@syncfusion/ej2-navigations 30.2.7 → 31.1.17

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 (162) hide show
  1. package/dist/ej2-navigations.min.js +1 -1
  2. package/dist/ej2-navigations.umd.min.js +1 -1
  3. package/dist/ej2-navigations.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-navigations.es2015.js.map +1 -1
  5. package/dist/es6/ej2-navigations.es5.js.map +1 -1
  6. package/dist/global/ej2-navigations.min.js +1 -1
  7. package/dist/global/ej2-navigations.min.js.map +1 -1
  8. package/dist/global/index.d.ts +1 -1
  9. package/dist/ts/accordion/accordion-model.d.ts +285 -0
  10. package/dist/ts/accordion/accordion.d.ts +458 -0
  11. package/dist/ts/accordion/accordion.ts +1580 -0
  12. package/dist/ts/accordion/index.d.ts +5 -0
  13. package/dist/ts/accordion/index.ts +5 -0
  14. package/dist/ts/appbar/appbar-model.d.ts +76 -0
  15. package/dist/ts/appbar/appbar.d.ts +115 -0
  16. package/dist/ts/appbar/appbar.ts +281 -0
  17. package/dist/ts/appbar/index.d.ts +3 -0
  18. package/dist/ts/appbar/index.ts +3 -0
  19. package/dist/ts/breadcrumb/breadcrumb-model.d.ts +170 -0
  20. package/dist/ts/breadcrumb/breadcrumb.d.ts +297 -0
  21. package/dist/ts/breadcrumb/breadcrumb.ts +959 -0
  22. package/dist/ts/breadcrumb/index.d.ts +5 -0
  23. package/dist/ts/breadcrumb/index.ts +5 -0
  24. package/dist/ts/carousel/carousel-model.d.ts +282 -0
  25. package/dist/ts/carousel/carousel.d.ts +439 -0
  26. package/dist/ts/carousel/carousel.ts +1633 -0
  27. package/dist/ts/carousel/index.d.ts +3 -0
  28. package/dist/ts/carousel/index.ts +3 -0
  29. package/dist/ts/common/h-scroll-model.d.ts +16 -0
  30. package/dist/ts/common/h-scroll.d.ts +105 -0
  31. package/dist/ts/common/h-scroll.ts +481 -0
  32. package/dist/ts/common/index.d.ts +9 -0
  33. package/dist/ts/common/index.ts +10 -0
  34. package/dist/ts/common/menu-base-model.d.ts +308 -0
  35. package/dist/ts/common/menu-base.d.ts +558 -0
  36. package/dist/ts/common/menu-base.ts +2736 -0
  37. package/dist/ts/common/menu-scroll.d.ts +29 -0
  38. package/dist/ts/common/menu-scroll.ts +105 -0
  39. package/dist/ts/common/v-scroll-model.d.ts +16 -0
  40. package/dist/ts/common/v-scroll.d.ts +106 -0
  41. package/dist/ts/common/v-scroll.ts +454 -0
  42. package/dist/ts/context-menu/context-menu-model.d.ts +47 -0
  43. package/dist/ts/context-menu/context-menu.d.ts +102 -0
  44. package/dist/ts/context-menu/context-menu.ts +165 -0
  45. package/dist/ts/context-menu/index.d.ts +5 -0
  46. package/dist/ts/context-menu/index.ts +5 -0
  47. package/dist/ts/index.d.ts +16 -0
  48. package/dist/ts/index.ts +16 -0
  49. package/dist/ts/menu/index.d.ts +5 -0
  50. package/dist/ts/menu/index.ts +5 -0
  51. package/dist/ts/menu/menu-model.d.ts +70 -0
  52. package/dist/ts/menu/menu.d.ts +127 -0
  53. package/dist/ts/menu/menu.ts +313 -0
  54. package/dist/ts/sidebar/index.d.ts +5 -0
  55. package/dist/ts/sidebar/index.ts +5 -0
  56. package/dist/ts/sidebar/sidebar-model.d.ts +200 -0
  57. package/dist/ts/sidebar/sidebar.d.ts +336 -0
  58. package/dist/ts/sidebar/sidebar.ts +907 -0
  59. package/dist/ts/stepper/index.d.ts +3 -0
  60. package/dist/ts/stepper/index.ts +3 -0
  61. package/dist/ts/stepper/stepper-model.d.ts +159 -0
  62. package/dist/ts/stepper/stepper.d.ts +381 -0
  63. package/dist/ts/stepper/stepper.ts +1350 -0
  64. package/dist/ts/stepper-base/index.d.ts +5 -0
  65. package/dist/ts/stepper-base/index.ts +6 -0
  66. package/dist/ts/stepper-base/stepper-base-model.d.ts +124 -0
  67. package/dist/ts/stepper-base/stepper-base.d.ts +187 -0
  68. package/dist/ts/stepper-base/stepper-base.ts +290 -0
  69. package/dist/ts/tab/index.d.ts +5 -0
  70. package/dist/ts/tab/index.ts +5 -0
  71. package/dist/ts/tab/tab-model.d.ts +408 -0
  72. package/dist/ts/tab/tab.d.ts +715 -0
  73. package/dist/ts/tab/tab.ts +2842 -0
  74. package/dist/ts/toolbar/index.d.ts +5 -0
  75. package/dist/ts/toolbar/index.ts +5 -0
  76. package/dist/ts/toolbar/toolbar-model.d.ts +294 -0
  77. package/dist/ts/toolbar/toolbar.d.ts +541 -0
  78. package/dist/ts/toolbar/toolbar.ts +2646 -0
  79. package/dist/ts/treeview/index.d.ts +5 -0
  80. package/dist/ts/treeview/index.ts +5 -0
  81. package/dist/ts/treeview/treeview-model.d.ts +637 -0
  82. package/dist/ts/treeview/treeview.d.ts +1518 -0
  83. package/dist/ts/treeview/treeview.ts +6780 -0
  84. package/package.json +70 -17
  85. package/src/context-menu/context-menu-model.d.ts +1 -1
  86. package/src/context-menu/context-menu.js +1 -1
  87. package/styles/accordion/_bootstrap-dark-definition.scss +1 -1
  88. package/styles/accordion/_bootstrap-definition.scss +1 -1
  89. package/styles/accordion/bootstrap-dark.css +1 -1
  90. package/styles/accordion/bootstrap.css +1 -1
  91. package/styles/bds-lite.css +1 -1
  92. package/styles/bds.css +1 -1
  93. package/styles/bootstrap-dark-lite.css +2 -2
  94. package/styles/bootstrap-dark.css +2 -2
  95. package/styles/bootstrap-lite.css +2 -2
  96. package/styles/bootstrap.css +2 -2
  97. package/styles/bootstrap4-lite.css +1 -1
  98. package/styles/bootstrap4.css +1 -1
  99. package/styles/bootstrap5-dark-lite.css +1 -1
  100. package/styles/bootstrap5-dark.css +1 -1
  101. package/styles/bootstrap5-lite.css +1 -1
  102. package/styles/bootstrap5.3-lite.css +1 -1
  103. package/styles/bootstrap5.3.css +9 -1
  104. package/styles/bootstrap5.css +1 -1
  105. package/styles/fabric-dark-lite.css +1 -1
  106. package/styles/fabric-dark.css +1 -1
  107. package/styles/fabric-lite.css +1 -1
  108. package/styles/fabric.css +1 -1
  109. package/styles/fluent-dark-lite.css +1 -1
  110. package/styles/fluent-dark.css +1 -1
  111. package/styles/fluent-lite.css +1 -1
  112. package/styles/fluent.css +1 -1
  113. package/styles/fluent2-lite.css +4 -1
  114. package/styles/fluent2.css +4 -1
  115. package/styles/h-scroll/_layout.scss +1 -1
  116. package/styles/h-scroll/bds.css +1 -1
  117. package/styles/h-scroll/bootstrap-dark.css +1 -1
  118. package/styles/h-scroll/bootstrap.css +1 -1
  119. package/styles/h-scroll/bootstrap4.css +1 -1
  120. package/styles/h-scroll/bootstrap5-dark.css +1 -1
  121. package/styles/h-scroll/bootstrap5.3.css +1 -1
  122. package/styles/h-scroll/bootstrap5.css +1 -1
  123. package/styles/h-scroll/fabric-dark.css +1 -1
  124. package/styles/h-scroll/fabric.css +1 -1
  125. package/styles/h-scroll/fluent-dark.css +1 -1
  126. package/styles/h-scroll/fluent.css +1 -1
  127. package/styles/h-scroll/fluent2.css +1 -1
  128. package/styles/h-scroll/highcontrast-light.css +1 -1
  129. package/styles/h-scroll/highcontrast.css +1 -1
  130. package/styles/h-scroll/material-dark.css +1 -1
  131. package/styles/h-scroll/material.css +1 -1
  132. package/styles/h-scroll/material3-dark.css +1 -1
  133. package/styles/h-scroll/material3.css +1 -1
  134. package/styles/h-scroll/tailwind-dark.css +1 -1
  135. package/styles/h-scroll/tailwind.css +1 -1
  136. package/styles/h-scroll/tailwind3.css +1 -1
  137. package/styles/highcontrast-light-lite.css +1 -1
  138. package/styles/highcontrast-light.css +1 -1
  139. package/styles/highcontrast-lite.css +1 -1
  140. package/styles/highcontrast.css +1 -1
  141. package/styles/material-dark-lite.css +1 -1
  142. package/styles/material-dark.css +1 -1
  143. package/styles/material-lite.css +1 -1
  144. package/styles/material.css +1 -1
  145. package/styles/material3-dark-lite.css +1 -1
  146. package/styles/material3-dark.css +1 -7
  147. package/styles/material3-lite.css +1 -1
  148. package/styles/material3.css +1 -7
  149. package/styles/tailwind-dark-lite.css +1 -1
  150. package/styles/tailwind-dark.css +1 -1
  151. package/styles/tailwind-lite.css +1 -1
  152. package/styles/tailwind.css +1 -1
  153. package/styles/tailwind3-lite.css +1 -1
  154. package/styles/tailwind3.css +1 -1
  155. package/styles/toolbar/_layout.scss +1 -1
  156. package/styles/treeview/_bigger.scss +2 -2
  157. package/styles/treeview/_bootstrap5.3-definition.scss +1 -0
  158. package/styles/treeview/_layout.scss +3 -0
  159. package/styles/treeview/bootstrap5.3.css +8 -0
  160. package/styles/treeview/fluent2.css +3 -0
  161. package/styles/treeview/material3-dark.css +0 -6
  162. package/styles/treeview/material3.css +0 -6
