@syncfusion/ej2-dropdowns 22.2.8 → 22.2.10

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 22.2.8
3
+ * version : 22.2.10
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@22.2.5",
3
+ "_id": "@syncfusion/ej2-dropdowns@22.2.9",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-wf/kIgwTVONADdQEZBFNabfPymGacqM8fjMBZUBuBBtp8SKR+nphlkIVU564UoGLcNOOV1yhUzlpVwEJ/ngabg==",
5
+ "_integrity": "sha512-whKmiVpgHgrWssX7CZKkSgMNfvgTjy+AXdJcLftSKQHBCxKh2btkKCMCAlmICNyJo2Eg0emmOJx29yCwpWOVMw==",
6
6
  "_location": "/@syncfusion/ej2-dropdowns",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -34,8 +34,8 @@
34
34
  "/@syncfusion/ej2-spreadsheet",
35
35
  "/@syncfusion/ej2-vue-dropdowns"
36
36
  ],
37
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-22.2.5.tgz",
38
- "_shasum": "194e02353868d6417668cc2fbbc0221ccb79ad36",
37
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-22.2.9.tgz",
38
+ "_shasum": "32589e400793ef872dcdc74f4707199c67b4461b",
39
39
  "_spec": "@syncfusion/ej2-dropdowns@*",
40
40
  "_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
41
41
  "author": {
@@ -43,12 +43,12 @@
43
43
  },
44
44
  "bundleDependencies": false,
45
45
  "dependencies": {
46
- "@syncfusion/ej2-base": "~22.2.5",
46
+ "@syncfusion/ej2-base": "~22.2.10",
47
47
  "@syncfusion/ej2-data": "~22.2.5",
48
- "@syncfusion/ej2-inputs": "~22.2.7",
49
- "@syncfusion/ej2-lists": "~22.2.8",
48
+ "@syncfusion/ej2-inputs": "~22.2.9",
49
+ "@syncfusion/ej2-lists": "~22.2.9",
50
50
  "@syncfusion/ej2-navigations": "~22.2.8",
51
- "@syncfusion/ej2-popups": "~22.2.7"
51
+ "@syncfusion/ej2-popups": "~22.2.9"
52
52
  },
53
53
  "deprecated": false,
54
54
  "description": "Essential JS 2 DropDown Components",
@@ -73,7 +73,7 @@
73
73
  "module": "./index.js",
74
74
  "name": "@syncfusion/ej2-dropdowns",
75
75
  "typings": "index.d.ts",
76
- "version": "22.2.8",
76
+ "version": "22.2.10",
77
77
  "sideEffects": false,
78
78
  "homepage": "https://www.syncfusion.com/javascript-ui-controls"
79
79
  }
