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