@progress/kendo-react-grid 9.0.0-develop.1 → 9.0.0-develop.11
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/Grid.js +1 -1
- package/Grid.mjs +927 -1042
- package/GridNoRecords.js +1 -1
- package/GridNoRecords.mjs +7 -14
- package/GridToolbar.js +1 -1
- package/GridToolbar.mjs +23 -28
- package/README.md +34 -33
- package/VirtualScroll.js +1 -1
- package/VirtualScroll.mjs +63 -58
- package/VirtualScrollFixed.js +1 -1
- package/VirtualScrollFixed.mjs +16 -14
- package/cells/GridCell.mjs +6 -3
- package/cells/GridDetailCell.mjs +6 -3
- package/cells/GridEditCell.mjs +10 -38
- package/cells/GridFilterCell.js +1 -1
- package/cells/GridFilterCell.mjs +99 -113
- package/cells/GridGroupCell.mjs +24 -30
- package/cells/GridHierarchyCell.mjs +2 -13
- package/cells/GridSelectionCell.mjs +3 -24
- package/columnMenu/GridColumnMenuCheckboxFilter.js +1 -1
- package/columnMenu/GridColumnMenuCheckboxFilter.mjs +132 -184
- package/columnMenu/GridColumnMenuFilter.js +1 -1
- package/columnMenu/GridColumnMenuFilter.mjs +127 -170
- package/columnMenu/GridColumnMenuFilterCell.js +1 -1
- package/columnMenu/GridColumnMenuFilterCell.mjs +42 -61
- package/columnMenu/GridColumnMenuFilterUI.js +1 -1
- package/columnMenu/GridColumnMenuFilterUI.mjs +15 -24
- package/columnMenu/GridColumnMenuGroup.js +1 -1
- package/columnMenu/GridColumnMenuGroup.mjs +29 -40
- package/columnMenu/GridColumnMenuItemContent.js +1 -1
- package/columnMenu/GridColumnMenuItemContent.mjs +7 -20
- package/columnMenu/GridColumnMenuItemGroup.js +1 -1
- package/columnMenu/GridColumnMenuItemGroup.mjs +7 -20
- package/columnMenu/GridColumnMenuSort.js +1 -1
- package/columnMenu/GridColumnMenuSort.mjs +42 -53
- package/columnMenu/GridColumnMenuWrapper.mjs +6 -18
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnDraggable.js +1 -1
- package/drag/ColumnDraggable.mjs +34 -33
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +36 -44
- package/drag/GroupingIndicator.js +1 -1
- package/drag/GroupingIndicator.mjs +51 -83
- package/filterCommon.mjs +1 -3
- package/footer/Footer.js +1 -1
- package/footer/Footer.mjs +40 -57
- package/footer/FooterRow.mjs +6 -5
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +69 -82
- package/header/GridHeaderSelectionCell.js +1 -1
- package/header/GridHeaderSelectionCell.mjs +28 -35
- package/header/GroupPanel.js +1 -1
- package/header/GroupPanel.mjs +43 -49
- package/header/Header.js +1 -1
- package/header/Header.mjs +70 -74
- package/header/HeaderRow.mjs +24 -27
- package/index.d.mts +259 -724
- package/index.d.ts +259 -724
- package/index.js +1 -1
- package/index.mjs +78 -80
- package/messages/index.mjs +4 -1
- package/package-metadata.mjs +1 -1
- package/package.json +11 -11
- package/rows/GridDetailRow.js +1 -1
- package/rows/GridDetailRow.mjs +2 -10
- package/rows/GridRow.mjs +10 -8
- package/utils/index.js +1 -1
- package/utils/index.mjs +35 -39
package/cells/GridEditCell.mjs
CHANGED
|
@@ -32,9 +32,12 @@ const B = (e) => {
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
[e.onChange, e.dataItem, e.dataIndex, e.field]
|
|
35
|
-
), o = a.useCallback(
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
), o = a.useCallback(
|
|
36
|
+
(t) => {
|
|
37
|
+
e.onContextMenu && e.onContextMenu.call(void 0, t, e.dataItem, e.field);
|
|
38
|
+
},
|
|
39
|
+
[e.onContextMenu, e.dataItem, e.field]
|
|
40
|
+
), g = a.useCallback(
|
|
38
41
|
(t) => {
|
|
39
42
|
e.onChange && e.onChange({
|
|
40
43
|
dataItem: e.dataItem,
|
|
@@ -65,13 +68,7 @@ const B = (e) => {
|
|
|
65
68
|
onChange: g,
|
|
66
69
|
[I]: !0
|
|
67
70
|
}
|
|
68
|
-
), d = /* @__PURE__ */ a.createElement(
|
|
69
|
-
"td",
|
|
70
|
-
{
|
|
71
|
-
...l
|
|
72
|
-
},
|
|
73
|
-
n
|
|
74
|
-
);
|
|
71
|
+
), d = /* @__PURE__ */ a.createElement("td", { ...l }, n);
|
|
75
72
|
break;
|
|
76
73
|
}
|
|
77
74
|
case "date":
|
|
@@ -85,20 +82,7 @@ const B = (e) => {
|
|
|
85
82
|
[x]: e.columnIndex,
|
|
86
83
|
role: "gridcell",
|
|
87
84
|
...u
|
|
88
|
-
}, n = /* @__PURE__ */ a.createElement(
|
|
89
|
-
N,
|
|
90
|
-
{
|
|
91
|
-
value: i,
|
|
92
|
-
onChange: g,
|
|
93
|
-
[I]: !0
|
|
94
|
-
}
|
|
95
|
-
), d = /* @__PURE__ */ a.createElement(
|
|
96
|
-
"td",
|
|
97
|
-
{
|
|
98
|
-
...l
|
|
99
|
-
},
|
|
100
|
-
n
|
|
101
|
-
);
|
|
85
|
+
}, n = /* @__PURE__ */ a.createElement(N, { value: i, onChange: g, [I]: !0 }), d = /* @__PURE__ */ a.createElement("td", { ...l }, n);
|
|
102
86
|
break;
|
|
103
87
|
case "boolean":
|
|
104
88
|
l = {
|
|
@@ -123,13 +107,7 @@ const B = (e) => {
|
|
|
123
107
|
}
|
|
124
108
|
)),
|
|
125
109
|
/* @__PURE__ */ a.createElement("label", { className: "k-checkbox-label", htmlFor: s, key: 2 })
|
|
126
|
-
], d = /* @__PURE__ */ a.createElement(
|
|
127
|
-
"td",
|
|
128
|
-
{
|
|
129
|
-
...l
|
|
130
|
-
},
|
|
131
|
-
n
|
|
132
|
-
);
|
|
110
|
+
], d = /* @__PURE__ */ a.createElement("td", { ...l }, n);
|
|
133
111
|
break;
|
|
134
112
|
default:
|
|
135
113
|
l = {
|
|
@@ -151,13 +129,7 @@ const B = (e) => {
|
|
|
151
129
|
onChange: f,
|
|
152
130
|
[I]: !0
|
|
153
131
|
}
|
|
154
|
-
), d = /* @__PURE__ */ a.createElement(
|
|
155
|
-
"td",
|
|
156
|
-
{
|
|
157
|
-
...l
|
|
158
|
-
},
|
|
159
|
-
n
|
|
160
|
-
);
|
|
132
|
+
), d = /* @__PURE__ */ a.createElement("td", { ...l }, n);
|
|
161
133
|
}
|
|
162
134
|
const r = e.editor || "text", c = e.cells;
|
|
163
135
|
if (c) {
|
package/cells/GridFilterCell.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
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react"),D=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-react-dropdowns"),C=require("@progress/kendo-react-inputs"),E=require("@progress/kendo-react-dateinputs"),u=require("../messages/index.js"),O=require("@progress/kendo-react-intl"),h=require("@progress/kendo-svg-icons"),g=require("../filterCommon.js"),y=require("@progress/kendo-react-common");function L(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const c in e)if(c!=="default"){const s=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(t,c,s.get?s:{enumerable:!0,get:()=>e[c]})}}return t.default=e,Object.freeze(t)}const r=L(z),R=e=>{const t=r.useRef(),c=O.useLocalization(),s=()=>{if(e.filterType==="boolean")return;let n;const l=e.operators.find(o=>o.operator===e.operator)||null;return r.createElement(m.DropDownList,{ref:o=>n=o,size:e.size,value:l,onChange:b,className:"k-dropdown-operator",iconClassName:"k-i-filter k-icon",svgIcon:h.filterIcon,data:e.operators,textField:"text",title:c.toLanguageString(u.filterChooseOperator,u.messages[u.filterChooseOperator]),popupSettings:{width:"",onMouseDownOutside:function(o){!o.isAnchorClicked&&o.state&&o.state.props.show&&n&&n.togglePopup()}}})},d=(n,l)=>{g.cellInputChange(n,l,e)},b=n=>{g.cellOperatorChange(n,e.value,e.onChange)},k=n=>{g.cellBoolDropdownChange(n,e.onChange)},v=n=>{n.preventDefault(),e.onChange({value:"",operator:"",syntheticEvent:n}),t.current&&(t.current.element.value="",setTimeout(()=>{t.current.element.focus()},0))},w=(n,l,o)=>{switch(n){case"numeric":return r.createElement(C.NumericTextBox,{ref:t,size:e.size,value:l,onChange:a=>{d(a.value,a.syntheticEvent)},title:e.title,ariaLabel:e.ariaLabel});case"date":return r.createElement(E.DatePicker,{ref:t,size:e.size,value:l,onChange:a=>{d(a.value,a.syntheticEvent)},title:e.title,ariaLabel:e.ariaLabel,popupSettings:{onMouseDownOutside:a=>{!a.isAnchorClicked&&a.state&&a.state.props.show&&t&&t.current.togglePopup()}}});case"boolean":{const a=i=>i==null;return r.createElement(m.DropDownList,{ref:t,size:e.size,onChange:k,value:o.find(i=>i.operator===(a(l)?"":l)),data:o,textField:"text",title:e.title,ariaLabel:e.ariaLabel,popupSettings:{onMouseDownOutside:i=>{!i.isAnchorClicked&&i.state&&i.state.props.show&&t&&t.current.togglePopup()}}})}default:return r.createElement(C.TextBox,{ref:t,size:e.size,value:l||"",onChange:a=>{d(a.target.value,a.syntheticEvent)},title:e.title,"aria-label":e.ariaLabel})}},f=r.createElement("div",{className:"k-filtercell"},r.createElement("div",{className:"k-filtercell-wrapper"},w(e.filterType,e.value,e.booleanValues),r.createElement("div",{className:"k-filtercell-operator"},s()," ",r.createElement(D.Button,{size:e.size,icon:"filter-clear",svgIcon:h.filterClearIcon,className:y.classNames({"k-clear-button-visible":!!(!(e.value===null||e.value==="")||e.operator)}),title:c.toLanguageString(u.filterClearButton,u.messages[u.filterClearButton]),type:"button",onClick:v,disabled:!(!(e.value===null||e.value==="")||e.operator)}))));return e.render?e.render.call(void 0,f,e):f};exports.GridFilterCell=R;
|
package/cells/GridFilterCell.mjs
CHANGED
|
@@ -7,131 +7,103 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as o from "react";
|
|
10
|
-
import { Button as
|
|
11
|
-
import { DropDownList as
|
|
12
|
-
import { TextBox as
|
|
13
|
-
import { DatePicker as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { classNames as
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
!t.isAnchorClicked && t.state && t.state.props.show && s && s.togglePopup();
|
|
43
|
-
}
|
|
10
|
+
import { Button as z } from "@progress/kendo-react-buttons";
|
|
11
|
+
import { DropDownList as m } from "@progress/kendo-react-dropdowns";
|
|
12
|
+
import { TextBox as w, NumericTextBox as k } from "@progress/kendo-react-inputs";
|
|
13
|
+
import { DatePicker as L } from "@progress/kendo-react-dateinputs";
|
|
14
|
+
import { filterClearButton as f, messages as d, filterChooseOperator as g } from "../messages/index.mjs";
|
|
15
|
+
import { useLocalization as x } from "@progress/kendo-react-intl";
|
|
16
|
+
import { filterClearIcon as D, filterIcon as N } from "@progress/kendo-svg-icons";
|
|
17
|
+
import { cellOperatorChange as y, cellInputChange as B, cellBoolDropdownChange as O } from "../filterCommon.mjs";
|
|
18
|
+
import { classNames as S } from "@progress/kendo-react-common";
|
|
19
|
+
const j = (e) => {
|
|
20
|
+
const n = o.useRef(), u = x(), h = () => {
|
|
21
|
+
if (e.filterType === "boolean")
|
|
22
|
+
return;
|
|
23
|
+
let t;
|
|
24
|
+
const r = e.operators.find((l) => l.operator === e.operator) || null;
|
|
25
|
+
return /* @__PURE__ */ o.createElement(
|
|
26
|
+
m,
|
|
27
|
+
{
|
|
28
|
+
ref: (l) => t = l,
|
|
29
|
+
size: e.size,
|
|
30
|
+
value: r,
|
|
31
|
+
onChange: C,
|
|
32
|
+
className: "k-dropdown-operator",
|
|
33
|
+
iconClassName: "k-i-filter k-icon",
|
|
34
|
+
svgIcon: N,
|
|
35
|
+
data: e.operators,
|
|
36
|
+
textField: "text",
|
|
37
|
+
title: u.toLanguageString(g, d[g]),
|
|
38
|
+
popupSettings: {
|
|
39
|
+
width: "",
|
|
40
|
+
onMouseDownOutside: function(l) {
|
|
41
|
+
!l.isAnchorClicked && l.state && l.state.props.show && t && t.togglePopup();
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
|
-
);
|
|
47
|
-
}, this.inputChange = this.inputChange.bind(this), this.clear = this.clear.bind(this), this.operatorChange = this.operatorChange.bind(this), this.boolDropdownChange = this.boolDropdownChange.bind(this);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* @hidden
|
|
51
|
-
*/
|
|
52
|
-
render() {
|
|
53
|
-
const r = d(this), i = /* @__PURE__ */ o.createElement("div", { className: "k-filtercell" }, /* @__PURE__ */ o.createElement("div", { className: "k-filtercell-wrapper" }, this.filterComponent(this.props.filterType, this.props.value, this.props.booleanValues), /* @__PURE__ */ o.createElement("div", { className: "k-filtercell-operator" }, this.renderOperatorEditor(r), " ", /* @__PURE__ */ o.createElement(
|
|
54
|
-
h,
|
|
55
|
-
{
|
|
56
|
-
size: this.props.size,
|
|
57
|
-
icon: "filter-clear",
|
|
58
|
-
svgIcon: C,
|
|
59
|
-
className: E({
|
|
60
|
-
"k-clear-button-visible": !!(!(this.props.value === null || this.props.value === "") || this.props.operator)
|
|
61
|
-
}),
|
|
62
|
-
title: r.toLanguageString(l, a[l]),
|
|
63
|
-
type: "button",
|
|
64
|
-
onClick: this.clear,
|
|
65
|
-
disabled: !(!(this.props.value === null || this.props.value === "") || this.props.operator)
|
|
66
44
|
}
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
w(r, this.props.onChange);
|
|
78
|
-
}
|
|
79
|
-
clear(r) {
|
|
80
|
-
r.preventDefault(), this.props.onChange({ value: "", operator: "", syntheticEvent: r }), this._inputRef.current && (this._inputRef.current.element.value = "", setTimeout(() => {
|
|
81
|
-
this._inputRef.current.element.focus();
|
|
45
|
+
);
|
|
46
|
+
}, c = (t, r) => {
|
|
47
|
+
B(t, r, e);
|
|
48
|
+
}, C = (t) => {
|
|
49
|
+
y(t, e.value, e.onChange);
|
|
50
|
+
}, v = (t) => {
|
|
51
|
+
O(t, e.onChange);
|
|
52
|
+
}, b = (t) => {
|
|
53
|
+
t.preventDefault(), e.onChange({ value: "", operator: "", syntheticEvent: t }), n.current && (n.current.element.value = "", setTimeout(() => {
|
|
54
|
+
n.current.element.focus();
|
|
82
55
|
}, 0));
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
switch (r) {
|
|
56
|
+
}, E = (t, r, l) => {
|
|
57
|
+
switch (t) {
|
|
86
58
|
case "numeric":
|
|
87
59
|
return /* @__PURE__ */ o.createElement(
|
|
88
|
-
|
|
60
|
+
k,
|
|
89
61
|
{
|
|
90
|
-
ref:
|
|
91
|
-
size:
|
|
92
|
-
value:
|
|
93
|
-
onChange: (
|
|
94
|
-
|
|
62
|
+
ref: n,
|
|
63
|
+
size: e.size,
|
|
64
|
+
value: r,
|
|
65
|
+
onChange: (a) => {
|
|
66
|
+
c(a.value, a.syntheticEvent);
|
|
95
67
|
},
|
|
96
|
-
title:
|
|
97
|
-
ariaLabel:
|
|
68
|
+
title: e.title,
|
|
69
|
+
ariaLabel: e.ariaLabel
|
|
98
70
|
}
|
|
99
71
|
);
|
|
100
72
|
case "date":
|
|
101
73
|
return /* @__PURE__ */ o.createElement(
|
|
102
|
-
|
|
74
|
+
L,
|
|
103
75
|
{
|
|
104
|
-
ref:
|
|
105
|
-
size:
|
|
106
|
-
value:
|
|
107
|
-
onChange: (
|
|
108
|
-
|
|
76
|
+
ref: n,
|
|
77
|
+
size: e.size,
|
|
78
|
+
value: r,
|
|
79
|
+
onChange: (a) => {
|
|
80
|
+
c(a.value, a.syntheticEvent);
|
|
109
81
|
},
|
|
110
|
-
title:
|
|
111
|
-
ariaLabel:
|
|
82
|
+
title: e.title,
|
|
83
|
+
ariaLabel: e.ariaLabel,
|
|
112
84
|
popupSettings: {
|
|
113
|
-
onMouseDownOutside: (
|
|
114
|
-
!
|
|
85
|
+
onMouseDownOutside: (a) => {
|
|
86
|
+
!a.isAnchorClicked && a.state && a.state.props.show && n && n.current.togglePopup();
|
|
115
87
|
}
|
|
116
88
|
}
|
|
117
89
|
}
|
|
118
90
|
);
|
|
119
91
|
case "boolean": {
|
|
120
|
-
const
|
|
92
|
+
const a = (i) => i == null;
|
|
121
93
|
return /* @__PURE__ */ o.createElement(
|
|
122
|
-
|
|
94
|
+
m,
|
|
123
95
|
{
|
|
124
|
-
ref:
|
|
125
|
-
size:
|
|
126
|
-
onChange:
|
|
127
|
-
value:
|
|
128
|
-
data:
|
|
96
|
+
ref: n,
|
|
97
|
+
size: e.size,
|
|
98
|
+
onChange: v,
|
|
99
|
+
value: l.find((i) => i.operator === (a(r) ? "" : r)),
|
|
100
|
+
data: l,
|
|
129
101
|
textField: "text",
|
|
130
|
-
title:
|
|
131
|
-
ariaLabel:
|
|
102
|
+
title: e.title,
|
|
103
|
+
ariaLabel: e.ariaLabel,
|
|
132
104
|
popupSettings: {
|
|
133
|
-
onMouseDownOutside: (
|
|
134
|
-
!
|
|
105
|
+
onMouseDownOutside: (i) => {
|
|
106
|
+
!i.isAnchorClicked && i.state && i.state.props.show && n && n.current.togglePopup();
|
|
135
107
|
}
|
|
136
108
|
}
|
|
137
109
|
}
|
|
@@ -139,22 +111,36 @@ class R extends o.Component {
|
|
|
139
111
|
}
|
|
140
112
|
default:
|
|
141
113
|
return /* @__PURE__ */ o.createElement(
|
|
142
|
-
|
|
114
|
+
w,
|
|
143
115
|
{
|
|
144
|
-
ref:
|
|
145
|
-
size:
|
|
146
|
-
value:
|
|
147
|
-
onChange: (
|
|
148
|
-
|
|
116
|
+
ref: n,
|
|
117
|
+
size: e.size,
|
|
118
|
+
value: r || "",
|
|
119
|
+
onChange: (a) => {
|
|
120
|
+
c(a.target.value, a.syntheticEvent);
|
|
149
121
|
},
|
|
150
|
-
title:
|
|
151
|
-
"aria-label":
|
|
122
|
+
title: e.title,
|
|
123
|
+
"aria-label": e.ariaLabel
|
|
152
124
|
}
|
|
153
125
|
);
|
|
154
126
|
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
127
|
+
}, s = /* @__PURE__ */ o.createElement("div", { className: "k-filtercell" }, /* @__PURE__ */ o.createElement("div", { className: "k-filtercell-wrapper" }, E(e.filterType, e.value, e.booleanValues), /* @__PURE__ */ o.createElement("div", { className: "k-filtercell-operator" }, h(), " ", /* @__PURE__ */ o.createElement(
|
|
128
|
+
z,
|
|
129
|
+
{
|
|
130
|
+
size: e.size,
|
|
131
|
+
icon: "filter-clear",
|
|
132
|
+
svgIcon: D,
|
|
133
|
+
className: S({
|
|
134
|
+
"k-clear-button-visible": !!(!(e.value === null || e.value === "") || e.operator)
|
|
135
|
+
}),
|
|
136
|
+
title: u.toLanguageString(f, d[f]),
|
|
137
|
+
type: "button",
|
|
138
|
+
onClick: b,
|
|
139
|
+
disabled: !(!(e.value === null || e.value === "") || e.operator)
|
|
140
|
+
}
|
|
141
|
+
))));
|
|
142
|
+
return e.render ? e.render.call(void 0, s, e) : s;
|
|
143
|
+
};
|
|
158
144
|
export {
|
|
159
|
-
|
|
145
|
+
j as GridFilterCell
|
|
160
146
|
};
|
package/cells/GridGroupCell.mjs
CHANGED
|
@@ -14,7 +14,20 @@ import * as t from "react";
|
|
|
14
14
|
import { messages as H, groupCollapse as j, groupExpand as q } from "../messages/index.mjs";
|
|
15
15
|
const V = (e) => {
|
|
16
16
|
let c = null;
|
|
17
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
columnIndex: a,
|
|
19
|
+
level: s,
|
|
20
|
+
columnsCount: m,
|
|
21
|
+
rowType: w,
|
|
22
|
+
dataItem: n,
|
|
23
|
+
field: D,
|
|
24
|
+
onChange: r,
|
|
25
|
+
expanded: o,
|
|
26
|
+
render: C,
|
|
27
|
+
dataIndex: f,
|
|
28
|
+
ariaColumnIndex: N,
|
|
29
|
+
isRtl: v
|
|
30
|
+
} = e, d = D || "", x = z(e.id), S = P();
|
|
18
31
|
let i = null, g = null, y = null;
|
|
19
32
|
const M = t.useCallback(
|
|
20
33
|
(l) => {
|
|
@@ -27,9 +40,12 @@ const V = (e) => {
|
|
|
27
40
|
}));
|
|
28
41
|
},
|
|
29
42
|
[o, r, n, f]
|
|
30
|
-
), k = t.useCallback(
|
|
31
|
-
|
|
32
|
-
|
|
43
|
+
), k = t.useCallback(
|
|
44
|
+
(l) => {
|
|
45
|
+
e.onContextMenu && e.onContextMenu.call(void 0, l, e.dataItem, e.field);
|
|
46
|
+
},
|
|
47
|
+
[e.onContextMenu, e.dataItem, e.field]
|
|
48
|
+
), b = (l, R) => {
|
|
33
49
|
const E = o ? j : q, A = S.toLanguageString(E, H[E]);
|
|
34
50
|
return i = {
|
|
35
51
|
className: "k-table-td",
|
|
@@ -66,44 +82,22 @@ const V = (e) => {
|
|
|
66
82
|
icon: o ? W : v ? F : G
|
|
67
83
|
}
|
|
68
84
|
)
|
|
69
|
-
), n[d] instanceof Date && n[d].toString ? n[d].toString() : n[d]), /* @__PURE__ */ t.createElement(
|
|
70
|
-
"td",
|
|
71
|
-
{
|
|
72
|
-
...i,
|
|
73
|
-
key: i.key
|
|
74
|
-
},
|
|
75
|
-
y
|
|
76
|
-
);
|
|
85
|
+
), n[d] instanceof Date && n[d].toString ? n[d].toString() : n[d]), /* @__PURE__ */ t.createElement("td", { ...i, key: i.key }, y);
|
|
77
86
|
};
|
|
78
87
|
a === void 0 || s === void 0 || a < s || m === void 0 || w !== "groupHeader" || n[d] === void 0 ? (i = {
|
|
79
88
|
style: e.style,
|
|
80
89
|
key: "g" + a,
|
|
81
|
-
className: L(
|
|
82
|
-
"k-table-td",
|
|
83
|
-
"k-group-cell",
|
|
84
|
-
{ "k-grid-content-sticky": e.locked }
|
|
85
|
-
),
|
|
90
|
+
className: L("k-table-td", "k-group-cell", { "k-grid-content-sticky": e.locked }),
|
|
86
91
|
role: "gridcell",
|
|
87
92
|
onContextMenu: k,
|
|
88
93
|
...x
|
|
89
|
-
}, c = /* @__PURE__ */ t.createElement(
|
|
90
|
-
"td",
|
|
91
|
-
{
|
|
92
|
-
...i,
|
|
93
|
-
key: i.key
|
|
94
|
-
}
|
|
95
|
-
)) : a <= s && !e.locked ? c = b(m - a, {}) : a <= s && e.locked && (g = {
|
|
94
|
+
}, c = /* @__PURE__ */ t.createElement("td", { ...i, key: i.key })) : a <= s && !e.locked ? c = b(m - a, {}) : a <= s && e.locked && (g = {
|
|
96
95
|
className: "k-table-td",
|
|
97
96
|
role: "gridcell",
|
|
98
97
|
colSpan: m - a,
|
|
99
98
|
style: { borderLeftWidth: 0, borderRightWidth: 0 },
|
|
100
99
|
onContextMenu: k
|
|
101
|
-
}, c = /* @__PURE__ */ t.createElement(t.Fragment, null, b(0, { position: "sticky", zIndex: 2 }), /* @__PURE__ */ t.createElement(
|
|
102
|
-
"td",
|
|
103
|
-
{
|
|
104
|
-
...g
|
|
105
|
-
}
|
|
106
|
-
)));
|
|
100
|
+
}, c = /* @__PURE__ */ t.createElement(t.Fragment, null, b(0, { position: "sticky", zIndex: 2 }), /* @__PURE__ */ t.createElement("td", { ...g })));
|
|
107
101
|
const I = e.rowType || "data", u = e.cells;
|
|
108
102
|
if (u && u.group && u.group[I]) {
|
|
109
103
|
const l = u.group[I];
|
|
@@ -32,12 +32,7 @@ const z = (e) => {
|
|
|
32
32
|
className: "k-table-td k-hierarchy-cell",
|
|
33
33
|
role: "gridcell",
|
|
34
34
|
...c
|
|
35
|
-
}, i = /* @__PURE__ */ n.createElement(
|
|
36
|
-
"td",
|
|
37
|
-
{
|
|
38
|
-
...l
|
|
39
|
-
}
|
|
40
|
-
);
|
|
35
|
+
}, i = /* @__PURE__ */ n.createElement("td", { ...l });
|
|
41
36
|
else if (e.rowType !== "groupHeader") {
|
|
42
37
|
const a = t ? b : E, g = u.toLanguageString(a, x[a]);
|
|
43
38
|
l = {
|
|
@@ -64,13 +59,7 @@ const z = (e) => {
|
|
|
64
59
|
tabIndex: -1
|
|
65
60
|
},
|
|
66
61
|
/* @__PURE__ */ n.createElement(C, { name: t ? "minus" : "plus", icon: t ? k : v })
|
|
67
|
-
), i = /* @__PURE__ */ n.createElement(
|
|
68
|
-
"td",
|
|
69
|
-
{
|
|
70
|
-
...l
|
|
71
|
-
},
|
|
72
|
-
r
|
|
73
|
-
);
|
|
62
|
+
), i = /* @__PURE__ */ n.createElement("td", { ...l }, r);
|
|
74
63
|
}
|
|
75
64
|
const o = e.rowType || "data", d = e.cells;
|
|
76
65
|
if (d && d.hierarchy && d.hierarchy[o]) {
|
|
@@ -13,27 +13,12 @@ import { useLocalization as T } from "@progress/kendo-react-intl";
|
|
|
13
13
|
import { useTableKeyboardNavigation as z } from "@progress/kendo-react-data-tools";
|
|
14
14
|
import { useId as L, classNames as V } from "@progress/kendo-react-common";
|
|
15
15
|
const P = (a) => {
|
|
16
|
-
const {
|
|
17
|
-
selectionChange: o,
|
|
18
|
-
field: p,
|
|
19
|
-
dataItem: k,
|
|
20
|
-
id: b,
|
|
21
|
-
className: f,
|
|
22
|
-
colSpan: h,
|
|
23
|
-
style: C,
|
|
24
|
-
ariaColumnIndex: x,
|
|
25
|
-
rowType: l,
|
|
26
|
-
cells: N,
|
|
27
|
-
render: n
|
|
28
|
-
} = a, y = T(), I = e.useCallback(
|
|
16
|
+
const { selectionChange: o, field: p, dataItem: k, id: b, className: f, colSpan: h, style: C, ariaColumnIndex: x, rowType: l, cells: N, render: n } = a, y = T(), I = e.useCallback(
|
|
29
17
|
(c) => {
|
|
30
18
|
o && o({ syntheticEvent: c });
|
|
31
19
|
},
|
|
32
20
|
[o]
|
|
33
|
-
), S = L(), s = v(p, k), w = z(b), E = V(
|
|
34
|
-
"k-table-td",
|
|
35
|
-
f
|
|
36
|
-
), r = {
|
|
21
|
+
), S = L(), s = v(p, k), w = z(b), E = V("k-table-td", f), r = {
|
|
37
22
|
colSpan: h,
|
|
38
23
|
style: C,
|
|
39
24
|
className: E,
|
|
@@ -52,13 +37,7 @@ const P = (a) => {
|
|
|
52
37
|
checked: i,
|
|
53
38
|
onChange: I
|
|
54
39
|
}
|
|
55
|
-
)), m = l !== "groupHeader" ? /* @__PURE__ */ e.createElement(
|
|
56
|
-
"td",
|
|
57
|
-
{
|
|
58
|
-
...r
|
|
59
|
-
},
|
|
60
|
-
d
|
|
61
|
-
) : null, u = l || "data", t = N;
|
|
40
|
+
)), m = l !== "groupHeader" ? /* @__PURE__ */ e.createElement("td", { ...r }, d) : null, u = l || "data", t = N;
|
|
62
41
|
if (t && t.select && t.select[u]) {
|
|
63
42
|
const c = t.select[u];
|
|
64
43
|
return /* @__PURE__ */ e.createElement(c, { ...a, tdProps: r }, d);
|
|
@@ -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 H=require("react"),J=require("./GridColumnMenuItem.js"),K=require("./GridColumnMenuItemGroup.js"),U=require("./GridColumnMenuItemContent.js"),v=require("@progress/kendo-react-inputs"),X=require("@progress/kendo-react-intl"),r=require("../messages/index.js"),D=require("@progress/kendo-data-query"),G=require("@progress/kendo-react-common"),F=require("@progress/kendo-react-buttons"),P=require("../utils/index.js"),S=require("@progress/kendo-svg-icons");function Y(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const m in e)if(m!=="default"){const f=Object.getOwnPropertyDescriptor(e,m);Object.defineProperty(s,m,f.get?f:{enumerable:!0,get:()=>e[m]})}}return s.default=e,Object.freeze(s)}const l=Y(H),Z=(e,s)=>e.length!==s.length?!1:e.every((m,f)=>m===s[f]),p={uniqueData:!0},ee=e=>{const{uniqueData:s=p.uniqueData}=e,m=()=>{const t=e.column.field;return b().filters.findIndex(i=>i.filters&&i.filters.length>0&&i.filters[0].field===t)},f=(t,n)=>{const c=e.column.field||"",i=t.map(o=>P.getNestedValue(c,o));return n?i.filter((o,u)=>i.indexOf(o)===u):i},b=()=>e.filter?G.clone(e.filter):{filters:[],logic:"and"},a=l.useRef(m()),[I,R]=l.useState(e.expanded||!1),[q,B]=l.useState(""),[h,C]=l.useState(f(e.data,s)||[]),[w,L]=l.useState(f(e.data,!1)||[]),[d,V]=l.useState(b());l.useEffect(()=>{const t=e.column.field||"",n=e.data.map(c=>P.getNestedValue(t,c));Z(n,w)||(C(n),L(n))},[e.column,e.data]);const y=()=>e.expanded!==void 0,j=()=>{const t=y(),n=!(t?e.expanded:I);e.onExpandChange&&e.onExpandChange(n),t||R(n)},N=t=>{const n=e.searchBoxFilterOperator?e.searchBoxFilterOperator:"startswith",c={logic:"and",filters:[{field:e.column.field,operator:n,value:t.target.value,ignoreCase:!0}]};B(t.target.value),C(f(D.filterBy(e.data||[],c),s))},T=()=>{const t=e.searchBoxFilterOperator?e.searchBoxFilterOperator:"startswith",n={logic:"and",filters:[{field:e.column.field,operator:t,value:"",ignoreCase:!0}]};B(""),C(f(D.filterBy(e.data||[],n),s))},z=t=>{if(t.preventDefault(),!e.onFilterChange)return;const n=d||null;n!==null&&n.filters.length>0?(a.current>=0&&n.filters.splice(a.current,1),e.onFilterChange(n,t)):e.onFilterChange(null,t),e.onCloseMenu&&e.onCloseMenu()},A=t=>{if(t.preventDefault(),!e.onFilterChange)return;const n=d||null;e.onFilterChange(n,t),e.onCloseMenu&&e.onCloseMenu()},M=(t,n)=>{const c=e.column.field||"",i={...d},o=[...d.filters];let u=[];if(a.current!==-1&&i.filters[a.current].filters&&n!=="all"&&(u=i.filters[a.current].filters),t.value&&n==="all")h.forEach(E=>{u.push({field:c,operator:"eq",value:E})});else if(t.value)u.push({field:c,operator:"eq",value:n});else if(d){const E=u.findIndex($=>$.value===n);u.splice(E,1)}i.logic="and",a.current!==-1?o[a.current]={logic:"or",filters:u}:o.push({logic:"or",filters:u}),(!t.value&&n==="all"||u.length===0)&&o.splice(a.current,1),i.filters=o,V(i)},_=()=>{let t=!1;if(d){const n=[...d.filters];return a.current===-1?!1:(t=h.every(c=>a.current!==-1&&n[a.current].filters?n[a.current].filters.findIndex(o=>o.value===c)>=0:!1),t)}return t},g=X.useLocalization(),{column:x}=e;if(!x||!x.field)return l.createElement("div",null);const Q=y()?e.expanded:I,k=[];if(d){const t=[...d.filters];a.current=t.findIndex(n=>n.filters&&n.filters.length>0?n.filters[0].field===x.field:!1),a.current!==-1&&t[a.current].filters.length>0&&t[a.current].filters.forEach(n=>{n.field===e.column.field&&k.push(n.value)})}const W=e.searchBox?l.createElement(e.searchBox,{value:q,onChange:N}):l.createElement("div",{className:"k-searchbox k-textbox k-input k-input-md k-input-solid"},l.createElement(G.IconWrap,{className:"k-input-icon",name:"search",icon:S.searchIcon}),l.createElement(v.Input,{className:"k-input-inner",type:"text",placeholder:g.toLanguageString(r.searchPlaceholder,r.messages[r.searchPlaceholder]),value:q,onChange:t=>N(t.nativeEvent)}),l.createElement(F.Button,{type:"button",rounded:null,className:"k-input-button",onClick:T,icon:"x",svgIcon:S.xIcon})),O=k.filter((t,n)=>k.indexOf(t)===n);return l.createElement(K.GridColumnMenuItemGroup,null,l.createElement(J.GridColumnMenuItem,{title:g.toLanguageString(r.filterTitle,r.messages[r.filterTitle]),iconClass:"k-i-filter",svgIcon:S.filterIcon,onClick:j}),l.createElement(U.GridColumnMenuItemContent,{show:!!Q},l.createElement("form",{className:"k-filter-menu",onSubmit:A,onReset:z},l.createElement("div",{className:"k-filter-menu-container"},W,l.createElement("ul",{className:"k-reset k-multicheck-wrap"},l.createElement("li",{className:"k-item k-check-all-wrap"},l.createElement(v.Checkbox,{label:g.toLanguageString(r.filterCheckAll,r.messages[r.filterCheckAll]),onChange:t=>M(t,"all"),checked:_()})),h.map((t,n)=>l.createElement("li",{className:"k-item",key:n},l.createElement(v.Checkbox,{label:String(t),onChange:c=>M(c,t),checked:O.includes(t)})))),l.createElement("div",{className:"k-filter-selected-items"},O.length+" "+g.toLanguageString(r.filterSelectedItems,r.messages[r.filterSelectedItems])),l.createElement("div",{className:"k-actions k-hstack k-justify-content-stretch"},l.createElement(F.Button,{themeColor:"primary",type:"submit"},g.toLanguageString(r.filterSubmitButton,r.messages[r.filterSubmitButton])),l.createElement(F.Button,{className:"k-button",type:"reset"},g.toLanguageString(r.filterClearButton,r.messages[r.filterClearButton])))))))};exports.GridColumnMenuCheckboxFilter=ee;
|