@progress/kendo-react-data-tools 7.4.0-develop.8 → 7.4.0-develop.9
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-react-datatools.js +1 -1
- package/filter/filters/NumericFilter.js +1 -1
- package/filter/filters/NumericFilter.mjs +19 -21
- package/index.d.mts +3 -0
- package/index.d.ts +3 -0
- package/index.js +1 -1
- package/index.mjs +90 -89
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
- package/selection/TableSelection.js +1 -1
- package/selection/TableSelection.mjs +48 -49
- package/selection/utils.js +1 -1
- package/selection/utils.mjs +86 -77
package/index.mjs
CHANGED
|
@@ -12,85 +12,85 @@ import { ColumnResizer as a } from "./drag/ColumnResizer.mjs";
|
|
|
12
12
|
import { CommonDragLogic as p } from "./drag/CommonDragLogic.mjs";
|
|
13
13
|
import { DragClue as x } from "./drag/DragClue.mjs";
|
|
14
14
|
import { DropClue as f } from "./drag/DropClue.mjs";
|
|
15
|
-
import { createDataTree as A, extendDataItem as E, filterBy as T, flatData as d, getItemPath as _, modifySubItems as D, moveTreeItem as s, orderBy as F, removeItems as N, treeToFlat as
|
|
16
|
-
import { getGroupIds as R, setExpandedState as
|
|
17
|
-
import { useTableKeyboardNavigation as
|
|
15
|
+
import { createDataTree as A, extendDataItem as E, filterBy as T, flatData as d, getItemPath as _, modifySubItems as D, moveTreeItem as s, orderBy as F, removeItems as N, treeToFlat as b } from "./utils/data-operations.mjs";
|
|
16
|
+
import { getGroupIds as R, setExpandedState as I, setGroupIds as O } from "./utils/group-operations.mjs";
|
|
17
|
+
import { useTableKeyboardNavigation as B } from "./navigation/hooks.mjs";
|
|
18
18
|
import { KEYBOARD_NAV_DATA_BODY as K, KEYBOARD_NAV_DATA_HEADER as L, KEYBOARD_NAV_DATA_ID as y, KEYBOARD_NAV_DATA_LEVEL as M, KEYBOARD_NAV_DATA_SCOPE as v, KEYBOARD_NAV_DATA_ZONE as V, KEYBOARD_NAV_FILTER_COL_SUFFIX as Y, tableKeyboardNavigationBodyAttributes as H, tableKeyboardNavigationHeaderAttributes as P, tableKeyboardNavigationScopeAttributes as w } from "./navigation/constants.mjs";
|
|
19
19
|
import { tableKeyboardNavigation as h } from "./navigation/TableKeyboardNavigation.mjs";
|
|
20
20
|
import { TableKeyboardNavigationContext as U } from "./navigation/TableKeyboardNavigationContext.mjs";
|
|
21
21
|
import { tableKeyboardNavigationTools as W } from "./navigation/utils.mjs";
|
|
22
22
|
import { TableSelection as j } from "./selection/TableSelection.mjs";
|
|
23
23
|
import { TABLE_COL_INDEX_ATTRIBUTE as q, TABLE_PREVENT_SELECTION_ELEMENT as J, TABLE_ROW_INDEX_ATTRIBUTE as Q } from "./selection/constants.mjs";
|
|
24
|
-
import { closestTagName as ee, getColumnIndex as oe, getOffset as re, getRowIndex as te, getSelectedState as me, getSelectedStateFromKeyDown as le, getSelectionOptions as ae,
|
|
25
|
-
import { ClipboardService as
|
|
26
|
-
import { ClipboardActionType as
|
|
27
|
-
import { createFilterComponent as
|
|
28
|
-
import { BooleanFilterCell as
|
|
29
|
-
import { DateFilterCell as
|
|
30
|
-
import { NumericFilterCell as
|
|
24
|
+
import { closestTagName as ee, getColumnIndex as oe, getOffset as re, getRowIndex as te, getSelectedState as me, getSelectedStateFromKeyDown as le, getSelectionOptions as ae, isInNonSelectable as ne, relativeContextElement as pe, setSelectedState as ie } from "./selection/utils.mjs";
|
|
25
|
+
import { ClipboardService as ue } from "./clipboard/clipboard.service.mjs";
|
|
26
|
+
import { ClipboardActionType as Ce, populateClipboardData as Ae } from "./clipboard/common.mjs";
|
|
27
|
+
import { createFilterComponent as Te } from "./filteringCells/FilterComponent.mjs";
|
|
28
|
+
import { BooleanFilterCell as _e } from "./filteringCells/BooleanFilter.mjs";
|
|
29
|
+
import { DateFilterCell as se } from "./filteringCells/DateFilter.mjs";
|
|
30
|
+
import { NumericFilterCell as Ne } from "./filteringCells/NumericFilter.mjs";
|
|
31
31
|
import { TextFilterCell as ge } from "./filteringCells/TextFilter.mjs";
|
|
32
|
-
import { ColumnDefaultProps as
|
|
33
|
-
import { FILTER_ROW_CLASS as
|
|
34
|
-
import { Header as
|
|
35
|
-
import { HeaderCell as
|
|
36
|
-
import { HeaderRow as
|
|
37
|
-
import { HeaderSelectionCell as
|
|
38
|
-
import { normalize as
|
|
39
|
-
import { getIndex as
|
|
40
|
-
import { HeaderThElement as
|
|
41
|
-
import { tableColumnsVirtualization as
|
|
42
|
-
import { TextFilter as
|
|
43
|
-
import { NumericFilter as
|
|
44
|
-
import { DateFilter as
|
|
45
|
-
import { BooleanFilter as
|
|
46
|
-
import { EnumFilter as
|
|
47
|
-
import { Expression as
|
|
48
|
-
import { Filter as
|
|
49
|
-
import { Group as
|
|
50
|
-
import { Operators as
|
|
51
|
-
import { ColumnMenuBooleanColumn as
|
|
52
|
-
import { ColumnMenuFilterForm as
|
|
53
|
-
import { ColumnMenuFilterLogic as
|
|
54
|
-
import { ColumnMenuBooleanFilter as
|
|
55
|
-
import { ColumnMenuItem as
|
|
56
|
-
import { ColumnMenuOperators as
|
|
32
|
+
import { ColumnDefaultProps as Ie } from "./header/ColumnProps.mjs";
|
|
33
|
+
import { FILTER_ROW_CLASS as ce, FilterRow as Be } from "./header/FilterRow.mjs";
|
|
34
|
+
import { Header as Ke } from "./header/Header.mjs";
|
|
35
|
+
import { HeaderCell as ye } from "./header/HeaderCell.mjs";
|
|
36
|
+
import { HeaderRow as ve } from "./header/HeaderRow.mjs";
|
|
37
|
+
import { HeaderSelectionCell as Ye } from "./header/HeaderSelectionCell.mjs";
|
|
38
|
+
import { normalize as Pe } from "./header/SortSettings.mjs";
|
|
39
|
+
import { getIndex as ze, isRtl as he, mapColumns as Ge, nextColumn as Ue, readColumns as Xe, updateLeft as We, updateRight as Ze } from "./header/utils/index.mjs";
|
|
40
|
+
import { HeaderThElement as ke } from "./header/HeaderThElement.mjs";
|
|
41
|
+
import { tableColumnsVirtualization as Je } from "./virtualization/columns.mjs";
|
|
42
|
+
import { TextFilter as $e } from "./filter/filters/TextFilter.mjs";
|
|
43
|
+
import { NumericFilter as oo } from "./filter/filters/NumericFilter.mjs";
|
|
44
|
+
import { DateFilter as to } from "./filter/filters/DateFilter.mjs";
|
|
45
|
+
import { BooleanFilter as lo } from "./filter/filters/BooleanFilter.mjs";
|
|
46
|
+
import { EnumFilter as no } from "./filter/filters/EnumFilter.mjs";
|
|
47
|
+
import { Expression as io } from "./filter/Expression.mjs";
|
|
48
|
+
import { Filter as uo } from "./filter/Filter.mjs";
|
|
49
|
+
import { Group as Co } from "./filter/Group.mjs";
|
|
50
|
+
import { Operators as Eo, stringOperator as To, unaryOperator as _o } from "./filter/operators.mjs";
|
|
51
|
+
import { ColumnMenuBooleanColumn as so, ColumnMenuDateColumn as Fo, ColumnMenuNumericColumn as No, ColumnMenuTextColumn as bo } from "./columnmenu/ColumnMenu.mjs";
|
|
52
|
+
import { ColumnMenuFilterForm as Ro, ColumnMenuForm as Io } from "./columnmenu/ColumnMenuFilterForm.mjs";
|
|
53
|
+
import { ColumnMenuFilterLogic as co } from "./columnmenu/ColumnMenuFilterLogic.mjs";
|
|
54
|
+
import { ColumnMenuBooleanFilter as So, ColumnMenuDateFilter as Ko, ColumnMenuNumericFilter as Lo, ColumnMenuTextFilter as yo } from "./columnmenu/ColumnMenuFilters.mjs";
|
|
55
|
+
import { ColumnMenuItem as vo } from "./columnmenu/ColumnMenuItem.mjs";
|
|
56
|
+
import { ColumnMenuOperators as Yo } from "./columnmenu/ColumnMenuOperators.mjs";
|
|
57
57
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
58
|
+
lo as BooleanFilter,
|
|
59
|
+
_e as BooleanFilterCell,
|
|
60
|
+
Ce as ClipboardActionType,
|
|
61
|
+
ue as ClipboardService,
|
|
62
|
+
Ie as ColumnDefaultProps,
|
|
63
|
+
so as ColumnMenuBooleanColumn,
|
|
64
|
+
So as ColumnMenuBooleanFilter,
|
|
65
|
+
Fo as ColumnMenuDateColumn,
|
|
66
|
+
Ko as ColumnMenuDateFilter,
|
|
67
|
+
Ro as ColumnMenuFilterForm,
|
|
68
|
+
co as ColumnMenuFilterLogic,
|
|
69
|
+
Io as ColumnMenuForm,
|
|
70
|
+
vo as ColumnMenuItem,
|
|
71
|
+
No as ColumnMenuNumericColumn,
|
|
72
|
+
Lo as ColumnMenuNumericFilter,
|
|
73
|
+
Yo as ColumnMenuOperators,
|
|
74
|
+
bo as ColumnMenuTextColumn,
|
|
75
|
+
yo as ColumnMenuTextFilter,
|
|
76
76
|
m as ColumnResize,
|
|
77
77
|
a as ColumnResizer,
|
|
78
78
|
p as CommonDragLogic,
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
to as DateFilter,
|
|
80
|
+
se as DateFilterCell,
|
|
81
81
|
x as DragClue,
|
|
82
82
|
f as DropClue,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
83
|
+
no as EnumFilter,
|
|
84
|
+
io as Expression,
|
|
85
|
+
ce as FILTER_ROW_CLASS,
|
|
86
|
+
uo as Filter,
|
|
87
|
+
Be as FilterRow,
|
|
88
|
+
Co as Group,
|
|
89
|
+
Ke as Header,
|
|
90
|
+
ye as HeaderCell,
|
|
91
|
+
ve as HeaderRow,
|
|
92
|
+
Ye as HeaderSelectionCell,
|
|
93
|
+
ke as HeaderThElement,
|
|
94
94
|
K as KEYBOARD_NAV_DATA_BODY,
|
|
95
95
|
L as KEYBOARD_NAV_DATA_HEADER,
|
|
96
96
|
y as KEYBOARD_NAV_DATA_ID,
|
|
@@ -98,56 +98,57 @@ export {
|
|
|
98
98
|
v as KEYBOARD_NAV_DATA_SCOPE,
|
|
99
99
|
V as KEYBOARD_NAV_DATA_ZONE,
|
|
100
100
|
Y as KEYBOARD_NAV_FILTER_COL_SUFFIX,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
oo as NumericFilter,
|
|
102
|
+
Ne as NumericFilterCell,
|
|
103
|
+
Eo as Operators,
|
|
104
104
|
r as Pager,
|
|
105
105
|
q as TABLE_COL_INDEX_ATTRIBUTE,
|
|
106
106
|
J as TABLE_PREVENT_SELECTION_ELEMENT,
|
|
107
107
|
Q as TABLE_ROW_INDEX_ATTRIBUTE,
|
|
108
108
|
U as TableKeyboardNavigationContext,
|
|
109
109
|
j as TableSelection,
|
|
110
|
-
|
|
110
|
+
$e as TextFilter,
|
|
111
111
|
ge as TextFilterCell,
|
|
112
112
|
ee as closestTagName,
|
|
113
113
|
A as createDataTree,
|
|
114
|
-
|
|
114
|
+
Te as createFilterComponent,
|
|
115
115
|
E as extendDataItem,
|
|
116
116
|
T as filterBy,
|
|
117
117
|
d as flatData,
|
|
118
118
|
oe as getColumnIndex,
|
|
119
119
|
R as getGroupIds,
|
|
120
|
-
|
|
120
|
+
ze as getIndex,
|
|
121
121
|
_ as getItemPath,
|
|
122
122
|
re as getOffset,
|
|
123
123
|
te as getRowIndex,
|
|
124
124
|
me as getSelectedState,
|
|
125
125
|
le as getSelectedStateFromKeyDown,
|
|
126
126
|
ae as getSelectionOptions,
|
|
127
|
-
|
|
128
|
-
he as
|
|
127
|
+
ne as isInNonSelectable,
|
|
128
|
+
he as isRtl,
|
|
129
|
+
Ge as mapColumns,
|
|
129
130
|
D as modifySubItems,
|
|
130
131
|
s as moveTreeItem,
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
Ue as nextColumn,
|
|
133
|
+
Pe as normalize,
|
|
133
134
|
F as orderBy,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
Ae as populateClipboardData,
|
|
136
|
+
Xe as readColumns,
|
|
137
|
+
pe as relativeContextElement,
|
|
137
138
|
N as removeItems,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
I as setExpandedState,
|
|
140
|
+
O as setGroupIds,
|
|
141
|
+
ie as setSelectedState,
|
|
142
|
+
To as stringOperator,
|
|
143
|
+
Je as tableColumnsVirtualization,
|
|
143
144
|
h as tableKeyboardNavigation,
|
|
144
145
|
H as tableKeyboardNavigationBodyAttributes,
|
|
145
146
|
P as tableKeyboardNavigationHeaderAttributes,
|
|
146
147
|
w as tableKeyboardNavigationScopeAttributes,
|
|
147
148
|
W as tableKeyboardNavigationTools,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
149
|
+
b as treeToFlat,
|
|
150
|
+
_o as unaryOperator,
|
|
151
|
+
We as updateLeft,
|
|
152
|
+
Ze as updateRight,
|
|
153
|
+
B as useTableKeyboardNavigation
|
|
153
154
|
};
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-data-tools",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1711533196,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-data-tools",
|
|
3
|
-
"version": "7.4.0-develop.
|
|
3
|
+
"version": "7.4.0-develop.9",
|
|
4
4
|
"description": "Includes React Pager & React Filter component, an intuitive interface to create complex filter descriptions. KendoReact Data Tools package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"@progress/kendo-data-query": "^1.0.0",
|
|
26
26
|
"@progress/kendo-drawing": "^1.19.0",
|
|
27
27
|
"@progress/kendo-licensing": "^1.3.4",
|
|
28
|
-
"@progress/kendo-react-animation": "7.4.0-develop.
|
|
29
|
-
"@progress/kendo-react-buttons": "7.4.0-develop.
|
|
30
|
-
"@progress/kendo-react-common": "7.4.0-develop.
|
|
31
|
-
"@progress/kendo-react-dateinputs": "7.4.0-develop.
|
|
32
|
-
"@progress/kendo-react-dropdowns": "7.4.0-develop.
|
|
33
|
-
"@progress/kendo-react-inputs": "7.4.0-develop.
|
|
34
|
-
"@progress/kendo-react-intl": "7.4.0-develop.
|
|
35
|
-
"@progress/kendo-react-popup": "7.4.0-develop.
|
|
28
|
+
"@progress/kendo-react-animation": "7.4.0-develop.9",
|
|
29
|
+
"@progress/kendo-react-buttons": "7.4.0-develop.9",
|
|
30
|
+
"@progress/kendo-react-common": "7.4.0-develop.9",
|
|
31
|
+
"@progress/kendo-react-dateinputs": "7.4.0-develop.9",
|
|
32
|
+
"@progress/kendo-react-dropdowns": "7.4.0-develop.9",
|
|
33
|
+
"@progress/kendo-react-inputs": "7.4.0-develop.9",
|
|
34
|
+
"@progress/kendo-react-intl": "7.4.0-develop.9",
|
|
35
|
+
"@progress/kendo-react-popup": "7.4.0-develop.9",
|
|
36
36
|
"@progress/kendo-svg-icons": "^2.1.0",
|
|
37
37
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
38
38
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react"),G=require("react-dom"),p=require("@progress/kendo-react-common"),t=require("./utils.js");function q(l){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const r in l)if(r!=="default"){const y=Object.getOwnPropertyDescriptor(l,r);Object.defineProperty(c,r,y.get?y:{enumerable:!0,get:()=>l[r]})}}return c.default=l,Object.freeze(c)}const n=q(B),J=q(G),L=l=>{var C;const{onRelease:c,childRef:r}=l,{enabled:y,drag:I,mode:d,cell:T}=t.getSelectionOptions(l.selectable),u=n.useRef(null),D=n.useRef(null),R=n.useRef({clientX:0,clientY:0}),[K,b]=n.useState(null),M=n.useRef(),v=n.useRef(!1),h=n.useRef(!1),j=n.useCallback(m=>{const{event:e}=m;h.current=t.isInNonSelectable(e.originalEvent.target),!(h.current||!u.current)&&(M.current=t.relativeContextElement(u.current.element),R.current={clientY:e.clientY,clientX:e.clientX})},[]),_=n.useCallback(m=>{const{event:e}=m,{clientX:o,clientY:s}=R.current;if(!h.current&&!(!I||d==="single")&&((Math.abs(s-e.clientY)>5||Math.abs(o-e.clientX)>5)&&(v.current=!0),v.current)){const a=t.getOffset(M.current);b({top:Math.min(s,e.clientY)-a.top,left:Math.min(o,e.clientX)-a.left,width:Math.abs(e.clientX-o),height:Math.abs(e.clientY-s)})}},[b,I,d]),F=n.useCallback(m=>{const{event:e}=m,{clientX:o,clientY:s}=R.current;if(h.current||!u.current)return;const a=u.current.element&&u.current.element.ownerDocument;if(a){if(v.current){const f=Math.min(s,e.clientY),E=Math.min(o,e.clientX),x=Math.max(s,e.clientY),g=Math.max(o,e.clientX),i=D.current;if(!i)return;i.style.visibility="hidden";const S=a.elementFromPoint(E,f),w=a.elementFromPoint(g,x);if(i.style.visibility="",!S||!w)return;const O=t.closestTagName(S,"TD"),z=t.closestTagName(O,"TR"),P=t.closestTagName(w,"TD"),A=t.closestTagName(P,"TR"),X=t.getColumnIndex(O),Y=t.getRowIndex(z),N=t.getColumnIndex(P),k=t.getRowIndex(A);X!==void 0&&Y!==void 0&&N!==void 0&&k!==void 0&&c({nativeEvent:e.originalEvent,startRowIndex:Y,startColIndex:X,endRowIndex:k,endColIndex:N,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,mode:d,cell:T,isDrag:!0})}else{const f=a.elementFromPoint(o,s);if(!f)return;const E=t.closestTagName(f,"TD"),x=t.closestTagName(f,"TR"),g=t.getColumnIndex(E),i=t.getRowIndex(x);E&&x&&i!==void 0&&g!==void 0&&c({nativeEvent:e.originalEvent,startRowIndex:i,startColIndex:g,endRowIndex:i,endColIndex:g,altKey:e.altKey,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,mode:d,cell:T,isDrag:!1})}b(null),v.current=!1,R.current={clientX:0,clientY:0}}},[b,d,T,c]),H=p.useDocument(D);return y?n.createElement(n.Fragment,null,n.createElement(p.Draggable,{onPress:j,onDrag:_,onRelease:F,ref:u,childRef:r},l.children),K&&J.createPortal(n.createElement("div",{ref:D,style:{...K,position:"fixed"},className:"k-marquee k-marquee-color"}),(C=H())==null?void 0:C.body)):n.cloneElement(n.Children.only(l.children),{ref:r})};exports.TableSelection=L;
|
|
@@ -7,62 +7,61 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import * as
|
|
11
|
-
import { useDocument as
|
|
12
|
-
import { getSelectionOptions as
|
|
13
|
-
|
|
14
|
-
const ee = (f) => {
|
|
10
|
+
import * as G from "react-dom";
|
|
11
|
+
import { useDocument as J, Draggable as L } from "@progress/kendo-react-common";
|
|
12
|
+
import { getSelectionOptions as Q, isInNonSelectable as U, relativeContextElement as V, getOffset as W, closestTagName as s, getColumnIndex as K, getRowIndex as D } from "./utils.mjs";
|
|
13
|
+
const $ = (d) => {
|
|
15
14
|
var X;
|
|
16
|
-
const { onRelease:
|
|
17
|
-
enabled:
|
|
18
|
-
drag:
|
|
15
|
+
const { onRelease: E, childRef: I } = d, {
|
|
16
|
+
enabled: H,
|
|
17
|
+
drag: M,
|
|
19
18
|
mode: i,
|
|
20
19
|
cell: b
|
|
21
|
-
} =
|
|
20
|
+
} = Q(d.selectable), o = t.useRef(null), x = t.useRef(null), f = t.useRef({ clientX: 0, clientY: 0 }), [T, g] = t.useState(null), C = t.useRef(), y = t.useRef(!1), R = t.useRef(!1), N = t.useCallback(
|
|
22
21
|
(a) => {
|
|
23
22
|
const { event: e } = a;
|
|
24
|
-
|
|
23
|
+
R.current = U(e.originalEvent.target), !(R.current || !o.current) && (C.current = V(o.current.element), f.current = {
|
|
25
24
|
clientY: e.clientY,
|
|
26
25
|
clientX: e.clientX
|
|
27
26
|
});
|
|
28
27
|
},
|
|
29
28
|
[]
|
|
30
|
-
),
|
|
29
|
+
), q = t.useCallback(
|
|
31
30
|
(a) => {
|
|
32
|
-
const { event: e } = a, { clientX: n, clientY:
|
|
33
|
-
if (!
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
top: Math.min(
|
|
37
|
-
left: Math.min(n, e.clientX) -
|
|
31
|
+
const { event: e } = a, { clientX: n, clientY: l } = f.current;
|
|
32
|
+
if (!R.current && !(!M || i === "single") && ((Math.abs(l - e.clientY) > 5 || Math.abs(n - e.clientX) > 5) && (y.current = !0), y.current)) {
|
|
33
|
+
const r = W(C.current);
|
|
34
|
+
g({
|
|
35
|
+
top: Math.min(l, e.clientY) - r.top,
|
|
36
|
+
left: Math.min(n, e.clientX) - r.left,
|
|
38
37
|
width: Math.abs(e.clientX - n),
|
|
39
|
-
height: Math.abs(e.clientY -
|
|
38
|
+
height: Math.abs(e.clientY - l)
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
41
|
},
|
|
43
|
-
[
|
|
44
|
-
),
|
|
42
|
+
[g, M, i]
|
|
43
|
+
), j = t.useCallback(
|
|
45
44
|
(a) => {
|
|
46
|
-
const { event: e } = a, { clientX: n, clientY:
|
|
47
|
-
if (
|
|
45
|
+
const { event: e } = a, { clientX: n, clientY: l } = f.current;
|
|
46
|
+
if (R.current || !o.current)
|
|
48
47
|
return;
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
if (
|
|
52
|
-
const m = Math.min(
|
|
48
|
+
const r = o.current.element && o.current.element.ownerDocument;
|
|
49
|
+
if (r) {
|
|
50
|
+
if (y.current) {
|
|
51
|
+
const m = Math.min(l, e.clientY), v = Math.min(n, e.clientX), h = Math.max(l, e.clientY), u = Math.max(n, e.clientX), c = x.current;
|
|
53
52
|
if (!c)
|
|
54
53
|
return;
|
|
55
54
|
c.style.visibility = "hidden";
|
|
56
|
-
const Y =
|
|
57
|
-
if (c.style.visibility = "", !Y || !
|
|
55
|
+
const Y = r.elementFromPoint(v, m), w = r.elementFromPoint(u, h);
|
|
56
|
+
if (c.style.visibility = "", !Y || !w)
|
|
58
57
|
return;
|
|
59
|
-
const
|
|
60
|
-
k !== void 0 && p !== void 0 &&
|
|
58
|
+
const P = s(Y, "TD"), A = s(P, "TR"), S = s(w, "TD"), B = s(S, "TR"), k = K(P), p = D(A), F = K(S), O = D(B);
|
|
59
|
+
k !== void 0 && p !== void 0 && F !== void 0 && O !== void 0 && E({
|
|
61
60
|
nativeEvent: e.originalEvent,
|
|
62
61
|
startRowIndex: p,
|
|
63
62
|
startColIndex: k,
|
|
64
63
|
endRowIndex: O,
|
|
65
|
-
endColIndex:
|
|
64
|
+
endColIndex: F,
|
|
66
65
|
altKey: e.altKey,
|
|
67
66
|
shiftKey: e.shiftKey,
|
|
68
67
|
ctrlKey: e.ctrlKey,
|
|
@@ -72,11 +71,11 @@ const ee = (f) => {
|
|
|
72
71
|
isDrag: !0
|
|
73
72
|
});
|
|
74
73
|
} else {
|
|
75
|
-
const m =
|
|
74
|
+
const m = r.elementFromPoint(n, l);
|
|
76
75
|
if (!m)
|
|
77
76
|
return;
|
|
78
|
-
const
|
|
79
|
-
|
|
77
|
+
const v = s(m, "TD"), h = s(m, "TR"), u = K(v), c = D(h);
|
|
78
|
+
v && h && c !== void 0 && u !== void 0 && E({
|
|
80
79
|
nativeEvent: e.originalEvent,
|
|
81
80
|
startRowIndex: c,
|
|
82
81
|
startColIndex: u,
|
|
@@ -91,33 +90,33 @@ const ee = (f) => {
|
|
|
91
90
|
isDrag: !1
|
|
92
91
|
});
|
|
93
92
|
}
|
|
94
|
-
|
|
93
|
+
g(null), y.current = !1, f.current = { clientX: 0, clientY: 0 };
|
|
95
94
|
}
|
|
96
95
|
},
|
|
97
|
-
[
|
|
98
|
-
),
|
|
99
|
-
return
|
|
100
|
-
|
|
96
|
+
[g, i, b, E]
|
|
97
|
+
), z = J(x);
|
|
98
|
+
return H ? /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
99
|
+
L,
|
|
101
100
|
{
|
|
102
|
-
onPress:
|
|
103
|
-
onDrag:
|
|
104
|
-
onRelease:
|
|
101
|
+
onPress: N,
|
|
102
|
+
onDrag: q,
|
|
103
|
+
onRelease: j,
|
|
105
104
|
ref: o,
|
|
106
|
-
childRef:
|
|
105
|
+
childRef: I
|
|
107
106
|
},
|
|
108
|
-
|
|
109
|
-
),
|
|
107
|
+
d.children
|
|
108
|
+
), T && G.createPortal(
|
|
110
109
|
/* @__PURE__ */ t.createElement(
|
|
111
110
|
"div",
|
|
112
111
|
{
|
|
113
112
|
ref: x,
|
|
114
|
-
style: { ...
|
|
113
|
+
style: { ...T, position: "fixed" },
|
|
115
114
|
className: "k-marquee k-marquee-color"
|
|
116
115
|
}
|
|
117
116
|
),
|
|
118
|
-
(X =
|
|
119
|
-
)) : t.cloneElement(t.Children.only(
|
|
117
|
+
(X = z()) == null ? void 0 : X.body
|
|
118
|
+
)) : t.cloneElement(t.Children.only(d.children), { ref: I });
|
|
120
119
|
};
|
|
121
120
|
export {
|
|
122
|
-
|
|
121
|
+
$ as TableSelection
|
|
123
122
|
};
|
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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("@progress/kendo-react-common"),
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("@progress/kendo-react-common"),A=require("./constants.js"),F="items",x={},b=(e,t)=>!e||Array.isArray(e)&&e.length===0?[t]:e.findIndex(o=>o===t)>-1?e.filter(o=>o!==t):[...e,t],G=e=>{let t=e;for(;t;){if(t.hasAttribute(A.TABLE_PREVENT_SELECTION_ELEMENT))return!0;t=t.parentElement}return!1},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},N=e=>{if(!e)return;const t=e.getAttribute(A.TABLE_ROW_INDEX_ATTRIBUTE);return t?parseInt(t,10):void 0},K=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,n=S.getter(e.dataItemKey);return S.mapTree(e.data,t,o=>S.extendDataItem(o,t,{[e.selectedField]:e.selectedState[n(o)]}))},k=e=>{const{event:t,dataItemKey:n,selectedState:o}=e,{syntheticEvent:a,nativeEvent:s,dataItems:g,componentId:c,mode:f,cell:E,selectedField:C}=t,{target:T,ctrlKey:y,metaKey:p,altKey:i,shiftKey:R}=s;if(a.isDefaultPrevented()||s.keyCode!==S.Keys.enter)return o;const D=v(T,"TD"),I=v(T,"TR"),r=K(D),u=N(I);let d={};return D&&I&&u!==void 0&&r!==void 0&&(d=L({selectedState:o,dataItemKey:n,event:{ctrlKey:y,metaKey:p,altKey:i,shiftKey:R,dataItems:g,cell:E,mode:f,selectedField:C,componentId:c,startColIndex:r,endColIndex:r,startRowIndex:u,endRowIndex:u,isDrag:!1,syntheticEvent:a,nativeEvent:s,target:t.target,dataItem:null}})),d},L=e=>{const{event:t,dataItemKey:n,selectedState:o}=e,{dataItems:a,startRowIndex:s,endRowIndex:g,startColIndex:c,endColIndex:f,cell:E,isDrag:C,ctrlKey:T,shiftKey:y,metaKey:p,componentId:i,mode:R,dataItem:D}=t,I=S.getter(n);let r={};const u=D!==null;if(R==="single"){const d=a.slice(s,s+1)[0],m=I(d);x[i]={rowIndex:s,colIndex:c},r[m]=E?[c]:!0}else if(C||!y&&!T&&!p&&!u){C||(x[i]={rowIndex:s,colIndex:c});const d=[];for(let l=c;l<=f;l++)d.push(l);a.slice(s,g+1).forEach(l=>{const h=I(l);r[h]=E?[...d]:!0})}else if(T||p||u){x[i]={rowIndex:s,colIndex:c};const m=a.slice(s,g+1)[0],l=I(m);r={...o},r[l]=E&&!u?b(r[l],c):!r[l]}else if(y){const d=x[i]&&x[i].rowIndex||0,m=x[i]&&x[i].colIndex||0,l=Math.min(d,s,g),h=Math.max(d,s,g),O=Math.min(m,c,f),B=Math.max(m,c,f),_=[];for(let w=O;w<=B;w++)_.push(w);a.slice(l,h+1).forEach(w=>{const M=I(w);r[M]=E?[..._]:!0})}return r},X=S.hasRelativeStackingContext(),q=e=>{if(!e||!X)return null;let t=e.parentElement;for(;t;){if(window.getComputedStyle(t).transform!=="none")return t;t=t.parentElement}},V=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=>{const t=e?typeof e.enabled=="boolean"?e.enabled:!0:!1,n=e?!!e.drag:!1,o=e&&e.mode?e.mode:"multiple",a=!!(e&&e.cell);return{enabled:t,drag:n,mode:o,cell:a}};exports.closestTagName=v;exports.getColumnIndex=K;exports.getOffset=V;exports.getRowIndex=N;exports.getSelectedState=L;exports.getSelectedStateFromKeyDown=k;exports.getSelectionOptions=j;exports.isInNonSelectable=G;exports.relativeContextElement=q;exports.setSelectedState=U;
|