@progress/kendo-vue-data-tools 8.0.3-develop.3 → 8.1.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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),B=require("@progress/kendo-vue-common"),t=require("./utils.js"),G=r.defineComponent({name:"TableSelection",props:{selectable:Object},emits:{release:b=>!0},setup(b,{emit:T,slots:a}){const{enabled:S,drag:N,mode:E,cell:I}=t.getSelectionOptions(b.selectable),q=r.ref(null),X=r.ref(null),d=r.ref({clientX:0,clientY:0,scrollX:0,scrollY:0,pressedElement:null}),u=r.ref(null),Y=r.ref(void 0),f=r.ref(!1),m=r.ref(!1),F=(e,l)=>{if(m.value=t.isInNonSelectable(e.originalEvent.target),m.value||!l)return;Y.value=t.relativeContextElement(l);const n=l==null?void 0:l.ownerDocument;if(!n)return;e.originalEvent.stopImmediatePropagation();const o=n.elementFromPoint(e.clientX,e.clientY);d.value={clientY:e.clientY,clientX:e.clientX,scrollX:e.scrollX,scrollY:e.scrollY,pressedElement:o}},O=(e,l)=>{const{clientX:n,clientY:o}=d.value;if(!m.value&&!(!N||E==="single")&&((Math.abs(o-e.clientY)>5||Math.abs(n-e.clientX)>5)&&(f.value=!0),e.originalEvent.stopImmediatePropagation(),f.value)){const g=t.getOffset(Y.value);u.value={top:`${Math.min(o,e.clientY)-g.top}px`,left:`${Math.min(n,e.clientX)-g.left}px`,width:`${Math.abs(e.clientX-n)}px`,height:`${Math.abs(e.clientY-o)}px`}}},$=(e,l)=>{const{clientX:n,clientY:o,scrollX:g,scrollY:k,pressedElement:H}=d.value;if(m.value||!l)return;const y=l==null?void 0:l.ownerDocument;if(y){debugger;if(e.originalEvent.stopImmediatePropagation(),f.value){const s=e.scrollY-k,p=e.scrollX-g,x=Math.min(o,e.clientY),c=Math.min(n,e.clientX),i=Math.max(o,e.clientY),j=Math.max(n,e.clientX),h=X.value;if(!h)return;h.style.visibility="hidden";const V=y.elementFromPoint(c,x),R=s>0||p>0?H:V,D=y.elementFromPoint(j,i);if(h.style.visibility="",!R||!D)return;const K=t.closestTagName(R,"TD"),z=t.closestTagName(K,"TR"),M=t.closestTagName(D,"TD"),A=t.closestTagName(M,"TR"),P=t.getColumnIndex(K),w=t.getRowIndex(z),C=t.getColumnIndex(M),v=t.getRowIndex(A);P!==void 0&&w!==void 0&&C!==void 0&&v!==void 0&&T("release",{event:e.originalEvent,startRowIndex:w,startColIndex:P,endRowIndex:v,endColIndex:C,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,mode:E,cell:I,isDrag:!0})}else{const s=y.elementFromPoint(n,o);if(!s)return;const p=t.closestTagName(s,"TD"),x=t.closestTagName(s,"TR"),c=t.getColumnIndex(p),i=t.getRowIndex(x);p&&x&&i!==void 0&&c!==void 0&&T("release",{event:e.originalEvent,startRowIndex:i,startColIndex:c,endRowIndex:i,endColIndex:c,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,mode:E,cell:I,isDrag:!1})}u.value=null,f.value=!1,d.value={clientX:0,clientY:0,scrollX:0,scrollY:0,pressedElement:null}}};return()=>{var n,o;if(!S)return(n=a.default)==null?void 0:n.call(a);const e=(o=a.default)==null?void 0:o.call(a),l=u.value?r.h(r.Teleport,{to:"body"},r.h("div",{ref:X,style:{...u.value,position:"fixed"},class:"k-marquee k-marquee-color"})):null;return[r.h(B.Draggable,{ref:q,onPress:F,onDrag:O,onRelease:$},()=>e),l]}}});exports.TableSelection=G;
@@ -0,0 +1,154 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { defineComponent as Q, ref as o, h as b, Teleport as U } from "vue";
9
+ import { Draggable as V } from "@progress/kendo-vue-common";
10
+ import { getSelectionOptions as W, closestTagName as a, getColumnIndex as X, getRowIndex as Y, getOffset as Z, isInNonSelectable as _, relativeContextElement as ee } from "./utils.mjs";
11
+ const oe = /* @__PURE__ */ Q({
12
+ name: "TableSelection",
13
+ props: {
14
+ selectable: Object
15
+ },
16
+ emits: {
17
+ release: (D) => !0
18
+ },
19
+ setup(D, {
20
+ emit: I,
21
+ slots: r
22
+ }) {
23
+ const {
24
+ enabled: H,
25
+ drag: O,
26
+ mode: h,
27
+ cell: K
28
+ } = W(D.selectable), k = o(null), R = o(null), d = o({
29
+ clientX: 0,
30
+ clientY: 0,
31
+ scrollX: 0,
32
+ scrollY: 0,
33
+ pressedElement: null
34
+ }), u = o(null), T = o(void 0), f = o(!1), m = o(!1), q = (e, t) => {
35
+ if (m.value = _(e.originalEvent.target), m.value || !t)
36
+ return;
37
+ T.value = ee(t);
38
+ const l = t == null ? void 0 : t.ownerDocument;
39
+ if (!l)
40
+ return;
41
+ e.originalEvent.stopImmediatePropagation();
42
+ const n = l.elementFromPoint(e.clientX, e.clientY);
43
+ d.value = {
44
+ clientY: e.clientY,
45
+ clientX: e.clientX,
46
+ scrollX: e.scrollX,
47
+ scrollY: e.scrollY,
48
+ pressedElement: n
49
+ };
50
+ }, N = (e, t) => {
51
+ const {
52
+ clientX: l,
53
+ clientY: n
54
+ } = d.value;
55
+ if (!m.value && !(!O || h === "single") && ((Math.abs(n - e.clientY) > 5 || Math.abs(l - e.clientX) > 5) && (f.value = !0), e.originalEvent.stopImmediatePropagation(), f.value)) {
56
+ const g = Z(T.value);
57
+ u.value = {
58
+ top: `${Math.min(n, e.clientY) - g.top}px`,
59
+ left: `${Math.min(l, e.clientX) - g.left}px`,
60
+ width: `${Math.abs(e.clientX - l)}px`,
61
+ height: `${Math.abs(e.clientY - n)}px`
62
+ };
63
+ }
64
+ }, j = (e, t) => {
65
+ const {
66
+ clientX: l,
67
+ clientY: n,
68
+ scrollX: g,
69
+ scrollY: z,
70
+ pressedElement: A
71
+ } = d.value;
72
+ if (m.value || !t)
73
+ return;
74
+ const p = t == null ? void 0 : t.ownerDocument;
75
+ if (p) {
76
+ debugger;
77
+ if (e.originalEvent.stopImmediatePropagation(), f.value) {
78
+ const i = e.scrollY - z, y = e.scrollX - g, E = Math.min(n, e.clientY), s = Math.min(l, e.clientX), c = Math.max(n, e.clientY), B = Math.max(l, e.clientX), x = R.value;
79
+ if (!x)
80
+ return;
81
+ x.style.visibility = "hidden";
82
+ const G = p.elementFromPoint(s, E), M = i > 0 || y > 0 ? A : G, P = p.elementFromPoint(B, c);
83
+ if (x.style.visibility = "", !M || !P)
84
+ return;
85
+ const w = a(M, "TD"), J = a(w, "TR"), v = a(P, "TD"), L = a(v, "TR"), C = X(w), S = Y(J), F = X(v), $ = Y(L);
86
+ C !== void 0 && S !== void 0 && F !== void 0 && $ !== void 0 && I("release", {
87
+ event: e.originalEvent,
88
+ startRowIndex: S,
89
+ startColIndex: C,
90
+ endRowIndex: $,
91
+ endColIndex: F,
92
+ altKey: e.altKey,
93
+ shiftKey: e.shiftKey,
94
+ ctrlKey: e.ctrlKey,
95
+ metaKey: e.metaKey,
96
+ mode: h,
97
+ cell: K,
98
+ isDrag: !0
99
+ });
100
+ } else {
101
+ const i = p.elementFromPoint(l, n);
102
+ if (!i)
103
+ return;
104
+ const y = a(i, "TD"), E = a(i, "TR"), s = X(y), c = Y(E);
105
+ y && E && c !== void 0 && s !== void 0 && I("release", {
106
+ event: e.originalEvent,
107
+ startRowIndex: c,
108
+ startColIndex: s,
109
+ endRowIndex: c,
110
+ endColIndex: s,
111
+ altKey: e.altKey,
112
+ shiftKey: e.shiftKey,
113
+ ctrlKey: e.ctrlKey,
114
+ metaKey: e.metaKey,
115
+ mode: h,
116
+ cell: K,
117
+ isDrag: !1
118
+ });
119
+ }
120
+ u.value = null, f.value = !1, d.value = {
121
+ clientX: 0,
122
+ clientY: 0,
123
+ scrollX: 0,
124
+ scrollY: 0,
125
+ pressedElement: null
126
+ };
127
+ }
128
+ };
129
+ return () => {
130
+ var l, n;
131
+ if (!H)
132
+ return (l = r.default) == null ? void 0 : l.call(r);
133
+ const e = (n = r.default) == null ? void 0 : n.call(r), t = u.value ? b(U, {
134
+ to: "body"
135
+ }, b("div", {
136
+ ref: R,
137
+ style: {
138
+ ...u.value,
139
+ position: "fixed"
140
+ },
141
+ class: "k-marquee k-marquee-color"
142
+ })) : null;
143
+ return [b(V, {
144
+ ref: k,
145
+ onPress: q,
146
+ onDrag: N,
147
+ onRelease: j
148
+ }, () => e), t];
149
+ };
150
+ }
151
+ });
152
+ export {
153
+ oe as TableSelection
154
+ };
@@ -53,7 +53,7 @@ export interface TableDragSelectionReleaseEvent {
53
53
  /**
54
54
  * A native DOM event.
55
55
  */
56
- еvent: any;
56
+ event: any;
57
57
  /**
58
58
  * Is ctrl key modifier pressed.
59
59
  */
@@ -101,8 +101,4 @@ export interface TableSelectionChangeEvent extends TableDragSelectionReleaseEven
101
101
  * The current component leaf data items.
102
102
  */
103
103
  dataItems: any[];
104
- /**
105
- * The component event.
106
- */
107
- event: any;
108
104
  }
