@syncfusion/ej2-dropdowns 19.4.50 → 19.4.55
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 +16 -0
- package/README.md +1 -1
- 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 +67 -30
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +68 -30
- 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/combo-box/combo-box.js +4 -1
- package/src/drop-down-base/drop-down-base.js +8 -6
- package/src/drop-down-tree/drop-down-tree.js +6 -14
- package/src/list-box/list-box.js +32 -0
- package/src/multi-select/multi-select.js +18 -9
- package/styles/bootstrap-dark.css +17 -5
- package/styles/bootstrap.css +17 -5
- package/styles/bootstrap4.css +17 -5
- package/styles/bootstrap5-dark.css +17 -5
- package/styles/bootstrap5.css +17 -5
- package/styles/fabric-dark.css +17 -5
- package/styles/fabric.css +17 -5
- package/styles/highcontrast-light.css +17 -5
- package/styles/highcontrast.css +17 -5
- package/styles/list-box/_layout.scss +12 -4
- package/styles/list-box/bootstrap-dark.css +9 -5
- package/styles/list-box/bootstrap.css +9 -5
- package/styles/list-box/bootstrap4.css +9 -5
- package/styles/list-box/bootstrap5-dark.css +9 -5
- package/styles/list-box/bootstrap5.css +9 -5
- package/styles/list-box/fabric-dark.css +9 -5
- package/styles/list-box/fabric.css +9 -5
- package/styles/list-box/highcontrast-light.css +9 -5
- package/styles/list-box/highcontrast.css +9 -5
- package/styles/list-box/material-dark.css +9 -5
- package/styles/list-box/material.css +9 -5
- package/styles/list-box/tailwind-dark.css +9 -5
- package/styles/list-box/tailwind.css +9 -5
- package/styles/material-dark.css +17 -5
- package/styles/material.css +17 -5
- package/styles/multi-select/_layout.scss +8 -0
- package/styles/multi-select/bootstrap-dark.css +8 -0
- package/styles/multi-select/bootstrap.css +8 -0
- package/styles/multi-select/bootstrap4.css +8 -0
- package/styles/multi-select/bootstrap5-dark.css +8 -0
- package/styles/multi-select/bootstrap5.css +8 -0
- package/styles/multi-select/fabric-dark.css +8 -0
- package/styles/multi-select/fabric.css +8 -0
- package/styles/multi-select/highcontrast-light.css +8 -0
- package/styles/multi-select/highcontrast.css +8 -0
- package/styles/multi-select/material-dark.css +8 -0
- package/styles/multi-select/material.css +8 -0
- package/styles/multi-select/tailwind-dark.css +8 -0
- package/styles/multi-select/tailwind.css +8 -0
- package/styles/tailwind-dark.css +17 -5
- package/styles/tailwind.css +17 -5
|
@@ -661,7 +661,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
661
661
|
}
|
|
662
662
|
_this.bindChildItems(localDataArgs.result, ulElement, fields);
|
|
663
663
|
setTimeout(function () {
|
|
664
|
-
if (_this.getModuleName() === 'multiselect' && _this.itemTemplate != null && (ulElement.childElementCount > 0 && ulElement.children[0].childElementCount > 0)) {
|
|
664
|
+
if (_this.getModuleName() === 'multiselect' && _this.itemTemplate != null && (ulElement.childElementCount > 0 && (ulElement.children[0].childElementCount > 0 || (_this.fields.groupBy && ulElement.children[1] && ulElement.children[1].childElementCount > 0)))) {
|
|
665
665
|
_this.updateDataList();
|
|
666
666
|
}
|
|
667
667
|
});
|
|
@@ -748,7 +748,6 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
748
748
|
if (this.isReact) {
|
|
749
749
|
this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);
|
|
750
750
|
}
|
|
751
|
-
this.list.innerHTML = '';
|
|
752
751
|
this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
|
|
753
752
|
if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
|
|
754
753
|
for (var i = 0; i < ulElement.childElementCount; i++) {
|
|
@@ -759,10 +758,13 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
759
758
|
}
|
|
760
759
|
}
|
|
761
760
|
}
|
|
762
|
-
this.list
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
761
|
+
if (!isNullOrUndefined(this.list)) {
|
|
762
|
+
this.list.innerHTML = '';
|
|
763
|
+
this.list.appendChild(ulElement);
|
|
764
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
765
|
+
this.ulElement = this.list.querySelector('ul');
|
|
766
|
+
this.postRender(this.list, list, this.bindEvent);
|
|
767
|
+
}
|
|
766
768
|
};
|
|
767
769
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
768
770
|
DropDownBase.prototype.postRender = function (listElement, list, bindEvent) {
|
|
@@ -5119,13 +5121,10 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5119
5121
|
var l10nLocale = { overflowCountTemplate: '+${count} more..', totalCountTemplate: '${count} selected' };
|
|
5120
5122
|
this.l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);
|
|
5121
5123
|
var remainContent = this.l10n.getConstant('overflowCountTemplate');
|
|
5124
|
+
var totalContent = this.l10n.getConstant('totalCountTemplate');
|
|
5122
5125
|
var remainElement = this.createElement('span', { className: REMAIN_WRAPPER });
|
|
5123
|
-
// eslint-disable-next-line
|
|
5124
|
-
var compiledString = compile(remainContent);
|
|
5125
|
-
// eslint-disable-next-line
|
|
5126
|
-
var totalCompiledString = compile(this.l10n.getConstant('totalCountTemplate'));
|
|
5127
|
-
remainElement.appendChild(compiledString({ 'count': this.value.length }, this, 'overflowCountTemplate', null, !this.isStringTemplate)[0]);
|
|
5128
5126
|
this.overFlowWrapper.appendChild(remainElement);
|
|
5127
|
+
remainElement.innerText = remainContent.replace('${count}', this.value.length.toString());
|
|
5129
5128
|
var remainSize = remainElement.offsetWidth;
|
|
5130
5129
|
remove(remainElement);
|
|
5131
5130
|
if (this.showDropDownIcon) {
|
|
@@ -5207,7 +5206,7 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5207
5206
|
}
|
|
5208
5207
|
}
|
|
5209
5208
|
if (remaining > 0) {
|
|
5210
|
-
this.overFlowWrapper.appendChild(this.updateRemainTemplate(remainElement, remaining,
|
|
5209
|
+
this.overFlowWrapper.appendChild(this.updateRemainTemplate(remainElement, remaining, remainContent, totalContent));
|
|
5211
5210
|
}
|
|
5212
5211
|
if (this.mode === 'Box' && !this.overFlowWrapper.classList.contains(TOTAL_COUNT_WRAPPER)) {
|
|
5213
5212
|
addClass([remainElement], REMAIN_COUNT);
|
|
@@ -5219,19 +5218,14 @@ var DropDownTree = /** @__PURE__ @class */ (function (_super) {
|
|
|
5219
5218
|
}
|
|
5220
5219
|
this.updateDelimMode();
|
|
5221
5220
|
};
|
|
5222
|
-
DropDownTree.prototype.updateRemainTemplate = function (remainElement, remaining,
|
|
5223
|
-
// eslint-disable-next-line
|
|
5224
|
-
compiledString,
|
|
5225
|
-
// eslint-disable-next-line
|
|
5226
|
-
totalCompiledString) {
|
|
5221
|
+
DropDownTree.prototype.updateRemainTemplate = function (remainElement, remaining, remainContent, totalContent) {
|
|
5227
5222
|
if (this.overFlowWrapper.firstChild && this.overFlowWrapper.firstChild.nodeType === 3 &&
|
|
5228
5223
|
this.overFlowWrapper.firstChild.nodeValue === '') {
|
|
5229
5224
|
this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild);
|
|
5230
5225
|
}
|
|
5231
5226
|
remainElement.innerHTML = '';
|
|
5232
|
-
remainElement.
|
|
5233
|
-
|
|
5234
|
-
totalCompiledString({ 'count': remaining }, this, 'totalCountTemplate', null, !this.isStringTemplate)[0]);
|
|
5227
|
+
remainElement.innerText = (this.overFlowWrapper.firstChild && (this.overFlowWrapper.firstChild.nodeType === 3 || this.mode === 'Box')) ?
|
|
5228
|
+
remainContent.replace('${count}', remaining.toString()) : totalContent.replace('${count}', remaining.toString());
|
|
5235
5229
|
if (this.overFlowWrapper.firstChild && (this.overFlowWrapper.firstChild.nodeType === 3 || this.mode === 'Box')) {
|
|
5236
5230
|
removeClass([this.overFlowWrapper], TOTAL_COUNT_WRAPPER);
|
|
5237
5231
|
}
|
|
@@ -7592,12 +7586,15 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7592
7586
|
};
|
|
7593
7587
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7594
7588
|
ComboBox.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
|
|
7589
|
+
var _this = this;
|
|
7595
7590
|
_super.prototype.onActionComplete.call(this, ulElement, list, e);
|
|
7596
7591
|
if (this.isSelectCustom) {
|
|
7597
7592
|
this.removeSelection();
|
|
7598
7593
|
}
|
|
7599
7594
|
if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped) {
|
|
7600
|
-
|
|
7595
|
+
setTimeout(function () {
|
|
7596
|
+
_this.inlineSearch();
|
|
7597
|
+
});
|
|
7601
7598
|
}
|
|
7602
7599
|
};
|
|
7603
7600
|
ComboBox.prototype.getFocusElement = function () {
|
|
@@ -9103,7 +9100,9 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9103
9100
|
return ariaAttributes;
|
|
9104
9101
|
};
|
|
9105
9102
|
MultiSelect.prototype.updateListARIA = function () {
|
|
9106
|
-
|
|
9103
|
+
if (!isNullOrUndefined(this.ulElement)) {
|
|
9104
|
+
attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
9105
|
+
}
|
|
9107
9106
|
var disableStatus = (this.inputElement.disabled) ? true : false;
|
|
9108
9107
|
attributes(this.inputElement, this.getAriaAttributes());
|
|
9109
9108
|
if (disableStatus) {
|
|
@@ -9263,7 +9262,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9263
9262
|
addClass([listEle[0]], dropDownBaseClasses.focus);
|
|
9264
9263
|
}
|
|
9265
9264
|
else {
|
|
9266
|
-
this.ulElement = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;
|
|
9265
|
+
//EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
|
|
9267
9266
|
if (!(this.list && this.list.querySelectorAll('.' + dropDownBaseClasses.li).length > 0)) {
|
|
9268
9267
|
this.l10nUpdate();
|
|
9269
9268
|
addClass([this.list], dropDownBaseClasses.noData);
|
|
@@ -11237,8 +11236,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11237
11236
|
}
|
|
11238
11237
|
};
|
|
11239
11238
|
MultiSelect.prototype.updateDataList = function () {
|
|
11240
|
-
if (this.mainList && this.ulElement
|
|
11241
|
-
|
|
11239
|
+
if (this.mainList && this.ulElement) {
|
|
11240
|
+
var isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
|
|
11241
|
+
var isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
|
|
11242
|
+
var isAngularTemplateUpdate = this.itemTemplate && this.ulElement.childElementCount > 0 && (this.ulElement.children[0].childElementCount > 0 || (this.fields.groupBy && this.ulElement.children[1] && this.ulElement.children[1].childElementCount > 0));
|
|
11243
|
+
if (isDynamicGroupItemUpdate || isReactTemplateUpdate || isAngularTemplateUpdate) {
|
|
11244
|
+
this.mainList = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;
|
|
11245
|
+
}
|
|
11242
11246
|
}
|
|
11243
11247
|
};
|
|
11244
11248
|
MultiSelect.prototype.isValidLI = function (li) {
|
|
@@ -11587,11 +11591,13 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11587
11591
|
}
|
|
11588
11592
|
};
|
|
11589
11593
|
MultiSelect.prototype.wireListEvents = function () {
|
|
11590
|
-
|
|
11591
|
-
|
|
11592
|
-
|
|
11593
|
-
|
|
11594
|
-
|
|
11594
|
+
if (!isNullOrUndefined(this.list)) {
|
|
11595
|
+
EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
|
|
11596
|
+
EventHandler.add(this.list, 'mousedown', this.onListMouseDown, this);
|
|
11597
|
+
EventHandler.add(this.list, 'mouseup', this.onMouseClick, this);
|
|
11598
|
+
EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
|
|
11599
|
+
EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
|
|
11600
|
+
}
|
|
11595
11601
|
};
|
|
11596
11602
|
MultiSelect.prototype.unwireListEvents = function () {
|
|
11597
11603
|
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
@@ -13853,6 +13859,38 @@ var ListBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
13853
13859
|
});
|
|
13854
13860
|
};
|
|
13855
13861
|
ListBox.prototype.triggerDrag = function (args) {
|
|
13862
|
+
var scrollParent;
|
|
13863
|
+
var boundRect;
|
|
13864
|
+
var scrollMoved = 36;
|
|
13865
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13866
|
+
var event = args.event;
|
|
13867
|
+
var wrapper;
|
|
13868
|
+
if (args.target && (args.target.classList.contains("e-listbox-wrapper") || args.target.classList.contains("e-list-item")
|
|
13869
|
+
|| args.target.classList.contains("e-filter-parent") || args.target.classList.contains("e-input-group"))) {
|
|
13870
|
+
if (args.target.classList.contains("e-list-item") || args.target.classList.contains("e-filter-parent")
|
|
13871
|
+
|| args.target.classList.contains("e-input-group")) {
|
|
13872
|
+
wrapper = args.target.closest('.e-listbox-wrapper');
|
|
13873
|
+
}
|
|
13874
|
+
else {
|
|
13875
|
+
wrapper = args.target;
|
|
13876
|
+
}
|
|
13877
|
+
if (this.allowFiltering) {
|
|
13878
|
+
scrollParent = wrapper.querySelector('.e-list-parent');
|
|
13879
|
+
}
|
|
13880
|
+
else {
|
|
13881
|
+
scrollParent = wrapper;
|
|
13882
|
+
}
|
|
13883
|
+
boundRect = scrollParent.getBoundingClientRect();
|
|
13884
|
+
if ((boundRect.y + scrollParent.offsetHeight) - (event.pageY + scrollMoved) < 1) {
|
|
13885
|
+
scrollParent.scrollTop = scrollParent.scrollTop + 10;
|
|
13886
|
+
}
|
|
13887
|
+
else if ((event.pageY - scrollMoved) - boundRect.y < 1) {
|
|
13888
|
+
scrollParent.scrollTop = scrollParent.scrollTop - 10;
|
|
13889
|
+
}
|
|
13890
|
+
}
|
|
13891
|
+
if (args.target === null) {
|
|
13892
|
+
return;
|
|
13893
|
+
}
|
|
13856
13894
|
this.trigger('drag', this.getDragArgs(args));
|
|
13857
13895
|
var listObj = this.getComponent(args.target);
|
|
13858
13896
|
if (listObj && listObj.listData.length === 0) {
|