@progress/kendo-react-dropdowns 9.2.0-develop.7 → 9.2.0-develop.9
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/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +132 -128
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +242 -242
- package/index.d.ts +242 -242
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as i from "react";
|
|
10
10
|
import k from "prop-types";
|
|
11
|
-
import { validatePackage as Gt, useUnstyled as Yt, useId as $t, usePropsContext as jt, canUseDOM as rt, useAdaptiveModeContext as Jt, classNames as C, uDropDownList as b, getTabIndex as Qt, IconWrap as Xt, svgIconPropType as Zt, createPropsContext as Rt, Keys as w, uDropDownsActionSheet as
|
|
11
|
+
import { validatePackage as Gt, useUnstyled as Yt, useId as $t, usePropsContext as jt, canUseDOM as rt, useAdaptiveModeContext as Jt, classNames as C, uDropDownList as b, getTabIndex as Qt, IconWrap as Xt, svgIconPropType as Zt, createPropsContext as Rt, Keys as w, uDropDownsActionSheet as J } from "@progress/kendo-react-common";
|
|
12
12
|
import { FloatingLabel as en } from "@progress/kendo-react-labels";
|
|
13
13
|
import { caretAltDownIcon as tn, xIcon as nn } from "@progress/kendo-svg-icons";
|
|
14
14
|
import rn from "../common/ListContainer.mjs";
|
|
@@ -17,25 +17,26 @@ import ot from "../common/GroupStickyHeader.mjs";
|
|
|
17
17
|
import an from "../common/ListDefaultItem.mjs";
|
|
18
18
|
import ln from "../common/List.mjs";
|
|
19
19
|
import dt from "../common/DropDownBase.mjs";
|
|
20
|
-
import { getFilteredData as P, areSame as N, getItemValue as
|
|
20
|
+
import { getFilteredData as P, areSame as N, getItemValue as fe, isPresent as it, itemIndexStartsWith as sn, sameCharsOnly as dn, shuffleData as cn, matchText as at } from "../common/utils.mjs";
|
|
21
21
|
import { packageMetadata as un } from "../package-metadata.mjs";
|
|
22
22
|
import { Button as lt } from "@progress/kendo-react-buttons";
|
|
23
23
|
import { useLocalization as pn } from "@progress/kendo-react-intl";
|
|
24
24
|
import { dropDownListArrowBtnAriaLabel as st, messages as mn } from "../messages/index.mjs";
|
|
25
25
|
import { ActionSheet as fn, ActionSheetHeader as vn, ActionSheetContent as gn } from "@progress/kendo-react-layout";
|
|
26
|
-
const
|
|
26
|
+
const hn = "Please select a value from the list!", Te = i.forwardRef((E, ct) => {
|
|
27
27
|
Gt(un);
|
|
28
|
-
const F = Yt(),
|
|
28
|
+
const F = Yt(), ve = $t(E.id), r = jt(In, E), {
|
|
29
29
|
delay: ut = z.delay,
|
|
30
30
|
tabIndex: pt = z.tabIndex,
|
|
31
|
-
ignoreCase:
|
|
32
|
-
size:
|
|
31
|
+
ignoreCase: ge = z.ignoreCase,
|
|
32
|
+
size: Q = z.size,
|
|
33
33
|
rounded: ze = z.rounded,
|
|
34
34
|
fillMode: he = z.fillMode,
|
|
35
35
|
groupMode: yn = z.groupMode
|
|
36
|
-
} = r,
|
|
36
|
+
} = r, Ie = () => {
|
|
37
|
+
var e;
|
|
37
38
|
if (rt)
|
|
38
|
-
return
|
|
39
|
+
return ((e = Z.current) == null ? void 0 : e.ownerDocument) || window.document;
|
|
39
40
|
}, mt = () => {
|
|
40
41
|
var e, n;
|
|
41
42
|
(e = t == null ? void 0 : t.current) != null && e.wrapper && ((n = t == null ? void 0 : t.current) == null || n.wrapper.focus({ preventScroll: !0 }));
|
|
@@ -45,16 +46,16 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
45
46
|
}, ft = () => {
|
|
46
47
|
const { dataItemKey: e } = r, n = P(E), a = L();
|
|
47
48
|
return n.findIndex((c) => N(c, a, e));
|
|
48
|
-
},
|
|
49
|
-
const e = r.validationMessage !== void 0, n = L(), a = !
|
|
49
|
+
}, ye = () => r.required !== void 0 ? r.required : z.required, we = () => {
|
|
50
|
+
const e = r.validationMessage !== void 0, n = L(), a = !ye() || n !== null && n !== "" && n !== void 0, c = r.valid !== void 0 ? r.valid : a;
|
|
50
51
|
return {
|
|
51
52
|
customError: e,
|
|
52
53
|
valid: c,
|
|
53
54
|
valueMissing: n === null
|
|
54
55
|
};
|
|
55
56
|
}, vt = () => r.validityStyles !== void 0 ? r.validityStyles : z.validityStyles, oe = (e) => {
|
|
56
|
-
|
|
57
|
-
},
|
|
57
|
+
ie.current = !0, e.focus(), window.setTimeout(() => ie.current = !1, 30);
|
|
58
|
+
}, xe = () => {
|
|
58
59
|
R.current && oe(R.current), r.adaptive && setTimeout(() => {
|
|
59
60
|
R.current && oe(R.current);
|
|
60
61
|
}, 300);
|
|
@@ -62,8 +63,9 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
62
63
|
for (const n of e)
|
|
63
64
|
Tt(n.target.clientWidth);
|
|
64
65
|
}, []), Oe = () => {
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
var e;
|
|
67
|
+
(e = Ee.current) != null && e.setCustomValidity && Ee.current.setCustomValidity(
|
|
68
|
+
we().valid ? "" : r.validationMessage || hn
|
|
67
69
|
);
|
|
68
70
|
}, q = (e, n) => {
|
|
69
71
|
const a = L();
|
|
@@ -71,28 +73,28 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
71
73
|
}, K = (e) => {
|
|
72
74
|
var n;
|
|
73
75
|
(n = t == null ? void 0 : t.current) == null || n.applyState(e), H.current = void 0;
|
|
74
|
-
},
|
|
76
|
+
}, X = (e, n) => {
|
|
75
77
|
var s;
|
|
76
78
|
const { virtual: a, dataItemKey: c, defaultItem: u } = r, m = P(E), v = a ? a.skip : 0, f = L(), o = e === -1 && u !== void 0 ? u : m[e - v], d = !N(o, f, c);
|
|
77
79
|
q(o, n), d && ((s = t == null ? void 0 : t.current) == null || s.triggerPageChangeCornerItems(o, n));
|
|
78
80
|
}, A = (e, n, a) => {
|
|
79
|
-
var
|
|
80
|
-
const { defaultItem: c, dataItemKey: u, virtual: m = { skip: 0, total: 0, pageSize: 0 } } = r, v = L(), f = P(E), o = (
|
|
81
|
+
var I, h;
|
|
82
|
+
const { defaultItem: c, dataItemKey: u, virtual: m = { skip: 0, total: 0, pageSize: 0 } } = r, v = L(), f = P(E), o = (I = t == null ? void 0 : t.current) == null ? void 0 : I.vs, d = f.findIndex((y) => N(y, v, u)), s = (h = t == null ? void 0 : t.current) == null ? void 0 : h.navigation.navigate({
|
|
81
83
|
current: m.skip + d,
|
|
82
84
|
max: (o != null && o.enabled ? m.total : f.length) - 1,
|
|
83
85
|
min: c !== void 0 ? -1 : 0,
|
|
84
86
|
keyCode: n,
|
|
85
87
|
skipItems: a || void 0
|
|
86
88
|
});
|
|
87
|
-
s !== void 0 &&
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
},
|
|
89
|
+
s !== void 0 && X(s, e), K(e);
|
|
90
|
+
}, ht = (e) => {
|
|
91
|
+
Z.current = e, t.current.wrapper = e;
|
|
92
|
+
}, It = (e) => /* @__PURE__ */ i.createElement(
|
|
91
93
|
"select",
|
|
92
94
|
{
|
|
93
95
|
name: r.name,
|
|
94
96
|
ref: (n) => {
|
|
95
|
-
|
|
97
|
+
Ee.current = n;
|
|
96
98
|
},
|
|
97
99
|
tabIndex: -1,
|
|
98
100
|
"aria-hidden": !0,
|
|
@@ -100,7 +102,7 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
100
102
|
style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" }
|
|
101
103
|
},
|
|
102
104
|
/* @__PURE__ */ i.createElement("option", { value: r.valueMap ? r.valueMap.call(void 0, e) : e })
|
|
103
|
-
),
|
|
105
|
+
), Se = () => {
|
|
104
106
|
const {
|
|
105
107
|
textField: e,
|
|
106
108
|
dataItemKey: n,
|
|
@@ -110,16 +112,16 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
110
112
|
skipDisabledItems: m = !0
|
|
111
113
|
} = r, v = L(), f = P(E), o = r.filter ? r.filter : p.text;
|
|
112
114
|
return m && e && !o && !v ? f.findIndex((d) => !d.disabled && d[e]) : it(v) && o === void 0 || u && o === "" ? f.findIndex((d) => N(d, v, n)) : o ? ke.current ? c(f, o, e) : f.findIndex((d) => N(d, v, n)) : a.skip === 0 ? 0 : -1;
|
|
113
|
-
}, Ae = (e, n) => n !== void 0 && n !== -1 && e && e.length > 0 && e[n].disabled,
|
|
114
|
-
const e = P(E), n = t.current.initState(), a =
|
|
115
|
+
}, Ae = (e, n) => n !== void 0 && n !== -1 && e && e.length > 0 && e[n].disabled, De = () => {
|
|
116
|
+
const e = P(E), n = t.current.initState(), a = Se();
|
|
115
117
|
Ae(e, a) && (q(null, n), K(n));
|
|
116
|
-
},
|
|
118
|
+
}, Ce = (e) => {
|
|
117
119
|
if (e.isPropagationStopped())
|
|
118
120
|
return;
|
|
119
121
|
const n = t.current.initState();
|
|
120
|
-
n.syntheticEvent = e, p.focused || (n.data.focused = !0),
|
|
122
|
+
n.syntheticEvent = e, p.focused || (n.data.focused = !0), De(), t.current.togglePopup(n), K(n);
|
|
121
123
|
}, He = (e) => {
|
|
122
|
-
var O,
|
|
124
|
+
var O, pe, _, me, j, tt, nt;
|
|
123
125
|
e && e.target instanceof Element && e.target.nodeName === "INPUT" && e.stopPropagation && e.stopPropagation();
|
|
124
126
|
const {
|
|
125
127
|
filterable: n,
|
|
@@ -131,40 +133,40 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
131
133
|
groupField: f = "",
|
|
132
134
|
textField: o,
|
|
133
135
|
skipDisabledItems: d = !0
|
|
134
|
-
} = r, s = P(E),
|
|
136
|
+
} = r, s = P(E), I = L(), h = s.findIndex((D) => N(D, I, v)), y = r.opened !== void 0 ? r.opened : p.opened, l = e.keyCode, T = l === w.home || l === w.end, M = l === w.up || l === w.down, $ = !y && (e.altKey && l === w.down || l === w.enter || l === w.space), re = y && (e.altKey && l === w.up || l === w.esc), ce = u && (l === w.left || l === w.right), ue = M || ce && !n || T, S = t.current.initState();
|
|
135
137
|
if (S.syntheticEvent = e, !a) {
|
|
136
138
|
if (T && ((O = t == null ? void 0 : t.current) != null && O.vs.enabled))
|
|
137
|
-
l === w.home ? m.skip !== 0 ? ((
|
|
139
|
+
l === w.home ? m.skip !== 0 ? ((pe = t == null ? void 0 : t.current) == null || pe.triggerOnPageChange(S, 0, m.pageSize), V.current = !0) : q(s[0], S) : m.skip < m.total - m.pageSize ? ((_ = t == null ? void 0 : t.current) == null || _.triggerOnPageChange(
|
|
138
140
|
S,
|
|
139
141
|
m.total - m.pageSize,
|
|
140
142
|
m.pageSize
|
|
141
143
|
), V.current = !0) : q(s[s.length - 1], S);
|
|
142
144
|
else if (y && l === w.pageUp)
|
|
143
|
-
e.preventDefault(), (
|
|
145
|
+
e.preventDefault(), (me = t == null ? void 0 : t.current) == null || me.scrollPopupByPageSize(-1);
|
|
144
146
|
else if (y && l === w.pageDown)
|
|
145
|
-
e.preventDefault(), (
|
|
147
|
+
e.preventDefault(), (j = t == null ? void 0 : t.current) == null || j.scrollPopupByPageSize(1);
|
|
146
148
|
else if (y && l === w.enter) {
|
|
147
|
-
const D =
|
|
148
|
-
Ae(s, D) ? (q(null, S), K(S)) :
|
|
149
|
-
} else if (
|
|
150
|
-
re &&
|
|
151
|
-
else if (
|
|
149
|
+
const D = Se();
|
|
150
|
+
Ae(s, D) ? (q(null, S), K(S)) : X(D, S), (tt = t == null ? void 0 : t.current) == null || tt.togglePopup(S), e.preventDefault();
|
|
151
|
+
} else if ($ || re)
|
|
152
|
+
re && De(), (nt = t == null ? void 0 : t.current) == null || nt.togglePopup(S), e.preventDefault();
|
|
153
|
+
else if (ue) {
|
|
152
154
|
if (ke.current = !1, f !== "" && o)
|
|
153
155
|
if (!d && y)
|
|
154
156
|
A(S, l);
|
|
155
157
|
else {
|
|
156
158
|
let D;
|
|
157
159
|
if (l === w.down || l === w.right) {
|
|
158
|
-
const x = s.slice(
|
|
160
|
+
const x = s.slice(h + 1).find((g) => !g.disabled && g[o]);
|
|
159
161
|
D = x && s.findIndex((g) => g[o] === x[o]);
|
|
160
162
|
} else if (l === w.up || l === w.left) {
|
|
161
163
|
let x;
|
|
162
|
-
if (
|
|
164
|
+
if (h === 0 && c)
|
|
163
165
|
D = -1;
|
|
164
|
-
else if (
|
|
166
|
+
else if (h === -1)
|
|
165
167
|
x = s, D = s.findIndex((g) => !g.disabled && g[o]);
|
|
166
168
|
else {
|
|
167
|
-
x = s.slice(0,
|
|
169
|
+
x = s.slice(0, h);
|
|
168
170
|
let g = x.pop();
|
|
169
171
|
for (; g && g.disabled; )
|
|
170
172
|
g = x.pop();
|
|
@@ -172,26 +174,26 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
176
|
if (D !== void 0) {
|
|
175
|
-
const x = D -
|
|
177
|
+
const x = D - h;
|
|
176
178
|
A(S, l, x);
|
|
177
179
|
} else
|
|
178
|
-
D === void 0 && s.findIndex((x) => x[o] ===
|
|
180
|
+
D === void 0 && s.findIndex((x) => x[o] === I[o]) === s.length - 1 && A(S, l);
|
|
179
181
|
}
|
|
180
182
|
else if (!d && y || T)
|
|
181
183
|
A(S, l);
|
|
182
184
|
else if (o) {
|
|
183
185
|
let D;
|
|
184
186
|
if (l === w.down || l === w.right) {
|
|
185
|
-
const x = s.slice(
|
|
187
|
+
const x = s.slice(h + 1).find((g) => !g.disabled && g[o]);
|
|
186
188
|
D = x && s.findIndex((g) => g[o] === x[o]);
|
|
187
189
|
} else if (l === w.up || l === w.left) {
|
|
188
190
|
let x;
|
|
189
|
-
if (
|
|
191
|
+
if (h === 0 && c)
|
|
190
192
|
D = -1;
|
|
191
|
-
else if (
|
|
193
|
+
else if (h === -1)
|
|
192
194
|
x = s, D = s.find((g) => !g.disabled && g[o]);
|
|
193
195
|
else {
|
|
194
|
-
x = s.slice(0,
|
|
196
|
+
x = s.slice(0, h);
|
|
195
197
|
let g = x.pop();
|
|
196
198
|
for (; g && g.disabled; )
|
|
197
199
|
g = x.pop();
|
|
@@ -199,10 +201,10 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
199
201
|
}
|
|
200
202
|
}
|
|
201
203
|
if (D !== void 0) {
|
|
202
|
-
const x = D -
|
|
204
|
+
const x = D - h;
|
|
203
205
|
A(S, l, x);
|
|
204
206
|
} else
|
|
205
|
-
D === void 0 && s.findIndex((x) => x[o] ===
|
|
207
|
+
D === void 0 && s.findIndex((x) => x[o] === I[o]) === s.length - 1 && A(S, l);
|
|
206
208
|
} else
|
|
207
209
|
A(S, l);
|
|
208
210
|
e.preventDefault();
|
|
@@ -221,7 +223,7 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
221
223
|
ref: (n) => R.current = n && n.element,
|
|
222
224
|
onChange: yt,
|
|
223
225
|
onKeyDown: He,
|
|
224
|
-
size:
|
|
226
|
+
size: Q,
|
|
225
227
|
rounded: ze,
|
|
226
228
|
fillMode: he,
|
|
227
229
|
renderListFilterWrapper: !0
|
|
@@ -268,14 +270,14 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
268
270
|
groupHeaderItemRender: c,
|
|
269
271
|
listNoDataRender: u,
|
|
270
272
|
itemRender: m
|
|
271
|
-
} = r, v = P(E), f = F && F.uDropDownList, o = t.current.vs, d = a.skip, s = r.opened !== void 0 ? r.opened : p.opened,
|
|
273
|
+
} = r, v = P(E), f = F && F.uDropDownList, o = t.current.vs, d = a.skip, s = r.opened !== void 0 ? r.opened : p.opened, I = t.current.getPopupSettings(), h = `translateY(${o.translate}px)`, y = L();
|
|
272
274
|
return /* @__PURE__ */ i.createElement(
|
|
273
275
|
ln,
|
|
274
276
|
{
|
|
275
277
|
id: be,
|
|
276
278
|
show: s,
|
|
277
279
|
data: v.slice(),
|
|
278
|
-
focusedIndex:
|
|
280
|
+
focusedIndex: Se(),
|
|
279
281
|
value: y,
|
|
280
282
|
textField: e,
|
|
281
283
|
valueField: n,
|
|
@@ -283,9 +285,9 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
283
285
|
groupField: r.groupField,
|
|
284
286
|
groupMode: "modern",
|
|
285
287
|
listRef: (T) => o.list = t.current.list = T,
|
|
286
|
-
wrapperStyle: { maxHeight:
|
|
288
|
+
wrapperStyle: { maxHeight: I.height },
|
|
287
289
|
wrapperCssClass: C(b.listContent({ c: f })),
|
|
288
|
-
listStyle: o.enabled ? { transform:
|
|
290
|
+
listStyle: o.enabled ? { transform: h } : void 0,
|
|
289
291
|
key: "listkey",
|
|
290
292
|
skip: d,
|
|
291
293
|
onClick: xt,
|
|
@@ -299,24 +301,24 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
299
301
|
}
|
|
300
302
|
);
|
|
301
303
|
}, Dt = () => {
|
|
302
|
-
var
|
|
304
|
+
var h;
|
|
303
305
|
const { header: e, footer: n, adaptiveTitle: a, groupField: c, groupStickyHeaderItemRender: u, list: m } = r, v = P(E), f = r.opened !== void 0 ? r.opened : p.opened, o = F && F.uDropDownList, d = F && F.uDropDownsActionSheet, s = {
|
|
304
306
|
navigatable: !1,
|
|
305
307
|
navigatableElements: [],
|
|
306
308
|
expand: f,
|
|
307
309
|
animation: !0,
|
|
308
|
-
onClose: (y) =>
|
|
310
|
+
onClose: (y) => Ce(y),
|
|
309
311
|
className: C(
|
|
310
|
-
|
|
312
|
+
J.wrapper({
|
|
311
313
|
c: d
|
|
312
314
|
}),
|
|
313
315
|
"k-adaptive-actionsheet"
|
|
314
316
|
),
|
|
315
|
-
animationStyles:
|
|
316
|
-
position:
|
|
317
|
+
animationStyles: G && Y && G <= Y.small ? { top: 0, width: "100%", height: "100%" } : void 0,
|
|
318
|
+
position: G && Y && G <= Y.small ? "fullscreen" : void 0
|
|
317
319
|
};
|
|
318
|
-
let { group:
|
|
319
|
-
return
|
|
320
|
+
let { group: I } = p;
|
|
321
|
+
return I === void 0 && c !== void 0 && (I = fe(v[0], c)), /* @__PURE__ */ i.createElement(fn, { ...s }, /* @__PURE__ */ i.createElement(vn, { className: C(J.header({ c: d })) }, /* @__PURE__ */ i.createElement("div", { className: C(J.titleBar({ c: d })) }, /* @__PURE__ */ i.createElement("div", { className: C(J.title({ c: d })) }, /* @__PURE__ */ i.createElement("div", null, a)), /* @__PURE__ */ i.createElement("div", { className: C(J.actions({ c: d })) }, /* @__PURE__ */ i.createElement(
|
|
320
322
|
lt,
|
|
321
323
|
{
|
|
322
324
|
tabIndex: 0,
|
|
@@ -324,26 +326,26 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
324
326
|
"aria-disabled": "false",
|
|
325
327
|
type: "button",
|
|
326
328
|
fillMode: "flat",
|
|
327
|
-
onClick:
|
|
329
|
+
onClick: Ce,
|
|
328
330
|
icon: "x",
|
|
329
331
|
svgIcon: nn
|
|
330
332
|
}
|
|
331
|
-
))), /* @__PURE__ */ i.createElement("div", { className: C(
|
|
333
|
+
))), /* @__PURE__ */ i.createElement("div", { className: C(J.titleBarGroup({ c: d })) }, Ve())), /* @__PURE__ */ i.createElement(gn, { overflowHidden: !0 }, e && /* @__PURE__ */ i.createElement("div", { className: C(b.listHeader({ c: o })) }, e), /* @__PURE__ */ i.createElement(
|
|
332
334
|
"div",
|
|
333
335
|
{
|
|
334
336
|
className: C(
|
|
335
337
|
b.list({
|
|
336
338
|
c: o,
|
|
337
|
-
size:
|
|
338
|
-
virtual: (
|
|
339
|
+
size: Q,
|
|
340
|
+
virtual: (h = t == null ? void 0 : t.current) == null ? void 0 : h.vs.enabled
|
|
339
341
|
})
|
|
340
342
|
)
|
|
341
343
|
},
|
|
342
344
|
Be(),
|
|
343
|
-
!m &&
|
|
345
|
+
!m && I && v.length !== 0 && /* @__PURE__ */ i.createElement(
|
|
344
346
|
ot,
|
|
345
347
|
{
|
|
346
|
-
group:
|
|
348
|
+
group: I,
|
|
347
349
|
groupMode: "modern",
|
|
348
350
|
render: u
|
|
349
351
|
}
|
|
@@ -358,7 +360,7 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
358
360
|
var n;
|
|
359
361
|
(n = r.popupSettings) != null && n.onMouseDownOutside && r.popupSettings.onMouseDownOutside.call(void 0, e);
|
|
360
362
|
}, kt = () => {
|
|
361
|
-
const { header: e, footer: n, dir: a, groupField: c, groupStickyHeaderItemRender: u, list: m } = r, v = P(E), f = t.current, o = f.getPopupSettings(), d = r.opened !== void 0 ? r.opened : p.opened, s = o.width !== void 0 ? o.width : f.popupWidth,
|
|
363
|
+
const { header: e, footer: n, dir: a, groupField: c, groupStickyHeaderItemRender: u, list: m } = r, v = P(E), f = t.current, o = f.getPopupSettings(), d = r.opened !== void 0 ? r.opened : p.opened, s = o.width !== void 0 ? o.width : f.popupWidth, I = F && F.uDropDownList, h = {
|
|
362
364
|
dir: a !== void 0 ? a : f.dirCalculated,
|
|
363
365
|
width: s,
|
|
364
366
|
popupSettings: {
|
|
@@ -366,25 +368,25 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
366
368
|
popupClass: C(
|
|
367
369
|
o.popupClass,
|
|
368
370
|
b.listContainer({
|
|
369
|
-
c:
|
|
371
|
+
c: I
|
|
370
372
|
})
|
|
371
373
|
),
|
|
372
|
-
anchor: o.anchor ||
|
|
374
|
+
anchor: o.anchor || Z.current,
|
|
373
375
|
show: d,
|
|
374
|
-
onOpen:
|
|
376
|
+
onOpen: xe,
|
|
375
377
|
onClose: Ct,
|
|
376
378
|
onMouseDownOutside: Et
|
|
377
379
|
},
|
|
378
380
|
itemsCount: [v.length]
|
|
379
381
|
};
|
|
380
382
|
let { group: y } = p;
|
|
381
|
-
return y === void 0 && c !== void 0 && (y =
|
|
383
|
+
return y === void 0 && c !== void 0 && (y = fe(v[0], c)), /* @__PURE__ */ i.createElement(rn, { ...h }, Ve(), e && /* @__PURE__ */ i.createElement("div", { className: C(b.listHeader({ c: I })) }, e), /* @__PURE__ */ i.createElement(
|
|
382
384
|
"div",
|
|
383
385
|
{
|
|
384
386
|
className: C(
|
|
385
387
|
b.list({
|
|
386
|
-
c:
|
|
387
|
-
size:
|
|
388
|
+
c: I,
|
|
389
|
+
size: Q,
|
|
388
390
|
virtual: t.current.vs.enabled
|
|
389
391
|
})
|
|
390
392
|
)
|
|
@@ -392,53 +394,55 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
392
394
|
Be(),
|
|
393
395
|
!m && y && v.length !== 0 && /* @__PURE__ */ i.createElement(ot, { group: y, groupMode: "modern", render: u }),
|
|
394
396
|
We()
|
|
395
|
-
), n && /* @__PURE__ */ i.createElement("div", { className: C(b.listFooter({ c:
|
|
397
|
+
), n && /* @__PURE__ */ i.createElement("div", { className: C(b.listFooter({ c: I })) }, n));
|
|
396
398
|
}, Lt = (e) => {
|
|
397
399
|
const { dataItemKey: n } = r, a = P(E), c = L();
|
|
398
|
-
let u = a.map((M,
|
|
399
|
-
const m =
|
|
400
|
+
let u = a.map((M, $) => ({ item: M, itemIndex: $ }));
|
|
401
|
+
const m = U.current.word, v = U.current.last, f = dn(m, v);
|
|
400
402
|
let o = u.length, d = Math.max(
|
|
401
403
|
0,
|
|
402
404
|
a.findIndex((M) => N(M, c, n))
|
|
403
405
|
), s;
|
|
404
406
|
r.defaultItem && (s = { item: r.defaultItem, itemIndex: -1 }, o += 1, d += 1), d += f ? 1 : 0, u = cn(u, d, s);
|
|
405
|
-
let
|
|
407
|
+
let I, h, y, l = 0;
|
|
406
408
|
const { textField: T } = r;
|
|
407
|
-
for (; l < o;
|
|
408
|
-
if (
|
|
409
|
+
for (; l < o; ) {
|
|
410
|
+
if (I = fe(u[l].item, T), h = f && at(I, v, ge), y = at(I, m, ge), h || y) {
|
|
409
411
|
l = u[l].itemIndex;
|
|
410
412
|
break;
|
|
411
413
|
}
|
|
414
|
+
l++;
|
|
415
|
+
}
|
|
412
416
|
if (l !== o) {
|
|
413
417
|
const M = t.current.initState();
|
|
414
|
-
M.syntheticEvent = e,
|
|
418
|
+
M.syntheticEvent = e, X(l, M), K(M), H.current = void 0;
|
|
415
419
|
}
|
|
416
420
|
}, bt = (e) => {
|
|
417
|
-
clearTimeout(qe.current), r.filterable || (qe.current = window.setTimeout(() =>
|
|
421
|
+
clearTimeout(qe.current), r.filterable || (qe.current = window.setTimeout(() => U.current.word = "", ut), Lt(e));
|
|
418
422
|
}, Pt = (e) => {
|
|
419
|
-
|
|
423
|
+
ie.current || t.current.handleFocus(e);
|
|
420
424
|
}, Mt = (e) => {
|
|
421
|
-
if (
|
|
425
|
+
if (ie.current || !p.focused)
|
|
422
426
|
return;
|
|
423
427
|
const n = r.opened !== void 0 ? r.opened : p.opened, a = t.current.initState();
|
|
424
|
-
a.syntheticEvent = e, a.data.focused = !1, a.events.push({ type: "onBlur" }), n &&
|
|
428
|
+
a.syntheticEvent = e, a.data.focused = !1, a.events.push({ type: "onBlur" }), n && De(), n && !Fe && t.current.togglePopup(a), K(a);
|
|
425
429
|
}, Nt = (e) => {
|
|
426
430
|
if (r.filterable || e.which === 0 || e.keyCode === w.enter)
|
|
427
431
|
return;
|
|
428
432
|
let n = String.fromCharCode(e.charCode || e.keyCode);
|
|
429
|
-
|
|
430
|
-
word:
|
|
431
|
-
last:
|
|
433
|
+
ge && (n = n.toLowerCase()), n === " " && e.preventDefault(), U.current = {
|
|
434
|
+
word: U.current.word + n,
|
|
435
|
+
last: U.current.last + n
|
|
432
436
|
}, bt(e);
|
|
433
437
|
}, Ft = () => {
|
|
434
438
|
const e = t.current.initState();
|
|
435
439
|
e.data.opened = p.opened, t.current.togglePopup(e), K(e);
|
|
436
|
-
}, _e = i.useRef(null),
|
|
440
|
+
}, _e = i.useRef(null), Z = i.useRef(null), Ee = i.useRef(), R = i.useRef(null);
|
|
437
441
|
i.useImperativeHandle(
|
|
438
442
|
_e,
|
|
439
443
|
() => ({
|
|
440
444
|
get element() {
|
|
441
|
-
return
|
|
445
|
+
return Z.current;
|
|
442
446
|
},
|
|
443
447
|
get index() {
|
|
444
448
|
return ft();
|
|
@@ -447,7 +451,7 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
447
451
|
return r.name;
|
|
448
452
|
},
|
|
449
453
|
get validity() {
|
|
450
|
-
return
|
|
454
|
+
return we();
|
|
451
455
|
},
|
|
452
456
|
get value() {
|
|
453
457
|
return L();
|
|
@@ -466,7 +470,7 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
466
470
|
ct,
|
|
467
471
|
() => _e.current
|
|
468
472
|
);
|
|
469
|
-
const qe = i.useRef(null),
|
|
473
|
+
const qe = i.useRef(null), U = i.useRef({ word: "", last: "" }), ie = i.useRef(!1), H = i.useRef(null), V = i.useRef(!1), ke = i.useRef(!1), B = i.useRef({}), Le = i.useRef({}), t = i.useRef(
|
|
470
474
|
new dt({
|
|
471
475
|
props: E,
|
|
472
476
|
setState: () => {
|
|
@@ -479,7 +483,7 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
479
483
|
handleItemSelect: () => {
|
|
480
484
|
}
|
|
481
485
|
})
|
|
482
|
-
), Ue = i.useRef(0), ee = i.useRef(null), [p, Kt] = i.useState({}), [
|
|
486
|
+
), Ue = i.useRef(0), ee = i.useRef(null), [p, Kt] = i.useState({}), [G, Tt] = i.useState(), [, Ge] = i.useReducer((e) => e, !0), zt = pn(), te = (e) => {
|
|
483
487
|
Kt({ ...p, ...e });
|
|
484
488
|
};
|
|
485
489
|
i.useEffect(() => {
|
|
@@ -488,87 +492,87 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
488
492
|
setState: te,
|
|
489
493
|
state: p,
|
|
490
494
|
forceUpdate: Ge,
|
|
491
|
-
element:
|
|
492
|
-
handleItemSelect:
|
|
495
|
+
element: Z.current,
|
|
496
|
+
handleItemSelect: X,
|
|
493
497
|
value: L()
|
|
494
498
|
});
|
|
495
|
-
}, [te, p, Ge,
|
|
496
|
-
var d, s,
|
|
499
|
+
}, [te, p, Ge, X, L]), i.useEffect(() => {
|
|
500
|
+
var d, s, I, h, y, l, T, M, $, re, ce, ue, S;
|
|
497
501
|
const { dataItemKey: e, virtual: n, groupField: a = "", textField: c } = r, u = P(E), m = B.current.virtual ? B.current.virtual.total : 0, v = r.opened !== void 0 ? r.opened : p.opened, f = B.current.opened !== void 0 ? B.current.opened : Le.current.opened, o = !f && v;
|
|
498
|
-
if ((d = t == null ? void 0 : t.current) == null || d.didUpdate(), (s = t == null ? void 0 : t.current) != null && s.getPopupSettings().animate || o &&
|
|
499
|
-
(
|
|
502
|
+
if ((d = t == null ? void 0 : t.current) == null || d.didUpdate(), (s = t == null ? void 0 : t.current) != null && s.getPopupSettings().animate || o && xe(), n && n.total !== m)
|
|
503
|
+
(I = t == null ? void 0 : t.current) == null || I.vs.calcScrollElementHeight(), (h = t == null ? void 0 : t.current) == null || h.vs.reset();
|
|
500
504
|
else {
|
|
501
|
-
const O = L(),
|
|
502
|
-
let _ = u.findIndex((
|
|
503
|
-
a !== "" && O && c && (_ = (l = (y = t == null ? void 0 : t.current) == null ? void 0 : y.getGroupedDataModernMode(u, a)) == null ? void 0 : l.map((
|
|
504
|
-
const
|
|
505
|
-
o && n ? (T = t == null ? void 0 : t.current) == null || T.scrollToVirtualItem(n, _) : o && !n ? (
|
|
505
|
+
const O = L(), pe = B.current.value !== void 0 ? B.current.value : Le.current.value;
|
|
506
|
+
let _ = u.findIndex((j) => N(j, O, e));
|
|
507
|
+
a !== "" && O && c && (_ = (l = (y = t == null ? void 0 : t.current) == null ? void 0 : y.getGroupedDataModernMode(u, a)) == null ? void 0 : l.map((j) => j[c]).indexOf(O[c]));
|
|
508
|
+
const me = !N(pe, O, e);
|
|
509
|
+
o && n ? (T = t == null ? void 0 : t.current) == null || T.scrollToVirtualItem(n, _) : o && !n ? (xe(), u && u.length !== 0 && ((M = t == null ? void 0 : t.current) == null || M.resetGroupStickyHeader(u[0][a], {
|
|
506
510
|
setState: te,
|
|
507
511
|
group: p.group,
|
|
508
512
|
state: p
|
|
509
|
-
})), (
|
|
513
|
+
})), ($ = t == null ? void 0 : t.current) == null || $.scrollToItem(_)) : v && f && O && me && !V.current ? (ce = t == null ? void 0 : t.current) == null || ce.scrollToItem(_, (re = t == null ? void 0 : t.current) == null ? void 0 : re.vs.enabled) : v && f && V.current && (V.current && n && n.skip === 0 ? (ue = t == null ? void 0 : t.current) == null || ue.vs.reset() : V.current && n && n.skip === n.total - n.pageSize && ((S = t == null ? void 0 : t.current) == null || S.vs.scrollToEnd()));
|
|
510
514
|
}
|
|
511
515
|
V.current = !1, Le.current = p, B.current = r, Oe();
|
|
512
516
|
}), i.useEffect(() => {
|
|
513
517
|
var e, n;
|
|
514
|
-
return ee.current = rt && window.ResizeObserver && new window.ResizeObserver(gt.bind(void 0)), (e = t == null ? void 0 : t.current) == null || e.didMount(), Oe(), (n =
|
|
518
|
+
return ee.current = rt && window.ResizeObserver && new window.ResizeObserver(gt.bind(void 0)), (e = t == null ? void 0 : t.current) == null || e.didMount(), Oe(), (n = Ie()) != null && n.body && ee.current && ee.current.observe(Ie().body), () => {
|
|
515
519
|
var a;
|
|
516
|
-
(a =
|
|
520
|
+
(a = Ie()) != null && a.body && ee.current && ee.current.disconnect();
|
|
517
521
|
};
|
|
518
522
|
}, []);
|
|
519
|
-
const Ye =
|
|
523
|
+
const Ye = ve + "-accessibility-id", be = ve + "-listbox-id", $e = ve + "-guid", Ot = zt.toLanguageString(
|
|
520
524
|
st,
|
|
521
525
|
mn[st]
|
|
522
526
|
), {
|
|
523
|
-
style:
|
|
527
|
+
style: ae,
|
|
524
528
|
className: At,
|
|
525
529
|
label: Pe,
|
|
526
530
|
dir: Ht,
|
|
527
531
|
virtual: W,
|
|
528
532
|
adaptive: wn,
|
|
529
533
|
dataItemKey: Vt,
|
|
530
|
-
disabled:
|
|
534
|
+
disabled: le,
|
|
531
535
|
loading: je,
|
|
532
536
|
iconClassName: Je,
|
|
533
537
|
svgIcon: Qe,
|
|
534
538
|
valueRender: Xe
|
|
535
|
-
} = r, Me = r.opened !== void 0 ? r.opened : p.opened,
|
|
539
|
+
} = r, Me = r.opened !== void 0 ? r.opened : p.opened, se = L(), Ne = fe(se, r.textField), Ze = !vt() || we().valid, de = t.current, Bt = de.vs, ne = F && F.uDropDownList;
|
|
536
540
|
Bt.enabled = W !== void 0;
|
|
537
|
-
const
|
|
538
|
-
W !== void 0 && (
|
|
539
|
-
const Wt = P(E), { focused: _t } = p, qt = Wt.findIndex((e) => N(e,
|
|
541
|
+
const Y = Jt(), Fe = !!(G && Y && G <= Y.medium && E.adaptive);
|
|
542
|
+
W !== void 0 && (de.vs.skip = W.skip, de.vs.total = W.total, de.vs.pageSize = W.pageSize);
|
|
543
|
+
const Wt = P(E), { focused: _t } = p, qt = Wt.findIndex((e) => N(e, se, Vt)), Re = /* @__PURE__ */ i.createElement("span", { id: Ye, className: C(b.inputInner({ c: ne })) }, Ne && /* @__PURE__ */ i.createElement("span", { className: C(b.inputText({ c: ne })) }, Ne)), Ut = Xe !== void 0 ? Xe.call(void 0, Re, se) : Re, et = /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
|
|
540
544
|
"span",
|
|
541
545
|
{
|
|
542
|
-
ref:
|
|
546
|
+
ref: ht,
|
|
543
547
|
className: C(
|
|
544
548
|
b.wrapper({
|
|
545
549
|
c: ne,
|
|
546
|
-
size:
|
|
550
|
+
size: Q,
|
|
547
551
|
rounded: ze,
|
|
548
552
|
fillMode: he,
|
|
549
553
|
focused: _t,
|
|
550
|
-
disabled:
|
|
554
|
+
disabled: le,
|
|
551
555
|
invalid: !Ze,
|
|
552
556
|
loading: je,
|
|
553
|
-
required:
|
|
557
|
+
required: ye()
|
|
554
558
|
}),
|
|
555
559
|
At
|
|
556
560
|
),
|
|
557
|
-
style: Pe ? { ...
|
|
561
|
+
style: Pe ? { ...ae, width: void 0 } : ae,
|
|
558
562
|
dir: Ht,
|
|
559
563
|
onMouseDown: Me ? (e) => {
|
|
560
564
|
e.target.nodeName !== "INPUT" && (oe(t.current.wrapper), e.preventDefault());
|
|
561
565
|
} : void 0,
|
|
562
566
|
onFocus: Pt,
|
|
563
567
|
onBlur: Mt,
|
|
564
|
-
tabIndex: Qt(pt,
|
|
568
|
+
tabIndex: Qt(pt, le),
|
|
565
569
|
accessKey: r.accessKey,
|
|
566
570
|
onKeyDown: He,
|
|
567
571
|
onKeyPress: Nt,
|
|
568
|
-
onClick:
|
|
572
|
+
onClick: le ? void 0 : Ce,
|
|
569
573
|
role: "combobox",
|
|
570
|
-
"aria-required":
|
|
571
|
-
"aria-disabled":
|
|
574
|
+
"aria-required": ye(),
|
|
575
|
+
"aria-disabled": le || void 0,
|
|
572
576
|
"aria-haspopup": "listbox",
|
|
573
577
|
"aria-expanded": Me || !1,
|
|
574
578
|
"aria-owns": be,
|
|
@@ -588,7 +592,7 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
588
592
|
tabIndex: -1,
|
|
589
593
|
type: "button",
|
|
590
594
|
"aria-label": Ot,
|
|
591
|
-
size:
|
|
595
|
+
size: Q,
|
|
592
596
|
fillMode: he,
|
|
593
597
|
iconClass: Je,
|
|
594
598
|
className: C(b.inputButton({ c: ne })),
|
|
@@ -599,7 +603,7 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
599
603
|
onMouseDown: (e) => p.focused && e.preventDefault()
|
|
600
604
|
}
|
|
601
605
|
),
|
|
602
|
-
|
|
606
|
+
It(se),
|
|
603
607
|
!Fe && kt()
|
|
604
608
|
), Fe && Dt());
|
|
605
609
|
return Pe ? /* @__PURE__ */ i.createElement(
|
|
@@ -609,7 +613,7 @@ const In = "Please select a value from the list!", Te = i.forwardRef((E, ct) =>
|
|
|
609
613
|
editorValue: Ne,
|
|
610
614
|
editorValid: Ze,
|
|
611
615
|
editorDisabled: r.disabled,
|
|
612
|
-
style: { width:
|
|
616
|
+
style: { width: ae ? ae.width : void 0 },
|
|
613
617
|
children: et
|
|
614
618
|
}
|
|
615
619
|
) : et;
|
|
@@ -646,10 +650,10 @@ const z = {
|
|
|
646
650
|
groupMode: "modern"
|
|
647
651
|
};
|
|
648
652
|
Te.displayName = "KendoReactDropDownList";
|
|
649
|
-
const
|
|
653
|
+
const In = Rt();
|
|
650
654
|
Te.displayName = "KendoReactDropDownList";
|
|
651
655
|
export {
|
|
652
656
|
Te as DropDownList,
|
|
653
|
-
|
|
657
|
+
In as DropDownListPropsContext,
|
|
654
658
|
z as dropDownListDefaultProps
|
|
655
659
|
};
|