@progress/kendo-react-dropdowns 8.3.0-develop.8 → 8.3.0

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