@progress/kendo-react-grid 7.5.0-develop.19 → 7.5.0-develop.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Grid.js +1 -1
- package/Grid.mjs +114 -112
- package/GridColumn.js +1 -1
- package/GridColumn.mjs +2 -1
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +58 -58
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +57 -56
- package/index.d.mts +13 -0
- package/index.d.ts +13 -0
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
|
@@ -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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),P=require("@progress/kendo-react-popup"),a=require("@progress/kendo-react-common"),W=require("@progress/kendo-svg-icons"),h=require("../messages/index.js"),_=require("@progress/kendo-react-intl");function j(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const l in e)if(l!=="default"){const u=Object.getOwnPropertyDescriptor(e,l);Object.defineProperty(r,l,u.get?u:{enumerable:!0,get:()=>e[l]})}}return r.default=e,Object.freeze(r)}const o=j(O),z=[".k-columnmenu-item-content",".k-filter-menu-container"].map(e=>a.TABBABLE_ELEMENTS.map(r=>`${e} ${r}`)),$=[[".k-tabstrip-items"],[".k-columnmenu-item"],...z],x=e=>{const[r,l]=o.useState(!1),u=o.useRef(null),i=o.useRef(null),s=o.useRef(null),m=o.useRef(0),{columnMenu:b,...M}=e,{column:k,columnMenuIcon:f}=e,w=_.useLocalization(),v=k.title||k.field,p=v?`${v} `:"",y="#",C=n=>{const t=a.getActiveElement(document);clearTimeout(m.current),m.current=window.setTimeout(()=>{t&&n.relatedTarget!==u.current&&i.current&&!i.current.contains(t)&&d()})},D=()=>{clearTimeout(m.current)},S=n=>{n.preventDefault(),r&&e.onCloseMenu&&e.onCloseMenu(),l(!r)},d=()=>{e.onCloseMenu&&e.onCloseMenu(),l(!1),!e.navigatable&&u.current&&u.current.focus()},T=n=>{var t;if(n.keyCode===a.Keys.tab){const c=n.target,E=c&&((t=c.closest(".k-grid"))==null?void 0:t.getElementsByClassName("k-grid-content")[0]);E&&E.scrollWidth>E.clientWidth&&c.scrollIntoView({inline:"center"})}},g=o.useMemo(()=>e.show!==void 0?e.show:r,[e.show,r]),I=n=>{var t;(t=s.current)==null||t.triggerKeyboardEvent(n)},R=n=>{var t;(t=s.current)==null||t.triggerMouseEvent(n)},K=(n,t,c)=>{c.preventDefault(),c.shiftKey?t.focusPrevious(n):t.focusNext(n)},q=(n,t,c)=>{n&&n.click()},B=(n,t,c)=>{c.preventDefault(),d()},N=(n,t,c)=>{c.preventDefault(),t.focusElement(n)};return o.useEffect(()=>(g&&i.current&&(s.current=new a.Navigation({tabIndex:0,root:i,selectors:$,keyboardEvents:{keydown:{Tab:K,Enter:q,Escape:B}},mouseEvents:{mousedown:N}}),s.current.focusElement(s.current.first,null)),()=>{s.current&&(s.current=null)}),[g]),o.createElement(o.Fragment,null,o.createElement("a",{className:"k-grid-header-menu k-grid-column-menu",ref:u,onClick:S,onKeyDown:T,href:y,tabIndex:e.navigatable?-1:void 0,"aria-label":`${p}${w.toLanguageString(h.columnMenu,h.messages[h.columnMenu])}`},f?o.createElement(a.IconWrap,{name:f.name,icon:f}):o.createElement(a.IconWrap,{name:"more-vertical",icon:W.moreVerticalIcon})),o.createElement(P.Popup,{anchor:u.current,show:g,popupClass:"k-column-menu k-column-menu-popup k-grid-columnmenu-popup"},o.createElement("div",{ref:i,onBlur:C,onFocus:D,onMouseDown:R,onKeyDown:I,style:{outline:"none"}},b&&o.createElement(b,{...M,onCloseMenu:d}))))};exports.GridColumnMenuWrapper=x;
|
|
@@ -7,108 +7,108 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import { Popup as
|
|
11
|
-
import { TABBABLE_ELEMENTS as
|
|
12
|
-
import { moreVerticalIcon as
|
|
13
|
-
import { columnMenu as
|
|
14
|
-
import { useLocalization as
|
|
15
|
-
const
|
|
10
|
+
import { Popup as x } from "@progress/kendo-react-popup";
|
|
11
|
+
import { TABBABLE_ELEMENTS as z, Navigation as A, IconWrap as v, getActiveElement as F, Keys as L } from "@progress/kendo-react-common";
|
|
12
|
+
import { moreVerticalIcon as W } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { columnMenu as M, messages as V } from "../messages/index.mjs";
|
|
14
|
+
import { useLocalization as _ } from "@progress/kendo-react-intl";
|
|
15
|
+
const H = [
|
|
16
16
|
".k-columnmenu-item-content",
|
|
17
17
|
".k-filter-menu-container"
|
|
18
|
-
].map((o) =>
|
|
18
|
+
].map((o) => z.map(
|
|
19
19
|
(u) => `${o} ${u}`
|
|
20
|
-
)),
|
|
20
|
+
)), P = [
|
|
21
21
|
[".k-tabstrip-items"],
|
|
22
22
|
[".k-columnmenu-item"],
|
|
23
|
-
...
|
|
24
|
-
],
|
|
25
|
-
const [u,
|
|
26
|
-
const n =
|
|
23
|
+
...H
|
|
24
|
+
], U = (o) => {
|
|
25
|
+
const [u, E] = t.useState(!1), l = t.useRef(null), s = t.useRef(null), r = t.useRef(null), a = t.useRef(0), { columnMenu: h, ...k } = o, { column: g, columnMenuIcon: i } = o, b = _(), w = g.title || g.field, p = w ? `${w} ` : "", y = "#", C = (e) => {
|
|
26
|
+
const n = F(document);
|
|
27
27
|
clearTimeout(a.current), a.current = window.setTimeout(() => {
|
|
28
|
-
n && e.relatedTarget !== l.current && s.current && !s.current.contains(n) &&
|
|
28
|
+
n && e.relatedTarget !== l.current && s.current && !s.current.contains(n) && m();
|
|
29
29
|
});
|
|
30
|
-
},
|
|
30
|
+
}, D = () => {
|
|
31
31
|
clearTimeout(a.current);
|
|
32
|
-
},
|
|
33
|
-
e.preventDefault(), u && o.onCloseMenu && o.onCloseMenu(),
|
|
34
|
-
},
|
|
35
|
-
o.onCloseMenu && o.onCloseMenu(),
|
|
36
|
-
},
|
|
32
|
+
}, T = (e) => {
|
|
33
|
+
e.preventDefault(), u && o.onCloseMenu && o.onCloseMenu(), E(!u);
|
|
34
|
+
}, m = () => {
|
|
35
|
+
o.onCloseMenu && o.onCloseMenu(), E(!1), !o.navigatable && l.current && l.current.focus();
|
|
36
|
+
}, S = (e) => {
|
|
37
37
|
var n;
|
|
38
|
-
if (e.keyCode ===
|
|
39
|
-
const
|
|
40
|
-
|
|
38
|
+
if (e.keyCode === L.tab) {
|
|
39
|
+
const c = e.target, d = c && ((n = c.closest(".k-grid")) == null ? void 0 : n.getElementsByClassName("k-grid-content")[0]);
|
|
40
|
+
d && d.scrollWidth > d.clientWidth && c.scrollIntoView({ inline: "center" });
|
|
41
41
|
}
|
|
42
|
-
},
|
|
42
|
+
}, f = t.useMemo(() => o.show !== void 0 ? o.show : u, [o.show, u]), K = (e) => {
|
|
43
43
|
var n;
|
|
44
|
-
(n =
|
|
45
|
-
},
|
|
44
|
+
(n = r.current) == null || n.triggerKeyboardEvent(e);
|
|
45
|
+
}, B = (e) => {
|
|
46
46
|
var n;
|
|
47
|
-
(n =
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
},
|
|
47
|
+
(n = r.current) == null || n.triggerMouseEvent(e);
|
|
48
|
+
}, I = (e, n, c) => {
|
|
49
|
+
c.preventDefault(), c.shiftKey ? n.focusPrevious(e) : n.focusNext(e);
|
|
50
|
+
}, N = (e, n, c) => {
|
|
51
51
|
e && e.click();
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
52
|
+
}, R = (e, n, c) => {
|
|
53
|
+
c.preventDefault(), m();
|
|
54
|
+
}, $ = (e, n, c) => {
|
|
55
|
+
c.preventDefault(), n.focusElement(e);
|
|
56
56
|
};
|
|
57
|
-
return t.useEffect(() => (
|
|
57
|
+
return t.useEffect(() => (f && s.current && (r.current = new A({
|
|
58
58
|
tabIndex: 0,
|
|
59
59
|
root: s,
|
|
60
|
-
selectors:
|
|
60
|
+
selectors: P,
|
|
61
61
|
keyboardEvents: {
|
|
62
62
|
keydown: {
|
|
63
|
-
Tab:
|
|
64
|
-
Enter:
|
|
65
|
-
Escape:
|
|
63
|
+
Tab: I,
|
|
64
|
+
Enter: N,
|
|
65
|
+
Escape: R
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
mouseEvents: {
|
|
69
|
-
mousedown:
|
|
69
|
+
mousedown: $
|
|
70
70
|
}
|
|
71
|
-
}),
|
|
72
|
-
|
|
73
|
-
}), [
|
|
71
|
+
}), r.current.focusElement(r.current.first, null)), () => {
|
|
72
|
+
r.current && (r.current = null);
|
|
73
|
+
}), [f]), /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
|
|
74
74
|
"a",
|
|
75
75
|
{
|
|
76
76
|
className: "k-grid-header-menu k-grid-column-menu",
|
|
77
77
|
ref: l,
|
|
78
|
-
onClick:
|
|
79
|
-
onKeyDown:
|
|
80
|
-
href:
|
|
78
|
+
onClick: T,
|
|
79
|
+
onKeyDown: S,
|
|
80
|
+
href: y,
|
|
81
81
|
tabIndex: o.navigatable ? -1 : void 0,
|
|
82
|
-
"aria-label": `${
|
|
82
|
+
"aria-label": `${p}${b.toLanguageString(M, V[M])}`
|
|
83
83
|
},
|
|
84
|
-
/* @__PURE__ */ t.createElement(
|
|
84
|
+
i ? /* @__PURE__ */ t.createElement(v, { name: i.name, icon: i }) : /* @__PURE__ */ t.createElement(v, { name: "more-vertical", icon: W })
|
|
85
85
|
), /* @__PURE__ */ t.createElement(
|
|
86
|
-
|
|
86
|
+
x,
|
|
87
87
|
{
|
|
88
88
|
anchor: l.current,
|
|
89
|
-
show:
|
|
89
|
+
show: f,
|
|
90
90
|
popupClass: "k-column-menu k-column-menu-popup k-grid-columnmenu-popup"
|
|
91
91
|
},
|
|
92
92
|
/* @__PURE__ */ t.createElement(
|
|
93
93
|
"div",
|
|
94
94
|
{
|
|
95
95
|
ref: s,
|
|
96
|
-
onBlur:
|
|
97
|
-
onFocus:
|
|
98
|
-
onMouseDown:
|
|
99
|
-
onKeyDown:
|
|
96
|
+
onBlur: C,
|
|
97
|
+
onFocus: D,
|
|
98
|
+
onMouseDown: B,
|
|
99
|
+
onKeyDown: K,
|
|
100
100
|
style: { outline: "none" }
|
|
101
101
|
},
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
h && /* @__PURE__ */ t.createElement(
|
|
103
|
+
h,
|
|
104
104
|
{
|
|
105
|
-
...
|
|
106
|
-
onCloseMenu:
|
|
105
|
+
...k,
|
|
106
|
+
onCloseMenu: m
|
|
107
107
|
}
|
|
108
108
|
)
|
|
109
109
|
)
|
|
110
110
|
));
|
|
111
111
|
};
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
U as GridColumnMenuWrapper
|
|
114
114
|
};
|