@progress/kendo-react-grid 11.2.0 → 11.3.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Grid.js +1 -1
- package/Grid.mjs +1 -0
- package/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +2 -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/columnMenu/GridColumnMenuGroup.js +1 -1
- package/columnMenu/GridColumnMenuGroup.mjs +14 -13
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +97 -82
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.d.mts +19 -0
- package/index.d.ts +19 -0
- 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/utils/index.js +1 -1
- package/utils/index.mjs +64 -63
package/cells/datacell/utils.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 s=require("../../utils/index.js"),r=require("../../constants/index.js"),c=require("@progress/kendo-react-common"),
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../utils/index.js"),r=require("../../constants/index.js"),c=require("@progress/kendo-react-common"),g=e=>{var n,a;let t=null,d=null;const i=e.unstyled,o=i&&i.uGrid?i.uGrid:c.uGrid;if(e.rowType==="groupFooter")t={className:e.className};else if(e.rowType!=="groupHeader"){if(e.field!==void 0){const l=s.getNestedValue(e.field,e.dataItem);l!=null&&(d=e.intl&&e.format?e.intl.format(e.format,l):l.toString())}const u=c.classNames(o.td({selected:e.isSelected,highlighted:e.isHighlighted,sorted:e.isSorted,alt:e.isAlt}),e.className);t={rowSpan:(a=(n=e._rowSpan)==null?void 0:n.count)!=null?a:void 0,colSpan:e.colSpan,style:e.style,className:u,role:"gridcell","aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,[r.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex}}return{tdProps:t,content:d}},m=e=>{var t;return(t=e.cells)==null?void 0:t[e.rowType||"data"]};exports.getCellTdProps=g;exports.getCustomCell=m;
|
package/cells/datacell/utils.mjs
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { getNestedValue as m } from "../../utils/index.mjs";
|
|
9
9
|
import { GRID_COL_INDEX_ATTRIBUTE as u } from "../../constants/index.mjs";
|
|
10
|
-
import { uGrid as
|
|
10
|
+
import { uGrid as s, classNames as r } from "@progress/kendo-react-common";
|
|
11
11
|
const y = (e) => {
|
|
12
|
-
var
|
|
13
|
-
let t = null,
|
|
14
|
-
const a = e.unstyled, c = a && a.uGrid ? a.uGrid :
|
|
12
|
+
var d, n;
|
|
13
|
+
let t = null, i = null;
|
|
14
|
+
const a = e.unstyled, c = a && a.uGrid ? a.uGrid : s;
|
|
15
15
|
if (e.rowType === "groupFooter")
|
|
16
16
|
t = {
|
|
17
17
|
className: e.className
|
|
@@ -19,14 +19,14 @@ const y = (e) => {
|
|
|
19
19
|
else if (e.rowType !== "groupHeader") {
|
|
20
20
|
if (e.field !== void 0) {
|
|
21
21
|
const l = m(e.field, e.dataItem);
|
|
22
|
-
l != null && (
|
|
22
|
+
l != null && (i = e.intl && e.format ? e.intl.format(e.format, l) : l.toString());
|
|
23
23
|
}
|
|
24
|
-
const o =
|
|
25
|
-
c.td({ selected: e.isSelected, sorted: e.isSorted, alt: e.isAlt }),
|
|
24
|
+
const o = r(
|
|
25
|
+
c.td({ selected: e.isSelected, highlighted: e.isHighlighted, sorted: e.isSorted, alt: e.isAlt }),
|
|
26
26
|
e.className
|
|
27
27
|
);
|
|
28
28
|
t = {
|
|
29
|
-
rowSpan: (n = (
|
|
29
|
+
rowSpan: (n = (d = e._rowSpan) == null ? void 0 : d.count) != null ? n : void 0,
|
|
30
30
|
colSpan: e.colSpan,
|
|
31
31
|
style: e.style,
|
|
32
32
|
className: o,
|
|
@@ -36,7 +36,7 @@ const y = (e) => {
|
|
|
36
36
|
[u]: e.columnIndex
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
return { tdProps: t, content:
|
|
39
|
+
return { tdProps: t, content: i };
|
|
40
40
|
}, N = (e) => {
|
|
41
41
|
var t;
|
|
42
42
|
return (t = e.cells) == null ? void 0 : t[e.rowType || "data"];
|
|
@@ -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
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../constants/index.js"),t=require("@progress/kendo-react-common"),s=e=>{let d=null;const l=e.unstyled,a=l&&l.uGrid?l.uGrid:t.uGrid,i=t.classNames(a.td({selected:e.isSelected,highlighted:e.isHighlighted,sorted:e.isSorted,alt:e.isAlt}),e.className,["k-drag-cell",`${e.rowReorderable?"":"k-disabled"}`]);return d={colSpan:e.colSpan,style:e.style,className:i,role:"gridcell","aria-colindex":e.ariaColumnIndex,"aria-selected":e.isSelected,"aria-disabled":!e.rowReorderable,[r.GRID_COL_INDEX_ATTRIBUTE]:e.columnIndex},{tdProps:d}};exports.getRowReorderCellTdProps=s;
|
|
@@ -5,26 +5,26 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { GRID_COL_INDEX_ATTRIBUTE as
|
|
9
|
-
import { uGrid as
|
|
10
|
-
const
|
|
8
|
+
import { GRID_COL_INDEX_ATTRIBUTE as i } from "../../constants/index.mjs";
|
|
9
|
+
import { uGrid as r, classNames as s } from "@progress/kendo-react-common";
|
|
10
|
+
const o = (e) => {
|
|
11
11
|
let d = null;
|
|
12
|
-
const l = e.unstyled,
|
|
13
|
-
|
|
12
|
+
const l = e.unstyled, t = l && l.uGrid ? l.uGrid : r, a = s(
|
|
13
|
+
t.td({ selected: e.isSelected, highlighted: e.isHighlighted, sorted: e.isSorted, alt: e.isAlt }),
|
|
14
14
|
e.className,
|
|
15
15
|
["k-drag-cell", `${e.rowReorderable ? "" : "k-disabled"}`]
|
|
16
16
|
);
|
|
17
17
|
return d = {
|
|
18
18
|
colSpan: e.colSpan,
|
|
19
19
|
style: e.style,
|
|
20
|
-
className:
|
|
20
|
+
className: a,
|
|
21
21
|
role: "gridcell",
|
|
22
22
|
"aria-colindex": e.ariaColumnIndex,
|
|
23
23
|
"aria-selected": e.isSelected,
|
|
24
24
|
"aria-disabled": !e.rowReorderable,
|
|
25
|
-
[
|
|
25
|
+
[i]: e.columnIndex
|
|
26
26
|
}, { tdProps: d };
|
|
27
27
|
};
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
o as getRowReorderCellTdProps
|
|
30
30
|
};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),C=require("@progress/kendo-react-intl"),G=require("./GridColumnMenuItemGroup.js"),p=require("./GridColumnMenuItem.js"),l=require("../messages/index.js"),a=require("@progress/kendo-svg-icons");function I(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,u.get?u:{enumerable:!0,get:()=>e[n]})}}return o.default=e,Object.freeze(o)}const d=I(m),M=e=>{const o=
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),C=require("@progress/kendo-react-intl"),G=require("./GridColumnMenuItemGroup.js"),p=require("./GridColumnMenuItem.js"),l=require("../messages/index.js"),a=require("@progress/kendo-svg-icons");function I(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(o,n,u.get?u:{enumerable:!0,get:()=>e[n]})}}return o.default=e,Object.freeze(o)}const d=I(m),M=e=>{const o=r=>{if(r.preventDefault(),e.onGroupChange){if(!e.column.field)return;const i=(e.group||[]).slice(),s=i.findIndex(g=>g.field===e.column.field);s>-1?i.splice(s,1):i.push({field:e.column.field}),e.onGroupChange(i,r)}e.onCloseMenu&&e.onCloseMenu()},{group:n,column:u}=e,f=C.useLocalization(),t=!!(n&&u.field&&n.find(r=>r.field===u.field)),c=t?l.ungroupColumn:l.groupColumn;return d.createElement(G.GridColumnMenuItemGroup,null,d.createElement(p.GridColumnMenuItem,{selected:t,title:f.toLanguageString(c,l.messages[c]),iconClass:t?"k-i-ungroup":"k-i-group",svgIcon:t?a.ungroupIcon:a.groupIcon,onClick:o}))};exports.GridColumnMenuGroup=M;
|
|
@@ -7,29 +7,30 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as m from "react";
|
|
10
|
-
import { useLocalization as
|
|
11
|
-
import { GridColumnMenuItemGroup as
|
|
12
|
-
import { GridColumnMenuItem as
|
|
10
|
+
import { useLocalization as a } from "@progress/kendo-react-intl";
|
|
11
|
+
import { GridColumnMenuItemGroup as d } from "./GridColumnMenuItemGroup.mjs";
|
|
12
|
+
import { GridColumnMenuItem as g } from "./GridColumnMenuItem.mjs";
|
|
13
13
|
import { messages as C, groupColumn as p, ungroupColumn as G } from "../messages/index.mjs";
|
|
14
14
|
import { groupIcon as I, ungroupIcon as M } from "@progress/kendo-svg-icons";
|
|
15
15
|
const L = (o) => {
|
|
16
|
-
const c = (
|
|
17
|
-
if (
|
|
16
|
+
const c = (e) => {
|
|
17
|
+
if (e.preventDefault(), o.onGroupChange) {
|
|
18
18
|
if (!o.column.field)
|
|
19
19
|
return;
|
|
20
|
-
const
|
|
21
|
-
t > -1 ?
|
|
20
|
+
const u = (o.group || []).slice(), t = u.findIndex((s) => s.field === o.column.field);
|
|
21
|
+
t > -1 ? u.splice(t, 1) : u.push({
|
|
22
22
|
field: o.column.field
|
|
23
|
-
}), o.onGroupChange(
|
|
23
|
+
}), o.onGroupChange(u, e);
|
|
24
24
|
}
|
|
25
25
|
o.onCloseMenu && o.onCloseMenu();
|
|
26
|
-
}, { group: i, column: l } = o, f =
|
|
27
|
-
return /* @__PURE__ */ m.createElement(
|
|
28
|
-
|
|
26
|
+
}, { group: i, column: l } = o, f = a(), n = !!(i && l.field && i.find((e) => e.field === l.field)), r = n ? G : p;
|
|
27
|
+
return /* @__PURE__ */ m.createElement(d, null, /* @__PURE__ */ m.createElement(
|
|
28
|
+
g,
|
|
29
29
|
{
|
|
30
|
+
selected: n,
|
|
30
31
|
title: f.toLanguageString(r, C[r]),
|
|
31
|
-
iconClass:
|
|
32
|
-
svgIcon:
|
|
32
|
+
iconClass: n ? "k-i-ungroup" : "k-i-group",
|
|
33
|
+
svgIcon: n ? M : I,
|
|
33
34
|
onClick: c
|
|
34
35
|
}
|
|
35
36
|
));
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("react"),L=require("@progress/kendo-react-popup"),s=require("@progress/kendo-react-common"),O=require("@progress/kendo-svg-icons"),k=require("../messages/index.js"),V=require("@progress/kendo-react-intl"),H=require("../utils/GridContext.js"),j=require("./adaptiveContext/GridColumnMenuAdaptiveContext.js"),J=require("./adaptiveContent/GridAdaptiveColumnMenu.js"),Q=require("react-dom");function U(o){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const u in o)if(u!=="default"){const a=Object.getOwnPropertyDescriptor(o,u);Object.defineProperty(c,u,a.get?a:{enumerable:!0,get:()=>o[u]})}}return c.default=o,Object.freeze(c)}const t=U($),X=[".k-columnmenu-item-content",".k-filter-menu-container"].map(o=>s.TABBABLE_ELEMENTS.map(c=>`${o} ${c}`)),Y=[[".k-tabstrip-items"],[".k-columnmenu-item"],...X],Z=o=>{var D;const c=t.useContext(H.GridContext),[u,a]=t.useState(!1),i=t.useRef(null),d=t.useRef(null),l=t.useRef(null),E=t.useRef(0),A=s.useDocument(i),{columnMenu:f,...p}=o,{column:m,columnMenuIcon:v,navigatable:w}=o,S=V.useLocalization(),y=m.title||m.field,T=y?`${y} `:"",q="#",R=n=>{const e=s.getActiveElement(document);clearTimeout(E.current),E.current=window.setTimeout(()=>{!c.mobileMode&&e&&n.relatedTarget!==i.current&&d.current&&!d.current.contains(e)&&g()})},x=()=>{clearTimeout(E.current)},G=n=>{n.preventDefault(),u&&o.onCloseMenu&&o.onCloseMenu(),a(!u)},g=()=>{o.onCloseMenu&&o.onCloseMenu(),a(!1),!o.navigatable&&i.current&&i.current.focus()},I=n=>{var e;if(n.keyCode===s.Keys.tab){const r=n.target,M=r&&((e=r.closest(".k-grid"))==null?void 0:e.getElementsByClassName("k-grid-content")[0]);M&&M.scrollWidth>M.clientWidth&&r.scrollIntoView({inline:"center"})}},C=t.useMemo(()=>o.show!==void 0?o.show:u,[o.show,u]),P=n=>{var e;(e=l.current)==null||e.triggerKeyboardEvent(n)},N=n=>{var e;(e=l.current)==null||e.triggerMouseEvent(n)},K=(n,e,r)=>{r.preventDefault(),r.shiftKey?e.focusPrevious(n):e.focusNext(n)},B=(n,e,r)=>{n&&(r.preventDefault(),n.click())},W=(n,e,r)=>{r.preventDefault(),g()},_=(n,e,r)=>{e.focusElement(n)},z=n=>{!n.isAnchorClicked&&a(!1)},h=t.useCallback((n,e)=>{const r=[];if(!e||typeof e!="object")return!1;if(Array.isArray(e.filters)){for(const M of e.filters)if(h(n,M))return!0}return"field"in e&&typeof e.field=="string"&&r.push(e.field),r.includes(n)},[]),b=t.useCallback((n,e)=>!e||!Array.isArray(e)?!1:e.some(r=>r.field===n),[]),F=t.useMemo(()=>m.field&&(h(m.field,c.filter)||b(m.field,c.group)),[m.field,c.filter,c.group,h,b]);return t.useEffect(()=>(C&&d.current&&(l.current=new s.Navigation({tabIndex:0,root:d,selectors:Y,keyboardEvents:{keydown:{Tab:K,Enter:B,Escape:W}},mouseEvents:{mousedown:_}}),l.current.focusElement(l.current.first,null)),()=>{l.current&&(l.current=null)}),[C]),t.createElement(t.Fragment,null,t.createElement("a",{className:s.classNames("k-grid-header-menu k-grid-column-menu",{"k-active":F}),ref:i,onClick:G,onKeyDown:I,href:q,tabIndex:w?-1:void 0,"aria-label":`${w?"":T}${S.toLanguageString(k.columnMenu,k.messages[k.columnMenu])}`},v?t.createElement(s.IconWrap,{name:v.name,icon:v}):t.createElement(s.IconWrap,{name:"more-vertical",icon:O.moreVerticalIcon})),t.createElement(j.GridColumnMenuAdaptiveProvider,null,c.mobileMode?t.createElement(t.Fragment,null,Q.createPortal(t.createElement(J.GridAdaptiveColumnMenu,{computedShow:C,ColumnMenu:f,closeMenu:g},f&&t.createElement(f,{...p,onCloseMenu:g})),(D=A())==null?void 0:D.body)):t.createElement(L.Popup,{anchor:i.current,show:C,popupClass:"k-grid-columnmenu-popup",onMouseDownOutside:z},t.createElement("div",{ref:d,onBlur:R,onFocus:x,onMouseDown:N,onKeyDown:P,className:"k-column-menu k-column-menu-md"},f&&t.createElement(f,{...p,onCloseMenu:g})))))};exports.GridColumnMenuWrapper=Z;
|
|
@@ -6,110 +6,125 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
10
|
-
import { Popup as
|
|
11
|
-
import { TABBABLE_ELEMENTS as
|
|
12
|
-
import { moreVerticalIcon as
|
|
13
|
-
import { columnMenu as b, messages as
|
|
14
|
-
import { useLocalization as
|
|
15
|
-
import { GridContext as
|
|
16
|
-
import { GridColumnMenuAdaptiveProvider as
|
|
17
|
-
import { GridAdaptiveColumnMenu as
|
|
18
|
-
import
|
|
19
|
-
const
|
|
20
|
-
var
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
clearTimeout(
|
|
24
|
-
!
|
|
9
|
+
import * as t from "react";
|
|
10
|
+
import { Popup as V } from "@progress/kendo-react-popup";
|
|
11
|
+
import { TABBABLE_ELEMENTS as _, useDocument as H, Navigation as q, classNames as J, IconWrap as D, getActiveElement as Q, Keys as U } from "@progress/kendo-react-common";
|
|
12
|
+
import { moreVerticalIcon as X } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { columnMenu as b, messages as Y } from "../messages/index.mjs";
|
|
14
|
+
import { useLocalization as Z } from "@progress/kendo-react-intl";
|
|
15
|
+
import { GridContext as O } from "../utils/GridContext.mjs";
|
|
16
|
+
import { GridColumnMenuAdaptiveProvider as j } from "./adaptiveContext/GridColumnMenuAdaptiveContext.mjs";
|
|
17
|
+
import { GridAdaptiveColumnMenu as ee } from "./adaptiveContent/GridAdaptiveColumnMenu.mjs";
|
|
18
|
+
import ne from "react-dom";
|
|
19
|
+
const te = [".k-columnmenu-item-content", ".k-filter-menu-container"].map((r) => _.map((c) => `${r} ${c}`)), oe = [[".k-tabstrip-items"], [".k-columnmenu-item"], ...te], Ee = (r) => {
|
|
20
|
+
var y;
|
|
21
|
+
const c = t.useContext(O), [d, M] = t.useState(!1), s = t.useRef(null), i = t.useRef(null), l = t.useRef(null), h = t.useRef(0), A = H(s), { columnMenu: a, ...C } = r, { column: u, columnMenuIcon: g, navigatable: p } = r, T = Z(), w = u.title || u.field, S = w ? `${w} ` : "", x = "#", K = (n) => {
|
|
22
|
+
const e = Q(document);
|
|
23
|
+
clearTimeout(h.current), h.current = window.setTimeout(() => {
|
|
24
|
+
!c.mobileMode && e && n.relatedTarget !== s.current && i.current && !i.current.contains(e) && m();
|
|
25
25
|
});
|
|
26
|
-
},
|
|
27
|
-
clearTimeout(
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
var
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
|
|
26
|
+
}, N = () => {
|
|
27
|
+
clearTimeout(h.current);
|
|
28
|
+
}, B = (n) => {
|
|
29
|
+
n.preventDefault(), d && r.onCloseMenu && r.onCloseMenu(), M(!d);
|
|
30
|
+
}, m = () => {
|
|
31
|
+
r.onCloseMenu && r.onCloseMenu(), M(!1), !r.navigatable && s.current && s.current.focus();
|
|
32
|
+
}, I = (n) => {
|
|
33
|
+
var e;
|
|
34
|
+
if (n.keyCode === U.tab) {
|
|
35
|
+
const o = n.target, f = o && ((e = o.closest(".k-grid")) == null ? void 0 : e.getElementsByClassName("k-grid-content")[0]);
|
|
36
|
+
f && f.scrollWidth > f.clientWidth && o.scrollIntoView({ inline: "center" });
|
|
37
37
|
}
|
|
38
|
-
},
|
|
39
|
-
var
|
|
40
|
-
(
|
|
41
|
-
},
|
|
42
|
-
var
|
|
43
|
-
(
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
!
|
|
54
|
-
}
|
|
55
|
-
|
|
38
|
+
}, E = t.useMemo(() => r.show !== void 0 ? r.show : d, [r.show, d]), R = (n) => {
|
|
39
|
+
var e;
|
|
40
|
+
(e = l.current) == null || e.triggerKeyboardEvent(n);
|
|
41
|
+
}, F = (n) => {
|
|
42
|
+
var e;
|
|
43
|
+
(e = l.current) == null || e.triggerMouseEvent(n);
|
|
44
|
+
}, G = (n, e, o) => {
|
|
45
|
+
o.preventDefault(), o.shiftKey ? e.focusPrevious(n) : e.focusNext(n);
|
|
46
|
+
}, P = (n, e, o) => {
|
|
47
|
+
n && (o.preventDefault(), n.click());
|
|
48
|
+
}, $ = (n, e, o) => {
|
|
49
|
+
o.preventDefault(), m();
|
|
50
|
+
}, z = (n, e, o) => {
|
|
51
|
+
e.focusElement(n);
|
|
52
|
+
}, L = (n) => {
|
|
53
|
+
!n.isAnchorClicked && M(!1);
|
|
54
|
+
}, v = t.useCallback(
|
|
55
|
+
(n, e) => {
|
|
56
|
+
const o = [];
|
|
57
|
+
if (!e || typeof e != "object")
|
|
58
|
+
return !1;
|
|
59
|
+
if (Array.isArray(e.filters)) {
|
|
60
|
+
for (const f of e.filters)
|
|
61
|
+
if (v(n, f))
|
|
62
|
+
return !0;
|
|
63
|
+
}
|
|
64
|
+
return "field" in e && typeof e.field == "string" && o.push(e.field), o.includes(n);
|
|
65
|
+
},
|
|
66
|
+
[]
|
|
67
|
+
), k = t.useCallback((n, e) => !e || !Array.isArray(e) ? !1 : e.some((o) => o.field === n), []), W = t.useMemo(() => u.field && (v(u.field, c.filter) || k(u.field, c.group)), [u.field, c.filter, c.group, v, k]);
|
|
68
|
+
return t.useEffect(() => (E && i.current && (l.current = new q({
|
|
56
69
|
tabIndex: 0,
|
|
57
|
-
root:
|
|
58
|
-
selectors:
|
|
70
|
+
root: i,
|
|
71
|
+
selectors: oe,
|
|
59
72
|
keyboardEvents: {
|
|
60
|
-
keydown: { Tab:
|
|
73
|
+
keydown: { Tab: G, Enter: P, Escape: $ }
|
|
61
74
|
},
|
|
62
|
-
mouseEvents: { mousedown:
|
|
63
|
-
}),
|
|
64
|
-
|
|
65
|
-
}), [
|
|
75
|
+
mouseEvents: { mousedown: z }
|
|
76
|
+
}), l.current.focusElement(l.current.first, null)), () => {
|
|
77
|
+
l.current && (l.current = null);
|
|
78
|
+
}), [E]), /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
66
79
|
"a",
|
|
67
80
|
{
|
|
68
|
-
className: "k-grid-header-menu k-grid-column-menu",
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
81
|
+
className: J("k-grid-header-menu k-grid-column-menu", {
|
|
82
|
+
"k-active": W
|
|
83
|
+
}),
|
|
84
|
+
ref: s,
|
|
85
|
+
onClick: B,
|
|
86
|
+
onKeyDown: I,
|
|
87
|
+
href: x,
|
|
88
|
+
tabIndex: p ? -1 : void 0,
|
|
89
|
+
"aria-label": `${p ? "" : S}${T.toLanguageString(
|
|
75
90
|
b,
|
|
76
|
-
|
|
91
|
+
Y[b]
|
|
77
92
|
)}`
|
|
78
93
|
},
|
|
79
|
-
|
|
80
|
-
), /* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
94
|
+
g ? /* @__PURE__ */ t.createElement(D, { name: g.name, icon: g }) : /* @__PURE__ */ t.createElement(D, { name: "more-vertical", icon: X })
|
|
95
|
+
), /* @__PURE__ */ t.createElement(j, null, c.mobileMode ? /* @__PURE__ */ t.createElement(t.Fragment, null, ne.createPortal(
|
|
96
|
+
/* @__PURE__ */ t.createElement(
|
|
97
|
+
ee,
|
|
83
98
|
{
|
|
84
|
-
computedShow:
|
|
85
|
-
ColumnMenu:
|
|
86
|
-
closeMenu:
|
|
99
|
+
computedShow: E,
|
|
100
|
+
ColumnMenu: a,
|
|
101
|
+
closeMenu: m
|
|
87
102
|
},
|
|
88
|
-
|
|
103
|
+
a && /* @__PURE__ */ t.createElement(a, { ...C, onCloseMenu: m })
|
|
89
104
|
),
|
|
90
|
-
(
|
|
91
|
-
)) : /* @__PURE__ */
|
|
92
|
-
|
|
105
|
+
(y = A()) == null ? void 0 : y.body
|
|
106
|
+
)) : /* @__PURE__ */ t.createElement(
|
|
107
|
+
V,
|
|
93
108
|
{
|
|
94
|
-
anchor:
|
|
95
|
-
show:
|
|
109
|
+
anchor: s.current,
|
|
110
|
+
show: E,
|
|
96
111
|
popupClass: "k-grid-columnmenu-popup",
|
|
97
|
-
onMouseDownOutside:
|
|
112
|
+
onMouseDownOutside: L
|
|
98
113
|
},
|
|
99
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ t.createElement(
|
|
100
115
|
"div",
|
|
101
116
|
{
|
|
102
|
-
ref:
|
|
103
|
-
onBlur:
|
|
104
|
-
onFocus:
|
|
105
|
-
onMouseDown:
|
|
106
|
-
onKeyDown:
|
|
117
|
+
ref: i,
|
|
118
|
+
onBlur: K,
|
|
119
|
+
onFocus: N,
|
|
120
|
+
onMouseDown: F,
|
|
121
|
+
onKeyDown: R,
|
|
107
122
|
className: "k-column-menu k-column-menu-md"
|
|
108
123
|
},
|
|
109
|
-
|
|
124
|
+
a && /* @__PURE__ */ t.createElement(a, { ...C, onCloseMenu: m })
|
|
110
125
|
)
|
|
111
126
|
)));
|
|
112
127
|
};
|
|
113
128
|
export {
|
|
114
|
-
|
|
129
|
+
Ee as GridColumnMenuWrapper
|
|
115
130
|
};
|