@syncfusion/ej2-navigations 23.2.5 → 24.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/ej2-navigations.min.js +2 -2
  3. package/dist/ej2-navigations.umd.min.js +2 -2
  4. package/dist/ej2-navigations.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-navigations.es2015.js +1351 -22
  6. package/dist/es6/ej2-navigations.es2015.js.map +1 -1
  7. package/dist/es6/ej2-navigations.es5.js +1399 -22
  8. package/dist/es6/ej2-navigations.es5.js.map +1 -1
  9. package/dist/global/ej2-navigations.min.js +2 -2
  10. package/dist/global/ej2-navigations.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +12 -12
  13. package/src/breadcrumb/breadcrumb.js +6 -1
  14. package/src/carousel/carousel.js +3 -3
  15. package/src/common/menu-base.js +4 -0
  16. package/src/index.d.ts +2 -0
  17. package/src/index.js +2 -0
  18. package/src/stepper/index.d.ts +3 -0
  19. package/src/stepper/index.js +2 -0
  20. package/src/stepper/stepper-model.d.ts +153 -0
  21. package/src/stepper/stepper.d.ts +339 -0
  22. package/src/stepper/stepper.js +1149 -0
  23. package/src/stepper-base/index.d.ts +5 -0
  24. package/src/stepper-base/index.js +4 -0
  25. package/src/stepper-base/stepper-base-model.d.ts +121 -0
  26. package/src/stepper-base/stepper-base.d.ts +184 -0
  27. package/src/stepper-base/stepper-base.js +221 -0
  28. package/src/tab/tab.js +0 -1
  29. package/src/toolbar/toolbar.js +4 -0
  30. package/src/treeview/treeview.js +10 -15
  31. package/stepper-base.d.ts +4 -0
  32. package/stepper-base.js +4 -0
  33. package/stepper.d.ts +4 -0
  34. package/stepper.js +4 -0
  35. package/styles/bootstrap-dark.css +753 -1
  36. package/styles/bootstrap-dark.scss +1 -0
  37. package/styles/bootstrap.css +753 -1
  38. package/styles/bootstrap.scss +1 -0
  39. package/styles/bootstrap4.css +753 -1
  40. package/styles/bootstrap4.scss +1 -0
  41. package/styles/bootstrap5-dark.css +754 -2
  42. package/styles/bootstrap5-dark.scss +1 -0
  43. package/styles/bootstrap5.css +754 -2
  44. package/styles/bootstrap5.scss +1 -0
  45. package/styles/fabric-dark.css +752 -0
  46. package/styles/fabric-dark.scss +1 -0
  47. package/styles/fabric.css +752 -0
  48. package/styles/fabric.scss +1 -0
  49. package/styles/fluent-dark.css +753 -1
  50. package/styles/fluent-dark.scss +1 -0
  51. package/styles/fluent.css +753 -1
  52. package/styles/fluent.scss +1 -0
  53. package/styles/highcontrast-light.css +753 -1
  54. package/styles/highcontrast-light.scss +1 -0
  55. package/styles/highcontrast.css +753 -1
  56. package/styles/highcontrast.scss +1 -0
  57. package/styles/material-dark.css +753 -1
  58. package/styles/material-dark.scss +1 -0
  59. package/styles/material.css +753 -1
  60. package/styles/material.scss +1 -0
  61. package/styles/material3-dark.css +752 -0
  62. package/styles/material3-dark.scss +1 -0
  63. package/styles/material3.css +752 -0
  64. package/styles/material3.scss +1 -0
  65. package/styles/pager/_bootstrap-dark-definition.scss +16 -0
  66. package/styles/pager/_bootstrap-definition.scss +16 -0
  67. package/styles/pager/_bootstrap4-definition.scss +16 -0
  68. package/styles/pager/_bootstrap5-definition.scss +16 -0
  69. package/styles/pager/_fabric-dark-definition.scss +16 -0
  70. package/styles/pager/_fabric-definition.scss +16 -0
  71. package/styles/pager/_fluent-definition.scss +16 -0
  72. package/styles/pager/_fusionnew-definition.scss +16 -0
  73. package/styles/pager/_highcontrast-definition.scss +16 -0
  74. package/styles/pager/_highcontrast-light-definition.scss +16 -0
  75. package/styles/pager/_layout.scss +114 -0
  76. package/styles/pager/_material-dark-definition.scss +16 -0
  77. package/styles/pager/_material-definition.scss +16 -0
  78. package/styles/pager/_material3-definition.scss +16 -0
  79. package/styles/pager/_tailwind-definition.scss +16 -0
  80. package/styles/pager/bootstrap-dark.css +107 -0
  81. package/styles/pager/bootstrap.css +107 -0
  82. package/styles/pager/bootstrap4.css +107 -0
  83. package/styles/pager/bootstrap5-dark.css +107 -0
  84. package/styles/pager/bootstrap5.css +107 -0
  85. package/styles/pager/fabric-dark.css +107 -0
  86. package/styles/pager/fabric.css +107 -0
  87. package/styles/pager/fluent-dark.css +107 -0
  88. package/styles/pager/fluent.css +107 -0
  89. package/styles/pager/highcontrast-light.css +107 -0
  90. package/styles/pager/highcontrast.css +107 -0
  91. package/styles/pager/material-dark.css +107 -0
  92. package/styles/pager/material.css +107 -0
  93. package/styles/pager/material3-dark.css +107 -0
  94. package/styles/pager/material3.css +107 -0
  95. package/styles/pager/tailwind-dark.css +107 -0
  96. package/styles/pager/tailwind.css +107 -0
  97. package/styles/stepper/_all.scss +2 -0
  98. package/styles/stepper/_bootstrap-dark-definition.scss +78 -0
  99. package/styles/stepper/_bootstrap-definition.scss +78 -0
  100. package/styles/stepper/_bootstrap4-definition.scss +78 -0
  101. package/styles/stepper/_bootstrap5-dark-definition.scss +1 -0
  102. package/styles/stepper/_bootstrap5-definition.scss +79 -0
  103. package/styles/stepper/_fabric-dark-definition.scss +78 -0
  104. package/styles/stepper/_fabric-definition.scss +78 -0
  105. package/styles/stepper/_fluent-dark-definition.scss +1 -0
  106. package/styles/stepper/_fluent-definition.scss +78 -0
  107. package/styles/stepper/_fusionnew-definition.scss +78 -0
  108. package/styles/stepper/_highcontrast-definition.scss +78 -0
  109. package/styles/stepper/_highcontrast-light-definition.scss +78 -0
  110. package/styles/stepper/_layout.scss +564 -0
  111. package/styles/stepper/_material-dark-definition.scss +78 -0
  112. package/styles/stepper/_material-definition.scss +78 -0
  113. package/styles/stepper/_material3-dark-definition.scss +1 -0
  114. package/styles/stepper/_material3-definition.scss +78 -0
  115. package/styles/stepper/_tailwind-dark-definition.scss +1 -0
  116. package/styles/stepper/_tailwind-definition.scss +78 -0
  117. package/styles/stepper/_theme.scss +223 -0
  118. package/styles/stepper/bootstrap-dark.css +644 -0
  119. package/styles/stepper/bootstrap-dark.scss +5 -0
  120. package/styles/stepper/bootstrap.css +644 -0
  121. package/styles/stepper/bootstrap.scss +5 -0
  122. package/styles/stepper/bootstrap4.css +644 -0
  123. package/styles/stepper/bootstrap4.scss +5 -0
  124. package/styles/stepper/bootstrap5-dark.css +644 -0
  125. package/styles/stepper/bootstrap5-dark.scss +5 -0
  126. package/styles/stepper/bootstrap5.css +644 -0
  127. package/styles/stepper/bootstrap5.scss +5 -0
  128. package/styles/stepper/fabric-dark.css +644 -0
  129. package/styles/stepper/fabric-dark.scss +5 -0
  130. package/styles/stepper/fabric.css +644 -0
  131. package/styles/stepper/fabric.scss +5 -0
  132. package/styles/stepper/fluent-dark.css +644 -0
  133. package/styles/stepper/fluent-dark.scss +5 -0
  134. package/styles/stepper/fluent.css +644 -0
  135. package/styles/stepper/fluent.scss +5 -0
  136. package/styles/stepper/highcontrast-light.css +644 -0
  137. package/styles/stepper/highcontrast-light.scss +5 -0
  138. package/styles/stepper/highcontrast.css +644 -0
  139. package/styles/stepper/highcontrast.scss +5 -0
  140. package/styles/stepper/icons/_bootstrap-dark.scss +5 -0
  141. package/styles/stepper/icons/_bootstrap.scss +5 -0
  142. package/styles/stepper/icons/_bootstrap4.scss +5 -0
  143. package/styles/stepper/icons/_bootstrap5-dark.scss +1 -0
  144. package/styles/stepper/icons/_bootstrap5.scss +5 -0
  145. package/styles/stepper/icons/_fabric-dark.scss +5 -0
  146. package/styles/stepper/icons/_fabric.scss +5 -0
  147. package/styles/stepper/icons/_fluent-dark.scss +1 -0
  148. package/styles/stepper/icons/_fluent.scss +5 -0
  149. package/styles/stepper/icons/_fusionnew.scss +5 -0
  150. package/styles/stepper/icons/_highcontrast-light.scss +5 -0
  151. package/styles/stepper/icons/_highcontrast.scss +5 -0
  152. package/styles/stepper/icons/_material-dark.scss +5 -0
  153. package/styles/stepper/icons/_material.scss +5 -0
  154. package/styles/stepper/icons/_material3-dark.scss +1 -0
  155. package/styles/stepper/icons/_material3.scss +5 -0
  156. package/styles/stepper/icons/_tailwind-dark.scss +1 -0
  157. package/styles/stepper/icons/_tailwind.scss +5 -0
  158. package/styles/stepper/material-dark.css +644 -0
  159. package/styles/stepper/material-dark.scss +5 -0
  160. package/styles/stepper/material.css +644 -0
  161. package/styles/stepper/material.scss +5 -0
  162. package/styles/stepper/material3-dark.css +699 -0
  163. package/styles/stepper/material3-dark.scss +6 -0
  164. package/styles/stepper/material3.css +755 -0
  165. package/styles/stepper/material3.scss +6 -0
  166. package/styles/stepper/tailwind-dark.css +644 -0
  167. package/styles/stepper/tailwind-dark.scss +5 -0
  168. package/styles/stepper/tailwind.css +644 -0
  169. package/styles/stepper/tailwind.scss +5 -0
  170. package/styles/tab/_bootstrap-dark-definition.scss +1 -1
  171. package/styles/tab/_bootstrap-definition.scss +1 -1
  172. package/styles/tab/_bootstrap4-definition.scss +1 -1
  173. package/styles/tab/_bootstrap5-definition.scss +3 -2
  174. package/styles/tab/_fluent-definition.scss +1 -1
  175. package/styles/tab/_fusionnew-definition.scss +1 -1
  176. package/styles/tab/_highcontrast-definition.scss +1 -1
  177. package/styles/tab/_highcontrast-light-definition.scss +1 -1
  178. package/styles/tab/_material-dark-definition.scss +1 -1
  179. package/styles/tab/_material-definition.scss +1 -1
  180. package/styles/tab/_theme.scss +6 -0
  181. package/styles/tab/bootstrap-dark.css +1 -1
  182. package/styles/tab/bootstrap.css +1 -1
  183. package/styles/tab/bootstrap4.css +1 -1
  184. package/styles/tab/bootstrap5-dark.css +2 -2
  185. package/styles/tab/bootstrap5.css +2 -2
  186. package/styles/tab/fluent-dark.css +1 -1
  187. package/styles/tab/fluent.css +1 -1
  188. package/styles/tab/highcontrast-light.css +1 -1
  189. package/styles/tab/highcontrast.css +1 -1
  190. package/styles/tab/material-dark.css +1 -1
  191. package/styles/tab/material.css +1 -1
  192. package/styles/tailwind-dark.css +752 -0
  193. package/styles/tailwind-dark.scss +1 -0
  194. package/styles/tailwind.css +752 -0
  195. package/styles/tailwind.scss +1 -0
