new AppMainFragment(args)
MainRouter used to allow main fragment to request for routing to children
Parameters:
Name | Type | Description |
---|---|---|
args |
AppMainFragmentConstructorArgs |
- Source:
Members
localRoutingInfos :Array.<LocalFragmentRoutingInfo>
Type:
- Array.<LocalFragmentRoutingInfo>
- Source:
mainRouter :MainRouter
Type:
- Source:
timedFunctionsUtils
- Source:
updatedQueryParamsList :UpdatedQueryParams
Type:
- UpdatedQueryParams
- Source:
viewID :string
Considering changing this to path unique value. More dynamic. So, passed dynamically on build. Only problem if fragment not reinflating? test with view panel
Type:
- string
- Source:
viewPanelsManager :ViewPanelsManagerInstance
Type:
- ViewPanelsManagerInstance
- Source:
Methods
bindLocalRoutingInfoToNavigation()
Uses the local routing information to bind navigational controls and their on click actions
Leave implementation as super
- Source:
bindNewUIToDOM(newUITemplate)
Internal. DO NOT OVERRIDE
Avoid asynchronous calls here, before UI is bound to the DOM.
Might lead to unexpected behavior with child fragments
Parameters:
Name | Type | Description |
---|---|---|
newUITemplate |
string |
- Source:
bindUIListeners(isServerSideRender)
Leave implementation as super.
Parameters:
Name | Type | Description |
---|---|---|
isServerSideRender |
boolean | Flag whether the view had been rendered freshly in fragment |
- Source:
buildNormalizedUpdatedQueryParamsList(queryParams) → {UpdatedQueryParams}
Extract the parameter and query names and add them to the list of params and queries to watch
Parameters:
Name | Type | Description |
---|---|---|
queryParams |
UpdatedQueryParams |
- Source:
Returns:
- Type
- UpdatedQueryParams
checkQueryParamsUpdates(routeParams) → {UpdatedQueryParams}
Leave implementation as super
Checks if you have to update your locals
Parameters:
Name | Type | Description |
---|---|---|
routeParams |
RouteParams |
- Source:
Returns:
- Type
- UpdatedQueryParams
defaultSaveState(myData) → {SavedFragmentState}
Parameters:
Name | Type | Description |
---|---|---|
myData |
MyDataFragmentState |
- Source:
Returns:
- Type
- SavedFragmentState
destroyFragment(cb)
Internal. Do not override
Parameters:
Name | Type | Description |
---|---|---|
cb |
fragmentDestroyCb |
- Source:
detachViewFromDOM()
Removes the view from DOM.
Override this is if you wish for a different behavior or animate the view before removing it
from DOM by calling super
- Source:
getContentNode() → {HTMLElement}
- Source:
Returns:
- Type
- HTMLElement
getLifeCycleObject() → {FragmentLifeCycleInstance}
- Source:
Returns:
- Type
- FragmentLifeCycleInstance
getMainFragmentComponent() → {MainFragmentComponent}
Internal
- Source:
Returns:
- Type
- MainFragmentComponent
getScrollParent() → {HTMLElement}
Override to specify a different scroll parent
- Source:
Returns:
- Type
- HTMLElement
getSpecSavedState(savedState) → {ExtSpecSavedFragmentState}
Parameters:
Name | Type | Description |
---|---|---|
savedState |
SavedFragmentState |
- Source:
Returns:
- Type
- ExtSpecSavedFragmentState
(async) initializeView(builderCb)
Override as developer
Initializes the view for the fragment. You can source it remotely using a promise (you must wait for this promise)
or use a template already shipped in the code
Override and use appropriately
Finally, call onViewInitSuccess with the view as plain text html
Parameters:
Name | Type | Description |
---|---|---|
builderCb |
initViewBuilderCb |
- Source:
isViewInitialized() → {boolean}
Check whether the view for the fragment has been initialized/loaded or not.
- Source:
Returns:
Whether the view for this fragment has been initialized or not
- Type
- boolean
loadRemoteUI(reqOptions) → {Promise.<string>}
Loads a remote UI resource in plain text
Parameters:
Name | Type | Description |
---|---|---|
reqOptions |
RequestOptions |
- Source:
Returns:
A promise that resolves with the ui template in plain text html
- Type
- Promise.<string>
maintainFragment(routingPipelineCb)
Leave implementation as super
Call if you want to maintain the fragment
Parameters:
Name | Type | Description |
---|---|---|
routingPipelineCb |
routingPipelineConsentCb |
- Source:
onBindView(uiTemplate, builderCb)
Called to bind view
Parameters:
Name | Type | Description |
---|---|---|
uiTemplate |
string | |
builderCb |
genericFunction |
- Source:
onBindViewUtils(serverSideRendered, builderCb)
Called to bind view listeners
Parameters:
Name | Type | Description |
---|---|---|
serverSideRendered |
boolean | |
builderCb |
genericFunction |
- Source:
onFragmentConsent(routingPipelineCb, newRouteInfo)
Tell whether the fragment can be destroyed or not
Override and call super if you're okay destroying. Else call maintainFragment()
Parameters:
Name | Type | Description |
---|---|---|
routingPipelineCb |
routingPipelineConsentCb | |
newRouteInfo |
NewRouteConsentInfo |
- Source:
onInitView(activeRoute, builderCb)
Called to initialize view.
First build stage
Parameters:
Name | Type | Description |
---|---|---|
activeRoute |
string | |
builderCb |
initViewBuilderCb |
- Source:
(async) onQueryParamsDataUpdate(updatedQueryParams, data, savedState, routeParams, isServerSideopt)
Called with updated queries and params, data from the route call, and the savedState
Override to check updates to query params, data sent through the route call, and saved state
Call super to properly trigger routeBuilt view panel builds. restore state?? Do so individually
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
updatedQueryParams |
UpdatedQueryParams | ||
data |
Object | ||
savedState |
ExtSpecSavedFragmentState | ||
routeParams |
RouteParams | ||
isServerSide |
boolean |
<optional> |
- Source:
onUIBind(serverSideRendered)
Override. Process attached view. For instance, add listeners
Parameters:
Name | Type | Description |
---|---|---|
serverSideRendered |
boolean | Flag whether the current view had been server side rendered |
- Source:
onUpdateParams(routeParams, data, savedState, buildCb, isServerSideopt)
DO NOT RUN THIS ASYNCHRONOUSLY
Will mess up dry update params builds where we lock flow in main thread since no data job is being done
So, CALLBACK NOT FOR ASYNCHRONOUS REASONS
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
routeParams |
RouteParams | ||
data |
Object | ||
savedState |
ExtSpecSavedFragmentState | ||
buildCb |
genericFunction | ||
isServerSide |
boolean |
<optional> |
- Source:
onViewInitFail(err, cb)
Call if you encounter some error loading the view
Modify to tell router that building the route failed
ACTUALLY, with the new pipeline, will add a fallback to show error and user can retry and build can continue
YES. Otherwise, allow them to navigate elsewhere. Pipeline not superlocked so can do that
Parameters:
Name | Type | Description |
---|---|---|
err |
object | The loading error |
cb |
initViewBuilderCb |
- Source:
onViewInitSuccess(uiAsHTMLText, builderCb)
Call after the UI has been loaded successfully to start binding to DOM
DO NOT OVERRIDE
Parameters:
Name | Type | Description |
---|---|---|
uiAsHTMLText |
string | |
builderCb |
initViewBuilderCb |
- Source:
requestDirectViewPanelBuild(viewPanelBuilder, launchViewPanelParams)
Call if you want to open a view panel directly given its builder.
If launched by panel name only, supply it in queries format. Still works
Parameters:
Name | Type | Description |
---|---|---|
viewPanelBuilder |
ViewPanelBuilderInstance.<T, LD, HPD> | |
launchViewPanelParams |
LaunchViewPanelParams.<LD, HPD> |
- Source:
Returns:
requestViewPanelBuildByName(panelName, args)
Call if you want to open a view panel by panel name
Parameters:
Name | Type | Description |
---|---|---|
panelName |
string | |
args |
LaunchViewPanelParams.<T, RD> |
- Source:
Returns:
restoreState(savedState)
Automatic scroll restoration only done for last in node. Done in MainRoutingPipeline. Done in reference to body
Call this if you're doing it on a different parent with a unique id
Parameters:
Name | Type | Description |
---|---|---|
savedState |
ExtSpecSavedFragmentState |
- Source:
saveState() → {SavedFragmentState}
Override if you want to save state.
return value from defaultSaveState() with your data as the argument
- Source:
Returns:
- Type
- SavedFragmentState
setCurrentlyActiveNavigation(navBtnIdopt)
Set the navigational control that is currently active
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
navBtnId |
string |
<optional> |
The ID of the currently active nav button. If none is provided, the algo will pick based on the currently active route |
- Source:
triggerNavigationalRouting(navBtnId, route)
Triggers the app's routing based on a navigational control click
Override if you want to perform some custom operation
Calling super confirms routing. Note that onDestroyView won't be necessarily called depending on route changes
Parameters:
Name | Type | Description |
---|---|---|
navBtnId |
string | |
route |
string |
- Source:
triggerViewPanelRouting(route)
Parameters:
Name | Type | Description |
---|---|---|
route |
string |
- Source: