Package Exports
- angular-walkthrough
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (angular-walkthrough) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Walkthrough
This Angular model is inspired in part by ng-walkthrough for AngularJS.
Installation
npm install angular-walkthroughRequirements
- Angular 5.0.0 and more
- Angular/cdk 2.0.0-beta.12
Demo
Usage
ng-walkthrough attributes
All attributes are optional.
id: HTML id.
Output events
ready: fired when the walkthrough is completely readyclosed: fired when the walkthrough has been closed. It sends a boolean value set to true if the walkthrough has been closed with the "finishStep" button.finished: fired when the walkthrough has been finished, which means : closed on last step.
Focus zone:
focusElementSelector: CSS selector for focus a HTML element. If the selector detect more that one, the only the first will be chosen.focusElementCSSClass: Add a class on focusElement (optional)focusHighlightAnimation:truefor show highlight animation on the focus element. By defautfalse.focusBackdrop:truefor show a dark backdrop around the focus element. By defautfalse.focusGlow:truefor show a glow on the focus element. By defautfalse.focusAction: add an actionclickon the highlight zone.typeSelector: type of selection. Two modes possible:element(one unique HMLT element),zone(a zone with contains the first and last element). By defaut :element.radius: apply a “borderRadius” on highlight zone. Ifnumberthe value as change in percent. Ifautouse the focused element borderRadius. If it's a simplestring, use it without changes. By defaut, no radius.
Content:
contentTemplate: add ang-templatewith your description.contentText: show a simple description without formating in content.contentStyle: background style for content container. Possible values:none,darken. By defaut :darken.justifyContent: align thecontentTemplate. Possible values:left,centerorright. By defaut :left.
Navigation:
previousStep: add a ling to go to the previousng-walkthrough.nextStep: add a ling to go to the nextng-walkthrough.closeButton:truefor show the button. By defautfalse.closeAnywhere:falsefor click anywhere to close. By defauttrue.finishStep:truefor show a link to exit. By defautfalse.texts: change texts. It's a overlay ofWalkthroughText.
Arrow:
showArrow:truefor show the arrow. By defautfalse.arrowColor: change the arrow color. By defaut#FFF.
ng-walkthrough-flow attributes
All attributes are optional and not overriding the subcomponents attributes except previousStep, nextStep and finishStep that will be ignored.
id: HTML id.
Output events
closed: fired when a walkthrough has been closed. It sends a boolean value set to true if the walkthrough has been closed with the "finishStep" button.finished: fired when the last walkthrough has been closed.
Focus zone:
focusHighlightAnimation:truefor show highlight animation on the focus element.focusBackdrop:truefor show a dark backdrop around the focus element.focusGlow:truefor show a glow on the focus element.radius: apply a “borderRadius” on highlight zone. Ifnumberthe value as change in percent. Ifautouse the focused element borderRadius. If it's a simplestring, use it without changes.
Content:
contentStyle: background style for content container. Possible values:none,darken.
Navigation:
closeButton:truefor show the button.closeAnywhere:falsefor for click anywhere to close.texts: change texts. It's a overlay ofWalkthroughText.
Arrow:
showArrow:truefor show the arrow. By defautfalse.arrowColor: change the arrow color. By defaut#FFF.
Change texts
It's possible to change all texts. With the texts directive attribute.
WalkthroughText {
previous = 'Previous';
next = 'Next';
close = 'Close';
}Example
Highlighting #selectorId element with example text in ng-template.
<ng-walkthrough
id="wt-test"
focusElementSelector="#selectorId"
focusBackdrop="true"
[contentTemplate]="template"
closeButton="true">
<ng-template #template>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit...
</p>
</ng-template>
</ng-walkthrough>Example of scenario with ng-walkthrough-flow:
<ng-walkthrough-flow #walkFlow
id="wt-test-flow"
focusBackdrop="true"
focusHighlightAnimation="true"
closeButton="true"
closeAnywhere="false"
showArrow="true"
radius="auto"
[texts]="frenchText">
<ng-walkthrough
id="wt-test1-flow"
focusElementSelector="#test1"
[contentText]="Lorem ipsum dolor sit amet, consectetur adipiscing elit...">
</ng-walkthrough>
<ng-walkthrough
id="wt-test2-flow"
focusElementSelector="#test2"
[contentText]="Lorem ipsum dolor sit amet, consectetur adipiscing elit...">
</ng-walkthrough>
<ng-walkthrough
id="wt-test3-flow"
focusElementSelector="#test3"
closeButton="true"
[contentText]="Lorem ipsum dolor sit amet, consectetur adipiscing elit...">
</ng-walkthrough>
</ng-walkthrough-flow>For more examples, see examples/example.component.html.
License
Like Angular, this module is released under the permissive MIT license. Your contributions are always welcome.