@syncfusion/ej2-dropdowns 22.2.5 → 22.2.9
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 +30 -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 +66 -64
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +82 -80
- 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 +10 -10
- package/src/combo-box/combo-box.js +2 -1
- package/src/drop-down-base/drop-down-base.d.ts +1 -0
- package/src/drop-down-base/drop-down-base.js +54 -47
- package/src/drop-down-list/drop-down-list.js +24 -23
- package/src/multi-select/multi-select.js +2 -9
- package/.eslintrc.json +0 -260
- package/tslint.json +0 -111
|
@@ -259,6 +259,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
259
259
|
this.isDynamicDataChange = false;
|
|
260
260
|
this.addedNewItem = false;
|
|
261
261
|
this.isAddNewItemTemplate = false;
|
|
262
|
+
this.isRequesting = false;
|
|
262
263
|
}
|
|
263
264
|
getPropObject(prop, newProp, oldProp) {
|
|
264
265
|
const newProperty = new Object();
|
|
@@ -637,61 +638,67 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
637
638
|
this.isActive = true;
|
|
638
639
|
const eventArgs = { cancel: false, data: dataSource, query: query };
|
|
639
640
|
this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
|
|
640
|
-
this.
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
this.
|
|
645
|
-
if (
|
|
646
|
-
this.
|
|
647
|
-
|
|
641
|
+
if (!this.isRequesting) {
|
|
642
|
+
this.trigger('actionBegin', eventArgs, (eventArgs) => {
|
|
643
|
+
if (!eventArgs.cancel) {
|
|
644
|
+
this.isRequesting = true;
|
|
645
|
+
this.showSpinner();
|
|
646
|
+
if (dataSource instanceof DataManager) {
|
|
647
|
+
this.isRequested = true;
|
|
648
|
+
if (this.isDataFetched) {
|
|
649
|
+
this.emptyDataRequest(fields);
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
eventArgs.data.executeQuery(this.getQuery(eventArgs.query)).then((e) => {
|
|
653
|
+
this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
|
|
654
|
+
this.trigger('actionComplete', e, (e) => {
|
|
655
|
+
if (!e.cancel) {
|
|
656
|
+
this.isRequesting = false;
|
|
657
|
+
const listItems = e.result;
|
|
658
|
+
if (listItems.length === 0) {
|
|
659
|
+
this.isDataFetched = true;
|
|
660
|
+
}
|
|
661
|
+
ulElement = this.renderItems(listItems, fields);
|
|
662
|
+
this.onActionComplete(ulElement, listItems, e);
|
|
663
|
+
if (this.groupTemplate) {
|
|
664
|
+
this.renderGroupTemplate(ulElement);
|
|
665
|
+
}
|
|
666
|
+
this.isRequested = false;
|
|
667
|
+
this.bindChildItems(listItems, ulElement, fields, e);
|
|
668
|
+
}
|
|
669
|
+
});
|
|
670
|
+
}).catch((e) => {
|
|
671
|
+
this.isRequested = false;
|
|
672
|
+
this.isRequesting = false;
|
|
673
|
+
this.onActionFailure(e);
|
|
674
|
+
this.hideSpinner();
|
|
675
|
+
});
|
|
648
676
|
}
|
|
649
|
-
|
|
677
|
+
else {
|
|
678
|
+
const dataManager = new DataManager(eventArgs.data);
|
|
679
|
+
const listItems = (this.getQuery(eventArgs.query)).executeLocal(dataManager);
|
|
680
|
+
const localDataArgs = { cancel: false, result: listItems };
|
|
650
681
|
this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
|
|
651
|
-
this.trigger('actionComplete',
|
|
652
|
-
if (!
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
}
|
|
657
|
-
ulElement = this.renderItems(listItems, fields);
|
|
658
|
-
this.onActionComplete(ulElement, listItems, e);
|
|
682
|
+
this.trigger('actionComplete', localDataArgs, (localDataArgs) => {
|
|
683
|
+
if (!localDataArgs.cancel) {
|
|
684
|
+
this.isRequesting = false;
|
|
685
|
+
ulElement = this.renderItems(localDataArgs.result, fields);
|
|
686
|
+
this.onActionComplete(ulElement, localDataArgs.result, event);
|
|
659
687
|
if (this.groupTemplate) {
|
|
660
688
|
this.renderGroupTemplate(ulElement);
|
|
661
689
|
}
|
|
662
|
-
this.
|
|
663
|
-
|
|
690
|
+
this.bindChildItems(localDataArgs.result, ulElement, fields);
|
|
691
|
+
setTimeout(() => {
|
|
692
|
+
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)))) {
|
|
693
|
+
this.updateDataList();
|
|
694
|
+
}
|
|
695
|
+
});
|
|
664
696
|
}
|
|
665
697
|
});
|
|
666
|
-
}
|
|
667
|
-
this.isRequested = false;
|
|
668
|
-
this.onActionFailure(e);
|
|
669
|
-
this.hideSpinner();
|
|
670
|
-
});
|
|
671
|
-
}
|
|
672
|
-
else {
|
|
673
|
-
const dataManager = new DataManager(eventArgs.data);
|
|
674
|
-
const listItems = (this.getQuery(eventArgs.query)).executeLocal(dataManager);
|
|
675
|
-
const localDataArgs = { cancel: false, result: listItems };
|
|
676
|
-
this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
|
|
677
|
-
this.trigger('actionComplete', localDataArgs, (localDataArgs) => {
|
|
678
|
-
if (!localDataArgs.cancel) {
|
|
679
|
-
ulElement = this.renderItems(localDataArgs.result, fields);
|
|
680
|
-
this.onActionComplete(ulElement, localDataArgs.result, event);
|
|
681
|
-
if (this.groupTemplate) {
|
|
682
|
-
this.renderGroupTemplate(ulElement);
|
|
683
|
-
}
|
|
684
|
-
this.bindChildItems(localDataArgs.result, ulElement, fields);
|
|
685
|
-
setTimeout(() => {
|
|
686
|
-
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)))) {
|
|
687
|
-
this.updateDataList();
|
|
688
|
-
}
|
|
689
|
-
});
|
|
690
|
-
}
|
|
691
|
-
});
|
|
698
|
+
}
|
|
692
699
|
}
|
|
693
|
-
}
|
|
694
|
-
}
|
|
700
|
+
});
|
|
701
|
+
}
|
|
695
702
|
}
|
|
696
703
|
bindChildItems(listItems, ulElement, fields, e) {
|
|
697
704
|
if (listItems.length >= 100 && this.getModuleName() === 'autocomplete') {
|
|
@@ -2994,7 +3001,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2994
3001
|
this.isNotSearchList = false;
|
|
2995
3002
|
return;
|
|
2996
3003
|
}
|
|
2997
|
-
if (this.isActive) {
|
|
3004
|
+
if (this.isActive || !isNullOrUndefined(ulElement)) {
|
|
2998
3005
|
const selectedItem = this.selectedLI ? this.selectedLI.cloneNode(true) : null;
|
|
2999
3006
|
super.onActionComplete(ulElement, list, e);
|
|
3000
3007
|
this.updateSelectElementData(this.allowFiltering);
|
|
@@ -3210,7 +3217,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3210
3217
|
this.getFocusElement();
|
|
3211
3218
|
this.createPopup(popupEle, offsetValue, left);
|
|
3212
3219
|
this.checkCollision(popupEle);
|
|
3213
|
-
const popupLeft = this.enableRtl ? parseFloat(popupEle.style.left) - (this.ulElement.parentElement.offsetWidth - this.inputWrapper.container.offsetWidth) : 0;
|
|
3214
3220
|
if (Browser.isDevice) {
|
|
3215
3221
|
this.popupObj.element.classList.add(dropDownListClasses.device);
|
|
3216
3222
|
if (this.getModuleName() === 'dropdownlist' || (this.getModuleName() === 'combobox'
|
|
@@ -3263,9 +3269,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3263
3269
|
this.beforePopupOpen = false;
|
|
3264
3270
|
this.destroyPopup();
|
|
3265
3271
|
}
|
|
3266
|
-
if (this.enableRtl && popupLeft > 0) {
|
|
3267
|
-
popupEle.style.left = popupLeft + "px";
|
|
3268
|
-
}
|
|
3269
3272
|
});
|
|
3270
3273
|
}
|
|
3271
3274
|
else {
|
|
@@ -3292,7 +3295,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3292
3295
|
this.popupObj = new Popup(element, {
|
|
3293
3296
|
width: this.setWidth(), targetType: 'relative',
|
|
3294
3297
|
relateTo: this.inputWrapper.container, collision: { X: 'flip', Y: 'flip' }, offsetY: offsetValue,
|
|
3295
|
-
enableRtl: this.enableRtl, offsetX: left,
|
|
3298
|
+
enableRtl: this.enableRtl, offsetX: left,
|
|
3299
|
+
position: this.enableRtl ? { X: 'right', Y: 'bottom' } : { X: 'left', Y: 'bottom' },
|
|
3296
3300
|
zIndex: this.zIndex,
|
|
3297
3301
|
close: () => {
|
|
3298
3302
|
if (!this.isDocumentClick) {
|
|
@@ -3701,7 +3705,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3701
3705
|
setFooterTemplate(popupEle) {
|
|
3702
3706
|
let compiledString;
|
|
3703
3707
|
if (this.footer) {
|
|
3704
|
-
if (this.isReact) {
|
|
3708
|
+
if (this.isReact && typeof this.footerTemplate === 'function') {
|
|
3705
3709
|
this.clearTemplate(['footerTemplate']);
|
|
3706
3710
|
}
|
|
3707
3711
|
else {
|
|
@@ -3787,6 +3791,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3787
3791
|
if (this.allowFiltering && newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))) {
|
|
3788
3792
|
this.actionCompleteData = { ulElement: null, list: null, isUpdated: false };
|
|
3789
3793
|
this.actionData = this.actionCompleteData;
|
|
3794
|
+
this.itemData = null;
|
|
3790
3795
|
}
|
|
3791
3796
|
else if (this.allowFiltering && newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
|
|
3792
3797
|
this.actionCompleteData = this.getModuleName() === 'combobox' ?
|
|
@@ -4287,6 +4292,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4287
4292
|
if (this.inputElement && !isNullOrUndefined(this.inputElement.onchange)) {
|
|
4288
4293
|
this.inputElement.onchange = null;
|
|
4289
4294
|
}
|
|
4295
|
+
if (this.isAngular) {
|
|
4296
|
+
this.inputElement = null;
|
|
4297
|
+
}
|
|
4290
4298
|
super.destroy();
|
|
4291
4299
|
}
|
|
4292
4300
|
/* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
|
|
@@ -7790,7 +7798,8 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7790
7798
|
}
|
|
7791
7799
|
setSearchBox() {
|
|
7792
7800
|
this.filterInput = this.inputElement;
|
|
7793
|
-
|
|
7801
|
+
let searchBoxContainer = (this.isFiltering() || (this.isReact && this.getModuleName() === 'combobox')) ? this.inputWrapper : inputObject$1;
|
|
7802
|
+
return searchBoxContainer;
|
|
7794
7803
|
}
|
|
7795
7804
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7796
7805
|
onActionComplete(ulElement, list, e, isUpdated) {
|
|
@@ -9246,9 +9255,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9246
9255
|
if (this.isFirstClick) {
|
|
9247
9256
|
this.loadTemplate();
|
|
9248
9257
|
}
|
|
9249
|
-
if (this.enableRtl) {
|
|
9250
|
-
this.popupWrapper.style.visibility = 'hidden';
|
|
9251
|
-
}
|
|
9252
9258
|
}
|
|
9253
9259
|
});
|
|
9254
9260
|
}
|
|
@@ -11096,7 +11102,8 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11096
11102
|
this.list.style.maxHeight = formatUnit(this.popupHeight);
|
|
11097
11103
|
}
|
|
11098
11104
|
this.popupObj = new Popup(this.popupWrapper, {
|
|
11099
|
-
width: this.calcPopupWidth(), targetType: 'relative',
|
|
11105
|
+
width: this.calcPopupWidth(), targetType: 'relative',
|
|
11106
|
+
position: this.enableRtl ? { X: 'right', Y: 'bottom' } : { X: 'left', Y: 'bottom' },
|
|
11100
11107
|
relateTo: this.overAllWrapper, collision: { X: 'flip', Y: 'flip' }, offsetY: 1,
|
|
11101
11108
|
enableRtl: this.enableRtl, zIndex: this.zIndex,
|
|
11102
11109
|
close: () => {
|
|
@@ -11112,11 +11119,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11112
11119
|
},
|
|
11113
11120
|
open: () => {
|
|
11114
11121
|
this.popupObj.resolveCollision();
|
|
11115
|
-
if (this.enableRtl) {
|
|
11116
|
-
const popupLeft = parseFloat(this.popupWrapper.style.left) - (this.popupWrapper.offsetWidth - this.overAllWrapper.offsetWidth);
|
|
11117
|
-
this.popupWrapper.style.left = popupLeft > 0 ? popupLeft + "px" : this.popupWrapper.style.left;
|
|
11118
|
-
this.popupWrapper.style.visibility = 'hidden';
|
|
11119
|
-
}
|
|
11120
11122
|
if (!this.isFirstClick) {
|
|
11121
11123
|
const ulElement = this.list.querySelector('ul');
|
|
11122
11124
|
if (ulElement) {
|