@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
|
@@ -637,7 +637,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
637
637
|
}
|
|
638
638
|
this.bindChildItems(localDataArgs.result, ulElement, fields);
|
|
639
639
|
setTimeout(() => {
|
|
640
|
-
if (this.getModuleName() === 'multiselect' && this.itemTemplate != null && (ulElement.childElementCount > 0 && ulElement.children[0].childElementCount > 0)) {
|
|
640
|
+
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)))) {
|
|
641
641
|
this.updateDataList();
|
|
642
642
|
}
|
|
643
643
|
});
|
|
@@ -723,7 +723,6 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
723
723
|
if (this.isReact) {
|
|
724
724
|
this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);
|
|
725
725
|
}
|
|
726
|
-
this.list.innerHTML = '';
|
|
727
726
|
this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
|
|
728
727
|
if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
|
|
729
728
|
for (let i = 0; i < ulElement.childElementCount; i++) {
|
|
@@ -734,10 +733,13 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
734
733
|
}
|
|
735
734
|
}
|
|
736
735
|
}
|
|
737
|
-
this.list
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
736
|
+
if (!isNullOrUndefined(this.list)) {
|
|
737
|
+
this.list.innerHTML = '';
|
|
738
|
+
this.list.appendChild(ulElement);
|
|
739
|
+
this.liCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
740
|
+
this.ulElement = this.list.querySelector('ul');
|
|
741
|
+
this.postRender(this.list, list, this.bindEvent);
|
|
742
|
+
}
|
|
741
743
|
}
|
|
742
744
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
743
745
|
postRender(listElement, list, bindEvent) {
|
|
@@ -5024,13 +5026,10 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5024
5026
|
const l10nLocale = { overflowCountTemplate: '+${count} more..', totalCountTemplate: '${count} selected' };
|
|
5025
5027
|
this.l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);
|
|
5026
5028
|
const remainContent = this.l10n.getConstant('overflowCountTemplate');
|
|
5029
|
+
const totalContent = this.l10n.getConstant('totalCountTemplate');
|
|
5027
5030
|
const remainElement = this.createElement('span', { className: REMAIN_WRAPPER });
|
|
5028
|
-
// eslint-disable-next-line
|
|
5029
|
-
const compiledString = compile(remainContent);
|
|
5030
|
-
// eslint-disable-next-line
|
|
5031
|
-
const totalCompiledString = compile(this.l10n.getConstant('totalCountTemplate'));
|
|
5032
|
-
remainElement.appendChild(compiledString({ 'count': this.value.length }, this, 'overflowCountTemplate', null, !this.isStringTemplate)[0]);
|
|
5033
5031
|
this.overFlowWrapper.appendChild(remainElement);
|
|
5032
|
+
remainElement.innerText = remainContent.replace('${count}', this.value.length.toString());
|
|
5034
5033
|
const remainSize = remainElement.offsetWidth;
|
|
5035
5034
|
remove(remainElement);
|
|
5036
5035
|
if (this.showDropDownIcon) {
|
|
@@ -5112,7 +5111,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5112
5111
|
}
|
|
5113
5112
|
}
|
|
5114
5113
|
if (remaining > 0) {
|
|
5115
|
-
this.overFlowWrapper.appendChild(this.updateRemainTemplate(remainElement, remaining,
|
|
5114
|
+
this.overFlowWrapper.appendChild(this.updateRemainTemplate(remainElement, remaining, remainContent, totalContent));
|
|
5116
5115
|
}
|
|
5117
5116
|
if (this.mode === 'Box' && !this.overFlowWrapper.classList.contains(TOTAL_COUNT_WRAPPER)) {
|
|
5118
5117
|
addClass([remainElement], REMAIN_COUNT);
|
|
@@ -5124,19 +5123,14 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5124
5123
|
}
|
|
5125
5124
|
this.updateDelimMode();
|
|
5126
5125
|
}
|
|
5127
|
-
updateRemainTemplate(remainElement, remaining,
|
|
5128
|
-
// eslint-disable-next-line
|
|
5129
|
-
compiledString,
|
|
5130
|
-
// eslint-disable-next-line
|
|
5131
|
-
totalCompiledString) {
|
|
5126
|
+
updateRemainTemplate(remainElement, remaining, remainContent, totalContent) {
|
|
5132
5127
|
if (this.overFlowWrapper.firstChild && this.overFlowWrapper.firstChild.nodeType === 3 &&
|
|
5133
5128
|
this.overFlowWrapper.firstChild.nodeValue === '') {
|
|
5134
5129
|
this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild);
|
|
5135
5130
|
}
|
|
5136
5131
|
remainElement.innerHTML = '';
|
|
5137
|
-
remainElement.
|
|
5138
|
-
|
|
5139
|
-
totalCompiledString({ 'count': remaining }, this, 'totalCountTemplate', null, !this.isStringTemplate)[0]);
|
|
5132
|
+
remainElement.innerText = (this.overFlowWrapper.firstChild && (this.overFlowWrapper.firstChild.nodeType === 3 || this.mode === 'Box')) ?
|
|
5133
|
+
remainContent.replace('${count}', remaining.toString()) : totalContent.replace('${count}', remaining.toString());
|
|
5140
5134
|
if (this.overFlowWrapper.firstChild && (this.overFlowWrapper.firstChild.nodeType === 3 || this.mode === 'Box')) {
|
|
5141
5135
|
removeClass([this.overFlowWrapper], TOTAL_COUNT_WRAPPER);
|
|
5142
5136
|
}
|
|
@@ -7481,7 +7475,9 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7481
7475
|
this.removeSelection();
|
|
7482
7476
|
}
|
|
7483
7477
|
if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped) {
|
|
7484
|
-
|
|
7478
|
+
setTimeout(() => {
|
|
7479
|
+
this.inlineSearch();
|
|
7480
|
+
});
|
|
7485
7481
|
}
|
|
7486
7482
|
}
|
|
7487
7483
|
getFocusElement() {
|
|
@@ -8948,7 +8944,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8948
8944
|
return ariaAttributes;
|
|
8949
8945
|
}
|
|
8950
8946
|
updateListARIA() {
|
|
8951
|
-
|
|
8947
|
+
if (!isNullOrUndefined(this.ulElement)) {
|
|
8948
|
+
attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
8949
|
+
}
|
|
8952
8950
|
const disableStatus = (this.inputElement.disabled) ? true : false;
|
|
8953
8951
|
attributes(this.inputElement, this.getAriaAttributes());
|
|
8954
8952
|
if (disableStatus) {
|
|
@@ -9108,7 +9106,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9108
9106
|
addClass([listEle[0]], dropDownBaseClasses.focus);
|
|
9109
9107
|
}
|
|
9110
9108
|
else {
|
|
9111
|
-
this.ulElement = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;
|
|
9109
|
+
//EJ2-57588 - for this task, we prevent the ul element cloning ( this.ulElement = this.ulElement.cloneNode ? <HTMLElement>this.ulElement.cloneNode(true) : this.ulElement;)
|
|
9112
9110
|
if (!(this.list && this.list.querySelectorAll('.' + dropDownBaseClasses.li).length > 0)) {
|
|
9113
9111
|
this.l10nUpdate();
|
|
9114
9112
|
addClass([this.list], dropDownBaseClasses.noData);
|
|
@@ -11076,8 +11074,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11076
11074
|
}
|
|
11077
11075
|
}
|
|
11078
11076
|
updateDataList() {
|
|
11079
|
-
if (this.mainList && this.ulElement
|
|
11080
|
-
|
|
11077
|
+
if (this.mainList && this.ulElement) {
|
|
11078
|
+
let isDynamicGroupItemUpdate = this.mainList.childElementCount < this.ulElement.childElementCount;
|
|
11079
|
+
let isReactTemplateUpdate = ((this.ulElement.childElementCount > 0 && this.ulElement.children[0].childElementCount > 0) && (this.mainList.children[0].childElementCount < this.ulElement.children[0].childElementCount));
|
|
11080
|
+
let 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));
|
|
11081
|
+
if (isDynamicGroupItemUpdate || isReactTemplateUpdate || isAngularTemplateUpdate) {
|
|
11082
|
+
this.mainList = this.ulElement.cloneNode ? this.ulElement.cloneNode(true) : this.ulElement;
|
|
11083
|
+
}
|
|
11081
11084
|
}
|
|
11082
11085
|
}
|
|
11083
11086
|
isValidLI(li) {
|
|
@@ -11424,11 +11427,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11424
11427
|
}
|
|
11425
11428
|
}
|
|
11426
11429
|
wireListEvents() {
|
|
11427
|
-
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11430
|
+
if (!isNullOrUndefined(this.list)) {
|
|
11431
|
+
EventHandler.add(document, 'mousedown', this.onDocumentClick, this);
|
|
11432
|
+
EventHandler.add(this.list, 'mousedown', this.onListMouseDown, this);
|
|
11433
|
+
EventHandler.add(this.list, 'mouseup', this.onMouseClick, this);
|
|
11434
|
+
EventHandler.add(this.list, 'mouseover', this.onMouseOver, this);
|
|
11435
|
+
EventHandler.add(this.list, 'mouseout', this.onMouseLeave, this);
|
|
11436
|
+
}
|
|
11432
11437
|
}
|
|
11433
11438
|
unwireListEvents() {
|
|
11434
11439
|
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
@@ -13649,6 +13654,38 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13649
13654
|
});
|
|
13650
13655
|
}
|
|
13651
13656
|
triggerDrag(args) {
|
|
13657
|
+
let scrollParent;
|
|
13658
|
+
let boundRect;
|
|
13659
|
+
let scrollMoved = 36;
|
|
13660
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13661
|
+
let event = args.event;
|
|
13662
|
+
let wrapper;
|
|
13663
|
+
if (args.target && (args.target.classList.contains("e-listbox-wrapper") || args.target.classList.contains("e-list-item")
|
|
13664
|
+
|| args.target.classList.contains("e-filter-parent") || args.target.classList.contains("e-input-group"))) {
|
|
13665
|
+
if (args.target.classList.contains("e-list-item") || args.target.classList.contains("e-filter-parent")
|
|
13666
|
+
|| args.target.classList.contains("e-input-group")) {
|
|
13667
|
+
wrapper = args.target.closest('.e-listbox-wrapper');
|
|
13668
|
+
}
|
|
13669
|
+
else {
|
|
13670
|
+
wrapper = args.target;
|
|
13671
|
+
}
|
|
13672
|
+
if (this.allowFiltering) {
|
|
13673
|
+
scrollParent = wrapper.querySelector('.e-list-parent');
|
|
13674
|
+
}
|
|
13675
|
+
else {
|
|
13676
|
+
scrollParent = wrapper;
|
|
13677
|
+
}
|
|
13678
|
+
boundRect = scrollParent.getBoundingClientRect();
|
|
13679
|
+
if ((boundRect.y + scrollParent.offsetHeight) - (event.pageY + scrollMoved) < 1) {
|
|
13680
|
+
scrollParent.scrollTop = scrollParent.scrollTop + 10;
|
|
13681
|
+
}
|
|
13682
|
+
else if ((event.pageY - scrollMoved) - boundRect.y < 1) {
|
|
13683
|
+
scrollParent.scrollTop = scrollParent.scrollTop - 10;
|
|
13684
|
+
}
|
|
13685
|
+
}
|
|
13686
|
+
if (args.target === null) {
|
|
13687
|
+
return;
|
|
13688
|
+
}
|
|
13652
13689
|
this.trigger('drag', this.getDragArgs(args));
|
|
13653
13690
|
const listObj = this.getComponent(args.target);
|
|
13654
13691
|
if (listObj && listObj.listData.length === 0) {
|