@progress/kendo-react-dropdowns 14.5.0-develop.14 → 14.5.0-develop.16
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.d.ts +4 -23
- package/AutoComplete/AutoComplete.js +1 -1
- package/AutoComplete/AutoComplete.mjs +206 -196
- package/AutoComplete/AutoCompleteProps.d.ts +12 -0
- package/ComboBox/ComboBox.d.ts +1 -1
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +224 -224
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +253 -252
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +202 -196
- package/DropDownTree/DropDownTreeProps.d.ts +12 -0
- package/MultiSelect/MultiSelect.d.ts +2 -1
- package/MultiSelect/MultiSelect.js +1 -1
- package/MultiSelect/MultiSelect.mjs +182 -175
- package/MultiSelect/TagList.js +1 -1
- package/MultiSelect/TagList.mjs +1 -1
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +237 -221
- package/MultiSelectTree/MultiSelectTreeProps.d.ts +12 -0
- package/common/ClearButton.js +1 -1
- package/common/ClearButton.mjs +6 -7
- package/common/List.d.ts +1 -0
- package/common/List.js +1 -1
- package/common/List.mjs +84 -81
- package/common/ListFilter.js +1 -1
- package/common/ListFilter.mjs +20 -17
- package/common/SearchBar.d.ts +1 -0
- package/common/SearchBar.js +1 -1
- package/common/SearchBar.mjs +7 -7
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/messages/index.d.ts +14 -4
- package/messages/index.js +1 -1
- package/messages/index.mjs +15 -11
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
|
@@ -7,26 +7,26 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import n from "prop-types";
|
|
10
|
-
import { usePropsContext as
|
|
11
|
-
import { Popup as
|
|
12
|
-
import { useLocalization as
|
|
13
|
-
import { TreeView as
|
|
14
|
-
import { packageMetadata as
|
|
15
|
-
import { getItemValue as
|
|
16
|
-
import { useDropdownWidth as
|
|
17
|
-
import { ListNoData as
|
|
18
|
-
import {
|
|
19
|
-
import { FloatingLabel as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { AdaptiveMode as
|
|
24
|
-
import { ActionSheetContent as
|
|
25
|
-
const
|
|
26
|
-
const { validationMessage: a, valid:
|
|
10
|
+
import { usePropsContext as st, validatePackage as ct, getLicenseMessage as ut, useId as dt, noop as Y, getTabIndex as pt, useRtl as ft, useAdaptiveModeContext as mt, canUseDOM as vt, Keys as r, classNames as Z, kendoThemeMaps as gt, IconWrap as ht, WatermarkOverlay as bt, createPropsContext as yt } from "@progress/kendo-react-common";
|
|
11
|
+
import { Popup as Ct } from "@progress/kendo-react-popup";
|
|
12
|
+
import { useLocalization as Et } from "@progress/kendo-react-intl";
|
|
13
|
+
import { TreeView as Me } from "@progress/kendo-react-treeview";
|
|
14
|
+
import { packageMetadata as Re } from "../package-metadata.mjs";
|
|
15
|
+
import { getItemValue as kt, areSame as Ft, matchTags as Le } from "../common/utils.mjs";
|
|
16
|
+
import { useDropdownWidth as xt } from "../DropDownTree/useDropdownWidth.mjs";
|
|
17
|
+
import { ListNoData as St } from "../DropDownTree/ListNoData.mjs";
|
|
18
|
+
import { chipListAriaLabel as Pe, messages as fe, nodata as ee } from "../messages/index.mjs";
|
|
19
|
+
import { FloatingLabel as wt } from "@progress/kendo-react-labels";
|
|
20
|
+
import It from "../MultiSelect/TagList.mjs";
|
|
21
|
+
import Tt from "../common/ClearButton.mjs";
|
|
22
|
+
import Ne from "../common/ListFilter.mjs";
|
|
23
|
+
import { AdaptiveMode as Dt } from "../common/AdaptiveMode.mjs";
|
|
24
|
+
import { ActionSheetContent as Mt } from "@progress/kendo-react-layout";
|
|
25
|
+
const Rt = "Please select a value from the list!", { sizeMap: Oe, roundedMap: Lt } = gt, Pt = (N) => N.split("_").map((M) => parseInt(M, 10)), Nt = (N, M) => {
|
|
26
|
+
const { validationMessage: a, valid: W, required: te } = N;
|
|
27
27
|
return {
|
|
28
28
|
customError: a !== void 0,
|
|
29
|
-
valid: !!(
|
|
29
|
+
valid: !!(W !== void 0 ? W : !te || M),
|
|
30
30
|
valueMissing: !M
|
|
31
31
|
};
|
|
32
32
|
}, b = {
|
|
@@ -43,56 +43,57 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
43
43
|
fillMode: void 0,
|
|
44
44
|
required: !1,
|
|
45
45
|
validityStyles: !0
|
|
46
|
-
},
|
|
46
|
+
}, Ot = yt(), Be = t.forwardRef(
|
|
47
47
|
(N, M) => {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
var Te;
|
|
49
|
+
const a = st(Ot, N), W = !ct(Re, { component: "MultiSelectTree" }), te = ut(Re), Ke = dt(), R = a.id || Ke, ne = `${R}-treeview`, {
|
|
50
|
+
data: z = [],
|
|
50
51
|
dataItemKey: x,
|
|
51
|
-
style:
|
|
52
|
-
placeholder:
|
|
52
|
+
style: O = {},
|
|
53
|
+
placeholder: ae,
|
|
53
54
|
label: B,
|
|
54
|
-
name:
|
|
55
|
+
name: Ve,
|
|
55
56
|
validationMessage: q,
|
|
56
|
-
valid:
|
|
57
|
-
tags:
|
|
57
|
+
valid: We,
|
|
58
|
+
tags: me,
|
|
58
59
|
value: m,
|
|
59
60
|
opened: S,
|
|
60
|
-
disabled:
|
|
61
|
-
popupSettings:
|
|
62
|
-
checkField:
|
|
63
|
-
checkIndeterminateField:
|
|
64
|
-
subItemsField:
|
|
65
|
-
size:
|
|
61
|
+
disabled: y,
|
|
62
|
+
popupSettings: L = b.popupSettings,
|
|
63
|
+
checkField: ve = b.checkField,
|
|
64
|
+
checkIndeterminateField: ge = b.checkIndeterminateField,
|
|
65
|
+
subItemsField: he = b.subItemsField,
|
|
66
|
+
size: C = b.size,
|
|
66
67
|
rounded: K = b.rounded,
|
|
67
|
-
fillMode:
|
|
68
|
-
required:
|
|
69
|
-
validityStyles:
|
|
70
|
-
onOpen:
|
|
71
|
-
onClose:
|
|
72
|
-
} = a,
|
|
73
|
-
width:
|
|
68
|
+
fillMode: A = b.fillMode,
|
|
69
|
+
required: ie = b.required,
|
|
70
|
+
validityStyles: ze = b.validityStyles,
|
|
71
|
+
onOpen: re = Y,
|
|
72
|
+
onClose: $ = Y
|
|
73
|
+
} = a, H = pt(a.tabIndex, y), o = t.useRef(null), E = t.useRef(null), w = t.useRef(null), oe = t.useRef(null), G = t.useRef(null), k = t.useRef(null), _ = t.useRef(!1), j = t.useRef([]), U = t.useRef(null), [P, qe] = t.useState(), [Ae, be] = t.useState(!1), [d, le] = t.useState(!1), [se, $e] = t.useState(), [He, Ge] = t.useState([]), [ye, _e] = t.useState(""), s = S !== void 0 ? S : Ae, ce = !!(Array.isArray(m) && m.length), ue = Nt({ validationMessage: q, valid: We, required: ie }, ce), I = ft(E, a.dir), je = {
|
|
74
|
+
width: xt(E, b, L, O),
|
|
74
75
|
...I !== void 0 ? { direction: I } : {}
|
|
75
|
-
},
|
|
76
|
-
|
|
76
|
+
}, Ue = t.useCallback(() => E.current && E.current.focus(), []), Ce = mt(), T = !!(se && Ce && se <= Ce.medium && a.adaptive);
|
|
77
|
+
j.current = me === void 0 ? (m || []).map((e) => ({ text: kt(e, a.textField), data: [e] })) : [...me], t.useImperativeHandle(o, () => ({
|
|
77
78
|
props: a,
|
|
78
|
-
element:
|
|
79
|
-
focus:
|
|
79
|
+
element: E.current,
|
|
80
|
+
focus: Ue
|
|
80
81
|
})), t.useImperativeHandle(
|
|
81
82
|
M,
|
|
82
83
|
() => o.current
|
|
83
84
|
);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
const Je = t.useCallback(() => {
|
|
86
|
+
G.current && G.current.setCustomValidity && G.current.setCustomValidity(
|
|
87
|
+
ue.valid ? "" : q === void 0 ? Rt : q
|
|
87
88
|
);
|
|
88
|
-
}, [q,
|
|
89
|
-
t.useEffect(
|
|
90
|
-
const e =
|
|
89
|
+
}, [q, ue]);
|
|
90
|
+
t.useEffect(Je), t.useEffect(() => {
|
|
91
|
+
const e = vt && window.ResizeObserver && new window.ResizeObserver(rt.bind(void 0));
|
|
91
92
|
return document != null && document.body && e && e.observe(document.body), () => {
|
|
92
93
|
e && e.disconnect();
|
|
93
94
|
};
|
|
94
95
|
}, []), t.useEffect(() => {
|
|
95
|
-
|
|
96
|
+
U.current && s && U.current.setPosition(U.current.element);
|
|
96
97
|
}, [m, s]);
|
|
97
98
|
const F = t.useCallback(
|
|
98
99
|
(e, i, l) => {
|
|
@@ -106,9 +107,9 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
106
107
|
}
|
|
107
108
|
},
|
|
108
109
|
[a.onChange]
|
|
109
|
-
),
|
|
110
|
+
), J = t.useCallback(
|
|
110
111
|
(e) => {
|
|
111
|
-
if (
|
|
112
|
+
if (Ft(e.item, m, x) || !o.current)
|
|
112
113
|
return;
|
|
113
114
|
const { item: i, nativeEvent: l, syntheticEvent: h } = e, D = {
|
|
114
115
|
syntheticEvent: h,
|
|
@@ -118,46 +119,46 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
118
119
|
F(D, [i], "toggle");
|
|
119
120
|
},
|
|
120
121
|
[m, x, F]
|
|
121
|
-
),
|
|
122
|
+
), Q = t.useCallback(
|
|
122
123
|
(e) => {
|
|
123
124
|
if (!s) {
|
|
124
|
-
if (
|
|
125
|
+
if (re) {
|
|
125
126
|
const i = { ...e };
|
|
126
|
-
|
|
127
|
+
re.call(void 0, i);
|
|
127
128
|
}
|
|
128
|
-
S === void 0 && (
|
|
129
|
+
S === void 0 && (be(!0), Ge(m || []), T && setTimeout(() => {
|
|
129
130
|
var i;
|
|
130
|
-
u((i =
|
|
131
|
+
u((i = oe.current) == null ? void 0 : i.element);
|
|
131
132
|
}, 300));
|
|
132
133
|
}
|
|
133
134
|
},
|
|
134
|
-
[s, S,
|
|
135
|
-
),
|
|
135
|
+
[s, S, re, T, oe]
|
|
136
|
+
), v = t.useCallback(
|
|
136
137
|
(e) => {
|
|
137
138
|
if (s) {
|
|
138
|
-
if (
|
|
139
|
+
if ($) {
|
|
139
140
|
const i = { ...e };
|
|
140
|
-
|
|
141
|
+
$.call(void 0, i);
|
|
141
142
|
}
|
|
142
|
-
S === void 0 &&
|
|
143
|
+
S === void 0 && be(!1);
|
|
143
144
|
}
|
|
144
145
|
},
|
|
145
|
-
[s, S,
|
|
146
|
-
),
|
|
147
|
-
|
|
146
|
+
[s, S, $]
|
|
147
|
+
), g = t.useCallback((e) => {
|
|
148
|
+
_.current = !0, e(), window.setTimeout(() => _.current = !1, 0);
|
|
148
149
|
}, []), u = t.useCallback(
|
|
149
150
|
(e) => {
|
|
150
|
-
e &&
|
|
151
|
+
e && g(() => e.focus());
|
|
151
152
|
},
|
|
152
|
-
[
|
|
153
|
-
),
|
|
153
|
+
[g]
|
|
154
|
+
), Qe = t.useCallback(() => {
|
|
154
155
|
var e;
|
|
155
|
-
!d && s ?
|
|
156
|
-
}, [d, s, u,
|
|
157
|
-
d && u(
|
|
158
|
-
}, [d, u]),
|
|
156
|
+
!d && s ? v({ target: o.current }) : a.filterable ? u((e = w.current) == null ? void 0 : e.element) : u(k.current && k.current.element);
|
|
157
|
+
}, [d, s, u, v, a.filterable]), Xe = t.useCallback(() => {
|
|
158
|
+
d && u(E.current);
|
|
159
|
+
}, [d, u]), Ye = t.useCallback(
|
|
159
160
|
(e) => {
|
|
160
|
-
if (!d && !
|
|
161
|
+
if (!d && !_.current && (le(!0), a.onFocus && o.current)) {
|
|
161
162
|
const i = {
|
|
162
163
|
syntheticEvent: e,
|
|
163
164
|
nativeEvent: e.nativeEvent,
|
|
@@ -167,10 +168,10 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
167
168
|
}
|
|
168
169
|
},
|
|
169
170
|
[d, a.onFocus]
|
|
170
|
-
),
|
|
171
|
+
), Ze = t.useCallback(
|
|
171
172
|
(e) => {
|
|
172
|
-
if (d && !
|
|
173
|
-
|
|
173
|
+
if (d && !_.current && o.current) {
|
|
174
|
+
le(!1);
|
|
174
175
|
const i = {
|
|
175
176
|
syntheticEvent: e,
|
|
176
177
|
nativeEvent: e.nativeEvent,
|
|
@@ -180,28 +181,28 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
180
181
|
const l = { ...i };
|
|
181
182
|
a.onBlur.call(void 0, l);
|
|
182
183
|
}
|
|
183
|
-
T ||
|
|
184
|
+
T || v(i);
|
|
184
185
|
}
|
|
185
186
|
},
|
|
186
|
-
[d, a.onBlur, s, S,
|
|
187
|
-
),
|
|
188
|
-
d &&
|
|
189
|
-
}, [d,
|
|
187
|
+
[d, a.onBlur, s, S, $]
|
|
188
|
+
), et = t.useCallback(() => {
|
|
189
|
+
d && g(Y);
|
|
190
|
+
}, [d, g]), Ee = t.useCallback(
|
|
190
191
|
(e) => {
|
|
191
192
|
if (!e.isDefaultPrevented() && o.current) {
|
|
192
|
-
|
|
193
|
+
le(!0);
|
|
193
194
|
const i = {
|
|
194
195
|
syntheticEvent: e,
|
|
195
196
|
nativeEvent: e.nativeEvent,
|
|
196
197
|
target: o.current
|
|
197
198
|
};
|
|
198
|
-
s ||
|
|
199
|
+
s || Q(i);
|
|
199
200
|
}
|
|
200
201
|
},
|
|
201
|
-
[s,
|
|
202
|
-
),
|
|
202
|
+
[s, Q]
|
|
203
|
+
), tt = t.useCallback(
|
|
203
204
|
(e) => {
|
|
204
|
-
var X,
|
|
205
|
+
var X, De;
|
|
205
206
|
const { keyCode: i, altKey: l } = e, h = k.current && k.current.element;
|
|
206
207
|
if (!o.current || e.isDefaultPrevented() && ((X = w.current) == null ? void 0 : X.element) === e.target)
|
|
207
208
|
return;
|
|
@@ -211,45 +212,45 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
211
212
|
target: o.current
|
|
212
213
|
};
|
|
213
214
|
if (m && m.length > 0 && (i === r.left || i === r.right || i === r.home || i === r.end || i === r.delete)) {
|
|
214
|
-
const c =
|
|
215
|
-
let p = P ? c.findIndex((
|
|
216
|
-
const
|
|
217
|
-
i === r.left ? (
|
|
215
|
+
const c = j.current;
|
|
216
|
+
let p = P ? c.findIndex((lt) => Le(lt, P, x)) : -1, f;
|
|
217
|
+
const pe = p !== -1;
|
|
218
|
+
i === r.left ? (pe ? p = Math.max(0, p - 1) : p = c.length - 1, f = c[p]) : i === r.right ? p === c.length - 1 ? f = void 0 : pe && (p = Math.min(c.length - 1, p + 1), f = c[p]) : i === r.home ? f = c[0] : i === r.end ? f = c[c.length - 1] : i === r.delete && pe && F(D, c[p].data, "delete"), f !== P && qe(f);
|
|
218
219
|
}
|
|
219
220
|
if (s)
|
|
220
221
|
if (i === r.esc || l && i === r.up)
|
|
221
|
-
e.preventDefault(),
|
|
222
|
+
e.preventDefault(), v(D);
|
|
222
223
|
else if (h && h.querySelector(".k-focus") && (i === r.up || i === r.down || i === r.left || i === r.right || i === r.home || i === r.end)) {
|
|
223
|
-
if (i === r.up && ((
|
|
224
|
+
if (i === r.up && ((De = w.current) != null && De.element)) {
|
|
224
225
|
const c = Array.from(h.querySelectorAll(".k-treeview-item")), p = [...c].reverse().find((f) => !!(f && f.querySelector(".k-focus")));
|
|
225
226
|
if (p && c.indexOf(p) === 0)
|
|
226
|
-
return
|
|
227
|
+
return g(() => {
|
|
227
228
|
var f;
|
|
228
229
|
u((f = w.current) == null ? void 0 : f.element);
|
|
229
230
|
});
|
|
230
231
|
}
|
|
231
|
-
|
|
232
|
-
} else i === r.down &&
|
|
232
|
+
g(Y);
|
|
233
|
+
} else i === r.down && g(() => {
|
|
233
234
|
var c;
|
|
234
235
|
u(((c = w.current) == null ? void 0 : c.element) || h);
|
|
235
236
|
});
|
|
236
237
|
else
|
|
237
|
-
l && i === r.down && (e.preventDefault(),
|
|
238
|
+
l && i === r.down && (e.preventDefault(), Q(D));
|
|
238
239
|
},
|
|
239
|
-
[s,
|
|
240
|
-
),
|
|
240
|
+
[s, v, u, g, Q, P, x, m, F]
|
|
241
|
+
), ke = t.useCallback(
|
|
241
242
|
(e) => {
|
|
242
243
|
const { keyCode: i, altKey: l } = e;
|
|
243
|
-
l || i !== r.up && i !== r.down || (e.preventDefault(),
|
|
244
|
+
l || i !== r.up && i !== r.down || (e.preventDefault(), g(
|
|
244
245
|
i === r.up ? () => {
|
|
245
|
-
u(
|
|
246
|
+
u(E.current);
|
|
246
247
|
} : () => {
|
|
247
248
|
u(k.current && k.current.element);
|
|
248
249
|
}
|
|
249
250
|
));
|
|
250
251
|
},
|
|
251
|
-
[u,
|
|
252
|
-
),
|
|
252
|
+
[u, g]
|
|
253
|
+
), nt = t.useCallback(
|
|
253
254
|
(e) => {
|
|
254
255
|
if (!o.current)
|
|
255
256
|
return;
|
|
@@ -258,13 +259,13 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
258
259
|
nativeEvent: e.nativeEvent,
|
|
259
260
|
target: o.current
|
|
260
261
|
};
|
|
261
|
-
F(i, [], "clear"),
|
|
262
|
+
F(i, [], "clear"), v(i), e.preventDefault();
|
|
262
263
|
},
|
|
263
|
-
[F,
|
|
264
|
-
),
|
|
264
|
+
[F, v]
|
|
265
|
+
), at = t.useCallback(
|
|
265
266
|
(e, i) => {
|
|
266
267
|
var l;
|
|
267
|
-
|
|
268
|
+
v({ target: o.current }), d || u((l = w.current) == null ? void 0 : l.element), F(
|
|
268
269
|
{
|
|
269
270
|
syntheticEvent: i,
|
|
270
271
|
nativeEvent: i.nativeEvent,
|
|
@@ -274,12 +275,12 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
274
275
|
"delete"
|
|
275
276
|
);
|
|
276
277
|
},
|
|
277
|
-
[F,
|
|
278
|
-
),
|
|
278
|
+
[F, v, u, d]
|
|
279
|
+
), Fe = t.useCallback(
|
|
279
280
|
(e) => {
|
|
280
281
|
if (a.onExpandChange && o.current) {
|
|
281
282
|
const { item: i, itemHierarchicalIndex: l, nativeEvent: h, syntheticEvent: D } = e, X = {
|
|
282
|
-
level:
|
|
283
|
+
level: Pt(l),
|
|
283
284
|
item: i,
|
|
284
285
|
nativeEvent: h,
|
|
285
286
|
syntheticEvent: D,
|
|
@@ -289,7 +290,7 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
289
290
|
}
|
|
290
291
|
},
|
|
291
292
|
[a.onExpandChange]
|
|
292
|
-
),
|
|
293
|
+
), xe = t.useCallback(
|
|
293
294
|
(e) => {
|
|
294
295
|
if (a.onFilterChange && o.current) {
|
|
295
296
|
const l = {
|
|
@@ -302,7 +303,7 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
302
303
|
nativeEvent: e.nativeEvent,
|
|
303
304
|
target: o.current
|
|
304
305
|
};
|
|
305
|
-
a.onFilterChange.call(void 0, l), a.filter === void 0 &&
|
|
306
|
+
a.onFilterChange.call(void 0, l), a.filter === void 0 && _e(e.target.value);
|
|
306
307
|
}
|
|
307
308
|
},
|
|
308
309
|
[a.onFilterChange, a.filter, a.textField]
|
|
@@ -316,122 +317,136 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
316
317
|
nativeEvent: e.nativeEvent,
|
|
317
318
|
target: o.current
|
|
318
319
|
};
|
|
319
|
-
a.onCancel && a.onCancel.call(void 0, i),
|
|
320
|
+
a.onCancel && a.onCancel.call(void 0, i), v(i), e.preventDefault();
|
|
320
321
|
},
|
|
321
|
-
[a.onCancel,
|
|
322
|
+
[a.onCancel, v]
|
|
322
323
|
);
|
|
323
|
-
const
|
|
324
|
+
const it = () => {
|
|
324
325
|
const e = a.filterable ? /* @__PURE__ */ t.createElement(
|
|
325
|
-
|
|
326
|
+
Ne,
|
|
326
327
|
{
|
|
327
|
-
value: a.filter === void 0 ?
|
|
328
|
-
ref:
|
|
329
|
-
onChange:
|
|
330
|
-
onKeyDown:
|
|
328
|
+
value: a.filter === void 0 ? ye : a.filter,
|
|
329
|
+
ref: oe,
|
|
330
|
+
onChange: xe,
|
|
331
|
+
onKeyDown: ke,
|
|
331
332
|
size: "large",
|
|
332
333
|
rounded: K,
|
|
333
|
-
fillMode:
|
|
334
|
-
placeholder:
|
|
334
|
+
fillMode: A,
|
|
335
|
+
placeholder: ae
|
|
335
336
|
}
|
|
336
337
|
) : null, i = {
|
|
337
338
|
title: a.adaptiveTitle || a.label,
|
|
338
339
|
subTitle: a.adaptiveSubtitle,
|
|
339
340
|
expand: s,
|
|
340
|
-
onClose: (l) =>
|
|
341
|
-
windowWidth:
|
|
341
|
+
onClose: (l) => v(l),
|
|
342
|
+
windowWidth: se,
|
|
342
343
|
mobileFilter: e
|
|
343
344
|
};
|
|
344
|
-
return /* @__PURE__ */ t.createElement(
|
|
345
|
-
|
|
345
|
+
return /* @__PURE__ */ t.createElement(Dt, { ...i }, /* @__PURE__ */ t.createElement(Mt, null, z.length > 0 ? /* @__PURE__ */ t.createElement(
|
|
346
|
+
Me,
|
|
346
347
|
{
|
|
348
|
+
id: ne,
|
|
347
349
|
ref: k,
|
|
348
350
|
animate: !1,
|
|
349
|
-
tabIndex:
|
|
350
|
-
data:
|
|
351
|
+
tabIndex: H,
|
|
352
|
+
data: z,
|
|
351
353
|
focusIdField: x,
|
|
352
354
|
textField: a.textField,
|
|
353
|
-
checkField:
|
|
354
|
-
checkIndeterminateField:
|
|
355
|
+
checkField: ve,
|
|
356
|
+
checkIndeterminateField: ge,
|
|
355
357
|
expandField: a.expandField,
|
|
356
|
-
childrenField:
|
|
358
|
+
childrenField: he,
|
|
357
359
|
expandIcons: !0,
|
|
358
|
-
onItemClick:
|
|
359
|
-
onCheckChange:
|
|
360
|
-
onExpandChange:
|
|
360
|
+
onItemClick: J,
|
|
361
|
+
onCheckChange: J,
|
|
362
|
+
onExpandChange: Fe,
|
|
361
363
|
checkboxes: !0,
|
|
362
364
|
size: "large",
|
|
363
365
|
item: a.item,
|
|
364
366
|
dir: I
|
|
365
367
|
}
|
|
366
|
-
) : /* @__PURE__ */ t.createElement(
|
|
367
|
-
},
|
|
368
|
+
) : /* @__PURE__ */ t.createElement(Se, null, de.toLanguageString(ee, fe[ee]))));
|
|
369
|
+
}, rt = t.useCallback((e) => {
|
|
368
370
|
for (const i of e)
|
|
369
|
-
|
|
370
|
-
}, []),
|
|
371
|
+
$e(i.target.clientWidth);
|
|
372
|
+
}, []), Se = a.listNoData || St, de = Et(), we = !ze || ue.valid, V = T && s ? He : j.current, ot = (Te = a.ariaDescribedBy) != null ? Te : V.length > 0 ? "tagslist-" + R : void 0, Ie = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
371
373
|
"span",
|
|
372
374
|
{
|
|
373
375
|
className: Z("k-multiselecttree k-input", a.className, {
|
|
374
|
-
[`k-input-${
|
|
375
|
-
[`k-rounded-${
|
|
376
|
-
[`k-input-${
|
|
377
|
-
"k-focus": d && !
|
|
378
|
-
"k-invalid": !
|
|
379
|
-
"k-disabled":
|
|
376
|
+
[`k-input-${Oe[C] || C}`]: C,
|
|
377
|
+
[`k-rounded-${Lt[K] || K}`]: K,
|
|
378
|
+
[`k-input-${A}`]: A,
|
|
379
|
+
"k-focus": d && !y,
|
|
380
|
+
"k-invalid": !we,
|
|
381
|
+
"k-disabled": y,
|
|
380
382
|
"k-loading": a.loading,
|
|
381
|
-
"k-required":
|
|
383
|
+
"k-required": ie
|
|
382
384
|
}),
|
|
383
|
-
tabIndex:
|
|
385
|
+
tabIndex: H,
|
|
384
386
|
accessKey: a.accessKey,
|
|
385
|
-
id:
|
|
386
|
-
style: B ? { ...
|
|
387
|
+
id: R,
|
|
388
|
+
style: B ? { ...O, width: void 0 } : O,
|
|
387
389
|
dir: I,
|
|
388
|
-
ref:
|
|
389
|
-
onKeyDown:
|
|
390
|
-
onMouseDown:
|
|
390
|
+
ref: E,
|
|
391
|
+
onKeyDown: y ? void 0 : tt,
|
|
392
|
+
onMouseDown: et,
|
|
391
393
|
onFocus: (e) => {
|
|
392
|
-
T ?
|
|
394
|
+
T ? Ee(e) : Ye(e);
|
|
393
395
|
},
|
|
394
|
-
onBlur:
|
|
395
|
-
|
|
396
|
-
"aria-haspopup": "tree",
|
|
397
|
-
"aria-expanded": s,
|
|
398
|
-
"aria-disabled": E,
|
|
399
|
-
"aria-label": B,
|
|
396
|
+
onBlur: Ze,
|
|
397
|
+
"aria-disabled": y || void 0,
|
|
400
398
|
"aria-labelledby": a.ariaLabelledBy,
|
|
401
|
-
|
|
402
|
-
"aria-required": a.required,
|
|
403
|
-
onClick: E ? void 0 : be
|
|
399
|
+
onClick: y ? void 0 : Ee
|
|
404
400
|
},
|
|
405
401
|
/* @__PURE__ */ t.createElement(
|
|
406
402
|
"div",
|
|
407
403
|
{
|
|
408
|
-
id: "tagslist-" +
|
|
404
|
+
id: "tagslist-" + R,
|
|
409
405
|
className: Z("k-input-values k-chip-list", {
|
|
410
|
-
[`k-chip-list-${
|
|
411
|
-
})
|
|
406
|
+
[`k-chip-list-${Oe[C] || C}`]: C
|
|
407
|
+
}),
|
|
408
|
+
role: "listbox",
|
|
409
|
+
"aria-label": de.toLanguageString(Pe, fe[Pe]),
|
|
410
|
+
"aria-orientation": "horizontal"
|
|
412
411
|
},
|
|
413
|
-
|
|
414
|
-
|
|
412
|
+
V.length > 0 && /* @__PURE__ */ t.createElement(
|
|
413
|
+
It,
|
|
415
414
|
{
|
|
416
415
|
tag: a.tag,
|
|
417
|
-
onTagDelete:
|
|
418
|
-
data:
|
|
419
|
-
guid:
|
|
420
|
-
focused: P ?
|
|
421
|
-
(e) =>
|
|
416
|
+
onTagDelete: at,
|
|
417
|
+
data: V,
|
|
418
|
+
guid: R,
|
|
419
|
+
focused: P ? j.current.find(
|
|
420
|
+
(e) => Le(e, P, x)
|
|
422
421
|
) : void 0,
|
|
423
|
-
size:
|
|
422
|
+
size: C
|
|
424
423
|
}
|
|
425
424
|
)
|
|
426
425
|
),
|
|
427
|
-
/* @__PURE__ */ t.createElement(
|
|
428
|
-
|
|
429
|
-
|
|
426
|
+
/* @__PURE__ */ t.createElement(
|
|
427
|
+
"span",
|
|
428
|
+
{
|
|
429
|
+
className: "k-input-inner",
|
|
430
|
+
role: "combobox",
|
|
431
|
+
"aria-haspopup": "tree",
|
|
432
|
+
"aria-expanded": s,
|
|
433
|
+
"aria-autocomplete": "list",
|
|
434
|
+
"aria-label": a.ariaLabel || B,
|
|
435
|
+
"aria-controls": s ? ne : void 0,
|
|
436
|
+
"aria-describedby": ot,
|
|
437
|
+
"aria-disabled": y ? !0 : void 0,
|
|
438
|
+
"aria-required": ie || void 0,
|
|
439
|
+
tabIndex: 0
|
|
440
|
+
},
|
|
441
|
+
V.length === 0 && /* @__PURE__ */ t.createElement("span", { className: "k-input-value-text" }, ae)
|
|
442
|
+
),
|
|
443
|
+
a.loading && /* @__PURE__ */ t.createElement(ht, { className: "k-input-loading-icon", name: "loading" }),
|
|
444
|
+
ce && !y && V.length > 0 && /* @__PURE__ */ t.createElement(Tt, { onClick: nt }),
|
|
430
445
|
/* @__PURE__ */ t.createElement(
|
|
431
446
|
"select",
|
|
432
447
|
{
|
|
433
|
-
name:
|
|
434
|
-
ref:
|
|
448
|
+
name: Ve,
|
|
449
|
+
ref: G,
|
|
435
450
|
tabIndex: -1,
|
|
436
451
|
"aria-hidden": !0,
|
|
437
452
|
title: B,
|
|
@@ -440,76 +455,77 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
440
455
|
/* @__PURE__ */ t.createElement("option", { value: a.valueMap ? a.valueMap.call(void 0, m) : m })
|
|
441
456
|
),
|
|
442
457
|
!T && /* @__PURE__ */ t.createElement(
|
|
443
|
-
|
|
458
|
+
Ct,
|
|
444
459
|
{
|
|
445
|
-
...
|
|
446
|
-
popupClass: Z(
|
|
447
|
-
className: Z(
|
|
448
|
-
style:
|
|
449
|
-
anchor:
|
|
460
|
+
...L,
|
|
461
|
+
popupClass: Z(L.popupClass, "k-multiselecttree-popup"),
|
|
462
|
+
className: Z(L.className, { "k-rtl": I === "rtl" }),
|
|
463
|
+
style: je,
|
|
464
|
+
anchor: L.anchor || E.current,
|
|
450
465
|
show: s,
|
|
451
|
-
onOpen:
|
|
452
|
-
onClose:
|
|
453
|
-
ref:
|
|
466
|
+
onOpen: Qe,
|
|
467
|
+
onClose: Xe,
|
|
468
|
+
ref: U
|
|
454
469
|
},
|
|
455
470
|
a.filterable && /* @__PURE__ */ t.createElement(
|
|
456
|
-
|
|
471
|
+
Ne,
|
|
457
472
|
{
|
|
458
|
-
value: a.filter === void 0 ?
|
|
473
|
+
value: a.filter === void 0 ? ye : a.filter,
|
|
459
474
|
ref: w,
|
|
460
|
-
onChange:
|
|
461
|
-
onKeyDown:
|
|
462
|
-
tabIndex:
|
|
463
|
-
size:
|
|
475
|
+
onChange: xe,
|
|
476
|
+
onKeyDown: ke,
|
|
477
|
+
tabIndex: H,
|
|
478
|
+
size: C,
|
|
464
479
|
rounded: K,
|
|
465
|
-
fillMode:
|
|
480
|
+
fillMode: A,
|
|
466
481
|
renderListFilterWrapper: !0,
|
|
467
482
|
renderPrefixSeparator: !0
|
|
468
483
|
}
|
|
469
484
|
),
|
|
470
|
-
|
|
471
|
-
|
|
485
|
+
z.length > 0 ? /* @__PURE__ */ t.createElement(
|
|
486
|
+
Me,
|
|
472
487
|
{
|
|
473
|
-
|
|
488
|
+
id: ne,
|
|
489
|
+
style: { height: L.height },
|
|
474
490
|
animate: !1,
|
|
475
491
|
ref: k,
|
|
476
|
-
tabIndex:
|
|
477
|
-
data:
|
|
492
|
+
tabIndex: H,
|
|
493
|
+
data: z,
|
|
478
494
|
focusIdField: x,
|
|
479
495
|
textField: a.textField,
|
|
480
|
-
checkField:
|
|
481
|
-
checkIndeterminateField:
|
|
496
|
+
checkField: ve,
|
|
497
|
+
checkIndeterminateField: ge,
|
|
482
498
|
expandField: a.expandField,
|
|
483
|
-
childrenField:
|
|
499
|
+
childrenField: he,
|
|
484
500
|
expandIcons: !0,
|
|
485
|
-
onItemClick:
|
|
486
|
-
onCheckChange:
|
|
487
|
-
onExpandChange:
|
|
501
|
+
onItemClick: J,
|
|
502
|
+
onCheckChange: J,
|
|
503
|
+
onExpandChange: Fe,
|
|
488
504
|
checkboxes: !0,
|
|
489
|
-
size:
|
|
505
|
+
size: C,
|
|
490
506
|
item: a.item,
|
|
491
507
|
dir: I
|
|
492
508
|
}
|
|
493
|
-
) : /* @__PURE__ */ t.createElement(
|
|
494
|
-
|
|
509
|
+
) : /* @__PURE__ */ t.createElement(Se, null, de.toLanguageString(ee, fe[ee])),
|
|
510
|
+
W && /* @__PURE__ */ t.createElement(bt, { message: te })
|
|
495
511
|
)
|
|
496
|
-
), T &&
|
|
512
|
+
), T && it());
|
|
497
513
|
return B ? /* @__PURE__ */ t.createElement(
|
|
498
|
-
|
|
514
|
+
wt,
|
|
499
515
|
{
|
|
500
516
|
label: B,
|
|
501
|
-
editorValue:
|
|
502
|
-
editorPlaceholder:
|
|
503
|
-
editorValid:
|
|
504
|
-
editorDisabled:
|
|
505
|
-
editorId:
|
|
506
|
-
style: { width:
|
|
507
|
-
children:
|
|
517
|
+
editorValue: ce,
|
|
518
|
+
editorPlaceholder: ae,
|
|
519
|
+
editorValid: we,
|
|
520
|
+
editorDisabled: y,
|
|
521
|
+
editorId: R,
|
|
522
|
+
style: { width: O ? O.width : void 0 },
|
|
523
|
+
children: Ie,
|
|
508
524
|
dir: I
|
|
509
525
|
}
|
|
510
|
-
) :
|
|
526
|
+
) : Ie;
|
|
511
527
|
}
|
|
512
|
-
),
|
|
528
|
+
), Bt = {
|
|
513
529
|
opened: n.bool,
|
|
514
530
|
disabled: n.bool,
|
|
515
531
|
dir: n.string,
|
|
@@ -573,9 +589,9 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
573
589
|
adaptiveSubtitle: n.string,
|
|
574
590
|
adaptive: n.bool
|
|
575
591
|
};
|
|
576
|
-
|
|
577
|
-
|
|
592
|
+
Be.displayName = "KendoReactMultiSelectTree";
|
|
593
|
+
Be.propTypes = Bt;
|
|
578
594
|
export {
|
|
579
|
-
|
|
580
|
-
|
|
595
|
+
Be as MultiSelectTree,
|
|
596
|
+
Ot as MultiSelectTreePropsContext
|
|
581
597
|
};
|