@progress/kendo-react-data-tools 7.3.0 → 7.4.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/dist/cdn/js/kendo-react-datatools.js +1 -1
- package/filter/filters/NumericFilter.js +1 -1
- package/filter/filters/NumericFilter.mjs +19 -21
- package/header/HeaderThElement.js +1 -1
- package/header/HeaderThElement.mjs +21 -26
- package/index.d.mts +27 -21
- package/index.d.ts +27 -21
- package/index.js +1 -1
- package/index.mjs +90 -89
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
- package/pager/Pager.js +1 -1
- package/pager/Pager.mjs +157 -131
- package/pager/PagerInput.js +1 -1
- package/pager/PagerInput.mjs +5 -4
- package/pager/PagerNumericButtons.js +1 -1
- package/pager/PagerNumericButtons.mjs +37 -35
- package/pager/PagerPageSizes.js +1 -1
- package/pager/PagerPageSizes.mjs +12 -11
- package/selection/TableSelection.js +1 -1
- package/selection/TableSelection.mjs +48 -49
- package/selection/utils.js +1 -1
- package/selection/utils.mjs +86 -77
|
@@ -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 B=require("react"),G=require("react-dom"),p=require("@progress/kendo-react-common"),t=require("./utils.js");function q(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const r in l)if(r!=="default"){const y=Object.getOwnPropertyDescriptor(l,r);Object.defineProperty(c,r,y.get?y:{enumerable:!0,get:()=>l[r]})}}return c.default=l,Object.freeze(c)}const n=q(B),J=q(G),L=l=>{var C;const{onRelease:c,childRef:r}=l,{enabled:y,drag:I,mode:d,cell:T}=t.getSelectionOptions(l.selectable),u=n.useRef(null),D=n.useRef(null),R=n.useRef({clientX:0,clientY:0}),[K,b]=n.useState(null),M=n.useRef(),v=n.useRef(!1),h=n.useRef(!1),j=n.useCallback(m=>{const{event:e}=m;h.current=t.isInNonSelectable(e.originalEvent.target),!(h.current||!u.current)&&(M.current=t.relativeContextElement(u.current.element),R.current={clientY:e.clientY,clientX:e.clientX})},[]),_=n.useCallback(m=>{const{event:e}=m,{clientX:o,clientY:s}=R.current;if(!h.current&&!(!I||d==="single")&&((Math.abs(s-e.clientY)>5||Math.abs(o-e.clientX)>5)&&(v.current=!0),v.current)){const a=t.getOffset(M.current);b({top:Math.min(s,e.clientY)-a.top,left:Math.min(o,e.clientX)-a.left,width:Math.abs(e.clientX-o),height:Math.abs(e.clientY-s)})}},[b,I,d]),F=n.useCallback(m=>{const{event:e}=m,{clientX:o,clientY:s}=R.current;if(h.current||!u.current)return;const a=u.current.element&&u.current.element.ownerDocument;if(a){if(v.current){const f=Math.min(s,e.clientY),E=Math.min(o,e.clientX),x=Math.max(s,e.clientY),g=Math.max(o,e.clientX),i=D.current;if(!i)return;i.style.visibility="hidden";const S=a.elementFromPoint(E,f),w=a.elementFromPoint(g,x);if(i.style.visibility="",!S||!w)return;const O=t.closestTagName(S,"TD"),z=t.closestTagName(O,"TR"),P=t.closestTagName(w,"TD"),A=t.closestTagName(P,"TR"),X=t.getColumnIndex(O),Y=t.getRowIndex(z),N=t.getColumnIndex(P),k=t.getRowIndex(A);X!==void 0&&Y!==void 0&&N!==void 0&&k!==void 0&&c({nativeEvent:e.originalEvent,startRowIndex:Y,startColIndex:X,endRowIndex:k,endColIndex:N,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,mode:d,cell:T,isDrag:!0})}else{const f=a.elementFromPoint(o,s);if(!f)return;const E=t.closestTagName(f,"TD"),x=t.closestTagName(f,"TR"),g=t.getColumnIndex(E),i=t.getRowIndex(x);E&&x&&i!==void 0&&g!==void 0&&c({nativeEvent:e.originalEvent,startRowIndex:i,startColIndex:g,endRowIndex:i,endColIndex:g,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,mode:d,cell:T,isDrag:!1})}b(null),v.current=!1,R.current={clientX:0,clientY:0}}},[b,d,T,c]),H=p.useDocument(D);return y?n.createElement(n.Fragment,null,n.createElement(p.Draggable,{onPress:j,onDrag:_,onRelease:F,ref:u,childRef:r},l.children),K&&J.createPortal(n.createElement("div",{ref:D,style:{...K,position:"fixed"},className:"k-marquee k-marquee-color"}),(C=H())==null?void 0:C.body)):n.cloneElement(n.Children.only(l.children),{ref:r})};exports.TableSelection=L;
|
|
@@ -7,62 +7,61 @@
|
|
|
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
|
-
|
|
14
|
-
const ee = (f) => {
|
|
10
|
+
import * as G from "react-dom";
|
|
11
|
+
import { useDocument as J, Draggable as L } from "@progress/kendo-react-common";
|
|
12
|
+
import { getSelectionOptions as Q, isInNonSelectable as U, relativeContextElement as V, getOffset as W, closestTagName as s, getColumnIndex as K, getRowIndex as D } from "./utils.mjs";
|
|
13
|
+
const $ = (d) => {
|
|
15
14
|
var X;
|
|
16
|
-
const { onRelease:
|
|
17
|
-
enabled:
|
|
18
|
-
drag:
|
|
15
|
+
const { onRelease: E, childRef: I } = d, {
|
|
16
|
+
enabled: H,
|
|
17
|
+
drag: M,
|
|
19
18
|
mode: i,
|
|
20
19
|
cell: b
|
|
21
|
-
} =
|
|
20
|
+
} = Q(d.selectable), o = t.useRef(null), x = t.useRef(null), f = t.useRef({ clientX: 0, clientY: 0 }), [T, g] = t.useState(null), C = t.useRef(), y = t.useRef(!1), R = t.useRef(!1), N = t.useCallback(
|
|
22
21
|
(a) => {
|
|
23
22
|
const { event: e } = a;
|
|
24
|
-
|
|
23
|
+
R.current = U(e.originalEvent.target), !(R.current || !o.current) && (C.current = V(o.current.element), f.current = {
|
|
25
24
|
clientY: e.clientY,
|
|
26
25
|
clientX: e.clientX
|
|
27
26
|
});
|
|
28
27
|
},
|
|
29
28
|
[]
|
|
30
|
-
),
|
|
29
|
+
), q = t.useCallback(
|
|
31
30
|
(a) => {
|
|
32
|
-
const { event: e } = a, { clientX: n, clientY:
|
|
33
|
-
if (!
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
top: Math.min(
|
|
37
|
-
left: Math.min(n, e.clientX) -
|
|
31
|
+
const { event: e } = a, { clientX: n, clientY: l } = f.current;
|
|
32
|
+
if (!R.current && !(!M || i === "single") && ((Math.abs(l - e.clientY) > 5 || Math.abs(n - e.clientX) > 5) && (y.current = !0), y.current)) {
|
|
33
|
+
const r = W(C.current);
|
|
34
|
+
g({
|
|
35
|
+
top: Math.min(l, e.clientY) - r.top,
|
|
36
|
+
left: Math.min(n, e.clientX) - r.left,
|
|
38
37
|
width: Math.abs(e.clientX - n),
|
|
39
|
-
height: Math.abs(e.clientY -
|
|
38
|
+
height: Math.abs(e.clientY - l)
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
41
|
},
|
|
43
|
-
[
|
|
44
|
-
),
|
|
42
|
+
[g, M, i]
|
|
43
|
+
), j = t.useCallback(
|
|
45
44
|
(a) => {
|
|
46
|
-
const { event: e } = a, { clientX: n, clientY:
|
|
47
|
-
if (
|
|
45
|
+
const { event: e } = a, { clientX: n, clientY: l } = f.current;
|
|
46
|
+
if (R.current || !o.current)
|
|
48
47
|
return;
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
if (
|
|
52
|
-
const m = Math.min(
|
|
48
|
+
const r = o.current.element && o.current.element.ownerDocument;
|
|
49
|
+
if (r) {
|
|
50
|
+
if (y.current) {
|
|
51
|
+
const m = Math.min(l, e.clientY), v = Math.min(n, e.clientX), h = Math.max(l, e.clientY), u = Math.max(n, e.clientX), c = x.current;
|
|
53
52
|
if (!c)
|
|
54
53
|
return;
|
|
55
54
|
c.style.visibility = "hidden";
|
|
56
|
-
const Y =
|
|
57
|
-
if (c.style.visibility = "", !Y || !
|
|
55
|
+
const Y = r.elementFromPoint(v, m), w = r.elementFromPoint(u, h);
|
|
56
|
+
if (c.style.visibility = "", !Y || !w)
|
|
58
57
|
return;
|
|
59
|
-
const
|
|
60
|
-
k !== void 0 && p !== void 0 &&
|
|
58
|
+
const P = s(Y, "TD"), A = s(P, "TR"), S = s(w, "TD"), B = s(S, "TR"), k = K(P), p = D(A), F = K(S), O = D(B);
|
|
59
|
+
k !== void 0 && p !== void 0 && F !== void 0 && O !== void 0 && E({
|
|
61
60
|
nativeEvent: e.originalEvent,
|
|
62
61
|
startRowIndex: p,
|
|
63
62
|
startColIndex: k,
|
|
64
63
|
endRowIndex: O,
|
|
65
|
-
endColIndex:
|
|
64
|
+
endColIndex: F,
|
|
66
65
|
altKey: e.altKey,
|
|
67
66
|
shiftKey: e.shiftKey,
|
|
68
67
|
ctrlKey: e.ctrlKey,
|
|
@@ -72,11 +71,11 @@ const ee = (f) => {
|
|
|
72
71
|
isDrag: !0
|
|
73
72
|
});
|
|
74
73
|
} else {
|
|
75
|
-
const m =
|
|
74
|
+
const m = r.elementFromPoint(n, l);
|
|
76
75
|
if (!m)
|
|
77
76
|
return;
|
|
78
|
-
const
|
|
79
|
-
|
|
77
|
+
const v = s(m, "TD"), h = s(m, "TR"), u = K(v), c = D(h);
|
|
78
|
+
v && h && c !== void 0 && u !== void 0 && E({
|
|
80
79
|
nativeEvent: e.originalEvent,
|
|
81
80
|
startRowIndex: c,
|
|
82
81
|
startColIndex: u,
|
|
@@ -91,33 +90,33 @@ const ee = (f) => {
|
|
|
91
90
|
isDrag: !1
|
|
92
91
|
});
|
|
93
92
|
}
|
|
94
|
-
|
|
93
|
+
g(null), y.current = !1, f.current = { clientX: 0, clientY: 0 };
|
|
95
94
|
}
|
|
96
95
|
},
|
|
97
|
-
[
|
|
98
|
-
),
|
|
99
|
-
return
|
|
100
|
-
|
|
96
|
+
[g, i, b, E]
|
|
97
|
+
), z = J(x);
|
|
98
|
+
return H ? /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
99
|
+
L,
|
|
101
100
|
{
|
|
102
|
-
onPress:
|
|
103
|
-
onDrag:
|
|
104
|
-
onRelease:
|
|
101
|
+
onPress: N,
|
|
102
|
+
onDrag: q,
|
|
103
|
+
onRelease: j,
|
|
105
104
|
ref: o,
|
|
106
|
-
childRef:
|
|
105
|
+
childRef: I
|
|
107
106
|
},
|
|
108
|
-
|
|
109
|
-
),
|
|
107
|
+
d.children
|
|
108
|
+
), T && G.createPortal(
|
|
110
109
|
/* @__PURE__ */ t.createElement(
|
|
111
110
|
"div",
|
|
112
111
|
{
|
|
113
112
|
ref: x,
|
|
114
|
-
style: { ...
|
|
113
|
+
style: { ...T, position: "fixed" },
|
|
115
114
|
className: "k-marquee k-marquee-color"
|
|
116
115
|
}
|
|
117
116
|
),
|
|
118
|
-
(X =
|
|
119
|
-
)) : t.cloneElement(t.Children.only(
|
|
117
|
+
(X = z()) == null ? void 0 : X.body
|
|
118
|
+
)) : t.cloneElement(t.Children.only(d.children), { ref: I });
|
|
120
119
|
};
|
|
121
120
|
export {
|
|
122
|
-
|
|
121
|
+
$ as TableSelection
|
|
123
122
|
};
|
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 S=require("@progress/kendo-react-common"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("@progress/kendo-react-common"),A=require("./constants.js"),F="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],G=e=>{let t=e;for(;t;){if(t.hasAttribute(A.TABLE_PREVENT_SELECTION_ELEMENT))return!0;t=t.parentElement}return!1},v=(e,t)=>{let n=e;for(;n;){if(n.tagName===t)return n;if(n.tagName==="TABLE")return null;n=n.parentElement}return null},N=e=>{if(!e)return;const t=e.getAttribute(A.TABLE_ROW_INDEX_ATTRIBUTE);return t?parseInt(t,10):void 0},K=e=>{if(!e)return;const t=e.getAttribute(A.TABLE_COL_INDEX_ATTRIBUTE);return t?parseInt(t,10):void 0},U=e=>{const t=e.subItemsField||F,n=S.getter(e.dataItemKey);return S.mapTree(e.data,t,o=>S.extendDataItem(o,t,{[e.selectedField]:e.selectedState[n(o)]}))},k=e=>{const{event:t,dataItemKey:n,selectedState:o}=e,{syntheticEvent:a,nativeEvent:s,dataItems:g,componentId:c,mode:f,cell:E,selectedField:C}=t,{target:T,ctrlKey:y,metaKey:p,altKey:i,shiftKey:R}=s;if(a.isDefaultPrevented()||s.keyCode!==S.Keys.enter)return o;const D=v(T,"TD"),I=v(T,"TR"),r=K(D),u=N(I);let d={};return D&&I&&u!==void 0&&r!==void 0&&(d=L({selectedState:o,dataItemKey:n,event:{ctrlKey:y,metaKey:p,altKey:i,shiftKey:R,dataItems:g,cell:E,mode:f,selectedField:C,componentId:c,startColIndex:r,endColIndex:r,startRowIndex:u,endRowIndex:u,isDrag:!1,syntheticEvent:a,nativeEvent:s,target:t.target,dataItem:null}})),d},L=e=>{const{event:t,dataItemKey:n,selectedState:o}=e,{dataItems:a,startRowIndex:s,endRowIndex:g,startColIndex:c,endColIndex:f,cell:E,isDrag:C,ctrlKey:T,shiftKey:y,metaKey:p,componentId:i,mode:R,dataItem:D}=t,I=S.getter(n);let r={};const u=D!==null;if(R==="single"){const d=a.slice(s,s+1)[0],m=I(d);x[i]={rowIndex:s,colIndex:c},r[m]=E?[c]:!0}else if(C||!y&&!T&&!p&&!u){C||(x[i]={rowIndex:s,colIndex:c});const d=[];for(let l=c;l<=f;l++)d.push(l);a.slice(s,g+1).forEach(l=>{const h=I(l);r[h]=E?[...d]:!0})}else if(T||p||u){x[i]={rowIndex:s,colIndex:c};const m=a.slice(s,g+1)[0],l=I(m);r={...o},r[l]=E&&!u?b(r[l],c):!r[l]}else if(y){const d=x[i]&&x[i].rowIndex||0,m=x[i]&&x[i].colIndex||0,l=Math.min(d,s,g),h=Math.max(d,s,g),O=Math.min(m,c,f),B=Math.max(m,c,f),_=[];for(let w=O;w<=B;w++)_.push(w);a.slice(l,h+1).forEach(w=>{const M=I(w);r[M]=E?[..._]:!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,n=e?!!e.drag:!1,o=e&&e.mode?e.mode:"multiple",a=!!(e&&e.cell);return{enabled:t,drag:n,mode:o,cell:a}};exports.closestTagName=v;exports.getColumnIndex=K;exports.getOffset=V;exports.getRowIndex=N;exports.getSelectedState=L;exports.getSelectedStateFromKeyDown=k;exports.getSelectionOptions=j;exports.isInNonSelectable=G;exports.relativeContextElement=q;exports.setSelectedState=U;
|
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
|
};
|