@progress/kendo-react-data-tools 11.2.0-develop.2 → 11.2.0-develop.4

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,4 +6,4 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react"),W=require("react-dom"),j=require("@progress/kendo-react-common"),t=require("./utils.js");function F(l){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const a in l)if(a!=="default"){const g=Object.getOwnPropertyDescriptor(l,a);Object.defineProperty(s,a,g.get?g:{enumerable:!0,get:()=>l[a]})}}return s.default=l,Object.freeze(s)}const n=F(V),Z=F(W),$=l=>{var M;const{onRelease:s,childRef:a}=l,{enabled:g,drag:Y,mode:i,cell:I}=t.getSelectionOptions(l.selectable),c=n.useRef(null),T=n.useRef(null),y=n.useRef({clientX:0,clientY:0,scrollX:0,scrollY:0,pressedElement:null}),[p,v]=n.useState(null),K=n.useRef(void 0),R=n.useRef(!1),E=n.useRef(!1),_=n.useCallback(u=>{const{event:e}=u;if(E.current=t.isInNonSelectable(e.originalEvent.target),E.current||!c.current)return;K.current=t.relativeContextElement(c.current.element);const r=c.current.element&&c.current.element.ownerDocument;if(!r)return;e.originalEvent.stopImmediatePropagation();const o=r.elementFromPoint(e.clientX,e.clientY);y.current={clientY:e.clientY,clientX:e.clientX,scrollX:e.scrollX,scrollY:e.scrollY,pressedElement:o}},[]),H=n.useCallback(u=>{const{event:e}=u,{clientX:r,clientY:o}=y.current;if(!E.current&&!(!Y||i==="single")&&((Math.abs(o-e.clientY)>5||Math.abs(r-e.clientX)>5)&&(R.current=!0),e.originalEvent.stopImmediatePropagation(),R.current)){const b=t.getOffset(K.current);v({top:Math.min(o,e.clientY)-b.top,left:Math.min(r,e.clientX)-b.left,width:Math.abs(e.clientX-r),height:Math.abs(e.clientY-o)})}},[v,Y,i]),z=n.useCallback(u=>{const{event:e}=u,{clientX:r,clientY:o,scrollX:b,scrollY:B,pressedElement:G}=y.current;if(E.current||!c.current)return;const h=c.current.element&&c.current.element.ownerDocument;if(h){if(e.originalEvent.stopImmediatePropagation(),R.current){const m=e.scrollY-B,D=e.scrollX-b,x=Math.min(o,e.clientY),d=Math.min(r,e.clientX),f=Math.max(o,e.clientY),J=Math.max(r,e.clientX),X=T.current;if(!X)return;X.style.visibility="hidden";const L=h.elementFromPoint(d,x),P=m>0||D>0?G:L,C=h.elementFromPoint(J,f);if(X.style.visibility="",!P||!C)return;const S=t.closestTagName(P,"TD"),Q=t.closestTagName(S,"TR"),w=t.closestTagName(C,"TD"),U=t.closestTagName(w,"TR"),O=t.getColumnIndex(S),N=t.getRowIndex(Q),k=t.getColumnIndex(w),q=t.getRowIndex(U);O!==void 0&&N!==void 0&&k!==void 0&&q!==void 0&&s({nativeEvent:e.originalEvent,startRowIndex:N,startColIndex:O,endRowIndex:q,endColIndex:k,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,mode:i,cell:I,isDrag:!0})}else{const m=h.elementFromPoint(r,o);if(!m)return;const D=t.closestTagName(m,"TD"),x=t.closestTagName(m,"TR"),d=t.getColumnIndex(D),f=t.getRowIndex(x);D&&x&&f!==void 0&&d!==void 0&&s({nativeEvent:e.originalEvent,startRowIndex:f,startColIndex:d,endRowIndex:f,endColIndex:d,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,mode:i,cell:I,isDrag:!1})}v(null),R.current=!1,y.current={clientX:0,clientY:0,scrollX:0,scrollY:0,pressedElement:null}}},[v,i,I,s]),A=j.useDocument(T);return g?n.createElement(n.Fragment,null,n.createElement(j.Draggable,{onPress:_,onDrag:H,onRelease:z,ref:c,childRef:a},l.children),p&&Z.createPortal(n.createElement("div",{ref:T,style:{...p,position:"fixed"},className:"k-marquee k-marquee-color"}),(M=A())==null?void 0:M.body)):n.cloneElement(n.Children.only(l.children),{ref:a})};exports.TableSelection=$;
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react"),Z=require("react-dom"),F=require("@progress/kendo-react-common"),t=require("./utils.js");function _(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const s in l)if(s!=="default"){const y=Object.getOwnPropertyDescriptor(l,s);Object.defineProperty(c,s,y.get?y:{enumerable:!0,get:()=>l[s]})}}return c.default=l,Object.freeze(c)}const n=_(W),$=_(Z),ee=l=>{var M;const{onRelease:c,childRef:s}=l,{enabled:y,drag:Y,mode:u,cell:I}=t.getSelectionOptions(l.selectable),i=n.useRef(null),T=n.useRef(null),v=n.useRef({clientX:0,clientY:0,scrollX:0,scrollY:0,pressedElement:null}),[p,R]=n.useState(null),K=n.useRef(void 0),E=n.useRef(!1),b=n.useRef(!1),H=n.useCallback(m=>{var a;const{event:e}=m;if(b.current=t.isInNonSelectable(e.originalEvent.target),b.current||!i.current)return;K.current=t.relativeContextElement(i.current.element);const r=(a=i.current.element)==null?void 0:a.ownerDocument;if(!r)return;e.originalEvent.stopImmediatePropagation();const o=r.elementFromPoint(e.clientX,e.clientY);v.current={clientY:e.clientY,clientX:e.clientX,scrollX:e.scrollX,scrollY:e.scrollY,pressedElement:o}},[]),z=n.useCallback(m=>{const{event:e}=m,{clientX:r,clientY:o}=v.current;if(!b.current&&!(!Y||u==="single")&&((Math.abs(o-e.clientY)>5||Math.abs(r-e.clientX)>5)&&(E.current=!0),e.originalEvent.stopImmediatePropagation(),E.current)){const a=t.getOffset(K.current);R({top:Math.min(o,e.clientY)-a.top,left:Math.min(r,e.clientX)-a.left,width:Math.abs(e.clientX-r),height:Math.abs(e.clientY-o)})}},[R,Y,u]),A=n.useCallback(m=>{var P;const{event:e}=m,{clientX:r,clientY:o,scrollX:a,scrollY:G,pressedElement:J}=v.current;if(b.current||!i.current)return;const h=(P=i.current.element)==null?void 0:P.ownerDocument;if(h){if(e.originalEvent.stopImmediatePropagation(),E.current){const d=e.scrollY-G,D=e.scrollX-a,x=Math.min(o,e.clientY),f=Math.min(r,e.clientX),g=Math.max(o,e.clientY),L=Math.max(r,e.clientX),X=T.current;if(!X)return;X.style.visibility="hidden";const Q=h.elementFromPoint(f,x),C=d>0||D>0?J:Q,S=h.elementFromPoint(L,g);if(X.style.visibility="",!C||!S)return;const w=t.closestTagName(C,"TD"),U=t.closestTagName(w,"TR"),O=t.closestTagName(S,"TD"),V=t.closestTagName(O,"TR"),N=t.getColumnIndex(w),k=t.getRowIndex(U),q=t.getColumnIndex(O),j=t.getRowIndex(V);N!==void 0&&k!==void 0&&q!==void 0&&j!==void 0&&c({nativeEvent:e.originalEvent,startRowIndex:k,startColIndex:N,endRowIndex:j,endColIndex:q,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,mode:u,cell:I,isDrag:!0})}else{const d=h.elementFromPoint(r,o);if(!d)return;const D=t.closestTagName(d,"TD"),x=t.closestTagName(d,"TR"),f=t.getColumnIndex(D),g=t.getRowIndex(x);D&&x&&g!==void 0&&f!==void 0&&c({nativeEvent:e.originalEvent,startRowIndex:g,startColIndex:f,endRowIndex:g,endColIndex:f,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,mode:u,cell:I,isDrag:!1})}R(null),E.current=!1,v.current={clientX:0,clientY:0,scrollX:0,scrollY:0,pressedElement:null}}},[R,u,I,c]),B=F.useDocument(T);return y?n.createElement(n.Fragment,null,n.createElement(F.Draggable,{onPress:H,onDrag:z,onRelease:A,ref:i,childRef:s},l.children),p&&$.createPortal(n.createElement("div",{ref:T,style:{...p,position:"fixed"},className:"k-marquee k-marquee-color"}),(M=B())==null?void 0:M.body)):n.cloneElement(n.Children.only(l.children),{ref:s})};exports.TableSelection=ee;
@@ -7,113 +7,115 @@
7
7
  */