@@ -0,0 +1,1350 @@
1
+ // eslint-disable-next-line @typescript-eslint/triple-slash-reference
2
+ ///<reference path='../stepper-base/stepper-base-model.d.ts'/>
3
+ import { INotifyPropertyChanged, attributes, NotifyPropertyChanges, L10n, append, isNullOrUndefined, getUniqueID, Complex, KeyboardEvents, KeyboardEventArgs, ChildProperty, Property, EventHandler, Event, EmitType, BaseEventArgs, addClass, remove, removeClass, initializeCSPTemplate, select, compile } from '@syncfusion/ej2-base';
4
+ import { StepperBase, StepStatus } from '../stepper-base/stepper-base';
5
+ import { StepperModel, StepperAnimationSettingsModel } from '../stepper';
6
+ import { StepModel } from '../stepper-base/stepper-base-model';
7
+ import { Tooltip } from '@syncfusion/ej2-popups';
8
+
9
+ const ITEMCONTAINER: string = 'e-step-container';
10
+ const ITEMLIST: string = 'e-stepper-steps';
11
+ const ICONCSS: string = 'e-indicator';
12
+ const TEXTCSS: string = 'e-step-text-container';
13
+ const STEPLABEL: string = 'e-step-label-container';
14
+ const OPTIONAL: string = 'e-step-label-optional';
15
+ const SELECTED: string = 'e-step-selected';
16
+ const INPROGRESS: string = 'e-step-inprogress';
17
+ const NOTSTARTED: string = 'e-step-notstarted';
18
+ const FOCUS: string = 'e-step-focus';
19
+ const COMPLETED: string = 'e-step-completed';
20
+ const DISABLED: string = 'e-step-disabled';
21
+ const READONLY: string = 'e-stepper-readonly';
22
+ const PROGRESSVALUE: string = '--progress-value';
23
+ const RTL: string = 'e-rtl';
24
+ const TEMPLATE: string = 'e-step-template';
25
+ const LABELAFTER: string = 'e-label-after';
26
+ const LABELBEFORE: string = 'e-label-before';
27
+ const VERTICALSTEP: string = 'e-vertical';
28
+ const HORIZSTEP: string = 'e-horizontal';
29
+ const STEPICON: string = 'e-step-item';
30
+ const STEPTEXT: string = 'e-step-text';
31
+ const TEXT: string = 'e-text';
32
+ const STEPSLABEL: string = 'e-step-label';
33
+ const LABEL: string = 'e-label';
34
+ const STEPINDICATOR: string = 'e-step-type-indicator';
35
+ const LABELINDICATOR: string = 'e-step-type-label';
36
+ const INDICATORICON: string = 'e-step-indicator';
37
+ const STEPPERTOOLTIP: string = 'e-stepper-tooltip';
38
+ const STEPPERIPROGRESSTIP: string = 'e-step-inprogress-tip';
39
+ const LINEARSTEP: string = 'e-linear';
40
+ const PREVSTEP: string = 'e-previous';
41
+ const NEXTSTEP: string = 'e-next';
42
+
43
+ /**
44
+ * Defines the step progress animation of the Stepper.
45
+ */
46
+ export class StepperAnimationSettings extends ChildProperty<StepperAnimationSettings> {
47
+
48
+ /**
49
+ * Defines whether a animation is enabled or disabled.
50
+ *
51
+ * @default true
52
+ */
53
+ @Property(true)
54
+ public enable: boolean;
55
+
56
+ /**
57
+ * duration in milliseconds
58
+ *
59
+ * @default 2000
60
+ * @aspType int
61
+ */
62
+ @Property(2000)
63
+ public duration: number;
64
+
65
+ /**
66
+ * delay in milliseconds
67
+ *
68
+ * @default 0
69
+ * @aspType int
70
+ */
71
+ @Property(0)
72
+ public delay: number;
73
+ }
74
+
75
+ /**
76
+ * Defines the label position in the Stepper.
77
+ */
78
+ export enum StepLabelPosition {
79
+ /**
80
+ * Displays the label on top position regardless of the Stepper's orientation.
81
+ */
82
+ Top = 'Top',
83
+ /**
84
+ * Displays the label on bottom position regardless of the Stepper's orientation.
85
+ */
86
+ Bottom = 'Bottom',
87
+ /**
88
+ * Displays the label on left side regardless of the Stepper's orientation.
89
+ */
90
+ Start = 'Start',
91
+ /**
92
+ * Displays the label on right side regardless of the Stepper's orientation.
93
+ */
94
+ End = 'End'
95
+ }
96
+
97
+ /**
98
+ * Defines whether steps are display with only indicator, only labels or combination of both.
99
+ */
100
+ export enum StepType {
101
+ /**
102
+ * Steps are shown indicator with label defined.
103
+ */
104
+ Default = 'Default',
105
+ /**
106
+ * Steps are shown with only label.
107
+ */
108
+ Label = 'Label',
109
+ /**
110
+ * Steps are shown with only indicator.
111
+ */
112
+ Indicator = 'Indicator'
113
+ }
114
+
115
+ /**
116
+ * Provides information about stepChanged event callback.
117
+ */
118
+ export interface StepperChangedEventArgs extends BaseEventArgs {
119
+ /**
120
+ * Provides the original event.
121
+ */
122
+ event: Event;
123
+
124
+ /**
125
+ * Provides whether the change is triggered by user interaction.
126
+ */
127
+ isInteracted: boolean;
128
+
129
+ /**
130
+ * Provides the index of the previous step.
131
+ */
132
+ previousStep: number;
133
+
134
+ /**
135
+ * Provides the index of the current step.
136
+ */
137
+ activeStep: number;
138
+
139
+ /**
140
+ * Provides the stepper element.
141
+ */
142
+ element: HTMLElement;
143
+ }
144
+
145
+ /**
146
+ * Provides information about stepChanging event callback.
147
+ */
148
+ export interface StepperChangingEventArgs extends StepperChangedEventArgs {
149
+ /**
150
+ * Provides whether the change has been prevented or not. Default value is false.
151
+ */
152
+ cancel: boolean;
153
+ }
154
+
155
+ /**
156
+ * Provides information about stepClick event callback.
157
+ */
158
+ export interface StepperClickEventArgs extends BaseEventArgs {
159
+ /**
160
+ * Provides the original event.
161
+ */
162
+ event: Event;
163
+
164
+ /**
165
+ * Provides the index of the previous step.
166
+ */
167
+ previousStep: number;
168
+
169
+ /**
170
+ * Provides the index of the current step.
171
+ */
172
+ activeStep: number;
173
+
174
+ /**
175
+ * Provides the stepper element.
176
+ */
177
+ element: HTMLElement;
178
+ }
179
+
180
+ /**
181
+ * Provides information about beforeStepRender event callback.
182
+ */
183
+ export interface StepperRenderingEventArgs extends BaseEventArgs {
184
+ /**
185
+ * Provides the stepper element.
186
+ */
187
+ element: HTMLElement;
188
+
189
+ /**
190
+ * Provides the index of the current step.
191
+ */
192
+ index: number;
193
+ }
194
+
195
+ /**
196
+ * The Stepper component visualizes several steps and indicates the current progress by highlighting already completed steps.
197
+ *
198
+ * ```html
199
+ * <nav id="stepper"></nav>
200
+ * ```
201
+ * ```typescript
202
+ * <script>
203
+ * let stepperObj: Stepper = new Stepper({steps : [{}, {}, {}, {}, {}]});
204
+ * stepperObj.appendTo('#stepper');
205
+ * </script>
206
+ * ```
207
+ */
208
+ @NotifyPropertyChanges
209
+ export class Stepper extends StepperBase implements INotifyPropertyChanged {
210
+
211
+ /**
212
+ * Defines the current step index of the Stepper.
213
+ *
214
+ * {% codeBlock src='stepper/activeStep/index.md' %}{% endcodeBlock %}
215
+ *
216
+ * @default 0
217
+ * @aspType int
218
+ */
219
+ @Property(0)
220
+ public activeStep: number;
221
+
222
+ /**
223
+ * Defines the step progress animation of the Stepper.
224
+ *
225
+ * {% codeBlock src='stepper/animation/index.md' %}{% endcodeBlock %}
226
+ *
227
+ */
228
+ @Complex<StepperAnimationSettingsModel>({}, StepperAnimationSettings)
229
+ public animation: StepperAnimationSettingsModel;
230
+
231
+ /**
232
+ * Defines whether allows to complete one step in order to move to the next or not.
233
+ *
234
+ * {% codeBlock src='stepper/linear/index.md' %}{% endcodeBlock %}
235
+ *
236
+ * @default false
237
+ */
238
+ @Property(false)
239
+ public linear: boolean;
240
+
241
+ /**
242
+ * Defines a value that defines whether to show tooltip or not on each step.
243
+ *
244
+ * @default false
245
+ */
246
+ @Property(false)
247
+ public showTooltip: boolean;
248
+
249
+ /**
250
+ * Defines the template content for each step.
251
+ *
252
+ * {% codeBlock src='stepper/template/index.md' %}{% endcodeBlock %}
253
+ *
254
+ * @default ''
255
+ * @angularType string | object
256
+ * @reactType string | function | JSX.Element
257
+ * @vueType string | function
258
+ * @aspType string
259
+ */
260
+ @Property('')
261
+ public template: string | Function;
262
+
263
+ /**
264
+ * Defines the template content for the tooltip.
265
+ *
266
+ * @default ''
267
+ * @angularType string | object
268
+ * @reactType string | function | JSX.Element
269
+ * @vueType string | function
270
+ * @aspType string
271
+ */
272
+ @Property('')
273
+ public tooltipTemplate: string | Function;
274
+
275
+ /**
276
+ * Defines the label position in the Stepper.
277
+ *
278
+ * The possible values are:
279
+ * * Top
280
+ * * Bottom
281
+ * * Start
282
+ * * End
283
+ *
284
+ * {% codeBlock src='stepper/labelPosition/index.md' %}{% endcodeBlock %}
285
+ *
286
+ * @isenumeration true
287
+ * @default StepLabelPosition.Bottom
288
+ * @asptype StepLabelPosition
289
+ */
290
+ @Property(StepLabelPosition.Bottom)
291
+ public labelPosition: string | StepLabelPosition;
292
+
293
+ /**
294
+ * Defines whether steps are display with only indicator, only labels or combination of both.
295
+ *
296
+ * The possible values are:
297
+ * * Default
298
+ * * Label
299
+ * * Indicator
300
+ *
301
+ * {% codeBlock src='stepper/stepType/index.md' %}{% endcodeBlock %}
302
+ *
303
+ * @isenumeration true
304
+ * @default StepType.Default
305
+ * @asptype StepType
306
+ */
307
+ @Property(StepType.Default)
308
+ public stepType: string | StepType;
309
+
310
+ /**
311
+ * Event triggers after active step changed.
312
+ *
313
+ * @event stepChanged
314
+ */
315
+ @Event()
316
+ public stepChanged: EmitType<StepperChangedEventArgs>;
317
+
318
+ /**
319
+ * Event triggers before active step change.
320
+ *
321
+ * @event stepChanging
322
+ */
323
+ @Event()
324
+ public stepChanging: EmitType<StepperChangingEventArgs>;
325
+
326
+ /**
327
+ * Event triggers when clicked on step.
328
+ *
329
+ * @event stepClick
330
+ */
331
+ @Event()
332
+ public stepClick: EmitType<StepperClickEventArgs>;
333
+
334
+ /**
335
+ * Event triggers before rendering each step.
336
+ *
337
+ * @event beforeStepRender
338
+ */
339
+ @Event()
340
+ public beforeStepRender: EmitType<StepperRenderingEventArgs>;
341
+
342
+ /* Private variables */
343
+ private stepperItemList: HTMLElement;
344
+ private stepperItemContainer: HTMLElement;
345
+ private labelContainer: HTMLElement;
346
+ private textContainer: HTMLElement;
347
+ private stepperItemElements: HTMLElement[] = [];
348
+ private beforeLabelWidth: number;
349
+ private textEleWidth: number;
350
+ private tooltipObj: Tooltip;
351
+ private tooltipOpen: boolean;
352
+ private templateFunction: Function;
353
+ private keyboardModuleStepper: KeyboardEvents;
354
+ private keyConfigs: { [key: string]: string };
355
+ private l10n: L10n;
356
+ private isKeyNavFocus: boolean;
357
+
358
+ /**
359
+ * * Constructor for creating the Stepper component.
360
+ *
361
+ * @param {StepperModel} options - Specifies the Stepper model.
362
+ * @param {string | HTMLElement} element - Specifies the element to render as component.
363
+ * @private
364
+ */
365
+ constructor(options?: StepperModel, element?: string | HTMLElement) {
366
+ super(options, element);
367
+ }
368
+
369
+ protected preRender(): void {
370
+ if (!this.element.id) {
371
+ this.element.id = getUniqueID('e-' + this.getModuleName());
372
+ }
373
+ const localeText: object = { optional: 'Optional' };
374
+ this.l10n = new L10n('stepper', localeText, this.locale);
375
+ this.keyConfigs = {
376
+ downarrow: 'downarrow',
377
+ leftarrow: 'leftarrow',
378
+ rightarrow: 'rightarrow',
379
+ uparrow: 'uparrow',
380
+ space: 'space',
381
+ enter: 'enter',
382
+ home: 'home',
383
+ end: 'end',
384
+ tab: 'tab',
385
+ shiftTab: 'shift+tab',
386
+ escape: 'escape'
387
+ };
388
+ this.tooltipOpen = false;
389
+ }
390
+
391
+ /**
392
+ * To get component name.
393
+ *
394
+ * @returns {string} - It returns the current module name.
395
+ * @private
396
+ */
397
+ public getModuleName(): string {
398
+ return 'stepper';
399
+ }
400
+
401
+ protected render(): void {
402
+ this.initialize();
403
+ this.navigationHandler(this.activeStep, null, false);
404
+ this.updateStepperStatus(true);
405
+ }
406
+
407
+ private initialize(): void {
408
+ this.element.setAttribute('aria-label', this.element.id);
409
+ this.updatePosition();
410
+ this.stepperItemList = this.createElement('ol', { className: ITEMLIST });
411
+ this.updateOrientaion(this.element);
412
+ this.updateStepType();
413
+ this.element.appendChild(this.stepperItemList);
414
+ if (this.cssClass) {
415
+ addClass([this.element], this.cssClass.trim().split(' '));
416
+ }
417
+ if (this.readOnly) { this.element.classList.add(READONLY); }
418
+ if (this.enableRtl) { this.element.classList.add(RTL); }
419
+ this.wireEvents();
420
+ this.updateTemplateFunction();
421
+ this.renderItems();
422
+ if (this.steps.length > 0) {
423
+ this.initiateProgressBar();
424
+ this.checkValidStep();
425
+ this.updateAnimation();
426
+ this.updateTooltip();
427
+ this.wireKeyboardEvent();
428
+ }
429
+ }
430
+
431
+ private initiateProgressBar(): void {
432
+ if (this.steps.length > 1) {
433
+ if (this.isAngular && this.template) {
434
+ setTimeout(() => { this.renderProgressBar(this.element); });
435
+ }
436
+ else { this.renderProgressBar(this.element); }
437
+ }
438
+ }
439
+
440
+ private updatePosition(): void {
441
+ this.progressBarPosition = this.beforeLabelWidth = this.textEleWidth = 0;
442
+ }
443
+
444
+ private renderDefault(index: number): boolean {
445
+ const step: StepModel = this.steps[parseInt(index.toString(), 10)];
446
+ return !step.iconCss && !step.text && !step.label;
447
+ }
448
+
449
+ private updateAnimation(): void {
450
+ const progressEle: HTMLElement = this.element.querySelector('.e-progressbar-value');
451
+ if (this.animation.enable) {
452
+ if (this.animation.delay >= 0) {
453
+ if (progressEle) { progressEle.style.setProperty('--delay', ((this.animation.delay) + 'ms')); }
454
+ }
455
+ }
456
+ else {
457
+ if (progressEle) {
458
+ progressEle.style.setProperty('--delay', (0 + 'ms'));
459
+ progressEle.style.setProperty('--duration', (0 + 'ms'));
460
+ }
461
+ }
462
+ }
463
+
464
+ private updateStepType(): void {
465
+ if (!isNullOrUndefined(this.stepType)) {
466
+ const stepTypeLower: string = this.stepType.toLowerCase();
467
+ const validStepTypes: string[] = ['indicator', 'label', 'default'];
468
+ if (validStepTypes.indexOf(stepTypeLower) !== -1) {
469
+ if (stepTypeLower !== 'default') { this.element.classList.add('e-step-type-' + stepTypeLower); }
470
+ if ((stepTypeLower === 'indicator' || stepTypeLower === 'label') && this.labelContainer) { this.clearLabelPosition(); }
471
+ }
472
+ }
473
+ }
474
+
475
+ private wireEvents(): void {
476
+ EventHandler.add(<HTMLElement & Window><unknown>window, 'resize', this.updateResize, this);
477
+ EventHandler.add(<HTMLElement & Window><unknown>window, 'click', this.updateStepFocus, this);
478
+ }
479
+
480
+ private unWireEvents(): void {
481
+ EventHandler.remove(<HTMLElement & Window><unknown>window, 'resize', this.updateResize);
482
+ EventHandler.remove(<HTMLElement & Window><unknown>window, 'click', this.updateStepFocus);
483
+ }
484
+
485
+ private updateResize(): void {
486
+ if (this.stepperItemList && this.progressbar && this.element.classList.contains(HORIZSTEP)) {
487
+ this.setProgressPosition(this.element, true);
488
+ }
489
+ this.navigateToStep(this.activeStep, null, null, false, false);
490
+ }
491
+
492
+ private updateStepFocus(): void {
493
+ if (this.isKeyNavFocus) {
494
+ this.isKeyNavFocus = false;
495
+ const isFocus: HTMLElement = this.element.querySelector('.' + FOCUS);
496
+ if (isFocus) { isFocus.classList.remove(FOCUS); this.element.classList.remove('e-steps-focus'); }
497
+ }
498
+ }
499
+
500
+ private updateStepperStatus(isInitial?: boolean): void {
501
+ for (let index: number = 0; index < this.steps.length; index++) {
502
+ const item: StepModel = this.steps[parseInt(index.toString(), 10)];
503
+ const status: string = item.status.toLowerCase();
504
+ if (isInitial && this.activeStep === 0 && index === 0) {
505
+ const prevOnChange: boolean = this.isProtectedOnChange;
506
+ this.isProtectedOnChange = true;
507
+ item.status = StepStatus.InProgress;
508
+ this.isProtectedOnChange = prevOnChange;
509
+ }
510
+ if (item && status !== 'notstarted' && index === this.activeStep) {
511
+ for (let i: number = 0; i < this.steps.length; i++) {
512
+ const itemElement: HTMLElement = this.stepperItemElements[parseInt(i.toString(), 10)];
513
+ itemElement.classList.remove(SELECTED, INPROGRESS, COMPLETED, NOTSTARTED);
514
+ const prevOnChange: boolean = this.isProtectedOnChange;
515
+ this.isProtectedOnChange = true;
516
+ if (status === 'completed') { this.updateStatusClass(i, index, itemElement); }
517
+ else { this.updateStatusClass(i, index, itemElement, true); }
518
+ this.isProtectedOnChange = prevOnChange;
519
+ }
520
+ } else if (item && status !== 'notstarted' && index !== this.activeStep) { this.navigationHandler(this.activeStep, null, true); }
521
+ }
522
+ }
523
+
524
+ private updateStatusClass(currentStep: number, index: number, ele: HTMLElement, isInprogress?: boolean): void {
525
+ const stepItem: StepModel = this.steps[parseInt(currentStep.toString(), 10)];
526
+ if (currentStep < index) { ele.classList.add(COMPLETED); stepItem.status = StepStatus.Completed; }
527
+ else if (currentStep === index) { ele.classList.add(isInprogress ? INPROGRESS : COMPLETED, SELECTED); }
528
+ else { ele.classList.add(NOTSTARTED); }
529
+ }
530
+
531
+ private renderItems(): void {
532
+ const isHorizontal: boolean = this.element.classList.contains(HORIZSTEP);
533
+ const isVertical: boolean = this.element.classList.contains(VERTICALSTEP);
534
+ const labelPositionLower: string = !isNullOrUndefined(this.labelPosition) ? this.labelPosition.toLowerCase() : '';
535
+ for (let index: number = 0; index < this.steps.length; index++) {
536
+ this.stepperItemContainer = this.createElement('li', { className: ITEMCONTAINER });
537
+ const stepSpan: HTMLElement = this.createElement('span', { className: 'e-step' });
538
+ const item: StepModel = this.steps[parseInt(index.toString(), 10)];
539
+ let isItemLabel: boolean = item.label ? true : false;
540
+ let isItemText: boolean = item.text ? true : false;
541
+ const isIndicator: boolean = this.element.classList.contains(STEPINDICATOR);
542
+ this.stepperItemContainer.classList[(index === 0) ? 'add' : 'remove'](SELECTED, INPROGRESS);
543
+ this.stepperItemContainer.classList[(index !== 0) ? 'add' : 'remove'](NOTSTARTED);
544
+ if (isHorizontal) { this.stepperItemContainer.style.setProperty('--max-width', 100 / this.steps.length + '%'); }
545
+ if (this.renderDefault(index) && (isNullOrUndefined(this.template) || this.template === '')) {
546
+ const isIndicator: boolean = !this.element.classList.contains('e-step-type-default') && this.stepType.toLowerCase() === 'indicator';
547
+ if (isIndicator) { stepSpan.classList.add('e-icons', INDICATORICON); }
548
+ if (!isIndicator && item.isValid == null) {
549
+ stepSpan.classList.add('e-step-content');
550
+ stepSpan.innerHTML = (index + 1).toString();
551
+ }
552
+ this.stepperItemContainer.appendChild(stepSpan);
553
+ }
554
+ else if (isNullOrUndefined(this.template) || this.template === '') {
555
+ let isRender: boolean = true;
556
+ if ((item.iconCss || (!item.iconCss && isItemText && isItemLabel)) && (((!isItemText && !isItemLabel) ||
557
+ !this.element.classList.contains(LABELINDICATOR)))) {
558
+ if (item.iconCss) {
559
+ const itemIcon: string[] = item.iconCss.trim().split(' ');
560
+ stepSpan.classList.add(ICONCSS, ...itemIcon);
561
+ this.stepperItemContainer.classList.add(STEPICON);
562
+ } else if (!item.iconCss && isItemText && isItemLabel) {
563
+ stepSpan.classList.add(ICONCSS);
564
+ stepSpan.innerHTML = item.text;
565
+ this.stepperItemContainer.classList.add(STEPICON);
566
+ }
567
+ this.stepperItemContainer.appendChild(stepSpan);
568
+ if (((isHorizontal && (labelPositionLower === 'start' || labelPositionLower === 'end') && isItemLabel) ||
569
+ (isVertical && (labelPositionLower === 'top' || labelPositionLower === 'bottom') && isItemLabel)) && !isIndicator) {
570
+ this.element.classList.add('e-label-' + labelPositionLower);
571
+ this.createTextLabelElement(item.label);
572
+ isRender = false;
573
+ }
574
+ }
575
+ if (isItemText && (!item.iconCss || !isIndicator) && isRender &&
576
+ !(item.iconCss && isItemLabel)) {
577
+ if ((!item.iconCss && isIndicator) ||
578
+ ((!item.iconCss || this.element.classList.contains(LABELINDICATOR)) && !isItemLabel)) {
579
+ if (!item.iconCss && !isItemLabel) { this.element.classList.add('e-step-type-indicator'); }
580
+ this.checkValidState(item, stepSpan);
581
+ isItemLabel = false;
582
+ }
583
+ else {
584
+ if (!isItemLabel) { this.createTextLabelElement(item.text); }
585
+ if (isItemLabel && this.element.classList.contains(LABELINDICATOR)) {
586
+ const textSpan: HTMLElement = this.createElement('span', { className: TEXT });
587
+ textSpan.innerText = item.label;
588
+ }
589
+ isItemText = isItemLabel ? false : true;
590
+ }
591
+ }
592
+ if (isItemLabel && isItemLabel && (!item.iconCss || !isIndicator) && isRender) {
593
+ if (!item.iconCss && !isItemText && isIndicator) {
594
+ this.checkValidState(item, stepSpan, true);
595
+ }
596
+ else if ((!((this.element.classList.contains(LABELINDICATOR)) && isItemText)) ||
597
+ (this.element.classList.contains(LABELINDICATOR) && isItemLabel)) {
598
+ this.createTextLabelElement(item.label, true);
599
+ this.updateLabelPosition();
600
+ if ((!item.iconCss && !isItemText && !this.stepperItemContainer.classList.contains(STEPICON)) ||
601
+ this.element.classList.contains(LABELINDICATOR)) {
602
+ this.stepperItemContainer.classList.add('e-step-label-only');
603
+ if (item.isValid !== null) {
604
+ const iconSpan: HTMLElement = this.createElement('span', { className: 'e-step-validation-icon e-icons' });
605
+ this.labelContainer.appendChild(iconSpan);
606
+ }
607
+ }
608
+ }
609
+ }
610
+ }
611
+ if (item.optional) {
612
+ const optionalSpan: HTMLElement = this.createElement('span', { className: OPTIONAL });
613
+ this.l10n.setLocale(this.locale);
614
+ const optionalContent: string = this.l10n.getConstant('optional');
615
+ optionalSpan.innerText = optionalContent;
616
+ if (isItemLabel && (this.labelContainer && ((this.element.classList.contains(LABELAFTER) && !this.stepperItemContainer.classList.contains('e-step-label-only'))
617
+ || (isHorizontal && this.element.classList.contains(LABELBEFORE) && !this.stepperItemContainer.classList.contains('e-step-label-only'))))
618
+ || (isVertical && this.element.classList.contains(LABELBEFORE))) {
619
+ this.labelContainer.appendChild(optionalSpan);
620
+ } else {
621
+ this.stepperItemContainer.appendChild(optionalSpan);
622
+ }
623
+ if (item.isValid !== null) { this.stepperItemContainer.classList.add(item.isValid ? 'e-step-valid' : 'e-step-error'); }
624
+ }
625
+ if (item.cssClass) {
626
+ addClass([this.stepperItemContainer], item.cssClass.trim().split(' '));
627
+ }
628
+ if (item.disabled) {
629
+ this.stepperItemContainer.classList[item.disabled ? 'add' : 'remove'](DISABLED);
630
+ attributes(this.stepperItemContainer, { 'tabindex': '-1', 'aria-disabled': 'true' });
631
+ }
632
+ if (item.isValid !== null) {
633
+ if (item.isValid) { this.stepperItemContainer.classList.add('e-step-valid'); }
634
+ else { this.stepperItemContainer.classList.add('e-step-error'); }
635
+ }
636
+ this.renderItemContent(index, false);
637
+ if (this.stepperItemContainer.classList.contains(INPROGRESS)) { attributes(this.stepperItemContainer, { 'tabindex': '0', 'aria-current': 'true' }); }
638
+ else { attributes(this.stepperItemContainer, { 'tabindex': '-1' }); }
639
+ this.wireItemsEvents(this.stepperItemContainer, index);
640
+ this.stepperItemElements.push(this.stepperItemContainer);
641
+ const eventArgs: StepperRenderingEventArgs = { element: this.stepperItemContainer, index: index };
642
+ this.trigger('beforeStepRender', eventArgs, (args: StepperRenderingEventArgs) => {
643
+ this.stepperItemList.appendChild(args.element);
644
+ });
645
+ if (isVertical) {
646
+ if (this.isAngular && this.template) {
647
+ setTimeout(() => { this.calculateProgressBarPosition(); });
648
+ } else { this.calculateProgressBarPosition(); }
649
+ }
650
+ }
651
+ if (isVertical) {
652
+ if (this.element.classList.contains(LABELBEFORE)) {
653
+ const listItems: NodeListOf<Element> = this.stepperItemList.querySelectorAll('.' + LABEL);
654
+ for (let i: number = 0; i < listItems.length; i++) {
655
+ const labelEle: HTMLElement = listItems[parseInt((i).toString(), 10)] as HTMLElement;
656
+ labelEle.style.setProperty('--label-width', (this.beforeLabelWidth) + 5 + 'px');
657
+ }
658
+ }
659
+ }
660
+ }
661
+
662
+ private createTextLabelElement(content: string, isLabelEle: boolean = false): void {
663
+ const spanEle: HTMLElement = this.createElement('span', { className: isLabelEle ? LABEL : `${TEXTCSS} ${TEXT}` });
664
+ spanEle.innerText = content;
665
+ if (isLabelEle) {
666
+ this.labelContainer = this.createElement('span', { className: STEPLABEL });
667
+ this.labelContainer.appendChild(spanEle);
668
+ } else { this.stepperItemContainer.appendChild(spanEle); }
669
+ this.stepperItemContainer.classList.add(isLabelEle ? STEPSLABEL : STEPTEXT);
670
+ }
671
+
672
+ private calculateProgressBarPosition(): void {
673
+ const isBeforeLabel: boolean = (this.element.classList.contains(LABELBEFORE)) ? true : false;
674
+ const iconOnly: boolean = (this.stepperItemContainer.classList.contains(STEPICON) &&
675
+ !this.stepperItemContainer.classList.contains(STEPTEXT) &&
676
+ !this.stepperItemContainer.classList.contains(STEPSLABEL));
677
+ const textEle: HTMLElement = (this.stepperItemContainer.querySelector('.' + TEXTCSS));
678
+ if (textEle) { this.textEleWidth = this.textEleWidth < textEle.offsetWidth ? textEle.offsetWidth : this.textEleWidth; }
679
+ if (isBeforeLabel) {
680
+ const labelWidth: number = (this.stepperItemContainer.querySelector('.' + LABEL) as HTMLElement).offsetWidth + 15;
681
+ this.beforeLabelWidth = Math.max(this.beforeLabelWidth, labelWidth);
682
+ const iconEle: HTMLElement = (this.element.querySelector('ol').lastChild as HTMLElement).querySelector('.' + ICONCSS);
683
+ const textEle: HTMLElement = this.stepperItemContainer.querySelector('.' + TEXTCSS);
684
+ if (iconEle || textEle) {
685
+ const itemWidth: number = this.beforeLabelWidth + (((this.stepperItemContainer.querySelector('.' + ICONCSS) as HTMLElement)
686
+ || textEle).offsetWidth / 2);
687
+ this.progressBarPosition = Math.max(this.progressBarPosition, itemWidth);
688
+ } else {
689
+ this.progressBarPosition = Math.max(this.progressBarPosition, (this.beforeLabelWidth / 2));
690
+ }
691
+ }
692
+ else {
693
+ const lastChild: HTMLElement = this.element.querySelector('ol').lastChild as HTMLElement;
694
+ const lastChildWidth: number = iconOnly ? this.stepperItemContainer.offsetWidth :
695
+ (lastChild.firstChild as HTMLElement).offsetWidth;
696
+ this.progressBarPosition = Math.max(this.progressBarPosition, lastChildWidth);
697
+ }
698
+ }
699
+
700
+ private checkValidState(item: StepModel, stepSpan: HTMLElement, isLabel?: boolean): void {
701
+ if (item.isValid == null) {
702
+ stepSpan.classList.add('e-step-content');
703
+ if (isLabel) { stepSpan.innerHTML = item.label; }
704
+ else { stepSpan.innerHTML = item.label ? item.label : item.text; }
705
+ this.stepperItemContainer.appendChild(stepSpan);
706
+ } else {
707
+ stepSpan.classList.add(ICONCSS);
708
+ this.stepperItemContainer.appendChild(stepSpan);
709
+ this.stepperItemContainer.classList.add(STEPICON);
710
+ }
711
+ }
712
+
713
+ private updateCurrentLabel(): string {
714
+ const labelPos: string = this.labelPosition.toLowerCase();
715
+ const currentLabelPos: string = this.element.classList.contains(HORIZSTEP)
716
+ ? (labelPos === 'top' ? 'before' : labelPos === 'bottom' ? 'after' : labelPos)
717
+ : (labelPos === 'start' ? 'before' : labelPos === 'end' ? 'after' : labelPos);
718
+ return currentLabelPos;
719
+ }
720
+
721
+ private updateLabelPosition(): void {
722
+ this.clearLabelPosition();
723
+ this.labelContainer.classList.add('e-label-' + this.updateCurrentLabel());
724
+ if (this.labelPosition.toLowerCase() === 'start' && this.orientation.toLowerCase() === 'vertical') {
725
+ if (this.stepperItemContainer.firstChild) { this.stepperItemContainer.firstChild.before(this.labelContainer); }
726
+ else { this.stepperItemContainer.appendChild(this.labelContainer); }
727
+ }
728
+ else { this.stepperItemContainer.appendChild(this.labelContainer); }
729
+ this.element.classList.add('e-label-' + this.updateCurrentLabel());
730
+ }
731
+
732
+ private clearLabelPosition(): void {
733
+ const removeCss: string[] = this.labelContainer.classList.value.match(/(e-label-[after|before]+)/g);
734
+ if (removeCss) {
735
+ removeClass([this.labelContainer], removeCss);
736
+ removeClass([this.element], removeCss);
737
+ }
738
+ }
739
+
740
+ private checkValidStep(): void {
741
+ const isStepIndicator: boolean = this.element.classList.contains(STEPINDICATOR);
742
+ for (let index: number = 0; index < this.steps.length; index++) {
743
+ const item: StepModel = this.steps[parseInt(index.toString(), 10)];
744
+ const itemElement: HTMLElement = this.stepperItemElements[parseInt(index.toString(), 10)];
745
+ if (item.isValid !== null) {
746
+ let indicatorEle: HTMLElement;
747
+ let iconEle: HTMLElement;
748
+ if (isStepIndicator && !item.iconCss) {
749
+ indicatorEle = itemElement.querySelector('.' + ICONCSS);
750
+ }
751
+ else {
752
+ iconEle = itemElement.querySelector('.' + ICONCSS);
753
+ }
754
+ if (!indicatorEle && isStepIndicator && this.renderDefault(index)) {
755
+ indicatorEle = itemElement.querySelector('.' + INDICATORICON);
756
+ }
757
+ const textLabelIcon: HTMLElement = itemElement.querySelector('.e-step-validation-icon');
758
+ const itemIcon: string[] = item.iconCss.trim().split(' ');
759
+ const validStep: boolean = itemElement.classList.contains('e-step-valid');
760
+ const validIconClass: string = validStep ? 'e-check' : 'e-circle-info';
761
+ if (indicatorEle) {
762
+ indicatorEle.classList.remove(INDICATORICON);
763
+ if (indicatorEle.innerHTML !== '') { indicatorEle.innerHTML = ''; }
764
+ indicatorEle.classList.add('e-icons', validIconClass, ICONCSS);
765
+ }
766
+ if (this.renderDefault(index) && !isStepIndicator) {
767
+ const stepSpan: HTMLElement = itemElement.querySelector('.e-step');
768
+ stepSpan.classList.add('e-icons', validIconClass, ICONCSS);
769
+ }
770
+ if (iconEle) {
771
+ if (iconEle.innerHTML !== '') { iconEle.innerHTML = ''; }
772
+ else if (itemIcon.length > 0) {
773
+ itemIcon.forEach((icon: string) => { iconEle.classList.remove(icon); });
774
+ }
775
+ iconEle.classList.add('e-icons', validIconClass);
776
+ }
777
+ if (textLabelIcon) {
778
+ textLabelIcon.classList.add(validStep ? 'e-circle-check' : 'e-circle-info');
779
+ if (this.element.classList.contains(VERTICALSTEP)) {
780
+ const labelEle: HTMLElement = (itemElement.querySelector('.' + LABEL) as HTMLElement);
781
+ const textEle: HTMLElement = (itemElement.querySelector('.' + TEXT) as HTMLElement);
782
+ const itemWidth: number = textEle ? textEle.offsetWidth + textEle.getBoundingClientRect().left :
783
+ labelEle.offsetWidth + labelEle.getBoundingClientRect().left;
784
+ const validationIcon: HTMLElement = (itemElement.querySelector('.e-step-validation-icon') as HTMLElement);
785
+ validationIcon.style.setProperty('--icon-position', (itemWidth + 20) + 'px');
786
+ }
787
+ }
788
+ }
789
+ }
790
+ }
791
+
792
+ private updateTooltip(): void {
793
+ if (this.showTooltip) {
794
+ this.tooltipObj = new Tooltip({
795
+ target: '.e-step-container', windowCollision: true,
796
+ opensOn: 'Custom', cssClass: this.cssClass ? (STEPPERTOOLTIP + ' ' + this.cssClass) : STEPPERTOOLTIP,
797
+ position: 'TopCenter'
798
+ });
799
+ this.tooltipObj.appendTo(this.stepperItemList);
800
+ }
801
+ else {
802
+ if (!isNullOrUndefined(this.tooltipObj)) {
803
+ this.tooltipObj.destroy();
804
+ this.tooltipObj = null;
805
+ }
806
+ }
807
+ }
808
+
809
+ private wireItemsEvents(itemElement: HTMLElement, index: number): void {
810
+ EventHandler.add(itemElement, 'click', this.linearModeHandler.bind(this, itemElement, index), this);
811
+ EventHandler.add(itemElement, 'mouseover', this.openStepperTooltip.bind(this, index), this);
812
+ EventHandler.add(itemElement, 'mouseleave', this.closeStepperTooltip, this);
813
+ }
814
+
815
+ private unWireItemsEvents(): void {
816
+ for (let index: number = 0; index < this.steps.length; index++) {
817
+ const itemElement: HTMLElement = this.stepperItemElements[parseInt(index.toString(), 10)];
818
+ EventHandler.remove(itemElement, 'click', this.linearModeHandler.bind(this, itemElement, index));
819
+ EventHandler.remove(itemElement, 'mouseover', this.openStepperTooltip.bind(this, index));
820
+ EventHandler.remove(itemElement, 'mouseleave', this.closeStepperTooltip);
821
+ }
822
+ }
823
+
824
+ private linearModeHandler(itemElement: HTMLElement, index: number, e: Event): void {
825
+ if (this.linear) {
826
+ const linearModeValue: number = index - this.activeStep;
827
+ if (Math.abs(linearModeValue) === 1) { this.stepClickHandler(index, e, itemElement); }
828
+ }
829
+ else { this.stepClickHandler(index, e, itemElement); }
830
+ }
831
+
832
+ private openStepperTooltip(index: number): void {
833
+ const currentStep: StepModel = this.steps[parseInt(index.toString(), 10)];
834
+ if (this.showTooltip && (currentStep.label || currentStep.text)) {
835
+ if (!this.tooltipOpen) {
836
+ this.updateTooltipContent(index);
837
+ this.tooltipObj.open(this.stepperItemElements[parseInt((index).toString(), 10)]);
838
+ if (this.stepType.toLocaleLowerCase() !== 'label' && ((this.stepType.toLocaleLowerCase() === 'indicator') ||
839
+ (currentStep.label !== '' && currentStep.iconCss !== '') || (currentStep.label === null && currentStep.iconCss === '' && currentStep.text !== ''))) {
840
+ const tooltipPopupClass: string = currentStep.status.toLowerCase() === 'inprogress' ?
841
+ `${STEPPERTOOLTIP} ${STEPPERIPROGRESSTIP} ${this.cssClass ? this.cssClass : ''}` : `${STEPPERTOOLTIP} ${this.cssClass ? this.cssClass : ''}`;
842
+ this.tooltipObj.setProperties({ cssClass: tooltipPopupClass.trim() });
843
+ }
844
+ this.tooltipOpen = true;
845
+ }
846
+ }
847
+ }
848
+
849
+ private closeStepperTooltip(): void {
850
+ if (this.tooltipOpen) {
851
+ this.tooltipObj.close();
852
+ this.tooltipOpen = false;
853
+ }
854
+ }
855
+
856
+ private updateTooltipContent(index: number): void {
857
+ if (this.showTooltip) {
858
+ if (this.isReact) { this.clearTemplate(['stepperTooltipTemplate']); }
859
+ let content: string | HTMLElement;
860
+ const currentStep: StepModel = this.steps[parseInt(index.toString(), 10)];
861
+ if (this.tooltipTemplate) {
862
+ content = this.createElement('span', { className: 'e-stepper-tooltip-content' });
863
+ const templateFunction: Function = this.getTemplateFunction(this.tooltipTemplate);
864
+ append(templateFunction({ value: currentStep }, this, 'stepperTooltipTemplate', (this.element.id + 'tooltipTemplate'), this.isStringTemplate), (content as HTMLElement));
865
+ this.tooltipObj.setProperties({ content: content }, true);
866
+ }
867
+ else {
868
+ const content: string = currentStep.label ? currentStep.label : currentStep.text;
869
+ this.tooltipObj.setProperties({ content: initializeCSPTemplate(() => { return content; }) }, true);
870
+ }
871
+ this.renderReactTemplates();
872
+ }
873
+ }
874
+
875
+ private stepClickHandler(index: number, e: Event, itemElement: HTMLElement): void {
876
+ const clickEventArgs: StepperClickEventArgs = {
877
+ element: itemElement, event: e, previousStep: this.activeStep,
878
+ activeStep: index
879
+ };
880
+ this.trigger('stepClick', clickEventArgs);
881
+ this.navigateToStep(index, e, itemElement, true);
882
+ }
883
+
884
+ private updateTemplateFunction(): void {
885
+ this.templateFunction = this.template ? this.getTemplateFunction(this.template) : null;
886
+ }
887
+
888
+ private renderItemContent(index: number, isrerender: boolean): void {
889
+ const listItems: NodeListOf<Element> = this.stepperItemList.querySelectorAll('li');
890
+ if (isrerender) {
891
+ this.removeItemContent(listItems[parseInt((index).toString(), 10)] as HTMLElement);
892
+ }
893
+ if (this.template) {
894
+ if (isrerender) { listItems[parseInt((index).toString(), 10)].classList.add(TEMPLATE); }
895
+ else { this.stepperItemContainer.classList.add(TEMPLATE); }
896
+ const item: StepModel = this.steps[parseInt(index.toString(), 10)];
897
+ append(this.templateFunction({ step: item, currentStep: index }, this, 'stepperTemplate', (this.element.id + '_stepperTemplate'), this.isStringTemplate), isrerender ? listItems[parseInt((index).toString(), 10)] : this.stepperItemContainer);
898
+ }
899
+ this.renderReactTemplates();
900
+ }
901
+
902
+ private removeItemContent(ele: HTMLElement): void {
903
+ ele.classList.remove(TEMPLATE);
904
+ const firstChild: HTMLElement = ele.firstElementChild as HTMLElement;
905
+ for (let i: number = 0; i < ele.childElementCount; i++) {
906
+ firstChild.remove();
907
+ }
908
+ }
909
+
910
+ private updateContent(): void {
911
+ if (this.isReact) { this.clearTemplate(['stepperTemplate']); }
912
+ for (let i: number = 0; i < this.steps.length; i++) {
913
+ this.renderItemContent(i, true);
914
+ }
915
+ }
916
+
917
+ /**
918
+ * Gets template content based on the template property value.
919
+ *
920
+ * @param {string | Function} template - Template property value.
921
+ * @returns {Function} - Return template function.
922
+ * @hidden
923
+ */
924
+ private getTemplateFunction(template: string | Function): Function {
925
+ if (typeof template === 'string') {
926
+ let content: string = '';
927
+ try {
928
+ const tempEle: HTMLElement = select(template);
929
+ if (tempEle) {
930
+ //Return innerHTML incase of jsrenderer script else outerHTML
931
+ content = tempEle.tagName === 'SCRIPT' ? tempEle.innerHTML : tempEle.outerHTML;
932
+ } else {
933
+ content = template;
934
+ }
935
+ } catch (e) {
936
+ content = template;
937
+ }
938
+ return compile(content);
939
+ } else {
940
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
941
+ return compile(template as any);
942
+ }
943
+ }
944
+
945
+ private navigateToStep(index: number, e: Event, itemElement: HTMLElement, isInteracted: boolean, isUpdated?: boolean): void {
946
+ const eventArgs: StepperChangingEventArgs = {
947
+ element: itemElement, event: e, isInteracted: isInteracted,
948
+ previousStep: this.activeStep, activeStep: index, cancel: false
949
+ };
950
+ if (isUpdated !== false) {
951
+ const previousStep: number = this.activeStep;
952
+ this.trigger('stepChanging', eventArgs, (args: StepperChangingEventArgs) => {
953
+ if (args.cancel) { return; }
954
+ this.navigationHandler(index);
955
+ const eventArgs: StepperChangedEventArgs = {
956
+ element: itemElement, event: e, isInteracted: isInteracted,
957
+ previousStep: previousStep, activeStep: this.activeStep
958
+ };
959
+ this.trigger('stepChanged', eventArgs);
960
+ });
961
+ }
962
+ else {
963
+ this.navigationHandler(index);
964
+ }
965
+ }
966
+
967
+ private navigationHandler(index: number, stepStatus?: string, isUpdated?: boolean): void {
968
+ if (index !== this.activeStep && this.progressbar) {
969
+ this.progressbar.style.transitionDuration = this.animation.duration + 'ms';
970
+ }
971
+ index = Math.min(index, this.steps.length - 1);
972
+ const Itemslength: number = this.stepperItemElements.length;
973
+ if (index >= 0 && index < Itemslength - 1) {
974
+ index = this.stepperItemElements[parseInt(index.toString(), 10)].classList.contains(DISABLED) ? this.activeStep : index;
975
+ }
976
+ const prevOnChange: boolean = this.isProtectedOnChange;
977
+ this.isProtectedOnChange = true;
978
+ this.activeStep = parseInt(index.toString(), 10);
979
+ this.isProtectedOnChange = prevOnChange;
980
+ for (let i: number = 0; i < this.steps.length; i++) {
981
+ const itemElement: HTMLElement = this.stepperItemElements[parseInt(i.toString(), 10)];
982
+ const item: StepModel = this.steps[parseInt(i.toString(), 10)];
983
+ itemElement.classList.remove(SELECTED, INPROGRESS, COMPLETED, NOTSTARTED);
984
+ if (i === this.activeStep) { itemElement.classList.add(SELECTED); }
985
+ if (this.activeStep >= 0 && this.progressbar) {
986
+ if (this.element.classList.contains(HORIZSTEP)) { this.calculateProgressbarPos(); }
987
+ else { this.progressbar.style.setProperty(PROGRESSVALUE, ((100 / (this.steps.length - 1)) * index) + '%'); }
988
+ }
989
+ else if (this.activeStep < 0 && this.progressbar) { this.progressbar.style.setProperty(PROGRESSVALUE, 0 + '%'); }
990
+ if (i === this.activeStep) { itemElement.classList.add(INPROGRESS); }
991
+ else if (this.activeStep > 0 && i < this.activeStep) { itemElement.classList.add(COMPLETED); }
992
+ else { itemElement.classList.add(NOTSTARTED); }
993
+ if (itemElement.classList.contains(INPROGRESS)) { attributes(itemElement, { 'tabindex': '0', 'aria-current': 'true' }); }
994
+ else { attributes(itemElement, { 'tabindex': '-1', 'aria-current': 'false' }); }
995
+ const prevOnChange: boolean = this.isProtectedOnChange;
996
+ this.isProtectedOnChange = true;
997
+ if (isUpdated !== false) {
998
+ if (i < this.activeStep || (this.steps.length - 1 === this.activeStep && item.status.toLowerCase() === 'completed')) { item.status = StepStatus.Completed; }
999
+ else if (i === this.activeStep) { item.status = StepStatus.InProgress; }
1000
+ else if (i > this.activeStep) { item.status = StepStatus.NotStarted; }
1001
+ if (stepStatus && this.activeStep === i) { item.status = stepStatus; }
1002
+ if (item.status.toLowerCase() === 'completed') {
1003
+ itemElement.classList.remove(SELECTED, INPROGRESS, NOTSTARTED);
1004
+ itemElement.classList.add(COMPLETED);
1005
+ }
1006
+ if (item.status.toLowerCase() === 'notstarted') {
1007
+ itemElement.classList.remove(SELECTED, INPROGRESS, COMPLETED);
1008
+ itemElement.classList.add(NOTSTARTED);
1009
+ }
1010
+ }
1011
+ this.isProtectedOnChange = prevOnChange;
1012
+ this.updateIndicatorStatus(i, itemElement);
1013
+ }
1014
+ this.updateStepInteractions();
1015
+ if (this.progressbar) { this.progressbar.style.transitionDuration = '0ms'; }
1016
+ }
1017
+
1018
+ private calculateProgressbarPos(): void {
1019
+ if ((this.element.classList.contains(LABELBEFORE) || this.element.classList.contains(LABELAFTER)) &&
1020
+ !this.element.classList.contains(STEPINDICATOR) &&
1021
+ this.stepperItemElements[parseInt(this.activeStep.toString(), 10)].classList.contains(STEPICON)) {
1022
+ const progressPos: HTMLElement = (this.element.querySelector('.e-stepper-progressbar') as HTMLElement);
1023
+ const selectedEle: HTMLElement = this.stepperItemElements[parseInt(this.activeStep.toString(), 10)]
1024
+ .firstChild as HTMLElement;
1025
+ let value: number = this.activeStep === 0 ? 0 : (selectedEle.offsetLeft - progressPos.offsetLeft +
1026
+ (selectedEle.offsetWidth / 2)) / progressPos.offsetWidth * 100;
1027
+ if (this.element.classList.contains(RTL)) {
1028
+ value = (progressPos.getBoundingClientRect().right - selectedEle.getBoundingClientRect().right +
1029
+ (selectedEle.offsetWidth / 2)) / progressPos.offsetWidth * 100;
1030
+ this.progressbar.style.setProperty(PROGRESSVALUE, (value) + '%');
1031
+ }
1032
+ else { this.progressbar.style.setProperty(PROGRESSVALUE, (value) + '%'); }
1033
+ }
1034
+ else {
1035
+ let totalLiWidth: number = 0;
1036
+ let activeLiWidth: number = 0;
1037
+ this.stepperItemElements.forEach((element: HTMLElement, index: number) => {
1038
+ const itemWidth: number = element.offsetWidth;
1039
+ totalLiWidth += itemWidth;
1040
+ if (index <= this.activeStep) {
1041
+ activeLiWidth += (index === this.activeStep && index !== 0) ? (itemWidth / 2) : itemWidth;
1042
+ }
1043
+ });
1044
+ const spaceWidth: number = (this.stepperItemList.offsetWidth - totalLiWidth) /
1045
+ (this.stepperItemElements.length - 1);
1046
+ const progressValue: number = ((activeLiWidth + (spaceWidth * this.activeStep)) /
1047
+ this.stepperItemList.offsetWidth) * 100;
1048
+ this.progressbar.style.setProperty(PROGRESSVALUE, (progressValue) + '%');
1049
+ }
1050
+ }
1051
+
1052
+ private updateIndicatorStatus(index: number, itemElement: HTMLElement): void {
1053
+ if (this.renderDefault(index) && this.element.classList.contains(STEPINDICATOR) && !itemElement.classList.contains('e-step-valid')
1054
+ && !itemElement.classList.contains('e-step-error')) {
1055
+ if (itemElement.classList.contains(COMPLETED)) {
1056
+ (itemElement.firstChild as HTMLElement).classList.remove('e-icons', 'e-step-indicator');
1057
+ (itemElement.firstChild as HTMLElement).classList.add(ICONCSS, 'e-icons', 'e-check');
1058
+ }
1059
+ else if (itemElement.classList.contains(INPROGRESS) || itemElement.classList.contains(NOTSTARTED)) {
1060
+ (itemElement.firstChild as HTMLElement).classList.remove(ICONCSS, 'e-icons', 'e-check');
1061
+ (itemElement.firstChild as HTMLElement).classList.add('e-icons', 'e-step-indicator');
1062
+ }
1063
+ }
1064
+ }
1065
+
1066
+ private updateStepInteractions(): void {
1067
+ this.element.classList.toggle(LINEARSTEP, this.linear);
1068
+ this.stepperItemElements.forEach((step: HTMLElement, index: number) => {
1069
+ step.classList.toggle(PREVSTEP, (index === this.activeStep - 1));
1070
+ step.classList.toggle(NEXTSTEP, (index === this.activeStep + 1));
1071
+ });
1072
+ }
1073
+
1074
+ private removeItemElements(): void {
1075
+ for (let i: number = 0; i < this.stepperItemElements.length; i++) {
1076
+ remove(this.stepperItemElements[parseInt(i.toString(), 10)]);
1077
+ }
1078
+ this.stepperItemElements = [];
1079
+ }
1080
+
1081
+ /**
1082
+ * Move to next step from current step in Stepper.
1083
+ *
1084
+ * @returns {void}
1085
+ */
1086
+ public nextStep(): void {
1087
+ if (this.activeStep !== this.steps.length - 1) { this.navigateToStep(this.activeStep + 1, null, null, false); }
1088
+ }
1089
+
1090
+ /**
1091
+ * Move to previous step from current step in Stepper.
1092
+ *
1093
+ * @returns {void}
1094
+ */
1095
+ public previousStep(): void {
1096
+ if (this.activeStep > 0) { this.navigateToStep(this.activeStep - 1, null, null, false); }
1097
+ }
1098
+
1099
+ /**
1100
+ * Reset the state of the Stepper and move to the first step.
1101
+ *
1102
+ * @returns {void}
1103
+ */
1104
+ public reset(): void {
1105
+ if (this.activeStep === 0) {
1106
+ this.updateStepInteractions();
1107
+ }
1108
+ else {
1109
+ const isDisabled: boolean = this.stepperItemElements[0].classList.contains(DISABLED) ? true : false;
1110
+ this.navigateToStep(isDisabled ? -1 : 0, null, null, false);
1111
+ }
1112
+ }
1113
+
1114
+ /**
1115
+ * Refreshes the position of the progress bar programmatically when the dimensions of the parent container are changed.
1116
+ *
1117
+ * @returns {void}
1118
+ */
1119
+ public refreshProgressbar(): void {
1120
+ if (this.stepperItemList && this.progressbar) { this.setProgressPosition(this.element); }
1121
+ this.navigateToStep(this.activeStep, null, null, false, false);
1122
+ }
1123
+
1124
+ private updateElementClassArray(): void {
1125
+ const classArray: string[] = [RTL, READONLY, 'e-steps-focus', LABELAFTER, LABELBEFORE, 'e-label-top',
1126
+ 'e-label-bottom', 'e-label-start', 'e-label-end', STEPINDICATOR, LABELINDICATOR, VERTICALSTEP, HORIZSTEP, LINEARSTEP];
1127
+ removeClass([this.element], classArray);
1128
+ }
1129
+
1130
+ /**
1131
+ * Destroy the stepper control.
1132
+ *
1133
+ * @returns {void}
1134
+ */
1135
+ public destroy(): void {
1136
+ super.destroy();
1137
+ this.unWireEvents();
1138
+ this.unWireItemsEvents();
1139
+ // unwires the events and detach the li elements
1140
+ this.removeItemElements();
1141
+ this.clearTemplate();
1142
+ if (this.stepperItemList) { remove(this.stepperItemList); }
1143
+ this.stepperItemList = null;
1144
+ if (this.progressStep) { remove(this.progressStep); }
1145
+ this.progressStep = null;
1146
+ this.progressbar = null;
1147
+ this.progressBarPosition = null;
1148
+ this.stepperItemContainer = null;
1149
+ this.textContainer = null;
1150
+ this.labelContainer = null;
1151
+ this.updateElementClassArray();
1152
+ this.element.removeAttribute('aria-label');
1153
+ if (this.showTooltip) {
1154
+ this.tooltipObj.destroy();
1155
+ this.tooltipObj = null;
1156
+ }
1157
+ if (this.keyboardModuleStepper) { this.keyboardModuleStepper.destroy(); }
1158
+ this.keyboardModuleStepper = null;
1159
+ }
1160
+
1161
+ private wireKeyboardEvent(): void {
1162
+ this.keyboardModuleStepper = new KeyboardEvents(this.element, {
1163
+ keyAction: this.keyActionHandler.bind(this),
1164
+ keyConfigs: this.keyConfigs,
1165
+ eventName: 'keydown'
1166
+ });
1167
+ }
1168
+
1169
+ private keyActionHandler(e: KeyboardEventArgs): void {
1170
+ if (this.readOnly) { return; }
1171
+ switch (e.action) {
1172
+ case 'uparrow':
1173
+ case 'downarrow':
1174
+ case 'leftarrow':
1175
+ case 'rightarrow':
1176
+ case 'tab':
1177
+ case 'shiftTab':
1178
+ this.handleNavigation(this.enableRtl && this.element.classList.contains(HORIZSTEP) ? (e.action === 'leftarrow' || e.action === 'tab' || e.action === 'uparrow') : (e.action === 'rightarrow' || e.action === 'tab' || e.action === 'downarrow'), e);
1179
+ break;
1180
+ case 'space':
1181
+ case 'enter':
1182
+ case 'escape':
1183
+ this.handleNavigation(null, e);
1184
+ break;
1185
+ case 'home':
1186
+ case 'end':
1187
+ this.handleNavigation(null, e, this.enableRtl);
1188
+ break;
1189
+ }
1190
+ }
1191
+
1192
+ private handleNavigation(isNextStep: boolean, e: KeyboardEventArgs, isRTL?: boolean): void {
1193
+ this.isKeyNavFocus = true;
1194
+ this.element.classList.add('e-steps-focus');
1195
+ let focusedEle: HTMLElement = this.element.querySelector('.' + FOCUS);
1196
+ if (!focusedEle) { focusedEle = this.element.querySelector('.' + SELECTED); }
1197
+ const stepItems: HTMLElement[] = Array.prototype.slice.call(this.stepperItemList.children);
1198
+ let index: number = stepItems.indexOf(focusedEle);
1199
+ if (e.action === 'tab' || e.action === 'shiftTab' || e.action === 'downarrow' || e.action === 'uparrow' || e.action === 'space' || e.action === 'home' || e.action === 'end') {
1200
+ if ((e.action === 'tab' && index === stepItems.length - 1) || (e.action === 'shiftTab' && index === 0)) {
1201
+ if (focusedEle.classList.contains(FOCUS)) { this.updateStepFocus(); return; }
1202
+ } else {
1203
+ e.preventDefault();
1204
+ }
1205
+ }
1206
+ if (e.action === 'escape') { stepItems[parseInt(index.toString(), 10)].classList.remove(FOCUS); this.element.classList.remove('e-steps-focus'); }
1207
+ if (!(e.action === 'space' || e.action === 'enter')) {
1208
+ const prevIndex: number = index;
1209
+ index = isNextStep ? index + 1 : index - 1;
1210
+ while ((index >= 0 && index < stepItems.length) && stepItems[parseInt(index.toString(), 10)].classList.contains(DISABLED)) {
1211
+ index = isNextStep ? index + 1 : index - 1;
1212
+ }
1213
+ index = (index < 0) ? 0 : (index > stepItems.length - 1) ? stepItems.length - 1 : index;
1214
+ if (stepItems[parseInt(prevIndex.toString(), 10)].classList.contains(FOCUS)) {
1215
+ stepItems[parseInt(prevIndex.toString(), 10)].classList.remove(FOCUS);
1216
+ }
1217
+ if ((e.action === 'home' || e.action === 'end')) {
1218
+ if (e.action === 'home') { index = isRTL ? stepItems.length - 1 : 0; }
1219
+ else { index = isRTL ? 0 : stepItems.length - 1; }
1220
+ }
1221
+ if (index >= 0 && index < stepItems.length) { stepItems[parseInt(index.toString(), 10)].classList.add(FOCUS); }
1222
+ } else if ((e.action === 'space' || e.action === 'enter')) {
1223
+ let isupdateFocus: boolean = false;
1224
+ if (this.linear) {
1225
+ const linearModeValue: number = this.activeStep - index;
1226
+ if (Math.abs(linearModeValue) === 1) { this.navigateToStep(index, null, null, true); isupdateFocus = true; }
1227
+ }
1228
+ else { this.navigateToStep(index, null, null, true); isupdateFocus = true; }
1229
+ if (isupdateFocus) {
1230
+ this.updateStepFocus();
1231
+ (this.stepperItemElements[index as number] as HTMLElement).focus();
1232
+ }
1233
+ }
1234
+ }
1235
+
1236
+ private renderStepperItems(isUpdate: boolean, isStepType?: boolean): void {
1237
+ this.updateElementClassArray();
1238
+ this.removeItemElements();
1239
+ this.element.querySelector('.e-stepper-progressbar').remove();
1240
+ if (isUpdate) { this.updatePosition(); }
1241
+ if (isStepType) { this.updateStepType(); }
1242
+ if (this.readOnly && !this.element.classList.contains(READONLY)) { this.element.classList.add(READONLY); }
1243
+ if (this.enableRtl && !this.element.classList.contains(RTL)) { this.element.classList.add(RTL); }
1244
+ this.updateOrientaion(this.element);
1245
+ this.renderItems();
1246
+ this.renderProgressBar(this.element);
1247
+ this.checkValidStep();
1248
+ this.updateAnimation();
1249
+ this.navigateToStep(this.activeStep, null, this.stepperItemElements[this.activeStep], true);
1250
+ }
1251
+
1252
+ private updateDynamicSteps(steps: StepModel[], prevSteps?: StepModel[]): void {
1253
+ if (!(steps instanceof Array && prevSteps instanceof Array)) {
1254
+ const stepCounts: Object[] = Object.keys(steps);
1255
+ for (let i: number = 0; i < stepCounts.length; i++) {
1256
+ const index: number = parseInt(Object.keys(steps)[i as number], 10);
1257
+ const changedPropsCount: number = Object.keys(steps[index as number]).length;
1258
+ for (let j: number = 0; j < changedPropsCount; j++) {
1259
+ const property: string = Object.keys(steps[index as number])[j as number];
1260
+ if (property === 'status') {
1261
+ if (this.activeStep === index) { this.navigationHandler(index, steps[index as number].status); }
1262
+ else { this.steps[index as number].status = prevSteps[index as number].status; }
1263
+ }
1264
+ else { this.removeItemElements(); this.renderItems(); this.updateStepperStatus(); }
1265
+ if (property === 'label' && (this.steps[index as number].iconCss || this.steps[index as number].text) &&
1266
+ this.stepType.toLowerCase() === 'default') {
1267
+ this.refreshProgressbar();
1268
+ }
1269
+ this.updateStepInteractions();
1270
+ this.checkValidStep();
1271
+ }
1272
+ }
1273
+ } else { this.renderStepperItems(true, true); }
1274
+ }
1275
+
1276
+ private updateDynamicActiveStep(activeStep: number, preActiveStep?: number): void {
1277
+ this.activeStep = (activeStep > this.steps.length - 1 || activeStep < -1) ? preActiveStep : this.activeStep;
1278
+ if (this.activeStep >= 0 && this.stepperItemElements[parseInt(this.activeStep.toString(), 10)].classList.contains(DISABLED)) {
1279
+ this.activeStep = preActiveStep;
1280
+ }
1281
+ if (this.linear) {
1282
+ const linearModeValue: number = preActiveStep - this.activeStep;
1283
+ if (Math.abs(linearModeValue) === 1) { this.navigateToStep(this.activeStep, null, null, true); }
1284
+ }
1285
+ else { this.navigateToStep(this.activeStep, null, this.stepperItemElements[this.activeStep], true); }
1286
+ }
1287
+
1288
+ private updateDynamicCssClass(cssClass: string, prevCssClass: string): void {
1289
+ if (prevCssClass) { removeClass([this.element], prevCssClass.trim().split(' ')); }
1290
+ if (cssClass) { addClass([this.element], cssClass.trim().split(' ')); }
1291
+ if (this.tooltipObj) {
1292
+ this.tooltipObj.setProperties({ cssClass: this.cssClass ? (STEPPERTOOLTIP + ' ' + this.cssClass) : STEPPERTOOLTIP });
1293
+ }
1294
+ }
1295
+
1296
+
1297
+ /**
1298
+ * Called internally if any of the property value changed.
1299
+ *
1300
+ * @param {StepperModel} newProp - Specifies new properties
1301
+ * @param {StepperModel} oldProp - Specifies old properties
1302
+ * @returns {void}
1303
+ * @private
1304
+ */
1305
+ public onPropertyChanged(newProp: StepperModel, oldProp?: StepperModel): void {
1306
+ for (const prop of Object.keys(newProp)) {
1307
+ switch (prop) {
1308
+ case 'steps': {
1309
+ this.updateDynamicSteps(newProp.steps, oldProp.steps);
1310
+ break;
1311
+ }
1312
+ case 'orientation':
1313
+ this.updateOrientaion(this.element);
1314
+ this.renderStepperItems(true);
1315
+ break;
1316
+ case 'activeStep':
1317
+ this.updateDynamicActiveStep(newProp.activeStep, oldProp.activeStep);
1318
+ break;
1319
+ case 'enableRtl':
1320
+ this.element.classList[this.enableRtl ? 'add' : 'remove'](RTL);
1321
+ break;
1322
+ case 'readOnly':
1323
+ this.element.classList[this.readOnly ? 'add' : 'remove'](READONLY);
1324
+ break;
1325
+ case 'cssClass':
1326
+ this.updateDynamicCssClass(newProp.cssClass, oldProp.cssClass);
1327
+ break;
1328
+ case 'labelPosition':
1329
+ this.renderStepperItems(true);
1330
+ break;
1331
+ case 'showTooltip':
1332
+ this.updateTooltip();
1333
+ break;
1334
+ case 'stepType':
1335
+ this.renderStepperItems(true, true);
1336
+ break;
1337
+ case 'template':
1338
+ this.updateTemplateFunction();
1339
+ this.updateContent();
1340
+ break;
1341
+ case 'animation':
1342
+ this.updateAnimation();
1343
+ break;
1344
+ case 'linear':
1345
+ this.updateStepInteractions();
1346
+ break;
1347
+ }
1348
+ }
1349
+ }
1350
+ }