@progress/kendo-react-grid 8.3.0-develop.1 → 8.3.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 +337 -341
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +20 -21
- package/cells/GridDetailCell.js +1 -1
- package/cells/GridDetailCell.mjs +14 -13
- package/cells/GridDetailHierarchyCell.js +1 -1
- package/cells/GridDetailHierarchyCell.mjs +7 -3
- package/cells/GridEditCell.js +1 -1
- package/cells/GridEditCell.mjs +26 -28
- package/cells/GridFilterCell.js +1 -1
- package/cells/GridFilterCell.mjs +67 -52
- package/columnMenu/GridColumnMenuColumnsList.js +1 -1
- package/columnMenu/GridColumnMenuColumnsList.mjs +36 -34
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +52 -49
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnDraggable.js +1 -1
- package/drag/ColumnDraggable.mjs +17 -15
- package/header/GridHeaderCell.js +1 -1
- package/header/GridHeaderCell.mjs +22 -28
- package/header/GridHeaderSelectionCell.js +1 -1
- package/header/GridHeaderSelectionCell.mjs +3 -3
- package/header/Header.js +1 -1
- package/header/Header.mjs +21 -33
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +83 -77
- package/index.d.mts +10 -12
- package/index.d.ts +10 -12
- package/index.js +1 -1
- package/index.mjs +80 -80
- package/messages/index.js +1 -1
- package/messages/index.mjs +49 -43
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/rows/GridRow.js +1 -1
- package/rows/GridRow.mjs +32 -40
- package/utils/index.js +1 -1
- package/utils/index.mjs +39 -38
package/cells/GridCell.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 y=require("react"),C=require("../utils/index.js"),b=require("@progress/kendo-react-intl"),S=require("@progress/kendo-react-data-tools"),T=require("../constants/index.js"),r=require("@progress/kendo-react-common");function I(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const l=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,l.get?l:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const d=I(y),x=e=>{let t=null;const n=b.useInternationalization(),l=r.useUnstyled(),g=l&&l.uGrid?l.uGrid:r.uGrid,s=S.useTableKeyboardNavigation(e.id),m=d.useCallback(i=>{e.onContextMenu&&e.onContextMenu.call(void 0,i,e.dataItem,e.field)},[e.onContextMenu,e.dataItem,e.field]);let a=null,o=null;if(e.rowType==="groupFooter")a={onContextMenu:m,className:e.className,...s},t=d.createElement("td",{...a});else if(e.rowType!=="groupHeader"){if(e.field!==void 0){const c=C.getNestedValue(e.field,e.dataItem);c!=null&&(o=e.format?n.format(e.format,c):c.toString())}const i=r.classNames(g.td({selected:e.isSelected,sorted:e.isSorted,alt:e.isAlt}),e.className);a={onContextMenu:m,colSpan:e.colSpan,style:e.style,className:i,role:"gridcell","aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[T.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,...s},t=d.createElement("td",{...a},o)}const f=e.rowType||"data",u=e.cells;if(u&&u[f]){const i=u[f];return d.createElement(i,{...e,tdProps:a},o)}return e.render?e.render.call(void 0,t,e):t};exports.GridCell=x;
|
package/cells/GridCell.mjs
CHANGED
|
@@ -7,52 +7,51 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as i from "react";
|
|
10
|
-
import { getNestedValue as
|
|
11
|
-
import { useInternationalization as
|
|
12
|
-
import { useTableKeyboardNavigation as
|
|
13
|
-
import { GRID_COL_INDEX_ATTRIBUTE as
|
|
14
|
-
import { classNames as
|
|
15
|
-
const
|
|
10
|
+
import { getNestedValue as C } from "../utils/index.mjs";
|
|
11
|
+
import { useInternationalization as g } from "@progress/kendo-react-intl";
|
|
12
|
+
import { useTableKeyboardNavigation as y } from "@progress/kendo-react-data-tools";
|
|
13
|
+
import { GRID_COL_INDEX_ATTRIBUTE as I } from "../constants/index.mjs";
|
|
14
|
+
import { useUnstyled as x, uGrid as N, classNames as T } from "@progress/kendo-react-common";
|
|
15
|
+
const w = (e) => {
|
|
16
16
|
let n = null;
|
|
17
|
-
const f =
|
|
17
|
+
const f = g(), d = x(), s = d && d.uGrid ? d.uGrid : N, m = y(e.id), u = i.useCallback((l) => {
|
|
18
18
|
e.onContextMenu && e.onContextMenu.call(void 0, l, e.dataItem, e.field);
|
|
19
19
|
}, [e.onContextMenu, e.dataItem, e.field]);
|
|
20
20
|
let t = null, c = null;
|
|
21
21
|
if (e.rowType === "groupFooter")
|
|
22
22
|
t = {
|
|
23
|
-
onContextMenu:
|
|
23
|
+
onContextMenu: u,
|
|
24
24
|
className: e.className,
|
|
25
|
-
...
|
|
25
|
+
...m
|
|
26
26
|
}, n = /* @__PURE__ */ i.createElement("td", { ...t });
|
|
27
27
|
else if (e.rowType !== "groupHeader") {
|
|
28
28
|
if (e.field !== void 0) {
|
|
29
|
-
const a =
|
|
29
|
+
const a = C(e.field, e.dataItem);
|
|
30
30
|
a != null && (c = e.format ? f.format(e.format, a) : a.toString());
|
|
31
31
|
}
|
|
32
|
-
const l =
|
|
33
|
-
|
|
34
|
-
e.className
|
|
35
|
-
{ "k-selected": e.isSelected }
|
|
32
|
+
const l = T(
|
|
33
|
+
s.td({ selected: e.isSelected, sorted: e.isSorted, alt: e.isAlt }),
|
|
34
|
+
e.className
|
|
36
35
|
);
|
|
37
36
|
t = {
|
|
38
|
-
onContextMenu:
|
|
37
|
+
onContextMenu: u,
|
|
39
38
|
colSpan: e.colSpan,
|
|
40
39
|
style: e.style,
|
|
41
40
|
className: l,
|
|
42
41
|
role: "gridcell",
|
|
43
42
|
"aria-colindex": e.ariaColumnIndex,
|
|
44
43
|
"aria-selected": e.isSelected,
|
|
45
|
-
[
|
|
46
|
-
...
|
|
44
|
+
[I]: e.columnIndex,
|
|
45
|
+
...m
|
|
47
46
|
}, n = /* @__PURE__ */ i.createElement("td", { ...t }, c);
|
|
48
47
|
}
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
const l =
|
|
48
|
+
const r = e.rowType || "data", o = e.cells;
|
|
49
|
+
if (o && o[r]) {
|
|
50
|
+
const l = o[r];
|
|
52
51
|
return /* @__PURE__ */ i.createElement(l, { ...e, tdProps: t }, c);
|
|
53
52
|
}
|
|
54
53
|
return e.render ? e.render.call(void 0, n, e) : n;
|
|
55
54
|
};
|
|
56
55
|
export {
|
|
57
|
-
|
|
56
|
+
w as GridCell
|
|
58
57
|
};
|
package/cells/GridDetailCell.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 b=require("@progress/kendo-react-data-tools"),f=require("react"),l=require("@progress/kendo-react-common");function g(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const c=g(f),C=e=>{const{colSpan:n,ariaColIndex:t,dataItem:a,dataIndex:i,id:r}=e,d=b.useTableKeyboardNavigation(r),o=l.useUnstyled(),u=o&&o.uGrid?o.uGrid:l.uGrid,s=c.useCallback(m=>{e.onContextMenu&&e.onContextMenu.call(void 0,m,e.dataItem)},[e.onContextMenu,e.dataItem]);return c.createElement("td",{onContextMenu:s,className:l.classNames(u.detailTd({})),colSpan:n,"aria-colindex":t,role:"gridcell",...d},c.createElement(e.detail,{dataItem:a,dataIndex:i}))};exports.GridDetailCell=C;
|
package/cells/GridDetailCell.mjs
CHANGED
|
@@ -6,25 +6,26 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { useTableKeyboardNavigation as
|
|
10
|
-
import * as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import { useTableKeyboardNavigation as m } from "@progress/kendo-react-data-tools";
|
|
10
|
+
import * as a from "react";
|
|
11
|
+
import { useUnstyled as x, uGrid as C, classNames as I } from "@progress/kendo-react-common";
|
|
12
|
+
const g = (e) => {
|
|
13
|
+
const { colSpan: n, ariaColIndex: i, dataItem: l, dataIndex: o, id: d } = e, c = m(d), t = x(), r = t && t.uGrid ? t.uGrid : C, s = a.useCallback((u) => {
|
|
14
|
+
e.onContextMenu && e.onContextMenu.call(void 0, u, e.dataItem);
|
|
14
15
|
}, [e.onContextMenu, e.dataItem]);
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ a.createElement(
|
|
16
17
|
"td",
|
|
17
18
|
{
|
|
18
|
-
onContextMenu:
|
|
19
|
-
className:
|
|
20
|
-
colSpan:
|
|
21
|
-
"aria-colindex":
|
|
19
|
+
onContextMenu: s,
|
|
20
|
+
className: I(r.detailTd({})),
|
|
21
|
+
colSpan: n,
|
|
22
|
+
"aria-colindex": i,
|
|
22
23
|
role: "gridcell",
|
|
23
|
-
...
|
|
24
|
+
...c
|
|
24
25
|
},
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
+
/* @__PURE__ */ a.createElement(e.detail, { dataItem: l, dataIndex: o })
|
|
26
27
|
);
|
|
27
28
|
};
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
+
g as GridDetailCell
|
|
30
31
|
};
|
|
@@ -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 l=require("react");function a(
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@progress/kendo-react-common"),l=require("react");function a(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const o=a(l),s=t=>{const e=c.useUnstyled(),r=e&&e.uGrid?e.uGrid:c.uGrid;return o.createElement("td",{className:c.classNames(r.hierarchyTd({})),role:"gridcell"})};exports.GridDetailHierarchyCell=s;
|
|
@@ -6,8 +6,12 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import
|
|
10
|
-
|
|
9
|
+
import { useUnstyled as s, uGrid as t, classNames as l } from "@progress/kendo-react-common";
|
|
10
|
+
import * as i from "react";
|
|
11
|
+
const d = (a) => {
|
|
12
|
+
const e = s(), r = e && e.uGrid ? e.uGrid : t;
|
|
13
|
+
return /* @__PURE__ */ i.createElement("td", { className: l(r.hierarchyTd({})), role: "gridcell" });
|
|
14
|
+
};
|
|
11
15
|
export {
|
|
12
|
-
|
|
16
|
+
d as GridDetailHierarchyCell
|
|
13
17
|
};
|
package/cells/GridEditCell.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 N=require("react"),b=require("../utils/index.js"),_=require("@progress/kendo-react-inputs"),h=require("@progress/kendo-react-dateinputs"),E=require("@progress/kendo-react-common"),I=require("@progress/kendo-react-data-tools"),C=require("../constants/index.js");function S(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const d in e)if(d!=="default"){const o=Object.getOwnPropertyDescriptor(e,d);Object.defineProperty(n,d,o.get?o:{enumerable:!0,get:()=>e[d]})}}return n.default=e,Object.freeze(n)}const t=S(N),y=e=>{const n=b.getNestedValue(e.field,e.dataItem),d=E.useUnstyled(),o=d&&d.uGrid?d.uGrid:E.uGrid;let i=null;const m=E.classNames(o.editTd({selected:e.isSelected}),e.className),x=E.useId(),r=I.useTableKeyboardNavigation(e.id);let l=null,c=null;const g=t.useCallback(a=>{if(e.onChange){const k=a.target.type==="checkbox"?a.target.checked:a.target.value;e.onChange({dataItem:e.dataItem,dataIndex:e.dataIndex,field:e.field,syntheticEvent:a,value:k})}},[e.onChange,e.dataItem,e.dataIndex,e.field]),s=t.useCallback(a=>{e.onContextMenu&&e.onContextMenu.call(void 0,a,e.dataItem,e.field)},[e.onContextMenu,e.dataItem,e.field]),T=t.useCallback(a=>{e.onChange&&e.onChange({dataItem:e.dataItem,dataIndex:e.dataIndex,field:e.field,syntheticEvent:a.syntheticEvent,value:a.value})},[e.onChange,e.dataItem,e.dataIndex,e.field]);switch(e.editor){case"numeric":{l={onContextMenu:s,colSpan:e.colSpan,style:e.style,className:m,"aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[C.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,role:"gridcell",...r},c=t.createElement(_.NumericTextBox,{value:n===void 0?null:n,onChange:T,[I.TABLE_PREVENT_SELECTION_ELEMENT]:!0}),i=t.createElement("td",{...l},c);break}case"date":l={onContextMenu:s,colSpan:e.colSpan,style:e.style,className:m,"aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[C.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,role:"gridcell",...r},c=t.createElement(h.DatePicker,{value:n,onChange:T,[I.TABLE_PREVENT_SELECTION_ELEMENT]:!0}),i=t.createElement("td",{...l},c);break;case"boolean":l={onContextMenu:s,colSpan:e.colSpan,style:e.style,className:m,"aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[C.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,role:"gridcell",...r},c=[t.createElement("span",{key:1,className:"k-checkbox-wrap"},t.createElement("input",{checked:n||!1,id:x,type:"checkbox",className:"k-checkbox k-checkbox-md k-rounded-md",onChange:g})),t.createElement("label",{className:"k-checkbox-label",htmlFor:x,key:2})],i=t.createElement("td",{...l},c);break;default:l={onContextMenu:s,colSpan:e.colSpan,style:e.style,className:m,"aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[C.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex,role:"gridcell",...r},c=t.createElement("input",{style:{width:"100%"},className:"k-input",value:n||"",onChange:g,[I.TABLE_PREVENT_SELECTION_ELEMENT]:!0}),i=t.createElement("td",{...l},c)}const f=e.editor||"text",u=e.cells;if(u){let a;return u.edit&&u.edit[f]?a=u.edit[f]:u.data&&(a=u.data),t.createElement(a,{...e,tdProps:l},c)}return e.render?e.render.call(void 0,i,e):i};exports.GridEditCell=y;
|
package/cells/GridEditCell.mjs
CHANGED
|
@@ -7,36 +7,34 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as a from "react";
|
|
10
|
-
import { getNestedValue as
|
|
11
|
-
import { NumericTextBox as
|
|
12
|
-
import { DatePicker as
|
|
13
|
-
import { classNames as
|
|
14
|
-
import { useTableKeyboardNavigation as
|
|
10
|
+
import { getNestedValue as E } from "../utils/index.mjs";
|
|
11
|
+
import { NumericTextBox as b } from "@progress/kendo-react-inputs";
|
|
12
|
+
import { DatePicker as N } from "@progress/kendo-react-dateinputs";
|
|
13
|
+
import { useUnstyled as y, uGrid as S, classNames as v, useId as T } from "@progress/kendo-react-common";
|
|
14
|
+
import { useTableKeyboardNavigation as _, TABLE_PREVENT_SELECTION_ELEMENT as I } from "@progress/kendo-react-data-tools";
|
|
15
15
|
import { GRID_COL_INDEX_ATTRIBUTE as x } from "../constants/index.mjs";
|
|
16
|
-
const
|
|
17
|
-
const i =
|
|
16
|
+
const B = (e) => {
|
|
17
|
+
const i = E(e.field, e.dataItem), C = y(), h = C && C.uGrid ? C.uGrid : S;
|
|
18
18
|
let d = null;
|
|
19
|
-
const m =
|
|
20
|
-
"k-selected": e.isSelected
|
|
21
|
-
}, e.className), I = N(), u = S(e.id);
|
|
19
|
+
const m = v(h.editTd({ selected: e.isSelected }), e.className), s = T(), u = _(e.id);
|
|
22
20
|
let l = null, n = null;
|
|
23
|
-
const
|
|
21
|
+
const f = a.useCallback(
|
|
24
22
|
(t) => {
|
|
25
23
|
if (e.onChange) {
|
|
26
|
-
const
|
|
24
|
+
const k = t.target.type === "checkbox" ? t.target.checked : t.target.value;
|
|
27
25
|
e.onChange({
|
|
28
26
|
dataItem: e.dataItem,
|
|
29
27
|
dataIndex: e.dataIndex,
|
|
30
28
|
field: e.field,
|
|
31
29
|
syntheticEvent: t,
|
|
32
|
-
value:
|
|
30
|
+
value: k
|
|
33
31
|
});
|
|
34
32
|
}
|
|
35
33
|
},
|
|
36
34
|
[e.onChange, e.dataItem, e.dataIndex, e.field]
|
|
37
35
|
), o = a.useCallback((t) => {
|
|
38
36
|
e.onContextMenu && e.onContextMenu.call(void 0, t, e.dataItem, e.field);
|
|
39
|
-
}, [e.onContextMenu, e.dataItem, e.field]),
|
|
37
|
+
}, [e.onContextMenu, e.dataItem, e.field]), g = a.useCallback(
|
|
40
38
|
(t) => {
|
|
41
39
|
e.onChange && e.onChange({
|
|
42
40
|
dataItem: e.dataItem,
|
|
@@ -61,11 +59,11 @@ const L = (e) => {
|
|
|
61
59
|
role: "gridcell",
|
|
62
60
|
...u
|
|
63
61
|
}, n = /* @__PURE__ */ a.createElement(
|
|
64
|
-
|
|
62
|
+
b,
|
|
65
63
|
{
|
|
66
64
|
value: i === void 0 ? null : i,
|
|
67
|
-
onChange:
|
|
68
|
-
[
|
|
65
|
+
onChange: g,
|
|
66
|
+
[I]: !0
|
|
69
67
|
}
|
|
70
68
|
), d = /* @__PURE__ */ a.createElement(
|
|
71
69
|
"td",
|
|
@@ -88,11 +86,11 @@ const L = (e) => {
|
|
|
88
86
|
role: "gridcell",
|
|
89
87
|
...u
|
|
90
88
|
}, n = /* @__PURE__ */ a.createElement(
|
|
91
|
-
|
|
89
|
+
N,
|
|
92
90
|
{
|
|
93
91
|
value: i,
|
|
94
|
-
onChange:
|
|
95
|
-
[
|
|
92
|
+
onChange: g,
|
|
93
|
+
[I]: !0
|
|
96
94
|
}
|
|
97
95
|
), d = /* @__PURE__ */ a.createElement(
|
|
98
96
|
"td",
|
|
@@ -118,13 +116,13 @@ const L = (e) => {
|
|
|
118
116
|
"input",
|
|
119
117
|
{
|
|
120
118
|
checked: i || !1,
|
|
121
|
-
id:
|
|
119
|
+
id: s,
|
|
122
120
|
type: "checkbox",
|
|
123
121
|
className: "k-checkbox k-checkbox-md k-rounded-md",
|
|
124
|
-
onChange:
|
|
122
|
+
onChange: f
|
|
125
123
|
}
|
|
126
124
|
)),
|
|
127
|
-
/* @__PURE__ */ a.createElement("label", { className: "k-checkbox-label", htmlFor:
|
|
125
|
+
/* @__PURE__ */ a.createElement("label", { className: "k-checkbox-label", htmlFor: s, key: 2 })
|
|
128
126
|
], d = /* @__PURE__ */ a.createElement(
|
|
129
127
|
"td",
|
|
130
128
|
{
|
|
@@ -150,8 +148,8 @@ const L = (e) => {
|
|
|
150
148
|
style: { width: "100%" },
|
|
151
149
|
className: "k-input",
|
|
152
150
|
value: i || "",
|
|
153
|
-
onChange:
|
|
154
|
-
[
|
|
151
|
+
onChange: f,
|
|
152
|
+
[I]: !0
|
|
155
153
|
}
|
|
156
154
|
), d = /* @__PURE__ */ a.createElement(
|
|
157
155
|
"td",
|
|
@@ -161,13 +159,13 @@ const L = (e) => {
|
|
|
161
159
|
n
|
|
162
160
|
);
|
|
163
161
|
}
|
|
164
|
-
const
|
|
162
|
+
const r = e.editor || "text", c = e.cells;
|
|
165
163
|
if (c) {
|
|
166
164
|
let t;
|
|
167
|
-
return c.edit && c.edit[
|
|
165
|
+
return c.edit && c.edit[r] ? t = c.edit[r] : c.data && (t = c.data), /* @__PURE__ */ a.createElement(t, { ...e, tdProps: l }, n);
|
|
168
166
|
}
|
|
169
167
|
return e.render ? e.render.call(void 0, d, e) : d;
|
|
170
168
|
};
|
|
171
169
|
export {
|
|
172
|
-
|
|
170
|
+
B as GridEditCell
|
|
173
171
|
};
|
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 g=require("react"),f=require("@progress/kendo-react-buttons"),l=require("@progress/kendo-react-dropdowns"),c=require("@progress/kendo-react-inputs"),C=require("@progress/kendo-react-dateinputs"),a=require("../messages/index.js"),u=require("@progress/kendo-react-intl"),h=require("@progress/kendo-svg-icons"),p=require("../filterCommon.js"),m=require("@progress/kendo-react-common");function b(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const i=b(g);class d extends i.Component{constructor(e){super(e),this._inputRef=i.createRef(),this.renderOperatorEditor=t=>{if(this.props.filterType==="boolean")return;let s;const r=this.props.operators.find(o=>o.operator===this.props.operator)||null;return i.createElement(l.DropDownList,{ref:o=>s=o,size:this.props.size,value:r,onChange:this.operatorChange,className:"k-dropdown-operator",iconClassName:"k-i-filter k-icon",svgIcon:h.filterIcon,data:this.props.operators,textField:"text",title:t.toLanguageString(a.filterChooseOperator,a.messages[a.filterChooseOperator]),popupSettings:{width:"",onMouseDownOutside:function(o){!o.isAnchorClicked&&o.state&&o.state.props.show&&s&&s.togglePopup()}}})},this.inputChange=this.inputChange.bind(this),this.clear=this.clear.bind(this),this.operatorChange=this.operatorChange.bind(this),this.boolDropdownChange=this.boolDropdownChange.bind(this)}render(){const e=u.provideLocalizationService(this),t=i.createElement("div",{className:"k-filtercell"},i.createElement("div",{className:"k-filtercell-wrapper"},this.filterComponent(this.props.filterType,this.props.value,this.props.booleanValues),i.createElement("div",{className:"k-filtercell-operator"},this.renderOperatorEditor(e)," ",i.createElement(f.Button,{size:this.props.size,icon:"filter-clear",svgIcon:h.filterClearIcon,className:m.classNames({"k-clear-button-visible":!!(!(this.props.value===null||this.props.value==="")||this.props.operator)}),title:e.toLanguageString(a.filterClearButton,a.messages[a.filterClearButton]),type:"button",onClick:this.clear,disabled:!(!(this.props.value===null||this.props.value==="")||this.props.operator)}))));return this.props.render?this.props.render.call(void 0,t,this.props):t}inputChange(e,t){p.cellInputChange(e,t,this.props)}operatorChange(e){p.cellOperatorChange(e,this.props.value,this.props.onChange)}boolDropdownChange(e){p.cellBoolDropdownChange(e,this.props.onChange)}clear(e){e.preventDefault(),this.props.onChange({value:"",operator:"",syntheticEvent:e}),this._inputRef.current&&(this._inputRef.current.element.value="",setTimeout(()=>{this._inputRef.current.element.focus()},0))}filterComponent(e,t,s){switch(e){case"numeric":return i.createElement(c.NumericTextBox,{ref:this._inputRef,size:this.props.size,value:t,onChange:r=>{this.inputChange(r.value,r.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel});case"date":return i.createElement(C.DatePicker,{ref:this._inputRef,size:this.props.size,value:t,onChange:r=>{this.inputChange(r.value,r.syntheticEvent)},title:this.props.title,ariaLabel:this.props.ariaLabel,popupSettings:{onMouseDownOutside:r=>{!r.isAnchorClicked&&r.state&&r.state.props.show&&this._inputRef&&this._inputRef.current.togglePopup()}}});case"boolean":{const r=o=>o==null;return i.createElement(l.DropDownList,{ref:this._inputRef,size:this.props.size,onChange:this.boolDropdownChange,value:s.find(o=>o.operator===(r(t)?"":t)),data:s,textField:"text",title:this.props.title,ariaLabel:this.props.ariaLabel,popupSettings:{onMouseDownOutside:o=>{!o.isAnchorClicked&&o.state&&o.state.props.show&&this._inputRef&&this._inputRef.current.togglePopup()}}})}default:return i.createElement(c.TextBox,{ref:this._inputRef,size:this.props.size,value:t||"",onChange:r=>{this.inputChange(r.target.value,r.syntheticEvent)},title:this.props.title,"aria-label":this.props.ariaLabel})}}}u.registerForLocalization(d);exports.GridFilterCell=d;
|
package/cells/GridFilterCell.mjs
CHANGED
|
@@ -6,36 +6,41 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
9
|
+
import * as o from "react";
|
|
10
10
|
import { Button as h } from "@progress/kendo-react-buttons";
|
|
11
|
-
import { DropDownList as
|
|
11
|
+
import { DropDownList as p } from "@progress/kendo-react-dropdowns";
|
|
12
12
|
import { TextBox as c, NumericTextBox as u } from "@progress/kendo-react-inputs";
|
|
13
|
-
import { DatePicker as
|
|
14
|
-
import { filterChooseOperator as n, messages as
|
|
15
|
-
import { provideLocalizationService as
|
|
16
|
-
import { filterIcon as
|
|
17
|
-
import { cellInputChange as
|
|
13
|
+
import { DatePicker as f } from "@progress/kendo-react-dateinputs";
|
|
14
|
+
import { filterChooseOperator as n, messages as a, filterClearButton as l } from "../messages/index.mjs";
|
|
15
|
+
import { provideLocalizationService as d, registerForLocalization as g } from "@progress/kendo-react-intl";
|
|
16
|
+
import { filterIcon as m, filterClearIcon as C } from "@progress/kendo-svg-icons";
|
|
17
|
+
import { cellInputChange as b, cellOperatorChange as v, cellBoolDropdownChange as w } from "../filterCommon.mjs";
|
|
18
18
|
import { classNames as E } from "@progress/kendo-react-common";
|
|
19
|
-
class
|
|
20
|
-
constructor(
|
|
21
|
-
super(
|
|
19
|
+
class R extends o.Component {
|
|
20
|
+
constructor(r) {
|
|
21
|
+
super(r), this._inputRef = o.createRef(), this.renderOperatorEditor = (i) => {
|
|
22
22
|
if (this.props.filterType === "boolean")
|
|
23
23
|
return;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
let s;
|
|
25
|
+
const e = this.props.operators.find((t) => t.operator === this.props.operator) || null;
|
|
26
|
+
return /* @__PURE__ */ o.createElement(
|
|
27
|
+
p,
|
|
27
28
|
{
|
|
29
|
+
ref: (t) => s = t,
|
|
28
30
|
size: this.props.size,
|
|
29
|
-
value:
|
|
31
|
+
value: e,
|
|
30
32
|
onChange: this.operatorChange,
|
|
31
33
|
className: "k-dropdown-operator",
|
|
32
34
|
iconClassName: "k-i-filter k-icon",
|
|
33
|
-
svgIcon:
|
|
35
|
+
svgIcon: m,
|
|
34
36
|
data: this.props.operators,
|
|
35
37
|
textField: "text",
|
|
36
|
-
title:
|
|
38
|
+
title: i.toLanguageString(n, a[n]),
|
|
37
39
|
popupSettings: {
|
|
38
|
-
width: ""
|
|
40
|
+
width: "",
|
|
41
|
+
onMouseDownOutside: function(t) {
|
|
42
|
+
!t.isAnchorClicked && t.state && t.state.props.show && s && s.togglePopup();
|
|
43
|
+
}
|
|
39
44
|
}
|
|
40
45
|
}
|
|
41
46
|
);
|
|
@@ -45,7 +50,7 @@ class L extends i.Component {
|
|
|
45
50
|
* @hidden
|
|
46
51
|
*/
|
|
47
52
|
render() {
|
|
48
|
-
const
|
|
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(
|
|
49
54
|
h,
|
|
50
55
|
{
|
|
51
56
|
size: this.props.size,
|
|
@@ -54,83 +59,93 @@ class L extends i.Component {
|
|
|
54
59
|
className: E({
|
|
55
60
|
"k-clear-button-visible": !!(!(this.props.value === null || this.props.value === "") || this.props.operator)
|
|
56
61
|
}),
|
|
57
|
-
title:
|
|
62
|
+
title: r.toLanguageString(l, a[l]),
|
|
58
63
|
type: "button",
|
|
59
64
|
onClick: this.clear,
|
|
60
65
|
disabled: !(!(this.props.value === null || this.props.value === "") || this.props.operator)
|
|
61
66
|
}
|
|
62
67
|
))));
|
|
63
|
-
return this.props.render ? this.props.render.call(void 0,
|
|
68
|
+
return this.props.render ? this.props.render.call(void 0, i, this.props) : i;
|
|
64
69
|
}
|
|
65
|
-
inputChange(
|
|
66
|
-
|
|
70
|
+
inputChange(r, i) {
|
|
71
|
+
b(r, i, this.props);
|
|
67
72
|
}
|
|
68
|
-
operatorChange(
|
|
69
|
-
|
|
73
|
+
operatorChange(r) {
|
|
74
|
+
v(r, this.props.value, this.props.onChange);
|
|
70
75
|
}
|
|
71
|
-
boolDropdownChange(
|
|
72
|
-
|
|
76
|
+
boolDropdownChange(r) {
|
|
77
|
+
w(r, this.props.onChange);
|
|
73
78
|
}
|
|
74
|
-
clear(
|
|
75
|
-
|
|
79
|
+
clear(r) {
|
|
80
|
+
r.preventDefault(), this.props.onChange({ value: "", operator: "", syntheticEvent: r }), this._inputRef.current && (this._inputRef.current.element.value = "", setTimeout(() => {
|
|
76
81
|
this._inputRef.current.element.focus();
|
|
77
82
|
}, 0));
|
|
78
83
|
}
|
|
79
|
-
filterComponent(
|
|
80
|
-
switch (
|
|
84
|
+
filterComponent(r, i, s) {
|
|
85
|
+
switch (r) {
|
|
81
86
|
case "numeric":
|
|
82
|
-
return /* @__PURE__ */
|
|
87
|
+
return /* @__PURE__ */ o.createElement(
|
|
83
88
|
u,
|
|
84
89
|
{
|
|
85
90
|
ref: this._inputRef,
|
|
86
91
|
size: this.props.size,
|
|
87
|
-
value:
|
|
88
|
-
onChange: (
|
|
89
|
-
this.inputChange(
|
|
92
|
+
value: i,
|
|
93
|
+
onChange: (e) => {
|
|
94
|
+
this.inputChange(e.value, e.syntheticEvent);
|
|
90
95
|
},
|
|
91
96
|
title: this.props.title,
|
|
92
97
|
ariaLabel: this.props.ariaLabel
|
|
93
98
|
}
|
|
94
99
|
);
|
|
95
100
|
case "date":
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
-
|
|
101
|
+
return /* @__PURE__ */ o.createElement(
|
|
102
|
+
f,
|
|
98
103
|
{
|
|
99
104
|
ref: this._inputRef,
|
|
100
105
|
size: this.props.size,
|
|
101
|
-
value:
|
|
102
|
-
onChange: (
|
|
103
|
-
this.inputChange(
|
|
106
|
+
value: i,
|
|
107
|
+
onChange: (e) => {
|
|
108
|
+
this.inputChange(e.value, e.syntheticEvent);
|
|
104
109
|
},
|
|
105
110
|
title: this.props.title,
|
|
106
|
-
ariaLabel: this.props.ariaLabel
|
|
111
|
+
ariaLabel: this.props.ariaLabel,
|
|
112
|
+
popupSettings: {
|
|
113
|
+
onMouseDownOutside: (e) => {
|
|
114
|
+
!e.isAnchorClicked && e.state && e.state.props.show && this._inputRef && this._inputRef.current.togglePopup();
|
|
115
|
+
}
|
|
116
|
+
}
|
|
107
117
|
}
|
|
108
118
|
);
|
|
109
119
|
case "boolean": {
|
|
110
|
-
const
|
|
111
|
-
return /* @__PURE__ */
|
|
112
|
-
|
|
120
|
+
const e = (t) => t == null;
|
|
121
|
+
return /* @__PURE__ */ o.createElement(
|
|
122
|
+
p,
|
|
113
123
|
{
|
|
114
124
|
ref: this._inputRef,
|
|
115
125
|
size: this.props.size,
|
|
116
126
|
onChange: this.boolDropdownChange,
|
|
117
|
-
value:
|
|
118
|
-
data:
|
|
127
|
+
value: s.find((t) => t.operator === (e(i) ? "" : i)),
|
|
128
|
+
data: s,
|
|
119
129
|
textField: "text",
|
|
120
130
|
title: this.props.title,
|
|
121
|
-
ariaLabel: this.props.ariaLabel
|
|
131
|
+
ariaLabel: this.props.ariaLabel,
|
|
132
|
+
popupSettings: {
|
|
133
|
+
onMouseDownOutside: (t) => {
|
|
134
|
+
!t.isAnchorClicked && t.state && t.state.props.show && this._inputRef && this._inputRef.current.togglePopup();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
122
137
|
}
|
|
123
138
|
);
|
|
124
139
|
}
|
|
125
140
|
default:
|
|
126
|
-
return /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ o.createElement(
|
|
127
142
|
c,
|
|
128
143
|
{
|
|
129
144
|
ref: this._inputRef,
|
|
130
145
|
size: this.props.size,
|
|
131
|
-
value:
|
|
132
|
-
onChange: (
|
|
133
|
-
this.inputChange(
|
|
146
|
+
value: i || "",
|
|
147
|
+
onChange: (e) => {
|
|
148
|
+
this.inputChange(e.target.value, e.syntheticEvent);
|
|
134
149
|
},
|
|
135
150
|
title: this.props.title,
|
|
136
151
|
"aria-label": this.props.ariaLabel
|
|
@@ -139,7 +154,7 @@ class L extends i.Component {
|
|
|
139
154
|
}
|
|
140
155
|
}
|
|
141
156
|
}
|
|
142
|
-
|
|
157
|
+
g(R);
|
|
143
158
|
export {
|
|
144
|
-
|
|
159
|
+
R as GridFilterCell
|
|
145
160
|
};
|
|
@@ -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 N=require("react"),d=require("@progress/kendo-react-inputs"),x=require("@progress/kendo-react-common"),B=require("@progress/kendo-svg-icons"),g=require("@progress/kendo-react-buttons"),L=require("@progress/kendo-react-intl"),o=require("../messages/index.js");function R(n){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const i in n)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(a,i,r.get?r:{enumerable:!0,get:()=>n[i]})}}return a.default=n,Object.freeze(a)}const t=R(N),h=n=>{const[a,i]=t.useState(""),r=n.columns.reduce((e,l)=>({...e,[l.id||""]:!!n.columnsState.find(s=>s.id===l.id)}),{}),[c,k]=t.useState(r),b=t.useMemo(()=>n.columns.filter(e=>{var l;return(l=e.title||e.field)==null?void 0:l.toLowerCase().includes(a.toLowerCase())}),[n.columns,a]),C=L.useLocalization(),S=t.useCallback(()=>{const e=n.columns.filter(l=>c[l.id||""]);n.onColumnsChange.call(void 0,e),n.onCloseMenu.call(void 0)},[c,n.columns,n.onColumnsChange,n.onCloseMenu]),E=()=>{k(r)},u=t.useMemo(()=>Object.values(c).filter(e=>e).length,[c]),m=t.useMemo(()=>u===n.columns.length,[n.columns,u]),y=t.useCallback(()=>{const e={...c};Object.keys(e).forEach((l,s)=>e[l]=m&&s===0?!0:!m),k(e)},[c,m]),v=t.useCallback((e,l)=>{const s={...c};s[l||""]=e,k(s)},[c]),M=e=>{i(String(e.target.value))};return t.createElement("form",{className:"k-filter-menu"},t.createElement("div",{className:"k-filter-menu-container"},t.createElement(d.TextBox,{className:"k-searchbox",value:a,onChange:M,prefix:()=>t.createElement(d.InputPrefix,null,t.createElement(x.IconWrap,{name:"search",icon:B.searchIcon}))}),t.createElement("ul",{className:"k-reset k-multicheck-wrap"},!a&&t.createElement("li",{className:"k-item k-check-all-wrap"},t.createElement(d.Checkbox,{checked:m,onChange:y,label:C.toLanguageString(o.filterSelectAll,o.messages[o.filterSelectAll])})),b.map((e,l)=>t.createElement("li",{key:e.id,className:"k-item"},t.createElement(d.Checkbox,{disabled:c[e.id||""]&&u===1,checked:c[e.id||""],onChange:s=>{var f;return v(!!((f=s.target.element)!=null&&f.checked),e.id)},label:e.title||e.field})))),t.createElement("div",{className:"k-filter-selected-items"},u," selected items"),t.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal"},t.createElement(g.Button,{type:"button",themeColor:"primary",onClick:S},C.toLanguageString(o.filterApplyButton,o.messages[o.filterApplyButton])),t.createElement(g.Button,{type:"button",onClick:E},C.toLanguageString(o.filterResetButton,o.messages[o.filterResetButton])))))};h.displayName="GridColumnMenuColumnsList";exports.GridColumnMenuColumnsList=h;
|