@progress/kendo-react-dropdowns 8.6.0-develop.1 → 9.0.0-develop.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ComboBox/ComboBox.mjs +67 -29
- package/DropDownTree/useDropdownWidth.mjs +3 -6
- package/MultiColumnComboBox/MultiColumnComboBox.mjs +144 -141
- package/MultiSelectTree/utils.js +1 -1
- package/MultiSelectTree/utils.mjs +12 -19
- package/README.md +44 -43
- 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 +0 -2
- package/index.d.ts +0 -2
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
package/ComboBox/ComboBox.mjs
CHANGED
|
@@ -323,7 +323,14 @@ const Ee = "Please enter a valid value!", F = class F extends u.Component {
|
|
|
323
323
|
this.props.prefix && /* @__PURE__ */ u.createElement(ee, { ...te }),
|
|
324
324
|
this.renderSearchBar(T || "", A, h),
|
|
325
325
|
Z && !o && /* @__PURE__ */ u.createElement(Ie, { onClick: this.clearButtonClick, key: "clearbutton" }),
|
|
326
|
-
o && /* @__PURE__ */ u.createElement(
|
|
326
|
+
o && /* @__PURE__ */ u.createElement(
|
|
327
|
+
le,
|
|
328
|
+
{
|
|
329
|
+
className: I(D.loadingIcon({ c: _ })),
|
|
330
|
+
name: "loading",
|
|
331
|
+
key: "loading"
|
|
332
|
+
}
|
|
333
|
+
),
|
|
327
334
|
this.props.suffix && /* @__PURE__ */ u.createElement(se, { ...ie }),
|
|
328
335
|
/* @__PURE__ */ u.createElement(
|
|
329
336
|
G,
|
|
@@ -451,38 +458,64 @@ const Ee = "Please enter a valid value!", F = class F extends u.Component {
|
|
|
451
458
|
icon: "x",
|
|
452
459
|
svgIcon: Ce
|
|
453
460
|
}
|
|
454
|
-
))), /* @__PURE__ */ u.createElement("div", { className: I(M.titleBarGroup({ c: m })) }, this.renderMobileListFilter())), /* @__PURE__ */ u.createElement(we, { overflowHidden: !0 }, /* @__PURE__ */ u.createElement(
|
|
455
|
-
D.listContainer({
|
|
456
|
-
c: v
|
|
457
|
-
})
|
|
458
|
-
) }, /* @__PURE__ */ u.createElement(
|
|
461
|
+
))), /* @__PURE__ */ u.createElement("div", { className: I(M.titleBarGroup({ c: m })) }, this.renderMobileListFilter())), /* @__PURE__ */ u.createElement(we, { overflowHidden: !0 }, /* @__PURE__ */ u.createElement(
|
|
459
462
|
"div",
|
|
460
463
|
{
|
|
461
464
|
className: I(
|
|
462
|
-
D.
|
|
463
|
-
c: v
|
|
464
|
-
list: a,
|
|
465
|
-
size: "large",
|
|
466
|
-
tableSize: i,
|
|
467
|
-
virtual: d
|
|
465
|
+
D.listContainer({
|
|
466
|
+
c: v
|
|
468
467
|
})
|
|
469
468
|
)
|
|
470
469
|
},
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
q,
|
|
470
|
+
/* @__PURE__ */ u.createElement(
|
|
471
|
+
"div",
|
|
474
472
|
{
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
473
|
+
className: I(
|
|
474
|
+
D.list({
|
|
475
|
+
c: v,
|
|
476
|
+
list: a,
|
|
477
|
+
size: "large",
|
|
478
|
+
tableSize: i,
|
|
479
|
+
virtual: d
|
|
480
|
+
})
|
|
481
|
+
)
|
|
482
|
+
},
|
|
483
|
+
e && /* @__PURE__ */ u.createElement("div", { className: I(D.listHeader({ c: v })) }, e),
|
|
484
|
+
!a && h && p.length !== 0 && /* @__PURE__ */ u.createElement(
|
|
485
|
+
q,
|
|
486
|
+
{
|
|
487
|
+
group: h,
|
|
488
|
+
groupMode: r,
|
|
489
|
+
render: o
|
|
490
|
+
}
|
|
491
|
+
),
|
|
492
|
+
this.renderList(),
|
|
493
|
+
t && /* @__PURE__ */ u.createElement(
|
|
494
|
+
"div",
|
|
495
|
+
{
|
|
496
|
+
className: I(
|
|
497
|
+
D.listFooter({ c: v }),
|
|
498
|
+
this.props.footerClassName
|
|
499
|
+
)
|
|
500
|
+
},
|
|
501
|
+
t
|
|
502
|
+
)
|
|
503
|
+
)
|
|
504
|
+
)));
|
|
483
505
|
}
|
|
484
506
|
renderListContainer() {
|
|
485
|
-
const s = this.base, {
|
|
507
|
+
const s = this.base, {
|
|
508
|
+
dir: e,
|
|
509
|
+
header: t,
|
|
510
|
+
footer: i,
|
|
511
|
+
groupField: n,
|
|
512
|
+
groupMode: r,
|
|
513
|
+
size: a,
|
|
514
|
+
list: d,
|
|
515
|
+
virtual: l,
|
|
516
|
+
groupStickyHeaderItemRender: o,
|
|
517
|
+
unstyled: c
|
|
518
|
+
} = this.props, p = S(this.props), y = this.props.opened !== void 0 ? this.props.opened : this.state.opened, x = s.getPopupSettings(), v = x.width !== void 0 ? x.width : s.popupWidth, m = c && c.uComboBox;
|
|
486
519
|
let { group: h } = this.state;
|
|
487
520
|
return h === void 0 && n !== void 0 && (h = k(p[0], n)), /* @__PURE__ */ u.createElement(
|
|
488
521
|
ve,
|
|
@@ -522,7 +555,10 @@ const Ee = "Please enter a valid value!", F = class F extends u.Component {
|
|
|
522
555
|
i && /* @__PURE__ */ u.createElement(
|
|
523
556
|
"div",
|
|
524
557
|
{
|
|
525
|
-
className: I(
|
|
558
|
+
className: I(
|
|
559
|
+
D.listFooter({ c: m }),
|
|
560
|
+
this.props.footerClassName
|
|
561
|
+
)
|
|
526
562
|
},
|
|
527
563
|
i
|
|
528
564
|
)
|
|
@@ -559,10 +595,12 @@ const Ee = "Please enter a valid value!", F = class F extends u.Component {
|
|
|
559
595
|
c.list = this.base.list = O, this.itemHeight = 0;
|
|
560
596
|
},
|
|
561
597
|
wrapperStyle: this.state.windowWidth && this.state.windowWidth > Y ? { maxHeight: o.height } : {},
|
|
562
|
-
wrapperCssClass: I(
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
598
|
+
wrapperCssClass: I(
|
|
599
|
+
D.listContent({
|
|
600
|
+
c: B,
|
|
601
|
+
virtual: a
|
|
602
|
+
})
|
|
603
|
+
),
|
|
566
604
|
listStyle: c.enabled ? { transform: x } : void 0,
|
|
567
605
|
key: "listkey",
|
|
568
606
|
skip: p,
|
|
@@ -9,12 +9,9 @@
|
|
|
9
9
|
import * as p from "react";
|
|
10
10
|
function u(t, e, n) {
|
|
11
11
|
const [d, i] = p.useState(e);
|
|
12
|
-
return p.useEffect(
|
|
13
|
-
()
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
n
|
|
17
|
-
), d;
|
|
12
|
+
return p.useEffect(() => {
|
|
13
|
+
d !== void 0 && t.current && i(t.current.offsetWidth);
|
|
14
|
+
}, n), d;
|
|
18
15
|
}
|
|
19
16
|
function r(t) {
|
|
20
17
|
return typeof t == "string" ? Number(t.replace("px", "")) : t || void 0;
|
|
@@ -13,156 +13,159 @@ import { createPropsContext as ie, usePropsContext as de, getScrollbarWidth as c
|
|
|
13
13
|
import { ComboBox as me, ComboBoxWithoutContext as fe } from "../ComboBox/ComboBox.mjs";
|
|
14
14
|
import { getItemValue as ge } from "../common/utils.mjs";
|
|
15
15
|
import W from "../common/withCustomComponent.mjs";
|
|
16
|
-
const he = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, Ce = ie(), P = e.forwardRef(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
16
|
+
const he = (u, h) => u ? typeof u == "number" ? u + "px" : u : h, Ce = ie(), P = e.forwardRef(
|
|
17
|
+
(u, h) => {
|
|
18
|
+
const t = de(Ce, u), C = e.useRef(null), a = e.useRef(null), y = ce(), {
|
|
19
|
+
columns: n = s.columns,
|
|
20
|
+
popupSettings: p = s.popupSettings,
|
|
21
|
+
size: z = s.size,
|
|
22
|
+
rounded: O = s.rounded,
|
|
23
|
+
fillMode: L = s.fillMode,
|
|
24
|
+
className: $,
|
|
25
|
+
prefix: j = void 0,
|
|
26
|
+
suffix: V = void 0,
|
|
27
|
+
onOpen: w,
|
|
28
|
+
onClose: E,
|
|
29
|
+
onFocus: F,
|
|
30
|
+
onBlur: H,
|
|
31
|
+
onChange: N,
|
|
32
|
+
onFilterChange: S,
|
|
33
|
+
onPageChange: M,
|
|
34
|
+
...A
|
|
35
|
+
} = t;
|
|
36
|
+
e.useImperativeHandle(C, () => ({
|
|
37
|
+
element: a.current && a.current.element,
|
|
38
|
+
focus() {
|
|
39
|
+
a.current && a.current.focus();
|
|
40
|
+
},
|
|
41
|
+
get value() {
|
|
42
|
+
return a.current && a.current.value;
|
|
43
|
+
},
|
|
44
|
+
get name() {
|
|
45
|
+
return a.current && a.current.name;
|
|
46
|
+
},
|
|
47
|
+
props: t
|
|
48
|
+
})), e.useImperativeHandle(
|
|
49
|
+
h,
|
|
50
|
+
() => C.current
|
|
51
|
+
);
|
|
52
|
+
const c = e.useMemo(() => {
|
|
50
53
|
if (t.groupField !== void 0 && t.data)
|
|
51
54
|
return ge(t.data[0], t.groupField);
|
|
52
|
-
},
|
|
53
|
-
[t.data, t.groupField]
|
|
54
|
-
), [k, m] = e.useState(c), [R, B] = e.useState(!0), [D] = j ? W(t.prefix || e.Fragment) : [], [J] = V ? W(t.suffix || e.Fragment) : [], Q = e.useMemo(
|
|
55
|
-
() => {
|
|
55
|
+
}, [t.data, t.groupField]), [k, m] = e.useState(c), [R, B] = e.useState(!0), [D] = j ? W(t.prefix || e.Fragment) : [], [J] = V ? W(t.suffix || e.Fragment) : [], Q = e.useMemo(() => {
|
|
56
56
|
const r = /* @__PURE__ */ e.createElement("th", { className: "k-table-th", colSpan: n.length }, k);
|
|
57
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, t.header, /* @__PURE__ */ e.createElement("div", { className: "k-table-header-wrap" }, /* @__PURE__ */ e.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ e.createElement("colgroup", null, n.map(
|
|
58
|
-
|
|
59
|
-
"col",
|
|
60
|
-
{
|
|
61
|
-
key: o.uniqueKey ? o.uniqueKey : i,
|
|
62
|
-
style: { width: o.width ? o.width : s.width }
|
|
63
|
-
}
|
|
64
|
-
)
|
|
65
|
-
)), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" }, n.map((o, i) => /* @__PURE__ */ e.createElement("th", { className: "k-table-th", key: o.uniqueKey ? o.uniqueKey : i }, o.header || " "))), k && R && /* @__PURE__ */ e.createElement("tr", { className: "k-table-group-row" }, t.groupStickyHeaderItemRender ? t.groupStickyHeaderItemRender.call(void 0, r, {}) : r)))));
|
|
66
|
-
},
|
|
67
|
-
[t.header, n, k, R]
|
|
68
|
-
), U = e.useMemo(
|
|
69
|
-
() => (
|
|
70
|
-
// These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
|
|
71
|
-
`calc(${n.map((r) => he(r.width, s.width)).filter(Boolean).join(" + ")} + ${y}px + 4px)`
|
|
72
|
-
),
|
|
73
|
-
[n, y]
|
|
74
|
-
), q = t.virtual ? t.virtual.skip : 0, X = e.useCallback(
|
|
75
|
-
(r, o) => {
|
|
76
|
-
const i = n.map((d, le) => /* @__PURE__ */ e.createElement(
|
|
77
|
-
"span",
|
|
57
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, t.header, /* @__PURE__ */ e.createElement("div", { className: "k-table-header-wrap" }, /* @__PURE__ */ e.createElement("table", { className: "k-table", role: "presentation" }, /* @__PURE__ */ e.createElement("colgroup", null, n.map((o, i) => /* @__PURE__ */ e.createElement(
|
|
58
|
+
"col",
|
|
78
59
|
{
|
|
79
|
-
|
|
80
|
-
style:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
60
|
+
key: o.uniqueKey ? o.uniqueKey : i,
|
|
61
|
+
style: { width: o.width ? o.width : s.width }
|
|
62
|
+
}
|
|
63
|
+
))), /* @__PURE__ */ e.createElement("thead", { className: "k-table-thead" }, /* @__PURE__ */ e.createElement("tr", { className: "k-table-row" }, n.map((o, i) => /* @__PURE__ */ e.createElement("th", { className: "k-table-th", key: o.uniqueKey ? o.uniqueKey : i }, o.header || " "))), k && R && /* @__PURE__ */ e.createElement("tr", { className: "k-table-group-row" }, t.groupStickyHeaderItemRender ? t.groupStickyHeaderItemRender.call(void 0, r, {}) : r)))));
|
|
64
|
+
}, [t.header, n, k, R]), U = e.useMemo(
|
|
65
|
+
() => (
|
|
66
|
+
// These additional 4px are coming from the child elements side borders (fixes horizontal scrollbar)
|
|
67
|
+
`calc(${n.map((r) => he(r.width, s.width)).filter(Boolean).join(" + ")} + ${y}px + 4px)`
|
|
68
|
+
),
|
|
69
|
+
[n, y]
|
|
70
|
+
), q = t.virtual ? t.virtual.skip : 0, X = e.useCallback(
|
|
71
|
+
(r, o) => {
|
|
72
|
+
const i = n.map((d, le) => /* @__PURE__ */ e.createElement(
|
|
73
|
+
"span",
|
|
74
|
+
{
|
|
75
|
+
className: t.itemRender ? void 0 : "k-table-td",
|
|
76
|
+
style: t.itemRender ? void 0 : { width: d.width ? d.width : s.width },
|
|
77
|
+
key: d.uniqueKey ? d.uniqueKey : le
|
|
78
|
+
},
|
|
79
|
+
d.field ? String(T(d.field)(o.dataItem)) : ""
|
|
80
|
+
));
|
|
81
|
+
let f, g, b, v, I = t.data || [];
|
|
82
|
+
const K = o.index - q;
|
|
83
|
+
t.groupField !== void 0 && (v = T(t.groupField), g = v(I[K]), b = v(I[K - 1]), g && b && g !== b && (f = g)), f && t.groupMode === "classic" && i.push(
|
|
84
|
+
/* @__PURE__ */ e.createElement("div", { key: "group", className: "k-table-td k-table-group-td" }, /* @__PURE__ */ e.createElement("span", null, f))
|
|
85
|
+
);
|
|
86
|
+
const G = e.cloneElement(
|
|
87
|
+
r,
|
|
88
|
+
{
|
|
89
|
+
...r.props,
|
|
90
|
+
className: x("k-table-row", {
|
|
91
|
+
"k-table-alt-row": o.index % 2 !== 0,
|
|
92
|
+
"k-focus": o.focused,
|
|
93
|
+
"k-selected": o.selected,
|
|
94
|
+
"k-first": !!f,
|
|
95
|
+
"k-disabled": o.dataItem.disabled
|
|
96
|
+
})
|
|
97
|
+
},
|
|
98
|
+
i
|
|
99
|
+
);
|
|
100
|
+
return t.itemRender ? t.itemRender.call(void 0, G, o) : G;
|
|
101
|
+
},
|
|
102
|
+
[n, t.groupField, t.itemRender, t.data, q]
|
|
103
|
+
), l = e.useCallback((r, o) => {
|
|
103
104
|
r && r.call(void 0, {
|
|
104
105
|
...o,
|
|
105
106
|
target: C.current
|
|
106
107
|
});
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
}, []), Y = e.useCallback(
|
|
109
|
+
(r) => (t.virtual || m(c), l(w, r)),
|
|
110
|
+
[l, w, t.virtual, c]
|
|
111
|
+
), Z = e.useCallback((r) => l(E, r), [E]), _ = e.useCallback((r) => l(F, r), [F]), ee = e.useCallback((r) => l(H, r), [H]), te = e.useCallback((r) => l(N, r), [N]), re = e.useCallback((r) => l(M, r), [M]), oe = e.useCallback(
|
|
112
|
+
(r) => (m(c), l(S, {
|
|
113
|
+
...r,
|
|
114
|
+
mobileMode: r.target.mobileMode
|
|
115
|
+
})),
|
|
116
|
+
[S]
|
|
117
|
+
), ae = e.useCallback((r) => {
|
|
114
118
|
m(r.group);
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}), ke = {
|
|
119
|
+
}, []);
|
|
120
|
+
e.useEffect(() => {
|
|
121
|
+
pe();
|
|
122
|
+
}), e.useEffect(() => {
|
|
123
|
+
const r = t.data;
|
|
124
|
+
m(c), r && r.length !== 0 ? B(!0) : B(!1);
|
|
125
|
+
}, [t.data]);
|
|
126
|
+
const ne = e.useCallback((r) => /* @__PURE__ */ e.createElement(ue, { ...r }), []);
|
|
127
|
+
return /* @__PURE__ */ e.createElement(
|
|
128
|
+
me,
|
|
129
|
+
{
|
|
130
|
+
...A,
|
|
131
|
+
list: ne,
|
|
132
|
+
popupSettings: {
|
|
133
|
+
...p,
|
|
134
|
+
popupClass: x("k-dropdowngrid-popup", p.popupClass),
|
|
135
|
+
width: p.width || U,
|
|
136
|
+
className: p.className
|
|
137
|
+
},
|
|
138
|
+
ref: a,
|
|
139
|
+
header: Q,
|
|
140
|
+
itemRender: X,
|
|
141
|
+
groupHeaderItemRender: t.groupHeaderItemRender,
|
|
142
|
+
size: z,
|
|
143
|
+
rounded: O,
|
|
144
|
+
fillMode: L,
|
|
145
|
+
groupMode: t.groupMode,
|
|
146
|
+
groupField: t.groupField,
|
|
147
|
+
isMultiColumn: !0,
|
|
148
|
+
onOpen: Y,
|
|
149
|
+
onClose: Z,
|
|
150
|
+
onFocus: _,
|
|
151
|
+
onBlur: ee,
|
|
152
|
+
onChange: te,
|
|
153
|
+
onFilterChange: oe,
|
|
154
|
+
onPageChange: re,
|
|
155
|
+
onGroupScroll: ae,
|
|
156
|
+
className: x("k-dropdowngrid", $),
|
|
157
|
+
required: t.required,
|
|
158
|
+
adaptive: t.adaptive,
|
|
159
|
+
adaptiveFilter: t.adaptiveFilter,
|
|
160
|
+
adaptiveTitle: t.adaptiveTitle,
|
|
161
|
+
footer: t.footer,
|
|
162
|
+
footerClassName: "k-table-footer",
|
|
163
|
+
prefix: D,
|
|
164
|
+
suffix: J
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
), ke = {
|
|
166
169
|
...fe.propTypes,
|
|
167
170
|
columns: se.any.isRequired
|
|
168
171
|
}, s = {
|
package/MultiSelectTree/utils.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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("@progress/kendo-react-common"),r=(i,m)=>{const u={};return i&&i.length&&i.forEach(f=>{u[m(f)]=!0}),u},G=(i,m)=>{const{items:u,dataItemKey:f,value:p,subItemsField:w="items",operation:V}=m,t=S.getter(f),I=r(p,t);if(V==="clear")return[];if(V==="delete"){const n=r(u,t);return p.filter(e=>!n[t(e)])}const y=u[0],C=t(y),d=S.getter(w),a=[...i],c=[];let M=[],g;for(;a.length;){const n=a.pop();if(C===t(n)){M=c.map(e=>e.item),g=n;break}else{c&&c.length&&c[c.length-1].parentPosition===a.length&&c.pop();const e=d(n);e&&e.length&&(c.push({item:n,parentPosition:a.length}),a.push(...e))}}const b=[...d(g)||[]]
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("@progress/kendo-react-common"),r=(i,m)=>{const u={};return i&&i.length&&i.forEach(f=>{u[m(f)]=!0}),u},G=(i,m)=>{const{items:u,dataItemKey:f,value:p,subItemsField:w="items",operation:V}=m,t=S.getter(f),I=r(p,t);if(V==="clear")return[];if(V==="delete"){const n=r(u,t);return p.filter(e=>!n[t(e)])}const y=u[0],C=t(y),d=S.getter(w),a=[...i],c=[];let M=[],g;for(;a.length;){const n=a.pop();if(C===t(n)){M=c.map(e=>e.item),g=n;break}else{c&&c.length&&c[c.length-1].parentPosition===a.length&&c.pop();const e=d(n);e&&e.length&&(c.push({item:n,parentPosition:a.length}),a.push(...e))}}const b=[...d(g)||[]],k=[];for(;b.length;){const n=b.pop();k.push(n);const e=d(n);e&&e.length&&b.push(...e)}const P=!I[C],l=[];if(P){l.push(...p),l.push(g),l.push(...k.filter(s=>!I[t(s)]));const n=M.filter(s=>!I[t(s)]),e=r(l,t);for(let s=n.length-1;s>-1;s--){const h=n[s],o=d(h);if(o.filter(T=>e[t(T)]).length<o.length)break;l.push(h),e[t(h)]=!0}}else{const n=t(g),e=r(k,t),s=r(M,t);l.push(...p.filter(h=>{const o=t(h);return!e[o]&&n!==o&&!s[o]}))}return l};exports.getMultiSelectTreeValue=G;exports.getValueMap=r;
|
|
@@ -13,13 +13,7 @@ const u = (r, f) => {
|
|
|
13
13
|
i[f(g)] = !0;
|
|
14
14
|
}), i;
|
|
15
15
|
}, E = (r, f) => {
|
|
16
|
-
const {
|
|
17
|
-
items: i,
|
|
18
|
-
dataItemKey: g,
|
|
19
|
-
value: a,
|
|
20
|
-
subItemsField: x = "items",
|
|
21
|
-
operation: w
|
|
22
|
-
} = f, t = V(g), I = u(a, t);
|
|
16
|
+
const { items: i, dataItemKey: g, value: a, subItemsField: x = "items", operation: w } = f, t = V(g), I = u(a, t);
|
|
23
17
|
if (w === "clear")
|
|
24
18
|
return [];
|
|
25
19
|
if (w === "delete") {
|
|
@@ -39,34 +33,33 @@ const u = (r, f) => {
|
|
|
39
33
|
e && e.length && (c.push({ item: n, parentPosition: h.length }), h.push(...e));
|
|
40
34
|
}
|
|
41
35
|
}
|
|
42
|
-
const k = [...d(m) || []];
|
|
43
|
-
let M = [];
|
|
36
|
+
const k = [...d(m) || []], M = [];
|
|
44
37
|
for (; k.length; ) {
|
|
45
38
|
const n = k.pop();
|
|
46
39
|
M.push(n);
|
|
47
40
|
const e = d(n);
|
|
48
41
|
e && e.length && k.push(...e);
|
|
49
42
|
}
|
|
50
|
-
const L = !I[C],
|
|
43
|
+
const L = !I[C], o = [];
|
|
51
44
|
if (L) {
|
|
52
|
-
|
|
53
|
-
const n = b.filter((s) => !I[t(s)]), e = u(
|
|
45
|
+
o.push(...a), o.push(m), o.push(...M.filter((s) => !I[t(s)]));
|
|
46
|
+
const n = b.filter((s) => !I[t(s)]), e = u(o, t);
|
|
54
47
|
for (let s = n.length - 1; s > -1; s--) {
|
|
55
|
-
const p = n[s],
|
|
56
|
-
if (
|
|
48
|
+
const p = n[s], l = d(p);
|
|
49
|
+
if (l.filter((P) => e[t(P)]).length < l.length)
|
|
57
50
|
break;
|
|
58
|
-
|
|
51
|
+
o.push(p), e[t(p)] = !0;
|
|
59
52
|
}
|
|
60
53
|
} else {
|
|
61
54
|
const n = t(m), e = u(M, t), s = u(b, t);
|
|
62
|
-
|
|
55
|
+
o.push(
|
|
63
56
|
...a.filter((p) => {
|
|
64
|
-
const
|
|
65
|
-
return !e[
|
|
57
|
+
const l = t(p);
|
|
58
|
+
return !e[l] && n !== l && !s[l];
|
|
66
59
|
})
|
|
67
60
|
);
|
|
68
61
|
}
|
|
69
|
-
return
|
|
62
|
+
return o;
|
|
70
63
|
};
|
|
71
64
|
export {
|
|
72
65
|
E as getMultiSelectTreeValue,
|