@@ -1,6 +1,6 @@
1
1
  import { Animation, Browser, ChildProperty, Collection, Complex, Component, Draggable, Droppable, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, animationMode, append, attributes, classList, closest, compile, createElement, detach, extend, formatUnit, getElement, getInstance, getRandomId, getUniqueID, getValue, initializeCSPTemplate, isBlazor, isNullOrUndefined, isRippleEnabled, isUndefined, isVisible, matches, merge, remove, removeClass, rippleEffect, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
2
2
  import { ListBase } from '@syncfusion/ej2-lists';
3
- import { Popup, calculatePosition, createSpinner, fit, getScrollableParent, getZindexPartial, hideSpinner, isCollide, showSpinner } from '@syncfusion/ej2-popups';
3
+ import { Popup, Tooltip, calculatePosition, createSpinner, fit, getScrollableParent, getZindexPartial, hideSpinner, isCollide, showSpinner } from '@syncfusion/ej2-popups';
4
4
  import { Button, createCheckBox, rippleMouseHandler } from '@syncfusion/ej2-buttons';
5
5
  import { DataManager, Query } from '@syncfusion/ej2-data';
6
6
  import { Input } from '@syncfusion/ej2-inputs';
@@ -1262,6 +1262,10 @@ let MenuBase = class MenuBase extends Component {
1262
1262
  }
1263
1263
  }
1264
1264
  }
1265
+ else {
1266
+ this.element.parentElement.setAttribute('role', 'dialog');
1267
+ this.element.parentElement.setAttribute('aria-label', 'context menu');
1268
+ }
1265
1269
  }
