|
|
- import { LightningElement } from 'lwc';
- import template from './baseStepNavigationComponent.html'
- import omniscriptStep from 'vlocity_cmt/omniscriptStep';
- // import { OmniscriptBaseMixin } from 'vlocity_cmt/omniscriptBaseMixin';
- import { dispatchOmniEvent } from 'vlocity_cmt/omniscriptUtils';
-
- export default class BaseStepNavigationComponent extends omniscriptStep {
-
- connectedCallback() {
- console.debug("BaseStepNavigationComponent - connected");
- }
-
- gotoNext() {
- dispatchOmniEvent(this, { moveToStep: 'next' }, 'omniautoadvance');
- }
-
- gotoPrev() {
- try {
- let jsDef = JSON.parse(JSON.stringify(this.jsonDef));
- let idx = jsDef.indexInParent;
- // console.debug('gotoPrev stepIndex', idx);
- dispatchOmniEvent(this, { moveToStep: idx - 1 }, 'omniautoadvance');
- } catch (e) {
- console.debug("Could not parse jsonDef to get previous step index!", e);
- }
- }
-
- render() {
- return template;
- }
- }
|