@syncfusion/ej2-dropdowns 26.1.41 → 26.1.42
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/.eslintrc.json +261 -0
- package/dist/ej2-dropdowns.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js +2 -2
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +152 -66
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +153 -69
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +2 -2
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +9 -9
- package/src/drop-down-list/drop-down-list.js +12 -3
- package/src/drop-down-tree/drop-down-tree.js +2 -3
- package/src/list-box/list-box.js +67 -31
- package/src/mention/mention.js +2 -2
- package/src/multi-select/multi-select.d.ts +1 -0
- package/src/multi-select/multi-select.js +70 -30
- package/tslint.json +111 -0
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 26.1.
|
|
3
|
+
* version : 26.1.42
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-dropdowns@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-dropdowns@26.1.
|
|
3
|
+
"_id": "@syncfusion/ej2-dropdowns@26.1.41",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-oXyXylub+CZHjdg53nVw1G9cLpYH15SYWNKUSypradjvrRhpt85Wt0YYc+kthaAjlFDkM2x8z1mD0eafZ85yJw==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-dropdowns",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"/@syncfusion/ej2-spreadsheet",
|
|
36
36
|
"/@syncfusion/ej2-vue-dropdowns"
|
|
37
37
|
],
|
|
38
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-26.1.
|
|
39
|
-
"_shasum": "
|
|
38
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-26.1.41.tgz",
|
|
39
|
+
"_shasum": "68a76e93c7ed742f782843cefdcea6381b4ded71",
|
|
40
40
|
"_spec": "@syncfusion/ej2-dropdowns@*",
|
|
41
41
|
"_where": "/jenkins/workspace/elease-automation_release_26.1.1/packages/included",
|
|
42
42
|
"author": {
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
},
|
|
45
45
|
"bundleDependencies": false,
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@syncfusion/ej2-base": "~26.1.
|
|
48
|
-
"@syncfusion/ej2-data": "~26.1.
|
|
49
|
-
"@syncfusion/ej2-inputs": "~26.1.
|
|
47
|
+
"@syncfusion/ej2-base": "~26.1.42",
|
|
48
|
+
"@syncfusion/ej2-data": "~26.1.42",
|
|
49
|
+
"@syncfusion/ej2-inputs": "~26.1.42",
|
|
50
50
|
"@syncfusion/ej2-lists": "~26.1.35",
|
|
51
51
|
"@syncfusion/ej2-navigations": "~26.1.41",
|
|
52
52
|
"@syncfusion/ej2-notifications": "~26.1.35",
|
|
53
|
-
"@syncfusion/ej2-popups": "~26.1.
|
|
53
|
+
"@syncfusion/ej2-popups": "~26.1.42"
|
|
54
54
|
},
|
|
55
55
|
"deprecated": false,
|
|
56
56
|
"description": "Essential JS 2 DropDown Components",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"module": "./index.js",
|
|
76
76
|
"name": "@syncfusion/ej2-dropdowns",
|
|
77
77
|
"typings": "index.d.ts",
|
|
78
|
-
"version": "26.1.
|
|
78
|
+
"version": "26.1.42",
|
|
79
79
|
"sideEffects": false,
|
|
80
80
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
81
81
|
}
|
|
@@ -1334,7 +1334,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1334
1334
|
this.removeSelection();
|
|
1335
1335
|
li.classList.add(dropDownBaseClasses.selected);
|
|
1336
1336
|
this.removeHover();
|
|
1337
|
-
var value = li.getAttribute('data-value') !==
|
|
1337
|
+
var value = li.getAttribute('data-value') !== null ? this.getFormattedValue(li.getAttribute('data-value')) : null;
|
|
1338
1338
|
var selectedData = this.getDataByValue(value);
|
|
1339
1339
|
if (!this.initial && !preventSelect && !isNullOrUndefined(e)) {
|
|
1340
1340
|
var items = this.detachChanges(selectedData);
|
|
@@ -1409,6 +1409,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1409
1409
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1410
1410
|
DropDownList.prototype.setValue = function (e) {
|
|
1411
1411
|
var dataItem = this.getItemData();
|
|
1412
|
+
this.isTouched = !isNullOrUndefined(e);
|
|
1412
1413
|
if (dataItem.value === null) {
|
|
1413
1414
|
Input.setValue(null, this.inputElement, this.floatLabelType, this.showClearButton);
|
|
1414
1415
|
}
|
|
@@ -3304,7 +3305,9 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
3304
3305
|
DropDownList.prototype.checkData = function (newProp) {
|
|
3305
3306
|
if (newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource)) && this.itemTemplate && this.allowFiltering &&
|
|
3306
3307
|
!(this.isListSearched && (newProp.dataSource instanceof DataManager))) {
|
|
3307
|
-
this.list
|
|
3308
|
+
if (this.list) {
|
|
3309
|
+
this.list.innerHTML = '';
|
|
3310
|
+
}
|
|
3308
3311
|
this.actionCompleteData = { ulElement: null, list: null, isUpdated: false };
|
|
3309
3312
|
}
|
|
3310
3313
|
this.isListSearched = false;
|
|
@@ -3346,7 +3349,13 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
3346
3349
|
this.itemData = this.getDataByValue(currentValue);
|
|
3347
3350
|
var dataItem = this.getItemData();
|
|
3348
3351
|
var value = this.allowObjectBinding ? this.itemData : dataItem.value;
|
|
3349
|
-
|
|
3352
|
+
var index = isNullOrUndefined(value) ? null : this.index;
|
|
3353
|
+
if (isNullOrUndefined(index) && (currentValue == value)) {
|
|
3354
|
+
this.setProperties({ 'text': dataItem.text, 'value': value });
|
|
3355
|
+
}
|
|
3356
|
+
else {
|
|
3357
|
+
this.setProperties({ 'text': dataItem.text, 'index': index, 'value': value });
|
|
3358
|
+
}
|
|
3350
3359
|
};
|
|
3351
3360
|
DropDownList.prototype.updateInputFields = function () {
|
|
3352
3361
|
if (this.getModuleName() === 'dropdownlist') {
|
|
@@ -1603,10 +1603,9 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1603
1603
|
_this.popupObj.refreshPosition();
|
|
1604
1604
|
if (!(_this.showCheckBox && _this.showSelectAll) && (!_this.popupDiv.classList.contains(NODATA)
|
|
1605
1605
|
&& _this.treeItems.length > 0)) {
|
|
1606
|
-
var focusedElement =
|
|
1607
|
-
if (
|
|
1606
|
+
var focusedElement = _this.value != null && _this.text != null ? _this.treeObj.element.querySelector('[data-uid="' + _this.value[0] + '"]') : null;
|
|
1607
|
+
if (focusedElement) {
|
|
1608
1608
|
_this.treeObj.element.querySelector('li').setAttribute('tabindex', '-1');
|
|
1609
|
-
focusedElement = _this.treeObj.element.querySelector('[data-uid="' + _this.value[0] + '"]');
|
|
1610
1609
|
focusedElement.setAttribute('tabindex', '0');
|
|
1611
1610
|
}
|
|
1612
1611
|
else {
|
package/src/list-box/list-box.js
CHANGED
|
@@ -719,11 +719,9 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
719
719
|
}
|
|
720
720
|
};
|
|
721
721
|
ListBox.prototype.updateListItems = function (sourceElem, destElem) {
|
|
722
|
-
var i = 0;
|
|
723
722
|
destElem.innerHTML = '';
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
}
|
|
723
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
724
|
+
destElem.append.apply(destElem, sourceElem.childNodes);
|
|
727
725
|
};
|
|
728
726
|
ListBox.prototype.removeSelected = function (listObj, elems) {
|
|
729
727
|
if (listObj.selectionSettings.showCheckbox) {
|
|
@@ -1367,8 +1365,13 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1367
1365
|
};
|
|
1368
1366
|
ListBox.prototype.getDataByElems = function (elems) {
|
|
1369
1367
|
var data = [];
|
|
1370
|
-
|
|
1371
|
-
|
|
1368
|
+
var len = elems.length;
|
|
1369
|
+
for (var i = 0; i < len; i++) {
|
|
1370
|
+
var elem = elems[i];
|
|
1371
|
+
var value = elem.getAttribute('data-value');
|
|
1372
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1373
|
+
var formattedValue = this.getFormattedValue(value);
|
|
1374
|
+
data.push(this.getDataByValue(formattedValue));
|
|
1372
1375
|
}
|
|
1373
1376
|
return data;
|
|
1374
1377
|
};
|
|
@@ -1543,16 +1546,39 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1543
1546
|
fListBox.value = [];
|
|
1544
1547
|
if (elems.length) {
|
|
1545
1548
|
this.removeSelected(fListBox, elems);
|
|
1549
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1550
|
+
var ulChildren_1 = Array.prototype.slice.call(fListBox.ulElement.children);
|
|
1551
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1552
|
+
var listItems_1 = Array.prototype.slice.call(fListBox.ulElement.querySelectorAll('.e-list-item'));
|
|
1553
|
+
var lData_1 = fListBox.listData;
|
|
1554
|
+
var sData_1 = fListBox.sortedData;
|
|
1555
|
+
var jData_1 = fListBox.jsonData;
|
|
1556
|
+
var eData_1;
|
|
1557
|
+
var listDataMap_1 = {};
|
|
1558
|
+
if (elems.length > 199) {
|
|
1559
|
+
for (var _i = 0, _a = fListBox.listData; _i < _a.length; _i++) {
|
|
1560
|
+
var item = _a[_i];
|
|
1561
|
+
if (!isNullOrUndefined(item)) {
|
|
1562
|
+
var key = fListBox.getFormattedValue(getValue((fListBox.fields.value ? fListBox.fields.value : 'value'), item));
|
|
1563
|
+
listDataMap_1[key] = item;
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1546
1567
|
elems.forEach(function (ele) {
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1568
|
+
if (elems.length < 200) {
|
|
1569
|
+
eData_1 = fListBox.getDataByElems([ele])[0];
|
|
1570
|
+
}
|
|
1571
|
+
else {
|
|
1572
|
+
var value_1 = ele.getAttribute('data-value');
|
|
1573
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1574
|
+
var formattedValue = fListBox.getFormattedValue(value_1);
|
|
1575
|
+
eData_1 = listDataMap_1[formattedValue];
|
|
1576
|
+
}
|
|
1577
|
+
idx.push(ulChildren_1.indexOf(ele));
|
|
1578
|
+
dataLiIdx.push(listItems_1.indexOf(ele));
|
|
1579
|
+
dataIdx.push(lData_1.indexOf(eData_1));
|
|
1580
|
+
sortIdx.push(sData_1.indexOf(eData_1));
|
|
1581
|
+
jsonIdx.push(jData_1.indexOf(eData_1));
|
|
1556
1582
|
});
|
|
1557
1583
|
if (this.sortOrder !== 'None') {
|
|
1558
1584
|
sortIdx.forEach(function (i) {
|
|
@@ -1691,20 +1717,27 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1691
1717
|
// eslint-disable-next-line prefer-spread
|
|
1692
1718
|
flistboxarray = Array.apply(null, { length: fListBox.ulElement.childElementCount }).map(Number.call, Number);
|
|
1693
1719
|
}
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1720
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1721
|
+
var childNodes = fListBox.ulElement.childNodes;
|
|
1722
|
+
var childElementCount = fListBox.ulElement.childElementCount;
|
|
1723
|
+
var newFlistboxArray = [];
|
|
1724
|
+
for (var i = 0; i < childElementCount; i++) {
|
|
1725
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1726
|
+
var childNode = childNodes[i];
|
|
1727
|
+
if (childNode.classList.contains('e-disabled')) {
|
|
1728
|
+
tempLiColl.push(childNode);
|
|
1699
1729
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1700
1730
|
tempData.push(fListBox.listData[i]);
|
|
1701
1731
|
}
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1732
|
+
else {
|
|
1733
|
+
newFlistboxArray.push(i);
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
flistboxarray = newFlistboxArray;
|
|
1737
|
+
if (!isRefresh) {
|
|
1738
|
+
moveTo(fListBox.ulElement, tListBox.ulElement, flistboxarray, index);
|
|
1739
|
+
fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
1705
1740
|
}
|
|
1706
|
-
moveTo(fListBox.ulElement, tListBox.ulElement, flistboxarray, index);
|
|
1707
|
-
this.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
1708
1741
|
if (isKey) {
|
|
1709
1742
|
this.list.focus();
|
|
1710
1743
|
}
|
|
@@ -1760,7 +1793,7 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1760
1793
|
if (isRefresh) {
|
|
1761
1794
|
var sourceElem = tListBox.renderItems(listData, tListBox.fields);
|
|
1762
1795
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|
|
1763
|
-
|
|
1796
|
+
fListBox.trigger('actionComplete', { items: tempItems, eventName: this.toolbarAction });
|
|
1764
1797
|
}
|
|
1765
1798
|
else {
|
|
1766
1799
|
tListBox.sortedData = listData;
|
|
@@ -2050,11 +2083,13 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
2050
2083
|
}
|
|
2051
2084
|
};
|
|
2052
2085
|
ListBox.prototype.resizeHandler = function () {
|
|
2053
|
-
if (this.list.
|
|
2054
|
-
this.list.
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2086
|
+
if (this.list && !(this.cssClass && this.cssClass.indexOf('e-horizontal-listbox') > -1)) {
|
|
2087
|
+
if (this.list.scrollWidth > this.list.offsetWidth) {
|
|
2088
|
+
this.list.querySelector('.e-list-parent').style.display = 'inline-block';
|
|
2089
|
+
}
|
|
2090
|
+
else {
|
|
2091
|
+
this.list.querySelector('.e-list-parent').style.display = 'block';
|
|
2092
|
+
}
|
|
2058
2093
|
}
|
|
2059
2094
|
};
|
|
2060
2095
|
ListBox.prototype.getValidIndex = function (cli, index, keyCode) {
|
|
@@ -2198,6 +2233,7 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
2198
2233
|
};
|
|
2199
2234
|
ListBox.prototype.checkDisabledState = function (inst) {
|
|
2200
2235
|
if (isNullOrUndefined(inst.ulElement)) {
|
|
2236
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2201
2237
|
if (!isNullOrUndefined(this.dataSource) && isNullOrUndefined(this.dataSource.length)) {
|
|
2202
2238
|
return false;
|
|
2203
2239
|
}
|
package/src/mention/mention.js
CHANGED
|
@@ -1308,10 +1308,10 @@ var Mention = /** @class */ (function (_super) {
|
|
|
1308
1308
|
}
|
|
1309
1309
|
if (this.isContentEditable(this.inputElement)) {
|
|
1310
1310
|
if (Browser.isAndroid) {
|
|
1311
|
-
return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '');
|
|
1311
|
+
return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
|
|
1312
1312
|
}
|
|
1313
1313
|
else {
|
|
1314
|
-
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '');
|
|
1314
|
+
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : ' ');
|
|
1315
1315
|
}
|
|
1316
1316
|
}
|
|
1317
1317
|
else {
|
|
@@ -779,6 +779,7 @@ export declare class MultiSelect extends DropDownBase implements IInput {
|
|
|
779
779
|
private findGroupStart;
|
|
780
780
|
private findGroupAttrtibutes;
|
|
781
781
|
private updateCheckBox;
|
|
782
|
+
private disableGroupHeader;
|
|
782
783
|
private deselectHeader;
|
|
783
784
|
private onMouseOver;
|
|
784
785
|
private onMouseLeave;
|
|
@@ -558,6 +558,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
558
558
|
this.isCustomRendered = true;
|
|
559
559
|
this.remoteCustomValue = this.enableVirtualization ? false : this.remoteCustomValue;
|
|
560
560
|
}
|
|
561
|
+
if (this.mode === 'CheckBox' && this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy) && !isNullOrUndefined(this.fields.disabled)) {
|
|
562
|
+
this.disableGroupHeader();
|
|
563
|
+
}
|
|
561
564
|
if (this.dataSource instanceof DataManager && this.mode === 'CheckBox' && this.allowFiltering) {
|
|
562
565
|
this.removeFocus();
|
|
563
566
|
}
|
|
@@ -721,9 +724,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
721
724
|
return (!isNullOrUndefined(liElement) ? liElement : this.liCollections[0]);
|
|
722
725
|
};
|
|
723
726
|
MultiSelect.prototype.checkSelectAll = function () {
|
|
724
|
-
var groupItemLength = this.list.querySelectorAll('li.e-list-group-item.e-active').length;
|
|
727
|
+
var groupItemLength = !isNullOrUndefined(this.fields.disabled) ? this.list.querySelectorAll('li.e-list-group-item.e-active:not(.e-disabled)').length : this.list.querySelectorAll('li.e-list-group-item.e-active').length;
|
|
725
728
|
var listItem = this.list.querySelectorAll('li.e-list-item');
|
|
726
|
-
var searchCount = this.enableVirtualization ? this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-virtual-list)').length : this.list.querySelectorAll('li.' + dropDownBaseClasses.li).length;
|
|
729
|
+
var searchCount = this.enableVirtualization ? this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-virtual-list)').length : !isNullOrUndefined(this.fields.disabled) ? this.list.querySelectorAll('li.' + dropDownBaseClasses.li + ':not(.e-disabled)').length : this.list.querySelectorAll('li.' + dropDownBaseClasses.li).length;
|
|
727
730
|
var searchActiveCount = this.list.querySelectorAll('li.' + dropDownBaseClasses.selected).length;
|
|
728
731
|
if (this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy)) {
|
|
729
732
|
searchActiveCount = searchActiveCount - groupItemLength;
|
|
@@ -2112,7 +2115,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
2112
2115
|
}
|
|
2113
2116
|
var focusedLi = this.list ? this.list.querySelector('.e-item-focus') : null;
|
|
2114
2117
|
if (this.isDisabledElement(focusedLi)) {
|
|
2115
|
-
if (this.list.querySelectorAll('.e-list-item:not(.e-hide-listitem):not(.e-disabled)').length === 0) {
|
|
2118
|
+
if (this.list.querySelectorAll('.e-list-item:not(.e-hide-listitem):not(.e-disabled)').length === 0 || (this.keyCode === 38 && this.mode === 'CheckBox' && this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy) && focusedLi === this.list.querySelector('li.e-list-group-item'))) {
|
|
2116
2119
|
this.removeFocus();
|
|
2117
2120
|
return;
|
|
2118
2121
|
}
|
|
@@ -2518,9 +2521,17 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
2518
2521
|
MultiSelect.prototype.checkMaxSelection = function () {
|
|
2519
2522
|
var limit = this.value && this.value.length ? this.value.length : 0;
|
|
2520
2523
|
if (limit === this.maximumSelectionLength) {
|
|
2521
|
-
var
|
|
2524
|
+
var activeItems = this.list.querySelectorAll('li.'
|
|
2525
|
+
+ dropDownBaseClasses.li + '.e-active');
|
|
2526
|
+
removeClass(activeItems, 'e-disable');
|
|
2527
|
+
var inactiveItems = this.list.querySelectorAll('li.'
|
|
2522
2528
|
+ dropDownBaseClasses.li + ':not(.e-active)');
|
|
2523
|
-
addClass(
|
|
2529
|
+
addClass(inactiveItems, 'e-disable');
|
|
2530
|
+
}
|
|
2531
|
+
if (limit < this.maximumSelectionLength) {
|
|
2532
|
+
var collection = this.list.querySelectorAll('li.'
|
|
2533
|
+
+ dropDownBaseClasses.li);
|
|
2534
|
+
removeClass(collection, 'e-disable');
|
|
2524
2535
|
}
|
|
2525
2536
|
};
|
|
2526
2537
|
MultiSelect.prototype.dispatchSelect = function (value, eve, element, isNotTrigger, length) {
|
|
@@ -3076,7 +3087,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
3076
3087
|
if (this.mode === 'CheckBox') {
|
|
3077
3088
|
this.refreshPlaceHolder();
|
|
3078
3089
|
this.refreshInputHight();
|
|
3079
|
-
if (this.changeOnBlur && isClearAll && (isNullOrUndefined(this.value) || this.value.length === 0)) {
|
|
3090
|
+
if (!this.changeOnBlur && isClearAll && (isNullOrUndefined(this.value) || this.value.length === 0)) {
|
|
3080
3091
|
this.updateValueState(e, this.value, this.tempValues);
|
|
3081
3092
|
}
|
|
3082
3093
|
}
|
|
@@ -3897,17 +3908,19 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
3897
3908
|
};
|
|
3898
3909
|
MultiSelect.prototype.findGroupAttrtibutes = function (listElement, checked, unChecked, count, position) {
|
|
3899
3910
|
while (!listElement.classList.contains('e-list-group-item')) {
|
|
3900
|
-
if (
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
listElement.classList.contains('e-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3911
|
+
if (!(this.fields.disabled && this.isDisabledElement(listElement))) {
|
|
3912
|
+
if (listElement.classList.contains('e-list-icon')) {
|
|
3913
|
+
listElement = listElement.parentElement;
|
|
3914
|
+
}
|
|
3915
|
+
if (listElement.getElementsByClassName('e-frame')[0].classList.contains('e-check') &&
|
|
3916
|
+
listElement.classList.contains('e-list-item')) {
|
|
3917
|
+
checked++;
|
|
3918
|
+
}
|
|
3919
|
+
else if (listElement.classList.contains('e-list-item')) {
|
|
3920
|
+
unChecked++;
|
|
3921
|
+
}
|
|
3922
|
+
count++;
|
|
3909
3923
|
}
|
|
3910
|
-
count++;
|
|
3911
3924
|
listElement = position ? listElement.nextElementSibling : listElement.previousElementSibling;
|
|
3912
3925
|
if (listElement == null) {
|
|
3913
3926
|
break;
|
|
@@ -3916,7 +3929,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
3916
3929
|
return [checked, unChecked, count];
|
|
3917
3930
|
};
|
|
3918
3931
|
MultiSelect.prototype.updateCheckBox = function (groupHeader, checked, unChecked, count) {
|
|
3919
|
-
if (groupHeader === null) {
|
|
3932
|
+
if (groupHeader === null || (!isNullOrUndefined(this.fields.disabled) && count === 0)) {
|
|
3920
3933
|
return;
|
|
3921
3934
|
}
|
|
3922
3935
|
var checkBoxElement = groupHeader.getElementsByClassName('e-frame')[0];
|
|
@@ -3945,6 +3958,28 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
3945
3958
|
groupHeader.setAttribute('aria-selected', 'false');
|
|
3946
3959
|
}
|
|
3947
3960
|
};
|
|
3961
|
+
MultiSelect.prototype.disableGroupHeader = function () {
|
|
3962
|
+
var collection = this.list.querySelectorAll('li.e-list-group-item');
|
|
3963
|
+
if (collection) {
|
|
3964
|
+
for (var index = 0; index < collection.length; index++) {
|
|
3965
|
+
var isDisabled = true;
|
|
3966
|
+
var target = collection[index].nextElementSibling;
|
|
3967
|
+
while (!target.classList.contains('e-list-group-item')) {
|
|
3968
|
+
if (!this.isDisabledElement(target)) {
|
|
3969
|
+
isDisabled = false;
|
|
3970
|
+
break;
|
|
3971
|
+
}
|
|
3972
|
+
target = target.nextElementSibling;
|
|
3973
|
+
if (target == null) {
|
|
3974
|
+
break;
|
|
3975
|
+
}
|
|
3976
|
+
}
|
|
3977
|
+
if (isDisabled) {
|
|
3978
|
+
this.disableListItem(collection[index]);
|
|
3979
|
+
}
|
|
3980
|
+
}
|
|
3981
|
+
}
|
|
3982
|
+
};
|
|
3948
3983
|
MultiSelect.prototype.deselectHeader = function () {
|
|
3949
3984
|
var limit = this.value && this.value.length ? this.value.length : 0;
|
|
3950
3985
|
var collection = this.list.querySelectorAll('li.e-list-group-item:not(.e-active)');
|
|
@@ -4318,22 +4353,24 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4318
4353
|
return;
|
|
4319
4354
|
}
|
|
4320
4355
|
while (listElement.classList.contains('e-list-item')) {
|
|
4321
|
-
if (
|
|
4322
|
-
if (
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4356
|
+
if (!(this.fields.disabled && this.isDisabledElement(listElement))) {
|
|
4357
|
+
if (state) {
|
|
4358
|
+
if (!listElement.firstElementChild.lastElementChild.classList.contains('e-check')) {
|
|
4359
|
+
var selectionLimit = this.value && this.value.length ? this.value.length : 0;
|
|
4360
|
+
if (listElement.classList.contains('e-active')) {
|
|
4361
|
+
selectionLimit -= 1;
|
|
4362
|
+
}
|
|
4363
|
+
if (selectionLimit < this.maximumSelectionLength) {
|
|
4364
|
+
this.updateListSelection(listElement, event);
|
|
4365
|
+
}
|
|
4326
4366
|
}
|
|
4327
|
-
|
|
4367
|
+
}
|
|
4368
|
+
else {
|
|
4369
|
+
if (listElement.firstElementChild.lastElementChild.classList.contains('e-check')) {
|
|
4328
4370
|
this.updateListSelection(listElement, event);
|
|
4329
4371
|
}
|
|
4330
4372
|
}
|
|
4331
4373
|
}
|
|
4332
|
-
else {
|
|
4333
|
-
if (listElement.firstElementChild.lastElementChild.classList.contains('e-check')) {
|
|
4334
|
-
this.updateListSelection(listElement, event);
|
|
4335
|
-
}
|
|
4336
|
-
}
|
|
4337
4374
|
listElement = listElement.nextElementSibling;
|
|
4338
4375
|
if (listElement == null) {
|
|
4339
4376
|
break;
|
|
@@ -4636,7 +4673,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
4636
4673
|
}
|
|
4637
4674
|
if (this.mode === 'CheckBox') {
|
|
4638
4675
|
this.updateDelimView();
|
|
4639
|
-
if (!(isRemoveAll || this.isSelectAll) && this.isSelectAllTarget) {
|
|
4676
|
+
if ((!(isRemoveAll || this.isSelectAll) && this.isSelectAllTarget) || (this.isSelectAll && this.isSelectAllTarget)) {
|
|
4640
4677
|
this.updateDelimeter(this.delimiterChar, event);
|
|
4641
4678
|
}
|
|
4642
4679
|
this.refreshInputHight();
|
|
@@ -5195,7 +5232,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
5195
5232
|
* @returns {void}
|
|
5196
5233
|
*/
|
|
5197
5234
|
MultiSelect.prototype.render = function () {
|
|
5198
|
-
if (!isNullOrUndefined(this.value)) {
|
|
5235
|
+
if (!isNullOrUndefined(this.value) && this.value.length > 0) {
|
|
5199
5236
|
// eslint-disable-next-line
|
|
5200
5237
|
this.value = this.value.slice();
|
|
5201
5238
|
}
|
|
@@ -5592,6 +5629,9 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
|
5592
5629
|
this.removeDisabledItemsValue(this.value);
|
|
5593
5630
|
this.updateVal(this.value, oldValue, 'value');
|
|
5594
5631
|
}
|
|
5632
|
+
if (this.mode === 'CheckBox' && this.enableGroupCheckBox && !isNullOrUndefined(this.fields.groupBy)) {
|
|
5633
|
+
this.disableGroupHeader();
|
|
5634
|
+
}
|
|
5595
5635
|
}
|
|
5596
5636
|
}
|
|
5597
5637
|
}
|
package/tslint.json
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"rules": {
|
|
3
|
+
"chai-vague-errors": true,
|
|
4
|
+
"use-isnan": true,
|
|
5
|
+
"missing-jsdoc": true,
|
|
6
|
+
"missing-optional-annotation": true,
|
|
7
|
+
"no-backbone-get-set-outside-model": true,
|
|
8
|
+
"no-banned-terms": true,
|
|
9
|
+
"no-constant-condition": true,
|
|
10
|
+
"no-control-regex": true,
|
|
11
|
+
"no-cookies": true,
|
|
12
|
+
"no-delete-expression": true,
|
|
13
|
+
"no-document-write": true,
|
|
14
|
+
"no-document-domain": true,
|
|
15
|
+
"no-disable-auto-sanitization": true,
|
|
16
|
+
"no-duplicate-case": true,
|
|
17
|
+
"no-duplicate-parameter-names": true,
|
|
18
|
+
"no-empty-interfaces": true,
|
|
19
|
+
"no-exec-script": true,
|
|
20
|
+
"no-function-constructor-with-string-args": true,
|
|
21
|
+
"no-function-expression": true,
|
|
22
|
+
"no-invalid-regexp": true,
|
|
23
|
+
"no-for-in": true,
|
|
24
|
+
"member-access": true,
|
|
25
|
+
"no-multiline-string": true,
|
|
26
|
+
"no-multiple-var-decl": true,
|
|
27
|
+
"no-unnecessary-bind": true,
|
|
28
|
+
"no-unnecessary-semicolons": true,
|
|
29
|
+
"no-octal-literal": true,
|
|
30
|
+
"no-regex-spaces": true,
|
|
31
|
+
"no-sparse-arrays": true,
|
|
32
|
+
"no-string-based-set-immediate": true,
|
|
33
|
+
"no-string-based-set-interval": true,
|
|
34
|
+
"no-unused-imports": true,
|
|
35
|
+
"no-with-statement": true,
|
|
36
|
+
"prefer-array-literal": true,
|
|
37
|
+
"promise-must-complete": false,
|
|
38
|
+
"react-no-dangerous-html": true,
|
|
39
|
+
"use-named-parameter": true,
|
|
40
|
+
"valid-typeof": true,
|
|
41
|
+
"max-func-body-length": [true, 100, {
|
|
42
|
+
"ignore-parameters-to-function-regex": "describe"
|
|
43
|
+
}],
|
|
44
|
+
"class-name": true,
|
|
45
|
+
"curly": true,
|
|
46
|
+
"eofline": false,
|
|
47
|
+
"forin": true,
|
|
48
|
+
"indent": [
|
|
49
|
+
true,
|
|
50
|
+
"spaces"
|
|
51
|
+
],
|
|
52
|
+
"label-position": true,
|
|
53
|
+
"max-line-length": [true, 140],
|
|
54
|
+
"no-arg": true,
|
|
55
|
+
"no-console": [true,
|
|
56
|
+
"debug",
|
|
57
|
+
"info",
|
|
58
|
+
"log",
|
|
59
|
+
"time",
|
|
60
|
+
"timeEnd",
|
|
61
|
+
"trace"
|
|
62
|
+
],
|
|
63
|
+
"no-construct": true,
|
|
64
|
+
"no-parameter-properties": true,
|
|
65
|
+
"no-debugger": true,
|
|
66
|
+
"no-duplicate-variable": true,
|
|
67
|
+
"no-empty": true,
|
|
68
|
+
"no-eval": true,
|
|
69
|
+
"no-string-literal": true,
|
|
70
|
+
"no-switch-case-fall-through": true,
|
|
71
|
+
"trailing-comma": true,
|
|
72
|
+
"no-trailing-whitespace": true,
|
|
73
|
+
"no-unused-expression": true,
|
|
74
|
+
"no-use-before-declare": false,
|
|
75
|
+
"no-var-requires": true,
|
|
76
|
+
"one-line": [true,
|
|
77
|
+
"check-open-brace",
|
|
78
|
+
"check-catch",
|
|
79
|
+
"check-else",
|
|
80
|
+
"check-whitespace"
|
|
81
|
+
],
|
|
82
|
+
"no-any": true,
|
|
83
|
+
"no-conditional-assignment": true,
|
|
84
|
+
"no-angle-bracket-type-assertion": false,
|
|
85
|
+
"align": [true, "parameters", "arguments", "statements"],
|
|
86
|
+
"no-empty-line-after-opening-brace": false,
|
|
87
|
+
"typedef-whitespace": [false],
|
|
88
|
+
"ban": true,
|
|
89
|
+
"quotemark": [true, "single"],
|
|
90
|
+
"semicolon": true,
|
|
91
|
+
"triple-equals": [true, "allow-null-check"],
|
|
92
|
+
"typedef": [true,
|
|
93
|
+
"call-signature",
|
|
94
|
+
"parameter",
|
|
95
|
+
"property-declaration",
|
|
96
|
+
"variable-declaration",
|
|
97
|
+
"arrow-parameter",
|
|
98
|
+
"member-variable-declaration"],
|
|
99
|
+
"variable-name": true,
|
|
100
|
+
"whitespace": [true,
|
|
101
|
+
"check-branch",
|
|
102
|
+
"check-decl",
|
|
103
|
+
"check-operator",
|
|
104
|
+
"check-separator",
|
|
105
|
+
"check-type"
|
|
106
|
+
],
|
|
107
|
+
"jsdoc-format": true,
|
|
108
|
+
"no-var-keyword": true,
|
|
109
|
+
"radix": true
|
|
110
|
+
}
|
|
111
|
+
}
|