8
8
  "use client";
9
9
  import * as t from "react";
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 o, getColumnIndex as x, getRowIndex as I } from "./utils.mjs";
13
- const oe = (u) => {
10
+ import * as Z from "react-dom";
11
+ import { useDocument as _, Draggable as $ } from "@progress/kendo-react-common";
12
+ import { getSelectionOptions as ee, isInNonSelectable as te, relativeContextElement as ne, getOffset as le, closestTagName as c, getColumnIndex as x, getRowIndex as I } from "./utils.mjs";
13
+ const ce = (d) => {
14
14
  var T;
15
- const { onRelease: D, childRef: K } = u, {
16
- enabled: q,
15
+ const { onRelease: D, childRef: K } = d, {
16
+ enabled: j,
17
17
  drag: p,
18
- mode: c,
18
+ mode: s,
19
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 }), [M, f] = t.useState(null), P = t.useRef(void 0), g = t.useRef(!1), E = t.useRef(!1), j = t.useCallback((s) => {
21
- const { event: e } = s;
22
- if (E.current = ee(e.originalEvent.target), E.current || !r.current)
20
+ } = ee(d.selectable), o = t.useRef(null), Y = t.useRef(null), f = t.useRef({ clientX: 0, clientY: 0, scrollX: 0, scrollY: 0, pressedElement: null }), [M, g] = t.useState(null), P = t.useRef(void 0), E = t.useRef(!1), v = t.useRef(!1), z = t.useCallback((i) => {
21
+ var r;
22
+ const { event: e } = i;
23
+ if (v.current = te(e.originalEvent.target), v.current || !o.current)
23
24
  return;
24
- P.current = te(r.current.element);
25
- const n = r.current.element && r.current.element.ownerDocument;
25
+ P.current = ne(o.current.element);
26
+ const n = (r = o.current.element) == null ? void 0 : r.ownerDocument;
26
27
  if (!n)
27
28
  return;
28
29
  e.originalEvent.stopImmediatePropagation();
29
30
  const l = n.elementFromPoint(e.clientX, e.clientY);
30
- d.current = {
31
+ f.current = {
31
32
  clientY: e.clientY,
32
33
  clientX: e.clientX,
33
34
  scrollX: e.scrollX,
34
35
  scrollY: e.scrollY,
35
36
  pressedElement: l
36
37
  };
37
- }, []), z = t.useCallback(
38
- (s) => {
39
- const { event: e } = s, { clientX: n, clientY: l } = d.current;
40
- if (!E.current && !(!p || c === "single") && ((Math.abs(l - e.clientY) > 5 || Math.abs(n - e.clientX) > 5) && (g.current = !0), e.originalEvent.stopImmediatePropagation(), g.current)) {
41
- const v = ne(P.current);
42
- f({
43
- top: Math.min(l, e.clientY) - v.top,
44
- left: Math.min(n, e.clientX) - v.left,
38
+ }, []), A = t.useCallback(
39
+ (i) => {
40
+ const { event: e } = i, { clientX: n, clientY: l } = f.current;
41
+ if (!v.current && !(!p || s === "single") && ((Math.abs(l - e.clientY) > 5 || Math.abs(n - e.clientX) > 5) && (E.current = !0), e.originalEvent.stopImmediatePropagation(), E.current)) {
42
+ const r = le(P.current);
43
+ g({
44
+ top: Math.min(l, e.clientY) - r.top,
45
+ left: Math.min(n, e.clientX) - r.left,
45
46
  width: Math.abs(e.clientX - n),
46
47
  height: Math.abs(e.clientY - l)
47
48
  });
48
49
  }
49
50
  },
50
- [f, p, c]
51
- ), A = t.useCallback(
52
- (s) => {
53
- const { event: e } = s, { clientX: n, clientY: l, scrollX: v, scrollY: G, pressedElement: J } = d.current;
54
- if (E.current || !r.current)
51
+ [g, p, s]
52
+ ), B = t.useCallback(
53
+ (i) => {
54
+ var C;
55
+ const { event: e } = i, { clientX: n, clientY: l, scrollX: r, scrollY: J, pressedElement: L } = f.current;
56
+ if (v.current || !o.current)
55
57
  return;
56
- const y = r.current.element && r.current.element.ownerDocument;
58
+ const y = (C = o.current.element) == null ? void 0 : C.ownerDocument;
57
59
  if (y) {
58
- if (e.originalEvent.stopImmediatePropagation(), g.current) {
59
- const i = e.scrollY - G, R = e.scrollX - v, 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;
60
+ if (e.originalEvent.stopImmediatePropagation(), E.current) {
61
+ const a = e.scrollY - J, R = e.scrollX - r, h = Math.min(l, e.clientY), m = Math.min(n, e.clientX), u = Math.max(l, e.clientY), Q = Math.max(n, e.clientX), b = Y.current;
60
62
  if (!b)
61
63
  return;
62
64
  b.style.visibility = "hidden";
63
- const Q = y.elementFromPoint(a, h), C = i > 0 || R > 0 ? J : Q, w = y.elementFromPoint(L, m);
64
- if (b.style.visibility = "", !C || !w)
65
+ const U = y.elementFromPoint(m, h), w = a > 0 || R > 0 ? L : U, S = y.elementFromPoint(Q, u);
66
+ if (b.style.visibility = "", !w || !S)
65
67
  return;
66
- const S = o(C, "TD"), U = o(S, "TR"), k = o(w, "TD"), V = o(k, "TR"), F = x(S), O = I(U), H = x(k), N = I(V);
67
- F !== void 0 && O !== void 0 && H !== void 0 && N !== void 0 && D({
68
+ const k = c(w, "TD"), V = c(k, "TR"), F = c(S, "TD"), W = c(F, "TR"), O = x(k), H = I(V), N = x(F), q = I(W);
69
+ O !== void 0 && H !== void 0 && N !== void 0 && q !== void 0 && D({
68
70
  nativeEvent: e.originalEvent,
69
- startRowIndex: O,
70
- startColIndex: F,
71
- endRowIndex: N,
72
- endColIndex: H,
71
+ startRowIndex: H,
72
+ startColIndex: O,
73
+ endRowIndex: q,
74
+ endColIndex: N,
73
75
  altKey: e.altKey,
74
76
  shiftKey: e.shiftKey,
75
77
  ctrlKey: e.ctrlKey,
76
78
  metaKey: e.metaKey,
77
- mode: c,
79
+ mode: s,
78
80
  cell: X,
79
81
  isDrag: !0
80
82
  });
81
83
  } else {
82
- const i = y.elementFromPoint(n, l);
83
- if (!i)
84
+ const a = y.elementFromPoint(n, l);
85
+ if (!a)
84
86
  return;
85
- const R = o(i, "TD"), h = o(i, "TR"), a = x(R), m = I(h);
86
- R && h && m !== void 0 && a !== void 0 && D({
87
+ const R = c(a, "TD"), h = c(a, "TR"), m = x(R), u = I(h);
88
+ R && h && u !== void 0 && m !== void 0 && D({
87
89
  nativeEvent: e.originalEvent,
88
- startRowIndex: m,
89
- startColIndex: a,
90
- endRowIndex: m,
91
- endColIndex: a,
90
+ startRowIndex: u,
91
+ startColIndex: m,
92
+ endRowIndex: u,
93
+ endColIndex: m,
92
94
  altKey: e.altKey,
93
95
  shiftKey: e.shiftKey,
94
96
  ctrlKey: e.ctrlKey,
95
97
  metaKey: e.metaKey,
96
- mode: c,
98
+ mode: s,
97
99
  cell: X,
98
100
  isDrag: !1
99
101
  });
100
102
  }
101
- f(null), g.current = !1, d.current = { clientX: 0, clientY: 0, scrollX: 0, scrollY: 0, pressedElement: null };
103
+ g(null), E.current = !1, f.current = { clientX: 0, clientY: 0, scrollX: 0, scrollY: 0, pressedElement: null };
102
104
  }
103
105
  },
104
- [f, c, X, D]
105
- ), B = Z(Y);
106
- return q ? /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
107
- _,
106
+ [g, s, X, D]
107
+ ), G = _(Y);
108
+ return j ? /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
109
+ $,
108
110
  {
109
- onPress: j,
110
- onDrag: z,
111
- onRelease: A,
112
- ref: r,
111
+ onPress: z,
112
+ onDrag: A,
113
+ onRelease: B,
114
+ ref: o,
113
115
  childRef: K
114
116
  },
115
- u.children
116
- ), M && W.createPortal(
117
+ d.children
118
+ ), M && Z.createPortal(
117
119
  /* @__PURE__ */ t.createElement(
118
120
  "div",
119
121
  {
@@ -122,9 +124,9 @@ const oe = (u) => {
122
124
  className: "k-marquee k-marquee-color"
123
125
  }
124
126
  ),
125
- (T = B()) == null ? void 0 : T.body
126
- )) : t.cloneElement(t.Children.only(u.children), { ref: K });
127
+ (T = G()) == null ? void 0 : T.body
128
+ )) : t.cloneElement(t.Children.only(d.children), { ref: K });
127
129
  };
128
130
  export {
129
- oe as TableSelection
131
+ ce as TableSelection
130
132
  };