@@ -8,6 +8,8 @@
8
8
  import { TableKeyDownEvent, TableSelectionChangeEvent } from './events';
9
9
  import { TableSelectableSettings } from './TableSelectableSettings';
10
10
  /** @hidden */
11
+ export declare const isInNonSelectable: (target: HTMLElement | null) => boolean;
12
+ /** @hidden */
11
13
  export declare const closestTagName: (target: HTMLElement | null, tagName: 'TD' | 'TR' | 'TABLE') => HTMLElement | null;
12
14
  /** @hidden */
13
15
  export declare const getRowIndex: (element: HTMLTableRowElement) => number;
@@ -65,9 +67,4 @@ export declare const relativeContextElement: (element: any) => any;
65
67
  /** @hidden */
66
68
  export declare const getOffset: (offsetParent: any) => any;
67
69
  /** @hidden */
68
- export declare const getSelectionOptions: (selectable?: TableSelectableSettings) => {
69
- enabled: boolean;
70
- drag: boolean;
71
- mode: import('./TableSelectableSettings').TableSelectableMode;
72
- cell: boolean;
73
- };
70
+ export declare const getSelectionOptions: (selectable?: boolean | TableSelectableSettings) => Required<TableSelectableSettings>;
@@ -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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@progress/kendo-vue-common"),A=require("./constants.js"),F="items",m={},M=(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)=>{let n=e;for(;n;){if(n.tagName===t)return n;if(n.tagName==="TABLE")return null;n=n.parentElement}return null},K=e=>{if(!e)return;const t=e.getAttribute(A.TABLE_ROW_INDEX_ATTRIBUTE);return t?parseInt(t,10):void 0},_=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;return p.mapTree(e.data,t,n=>p.extendDataItem(n,t,{[e.selectedField]:e.selectedState[n[e.dataItemKey]]}))},k=e=>{const{dataItemKey:t,selectedState:n}=e,{event:o,dataItems:c,componentId:r,mode:u,cell:a,selectedField:f}=e.event,{target:I,ctrlKey:T,metaKey:w,altKey:C,shiftKey:y}=o;if(o.isDefaultPrevented()||o.keyCode!==p.Keys.enter)return n;const l=v(I,"TD"),D=v(I,"TR"),S=_(l),s=K(D);let x={};return l&&D&&s!==void 0&&S!==void 0&&(x=O({selectedState:n,dataItemKey:t,event:{ctrlKey:T,metaKey:w,altKey:C,shiftKey:y,dataItems:c,cell:a,mode:u,selectedField:f,componentId:r,startColIndex:S,endColIndex:S,startRowIndex:s,endRowIndex:s,isDrag:!1,event:o,target:o.target,dataItem:null}})),x},O=e=>{const{event:t,dataItemKey:n,selectedState:o}=e,{dataItems:c,startRowIndex:r,endRowIndex:u,startColIndex:a,endColIndex:f,cell:I,isDrag:T,ctrlKey:w,shiftKey:C,metaKey:y,componentId:l,mode:D,dataItem:S}=t;let s={};const x=S!==null;if(D==="single"){const g=c.slice(r,r+1)[0][n];m[l]={rowIndex:r,colIndex:a},s[g]=I?[a]:!0}else if(T||!C&&!w&&!y&&!x){T||(m[l]={rowIndex:r,colIndex:a});const i=[];for(let d=a;d<=f;d++)i.push(d);c.slice(r,u+1).forEach(d=>{const R=d[n];s[R]=I?[...i]:!0})}else if(w||y||x){m[l]={rowIndex:r,colIndex:a};const d=c.slice(r,u+1)[0][n];s={...o},s[d]=I&&!x?M(s[d],a):!s[d]}else if(C){const i=m[l]&&m[l].rowIndex||0,g=m[l]&&m[l].colIndex||0,d=Math.min(i,r,u),R=Math.max(i,r,u),L=Math.min(g,a,f),N=Math.max(g,a,f),h=[];for(let E=L;E<=N;E++)h.push(E);c.slice(d,R+1).forEach(E=>{const B=E[n];s[B]=I?[...h]:!0})}return s},X=p.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}},G=e=>{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);return{enabled:t,drag:n,mode:o,cell:c}};exports.closestTagName=v;exports.getColumnIndex=_;exports.getOffset=q;exports.getRowIndex=K;exports.getSelectedState=O;exports.getSelectedStateFromKeyDown=k;exports.getSelectionOptions=G;exports.relativeContextElement=b;exports.setSelectedState=U;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@progress/kendo-vue-common"),_=require("./constants.js"),j="items",S={},G=(e,t)=>!e||Array.isArray(e)&&e.length===0?[t]:e.findIndex(n=>n===t)>-1?e.filter(n=>n!==t):[...e,t],U=e=>{let t=e;for(;t;){if(t.hasAttribute(_.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},O=e=>{if(!e)return;const t=e.getAttribute(_.TABLE_ROW_INDEX_ATTRIBUTE);return t?parseInt(t,10):void 0},B=e=>{if(!e)return;const t=e.getAttribute(_.TABLE_COL_INDEX_ATTRIBUTE);return t?parseInt(t,10):void 0},V=e=>{const t=e.subItemsField||j,o=d.getter(e.dataItemKey);return d.mapTree(e.data,t,n=>d.extendDataItem(n,t,{[e.selectedField]:e.selectedState[o(n)]}))},X=e=>{const{dataItemKey:t,selectedState:o}=e,{event:n,dataItems:u,componentId:r,mode:f,cell:s,selectedField:x}=e.event,{target:g,ctrlKey:w,metaKey:p,altKey:K,shiftKey:C}=n;if(n.defaultPrevented&&!C||n.keyCode!==d.Keys.space&&n.keyCode!==d.Keys.enter&&n.keyCode!==d.Keys.right&&n.keyCode!==d.Keys.left&&n.keyCode!==d.Keys.up&&n.keyCode!==d.Keys.down)return o;n.preventDefault();const y=R(g,"TD"),v=R(g,"TR");let E=B(y),a=O(v),i={};return y&&v&&a!==void 0&&E!==void 0&&(n.keyCode===d.Keys.right&&E++,n.keyCode===d.Keys.left&&E--,n.keyCode===d.Keys.down&&a++,n.keyCode===d.Keys.up&&a--,i=M({selectedState:o,dataItemKey:t,event:{ctrlKey:w,metaKey:p,altKey:K,shiftKey:C,dataItems:u,cell:s,mode:f,selectedField:x,componentId:r,startColIndex:E,endColIndex:E,startRowIndex:a,endRowIndex:a,isDrag:!1,event:n,dataItem:null}})),i},M=e=>{var N,k;const{event:t,dataItemKey:o,selectedState:n}=e,{dataItems:u,startRowIndex:r,endRowIndex:f,startColIndex:s,endColIndex:x,cell:g,isDrag:w,ctrlKey:p,shiftKey:K,metaKey:C,componentId:y,mode:v,dataItem:E}=t,a=d.getter(o);let i={};const A=E!==null;if(v==="single"){const l=u.slice(r,r+1)[0],I=a(l);S[y]={rowIndex:r,colIndex:s},I!==void 0&&(i[I]=g?[s]:!0)}else if(w||!K&&!p&&!C&&!A){w||(S[y]={rowIndex:r,colIndex:s});const l=[];for(let c=s;c<=x;c++)l.push(c);u.slice(r,f+1).forEach(c=>{const h=a(c);h!==void 0&&(i[h]=g?[...l]:!0)})}else if(p||C||A){S[y]={rowIndex:r,colIndex:s};const I=u.slice(r,f+1)[0],c=a(I);c!==void 0&&(i={...n},i[c]=g&&!A?G(i[c],s):!i[c])}else if(K){let l=(N=S[y])==null?void 0:N.rowIndex,I=(k=S[y])==null?void 0:k.colIndex;if(l===void 0){l=0,I=0;for(let m=0;m<u.length;m++){const D=a(u[m]),T=n[D];if(T!==void 0&&T!==!1){l=m,g&&Array.isArray(T)&&T.length>0&&(I=Math.min(...T));break}}S[y]={rowIndex:l,colIndex:I}}const c=Math.min(l,r,f),h=Math.max(l,r,f),F=Math.min(I,s,x),b=Math.max(I,s,x),L=[];for(let m=F;m<=b;m++)L.push(m);u.slice(c,h+1).forEach(m=>{const D=a(m);D!==void 0&&(i[D]=g?[...L]:!0)})}return i},q=d.hasRelativeStackingContext(),H=e=>{if(!e||!q)return null;let t=e.parentElement;for(;t;){if(window.getComputedStyle(t).transform!=="none")return t;t=t.parentElement}},W=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}},z=e=>{var r,f,s,x;const t=typeof e=="object"?(r=e.enabled)!=null?r:!0:e!=null?e:!1,o=typeof e=="object"&&(f=e.drag)!=null?f:!1,n=typeof e=="object"&&(s=e.mode)!=null?s:"multiple",u=typeof e=="object"&&(x=e.cell)!=null?x:!1;return{enabled:t,drag:o,mode:n,cell:u}};exports.closestTagName=R;exports.getColumnIndex=B;exports.getOffset=W;exports.getRowIndex=O;exports.getSelectedState=M;exports.getSelectedStateFromKeyDown=X;exports.getSelectionOptions=z;exports.isInNonSelectable=U;exports.relativeContextElement=H;exports.setSelectedState=V;
@@ -5,121 +5,145 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { Keys as _, mapTree as L, extendDataItem as B, hasRelativeStackingContext as N } from "@progress/kendo-vue-common";
9
- import { TABLE_COL_INDEX_ATTRIBUTE as O, TABLE_ROW_INDEX_ATTRIBUTE as F } from "./constants.mjs";
10
- const M = "items", m = {}, U = (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) => {
11
- let n = e;
12
- for (; n; ) {
13
- if (n.tagName === t)
14
- return n;
15
- if (n.tagName === "TABLE")
8
+ import { getter as k, Keys as u, mapTree as M, extendDataItem as F, hasRelativeStackingContext as j } from "@progress/kendo-vue-common";
9
+ import { TABLE_COL_INDEX_ATTRIBUTE as G, TABLE_ROW_INDEX_ATTRIBUTE as U, TABLE_PREVENT_SELECTION_ELEMENT as X } from "./constants.mjs";
10
+ const b = "items", T = {}, V = (e, t) => !e || Array.isArray(e) && e.length === 0 ? [t] : e.findIndex((n) => n === t) > -1 ? e.filter((n) => n !== t) : [...e, t], Z = (e) => {
11
+ let t = e;
12
+ for (; t; ) {
13
+ if (t.hasAttribute(X))
14
+ return !0;
15
+ t = t.parentElement;
16
+ }
17
+ return !1;
18
+ }, N = (e, t) => {
19
+ let o = e;
20
+ for (; o; ) {
21
+ if (o.tagName === t)
22
+ return o;
23
+ if (o.tagName === "TABLE")
16
24
  return null;
17
- n = n.parentElement;
25
+ o = o.parentElement;
18
26
  }
19
27
  return null;
20
- }, X = (e) => {
28
+ }, H = (e) => {
21
29
  if (!e)
22
30
  return;
23
- const t = e.getAttribute(F);
31
+ const t = e.getAttribute(U);
24
32
  return t ? parseInt(t, 10) : void 0;
25
- }, k = (e) => {
33
+ }, W = (e) => {
26
34
  if (!e)
27
35
  return;
28
- const t = e.getAttribute(O);
36
+ const t = e.getAttribute(G);
29
37
  return t ? parseInt(t, 10) : void 0;
30
- }, j = (e) => {
31
- const t = e.subItemsField || M;
32
- return L(
38
+ }, $ = (e) => {
39
+ const t = e.subItemsField || b, o = k(e.dataItemKey);
40
+ return M(
33
41
  e.data,
34
42
  t,
35
- (n) => B(n, t, {
36
- [e.selectedField]: e.selectedState[n[e.dataItemKey]]
43
+ (n) => F(n, t, {
44
+ [e.selectedField]: e.selectedState[o(n)]
37
45
  })
38
46
  );
39
- }, q = (e) => {
40
- const { dataItemKey: t, selectedState: n } = e, { event: o, dataItems: l, componentId: s, mode: u, cell: a, selectedField: g } = e.event, { target: I, ctrlKey: w, metaKey: S, altKey: D, shiftKey: C } = o;
41
- if (o.isDefaultPrevented() || o.keyCode !== _.enter)
42
- return n;
43
- const c = h(I, "TD"), p = h(I, "TR"), E = k(c), r = X(p);
44
- let x = {};
45
- return c && p && r !== void 0 && E !== void 0 && (x = G({
46
- selectedState: n,
47
+ }, P = (e) => {
48
+ const { dataItemKey: t, selectedState: o } = e, { event: n, dataItems: I, componentId: r, mode: f, cell: d, selectedField: E } = e.event, { target: y, ctrlKey: w, metaKey: S, altKey: h, shiftKey: C } = n;
49
+ if (n.defaultPrevented && !C || n.keyCode !== u.space && n.keyCode !== u.enter && n.keyCode !== u.right && n.keyCode !== u.left && n.keyCode !== u.up && n.keyCode !== u.down)
50
+ return o;
51
+ n.preventDefault();
52
+ const x = N(y, "TD"), v = N(y, "TR");
53
+ let g = W(x), a = H(v), c = {};
54
+ return x && v && a !== void 0 && g !== void 0 && (n.keyCode === u.right && g++, n.keyCode === u.left && g--, n.keyCode === u.down && a++, n.keyCode === u.up && a--, c = q({
55
+ selectedState: o,
47
56
  dataItemKey: t,
48
57
  event: {
49
58
  ctrlKey: w,
50
59
  metaKey: S,
51
- altKey: D,
60
+ altKey: h,
52
61
  shiftKey: C,
53
- dataItems: l,
54
- cell: a,
55
- mode: u,
56
- selectedField: g,
57
- componentId: s,
58
- startColIndex: E,
59
- endColIndex: E,
60
- startRowIndex: r,
61
- endRowIndex: r,
62
+ dataItems: I,
63
+ cell: d,
64
+ mode: f,
65
+ selectedField: E,
66
+ componentId: r,
67
+ startColIndex: g,
68
+ endColIndex: g,
69
+ startRowIndex: a,
70
+ endRowIndex: a,
62
71
  isDrag: !1,
63
- event: o,
64
- target: o.target,
72
+ event: n,
65
73
  dataItem: null
66
74
  }
67
- })), x;
68
- }, G = (e) => {
69
- const { event: t, dataItemKey: n, selectedState: o } = e, {
70
- dataItems: l,
71
- startRowIndex: s,
72
- endRowIndex: u,
73
- startColIndex: a,
74
- endColIndex: g,
75
- cell: I,
75
+ })), c;
76
+ }, q = (e) => {
77
+ var _, K;
78
+ const { event: t, dataItemKey: o, selectedState: n } = e, {
79
+ dataItems: I,
80
+ startRowIndex: r,
81
+ endRowIndex: f,
82
+ startColIndex: d,
83
+ endColIndex: E,
84
+ cell: y,
76
85
  isDrag: w,
77
86
  ctrlKey: S,
78
- shiftKey: D,
87
+ shiftKey: h,
79
88
  metaKey: C,
80
- componentId: c,
81
- mode: p,
82
- dataItem: E
83
- } = t;
84
- let r = {};
85
- const x = E !== null;
86
- if (p === "single") {
87
- const f = l.slice(s, s + 1)[0][n];
88
- m[c] = {
89
- rowIndex: s,
90
- colIndex: a
91
- }, r[f] = I ? [a] : !0;
92
- } else if (w || !D && !S && !C && !x) {
93
- w || (m[c] = {
94
- rowIndex: s,
95
- colIndex: a
89
+ componentId: x,
90
+ mode: v,
91
+ dataItem: g
92
+ } = t, a = k(o);
93
+ let c = {};
94
+ const R = g !== null;
95
+ if (v === "single") {
96
+ const s = I.slice(r, r + 1)[0], i = a(s);
97
+ T[x] = {
98
+ rowIndex: r,
99
+ colIndex: d
100
+ }, i !== void 0 && (c[i] = y ? [d] : !0);
101
+ } else if (w || !h && !S && !C && !R) {
102
+ w || (T[x] = {
103
+ rowIndex: r,
104
+ colIndex: d
96
105
  });
97
- const i = [];
98
- for (let d = a; d <= g; d++)
99
- i.push(d);
100
- l.slice(s, u + 1).forEach((d) => {
101
- const y = d[n];
102
- r[y] = I ? [...i] : !0;
106
+ const s = [];
107
+ for (let l = d; l <= E; l++)
108
+ s.push(l);
109
+ I.slice(r, f + 1).forEach((l) => {
110
+ const A = a(l);
111
+ A !== void 0 && (c[A] = y ? [...s] : !0);
103
112
  });
104
- } else if (S || C || x) {
105
- m[c] = {
106
- rowIndex: s,
107
- colIndex: a
113
+ } else if (S || C || R) {
114
+ T[x] = {
115
+ rowIndex: r,
116
+ colIndex: d
108
117
  };
109
- const d = l.slice(s, u + 1)[0][n];
110
- r = { ...o }, r[d] = I && !x ? U(r[d], a) : !r[d];
111
- } else if (D) {
112
- const i = m[c] && m[c].rowIndex || 0, f = m[c] && m[c].colIndex || 0, d = Math.min(i, s, u), y = Math.max(i, s, u), A = Math.min(f, a, g), v = Math.max(f, a, g), R = [];
113
- for (let T = A; T <= v; T++)
114
- R.push(T);
115
- l.slice(d, y + 1).forEach((T) => {
116
- const K = T[n];
117
- r[K] = I ? [...R] : !0;
118
+ const i = I.slice(r, f + 1)[0], l = a(i);
119
+ l !== void 0 && (c = { ...n }, c[l] = y && !R ? V(c[l], d) : !c[l]);
120
+ } else if (h) {
121
+ let s = (_ = T[x]) == null ? void 0 : _.rowIndex, i = (K = T[x]) == null ? void 0 : K.colIndex;
122
+ if (s === void 0) {
123
+ s = 0, i = 0;
124
+ for (let m = 0; m < I.length; m++) {
125
+ const D = a(I[m]), p = n[D];
126
+ if (p !== void 0 && p !== !1) {
127
+ s = m, y && Array.isArray(p) && p.length > 0 && (i = Math.min(...p));
128
+ break;
129
+ }
130
+ }
131
+ T[x] = {
132
+ rowIndex: s,
133
+ colIndex: i
134
+ };
135
+ }
136
+ const l = Math.min(s, r, f), A = Math.max(s, r, f), O = Math.min(i, d, E), B = Math.max(i, d, E), L = [];
137
+ for (let m = O; m <= B; m++)
138
+ L.push(m);
139
+ I.slice(l, A + 1).forEach((m) => {
140
+ const D = a(m);
141
+ D !== void 0 && (c[D] = y ? [...L] : !0);
118
142
  });
119
143
  }
120
- return r;
121
- }, H = N(), z = (e) => {
122
- if (!e || !H)
144
+ return c;
145
+ }, z = j(), ee = (e) => {
146
+ if (!e || !z)
123
147
  return null;
124
148
  let t = e.parentElement;
125
149
  for (; t; ) {
@@ -127,7 +151,7 @@ const M = "items", m = {}, U = (e, t) => !e || Array.isArray(e) && e.length ===
127
151
  return t;
128
152
  t = t.parentElement;
129
153
  }
130
- }, J = (e) => {
154
+ }, te = (e) => {
131
155
  if (e && e.ownerDocument && e !== e.ownerDocument.body) {
132
156
  const t = e.getBoundingClientRect();
133
157
  return {
@@ -136,18 +160,20 @@ const M = "items", m = {}, U = (e, t) => !e || Array.isArray(e) && e.length ===
136
160
  };
137
161
  }
138
162
  return { left: 0, top: 0 };
139
- }, Q = (e) => {
140
- const t = e ? typeof e.enabled == "boolean" ? e.enabled : !0 : !1, n = e ? !!e.drag : !1, o = e && e.mode ? e.mode : "multiple", l = !!(e && e.cell);
141
- return { enabled: t, drag: n, mode: o, cell: l };
163
+ }, ne = (e) => {
164
+ var r, f, d, E;
165
+ const t = typeof e == "object" ? (r = e.enabled) != null ? r : !0 : e != null ? e : !1, o = typeof e == "object" && (f = e.drag) != null ? f : !1, n = typeof e == "object" && (d = e.mode) != null ? d : "multiple", I = typeof e == "object" && (E = e.cell) != null ? E : !1;
166
+ return { enabled: t, drag: o, mode: n, cell: I };
142
167
  };
143
168
  export {
144
- h as closestTagName,
145
- k as getColumnIndex,
146
- J as getOffset,
147
- X as getRowIndex,
148
- G as getSelectedState,
149
- q as getSelectedStateFromKeyDown,
150
- Q as getSelectionOptions,
151
- z as relativeContextElement,
152
- j as setSelectedState
169
+ N as closestTagName,
170
+ W as getColumnIndex,
171
+ te as getOffset,
172
+ H as getRowIndex,
173
+ q as getSelectedState,
174
+ P as getSelectedStateFromKeyDown,
175
+ ne as getSelectionOptions,
176
+ Z as isInNonSelectable,
177
+ ee as relativeContextElement,
178
+ $ as setSelectedState
153
179
  };