@progress/kendo-react-dropdowns 7.2.4-develop.3 → 7.3.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AutoComplete/AutoComplete.js +8 -0
- package/AutoComplete/AutoComplete.mjs +458 -0
- package/ComboBox/ComboBox.js +8 -0
- package/ComboBox/ComboBox.mjs +618 -0
- package/DropDownList/DropDownList.js +8 -0
- package/DropDownList/DropDownList.mjs +630 -0
- package/DropDownTree/DropDownTree.js +8 -0
- package/DropDownTree/DropDownTree.mjs +550 -0
- package/DropDownTree/ListNoData.js +8 -0
- package/DropDownTree/ListNoData.mjs +13 -0
- package/DropDownTree/useDropdownWidth.js +8 -0
- package/DropDownTree/useDropdownWidth.mjs +25 -0
- package/MultiColumnComboBox/MultiColumnComboBox.js +8 -0
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +186 -0
- package/MultiSelect/MultiSelect.js +8 -0
- package/MultiSelect/MultiSelect.mjs +694 -0
- package/MultiSelect/TagList.js +8 -0
- package/MultiSelect/TagList.mjs +48 -0
- package/MultiSelectTree/MultiSelectTree.js +8 -0
- package/MultiSelectTree/MultiSelectTree.mjs +590 -0
- package/MultiSelectTree/utils.js +8 -0
- package/MultiSelectTree/utils.mjs +74 -0
- package/common/AdaptiveMode.js +8 -0
- package/common/AdaptiveMode.mjs +73 -0
- package/common/ClearButton.js +8 -0
- package/common/ClearButton.mjs +38 -0
- package/common/DropDownBase.js +8 -0
- package/common/DropDownBase.mjs +194 -0
- package/common/GroupStickyHeader.js +8 -0
- package/common/GroupStickyHeader.mjs +22 -0
- package/common/List.js +8 -0
- package/common/List.mjs +117 -0
- package/common/ListContainer.js +8 -0
- package/common/ListContainer.mjs +33 -0
- package/common/ListDefaultItem.js +8 -0
- package/common/ListDefaultItem.mjs +36 -0
- package/common/ListFilter.js +8 -0
- package/common/ListFilter.mjs +49 -0
- package/common/ListGroupItem.js +8 -0
- package/common/ListGroupItem.mjs +32 -0
- package/common/ListItem.js +8 -0
- package/common/ListItem.mjs +49 -0
- package/common/MultiColumnList.js +8 -0
- package/common/MultiColumnList.mjs +28 -0
- package/common/Navigation.js +8 -0
- package/common/Navigation.mjs +29 -0
- package/common/SearchBar.js +8 -0
- package/common/SearchBar.mjs +65 -0
- package/common/VirtualScroll.js +8 -0
- package/common/VirtualScroll.mjs +75 -0
- package/common/constants.js +8 -0
- package/common/constants.mjs +13 -0
- package/common/settings.js +8 -0
- package/common/settings.mjs +12 -0
- package/common/utils.js +8 -0
- package/common/utils.mjs +109 -0
- package/common/withCustomComponent.js +8 -0
- package/common/withCustomComponent.mjs +13 -0
- package/dist/cdn/js/kendo-react-dropdowns.js +8 -5
- package/index.d.mts +4098 -5
- package/index.d.ts +4098 -31
- package/index.js +8 -5
- package/index.mjs +55 -4429
- package/messages/index.js +8 -0
- package/messages/index.mjs +27 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +9 -9
- package/AutoComplete/AutoComplete.d.ts +0 -236
- package/AutoComplete/AutoCompleteProps.d.ts +0 -254
- package/ComboBox/ComboBox.d.ts +0 -254
- package/ComboBox/ComboBoxProps.d.ts +0 -324
- package/DropDownList/DropDownList.d.ts +0 -264
- package/DropDownList/DropDownListProps.d.ts +0 -329
- package/DropDownTree/DropDownTree.d.ts +0 -74
- package/DropDownTree/DropDownTreeProps.d.ts +0 -297
- package/DropDownTree/ListNoData.d.ts +0 -10
- package/DropDownTree/useDropdownWidth.d.ts +0 -10
- package/MultiColumnComboBox/MultiColumnComboBox.d.ts +0 -300
- package/MultiSelect/MultiSelect.d.ts +0 -262
- package/MultiSelect/MultiSelectProps.d.ts +0 -325
- package/MultiSelect/TagList.d.ts +0 -42
- package/MultiSelectTree/MultiSelectTree.d.ts +0 -85
- package/MultiSelectTree/MultiSelectTreeProps.d.ts +0 -324
- package/MultiSelectTree/utils.d.ts +0 -21
- package/common/AdaptiveMode.d.ts +0 -25
- package/common/ClearButton.d.ts +0 -18
- package/common/DropDownBase.d.ts +0 -180
- package/common/GroupStickyHeader.d.ts +0 -28
- package/common/List.d.ts +0 -50
- package/common/ListContainer.d.ts +0 -22
- package/common/ListDefaultItem.d.ts +0 -20
- package/common/ListFilter.d.ts +0 -23
- package/common/ListGroupItem.d.ts +0 -37
- package/common/ListItem.d.ts +0 -65
- package/common/MultiColumnList.d.ts +0 -9
- package/common/Navigation.d.ts +0 -17
- package/common/SearchBar.d.ts +0 -47
- package/common/VirtualScroll.d.ts +0 -45
- package/common/constants.d.ts +0 -8
- package/common/events.d.ts +0 -76
- package/common/filterDescriptor.d.ts +0 -45
- package/common/settings.d.ts +0 -109
- package/common/utils.d.ts +0 -70
- package/common/withCustomComponent.d.ts +0 -11
- package/messages/index.d.ts +0 -44
- package/package-metadata.d.ts +0 -9
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import n from "prop-types";
|
|
11
|
+
import { createPropsContext as Xe, validatePackage as Ye, usePropsContext as Ze, useId as et, getTabIndex as tt, useRtl as nt, canUseDOM as ot, Keys as c, noop as U, mapTree as at, extendDataItem as rt, classNames as ne, IconWrap as xe, kendoThemeMaps as it } from "@progress/kendo-react-common";
|
|
12
|
+
import { Popup as lt } from "@progress/kendo-react-popup";
|
|
13
|
+
import { useLocalization as st } from "@progress/kendo-react-intl";
|
|
14
|
+
import { TreeView as we } from "@progress/kendo-react-treeview";
|
|
15
|
+
import { packageMetadata as ct } from "../package-metadata.mjs";
|
|
16
|
+
import { getItemValue as ut, areSame as Fe, isPresent as dt } from "../common/utils.mjs";
|
|
17
|
+
import { useDropdownWidth as pt } from "./useDropdownWidth.mjs";
|
|
18
|
+
import { ListNoData as ft } from "./ListNoData.mjs";
|
|
19
|
+
import { clear as De, messages as oe, nodata as j } from "../messages/index.mjs";
|
|
20
|
+
import { FloatingLabel as mt } from "@progress/kendo-react-labels";
|
|
21
|
+
import Ie from "../common/ListFilter.mjs";
|
|
22
|
+
import { Button as vt } from "@progress/kendo-react-buttons";
|
|
23
|
+
import { xIcon as gt, caretAltDownIcon as bt } from "@progress/kendo-svg-icons";
|
|
24
|
+
import { AdaptiveMode as ht } from "../common/AdaptiveMode.mjs";
|
|
25
|
+
import { ActionSheetContent as yt } from "@progress/kendo-react-layout";
|
|
26
|
+
import { MOBILE_MEDIUM_DEVISE as Et } from "../common/constants.mjs";
|
|
27
|
+
const { sizeMap: Ct, roundedMap: kt } = it, xt = "Please select a value from the list!", wt = (y) => /* @__PURE__ */ t.createElement("span", { className: "k-input-value-text" }, y.children), Se = (y) => y.split("_").map((F) => parseInt(F, 10)), Ft = (y, F) => {
|
|
28
|
+
const { validationMessage: r, valid: a, required: G } = y;
|
|
29
|
+
return {
|
|
30
|
+
customError: r !== void 0,
|
|
31
|
+
valid: !!(a !== void 0 ? a : !G || F),
|
|
32
|
+
valueMissing: !F
|
|
33
|
+
};
|
|
34
|
+
}, Me = {
|
|
35
|
+
selectField: "selected",
|
|
36
|
+
subItemsField: "items",
|
|
37
|
+
popupSettings: {
|
|
38
|
+
animate: !0,
|
|
39
|
+
width: "200px",
|
|
40
|
+
height: "200px"
|
|
41
|
+
},
|
|
42
|
+
data: [],
|
|
43
|
+
required: !1,
|
|
44
|
+
style: {},
|
|
45
|
+
validityStyles: !0,
|
|
46
|
+
size: "medium",
|
|
47
|
+
rounded: "medium",
|
|
48
|
+
fillMode: "solid"
|
|
49
|
+
}, Dt = Xe(), Re = t.forwardRef((y, F) => {
|
|
50
|
+
Ye(ct);
|
|
51
|
+
const r = Ze(Dt, y), a = {
|
|
52
|
+
...Me,
|
|
53
|
+
...r
|
|
54
|
+
}, G = et(), ae = a.id || G, {
|
|
55
|
+
data: T,
|
|
56
|
+
dataItemKey: N,
|
|
57
|
+
popupSettings: D = {},
|
|
58
|
+
style: P,
|
|
59
|
+
opened: u,
|
|
60
|
+
disabled: I,
|
|
61
|
+
onOpen: V = U,
|
|
62
|
+
onClose: f = U,
|
|
63
|
+
placeholder: re,
|
|
64
|
+
label: O,
|
|
65
|
+
name: Te,
|
|
66
|
+
selectField: z,
|
|
67
|
+
subItemsField: K,
|
|
68
|
+
validationMessage: H,
|
|
69
|
+
valid: Ne,
|
|
70
|
+
required: J,
|
|
71
|
+
validityStyles: Pe
|
|
72
|
+
} = a, Q = tt(a.tabIndex, I), i = t.useRef(null), m = t.useRef(null), S = t.useRef(null), X = t.useRef(null), _ = t.useRef(null), b = t.useRef(null), $ = t.useRef(!1), [ie, Ve] = t.useState(void 0), E = a.value !== void 0, v = E ? a.value : ie !== void 0 ? ie : a.defaultValue, B = dt(v), le = B ? ut(v, a.textField) : "", Y = Ft({ validationMessage: H, valid: Ne, required: J }, B), Oe = t.useCallback(() => m.current && m.current.focus(), []);
|
|
73
|
+
t.useImperativeHandle(
|
|
74
|
+
i,
|
|
75
|
+
() => ({
|
|
76
|
+
props: a,
|
|
77
|
+
element: m.current,
|
|
78
|
+
focus: Oe
|
|
79
|
+
})
|
|
80
|
+
), t.useImperativeHandle(F, () => i.current);
|
|
81
|
+
const C = nt(m, a.dir), Ke = {
|
|
82
|
+
width: pt(m, Me, D, P),
|
|
83
|
+
...C !== void 0 ? { direction: C } : {}
|
|
84
|
+
}, [Be, se] = t.useState(!1), l = u !== void 0 ? u : Be, [d, Z] = t.useState(!1), [ee, Le] = t.useState(), k = !!(ee && ee <= Et && a.adaptive), [ce, qe] = t.useState(""), We = t.useCallback(
|
|
85
|
+
() => {
|
|
86
|
+
_.current && _.current.setCustomValidity && _.current.setCustomValidity(
|
|
87
|
+
Y.valid ? "" : H === void 0 ? xt : H
|
|
88
|
+
);
|
|
89
|
+
},
|
|
90
|
+
[H, Y]
|
|
91
|
+
);
|
|
92
|
+
t.useEffect(We), t.useEffect(() => {
|
|
93
|
+
const e = ot && window.ResizeObserver && new window.ResizeObserver(Je.bind(void 0));
|
|
94
|
+
return document != null && document.body && e && e.observe(document.body), () => {
|
|
95
|
+
document != null && document.body && e && e.disconnect();
|
|
96
|
+
};
|
|
97
|
+
}, []);
|
|
98
|
+
const ue = t.useCallback(
|
|
99
|
+
(e) => {
|
|
100
|
+
if (!l) {
|
|
101
|
+
if (V) {
|
|
102
|
+
const o = { ...e };
|
|
103
|
+
V.call(void 0, o);
|
|
104
|
+
}
|
|
105
|
+
u === void 0 && se(!0);
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
[l, u, V]
|
|
109
|
+
), x = t.useCallback(
|
|
110
|
+
(e) => {
|
|
111
|
+
if (l) {
|
|
112
|
+
if (f) {
|
|
113
|
+
const o = { ...e };
|
|
114
|
+
f.call(void 0, o);
|
|
115
|
+
}
|
|
116
|
+
u === void 0 && (se(!1), k && setTimeout(() => {
|
|
117
|
+
var o;
|
|
118
|
+
g((o = X.current) == null ? void 0 : o.element);
|
|
119
|
+
}, 300));
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
[l, u, f, k]
|
|
123
|
+
), Ae = t.useCallback(
|
|
124
|
+
(e) => {
|
|
125
|
+
if (!e.isDefaultPrevented() && i.current) {
|
|
126
|
+
Z(!0);
|
|
127
|
+
const o = {
|
|
128
|
+
syntheticEvent: e,
|
|
129
|
+
nativeEvent: e.nativeEvent,
|
|
130
|
+
target: i.current
|
|
131
|
+
};
|
|
132
|
+
(l ? x : ue)(o);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
[l, u, V, f]
|
|
136
|
+
), M = t.useCallback(
|
|
137
|
+
(e) => {
|
|
138
|
+
$.current = !0, e(), window.setTimeout(() => $.current = !1, 0);
|
|
139
|
+
},
|
|
140
|
+
[]
|
|
141
|
+
), ze = t.useCallback(
|
|
142
|
+
(e) => {
|
|
143
|
+
var w, Ce;
|
|
144
|
+
const { keyCode: o, altKey: s } = e, p = b.current && b.current.element;
|
|
145
|
+
if (!i.current || e.isDefaultPrevented() && ((w = S.current) == null ? void 0 : w.element) === e.target)
|
|
146
|
+
return;
|
|
147
|
+
const R = {
|
|
148
|
+
syntheticEvent: e,
|
|
149
|
+
nativeEvent: e.nativeEvent,
|
|
150
|
+
target: i.current
|
|
151
|
+
};
|
|
152
|
+
if (l)
|
|
153
|
+
if (o === c.esc || s && o === c.up)
|
|
154
|
+
e.preventDefault(), x(R);
|
|
155
|
+
else if (p && p.querySelector(".k-focus") && (o === c.up || o === c.down || o === c.left || o === c.right || o === c.home || o === c.end)) {
|
|
156
|
+
if (o === c.up && ((Ce = S.current) != null && Ce.element)) {
|
|
157
|
+
const W = Array.from(p.querySelectorAll(".k-treeview-item")), ke = [...W].reverse().find((A) => !!(A && A.querySelector(".k-focus")));
|
|
158
|
+
if (ke && W.indexOf(ke) === 0)
|
|
159
|
+
return M(() => {
|
|
160
|
+
var A;
|
|
161
|
+
g((A = S.current) == null ? void 0 : A.element);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
M(U);
|
|
165
|
+
} else
|
|
166
|
+
o === c.down && M(() => {
|
|
167
|
+
var W;
|
|
168
|
+
g(((W = S.current) == null ? void 0 : W.element) || p);
|
|
169
|
+
});
|
|
170
|
+
else
|
|
171
|
+
s && o === c.down ? (e.preventDefault(), ue(R)) : l || o === c.esc && me(e);
|
|
172
|
+
},
|
|
173
|
+
[l, u, V, f]
|
|
174
|
+
), de = t.useCallback(
|
|
175
|
+
(e) => {
|
|
176
|
+
const { keyCode: o, altKey: s } = e;
|
|
177
|
+
s || o !== c.up && o !== c.down || (e.preventDefault(), M(
|
|
178
|
+
o === c.up ? () => {
|
|
179
|
+
g(m.current);
|
|
180
|
+
} : () => {
|
|
181
|
+
g(b.current && b.current.element);
|
|
182
|
+
}
|
|
183
|
+
));
|
|
184
|
+
},
|
|
185
|
+
[]
|
|
186
|
+
), g = t.useCallback(
|
|
187
|
+
(e) => {
|
|
188
|
+
e && M(() => e.focus());
|
|
189
|
+
},
|
|
190
|
+
[]
|
|
191
|
+
), He = t.useCallback(
|
|
192
|
+
() => {
|
|
193
|
+
var e;
|
|
194
|
+
!d && l && !u ? x({ target: i.current }) : r.filterable ? g((e = S.current) == null ? void 0 : e.element) : g(b.current && b.current.element);
|
|
195
|
+
},
|
|
196
|
+
[f, r.filterable, d, u, l]
|
|
197
|
+
), _e = t.useCallback(
|
|
198
|
+
() => {
|
|
199
|
+
d && g(m.current);
|
|
200
|
+
},
|
|
201
|
+
[d]
|
|
202
|
+
), $e = t.useCallback(
|
|
203
|
+
(e) => {
|
|
204
|
+
if (!d && !$.current && (Z(!0), r.onFocus && i.current)) {
|
|
205
|
+
const o = {
|
|
206
|
+
syntheticEvent: e,
|
|
207
|
+
nativeEvent: e.nativeEvent,
|
|
208
|
+
target: i.current
|
|
209
|
+
};
|
|
210
|
+
r.onFocus.call(void 0, o);
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
[d, r.onFocus]
|
|
214
|
+
), Ue = t.useCallback(
|
|
215
|
+
(e) => {
|
|
216
|
+
if (d && !$.current && i.current) {
|
|
217
|
+
Z(!1);
|
|
218
|
+
const o = {
|
|
219
|
+
syntheticEvent: e,
|
|
220
|
+
nativeEvent: e.nativeEvent,
|
|
221
|
+
target: i.current
|
|
222
|
+
};
|
|
223
|
+
if (r.onBlur) {
|
|
224
|
+
const s = { ...o };
|
|
225
|
+
r.onBlur.call(void 0, s);
|
|
226
|
+
}
|
|
227
|
+
k || x(o);
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
[d, r.onBlur, l, u, f]
|
|
231
|
+
), je = t.useCallback(
|
|
232
|
+
() => {
|
|
233
|
+
d && M(U), k && setTimeout(() => {
|
|
234
|
+
var e;
|
|
235
|
+
g((e = X.current) == null ? void 0 : e.element);
|
|
236
|
+
}, 300);
|
|
237
|
+
},
|
|
238
|
+
[d, k]
|
|
239
|
+
), pe = t.useCallback(
|
|
240
|
+
(e, o, s) => {
|
|
241
|
+
if (r.onChange) {
|
|
242
|
+
const p = {
|
|
243
|
+
value: o,
|
|
244
|
+
level: s ? Se(s) : [],
|
|
245
|
+
...e
|
|
246
|
+
};
|
|
247
|
+
r.onChange.call(void 0, p);
|
|
248
|
+
}
|
|
249
|
+
E || Ve(o);
|
|
250
|
+
},
|
|
251
|
+
[r.onChange, E]
|
|
252
|
+
), fe = t.useCallback(
|
|
253
|
+
(e) => {
|
|
254
|
+
if (Fe(e.item, v, N) || !i.current)
|
|
255
|
+
return;
|
|
256
|
+
const { item: o, itemHierarchicalIndex: s, nativeEvent: p, syntheticEvent: R } = e, w = {
|
|
257
|
+
syntheticEvent: R,
|
|
258
|
+
nativeEvent: p,
|
|
259
|
+
target: i.current
|
|
260
|
+
};
|
|
261
|
+
pe(w, o, s), x(w);
|
|
262
|
+
},
|
|
263
|
+
[E, v, r.onChange, N, l, u, f]
|
|
264
|
+
), me = t.useCallback(
|
|
265
|
+
(e) => {
|
|
266
|
+
if (!i.current)
|
|
267
|
+
return;
|
|
268
|
+
const o = {
|
|
269
|
+
syntheticEvent: e,
|
|
270
|
+
nativeEvent: e.nativeEvent,
|
|
271
|
+
target: i.current
|
|
272
|
+
};
|
|
273
|
+
pe(o, null), x(o), e.preventDefault();
|
|
274
|
+
},
|
|
275
|
+
[E, r.onChange, l, u, f]
|
|
276
|
+
), ve = t.useCallback(
|
|
277
|
+
(e) => {
|
|
278
|
+
if (e.syntheticEvent.stopPropagation(), r.onExpandChange && i.current) {
|
|
279
|
+
const { item: o, itemHierarchicalIndex: s, nativeEvent: p, syntheticEvent: R } = e, w = {
|
|
280
|
+
level: Se(s),
|
|
281
|
+
item: o,
|
|
282
|
+
nativeEvent: p,
|
|
283
|
+
syntheticEvent: R,
|
|
284
|
+
target: i.current
|
|
285
|
+
};
|
|
286
|
+
r.onExpandChange.call(void 0, w);
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
[r.onExpandChange]
|
|
290
|
+
), ge = t.useCallback(
|
|
291
|
+
(e) => {
|
|
292
|
+
if (r.onFilterChange && i.current) {
|
|
293
|
+
const s = {
|
|
294
|
+
filter: { field: r.textField, operator: "contains", value: e.target.value },
|
|
295
|
+
syntheticEvent: e.syntheticEvent,
|
|
296
|
+
nativeEvent: e.nativeEvent,
|
|
297
|
+
target: i.current
|
|
298
|
+
};
|
|
299
|
+
r.onFilterChange.call(void 0, s), r.filter === void 0 && qe(e.target.value);
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
[r.onFilterChange, r.filter, r.textField]
|
|
303
|
+
), Ge = () => {
|
|
304
|
+
const e = a.filterable ? /* @__PURE__ */ t.createElement(
|
|
305
|
+
Ie,
|
|
306
|
+
{
|
|
307
|
+
value: a.filter === void 0 ? ce : a.filter,
|
|
308
|
+
ref: X,
|
|
309
|
+
onChange: ge,
|
|
310
|
+
onKeyDown: de,
|
|
311
|
+
size: h,
|
|
312
|
+
rounded: L,
|
|
313
|
+
fillMode: q
|
|
314
|
+
}
|
|
315
|
+
) : null, o = {
|
|
316
|
+
adaptiveTitle: a.adaptiveTitle,
|
|
317
|
+
expand: l,
|
|
318
|
+
onClose: (s) => x(s),
|
|
319
|
+
windowWidth: ee,
|
|
320
|
+
mobileFilter: e
|
|
321
|
+
};
|
|
322
|
+
return /* @__PURE__ */ t.createElement(ht, { ...o }, /* @__PURE__ */ t.createElement(yt, { className: "!k-overflow-hidden" }, /* @__PURE__ */ t.createElement("div", { className: "k-list-container" }, /* @__PURE__ */ t.createElement("div", { className: "k-list k-list-lg" }, T.length > 0 ? /* @__PURE__ */ t.createElement(
|
|
323
|
+
we,
|
|
324
|
+
{
|
|
325
|
+
ref: b,
|
|
326
|
+
tabIndex: Q,
|
|
327
|
+
data: be,
|
|
328
|
+
focusIdField: N,
|
|
329
|
+
textField: a.textField,
|
|
330
|
+
selectField: z,
|
|
331
|
+
expandField: a.expandField,
|
|
332
|
+
childrenField: K,
|
|
333
|
+
expandIcons: !0,
|
|
334
|
+
onItemClick: fe,
|
|
335
|
+
onExpandChange: ve,
|
|
336
|
+
size: h,
|
|
337
|
+
item: a.item,
|
|
338
|
+
dir: C
|
|
339
|
+
}
|
|
340
|
+
) : /* @__PURE__ */ t.createElement(he, null, te.toLanguageString(j, oe[j]))))));
|
|
341
|
+
}, Je = t.useCallback(
|
|
342
|
+
(e) => {
|
|
343
|
+
for (let o of e)
|
|
344
|
+
Le(o.target.clientWidth);
|
|
345
|
+
},
|
|
346
|
+
[]
|
|
347
|
+
), be = t.useMemo(
|
|
348
|
+
() => E || !B ? T : at(
|
|
349
|
+
T,
|
|
350
|
+
K,
|
|
351
|
+
(e) => rt(
|
|
352
|
+
e,
|
|
353
|
+
K,
|
|
354
|
+
{ [z]: Fe(e, v, N) }
|
|
355
|
+
)
|
|
356
|
+
),
|
|
357
|
+
[T, v, E, B, z, K]
|
|
358
|
+
), he = a.listNoData || ft, Qe = a.valueHolder || wt, te = st(), ye = !Pe || Y.valid, { size: h, rounded: L, fillMode: q } = a, Ee = /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
359
|
+
"span",
|
|
360
|
+
{
|
|
361
|
+
className: ne("k-dropdowntree k-picker", a.className, {
|
|
362
|
+
[`k-picker-${Ct[h] || h}`]: h,
|
|
363
|
+
[`k-rounded-${kt[L] || L}`]: L,
|
|
364
|
+
[`k-picker-${q}`]: q,
|
|
365
|
+
"k-focus": d,
|
|
366
|
+
"k-invalid": !ye,
|
|
367
|
+
"k-loading": a.loading,
|
|
368
|
+
"k-required": J,
|
|
369
|
+
"k-disabled": a.disabled
|
|
370
|
+
}),
|
|
371
|
+
tabIndex: Q,
|
|
372
|
+
accessKey: a.accessKey,
|
|
373
|
+
id: ae,
|
|
374
|
+
style: O ? { ...P, width: void 0 } : P,
|
|
375
|
+
dir: C,
|
|
376
|
+
ref: m,
|
|
377
|
+
onKeyDown: I ? void 0 : ze,
|
|
378
|
+
onMouseDown: je,
|
|
379
|
+
onClick: I ? void 0 : Ae,
|
|
380
|
+
onFocus: $e,
|
|
381
|
+
onBlur: Ue,
|
|
382
|
+
role: "combobox",
|
|
383
|
+
"aria-haspopup": "tree",
|
|
384
|
+
"aria-expanded": l,
|
|
385
|
+
"aria-disabled": I,
|
|
386
|
+
"aria-label": O,
|
|
387
|
+
"aria-labelledby": a.ariaLabelledBy,
|
|
388
|
+
"aria-describedby": a.ariaDescribedBy,
|
|
389
|
+
"aria-required": J
|
|
390
|
+
},
|
|
391
|
+
/* @__PURE__ */ t.createElement("span", { className: "k-input-inner" }, /* @__PURE__ */ t.createElement(Qe, { item: v }, le || re)),
|
|
392
|
+
a.loading && /* @__PURE__ */ t.createElement(xe, { className: "k-input-loading-icon", name: "loading" }),
|
|
393
|
+
B && !I && /* @__PURE__ */ t.createElement(
|
|
394
|
+
"span",
|
|
395
|
+
{
|
|
396
|
+
onClick: me,
|
|
397
|
+
className: "k-clear-value",
|
|
398
|
+
title: te.toLanguageString(De, oe[De]),
|
|
399
|
+
role: "button",
|
|
400
|
+
tabIndex: -1,
|
|
401
|
+
onMouseDown: (e) => e.preventDefault()
|
|
402
|
+
},
|
|
403
|
+
/* @__PURE__ */ t.createElement(xe, { name: "x", icon: gt })
|
|
404
|
+
),
|
|
405
|
+
/* @__PURE__ */ t.createElement(
|
|
406
|
+
vt,
|
|
407
|
+
{
|
|
408
|
+
tabIndex: -1,
|
|
409
|
+
type: "button",
|
|
410
|
+
"aria-label": "select",
|
|
411
|
+
className: "k-input-button",
|
|
412
|
+
size: h,
|
|
413
|
+
fillMode: q,
|
|
414
|
+
themeColor: "base",
|
|
415
|
+
rounded: null,
|
|
416
|
+
icon: "caret-alt-down",
|
|
417
|
+
svgIcon: bt
|
|
418
|
+
}
|
|
419
|
+
),
|
|
420
|
+
/* @__PURE__ */ t.createElement(
|
|
421
|
+
"select",
|
|
422
|
+
{
|
|
423
|
+
name: Te,
|
|
424
|
+
ref: _,
|
|
425
|
+
tabIndex: -1,
|
|
426
|
+
"aria-hidden": !0,
|
|
427
|
+
title: O,
|
|
428
|
+
style: { opacity: 0, width: 1, border: 0, zIndex: -1, position: "absolute", left: "50%" }
|
|
429
|
+
},
|
|
430
|
+
/* @__PURE__ */ t.createElement("option", { value: a.valueMap ? a.valueMap.call(void 0, v) : v })
|
|
431
|
+
),
|
|
432
|
+
!k && /* @__PURE__ */ t.createElement(
|
|
433
|
+
lt,
|
|
434
|
+
{
|
|
435
|
+
...D,
|
|
436
|
+
className: ne(D.className, { "k-rtl": C === "rtl" }),
|
|
437
|
+
popupClass: ne(D.popupClass, "k-dropdowntree-popup"),
|
|
438
|
+
style: Ke,
|
|
439
|
+
anchor: D.anchor || m.current,
|
|
440
|
+
show: l,
|
|
441
|
+
onOpen: He,
|
|
442
|
+
onClose: _e
|
|
443
|
+
},
|
|
444
|
+
a.filterable && /* @__PURE__ */ t.createElement(
|
|
445
|
+
Ie,
|
|
446
|
+
{
|
|
447
|
+
value: a.filter === void 0 ? ce : a.filter,
|
|
448
|
+
ref: S,
|
|
449
|
+
onChange: ge,
|
|
450
|
+
onKeyDown: de,
|
|
451
|
+
size: h,
|
|
452
|
+
rounded: L,
|
|
453
|
+
fillMode: q
|
|
454
|
+
}
|
|
455
|
+
),
|
|
456
|
+
T.length > 0 ? /* @__PURE__ */ t.createElement(
|
|
457
|
+
we,
|
|
458
|
+
{
|
|
459
|
+
style: { height: D.height },
|
|
460
|
+
ref: b,
|
|
461
|
+
tabIndex: Q,
|
|
462
|
+
data: be,
|
|
463
|
+
focusIdField: N,
|
|
464
|
+
textField: a.textField,
|
|
465
|
+
selectField: z,
|
|
466
|
+
expandField: a.expandField,
|
|
467
|
+
childrenField: K,
|
|
468
|
+
expandIcons: !0,
|
|
469
|
+
onItemClick: fe,
|
|
470
|
+
onExpandChange: ve,
|
|
471
|
+
size: h,
|
|
472
|
+
item: a.item,
|
|
473
|
+
dir: C
|
|
474
|
+
}
|
|
475
|
+
) : /* @__PURE__ */ t.createElement(he, null, te.toLanguageString(j, oe[j]))
|
|
476
|
+
)
|
|
477
|
+
), k && Ge());
|
|
478
|
+
return O ? /* @__PURE__ */ t.createElement(
|
|
479
|
+
mt,
|
|
480
|
+
{
|
|
481
|
+
label: O,
|
|
482
|
+
editorValue: le,
|
|
483
|
+
editorPlaceholder: re,
|
|
484
|
+
editorValid: ye,
|
|
485
|
+
editorDisabled: I,
|
|
486
|
+
editorId: ae,
|
|
487
|
+
style: { width: P ? P.width : void 0 },
|
|
488
|
+
children: Ee,
|
|
489
|
+
dir: C
|
|
490
|
+
}
|
|
491
|
+
) : Ee;
|
|
492
|
+
}), It = {
|
|
493
|
+
opened: n.bool,
|
|
494
|
+
disabled: n.bool,
|
|
495
|
+
dir: n.string,
|
|
496
|
+
tabIndex: n.number,
|
|
497
|
+
accessKey: n.string,
|
|
498
|
+
data: n.array,
|
|
499
|
+
value: n.any,
|
|
500
|
+
valueMap: n.func,
|
|
501
|
+
placeholder: n.string,
|
|
502
|
+
dataItemKey: n.string.isRequired,
|
|
503
|
+
textField: n.string.isRequired,
|
|
504
|
+
selectField: n.string,
|
|
505
|
+
expandField: n.string,
|
|
506
|
+
subItemsField: n.string,
|
|
507
|
+
className: n.string,
|
|
508
|
+
style: n.object,
|
|
509
|
+
label: n.string,
|
|
510
|
+
validationMessage: n.string,
|
|
511
|
+
validityStyles: n.bool,
|
|
512
|
+
valid: n.bool,
|
|
513
|
+
required: n.bool,
|
|
514
|
+
name: n.string,
|
|
515
|
+
id: n.string,
|
|
516
|
+
ariaLabelledBy: n.string,
|
|
517
|
+
ariaDescribedBy: n.string,
|
|
518
|
+
filterable: n.bool,
|
|
519
|
+
filter: n.string,
|
|
520
|
+
loading: n.bool,
|
|
521
|
+
popupSettings: n.shape({
|
|
522
|
+
animate: n.oneOfType([n.bool, n.shape({
|
|
523
|
+
openDuration: n.number,
|
|
524
|
+
closeDuration: n.number
|
|
525
|
+
})]),
|
|
526
|
+
popupClass: n.string,
|
|
527
|
+
className: n.string,
|
|
528
|
+
appendTo: n.any,
|
|
529
|
+
width: n.oneOfType([n.string, n.number]),
|
|
530
|
+
height: n.oneOfType([n.string, n.number])
|
|
531
|
+
}),
|
|
532
|
+
onOpen: n.func,
|
|
533
|
+
onClose: n.func,
|
|
534
|
+
onFocus: n.func,
|
|
535
|
+
onBlur: n.func,
|
|
536
|
+
onChange: n.func,
|
|
537
|
+
onFilterChange: n.func,
|
|
538
|
+
onExpandChange: n.func,
|
|
539
|
+
item: n.func,
|
|
540
|
+
valueHolder: n.func,
|
|
541
|
+
listNoData: n.func,
|
|
542
|
+
adaptiveTitle: n.string,
|
|
543
|
+
adaptive: n.bool
|
|
544
|
+
};
|
|
545
|
+
Re.displayName = "KendoReactDropDownTree";
|
|
546
|
+
Re.propTypes = It;
|
|
547
|
+
export {
|
|
548
|
+
Re as DropDownTree,
|
|
549
|
+
Dt as DropDownTreePropsContext
|
|
550
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react");function o(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const c=o(r),l=e=>c.createElement("div",{className:"k-nodata"},c.createElement("div",null,e.children));exports.ListNoData=l;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as e from "react";
|
|
10
|
+
const a = (t) => /* @__PURE__ */ e.createElement("div", { className: "k-nodata" }, /* @__PURE__ */ e.createElement("div", null, t.children));
|
|
11
|
+
export {
|
|
12
|
+
a as ListNoData
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react");function p(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:()=>t[i]})}}return e.default=t,Object.freeze(e)}const u=p(s);function h(t,e,i){const[n,o]=u.useState(e);return u.useEffect(()=>{n!==void 0&&t.current&&o(t.current.offsetWidth)},i),n}function f(t,e,i,n){const o=i.width!==void 0&&i.width!==e.popupSettings.width,d=n.width!==void 0,r=o?i.width:d?n.width:e.popupSettings.width,c=h(t,r);return o||d?r:c&&c>e.popupSettings.width?c:e.popupSettings.width}exports.useDropdownWidth=f;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as p from "react";
|
|
10
|
+
function u(d, t, i) {
|
|
11
|
+
const [n, e] = p.useState(t);
|
|
12
|
+
return p.useEffect(
|
|
13
|
+
() => {
|
|
14
|
+
n !== void 0 && d.current && e(d.current.offsetWidth);
|
|
15
|
+
},
|
|
16
|
+
i
|
|
17
|
+
), n;
|
|
18
|
+
}
|
|
19
|
+
function c(d, t, i, n) {
|
|
20
|
+
const e = i.width !== void 0 && i.width !== t.popupSettings.width, o = n.width !== void 0, s = e ? i.width : o ? n.width : t.popupSettings.width, h = u(d, s);
|
|
21
|
+
return e || o ? s : h && h > t.popupSettings.width ? h : t.popupSettings.width;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
c as useDropdownWidth
|
|
25
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ne=require("react"),le=require("prop-types"),se=require("@progress/kendo-react-popup"),ue=require("../common/MultiColumnList.js"),u=require("@progress/kendo-react-common"),j=require("../ComboBox/ComboBox.js"),ie=require("../common/utils.js"),K=require("../common/withCustomComponent.js");function de(a){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const d=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(i,e,d.get?d:{enumerable:!0,get:()=>a[e]})}}return i.default=a,Object.freeze(i)}const t=de(ne),ce=(a,i)=>a?typeof a=="number"?a+"px":a:i,G=u.createPropsContext(),k=t.forwardRef((a,i)=>{const e=u.usePropsContext(G,a),d=t.useRef(null),n=t.useRef(null),w=u.getScrollbarWidth(),{columns:l=m.columns,popupSettings:f=m.popupSettings,className:W,size:me,prefix:z=void 0,suffix:L=void 0,onOpen:M,onClose:S,onFocus:E,onBlur:F,onChange:N,onFilterChange:R,onPageChange:H,..._}=e;t.useImperativeHandle(d,()=>({element:n.current&&n.current.element,focus(){n.current&&n.current.focus()},get value(){return n.current&&n.current.value},get name(){return n.current&&n.current.name},props:e})),t.useImperativeHandle(i,()=>d.current);const g=t.useMemo(()=>{if(e.groupField!==void 0&&e.data)return ie.getItemValue(e.data[0],e.groupField)},[e.data,e.groupField]),[v,C]=t.useState(g),[q,B]=t.useState(!0),[$]=z?K(e.prefix||t.Fragment):[],[D]=L?K(e.suffix||t.Fragment):[],V=t.useMemo(()=>{const o=t.createElement("th",{className:"k-table-th",colSpan:l.length},v);return t.createElement(t.Fragment,null,e.header,t.createElement("div",{className:"k-table-header-wrap"},t.createElement("table",{className:"k-table",role:"presentation"},t.createElement("colgroup",null,l.map((r,c)=>t.createElement("col",{key:r.uniqueKey?r.uniqueKey:c,style:{width:r.width?r.width:m.width}}))),t.createElement("thead",{className:"k-table-thead"},t.createElement("tr",{className:"k-table-row"},l.map((r,c)=>t.createElement("th",{className:"k-table-th",key:r.uniqueKey?r.uniqueKey:c},r.header||" "))),v&&q&&t.createElement("tr",{className:"k-table-group-row"},e.groupStickyHeaderItemRender?e.groupStickyHeaderItemRender.call(void 0,o,{}):o)))))},[e.header,l,v,q]),A=t.useMemo(()=>`calc(${l.map(o=>ce(o.width,m.width)).filter(Boolean).join(" + ")} + ${w}px + 4px)`,[l,w]),P=e.virtual?e.virtual.skip:0,J=t.useCallback((o,r)=>{const c=l.map((p,ae)=>t.createElement("span",{className:e.itemRender?void 0:"k-table-td",style:e.itemRender?void 0:{width:p.width?p.width:m.width},key:p.uniqueKey?p.uniqueKey:ae},p.field?String(u.getter(p.field)(r.dataItem)):""));let b,h,x,y,I=e.data||[];const O=r.index-P;e.groupField!==void 0&&(y=u.getter(e.groupField),h=y(I[O]),x=y(I[O-1]),h&&x&&h!==x&&(b=h)),b&&e.groupMode==="classic"&&c.push(t.createElement("div",{key:"group",className:"k-table-td k-table-group-td"},t.createElement("span",null,b)));const T=t.cloneElement(o,{...o.props,className:u.classNames("k-table-row",{"k-table-alt-row":r.index%2!==0,"k-focus":r.focused,"k-selected":r.selected,"k-first":!!b,"k-disabled":r.dataItem.disabled})},c);return e.itemRender?e.itemRender.call(void 0,T,r):T},[l,e.groupField,e.itemRender,e.data,P]),s=t.useCallback((o,r)=>{o&&o.call(void 0,{...r,target:d.current})},[]),Q=t.useCallback(o=>(e.virtual||C(g),s(M,o)),[s,M,e.virtual,g]),U=t.useCallback(o=>s(S,o),[S]),X=t.useCallback(o=>s(E,o),[E]),Y=t.useCallback(o=>s(F,o),[F]),Z=t.useCallback(o=>s(N,o),[N]),ee=t.useCallback(o=>s(H,o),[H]),te=t.useCallback(o=>(C(g),s(R,{...o,mobileMode:o.target.mobileMode})),[R]),oe=t.useCallback(o=>{C(o.group)},[]);t.useEffect(()=>{u.setScrollbarWidth()}),t.useEffect(()=>{const o=e.data;C(g),o&&o.length!==0?B(!0):B(!1)},[e.data]);const re=t.useCallback(o=>t.createElement(ue.MultiColumnList,{...o}),[]);return t.createElement(se.PopupPropsContext.Provider,{value:o=>({...o,popupClass:`k-dropdowngrid-popup ${f.popupClass}`})},t.createElement(j.ComboBox,{..._,list:re,popupSettings:{...f,width:f.width||A,className:f.className},ref:n,header:V,itemRender:J,groupHeaderItemRender:e.groupHeaderItemRender,size:e.size,rounded:e.rounded,fillMode:e.fillMode,groupMode:e.groupMode,groupField:e.groupField,isMultiColumn:!0,onOpen:Q,onClose:U,onFocus:X,onBlur:Y,onChange:Z,onFilterChange:te,onPageChange:ee,onGroupScroll:oe,className:u.classNames("k-dropdowngrid",W),required:e.required,adaptive:e.adaptive,adaptiveFilter:e.adaptiveFilter,adaptiveTitle:e.adaptiveTitle,footer:e.footer,footerClassName:"k-table-footer",prefix:$,suffix:D}))}),pe={...j.ComboBoxWithoutContext.propTypes,columns:le.any.isRequired},m={columns:[],popupSettings:{},width:"200px",size:"medium",rounded:"medium",fillMode:"solid"};k.displayName="KendoMultiColumnComboBox";k.propTypes=pe;k.defaultProps=m;exports.MultiColumnComboBox=k;exports.MultiColumnComboBoxPropsContext=G;
|