@progress/kendo-react-dropdowns 7.5.0-develop.2 → 7.5.0-develop.20
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 +1 -1
- package/AutoComplete/AutoComplete.mjs +30 -29
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +62 -60
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +59 -57
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +188 -184
- package/DropDownTree/useDropdownWidth.js +1 -1
- package/DropDownTree/useDropdownWidth.mjs +12 -9
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +4 -5
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +92 -90
- package/common/AdaptiveMode.js +1 -1
- package/common/AdaptiveMode.mjs +10 -5
- package/common/DropDownBase.js +1 -1
- package/common/DropDownBase.mjs +63 -55
- package/common/ListFilter.js +1 -1
- package/common/ListFilter.mjs +31 -26
- package/common/VirtualScrollStatic.js +8 -0
- package/common/VirtualScrollStatic.mjs +77 -0
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +27 -18
- package/index.d.ts +27 -18
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/common/VirtualScroll.js +0 -8
- package/common/VirtualScroll.mjs +0 -75
|
@@ -8,30 +8,30 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
10
|
import n from "prop-types";
|
|
11
|
-
import { createPropsContext as Xe, validatePackage as Ye, usePropsContext as Ze, useId as et, getTabIndex as tt, useRtl as nt, canUseDOM as
|
|
11
|
+
import { createPropsContext as Xe, validatePackage as Ye, usePropsContext as Ze, useId as et, getTabIndex as tt, useRtl as nt, canUseDOM as at, Keys as c, noop as U, mapTree as ot, extendDataItem as rt, classNames as oe, IconWrap as we, kendoThemeMaps as it } from "@progress/kendo-react-common";
|
|
12
12
|
import { Popup as lt } from "@progress/kendo-react-popup";
|
|
13
13
|
import { useLocalization as st } from "@progress/kendo-react-intl";
|
|
14
|
-
import { TreeView as
|
|
14
|
+
import { TreeView as Fe } from "@progress/kendo-react-treeview";
|
|
15
15
|
import { packageMetadata as ct } from "../package-metadata.mjs";
|
|
16
|
-
import { getItemValue as ut, areSame as
|
|
16
|
+
import { getItemValue as ut, areSame as De, isPresent as dt } from "../common/utils.mjs";
|
|
17
17
|
import { useDropdownWidth as pt } from "./useDropdownWidth.mjs";
|
|
18
18
|
import { ListNoData as ft } from "./ListNoData.mjs";
|
|
19
|
-
import { clear as
|
|
19
|
+
import { clear as Ie, messages as re, nodata as j } from "../messages/index.mjs";
|
|
20
20
|
import { FloatingLabel as mt } from "@progress/kendo-react-labels";
|
|
21
|
-
import
|
|
21
|
+
import Se from "../common/ListFilter.mjs";
|
|
22
22
|
import { Button as vt } from "@progress/kendo-react-buttons";
|
|
23
23
|
import { xIcon as gt, caretAltDownIcon as bt } from "@progress/kendo-svg-icons";
|
|
24
24
|
import { AdaptiveMode as ht } from "../common/AdaptiveMode.mjs";
|
|
25
25
|
import { ActionSheetContent as yt } from "@progress/kendo-react-layout";
|
|
26
26
|
import { MOBILE_MEDIUM_DEVISE as Et } from "../common/constants.mjs";
|
|
27
|
-
const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the list!", wt = (
|
|
28
|
-
const { validationMessage: r, valid:
|
|
27
|
+
const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the list!", wt = (E) => /* @__PURE__ */ t.createElement("span", { className: "k-input-value-text" }, E.children), Me = (E) => E.split("_").map((D) => parseInt(D, 10)), Ft = (E, D) => {
|
|
28
|
+
const { validationMessage: r, valid: o, required: G } = E;
|
|
29
29
|
return {
|
|
30
30
|
customError: r !== void 0,
|
|
31
|
-
valid: !!(
|
|
32
|
-
valueMissing: !
|
|
31
|
+
valid: !!(o !== void 0 ? o : !G || D),
|
|
32
|
+
valueMissing: !D
|
|
33
33
|
};
|
|
34
|
-
},
|
|
34
|
+
}, ie = {
|
|
35
35
|
selectField: "selected",
|
|
36
36
|
subItemsField: "items",
|
|
37
37
|
popupSettings: {
|
|
@@ -46,90 +46,90 @@ const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the
|
|
|
46
46
|
size: "medium",
|
|
47
47
|
rounded: "medium",
|
|
48
48
|
fillMode: "solid"
|
|
49
|
-
}, Dt = Xe(), Re = t.forwardRef((
|
|
49
|
+
}, Dt = Xe(), Re = t.forwardRef((E, D) => {
|
|
50
50
|
Ye(ct);
|
|
51
|
-
const r = Ze(Dt,
|
|
52
|
-
...
|
|
51
|
+
const r = Ze(Dt, E), o = {
|
|
52
|
+
...ie,
|
|
53
53
|
...r
|
|
54
|
-
}, G = et(),
|
|
54
|
+
}, G = et(), le = o.id || G, {
|
|
55
55
|
data: T,
|
|
56
56
|
dataItemKey: N,
|
|
57
|
-
popupSettings:
|
|
57
|
+
popupSettings: b = {},
|
|
58
58
|
style: P,
|
|
59
59
|
opened: u,
|
|
60
60
|
disabled: I,
|
|
61
61
|
onOpen: V = U,
|
|
62
62
|
onClose: f = U,
|
|
63
|
-
placeholder:
|
|
63
|
+
placeholder: J,
|
|
64
64
|
label: O,
|
|
65
65
|
name: Te,
|
|
66
66
|
selectField: z,
|
|
67
67
|
subItemsField: K,
|
|
68
68
|
validationMessage: H,
|
|
69
69
|
valid: Ne,
|
|
70
|
-
required:
|
|
70
|
+
required: Q,
|
|
71
71
|
validityStyles: Pe
|
|
72
|
-
} =
|
|
72
|
+
} = o, X = tt(o.tabIndex, I), i = t.useRef(null), m = t.useRef(null), S = t.useRef(null), Y = t.useRef(null), _ = t.useRef(null), h = t.useRef(null), $ = t.useRef(!1), [se, Ve] = t.useState(void 0), C = o.value !== void 0, v = C ? o.value : se !== void 0 ? se : o.defaultValue, L = dt(v), Z = L ? ut(v, o.textField) : "", ee = Ft({ validationMessage: H, valid: Ne, required: Q }, L), Oe = t.useCallback(() => m.current && m.current.focus(), []);
|
|
73
73
|
t.useImperativeHandle(
|
|
74
74
|
i,
|
|
75
75
|
() => ({
|
|
76
|
-
props:
|
|
76
|
+
props: o,
|
|
77
77
|
element: m.current,
|
|
78
78
|
focus: Oe
|
|
79
79
|
})
|
|
80
|
-
), t.useImperativeHandle(
|
|
81
|
-
const
|
|
82
|
-
width: pt(m,
|
|
83
|
-
...
|
|
84
|
-
}, [
|
|
80
|
+
), t.useImperativeHandle(D, () => i.current);
|
|
81
|
+
const k = nt(m, o.dir), Ke = {
|
|
82
|
+
width: pt(m, ie, { ...ie.popupSettings, ...b }, P),
|
|
83
|
+
...k !== void 0 ? { direction: k } : {}
|
|
84
|
+
}, [Le, ce] = t.useState(!1), l = u !== void 0 ? u : Le, [d, te] = t.useState(!1), [ne, Be] = t.useState(), x = !!(ne && ne <= Et && o.adaptive), [ue, We] = t.useState(""), qe = t.useCallback(
|
|
85
85
|
() => {
|
|
86
86
|
_.current && _.current.setCustomValidity && _.current.setCustomValidity(
|
|
87
|
-
|
|
87
|
+
ee.valid ? "" : H === void 0 ? xt : H
|
|
88
88
|
);
|
|
89
89
|
},
|
|
90
|
-
[H,
|
|
90
|
+
[H, ee]
|
|
91
91
|
);
|
|
92
|
-
t.useEffect(
|
|
93
|
-
const e =
|
|
92
|
+
t.useEffect(qe), t.useEffect(() => {
|
|
93
|
+
const e = at && window.ResizeObserver && new window.ResizeObserver(Je.bind(void 0));
|
|
94
94
|
return document != null && document.body && e && e.observe(document.body), () => {
|
|
95
95
|
document != null && document.body && e && e.disconnect();
|
|
96
96
|
};
|
|
97
97
|
}, []);
|
|
98
|
-
const
|
|
98
|
+
const de = t.useCallback(
|
|
99
99
|
(e) => {
|
|
100
100
|
if (!l) {
|
|
101
101
|
if (V) {
|
|
102
|
-
const
|
|
103
|
-
V.call(void 0,
|
|
102
|
+
const a = { ...e };
|
|
103
|
+
V.call(void 0, a);
|
|
104
104
|
}
|
|
105
|
-
u === void 0 &&
|
|
105
|
+
u === void 0 && ce(!0);
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
[l, u, V]
|
|
109
|
-
),
|
|
109
|
+
), w = t.useCallback(
|
|
110
110
|
(e) => {
|
|
111
111
|
if (l) {
|
|
112
112
|
if (f) {
|
|
113
|
-
const
|
|
114
|
-
f.call(void 0,
|
|
113
|
+
const a = { ...e };
|
|
114
|
+
f.call(void 0, a);
|
|
115
115
|
}
|
|
116
|
-
u === void 0 && (
|
|
117
|
-
var
|
|
118
|
-
g((
|
|
116
|
+
u === void 0 && (ce(!1), x && setTimeout(() => {
|
|
117
|
+
var a;
|
|
118
|
+
g((a = Y.current) == null ? void 0 : a.element);
|
|
119
119
|
}, 300));
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
|
-
[l, u, f,
|
|
122
|
+
[l, u, f, x]
|
|
123
123
|
), Ae = t.useCallback(
|
|
124
124
|
(e) => {
|
|
125
125
|
if (!e.isDefaultPrevented() && i.current) {
|
|
126
|
-
|
|
127
|
-
const
|
|
126
|
+
te(!0);
|
|
127
|
+
const a = {
|
|
128
128
|
syntheticEvent: e,
|
|
129
129
|
nativeEvent: e.nativeEvent,
|
|
130
130
|
target: i.current
|
|
131
131
|
};
|
|
132
|
-
(l ?
|
|
132
|
+
(l ? w : de)(a);
|
|
133
133
|
}
|
|
134
134
|
},
|
|
135
135
|
[l, u, V, f]
|
|
@@ -140,9 +140,9 @@ const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the
|
|
|
140
140
|
[]
|
|
141
141
|
), ze = t.useCallback(
|
|
142
142
|
(e) => {
|
|
143
|
-
var
|
|
144
|
-
const { keyCode:
|
|
145
|
-
if (!i.current || e.isDefaultPrevented() && ((
|
|
143
|
+
var F, ke;
|
|
144
|
+
const { keyCode: a, altKey: s } = e, p = h.current && h.current.element;
|
|
145
|
+
if (!i.current || e.isDefaultPrevented() && ((F = S.current) == null ? void 0 : F.element) === e.target)
|
|
146
146
|
return;
|
|
147
147
|
const R = {
|
|
148
148
|
syntheticEvent: e,
|
|
@@ -150,12 +150,12 @@ const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the
|
|
|
150
150
|
target: i.current
|
|
151
151
|
};
|
|
152
152
|
if (l)
|
|
153
|
-
if (
|
|
154
|
-
e.preventDefault(),
|
|
155
|
-
else if (p && p.querySelector(".k-focus") && (
|
|
156
|
-
if (
|
|
157
|
-
const
|
|
158
|
-
if (
|
|
153
|
+
if (a === c.esc || s && a === c.up)
|
|
154
|
+
e.preventDefault(), w(R);
|
|
155
|
+
else if (p && p.querySelector(".k-focus") && (a === c.up || a === c.down || a === c.left || a === c.right || a === c.home || a === c.end)) {
|
|
156
|
+
if (a === c.up && ((ke = S.current) != null && ke.element)) {
|
|
157
|
+
const q = Array.from(p.querySelectorAll(".k-treeview-item")), xe = [...q].reverse().find((A) => !!(A && A.querySelector(".k-focus")));
|
|
158
|
+
if (xe && q.indexOf(xe) === 0)
|
|
159
159
|
return M(() => {
|
|
160
160
|
var A;
|
|
161
161
|
g((A = S.current) == null ? void 0 : A.element);
|
|
@@ -163,22 +163,22 @@ const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the
|
|
|
163
163
|
}
|
|
164
164
|
M(U);
|
|
165
165
|
} else
|
|
166
|
-
|
|
167
|
-
var
|
|
168
|
-
g(((
|
|
166
|
+
a === c.down && M(() => {
|
|
167
|
+
var q;
|
|
168
|
+
g(((q = S.current) == null ? void 0 : q.element) || p);
|
|
169
169
|
});
|
|
170
170
|
else
|
|
171
|
-
s &&
|
|
171
|
+
s && a === c.down ? (e.preventDefault(), de(R)) : l || a === c.esc && ve(e);
|
|
172
172
|
},
|
|
173
173
|
[l, u, V, f]
|
|
174
|
-
),
|
|
174
|
+
), pe = t.useCallback(
|
|
175
175
|
(e) => {
|
|
176
|
-
const { keyCode:
|
|
177
|
-
s ||
|
|
178
|
-
|
|
176
|
+
const { keyCode: a, altKey: s } = e;
|
|
177
|
+
s || a !== c.up && a !== c.down || (e.preventDefault(), M(
|
|
178
|
+
a === c.up ? () => {
|
|
179
179
|
g(m.current);
|
|
180
180
|
} : () => {
|
|
181
|
-
g(
|
|
181
|
+
g(h.current && h.current.element);
|
|
182
182
|
}
|
|
183
183
|
));
|
|
184
184
|
},
|
|
@@ -191,7 +191,7 @@ const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the
|
|
|
191
191
|
), He = t.useCallback(
|
|
192
192
|
() => {
|
|
193
193
|
var e;
|
|
194
|
-
!d && l && !u ?
|
|
194
|
+
!d && l && !u ? w({ target: i.current }) : r.filterable ? g((e = S.current) == null ? void 0 : e.element) : g(h.current && h.current.element);
|
|
195
195
|
},
|
|
196
196
|
[f, r.filterable, d, u, l]
|
|
197
197
|
), _e = t.useCallback(
|
|
@@ -201,93 +201,93 @@ const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the
|
|
|
201
201
|
[d]
|
|
202
202
|
), $e = t.useCallback(
|
|
203
203
|
(e) => {
|
|
204
|
-
if (!d && !$.current && (
|
|
205
|
-
const
|
|
204
|
+
if (!d && !$.current && (te(!0), r.onFocus && i.current)) {
|
|
205
|
+
const a = {
|
|
206
206
|
syntheticEvent: e,
|
|
207
207
|
nativeEvent: e.nativeEvent,
|
|
208
208
|
target: i.current
|
|
209
209
|
};
|
|
210
|
-
r.onFocus.call(void 0,
|
|
210
|
+
r.onFocus.call(void 0, a);
|
|
211
211
|
}
|
|
212
212
|
},
|
|
213
213
|
[d, r.onFocus]
|
|
214
214
|
), Ue = t.useCallback(
|
|
215
215
|
(e) => {
|
|
216
216
|
if (d && !$.current && i.current) {
|
|
217
|
-
|
|
218
|
-
const
|
|
217
|
+
te(!1);
|
|
218
|
+
const a = {
|
|
219
219
|
syntheticEvent: e,
|
|
220
220
|
nativeEvent: e.nativeEvent,
|
|
221
221
|
target: i.current
|
|
222
222
|
};
|
|
223
223
|
if (r.onBlur) {
|
|
224
|
-
const s = { ...
|
|
224
|
+
const s = { ...a };
|
|
225
225
|
r.onBlur.call(void 0, s);
|
|
226
226
|
}
|
|
227
|
-
|
|
227
|
+
x || w(a);
|
|
228
228
|
}
|
|
229
229
|
},
|
|
230
230
|
[d, r.onBlur, l, u, f]
|
|
231
231
|
), je = t.useCallback(
|
|
232
232
|
() => {
|
|
233
|
-
d && M(U),
|
|
233
|
+
d && M(U), x && setTimeout(() => {
|
|
234
234
|
var e;
|
|
235
|
-
g((e =
|
|
235
|
+
g((e = Y.current) == null ? void 0 : e.element);
|
|
236
236
|
}, 300);
|
|
237
237
|
},
|
|
238
|
-
[d,
|
|
239
|
-
),
|
|
240
|
-
(e,
|
|
238
|
+
[d, x]
|
|
239
|
+
), fe = t.useCallback(
|
|
240
|
+
(e, a, s) => {
|
|
241
241
|
if (r.onChange) {
|
|
242
242
|
const p = {
|
|
243
|
-
value:
|
|
244
|
-
level: s ?
|
|
243
|
+
value: a,
|
|
244
|
+
level: s ? Me(s) : [],
|
|
245
245
|
...e
|
|
246
246
|
};
|
|
247
247
|
r.onChange.call(void 0, p);
|
|
248
248
|
}
|
|
249
|
-
|
|
249
|
+
C || Ve(a);
|
|
250
250
|
},
|
|
251
|
-
[r.onChange,
|
|
252
|
-
),
|
|
251
|
+
[r.onChange, C]
|
|
252
|
+
), me = t.useCallback(
|
|
253
253
|
(e) => {
|
|
254
|
-
if (
|
|
254
|
+
if (De(e.item, v, N) || !i.current)
|
|
255
255
|
return;
|
|
256
|
-
const { item:
|
|
256
|
+
const { item: a, itemHierarchicalIndex: s, nativeEvent: p, syntheticEvent: R } = e, F = {
|
|
257
257
|
syntheticEvent: R,
|
|
258
258
|
nativeEvent: p,
|
|
259
259
|
target: i.current
|
|
260
260
|
};
|
|
261
|
-
|
|
261
|
+
fe(F, a, s), w(F);
|
|
262
262
|
},
|
|
263
|
-
[
|
|
264
|
-
),
|
|
263
|
+
[C, v, r.onChange, N, l, u, f]
|
|
264
|
+
), ve = t.useCallback(
|
|
265
265
|
(e) => {
|
|
266
266
|
if (!i.current)
|
|
267
267
|
return;
|
|
268
|
-
const
|
|
268
|
+
const a = {
|
|
269
269
|
syntheticEvent: e,
|
|
270
270
|
nativeEvent: e.nativeEvent,
|
|
271
271
|
target: i.current
|
|
272
272
|
};
|
|
273
|
-
|
|
273
|
+
fe(a, null), w(a), e.preventDefault();
|
|
274
274
|
},
|
|
275
|
-
[
|
|
276
|
-
),
|
|
275
|
+
[C, r.onChange, l, u, f]
|
|
276
|
+
), ge = t.useCallback(
|
|
277
277
|
(e) => {
|
|
278
278
|
if (e.syntheticEvent.stopPropagation(), r.onExpandChange && i.current) {
|
|
279
|
-
const { item:
|
|
280
|
-
level:
|
|
281
|
-
item:
|
|
279
|
+
const { item: a, itemHierarchicalIndex: s, nativeEvent: p, syntheticEvent: R } = e, F = {
|
|
280
|
+
level: Me(s),
|
|
281
|
+
item: a,
|
|
282
282
|
nativeEvent: p,
|
|
283
283
|
syntheticEvent: R,
|
|
284
284
|
target: i.current
|
|
285
285
|
};
|
|
286
|
-
r.onExpandChange.call(void 0,
|
|
286
|
+
r.onExpandChange.call(void 0, F);
|
|
287
287
|
}
|
|
288
288
|
},
|
|
289
289
|
[r.onExpandChange]
|
|
290
|
-
),
|
|
290
|
+
), be = t.useCallback(
|
|
291
291
|
(e) => {
|
|
292
292
|
if (r.onFilterChange && i.current) {
|
|
293
293
|
const s = {
|
|
@@ -296,83 +296,84 @@ const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the
|
|
|
296
296
|
nativeEvent: e.nativeEvent,
|
|
297
297
|
target: i.current
|
|
298
298
|
};
|
|
299
|
-
r.onFilterChange.call(void 0, s), r.filter === void 0 &&
|
|
299
|
+
r.onFilterChange.call(void 0, s), r.filter === void 0 && We(e.target.value);
|
|
300
300
|
}
|
|
301
301
|
},
|
|
302
302
|
[r.onFilterChange, r.filter, r.textField]
|
|
303
303
|
), Ge = () => {
|
|
304
|
-
const e =
|
|
305
|
-
|
|
304
|
+
const e = o.filterable ? /* @__PURE__ */ t.createElement(
|
|
305
|
+
Se,
|
|
306
306
|
{
|
|
307
|
-
value:
|
|
308
|
-
ref:
|
|
309
|
-
onChange:
|
|
310
|
-
onKeyDown:
|
|
311
|
-
size:
|
|
312
|
-
rounded:
|
|
313
|
-
fillMode:
|
|
307
|
+
value: o.filter === void 0 ? ue : o.filter,
|
|
308
|
+
ref: Y,
|
|
309
|
+
onChange: be,
|
|
310
|
+
onKeyDown: pe,
|
|
311
|
+
size: y,
|
|
312
|
+
rounded: B,
|
|
313
|
+
fillMode: W
|
|
314
314
|
}
|
|
315
|
-
) : null,
|
|
316
|
-
adaptiveTitle:
|
|
315
|
+
) : null, a = {
|
|
316
|
+
adaptiveTitle: o.adaptiveTitle,
|
|
317
317
|
expand: l,
|
|
318
|
-
onClose: (s) =>
|
|
319
|
-
windowWidth:
|
|
318
|
+
onClose: (s) => w(s),
|
|
319
|
+
windowWidth: ne,
|
|
320
320
|
mobileFilter: e
|
|
321
321
|
};
|
|
322
|
-
return /* @__PURE__ */ t.createElement(ht, { ...
|
|
323
|
-
|
|
322
|
+
return /* @__PURE__ */ t.createElement(ht, { ...a }, /* @__PURE__ */ t.createElement(yt, { className: "!k-overflow-hidden" }, /* @__PURE__ */ t.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ t.createElement("div", { className: "k-list k-list-lg" }, T.length > 0 ? /* @__PURE__ */ t.createElement(
|
|
323
|
+
Fe,
|
|
324
324
|
{
|
|
325
|
-
ref:
|
|
326
|
-
tabIndex:
|
|
327
|
-
data:
|
|
325
|
+
ref: h,
|
|
326
|
+
tabIndex: X,
|
|
327
|
+
data: he,
|
|
328
328
|
focusIdField: N,
|
|
329
|
-
textField:
|
|
329
|
+
textField: o.textField,
|
|
330
330
|
selectField: z,
|
|
331
|
-
expandField:
|
|
331
|
+
expandField: o.expandField,
|
|
332
332
|
childrenField: K,
|
|
333
333
|
expandIcons: !0,
|
|
334
|
-
onItemClick:
|
|
335
|
-
onExpandChange:
|
|
336
|
-
size:
|
|
337
|
-
item:
|
|
338
|
-
dir:
|
|
334
|
+
onItemClick: me,
|
|
335
|
+
onExpandChange: ge,
|
|
336
|
+
size: y,
|
|
337
|
+
item: o.item,
|
|
338
|
+
dir: k,
|
|
339
|
+
animate: b.animate
|
|
339
340
|
}
|
|
340
|
-
) : /* @__PURE__ */ t.createElement(
|
|
341
|
+
) : /* @__PURE__ */ t.createElement(ye, null, ae.toLanguageString(j, re[j]))))));
|
|
341
342
|
}, Je = t.useCallback(
|
|
342
343
|
(e) => {
|
|
343
|
-
for (let
|
|
344
|
-
|
|
344
|
+
for (let a of e)
|
|
345
|
+
Be(a.target.clientWidth);
|
|
345
346
|
},
|
|
346
347
|
[]
|
|
347
|
-
),
|
|
348
|
-
() =>
|
|
348
|
+
), he = t.useMemo(
|
|
349
|
+
() => C || !L ? T : ot(
|
|
349
350
|
T,
|
|
350
351
|
K,
|
|
351
352
|
(e) => rt(
|
|
352
353
|
e,
|
|
353
354
|
K,
|
|
354
|
-
{ [z]:
|
|
355
|
+
{ [z]: De(e, v, N) }
|
|
355
356
|
)
|
|
356
357
|
),
|
|
357
|
-
[T, v,
|
|
358
|
-
),
|
|
358
|
+
[T, v, C, L, z, K]
|
|
359
|
+
), ye = o.listNoData || ft, Qe = o.valueHolder || wt, ae = st(), Ee = !Pe || ee.valid, { size: y, rounded: B, fillMode: W } = o, Ce = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
359
360
|
"span",
|
|
360
361
|
{
|
|
361
|
-
className:
|
|
362
|
-
[`k-picker-${Ct[
|
|
363
|
-
[`k-rounded-${kt[
|
|
364
|
-
[`k-picker-${
|
|
362
|
+
className: oe("k-dropdowntree k-picker", o.className, {
|
|
363
|
+
[`k-picker-${Ct[y] || y}`]: y,
|
|
364
|
+
[`k-rounded-${kt[B] || B}`]: B,
|
|
365
|
+
[`k-picker-${W}`]: W,
|
|
365
366
|
"k-focus": d,
|
|
366
|
-
"k-invalid": !
|
|
367
|
-
"k-loading":
|
|
368
|
-
"k-required":
|
|
369
|
-
"k-disabled":
|
|
367
|
+
"k-invalid": !Ee,
|
|
368
|
+
"k-loading": o.loading,
|
|
369
|
+
"k-required": Q,
|
|
370
|
+
"k-disabled": o.disabled
|
|
370
371
|
}),
|
|
371
|
-
tabIndex:
|
|
372
|
-
accessKey:
|
|
373
|
-
id:
|
|
372
|
+
tabIndex: X,
|
|
373
|
+
accessKey: o.accessKey,
|
|
374
|
+
id: le,
|
|
374
375
|
style: O ? { ...P, width: void 0 } : P,
|
|
375
|
-
dir:
|
|
376
|
+
dir: k,
|
|
376
377
|
ref: m,
|
|
377
378
|
onKeyDown: I ? void 0 : ze,
|
|
378
379
|
onMouseDown: je,
|
|
@@ -384,23 +385,23 @@ const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the
|
|
|
384
385
|
"aria-expanded": l,
|
|
385
386
|
"aria-disabled": I,
|
|
386
387
|
"aria-label": O,
|
|
387
|
-
"aria-labelledby":
|
|
388
|
-
"aria-describedby":
|
|
389
|
-
"aria-required":
|
|
388
|
+
"aria-labelledby": o.ariaLabelledBy,
|
|
389
|
+
"aria-describedby": o.ariaDescribedBy,
|
|
390
|
+
"aria-required": Q
|
|
390
391
|
},
|
|
391
|
-
/* @__PURE__ */ t.createElement("span", { className: "k-input-inner" }, /* @__PURE__ */ t.createElement(Qe, { item: v },
|
|
392
|
-
|
|
393
|
-
|
|
392
|
+
/* @__PURE__ */ t.createElement("span", { className: "k-input-inner" }, (Z || J) && /* @__PURE__ */ t.createElement(Qe, { item: v }, Z || J)),
|
|
393
|
+
o.loading && /* @__PURE__ */ t.createElement(we, { className: "k-input-loading-icon", name: "loading" }),
|
|
394
|
+
L && !I && /* @__PURE__ */ t.createElement(
|
|
394
395
|
"span",
|
|
395
396
|
{
|
|
396
|
-
onClick:
|
|
397
|
+
onClick: ve,
|
|
397
398
|
className: "k-clear-value",
|
|
398
|
-
title:
|
|
399
|
+
title: ae.toLanguageString(Ie, re[Ie]),
|
|
399
400
|
role: "button",
|
|
400
401
|
tabIndex: -1,
|
|
401
402
|
onMouseDown: (e) => e.preventDefault()
|
|
402
403
|
},
|
|
403
|
-
/* @__PURE__ */ t.createElement(
|
|
404
|
+
/* @__PURE__ */ t.createElement(we, { name: "x", icon: gt })
|
|
404
405
|
),
|
|
405
406
|
/* @__PURE__ */ t.createElement(
|
|
406
407
|
vt,
|
|
@@ -409,8 +410,8 @@ const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the
|
|
|
409
410
|
type: "button",
|
|
410
411
|
"aria-label": "select",
|
|
411
412
|
className: "k-input-button",
|
|
412
|
-
size:
|
|
413
|
-
fillMode:
|
|
413
|
+
size: y,
|
|
414
|
+
fillMode: W,
|
|
414
415
|
themeColor: "base",
|
|
415
416
|
rounded: null,
|
|
416
417
|
icon: "caret-alt-down",
|
|
@@ -427,68 +428,71 @@ const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the
|
|
|
427
428
|
title: O,
|
|
428
429
|
style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" }
|
|
429
430
|
},
|
|
430
|
-
/* @__PURE__ */ t.createElement("option", { value:
|
|
431
|
+
/* @__PURE__ */ t.createElement("option", { value: o.valueMap ? o.valueMap.call(void 0, v) : v })
|
|
431
432
|
),
|
|
432
|
-
!
|
|
433
|
+
!x && /* @__PURE__ */ t.createElement(
|
|
433
434
|
lt,
|
|
434
435
|
{
|
|
435
|
-
...
|
|
436
|
-
className:
|
|
437
|
-
popupClass:
|
|
436
|
+
...b,
|
|
437
|
+
className: oe(b.className, { "k-rtl": k === "rtl" }),
|
|
438
|
+
popupClass: oe(b.popupClass, "k-dropdowntree-popup k-list-container"),
|
|
438
439
|
style: Ke,
|
|
439
|
-
anchor:
|
|
440
|
+
anchor: b.anchor || m.current,
|
|
440
441
|
show: l,
|
|
441
442
|
onOpen: He,
|
|
442
443
|
onClose: _e
|
|
443
444
|
},
|
|
444
|
-
|
|
445
|
-
|
|
445
|
+
o.filterable && /* @__PURE__ */ t.createElement(
|
|
446
|
+
Se,
|
|
446
447
|
{
|
|
447
|
-
value:
|
|
448
|
+
value: o.filter === void 0 ? ue : o.filter,
|
|
448
449
|
ref: S,
|
|
449
|
-
onChange:
|
|
450
|
-
onKeyDown:
|
|
451
|
-
size:
|
|
452
|
-
rounded:
|
|
453
|
-
fillMode:
|
|
450
|
+
onChange: be,
|
|
451
|
+
onKeyDown: pe,
|
|
452
|
+
size: y,
|
|
453
|
+
rounded: B,
|
|
454
|
+
fillMode: W,
|
|
455
|
+
renderListFilterWrapper: !0,
|
|
456
|
+
renderPrefixSeparator: !0
|
|
454
457
|
}
|
|
455
458
|
),
|
|
456
459
|
T.length > 0 ? /* @__PURE__ */ t.createElement(
|
|
457
|
-
|
|
460
|
+
Fe,
|
|
458
461
|
{
|
|
459
|
-
style: { height:
|
|
460
|
-
ref:
|
|
461
|
-
tabIndex:
|
|
462
|
-
data:
|
|
462
|
+
style: { height: b.height },
|
|
463
|
+
ref: h,
|
|
464
|
+
tabIndex: X,
|
|
465
|
+
data: he,
|
|
463
466
|
focusIdField: N,
|
|
464
|
-
textField:
|
|
467
|
+
textField: o.textField,
|
|
465
468
|
selectField: z,
|
|
466
|
-
expandField:
|
|
469
|
+
expandField: o.expandField,
|
|
467
470
|
childrenField: K,
|
|
468
471
|
expandIcons: !0,
|
|
469
|
-
onItemClick:
|
|
470
|
-
onExpandChange:
|
|
471
|
-
size:
|
|
472
|
-
item:
|
|
473
|
-
dir:
|
|
472
|
+
onItemClick: me,
|
|
473
|
+
onExpandChange: ge,
|
|
474
|
+
size: y,
|
|
475
|
+
item: o.item,
|
|
476
|
+
dir: k,
|
|
477
|
+
animate: b.animate
|
|
474
478
|
}
|
|
475
|
-
) : /* @__PURE__ */ t.createElement(
|
|
479
|
+
) : /* @__PURE__ */ t.createElement(ye, null, ae.toLanguageString(j, re[j]))
|
|
476
480
|
)
|
|
477
|
-
),
|
|
481
|
+
), x && Ge());
|
|
478
482
|
return O ? /* @__PURE__ */ t.createElement(
|
|
479
483
|
mt,
|
|
480
484
|
{
|
|
481
485
|
label: O,
|
|
482
|
-
editorValue:
|
|
483
|
-
editorPlaceholder:
|
|
484
|
-
editorValid:
|
|
486
|
+
editorValue: Z,
|
|
487
|
+
editorPlaceholder: J,
|
|
488
|
+
editorValid: Ee,
|
|
485
489
|
editorDisabled: I,
|
|
486
|
-
editorId:
|
|
490
|
+
editorId: le,
|
|
487
491
|
style: { width: P ? P.width : void 0 },
|
|
488
|
-
children:
|
|
489
|
-
dir:
|
|
492
|
+
children: Ce,
|
|
493
|
+
dir: k
|
|
490
494
|
}
|
|
491
|
-
) :
|
|
495
|
+
) : Ce;
|
|
492
496
|
}), It = {
|
|
493
497
|
opened: n.bool,
|
|
494
498
|
disabled: n.bool,
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react");function h(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const p=h(f);function a(t,n,e){const[i,o]=p.useState(n);return p.useEffect(()=>{i!==void 0&&t.current&&o(t.current.offsetWidth)},e),i}function c(t){return typeof t=="string"?Number(t.replace("px","")):t||void 0}function l(t,n,e,i){const o=c(n.popupSettings.width),d=(e.width!==void 0&&c(e.width))!==o,u=i.width!==void 0,s=d?e.width:u?i.width:o,r=c(a(t,s));return d||u?s:r&&o&&r>o?r:o}exports.useDropdownWidth=l;
|