Examples of Vlocity/SF LWC components (in various states of working)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1019 B

  1. import { LightningElement } from 'lwc';
  2. import template from './baseStepNavigationComponent.html'
  3. import omniscriptStep from 'vlocity_cmt/omniscriptStep';
  4. // import { OmniscriptBaseMixin } from 'vlocity_cmt/omniscriptBaseMixin';
  5. import { dispatchOmniEvent } from 'vlocity_cmt/omniscriptUtils';
  6. export default class BaseStepNavigationComponent extends omniscriptStep {
  7. connectedCallback() {
  8. console.debug("BaseStepNavigationComponent - connected");
  9. }
  10. gotoNext() {
  11. dispatchOmniEvent(this, { moveToStep: 'next' }, 'omniautoadvance');
  12. }
  13. gotoPrev() {
  14. try {
  15. let jsDef = JSON.parse(JSON.stringify(this.jsonDef));
  16. let idx = jsDef.indexInParent;
  17. // console.debug('gotoPrev stepIndex', idx);
  18. dispatchOmniEvent(this, { moveToStep: idx - 1 }, 'omniautoadvance');
  19. } catch (e) {
  20. console.debug("Could not parse jsonDef to get previous step index!", e);
  21. }
  22. }
  23. render() {
  24. return template;
  25. }
  26. }