libs/ngx-pfe/models/ngx-pfe-page-config.model.ts
The page config contains specific configuration attributes for every available page types.
This is done, in this way, to allow the usage of the JSON Schema. Separate types would produce separate schemas.
This interface has to be extended by the application using the PFE with its custom pages.
Configuration examples for each page type can be found in the fnol-config repository in the demo_app branch.
Properties |
|
disableAnimations |
disableAnimations:
|
Type : boolean
|
Optional |
Disables the transition animation between pages |
guards |
guards:
|
Type : GuardOptions<T>
|
Optional |
Specify guards on a specific page. |
hideBackButton |
hideBackButton:
|
Type : boolean
|
Optional |
Hide the back button on this page. This attribute is optional. The default is false. |
hideNextButton |
hideNextButton:
|
Type : boolean
|
Optional |
Hide the next button on this page. This attribute is optional. The default is false. |
linkBackButton |
linkBackButton:
|
Type : boolean
|
Optional |
Display the back button as a link instead of a button. |
linkNextButton |
linkNextButton:
|
Type : boolean
|
Optional |
Display the next button as a link instead of a button. |
nextBtnOptionalLabel |
nextBtnOptionalLabel:
|
Type : string
|
Optional |
Can be used to change the translation key with ngx-translate or any other dynamic translation tool/library. Can not be used for dynamic translation keys with the native Angular translation or any other static translation tool/library. |
nextBtnOptionalLabelCondition |
nextBtnOptionalLabelCondition:
|
Type : ExpressionCondition[]
|
Optional |
Can be used to change the translation key with ngx-translate or any other dynamic translation tool/library. Can not be used for dynamic translation keys with the native Angular translation or any other static translation tool/library. |
nxBackText |
nxBackText:
|
Type : string
|
Optional |
Specificy a label of the Back button on a specific page. Can be used to change the translation key with ngx-translate or any other dynamic translation tool/library. Can not be used for dynamic translation keys with the native Angular translation or any other static translation tool/library. |
nxNextText |
nxNextText:
|
Type : string
|
Optional |
Specify a label of the Next button on a specific page. Can be used to change the translation key with ngx-translate or any other dynamic translation tool/library. Can not be used for dynamic translation keys with the native Angular translation or any other static translation tool/library. |
pageId |
pageId:
|
Type : PageId
|
The pageID is a unique ID, that is used to reference to a page instance on other locations, like the navigation configuration. |
updateStateValues |
updateStateValues:
|
Type : StateUpdates[]
|
Optional |
List of possibles userInputState updates |
import { PfeActionConfig } from '../pfe-actions/pfe-actions.model';
import { AppConfiguration } from './app-configuration.model';
import { PfeGlobalConfig } from './global-config.model';
import { PageId, PfeNavigationConfiguration, StateUpdates } from './navigation-config.model';
import { ExpressionCondition } from '../pfe-conditions/rules-evaluator';
/**
* The NgxPfeConfig contains two generics:
* APP_CONFIG_TYPE: Allows it to set the extended appConfiguration type.
* PAGE_CONFIG_TYPE: Allows it to set the extended pagesConfiguration type.
*
* @export
*/
export interface NgxPfeConfig<
APP_CONFIG_TYPE extends AppConfiguration = AppConfiguration,
PAGE_CONFIG_TYPE extends PageConfig = PageConfig,
ACTIONS_CONFIG_TYPE = PfeActionConfig,
> {
appConfiguration?: APP_CONFIG_TYPE;
pagesConfiguration: PAGE_CONFIG_TYPE[];
navConfiguration: PfeNavigationConfiguration<ACTIONS_CONFIG_TYPE>;
globalConfiguration?: PfeGlobalConfig<ACTIONS_CONFIG_TYPE>;
}
/**
* The page config contains specific configuration attributes
* for every available page types.
*
* This is done, in this way, to allow the usage of the JSON Schema. Separate types would produce separate schemas.
*
* This interface has to be extended by the application using the PFE with its custom pages.
*
* Configuration examples for each page type can be found in the fnol-config repository in the demo_app branch.
*
* @export
*/
export interface PageConfig<T = string> {
/**
* The pageID is a unique ID, that is used to reference to a
* page instance on other locations, like the navigation configuration.
*/
pageId: PageId;
/**
* Hide the next button on this page.
* This attribute is optional. The default is false.
*/
hideNextButton?: boolean;
/**
* Hide the back button on this page.
* This attribute is optional. The default is false.
*/
hideBackButton?: boolean;
/**
* Display the back button as a link instead of a button.
*/
linkBackButton?: boolean;
/**
* Display the next button as a link instead of a button.
*/
linkNextButton?: boolean;
/**
* Specify a label of the Next button on a specific page.
* Can be used to change the translation key with ngx-translate or any other dynamic translation tool/library.
* Can not be used for dynamic translation keys with the native Angular translation or any other static translation tool/library.
*/
nxNextText?: string;
/**
* Specificy a label of the Back button on a specific page.
* Can be used to change the translation key with ngx-translate or any other dynamic translation tool/library.
* Can not be used for dynamic translation keys with the native Angular translation or any other static translation tool/library.
*/
nxBackText?: string;
/**
* Can be used to change the translation key with ngx-translate or any other dynamic translation tool/library.
* Can not be used for dynamic translation keys with the native Angular translation or any other static translation tool/library.
*/
nextBtnOptionalLabel?: string;
/**
* Can be used to change the translation key with ngx-translate or any other dynamic translation tool/library.
* Can not be used for dynamic translation keys with the native Angular translation or any other static translation tool/library.
*/
nextBtnOptionalLabelCondition?: ExpressionCondition[];
/**
* Specify guards on a specific page.
*/
guards?: GuardOptions<T>;
/**
* Disables the transition animation between pages
*/
disableAnimations?: boolean;
/**
* List of possibles userInputState updates
*/
updateStateValues?: StateUpdates[];
}
/**
* This object could define the 4 different possibilities that route object of angular support
* https://angular.io/guide/router#milestone-5-route-guards
*/
export interface GuardOptions<T = string> {
canActivate?: T[];
canActivateChild?: T[];
canDeactivate?: T[];
canLoad?: T[];
canMatch?: T[];
}