@progress/kendo-react-grid 8.2.1-develop.5 → 8.3.0-develop.10
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 +336 -341
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +20 -21
- package/cells/GridDetailCell.js +1 -1
- package/cells/GridDetailCell.mjs +14 -13
- package/cells/GridDetailHierarchyCell.js +1 -1
- package/cells/GridDetailHierarchyCell.mjs +7 -3
- package/cells/GridEditCell.js +1 -1
- package/cells/GridEditCell.mjs +26 -28
- package/cells/GridFilterCell.js +1 -1
- package/cells/GridFilterCell.mjs +67 -52
- package/columnMenu/GridColumnMenuColumnsList.js +1 -1
- package/columnMenu/GridColumnMenuColumnsList.mjs +36 -34
- package/columnMenu/GridColumnMenuWrapper.js +1 -1
- package/columnMenu/GridColumnMenuWrapper.mjs +52 -49
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/drag/ColumnDraggable.js +1 -1
- package/drag/ColumnDraggable.mjs +17 -15
- package/header/GridHeaderCell.js +1 -1
- package/header/GridHeaderCell.mjs +22 -28
- package/header/GridHeaderSelectionCell.js +1 -1
- package/header/GridHeaderSelectionCell.mjs +3 -3
- package/header/Header.js +1 -1
- package/header/Header.mjs +24 -38
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +83 -77
- package/index.d.mts +10 -16
- package/index.d.ts +10 -16
- package/index.js +1 -1
- package/index.mjs +80 -80
- package/messages/index.js +1 -1
- package/messages/index.mjs +49 -43
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/rows/GridRow.js +1 -1
- package/rows/GridRow.mjs +32 -40
- package/utils/index.js +1 -1
- package/utils/index.mjs +39 -38
|
@@ -7,57 +7,59 @@
|
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
9
|
import * as t from "react";
|
|
10
|
-
import { TextBox as
|
|
11
|
-
import { IconWrap as
|
|
12
|
-
import { searchIcon as
|
|
13
|
-
import { Button as
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
import { TextBox as M, InputPrefix as B, Checkbox as k } from "@progress/kendo-react-inputs";
|
|
11
|
+
import { IconWrap as w } from "@progress/kendo-react-common";
|
|
12
|
+
import { searchIcon as A } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { Button as f } from "@progress/kendo-react-buttons";
|
|
14
|
+
import { useLocalization as I } from "@progress/kendo-react-intl";
|
|
15
|
+
import { filterSelectAll as h, messages as u, filterApplyButton as g, filterResetButton as E } from "../messages/index.mjs";
|
|
16
|
+
const R = (l) => {
|
|
17
|
+
const [a, S] = t.useState(""), d = l.columns.reduce((e, n) => ({ ...e, [n.id || ""]: !!l.columnsState.find((o) => o.id === n.id) }), {}), [c, m] = t.useState(d), b = t.useMemo(() => l.columns.filter((e) => {
|
|
16
18
|
var n;
|
|
17
|
-
return (n = e.title || e.field) == null ? void 0 : n.toLowerCase().includes(
|
|
18
|
-
}), [l.columns,
|
|
19
|
+
return (n = e.title || e.field) == null ? void 0 : n.toLowerCase().includes(a.toLowerCase());
|
|
20
|
+
}), [l.columns, a]), r = I(), N = t.useCallback(() => {
|
|
19
21
|
const e = l.columns.filter((n) => c[n.id || ""]);
|
|
20
22
|
l.onColumnsChange.call(void 0, e), l.onCloseMenu.call(void 0);
|
|
21
|
-
}, [c, l.columns, l.onColumnsChange, l.onCloseMenu]),
|
|
22
|
-
|
|
23
|
-
}, s = t.useMemo(() => Object.values(c).filter((e) => e).length, [c]),
|
|
23
|
+
}, [c, l.columns, l.onColumnsChange, l.onCloseMenu]), x = () => {
|
|
24
|
+
m(d);
|
|
25
|
+
}, s = t.useMemo(() => Object.values(c).filter((e) => e).length, [c]), i = t.useMemo(() => s === l.columns.length, [l.columns, s]), y = t.useCallback(() => {
|
|
24
26
|
const e = { ...c };
|
|
25
|
-
Object.keys(e).forEach((n,
|
|
26
|
-
}, [c,
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
}, [c]),
|
|
30
|
-
|
|
27
|
+
Object.keys(e).forEach((n, o) => e[n] = i && o === 0 ? !0 : !i), m(e);
|
|
28
|
+
}, [c, i]), L = t.useCallback((e, n) => {
|
|
29
|
+
const o = { ...c };
|
|
30
|
+
o[n || ""] = e, m(o);
|
|
31
|
+
}, [c]), v = (e) => {
|
|
32
|
+
S(String(e.target.value));
|
|
31
33
|
};
|
|
32
34
|
return /* @__PURE__ */ t.createElement("form", { className: "k-filter-menu" }, /* @__PURE__ */ t.createElement("div", { className: "k-filter-menu-container" }, /* @__PURE__ */ t.createElement(
|
|
33
|
-
|
|
35
|
+
M,
|
|
34
36
|
{
|
|
35
37
|
className: "k-searchbox",
|
|
36
|
-
value:
|
|
37
|
-
onChange:
|
|
38
|
-
prefix: () => /* @__PURE__ */ t.createElement(
|
|
38
|
+
value: a,
|
|
39
|
+
onChange: v,
|
|
40
|
+
prefix: () => /* @__PURE__ */ t.createElement(B, null, /* @__PURE__ */ t.createElement(w, { name: "search", icon: A }))
|
|
39
41
|
}
|
|
40
|
-
), /* @__PURE__ */ t.createElement("ul", { className: "k-reset k-multicheck-wrap" }, !
|
|
41
|
-
|
|
42
|
+
), /* @__PURE__ */ t.createElement("ul", { className: "k-reset k-multicheck-wrap" }, !a && /* @__PURE__ */ t.createElement("li", { className: "k-item k-check-all-wrap" }, /* @__PURE__ */ t.createElement(
|
|
43
|
+
k,
|
|
42
44
|
{
|
|
43
|
-
checked:
|
|
44
|
-
onChange:
|
|
45
|
-
label:
|
|
45
|
+
checked: i,
|
|
46
|
+
onChange: y,
|
|
47
|
+
label: r.toLanguageString(h, u[h])
|
|
46
48
|
}
|
|
47
|
-
)),
|
|
48
|
-
|
|
49
|
+
)), b.map((e, n) => /* @__PURE__ */ t.createElement("li", { key: e.id, className: "k-item" }, /* @__PURE__ */ t.createElement(
|
|
50
|
+
k,
|
|
49
51
|
{
|
|
50
52
|
disabled: c[e.id || ""] && s === 1,
|
|
51
53
|
checked: c[e.id || ""],
|
|
52
|
-
onChange: (
|
|
53
|
-
var
|
|
54
|
-
return
|
|
54
|
+
onChange: (o) => {
|
|
55
|
+
var C;
|
|
56
|
+
return L(!!((C = o.target.element) != null && C.checked), e.id);
|
|
55
57
|
},
|
|
56
58
|
label: e.title || e.field
|
|
57
59
|
}
|
|
58
|
-
)))), /* @__PURE__ */ t.createElement("div", { className: "k-filter-selected-items" }, s, " selected items"), /* @__PURE__ */ t.createElement("div", { className: "k-actions k-actions-start k-actions-horizontal" }, /* @__PURE__ */ t.createElement(
|
|
60
|
+
)))), /* @__PURE__ */ t.createElement("div", { className: "k-filter-selected-items" }, s, " selected items"), /* @__PURE__ */ t.createElement("div", { className: "k-actions k-actions-start k-actions-horizontal" }, /* @__PURE__ */ t.createElement(f, { type: "button", themeColor: "primary", onClick: N }, r.toLanguageString(g, u[g])), /* @__PURE__ */ t.createElement(f, { type: "button", onClick: x }, r.toLanguageString(E, u[E])))));
|
|
59
61
|
};
|
|
60
|
-
|
|
62
|
+
R.displayName = "GridColumnMenuColumnsList";
|
|
61
63
|
export {
|
|
62
|
-
|
|
64
|
+
R as GridColumnMenuColumnsList
|
|
63
65
|
};
|
|
@@ -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 W=require("react"),_=require("@progress/kendo-react-popup"),a=require("@progress/kendo-react-common"),j=require("@progress/kendo-svg-icons"),E=require("../messages/index.js"),z=require("@progress/kendo-react-intl");function A(n){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const u in n)if(u!=="default"){const l=Object.getOwnPropertyDescriptor(n,u);Object.defineProperty(r,u,l.get?l:{enumerable:!0,get:()=>n[u]})}}return r.default=n,Object.freeze(r)}const o=A(W),$=[".k-columnmenu-item-content",".k-filter-menu-container"].map(n=>a.TABBABLE_ELEMENTS.map(r=>`${n} ${r}`)),x=[[".k-tabstrip-items"],[".k-columnmenu-item"],...$],F=n=>{const[r,u]=o.useState(!1),l=o.useRef(null),i=o.useRef(null),s=o.useRef(null),m=o.useRef(0),{columnMenu:M,...v}=n,{column:k,columnMenuIcon:f,navigatable:w}=n,p=z.useLocalization(),b=k.title||k.field,y=b?`${b} `:"",C="#",D=e=>{const t=a.getActiveElement(document);clearTimeout(m.current),m.current=window.setTimeout(()=>{t&&e.relatedTarget!==l.current&&i.current&&!i.current.contains(t)&&d()})},S=()=>{clearTimeout(m.current)},T=e=>{e.preventDefault(),r&&n.onCloseMenu&&n.onCloseMenu(),u(!r)},d=()=>{n.onCloseMenu&&n.onCloseMenu(),u(!1),!n.navigatable&&l.current&&l.current.focus()},I=e=>{var t;if(e.keyCode===a.Keys.tab){const c=e.target,h=c&&((t=c.closest(".k-grid"))==null?void 0:t.getElementsByClassName("k-grid-content")[0]);h&&h.scrollWidth>h.clientWidth&&c.scrollIntoView({inline:"center"})}},g=o.useMemo(()=>n.show!==void 0?n.show:r,[n.show,r]),R=e=>{var t;(t=s.current)==null||t.triggerKeyboardEvent(e)},O=e=>{var t;(t=s.current)==null||t.triggerMouseEvent(e)},K=(e,t,c)=>{c.preventDefault(),c.shiftKey?t.focusPrevious(e):t.focusNext(e)},P=(e,t,c)=>{e&&e.click()},q=(e,t,c)=>{c.preventDefault(),d()},B=(e,t,c)=>{c.preventDefault(),t.focusElement(e)},N=e=>{!e.isAnchorClicked&&u(!1)};return o.useEffect(()=>(g&&i.current&&(s.current=new a.Navigation({tabIndex:0,root:i,selectors:x,keyboardEvents:{keydown:{Tab:K,Enter:P,Escape:q}},mouseEvents:{mousedown:B}}),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:l,onClick:T,onKeyDown:I,href:C,tabIndex:w?-1:void 0,"aria-label":`${w?"":y}${p.toLanguageString(E.columnMenu,E.messages[E.columnMenu])}`},f?o.createElement(a.IconWrap,{name:f.name,icon:f}):o.createElement(a.IconWrap,{name:"more-vertical",icon:j.moreVerticalIcon})),o.createElement(_.Popup,{anchor:l.current,show:g,popupClass:"k-column-menu k-column-menu-popup k-grid-columnmenu-popup",onMouseDownOutside:N},o.createElement("div",{ref:i,onBlur:D,onFocus:S,onMouseDown:O,onKeyDown:R,style:{outline:"none"}},M&&o.createElement(M,{...v,onCloseMenu:d}))))};exports.GridColumnMenuWrapper=F;
|
|
@@ -6,109 +6,112 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import * as
|
|
9
|
+
import * as o from "react";
|
|
10
10
|
import { Popup as z } from "@progress/kendo-react-popup";
|
|
11
|
-
import { TABBABLE_ELEMENTS as
|
|
11
|
+
import { TABBABLE_ELEMENTS as F, Navigation as L, IconWrap as v, getActiveElement as W, Keys as P } from "@progress/kendo-react-common";
|
|
12
12
|
import { moreVerticalIcon as V } from "@progress/kendo-svg-icons";
|
|
13
13
|
import { columnMenu as k, messages as _ } from "../messages/index.mjs";
|
|
14
14
|
import { useLocalization as H } from "@progress/kendo-react-intl";
|
|
15
|
-
const
|
|
15
|
+
const O = [
|
|
16
16
|
".k-columnmenu-item-content",
|
|
17
17
|
".k-filter-menu-container"
|
|
18
|
-
].map((
|
|
19
|
-
(u) => `${
|
|
18
|
+
].map((t) => F.map(
|
|
19
|
+
(u) => `${t} ${u}`
|
|
20
20
|
)), G = [
|
|
21
21
|
[".k-tabstrip-items"],
|
|
22
22
|
[".k-columnmenu-item"],
|
|
23
|
-
...
|
|
24
|
-
],
|
|
25
|
-
const [u,
|
|
26
|
-
const n =
|
|
27
|
-
clearTimeout(
|
|
28
|
-
n && e.relatedTarget !== l.current && s.current && !s.current.contains(n) &&
|
|
23
|
+
...O
|
|
24
|
+
], Y = (t) => {
|
|
25
|
+
const [u, a] = o.useState(!1), l = o.useRef(null), s = o.useRef(null), r = o.useRef(null), i = o.useRef(0), { columnMenu: E, ...p } = t, { column: g, columnMenuIcon: m, navigatable: w } = t, b = H(), M = g.title || g.field, C = M ? `${M} ` : "", D = "#", y = (e) => {
|
|
26
|
+
const n = W(document);
|
|
27
|
+
clearTimeout(i.current), i.current = window.setTimeout(() => {
|
|
28
|
+
n && e.relatedTarget !== l.current && s.current && !s.current.contains(n) && f();
|
|
29
29
|
});
|
|
30
30
|
}, T = () => {
|
|
31
|
-
clearTimeout(
|
|
31
|
+
clearTimeout(i.current);
|
|
32
32
|
}, S = (e) => {
|
|
33
|
-
e.preventDefault(), u &&
|
|
34
|
-
},
|
|
35
|
-
|
|
33
|
+
e.preventDefault(), u && t.onCloseMenu && t.onCloseMenu(), a(!u);
|
|
34
|
+
}, f = () => {
|
|
35
|
+
t.onCloseMenu && t.onCloseMenu(), a(!1), !t.navigatable && l.current && l.current.focus();
|
|
36
36
|
}, K = (e) => {
|
|
37
37
|
var n;
|
|
38
|
-
if (e.keyCode ===
|
|
39
|
-
const
|
|
40
|
-
|
|
38
|
+
if (e.keyCode === P.tab) {
|
|
39
|
+
const c = e.target, h = c && ((n = c.closest(".k-grid")) == null ? void 0 : n.getElementsByClassName("k-grid-content")[0]);
|
|
40
|
+
h && h.scrollWidth > h.clientWidth && c.scrollIntoView({ inline: "center" });
|
|
41
41
|
}
|
|
42
|
-
},
|
|
42
|
+
}, d = o.useMemo(() => t.show !== void 0 ? t.show : u, [t.show, u]), B = (e) => {
|
|
43
43
|
var n;
|
|
44
|
-
(n =
|
|
44
|
+
(n = r.current) == null || n.triggerKeyboardEvent(e);
|
|
45
45
|
}, I = (e) => {
|
|
46
46
|
var n;
|
|
47
|
-
(n =
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
},
|
|
47
|
+
(n = r.current) == null || n.triggerMouseEvent(e);
|
|
48
|
+
}, A = (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(), f();
|
|
54
|
+
}, $ = (e, n, c) => {
|
|
55
|
+
c.preventDefault(), n.focusElement(e);
|
|
56
|
+
}, x = (e) => {
|
|
57
|
+
!e.isAnchorClicked && a(!1);
|
|
56
58
|
};
|
|
57
|
-
return
|
|
59
|
+
return o.useEffect(() => (d && s.current && (r.current = new L({
|
|
58
60
|
tabIndex: 0,
|
|
59
61
|
root: s,
|
|
60
62
|
selectors: G,
|
|
61
63
|
keyboardEvents: {
|
|
62
64
|
keydown: {
|
|
63
|
-
Tab:
|
|
64
|
-
Enter:
|
|
65
|
-
Escape:
|
|
65
|
+
Tab: A,
|
|
66
|
+
Enter: N,
|
|
67
|
+
Escape: R
|
|
66
68
|
}
|
|
67
69
|
},
|
|
68
70
|
mouseEvents: {
|
|
69
|
-
mousedown:
|
|
71
|
+
mousedown: $
|
|
70
72
|
}
|
|
71
|
-
}),
|
|
72
|
-
|
|
73
|
-
}), [
|
|
73
|
+
}), r.current.focusElement(r.current.first, null)), () => {
|
|
74
|
+
r.current && (r.current = null);
|
|
75
|
+
}), [d]), /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
74
76
|
"a",
|
|
75
77
|
{
|
|
76
78
|
className: "k-grid-header-menu k-grid-column-menu",
|
|
77
79
|
ref: l,
|
|
78
80
|
onClick: S,
|
|
79
81
|
onKeyDown: K,
|
|
80
|
-
href:
|
|
82
|
+
href: D,
|
|
81
83
|
tabIndex: w ? -1 : void 0,
|
|
82
|
-
"aria-label": `${w ? "" :
|
|
84
|
+
"aria-label": `${w ? "" : C}${b.toLanguageString(k, _[k])}`
|
|
83
85
|
},
|
|
84
|
-
|
|
85
|
-
), /* @__PURE__ */
|
|
86
|
+
m ? /* @__PURE__ */ o.createElement(v, { name: m.name, icon: m }) : /* @__PURE__ */ o.createElement(v, { name: "more-vertical", icon: V })
|
|
87
|
+
), /* @__PURE__ */ o.createElement(
|
|
86
88
|
z,
|
|
87
89
|
{
|
|
88
90
|
anchor: l.current,
|
|
89
|
-
show:
|
|
90
|
-
popupClass: "k-column-menu k-column-menu-popup k-grid-columnmenu-popup"
|
|
91
|
+
show: d,
|
|
92
|
+
popupClass: "k-column-menu k-column-menu-popup k-grid-columnmenu-popup",
|
|
93
|
+
onMouseDownOutside: x
|
|
91
94
|
},
|
|
92
|
-
/* @__PURE__ */
|
|
95
|
+
/* @__PURE__ */ o.createElement(
|
|
93
96
|
"div",
|
|
94
97
|
{
|
|
95
98
|
ref: s,
|
|
96
|
-
onBlur:
|
|
99
|
+
onBlur: y,
|
|
97
100
|
onFocus: T,
|
|
98
101
|
onMouseDown: I,
|
|
99
102
|
onKeyDown: B,
|
|
100
103
|
style: { outline: "none" }
|
|
101
104
|
},
|
|
102
|
-
|
|
103
|
-
|
|
105
|
+
E && /* @__PURE__ */ o.createElement(
|
|
106
|
+
E,
|
|
104
107
|
{
|
|
105
|
-
...
|
|
106
|
-
onCloseMenu:
|
|
108
|
+
...p,
|
|
109
|
+
onCloseMenu: f
|
|
107
110
|
}
|
|
108
111
|
)
|
|
109
112
|
)
|
|
110
113
|
));
|
|
111
114
|
};
|
|
112
115
|
export {
|
|
113
|
-
|
|
116
|
+
Y as GridColumnMenuWrapper
|
|
114
117
|
};
|