@progress/kendo-react-dropdowns 14.5.0-develop.13 → 14.5.0-develop.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoComplete/AutoComplete.mjs +7 -7
- package/AutoComplete/AutoCompleteProps.d.ts +6 -1
- package/AutoCompleteMcpWrapper.d.ts +17 -0
- package/AutoCompleteMcpWrapper.js +8 -0
- package/AutoCompleteMcpWrapper.mjs +18 -0
- package/ComboBox/ComboBox.mjs +10 -10
- package/ComboBox/ComboBoxProps.d.ts +6 -1
- package/ComboBoxMcpWrapper.d.ts +17 -0
- package/ComboBoxMcpWrapper.js +8 -0
- package/ComboBoxMcpWrapper.mjs +18 -0
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +123 -123
- package/DropDownList/DropDownListProps.d.ts +6 -1
- package/DropDownTree/DropDownTree.js +1 -1
- package/DropDownTree/DropDownTree.mjs +64 -64
- package/DropDownTree/DropDownTreeProps.d.ts +6 -1
- package/MultiSelect/MultiSelect.mjs +9 -9
- package/MultiSelect/MultiSelectProps.d.ts +6 -1
- package/MultiSelectMcpWrapper.d.ts +17 -0
- package/MultiSelectMcpWrapper.js +8 -0
- package/MultiSelectMcpWrapper.mjs +18 -0
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +9 -3
- package/index.d.ts +9 -3
- package/index.js +1 -1
- package/index.mjs +51 -47
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
|
@@ -7,50 +7,50 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as i from "react";
|
|
9
9
|
import C from "prop-types";
|
|
10
|
-
import { getLicenseMessage as Qt, usePropsContext as Xt, validatePackage as Zt, useUnstyled as Rt, useId as en,
|
|
11
|
-
import { FloatingLabel as
|
|
12
|
-
import { chevronDownIcon as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
10
|
+
import { getLicenseMessage as Qt, usePropsContext as Xt, validatePackage as Zt, useUnstyled as Rt, useId as en, useWebMcpRegister as tn, useKendoPaste as nn, canUseDOM as tt, useAdaptiveModeContext as rn, classNames as L, uDropDownList as P, getTabIndex as on, IconWrap as sn, createPropsContext as an, Keys as h, WatermarkOverlay as ln, sizeMap as dn, svgIconPropType as cn } from "@progress/kendo-react-common";
|
|
11
|
+
import { FloatingLabel as un } from "@progress/kendo-react-labels";
|
|
12
|
+
import { chevronDownIcon as pn } from "@progress/kendo-svg-icons";
|
|
13
|
+
import mn from "../common/ListContainer.mjs";
|
|
14
|
+
import fn from "../common/ListFilter.mjs";
|
|
15
15
|
import nt from "../common/GroupStickyHeader.mjs";
|
|
16
|
-
import
|
|
16
|
+
import gn from "../common/ListDefaultItem.mjs";
|
|
17
17
|
import vn from "../common/List.mjs";
|
|
18
18
|
import dt from "../common/DropDownBase.mjs";
|
|
19
|
-
import { getFilteredData as E, getItemIndexByText as
|
|
19
|
+
import { getFilteredData as E, getItemIndexByText as hn, areSame as F, getItemValue as ne, isPresent as rt, itemIndexStartsWith as In, sameCharsOnly as yn, shuffleData as wn, matchText as ot } from "../common/utils.mjs";
|
|
20
20
|
import { packageMetadata as it } from "../package-metadata.mjs";
|
|
21
|
-
import { Button as
|
|
22
|
-
import { useLocalization as
|
|
21
|
+
import { Button as xn } from "@progress/kendo-react-buttons";
|
|
22
|
+
import { useLocalization as Dn } from "@progress/kendo-react-intl";
|
|
23
23
|
import { dropDownListArrowBtnAriaLabel as st, messages as at, dropDownListAdaptiveFilterPlaceholder as lt } from "../messages/index.mjs";
|
|
24
|
-
import { ActionSheetContent as
|
|
25
|
-
import { AdaptiveMode as
|
|
26
|
-
const
|
|
27
|
-
let
|
|
28
|
-
const pt = Qt(it), n = Xt(
|
|
24
|
+
import { ActionSheetContent as Sn } from "@progress/kendo-react-layout";
|
|
25
|
+
import { AdaptiveMode as Cn } from "../common/AdaptiveMode.mjs";
|
|
26
|
+
const kn = "Please select a value from the list!", Me = i.forwardRef((ct, ut) => {
|
|
27
|
+
let Ke = !1;
|
|
28
|
+
const pt = Qt(it), n = Xt(En, ct), {
|
|
29
29
|
delay: mt = O.delay,
|
|
30
30
|
tabIndex: ft = O.tabIndex,
|
|
31
31
|
ignoreCase: J = O.ignoreCase,
|
|
32
32
|
size: z = O.size,
|
|
33
|
-
rounded:
|
|
33
|
+
rounded: Ne = O.rounded,
|
|
34
34
|
fillMode: fe = O.fillMode
|
|
35
35
|
} = n;
|
|
36
36
|
if (n.filterable || n.virtual) {
|
|
37
37
|
const e = [];
|
|
38
|
-
n.filterable && e.push("filterable"), n.virtual && e.push("virtualization"),
|
|
38
|
+
n.filterable && e.push("filterable"), n.virtual && e.push("virtualization"), Ke = !Zt(it, {
|
|
39
39
|
component: "DropDownList",
|
|
40
40
|
features: e
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
const K = Rt(),
|
|
43
|
+
const K = Rt(), ge = en(n.id), ve = () => {
|
|
44
44
|
var e;
|
|
45
45
|
if (tt)
|
|
46
46
|
return ((e = B.current) == null ? void 0 : e.ownerDocument) || window.document;
|
|
47
|
-
},
|
|
47
|
+
}, gt = () => {
|
|
48
48
|
var e, r;
|
|
49
49
|
(e = t == null ? void 0 : t.current) != null && e.wrapper && ((r = t == null ? void 0 : t.current) == null || r.wrapper.focus({ preventScroll: !0 }));
|
|
50
50
|
}, k = () => {
|
|
51
51
|
let e;
|
|
52
52
|
return A.current !== void 0 && A.current !== null ? e = A.current : n.value !== void 0 ? e = n.value : m.value !== void 0 && m.value !== null ? e = m.value : n.defaultValue !== void 0 && n.defaultValue !== null && (e = n.defaultValue), !rt(e) && n.defaultItem !== void 0 && n.defaultItem !== null && (e = n.defaultItem), e;
|
|
53
|
-
},
|
|
53
|
+
}, vt = () => {
|
|
54
54
|
const { dataItemKey: e } = n, r = E(n), o = k();
|
|
55
55
|
return r.findIndex((l) => F(l, o, e));
|
|
56
56
|
}, he = () => n.required !== void 0 ? n.required : O.required, Ie = () => {
|
|
@@ -69,10 +69,10 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
69
69
|
}, It = i.useCallback((e) => {
|
|
70
70
|
for (const r of e)
|
|
71
71
|
Ht(r.target.clientWidth);
|
|
72
|
-
}, []),
|
|
72
|
+
}, []), Te = () => {
|
|
73
73
|
var e;
|
|
74
|
-
(e =
|
|
75
|
-
Ie().valid ? "" : n.validationMessage ||
|
|
74
|
+
(e = Ce.current) != null && e.setCustomValidity && Ce.current.setCustomValidity(
|
|
75
|
+
Ie().valid ? "" : n.validationMessage || kn
|
|
76
76
|
);
|
|
77
77
|
}, V = (e, r) => {
|
|
78
78
|
const o = k();
|
|
@@ -82,12 +82,12 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
82
82
|
(r = t == null ? void 0 : t.current) == null || r.applyState(e), A.current = void 0;
|
|
83
83
|
}, Q = (e, r) => {
|
|
84
84
|
var u;
|
|
85
|
-
const { virtual: o, dataItemKey: l, defaultItem: a } = n, c = E(n), p = o ? o.skip : 0, f = k(), d = e === -1 && a !== void 0 ? a : c[e - p],
|
|
86
|
-
V(d, r),
|
|
85
|
+
const { virtual: o, dataItemKey: l, defaultItem: a } = n, c = E(n), p = o ? o.skip : 0, f = k(), d = e === -1 && a !== void 0 ? a : c[e - p], g = !F(d, f, l);
|
|
86
|
+
V(d, r), g && ((u = t == null ? void 0 : t.current) == null || u.triggerPageChangeCornerItems(d, r));
|
|
87
87
|
}, H = (e, r, o) => {
|
|
88
|
-
var S,
|
|
89
|
-
const { defaultItem: l, dataItemKey: a, virtual: c = { skip: 0, total: 0, pageSize: 0 } } = n, p = k(), f = E(n), d = (S = t == null ? void 0 : t.current) == null ? void 0 : S.vs,
|
|
90
|
-
current: c.skip +
|
|
88
|
+
var S, v;
|
|
89
|
+
const { defaultItem: l, dataItemKey: a, virtual: c = { skip: 0, total: 0, pageSize: 0 } } = n, p = k(), f = E(n), d = (S = t == null ? void 0 : t.current) == null ? void 0 : S.vs, g = f.findIndex((I) => F(I, p, a)), u = (v = t == null ? void 0 : t.current) == null ? void 0 : v.navigation.navigate({
|
|
90
|
+
current: c.skip + g,
|
|
91
91
|
max: (d != null && d.enabled ? c.total : f.length) - 1,
|
|
92
92
|
min: l !== void 0 ? -1 : 0,
|
|
93
93
|
keyCode: r,
|
|
@@ -101,7 +101,7 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
101
101
|
{
|
|
102
102
|
name: n.name,
|
|
103
103
|
ref: (r) => {
|
|
104
|
-
|
|
104
|
+
Ce.current = r;
|
|
105
105
|
},
|
|
106
106
|
tabIndex: -1,
|
|
107
107
|
"aria-hidden": !0,
|
|
@@ -114,20 +114,20 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
114
114
|
textField: e,
|
|
115
115
|
dataItemKey: r,
|
|
116
116
|
virtual: o = { skip: 0 },
|
|
117
|
-
focusedItemIndex: l =
|
|
117
|
+
focusedItemIndex: l = In,
|
|
118
118
|
filterable: a,
|
|
119
119
|
skipDisabledItems: c = !0
|
|
120
120
|
} = n, p = k(), f = E(n), d = n.filter ? n.filter : m.text;
|
|
121
|
-
return c && e && !d && !p ? f.findIndex((
|
|
122
|
-
},
|
|
121
|
+
return c && e && !d && !p ? f.findIndex((g) => !g.disabled) : rt(p) && d === void 0 || a && d === "" ? f.findIndex((g) => F(g, p, r)) : d ? ke.current ? l(f, d, e) : f.findIndex((g) => F(g, p, r)) : o.skip === 0 ? 0 : -1;
|
|
122
|
+
}, Oe = (e, r) => r !== void 0 && r !== -1 && e && e.length > 0 && e[r].disabled, xe = () => {
|
|
123
123
|
const e = E(n), r = t.current.initState(), o = we();
|
|
124
|
-
|
|
124
|
+
Oe(e, o) && (V(null, r), M(r));
|
|
125
125
|
}, De = (e) => {
|
|
126
126
|
if (e.isPropagationStopped())
|
|
127
127
|
return;
|
|
128
128
|
const r = t.current.initState();
|
|
129
129
|
r.syntheticEvent = e, m.focused || (r.data.focused = !0), xe(), t.current.togglePopup(r), M(r);
|
|
130
|
-
},
|
|
130
|
+
}, ze = (e) => {
|
|
131
131
|
var T, pe, G, me, j, Re, et;
|
|
132
132
|
e && e.target instanceof Element && e.target.nodeName === "INPUT" && e.stopPropagation && e.stopPropagation();
|
|
133
133
|
const {
|
|
@@ -139,8 +139,8 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
139
139
|
dataItemKey: p,
|
|
140
140
|
groupField: f = "",
|
|
141
141
|
textField: d,
|
|
142
|
-
skipDisabledItems:
|
|
143
|
-
} = n, u = E(n), S = k(),
|
|
142
|
+
skipDisabledItems: g = !0
|
|
143
|
+
} = n, u = E(n), S = k(), v = u.findIndex((w) => F(w, S, p)), I = n.opened !== void 0 ? n.opened : m.opened, s = e.keyCode, N = s === h.home || s === h.end, b = s === h.up || s === h.down, Y = !I && (e.altKey && s === h.down || s === h.enter || s === h.space), te = I && (e.altKey && s === h.up || s === h.esc), ce = a && (s === h.left || s === h.right), ue = b || ce && !r || N, y = t.current.initState();
|
|
144
144
|
if (y.syntheticEvent = e, !o) {
|
|
145
145
|
if (N && ((T = t == null ? void 0 : t.current) != null && T.vs.enabled))
|
|
146
146
|
s === h.home ? c.skip !== 0 ? ((pe = t == null ? void 0 : t.current) == null || pe.triggerOnPageChange(y, 0, c.pageSize), W.current = !0) : V(u[0], y) : c.skip < c.total - c.pageSize ? ((G = t == null ? void 0 : t.current) == null || G.triggerOnPageChange(
|
|
@@ -154,26 +154,26 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
154
154
|
e.preventDefault(), (j = t == null ? void 0 : t.current) == null || j.scrollPopupByPageSize(1);
|
|
155
155
|
else if (I && s === h.enter) {
|
|
156
156
|
const w = we();
|
|
157
|
-
|
|
157
|
+
Oe(u, w) ? (V(null, y), M(y)) : Q(w, y), (Re = t == null ? void 0 : t.current) == null || Re.togglePopup(y), e.preventDefault();
|
|
158
158
|
} else if (Y || te)
|
|
159
159
|
te && xe(), (et = t == null ? void 0 : t.current) == null || et.togglePopup(y), e.preventDefault();
|
|
160
160
|
else if (ue) {
|
|
161
|
-
if (
|
|
162
|
-
if (!
|
|
161
|
+
if (ke.current = !1, f !== "" && d)
|
|
162
|
+
if (!g && I)
|
|
163
163
|
H(y, s);
|
|
164
164
|
else {
|
|
165
165
|
let w;
|
|
166
166
|
if (s === h.down || s === h.right) {
|
|
167
|
-
const x = u.slice(
|
|
167
|
+
const x = u.slice(v + 1).find((D) => !D.disabled);
|
|
168
168
|
w = x && u.indexOf(x);
|
|
169
169
|
} else if (s === h.up || s === h.left) {
|
|
170
170
|
let x;
|
|
171
|
-
if (
|
|
171
|
+
if (v === 0 && l)
|
|
172
172
|
w = -1;
|
|
173
|
-
else if (
|
|
173
|
+
else if (v === -1)
|
|
174
174
|
x = u, w = u.findIndex((D) => !D.disabled);
|
|
175
175
|
else {
|
|
176
|
-
x = u.slice(0,
|
|
176
|
+
x = u.slice(0, v);
|
|
177
177
|
let D = x.pop();
|
|
178
178
|
for (; D && D.disabled; )
|
|
179
179
|
D = x.pop();
|
|
@@ -181,25 +181,25 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
if (w !== void 0) {
|
|
184
|
-
const x = w -
|
|
184
|
+
const x = w - v;
|
|
185
185
|
H(y, s, x);
|
|
186
|
-
} else w === void 0 &&
|
|
186
|
+
} else w === void 0 && v === u.length - 1 && H(y, s);
|
|
187
187
|
}
|
|
188
|
-
else if (!
|
|
188
|
+
else if (!g && I || N)
|
|
189
189
|
H(y, s);
|
|
190
190
|
else if (d) {
|
|
191
191
|
let w;
|
|
192
192
|
if (s === h.down || s === h.right) {
|
|
193
|
-
const x = u.slice(
|
|
193
|
+
const x = u.slice(v + 1).find((D) => !D.disabled);
|
|
194
194
|
w = x && u.indexOf(x);
|
|
195
195
|
} else if (s === h.up || s === h.left) {
|
|
196
196
|
let x;
|
|
197
|
-
if (
|
|
197
|
+
if (v === 0 && l)
|
|
198
198
|
w = -1;
|
|
199
|
-
else if (
|
|
199
|
+
else if (v === -1)
|
|
200
200
|
x = u, w = u.findIndex((D) => !D.disabled);
|
|
201
201
|
else {
|
|
202
|
-
x = u.slice(0,
|
|
202
|
+
x = u.slice(0, v);
|
|
203
203
|
let D = x.pop();
|
|
204
204
|
for (; D && D.disabled; )
|
|
205
205
|
D = x.pop();
|
|
@@ -207,9 +207,9 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
if (w !== void 0) {
|
|
210
|
-
const x = w -
|
|
210
|
+
const x = w - v;
|
|
211
211
|
H(y, s, x);
|
|
212
|
-
} else w === void 0 &&
|
|
212
|
+
} else w === void 0 && v === u.length - 1 && H(y, s);
|
|
213
213
|
} else
|
|
214
214
|
H(y, s);
|
|
215
215
|
e.preventDefault();
|
|
@@ -218,20 +218,20 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
218
218
|
}
|
|
219
219
|
}, xt = (e) => {
|
|
220
220
|
const r = t.current.initState();
|
|
221
|
-
r.syntheticEvent = e.syntheticEvent, n.filter === void 0 && (r.data.text = e.target.value), t.current.filterChanged(e.target.value, r),
|
|
222
|
-
},
|
|
221
|
+
r.syntheticEvent = e.syntheticEvent, n.filter === void 0 && (r.data.text = e.target.value), t.current.filterChanged(e.target.value, r), ke.current = !0, M(r), R({ group: void 0, text: String(e.target.value) });
|
|
222
|
+
}, Ve = (e) => {
|
|
223
223
|
const r = n.filter !== void 0 ? n.filter : m.text;
|
|
224
224
|
return n.filterable && /* @__PURE__ */ i.createElement(
|
|
225
|
-
|
|
225
|
+
fn,
|
|
226
226
|
{
|
|
227
227
|
value: r,
|
|
228
228
|
ref: (o) => {
|
|
229
229
|
X.current = o && o.element;
|
|
230
230
|
},
|
|
231
231
|
onChange: xt,
|
|
232
|
-
onKeyDown:
|
|
232
|
+
onKeyDown: ze,
|
|
233
233
|
size: e ? "large" : z,
|
|
234
|
-
rounded:
|
|
234
|
+
rounded: Ne,
|
|
235
235
|
fillMode: fe,
|
|
236
236
|
renderListFilterWrapper: !0,
|
|
237
237
|
placeholder: qe.toLanguageString(
|
|
@@ -247,7 +247,7 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
247
247
|
}, St = () => {
|
|
248
248
|
const { textField: e, defaultItem: r, dataItemKey: o } = n, l = k();
|
|
249
249
|
return r !== void 0 && /* @__PURE__ */ i.createElement(
|
|
250
|
-
|
|
250
|
+
gn,
|
|
251
251
|
{
|
|
252
252
|
defaultItem: r,
|
|
253
253
|
textField: e,
|
|
@@ -268,11 +268,11 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
268
268
|
const c = Ae.current = Ae.current || (r.enabled ? r.itemHeight : o ? o.children[0].offsetHeight : 0), f = e.target.scrollTop - r.skip * c;
|
|
269
269
|
a = t.current.getGroupedDataModernMode(a, l);
|
|
270
270
|
let d = a[0][l];
|
|
271
|
-
for (let
|
|
272
|
-
a[
|
|
271
|
+
for (let g = 1; g < a.length && !(c * g > f); g++)
|
|
272
|
+
a[g] && a[g][l] && (d = a[g][l]);
|
|
273
273
|
d !== m.group && R({ group: d });
|
|
274
274
|
}
|
|
275
|
-
},
|
|
275
|
+
}, He = () => {
|
|
276
276
|
var s;
|
|
277
277
|
const {
|
|
278
278
|
textField: e,
|
|
@@ -281,11 +281,11 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
281
281
|
groupHeaderItemRender: l,
|
|
282
282
|
listNoDataRender: a,
|
|
283
283
|
itemRender: c
|
|
284
|
-
} = n, p = E(n), f = K && K.uDropDownList, d = t.current.vs,
|
|
284
|
+
} = n, p = E(n), f = K && K.uDropDownList, d = t.current.vs, g = o.skip, u = n.opened !== void 0 ? n.opened : m.opened, S = t.current.getPopupSettings(), v = `translateY(${d.translate}px)`, I = k();
|
|
285
285
|
return /* @__PURE__ */ i.createElement(
|
|
286
286
|
vn,
|
|
287
287
|
{
|
|
288
|
-
id:
|
|
288
|
+
id: be,
|
|
289
289
|
show: u,
|
|
290
290
|
data: p.slice(),
|
|
291
291
|
focusedIndex: we(),
|
|
@@ -299,9 +299,9 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
299
299
|
},
|
|
300
300
|
wrapperStyle: { maxHeight: _ ? void 0 : S.height },
|
|
301
301
|
wrapperCssClass: L(P.listContent({ c: f })),
|
|
302
|
-
listStyle: d.enabled ? { transform:
|
|
302
|
+
listStyle: d.enabled ? { transform: v } : void 0,
|
|
303
303
|
key: "listkey",
|
|
304
|
-
skip:
|
|
304
|
+
skip: g,
|
|
305
305
|
onClick: Ct,
|
|
306
306
|
itemRender: c,
|
|
307
307
|
groupHeaderItemRender: l,
|
|
@@ -318,11 +318,11 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
318
318
|
subTitle: n.adaptiveSubtitle,
|
|
319
319
|
expand: o,
|
|
320
320
|
onClose: (p) => De(p),
|
|
321
|
-
windowWidth:
|
|
322
|
-
mobileFilter:
|
|
321
|
+
windowWidth: Le,
|
|
322
|
+
mobileFilter: Ve(!0)
|
|
323
323
|
};
|
|
324
324
|
let { group: c } = m;
|
|
325
|
-
return c === void 0 && e !== void 0 && (c = ne(r[0], e)), /* @__PURE__ */ i.createElement(
|
|
325
|
+
return c === void 0 && e !== void 0 && (c = ne(r[0], e)), /* @__PURE__ */ i.createElement(Cn, { ...a }, /* @__PURE__ */ i.createElement(Sn, null, /* @__PURE__ */ i.createElement("div", { className: L(P.listContainer({ c: l, popup: !1 })) }, Ft())));
|
|
326
326
|
}, Lt = () => {
|
|
327
327
|
m.focused && window.setTimeout(() => {
|
|
328
328
|
m.focused && t.current.wrapper && re(t.current.wrapper);
|
|
@@ -330,7 +330,7 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
330
330
|
}, bt = (e) => {
|
|
331
331
|
"onMouseDownOutside" in (n.popupSettings || {}) && n.popupSettings.onMouseDownOutside.call(void 0, e);
|
|
332
332
|
}, Pt = () => {
|
|
333
|
-
const { header: e, footer: r, dir: o, groupField: l, groupStickyHeaderItemRender: a, list: c } = n, p = E(n), f = t.current, d = f.getPopupSettings(),
|
|
333
|
+
const { header: e, footer: r, dir: o, groupField: l, groupStickyHeaderItemRender: a, list: c } = n, p = E(n), f = t.current, d = f.getPopupSettings(), g = n.opened !== void 0 ? n.opened : m.opened, u = d.width !== void 0 ? d.width : f.popupWidth, S = K && K.uDropDownList, v = {
|
|
334
334
|
dir: o !== void 0 ? o : f.dirCalculated,
|
|
335
335
|
width: u,
|
|
336
336
|
popupSettings: {
|
|
@@ -343,7 +343,7 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
343
343
|
})
|
|
344
344
|
),
|
|
345
345
|
anchor: d.anchor || B.current,
|
|
346
|
-
show:
|
|
346
|
+
show: g,
|
|
347
347
|
onOpen: ye,
|
|
348
348
|
onClose: Lt,
|
|
349
349
|
onMouseDownOutside: bt
|
|
@@ -351,7 +351,7 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
351
351
|
itemsCount: [p.length]
|
|
352
352
|
};
|
|
353
353
|
let { group: I } = m;
|
|
354
|
-
return I === void 0 && l !== void 0 && (I = ne(p[0], l)), /* @__PURE__ */ i.createElement(
|
|
354
|
+
return I === void 0 && l !== void 0 && (I = ne(p[0], l)), /* @__PURE__ */ i.createElement(mn, { ...v }, Ve(!1), e && /* @__PURE__ */ i.createElement("div", { className: L(P.listHeader({ c: S })) }, e), /* @__PURE__ */ i.createElement(
|
|
355
355
|
"div",
|
|
356
356
|
{
|
|
357
357
|
className: L(
|
|
@@ -364,8 +364,8 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
364
364
|
},
|
|
365
365
|
St(),
|
|
366
366
|
!c && I && p.length !== 0 && /* @__PURE__ */ i.createElement(nt, { group: I, render: a }),
|
|
367
|
-
|
|
368
|
-
), r && /* @__PURE__ */ i.createElement("div", { className: L(P.listFooter({ c: S })) }, r),
|
|
367
|
+
He()
|
|
368
|
+
), r && /* @__PURE__ */ i.createElement("div", { className: L(P.listFooter({ c: S })) }, r), Ke && /* @__PURE__ */ i.createElement(ln, { message: pt }));
|
|
369
369
|
}, Ft = () => {
|
|
370
370
|
const { header: e, footer: r, groupStickyHeaderItemRender: o, groupField: l, list: a } = n, c = E(n), p = K && K.uDropDownList;
|
|
371
371
|
let { group: f } = m;
|
|
@@ -373,25 +373,25 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
373
373
|
"div",
|
|
374
374
|
{
|
|
375
375
|
className: L("k-list", {
|
|
376
|
-
[`k-list-${_ ? "lg" :
|
|
376
|
+
[`k-list-${_ ? "lg" : dn[z] || z}`]: _ || z
|
|
377
377
|
})
|
|
378
378
|
},
|
|
379
379
|
!a && f && c.length !== 0 && /* @__PURE__ */ i.createElement(nt, { group: f, render: o }),
|
|
380
|
-
|
|
380
|
+
He()
|
|
381
381
|
), r && /* @__PURE__ */ i.createElement("div", { className: "k-list-footer" }, r));
|
|
382
382
|
}, Mt = (e) => {
|
|
383
383
|
const { dataItemKey: r } = n, o = E(n), l = k();
|
|
384
384
|
let a = o.map((b, Y) => ({ item: b, itemIndex: Y }));
|
|
385
|
-
const c = $.current.word, p = $.current.last, f =
|
|
386
|
-
let d = a.length,
|
|
385
|
+
const c = $.current.word, p = $.current.last, f = yn(c, p);
|
|
386
|
+
let d = a.length, g = Math.max(
|
|
387
387
|
0,
|
|
388
388
|
o.findIndex((b) => F(b, l, r))
|
|
389
389
|
), u;
|
|
390
|
-
n.defaultItem && (u = { item: n.defaultItem, itemIndex: -1 }, d += 1,
|
|
391
|
-
let S,
|
|
390
|
+
n.defaultItem && (u = { item: n.defaultItem, itemIndex: -1 }, d += 1, g += 1), g += f ? 1 : 0, a = wn(a, g, u);
|
|
391
|
+
let S, v, I, s = 0;
|
|
392
392
|
const { textField: N } = n;
|
|
393
393
|
for (; s < d; ) {
|
|
394
|
-
if (S = ne(a[s].item, N),
|
|
394
|
+
if (S = ne(a[s].item, N), v = f && ot(S, p, J), I = ot(S, c, J), v || I) {
|
|
395
395
|
s = a[s].itemIndex;
|
|
396
396
|
break;
|
|
397
397
|
}
|
|
@@ -421,15 +421,15 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
421
421
|
}, zt = () => {
|
|
422
422
|
const e = t.current.initState();
|
|
423
423
|
e.data.opened = m.opened, t.current.togglePopup(e), M(e);
|
|
424
|
-
},
|
|
424
|
+
}, Se = i.useRef(null), B = i.useRef(null), Ce = i.useRef(null), X = i.useRef(null);
|
|
425
425
|
i.useImperativeHandle(
|
|
426
|
-
|
|
426
|
+
Se,
|
|
427
427
|
() => ({
|
|
428
428
|
get element() {
|
|
429
429
|
return B.current;
|
|
430
430
|
},
|
|
431
431
|
get index() {
|
|
432
|
-
return
|
|
432
|
+
return vt();
|
|
433
433
|
},
|
|
434
434
|
get name() {
|
|
435
435
|
return n.name;
|
|
@@ -446,15 +446,15 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
446
446
|
get opened() {
|
|
447
447
|
return m.opened;
|
|
448
448
|
},
|
|
449
|
-
focus:
|
|
449
|
+
focus: gt,
|
|
450
450
|
props: n,
|
|
451
451
|
togglePopup: zt
|
|
452
452
|
})
|
|
453
453
|
), i.useImperativeHandle(
|
|
454
454
|
ut,
|
|
455
|
-
() =>
|
|
456
|
-
);
|
|
457
|
-
const Be = i.useRef(null), $ = i.useRef({ word: "", last: "" }), oe = i.useRef(!1), A = i.useRef(null), W = i.useRef(!1),
|
|
455
|
+
() => Se.current
|
|
456
|
+
), tn("dropdownlist", Se, n, n.webMcp);
|
|
457
|
+
const Be = i.useRef(null), $ = i.useRef({ word: "", last: "" }), oe = i.useRef(!1), A = i.useRef(null), W = i.useRef(!1), ke = i.useRef(!1), q = i.useRef({}), Ee = i.useRef({}), t = i.useRef(
|
|
458
458
|
new dt({
|
|
459
459
|
props: n,
|
|
460
460
|
setState: () => {
|
|
@@ -467,11 +467,11 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
467
467
|
handleItemSelect: () => {
|
|
468
468
|
}
|
|
469
469
|
})
|
|
470
|
-
), Ae = i.useRef(0), Z = i.useRef(null), [m, Vt] = i.useState({}), [
|
|
470
|
+
), Ae = i.useRef(0), Z = i.useRef(null), [m, Vt] = i.useState({}), [Le, Ht] = i.useState(), [, We] = i.useReducer((e) => e, !0), qe = Dn(), Ue = n.name || n.id, Bt = i.useCallback(
|
|
471
471
|
(e) => {
|
|
472
472
|
if (e == null || !t.current)
|
|
473
473
|
return;
|
|
474
|
-
const r = E(n), { textField: o } = n, l = String(e), a =
|
|
474
|
+
const r = E(n), { textField: o } = n, l = String(e), a = hn(r, l, o, !1, J), c = a !== -1 ? r[a] : void 0;
|
|
475
475
|
if (c !== void 0) {
|
|
476
476
|
const p = t.current.initState();
|
|
477
477
|
p.syntheticEvent = {
|
|
@@ -481,7 +481,7 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
481
481
|
},
|
|
482
482
|
[n, J]
|
|
483
483
|
);
|
|
484
|
-
|
|
484
|
+
nn(B, {
|
|
485
485
|
fieldName: Ue,
|
|
486
486
|
onValueChange: Bt,
|
|
487
487
|
enabled: !!Ue
|
|
@@ -500,12 +500,12 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
500
500
|
value: k()
|
|
501
501
|
});
|
|
502
502
|
}, [R, m, We, Q, k]), i.useEffect(() => {
|
|
503
|
-
var
|
|
504
|
-
const { dataItemKey: e, virtual: r, groupField: o = "", textField: l } = n, a = E(n), c = q.current.virtual ? q.current.virtual.total : 0, p = n.opened !== void 0 ? n.opened : m.opened, f = q.current.opened !== void 0 ? q.current.opened :
|
|
505
|
-
if ((
|
|
506
|
-
(S = t == null ? void 0 : t.current) == null || S.vs.calcScrollElementHeight(), (
|
|
503
|
+
var g, u, S, v, I, s, N, b, Y, te, ce, ue, y;
|
|
504
|
+
const { dataItemKey: e, virtual: r, groupField: o = "", textField: l } = n, a = E(n), c = q.current.virtual ? q.current.virtual.total : 0, p = n.opened !== void 0 ? n.opened : m.opened, f = q.current.opened !== void 0 ? q.current.opened : Ee.current.opened, d = !f && p;
|
|
505
|
+
if ((g = t == null ? void 0 : t.current) == null || g.didUpdate(), (u = t == null ? void 0 : t.current) != null && u.getPopupSettings().animate || d && ye(), r && r.total !== c)
|
|
506
|
+
(S = t == null ? void 0 : t.current) == null || S.vs.calcScrollElementHeight(), (v = t == null ? void 0 : t.current) == null || v.vs.reset();
|
|
507
507
|
else {
|
|
508
|
-
const T = k(), pe = q.current.value !== void 0 ? q.current.value :
|
|
508
|
+
const T = k(), pe = q.current.value !== void 0 ? q.current.value : Ee.current.value;
|
|
509
509
|
let G = a.findIndex((j) => F(j, T, e));
|
|
510
510
|
o !== "" && T && l && (G = (s = (I = t == null ? void 0 : t.current) == null ? void 0 : I.getGroupedDataModernMode(a, o)) == null ? void 0 : s.map((j) => j[l]).indexOf(T[l]));
|
|
511
511
|
const me = !F(pe, T, e);
|
|
@@ -515,35 +515,35 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
515
515
|
state: m
|
|
516
516
|
})), (Y = t == null ? void 0 : t.current) == null || Y.scrollToItem(G)) : p && f && T && me && !W.current ? (ce = t == null ? void 0 : t.current) == null || ce.scrollToItem(G, (te = t == null ? void 0 : t.current) == null ? void 0 : te.vs.enabled) : p && f && W.current && (W.current && r && r.skip === 0 ? (ue = t == null ? void 0 : t.current) == null || ue.vs.reset() : W.current && r && r.skip === r.total - r.pageSize && ((y = t == null ? void 0 : t.current) == null || y.vs.scrollToEnd()));
|
|
517
517
|
}
|
|
518
|
-
W.current = !1,
|
|
518
|
+
W.current = !1, Ee.current = m, q.current = n, Te();
|
|
519
519
|
}), i.useEffect(() => {
|
|
520
520
|
var e, r;
|
|
521
|
-
return Z.current = tt && window.ResizeObserver && new window.ResizeObserver(It.bind(void 0)), (e = t == null ? void 0 : t.current) == null || e.didMount(),
|
|
521
|
+
return Z.current = tt && window.ResizeObserver && new window.ResizeObserver(It.bind(void 0)), (e = t == null ? void 0 : t.current) == null || e.didMount(), Te(), (r = ve()) != null && r.body && Z.current && Z.current.observe(ve().body), () => {
|
|
522
522
|
var o;
|
|
523
|
-
(o =
|
|
523
|
+
(o = ve()) != null && o.body && Z.current && Z.current.disconnect();
|
|
524
524
|
};
|
|
525
525
|
}, []);
|
|
526
|
-
const _e =
|
|
526
|
+
const _e = ge + "-accessibility-id", be = ge + "-listbox-id", Ge = ge + "-guid", At = qe.toLanguageString(
|
|
527
527
|
st,
|
|
528
528
|
at[st]
|
|
529
529
|
), {
|
|
530
530
|
style: ie,
|
|
531
531
|
className: Wt,
|
|
532
|
-
label:
|
|
532
|
+
label: Pe,
|
|
533
533
|
dir: qt,
|
|
534
534
|
virtual: U,
|
|
535
|
-
adaptive:
|
|
535
|
+
adaptive: Ln,
|
|
536
536
|
dataItemKey: Ut,
|
|
537
537
|
disabled: se,
|
|
538
538
|
loading: $e,
|
|
539
539
|
iconClassName: Ye,
|
|
540
540
|
svgIcon: _t,
|
|
541
541
|
valueRender: je
|
|
542
|
-
} = n, ae = n.opened !== void 0 ? n.opened : m.opened, le = k(),
|
|
542
|
+
} = n, ae = n.opened !== void 0 ? n.opened : m.opened, le = k(), Fe = ne(le, n.textField), Je = !ht() || Ie().valid, de = t.current, Gt = de.vs, ee = K && K.uDropDownList;
|
|
543
543
|
Gt.enabled = U !== void 0;
|
|
544
|
-
const Qe =
|
|
544
|
+
const Qe = rn(), _ = !!(Le && Qe && Le <= Qe.medium && n.adaptive);
|
|
545
545
|
U !== void 0 && (de.vs.skip = U.skip, de.vs.total = U.total, de.vs.pageSize = U.pageSize);
|
|
546
|
-
const $t = E(n), { focused: Yt } = m, jt = $t.findIndex((e) => F(e, le, Ut)), Xe = /* @__PURE__ */ i.createElement("span", { id: _e, className: L(P.inputInner({ c: ee })) },
|
|
546
|
+
const $t = E(n), { focused: Yt } = m, jt = $t.findIndex((e) => F(e, le, Ut)), Xe = /* @__PURE__ */ i.createElement("span", { id: _e, className: L(P.inputInner({ c: ee })) }, Fe && /* @__PURE__ */ i.createElement("span", { className: L(P.inputText({ c: ee })) }, Fe)), Jt = je !== void 0 ? je.call(void 0, Xe, le) : Xe, Ze = /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(
|
|
547
547
|
"span",
|
|
548
548
|
{
|
|
549
549
|
ref: yt,
|
|
@@ -551,7 +551,7 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
551
551
|
P.wrapper({
|
|
552
552
|
c: ee,
|
|
553
553
|
size: z,
|
|
554
|
-
rounded:
|
|
554
|
+
rounded: Ne,
|
|
555
555
|
fillMode: fe,
|
|
556
556
|
focused: Yt,
|
|
557
557
|
disabled: se,
|
|
@@ -561,16 +561,16 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
561
561
|
}),
|
|
562
562
|
Wt
|
|
563
563
|
),
|
|
564
|
-
style:
|
|
564
|
+
style: Pe ? { ...ie, width: void 0 } : ie,
|
|
565
565
|
dir: qt,
|
|
566
566
|
onMouseDown: ae ? (e) => {
|
|
567
567
|
e.target.nodeName !== "INPUT" && (re(t.current.wrapper), e.preventDefault());
|
|
568
568
|
} : void 0,
|
|
569
569
|
onFocus: _ ? (e) => De(e) : Nt,
|
|
570
570
|
onBlur: Tt,
|
|
571
|
-
tabIndex:
|
|
571
|
+
tabIndex: on(ft, se),
|
|
572
572
|
accessKey: n.accessKey,
|
|
573
|
-
onKeyDown:
|
|
573
|
+
onKeyDown: ze,
|
|
574
574
|
onKeyPress: Ot,
|
|
575
575
|
onClick: se ? void 0 : De,
|
|
576
576
|
role: "combobox",
|
|
@@ -578,19 +578,19 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
578
578
|
"aria-disabled": se || void 0,
|
|
579
579
|
"aria-haspopup": "listbox",
|
|
580
580
|
"aria-expanded": ae || !1,
|
|
581
|
-
"aria-owns":
|
|
581
|
+
"aria-owns": be,
|
|
582
582
|
"aria-activedescendant": ae ? "option-" + Ge + "-" + (jt + (U ? U.skip : 0)) : void 0,
|
|
583
583
|
"aria-label": n.ariaLabel || n.label,
|
|
584
584
|
"aria-labelledby": n.ariaLabelledBy,
|
|
585
585
|
"aria-describedby": n.ariaDescribedBy || _e,
|
|
586
|
-
"aria-controls": ae ?
|
|
586
|
+
"aria-controls": ae ? be : void 0,
|
|
587
587
|
id: n.id,
|
|
588
588
|
title: n.title
|
|
589
589
|
},
|
|
590
590
|
Jt,
|
|
591
|
-
$e && /* @__PURE__ */ i.createElement(
|
|
591
|
+
$e && /* @__PURE__ */ i.createElement(sn, { className: L(P.loadingIcon({ c: ee })), name: "loading" }),
|
|
592
592
|
/* @__PURE__ */ i.createElement(
|
|
593
|
-
|
|
593
|
+
xn,
|
|
594
594
|
{
|
|
595
595
|
tabIndex: -1,
|
|
596
596
|
type: "button",
|
|
@@ -599,18 +599,18 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
599
599
|
fillMode: fe,
|
|
600
600
|
className: L(P.inputButton({ c: ee })),
|
|
601
601
|
iconClass: Ye,
|
|
602
|
-
svgIcon: Ye ? void 0 : _t ||
|
|
602
|
+
svgIcon: Ye ? void 0 : _t || pn,
|
|
603
603
|
onMouseDown: (e) => m.focused && e.preventDefault()
|
|
604
604
|
}
|
|
605
605
|
),
|
|
606
606
|
wt(le),
|
|
607
607
|
!_ && Pt()
|
|
608
608
|
), _ && Et());
|
|
609
|
-
return
|
|
610
|
-
|
|
609
|
+
return Pe ? /* @__PURE__ */ i.createElement(
|
|
610
|
+
un,
|
|
611
611
|
{
|
|
612
|
-
label:
|
|
613
|
-
editorValue:
|
|
612
|
+
label: Pe,
|
|
613
|
+
editorValue: Fe,
|
|
614
614
|
editorValid: Je,
|
|
615
615
|
editorDisabled: n.disabled,
|
|
616
616
|
style: { width: ie ? ie.width : void 0 },
|
|
@@ -618,11 +618,11 @@ const Cn = "Please select a value from the list!", Fe = i.forwardRef((ct, ut) =>
|
|
|
618
618
|
}
|
|
619
619
|
) : Ze;
|
|
620
620
|
});
|
|
621
|
-
|
|
621
|
+
Me.propTypes = {
|
|
622
622
|
delay: C.number,
|
|
623
623
|
ignoreCase: C.bool,
|
|
624
624
|
iconClassName: C.string,
|
|
625
|
-
svgIcon:
|
|
625
|
+
svgIcon: cn,
|
|
626
626
|
defaultItem: C.any,
|
|
627
627
|
valueRender: C.func,
|
|
628
628
|
valueMap: C.func,
|
|
@@ -648,11 +648,11 @@ const O = {
|
|
|
648
648
|
rounded: void 0,
|
|
649
649
|
fillMode: void 0
|
|
650
650
|
};
|
|
651
|
-
|
|
652
|
-
const
|
|
653
|
-
|
|
651
|
+
Me.displayName = "KendoReactDropDownList";
|
|
652
|
+
const En = an();
|
|
653
|
+
Me.displayName = "KendoReactDropDownList";
|
|
654
654
|
export {
|
|
655
|
-
|
|
656
|
-
|
|
655
|
+
Me as DropDownList,
|
|
656
|
+
En as DropDownListPropsContext,
|
|
657
657
|
O as dropDownListDefaultProps
|
|
658
658
|
};
|
|
@@ -10,7 +10,7 @@ import { VirtualizationSettings, DropDownsPopupSettings } from '../common/settin
|
|
|
10
10
|
import { ListGroupItemProps } from '../common/ListGroupItem.js';
|
|
11
11
|
import { GroupStickyHeaderProps } from '../common/GroupStickyHeader.js';
|
|
12
12
|
import { ListItemProps } from '../common/ListItem.js';
|
|
13
|
-
import { DropDownsClassStructure, FormComponentProps, SVGIcon } from '@progress/kendo-react-common';
|
|
13
|
+
import { DropDownsClassStructure, FormComponentProps, SVGIcon, WebMcpProps } from '@progress/kendo-react-common';
|
|
14
14
|
import { DropDownListHandle } from './models/index.js';
|
|
15
15
|
/**
|
|
16
16
|
* Represents the object of the `filterChange` DropDownList event.
|
|
@@ -602,6 +602,11 @@ export interface DropDownListProps extends FormComponentProps {
|
|
|
602
602
|
* ```
|
|
603
603
|
*/
|
|
604
604
|
skipDisabledItems?: boolean;
|
|
605
|
+
/**
|
|
606
|
+
* Enables Web MCP tool registration for this component.
|
|
607
|
+
* Requires a parent `WebMcpProvider` from `@progress/kendo-react-webmcp`.
|
|
608
|
+
*/
|
|
609
|
+
webMcp?: boolean | WebMcpProps;
|
|
605
610
|
/**
|
|
606
611
|
* @hidden
|
|
607
612
|
*/
|