@syncfusion/ej2-dropdowns 25.2.7 → 26.1.35
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 +3 -2
- package/dist/ej2-dropdowns.min.js +2 -2
- 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 +505 -224
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +498 -216
- 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 +14 -13
- package/src/auto-complete/auto-complete.js +1 -1
- package/src/combo-box/combo-box.js +15 -0
- package/src/common/interface.js +0 -1
- package/src/common/virtual-scroll.js +1 -0
- package/src/drop-down-base/drop-down-base-model.d.ts +8 -1
- package/src/drop-down-base/drop-down-base.d.ts +28 -2
- package/src/drop-down-base/drop-down-base.js +64 -9
- package/src/drop-down-list/drop-down-list.d.ts +15 -2
- package/src/drop-down-list/drop-down-list.js +129 -13
- package/src/drop-down-tree/drop-down-tree-model.d.ts +15 -15
- package/src/drop-down-tree/drop-down-tree.d.ts +17 -13
- package/src/drop-down-tree/drop-down-tree.js +52 -38
- package/src/list-box/list-box.js +30 -9
- package/src/mention/mention.js +23 -8
- package/src/multi-select/interface.js +0 -1
- package/src/multi-select/multi-select.d.ts +15 -0
- package/src/multi-select/multi-select.js +135 -12
- package/styles/auto-complete/_bootstrap5.3-definition.scss +2 -0
- package/styles/auto-complete/_fluent2-definition.scss +2 -0
- package/styles/auto-complete/bootstrap-dark.css +5 -2
- package/styles/auto-complete/bootstrap.css +5 -2
- package/styles/auto-complete/bootstrap4.css +6 -2
- package/styles/auto-complete/bootstrap5-dark.css +6 -2
- package/styles/auto-complete/bootstrap5.css +6 -2
- package/styles/auto-complete/fabric-dark.css +3 -1
- package/styles/auto-complete/fabric.css +3 -1
- package/styles/auto-complete/fluent-dark.css +6 -2
- package/styles/auto-complete/fluent.css +6 -2
- package/styles/auto-complete/fluent2.css +1140 -0
- package/styles/auto-complete/fluent2.scss +4 -0
- package/styles/auto-complete/highcontrast-light.css +3 -1
- package/styles/auto-complete/highcontrast.css +3 -1
- package/styles/auto-complete/material-dark.css +16 -5
- package/styles/auto-complete/material.css +16 -5
- package/styles/auto-complete/material3-dark.css +17 -6
- package/styles/auto-complete/material3.css +17 -6
- package/styles/auto-complete/tailwind-dark.css +16 -5
- package/styles/auto-complete/tailwind.css +16 -5
- package/styles/bootstrap-dark.css +196 -228
- package/styles/bootstrap-dark.scss +28 -8
- package/styles/bootstrap.css +196 -228
- package/styles/bootstrap.scss +28 -8
- package/styles/bootstrap4.css +199 -229
- package/styles/bootstrap4.scss +28 -8
- package/styles/bootstrap5-dark.css +196 -221
- package/styles/bootstrap5-dark.scss +28 -8
- package/styles/bootstrap5.css +196 -221
- package/styles/bootstrap5.scss +28 -8
- package/styles/combo-box/_bootstrap5.3-definition.scss +2 -0
- package/styles/combo-box/_fluent2-definition.scss +2 -0
- package/styles/combo-box/bootstrap-dark.css +5 -2
- package/styles/combo-box/bootstrap.css +5 -2
- package/styles/combo-box/bootstrap4.css +6 -2
- package/styles/combo-box/bootstrap5-dark.css +6 -2
- package/styles/combo-box/bootstrap5.css +6 -2
- package/styles/combo-box/fabric-dark.css +3 -1
- package/styles/combo-box/fabric.css +3 -1
- package/styles/combo-box/fluent-dark.css +6 -2
- package/styles/combo-box/fluent.css +6 -2
- package/styles/combo-box/fluent2.css +1140 -0
- package/styles/combo-box/fluent2.scss +4 -0
- package/styles/combo-box/highcontrast-light.css +3 -1
- package/styles/combo-box/highcontrast.css +3 -1
- package/styles/combo-box/material-dark.css +16 -5
- package/styles/combo-box/material.css +16 -5
- package/styles/combo-box/material3-dark.css +17 -6
- package/styles/combo-box/material3.css +17 -6
- package/styles/combo-box/tailwind-dark.css +16 -5
- package/styles/combo-box/tailwind.css +16 -5
- package/styles/drop-down-base/_bds-definition.scss +2 -2
- package/styles/drop-down-base/_bootstrap5.3-definition.scss +117 -0
- package/styles/drop-down-base/_fluent2-definition.scss +134 -0
- package/styles/drop-down-base/_layout.scss +12 -2
- package/styles/drop-down-base/_material3-definition.scss +0 -11
- package/styles/drop-down-base/_theme.scss +2 -11
- package/styles/drop-down-base/bootstrap-dark.css +2 -1
- package/styles/drop-down-base/bootstrap.css +2 -1
- package/styles/drop-down-base/bootstrap4.css +2 -1
- package/styles/drop-down-base/bootstrap5-dark.css +2 -1
- package/styles/drop-down-base/bootstrap5.css +2 -1
- package/styles/drop-down-base/fabric-dark.css +2 -1
- package/styles/drop-down-base/fabric.css +2 -1
- package/styles/drop-down-base/fluent-dark.css +2 -1
- package/styles/drop-down-base/fluent.css +2 -1
- package/styles/drop-down-base/fluent2.css +1447 -0
- package/styles/drop-down-base/fluent2.scss +3 -0
- package/styles/drop-down-base/highcontrast-light.css +2 -1
- package/styles/drop-down-base/highcontrast.css +2 -1
- package/styles/drop-down-base/material-dark.css +2 -1
- package/styles/drop-down-base/material.css +2 -1
- package/styles/drop-down-base/material3-dark.css +9 -2
- package/styles/drop-down-base/material3.css +9 -2
- package/styles/drop-down-base/tailwind-dark.css +2 -1
- package/styles/drop-down-base/tailwind.css +2 -1
- package/styles/drop-down-list/_bootstrap5.3-definition.scss +201 -0
- package/styles/drop-down-list/_fluent2-definition.scss +134 -0
- package/styles/drop-down-list/_layout.scss +5 -3
- package/styles/drop-down-list/_material3-definition.scss +0 -8
- package/styles/drop-down-list/bootstrap-dark.css +38 -3
- package/styles/drop-down-list/bootstrap.css +38 -3
- package/styles/drop-down-list/bootstrap4.css +39 -3
- package/styles/drop-down-list/bootstrap5-dark.css +39 -3
- package/styles/drop-down-list/bootstrap5.css +39 -3
- package/styles/drop-down-list/fabric-dark.css +36 -2
- package/styles/drop-down-list/fabric.css +36 -2
- package/styles/drop-down-list/fluent-dark.css +39 -3
- package/styles/drop-down-list/fluent.css +39 -3
- package/styles/drop-down-list/fluent2.css +1684 -0
- package/styles/drop-down-list/fluent2.scss +9 -0
- package/styles/drop-down-list/highcontrast-light.css +36 -2
- package/styles/drop-down-list/highcontrast.css +36 -2
- package/styles/drop-down-list/icons/_bootstrap5.3.scss +14 -0
- package/styles/drop-down-list/icons/_fluent2.scss +14 -0
- package/styles/drop-down-list/material-dark.css +58 -7
- package/styles/drop-down-list/material.css +72 -9
- package/styles/drop-down-list/material3-dark.css +74 -10
- package/styles/drop-down-list/material3.css +74 -10
- package/styles/drop-down-list/tailwind-dark.css +49 -6
- package/styles/drop-down-list/tailwind.css +49 -6
- package/styles/drop-down-tree/_bds-definition.scss +5 -0
- package/styles/drop-down-tree/_bootstrap4-definition.scss +1 -0
- package/styles/drop-down-tree/_bootstrap5-definition.scss +5 -0
- package/styles/drop-down-tree/_bootstrap5.3-definition.scss +66 -0
- package/styles/drop-down-tree/_fluent-definition.scss +4 -0
- package/styles/drop-down-tree/_fluent2-definition.scss +75 -0
- package/styles/drop-down-tree/_layout.scss +289 -327
- package/styles/drop-down-tree/_material3-definition.scss +3 -5
- package/styles/drop-down-tree/_tailwind-definition.scss +7 -2
- package/styles/drop-down-tree/_theme.scss +24 -41
- package/styles/drop-down-tree/bootstrap-dark.css +63 -29
- package/styles/drop-down-tree/bootstrap.css +63 -29
- package/styles/drop-down-tree/bootstrap4.css +64 -30
- package/styles/drop-down-tree/bootstrap5-dark.css +63 -27
- package/styles/drop-down-tree/bootstrap5.css +63 -27
- package/styles/drop-down-tree/fabric-dark.css +63 -29
- package/styles/drop-down-tree/fabric.css +63 -29
- package/styles/drop-down-tree/fluent-dark.css +71 -35
- package/styles/drop-down-tree/fluent.css +71 -35
- package/styles/drop-down-tree/fluent2.css +1732 -0
- package/styles/drop-down-tree/fluent2.scss +9 -0
- package/styles/drop-down-tree/highcontrast-light.css +63 -29
- package/styles/drop-down-tree/highcontrast.css +63 -23
- package/styles/drop-down-tree/icons/_bootstrap5.3.scss +11 -0
- package/styles/drop-down-tree/icons/_fluent2.scss +14 -0
- package/styles/drop-down-tree/material-dark.css +80 -43
- package/styles/drop-down-tree/material.css +97 -51
- package/styles/drop-down-tree/material3-dark.css +85 -32
- package/styles/drop-down-tree/material3.css +85 -32
- package/styles/drop-down-tree/tailwind-dark.css +72 -28
- package/styles/drop-down-tree/tailwind.css +72 -28
- package/styles/fabric-dark.css +194 -227
- package/styles/fabric-dark.scss +28 -8
- package/styles/fabric.css +194 -227
- package/styles/fabric.scss +28 -8
- package/styles/fluent-dark.css +206 -236
- package/styles/fluent-dark.scss +28 -8
- package/styles/fluent.css +206 -236
- package/styles/fluent.scss +28 -8
- package/styles/fluent2.css +4771 -0
- package/styles/fluent2.scss +28 -0
- package/styles/highcontrast-light.css +197 -227
- package/styles/highcontrast-light.scss +28 -8
- package/styles/highcontrast.css +197 -221
- package/styles/highcontrast.scss +28 -8
- package/styles/list-box/_bootstrap-dark-definition.scss +0 -2
- package/styles/list-box/_bootstrap5.3-definition.scss +120 -0
- package/styles/list-box/_fabric-dark-definition.scss +0 -2
- package/styles/list-box/_fluent2-definition.scss +121 -0
- package/styles/list-box/_highcontrast-light-definition.scss +0 -2
- package/styles/list-box/_layout.scss +65 -44
- package/styles/list-box/_material-dark-definition.scss +0 -2
- package/styles/list-box/_tailwind-definition.scss +1 -1
- package/styles/list-box/_theme.scss +36 -65
- package/styles/list-box/bootstrap-dark.css +72 -112
- package/styles/list-box/bootstrap.css +72 -112
- package/styles/list-box/bootstrap4.css +72 -112
- package/styles/list-box/bootstrap5-dark.css +72 -106
- package/styles/list-box/bootstrap5.css +72 -106
- package/styles/list-box/fabric-dark.css +72 -112
- package/styles/list-box/fabric.css +72 -112
- package/styles/list-box/fluent-dark.css +72 -112
- package/styles/list-box/fluent.css +72 -112
- package/styles/list-box/fluent2.css +2029 -0
- package/styles/list-box/fluent2.scss +5 -0
- package/styles/list-box/highcontrast-light.css +72 -112
- package/styles/list-box/highcontrast.css +72 -112
- package/styles/list-box/icons/_bootstrap5.3.scss +25 -0
- package/styles/list-box/icons/_fluent2.scss +25 -0
- package/styles/list-box/material-dark.css +72 -112
- package/styles/list-box/material.css +72 -112
- package/styles/list-box/material3-dark.css +73 -113
- package/styles/list-box/material3.css +73 -113
- package/styles/list-box/tailwind-dark.css +74 -114
- package/styles/list-box/tailwind.css +74 -114
- package/styles/material-dark.css +236 -260
- package/styles/material-dark.scss +28 -8
- package/styles/material.css +253 -284
- package/styles/material.scss +28 -8
- package/styles/material3-dark.css +253 -266
- package/styles/material3-dark.scss +28 -8
- package/styles/material3.css +253 -266
- package/styles/material3.scss +28 -8
- package/styles/mention/_bootstrap5.3-definition.scss +1 -0
- package/styles/mention/_fluent2-definition.scss +1 -0
- package/styles/mention/bootstrap-dark.css +24 -0
- package/styles/mention/bootstrap.css +24 -0
- package/styles/mention/bootstrap4.css +24 -0
- package/styles/mention/bootstrap5-dark.css +24 -0
- package/styles/mention/bootstrap5.css +24 -0
- package/styles/mention/fabric-dark.css +24 -0
- package/styles/mention/fabric.css +24 -0
- package/styles/mention/fluent-dark.css +24 -0
- package/styles/mention/fluent.css +24 -0
- package/styles/mention/fluent2.css +1130 -0
- package/styles/mention/fluent2.scss +6 -0
- package/styles/mention/highcontrast-light.css +24 -0
- package/styles/mention/highcontrast.css +24 -0
- package/styles/mention/material-dark.css +24 -0
- package/styles/mention/material.css +24 -0
- package/styles/mention/material3-dark.css +25 -1
- package/styles/mention/material3.css +25 -1
- package/styles/mention/tailwind-dark.css +24 -0
- package/styles/mention/tailwind.css +24 -0
- package/styles/multi-select/_bootstrap5.3-definition.scss +230 -0
- package/styles/multi-select/_fluent2-definition.scss +236 -0
- package/styles/multi-select/_layout.scss +32 -38
- package/styles/multi-select/_material3-definition.scss +0 -15
- package/styles/multi-select/_theme.scss +0 -4
- package/styles/multi-select/bootstrap-dark.css +67 -28
- package/styles/multi-select/bootstrap.css +67 -28
- package/styles/multi-select/bootstrap4.css +70 -29
- package/styles/multi-select/bootstrap5-dark.css +67 -28
- package/styles/multi-select/bootstrap5.css +67 -28
- package/styles/multi-select/fabric-dark.css +67 -28
- package/styles/multi-select/fabric.css +67 -28
- package/styles/multi-select/fluent-dark.css +69 -29
- package/styles/multi-select/fluent.css +69 -29
- package/styles/multi-select/fluent2.css +2663 -0
- package/styles/multi-select/fluent2.scss +9 -0
- package/styles/multi-select/highcontrast-light.css +70 -28
- package/styles/multi-select/highcontrast.css +70 -28
- package/styles/multi-select/icons/_bootstrap5.3.scss +26 -0
- package/styles/multi-select/icons/_fluent2.scss +692 -0
- package/styles/multi-select/material-dark.css +88 -32
- package/styles/multi-select/material.css +102 -34
- package/styles/multi-select/material3-dark.css +109 -35
- package/styles/multi-select/material3.css +109 -35
- package/styles/multi-select/tailwind-dark.css +67 -28
- package/styles/multi-select/tailwind.css +67 -28
- package/styles/tailwind-dark.css +217 -233
- package/styles/tailwind-dark.scss +28 -8
- package/styles/tailwind.css +217 -233
- package/styles/tailwind.scss +28 -8
- package/CHANGELOG.md +0 -2200
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version :
|
|
3
|
+
* version : 26.1.35
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. 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@
|
|
3
|
+
"_id": "@syncfusion/ej2-dropdowns@18.66.23",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-yDOcip+lZNukwhS2MZga3L7PqR0RlCStBwQDsjvg4ZhCtJ8qXB7mNWPjSOfZGgJRw3HWCGhCzSyZb3zSjMpXUA==",
|
|
6
6
|
"_location": "/@syncfusion/ej2-dropdowns",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"/@syncfusion/ej2-documenteditor",
|
|
24
24
|
"/@syncfusion/ej2-gantt",
|
|
25
25
|
"/@syncfusion/ej2-grids",
|
|
26
|
+
"/@syncfusion/ej2-image-editor",
|
|
26
27
|
"/@syncfusion/ej2-inplace-editor",
|
|
27
28
|
"/@syncfusion/ej2-kanban",
|
|
28
29
|
"/@syncfusion/ej2-pdfviewer",
|
|
@@ -34,22 +35,22 @@
|
|
|
34
35
|
"/@syncfusion/ej2-spreadsheet",
|
|
35
36
|
"/@syncfusion/ej2-vue-dropdowns"
|
|
36
37
|
],
|
|
37
|
-
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-
|
|
38
|
-
"_shasum": "
|
|
38
|
+
"_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-release/@syncfusion/ej2-dropdowns/-/ej2-dropdowns-18.66.23.tgz",
|
|
39
|
+
"_shasum": "e298ecdd7cb43706e54fe2850a72cb6c5ffc0093",
|
|
39
40
|
"_spec": "@syncfusion/ej2-dropdowns@*",
|
|
40
|
-
"_where": "/jenkins/workspace/elease-
|
|
41
|
+
"_where": "/jenkins/workspace/elease-automation_release_26.1.1/packages/included",
|
|
41
42
|
"author": {
|
|
42
43
|
"name": "Syncfusion Inc."
|
|
43
44
|
},
|
|
44
45
|
"bundleDependencies": false,
|
|
45
46
|
"dependencies": {
|
|
46
|
-
"@syncfusion/ej2-base": "~
|
|
47
|
-
"@syncfusion/ej2-data": "~
|
|
48
|
-
"@syncfusion/ej2-inputs": "~
|
|
49
|
-
"@syncfusion/ej2-lists": "~
|
|
50
|
-
"@syncfusion/ej2-navigations": "~
|
|
51
|
-
"@syncfusion/ej2-notifications": "~
|
|
52
|
-
"@syncfusion/ej2-popups": "~
|
|
47
|
+
"@syncfusion/ej2-base": "~26.1.35",
|
|
48
|
+
"@syncfusion/ej2-data": "~26.1.35",
|
|
49
|
+
"@syncfusion/ej2-inputs": "~26.1.35",
|
|
50
|
+
"@syncfusion/ej2-lists": "~26.1.35",
|
|
51
|
+
"@syncfusion/ej2-navigations": "~26.1.35",
|
|
52
|
+
"@syncfusion/ej2-notifications": "~26.1.35",
|
|
53
|
+
"@syncfusion/ej2-popups": "~26.1.35"
|
|
53
54
|
},
|
|
54
55
|
"deprecated": false,
|
|
55
56
|
"description": "Essential JS 2 DropDown Components",
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
"module": "./index.js",
|
|
75
76
|
"name": "@syncfusion/ej2-dropdowns",
|
|
76
77
|
"typings": "index.d.ts",
|
|
77
|
-
"version": "
|
|
78
|
+
"version": "26.1.35",
|
|
78
79
|
"sideEffects": false,
|
|
79
80
|
"homepage": "https://www.syncfusion.com/javascript-ui-controls"
|
|
80
81
|
}
|
|
@@ -486,7 +486,7 @@ var AutoComplete = /** @class */ (function (_super) {
|
|
|
486
486
|
_super.prototype.render.call(this);
|
|
487
487
|
};
|
|
488
488
|
__decorate([
|
|
489
|
-
Complex({ value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
489
|
+
Complex({ value: null, iconCss: null, groupBy: null, disabled: null }, FieldSettings)
|
|
490
490
|
], AutoComplete.prototype, "fields", void 0);
|
|
491
491
|
__decorate([
|
|
492
492
|
Property(true)
|
|
@@ -144,6 +144,18 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
ComboBox.prototype.updateValues = function () {
|
|
147
|
+
if (this.fields.disabled) {
|
|
148
|
+
if (this.value != null) {
|
|
149
|
+
this.value = !this.isDisableItemValue(this.value) ? this.value : null;
|
|
150
|
+
}
|
|
151
|
+
if (this.text != null) {
|
|
152
|
+
this.text = !this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text))) ? this.text : null;
|
|
153
|
+
}
|
|
154
|
+
if (this.index != null) {
|
|
155
|
+
this.index = !this.isDisabledItemByIndex(this.index) ? this.index : null;
|
|
156
|
+
this.activeIndex = this.index;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
147
159
|
if (!isNullOrUndefined(this.value)) {
|
|
148
160
|
var currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
|
|
149
161
|
var li = this.getElementByValue(currentValue);
|
|
@@ -577,6 +589,9 @@ var ComboBox = /** @class */ (function (_super) {
|
|
|
577
589
|
else {
|
|
578
590
|
li = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
579
591
|
}
|
|
592
|
+
if (this.isDisabledElement(li)) {
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
580
595
|
if (li) {
|
|
581
596
|
this.setSelection(li, e);
|
|
582
597
|
this.isTyped = false;
|
package/src/common/interface.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -314,6 +314,7 @@ var VirtualScroll = /** @class */ (function () {
|
|
|
314
314
|
this.parent.updatevirtualizationList();
|
|
315
315
|
}
|
|
316
316
|
this.parent.getSkeletonCount();
|
|
317
|
+
this.parent.skeletonCount = this.parent.totalItemCount != 0 && this.parent.totalItemCount < (this.parent.itemCount * 2) ? 0 : this.parent.skeletonCount;
|
|
317
318
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
318
319
|
var virtualTrackElement = this.parent.list.getElementsByClassName('e-virtual-ddl')[0];
|
|
319
320
|
if (virtualTrackElement) {
|
|
@@ -43,6 +43,13 @@ export interface FieldSettingsModel {
|
|
|
43
43
|
*/
|
|
44
44
|
htmlAttributes?: string;
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Defines whether the particular field value is disabled or not.
|
|
48
|
+
*
|
|
49
|
+
* @default null
|
|
50
|
+
*/
|
|
51
|
+
disabled?: string;
|
|
52
|
+
|
|
46
53
|
}
|
|
47
54
|
|
|
48
55
|
/**
|
|
@@ -69,7 +76,7 @@ export interface DropDownBaseModel extends ComponentModel{
|
|
|
69
76
|
* customers.appendTo("#list");
|
|
70
77
|
* ```
|
|
71
78
|
*
|
|
72
|
-
* @default {text: null, value: null, iconCss: null, groupBy: null}
|
|
79
|
+
* @default {text: null, value: null, iconCss: null, groupBy: null, disabled: null}
|
|
73
80
|
|
|
74
81
|
*/
|
|
75
82
|
fields?: FieldSettingsModel;
|
|
@@ -40,6 +40,12 @@ export declare class FieldSettings extends ChildProperty<FieldSettings> {
|
|
|
40
40
|
* @default null
|
|
41
41
|
*/
|
|
42
42
|
htmlAttributes: string;
|
|
43
|
+
/**
|
|
44
|
+
* Defines whether the particular field value is disabled or not.
|
|
45
|
+
*
|
|
46
|
+
* @default null
|
|
47
|
+
*/
|
|
48
|
+
disabled: string;
|
|
43
49
|
}
|
|
44
50
|
export declare const dropDownBaseClasses: DropDownBaseClassList;
|
|
45
51
|
export interface DropDownBaseClassList {
|
|
@@ -220,7 +226,6 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
220
226
|
protected noRecordsTemplateId: string;
|
|
221
227
|
protected actionFailureTemplateId: string;
|
|
222
228
|
protected preventChange: boolean;
|
|
223
|
-
protected isAngular: boolean;
|
|
224
229
|
protected isPreventChange: boolean;
|
|
225
230
|
protected isDynamicDataChange: boolean;
|
|
226
231
|
protected addedNewItem: boolean;
|
|
@@ -310,7 +315,7 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
310
315
|
* customers.appendTo("#list");
|
|
311
316
|
* ```
|
|
312
317
|
*
|
|
313
|
-
* @default {text: null, value: null, iconCss: null, groupBy: null}
|
|
318
|
+
* @default {text: null, value: null, iconCss: null, groupBy: null, disabled: null}
|
|
314
319
|
|
|
315
320
|
*/
|
|
316
321
|
fields: FieldSettingsModel;
|
|
@@ -736,6 +741,27 @@ export declare class DropDownBase extends Component<HTMLElement> implements INot
|
|
|
736
741
|
}[] | {
|
|
737
742
|
[key: string]: Object;
|
|
738
743
|
} | string | boolean | number | string[] | boolean[] | number[], itemIndex?: number): void;
|
|
744
|
+
/**
|
|
745
|
+
* Checks if the given HTML element is disabled.
|
|
746
|
+
*
|
|
747
|
+
* @param {HTMLElement} li - The HTML element to check.
|
|
748
|
+
* @returns {boolean} - Returns true if the element is disabled, otherwise false.
|
|
749
|
+
*/
|
|
750
|
+
protected isDisabledElement(li: HTMLElement): boolean;
|
|
751
|
+
/**
|
|
752
|
+
* Checks whether the list item at the specified index is disabled.
|
|
753
|
+
*
|
|
754
|
+
* @param {number} index - The index of the list item to check.
|
|
755
|
+
* @returns {boolean} True if the list item is disabled, false otherwise.
|
|
756
|
+
*/
|
|
757
|
+
protected isDisabledItemByIndex(index: number): boolean;
|
|
758
|
+
/**
|
|
759
|
+
* Disables the given list item.
|
|
760
|
+
*
|
|
761
|
+
* @param { HTMLLIElement } li - The list item to disable.
|
|
762
|
+
* @returns {void}
|
|
763
|
+
*/
|
|
764
|
+
protected disableListItem(li: HTMLLIElement): void;
|
|
739
765
|
protected validationAttribute(target: HTMLElement, hidden: Element): void;
|
|
740
766
|
protected setZIndex(): void;
|
|
741
767
|
protected updateActionCompleteData(li: HTMLElement, item: {
|
|
@@ -44,6 +44,9 @@ var FieldSettings = /** @class */ (function (_super) {
|
|
|
44
44
|
__decorate([
|
|
45
45
|
Property()
|
|
46
46
|
], FieldSettings.prototype, "htmlAttributes", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
Property()
|
|
49
|
+
], FieldSettings.prototype, "disabled", void 0);
|
|
47
50
|
return FieldSettings;
|
|
48
51
|
}(ChildProperty));
|
|
49
52
|
export { FieldSettings };
|
|
@@ -87,7 +90,6 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
87
90
|
function DropDownBase(options, element) {
|
|
88
91
|
var _this = _super.call(this, options, element) || this;
|
|
89
92
|
_this.preventChange = false;
|
|
90
|
-
_this.isAngular = false;
|
|
91
93
|
_this.isPreventChange = false;
|
|
92
94
|
_this.isDynamicDataChange = false;
|
|
93
95
|
_this.addedNewItem = false;
|
|
@@ -298,7 +300,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
298
300
|
};
|
|
299
301
|
DropDownBase.prototype.l10nUpdate = function (actionFailure) {
|
|
300
302
|
var ele = this.getModuleName() === 'listbox' ? this.ulElement : this.list;
|
|
301
|
-
if (this.noRecordsTemplate !== 'No records found' || this.actionFailureTemplate !== 'Request failed') {
|
|
303
|
+
if ((!isNullOrUndefined(this.noRecordsTemplate) && this.noRecordsTemplate !== 'No records found') || this.actionFailureTemplate !== 'Request failed') {
|
|
302
304
|
var template = actionFailure ? this.actionFailureTemplate : this.noRecordsTemplate;
|
|
303
305
|
var compiledString = void 0;
|
|
304
306
|
var templateId = actionFailure ? this.actionFailureTemplateId : this.noRecordsTemplateId;
|
|
@@ -460,7 +462,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
460
462
|
DropDownBase.prototype.getTransformValues = function () {
|
|
461
463
|
var translateY = this.viewPortInfo.startIndex * this.listItemHeight;
|
|
462
464
|
translateY = translateY - (this.skeletonCount * this.listItemHeight);
|
|
463
|
-
translateY = this.viewPortInfo.startIndex === 0 && this.listData && this.listData.length === 0 ? 0 : translateY;
|
|
465
|
+
translateY = ((this.viewPortInfo.startIndex === 0 && this.listData && this.listData.length === 0) || this.skeletonCount === 0) ? 0 : translateY;
|
|
464
466
|
var styleText = "transform: translate(0px, " + translateY + "px);";
|
|
465
467
|
return styleText;
|
|
466
468
|
};
|
|
@@ -605,17 +607,18 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
605
607
|
}
|
|
606
608
|
element.querySelectorAll('select>option');
|
|
607
609
|
}
|
|
608
|
-
this.updateFields(fields.text, fields.value, this.fields.groupBy, this.fields.htmlAttributes, this.fields.iconCss);
|
|
610
|
+
this.updateFields(fields.text, fields.value, this.fields.groupBy, this.fields.htmlAttributes, this.fields.iconCss, this.fields.disabled);
|
|
609
611
|
this.resetList(jsonElement, fields);
|
|
610
612
|
};
|
|
611
|
-
DropDownBase.prototype.updateFields = function (text, value, groupBy, htmlAttributes, iconCss) {
|
|
613
|
+
DropDownBase.prototype.updateFields = function (text, value, groupBy, htmlAttributes, iconCss, disabled) {
|
|
612
614
|
var field = {
|
|
613
615
|
'fields': {
|
|
614
616
|
text: text,
|
|
615
617
|
value: value,
|
|
616
618
|
groupBy: !isNullOrUndefined(groupBy) ? groupBy : this.fields && this.fields.groupBy,
|
|
617
619
|
htmlAttributes: !isNullOrUndefined(htmlAttributes) ? htmlAttributes : this.fields && this.fields.htmlAttributes,
|
|
618
|
-
iconCss: !isNullOrUndefined(iconCss) ? iconCss : this.fields && this.fields.iconCss
|
|
620
|
+
iconCss: !isNullOrUndefined(iconCss) ? iconCss : this.fields && this.fields.iconCss,
|
|
621
|
+
disabled: !isNullOrUndefined(disabled) ? disabled : this.fields && this.fields.disabled
|
|
619
622
|
}
|
|
620
623
|
};
|
|
621
624
|
this.setProperties(field, true);
|
|
@@ -986,8 +989,16 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
986
989
|
};
|
|
987
990
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
988
991
|
DropDownBase.prototype.postRender = function (listElement, list, bindEvent) {
|
|
992
|
+
if (this.fields.disabled) {
|
|
993
|
+
var liCollections = listElement.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
994
|
+
for (var index = 0; index < liCollections.length; index++) {
|
|
995
|
+
if (JSON.parse(JSON.stringify(this.listData[index]))[this.fields.disabled]) {
|
|
996
|
+
this.disableListItem(liCollections[index]);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
}
|
|
989
1000
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
990
|
-
var focusItem = listElement.querySelector('.' + dropDownBaseClasses.li);
|
|
1001
|
+
var focusItem = this.fields.disabled ? listElement.querySelector('.' + dropDownBaseClasses.li + ':not(.e-disabled') : listElement.querySelector('.' + dropDownBaseClasses.li);
|
|
991
1002
|
var selectedItem = listElement.querySelector('.' + dropDownBaseClasses.selected);
|
|
992
1003
|
if (focusItem && !selectedItem) {
|
|
993
1004
|
focusItem.classList.add(dropDownBaseClasses.focus);
|
|
@@ -1341,7 +1352,13 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
1341
1352
|
*/
|
|
1342
1353
|
DropDownBase.prototype.getIndexByValue = function (value) {
|
|
1343
1354
|
var index;
|
|
1344
|
-
var listItems =
|
|
1355
|
+
var listItems = [];
|
|
1356
|
+
if (this.fields.disabled && this.getModuleName() === 'multiselect' && this.liCollections) {
|
|
1357
|
+
listItems = this.liCollections;
|
|
1358
|
+
}
|
|
1359
|
+
else {
|
|
1360
|
+
listItems = this.getItems();
|
|
1361
|
+
}
|
|
1345
1362
|
for (var i = 0; i < listItems.length; i++) {
|
|
1346
1363
|
if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
|
|
1347
1364
|
index = i;
|
|
@@ -1630,6 +1647,9 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
1630
1647
|
this.notify('addItem', { module: 'CheckBoxSelection', item: li });
|
|
1631
1648
|
liCollections.push(li);
|
|
1632
1649
|
if (this.getModuleName() === 'listbox') {
|
|
1650
|
+
if (item.disabled) {
|
|
1651
|
+
li.classList.add('e-disabled');
|
|
1652
|
+
}
|
|
1633
1653
|
this.listData.splice(isListboxEmpty ? this.listData.length : index, 0, item);
|
|
1634
1654
|
if (this.listData.length !== this.sortedData.length) {
|
|
1635
1655
|
this.sortedData = this.listData;
|
|
@@ -1715,6 +1735,41 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
1715
1735
|
}
|
|
1716
1736
|
this.addedNewItem = true;
|
|
1717
1737
|
};
|
|
1738
|
+
/**
|
|
1739
|
+
* Checks if the given HTML element is disabled.
|
|
1740
|
+
*
|
|
1741
|
+
* @param {HTMLElement} li - The HTML element to check.
|
|
1742
|
+
* @returns {boolean} - Returns true if the element is disabled, otherwise false.
|
|
1743
|
+
*/
|
|
1744
|
+
DropDownBase.prototype.isDisabledElement = function (li) {
|
|
1745
|
+
if (li && li.classList.contains('e-disabled')) {
|
|
1746
|
+
return true;
|
|
1747
|
+
}
|
|
1748
|
+
return false;
|
|
1749
|
+
};
|
|
1750
|
+
/**
|
|
1751
|
+
* Checks whether the list item at the specified index is disabled.
|
|
1752
|
+
*
|
|
1753
|
+
* @param {number} index - The index of the list item to check.
|
|
1754
|
+
* @returns {boolean} True if the list item is disabled, false otherwise.
|
|
1755
|
+
*/
|
|
1756
|
+
DropDownBase.prototype.isDisabledItemByIndex = function (index) {
|
|
1757
|
+
if (this.fields.disabled && this.liCollections) {
|
|
1758
|
+
return this.isDisabledElement(this.liCollections[index]);
|
|
1759
|
+
}
|
|
1760
|
+
return false;
|
|
1761
|
+
};
|
|
1762
|
+
/**
|
|
1763
|
+
* Disables the given list item.
|
|
1764
|
+
*
|
|
1765
|
+
* @param { HTMLLIElement } li - The list item to disable.
|
|
1766
|
+
* @returns {void}
|
|
1767
|
+
*/
|
|
1768
|
+
DropDownBase.prototype.disableListItem = function (li) {
|
|
1769
|
+
li.classList.add('e-disabled');
|
|
1770
|
+
li.setAttribute('aria-disabled', 'true');
|
|
1771
|
+
li.setAttribute('aria-selected', 'false');
|
|
1772
|
+
};
|
|
1718
1773
|
DropDownBase.prototype.validationAttribute = function (target, hidden) {
|
|
1719
1774
|
var name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');
|
|
1720
1775
|
hidden.setAttribute('name', name);
|
|
@@ -1798,7 +1853,7 @@ var DropDownBase = /** @class */ (function (_super) {
|
|
|
1798
1853
|
_super.prototype.destroy.call(this);
|
|
1799
1854
|
};
|
|
1800
1855
|
__decorate([
|
|
1801
|
-
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
1856
|
+
Complex({ text: null, value: null, iconCss: null, groupBy: null, disabled: null }, FieldSettings)
|
|
1802
1857
|
], DropDownBase.prototype, "fields", void 0);
|
|
1803
1858
|
__decorate([
|
|
1804
1859
|
Property(null)
|
|
@@ -104,7 +104,6 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
104
104
|
private isSecondClick;
|
|
105
105
|
protected isListSearched: boolean;
|
|
106
106
|
protected preventChange: boolean;
|
|
107
|
-
protected isAngular: boolean;
|
|
108
107
|
protected selectedElementID: string;
|
|
109
108
|
private preselectedIndex;
|
|
110
109
|
private isTouched;
|
|
@@ -391,6 +390,13 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
391
390
|
protected getElementByText(text: string): Element;
|
|
392
391
|
protected getElementByValue(value: string | number | boolean | object): Element;
|
|
393
392
|
private initValue;
|
|
393
|
+
/**
|
|
394
|
+
* Checks if the given value is disabled.
|
|
395
|
+
*
|
|
396
|
+
* @param { string | number | boolean | object } value - The value to check for disablement. Can be a string, number, boolean, or object.
|
|
397
|
+
* @returns { boolean } A boolean indicating whether the value is disabled.
|
|
398
|
+
*/
|
|
399
|
+
protected isDisableItemValue(value: string | number | boolean | object): boolean;
|
|
394
400
|
protected updateValues(): void;
|
|
395
401
|
protected onBlurHandler(e: MouseEvent): void;
|
|
396
402
|
protected focusOutAction(e?: MouseEvent | KeyboardEventArgs): void;
|
|
@@ -620,7 +626,14 @@ export declare class DropDownList extends DropDownBase implements IInput {
|
|
|
620
626
|
* @returns {void}
|
|
621
627
|
*/
|
|
622
628
|
focusOut(e?: MouseEvent | KeyboardEventArgs): void;
|
|
623
|
-
|
|
629
|
+
/**
|
|
630
|
+
* Method to disable specific item in the popup.
|
|
631
|
+
*
|
|
632
|
+
* @param {string | number | object | HTMLLIElement} item - Specifies the item to be disabled.
|
|
633
|
+
* @returns {void}
|
|
634
|
+
|
|
635
|
+
*/
|
|
636
|
+
disableItem(item: string | number | object | HTMLLIElement): void;
|
|
624
637
|
/**
|
|
625
638
|
* Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
|
|
626
639
|
*
|
|
@@ -88,17 +88,10 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
88
88
|
var _this = _super.call(this, options, element) || this;
|
|
89
89
|
_this.isListSearched = false;
|
|
90
90
|
_this.preventChange = false;
|
|
91
|
-
_this.isAngular = false;
|
|
92
91
|
_this.isTouched = false;
|
|
93
92
|
_this.IsScrollerAtEnd = function () {
|
|
94
93
|
return this.list && this.list.scrollTop + this.list.clientHeight >= this.list.scrollHeight;
|
|
95
94
|
};
|
|
96
|
-
_this.removeAllChildren = function (element) {
|
|
97
|
-
while (element.children[0]) {
|
|
98
|
-
this.removeAllChildren(element.children[0]);
|
|
99
|
-
element.removeChild(element.children[0]);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
95
|
return _this;
|
|
103
96
|
}
|
|
104
97
|
/**
|
|
@@ -219,7 +212,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
219
212
|
this.removeFocus();
|
|
220
213
|
this.list.scrollTop = 0;
|
|
221
214
|
if (this.getModuleName() !== 'autocomplete' && !isNullOrUndefined(this.ulElement)) {
|
|
222
|
-
var li = this.ulElement.querySelector('.' + dropDownListClasses.li);
|
|
215
|
+
var li = this.fields.disabled ? this.ulElement.querySelector('.' + dropDownListClasses.li + ':not(.e-disabled)') : this.ulElement.querySelector('.' + dropDownListClasses.li);
|
|
223
216
|
if (this.enableVirtualization) {
|
|
224
217
|
li = this.liCollections[this.skeletonCount];
|
|
225
218
|
}
|
|
@@ -424,7 +417,32 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
424
417
|
this.updateValues();
|
|
425
418
|
}
|
|
426
419
|
};
|
|
420
|
+
/**
|
|
421
|
+
* Checks if the given value is disabled.
|
|
422
|
+
*
|
|
423
|
+
* @param { string | number | boolean | object } value - The value to check for disablement. Can be a string, number, boolean, or object.
|
|
424
|
+
* @returns { boolean } A boolean indicating whether the value is disabled.
|
|
425
|
+
*/
|
|
426
|
+
DropDownList.prototype.isDisableItemValue = function (value) {
|
|
427
|
+
if (typeof (value) === 'object') {
|
|
428
|
+
var objectValue = JSON.parse(JSON.stringify(value))[this.fields.value];
|
|
429
|
+
return this.isDisabledItemByIndex(this.getIndexByValue(objectValue));
|
|
430
|
+
}
|
|
431
|
+
return this.isDisabledItemByIndex(this.getIndexByValue(value));
|
|
432
|
+
};
|
|
427
433
|
DropDownList.prototype.updateValues = function () {
|
|
434
|
+
if (this.fields.disabled) {
|
|
435
|
+
if (this.value != null) {
|
|
436
|
+
this.value = !this.isDisableItemValue(this.value) ? this.value : null;
|
|
437
|
+
}
|
|
438
|
+
if (this.text != null) {
|
|
439
|
+
this.text = !this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text))) ? this.text : null;
|
|
440
|
+
}
|
|
441
|
+
if (this.index != null) {
|
|
442
|
+
this.index = !this.isDisabledItemByIndex(this.index) ? this.index : null;
|
|
443
|
+
this.activeIndex = this.index;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
428
446
|
this.selectedValueInfo = this.viewPortInfo;
|
|
429
447
|
if (!isNullOrUndefined(this.value)) {
|
|
430
448
|
var value = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue(((this.fields.value) ? this.fields.value : ''), this.value) : this.value;
|
|
@@ -617,7 +635,7 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
617
635
|
var target = e.target;
|
|
618
636
|
this.keyboardEvent = null;
|
|
619
637
|
var li = closest(target, '.' + dropDownBaseClasses.li);
|
|
620
|
-
if (!this.isValidLI(li)) {
|
|
638
|
+
if (!this.isValidLI(li) || this.isDisabledElement(li)) {
|
|
621
639
|
return;
|
|
622
640
|
}
|
|
623
641
|
this.setSelection(li, e);
|
|
@@ -761,7 +779,14 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
761
779
|
}
|
|
762
780
|
}
|
|
763
781
|
else {
|
|
764
|
-
var li =
|
|
782
|
+
var li = void 0;
|
|
783
|
+
if (this.fields.disabled) {
|
|
784
|
+
var enableLiCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li + ':not(.e-disabled)');
|
|
785
|
+
li = incrementalSearch(e.charCode, enableLiCollections, this.activeIndex, true, this.element.id);
|
|
786
|
+
}
|
|
787
|
+
else {
|
|
788
|
+
li = incrementalSearch(e.charCode, this.liCollections, this.activeIndex, true, this.element.id);
|
|
789
|
+
}
|
|
765
790
|
if (!isNullOrUndefined(li)) {
|
|
766
791
|
this.setSelection(li, e);
|
|
767
792
|
this.setScrollPosition();
|
|
@@ -891,6 +916,9 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
891
916
|
}
|
|
892
917
|
};
|
|
893
918
|
DropDownList.prototype.updateUpDownAction = function (e, isVirtualKeyAction) {
|
|
919
|
+
if (this.fields.disabled && this.list && this.list.querySelectorAll('.e-list-item:not(.e-disabled)').length === 0) {
|
|
920
|
+
return;
|
|
921
|
+
}
|
|
894
922
|
if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
|
|
895
923
|
var value_1 = this.getItemData().value;
|
|
896
924
|
if (isNullOrUndefined(value_1)) {
|
|
@@ -1001,6 +1029,25 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1001
1029
|
attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
|
|
1002
1030
|
}
|
|
1003
1031
|
}
|
|
1032
|
+
var itemIndex;
|
|
1033
|
+
for (var index = 0; index < this.liCollections.length; index++) {
|
|
1034
|
+
if (this.liCollections[index].classList.contains(dropDownListClasses.focus)
|
|
1035
|
+
|| this.liCollections[index].classList.contains(dropDownListClasses.selected)) {
|
|
1036
|
+
itemIndex = index;
|
|
1037
|
+
break;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
if (itemIndex != null && this.isDisabledElement(this.liCollections[itemIndex])) {
|
|
1041
|
+
if (this.getModuleName() !== 'autocomplete') {
|
|
1042
|
+
if (this.liCollections.length - 1 === itemIndex && e.action === 'down') {
|
|
1043
|
+
e.action = 'up';
|
|
1044
|
+
}
|
|
1045
|
+
if (itemIndex === 0 && e.action === 'up') {
|
|
1046
|
+
e.action = 'down';
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
this.updateUpDownAction(e);
|
|
1050
|
+
}
|
|
1004
1051
|
e.preventDefault();
|
|
1005
1052
|
};
|
|
1006
1053
|
DropDownList.prototype.updateHomeEndAction = function (e, isVirtualKeyAction) {
|
|
@@ -1101,6 +1148,9 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
1101
1148
|
DropDownList.prototype.selectCurrentItem = function (e) {
|
|
1102
1149
|
if (this.isPopupOpen) {
|
|
1103
1150
|
var li = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
1151
|
+
if (this.isDisabledElement(li)) {
|
|
1152
|
+
return;
|
|
1153
|
+
}
|
|
1104
1154
|
if (li) {
|
|
1105
1155
|
this.setSelection(li, e);
|
|
1106
1156
|
this.isTyped = false;
|
|
@@ -3362,6 +3412,10 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
3362
3412
|
this_1.setEnable();
|
|
3363
3413
|
break;
|
|
3364
3414
|
case 'text':
|
|
3415
|
+
if (this_1.fields.disabled) {
|
|
3416
|
+
newProp.text = newProp.text && !this_1.isDisabledItemByIndex(this_1.getIndexByValue(this_1.getValueByText(newProp.text)))
|
|
3417
|
+
? newProp.text : null;
|
|
3418
|
+
}
|
|
3365
3419
|
if (newProp.text === null) {
|
|
3366
3420
|
this_1.clearAll();
|
|
3367
3421
|
break;
|
|
@@ -3413,6 +3467,9 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
3413
3467
|
}
|
|
3414
3468
|
break;
|
|
3415
3469
|
case 'value':
|
|
3470
|
+
if (this_1.fields.disabled) {
|
|
3471
|
+
newProp.value = newProp.value != null && !this_1.isDisableItemValue(newProp.value) ? newProp.value : null;
|
|
3472
|
+
}
|
|
3416
3473
|
if (newProp.value === null) {
|
|
3417
3474
|
this_1.clearAll();
|
|
3418
3475
|
break;
|
|
@@ -3472,6 +3529,9 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
3472
3529
|
}
|
|
3473
3530
|
break;
|
|
3474
3531
|
case 'index':
|
|
3532
|
+
if (this_1.fields.disabled) {
|
|
3533
|
+
newProp.index = newProp.index != null && !this_1.isDisabledItemByIndex(newProp.index) ? newProp.index : null;
|
|
3534
|
+
}
|
|
3475
3535
|
if (newProp.index === null) {
|
|
3476
3536
|
this_1.clearAll();
|
|
3477
3537
|
break;
|
|
@@ -3789,6 +3849,65 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
3789
3849
|
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
3790
3850
|
}
|
|
3791
3851
|
};
|
|
3852
|
+
/**
|
|
3853
|
+
* Method to disable specific item in the popup.
|
|
3854
|
+
*
|
|
3855
|
+
* @param {string | number | object | HTMLLIElement} item - Specifies the item to be disabled.
|
|
3856
|
+
* @returns {void}
|
|
3857
|
+
|
|
3858
|
+
*/
|
|
3859
|
+
DropDownList.prototype.disableItem = function (item) {
|
|
3860
|
+
if (this.fields.disabled) {
|
|
3861
|
+
if (!this.list) {
|
|
3862
|
+
this.renderList();
|
|
3863
|
+
}
|
|
3864
|
+
var itemIndex = -1;
|
|
3865
|
+
if (this.liCollections && this.liCollections.length > 0 && this.listData && this.fields.disabled) {
|
|
3866
|
+
if (typeof (item) === 'string') {
|
|
3867
|
+
itemIndex = this.getIndexByValue(item);
|
|
3868
|
+
}
|
|
3869
|
+
else if (typeof item === 'object') {
|
|
3870
|
+
if (item instanceof HTMLLIElement) {
|
|
3871
|
+
for (var index = 0; index < this.liCollections.length; index++) {
|
|
3872
|
+
if (this.liCollections[index] === item) {
|
|
3873
|
+
itemIndex = this.getIndexByValue(item.getAttribute('data-value'));
|
|
3874
|
+
break;
|
|
3875
|
+
}
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
else {
|
|
3879
|
+
var value = JSON.parse(JSON.stringify(item))[this.fields.value];
|
|
3880
|
+
for (var index = 0; index < this.listData.length; index++) {
|
|
3881
|
+
if (JSON.parse(JSON.stringify(this.listData[index]))[this.fields.value] === value) {
|
|
3882
|
+
itemIndex = this.getIndexByValue(value);
|
|
3883
|
+
break;
|
|
3884
|
+
}
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3887
|
+
}
|
|
3888
|
+
else {
|
|
3889
|
+
itemIndex = item;
|
|
3890
|
+
}
|
|
3891
|
+
var isValidIndex = itemIndex < this.liCollections.length && itemIndex > -1;
|
|
3892
|
+
if (isValidIndex && !(JSON.parse(JSON.stringify(this.listData[itemIndex]))[this.fields.disabled])) {
|
|
3893
|
+
var li = this.liCollections[itemIndex];
|
|
3894
|
+
if (li) {
|
|
3895
|
+
this.disableListItem(li);
|
|
3896
|
+
var parsedData = JSON.parse(JSON.stringify(this.listData[itemIndex]));
|
|
3897
|
+
parsedData[this.fields.disabled] = true;
|
|
3898
|
+
this.listData[itemIndex] = parsedData;
|
|
3899
|
+
this.dataSource = this.listData;
|
|
3900
|
+
if (li.classList.contains(dropDownListClasses.focus)) {
|
|
3901
|
+
this.removeFocus();
|
|
3902
|
+
}
|
|
3903
|
+
if (li.classList.contains(dropDownListClasses.selected)) {
|
|
3904
|
+
this.clear();
|
|
3905
|
+
}
|
|
3906
|
+
}
|
|
3907
|
+
}
|
|
3908
|
+
}
|
|
3909
|
+
}
|
|
3910
|
+
};
|
|
3792
3911
|
/**
|
|
3793
3912
|
* Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
|
|
3794
3913
|
*
|
|
@@ -3838,9 +3957,6 @@ var DropDownList = /** @class */ (function (_super) {
|
|
|
3838
3957
|
delete this.hiddenElement;
|
|
3839
3958
|
this.filterInput = null;
|
|
3840
3959
|
this.keyboardModule = null;
|
|
3841
|
-
if (!isNullOrUndefined(this.ulElement)) {
|
|
3842
|
-
this.removeAllChildren(this.ulElement);
|
|
3843
|
-
}
|
|
3844
3960
|
this.ulElement = null;
|
|
3845
3961
|
this.list = null;
|
|
3846
3962
|
this.clearIconElement = null;
|