@syncfusion/ej2-dropdowns 32.1.25 → 32.2.4

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 : 32.1.25
3
+ * version : 32.2.4
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-dropdowns",
3
- "version": "32.1.25",
3
+ "version": "32.2.4",
4
4
  "description": "Essential JS 2 DropDown Components",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,13 +8,13 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-dropdowns.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~32.1.24",
12
- "@syncfusion/ej2-data": "~32.1.24",
13
- "@syncfusion/ej2-inputs": "~32.1.24",
14
- "@syncfusion/ej2-lists": "~32.1.24",
15
- "@syncfusion/ej2-navigations": "~32.1.24",
16
- "@syncfusion/ej2-notifications": "~32.1.24",
17
- "@syncfusion/ej2-popups": "~32.1.25"
11
+ "@syncfusion/ej2-base": "~32.2.3",
12
+ "@syncfusion/ej2-data": "~32.2.3",
13
+ "@syncfusion/ej2-inputs": "~32.2.3",
14
+ "@syncfusion/ej2-lists": "~32.2.3",
15
+ "@syncfusion/ej2-navigations": "~32.2.3",
16
+ "@syncfusion/ej2-notifications": "~32.2.3",
17
+ "@syncfusion/ej2-popups": "~32.2.4"
18
18
  },
19
19
  "devDependencies": {},
20
20
  "keywords": [
@@ -591,6 +591,7 @@ export declare class DropDownList extends DropDownBase implements IInput {
591
591
  }[], e?: Object, isUpdated?: boolean): void;
592
592
  private isValueInList;
593
593
  private checkFieldValue;
594
+ private checkAndFetchItemData;
594
595
  private updateActionCompleteDataValues;
595
596
  private addNewItem;
