@syncfusion/ej2-dropdowns 20.2.43 → 20.2.44
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/.eslintrc.json +244 -0
- package/CHANGELOG.md +26 -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 +86 -67
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +103 -84
- 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 +7 -7
- 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 +30 -35
- package/src/multi-select/multi-select.d.ts +1 -1
- package/src/multi-select/multi-select.js +10 -10
- 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
- package/tslint.json +111 -0
|
@@ -485,7 +485,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
485
485
|
*
|
|
486
486
|
* @returns {void}
|
|
487
487
|
*/
|
|
488
|
-
DropDownBase.prototype.initialize = function () {
|
|
488
|
+
DropDownBase.prototype.initialize = function (e) {
|
|
489
489
|
this.bindEvent = true;
|
|
490
490
|
this.actionFailureTemplateId = "" + this.element.id + ACTIONFAILURETEMPLATE_PROPERTY;
|
|
491
491
|
if (this.element.tagName === 'UL') {
|
|
@@ -504,7 +504,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
else {
|
|
507
|
-
this.setListData(this.dataSource, this.fields, this.query);
|
|
507
|
+
this.setListData(this.dataSource, this.fields, this.query, e);
|
|
508
508
|
}
|
|
509
509
|
};
|
|
510
510
|
/**
|
|
@@ -612,7 +612,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
612
612
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
613
613
|
* @returns {void}
|
|
614
614
|
*/
|
|
615
|
-
DropDownBase.prototype.setListData = function (dataSource, fields, query) {
|
|
615
|
+
DropDownBase.prototype.setListData = function (dataSource, fields, query, event) {
|
|
616
616
|
var _this = this;
|
|
617
617
|
fields = fields ? fields : this.fields;
|
|
618
618
|
var ulElement;
|
|
@@ -659,7 +659,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
659
659
|
_this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
|
|
660
660
|
if (!localDataArgs.cancel) {
|
|
661
661
|
ulElement = _this.renderItems(localDataArgs.result, fields);
|
|
662
|
-
_this.onActionComplete(ulElement, localDataArgs.result);
|
|
662
|
+
_this.onActionComplete(ulElement, localDataArgs.result, event);
|
|
663
663
|
if (_this.groupTemplate) {
|
|
664
664
|
_this.renderGroupTemplate(ulElement);
|
|
665
665
|
}
|
|
@@ -1049,7 +1049,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1049
1049
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
1050
1050
|
* @returns {void}
|
|
1051
1051
|
*/
|
|
1052
|
-
DropDownBase.prototype.resetList = function (dataSource, fields, query) {
|
|
1052
|
+
DropDownBase.prototype.resetList = function (dataSource, fields, query, e) {
|
|
1053
1053
|
if (this.list) {
|
|
1054
1054
|
if ((this.element.tagName === 'SELECT' && this.element.options.length > 0)
|
|
1055
1055
|
|| (this.element.tagName === 'UL' && this.element.childNodes.length > 0)) {
|
|
@@ -1060,7 +1060,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
}
|
|
1062
1062
|
dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length ? this.selectData : dataSource;
|
|
1063
|
-
this.setListData(dataSource, fields, query);
|
|
1063
|
+
this.setListData(dataSource, fields, query, e);
|
|
1064
1064
|
}
|
|
1065
1065
|
};
|
|
1066
1066
|
DropDownBase.prototype.updateSelectElementData = function (isFiltering) {
|
|
@@ -1152,7 +1152,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1152
1152
|
* @private
|
|
1153
1153
|
* @returns {void}
|
|
1154
1154
|
*/
|
|
1155
|
-
DropDownBase.prototype.render = function (isEmptyData) {
|
|
1155
|
+
DropDownBase.prototype.render = function (e, isEmptyData) {
|
|
1156
1156
|
this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
|
|
1157
1157
|
this.list.classList.add(dropDownBaseClasses.root);
|
|
1158
1158
|
this.setFields();
|
|
@@ -1176,7 +1176,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1176
1176
|
this.setEnableRtl();
|
|
1177
1177
|
this.setEnabled();
|
|
1178
1178
|
if (!isEmptyData) {
|
|
1179
|
-
this.initialize();
|
|
1179
|
+
this.initialize(e);
|
|
1180
1180
|
}
|
|
1181
1181
|
};
|
|
1182
1182
|
/**
|
|
@@ -1611,8 +1611,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1611
1611
|
this.popupObj.setProperties({ 'zIndex': this.zIndex });
|
|
1612
1612
|
}
|
|
1613
1613
|
};
|
|
1614
|
-
DropDownList.prototype.renderList = function (isEmptyData) {
|
|
1615
|
-
_super.prototype.render.call(this, isEmptyData);
|
|
1614
|
+
DropDownList.prototype.renderList = function (e, isEmptyData) {
|
|
1615
|
+
_super.prototype.render.call(this, e, isEmptyData);
|
|
1616
1616
|
this.unWireListEvents();
|
|
1617
1617
|
this.wireListEvents();
|
|
1618
1618
|
};
|
|
@@ -2097,7 +2097,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2097
2097
|
var isTabAction = e.action === 'tab' || e.action === 'close';
|
|
2098
2098
|
if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
|
|
2099
2099
|
this.searchKeyEvent = e;
|
|
2100
|
-
this.renderList();
|
|
2100
|
+
this.renderList(e);
|
|
2101
2101
|
}
|
|
2102
2102
|
if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
|
|
2103
2103
|
isNavigation && this.liCollections.length === 0) || this.isRequested) {
|
|
@@ -2136,7 +2136,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2136
2136
|
}
|
|
2137
2137
|
break;
|
|
2138
2138
|
case 'open':
|
|
2139
|
-
this.showPopup();
|
|
2139
|
+
this.showPopup(e);
|
|
2140
2140
|
break;
|
|
2141
2141
|
case 'hide':
|
|
2142
2142
|
this.preventAltUp = this.isPopupOpen;
|
|
@@ -2328,7 +2328,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2328
2328
|
}
|
|
2329
2329
|
if (!this.readonly) {
|
|
2330
2330
|
if (this.isPopupOpen) {
|
|
2331
|
-
this.hidePopup();
|
|
2331
|
+
this.hidePopup(e);
|
|
2332
2332
|
if (this.isFilterLayout()) {
|
|
2333
2333
|
this.focusDropDown(e);
|
|
2334
2334
|
}
|
|
@@ -2338,7 +2338,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2338
2338
|
this.floatLabelChange();
|
|
2339
2339
|
this.queryString = this.inputElement.value.trim() === '' ? null : this.inputElement.value;
|
|
2340
2340
|
this.isDropDownClick = true;
|
|
2341
|
-
this.showPopup();
|
|
2341
|
+
this.showPopup(e);
|
|
2342
2342
|
}
|
|
2343
2343
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
2344
2344
|
var proxy_1 = this;
|
|
@@ -2983,26 +2983,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2983
2983
|
}
|
|
2984
2984
|
this.initial = false;
|
|
2985
2985
|
}
|
|
2986
|
-
else if (this.getModuleName() === 'autocomplete' && this.value
|
|
2987
|
-
|
|
2988
|
-
var checkValue = list.some(function (x) { return x[checkFields_1] === _this.value; });
|
|
2989
|
-
var query = new Query();
|
|
2990
|
-
if (!checkValue) {
|
|
2991
|
-
new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1, 'equal', this.value)))
|
|
2992
|
-
.then(function (e) {
|
|
2993
|
-
if (e.result.length > 0) {
|
|
2994
|
-
_this.value = checkFields_1 !== '' ? e.result[0][_this.fields.value].toString() : e.result[0].toString();
|
|
2995
|
-
_this.addItem(e.result, list.length);
|
|
2996
|
-
_this.updateValues();
|
|
2997
|
-
}
|
|
2998
|
-
else {
|
|
2999
|
-
_this.updateValues();
|
|
3000
|
-
}
|
|
3001
|
-
});
|
|
3002
|
-
}
|
|
3003
|
-
else {
|
|
3004
|
-
this.updateValues();
|
|
3005
|
-
}
|
|
2986
|
+
else if (this.getModuleName() === 'autocomplete' && this.value) {
|
|
2987
|
+
this.setInputValue();
|
|
3006
2988
|
}
|
|
3007
2989
|
if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
|
|
3008
2990
|
if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
|
|
@@ -3025,7 +3007,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3025
3007
|
}
|
|
3026
3008
|
}
|
|
3027
3009
|
if (this.beforePopupOpen) {
|
|
3028
|
-
this.renderPopup();
|
|
3010
|
+
this.renderPopup(e);
|
|
3029
3011
|
}
|
|
3030
3012
|
}
|
|
3031
3013
|
};
|
|
@@ -3097,7 +3079,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3097
3079
|
removeClass(highlightedItem, dropDownListClasses.focus);
|
|
3098
3080
|
}
|
|
3099
3081
|
};
|
|
3100
|
-
DropDownList.prototype.renderPopup = function () {
|
|
3082
|
+
DropDownList.prototype.renderPopup = function (e) {
|
|
3101
3083
|
var _this = this;
|
|
3102
3084
|
if (this.popupObj && document.body.contains(this.popupObj.element)) {
|
|
3103
3085
|
this.refreshPopup();
|
|
@@ -3200,7 +3182,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3200
3182
|
var animModel = { name: 'FadeIn', duration: 100 };
|
|
3201
3183
|
_this.beforePopupOpen = true;
|
|
3202
3184
|
var popupInstance = _this.popupObj;
|
|
3203
|
-
var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
|
|
3185
|
+
var eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
|
|
3204
3186
|
_this.trigger('open', eventArgs, function (eventArgs) {
|
|
3205
3187
|
if (!eventArgs.cancel) {
|
|
3206
3188
|
addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
|
|
@@ -3613,7 +3595,12 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3613
3595
|
DropDownList.prototype.setFooterTemplate = function (popupEle) {
|
|
3614
3596
|
var compiledString;
|
|
3615
3597
|
if (this.footer) {
|
|
3616
|
-
this.
|
|
3598
|
+
if (this.isReact) {
|
|
3599
|
+
this.clearTemplate(['footerTemplate']);
|
|
3600
|
+
}
|
|
3601
|
+
else {
|
|
3602
|
+
this.footer.innerHTML = '';
|
|
3603
|
+
}
|
|
3617
3604
|
}
|
|
3618
3605
|
else {
|
|
3619
3606
|
this.footer = this.createElement('div');
|
|
@@ -3805,6 +3792,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3805
3792
|
}
|
|
3806
3793
|
});
|
|
3807
3794
|
}
|
|
3795
|
+
else if (this_1.getModuleName() === 'autocomplete') {
|
|
3796
|
+
this_1.setInputValue(newProp, oldProp);
|
|
3797
|
+
}
|
|
3808
3798
|
else {
|
|
3809
3799
|
this_1.setOldText(oldProp.text);
|
|
3810
3800
|
}
|
|
@@ -3846,6 +3836,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3846
3836
|
}
|
|
3847
3837
|
});
|
|
3848
3838
|
}
|
|
3839
|
+
else if (this_1.getModuleName() === 'autocomplete') {
|
|
3840
|
+
this_1.setInputValue(newProp, oldProp);
|
|
3841
|
+
}
|
|
3849
3842
|
else {
|
|
3850
3843
|
this_1.setOldValue(oldProp.value);
|
|
3851
3844
|
}
|
|
@@ -3964,6 +3957,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3964
3957
|
removeClass([this.inputWrapper.container], ['e-readonly']);
|
|
3965
3958
|
}
|
|
3966
3959
|
};
|
|
3960
|
+
DropDownList.prototype.setInputValue = function (newProp, oldProp) {
|
|
3961
|
+
};
|
|
3967
3962
|
DropDownList.prototype.setCssClass = function (newClass, oldClass) {
|
|
3968
3963
|
if (!isNullOrUndefined(oldClass)) {
|
|
3969
3964
|
oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
|
|
@@ -3990,7 +3985,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3990
3985
|
*
|
|
3991
3986
|
* @returns {void}
|
|
3992
3987
|
*/
|
|
3993
|
-
DropDownList.prototype.showPopup = function () {
|
|
3988
|
+
DropDownList.prototype.showPopup = function (e) {
|
|
3994
3989
|
if (!this.enabled) {
|
|
3995
3990
|
return;
|
|
3996
3991
|
}
|
|
@@ -4010,11 +4005,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4010
4005
|
}
|
|
4011
4006
|
else if (isNullOrUndefined(this.list) || !isUndefined(this.list) && (this.list.classList.contains(dropDownBaseClasses.noData) ||
|
|
4012
4007
|
this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
|
|
4013
|
-
this.renderList();
|
|
4008
|
+
this.renderList(e);
|
|
4014
4009
|
}
|
|
4015
|
-
this.invokeRenderPopup();
|
|
4010
|
+
this.invokeRenderPopup(e);
|
|
4016
4011
|
};
|
|
4017
|
-
DropDownList.prototype.invokeRenderPopup = function () {
|
|
4012
|
+
DropDownList.prototype.invokeRenderPopup = function (e) {
|
|
4018
4013
|
if (Browser.isDevice && this.isFilterLayout()) {
|
|
4019
4014
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
4020
4015
|
var proxy_2 = this;
|
|
@@ -4024,7 +4019,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4024
4019
|
history.pushState({}, '');
|
|
4025
4020
|
}
|
|
4026
4021
|
if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
4027
|
-
this.renderPopup();
|
|
4022
|
+
this.renderPopup(e);
|
|
4028
4023
|
}
|
|
4029
4024
|
attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
4030
4025
|
};
|
|
@@ -7817,7 +7812,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7817
7812
|
}
|
|
7818
7813
|
};
|
|
7819
7814
|
ComboBox.prototype.incrementalSearch = function (e) {
|
|
7820
|
-
this.showPopup();
|
|
7815
|
+
this.showPopup(e);
|
|
7821
7816
|
if (!isNullOrUndefined(this.listData)) {
|
|
7822
7817
|
this.inlineSearch(e);
|
|
7823
7818
|
e.preventDefault();
|
|
@@ -8080,8 +8075,8 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8080
8075
|
* @returns {void}
|
|
8081
8076
|
* @deprecated
|
|
8082
8077
|
*/
|
|
8083
|
-
ComboBox.prototype.showPopup = function () {
|
|
8084
|
-
_super.prototype.showPopup.call(this);
|
|
8078
|
+
ComboBox.prototype.showPopup = function (e) {
|
|
8079
|
+
_super.prototype.showPopup.call(this, e);
|
|
8085
8080
|
};
|
|
8086
8081
|
/* eslint-disable valid-jsdoc, jsdoc/require-param */
|
|
8087
8082
|
/**
|
|
@@ -8318,10 +8313,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8318
8313
|
* @private
|
|
8319
8314
|
*/
|
|
8320
8315
|
function AutoComplete(options, element) {
|
|
8321
|
-
var
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
return
|
|
8316
|
+
var _this_1 = _super.call(this, options, element) || this;
|
|
8317
|
+
_this_1.isFiltered = false;
|
|
8318
|
+
_this_1.searchList = false;
|
|
8319
|
+
return _this_1;
|
|
8325
8320
|
}
|
|
8326
8321
|
/**
|
|
8327
8322
|
* Initialize the event handler
|
|
@@ -8369,17 +8364,17 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8369
8364
|
return filterQuery;
|
|
8370
8365
|
};
|
|
8371
8366
|
AutoComplete.prototype.searchLists = function (e) {
|
|
8372
|
-
var
|
|
8367
|
+
var _this_1 = this;
|
|
8373
8368
|
this.isTyped = true;
|
|
8374
8369
|
this.isDataFetched = this.isSelectCustom = false;
|
|
8375
8370
|
if (isNullOrUndefined(this.list)) {
|
|
8376
|
-
_super.prototype.renderList.call(this, true);
|
|
8371
|
+
_super.prototype.renderList.call(this, e, true);
|
|
8377
8372
|
}
|
|
8378
8373
|
this.queryString = this.filterInput.value;
|
|
8379
8374
|
if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
|
|
8380
8375
|
this.queryString = this.queryString === '' ? null : this.queryString;
|
|
8381
8376
|
this.beforePopupOpen = true;
|
|
8382
|
-
this.resetList(this.dataSource, this.fields);
|
|
8377
|
+
this.resetList(this.dataSource, this.fields, null, e);
|
|
8383
8378
|
return;
|
|
8384
8379
|
}
|
|
8385
8380
|
this.isSelected = false;
|
|
@@ -8391,15 +8386,15 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8391
8386
|
if (eventArgs.cancel) {
|
|
8392
8387
|
return;
|
|
8393
8388
|
}
|
|
8394
|
-
|
|
8395
|
-
|
|
8389
|
+
_this_1.isFiltered = true;
|
|
8390
|
+
_this_1.filterAction(dataSource, query, fields);
|
|
8396
8391
|
},
|
|
8397
8392
|
cancel: false
|
|
8398
8393
|
};
|
|
8399
8394
|
this.trigger('filtering', eventArgs, function (eventArgs) {
|
|
8400
|
-
if (!eventArgs.cancel && !
|
|
8401
|
-
|
|
8402
|
-
|
|
8395
|
+
if (!eventArgs.cancel && !_this_1.isFiltered && !eventArgs.preventDefaultAction) {
|
|
8396
|
+
_this_1.searchList = true;
|
|
8397
|
+
_this_1.filterAction(_this_1.dataSource, null, _this_1.fields, e);
|
|
8403
8398
|
}
|
|
8404
8399
|
});
|
|
8405
8400
|
};
|
|
@@ -8416,13 +8411,13 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8416
8411
|
this.isFiltered = true;
|
|
8417
8412
|
this.filterAction(dataSource, query, fields);
|
|
8418
8413
|
};
|
|
8419
|
-
AutoComplete.prototype.filterAction = function (dataSource, query, fields) {
|
|
8414
|
+
AutoComplete.prototype.filterAction = function (dataSource, query, fields, e) {
|
|
8420
8415
|
this.beforePopupOpen = true;
|
|
8421
8416
|
if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
|
|
8422
|
-
this.resetList(dataSource, fields, query);
|
|
8417
|
+
this.resetList(dataSource, fields, query, e);
|
|
8423
8418
|
}
|
|
8424
8419
|
else {
|
|
8425
|
-
this.hidePopup();
|
|
8420
|
+
this.hidePopup(e);
|
|
8426
8421
|
this.beforePopupOpen = false;
|
|
8427
8422
|
}
|
|
8428
8423
|
this.renderReactTemplates();
|
|
@@ -8479,18 +8474,18 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8479
8474
|
}
|
|
8480
8475
|
};
|
|
8481
8476
|
AutoComplete.prototype.listOption = function (dataSource, fieldsSettings) {
|
|
8482
|
-
var
|
|
8477
|
+
var _this_1 = this;
|
|
8483
8478
|
var fields = _super.prototype.listOption.call(this, dataSource, fieldsSettings);
|
|
8484
8479
|
if (isNullOrUndefined(fields.itemCreated)) {
|
|
8485
8480
|
fields.itemCreated = function (e) {
|
|
8486
|
-
if (
|
|
8487
|
-
if (
|
|
8481
|
+
if (_this_1.highlight) {
|
|
8482
|
+
if (_this_1.element.tagName === _this_1.getNgDirective() && _this_1.itemTemplate) {
|
|
8488
8483
|
setTimeout(function () {
|
|
8489
|
-
highlightSearch(e.item,
|
|
8484
|
+
highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
|
|
8490
8485
|
}, 0);
|
|
8491
8486
|
}
|
|
8492
8487
|
else {
|
|
8493
|
-
highlightSearch(e.item,
|
|
8488
|
+
highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
|
|
8494
8489
|
}
|
|
8495
8490
|
}
|
|
8496
8491
|
};
|
|
@@ -8498,10 +8493,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8498
8493
|
else {
|
|
8499
8494
|
var itemCreated_1 = fields.itemCreated;
|
|
8500
8495
|
fields.itemCreated = function (e) {
|
|
8501
|
-
if (
|
|
8502
|
-
highlightSearch(e.item,
|
|
8496
|
+
if (_this_1.highlight) {
|
|
8497
|
+
highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
|
|
8503
8498
|
}
|
|
8504
|
-
itemCreated_1.apply(
|
|
8499
|
+
itemCreated_1.apply(_this_1, [e]);
|
|
8505
8500
|
};
|
|
8506
8501
|
}
|
|
8507
8502
|
return fields;
|
|
@@ -8509,9 +8504,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8509
8504
|
AutoComplete.prototype.isFiltering = function () {
|
|
8510
8505
|
return true;
|
|
8511
8506
|
};
|
|
8512
|
-
AutoComplete.prototype.renderPopup = function () {
|
|
8507
|
+
AutoComplete.prototype.renderPopup = function (e) {
|
|
8513
8508
|
this.list.scrollTop = 0;
|
|
8514
|
-
_super.prototype.renderPopup.call(this);
|
|
8509
|
+
_super.prototype.renderPopup.call(this, e);
|
|
8515
8510
|
};
|
|
8516
8511
|
AutoComplete.prototype.isEditTextBox = function () {
|
|
8517
8512
|
return true && this.inputElement.value.trim() !== '';
|
|
@@ -8523,13 +8518,37 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8523
8518
|
AutoComplete.prototype.isSelectFocusItem = function (element) {
|
|
8524
8519
|
return false;
|
|
8525
8520
|
};
|
|
8521
|
+
AutoComplete.prototype.setInputValue = function (newProp, oldProp) {
|
|
8522
|
+
var oldValue = oldProp && oldProp.text ? oldProp.text : oldProp ? oldProp.value : oldProp;
|
|
8523
|
+
var value = newProp && newProp.text ? newProp.text : newProp && newProp.value ? newProp.value : this.value;
|
|
8524
|
+
if (value && this.typedString === '' && !this.allowCustom && !(this.dataSource instanceof DataManager)) {
|
|
8525
|
+
var checkFields_1_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
|
|
8526
|
+
var listLength_1 = this.getItems().length;
|
|
8527
|
+
var query = new Query();
|
|
8528
|
+
var _this_2 = this;
|
|
8529
|
+
new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1_1, 'equal', value)))
|
|
8530
|
+
.then(function (e) {
|
|
8531
|
+
if (e.result.length > 0) {
|
|
8532
|
+
_this_2.value = checkFields_1_1 !== '' ? e.result[0][_this_2.fields.value].toString() : e.result[0].toString();
|
|
8533
|
+
_this_2.addItem(e.result, listLength_1);
|
|
8534
|
+
_this_2.updateValues();
|
|
8535
|
+
}
|
|
8536
|
+
else {
|
|
8537
|
+
newProp && newProp.text ? _this_2.setOldText(oldValue) : newProp && newProp.value ? _this_2.setOldValue(oldValue) : _this_2.updateValues();
|
|
8538
|
+
}
|
|
8539
|
+
});
|
|
8540
|
+
}
|
|
8541
|
+
else if (newProp) {
|
|
8542
|
+
newProp.text ? this.setOldText(oldValue) : this.setOldValue(oldValue);
|
|
8543
|
+
}
|
|
8544
|
+
};
|
|
8526
8545
|
/**
|
|
8527
8546
|
* Search the entered text and show it in the suggestion list if available.
|
|
8528
8547
|
*
|
|
8529
8548
|
* @returns {void}
|
|
8530
8549
|
* @deprecated
|
|
8531
8550
|
*/
|
|
8532
|
-
AutoComplete.prototype.showPopup = function () {
|
|
8551
|
+
AutoComplete.prototype.showPopup = function (e) {
|
|
8533
8552
|
if (!this.enabled) {
|
|
8534
8553
|
return;
|
|
8535
8554
|
}
|
|
@@ -8540,10 +8559,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8540
8559
|
this.beforePopupOpen = true;
|
|
8541
8560
|
this.preventAutoFill = true;
|
|
8542
8561
|
if (isNullOrUndefined(this.list)) {
|
|
8543
|
-
this.renderList();
|
|
8562
|
+
this.renderList(e);
|
|
8544
8563
|
}
|
|
8545
8564
|
else {
|
|
8546
|
-
this.resetList(this.dataSource, this.fields);
|
|
8565
|
+
this.resetList(this.dataSource, this.fields, null, e);
|
|
8547
8566
|
}
|
|
8548
8567
|
};
|
|
8549
8568
|
/**
|
|
@@ -9045,7 +9064,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9045
9064
|
}
|
|
9046
9065
|
}
|
|
9047
9066
|
};
|
|
9048
|
-
MultiSelect.prototype.onPopupShown = function () {
|
|
9067
|
+
MultiSelect.prototype.onPopupShown = function (e) {
|
|
9049
9068
|
var _this = this;
|
|
9050
9069
|
if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
|
|
9051
9070
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -9057,7 +9076,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9057
9076
|
history.pushState({}, '');
|
|
9058
9077
|
}
|
|
9059
9078
|
var animModel = { name: 'FadeIn', duration: 100 };
|
|
9060
|
-
var eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };
|
|
9079
|
+
var eventArgs = { popup: this.popupObj, event: e, cancel: false, animation: animModel };
|
|
9061
9080
|
this.trigger('open', eventArgs, function (eventArgs) {
|
|
9062
9081
|
if (!eventArgs.cancel) {
|
|
9063
9082
|
_this.focusAtFirstListItem();
|
|
@@ -9281,7 +9300,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9281
9300
|
this.renderPopup();
|
|
9282
9301
|
if (this.beforePopupOpen) {
|
|
9283
9302
|
this.beforePopupOpen = false;
|
|
9284
|
-
this.onPopupShown();
|
|
9303
|
+
this.onPopupShown(e);
|
|
9285
9304
|
}
|
|
9286
9305
|
};
|
|
9287
9306
|
MultiSelect.prototype.refreshSelection = function () {
|
|
@@ -9573,7 +9592,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9573
9592
|
}
|
|
9574
9593
|
if (!this.isPopupOpen() &&
|
|
9575
9594
|
(this.openOnClick || (this.showDropDownIcon && e.target && e.target.className === dropdownIcon))) {
|
|
9576
|
-
this.showPopup();
|
|
9595
|
+
this.showPopup(e);
|
|
9577
9596
|
}
|
|
9578
9597
|
else {
|
|
9579
9598
|
this.hidePopup(e);
|
|
@@ -9867,7 +9886,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9867
9886
|
break;
|
|
9868
9887
|
case 40:
|
|
9869
9888
|
if (!this.isPopupOpen()) {
|
|
9870
|
-
this.showPopup();
|
|
9889
|
+
this.showPopup(e);
|
|
9871
9890
|
e.preventDefault();
|
|
9872
9891
|
}
|
|
9873
9892
|
break;
|
|
@@ -11058,7 +11077,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11058
11077
|
this.keyCode = e.keyCode;
|
|
11059
11078
|
}
|
|
11060
11079
|
if (!this.isPopupOpen() && this.openOnClick) {
|
|
11061
|
-
this.showPopup();
|
|
11080
|
+
this.showPopup(e);
|
|
11062
11081
|
}
|
|
11063
11082
|
this.openClick(e);
|
|
11064
11083
|
if (this.checkTextLength() && !this.allowFiltering && !isNullOrUndefined(e) && (e.keyCode !== 8)) {
|
|
@@ -11205,7 +11224,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11205
11224
|
|| this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
|
|
11206
11225
|
isEmptyData = true;
|
|
11207
11226
|
}
|
|
11208
|
-
_super.prototype.render.call(this, isEmptyData);
|
|
11227
|
+
_super.prototype.render.call(this, null, isEmptyData);
|
|
11209
11228
|
this.unwireListEvents();
|
|
11210
11229
|
this.wireListEvents();
|
|
11211
11230
|
};
|
|
@@ -12478,7 +12497,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12478
12497
|
*
|
|
12479
12498
|
* @returns {void}
|
|
12480
12499
|
*/
|
|
12481
|
-
MultiSelect.prototype.showPopup = function () {
|
|
12500
|
+
MultiSelect.prototype.showPopup = function (e) {
|
|
12482
12501
|
var _this = this;
|
|
12483
12502
|
if (!this.enabled) {
|
|
12484
12503
|
return;
|
|
@@ -12488,7 +12507,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12488
12507
|
if (!args.cancel) {
|
|
12489
12508
|
if (!_this.ulElement) {
|
|
12490
12509
|
_this.beforePopupOpen = true;
|
|
12491
|
-
_super.prototype.render.call(_this);
|
|
12510
|
+
_super.prototype.render.call(_this, e);
|
|
12492
12511
|
if (_this.mode === 'CheckBox' && Browser.isDevice && _this.allowFiltering) {
|
|
12493
12512
|
_this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox' });
|
|
12494
12513
|
}
|
|
@@ -12504,7 +12523,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12504
12523
|
_this.beforePopupOpen = false;
|
|
12505
12524
|
return;
|
|
12506
12525
|
}
|
|
12507
|
-
_this.onPopupShown();
|
|
12526
|
+
_this.onPopupShown(e);
|
|
12508
12527
|
}
|
|
12509
12528
|
});
|
|
12510
12529
|
};
|