@progress/kendo-react-grid 9.0.0-develop.9 → 9.0.1-develop.1
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/VirtualScroll.js +1 -1
- package/VirtualScroll.mjs +53 -51
- package/VirtualScrollFixed.js +1 -1
- package/VirtualScrollFixed.mjs +16 -14
- package/cells/GridFilterCell.js +1 -1
- package/cells/GridFilterCell.mjs +99 -113
- package/columnMenu/GridColumnMenuCheckboxFilter.js +1 -1
- package/columnMenu/GridColumnMenuCheckboxFilter.mjs +132 -178
- package/columnMenu/GridColumnMenuFilter.js +1 -1
- package/columnMenu/GridColumnMenuFilter.mjs +123 -156
- package/columnMenu/GridColumnMenuFilterCell.js +1 -1
- package/columnMenu/GridColumnMenuFilterCell.mjs +42 -53
- package/columnMenu/GridColumnMenuFilterUI.js +1 -1
- package/columnMenu/GridColumnMenuFilterUI.mjs +15 -17
- 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/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnDraggable.js +1 -1
- package/drag/ColumnDraggable.mjs +34 -45
- package/drag/GroupingIndicator.js +1 -1
- package/drag/GroupingIndicator.mjs +51 -69
- package/footer/Footer.js +1 -1
- package/footer/Footer.mjs +40 -57
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +70 -78
- package/header/GridHeaderSelectionCell.js +1 -1
- package/header/GridHeaderSelectionCell.mjs +28 -37
- package/header/GroupPanel.js +1 -1
- package/header/GroupPanel.mjs +43 -49
- package/header/Header.js +1 -1
- package/header/Header.mjs +70 -89
- package/index.d.mts +261 -725
- package/index.d.ts +261 -725
- package/index.js +1 -1
- package/index.mjs +78 -80
- package/package-metadata.mjs +1 -1
- package/package.json +11 -11
- package/rows/GridDetailRow.js +1 -1
- package/rows/GridDetailRow.mjs +2 -10
package/drag/ColumnDraggable.mjs
CHANGED
|
@@ -6,52 +6,41 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
import * as a from "react";
|
|
10
|
+
import { useUnstyled as d, uGrid as u, Draggable as m, classNames as f } from "@progress/kendo-react-common";
|
|
11
|
+
const R = (e) => {
|
|
12
|
+
const n = a.useRef(null), c = (t) => {
|
|
13
|
+
const r = n.current && n.current.element;
|
|
14
|
+
r && e.pressHandler && e.pressHandler(t.event, r);
|
|
15
|
+
}, s = (t) => {
|
|
16
|
+
const r = n.current && n.current.element;
|
|
17
|
+
r && e.dragHandler && e.dragHandler(t.event, r);
|
|
18
|
+
}, o = (t) => {
|
|
19
|
+
n.current && n.current.element && e.releaseHandler && e.releaseHandler(t.event);
|
|
20
|
+
}, l = d(), i = l && l.uGrid ? l.uGrid : u;
|
|
21
|
+
return /* @__PURE__ */ a.createElement(
|
|
22
|
+
m,
|
|
23
|
+
{
|
|
24
|
+
onPress: c,
|
|
25
|
+
onDrag: s,
|
|
26
|
+
onRelease: o,
|
|
27
|
+
hint: e.dragClue,
|
|
28
|
+
autoScroll: { boundaryElementRef: e.headerRef, direction: { horizontal: !0, vertical: !1 } },
|
|
29
|
+
scrollContainer: e.containerRef || void 0,
|
|
30
|
+
ref: n
|
|
31
|
+
},
|
|
32
|
+
/* @__PURE__ */ a.createElement(
|
|
33
|
+
"tr",
|
|
27
34
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
autoScroll: {
|
|
33
|
-
boundaryElementRef: this.props.headerRef,
|
|
34
|
-
direction: { horizontal: !0, vertical: !1 }
|
|
35
|
-
},
|
|
36
|
-
scrollContainer: this.props.containerRef || void 0,
|
|
37
|
-
ref: (e) => {
|
|
38
|
-
this.draggable = e;
|
|
39
|
-
}
|
|
35
|
+
className: f(i.simpleTr({})),
|
|
36
|
+
style: { touchAction: "none" },
|
|
37
|
+
role: "row",
|
|
38
|
+
"aria-rowindex": e.ariaRowIndex
|
|
40
39
|
},
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
style: { touchAction: "none" },
|
|
46
|
-
role: "row",
|
|
47
|
-
"aria-rowindex": this.props.ariaRowIndex
|
|
48
|
-
},
|
|
49
|
-
this.props.children
|
|
50
|
-
)
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
i.contextType = o;
|
|
40
|
+
e.children
|
|
41
|
+
)
|
|
42
|
+
);
|
|
43
|
+
};
|
|
55
44
|
export {
|
|
56
|
-
|
|
45
|
+
R as ColumnDraggable
|
|
57
46
|
};
|
|
@@ -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"),l=require("@progress/kendo-react-common"),i=require("@progress/kendo-svg-icons");function h(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const c=h(b),y=e=>{const t=c.useRef(null),a=n=>{const o=t.current&&t.current.element;o&&e.onPress&&e.onPress(n.event,o)},r=n=>{const o=t.current&&t.current.element;o&&e.onDrag&&e.onDrag(n.event,o)},m=n=>{t.current&&t.current.element&&e.onRelease&&e.onRelease(n.event)},u=n=>{if(n.preventDefault(),e.onSortChange){const o=e.dir==="asc"?"desc":"asc";e.onSortChange(n,o)}},d=n=>{(n.keyCode===l.Keys.delete||n.keyCode===l.Keys.backspace)&&(n.preventDefault(),n.stopPropagation(),e.onRemove&&e.onRemove(n))},f=n=>{n.preventDefault(),n.stopPropagation(),e.onRemove&&e.onRemove(n)},g=n=>{const o={title:e.title,dir:e.dir,index:e.index};e.onContextMenu&&e.onContextMenu.call(void 0,n,{dataItem:{...o}})},{dir:s,title:k}=e;return c.createElement(l.Draggable,{onPress:a,onDrag:r,onRelease:m,ref:t},c.createElement("div",{className:"k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md",onClick:u,onContextMenu:g,onKeyDown:d,tabIndex:0,role:"button",style:{touchAction:"none"}},c.createElement("span",null,c.createElement(l.IconWrap,{name:"sort-"+s+"-small",icon:s==="asc"?i.sortAscSmallIcon:i.sortDescSmallIcon,size:"small"})),c.createElement("span",{className:"k-chip-content"},k),c.createElement("span",{className:"k-chip-actions"},c.createElement("span",{className:"k-chip-action k-chip-remove-action",onClick:f},c.createElement(l.IconWrap,{name:"x-circle",icon:i.xCircleIcon,size:"small"})))))};exports.GroupingIndicator=y;
|
|
@@ -6,76 +6,58 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
dir: this.props.dir,
|
|
36
|
-
index: this.props.index
|
|
37
|
-
};
|
|
38
|
-
this.props.onContextMenu && this.props.onContextMenu.call(void 0, e, { dataItem: { ...t } });
|
|
9
|
+
import * as o from "react";
|
|
10
|
+
import { Draggable as h, IconWrap as l, Keys as i } from "@progress/kendo-react-common";
|
|
11
|
+
import { sortAscSmallIcon as C, sortDescSmallIcon as D, xCircleIcon as R } from "@progress/kendo-svg-icons";
|
|
12
|
+
const I = (n) => {
|
|
13
|
+
const c = o.useRef(null), s = (e) => {
|
|
14
|
+
const t = c.current && c.current.element;
|
|
15
|
+
t && n.onPress && n.onPress(e.event, t);
|
|
16
|
+
}, r = (e) => {
|
|
17
|
+
const t = c.current && c.current.element;
|
|
18
|
+
t && n.onDrag && n.onDrag(e.event, t);
|
|
19
|
+
}, m = (e) => {
|
|
20
|
+
c.current && c.current.element && n.onRelease && n.onRelease(e.event);
|
|
21
|
+
}, d = (e) => {
|
|
22
|
+
if (e.preventDefault(), n.onSortChange) {
|
|
23
|
+
const t = n.dir === "asc" ? "desc" : "asc";
|
|
24
|
+
n.onSortChange(e, t);
|
|
25
|
+
}
|
|
26
|
+
}, u = (e) => {
|
|
27
|
+
(e.keyCode === i.delete || e.keyCode === i.backspace) && (e.preventDefault(), e.stopPropagation(), n.onRemove && n.onRemove(e));
|
|
28
|
+
}, f = (e) => {
|
|
29
|
+
e.preventDefault(), e.stopPropagation(), n.onRemove && n.onRemove(e);
|
|
30
|
+
}, g = (e) => {
|
|
31
|
+
const t = {
|
|
32
|
+
title: n.title,
|
|
33
|
+
dir: n.dir,
|
|
34
|
+
index: n.index
|
|
39
35
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
n.onContextMenu && n.onContextMenu.call(void 0, e, { dataItem: { ...t } });
|
|
37
|
+
}, { dir: a, title: k } = n;
|
|
38
|
+
return /* @__PURE__ */ o.createElement(h, { onPress: s, onDrag: r, onRelease: m, ref: c }, /* @__PURE__ */ o.createElement(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: "k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md",
|
|
42
|
+
onClick: d,
|
|
43
|
+
onContextMenu: g,
|
|
44
|
+
onKeyDown: u,
|
|
45
|
+
tabIndex: 0,
|
|
46
|
+
role: "button",
|
|
47
|
+
style: { touchAction: "none" }
|
|
48
|
+
},
|
|
49
|
+
/* @__PURE__ */ o.createElement("span", null, /* @__PURE__ */ o.createElement(
|
|
50
|
+
l,
|
|
45
51
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
className: "k-chip k-chip-md k-chip-solid k-chip-solid-base k-rounded-md",
|
|
57
|
-
onClick: this.sortChange,
|
|
58
|
-
onContextMenu: this.onContextMenu,
|
|
59
|
-
onKeyDown: this.handleKeyDown,
|
|
60
|
-
tabIndex: 0,
|
|
61
|
-
role: "button",
|
|
62
|
-
style: { touchAction: "none" }
|
|
63
|
-
},
|
|
64
|
-
/* @__PURE__ */ s.createElement("span", null, /* @__PURE__ */ s.createElement(
|
|
65
|
-
n,
|
|
66
|
-
{
|
|
67
|
-
name: "sort-" + e + "-small",
|
|
68
|
-
icon: e === "asc" ? a : p,
|
|
69
|
-
size: "small"
|
|
70
|
-
}
|
|
71
|
-
)),
|
|
72
|
-
/* @__PURE__ */ s.createElement("span", { className: "k-chip-content" }, this.props.title),
|
|
73
|
-
/* @__PURE__ */ s.createElement("span", { className: "k-chip-actions" }, /* @__PURE__ */ s.createElement("span", { className: "k-chip-action k-chip-remove-action", onClick: this.groupRemove }, /* @__PURE__ */ s.createElement(n, { name: "x-circle", icon: l, size: "small" })))
|
|
74
|
-
)
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
r(c);
|
|
52
|
+
name: "sort-" + a + "-small",
|
|
53
|
+
icon: a === "asc" ? C : D,
|
|
54
|
+
size: "small"
|
|
55
|
+
}
|
|
56
|
+
)),
|
|
57
|
+
/* @__PURE__ */ o.createElement("span", { className: "k-chip-content" }, k),
|
|
58
|
+
/* @__PURE__ */ o.createElement("span", { className: "k-chip-actions" }, /* @__PURE__ */ o.createElement("span", { className: "k-chip-action k-chip-remove-action", onClick: f }, /* @__PURE__ */ o.createElement(l, { name: "x-circle", icon: R, size: "small" })))
|
|
59
|
+
));
|
|
60
|
+
};
|
|
79
61
|
export {
|
|
80
|
-
|
|
62
|
+
I as GroupingIndicator
|
|
81
63
|
};
|
package/footer/Footer.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 s=require("react"),n=require("@progress/kendo-react-common");function i(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return a.default=e,Object.freeze(a)}const t=i(s),c=t.forwardRef((e,a)=>{const r=t.useRef(null),o=t.useRef(null);return t.useImperativeHandle(a,()=>({setScrollLeft:l=>{r.current&&(r.current.scrollLeft=l)},setWidth:l=>{o.current&&(o.current.style.width=l+"px")}})),e.staticHeaders?t.createElement("div",{className:"k-grid-footer",role:"presentation"},t.createElement("div",{ref:r,className:"k-grid-footer-wrap",style:e.hasScrollbarWidth?{}:{borderWidth:0},role:"presentation"},t.createElement("table",{ref:o,className:n.classNames("k-table k-grid-footer-table",{"k-table-md":!e.size,[`k-table-${n.kendoThemeMaps.sizeMap[e.size]||e.size}`]:e.size},e.className),role:"presentation"},t.createElement("colgroup",{ref:l=>{e.columnResize.colGroupFooter=l},role:"presentation"},e.cols),t.createElement("tfoot",{className:"k-table-tfoot",role:"presentation"},e.row)))):t.createElement("tfoot",{className:"k-table-tfoot"},e.row)});c.displayName="KendoReactFooter";exports.Footer=c;
|
package/footer/Footer.mjs
CHANGED
|
@@ -7,70 +7,53 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import { classNames as s, kendoThemeMaps as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.table && (this.table.style.width = e + "px");
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
return this.props.staticHeaders ? /* @__PURE__ */ t.createElement("div", { className: "k-grid-footer", role: "presentation" }, /* @__PURE__ */ t.createElement(
|
|
34
|
-
"div",
|
|
10
|
+
import { classNames as s, kendoThemeMaps as n } from "@progress/kendo-react-common";
|
|
11
|
+
const c = t.forwardRef((e, o) => {
|
|
12
|
+
const a = t.useRef(null), l = t.useRef(null);
|
|
13
|
+
return t.useImperativeHandle(o, () => ({
|
|
14
|
+
setScrollLeft: (r) => {
|
|
15
|
+
a.current && (a.current.scrollLeft = r);
|
|
16
|
+
},
|
|
17
|
+
setWidth: (r) => {
|
|
18
|
+
l.current && (l.current.style.width = r + "px");
|
|
19
|
+
}
|
|
20
|
+
})), e.staticHeaders ? /* @__PURE__ */ t.createElement("div", { className: "k-grid-footer", role: "presentation" }, /* @__PURE__ */ t.createElement(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref: a,
|
|
24
|
+
className: "k-grid-footer-wrap",
|
|
25
|
+
style: e.hasScrollbarWidth ? {} : { borderWidth: 0 },
|
|
26
|
+
role: "presentation"
|
|
27
|
+
},
|
|
28
|
+
/* @__PURE__ */ t.createElement(
|
|
29
|
+
"table",
|
|
35
30
|
{
|
|
36
|
-
ref:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
ref: l,
|
|
32
|
+
className: s(
|
|
33
|
+
"k-table k-grid-footer-table",
|
|
34
|
+
{
|
|
35
|
+
"k-table-md": !e.size,
|
|
36
|
+
[`k-table-${n.sizeMap[e.size] || e.size}`]: e.size
|
|
37
|
+
},
|
|
38
|
+
e.className
|
|
39
|
+
),
|
|
41
40
|
role: "presentation"
|
|
42
41
|
},
|
|
43
42
|
/* @__PURE__ */ t.createElement(
|
|
44
|
-
"
|
|
43
|
+
"colgroup",
|
|
45
44
|
{
|
|
46
|
-
ref: (
|
|
47
|
-
|
|
45
|
+
ref: (r) => {
|
|
46
|
+
e.columnResize.colGroupFooter = r;
|
|
48
47
|
},
|
|
49
|
-
className: s(
|
|
50
|
-
"k-table k-grid-footer-table",
|
|
51
|
-
{
|
|
52
|
-
"k-table-md": !this.props.size,
|
|
53
|
-
[`k-table-${r.sizeMap[this.props.size] || this.props.size}`]: this.props.size
|
|
54
|
-
},
|
|
55
|
-
this.props.className
|
|
56
|
-
),
|
|
57
48
|
role: "presentation"
|
|
58
49
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
this.props.cols
|
|
68
|
-
),
|
|
69
|
-
/* @__PURE__ */ t.createElement("tfoot", { className: "k-table-tfoot", role: "presentation" }, this.props.row)
|
|
70
|
-
)
|
|
71
|
-
)) : /* @__PURE__ */ t.createElement("tfoot", { className: "k-table-tfoot" }, this.props.row);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
50
|
+
e.cols
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ t.createElement("tfoot", { className: "k-table-tfoot", role: "presentation" }, e.row)
|
|
53
|
+
)
|
|
54
|
+
)) : /* @__PURE__ */ t.createElement("tfoot", { className: "k-table-tfoot" }, e.row);
|
|
55
|
+
});
|
|
56
|
+
c.displayName = "KendoReactFooter";
|
|
74
57
|
export {
|
|
75
|
-
|
|
58
|
+
c as Footer
|
|
76
59
|
};
|
package/header/FilterRow.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 T=require("react"),O=require("@progress/kendo-react-intl"),S=require("../cells/GridFilterCell.js"),u=require("../filterCommon.js"),k=require("@progress/kendo-react-data-tools"),v=require("../messages/index.js"),m=require("@progress/kendo-react-common"),q=require("../utils/index.js");function w(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const g=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(a,n,g.get?g:{enumerable:!0,get:()=>t[n]})}}return a.default=t,Object.freeze(a)}const d=w(T),y="k-table-row k-filter-row",_=t=>{const a=O.useLocalization(),n=(e,r)=>{let l=`${r?"k-grid-header-sticky":""}`;return t.sort&&t.sort.filter(o=>o.field===e).length>0&&(l+=" k-sorted"),l},g=(e,r,l,o)=>{if(!t.filterChange)return;const i=[];(e!==""&&e!==null||r!=="")&&i.push({field:l,operator:r,value:e}),t.filter&&t.filter.filters&&(t.filter.filters||[]).forEach(b=>{const c=b;c&&c.field!==l&&i.push(c)});const s=t.filter&&t.filter.logic?t.filter.logic:"and";t.filterChange(i.length>0?{logic:s,filters:i}:null,o)},x=t.filter&&t.filter.filters||[],L=e=>{if(e===void 0)return;const r=x.filter(l=>l.field===e);return r.length?r[0]:void 0};let E=0,F=-1;const I=t.columns.filter(e=>e.children.length===0).map(e=>{const r=u.getFilterType(e.filter),l=L(e.field),o=`${e.field} ${a.toLanguageString(v.filterAriaLabel,v.messages[v.filterAriaLabel])}`;let i=l&&l.value;i===void 0&&(i=r==="text"?"":null);const s=e.filterable&&{render:t.cellRender,field:e.field,title:e.filterTitle,value:i,operator:l&&l.operator,operators:u.operatorMap(t.filterOperators[r]||[],a),booleanValues:u.operatorMap(u.booleanFilterValues,a),filterType:r,ariaLabel:o,onChange:f=>{g(f.value,f.operator,e.field,f.syntheticEvent)}},C=e.declarationIndex>=0?++F:--E,b=e.left!==void 0?t.isRtl?{left:e.right,right:e.left}:{left:e.left,right:e.right}:{},c={columnId:k.tableKeyboardNavigationTools.getFilterColumnId(e.id),navigatable:e.navigatable||t.navigatable,style:b,className:m.classNames("k-table-td",n(e.field,e.locked)||void 0),role:"gridcell",ariaLabel:o,ariaColumnIndex:e.ariaColumnIndex},R=s&&(e.filterCell?d.createElement(e.filterCell,{...s}):d.createElement(S.GridFilterCell,{size:t.size,...s})),h=q.resolveCells(t.cells,e.cells);if(h&&h.filterCell){const f=h.filterCell;return d.createElement(f,{key:C,...s,tdProps:c,index:F},R)}return d.createElement(k.HeaderTdElement,{key:C,...c},R)});return d.createElement("tr",{className:y,"aria-rowindex":t.ariaRowIndex,role:"row"},I)};exports.FILTER_ROW_CLASS=y;exports.FilterRow=_;
|
package/header/FilterRow.mjs
CHANGED
|
@@ -6,87 +6,79 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import {
|
|
11
|
-
import { GridFilterCell as
|
|
12
|
-
import { getFilterType as
|
|
13
|
-
import { tableKeyboardNavigationTools as
|
|
14
|
-
import { filterAriaLabel as
|
|
15
|
-
import { classNames as
|
|
16
|
-
import { resolveCells as
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
setFilter(r, o, l, n) {
|
|
24
|
-
if (!this.props.filterChange)
|
|
9
|
+
import * as s from "react";
|
|
10
|
+
import { useLocalization as L } from "@progress/kendo-react-intl";
|
|
11
|
+
import { GridFilterCell as y } from "../cells/GridFilterCell.mjs";
|
|
12
|
+
import { getFilterType as R, operatorMap as v, booleanFilterValues as w } from "../filterCommon.mjs";
|
|
13
|
+
import { tableKeyboardNavigationTools as T, HeaderTdElement as N } from "@progress/kendo-react-data-tools";
|
|
14
|
+
import { filterAriaLabel as F, messages as z } from "../messages/index.mjs";
|
|
15
|
+
import { classNames as A } from "@progress/kendo-react-common";
|
|
16
|
+
import { resolveCells as S } from "../utils/index.mjs";
|
|
17
|
+
const $ = "k-table-row k-filter-row", M = (t) => {
|
|
18
|
+
const d = L(), b = (e, r) => {
|
|
19
|
+
let l = `${r ? "k-grid-header-sticky" : ""}`;
|
|
20
|
+
return t.sort && t.sort.filter((a) => a.field === e).length > 0 && (l += " k-sorted"), l;
|
|
21
|
+
}, x = (e, r, l, a) => {
|
|
22
|
+
if (!t.filterChange)
|
|
25
23
|
return;
|
|
26
|
-
const
|
|
27
|
-
(
|
|
24
|
+
const i = [];
|
|
25
|
+
(e !== "" && e !== null || r !== "") && i.push({
|
|
28
26
|
field: l,
|
|
29
|
-
operator:
|
|
30
|
-
value:
|
|
31
|
-
}),
|
|
32
|
-
const
|
|
33
|
-
|
|
27
|
+
operator: r,
|
|
28
|
+
value: e
|
|
29
|
+
}), t.filter && t.filter.filters && (t.filter.filters || []).forEach((g) => {
|
|
30
|
+
const n = g;
|
|
31
|
+
n && n.field !== l && i.push(n);
|
|
34
32
|
});
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}, C = e.declarationIndex >= 0 ? ++s : --n, x = {
|
|
66
|
-
ariaLabel: g,
|
|
67
|
-
ariaColumnIndex: e.ariaColumnIndex
|
|
68
|
-
}, E = e.left !== void 0 ? this.props.isRtl ? { left: e.right, right: e.left } : { left: e.left, right: e.right } : {}, m = {
|
|
69
|
-
columnId: R.getFilterColumnId(e.id),
|
|
70
|
-
navigatable: e.navigatable || this.props.navigatable,
|
|
71
|
-
style: E,
|
|
72
|
-
className: T(
|
|
73
|
-
"k-table-th",
|
|
74
|
-
this.headerCellClassName(e.field, e.locked) || void 0
|
|
75
|
-
),
|
|
76
|
-
role: "columnheader",
|
|
77
|
-
...x
|
|
78
|
-
}, v = f && (e.filterCell ? /* @__PURE__ */ a.createElement(e.filterCell, { ...f }) : /* @__PURE__ */ a.createElement(I, { size: this.props.size, ...f })), c = z(this.props.cells, e.cells);
|
|
79
|
-
if (c && c.filterCell) {
|
|
80
|
-
const p = c.filterCell;
|
|
81
|
-
return /* @__PURE__ */ a.createElement(p, { key: C, ...f, thProps: m, index: s }, v);
|
|
33
|
+
const o = t.filter && t.filter.logic ? t.filter.logic : "and";
|
|
34
|
+
t.filterChange(i.length > 0 ? { logic: o, filters: i } : null, a);
|
|
35
|
+
}, E = t.filter && t.filter.filters || [], k = (e) => {
|
|
36
|
+
if (e === void 0)
|
|
37
|
+
return;
|
|
38
|
+
const r = E.filter(
|
|
39
|
+
(l) => l.field === e
|
|
40
|
+
);
|
|
41
|
+
return r.length ? r[0] : void 0;
|
|
42
|
+
};
|
|
43
|
+
let u = 0, h = -1;
|
|
44
|
+
const I = t.columns.filter((e) => e.children.length === 0).map((e) => {
|
|
45
|
+
const r = R(e.filter), l = k(e.field), a = `${e.field} ${d.toLanguageString(
|
|
46
|
+
F,
|
|
47
|
+
z[F]
|
|
48
|
+
)}`;
|
|
49
|
+
let i = l && l.value;
|
|
50
|
+
i === void 0 && (i = r === "text" ? "" : null);
|
|
51
|
+
const o = e.filterable && {
|
|
52
|
+
render: t.cellRender,
|
|
53
|
+
field: e.field,
|
|
54
|
+
title: e.filterTitle,
|
|
55
|
+
value: i,
|
|
56
|
+
operator: l && l.operator,
|
|
57
|
+
operators: v(t.filterOperators[r] || [], d),
|
|
58
|
+
booleanValues: v(w, d),
|
|
59
|
+
filterType: r,
|
|
60
|
+
ariaLabel: a,
|
|
61
|
+
onChange: (f) => {
|
|
62
|
+
x(f.value, f.operator, e.field, f.syntheticEvent);
|
|
82
63
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
64
|
+
}, c = e.declarationIndex >= 0 ? ++h : --u, g = e.left !== void 0 ? t.isRtl ? { left: e.right, right: e.left } : { left: e.left, right: e.right } : {}, n = {
|
|
65
|
+
columnId: T.getFilterColumnId(e.id),
|
|
66
|
+
navigatable: e.navigatable || t.navigatable,
|
|
67
|
+
style: g,
|
|
68
|
+
className: A("k-table-td", b(e.field, e.locked) || void 0),
|
|
69
|
+
role: "gridcell",
|
|
70
|
+
ariaLabel: a,
|
|
71
|
+
ariaColumnIndex: e.ariaColumnIndex
|
|
72
|
+
}, m = o && (e.filterCell ? /* @__PURE__ */ s.createElement(e.filterCell, { ...o }) : /* @__PURE__ */ s.createElement(y, { size: t.size, ...o })), C = S(t.cells, e.cells);
|
|
73
|
+
if (C && C.filterCell) {
|
|
74
|
+
const f = C.filterCell;
|
|
75
|
+
return /* @__PURE__ */ s.createElement(f, { key: c, ...o, tdProps: n, index: h }, m);
|
|
76
|
+
}
|
|
77
|
+
return /* @__PURE__ */ s.createElement(N, { key: c, ...n }, m);
|
|
78
|
+
});
|
|
79
|
+
return /* @__PURE__ */ s.createElement("tr", { className: $, "aria-rowindex": t.ariaRowIndex, role: "row" }, I);
|
|
80
|
+
};
|
|
89
81
|
export {
|
|
90
|
-
|
|
91
|
-
|
|
82
|
+
$ as FILTER_ROW_CLASS,
|
|
83
|
+
M as FilterRow
|
|
92
84
|
};
|
|
@@ -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 u=require("react"),d=require("../columnMenu/GridColumnMenuWrapper.js"),a=require("../messages/index.js"),s=require("@progress/kendo-react-intl"),m=require("@progress/kendo-react-common");function b(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,c.get?c:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const r=b(u),g=e=>{const n=m.useId(),t=s.useLocalization(),c=e.id||n,{columnMenuWrapperProps:l}=e,o=[r.createElement("span",{key:0,className:"k-checkbox-wrap"},r.createElement("input",{id:c,type:"checkbox",tabIndex:-1,className:"k-checkbox k-checkbox-md k-rounded-md","aria-label":t.toLanguageString(a.selectRow,a.messages[a.selectRow]),"aria-checked":e.selectionValue,checked:e.selectionValue,onChange:i=>e.selectionChange({field:e.field,syntheticEvent:i})})),l.columnMenu&&r.createElement(d.GridColumnMenuWrapper,{...l})];return e.render?e.render.call(void 0,o,e):o};exports.GridHeaderSelectionCell=g;
|