@syncfusion/ej2-dropdowns 19.4.48 → 19.4.54
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 +20 -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 +82 -35
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +160 -107
- 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 +18 -6
- package/src/drop-down-list/drop-down-list.js +106 -71
- package/src/drop-down-tree/drop-down-tree.js +6 -14
- package/src/list-box/list-box.js +4 -3
- package/src/multi-select/multi-select.js +19 -9
- package/styles/bootstrap-dark.css +10 -1
- package/styles/bootstrap.css +10 -1
- package/styles/bootstrap4.css +10 -1
- package/styles/bootstrap5-dark.css +10 -1
- package/styles/bootstrap5.css +10 -1
- package/styles/fabric-dark.css +10 -1
- package/styles/fabric.css +10 -1
- package/styles/highcontrast-light.css +10 -1
- package/styles/highcontrast.css +10 -1
- package/styles/material-dark.css +10 -1
- package/styles/material.css +10 -1
- package/styles/multi-select/_layout.scss +10 -1
- package/styles/multi-select/bootstrap-dark.css +10 -1
- package/styles/multi-select/bootstrap.css +10 -1
- package/styles/multi-select/bootstrap4.css +10 -1
- package/styles/multi-select/bootstrap5-dark.css +10 -1
- package/styles/multi-select/bootstrap5.css +10 -1
- package/styles/multi-select/fabric-dark.css +10 -1
- package/styles/multi-select/fabric.css +10 -1
- package/styles/multi-select/highcontrast-light.css +10 -1
- package/styles/multi-select/highcontrast.css +10 -1
- package/styles/multi-select/material-dark.css +10 -1
- package/styles/multi-select/material.css +10 -1
- package/styles/multi-select/tailwind-dark.css +10 -1
- package/styles/multi-select/tailwind.css +10 -1
- package/styles/tailwind-dark.css +10 -1
- package/styles/tailwind.css +10 -1
|
@@ -216,6 +216,7 @@ const HEADERTEMPLATE_PROPERTY = 'HeaderTemplate';
|
|
|
216
216
|
const FOOTERTEMPLATE_PROPERTY = 'FooterTemplate';
|
|
217
217
|
const NORECORDSTEMPLATE_PROPERTY = 'NoRecordsTemplate';
|
|
218
218
|
const ACTIONFAILURETEMPLATE_PROPERTY = 'ActionFailureTemplate';
|
|
219
|
+
const HIDE_GROUPLIST = 'e-hide-group-header';
|
|
219
220
|
/**
|
|
220
221
|
* DropDownBase component will generate the list items based on given data and act as base class to drop-down related components
|
|
221
222
|
*/
|
|
@@ -636,7 +637,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
636
637
|
}
|
|
637
638
|
this.bindChildItems(localDataArgs.result, ulElement, fields);
|
|
638
639
|
setTimeout(() => {
|
|
639
|
-
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)))) {
|
|
640
641
|
this.updateDataList();
|
|
641
642
|
}
|
|
642
643
|
});
|
|
@@ -722,12 +723,23 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
722
723
|
if (this.isReact) {
|
|
723
724
|
this.clearTemplate(['itemTemplate', 'groupTemplate', 'actionFailureTemplate', 'noRecordsTemplate']);
|
|
724
725
|
}
|
|
725
|
-
this.list.innerHTML = '';
|
|
726
726
|
this.fixedHeaderElement = isNullOrUndefined(this.fixedHeaderElement) ? this.fixedHeaderElement : null;
|
|
727
|
-
this.
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
727
|
+
if (this.getModuleName() === 'multiselect' && this.properties.allowCustomValue && this.fields.groupBy) {
|
|
728
|
+
for (let i = 0; i < ulElement.childElementCount; i++) {
|
|
729
|
+
if (ulElement.children[i].classList.contains('e-list-group-item')) {
|
|
730
|
+
if (isNullOrUndefined(ulElement.children[i].innerHTML) || ulElement.children[i].innerHTML == "") {
|
|
731
|
+
addClass([ulElement.children[i]], HIDE_GROUPLIST);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}
|
|
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
|
+
}
|
|
731
743
|
}
|
|
732
744
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
733
745
|
postRender(listElement, list, bindEvent) {
|
|
@@ -772,7 +784,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
772
784
|
const tempHeaders = ListBase.renderGroupTemplate(groupValue, dataSource, this.fields.properties, headerItems, option, this);
|
|
773
785
|
//EJ2-55168- Group checkbox is not working with group template
|
|
774
786
|
if (this.isGroupChecking) {
|
|
775
|
-
for (
|
|
787
|
+
for (let i = 0; i < tempHeaders.length; i++) {
|
|
776
788
|
this.notify('addItem', { module: 'CheckBoxSelection', item: tempHeaders[i] });
|
|
777
789
|
}
|
|
778
790
|
}
|
|
@@ -782,7 +794,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
782
794
|
const tempHeaders = ListBase.renderGroupTemplate(this.groupTemplate, dataSource, this.fields.properties, headerItems, option, this);
|
|
783
795
|
//EJ2-55168- Group checkbox is not working with group template
|
|
784
796
|
if (this.isGroupChecking) {
|
|
785
|
-
for (
|
|
797
|
+
for (let i = 0; i < tempHeaders.length; i++) {
|
|
786
798
|
this.notify('addItem', { module: 'CheckBoxSelection', item: tempHeaders[i] });
|
|
787
799
|
}
|
|
788
800
|
}
|
|
@@ -3680,6 +3692,21 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3680
3692
|
this.getModuleName() === 'autocomplete' && this.listData.length > 100) {
|
|
3681
3693
|
this.setSelectionData(newProp.text, oldProp.text, 'text');
|
|
3682
3694
|
}
|
|
3695
|
+
else if (newProp.text && this.dataSource instanceof DataManager) {
|
|
3696
|
+
const listLength = this.getItems().length;
|
|
3697
|
+
const checkField = isNullOrUndefined(this.fields.text) ? this.fields.value : this.fields.text;
|
|
3698
|
+
this.typedString = '';
|
|
3699
|
+
this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', newProp.text)))
|
|
3700
|
+
.then((e) => {
|
|
3701
|
+
if (e.result.length > 0) {
|
|
3702
|
+
this.addItem(e.result, listLength);
|
|
3703
|
+
this.updateValues();
|
|
3704
|
+
}
|
|
3705
|
+
else {
|
|
3706
|
+
this.setOldText(oldProp.text);
|
|
3707
|
+
}
|
|
3708
|
+
});
|
|
3709
|
+
}
|
|
3683
3710
|
else {
|
|
3684
3711
|
this.setOldText(oldProp.text);
|
|
3685
3712
|
}
|
|
@@ -3706,6 +3733,21 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3706
3733
|
this.getModuleName() === 'autocomplete' && this.listData.length > 100) {
|
|
3707
3734
|
this.setSelectionData(newProp.value, oldProp.value, 'value');
|
|
3708
3735
|
}
|
|
3736
|
+
else if (newProp.value && this.dataSource instanceof DataManager) {
|
|
3737
|
+
const listLength = this.getItems().length;
|
|
3738
|
+
const checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
|
|
3739
|
+
this.typedString = '';
|
|
3740
|
+
this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', newProp.value)))
|
|
3741
|
+
.then((e) => {
|
|
3742
|
+
if (e.result.length > 0) {
|
|
3743
|
+
this.addItem(e.result, listLength);
|
|
3744
|
+
this.updateValues();
|
|
3745
|
+
}
|
|
3746
|
+
else {
|
|
3747
|
+
this.setOldValue(oldProp.value);
|
|
3748
|
+
}
|
|
3749
|
+
});
|
|
3750
|
+
}
|
|
3709
3751
|
else {
|
|
3710
3752
|
this.setOldValue(oldProp.value);
|
|
3711
3753
|
}
|
|
@@ -4984,13 +5026,10 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
4984
5026
|
const l10nLocale = { overflowCountTemplate: '+${count} more..', totalCountTemplate: '${count} selected' };
|
|
4985
5027
|
this.l10n = new L10n(this.getLocaleName(), l10nLocale, this.locale);
|
|
4986
5028
|
const remainContent = this.l10n.getConstant('overflowCountTemplate');
|
|
5029
|
+
const totalContent = this.l10n.getConstant('totalCountTemplate');
|
|
4987
5030
|
const remainElement = this.createElement('span', { className: REMAIN_WRAPPER });
|
|
4988
|
-
// eslint-disable-next-line
|
|
4989
|
-
const compiledString = compile(remainContent);
|
|
4990
|
-
// eslint-disable-next-line
|
|
4991
|
-
const totalCompiledString = compile(this.l10n.getConstant('totalCountTemplate'));
|
|
4992
|
-
remainElement.appendChild(compiledString({ 'count': this.value.length }, this, 'overflowCountTemplate', null, !this.isStringTemplate)[0]);
|
|
4993
5031
|
this.overFlowWrapper.appendChild(remainElement);
|
|
5032
|
+
remainElement.innerText = remainContent.replace('${count}', this.value.length.toString());
|
|
4994
5033
|
const remainSize = remainElement.offsetWidth;
|
|
4995
5034
|
remove(remainElement);
|
|
4996
5035
|
if (this.showDropDownIcon) {
|
|
@@ -5072,7 +5111,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5072
5111
|
}
|
|
5073
5112
|
}
|
|
5074
5113
|
if (remaining > 0) {
|
|
5075
|
-
this.overFlowWrapper.appendChild(this.updateRemainTemplate(remainElement, remaining,
|
|
5114
|
+
this.overFlowWrapper.appendChild(this.updateRemainTemplate(remainElement, remaining, remainContent, totalContent));
|
|
5076
5115
|
}
|
|
5077
5116
|
if (this.mode === 'Box' && !this.overFlowWrapper.classList.contains(TOTAL_COUNT_WRAPPER)) {
|
|
5078
5117
|
addClass([remainElement], REMAIN_COUNT);
|
|
@@ -5084,19 +5123,14 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
5084
5123
|
}
|
|
5085
5124
|
this.updateDelimMode();
|
|
5086
5125
|
}
|
|
5087
|
-
updateRemainTemplate(remainElement, remaining,
|
|
5088
|
-
// eslint-disable-next-line
|
|
5089
|
-
compiledString,
|
|
5090
|
-
// eslint-disable-next-line
|
|
5091
|
-
totalCompiledString) {
|
|
5126
|
+
updateRemainTemplate(remainElement, remaining, remainContent, totalContent) {
|
|
5092
5127
|
if (this.overFlowWrapper.firstChild && this.overFlowWrapper.firstChild.nodeType === 3 &&
|
|
5093
5128
|
this.overFlowWrapper.firstChild.nodeValue === '') {
|
|
5094
5129
|
this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild);
|
|
5095
5130
|
}
|
|
5096
5131
|
remainElement.innerHTML = '';
|
|
5097
|
-
remainElement.
|
|
5098
|
-
|
|
5099
|
-
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());
|
|
5100
5134
|
if (this.overFlowWrapper.firstChild && (this.overFlowWrapper.firstChild.nodeType === 3 || this.mode === 'Box')) {
|
|
5101
5135
|
removeClass([this.overFlowWrapper], TOTAL_COUNT_WRAPPER);
|
|
5102
5136
|
}
|
|
@@ -7441,7 +7475,9 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7441
7475
|
this.removeSelection();
|
|
7442
7476
|
}
|
|
7443
7477
|
if (!this.preventAutoFill && this.getModuleName() === 'combobox' && this.isTyped) {
|
|
7444
|
-
|
|
7478
|
+
setTimeout(() => {
|
|
7479
|
+
this.inlineSearch();
|
|
7480
|
+
});
|
|
7445
7481
|
}
|
|
7446
7482
|
}
|
|
7447
7483
|
getFocusElement() {
|
|
@@ -8908,7 +8944,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8908
8944
|
return ariaAttributes;
|
|
8909
8945
|
}
|
|
8910
8946
|
updateListARIA() {
|
|
8911
|
-
|
|
8947
|
+
if (!isNullOrUndefined(this.ulElement)) {
|
|
8948
|
+
attributes(this.ulElement, { 'id': this.element.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
8949
|
+
}
|
|
8912
8950
|
const disableStatus = (this.inputElement.disabled) ? true : false;
|
|
8913
8951
|
attributes(this.inputElement, this.getAriaAttributes());
|
|
8914
8952
|
if (disableStatus) {
|
|
@@ -9068,7 +9106,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9068
9106
|
addClass([listEle[0]], dropDownBaseClasses.focus);
|
|
9069
9107
|
}
|
|
9070
9108
|
else {
|
|
9071
|
-
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;)
|
|
9072
9110
|
if (!(this.list && this.list.querySelectorAll('.' + dropDownBaseClasses.li).length > 0)) {
|
|
9073
9111
|
this.l10nUpdate();
|
|
9074
9112
|
addClass([this.list], dropDownBaseClasses.noData);
|
|
@@ -11036,8 +11074,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11036
11074
|
}
|
|
11037
11075
|
}
|
|
11038
11076
|
updateDataList() {
|
|
11039
|
-
if (this.mainList && this.ulElement
|
|
11040
|
-
|
|
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
|
+
}
|
|
11041
11084
|
}
|
|
11042
11085
|
}
|
|
11043
11086
|
isValidLI(li) {
|
|
@@ -11384,11 +11427,13 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11384
11427
|
}
|
|
11385
11428
|
}
|
|
11386
11429
|
wireListEvents() {
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
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
|
+
}
|
|
11392
11437
|
}
|
|
11393
11438
|
unwireListEvents() {
|
|
11394
11439
|
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
@@ -12509,6 +12554,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12509
12554
|
this.mainData = null;
|
|
12510
12555
|
this.filterParent = null;
|
|
12511
12556
|
this.ulElement = null;
|
|
12557
|
+
this.mainListCollection = null;
|
|
12512
12558
|
super.destroy();
|
|
12513
12559
|
const temp = ['readonly', 'aria-disabled', 'aria-placeholder', 'placeholder'];
|
|
12514
12560
|
let length = temp.length;
|
|
@@ -13925,9 +13971,10 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13925
13971
|
}
|
|
13926
13972
|
if (objValue === dataValue) {
|
|
13927
13973
|
itemIdx = this.getIndexByValue(dataValue);
|
|
13928
|
-
|
|
13929
|
-
|
|
13930
|
-
|
|
13974
|
+
const idx = itemIdx === i ? itemIdx : i;
|
|
13975
|
+
liCollections.push(liElement[idx]);
|
|
13976
|
+
removeIdxes.push(idx);
|
|
13977
|
+
removeLiIdxes.push(idx);
|
|
13931
13978
|
}
|
|
13932
13979
|
}
|
|
13933
13980
|
}
|