@syncfusion/ej2-dropdowns 20.2.43 → 20.2.46
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 +28 -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 +103 -72
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +120 -89
- 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 +4 -3
- package/src/drop-down-base/drop-down-base.js +12 -9
- package/src/drop-down-list/drop-down-list.d.ts +6 -5
- package/src/drop-down-list/drop-down-list.js +40 -37
- package/src/multi-select/float-label.js +4 -2
- 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
- package/tslint.json +111 -0
|
@@ -257,6 +257,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
257
257
|
_this.isAngular = false;
|
|
258
258
|
_this.isPreventChange = false;
|
|
259
259
|
_this.isDynamicDataChange = false;
|
|
260
|
+
_this.addedNewItem = false;
|
|
260
261
|
return _this;
|
|
261
262
|
}
|
|
262
263
|
DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
|
|
@@ -485,7 +486,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
485
486
|
*
|
|
486
487
|
* @returns {void}
|
|
487
488
|
*/
|
|
488
|
-
DropDownBase.prototype.initialize = function () {
|
|
489
|
+
DropDownBase.prototype.initialize = function (e) {
|
|
489
490
|
this.bindEvent = true;
|
|
490
491
|
this.actionFailureTemplateId = "" + this.element.id + ACTIONFAILURETEMPLATE_PROPERTY;
|
|
491
492
|
if (this.element.tagName === 'UL') {
|
|
@@ -504,7 +505,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
504
505
|
}
|
|
505
506
|
}
|
|
506
507
|
else {
|
|
507
|
-
this.setListData(this.dataSource, this.fields, this.query);
|
|
508
|
+
this.setListData(this.dataSource, this.fields, this.query, e);
|
|
508
509
|
}
|
|
509
510
|
};
|
|
510
511
|
/**
|
|
@@ -612,7 +613,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
612
613
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
613
614
|
* @returns {void}
|
|
614
615
|
*/
|
|
615
|
-
DropDownBase.prototype.setListData = function (dataSource, fields, query) {
|
|
616
|
+
DropDownBase.prototype.setListData = function (dataSource, fields, query, event) {
|
|
616
617
|
var _this = this;
|
|
617
618
|
fields = fields ? fields : this.fields;
|
|
618
619
|
var ulElement;
|
|
@@ -659,7 +660,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
659
660
|
_this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
|
|
660
661
|
if (!localDataArgs.cancel) {
|
|
661
662
|
ulElement = _this.renderItems(localDataArgs.result, fields);
|
|
662
|
-
_this.onActionComplete(ulElement, localDataArgs.result);
|
|
663
|
+
_this.onActionComplete(ulElement, localDataArgs.result, event);
|
|
663
664
|
if (_this.groupTemplate) {
|
|
664
665
|
_this.renderGroupTemplate(ulElement);
|
|
665
666
|
}
|
|
@@ -1049,7 +1050,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1049
1050
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
1050
1051
|
* @returns {void}
|
|
1051
1052
|
*/
|
|
1052
|
-
DropDownBase.prototype.resetList = function (dataSource, fields, query) {
|
|
1053
|
+
DropDownBase.prototype.resetList = function (dataSource, fields, query, e) {
|
|
1053
1054
|
if (this.list) {
|
|
1054
1055
|
if ((this.element.tagName === 'SELECT' && this.element.options.length > 0)
|
|
1055
1056
|
|| (this.element.tagName === 'UL' && this.element.childNodes.length > 0)) {
|
|
@@ -1059,8 +1060,9 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1059
1060
|
dataSource = this.selectData;
|
|
1060
1061
|
}
|
|
1061
1062
|
}
|
|
1062
|
-
dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length ? this.selectData : dataSource;
|
|
1063
|
-
this.
|
|
1063
|
+
dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length && this.addedNewItem ? this.selectData : dataSource;
|
|
1064
|
+
this.addedNewItem = false;
|
|
1065
|
+
this.setListData(dataSource, fields, query, e);
|
|
1064
1066
|
}
|
|
1065
1067
|
};
|
|
1066
1068
|
DropDownBase.prototype.updateSelectElementData = function (isFiltering) {
|
|
@@ -1152,7 +1154,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1152
1154
|
* @private
|
|
1153
1155
|
* @returns {void}
|
|
1154
1156
|
*/
|
|
1155
|
-
DropDownBase.prototype.render = function (isEmptyData) {
|
|
1157
|
+
DropDownBase.prototype.render = function (e, isEmptyData) {
|
|
1156
1158
|
this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
|
|
1157
1159
|
this.list.classList.add(dropDownBaseClasses.root);
|
|
1158
1160
|
this.setFields();
|
|
@@ -1176,7 +1178,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1176
1178
|
this.setEnableRtl();
|
|
1177
1179
|
this.setEnabled();
|
|
1178
1180
|
if (!isEmptyData) {
|
|
1179
|
-
this.initialize();
|
|
1181
|
+
this.initialize(e);
|
|
1180
1182
|
}
|
|
1181
1183
|
};
|
|
1182
1184
|
/**
|
|
@@ -1317,6 +1319,7 @@ var DropDownBase = /** @__PURE__ @class */ (function (_super) {
|
|
|
1317
1319
|
if (selectedItemValue || itemIndex === 0) {
|
|
1318
1320
|
this.updateSelection();
|
|
1319
1321
|
}
|
|
1322
|
+
this.addedNewItem = true;
|
|
1320
1323
|
};
|
|
1321
1324
|
DropDownBase.prototype.validationAttribute = function (target, hidden) {
|
|
1322
1325
|
var name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');
|
|
@@ -1611,8 +1614,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
1611
1614
|
this.popupObj.setProperties({ 'zIndex': this.zIndex });
|
|
1612
1615
|
}
|
|
1613
1616
|
};
|
|
1614
|
-
DropDownList.prototype.renderList = function (isEmptyData) {
|
|
1615
|
-
_super.prototype.render.call(this, isEmptyData);
|
|
1617
|
+
DropDownList.prototype.renderList = function (e, isEmptyData) {
|
|
1618
|
+
_super.prototype.render.call(this, e, isEmptyData);
|
|
1616
1619
|
this.unWireListEvents();
|
|
1617
1620
|
this.wireListEvents();
|
|
1618
1621
|
};
|
|
@@ -2097,7 +2100,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2097
2100
|
var isTabAction = e.action === 'tab' || e.action === 'close';
|
|
2098
2101
|
if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
|
|
2099
2102
|
this.searchKeyEvent = e;
|
|
2100
|
-
this.renderList();
|
|
2103
|
+
this.renderList(e);
|
|
2101
2104
|
}
|
|
2102
2105
|
if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
|
|
2103
2106
|
isNavigation && this.liCollections.length === 0) || this.isRequested) {
|
|
@@ -2136,7 +2139,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2136
2139
|
}
|
|
2137
2140
|
break;
|
|
2138
2141
|
case 'open':
|
|
2139
|
-
this.showPopup();
|
|
2142
|
+
this.showPopup(e);
|
|
2140
2143
|
break;
|
|
2141
2144
|
case 'hide':
|
|
2142
2145
|
this.preventAltUp = this.isPopupOpen;
|
|
@@ -2328,7 +2331,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2328
2331
|
}
|
|
2329
2332
|
if (!this.readonly) {
|
|
2330
2333
|
if (this.isPopupOpen) {
|
|
2331
|
-
this.hidePopup();
|
|
2334
|
+
this.hidePopup(e);
|
|
2332
2335
|
if (this.isFilterLayout()) {
|
|
2333
2336
|
this.focusDropDown(e);
|
|
2334
2337
|
}
|
|
@@ -2338,7 +2341,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2338
2341
|
this.floatLabelChange();
|
|
2339
2342
|
this.queryString = this.inputElement.value.trim() === '' ? null : this.inputElement.value;
|
|
2340
2343
|
this.isDropDownClick = true;
|
|
2341
|
-
this.showPopup();
|
|
2344
|
+
this.showPopup(e);
|
|
2342
2345
|
}
|
|
2343
2346
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
2344
2347
|
var proxy_1 = this;
|
|
@@ -2983,26 +2986,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
2983
2986
|
}
|
|
2984
2987
|
this.initial = false;
|
|
2985
2988
|
}
|
|
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
|
-
}
|
|
2989
|
+
else if (this.getModuleName() === 'autocomplete' && this.value) {
|
|
2990
|
+
this.setInputValue();
|
|
3006
2991
|
}
|
|
3007
2992
|
if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
|
|
3008
2993
|
if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
|
|
@@ -3025,7 +3010,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3025
3010
|
}
|
|
3026
3011
|
}
|
|
3027
3012
|
if (this.beforePopupOpen) {
|
|
3028
|
-
this.renderPopup();
|
|
3013
|
+
this.renderPopup(e);
|
|
3029
3014
|
}
|
|
3030
3015
|
}
|
|
3031
3016
|
};
|
|
@@ -3097,7 +3082,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3097
3082
|
removeClass(highlightedItem, dropDownListClasses.focus);
|
|
3098
3083
|
}
|
|
3099
3084
|
};
|
|
3100
|
-
DropDownList.prototype.renderPopup = function () {
|
|
3085
|
+
DropDownList.prototype.renderPopup = function (e) {
|
|
3101
3086
|
var _this = this;
|
|
3102
3087
|
if (this.popupObj && document.body.contains(this.popupObj.element)) {
|
|
3103
3088
|
this.refreshPopup();
|
|
@@ -3200,7 +3185,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3200
3185
|
var animModel = { name: 'FadeIn', duration: 100 };
|
|
3201
3186
|
_this.beforePopupOpen = true;
|
|
3202
3187
|
var popupInstance = _this.popupObj;
|
|
3203
|
-
var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
|
|
3188
|
+
var eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
|
|
3204
3189
|
_this.trigger('open', eventArgs, function (eventArgs) {
|
|
3205
3190
|
if (!eventArgs.cancel) {
|
|
3206
3191
|
addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
|
|
@@ -3522,14 +3507,14 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3522
3507
|
if (this.element.tagName === 'INPUT') {
|
|
3523
3508
|
this.inputElement = this.element;
|
|
3524
3509
|
if (isNullOrUndefined(this.inputElement.getAttribute('role'))) {
|
|
3525
|
-
this.inputElement.setAttribute('role', '
|
|
3510
|
+
this.inputElement.setAttribute('role', 'combobox');
|
|
3526
3511
|
}
|
|
3527
3512
|
if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
|
|
3528
3513
|
this.inputElement.setAttribute('type', 'text');
|
|
3529
3514
|
}
|
|
3530
3515
|
}
|
|
3531
3516
|
else {
|
|
3532
|
-
this.inputElement = this.createElement('input', { attrs: { role: '
|
|
3517
|
+
this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
|
|
3533
3518
|
if (this.element.tagName !== this.getNgDirective()) {
|
|
3534
3519
|
this.element.style.display = 'none';
|
|
3535
3520
|
}
|
|
@@ -3578,6 +3563,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3578
3563
|
attributes(this.targetElement(), this.getAriaAttributes());
|
|
3579
3564
|
this.updateDataAttribute(this.htmlAttributes);
|
|
3580
3565
|
this.setHTMLAttributes();
|
|
3566
|
+
if (this.targetElement() === this.inputElement) {
|
|
3567
|
+
this.element.removeAttribute('aria-labelledby');
|
|
3568
|
+
}
|
|
3581
3569
|
if (this.value !== null || this.activeIndex !== null || this.text !== null) {
|
|
3582
3570
|
this.initValue();
|
|
3583
3571
|
}
|
|
@@ -3608,12 +3596,22 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3608
3596
|
if (this.element.hasAttribute('data-val')) {
|
|
3609
3597
|
this.element.setAttribute('data-val', 'false');
|
|
3610
3598
|
}
|
|
3599
|
+
var floatLabelElement = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
|
|
3600
|
+
if (!isNullOrUndefined(this.element.id) && this.element.id !== '' && !isNullOrUndefined(floatLabelElement)) {
|
|
3601
|
+
floatLabelElement.id = 'label_' + this.element.id.replace(/ /g, '_');
|
|
3602
|
+
attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
|
|
3603
|
+
}
|
|
3611
3604
|
this.renderComplete();
|
|
3612
3605
|
};
|
|
3613
3606
|
DropDownList.prototype.setFooterTemplate = function (popupEle) {
|
|
3614
3607
|
var compiledString;
|
|
3615
3608
|
if (this.footer) {
|
|
3616
|
-
this.
|
|
3609
|
+
if (this.isReact) {
|
|
3610
|
+
this.clearTemplate(['footerTemplate']);
|
|
3611
|
+
}
|
|
3612
|
+
else {
|
|
3613
|
+
this.footer.innerHTML = '';
|
|
3614
|
+
}
|
|
3617
3615
|
}
|
|
3618
3616
|
else {
|
|
3619
3617
|
this.footer = this.createElement('div');
|
|
@@ -3805,6 +3803,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3805
3803
|
}
|
|
3806
3804
|
});
|
|
3807
3805
|
}
|
|
3806
|
+
else if (this_1.getModuleName() === 'autocomplete') {
|
|
3807
|
+
this_1.setInputValue(newProp, oldProp);
|
|
3808
|
+
}
|
|
3808
3809
|
else {
|
|
3809
3810
|
this_1.setOldText(oldProp.text);
|
|
3810
3811
|
}
|
|
@@ -3846,6 +3847,9 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3846
3847
|
}
|
|
3847
3848
|
});
|
|
3848
3849
|
}
|
|
3850
|
+
else if (this_1.getModuleName() === 'autocomplete') {
|
|
3851
|
+
this_1.setInputValue(newProp, oldProp);
|
|
3852
|
+
}
|
|
3849
3853
|
else {
|
|
3850
3854
|
this_1.setOldValue(oldProp.value);
|
|
3851
3855
|
}
|
|
@@ -3964,6 +3968,8 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3964
3968
|
removeClass([this.inputWrapper.container], ['e-readonly']);
|
|
3965
3969
|
}
|
|
3966
3970
|
};
|
|
3971
|
+
DropDownList.prototype.setInputValue = function (newProp, oldProp) {
|
|
3972
|
+
};
|
|
3967
3973
|
DropDownList.prototype.setCssClass = function (newClass, oldClass) {
|
|
3968
3974
|
if (!isNullOrUndefined(oldClass)) {
|
|
3969
3975
|
oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
|
|
@@ -3990,7 +3996,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
3990
3996
|
*
|
|
3991
3997
|
* @returns {void}
|
|
3992
3998
|
*/
|
|
3993
|
-
DropDownList.prototype.showPopup = function () {
|
|
3999
|
+
DropDownList.prototype.showPopup = function (e) {
|
|
3994
4000
|
if (!this.enabled) {
|
|
3995
4001
|
return;
|
|
3996
4002
|
}
|
|
@@ -4010,11 +4016,11 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4010
4016
|
}
|
|
4011
4017
|
else if (isNullOrUndefined(this.list) || !isUndefined(this.list) && (this.list.classList.contains(dropDownBaseClasses.noData) ||
|
|
4012
4018
|
this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
|
|
4013
|
-
this.renderList();
|
|
4019
|
+
this.renderList(e);
|
|
4014
4020
|
}
|
|
4015
|
-
this.invokeRenderPopup();
|
|
4021
|
+
this.invokeRenderPopup(e);
|
|
4016
4022
|
};
|
|
4017
|
-
DropDownList.prototype.invokeRenderPopup = function () {
|
|
4023
|
+
DropDownList.prototype.invokeRenderPopup = function (e) {
|
|
4018
4024
|
if (Browser.isDevice && this.isFilterLayout()) {
|
|
4019
4025
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
4020
4026
|
var proxy_2 = this;
|
|
@@ -4024,7 +4030,7 @@ var DropDownList = /** @__PURE__ @class */ (function (_super) {
|
|
|
4024
4030
|
history.pushState({}, '');
|
|
4025
4031
|
}
|
|
4026
4032
|
if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
4027
|
-
this.renderPopup();
|
|
4033
|
+
this.renderPopup(e);
|
|
4028
4034
|
}
|
|
4029
4035
|
attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
4030
4036
|
};
|
|
@@ -7817,7 +7823,7 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
7817
7823
|
}
|
|
7818
7824
|
};
|
|
7819
7825
|
ComboBox.prototype.incrementalSearch = function (e) {
|
|
7820
|
-
this.showPopup();
|
|
7826
|
+
this.showPopup(e);
|
|
7821
7827
|
if (!isNullOrUndefined(this.listData)) {
|
|
7822
7828
|
this.inlineSearch(e);
|
|
7823
7829
|
e.preventDefault();
|
|
@@ -8080,8 +8086,8 @@ var ComboBox = /** @__PURE__ @class */ (function (_super) {
|
|
|
8080
8086
|
* @returns {void}
|
|
8081
8087
|
* @deprecated
|
|
8082
8088
|
*/
|
|
8083
|
-
ComboBox.prototype.showPopup = function () {
|
|
8084
|
-
_super.prototype.showPopup.call(this);
|
|
8089
|
+
ComboBox.prototype.showPopup = function (e) {
|
|
8090
|
+
_super.prototype.showPopup.call(this, e);
|
|
8085
8091
|
};
|
|
8086
8092
|
/* eslint-disable valid-jsdoc, jsdoc/require-param */
|
|
8087
8093
|
/**
|
|
@@ -8318,10 +8324,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8318
8324
|
* @private
|
|
8319
8325
|
*/
|
|
8320
8326
|
function AutoComplete(options, element) {
|
|
8321
|
-
var
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
return
|
|
8327
|
+
var _this_1 = _super.call(this, options, element) || this;
|
|
8328
|
+
_this_1.isFiltered = false;
|
|
8329
|
+
_this_1.searchList = false;
|
|
8330
|
+
return _this_1;
|
|
8325
8331
|
}
|
|
8326
8332
|
/**
|
|
8327
8333
|
* Initialize the event handler
|
|
@@ -8369,17 +8375,17 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8369
8375
|
return filterQuery;
|
|
8370
8376
|
};
|
|
8371
8377
|
AutoComplete.prototype.searchLists = function (e) {
|
|
8372
|
-
var
|
|
8378
|
+
var _this_1 = this;
|
|
8373
8379
|
this.isTyped = true;
|
|
8374
8380
|
this.isDataFetched = this.isSelectCustom = false;
|
|
8375
8381
|
if (isNullOrUndefined(this.list)) {
|
|
8376
|
-
_super.prototype.renderList.call(this, true);
|
|
8382
|
+
_super.prototype.renderList.call(this, e, true);
|
|
8377
8383
|
}
|
|
8378
8384
|
this.queryString = this.filterInput.value;
|
|
8379
8385
|
if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
|
|
8380
8386
|
this.queryString = this.queryString === '' ? null : this.queryString;
|
|
8381
8387
|
this.beforePopupOpen = true;
|
|
8382
|
-
this.resetList(this.dataSource, this.fields);
|
|
8388
|
+
this.resetList(this.dataSource, this.fields, null, e);
|
|
8383
8389
|
return;
|
|
8384
8390
|
}
|
|
8385
8391
|
this.isSelected = false;
|
|
@@ -8391,15 +8397,15 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8391
8397
|
if (eventArgs.cancel) {
|
|
8392
8398
|
return;
|
|
8393
8399
|
}
|
|
8394
|
-
|
|
8395
|
-
|
|
8400
|
+
_this_1.isFiltered = true;
|
|
8401
|
+
_this_1.filterAction(dataSource, query, fields);
|
|
8396
8402
|
},
|
|
8397
8403
|
cancel: false
|
|
8398
8404
|
};
|
|
8399
8405
|
this.trigger('filtering', eventArgs, function (eventArgs) {
|
|
8400
|
-
if (!eventArgs.cancel && !
|
|
8401
|
-
|
|
8402
|
-
|
|
8406
|
+
if (!eventArgs.cancel && !_this_1.isFiltered && !eventArgs.preventDefaultAction) {
|
|
8407
|
+
_this_1.searchList = true;
|
|
8408
|
+
_this_1.filterAction(_this_1.dataSource, null, _this_1.fields, e);
|
|
8403
8409
|
}
|
|
8404
8410
|
});
|
|
8405
8411
|
};
|
|
@@ -8416,13 +8422,13 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8416
8422
|
this.isFiltered = true;
|
|
8417
8423
|
this.filterAction(dataSource, query, fields);
|
|
8418
8424
|
};
|
|
8419
|
-
AutoComplete.prototype.filterAction = function (dataSource, query, fields) {
|
|
8425
|
+
AutoComplete.prototype.filterAction = function (dataSource, query, fields, e) {
|
|
8420
8426
|
this.beforePopupOpen = true;
|
|
8421
8427
|
if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
|
|
8422
|
-
this.resetList(dataSource, fields, query);
|
|
8428
|
+
this.resetList(dataSource, fields, query, e);
|
|
8423
8429
|
}
|
|
8424
8430
|
else {
|
|
8425
|
-
this.hidePopup();
|
|
8431
|
+
this.hidePopup(e);
|
|
8426
8432
|
this.beforePopupOpen = false;
|
|
8427
8433
|
}
|
|
8428
8434
|
this.renderReactTemplates();
|
|
@@ -8479,18 +8485,18 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8479
8485
|
}
|
|
8480
8486
|
};
|
|
8481
8487
|
AutoComplete.prototype.listOption = function (dataSource, fieldsSettings) {
|
|
8482
|
-
var
|
|
8488
|
+
var _this_1 = this;
|
|
8483
8489
|
var fields = _super.prototype.listOption.call(this, dataSource, fieldsSettings);
|
|
8484
8490
|
if (isNullOrUndefined(fields.itemCreated)) {
|
|
8485
8491
|
fields.itemCreated = function (e) {
|
|
8486
|
-
if (
|
|
8487
|
-
if (
|
|
8492
|
+
if (_this_1.highlight) {
|
|
8493
|
+
if (_this_1.element.tagName === _this_1.getNgDirective() && _this_1.itemTemplate) {
|
|
8488
8494
|
setTimeout(function () {
|
|
8489
|
-
highlightSearch(e.item,
|
|
8495
|
+
highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
|
|
8490
8496
|
}, 0);
|
|
8491
8497
|
}
|
|
8492
8498
|
else {
|
|
8493
|
-
highlightSearch(e.item,
|
|
8499
|
+
highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
|
|
8494
8500
|
}
|
|
8495
8501
|
}
|
|
8496
8502
|
};
|
|
@@ -8498,10 +8504,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8498
8504
|
else {
|
|
8499
8505
|
var itemCreated_1 = fields.itemCreated;
|
|
8500
8506
|
fields.itemCreated = function (e) {
|
|
8501
|
-
if (
|
|
8502
|
-
highlightSearch(e.item,
|
|
8507
|
+
if (_this_1.highlight) {
|
|
8508
|
+
highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
|
|
8503
8509
|
}
|
|
8504
|
-
itemCreated_1.apply(
|
|
8510
|
+
itemCreated_1.apply(_this_1, [e]);
|
|
8505
8511
|
};
|
|
8506
8512
|
}
|
|
8507
8513
|
return fields;
|
|
@@ -8509,9 +8515,9 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8509
8515
|
AutoComplete.prototype.isFiltering = function () {
|
|
8510
8516
|
return true;
|
|
8511
8517
|
};
|
|
8512
|
-
AutoComplete.prototype.renderPopup = function () {
|
|
8518
|
+
AutoComplete.prototype.renderPopup = function (e) {
|
|
8513
8519
|
this.list.scrollTop = 0;
|
|
8514
|
-
_super.prototype.renderPopup.call(this);
|
|
8520
|
+
_super.prototype.renderPopup.call(this, e);
|
|
8515
8521
|
};
|
|
8516
8522
|
AutoComplete.prototype.isEditTextBox = function () {
|
|
8517
8523
|
return true && this.inputElement.value.trim() !== '';
|
|
@@ -8523,13 +8529,37 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8523
8529
|
AutoComplete.prototype.isSelectFocusItem = function (element) {
|
|
8524
8530
|
return false;
|
|
8525
8531
|
};
|
|
8532
|
+
AutoComplete.prototype.setInputValue = function (newProp, oldProp) {
|
|
8533
|
+
var oldValue = oldProp && oldProp.text ? oldProp.text : oldProp ? oldProp.value : oldProp;
|
|
8534
|
+
var value = newProp && newProp.text ? newProp.text : newProp && newProp.value ? newProp.value : this.value;
|
|
8535
|
+
if (value && this.typedString === '' && !this.allowCustom && !(this.dataSource instanceof DataManager)) {
|
|
8536
|
+
var checkFields_1_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
|
|
8537
|
+
var listLength_1 = this.getItems().length;
|
|
8538
|
+
var query = new Query();
|
|
8539
|
+
var _this_2 = this;
|
|
8540
|
+
new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1_1, 'equal', value)))
|
|
8541
|
+
.then(function (e) {
|
|
8542
|
+
if (e.result.length > 0) {
|
|
8543
|
+
_this_2.value = checkFields_1_1 !== '' ? e.result[0][_this_2.fields.value].toString() : e.result[0].toString();
|
|
8544
|
+
_this_2.addItem(e.result, listLength_1);
|
|
8545
|
+
_this_2.updateValues();
|
|
8546
|
+
}
|
|
8547
|
+
else {
|
|
8548
|
+
newProp && newProp.text ? _this_2.setOldText(oldValue) : newProp && newProp.value ? _this_2.setOldValue(oldValue) : _this_2.updateValues();
|
|
8549
|
+
}
|
|
8550
|
+
});
|
|
8551
|
+
}
|
|
8552
|
+
else if (newProp) {
|
|
8553
|
+
newProp.text ? this.setOldText(oldValue) : this.setOldValue(oldValue);
|
|
8554
|
+
}
|
|
8555
|
+
};
|
|
8526
8556
|
/**
|
|
8527
8557
|
* Search the entered text and show it in the suggestion list if available.
|
|
8528
8558
|
*
|
|
8529
8559
|
* @returns {void}
|
|
8530
8560
|
* @deprecated
|
|
8531
8561
|
*/
|
|
8532
|
-
AutoComplete.prototype.showPopup = function () {
|
|
8562
|
+
AutoComplete.prototype.showPopup = function (e) {
|
|
8533
8563
|
if (!this.enabled) {
|
|
8534
8564
|
return;
|
|
8535
8565
|
}
|
|
@@ -8540,10 +8570,10 @@ var AutoComplete = /** @__PURE__ @class */ (function (_super) {
|
|
|
8540
8570
|
this.beforePopupOpen = true;
|
|
8541
8571
|
this.preventAutoFill = true;
|
|
8542
8572
|
if (isNullOrUndefined(this.list)) {
|
|
8543
|
-
this.renderList();
|
|
8573
|
+
this.renderList(e);
|
|
8544
8574
|
}
|
|
8545
8575
|
else {
|
|
8546
|
-
this.resetList(this.dataSource, this.fields);
|
|
8576
|
+
this.resetList(this.dataSource, this.fields, null, e);
|
|
8547
8577
|
}
|
|
8548
8578
|
};
|
|
8549
8579
|
/**
|
|
@@ -8702,9 +8732,11 @@ var LABELBOTTOM = 'e-label-bottom';
|
|
|
8702
8732
|
function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement, value, floatLabelType, placeholder) {
|
|
8703
8733
|
var floatLinelement = createElement('span', { className: FLOATLINE });
|
|
8704
8734
|
var floatLabelElement = createElement('label', { className: FLOATTEXT });
|
|
8735
|
+
var id = element.getAttribute('id') ? element.getAttribute('id') : getUniqueID('ej2_multiselect');
|
|
8736
|
+
element.id = id;
|
|
8705
8737
|
if (!isNullOrUndefined(element.id) && element.id !== '') {
|
|
8706
8738
|
floatLabelElement.id = 'label_' + element.id.replace(/ /g, '_');
|
|
8707
|
-
attributes(
|
|
8739
|
+
attributes(inputElement, { 'aria-labelledby': floatLabelElement.id });
|
|
8708
8740
|
}
|
|
8709
8741
|
if (!isNullOrUndefined(inputElement.placeholder) && inputElement.placeholder !== '') {
|
|
8710
8742
|
floatLabelElement.innerText = encodePlaceholder(inputElement.placeholder);
|
|
@@ -9045,7 +9077,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9045
9077
|
}
|
|
9046
9078
|
}
|
|
9047
9079
|
};
|
|
9048
|
-
MultiSelect.prototype.onPopupShown = function () {
|
|
9080
|
+
MultiSelect.prototype.onPopupShown = function (e) {
|
|
9049
9081
|
var _this = this;
|
|
9050
9082
|
if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
|
|
9051
9083
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
@@ -9057,7 +9089,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9057
9089
|
history.pushState({}, '');
|
|
9058
9090
|
}
|
|
9059
9091
|
var animModel = { name: 'FadeIn', duration: 100 };
|
|
9060
|
-
var eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };
|
|
9092
|
+
var eventArgs = { popup: this.popupObj, event: e, cancel: false, animation: animModel };
|
|
9061
9093
|
this.trigger('open', eventArgs, function (eventArgs) {
|
|
9062
9094
|
if (!eventArgs.cancel) {
|
|
9063
9095
|
_this.focusAtFirstListItem();
|
|
@@ -9281,7 +9313,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9281
9313
|
this.renderPopup();
|
|
9282
9314
|
if (this.beforePopupOpen) {
|
|
9283
9315
|
this.beforePopupOpen = false;
|
|
9284
|
-
this.onPopupShown();
|
|
9316
|
+
this.onPopupShown(e);
|
|
9285
9317
|
}
|
|
9286
9318
|
};
|
|
9287
9319
|
MultiSelect.prototype.refreshSelection = function () {
|
|
@@ -9573,7 +9605,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9573
9605
|
}
|
|
9574
9606
|
if (!this.isPopupOpen() &&
|
|
9575
9607
|
(this.openOnClick || (this.showDropDownIcon && e.target && e.target.className === dropdownIcon))) {
|
|
9576
|
-
this.showPopup();
|
|
9608
|
+
this.showPopup(e);
|
|
9577
9609
|
}
|
|
9578
9610
|
else {
|
|
9579
9611
|
this.hidePopup(e);
|
|
@@ -9867,7 +9899,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
9867
9899
|
break;
|
|
9868
9900
|
case 40:
|
|
9869
9901
|
if (!this.isPopupOpen()) {
|
|
9870
|
-
this.showPopup();
|
|
9902
|
+
this.showPopup(e);
|
|
9871
9903
|
e.preventDefault();
|
|
9872
9904
|
}
|
|
9873
9905
|
break;
|
|
@@ -11058,7 +11090,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11058
11090
|
this.keyCode = e.keyCode;
|
|
11059
11091
|
}
|
|
11060
11092
|
if (!this.isPopupOpen() && this.openOnClick) {
|
|
11061
|
-
this.showPopup();
|
|
11093
|
+
this.showPopup(e);
|
|
11062
11094
|
}
|
|
11063
11095
|
this.openClick(e);
|
|
11064
11096
|
if (this.checkTextLength() && !this.allowFiltering && !isNullOrUndefined(e) && (e.keyCode !== 8)) {
|
|
@@ -11205,7 +11237,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
11205
11237
|
|| this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
|
|
11206
11238
|
isEmptyData = true;
|
|
11207
11239
|
}
|
|
11208
|
-
_super.prototype.render.call(this, isEmptyData);
|
|
11240
|
+
_super.prototype.render.call(this, null, isEmptyData);
|
|
11209
11241
|
this.unwireListEvents();
|
|
11210
11242
|
this.wireListEvents();
|
|
11211
11243
|
};
|
|
@@ -12478,7 +12510,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12478
12510
|
*
|
|
12479
12511
|
* @returns {void}
|
|
12480
12512
|
*/
|
|
12481
|
-
MultiSelect.prototype.showPopup = function () {
|
|
12513
|
+
MultiSelect.prototype.showPopup = function (e) {
|
|
12482
12514
|
var _this = this;
|
|
12483
12515
|
if (!this.enabled) {
|
|
12484
12516
|
return;
|
|
@@ -12488,7 +12520,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12488
12520
|
if (!args.cancel) {
|
|
12489
12521
|
if (!_this.ulElement) {
|
|
12490
12522
|
_this.beforePopupOpen = true;
|
|
12491
|
-
_super.prototype.render.call(_this);
|
|
12523
|
+
_super.prototype.render.call(_this, e);
|
|
12492
12524
|
if (_this.mode === 'CheckBox' && Browser.isDevice && _this.allowFiltering) {
|
|
12493
12525
|
_this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: _this.mode === 'CheckBox' });
|
|
12494
12526
|
}
|
|
@@ -12504,7 +12536,7 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12504
12536
|
_this.beforePopupOpen = false;
|
|
12505
12537
|
return;
|
|
12506
12538
|
}
|
|
12507
|
-
_this.onPopupShown();
|
|
12539
|
+
_this.onPopupShown(e);
|
|
12508
12540
|
}
|
|
12509
12541
|
});
|
|
12510
12542
|
};
|
|
@@ -12611,7 +12643,6 @@ var MultiSelect = /** @__PURE__ @class */ (function (_super) {
|
|
|
12611
12643
|
});
|
|
12612
12644
|
if (this.mode === 'Default' || this.mode === 'Box') {
|
|
12613
12645
|
this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
|
|
12614
|
-
this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
|
|
12615
12646
|
}
|
|
12616
12647
|
if (this.element.tagName !== this.getNgDirective()) {
|
|
12617
12648
|
this.element.style.display = 'none';
|