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