@progress/kendo-react-dropdowns 9.0.0-develop.2 → 9.0.0-develop.20
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/ComboBox/ComboBox.mjs +67 -29
- package/DropDownList/DropDownList.js +1 -1
- package/DropDownList/DropDownList.mjs +591 -581
- package/DropDownTree/useDropdownWidth.mjs +3 -6
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +144 -141
- package/MultiSelectTree/MultiSelectTree.js +1 -1
- package/MultiSelectTree/MultiSelectTree.mjs +11 -11
- package/MultiSelectTree/utils.js +1 -1
- package/MultiSelectTree/utils.mjs +12 -19
- package/README.md +44 -43
- package/common/DropDownBase.js +1 -1
- package/common/DropDownBase.mjs +119 -115
- package/common/GroupStickyHeader.mjs +1 -5
- package/common/List.js +1 -1
- package/common/List.mjs +63 -71
- package/common/ListContainer.mjs +1 -7
- package/common/ListDefaultItem.mjs +1 -5
- package/common/ListFilter.mjs +9 -5
- package/common/ListGroupItem.mjs +8 -8
- package/common/ListItem.mjs +10 -18
- package/common/MultiColumnList.mjs +3 -6
- package/common/Navigation.mjs +12 -2
- package/common/utils.mjs +3 -1
- package/dist/cdn/js/kendo-react-dropdowns.js +1 -1
- package/index.d.mts +45 -231
- package/index.d.ts +45 -231
- package/index.js +1 -1
- package/index.mjs +39 -40
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
package/common/List.mjs
CHANGED
|
@@ -7,87 +7,79 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { areSame as
|
|
13
|
-
import { useLocalization as
|
|
14
|
-
import { nodata as
|
|
15
|
-
import { useUnstyled as
|
|
10
|
+
import T from "./ListItem.mjs";
|
|
11
|
+
import W from "./ListGroupItem.mjs";
|
|
12
|
+
import { areSame as b, getItemValue as k } from "./utils.mjs";
|
|
13
|
+
import { useLocalization as X } from "@progress/kendo-react-intl";
|
|
14
|
+
import { nodata as B, messages as Y } from "../messages/index.mjs";
|
|
15
|
+
import { useUnstyled as Z, classNames as v, uDropDownsBase as y } from "@progress/kendo-react-common";
|
|
16
16
|
const le = (e) => {
|
|
17
|
-
const
|
|
18
|
-
id: L,
|
|
19
|
-
show: z,
|
|
20
|
-
wrapperCssClass: M,
|
|
21
|
-
wrapperStyle: $,
|
|
22
|
-
listStyle: x,
|
|
23
|
-
listRef: A,
|
|
24
|
-
wrapperRef: F,
|
|
25
|
-
listClassName: G,
|
|
26
|
-
ariaSetSize: V
|
|
27
|
-
} = e, D = (() => {
|
|
17
|
+
const L = X(), D = Z(), d = D && D.uDropDownsBase, { id: M, show: z, wrapperCssClass: $, wrapperStyle: x, listStyle: A, listRef: F, wrapperRef: G, listClassName: V, ariaSetSize: H } = e, I = (() => {
|
|
28
18
|
const {
|
|
29
|
-
textField:
|
|
30
|
-
valueField:
|
|
31
|
-
groupField:
|
|
32
|
-
groupMode:
|
|
33
|
-
isMultiColumn:
|
|
34
|
-
optionsGuid:
|
|
35
|
-
skip:
|
|
36
|
-
virtual:
|
|
37
|
-
focusedIndex:
|
|
38
|
-
hasDuplicates:
|
|
39
|
-
highlightSelected:
|
|
40
|
-
value:
|
|
41
|
-
data:
|
|
42
|
-
itemRender:
|
|
43
|
-
groupHeaderItemRender:
|
|
44
|
-
} = e,
|
|
45
|
-
let
|
|
46
|
-
return
|
|
47
|
-
const m =
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
19
|
+
textField: s,
|
|
20
|
+
valueField: a,
|
|
21
|
+
groupField: c,
|
|
22
|
+
groupMode: S,
|
|
23
|
+
isMultiColumn: j,
|
|
24
|
+
optionsGuid: h,
|
|
25
|
+
skip: C = 0,
|
|
26
|
+
virtual: E,
|
|
27
|
+
focusedIndex: w,
|
|
28
|
+
hasDuplicates: q,
|
|
29
|
+
highlightSelected: J = !0,
|
|
30
|
+
value: l,
|
|
31
|
+
data: N,
|
|
32
|
+
itemRender: K,
|
|
33
|
+
groupHeaderItemRender: O
|
|
34
|
+
} = e, R = Array.isArray(l);
|
|
35
|
+
let u = 0;
|
|
36
|
+
return N.map((r, o) => {
|
|
37
|
+
const m = C + o, f = C + o + u, P = q ? l ? w === o : !1 : r.disabled ? !1 : J && (!R && b(r, l, a) || R && l.findIndex((Q) => b(Q, r, a)) !== -1);
|
|
38
|
+
let n, i, g;
|
|
39
|
+
o > 0 && c !== void 0 && (i = k(r, c), g = k(N[o - 1], c), i && g && i !== g && (n = i));
|
|
40
|
+
const p = n !== void 0 && S === "modern";
|
|
41
|
+
return p ? u += 1 : u = 0, [
|
|
42
|
+
p && /* @__PURE__ */ t.createElement(
|
|
43
|
+
W,
|
|
52
44
|
{
|
|
53
|
-
id: `option-${
|
|
54
|
-
virtual:
|
|
45
|
+
id: `option-${h}-${f}`,
|
|
46
|
+
virtual: E,
|
|
55
47
|
key: m + "-group-item",
|
|
56
|
-
group:
|
|
57
|
-
isMultiColumn:
|
|
58
|
-
render:
|
|
48
|
+
group: n,
|
|
49
|
+
isMultiColumn: j,
|
|
50
|
+
render: O
|
|
59
51
|
}
|
|
60
52
|
),
|
|
61
53
|
/* @__PURE__ */ t.createElement(
|
|
62
|
-
|
|
54
|
+
T,
|
|
63
55
|
{
|
|
64
|
-
id: `option-${
|
|
65
|
-
virtual:
|
|
66
|
-
dataItem:
|
|
67
|
-
groupMode:
|
|
68
|
-
selected:
|
|
69
|
-
focused:
|
|
56
|
+
id: `option-${h}-${p ? f + 1 : f}`,
|
|
57
|
+
virtual: E,
|
|
58
|
+
dataItem: r,
|
|
59
|
+
groupMode: S,
|
|
60
|
+
selected: P,
|
|
61
|
+
focused: w === o,
|
|
70
62
|
index: m,
|
|
71
63
|
key: m,
|
|
72
64
|
onClick: e.onClick,
|
|
73
|
-
textField:
|
|
74
|
-
group:
|
|
75
|
-
render:
|
|
76
|
-
disabled:
|
|
65
|
+
textField: s,
|
|
66
|
+
group: n,
|
|
67
|
+
render: K,
|
|
68
|
+
disabled: r.disabled
|
|
77
69
|
}
|
|
78
70
|
)
|
|
79
71
|
];
|
|
80
72
|
});
|
|
81
|
-
})(),
|
|
82
|
-
const
|
|
83
|
-
return
|
|
73
|
+
})(), U = () => {
|
|
74
|
+
const s = e.noDataRender, a = /* @__PURE__ */ t.createElement("div", { className: v(y.noData({ c: d })) }, /* @__PURE__ */ t.createElement("div", null, L.toLanguageString(B, Y[B])));
|
|
75
|
+
return s ? s.call(void 0, a) : a;
|
|
84
76
|
};
|
|
85
|
-
return
|
|
77
|
+
return I.length ? /* @__PURE__ */ t.createElement(
|
|
86
78
|
"div",
|
|
87
79
|
{
|
|
88
|
-
className:
|
|
89
|
-
style:
|
|
90
|
-
ref:
|
|
80
|
+
className: $,
|
|
81
|
+
style: x,
|
|
82
|
+
ref: G,
|
|
91
83
|
onMouseDown: e.onMouseDown,
|
|
92
84
|
onBlur: e.onBlur,
|
|
93
85
|
onScroll: e.onScroll,
|
|
@@ -96,18 +88,18 @@ const le = (e) => {
|
|
|
96
88
|
/* @__PURE__ */ t.createElement(
|
|
97
89
|
"ul",
|
|
98
90
|
{
|
|
99
|
-
id:
|
|
91
|
+
id: M,
|
|
100
92
|
role: "listbox",
|
|
101
93
|
"aria-hidden": z ? void 0 : !0,
|
|
102
|
-
"aria-setsize":
|
|
103
|
-
className:
|
|
104
|
-
ref:
|
|
105
|
-
style:
|
|
94
|
+
"aria-setsize": H,
|
|
95
|
+
className: V || v(y.ul({ c: d })),
|
|
96
|
+
ref: F,
|
|
97
|
+
style: A
|
|
106
98
|
},
|
|
107
|
-
|
|
99
|
+
I
|
|
108
100
|
),
|
|
109
|
-
e.scroller && /* @__PURE__ */ t.createElement("div", { className:
|
|
110
|
-
) :
|
|
101
|
+
e.scroller && /* @__PURE__ */ t.createElement("div", { className: v(y.heightContainer({ c: d })) }, e.scroller)
|
|
102
|
+
) : U();
|
|
111
103
|
};
|
|
112
104
|
export {
|
|
113
105
|
le as default
|
package/common/ListContainer.mjs
CHANGED
|
@@ -9,13 +9,7 @@
|
|
|
9
9
|
import * as s from "react";
|
|
10
10
|
import { Popup as c } from "@progress/kendo-react-popup";
|
|
11
11
|
const a = (e) => {
|
|
12
|
-
const {
|
|
13
|
-
children: n,
|
|
14
|
-
width: o,
|
|
15
|
-
dir: i,
|
|
16
|
-
itemsCount: t,
|
|
17
|
-
popupSettings: r
|
|
18
|
-
} = e;
|
|
12
|
+
const { children: n, width: o, dir: i, itemsCount: t, popupSettings: r } = e;
|
|
19
13
|
return /* @__PURE__ */ s.createElement(
|
|
20
14
|
c,
|
|
21
15
|
{
|
|
@@ -10,11 +10,7 @@ import * as a from "react";
|
|
|
10
10
|
import { useUnstyled as c, classNames as u, uDropDownsBase as r } from "@progress/kendo-react-common";
|
|
11
11
|
import { getItemValue as i } from "./utils.mjs";
|
|
12
12
|
const m = (e) => e.preventDefault(), p = (e) => {
|
|
13
|
-
const {
|
|
14
|
-
selected: s,
|
|
15
|
-
defaultItem: o,
|
|
16
|
-
textField: n
|
|
17
|
-
} = e, t = c(), l = t && t.uDropDownsBase;
|
|
13
|
+
const { selected: s, defaultItem: o, textField: n } = e, t = c(), l = t && t.uDropDownsBase;
|
|
18
14
|
return /* @__PURE__ */ a.createElement(
|
|
19
15
|
"div",
|
|
20
16
|
{
|
package/common/ListFilter.mjs
CHANGED
|
@@ -13,11 +13,15 @@ import { searchIcon as g } from "@progress/kendo-svg-icons";
|
|
|
13
13
|
import { useUnstyled as h, classNames as l, uDropDownsBase as a, IconWrap as D } from "@progress/kendo-react-common";
|
|
14
14
|
const u = n.forwardRef((r, c) => {
|
|
15
15
|
const o = n.useRef(null), { renderListFilterWrapper: m = !1, renderPrefixSeparator: d = !1, ...f } = r, s = h(), t = s && s.uDropDownsBase;
|
|
16
|
-
n.useImperativeHandle(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
n.useImperativeHandle(c, () => o.current);
|
|
17
|
+
const p = () => /* @__PURE__ */ n.createElement(n.Fragment, null, /* @__PURE__ */ n.createElement(b, null, /* @__PURE__ */ n.createElement(
|
|
18
|
+
D,
|
|
19
|
+
{
|
|
20
|
+
name: "search",
|
|
21
|
+
icon: g,
|
|
22
|
+
className: l(a.inputIcon({ c: t }))
|
|
23
|
+
}
|
|
24
|
+
)), d && /* @__PURE__ */ n.createElement(I, null)), i = /* @__PURE__ */ n.createElement(
|
|
21
25
|
y,
|
|
22
26
|
{
|
|
23
27
|
...f,
|
package/common/ListGroupItem.mjs
CHANGED
|
@@ -9,13 +9,7 @@
|
|
|
9
9
|
import { useUnstyled as d, classNames as i, uDropDownsBase as l } from "@progress/kendo-react-common";
|
|
10
10
|
import * as n from "react";
|
|
11
11
|
const g = (t) => {
|
|
12
|
-
const {
|
|
13
|
-
group: u,
|
|
14
|
-
virtual: c,
|
|
15
|
-
render: e,
|
|
16
|
-
isMultiColumn: s = !1,
|
|
17
|
-
id: m
|
|
18
|
-
} = t, o = d(), r = o && o.uDropDownsBase, a = /* @__PURE__ */ n.createElement(
|
|
12
|
+
const { group: u, virtual: c, render: e, isMultiColumn: s = !1, id: m } = t, o = d(), r = o && o.uDropDownsBase, a = /* @__PURE__ */ n.createElement(
|
|
19
13
|
"li",
|
|
20
14
|
{
|
|
21
15
|
id: m,
|
|
@@ -23,7 +17,13 @@ const g = (t) => {
|
|
|
23
17
|
className: i(l.groupLi({ c: r, isMultiColumn: s })),
|
|
24
18
|
style: s ? { boxSizing: "inherit" } : { position: c ? "relative" : "unset" }
|
|
25
19
|
},
|
|
26
|
-
/* @__PURE__ */ n.createElement(
|
|
20
|
+
/* @__PURE__ */ n.createElement(
|
|
21
|
+
"span",
|
|
22
|
+
{
|
|
23
|
+
className: e ? void 0 : i(l.groupItemText({ c: r, isMultiColumn: s }))
|
|
24
|
+
},
|
|
25
|
+
u
|
|
26
|
+
)
|
|
27
27
|
);
|
|
28
28
|
return e !== void 0 ? e.call(void 0, a, t) : a;
|
|
29
29
|
};
|
package/common/ListItem.mjs
CHANGED
|
@@ -10,30 +10,22 @@ import * as a from "react";
|
|
|
10
10
|
import { useUnstyled as B, classNames as l, uDropDownsBase as i } from "@progress/kendo-react-common";
|
|
11
11
|
import { getItemValue as C } from "./utils.mjs";
|
|
12
12
|
const b = (e) => {
|
|
13
|
-
const {
|
|
14
|
-
selected: o,
|
|
15
|
-
group: t,
|
|
16
|
-
dataItem: u,
|
|
17
|
-
virtual: v,
|
|
18
|
-
groupMode: c,
|
|
19
|
-
disabled: n,
|
|
20
|
-
id: f,
|
|
21
|
-
focused: g,
|
|
22
|
-
render: r
|
|
23
|
-
} = e, d = B(), s = d && d.uDropDownsBase, p = (x) => e.onClick(e.index, x), m = /* @__PURE__ */ a.createElement(
|
|
13
|
+
const { selected: o, group: t, dataItem: u, virtual: v, groupMode: c, disabled: n, id: f, focused: g, render: r } = e, d = B(), s = d && d.uDropDownsBase, p = (x) => e.onClick(e.index, x), m = /* @__PURE__ */ a.createElement(
|
|
24
14
|
"li",
|
|
25
15
|
{
|
|
26
16
|
id: f,
|
|
27
17
|
role: "option",
|
|
28
18
|
"aria-selected": o,
|
|
29
19
|
"aria-disabled": n ? !0 : void 0,
|
|
30
|
-
className: l(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
className: l(
|
|
21
|
+
i.li({
|
|
22
|
+
c: s,
|
|
23
|
+
selected: o,
|
|
24
|
+
focused: g,
|
|
25
|
+
first: !!t && c === "classic",
|
|
26
|
+
disabled: n
|
|
27
|
+
})
|
|
28
|
+
),
|
|
37
29
|
onClick: p,
|
|
38
30
|
style: { position: v ? "relative" : "unset" }
|
|
39
31
|
},
|
|
@@ -14,12 +14,9 @@ const r = (t) => /* @__PURE__ */ l.createElement(
|
|
|
14
14
|
{
|
|
15
15
|
...t,
|
|
16
16
|
wrapperCssClass: "k-table-body k-table-scroller",
|
|
17
|
-
listClassName: s(
|
|
18
|
-
"k-
|
|
19
|
-
|
|
20
|
-
"k-virtual-table": t.virtual !== void 0
|
|
21
|
-
}
|
|
22
|
-
),
|
|
17
|
+
listClassName: s("k-table k-table-list", {
|
|
18
|
+
"k-virtual-table": t.virtual !== void 0
|
|
19
|
+
}),
|
|
23
20
|
listStyle: { ...t.listStyle }
|
|
24
21
|
}
|
|
25
22
|
);
|
package/common/Navigation.mjs
CHANGED
|
@@ -12,9 +12,19 @@ class o {
|
|
|
12
12
|
navigate(e) {
|
|
13
13
|
const t = e.keyCode;
|
|
14
14
|
if (t === n.up || t === n.left)
|
|
15
|
-
return this.next({
|
|
15
|
+
return this.next({
|
|
16
|
+
current: e.current,
|
|
17
|
+
min: e.min,
|
|
18
|
+
max: e.max,
|
|
19
|
+
step: e.skipItems ? e.skipItems : -1
|
|
20
|
+
});
|
|
16
21
|
if (t === n.down || t === n.right)
|
|
17
|
-
return this.next({
|
|
22
|
+
return this.next({
|
|
23
|
+
current: e.current,
|
|
24
|
+
min: e.min,
|
|
25
|
+
max: e.max,
|
|
26
|
+
step: e.skipItems ? e.skipItems : 1
|
|
27
|
+
});
|
|
18
28
|
if (t === n.home)
|
|
19
29
|
return 0;
|
|
20
30
|
if (t === n.end)
|
package/common/utils.mjs
CHANGED
|
@@ -89,7 +89,9 @@ const l = (e) => e != null, d = (e, t) => {
|
|
|
89
89
|
}, S = (e) => {
|
|
90
90
|
e.target.nodeName !== "INPUT" && e.preventDefault();
|
|
91
91
|
}, y = (e, t, r) => !!e != !!t || e.text !== t.text ? !1 : e === t || a(e.data, t.data, r), N = (e) => {
|
|
92
|
-
const t = e.filter(
|
|
92
|
+
const t = e.filter(
|
|
93
|
+
(r, n) => e.some((s, o) => s === r && o !== n)
|
|
94
|
+
);
|
|
93
95
|
return Array.from(new Set(t));
|
|
94
96
|
}, O = (e) => {
|
|
95
97
|
const { data: t = [], groupField: r } = e;
|