@progress/kendo-react-grid 9.4.0-develop.9 → 9.4.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/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +463 -374
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +337 -307
- package/GridSearchBox.js +8 -0
- package/GridSearchBox.mjs +35 -0
- package/GridState.js +1 -1
- package/GridState.mjs +79 -67
- package/NOTICE.txt +40 -51
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +24 -20
- package/cells/client/GridRowReorderContainer.js +1 -1
- package/cells/client/GridRowReorderContainer.mjs +15 -9
- package/columnMenu/GridColumnMenuCheckboxFilter.js +1 -1
- package/columnMenu/GridColumnMenuCheckboxFilter.mjs +56 -55
- package/columnMenu/GridColumnMenuColumnsChooser.js +9 -0
- package/columnMenu/GridColumnMenuColumnsChooser.mjs +82 -0
- package/columnMenu/GridColumnMenuFilter.js +1 -1
- package/columnMenu/GridColumnMenuFilter.mjs +19 -19
- package/columnMenu/GridColumnMenuSort.js +1 -1
- package/columnMenu/GridColumnMenuSort.mjs +1 -1
- package/components/noRecords/GridNoRecords.js +1 -1
- package/components/noRecords/GridNoRecords.mjs +8 -7
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/header/client/GridHeaderCellContainer.js +1 -1
- package/header/client/GridHeaderCellContainer.mjs +20 -18
- package/index.d.mts +289 -48
- package/index.d.ts +289 -48
- package/index.js +1 -1
- package/index.mjs +76 -72
- package/messages/index.js +1 -1
- package/messages/index.mjs +38 -36
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +14 -14
- package/rows/GridRow.js +1 -1
- package/rows/GridRow.mjs +45 -45
- package/utils/index.js +1 -1
- package/utils/index.mjs +156 -146
- /package/{interfaces/GridSortSettings.js → sortCommon.js} +0 -0
- /package/{interfaces/GridSortSettings.mjs → sortCommon.mjs} +0 -0
|
@@ -7,48 +7,48 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as l from "react";
|
|
10
|
-
import { GridColumnMenuItem as
|
|
11
|
-
import { GridColumnMenuItemGroup as
|
|
12
|
-
import { GridColumnMenuItemContent as
|
|
13
|
-
import { Input as
|
|
14
|
-
import { useLocalization as
|
|
15
|
-
import {
|
|
10
|
+
import { GridColumnMenuItem as _ } from "./GridColumnMenuItem.mjs";
|
|
11
|
+
import { GridColumnMenuItemGroup as $ } from "./GridColumnMenuItemGroup.mjs";
|
|
12
|
+
import { GridColumnMenuItemContent as p } from "./GridColumnMenuItemContent.mjs";
|
|
13
|
+
import { Input as ee, Checkbox as M } from "@progress/kendo-react-inputs";
|
|
14
|
+
import { useLocalization as te } from "@progress/kendo-react-intl";
|
|
15
|
+
import { filterClearButton as h, messages as f, searchPlaceholder as O, filterTitle as q, filterCheckAll as w, filterSelectedItems as V, filterSubmitButton as G } from "../messages/index.mjs";
|
|
16
16
|
import { filterBy as P } from "@progress/kendo-data-query";
|
|
17
|
-
import { IconWrap as
|
|
18
|
-
import { Button as
|
|
19
|
-
import { getNestedValue as
|
|
20
|
-
import { searchIcon as
|
|
21
|
-
const
|
|
17
|
+
import { IconWrap as ne, clone as le } from "@progress/kendo-react-common";
|
|
18
|
+
import { Button as v } from "@progress/kendo-react-buttons";
|
|
19
|
+
import { getNestedValue as A } from "../utils/index.mjs";
|
|
20
|
+
import { searchIcon as re, xIcon as ae, filterIcon as ie } from "@progress/kendo-svg-icons";
|
|
21
|
+
const ce = (e, d) => e.length !== d.length ? !1 : e.every((g, m) => g === d[m]), oe = {
|
|
22
22
|
uniqueData: !0
|
|
23
|
-
},
|
|
24
|
-
const { uniqueData:
|
|
23
|
+
}, Fe = (e) => {
|
|
24
|
+
const { uniqueData: d = oe.uniqueData } = e, g = () => {
|
|
25
25
|
const t = e.column.field;
|
|
26
|
-
return
|
|
26
|
+
return S().filters.findIndex(
|
|
27
27
|
(a) => a.filters && a.filters.length > 0 && a.filters[0].field === t
|
|
28
28
|
);
|
|
29
|
-
},
|
|
30
|
-
const i = e.column.field || "", a = t.map((c) =>
|
|
29
|
+
}, m = (t, n) => {
|
|
30
|
+
const i = e.column.field || "", a = t.map((c) => A(i, c));
|
|
31
31
|
return n ? a.filter((c, o) => a.indexOf(c) === o) : a;
|
|
32
|
-
},
|
|
32
|
+
}, S = () => e.filter ? le(e.filter) : { filters: [], logic: "and" }, r = l.useRef(g()), [I, R] = l.useState(e.expanded || !1), [b, B] = l.useState(""), [x, C] = l.useState(m(e.data, d) || []), [z, j] = l.useState(m(e.data, !1) || []), [s, T] = l.useState(S());
|
|
33
33
|
l.useEffect(() => {
|
|
34
|
-
const t = e.column.field || "", n = e.data.map((i) =>
|
|
35
|
-
|
|
34
|
+
const t = e.column.field || "", n = e.data.map((i) => A(t, i));
|
|
35
|
+
ce(n, z) || (C(n), j(n));
|
|
36
36
|
}, [e.column, e.data]);
|
|
37
37
|
const N = () => e.expanded !== void 0, W = () => {
|
|
38
|
-
const t = N(), n = !(t ? e.expanded :
|
|
39
|
-
e.onExpandChange && e.onExpandChange(n), t ||
|
|
40
|
-
},
|
|
38
|
+
const t = N(), n = !(t ? e.expanded : I);
|
|
39
|
+
e.onExpandChange && e.onExpandChange(n), t || R(n);
|
|
40
|
+
}, D = (t) => {
|
|
41
41
|
const n = e.searchBoxFilterOperator ? e.searchBoxFilterOperator : "startswith", i = {
|
|
42
42
|
logic: "and",
|
|
43
43
|
filters: [{ field: e.column.field, operator: n, value: t.target.value, ignoreCase: !0 }]
|
|
44
44
|
};
|
|
45
|
-
|
|
45
|
+
B(t.target.value), C(m(P(e.data || [], i), d));
|
|
46
46
|
}, H = () => {
|
|
47
47
|
const t = e.searchBoxFilterOperator ? e.searchBoxFilterOperator : "startswith", n = {
|
|
48
48
|
logic: "and",
|
|
49
49
|
filters: [{ field: e.column.field, operator: t, value: "", ignoreCase: !0 }]
|
|
50
50
|
};
|
|
51
|
-
|
|
51
|
+
B(""), C(m(P(e.data || [], n), d));
|
|
52
52
|
}, J = (t) => {
|
|
53
53
|
if (t.preventDefault(), !e.onFilterChange)
|
|
54
54
|
return;
|
|
@@ -59,18 +59,18 @@ const ie = (e, u) => e.length !== u.length ? !1 : e.every((h, f) => h === u[f]),
|
|
|
59
59
|
return;
|
|
60
60
|
const n = s || null;
|
|
61
61
|
e.onFilterChange(n, t), e.onCloseMenu && e.onCloseMenu();
|
|
62
|
-
},
|
|
62
|
+
}, y = (t, n) => {
|
|
63
63
|
const i = e.column.field || "", a = { ...s }, c = [...s.filters];
|
|
64
64
|
let o = [];
|
|
65
65
|
if (r.current !== -1 && a.filters[r.current].filters && n !== "all" && (o = a.filters[r.current].filters), t.value && n === "all")
|
|
66
|
-
|
|
67
|
-
o.push({ field: i, operator: "eq", value:
|
|
66
|
+
x.forEach((F) => {
|
|
67
|
+
o.push({ field: i, operator: "eq", value: F });
|
|
68
68
|
});
|
|
69
69
|
else if (t.value)
|
|
70
70
|
o.push({ field: i, operator: "eq", value: n });
|
|
71
71
|
else if (s) {
|
|
72
|
-
const
|
|
73
|
-
o.splice(
|
|
72
|
+
const F = o.findIndex((Z) => Z.value === n);
|
|
73
|
+
o.splice(F, 1);
|
|
74
74
|
}
|
|
75
75
|
a.logic = "and", r.current !== -1 ? c[r.current] = {
|
|
76
76
|
logic: "or",
|
|
@@ -83,65 +83,66 @@ const ie = (e, u) => e.length !== u.length ? !1 : e.every((h, f) => h === u[f]),
|
|
|
83
83
|
let t = !1;
|
|
84
84
|
if (s) {
|
|
85
85
|
const n = [...s.filters];
|
|
86
|
-
return r.current === -1 ? !1 : (t =
|
|
86
|
+
return r.current === -1 ? !1 : (t = x.every((i) => r.current !== -1 && n[r.current].filters ? n[r.current].filters.findIndex(
|
|
87
87
|
(c) => c.value === i
|
|
88
88
|
) >= 0 : !1), t);
|
|
89
89
|
}
|
|
90
90
|
return t;
|
|
91
|
-
},
|
|
92
|
-
if (!
|
|
91
|
+
}, u = te(), { column: k } = e;
|
|
92
|
+
if (!k || !k.field)
|
|
93
93
|
return /* @__PURE__ */ l.createElement("div", null);
|
|
94
|
-
const U = N() ? e.expanded :
|
|
94
|
+
const U = N() ? e.expanded : I, E = [];
|
|
95
95
|
if (s) {
|
|
96
96
|
const t = [...s.filters];
|
|
97
|
-
r.current = t.findIndex((n) => n.filters && n.filters.length > 0 ? n.filters[0].field ===
|
|
98
|
-
n.field === e.column.field &&
|
|
97
|
+
r.current = t.findIndex((n) => n.filters && n.filters.length > 0 ? n.filters[0].field === k.field : !1), r.current !== -1 && t[r.current].filters.length > 0 && t[r.current].filters.forEach((n) => {
|
|
98
|
+
n.field === e.column.field && E.push(n.value);
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
const X = e.searchBox ? /* @__PURE__ */ l.createElement(e.searchBox, { value:
|
|
102
|
-
|
|
101
|
+
const X = u.toLanguageString(h, f[h]), Y = e.searchBox ? /* @__PURE__ */ l.createElement(e.searchBox, { value: b, onChange: D }) : /* @__PURE__ */ l.createElement("div", { className: "k-searchbox k-textbox k-input k-input-md k-input-solid" }, /* @__PURE__ */ l.createElement(ne, { className: "k-input-icon", name: "search", icon: re }), /* @__PURE__ */ l.createElement(
|
|
102
|
+
ee,
|
|
103
103
|
{
|
|
104
104
|
className: "k-input-inner",
|
|
105
105
|
type: "text",
|
|
106
|
-
placeholder:
|
|
107
|
-
value:
|
|
108
|
-
onChange: (t) =>
|
|
106
|
+
placeholder: u.toLanguageString(O, f[O]),
|
|
107
|
+
value: b,
|
|
108
|
+
onChange: (t) => D(t.nativeEvent)
|
|
109
109
|
}
|
|
110
110
|
), /* @__PURE__ */ l.createElement(
|
|
111
|
-
|
|
111
|
+
v,
|
|
112
112
|
{
|
|
113
113
|
type: "button",
|
|
114
114
|
rounded: null,
|
|
115
115
|
className: "k-input-button",
|
|
116
116
|
onClick: H,
|
|
117
117
|
icon: "x",
|
|
118
|
-
|
|
118
|
+
"aria-label": X,
|
|
119
|
+
svgIcon: ae
|
|
119
120
|
}
|
|
120
|
-
)),
|
|
121
|
-
return /* @__PURE__ */ l.createElement(
|
|
122
|
-
|
|
121
|
+
)), L = E.filter((t, n) => E.indexOf(t) === n);
|
|
122
|
+
return /* @__PURE__ */ l.createElement($, null, /* @__PURE__ */ l.createElement(
|
|
123
|
+
_,
|
|
123
124
|
{
|
|
124
|
-
title:
|
|
125
|
+
title: u.toLanguageString(q, f[q]),
|
|
125
126
|
iconClass: "k-i-filter",
|
|
126
|
-
svgIcon:
|
|
127
|
+
svgIcon: ie,
|
|
127
128
|
onClick: W
|
|
128
129
|
}
|
|
129
|
-
), /* @__PURE__ */ l.createElement(
|
|
130
|
+
), /* @__PURE__ */ l.createElement(p, { show: !!U }, /* @__PURE__ */ l.createElement("form", { className: "k-filter-menu", onSubmit: K, onReset: J }, /* @__PURE__ */ l.createElement("div", { className: "k-filter-menu-container" }, Y, /* @__PURE__ */ l.createElement("ul", { className: "k-reset k-multicheck-wrap" }, /* @__PURE__ */ l.createElement("li", { className: "k-item k-check-all-wrap" }, /* @__PURE__ */ l.createElement(
|
|
130
131
|
M,
|
|
131
132
|
{
|
|
132
|
-
label:
|
|
133
|
-
onChange: (t) =>
|
|
133
|
+
label: u.toLanguageString(w, f[w]),
|
|
134
|
+
onChange: (t) => y(t, "all"),
|
|
134
135
|
checked: Q()
|
|
135
136
|
}
|
|
136
|
-
)),
|
|
137
|
+
)), x.map((t, n) => /* @__PURE__ */ l.createElement("li", { className: "k-item", key: n }, /* @__PURE__ */ l.createElement(
|
|
137
138
|
M,
|
|
138
139
|
{
|
|
139
140
|
label: String(t),
|
|
140
|
-
onChange: (i) =>
|
|
141
|
-
checked:
|
|
141
|
+
onChange: (i) => y(i, t),
|
|
142
|
+
checked: L.includes(t)
|
|
142
143
|
}
|
|
143
|
-
)))), /* @__PURE__ */ l.createElement("div", { className: "k-filter-selected-items" },
|
|
144
|
+
)))), /* @__PURE__ */ l.createElement("div", { className: "k-filter-selected-items" }, L.length + " " + u.toLanguageString(V, f[V])), /* @__PURE__ */ l.createElement("div", { className: "k-actions k-hstack k-justify-content-stretch" }, /* @__PURE__ */ l.createElement(v, { themeColor: "primary", type: "submit" }, u.toLanguageString(G, f[G])), /* @__PURE__ */ l.createElement(v, { className: "k-button", type: "reset" }, u.toLanguageString(h, f[h])))))));
|
|
144
145
|
};
|
|
145
146
|
export {
|
|
146
|
-
|
|
147
|
+
Fe as GridColumnMenuCheckboxFilter
|
|
147
148
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),g=require("@progress/kendo-react-inputs"),j=require("@progress/kendo-react-common"),q=require("@progress/kendo-svg-icons"),b=require("@progress/kendo-react-buttons"),M=require("@progress/kendo-react-intl"),r=require("../messages/index.js");function w(s){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const c in s)if(c!=="default"){const u=Object.getOwnPropertyDescriptor(s,c);Object.defineProperty(n,c,u.get?u:{enumerable:!0,get:()=>s[c]})}}return n.default=s,Object.freeze(n)}const t=w(O),S=s=>{const{columnsState:n,onCloseMenu:c,onColumnsStateChange:u}=s,f=M.useLocalization(),[m,E]=t.useState(""),h=n.reduce((e,l)=>({...e,[l.id||""]:!l.hidden}),{}),[o,C]=t.useState(h),y=t.useMemo(()=>(n==null?void 0:n.filter(e=>{var l;return(l=e.title||e.field)==null?void 0:l.toLowerCase().includes(m.toLowerCase())}))||[],[n,m]),d=t.useMemo(()=>Object.values(o).filter(e=>e).length,[o]),k=t.useMemo(()=>d===(n==null?void 0:n.length),[n,d]),N=t.useCallback(e=>{const a=(i=>(i==null?void 0:i.map(p=>({...p,hidden:!o[p.id||""]})))||[])(n);u&&u(a),c==null||c.call(void 0)},[o,n,c]),v=()=>{C(h)},B=t.useCallback(()=>{const e={...o};Object.keys(e).forEach((l,a)=>e[l]=k&&a===0?!0:!k),C(e)},[o,k]),R=t.useCallback((e,l)=>{const a={...o};a[l||""]=e,C(a)},[o]),x=e=>{E(String(e.target.value))};return t.createElement("form",{className:"k-filter-menu"},t.createElement("div",{className:"k-filter-menu-container"},t.createElement(g.TextBox,{className:"k-searchbox",value:m,onChange:x,prefix:()=>t.createElement(g.InputPrefix,null,t.createElement(j.IconWrap,{name:"search",icon:q.searchIcon}))}),t.createElement("ul",{className:"k-reset k-multicheck-wrap"},!m&&t.createElement("li",{className:"k-item k-check-all-wrap"},t.createElement(g.Checkbox,{checked:k,onChange:B,label:f.toLanguageString(r.filterSelectAll,r.messages[r.filterSelectAll])})),y.map((e,l)=>t.createElement("li",{key:e.id,className:"k-item"},t.createElement(g.Checkbox,{disabled:o[e.id||""]&&d===1,checked:o[e.id||""],onChange:a=>{var i;return R(!!((i=a.target.element)!=null&&i.checked),e.id)},label:e.title||e.field})))),t.createElement("div",{className:"k-filter-selected-items"},d," selected items"),t.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal"},t.createElement(b.Button,{type:"button",themeColor:"primary",onClick:N},f.toLanguageString(r.filterApplyButton,r.messages[r.filterApplyButton])),t.createElement(b.Button,{type:"button",onClick:v},f.toLanguageString(r.filterResetButton,r.messages[r.filterResetButton])))))};S.displayName="GridColumnMenuColumnsChooser";exports.GridColumnMenuColumnsChooser=S;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2025 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { TextBox as M, InputPrefix as I, Checkbox as p } from "@progress/kendo-react-inputs";
|
|
11
|
+
import { IconWrap as R } from "@progress/kendo-react-common";
|
|
12
|
+
import { searchIcon as j } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { Button as g } from "@progress/kendo-react-buttons";
|
|
14
|
+
import { useLocalization as z } from "@progress/kendo-react-intl";
|
|
15
|
+
import { filterSelectAll as E, messages as k, filterApplyButton as S, filterResetButton as b } from "../messages/index.mjs";
|
|
16
|
+
const F = (N) => {
|
|
17
|
+
const { columnsState: l, onCloseMenu: c, onColumnsStateChange: h } = N, u = z(), [i, y] = t.useState(""), C = l.reduce((e, n) => ({ ...e, [n.id || ""]: !n.hidden }), {}), [o, d] = t.useState(C), x = t.useMemo(
|
|
18
|
+
() => (l == null ? void 0 : l.filter((e) => {
|
|
19
|
+
var n;
|
|
20
|
+
return (n = e.title || e.field) == null ? void 0 : n.toLowerCase().includes(i.toLowerCase());
|
|
21
|
+
})) || [],
|
|
22
|
+
[l, i]
|
|
23
|
+
), s = t.useMemo(
|
|
24
|
+
() => Object.values(o).filter((e) => e).length,
|
|
25
|
+
[o]
|
|
26
|
+
), m = t.useMemo(() => s === (l == null ? void 0 : l.length), [l, s]), v = t.useCallback(
|
|
27
|
+
(e) => {
|
|
28
|
+
const a = ((r) => (r == null ? void 0 : r.map((f) => ({
|
|
29
|
+
...f,
|
|
30
|
+
hidden: !o[f.id || ""]
|
|
31
|
+
}))) || [])(l);
|
|
32
|
+
h && h(a), c == null || c.call(void 0);
|
|
33
|
+
},
|
|
34
|
+
[o, l, c]
|
|
35
|
+
), L = () => {
|
|
36
|
+
d(C);
|
|
37
|
+
}, w = t.useCallback(() => {
|
|
38
|
+
const e = { ...o };
|
|
39
|
+
Object.keys(e).forEach(
|
|
40
|
+
(n, a) => e[n] = m && a === 0 ? !0 : !m
|
|
41
|
+
), d(e);
|
|
42
|
+
}, [o, m]), B = t.useCallback(
|
|
43
|
+
(e, n) => {
|
|
44
|
+
const a = { ...o };
|
|
45
|
+
a[n || ""] = e, d(a);
|
|
46
|
+
},
|
|
47
|
+
[o]
|
|
48
|
+
), A = (e) => {
|
|
49
|
+
y(String(e.target.value));
|
|
50
|
+
};
|
|
51
|
+
return /* @__PURE__ */ t.createElement("form", { className: "k-filter-menu" }, /* @__PURE__ */ t.createElement("div", { className: "k-filter-menu-container" }, /* @__PURE__ */ t.createElement(
|
|
52
|
+
M,
|
|
53
|
+
{
|
|
54
|
+
className: "k-searchbox",
|
|
55
|
+
value: i,
|
|
56
|
+
onChange: A,
|
|
57
|
+
prefix: () => /* @__PURE__ */ t.createElement(I, null, /* @__PURE__ */ t.createElement(R, { name: "search", icon: j }))
|
|
58
|
+
}
|
|
59
|
+
), /* @__PURE__ */ t.createElement("ul", { className: "k-reset k-multicheck-wrap" }, !i && /* @__PURE__ */ t.createElement("li", { className: "k-item k-check-all-wrap" }, /* @__PURE__ */ t.createElement(
|
|
60
|
+
p,
|
|
61
|
+
{
|
|
62
|
+
checked: m,
|
|
63
|
+
onChange: w,
|
|
64
|
+
label: u.toLanguageString(E, k[E])
|
|
65
|
+
}
|
|
66
|
+
)), x.map((e, n) => /* @__PURE__ */ t.createElement("li", { key: e.id, className: "k-item" }, /* @__PURE__ */ t.createElement(
|
|
67
|
+
p,
|
|
68
|
+
{
|
|
69
|
+
disabled: o[e.id || ""] && s === 1,
|
|
70
|
+
checked: o[e.id || ""],
|
|
71
|
+
onChange: (a) => {
|
|
72
|
+
var r;
|
|
73
|
+
return B(!!((r = a.target.element) != null && r.checked), e.id);
|
|
74
|
+
},
|
|
75
|
+
label: e.title || e.field
|
|
76
|
+
}
|
|
77
|
+
)))), /* @__PURE__ */ t.createElement("div", { className: "k-filter-selected-items" }, s, " selected items"), /* @__PURE__ */ t.createElement("div", { className: "k-actions k-actions-start k-actions-horizontal" }, /* @__PURE__ */ t.createElement(g, { type: "button", themeColor: "primary", onClick: v }, u.toLanguageString(S, k[S])), /* @__PURE__ */ t.createElement(g, { type: "button", onClick: L }, u.toLanguageString(b, k[b])))));
|
|
78
|
+
};
|
|
79
|
+
F.displayName = "GridColumnMenuColumnsChooser";
|
|
80
|
+
export {
|
|
81
|
+
F as GridColumnMenuColumnsChooser
|
|
82
|
+
};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),L=require("@progress/kendo-data-query"),Y=require("./GridColumnMenuItem.js"),Z=require("./GridColumnMenuItemGroup.js"),$=require("./GridColumnMenuItemContent.js"),ee=require("@progress/kendo-react-intl"),
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react"),L=require("@progress/kendo-data-query"),Y=require("./GridColumnMenuItem.js"),Z=require("./GridColumnMenuItemGroup.js"),$=require("./GridColumnMenuItemContent.js"),ee=require("@progress/kendo-react-intl"),n=require("../filterCommon.js"),c=require("../messages/index.js"),te=require("./GridColumnMenuFilterUI.js"),T=require("@progress/kendo-react-buttons"),re=require("@progress/kendo-svg-icons");function le(e){const u=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const f in e)if(f!=="default"){const F=Object.getOwnPropertyDescriptor(e,f);Object.defineProperty(u,f,F.get?F:{enumerable:!0,get:()=>e[f]})}}return u.default=e,Object.freeze(u)}const l=le(X),I=e=>e||{filters:[],logic:"and"},v=(e,u)=>I(u).filters.filter(i=>L.isCompositeFilterDescriptor(i)?i.filters&&i.filters.length&&!i.filters.find(C=>L.isCompositeFilterDescriptor(C)||C.field!==e):!1)[0]||null,ne=(e,u)=>!!v(e,u),ie=e=>{const u=l.useCallback(()=>{let t;if(e.column&&e.column.field){const a=n.getFilterType(e.column.filter),r=n.getDefaultOperator(e.filterOperators,a);t=v(e.column.field,e.filter),t=t?{...t,filters:t.filters.map(o=>({...o}))}:{logic:"and",filters:[{field:e.column.field,operator:r,value:n.IsUnaryFilter(r)?null:void 0},{field:e.column.field,operator:r,value:n.IsUnaryFilter(r)?null:void 0}]},t.filters.filter(o=>o.field===e.column.field).length===1&&t.filters.splice(1,0,{field:e.column.field,operator:r})}return t},[e.column]),[f,F]=l.useState(e.expanded||!1),[i,C]=l.useState(u()),S=()=>e.expanded!==void 0,_=()=>{const t=S(),a=!(t?e.expanded:f);e.onExpandChange&&e.onExpandChange(a),t||F(a)},j=t=>{p(0,t)},R=t=>{p(1,t)},p=(t,a)=>{const r=i.filters.map((o,s)=>s===t?{...o,value:a.value,operator:a.operator}:o);C({...i,filters:r})},V=t=>{C({...i,logic:t.target.value.operator})},w=t=>{if(t.preventDefault(),!e.onFilterChange)return;const a=e.column.field,r=I(e.filter),o=v(a,e.filter),s=r.filters.filter(g=>g!==o);s.length?e.onFilterChange({...r,filters:s},t):e.onFilterChange(null,t),e.onCloseMenu&&e.onCloseMenu()},b=()=>({...i,filters:i.filters.filter(t=>t.value!==void 0&&t.value!==null&&t.value!==""||t.value===null&&t.operator)}),N=t=>{if(t.preventDefault(),!e.onFilterChange)return;const a=e.column.field,r=I(e.filter),o=v(a,e.filter),s=b();let g=null;if(o&&s.filters.length>0){const M=r.filters.map(y=>y===o?s:y);g={...r,filters:M}}else if(s.filters.length===0){const M=r.filters.filter(y=>y!==o);M.length&&(g={...r,filters:M})}else g={...r,filters:[...r.filters,s]};e.onFilterChange(g,t),e.onCloseMenu&&e.onCloseMenu()},{column:h,filterUI:z,hideSecondFilter:x,filterOperators:A}=e,d=ee.useLocalization();if(!h||!h.field)return l.createElement("div",null);const G=n.getFilterType(h.filter),H=x!==void 0?x:n.defaultHideSecondFilter[G],m=i.filters,O=n.operatorMap(A[G],d),k=n.operatorMap(n.booleanFilterValues,d),Q={field:h.field,value:m[0].value,operator:m[0].operator,operators:O,booleanValues:k,onChange:j,filterType:G},J={field:h.field,value:m[1].value,operator:m[1].operator,operators:O,booleanValues:k,onChange:R,filterType:G},D=i.logic,q=n.operatorMap(n.filterLogicList,d),E={value:q.find(t=>t.operator===(D===null?"":D)),onChange:V,data:q},B=z,P={firstFilterProps:Q,secondFilterProps:J,logicData:E.data,logicValue:E.value,onLogicChange:E.onChange,hideSecondFilter:H},K=b().filters.length!==0||n.IsUnaryFilter(m[0].operator)||n.IsUnaryFilter(m[1].operator),W=S()?e.expanded:f,U=e.alwaysExpand;return l.createElement(Z.GridColumnMenuItemGroup,null,!U&&l.createElement(Y.GridColumnMenuItem,{title:d.toLanguageString(c.filterTitle,c.messages[c.filterTitle]),iconClass:"k-i-filter",svgIcon:re.filterIcon,onClick:_}),l.createElement($.GridColumnMenuItemContent,{show:U||!!W},l.createElement("form",{className:"k-filter-menu",onSubmit:N,onReset:w},l.createElement("div",{className:"k-filter-menu-container"},B?l.createElement(B,{...P}):l.createElement(te.GridColumnMenuFilterUI,{...P}),l.createElement("div",{className:"k-actions k-actions-stretched"},l.createElement(T.Button,{themeColor:"primary",disabled:!K},d.toLanguageString(c.filterSubmitButton,c.messages[c.filterSubmitButton])),l.createElement(T.Button,{type:"reset"},d.toLanguageString(c.filterClearButton,c.messages[c.filterClearButton])))))))};exports.GridColumnMenuFilter=ie;exports.filterGroupByField=v;exports.isColumnMenuFilterActive=ne;exports.rootFilterOrDefault=I;
|
|
@@ -12,19 +12,19 @@ import { GridColumnMenuItem as te } from "./GridColumnMenuItem.mjs";
|
|
|
12
12
|
import { GridColumnMenuItemGroup as le } from "./GridColumnMenuItemGroup.mjs";
|
|
13
13
|
import { GridColumnMenuItemContent as re } from "./GridColumnMenuItemContent.mjs";
|
|
14
14
|
import { useLocalization as ie } from "@progress/kendo-react-intl";
|
|
15
|
-
import { getFilterType as w, getDefaultOperator as
|
|
15
|
+
import { getFilterType as w, getDefaultOperator as oe, IsUnaryFilter as h, operatorMap as x, booleanFilterValues as ne, filterLogicList as ae, defaultHideSecondFilter as ce } from "../filterCommon.mjs";
|
|
16
16
|
import { filterTitle as N, messages as p, filterSubmitButton as _, filterClearButton as z } from "../messages/index.mjs";
|
|
17
17
|
import { GridColumnMenuFilterUI as se } from "./GridColumnMenuFilterUI.mjs";
|
|
18
18
|
import { Button as H } from "@progress/kendo-react-buttons";
|
|
19
19
|
import { filterIcon as ue } from "@progress/kendo-svg-icons";
|
|
20
|
-
const S = (e) => e || { filters: [], logic: "and" }, v = (e, f) => S(f).filters.filter((i) => T(i) ? i.filters && i.filters.length &&
|
|
20
|
+
const S = (e) => e || { filters: [], logic: "and" }, v = (e, f) => S(f).filters.filter((i) => T(i) ? i.filters && i.filters.length && !i.filters.find((d) => T(d) || d.field !== e) : !1)[0] || null, xe = (e, f) => !!v(e, f), pe = (e) => {
|
|
21
21
|
const f = r.useCallback(() => {
|
|
22
22
|
let t;
|
|
23
23
|
if (e.column && e.column.field) {
|
|
24
|
-
const
|
|
24
|
+
const n = w(e.column.filter), l = oe(e.filterOperators, n);
|
|
25
25
|
t = v(e.column.field, e.filter), t = t ? {
|
|
26
26
|
...t,
|
|
27
|
-
filters: t.filters.map((
|
|
27
|
+
filters: t.filters.map((o) => ({ ...o }))
|
|
28
28
|
} : {
|
|
29
29
|
logic: "and",
|
|
30
30
|
filters: [
|
|
@@ -39,22 +39,22 @@ const S = (e) => e || { filters: [], logic: "and" }, v = (e, f) => S(f).filters.
|
|
|
39
39
|
value: h(l) ? null : void 0
|
|
40
40
|
}
|
|
41
41
|
]
|
|
42
|
-
}, t.filters.filter((
|
|
42
|
+
}, t.filters.filter((o) => o.field === e.column.field).length === 1 && t.filters.splice(1, 0, { field: e.column.field, operator: l });
|
|
43
43
|
}
|
|
44
44
|
return t;
|
|
45
45
|
}, [e.column]), [E, M] = r.useState(e.expanded || !1), [i, d] = r.useState(f()), I = () => e.expanded !== void 0, R = () => {
|
|
46
|
-
const t = I(),
|
|
47
|
-
e.onExpandChange && e.onExpandChange(
|
|
46
|
+
const t = I(), n = !(t ? e.expanded : E);
|
|
47
|
+
e.onExpandChange && e.onExpandChange(n), t || M(n);
|
|
48
48
|
}, A = (t) => {
|
|
49
49
|
y(0, t);
|
|
50
50
|
}, j = (t) => {
|
|
51
51
|
y(1, t);
|
|
52
|
-
}, y = (t,
|
|
53
|
-
const l = i.filters.map((
|
|
54
|
-
...
|
|
55
|
-
value:
|
|
56
|
-
operator:
|
|
57
|
-
} :
|
|
52
|
+
}, y = (t, n) => {
|
|
53
|
+
const l = i.filters.map((o, a) => a === t ? {
|
|
54
|
+
...o,
|
|
55
|
+
value: n.value,
|
|
56
|
+
operator: n.operator
|
|
57
|
+
} : o);
|
|
58
58
|
d({
|
|
59
59
|
...i,
|
|
60
60
|
filters: l
|
|
@@ -67,7 +67,7 @@ const S = (e) => e || { filters: [], logic: "and" }, v = (e, f) => S(f).filters.
|
|
|
67
67
|
}, J = (t) => {
|
|
68
68
|
if (t.preventDefault(), !e.onFilterChange)
|
|
69
69
|
return;
|
|
70
|
-
const
|
|
70
|
+
const n = e.column.field, l = S(e.filter), o = v(n, e.filter), a = l.filters.filter((u) => u !== o);
|
|
71
71
|
a.length ? e.onFilterChange({ ...l, filters: a }, t) : e.onFilterChange(null, t), e.onCloseMenu && e.onCloseMenu();
|
|
72
72
|
}, L = () => ({
|
|
73
73
|
...i,
|
|
@@ -75,16 +75,16 @@ const S = (e) => e || { filters: [], logic: "and" }, v = (e, f) => S(f).filters.
|
|
|
75
75
|
}), K = (t) => {
|
|
76
76
|
if (t.preventDefault(), !e.onFilterChange)
|
|
77
77
|
return;
|
|
78
|
-
const
|
|
78
|
+
const n = e.column.field, l = S(e.filter), o = v(n, e.filter), a = L();
|
|
79
79
|
let u = null;
|
|
80
|
-
if (
|
|
81
|
-
const F = l.filters.map((C) => C ===
|
|
80
|
+
if (o && a.filters.length > 0) {
|
|
81
|
+
const F = l.filters.map((C) => C === o ? a : C);
|
|
82
82
|
u = {
|
|
83
83
|
...l,
|
|
84
84
|
filters: F
|
|
85
85
|
};
|
|
86
86
|
} else if (a.filters.length === 0) {
|
|
87
|
-
const F = l.filters.filter((C) => C !==
|
|
87
|
+
const F = l.filters.filter((C) => C !== o);
|
|
88
88
|
F.length && (u = {
|
|
89
89
|
...l,
|
|
90
90
|
filters: F
|
|
@@ -98,7 +98,7 @@ const S = (e) => e || { filters: [], logic: "and" }, v = (e, f) => S(f).filters.
|
|
|
98
98
|
}, { column: m, filterUI: Q, hideSecondFilter: b, filterOperators: W } = e, c = ie();
|
|
99
99
|
if (!m || !m.field)
|
|
100
100
|
return /* @__PURE__ */ r.createElement("div", null);
|
|
101
|
-
const g = w(m.filter), X = b !== void 0 ? b : ce[g], s = i.filters, k = x(W[g], c), D = x(
|
|
101
|
+
const g = w(m.filter), X = b !== void 0 ? b : ce[g], s = i.filters, k = x(W[g], c), D = x(ne, c), Y = {
|
|
102
102
|
field: m.field,
|
|
103
103
|
value: s[0].value,
|
|
104
104
|
operator: s[0].operator,
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),g=require("./GridColumnMenuItem.js"),j=require("./GridColumnMenuItemGroup.js"),C=require("../
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),g=require("./GridColumnMenuItem.js"),j=require("./GridColumnMenuItemGroup.js"),C=require("../sortCommon.js"),y=require("@progress/kendo-react-intl"),c=require("../messages/index.js"),S=require("@progress/kendo-svg-icons");function R(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const l=R(O),M="asc",I="desc",D=(e,n)=>n?n.findIndex(t=>t.field===e):-1,b=(e,n)=>!!(n&&e>-1&&n[e].dir===M),k=(e,n)=>!!(n&&e>-1&&n[e].dir===I),_=(e,n)=>{const t=D(e,n);return k(t,n)||b(t,n)},z=e=>{const n=o=>{r(o,M),e.onCloseMenu&&e.onCloseMenu()},t=o=>{r(o,I),e.onCloseMenu&&e.onCloseMenu()},r=(o,q)=>{if(o.preventDefault(),!e.onSortChange)return;const{allowUnsort:A,mode:v}=C.normalize(e.sortable||!1,!1),d=(e.sort||[]).filter(i=>i.field===e.column.field)[0],m=C.sortSeqMap[A][d&&d.dir||""][q],f=v==="single"?[]:(e.sort||[]).filter(i=>i.field!==e.column.field);m!==""&&e.column.field&&f.push({field:e.column.field,dir:m}),e.onSortChange(f,o)},{sort:s,column:G}=e,u=D(G.field,s),a=y.useLocalization();return l.createElement(j.GridColumnMenuItemGroup,null,l.createElement(g.GridColumnMenuItem,{title:a.toLanguageString(c.sortAscending,c.messages[c.sortAscending]),iconClass:"k-i-sort-asc-sm",svgIcon:S.sortAscSmallIcon,selected:b(u,s),onClick:n}),l.createElement(g.GridColumnMenuItem,{title:a.toLanguageString(c.sortDescending,c.messages[c.sortDescending]),iconClass:"k-i-sort-desc-sm",svgIcon:S.sortDescSmallIcon,selected:k(u,s),onClick:t}))};exports.GridColumnMenuSort=z;exports.isColumnMenuSortActive=_;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import * as i from "react";
|
|
10
10
|
import { GridColumnMenuItem as f } from "./GridColumnMenuItem.mjs";
|
|
11
11
|
import { GridColumnMenuItemGroup as x } from "./GridColumnMenuItemGroup.mjs";
|
|
12
|
-
import { normalize as z, sortSeqMap as L } from "../
|
|
12
|
+
import { normalize as z, sortSeqMap as L } from "../sortCommon.mjs";
|
|
13
13
|
import { useLocalization as R } from "@progress/kendo-react-intl";
|
|
14
14
|
import { sortAscending as C, messages as g, sortDescending as S } from "../messages/index.mjs";
|
|
15
15
|
import { sortAscSmallIcon as w, sortDescSmallIcon as _ } from "@progress/kendo-svg-icons";
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),s=require("@progress/kendo-react-intl"),r=require("../../messages/index.js");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const c=l(i),a=e=>{const t=s.useLocalization();return c.createElement(c.Fragment,null,e.children||t.toLanguageString(r.noRecords,r.messages[r.noRecords]))};a.displayName="KendoReactGridNoRecords";exports.GridNoRecords=a;
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import * as o from "react";
|
|
10
|
+
import { useLocalization as a } from "@progress/kendo-react-intl";
|
|
11
|
+
import { noRecords as e, messages as n } from "../../messages/index.mjs";
|
|
12
|
+
const i = (r) => {
|
|
13
|
+
const t = a();
|
|
14
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, r.children || t.toLanguageString(e, n[e]));
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
+
i.displayName = "KendoReactGridNoRecords";
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
+
i as GridNoRecords
|
|
18
19
|
};
|