@progress/kendo-react-data-tools 7.5.0-develop.9 → 8.0.0-develop.1
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/index.d.mts +23 -3
- package/index.d.ts +23 -3
- package/navigation/TableKeyboardNavigation.js +1 -1
- package/navigation/TableKeyboardNavigation.mjs +121 -91
- package/navigation/utils.js +1 -1
- package/navigation/utils.mjs +101 -75
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/selection/TableSelection.js +1 -1
- package/selection/TableSelection.mjs +79 -69
- package/selection/utils.js +1 -1
- package/selection/utils.mjs +85 -84
|
@@ -7,116 +7,126 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import * as
|
|
11
|
-
import { useDocument as
|
|
12
|
-
import { getSelectionOptions as
|
|
13
|
-
const
|
|
14
|
-
var
|
|
15
|
-
const { onRelease:
|
|
16
|
-
enabled:
|
|
10
|
+
import * as W from "react-dom";
|
|
11
|
+
import { useDocument as Z, Draggable as _ } from "@progress/kendo-react-common";
|
|
12
|
+
import { getSelectionOptions as $, isInNonSelectable as ee, relativeContextElement as te, getOffset as ne, closestTagName as c, getColumnIndex as x, getRowIndex as K } from "./utils.mjs";
|
|
13
|
+
const ce = (u) => {
|
|
14
|
+
var w;
|
|
15
|
+
const { onRelease: D, childRef: I } = u, {
|
|
16
|
+
enabled: q,
|
|
17
17
|
drag: M,
|
|
18
|
-
mode:
|
|
19
|
-
cell:
|
|
20
|
-
} =
|
|
21
|
-
(
|
|
22
|
-
const { event: e } =
|
|
23
|
-
|
|
18
|
+
mode: o,
|
|
19
|
+
cell: X
|
|
20
|
+
} = $(u.selectable), r = t.useRef(null), Y = t.useRef(null), d = t.useRef({ clientX: 0, clientY: 0, scrollX: 0, scrollY: 0, pressedElement: null }), [T, f] = t.useState(null), C = t.useRef(), g = t.useRef(!1), y = t.useRef(!1), j = t.useCallback(
|
|
21
|
+
(s) => {
|
|
22
|
+
const { event: e } = s;
|
|
23
|
+
if (y.current = ee(e.originalEvent.target), y.current || !r.current)
|
|
24
|
+
return;
|
|
25
|
+
C.current = te(r.current.element);
|
|
26
|
+
const n = r.current.element && r.current.element.ownerDocument;
|
|
27
|
+
if (!n)
|
|
28
|
+
return;
|
|
29
|
+
const l = n.elementFromPoint(e.clientX, e.clientY);
|
|
30
|
+
d.current = {
|
|
24
31
|
clientY: e.clientY,
|
|
25
|
-
clientX: e.clientX
|
|
26
|
-
|
|
32
|
+
clientX: e.clientX,
|
|
33
|
+
scrollX: e.scrollX,
|
|
34
|
+
scrollY: e.scrollY,
|
|
35
|
+
pressedElement: l
|
|
36
|
+
};
|
|
27
37
|
},
|
|
28
38
|
[]
|
|
29
|
-
),
|
|
30
|
-
(
|
|
31
|
-
const { event: e } =
|
|
32
|
-
if (!
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
top: Math.min(l, e.clientY) -
|
|
36
|
-
left: Math.min(n, e.clientX) -
|
|
39
|
+
), z = t.useCallback(
|
|
40
|
+
(s) => {
|
|
41
|
+
const { event: e } = s, { clientX: n, clientY: l } = d.current;
|
|
42
|
+
if (!y.current && !(!M || o === "single") && ((Math.abs(l - e.clientY) > 5 || Math.abs(n - e.clientX) > 5) && (g.current = !0), g.current)) {
|
|
43
|
+
const E = ne(C.current);
|
|
44
|
+
f({
|
|
45
|
+
top: Math.min(l, e.clientY) - E.top,
|
|
46
|
+
left: Math.min(n, e.clientX) - E.left,
|
|
37
47
|
width: Math.abs(e.clientX - n),
|
|
38
48
|
height: Math.abs(e.clientY - l)
|
|
39
49
|
});
|
|
40
50
|
}
|
|
41
51
|
},
|
|
42
|
-
[
|
|
43
|
-
),
|
|
44
|
-
(
|
|
45
|
-
const { event: e } =
|
|
46
|
-
if (
|
|
52
|
+
[f, M, o]
|
|
53
|
+
), A = t.useCallback(
|
|
54
|
+
(s) => {
|
|
55
|
+
const { event: e } = s, { clientX: n, clientY: l, scrollX: E, scrollY: G, pressedElement: J } = d.current;
|
|
56
|
+
if (y.current || !r.current)
|
|
47
57
|
return;
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
if (
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
58
|
+
const R = r.current.element && r.current.element.ownerDocument;
|
|
59
|
+
if (R) {
|
|
60
|
+
if (g.current) {
|
|
61
|
+
const i = e.scrollY - G, v = e.scrollX - E, h = Math.min(l, e.clientY), a = Math.min(n, e.clientX), m = Math.max(l, e.clientY), L = Math.max(n, e.clientX), b = Y.current;
|
|
62
|
+
if (!b)
|
|
53
63
|
return;
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
64
|
+
b.style.visibility = "hidden";
|
|
65
|
+
const Q = R.elementFromPoint(a, h), P = i > 0 || v > 0 ? J : Q, p = R.elementFromPoint(L, m);
|
|
66
|
+
if (b.style.visibility = "", !P || !p)
|
|
57
67
|
return;
|
|
58
|
-
const
|
|
59
|
-
|
|
68
|
+
const S = c(P, "TD"), U = c(S, "TR"), k = c(p, "TD"), V = c(k, "TR"), F = x(S), O = K(U), H = x(k), N = K(V);
|
|
69
|
+
F !== void 0 && O !== void 0 && H !== void 0 && N !== void 0 && D({
|
|
60
70
|
nativeEvent: e.originalEvent,
|
|
61
|
-
startRowIndex:
|
|
62
|
-
startColIndex:
|
|
63
|
-
endRowIndex:
|
|
64
|
-
endColIndex:
|
|
71
|
+
startRowIndex: O,
|
|
72
|
+
startColIndex: F,
|
|
73
|
+
endRowIndex: N,
|
|
74
|
+
endColIndex: H,
|
|
65
75
|
altKey: e.altKey,
|
|
66
76
|
shiftKey: e.shiftKey,
|
|
67
77
|
ctrlKey: e.ctrlKey,
|
|
68
78
|
metaKey: e.metaKey,
|
|
69
|
-
mode:
|
|
70
|
-
cell:
|
|
79
|
+
mode: o,
|
|
80
|
+
cell: X,
|
|
71
81
|
isDrag: !0
|
|
72
82
|
});
|
|
73
83
|
} else {
|
|
74
|
-
const
|
|
75
|
-
if (!
|
|
84
|
+
const i = R.elementFromPoint(n, l);
|
|
85
|
+
if (!i)
|
|
76
86
|
return;
|
|
77
|
-
const v =
|
|
78
|
-
v && h &&
|
|
87
|
+
const v = c(i, "TD"), h = c(i, "TR"), a = x(v), m = K(h);
|
|
88
|
+
v && h && m !== void 0 && a !== void 0 && D({
|
|
79
89
|
nativeEvent: e.originalEvent,
|
|
80
|
-
startRowIndex:
|
|
81
|
-
startColIndex:
|
|
82
|
-
endRowIndex:
|
|
83
|
-
endColIndex:
|
|
90
|
+
startRowIndex: m,
|
|
91
|
+
startColIndex: a,
|
|
92
|
+
endRowIndex: m,
|
|
93
|
+
endColIndex: a,
|
|
84
94
|
altKey: e.altKey,
|
|
85
95
|
shiftKey: e.shiftKey,
|
|
86
96
|
ctrlKey: e.ctrlKey,
|
|
87
97
|
metaKey: e.metaKey,
|
|
88
|
-
mode:
|
|
89
|
-
cell:
|
|
98
|
+
mode: o,
|
|
99
|
+
cell: X,
|
|
90
100
|
isDrag: !1
|
|
91
101
|
});
|
|
92
102
|
}
|
|
93
|
-
|
|
103
|
+
f(null), g.current = !1, d.current = { clientX: 0, clientY: 0, scrollX: 0, scrollY: 0, pressedElement: null };
|
|
94
104
|
}
|
|
95
105
|
},
|
|
96
|
-
[
|
|
97
|
-
),
|
|
98
|
-
return
|
|
99
|
-
|
|
106
|
+
[f, o, X, D]
|
|
107
|
+
), B = Z(Y);
|
|
108
|
+
return q ? /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
109
|
+
_,
|
|
100
110
|
{
|
|
101
|
-
onPress:
|
|
102
|
-
onDrag:
|
|
103
|
-
onRelease:
|
|
104
|
-
ref:
|
|
111
|
+
onPress: j,
|
|
112
|
+
onDrag: z,
|
|
113
|
+
onRelease: A,
|
|
114
|
+
ref: r,
|
|
105
115
|
childRef: I
|
|
106
116
|
},
|
|
107
|
-
|
|
108
|
-
), T &&
|
|
117
|
+
u.children
|
|
118
|
+
), T && W.createPortal(
|
|
109
119
|
/* @__PURE__ */ t.createElement(
|
|
110
120
|
"div",
|
|
111
121
|
{
|
|
112
|
-
ref:
|
|
122
|
+
ref: Y,
|
|
113
123
|
style: { ...T, position: "fixed" },
|
|
114
124
|
className: "k-marquee k-marquee-color"
|
|
115
125
|
}
|
|
116
126
|
),
|
|
117
|
-
(
|
|
118
|
-
)) : t.cloneElement(t.Children.only(
|
|
127
|
+
(w = B()) == null ? void 0 : w.body
|
|
128
|
+
)) : t.cloneElement(t.Children.only(u.children), { ref: I });
|
|
119
129
|
};
|
|
120
130
|
export {
|
|
121
|
-
|
|
131
|
+
ce as TableSelection
|
|
122
132
|
};
|
package/selection/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
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@progress/kendo-react-common"),v=require("./constants.js"),M="items",y={},F=(e,t)=>!e||Array.isArray(e)&&e.length===0?[t]:e.findIndex(d=>d===t)>-1?e.filter(d=>d!==t):[...e,t],b=e=>{let t=e;for(;t;){if(t.hasAttribute(v.TABLE_PREVENT_SELECTION_ELEMENT))return!0;t=t.parentElement}return!1},R=(e,t)=>{let o=e;for(;o;){if(o.tagName===t)return o;if(o.tagName==="TABLE")return null;o=o.parentElement}return null},_=e=>{if(!e)return;const t=e.getAttribute(v.TABLE_ROW_INDEX_ATTRIBUTE);return t?parseInt(t,10):void 0},N=e=>{if(!e)return;const t=e.getAttribute(v.TABLE_COL_INDEX_ATTRIBUTE);return t?parseInt(t,10):void 0},G=e=>{const t=e.subItemsField||M,o=s.getter(e.dataItemKey);return s.mapTree(e.data,t,d=>s.extendDataItem(d,t,{[e.selectedField]:e.selectedState[o(d)]}))},U=e=>{const{event:t,dataItemKey:o,selectedState:d}=e,{syntheticEvent:c,nativeEvent:n,dataItems:f,componentId:i,mode:E,cell:x,selectedField:T}=t,{target:S,ctrlKey:w,metaKey:p,altKey:I,shiftKey:K}=n;if(c.isDefaultPrevented()&&!K||n.keyCode!==s.Keys.space&&n.keyCode!==s.Keys.enter&&n.keyCode!==s.Keys.right&&n.keyCode!==s.Keys.left&&n.keyCode!==s.Keys.up&&n.keyCode!==s.Keys.down)return d;c.preventDefault();const D=R(S,"TD"),m=R(S,"TR");let r=N(D),u=_(m),l={};return D&&m&&u!==void 0&&r!==void 0&&(n.keyCode===s.Keys.right&&r++,n.keyCode===s.Keys.left&&r--,n.keyCode===s.Keys.down&&u++,n.keyCode===s.Keys.up&&u--,l=L({selectedState:d,dataItemKey:o,event:{ctrlKey:w,metaKey:p,altKey:I,shiftKey:K,dataItems:f,cell:x,mode:E,selectedField:T,componentId:i,startColIndex:r,endColIndex:r,startRowIndex:u,endRowIndex:u,isDrag:!1,syntheticEvent:c,nativeEvent:n,target:t.target,dataItem:null}})),l},L=e=>{const{event:t,dataItemKey:o,selectedState:d}=e,{dataItems:c,startRowIndex:n,endRowIndex:f,startColIndex:i,endColIndex:E,cell:x,isDrag:T,ctrlKey:S,shiftKey:w,metaKey:p,componentId:I,mode:K,dataItem:D}=t,m=s.getter(o);let r={};const u=D!==null;if(K==="single"){const l=c.slice(n,n+1)[0],g=m(l);y[I]={rowIndex:n,colIndex:i},r[g]=x?[i]:!0}else if(T||!w&&!S&&!p&&!u){T||(y[I]={rowIndex:n,colIndex:i});const l=[];for(let a=i;a<=E;a++)l.push(a);c.slice(n,f+1).forEach(a=>{const h=m(a);r[h]=x?[...l]:!0})}else if(S||p||u){y[I]={rowIndex:n,colIndex:i};const g=c.slice(n,f+1)[0],a=m(g);r={...d},r[a]=x&&!u?F(r[a],i):!r[a]}else if(w){const l=y[I]&&y[I].rowIndex||0,g=y[I]&&y[I].colIndex||0,a=Math.min(l,n,f),h=Math.max(l,n,f),O=Math.min(g,i,E),k=Math.max(g,i,E),A=[];for(let C=O;C<=k;C++)A.push(C);c.slice(a,h+1).forEach(C=>{const B=m(C);r[B]=x?[...A]:!0})}return r},X=s.hasRelativeStackingContext(),q=e=>{if(!e||!X)return null;let t=e.parentElement;for(;t;){if(window.getComputedStyle(t).transform!=="none")return t;t=t.parentElement}},V=e=>{if(e&&e.ownerDocument&&e!==e.ownerDocument.body){const t=e.getBoundingClientRect();return{left:t.left-e.scrollLeft,top:t.top-e.scrollTop}}return{left:0,top:0}},j=e=>{const t=e?typeof e.enabled=="boolean"?e.enabled:!0:!1,o=e?!!e.drag:!1,d=e&&e.mode?e.mode:"multiple",c=!!(e&&e.cell);return{enabled:t,drag:o,mode:d,cell:c}};exports.closestTagName=R;exports.getColumnIndex=N;exports.getOffset=V;exports.getRowIndex=_;exports.getSelectedState=L;exports.getSelectedStateFromKeyDown=U;exports.getSelectionOptions=j;exports.isInNonSelectable=b;exports.relativeContextElement=q;exports.setSelectedState=G;
|
package/selection/utils.mjs
CHANGED
|
@@ -6,129 +6,130 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { getter as _, mapTree as
|
|
10
|
-
import { TABLE_PREVENT_SELECTION_ELEMENT as
|
|
11
|
-
const
|
|
9
|
+
import { getter as _, mapTree as k, extendDataItem as B, Keys as i, hasRelativeStackingContext as O } from "@progress/kendo-react-common";
|
|
10
|
+
import { TABLE_PREVENT_SELECTION_ELEMENT as M, TABLE_ROW_INDEX_ATTRIBUTE as F, 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((d) => d === t) > -1 ? e.filter((d) => d !== t) : [...e, t], J = (e) => {
|
|
12
12
|
let t = e;
|
|
13
13
|
for (; t; ) {
|
|
14
|
-
if (t.hasAttribute(
|
|
14
|
+
if (t.hasAttribute(M))
|
|
15
15
|
return !0;
|
|
16
16
|
t = t.parentElement;
|
|
17
17
|
}
|
|
18
18
|
return !1;
|
|
19
19
|
}, A = (e, t) => {
|
|
20
|
-
let
|
|
21
|
-
for (;
|
|
22
|
-
if (
|
|
23
|
-
return
|
|
24
|
-
if (
|
|
20
|
+
let o = e;
|
|
21
|
+
for (; o; ) {
|
|
22
|
+
if (o.tagName === t)
|
|
23
|
+
return o;
|
|
24
|
+
if (o.tagName === "TABLE")
|
|
25
25
|
return null;
|
|
26
|
-
|
|
26
|
+
o = o.parentElement;
|
|
27
27
|
}
|
|
28
28
|
return null;
|
|
29
|
-
},
|
|
29
|
+
}, b = (e) => {
|
|
30
30
|
if (!e)
|
|
31
31
|
return;
|
|
32
|
-
const t = e.getAttribute(
|
|
32
|
+
const t = e.getAttribute(F);
|
|
33
33
|
return t ? parseInt(t, 10) : void 0;
|
|
34
34
|
}, V = (e) => {
|
|
35
35
|
if (!e)
|
|
36
36
|
return;
|
|
37
|
-
const t = e.getAttribute(
|
|
37
|
+
const t = e.getAttribute(G);
|
|
38
38
|
return t ? parseInt(t, 10) : void 0;
|
|
39
39
|
}, Q = (e) => {
|
|
40
|
-
const t = e.subItemsField ||
|
|
41
|
-
return
|
|
40
|
+
const t = e.subItemsField || U, o = _(e.dataItemKey);
|
|
41
|
+
return k(
|
|
42
42
|
e.data,
|
|
43
43
|
t,
|
|
44
|
-
(
|
|
45
|
-
[e.selectedField]: e.selectedState[
|
|
44
|
+
(d) => B(d, t, {
|
|
45
|
+
[e.selectedField]: e.selectedState[o(d)]
|
|
46
46
|
})
|
|
47
47
|
);
|
|
48
48
|
}, Y = (e) => {
|
|
49
|
-
const { event: t, dataItemKey:
|
|
50
|
-
if (
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
const { event: t, dataItemKey: o, selectedState: d } = e, { syntheticEvent: a, nativeEvent: n, dataItems: E, componentId: c, mode: T, cell: g, selectedField: p } = t, { target: C, ctrlKey: w, metaKey: S, altKey: I, shiftKey: h } = n;
|
|
50
|
+
if (a.isDefaultPrevented() && !h || n.keyCode !== i.space && n.keyCode !== i.enter && n.keyCode !== i.right && n.keyCode !== i.left && n.keyCode !== i.up && n.keyCode !== i.down)
|
|
51
|
+
return d;
|
|
52
|
+
a.preventDefault();
|
|
53
|
+
const D = A(C, "TD"), m = A(C, "TR");
|
|
54
|
+
let r = V(D), u = b(m), s = {};
|
|
55
|
+
return D && m && u !== void 0 && r !== void 0 && (n.keyCode === i.right && r++, n.keyCode === i.left && r--, n.keyCode === i.down && u++, n.keyCode === i.up && u--, s = H({
|
|
56
|
+
selectedState: d,
|
|
57
|
+
dataItemKey: o,
|
|
57
58
|
event: {
|
|
58
|
-
ctrlKey:
|
|
59
|
-
metaKey:
|
|
59
|
+
ctrlKey: w,
|
|
60
|
+
metaKey: S,
|
|
60
61
|
altKey: I,
|
|
61
|
-
shiftKey:
|
|
62
|
+
shiftKey: h,
|
|
62
63
|
dataItems: E,
|
|
63
|
-
cell:
|
|
64
|
+
cell: g,
|
|
64
65
|
mode: T,
|
|
65
|
-
selectedField:
|
|
66
|
-
componentId:
|
|
67
|
-
startColIndex:
|
|
68
|
-
endColIndex:
|
|
69
|
-
startRowIndex:
|
|
70
|
-
endRowIndex:
|
|
66
|
+
selectedField: p,
|
|
67
|
+
componentId: c,
|
|
68
|
+
startColIndex: r,
|
|
69
|
+
endColIndex: r,
|
|
70
|
+
startRowIndex: u,
|
|
71
|
+
endRowIndex: u,
|
|
71
72
|
isDrag: !1,
|
|
72
|
-
syntheticEvent:
|
|
73
|
-
nativeEvent:
|
|
73
|
+
syntheticEvent: a,
|
|
74
|
+
nativeEvent: n,
|
|
74
75
|
target: t.target,
|
|
75
76
|
dataItem: null
|
|
76
77
|
}
|
|
77
|
-
})),
|
|
78
|
+
})), s;
|
|
78
79
|
}, H = (e) => {
|
|
79
|
-
const { event: t, dataItemKey:
|
|
80
|
-
dataItems:
|
|
81
|
-
startRowIndex:
|
|
80
|
+
const { event: t, dataItemKey: o, selectedState: d } = e, {
|
|
81
|
+
dataItems: a,
|
|
82
|
+
startRowIndex: n,
|
|
82
83
|
endRowIndex: E,
|
|
83
|
-
startColIndex:
|
|
84
|
+
startColIndex: c,
|
|
84
85
|
endColIndex: T,
|
|
85
|
-
cell:
|
|
86
|
-
isDrag:
|
|
87
|
-
ctrlKey:
|
|
88
|
-
shiftKey:
|
|
89
|
-
metaKey:
|
|
86
|
+
cell: g,
|
|
87
|
+
isDrag: p,
|
|
88
|
+
ctrlKey: C,
|
|
89
|
+
shiftKey: w,
|
|
90
|
+
metaKey: S,
|
|
90
91
|
componentId: I,
|
|
91
|
-
mode:
|
|
92
|
-
dataItem:
|
|
93
|
-
} = t,
|
|
94
|
-
let
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
92
|
+
mode: h,
|
|
93
|
+
dataItem: D
|
|
94
|
+
} = t, m = _(o);
|
|
95
|
+
let r = {};
|
|
96
|
+
const u = D !== null;
|
|
97
|
+
if (h === "single") {
|
|
98
|
+
const s = a.slice(n, n + 1)[0], f = m(s);
|
|
98
99
|
x[I] = {
|
|
99
|
-
rowIndex:
|
|
100
|
-
colIndex:
|
|
101
|
-
},
|
|
102
|
-
} else if (
|
|
103
|
-
|
|
104
|
-
rowIndex:
|
|
105
|
-
colIndex:
|
|
100
|
+
rowIndex: n,
|
|
101
|
+
colIndex: c
|
|
102
|
+
}, r[f] = g ? [c] : !0;
|
|
103
|
+
} else if (p || !w && !C && !S && !u) {
|
|
104
|
+
p || (x[I] = {
|
|
105
|
+
rowIndex: n,
|
|
106
|
+
colIndex: c
|
|
106
107
|
});
|
|
107
|
-
const
|
|
108
|
-
for (let l =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
108
|
+
const s = [];
|
|
109
|
+
for (let l = c; l <= T; l++)
|
|
110
|
+
s.push(l);
|
|
111
|
+
a.slice(n, E + 1).forEach((l) => {
|
|
112
|
+
const R = m(l);
|
|
113
|
+
r[R] = g ? [...s] : !0;
|
|
113
114
|
});
|
|
114
|
-
} else if (
|
|
115
|
+
} else if (C || S || u) {
|
|
115
116
|
x[I] = {
|
|
116
|
-
rowIndex:
|
|
117
|
-
colIndex:
|
|
117
|
+
rowIndex: n,
|
|
118
|
+
colIndex: c
|
|
118
119
|
};
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
} else if (
|
|
122
|
-
const
|
|
123
|
-
for (let
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
120
|
+
const f = a.slice(n, E + 1)[0], l = m(f);
|
|
121
|
+
r = { ...d }, r[l] = g && !u ? X(r[l], c) : !r[l];
|
|
122
|
+
} else if (w) {
|
|
123
|
+
const s = x[I] && x[I].rowIndex || 0, f = x[I] && x[I].colIndex || 0, l = Math.min(s, n, E), R = Math.max(s, n, E), K = Math.min(f, c, T), L = Math.max(f, c, T), v = [];
|
|
124
|
+
for (let y = K; y <= L; y++)
|
|
125
|
+
v.push(y);
|
|
126
|
+
a.slice(l, R + 1).forEach((y) => {
|
|
127
|
+
const N = m(y);
|
|
128
|
+
r[N] = g ? [...v] : !0;
|
|
128
129
|
});
|
|
129
130
|
}
|
|
130
|
-
return
|
|
131
|
-
}, W =
|
|
131
|
+
return r;
|
|
132
|
+
}, W = O(), Z = (e) => {
|
|
132
133
|
if (!e || !W)
|
|
133
134
|
return null;
|
|
134
135
|
let t = e.parentElement;
|
|
@@ -147,14 +148,14 @@ const X = "items", x = {}, b = (e, t) => !e || Array.isArray(e) && e.length ===
|
|
|
147
148
|
}
|
|
148
149
|
return { left: 0, top: 0 };
|
|
149
150
|
}, P = (e) => {
|
|
150
|
-
const t = e ? typeof e.enabled == "boolean" ? e.enabled : !0 : !1,
|
|
151
|
-
return { enabled: t, drag:
|
|
151
|
+
const t = e ? typeof e.enabled == "boolean" ? e.enabled : !0 : !1, o = e ? !!e.drag : !1, d = e && e.mode ? e.mode : "multiple", a = !!(e && e.cell);
|
|
152
|
+
return { enabled: t, drag: o, mode: d, cell: a };
|
|
152
153
|
};
|
|
153
154
|
export {
|
|
154
155
|
A as closestTagName,
|
|
155
156
|
V as getColumnIndex,
|
|
156
157
|
$ as getOffset,
|
|
157
|
-
|
|
158
|
+
b as getRowIndex,
|
|
158
159
|
H as getSelectedState,
|
|
159
160
|
Y as getSelectedStateFromKeyDown,
|
|
160
161
|
P as getSelectionOptions,
|