@progress/kendo-react-data-tools 7.4.0-develop.8 → 7.4.0-develop.9
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/dist/cdn/js/kendo-react-datatools.js +1 -1
- package/filter/filters/NumericFilter.js +1 -1
- package/filter/filters/NumericFilter.mjs +19 -21
- package/index.d.mts +3 -0
- package/index.d.ts +3 -0
- package/index.js +1 -1
- package/index.mjs +90 -89
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
- package/selection/TableSelection.js +1 -1
- package/selection/TableSelection.mjs +48 -49
- package/selection/utils.js +1 -1
- package/selection/utils.mjs +86 -77
package/selection/utils.mjs
CHANGED
|
@@ -6,9 +6,17 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { getter as
|
|
10
|
-
import { TABLE_ROW_INDEX_ATTRIBUTE as
|
|
11
|
-
const
|
|
9
|
+
import { getter as _, mapTree as N, extendDataItem as B, Keys as O, hasRelativeStackingContext as M } from "@progress/kendo-react-common";
|
|
10
|
+
import { TABLE_PREVENT_SELECTION_ELEMENT as F, TABLE_ROW_INDEX_ATTRIBUTE as G, TABLE_COL_INDEX_ATTRIBUTE as U } from "./constants.mjs";
|
|
11
|
+
const X = "items", x = {}, b = (e, t) => !e || Array.isArray(e) && e.length === 0 ? [t] : e.findIndex((o) => o === t) > -1 ? e.filter((o) => o !== t) : [...e, t], J = (e) => {
|
|
12
|
+
let t = e;
|
|
13
|
+
for (; t; ) {
|
|
14
|
+
if (t.hasAttribute(F))
|
|
15
|
+
return !0;
|
|
16
|
+
t = t.parentElement;
|
|
17
|
+
}
|
|
18
|
+
return !1;
|
|
19
|
+
}, A = (e, t) => {
|
|
12
20
|
let n = e;
|
|
13
21
|
for (; n; ) {
|
|
14
22
|
if (n.tagName === t)
|
|
@@ -21,106 +29,106 @@ const U = "items", x = {}, X = (e, t) => !e || Array.isArray(e) && e.length ===
|
|
|
21
29
|
}, k = (e) => {
|
|
22
30
|
if (!e)
|
|
23
31
|
return;
|
|
24
|
-
const t = e.getAttribute(
|
|
32
|
+
const t = e.getAttribute(G);
|
|
25
33
|
return t ? parseInt(t, 10) : void 0;
|
|
26
|
-
},
|
|
34
|
+
}, V = (e) => {
|
|
27
35
|
if (!e)
|
|
28
36
|
return;
|
|
29
|
-
const t = e.getAttribute(
|
|
37
|
+
const t = e.getAttribute(U);
|
|
30
38
|
return t ? parseInt(t, 10) : void 0;
|
|
31
|
-
},
|
|
32
|
-
const t = e.subItemsField ||
|
|
33
|
-
return
|
|
39
|
+
}, Q = (e) => {
|
|
40
|
+
const t = e.subItemsField || X, n = _(e.dataItemKey);
|
|
41
|
+
return N(
|
|
34
42
|
e.data,
|
|
35
43
|
t,
|
|
36
|
-
(o) =>
|
|
44
|
+
(o) => B(o, t, {
|
|
37
45
|
[e.selectedField]: e.selectedState[n(o)]
|
|
38
46
|
})
|
|
39
47
|
);
|
|
40
|
-
},
|
|
41
|
-
const { event: t, dataItemKey: n, selectedState: o } = e, { syntheticEvent:
|
|
42
|
-
if (
|
|
48
|
+
}, Y = (e) => {
|
|
49
|
+
const { event: t, dataItemKey: n, selectedState: o } = e, { syntheticEvent: c, nativeEvent: r, dataItems: E, componentId: a, mode: T, cell: f, selectedField: w } = t, { target: g, ctrlKey: p, metaKey: C, altKey: I, shiftKey: D } = r;
|
|
50
|
+
if (c.isDefaultPrevented() || r.keyCode !== O.enter)
|
|
43
51
|
return o;
|
|
44
|
-
const
|
|
52
|
+
const y = A(g, "TD"), i = A(g, "TR"), s = V(y), m = k(i);
|
|
45
53
|
let d = {};
|
|
46
|
-
return
|
|
54
|
+
return y && i && m !== void 0 && s !== void 0 && (d = H({
|
|
47
55
|
selectedState: o,
|
|
48
56
|
dataItemKey: n,
|
|
49
57
|
event: {
|
|
50
58
|
ctrlKey: p,
|
|
51
|
-
metaKey:
|
|
59
|
+
metaKey: C,
|
|
52
60
|
altKey: I,
|
|
53
61
|
shiftKey: D,
|
|
54
|
-
dataItems:
|
|
55
|
-
cell:
|
|
56
|
-
mode:
|
|
57
|
-
selectedField:
|
|
58
|
-
componentId:
|
|
59
|
-
startColIndex:
|
|
60
|
-
endColIndex:
|
|
62
|
+
dataItems: E,
|
|
63
|
+
cell: f,
|
|
64
|
+
mode: T,
|
|
65
|
+
selectedField: w,
|
|
66
|
+
componentId: a,
|
|
67
|
+
startColIndex: s,
|
|
68
|
+
endColIndex: s,
|
|
61
69
|
startRowIndex: m,
|
|
62
70
|
endRowIndex: m,
|
|
63
71
|
isDrag: !1,
|
|
64
|
-
syntheticEvent:
|
|
65
|
-
nativeEvent:
|
|
72
|
+
syntheticEvent: c,
|
|
73
|
+
nativeEvent: r,
|
|
66
74
|
target: t.target,
|
|
67
75
|
dataItem: null
|
|
68
76
|
}
|
|
69
77
|
})), d;
|
|
70
|
-
},
|
|
78
|
+
}, H = (e) => {
|
|
71
79
|
const { event: t, dataItemKey: n, selectedState: o } = e, {
|
|
72
|
-
dataItems:
|
|
73
|
-
startRowIndex:
|
|
74
|
-
endRowIndex:
|
|
75
|
-
startColIndex:
|
|
76
|
-
endColIndex:
|
|
77
|
-
cell:
|
|
78
|
-
isDrag:
|
|
79
|
-
ctrlKey:
|
|
80
|
+
dataItems: c,
|
|
81
|
+
startRowIndex: r,
|
|
82
|
+
endRowIndex: E,
|
|
83
|
+
startColIndex: a,
|
|
84
|
+
endColIndex: T,
|
|
85
|
+
cell: f,
|
|
86
|
+
isDrag: w,
|
|
87
|
+
ctrlKey: g,
|
|
80
88
|
shiftKey: p,
|
|
81
|
-
metaKey:
|
|
89
|
+
metaKey: C,
|
|
82
90
|
componentId: I,
|
|
83
91
|
mode: D,
|
|
84
|
-
dataItem:
|
|
85
|
-
} = t, i =
|
|
86
|
-
let
|
|
87
|
-
const m =
|
|
92
|
+
dataItem: y
|
|
93
|
+
} = t, i = _(n);
|
|
94
|
+
let s = {};
|
|
95
|
+
const m = y !== null;
|
|
88
96
|
if (D === "single") {
|
|
89
|
-
const d =
|
|
97
|
+
const d = c.slice(r, r + 1)[0], u = i(d);
|
|
90
98
|
x[I] = {
|
|
91
|
-
rowIndex:
|
|
92
|
-
colIndex:
|
|
93
|
-
},
|
|
94
|
-
} else if (
|
|
95
|
-
|
|
96
|
-
rowIndex:
|
|
97
|
-
colIndex:
|
|
99
|
+
rowIndex: r,
|
|
100
|
+
colIndex: a
|
|
101
|
+
}, s[u] = f ? [a] : !0;
|
|
102
|
+
} else if (w || !p && !g && !C && !m) {
|
|
103
|
+
w || (x[I] = {
|
|
104
|
+
rowIndex: r,
|
|
105
|
+
colIndex: a
|
|
98
106
|
});
|
|
99
107
|
const d = [];
|
|
100
|
-
for (let
|
|
101
|
-
d.push(
|
|
102
|
-
|
|
103
|
-
const
|
|
104
|
-
|
|
108
|
+
for (let l = a; l <= T; l++)
|
|
109
|
+
d.push(l);
|
|
110
|
+
c.slice(r, E + 1).forEach((l) => {
|
|
111
|
+
const h = i(l);
|
|
112
|
+
s[h] = f ? [...d] : !0;
|
|
105
113
|
});
|
|
106
|
-
} else if (
|
|
114
|
+
} else if (g || C || m) {
|
|
107
115
|
x[I] = {
|
|
108
|
-
rowIndex:
|
|
109
|
-
colIndex:
|
|
116
|
+
rowIndex: r,
|
|
117
|
+
colIndex: a
|
|
110
118
|
};
|
|
111
|
-
const u =
|
|
112
|
-
|
|
119
|
+
const u = c.slice(r, E + 1)[0], l = i(u);
|
|
120
|
+
s = { ...o }, s[l] = f && !m ? b(s[l], a) : !s[l];
|
|
113
121
|
} else if (p) {
|
|
114
|
-
const d = x[I] && x[I].rowIndex || 0, u = x[I] && x[I].colIndex || 0,
|
|
115
|
-
for (let
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const L = i(
|
|
119
|
-
|
|
122
|
+
const d = x[I] && x[I].rowIndex || 0, u = x[I] && x[I].colIndex || 0, l = Math.min(d, r, E), h = Math.max(d, r, E), v = Math.min(u, a, T), K = Math.max(u, a, T), R = [];
|
|
123
|
+
for (let S = v; S <= K; S++)
|
|
124
|
+
R.push(S);
|
|
125
|
+
c.slice(l, h + 1).forEach((S) => {
|
|
126
|
+
const L = i(S);
|
|
127
|
+
s[L] = f ? [...R] : !0;
|
|
120
128
|
});
|
|
121
129
|
}
|
|
122
|
-
return
|
|
123
|
-
}, W =
|
|
130
|
+
return s;
|
|
131
|
+
}, W = M(), Z = (e) => {
|
|
124
132
|
if (!e || !W)
|
|
125
133
|
return null;
|
|
126
134
|
let t = e.parentElement;
|
|
@@ -129,7 +137,7 @@ const U = "items", x = {}, X = (e, t) => !e || Array.isArray(e) && e.length ===
|
|
|
129
137
|
return t;
|
|
130
138
|
t = t.parentElement;
|
|
131
139
|
}
|
|
132
|
-
},
|
|
140
|
+
}, $ = (e) => {
|
|
133
141
|
if (e && e.ownerDocument && e !== e.ownerDocument.body) {
|
|
134
142
|
const t = e.getBoundingClientRect();
|
|
135
143
|
return {
|
|
@@ -138,18 +146,19 @@ const U = "items", x = {}, X = (e, t) => !e || Array.isArray(e) && e.length ===
|
|
|
138
146
|
};
|
|
139
147
|
}
|
|
140
148
|
return { left: 0, top: 0 };
|
|
141
|
-
},
|
|
142
|
-
const t = e ? typeof e.enabled == "boolean" ? e.enabled : !0 : !1, n = e ? !!e.drag : !1, o = e && e.mode ? e.mode : "multiple",
|
|
143
|
-
return { enabled: t, drag: n, mode: o, cell:
|
|
149
|
+
}, P = (e) => {
|
|
150
|
+
const t = e ? typeof e.enabled == "boolean" ? e.enabled : !0 : !1, n = e ? !!e.drag : !1, o = e && e.mode ? e.mode : "multiple", c = !!(e && e.cell);
|
|
151
|
+
return { enabled: t, drag: n, mode: o, cell: c };
|
|
144
152
|
};
|
|
145
153
|
export {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
154
|
+
A as closestTagName,
|
|
155
|
+
V as getColumnIndex,
|
|
156
|
+
$ as getOffset,
|
|
149
157
|
k as getRowIndex,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
158
|
+
H as getSelectedState,
|
|
159
|
+
Y as getSelectedStateFromKeyDown,
|
|
160
|
+
P as getSelectionOptions,
|
|
161
|
+
J as isInNonSelectable,
|
|
162
|
+
Z as relativeContextElement,
|
|
163
|
+
Q as setSelectedState
|
|
155
164
|
};
|