@progress/kendo-react-grid 13.3.0-develop.2 → 13.3.0-develop.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GridClientWrapper.js +1 -1
- package/GridClientWrapper.mjs +354 -336
- package/GridComponent.js +1 -1
- package/GridComponent.mjs +330 -350
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +28 -28
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/index.d.mts +283 -69
- package/index.d.ts +283 -69
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +17 -17
- package/rows/GridDetailRowRenderer.js +8 -0
- package/rows/GridDetailRowRenderer.mjs +103 -0
- package/rows/GridRowRenderer.js +8 -0
- package/rows/GridRowRenderer.mjs +88 -0
- package/stacked/GridStackedCell.js +9 -0
- package/stacked/GridStackedCell.mjs +69 -0
- package/stacked/GridStackedDetailToggle.js +9 -0
- package/stacked/GridStackedDetailToggle.mjs +37 -0
- package/stacked/GridStackedRow.js +9 -0
- package/stacked/GridStackedRow.mjs +463 -0
- package/stacked/StackedModeComponents.js +9 -0
- package/stacked/StackedModeComponents.mjs +54 -0
- package/stacked/StackedModeRow.js +8 -0
- package/stacked/StackedModeRow.mjs +131 -0
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
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),
|
|
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),v=t.useRef(0),A=s.useDocument(i),{columnMenu:f,...p}=o,{column:m,columnMenuIcon:C,navigatable:w}=o,S=V.useLocalization(),b=m.title||m.field,T=b?`${b} `:"",q="#",R=n=>{const e=s.getActiveElement(document);clearTimeout(v.current),v.current=window.setTimeout(()=>{!c.mobileMode&&e&&n.relatedTarget!==i.current&&d.current&&!d.current.contains(e)&&g()})},x=()=>{clearTimeout(v.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.key==="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"})}},E=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)},B=(n,e,r)=>{r.preventDefault(),r.shiftKey?e.focusPrevious(n):e.focusNext(n)},K=(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)},[]),y=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)||y(m.field,c.group)),[m.field,c.filter,c.group,h,y]);return t.useEffect(()=>(E&&d.current&&(l.current=new s.Navigation({tabIndex:0,root:d,selectors:Y,keyboardEvents:{keydown:{Tab:B,Enter:K,Escape:W}},mouseEvents:{mousedown:_}}),l.current.focusElement(l.current.first,null)),()=>{l.current&&(l.current=null)}),[E]),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])}`},C?t.createElement(s.IconWrap,{name:C.name,icon:C}):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:E,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:E,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;
|
|
@@ -8,30 +8,30 @@
|
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
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
|
|
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
|
|
11
|
+
import { TABBABLE_ELEMENTS as _, useDocument as H, Navigation as q, classNames as J, IconWrap as D, getActiveElement as Q } from "@progress/kendo-react-common";
|
|
12
|
+
import { moreVerticalIcon as U } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { columnMenu as b, messages as X } from "../messages/index.mjs";
|
|
14
|
+
import { useLocalization as Y } from "@progress/kendo-react-intl";
|
|
15
|
+
import { GridContext as Z } from "../utils/GridContext.mjs";
|
|
16
|
+
import { GridColumnMenuAdaptiveProvider as O } from "./adaptiveContext/GridColumnMenuAdaptiveContext.mjs";
|
|
17
|
+
import { GridAdaptiveColumnMenu as j } from "./adaptiveContent/GridAdaptiveColumnMenu.mjs";
|
|
18
|
+
import ee from "react-dom";
|
|
19
|
+
const ne = [".k-columnmenu-item-content", ".k-filter-menu-container"].map((r) => _.map((c) => `${r} ${c}`)), te = [[".k-tabstrip-items"], [".k-columnmenu-item"], ...ne], de = (r) => {
|
|
20
20
|
var y;
|
|
21
|
-
const c = t.useContext(
|
|
21
|
+
const c = t.useContext(Z), [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, ...p } = r, { column: u, columnMenuIcon: g, navigatable: C } = r, T = Y(), w = u.title || u.field, S = w ? `${w} ` : "", x = "#", N = (n) => {
|
|
22
22
|
const e = Q(document);
|
|
23
23
|
clearTimeout(h.current), h.current = window.setTimeout(() => {
|
|
24
24
|
!c.mobileMode && e && n.relatedTarget !== s.current && i.current && !i.current.contains(e) && m();
|
|
25
25
|
});
|
|
26
|
-
},
|
|
26
|
+
}, B = () => {
|
|
27
27
|
clearTimeout(h.current);
|
|
28
|
-
},
|
|
28
|
+
}, I = (n) => {
|
|
29
29
|
n.preventDefault(), d && r.onCloseMenu && r.onCloseMenu(), M(!d);
|
|
30
30
|
}, m = () => {
|
|
31
31
|
r.onCloseMenu && r.onCloseMenu(), M(!1), !r.navigatable && s.current && s.current.focus();
|
|
32
|
-
},
|
|
32
|
+
}, K = (n) => {
|
|
33
33
|
var e;
|
|
34
|
-
if (n.
|
|
34
|
+
if (n.key === "Tab") {
|
|
35
35
|
const o = n.target, f = o && ((e = o.closest(".k-grid")) == null ? void 0 : e.getElementsByClassName("k-grid-content")[0]);
|
|
36
36
|
f && f.scrollWidth > f.clientWidth && o.scrollIntoView({ inline: "center" });
|
|
37
37
|
}
|
|
@@ -68,7 +68,7 @@ const te = [".k-columnmenu-item-content", ".k-filter-menu-container"].map((r) =>
|
|
|
68
68
|
return t.useEffect(() => (E && i.current && (l.current = new q({
|
|
69
69
|
tabIndex: 0,
|
|
70
70
|
root: i,
|
|
71
|
-
selectors:
|
|
71
|
+
selectors: te,
|
|
72
72
|
keyboardEvents: {
|
|
73
73
|
keydown: { Tab: G, Enter: P, Escape: $ }
|
|
74
74
|
},
|
|
@@ -82,25 +82,25 @@ const te = [".k-columnmenu-item-content", ".k-filter-menu-container"].map((r) =>
|
|
|
82
82
|
"k-active": W
|
|
83
83
|
}),
|
|
84
84
|
ref: s,
|
|
85
|
-
onClick:
|
|
86
|
-
onKeyDown:
|
|
85
|
+
onClick: I,
|
|
86
|
+
onKeyDown: K,
|
|
87
87
|
href: x,
|
|
88
|
-
tabIndex:
|
|
89
|
-
"aria-label": `${
|
|
88
|
+
tabIndex: C ? -1 : void 0,
|
|
89
|
+
"aria-label": `${C ? "" : S}${T.toLanguageString(
|
|
90
90
|
b,
|
|
91
|
-
|
|
91
|
+
X[b]
|
|
92
92
|
)}`
|
|
93
93
|
},
|
|
94
|
-
g ? /* @__PURE__ */ t.createElement(D, { name: g.name, icon: g }) : /* @__PURE__ */ t.createElement(D, { name: "more-vertical", icon:
|
|
95
|
-
), /* @__PURE__ */ t.createElement(
|
|
94
|
+
g ? /* @__PURE__ */ t.createElement(D, { name: g.name, icon: g }) : /* @__PURE__ */ t.createElement(D, { name: "more-vertical", icon: U })
|
|
95
|
+
), /* @__PURE__ */ t.createElement(O, null, c.mobileMode ? /* @__PURE__ */ t.createElement(t.Fragment, null, ee.createPortal(
|
|
96
96
|
/* @__PURE__ */ t.createElement(
|
|
97
|
-
|
|
97
|
+
j,
|
|
98
98
|
{
|
|
99
99
|
computedShow: E,
|
|
100
100
|
ColumnMenu: a,
|
|
101
101
|
closeMenu: m
|
|
102
102
|
},
|
|
103
|
-
a && /* @__PURE__ */ t.createElement(a, { ...
|
|
103
|
+
a && /* @__PURE__ */ t.createElement(a, { ...p, onCloseMenu: m })
|
|
104
104
|
),
|
|
105
105
|
(y = A()) == null ? void 0 : y.body
|
|
106
106
|
)) : /* @__PURE__ */ t.createElement(
|
|
@@ -115,16 +115,16 @@ const te = [".k-columnmenu-item-content", ".k-filter-menu-container"].map((r) =>
|
|
|
115
115
|
"div",
|
|
116
116
|
{
|
|
117
117
|
ref: i,
|
|
118
|
-
onBlur:
|
|
119
|
-
onFocus:
|
|
118
|
+
onBlur: N,
|
|
119
|
+
onFocus: B,
|
|
120
120
|
onMouseDown: F,
|
|
121
121
|
onKeyDown: R,
|
|
122
122
|
className: "k-column-menu k-column-menu-md"
|
|
123
123
|
},
|
|
124
|
-
a && /* @__PURE__ */ t.createElement(a, { ...
|
|
124
|
+
a && /* @__PURE__ */ t.createElement(a, { ...p, onCloseMenu: m })
|
|
125
125
|
)
|
|
126
126
|
)));
|
|
127
127
|
};
|
|
128
128
|
export {
|
|
129
|
-
|
|
129
|
+
de as GridColumnMenuWrapper
|
|
130
130
|
};
|