@progress/kendo-react-grid 9.4.0-develop.19 → 9.4.0-develop.20

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/GridState.js CHANGED
@@ -6,4 +6,4 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),B=u.createContext([{},()=>{},{}]),v=()=>u.useContext(B),p=t=>{var f,C,k,G,P,D,b,m,y,F,T,j,q,H,M,O,R,w,z,A;const{children:I,onEditChange:h,onFilterChange:l,onSortChange:i,onSearchChange:o,onPageChange:c,onGroupChange:r,onDataStateChange:g,onSelectionChange:s,onDetailExpandChange:x,onGroupExpandChange:E,onHeaderSelectionChange:S}=t,[n,d]=u.useState({edit:(f=t.defaultEdit)!=null?f:t.edit,filter:(C=t.defaultFilter)!=null?C:t.filter,select:(k=t.defaultSelect)!=null?k:t.select,search:(G=t.defaultSearch)!=null?G:t.search,sort:(P=t.defaultSort)!=null?P:t.sort,take:(D=t.defaultTake)!=null?D:t.take,skip:(b=t.defaultSkip)!=null?b:t.skip,group:(m=t.defaultGroup)!=null?m:t.group,detailExpand:(y=t.defaultDetailExpand)!=null?y:t.detailExpand,groupExpand:(F=t.defaultGroupExpand)!=null?F:t.groupExpand}),J={edit:(T=t.edit)!=null?T:n.edit,filter:(j=t.filter)!=null?j:n.filter,search:(q=t.search)!=null?q:n.search,sort:(H=t.sort)!=null?H:n.sort,take:(M=t.take)!=null?M:n.take,skip:(O=t.skip)!=null?O:n.skip,group:(R=t.group)!=null?R:n.group,select:(w=t.select)!=null?w:n.select,detailExpand:(z=t.detailExpand)!=null?z:n.detailExpand,groupExpand:(A=t.groupExpand)!=null?A:n.groupExpand},K=e=>{},L=e=>{d(a=>({...a,edit:e.edit})),h==null||h(e)},N=e=>{d(a=>({...a,filter:e.filter})),l==null||l(e)},Q=e=>{d(a=>({...a,search:e.search})),o==null||o(e)},U=e=>{d(a=>({...a,sort:e.sort})),i==null||i(e)},V=e=>{d(a=>({...a,...e.page})),c==null||c(e)},W=e=>{d(a=>({...a,group:e.group})),r==null||r(e)},X=e=>{d(a=>({...a,...e.dataState})),g==null||g(e)},Y=e=>{d(a=>({...a,select:e.select})),s==null||s(e)},Z=e=>{d(a=>({...a,select:e.select})),S==null||S(e)},_=e=>{d(a=>({...a,detailExpand:e.detailExpand})),x==null||x(e)},$=e=>{d(a=>({...a,groupExpand:e.groupExpand})),E==null||E(e)};return u.createElement(B.Provider,{value:[J,K,{onEditChange:L,onFilterChange:l&&N,onSearchChange:Q,onSortChange:i&&U,onPageChange:c&&V,onGroupChange:r&&W,onDataStateChange:X,onSelectionChange:Y,onHeaderSelectionChange:Z,onDetailExpandChange:_,onGroupExpandChange:$}]},I)};exports.GridClientStateProvider=p;exports.useGridState=v;
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),K=o.createContext([{},()=>{},{}]),at=()=>o.useContext(K),nt=e=>{var C,k,m,G,P,D,b,y,F,T,j,q,H,M,O,R,w,z,A,B,I,J;const{children:L,onEditChange:h,onFilterChange:d,onSortChange:c,onSearchChange:r,onPageChange:i,onGroupChange:u,onDataStateChange:s,onSelectionChange:S,onDetailExpandChange:g,onGroupExpandChange:x,onHeaderSelectionChange:E,onColumnsStateChange:f}=e,[l,n]=o.useState({edit:(C=e.defaultEdit)!=null?C:e.edit,filter:(k=e.defaultFilter)!=null?k:e.filter,select:(m=e.defaultSelect)!=null?m:e.select,search:(G=e.defaultSearch)!=null?G:e.search,sort:(P=e.defaultSort)!=null?P:e.sort,take:(D=e.defaultTake)!=null?D:e.take,skip:(b=e.defaultSkip)!=null?b:e.skip,group:(y=e.defaultGroup)!=null?y:e.group,detailExpand:(F=e.defaultDetailExpand)!=null?F:e.detailExpand,groupExpand:(T=e.defaultGroupExpand)!=null?T:e.groupExpand,columnsState:(j=e.defaultColumnsState)!=null?j:e.columnsState}),N={edit:(q=e.edit)!=null?q:l.edit,filter:(H=e.filter)!=null?H:l.filter,search:(M=e.search)!=null?M:l.search,sort:(O=e.sort)!=null?O:l.sort,take:(R=e.take)!=null?R:l.take,skip:(w=e.skip)!=null?w:l.skip,group:(z=e.group)!=null?z:l.group,select:(A=e.select)!=null?A:l.select,detailExpand:(B=e.detailExpand)!=null?B:l.detailExpand,groupExpand:(I=e.groupExpand)!=null?I:l.groupExpand,columnsState:(J=e.columnsState)!=null?J:l.columnsState},Q=t=>{},U=t=>{n(a=>({...a,edit:t.edit})),h==null||h(t)},V=t=>{n(a=>({...a,filter:t.filter})),d==null||d(t)},W=t=>{n(a=>({...a,search:t.search})),r==null||r(t)},X=t=>{n(a=>({...a,sort:t.sort})),c==null||c(t)},Y=t=>{n(a=>({...a,...t.page})),i==null||i(t)},Z=t=>{n(a=>({...a,group:t.group})),u==null||u(t)},_=t=>{n(a=>({...a,...t.dataState})),s==null||s(t)},$=t=>{n(a=>({...a,select:t.select})),S==null||S(t)},v=t=>{n(a=>({...a,select:t.select})),E==null||E(t)},p=t=>{n(a=>({...a,detailExpand:t.detailExpand})),g==null||g(t)},tt=t=>{n(a=>({...a,groupExpand:t.groupExpand})),x==null||x(t)},et=t=>{n(a=>({...a,columnsState:t.columnsState})),f==null||f(t)};return o.createElement(K.Provider,{value:[N,Q,{onEditChange:U,onFilterChange:d&&V,onSearchChange:W,onSortChange:c&&X,onPageChange:i&&Y,onGroupChange:u&&Z,onDataStateChange:_,onSelectionChange:$,onHeaderSelectionChange:v,onDetailExpandChange:p,onGroupExpandChange:tt,onColumnsStateChange:et}]},L)};exports.GridClientStateProvider=nt;exports.useGridState=at;
package/GridState.mjs CHANGED
@@ -6,94 +6,100 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import u from "react";
10
- const I = u.createContext([{}, () => {
11
- }, {}]), p = () => u.useContext(I), ee = (t) => {
12
- var S, C, k, G, D, P, m, F, _, H, R, T, b, j, q, w, y, z, A, B;
9
+ import h from "react";
10
+ const L = h.createContext([{}, () => {
11
+ }, {}]), nt = () => h.useContext(L), lt = (e) => {
12
+ var C, k, m, G, D, P, F, _, H, R, T, b, j, q, w, y, z, A, B, I, J, K;
13
13
  const {
14
- children: J,
15
- onEditChange: r,
16
- onFilterChange: l,
14
+ children: M,
15
+ onEditChange: o,
16
+ onFilterChange: d,
17
17
  onSortChange: c,
18
- onSearchChange: o,
18
+ onSearchChange: r,
19
19
  onPageChange: i,
20
- onGroupChange: h,
21
- onDataStateChange: g,
22
- onSelectionChange: x,
23
- onDetailExpandChange: E,
24
- onGroupExpandChange: s,
25
- onHeaderSelectionChange: f
26
- } = t, [n, d] = u.useState({
27
- edit: (S = t.defaultEdit) != null ? S : t.edit,
28
- filter: (C = t.defaultFilter) != null ? C : t.filter,
29
- select: (k = t.defaultSelect) != null ? k : t.select,
30
- search: (G = t.defaultSearch) != null ? G : t.search,
31
- sort: (D = t.defaultSort) != null ? D : t.sort,
32
- take: (P = t.defaultTake) != null ? P : t.take,
33
- skip: (m = t.defaultSkip) != null ? m : t.skip,
34
- group: (F = t.defaultGroup) != null ? F : t.group,
35
- detailExpand: (_ = t.defaultDetailExpand) != null ? _ : t.detailExpand,
36
- groupExpand: (H = t.defaultGroupExpand) != null ? H : t.groupExpand
37
- }), K = {
38
- edit: (R = t.edit) != null ? R : n.edit,
39
- filter: (T = t.filter) != null ? T : n.filter,
40
- search: (b = t.search) != null ? b : n.search,
41
- sort: (j = t.sort) != null ? j : n.sort,
42
- take: (q = t.take) != null ? q : n.take,
43
- skip: (w = t.skip) != null ? w : n.skip,
44
- group: (y = t.group) != null ? y : n.group,
45
- select: (z = t.select) != null ? z : n.select,
46
- detailExpand: (A = t.detailExpand) != null ? A : n.detailExpand,
47
- groupExpand: (B = t.groupExpand) != null ? B : n.groupExpand
48
- }, L = (e) => {
49
- }, M = (e) => {
50
- d((a) => ({ ...a, edit: e.edit })), r == null || r(e);
51
- }, N = (e) => {
52
- d((a) => ({ ...a, filter: e.filter })), l == null || l(e);
53
- }, O = (e) => {
54
- d((a) => ({ ...a, search: e.search })), o == null || o(e);
55
- }, Q = (e) => {
56
- d((a) => ({ ...a, sort: e.sort })), c == null || c(e);
57
- }, U = (e) => {
58
- d((a) => ({ ...a, ...e.page })), i == null || i(e);
59
- }, V = (e) => {
60
- d((a) => ({ ...a, group: e.group })), h == null || h(e);
61
- }, W = (e) => {
62
- d((a) => ({ ...a, ...e.dataState })), g == null || g(e);
63
- }, X = (e) => {
64
- d((a) => ({ ...a, select: e.select })), x == null || x(e);
65
- }, Y = (e) => {
66
- d((a) => ({ ...a, select: e.select })), f == null || f(e);
67
- }, Z = (e) => {
68
- d((a) => ({ ...a, detailExpand: e.detailExpand })), E == null || E(e);
69
- }, $ = (e) => {
70
- d((a) => ({ ...a, groupExpand: e.groupExpand })), s == null || s(e);
20
+ onGroupChange: u,
21
+ onDataStateChange: s,
22
+ onSelectionChange: g,
23
+ onDetailExpandChange: S,
24
+ onGroupExpandChange: x,
25
+ onHeaderSelectionChange: E,
26
+ onColumnsStateChange: f
27
+ } = e, [l, n] = h.useState({
28
+ edit: (C = e.defaultEdit) != null ? C : e.edit,
29
+ filter: (k = e.defaultFilter) != null ? k : e.filter,
30
+ select: (m = e.defaultSelect) != null ? m : e.select,
31
+ search: (G = e.defaultSearch) != null ? G : e.search,
32
+ sort: (D = e.defaultSort) != null ? D : e.sort,
33
+ take: (P = e.defaultTake) != null ? P : e.take,
34
+ skip: (F = e.defaultSkip) != null ? F : e.skip,
35
+ group: (_ = e.defaultGroup) != null ? _ : e.group,
36
+ detailExpand: (H = e.defaultDetailExpand) != null ? H : e.detailExpand,
37
+ groupExpand: (R = e.defaultGroupExpand) != null ? R : e.groupExpand,
38
+ columnsState: (T = e.defaultColumnsState) != null ? T : e.columnsState
39
+ }), N = {
40
+ edit: (b = e.edit) != null ? b : l.edit,
41
+ filter: (j = e.filter) != null ? j : l.filter,
42
+ search: (q = e.search) != null ? q : l.search,
43
+ sort: (w = e.sort) != null ? w : l.sort,
44
+ take: (y = e.take) != null ? y : l.take,
45
+ skip: (z = e.skip) != null ? z : l.skip,
46
+ group: (A = e.group) != null ? A : l.group,
47
+ select: (B = e.select) != null ? B : l.select,
48
+ detailExpand: (I = e.detailExpand) != null ? I : l.detailExpand,
49
+ groupExpand: (J = e.groupExpand) != null ? J : l.groupExpand,
50
+ columnsState: (K = e.columnsState) != null ? K : l.columnsState
51
+ }, O = (t) => {
52
+ }, Q = (t) => {
53
+ n((a) => ({ ...a, edit: t.edit })), o == null || o(t);
54
+ }, U = (t) => {
55
+ n((a) => ({ ...a, filter: t.filter })), d == null || d(t);
56
+ }, V = (t) => {
57
+ n((a) => ({ ...a, search: t.search })), r == null || r(t);
58
+ }, W = (t) => {
59
+ n((a) => ({ ...a, sort: t.sort })), c == null || c(t);
60
+ }, X = (t) => {
61
+ n((a) => ({ ...a, ...t.page })), i == null || i(t);
62
+ }, Y = (t) => {
63
+ n((a) => ({ ...a, group: t.group })), u == null || u(t);
64
+ }, Z = (t) => {
65
+ n((a) => ({ ...a, ...t.dataState })), s == null || s(t);
66
+ }, $ = (t) => {
67
+ n((a) => ({ ...a, select: t.select })), g == null || g(t);
68
+ }, v = (t) => {
69
+ n((a) => ({ ...a, select: t.select })), E == null || E(t);
70
+ }, p = (t) => {
71
+ n((a) => ({ ...a, detailExpand: t.detailExpand })), S == null || S(t);
72
+ }, tt = (t) => {
73
+ n((a) => ({ ...a, groupExpand: t.groupExpand })), x == null || x(t);
74
+ }, et = (t) => {
75
+ n((a) => ({ ...a, columnsState: t.columnsState })), f == null || f(t);
71
76
  };
72
- return /* @__PURE__ */ u.createElement(
73
- I.Provider,
77
+ return /* @__PURE__ */ h.createElement(
78
+ L.Provider,
74
79
  {
75
80
  value: [
76
- K,
77
- L,
81
+ N,
82
+ O,
78
83
  {
79
- onEditChange: M,
80
- onFilterChange: l && N,
81
- onSearchChange: O,
82
- onSortChange: c && Q,
83
- onPageChange: i && U,
84
- onGroupChange: h && V,
85
- onDataStateChange: W,
86
- onSelectionChange: X,
87
- onHeaderSelectionChange: Y,
88
- onDetailExpandChange: Z,
89
- onGroupExpandChange: $
84
+ onEditChange: Q,
85
+ onFilterChange: d && U,
86
+ onSearchChange: V,
87
+ onSortChange: c && W,
88
+ onPageChange: i && X,
89
+ onGroupChange: u && Y,
90
+ onDataStateChange: Z,
91
+ onSelectionChange: $,
92
+ onHeaderSelectionChange: v,
93
+ onDetailExpandChange: p,
94
+ onGroupExpandChange: tt,
95
+ onColumnsStateChange: et
90
96
  }
91
97
  ]
92
98
  },
93
- J
99
+ M
94
100
  );
95
101
  };
96
102
  export {
97
- ee as GridClientStateProvider,
98
- p as useGridState
103
+ lt as GridClientStateProvider,
104
+ nt as useGridState
99
105
  };
@@ -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
+ };