596
597
  protected updateActionCompleteData(li: HTMLElement, item: {
@@ -2382,37 +2382,10 @@ var DropDownList = /** @class */ (function (_super) {
2382
2382
  this.activeIndex = this.index;
2383
2383
  this.initialRemoteRender = false;
2384
2384
  if (this.value && this.dataSource instanceof DataManager) {
2385
- var checkField_1 = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
2386
- var value_1 = this.allowObjectBinding && !isNullOrUndefined(this.value) ?
2387
- getValue(checkField_1, this.value) : this.value;
2388
- var fieldValue_1 = this.fields.value.split('.');
2389
- var checkVal = list.some(function (x) {
2390
- return isNullOrUndefined(x[checkField_1]) && fieldValue_1.length > 1 ?
2391
- _this.checkFieldValue(x, fieldValue_1) === value_1 : x[checkField_1] === value_1;
2392
- });
2393
- if (this.enableVirtualization && this.virtualGroupDataSource) {
2394
- checkVal = this.virtualGroupDataSource.some(function (x) {
2395
- return isNullOrUndefined(x[checkField_1]) && fieldValue_1.length > 1 ?
2396
- _this.checkFieldValue(x, fieldValue_1) === value_1 : x[checkField_1] === value_1;
2397
- });
2398
- }
2399
- if (!checkVal && !this.enableVirtualization) {
2400
- this.dataSource.executeQuery(this.getQuery(this.query).where(new Predicate(checkField_1, 'equal', value_1)))
2401
- .then(function (e) {
2402
- if (e.result.length > 0) {
2403
- if (!_this.enableVirtualization) {
2404
- _this.addItem(e.result, list.length);
2405
- }
2406
- _this.updateValues();
2407
- }
2408
- else {
2409
- _this.updateValues();
2410
- }
2411
- });
2412
- }
2413
- else {
2414
- this.updateValues();
2415
- }
2385
+ var checkField = isNullOrUndefined(this.fields.value) ? this.fields.text : this.fields.value;
2386
+ var value = this.allowObjectBinding && !isNullOrUndefined(this.value) ?
2387
+ getValue(checkField, this.value) : this.value;
2388
+ this.checkAndFetchItemData(list, value, checkField);
2416
2389
  }
2417
2390
  else {
2418
2391
  this.updateValues();
@@ -2520,6 +2493,46 @@ var DropDownList = /** @class */ (function (_super) {
2520
2493
  });
2521
2494
  return checkField;
2522
2495
  };
2496
+ DropDownList.prototype.checkAndFetchItemData = function (list, value, checkField) {
2497
+ var _this = this;
2498
+ var fieldValue = this.fields.value.split('.');
2499
+ var checkVal = list.some(function (x) {
2500
+ return isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
2501
+ _this.checkFieldValue(x, fieldValue) === value : x[checkField] === value;
2502
+ });
2503
+ if (this.enableVirtualization && this.virtualGroupDataSource) {
2504
+ checkVal = this.virtualGroupDataSource.some(function (x) {
2505
+ return isNullOrUndefined(x[checkField]) && fieldValue.length > 1 ?
2506
+ _this.checkFieldValue(x, fieldValue) === value : x[checkField] === value;
2507
+ });
2508
+ }
2509
+ if (!checkVal && this.dataSource instanceof DataManager) {
2510
+ (this.dataSource).executeQuery(this.getQuery(this.query).where(new Predicate(checkField, 'equal', value)))
2511
+ .then(function (e) {
2512
+ if (e.result.length > 0) {
2513
+ if (!_this.enableVirtualization) {
2514
+ _this.addItem(e.result, list.length);
2515
+ }
2516
+ else {
2517
+ _this.itemData = e.result[0];
2518
+ var dataItem = _this.getItemData();
2519
+ if ((_this.value === dataItem.value && _this.text !== dataItem.text) ||
2520
+ (_this.value !== dataItem.value && _this.text === dataItem.text)) {
2521
+ _this.setProperties({ text: dataItem.text.toString() });
2522
+ Input.setValue(_this.text, _this.inputElement, _this.floatLabelType, _this.showClearButton);
2523
+ }
2524
+ }
2525
+ _this.updateValues();
2526
+ }
2527
+ else {
2528
+ _this.updateValues();
2529
+ }
2530
+ });
2531
+ }
2532
+ else {
2533
+ this.updateValues();
2534
+ }
2535
+ };
2523
2536
  DropDownList.prototype.updateActionCompleteDataValues = function (ulElement, list) {
2524
2537
  this.actionCompleteData = { ulElement: ulElement.cloneNode(true), list: list, isUpdated: true };
2525
2538
  if (this.actionData.list !== this.actionCompleteData.list && this.actionCompleteData.ulElement && this.actionCompleteData.list) {
@@ -2529,10 +2542,10 @@ var DropDownList = /** @class */ (function (_super) {
2529
2542
  DropDownList.prototype.addNewItem = function (listData, newElement) {
2530
2543
  var _this = this;
2531
2544
  if (!isNullOrUndefined(this.itemData) && !isNullOrUndefined(newElement)) {
2532
- var value_2 = this.getItemData().value;
2545
+ var value_1 = this.getItemData().value;
2533
2546
  var isExist = listData.some(function (data) {
2534
- return (((typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean') && data === value_2) ||
2535
- (getValue(_this.fields.value, data) === value_2));
2547
+ return (((typeof data === 'string' || typeof data === 'number' || typeof data === 'boolean') && data === value_1) ||
2548
+ (getValue(_this.fields.value, data) === value_1));
2536
2549
  });
2537
2550
  if (!isExist) {
2538
2551
  this.addItem(this.itemData);
@@ -3947,6 +3960,12 @@ var DropDownList = /** @class */ (function (_super) {
3947
3960
  return { value: void 0 };
3948
3961
  }
3949
3962
  if (this_1.enableVirtualization) {
3963
+ if (newProp.value && this_1.dataSource instanceof DataManager) {
3964
+ var checkField = isNullOrUndefined(this_1.fields.value) ? this_1.fields.text : this_1.fields.value;
3965
+ var value = this_1.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
3966
+ getValue(checkField, newProp.value) : newProp.value;
3967
+ this_1.checkAndFetchItemData(this_1.listData, value, checkField);
3968
+ }
3950
3969
  this_1.updateValues();
3951
3970
  this_1.updateInputFields();
3952
3971
  this_1.notify('setCurrentViewDataAsync', {
@@ -3975,9 +3994,9 @@ var DropDownList = /** @class */ (function (_super) {
3975
3994
  var listLength_2 = this_1.getItems().length;
3976
3995
  var checkField = isNullOrUndefined(this_1.fields.value) ? this_1.fields.text : this_1.fields.value;
3977
3996
  this_1.typedString = '';
3978
- var value_3 = this_1.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
3997
+ var value_2 = this_1.allowObjectBinding && !isNullOrUndefined(newProp.value) ?
3979
3998
  getValue(checkField, newProp.value) : newProp.value;
3980
- this_1.dataSource.executeQuery(this_1.getQuery(this_1.query).where(new Predicate(checkField, 'equal', value_3)))
3999
+ this_1.dataSource.executeQuery(this_1.getQuery(this_1.query).where(new Predicate(checkField, 'equal', value_2)))
3981
4000
  .then(function (e) {
3982
4001
  if (e.result.length > 0) {
3983
4002
  _this.addItem(e.result, listLength_2);
@@ -3970,7 +3970,7 @@ var MultiSelect = /** @class */ (function (_super) {
3970
3970
  this.unwireListEvents();
3971
3971
  this.wireListEvents();
3972
3972
  };
3973
- MultiSelect.prototype.initialValueUpdate = function (listItems, isInitialVirtualData) {
3973
+ MultiSelect.prototype.initialValueUpdate = function (listItems, isInitialVirtualData, isInitialRender) {
3974
3974
  var _this = this;
3975
3975
  if (this.list) {
3976
3976
  var text = void 0;
@@ -3980,6 +3980,7 @@ var MultiSelect = /** @class */ (function (_super) {
3980
3980
  this.chipCollectionWrapper.innerHTML = '';
3981
3981
  }
3982
3982
  this.removeListSelection();
3983
+ var formElement = closest(this.inputElement, 'form');
3983
3984
  if (!isNullOrUndefined(this.value)) {
3984
3985
  for (var index = 0; !isNullOrUndefined(this.value[index]); index++) {
3985
3986
  value_2 = this.allowObjectBinding ?
@@ -4024,7 +4025,8 @@ var MultiSelect = /** @class */ (function (_super) {
4024
4025
  }
4025
4026
  else if ((isNullOrUndefined(text) && !this.allowCustomValue) &&
4026
4027
  ((!(this.dataSource instanceof DataManager)) ||
4027
- (this.dataSource instanceof DataManager && isInitialVirtualData))) {
4028
+ (this.dataSource instanceof DataManager && isInitialVirtualData)) && (!this.isAngular || !isInitialRender ||
4029
+ (isNullOrUndefined(formElement) && listItems && listItems.length > 0))) {
4028
4030
  this.value.splice(index, 1);
4029
4031
  index -= 1;
4030
4032
  }
@@ -6130,7 +6132,7 @@ var MultiSelect = /** @class */ (function (_super) {
6130
6132
  this.viewPortInfo.startIndex = this.virtualItemStartIndex = 0;
6131
6133
  this.viewPortInfo.endIndex = this.virtualItemEndIndex = this.viewPortInfo.startIndex > 0 ?
6132
6134
  this.viewPortInfo.endIndex : this.itemCount;
6133
- this.checkInitialValue();
6135
+ this.checkInitialValue(true);
6134
6136
  if (this.element.hasAttribute('data-val')) {
6135
6137
  this.element.setAttribute('data-val', 'false');
6136
6138
  }
@@ -6310,7 +6312,7 @@ var MultiSelect = /** @class */ (function (_super) {
6310
6312
  this.value = data.length > 0 ? data : null;
6311
6313
  }
6312
6314
  };
6313
- MultiSelect.prototype.checkInitialValue = function () {
6315
+ MultiSelect.prototype.checkInitialValue = function (isInitialRender) {
6314
6316
  var _this = this;
6315
6317
  if (this.fields.disabled) {
6316
6318
  this.removeDisabledItemsValue(this.value);
@@ -6397,7 +6399,7 @@ var MultiSelect = /** @class */ (function (_super) {
6397
6399
  }
6398
6400
  }
6399
6401
  if (!(this.dataSource instanceof DataManager)) {
6400
- this.initialValueUpdate(listItems_3, true);
6402
+ this.initialValueUpdate(listItems_3, true, isInitialRender);
6401
6403
  this.initialUpdate();
6402
6404
  }
6403
6405
  else {
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
+ }