@progress/kendo-react-dropdowns 14.0.0-develop.1 → 14.0.0-develop.3
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 +4 -4
- package/ComboBox/ComboBox.js +1 -1
- package/ComboBox/ComboBox.mjs +6 -5
- package/ComboBox/ComboBoxProps.d.ts +4 -0
- package/DropDownList/DropDownList.mjs +9 -9
- package/DropDownTree/DropDownTree.mjs +12 -12
- package/MultiColumnComboBox/MultiColumnComboBox.js +1 -1
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +93 -90
- package/MultiSelect/MultiSelect.mjs +4 -4
- package/MultiSelectTree/MultiSelectTree.mjs +9 -9
- package/common/List.d.ts +7 -0
- package/common/List.js +1 -1
- package/common/List.mjs +50 -50
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +1 -1
- package/package.json +12 -12
|
@@ -6,46 +6,46 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
import * as e from "react";
|
|
9
|
-
import
|
|
10
|
-
import { MultiColumnList as
|
|
11
|
-
import {
|
|
12
|
-
import { ComboBox as
|
|
13
|
-
import { getItemValue as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
9
|
+
import ue from "prop-types";
|
|
10
|
+
import { MultiColumnList as de } from "../common/MultiColumnList.mjs";
|
|
11
|
+
import { usePropsContext as ce, getScrollbarWidth as pe, getter as T, classNames as x, setScrollbarWidth as me, createPropsContext as fe } from "@progress/kendo-react-common";
|
|
12
|
+
import { ComboBox as ge, ComboBoxWithoutContext as he } from "../ComboBox/ComboBox.mjs";
|
|
13
|
+
import { getItemValue as Ce } from "../common/utils.mjs";
|
|
14
|
+
import L from "../common/withCustomComponent.mjs";
|
|
15
|
+
const be = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, ke = fe(), P = e.forwardRef(
|
|
16
16
|
(s, g) => {
|
|
17
|
-
const t =
|
|
18
|
-
columns:
|
|
17
|
+
const t = ce(ke, s), h = e.useRef(null), i = e.useRef(null), y = pe(), {
|
|
18
|
+
columns: a = l.columns,
|
|
19
19
|
popupSettings: p = l.popupSettings,
|
|
20
20
|
size: z = l.size,
|
|
21
21
|
rounded: O = l.rounded,
|
|
22
|
-
fillMode:
|
|
23
|
-
className:
|
|
24
|
-
prefix:
|
|
25
|
-
suffix:
|
|
26
|
-
onOpen:
|
|
27
|
-
onClose:
|
|
22
|
+
fillMode: $ = l.fillMode,
|
|
23
|
+
className: j,
|
|
24
|
+
prefix: V = void 0,
|
|
25
|
+
suffix: A = void 0,
|
|
26
|
+
onOpen: w,
|
|
27
|
+
onClose: S,
|
|
28
28
|
onFocus: F,
|
|
29
|
-
onBlur:
|
|
30
|
-
onChange:
|
|
29
|
+
onBlur: H,
|
|
30
|
+
onChange: R,
|
|
31
31
|
onFilterChange: E,
|
|
32
32
|
onPageChange: N,
|
|
33
|
-
...
|
|
33
|
+
...D
|
|
34
34
|
} = t;
|
|
35
35
|
e.useImperativeHandle(h, () => {
|
|
36
|
-
var
|
|
36
|
+
var r;
|
|
37
37
|
return {
|
|
38
|
-
element: ((
|
|
38
|
+
element: ((r = i.current) == null ? void 0 : r.element) || null,
|
|
39
39
|
focus() {
|
|
40
40
|
i.current && i.current.focus();
|
|
41
41
|
},
|
|
42
42
|
get value() {
|
|
43
|
-
var
|
|
44
|
-
return (
|
|
43
|
+
var o;
|
|
44
|
+
return (o = i.current) == null ? void 0 : o.value;
|
|
45
45
|
},
|
|
46
46
|
get name() {
|
|
47
|
-
var
|
|
48
|
-
return (
|
|
47
|
+
var o;
|
|
48
|
+
return (o = i.current) == null ? void 0 : o.name;
|
|
49
49
|
},
|
|
50
50
|
props: t
|
|
51
51
|
};
|
|
@@ -55,106 +55,109 @@ const he = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, Ce = ue(), P =
|
|
|
55
55
|
);
|
|
56
56
|
const d = e.useMemo(() => {
|
|
57
57
|
if (t.groupField !== void 0 && t.data)
|
|
58
|
-
return
|
|
59
|
-
}, [t.data, t.groupField]), [C, m] = e.useState(d), [
|
|
60
|
-
const
|
|
61
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, t.header, /* @__PURE__ */ e.createElement("div", { className: "k-table-header-wrap
|
|
58
|
+
return Ce(t.data[0], t.groupField);
|
|
59
|
+
}, [t.data, t.groupField]), [C, m] = e.useState(d), [M, B] = e.useState(!0), b = e.useRef(null), [J] = V ? L(t.prefix || e.Fragment) : [], [Q] = A ? L(t.suffix || e.Fragment) : [], U = e.useMemo(() => {
|
|
60
|
+
const r = /* @__PURE__ */ e.createElement("th", { className: "k-table-th", colSpan: a.length }, C);
|
|
61
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, t.header, /* @__PURE__ */ e.createElement("div", { ref: b, className: "k-table-header-wrap" }, /* @__PURE__ */ e.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ e.createElement("colgroup", null, a.map((o, c) => /* @__PURE__ */ e.createElement(
|
|
62
62
|
"col",
|
|
63
63
|
{
|
|
64
|
-
key:
|
|
65
|
-
style: { width:
|
|
64
|
+
key: o.uniqueKey ? o.uniqueKey : c,
|
|
65
|
+
style: { width: o.width ? o.width : l.width }
|
|
66
66
|
}
|
|
67
|
-
))), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" },
|
|
68
|
-
}, [t.header,
|
|
67
|
+
))), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" }, a.map((o, c) => /* @__PURE__ */ e.createElement("th", { className: "k-table-th", key: o.uniqueKey ? o.uniqueKey : c }, o.header || " "))), C && M && /* @__PURE__ */ e.createElement("tr", { className: "k-table-group-row" }, t.groupStickyHeaderItemRender ? t.groupStickyHeaderItemRender.call(void 0, r, {}) : r)))));
|
|
68
|
+
}, [t.header, a, C, M]), X = e.useMemo(
|
|
69
69
|
() => (
|
|
70
70
|
// These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
|
|
71
|
-
`calc(${
|
|
71
|
+
`calc(${a.map((r) => be(r.width, l.width)).filter(Boolean).join(" + ")} + ${y}px + 4px)`
|
|
72
72
|
),
|
|
73
|
-
[
|
|
74
|
-
),
|
|
75
|
-
(
|
|
76
|
-
const c =
|
|
73
|
+
[a, y]
|
|
74
|
+
), q = t.virtual ? t.virtual.skip : 0, Y = e.useCallback(
|
|
75
|
+
(r, o) => {
|
|
76
|
+
const c = a.map((u, ie) => /* @__PURE__ */ e.createElement(
|
|
77
77
|
"span",
|
|
78
78
|
{
|
|
79
79
|
className: t.itemRender ? void 0 : "k-table-td",
|
|
80
80
|
style: t.itemRender ? void 0 : { width: u.width ? u.width : l.width },
|
|
81
|
-
key: u.uniqueKey ? u.uniqueKey :
|
|
81
|
+
key: u.uniqueKey ? u.uniqueKey : ie
|
|
82
82
|
},
|
|
83
|
-
u.field ? String(T(u.field)(
|
|
83
|
+
u.field ? String(T(u.field)(o.dataItem)) : ""
|
|
84
84
|
));
|
|
85
|
-
let
|
|
86
|
-
const
|
|
87
|
-
t.groupField !== void 0 && (
|
|
85
|
+
let I, f, k, v, K = t.data || [];
|
|
86
|
+
const W = o.index - q;
|
|
87
|
+
t.groupField !== void 0 && (v = T(t.groupField), f = v(K[W]), k = v(K[W - 1]), f && k && f !== k && (I = f));
|
|
88
88
|
const G = e.cloneElement(
|
|
89
|
-
|
|
89
|
+
r,
|
|
90
90
|
{
|
|
91
|
-
...
|
|
92
|
-
className:
|
|
93
|
-
"k-table-alt-row":
|
|
94
|
-
"k-focus":
|
|
95
|
-
"k-selected":
|
|
96
|
-
"k-first": !!
|
|
97
|
-
"k-disabled":
|
|
91
|
+
...r.props,
|
|
92
|
+
className: x("k-table-row", {
|
|
93
|
+
"k-table-alt-row": o.index % 2 !== 0,
|
|
94
|
+
"k-focus": o.focused,
|
|
95
|
+
"k-selected": o.selected,
|
|
96
|
+
"k-first": !!I,
|
|
97
|
+
"k-disabled": o.dataItem.disabled
|
|
98
98
|
})
|
|
99
99
|
},
|
|
100
100
|
c
|
|
101
101
|
);
|
|
102
|
-
return t.itemRender ? t.itemRender.call(void 0, G,
|
|
102
|
+
return t.itemRender ? t.itemRender.call(void 0, G, o) : G;
|
|
103
103
|
},
|
|
104
|
-
[
|
|
105
|
-
), n = e.useCallback((
|
|
106
|
-
|
|
107
|
-
...
|
|
104
|
+
[a, t.groupField, t.itemRender, t.data, q]
|
|
105
|
+
), n = e.useCallback((r, o) => {
|
|
106
|
+
r && r.call(void 0, {
|
|
107
|
+
...o,
|
|
108
108
|
target: h.current
|
|
109
109
|
});
|
|
110
|
-
}, []),
|
|
111
|
-
(
|
|
112
|
-
[n,
|
|
113
|
-
),
|
|
114
|
-
(
|
|
115
|
-
...
|
|
116
|
-
mobileMode:
|
|
110
|
+
}, []), Z = e.useCallback(
|
|
111
|
+
(r) => (t.virtual || m(d), n(w, r)),
|
|
112
|
+
[n, w, t.virtual, d]
|
|
113
|
+
), _ = e.useCallback((r) => n(S, r), [S]), ee = e.useCallback((r) => n(F, r), [F]), te = e.useCallback((r) => n(H, r), [H]), re = e.useCallback((r) => n(R, r), [R]), oe = e.useCallback((r) => n(N, r), [N]), ae = e.useCallback(
|
|
114
|
+
(r) => (m(d), n(E, {
|
|
115
|
+
...r,
|
|
116
|
+
mobileMode: r.target.mobileMode
|
|
117
117
|
})),
|
|
118
118
|
[E]
|
|
119
|
-
),
|
|
120
|
-
m(
|
|
119
|
+
), ne = e.useCallback((r) => {
|
|
120
|
+
m(r.group);
|
|
121
|
+
}, []), le = e.useCallback((r) => {
|
|
122
|
+
b.current && (b.current.scrollLeft = r.target.scrollLeft);
|
|
121
123
|
}, []);
|
|
122
124
|
e.useEffect(() => {
|
|
123
|
-
|
|
125
|
+
me();
|
|
124
126
|
}), e.useEffect(() => {
|
|
125
|
-
const
|
|
126
|
-
m(d),
|
|
127
|
+
const r = t.data;
|
|
128
|
+
m(d), r && r.length !== 0 ? B(!0) : B(!1);
|
|
127
129
|
}, [t.data]);
|
|
128
|
-
const
|
|
130
|
+
const se = e.useCallback((r) => /* @__PURE__ */ e.createElement(de, { ...r }), []);
|
|
129
131
|
return /* @__PURE__ */ e.createElement(
|
|
130
|
-
|
|
132
|
+
ge,
|
|
131
133
|
{
|
|
132
|
-
...
|
|
133
|
-
list:
|
|
134
|
+
...D,
|
|
135
|
+
list: se,
|
|
134
136
|
popupSettings: {
|
|
135
137
|
...p,
|
|
136
|
-
popupClass:
|
|
137
|
-
width: p.width ||
|
|
138
|
+
popupClass: x("k-dropdowngrid-popup", p.popupClass),
|
|
139
|
+
width: p.width || X,
|
|
138
140
|
className: p.className
|
|
139
141
|
},
|
|
140
142
|
ref: i,
|
|
141
|
-
header:
|
|
142
|
-
itemRender:
|
|
143
|
+
header: U,
|
|
144
|
+
itemRender: Y,
|
|
143
145
|
groupHeaderItemRender: t.groupHeaderItemRender,
|
|
144
146
|
size: z,
|
|
145
147
|
rounded: O,
|
|
146
|
-
fillMode:
|
|
148
|
+
fillMode: $,
|
|
147
149
|
groupField: t.groupField,
|
|
148
150
|
isMultiColumn: !0,
|
|
149
|
-
onOpen:
|
|
150
|
-
onClose:
|
|
151
|
-
onFocus:
|
|
152
|
-
onBlur:
|
|
153
|
-
onChange:
|
|
151
|
+
onOpen: Z,
|
|
152
|
+
onClose: _,
|
|
153
|
+
onFocus: ee,
|
|
154
|
+
onBlur: te,
|
|
155
|
+
onChange: re,
|
|
154
156
|
onFilterChange: ae,
|
|
155
157
|
onPageChange: oe,
|
|
156
|
-
onGroupScroll:
|
|
157
|
-
|
|
158
|
+
onGroupScroll: ne,
|
|
159
|
+
onListScroll: le,
|
|
160
|
+
className: x("k-dropdowngrid", j),
|
|
158
161
|
required: t.required,
|
|
159
162
|
adaptive: t.adaptive,
|
|
160
163
|
adaptiveFilter: t.adaptiveFilter,
|
|
@@ -162,14 +165,14 @@ const he = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, Ce = ue(), P =
|
|
|
162
165
|
adaptiveSubtitle: t.adaptiveSubtitle,
|
|
163
166
|
footer: t.footer,
|
|
164
167
|
footerClassName: "k-table-footer",
|
|
165
|
-
prefix:
|
|
166
|
-
suffix:
|
|
168
|
+
prefix: J,
|
|
169
|
+
suffix: Q
|
|
167
170
|
}
|
|
168
171
|
);
|
|
169
172
|
}
|
|
170
|
-
),
|
|
171
|
-
...
|
|
172
|
-
columns:
|
|
173
|
+
), ve = {
|
|
174
|
+
...he.propTypes,
|
|
175
|
+
columns: ue.any.isRequired
|
|
173
176
|
}, l = {
|
|
174
177
|
columns: [],
|
|
175
178
|
popupSettings: {},
|
|
@@ -179,8 +182,8 @@ const he = (s, g) => s ? typeof s == "number" ? s + "px" : s : g, Ce = ue(), P =
|
|
|
179
182
|
fillMode: void 0
|
|
180
183
|
};
|
|
181
184
|
P.displayName = "KendoMultiColumnComboBox";
|
|
182
|
-
P.propTypes =
|
|
185
|
+
P.propTypes = ve;
|
|
183
186
|
export {
|
|
184
187
|
P as MultiColumnComboBox,
|
|
185
|
-
|
|
188
|
+
ke as MultiColumnComboBoxPropsContext
|
|
186
189
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as g from "react";
|
|
9
9
|
import v from "prop-types";
|
|
10
|
-
import { withIdHOC as J,
|
|
10
|
+
import { withIdHOC as J, withPropsContext as Q, withAdaptiveModeContext as X, createPropsContext as Z, Keys as u, classNames as S, kendoThemeMaps as tt, IconWrap as B, WatermarkOverlay as et, getLicenseMessage as st, canUseDOM as V, validatePackage as it, subscribeToKendoPaste as ot } from "@progress/kendo-react-common";
|
|
11
11
|
import { plusIcon as at } from "@progress/kendo-svg-icons";
|
|
12
12
|
import { FloatingLabel as nt } from "@progress/kendo-react-labels";
|
|
13
13
|
import lt from "../common/ListContainer.mjs";
|
|
@@ -722,10 +722,10 @@ C.displayName = "MultiSelect", C.propTypes = {
|
|
|
722
722
|
suffix: void 0
|
|
723
723
|
};
|
|
724
724
|
let N = C;
|
|
725
|
-
const xt =
|
|
726
|
-
|
|
725
|
+
const xt = Z(), St = J(
|
|
726
|
+
Q(
|
|
727
727
|
xt,
|
|
728
|
-
|
|
728
|
+
X(N)
|
|
729
729
|
)
|
|
730
730
|
);
|
|
731
731
|
St.displayName = "KendoReactMultiSelect";
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import * as t from "react";
|
|
9
9
|
import n from "prop-types";
|
|
10
|
-
import {
|
|
10
|
+
import { usePropsContext as it, validatePackage as rt, getLicenseMessage as ot, useId as lt, noop as Y, getTabIndex as st, useRtl as ct, useAdaptiveModeContext as ut, canUseDOM as dt, Keys as r, classNames as Z, kendoThemeMaps as pt, IconWrap as ft, WatermarkOverlay as mt, createPropsContext as gt } from "@progress/kendo-react-common";
|
|
11
11
|
import { Popup as vt } from "@progress/kendo-react-popup";
|
|
12
12
|
import { useLocalization as ht } from "@progress/kendo-react-intl";
|
|
13
13
|
import { TreeView as Ie } from "@progress/kendo-react-treeview";
|
|
@@ -22,7 +22,7 @@ import xt from "../common/ClearButton.mjs";
|
|
|
22
22
|
import Re from "../common/ListFilter.mjs";
|
|
23
23
|
import { AdaptiveMode as St } from "../common/AdaptiveMode.mjs";
|
|
24
24
|
import { ActionSheetContent as wt } from "@progress/kendo-react-layout";
|
|
25
|
-
const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt } =
|
|
25
|
+
const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt } = pt, Dt = (N) => N.split("_").map((M) => parseInt(M, 10)), Mt = (N, M) => {
|
|
26
26
|
const { validationMessage: a, valid: V, required: te } = N;
|
|
27
27
|
return {
|
|
28
28
|
customError: a !== void 0,
|
|
@@ -43,9 +43,9 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
43
43
|
fillMode: void 0,
|
|
44
44
|
required: !1,
|
|
45
45
|
validityStyles: !0
|
|
46
|
-
}, Rt =
|
|
46
|
+
}, Rt = gt(), Ne = t.forwardRef(
|
|
47
47
|
(N, M) => {
|
|
48
|
-
const a =
|
|
48
|
+
const a = it(Rt, N), V = !rt(Te, { component: "MultiSelectTree" }), te = ot(Te), Oe = lt(), O = a.id || Oe, {
|
|
49
49
|
data: W = [],
|
|
50
50
|
dataItemKey: x,
|
|
51
51
|
style: L = {},
|
|
@@ -69,10 +69,10 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
69
69
|
validityStyles: Ke = b.validityStyles,
|
|
70
70
|
onOpen: ae = Y,
|
|
71
71
|
onClose: A = Y
|
|
72
|
-
} = a, $ =
|
|
72
|
+
} = a, $ = st(a.tabIndex, E), o = t.useRef(null), C = t.useRef(null), w = t.useRef(null), ie = t.useRef(null), H = t.useRef(null), k = t.useRef(null), G = t.useRef(!1), _ = t.useRef([]), j = t.useRef(null), [P, Ve] = t.useState(), [We, ge] = t.useState(!1), [d, re] = t.useState(!1), [oe, qe] = t.useState(), [ze, Ae] = t.useState([]), [ve, $e] = t.useState(""), s = S !== void 0 ? S : We, le = !!(Array.isArray(m) && m.length), se = Mt({ validationMessage: q, valid: Be, required: me }, le), I = ct(C, a.dir), He = {
|
|
73
73
|
width: Ct(C, b, R, L),
|
|
74
74
|
...I !== void 0 ? { direction: I } : {}
|
|
75
|
-
}, Ge = t.useCallback(() => C.current && C.current.focus(), []), he =
|
|
75
|
+
}, Ge = t.useCallback(() => C.current && C.current.focus(), []), he = ut(), T = !!(oe && he && oe <= he.medium && a.adaptive);
|
|
76
76
|
_.current = ue === void 0 ? (m || []).map((e) => ({ text: bt(e, a.textField), data: [e] })) : [...ue], t.useImperativeHandle(o, () => ({
|
|
77
77
|
props: a,
|
|
78
78
|
element: C.current,
|
|
@@ -87,7 +87,7 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
87
87
|
);
|
|
88
88
|
}, [q, se]);
|
|
89
89
|
t.useEffect(_e), t.useEffect(() => {
|
|
90
|
-
const e =
|
|
90
|
+
const e = dt && window.ResizeObserver && new window.ResizeObserver(nt.bind(void 0));
|
|
91
91
|
return document != null && document.body && e && e.observe(document.body), () => {
|
|
92
92
|
e && e.disconnect();
|
|
93
93
|
};
|
|
@@ -425,7 +425,7 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
425
425
|
)
|
|
426
426
|
),
|
|
427
427
|
/* @__PURE__ */ t.createElement("span", { className: "k-input-inner" }, Q.length === 0 && /* @__PURE__ */ t.createElement("span", { className: "k-input-value-text" }, ne)),
|
|
428
|
-
a.loading && /* @__PURE__ */ t.createElement(
|
|
428
|
+
a.loading && /* @__PURE__ */ t.createElement(ft, { className: "k-input-loading-icon", name: "loading" }),
|
|
429
429
|
le && !E && Q.length > 0 && /* @__PURE__ */ t.createElement(xt, { onClick: Ze }),
|
|
430
430
|
/* @__PURE__ */ t.createElement(
|
|
431
431
|
"select",
|
|
@@ -491,7 +491,7 @@ const It = "Please select a value from the list!", { sizeMap: Pe, roundedMap: Tt
|
|
|
491
491
|
dir: I
|
|
492
492
|
}
|
|
493
493
|
) : /* @__PURE__ */ t.createElement(ke, null, Fe.toLanguageString(ee, Me[ee])),
|
|
494
|
-
V && /* @__PURE__ */ t.createElement(
|
|
494
|
+
V && /* @__PURE__ */ t.createElement(mt, { message: te })
|
|
495
495
|
)
|
|
496
496
|
), T && tt());
|
|
497
497
|
return B ? /* @__PURE__ */ t.createElement(
|
package/common/List.d.ts
CHANGED
|
@@ -46,6 +46,13 @@ export interface ListProps {
|
|
|
46
46
|
iconField?: string;
|
|
47
47
|
svgIconField?: string;
|
|
48
48
|
checkboxField?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Specifies whether to show the group header for the first group.
|
|
51
|
+
* By default, the first group header is hidden because there is no previous group to differentiate from.
|
|
52
|
+
*
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
showFirstGroupHeader?: boolean;
|
|
49
56
|
}
|
|
50
57
|
/**
|
|
51
58
|
* @hidden
|
package/common/List.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";const Y=require("react"),Z=require("./ListItem.js"),
|
|
8
|
+
"use strict";const Y=require("react"),Z=require("./ListItem.js"),S=require("./ListGroupItem.js"),y=require("./utils.js"),ee=require("@progress/kendo-react-intl"),I=require("../messages/index.js"),a=require("@progress/kendo-react-common");function te(e){const g=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const i=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(g,l,i.get?i:{enumerable:!0,get:()=>e[l]})}}return g.default=e,Object.freeze(g)}const n=te(Y),re=e=>{const g=ee.useLocalization(),l=a.useUnstyled(),i=l&&l.uDropDownsBase,{id:N,show:b,wrapperCssClass:j,wrapperStyle:M,listStyle:k,listRef:C,wrapperRef:V,listClassName:R,ariaSetSize:B,actionsField:$,descriptionField:_,iconField:q,svgIconField:L,checkboxField:P}=e,D=(()=>{const{textField:o,valueField:t,groupField:s,isMultiColumn:r,optionsGuid:c,skip:p=0,virtual:v,focusedIndex:z,hasDuplicates:U,highlightSelected:J=!0,value:h,data:G,itemRender:K,groupHeaderItemRender:Q}=e,x=Array.isArray(h);let A=0;return G.map((d,u)=>{const F=p+u,w=p+u+A,W=U?h?z===u:!1:d.disabled?!1:J&&(!x&&y.areSame(d,h,t)||x&&h.findIndex(X=>y.areSame(X,d,t))!==-1);let f,m,E;s!==void 0&&(m=y.getItemValue(d,s),u===0&&e.showFirstGroupHeader&&m?f=m:u>0&&(E=y.getItemValue(G[u-1],s),m&&E&&m!==E&&(f=m)));const O=f!==void 0;return f!==void 0&&(A+=1),[O&&n.createElement(S,{id:`option-${c}-${w}`,virtual:v,key:F+"-group-item",group:f,isMultiColumn:r,render:Q,iconField:q,svgIconField:L,groupItem:d}),n.createElement(Z,{id:`option-${c}-${O?w+1:w}`,virtual:v,dataItem:d,selected:W,focused:z===u,index:F,key:F,onClick:e.onClick,textField:o,group:f,render:K,disabled:d.disabled,actionsField:$,descriptionField:_,iconField:q,svgIconField:L,checkboxField:P})]})})(),H=()=>{const o=e.noDataRender,t=n.createElement("div",{className:a.classNames(a.uDropDownsBase.noData({c:i})),"aria-live":"polite"},n.createElement("div",null,g.toLanguageString(I.nodata,I.messages[I.nodata])));return o?o(t):t},T=()=>{if(!e.groupField)return n.createElement("ul",{id:N,role:"listbox","aria-hidden":b?void 0:!0,"aria-setsize":B,className:R||a.classNames(a.uDropDownsBase.ul({c:i})),ref:C,style:k},D);const o=[];let t=[];return D.forEach(s=>{Array.isArray(s)&&s.forEach(r=>{r&&r.type===S?(t.length>0&&o.push(t),t=[r]):r&&t.push(r)})}),t.length>0&&o.push(t),o.map(s=>{var p;const r=s.find(v=>n.isValidElement(v)&&v.type===S),c=(p=r==null?void 0:r.props)==null?void 0:p.id;return n.createElement("ul",{id:c?void 0:N,key:c||"first-group",role:"group","aria-labelledby":c,className:R||a.classNames(a.uDropDownsBase.ul({c:i})),ref:c?void 0:C,style:k},s)})};return D.length?n.createElement("div",{className:j,style:M,ref:V,role:e.groupField?"listbox":void 0,"aria-hidden":e.groupField&&!b?!0:void 0,"aria-setsize":e.groupField?B:void 0,onMouseDown:e.onMouseDown,onBlur:e.onBlur,onScroll:e.onScroll,unselectable:"on"},T(),e.scroller&&n.createElement("div",{className:a.classNames(a.uDropDownsBase.heightContainer({c:i}))},e.scroller)):H()};module.exports=re;
|
package/common/List.mjs
CHANGED
|
@@ -11,87 +11,87 @@ import D from "./ListGroupItem.mjs";
|
|
|
11
11
|
import { areSame as $, getItemValue as M } from "./utils.mjs";
|
|
12
12
|
import { useLocalization as te } from "@progress/kendo-react-intl";
|
|
13
13
|
import { nodata as V, messages as re } from "../messages/index.mjs";
|
|
14
|
-
import { useUnstyled as oe, classNames as p, uDropDownsBase as
|
|
14
|
+
import { useUnstyled as oe, classNames as p, uDropDownsBase as h } from "@progress/kendo-react-common";
|
|
15
15
|
const ue = (e) => {
|
|
16
|
-
const
|
|
16
|
+
const H = te(), I = oe(), f = I && I.uDropDownsBase, {
|
|
17
17
|
id: S,
|
|
18
|
-
show:
|
|
19
|
-
wrapperCssClass:
|
|
20
|
-
wrapperStyle:
|
|
21
|
-
listStyle:
|
|
18
|
+
show: w,
|
|
19
|
+
wrapperCssClass: U,
|
|
20
|
+
wrapperStyle: j,
|
|
21
|
+
listStyle: C,
|
|
22
22
|
listRef: N,
|
|
23
|
-
wrapperRef:
|
|
23
|
+
wrapperRef: q,
|
|
24
24
|
listClassName: k,
|
|
25
25
|
ariaSetSize: L,
|
|
26
26
|
actionsField: J,
|
|
27
27
|
descriptionField: K,
|
|
28
28
|
iconField: R,
|
|
29
|
-
svgIconField:
|
|
29
|
+
svgIconField: G,
|
|
30
30
|
checkboxField: O
|
|
31
|
-
} = e,
|
|
31
|
+
} = e, v = (() => {
|
|
32
32
|
const {
|
|
33
33
|
textField: i,
|
|
34
34
|
valueField: t,
|
|
35
35
|
groupField: o,
|
|
36
36
|
isMultiColumn: r,
|
|
37
37
|
optionsGuid: a,
|
|
38
|
-
skip:
|
|
39
|
-
virtual:
|
|
40
|
-
focusedIndex:
|
|
38
|
+
skip: u = 0,
|
|
39
|
+
virtual: m,
|
|
40
|
+
focusedIndex: b,
|
|
41
41
|
hasDuplicates: T,
|
|
42
42
|
highlightSelected: W = !0,
|
|
43
|
-
value:
|
|
43
|
+
value: g,
|
|
44
44
|
data: z,
|
|
45
45
|
itemRender: X,
|
|
46
46
|
groupHeaderItemRender: Y
|
|
47
|
-
} = e, A = Array.isArray(
|
|
47
|
+
} = e, A = Array.isArray(g);
|
|
48
48
|
let B = 0;
|
|
49
|
-
return z.map((
|
|
50
|
-
const y =
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
return
|
|
55
|
-
|
|
49
|
+
return z.map((s, n) => {
|
|
50
|
+
const y = u + n, F = u + n + B, Z = T ? g ? b === n : !1 : s.disabled ? !1 : W && (!A && $(s, g, t) || A && g.findIndex((_) => $(_, s, t)) !== -1);
|
|
51
|
+
let d, c, E;
|
|
52
|
+
o !== void 0 && (c = M(s, o), n === 0 && e.showFirstGroupHeader && c ? d = c : n > 0 && (E = M(z[n - 1], o), c && E && c !== E && (d = c)));
|
|
53
|
+
const x = d !== void 0;
|
|
54
|
+
return d !== void 0 && (B += 1), [
|
|
55
|
+
x && /* @__PURE__ */ l.createElement(
|
|
56
56
|
D,
|
|
57
57
|
{
|
|
58
|
-
id: `option-${a}-${
|
|
59
|
-
virtual:
|
|
58
|
+
id: `option-${a}-${F}`,
|
|
59
|
+
virtual: m,
|
|
60
60
|
key: y + "-group-item",
|
|
61
|
-
group:
|
|
61
|
+
group: d,
|
|
62
62
|
isMultiColumn: r,
|
|
63
63
|
render: Y,
|
|
64
64
|
iconField: R,
|
|
65
|
-
svgIconField:
|
|
66
|
-
groupItem:
|
|
65
|
+
svgIconField: G,
|
|
66
|
+
groupItem: s
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
69
|
/* @__PURE__ */ l.createElement(
|
|
70
70
|
ee,
|
|
71
71
|
{
|
|
72
|
-
id: `option-${a}-${
|
|
73
|
-
virtual:
|
|
74
|
-
dataItem:
|
|
72
|
+
id: `option-${a}-${x ? F + 1 : F}`,
|
|
73
|
+
virtual: m,
|
|
74
|
+
dataItem: s,
|
|
75
75
|
selected: Z,
|
|
76
|
-
focused:
|
|
76
|
+
focused: b === n,
|
|
77
77
|
index: y,
|
|
78
78
|
key: y,
|
|
79
79
|
onClick: e.onClick,
|
|
80
80
|
textField: i,
|
|
81
|
-
group:
|
|
81
|
+
group: d,
|
|
82
82
|
render: X,
|
|
83
|
-
disabled:
|
|
83
|
+
disabled: s.disabled,
|
|
84
84
|
actionsField: J,
|
|
85
85
|
descriptionField: K,
|
|
86
86
|
iconField: R,
|
|
87
|
-
svgIconField:
|
|
87
|
+
svgIconField: G,
|
|
88
88
|
checkboxField: O
|
|
89
89
|
}
|
|
90
90
|
)
|
|
91
91
|
];
|
|
92
92
|
});
|
|
93
93
|
})(), P = () => {
|
|
94
|
-
const i = e.noDataRender, t = /* @__PURE__ */ l.createElement("div", { className: p(
|
|
94
|
+
const i = e.noDataRender, t = /* @__PURE__ */ l.createElement("div", { className: p(h.noData({ c: f })), "aria-live": "polite" }, /* @__PURE__ */ l.createElement("div", null, H.toLanguageString(V, re[V])));
|
|
95
95
|
return i ? i(t) : t;
|
|
96
96
|
}, Q = () => {
|
|
97
97
|
if (!e.groupField)
|
|
@@ -100,25 +100,25 @@ const ue = (e) => {
|
|
|
100
100
|
{
|
|
101
101
|
id: S,
|
|
102
102
|
role: "listbox",
|
|
103
|
-
"aria-hidden":
|
|
103
|
+
"aria-hidden": w ? void 0 : !0,
|
|
104
104
|
"aria-setsize": L,
|
|
105
|
-
className: k || p(
|
|
105
|
+
className: k || p(h.ul({ c: f })),
|
|
106
106
|
ref: N,
|
|
107
|
-
style:
|
|
107
|
+
style: C
|
|
108
108
|
},
|
|
109
|
-
|
|
109
|
+
v
|
|
110
110
|
);
|
|
111
111
|
const i = [];
|
|
112
112
|
let t = [];
|
|
113
|
-
return
|
|
113
|
+
return v.forEach((o) => {
|
|
114
114
|
Array.isArray(o) && o.forEach((r) => {
|
|
115
115
|
r && r.type === D ? (t.length > 0 && i.push(t), t = [r]) : r && t.push(r);
|
|
116
116
|
});
|
|
117
117
|
}), t.length > 0 && i.push(t), i.map((o) => {
|
|
118
|
-
var
|
|
118
|
+
var u;
|
|
119
119
|
const r = o.find(
|
|
120
|
-
(
|
|
121
|
-
), a = (
|
|
120
|
+
(m) => l.isValidElement(m) && m.type === D
|
|
121
|
+
), a = (u = r == null ? void 0 : r.props) == null ? void 0 : u.id;
|
|
122
122
|
return /* @__PURE__ */ l.createElement(
|
|
123
123
|
"ul",
|
|
124
124
|
{
|
|
@@ -126,22 +126,22 @@ const ue = (e) => {
|
|
|
126
126
|
key: a || "first-group",
|
|
127
127
|
role: "group",
|
|
128
128
|
"aria-labelledby": a,
|
|
129
|
-
className: k || p(
|
|
129
|
+
className: k || p(h.ul({ c: f })),
|
|
130
130
|
ref: a ? void 0 : N,
|
|
131
|
-
style:
|
|
131
|
+
style: C
|
|
132
132
|
},
|
|
133
133
|
o
|
|
134
134
|
);
|
|
135
135
|
});
|
|
136
136
|
};
|
|
137
|
-
return
|
|
137
|
+
return v.length ? /* @__PURE__ */ l.createElement(
|
|
138
138
|
"div",
|
|
139
139
|
{
|
|
140
|
-
className:
|
|
141
|
-
style:
|
|
142
|
-
ref:
|
|
140
|
+
className: U,
|
|
141
|
+
style: j,
|
|
142
|
+
ref: q,
|
|
143
143
|
role: e.groupField ? "listbox" : void 0,
|
|
144
|
-
"aria-hidden": e.groupField && !
|
|
144
|
+
"aria-hidden": e.groupField && !w ? !0 : void 0,
|
|
145
145
|
"aria-setsize": e.groupField ? L : void 0,
|
|
146
146
|
onMouseDown: e.onMouseDown,
|
|
147
147
|
onBlur: e.onBlur,
|
|
@@ -149,7 +149,7 @@ const ue = (e) => {
|
|
|
149
149
|
unselectable: "on"
|
|
150
150
|
},
|
|
151
151
|
Q(),
|
|
152
|
-
e.scroller && /* @__PURE__ */ l.createElement("div", { className: p(
|
|
152
|
+
e.scroller && /* @__PURE__ */ l.createElement("div", { className: p(h.heightContainer({ c: f })) }, e.scroller)
|
|
153
153
|
) : P();
|
|
154
154
|
};
|
|
155
155
|
export {
|