@@ -210,7 +210,8 @@ var ComboBox = /** @class */ (function (_super) {
210
210
  };
211
211
  ComboBox.prototype.setSearchBox = function () {
212
212
  this.filterInput = this.inputElement;
213
- return (this.isFiltering() ? this.inputWrapper : inputObject);
213
+ var searchBoxContainer = (this.isFiltering() || (this.isReact && this.getModuleName() === 'combobox')) ? this.inputWrapper : inputObject;
214
+ return searchBoxContainer;
214
215
  };
215
216
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
216
217
  ComboBox.prototype.onActionComplete = function (ulElement, list, e, isUpdated) {
@@ -217,6 +217,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
217
217
  protected isDynamicDataChange: boolean;
218
218
  protected addedNewItem: boolean;
219
219
  protected isAddNewItemTemplate: boolean;
220
+ private isRequesting;
220
221
  /**
221
222
  * The `fields` property maps the columns of the data table and binds the data to the component.
222
223
  * * text - Maps the text column from data table for each list item.
@@ -90,6 +90,7 @@ var DropDownBase = /** @class */ (function (_super) {
90
90
  _this.isDynamicDataChange = false;
91
91
  _this.addedNewItem = false;
92
92
  _this.isAddNewItemTemplate = false;
93
+ _this.isRequesting = false;
93
94
  return _this;
94
95
  }
95
96
  DropDownBase.prototype.getPropObject = function (prop, newProp, oldProp) {
@@ -246,24 +247,30 @@ var DropDownBase = /** @class */ (function (_super) {
246
247
  }
247
248
  var templateName = actionFailure ? 'actionFailureTemplate' : 'noRecordsTemplate';
248
249
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
249
- var noDataCompTemp = compiledString({}, this, templateName, templateId, this.isStringTemplate, null, ele);
250
- if (noDataCompTemp && noDataCompTemp.length > 0) {
251
- for (var i = 0; i < noDataCompTemp.length; i++) {
250
+ var noDataElement = void 0;
251
+ if ((this.isReact) && typeof template === 'function') {
252
+ noDataElement = compiledString({}, this, templateName, templateId, this.isStringTemplate, null);
253
+ }
254
+ else {
255
+ noDataElement = compiledString({}, this, templateName, templateId, this.isStringTemplate, null, ele);
256
+ }
257
+ if (noDataElement && noDataElement.length > 0) {
258
+ for (var i = 0; i < noDataElement.length; i++) {
252
259
  if (this.getModuleName() === 'listbox' && templateName === 'noRecordsTemplate') {
253
- if (noDataCompTemp[i].nodeName === '#text') {
260
+ if (noDataElement[i].nodeName === '#text') {
254
261
  var liElem = this.createElement('li');
255
- liElem.textContent = noDataCompTemp[i].textContent;
262
+ liElem.textContent = noDataElement[i].textContent;
256
263
  liElem.classList.add('e-list-nrt');
257
264
  liElem.setAttribute('role', 'option');
258
265
  ele.appendChild(liElem);
259
266
  }
260
267
  else {
261
- noDataCompTemp[i].classList.add('e-list-nr-template');
262
- ele.appendChild(noDataCompTemp[i]);
268
+ noDataElement[i].classList.add('e-list-nr-template');
269
+ ele.appendChild(noDataElement[i]);
263
270
  }
264
271
  }
265
272
  else {
266
- ele.appendChild(noDataCompTemp[i]);
273
+ ele.appendChild(noDataElement[i]);
267
274
  }
268
275
  }
269
276
  }
@@ -473,61 +480,67 @@ var DropDownBase = /** @class */ (function (_super) {
473
480
  this.isActive = true;
474
481
  var eventArgs = { cancel: false, data: dataSource, query: query };
475
482
  this.isPreventChange = this.isAngular && this.preventChange ? true : this.isPreventChange;
476
- this.trigger('actionBegin', eventArgs, function (eventArgs) {
477
- if (!eventArgs.cancel) {
478
- _this.showSpinner();
479
- if (dataSource instanceof DataManager) {
480
- _this.isRequested = true;
481
- if (_this.isDataFetched) {
482
- _this.emptyDataRequest(fields);
483
- return;
483
+ if (!this.isRequesting) {
484
+ this.trigger('actionBegin', eventArgs, function (eventArgs) {
485
+ if (!eventArgs.cancel) {
486
+ _this.isRequesting = true;
487
+ _this.showSpinner();
488
+ if (dataSource instanceof DataManager) {
489
+ _this.isRequested = true;
490
+ if (_this.isDataFetched) {
491
+ _this.emptyDataRequest(fields);
492
+ return;
493
+ }
494
+ eventArgs.data.executeQuery(_this.getQuery(eventArgs.query)).then(function (e) {
495
+ _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
496
+ _this.trigger('actionComplete', e, function (e) {
497
+ if (!e.cancel) {
498
+ _this.isRequesting = false;
499
+ var listItems = e.result;
500
+ if (listItems.length === 0) {
501
+ _this.isDataFetched = true;
502
+ }
503
+ ulElement = _this.renderItems(listItems, fields);
504
+ _this.onActionComplete(ulElement, listItems, e);
505
+ if (_this.groupTemplate) {
506
+ _this.renderGroupTemplate(ulElement);
507
+ }
508
+ _this.isRequested = false;
509
+ _this.bindChildItems(listItems, ulElement, fields, e);
510
+ }
511
+ });
512
+ }).catch(function (e) {
513
+ _this.isRequested = false;
514
+ _this.isRequesting = false;
515
+ _this.onActionFailure(e);
516
+ _this.hideSpinner();
517
+ });
484
518
  }
485
- eventArgs.data.executeQuery(_this.getQuery(eventArgs.query)).then(function (e) {
519
+ else {
520
+ var dataManager = new DataManager(eventArgs.data);
521
+ var listItems = (_this.getQuery(eventArgs.query)).executeLocal(dataManager);
522
+ var localDataArgs = { cancel: false, result: listItems };
486
523
  _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
487
- _this.trigger('actionComplete', e, function (e) {
488
- if (!e.cancel) {
489
- var listItems = e.result;
490
- if (listItems.length === 0) {
491
- _this.isDataFetched = true;
492
- }
493
- ulElement = _this.renderItems(listItems, fields);
494
- _this.onActionComplete(ulElement, listItems, e);
524
+ _this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
525
+ if (!localDataArgs.cancel) {
526
+ _this.isRequesting = false;
527
+ ulElement = _this.renderItems(localDataArgs.result, fields);
528
+ _this.onActionComplete(ulElement, localDataArgs.result, event);
495
529
  if (_this.groupTemplate) {
496
530
  _this.renderGroupTemplate(ulElement);
497
531
  }
498
- _this.isRequested = false;
499
- _this.bindChildItems(listItems, ulElement, fields, e);
532
+ _this.bindChildItems(localDataArgs.result, ulElement, fields);
533
+ setTimeout(function () {
534
+ if (_this.getModuleName() === 'multiselect' && _this.itemTemplate != null && (ulElement.childElementCount > 0 && (ulElement.children[0].childElementCount > 0 || (_this.fields.groupBy && ulElement.children[1] && ulElement.children[1].childElementCount > 0)))) {
535
+ _this.updateDataList();
536
+ }
537
+ });
500
538
  }
501
539
  });
502
- }).catch(function (e) {
503
- _this.isRequested = false;
504
- _this.onActionFailure(e);
505
- _this.hideSpinner();
506
- });
507
- }
508
- else {
509
- var dataManager = new DataManager(eventArgs.data);
510
- var listItems = (_this.getQuery(eventArgs.query)).executeLocal(dataManager);
511
- var localDataArgs = { cancel: false, result: listItems };
512
- _this.isPreventChange = _this.isAngular && _this.preventChange ? true : _this.isPreventChange;
513
- _this.trigger('actionComplete', localDataArgs, function (localDataArgs) {
514
- if (!localDataArgs.cancel) {
515
- ulElement = _this.renderItems(localDataArgs.result, fields);
516
- _this.onActionComplete(ulElement, localDataArgs.result, event);
517
- if (_this.groupTemplate) {
518
- _this.renderGroupTemplate(ulElement);
519
- }
520
- _this.bindChildItems(localDataArgs.result, ulElement, fields);
521
- setTimeout(function () {
522
- if (_this.getModuleName() === 'multiselect' && _this.itemTemplate != null && (ulElement.childElementCount > 0 && (ulElement.children[0].childElementCount > 0 || (_this.fields.groupBy && ulElement.children[1] && ulElement.children[1].childElementCount > 0)))) {
523
- _this.updateDataList();
524
- }
525
- });
526
- }
527
- });
540
+ }
528
541
  }
529
- }
530
- });
542
+ });
543
+ }
531
544
  };
532
545
  DropDownBase.prototype.bindChildItems = function (listItems, ulElement, fields, e) {
533
546
  var _this = this;
@@ -1513,7 +1513,7 @@ var DropDownList = /** @class */ (function (_super) {
1513
1513
  this.isNotSearchList = false;
1514
1514
  return;
1515
1515
  }
1516
- if (this.isActive) {
1516
+ if (this.isActive || !isNullOrUndefined(ulElement)) {
1517
1517
  var selectedItem = this.selectedLI ? this.selectedLI.cloneNode(true) : null;
1518
1518
  _super.prototype.onActionComplete.call(this, ulElement, list, e);
1519
1519
  this.updateSelectElementData(this.allowFiltering);
@@ -2226,7 +2226,7 @@ var DropDownList = /** @class */ (function (_super) {
2226
2226
  DropDownList.prototype.setFooterTemplate = function (popupEle) {
2227
2227
  var compiledString;
2228
2228
  if (this.footer) {
2229
- if (this.isReact) {
2229
+ if (this.isReact && typeof this.footerTemplate === 'function') {
2230
2230
  this.clearTemplate(['footerTemplate']);
2231
2231
  }
2232
2232
  else {
@@ -2312,6 +2312,7 @@ var DropDownList = /** @class */ (function (_super) {
2312
2312
  if (this.allowFiltering && newProp.dataSource && !isNullOrUndefined(Object.keys(newProp.dataSource))) {
2313
2313
  this.actionCompleteData = { ulElement: null, list: null, isUpdated: false };
2314
2314
  this.actionData = this.actionCompleteData;
2315
+ this.itemData = null;
2315
2316
  }
2316
2317
  else if (this.allowFiltering && newProp.query && !isNullOrUndefined(Object.keys(newProp.query))) {
2317
2318
  this.actionCompleteData = this.getModuleName() === 'combobox' ?
@@ -2819,6 +2820,9 @@ var DropDownList = /** @class */ (function (_super) {
2819
2820
  if (this.inputElement && !isNullOrUndefined(this.inputElement.onchange)) {
2820
2821
  this.inputElement.onchange = null;
2821
2822
  }
2823
+ if (this.isAngular) {
2824
+ this.inputElement = null;
2825
+ }
2822
2826
  _super.prototype.destroy.call(this);
2823
2827
  };
2824
2828
  /* eslint-disable valid-jsdoc, jsdoc/require-returns-description */
@@ -3877,6 +3877,10 @@ var MultiSelect = /** @class */ (function (_super) {
3877
3877
  * @returns {void}
3878
3878
  */
3879
3879
  MultiSelect.prototype.render = function () {
3880
+ if (!isNullOrUndefined(this.value)) {
3881
+ // eslint-disable-next-line
3882
+ this.value = this.value.slice();
3883
+ }
3880
3884
  this.setDynValue = this.initStatus = false;
3881
3885
  this.isSelectAll = false;
3882
3886
  this.selectAllEventEle = [];
package/tslint.json ADDED
@@ -0,0 +1,111 @@
1
+ {
2
+ "rules": {
3
+ "chai-vague-errors": true,
4
+ "use-isnan": true,
5
+ "missing-jsdoc": true,
6
+ "missing-optional-annotation": true,
7
+ "no-backbone-get-set-outside-model": true,
8
+ "no-banned-terms": true,
9
+ "no-constant-condition": true,
10
+ "no-control-regex": true,
11
+ "no-cookies": true,
12
+ "no-delete-expression": true,
13
+ "no-document-write": true,
14
+ "no-document-domain": true,
15
+ "no-disable-auto-sanitization": true,
16
+ "no-duplicate-case": true,
17
+ "no-duplicate-parameter-names": true,
18
+ "no-empty-interfaces": true,
19
+ "no-exec-script": true,
20
+ "no-function-constructor-with-string-args": true,
21
+ "no-function-expression": true,
22
+ "no-invalid-regexp": true,
23
+ "no-for-in": true,
24
+ "member-access": true,
25
+ "no-multiline-string": true,
26
+ "no-multiple-var-decl": true,
27
+ "no-unnecessary-bind": true,
28
+ "no-unnecessary-semicolons": true,
29
+ "no-octal-literal": true,
30
+ "no-regex-spaces": true,
31
+ "no-sparse-arrays": true,
32
+ "no-string-based-set-immediate": true,
33
+ "no-string-based-set-interval": true,
34
+ "no-unused-imports": true,
35
+ "no-with-statement": true,
36
+ "prefer-array-literal": true,
37
+ "promise-must-complete": false,
38
+ "react-no-dangerous-html": true,
39
+ "use-named-parameter": true,
40
+ "valid-typeof": true,
41
+ "max-func-body-length": [true, 100, {
42
+ "ignore-parameters-to-function-regex": "describe"
43
+ }],
44
+ "class-name": true,
45
+ "curly": true,
46
+ "eofline": false,
47
+ "forin": true,
48
+ "indent": [
49
+ true,
50
+ "spaces"
51
+ ],
52
+ "label-position": true,
53
+ "max-line-length": [true, 140],
54
+ "no-arg": true,
55
+ "no-console": [true,
56
+ "debug",
57
+ "info",
58
+ "log",
59
+ "time",
60
+ "timeEnd",
61
+ "trace"
62
+ ],
63
+ "no-construct": true,
64
+ "no-parameter-properties": true,
65
+ "no-debugger": true,
66
+ "no-duplicate-variable": true,
67
+ "no-empty": true,
68
+ "no-eval": true,
69
+ "no-string-literal": true,
70
+ "no-switch-case-fall-through": true,
71
+ "trailing-comma": true,
72
+ "no-trailing-whitespace": true,
73
+ "no-unused-expression": true,
74
+ "no-use-before-declare": false,
75
+ "no-var-requires": true,
76
+ "one-line": [true,
77
+ "check-open-brace",
78
+ "check-catch",
79
+ "check-else",
80
+ "check-whitespace"
81
+ ],
82
+ "no-any": true,
83
+ "no-conditional-assignment": true,
84
+ "no-angle-bracket-type-assertion": false,
85
+ "align": [true, "parameters", "arguments", "statements"],
86
+ "no-empty-line-after-opening-brace": false,
87
+ "typedef-whitespace": [false],
88
+ "ban": true,
89
+ "quotemark": [true, "single"],
90
+ "semicolon": true,
91
+ "triple-equals": [true, "allow-null-check"],
92
+ "typedef": [true,
93
+ "call-signature",
94
+ "parameter",
95
+ "property-declaration",
96
+ "variable-declaration",
97
+ "arrow-parameter",
98
+ "member-variable-declaration"],
99
+ "variable-name": true,
100
+ "whitespace": [true,
101
+ "check-branch",
102
+ "check-decl",
103
+ "check-operator",
104
+ "check-separator",
105
+ "check-type"
106
+ ],
107
+ "jsdoc-format": true,
108
+ "no-var-keyword": true,
109
+ "radix": true
110
+ }
111
+ }