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