@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
|
@@ -238,6 +238,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
238
238
|
this.isAngular = false;
|
|
239
239
|
this.isPreventChange = false;
|
|
240
240
|
this.isDynamicDataChange = false;
|
|
241
|
+
this.addedNewItem = false;
|
|
241
242
|
}
|
|
242
243
|
getPropObject(prop, newProp, oldProp) {
|
|
243
244
|
const newProperty = new Object();
|
|
@@ -463,7 +464,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
463
464
|
*
|
|
464
465
|
* @returns {void}
|
|
465
466
|
*/
|
|
466
|
-
initialize() {
|
|
467
|
+
initialize(e) {
|
|
467
468
|
this.bindEvent = true;
|
|
468
469
|
this.actionFailureTemplateId = `${this.element.id}${ACTIONFAILURETEMPLATE_PROPERTY}`;
|
|
469
470
|
if (this.element.tagName === 'UL') {
|
|
@@ -482,7 +483,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
482
483
|
}
|
|
483
484
|
}
|
|
484
485
|
else {
|
|
485
|
-
this.setListData(this.dataSource, this.fields, this.query);
|
|
486
|
+
this.setListData(this.dataSource, this.fields, this.query, e);
|
|
486
487
|
}
|
|
487
488
|
}
|
|
488
489
|
/**
|
|
@@ -589,7 +590,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
589
590
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
590
591
|
* @returns {void}
|
|
591
592
|
*/
|
|
592
|
-
setListData(dataSource, fields, query) {
|
|
593
|
+
setListData(dataSource, fields, query, event) {
|
|
593
594
|
fields = fields ? fields : this.fields;
|
|
594
595
|
let ulElement;
|
|
595
596
|
this.isActive = true;
|
|
@@ -635,7 +636,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
635
636
|
this.trigger('actionComplete', localDataArgs, (localDataArgs) => {
|
|
636
637
|
if (!localDataArgs.cancel) {
|
|
637
638
|
ulElement = this.renderItems(localDataArgs.result, fields);
|
|
638
|
-
this.onActionComplete(ulElement, localDataArgs.result);
|
|
639
|
+
this.onActionComplete(ulElement, localDataArgs.result, event);
|
|
639
640
|
if (this.groupTemplate) {
|
|
640
641
|
this.renderGroupTemplate(ulElement);
|
|
641
642
|
}
|
|
@@ -1024,7 +1025,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1024
1025
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
1025
1026
|
* @returns {void}
|
|
1026
1027
|
*/
|
|
1027
|
-
resetList(dataSource, fields, query) {
|
|
1028
|
+
resetList(dataSource, fields, query, e) {
|
|
1028
1029
|
if (this.list) {
|
|
1029
1030
|
if ((this.element.tagName === 'SELECT' && this.element.options.length > 0)
|
|
1030
1031
|
|| (this.element.tagName === 'UL' && this.element.childNodes.length > 0)) {
|
|
@@ -1034,8 +1035,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1034
1035
|
dataSource = this.selectData;
|
|
1035
1036
|
}
|
|
1036
1037
|
}
|
|
1037
|
-
dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length ? this.selectData : dataSource;
|
|
1038
|
-
this.
|
|
1038
|
+
dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length && this.addedNewItem ? this.selectData : dataSource;
|
|
1039
|
+
this.addedNewItem = false;
|
|
1040
|
+
this.setListData(dataSource, fields, query, e);
|
|
1039
1041
|
}
|
|
1040
1042
|
}
|
|
1041
1043
|
updateSelectElementData(isFiltering) {
|
|
@@ -1126,7 +1128,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1126
1128
|
* @private
|
|
1127
1129
|
* @returns {void}
|
|
1128
1130
|
*/
|
|
1129
|
-
render(isEmptyData) {
|
|
1131
|
+
render(e, isEmptyData) {
|
|
1130
1132
|
this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
|
|
1131
1133
|
this.list.classList.add(dropDownBaseClasses.root);
|
|
1132
1134
|
this.setFields();
|
|
@@ -1150,7 +1152,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1150
1152
|
this.setEnableRtl();
|
|
1151
1153
|
this.setEnabled();
|
|
1152
1154
|
if (!isEmptyData) {
|
|
1153
|
-
this.initialize();
|
|
1155
|
+
this.initialize(e);
|
|
1154
1156
|
}
|
|
1155
1157
|
}
|
|
1156
1158
|
/**
|
|
@@ -1291,6 +1293,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1291
1293
|
if (selectedItemValue || itemIndex === 0) {
|
|
1292
1294
|
this.updateSelection();
|
|
1293
1295
|
}
|
|
1296
|
+
this.addedNewItem = true;
|
|
1294
1297
|
}
|
|
1295
1298
|
validationAttribute(target, hidden) {
|
|
1296
1299
|
const name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');
|
|
@@ -1567,8 +1570,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
1567
1570
|
this.popupObj.setProperties({ 'zIndex': this.zIndex });
|
|
1568
1571
|
}
|
|
1569
1572
|
}
|
|
1570
|
-
renderList(isEmptyData) {
|
|
1571
|
-
super.render(isEmptyData);
|
|
1573
|
+
renderList(e, isEmptyData) {
|
|
1574
|
+
super.render(e, isEmptyData);
|
|
1572
1575
|
this.unWireListEvents();
|
|
1573
1576
|
this.wireListEvents();
|
|
1574
1577
|
}
|
|
@@ -2051,7 +2054,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2051
2054
|
const isTabAction = e.action === 'tab' || e.action === 'close';
|
|
2052
2055
|
if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
|
|
2053
2056
|
this.searchKeyEvent = e;
|
|
2054
|
-
this.renderList();
|
|
2057
|
+
this.renderList(e);
|
|
2055
2058
|
}
|
|
2056
2059
|
if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
|
|
2057
2060
|
isNavigation && this.liCollections.length === 0) || this.isRequested) {
|
|
@@ -2090,7 +2093,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2090
2093
|
}
|
|
2091
2094
|
break;
|
|
2092
2095
|
case 'open':
|
|
2093
|
-
this.showPopup();
|
|
2096
|
+
this.showPopup(e);
|
|
2094
2097
|
break;
|
|
2095
2098
|
case 'hide':
|
|
2096
2099
|
this.preventAltUp = this.isPopupOpen;
|
|
@@ -2282,7 +2285,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2282
2285
|
}
|
|
2283
2286
|
if (!this.readonly) {
|
|
2284
2287
|
if (this.isPopupOpen) {
|
|
2285
|
-
this.hidePopup();
|
|
2288
|
+
this.hidePopup(e);
|
|
2286
2289
|
if (this.isFilterLayout()) {
|
|
2287
2290
|
this.focusDropDown(e);
|
|
2288
2291
|
}
|
|
@@ -2292,7 +2295,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2292
2295
|
this.floatLabelChange();
|
|
2293
2296
|
this.queryString = this.inputElement.value.trim() === '' ? null : this.inputElement.value;
|
|
2294
2297
|
this.isDropDownClick = true;
|
|
2295
|
-
this.showPopup();
|
|
2298
|
+
this.showPopup(e);
|
|
2296
2299
|
}
|
|
2297
2300
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
2298
2301
|
const proxy = this;
|
|
@@ -2933,26 +2936,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2933
2936
|
}
|
|
2934
2937
|
this.initial = false;
|
|
2935
2938
|
}
|
|
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
|
-
}
|
|
2939
|
+
else if (this.getModuleName() === 'autocomplete' && this.value) {
|
|
2940
|
+
this.setInputValue();
|
|
2956
2941
|
}
|
|
2957
2942
|
if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
|
|
2958
2943
|
if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
|
|
@@ -2975,7 +2960,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2975
2960
|
}
|
|
2976
2961
|
}
|
|
2977
2962
|
if (this.beforePopupOpen) {
|
|
2978
|
-
this.renderPopup();
|
|
2963
|
+
this.renderPopup(e);
|
|
2979
2964
|
}
|
|
2980
2965
|
}
|
|
2981
2966
|
}
|
|
@@ -3045,7 +3030,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3045
3030
|
removeClass(highlightedItem, dropDownListClasses.focus);
|
|
3046
3031
|
}
|
|
3047
3032
|
}
|
|
3048
|
-
renderPopup() {
|
|
3033
|
+
renderPopup(e) {
|
|
3049
3034
|
if (this.popupObj && document.body.contains(this.popupObj.element)) {
|
|
3050
3035
|
this.refreshPopup();
|
|
3051
3036
|
return;
|
|
@@ -3146,7 +3131,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3146
3131
|
const animModel = { name: 'FadeIn', duration: 100 };
|
|
3147
3132
|
this.beforePopupOpen = true;
|
|
3148
3133
|
const popupInstance = this.popupObj;
|
|
3149
|
-
const eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
|
|
3134
|
+
const eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
|
|
3150
3135
|
this.trigger('open', eventArgs, (eventArgs) => {
|
|
3151
3136
|
if (!eventArgs.cancel) {
|
|
3152
3137
|
addClass([this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
|
|
@@ -3465,14 +3450,14 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3465
3450
|
if (this.element.tagName === 'INPUT') {
|
|
3466
3451
|
this.inputElement = this.element;
|
|
3467
3452
|
if (isNullOrUndefined(this.inputElement.getAttribute('role'))) {
|
|
3468
|
-
this.inputElement.setAttribute('role', '
|
|
3453
|
+
this.inputElement.setAttribute('role', 'combobox');
|
|
3469
3454
|
}
|
|
3470
3455
|
if (isNullOrUndefined(this.inputElement.getAttribute('type'))) {
|
|
3471
3456
|
this.inputElement.setAttribute('type', 'text');
|
|
3472
3457
|
}
|
|
3473
3458
|
}
|
|
3474
3459
|
else {
|
|
3475
|
-
this.inputElement = this.createElement('input', { attrs: { role: '
|
|
3460
|
+
this.inputElement = this.createElement('input', { attrs: { role: 'combobox', type: 'text' } });
|
|
3476
3461
|
if (this.element.tagName !== this.getNgDirective()) {
|
|
3477
3462
|
this.element.style.display = 'none';
|
|
3478
3463
|
}
|
|
@@ -3521,6 +3506,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3521
3506
|
attributes(this.targetElement(), this.getAriaAttributes());
|
|
3522
3507
|
this.updateDataAttribute(this.htmlAttributes);
|
|
3523
3508
|
this.setHTMLAttributes();
|
|
3509
|
+
if (this.targetElement() === this.inputElement) {
|
|
3510
|
+
this.element.removeAttribute('aria-labelledby');
|
|
3511
|
+
}
|
|
3524
3512
|
if (this.value !== null || this.activeIndex !== null || this.text !== null) {
|
|
3525
3513
|
this.initValue();
|
|
3526
3514
|
}
|
|
@@ -3551,12 +3539,22 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3551
3539
|
if (this.element.hasAttribute('data-val')) {
|
|
3552
3540
|
this.element.setAttribute('data-val', 'false');
|
|
3553
3541
|
}
|
|
3542
|
+
const floatLabelElement = this.inputWrapper.container.getElementsByClassName('e-float-text')[0];
|
|
3543
|
+
if (!isNullOrUndefined(this.element.id) && this.element.id !== '' && !isNullOrUndefined(floatLabelElement)) {
|
|
3544
|
+
floatLabelElement.id = 'label_' + this.element.id.replace(/ /g, '_');
|
|
3545
|
+
attributes(this.inputElement, { 'aria-labelledby': floatLabelElement.id });
|
|
3546
|
+
}
|
|
3554
3547
|
this.renderComplete();
|
|
3555
3548
|
}
|
|
3556
3549
|
setFooterTemplate(popupEle) {
|
|
3557
3550
|
let compiledString;
|
|
3558
3551
|
if (this.footer) {
|
|
3559
|
-
this.
|
|
3552
|
+
if (this.isReact) {
|
|
3553
|
+
this.clearTemplate(['footerTemplate']);
|
|
3554
|
+
}
|
|
3555
|
+
else {
|
|
3556
|
+
this.footer.innerHTML = '';
|
|
3557
|
+
}
|
|
3560
3558
|
}
|
|
3561
3559
|
else {
|
|
3562
3560
|
this.footer = this.createElement('div');
|
|
@@ -3747,6 +3745,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3747
3745
|
}
|
|
3748
3746
|
});
|
|
3749
3747
|
}
|
|
3748
|
+
else if (this.getModuleName() === 'autocomplete') {
|
|
3749
|
+
this.setInputValue(newProp, oldProp);
|
|
3750
|
+
}
|
|
3750
3751
|
else {
|
|
3751
3752
|
this.setOldText(oldProp.text);
|
|
3752
3753
|
}
|
|
@@ -3788,6 +3789,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3788
3789
|
}
|
|
3789
3790
|
});
|
|
3790
3791
|
}
|
|
3792
|
+
else if (this.getModuleName() === 'autocomplete') {
|
|
3793
|
+
this.setInputValue(newProp, oldProp);
|
|
3794
|
+
}
|
|
3791
3795
|
else {
|
|
3792
3796
|
this.setOldValue(oldProp.value);
|
|
3793
3797
|
}
|
|
@@ -3900,6 +3904,8 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3900
3904
|
removeClass([this.inputWrapper.container], ['e-readonly']);
|
|
3901
3905
|
}
|
|
3902
3906
|
}
|
|
3907
|
+
setInputValue(newProp, oldProp) {
|
|
3908
|
+
}
|
|
3903
3909
|
setCssClass(newClass, oldClass) {
|
|
3904
3910
|
if (!isNullOrUndefined(oldClass)) {
|
|
3905
3911
|
oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
|
|
@@ -3926,7 +3932,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3926
3932
|
*
|
|
3927
3933
|
* @returns {void}
|
|
3928
3934
|
*/
|
|
3929
|
-
showPopup() {
|
|
3935
|
+
showPopup(e) {
|
|
3930
3936
|
if (!this.enabled) {
|
|
3931
3937
|
return;
|
|
3932
3938
|
}
|
|
@@ -3946,11 +3952,11 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3946
3952
|
}
|
|
3947
3953
|
else if (isNullOrUndefined(this.list) || !isUndefined(this.list) && (this.list.classList.contains(dropDownBaseClasses.noData) ||
|
|
3948
3954
|
this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
|
|
3949
|
-
this.renderList();
|
|
3955
|
+
this.renderList(e);
|
|
3950
3956
|
}
|
|
3951
|
-
this.invokeRenderPopup();
|
|
3957
|
+
this.invokeRenderPopup(e);
|
|
3952
3958
|
}
|
|
3953
|
-
invokeRenderPopup() {
|
|
3959
|
+
invokeRenderPopup(e) {
|
|
3954
3960
|
if (Browser.isDevice && this.isFilterLayout()) {
|
|
3955
3961
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
3956
3962
|
const proxy = this;
|
|
@@ -3960,7 +3966,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3960
3966
|
history.pushState({}, '');
|
|
3961
3967
|
}
|
|
3962
3968
|
if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
3963
|
-
this.renderPopup();
|
|
3969
|
+
this.renderPopup(e);
|
|
3964
3970
|
}
|
|
3965
3971
|
attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
3966
3972
|
}
|
|
@@ -7700,7 +7706,7 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7700
7706
|
}
|
|
7701
7707
|
}
|
|
7702
7708
|
incrementalSearch(e) {
|
|
7703
|
-
this.showPopup();
|
|
7709
|
+
this.showPopup(e);
|
|
7704
7710
|
if (!isNullOrUndefined(this.listData)) {
|
|
7705
7711
|
this.inlineSearch(e);
|
|
7706
7712
|
e.preventDefault();
|
|
@@ -7960,8 +7966,8 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
7960
7966
|
* @returns {void}
|
|
7961
7967
|
* @deprecated
|
|
7962
7968
|
*/
|
|
7963
|
-
showPopup() {
|
|
7964
|
-
super.showPopup();
|
|
7969
|
+
showPopup(e) {
|
|
7970
|
+
super.showPopup(e);
|
|
7965
7971
|
}
|
|
7966
7972
|
/* eslint-disable valid-jsdoc, jsdoc/require-param */
|
|
7967
7973
|
/**
|
|
@@ -8236,13 +8242,13 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8236
8242
|
this.isTyped = true;
|
|
8237
8243
|
this.isDataFetched = this.isSelectCustom = false;
|
|
8238
8244
|
if (isNullOrUndefined(this.list)) {
|
|
8239
|
-
super.renderList(true);
|
|
8245
|
+
super.renderList(e, true);
|
|
8240
8246
|
}
|
|
8241
8247
|
this.queryString = this.filterInput.value;
|
|
8242
8248
|
if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
|
|
8243
8249
|
this.queryString = this.queryString === '' ? null : this.queryString;
|
|
8244
8250
|
this.beforePopupOpen = true;
|
|
8245
|
-
this.resetList(this.dataSource, this.fields);
|
|
8251
|
+
this.resetList(this.dataSource, this.fields, null, e);
|
|
8246
8252
|
return;
|
|
8247
8253
|
}
|
|
8248
8254
|
this.isSelected = false;
|
|
@@ -8262,7 +8268,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8262
8268
|
this.trigger('filtering', eventArgs, (eventArgs) => {
|
|
8263
8269
|
if (!eventArgs.cancel && !this.isFiltered && !eventArgs.preventDefaultAction) {
|
|
8264
8270
|
this.searchList = true;
|
|
8265
|
-
this.filterAction(this.dataSource, null, this.fields);
|
|
8271
|
+
this.filterAction(this.dataSource, null, this.fields, e);
|
|
8266
8272
|
}
|
|
8267
8273
|
});
|
|
8268
8274
|
}
|
|
@@ -8279,13 +8285,13 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8279
8285
|
this.isFiltered = true;
|
|
8280
8286
|
this.filterAction(dataSource, query, fields);
|
|
8281
8287
|
}
|
|
8282
|
-
filterAction(dataSource, query, fields) {
|
|
8288
|
+
filterAction(dataSource, query, fields, e) {
|
|
8283
8289
|
this.beforePopupOpen = true;
|
|
8284
8290
|
if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
|
|
8285
|
-
this.resetList(dataSource, fields, query);
|
|
8291
|
+
this.resetList(dataSource, fields, query, e);
|
|
8286
8292
|
}
|
|
8287
8293
|
else {
|
|
8288
|
-
this.hidePopup();
|
|
8294
|
+
this.hidePopup(e);
|
|
8289
8295
|
this.beforePopupOpen = false;
|
|
8290
8296
|
}
|
|
8291
8297
|
this.renderReactTemplates();
|
|
@@ -8371,9 +8377,9 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8371
8377
|
isFiltering() {
|
|
8372
8378
|
return true;
|
|
8373
8379
|
}
|
|
8374
|
-
renderPopup() {
|
|
8380
|
+
renderPopup(e) {
|
|
8375
8381
|
this.list.scrollTop = 0;
|
|
8376
|
-
super.renderPopup();
|
|
8382
|
+
super.renderPopup(e);
|
|
8377
8383
|
}
|
|
8378
8384
|
isEditTextBox() {
|
|
8379
8385
|
return true && this.inputElement.value.trim() !== '';
|
|
@@ -8385,13 +8391,37 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8385
8391
|
isSelectFocusItem(element) {
|
|
8386
8392
|
return false;
|
|
8387
8393
|
}
|
|
8394
|
+
setInputValue(newProp, oldProp) {
|
|
8395
|
+
let oldValue = oldProp && oldProp.text ? oldProp.text : oldProp ? oldProp.value : oldProp;
|
|
8396
|
+
let value = newProp && newProp.text ? newProp.text : newProp && newProp.value ? newProp.value : this.value;
|
|
8397
|
+
if (value && this.typedString === '' && !this.allowCustom && !(this.dataSource instanceof DataManager)) {
|
|
8398
|
+
let checkFields_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
|
|
8399
|
+
const listLength = this.getItems().length;
|
|
8400
|
+
let query = new Query();
|
|
8401
|
+
let _this = this;
|
|
8402
|
+
new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1, 'equal', value)))
|
|
8403
|
+
.then(function (e) {
|
|
8404
|
+
if (e.result.length > 0) {
|
|
8405
|
+
_this.value = checkFields_1 !== '' ? e.result[0][_this.fields.value].toString() : e.result[0].toString();
|
|
8406
|
+
_this.addItem(e.result, listLength);
|
|
8407
|
+
_this.updateValues();
|
|
8408
|
+
}
|
|
8409
|
+
else {
|
|
8410
|
+
newProp && newProp.text ? _this.setOldText(oldValue) : newProp && newProp.value ? _this.setOldValue(oldValue) : _this.updateValues();
|
|
8411
|
+
}
|
|
8412
|
+
});
|
|
8413
|
+
}
|
|
8414
|
+
else if (newProp) {
|
|
8415
|
+
newProp.text ? this.setOldText(oldValue) : this.setOldValue(oldValue);
|
|
8416
|
+
}
|
|
8417
|
+
}
|
|
8388
8418
|
/**
|
|
8389
8419
|
* Search the entered text and show it in the suggestion list if available.
|
|
8390
8420
|
*
|
|
8391
8421
|
* @returns {void}
|
|
8392
8422
|
* @deprecated
|
|
8393
8423
|
*/
|
|
8394
|
-
showPopup() {
|
|
8424
|
+
showPopup(e) {
|
|
8395
8425
|
if (!this.enabled) {
|
|
8396
8426
|
return;
|
|
8397
8427
|
}
|
|
@@ -8402,10 +8432,10 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
8402
8432
|
this.beforePopupOpen = true;
|
|
8403
8433
|
this.preventAutoFill = true;
|
|
8404
8434
|
if (isNullOrUndefined(this.list)) {
|
|
8405
|
-
this.renderList();
|
|
8435
|
+
this.renderList(e);
|
|
8406
8436
|
}
|
|
8407
8437
|
else {
|
|
8408
|
-
this.resetList(this.dataSource, this.fields);
|
|
8438
|
+
this.resetList(this.dataSource, this.fields, null, e);
|
|
8409
8439
|
}
|
|
8410
8440
|
}
|
|
8411
8441
|
/**
|
|
@@ -8562,9 +8592,11 @@ const LABELBOTTOM = 'e-label-bottom';
|
|
|
8562
8592
|
function createFloatLabel(overAllWrapper, searchWrapper, element, inputElement, value, floatLabelType, placeholder) {
|
|
8563
8593
|
const floatLinelement = createElement('span', { className: FLOATLINE });
|
|
8564
8594
|
const floatLabelElement = createElement('label', { className: FLOATTEXT });
|
|
8595
|
+
const id = element.getAttribute('id') ? element.getAttribute('id') : getUniqueID('ej2_multiselect');
|
|
8596
|
+
element.id = id;
|
|
8565
8597
|
if (!isNullOrUndefined(element.id) && element.id !== '') {
|
|
8566
8598
|
floatLabelElement.id = 'label_' + element.id.replace(/ /g, '_');
|
|
8567
|
-
attributes(
|
|
8599
|
+
attributes(inputElement, { 'aria-labelledby': floatLabelElement.id });
|
|
8568
8600
|
}
|
|
8569
8601
|
if (!isNullOrUndefined(inputElement.placeholder) && inputElement.placeholder !== '') {
|
|
8570
8602
|
floatLabelElement.innerText = encodePlaceholder(inputElement.placeholder);
|
|
@@ -8889,7 +8921,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8889
8921
|
}
|
|
8890
8922
|
}
|
|
8891
8923
|
}
|
|
8892
|
-
onPopupShown() {
|
|
8924
|
+
onPopupShown(e) {
|
|
8893
8925
|
if (Browser.isDevice && (this.mode === 'CheckBox' && this.allowFiltering)) {
|
|
8894
8926
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
8895
8927
|
const proxy = this;
|
|
@@ -8900,7 +8932,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
8900
8932
|
history.pushState({}, '');
|
|
8901
8933
|
}
|
|
8902
8934
|
const animModel = { name: 'FadeIn', duration: 100 };
|
|
8903
|
-
const eventArgs = { popup: this.popupObj, cancel: false, animation: animModel };
|
|
8935
|
+
const eventArgs = { popup: this.popupObj, event: e, cancel: false, animation: animModel };
|
|
8904
8936
|
this.trigger('open', eventArgs, (eventArgs) => {
|
|
8905
8937
|
if (!eventArgs.cancel) {
|
|
8906
8938
|
this.focusAtFirstListItem();
|
|
@@ -9124,7 +9156,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9124
9156
|
this.renderPopup();
|
|
9125
9157
|
if (this.beforePopupOpen) {
|
|
9126
9158
|
this.beforePopupOpen = false;
|
|
9127
|
-
this.onPopupShown();
|
|
9159
|
+
this.onPopupShown(e);
|
|
9128
9160
|
}
|
|
9129
9161
|
}
|
|
9130
9162
|
refreshSelection() {
|
|
@@ -9416,7 +9448,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9416
9448
|
}
|
|
9417
9449
|
if (!this.isPopupOpen() &&
|
|
9418
9450
|
(this.openOnClick || (this.showDropDownIcon && e.target && e.target.className === dropdownIcon))) {
|
|
9419
|
-
this.showPopup();
|
|
9451
|
+
this.showPopup(e);
|
|
9420
9452
|
}
|
|
9421
9453
|
else {
|
|
9422
9454
|
this.hidePopup(e);
|
|
@@ -9710,7 +9742,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
9710
9742
|
break;
|
|
9711
9743
|
case 40:
|
|
9712
9744
|
if (!this.isPopupOpen()) {
|
|
9713
|
-
this.showPopup();
|
|
9745
|
+
this.showPopup(e);
|
|
9714
9746
|
e.preventDefault();
|
|
9715
9747
|
}
|
|
9716
9748
|
break;
|
|
@@ -10895,7 +10927,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
10895
10927
|
this.keyCode = e.keyCode;
|
|
10896
10928
|
}
|
|
10897
10929
|
if (!this.isPopupOpen() && this.openOnClick) {
|
|
10898
|
-
this.showPopup();
|
|
10930
|
+
this.showPopup(e);
|
|
10899
10931
|
}
|
|
10900
10932
|
this.openClick(e);
|
|
10901
10933
|
if (this.checkTextLength() && !this.allowFiltering && !isNullOrUndefined(e) && (e.keyCode !== 8)) {
|
|
@@ -11042,7 +11074,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11042
11074
|
|| this.list.querySelector('.e-ul') && this.list.querySelector('.e-ul').childElementCount === 0)) {
|
|
11043
11075
|
isEmptyData = true;
|
|
11044
11076
|
}
|
|
11045
|
-
super.render(isEmptyData);
|
|
11077
|
+
super.render(null, isEmptyData);
|
|
11046
11078
|
this.unwireListEvents();
|
|
11047
11079
|
this.wireListEvents();
|
|
11048
11080
|
}
|
|
@@ -12307,7 +12339,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12307
12339
|
*
|
|
12308
12340
|
* @returns {void}
|
|
12309
12341
|
*/
|
|
12310
|
-
showPopup() {
|
|
12342
|
+
showPopup(e) {
|
|
12311
12343
|
if (!this.enabled) {
|
|
12312
12344
|
return;
|
|
12313
12345
|
}
|
|
@@ -12316,7 +12348,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12316
12348
|
if (!args.cancel) {
|
|
12317
12349
|
if (!this.ulElement) {
|
|
12318
12350
|
this.beforePopupOpen = true;
|
|
12319
|
-
super.render();
|
|
12351
|
+
super.render(e);
|
|
12320
12352
|
if (this.mode === 'CheckBox' && Browser.isDevice && this.allowFiltering) {
|
|
12321
12353
|
this.notify('popupFullScreen', { module: 'CheckBoxSelection', enable: this.mode === 'CheckBox' });
|
|
12322
12354
|
}
|
|
@@ -12332,7 +12364,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12332
12364
|
this.beforePopupOpen = false;
|
|
12333
12365
|
return;
|
|
12334
12366
|
}
|
|
12335
|
-
this.onPopupShown();
|
|
12367
|
+
this.onPopupShown(e);
|
|
12336
12368
|
}
|
|
12337
12369
|
});
|
|
12338
12370
|
}
|
|
@@ -12438,7 +12470,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12438
12470
|
});
|
|
12439
12471
|
if (this.mode === 'Default' || this.mode === 'Box') {
|
|
12440
12472
|
this.inputElement.setAttribute('aria-describedby', this.chipCollectionWrapper.id);
|
|
12441
|
-
this.inputElement.setAttribute('aria-labelledby', this.chipCollectionWrapper.id);
|
|
12442
12473
|
}
|
|
12443
12474
|
if (this.element.tagName !== this.getNgDirective()) {
|
|
12444
12475
|
this.element.style.display = 'none';
|