1266
1270
  wireEvents() {
1267
1271
  const wrapper = this.getWrapper();
@@ -4044,6 +4048,10 @@ let Toolbar = class Toolbar extends Component {
4044
4048
  if (this.cssClass) {
4045
4049
  addClass([innerItems[0]], this.cssClass.split(' '));
4046
4050
  }
4051
+ const scrollEle = this.scrollModule.element.querySelector('.' + CLS_HSCROLLBAR$1 + ', .' + 'e-vscroll-bar');
4052
+ if (scrollEle) {
4053
+ scrollEle.removeAttribute('tabindex');
4054
+ }
4047
4055
  this.remove(this.scrollModule.element, CLS_TBARPOS);
4048
4056
  setStyleAttribute(this.element, { overflow: 'hidden' });
4049
4057
  }
@@ -8648,7 +8656,6 @@ let Tab = class Tab extends Component {
8648
8656
  const scrCnt = select('.' + this.scrCntClass, this.tbItems);
8649
8657
  if (!this.isVertical() && !isNullOrUndefined(scrCnt)) {
8650
8658
  const scrBar = select('.e-hscroll-bar', this.tbItems);
8651
- scrBar.removeAttribute('tabindex');
8652
8659
  const scrStart = scrBar.scrollLeft;
8653
8660
  const scrEnd = scrStart + scrBar.offsetWidth;
8654
8661
  const eleStart = target.offsetLeft;
@@ -10035,9 +10042,11 @@ let TreeView = TreeView_1 = class TreeView extends Component {
10035
10042
  setDisabledMode() {
10036
10043
  if (this.disabled) {
10037
10044
  this.element.classList.add(DISABLED$1);
10045
+ this.element.setAttribute('aria-disabled', 'true');
10038
10046
  }
10039
10047
  else {
10040
10048
  this.element.classList.remove(DISABLED$1);
10049
+ this.element.setAttribute('aria-disabled', 'false');
10041
10050
  }
10042
10051
  }
10043
10052
  setEnableRtl() {
@@ -10060,12 +10069,11 @@ let TreeView = TreeView_1 = class TreeView extends Component {
10060
10069
  (isEnabled ? addClass : removeClass)([this.element], FULLROWWRAP);
10061
10070
  }
10062
10071
  setMultiSelect(isEnabled) {
10063
- const firstUl = select('.' + PARENTITEM, this.element);
10064
10072
  if (isEnabled) {
10065
- firstUl.setAttribute('aria-multiselectable', 'true');
10073
+ this.element.setAttribute('aria-multiselectable', 'true');
10066
10074
  }
10067
10075
  else {
10068
- firstUl.removeAttribute('aria-multiselectable');
10076
+ this.element.setAttribute('aria-multiselectable', 'false');
10069
10077
  }
10070
10078
  }
10071
10079
  // eslint-disable-next-line
@@ -10430,7 +10438,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
10430
10438
  if (this.showCheckBox) {
10431
10439
  let checkboxEle = createCheckBox(this.createElement, true, { cssClass: this.touchClass });
10432
10440
  checkboxEle.setAttribute('role', 'checkbox');
10433
- checkboxEle.setAttribute('aria-label', 'checkbox');
10441
+ checkboxEle.setAttribute('aria-label', e.text);
10434
10442
  let icon = select('div.' + ICON, e.item);
10435
10443
  let id = e.item.getAttribute('data-uid');
10436
10444
  e.item.childNodes[0].insertBefore(checkboxEle, e.item.childNodes[0].childNodes[isNullOrUndefined(icon) ? 0 : 1]);
@@ -10686,17 +10694,11 @@ let TreeView = TreeView_1 = class TreeView extends Component {
10686
10694
  doCheckBoxAction(nodes, doCheck) {
10687
10695
  let li = selectAll('.' + LISTITEM, this.element);
10688
10696
  if (!isNullOrUndefined(nodes)) {
10689
- for (let len = nodes.length; len >= 0; len--) {
10690
- let liEle;
10691
- if (nodes.length === 1) {
10692
- liEle = this.getElement(nodes[len - 1]);
10693
- }
10694
- else {
10695
- liEle = this.getElement(nodes[len]);
10696
- }
10697
+ for (let len = nodes.length - 1; len >= 0; len--) {
10698
+ let liEle = this.getElement(nodes[len]);
10697
10699
  if (isNullOrUndefined(liEle)) {
10698
10700
  let node;
10699
- node = nodes[len - nodes.length] ? nodes[len - nodes.length].toString() : nodes[len] ? nodes[len].toString() : null;
10701
+ node = nodes[len - (nodes.length - 1)] ? nodes[len - (nodes.length - 1)].toString() : nodes[len] ? nodes[len].toString() : null;
10700
10702
  if (node !== '' && doCheck && node) {
10701
10703
  this.setValidCheckedNode(node);
10702
10704
  this.dynamicCheckState(node, doCheck);
@@ -10746,7 +10748,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
10746
10748
  }
10747
10749
  }
10748
10750
  if (nodes) {
10749
- for (let j = 0; j < nodes.length; j++) {
10751
+ for (let j = 0; j < nodes.length - 1; j++) {
10750
10752
  let node = nodes[j] ? nodes[j].toString() : '';
10751
10753
  if (!doCheck) {
10752
10754
  this.updateField(this.treeData, this.fields, node, 'isChecked', null);
@@ -14268,7 +14270,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
14268
14270
  this.isAnimate = false;
14269
14271
  this.isFieldChange = true;
14270
14272
  this.initialRender = true;
14271
- if (isNullOrUndefined(this.isReact) && !(this.fields.dataSource instanceof DataManager)) {
14273
+ if (!this.isReact || this.isReact && !(this.fields.dataSource instanceof DataManager)) {
14272
14274
  this.reRenderNodes();
14273
14275
  }
14274
14276
  this.initialRender = false;
@@ -15697,7 +15699,9 @@ let Breadcrumb = class Breadcrumb extends Component {
15697
15699
  }
15698
15700
  initialize() {
15699
15701
  this._maxItems = this.maxItems;
15700
- this.element.setAttribute('aria-label', 'breadcrumb');
15702
+ if (isNullOrUndefined(this.element.getAttribute('aria-label'))) {
15703
+ this.element.setAttribute('aria-label', 'breadcrumb');
15704
+ }
15701
15705
  if (this.cssClass) {
15702
15706
  addClass([this.element], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
15703
15707
  }
@@ -16024,6 +16028,9 @@ let Breadcrumb = class Breadcrumb extends Component {
16024
16028
  }
16025
16029
  beforeItemRenderChanges(prevItem, currItem, elem, isRightIcon) {
16026
16030
  const wrapElem = elem.querySelector('.e-anchor-wrap');
16031
+ if (wrapElem) {
16032
+ wrapElem.parentElement.setAttribute('aria-label', 'home');
16033
+ }
16027
16034
  if (currItem.text !== prevItem.text) {
16028
16035
  wrapElem.childNodes.forEach((child) => {
16029
16036
  if (child.nodeType === Node.TEXT_NODE) {
@@ -16648,7 +16655,7 @@ let Carousel = class Carousel extends Component {
16648
16655
  }
16649
16656
  addClass([this.element], carouselClasses);
16650
16657
  setStyleAttribute(this.element, { 'width': formatUnit(this.width), 'height': formatUnit(this.height) });
16651
- attributes(this.element, { 'tabindex': '0', 'role': 'group', 'aria-roledescription': 'carousel', 'aria-label': this.localeObj.getConstant('slideShow') });
16658
+ attributes(this.element, { 'role': 'group', 'aria-roledescription': 'carousel', 'aria-label': this.localeObj.getConstant('slideShow') });
16652
16659
  if (!isNullOrUndefined(this.htmlAttributes)) {
16653
16660
  this.setHtmlAttributes(this.htmlAttributes, this.element);
16654
16661
  }
@@ -16656,7 +16663,7 @@ let Carousel = class Carousel extends Component {
16656
16663
  renderSlides() {
16657
16664
  let slideContainer = this.element.querySelector('.' + CLS_SLIDE_CONTAINER);
16658
16665
  if (!slideContainer) {
16659
- slideContainer = this.createElement('div', { className: CLS_SLIDE_CONTAINER });
16666
+ slideContainer = this.createElement('div', { className: CLS_SLIDE_CONTAINER, attrs: { 'tabindex': '0', 'role': 'tabpanel' } });
16660
16667
  this.element.appendChild(slideContainer);
16661
16668
  }
16662
16669
  this.itemsContainer = this.createElement('div', { className: CLS_ITEMS$2, attrs: { 'aria-live': this.autoPlay ? 'off' : 'polite' } });
@@ -17551,7 +17558,7 @@ let Carousel = class Carousel extends Component {
17551
17558
  this.unWireEvents();
17552
17559
  [].slice.call(this.element.children).forEach((ele) => { this.element.removeChild(ele); });
17553
17560
  removeClass([this.element], [CLS_CAROUSEL, this.cssClass, CLS_RTL$5, CLS_SWIPE]);
17554
- ['tabindex', 'role', 'style'].forEach((attr) => { this.element.removeAttribute(attr); });
17561
+ ['role', 'style'].forEach((attr) => { this.element.removeAttribute(attr); });
17555
17562
  this.itemsContainer = null;
17556
17563
  super.destroy();
17557
17564
  }
@@ -17843,9 +17850,1331 @@ AppBar = __decorate$12([
17843
17850
 
17844
17851
  /** AppBar export modules */
17845
17852
 
17853
+ var __decorate$13 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
17854
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
17855
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17856
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
17857
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
17858
+ };
17859
+ const PROGRESSVALUE = '--progress-value';
17860
+ /**
17861
+ * Defines the status of the step.
17862
+ */
17863
+ var StepStatus;
17864
+ (function (StepStatus) {
17865
+ /**
17866
+ * Shows the status of the step is not started.
17867
+ */
17868
+ StepStatus["NotStarted"] = "NotStarted";
17869
+ /**
17870
+ * Shows the step is in progress.
17871
+ */
17872
+ StepStatus["InProgress"] = "InProgress";
17873
+ /**
17874
+ * Shows the status of the step is completed.
17875
+ */
17876
+ StepStatus["Completed"] = "Completed";
17877
+ })(StepStatus || (StepStatus = {}));
17878
+ /**
17879
+ * Specifies the steps of the Stepper.
17880
+ */
17881
+ class Step extends ChildProperty {
17882
+ }
17883
+ __decorate$13([
17884
+ Property('')
17885
+ ], Step.prototype, "cssClass", void 0);
17886
+ __decorate$13([
17887
+ Property(false)
17888
+ ], Step.prototype, "disabled", void 0);
17889
+ __decorate$13([
17890
+ Property('')
17891
+ ], Step.prototype, "iconCss", void 0);
17892
+ __decorate$13([
17893
+ Property(null)
17894
+ ], Step.prototype, "isValid", void 0);
17895
+ __decorate$13([
17896
+ Property('')
17897
+ ], Step.prototype, "label", void 0);
17898
+ __decorate$13([
17899
+ Property(false)
17900
+ ], Step.prototype, "optional", void 0);
17901
+ __decorate$13([
17902
+ Property(StepStatus.NotStarted)
17903
+ ], Step.prototype, "status", void 0);
17904
+ __decorate$13([
17905
+ Property('')
17906
+ ], Step.prototype, "text", void 0);
17907
+ /**
17908
+ * Defines the orientation type of the Stepper.
17909
+ */
17910
+ var StepperOrientation;
17911
+ (function (StepperOrientation) {
17912
+ /**
17913
+ * Steps are displayed horizontally.
17914
+ */
17915
+ StepperOrientation["Horizontal"] = "Horizontal";
17916
+ /**
17917
+ * Steps are displayed vertically.
17918
+ */
17919
+ StepperOrientation["Vertical"] = "Vertical";
17920
+ })(StepperOrientation || (StepperOrientation = {}));
17921
+ /**
17922
+ * StepperBase component act as base class to the stepper component.
17923
+ */
17924
+ let StepperBase = class StepperBase extends Component {
17925
+ /**
17926
+ * * Constructor for Base class
17927
+ *
17928
+ * @param {StepperBaseModel} options - Specifies the Base model.
17929
+ * @param {string | HTMLElement} element - Specifies the element to render as component.
17930
+ * @private
17931
+ */
17932
+ constructor(options, element) {
17933
+ super(options, element);
17934
+ }
17935
+ /**
17936
+ * This method is abstract member of the Component<HTMLElement>.
17937
+ *
17938
+ * @private
17939
+ * @returns {void}
17940
+ */
17941
+ preRender() {
17942
+ }
17943
+ /**
17944
+ * This method is abstract member of the Component<HTMLElement>.
17945
+ *
17946
+ * @private
17947
+ * @returns {string}
17948
+ */
17949
+ getModuleName() {
17950
+ return 'stepperBase';
17951
+ }
17952
+ /**
17953
+ * This method is abstract member of the Component<HTMLElement>.
17954
+ *
17955
+ * @private
17956
+ * @returns {string}
17957
+ */
17958
+ getPersistData() {
17959
+ return this.addOnPersist([]);
17960
+ }
17961
+ /**
17962
+ * This method is abstract member of the Component<HTMLElement>.
17963
+ *
17964
+ * @private
17965
+ * @returns {void}
17966
+ */
17967
+ render() {
17968
+ }
17969
+ updateOrientaion(wrapper) {
17970
+ if (wrapper.classList.contains('e-horizontal') || wrapper.classList.contains('e-vertical')) {
17971
+ wrapper.classList.contains('e-horizontal') ? wrapper.classList.remove('e-horizontal') : wrapper.classList.remove('e-vertical');
17972
+ }
17973
+ wrapper.classList.add('e-' + this.orientation.toLocaleLowerCase());
17974
+ }
17975
+ renderProgressBar(wrapper) {
17976
+ this.progressStep = this.createElement('div', { className: 'e-stepper-progressbar' });
17977
+ this.progressbar = this.createElement('div', { className: 'e-progressbar-value' });
17978
+ this.progressStep.appendChild(this.progressbar);
17979
+ wrapper.prepend(this.progressStep);
17980
+ this.progressbar.style.setProperty(PROGRESSVALUE, (0) + '%');
17981
+ const beforeLabel = (wrapper.querySelector('li').querySelector('.e-step-label-container'));
17982
+ if (wrapper.classList.contains('e-vertical')) {
17983
+ if (wrapper.classList.contains('e-label-bottom') || wrapper.classList.contains('e-label-top')) {
17984
+ const stepsContainer = (wrapper.querySelector('.e-stepper-steps'));
17985
+ this.progressStep.style.setProperty('--progress-position', (stepsContainer.offsetWidth / 2) + 'px');
17986
+ }
17987
+ else {
17988
+ this.progressStep.style.setProperty('--progress-position', ((this.progressBarPosition / 2) - 1) + 'px');
17989
+ }
17990
+ }
17991
+ if (beforeLabel && (beforeLabel.classList.contains('e-label-before'))) {
17992
+ this.progressStep.style.setProperty('--progress-position', (((this.progressBarPosition) - 1)) + 5 + 'px');
17993
+ }
17994
+ if (wrapper.classList.contains('e-horizontal')) {
17995
+ this.setProgressPosition(wrapper);
17996
+ }
17997
+ }
17998
+ setProgressPosition(wrapper, isResize) {
17999
+ const stepItemContainer = (wrapper.querySelector('.e-step-container'));
18000
+ const stepItemEle = stepItemContainer.firstElementChild;
18001
+ if (isResize != true) {
18002
+ let topPos = 0;
18003
+ if (wrapper.classList.contains('e-label-before')) {
18004
+ topPos = (stepItemContainer.offsetParent.offsetHeight - (stepItemEle.offsetHeight / 2) - 1);
18005
+ }
18006
+ else {
18007
+ topPos = (stepItemEle.offsetHeight / 2);
18008
+ }
18009
+ this.progressStep.style.setProperty('--progress-top-position', topPos + 'px');
18010
+ }
18011
+ const lastEle = wrapper.querySelector('.e-stepper-steps').lastChild.firstChild;
18012
+ if (wrapper.classList.contains('e-rtl')) {
18013
+ const leftPost = ((stepItemEle.offsetLeft + stepItemEle.offsetWidth) - wrapper.querySelector('.e-stepper-steps').offsetWidth);
18014
+ this.progressStep.style.setProperty('--progress-left-position', Math.abs(leftPost) + 'px');
18015
+ this.progressStep.style.setProperty('--progress-bar-width', Math.abs(lastEle.offsetLeft - stepItemEle.offsetLeft) + 'px');
18016
+ }
18017
+ else {
18018
+ this.progressStep.style.setProperty('--progress-left-position', (stepItemEle.offsetLeft + 1) + 'px');
18019
+ this.progressStep.style.setProperty('--progress-bar-width', ((lastEle.offsetWidth + lastEle.offsetLeft - 2) - (stepItemEle.offsetLeft + 2)) + 'px');
18020
+ }
18021
+ }
18022
+ /**
18023
+ * This method is abstract member of the Component<HTMLElement>.
18024
+ *
18025
+ * @param newProp
18026
+ * @param oldProp
18027
+ * @private
18028
+ * @returns {void}
18029
+ */
18030
+ onPropertyChanged(newProp, oldProp) {
18031
+ }
18032
+ };
18033
+ __decorate$13([
18034
+ Collection([], Step)
18035
+ ], StepperBase.prototype, "steps", void 0);
18036
+ __decorate$13([
18037
+ Property('')
18038
+ ], StepperBase.prototype, "cssClass", void 0);
18039
+ __decorate$13([
18040
+ Property(false)
18041
+ ], StepperBase.prototype, "readOnly", void 0);
18042
+ __decorate$13([
18043
+ Property(StepperOrientation.Horizontal)
18044
+ ], StepperBase.prototype, "orientation", void 0);
18045
+ __decorate$13([
18046
+ Event()
18047
+ ], StepperBase.prototype, "created", void 0);
18048
+ StepperBase = __decorate$13([
18049
+ NotifyPropertyChanges
18050
+ ], StepperBase);
18051
+
18052
+ /**
18053
+ * export all modules from current location
18054
+ */
18055
+
18056
+ var __decorate$14 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
18057
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
18058
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
18059
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18060
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
18061
+ };
18062
+ // eslint-disable-next-line @typescript-eslint/triple-slash-reference
18063
+ ///<reference path='../stepper-base/stepper-base-model.d.ts'/>
18064
+ const ITEMCONTAINER = 'e-step-container';
18065
+ const ITEMLIST = 'e-stepper-steps';
18066
+ const ICONCSS = 'e-indicator';
18067
+ const TEXTCSS = 'e-step-text-container';
18068
+ const STEPLABEL = 'e-step-label-container';
18069
+ const OPTIONAL = 'e-step-label-optional';
18070
+ const SELECTED$2 = 'e-step-selected';
18071
+ const INPROGRESS = 'e-step-inprogress';
18072
+ const NOTSTARTED = 'e-step-notstarted';
18073
+ const FOCUS$1 = 'e-step-focus';
18074
+ const COMPLETED = 'e-step-completed';
18075
+ const DISABLED$2 = 'e-step-disabled';
18076
+ const READONLY = 'e-stepper-readonly';
18077
+ const PROGRESSVALUE$1 = '--progress-value';
18078
+ const RTL$3 = 'e-rtl';
18079
+ const TEMPLATE = 'e-step-template';
18080
+ const LABELAFTER = 'e-label-after';
18081
+ const LABELBEFORE = 'e-label-before';
18082
+ const VERTICALSTEP = 'e-vertical';
18083
+ const HORIZSTEP = 'e-horizontal';
18084
+ const STEPICON = 'e-step-icon';
18085
+ const STEPTEXT = 'e-step-text';
18086
+ const TEXT = 'e-text';
18087
+ const STEPSLABEL = 'e-step-label';
18088
+ const LABEL = 'e-label';
18089
+ const STEPINDICATOR = 'e-step-type-indicator';
18090
+ const LABELINDICATOR = 'e-step-type-label';
18091
+ const INDICATORICON = 'e-step-indicator';
18092
+ const STEPPERTOOLTIP = 'e-stepper-tooltip';
18093
+ const STEPPERIPROGRESSTIP = 'e-step-inprogress-tip';
18094
+ /**
18095
+ * Defines the step progress animation of the Stepper.
18096
+ */
18097
+ class StepperAnimationSettings extends ChildProperty {
18098
+ }
18099
+ __decorate$14([
18100
+ Property(true)
18101
+ ], StepperAnimationSettings.prototype, "enable", void 0);
18102
+ __decorate$14([
18103
+ Property(2000)
18104
+ ], StepperAnimationSettings.prototype, "duration", void 0);
18105
+ __decorate$14([
18106
+ Property(0)
18107
+ ], StepperAnimationSettings.prototype, "delay", void 0);
18108
+ /**
18109
+ * Defines the label position in the Stepper.
18110
+ */
18111
+ var StepLabelPosition;
18112
+ (function (StepLabelPosition) {
18113
+ /**
18114
+ * Displays the label on top position regardless of the Stepper's orientation.
18115
+ */
18116
+ StepLabelPosition["Top"] = "Top";
18117
+ /**
18118
+ * Displays the label on bottom position regardless of the Stepper's orientation.
18119
+ */
18120
+ StepLabelPosition["Bottom"] = "Bottom";
18121
+ /**
18122
+ * Displays the label on left side regardless of the Stepper's orientation.
18123
+ */
18124
+ StepLabelPosition["Start"] = "Start";
18125
+ /**
18126
+ * Displays the label on right side regardless of the Stepper's orientation.
18127
+ */
18128
+ StepLabelPosition["End"] = "End";
18129
+ })(StepLabelPosition || (StepLabelPosition = {}));
18130
+ /**
18131
+ * Defines whether steps are display with only indicator, only labels or combination of both.
18132
+ */
18133
+ var StepType;
18134
+ (function (StepType) {
18135
+ /**
18136
+ * Steps are shown indicator with label defined.
18137
+ */
18138
+ StepType["Default"] = "Default";
18139
+ /**
18140
+ * Steps are shown with only label.
18141
+ */
18142
+ StepType["Label"] = "Label";
18143
+ /**
18144
+ * Steps are shown with only indicator.
18145
+ */
18146
+ StepType["Indicator"] = "Indicator";
18147
+ })(StepType || (StepType = {}));
18148
+ /**
18149
+ * The Stepper component visualizes several steps and indicates the current progress by highlighting already completed steps.
18150
+ *
18151
+ * ```html
18152
+ * <nav id="stepper"></nav>
18153
+ * ```
18154
+ * ```typescript
18155
+ * <script>
18156
+ * let stepperObj: Stepper = new Stepper({steps : [{}, {}, {}, {}, {}]});
18157
+ * stepperObj.appendTo('#stepper');
18158
+ * </script>
18159
+ * ```
18160
+ */
18161
+ let Stepper = class Stepper extends StepperBase {
18162
+ /**
18163
+ * * Constructor for creating the Stepper component.
18164
+ *
18165
+ * @param {StepperModel} options - Specifies the Stepper model.
18166
+ * @param {string | HTMLElement} element - Specifies the element to render as component.
18167
+ * @private
18168
+ */
18169
+ constructor(options, element) {
18170
+ super(options, element);
18171
+ this.stepperItemElements = [];
18172
+ }
18173
+ preRender() {
18174
+ if (!this.element.id) {
18175
+ this.element.id = getUniqueID('e-' + this.getModuleName());
18176
+ }
18177
+ const localeText = { optional: 'Optional' };
18178
+ this.l10n = new L10n('stepper', localeText, this.locale);
18179
+ this.keyConfigs = {
18180
+ downarrow: 'downarrow',
18181
+ leftarrow: 'leftarrow',
18182
+ rightarrow: 'rightarrow',
18183
+ uparrow: 'uparrow',
18184
+ space: 'space',
18185
+ enter: 'enter',
18186
+ home: 'home',
18187
+ end: 'end',
18188
+ tab: 'tab',
18189
+ escape: 'escape'
18190
+ };
18191
+ this.tooltipOpen = false;
18192
+ }
18193
+ /**
18194
+ * To get component name.
18195
+ *
18196
+ * @returns {string} - Module Name
18197
+ * @private
18198
+ */
18199
+ getModuleName() {
18200
+ return 'stepper';
18201
+ }
18202
+ render() {
18203
+ this.initialize();
18204
+ this.navigationHandler(this.activeStep, null, false);
18205
+ this.updateStepperStatus(true);
18206
+ }
18207
+ initialize() {
18208
+ this.element.setAttribute('aria-label', this.element.id);
18209
+ this.updatePosition();
18210
+ this.stepperItemList = this.createElement('ol', { className: ITEMLIST });
18211
+ this.updateOrientaion(this.element);
18212
+ this.updateStepType();
18213
+ this.element.appendChild(this.stepperItemList);
18214
+ if (this.cssClass) {
18215
+ addClass([this.element], this.cssClass.trim().split(' '));
18216
+ }
18217
+ if (this.readOnly) {
18218
+ this.element.classList.add(READONLY);
18219
+ }
18220
+ if (this.enableRtl) {
18221
+ this.element.classList.add(RTL$3);
18222
+ }
18223
+ this.wireEvents();
18224
+ this.updateTemplateFunction();
18225
+ this.renderItems();
18226
+ if (this.steps.length > 0) {
18227
+ if (this.steps.length > 1) {
18228
+ if (this.isAngular && this.template) {
18229
+ setTimeout(() => {
18230
+ this.renderProgressBar(this.element);
18231
+ });
18232
+ }
18233
+ else {
18234
+ this.renderProgressBar(this.element);
18235
+ }
18236
+ }
18237
+ this.checkValidStep();
18238
+ this.updateAnimation();
18239
+ this.updateTooltip();
18240
+ this.wireKeyboardEvent();
18241
+ }
18242
+ }
18243
+ updatePosition() {
18244
+ this.progressBarPosition = this.beforeLabelWidth = this.textEleWidth = 0;
18245
+ }
18246
+ renderDefault(index) {
18247
+ return (!this.steps[parseInt((index).toString(), 10)].iconCss && !this.steps[parseInt((index).toString(), 10)].text &&
18248
+ !this.steps[parseInt((index).toString(), 10)].label) ? true : false;
18249
+ }
18250
+ updateAnimation() {
18251
+ const progressEle = this.element.querySelector('.e-progressbar-value');
18252
+ if (this.animation.enable) {
18253
+ if (this.animation.duration >= 0) {
18254
+ if (progressEle) {
18255
+ progressEle.style.setProperty('--duration', ((this.animation.duration) + 'ms'));
18256
+ }
18257
+ }
18258
+ if (this.animation.delay >= 0) {
18259
+ if (progressEle) {
18260
+ progressEle.style.setProperty('--delay', ((this.animation.delay) + 'ms'));
18261
+ }
18262
+ }
18263
+ }
18264
+ else {
18265
+ if (progressEle) {
18266
+ progressEle.style.setProperty('--delay', (0 + 'ms'));
18267
+ progressEle.style.setProperty('--duration', (0 + 'ms'));
18268
+ }
18269
+ }
18270
+ }
18271
+ updateStepType() {
18272
+ if (this.stepType.toLowerCase() === 'indicator' || 'label' || 'default') {
18273
+ this.stepType.toLowerCase() !== 'default' ? this.element.classList.add('e-step-type-' + this.stepType.toLowerCase()) : '';
18274
+ if (((this.stepType.toLowerCase() === 'indicator' || 'label') && (this.labelContainer))) {
18275
+ this.clearLabelPosition();
18276
+ }
18277
+ }
18278
+ }
18279
+ wireEvents() {
18280
+ EventHandler.add(window, 'resize', () => {
18281
+ if (this.stepperItemList && this.progressbar && this.element.classList.contains(HORIZSTEP)) {
18282
+ this.setProgressPosition(this.element, true);
18283
+ }
18284
+ }, this);
18285
+ EventHandler.add(window, 'click', () => { this.updateStepFocus(); }, this);
18286
+ }
18287
+ updateStepFocus() {
18288
+ if (this.isKeyNavFocus) {
18289
+ this.isKeyNavFocus = false;
18290
+ const isFocus = this.element.querySelector('.' + FOCUS$1);
18291
+ if (isFocus) {
18292
+ isFocus.classList.remove(FOCUS$1);
18293
+ this.element.classList.remove('e-steps-focus');
18294
+ }
18295
+ }
18296
+ }
18297
+ updateStepperStatus(isInitial) {
18298
+ for (let index = 0; index < this.steps.length; index++) {
18299
+ const item = this.steps[parseInt(index.toString(), 10)];
18300
+ const status = item.status.toLowerCase();
18301
+ if (isInitial && this.activeStep === 0 && index === 0) {
18302
+ item.status = StepStatus.InProgress;
18303
+ }
18304
+ if (item && status !== 'notstarted' && index === this.activeStep) {
18305
+ for (let i = 0; i < this.steps.length; i++) {
18306
+ const itemElement = this.stepperItemElements[parseInt(i.toString(), 10)];
18307
+ itemElement.classList.remove(SELECTED$2, INPROGRESS, COMPLETED, NOTSTARTED);
18308
+ const prevOnChange = this.isProtectedOnChange;
18309
+ this.isProtectedOnChange = true;
18310
+ if (status === 'completed') {
18311
+ this.updateStatusClass(i, index, itemElement);
18312
+ }
18313
+ else {
18314
+ this.updateStatusClass(i, index, itemElement, true);
18315
+ }
18316
+ this.isProtectedOnChange = prevOnChange;
18317
+ }
18318
+ }
18319
+ else if (item && status !== 'notstarted' && index !== this.activeStep) {
18320
+ this.navigationHandler(this.activeStep, null, true);
18321
+ }
18322
+ }
18323
+ }
18324
+ updateStatusClass(currentStep, index, ele, isInprogress) {
18325
+ const stepItem = this.steps[parseInt(currentStep.toString(), 10)];
18326
+ if (currentStep < index) {
18327
+ ele.classList.add(COMPLETED);
18328
+ stepItem.status = StepStatus.Completed;
18329
+ }
18330
+ else if (currentStep === index) {
18331
+ ele.classList.add(isInprogress ? INPROGRESS : COMPLETED, SELECTED$2);
18332
+ }
18333
+ else {
18334
+ ele.classList.add(NOTSTARTED);
18335
+ }
18336
+ }
18337
+ renderItems() {
18338
+ for (let index = 0; index < this.steps.length; index++) {
18339
+ this.stepperItemContainer = this.createElement('li', { className: ITEMCONTAINER });
18340
+ this.stepperItemContainer.classList[(index === 0) ? 'add' : 'remove'](SELECTED$2, INPROGRESS);
18341
+ this.stepperItemContainer.classList[(index !== 0) ? 'add' : 'remove'](NOTSTARTED);
18342
+ if (this.element.classList.contains(HORIZSTEP)) {
18343
+ this.stepperItemContainer.style.setProperty('--max-width', 100 / this.steps.length + '%');
18344
+ }
18345
+ const stepSpan = this.createElement('span', { className: 'e-step' });
18346
+ if (this.renderDefault(index) && (isNullOrUndefined(this.template) || this.template === '')) {
18347
+ const isIndicator = (!this.element.classList.contains('e-step-type-default') && this.stepType.toLowerCase() === 'indicator') ? true : false;
18348
+ if (isIndicator) {
18349
+ stepSpan.classList.add('e-icons', INDICATORICON);
18350
+ }
18351
+ if (!isIndicator) {
18352
+ stepSpan.classList.add('e-step-content');
18353
+ stepSpan.innerHTML = (index + 1).toString();
18354
+ }
18355
+ this.stepperItemContainer.appendChild(stepSpan);
18356
+ }
18357
+ else if (isNullOrUndefined(this.template) || this.template === '') {
18358
+ let isRender = true;
18359
+ const item = this.steps[parseInt(index.toString(), 10)];
18360
+ if (item.iconCss && (((!item.text && !item.label) || !this.element.classList.contains(LABELINDICATOR)))) {
18361
+ const itemIcon = item.iconCss.trim().split(' ');
18362
+ stepSpan.classList.add(ICONCSS);
18363
+ for (let i = 0; i < itemIcon.length; i++) {
18364
+ stepSpan.classList.add(itemIcon[parseInt(i.toString(), 10)]);
18365
+ }
18366
+ this.stepperItemContainer.appendChild(stepSpan);
18367
+ this.stepperItemContainer.classList.add(STEPICON);
18368
+ if ((this.element.classList.contains(HORIZSTEP) && (this.labelPosition.toLowerCase() === 'start' || this.labelPosition.toLowerCase() === 'end') && item.label) ||
18369
+ (this.element.classList.contains(VERTICALSTEP) && (this.labelPosition.toLowerCase() === 'top' || this.labelPosition.toLowerCase() === 'bottom') && item.label)) {
18370
+ this.element.classList.add('e-label-' + this.labelPosition.toLowerCase());
18371
+ const textSpan = this.createElement('span', { className: TEXTCSS + ' ' + TEXT });
18372
+ textSpan.innerText = item.label;
18373
+ this.stepperItemContainer.appendChild(textSpan);
18374
+ this.stepperItemContainer.classList.add(STEPTEXT);
18375
+ isRender = false;
18376
+ }
18377
+ }
18378
+ if (item.text && (!item.iconCss || !this.element.classList.contains(STEPINDICATOR)) && isRender && !(item.iconCss && item.label)) {
18379
+ if (!item.iconCss && this.element.classList.contains(STEPINDICATOR)) {
18380
+ this.checkValidState(item, stepSpan);
18381
+ const prevOnChange = this.isProtectedOnChange;
18382
+ this.isProtectedOnChange = true;
18383
+ item.label = null;
18384
+ this.isProtectedOnChange = prevOnChange;
18385
+ }
18386
+ else {
18387
+ this.textContainer = this.createElement('span', { className: TEXTCSS });
18388
+ const textSpan = this.createElement('span', { className: TEXT });
18389
+ if (!item.label) {
18390
+ textSpan.innerText = item.text;
18391
+ (item.isValid !== null && (!item.iconCss || this.element.classList.contains(LABELINDICATOR))) ? this.textContainer.appendChild(textSpan) : textSpan.classList.add(TEXTCSS);
18392
+ this.stepperItemContainer.appendChild((item.isValid !== null && (!item.iconCss || this.element.classList.contains(LABELINDICATOR))) ? this.textContainer : textSpan);
18393
+ this.stepperItemContainer.classList.add(STEPTEXT);
18394
+ }
18395
+ if (!item.iconCss || this.element.classList.contains(LABELINDICATOR)) {
18396
+ this.stepperItemContainer.classList.add('e-step-text-only');
18397
+ if (!item.label && item.isValid !== null) {
18398
+ const iconSpan = this.createElement('span', { className: 'e-step-validation-icon e-icons' });
18399
+ this.textContainer.appendChild(iconSpan);
18400
+ }
18401
+ }
18402
+ if (item.label && this.element.classList.contains(LABELINDICATOR)) {
18403
+ textSpan.innerText = item.label;
18404
+ }
18405
+ const prevOnChange = this.isProtectedOnChange;
18406
+ this.isProtectedOnChange = true;
18407
+ item.text = item.label ? null : item.text;
18408
+ this.isProtectedOnChange = prevOnChange;
18409
+ }
18410
+ }
18411
+ if (item.cssClass) {
18412
+ addClass([this.stepperItemContainer], item.cssClass.trim().split(' '));
18413
+ }
18414
+ if (item.disabled) {
18415
+ this.stepperItemContainer.classList[item.disabled ? 'add' : 'remove'](DISABLED$2);
18416
+ attributes(this.stepperItemContainer, { 'tabindex': '-1', 'aria-disabled': 'true' });
18417
+ }
18418
+ if (item.label && (!item.iconCss || !this.element.classList.contains(STEPINDICATOR)) && isRender) {
18419
+ if (!item.iconCss && !item.text && this.element.classList.contains(STEPINDICATOR)) {
18420
+ this.checkValidState(item, stepSpan, true);
18421
+ }
18422
+ else if ((!((this.element.classList.contains(LABELINDICATOR)) && item.text)) || (this.element.classList.contains(LABELINDICATOR) && item.label)) {
18423
+ this.labelContainer = this.createElement('span', { className: STEPLABEL });
18424
+ const labelSpan = this.createElement('span', { className: LABEL });
18425
+ labelSpan.innerText = item.label;
18426
+ this.labelContainer.appendChild(labelSpan);
18427
+ this.stepperItemContainer.classList.add(STEPSLABEL);
18428
+ this.updateLabelPosition();
18429
+ if ((!item.iconCss && !item.text) || this.element.classList.contains(LABELINDICATOR)) {
18430
+ this.stepperItemContainer.classList.add('e-step-label-only');
18431
+ if (item.isValid !== null) {
18432
+ const iconSpan = this.createElement('span', { className: 'e-step-validation-icon e-icons' });
18433
+ this.labelContainer.appendChild(iconSpan);
18434
+ }
18435
+ }
18436
+ }
18437
+ }
18438
+ if (item.optional) {
18439
+ const optionalSpan = this.createElement('span', { className: OPTIONAL });
18440
+ this.l10n.setLocale(this.locale);
18441
+ const optionalContent = this.l10n.getConstant('optional');
18442
+ optionalSpan.innerText = optionalContent;
18443
+ if (item.label && (this.labelContainer && ((this.element.classList.contains(LABELAFTER) && !this.stepperItemContainer.classList.contains('e-step-label-only'))
18444
+ || (this.element.classList.contains(HORIZSTEP) && this.element.classList.contains(LABELBEFORE) && !this.stepperItemContainer.classList.contains('e-step-label-only'))))
18445
+ || (this.element.classList.contains(VERTICALSTEP) && this.element.classList.contains(LABELBEFORE))) {
18446
+ this.labelContainer.appendChild(optionalSpan);
18447
+ }
18448
+ else {
18449
+ this.stepperItemContainer.appendChild(optionalSpan);
18450
+ }
18451
+ }
18452
+ if (item.isValid !== null) {
18453
+ item.isValid ? this.stepperItemContainer.classList.add('e-step-valid') : this.stepperItemContainer.classList.add('e-step-error');
18454
+ }
18455
+ }
18456
+ this.renderItemContent(index, false);
18457
+ if (this.stepperItemContainer.classList.contains(INPROGRESS)) {
18458
+ attributes(this.stepperItemContainer, { 'tabindex': '0', 'aria-current': 'true' });
18459
+ }
18460
+ else {
18461
+ attributes(this.stepperItemContainer, { 'tabindex': '-1' });
18462
+ }
18463
+ this.wireItemsEvents(this.stepperItemContainer, index);
18464
+ this.stepperItemElements.push(this.stepperItemContainer);
18465
+ const eventArgs = { element: this.stepperItemContainer, index: index };
18466
+ this.trigger('beforeStepRender', eventArgs, (args) => {
18467
+ this.stepperItemList.appendChild(args.element);
18468
+ });
18469
+ if (this.isAngular && this.template) {
18470
+ setTimeout(() => {
18471
+ this.calculateProgressBarPosition();
18472
+ });
18473
+ }
18474
+ else {
18475
+ this.calculateProgressBarPosition();
18476
+ }
18477
+ }
18478
+ if (this.element.classList.contains(VERTICALSTEP)) {
18479
+ if (this.element.classList.contains(LABELBEFORE)) {
18480
+ const listItems = this.stepperItemList.querySelectorAll('.' + LABEL);
18481
+ for (let i = 0; i < listItems.length; i++) {
18482
+ const labelEle = listItems[parseInt((i).toString(), 10)];
18483
+ labelEle.style.setProperty('--label-width', (this.beforeLabelWidth) + 5 + 'px');
18484
+ }
18485
+ }
18486
+ }
18487
+ }
18488
+ calculateProgressBarPosition() {
18489
+ const isBeforeLabel = (this.element.classList.contains(LABELBEFORE)) ? true : false;
18490
+ const isStepVertical = (this.element.classList.contains(VERTICALSTEP)) ? true : false;
18491
+ if (isStepVertical) {
18492
+ const iconOnly = (this.stepperItemContainer.classList.contains(STEPICON) && !this.stepperItemContainer.classList.contains(STEPTEXT) && !this.stepperItemContainer.classList.contains(STEPSLABEL)) ? true : false;
18493
+ const textEle = (this.stepperItemContainer.querySelector('.' + TEXTCSS));
18494
+ if (textEle) {
18495
+ this.textEleWidth = this.textEleWidth < textEle.offsetWidth ? textEle.offsetWidth : this.textEleWidth;
18496
+ }
18497
+ if (isBeforeLabel) {
18498
+ let itemWidth;
18499
+ const labelWidth = this.stepperItemContainer.querySelector('.' + LABEL).offsetWidth + 15;
18500
+ if (this.beforeLabelWidth < labelWidth) {
18501
+ this.beforeLabelWidth = labelWidth;
18502
+ }
18503
+ if (this.element.querySelector('ol').lastChild.querySelector('.' + ICONCSS)) {
18504
+ itemWidth = (this.beforeLabelWidth + (this.stepperItemContainer.querySelector('.' + ICONCSS).offsetWidth / 2));
18505
+ }
18506
+ else if (this.stepperItemContainer.querySelector('.' + TEXTCSS)) {
18507
+ itemWidth = (this.beforeLabelWidth + (this.stepperItemContainer.querySelector('.' + TEXTCSS).offsetWidth / 2));
18508
+ }
18509
+ if (this.progressBarPosition < itemWidth) {
18510
+ this.progressBarPosition = itemWidth;
18511
+ }
18512
+ }
18513
+ else if (this.progressBarPosition < (iconOnly ? this.stepperItemContainer.offsetWidth : this.element.querySelector('ol').lastChild.firstChild.offsetWidth)) {
18514
+ this.progressBarPosition = iconOnly ? this.stepperItemContainer.offsetWidth : this.element.querySelector('ol').lastChild.firstChild.offsetWidth;
18515
+ }
18516
+ }
18517
+ }
18518
+ checkValidState(item, stepSpan, isLabel) {
18519
+ if (item.isValid == null) {
18520
+ stepSpan.classList.add('e-step-content');
18521
+ if (isLabel) {
18522
+ stepSpan.innerHTML = item.label;
18523
+ }
18524
+ else {
18525
+ stepSpan.innerHTML = item.label ? item.label : item.text;
18526
+ }
18527
+ this.stepperItemContainer.appendChild(stepSpan);
18528
+ }
18529
+ else {
18530
+ stepSpan.classList.add(ICONCSS);
18531
+ this.stepperItemContainer.appendChild(stepSpan);
18532
+ this.stepperItemContainer.classList.add(STEPICON);
18533
+ }
18534
+ }
18535
+ updateCurrentLabel() {
18536
+ let currentLabelPos;
18537
+ if (this.element.classList.contains(HORIZSTEP)) {
18538
+ currentLabelPos = this.labelPosition.toLowerCase() === 'top' ? 'before' : this.labelPosition.toLowerCase() === 'bottom' ? 'after' : this.labelPosition.toLowerCase();
18539
+ }
18540
+ else {
18541
+ currentLabelPos = this.labelPosition.toLowerCase() === 'start' ? 'before' : this.labelPosition.toLowerCase() === 'end' ? 'after' : this.labelPosition.toLowerCase();
18542
+ }
18543
+ return currentLabelPos;
18544
+ }
18545
+ updateLabelPosition() {
18546
+ this.clearLabelPosition();
18547
+ this.labelContainer.classList.add('e-label-' + this.updateCurrentLabel());
18548
+ if (this.labelPosition.toLowerCase() === 'start' && this.orientation.toLowerCase() === 'vertical') {
18549
+ this.stepperItemContainer.firstChild ? this.stepperItemContainer.firstChild.before(this.labelContainer) : this.stepperItemContainer.appendChild(this.labelContainer);
18550
+ }
18551
+ else {
18552
+ this.stepperItemContainer.appendChild(this.labelContainer);
18553
+ }
18554
+ this.element.classList.add('e-label-' + this.updateCurrentLabel());
18555
+ }
18556
+ clearLabelPosition() {
18557
+ const removeCss = this.labelContainer.classList.value.match(/(e-label-[after|before]+)/g);
18558
+ if (removeCss) {
18559
+ removeClass([this.labelContainer], removeCss);
18560
+ removeClass([this.element], removeCss);
18561
+ }
18562
+ }
18563
+ checkValidStep() {
18564
+ for (let index = 0; index < this.steps.length; index++) {
18565
+ const item = this.steps[parseInt(index.toString(), 10)];
18566
+ const itemElement = this.stepperItemElements[parseInt(index.toString(), 10)];
18567
+ if (item.isValid !== null) {
18568
+ let indicatorEle;
18569
+ let iconEle;
18570
+ if (this.element.classList.contains(STEPINDICATOR) && !item.iconCss) {
18571
+ indicatorEle = itemElement.querySelector('.' + ICONCSS);
18572
+ }
18573
+ else {
18574
+ iconEle = itemElement.querySelector('.' + ICONCSS);
18575
+ }
18576
+ const textLabelIcon = itemElement.querySelector('.e-step-validation-icon');
18577
+ const itemIcon = item.iconCss.trim().split(' ');
18578
+ const validStep = itemElement.classList.contains('e-step-valid');
18579
+ if (indicatorEle) {
18580
+ indicatorEle.classList.add('e-icons', validStep ? 'e-check' : 'e-circle-info');
18581
+ }
18582
+ if (iconEle) {
18583
+ for (let i = 0; i < itemIcon.length; i++) {
18584
+ iconEle.classList.remove(itemIcon[parseInt(i.toString(), 10)]);
18585
+ }
18586
+ iconEle.classList.add('e-icons', validStep ? 'e-check' : 'e-circle-info');
18587
+ }
18588
+ if (textLabelIcon) {
18589
+ textLabelIcon.classList.add(validStep ? 'e-circle-check' : 'e-circle-info');
18590
+ if (this.element.classList.contains(VERTICALSTEP)) {
18591
+ const labelEle = itemElement.querySelector('.' + LABEL);
18592
+ const textEle = itemElement.querySelector('.' + TEXT);
18593
+ const itemWidth = textEle ? textEle.offsetWidth + textEle.getBoundingClientRect().left :
18594
+ labelEle.offsetWidth + labelEle.getBoundingClientRect().left;
18595
+ const validationIcon = itemElement.querySelector('.e-step-validation-icon');
18596
+ validationIcon.style.setProperty('--icon-position', (itemWidth + 20) + 'px');
18597
+ }
18598
+ }
18599
+ }
18600
+ }
18601
+ }
18602
+ updateTooltip() {
18603
+ if (this.showTooltip) {
18604
+ this.tooltipObj = new Tooltip({
18605
+ target: '.e-step-container', windowCollision: true,
18606
+ opensOn: 'Custom', cssClass: this.cssClass ? (STEPPERTOOLTIP + ' ' + this.cssClass) : STEPPERTOOLTIP,
18607
+ position: 'TopCenter'
18608
+ });
18609
+ this.tooltipObj.appendTo(this.stepperItemList);
18610
+ }
18611
+ else {
18612
+ if (!isNullOrUndefined(this.tooltipObj)) {
18613
+ this.tooltipObj.destroy();
18614
+ this.tooltipObj = null;
18615
+ }
18616
+ }
18617
+ }
18618
+ wireItemsEvents(itemElement, index) {
18619
+ EventHandler.add(itemElement, 'click', (e) => {
18620
+ if (this.linear) {
18621
+ const linearModeValue = index - this.activeStep;
18622
+ if (Math.abs(linearModeValue) === 1) {
18623
+ this.stepClickHandler(index, e, itemElement);
18624
+ }
18625
+ }
18626
+ else {
18627
+ this.stepClickHandler(index, e, itemElement);
18628
+ }
18629
+ }, this);
18630
+ EventHandler.add(itemElement, 'mouseover', () => this.openStepperTooltip(index), this);
18631
+ EventHandler.add(itemElement, 'mouseleave', () => this.closeStepperTooltip(), this);
18632
+ }
18633
+ openStepperTooltip(index) {
18634
+ const currentStep = this.steps[parseInt(index.toString(), 10)];
18635
+ if (this.showTooltip && (currentStep.label || currentStep.text)) {
18636
+ if (!this.tooltipOpen) {
18637
+ this.updateTooltipContent(index);
18638
+ this.tooltipObj.open(this.stepperItemElements[parseInt((index).toString(), 10)]);
18639
+ if (this.stepType.toLocaleLowerCase() !== 'label' && ((this.stepType.toLocaleLowerCase() === 'indicator') ||
18640
+ (currentStep.label !== '' && currentStep.iconCss !== ''))) {
18641
+ const tooltipPopupClass = currentStep.status.toLowerCase() === 'inprogress' ?
18642
+ `${STEPPERTOOLTIP} ${STEPPERIPROGRESSTIP} ${this.cssClass ? this.cssClass : ''}` : `${STEPPERTOOLTIP} ${this.cssClass ? this.cssClass : ''}`;
18643
+ this.tooltipObj.setProperties({ cssClass: tooltipPopupClass.trim() });
18644
+ }
18645
+ this.tooltipOpen = true;
18646
+ }
18647
+ }
18648
+ }
18649
+ closeStepperTooltip() {
18650
+ if (this.tooltipOpen) {
18651
+ this.tooltipObj.close();
18652
+ this.tooltipOpen = false;
18653
+ }
18654
+ }
18655
+ updateTooltipContent(index) {
18656
+ if (this.showTooltip) {
18657
+ if (this.isReact) {
18658
+ this.clearTemplate(['stepperTooltipTemplate']);
18659
+ }
18660
+ let content;
18661
+ const currentStep = this.steps[parseInt(index.toString(), 10)];
18662
+ if (this.tooltipTemplate) {
18663
+ content = this.createElement('span', { className: 'e-stepper-tooltip-content' });
18664
+ const templateFunction = this.getTemplateFunction(this.tooltipTemplate);
18665
+ append(templateFunction({ value: currentStep }, this, 'stepperTooltipTemplate', (this.element.id + 'tooltipTemplate'), this.isStringTemplate), content);
18666
+ this.tooltipObj.setProperties({ content: content }, true);
18667
+ }
18668
+ else {
18669
+ const content = currentStep.label ? currentStep.label : currentStep.text;
18670
+ this.tooltipObj.setProperties({ content: initializeCSPTemplate(function () { return content; }) }, true);
18671
+ }
18672
+ this.renderReactTemplates();
18673
+ }
18674
+ }
18675
+ stepClickHandler(index, e, itemElement) {
18676
+ const clickEventArgs = {
18677
+ element: itemElement, event: e, previousStep: this.activeStep,
18678
+ activeStep: index
18679
+ };
18680
+ this.trigger('stepClick', clickEventArgs);
18681
+ this.navigateToStep(index, e, itemElement, true);
18682
+ }
18683
+ updateTemplateFunction() {
18684
+ this.templateFunction = this.template ? this.getTemplateFunction(this.template) : null;
18685
+ }
18686
+ renderItemContent(index, isrerender) {
18687
+ const listItems = this.stepperItemList.querySelectorAll('li');
18688
+ if (isrerender) {
18689
+ this.removeItemContent(listItems[parseInt((index).toString(), 10)]);
18690
+ }
18691
+ if (this.template) {
18692
+ isrerender ? listItems[parseInt((index).toString(), 10)].classList.add(TEMPLATE) :
18693
+ this.stepperItemContainer.classList.add(TEMPLATE);
18694
+ const item = this.steps[parseInt(index.toString(), 10)];
18695
+ append(this.templateFunction({ step: item, currentStep: index }, this, 'stepperTemplate', (this.element.id + '_stepperTemplate'), this.isStringTemplate), isrerender ? listItems[parseInt((index).toString(), 10)] : this.stepperItemContainer);
18696
+ }
18697
+ this.renderReactTemplates();
18698
+ }
18699
+ removeItemContent(ele) {
18700
+ ele.classList.remove(TEMPLATE);
18701
+ const firstChild = ele.firstElementChild;
18702
+ for (let i = 0; i < ele.childElementCount; i++) {
18703
+ firstChild.remove();
18704
+ }
18705
+ }
18706
+ updateContent() {
18707
+ if (this.isReact) {
18708
+ this.clearTemplate(['stepperTemplate']);
18709
+ }
18710
+ for (let i = 0; i < this.steps.length; i++) {
18711
+ this.renderItemContent(i, true);
18712
+ }
18713
+ }
18714
+ /**
18715
+ * Gets template content based on the template property value.
18716
+ *
18717
+ * @param {string | Function} template - Template property value.
18718
+ * @returns {Function} - Return template function.
18719
+ * @hidden
18720
+ */
18721
+ getTemplateFunction(template) {
18722
+ if (typeof template === 'string') {
18723
+ let content = '';
18724
+ try {
18725
+ const tempEle = select(template);
18726
+ if (tempEle) {
18727
+ //Return innerHTML incase of jsrenderer script else outerHTML
18728
+ content = tempEle.tagName === 'SCRIPT' ? tempEle.innerHTML : tempEle.outerHTML;
18729
+ }
18730
+ else {
18731
+ content = template;
18732
+ }
18733
+ }
18734
+ catch (e) {
18735
+ content = template;
18736
+ }
18737
+ return compile(content);
18738
+ }
18739
+ else {
18740
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
18741
+ return compile(template);
18742
+ }
18743
+ }
18744
+ navigateToStep(index, e, itemElement, isInteracted, isUpdated) {
18745
+ const eventArgs = {
18746
+ element: itemElement, event: e, isInteracted: isInteracted,
18747
+ previousStep: this.activeStep, activeStep: index, cancel: false
18748
+ };
18749
+ if (isUpdated != false) {
18750
+ const previousStep = this.activeStep;
18751
+ this.trigger('stepChanging', eventArgs, (args) => {
18752
+ if (args.cancel) {
18753
+ return;
18754
+ }
18755
+ this.navigationHandler(index);
18756
+ const eventArgs = {
18757
+ element: itemElement, event: e, isInteracted: isInteracted,
18758
+ previousStep: previousStep, activeStep: this.activeStep
18759
+ };
18760
+ this.trigger('stepChanged', eventArgs);
18761
+ });
18762
+ }
18763
+ else {
18764
+ this.navigationHandler(index);
18765
+ }
18766
+ }
18767
+ navigationHandler(index, stepStatus, isUpdated) {
18768
+ index = (index >= this.steps.length - 1) ? this.steps.length - 1 : index;
18769
+ const Itemslength = this.stepperItemElements.length;
18770
+ if (index >= 0 && index < Itemslength - 1) {
18771
+ index = this.stepperItemElements[parseInt(index.toString(), 10)].classList.contains(DISABLED$2) ? this.activeStep : index;
18772
+ }
18773
+ const prevOnChange = this.isProtectedOnChange;
18774
+ this.isProtectedOnChange = true;
18775
+ this.activeStep = index;
18776
+ this.isProtectedOnChange = prevOnChange;
18777
+ for (let i = 0; i < this.steps.length; i++) {
18778
+ const itemElement = this.stepperItemElements[parseInt(i.toString(), 10)];
18779
+ const item = this.steps[parseInt(i.toString(), 10)];
18780
+ itemElement.classList.remove(SELECTED$2, INPROGRESS, COMPLETED, NOTSTARTED);
18781
+ if (i === this.activeStep || this.activeStep === this.steps.length - 1) {
18782
+ itemElement.classList.add(SELECTED$2);
18783
+ }
18784
+ if (this.activeStep >= 0 && this.progressbar) {
18785
+ if (this.element.classList.contains(HORIZSTEP)) {
18786
+ if ((this.element.classList.contains(LABELBEFORE) || this.element.classList.contains(LABELAFTER)) && !this.element.classList.contains(STEPINDICATOR) &&
18787
+ this.stepperItemElements[parseInt(this.activeStep.toString(), 10)].classList.contains(STEPICON)) {
18788
+ const progressPos = this.element.querySelector('.e-stepper-progressbar');
18789
+ const selectedEle = this.stepperItemElements[parseInt(this.activeStep.toString(), 10)].firstChild;
18790
+ let value = this.activeStep === 0 ? 0 : (selectedEle.offsetLeft - progressPos.offsetLeft + (selectedEle.offsetWidth / 2)) / progressPos.offsetWidth * 100;
18791
+ if (this.element.classList.contains(RTL$3)) {
18792
+ const elementPos = this.stepperItemElements[0].firstChild;
18793
+ value = ((progressPos.offsetWidth - selectedEle.offsetLeft) + Math.abs((elementPos.offsetLeft + elementPos.offsetWidth) - this.stepperItemList.offsetWidth)) / progressPos.offsetWidth * 100;
18794
+ this.progressbar.style.setProperty(PROGRESSVALUE$1, (value) + '%');
18795
+ }
18796
+ else {
18797
+ this.progressbar.style.setProperty(PROGRESSVALUE$1, (value) + '%');
18798
+ }
18799
+ }
18800
+ else {
18801
+ let totalLiWidth = 0;
18802
+ let activeLiWidth = 0;
18803
+ for (let j = 0; j < this.stepperItemElements.length; j++) {
18804
+ totalLiWidth = totalLiWidth + this.stepperItemElements[parseInt(j.toString(), 10)].offsetWidth;
18805
+ if (j <= this.activeStep) {
18806
+ if (j < this.activeStep) {
18807
+ activeLiWidth = activeLiWidth + this.stepperItemElements[parseInt(j.toString(), 10)].offsetWidth;
18808
+ }
18809
+ else if (j == this.activeStep && j !== 0) {
18810
+ activeLiWidth = activeLiWidth + (this.stepperItemElements[parseInt(j.toString(), 10)].offsetWidth / 2);
18811
+ }
18812
+ }
18813
+ }
18814
+ const spaceWidth = (this.stepperItemList.offsetWidth - totalLiWidth) / (this.stepperItemElements.length - 1);
18815
+ const progressValue = ((activeLiWidth + (spaceWidth * this.activeStep)) / this.stepperItemList.offsetWidth) * 100;
18816
+ this.progressbar.style.setProperty(PROGRESSVALUE$1, (progressValue) + '%');
18817
+ }
18818
+ }
18819
+ else {
18820
+ this.progressbar.style.setProperty(PROGRESSVALUE$1, ((100 / (this.steps.length - 1)) * index) + '%');
18821
+ }
18822
+ }
18823
+ else if (this.activeStep < 0 && this.progressbar) {
18824
+ this.progressbar.style.setProperty(PROGRESSVALUE$1, 0 + '%');
18825
+ }
18826
+ if (i === this.activeStep) {
18827
+ itemElement.classList.add(INPROGRESS);
18828
+ }
18829
+ else if (this.activeStep > 0 && i < this.activeStep) {
18830
+ itemElement.classList.add(COMPLETED);
18831
+ }
18832
+ else {
18833
+ itemElement.classList.add(NOTSTARTED);
18834
+ }
18835
+ if (itemElement.classList.contains(INPROGRESS)) {
18836
+ attributes(itemElement, { 'tabindex': '0', 'aria-current': 'true' });
18837
+ }
18838
+ else {
18839
+ attributes(itemElement, { 'tabindex': '-1', 'aria-current': 'false' });
18840
+ }
18841
+ const prevOnChange = this.isProtectedOnChange;
18842
+ this.isProtectedOnChange = true;
18843
+ if (isUpdated != false) {
18844
+ if (i < this.activeStep || (this.steps.length - 1 === this.activeStep && item.status.toLowerCase() === "completed")) {
18845
+ item.status = StepStatus.Completed;
18846
+ }
18847
+ else if (i === this.activeStep) {
18848
+ item.status = StepStatus.InProgress;
18849
+ }
18850
+ else if (i > this.activeStep) {
18851
+ item.status = StepStatus.NotStarted;
18852
+ }
18853
+ if (stepStatus && this.activeStep === i) {
18854
+ item.status = stepStatus;
18855
+ }
18856
+ if (item.status.toLowerCase() === "completed") {
18857
+ itemElement.classList.remove(SELECTED$2, INPROGRESS, NOTSTARTED);
18858
+ itemElement.classList.add(COMPLETED);
18859
+ }
18860
+ if (item.status.toLowerCase() === "notstarted") {
18861
+ itemElement.classList.remove(SELECTED$2, INPROGRESS, COMPLETED);
18862
+ itemElement.classList.add(NOTSTARTED);
18863
+ }
18864
+ }
18865
+ this.isProtectedOnChange = prevOnChange;
18866
+ if (this.renderDefault(i) && this.element.classList.contains(STEPINDICATOR)) {
18867
+ if (itemElement.classList.contains(COMPLETED)) {
18868
+ itemElement.firstChild.classList.remove('e-icons', 'e-step-indicator');
18869
+ itemElement.firstChild.classList.add(ICONCSS, 'e-icons', 'e-check');
18870
+ }
18871
+ else if (itemElement.classList.contains(INPROGRESS) || itemElement.classList.contains(NOTSTARTED)) {
18872
+ itemElement.firstChild.classList.remove(ICONCSS, 'e-icons', 'e-check');
18873
+ itemElement.firstChild.classList.add('e-icons', 'e-step-indicator');
18874
+ }
18875
+ }
18876
+ }
18877
+ }
18878
+ removeItemElements() {
18879
+ for (let i = 0; i < this.stepperItemElements.length; i++) {
18880
+ remove(this.stepperItemElements[parseInt(i.toString(), 10)]);
18881
+ }
18882
+ this.stepperItemElements = [];
18883
+ }
18884
+ nextStep() {
18885
+ if (this.activeStep !== this.steps.length - 1) {
18886
+ this.navigateToStep(this.activeStep + 1, null, null, false);
18887
+ }
18888
+ }
18889
+ previousStep() {
18890
+ if (this.activeStep > 0) {
18891
+ this.navigateToStep(this.activeStep - 1, null, null, false);
18892
+ }
18893
+ }
18894
+ reset() {
18895
+ if (this.activeStep !== 0) {
18896
+ const isDisabled = this.stepperItemElements[0].classList.contains(DISABLED$2) ? true : false;
18897
+ this.navigateToStep(isDisabled ? -1 : 0, null, null, false);
18898
+ }
18899
+ }
18900
+ updateElementClassArray() {
18901
+ const classArray = [RTL$3, READONLY, 'e-steps-focus', LABELAFTER, LABELBEFORE, 'e-label-top',
18902
+ 'e-label-bottom', 'e-label-start', 'e-label-end', STEPINDICATOR, LABELINDICATOR, VERTICALSTEP, HORIZSTEP];
18903
+ removeClass([this.element], classArray);
18904
+ }
18905
+ destroy() {
18906
+ super.destroy();
18907
+ EventHandler.remove(window, 'resize', () => { if (this.stepperItemList && this.progressbar) {
18908
+ this.setProgressPosition(this.element, true);
18909
+ } });
18910
+ EventHandler.remove(window, 'click', () => { this.updateStepFocus(); });
18911
+ // unwires the events and detach the li elements
18912
+ this.removeItemElements();
18913
+ this.clearTemplate();
18914
+ if (this.stepperItemList) {
18915
+ remove(this.stepperItemList);
18916
+ }
18917
+ this.stepperItemList = null;
18918
+ if (this.progressStep) {
18919
+ remove(this.progressStep);
18920
+ }
18921
+ this.progressStep = null;
18922
+ this.progressbar = null;
18923
+ this.progressBarPosition = null;
18924
+ this.stepperItemContainer = null;
18925
+ this.textContainer = null;
18926
+ this.labelContainer = null;
18927
+ this.updateElementClassArray();
18928
+ this.element.removeAttribute('aria-label');
18929
+ if (this.showTooltip) {
18930
+ this.tooltipObj.destroy();
18931
+ this.tooltipObj = null;
18932
+ }
18933
+ if (this.keyboardModuleStepper) {
18934
+ this.keyboardModuleStepper.destroy();
18935
+ }
18936
+ this.keyboardModuleStepper = null;
18937
+ }
18938
+ wireKeyboardEvent() {
18939
+ this.keyboardModuleStepper = new KeyboardEvents(this.element, {
18940
+ keyAction: this.keyActionHandler.bind(this),
18941
+ keyConfigs: this.keyConfigs,
18942
+ eventName: 'keydown'
18943
+ });
18944
+ }
18945
+ keyActionHandler(e) {
18946
+ if (this.readOnly) {
18947
+ return;
18948
+ }
18949
+ switch (e.action) {
18950
+ case 'uparrow':
18951
+ case 'downarrow':
18952
+ if (this.element.classList.contains(VERTICALSTEP)) {
18953
+ this.handleNavigation(e.action === 'uparrow' ? false : true, e);
18954
+ }
18955
+ break;
18956
+ case 'leftarrow':
18957
+ case 'rightarrow':
18958
+ if (this.element.classList.contains(HORIZSTEP)) {
18959
+ this.handleNavigation(this.enableRtl ? e.action === 'leftarrow' : e.action === 'rightarrow', e);
18960
+ }
18961
+ break;
18962
+ case 'tab':
18963
+ case 'space':
18964
+ case 'enter':
18965
+ case 'escape':
18966
+ this.handleNavigation(null, e);
18967
+ break;
18968
+ case 'home':
18969
+ case 'end':
18970
+ this.handleNavigation(null, e, this.enableRtl);
18971
+ break;
18972
+ }
18973
+ }
18974
+ handleNavigation(isNextStep, e, isRTL) {
18975
+ this.isKeyNavFocus = true;
18976
+ this.element.classList.add('e-steps-focus');
18977
+ let focusedEle = this.element.querySelector('.' + FOCUS$1);
18978
+ if (!focusedEle) {
18979
+ focusedEle = this.element.querySelector('.' + SELECTED$2);
18980
+ }
18981
+ const stepItems = Array.prototype.slice.call(this.stepperItemList.children);
18982
+ let index = stepItems.indexOf(focusedEle);
18983
+ if (e.action === 'tab' || e.action === 'escape') {
18984
+ stepItems[parseInt(index.toString(), 10)].classList.remove(FOCUS$1);
18985
+ this.element.classList.remove('e-steps-focus');
18986
+ }
18987
+ if (!(e.action === 'space' || e.action === 'enter' || e.action === 'tab')) {
18988
+ const prevIndex = index;
18989
+ index = isNextStep ? index + 1 : index - 1;
18990
+ while ((index >= 0 && index < stepItems.length) && stepItems[parseInt(index.toString(), 10)].classList.contains(DISABLED$2)) {
18991
+ index = isNextStep ? index + 1 : index - 1;
18992
+ }
18993
+ index = (index < 0) ? 0 : (index > stepItems.length - 1) ? stepItems.length - 1 : index;
18994
+ if (stepItems[parseInt(prevIndex.toString(), 10)].classList.contains(FOCUS$1)) {
18995
+ stepItems[parseInt(prevIndex.toString(), 10)].classList.remove(FOCUS$1);
18996
+ }
18997
+ if ((e.action === 'home' || e.action === 'end')) {
18998
+ if (e.action === 'home') {
18999
+ isRTL ? index = stepItems.length - 1 : index = 0;
19000
+ }
19001
+ else {
19002
+ isRTL ? index = 0 : index = stepItems.length - 1;
19003
+ }
19004
+ }
19005
+ if (index >= 0 && index < stepItems.length) {
19006
+ stepItems[parseInt(index.toString(), 10)].classList.add(FOCUS$1);
19007
+ }
19008
+ }
19009
+ else if ((e.action === 'space' || e.action === 'enter')) {
19010
+ if (this.linear) {
19011
+ const linearModeValue = this.activeStep - index;
19012
+ if (Math.abs(linearModeValue) === 1) {
19013
+ this.navigateToStep(index, null, null, true);
19014
+ }
19015
+ }
19016
+ else {
19017
+ this.navigateToStep(index, null, null, true);
19018
+ }
19019
+ }
19020
+ }
19021
+ renderStepperItems(isUpdate, isStepType) {
19022
+ this.updateElementClassArray();
19023
+ this.removeItemElements();
19024
+ this.element.querySelector('.e-stepper-progressbar').remove();
19025
+ isUpdate ? this.updatePosition() : null;
19026
+ isStepType ? this.updateStepType() : null;
19027
+ this.readOnly ? (!this.element.classList.contains(READONLY)) ? this.element.classList.add(READONLY) : null : null;
19028
+ this.enableRtl ? (!this.element.classList.contains(RTL$3)) ? this.element.classList.add(RTL$3) : null : null;
19029
+ this.updateOrientaion(this.element);
19030
+ this.renderItems();
19031
+ this.renderProgressBar(this.element);
19032
+ this.checkValidStep();
19033
+ this.updateAnimation();
19034
+ this.navigateToStep(this.activeStep, null, this.stepperItemElements[this.activeStep], true);
19035
+ }
19036
+ /**
19037
+ * Called internally if any of the property value changed.
19038
+ *
19039
+ * @param {StepperModel} newProp - Specifies new properties
19040
+ * @param {StepperModel} oldProp - Specifies old properties
19041
+ * @returns {void}
19042
+ * @private
19043
+ */
19044
+ onPropertyChanged(newProp, oldProp) {
19045
+ for (const prop of Object.keys(newProp)) {
19046
+ switch (prop) {
19047
+ case 'steps': {
19048
+ if (!(newProp.steps instanceof Array && oldProp.steps instanceof Array)) {
19049
+ const stepCounts = Object.keys(newProp.steps);
19050
+ for (let i = 0; i < stepCounts.length; i++) {
19051
+ const index = parseInt(Object.keys(newProp.steps)[i], 10);
19052
+ const changedPropsCount = Object.keys(newProp.steps[index]).length;
19053
+ for (let j = 0; j < changedPropsCount; j++) {
19054
+ const property = Object.keys(newProp.steps[index])[j];
19055
+ if (property === 'status') {
19056
+ if (this.activeStep === index) {
19057
+ this.navigationHandler(index, newProp.steps[index].status);
19058
+ }
19059
+ else {
19060
+ this.steps[index].status = oldProp.steps[index].status;
19061
+ }
19062
+ }
19063
+ else {
19064
+ this.removeItemElements();
19065
+ this.renderItems();
19066
+ this.updateStepperStatus();
19067
+ }
19068
+ this.checkValidStep();
19069
+ }
19070
+ }
19071
+ }
19072
+ else {
19073
+ this.renderStepperItems(true, true);
19074
+ }
19075
+ break;
19076
+ }
19077
+ case 'orientation':
19078
+ this.updateOrientaion(this.element);
19079
+ this.renderStepperItems(true);
19080
+ break;
19081
+ case 'activeStep':
19082
+ this.activeStep = (newProp.activeStep > this.steps.length - 1 || newProp.activeStep < -1) ? oldProp.activeStep : this.activeStep;
19083
+ if (this.activeStep >= 0 && this.stepperItemElements[parseInt(this.activeStep.toString(), 10)].classList.contains(DISABLED$2)) {
19084
+ this.activeStep = oldProp.activeStep;
19085
+ }
19086
+ if (this.linear) {
19087
+ const linearModeValue = oldProp.activeStep - this.activeStep;
19088
+ if (Math.abs(linearModeValue) === 1) {
19089
+ this.navigateToStep(this.activeStep, null, null, true);
19090
+ }
19091
+ }
19092
+ else {
19093
+ this.navigateToStep(this.activeStep, null, this.stepperItemElements[this.activeStep], true);
19094
+ }
19095
+ break;
19096
+ case 'enableRtl':
19097
+ this.element.classList[this.enableRtl ? 'add' : 'remove'](RTL$3);
19098
+ break;
19099
+ case 'readOnly':
19100
+ this.element.classList[this.readOnly ? 'add' : 'remove'](READONLY);
19101
+ break;
19102
+ case 'cssClass':
19103
+ if (oldProp.cssClass) {
19104
+ removeClass([this.element], oldProp.cssClass.trim().split(' '));
19105
+ }
19106
+ if (newProp.cssClass) {
19107
+ addClass([this.element], newProp.cssClass.trim().split(' '));
19108
+ }
19109
+ if (this.tooltipObj) {
19110
+ this.tooltipObj.setProperties({ cssClass: this.cssClass ? (STEPPERTOOLTIP + ' ' + this.cssClass) : STEPPERTOOLTIP });
19111
+ }
19112
+ break;
19113
+ case 'labelPosition':
19114
+ this.renderStepperItems(true);
19115
+ break;
19116
+ case 'showTooltip':
19117
+ this.updateTooltip();
19118
+ break;
19119
+ case 'stepType':
19120
+ this.renderStepperItems(true, true);
19121
+ break;
19122
+ case 'template':
19123
+ this.updateTemplateFunction();
19124
+ this.updateContent();
19125
+ break;
19126
+ case 'animation':
19127
+ this.updateAnimation();
19128
+ break;
19129
+ }
19130
+ }
19131
+ }
19132
+ };
19133
+ __decorate$14([
19134
+ Property(0)
19135
+ ], Stepper.prototype, "activeStep", void 0);
19136
+ __decorate$14([
19137
+ Complex({}, StepperAnimationSettings)
19138
+ ], Stepper.prototype, "animation", void 0);
19139
+ __decorate$14([
19140
+ Property(false)
19141
+ ], Stepper.prototype, "linear", void 0);
19142
+ __decorate$14([
19143
+ Property(false)
19144
+ ], Stepper.prototype, "showTooltip", void 0);
19145
+ __decorate$14([
19146
+ Property('')
19147
+ ], Stepper.prototype, "template", void 0);
19148
+ __decorate$14([
19149
+ Property('')
19150
+ ], Stepper.prototype, "tooltipTemplate", void 0);
19151
+ __decorate$14([
19152
+ Property(StepLabelPosition.Bottom)
19153
+ ], Stepper.prototype, "labelPosition", void 0);
19154
+ __decorate$14([
19155
+ Property(StepType.Default)
19156
+ ], Stepper.prototype, "stepType", void 0);
19157
+ __decorate$14([
19158
+ Event()
19159
+ ], Stepper.prototype, "stepChanged", void 0);
19160
+ __decorate$14([
19161
+ Event()
19162
+ ], Stepper.prototype, "stepChanging", void 0);
19163
+ __decorate$14([
19164
+ Event()
19165
+ ], Stepper.prototype, "stepClick", void 0);
19166
+ __decorate$14([
19167
+ Event()
19168
+ ], Stepper.prototype, "beforeStepRender", void 0);
19169
+ Stepper = __decorate$14([
19170
+ NotifyPropertyChanges
19171
+ ], Stepper);
19172
+
19173
+ /** Stepper export modules */
19174
+
17846
19175
  /**
17847
19176
  * Navigation all modules
17848
19177
  */
17849
19178
 
17850
- export { MenuAnimationSettings, MenuItem, FieldSettings, HScroll, VScroll, addScrolling, destroyScroll, Item, Toolbar, AccordionActionSettings, AccordionAnimationSettings, AccordionItem, Accordion, ContextMenu, Menu, TabActionSettings, TabAnimationSettings, Header, TabItem, Tab, FieldsSettings, ActionSettings, NodeAnimationSettings, TreeView, Sidebar, BreadcrumbOverflowMode, BreadcrumbItem, Breadcrumb, CarouselSwipeMode, CarouselItem, Carousel, AppBar };
19179
+ export { MenuAnimationSettings, MenuItem, FieldSettings, HScroll, VScroll, addScrolling, destroyScroll, Item, Toolbar, AccordionActionSettings, AccordionAnimationSettings, AccordionItem, Accordion, ContextMenu, Menu, TabActionSettings, TabAnimationSettings, Header, TabItem, Tab, FieldsSettings, ActionSettings, NodeAnimationSettings, TreeView, Sidebar, BreadcrumbOverflowMode, BreadcrumbItem, Breadcrumb, CarouselSwipeMode, CarouselItem, Carousel, AppBar, StepStatus, Step, StepperOrientation, StepperBase, StepperAnimationSettings, StepLabelPosition, StepType, Stepper };
17851
19180
  //# sourceMappingURL=ej2-navigations.es2015.js.map