@syncfusion/ej2-navigations 23.2.7 → 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 +6 -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 +1346 -11
  6. package/dist/es6/ej2-navigations.es2015.js.map +1 -1
  7. package/dist/es6/ej2-navigations.es5.js +1394 -11
  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 +5 -4
  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';
@@ -1337,6 +1337,10 @@ var MenuBase = /** @__PURE__ @class */ (function (_super) {
1337
1337
  }
1338
1338
  }
1339
1339
  }
1340
+ else {
1341
+ this.element.parentElement.setAttribute('role', 'dialog');
1342
+ this.element.parentElement.setAttribute('aria-label', 'context menu');
1343
+ }
1340
1344
  };
1341
1345
  MenuBase.prototype.wireEvents = function () {
1342
1346
  var wrapper = this.getWrapper();
@@ -4185,6 +4189,10 @@ var Toolbar = /** @__PURE__ @class */ (function (_super) {
4185
4189
  if (this.cssClass) {
4186
4190
  addClass([innerItems[0]], this.cssClass.split(' '));
4187
4191
  }
4192
+ var scrollEle = this.scrollModule.element.querySelector('.' + CLS_HSCROLLBAR$1 + ', .' + 'e-vscroll-bar');
4193
+ if (scrollEle) {
4194
+ scrollEle.removeAttribute('tabindex');
4195
+ }
4188
4196
  this.remove(this.scrollModule.element, CLS_TBARPOS);
4189
4197
  setStyleAttribute(this.element, { overflow: 'hidden' });
4190
4198
  }
@@ -8926,7 +8934,6 @@ var Tab = /** @__PURE__ @class */ (function (_super) {
8926
8934
  var scrCnt = select('.' + this.scrCntClass, this.tbItems);
8927
8935
  if (!this.isVertical() && !isNullOrUndefined(scrCnt)) {
8928
8936
  var scrBar = select('.e-hscroll-bar', this.tbItems);
8929
- scrBar.removeAttribute('tabindex');
8930
8937
  var scrStart = scrBar.scrollLeft;
8931
8938
  var scrEnd = scrStart + scrBar.offsetWidth;
8932
8939
  var eleStart = target.offsetLeft;
@@ -10356,9 +10363,11 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
10356
10363
  TreeView.prototype.setDisabledMode = function () {
10357
10364
  if (this.disabled) {
10358
10365
  this.element.classList.add(DISABLED$1);
10366
+ this.element.setAttribute('aria-disabled', 'true');
10359
10367
  }
10360
10368
  else {
10361
10369
  this.element.classList.remove(DISABLED$1);
10370
+ this.element.setAttribute('aria-disabled', 'false');
10362
10371
  }
10363
10372
  };
10364
10373
  TreeView.prototype.setEnableRtl = function () {
@@ -10381,12 +10390,11 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
10381
10390
  (isEnabled ? addClass : removeClass)([this.element], FULLROWWRAP);
10382
10391
  };
10383
10392
  TreeView.prototype.setMultiSelect = function (isEnabled) {
10384
- var firstUl = select('.' + PARENTITEM, this.element);
10385
10393
  if (isEnabled) {
10386
- firstUl.setAttribute('aria-multiselectable', 'true');
10394
+ this.element.setAttribute('aria-multiselectable', 'true');
10387
10395
  }
10388
10396
  else {
10389
- firstUl.removeAttribute('aria-multiselectable');
10397
+ this.element.setAttribute('aria-multiselectable', 'false');
10390
10398
  }
10391
10399
  };
10392
10400
  // eslint-disable-next-line
@@ -10754,7 +10762,7 @@ var TreeView = /** @__PURE__ @class */ (function (_super) {
10754
10762
  if (this.showCheckBox) {
10755
10763
  var checkboxEle = createCheckBox(this.createElement, true, { cssClass: this.touchClass });
10756
10764
  checkboxEle.setAttribute('role', 'checkbox');
10757
- checkboxEle.setAttribute('aria-label', 'checkbox');
10765
+ checkboxEle.setAttribute('aria-label', e.text);
10758
10766
  var icon = select('div.' + ICON, e.item);
10759
10767
  var id = e.item.getAttribute('data-uid');
10760
10768
  e.item.childNodes[0].insertBefore(checkboxEle, e.item.childNodes[0].childNodes[isNullOrUndefined(icon) ? 0 : 1]);
@@ -16082,7 +16090,9 @@ var Breadcrumb = /** @__PURE__ @class */ (function (_super) {
16082
16090
  };
16083
16091
  Breadcrumb.prototype.initialize = function () {
16084
16092
  this._maxItems = this.maxItems;
16085
- this.element.setAttribute('aria-label', 'breadcrumb');
16093
+ if (isNullOrUndefined(this.element.getAttribute('aria-label'))) {
16094
+ this.element.setAttribute('aria-label', 'breadcrumb');
16095
+ }
16086
16096
  if (this.cssClass) {
16087
16097
  addClass([this.element], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
16088
16098
  }
@@ -16411,6 +16421,9 @@ var Breadcrumb = /** @__PURE__ @class */ (function (_super) {
16411
16421
  };
16412
16422
  Breadcrumb.prototype.beforeItemRenderChanges = function (prevItem, currItem, elem, isRightIcon) {
16413
16423
  var wrapElem = elem.querySelector('.e-anchor-wrap');
16424
+ if (wrapElem) {
16425
+ wrapElem.parentElement.setAttribute('aria-label', 'home');
16426
+ }
16414
16427
  if (currItem.text !== prevItem.text) {
16415
16428
  wrapElem.childNodes.forEach(function (child) {
16416
16429
  if (child.nodeType === Node.TEXT_NODE) {
@@ -17059,7 +17072,7 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
17059
17072
  }
17060
17073
  addClass([this.element], carouselClasses);
17061
17074
  setStyleAttribute(this.element, { 'width': formatUnit(this.width), 'height': formatUnit(this.height) });
17062
- attributes(this.element, { 'tabindex': '0', 'role': 'group', 'aria-roledescription': 'carousel', 'aria-label': this.localeObj.getConstant('slideShow') });
17075
+ attributes(this.element, { 'role': 'group', 'aria-roledescription': 'carousel', 'aria-label': this.localeObj.getConstant('slideShow') });
17063
17076
  if (!isNullOrUndefined(this.htmlAttributes)) {
17064
17077
  this.setHtmlAttributes(this.htmlAttributes, this.element);
17065
17078
  }
@@ -17068,7 +17081,7 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
17068
17081
  var _this = this;
17069
17082
  var slideContainer = this.element.querySelector('.' + CLS_SLIDE_CONTAINER);
17070
17083
  if (!slideContainer) {
17071
- slideContainer = this.createElement('div', { className: CLS_SLIDE_CONTAINER });
17084
+ slideContainer = this.createElement('div', { className: CLS_SLIDE_CONTAINER, attrs: { 'tabindex': '0', 'role': 'tabpanel' } });
17072
17085
  this.element.appendChild(slideContainer);
17073
17086
  }
17074
17087
  this.itemsContainer = this.createElement('div', { className: CLS_ITEMS$2, attrs: { 'aria-live': this.autoPlay ? 'off' : 'polite' } });
@@ -17977,7 +17990,7 @@ var Carousel = /** @__PURE__ @class */ (function (_super) {
17977
17990
  this.unWireEvents();
17978
17991
  [].slice.call(this.element.children).forEach(function (ele) { _this.element.removeChild(ele); });
17979
17992
  removeClass([this.element], [CLS_CAROUSEL, this.cssClass, CLS_RTL$5, CLS_SWIPE]);
17980
- ['tabindex', 'role', 'style'].forEach(function (attr) { _this.element.removeAttribute(attr); });
17993
+ ['role', 'style'].forEach(function (attr) { _this.element.removeAttribute(attr); });
17981
17994
  this.itemsContainer = null;
17982
17995
  _super.prototype.destroy.call(this);
17983
17996
  };
@@ -18288,9 +18301,1379 @@ var AppBar = /** @__PURE__ @class */ (function (_super) {
18288
18301
 
18289
18302
  /** AppBar export modules */
18290
18303
 
18304
+ var __extends$13 = (undefined && undefined.__extends) || (function () {
18305
+ var extendStatics = function (d, b) {
18306
+ extendStatics = Object.setPrototypeOf ||
18307
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
18308
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
18309
+ return extendStatics(d, b);
18310
+ };
18311
+ return function (d, b) {
18312
+ extendStatics(d, b);
18313
+ function __() { this.constructor = d; }
18314
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18315
+ };
18316
+ })();
18317
+ var __decorate$13 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
18318
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
18319
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
18320
+ 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;
18321
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
18322
+ };
18323
+ var PROGRESSVALUE = '--progress-value';
18324
+ /**
18325
+ * Defines the status of the step.
18326
+ */
18327
+ var StepStatus;
18328
+ (function (StepStatus) {
18329
+ /**
18330
+ * Shows the status of the step is not started.
18331
+ */
18332
+ StepStatus["NotStarted"] = "NotStarted";
18333
+ /**
18334
+ * Shows the step is in progress.
18335
+ */
18336
+ StepStatus["InProgress"] = "InProgress";
18337
+ /**
18338
+ * Shows the status of the step is completed.
18339
+ */
18340
+ StepStatus["Completed"] = "Completed";
18341
+ })(StepStatus || (StepStatus = {}));
18342
+ /**
18343
+ * Specifies the steps of the Stepper.
18344
+ */
18345
+ var Step = /** @__PURE__ @class */ (function (_super) {
18346
+ __extends$13(Step, _super);
18347
+ function Step() {
18348
+ return _super !== null && _super.apply(this, arguments) || this;
18349
+ }
18350
+ __decorate$13([
18351
+ Property('')
18352
+ ], Step.prototype, "cssClass", void 0);
18353
+ __decorate$13([
18354
+ Property(false)
18355
+ ], Step.prototype, "disabled", void 0);
18356
+ __decorate$13([
18357
+ Property('')
18358
+ ], Step.prototype, "iconCss", void 0);
18359
+ __decorate$13([
18360
+ Property(null)
18361
+ ], Step.prototype, "isValid", void 0);
18362
+ __decorate$13([
18363
+ Property('')
18364
+ ], Step.prototype, "label", void 0);
18365
+ __decorate$13([
18366
+ Property(false)
18367
+ ], Step.prototype, "optional", void 0);
18368
+ __decorate$13([
18369
+ Property(StepStatus.NotStarted)
18370
+ ], Step.prototype, "status", void 0);
18371
+ __decorate$13([
18372
+ Property('')
18373
+ ], Step.prototype, "text", void 0);
18374
+ return Step;
18375
+ }(ChildProperty));
18376
+ /**
18377
+ * Defines the orientation type of the Stepper.
18378
+ */
18379
+ var StepperOrientation;
18380
+ (function (StepperOrientation) {
18381
+ /**
18382
+ * Steps are displayed horizontally.
18383
+ */
18384
+ StepperOrientation["Horizontal"] = "Horizontal";
18385
+ /**
18386
+ * Steps are displayed vertically.
18387
+ */
18388
+ StepperOrientation["Vertical"] = "Vertical";
18389
+ })(StepperOrientation || (StepperOrientation = {}));
18390
+ /**
18391
+ * StepperBase component act as base class to the stepper component.
18392
+ */
18393
+ var StepperBase = /** @__PURE__ @class */ (function (_super) {
18394
+ __extends$13(StepperBase, _super);
18395
+ /**
18396
+ * * Constructor for Base class
18397
+ *
18398
+ * @param {StepperBaseModel} options - Specifies the Base model.
18399
+ * @param {string | HTMLElement} element - Specifies the element to render as component.
18400
+ * @private
18401
+ */
18402
+ function StepperBase(options, element) {
18403
+ return _super.call(this, options, element) || this;
18404
+ }
18405
+ /**
18406
+ * This method is abstract member of the Component<HTMLElement>.
18407
+ *
18408
+ * @private
18409
+ * @returns {void}
18410
+ */
18411
+ StepperBase.prototype.preRender = function () {
18412
+ };
18413
+ /**
18414
+ * This method is abstract member of the Component<HTMLElement>.
18415
+ *
18416
+ * @private
18417
+ * @returns {string}
18418
+ */
18419
+ StepperBase.prototype.getModuleName = function () {
18420
+ return 'stepperBase';
18421
+ };
18422
+ /**
18423
+ * This method is abstract member of the Component<HTMLElement>.
18424
+ *
18425
+ * @private
18426
+ * @returns {string}
18427
+ */
18428
+ StepperBase.prototype.getPersistData = function () {
18429
+ return this.addOnPersist([]);
18430
+ };
18431
+ /**
18432
+ * This method is abstract member of the Component<HTMLElement>.
18433
+ *
18434
+ * @private
18435
+ * @returns {void}
18436
+ */
18437
+ StepperBase.prototype.render = function () {
18438
+ };
18439
+ StepperBase.prototype.updateOrientaion = function (wrapper) {
18440
+ if (wrapper.classList.contains('e-horizontal') || wrapper.classList.contains('e-vertical')) {
18441
+ wrapper.classList.contains('e-horizontal') ? wrapper.classList.remove('e-horizontal') : wrapper.classList.remove('e-vertical');
18442
+ }
18443
+ wrapper.classList.add('e-' + this.orientation.toLocaleLowerCase());
18444
+ };
18445
+ StepperBase.prototype.renderProgressBar = function (wrapper) {
18446
+ this.progressStep = this.createElement('div', { className: 'e-stepper-progressbar' });
18447
+ this.progressbar = this.createElement('div', { className: 'e-progressbar-value' });
18448
+ this.progressStep.appendChild(this.progressbar);
18449
+ wrapper.prepend(this.progressStep);
18450
+ this.progressbar.style.setProperty(PROGRESSVALUE, (0) + '%');
18451
+ var beforeLabel = (wrapper.querySelector('li').querySelector('.e-step-label-container'));
18452
+ if (wrapper.classList.contains('e-vertical')) {
18453
+ if (wrapper.classList.contains('e-label-bottom') || wrapper.classList.contains('e-label-top')) {
18454
+ var stepsContainer = (wrapper.querySelector('.e-stepper-steps'));
18455
+ this.progressStep.style.setProperty('--progress-position', (stepsContainer.offsetWidth / 2) + 'px');
18456
+ }
18457
+ else {
18458
+ this.progressStep.style.setProperty('--progress-position', ((this.progressBarPosition / 2) - 1) + 'px');
18459
+ }
18460
+ }
18461
+ if (beforeLabel && (beforeLabel.classList.contains('e-label-before'))) {
18462
+ this.progressStep.style.setProperty('--progress-position', (((this.progressBarPosition) - 1)) + 5 + 'px');
18463
+ }
18464
+ if (wrapper.classList.contains('e-horizontal')) {
18465
+ this.setProgressPosition(wrapper);
18466
+ }
18467
+ };
18468
+ StepperBase.prototype.setProgressPosition = function (wrapper, isResize) {
18469
+ var stepItemContainer = (wrapper.querySelector('.e-step-container'));
18470
+ var stepItemEle = stepItemContainer.firstElementChild;
18471
+ if (isResize != true) {
18472
+ var topPos = 0;
18473
+ if (wrapper.classList.contains('e-label-before')) {
18474
+ topPos = (stepItemContainer.offsetParent.offsetHeight - (stepItemEle.offsetHeight / 2) - 1);
18475
+ }
18476
+ else {
18477
+ topPos = (stepItemEle.offsetHeight / 2);
18478
+ }
18479
+ this.progressStep.style.setProperty('--progress-top-position', topPos + 'px');
18480
+ }
18481
+ var lastEle = wrapper.querySelector('.e-stepper-steps').lastChild.firstChild;
18482
+ if (wrapper.classList.contains('e-rtl')) {
18483
+ var leftPost = ((stepItemEle.offsetLeft + stepItemEle.offsetWidth) - wrapper.querySelector('.e-stepper-steps').offsetWidth);
18484
+ this.progressStep.style.setProperty('--progress-left-position', Math.abs(leftPost) + 'px');
18485
+ this.progressStep.style.setProperty('--progress-bar-width', Math.abs(lastEle.offsetLeft - stepItemEle.offsetLeft) + 'px');
18486
+ }
18487
+ else {
18488
+ this.progressStep.style.setProperty('--progress-left-position', (stepItemEle.offsetLeft + 1) + 'px');
18489
+ this.progressStep.style.setProperty('--progress-bar-width', ((lastEle.offsetWidth + lastEle.offsetLeft - 2) - (stepItemEle.offsetLeft + 2)) + 'px');
18490
+ }
18491
+ };
18492
+ /**
18493
+ * This method is abstract member of the Component<HTMLElement>.
18494
+ *
18495
+ * @param newProp
18496
+ * @param oldProp
18497
+ * @private
18498
+ * @returns {void}
18499
+ */
18500
+ StepperBase.prototype.onPropertyChanged = function (newProp, oldProp) {
18501
+ };
18502
+ __decorate$13([
18503
+ Collection([], Step)
18504
+ ], StepperBase.prototype, "steps", void 0);
18505
+ __decorate$13([
18506
+ Property('')
18507
+ ], StepperBase.prototype, "cssClass", void 0);
18508
+ __decorate$13([
18509
+ Property(false)
18510
+ ], StepperBase.prototype, "readOnly", void 0);
18511
+ __decorate$13([
18512
+ Property(StepperOrientation.Horizontal)
18513
+ ], StepperBase.prototype, "orientation", void 0);
18514
+ __decorate$13([
18515
+ Event()
18516
+ ], StepperBase.prototype, "created", void 0);
18517
+ StepperBase = __decorate$13([
18518
+ NotifyPropertyChanges
18519
+ ], StepperBase);
18520
+ return StepperBase;
18521
+ }(Component));
18522
+
18523
+ /**
18524
+ * export all modules from current location
18525
+ */
18526
+
18527
+ var __extends$14 = (undefined && undefined.__extends) || (function () {
18528
+ var extendStatics = function (d, b) {
18529
+ extendStatics = Object.setPrototypeOf ||
18530
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
18531
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
18532
+ return extendStatics(d, b);
18533
+ };
18534
+ return function (d, b) {
18535
+ extendStatics(d, b);
18536
+ function __() { this.constructor = d; }
18537
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
18538
+ };
18539
+ })();
18540
+ var __decorate$14 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
18541
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
18542
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
18543
+ 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;
18544
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
18545
+ };
18546
+ // eslint-disable-next-line @typescript-eslint/triple-slash-reference
18547
+ ///<reference path='../stepper-base/stepper-base-model.d.ts'/>
18548
+ var ITEMCONTAINER = 'e-step-container';
18549
+ var ITEMLIST = 'e-stepper-steps';
18550
+ var ICONCSS = 'e-indicator';
18551
+ var TEXTCSS = 'e-step-text-container';
18552
+ var STEPLABEL = 'e-step-label-container';
18553
+ var OPTIONAL = 'e-step-label-optional';
18554
+ var SELECTED$2 = 'e-step-selected';
18555
+ var INPROGRESS = 'e-step-inprogress';
18556
+ var NOTSTARTED = 'e-step-notstarted';
18557
+ var FOCUS$1 = 'e-step-focus';
18558
+ var COMPLETED = 'e-step-completed';
18559
+ var DISABLED$2 = 'e-step-disabled';
18560
+ var READONLY = 'e-stepper-readonly';
18561
+ var PROGRESSVALUE$1 = '--progress-value';
18562
+ var RTL$3 = 'e-rtl';
18563
+ var TEMPLATE = 'e-step-template';
18564
+ var LABELAFTER = 'e-label-after';
18565
+ var LABELBEFORE = 'e-label-before';
18566
+ var VERTICALSTEP = 'e-vertical';
18567
+ var HORIZSTEP = 'e-horizontal';
18568
+ var STEPICON = 'e-step-icon';
18569
+ var STEPTEXT = 'e-step-text';
18570
+ var TEXT = 'e-text';
18571
+ var STEPSLABEL = 'e-step-label';
18572
+ var LABEL = 'e-label';
18573
+ var STEPINDICATOR = 'e-step-type-indicator';
18574
+ var LABELINDICATOR = 'e-step-type-label';
18575
+ var INDICATORICON = 'e-step-indicator';
18576
+ var STEPPERTOOLTIP = 'e-stepper-tooltip';
18577
+ var STEPPERIPROGRESSTIP = 'e-step-inprogress-tip';
18578
+ /**
18579
+ * Defines the step progress animation of the Stepper.
18580
+ */
18581
+ var StepperAnimationSettings = /** @__PURE__ @class */ (function (_super) {
18582
+ __extends$14(StepperAnimationSettings, _super);
18583
+ function StepperAnimationSettings() {
18584
+ return _super !== null && _super.apply(this, arguments) || this;
18585
+ }
18586
+ __decorate$14([
18587
+ Property(true)
18588
+ ], StepperAnimationSettings.prototype, "enable", void 0);
18589
+ __decorate$14([
18590
+ Property(2000)
18591
+ ], StepperAnimationSettings.prototype, "duration", void 0);
18592
+ __decorate$14([
18593
+ Property(0)
18594
+ ], StepperAnimationSettings.prototype, "delay", void 0);
18595
+ return StepperAnimationSettings;
18596
+ }(ChildProperty));
18597
+ /**
18598
+ * Defines the label position in the Stepper.
18599
+ */
18600
+ var StepLabelPosition;
18601
+ (function (StepLabelPosition) {
18602
+ /**
18603
+ * Displays the label on top position regardless of the Stepper's orientation.
18604
+ */
18605
+ StepLabelPosition["Top"] = "Top";
18606
+ /**
18607
+ * Displays the label on bottom position regardless of the Stepper's orientation.
18608
+ */
18609
+ StepLabelPosition["Bottom"] = "Bottom";
18610
+ /**
18611
+ * Displays the label on left side regardless of the Stepper's orientation.
18612
+ */
18613
+ StepLabelPosition["Start"] = "Start";
18614
+ /**
18615
+ * Displays the label on right side regardless of the Stepper's orientation.
18616
+ */
18617
+ StepLabelPosition["End"] = "End";
18618
+ })(StepLabelPosition || (StepLabelPosition = {}));
18619
+ /**
18620
+ * Defines whether steps are display with only indicator, only labels or combination of both.
18621
+ */
18622
+ var StepType;
18623
+ (function (StepType) {
18624
+ /**
18625
+ * Steps are shown indicator with label defined.
18626
+ */
18627
+ StepType["Default"] = "Default";
18628
+ /**
18629
+ * Steps are shown with only label.
18630
+ */
18631
+ StepType["Label"] = "Label";
18632
+ /**
18633
+ * Steps are shown with only indicator.
18634
+ */
18635
+ StepType["Indicator"] = "Indicator";
18636
+ })(StepType || (StepType = {}));
18637
+ /**
18638
+ * The Stepper component visualizes several steps and indicates the current progress by highlighting already completed steps.
18639
+ *
18640
+ * ```html
18641
+ * <nav id="stepper"></nav>
18642
+ * ```
18643
+ * ```typescript
18644
+ * <script>
18645
+ * let stepperObj: Stepper = new Stepper({steps : [{}, {}, {}, {}, {}]});
18646
+ * stepperObj.appendTo('#stepper');
18647
+ * </script>
18648
+ * ```
18649
+ */
18650
+ var Stepper = /** @__PURE__ @class */ (function (_super) {
18651
+ __extends$14(Stepper, _super);
18652
+ /**
18653
+ * * Constructor for creating the Stepper component.
18654
+ *
18655
+ * @param {StepperModel} options - Specifies the Stepper model.
18656
+ * @param {string | HTMLElement} element - Specifies the element to render as component.
18657
+ * @private
18658
+ */
18659
+ function Stepper(options, element) {
18660
+ var _this = _super.call(this, options, element) || this;
18661
+ _this.stepperItemElements = [];
18662
+ return _this;
18663
+ }
18664
+ Stepper.prototype.preRender = function () {
18665
+ if (!this.element.id) {
18666
+ this.element.id = getUniqueID('e-' + this.getModuleName());
18667
+ }
18668
+ var localeText = { optional: 'Optional' };
18669
+ this.l10n = new L10n('stepper', localeText, this.locale);
18670
+ this.keyConfigs = {
18671
+ downarrow: 'downarrow',
18672
+ leftarrow: 'leftarrow',
18673
+ rightarrow: 'rightarrow',
18674
+ uparrow: 'uparrow',
18675
+ space: 'space',
18676
+ enter: 'enter',
18677
+ home: 'home',
18678
+ end: 'end',
18679
+ tab: 'tab',
18680
+ escape: 'escape'
18681
+ };
18682
+ this.tooltipOpen = false;
18683
+ };
18684
+ /**
18685
+ * To get component name.
18686
+ *
18687
+ * @returns {string} - Module Name
18688
+ * @private
18689
+ */
18690
+ Stepper.prototype.getModuleName = function () {
18691
+ return 'stepper';
18692
+ };
18693
+ Stepper.prototype.render = function () {
18694
+ this.initialize();
18695
+ this.navigationHandler(this.activeStep, null, false);
18696
+ this.updateStepperStatus(true);
18697
+ };
18698
+ Stepper.prototype.initialize = function () {
18699
+ var _this = this;
18700
+ this.element.setAttribute('aria-label', this.element.id);
18701
+ this.updatePosition();
18702
+ this.stepperItemList = this.createElement('ol', { className: ITEMLIST });
18703
+ this.updateOrientaion(this.element);
18704
+ this.updateStepType();
18705
+ this.element.appendChild(this.stepperItemList);
18706
+ if (this.cssClass) {
18707
+ addClass([this.element], this.cssClass.trim().split(' '));
18708
+ }
18709
+ if (this.readOnly) {
18710
+ this.element.classList.add(READONLY);
18711
+ }
18712
+ if (this.enableRtl) {
18713
+ this.element.classList.add(RTL$3);
18714
+ }
18715
+ this.wireEvents();
18716
+ this.updateTemplateFunction();
18717
+ this.renderItems();
18718
+ if (this.steps.length > 0) {
18719
+ if (this.steps.length > 1) {
18720
+ if (this.isAngular && this.template) {
18721
+ setTimeout(function () {
18722
+ _this.renderProgressBar(_this.element);
18723
+ });
18724
+ }
18725
+ else {
18726
+ this.renderProgressBar(this.element);
18727
+ }
18728
+ }
18729
+ this.checkValidStep();
18730
+ this.updateAnimation();
18731
+ this.updateTooltip();
18732
+ this.wireKeyboardEvent();
18733
+ }
18734
+ };
18735
+ Stepper.prototype.updatePosition = function () {
18736
+ this.progressBarPosition = this.beforeLabelWidth = this.textEleWidth = 0;
18737
+ };
18738
+ Stepper.prototype.renderDefault = function (index) {
18739
+ return (!this.steps[parseInt((index).toString(), 10)].iconCss && !this.steps[parseInt((index).toString(), 10)].text &&
18740
+ !this.steps[parseInt((index).toString(), 10)].label) ? true : false;
18741
+ };
18742
+ Stepper.prototype.updateAnimation = function () {
18743
+ var progressEle = this.element.querySelector('.e-progressbar-value');
18744
+ if (this.animation.enable) {
18745
+ if (this.animation.duration >= 0) {
18746
+ if (progressEle) {
18747
+ progressEle.style.setProperty('--duration', ((this.animation.duration) + 'ms'));
18748
+ }
18749
+ }
18750
+ if (this.animation.delay >= 0) {
18751
+ if (progressEle) {
18752
+ progressEle.style.setProperty('--delay', ((this.animation.delay) + 'ms'));
18753
+ }
18754
+ }
18755
+ }
18756
+ else {
18757
+ if (progressEle) {
18758
+ progressEle.style.setProperty('--delay', (0 + 'ms'));
18759
+ progressEle.style.setProperty('--duration', (0 + 'ms'));
18760
+ }
18761
+ }
18762
+ };
18763
+ Stepper.prototype.updateStepType = function () {
18764
+ if (this.stepType.toLowerCase() === 'indicator' || 'label' || 'default') {
18765
+ this.stepType.toLowerCase() !== 'default' ? this.element.classList.add('e-step-type-' + this.stepType.toLowerCase()) : '';
18766
+ if (((this.stepType.toLowerCase() === 'indicator' || 'label') && (this.labelContainer))) {
18767
+ this.clearLabelPosition();
18768
+ }
18769
+ }
18770
+ };
18771
+ Stepper.prototype.wireEvents = function () {
18772
+ var _this = this;
18773
+ EventHandler.add(window, 'resize', function () {
18774
+ if (_this.stepperItemList && _this.progressbar && _this.element.classList.contains(HORIZSTEP)) {
18775
+ _this.setProgressPosition(_this.element, true);
18776
+ }
18777
+ }, this);
18778
+ EventHandler.add(window, 'click', function () { _this.updateStepFocus(); }, this);
18779
+ };
18780
+ Stepper.prototype.updateStepFocus = function () {
18781
+ if (this.isKeyNavFocus) {
18782
+ this.isKeyNavFocus = false;
18783
+ var isFocus = this.element.querySelector('.' + FOCUS$1);
18784
+ if (isFocus) {
18785
+ isFocus.classList.remove(FOCUS$1);
18786
+ this.element.classList.remove('e-steps-focus');
18787
+ }
18788
+ }
18789
+ };
18790
+ Stepper.prototype.updateStepperStatus = function (isInitial) {
18791
+ for (var index = 0; index < this.steps.length; index++) {
18792
+ var item = this.steps[parseInt(index.toString(), 10)];
18793
+ var status_1 = item.status.toLowerCase();
18794
+ if (isInitial && this.activeStep === 0 && index === 0) {
18795
+ item.status = StepStatus.InProgress;
18796
+ }
18797
+ if (item && status_1 !== 'notstarted' && index === this.activeStep) {
18798
+ for (var i = 0; i < this.steps.length; i++) {
18799
+ var itemElement = this.stepperItemElements[parseInt(i.toString(), 10)];
18800
+ itemElement.classList.remove(SELECTED$2, INPROGRESS, COMPLETED, NOTSTARTED);
18801
+ var prevOnChange = this.isProtectedOnChange;
18802
+ this.isProtectedOnChange = true;
18803
+ if (status_1 === 'completed') {
18804
+ this.updateStatusClass(i, index, itemElement);
18805
+ }
18806
+ else {
18807
+ this.updateStatusClass(i, index, itemElement, true);
18808
+ }
18809
+ this.isProtectedOnChange = prevOnChange;
18810
+ }
18811
+ }
18812
+ else if (item && status_1 !== 'notstarted' && index !== this.activeStep) {
18813
+ this.navigationHandler(this.activeStep, null, true);
18814
+ }
18815
+ }
18816
+ };
18817
+ Stepper.prototype.updateStatusClass = function (currentStep, index, ele, isInprogress) {
18818
+ var stepItem = this.steps[parseInt(currentStep.toString(), 10)];
18819
+ if (currentStep < index) {
18820
+ ele.classList.add(COMPLETED);
18821
+ stepItem.status = StepStatus.Completed;
18822
+ }
18823
+ else if (currentStep === index) {
18824
+ ele.classList.add(isInprogress ? INPROGRESS : COMPLETED, SELECTED$2);
18825
+ }
18826
+ else {
18827
+ ele.classList.add(NOTSTARTED);
18828
+ }
18829
+ };
18830
+ Stepper.prototype.renderItems = function () {
18831
+ var _this = this;
18832
+ for (var index = 0; index < this.steps.length; index++) {
18833
+ this.stepperItemContainer = this.createElement('li', { className: ITEMCONTAINER });
18834
+ this.stepperItemContainer.classList[(index === 0) ? 'add' : 'remove'](SELECTED$2, INPROGRESS);
18835
+ this.stepperItemContainer.classList[(index !== 0) ? 'add' : 'remove'](NOTSTARTED);
18836
+ if (this.element.classList.contains(HORIZSTEP)) {
18837
+ this.stepperItemContainer.style.setProperty('--max-width', 100 / this.steps.length + '%');
18838
+ }
18839
+ var stepSpan = this.createElement('span', { className: 'e-step' });
18840
+ if (this.renderDefault(index) && (isNullOrUndefined(this.template) || this.template === '')) {
18841
+ var isIndicator = (!this.element.classList.contains('e-step-type-default') && this.stepType.toLowerCase() === 'indicator') ? true : false;
18842
+ if (isIndicator) {
18843
+ stepSpan.classList.add('e-icons', INDICATORICON);
18844
+ }
18845
+ if (!isIndicator) {
18846
+ stepSpan.classList.add('e-step-content');
18847
+ stepSpan.innerHTML = (index + 1).toString();
18848
+ }
18849
+ this.stepperItemContainer.appendChild(stepSpan);
18850
+ }
18851
+ else if (isNullOrUndefined(this.template) || this.template === '') {
18852
+ var isRender = true;
18853
+ var item = this.steps[parseInt(index.toString(), 10)];
18854
+ if (item.iconCss && (((!item.text && !item.label) || !this.element.classList.contains(LABELINDICATOR)))) {
18855
+ var itemIcon = item.iconCss.trim().split(' ');
18856
+ stepSpan.classList.add(ICONCSS);
18857
+ for (var i = 0; i < itemIcon.length; i++) {
18858
+ stepSpan.classList.add(itemIcon[parseInt(i.toString(), 10)]);
18859
+ }
18860
+ this.stepperItemContainer.appendChild(stepSpan);
18861
+ this.stepperItemContainer.classList.add(STEPICON);
18862
+ if ((this.element.classList.contains(HORIZSTEP) && (this.labelPosition.toLowerCase() === 'start' || this.labelPosition.toLowerCase() === 'end') && item.label) ||
18863
+ (this.element.classList.contains(VERTICALSTEP) && (this.labelPosition.toLowerCase() === 'top' || this.labelPosition.toLowerCase() === 'bottom') && item.label)) {
18864
+ this.element.classList.add('e-label-' + this.labelPosition.toLowerCase());
18865
+ var textSpan = this.createElement('span', { className: TEXTCSS + ' ' + TEXT });
18866
+ textSpan.innerText = item.label;
18867
+ this.stepperItemContainer.appendChild(textSpan);
18868
+ this.stepperItemContainer.classList.add(STEPTEXT);
18869
+ isRender = false;
18870
+ }
18871
+ }
18872
+ if (item.text && (!item.iconCss || !this.element.classList.contains(STEPINDICATOR)) && isRender && !(item.iconCss && item.label)) {
18873
+ if (!item.iconCss && this.element.classList.contains(STEPINDICATOR)) {
18874
+ this.checkValidState(item, stepSpan);
18875
+ var prevOnChange = this.isProtectedOnChange;
18876
+ this.isProtectedOnChange = true;
18877
+ item.label = null;
18878
+ this.isProtectedOnChange = prevOnChange;
18879
+ }
18880
+ else {
18881
+ this.textContainer = this.createElement('span', { className: TEXTCSS });
18882
+ var textSpan = this.createElement('span', { className: TEXT });
18883
+ if (!item.label) {
18884
+ textSpan.innerText = item.text;
18885
+ (item.isValid !== null && (!item.iconCss || this.element.classList.contains(LABELINDICATOR))) ? this.textContainer.appendChild(textSpan) : textSpan.classList.add(TEXTCSS);
18886
+ this.stepperItemContainer.appendChild((item.isValid !== null && (!item.iconCss || this.element.classList.contains(LABELINDICATOR))) ? this.textContainer : textSpan);
18887
+ this.stepperItemContainer.classList.add(STEPTEXT);
18888
+ }
18889
+ if (!item.iconCss || this.element.classList.contains(LABELINDICATOR)) {
18890
+ this.stepperItemContainer.classList.add('e-step-text-only');
18891
+ if (!item.label && item.isValid !== null) {
18892
+ var iconSpan = this.createElement('span', { className: 'e-step-validation-icon e-icons' });
18893
+ this.textContainer.appendChild(iconSpan);
18894
+ }
18895
+ }
18896
+ if (item.label && this.element.classList.contains(LABELINDICATOR)) {
18897
+ textSpan.innerText = item.label;
18898
+ }
18899
+ var prevOnChange = this.isProtectedOnChange;
18900
+ this.isProtectedOnChange = true;
18901
+ item.text = item.label ? null : item.text;
18902
+ this.isProtectedOnChange = prevOnChange;
18903
+ }
18904
+ }
18905
+ if (item.cssClass) {
18906
+ addClass([this.stepperItemContainer], item.cssClass.trim().split(' '));
18907
+ }
18908
+ if (item.disabled) {
18909
+ this.stepperItemContainer.classList[item.disabled ? 'add' : 'remove'](DISABLED$2);
18910
+ attributes(this.stepperItemContainer, { 'tabindex': '-1', 'aria-disabled': 'true' });
18911
+ }
18912
+ if (item.label && (!item.iconCss || !this.element.classList.contains(STEPINDICATOR)) && isRender) {
18913
+ if (!item.iconCss && !item.text && this.element.classList.contains(STEPINDICATOR)) {
18914
+ this.checkValidState(item, stepSpan, true);
18915
+ }
18916
+ else if ((!((this.element.classList.contains(LABELINDICATOR)) && item.text)) || (this.element.classList.contains(LABELINDICATOR) && item.label)) {
18917
+ this.labelContainer = this.createElement('span', { className: STEPLABEL });
18918
+ var labelSpan = this.createElement('span', { className: LABEL });
18919
+ labelSpan.innerText = item.label;
18920
+ this.labelContainer.appendChild(labelSpan);
18921
+ this.stepperItemContainer.classList.add(STEPSLABEL);
18922
+ this.updateLabelPosition();
18923
+ if ((!item.iconCss && !item.text) || this.element.classList.contains(LABELINDICATOR)) {
18924
+ this.stepperItemContainer.classList.add('e-step-label-only');
18925
+ if (item.isValid !== null) {
18926
+ var iconSpan = this.createElement('span', { className: 'e-step-validation-icon e-icons' });
18927
+ this.labelContainer.appendChild(iconSpan);
18928
+ }
18929
+ }
18930
+ }
18931
+ }
18932
+ if (item.optional) {
18933
+ var optionalSpan = this.createElement('span', { className: OPTIONAL });
18934
+ this.l10n.setLocale(this.locale);
18935
+ var optionalContent = this.l10n.getConstant('optional');
18936
+ optionalSpan.innerText = optionalContent;
18937
+ if (item.label && (this.labelContainer && ((this.element.classList.contains(LABELAFTER) && !this.stepperItemContainer.classList.contains('e-step-label-only'))
18938
+ || (this.element.classList.contains(HORIZSTEP) && this.element.classList.contains(LABELBEFORE) && !this.stepperItemContainer.classList.contains('e-step-label-only'))))
18939
+ || (this.element.classList.contains(VERTICALSTEP) && this.element.classList.contains(LABELBEFORE))) {
18940
+ this.labelContainer.appendChild(optionalSpan);
18941
+ }
18942
+ else {
18943
+ this.stepperItemContainer.appendChild(optionalSpan);
18944
+ }
18945
+ }
18946
+ if (item.isValid !== null) {
18947
+ item.isValid ? this.stepperItemContainer.classList.add('e-step-valid') : this.stepperItemContainer.classList.add('e-step-error');
18948
+ }
18949
+ }
18950
+ this.renderItemContent(index, false);
18951
+ if (this.stepperItemContainer.classList.contains(INPROGRESS)) {
18952
+ attributes(this.stepperItemContainer, { 'tabindex': '0', 'aria-current': 'true' });
18953
+ }
18954
+ else {
18955
+ attributes(this.stepperItemContainer, { 'tabindex': '-1' });
18956
+ }
18957
+ this.wireItemsEvents(this.stepperItemContainer, index);
18958
+ this.stepperItemElements.push(this.stepperItemContainer);
18959
+ var eventArgs = { element: this.stepperItemContainer, index: index };
18960
+ this.trigger('beforeStepRender', eventArgs, function (args) {
18961
+ _this.stepperItemList.appendChild(args.element);
18962
+ });
18963
+ if (this.isAngular && this.template) {
18964
+ setTimeout(function () {
18965
+ _this.calculateProgressBarPosition();
18966
+ });
18967
+ }
18968
+ else {
18969
+ this.calculateProgressBarPosition();
18970
+ }
18971
+ }
18972
+ if (this.element.classList.contains(VERTICALSTEP)) {
18973
+ if (this.element.classList.contains(LABELBEFORE)) {
18974
+ var listItems = this.stepperItemList.querySelectorAll('.' + LABEL);
18975
+ for (var i = 0; i < listItems.length; i++) {
18976
+ var labelEle = listItems[parseInt((i).toString(), 10)];
18977
+ labelEle.style.setProperty('--label-width', (this.beforeLabelWidth) + 5 + 'px');
18978
+ }
18979
+ }
18980
+ }
18981
+ };
18982
+ Stepper.prototype.calculateProgressBarPosition = function () {
18983
+ var isBeforeLabel = (this.element.classList.contains(LABELBEFORE)) ? true : false;
18984
+ var isStepVertical = (this.element.classList.contains(VERTICALSTEP)) ? true : false;
18985
+ if (isStepVertical) {
18986
+ var iconOnly = (this.stepperItemContainer.classList.contains(STEPICON) && !this.stepperItemContainer.classList.contains(STEPTEXT) && !this.stepperItemContainer.classList.contains(STEPSLABEL)) ? true : false;
18987
+ var textEle = (this.stepperItemContainer.querySelector('.' + TEXTCSS));
18988
+ if (textEle) {
18989
+ this.textEleWidth = this.textEleWidth < textEle.offsetWidth ? textEle.offsetWidth : this.textEleWidth;
18990
+ }
18991
+ if (isBeforeLabel) {
18992
+ var itemWidth = void 0;
18993
+ var labelWidth = this.stepperItemContainer.querySelector('.' + LABEL).offsetWidth + 15;
18994
+ if (this.beforeLabelWidth < labelWidth) {
18995
+ this.beforeLabelWidth = labelWidth;
18996
+ }
18997
+ if (this.element.querySelector('ol').lastChild.querySelector('.' + ICONCSS)) {
18998
+ itemWidth = (this.beforeLabelWidth + (this.stepperItemContainer.querySelector('.' + ICONCSS).offsetWidth / 2));
18999
+ }
19000
+ else if (this.stepperItemContainer.querySelector('.' + TEXTCSS)) {
19001
+ itemWidth = (this.beforeLabelWidth + (this.stepperItemContainer.querySelector('.' + TEXTCSS).offsetWidth / 2));
19002
+ }
19003
+ if (this.progressBarPosition < itemWidth) {
19004
+ this.progressBarPosition = itemWidth;
19005
+ }
19006
+ }
19007
+ else if (this.progressBarPosition < (iconOnly ? this.stepperItemContainer.offsetWidth : this.element.querySelector('ol').lastChild.firstChild.offsetWidth)) {
19008
+ this.progressBarPosition = iconOnly ? this.stepperItemContainer.offsetWidth : this.element.querySelector('ol').lastChild.firstChild.offsetWidth;
19009
+ }
19010
+ }
19011
+ };
19012
+ Stepper.prototype.checkValidState = function (item, stepSpan, isLabel) {
19013
+ if (item.isValid == null) {
19014
+ stepSpan.classList.add('e-step-content');
19015
+ if (isLabel) {
19016
+ stepSpan.innerHTML = item.label;
19017
+ }
19018
+ else {
19019
+ stepSpan.innerHTML = item.label ? item.label : item.text;
19020
+ }
19021
+ this.stepperItemContainer.appendChild(stepSpan);
19022
+ }
19023
+ else {
19024
+ stepSpan.classList.add(ICONCSS);
19025
+ this.stepperItemContainer.appendChild(stepSpan);
19026
+ this.stepperItemContainer.classList.add(STEPICON);
19027
+ }
19028
+ };
19029
+ Stepper.prototype.updateCurrentLabel = function () {
19030
+ var currentLabelPos;
19031
+ if (this.element.classList.contains(HORIZSTEP)) {
19032
+ currentLabelPos = this.labelPosition.toLowerCase() === 'top' ? 'before' : this.labelPosition.toLowerCase() === 'bottom' ? 'after' : this.labelPosition.toLowerCase();
19033
+ }
19034
+ else {
19035
+ currentLabelPos = this.labelPosition.toLowerCase() === 'start' ? 'before' : this.labelPosition.toLowerCase() === 'end' ? 'after' : this.labelPosition.toLowerCase();
19036
+ }
19037
+ return currentLabelPos;
19038
+ };
19039
+ Stepper.prototype.updateLabelPosition = function () {
19040
+ this.clearLabelPosition();
19041
+ this.labelContainer.classList.add('e-label-' + this.updateCurrentLabel());
19042
+ if (this.labelPosition.toLowerCase() === 'start' && this.orientation.toLowerCase() === 'vertical') {
19043
+ this.stepperItemContainer.firstChild ? this.stepperItemContainer.firstChild.before(this.labelContainer) : this.stepperItemContainer.appendChild(this.labelContainer);
19044
+ }
19045
+ else {
19046
+ this.stepperItemContainer.appendChild(this.labelContainer);
19047
+ }
19048
+ this.element.classList.add('e-label-' + this.updateCurrentLabel());
19049
+ };
19050
+ Stepper.prototype.clearLabelPosition = function () {
19051
+ var removeCss = this.labelContainer.classList.value.match(/(e-label-[after|before]+)/g);
19052
+ if (removeCss) {
19053
+ removeClass([this.labelContainer], removeCss);
19054
+ removeClass([this.element], removeCss);
19055
+ }
19056
+ };
19057
+ Stepper.prototype.checkValidStep = function () {
19058
+ for (var index = 0; index < this.steps.length; index++) {
19059
+ var item = this.steps[parseInt(index.toString(), 10)];
19060
+ var itemElement = this.stepperItemElements[parseInt(index.toString(), 10)];
19061
+ if (item.isValid !== null) {
19062
+ var indicatorEle = void 0;
19063
+ var iconEle = void 0;
19064
+ if (this.element.classList.contains(STEPINDICATOR) && !item.iconCss) {
19065
+ indicatorEle = itemElement.querySelector('.' + ICONCSS);
19066
+ }
19067
+ else {
19068
+ iconEle = itemElement.querySelector('.' + ICONCSS);
19069
+ }
19070
+ var textLabelIcon = itemElement.querySelector('.e-step-validation-icon');
19071
+ var itemIcon = item.iconCss.trim().split(' ');
19072
+ var validStep = itemElement.classList.contains('e-step-valid');
19073
+ if (indicatorEle) {
19074
+ indicatorEle.classList.add('e-icons', validStep ? 'e-check' : 'e-circle-info');
19075
+ }
19076
+ if (iconEle) {
19077
+ for (var i = 0; i < itemIcon.length; i++) {
19078
+ iconEle.classList.remove(itemIcon[parseInt(i.toString(), 10)]);
19079
+ }
19080
+ iconEle.classList.add('e-icons', validStep ? 'e-check' : 'e-circle-info');
19081
+ }
19082
+ if (textLabelIcon) {
19083
+ textLabelIcon.classList.add(validStep ? 'e-circle-check' : 'e-circle-info');
19084
+ if (this.element.classList.contains(VERTICALSTEP)) {
19085
+ var labelEle = itemElement.querySelector('.' + LABEL);
19086
+ var textEle = itemElement.querySelector('.' + TEXT);
19087
+ var itemWidth = textEle ? textEle.offsetWidth + textEle.getBoundingClientRect().left :
19088
+ labelEle.offsetWidth + labelEle.getBoundingClientRect().left;
19089
+ var validationIcon = itemElement.querySelector('.e-step-validation-icon');
19090
+ validationIcon.style.setProperty('--icon-position', (itemWidth + 20) + 'px');
19091
+ }
19092
+ }
19093
+ }
19094
+ }
19095
+ };
19096
+ Stepper.prototype.updateTooltip = function () {
19097
+ if (this.showTooltip) {
19098
+ this.tooltipObj = new Tooltip({
19099
+ target: '.e-step-container', windowCollision: true,
19100
+ opensOn: 'Custom', cssClass: this.cssClass ? (STEPPERTOOLTIP + ' ' + this.cssClass) : STEPPERTOOLTIP,
19101
+ position: 'TopCenter'
19102
+ });
19103
+ this.tooltipObj.appendTo(this.stepperItemList);
19104
+ }
19105
+ else {
19106
+ if (!isNullOrUndefined(this.tooltipObj)) {
19107
+ this.tooltipObj.destroy();
19108
+ this.tooltipObj = null;
19109
+ }
19110
+ }
19111
+ };
19112
+ Stepper.prototype.wireItemsEvents = function (itemElement, index) {
19113
+ var _this = this;
19114
+ EventHandler.add(itemElement, 'click', function (e) {
19115
+ if (_this.linear) {
19116
+ var linearModeValue = index - _this.activeStep;
19117
+ if (Math.abs(linearModeValue) === 1) {
19118
+ _this.stepClickHandler(index, e, itemElement);
19119
+ }
19120
+ }
19121
+ else {
19122
+ _this.stepClickHandler(index, e, itemElement);
19123
+ }
19124
+ }, this);
19125
+ EventHandler.add(itemElement, 'mouseover', function () { return _this.openStepperTooltip(index); }, this);
19126
+ EventHandler.add(itemElement, 'mouseleave', function () { return _this.closeStepperTooltip(); }, this);
19127
+ };
19128
+ Stepper.prototype.openStepperTooltip = function (index) {
19129
+ var currentStep = this.steps[parseInt(index.toString(), 10)];
19130
+ if (this.showTooltip && (currentStep.label || currentStep.text)) {
19131
+ if (!this.tooltipOpen) {
19132
+ this.updateTooltipContent(index);
19133
+ this.tooltipObj.open(this.stepperItemElements[parseInt((index).toString(), 10)]);
19134
+ if (this.stepType.toLocaleLowerCase() !== 'label' && ((this.stepType.toLocaleLowerCase() === 'indicator') ||
19135
+ (currentStep.label !== '' && currentStep.iconCss !== ''))) {
19136
+ var tooltipPopupClass = currentStep.status.toLowerCase() === 'inprogress' ?
19137
+ STEPPERTOOLTIP + " " + STEPPERIPROGRESSTIP + " " + (this.cssClass ? this.cssClass : '') : STEPPERTOOLTIP + " " + (this.cssClass ? this.cssClass : '');
19138
+ this.tooltipObj.setProperties({ cssClass: tooltipPopupClass.trim() });
19139
+ }
19140
+ this.tooltipOpen = true;
19141
+ }
19142
+ }
19143
+ };
19144
+ Stepper.prototype.closeStepperTooltip = function () {
19145
+ if (this.tooltipOpen) {
19146
+ this.tooltipObj.close();
19147
+ this.tooltipOpen = false;
19148
+ }
19149
+ };
19150
+ Stepper.prototype.updateTooltipContent = function (index) {
19151
+ if (this.showTooltip) {
19152
+ if (this.isReact) {
19153
+ this.clearTemplate(['stepperTooltipTemplate']);
19154
+ }
19155
+ var content = void 0;
19156
+ var currentStep = this.steps[parseInt(index.toString(), 10)];
19157
+ if (this.tooltipTemplate) {
19158
+ content = this.createElement('span', { className: 'e-stepper-tooltip-content' });
19159
+ var templateFunction = this.getTemplateFunction(this.tooltipTemplate);
19160
+ append(templateFunction({ value: currentStep }, this, 'stepperTooltipTemplate', (this.element.id + 'tooltipTemplate'), this.isStringTemplate), content);
19161
+ this.tooltipObj.setProperties({ content: content }, true);
19162
+ }
19163
+ else {
19164
+ var content_1 = currentStep.label ? currentStep.label : currentStep.text;
19165
+ this.tooltipObj.setProperties({ content: initializeCSPTemplate(function () { return content_1; }) }, true);
19166
+ }
19167
+ this.renderReactTemplates();
19168
+ }
19169
+ };
19170
+ Stepper.prototype.stepClickHandler = function (index, e, itemElement) {
19171
+ var clickEventArgs = {
19172
+ element: itemElement, event: e, previousStep: this.activeStep,
19173
+ activeStep: index
19174
+ };
19175
+ this.trigger('stepClick', clickEventArgs);
19176
+ this.navigateToStep(index, e, itemElement, true);
19177
+ };
19178
+ Stepper.prototype.updateTemplateFunction = function () {
19179
+ this.templateFunction = this.template ? this.getTemplateFunction(this.template) : null;
19180
+ };
19181
+ Stepper.prototype.renderItemContent = function (index, isrerender) {
19182
+ var listItems = this.stepperItemList.querySelectorAll('li');
19183
+ if (isrerender) {
19184
+ this.removeItemContent(listItems[parseInt((index).toString(), 10)]);
19185
+ }
19186
+ if (this.template) {
19187
+ isrerender ? listItems[parseInt((index).toString(), 10)].classList.add(TEMPLATE) :
19188
+ this.stepperItemContainer.classList.add(TEMPLATE);
19189
+ var item = this.steps[parseInt(index.toString(), 10)];
19190
+ append(this.templateFunction({ step: item, currentStep: index }, this, 'stepperTemplate', (this.element.id + '_stepperTemplate'), this.isStringTemplate), isrerender ? listItems[parseInt((index).toString(), 10)] : this.stepperItemContainer);
19191
+ }
19192
+ this.renderReactTemplates();
19193
+ };
19194
+ Stepper.prototype.removeItemContent = function (ele) {
19195
+ ele.classList.remove(TEMPLATE);
19196
+ var firstChild = ele.firstElementChild;
19197
+ for (var i = 0; i < ele.childElementCount; i++) {
19198
+ firstChild.remove();
19199
+ }
19200
+ };
19201
+ Stepper.prototype.updateContent = function () {
19202
+ if (this.isReact) {
19203
+ this.clearTemplate(['stepperTemplate']);
19204
+ }
19205
+ for (var i = 0; i < this.steps.length; i++) {
19206
+ this.renderItemContent(i, true);
19207
+ }
19208
+ };
19209
+ /**
19210
+ * Gets template content based on the template property value.
19211
+ *
19212
+ * @param {string | Function} template - Template property value.
19213
+ * @returns {Function} - Return template function.
19214
+ * @hidden
19215
+ */
19216
+ Stepper.prototype.getTemplateFunction = function (template) {
19217
+ if (typeof template === 'string') {
19218
+ var content = '';
19219
+ try {
19220
+ var tempEle = select(template);
19221
+ if (tempEle) {
19222
+ //Return innerHTML incase of jsrenderer script else outerHTML
19223
+ content = tempEle.tagName === 'SCRIPT' ? tempEle.innerHTML : tempEle.outerHTML;
19224
+ }
19225
+ else {
19226
+ content = template;
19227
+ }
19228
+ }
19229
+ catch (e) {
19230
+ content = template;
19231
+ }
19232
+ return compile(content);
19233
+ }
19234
+ else {
19235
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
19236
+ return compile(template);
19237
+ }
19238
+ };
19239
+ Stepper.prototype.navigateToStep = function (index, e, itemElement, isInteracted, isUpdated) {
19240
+ var _this = this;
19241
+ var eventArgs = {
19242
+ element: itemElement, event: e, isInteracted: isInteracted,
19243
+ previousStep: this.activeStep, activeStep: index, cancel: false
19244
+ };
19245
+ if (isUpdated != false) {
19246
+ var previousStep_1 = this.activeStep;
19247
+ this.trigger('stepChanging', eventArgs, function (args) {
19248
+ if (args.cancel) {
19249
+ return;
19250
+ }
19251
+ _this.navigationHandler(index);
19252
+ var eventArgs = {
19253
+ element: itemElement, event: e, isInteracted: isInteracted,
19254
+ previousStep: previousStep_1, activeStep: _this.activeStep
19255
+ };
19256
+ _this.trigger('stepChanged', eventArgs);
19257
+ });
19258
+ }
19259
+ else {
19260
+ this.navigationHandler(index);
19261
+ }
19262
+ };
19263
+ Stepper.prototype.navigationHandler = function (index, stepStatus, isUpdated) {
19264
+ index = (index >= this.steps.length - 1) ? this.steps.length - 1 : index;
19265
+ var Itemslength = this.stepperItemElements.length;
19266
+ if (index >= 0 && index < Itemslength - 1) {
19267
+ index = this.stepperItemElements[parseInt(index.toString(), 10)].classList.contains(DISABLED$2) ? this.activeStep : index;
19268
+ }
19269
+ var prevOnChange = this.isProtectedOnChange;
19270
+ this.isProtectedOnChange = true;
19271
+ this.activeStep = index;
19272
+ this.isProtectedOnChange = prevOnChange;
19273
+ for (var i = 0; i < this.steps.length; i++) {
19274
+ var itemElement = this.stepperItemElements[parseInt(i.toString(), 10)];
19275
+ var item = this.steps[parseInt(i.toString(), 10)];
19276
+ itemElement.classList.remove(SELECTED$2, INPROGRESS, COMPLETED, NOTSTARTED);
19277
+ if (i === this.activeStep || this.activeStep === this.steps.length - 1) {
19278
+ itemElement.classList.add(SELECTED$2);
19279
+ }
19280
+ if (this.activeStep >= 0 && this.progressbar) {
19281
+ if (this.element.classList.contains(HORIZSTEP)) {
19282
+ if ((this.element.classList.contains(LABELBEFORE) || this.element.classList.contains(LABELAFTER)) && !this.element.classList.contains(STEPINDICATOR) &&
19283
+ this.stepperItemElements[parseInt(this.activeStep.toString(), 10)].classList.contains(STEPICON)) {
19284
+ var progressPos = this.element.querySelector('.e-stepper-progressbar');
19285
+ var selectedEle = this.stepperItemElements[parseInt(this.activeStep.toString(), 10)].firstChild;
19286
+ var value = this.activeStep === 0 ? 0 : (selectedEle.offsetLeft - progressPos.offsetLeft + (selectedEle.offsetWidth / 2)) / progressPos.offsetWidth * 100;
19287
+ if (this.element.classList.contains(RTL$3)) {
19288
+ var elementPos = this.stepperItemElements[0].firstChild;
19289
+ value = ((progressPos.offsetWidth - selectedEle.offsetLeft) + Math.abs((elementPos.offsetLeft + elementPos.offsetWidth) - this.stepperItemList.offsetWidth)) / progressPos.offsetWidth * 100;
19290
+ this.progressbar.style.setProperty(PROGRESSVALUE$1, (value) + '%');
19291
+ }
19292
+ else {
19293
+ this.progressbar.style.setProperty(PROGRESSVALUE$1, (value) + '%');
19294
+ }
19295
+ }
19296
+ else {
19297
+ var totalLiWidth = 0;
19298
+ var activeLiWidth = 0;
19299
+ for (var j = 0; j < this.stepperItemElements.length; j++) {
19300
+ totalLiWidth = totalLiWidth + this.stepperItemElements[parseInt(j.toString(), 10)].offsetWidth;
19301
+ if (j <= this.activeStep) {
19302
+ if (j < this.activeStep) {
19303
+ activeLiWidth = activeLiWidth + this.stepperItemElements[parseInt(j.toString(), 10)].offsetWidth;
19304
+ }
19305
+ else if (j == this.activeStep && j !== 0) {
19306
+ activeLiWidth = activeLiWidth + (this.stepperItemElements[parseInt(j.toString(), 10)].offsetWidth / 2);
19307
+ }
19308
+ }
19309
+ }
19310
+ var spaceWidth = (this.stepperItemList.offsetWidth - totalLiWidth) / (this.stepperItemElements.length - 1);
19311
+ var progressValue = ((activeLiWidth + (spaceWidth * this.activeStep)) / this.stepperItemList.offsetWidth) * 100;
19312
+ this.progressbar.style.setProperty(PROGRESSVALUE$1, (progressValue) + '%');
19313
+ }
19314
+ }
19315
+ else {
19316
+ this.progressbar.style.setProperty(PROGRESSVALUE$1, ((100 / (this.steps.length - 1)) * index) + '%');
19317
+ }
19318
+ }
19319
+ else if (this.activeStep < 0 && this.progressbar) {
19320
+ this.progressbar.style.setProperty(PROGRESSVALUE$1, 0 + '%');
19321
+ }
19322
+ if (i === this.activeStep) {
19323
+ itemElement.classList.add(INPROGRESS);
19324
+ }
19325
+ else if (this.activeStep > 0 && i < this.activeStep) {
19326
+ itemElement.classList.add(COMPLETED);
19327
+ }
19328
+ else {
19329
+ itemElement.classList.add(NOTSTARTED);
19330
+ }
19331
+ if (itemElement.classList.contains(INPROGRESS)) {
19332
+ attributes(itemElement, { 'tabindex': '0', 'aria-current': 'true' });
19333
+ }
19334
+ else {
19335
+ attributes(itemElement, { 'tabindex': '-1', 'aria-current': 'false' });
19336
+ }
19337
+ var prevOnChange_1 = this.isProtectedOnChange;
19338
+ this.isProtectedOnChange = true;
19339
+ if (isUpdated != false) {
19340
+ if (i < this.activeStep || (this.steps.length - 1 === this.activeStep && item.status.toLowerCase() === "completed")) {
19341
+ item.status = StepStatus.Completed;
19342
+ }
19343
+ else if (i === this.activeStep) {
19344
+ item.status = StepStatus.InProgress;
19345
+ }
19346
+ else if (i > this.activeStep) {
19347
+ item.status = StepStatus.NotStarted;
19348
+ }
19349
+ if (stepStatus && this.activeStep === i) {
19350
+ item.status = stepStatus;
19351
+ }
19352
+ if (item.status.toLowerCase() === "completed") {
19353
+ itemElement.classList.remove(SELECTED$2, INPROGRESS, NOTSTARTED);
19354
+ itemElement.classList.add(COMPLETED);
19355
+ }
19356
+ if (item.status.toLowerCase() === "notstarted") {
19357
+ itemElement.classList.remove(SELECTED$2, INPROGRESS, COMPLETED);
19358
+ itemElement.classList.add(NOTSTARTED);
19359
+ }
19360
+ }
19361
+ this.isProtectedOnChange = prevOnChange_1;
19362
+ if (this.renderDefault(i) && this.element.classList.contains(STEPINDICATOR)) {
19363
+ if (itemElement.classList.contains(COMPLETED)) {
19364
+ itemElement.firstChild.classList.remove('e-icons', 'e-step-indicator');
19365
+ itemElement.firstChild.classList.add(ICONCSS, 'e-icons', 'e-check');
19366
+ }
19367
+ else if (itemElement.classList.contains(INPROGRESS) || itemElement.classList.contains(NOTSTARTED)) {
19368
+ itemElement.firstChild.classList.remove(ICONCSS, 'e-icons', 'e-check');
19369
+ itemElement.firstChild.classList.add('e-icons', 'e-step-indicator');
19370
+ }
19371
+ }
19372
+ }
19373
+ };
19374
+ Stepper.prototype.removeItemElements = function () {
19375
+ for (var i = 0; i < this.stepperItemElements.length; i++) {
19376
+ remove(this.stepperItemElements[parseInt(i.toString(), 10)]);
19377
+ }
19378
+ this.stepperItemElements = [];
19379
+ };
19380
+ Stepper.prototype.nextStep = function () {
19381
+ if (this.activeStep !== this.steps.length - 1) {
19382
+ this.navigateToStep(this.activeStep + 1, null, null, false);
19383
+ }
19384
+ };
19385
+ Stepper.prototype.previousStep = function () {
19386
+ if (this.activeStep > 0) {
19387
+ this.navigateToStep(this.activeStep - 1, null, null, false);
19388
+ }
19389
+ };
19390
+ Stepper.prototype.reset = function () {
19391
+ if (this.activeStep !== 0) {
19392
+ var isDisabled = this.stepperItemElements[0].classList.contains(DISABLED$2) ? true : false;
19393
+ this.navigateToStep(isDisabled ? -1 : 0, null, null, false);
19394
+ }
19395
+ };
19396
+ Stepper.prototype.updateElementClassArray = function () {
19397
+ var classArray = [RTL$3, READONLY, 'e-steps-focus', LABELAFTER, LABELBEFORE, 'e-label-top',
19398
+ 'e-label-bottom', 'e-label-start', 'e-label-end', STEPINDICATOR, LABELINDICATOR, VERTICALSTEP, HORIZSTEP];
19399
+ removeClass([this.element], classArray);
19400
+ };
19401
+ Stepper.prototype.destroy = function () {
19402
+ var _this = this;
19403
+ _super.prototype.destroy.call(this);
19404
+ EventHandler.remove(window, 'resize', function () { if (_this.stepperItemList && _this.progressbar) {
19405
+ _this.setProgressPosition(_this.element, true);
19406
+ } });
19407
+ EventHandler.remove(window, 'click', function () { _this.updateStepFocus(); });
19408
+ // unwires the events and detach the li elements
19409
+ this.removeItemElements();
19410
+ this.clearTemplate();
19411
+ if (this.stepperItemList) {
19412
+ remove(this.stepperItemList);
19413
+ }
19414
+ this.stepperItemList = null;
19415
+ if (this.progressStep) {
19416
+ remove(this.progressStep);
19417
+ }
19418
+ this.progressStep = null;
19419
+ this.progressbar = null;
19420
+ this.progressBarPosition = null;
19421
+ this.stepperItemContainer = null;
19422
+ this.textContainer = null;
19423
+ this.labelContainer = null;
19424
+ this.updateElementClassArray();
19425
+ this.element.removeAttribute('aria-label');
19426
+ if (this.showTooltip) {
19427
+ this.tooltipObj.destroy();
19428
+ this.tooltipObj = null;
19429
+ }
19430
+ if (this.keyboardModuleStepper) {
19431
+ this.keyboardModuleStepper.destroy();
19432
+ }
19433
+ this.keyboardModuleStepper = null;
19434
+ };
19435
+ Stepper.prototype.wireKeyboardEvent = function () {
19436
+ this.keyboardModuleStepper = new KeyboardEvents(this.element, {
19437
+ keyAction: this.keyActionHandler.bind(this),
19438
+ keyConfigs: this.keyConfigs,
19439
+ eventName: 'keydown'
19440
+ });
19441
+ };
19442
+ Stepper.prototype.keyActionHandler = function (e) {
19443
+ if (this.readOnly) {
19444
+ return;
19445
+ }
19446
+ switch (e.action) {
19447
+ case 'uparrow':
19448
+ case 'downarrow':
19449
+ if (this.element.classList.contains(VERTICALSTEP)) {
19450
+ this.handleNavigation(e.action === 'uparrow' ? false : true, e);
19451
+ }
19452
+ break;
19453
+ case 'leftarrow':
19454
+ case 'rightarrow':
19455
+ if (this.element.classList.contains(HORIZSTEP)) {
19456
+ this.handleNavigation(this.enableRtl ? e.action === 'leftarrow' : e.action === 'rightarrow', e);
19457
+ }
19458
+ break;
19459
+ case 'tab':
19460
+ case 'space':
19461
+ case 'enter':
19462
+ case 'escape':
19463
+ this.handleNavigation(null, e);
19464
+ break;
19465
+ case 'home':
19466
+ case 'end':
19467
+ this.handleNavigation(null, e, this.enableRtl);
19468
+ break;
19469
+ }
19470
+ };
19471
+ Stepper.prototype.handleNavigation = function (isNextStep, e, isRTL) {
19472
+ this.isKeyNavFocus = true;
19473
+ this.element.classList.add('e-steps-focus');
19474
+ var focusedEle = this.element.querySelector('.' + FOCUS$1);
19475
+ if (!focusedEle) {
19476
+ focusedEle = this.element.querySelector('.' + SELECTED$2);
19477
+ }
19478
+ var stepItems = Array.prototype.slice.call(this.stepperItemList.children);
19479
+ var index = stepItems.indexOf(focusedEle);
19480
+ if (e.action === 'tab' || e.action === 'escape') {
19481
+ stepItems[parseInt(index.toString(), 10)].classList.remove(FOCUS$1);
19482
+ this.element.classList.remove('e-steps-focus');
19483
+ }
19484
+ if (!(e.action === 'space' || e.action === 'enter' || e.action === 'tab')) {
19485
+ var prevIndex = index;
19486
+ index = isNextStep ? index + 1 : index - 1;
19487
+ while ((index >= 0 && index < stepItems.length) && stepItems[parseInt(index.toString(), 10)].classList.contains(DISABLED$2)) {
19488
+ index = isNextStep ? index + 1 : index - 1;
19489
+ }
19490
+ index = (index < 0) ? 0 : (index > stepItems.length - 1) ? stepItems.length - 1 : index;
19491
+ if (stepItems[parseInt(prevIndex.toString(), 10)].classList.contains(FOCUS$1)) {
19492
+ stepItems[parseInt(prevIndex.toString(), 10)].classList.remove(FOCUS$1);
19493
+ }
19494
+ if ((e.action === 'home' || e.action === 'end')) {
19495
+ if (e.action === 'home') {
19496
+ isRTL ? index = stepItems.length - 1 : index = 0;
19497
+ }
19498
+ else {
19499
+ isRTL ? index = 0 : index = stepItems.length - 1;
19500
+ }
19501
+ }
19502
+ if (index >= 0 && index < stepItems.length) {
19503
+ stepItems[parseInt(index.toString(), 10)].classList.add(FOCUS$1);
19504
+ }
19505
+ }
19506
+ else if ((e.action === 'space' || e.action === 'enter')) {
19507
+ if (this.linear) {
19508
+ var linearModeValue = this.activeStep - index;
19509
+ if (Math.abs(linearModeValue) === 1) {
19510
+ this.navigateToStep(index, null, null, true);
19511
+ }
19512
+ }
19513
+ else {
19514
+ this.navigateToStep(index, null, null, true);
19515
+ }
19516
+ }
19517
+ };
19518
+ Stepper.prototype.renderStepperItems = function (isUpdate, isStepType) {
19519
+ this.updateElementClassArray();
19520
+ this.removeItemElements();
19521
+ this.element.querySelector('.e-stepper-progressbar').remove();
19522
+ isUpdate ? this.updatePosition() : null;
19523
+ isStepType ? this.updateStepType() : null;
19524
+ this.readOnly ? (!this.element.classList.contains(READONLY)) ? this.element.classList.add(READONLY) : null : null;
19525
+ this.enableRtl ? (!this.element.classList.contains(RTL$3)) ? this.element.classList.add(RTL$3) : null : null;
19526
+ this.updateOrientaion(this.element);
19527
+ this.renderItems();
19528
+ this.renderProgressBar(this.element);
19529
+ this.checkValidStep();
19530
+ this.updateAnimation();
19531
+ this.navigateToStep(this.activeStep, null, this.stepperItemElements[this.activeStep], true);
19532
+ };
19533
+ /**
19534
+ * Called internally if any of the property value changed.
19535
+ *
19536
+ * @param {StepperModel} newProp - Specifies new properties
19537
+ * @param {StepperModel} oldProp - Specifies old properties
19538
+ * @returns {void}
19539
+ * @private
19540
+ */
19541
+ Stepper.prototype.onPropertyChanged = function (newProp, oldProp) {
19542
+ for (var _i = 0, _a = Object.keys(newProp); _i < _a.length; _i++) {
19543
+ var prop = _a[_i];
19544
+ switch (prop) {
19545
+ case 'steps': {
19546
+ if (!(newProp.steps instanceof Array && oldProp.steps instanceof Array)) {
19547
+ var stepCounts = Object.keys(newProp.steps);
19548
+ for (var i = 0; i < stepCounts.length; i++) {
19549
+ var index = parseInt(Object.keys(newProp.steps)[i], 10);
19550
+ var changedPropsCount = Object.keys(newProp.steps[index]).length;
19551
+ for (var j = 0; j < changedPropsCount; j++) {
19552
+ var property = Object.keys(newProp.steps[index])[j];
19553
+ if (property === 'status') {
19554
+ if (this.activeStep === index) {
19555
+ this.navigationHandler(index, newProp.steps[index].status);
19556
+ }
19557
+ else {
19558
+ this.steps[index].status = oldProp.steps[index].status;
19559
+ }
19560
+ }
19561
+ else {
19562
+ this.removeItemElements();
19563
+ this.renderItems();
19564
+ this.updateStepperStatus();
19565
+ }
19566
+ this.checkValidStep();
19567
+ }
19568
+ }
19569
+ }
19570
+ else {
19571
+ this.renderStepperItems(true, true);
19572
+ }
19573
+ break;
19574
+ }
19575
+ case 'orientation':
19576
+ this.updateOrientaion(this.element);
19577
+ this.renderStepperItems(true);
19578
+ break;
19579
+ case 'activeStep':
19580
+ this.activeStep = (newProp.activeStep > this.steps.length - 1 || newProp.activeStep < -1) ? oldProp.activeStep : this.activeStep;
19581
+ if (this.activeStep >= 0 && this.stepperItemElements[parseInt(this.activeStep.toString(), 10)].classList.contains(DISABLED$2)) {
19582
+ this.activeStep = oldProp.activeStep;
19583
+ }
19584
+ if (this.linear) {
19585
+ var linearModeValue = oldProp.activeStep - this.activeStep;
19586
+ if (Math.abs(linearModeValue) === 1) {
19587
+ this.navigateToStep(this.activeStep, null, null, true);
19588
+ }
19589
+ }
19590
+ else {
19591
+ this.navigateToStep(this.activeStep, null, this.stepperItemElements[this.activeStep], true);
19592
+ }
19593
+ break;
19594
+ case 'enableRtl':
19595
+ this.element.classList[this.enableRtl ? 'add' : 'remove'](RTL$3);
19596
+ break;
19597
+ case 'readOnly':
19598
+ this.element.classList[this.readOnly ? 'add' : 'remove'](READONLY);
19599
+ break;
19600
+ case 'cssClass':
19601
+ if (oldProp.cssClass) {
19602
+ removeClass([this.element], oldProp.cssClass.trim().split(' '));
19603
+ }
19604
+ if (newProp.cssClass) {
19605
+ addClass([this.element], newProp.cssClass.trim().split(' '));
19606
+ }
19607
+ if (this.tooltipObj) {
19608
+ this.tooltipObj.setProperties({ cssClass: this.cssClass ? (STEPPERTOOLTIP + ' ' + this.cssClass) : STEPPERTOOLTIP });
19609
+ }
19610
+ break;
19611
+ case 'labelPosition':
19612
+ this.renderStepperItems(true);
19613
+ break;
19614
+ case 'showTooltip':
19615
+ this.updateTooltip();
19616
+ break;
19617
+ case 'stepType':
19618
+ this.renderStepperItems(true, true);
19619
+ break;
19620
+ case 'template':
19621
+ this.updateTemplateFunction();
19622
+ this.updateContent();
19623
+ break;
19624
+ case 'animation':
19625
+ this.updateAnimation();
19626
+ break;
19627
+ }
19628
+ }
19629
+ };
19630
+ __decorate$14([
19631
+ Property(0)
19632
+ ], Stepper.prototype, "activeStep", void 0);
19633
+ __decorate$14([
19634
+ Complex({}, StepperAnimationSettings)
19635
+ ], Stepper.prototype, "animation", void 0);
19636
+ __decorate$14([
19637
+ Property(false)
19638
+ ], Stepper.prototype, "linear", void 0);
19639
+ __decorate$14([
19640
+ Property(false)
19641
+ ], Stepper.prototype, "showTooltip", void 0);
19642
+ __decorate$14([
19643
+ Property('')
19644
+ ], Stepper.prototype, "template", void 0);
19645
+ __decorate$14([
19646
+ Property('')
19647
+ ], Stepper.prototype, "tooltipTemplate", void 0);
19648
+ __decorate$14([
19649
+ Property(StepLabelPosition.Bottom)
19650
+ ], Stepper.prototype, "labelPosition", void 0);
19651
+ __decorate$14([
19652
+ Property(StepType.Default)
19653
+ ], Stepper.prototype, "stepType", void 0);
19654
+ __decorate$14([
19655
+ Event()
19656
+ ], Stepper.prototype, "stepChanged", void 0);
19657
+ __decorate$14([
19658
+ Event()
19659
+ ], Stepper.prototype, "stepChanging", void 0);
19660
+ __decorate$14([
19661
+ Event()
19662
+ ], Stepper.prototype, "stepClick", void 0);
19663
+ __decorate$14([
19664
+ Event()
19665
+ ], Stepper.prototype, "beforeStepRender", void 0);
19666
+ Stepper = __decorate$14([
19667
+ NotifyPropertyChanges
19668
+ ], Stepper);
19669
+ return Stepper;
19670
+ }(StepperBase));
19671
+
19672
+ /** Stepper export modules */
19673
+
18291
19674
  /**
18292
19675
  * Navigation all modules
18293
19676
  */
18294
19677
 
18295
- 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 };
19678
+ 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 };
18296
19679
  //# sourceMappingURL=ej2-navigations.es5.js.map