@progress/kendo-react-grid 11.2.1-develop.1 → 11.3.0-develop.2
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 +1 -0
- package/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +1 -0
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +247 -244
- package/cells/datacell/utils.js +1 -1
- package/cells/datacell/utils.mjs +9 -9
- package/cells/rowreordercell/utils.js +1 -1
- package/cells/rowreordercell/utils.mjs +8 -8
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.d.mts +72 -0
- package/index.d.ts +72 -0
- package/index.js +1 -1
- package/index.mjs +50 -48
- package/messages/index.js +1 -1
- package/messages/index.mjs +83 -75
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +16 -16
- package/rows/GridRow.js +1 -1
- package/rows/GridRow.mjs +19 -18
- package/toolbar-tools/GridToolbarFilter.js +1 -1
- package/toolbar-tools/GridToolbarFilter.mjs +126 -128
- package/toolbar-tools/GridToolbarGroup.js +8 -0
- package/toolbar-tools/GridToolbarGroup.mjs +204 -0
- package/toolbar-tools/GridToolbarSort.js +1 -1
- package/toolbar-tools/GridToolbarSort.mjs +16 -16
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarGroup.js +9 -0
- package/toolbar-tools/adaptiveContent/GridAdaptiveToolbarGroup.mjs +59 -0
- package/utils/index.js +1 -1
- package/utils/index.mjs +64 -63
- package/utils/premium.js +1 -1
- package/utils/premium.mjs +11 -11
|
@@ -0,0 +1,8 @@
|
|
|
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 strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react"),ee=require("react-dom"),te=require("../utils/GridContext.js"),F=require("@progress/kendo-react-buttons"),g=require("@progress/kendo-svg-icons"),ne=require("@progress/kendo-react-intl"),i=require("../messages/index.js"),u=require("@progress/kendo-react-common"),P=require("@progress/kendo-react-indicators"),oe=require("@progress/kendo-react-popup"),ae=require("./adaptiveContext/GridToolbarAdaptiveContext.js"),re=require("./adaptiveContent/GridAdaptiveToolbarGroup.js");function le(l){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const c in l)if(c!=="default"){const f=Object.getOwnPropertyDescriptor(l,c);Object.defineProperty(o,c,f.get?f:{enumerable:!0,get:()=>l[c]})}}return o.default=l,Object.freeze(o)}const e=le(x),z=l=>{var A,O;const o=e.useContext(te.GridContext),c=o.columnsState,f=o.groupable,a=o.group,w=o.defaultGroup,[I,k]=e.useState(!0),[j,p]=e.useState(!1),[b,C]=e.useState(!1),m=e.useRef(null),v=e.useRef(null),M=e.useRef(null),h=e.useRef(0),E=ne.useLocalization(),L=u.useDocument(m);e.useEffect(()=>{w||a!=null&&a.length?(p(!0),k(!1)):p(!1)},[w,a]);const N=e.useMemo(()=>(c==null?void 0:c.filter(t=>{var n;return(n=t.title||t.field)==null?void 0:n.toLowerCase()}))||[],[c]),d=e.useCallback(()=>{var t;l.onCloseMenu&&l.onCloseMenu(),C(!1),m.current&&((t=m.current.element)==null||t.focus())},[l]),D=e.useCallback((t,n)=>{if(t.preventDefault(),!(n!=null&&n.field))return;const r=(a||[]).slice(),s=r.findIndex($=>$.field===n.field);s>-1?r.splice(s,1):r.push({field:n.field}),o.groupChange(r,t),k(!1),p(!0)},[o,a]),T=e.useCallback((t,n)=>{if(t.preventDefault(),!(n!=null&&n.field))return;const r=(a||[]).filter(s=>s.field!==n.field);o.groupChange(r,t),r.length===0&&(k(!0),p(!1),d())},[d,o,a]),S=e.useCallback((t,n)=>{if(n===0)return;const r=[...a||[]],s=r[n-1];r[n-1]=r[n],r[n]=s,o.groupChange(r,t)},[a,o]),y=e.useCallback((t,n)=>{if(n===a.length-1)return;const r=[...a||[]],s=r[n+1];r[n+1]=r[n],r[n]=s,o.groupChange(r,t)},[a,o]),K=e.useCallback((t,n)=>{const r=c==null?void 0:c.find(s=>s.field===t.field);return e.createElement(e.Fragment,null,a&&a.length!==1&&e.createElement("span",{className:"k-group-menu-item-actions"},e.createElement("span",{className:u.classNames("k-group-menu-item-action k-group-menu-item-up-action",{"k-disabled":n===0}),"aria-disabled":n===0,onClick:s=>S(s,n)},e.createElement(u.SvgIcon,{icon:g.chevronUpIcon})),e.createElement("span",{className:u.classNames("k-group-menu-item-action k-group-menu-item-down-action",{"k-disabled":n===a.length-1}),"aria-disabled":n===a.length-1,onClick:s=>y(s,n)},e.createElement(u.SvgIcon,{icon:g.chevronDownIcon}))),e.createElement("span",{className:"k-group-item-text"},(r==null?void 0:r.title)||t.field),e.createElement("span",{className:"k-spacer"}),e.createElement("span",{className:"k-group-menu-item-actions"},e.createElement("span",{className:"k-group-menu-item-action k-group-menu-item-remove-action",onClick:s=>T(s,t)},e.createElement(u.SvgIcon,{icon:g.xCircleIcon,size:o.mobileMode?"large":"medium"}))))},[c,o.mobileMode,a,T,y,S]),_=e.useCallback(t=>e.createElement(e.Fragment,null,e.createElement("span",{className:"k-group-item-text"},t.title||t.field),e.createElement("span",{className:"k-spacer"}),e.createElement("span",{className:"k-group-menu-item-actions"},e.createElement("span",{className:"k-group-menu-item-action k-group-menu-item-add-action",onClick:n=>D(n,t)},e.createElement(u.SvgIcon,{icon:g.plusCircleIcon,size:o.mobileMode?"large":"medium"})))),[o.mobileMode,D]),U=t=>{t.preventDefault(),C(!b)},G=e.useMemo(()=>{var t;return(t=l.show)!=null?t:b},[l.show,b]),V=t=>{const n=u.getActiveElement(document);clearTimeout(h.current),h.current=window.setTimeout(()=>{!o.mobileMode&&n&&t.relatedTarget!==m.current&&v.current&&!v.current.contains(n)&&d()})},H=()=>{clearTimeout(h.current)},{onFocus:J,onBlur:Q}=u.useAsyncFocusBlur({onFocus:t=>H(),onBlur:t=>V(t)}),W=t=>{var n;(n=M.current)==null||n.triggerMouseEvent(t)},X=t=>{var n;(n=M.current)==null||n.triggerKeyboardEvent(t)},Y=t=>{!t.isAnchorClicked&&C(!1)},B=e.useCallback(t=>{o.groupChange([],t),k(!0),p(!1),d()},[d,o]),R=e.createElement(e.Fragment,null,a&&a.length>0&&e.createElement("div",{className:"k-group-menu-item-wrap"},a==null?void 0:a.map((t,n)=>e.createElement("div",{className:"k-group-menu-item",key:t.id},K(t,n)))),e.createElement("div",{className:"k-group-menu-item-wrap"},N.filter(t=>!(a!=null&&a.some(n=>n.field===t.field))).map(t=>t.field==="value"?null:e.createElement("div",{className:"k-group-menu-item",key:t.id},_(t))))),Z=e.useMemo(()=>l.svgIcon?l.svgIcon:l.icon?void 0:g.groupIcon,[l.icon,l.svgIcon]),q=e.createElement(F.Button,{ref:m,togglable:!0,selected:G,svgIcon:Z,icon:l.icon,size:o.mobileMode?"large":"medium",className:u.classNames("k-toolbar-button",{"k-icon-button":o.mobileMode}),title:E.toLanguageString(i.toolbarGroup,i.messages[i.toolbarGroup]),onClick:U},!o.mobileMode&&E.toLanguageString(i.toolbarGroup,i.messages[i.toolbarGroup]));return f&&e.createElement(e.Fragment,null,j?e.createElement(P.BadgeContainer,null,q,e.createElement(P.Badge,{themeColor:"primary"})):q,o.mobileMode?e.createElement(ae.GridToolbarAdaptiveProvider,null,ee.createPortal(e.createElement(re.GridAdaptiveToolbarGroup,{filtered:N,computedShow:G,isDisabledButton:I,toolContent:R,onClose:d,onClear:B}),(A=L())==null?void 0:A.body)):e.createElement(oe.Popup,{anchor:(O=m.current)==null?void 0:O.element,show:G,popupClass:"k-grid-columnmenu-popup",onMouseDownOutside:Y},e.createElement("div",{ref:v,onBlur:Q,onFocus:J,onMouseDown:W,onKeyDown:X,className:"k-group-menu k-group-menu-md"},R,e.createElement("div",{className:"k-actions k-actions-stretched k-actions-horizontal k-column-menu-footer"},e.createElement(F.Button,{svgIcon:g.xIcon,onClick:B,disabled:I},E.toLanguageString(i.groupClearButton,i.messages[i.groupClearButton]))))))};z.displayName="KendoReactGridToolbarGroup";exports.GridToolbarGroup=z;
|
|
@@ -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.id }, 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"),
|
|
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
|
|
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,
|
|
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 && (
|
|
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),
|
|
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),
|
|
41
|
+
n.sortChange([], t), c(!1);
|
|
42
42
|
},
|
|
43
43
|
[n]
|
|
44
44
|
), M = e.useCallback(
|
|
45
45
|
(t) => {
|
|
46
|
-
const o =
|
|
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:
|
|
52
|
+
icon: l[o].dir === "asc" ? U : W
|
|
53
53
|
}
|
|
54
54
|
),
|
|
55
|
-
|
|
55
|
+
l.length > 1 && /* @__PURE__ */ e.createElement("span", { key: 2, className: "k-sort-index" }, o + 1)
|
|
56
56
|
]));
|
|
57
57
|
},
|
|
58
|
-
[
|
|
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),
|
|
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 !==
|
|
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:
|
|
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(
|
|
101
|
+
title: g.toLanguageString(i, b[i]),
|
|
102
102
|
onClick: R
|
|
103
103
|
},
|
|
104
|
-
!n.mobileMode && g.toLanguageString(
|
|
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 =
|
|
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/index.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 A=require("react"),w=require("../GridColumn.js"),S=require("@progress/kendo-data-query"),I=require("@progress/kendo-react-data-tools"),G=require("./_serverModule.js"),O=require("./_clientModule.js"),c=require("../contextMenu/enums.js"),T=require("@progress/kendo-react-common");function
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react"),w=require("../GridColumn.js"),S=require("@progress/kendo-data-query"),I=require("@progress/kendo-react-data-tools"),G=require("./_serverModule.js"),O=require("./_clientModule.js"),c=require("../contextMenu/enums.js"),T=require("@progress/kendo-react-common");function H(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const y=H(A);function j(e,t){const n=(e!=null?e:"").split(".");let r=t;return n.forEach(d=>{r=r?r[d]:void 0}),r}function v(e,t,n,r,d,l,a,i,o,s=0,f){var u;let g=s;for(let h=0;h<t.length;h++){let x;if(!d||t[h].value===void 0||t[h].items===void 0){e[e.length]={dataIndex:r.index,dataItem:t[h],rowType:"data",level:s,group:f,expanded:(u=o?!!(l!=null&&l[S.getter(o)(t[h])]):!1)!=null?u:!1},r.index++;continue}else{let m;f!=null&&f.parents?m=[{field:f.field,value:f.value},...f.parents]:f?m=[f]:m=[],x={field:t[h].field,value:t[h].value,parents:m}}g=Math.max(g,s+1);let C=!1;const M=I.findGroupExpand(a||[],x);M?C=M.expanded!==!1:C=i!==!1,e[e.length]={dataIndex:-1,dataItem:t[h],level:s,group:x,rowType:"groupHeader",expanded:C},C&&(x.expanded=C,g=Math.max(v(e,t[h].items,n,r,d,l,a,i,o,s+1,x),g)),(n==="always"||C&&n==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[h],rowType:"groupFooter",level:s,expanded:C})}return g}const q=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1;function k(e,t){const n=[[]];let r=0;for(let a=e.length-1;a>=0;a--)r=Math.max(r,e[a].depth),e[a].headerColSpan=e[a].headerColSpan||1,e[a].children.length>0&&(e[a].headerColSpan=e[a].children.reduce((i,o)=>o.hidden?i:i+o.headerColSpan,0));const d=[];let l=1;return e.forEach((a,i)=>{n[a.depth]=n[a.depth]||[];let o=!1;n[a.depth].length===0&&(l<=1?l=1+(a.children.length>0?0:r-a.depth):(l--,o=!0)),a.rowSpan=1+(a.children.length>0?0:r-a.depth),a.kFirst=o,a.index=n[a.depth].length,n[a.depth].push(i),a.ariaColumnIndex=d[a.depth]?d[a.depth]+1:1;for(let s=a.depth;s<a.depth+a.rowSpan;s++)d[s]=(d[s]||0)+a.headerColSpan}),I.updateLeft(n,e,t),I.updateRight(n,e,t),n}function N(e,t,n,r=0,d=!1){const l=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.forEach((i,o)=>{i=i.props?i.props:i;const s=i.id?i.id:I.tableKeyboardNavigationTools.generateNavigatableId(`${n.prevId++}`,n.idPrefix,"column"),f=T.canUseDOM&&i.media&&window.matchMedia?!window.matchMedia(i.media).matches:!1,g=d||f||i.hidden,u=t==null?void 0:t.find(x=>x.id===s),h=N(i.children,(u==null?void 0:u.children)||[],n,r+1,g);l.push(Object.assign({depth:r},w.gridDefaultProps,h.length?{cell:()=>null,filterCell:()=>null}:{},i,{id:s,declarationIndex:l.length,children:h,headerColSpan:0,rowSpan:0,columnType:i.columnType||"data",colSpan:i.colSpan||1,isAccessible:!0,hidden:g,left:null,right:null,rowSpannable:i.rowSpannable},u?{width:u.width,orderIndex:u.orderIndex}:{}))});const a=(i,o)=>i.orderIndex===o.orderIndex?i.declarationIndex-o.declarationIndex:(i.orderIndex||0)-(o.orderIndex||0);if(l.sort(a),r===0){const i=[],o=(s,f)=>s.forEach(g=>{g.parentIndex=f,o(g.children,i.push(g)-1)});return o(l,-1),i}return l}const b=e=>Array.isArray(e)?e:e?e.data:[];function B(e,t,n,r){const d=b(e),l=[];if(d.length>0){let a=d[0];if(t)for(let o=0;o<t.length;o++)a=a.items&&a.items[0];Object.getOwnPropertyNames(a).forEach(o=>{o!==n.column&&l.push(Object.assign({id:I.tableKeyboardNavigationTools.generateNavigatableId(`${r.prevId++}`,r.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,index:0,columnType:"data",left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},w.gridDefaultProps,{field:o}))})}return l}const _=(e,t)=>{var r;let n=e[t.parentIndex];for(;n;){if((r=n.cells)!=null&&r.footerCell)return!0;n=e[n.parentIndex]}return!1},$=e=>e.filter(t=>{var n;return _(e,t)?!1:!!((n=t.cells)!=null&&n.footerCell)||!(t.children&&t.children.length>0)}),z=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,V=(e,t)=>t&&t.filter(n=>n.field===e).length>0,D=e=>(e.sort((t,n)=>t.declarationIndex-n.declarationIndex),e.map(t=>{const{declarationIndex:n,parentIndex:r,depth:d,headerColSpan:l,rowSpan:a,index:i,kFirst:o,children:s,...f}=t;return s.length?{children:D(s),...f}:f})),R=e=>{const{cells:t,rowSpannable:n,defaultCell:r,...d}=e;return e.children.length?{...d,children:e.children.map(R)}:d},p=e=>({id:e.id,field:e.field,title:e.title,width:e.width,hidden:!1,children:e.children?E(e.children):null}),E=e=>e.map(p),L=e=>{const t=[],n=r=>r==null?void 0:r.forEach(d=>{t.push(d),n(d.children)});return n(e),t},P=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),W=17895697,K=e=>{let t=[];return e.sortable&&(t=t.concat([c.GridContextMenuItemNames.sortAsc,c.GridContextMenuItemNames.sortDesc])),e.pdf&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.exportPDF])),t},Q=e=>{let t=[];return e.clipboard&&(t=t.concat([c.GridContextMenuItemNames.copySelection,c.GridContextMenuItemNames.copySelectionNoHeaders,c.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.create,c.GridContextMenuItemNames.edit,c.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.select])),e.rowReorderable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.reorderRow])),e.pdf&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.exportPDF])),t},U=(e,t)=>{if(!(!e&&!t))return t?e?{...e,...t,select:{...e.select||{},...t.select||{}},hierarchy:{...e.hierarchy||{},...t.hierarchy||{}},group:{...e.group||{},...t.group||{}},edit:{...e.edit||{},...t.edit||{}}}:t:e},J=e=>{var n;return typeof e=="object"?(n=e.enabled)!=null?n:!0:e!=null?e:!1},X=()=>G.ServerFragment===O.ClientFragment,Y=e=>!!(e&&e.$$typeof===Symbol.for("react.client.reference")),Z=e=>({id:e.id,ariaColumnIndex:e.ariaColumnIndex,isSelected:e.isSelected,isHighlighted:e.isHighlighted,isInEdit:e.isInEdit,isSorted:e.isSorted,isAlt:e.isAlt,expanded:e.expanded,className:e.className,style:e.style,field:e.field,dataItem:e.dataItem,format:e.format,colSpan:e.colSpan,dataIndex:e.dataIndex,columnIndex:e.columnIndex,columnsCount:e.columnsCount,rowType:e.rowType,level:e.level,editor:e.editor,locked:e.locked,isRtl:e.isRtl,rowDataIndex:e.rowDataIndex,columnPosition:e.columnPosition,group:e.group}),ee=e=>{var r,d;const t=typeof e=="object"?(r=e.enabled)!=null?r:!0:e!=null?e:!1,n=typeof e=="object"?(d=e.valueGetter)!=null?d:(l,a)=>S.getter(a)(l):(l,a)=>S.getter(a)(l);return{enabled:t,valueGetter:n}},F=e=>{var t;return y.isValidElement(e)?e:(t=y.Children.toArray(e))==null?void 0:t[0]},te=(e,t)=>{const n=F(e);return n?y.cloneElement(n,t):null},ne=e=>{let t=0;if(e){const n=e.insertRow(0),r=n.insertCell(0);r.textContent=" ",t=n.getBoundingClientRect().height,e.deleteRow(0)}return t};exports.autoGenerateColumns=B;exports.calcRowHeight=ne;exports.clientColumn=R;exports.cloneReactElement=te;exports.firefox=P;exports.firefoxMaxHeight=W;exports.flatData=v;exports.footerColumns=$;exports.getClientCellProps=Z;exports.getColSpan=q;exports.getColumnState=p;exports.getColumnWidth=z;exports.getColumnsState=E;exports.getDataAsArray=b;exports.getDefaultBodyContextMenuItems=Q;exports.getDefaultHeadContextMenuItems=K;exports.getFlatColumnsState=L;exports.getNestedValue=j;exports.getReactElement=F;exports.getRowSpanOptions=ee;exports.isClient=X;exports.isClientReference=Y;exports.isRowReorderEnabled=J;exports.isSorted=V;exports.mapColumns=k;exports.readColumns=N;exports.resolveCells=U;exports.sanitizeColumns=D;
|