@syncfusion/ej2-dropdowns 20.2.40 → 20.2.45
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 +36 -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 +96 -76
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +113 -93
- 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/auto-complete/auto-complete-model.d.ts +1 -1
- package/src/auto-complete/auto-complete.d.ts +4 -3
- package/src/auto-complete/auto-complete.js +53 -29
- package/src/combo-box/combo-box.d.ts +2 -2
- package/src/combo-box/combo-box.js +3 -3
- package/src/drop-down-base/drop-down-base.d.ts +3 -3
- package/src/drop-down-base/drop-down-base.js +8 -8
- package/src/drop-down-list/drop-down-list.d.ts +6 -5
- package/src/drop-down-list/drop-down-list.js +35 -37
- package/src/list-box/list-box.d.ts +1 -1
- package/src/list-box/list-box.js +5 -6
- package/src/multi-select/multi-select.d.ts +1 -1
- package/src/multi-select/multi-select.js +10 -11
- package/styles/multi-select/_layout.scss +4 -0
- package/styles/multi-select/tailwind-dark.css +2 -0
- package/styles/multi-select/tailwind.css +2 -0
- package/styles/tailwind-dark.css +2 -0
- package/styles/tailwind.css +2 -0
|
@@ -463,7 +463,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
463
463
|
*
|
|
464
464
|
* @returns {void}
|
|
465
465
|
*/
|
|
466
|
-
initialize() {
|
|
466
|
+
initialize(e) {
|
|
467
467
|
this.bindEvent = true;
|
|
468
468
|
this.actionFailureTemplateId = `${this.element.id}${ACTIONFAILURETEMPLATE_PROPERTY}`;
|
|
469
469
|
if (this.element.tagName === 'UL') {
|
|
@@ -482,7 +482,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
else {
|
|
485
|
-
this.setListData(this.dataSource, this.fields, this.query);
|
|
485
|
+
this.setListData(this.dataSource, this.fields, this.query, e);
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
/**
|
|
@@ -589,7 +589,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
589
589
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
590
590
|
* @returns {void}
|
|
591
591
|
*/
|
|
592
|
-
setListData(dataSource, fields, query) {
|
|
592
|
+
setListData(dataSource, fields, query, event) {
|
|
593
593
|
fields = fields ? fields : this.fields;
|
|
594
594
|
let ulElement;
|
|
595
595
|
this.isActive = true;
|
|
@@ -635,7 +635,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
635
635
|
this.trigger('actionComplete', localDataArgs, (localDataArgs) => {
|
|
636
636
|
if (!localDataArgs.cancel) {
|
|
637
637
|
ulElement = this.renderItems(localDataArgs.result, fields);
|
|
638
|
-
this.onActionComplete(ulElement, localDataArgs.result);
|
|
638
|
+
this.onActionComplete(ulElement, localDataArgs.result, event);
|
|
639
639
|
if (this.groupTemplate) {
|
|
640
640
|
this.renderGroupTemplate(ulElement);
|
|
641
641
|
}
|
|
@@ -1024,7 +1024,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1024
1024
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
1025
1025
|
* @returns {void}
|
|
1026
1026
|
*/
|
|
1027
|
-
resetList(dataSource, fields, query) {
|
|
1027
|
+
resetList(dataSource, fields, query, e) {
|
|
1028
1028
|
if (this.list) {
|
|
1029
1029
|
if ((this.element.tagName === 'SELECT' && this.element.options.length > 0)
|
|
1030
1030
|
|| (this.element.tagName === 'UL' && this.element.childNodes.length > 0)) {
|
|
@@ -1035,7 +1035,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1035
1035
|
}
|
|
1036
1036
|
}
|
|
1037
1037
|
dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length ? this.selectData : dataSource;
|
|
1038
|
-
this.setListData(dataSource, fields, query);
|
|
1038
|
+
this.setListData(dataSource, fields, query, e);
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
|
1041
1041
|
updateSelectElementData(isFiltering) {
|
|
@@ -1126,7 +1126,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1126
1126
|
* @private
|
|
1127
1127
|
* @returns {void}
|
|
1128
1128
|
*/
|
|
1129
|
-
render(isEmptyData) {
|
|
1129
|
+
render(e, isEmptyData) {
|
|
1130
1130
|
this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
|
|
1131
1131
|
this.list.classList.add(dropDownBaseClasses.root);
|
|
1132
1132
|
this.setFields();
|
|
@@ -1150,7 +1150,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1150
1150
|
this.setEnableRtl();
|
|
1151
1151
|
this.setEnabled();
|
|
1152
1152
|
if (!isEmptyData) {
|
|
1153
|
-
this.initialize();
|
|
1153
|
+
this.initialize(e);
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
1156
|
/**
|
|
@@ -1567,8 +1567,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1567
1567
|
this.popupObj.setProperties({ 'zIndex': this.zIndex });
|
|
1568
1568
|
}
|
|
1569
1569
|
}
|
|
1570
|
-
renderList(isEmptyData) {
|
|
1571
|
-
super.render(isEmptyData);
|
|
1570
|
+
renderList(e, isEmptyData) {
|
|
1571
|
+
super.render(e, isEmptyData);
|
|
1572
1572
|
this.unWireListEvents();
|
|
1573
1573
|
this.wireListEvents();
|
|
1574
1574
|
}
|
|
@@ -2051,7 +2051,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2051
2051
|
const isTabAction = e.action === 'tab' || e.action === 'close';
|
|
2052
2052
|
if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
|
|
2053
2053
|
this.searchKeyEvent = e;
|
|
2054
|
-
this.renderList();
|
|
2054
|
+
this.renderList(e);
|
|
2055
2055
|
}
|
|
2056
2056
|
if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
|
|
2057
2057
|
isNavigation && this.liCollections.length === 0) || this.isRequested) {
|
|
@@ -2090,7 +2090,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2090
2090
|
}
|
|
2091
2091
|
break;
|
|
2092
2092
|
case 'open':
|
|
2093
|
-
this.showPopup();
|
|
2093
|
+
this.showPopup(e);
|
|
2094
2094
|
break;
|
|
2095
2095
|
case 'hide':
|
|
2096
2096
|
this.preventAltUp = this.isPopupOpen;
|
|
@@ -2282,7 +2282,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2282
2282
|
}
|
|
2283
2283
|
if (!this.readonly) {
|
|
2284
2284
|
if (this.isPopupOpen) {
|
|
2285
|
-
this.hidePopup();
|
|
2285
|
+
this.hidePopup(e);
|
|
2286
2286
|
if (this.isFilterLayout()) {
|
|
2287
2287
|
this.focusDropDown(e);
|
|
2288
2288
|
}
|
|
@@ -2292,7 +2292,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2292
2292
|
this.floatLabelChange();
|
|
2293
2293
|
this.queryString = this.inputElement.value.trim() === '' ? null : this.inputElement.value;
|
|
2294
2294
|
this.isDropDownClick = true;
|
|
2295
|
-
this.showPopup();
|
|
2295
|
+
this.showPopup(e);
|
|
2296
2296
|
}
|
|
2297
2297
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
2298
2298
|
const proxy = this;
|
|
@@ -2933,26 +2933,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2933
2933
|
}
|
|
2934
2934
|
this.initial = false;
|
|
2935
2935
|
}
|
|
2936
|
-
else if (this.getModuleName() === 'autocomplete' && this.value
|
|
2937
|
-
|
|
2938
|
-
const checkValue = list.some((x) => x[checkFields] === this.value);
|
|
2939
|
-
let query = new Query();
|
|
2940
|
-
if (!checkValue) {
|
|
2941
|
-
new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields, 'equal', this.value)))
|
|
2942
|
-
.then((e) => {
|
|
2943
|
-
if (e.result.length > 0) {
|
|
2944
|
-
this.value = checkFields !== '' ? e.result[0][this.fields.value].toString() : e.result[0].toString();
|
|
2945
|
-
this.addItem(e.result, list.length);
|
|
2946
|
-
this.updateValues();
|
|
2947
|
-
}
|
|
2948
|
-
else {
|
|
2949
|
-
this.updateValues();
|
|
2950
|
-
}
|
|
2951
|
-
});
|
|
2952
|
-
}
|
|
2953
|
-
else {
|
|
2954
|
-
this.updateValues();
|
|
2955
|
-
}
|
|
2936
|
+
else if (this.getModuleName() === 'autocomplete' && this.value) {
|
|
2937
|
+
this.setInputValue();
|
|
2956
2938
|
}
|
|
2957
2939
|
if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
|
|
2958
2940
|
if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
|
|
@@ -2975,7 +2957,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2975
2957
|
}
|
|
2976
2958
|
}
|
|
2977
2959
|
if (this.beforePopupOpen) {
|
|
2978
|
-
this.renderPopup();
|
|
2960
|
+
this.renderPopup(e);
|
|
2979
2961
|
}
|
|
2980
2962
|
}
|
|
2981
2963
|
}
|
|
@@ -3045,7 +3027,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3045
3027
|
removeClass(highlightedItem, dropDownListClasses.focus);
|
|
3046
3028
|
}
|
|
3047
3029
|
}
|
|
3048
|
-
renderPopup() {
|
|
3030
|
+
renderPopup(e) {
|
|
3049
3031
|
if (this.popupObj && document.body.contains(this.popupObj.element)) {
|
|
3050
3032
|
this.refreshPopup();
|
|
3051
3033
|
return;
|
|
@@ -3146,7 +3128,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3146
3128
|
const animModel = { name: 'FadeIn', duration: 100 };
|
|
3147
3129
|
this.beforePopupOpen = true;
|
|
3148
3130
|
const popupInstance = this.popupObj;
|
|
3149
|
-
const eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
|
|
3131
|
+
const eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
|
|
3150
3132
|
this.trigger('open', eventArgs, (eventArgs) => {
|
|
3151
3133
|
if (!eventArgs.cancel) {
|
|
3152
3134
|
addClass([this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
|
|
@@ -3465,14 +3447,14 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3465
3447
|
if (this.element.tagName === 'INPUT') {
|
|
3466
3448
|
this.inputElement = this.element;
|
|
3467
3449
|
if (isNullOrUndefined(this.inputElement.getAttribute('role'))) {
|
|
3468
|
-
this.inputElement.setAttribute('role', '
|
|
3450
|
+
this.inputElement.setAttribute('role', 'combobox');
|
|
3469
3451
|
}
|
|
3470
3452
|
if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
|
|
3471
3453
|
this.inputElement.setAttribute('type', 'text');
|
|
3472
3454
|
}
|
|
3473
3455
|
}
|
|
3474
3456
|
else {
|
|
3475
|
-
this.inputElement = this.createElement('input', { attrs: { role: '
|
|
3457
|
+
this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
|
|
3476
3458
|
if (this.element.tagName !== this.getNgDirective()) {
|
|
3477
3459
|
this.element.style.display = 'none';
|
|
3478
3460
|
}
|
|
@@ -3521,6 +3503,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3521
3503
|
attributes(this.targetElement(), this.getAriaAttributes());
|
|
3522
3504
|
this.updateDataAttribute(this.htmlAttributes);
|
|
3523
3505
|
this.setHTMLAttributes();
|
|
3506
|
+
if (this.targetElement() === this.inputElement) {
|
|
3507
|
+
this.element.removeAttribute('aria-labelledby');
|
|
3508
|
+
}
|
|
3524
3509
|
if (this.value !== null || this.activeIndex !== null || this.text !== null) {
|
|
3525
3510
|
this.initValue();
|
|
3526
3511
|
}
|
|
@@ -3556,7 +3541,12 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3556
3541
|
setFooterTemplate(popupEle) {
|
|
3557
3542
|
let compiledString;
|
|
3558
3543
|
if (this.footer) {
|
|
3559
|
-
this.
|
|
3544
|
+
if (this.isReact) {
|
|
3545
|
+
this.clearTemplate(['footerTemplate']);
|
|
3546
|
+
}
|
|
3547
|
+
else {
|
|
3548
|
+
this.footer.innerHTML = '';
|
|
3549
|
+
}
|
|
3560
3550
|
}
|
|
3561
3551
|
else {
|
|
3562
3552
|
this.footer = this.createElement('div');
|
|
@@ -3747,6 +3737,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3747
3737
|
}
|
|
3748
3738
|
});
|
|
3749
3739
|
}
|
|
3740
|
+
else if (this.getModuleName() === 'autocomplete') {
|
|
3741
|
+
this.setInputValue(newProp, oldProp);
|
|
3742
|
+
}
|
|
3750
3743
|
else {
|
|
3751
3744
|
this.setOldText(oldProp.text);
|
|
3752
3745
|
}
|
|
@@ -3788,6 +3781,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3788
3781
|
}
|
|
3789
3782
|
});
|
|
3790
3783
|
}
|
|
3784
|
+
else if (this.getModuleName() === 'autocomplete') {
|
|
3785
|
+
this.setInputValue(newProp, oldProp);
|
|
3786
|
+
}
|
|
3791
3787
|
else {
|
|
3792
3788
|
this.setOldValue(oldProp.value);
|
|
3793
3789
|
}
|
|
@@ -3900,6 +3896,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3900
3896
|
removeClass([this.inputWrapper.container], ['e-readonly']);
|
|
3901
3897
|
}
|
|
3902
3898
|
}
|
|
3899
|
+
setInputValue(newProp, oldProp) {
|
|
3900
|
+
}
|
|
3903
3901
|
setCssClass(newClass, oldClass) {
|
|
3904
3902
|
if (!isNullOrUndefined(oldClass)) {
|
|
3905
3903
|
oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
|
|
@@ -3926,7 +3924,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3926
3924
|
*
|
|
3927
3925
|
* @returns {void}
|
|
3928
3926
|
*/
|
|
3929
|
-
showPopup() {
|
|
3927
|
+
showPopup(e) {
|
|
3930
3928
|
if (!this.enabled) {
|
|
3931
3929
|
return;
|
|
3932
3930
|
}
|
|
@@ -3946,11 +3944,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3946
3944
|
}
|
|
3947
3945
|
else if (isNullOrUndefined(this.list) || !isUndefined(this.list) && (this.list.classList.contains(dropDownBaseClasses.noData) ||
|
|
3948
3946
|
this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
|
|
3949
|
-
this.renderList();
|
|
3947
|
+
this.renderList(e);
|
|
3950
3948
|
}
|
|
3951
|
-
this.invokeRenderPopup();
|
|
3949
|
+
this.invokeRenderPopup(e);
|
|
3952
3950
|
}
|
|
3953
|
-
invokeRenderPopup() {
|
|
3951
|
+
invokeRenderPopup(e) {
|
|
3954
3952
|
if (Browser.isDevice && this.isFilterLayout()) {
|
|
3955
3953
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
3956
3954
|
const proxy = this;
|
|
@@ -3960,7 +3958,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3960
3958
|
history.pushState({}, '');
|
|
3961
3959
|
}
|
|
3962
3960
|
if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
3963
|
-
this.renderPopup();
|
|
3961
|
+
this.renderPopup(e);
|
|
3964
3962
|
}
|
|
3965
3963
|
attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
3966
3964
|
}
|
|
@@ -7700,7 +7698,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7700
7698
|
}
|
|
7701
7699
|
}
|
|
7702
7700
|
incrementalSearch(e) {
|
|
7703
|
-
this.showPopup();
|
|
7701
|
+
this.showPopup(e);
|
|
7704
7702
|
if (!isNullOrUndefined(this.listData)) {
|
|
7705
7703
|
this.inlineSearch(e);
|
|
7706
7704
|
e.preventDefault();
|
|
@@ -7960,8 +7958,8 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7960
7958
|
* @returns {void}
|
|
7961
7959
|
* @deprecated
|
|
7962
7960
|
*/
|
|
7963
|
-
showPopup() {
|
|
7964
|
-
super.showPopup();
|
|
7961
|
+
showPopup(e) {
|
|
7962
|
+
super.showPopup(e);
|
|
7965
7963
|
}
|
|
7966
7964
|
/* eslint-disable valid-jsdoc, jsdoc/require-param */
|
|
7967
7965
|
/**
|
|
@@ -8236,13 +8234,13 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8236
8234
|
this.isTyped = true;
|
|
8237
8235
|
this.isDataFetched = this.isSelectCustom = false;
|
|
8238
8236
|
if (isNullOrUndefined(this.list)) {
|
|
8239
|
-
super.renderList(true);
|
|
8237
|
+
super.renderList(e, true);
|
|
8240
8238
|
}
|
|
8241
8239
|
this.queryString = this.filterInput.value;
|
|
8242
8240
|
if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
|
|
8243
8241
|
this.queryString = this.queryString === '' ? null : this.queryString;
|
|
8244
8242
|
this.beforePopupOpen = true;
|
|
8245
|
-
this.resetList(this.dataSource, this.fields);
|
|
8243
|
+
this.resetList(this.dataSource, this.fields, null, e);
|
|
8246
8244
|
return;
|
|
8247
8245
|
}
|
|
8248
8246
|
this.isSelected = false;
|
|
@@ -8262,7 +8260,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8262
8260
|
this.trigger('filtering', eventArgs, (eventArgs) => {
|
|
8263
8261
|
if (!eventArgs.cancel && !this.isFiltered && !eventArgs.preventDefaultAction) {
|
|
8264
8262
|
this.searchList = true;
|
|
8265
|
-
this.filterAction(this.dataSource, null, this.fields);
|
|
8263
|
+
this.filterAction(this.dataSource, null, this.fields, e);
|
|
8266
8264
|
}
|
|
8267
8265
|
});
|
|
8268
8266
|
}
|
|
@@ -8279,13 +8277,13 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8279
8277
|
this.isFiltered = true;
|
|
8280
8278
|
this.filterAction(dataSource, query, fields);
|
|
8281
8279
|
}
|
|
8282
|
-
filterAction(dataSource, query, fields) {
|
|
8280
|
+
filterAction(dataSource, query, fields, e) {
|
|
8283
8281
|
this.beforePopupOpen = true;
|
|
8284
8282
|
if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
|
|
8285
|
-
this.resetList(dataSource, fields, query);
|
|
8283
|
+
this.resetList(dataSource, fields, query, e);
|
|
8286
8284
|
}
|
|
8287
8285
|
else {
|
|
8288
|
-
this.hidePopup();
|
|
8286
|
+
this.hidePopup(e);
|
|
8289
8287
|
this.beforePopupOpen = false;
|
|
8290
8288
|
}
|
|
8291
8289
|
this.renderReactTemplates();
|
|
@@ -8371,9 +8369,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8371
8369
|
isFiltering() {
|
|
8372
8370
|
return true;
|
|
8373
8371
|
}
|
|
8374
|
-
renderPopup() {
|
|
8372
|
+
renderPopup(e) {
|
|
8375
8373
|
this.list.scrollTop = 0;
|
|
8376
|
-
super.renderPopup();
|
|
8374
|
+
super.renderPopup(e);
|
|
8377
8375
|
}
|
|
8378
8376
|
isEditTextBox() {
|
|
8379
8377
|
return true && this.inputElement.value.trim() !== '';
|
|
@@ -8385,13 +8383,37 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8385
8383
|
isSelectFocusItem(element) {
|
|
8386
8384
|
return false;
|
|
8387
8385
|
}
|
|
8386
|
+
setInputValue(newProp, oldProp) {
|
|
8387
|
+
let oldValue = oldProp && oldProp.text ? oldProp.text : oldProp ? oldProp.value : oldProp;
|
|
8388
|
+
let value = newProp && newProp.text ? newProp.text : newProp && newProp.value ? newProp.value : this.value;
|
|
8389
|
+
if (value && this.typedString === '' && !this.allowCustom && !(this.dataSource instanceof DataManager)) {
|
|
8390
|
+
let checkFields_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
|
|
8391
|
+
const listLength = this.getItems().length;
|
|
8392
|
+
let query = new Query();
|
|
8393
|
+
let _this = this;
|
|
8394
|
+
new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1, 'equal', value)))
|
|
8395
|
+
.then(function (e) {
|
|
8396
|
+
if (e.result.length > 0) {
|
|
8397
|
+
_this.value = checkFields_1 !== '' ? e.result[0][_this.fields.value].toString() : e.result[0].toString();
|
|
8398
|
+
_this.addItem(e.result, listLength);
|
|
8399
|
+
_this.updateValues();
|
|
8400
|
+
}
|
|
8401
|
+
else {
|
|
8402
|
+
newProp && newProp.text ? _this.setOldText(oldValue) : newProp && newProp.value ? _this.setOldValue(oldValue) : _this.updateValues();
|
|
8403
|
+
}
|
|
8404
|
+
});
|
|
8405
|
+
}
|
|
8406
|
+
else if (newProp) {
|
|
8407
|
+
newProp.text ? this.setOldText(oldValue) : this.setOldValue(oldValue);
|
|
8408
|
+
}
|
|
8409
|
+
}
|
|
8388
8410
|
/**
|
|
8389
8411
|
* Search the entered text and show it in the suggestion list if available.
|
|
8390
8412
|
*
|
|
8391
8413
|
* @returns {void}
|
|
8392
8414
|
* @deprecated
|
|
8393
8415
|
*/
|
|
8394
|
-
showPopup() {
|
|
8416
|
+
showPopup(e) {
|
|
8395
8417
|
if (!this.enabled) {
|
|
8396
8418
|
return;
|
|
8397
8419
|
}
|
|
@@ -8402,10 +8424,10 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8402
8424
|
this.beforePopupOpen = true;
|
|
8403
8425
|
this.preventAutoFill = true;
|
|
8404
8426
|
if (isNullOrUndefined(this.list)) {
|
|
8405
|
-
this.renderList();
|
|
8427
|
+
this.renderList(e);
|
|
8406
8428
|
}
|
|
8407
8429
|
else {
|
|
8408
|
-
this.resetList(this.dataSource, this.fields);
|
|
8430
|
+
this.resetList(this.dataSource, this.fields, null, e);
|
|
8409
8431
|
}
|
|
8410
8432
|
}
|
|
8411
8433
|
/**
|
|
@@ -8889,7 +8911,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8889
8911
|
}
|
|
8890
8912
|
}
|
|
8891
8913
|
}
|
|
8892
|
-
onPopupShown() {
|
|
8914
|
+
onPopupShown(e) {
|
|
8893
8915
|
if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
|
|
8894
8916
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
8895
8917
|
const proxy = this;
|
|
@@ -8900,7 +8922,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8900
8922
|
history.pushState({}, '');
|
|
8901
8923
|
}
|
|
8902
8924
|
const animModel = { name: 'FadeIn', duration: 100 };
|
|
8903
|
-
const eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };
|
|
8925
|
+
const eventArgs = { popup: this.popupObj, event: e, cancel: false, animation: animModel };
|
|
8904
8926
|
this.trigger('open', eventArgs, (eventArgs) => {
|
|
8905
8927
|
if (!eventArgs.cancel) {
|
|
8906
8928
|
this.focusAtFirstListItem();
|
|
@@ -9124,7 +9146,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9124
9146
|
this.renderPopup();
|
|
9125
9147
|
if (this.beforePopupOpen) {
|
|
9126
9148
|
this.beforePopupOpen = false;
|
|
9127
|
-
this.onPopupShown();
|
|
9149
|
+
this.onPopupShown(e);
|
|
9128
9150
|
}
|
|
9129
9151
|
}
|
|
9130
9152
|
refreshSelection() {
|
|
@@ -9416,7 +9438,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9416
9438
|
}
|
|
9417
9439
|
if (!this.isPopupOpen() &&
|
|
9418
9440
|
(this.openOnClick || (this.showDropDownIcon && e.target && e.target.className === dropdownIcon))) {
|
|
9419
|
-
this.showPopup();
|
|
9441
|
+
this.showPopup(e);
|
|
9420
9442
|
}
|
|
9421
9443
|
else {
|
|
9422
9444
|
this.hidePopup(e);
|
|
@@ -9710,7 +9732,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9710
9732
|
break;
|
|
9711
9733
|
case 40:
|
|
9712
9734
|
if (!this.isPopupOpen()) {
|
|
9713
|
-
this.showPopup();
|
|
9735
|
+
this.showPopup(e);
|
|
9714
9736
|
e.preventDefault();
|
|
9715
9737
|
}
|
|
9716
9738
|
break;
|
|
@@ -10895,7 +10917,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10895
10917
|
this.keyCode = e.keyCode;
|
|
10896
10918
|
}
|
|
10897
10919
|
if (!this.isPopupOpen() && this.openOnClick) {
|
|
10898
|
-
this.showPopup();
|
|
10920
|
+
this.showPopup(e);
|
|
10899
10921
|
}
|
|
10900
10922
|
this.openClick(e);
|
|
10901
10923
|
if (this.checkTextLength() && !this.allowFiltering && !isNullOrUndefined(e) && (e.keyCode !== 8)) {
|
|
@@ -11042,7 +11064,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11042
11064
|
|| this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
|
|
11043
11065
|
isEmptyData = true;
|
|
11044
11066
|
}
|
|
11045
|
-
super.render(isEmptyData);
|
|
11067
|
+
super.render(null, isEmptyData);
|
|
11046
11068
|
this.unwireListEvents();
|
|
11047
11069
|
this.wireListEvents();
|
|
11048
11070
|
}
|
|
@@ -12307,7 +12329,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12307
12329
|
*
|
|
12308
12330
|
* @returns {void}
|
|
12309
12331
|
*/
|
|
12310
|
-
showPopup() {
|
|
12332
|
+
showPopup(e) {
|
|
12311
12333
|
if (!this.enabled) {
|
|
12312
12334
|
return;
|
|
12313
12335
|
}
|
|
@@ -12316,7 +12338,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12316
12338
|
if (!args.cancel) {
|
|
12317
12339
|
if (!this.ulElement) {
|
|
12318
12340
|
this.beforePopupOpen = true;
|
|
12319
|
-
super.render();
|
|
12341
|
+
super.render(e);
|
|
12320
12342
|
if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
|
|
12321
12343
|
this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
12322
12344
|
}
|
|
@@ -12332,7 +12354,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12332
12354
|
this.beforePopupOpen = false;
|
|
12333
12355
|
return;
|
|
12334
12356
|
}
|
|
12335
|
-
this.onPopupShown();
|
|
12357
|
+
this.onPopupShown(e);
|
|
12336
12358
|
}
|
|
12337
12359
|
});
|
|
12338
12360
|
}
|
|
@@ -12438,7 +12460,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12438
12460
|
});
|
|
12439
12461
|
if (this.mode === 'Default' || this.mode === 'Box') {
|
|
12440
12462
|
this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
|
|
12441
|
-
this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
|
|
12442
12463
|
}
|
|
12443
12464
|
if (this.element.tagName !== this.getNgDirective()) {
|
|
12444
12465
|
this.element.style.display = 'none';
|
|
@@ -13503,8 +13524,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
13503
13524
|
});
|
|
13504
13525
|
}
|
|
13505
13526
|
}
|
|
13506
|
-
updateActionCompleteData(li, item) {
|
|
13507
|
-
this.jsonData.
|
|
13527
|
+
updateActionCompleteData(li, item, index) {
|
|
13528
|
+
this.jsonData.splice(index, 0, item);
|
|
13508
13529
|
}
|
|
13509
13530
|
initToolbar() {
|
|
13510
13531
|
const pos = this.toolbarSettings.position;
|
|
@@ -14042,7 +14063,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14042
14063
|
let objValue;
|
|
14043
14064
|
const dupData = [];
|
|
14044
14065
|
let itemIdx;
|
|
14045
|
-
extend(dupData, [], this.
|
|
14066
|
+
extend(dupData, [], this.jsonData);
|
|
14046
14067
|
const removeIdxes = [];
|
|
14047
14068
|
const removeLiIdxes = [];
|
|
14048
14069
|
for (let j = 0; j < items.length; j++) {
|
|
@@ -14815,9 +14836,8 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
14815
14836
|
fListBox.value = [];
|
|
14816
14837
|
listData = listData
|
|
14817
14838
|
.filter((data) => data.isHeader !== true);
|
|
14818
|
-
tListBox.listData = listData;
|
|
14819
|
-
|
|
14820
|
-
if (this.listData.length == this.jsonData.length) {
|
|
14839
|
+
tListBox.listData = tListBox.jsonData = listData;
|
|
14840
|
+
if (fListBox.listData.length == fListBox.jsonData.length) {
|
|
14821
14841
|
fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
|
|
14822
14842
|
}
|
|
14823
14843
|
else if (this.allowFiltering) {
|