@progress/kendo-vue-data-tools 8.3.0-develop.2 → 8.3.0-develop.3

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