@progress/kendo-react-grid 11.3.0-develop.1 → 11.3.0-develop.3

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.
@@ -0,0 +1,204 @@
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
+ import * as e from "react";
9
+ import x from "react-dom";
10
+ import { GridContext as ee } from "../utils/GridContext.mjs";
11
+ import { Button as L } from "@progress/kendo-react-buttons";
12
+ import { chevronUpIcon as te, chevronDownIcon as ne, xCircleIcon as oe, plusCircleIcon as ae, groupIcon as re, xIcon as le } from "@progress/kendo-svg-icons";
13
+ import { useLocalization as se } from "@progress/kendo-react-intl";
14
+ import { toolbarGroup as p, messages as v, groupClearButton as K } from "../messages/index.mjs";
15
+ import { useDocument as ce, classNames as w, SvgIcon as g, useAsyncFocusBlur as ue, getActiveElement as ie } from "@progress/kendo-react-common";
16
+ import { BadgeContainer as me, Badge as de } from "@progress/kendo-react-indicators";
17
+ import { Popup as pe } from "@progress/kendo-react-popup";
18
+ import { GridToolbarAdaptiveProvider as ge } from "./adaptiveContext/GridToolbarAdaptiveContext.mjs";
19
+ import { GridAdaptiveToolbarGroup as fe } from "./adaptiveContent/GridAdaptiveToolbarGroup.mjs";
20
+ const ke = (s) => {
21
+ var S, z;
22
+ const a = e.useContext(ee), c = a.columnsState, P = a.groupable, o = a.group, G = a.defaultGroup, [M, d] = e.useState(!0), [O, m] = e.useState(!1), [f, k] = e.useState(!1), u = e.useRef(null), b = e.useRef(null), N = e.useRef(null), C = e.useRef(0), h = se(), U = ce(u);
23
+ e.useEffect(() => {
24
+ G || o != null && o.length ? (m(!0), d(!1)) : m(!1);
25
+ }, [G, o]);
26
+ const I = e.useMemo(
27
+ () => (c == null ? void 0 : c.filter((t) => {
28
+ var n;
29
+ return (n = t.title || t.field) == null ? void 0 : n.toLowerCase();
30
+ })) || [],
31
+ [c]
32
+ ), i = e.useCallback(() => {
33
+ var t;
34
+ s.onCloseMenu && s.onCloseMenu(), k(!1), u.current && ((t = u.current.element) == null || t.focus());
35
+ }, [s]), D = e.useCallback(
36
+ (t, n) => {
37
+ if (t.preventDefault(), !(n != null && n.field))
38
+ return;
39
+ const r = (o || []).slice(), l = r.findIndex(($) => $.field === n.field);
40
+ l > -1 ? r.splice(l, 1) : r.push({
41
+ field: n.field
42
+ }), a.groupChange(r, t), d(!1), m(!0);
43
+ },
44
+ [a, o]
45
+ ), B = e.useCallback(
46
+ (t, n) => {
47
+ if (t.preventDefault(), !(n != null && n.field))
48
+ return;
49
+ const r = (o || []).filter((l) => l.field !== n.field);
50
+ a.groupChange(r, t), r.length === 0 && (d(!0), m(!1), i());
51
+ },
52
+ [i, a, o]
53
+ ), T = e.useCallback(
54
+ (t, n) => {
55
+ if (n === 0)
56
+ return;
57
+ const r = [...o || []], l = r[n - 1];
58
+ r[n - 1] = r[n], r[n] = l, a.groupChange(r, t);
59
+ },
60
+ [o, a]
61
+ ), y = e.useCallback(
62
+ (t, n) => {
63
+ if (n === o.length - 1)
64
+ return;
65
+ const r = [...o || []], l = r[n + 1];
66
+ r[n + 1] = r[n], r[n] = l, a.groupChange(r, t);
67
+ },
68
+ [o, a]
69
+ ), V = e.useCallback(
70
+ (t, n) => {
71
+ const r = c == null ? void 0 : c.find((l) => l.field === t.field);
72
+ return /* @__PURE__ */ e.createElement(e.Fragment, null, o && o.length !== 1 && /* @__PURE__ */ e.createElement("span", { className: "k-group-menu-item-actions" }, /* @__PURE__ */ e.createElement(
73
+ "span",
74
+ {
75
+ className: w("k-group-menu-item-action k-group-menu-item-up-action", {
76
+ "k-disabled": n === 0
77
+ }),
78
+ "aria-disabled": n === 0,
79
+ onClick: (l) => T(l, n)
80
+ },
81
+ /* @__PURE__ */ e.createElement(g, { icon: te })
82
+ ), /* @__PURE__ */ e.createElement(
83
+ "span",
84
+ {
85
+ className: w("k-group-menu-item-action k-group-menu-item-down-action", {
86
+ "k-disabled": n === o.length - 1
87
+ }),
88
+ "aria-disabled": n === o.length - 1,
89
+ onClick: (l) => y(l, n)
90
+ },
91
+ /* @__PURE__ */ e.createElement(g, { icon: ne })
92
+ )), /* @__PURE__ */ e.createElement("span", { className: "k-group-item-text" }, (r == null ? void 0 : r.title) || t.field), /* @__PURE__ */ e.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ e.createElement("span", { className: "k-group-menu-item-actions" }, /* @__PURE__ */ e.createElement(
93
+ "span",
94
+ {
95
+ className: "k-group-menu-item-action k-group-menu-item-remove-action",
96
+ onClick: (l) => B(l, t)
97
+ },
98
+ /* @__PURE__ */ e.createElement(g, { icon: oe, size: a.mobileMode ? "large" : "medium" })
99
+ )));
100
+ },
101
+ [c, a.mobileMode, o, B, y, T]
102
+ ), H = e.useCallback(
103
+ (t) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("span", { className: "k-group-item-text" }, t.title || t.field), /* @__PURE__ */ e.createElement("span", { className: "k-spacer" }), /* @__PURE__ */ e.createElement("span", { className: "k-group-menu-item-actions" }, /* @__PURE__ */ e.createElement(
104
+ "span",
105
+ {
106
+ className: "k-group-menu-item-action k-group-menu-item-add-action",
107
+ onClick: (n) => D(n, t)
108
+ },
109
+ /* @__PURE__ */ e.createElement(g, { icon: ae, size: a.mobileMode ? "large" : "medium" })
110
+ ))),
111
+ [a.mobileMode, D]
112
+ ), _ = (t) => {
113
+ t.preventDefault(), k(!f);
114
+ }, E = e.useMemo(() => {
115
+ var t;
116
+ return (t = s.show) != null ? t : f;
117
+ }, [s.show, f]), j = (t) => {
118
+ const n = ie(document);
119
+ clearTimeout(C.current), C.current = window.setTimeout(() => {
120
+ !a.mobileMode && n && t.relatedTarget !== u.current && b.current && !b.current.contains(n) && i();
121
+ });
122
+ }, q = () => {
123
+ clearTimeout(C.current);
124
+ }, { onFocus: J, onBlur: Q } = ue({
125
+ onFocus: (t) => q(),
126
+ onBlur: (t) => j(t)
127
+ }), W = (t) => {
128
+ var n;
129
+ (n = N.current) == null || n.triggerMouseEvent(t);
130
+ }, X = (t) => {
131
+ var n;
132
+ (n = N.current) == null || n.triggerKeyboardEvent(t);
133
+ }, Y = (t) => {
134
+ !t.isAnchorClicked && k(!1);
135
+ }, A = e.useCallback(
136
+ (t) => {
137
+ a.groupChange([], t), d(!0), m(!1), i();
138
+ },
139
+ [i, a]
140
+ ), F = /* @__PURE__ */ e.createElement(e.Fragment, null, o && o.length > 0 && /* @__PURE__ */ e.createElement("div", { className: "k-group-menu-item-wrap" }, o == null ? void 0 : o.map((t, n) => /* @__PURE__ */ e.createElement("div", { className: "k-group-menu-item", key: t.field }, V(t, n)))), /* @__PURE__ */ e.createElement("div", { className: "k-group-menu-item-wrap" }, I.filter((t) => !(o != null && o.some((n) => n.field === t.field))).map((t) => t.field === "value" ? null : /* @__PURE__ */ e.createElement("div", { className: "k-group-menu-item", key: t.id }, H(t))))), Z = e.useMemo(() => s.svgIcon ? s.svgIcon : s.icon ? void 0 : re, [s.icon, s.svgIcon]), R = /* @__PURE__ */ e.createElement(
141
+ L,
142
+ {
143
+ ref: u,
144
+ togglable: !0,
145
+ selected: E,
146
+ svgIcon: Z,
147
+ icon: s.icon,
148
+ size: a.mobileMode ? "large" : "medium",
149
+ className: w("k-toolbar-button", {
150
+ "k-icon-button": a.mobileMode
151
+ }),
152
+ title: h.toLanguageString(p, v[p]),
153
+ onClick: _
154
+ },
155
+ !a.mobileMode && h.toLanguageString(p, v[p])
156
+ );
157
+ return P && /* @__PURE__ */ e.createElement(e.Fragment, null, O ? /* @__PURE__ */ e.createElement(me, null, R, /* @__PURE__ */ e.createElement(de, { themeColor: "primary" })) : R, a.mobileMode ? /* @__PURE__ */ e.createElement(ge, null, x.createPortal(
158
+ /* @__PURE__ */ e.createElement(
159
+ fe,
160
+ {
161
+ filtered: I,
162
+ computedShow: E,
163
+ isDisabledButton: M,
164
+ toolContent: F,
165
+ onClose: i,
166
+ onClear: A
167
+ }
168
+ ),
169
+ (S = U()) == null ? void 0 : S.body
170
+ )) : /* @__PURE__ */ e.createElement(
171
+ pe,
172
+ {
173
+ anchor: (z = u.current) == null ? void 0 : z.element,
174
+ show: E,
175
+ popupClass: "k-grid-columnmenu-popup",
176
+ onMouseDownOutside: Y
177
+ },
178
+ /* @__PURE__ */ e.createElement(
179
+ "div",
180
+ {
181
+ ref: b,
182
+ onBlur: Q,
183
+ onFocus: J,
184
+ onMouseDown: W,
185
+ onKeyDown: X,
186
+ className: "k-group-menu k-group-menu-md"
187
+ },
188
+ F,
189
+ /* @__PURE__ */ e.createElement("div", { className: "k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer" }, /* @__PURE__ */ e.createElement(
190
+ L,
191
+ {
192
+ svgIcon: le,
193
+ onClick: A,
194
+ disabled: M
195
+ },
196
+ h.toLanguageString(K, v[K])
197
+ ))
198
+ )
199
+ ));
200
+ };
201
+ ke.displayName = "KendoReactGridToolbarGroup";
202
+ export {
203
+ ke as GridToolbarGroup
204
+ };
@@ -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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("react"),Q=require("react-dom"),U=require("../columnMenu/GridColumnMenuItemGroup.js"),W=require("../columnMenu/GridColumnMenuItem.js"),X=require("../utils/GridContext.js"),R=require("@progress/kendo-react-buttons"),d=require("@progress/kendo-svg-icons"),Y=require("@progress/kendo-react-intl"),a=require("../messages/index.js"),u=require("@progress/kendo-react-common"),x=require("@progress/kendo-react-indicators"),Z=require("@progress/kendo-react-popup"),$=require("./adaptiveContext/GridToolbarAdaptiveContext.js"),ee=require("./adaptiveContent/GridAdaptiveToolbarSort.js");function te(r){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const l in r)if(l!=="default"){const i=Object.getOwnPropertyDescriptor(r,l);Object.defineProperty(n,l,i.get?i:{enumerable:!0,get:()=>r[l]})}}return n.default=r,Object.freeze(n)}const e=te(J),A=r=>{var q,B;const n=e.useContext(X.GridContext),l=n.columnsState,i=n.sortable,c=n.sort,h=n.defaultSort,[v,E]=e.useState(!0),[O,m]=e.useState(!1),[g,b]=e.useState(!1),s=e.useRef(null),f=e.useRef(null),M=e.useRef(null),C=e.useRef(0),S=Y.useLocalization(),N=u.useDocument(s);e.useEffect(()=>{h&&(m(!0),E(!1))},[h]);const p=e.useMemo(()=>(l==null?void 0:l.filter(t=>{var o;return(o=t.title||t.field)==null?void 0:o.toLowerCase()}))||[],[l]),w=e.useCallback((t,o)=>{n.headerCellClick(t,o),E(!1),m(!0)},[n]),I=e.useCallback(t=>{n.sortChange([],t),m(!1)},[n]),D=e.useCallback(t=>{const o=c?c.findIndex(H=>H.field===t.field):-1;return e.createElement(e.Fragment,null,t.title||t.field,e.createElement("span",{className:"k-columnmenu-indicators"},o>=0&&[e.createElement(u.SvgIcon,{key:1,icon:c[o].dir==="asc"?d.sortAscSmallIcon:d.sortDescSmallIcon}),c.length>1&&e.createElement("span",{key:2,className:"k-sort-index"},o+1)]))},[c]),P=t=>{t.preventDefault(),b(!g)},k=e.useMemo(()=>r.show!==void 0?r.show:g,[r.show,g]),y=()=>{var t;r.onCloseMenu&&r.onCloseMenu(),b(!1),s.current&&((t=s.current.element)==null||t.focus())},F=t=>{const o=u.getActiveElement(document);clearTimeout(C.current),C.current=window.setTimeout(()=>{!n.mobileMode&&o&&t.relatedTarget!==s.current&&f.current&&!f.current.contains(o)&&y()})},j=()=>{clearTimeout(C.current)},{onFocus:z,onBlur:L}=u.useAsyncFocusBlur({onFocus:t=>j(),onBlur:t=>F(t)}),K=t=>{var o;(o=M.current)==null||o.triggerMouseEvent(t)},_=t=>{var o;(o=M.current)==null||o.triggerKeyboardEvent(t)},V=t=>{!t.isAnchorClicked&&b(!1)},G=e.createElement(e.Fragment,null,e.createElement(U.GridColumnMenuItemGroup,null,p.map(t=>e.createElement(W.GridColumnMenuItem,{key:t.id,title:D(t),onClick:o=>w(o,t)}))),e.createElement("div",{className:"k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer"},e.createElement(R.Button,{svgIcon:d.xIcon,onClick:I,disabled:v},S.toLanguageString(a.sortClearButton,a.messages[a.sortClearButton])))),T=e.createElement(R.Button,{ref:s,togglable:!0,selected:k,svgIcon:r.svgIcon?r.svgIcon:r.icon?void 0:d.arrowsSwapIcon,icon:r.icon,size:n.mobileMode?"large":"medium",className:u.classNames("k-toolbar-button",{"k-icon-button":n.mobileMode}),title:S.toLanguageString(a.toolbarSort,a.messages[a.toolbarSort]),onClick:P},!n.mobileMode&&S.toLanguageString(a.toolbarSort,a.messages[a.toolbarSort]));return i&&e.createElement(e.Fragment,null,O?e.createElement(x.BadgeContainer,null,T,e.createElement(x.Badge,{themeColor:"primary"})):T,n.mobileMode?e.createElement($.GridToolbarAdaptiveProvider,null,Q.createPortal(e.createElement(ee.GridAdaptiveToolbarSort,{filtered:p,computedShow:k,isDisabledButton:v,renderTitle:D,onClose:y,onClear:I,handleSorting:w},G),(q=N())==null?void 0:q.body)):e.createElement(Z.Popup,{anchor:(B=s.current)==null?void 0:B.element,show:k,popupClass:"k-grid-columnmenu-popup",onMouseDownOutside:V},e.createElement("div",{ref:f,onBlur:L,onFocus:z,onMouseDown:K,onKeyDown:_,className:"k-column-menu k-column-menu-md"},G)))};A.displayName="KendoReactGridToolbarSort";exports.GridToolbarSort=A;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const J=require("react"),Q=require("react-dom"),U=require("../columnMenu/GridColumnMenuItemGroup.js"),W=require("../columnMenu/GridColumnMenuItem.js"),X=require("../utils/GridContext.js"),R=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-svg-icons"),Y=require("@progress/kendo-react-intl"),s=require("../messages/index.js"),u=require("@progress/kendo-react-common"),x=require("@progress/kendo-react-indicators"),Z=require("@progress/kendo-react-popup"),$=require("./adaptiveContext/GridToolbarAdaptiveContext.js"),ee=require("./adaptiveContent/GridAdaptiveToolbarSort.js");function te(r){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const l in r)if(l!=="default"){const i=Object.getOwnPropertyDescriptor(r,l);Object.defineProperty(n,l,i.get?i:{enumerable:!0,get:()=>r[l]})}}return n.default=r,Object.freeze(n)}const e=te(J),A=r=>{var q,B;const n=e.useContext(X.GridContext),l=n.columnsState,i=n.sortable,a=n.sort,h=n.defaultSort,[v,E]=e.useState(!0),[O,d]=e.useState(!1),[g,f]=e.useState(!1),c=e.useRef(null),b=e.useRef(null),M=e.useRef(null),C=e.useRef(0),S=Y.useLocalization(),N=u.useDocument(c);e.useEffect(()=>{h||a!=null&&a.length?(d(!0),E(!1)):d(!1)},[h,a]);const p=e.useMemo(()=>(l==null?void 0:l.filter(t=>{var o;return(o=t.title||t.field)==null?void 0:o.toLowerCase()}))||[],[l]),w=e.useCallback((t,o)=>{n.headerCellClick(t,o),E(!1),d(!0)},[n]),I=e.useCallback(t=>{n.sortChange([],t),d(!1)},[n]),D=e.useCallback(t=>{const o=a?a.findIndex(H=>H.field===t.field):-1;return e.createElement(e.Fragment,null,t.title||t.field,e.createElement("span",{className:"k-columnmenu-indicators"},o>=0&&[e.createElement(u.SvgIcon,{key:1,icon:a[o].dir==="asc"?m.sortAscSmallIcon:m.sortDescSmallIcon}),a.length>1&&e.createElement("span",{key:2,className:"k-sort-index"},o+1)]))},[a]),P=t=>{t.preventDefault(),f(!g)},k=e.useMemo(()=>r.show!==void 0?r.show:g,[r.show,g]),y=()=>{var t;r.onCloseMenu&&r.onCloseMenu(),f(!1),c.current&&((t=c.current.element)==null||t.focus())},F=t=>{const o=u.getActiveElement(document);clearTimeout(C.current),C.current=window.setTimeout(()=>{!n.mobileMode&&o&&t.relatedTarget!==c.current&&b.current&&!b.current.contains(o)&&y()})},j=()=>{clearTimeout(C.current)},{onFocus:z,onBlur:L}=u.useAsyncFocusBlur({onFocus:t=>j(),onBlur:t=>F(t)}),K=t=>{var o;(o=M.current)==null||o.triggerMouseEvent(t)},_=t=>{var o;(o=M.current)==null||o.triggerKeyboardEvent(t)},V=t=>{!t.isAnchorClicked&&f(!1)},G=e.createElement(e.Fragment,null,e.createElement(U.GridColumnMenuItemGroup,null,p.map(t=>e.createElement(W.GridColumnMenuItem,{key:t.id,title:D(t),onClick:o=>w(o,t)}))),e.createElement("div",{className:"k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer"},e.createElement(R.Button,{svgIcon:m.xIcon,onClick:I,disabled:v},S.toLanguageString(s.sortClearButton,s.messages[s.sortClearButton])))),T=e.createElement(R.Button,{ref:c,togglable:!0,selected:k,svgIcon:r.svgIcon?r.svgIcon:r.icon?void 0:m.arrowsSwapIcon,icon:r.icon,size:n.mobileMode?"large":"medium",className:u.classNames("k-toolbar-button",{"k-icon-button":n.mobileMode}),title:S.toLanguageString(s.toolbarSort,s.messages[s.toolbarSort]),onClick:P},!n.mobileMode&&S.toLanguageString(s.toolbarSort,s.messages[s.toolbarSort]));return i&&e.createElement(e.Fragment,null,O?e.createElement(x.BadgeContainer,null,T,e.createElement(x.Badge,{themeColor:"primary"})):T,n.mobileMode?e.createElement($.GridToolbarAdaptiveProvider,null,Q.createPortal(e.createElement(ee.GridAdaptiveToolbarSort,{filtered:p,computedShow:k,isDisabledButton:v,renderTitle:D,onClose:y,onClear:I,handleSorting:w},G),(q=N())==null?void 0:q.body)):e.createElement(Z.Popup,{anchor:(B=c.current)==null?void 0:B.element,show:k,popupClass:"k-grid-columnmenu-popup",onMouseDownOutside:V},e.createElement("div",{ref:b,onBlur:L,onFocus:z,onMouseDown:K,onKeyDown:_,className:"k-column-menu k-column-menu-md"},G)))};A.displayName="KendoReactGridToolbarSort";exports.GridToolbarSort=A;
@@ -13,7 +13,7 @@ import { GridContext as Q } from "../utils/GridContext.mjs";
13
13
  import { Button as x } from "@progress/kendo-react-buttons";
