@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.
@@ -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 z=require("react"),B=require("react-dom"),k=require("@progress/kendo-react-common"),n=require("./utils.js"),V=require("./constants.js");function p(l){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const c in l)if(c!=="default"){const y=Object.getOwnPropertyDescriptor(l,c);Object.defineProperty(r,c,y.get?y:{enumerable:!0,get:()=>l[c]})}}return r.default=l,Object.freeze(r)}const t=p(z),G=p(B),J=l=>{var C;const{onRelease:r,childRef:c}=l,{enabled:y,drag:I,mode:d,cell:x}=n.getSelectionOptions(l.selectable),u=t.useRef(null),D=t.useRef(null),R=t.useRef({clientX:0,clientY:0}),[K,E]=t.useState(null),M=t.useRef(),b=t.useRef(!1),v=t.useRef(!1),q=t.useCallback(m=>{const{event:e}=m;v.current=e.originalEvent.target.hasAttribute(V.TABLE_PREVENT_SELECTION_ELEMENT),!(v.current||!u.current)&&(M.current=n.relativeContextElement(u.current.element),R.current={clientY:e.clientY,clientX:e.clientX})},[]),j=t.useCallback(m=>{const{event:e}=m,{clientX:o,clientY:s}=R.current;if(!v.current&&!(!I||d==="single")&&((Math.abs(s-e.clientY)>5||Math.abs(o-e.clientX)>5)&&(b.current=!0),b.current)){const a=n.getOffset(M.current);E({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)})}},[E,I,d]),F=t.useCallback(m=>{const{event:e}=m,{clientX:o,clientY:s}=R.current;if(v.current||!u.current)return;const a=u.current.element&&u.current.element.ownerDocument;if(a){if(b.current){const f=Math.min(s,e.clientY),h=Math.min(o,e.clientX),T=Math.max(s,e.clientY),g=Math.max(o,e.clientX),i=D.current;if(!i)return;i.style.visibility="hidden";const O=a.elementFromPoint(h,f),P=a.elementFromPoint(g,T);if(i.style.visibility="",!O||!P)return;const S=n.closestTagName(O,"TD"),L=n.closestTagName(S,"TR"),w=n.closestTagName(P,"TD"),A=n.closestTagName(w,"TR"),N=n.getColumnIndex(S),X=n.getRowIndex(L),Y=n.getColumnIndex(w),_=n.getRowIndex(A);N!==void 0&&X!==void 0&&Y!==void 0&&_!==void 0&&r({nativeEvent:e.originalEvent,startRowIndex:X,startColIndex:N,endRowIndex:_,endColIndex:Y,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,mode:d,cell:x,isDrag:!0})}else{const f=a.elementFromPoint(o,s);if(!f)return;const h=n.closestTagName(f,"TD"),T=n.closestTagName(f,"TR"),g=n.getColumnIndex(h),i=n.getRowIndex(T);h&&T&&i!==void 0&&g!==void 0&&r({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:x,isDrag:!1})}E(null),b.current=!1,R.current={clientX:0,clientY:0}}},[E,d,x,r]),H=k.useDocument(D);return y?t.createElement(t.Fragment,null,t.createElement(k.Draggable,{onPress:q,onDrag:j,onRelease:F,ref:u,childRef:c},l.children),K&&G.createPortal(t.createElement("div",{ref:D,style:{...K,position:"fixed"},className:"k-marquee k-marquee-color"}),(C=H())==null?void 0:C.body)):t.cloneElement(t.Children.only(l.children),{ref:c})};exports.TableSelection=J;
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 V from "react-dom";
11
- import { useDocument as j, Draggable as z } from "@progress/kendo-react-common";
12
- import { getSelectionOptions as G, relativeContextElement as J, getOffset as Q, closestTagName as s, getColumnIndex as K, getRowIndex as T } from "./utils.mjs";
13
- import { TABLE_PREVENT_SELECTION_ELEMENT as U } from "./constants.mjs";
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: h, childRef: D } = f, {
17
- enabled: F,
18
- drag: I,
15
+ const { onRelease: E, childRef: I } = d, {
16
+ enabled: H,
17
+ drag: M,
19
18
  mode: i,
20
19
  cell: b
21
- } = G(f.selectable), o = t.useRef(null), x = t.useRef(null), d = t.useRef({ clientX: 0, clientY: 0 }), [M, E] = t.useState(null), C = t.useRef(), g = t.useRef(!1), y = t.useRef(!1), H = t.useCallback(
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
- y.current = e.originalEvent.target.hasAttribute(U), !(y.current || !o.current) && (C.current = J(o.current.element), d.current = {
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
- ), L = t.useCallback(
29
+ ), q = t.useCallback(
31
30
  (a) => {
32
- const { event: e } = a, { clientX: n, clientY: r } = d.current;
33
- if (!y.current && !(!I || i === "single") && ((Math.abs(r - e.clientY) > 5 || Math.abs(n - e.clientX) > 5) && (g.current = !0), g.current)) {
34
- const l = Q(C.current);
35
- E({
36
- top: Math.min(r, e.clientY) - l.top,
37
- left: Math.min(n, e.clientX) - l.left,
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 - r)
38
+ height: Math.abs(e.clientY - l)
40
39
  });
41
40
  }
42
41
  },
43
- [E, I, i]
44
- ), _ = t.useCallback(
42
+ [g, M, i]
43
+ ), j = t.useCallback(
45
44
  (a) => {
46
- const { event: e } = a, { clientX: n, clientY: r } = d.current;
47
- if (y.current || !o.current)
45
+ const { event: e } = a, { clientX: n, clientY: l } = f.current;
46
+ if (R.current || !o.current)
48
47
  return;
49
- const l = o.current.element && o.current.element.ownerDocument;
50
- if (l) {
51
- if (g.current) {
52
- const m = Math.min(r, e.clientY), R = Math.min(n, e.clientX), v = Math.max(r, e.clientY), u = Math.max(n, e.clientX), c = x.current;
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 = l.elementFromPoint(R, m), P = l.elementFromPoint(u, v);
57
- if (c.style.visibility = "", !Y || !P)
55
+ const Y = r.elementFromPoint(v, m), w = r.elementFromPoint(u, h);
56
+ if (c.style.visibility = "", !Y || !w)
58
57
  return;
59
- const w = s(Y, "TD"), A = s(w, "TR"), S = s(P, "TD"), B = s(S, "TR"), k = K(w), p = T(A), N = K(S), O = T(B);
60
- k !== void 0 && p !== void 0 && N !== void 0 && O !== void 0 && h({
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: N,
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 = l.elementFromPoint(n, r);
74
+ const m = r.elementFromPoint(n, l);
76
75
  if (!m)
77
76
  return;
78
- const R = s(m, "TD"), v = s(m, "TR"), u = K(R), c = T(v);
79
- R && v && c !== void 0 && u !== void 0 && h({
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
- E(null), g.current = !1, d.current = { clientX: 0, clientY: 0 };
93
+ g(null), y.current = !1, f.current = { clientX: 0, clientY: 0 };
95
94
  }
96
95
  },
97
- [E, i, b, h]
98
- ), q = j(x);
99
- return F ? /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
100
- z,
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: H,
103
- onDrag: L,
104
- onRelease: _,
101
+ onPress: N,
102
+ onDrag: q,
103
+ onRelease: j,
105
104
  ref: o,
106
- childRef: D
105
+ childRef: I
107
106
  },
108
- f.children
109
- ), M && V.createPortal(
107
+ d.children
108
+ ), T && G.createPortal(
110
109
  /* @__PURE__ */ t.createElement(
111
110
  "div",
112
111
  {
113
112
  ref: x,
114
- style: { ...M, position: "fixed" },
113
+ style: { ...T, position: "fixed" },
115
114
  className: "k-marquee k-marquee-color"
116
115
  }
117
116
  ),
118
- (X = q()) == null ? void 0 : X.body
119
- )) : t.cloneElement(t.Children.only(f.children), { ref: D });
117
+ (X = z()) == null ? void 0 : X.body
118
+ )) : t.cloneElement(t.Children.only(d.children), { ref: I });
120
119
  };
121
120
  export {
122
- ee as TableSelection
121
+ $ as TableSelection
123
122
  };
@@ -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"),K=require("./constants.js"),M="items",x={},G=(e,t)=>!e||Array.isArray(e)&&e.length===0?[t]:e.findIndex(o=>o===t)>-1?e.filter(o=>o!==t):[...e,t],h=(e,t)=>{let n=e;for(;n;){if(n.tagName===t)return n;if(n.tagName==="TABLE")return null;n=n.parentElement}return null},_=e=>{if(!e)return;const t=e.getAttribute(K.TABLE_ROW_INDEX_ATTRIBUTE);return t?parseInt(t,10):void 0},O=e=>{if(!e)return;const t=e.getAttribute(K.TABLE_COL_INDEX_ATTRIBUTE);return t?parseInt(t,10):void 0},U=e=>{const t=e.subItemsField||M,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:l,mode:E,cell:f,selectedField:y}=t,{target:T,ctrlKey:C,metaKey:D,altKey:I,shiftKey:R}=s;if(a.isDefaultPrevented()||s.keyCode!==S.Keys.enter)return o;const p=h(T,"TD"),i=h(T,"TR"),r=O(p),m=_(i);let d={};return p&&i&&m!==void 0&&r!==void 0&&(d=L({selectedState:o,dataItemKey:n,event:{ctrlKey:C,metaKey:D,altKey:I,shiftKey:R,dataItems:g,cell:f,mode:E,selectedField:y,componentId:l,startColIndex:r,endColIndex:r,startRowIndex:m,endRowIndex:m,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:l,endColIndex:E,cell:f,isDrag:y,ctrlKey:T,shiftKey:C,metaKey:D,componentId:I,mode:R,dataItem:p}=t,i=S.getter(n);let r={};const m=p!==null;if(R==="single"){const d=a.slice(s,s+1)[0],u=i(d);x[I]={rowIndex:s,colIndex:l},r[u]=f?[l]:!0}else if(y||!C&&!T&&!D&&!m){y||(x[I]={rowIndex:s,colIndex:l});const d=[];for(let c=l;c<=E;c++)d.push(c);a.slice(s,g+1).forEach(c=>{const v=i(c);r[v]=f?[...d]:!0})}else if(T||D||m){x[I]={rowIndex:s,colIndex:l};const u=a.slice(s,g+1)[0],c=i(u);r={...o},r[c]=f&&!m?G(r[c],l):!r[c]}else if(C){const d=x[I]&&x[I].rowIndex||0,u=x[I]&&x[I].colIndex||0,c=Math.min(d,s,g),v=Math.max(d,s,g),N=Math.min(u,l,E),B=Math.max(u,l,E),A=[];for(let w=N;w<=B;w++)A.push(w);a.slice(c,v+1).forEach(w=>{const F=i(w);r[F]=f?[...A]:!0})}return r},X=S.hasRelativeStackingContext(),b=e=>{if(!e||!X)return null;let t=e.parentElement;for(;t;){if(window.getComputedStyle(t).transform!=="none")return t;t=t.parentElement}},q=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=h;exports.getColumnIndex=O;exports.getOffset=q;exports.getRowIndex=_;exports.getSelectedState=L;exports.getSelectedStateFromKeyDown=k;exports.getSelectionOptions=j;exports.relativeContextElement=b;exports.setSelectedState=U;
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;
@@ -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
  };