@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
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.46
|
|
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.45",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-tyYDvpdpEBKIZ02cpy56kIbgdQU28VHlbHg4/ekSFb1PeevRc+KsXw31emLy9V182vAz6HpUSz8cb5oPL+Vm2A==",
|
|
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.45.tgz",
|
|
37
|
+
"_shasum": "3aa842e2fd4fd447d1b9032528bcb51ea9ef71dc",
|
|
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.46",
|
|
46
|
+
"@syncfusion/ej2-data": "~20.2.45",
|
|
47
|
+
"@syncfusion/ej2-inputs": "~20.2.45",
|
|
48
|
+
"@syncfusion/ej2-lists": "~20.2.46",
|
|
49
|
+
"@syncfusion/ej2-navigations": "~20.2.46",
|
|
50
|
+
"@syncfusion/ej2-popups": "~20.2.45"
|
|
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.46",
|
|
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
|
/**
|
|
@@ -213,6 +213,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
213
213
|
protected isAngular: boolean;
|
|
214
214
|
protected isPreventChange: boolean;
|
|
215
215
|
protected isDynamicDataChange: boolean;
|
|
216
|
+
protected addedNewItem: boolean;
|
|
216
217
|
/**
|
|
217
218
|
* The `fields` property maps the columns of the data table and binds the data to the component.
|
|
218
219
|
* * text - Maps the text column from data table for each list item.
|
|
@@ -592,7 +593,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
592
593
|
*/
|
|
593
594
|
protected resetList(dataSource?: {
|
|
594
595
|
[key: string]: Object;
|
|
595
|
-
}[] | DataManager | string[] | number[] | boolean[], fields?: FieldSettingsModel, query?: Query): void;
|
|
596
|
+
}[] | DataManager | string[] | number[] | boolean[], fields?: FieldSettingsModel, query?: Query, e?: MouseEvent | KeyboardEventArgs | TouchEvent): void;
|
|
596
597
|
protected updateSelectElementData(isFiltering: boolean): void;
|
|
597
598
|
protected updateSelection(): void;
|
|
598
599
|
protected renderList(): void;
|
|
@@ -616,7 +617,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
616
617
|
* @private
|
|
617
618
|
* @returns {void}
|
|
618
619
|
*/
|
|
619
|
-
render(isEmptyData?: boolean): void;
|
|
620
|
+
render(e?: MouseEvent | KeyboardEventArgs | TouchEvent, isEmptyData?: boolean): void;
|
|
620
621
|
/**
|
|
621
622
|
* Return the module name of this component.
|
|
622
623
|
*
|
|
@@ -723,7 +724,7 @@ export interface PopupEventArgs {
|
|
|
723
724
|
/**
|
|
724
725
|
* Specifies the event.
|
|
725
726
|
*/
|
|
726
|
-
event?: MouseEvent | KeyboardEventArgs;
|
|
727
|
+
event?: MouseEvent | KeyboardEventArgs | TouchEvent | Object;
|
|
727
728
|
}
|
|
728
729
|
export interface FocusEventArgs {
|
|
729
730
|
/**
|
|
@@ -86,6 +86,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
86
86
|
_this.isAngular = false;
|
|
87
87
|
_this.isPreventChange = false;
|
|
88
88
|
_this.isDynamicDataChange = false;
|
|
89
|
+
_this.addedNewItem = false;
|
|
89
90
|
return _this;
|
|
90
91
|
}
|
|
91
92
|
DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
|
|
@@ -314,7 +315,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
314
315
|
*
|
|
315
316
|
* @returns {void}
|
|
316
317
|
*/
|
|
317
|
-
DropDownBase.prototype.initialize = function () {
|
|
318
|
+
DropDownBase.prototype.initialize = function (e) {
|
|
318
319
|
this.bindEvent = true;
|
|
319
320
|
this.actionFailureTemplateId = "" + this.element.id + ACTIONFAILURETEMPLATE_PROPERTY;
|
|
320
321
|
if (this.element.tagName === 'UL') {
|
|
@@ -333,7 +334,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
333
334
|
}
|
|
334
335
|
}
|
|
335
336
|
else {
|
|
336
|
-
this.setListData(this.dataSource, this.fields, this.query);
|
|
337
|
+
this.setListData(this.dataSource, this.fields, this.query, e);
|
|
337
338
|
}
|
|
338
339
|
};
|
|
339
340
|
/**
|
|
@@ -441,7 +442,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
441
442
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
442
443
|
* @returns {void}
|
|
443
444
|
*/
|
|
444
|
-
DropDownBase.prototype.setListData = function (dataSource, fields, query) {
|
|
445
|
+
DropDownBase.prototype.setListData = function (dataSource, fields, query, event) {
|
|
445
446
|
var _this = this;
|
|
446
447
|
fields = fields ? fields : this.fields;
|
|
447
448
|
var ulElement;
|
|
@@ -488,7 +489,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
488
489
|
_this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
|
|
489
490
|
if (!localDataArgs.cancel) {
|
|
490
491
|
ulElement = _this.renderItems(localDataArgs.result, fields);
|
|
491
|
-
_this.onActionComplete(ulElement, localDataArgs.result);
|
|
492
|
+
_this.onActionComplete(ulElement, localDataArgs.result, event);
|
|
492
493
|
if (_this.groupTemplate) {
|
|
493
494
|
_this.renderGroupTemplate(ulElement);
|
|
494
495
|
}
|
|
@@ -878,7 +879,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
878
879
|
* @param {Query} query - Accepts the external Query that execute along with data processing.
|
|
879
880
|
* @returns {void}
|
|
880
881
|
*/
|
|
881
|
-
DropDownBase.prototype.resetList = function (dataSource, fields, query) {
|
|
882
|
+
DropDownBase.prototype.resetList = function (dataSource, fields, query, e) {
|
|
882
883
|
if (this.list) {
|
|
883
884
|
if ((this.element.tagName === 'SELECT' && this.element.options.length > 0)
|
|
884
885
|
|| (this.element.tagName === 'UL' && this.element.childNodes.length > 0)) {
|
|
@@ -888,8 +889,9 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
888
889
|
dataSource = this.selectData;
|
|
889
890
|
}
|
|
890
891
|
}
|
|
891
|
-
dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length ? this.selectData : dataSource;
|
|
892
|
-
this.
|
|
892
|
+
dataSource = this.getModuleName() === 'combobox' && this.selectData && dataSource instanceof Array && dataSource.length < this.selectData.length && this.addedNewItem ? this.selectData : dataSource;
|
|
893
|
+
this.addedNewItem = false;
|
|
894
|
+
this.setListData(dataSource, fields, query, e);
|
|
893
895
|
}
|
|
894
896
|
};
|
|
895
897
|
DropDownBase.prototype.updateSelectElementData = function (isFiltering) {
|
|
@@ -981,7 +983,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
981
983
|
* @private
|
|
982
984
|
* @returns {void}
|
|
983
985
|
*/
|
|
984
|
-
DropDownBase.prototype.render = function (isEmptyData) {
|
|
986
|
+
DropDownBase.prototype.render = function (e, isEmptyData) {
|
|
985
987
|
this.list = this.createElement('div', { className: dropDownBaseClasses.content, attrs: { 'tabindex': '0' } });
|
|
986
988
|
this.list.classList.add(dropDownBaseClasses.root);
|
|
987
989
|
this.setFields();
|
|
@@ -1005,7 +1007,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
1005
1007
|
this.setEnableRtl();
|
|
1006
1008
|
this.setEnabled();
|
|
1007
1009
|
if (!isEmptyData) {
|
|
1008
|
-
this.initialize();
|
|
1010
|
+
this.initialize(e);
|
|
1009
1011
|
}
|
|
1010
1012
|
};
|
|
1011
1013
|
/**
|
|
@@ -1146,6 +1148,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
1146
1148
|
if (selectedItemValue || itemIndex === 0) {
|
|
1147
1149
|
this.updateSelection();
|
|
1148
1150
|
}
|
|
1151
|
+
this.addedNewItem = true;
|
|
1149
1152
|
};
|
|
1150
1153
|
DropDownBase.prototype.validationAttribute = function (target, hidden) {
|
|
1151
1154
|
var name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');
|
|
@@ -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
|
*
|