14
14
  import { sortAscSmallIcon as U, sortDescSmallIcon as W, xIcon as X, arrowsSwapIcon as Y } from "@progress/kendo-svg-icons";
15
15
  import { useLocalization as Z } from "@progress/kendo-react-intl";
16
- import { sortClearButton as A, messages as b, toolbarSort as c } from "../messages/index.mjs";
16
+ import { sortClearButton as A, messages as b, toolbarSort as i } from "../messages/index.mjs";
17
17
  import { useDocument as $, SvgIcon as ee, useAsyncFocusBlur as te, classNames as oe, getActiveElement as ne } from "@progress/kendo-react-common";
18
18
  import { BadgeContainer as re, Badge as le } from "@progress/kendo-react-indicators";
19
19
  import { Popup as ae } from "@progress/kendo-react-popup";
@@ -21,10 +21,10 @@ import { GridToolbarAdaptiveProvider as se } from "./adaptiveContext/GridToolbar
21
21
  import { GridAdaptiveToolbarSort as ce } from "./adaptiveContent/GridAdaptiveToolbarSort.mjs";
22
22
  const ie = (r) => {
23
23
  var y, T;
24
- const n = e.useContext(Q), s = n.columnsState, G = n.sortable, a = n.sort, h = n.defaultSort, [p, k] = e.useState(!0), [F, i] = e.useState(!1), [u, m] = e.useState(!1), l = e.useRef(null), d = e.useRef(null), E = e.useRef(null), f = e.useRef(0), g = Z(), N = $(l);
24
+ const n = e.useContext(Q), s = n.columnsState, G = n.sortable, l = n.sort, h = n.defaultSort, [p, k] = e.useState(!0), [F, c] = e.useState(!1), [u, m] = e.useState(!1), a = e.useRef(null), d = e.useRef(null), E = e.useRef(null), f = e.useRef(0), g = Z(), N = $(a);
25
25
  e.useEffect(() => {
26
- h && (i(!0), k(!1));
27
- }, [h]);
26
+ h || l != null && l.length ? (c(!0), k(!1)) : c(!1);
27
+ }, [h, l]);
28
28
  const S = e.useMemo(
29
29
  () => (s == null ? void 0 : s.filter((t) => {
30
30
  var o;
@@ -33,38 +33,38 @@ const ie = (r) => {
33
33
  [s]
34
34
  ), v = e.useCallback(
35
35
  (t, o) => {
36
- n.headerCellClick(t, o), k(!1), i(!0);
36
+ n.headerCellClick(t, o), k(!1), c(!0);
37
37
  },
38
38
  [n]
39
39
  ), w = e.useCallback(
40
40
  (t) => {
41
- n.sortChange([], t), i(!1);
41
+ n.sortChange([], t), c(!1);
42
42
  },
43
43
  [n]
44
44
  ), M = e.useCallback(
45
45
  (t) => {
46
- const o = a ? a.findIndex((_) => _.field === t.field) : -1;
46
+ const o = l ? l.findIndex((_) => _.field === t.field) : -1;
47
47
  return /* @__PURE__ */ e.createElement(e.Fragment, null, t.title || t.field, /* @__PURE__ */ e.createElement("span", { className: "k-columnmenu-indicators" }, o >= 0 && [
48
48
  /* @__PURE__ */ e.createElement(
49
49
  ee,
50
50
  {
51
51
  key: 1,
52
- icon: a[o].dir === "asc" ? U : W
52
+ icon: l[o].dir === "asc" ? U : W
53
53
  }
54
54
  ),
55
- a.length > 1 && /* @__PURE__ */ e.createElement("span", { key: 2, className: "k-sort-index" }, o + 1)
55
+ l.length > 1 && /* @__PURE__ */ e.createElement("span", { key: 2, className: "k-sort-index" }, o + 1)
56
56
  ]));
57
57
  },
58
- [a]
58
+ [l]
59
59
  ), R = (t) => {
60
60
  t.preventDefault(), m(!u);
61
61
  }, C = e.useMemo(() => r.show !== void 0 ? r.show : u, [r.show, u]), D = () => {
62
62
  var t;
63
- r.onCloseMenu && r.onCloseMenu(), m(!1), l.current && ((t = l.current.element) == null || t.focus());
63
+ r.onCloseMenu && r.onCloseMenu(), m(!1), a.current && ((t = a.current.element) == null || t.focus());
64
64
  }, L = (t) => {
65
65
  const o = ne(document);
66
66
  clearTimeout(f.current), f.current = window.setTimeout(() => {
67
- !n.mobileMode && o && t.relatedTarget !== l.current && d.current && !d.current.contains(o) && D();
67
+ !n.mobileMode && o && t.relatedTarget !== a.current && d.current && !d.current.contains(o) && D();
68
68
  });
69
69
  }, z = () => {
70
70
  clearTimeout(f.current);
@@ -89,7 +89,7 @@ const ie = (r) => {
89
89
  ))), /* @__PURE__ */ e.createElement("div", { className: "k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer" }, /* @__PURE__ */ e.createElement(x, { svgIcon: X, onClick: w, disabled: p }, g.toLanguageString(A, b[A])))), B = /* @__PURE__ */ e.createElement(
90
90
  x,
91
91
  {
92
- ref: l,
92
+ ref: a,
93
93
  togglable: !0,
94
94
  selected: C,
95
95
  svgIcon: r.svgIcon ? r.svgIcon : r.icon ? void 0 : Y,
@@ -98,10 +98,10 @@ const ie = (r) => {
98
98
  className: oe("k-toolbar-button", {
99
99
  "k-icon-button": n.mobileMode
100
100
  }),
101
- title: g.toLanguageString(c, b[c]),
101
+ title: g.toLanguageString(i, b[i]),
102
102
  onClick: R
103
103
  },
104
- !n.mobileMode && g.toLanguageString(c, b[c])
104
+ !n.mobileMode && g.toLanguageString(i, b[i])
105
105
  );
106
106
  return G && /* @__PURE__ */ e.createElement(e.Fragment, null, F ? /* @__PURE__ */ e.createElement(re, null, B, /* @__PURE__ */ e.createElement(le, { themeColor: "primary" })) : B, n.mobileMode ? /* @__PURE__ */ e.createElement(se, null, j.createPortal(
107
107
  /* @__PURE__ */ e.createElement(
@@ -121,7 +121,7 @@ const ie = (r) => {
121
121
  )) : /* @__PURE__ */ e.createElement(
122
122
  ae,
123
123
  {
124
- anchor: (T = l.current) == null ? void 0 : T.element,
124
+ anchor: (T = a.current) == null ? void 0 : T.element,
125
125
  show: C,
126
126
  popupClass: "k-grid-columnmenu-popup",
127
127
  onMouseDownOutside: H
@@ -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 e=require("react"),l=require("@progress/kendo-svg-icons"),t=require("../../messages/index.js"),r=require("@progress/kendo-react-buttons"),m=require("@progress/kendo-react-intl"),n=require("@progress/kendo-react-layout"),g=require("../../utils/GridContext.js"),v=require("../adaptiveContext/GridToolbarAdaptiveContext.js"),C=require("@progress/kendo-react-common"),p=o=>{const c=e.useContext(g.GridContext),{actionSheetRef:s}=e.useContext(v.GridToolbarAdaptiveContext),a=C.useAdaptiveModeContext(),i=m.useLocalization(),u={animation:!0,navigatable:!1,navigatableElements:[],expand:o.computedShow,animationStyles:a&&c.adaptiveColumnMenuRef<=a.small?{top:0,width:"100%",height:"100%"}:void 0,className:"k-adaptive-actionsheet",position:a&&c.adaptiveColumnMenuRef<=a.small?"fullscreen":void 0},d=i.toLanguageString(t.adaptiveToolbarGroupTitle,t.messages[t.adaptiveToolbarGroupTitle]);return e.createElement(n.ActionSheet,{...u,ref:s,style:{"--kendo-actionsheet-view-current":1},onClose:o.onClose},e.createElement(n.ActionSheetView,null,e.createElement(n.ActionSheetHeader,null,e.createElement("div",{className:"k-actionsheet-titlebar-group"},e.createElement("div",{className:"k-actionsheet-title"},e.createElement("div",{className:"k-text-center"},d)),e.createElement("div",{className:"k-actionsheet-actions"},e.createElement(r.Button,{type:"button",svgIcon:l.checkIcon,themeColor:"primary",onClick:o.onClose,fillMode:"flat"})))),e.createElement(n.ActionSheetContent,null,e.createElement("div",{className:"k-group-menu k-group-menu-lg"},o.toolContent)),e.createElement(n.ActionSheetFooter,null,e.createElement("div",{className:"k-actions k-actions-stretched"},e.createElement(r.Button,{svgIcon:l.xIcon,onClick:o.onClear,size:"large",disabled:o.isDisabledButton},i.toLanguageString(t.groupClearButton,t.messages[t.groupClearButton])),e.createElement(r.Button,{svgIcon:l.checkIcon,themeColor:"primary",size:"large",onClick:o.onClose},i.toLanguageString(t.groupApplyButton,t.messages[t.groupApplyButton]))))))};exports.GridAdaptiveToolbarGroup=p;
@@ -0,0 +1,59 @@
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 e from "react";
10
+ import { checkIcon as r, xIcon as p } from "@progress/kendo-svg-icons";
11
+ import { adaptiveToolbarGroupTitle as c, messages as a, groupClearButton as m, groupApplyButton as s } from "../../messages/index.mjs";
12
+ import { Button as i } from "@progress/kendo-react-buttons";
13
+ import { useLocalization as v } from "@progress/kendo-react-intl";
14
+ import { ActionSheet as C, ActionSheetView as h, ActionSheetHeader as f, ActionSheetContent as E, ActionSheetFooter as k } from "@progress/kendo-react-layout";
15
+ import { GridContext as S } from "../../utils/GridContext.mjs";
16
+ import { GridToolbarAdaptiveContext as x } from "../adaptiveContext/GridToolbarAdaptiveContext.mjs";
17
+ import { useAdaptiveModeContext as b } from "@progress/kendo-react-common";
18
+ const M = (t) => {
19
+ const l = e.useContext(S), { actionSheetRef: u } = e.useContext(x), o = b(), n = v(), d = {
20
+ animation: !0,
21
+ navigatable: !1,
22
+ navigatableElements: [],
23
+ expand: t.computedShow,
24
+ animationStyles: o && l.adaptiveColumnMenuRef <= o.small ? { top: 0, width: "100%", height: "100%" } : void 0,
25
+ className: "k-adaptive-actionsheet",
26
+ position: o && l.adaptiveColumnMenuRef <= o.small ? "fullscreen" : void 0
27
+ }, g = n.toLanguageString(c, a[c]);
28
+ return /* @__PURE__ */ e.createElement(
29
+ C,
30
+ {
31
+ ...d,
32
+ ref: u,
33
+ style: { "--kendo-actionsheet-view-current": 1 },
34
+ onClose: t.onClose
35
+ },
36
+ /* @__PURE__ */ e.createElement(h, null, /* @__PURE__ */ e.createElement(f, null, /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-titlebar-group" }, /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-title" }, /* @__PURE__ */ e.createElement("div", { className: "k-text-center" }, g)), /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ e.createElement(
37
+ i,
38
+ {
39
+ type: "button",
40
+ svgIcon: r,
41
+ themeColor: "primary",
42
+ onClick: t.onClose,
43
+ fillMode: "flat"
44
+ }
45
+ )))), /* @__PURE__ */ e.createElement(E, null, /* @__PURE__ */ e.createElement("div", { className: "k-group-menu k-group-menu-lg" }, t.toolContent)), /* @__PURE__ */ e.createElement(k, null, /* @__PURE__ */ e.createElement("div", { className: "k-actions k-actions-stretched" }, /* @__PURE__ */ e.createElement(
46
+ i,
47
+ {
48
+ svgIcon: p,
49
+ onClick: t.onClear,
50
+ size: "large",
51
+ disabled: t.isDisabledButton
52
+ },
53
+ n.toLanguageString(m, a[m])
54
+ ), /* @__PURE__ */ e.createElement(i, { svgIcon: r, themeColor: "primary", size: "large", onClick: t.onClose }, n.toLanguageString(s, a[s])))))
55
+ );
56
+ };
57
+ export {
58
+ M as GridAdaptiveToolbarGroup
59
+ };
package/utils/premium.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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),a=require("@progress/kendo-react-data-tools"),c=require("../sortCommon.js"),m=require("../paging/GridPagerSettings.js");function b(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=b(d),y=e=>({lockedColumn:e.some(r=>r.locked)}),g=e=>({multiColumn:e.some(r=>r.children&&r.children.length>0)}),C=e=>({columnCellTemplate:e.some(r=>r.columnType!=="data"?!1:r.cells)}),p=e=>({columnMenu:e.some(r=>r.columnMenu)}),f=e=>o.Children.toArray(e.children).some(t=>t&&t.type&&t.type.displayName==="KendoReactGridColumn"?t.props.hidden:!1),h=e=>o.Children.toArray(e.children).some(t=>t&&t.type&&t.type.displayName==="KendoReactGridToolbar"&&t.props&&t.props.children?o.Children.toArray(t.props.children).some(l=>l.type&&(l.type.displayName==="KendoReactGridToolbarSort"||l.type.displayName==="KendoReactGridToolbarFilter"||l.type.displayName==="KendoReactGridToolbarCheckboxFilter"||l.type.displayName==="KendoReactGridToolbarColumnsChooser")):!1),i=e=>{const r=a.getSelectionOptions(e.selectable),t=a.getEditableOptions(e.editable),n=e.sortable&&c.normalizeSortable(e.sortable),l=e.pageable&&m.normalize(e.pageable);return{cells:!!e.cells,pdf:!!e.pdf,detail:!!e.detail,rows:!!e.rows,editableInline:t.mode==="inline",selectionMultiple:r.enabled&&r.mode==="multiple",selectionDrag:r.enabled&&r.drag,columnMenu:!!e.columnMenu,filterOperators:!!e.filterOperators,groupable:!!e.groupable,group:!!e.group,groupExpand:!!e.groupExpand,customPager:!!e.pager,clipboard:!!e.clipboard,contextMenu:!!e.contextMenu,serverGrid:!e.isClient,scrollableVirtual:e.scrollable==="virtual",pageableInput:!!(e.pageable&&l.type==="input"),sortableMultiple:!!(e.sortable&&n.mode==="multiple"),hiddenColumns:f(e)}},s=e=>({...y(e),...g(e),...C(e),...p(e)}),u=e=>({toolbarTools:h(e)}),P=(e,r)=>{const t={...i(e),...s(r),...u(e)};return Object.keys(t).filter(n=>t[n]===!0)};exports.gridPremiumFeatures=P;exports.isPremiumGridByColumns=s;exports.isPremiumGridByComponents=u;exports.isPremiumGridByProps=i;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),a=require("@progress/kendo-react-data-tools"),c=require("../sortCommon.js"),m=require("../paging/GridPagerSettings.js");function b(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const o=b(d),y=e=>({lockedColumn:e.some(r=>r.locked)}),g=e=>({multiColumn:e.some(r=>r.children&&r.children.length>0)}),C=e=>({columnCellTemplate:e.some(r=>r.columnType!=="data"?!1:r.cells)}),p=e=>({columnMenu:e.some(r=>r.columnMenu)}),f=e=>o.Children.toArray(e.children).some(t=>t&&t.type&&t.type.displayName==="KendoReactGridColumn"?t.props.hidden:!1),h=e=>o.Children.toArray(e.children).some(t=>t&&t.type&&t.type.displayName==="KendoReactGridToolbar"&&t.props&&t.props.children?o.Children.toArray(t.props.children).some(n=>n.type&&(n.type.displayName==="KendoReactGridToolbarSort"||n.type.displayName==="KendoReactGridToolbarFilter"||n.type.displayName==="KendoReactGridToolbarCheckboxFilter"||n.type.displayName==="KendoReactGridToolbarColumnsChooser"||n.type.displayName==="KendoReactGridToolbarGroup")):!1),i=e=>{const r=a.getSelectionOptions(e.selectable),t=a.getEditableOptions(e.editable),l=e.sortable&&c.normalizeSortable(e.sortable),n=e.pageable&&m.normalize(e.pageable);return{cells:!!e.cells,pdf:!!e.pdf,detail:!!e.detail,rows:!!e.rows,editableInline:t.mode==="inline",selectionMultiple:r.enabled&&r.mode==="multiple",selectionDrag:r.enabled&&r.drag,columnMenu:!!e.columnMenu,filterOperators:!!e.filterOperators,groupable:!!e.groupable,group:!!e.group,groupExpand:!!e.groupExpand,customPager:!!e.pager,clipboard:!!e.clipboard,contextMenu:!!e.contextMenu,serverGrid:!e.isClient,scrollableVirtual:e.scrollable==="virtual",pageableInput:!!(e.pageable&&n.type==="input"),sortableMultiple:!!(e.sortable&&l.mode==="multiple"),hiddenColumns:f(e)}},s=e=>({...y(e),...g(e),...C(e),...p(e)}),u=e=>({toolbarTools:h(e)}),G=(e,r)=>{const t={...i(e),...s(r),...u(e)};return Object.keys(t).filter(l=>t[l]===!0)};exports.gridPremiumFeatures=G;exports.isPremiumGridByColumns=s;exports.isPremiumGridByComponents=u;exports.isPremiumGridByProps=i;
package/utils/premium.mjs CHANGED
@@ -17,7 +17,7 @@ const u = (e) => ({
17
17
  columnCellTemplate: e.some((r) => r.columnType !== "data" ? !1 : r.cells)
18
18
  }), b = (e) => ({
19
19
  columnMenu: e.some((r) => r.columnMenu)
20
- }), y = (e) => a.Children.toArray(e.children).some((t) => t && t.type && t.type.displayName === "KendoReactGridColumn" ? t.props.hidden : !1), C = (e) => a.Children.toArray(e.children).some((t) => t && t.type && t.type.displayName === "KendoReactGridToolbar" && t.props && t.props.children ? a.Children.toArray(t.props.children).some((l) => l.type && (l.type.displayName === "KendoReactGridToolbarSort" || l.type.displayName === "KendoReactGridToolbarFilter" || l.type.displayName === "KendoReactGridToolbarCheckboxFilter" || l.type.displayName === "KendoReactGridToolbarColumnsChooser")) : !1), g = (e) => {
20
+ }), y = (e) => a.Children.toArray(e.children).some((t) => t && t.type && t.type.displayName === "KendoReactGridColumn" ? t.props.hidden : !1), C = (e) => a.Children.toArray(e.children).some((t) => t && t.type && t.type.displayName === "KendoReactGridToolbar" && t.props && t.props.children ? a.Children.toArray(t.props.children).some((l) => l.type && (l.type.displayName === "KendoReactGridToolbarSort" || l.type.displayName === "KendoReactGridToolbarFilter" || l.type.displayName === "KendoReactGridToolbarCheckboxFilter" || l.type.displayName === "KendoReactGridToolbarColumnsChooser" || l.type.displayName === "KendoReactGridToolbarGroup")) : !1), p = (e) => {
21
21
  const r = o(e.selectable), t = i(e.editable), n = e.sortable && s(e.sortable), l = e.pageable && d(e.pageable);
22
22
  return {
23
23
  cells: !!e.cells,
@@ -41,24 +41,24 @@ const u = (e) => ({
41
41
  sortableMultiple: !!(e.sortable && n.mode === "multiple"),
42
42
  hiddenColumns: y(e)
43
43
  };
44
- }, h = (e) => ({
44
+ }, g = (e) => ({
45
45
  ...u(e),
46
46
  ...m(e),
47
47
  ...c(e),
48
48
  ...b(e)
49
- }), p = (e) => ({
49
+ }), h = (e) => ({
50
50
  toolbarTools: C(e)
51
- }), G = (e, r) => {
51
+ }), A = (e, r) => {
52
52
  const t = {
53
- ...g(e),
54
- ...h(r),
55
- ...p(e)
53
+ ...p(e),
54
+ ...g(r),
55
+ ...h(e)
56
56
  };
57
57
  return Object.keys(t).filter((n) => t[n] === !0);
58
58
  };
59
59
  export {
60
- G as gridPremiumFeatures,
61
- h as isPremiumGridByColumns,
62
- p as isPremiumGridByComponents,
63
- g as isPremiumGridByProps
60
+ A as gridPremiumFeatures,
61
+ g as isPremiumGridByColumns,
62
+ h as isPremiumGridByComponents,
63
+ p as isPremiumGridByProps
64
64
  };