@syncfusion/ej2-dropdowns 19.3.45 → 19.3.53
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 +34 -0
- 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 +50 -29
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +50 -29
- 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 +11 -11
- package/src/drop-down-tree/drop-down-tree.d.ts +1 -0
- package/src/drop-down-tree/drop-down-tree.js +18 -10
- package/src/multi-select/checkbox-selection.js +1 -1
- package/src/multi-select/multi-select-model.d.ts +9 -0
- package/src/multi-select/multi-select.d.ts +8 -0
- package/src/multi-select/multi-select.js +31 -18
- package/styles/auto-complete/bootstrap5-dark.css +1 -0
- package/styles/auto-complete/bootstrap5.css +1 -0
- package/styles/bootstrap5-dark.css +1 -0
- package/styles/bootstrap5.css +1 -0
- package/styles/combo-box/bootstrap5-dark.css +1 -0
- package/styles/combo-box/bootstrap5.css +1 -0
- package/styles/drop-down-list/_bootstrap5-definition.scss +1 -0
- package/styles/drop-down-list/bootstrap5-dark.css +1 -0
- package/styles/drop-down-list/bootstrap5.css +1 -0
- package/styles/drop-down-tree/_layout.scss +461 -1
- package/styles/drop-down-tree/_material-dark-definition.scss +6 -1
- package/styles/drop-down-tree/_material-definition.scss +6 -1
- package/styles/drop-down-tree/_theme.scss +8 -0
- package/styles/drop-down-tree/material-dark.css +402 -1
- package/styles/drop-down-tree/material.css +402 -1
- package/styles/material-dark.css +402 -1
- package/styles/material.css +402 -1
|
@@ -4319,6 +4319,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
4319
4319
|
// eslint-disable-next-line
|
|
4320
4320
|
_this.selectedData = [];
|
|
4321
4321
|
_this.filterDelayTime = 300;
|
|
4322
|
+
_this.isClicked = false;
|
|
4322
4323
|
return _this;
|
|
4323
4324
|
}
|
|
4324
4325
|
/**
|
|
@@ -4444,9 +4445,9 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
4444
4445
|
this.createClearIcon();
|
|
4445
4446
|
this.inputWrapper.classList.add(DROPDOWNTREE);
|
|
4446
4447
|
this.setElementWidth(this.width);
|
|
4447
|
-
this.setAttributes();
|
|
4448
4448
|
this.updateDataAttribute();
|
|
4449
4449
|
this.setHTMLAttributes();
|
|
4450
|
+
this.setAttributes();
|
|
4450
4451
|
this.popupDiv = this.createElement('div', { className: CONTENT, attrs: { 'tabindex': '0' } });
|
|
4451
4452
|
this.popupDiv.classList.add(DROPDOWN);
|
|
4452
4453
|
this.tree = this.createElement('div', { id: this.element.id + '_tree' });
|
|
@@ -4734,9 +4735,6 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
4734
4735
|
this.isClearButtonClick = false;
|
|
4735
4736
|
return;
|
|
4736
4737
|
}
|
|
4737
|
-
if (!this.wrapText && e.target.classList.contains(CHIP_CLOSE)) {
|
|
4738
|
-
this.removeChip(e);
|
|
4739
|
-
}
|
|
4740
4738
|
if (this.isPopupOpen) {
|
|
4741
4739
|
this.hidePopup();
|
|
4742
4740
|
}
|
|
@@ -4807,7 +4805,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
4807
4805
|
this.trigger('blur');
|
|
4808
4806
|
};
|
|
4809
4807
|
DropDownTree.prototype.updateView = function () {
|
|
4810
|
-
if ((!this.showCheckBox && !this.allowMultiSelection) || this.mode === 'Custom') {
|
|
4808
|
+
if ((!this.showCheckBox && !this.allowMultiSelection) || this.mode === 'Custom' || this.inputFocus) {
|
|
4811
4809
|
return;
|
|
4812
4810
|
}
|
|
4813
4811
|
if (this.mode !== 'Box') {
|
|
@@ -4968,11 +4966,18 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
4968
4966
|
switch (e.action) {
|
|
4969
4967
|
case 'escape':
|
|
4970
4968
|
case 'altUp':
|
|
4969
|
+
if (_this.isPopupOpen) {
|
|
4970
|
+
_this.hidePopup();
|
|
4971
|
+
}
|
|
4972
|
+
break;
|
|
4971
4973
|
case 'shiftTab':
|
|
4972
4974
|
case 'tab':
|
|
4973
4975
|
if (_this.isPopupOpen) {
|
|
4974
4976
|
_this.hidePopup();
|
|
4975
4977
|
}
|
|
4978
|
+
if (_this.inputFocus) {
|
|
4979
|
+
_this.onFocusOut();
|
|
4980
|
+
}
|
|
4976
4981
|
break;
|
|
4977
4982
|
case 'altDown':
|
|
4978
4983
|
if (!_this.isPopupOpen) {
|
|
@@ -5242,10 +5247,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5242
5247
|
this.inputWrapper.insertBefore(this.chipWrapper, this.hiddenElement);
|
|
5243
5248
|
addClass([this.inputWrapper], SHOW_CHIP);
|
|
5244
5249
|
var isValid = this.getValidMode();
|
|
5245
|
-
if (isValid && this.value !== null) {
|
|
5250
|
+
if (isValid && this.value !== null && (this.value && this.value.length !== 0)) {
|
|
5246
5251
|
addClass([this.inputEle], CHIP_INPUT);
|
|
5247
5252
|
}
|
|
5248
|
-
else if (this.value === null) {
|
|
5253
|
+
else if (this.value === null || (this.value && this.value.length === 0)) {
|
|
5249
5254
|
addClass([this.chipWrapper], HIDEICON);
|
|
5250
5255
|
}
|
|
5251
5256
|
}
|
|
@@ -5286,8 +5291,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5286
5291
|
}
|
|
5287
5292
|
this.checkWrapper = closest(target, '.' + CHECKBOXWRAP);
|
|
5288
5293
|
if (!isNullOrUndefined(this.checkWrapper)) {
|
|
5294
|
+
this.isClicked = true;
|
|
5289
5295
|
var checkElement = select('.' + CHECKBOXFRAME, this.checkWrapper);
|
|
5290
5296
|
this.changeState(this.checkWrapper, checkElement.classList.contains(CHECK) ? 'uncheck' : 'check', e);
|
|
5297
|
+
this.isClicked = false;
|
|
5291
5298
|
}
|
|
5292
5299
|
e.preventDefault();
|
|
5293
5300
|
};
|
|
@@ -5343,7 +5350,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5343
5350
|
}
|
|
5344
5351
|
};
|
|
5345
5352
|
DropDownTree.prototype.setAttributes = function () {
|
|
5346
|
-
this.
|
|
5353
|
+
this.inputEle.setAttribute('tabindex', '-1');
|
|
5347
5354
|
var id = this.element.getAttribute('id');
|
|
5348
5355
|
this.hiddenElement.id = id + '_hidden';
|
|
5349
5356
|
this.inputWrapper.setAttribute('tabindex', '0');
|
|
@@ -5519,7 +5526,6 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5519
5526
|
else {
|
|
5520
5527
|
if (this.showCheckBox) {
|
|
5521
5528
|
this.treeObj.checkedNodes = this.value.slice();
|
|
5522
|
-
setValue('selectedNodes', [], this.treeObj);
|
|
5523
5529
|
this.treeObj.dataBind();
|
|
5524
5530
|
this.setMultiSelect();
|
|
5525
5531
|
}
|
|
@@ -5987,7 +5993,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5987
5993
|
}
|
|
5988
5994
|
var eventArgs = {
|
|
5989
5995
|
action: this.showCheckBox ? state : args.action,
|
|
5990
|
-
isInteracted: args.isInteracted,
|
|
5996
|
+
isInteracted: this.isClicked ? true : args.isInteracted,
|
|
5991
5997
|
item: args.node,
|
|
5992
5998
|
itemData: this.showCheckBox ? checkData[0] : selectData
|
|
5993
5999
|
};
|
|
@@ -6058,6 +6064,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6058
6064
|
}
|
|
6059
6065
|
var target = args.event.target;
|
|
6060
6066
|
if ((target.classList.contains('e-fullrow') || target.classList.contains('e-list-text')) && this.showCheckBox) {
|
|
6067
|
+
this.isClicked = true;
|
|
6061
6068
|
// eslint-disable-next-line
|
|
6062
6069
|
var getNodeDetails = this.treeObj.getNode(args.node);
|
|
6063
6070
|
if (getNodeDetails.isChecked === 'true') {
|
|
@@ -6066,6 +6073,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
6066
6073
|
else {
|
|
6067
6074
|
this.treeObj.checkAll([args.node]);
|
|
6068
6075
|
}
|
|
6076
|
+
this.isClicked = false;
|
|
6069
6077
|
this.setMultiSelect();
|
|
6070
6078
|
this.ensurePlaceHolder();
|
|
6071
6079
|
}
|
|
@@ -9508,6 +9516,18 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9508
9516
|
}
|
|
9509
9517
|
this.inputFocus = false;
|
|
9510
9518
|
this.overAllWrapper.classList.remove(FOCUS);
|
|
9519
|
+
if (this.addTagOnBlur) {
|
|
9520
|
+
var dataChecks = this.getValueByText(this.inputElement.value, this.ignoreCase, this.ignoreAccent);
|
|
9521
|
+
var listLiElement = this.findListElement(this.list, 'li', 'data-value', dataChecks);
|
|
9522
|
+
var className = this.hideSelectedItem ? HIDE_LIST : dropDownBaseClasses.selected;
|
|
9523
|
+
var allowChipAddition = (listLiElement && !listLiElement.classList.contains(className)) ? true : false;
|
|
9524
|
+
if (allowChipAddition) {
|
|
9525
|
+
this.updateListSelection(listLiElement, eve);
|
|
9526
|
+
if (this.mode === 'Delimiter') {
|
|
9527
|
+
this.updateDelimeter(this.delimiterChar);
|
|
9528
|
+
}
|
|
9529
|
+
}
|
|
9530
|
+
}
|
|
9511
9531
|
this.refreshListItems(null);
|
|
9512
9532
|
if (this.mode !== 'Box' && this.mode !== 'CheckBox') {
|
|
9513
9533
|
this.updateDelimView();
|
|
@@ -11081,6 +11101,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11081
11101
|
setValue(this.fields.value, value, newValue);
|
|
11082
11102
|
var noDataEle = this.popupWrapper.querySelector('.' + dropDownBaseClasses.noData);
|
|
11083
11103
|
this.addItem(newValue, indexItem);
|
|
11104
|
+
element = element ? element : this.findListElement(this.hideSelectedItem ? this.ulElement : this.list, 'li', 'data-value', value);
|
|
11084
11105
|
if (this.popupWrapper.contains(noDataEle)) {
|
|
11085
11106
|
this.list.setAttribute('style', noDataEle.getAttribute('style'));
|
|
11086
11107
|
this.popupWrapper.replaceChild(this.list, noDataEle);
|
|
@@ -11129,6 +11150,10 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11129
11150
|
this.popupObj = null;
|
|
11130
11151
|
this.renderPopup();
|
|
11131
11152
|
}
|
|
11153
|
+
else if (this.allowCustomValue) {
|
|
11154
|
+
this.list = list;
|
|
11155
|
+
this.mainList = this.ulElement = list.querySelector('ul');
|
|
11156
|
+
}
|
|
11132
11157
|
};
|
|
11133
11158
|
MultiSelect.prototype.updateDataList = function () {
|
|
11134
11159
|
if (this.mainList && this.ulElement && this.mainList.childElementCount < this.ulElement.childElementCount) {
|
|
@@ -11609,16 +11634,12 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11609
11634
|
l10n = new L10n('dropdowns', l10nLocale, this.locale);
|
|
11610
11635
|
}
|
|
11611
11636
|
var remainContent = l10n.getConstant('overflowCountTemplate');
|
|
11637
|
+
var totalContent = l10n.getConstant('totalCountTemplate');
|
|
11612
11638
|
var raminElement = this.createElement('span', {
|
|
11613
11639
|
className: REMAIN_WRAPPER$1
|
|
11614
11640
|
});
|
|
11615
|
-
var
|
|
11616
|
-
|
|
11617
|
-
// eslint-disable-next-line
|
|
11618
|
-
var remainCompildTemp = compiledString({ 'count': this.value.length }, this, 'overflowCountTemplate', null, !this.isStringTemplate, null, raminElement);
|
|
11619
|
-
if (remainCompildTemp && remainCompildTemp.length > 0) {
|
|
11620
|
-
raminElement.appendChild(remainCompildTemp[0]);
|
|
11621
|
-
}
|
|
11641
|
+
var remainCompildTemp = remainContent.replace('${count}', this.value.length.toString());
|
|
11642
|
+
raminElement.innerText = remainCompildTemp;
|
|
11622
11643
|
this.viewWrapper.appendChild(raminElement);
|
|
11623
11644
|
this.renderReactTemplates();
|
|
11624
11645
|
var remainSize = raminElement.offsetWidth;
|
|
@@ -11670,9 +11691,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11670
11691
|
}
|
|
11671
11692
|
if (remaining > 0) {
|
|
11672
11693
|
var totalWidth = overAllContainer - downIconWidth - this.clearIconWidth;
|
|
11673
|
-
this.viewWrapper.appendChild(this.updateRemainTemplate(raminElement, this.viewWrapper, remaining,
|
|
11694
|
+
this.viewWrapper.appendChild(this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, remainContent, totalContent, totalWidth));
|
|
11674
11695
|
this.updateRemainWidth(this.viewWrapper, totalWidth);
|
|
11675
|
-
this.updateRemainingText(raminElement, downIconWidth, remaining,
|
|
11696
|
+
this.updateRemainingText(raminElement, downIconWidth, remaining, remainContent, totalContent);
|
|
11676
11697
|
}
|
|
11677
11698
|
}
|
|
11678
11699
|
else {
|
|
@@ -11692,17 +11713,14 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11692
11713
|
viewWrapper.style.width = totalWidth + 'px';
|
|
11693
11714
|
}
|
|
11694
11715
|
};
|
|
11695
|
-
MultiSelect.prototype.updateRemainTemplate = function (raminElement, viewWrapper, remaining,
|
|
11716
|
+
MultiSelect.prototype.updateRemainTemplate = function (raminElement, viewWrapper, remaining, remainContent, totalContent, totalWidth) {
|
|
11696
11717
|
if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3 && viewWrapper.firstChild.nodeValue === '') {
|
|
11697
11718
|
viewWrapper.removeChild(viewWrapper.firstChild);
|
|
11698
11719
|
}
|
|
11699
11720
|
raminElement.innerHTML = '';
|
|
11700
|
-
|
|
11701
|
-
var
|
|
11702
|
-
|
|
11703
|
-
var totalTemp = totalCompiledString({ 'count': remaining }, this, 'totalCountTemplate', null, !this.isStringTemplate, null, raminElement);
|
|
11704
|
-
raminElement.appendChild((viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ?
|
|
11705
|
-
remainTemp && remainTemp[0] : totalTemp && totalTemp[0]);
|
|
11721
|
+
var remainTemp = remainContent.replace('${count}', remaining.toString());
|
|
11722
|
+
var totalTemp = totalContent.replace('${count}', remaining.toString());
|
|
11723
|
+
raminElement.innerText = (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) ? remainTemp : totalTemp;
|
|
11706
11724
|
if (viewWrapper.firstChild && viewWrapper.firstChild.nodeType === 3) {
|
|
11707
11725
|
viewWrapper.classList.remove(TOTAL_COUNT_WRAPPER$1);
|
|
11708
11726
|
}
|
|
@@ -11712,7 +11730,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11712
11730
|
}
|
|
11713
11731
|
return raminElement;
|
|
11714
11732
|
};
|
|
11715
|
-
MultiSelect.prototype.updateRemainingText = function (raminElement, downIconWidth, remaining,
|
|
11733
|
+
MultiSelect.prototype.updateRemainingText = function (raminElement, downIconWidth, remaining, remainContent, totalContent) {
|
|
11716
11734
|
var overAllContainer = this.componentWrapper.offsetWidth -
|
|
11717
11735
|
parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft, 10) -
|
|
11718
11736
|
parseInt(window.getComputedStyle(this.componentWrapper).paddingRight, 10);
|
|
@@ -11731,7 +11749,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11731
11749
|
wrapperleng = this.viewWrapper.offsetWidth;
|
|
11732
11750
|
}
|
|
11733
11751
|
var totalWidth = overAllContainer - downIconWidth;
|
|
11734
|
-
this.updateRemainTemplate(raminElement, this.viewWrapper, remaining,
|
|
11752
|
+
this.updateRemainTemplate(raminElement, this.viewWrapper, remaining, remainContent, totalContent, totalWidth);
|
|
11735
11753
|
}
|
|
11736
11754
|
};
|
|
11737
11755
|
MultiSelect.prototype.getOverflowVal = function (index) {
|
|
@@ -12737,6 +12755,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12737
12755
|
__decorate$5([
|
|
12738
12756
|
Property(true)
|
|
12739
12757
|
], MultiSelect.prototype, "openOnClick", void 0);
|
|
12758
|
+
__decorate$5([
|
|
12759
|
+
Property(false)
|
|
12760
|
+
], MultiSelect.prototype, "addTagOnBlur", void 0);
|
|
12740
12761
|
__decorate$5([
|
|
12741
12762
|
Event()
|
|
12742
12763
|
], MultiSelect.prototype, "change", void 0);
|
|
@@ -12930,7 +12951,7 @@ var CheckBoxSelection = /** @__PURE__ @class */ (function () {
|
|
|
12930
12951
|
}
|
|
12931
12952
|
if (this.parent.list.classList.contains('e-nodata') || (this.parent.listData && this.parent.listData.length <= 1 &&
|
|
12932
12953
|
!(this.parent.isDynamicDataChange)) || (this.parent.isDynamicDataChange &&
|
|
12933
|
-
|
|
12954
|
+
this.parent.listData && this.parent.listData.length <= 1)) {
|
|
12934
12955
|
this.checkAllParent.style.display = 'none';
|
|
12935
12956
|
}
|
|
12936
12957
|
else {
|