@progress/kendo-vue-data-tools 8.0.3-develop.4 → 8.1.0-develop.2
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.
- package/dist/cdn/js/kendo-vue-datatools.js +1 -1
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +103 -100
- package/navigation/NavigatableSettings.d.ts +25 -0
- package/navigation/NavigatableSettings.js +8 -0
- package/navigation/NavigatableSettings.mjs +11 -0
- package/navigation/TableKeyboardNavigation.d.ts +32 -8
- package/navigation/TableKeyboardNavigation.js +1 -1
- package/navigation/TableKeyboardNavigation.mjs +283 -109
- package/navigation/constants.d.ts +2 -2
- package/navigation/constants.js +1 -1
- package/navigation/constants.mjs +17 -17
- package/navigation/utils.d.ts +143 -4
- package/navigation/utils.js +1 -1
- package/navigation/utils.mjs +210 -71
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
- package/selection/TableSelection.d.ts +33 -0
- package/selection/TableSelection.js +8 -0
- package/selection/TableSelection.mjs +154 -0
- package/selection/events.d.ts +1 -5
- package/selection/utils.d.ts +3 -6
- package/selection/utils.js +1 -1
- package/selection/utils.mjs +125 -99
|
@@ -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
|
+
};
|
package/selection/events.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface TableDragSelectionReleaseEvent {
|
|
|
53
53
|
/**
|
|
54
54
|
* A native DOM event.
|
|
55
55
|
*/
|
|
56
|
-
|
|
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
|
}
|
package/selection/utils.d.ts
CHANGED
|
@@ -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>;
|
package/selection/utils.js
CHANGED
|
@@ -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
|
|
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;
|
package/selection/utils.mjs
CHANGED
|
@@ -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
|
|
9
|
-
import { TABLE_COL_INDEX_ATTRIBUTE as
|
|
10
|
-
const
|
|
11
|
-
let
|
|
12
|
-
for (;
|
|
13
|
-
if (
|
|
14
|
-
return
|
|
15
|
-
|
|
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
|
-
|
|
25
|
+
o = o.parentElement;
|
|
18
26
|
}
|
|
19
27
|
return null;
|
|
20
|
-
},
|
|
28
|
+
}, H = (e) => {
|
|
21
29
|
if (!e)
|
|
22
30
|
return;
|
|
23
|
-
const t = e.getAttribute(
|
|
31
|
+
const t = e.getAttribute(U);
|
|
24
32
|
return t ? parseInt(t, 10) : void 0;
|
|
25
|
-
},
|
|
33
|
+
}, W = (e) => {
|
|
26
34
|
if (!e)
|
|
27
35
|
return;
|
|
28
|
-
const t = e.getAttribute(
|
|
36
|
+
const t = e.getAttribute(G);
|
|
29
37
|
return t ? parseInt(t, 10) : void 0;
|
|
30
|
-
},
|
|
31
|
-
const t = e.subItemsField ||
|
|
32
|
-
return
|
|
38
|
+
}, $ = (e) => {
|
|
39
|
+
const t = e.subItemsField || b, o = k(e.dataItemKey);
|
|
40
|
+
return M(
|
|
33
41
|
e.data,
|
|
34
42
|
t,
|
|
35
|
-
(n) =>
|
|
36
|
-
[e.selectedField]: e.selectedState[n
|
|
43
|
+
(n) => F(n, t, {
|
|
44
|
+
[e.selectedField]: e.selectedState[o(n)]
|
|
37
45
|
})
|
|
38
46
|
);
|
|
39
|
-
},
|
|
40
|
-
const { dataItemKey: t, selectedState:
|
|
41
|
-
if (
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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:
|
|
60
|
+
altKey: h,
|
|
52
61
|
shiftKey: C,
|
|
53
|
-
dataItems:
|
|
54
|
-
cell:
|
|
55
|
-
mode:
|
|
56
|
-
selectedField:
|
|
57
|
-
componentId:
|
|
58
|
-
startColIndex:
|
|
59
|
-
endColIndex:
|
|
60
|
-
startRowIndex:
|
|
61
|
-
endRowIndex:
|
|
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:
|
|
64
|
-
target: o.target,
|
|
72
|
+
event: n,
|
|
65
73
|
dataItem: null
|
|
66
74
|
}
|
|
67
|
-
})),
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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:
|
|
87
|
+
shiftKey: h,
|
|
79
88
|
metaKey: C,
|
|
80
|
-
componentId:
|
|
81
|
-
mode:
|
|
82
|
-
dataItem:
|
|
83
|
-
} = t;
|
|
84
|
-
let
|
|
85
|
-
const
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
rowIndex:
|
|
90
|
-
colIndex:
|
|
91
|
-
},
|
|
92
|
-
} else if (w || !
|
|
93
|
-
w || (
|
|
94
|
-
rowIndex:
|
|
95
|
-
colIndex:
|
|
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
|
|
98
|
-
for (let
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
|
|
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 ||
|
|
105
|
-
|
|
106
|
-
rowIndex:
|
|
107
|
-
colIndex:
|
|
113
|
+
} else if (S || C || R) {
|
|
114
|
+
T[x] = {
|
|
115
|
+
rowIndex: r,
|
|
116
|
+
colIndex: d
|
|
108
117
|
};
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
} else if (
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
|
121
|
-
},
|
|
122
|
-
if (!e || !
|
|
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
|
-
},
|
|
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
|
-
},
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
};
|