@progress/kendo-vue-data-tools 8.3.0-develop.1 → 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.
- package/clipboard/clipboard.service.d.ts +20 -0
- package/clipboard/clipboard.service.js +8 -0
- package/clipboard/clipboard.service.mjs +26 -0
- package/clipboard/common.d.ts +188 -0
- package/clipboard/common.js +13 -0
- package/clipboard/common.mjs +104 -0
- package/dist/cdn/js/kendo-vue-datatools.js +1 -1
- package/header/HeaderThElement.d.ts +3 -0
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/index.js +1 -1
- package/index.mjs +133 -117
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
- package/selection/TableSelection.js +1 -1
- package/selection/TableSelection.mjs +106 -80
- package/selection/utils.d.ts +2 -0
- package/selection/utils.js +1 -1
- package/selection/utils.mjs +102 -88
|
@@ -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
|
|
9
|
-
import { Draggable as
|
|
10
|
-
import { getSelectionOptions as
|
|
11
|
-
|
|
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: (
|
|
18
|
+
release: (_) => !0
|
|
18
19
|
},
|
|
19
|
-
setup(
|
|
20
|
-
emit:
|
|
21
|
-
slots:
|
|
20
|
+
setup(_, {
|
|
21
|
+
emit: $,
|
|
22
|
+
slots: a
|
|
22
23
|
}) {
|
|
23
24
|
const {
|
|
24
|
-
enabled:
|
|
25
|
-
drag:
|
|
26
|
-
mode:
|
|
27
|
-
cell:
|
|
28
|
-
} =
|
|
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
|
-
}),
|
|
35
|
-
if (
|
|
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
|
-
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
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
|
|
43
|
-
|
|
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:
|
|
49
|
+
pressedElement: o
|
|
49
50
|
};
|
|
50
|
-
},
|
|
51
|
+
}, z = (e, t) => {
|
|
51
52
|
const {
|
|
52
|
-
clientX:
|
|
53
|
-
clientY:
|
|
54
|
-
} =
|
|
55
|
-
if (!
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
top: `${Math.min(
|
|
59
|
-
left: `${Math.min(
|
|
60
|
-
width: `${Math.abs(e.clientX -
|
|
61
|
-
height: `${Math.abs(e.clientY -
|
|
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
|
-
},
|
|
65
|
+
}, G = (e, t) => {
|
|
65
66
|
const {
|
|
66
|
-
clientX:
|
|
67
|
-
clientY:
|
|
68
|
-
scrollX:
|
|
69
|
-
scrollY:
|
|
70
|
-
pressedElement:
|
|
71
|
-
} =
|
|
72
|
-
if (
|
|
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
|
|
75
|
-
if (
|
|
76
|
-
if (e.originalEvent.stopImmediatePropagation(),
|
|
77
|
-
const
|
|
78
|
-
if (!
|
|
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
|
-
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
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
|
|
85
|
-
|
|
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:
|
|
88
|
-
startColIndex:
|
|
89
|
-
endRowIndex:
|
|
90
|
-
endColIndex:
|
|
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:
|
|
96
|
-
cell:
|
|
121
|
+
mode: M,
|
|
122
|
+
cell: N,
|
|
97
123
|
isDrag: !0
|
|
98
124
|
});
|
|
99
125
|
} else {
|
|
100
|
-
const
|
|
101
|
-
if (!
|
|
126
|
+
const c = R.elementFromPoint(n, o);
|
|
127
|
+
if (!c)
|
|
102
128
|
return;
|
|
103
|
-
const
|
|
104
|
-
|
|
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:
|
|
107
|
-
startColIndex:
|
|
108
|
-
endRowIndex:
|
|
109
|
-
endColIndex:
|
|
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:
|
|
115
|
-
cell:
|
|
140
|
+
mode: M,
|
|
141
|
+
cell: N,
|
|
116
142
|
isDrag: !1
|
|
117
143
|
});
|
|
118
144
|
}
|
|
119
|
-
|
|
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
|
|
130
|
-
if (!
|
|
131
|
-
return (
|
|
132
|
-
const e = (
|
|
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
|
-
},
|
|
135
|
-
ref:
|
|
160
|
+
}, A("div", {
|
|
161
|
+
ref: O,
|
|
136
162
|
style: {
|
|
137
|
-
...
|
|
163
|
+
...y.value,
|
|
138
164
|
position: "fixed"
|
|
139
165
|
},
|
|
140
166
|
class: "k-marquee k-marquee-color"
|
|
141
167
|
})) : null;
|
|
142
|
-
return [
|
|
143
|
-
ref:
|
|
144
|
-
onPress:
|
|
145
|
-
onDrag:
|
|
146
|
-
onRelease:
|
|
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
|
-
|
|
178
|
+
fe as TableSelection
|
|
153
179
|
};
|
package/selection/utils.d.ts
CHANGED
|
@@ -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
|
*
|
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 d=require("@progress/kendo-vue-common"),
|
|
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;
|
package/selection/utils.mjs
CHANGED
|
@@ -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
|
|
9
|
-
import { TABLE_COL_INDEX_ATTRIBUTE as
|
|
10
|
-
const
|
|
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(
|
|
13
|
+
if (t.hasAttribute(U))
|
|
14
14
|
return !0;
|
|
15
15
|
t = t.parentElement;
|
|
16
16
|
}
|
|
17
17
|
return !1;
|
|
18
|
-
},
|
|
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
|
-
},
|
|
28
|
+
}, W = (e) => {
|
|
29
29
|
if (!e)
|
|
30
30
|
return;
|
|
31
|
-
const t = e.getAttribute(
|
|
31
|
+
const t = e.getAttribute(G);
|
|
32
32
|
return t ? parseInt(t, 10) : void 0;
|
|
33
|
-
},
|
|
33
|
+
}, H = (e) => {
|
|
34
34
|
if (!e)
|
|
35
35
|
return;
|
|
36
|
-
const t = e.getAttribute(
|
|
36
|
+
const t = e.getAttribute(j);
|
|
37
37
|
return t ? parseInt(t, 10) : void 0;
|
|
38
|
-
}, $ = (e) => {
|
|
39
|
-
|
|
40
|
-
|
|
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) =>
|
|
56
|
+
(n) => M(n, t, {
|
|
44
57
|
[e.selectedField]: e.selectedState[o(n)]
|
|
45
58
|
})
|
|
46
59
|
);
|
|
47
|
-
},
|
|
48
|
-
const { dataItemKey: t, selectedState: o } = e, { event: n, dataItems:
|
|
49
|
-
if (n.defaultPrevented && !
|
|
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 =
|
|
53
|
-
let
|
|
54
|
-
return x && v &&
|
|
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:
|
|
59
|
-
metaKey:
|
|
71
|
+
ctrlKey: S,
|
|
72
|
+
metaKey: w,
|
|
60
73
|
altKey: h,
|
|
61
|
-
shiftKey:
|
|
62
|
-
dataItems:
|
|
63
|
-
cell:
|
|
64
|
-
mode:
|
|
74
|
+
shiftKey: p,
|
|
75
|
+
dataItems: l,
|
|
76
|
+
cell: s,
|
|
77
|
+
mode: d,
|
|
65
78
|
selectedField: E,
|
|
66
79
|
componentId: r,
|
|
67
|
-
startColIndex:
|
|
68
|
-
endColIndex:
|
|
69
|
-
startRowIndex:
|
|
70
|
-
endRowIndex:
|
|
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
|
-
})),
|
|
88
|
+
})), I;
|
|
76
89
|
}, q = (e) => {
|
|
77
|
-
var _,
|
|
90
|
+
var _, N;
|
|
78
91
|
const { event: t, dataItemKey: o, selectedState: n } = e, {
|
|
79
|
-
dataItems:
|
|
92
|
+
dataItems: l,
|
|
80
93
|
startRowIndex: r,
|
|
81
|
-
endRowIndex:
|
|
82
|
-
startColIndex:
|
|
94
|
+
endRowIndex: d,
|
|
95
|
+
startColIndex: s,
|
|
83
96
|
endColIndex: E,
|
|
84
|
-
cell:
|
|
85
|
-
isDrag:
|
|
86
|
-
ctrlKey:
|
|
97
|
+
cell: g,
|
|
98
|
+
isDrag: S,
|
|
99
|
+
ctrlKey: w,
|
|
87
100
|
shiftKey: h,
|
|
88
|
-
metaKey:
|
|
101
|
+
metaKey: p,
|
|
89
102
|
componentId: x,
|
|
90
103
|
mode: v,
|
|
91
|
-
dataItem:
|
|
92
|
-
} = t,
|
|
93
|
-
let
|
|
94
|
-
const R =
|
|
104
|
+
dataItem: y
|
|
105
|
+
} = t, c = k(o);
|
|
106
|
+
let I = {};
|
|
107
|
+
const R = y !== null;
|
|
95
108
|
if (v === "single") {
|
|
96
|
-
const
|
|
109
|
+
const i = l.slice(r, r + 1)[0], u = c(i);
|
|
97
110
|
T[x] = {
|
|
98
111
|
rowIndex: r,
|
|
99
|
-
colIndex:
|
|
100
|
-
},
|
|
101
|
-
} else if (
|
|
102
|
-
|
|
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:
|
|
117
|
+
colIndex: s
|
|
105
118
|
});
|
|
106
|
-
const
|
|
107
|
-
for (let
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const A = a
|
|
111
|
-
A !== void 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 (
|
|
126
|
+
} else if (w || p || R) {
|
|
114
127
|
T[x] = {
|
|
115
128
|
rowIndex: r,
|
|
116
|
-
colIndex:
|
|
129
|
+
colIndex: s
|
|
117
130
|
};
|
|
118
|
-
const
|
|
119
|
-
|
|
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
|
|
122
|
-
if (
|
|
123
|
-
|
|
124
|
-
for (let m = 0; m <
|
|
125
|
-
const D =
|
|
126
|
-
if (
|
|
127
|
-
|
|
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:
|
|
133
|
-
colIndex:
|
|
145
|
+
rowIndex: i,
|
|
146
|
+
colIndex: u
|
|
134
147
|
};
|
|
135
148
|
}
|
|
136
|
-
const
|
|
137
|
-
for (let m =
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const D =
|
|
141
|
-
D !== void 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
|
|
145
|
-
}, z =
|
|
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
|
-
},
|
|
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
|
-
},
|
|
164
|
-
var r,
|
|
165
|
-
const t = typeof e == "object" ? (r = e.enabled) != null ? r : !0 : e != null ? e : !1, o = typeof e == "object" && (
|
|
166
|
-
return { enabled: t, drag: o, mode: n, cell:
|
|
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
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
175
|
-
|
|
188
|
+
ee as getSelectedStateFromKeyDown,
|
|
189
|
+
oe as getSelectionOptions,
|
|
176
190
|
Z as isInNonSelectable,
|
|
177
|
-
|
|
178
|
-
|
|
191
|
+
te as relativeContextElement,
|
|
192
|
+
P as setSelectedState
|
|
179
193
|
};
|