@syncfusion/ej2-dropdowns 20.2.39 → 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/CHANGELOG.md +42 -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 +104 -52
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +121 -69
- 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 +31 -15
- package/src/drop-down-tree/drop-down-tree.js +2 -1
- package/src/list-box/list-box.js +14 -3
- package/src/multi-select/multi-select.d.ts +1 -1
- package/src/multi-select/multi-select.js +11 -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/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 20.2.
|
|
3
|
+
* version : 20.2.44
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@syncfusion/ej2-dropdowns@*",
|
|
3
|
-
"_id": "@syncfusion/ej2-dropdowns@20.2.
|
|
3
|
+
"_id": "@syncfusion/ej2-dropdowns@20.2.43",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-eDYUh1Aox6DSh/TiiHU2bjPmp0O5LR2W86+tL/vVUEI7GbD5ZXzwjcK414jM5Pu3pckoUoXdjqyU1qVoibjBJw==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-dropdowns",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"/@syncfusion/ej2-spreadsheet",
|
|
34
34
|
"/@syncfusion/ej2-vue-dropdowns"
|
|
35
35
|
],
|
|
36
|
-
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-20.2.
|
|
37
|
-
"_shasum": "
|
|
36
|
+
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-20.2.43.tgz",
|
|
37
|
+
"_shasum": "de78f32afa49d61a4cc323357712c7cc81c46eb2",
|
|
38
38
|
"_spec": "@syncfusion/ej2-dropdowns@*",
|
|
39
39
|
"_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
|
|
40
40
|
"author": {
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
},
|
|
43
43
|
"bundleDependencies": false,
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@syncfusion/ej2-base": "~20.2.
|
|
46
|
-
"@syncfusion/ej2-data": "~20.2.
|
|
47
|
-
"@syncfusion/ej2-inputs": "~20.2.
|
|
48
|
-
"@syncfusion/ej2-lists": "~20.2.
|
|
49
|
-
"@syncfusion/ej2-navigations": "~20.2.
|
|
50
|
-
"@syncfusion/ej2-popups": "~20.2.
|
|
45
|
+
"@syncfusion/ej2-base": "~20.2.43",
|
|
46
|
+
"@syncfusion/ej2-data": "~20.2.43",
|
|
47
|
+
"@syncfusion/ej2-inputs": "~20.2.44",
|
|
48
|
+
"@syncfusion/ej2-lists": "~20.2.43",
|
|
49
|
+
"@syncfusion/ej2-navigations": "~20.2.44",
|
|
50
|
+
"@syncfusion/ej2-popups": "~20.2.43"
|
|
51
51
|
},
|
|
52
52
|
"deprecated": false,
|
|
53
53
|
"description": "Essential JS 2 DropDown Components",
|
|
@@ -72,6 +72,6 @@
|
|
|
72
72
|
"module": "./index.js",
|
|
73
73
|
"name": "@syncfusion/ej2-dropdowns",
|
|
74
74
|
"typings": "index.d.ts",
|
|
75
|
-
"version": "20.2.
|
|
75
|
+
"version": "20.2.44",
|
|
76
76
|
"sideEffects": false
|
|
77
77
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Property, EventHandler, KeyboardEventArgs, isNullOrUndefined, detach } from '@syncfusion/ej2-base';import { Event, EmitType, Complex } from '@syncfusion/ej2-base';import { removeClass, attributes, NotifyPropertyChanges } from '@syncfusion/ej2-base';import { dropDownListClasses } from '../drop-down-list/drop-down-list';import { ComboBox } from '../combo-box/combo-box';import { highlightSearch, revertHighlightSearch } from '../common/highlight-search';import { Search } from '../common/incremental-search';import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';import { FieldSettings, FilteringEventArgs, FilterType } from '../drop-down-base/drop-down-base';import { FloatLabelType, Input } from '@syncfusion/ej2-inputs';import { DataManager, Query } from '@syncfusion/ej2-data';
|
|
1
|
+
import { Property, EventHandler, KeyboardEventArgs, isNullOrUndefined, detach } from '@syncfusion/ej2-base';import { Event, EmitType, Complex } from '@syncfusion/ej2-base';import { removeClass, attributes, NotifyPropertyChanges } from '@syncfusion/ej2-base';import { dropDownListClasses } from '../drop-down-list/drop-down-list';import { ComboBox } from '../combo-box/combo-box';import { highlightSearch, revertHighlightSearch } from '../common/highlight-search';import { Search } from '../common/incremental-search';import { FieldSettingsModel } from '../drop-down-base/drop-down-base-model';import { FieldSettings, FilteringEventArgs, FilterType, ResultData } from '../drop-down-base/drop-down-base';import { FloatLabelType, Input } from '@syncfusion/ej2-inputs';import { DataManager, Predicate, Query } from '@syncfusion/ej2-data';
|
|
2
2
|
import {ComboBoxModel} from "../combo-box/combo-box-model";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -236,23 +236,24 @@ export declare class AutoComplete extends ComboBox {
|
|
|
236
236
|
[key: string]: Object;
|
|
237
237
|
}[], fieldsSettings: FieldSettingsModel): FieldSettingsModel;
|
|
238
238
|
protected isFiltering(): boolean;
|
|
239
|
-
protected renderPopup(): void;
|
|
239
|
+
protected renderPopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent): void;
|
|
240
240
|
protected isEditTextBox(): boolean;
|
|
241
241
|
protected isPopupButton(): boolean;
|
|
242
242
|
protected isSelectFocusItem(element: Element): boolean;
|
|
243
|
+
protected setInputValue(newProp?: any, oldProp?: any): void;
|
|
243
244
|
/**
|
|
244
245
|
* Search the entered text and show it in the suggestion list if available.
|
|
245
246
|
*
|
|
246
247
|
* @returns {void}
|
|
247
248
|
|
|
248
249
|
*/
|
|
249
|
-
showPopup(): void;
|
|
250
|
+
showPopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent): void;
|
|
250
251
|
/**
|
|
251
252
|
* Hides the popup if it is in open state.
|
|
252
253
|
*
|
|
253
254
|
* @returns {void}
|
|
254
255
|
*/
|
|
255
|
-
hidePopup(e?: KeyboardEventArgs): void;
|
|
256
|
+
hidePopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent): void;
|
|
256
257
|
/**
|
|
257
258
|
* Dynamically change the value of properties.
|
|
258
259
|
*
|
|
@@ -28,7 +28,7 @@ import { highlightSearch, revertHighlightSearch } from '../common/highlight-sear
|
|
|
28
28
|
import { Search } from '../common/incremental-search';
|
|
29
29
|
import { FieldSettings } from '../drop-down-base/drop-down-base';
|
|
30
30
|
import { Input } from '@syncfusion/ej2-inputs';
|
|
31
|
-
import { DataManager, Query } from '@syncfusion/ej2-data';
|
|
31
|
+
import { DataManager, Predicate, Query } from '@syncfusion/ej2-data';
|
|
32
32
|
dropDownListClasses.root = 'e-autocomplete';
|
|
33
33
|
dropDownListClasses.icon = 'e-input-group-icon e-ddl-icon e-search-icon';
|
|
34
34
|
/**
|
|
@@ -52,10 +52,10 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
52
52
|
* @private
|
|
53
53
|
*/
|
|
54
54
|
function AutoComplete(options, element) {
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return
|
|
55
|
+
var _this_1 = _super.call(this, options, element) || this;
|
|
56
|
+
_this_1.isFiltered = false;
|
|
57
|
+
_this_1.searchList = false;
|
|
58
|
+
return _this_1;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Initialize the event handler
|
|
@@ -103,17 +103,17 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
103
103
|
return filterQuery;
|
|
104
104
|
};
|
|
105
105
|
AutoComplete.prototype.searchLists = function (e) {
|
|
106
|
-
var
|
|
106
|
+
var _this_1 = this;
|
|
107
107
|
this.isTyped = true;
|
|
108
108
|
this.isDataFetched = this.isSelectCustom = false;
|
|
109
109
|
if (isNullOrUndefined(this.list)) {
|
|
110
|
-
_super.prototype.renderList.call(this, true);
|
|
110
|
+
_super.prototype.renderList.call(this, e, true);
|
|
111
111
|
}
|
|
112
112
|
this.queryString = this.filterInput.value;
|
|
113
113
|
if (e.type !== 'mousedown' && (e.keyCode === 40 || e.keyCode === 38)) {
|
|
114
114
|
this.queryString = this.queryString === '' ? null : this.queryString;
|
|
115
115
|
this.beforePopupOpen = true;
|
|
116
|
-
this.resetList(this.dataSource, this.fields);
|
|
116
|
+
this.resetList(this.dataSource, this.fields, null, e);
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
119
|
this.isSelected = false;
|
|
@@ -125,15 +125,15 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
125
125
|
if (eventArgs.cancel) {
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
_this_1.isFiltered = true;
|
|
129
|
+
_this_1.filterAction(dataSource, query, fields);
|
|
130
130
|
},
|
|
131
131
|
cancel: false
|
|
132
132
|
};
|
|
133
133
|
this.trigger('filtering', eventArgs, function (eventArgs) {
|
|
134
|
-
if (!eventArgs.cancel && !
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
if (!eventArgs.cancel && !_this_1.isFiltered && !eventArgs.preventDefaultAction) {
|
|
135
|
+
_this_1.searchList = true;
|
|
136
|
+
_this_1.filterAction(_this_1.dataSource, null, _this_1.fields, e);
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
};
|
|
@@ -150,13 +150,13 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
150
150
|
this.isFiltered = true;
|
|
151
151
|
this.filterAction(dataSource, query, fields);
|
|
152
152
|
};
|
|
153
|
-
AutoComplete.prototype.filterAction = function (dataSource, query, fields) {
|
|
153
|
+
AutoComplete.prototype.filterAction = function (dataSource, query, fields, e) {
|
|
154
154
|
this.beforePopupOpen = true;
|
|
155
155
|
if (this.queryString !== '' && (this.queryString.length >= this.minLength)) {
|
|
156
|
-
this.resetList(dataSource, fields, query);
|
|
156
|
+
this.resetList(dataSource, fields, query, e);
|
|
157
157
|
}
|
|
158
158
|
else {
|
|
159
|
-
this.hidePopup();
|
|
159
|
+
this.hidePopup(e);
|
|
160
160
|
this.beforePopupOpen = false;
|
|
161
161
|
}
|
|
162
162
|
this.renderReactTemplates();
|
|
@@ -213,18 +213,18 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
213
213
|
}
|
|
214
214
|
};
|
|
215
215
|
AutoComplete.prototype.listOption = function (dataSource, fieldsSettings) {
|
|
216
|
-
var
|
|
216
|
+
var _this_1 = this;
|
|
217
217
|
var fields = _super.prototype.listOption.call(this, dataSource, fieldsSettings);
|
|
218
218
|
if (isNullOrUndefined(fields.itemCreated)) {
|
|
219
219
|
fields.itemCreated = function (e) {
|
|
220
|
-
if (
|
|
221
|
-
if (
|
|
220
|
+
if (_this_1.highlight) {
|
|
221
|
+
if (_this_1.element.tagName === _this_1.getNgDirective() && _this_1.itemTemplate) {
|
|
222
222
|
setTimeout(function () {
|
|
223
|
-
highlightSearch(e.item,
|
|
223
|
+
highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
|
|
224
224
|
}, 0);
|
|
225
225
|
}
|
|
226
226
|
else {
|
|
227
|
-
highlightSearch(e.item,
|
|
227
|
+
highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
};
|
|
@@ -232,10 +232,10 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
232
232
|
else {
|
|
233
233
|
var itemCreated_1 = fields.itemCreated;
|
|
234
234
|
fields.itemCreated = function (e) {
|
|
235
|
-
if (
|
|
236
|
-
highlightSearch(e.item,
|
|
235
|
+
if (_this_1.highlight) {
|
|
236
|
+
highlightSearch(e.item, _this_1.queryString, _this_1.ignoreCase, _this_1.filterType);
|
|
237
237
|
}
|
|
238
|
-
itemCreated_1.apply(
|
|
238
|
+
itemCreated_1.apply(_this_1, [e]);
|
|
239
239
|
};
|
|
240
240
|
}
|
|
241
241
|
return fields;
|
|
@@ -243,9 +243,9 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
243
243
|
AutoComplete.prototype.isFiltering = function () {
|
|
244
244
|
return true;
|
|
245
245
|
};
|
|
246
|
-
AutoComplete.prototype.renderPopup = function () {
|
|
246
|
+
AutoComplete.prototype.renderPopup = function (e) {
|
|
247
247
|
this.list.scrollTop = 0;
|
|
248
|
-
_super.prototype.renderPopup.call(this);
|
|
248
|
+
_super.prototype.renderPopup.call(this, e);
|
|
249
249
|
};
|
|
250
250
|
AutoComplete.prototype.isEditTextBox = function () {
|
|
251
251
|
return true && this.inputElement.value.trim() !== '';
|
|
@@ -257,13 +257,37 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
257
257
|
AutoComplete.prototype.isSelectFocusItem = function (element) {
|
|
258
258
|
return false;
|
|
259
259
|
};
|
|
260
|
+
AutoComplete.prototype.setInputValue = function (newProp, oldProp) {
|
|
261
|
+
var oldValue = oldProp && oldProp.text ? oldProp.text : oldProp ? oldProp.value : oldProp;
|
|
262
|
+
var value = newProp && newProp.text ? newProp.text : newProp && newProp.value ? newProp.value : this.value;
|
|
263
|
+
if (value && this.typedString === '' && !this.allowCustom && !(this.dataSource instanceof DataManager)) {
|
|
264
|
+
var checkFields_1_1 = this.typeOfData(this.dataSource).typeof === 'string' ? '' : this.fields.value;
|
|
265
|
+
var listLength_1 = this.getItems().length;
|
|
266
|
+
var query = new Query();
|
|
267
|
+
var _this_2 = this;
|
|
268
|
+
new DataManager(this.dataSource).executeQuery(query.where(new Predicate(checkFields_1_1, 'equal', value)))
|
|
269
|
+
.then(function (e) {
|
|
270
|
+
if (e.result.length > 0) {
|
|
271
|
+
_this_2.value = checkFields_1_1 !== '' ? e.result[0][_this_2.fields.value].toString() : e.result[0].toString();
|
|
272
|
+
_this_2.addItem(e.result, listLength_1);
|
|
273
|
+
_this_2.updateValues();
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
newProp && newProp.text ? _this_2.setOldText(oldValue) : newProp && newProp.value ? _this_2.setOldValue(oldValue) : _this_2.updateValues();
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
else if (newProp) {
|
|
281
|
+
newProp.text ? this.setOldText(oldValue) : this.setOldValue(oldValue);
|
|
282
|
+
}
|
|
283
|
+
};
|
|
260
284
|
/**
|
|
261
285
|
* Search the entered text and show it in the suggestion list if available.
|
|
262
286
|
*
|
|
263
287
|
* @returns {void}
|
|
264
288
|
|
|
265
289
|
*/
|
|
266
|
-
AutoComplete.prototype.showPopup = function () {
|
|
290
|
+
AutoComplete.prototype.showPopup = function (e) {
|
|
267
291
|
if (!this.enabled) {
|
|
268
292
|
return;
|
|
269
293
|
}
|
|
@@ -274,10 +298,10 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
274
298
|
this.beforePopupOpen = true;
|
|
275
299
|
this.preventAutoFill = true;
|
|
276
300
|
if (isNullOrUndefined(this.list)) {
|
|
277
|
-
this.renderList();
|
|
301
|
+
this.renderList(e);
|
|
278
302
|
}
|
|
279
303
|
else {
|
|
280
|
-
this.resetList(this.dataSource, this.fields);
|
|
304
|
+
this.resetList(this.dataSource, this.fields, null, e);
|
|
281
305
|
}
|
|
282
306
|
};
|
|
283
307
|
/**
|
|
@@ -346,14 +346,14 @@ export declare class ComboBox extends DropDownList {
|
|
|
346
346
|
* @returns {void}
|
|
347
347
|
|
|
348
348
|
*/
|
|
349
|
-
showPopup(): void;
|
|
349
|
+
showPopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent): void;
|
|
350
350
|
/**
|
|
351
351
|
* Hides the popup if it is in open state.
|
|
352
352
|
*
|
|
353
353
|
* @returns {void}
|
|
354
354
|
|
|
355
355
|
*/
|
|
356
|
-
hidePopup(e?: MouseEvent | KeyboardEventArgs): void;
|
|
356
|
+
hidePopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent): void;
|
|
357
357
|
/**
|
|
358
358
|
* Sets the focus to the component for interaction.
|
|
359
359
|
*
|
|
@@ -400,7 +400,7 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
400
400
|
}
|
|
401
401
|
};
|
|
402
402
|
ComboBox.prototype.incrementalSearch = function (e) {
|
|
403
|
-
this.showPopup();
|
|
403
|
+
this.showPopup(e);
|
|
404
404
|
if (!isNullOrUndefined(this.listData)) {
|
|
405
405
|
this.inlineSearch(e);
|
|
406
406
|
e.preventDefault();
|
|
@@ -663,8 +663,8 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
663
663
|
* @returns {void}
|
|
664
664
|
|
|
665
665
|
*/
|
|
666
|
-
ComboBox.prototype.showPopup = function () {
|
|
667
|
-
_super.prototype.showPopup.call(this);
|
|
666
|
+
ComboBox.prototype.showPopup = function (e) {
|
|
667
|
+
_super.prototype.showPopup.call(this, e);
|
|
668
668
|
};
|
|
669
669
|
/* eslint-disable valid-jsdoc, jsdoc/require-param */
|
|
670
670
|
/**
|
|
@@ -592,7 +592,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
592
592
|
*/
|
|
593
593
|
protected resetList(dataSource?: {
|
|
594
594
|
[key: string]: Object;
|
|
595
|
-
}[] | DataManager | string[] | number[] | boolean[], fields?: FieldSettingsModel, query?: Query): void;
|
|
595
|
+
}[] | DataManager | string[] | number[] | boolean[], fields?: FieldSettingsModel, query?: Query, e?: MouseEvent | KeyboardEventArgs | TouchEvent): void;
|
|
596
596
|
protected updateSelectElementData(isFiltering: boolean): void;
|
|
597
597
|
protected updateSelection(): void;
|
|
598
598
|
protected renderList(): void;
|
|
@@ -616,7 +616,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
616
616
|
* @private
|
|
617
617
|
* @returns {void}
|
|
618
618
|
*/
|
|
619
|
-
render(isEmptyData?: boolean): void;
|
|
619
|
+
render(e?: MouseEvent | KeyboardEventArgs | TouchEvent, isEmptyData?: boolean): void;
|
|
620
620
|
/**
|
|
621
621
|
* Return the module name of this component.
|
|
622
622
|
*
|
|
@@ -723,7 +723,7 @@ export interface PopupEventArgs {
|
|
|
723
723
|
/**
|
|
724
724
|
* Specifies the event.
|
|
725
725
|
*/
|
|
726
|
-
event?: MouseEvent | KeyboardEventArgs;
|
|
726
|
+
event?: MouseEvent | KeyboardEventArgs | TouchEvent | Object;
|
|
727
727
|
}
|
|
728
728
|
export interface FocusEventArgs {
|
|
729
729
|
/**
|
|
@@ -314,7 +314,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
314
314
|
*
|
|
315
315
|
* @returns {void}
|
|
316
316
|
*/
|
|
317
|
-
DropDownBase.prototype.initialize = function () {
|
|
317
|
+
DropDownBase.prototype.initialize = function (e) {
|
|
318
318
|
this.bindEvent = true;
|
|
319
319
|
this.actionFailureTemplateId = "" + this.element.id + ACTIONFAILURETEMPLATE_PROPERTY;
|
|
320
320
|
if (this.element.tagName === 'UL') {
|
|
@@ -333,7 +333,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
else {
|
|
336
|
-
this.setListData(this.dataSource, this.fields, this.query);
|
|
336
|
+
this.setListData(this.dataSource, this.fields, this.query, e);
|
|
337
337
|
}
|
|
338
338
|
};
|
|
339
339
|
/**
|
|
@@ -441,7 +441,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
441
441
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
442
442
|
* @returns {void}
|
|
443
443
|
*/
|
|
444
|
-
DropDownBase.prototype.setListData = function (dataSource, fields, query) {
|
|
444
|
+
DropDownBase.prototype.setListData = function (dataSource, fields, query, event) {
|
|
445
445
|
var _this = this;
|
|
446
446
|
fields = fields ? fields : this.fields;
|
|
447
447
|
var ulElement;
|
|
@@ -488,7 +488,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
488
488
|
_this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
|
|
489
489
|
if (!localDataArgs.cancel) {
|
|
490
490
|
ulElement = _this.renderItems(localDataArgs.result, fields);
|
|
491
|
-
_this.onActionComplete(ulElement, localDataArgs.result);
|
|
491
|
+
_this.onActionComplete(ulElement, localDataArgs.result, event);
|
|
492
492
|
if (_this.groupTemplate) {
|
|
493
493
|
_this.renderGroupTemplate(ulElement);
|
|
494
494
|
}
|
|
@@ -878,7 +878,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
878
878
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
879
879
|
* @returns {void}
|
|
880
880
|
*/
|
|
881
|
-
DropDownBase.prototype.resetList = function (dataSource, fields, query) {
|
|
881
|
+
DropDownBase.prototype.resetList = function (dataSource, fields, query, e) {
|
|
882
882
|
if (this.list) {
|
|
883
883
|
if ((this.element.tagName === 'SELECT' && this.element.options.length > 0)
|
|
884
884
|
|| (this.element.tagName === 'UL' && this.element.childNodes.length > 0)) {
|
|
@@ -889,7 +889,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length ? this.selectData : dataSource;
|
|
892
|
-
this.setListData(dataSource, fields, query);
|
|
892
|
+
this.setListData(dataSource, fields, query, e);
|
|
893
893
|
}
|
|
894
894
|
};
|
|
895
895
|
DropDownBase.prototype.updateSelectElementData = function (isFiltering) {
|
|
@@ -981,7 +981,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
981
981
|
* @private
|
|
982
982
|
* @returns {void}
|
|
983
983
|
*/
|
|
984
|
-
DropDownBase.prototype.render = function (isEmptyData) {
|
|
984
|
+
DropDownBase.prototype.render = function (e, isEmptyData) {
|
|
985
985
|
this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
|
|
986
986
|
this.list.classList.add(dropDownBaseClasses.root);
|
|
987
987
|
this.setFields();
|
|
@@ -1005,7 +1005,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
1005
1005
|
this.setEnableRtl();
|
|
1006
1006
|
this.setEnabled();
|
|
1007
1007
|
if (!isEmptyData) {
|
|
1008
|
-
this.initialize();
|
|
1008
|
+
this.initialize(e);
|
|
1009
1009
|
}
|
|
1010
1010
|
};
|
|
1011
1011
|
/**
|
|
@@ -327,11 +327,11 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
327
327
|
protected preRender(): void;
|
|
328
328
|
private initializeData;
|
|
329
329
|
protected setZIndex(): void;
|
|
330
|
-
protected renderList(isEmptyData?: boolean): void;
|
|
330
|
+
protected renderList(e?: MouseEvent | KeyboardEventArgs | TouchEvent, isEmptyData?: boolean): void;
|
|
331
331
|
private floatLabelChange;
|
|
332
332
|
protected resetHandler(e: MouseEvent): void;
|
|
333
333
|
protected resetFocusElement(): void;
|
|
334
|
-
protected clearAll(e?: MouseEvent | KeyboardEventArgs, properties?: DropDownListModel): void;
|
|
334
|
+
protected clearAll(e?: MouseEvent | KeyboardEventArgs | TouchEvent, properties?: DropDownListModel): void;
|
|
335
335
|
private resetSelection;
|
|
336
336
|
private setHTMLAttributes;
|
|
337
337
|
protected getAriaAttributes(): {
|
|
@@ -478,7 +478,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
478
478
|
private focusIndexItem;
|
|
479
479
|
protected updateSelection(): void;
|
|
480
480
|
protected removeFocus(): void;
|
|
481
|
-
protected renderPopup(): void;
|
|
481
|
+
protected renderPopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent | Object): void;
|
|
482
482
|
private checkCollision;
|
|
483
483
|
private getOffsetValue;
|
|
484
484
|
private createPopup;
|
|
@@ -529,6 +529,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
529
529
|
private checkValidLi;
|
|
530
530
|
private setSelectionData;
|
|
531
531
|
protected setReadOnly(): void;
|
|
532
|
+
protected setInputValue(newProp?: any, oldProp?: any): void;
|
|
532
533
|
private setCssClass;
|
|
533
534
|
/**
|
|
534
535
|
* Return the module name of this component.
|
|
@@ -542,7 +543,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
542
543
|
*
|
|
543
544
|
* @returns {void}
|
|
544
545
|
*/
|
|
545
|
-
showPopup(): void;
|
|
546
|
+
showPopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent): void;
|
|
546
547
|
private invokeRenderPopup;
|
|
547
548
|
protected renderHightSearch(): void;
|
|
548
549
|
/**
|
|
@@ -550,7 +551,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
550
551
|
*
|
|
551
552
|
* @returns {void}
|
|
552
553
|
*/
|
|
553
|
-
hidePopup(e?: MouseEvent | KeyboardEventArgs): void;
|
|
554
|
+
hidePopup(e?: MouseEvent | KeyboardEventArgs | TouchEvent): void;
|
|
554
555
|
/**
|
|
555
556
|
* Sets the focus on the component for interaction.
|
|
556
557
|
*
|
|
@@ -150,8 +150,8 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
150
150
|
this.popupObj.setProperties({ 'zIndex': this.zIndex });
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
|
-
DropDownList.prototype.renderList = function (isEmptyData) {
|
|
154
|
-
_super.prototype.render.call(this, isEmptyData);
|
|
153
|
+
DropDownList.prototype.renderList = function (e, isEmptyData) {
|
|
154
|
+
_super.prototype.render.call(this, e, isEmptyData);
|
|
155
155
|
this.unWireListEvents();
|
|
156
156
|
this.wireListEvents();
|
|
157
157
|
};
|
|
@@ -636,7 +636,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
636
636
|
var isTabAction = e.action === 'tab' || e.action === 'close';
|
|
637
637
|
if (this.list === undefined && !this.isRequested && !isTabAction && e.action !== 'escape') {
|
|
638
638
|
this.searchKeyEvent = e;
|
|
639
|
-
this.renderList();
|
|
639
|
+
this.renderList(e);
|
|
640
640
|
}
|
|
641
641
|
if (isNullOrUndefined(this.list) || (!isNullOrUndefined(this.liCollections) &&
|
|
642
642
|
isNavigation && this.liCollections.length === 0) || this.isRequested) {
|
|
@@ -675,7 +675,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
675
675
|
}
|
|
676
676
|
break;
|
|
677
677
|
case 'open':
|
|
678
|
-
this.showPopup();
|
|
678
|
+
this.showPopup(e);
|
|
679
679
|
break;
|
|
680
680
|
case 'hide':
|
|
681
681
|
this.preventAltUp = this.isPopupOpen;
|
|
@@ -867,7 +867,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
867
867
|
}
|
|
868
868
|
if (!this.readonly) {
|
|
869
869
|
if (this.isPopupOpen) {
|
|
870
|
-
this.hidePopup();
|
|
870
|
+
this.hidePopup(e);
|
|
871
871
|
if (this.isFilterLayout()) {
|
|
872
872
|
this.focusDropDown(e);
|
|
873
873
|
}
|
|
@@ -877,7 +877,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
877
877
|
this.floatLabelChange();
|
|
878
878
|
this.queryString = this.inputElement.value.trim() === '' ? null : this.inputElement.value;
|
|
879
879
|
this.isDropDownClick = true;
|
|
880
|
-
this.showPopup();
|
|
880
|
+
this.showPopup(e);
|
|
881
881
|
}
|
|
882
882
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
883
883
|
var proxy_1 = this;
|
|
@@ -1522,6 +1522,9 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1522
1522
|
}
|
|
1523
1523
|
this.initial = false;
|
|
1524
1524
|
}
|
|
1525
|
+
else if (this.getModuleName() === 'autocomplete' && this.value) {
|
|
1526
|
+
this.setInputValue();
|
|
1527
|
+
}
|
|
1525
1528
|
if (this.getModuleName() !== 'autocomplete' && this.isFiltering() && !this.isTyped) {
|
|
1526
1529
|
if (!this.actionCompleteData.isUpdated || ((!this.isCustomFilter
|
|
1527
1530
|
&& !this.isFilterFocus) || (isNullOrUndefined(this.itemData) && this.allowFiltering)
|
|
@@ -1543,7 +1546,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1543
1546
|
}
|
|
1544
1547
|
}
|
|
1545
1548
|
if (this.beforePopupOpen) {
|
|
1546
|
-
this.renderPopup();
|
|
1549
|
+
this.renderPopup(e);
|
|
1547
1550
|
}
|
|
1548
1551
|
}
|
|
1549
1552
|
};
|
|
@@ -1615,7 +1618,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1615
1618
|
removeClass(highlightedItem, dropDownListClasses.focus);
|
|
1616
1619
|
}
|
|
1617
1620
|
};
|
|
1618
|
-
DropDownList.prototype.renderPopup = function () {
|
|
1621
|
+
DropDownList.prototype.renderPopup = function (e) {
|
|
1619
1622
|
var _this = this;
|
|
1620
1623
|
if (this.popupObj && document.body.contains(this.popupObj.element)) {
|
|
1621
1624
|
this.refreshPopup();
|
|
@@ -1718,7 +1721,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1718
1721
|
var animModel = { name: 'FadeIn', duration: 100 };
|
|
1719
1722
|
_this.beforePopupOpen = true;
|
|
1720
1723
|
var popupInstance = _this.popupObj;
|
|
1721
|
-
var eventArgs = { popup: popupInstance, cancel: false, animation: animModel };
|
|
1724
|
+
var eventArgs = { popup: popupInstance, event: e, cancel: false, animation: animModel };
|
|
1722
1725
|
_this.trigger('open', eventArgs, function (eventArgs) {
|
|
1723
1726
|
if (!eventArgs.cancel) {
|
|
1724
1727
|
addClass([_this.inputWrapper.container], [dropDownListClasses.iconAnimation]);
|
|
@@ -2131,7 +2134,12 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2131
2134
|
DropDownList.prototype.setFooterTemplate = function (popupEle) {
|
|
2132
2135
|
var compiledString;
|
|
2133
2136
|
if (this.footer) {
|
|
2134
|
-
this.
|
|
2137
|
+
if (this.isReact) {
|
|
2138
|
+
this.clearTemplate(['footerTemplate']);
|
|
2139
|
+
}
|
|
2140
|
+
else {
|
|
2141
|
+
this.footer.innerHTML = '';
|
|
2142
|
+
}
|
|
2135
2143
|
}
|
|
2136
2144
|
else {
|
|
2137
2145
|
this.footer = this.createElement('div');
|
|
@@ -2323,6 +2331,9 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2323
2331
|
}
|
|
2324
2332
|
});
|
|
2325
2333
|
}
|
|
2334
|
+
else if (this_1.getModuleName() === 'autocomplete') {
|
|
2335
|
+
this_1.setInputValue(newProp, oldProp);
|
|
2336
|
+
}
|
|
2326
2337
|
else {
|
|
2327
2338
|
this_1.setOldText(oldProp.text);
|
|
2328
2339
|
}
|
|
@@ -2364,6 +2375,9 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2364
2375
|
}
|
|
2365
2376
|
});
|
|
2366
2377
|
}
|
|
2378
|
+
else if (this_1.getModuleName() === 'autocomplete') {
|
|
2379
|
+
this_1.setInputValue(newProp, oldProp);
|
|
2380
|
+
}
|
|
2367
2381
|
else {
|
|
2368
2382
|
this_1.setOldValue(oldProp.value);
|
|
2369
2383
|
}
|
|
@@ -2482,6 +2496,8 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2482
2496
|
removeClass([this.inputWrapper.container], ['e-readonly']);
|
|
2483
2497
|
}
|
|
2484
2498
|
};
|
|
2499
|
+
DropDownList.prototype.setInputValue = function (newProp, oldProp) {
|
|
2500
|
+
};
|
|
2485
2501
|
DropDownList.prototype.setCssClass = function (newClass, oldClass) {
|
|
2486
2502
|
if (!isNullOrUndefined(oldClass)) {
|
|
2487
2503
|
oldClass = (oldClass.replace(/\s+/g, ' ')).trim();
|
|
@@ -2508,7 +2524,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2508
2524
|
*
|
|
2509
2525
|
* @returns {void}
|
|
2510
2526
|
*/
|
|
2511
|
-
DropDownList.prototype.showPopup = function () {
|
|
2527
|
+
DropDownList.prototype.showPopup = function (e) {
|
|
2512
2528
|
if (!this.enabled) {
|
|
2513
2529
|
return;
|
|
2514
2530
|
}
|
|
@@ -2528,11 +2544,11 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2528
2544
|
}
|
|
2529
2545
|
else if (isNullOrUndefined(this.list) || !isUndefined(this.list) && (this.list.classList.contains(dropDownBaseClasses.noData) ||
|
|
2530
2546
|
this.list.querySelectorAll('.' + dropDownBaseClasses.li).length <= 0)) {
|
|
2531
|
-
this.renderList();
|
|
2547
|
+
this.renderList(e);
|
|
2532
2548
|
}
|
|
2533
|
-
this.invokeRenderPopup();
|
|
2549
|
+
this.invokeRenderPopup(e);
|
|
2534
2550
|
};
|
|
2535
|
-
DropDownList.prototype.invokeRenderPopup = function () {
|
|
2551
|
+
DropDownList.prototype.invokeRenderPopup = function (e) {
|
|
2536
2552
|
if (Browser.isDevice && this.isFilterLayout()) {
|
|
2537
2553
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
2538
2554
|
var proxy_2 = this;
|
|
@@ -2542,7 +2558,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
2542
2558
|
history.pushState({}, '');
|
|
2543
2559
|
}
|
|
2544
2560
|
if (!isNullOrUndefined(this.list.children[0]) || this.list.classList.contains(dropDownBaseClasses.noData)) {
|
|
2545
|
-
this.renderPopup();
|
|
2561
|
+
this.renderPopup(e);
|
|
2546
2562
|
}
|
|
2547
2563
|
attributes(this.targetElement(), { 'aria-activedescendant': this.selectedLI ? this.selectedLI.id : null });
|
|
2548
2564
|
};
|
|
@@ -1803,7 +1803,8 @@ var DropDownTree = /** @class */ (function (_super) {
|
|
|
1803
1803
|
}
|
|
1804
1804
|
return 2;
|
|
1805
1805
|
}
|
|
1806
|
-
|
|
1806
|
+
if (isNOU(this.fields.dataSource))
|
|
1807
|
+
this.fields.dataSource = [];
|
|
1807
1808
|
for (var i = 0, len = this.fields.dataSource.length; i < len; i++) {
|
|
1808
1809
|
if ((typeof field.child === 'string') && !isNOU(getValue(field.child, this.fields.dataSource[i]))) {
|
|
1809
1810
|
return 2;
|
package/src/list-box/list-box.js
CHANGED
|
@@ -1543,9 +1543,20 @@ var ListBox = /** @class */ (function (_super) {
|
|
|
1543
1543
|
fListBox.value = [];
|
|
1544
1544
|
listData = listData
|
|
1545
1545
|
.filter(function (data) { return data.isHeader !== true; });
|
|
1546
|
-
tListBox.listData = listData;
|
|
1547
|
-
|
|
1548
|
-
|
|
1546
|
+
tListBox.listData = tListBox.jsonData = listData;
|
|
1547
|
+
if (fListBox.listData.length == fListBox.jsonData.length) {
|
|
1548
|
+
fListBox.listData = fListBox.sortedData = fListBox.jsonData = [];
|
|
1549
|
+
}
|
|
1550
|
+
else if (this.allowFiltering) {
|
|
1551
|
+
for (var i = 0; i < fListBox.listData.length; i++) {
|
|
1552
|
+
for (var j = 0; j < fListBox.jsonData.length; j++) {
|
|
1553
|
+
if (fListBox.listData[i] === fListBox.jsonData[j]) {
|
|
1554
|
+
fListBox.jsonData.splice(j, 1);
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
fListBox.listData = fListBox.sortedData = [];
|
|
1559
|
+
}
|
|
1549
1560
|
if (isRefresh) {
|
|
1550
1561
|
var sourceElem = tListBox.renderItems(listData, tListBox.fields);
|
|
1551
1562
|
tListBox.updateListItems(sourceElem, tListBox.ulElement);
|