@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.
@@ -6,9 +6,17 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import { getter as A, mapTree as B, extendDataItem as N, Keys as O, hasRelativeStackingContext as F } from "@progress/kendo-react-common";
10
- import { TABLE_ROW_INDEX_ATTRIBUTE as M, TABLE_COL_INDEX_ATTRIBUTE as G } from "./constants.mjs";
11
- const U = "items", x = {}, X = (e, t) => !e || Array.isArray(e) && e.length === 0 ? [t] : e.findIndex((o) => o === t) > -1 ? e.filter((o) => o !== t) : [...e, t], v = (e, t) => {
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(M);
32
+ const t = e.getAttribute(G);
25
33
  return t ? parseInt(t, 10) : void 0;
26
- }, H = (e) => {
34
+ }, V = (e) => {
27
35
  if (!e)
28
36
  return;
29
- const t = e.getAttribute(G);
37
+ const t = e.getAttribute(U);
30
38
  return t ? parseInt(t, 10) : void 0;
31
- }, z = (e) => {
32
- const t = e.subItemsField || U, n = A(e.dataItemKey);
33
- return B(
39
+ }, Q = (e) => {
40
+ const t = e.subItemsField || X, n = _(e.dataItemKey);
41
+ return N(
34
42
  e.data,
35
43
  t,
36
- (o) => N(o, t, {
44
+ (o) => B(o, t, {
37
45
  [e.selectedField]: e.selectedState[n(o)]
38
46
  })
39
47
  );
40
- }, J = (e) => {
41
- const { event: t, dataItemKey: n, selectedState: o } = e, { syntheticEvent: a, nativeEvent: s, dataItems: f, componentId: l, mode: g, cell: E, selectedField: S } = t, { target: T, ctrlKey: p, metaKey: y, altKey: I, shiftKey: D } = s;
42
- if (a.isDefaultPrevented() || s.keyCode !== O.enter)
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 C = v(T, "TD"), i = v(T, "TR"), r = H(C), m = k(i);
52
+ const y = A(g, "TD"), i = A(g, "TR"), s = V(y), m = k(i);
45
53
  let d = {};
46
- return C && i && m !== void 0 && r !== void 0 && (d = V({
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: y,
59
+ metaKey: C,
52
60
  altKey: I,
53
61
  shiftKey: D,
54
- dataItems: f,
55
- cell: E,
56
- mode: g,
57
- selectedField: S,
58
- componentId: l,
59
- startColIndex: r,
60
- endColIndex: r,
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: a,
65
- nativeEvent: s,
72
+ syntheticEvent: c,
73
+ nativeEvent: r,
66
74
  target: t.target,
67
75
  dataItem: null
68
76
  }
69
77
  })), d;
70
- }, V = (e) => {
78
+ }, H = (e) => {
71
79
  const { event: t, dataItemKey: n, selectedState: o } = e, {
72
- dataItems: a,
73
- startRowIndex: s,
74
- endRowIndex: f,
75
- startColIndex: l,
76
- endColIndex: g,
77
- cell: E,
78
- isDrag: S,
79
- ctrlKey: T,
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: y,
89
+ metaKey: C,
82
90
  componentId: I,
83
91
  mode: D,
84
- dataItem: C
85
- } = t, i = A(n);
86
- let r = {};
87
- const m = C !== null;
92
+ dataItem: y
93
+ } = t, i = _(n);
94
+ let s = {};
95
+ const m = y !== null;
88
96
  if (D === "single") {
89
- const d = a.slice(s, s + 1)[0], u = i(d);
97
+ const d = c.slice(r, r + 1)[0], u = i(d);
90
98
  x[I] = {
91
- rowIndex: s,
92
- colIndex: l
93
- }, r[u] = E ? [l] : !0;
94
- } else if (S || !p && !T && !y && !m) {
95
- S || (x[I] = {
96
- rowIndex: s,
97
- colIndex: l
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 c = l; c <= g; c++)
101
- d.push(c);
102
- a.slice(s, f + 1).forEach((c) => {
103
- const R = i(c);
104
- r[R] = E ? [...d] : !0;
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 (T || y || m) {
114
+ } else if (g || C || m) {
107
115
  x[I] = {
108
- rowIndex: s,
109
- colIndex: l
116
+ rowIndex: r,
117
+ colIndex: a
110
118
  };
111
- const u = a.slice(s, f + 1)[0], c = i(u);
112
- r = { ...o }, r[c] = E && !m ? X(r[c], l) : !r[c];
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, c = Math.min(d, s, f), R = Math.max(d, s, f), K = Math.min(u, l, g), _ = Math.max(u, l, g), h = [];
115
- for (let w = K; w <= _; w++)
116
- h.push(w);
117
- a.slice(c, R + 1).forEach((w) => {
118
- const L = i(w);
119
- r[L] = E ? [...h] : !0;
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 r;
123
- }, W = F(), Q = (e) => {
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
- }, Y = (e) => {
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
- }, Z = (e) => {
142
- const t = e ? typeof e.enabled == "boolean" ? e.enabled : !0 : !1, n = e ? !!e.drag : !1, o = e && e.mode ? e.mode : "multiple", a = !!(e && e.cell);
143
- return { enabled: t, drag: n, mode: o, cell: a };
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
- v as closestTagName,
147
- H as getColumnIndex,
148
- Y as getOffset,
154
+ A as closestTagName,
155
+ V as getColumnIndex,
156
+ $ as getOffset,
149
157
  k as getRowIndex,
150
- V as getSelectedState,
151
- J as getSelectedStateFromKeyDown,
152
- Z as getSelectionOptions,
153
- Q as relativeContextElement,
154
- z as setSelectedState
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
  };