@progress/kendo-react-dropdowns 9.2.0-develop.2 → 9.2.0-develop.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoComplete/AutoComplete.js +2 -2
- package/AutoComplete/AutoComplete.mjs +282 -219
- package/ComboBox/ComboBox.js +2 -2
- package/ComboBox/ComboBox.mjs +38 -39
- package/DropDownList/DropDownList.js +2 -2
- package/DropDownList/DropDownList.mjs +116 -117
- package/DropDownTree/DropDownTree.js +2 -2
- package/DropDownTree/DropDownTree.mjs +67 -68
- package/DropDownTree/ListNoData.js +1 -1
- package/DropDownTree/ListNoData.mjs +1 -1
- package/DropDownTree/useDropdownWidth.js +1 -1
- package/DropDownTree/useDropdownWidth.mjs +1 -1
- package/LICENSE.md +1 -1
- package/MultiColumnComboBox/MultiColumnComboBox.js +1 -1
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +1 -1
- package/MultiSelect/MultiSelect.js +2 -2
- package/MultiSelect/MultiSelect.mjs +42 -43
- package/MultiSelect/TagList.js +1 -1
- package/MultiSelect/TagList.mjs +1 -1
- package/MultiSelectTree/MultiSelectTree.js +2 -2
- package/MultiSelectTree/MultiSelectTree.mjs +65 -66
- package/MultiSelectTree/utils.js +1 -1
- package/MultiSelectTree/utils.mjs +1 -1
- package/README.md +1 -1
- package/common/AdaptiveMode.js +2 -2
- package/common/AdaptiveMode.mjs +44 -42
- package/common/ClearButton.js +1 -1
- package/common/ClearButton.mjs +1 -1
- package/common/DropDownBase.js +1 -1
- package/common/DropDownBase.mjs +1 -1
- package/common/GroupStickyHeader.js +1 -1
- package/common/GroupStickyHeader.mjs +1 -1
- package/common/List.js +1 -1
- package/common/List.mjs +1 -1
- package/common/ListContainer.js +1 -1
- package/common/ListContainer.mjs +1 -1
- package/common/ListDefaultItem.js +1 -1
- package/common/ListDefaultItem.mjs +1 -1
- package/common/ListFilter.js +1 -1
- package/common/ListFilter.mjs +1 -1
- package/common/ListGroupItem.js +1 -1
- package/common/ListGroupItem.mjs +1 -1
- package/common/ListItem.js +1 -1
- package/common/ListItem.mjs +1 -1
- package/common/MultiColumnList.js +1 -1
- package/common/MultiColumnList.mjs +1 -1
- package/common/Navigation.js +1 -1
- package/common/Navigation.mjs +1 -1
- package/common/SearchBar.js +1 -1
- package/common/SearchBar.mjs +1 -1
- package/common/VirtualScrollStatic.js +1 -1
- package/common/VirtualScrollStatic.mjs +1 -1
- package/common/settings.js +1 -1
- package/common/settings.mjs +1 -1
- package/common/utils.js +1 -1
- package/common/utils.mjs +1 -1
- package/common/withCustomComponent.js +1 -1
- package/common/withCustomComponent.mjs +1 -1
- package/dist/cdn/js/kendo-react-dropdowns.js +2 -2
- package/index.d.mts +31 -2
- package/index.d.ts +31 -2
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/messages/index.js +1 -1
- package/messages/index.mjs +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +9 -9
- package/common/constants.js +0 -8
- package/common/constants.mjs +0 -13
|
@@ -1,39 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright ©
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as i from "react";
|
|
10
10
|
import k from "prop-types";
|
|
11
|
-
import { validatePackage as Yt, useUnstyled as $t, useId as jt, usePropsContext as Jt, canUseDOM as tt, classNames as C, uDropDownList as
|
|
11
|
+
import { validatePackage as Yt, useUnstyled as $t, useId as jt, usePropsContext as Jt, canUseDOM as tt, classNames as C, uDropDownList as P, getTabIndex as Qt, IconWrap as Xt, svgIconPropType as Zt, createPropsContext as Rt, Keys as w, ADAPTIVE_SMALL_BREAKPOINT as nt, uDropDownsActionSheet as J, ADAPTIVE_MEDIUM_BREAKPOINT as rt } from "@progress/kendo-react-common";
|
|
12
12
|
import { FloatingLabel as en } from "@progress/kendo-react-labels";
|
|
13
13
|
import { caretAltDownIcon as tn, xIcon as nn } from "@progress/kendo-svg-icons";
|
|
14
14
|
import rn from "../common/ListContainer.mjs";
|
|
15
15
|
import on from "../common/ListFilter.mjs";
|
|
16
|
-
import
|
|
16
|
+
import ot from "../common/GroupStickyHeader.mjs";
|
|
17
17
|
import an from "../common/ListDefaultItem.mjs";
|
|
18
18
|
import sn from "../common/List.mjs";
|
|
19
19
|
import dt from "../common/DropDownBase.mjs";
|
|
20
|
-
import { getFilteredData as
|
|
20
|
+
import { getFilteredData as M, areSame as N, getItemValue as fe, isPresent as it, itemIndexStartsWith as ln, sameCharsOnly as dn, shuffleData as cn, matchText as at } from "../common/utils.mjs";
|
|
21
21
|
import { packageMetadata as un } from "../package-metadata.mjs";
|
|
22
|
-
import { Button as
|
|
22
|
+
import { Button as st } from "@progress/kendo-react-buttons";
|
|
23
23
|
import { useLocalization as pn } from "@progress/kendo-react-intl";
|
|
24
|
-
import { dropDownListArrowBtnAriaLabel as
|
|
25
|
-
import { MOBILE_SMALL_DEVISE as st, MOBILE_MEDIUM_DEVISE as lt } from "../common/constants.mjs";
|
|
24
|
+
import { dropDownListArrowBtnAriaLabel as lt, messages as mn } from "../messages/index.mjs";
|
|
26
25
|
import { ActionSheet as fn, ActionSheetHeader as gn, ActionSheetContent as vn } from "@progress/kendo-react-layout";
|
|
27
26
|
const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) => {
|
|
28
27
|
Yt(un);
|
|
29
28
|
const F = $t(), ge = jt(E.id), r = Jt(hn, E), {
|
|
30
|
-
delay: ut =
|
|
31
|
-
tabIndex: pt =
|
|
32
|
-
ignoreCase: ve =
|
|
33
|
-
size: Q =
|
|
34
|
-
rounded: Fe =
|
|
35
|
-
fillMode: Ie =
|
|
36
|
-
groupMode: wn =
|
|
29
|
+
delay: ut = A.delay,
|
|
30
|
+
tabIndex: pt = A.tabIndex,
|
|
31
|
+
ignoreCase: ve = A.ignoreCase,
|
|
32
|
+
size: Q = A.size,
|
|
33
|
+
rounded: Fe = A.rounded,
|
|
34
|
+
fillMode: Ie = A.fillMode,
|
|
35
|
+
groupMode: wn = A.groupMode
|
|
37
36
|
} = r, he = () => {
|
|
38
37
|
if (tt)
|
|
39
38
|
return q.current && q.current.ownerDocument || window.document;
|
|
@@ -42,20 +41,20 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
42
41
|
(e = t == null ? void 0 : t.current) != null && e.wrapper && ((n = t == null ? void 0 : t.current) == null || n.wrapper.focus({ preventScroll: !0 }));
|
|
43
42
|
}, L = () => {
|
|
44
43
|
let e;
|
|
45
|
-
return V.current !== void 0 && V.current !== null ? e = V.current : r.value !== void 0 ? e = r.value : m.value !== void 0 && m.value !== null ? e = m.value : r.defaultValue !== void 0 && r.defaultValue !== null && (e = r.defaultValue), !
|
|
44
|
+
return V.current !== void 0 && V.current !== null ? e = V.current : r.value !== void 0 ? e = r.value : m.value !== void 0 && m.value !== null ? e = m.value : r.defaultValue !== void 0 && r.defaultValue !== null && (e = r.defaultValue), !it(e) && r.defaultItem !== void 0 && r.defaultItem !== null && (e = r.defaultItem), e;
|
|
46
45
|
}, ft = () => {
|
|
47
|
-
const { dataItemKey: e } = r, n =
|
|
46
|
+
const { dataItemKey: e } = r, n = M(E), a = L();
|
|
48
47
|
return n.findIndex((c) => N(c, a, e));
|
|
49
|
-
}, we = () => r.required !== void 0 ? r.required :
|
|
48
|
+
}, we = () => r.required !== void 0 ? r.required : A.required, ye = () => {
|
|
50
49
|
const e = r.validationMessage !== void 0, n = L(), a = !we() || n !== null && n !== "" && n !== void 0, c = r.valid !== void 0 ? r.valid : a;
|
|
51
50
|
return {
|
|
52
51
|
customError: e,
|
|
53
52
|
valid: c,
|
|
54
53
|
valueMissing: n === null
|
|
55
54
|
};
|
|
56
|
-
}, gt = () => r.validityStyles !== void 0 ? r.validityStyles :
|
|
55
|
+
}, gt = () => r.validityStyles !== void 0 ? r.validityStyles : A.validityStyles, ne = (e) => {
|
|
57
56
|
oe.current = !0, e.focus(), window.setTimeout(() => oe.current = !1, 30);
|
|
58
|
-
},
|
|
57
|
+
}, De = () => {
|
|
59
58
|
Z.current && ne(Z.current), r.adaptive && setTimeout(() => {
|
|
60
59
|
Z.current && ne(Z.current);
|
|
61
60
|
}, 300);
|
|
@@ -74,11 +73,11 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
74
73
|
(n = t == null ? void 0 : t.current) == null || n.applyState(e), V.current = void 0;
|
|
75
74
|
}, X = (e, n) => {
|
|
76
75
|
var l;
|
|
77
|
-
const { virtual: a, dataItemKey: c, defaultItem: d } = r, u =
|
|
76
|
+
const { virtual: a, dataItemKey: c, defaultItem: d } = r, u = M(E), I = a ? a.skip : 0, f = L(), o = e === -1 && d !== void 0 ? d : u[e - I], p = !N(o, f, c);
|
|
78
77
|
U(o, n), p && ((l = t == null ? void 0 : t.current) == null || l.triggerPageChangeCornerItems(o, n));
|
|
79
|
-
},
|
|
80
|
-
var
|
|
81
|
-
const { defaultItem: c, dataItemKey: d, virtual: u = { skip: 0, total: 0, pageSize: 0 } } = r, I = L(), f =
|
|
78
|
+
}, z = (e, n, a) => {
|
|
79
|
+
var D, g;
|
|
80
|
+
const { defaultItem: c, dataItemKey: d, virtual: u = { skip: 0, total: 0, pageSize: 0 } } = r, I = L(), f = M(E), o = (D = t == null ? void 0 : t.current) == null ? void 0 : D.vs, p = f.findIndex((h) => N(h, I, d)), l = (g = t == null ? void 0 : t.current) == null ? void 0 : g.navigation.navigate({
|
|
82
81
|
current: u.skip + p,
|
|
83
82
|
max: (o != null && o.enabled ? u.total : f.length) - 1,
|
|
84
83
|
min: c !== void 0 ? -1 : 0,
|
|
@@ -101,7 +100,7 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
101
100
|
style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" }
|
|
102
101
|
},
|
|
103
102
|
/* @__PURE__ */ i.createElement("option", { value: r.valueMap ? r.valueMap.call(void 0, e) : e })
|
|
104
|
-
),
|
|
103
|
+
), Se = () => {
|
|
105
104
|
const {
|
|
106
105
|
textField: e,
|
|
107
106
|
dataItemKey: n,
|
|
@@ -109,18 +108,18 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
109
108
|
focusedItemIndex: c = ln,
|
|
110
109
|
filterable: d,
|
|
111
110
|
skipDisabledItems: u = !0
|
|
112
|
-
} = r, I = L(), f =
|
|
113
|
-
return u && e && !o && !I ? f.findIndex((p) => !p.disabled && p[e]) :
|
|
111
|
+
} = r, I = L(), f = M(E), o = r.filter ? r.filter : m.text;
|
|
112
|
+
return u && e && !o && !I ? f.findIndex((p) => !p.disabled && p[e]) : it(I) && o === void 0 || d && o === "" ? f.findIndex((p) => N(p, I, n)) : o ? Ee.current ? c(f, o, e) : f.findIndex((p) => N(p, I, n)) : a.skip === 0 ? 0 : -1;
|
|
114
113
|
}, Te = (e, n) => n !== void 0 && n !== -1 && e && e.length > 0 && e[n].disabled, xe = () => {
|
|
115
|
-
const e =
|
|
114
|
+
const e = M(E), n = t.current.initState(), a = Se();
|
|
116
115
|
Te(e, a) && (U(null, n), K(n));
|
|
117
116
|
}, Ce = (e) => {
|
|
118
117
|
if (e.isPropagationStopped())
|
|
119
118
|
return;
|
|
120
119
|
const n = t.current.initState();
|
|
121
120
|
n.syntheticEvent = e, m.focused || (n.data.focused = !0), xe(), t.current.togglePopup(n), K(n);
|
|
122
|
-
},
|
|
123
|
-
var
|
|
121
|
+
}, Ae = (e) => {
|
|
122
|
+
var O, pe, W, me, j, Re, et;
|
|
124
123
|
e && e.target instanceof Element && e.target.nodeName === "INPUT" && e.stopPropagation && e.stopPropagation();
|
|
125
124
|
const {
|
|
126
125
|
filterable: n,
|
|
@@ -132,27 +131,27 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
132
131
|
groupField: f = "",
|
|
133
132
|
textField: o,
|
|
134
133
|
skipDisabledItems: p = !0
|
|
135
|
-
} = r, l =
|
|
136
|
-
if (
|
|
137
|
-
if (T && ((
|
|
138
|
-
s === w.home ? u.skip !== 0 ? ((pe = t == null ? void 0 : t.current) == null || pe.triggerOnPageChange(
|
|
139
|
-
|
|
134
|
+
} = r, l = M(E), D = L(), g = l.findIndex((x) => N(x, D, I)), h = r.opened !== void 0 ? r.opened : m.opened, s = e.keyCode, T = s === w.home || s === w.end, b = s === w.up || s === w.down, $ = !h && (e.altKey && s === w.down || s === w.enter || s === w.space), te = h && (e.altKey && s === w.up || s === w.esc), ce = d && (s === w.left || s === w.right), ue = b || ce && !n || T, S = t.current.initState();
|
|
135
|
+
if (S.syntheticEvent = e, !a) {
|
|
136
|
+
if (T && ((O = t == null ? void 0 : t.current) != null && O.vs.enabled))
|
|
137
|
+
s === w.home ? u.skip !== 0 ? ((pe = t == null ? void 0 : t.current) == null || pe.triggerOnPageChange(S, 0, u.pageSize), H.current = !0) : U(l[0], S) : u.skip < u.total - u.pageSize ? ((W = t == null ? void 0 : t.current) == null || W.triggerOnPageChange(
|
|
138
|
+
S,
|
|
140
139
|
u.total - u.pageSize,
|
|
141
140
|
u.pageSize
|
|
142
|
-
), H.current = !0) : U(l[l.length - 1],
|
|
141
|
+
), H.current = !0) : U(l[l.length - 1], S);
|
|
143
142
|
else if (h && s === w.pageUp)
|
|
144
143
|
e.preventDefault(), (me = t == null ? void 0 : t.current) == null || me.scrollPopupByPageSize(-1);
|
|
145
144
|
else if (h && s === w.pageDown)
|
|
146
145
|
e.preventDefault(), (j = t == null ? void 0 : t.current) == null || j.scrollPopupByPageSize(1);
|
|
147
146
|
else if (h && s === w.enter) {
|
|
148
|
-
const x =
|
|
149
|
-
Te(l, x) ? (U(null,
|
|
147
|
+
const x = Se();
|
|
148
|
+
Te(l, x) ? (U(null, S), K(S)) : X(x, S), (Re = t == null ? void 0 : t.current) == null || Re.togglePopup(S), e.preventDefault();
|
|
150
149
|
} else if ($ || te)
|
|
151
|
-
te && xe(), (et = t == null ? void 0 : t.current) == null || et.togglePopup(
|
|
150
|
+
te && xe(), (et = t == null ? void 0 : t.current) == null || et.togglePopup(S), e.preventDefault();
|
|
152
151
|
else if (ue) {
|
|
153
152
|
if (Ee.current = !1, f !== "" && o)
|
|
154
153
|
if (!p && h)
|
|
155
|
-
|
|
154
|
+
z(S, s);
|
|
156
155
|
else {
|
|
157
156
|
let x;
|
|
158
157
|
if (s === w.down || s === w.right) {
|
|
@@ -174,12 +173,12 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
174
173
|
}
|
|
175
174
|
if (x !== void 0) {
|
|
176
175
|
const y = x - g;
|
|
177
|
-
|
|
176
|
+
z(S, s, y);
|
|
178
177
|
} else
|
|
179
|
-
x === void 0 && l.findIndex((y) => y[o] ===
|
|
178
|
+
x === void 0 && l.findIndex((y) => y[o] === D[o]) === l.length - 1 && z(S, s);
|
|
180
179
|
}
|
|
181
180
|
else if (!p && h || T)
|
|
182
|
-
|
|
181
|
+
z(S, s);
|
|
183
182
|
else if (o) {
|
|
184
183
|
let x;
|
|
185
184
|
if (s === w.down || s === w.right) {
|
|
@@ -201,19 +200,19 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
201
200
|
}
|
|
202
201
|
if (x !== void 0) {
|
|
203
202
|
const y = x - g;
|
|
204
|
-
|
|
203
|
+
z(S, s, y);
|
|
205
204
|
} else
|
|
206
|
-
x === void 0 && l.findIndex((y) => y[o] ===
|
|
205
|
+
x === void 0 && l.findIndex((y) => y[o] === D[o]) === l.length - 1 && z(S, s);
|
|
207
206
|
} else
|
|
208
|
-
|
|
207
|
+
z(S, s);
|
|
209
208
|
e.preventDefault();
|
|
210
209
|
}
|
|
211
|
-
K(
|
|
210
|
+
K(S);
|
|
212
211
|
}
|
|
213
212
|
}, wt = (e) => {
|
|
214
213
|
const n = t.current.initState();
|
|
215
214
|
n.syntheticEvent = e.syntheticEvent, r.filter === void 0 && (n.data.text = e.target.value), t.current.filterChanged(e.target.value, n), Ee.current = !0, K(n), Y({ group: void 0, text: String(e.target.value) });
|
|
216
|
-
},
|
|
215
|
+
}, Oe = () => {
|
|
217
216
|
const e = r.filter !== void 0 ? r.filter : m.text;
|
|
218
217
|
return r.filterable && /* @__PURE__ */ i.createElement(
|
|
219
218
|
on,
|
|
@@ -221,7 +220,7 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
221
220
|
value: e,
|
|
222
221
|
ref: (n) => Z.current = n && n.element,
|
|
223
222
|
onChange: wt,
|
|
224
|
-
onKeyDown:
|
|
223
|
+
onKeyDown: Ae,
|
|
225
224
|
size: Q,
|
|
226
225
|
rounded: Fe,
|
|
227
226
|
fillMode: Ie,
|
|
@@ -232,7 +231,7 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
232
231
|
var a;
|
|
233
232
|
const n = t.current.initState();
|
|
234
233
|
n.syntheticEvent = e, (a = t == null ? void 0 : t.current) == null || a.togglePopup(n), U(r.defaultItem, n), K(n);
|
|
235
|
-
},
|
|
234
|
+
}, ze = () => {
|
|
236
235
|
const { textField: e, defaultItem: n, dataItemKey: a } = r, c = L();
|
|
237
236
|
return n !== void 0 && /* @__PURE__ */ i.createElement(
|
|
238
237
|
an,
|
|
@@ -244,14 +243,14 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
244
243
|
onClick: yt
|
|
245
244
|
}
|
|
246
245
|
);
|
|
247
|
-
},
|
|
246
|
+
}, Dt = (e, n) => {
|
|
248
247
|
var a;
|
|
249
248
|
(a = t == null ? void 0 : t.current) == null || a.handleItemClick(e, n), V.current = void 0;
|
|
250
|
-
},
|
|
249
|
+
}, St = (e) => {
|
|
251
250
|
const { vs: n, list: a } = t.current;
|
|
252
251
|
n.scrollHandler(e);
|
|
253
252
|
const { groupField: c } = r;
|
|
254
|
-
let d =
|
|
253
|
+
let d = M(E);
|
|
255
254
|
if (!(!c || !d.length) && c) {
|
|
256
255
|
const u = _e.current = _e.current || (n.enabled ? n.itemHeight : a ? a.children[0].offsetHeight : 0), f = e.target.scrollTop - n.skip * u;
|
|
257
256
|
d = t.current.getGroupedDataModernMode(d, c);
|
|
@@ -269,14 +268,14 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
269
268
|
groupHeaderItemRender: c,
|
|
270
269
|
listNoDataRender: d,
|
|
271
270
|
itemRender: u
|
|
272
|
-
} = r, I =
|
|
271
|
+
} = r, I = M(E), f = F && F.uDropDownList, o = t.current.vs, p = a.skip, l = r.opened !== void 0 ? r.opened : m.opened, D = t.current.getPopupSettings(), g = `translateY(${o.translate}px)`, h = L();
|
|
273
272
|
return /* @__PURE__ */ i.createElement(
|
|
274
273
|
sn,
|
|
275
274
|
{
|
|
276
275
|
id: ke,
|
|
277
276
|
show: l,
|
|
278
277
|
data: I.slice(),
|
|
279
|
-
focusedIndex:
|
|
278
|
+
focusedIndex: Se(),
|
|
280
279
|
value: h,
|
|
281
280
|
textField: e,
|
|
282
281
|
valueField: n,
|
|
@@ -284,16 +283,16 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
284
283
|
groupField: r.groupField,
|
|
285
284
|
groupMode: "modern",
|
|
286
285
|
listRef: (T) => o.list = t.current.list = T,
|
|
287
|
-
wrapperStyle: { maxHeight:
|
|
288
|
-
wrapperCssClass: C(
|
|
286
|
+
wrapperStyle: { maxHeight: D.height },
|
|
287
|
+
wrapperCssClass: C(P.listContent({ c: f })),
|
|
289
288
|
listStyle: o.enabled ? { transform: g } : void 0,
|
|
290
289
|
key: "listkey",
|
|
291
290
|
skip: p,
|
|
292
|
-
onClick:
|
|
291
|
+
onClick: Dt,
|
|
293
292
|
itemRender: u,
|
|
294
293
|
groupHeaderItemRender: c,
|
|
295
294
|
noDataRender: d,
|
|
296
|
-
onScroll:
|
|
295
|
+
onScroll: St,
|
|
297
296
|
wrapperRef: o.scrollerRef,
|
|
298
297
|
scroller: (s = t == null ? void 0 : t.current) == null ? void 0 : s.renderScrollElement(),
|
|
299
298
|
ariaSetSize: a.total
|
|
@@ -301,23 +300,23 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
301
300
|
);
|
|
302
301
|
}, xt = () => {
|
|
303
302
|
var h;
|
|
304
|
-
const { windowWidth: e = 0 } = m, { header: n, footer: a, adaptiveTitle: c, groupField: d, groupStickyHeaderItemRender: u, list: I } = r, f =
|
|
303
|
+
const { windowWidth: e = 0 } = m, { header: n, footer: a, adaptiveTitle: c, groupField: d, groupStickyHeaderItemRender: u, list: I } = r, f = M(E), o = r.opened !== void 0 ? r.opened : m.opened, p = F && F.uDropDownList, l = F && F.uDropDownsActionSheet, D = {
|
|
305
304
|
navigatable: !1,
|
|
306
305
|
navigatableElements: [],
|
|
307
306
|
expand: o,
|
|
308
307
|
animation: !0,
|
|
309
308
|
onClose: (s) => Ce(s),
|
|
310
|
-
animationStyles: e <=
|
|
309
|
+
animationStyles: e <= nt ? { top: 0, width: "100%", height: "100%" } : void 0,
|
|
311
310
|
className: C(
|
|
312
311
|
J.wrapper({
|
|
313
312
|
c: l,
|
|
314
|
-
isFullScreen: e <=
|
|
313
|
+
isFullScreen: e <= nt
|
|
315
314
|
})
|
|
316
315
|
)
|
|
317
316
|
};
|
|
318
317
|
let { group: g } = m;
|
|
319
|
-
return g === void 0 && d !== void 0 && (g = fe(f[0], d)), /* @__PURE__ */ i.createElement(fn, { ...
|
|
320
|
-
|
|
318
|
+
return g === void 0 && d !== void 0 && (g = fe(f[0], d)), /* @__PURE__ */ i.createElement(fn, { ...D }, /* @__PURE__ */ i.createElement(gn, { className: C(J.header({ c: l })) }, /* @__PURE__ */ i.createElement("div", { className: C(J.titleBar({ c: l })) }, /* @__PURE__ */ i.createElement("div", { className: C(J.title({ c: l })) }, /* @__PURE__ */ i.createElement("div", null, c)), /* @__PURE__ */ i.createElement("div", { className: C(J.actions({ c: l })) }, /* @__PURE__ */ i.createElement(
|
|
319
|
+
st,
|
|
321
320
|
{
|
|
322
321
|
tabIndex: 0,
|
|
323
322
|
"aria-label": "Cancel",
|
|
@@ -328,20 +327,20 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
328
327
|
icon: "x",
|
|
329
328
|
svgIcon: nn
|
|
330
329
|
}
|
|
331
|
-
))), /* @__PURE__ */ i.createElement("div", { className: C(J.titleBarGroup({ c: l })) },
|
|
330
|
+
))), /* @__PURE__ */ i.createElement("div", { className: C(J.titleBarGroup({ c: l })) }, Oe())), /* @__PURE__ */ i.createElement(vn, { overflowHidden: !0 }, n && /* @__PURE__ */ i.createElement("div", { className: C(P.listHeader({ c: p })) }, n), /* @__PURE__ */ i.createElement(
|
|
332
331
|
"div",
|
|
333
332
|
{
|
|
334
333
|
className: C(
|
|
335
|
-
|
|
334
|
+
P.list({
|
|
336
335
|
c: p,
|
|
337
336
|
size: Q,
|
|
338
337
|
virtual: (h = t == null ? void 0 : t.current) == null ? void 0 : h.vs.enabled
|
|
339
338
|
})
|
|
340
339
|
)
|
|
341
340
|
},
|
|
342
|
-
|
|
341
|
+
ze(),
|
|
343
342
|
!I && g && f.length !== 0 && /* @__PURE__ */ i.createElement(
|
|
344
|
-
|
|
343
|
+
ot,
|
|
345
344
|
{
|
|
346
345
|
group: g,
|
|
347
346
|
groupMode: "modern",
|
|
@@ -349,7 +348,7 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
349
348
|
}
|
|
350
349
|
),
|
|
351
350
|
Ve()
|
|
352
|
-
), a && /* @__PURE__ */ i.createElement("div", { className: C(
|
|
351
|
+
), a && /* @__PURE__ */ i.createElement("div", { className: C(P.listFooter({ c: p })) }, a)));
|
|
353
352
|
}, Ct = () => {
|
|
354
353
|
m.focused && window.setTimeout(() => {
|
|
355
354
|
m.focused && t.current.wrapper && ne(t.current.wrapper);
|
|
@@ -358,43 +357,43 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
358
357
|
var n;
|
|
359
358
|
(n = r.popupSettings) != null && n.onMouseDownOutside && r.popupSettings.onMouseDownOutside.call(void 0, e);
|
|
360
359
|
}, kt = () => {
|
|
361
|
-
const { header: e, footer: n, dir: a, groupField: c, groupStickyHeaderItemRender: d, list: u } = r, I =
|
|
360
|
+
const { header: e, footer: n, dir: a, groupField: c, groupStickyHeaderItemRender: d, list: u } = r, I = M(E), f = t.current, o = f.getPopupSettings(), p = r.opened !== void 0 ? r.opened : m.opened, l = o.width !== void 0 ? o.width : f.popupWidth, D = F && F.uDropDownList, g = {
|
|
362
361
|
dir: a !== void 0 ? a : f.dirCalculated,
|
|
363
362
|
width: l,
|
|
364
363
|
popupSettings: {
|
|
365
364
|
...o,
|
|
366
365
|
popupClass: C(
|
|
367
366
|
o.popupClass,
|
|
368
|
-
|
|
369
|
-
c:
|
|
367
|
+
P.listContainer({
|
|
368
|
+
c: D
|
|
370
369
|
})
|
|
371
370
|
),
|
|
372
371
|
anchor: o.anchor || q.current,
|
|
373
372
|
show: p,
|
|
374
|
-
onOpen:
|
|
373
|
+
onOpen: De,
|
|
375
374
|
onClose: Ct,
|
|
376
375
|
onMouseDownOutside: Et
|
|
377
376
|
},
|
|
378
377
|
itemsCount: [I.length]
|
|
379
378
|
};
|
|
380
379
|
let { group: h } = m;
|
|
381
|
-
return h === void 0 && c !== void 0 && (h = fe(I[0], c)), /* @__PURE__ */ i.createElement(rn, { ...g },
|
|
380
|
+
return h === void 0 && c !== void 0 && (h = fe(I[0], c)), /* @__PURE__ */ i.createElement(rn, { ...g }, Oe(), e && /* @__PURE__ */ i.createElement("div", { className: C(P.listHeader({ c: D })) }, e), /* @__PURE__ */ i.createElement(
|
|
382
381
|
"div",
|
|
383
382
|
{
|
|
384
383
|
className: C(
|
|
385
|
-
|
|
386
|
-
c:
|
|
384
|
+
P.list({
|
|
385
|
+
c: D,
|
|
387
386
|
size: Q,
|
|
388
387
|
virtual: t.current.vs.enabled
|
|
389
388
|
})
|
|
390
389
|
)
|
|
391
390
|
},
|
|
392
|
-
|
|
393
|
-
!u && h && I.length !== 0 && /* @__PURE__ */ i.createElement(
|
|
391
|
+
ze(),
|
|
392
|
+
!u && h && I.length !== 0 && /* @__PURE__ */ i.createElement(ot, { group: h, groupMode: "modern", render: d }),
|
|
394
393
|
Ve()
|
|
395
|
-
), n && /* @__PURE__ */ i.createElement("div", { className: C(
|
|
394
|
+
), n && /* @__PURE__ */ i.createElement("div", { className: C(P.listFooter({ c: D })) }, n));
|
|
396
395
|
}, Lt = (e) => {
|
|
397
|
-
const { dataItemKey: n } = r, a =
|
|
396
|
+
const { dataItemKey: n } = r, a = M(E), c = L();
|
|
398
397
|
let d = a.map((b, $) => ({ item: b, itemIndex: $ }));
|
|
399
398
|
const u = G.current.word, I = G.current.last, f = dn(u, I);
|
|
400
399
|
let o = d.length, p = Math.max(
|
|
@@ -402,10 +401,10 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
402
401
|
a.findIndex((b) => N(b, c, n))
|
|
403
402
|
), l;
|
|
404
403
|
r.defaultItem && (l = { item: r.defaultItem, itemIndex: -1 }, o += 1, p += 1), p += f ? 1 : 0, d = cn(d, p, l);
|
|
405
|
-
let
|
|
404
|
+
let D, g, h, s = 0;
|
|
406
405
|
const { textField: T } = r;
|
|
407
406
|
for (; s < o; s++)
|
|
408
|
-
if (
|
|
407
|
+
if (D = fe(d[s].item, T), g = f && at(D, I, ve), h = at(D, u, ve), g || h) {
|
|
409
408
|
s = d[s].itemIndex;
|
|
410
409
|
break;
|
|
411
410
|
}
|
|
@@ -413,14 +412,14 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
413
412
|
const b = t.current.initState();
|
|
414
413
|
b.syntheticEvent = e, X(s, b), K(b), V.current = void 0;
|
|
415
414
|
}
|
|
416
|
-
}, Mt = (e) => {
|
|
417
|
-
clearTimeout(Be.current), r.filterable || (Be.current = window.setTimeout(() => G.current.word = "", ut), Lt(e));
|
|
418
415
|
}, Pt = (e) => {
|
|
416
|
+
clearTimeout(Be.current), r.filterable || (Be.current = window.setTimeout(() => G.current.word = "", ut), Lt(e));
|
|
417
|
+
}, Mt = (e) => {
|
|
419
418
|
oe.current || t.current.handleFocus(e);
|
|
420
419
|
}, bt = (e) => {
|
|
421
420
|
if (oe.current || !m.focused)
|
|
422
421
|
return;
|
|
423
|
-
const n = r.opened !== void 0 ? r.opened : m.opened, { adaptive: a } = r, { windowWidth: c = 0 } = m, d = c <=
|
|
422
|
+
const n = r.opened !== void 0 ? r.opened : m.opened, { adaptive: a } = r, { windowWidth: c = 0 } = m, d = c <= rt && a, u = t.current.initState();
|
|
424
423
|
u.syntheticEvent = e, u.data.focused = !1, u.events.push({ type: "onBlur" }), n && xe(), n && !d && t.current.togglePopup(u), K(u);
|
|
425
424
|
}, Nt = (e) => {
|
|
426
425
|
if (r.filterable || e.which === 0 || e.keyCode === w.enter)
|
|
@@ -429,7 +428,7 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
429
428
|
ve && (n = n.toLowerCase()), n === " " && e.preventDefault(), G.current = {
|
|
430
429
|
word: G.current.word + n,
|
|
431
430
|
last: G.current.last + n
|
|
432
|
-
},
|
|
431
|
+
}, Pt(e);
|
|
433
432
|
}, Ft = () => {
|
|
434
433
|
const e = t.current.initState();
|
|
435
434
|
e.data.opened = m.opened, t.current.togglePopup(e), K(e);
|
|
@@ -493,20 +492,20 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
493
492
|
value: L()
|
|
494
493
|
});
|
|
495
494
|
}, [Y, m, We, X, L]), i.useEffect(() => {
|
|
496
|
-
var p, l,
|
|
497
|
-
const { dataItemKey: e, virtual: n, groupField: a = "", textField: c } = r, d =
|
|
498
|
-
if ((p = t == null ? void 0 : t.current) == null || p.didUpdate(), (l = t == null ? void 0 : t.current) != null && l.getPopupSettings().animate || o &&
|
|
499
|
-
(
|
|
495
|
+
var p, l, D, g, h, s, T, b, $, te, ce, ue, S;
|
|
496
|
+
const { dataItemKey: e, virtual: n, groupField: a = "", textField: c } = r, d = M(E), u = B.current.virtual ? B.current.virtual.total : 0, I = r.opened !== void 0 ? r.opened : m.opened, f = B.current.opened !== void 0 ? B.current.opened : ie.current.opened, o = !f && I;
|
|
497
|
+
if ((p = t == null ? void 0 : t.current) == null || p.didUpdate(), (l = t == null ? void 0 : t.current) != null && l.getPopupSettings().animate || o && De(), n && n.total !== u)
|
|
498
|
+
(D = t == null ? void 0 : t.current) == null || D.vs.calcScrollElementHeight(), (g = t == null ? void 0 : t.current) == null || g.vs.reset();
|
|
500
499
|
else {
|
|
501
|
-
const
|
|
502
|
-
let W = d.findIndex((j) => N(j,
|
|
503
|
-
a !== "" &&
|
|
504
|
-
const me = !N(pe,
|
|
505
|
-
o && n ? (T = t == null ? void 0 : t.current) == null || T.scrollToVirtualItem(n, W) : o && !n ? (
|
|
500
|
+
const O = L(), pe = B.current.value !== void 0 ? B.current.value : ie.current.value;
|
|
501
|
+
let W = d.findIndex((j) => N(j, O, e));
|
|
502
|
+
a !== "" && O && c && (W = (s = (h = t == null ? void 0 : t.current) == null ? void 0 : h.getGroupedDataModernMode(d, a)) == null ? void 0 : s.map((j) => j[c]).indexOf(O[c]));
|
|
503
|
+
const me = !N(pe, O, e);
|
|
504
|
+
o && n ? (T = t == null ? void 0 : t.current) == null || T.scrollToVirtualItem(n, W) : o && !n ? (De(), d && d.length !== 0 && ((b = t == null ? void 0 : t.current) == null || b.resetGroupStickyHeader(d[0][a], {
|
|
506
505
|
setState: Y,
|
|
507
506
|
group: m.group,
|
|
508
507
|
state: m
|
|
509
|
-
})), ($ = t == null ? void 0 : t.current) == null || $.scrollToItem(W)) : I && f &&
|
|
508
|
+
})), ($ = t == null ? void 0 : t.current) == null || $.scrollToItem(W)) : I && f && O && me && !H.current ? (ce = t == null ? void 0 : t.current) == null || ce.scrollToItem(W, (te = t == null ? void 0 : t.current) == null ? void 0 : te.vs.enabled) : I && f && H.current && (H.current && n && n.skip === 0 ? (ue = t == null ? void 0 : t.current) == null || ue.vs.reset() : H.current && n && n.skip === n.total - n.pageSize && ((S = t == null ? void 0 : t.current) == null || S.vs.scrollToEnd()));
|
|
510
509
|
}
|
|
511
510
|
H.current = !1, ie.current = m, B.current = r, Ke();
|
|
512
511
|
}), i.useEffect(() => {
|
|
@@ -516,14 +515,14 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
516
515
|
(a = he()) != null && a.body && R.current && R.current.disconnect();
|
|
517
516
|
};
|
|
518
517
|
}, []);
|
|
519
|
-
const Ue = ge + "-accessibility-id", ke = ge + "-listbox-id", qe = ge + "-guid",
|
|
520
|
-
|
|
521
|
-
mn[
|
|
518
|
+
const Ue = ge + "-accessibility-id", ke = ge + "-listbox-id", qe = ge + "-guid", At = Tt.toLanguageString(
|
|
519
|
+
lt,
|
|
520
|
+
mn[lt]
|
|
522
521
|
), {
|
|
523
522
|
style: ae,
|
|
524
|
-
className:
|
|
523
|
+
className: Ot,
|
|
525
524
|
label: Le,
|
|
526
|
-
dir:
|
|
525
|
+
dir: zt,
|
|
527
526
|
virtual: _,
|
|
528
527
|
adaptive: Vt,
|
|
529
528
|
dataItemKey: Ht,
|
|
@@ -532,14 +531,14 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
532
531
|
iconClassName: Ye,
|
|
533
532
|
svgIcon: $e,
|
|
534
533
|
valueRender: je
|
|
535
|
-
} = r, { windowWidth: Bt = 0 } = m,
|
|
534
|
+
} = r, { windowWidth: Bt = 0 } = m, Pe = r.opened !== void 0 ? r.opened : m.opened, le = L(), Me = fe(le, r.textField), Je = !gt() || ye().valid, de = t.current, _t = de.vs, Qe = Bt <= rt && Vt, ee = F && F.uDropDownList;
|
|
536
535
|
_t.enabled = _ !== void 0, _ !== void 0 && (de.vs.skip = _.skip, de.vs.total = _.total, de.vs.pageSize = _.pageSize);
|
|
537
|
-
const Wt =
|
|
536
|
+
const Wt = M(E), { focused: Ut } = m, qt = Wt.findIndex((e) => N(e, le, Ht)), Xe = /* @__PURE__ */ i.createElement("span", { id: Ue, className: C(P.inputInner({ c: ee })) }, Me && /* @__PURE__ */ i.createElement("span", { className: C(P.inputText({ c: ee })) }, Me)), Gt = je !== void 0 ? je.call(void 0, Xe, le) : Xe, Ze = /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
|
|
538
537
|
"span",
|
|
539
538
|
{
|
|
540
539
|
ref: It,
|
|
541
540
|
className: C(
|
|
542
|
-
|
|
541
|
+
P.wrapper({
|
|
543
542
|
c: ee,
|
|
544
543
|
size: Q,
|
|
545
544
|
rounded: Fe,
|
|
@@ -550,27 +549,27 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
550
549
|
loading: Ge,
|
|
551
550
|
required: we()
|
|
552
551
|
}),
|
|
553
|
-
|
|
552
|
+
Ot
|
|
554
553
|
),
|
|
555
554
|
style: Le ? { ...ae, width: void 0 } : ae,
|
|
556
|
-
dir:
|
|
557
|
-
onMouseDown:
|
|
555
|
+
dir: zt,
|
|
556
|
+
onMouseDown: Pe ? (e) => {
|
|
558
557
|
e.target.nodeName !== "INPUT" && (ne(t.current.wrapper), e.preventDefault());
|
|
559
558
|
} : void 0,
|
|
560
|
-
onFocus:
|
|
559
|
+
onFocus: Mt,
|
|
561
560
|
onBlur: bt,
|
|
562
561
|
tabIndex: Qt(pt, se),
|
|
563
562
|
accessKey: r.accessKey,
|
|
564
|
-
onKeyDown:
|
|
563
|
+
onKeyDown: Ae,
|
|
565
564
|
onKeyPress: Nt,
|
|
566
565
|
onClick: se ? void 0 : Ce,
|
|
567
566
|
role: "combobox",
|
|
568
567
|
"aria-required": we(),
|
|
569
568
|
"aria-disabled": se || void 0,
|
|
570
569
|
"aria-haspopup": "listbox",
|
|
571
|
-
"aria-expanded":
|
|
570
|
+
"aria-expanded": Pe || !1,
|
|
572
571
|
"aria-owns": ke,
|
|
573
|
-
"aria-activedescendant":
|
|
572
|
+
"aria-activedescendant": Pe ? "option-" + qe + "-" + (qt + (_ ? _.skip : 0)) : void 0,
|
|
574
573
|
"aria-label": r.ariaLabel || r.label,
|
|
575
574
|
"aria-labelledby": r.ariaLabelledBy,
|
|
576
575
|
"aria-describedby": r.ariaDescribedBy || Ue,
|
|
@@ -579,17 +578,17 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
579
578
|
title: r.title
|
|
580
579
|
},
|
|
581
580
|
Gt,
|
|
582
|
-
Ge && /* @__PURE__ */ i.createElement(Xt, { className: C(
|
|
581
|
+
Ge && /* @__PURE__ */ i.createElement(Xt, { className: C(P.loadingIcon({ c: ee })), name: "loading" }),
|
|
583
582
|
/* @__PURE__ */ i.createElement(
|
|
584
|
-
|
|
583
|
+
st,
|
|
585
584
|
{
|
|
586
585
|
tabIndex: -1,
|
|
587
586
|
type: "button",
|
|
588
|
-
"aria-label":
|
|
587
|
+
"aria-label": At,
|
|
589
588
|
size: Q,
|
|
590
589
|
fillMode: Ie,
|
|
591
590
|
iconClass: Ye,
|
|
592
|
-
className: C(
|
|
591
|
+
className: C(P.inputButton({ c: ee })),
|
|
593
592
|
rounded: null,
|
|
594
593
|
themeColor: "base",
|
|
595
594
|
icon: Ye ? void 0 : "caret-alt-down",
|
|
@@ -604,7 +603,7 @@ const In = "Please select a value from the list!", Ne = i.forwardRef((E, ct) =>
|
|
|
604
603
|
en,
|
|
605
604
|
{
|
|
606
605
|
label: Le,
|
|
607
|
-
editorValue:
|
|
606
|
+
editorValue: Me,
|
|
608
607
|
editorValid: Je,
|
|
609
608
|
editorDisabled: r.disabled,
|
|
610
609
|
style: { width: ae ? ae.width : void 0 },
|
|
@@ -632,7 +631,7 @@ Ne.propTypes = {
|
|
|
632
631
|
list: k.any,
|
|
633
632
|
skipDisabledItems: k.bool
|
|
634
633
|
};
|
|
635
|
-
const
|
|
634
|
+
const A = {
|
|
636
635
|
delay: 500,
|
|
637
636
|
tabIndex: 0,
|
|
638
637
|
ignoreCase: !0,
|
|
@@ -649,5 +648,5 @@ Ne.displayName = "KendoReactDropDownList";
|
|
|
649
648
|
export {
|
|
650
649
|
Ne as DropDownList,
|
|
651
650
|
hn as DropDownListPropsContext,
|
|
652
|
-
|
|
651
|
+
A as dropDownListDefaultProps
|
|
653
652
|
};
|