@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.
@@ -7,116 +7,126 @@
7
7
  */
8
8
  "use client";
9
9
  import * as t from "react";
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) => {
14
- var X;
15
- const { onRelease: E, childRef: I } = d, {
16
- enabled: H,
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: i,
19
- cell: b
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(
21
- (a) => {
22
- const { event: e } = a;
23
- R.current = U(e.originalEvent.target), !(R.current || !o.current) && (C.current = V(o.current.element), f.current = {
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
- ), q = t.useCallback(
30
- (a) => {
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,
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
- [g, M, i]
43
- ), j = t.useCallback(
44
- (a) => {
45
- const { event: e } = a, { clientX: n, clientY: l } = f.current;
46
- if (R.current || !o.current)
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 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;
52
- if (!c)
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
- c.style.visibility = "hidden";
55
- const Y = r.elementFromPoint(v, m), w = r.elementFromPoint(u, h);
56
- if (c.style.visibility = "", !Y || !w)
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 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({
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: p,
62
- startColIndex: k,
63
- endRowIndex: O,
64
- endColIndex: F,
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: i,
70
- cell: b,
79
+ mode: o,
80
+ cell: X,
71
81
  isDrag: !0
72
82
  });
73
83
  } else {
74
- const m = r.elementFromPoint(n, l);
75
- if (!m)
84
+ const i = R.elementFromPoint(n, l);
85
+ if (!i)
76
86
  return;
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({
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: c,
81
- startColIndex: u,
82
- endRowIndex: c,
83
- endColIndex: u,
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: i,
89
- cell: b,
98
+ mode: o,
99
+ cell: X,
90
100
  isDrag: !1
91
101
  });
92
102
  }
93
- g(null), y.current = !1, f.current = { clientX: 0, clientY: 0 };
103
+ f(null), g.current = !1, d.current = { clientX: 0, clientY: 0, scrollX: 0, scrollY: 0, pressedElement: null };
94
104
  }
95
105
  },
96
- [g, i, b, E]
97
- ), z = J(x);
98
- return H ? /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
99
- L,
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: N,
102
- onDrag: q,
103
- onRelease: j,
104
- ref: o,
111
+ onPress: j,
112
+ onDrag: z,
113
+ onRelease: A,
114
+ ref: r,
105
115
  childRef: I
106
116
  },
107
- d.children
108
- ), T && G.createPortal(
117
+ u.children
118
+ ), T && W.createPortal(
109
119
  /* @__PURE__ */ t.createElement(
110
120
  "div",
111
121
  {
112
- ref: x,
122
+ ref: Y,
113
123
  style: { ...T, position: "fixed" },
114
124
  className: "k-marquee k-marquee-color"
115
125
  }
116
126
  ),
117
- (X = z()) == null ? void 0 : X.body
118
- )) : t.cloneElement(t.Children.only(d.children), { ref: I });
127
+ (w = B()) == null ? void 0 : w.body
128
+ )) : t.cloneElement(t.Children.only(u.children), { ref: I });
119
129
  };
120
130
  export {
121
- $ as TableSelection
131
+ ce as TableSelection
122
132
  };
@@ -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"),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;
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;
@@ -6,129 +6,130 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
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) => {
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(F))
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 n = e;
21
- for (; n; ) {
22
- if (n.tagName === t)
23
- return n;
24
- if (n.tagName === "TABLE")
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
- n = n.parentElement;
26
+ o = o.parentElement;
27
27
  }
28
28
  return null;
29
- }, k = (e) => {
29
+ }, b = (e) => {
30
30
  if (!e)
31
31
  return;
32
- const t = e.getAttribute(G);
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(U);
37
+ const t = e.getAttribute(G);
38
38
  return t ? parseInt(t, 10) : void 0;
39
39
  }, Q = (e) => {
40
- const t = e.subItemsField || X, n = _(e.dataItemKey);
41
- return N(
40
+ const t = e.subItemsField || U, o = _(e.dataItemKey);
41
+ return k(
42
42
  e.data,
43
43
  t,
44
- (o) => B(o, t, {
45
- [e.selectedField]: e.selectedState[n(o)]
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: 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)
51
- return o;
52
- const y = A(g, "TD"), i = A(g, "TR"), s = V(y), m = k(i);
53
- let d = {};
54
- return y && i && m !== void 0 && s !== void 0 && (d = H({
55
- selectedState: o,
56
- dataItemKey: n,
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: p,
59
- metaKey: C,
59
+ ctrlKey: w,
60
+ metaKey: S,
60
61
  altKey: I,
61
- shiftKey: D,
62
+ shiftKey: h,
62
63
  dataItems: E,
63
- cell: f,
64
+ cell: g,
64
65
  mode: T,
65
- selectedField: w,
66
- componentId: a,
67
- startColIndex: s,
68
- endColIndex: s,
69
- startRowIndex: m,
70
- endRowIndex: m,
66
+ selectedField: p,
67
+ componentId: c,
68
+ startColIndex: r,
69
+ endColIndex: r,
70
+ startRowIndex: u,
71
+ endRowIndex: u,
71
72
  isDrag: !1,
72
- syntheticEvent: c,
73
- nativeEvent: r,
73
+ syntheticEvent: a,
74
+ nativeEvent: n,
74
75
  target: t.target,
75
76
  dataItem: null
76
77
  }
77
- })), d;
78
+ })), s;
78
79
  }, H = (e) => {
79
- const { event: t, dataItemKey: n, selectedState: o } = e, {
80
- dataItems: c,
81
- startRowIndex: r,
80
+ const { event: t, dataItemKey: o, selectedState: d } = e, {
81
+ dataItems: a,
82
+ startRowIndex: n,
82
83
  endRowIndex: E,
83
- startColIndex: a,
84
+ startColIndex: c,
84
85
  endColIndex: T,
85
- cell: f,
86
- isDrag: w,
87
- ctrlKey: g,
88
- shiftKey: p,
89
- metaKey: C,
86
+ cell: g,
87
+ isDrag: p,
88
+ ctrlKey: C,
89
+ shiftKey: w,
90
+ metaKey: S,
90
91
  componentId: I,
91
- mode: D,
92
- dataItem: y
93
- } = t, i = _(n);
94
- let s = {};
95
- const m = y !== null;
96
- if (D === "single") {
97
- const d = c.slice(r, r + 1)[0], u = i(d);
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: 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
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 d = [];
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;
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 (g || C || m) {
115
+ } else if (C || S || u) {
115
116
  x[I] = {
116
- rowIndex: r,
117
- colIndex: a
117
+ rowIndex: n,
118
+ colIndex: c
118
119
  };
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];
121
- } else if (p) {
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
+ 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 s;
131
- }, W = M(), Z = (e) => {
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, 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 };
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
- k as getRowIndex,
158
+ b as getRowIndex,
158
159
  H as getSelectedState,
159
160
  Y as getSelectedStateFromKeyDown,
160
161
  P as getSelectionOptions,