@syncfusion/ej2-navigations 23.2.7 → 24.1.46
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.
- package/CHANGELOG.md +26 -0
- package/README.md +1 -1
- package/dist/ej2-navigations.min.js +2 -2
- package/dist/ej2-navigations.umd.min.js +2 -2
- package/dist/ej2-navigations.umd.min.js.map +1 -1
- package/dist/es6/ej2-navigations.es2015.js +1435 -13
- package/dist/es6/ej2-navigations.es2015.js.map +1 -1
- package/dist/es6/ej2-navigations.es5.js +1492 -22
- package/dist/es6/ej2-navigations.es5.js.map +1 -1
- package/dist/global/ej2-navigations.min.js +2 -2
- package/dist/global/ej2-navigations.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/breadcrumb/breadcrumb.js +6 -1
- package/src/carousel/carousel.js +3 -3
- package/src/common/menu-base.js +25 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/stepper/index.d.ts +3 -0
- package/src/stepper/index.js +2 -0
- package/src/stepper/stepper-model.d.ts +153 -0
- package/src/stepper/stepper.d.ts +339 -0
- package/src/stepper/stepper.js +1163 -0
- package/src/stepper-base/index.d.ts +5 -0
- package/src/stepper-base/index.js +4 -0
- package/src/stepper-base/stepper-base-model.d.ts +121 -0
- package/src/stepper-base/stepper-base.d.ts +184 -0
- package/src/stepper-base/stepper-base.js +221 -0
- package/src/tab/tab.js +0 -1
- package/src/toolbar/toolbar.js +4 -0
- package/src/treeview/treeview.d.ts +1 -0
- package/src/treeview/treeview.js +68 -15
- package/stepper-base.d.ts +4 -0
- package/stepper-base.js +4 -0
- package/stepper.d.ts +4 -0
- package/stepper.js +4 -0
- package/styles/bootstrap-dark.css +755 -1
- package/styles/bootstrap-dark.scss +1 -0
- package/styles/bootstrap.css +755 -1
- package/styles/bootstrap.scss +1 -0
- package/styles/bootstrap4.css +755 -1
- package/styles/bootstrap4.scss +1 -0
- package/styles/bootstrap5-dark.css +762 -8
- package/styles/bootstrap5-dark.scss +1 -0
- package/styles/bootstrap5.css +762 -8
- package/styles/bootstrap5.scss +1 -0
- package/styles/fabric-dark.css +754 -0
- package/styles/fabric-dark.scss +1 -0
- package/styles/fabric.css +754 -0
- package/styles/fabric.scss +1 -0
- package/styles/fluent-dark.css +759 -5
- package/styles/fluent-dark.scss +1 -0
- package/styles/fluent.css +759 -5
- package/styles/fluent.scss +1 -0
- package/styles/highcontrast-light.css +755 -1
- package/styles/highcontrast-light.scss +1 -0
- package/styles/highcontrast.css +755 -1
- package/styles/highcontrast.scss +1 -0
- package/styles/material-dark.css +755 -1
- package/styles/material-dark.scss +1 -0
- package/styles/material.css +755 -1
- package/styles/material.scss +1 -0
- package/styles/material3-dark.css +754 -0
- package/styles/material3-dark.scss +1 -0
- package/styles/material3.css +754 -0
- package/styles/material3.scss +1 -0
- package/styles/pager/_bootstrap-dark-definition.scss +16 -0
- package/styles/pager/_bootstrap-definition.scss +16 -0
- package/styles/pager/_bootstrap4-definition.scss +16 -0
- package/styles/pager/_bootstrap5-definition.scss +16 -0
- package/styles/pager/_fabric-dark-definition.scss +16 -0
- package/styles/pager/_fabric-definition.scss +16 -0
- package/styles/pager/_fluent-definition.scss +16 -0
- package/styles/pager/_fusionnew-definition.scss +16 -0
- package/styles/pager/_highcontrast-definition.scss +16 -0
- package/styles/pager/_highcontrast-light-definition.scss +16 -0
- package/styles/pager/_layout.scss +114 -0
- package/styles/pager/_material-dark-definition.scss +16 -0
- package/styles/pager/_material-definition.scss +16 -0
- package/styles/pager/_material3-definition.scss +16 -0
- package/styles/pager/_tailwind-definition.scss +16 -0
- package/styles/pager/bootstrap-dark.css +107 -0
- package/styles/pager/bootstrap.css +107 -0
- package/styles/pager/bootstrap4.css +107 -0
- package/styles/pager/bootstrap5-dark.css +107 -0
- package/styles/pager/bootstrap5.css +107 -0
- package/styles/pager/fabric-dark.css +107 -0
- package/styles/pager/fabric.css +107 -0
- package/styles/pager/fluent-dark.css +107 -0
- package/styles/pager/fluent.css +107 -0
- package/styles/pager/highcontrast-light.css +107 -0
- package/styles/pager/highcontrast.css +107 -0
- package/styles/pager/material-dark.css +107 -0
- package/styles/pager/material.css +107 -0
- package/styles/pager/material3-dark.css +107 -0
- package/styles/pager/material3.css +107 -0
- package/styles/pager/tailwind-dark.css +107 -0
- package/styles/pager/tailwind.css +107 -0
- package/styles/stepper/_all.scss +2 -0
- package/styles/stepper/_bootstrap-dark-definition.scss +79 -0
- package/styles/stepper/_bootstrap-definition.scss +79 -0
- package/styles/stepper/_bootstrap4-definition.scss +79 -0
- package/styles/stepper/_bootstrap5-dark-definition.scss +1 -0
- package/styles/stepper/_bootstrap5-definition.scss +80 -0
- package/styles/stepper/_fabric-dark-definition.scss +79 -0
- package/styles/stepper/_fabric-definition.scss +79 -0
- package/styles/stepper/_fluent-dark-definition.scss +1 -0
- package/styles/stepper/_fluent-definition.scss +79 -0
- package/styles/stepper/_fusionnew-definition.scss +79 -0
- package/styles/stepper/_highcontrast-definition.scss +79 -0
- package/styles/stepper/_highcontrast-light-definition.scss +79 -0
- package/styles/stepper/_layout.scss +564 -0
- package/styles/stepper/_material-dark-definition.scss +79 -0
- package/styles/stepper/_material-definition.scss +79 -0
- package/styles/stepper/_material3-dark-definition.scss +1 -0
- package/styles/stepper/_material3-definition.scss +79 -0
- package/styles/stepper/_tailwind-dark-definition.scss +1 -0
- package/styles/stepper/_tailwind-definition.scss +79 -0
- package/styles/stepper/_theme.scss +229 -0
- package/styles/stepper/bootstrap-dark.css +646 -0
- package/styles/stepper/bootstrap-dark.scss +5 -0
- package/styles/stepper/bootstrap.css +646 -0
- package/styles/stepper/bootstrap.scss +5 -0
- package/styles/stepper/bootstrap4.css +646 -0
- package/styles/stepper/bootstrap4.scss +5 -0
- package/styles/stepper/bootstrap5-dark.css +646 -0
- package/styles/stepper/bootstrap5-dark.scss +5 -0
- package/styles/stepper/bootstrap5.css +646 -0
- package/styles/stepper/bootstrap5.scss +5 -0
- package/styles/stepper/fabric-dark.css +646 -0
- package/styles/stepper/fabric-dark.scss +5 -0
- package/styles/stepper/fabric.css +646 -0
- package/styles/stepper/fabric.scss +5 -0
- package/styles/stepper/fluent-dark.css +646 -0
- package/styles/stepper/fluent-dark.scss +5 -0
- package/styles/stepper/fluent.css +646 -0
- package/styles/stepper/fluent.scss +5 -0
- package/styles/stepper/highcontrast-light.css +646 -0
- package/styles/stepper/highcontrast-light.scss +5 -0
- package/styles/stepper/highcontrast.css +646 -0
- package/styles/stepper/highcontrast.scss +5 -0
- package/styles/stepper/icons/_bootstrap-dark.scss +5 -0
- package/styles/stepper/icons/_bootstrap.scss +5 -0
- package/styles/stepper/icons/_bootstrap4.scss +5 -0
- package/styles/stepper/icons/_bootstrap5-dark.scss +1 -0
- package/styles/stepper/icons/_bootstrap5.scss +5 -0
- package/styles/stepper/icons/_fabric-dark.scss +5 -0
- package/styles/stepper/icons/_fabric.scss +5 -0
- package/styles/stepper/icons/_fluent-dark.scss +1 -0
- package/styles/stepper/icons/_fluent.scss +5 -0
- package/styles/stepper/icons/_fusionnew.scss +5 -0
- package/styles/stepper/icons/_highcontrast-light.scss +5 -0
- package/styles/stepper/icons/_highcontrast.scss +5 -0
- package/styles/stepper/icons/_material-dark.scss +5 -0
- package/styles/stepper/icons/_material.scss +5 -0
- package/styles/stepper/icons/_material3-dark.scss +1 -0
- package/styles/stepper/icons/_material3.scss +5 -0
- package/styles/stepper/icons/_tailwind-dark.scss +1 -0
- package/styles/stepper/icons/_tailwind.scss +5 -0
- package/styles/stepper/material-dark.css +646 -0
- package/styles/stepper/material-dark.scss +5 -0
- package/styles/stepper/material.css +646 -0
- package/styles/stepper/material.scss +5 -0
- package/styles/stepper/material3-dark.css +701 -0
- package/styles/stepper/material3-dark.scss +6 -0
- package/styles/stepper/material3.css +757 -0
- package/styles/stepper/material3.scss +6 -0
- package/styles/stepper/tailwind-dark.css +646 -0
- package/styles/stepper/tailwind-dark.scss +5 -0
- package/styles/stepper/tailwind.css +646 -0
- package/styles/stepper/tailwind.scss +5 -0
- package/styles/tab/_bootstrap-dark-definition.scss +1 -1
- package/styles/tab/_bootstrap-definition.scss +1 -1
- package/styles/tab/_bootstrap4-definition.scss +1 -1
- package/styles/tab/_bootstrap5-definition.scss +3 -2
- package/styles/tab/_fluent-definition.scss +1 -1
- package/styles/tab/_fusionnew-definition.scss +1 -1
- package/styles/tab/_highcontrast-definition.scss +1 -1
- package/styles/tab/_highcontrast-light-definition.scss +1 -1
- package/styles/tab/_material-dark-definition.scss +1 -1
- package/styles/tab/_material-definition.scss +1 -1
- package/styles/tab/_theme.scss +6 -0
- package/styles/tab/bootstrap-dark.css +1 -1
- package/styles/tab/bootstrap.css +1 -1
- package/styles/tab/bootstrap4.css +1 -1
- package/styles/tab/bootstrap5-dark.css +2 -2
- package/styles/tab/bootstrap5.css +2 -2
- package/styles/tab/fluent-dark.css +1 -1
- package/styles/tab/fluent.css +1 -1
- package/styles/tab/highcontrast-light.css +1 -1
- package/styles/tab/highcontrast.css +1 -1
- package/styles/tab/material-dark.css +1 -1
- package/styles/tab/material.css +1 -1
- package/styles/tailwind-dark.css +758 -4
- package/styles/tailwind-dark.scss +1 -0
- package/styles/tailwind.css +758 -4
- package/styles/tailwind.scss +1 -0
- package/styles/toolbar/_bootstrap5-definition.scss +3 -3
- package/styles/toolbar/_fluent-definition.scss +2 -2
- package/styles/toolbar/_tailwind-definition.scss +2 -2
- package/styles/toolbar/bootstrap5-dark.css +6 -6
- package/styles/toolbar/bootstrap5.css +6 -6
- package/styles/toolbar/fluent-dark.css +4 -4
- package/styles/toolbar/fluent.css +4 -4
- package/styles/toolbar/tailwind-dark.css +4 -4
- package/styles/toolbar/tailwind.css +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Animation, Browser, ChildProperty, Collection, Complex, Component, Draggable, Droppable, Event, EventHandler, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, animationMode, append, attributes, classList, closest, compile, createElement, detach, extend, formatUnit, getElement, getInstance, getRandomId, getUniqueID, getValue, initializeCSPTemplate, isBlazor, isNullOrUndefined, isRippleEnabled, isUndefined, isVisible, matches, merge, remove, removeClass, rippleEffect, select, selectAll, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
|
|
2
2
|
import { ListBase } from '@syncfusion/ej2-lists';
|
|
3
|
-
import { Popup, calculatePosition, createSpinner, fit, getScrollableParent, getZindexPartial, hideSpinner, isCollide, showSpinner } from '@syncfusion/ej2-popups';
|
|
3
|
+
import { Popup, Tooltip, calculatePosition, createSpinner, fit, getScrollableParent, getZindexPartial, hideSpinner, isCollide, showSpinner } from '@syncfusion/ej2-popups';
|
|
4
4
|
import { Button, createCheckBox, rippleMouseHandler } from '@syncfusion/ej2-buttons';
|
|
5
5
|
import { DataManager, Query } from '@syncfusion/ej2-data';
|
|
6
6
|
import { Input } from '@syncfusion/ej2-inputs';
|
|
@@ -1262,6 +1262,10 @@ let MenuBase = class MenuBase extends Component {
|
|
|
1262
1262
|
}
|
|
1263
1263
|
}
|
|
1264
1264
|
}
|
|
1265
|
+
else {
|
|
1266
|
+
this.element.parentElement.setAttribute('role', 'dialog');
|
|
1267
|
+
this.element.parentElement.setAttribute('aria-label', 'context menu');
|
|
1268
|
+
}
|
|
1265
1269
|
}
|
|
1266
1270
|
wireEvents() {
|
|
1267
1271
|
const wrapper = this.getWrapper();
|
|
@@ -1498,7 +1502,25 @@ let MenuBase = class MenuBase extends Component {
|
|
|
1498
1502
|
fli.classList.add(SELECTED);
|
|
1499
1503
|
eventArgs = { element: fli, item: item, event: e };
|
|
1500
1504
|
this.trigger('select', eventArgs);
|
|
1505
|
+
const aEle = fli.querySelector('.e-menu-url');
|
|
1506
|
+
if (item.url && aEle) {
|
|
1507
|
+
switch (aEle.getAttribute('target')) {
|
|
1508
|
+
case '_blank':
|
|
1509
|
+
window.open(item.url, '_blank');
|
|
1510
|
+
break;
|
|
1511
|
+
case '_parent':
|
|
1512
|
+
window.parent.location.href = item.url;
|
|
1513
|
+
break;
|
|
1514
|
+
default:
|
|
1515
|
+
window.location.href = item.url;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1501
1518
|
this.closeMenu(null, e);
|
|
1519
|
+
const sli = this.getLIByClass(this.getUlByNavIdx(), SELECTED);
|
|
1520
|
+
if (sli) {
|
|
1521
|
+
sli.classList.add(FOCUSED);
|
|
1522
|
+
sli.focus();
|
|
1523
|
+
}
|
|
1502
1524
|
}
|
|
1503
1525
|
}
|
|
1504
1526
|
}
|
|
@@ -1593,6 +1615,9 @@ let MenuBase = class MenuBase extends Component {
|
|
|
1593
1615
|
closeArgs = { element: ul, parentItem: item, items: items };
|
|
1594
1616
|
this.trigger('onClose', closeArgs);
|
|
1595
1617
|
this.navIdx.pop();
|
|
1618
|
+
if (this.navIdx.length === 0) {
|
|
1619
|
+
this.showSubMenu = false;
|
|
1620
|
+
}
|
|
1596
1621
|
if (!this.isMenu) {
|
|
1597
1622
|
EventHandler.remove(ul, 'keydown', this.keyHandler);
|
|
1598
1623
|
if (this.keyType === 'right') {
|
|
@@ -4044,6 +4069,10 @@ let Toolbar = class Toolbar extends Component {
|
|
|
4044
4069
|
if (this.cssClass) {
|
|
4045
4070
|
addClass([innerItems[0]], this.cssClass.split(' '));
|
|
4046
4071
|
}
|
|
4072
|
+
const scrollEle = this.scrollModule.element.querySelector('.' + CLS_HSCROLLBAR$1 + ', .' + 'e-vscroll-bar');
|
|
4073
|
+
if (scrollEle) {
|
|
4074
|
+
scrollEle.removeAttribute('tabindex');
|
|
4075
|
+
}
|
|
4047
4076
|
this.remove(this.scrollModule.element, CLS_TBARPOS);
|
|
4048
4077
|
setStyleAttribute(this.element, { overflow: 'hidden' });
|
|
4049
4078
|
}
|
|
@@ -8648,7 +8677,6 @@ let Tab = class Tab extends Component {
|
|
|
8648
8677
|
const scrCnt = select('.' + this.scrCntClass, this.tbItems);
|
|
8649
8678
|
if (!this.isVertical() && !isNullOrUndefined(scrCnt)) {
|
|
8650
8679
|
const scrBar = select('.e-hscroll-bar', this.tbItems);
|
|
8651
|
-
scrBar.removeAttribute('tabindex');
|
|
8652
8680
|
const scrStart = scrBar.scrollLeft;
|
|
8653
8681
|
const scrEnd = scrStart + scrBar.offsetWidth;
|
|
8654
8682
|
const eleStart = target.offsetLeft;
|
|
@@ -10035,9 +10063,11 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
10035
10063
|
setDisabledMode() {
|
|
10036
10064
|
if (this.disabled) {
|
|
10037
10065
|
this.element.classList.add(DISABLED$1);
|
|
10066
|
+
this.element.setAttribute('aria-disabled', 'true');
|
|
10038
10067
|
}
|
|
10039
10068
|
else {
|
|
10040
10069
|
this.element.classList.remove(DISABLED$1);
|
|
10070
|
+
this.element.setAttribute('aria-disabled', 'false');
|
|
10041
10071
|
}
|
|
10042
10072
|
}
|
|
10043
10073
|
setEnableRtl() {
|
|
@@ -10060,12 +10090,11 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
10060
10090
|
(isEnabled ? addClass : removeClass)([this.element], FULLROWWRAP);
|
|
10061
10091
|
}
|
|
10062
10092
|
setMultiSelect(isEnabled) {
|
|
10063
|
-
const firstUl = select('.' + PARENTITEM, this.element);
|
|
10064
10093
|
if (isEnabled) {
|
|
10065
|
-
|
|
10094
|
+
this.element.setAttribute('aria-multiselectable', 'true');
|
|
10066
10095
|
}
|
|
10067
10096
|
else {
|
|
10068
|
-
|
|
10097
|
+
this.element.setAttribute('aria-multiselectable', 'false');
|
|
10069
10098
|
}
|
|
10070
10099
|
}
|
|
10071
10100
|
// eslint-disable-next-line
|
|
@@ -10192,6 +10221,14 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
10192
10221
|
this.rootData = this.treeData;
|
|
10193
10222
|
}
|
|
10194
10223
|
}
|
|
10224
|
+
isChildObject() {
|
|
10225
|
+
if (typeof this.fields.child === 'object') {
|
|
10226
|
+
return true;
|
|
10227
|
+
}
|
|
10228
|
+
else {
|
|
10229
|
+
return false;
|
|
10230
|
+
}
|
|
10231
|
+
}
|
|
10195
10232
|
renderItems(isSorted) {
|
|
10196
10233
|
/* eslint-disable */
|
|
10197
10234
|
this.listBaseOption.ariaAttributes.level = 1;
|
|
@@ -10430,7 +10467,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
10430
10467
|
if (this.showCheckBox) {
|
|
10431
10468
|
let checkboxEle = createCheckBox(this.createElement, true, { cssClass: this.touchClass });
|
|
10432
10469
|
checkboxEle.setAttribute('role', 'checkbox');
|
|
10433
|
-
checkboxEle.setAttribute('aria-label',
|
|
10470
|
+
checkboxEle.setAttribute('aria-label', e.text);
|
|
10434
10471
|
let icon = select('div.' + ICON, e.item);
|
|
10435
10472
|
let id = e.item.getAttribute('data-uid');
|
|
10436
10473
|
e.item.childNodes[0].insertBefore(checkboxEle, e.item.childNodes[0].childNodes[isNullOrUndefined(icon) ? 0 : 1]);
|
|
@@ -10511,6 +10548,9 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
10511
10548
|
if ((typeof mapper.child === 'string') && !isNullOrUndefined(getValue(mapper.child, ds[i]))) {
|
|
10512
10549
|
return 2;
|
|
10513
10550
|
}
|
|
10551
|
+
if (this.isChildObject()) {
|
|
10552
|
+
return 2;
|
|
10553
|
+
}
|
|
10514
10554
|
if (!isNullOrUndefined(getValue(mapper.parentID, ds[i])) || !isNullOrUndefined(getValue(mapper.hasChildren, ds[i]))) {
|
|
10515
10555
|
return 1;
|
|
10516
10556
|
}
|
|
@@ -11451,7 +11491,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
11451
11491
|
}
|
|
11452
11492
|
}
|
|
11453
11493
|
else {
|
|
11454
|
-
childItems = this.getChildNodes(this.treeData, parentLi.getAttribute('data-uid'));
|
|
11494
|
+
childItems = this.getChildNodes(this.treeData, parentLi.getAttribute('data-uid'), false, parseFloat(parentLi.getAttribute('aria-level')) + 1);
|
|
11455
11495
|
this.currentLoadData = this.getSortedData(childItems);
|
|
11456
11496
|
if (isNullOrUndefined(childItems) || childItems.length === 0) {
|
|
11457
11497
|
detach(eicon);
|
|
@@ -11553,7 +11593,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
11553
11593
|
getChildMapper(mapper) {
|
|
11554
11594
|
return (typeof mapper.child === 'string' || isNullOrUndefined(mapper.child)) ? mapper : mapper.child;
|
|
11555
11595
|
}
|
|
11556
|
-
getChildNodes(obj, parentId, isRoot = false) {
|
|
11596
|
+
getChildNodes(obj, parentId, isRoot = false, level) {
|
|
11557
11597
|
let childNodes;
|
|
11558
11598
|
if (isNullOrUndefined(obj)) {
|
|
11559
11599
|
return childNodes;
|
|
@@ -11583,6 +11623,39 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
11583
11623
|
}
|
|
11584
11624
|
}
|
|
11585
11625
|
}
|
|
11626
|
+
else if (this.isChildObject()) {
|
|
11627
|
+
let tempField = !isNullOrUndefined(level) ? this.fields : this.fields.child;
|
|
11628
|
+
let i = 1;
|
|
11629
|
+
while (i < level) {
|
|
11630
|
+
if (!isNullOrUndefined(tempField.child)) {
|
|
11631
|
+
tempField = tempField.child;
|
|
11632
|
+
}
|
|
11633
|
+
else {
|
|
11634
|
+
break;
|
|
11635
|
+
}
|
|
11636
|
+
i++;
|
|
11637
|
+
}
|
|
11638
|
+
this.updateListProp(tempField);
|
|
11639
|
+
let index = obj.findIndex((data) => getValue(this.fields.id, data) && getValue(this.fields.id, data).toString() === parentId);
|
|
11640
|
+
if (index !== -1) {
|
|
11641
|
+
return getValue('child', obj[index]);
|
|
11642
|
+
}
|
|
11643
|
+
if (index === -1) {
|
|
11644
|
+
for (let i = 0, objlen = obj.length; i < objlen; i++) {
|
|
11645
|
+
let tempArray = getValue('child', obj[i]);
|
|
11646
|
+
let childIndex = !isNullOrUndefined(tempArray) ? tempArray.findIndex((data) => getValue(this.fields.child.id, data) && getValue(this.fields.child.id, data).toString() === parentId) : -1;
|
|
11647
|
+
if (childIndex !== -1) {
|
|
11648
|
+
return getValue('child', tempArray[childIndex]);
|
|
11649
|
+
}
|
|
11650
|
+
else if (!isNullOrUndefined(tempArray)) {
|
|
11651
|
+
childNodes = this.getChildNodes(tempArray, parentId, false, level);
|
|
11652
|
+
if (childNodes !== undefined) {
|
|
11653
|
+
break;
|
|
11654
|
+
}
|
|
11655
|
+
}
|
|
11656
|
+
}
|
|
11657
|
+
}
|
|
11658
|
+
}
|
|
11586
11659
|
}
|
|
11587
11660
|
return childNodes;
|
|
11588
11661
|
}
|
|
@@ -12614,6 +12687,14 @@ let TreeView = TreeView_1 = class TreeView extends Component {
|
|
|
12614
12687
|
break;
|
|
12615
12688
|
}
|
|
12616
12689
|
}
|
|
12690
|
+
else if (this.isChildObject()) {
|
|
12691
|
+
let children = 'child';
|
|
12692
|
+
let childData = getValue(children, obj[i]);
|
|
12693
|
+
newList = this.getChildNodeObject(childData, this.getChildMapper(mapper), id);
|
|
12694
|
+
if (newList !== undefined) {
|
|
12695
|
+
break;
|
|
12696
|
+
}
|
|
12697
|
+
}
|
|
12617
12698
|
}
|
|
12618
12699
|
return newList;
|
|
12619
12700
|
}
|
|
@@ -15691,7 +15772,9 @@ let Breadcrumb = class Breadcrumb extends Component {
|
|
|
15691
15772
|
}
|
|
15692
15773
|
initialize() {
|
|
15693
15774
|
this._maxItems = this.maxItems;
|
|
15694
|
-
this.element.
|
|
15775
|
+
if (isNullOrUndefined(this.element.getAttribute('aria-label'))) {
|
|
15776
|
+
this.element.setAttribute('aria-label', 'breadcrumb');
|
|
15777
|
+
}
|
|
15695
15778
|
if (this.cssClass) {
|
|
15696
15779
|
addClass([this.element], this.cssClass.replace(/\s+/g, ' ').trim().split(' '));
|
|
15697
15780
|
}
|
|
@@ -16018,6 +16101,9 @@ let Breadcrumb = class Breadcrumb extends Component {
|
|
|
16018
16101
|
}
|
|
16019
16102
|
beforeItemRenderChanges(prevItem, currItem, elem, isRightIcon) {
|
|
16020
16103
|
const wrapElem = elem.querySelector('.e-anchor-wrap');
|
|
16104
|
+
if (wrapElem) {
|
|
16105
|
+
wrapElem.parentElement.setAttribute('aria-label', 'home');
|
|
16106
|
+
}
|
|
16021
16107
|
if (currItem.text !== prevItem.text) {
|
|
16022
16108
|
wrapElem.childNodes.forEach((child) => {
|
|
16023
16109
|
if (child.nodeType === Node.TEXT_NODE) {
|
|
@@ -16642,7 +16728,7 @@ let Carousel = class Carousel extends Component {
|
|
|
16642
16728
|
}
|
|
16643
16729
|
addClass([this.element], carouselClasses);
|
|
16644
16730
|
setStyleAttribute(this.element, { 'width': formatUnit(this.width), 'height': formatUnit(this.height) });
|
|
16645
|
-
attributes(this.element, { '
|
|
16731
|
+
attributes(this.element, { 'role': 'group', 'aria-roledescription': 'carousel', 'aria-label': this.localeObj.getConstant('slideShow') });
|
|
16646
16732
|
if (!isNullOrUndefined(this.htmlAttributes)) {
|
|
16647
16733
|
this.setHtmlAttributes(this.htmlAttributes, this.element);
|
|
16648
16734
|
}
|
|
@@ -16650,7 +16736,7 @@ let Carousel = class Carousel extends Component {
|
|
|
16650
16736
|
renderSlides() {
|
|
16651
16737
|
let slideContainer = this.element.querySelector('.' + CLS_SLIDE_CONTAINER);
|
|
16652
16738
|
if (!slideContainer) {
|
|
16653
|
-
slideContainer = this.createElement('div', { className: CLS_SLIDE_CONTAINER });
|
|
16739
|
+
slideContainer = this.createElement('div', { className: CLS_SLIDE_CONTAINER, attrs: { 'tabindex': '0', 'role': 'tabpanel' } });
|
|
16654
16740
|
this.element.appendChild(slideContainer);
|
|
16655
16741
|
}
|
|
16656
16742
|
this.itemsContainer = this.createElement('div', { className: CLS_ITEMS$2, attrs: { 'aria-live': this.autoPlay ? 'off' : 'polite' } });
|
|
@@ -17545,7 +17631,7 @@ let Carousel = class Carousel extends Component {
|
|
|
17545
17631
|
this.unWireEvents();
|
|
17546
17632
|
[].slice.call(this.element.children).forEach((ele) => { this.element.removeChild(ele); });
|
|
17547
17633
|
removeClass([this.element], [CLS_CAROUSEL, this.cssClass, CLS_RTL$5, CLS_SWIPE]);
|
|
17548
|
-
['
|
|
17634
|
+
['role', 'style'].forEach((attr) => { this.element.removeAttribute(attr); });
|
|
17549
17635
|
this.itemsContainer = null;
|
|
17550
17636
|
super.destroy();
|
|
17551
17637
|
}
|
|
@@ -17837,9 +17923,1345 @@ AppBar = __decorate$12([
|
|
|
17837
17923
|
|
|
17838
17924
|
/** AppBar export modules */
|
|
17839
17925
|
|
|
17926
|
+
var __decorate$13 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
17927
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17928
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
17929
|
+
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;
|
|
17930
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17931
|
+
};
|
|
17932
|
+
const PROGRESSVALUE = '--progress-value';
|
|
17933
|
+
/**
|
|
17934
|
+
* Defines the status of the step.
|
|
17935
|
+
*/
|
|
17936
|
+
var StepStatus;
|
|
17937
|
+
(function (StepStatus) {
|
|
17938
|
+
/**
|
|
17939
|
+
* Shows the status of the step is not started.
|
|
17940
|
+
*/
|
|
17941
|
+
StepStatus["NotStarted"] = "NotStarted";
|
|
17942
|
+
/**
|
|
17943
|
+
* Shows the step is in progress.
|
|
17944
|
+
*/
|
|
17945
|
+
StepStatus["InProgress"] = "InProgress";
|
|
17946
|
+
/**
|
|
17947
|
+
* Shows the status of the step is completed.
|
|
17948
|
+
*/
|
|
17949
|
+
StepStatus["Completed"] = "Completed";
|
|
17950
|
+
})(StepStatus || (StepStatus = {}));
|
|
17951
|
+
/**
|
|
17952
|
+
* Specifies the steps of the Stepper.
|
|
17953
|
+
*/
|
|
17954
|
+
class Step extends ChildProperty {
|
|
17955
|
+
}
|
|
17956
|
+
__decorate$13([
|
|
17957
|
+
Property('')
|
|
17958
|
+
], Step.prototype, "cssClass", void 0);
|
|
17959
|
+
__decorate$13([
|
|
17960
|
+
Property(false)
|
|
17961
|
+
], Step.prototype, "disabled", void 0);
|
|
17962
|
+
__decorate$13([
|
|
17963
|
+
Property('')
|
|
17964
|
+
], Step.prototype, "iconCss", void 0);
|
|
17965
|
+
__decorate$13([
|
|
17966
|
+
Property(null)
|
|
17967
|
+
], Step.prototype, "isValid", void 0);
|
|
17968
|
+
__decorate$13([
|
|
17969
|
+
Property('')
|
|
17970
|
+
], Step.prototype, "label", void 0);
|
|
17971
|
+
__decorate$13([
|
|
17972
|
+
Property(false)
|
|
17973
|
+
], Step.prototype, "optional", void 0);
|
|
17974
|
+
__decorate$13([
|
|
17975
|
+
Property(StepStatus.NotStarted)
|
|
17976
|
+
], Step.prototype, "status", void 0);
|
|
17977
|
+
__decorate$13([
|
|
17978
|
+
Property('')
|
|
17979
|
+
], Step.prototype, "text", void 0);
|
|
17980
|
+
/**
|
|
17981
|
+
* Defines the orientation type of the Stepper.
|
|
17982
|
+
*/
|
|
17983
|
+
var StepperOrientation;
|
|
17984
|
+
(function (StepperOrientation) {
|
|
17985
|
+
/**
|
|
17986
|
+
* Steps are displayed horizontally.
|
|
17987
|
+
*/
|
|
17988
|
+
StepperOrientation["Horizontal"] = "Horizontal";
|
|
17989
|
+
/**
|
|
17990
|
+
* Steps are displayed vertically.
|
|
17991
|
+
*/
|
|
17992
|
+
StepperOrientation["Vertical"] = "Vertical";
|
|
17993
|
+
})(StepperOrientation || (StepperOrientation = {}));
|
|
17994
|
+
/**
|
|
17995
|
+
* StepperBase component act as base class to the stepper component.
|
|
17996
|
+
*/
|
|
17997
|
+
let StepperBase = class StepperBase extends Component {
|
|
17998
|
+
/**
|
|
17999
|
+
* * Constructor for Base class
|
|
18000
|
+
*
|
|
18001
|
+
* @param {StepperBaseModel} options - Specifies the Base model.
|
|
18002
|
+
* @param {string | HTMLElement} element - Specifies the element to render as component.
|
|
18003
|
+
* @private
|
|
18004
|
+
*/
|
|
18005
|
+
constructor(options, element) {
|
|
18006
|
+
super(options, element);
|
|
18007
|
+
}
|
|
18008
|
+
/**
|
|
18009
|
+
* This method is abstract member of the Component<HTMLElement>.
|
|
18010
|
+
*
|
|
18011
|
+
* @private
|
|
18012
|
+
* @returns {void}
|
|
18013
|
+
*/
|
|
18014
|
+
preRender() {
|
|
18015
|
+
}
|
|
18016
|
+
/**
|
|
18017
|
+
* This method is abstract member of the Component<HTMLElement>.
|
|
18018
|
+
*
|
|
18019
|
+
* @private
|
|
18020
|
+
* @returns {string}
|
|
18021
|
+
*/
|
|
18022
|
+
getModuleName() {
|
|
18023
|
+
return 'stepperBase';
|
|
18024
|
+
}
|
|
18025
|
+
/**
|
|
18026
|
+
* This method is abstract member of the Component<HTMLElement>.
|
|
18027
|
+
*
|
|
18028
|
+
* @private
|
|
18029
|
+
* @returns {string}
|
|
18030
|
+
*/
|
|
18031
|
+
getPersistData() {
|
|
18032
|
+
return this.addOnPersist([]);
|
|
18033
|
+
}
|
|
18034
|
+
/**
|
|
18035
|
+
* This method is abstract member of the Component<HTMLElement>.
|
|
18036
|
+
*
|
|
18037
|
+
* @private
|
|
18038
|
+
* @returns {void}
|
|
18039
|
+
*/
|
|
18040
|
+
render() {
|
|
18041
|
+
}
|
|
18042
|
+
updateOrientaion(wrapper) {
|
|
18043
|
+
if (wrapper.classList.contains('e-horizontal') || wrapper.classList.contains('e-vertical')) {
|
|
18044
|
+
wrapper.classList.contains('e-horizontal') ? wrapper.classList.remove('e-horizontal') : wrapper.classList.remove('e-vertical');
|
|
18045
|
+
}
|
|
18046
|
+
wrapper.classList.add('e-' + this.orientation.toLocaleLowerCase());
|
|
18047
|
+
}
|
|
18048
|
+
renderProgressBar(wrapper) {
|
|
18049
|
+
this.progressStep = this.createElement('div', { className: 'e-stepper-progressbar' });
|
|
18050
|
+
this.progressbar = this.createElement('div', { className: 'e-progressbar-value' });
|
|
18051
|
+
this.progressStep.appendChild(this.progressbar);
|
|
18052
|
+
wrapper.prepend(this.progressStep);
|
|
18053
|
+
this.progressbar.style.setProperty(PROGRESSVALUE, (0) + '%');
|
|
18054
|
+
const beforeLabel = (wrapper.querySelector('li').querySelector('.e-step-label-container'));
|
|
18055
|
+
if (wrapper.classList.contains('e-vertical')) {
|
|
18056
|
+
if (wrapper.classList.contains('e-label-bottom') || wrapper.classList.contains('e-label-top')) {
|
|
18057
|
+
const stepsContainer = (wrapper.querySelector('.e-stepper-steps'));
|
|
18058
|
+
this.progressStep.style.setProperty('--progress-position', (stepsContainer.offsetWidth / 2) + 'px');
|
|
18059
|
+
}
|
|
18060
|
+
else {
|
|
18061
|
+
this.progressStep.style.setProperty('--progress-position', ((this.progressBarPosition / 2) - 1) + 'px');
|
|
18062
|
+
}
|
|
18063
|
+
}
|
|
18064
|
+
if (beforeLabel && (beforeLabel.classList.contains('e-label-before'))) {
|
|
18065
|
+
this.progressStep.style.setProperty('--progress-position', (((this.progressBarPosition) - 1)) + 5 + 'px');
|
|
18066
|
+
}
|
|
18067
|
+
if (wrapper.classList.contains('e-horizontal')) {
|
|
18068
|
+
this.setProgressPosition(wrapper);
|
|
18069
|
+
}
|
|
18070
|
+
}
|
|
18071
|
+
setProgressPosition(wrapper, isResize) {
|
|
18072
|
+
const stepItemContainer = (wrapper.querySelector('.e-step-container'));
|
|
18073
|
+
const stepItemEle = stepItemContainer.firstElementChild;
|
|
18074
|
+
if (isResize != true) {
|
|
18075
|
+
let topPos = 0;
|
|
18076
|
+
if (wrapper.classList.contains('e-label-before')) {
|
|
18077
|
+
topPos = (stepItemContainer.offsetParent.offsetHeight - (stepItemEle.offsetHeight / 2) - 1);
|
|
18078
|
+
}
|
|
18079
|
+
else {
|
|
18080
|
+
topPos = (stepItemEle.offsetHeight / 2);
|
|
18081
|
+
}
|
|
18082
|
+
this.progressStep.style.setProperty('--progress-top-position', topPos + 'px');
|
|
18083
|
+
}
|
|
18084
|
+
const lastEle = wrapper.querySelector('.e-stepper-steps').lastChild.firstChild;
|
|
18085
|
+
if (wrapper.classList.contains('e-rtl')) {
|
|
18086
|
+
const leftPost = ((stepItemEle.offsetLeft + stepItemEle.offsetWidth) - wrapper.querySelector('.e-stepper-steps').offsetWidth);
|
|
18087
|
+
this.progressStep.style.setProperty('--progress-left-position', Math.abs(leftPost) + 'px');
|
|
18088
|
+
this.progressStep.style.setProperty('--progress-bar-width', Math.abs(lastEle.offsetLeft - stepItemEle.offsetLeft) + 'px');
|
|
18089
|
+
}
|
|
18090
|
+
else {
|
|
18091
|
+
this.progressStep.style.setProperty('--progress-left-position', (stepItemEle.offsetLeft + 1) + 'px');
|
|
18092
|
+
this.progressStep.style.setProperty('--progress-bar-width', ((lastEle.offsetWidth + lastEle.offsetLeft - 2) - (stepItemEle.offsetLeft + 2)) + 'px');
|
|
18093
|
+
}
|
|
18094
|
+
}
|
|
18095
|
+
/**
|
|
18096
|
+
* This method is abstract member of the Component<HTMLElement>.
|
|
18097
|
+
*
|
|
18098
|
+
* @param newProp
|
|
18099
|
+
* @param oldProp
|
|
18100
|
+
* @private
|
|
18101
|
+
* @returns {void}
|
|
18102
|
+
*/
|
|
18103
|
+
onPropertyChanged(newProp, oldProp) {
|
|
18104
|
+
}
|
|
18105
|
+
};
|
|
18106
|
+
__decorate$13([
|
|
18107
|
+
Collection([], Step)
|
|
18108
|
+
], StepperBase.prototype, "steps", void 0);
|
|
18109
|
+
__decorate$13([
|
|
18110
|
+
Property('')
|
|
18111
|
+
], StepperBase.prototype, "cssClass", void 0);
|
|
18112
|
+
__decorate$13([
|
|
18113
|
+
Property(false)
|
|
18114
|
+
], StepperBase.prototype, "readOnly", void 0);
|
|
18115
|
+
__decorate$13([
|
|
18116
|
+
Property(StepperOrientation.Horizontal)
|
|
18117
|
+
], StepperBase.prototype, "orientation", void 0);
|
|
18118
|
+
__decorate$13([
|
|
18119
|
+
Event()
|
|
18120
|
+
], StepperBase.prototype, "created", void 0);
|
|
18121
|
+
StepperBase = __decorate$13([
|
|
18122
|
+
NotifyPropertyChanges
|
|
18123
|
+
], StepperBase);
|
|
18124
|
+
|
|
18125
|
+
/**
|
|
18126
|
+
* export all modules from current location
|
|
18127
|
+
*/
|
|
18128
|
+
|
|
18129
|
+
var __decorate$14 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
18130
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18131
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
18132
|
+
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;
|
|
18133
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18134
|
+
};
|
|
18135
|
+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
18136
|
+
///<reference path='../stepper-base/stepper-base-model.d.ts'/>
|
|
18137
|
+
const ITEMCONTAINER = 'e-step-container';
|
|
18138
|
+
const ITEMLIST = 'e-stepper-steps';
|
|
18139
|
+
const ICONCSS = 'e-indicator';
|
|
18140
|
+
const TEXTCSS = 'e-step-text-container';
|
|
18141
|
+
const STEPLABEL = 'e-step-label-container';
|
|
18142
|
+
const OPTIONAL = 'e-step-label-optional';
|
|
18143
|
+
const SELECTED$2 = 'e-step-selected';
|
|
18144
|
+
const INPROGRESS = 'e-step-inprogress';
|
|
18145
|
+
const NOTSTARTED = 'e-step-notstarted';
|
|
18146
|
+
const FOCUS$1 = 'e-step-focus';
|
|
18147
|
+
const COMPLETED = 'e-step-completed';
|
|
18148
|
+
const DISABLED$2 = 'e-step-disabled';
|
|
18149
|
+
const READONLY = 'e-stepper-readonly';
|
|
18150
|
+
const PROGRESSVALUE$1 = '--progress-value';
|
|
18151
|
+
const RTL$3 = 'e-rtl';
|
|
18152
|
+
const TEMPLATE = 'e-step-template';
|
|
18153
|
+
const LABELAFTER = 'e-label-after';
|
|
18154
|
+
const LABELBEFORE = 'e-label-before';
|
|
18155
|
+
const VERTICALSTEP = 'e-vertical';
|
|
18156
|
+
const HORIZSTEP = 'e-horizontal';
|
|
18157
|
+
const STEPICON = 'e-step-icon';
|
|
18158
|
+
const STEPTEXT = 'e-step-text';
|
|
18159
|
+
const TEXT = 'e-text';
|
|
18160
|
+
const STEPSLABEL = 'e-step-label';
|
|
18161
|
+
const LABEL = 'e-label';
|
|
18162
|
+
const STEPINDICATOR = 'e-step-type-indicator';
|
|
18163
|
+
const LABELINDICATOR = 'e-step-type-label';
|
|
18164
|
+
const INDICATORICON = 'e-step-indicator';
|
|
18165
|
+
const STEPPERTOOLTIP = 'e-stepper-tooltip';
|
|
18166
|
+
const STEPPERIPROGRESSTIP = 'e-step-inprogress-tip';
|
|
18167
|
+
/**
|
|
18168
|
+
* Defines the step progress animation of the Stepper.
|
|
18169
|
+
*/
|
|
18170
|
+
class StepperAnimationSettings extends ChildProperty {
|
|
18171
|
+
}
|
|
18172
|
+
__decorate$14([
|
|
18173
|
+
Property(true)
|
|
18174
|
+
], StepperAnimationSettings.prototype, "enable", void 0);
|
|
18175
|
+
__decorate$14([
|
|
18176
|
+
Property(2000)
|
|
18177
|
+
], StepperAnimationSettings.prototype, "duration", void 0);
|
|
18178
|
+
__decorate$14([
|
|
18179
|
+
Property(0)
|
|
18180
|
+
], StepperAnimationSettings.prototype, "delay", void 0);
|
|
18181
|
+
/**
|
|
18182
|
+
* Defines the label position in the Stepper.
|
|
18183
|
+
*/
|
|
18184
|
+
var StepLabelPosition;
|
|
18185
|
+
(function (StepLabelPosition) {
|
|
18186
|
+
/**
|
|
18187
|
+
* Displays the label on top position regardless of the Stepper's orientation.
|
|
18188
|
+
*/
|
|
18189
|
+
StepLabelPosition["Top"] = "Top";
|
|
18190
|
+
/**
|
|
18191
|
+
* Displays the label on bottom position regardless of the Stepper's orientation.
|
|
18192
|
+
*/
|
|
18193
|
+
StepLabelPosition["Bottom"] = "Bottom";
|
|
18194
|
+
/**
|
|
18195
|
+
* Displays the label on left side regardless of the Stepper's orientation.
|
|
18196
|
+
*/
|
|
18197
|
+
StepLabelPosition["Start"] = "Start";
|
|
18198
|
+
/**
|
|
18199
|
+
* Displays the label on right side regardless of the Stepper's orientation.
|
|
18200
|
+
*/
|
|
18201
|
+
StepLabelPosition["End"] = "End";
|
|
18202
|
+
})(StepLabelPosition || (StepLabelPosition = {}));
|
|
18203
|
+
/**
|
|
18204
|
+
* Defines whether steps are display with only indicator, only labels or combination of both.
|
|
18205
|
+
*/
|
|
18206
|
+
var StepType;
|
|
18207
|
+
(function (StepType) {
|
|
18208
|
+
/**
|
|
18209
|
+
* Steps are shown indicator with label defined.
|
|
18210
|
+
*/
|
|
18211
|
+
StepType["Default"] = "Default";
|
|
18212
|
+
/**
|
|
18213
|
+
* Steps are shown with only label.
|
|
18214
|
+
*/
|
|
18215
|
+
StepType["Label"] = "Label";
|
|
18216
|
+
/**
|
|
18217
|
+
* Steps are shown with only indicator.
|
|
18218
|
+
*/
|
|
18219
|
+
StepType["Indicator"] = "Indicator";
|
|
18220
|
+
})(StepType || (StepType = {}));
|
|
18221
|
+
/**
|
|
18222
|
+
* The Stepper component visualizes several steps and indicates the current progress by highlighting already completed steps.
|
|
18223
|
+
*
|
|
18224
|
+
* ```html
|
|
18225
|
+
* <nav id="stepper"></nav>
|
|
18226
|
+
* ```
|
|
18227
|
+
* ```typescript
|
|
18228
|
+
* <script>
|
|
18229
|
+
* let stepperObj: Stepper = new Stepper({steps : [{}, {}, {}, {}, {}]});
|
|
18230
|
+
* stepperObj.appendTo('#stepper');
|
|
18231
|
+
* </script>
|
|
18232
|
+
* ```
|
|
18233
|
+
*/
|
|
18234
|
+
let Stepper = class Stepper extends StepperBase {
|
|
18235
|
+
/**
|
|
18236
|
+
* * Constructor for creating the Stepper component.
|
|
18237
|
+
*
|
|
18238
|
+
* @param {StepperModel} options - Specifies the Stepper model.
|
|
18239
|
+
* @param {string | HTMLElement} element - Specifies the element to render as component.
|
|
18240
|
+
* @private
|
|
18241
|
+
*/
|
|
18242
|
+
constructor(options, element) {
|
|
18243
|
+
super(options, element);
|
|
18244
|
+
this.stepperItemElements = [];
|
|
18245
|
+
}
|
|
18246
|
+
preRender() {
|
|
18247
|
+
if (!this.element.id) {
|
|
18248
|
+
this.element.id = getUniqueID('e-' + this.getModuleName());
|
|
18249
|
+
}
|
|
18250
|
+
const localeText = { optional: 'Optional' };
|
|
18251
|
+
this.l10n = new L10n('stepper', localeText, this.locale);
|
|
18252
|
+
this.keyConfigs = {
|
|
18253
|
+
downarrow: 'downarrow',
|
|
18254
|
+
leftarrow: 'leftarrow',
|
|
18255
|
+
rightarrow: 'rightarrow',
|
|
18256
|
+
uparrow: 'uparrow',
|
|
18257
|
+
space: 'space',
|
|
18258
|
+
enter: 'enter',
|
|
18259
|
+
home: 'home',
|
|
18260
|
+
end: 'end',
|
|
18261
|
+
tab: 'tab',
|
|
18262
|
+
shiftTab: 'shift+tab',
|
|
18263
|
+
escape: 'escape'
|
|
18264
|
+
};
|
|
18265
|
+
this.tooltipOpen = false;
|
|
18266
|
+
}
|
|
18267
|
+
/**
|
|
18268
|
+
* To get component name.
|
|
18269
|
+
*
|
|
18270
|
+
* @returns {string} - Module Name
|
|
18271
|
+
* @private
|
|
18272
|
+
*/
|
|
18273
|
+
getModuleName() {
|
|
18274
|
+
return 'stepper';
|
|
18275
|
+
}
|
|
18276
|
+
render() {
|
|
18277
|
+
this.initialize();
|
|
18278
|
+
this.navigationHandler(this.activeStep, null, false);
|
|
18279
|
+
this.updateStepperStatus(true);
|
|
18280
|
+
}
|
|
18281
|
+
initialize() {
|
|
18282
|
+
this.element.setAttribute('aria-label', this.element.id);
|
|
18283
|
+
this.updatePosition();
|
|
18284
|
+
this.stepperItemList = this.createElement('ol', { className: ITEMLIST });
|
|
18285
|
+
this.updateOrientaion(this.element);
|
|
18286
|
+
this.updateStepType();
|
|
18287
|
+
this.element.appendChild(this.stepperItemList);
|
|
18288
|
+
if (this.cssClass) {
|
|
18289
|
+
addClass([this.element], this.cssClass.trim().split(' '));
|
|
18290
|
+
}
|
|
18291
|
+
if (this.readOnly) {
|
|
18292
|
+
this.element.classList.add(READONLY);
|
|
18293
|
+
}
|
|
18294
|
+
if (this.enableRtl) {
|
|
18295
|
+
this.element.classList.add(RTL$3);
|
|
18296
|
+
}
|
|
18297
|
+
this.wireEvents();
|
|
18298
|
+
this.updateTemplateFunction();
|
|
18299
|
+
this.renderItems();
|
|
18300
|
+
if (this.steps.length > 0) {
|
|
18301
|
+
if (this.steps.length > 1) {
|
|
18302
|
+
if (this.isAngular && this.template) {
|
|
18303
|
+
setTimeout(() => {
|
|
18304
|
+
this.renderProgressBar(this.element);
|
|
18305
|
+
});
|
|
18306
|
+
}
|
|
18307
|
+
else {
|
|
18308
|
+
this.renderProgressBar(this.element);
|
|
18309
|
+
}
|
|
18310
|
+
}
|
|
18311
|
+
this.checkValidStep();
|
|
18312
|
+
this.updateAnimation();
|
|
18313
|
+
this.updateTooltip();
|
|
18314
|
+
this.wireKeyboardEvent();
|
|
18315
|
+
}
|
|
18316
|
+
}
|
|
18317
|
+
updatePosition() {
|
|
18318
|
+
this.progressBarPosition = this.beforeLabelWidth = this.textEleWidth = 0;
|
|
18319
|
+
}
|
|
18320
|
+
renderDefault(index) {
|
|
18321
|
+
return (!this.steps[parseInt((index).toString(), 10)].iconCss && !this.steps[parseInt((index).toString(), 10)].text &&
|
|
18322
|
+
!this.steps[parseInt((index).toString(), 10)].label) ? true : false;
|
|
18323
|
+
}
|
|
18324
|
+
updateAnimation() {
|
|
18325
|
+
const progressEle = this.element.querySelector('.e-progressbar-value');
|
|
18326
|
+
if (this.animation.enable) {
|
|
18327
|
+
if (this.animation.duration >= 0) {
|
|
18328
|
+
if (progressEle) {
|
|
18329
|
+
progressEle.style.setProperty('--duration', ((this.animation.duration) + 'ms'));
|
|
18330
|
+
}
|
|
18331
|
+
}
|
|
18332
|
+
if (this.animation.delay >= 0) {
|
|
18333
|
+
if (progressEle) {
|
|
18334
|
+
progressEle.style.setProperty('--delay', ((this.animation.delay) + 'ms'));
|
|
18335
|
+
}
|
|
18336
|
+
}
|
|
18337
|
+
}
|
|
18338
|
+
else {
|
|
18339
|
+
if (progressEle) {
|
|
18340
|
+
progressEle.style.setProperty('--delay', (0 + 'ms'));
|
|
18341
|
+
progressEle.style.setProperty('--duration', (0 + 'ms'));
|
|
18342
|
+
}
|
|
18343
|
+
}
|
|
18344
|
+
}
|
|
18345
|
+
updateStepType() {
|
|
18346
|
+
if (this.stepType.toLowerCase() === 'indicator' || 'label' || 'default') {
|
|
18347
|
+
this.stepType.toLowerCase() !== 'default' ? this.element.classList.add('e-step-type-' + this.stepType.toLowerCase()) : '';
|
|
18348
|
+
if (((this.stepType.toLowerCase() === 'indicator' || 'label') && (this.labelContainer))) {
|
|
18349
|
+
this.clearLabelPosition();
|
|
18350
|
+
}
|
|
18351
|
+
}
|
|
18352
|
+
}
|
|
18353
|
+
wireEvents() {
|
|
18354
|
+
EventHandler.add(window, 'resize', () => {
|
|
18355
|
+
if (this.stepperItemList && this.progressbar && this.element.classList.contains(HORIZSTEP)) {
|
|
18356
|
+
this.setProgressPosition(this.element, true);
|
|
18357
|
+
}
|
|
18358
|
+
}, this);
|
|
18359
|
+
EventHandler.add(window, 'click', () => { this.updateStepFocus(); }, this);
|
|
18360
|
+
}
|
|
18361
|
+
updateStepFocus() {
|
|
18362
|
+
if (this.isKeyNavFocus) {
|
|
18363
|
+
this.isKeyNavFocus = false;
|
|
18364
|
+
const isFocus = this.element.querySelector('.' + FOCUS$1);
|
|
18365
|
+
if (isFocus) {
|
|
18366
|
+
isFocus.classList.remove(FOCUS$1);
|
|
18367
|
+
this.element.classList.remove('e-steps-focus');
|
|
18368
|
+
}
|
|
18369
|
+
}
|
|
18370
|
+
}
|
|
18371
|
+
updateStepperStatus(isInitial) {
|
|
18372
|
+
for (let index = 0; index < this.steps.length; index++) {
|
|
18373
|
+
const item = this.steps[parseInt(index.toString(), 10)];
|
|
18374
|
+
const status = item.status.toLowerCase();
|
|
18375
|
+
if (isInitial && this.activeStep === 0 && index === 0) {
|
|
18376
|
+
item.status = StepStatus.InProgress;
|
|
18377
|
+
}
|
|
18378
|
+
if (item && status !== 'notstarted' && index === this.activeStep) {
|
|
18379
|
+
for (let i = 0; i < this.steps.length; i++) {
|
|
18380
|
+
const itemElement = this.stepperItemElements[parseInt(i.toString(), 10)];
|
|
18381
|
+
itemElement.classList.remove(SELECTED$2, INPROGRESS, COMPLETED, NOTSTARTED);
|
|
18382
|
+
const prevOnChange = this.isProtectedOnChange;
|
|
18383
|
+
this.isProtectedOnChange = true;
|
|
18384
|
+
if (status === 'completed') {
|
|
18385
|
+
this.updateStatusClass(i, index, itemElement);
|
|
18386
|
+
}
|
|
18387
|
+
else {
|
|
18388
|
+
this.updateStatusClass(i, index, itemElement, true);
|
|
18389
|
+
}
|
|
18390
|
+
this.isProtectedOnChange = prevOnChange;
|
|
18391
|
+
}
|
|
18392
|
+
}
|
|
18393
|
+
else if (item && status !== 'notstarted' && index !== this.activeStep) {
|
|
18394
|
+
this.navigationHandler(this.activeStep, null, true);
|
|
18395
|
+
}
|
|
18396
|
+
}
|
|
18397
|
+
}
|
|
18398
|
+
updateStatusClass(currentStep, index, ele, isInprogress) {
|
|
18399
|
+
const stepItem = this.steps[parseInt(currentStep.toString(), 10)];
|
|
18400
|
+
if (currentStep < index) {
|
|
18401
|
+
ele.classList.add(COMPLETED);
|
|
18402
|
+
stepItem.status = StepStatus.Completed;
|
|
18403
|
+
}
|
|
18404
|
+
else if (currentStep === index) {
|
|
18405
|
+
ele.classList.add(isInprogress ? INPROGRESS : COMPLETED, SELECTED$2);
|
|
18406
|
+
}
|
|
18407
|
+
else {
|
|
18408
|
+
ele.classList.add(NOTSTARTED);
|
|
18409
|
+
}
|
|
18410
|
+
}
|
|
18411
|
+
renderItems() {
|
|
18412
|
+
for (let index = 0; index < this.steps.length; index++) {
|
|
18413
|
+
this.stepperItemContainer = this.createElement('li', { className: ITEMCONTAINER });
|
|
18414
|
+
this.stepperItemContainer.classList[(index === 0) ? 'add' : 'remove'](SELECTED$2, INPROGRESS);
|
|
18415
|
+
this.stepperItemContainer.classList[(index !== 0) ? 'add' : 'remove'](NOTSTARTED);
|
|
18416
|
+
if (this.element.classList.contains(HORIZSTEP)) {
|
|
18417
|
+
this.stepperItemContainer.style.setProperty('--max-width', 100 / this.steps.length + '%');
|
|
18418
|
+
}
|
|
18419
|
+
const stepSpan = this.createElement('span', { className: 'e-step' });
|
|
18420
|
+
if (this.renderDefault(index) && (isNullOrUndefined(this.template) || this.template === '')) {
|
|
18421
|
+
const isIndicator = (!this.element.classList.contains('e-step-type-default') && this.stepType.toLowerCase() === 'indicator') ? true : false;
|
|
18422
|
+
if (isIndicator) {
|
|
18423
|
+
stepSpan.classList.add('e-icons', INDICATORICON);
|
|
18424
|
+
}
|
|
18425
|
+
if (!isIndicator) {
|
|
18426
|
+
stepSpan.classList.add('e-step-content');
|
|
18427
|
+
stepSpan.innerHTML = (index + 1).toString();
|
|
18428
|
+
}
|
|
18429
|
+
this.stepperItemContainer.appendChild(stepSpan);
|
|
18430
|
+
}
|
|
18431
|
+
else if (isNullOrUndefined(this.template) || this.template === '') {
|
|
18432
|
+
let isRender = true;
|
|
18433
|
+
const item = this.steps[parseInt(index.toString(), 10)];
|
|
18434
|
+
if (item.iconCss && (((!item.text && !item.label) || !this.element.classList.contains(LABELINDICATOR)))) {
|
|
18435
|
+
const itemIcon = item.iconCss.trim().split(' ');
|
|
18436
|
+
stepSpan.classList.add(ICONCSS);
|
|
18437
|
+
for (let i = 0; i < itemIcon.length; i++) {
|
|
18438
|
+
stepSpan.classList.add(itemIcon[parseInt(i.toString(), 10)]);
|
|
18439
|
+
}
|
|
18440
|
+
this.stepperItemContainer.appendChild(stepSpan);
|
|
18441
|
+
this.stepperItemContainer.classList.add(STEPICON);
|
|
18442
|
+
if ((this.element.classList.contains(HORIZSTEP) && (this.labelPosition.toLowerCase() === 'start' || this.labelPosition.toLowerCase() === 'end') && item.label) ||
|
|
18443
|
+
(this.element.classList.contains(VERTICALSTEP) && (this.labelPosition.toLowerCase() === 'top' || this.labelPosition.toLowerCase() === 'bottom') && item.label)) {
|
|
18444
|
+
this.element.classList.add('e-label-' + this.labelPosition.toLowerCase());
|
|
18445
|
+
const textSpan = this.createElement('span', { className: TEXTCSS + ' ' + TEXT });
|
|
18446
|
+
textSpan.innerText = item.label;
|
|
18447
|
+
this.stepperItemContainer.appendChild(textSpan);
|
|
18448
|
+
this.stepperItemContainer.classList.add(STEPTEXT);
|
|
18449
|
+
isRender = false;
|
|
18450
|
+
}
|
|
18451
|
+
}
|
|
18452
|
+
if (item.text && (!item.iconCss || !this.element.classList.contains(STEPINDICATOR)) && isRender && !(item.iconCss && item.label)) {
|
|
18453
|
+
if (!item.iconCss && this.element.classList.contains(STEPINDICATOR)) {
|
|
18454
|
+
this.checkValidState(item, stepSpan);
|
|
18455
|
+
const prevOnChange = this.isProtectedOnChange;
|
|
18456
|
+
this.isProtectedOnChange = true;
|
|
18457
|
+
item.label = null;
|
|
18458
|
+
this.isProtectedOnChange = prevOnChange;
|
|
18459
|
+
}
|
|
18460
|
+
else {
|
|
18461
|
+
this.textContainer = this.createElement('span', { className: TEXTCSS });
|
|
18462
|
+
const textSpan = this.createElement('span', { className: TEXT });
|
|
18463
|
+
if (!item.label) {
|
|
18464
|
+
textSpan.innerText = item.text;
|
|
18465
|
+
(item.isValid !== null && (!item.iconCss || this.element.classList.contains(LABELINDICATOR))) ? this.textContainer.appendChild(textSpan) : textSpan.classList.add(TEXTCSS);
|
|
18466
|
+
this.stepperItemContainer.appendChild((item.isValid !== null && (!item.iconCss || this.element.classList.contains(LABELINDICATOR))) ? this.textContainer : textSpan);
|
|
18467
|
+
this.stepperItemContainer.classList.add(STEPTEXT);
|
|
18468
|
+
}
|
|
18469
|
+
if (!item.iconCss || this.element.classList.contains(LABELINDICATOR)) {
|
|
18470
|
+
this.stepperItemContainer.classList.add('e-step-text-only');
|
|
18471
|
+
if (!item.label && item.isValid !== null) {
|
|
18472
|
+
const iconSpan = this.createElement('span', { className: 'e-step-validation-icon e-icons' });
|
|
18473
|
+
this.textContainer.appendChild(iconSpan);
|
|
18474
|
+
}
|
|
18475
|
+
}
|
|
18476
|
+
if (item.label && this.element.classList.contains(LABELINDICATOR)) {
|
|
18477
|
+
textSpan.innerText = item.label;
|
|
18478
|
+
}
|
|
18479
|
+
const prevOnChange = this.isProtectedOnChange;
|
|
18480
|
+
this.isProtectedOnChange = true;
|
|
18481
|
+
item.text = item.label ? null : item.text;
|
|
18482
|
+
this.isProtectedOnChange = prevOnChange;
|
|
18483
|
+
}
|
|
18484
|
+
}
|
|
18485
|
+
if (item.cssClass) {
|
|
18486
|
+
addClass([this.stepperItemContainer], item.cssClass.trim().split(' '));
|
|
18487
|
+
}
|
|
18488
|
+
if (item.disabled) {
|
|
18489
|
+
this.stepperItemContainer.classList[item.disabled ? 'add' : 'remove'](DISABLED$2);
|
|
18490
|
+
attributes(this.stepperItemContainer, { 'tabindex': '-1', 'aria-disabled': 'true' });
|
|
18491
|
+
}
|
|
18492
|
+
if (item.label && (!item.iconCss || !this.element.classList.contains(STEPINDICATOR)) && isRender) {
|
|
18493
|
+
if (!item.iconCss && !item.text && this.element.classList.contains(STEPINDICATOR)) {
|
|
18494
|
+
this.checkValidState(item, stepSpan, true);
|
|
18495
|
+
}
|
|
18496
|
+
else if ((!((this.element.classList.contains(LABELINDICATOR)) && item.text)) || (this.element.classList.contains(LABELINDICATOR) && item.label)) {
|
|
18497
|
+
this.labelContainer = this.createElement('span', { className: STEPLABEL });
|
|
18498
|
+
const labelSpan = this.createElement('span', { className: LABEL });
|
|
18499
|
+
labelSpan.innerText = item.label;
|
|
18500
|
+
this.labelContainer.appendChild(labelSpan);
|
|
18501
|
+
this.stepperItemContainer.classList.add(STEPSLABEL);
|
|
18502
|
+
this.updateLabelPosition();
|
|
18503
|
+
if ((!item.iconCss && !item.text) || this.element.classList.contains(LABELINDICATOR)) {
|
|
18504
|
+
this.stepperItemContainer.classList.add('e-step-label-only');
|
|
18505
|
+
if (item.isValid !== null) {
|
|
18506
|
+
const iconSpan = this.createElement('span', { className: 'e-step-validation-icon e-icons' });
|
|
18507
|
+
this.labelContainer.appendChild(iconSpan);
|
|
18508
|
+
}
|
|
18509
|
+
}
|
|
18510
|
+
}
|
|
18511
|
+
}
|
|
18512
|
+
if (item.optional) {
|
|
18513
|
+
const optionalSpan = this.createElement('span', { className: OPTIONAL });
|
|
18514
|
+
this.l10n.setLocale(this.locale);
|
|
18515
|
+
const optionalContent = this.l10n.getConstant('optional');
|
|
18516
|
+
optionalSpan.innerText = optionalContent;
|
|
18517
|
+
if (item.label && (this.labelContainer && ((this.element.classList.contains(LABELAFTER) && !this.stepperItemContainer.classList.contains('e-step-label-only'))
|
|
18518
|
+
|| (this.element.classList.contains(HORIZSTEP) && this.element.classList.contains(LABELBEFORE) && !this.stepperItemContainer.classList.contains('e-step-label-only'))))
|
|
18519
|
+
|| (this.element.classList.contains(VERTICALSTEP) && this.element.classList.contains(LABELBEFORE))) {
|
|
18520
|
+
this.labelContainer.appendChild(optionalSpan);
|
|
18521
|
+
}
|
|
18522
|
+
else {
|
|
18523
|
+
this.stepperItemContainer.appendChild(optionalSpan);
|
|
18524
|
+
}
|
|
18525
|
+
}
|
|
18526
|
+
if (item.isValid !== null) {
|
|
18527
|
+
item.isValid ? this.stepperItemContainer.classList.add('e-step-valid') : this.stepperItemContainer.classList.add('e-step-error');
|
|
18528
|
+
}
|
|
18529
|
+
}
|
|
18530
|
+
this.renderItemContent(index, false);
|
|
18531
|
+
if (this.stepperItemContainer.classList.contains(INPROGRESS)) {
|
|
18532
|
+
attributes(this.stepperItemContainer, { 'tabindex': '0', 'aria-current': 'true' });
|
|
18533
|
+
}
|
|
18534
|
+
else {
|
|
18535
|
+
attributes(this.stepperItemContainer, { 'tabindex': '-1' });
|
|
18536
|
+
}
|
|
18537
|
+
this.wireItemsEvents(this.stepperItemContainer, index);
|
|
18538
|
+
this.stepperItemElements.push(this.stepperItemContainer);
|
|
18539
|
+
const eventArgs = { element: this.stepperItemContainer, index: index };
|
|
18540
|
+
this.trigger('beforeStepRender', eventArgs, (args) => {
|
|
18541
|
+
this.stepperItemList.appendChild(args.element);
|
|
18542
|
+
});
|
|
18543
|
+
if (this.isAngular && this.template) {
|
|
18544
|
+
setTimeout(() => {
|
|
18545
|
+
this.calculateProgressBarPosition();
|
|
18546
|
+
});
|
|
18547
|
+
}
|
|
18548
|
+
else {
|
|
18549
|
+
this.calculateProgressBarPosition();
|
|
18550
|
+
}
|
|
18551
|
+
}
|
|
18552
|
+
if (this.element.classList.contains(VERTICALSTEP)) {
|
|
18553
|
+
if (this.element.classList.contains(LABELBEFORE)) {
|
|
18554
|
+
const listItems = this.stepperItemList.querySelectorAll('.' + LABEL);
|
|
18555
|
+
for (let i = 0; i < listItems.length; i++) {
|
|
18556
|
+
const labelEle = listItems[parseInt((i).toString(), 10)];
|
|
18557
|
+
labelEle.style.setProperty('--label-width', (this.beforeLabelWidth) + 5 + 'px');
|
|
18558
|
+
}
|
|
18559
|
+
}
|
|
18560
|
+
}
|
|
18561
|
+
}
|
|
18562
|
+
calculateProgressBarPosition() {
|
|
18563
|
+
const isBeforeLabel = (this.element.classList.contains(LABELBEFORE)) ? true : false;
|
|
18564
|
+
const isStepVertical = (this.element.classList.contains(VERTICALSTEP)) ? true : false;
|
|
18565
|
+
if (isStepVertical) {
|
|
18566
|
+
const iconOnly = (this.stepperItemContainer.classList.contains(STEPICON) && !this.stepperItemContainer.classList.contains(STEPTEXT) && !this.stepperItemContainer.classList.contains(STEPSLABEL)) ? true : false;
|
|
18567
|
+
const textEle = (this.stepperItemContainer.querySelector('.' + TEXTCSS));
|
|
18568
|
+
if (textEle) {
|
|
18569
|
+
this.textEleWidth = this.textEleWidth < textEle.offsetWidth ? textEle.offsetWidth : this.textEleWidth;
|
|
18570
|
+
}
|
|
18571
|
+
if (isBeforeLabel) {
|
|
18572
|
+
let itemWidth;
|
|
18573
|
+
const labelWidth = this.stepperItemContainer.querySelector('.' + LABEL).offsetWidth + 15;
|
|
18574
|
+
if (this.beforeLabelWidth < labelWidth) {
|
|
18575
|
+
this.beforeLabelWidth = labelWidth;
|
|
18576
|
+
}
|
|
18577
|
+
if (this.element.querySelector('ol').lastChild.querySelector('.' + ICONCSS)) {
|
|
18578
|
+
itemWidth = (this.beforeLabelWidth + (this.stepperItemContainer.querySelector('.' + ICONCSS).offsetWidth / 2));
|
|
18579
|
+
}
|
|
18580
|
+
else if (this.stepperItemContainer.querySelector('.' + TEXTCSS)) {
|
|
18581
|
+
itemWidth = (this.beforeLabelWidth + (this.stepperItemContainer.querySelector('.' + TEXTCSS).offsetWidth / 2));
|
|
18582
|
+
}
|
|
18583
|
+
if (this.progressBarPosition < itemWidth) {
|
|
18584
|
+
this.progressBarPosition = itemWidth;
|
|
18585
|
+
}
|
|
18586
|
+
}
|
|
18587
|
+
else if (this.progressBarPosition < (iconOnly ? this.stepperItemContainer.offsetWidth : this.element.querySelector('ol').lastChild.firstChild.offsetWidth)) {
|
|
18588
|
+
this.progressBarPosition = iconOnly ? this.stepperItemContainer.offsetWidth : this.element.querySelector('ol').lastChild.firstChild.offsetWidth;
|
|
18589
|
+
}
|
|
18590
|
+
}
|
|
18591
|
+
}
|
|
18592
|
+
checkValidState(item, stepSpan, isLabel) {
|
|
18593
|
+
if (item.isValid == null) {
|
|
18594
|
+
stepSpan.classList.add('e-step-content');
|
|
18595
|
+
if (isLabel) {
|
|
18596
|
+
stepSpan.innerHTML = item.label;
|
|
18597
|
+
}
|
|
18598
|
+
else {
|
|
18599
|
+
stepSpan.innerHTML = item.label ? item.label : item.text;
|
|
18600
|
+
}
|
|
18601
|
+
this.stepperItemContainer.appendChild(stepSpan);
|
|
18602
|
+
}
|
|
18603
|
+
else {
|
|
18604
|
+
stepSpan.classList.add(ICONCSS);
|
|
18605
|
+
this.stepperItemContainer.appendChild(stepSpan);
|
|
18606
|
+
this.stepperItemContainer.classList.add(STEPICON);
|
|
18607
|
+
}
|
|
18608
|
+
}
|
|
18609
|
+
updateCurrentLabel() {
|
|
18610
|
+
let currentLabelPos;
|
|
18611
|
+
if (this.element.classList.contains(HORIZSTEP)) {
|
|
18612
|
+
currentLabelPos = this.labelPosition.toLowerCase() === 'top' ? 'before' : this.labelPosition.toLowerCase() === 'bottom' ? 'after' : this.labelPosition.toLowerCase();
|
|
18613
|
+
}
|
|
18614
|
+
else {
|
|
18615
|
+
currentLabelPos = this.labelPosition.toLowerCase() === 'start' ? 'before' : this.labelPosition.toLowerCase() === 'end' ? 'after' : this.labelPosition.toLowerCase();
|
|
18616
|
+
}
|
|
18617
|
+
return currentLabelPos;
|
|
18618
|
+
}
|
|
18619
|
+
updateLabelPosition() {
|
|
18620
|
+
this.clearLabelPosition();
|
|
18621
|
+
this.labelContainer.classList.add('e-label-' + this.updateCurrentLabel());
|
|
18622
|
+
if (this.labelPosition.toLowerCase() === 'start' && this.orientation.toLowerCase() === 'vertical') {
|
|
18623
|
+
this.stepperItemContainer.firstChild ? this.stepperItemContainer.firstChild.before(this.labelContainer) : this.stepperItemContainer.appendChild(this.labelContainer);
|
|
18624
|
+
}
|
|
18625
|
+
else {
|
|
18626
|
+
this.stepperItemContainer.appendChild(this.labelContainer);
|
|
18627
|
+
}
|
|
18628
|
+
this.element.classList.add('e-label-' + this.updateCurrentLabel());
|
|
18629
|
+
}
|
|
18630
|
+
clearLabelPosition() {
|
|
18631
|
+
const removeCss = this.labelContainer.classList.value.match(/(e-label-[after|before]+)/g);
|
|
18632
|
+
if (removeCss) {
|
|
18633
|
+
removeClass([this.labelContainer], removeCss);
|
|
18634
|
+
removeClass([this.element], removeCss);
|
|
18635
|
+
}
|
|
18636
|
+
}
|
|
18637
|
+
checkValidStep() {
|
|
18638
|
+
for (let index = 0; index < this.steps.length; index++) {
|
|
18639
|
+
const item = this.steps[parseInt(index.toString(), 10)];
|
|
18640
|
+
const itemElement = this.stepperItemElements[parseInt(index.toString(), 10)];
|
|
18641
|
+
if (item.isValid !== null) {
|
|
18642
|
+
let indicatorEle;
|
|
18643
|
+
let iconEle;
|
|
18644
|
+
if (this.element.classList.contains(STEPINDICATOR) && !item.iconCss) {
|
|
18645
|
+
indicatorEle = itemElement.querySelector('.' + ICONCSS);
|
|
18646
|
+
}
|
|
18647
|
+
else {
|
|
18648
|
+
iconEle = itemElement.querySelector('.' + ICONCSS);
|
|
18649
|
+
}
|
|
18650
|
+
const textLabelIcon = itemElement.querySelector('.e-step-validation-icon');
|
|
18651
|
+
const itemIcon = item.iconCss.trim().split(' ');
|
|
18652
|
+
const validStep = itemElement.classList.contains('e-step-valid');
|
|
18653
|
+
if (indicatorEle) {
|
|
18654
|
+
indicatorEle.classList.add('e-icons', validStep ? 'e-check' : 'e-circle-info');
|
|
18655
|
+
}
|
|
18656
|
+
if (iconEle) {
|
|
18657
|
+
for (let i = 0; i < itemIcon.length; i++) {
|
|
18658
|
+
iconEle.classList.remove(itemIcon[parseInt(i.toString(), 10)]);
|
|
18659
|
+
}
|
|
18660
|
+
iconEle.classList.add('e-icons', validStep ? 'e-check' : 'e-circle-info');
|
|
18661
|
+
}
|
|
18662
|
+
if (textLabelIcon) {
|
|
18663
|
+
textLabelIcon.classList.add(validStep ? 'e-circle-check' : 'e-circle-info');
|
|
18664
|
+
if (this.element.classList.contains(VERTICALSTEP)) {
|
|
18665
|
+
const labelEle = itemElement.querySelector('.' + LABEL);
|
|
18666
|
+
const textEle = itemElement.querySelector('.' + TEXT);
|
|
18667
|
+
const itemWidth = textEle ? textEle.offsetWidth + textEle.getBoundingClientRect().left :
|
|
18668
|
+
labelEle.offsetWidth + labelEle.getBoundingClientRect().left;
|
|
18669
|
+
const validationIcon = itemElement.querySelector('.e-step-validation-icon');
|
|
18670
|
+
validationIcon.style.setProperty('--icon-position', (itemWidth + 20) + 'px');
|
|
18671
|
+
}
|
|
18672
|
+
}
|
|
18673
|
+
}
|
|
18674
|
+
}
|
|
18675
|
+
}
|
|
18676
|
+
updateTooltip() {
|
|
18677
|
+
if (this.showTooltip) {
|
|
18678
|
+
this.tooltipObj = new Tooltip({
|
|
18679
|
+
target: '.e-step-container', windowCollision: true,
|
|
18680
|
+
opensOn: 'Custom', cssClass: this.cssClass ? (STEPPERTOOLTIP + ' ' + this.cssClass) : STEPPERTOOLTIP,
|
|
18681
|
+
position: 'TopCenter'
|
|
18682
|
+
});
|
|
18683
|
+
this.tooltipObj.appendTo(this.stepperItemList);
|
|
18684
|
+
}
|
|
18685
|
+
else {
|
|
18686
|
+
if (!isNullOrUndefined(this.tooltipObj)) {
|
|
18687
|
+
this.tooltipObj.destroy();
|
|
18688
|
+
this.tooltipObj = null;
|
|
18689
|
+
}
|
|
18690
|
+
}
|
|
18691
|
+
}
|
|
18692
|
+
wireItemsEvents(itemElement, index) {
|
|
18693
|
+
EventHandler.add(itemElement, 'click', (e) => {
|
|
18694
|
+
if (this.linear) {
|
|
18695
|
+
const linearModeValue = index - this.activeStep;
|
|
18696
|
+
if (Math.abs(linearModeValue) === 1) {
|
|
18697
|
+
this.stepClickHandler(index, e, itemElement);
|
|
18698
|
+
}
|
|
18699
|
+
}
|
|
18700
|
+
else {
|
|
18701
|
+
this.stepClickHandler(index, e, itemElement);
|
|
18702
|
+
}
|
|
18703
|
+
}, this);
|
|
18704
|
+
EventHandler.add(itemElement, 'mouseover', () => this.openStepperTooltip(index), this);
|
|
18705
|
+
EventHandler.add(itemElement, 'mouseleave', () => this.closeStepperTooltip(), this);
|
|
18706
|
+
}
|
|
18707
|
+
openStepperTooltip(index) {
|
|
18708
|
+
const currentStep = this.steps[parseInt(index.toString(), 10)];
|
|
18709
|
+
if (this.showTooltip && (currentStep.label || currentStep.text)) {
|
|
18710
|
+
if (!this.tooltipOpen) {
|
|
18711
|
+
this.updateTooltipContent(index);
|
|
18712
|
+
this.tooltipObj.open(this.stepperItemElements[parseInt((index).toString(), 10)]);
|
|
18713
|
+
if (this.stepType.toLocaleLowerCase() !== 'label' && ((this.stepType.toLocaleLowerCase() === 'indicator') ||
|
|
18714
|
+
(currentStep.label !== '' && currentStep.iconCss !== ''))) {
|
|
18715
|
+
const tooltipPopupClass = currentStep.status.toLowerCase() === 'inprogress' ?
|
|
18716
|
+
`${STEPPERTOOLTIP} ${STEPPERIPROGRESSTIP} ${this.cssClass ? this.cssClass : ''}` : `${STEPPERTOOLTIP} ${this.cssClass ? this.cssClass : ''}`;
|
|
18717
|
+
this.tooltipObj.setProperties({ cssClass: tooltipPopupClass.trim() });
|
|
18718
|
+
}
|
|
18719
|
+
this.tooltipOpen = true;
|
|
18720
|
+
}
|
|
18721
|
+
}
|
|
18722
|
+
}
|
|
18723
|
+
closeStepperTooltip() {
|
|
18724
|
+
if (this.tooltipOpen) {
|
|
18725
|
+
this.tooltipObj.close();
|
|
18726
|
+
this.tooltipOpen = false;
|
|
18727
|
+
}
|
|
18728
|
+
}
|
|
18729
|
+
updateTooltipContent(index) {
|
|
18730
|
+
if (this.showTooltip) {
|
|
18731
|
+
if (this.isReact) {
|
|
18732
|
+
this.clearTemplate(['stepperTooltipTemplate']);
|
|
18733
|
+
}
|
|
18734
|
+
let content;
|
|
18735
|
+
const currentStep = this.steps[parseInt(index.toString(), 10)];
|
|
18736
|
+
if (this.tooltipTemplate) {
|
|
18737
|
+
content = this.createElement('span', { className: 'e-stepper-tooltip-content' });
|
|
18738
|
+
const templateFunction = this.getTemplateFunction(this.tooltipTemplate);
|
|
18739
|
+
append(templateFunction({ value: currentStep }, this, 'stepperTooltipTemplate', (this.element.id + 'tooltipTemplate'), this.isStringTemplate), content);
|
|
18740
|
+
this.tooltipObj.setProperties({ content: content }, true);
|
|
18741
|
+
}
|
|
18742
|
+
else {
|
|
18743
|
+
const content = currentStep.label ? currentStep.label : currentStep.text;
|
|
18744
|
+
this.tooltipObj.setProperties({ content: initializeCSPTemplate(function () { return content; }) }, true);
|
|
18745
|
+
}
|
|
18746
|
+
this.renderReactTemplates();
|
|
18747
|
+
}
|
|
18748
|
+
}
|
|
18749
|
+
stepClickHandler(index, e, itemElement) {
|
|
18750
|
+
const clickEventArgs = {
|
|
18751
|
+
element: itemElement, event: e, previousStep: this.activeStep,
|
|
18752
|
+
activeStep: index
|
|
18753
|
+
};
|
|
18754
|
+
this.trigger('stepClick', clickEventArgs);
|
|
18755
|
+
this.navigateToStep(index, e, itemElement, true);
|
|
18756
|
+
}
|
|
18757
|
+
updateTemplateFunction() {
|
|
18758
|
+
this.templateFunction = this.template ? this.getTemplateFunction(this.template) : null;
|
|
18759
|
+
}
|
|
18760
|
+
renderItemContent(index, isrerender) {
|
|
18761
|
+
const listItems = this.stepperItemList.querySelectorAll('li');
|
|
18762
|
+
if (isrerender) {
|
|
18763
|
+
this.removeItemContent(listItems[parseInt((index).toString(), 10)]);
|
|
18764
|
+
}
|
|
18765
|
+
if (this.template) {
|
|
18766
|
+
isrerender ? listItems[parseInt((index).toString(), 10)].classList.add(TEMPLATE) :
|
|
18767
|
+
this.stepperItemContainer.classList.add(TEMPLATE);
|
|
18768
|
+
const item = this.steps[parseInt(index.toString(), 10)];
|
|
18769
|
+
append(this.templateFunction({ step: item, currentStep: index }, this, 'stepperTemplate', (this.element.id + '_stepperTemplate'), this.isStringTemplate), isrerender ? listItems[parseInt((index).toString(), 10)] : this.stepperItemContainer);
|
|
18770
|
+
}
|
|
18771
|
+
this.renderReactTemplates();
|
|
18772
|
+
}
|
|
18773
|
+
removeItemContent(ele) {
|
|
18774
|
+
ele.classList.remove(TEMPLATE);
|
|
18775
|
+
const firstChild = ele.firstElementChild;
|
|
18776
|
+
for (let i = 0; i < ele.childElementCount; i++) {
|
|
18777
|
+
firstChild.remove();
|
|
18778
|
+
}
|
|
18779
|
+
}
|
|
18780
|
+
updateContent() {
|
|
18781
|
+
if (this.isReact) {
|
|
18782
|
+
this.clearTemplate(['stepperTemplate']);
|
|
18783
|
+
}
|
|
18784
|
+
for (let i = 0; i < this.steps.length; i++) {
|
|
18785
|
+
this.renderItemContent(i, true);
|
|
18786
|
+
}
|
|
18787
|
+
}
|
|
18788
|
+
/**
|
|
18789
|
+
* Gets template content based on the template property value.
|
|
18790
|
+
*
|
|
18791
|
+
* @param {string | Function} template - Template property value.
|
|
18792
|
+
* @returns {Function} - Return template function.
|
|
18793
|
+
* @hidden
|
|
18794
|
+
*/
|
|
18795
|
+
getTemplateFunction(template) {
|
|
18796
|
+
if (typeof template === 'string') {
|
|
18797
|
+
let content = '';
|
|
18798
|
+
try {
|
|
18799
|
+
const tempEle = select(template);
|
|
18800
|
+
if (tempEle) {
|
|
18801
|
+
//Return innerHTML incase of jsrenderer script else outerHTML
|
|
18802
|
+
content = tempEle.tagName === 'SCRIPT' ? tempEle.innerHTML : tempEle.outerHTML;
|
|
18803
|
+
}
|
|
18804
|
+
else {
|
|
18805
|
+
content = template;
|
|
18806
|
+
}
|
|
18807
|
+
}
|
|
18808
|
+
catch (e) {
|
|
18809
|
+
content = template;
|
|
18810
|
+
}
|
|
18811
|
+
return compile(content);
|
|
18812
|
+
}
|
|
18813
|
+
else {
|
|
18814
|
+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
18815
|
+
return compile(template);
|
|
18816
|
+
}
|
|
18817
|
+
}
|
|
18818
|
+
navigateToStep(index, e, itemElement, isInteracted, isUpdated) {
|
|
18819
|
+
const eventArgs = {
|
|
18820
|
+
element: itemElement, event: e, isInteracted: isInteracted,
|
|
18821
|
+
previousStep: this.activeStep, activeStep: index, cancel: false
|
|
18822
|
+
};
|
|
18823
|
+
if (isUpdated != false) {
|
|
18824
|
+
const previousStep = this.activeStep;
|
|
18825
|
+
this.trigger('stepChanging', eventArgs, (args) => {
|
|
18826
|
+
if (args.cancel) {
|
|
18827
|
+
return;
|
|
18828
|
+
}
|
|
18829
|
+
this.navigationHandler(index);
|
|
18830
|
+
const eventArgs = {
|
|
18831
|
+
element: itemElement, event: e, isInteracted: isInteracted,
|
|
18832
|
+
previousStep: previousStep, activeStep: this.activeStep
|
|
18833
|
+
};
|
|
18834
|
+
this.trigger('stepChanged', eventArgs);
|
|
18835
|
+
});
|
|
18836
|
+
}
|
|
18837
|
+
else {
|
|
18838
|
+
this.navigationHandler(index);
|
|
18839
|
+
}
|
|
18840
|
+
}
|
|
18841
|
+
navigationHandler(index, stepStatus, isUpdated) {
|
|
18842
|
+
index = (index >= this.steps.length - 1) ? this.steps.length - 1 : index;
|
|
18843
|
+
const Itemslength = this.stepperItemElements.length;
|
|
18844
|
+
if (index >= 0 && index < Itemslength - 1) {
|
|
18845
|
+
index = this.stepperItemElements[parseInt(index.toString(), 10)].classList.contains(DISABLED$2) ? this.activeStep : index;
|
|
18846
|
+
}
|
|
18847
|
+
const prevOnChange = this.isProtectedOnChange;
|
|
18848
|
+
this.isProtectedOnChange = true;
|
|
18849
|
+
this.activeStep = index;
|
|
18850
|
+
this.isProtectedOnChange = prevOnChange;
|
|
18851
|
+
for (let i = 0; i < this.steps.length; i++) {
|
|
18852
|
+
const itemElement = this.stepperItemElements[parseInt(i.toString(), 10)];
|
|
18853
|
+
const item = this.steps[parseInt(i.toString(), 10)];
|
|
18854
|
+
itemElement.classList.remove(SELECTED$2, INPROGRESS, COMPLETED, NOTSTARTED);
|
|
18855
|
+
if (i === this.activeStep) {
|
|
18856
|
+
itemElement.classList.add(SELECTED$2);
|
|
18857
|
+
}
|
|
18858
|
+
if (this.activeStep >= 0 && this.progressbar) {
|
|
18859
|
+
if (this.element.classList.contains(HORIZSTEP)) {
|
|
18860
|
+
if ((this.element.classList.contains(LABELBEFORE) || this.element.classList.contains(LABELAFTER)) && !this.element.classList.contains(STEPINDICATOR) &&
|
|
18861
|
+
this.stepperItemElements[parseInt(this.activeStep.toString(), 10)].classList.contains(STEPICON)) {
|
|
18862
|
+
const progressPos = this.element.querySelector('.e-stepper-progressbar');
|
|
18863
|
+
const selectedEle = this.stepperItemElements[parseInt(this.activeStep.toString(), 10)].firstChild;
|
|
18864
|
+
let value = this.activeStep === 0 ? 0 : (selectedEle.offsetLeft - progressPos.offsetLeft + (selectedEle.offsetWidth / 2)) / progressPos.offsetWidth * 100;
|
|
18865
|
+
if (this.element.classList.contains(RTL$3)) {
|
|
18866
|
+
const elementPos = this.stepperItemElements[0].firstChild;
|
|
18867
|
+
value = ((progressPos.offsetWidth - selectedEle.offsetLeft) + Math.abs((elementPos.offsetLeft + elementPos.offsetWidth) - this.stepperItemList.offsetWidth)) / progressPos.offsetWidth * 100;
|
|
18868
|
+
this.progressbar.style.setProperty(PROGRESSVALUE$1, (value) + '%');
|
|
18869
|
+
}
|
|
18870
|
+
else {
|
|
18871
|
+
this.progressbar.style.setProperty(PROGRESSVALUE$1, (value) + '%');
|
|
18872
|
+
}
|
|
18873
|
+
}
|
|
18874
|
+
else {
|
|
18875
|
+
let totalLiWidth = 0;
|
|
18876
|
+
let activeLiWidth = 0;
|
|
18877
|
+
for (let j = 0; j < this.stepperItemElements.length; j++) {
|
|
18878
|
+
totalLiWidth = totalLiWidth + this.stepperItemElements[parseInt(j.toString(), 10)].offsetWidth;
|
|
18879
|
+
if (j <= this.activeStep) {
|
|
18880
|
+
if (j < this.activeStep) {
|
|
18881
|
+
activeLiWidth = activeLiWidth + this.stepperItemElements[parseInt(j.toString(), 10)].offsetWidth;
|
|
18882
|
+
}
|
|
18883
|
+
else if (j == this.activeStep && j !== 0) {
|
|
18884
|
+
activeLiWidth = activeLiWidth + (this.stepperItemElements[parseInt(j.toString(), 10)].offsetWidth / 2);
|
|
18885
|
+
}
|
|
18886
|
+
}
|
|
18887
|
+
}
|
|
18888
|
+
const spaceWidth = (this.stepperItemList.offsetWidth - totalLiWidth) / (this.stepperItemElements.length - 1);
|
|
18889
|
+
const progressValue = ((activeLiWidth + (spaceWidth * this.activeStep)) / this.stepperItemList.offsetWidth) * 100;
|
|
18890
|
+
this.progressbar.style.setProperty(PROGRESSVALUE$1, (progressValue) + '%');
|
|
18891
|
+
}
|
|
18892
|
+
}
|
|
18893
|
+
else {
|
|
18894
|
+
this.progressbar.style.setProperty(PROGRESSVALUE$1, ((100 / (this.steps.length - 1)) * index) + '%');
|
|
18895
|
+
}
|
|
18896
|
+
}
|
|
18897
|
+
else if (this.activeStep < 0 && this.progressbar) {
|
|
18898
|
+
this.progressbar.style.setProperty(PROGRESSVALUE$1, 0 + '%');
|
|
18899
|
+
}
|
|
18900
|
+
if (i === this.activeStep) {
|
|
18901
|
+
itemElement.classList.add(INPROGRESS);
|
|
18902
|
+
}
|
|
18903
|
+
else if (this.activeStep > 0 && i < this.activeStep) {
|
|
18904
|
+
itemElement.classList.add(COMPLETED);
|
|
18905
|
+
}
|
|
18906
|
+
else {
|
|
18907
|
+
itemElement.classList.add(NOTSTARTED);
|
|
18908
|
+
}
|
|
18909
|
+
if (itemElement.classList.contains(INPROGRESS)) {
|
|
18910
|
+
attributes(itemElement, { 'tabindex': '0', 'aria-current': 'true' });
|
|
18911
|
+
}
|
|
18912
|
+
else {
|
|
18913
|
+
attributes(itemElement, { 'tabindex': '-1', 'aria-current': 'false' });
|
|
18914
|
+
}
|
|
18915
|
+
const prevOnChange = this.isProtectedOnChange;
|
|
18916
|
+
this.isProtectedOnChange = true;
|
|
18917
|
+
if (isUpdated !== false) {
|
|
18918
|
+
if (i < this.activeStep || (this.steps.length - 1 === this.activeStep && item.status.toLowerCase() === "completed")) {
|
|
18919
|
+
item.status = StepStatus.Completed;
|
|
18920
|
+
}
|
|
18921
|
+
else if (i === this.activeStep) {
|
|
18922
|
+
item.status = StepStatus.InProgress;
|
|
18923
|
+
}
|
|
18924
|
+
else if (i > this.activeStep) {
|
|
18925
|
+
item.status = StepStatus.NotStarted;
|
|
18926
|
+
}
|
|
18927
|
+
if (stepStatus && this.activeStep === i) {
|
|
18928
|
+
item.status = stepStatus;
|
|
18929
|
+
}
|
|
18930
|
+
if (item.status.toLowerCase() === "completed") {
|
|
18931
|
+
itemElement.classList.remove(SELECTED$2, INPROGRESS, NOTSTARTED);
|
|
18932
|
+
itemElement.classList.add(COMPLETED);
|
|
18933
|
+
}
|
|
18934
|
+
if (item.status.toLowerCase() === "notstarted") {
|
|
18935
|
+
itemElement.classList.remove(SELECTED$2, INPROGRESS, COMPLETED);
|
|
18936
|
+
itemElement.classList.add(NOTSTARTED);
|
|
18937
|
+
}
|
|
18938
|
+
}
|
|
18939
|
+
this.isProtectedOnChange = prevOnChange;
|
|
18940
|
+
if (this.renderDefault(i) && this.element.classList.contains(STEPINDICATOR)) {
|
|
18941
|
+
if (itemElement.classList.contains(COMPLETED)) {
|
|
18942
|
+
itemElement.firstChild.classList.remove('e-icons', 'e-step-indicator');
|
|
18943
|
+
itemElement.firstChild.classList.add(ICONCSS, 'e-icons', 'e-check');
|
|
18944
|
+
}
|
|
18945
|
+
else if (itemElement.classList.contains(INPROGRESS) || itemElement.classList.contains(NOTSTARTED)) {
|
|
18946
|
+
itemElement.firstChild.classList.remove(ICONCSS, 'e-icons', 'e-check');
|
|
18947
|
+
itemElement.firstChild.classList.add('e-icons', 'e-step-indicator');
|
|
18948
|
+
}
|
|
18949
|
+
}
|
|
18950
|
+
}
|
|
18951
|
+
}
|
|
18952
|
+
removeItemElements() {
|
|
18953
|
+
for (let i = 0; i < this.stepperItemElements.length; i++) {
|
|
18954
|
+
remove(this.stepperItemElements[parseInt(i.toString(), 10)]);
|
|
18955
|
+
}
|
|
18956
|
+
this.stepperItemElements = [];
|
|
18957
|
+
}
|
|
18958
|
+
nextStep() {
|
|
18959
|
+
if (this.activeStep !== this.steps.length - 1) {
|
|
18960
|
+
this.navigateToStep(this.activeStep + 1, null, null, false);
|
|
18961
|
+
}
|
|
18962
|
+
}
|
|
18963
|
+
previousStep() {
|
|
18964
|
+
if (this.activeStep > 0) {
|
|
18965
|
+
this.navigateToStep(this.activeStep - 1, null, null, false);
|
|
18966
|
+
}
|
|
18967
|
+
}
|
|
18968
|
+
reset() {
|
|
18969
|
+
if (this.activeStep !== 0) {
|
|
18970
|
+
const isDisabled = this.stepperItemElements[0].classList.contains(DISABLED$2) ? true : false;
|
|
18971
|
+
this.navigateToStep(isDisabled ? -1 : 0, null, null, false);
|
|
18972
|
+
}
|
|
18973
|
+
}
|
|
18974
|
+
updateElementClassArray() {
|
|
18975
|
+
const classArray = [RTL$3, READONLY, 'e-steps-focus', LABELAFTER, LABELBEFORE, 'e-label-top',
|
|
18976
|
+
'e-label-bottom', 'e-label-start', 'e-label-end', STEPINDICATOR, LABELINDICATOR, VERTICALSTEP, HORIZSTEP];
|
|
18977
|
+
removeClass([this.element], classArray);
|
|
18978
|
+
}
|
|
18979
|
+
destroy() {
|
|
18980
|
+
super.destroy();
|
|
18981
|
+
EventHandler.remove(window, 'resize', () => { if (this.stepperItemList && this.progressbar) {
|
|
18982
|
+
this.setProgressPosition(this.element, true);
|
|
18983
|
+
} });
|
|
18984
|
+
EventHandler.remove(window, 'click', () => { this.updateStepFocus(); });
|
|
18985
|
+
// unwires the events and detach the li elements
|
|
18986
|
+
this.removeItemElements();
|
|
18987
|
+
this.clearTemplate();
|
|
18988
|
+
if (this.stepperItemList) {
|
|
18989
|
+
remove(this.stepperItemList);
|
|
18990
|
+
}
|
|
18991
|
+
this.stepperItemList = null;
|
|
18992
|
+
if (this.progressStep) {
|
|
18993
|
+
remove(this.progressStep);
|
|
18994
|
+
}
|
|
18995
|
+
this.progressStep = null;
|
|
18996
|
+
this.progressbar = null;
|
|
18997
|
+
this.progressBarPosition = null;
|
|
18998
|
+
this.stepperItemContainer = null;
|
|
18999
|
+
this.textContainer = null;
|
|
19000
|
+
this.labelContainer = null;
|
|
19001
|
+
this.updateElementClassArray();
|
|
19002
|
+
this.element.removeAttribute('aria-label');
|
|
19003
|
+
if (this.showTooltip) {
|
|
19004
|
+
this.tooltipObj.destroy();
|
|
19005
|
+
this.tooltipObj = null;
|
|
19006
|
+
}
|
|
19007
|
+
if (this.keyboardModuleStepper) {
|
|
19008
|
+
this.keyboardModuleStepper.destroy();
|
|
19009
|
+
}
|
|
19010
|
+
this.keyboardModuleStepper = null;
|
|
19011
|
+
}
|
|
19012
|
+
wireKeyboardEvent() {
|
|
19013
|
+
this.keyboardModuleStepper = new KeyboardEvents(this.element, {
|
|
19014
|
+
keyAction: this.keyActionHandler.bind(this),
|
|
19015
|
+
keyConfigs: this.keyConfigs,
|
|
19016
|
+
eventName: 'keydown'
|
|
19017
|
+
});
|
|
19018
|
+
}
|
|
19019
|
+
keyActionHandler(e) {
|
|
19020
|
+
if (this.readOnly) {
|
|
19021
|
+
return;
|
|
19022
|
+
}
|
|
19023
|
+
switch (e.action) {
|
|
19024
|
+
case 'uparrow':
|
|
19025
|
+
case 'downarrow':
|
|
19026
|
+
case 'leftarrow':
|
|
19027
|
+
case 'rightarrow':
|
|
19028
|
+
case 'tab':
|
|
19029
|
+
case 'shiftTab':
|
|
19030
|
+
this.handleNavigation(this.enableRtl && this.element.classList.contains(HORIZSTEP) ? (e.action === 'leftarrow' || e.action === 'shiftTab' || e.action === 'uparrow') : (e.action === 'rightarrow' || e.action === 'tab' || e.action === 'downarrow'), e);
|
|
19031
|
+
break;
|
|
19032
|
+
case 'space':
|
|
19033
|
+
case 'enter':
|
|
19034
|
+
case 'escape':
|
|
19035
|
+
this.handleNavigation(null, e);
|
|
19036
|
+
break;
|
|
19037
|
+
case 'home':
|
|
19038
|
+
case 'end':
|
|
19039
|
+
this.handleNavigation(null, e, this.enableRtl);
|
|
19040
|
+
break;
|
|
19041
|
+
}
|
|
19042
|
+
}
|
|
19043
|
+
handleNavigation(isNextStep, e, isRTL) {
|
|
19044
|
+
this.isKeyNavFocus = true;
|
|
19045
|
+
this.element.classList.add('e-steps-focus');
|
|
19046
|
+
let focusedEle = this.element.querySelector('.' + FOCUS$1);
|
|
19047
|
+
if (!focusedEle) {
|
|
19048
|
+
focusedEle = this.element.querySelector('.' + SELECTED$2);
|
|
19049
|
+
}
|
|
19050
|
+
const stepItems = Array.prototype.slice.call(this.stepperItemList.children);
|
|
19051
|
+
let index = stepItems.indexOf(focusedEle);
|
|
19052
|
+
if (e.action === 'tab' || e.action === 'shiftTab' || e.action === 'downarrow' || e.action === 'uparrow' || e.action === 'space' || e.action === 'home' || e.action === 'end') {
|
|
19053
|
+
if ((e.action === 'tab' && index === stepItems.length - 1) || (e.action === 'shiftTab' && index === 0)) {
|
|
19054
|
+
if (focusedEle.classList.contains(FOCUS$1)) {
|
|
19055
|
+
this.updateStepFocus();
|
|
19056
|
+
return;
|
|
19057
|
+
}
|
|
19058
|
+
}
|
|
19059
|
+
else {
|
|
19060
|
+
e.preventDefault();
|
|
19061
|
+
}
|
|
19062
|
+
}
|
|
19063
|
+
if (e.action === 'escape') {
|
|
19064
|
+
stepItems[parseInt(index.toString(), 10)].classList.remove(FOCUS$1);
|
|
19065
|
+
this.element.classList.remove('e-steps-focus');
|
|
19066
|
+
}
|
|
19067
|
+
if (!(e.action === 'space' || e.action === 'enter')) {
|
|
19068
|
+
const prevIndex = index;
|
|
19069
|
+
index = isNextStep ? index + 1 : index - 1;
|
|
19070
|
+
while ((index >= 0 && index < stepItems.length) && stepItems[parseInt(index.toString(), 10)].classList.contains(DISABLED$2)) {
|
|
19071
|
+
index = isNextStep ? index + 1 : index - 1;
|
|
19072
|
+
}
|
|
19073
|
+
index = (index < 0) ? 0 : (index > stepItems.length - 1) ? stepItems.length - 1 : index;
|
|
19074
|
+
if (stepItems[parseInt(prevIndex.toString(), 10)].classList.contains(FOCUS$1)) {
|
|
19075
|
+
stepItems[parseInt(prevIndex.toString(), 10)].classList.remove(FOCUS$1);
|
|
19076
|
+
}
|
|
19077
|
+
if ((e.action === 'home' || e.action === 'end')) {
|
|
19078
|
+
if (e.action === 'home') {
|
|
19079
|
+
isRTL ? index = stepItems.length - 1 : index = 0;
|
|
19080
|
+
}
|
|
19081
|
+
else {
|
|
19082
|
+
isRTL ? index = 0 : index = stepItems.length - 1;
|
|
19083
|
+
}
|
|
19084
|
+
}
|
|
19085
|
+
if (index >= 0 && index < stepItems.length) {
|
|
19086
|
+
stepItems[parseInt(index.toString(), 10)].classList.add(FOCUS$1);
|
|
19087
|
+
}
|
|
19088
|
+
}
|
|
19089
|
+
else if ((e.action === 'space' || e.action === 'enter')) {
|
|
19090
|
+
let isupdateFocus = false;
|
|
19091
|
+
if (this.linear) {
|
|
19092
|
+
const linearModeValue = this.activeStep - index;
|
|
19093
|
+
if (Math.abs(linearModeValue) === 1) {
|
|
19094
|
+
this.navigateToStep(index, null, null, true);
|
|
19095
|
+
isupdateFocus = true;
|
|
19096
|
+
}
|
|
19097
|
+
}
|
|
19098
|
+
else {
|
|
19099
|
+
this.navigateToStep(index, null, null, true);
|
|
19100
|
+
isupdateFocus = true;
|
|
19101
|
+
}
|
|
19102
|
+
if (isupdateFocus) {
|
|
19103
|
+
this.updateStepFocus();
|
|
19104
|
+
this.stepperItemElements[index].focus();
|
|
19105
|
+
}
|
|
19106
|
+
}
|
|
19107
|
+
}
|
|
19108
|
+
renderStepperItems(isUpdate, isStepType) {
|
|
19109
|
+
this.updateElementClassArray();
|
|
19110
|
+
this.removeItemElements();
|
|
19111
|
+
this.element.querySelector('.e-stepper-progressbar').remove();
|
|
19112
|
+
isUpdate ? this.updatePosition() : null;
|
|
19113
|
+
isStepType ? this.updateStepType() : null;
|
|
19114
|
+
this.readOnly ? (!this.element.classList.contains(READONLY)) ? this.element.classList.add(READONLY) : null : null;
|
|
19115
|
+
this.enableRtl ? (!this.element.classList.contains(RTL$3)) ? this.element.classList.add(RTL$3) : null : null;
|
|
19116
|
+
this.updateOrientaion(this.element);
|
|
19117
|
+
this.renderItems();
|
|
19118
|
+
this.renderProgressBar(this.element);
|
|
19119
|
+
this.checkValidStep();
|
|
19120
|
+
this.updateAnimation();
|
|
19121
|
+
this.navigateToStep(this.activeStep, null, this.stepperItemElements[this.activeStep], true);
|
|
19122
|
+
}
|
|
19123
|
+
/**
|
|
19124
|
+
* Called internally if any of the property value changed.
|
|
19125
|
+
*
|
|
19126
|
+
* @param {StepperModel} newProp - Specifies new properties
|
|
19127
|
+
* @param {StepperModel} oldProp - Specifies old properties
|
|
19128
|
+
* @returns {void}
|
|
19129
|
+
* @private
|
|
19130
|
+
*/
|
|
19131
|
+
onPropertyChanged(newProp, oldProp) {
|
|
19132
|
+
for (const prop of Object.keys(newProp)) {
|
|
19133
|
+
switch (prop) {
|
|
19134
|
+
case 'steps': {
|
|
19135
|
+
if (!(newProp.steps instanceof Array && oldProp.steps instanceof Array)) {
|
|
19136
|
+
const stepCounts = Object.keys(newProp.steps);
|
|
19137
|
+
for (let i = 0; i < stepCounts.length; i++) {
|
|
19138
|
+
const index = parseInt(Object.keys(newProp.steps)[i], 10);
|
|
19139
|
+
const changedPropsCount = Object.keys(newProp.steps[index]).length;
|
|
19140
|
+
for (let j = 0; j < changedPropsCount; j++) {
|
|
19141
|
+
const property = Object.keys(newProp.steps[index])[j];
|
|
19142
|
+
if (property === 'status') {
|
|
19143
|
+
if (this.activeStep === index) {
|
|
19144
|
+
this.navigationHandler(index, newProp.steps[index].status);
|
|
19145
|
+
}
|
|
19146
|
+
else {
|
|
19147
|
+
this.steps[index].status = oldProp.steps[index].status;
|
|
19148
|
+
}
|
|
19149
|
+
}
|
|
19150
|
+
else {
|
|
19151
|
+
this.removeItemElements();
|
|
19152
|
+
this.renderItems();
|
|
19153
|
+
this.updateStepperStatus();
|
|
19154
|
+
}
|
|
19155
|
+
this.checkValidStep();
|
|
19156
|
+
}
|
|
19157
|
+
}
|
|
19158
|
+
}
|
|
19159
|
+
else {
|
|
19160
|
+
this.renderStepperItems(true, true);
|
|
19161
|
+
}
|
|
19162
|
+
break;
|
|
19163
|
+
}
|
|
19164
|
+
case 'orientation':
|
|
19165
|
+
this.updateOrientaion(this.element);
|
|
19166
|
+
this.renderStepperItems(true);
|
|
19167
|
+
break;
|
|
19168
|
+
case 'activeStep':
|
|
19169
|
+
this.activeStep = (newProp.activeStep > this.steps.length - 1 || newProp.activeStep < -1) ? oldProp.activeStep : this.activeStep;
|
|
19170
|
+
if (this.activeStep >= 0 && this.stepperItemElements[parseInt(this.activeStep.toString(), 10)].classList.contains(DISABLED$2)) {
|
|
19171
|
+
this.activeStep = oldProp.activeStep;
|
|
19172
|
+
}
|
|
19173
|
+
if (this.linear) {
|
|
19174
|
+
const linearModeValue = oldProp.activeStep - this.activeStep;
|
|
19175
|
+
if (Math.abs(linearModeValue) === 1) {
|
|
19176
|
+
this.navigateToStep(this.activeStep, null, null, true);
|
|
19177
|
+
}
|
|
19178
|
+
}
|
|
19179
|
+
else {
|
|
19180
|
+
this.navigateToStep(this.activeStep, null, this.stepperItemElements[this.activeStep], true);
|
|
19181
|
+
}
|
|
19182
|
+
break;
|
|
19183
|
+
case 'enableRtl':
|
|
19184
|
+
this.element.classList[this.enableRtl ? 'add' : 'remove'](RTL$3);
|
|
19185
|
+
break;
|
|
19186
|
+
case 'readOnly':
|
|
19187
|
+
this.element.classList[this.readOnly ? 'add' : 'remove'](READONLY);
|
|
19188
|
+
break;
|
|
19189
|
+
case 'cssClass':
|
|
19190
|
+
if (oldProp.cssClass) {
|
|
19191
|
+
removeClass([this.element], oldProp.cssClass.trim().split(' '));
|
|
19192
|
+
}
|
|
19193
|
+
if (newProp.cssClass) {
|
|
19194
|
+
addClass([this.element], newProp.cssClass.trim().split(' '));
|
|
19195
|
+
}
|
|
19196
|
+
if (this.tooltipObj) {
|
|
19197
|
+
this.tooltipObj.setProperties({ cssClass: this.cssClass ? (STEPPERTOOLTIP + ' ' + this.cssClass) : STEPPERTOOLTIP });
|
|
19198
|
+
}
|
|
19199
|
+
break;
|
|
19200
|
+
case 'labelPosition':
|
|
19201
|
+
this.renderStepperItems(true);
|
|
19202
|
+
break;
|
|
19203
|
+
case 'showTooltip':
|
|
19204
|
+
this.updateTooltip();
|
|
19205
|
+
break;
|
|
19206
|
+
case 'stepType':
|
|
19207
|
+
this.renderStepperItems(true, true);
|
|
19208
|
+
break;
|
|
19209
|
+
case 'template':
|
|
19210
|
+
this.updateTemplateFunction();
|
|
19211
|
+
this.updateContent();
|
|
19212
|
+
break;
|
|
19213
|
+
case 'animation':
|
|
19214
|
+
this.updateAnimation();
|
|
19215
|
+
break;
|
|
19216
|
+
}
|
|
19217
|
+
}
|
|
19218
|
+
}
|
|
19219
|
+
};
|
|
19220
|
+
__decorate$14([
|
|
19221
|
+
Property(0)
|
|
19222
|
+
], Stepper.prototype, "activeStep", void 0);
|
|
19223
|
+
__decorate$14([
|
|
19224
|
+
Complex({}, StepperAnimationSettings)
|
|
19225
|
+
], Stepper.prototype, "animation", void 0);
|
|
19226
|
+
__decorate$14([
|
|
19227
|
+
Property(false)
|
|
19228
|
+
], Stepper.prototype, "linear", void 0);
|
|
19229
|
+
__decorate$14([
|
|
19230
|
+
Property(false)
|
|
19231
|
+
], Stepper.prototype, "showTooltip", void 0);
|
|
19232
|
+
__decorate$14([
|
|
19233
|
+
Property('')
|
|
19234
|
+
], Stepper.prototype, "template", void 0);
|
|
19235
|
+
__decorate$14([
|
|
19236
|
+
Property('')
|
|
19237
|
+
], Stepper.prototype, "tooltipTemplate", void 0);
|
|
19238
|
+
__decorate$14([
|
|
19239
|
+
Property(StepLabelPosition.Bottom)
|
|
19240
|
+
], Stepper.prototype, "labelPosition", void 0);
|
|
19241
|
+
__decorate$14([
|
|
19242
|
+
Property(StepType.Default)
|
|
19243
|
+
], Stepper.prototype, "stepType", void 0);
|
|
19244
|
+
__decorate$14([
|
|
19245
|
+
Event()
|
|
19246
|
+
], Stepper.prototype, "stepChanged", void 0);
|
|
19247
|
+
__decorate$14([
|
|
19248
|
+
Event()
|
|
19249
|
+
], Stepper.prototype, "stepChanging", void 0);
|
|
19250
|
+
__decorate$14([
|
|
19251
|
+
Event()
|
|
19252
|
+
], Stepper.prototype, "stepClick", void 0);
|
|
19253
|
+
__decorate$14([
|
|
19254
|
+
Event()
|
|
19255
|
+
], Stepper.prototype, "beforeStepRender", void 0);
|
|
19256
|
+
Stepper = __decorate$14([
|
|
19257
|
+
NotifyPropertyChanges
|
|
19258
|
+
], Stepper);
|
|
19259
|
+
|
|
19260
|
+
/** Stepper export modules */
|
|
19261
|
+
|
|
17840
19262
|
/**
|
|
17841
19263
|
* Navigation all modules
|
|
17842
19264
|
*/
|
|
17843
19265
|
|
|
17844
|
-
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 };
|
|
19266
|
+
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 };
|
|
17845
19267
|
//# sourceMappingURL=ej2-navigations.es2015.js.map
|