@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.
@@ -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 N=require("react"),O=require("@progress/kendo-react-popup"),i=require("@progress/kendo-react-common"),P=require("@progress/kendo-svg-icons"),E=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(N),z=[".k-columnmenu-item-content",".k-filter-menu-container"].map(e=>i.TABBABLE_ELEMENTS.map(r=>`${e} ${r}`)),W=[[".k-tabstrip-items"],[".k-columnmenu-item"],...z],$=e=>{const[r,l]=o.useState(!1),u=o.useRef(null),a=o.useRef(null),s=o.useRef(null),m=o.useRef(0),{columnMenu:h,...v}=e,{column:b}=e,w=_.useLocalization(),k=b.title||b.field,M=k?`${k} `:"",y="#",p=n=>{const t=i.getActiveElement(document);clearTimeout(m.current),m.current=window.setTimeout(()=>{t&&n.relatedTarget!==u.current&&a.current&&!a.current.contains(t)&&f()})},C=()=>{clearTimeout(m.current)},D=n=>{n.preventDefault(),r&&e.onCloseMenu&&e.onCloseMenu(),l(!r)},f=()=>{e.onCloseMenu&&e.onCloseMenu(),l(!1),!e.navigatable&&u.current&&u.current.focus()},S=n=>{var t;if(n.keyCode===i.Keys.tab){const c=n.target,g=c&&((t=c.closest(".k-grid"))==null?void 0:t.getElementsByClassName("k-grid-content")[0]);g&&g.scrollWidth>g.clientWidth&&c.scrollIntoView({inline:"center"})}},d=o.useMemo(()=>e.show!==void 0?e.show:r,[e.show,r]),T=n=>{var t;(t=s.current)==null||t.triggerKeyboardEvent(n)},R=n=>{var t;(t=s.current)==null||t.triggerMouseEvent(n)},I=(n,t,c)=>{c.preventDefault(),c.shiftKey?t.focusPrevious(n):t.focusNext(n)},K=(n,t,c)=>{n&&n.click()},q=(n,t,c)=>{c.preventDefault(),f()},B=(n,t,c)=>{c.preventDefault(),t.focusElement(n)};return o.useEffect(()=>(d&&a.current&&(s.current=new i.Navigation({tabIndex:0,root:a,selectors:W,keyboardEvents:{keydown:{Tab:I,Enter:K,Escape:q}},mouseEvents:{mousedown:B}}),s.current.focusElement(s.current.first,null)),()=>{s.current&&(s.current=null)}),[d]),o.createElement(o.Fragment,null,o.createElement("a",{className:"k-grid-header-menu k-grid-column-menu",ref:u,onClick:D,onKeyDown:S,href:y,tabIndex:e.navigatable?-1:void 0,"aria-label":`${M}${w.toLanguageString(E.columnMenu,E.messages[E.columnMenu])}`},o.createElement(i.IconWrap,{name:"filter",icon:P.moreVerticalIcon})),o.createElement(O.Popup,{anchor:u.current,show:d,popupClass:"k-column-menu k-column-menu-popup k-grid-columnmenu-popup"},o.createElement("div",{ref:a,onBlur:p,onFocus:C,onMouseDown:R,onKeyDown:T,style:{outline:"none"}},h&&o.createElement(h,{...v,onCloseMenu:f}))))};exports.GridColumnMenuWrapper=$;
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 R } from "@progress/kendo-react-popup";
11
- import { TABBABLE_ELEMENTS as $, Navigation as x, IconWrap as z, getActiveElement as A, Keys as F } from "@progress/kendo-react-common";
12
- import { moreVerticalIcon as L } from "@progress/kendo-svg-icons";
13
- import { columnMenu as w, messages as W } from "../messages/index.mjs";
14
- import { useLocalization as V } from "@progress/kendo-react-intl";
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) => $.map(
18
+ ].map((o) => z.map(
19
19
  (u) => `${o} ${u}`
20
- )), H = [
20
+ )), P = [
21
21
  [".k-tabstrip-items"],
22
22
  [".k-columnmenu-item"],
23
- ..._
24
- ], Q = (o) => {
25
- const [u, d] = t.useState(!1), l = t.useRef(null), s = t.useRef(null), c = t.useRef(null), a = t.useRef(0), { columnMenu: E, ...v } = o, { column: h } = o, k = V(), g = h.title || h.field, M = g ? `${g} ` : "", b = "#", p = (e) => {
26
- const n = A(document);
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) && i();
28
+ n && e.relatedTarget !== l.current && s.current && !s.current.contains(n) && m();
29
29
  });
