@syncfusion/ej2-dropdowns 25.2.7-130084 → 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/{ReadMe.md → README.md} +1 -1
- package/dist/ej2-dropdowns.min.js +10 -1
- package/dist/ej2-dropdowns.umd.min.js +10 -1
- package/dist/ej2-dropdowns.umd.min.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es2015.js +505 -215
- package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
- package/dist/es6/ej2-dropdowns.es5.js +498 -207
- package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
- package/dist/global/ej2-dropdowns.min.js +10 -1
- package/dist/global/ej2-dropdowns.min.js.map +1 -1
- package/dist/global/index.d.ts +9 -0
- package/package.json +80 -79
- package/src/auto-complete/auto-complete-model.d.ts +10 -10
- package/src/auto-complete/auto-complete.d.ts +12 -12
- package/src/auto-complete/auto-complete.js +3 -3
- package/src/combo-box/combo-box-model.d.ts +17 -17
- package/src/combo-box/combo-box.d.ts +27 -27
- package/src/combo-box/combo-box.js +25 -10
- 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 +21 -14
- package/src/drop-down-base/drop-down-base.d.ts +43 -17
- package/src/drop-down-base/drop-down-base.js +65 -10
- package/src/drop-down-list/drop-down-list-model.d.ts +3 -3
- package/src/drop-down-list/drop-down-list.d.ts +19 -5
- package/src/drop-down-list/drop-down-list.js +130 -5
- package/src/drop-down-tree/drop-down-tree-model.d.ts +16 -16
- package/src/drop-down-tree/drop-down-tree.d.ts +18 -14
- package/src/drop-down-tree/drop-down-tree.js +52 -38
- package/src/list-box/list-box-model.d.ts +2 -2
- package/src/list-box/list-box.d.ts +2 -2
- 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-dark.scss +1 -1
- package/styles/auto-complete/material3.css +17 -6
- package/styles/auto-complete/material3.scss +1 -1
- 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-dark.scss +1 -1
- package/styles/combo-box/material3.css +17 -6
- package/styles/combo-box/material3.scss +1 -1
- 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-dark.scss +1 -1
- package/styles/drop-down-base/material3.css +9 -2
- package/styles/drop-down-base/material3.scss +1 -1
- 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-dark.scss +1 -1
- package/styles/drop-down-list/material3.css +74 -10
- package/styles/drop-down-list/material3.scss +1 -1
- 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-dark.scss +1 -1
- package/styles/drop-down-tree/material3.css +85 -32
- package/styles/drop-down-tree/material3.scss +1 -1
- 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-dark.scss +1 -1
- package/styles/list-box/material3.css +73 -113
- package/styles/list-box/material3.scss +1 -1
- 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 +29 -9
- package/styles/material3.css +253 -266
- package/styles/material3.scss +29 -9
- 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-dark.scss +1 -1
- package/styles/mention/material3.css +25 -1
- package/styles/mention/material3.scss +1 -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-dark.scss +1 -1
- package/styles/multi-select/material3.css +109 -35
- package/styles/multi-select/material3.scss +1 -1
- 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
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DataManager,
|
|
1
|
+
import { EventHandler, Touch, isNullOrUndefined, getValue, select, Browser, debounce, ChildProperty, Property, Component, selectAll, compile, L10n, addClass, removeClass, extend, append, setStyleAttribute, prepend, rippleEffect, detach, Complex, Event, NotifyPropertyChanges, classList, closest, KeyboardEvents, attributes, isUndefined, formatUnit, Animation, getUniqueID, remove, SanitizeHtmlHelper, setValue, matches as matches$1, createElement, getComponent } from '@syncfusion/ej2-base';
|
|
2
|
+
import { DataManager, Query, DataUtil, Predicate, JsonAdaptor } from '@syncfusion/ej2-data';
|
|
3
3
|
import { ListBase, Sortable, cssClass, moveTo } from '@syncfusion/ej2-lists';
|
|
4
4
|
import { Skeleton } from '@syncfusion/ej2-notifications';
|
|
5
|
-
import {
|
|
5
|
+
import { hideSpinner, createSpinner, showSpinner, isCollide, Popup, getZindexPartial } from '@syncfusion/ej2-popups';
|
|
6
6
|
import { Input, TextBox } from '@syncfusion/ej2-inputs';
|
|
7
|
-
import {
|
|
7
|
+
import { createCheckBox, Button } from '@syncfusion/ej2-buttons';
|
|
8
8
|
import { TreeView } from '@syncfusion/ej2-navigations';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -13,7 +13,7 @@ import { TreeView } from '@syncfusion/ej2-navigations';
|
|
|
13
13
|
let queryString = '';
|
|
14
14
|
let prevString = '';
|
|
15
15
|
let tempQueryString = '';
|
|
16
|
-
let matches
|
|
16
|
+
let matches = [];
|
|
17
17
|
const activeClass = 'e-active';
|
|
18
18
|
let prevElementId = '';
|
|
19
19
|
/**
|
|
@@ -56,21 +56,21 @@ function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId,
|
|
|
56
56
|
let index;
|
|
57
57
|
queryString = ignoreCase ? queryString.toLowerCase() : queryString;
|
|
58
58
|
if (prevElementId === elementId && prevString === queryString && !refresh) {
|
|
59
|
-
for (let i = 0; i < matches
|
|
60
|
-
if (matches
|
|
59
|
+
for (let i = 0; i < matches.length; i++) {
|
|
60
|
+
if (matches[i].classList.contains(activeClass)) {
|
|
61
61
|
index = i;
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
|
-
if (currentValue && matches
|
|
64
|
+
if (currentValue && matches[i].textContent.toLowerCase() === currentValue.toLowerCase()) {
|
|
65
65
|
index = i;
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
index = index + 1;
|
|
70
70
|
if (isVirtual) {
|
|
71
|
-
return matches
|
|
71
|
+
return matches[index] && matches.length - 1 != index ? matches[index] : matches[matches.length];
|
|
72
72
|
}
|
|
73
|
-
return matches
|
|
73
|
+
return matches[index] ? matches[index] : matches[0];
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
76
|
const listItems = items;
|
|
@@ -79,7 +79,7 @@ function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId,
|
|
|
79
79
|
let item;
|
|
80
80
|
selectedIndex = selectedIndex ? selectedIndex + 1 : 0;
|
|
81
81
|
let i = selectedIndex;
|
|
82
|
-
matches
|
|
82
|
+
matches = [];
|
|
83
83
|
do {
|
|
84
84
|
if (i === listItems.length) {
|
|
85
85
|
i = -1;
|
|
@@ -93,7 +93,7 @@ function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId,
|
|
|
93
93
|
item = listItems[index];
|
|
94
94
|
text = ignoreCase ? item.innerText.toLowerCase() : item.innerText;
|
|
95
95
|
if (text.substr(0, strLength) === queryString) {
|
|
96
|
-
matches
|
|
96
|
+
matches.push(listItems[index]);
|
|
97
97
|
}
|
|
98
98
|
i++;
|
|
99
99
|
} while (i !== selectedIndex);
|
|
@@ -101,8 +101,8 @@ function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId,
|
|
|
101
101
|
prevElementId = elementId;
|
|
102
102
|
if (isVirtual) {
|
|
103
103
|
var indexUpdated = false;
|
|
104
|
-
for (let i = 0; i < matches
|
|
105
|
-
if (currentValue && matches
|
|
104
|
+
for (let i = 0; i < matches.length; i++) {
|
|
105
|
+
if (currentValue && matches[i].textContent.toLowerCase() === currentValue.toLowerCase()) {
|
|
106
106
|
index = i;
|
|
107
107
|
indexUpdated = true;
|
|
108
108
|
break;
|
|
@@ -111,9 +111,9 @@ function incrementalSearch(keyCode, items, selectedIndex, ignoreCase, elementId,
|
|
|
111
111
|
if (currentValue && indexUpdated) {
|
|
112
112
|
index = index + 1;
|
|
113
113
|
}
|
|
114
|
-
return matches
|
|
114
|
+
return matches[index] ? matches[index] : matches[0];
|
|
115
115
|
}
|
|
116
|
-
return matches
|
|
116
|
+
return matches[0];
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
@@ -171,7 +171,7 @@ function resetIncrementalSearchValues(elementId) {
|
|
|
171
171
|
prevElementId = '';
|
|
172
172
|
prevString = '';
|
|
173
173
|
queryString = '';
|
|
174
|
-
matches
|
|
174
|
+
matches = [];
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
|
|
@@ -507,6 +507,7 @@ class VirtualScroll {
|
|
|
507
507
|
this.parent.updatevirtualizationList();
|
|
508
508
|
}
|
|
509
509
|
this.parent.getSkeletonCount();
|
|
510
|
+
this.parent.skeletonCount = this.parent.totalItemCount != 0 && this.parent.totalItemCount < (this.parent.itemCount * 2) ? 0 : this.parent.skeletonCount;
|
|
510
511
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
511
512
|
const virtualTrackElement = this.parent.list.getElementsByClassName('e-virtual-ddl')[0];
|
|
512
513
|
if (virtualTrackElement) {
|
|
@@ -731,10 +732,6 @@ class VirtualScroll {
|
|
|
731
732
|
}
|
|
732
733
|
}
|
|
733
734
|
|
|
734
|
-
/**
|
|
735
|
-
* Common source
|
|
736
|
-
*/
|
|
737
|
-
|
|
738
735
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
739
736
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
740
737
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -758,6 +755,9 @@ __decorate([
|
|
|
758
755
|
__decorate([
|
|
759
756
|
Property()
|
|
760
757
|
], FieldSettings.prototype, "htmlAttributes", void 0);
|
|
758
|
+
__decorate([
|
|
759
|
+
Property()
|
|
760
|
+
], FieldSettings.prototype, "disabled", void 0);
|
|
761
761
|
const dropDownBaseClasses = {
|
|
762
762
|
root: 'e-dropdownbase',
|
|
763
763
|
rtl: 'e-rtl',
|
|
@@ -797,7 +797,6 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
797
797
|
constructor(options, element) {
|
|
798
798
|
super(options, element);
|
|
799
799
|
this.preventChange = false;
|
|
800
|
-
this.isAngular = false;
|
|
801
800
|
this.isPreventChange = false;
|
|
802
801
|
this.isDynamicDataChange = false;
|
|
803
802
|
this.addedNewItem = false;
|
|
@@ -1005,7 +1004,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1005
1004
|
}
|
|
1006
1005
|
l10nUpdate(actionFailure) {
|
|
1007
1006
|
const ele = this.getModuleName() === 'listbox' ? this.ulElement : this.list;
|
|
1008
|
-
if (this.noRecordsTemplate !== 'No records found' || this.actionFailureTemplate !== 'Request failed') {
|
|
1007
|
+
if ((!isNullOrUndefined(this.noRecordsTemplate) && this.noRecordsTemplate !== 'No records found') || this.actionFailureTemplate !== 'Request failed') {
|
|
1009
1008
|
const template = actionFailure ? this.actionFailureTemplate : this.noRecordsTemplate;
|
|
1010
1009
|
let compiledString;
|
|
1011
1010
|
const templateId = actionFailure ? this.actionFailureTemplateId : this.noRecordsTemplateId;
|
|
@@ -1167,7 +1166,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1167
1166
|
getTransformValues() {
|
|
1168
1167
|
let translateY = this.viewPortInfo.startIndex * this.listItemHeight;
|
|
1169
1168
|
translateY = translateY - (this.skeletonCount * this.listItemHeight);
|
|
1170
|
-
translateY = this.viewPortInfo.startIndex === 0 && this.listData && this.listData.length === 0 ? 0 : translateY;
|
|
1169
|
+
translateY = ((this.viewPortInfo.startIndex === 0 && this.listData && this.listData.length === 0) || this.skeletonCount === 0) ? 0 : translateY;
|
|
1171
1170
|
const styleText = `transform: translate(0px, ${translateY}px);`;
|
|
1172
1171
|
return styleText;
|
|
1173
1172
|
}
|
|
@@ -1312,17 +1311,18 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1312
1311
|
}
|
|
1313
1312
|
element.querySelectorAll('select>option');
|
|
1314
1313
|
}
|
|
1315
|
-
this.updateFields(fields.text, fields.value, this.fields.groupBy, this.fields.htmlAttributes, this.fields.iconCss);
|
|
1314
|
+
this.updateFields(fields.text, fields.value, this.fields.groupBy, this.fields.htmlAttributes, this.fields.iconCss, this.fields.disabled);
|
|
1316
1315
|
this.resetList(jsonElement, fields);
|
|
1317
1316
|
}
|
|
1318
|
-
updateFields(text, value, groupBy, htmlAttributes, iconCss) {
|
|
1317
|
+
updateFields(text, value, groupBy, htmlAttributes, iconCss, disabled) {
|
|
1319
1318
|
const field = {
|
|
1320
1319
|
'fields': {
|
|
1321
1320
|
text: text,
|
|
1322
1321
|
value: value,
|
|
1323
1322
|
groupBy: !isNullOrUndefined(groupBy) ? groupBy : this.fields && this.fields.groupBy,
|
|
1324
1323
|
htmlAttributes: !isNullOrUndefined(htmlAttributes) ? htmlAttributes : this.fields && this.fields.htmlAttributes,
|
|
1325
|
-
iconCss: !isNullOrUndefined(iconCss) ? iconCss : this.fields && this.fields.iconCss
|
|
1324
|
+
iconCss: !isNullOrUndefined(iconCss) ? iconCss : this.fields && this.fields.iconCss,
|
|
1325
|
+
disabled: !isNullOrUndefined(disabled) ? disabled : this.fields && this.fields.disabled
|
|
1326
1326
|
}
|
|
1327
1327
|
};
|
|
1328
1328
|
this.setProperties(field, true);
|
|
@@ -1690,8 +1690,16 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1690
1690
|
}
|
|
1691
1691
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1692
1692
|
postRender(listElement, list, bindEvent) {
|
|
1693
|
+
if (this.fields.disabled) {
|
|
1694
|
+
const liCollections = listElement.querySelectorAll('.' + dropDownBaseClasses.li);
|
|
1695
|
+
for (let index = 0; index < liCollections.length; index++) {
|
|
1696
|
+
if (JSON.parse(JSON.stringify(this.listData[index]))[this.fields.disabled]) {
|
|
1697
|
+
this.disableListItem(liCollections[index]);
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1693
1701
|
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
1694
|
-
const focusItem = listElement.querySelector('.' + dropDownBaseClasses.li);
|
|
1702
|
+
const focusItem = this.fields.disabled ? listElement.querySelector('.' + dropDownBaseClasses.li + ':not(.e-disabled') : listElement.querySelector('.' + dropDownBaseClasses.li);
|
|
1695
1703
|
const selectedItem = listElement.querySelector('.' + dropDownBaseClasses.selected);
|
|
1696
1704
|
if (focusItem && !selectedItem) {
|
|
1697
1705
|
focusItem.classList.add(dropDownBaseClasses.focus);
|
|
@@ -1826,9 +1834,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
1826
1834
|
break;
|
|
1827
1835
|
}
|
|
1828
1836
|
if (isDownkey) {
|
|
1829
|
-
if ((!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.selected) && this.getModuleName() !== 'autocomplete') || (!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.focus) && this.getModuleName() === 'autocomplete'))
|
|
1830
|
-
|
|
1831
|
-
}
|
|
1837
|
+
if ((!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.selected) && this.getModuleName() !== 'autocomplete') || (!isNullOrUndefined(liCollections[index]) && liCollections[index].classList.contains(dropDownBaseClasses.focus) && this.getModuleName() === 'autocomplete')) ;
|
|
1832
1838
|
}
|
|
1833
1839
|
}
|
|
1834
1840
|
else {
|
|
@@ -2039,7 +2045,13 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2039
2045
|
*/
|
|
2040
2046
|
getIndexByValue(value) {
|
|
2041
2047
|
let index;
|
|
2042
|
-
|
|
2048
|
+
let listItems = [];
|
|
2049
|
+
if (this.fields.disabled && this.getModuleName() === 'multiselect' && this.liCollections) {
|
|
2050
|
+
listItems = this.liCollections;
|
|
2051
|
+
}
|
|
2052
|
+
else {
|
|
2053
|
+
listItems = this.getItems();
|
|
2054
|
+
}
|
|
2043
2055
|
for (let i = 0; i < listItems.length; i++) {
|
|
2044
2056
|
if (!isNullOrUndefined(value) && listItems[i].getAttribute('data-value') === value.toString()) {
|
|
2045
2057
|
index = i;
|
|
@@ -2327,6 +2339,9 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2327
2339
|
this.notify('addItem', { module: 'CheckBoxSelection', item: li });
|
|
2328
2340
|
liCollections.push(li);
|
|
2329
2341
|
if (this.getModuleName() === 'listbox') {
|
|
2342
|
+
if (item.disabled) {
|
|
2343
|
+
li.classList.add('e-disabled');
|
|
2344
|
+
}
|
|
2330
2345
|
this.listData.splice(isListboxEmpty ? this.listData.length : index, 0, item);
|
|
2331
2346
|
if (this.listData.length !== this.sortedData.length) {
|
|
2332
2347
|
this.sortedData = this.listData;
|
|
@@ -2412,18 +2427,53 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2412
2427
|
}
|
|
2413
2428
|
this.addedNewItem = true;
|
|
2414
2429
|
}
|
|
2430
|
+
/**
|
|
2431
|
+
* Checks if the given HTML element is disabled.
|
|
2432
|
+
*
|
|
2433
|
+
* @param {HTMLElement} li - The HTML element to check.
|
|
2434
|
+
* @returns {boolean} - Returns true if the element is disabled, otherwise false.
|
|
2435
|
+
*/
|
|
2436
|
+
isDisabledElement(li) {
|
|
2437
|
+
if (li && li.classList.contains('e-disabled')) {
|
|
2438
|
+
return true;
|
|
2439
|
+
}
|
|
2440
|
+
return false;
|
|
2441
|
+
}
|
|
2442
|
+
/**
|
|
2443
|
+
* Checks whether the list item at the specified index is disabled.
|
|
2444
|
+
*
|
|
2445
|
+
* @param {number} index - The index of the list item to check.
|
|
2446
|
+
* @returns {boolean} True if the list item is disabled, false otherwise.
|
|
2447
|
+
*/
|
|
2448
|
+
isDisabledItemByIndex(index) {
|
|
2449
|
+
if (this.fields.disabled && this.liCollections) {
|
|
2450
|
+
return this.isDisabledElement(this.liCollections[index]);
|
|
2451
|
+
}
|
|
2452
|
+
return false;
|
|
2453
|
+
}
|
|
2454
|
+
/**
|
|
2455
|
+
* Disables the given list item.
|
|
2456
|
+
*
|
|
2457
|
+
* @param { HTMLLIElement } li - The list item to disable.
|
|
2458
|
+
* @returns {void}
|
|
2459
|
+
*/
|
|
2460
|
+
disableListItem(li) {
|
|
2461
|
+
li.classList.add('e-disabled');
|
|
2462
|
+
li.setAttribute('aria-disabled', 'true');
|
|
2463
|
+
li.setAttribute('aria-selected', 'false');
|
|
2464
|
+
}
|
|
2415
2465
|
validationAttribute(target, hidden) {
|
|
2416
2466
|
const name = target.getAttribute('name') ? target.getAttribute('name') : target.getAttribute('id');
|
|
2417
2467
|
hidden.setAttribute('name', name);
|
|
2418
2468
|
target.removeAttribute('name');
|
|
2419
|
-
const attributes
|
|
2420
|
-
for (let i = 0; i < attributes
|
|
2421
|
-
if (!target.getAttribute(attributes
|
|
2469
|
+
const attributes = ['required', 'aria-required', 'form'];
|
|
2470
|
+
for (let i = 0; i < attributes.length; i++) {
|
|
2471
|
+
if (!target.getAttribute(attributes[i])) {
|
|
2422
2472
|
continue;
|
|
2423
2473
|
}
|
|
2424
|
-
const attr = target.getAttribute(attributes
|
|
2425
|
-
hidden.setAttribute(attributes
|
|
2426
|
-
target.removeAttribute(attributes
|
|
2474
|
+
const attr = target.getAttribute(attributes[i]);
|
|
2475
|
+
hidden.setAttribute(attributes[i], attr);
|
|
2476
|
+
target.removeAttribute(attributes[i]);
|
|
2427
2477
|
}
|
|
2428
2478
|
}
|
|
2429
2479
|
setZIndex() {
|
|
@@ -2494,7 +2544,7 @@ let DropDownBase = class DropDownBase extends Component {
|
|
|
2494
2544
|
}
|
|
2495
2545
|
};
|
|
2496
2546
|
__decorate([
|
|
2497
|
-
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
2547
|
+
Complex({ text: null, value: null, iconCss: null, groupBy: null, disabled: null }, FieldSettings)
|
|
2498
2548
|
], DropDownBase.prototype, "fields", void 0);
|
|
2499
2549
|
__decorate([
|
|
2500
2550
|
Property(null)
|
|
@@ -2557,18 +2607,12 @@ DropDownBase = __decorate([
|
|
|
2557
2607
|
NotifyPropertyChanges
|
|
2558
2608
|
], DropDownBase);
|
|
2559
2609
|
|
|
2560
|
-
/**
|
|
2561
|
-
* export all modules from current location
|
|
2562
|
-
*/
|
|
2563
|
-
|
|
2564
2610
|
var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2565
2611
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2566
2612
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2567
2613
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2568
2614
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2569
2615
|
};
|
|
2570
|
-
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
2571
|
-
/// <reference path='../drop-down-base/drop-down-base-model.d.ts'/>
|
|
2572
2616
|
// don't use space in classnames
|
|
2573
2617
|
const dropDownListClasses = {
|
|
2574
2618
|
root: 'e-dropdownlist',
|
|
@@ -2627,7 +2671,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2627
2671
|
super(options, element);
|
|
2628
2672
|
this.isListSearched = false;
|
|
2629
2673
|
this.preventChange = false;
|
|
2630
|
-
this.isAngular = false;
|
|
2631
2674
|
this.isTouched = false;
|
|
2632
2675
|
this.IsScrollerAtEnd = function () {
|
|
2633
2676
|
return this.list && this.list.scrollTop + this.list.clientHeight >= this.list.scrollHeight;
|
|
@@ -2751,7 +2794,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2751
2794
|
this.removeFocus();
|
|
2752
2795
|
this.list.scrollTop = 0;
|
|
2753
2796
|
if (this.getModuleName() !== 'autocomplete' && !isNullOrUndefined(this.ulElement)) {
|
|
2754
|
-
let li = this.ulElement.querySelector('.' + dropDownListClasses.li);
|
|
2797
|
+
let li = this.fields.disabled ? this.ulElement.querySelector('.' + dropDownListClasses.li + ':not(.e-disabled)') : this.ulElement.querySelector('.' + dropDownListClasses.li);
|
|
2755
2798
|
if (this.enableVirtualization) {
|
|
2756
2799
|
li = this.liCollections[this.skeletonCount];
|
|
2757
2800
|
}
|
|
@@ -2954,7 +2997,32 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
2954
2997
|
this.updateValues();
|
|
2955
2998
|
}
|
|
2956
2999
|
}
|
|
3000
|
+
/**
|
|
3001
|
+
* Checks if the given value is disabled.
|
|
3002
|
+
*
|
|
3003
|
+
* @param { string | number | boolean | object } value - The value to check for disablement. Can be a string, number, boolean, or object.
|
|
3004
|
+
* @returns { boolean } A boolean indicating whether the value is disabled.
|
|
3005
|
+
*/
|
|
3006
|
+
isDisableItemValue(value) {
|
|
3007
|
+
if (typeof (value) === 'object') {
|
|
3008
|
+
const objectValue = JSON.parse(JSON.stringify(value))[this.fields.value];
|
|
3009
|
+
return this.isDisabledItemByIndex(this.getIndexByValue(objectValue));
|
|
3010
|
+
}
|
|
3011
|
+
return this.isDisabledItemByIndex(this.getIndexByValue(value));
|
|
3012
|
+
}
|
|
2957
3013
|
updateValues() {
|
|
3014
|
+
if (this.fields.disabled) {
|
|
3015
|
+
if (this.value != null) {
|
|
3016
|
+
this.value = !this.isDisableItemValue(this.value) ? this.value : null;
|
|
3017
|
+
}
|
|
3018
|
+
if (this.text != null) {
|
|
3019
|
+
this.text = !this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text))) ? this.text : null;
|
|
3020
|
+
}
|
|
3021
|
+
if (this.index != null) {
|
|
3022
|
+
this.index = !this.isDisabledItemByIndex(this.index) ? this.index : null;
|
|
3023
|
+
this.activeIndex = this.index;
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
2958
3026
|
this.selectedValueInfo = this.viewPortInfo;
|
|
2959
3027
|
if (!isNullOrUndefined(this.value)) {
|
|
2960
3028
|
const value = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue(((this.fields.value) ? this.fields.value : ''), this.value) : this.value;
|
|
@@ -3147,7 +3215,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3147
3215
|
const target = e.target;
|
|
3148
3216
|
this.keyboardEvent = null;
|
|
3149
3217
|
const li = closest(target, '.' + dropDownBaseClasses.li);
|
|
3150
|
-
if (!this.isValidLI(li)) {
|
|
3218
|
+
if (!this.isValidLI(li) || this.isDisabledElement(li)) {
|
|
3151
3219
|
return;
|
|
3152
3220
|
}
|
|
3153
3221
|
this.setSelection(li, e);
|
|
@@ -3291,7 +3359,14 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3291
3359
|
}
|
|
3292
3360
|
}
|
|
3293
3361
|
else {
|
|
3294
|
-
|
|
3362
|
+
let li;
|
|
3363
|
+
if (this.fields.disabled) {
|
|
3364
|
+
const enableLiCollections = this.list.querySelectorAll('.' + dropDownBaseClasses.li + ':not(.e-disabled)');
|
|
3365
|
+
li = incrementalSearch(e.charCode, enableLiCollections, this.activeIndex, true, this.element.id);
|
|
3366
|
+
}
|
|
3367
|
+
else {
|
|
3368
|
+
li = incrementalSearch(e.charCode, this.liCollections, this.activeIndex, true, this.element.id);
|
|
3369
|
+
}
|
|
3295
3370
|
if (!isNullOrUndefined(li)) {
|
|
3296
3371
|
this.setSelection(li, e);
|
|
3297
3372
|
this.setScrollPosition();
|
|
@@ -3421,6 +3496,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3421
3496
|
}
|
|
3422
3497
|
}
|
|
3423
3498
|
updateUpDownAction(e, isVirtualKeyAction) {
|
|
3499
|
+
if (this.fields.disabled && this.list && this.list.querySelectorAll('.e-list-item:not(.e-disabled)').length === 0) {
|
|
3500
|
+
return;
|
|
3501
|
+
}
|
|
3424
3502
|
if (this.allowFiltering && !this.enableVirtualization && this.getModuleName() !== 'autocomplete') {
|
|
3425
3503
|
let value = this.getItemData().value;
|
|
3426
3504
|
if (isNullOrUndefined(value)) {
|
|
@@ -3531,6 +3609,25 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3531
3609
|
attributes(this.filterInput, { 'aria-activedescendant': this.ulElement.getElementsByClassName('e-active')[0].id });
|
|
3532
3610
|
}
|
|
3533
3611
|
}
|
|
3612
|
+
let itemIndex;
|
|
3613
|
+
for (let index = 0; index < this.liCollections.length; index++) {
|
|
3614
|
+
if (this.liCollections[index].classList.contains(dropDownListClasses.focus)
|
|
3615
|
+
|| this.liCollections[index].classList.contains(dropDownListClasses.selected)) {
|
|
3616
|
+
itemIndex = index;
|
|
3617
|
+
break;
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
if (itemIndex != null && this.isDisabledElement(this.liCollections[itemIndex])) {
|
|
3621
|
+
if (this.getModuleName() !== 'autocomplete') {
|
|
3622
|
+
if (this.liCollections.length - 1 === itemIndex && e.action === 'down') {
|
|
3623
|
+
e.action = 'up';
|
|
3624
|
+
}
|
|
3625
|
+
if (itemIndex === 0 && e.action === 'up') {
|
|
3626
|
+
e.action = 'down';
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3629
|
+
this.updateUpDownAction(e);
|
|
3630
|
+
}
|
|
3534
3631
|
e.preventDefault();
|
|
3535
3632
|
}
|
|
3536
3633
|
updateHomeEndAction(e, isVirtualKeyAction) {
|
|
@@ -3631,6 +3728,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
3631
3728
|
selectCurrentItem(e) {
|
|
3632
3729
|
if (this.isPopupOpen) {
|
|
3633
3730
|
const li = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
3731
|
+
if (this.isDisabledElement(li)) {
|
|
3732
|
+
return;
|
|
3733
|
+
}
|
|
3634
3734
|
if (li) {
|
|
3635
3735
|
this.setSelection(li, e);
|
|
3636
3736
|
this.isTyped = false;
|
|
@@ -4313,7 +4413,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4313
4413
|
}
|
|
4314
4414
|
}
|
|
4315
4415
|
}
|
|
4316
|
-
let skipExists = false;
|
|
4317
4416
|
if (filterQuery && filterQuery.queries.length > 0) {
|
|
4318
4417
|
for (let queryElements = 0; queryElements < filterQuery.queries.length; queryElements++) {
|
|
4319
4418
|
if (filterQuery.queries[queryElements].fn === 'onSkip') {
|
|
@@ -4329,7 +4428,7 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
4329
4428
|
}
|
|
4330
4429
|
}
|
|
4331
4430
|
}
|
|
4332
|
-
if (
|
|
4431
|
+
if ( (this.allowFiltering || !this.isPopupOpen || !alreadySkipAdded)) {
|
|
4333
4432
|
if (querySkipValue > 0) {
|
|
4334
4433
|
filterQuery.skip(querySkipValue);
|
|
4335
4434
|
}
|
|
@@ -5219,7 +5318,6 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5219
5318
|
this.list.scrollTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.virtualListInfo.startIndex * this.listItemHeight : 0;
|
|
5220
5319
|
}
|
|
5221
5320
|
isScrollerCHanged = this.isKeyBoardAction;
|
|
5222
|
-
|
|
5223
5321
|
}
|
|
5224
5322
|
this.isKeyBoardAction = isScrollerCHanged;
|
|
5225
5323
|
if (this.enableVirtualization && this.fields.groupBy && this.fixedHeaderElement && (keyAction == "down")) {
|
|
@@ -5868,6 +5966,10 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5868
5966
|
this.setEnable();
|
|
5869
5967
|
break;
|
|
5870
5968
|
case 'text':
|
|
5969
|
+
if (this.fields.disabled) {
|
|
5970
|
+
newProp.text = newProp.text && !this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(newProp.text)))
|
|
5971
|
+
? newProp.text : null;
|
|
5972
|
+
}
|
|
5871
5973
|
if (newProp.text === null) {
|
|
5872
5974
|
this.clearAll();
|
|
5873
5975
|
break;
|
|
@@ -5919,6 +6021,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5919
6021
|
}
|
|
5920
6022
|
break;
|
|
5921
6023
|
case 'value':
|
|
6024
|
+
if (this.fields.disabled) {
|
|
6025
|
+
newProp.value = newProp.value != null && !this.isDisableItemValue(newProp.value) ? newProp.value : null;
|
|
6026
|
+
}
|
|
5922
6027
|
if (newProp.value === null) {
|
|
5923
6028
|
this.clearAll();
|
|
5924
6029
|
break;
|
|
@@ -5978,6 +6083,9 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
5978
6083
|
}
|
|
5979
6084
|
break;
|
|
5980
6085
|
case 'index':
|
|
6086
|
+
if (this.fields.disabled) {
|
|
6087
|
+
newProp.index = newProp.index != null && !this.isDisabledItemByIndex(newProp.index) ? newProp.index : null;
|
|
6088
|
+
}
|
|
5981
6089
|
if (newProp.index === null) {
|
|
5982
6090
|
this.clearAll();
|
|
5983
6091
|
break;
|
|
@@ -6287,6 +6395,65 @@ let DropDownList = class DropDownList extends DropDownBase {
|
|
|
6287
6395
|
Input.calculateWidth(this.inputElement, this.inputWrapper.container);
|
|
6288
6396
|
}
|
|
6289
6397
|
}
|
|
6398
|
+
/**
|
|
6399
|
+
* Method to disable specific item in the popup.
|
|
6400
|
+
*
|
|
6401
|
+
* @param {string | number | object | HTMLLIElement} item - Specifies the item to be disabled.
|
|
6402
|
+
* @returns {void}
|
|
6403
|
+
* @deprecated
|
|
6404
|
+
*/
|
|
6405
|
+
disableItem(item) {
|
|
6406
|
+
if (this.fields.disabled) {
|
|
6407
|
+
if (!this.list) {
|
|
6408
|
+
this.renderList();
|
|
6409
|
+
}
|
|
6410
|
+
let itemIndex = -1;
|
|
6411
|
+
if (this.liCollections && this.liCollections.length > 0 && this.listData && this.fields.disabled) {
|
|
6412
|
+
if (typeof (item) === 'string') {
|
|
6413
|
+
itemIndex = this.getIndexByValue(item);
|
|
6414
|
+
}
|
|
6415
|
+
else if (typeof item === 'object') {
|
|
6416
|
+
if (item instanceof HTMLLIElement) {
|
|
6417
|
+
for (let index = 0; index < this.liCollections.length; index++) {
|
|
6418
|
+
if (this.liCollections[index] === item) {
|
|
6419
|
+
itemIndex = this.getIndexByValue(item.getAttribute('data-value'));
|
|
6420
|
+
break;
|
|
6421
|
+
}
|
|
6422
|
+
}
|
|
6423
|
+
}
|
|
6424
|
+
else {
|
|
6425
|
+
const value = JSON.parse(JSON.stringify(item))[this.fields.value];
|
|
6426
|
+
for (let index = 0; index < this.listData.length; index++) {
|
|
6427
|
+
if (JSON.parse(JSON.stringify(this.listData[index]))[this.fields.value] === value) {
|
|
6428
|
+
itemIndex = this.getIndexByValue(value);
|
|
6429
|
+
break;
|
|
6430
|
+
}
|
|
6431
|
+
}
|
|
6432
|
+
}
|
|
6433
|
+
}
|
|
6434
|
+
else {
|
|
6435
|
+
itemIndex = item;
|
|
6436
|
+
}
|
|
6437
|
+
const isValidIndex = itemIndex < this.liCollections.length && itemIndex > -1;
|
|
6438
|
+
if (isValidIndex && !(JSON.parse(JSON.stringify(this.listData[itemIndex]))[this.fields.disabled])) {
|
|
6439
|
+
const li = this.liCollections[itemIndex];
|
|
6440
|
+
if (li) {
|
|
6441
|
+
this.disableListItem(li);
|
|
6442
|
+
const parsedData = JSON.parse(JSON.stringify(this.listData[itemIndex]));
|
|
6443
|
+
parsedData[this.fields.disabled] = true;
|
|
6444
|
+
this.listData[itemIndex] = parsedData;
|
|
6445
|
+
this.dataSource = this.listData;
|
|
6446
|
+
if (li.classList.contains(dropDownListClasses.focus)) {
|
|
6447
|
+
this.removeFocus();
|
|
6448
|
+
}
|
|
6449
|
+
if (li.classList.contains(dropDownListClasses.selected)) {
|
|
6450
|
+
this.clear();
|
|
6451
|
+
}
|
|
6452
|
+
}
|
|
6453
|
+
}
|
|
6454
|
+
}
|
|
6455
|
+
}
|
|
6456
|
+
}
|
|
6290
6457
|
/**
|
|
6291
6458
|
* Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
|
|
6292
6459
|
*
|
|
@@ -6492,10 +6659,6 @@ DropDownList = __decorate$1([
|
|
|
6492
6659
|
NotifyPropertyChanges
|
|
6493
6660
|
], DropDownList);
|
|
6494
6661
|
|
|
6495
|
-
/**
|
|
6496
|
-
* export all modules from current location
|
|
6497
|
-
*/
|
|
6498
|
-
|
|
6499
6662
|
var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
6500
6663
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6501
6664
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -6873,7 +7036,6 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6873
7036
|
if (args.text === '') {
|
|
6874
7037
|
this.isFilteredData = false;
|
|
6875
7038
|
this.isFilterRestore = true;
|
|
6876
|
-
this.isFromFilterChange = false;
|
|
6877
7039
|
fields = this.cloneFields(this.fields);
|
|
6878
7040
|
}
|
|
6879
7041
|
else if (args.preventDefaultAction) {
|
|
@@ -6924,17 +7086,17 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6924
7086
|
});
|
|
6925
7087
|
}
|
|
6926
7088
|
remoteDataFilter(value, filteredFields) {
|
|
6927
|
-
filteredFields.dataSource = this.treeData.map(item => this.remoteChildFilter(value, item)).filter(filteredChild => !isNullOrUndefined(filteredChild));
|
|
7089
|
+
filteredFields.dataSource = this.treeData.map((item) => this.remoteChildFilter(value, item)).filter((filteredChild) => !isNullOrUndefined(filteredChild));
|
|
6928
7090
|
return filteredFields;
|
|
6929
7091
|
}
|
|
6930
7092
|
remoteChildFilter(value, node, isChild, isChildFiltering) {
|
|
6931
|
-
|
|
7093
|
+
const children = this.isChildObject() ? node['child'] : node[this.fields.child];
|
|
6932
7094
|
if (isNullOrUndefined(children)) {
|
|
6933
7095
|
return (this.isMatchedNode(value, node, isChild, isChildFiltering)) ? node : null;
|
|
6934
7096
|
}
|
|
6935
|
-
|
|
7097
|
+
const matchedChildren = [];
|
|
6936
7098
|
for (let i = 0; i < children.length; i++) {
|
|
6937
|
-
|
|
7099
|
+
const filteredChild = this.remoteChildFilter(value, children[i], true, true);
|
|
6938
7100
|
if (!isNullOrUndefined(filteredChild)) {
|
|
6939
7101
|
matchedChildren.push(filteredChild);
|
|
6940
7102
|
}
|
|
@@ -6953,8 +7115,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6953
7115
|
nestedFilter(value, filteredFields) {
|
|
6954
7116
|
const matchedDataSource = [];
|
|
6955
7117
|
for (let i = 0; i < this.treeData.length; i++) {
|
|
6956
|
-
|
|
6957
|
-
const filteredChild = this.nestedChildFilter(value, this.treeData[i]);
|
|
7118
|
+
const filteredChild = this.nestedChildFilter(value, this.treeData[parseInt(i.toString(), 10)]);
|
|
6958
7119
|
if (!isNullOrUndefined(filteredChild)) {
|
|
6959
7120
|
matchedDataSource.push(filteredChild);
|
|
6960
7121
|
}
|
|
@@ -6970,13 +7131,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6970
7131
|
else {
|
|
6971
7132
|
const matchedChildren = [];
|
|
6972
7133
|
for (let i = 0; i < children.length; i++) {
|
|
6973
|
-
|
|
6974
|
-
const filteredChild = this.nestedChildFilter(value, children[i]);
|
|
7134
|
+
const filteredChild = this.nestedChildFilter(value, children[parseInt(i.toString(), 10)]);
|
|
6975
7135
|
if (!isNullOrUndefined(filteredChild)) {
|
|
6976
7136
|
matchedChildren.push(filteredChild);
|
|
6977
7137
|
}
|
|
6978
7138
|
}
|
|
6979
|
-
|
|
7139
|
+
const filteredItems = Object.assign({}, node);
|
|
6980
7140
|
if (matchedChildren.length !== 0) {
|
|
6981
7141
|
filteredItems[this.fields.child] = matchedChildren;
|
|
6982
7142
|
return filteredItems;
|
|
@@ -6998,13 +7158,11 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
6998
7158
|
for (let i = 0; i < matchedData.length; i++) {
|
|
6999
7159
|
if (matchedDataSource.indexOf(matchedData[i]) === -1) {
|
|
7000
7160
|
matchedDataSource.push(matchedData[i]);
|
|
7001
|
-
|
|
7002
|
-
let parentId = matchedData[i][this.fields.parentValue];
|
|
7161
|
+
let parentId = matchedData[parseInt(i.toString(), 10)][this.fields.parentValue];
|
|
7003
7162
|
while (!isNullOrUndefined(parentId)) {
|
|
7004
7163
|
let parent = null;
|
|
7005
7164
|
for (let j = 0; j < this.treeData.length; j++) {
|
|
7006
|
-
|
|
7007
|
-
const value = this.treeData[j][this.fields.value];
|
|
7165
|
+
const value = this.treeData[parseInt(j.toString(), 10)][this.fields.value];
|
|
7008
7166
|
if (!isNullOrUndefined(value) && (value === parentId)) {
|
|
7009
7167
|
parent = this.treeData[j];
|
|
7010
7168
|
break;
|
|
@@ -7025,7 +7183,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7025
7183
|
}
|
|
7026
7184
|
isMatchedNode(value, node, isChild, isChildFiltering) {
|
|
7027
7185
|
let checkValue;
|
|
7028
|
-
|
|
7186
|
+
const isObjectValue = isChild && isChildFiltering && this.isChildObject();
|
|
7029
7187
|
checkValue = isObjectValue ? node[this.fields.child.text] : node[this.fields.text];
|
|
7030
7188
|
if (!checkValue) {
|
|
7031
7189
|
let tempChild = this.fields.child;
|
|
@@ -7098,6 +7256,11 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7098
7256
|
if (formElement) {
|
|
7099
7257
|
EventHandler.remove(formElement, 'reset', this.resetValueHandler);
|
|
7100
7258
|
}
|
|
7259
|
+
this.keyboardModule.destroy();
|
|
7260
|
+
if (this.showSelectAll && this.checkAllParent) {
|
|
7261
|
+
EventHandler.remove(this.checkAllParent, 'mouseup', this.clickHandler);
|
|
7262
|
+
}
|
|
7263
|
+
EventHandler.remove(document, 'mousedown', this.onDocumentClick);
|
|
7101
7264
|
}
|
|
7102
7265
|
/* Trigger when the dropdown is clicked */
|
|
7103
7266
|
dropDownClick(e) {
|
|
@@ -7301,24 +7464,6 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7301
7464
|
this.selectAll(true);
|
|
7302
7465
|
}
|
|
7303
7466
|
break;
|
|
7304
|
-
case 'moveRight':
|
|
7305
|
-
case 'moveLeft':
|
|
7306
|
-
case 'shiftDown':
|
|
7307
|
-
case 'moveDown':
|
|
7308
|
-
case 'ctrlDown':
|
|
7309
|
-
case 'csDown':
|
|
7310
|
-
case 'shiftUp':
|
|
7311
|
-
case 'moveUp':
|
|
7312
|
-
case 'ctrlUp':
|
|
7313
|
-
case 'csUp':
|
|
7314
|
-
case 'home':
|
|
7315
|
-
case 'shiftHome':
|
|
7316
|
-
case 'ctrlHome':
|
|
7317
|
-
case 'csHome':
|
|
7318
|
-
case 'end':
|
|
7319
|
-
case 'shiftEnd':
|
|
7320
|
-
case 'ctrlEnd':
|
|
7321
|
-
case 'csEnd':
|
|
7322
7467
|
}
|
|
7323
7468
|
}
|
|
7324
7469
|
else {
|
|
@@ -7369,6 +7514,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7369
7514
|
cancel: false,
|
|
7370
7515
|
event: e
|
|
7371
7516
|
};
|
|
7517
|
+
let focusedElement;
|
|
7372
7518
|
this.trigger('keyPress', eventArgs, (observedArgs) => {
|
|
7373
7519
|
if (!observedArgs.cancel) {
|
|
7374
7520
|
switch (e.action) {
|
|
@@ -7376,9 +7522,10 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7376
7522
|
this.clickHandler(e);
|
|
7377
7523
|
break;
|
|
7378
7524
|
case 'moveDown':
|
|
7379
|
-
|
|
7525
|
+
focusedElement = this.treeObj.element.querySelector('li');
|
|
7380
7526
|
focusedElement.focus();
|
|
7381
7527
|
addClass([focusedElement], ['e-node-focus']);
|
|
7528
|
+
break;
|
|
7382
7529
|
}
|
|
7383
7530
|
}
|
|
7384
7531
|
});
|
|
@@ -7537,8 +7684,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7537
7684
|
return remainElement;
|
|
7538
7685
|
}
|
|
7539
7686
|
getOverflowVal(index) {
|
|
7540
|
-
|
|
7541
|
-
const selectedData = this.getSelectedData(this.value[index]);
|
|
7687
|
+
const selectedData = this.getSelectedData(this.value[parseInt(index.toString(), 10)]);
|
|
7542
7688
|
return getValue(this.treeSettings.loadOnDemand ? this.fields.text : 'text', selectedData);
|
|
7543
7689
|
}
|
|
7544
7690
|
updateDelimMode() {
|
|
@@ -7584,12 +7730,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7584
7730
|
const name = this.inputEle.getAttribute('name') ? this.inputEle.getAttribute('name') : this.inputEle.getAttribute('id');
|
|
7585
7731
|
this.hiddenElement.setAttribute('name', name);
|
|
7586
7732
|
this.inputEle.removeAttribute('name');
|
|
7587
|
-
const attributes
|
|
7588
|
-
for (let i = 0; i < attributes
|
|
7589
|
-
const attr = this.inputEle.getAttribute(attributes
|
|
7733
|
+
const attributes = ['required', 'aria-required', 'form'];
|
|
7734
|
+
for (let i = 0; i < attributes.length; i++) {
|
|
7735
|
+
const attr = this.inputEle.getAttribute(attributes[i]);
|
|
7590
7736
|
if (attr) {
|
|
7591
|
-
this.hiddenElement.setAttribute(attributes
|
|
7592
|
-
this.inputEle.removeAttribute(attributes
|
|
7737
|
+
this.hiddenElement.setAttribute(attributes[i], attr);
|
|
7738
|
+
this.inputEle.removeAttribute(attributes[i]);
|
|
7593
7739
|
}
|
|
7594
7740
|
}
|
|
7595
7741
|
}
|
|
@@ -7907,8 +8053,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7907
8053
|
let data;
|
|
7908
8054
|
if (this.treeDataType === 1) {
|
|
7909
8055
|
for (let i = 0; i < this.treeItems.length; i++) {
|
|
7910
|
-
|
|
7911
|
-
const text = getValue(this.fields.text, this.treeItems[i]);
|
|
8056
|
+
const text = getValue(this.fields.text, this.treeItems[parseInt(i.toString(), 10)]);
|
|
7912
8057
|
if (!isNullOrUndefined(this.treeItems[i]) && !isNullOrUndefined(text) && text === givenText) {
|
|
7913
8058
|
data = this.treeItems[i];
|
|
7914
8059
|
break;
|
|
@@ -7923,14 +8068,12 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7923
8068
|
getNestedItems(data, field, givenText) {
|
|
7924
8069
|
let newData;
|
|
7925
8070
|
for (let i = 0, objlen = data.length; i < objlen; i++) {
|
|
7926
|
-
|
|
7927
|
-
const dataId = getValue(this.fields.text, data[i]);
|
|
8071
|
+
const dataId = getValue(this.fields.text, data[parseInt(i.toString(), 10)]);
|
|
7928
8072
|
if (data[i] && dataId && dataId.toString() === givenText) {
|
|
7929
8073
|
return data[i];
|
|
7930
8074
|
}
|
|
7931
8075
|
else if (typeof field.child === 'string' && !isNullOrUndefined(getValue(field.child, data[i]))) {
|
|
7932
|
-
|
|
7933
|
-
const childData = getValue(field.child, data[i]);
|
|
8076
|
+
const childData = getValue(field.child, data[parseInt(i.toString(), 10)]);
|
|
7934
8077
|
newData = this.getNestedItems(childData, this.getChildType(field), givenText);
|
|
7935
8078
|
if (newData !== undefined) {
|
|
7936
8079
|
break;
|
|
@@ -7938,8 +8081,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
7938
8081
|
}
|
|
7939
8082
|
else if (this.fields.dataSource instanceof DataManager && !isNullOrUndefined(getValue('child', data[i]))) {
|
|
7940
8083
|
const child = 'child';
|
|
7941
|
-
|
|
7942
|
-
newData = this.getNestedItems(getValue(child, data[i]), this.getChildType(field), givenText);
|
|
8084
|
+
newData = this.getNestedItems(getValue(child, data[parseInt(i.toString(), 10)]), this.getChildType(field), givenText);
|
|
7943
8085
|
if (newData !== undefined) {
|
|
7944
8086
|
break;
|
|
7945
8087
|
}
|
|
@@ -8028,12 +8170,10 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8028
8170
|
this.setFooterTemplate();
|
|
8029
8171
|
}
|
|
8030
8172
|
this.isFirstRender = false;
|
|
8031
|
-
/* eslint-disable */
|
|
8032
8173
|
if (this.hasTemplate && this.portals) {
|
|
8033
8174
|
if (this.treeObj.portals) {
|
|
8034
8175
|
this.portals = this.portals.concat(this.treeObj.portals.filter((item) => !this.portals.includes(item)));
|
|
8035
8176
|
}
|
|
8036
|
-
/* eslint-enable */
|
|
8037
8177
|
if (this.isReact) {
|
|
8038
8178
|
this.renderReactTemplates(this.reactCallBack);
|
|
8039
8179
|
}
|
|
@@ -8054,9 +8194,9 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8054
8194
|
focusedElement.setAttribute('tabindex', '0');
|
|
8055
8195
|
}
|
|
8056
8196
|
else {
|
|
8057
|
-
|
|
8197
|
+
const oldFocussedNode = this.treeObj.element.querySelector('.e-node-focus');
|
|
8058
8198
|
focusedElement = this.treeObj.element.querySelector('li:not(.e-disable):not(.e-prevent)');
|
|
8059
|
-
if (oldFocussedNode && oldFocussedNode
|
|
8199
|
+
if (oldFocussedNode && oldFocussedNode !== focusedElement) {
|
|
8060
8200
|
oldFocussedNode.setAttribute('tabindex', '-1');
|
|
8061
8201
|
removeClass([oldFocussedNode], 'e-node-focus');
|
|
8062
8202
|
}
|
|
@@ -8181,8 +8321,9 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8181
8321
|
const isHeader = closest(target, '.' + HEADER);
|
|
8182
8322
|
const isFooter = closest(target, '.' + FOOTER);
|
|
8183
8323
|
const isScroller = target.classList.contains(DROPDOWN) ? true :
|
|
8184
|
-
(matches(target, '.e-ddt .e-popup') || matches(target, '.e-ddt .e-treeview'));
|
|
8185
|
-
if ((this.isPopupOpen && ((!isNullOrUndefined(this.inputWrapper) &&
|
|
8324
|
+
(matches$1(target, '.e-ddt .e-popup') || matches$1(target, '.e-ddt .e-treeview'));
|
|
8325
|
+
if ((this.isPopupOpen && ((!isNullOrUndefined(this.inputWrapper) &&
|
|
8326
|
+
this.inputWrapper.contains(target)) || isTree || isScroller || isHeader || isFooter)) ||
|
|
8186
8327
|
((this.allowMultiSelection || this.showCheckBox) && (this.isPopupOpen && target.classList.contains(CHIP_CLOSE) ||
|
|
8187
8328
|
(this.isPopupOpen && (target.classList.contains(CHECKALLPARENT) || target.classList.contains(ALLTEXT)
|
|
8188
8329
|
|| target.classList.contains(CHECKBOXFRAME)))))) {
|
|
@@ -8209,7 +8350,9 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8209
8350
|
removeClass([this.popupDiv], NODATA);
|
|
8210
8351
|
this.hideCheckAll(false);
|
|
8211
8352
|
}
|
|
8212
|
-
|
|
8353
|
+
if (!this.isFilteredData) {
|
|
8354
|
+
this.treeDataType = this.getTreeDataType(this.treeItems, this.fields);
|
|
8355
|
+
}
|
|
8213
8356
|
if (this.isFirstRender && this.isRemoteData) {
|
|
8214
8357
|
this.setTreeValue();
|
|
8215
8358
|
this.setTreeText();
|
|
@@ -8305,7 +8448,8 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8305
8448
|
dataSource: fields.dataSource, value: fields.value, text: fields.text, parentValue: fields.parentValue,
|
|
8306
8449
|
child: (fields.child ? this.cloneChildField(fields.child) : null), hasChildren: fields.hasChildren,
|
|
8307
8450
|
expanded: fields.expanded, iconCss: fields.iconCss, imageUrl: fields.imageUrl, htmlAttributes: fields.htmlAttributes,
|
|
8308
|
-
query: fields.query, selected: fields.selected, selectable: fields.selectable,
|
|
8451
|
+
query: fields.query, selected: fields.selected, selectable: fields.selectable,
|
|
8452
|
+
tableName: fields.tableName, tooltip: fields.tooltip
|
|
8309
8453
|
};
|
|
8310
8454
|
return clonedField;
|
|
8311
8455
|
}
|
|
@@ -8359,7 +8503,8 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8359
8503
|
if ((typeof field.child === 'string') && !isNullOrUndefined(getValue(field.child, this.fields.dataSource[i]))) {
|
|
8360
8504
|
return 2;
|
|
8361
8505
|
}
|
|
8362
|
-
if (!isNullOrUndefined(getValue(field.parentValue, this.fields.dataSource[i])) ||
|
|
8506
|
+
if (!isNullOrUndefined(getValue(field.parentValue, this.fields.dataSource[i])) ||
|
|
8507
|
+
!isNullOrUndefined(getValue(field.hasChildren, this.fields.dataSource[i]))) {
|
|
8363
8508
|
return 1;
|
|
8364
8509
|
}
|
|
8365
8510
|
}
|
|
@@ -8508,14 +8653,13 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8508
8653
|
this.oldValue = this.value ? this.value.slice() : this.value;
|
|
8509
8654
|
}
|
|
8510
8655
|
}
|
|
8511
|
-
onNodeExpanded(
|
|
8656
|
+
onNodeExpanded() {
|
|
8512
8657
|
if (this.hasTemplate && this.portals && this.treeObj.portals) {
|
|
8513
8658
|
for (let i = 0; i < this.treeObj.portals.length; i++) {
|
|
8514
8659
|
if (this.portals.indexOf(this.treeObj.portals[i]) === -1) {
|
|
8515
8660
|
this.portals.push(this.treeObj.portals[i]);
|
|
8516
8661
|
}
|
|
8517
8662
|
}
|
|
8518
|
-
/* eslint-enable */
|
|
8519
8663
|
this.renderReactTemplates();
|
|
8520
8664
|
}
|
|
8521
8665
|
}
|
|
@@ -8611,7 +8755,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8611
8755
|
if (!this.isFilteredData) {
|
|
8612
8756
|
this.setProperties({ value: this.isFromFilterChange && newValues && newValues.length === 0 ? this.value : newValues }, true);
|
|
8613
8757
|
this.isFromFilterChange = false;
|
|
8614
|
-
if (newValues && newValues.length !== 0 && !this.showCheckBox) {
|
|
8758
|
+
if (newValues && newValues.length !== 0 && !this.showCheckBox && !this.ddtCompareValues(this.treeObj.selectedNodes, this.value.slice())) {
|
|
8615
8759
|
this.treeObj.selectedNodes = this.value.slice();
|
|
8616
8760
|
this.treeObj.dataBind();
|
|
8617
8761
|
}
|
|
@@ -8893,7 +9037,6 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8893
9037
|
}
|
|
8894
9038
|
templateComplier(template) {
|
|
8895
9039
|
if (template) {
|
|
8896
|
-
// eslint-disable-next-line
|
|
8897
9040
|
try {
|
|
8898
9041
|
if (typeof template !== 'function' && document.querySelectorAll(template).length) {
|
|
8899
9042
|
return compile(document.querySelector(template).innerHTML.trim());
|
|
@@ -8979,7 +9122,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
8979
9122
|
this.ensurePlaceHolder();
|
|
8980
9123
|
}
|
|
8981
9124
|
resetValue(isDynamicChange) {
|
|
8982
|
-
if (this.value ===
|
|
9125
|
+
if (Array.isArray(this.value) && this.value.length === 0 && this.text == null) {
|
|
8983
9126
|
return;
|
|
8984
9127
|
}
|
|
8985
9128
|
Input.setValue(null, this.inputEle, this.floatLabelType);
|
|
@@ -9093,9 +9236,7 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
9093
9236
|
updateTemplate() {
|
|
9094
9237
|
if (this.popupObj) {
|
|
9095
9238
|
this.clearTemplate();
|
|
9096
|
-
/* eslint-disable */
|
|
9097
9239
|
this.portals = [];
|
|
9098
|
-
/* eslint-enable */
|
|
9099
9240
|
this.popupObj.destroy();
|
|
9100
9241
|
if (this.isPopupOpen) {
|
|
9101
9242
|
this.hidePopup();
|
|
@@ -9471,22 +9612,34 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
9471
9612
|
detach(this.inputWrapper);
|
|
9472
9613
|
detach(this.popupDiv);
|
|
9473
9614
|
detach(this.hiddenElement);
|
|
9615
|
+
Input.setRipple(false, [this.inputObj]);
|
|
9474
9616
|
this.element.classList.remove('e-input');
|
|
9475
9617
|
if (this.showCheckBox || this.allowMultiSelection) {
|
|
9476
9618
|
this.element.classList.remove(CHIP_INPUT);
|
|
9477
9619
|
}
|
|
9620
|
+
detach(this.inputObj.container);
|
|
9621
|
+
if (this.inputObj.buttons.length) {
|
|
9622
|
+
detach(this.inputObj.buttons[0]);
|
|
9623
|
+
}
|
|
9478
9624
|
this.inputObj = null;
|
|
9479
9625
|
while (this.hiddenElement.options.length > 0) {
|
|
9480
9626
|
this.hiddenElement.remove(0);
|
|
9481
9627
|
}
|
|
9482
9628
|
this.hiddenElement.innerHTML = '';
|
|
9483
9629
|
this.hiddenElement = null;
|
|
9630
|
+
this.inputWrapper.innerHTML = '';
|
|
9484
9631
|
this.inputWrapper = null;
|
|
9485
9632
|
this.popupDiv = null;
|
|
9486
9633
|
this.tree = null;
|
|
9487
9634
|
this.popupObj = null;
|
|
9488
9635
|
this.treeObj = null;
|
|
9489
9636
|
this.overAllClear = null;
|
|
9637
|
+
if (this.chipCollection) {
|
|
9638
|
+
const chipsIcons = selectAll('.e-chips-close', this.chipCollection);
|
|
9639
|
+
for (const element of chipsIcons) {
|
|
9640
|
+
EventHandler.remove(element, 'mousedown', this.removeChip);
|
|
9641
|
+
}
|
|
9642
|
+
}
|
|
9490
9643
|
this.chipWrapper = null;
|
|
9491
9644
|
this.chipCollection = null;
|
|
9492
9645
|
this.checkAllParent = null;
|
|
@@ -9545,7 +9698,11 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
9545
9698
|
* @returns {void}
|
|
9546
9699
|
*/
|
|
9547
9700
|
hidePopup() {
|
|
9548
|
-
const eventArgs = { popup: this.popupObj };
|
|
9701
|
+
const eventArgs = { popup: this.popupObj, cancel: false };
|
|
9702
|
+
this.trigger('close', eventArgs);
|
|
9703
|
+
if (eventArgs.cancel) {
|
|
9704
|
+
return;
|
|
9705
|
+
}
|
|
9549
9706
|
this.inputWrapper.classList.remove(ICONANIMATION);
|
|
9550
9707
|
if (this.popupEle) {
|
|
9551
9708
|
addClass([this.popupEle], DDTHIDEICON);
|
|
@@ -9559,7 +9716,6 @@ let DropDownTree = class DropDownTree extends Component {
|
|
|
9559
9716
|
addClass([this.inputWrapper], [INPUTFOCUS]);
|
|
9560
9717
|
}
|
|
9561
9718
|
}
|
|
9562
|
-
this.trigger('close', eventArgs);
|
|
9563
9719
|
if (this.destroyPopupOnHide) {
|
|
9564
9720
|
this.isFirstRender = true;
|
|
9565
9721
|
this.destroyPopup();
|
|
@@ -9758,18 +9914,12 @@ DropDownTree = __decorate$2([
|
|
|
9758
9914
|
NotifyPropertyChanges
|
|
9759
9915
|
], DropDownTree);
|
|
9760
9916
|
|
|
9761
|
-
/**
|
|
9762
|
-
* export all modules from current location
|
|
9763
|
-
*/
|
|
9764
|
-
|
|
9765
9917
|
var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
9766
9918
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
9767
9919
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9768
9920
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9769
9921
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9770
9922
|
};
|
|
9771
|
-
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
9772
|
-
/// <reference path='../drop-down-list/drop-down-list-model.d.ts'/>
|
|
9773
9923
|
const SPINNER_CLASS = 'e-atc-spinner-icon';
|
|
9774
9924
|
dropDownListClasses.root = 'e-combobox';
|
|
9775
9925
|
const inputObject$1 = {
|
|
@@ -9887,6 +10037,18 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
9887
10037
|
}
|
|
9888
10038
|
}
|
|
9889
10039
|
updateValues() {
|
|
10040
|
+
if (this.fields.disabled) {
|
|
10041
|
+
if (this.value != null) {
|
|
10042
|
+
this.value = !this.isDisableItemValue(this.value) ? this.value : null;
|
|
10043
|
+
}
|
|
10044
|
+
if (this.text != null) {
|
|
10045
|
+
this.text = !this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text))) ? this.text : null;
|
|
10046
|
+
}
|
|
10047
|
+
if (this.index != null) {
|
|
10048
|
+
this.index = !this.isDisabledItemByIndex(this.index) ? this.index : null;
|
|
10049
|
+
this.activeIndex = this.index;
|
|
10050
|
+
}
|
|
10051
|
+
}
|
|
9890
10052
|
if (!isNullOrUndefined(this.value)) {
|
|
9891
10053
|
let currentValue = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
|
|
9892
10054
|
const li = this.getElementByValue(currentValue);
|
|
@@ -10133,9 +10295,9 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
10133
10295
|
const value = this.allowObjectBinding && !isNullOrUndefined(this.value) ? getValue((this.fields.value) ? this.fields.value : '', this.value) : this.value;
|
|
10134
10296
|
this.itemData = this.getDataByValue(value);
|
|
10135
10297
|
const dataItem = this.getItemData();
|
|
10136
|
-
const setValue
|
|
10298
|
+
const setValue = this.allowObjectBinding ? this.itemData : dataItem.value;
|
|
10137
10299
|
if (!(this.allowCustom && isNullOrUndefined(dataItem.value) && isNullOrUndefined(dataItem.text))) {
|
|
10138
|
-
this.setProperties({ 'value': setValue
|
|
10300
|
+
this.setProperties({ 'value': setValue }, !this.allowCustom);
|
|
10139
10301
|
}
|
|
10140
10302
|
}
|
|
10141
10303
|
/**
|
|
@@ -10318,6 +10480,9 @@ let ComboBox = class ComboBox extends DropDownList {
|
|
|
10318
10480
|
else {
|
|
10319
10481
|
li = this.list.querySelector('.' + dropDownListClasses.focus);
|
|
10320
10482
|
}
|
|
10483
|
+
if (this.isDisabledElement(li)) {
|
|
10484
|
+
return;
|
|
10485
|
+
}
|
|
10321
10486
|
if (li) {
|
|
10322
10487
|
this.setSelection(li, e);
|
|
10323
10488
|
this.isTyped = false;
|
|
@@ -10733,18 +10898,12 @@ ComboBox = __decorate$3([
|
|
|
10733
10898
|
NotifyPropertyChanges
|
|
10734
10899
|
], ComboBox);
|
|
10735
10900
|
|
|
10736
|
-
/**
|
|
10737
|
-
* export all modules from current location
|
|
10738
|
-
*/
|
|
10739
|
-
|
|
10740
10901
|
var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
10741
10902
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10742
10903
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10743
10904
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10744
10905
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10745
10906
|
};
|
|
10746
|
-
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
10747
|
-
/// <reference path='../combo-box/combo-box-model.d.ts'/>
|
|
10748
10907
|
dropDownListClasses.root = 'e-autocomplete';
|
|
10749
10908
|
dropDownListClasses.icon = 'e-input-group-icon e-ddl-icon e-search-icon';
|
|
10750
10909
|
/**
|
|
@@ -11198,7 +11357,7 @@ let AutoComplete = class AutoComplete extends ComboBox {
|
|
|
11198
11357
|
}
|
|
11199
11358
|
};
|
|
11200
11359
|
__decorate$4([
|
|
11201
|
-
Complex({ value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
11360
|
+
Complex({ value: null, iconCss: null, groupBy: null, disabled: null }, FieldSettings)
|
|
11202
11361
|
], AutoComplete.prototype, "fields", void 0);
|
|
11203
11362
|
__decorate$4([
|
|
11204
11363
|
Property(true)
|
|
@@ -11249,10 +11408,6 @@ AutoComplete = __decorate$4([
|
|
|
11249
11408
|
NotifyPropertyChanges
|
|
11250
11409
|
], AutoComplete);
|
|
11251
11410
|
|
|
11252
|
-
/**
|
|
11253
|
-
* export all modules from current location
|
|
11254
|
-
*/
|
|
11255
|
-
|
|
11256
11411
|
/**
|
|
11257
11412
|
* FloatLable Moduel
|
|
11258
11413
|
* Specifies whether to display the floating label above the input element.
|
|
@@ -11414,8 +11569,6 @@ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
11414
11569
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
11415
11570
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11416
11571
|
};
|
|
11417
|
-
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
11418
|
-
/// <reference path='../drop-down-base/drop-down-base-model.d.ts'/>
|
|
11419
11572
|
const FOCUS = 'e-input-focus';
|
|
11420
11573
|
const DISABLED$1 = 'e-disabled';
|
|
11421
11574
|
const OVER_ALL_WRAPPER = 'e-multiselect e-input-group e-control-wrapper';
|
|
@@ -11738,13 +11891,26 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
11738
11891
|
}
|
|
11739
11892
|
else {
|
|
11740
11893
|
if (this.enableVirtualization) {
|
|
11741
|
-
|
|
11742
|
-
|
|
11894
|
+
if (this.fields.disabled) {
|
|
11895
|
+
element = this.ulElement.querySelector('li.'
|
|
11896
|
+
+ dropDownBaseClasses.li + ':not(.e-virtual-list)' + ':not(.e-hide-listitem)' + ':not(.' + DISABLED$1 + ')');
|
|
11897
|
+
}
|
|
11898
|
+
else {
|
|
11899
|
+
element = this.ulElement.querySelector('li.'
|
|
11900
|
+
+ dropDownBaseClasses.li + ':not(.e-virtual-list)' + ':not(.e-hide-listitem)');
|
|
11901
|
+
}
|
|
11743
11902
|
}
|
|
11744
11903
|
else {
|
|
11745
|
-
|
|
11746
|
-
|
|
11747
|
-
|
|
11904
|
+
if (this.fields.disabled) {
|
|
11905
|
+
element = this.ulElement.querySelector('li.'
|
|
11906
|
+
+ dropDownBaseClasses.li + ':not(.'
|
|
11907
|
+
+ HIDE_LIST + ')' + ':not(.' + DISABLED$1 + ')');
|
|
11908
|
+
}
|
|
11909
|
+
else {
|
|
11910
|
+
element = this.ulElement.querySelector('li.'
|
|
11911
|
+
+ dropDownBaseClasses.li + ':not(.'
|
|
11912
|
+
+ HIDE_LIST + ')');
|
|
11913
|
+
}
|
|
11748
11914
|
}
|
|
11749
11915
|
}
|
|
11750
11916
|
if (element !== null) {
|
|
@@ -12204,9 +12370,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
12204
12370
|
if (filterQuery.queries[queryElements].fn === 'onSkip') {
|
|
12205
12371
|
isSkip = false;
|
|
12206
12372
|
}
|
|
12207
|
-
if (filterQuery.queries[queryElements].fn === 'onTake')
|
|
12208
|
-
|
|
12209
|
-
}
|
|
12373
|
+
if (filterQuery.queries[queryElements].fn === 'onTake') ;
|
|
12210
12374
|
}
|
|
12211
12375
|
let queryTakeValue = 0;
|
|
12212
12376
|
if (filterQuery && filterQuery.queries.length > 0) {
|
|
@@ -13194,7 +13358,6 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13194
13358
|
this.list.scrollTop = this.virtualListInfo && this.virtualListInfo.startIndex ? this.virtualListInfo.startIndex * this.listItemHeight : 0;
|
|
13195
13359
|
}
|
|
13196
13360
|
isScrollerCHanged = this.isKeyBoardAction;
|
|
13197
|
-
|
|
13198
13361
|
}
|
|
13199
13362
|
this.isKeyBoardAction = isScrollerCHanged;
|
|
13200
13363
|
}
|
|
@@ -13471,6 +13634,21 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13471
13634
|
}
|
|
13472
13635
|
}
|
|
13473
13636
|
}
|
|
13637
|
+
const focusedLi = this.list ? this.list.querySelector('.e-item-focus') : null;
|
|
13638
|
+
if (this.isDisabledElement(focusedLi)) {
|
|
13639
|
+
if (this.list.querySelectorAll('.e-list-item:not(.e-hide-listitem):not(.e-disabled)').length === 0) {
|
|
13640
|
+
this.removeFocus();
|
|
13641
|
+
return;
|
|
13642
|
+
}
|
|
13643
|
+
const index = this.getIndexByValue(focusedLi.getAttribute('data-value'));
|
|
13644
|
+
if (index === 0 && this.mode !== 'CheckBox') {
|
|
13645
|
+
position = 1;
|
|
13646
|
+
}
|
|
13647
|
+
if (index === (this.list.querySelectorAll('.e-list-item:not(.e-hide-listitem)').length - 1)) {
|
|
13648
|
+
position = -1;
|
|
13649
|
+
}
|
|
13650
|
+
this.moveByList(position);
|
|
13651
|
+
}
|
|
13474
13652
|
}
|
|
13475
13653
|
getElementByValue(value) {
|
|
13476
13654
|
let item;
|
|
@@ -13659,7 +13837,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
13659
13837
|
}
|
|
13660
13838
|
this.setProperties({ value: [].concat([], removeVal) }, true);
|
|
13661
13839
|
if (this.enableVirtualization) {
|
|
13662
|
-
let currentText = index == 0 ? this.text.replace(this.text.split(this.delimiterChar)[index] + this.delimiterChar, '') : this.text.replace(this.delimiterChar + this.text.split(this.delimiterChar)[index], '');
|
|
13840
|
+
let currentText = index == 0 && this.text.split(this.delimiterChar) && this.text.split(this.delimiterChar).length == 1 ? this.text.replace(this.text.split(this.delimiterChar)[index], '') : index == 0 ? this.text.replace(this.text.split(this.delimiterChar)[index] + this.delimiterChar, '') : this.text.replace(this.delimiterChar + this.text.split(this.delimiterChar)[index], '');
|
|
13663
13841
|
this.setProperties({ text: currentText.toString() }, true);
|
|
13664
13842
|
}
|
|
13665
13843
|
if (element !== null) {
|
|
@@ -15040,7 +15218,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15040
15218
|
}
|
|
15041
15219
|
}
|
|
15042
15220
|
addListFocus(element) {
|
|
15043
|
-
if (this.enabled && this.isValidLI(element)) {
|
|
15221
|
+
if (this.enabled && (this.isValidLI(element) || (this.fields.disabled && this.isDisabledElement(element)))) {
|
|
15044
15222
|
this.removeFocus();
|
|
15045
15223
|
addClass([element], dropDownBaseClasses.focus);
|
|
15046
15224
|
this.updateAriaActiveDescendant();
|
|
@@ -15630,14 +15808,14 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
15630
15808
|
let li;
|
|
15631
15809
|
if (!isNullOrUndefined(this.list)) {
|
|
15632
15810
|
li = this.list.querySelectorAll(state ?
|
|
15633
|
-
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-virtual-list)' :
|
|
15634
|
-
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-virtual-list)');
|
|
15811
|
+
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)' :
|
|
15812
|
+
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)');
|
|
15635
15813
|
}
|
|
15636
15814
|
if (this.value && this.value.length && event && event.target
|
|
15637
15815
|
&& closest(event.target, '.e-close-hooker') && this.allowFiltering) {
|
|
15638
15816
|
li = this.mainList.querySelectorAll(state ?
|
|
15639
|
-
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-virtual-list)' :
|
|
15640
|
-
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-virtual-list)');
|
|
15817
|
+
'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)' :
|
|
15818
|
+
'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)');
|
|
15641
15819
|
}
|
|
15642
15820
|
if (this.enableGroupCheckBox && this.mode === 'CheckBox' && !isNullOrUndefined(this.fields.groupBy)) {
|
|
15643
15821
|
let target = (event ? (this.groupTemplate ? closest(event.target, '.e-list-group-item') : event.target) : null);
|
|
@@ -16080,9 +16258,16 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16080
16258
|
this.updateClearButton(newProp.showClearButton);
|
|
16081
16259
|
break;
|
|
16082
16260
|
case 'text':
|
|
16261
|
+
if (this.fields.disabled) {
|
|
16262
|
+
this.text =
|
|
16263
|
+
this.text && !this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text))) ? this.text : null;
|
|
16264
|
+
}
|
|
16083
16265
|
this.updateVal(this.value, this.value, 'text');
|
|
16084
16266
|
break;
|
|
16085
16267
|
case 'value':
|
|
16268
|
+
if (this.fields.disabled) {
|
|
16269
|
+
this.removeDisabledItemsValue(this.value);
|
|
16270
|
+
}
|
|
16086
16271
|
this.updateVal(this.value, oldProp.value, 'value');
|
|
16087
16272
|
this.addValidInputClass();
|
|
16088
16273
|
if (!this.closePopupOnSelect && this.isPopupOpen()) {
|
|
@@ -16329,7 +16514,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16329
16514
|
const animModel = {
|
|
16330
16515
|
name: 'FadeOut',
|
|
16331
16516
|
duration: 100,
|
|
16332
|
-
delay:
|
|
16517
|
+
delay: delay
|
|
16333
16518
|
};
|
|
16334
16519
|
this.customFilterQuery = null;
|
|
16335
16520
|
const eventArgs = { popup: this.popupObj, cancel: false, animation: animModel, event: e || null };
|
|
@@ -16649,7 +16834,32 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16649
16834
|
listParent.remove();
|
|
16650
16835
|
return listItemHeight;
|
|
16651
16836
|
}
|
|
16837
|
+
/**
|
|
16838
|
+
* Removes disabled values from the given array.
|
|
16839
|
+
*
|
|
16840
|
+
* @param { number[] | string[] | boolean[] | object[] } value - The array to check.
|
|
16841
|
+
* @returns {void}
|
|
16842
|
+
*/
|
|
16843
|
+
removeDisabledItemsValue(value) {
|
|
16844
|
+
if (value) {
|
|
16845
|
+
const data = [];
|
|
16846
|
+
let dataIndex = 0;
|
|
16847
|
+
for (let index = 0; index < value.length; index++) {
|
|
16848
|
+
let indexValue = value[index];
|
|
16849
|
+
if (typeof (indexValue) === 'object') {
|
|
16850
|
+
indexValue = JSON.parse(JSON.stringify(indexValue))[this.fields.value];
|
|
16851
|
+
}
|
|
16852
|
+
if ((indexValue != null) && !(this.isDisabledItemByIndex(this.getIndexByValue(indexValue)))) {
|
|
16853
|
+
data[dataIndex++] = value[index];
|
|
16854
|
+
}
|
|
16855
|
+
}
|
|
16856
|
+
this.value = data.length > 0 ? data : null;
|
|
16857
|
+
}
|
|
16858
|
+
}
|
|
16652
16859
|
checkInitialValue() {
|
|
16860
|
+
if (this.fields.disabled) {
|
|
16861
|
+
this.removeDisabledItemsValue(this.value);
|
|
16862
|
+
}
|
|
16653
16863
|
const isData = this.dataSource instanceof Array ? (this.dataSource.length > 0)
|
|
16654
16864
|
: !isNullOrUndefined(this.dataSource);
|
|
16655
16865
|
if (!(this.value && this.value.length) &&
|
|
@@ -16688,6 +16898,9 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16688
16898
|
super.render();
|
|
16689
16899
|
}
|
|
16690
16900
|
}
|
|
16901
|
+
if (this.fields.disabled) {
|
|
16902
|
+
this.text = this.text && !this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text))) ? this.text : null;
|
|
16903
|
+
}
|
|
16691
16904
|
if (!isNullOrUndefined(this.text) && (isNullOrUndefined(this.value) || this.value.length === 0)) {
|
|
16692
16905
|
this.initialTextUpdate();
|
|
16693
16906
|
}
|
|
@@ -16821,6 +17034,66 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16821
17034
|
this.refreshInputHight();
|
|
16822
17035
|
this.checkPlaceholderSize();
|
|
16823
17036
|
}
|
|
17037
|
+
/**
|
|
17038
|
+
* Method to disable specific item in the popup.
|
|
17039
|
+
*
|
|
17040
|
+
* @param {string | number | object | HTMLLIElement} item - Specifies the item to be disabled.
|
|
17041
|
+
* @returns {void}
|
|
17042
|
+
* @deprecated
|
|
17043
|
+
*/
|
|
17044
|
+
disableItem(item) {
|
|
17045
|
+
if (this.fields.disabled) {
|
|
17046
|
+
if (!this.list) {
|
|
17047
|
+
this.renderList();
|
|
17048
|
+
}
|
|
17049
|
+
let itemIndex = -1;
|
|
17050
|
+
if (this.liCollections && this.liCollections.length > 0 && this.listData && this.fields.disabled) {
|
|
17051
|
+
if (typeof (item) === 'string') {
|
|
17052
|
+
itemIndex = this.getIndexByValue(item);
|
|
17053
|
+
}
|
|
17054
|
+
else if (typeof item === 'object') {
|
|
17055
|
+
if (item instanceof HTMLLIElement) {
|
|
17056
|
+
for (let index = 0; index < this.liCollections.length; index++) {
|
|
17057
|
+
if (this.liCollections[index] === item) {
|
|
17058
|
+
itemIndex = this.getIndexByValue(item.getAttribute('data-value'));
|
|
17059
|
+
break;
|
|
17060
|
+
}
|
|
17061
|
+
}
|
|
17062
|
+
}
|
|
17063
|
+
else {
|
|
17064
|
+
const value = JSON.parse(JSON.stringify(item))[this.fields.value];
|
|
17065
|
+
for (let index = 0; index < this.listData.length; index++) {
|
|
17066
|
+
if (JSON.parse(JSON.stringify(this.listData[index]))[this.fields.value] === value) {
|
|
17067
|
+
itemIndex = this.getIndexByValue(value);
|
|
17068
|
+
break;
|
|
17069
|
+
}
|
|
17070
|
+
}
|
|
17071
|
+
}
|
|
17072
|
+
}
|
|
17073
|
+
else {
|
|
17074
|
+
itemIndex = item;
|
|
17075
|
+
}
|
|
17076
|
+
const isValidIndex = itemIndex < this.liCollections.length && itemIndex > -1;
|
|
17077
|
+
if (isValidIndex && !(JSON.parse(JSON.stringify(this.listData[itemIndex]))[this.fields.disabled])) {
|
|
17078
|
+
const li = this.liCollections[itemIndex];
|
|
17079
|
+
if (li) {
|
|
17080
|
+
this.disableListItem(li);
|
|
17081
|
+
const parsedData = JSON.parse(JSON.stringify(this.listData[itemIndex]));
|
|
17082
|
+
parsedData[this.fields.disabled] = true;
|
|
17083
|
+
this.listData[itemIndex] = parsedData;
|
|
17084
|
+
if (li.classList.contains(dropDownBaseClasses.focus)) {
|
|
17085
|
+
this.removeFocus();
|
|
17086
|
+
}
|
|
17087
|
+
if (li.classList.contains(HIDE_LIST) || li.classList.contains(dropDownBaseClasses.selected)) {
|
|
17088
|
+
const oldValue = this.value;
|
|
17089
|
+
this.removeDisabledItemsValue(this.value);
|
|
17090
|
+
this.updateVal(this.value, oldValue, 'value');
|
|
17091
|
+
}
|
|
17092
|
+
}
|
|
17093
|
+
}
|
|
17094
|
+
}
|
|
17095
|
+
}
|
|
17096
|
+
}
|
|
16824
17097
|
/**
|
|
16825
17098
|
* Removes the component from the DOM and detaches all its related event handlers. Also it removes the attributes and classes.
|
|
16826
17099
|
*
|
|
@@ -16889,7 +17162,7 @@ let MultiSelect = class MultiSelect extends DropDownBase {
|
|
|
16889
17162
|
}
|
|
16890
17163
|
};
|
|
16891
17164
|
__decorate$5([
|
|
16892
|
-
Complex({ text: null, value: null, iconCss: null, groupBy: null }, FieldSettings)
|
|
17165
|
+
Complex({ text: null, value: null, iconCss: null, groupBy: null, disabled: null }, FieldSettings)
|
|
16893
17166
|
], MultiSelect.prototype, "fields", void 0);
|
|
16894
17167
|
__decorate$5([
|
|
16895
17168
|
Property(false)
|
|
@@ -17271,12 +17544,12 @@ class CheckBoxSelection {
|
|
|
17271
17544
|
}
|
|
17272
17545
|
if (!isNullOrUndefined(this.checkWrapper)) {
|
|
17273
17546
|
const checkElement = select('.' + CHECKBOXFRAME$1, this.checkWrapper);
|
|
17274
|
-
const selectAll
|
|
17275
|
-
this.validateCheckNode(this.checkWrapper, checkElement.classList.contains(CHECK$1), args.li, args.e, selectAll
|
|
17547
|
+
const selectAll = false;
|
|
17548
|
+
this.validateCheckNode(this.checkWrapper, checkElement.classList.contains(CHECK$1), args.li, args.e, selectAll);
|
|
17276
17549
|
}
|
|
17277
17550
|
}
|
|
17278
|
-
validateCheckNode(checkWrap, isCheck, li, e, selectAll
|
|
17279
|
-
this.changeState(checkWrap, isCheck ? 'uncheck' : 'check', e, true, selectAll
|
|
17551
|
+
validateCheckNode(checkWrap, isCheck, li, e, selectAll) {
|
|
17552
|
+
this.changeState(checkWrap, isCheck ? 'uncheck' : 'check', e, true, selectAll);
|
|
17280
17553
|
}
|
|
17281
17554
|
clickHandler(e) {
|
|
17282
17555
|
let target;
|
|
@@ -17287,26 +17560,26 @@ class CheckBoxSelection {
|
|
|
17287
17560
|
target = e.currentTarget;
|
|
17288
17561
|
}
|
|
17289
17562
|
this.checkWrapper = closest(target, '.' + CHECKBOXWRAP$1);
|
|
17290
|
-
const selectAll
|
|
17563
|
+
const selectAll = true;
|
|
17291
17564
|
if (!isNullOrUndefined(this.checkWrapper)) {
|
|
17292
17565
|
const checkElement = select('.' + CHECKBOXFRAME$1, this.checkWrapper);
|
|
17293
|
-
this.validateCheckNode(this.checkWrapper, checkElement.classList.contains(CHECK$1), null, e, selectAll
|
|
17566
|
+
this.validateCheckNode(this.checkWrapper, checkElement.classList.contains(CHECK$1), null, e, selectAll);
|
|
17294
17567
|
}
|
|
17295
17568
|
e.preventDefault();
|
|
17296
17569
|
}
|
|
17297
|
-
changeState(wrapper, state, e, isPrevent, selectAll
|
|
17570
|
+
changeState(wrapper, state, e, isPrevent, selectAll) {
|
|
17298
17571
|
const frameSpan = wrapper.getElementsByClassName(CHECKBOXFRAME$1)[0];
|
|
17299
17572
|
if (state === 'check' && !frameSpan.classList.contains(CHECK$1)) {
|
|
17300
17573
|
frameSpan.classList.remove(INDETERMINATE);
|
|
17301
17574
|
frameSpan.classList.add(CHECK$1);
|
|
17302
|
-
if (selectAll
|
|
17575
|
+
if (selectAll) {
|
|
17303
17576
|
this.parent.selectAllItems(true, e);
|
|
17304
17577
|
this.setLocale(true);
|
|
17305
17578
|
}
|
|
17306
17579
|
}
|
|
17307
17580
|
else if (state === 'uncheck' && (frameSpan.classList.contains(CHECK$1) || frameSpan.classList.contains(INDETERMINATE))) {
|
|
17308
17581
|
removeClass([frameSpan], [CHECK$1, INDETERMINATE]);
|
|
17309
|
-
if (selectAll
|
|
17582
|
+
if (selectAll) {
|
|
17310
17583
|
this.parent.selectAllItems(false, e);
|
|
17311
17584
|
this.setLocale();
|
|
17312
17585
|
}
|
|
@@ -17314,7 +17587,7 @@ class CheckBoxSelection {
|
|
|
17314
17587
|
else if (state === 'indeterminate' && !(frameSpan.classList.contains(INDETERMINATE))) {
|
|
17315
17588
|
removeClass([frameSpan], [CHECK$1]);
|
|
17316
17589
|
frameSpan.classList.add(INDETERMINATE);
|
|
17317
|
-
if (selectAll
|
|
17590
|
+
if (selectAll) {
|
|
17318
17591
|
this.parent.selectAllItems(false, e);
|
|
17319
17592
|
this.setLocale();
|
|
17320
17593
|
}
|
|
@@ -17604,10 +17877,6 @@ class CheckBoxSelection {
|
|
|
17604
17877
|
}
|
|
17605
17878
|
}
|
|
17606
17879
|
|
|
17607
|
-
/**
|
|
17608
|
-
* export all modules from current location
|
|
17609
|
-
*/
|
|
17610
|
-
|
|
17611
17880
|
var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
17612
17881
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
17613
17882
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -17615,8 +17884,6 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
|
|
|
17615
17884
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17616
17885
|
};
|
|
17617
17886
|
var ListBox_1;
|
|
17618
|
-
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
17619
|
-
/// <reference path='../drop-down-base/drop-down-base-model.d.ts'/>
|
|
17620
17887
|
/**
|
|
17621
17888
|
* Defines the Selection settings of List Box.
|
|
17622
17889
|
*/
|
|
@@ -17717,6 +17984,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
17717
17984
|
const hiddenSelect = this.createElement('select', { className: 'e-hidden-select', attrs: { 'multiple': '' } });
|
|
17718
17985
|
hiddenSelect.style.visibility = 'hidden';
|
|
17719
17986
|
this.list.classList.add('e-listbox-wrapper');
|
|
17987
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17720
17988
|
this.list.querySelector('.e-list-parent').setAttribute('role', 'presentation');
|
|
17721
17989
|
const groupHdrs = this.list.querySelectorAll('.e-list-group-item');
|
|
17722
17990
|
for (let i = 0; i < groupHdrs.length; i++) {
|
|
@@ -17735,7 +18003,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
17735
18003
|
}
|
|
17736
18004
|
}
|
|
17737
18005
|
else {
|
|
17738
|
-
if (this.initLoad) {
|
|
18006
|
+
if (this.initLoad && this.element.parentElement) {
|
|
17739
18007
|
this.element.parentElement.insertBefore(this.list, this.element);
|
|
17740
18008
|
}
|
|
17741
18009
|
this.list.insertBefore(this.element, this.list.firstChild);
|
|
@@ -17802,6 +18070,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
17802
18070
|
initToolbar() {
|
|
17803
18071
|
const pos = this.toolbarSettings.position;
|
|
17804
18072
|
const prevScope = this.element.getAttribute('data-value');
|
|
18073
|
+
this.toolbarSettings.items = isNullOrUndefined(this.toolbarSettings.items) ? [] : this.toolbarSettings.items;
|
|
17805
18074
|
if (this.toolbarSettings.items.length) {
|
|
17806
18075
|
const toolElem = this.createElement('div', { className: 'e-listbox-tool', attrs: { 'role': 'toolbar' } });
|
|
17807
18076
|
const wrapper = this.createElement('div', {
|
|
@@ -17895,7 +18164,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
17895
18164
|
this.spinner = this.createElement('div', { className: 'e-listbox-wrapper' });
|
|
17896
18165
|
}
|
|
17897
18166
|
this.spinner.style.height = formatUnit(this.height);
|
|
17898
|
-
this.element.parentElement
|
|
18167
|
+
if (this.element.parentElement) {
|
|
18168
|
+
this.element.parentElement.insertBefore(this.spinner, this.element.nextSibling);
|
|
18169
|
+
}
|
|
17899
18170
|
createSpinner({ target: this.spinner }, this.createElement);
|
|
17900
18171
|
showSpinner(this.spinner);
|
|
17901
18172
|
}
|
|
@@ -17955,7 +18226,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
17955
18226
|
this.list.insertBefore(searchEle, this.list.firstElementChild);
|
|
17956
18227
|
this.filterParent = this.list.getElementsByClassName('e-filter-parent')[0];
|
|
17957
18228
|
this.filterWireEvents(searchEle);
|
|
17958
|
-
|
|
18229
|
+
const inputSearch = searchEle.querySelector('.e-input-filter');
|
|
17959
18230
|
if (inputSearch) {
|
|
17960
18231
|
inputSearch.addEventListener('focus', function () {
|
|
17961
18232
|
if (!searchEle.childNodes[0].classList.contains('e-input-focus')) {
|
|
@@ -18093,7 +18364,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
18093
18364
|
}
|
|
18094
18365
|
beforeDragEnd(args) {
|
|
18095
18366
|
this.stopTimer();
|
|
18096
|
-
|
|
18367
|
+
const items = [];
|
|
18097
18368
|
this.dragValue = this.getFormattedValue(args.droppedElement.getAttribute('data-value'));
|
|
18098
18369
|
if (this.value.indexOf(this.dragValue) > -1) {
|
|
18099
18370
|
args.items = this.getDataByValues(this.value);
|
|
@@ -18198,7 +18469,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
18198
18469
|
}
|
|
18199
18470
|
const fListData = [].slice.call(this.listData);
|
|
18200
18471
|
const fSortData = [].slice.call(this.sortedData);
|
|
18201
|
-
selectedOptions.forEach((value
|
|
18472
|
+
selectedOptions.forEach((value) => {
|
|
18202
18473
|
droppedData = this.getDataByValue(value);
|
|
18203
18474
|
const srcIdx = this.listData.indexOf(droppedData);
|
|
18204
18475
|
const jsonSrcIdx = this.jsonData.indexOf(droppedData);
|
|
@@ -18381,7 +18652,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
18381
18652
|
}
|
|
18382
18653
|
this.setSelection(items, state, !isValue);
|
|
18383
18654
|
this.updateSelectedOptions();
|
|
18384
|
-
|
|
18655
|
+
const selElems = [];
|
|
18385
18656
|
for (let i = 0; i < items.length; i++) {
|
|
18386
18657
|
const liColl = this.list.querySelectorAll('[aria-selected="true"]');
|
|
18387
18658
|
for (let j = 0; j < liColl.length; j++) {
|
|
@@ -18736,6 +19007,10 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
18736
19007
|
}
|
|
18737
19008
|
}
|
|
18738
19009
|
clickHandler(e) {
|
|
19010
|
+
const li = closest(e.target, '.' + 'e-list-item');
|
|
19011
|
+
if (isNullOrUndefined(li)) {
|
|
19012
|
+
return;
|
|
19013
|
+
}
|
|
18739
19014
|
this.selectHandler(e);
|
|
18740
19015
|
}
|
|
18741
19016
|
checkSelectAll() {
|
|
@@ -19223,6 +19498,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
19223
19498
|
}
|
|
19224
19499
|
for (let i = 0; i < fListBox.ulElement.childElementCount; i++) {
|
|
19225
19500
|
if (fListBox.ulElement.childNodes[i].classList.contains('e-disabled')) {
|
|
19501
|
+
// eslint-disable-next-line @typescript-eslint/tslint/config
|
|
19226
19502
|
flistboxarray = flistboxarray.filter(function (item) { return item !== i; });
|
|
19227
19503
|
tempLiColl.push(fListBox.ulElement.childNodes[i]);
|
|
19228
19504
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -19548,10 +19824,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
19548
19824
|
}
|
|
19549
19825
|
dataUpdater(dataSource, query, fields) {
|
|
19550
19826
|
this.isDataFetched = false;
|
|
19551
|
-
const backCommand = true;
|
|
19552
19827
|
if (this.targetElement().trim() === '') {
|
|
19553
19828
|
let list = this.mainList.cloneNode ? this.mainList.cloneNode(true) : this.mainList;
|
|
19554
|
-
|
|
19829
|
+
{
|
|
19555
19830
|
this.remoteCustomValue = false;
|
|
19556
19831
|
if (this.isAngular && this.itemTemplate) {
|
|
19557
19832
|
list = this.renderItems(this.listData, fields);
|
|
@@ -19635,7 +19910,9 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
19635
19910
|
});
|
|
19636
19911
|
}
|
|
19637
19912
|
}
|
|
19638
|
-
setSelection(
|
|
19913
|
+
setSelection(
|
|
19914
|
+
// eslint-disable-next-line max-len
|
|
19915
|
+
values = this.value, isSelect = true, isText = false, canFocus = true) {
|
|
19639
19916
|
let li;
|
|
19640
19917
|
let liselect;
|
|
19641
19918
|
if (values) {
|
|
@@ -19655,21 +19932,21 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
19655
19932
|
li = this.list.querySelector('[data-value="' + text + '"]');
|
|
19656
19933
|
}
|
|
19657
19934
|
if (li) {
|
|
19658
|
-
if (this.selectionSettings.showCheckbox) {
|
|
19935
|
+
if (this.selectionSettings.showCheckbox && !li.classList.contains('e-disabled')) {
|
|
19659
19936
|
liselect = li.getElementsByClassName('e-frame')[0].classList.contains('e-check');
|
|
19660
19937
|
}
|
|
19661
19938
|
else {
|
|
19662
19939
|
liselect = li.classList.contains('e-selected');
|
|
19663
19940
|
}
|
|
19664
19941
|
if (!isSelect && liselect || isSelect && !liselect && li) {
|
|
19665
|
-
if (this.selectionSettings.showCheckbox) {
|
|
19942
|
+
if (this.selectionSettings.showCheckbox && !li.classList.contains('e-disabled')) {
|
|
19666
19943
|
this.notify('updatelist', { li: li, module: 'listbox' });
|
|
19667
19944
|
if (canFocus) {
|
|
19668
19945
|
li.focus();
|
|
19669
19946
|
}
|
|
19670
19947
|
}
|
|
19671
19948
|
else {
|
|
19672
|
-
if (isSelect) {
|
|
19949
|
+
if (isSelect && !li.classList.contains('e-disabled')) {
|
|
19673
19950
|
li.classList.add(cssClass.selected);
|
|
19674
19951
|
li.setAttribute('aria-selected', 'true');
|
|
19675
19952
|
if (canFocus) {
|
|
@@ -19703,7 +19980,17 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
19703
19980
|
this.checkSelectAll();
|
|
19704
19981
|
}
|
|
19705
19982
|
checkDisabledState(inst) {
|
|
19706
|
-
|
|
19983
|
+
if (isNullOrUndefined(inst.ulElement)) {
|
|
19984
|
+
if (!isNullOrUndefined(this.dataSource) && isNullOrUndefined(this.dataSource.length)) {
|
|
19985
|
+
return false;
|
|
19986
|
+
}
|
|
19987
|
+
else {
|
|
19988
|
+
return true;
|
|
19989
|
+
}
|
|
19990
|
+
}
|
|
19991
|
+
else {
|
|
19992
|
+
return inst.ulElement.querySelectorAll('.' + cssClass.li).length === 0;
|
|
19993
|
+
}
|
|
19707
19994
|
}
|
|
19708
19995
|
updateToolBarState() {
|
|
19709
19996
|
if (this.toolbarSettings.items.length) {
|
|
@@ -19939,6 +20226,7 @@ let ListBox = ListBox_1 = class ListBox extends DropDownBase {
|
|
|
19939
20226
|
}
|
|
19940
20227
|
}
|
|
19941
20228
|
if (newProp.toolbarSettings.items) {
|
|
20229
|
+
oldProp.toolbarSettings.items = isNullOrUndefined(oldProp.toolbarSettings.items) ? [] : oldProp.toolbarSettings.items;
|
|
19942
20230
|
if (oldProp.toolbarSettings && oldProp.toolbarSettings.items.length) {
|
|
19943
20231
|
ele = this.list.parentElement;
|
|
19944
20232
|
ele.parentElement.insertBefore(this.list, ele);
|
|
@@ -20073,10 +20361,6 @@ const listBoxClasses = {
|
|
|
20073
20361
|
clearIcon: 'e-clear-icon'
|
|
20074
20362
|
};
|
|
20075
20363
|
|
|
20076
|
-
/**
|
|
20077
|
-
* export all modules from current location
|
|
20078
|
-
*/
|
|
20079
|
-
|
|
20080
20364
|
var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
20081
20365
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20082
20366
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -20143,12 +20427,12 @@ let Mention = class Mention extends DropDownBase {
|
|
|
20143
20427
|
this.setCssClass(newClass, [this.popupObj.element], oldClass);
|
|
20144
20428
|
}
|
|
20145
20429
|
}
|
|
20146
|
-
setCssClass(cssClass
|
|
20430
|
+
setCssClass(cssClass, elements, oldClass) {
|
|
20147
20431
|
if (!isNullOrUndefined(oldClass) && oldClass !== '') {
|
|
20148
20432
|
removeClass(elements, oldClass.split(' '));
|
|
20149
20433
|
}
|
|
20150
|
-
if (!isNullOrUndefined(cssClass
|
|
20151
|
-
addClass(elements, cssClass
|
|
20434
|
+
if (!isNullOrUndefined(cssClass) && cssClass !== '') {
|
|
20435
|
+
addClass(elements, cssClass.split(' '));
|
|
20152
20436
|
}
|
|
20153
20437
|
}
|
|
20154
20438
|
initializeData() {
|
|
@@ -20353,6 +20637,9 @@ let Mention = class Mention extends DropDownBase {
|
|
|
20353
20637
|
}
|
|
20354
20638
|
}
|
|
20355
20639
|
updateUpDownAction(e) {
|
|
20640
|
+
if (this.fields.disabled && this.list && this.list.querySelectorAll('.e-list-item:not(.e-disabled)').length === 0) {
|
|
20641
|
+
return;
|
|
20642
|
+
}
|
|
20356
20643
|
const focusEle = this.list.querySelector('.' + dropDownBaseClasses.focus);
|
|
20357
20644
|
if (this.isSelectFocusItem(focusEle)) {
|
|
20358
20645
|
this.setSelection(focusEle, e);
|
|
@@ -20373,6 +20660,17 @@ let Mention = class Mention extends DropDownBase {
|
|
|
20373
20660
|
this.setSelection(nextItem, e);
|
|
20374
20661
|
}
|
|
20375
20662
|
}
|
|
20663
|
+
let itemIndex;
|
|
20664
|
+
for (let index = 0; index < this.liCollections.length; index++) {
|
|
20665
|
+
if (this.liCollections[index].classList.contains(dropDownBaseClasses.focus)
|
|
20666
|
+
|| this.liCollections[index].classList.contains(dropDownBaseClasses.selected)) {
|
|
20667
|
+
itemIndex = index;
|
|
20668
|
+
break;
|
|
20669
|
+
}
|
|
20670
|
+
}
|
|
20671
|
+
if (itemIndex != null && this.isDisabledElement(this.liCollections[itemIndex])) {
|
|
20672
|
+
this.updateUpDownAction(e);
|
|
20673
|
+
}
|
|
20376
20674
|
if (this.isPopupOpen) {
|
|
20377
20675
|
e.preventDefault();
|
|
20378
20676
|
}
|
|
@@ -20547,7 +20845,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
20547
20845
|
if (!isNullOrUndefined(ulElement)) {
|
|
20548
20846
|
attributes(ulElement, { 'id': this.inputElement.id + '_options', 'role': 'listbox', 'aria-hidden': 'false' });
|
|
20549
20847
|
}
|
|
20550
|
-
let focusItem = ulElement.querySelector('.' + dropDownBaseClasses.li);
|
|
20848
|
+
let focusItem = this.fields.disabled ? ulElement.querySelector('.' + dropDownBaseClasses.li + ':not(.e-disabled)') : ulElement.querySelector('.' + dropDownBaseClasses.li);
|
|
20551
20849
|
if (focusItem) {
|
|
20552
20850
|
focusItem.classList.add(dropDownBaseClasses.selected);
|
|
20553
20851
|
this.selectedLI = focusItem;
|
|
@@ -20773,10 +21071,10 @@ let Mention = class Mention extends DropDownBase {
|
|
|
20773
21071
|
}
|
|
20774
21072
|
}
|
|
20775
21073
|
append([this.list], popupEle);
|
|
20776
|
-
if (this.inputElement.parentElement
|
|
20777
|
-
this.inputElement.parentElement.
|
|
20778
|
-
if (popupEle.firstElementChild && popupEle.firstElementChild.childElementCount > 0) {
|
|
20779
|
-
popupEle.firstElementChild.setAttribute('aria-owns',
|
|
21074
|
+
if (this.inputElement.parentElement) {
|
|
21075
|
+
const rteRootElement = this.inputElement.parentElement.closest('.e-richtexteditor');
|
|
21076
|
+
if (rteRootElement && popupEle.firstElementChild && popupEle.firstElementChild.childElementCount > 0) {
|
|
21077
|
+
popupEle.firstElementChild.setAttribute('aria-owns', rteRootElement.id);
|
|
20780
21078
|
addClass([popupEle], 'e-rte-elements');
|
|
20781
21079
|
}
|
|
20782
21080
|
}
|
|
@@ -21078,7 +21376,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
21078
21376
|
onMouseClick(e) {
|
|
21079
21377
|
const target = e.target;
|
|
21080
21378
|
const li = closest(target, '.' + dropDownBaseClasses.li);
|
|
21081
|
-
if (!this.isValidLI(li)) {
|
|
21379
|
+
if (!this.isValidLI(li) || this.isDisabledElement(li)) {
|
|
21082
21380
|
return;
|
|
21083
21381
|
}
|
|
21084
21382
|
this.isSelected = true;
|
|
@@ -21308,6 +21606,7 @@ let Mention = class Mention extends DropDownBase {
|
|
|
21308
21606
|
}
|
|
21309
21607
|
this.isTyped = false;
|
|
21310
21608
|
range.deleteContents();
|
|
21609
|
+
range.startContainer.parentElement.normalize();
|
|
21311
21610
|
const element = this.createElement('div');
|
|
21312
21611
|
element.innerHTML = value;
|
|
21313
21612
|
const frag = document.createDocumentFragment();
|
|
@@ -21333,7 +21632,6 @@ let Mention = class Mention extends DropDownBase {
|
|
|
21333
21632
|
const event = new CustomEvent('content-changed', { detail: { click: true } });
|
|
21334
21633
|
this.inputElement.dispatchEvent(event);
|
|
21335
21634
|
}
|
|
21336
|
-
|
|
21337
21635
|
this.onChangeEvent(e);
|
|
21338
21636
|
}
|
|
21339
21637
|
}
|
|
@@ -21344,10 +21642,10 @@ let Mention = class Mention extends DropDownBase {
|
|
|
21344
21642
|
}
|
|
21345
21643
|
if (this.isContentEditable(this.inputElement)) {
|
|
21346
21644
|
if (Browser.isAndroid) {
|
|
21347
|
-
return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '
|
|
21645
|
+
return '<span contenteditable="true" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '');
|
|
21348
21646
|
}
|
|
21349
21647
|
else {
|
|
21350
|
-
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '
|
|
21648
|
+
return '<span contenteditable="false" class="e-mention-chip">' + showChar + value + '</span>'.concat(typeof this.suffixText === 'string' ? this.suffixText : '');
|
|
21351
21649
|
}
|
|
21352
21650
|
}
|
|
21353
21651
|
else {
|
|
@@ -21701,13 +21999,5 @@ Mention = __decorate$7([
|
|
|
21701
21999
|
NotifyPropertyChanges
|
|
21702
22000
|
], Mention);
|
|
21703
22001
|
|
|
21704
|
-
|
|
21705
|
-
* export all modules from current location
|
|
21706
|
-
*/
|
|
21707
|
-
|
|
21708
|
-
/**
|
|
21709
|
-
* export all modules from current location
|
|
21710
|
-
*/
|
|
21711
|
-
|
|
21712
|
-
export { incrementalSearch, Search, escapeCharRegExp, resetIncrementalSearchValues, highlightSearch, revertHighlightSearch, VirtualScroll, FieldSettings, dropDownBaseClasses, DropDownBase, dropDownListClasses, DropDownList, Fields, TreeSettings, DropDownTree, ComboBox, AutoComplete, MultiSelect, CheckBoxSelection, createFloatLabel, updateFloatLabelState, removeFloating, setPlaceHolder, floatLabelFocus, floatLabelBlur, encodePlaceholder, SelectionSettings, ToolbarSettings, ListBox, Mention };
|
|
22002
|
+
export { AutoComplete, CheckBoxSelection, ComboBox, DropDownBase, DropDownList, DropDownTree, FieldSettings, Fields, ListBox, Mention, MultiSelect, Search, SelectionSettings, ToolbarSettings, TreeSettings, VirtualScroll, createFloatLabel, dropDownBaseClasses, dropDownListClasses, encodePlaceholder, escapeCharRegExp, floatLabelBlur, floatLabelFocus, highlightSearch, incrementalSearch, removeFloating, resetIncrementalSearchValues, revertHighlightSearch, setPlaceHolder, updateFloatLabelState };
|
|
21713
22003
|
//# sourceMappingURL=ej2-dropdowns.es2015.js.map
|