30
- }, y = () => {
30
+ }, D = () => {
31
31
  clearTimeout(a.current);
32
- }, C = (e) => {
33
- e.preventDefault(), u && o.onCloseMenu && o.onCloseMenu(), d(!u);
34
- }, i = () => {
35
- o.onCloseMenu && o.onCloseMenu(), d(!1), !o.navigatable && l.current && l.current.focus();
36
- }, D = (e) => {
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 === F.tab) {
39
- const r = e.target, f = r && ((n = r.closest(".k-grid")) == null ? void 0 : n.getElementsByClassName("k-grid-content")[0]);
40
- f && f.scrollWidth > f.clientWidth && r.scrollIntoView({ inline: "center" });
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
- }, m = t.useMemo(() => o.show !== void 0 ? o.show : u, [o.show, u]), T = (e) => {
42
+ }, f = t.useMemo(() => o.show !== void 0 ? o.show : u, [o.show, u]), K = (e) => {
43
43
  var n;
44
- (n = c.current) == null || n.triggerKeyboardEvent(e);
45
- }, S = (e) => {
44
+ (n = r.current) == null || n.triggerKeyboardEvent(e);
45
+ }, B = (e) => {
46
46
  var n;
47
- (n = c.current) == null || n.triggerMouseEvent(e);
48
- }, K = (e, n, r) => {
49
- r.preventDefault(), r.shiftKey ? n.focusPrevious(e) : n.focusNext(e);
50
- }, B = (e, n, r) => {
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
- }, I = (e, n, r) => {
53
- r.preventDefault(), i();
54
- }, N = (e, n, r) => {
55
- r.preventDefault(), n.focusElement(e);
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(() => (m && s.current && (c.current = new x({
57
+ return t.useEffect(() => (f && s.current && (r.current = new A({
58
58
  tabIndex: 0,
59
59
  root: s,
60
- selectors: H,
60
+ selectors: P,
61
61
  keyboardEvents: {
62
62
  keydown: {
63
- Tab: K,
64
- Enter: B,
65
- Escape: I
63
+ Tab: I,
64
+ Enter: N,
65
+ Escape: R
66
66
  }
67
67
  },
68
68
  mouseEvents: {
69
- mousedown: N
69
+ mousedown: $
70
70
  }
71
- }), c.current.focusElement(c.current.first, null)), () => {
72
- c.current && (c.current = null);
73
- }), [m]), /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement(
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: C,
79
- onKeyDown: D,
80
- href: b,
78
+ onClick: T,
79
+ onKeyDown: S,
80
+ href: y,
81
81
  tabIndex: o.navigatable ? -1 : void 0,
82
- "aria-label": `${M}${k.toLanguageString(w, W[w])}`
82
+ "aria-label": `${p}${b.toLanguageString(M, V[M])}`
83
83
  },
84
- /* @__PURE__ */ t.createElement(z, { name: "filter", icon: L })
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
- R,
86
+ x,
87
87
  {
88
88
  anchor: l.current,
89
- show: m,
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: p,
97
- onFocus: y,
98
- onMouseDown: S,
99
- onKeyDown: T,
96
+ onBlur: C,
97
+ onFocus: D,
98
+ onMouseDown: B,
99
+ onKeyDown: K,
100
100
  style: { outline: "none" }
101
101
  },
102
- E && /* @__PURE__ */ t.createElement(
103
- E,
102
+ h && /* @__PURE__ */ t.createElement(
103
+ h,
104
104
  {
105
- ...v,
106
- onCloseMenu: i
105
+ ...k,
106
+ onCloseMenu: m
107
107
  }
108
108
  )
109
109
  )
110
110
  ));
111
111
  };
112
112
  export {
113
- Q as GridColumnMenuWrapper
113
+ U as GridColumnMenuWrapper
114
114
  };