@progress/kendo-react-grid 14.5.0-develop.7 → 14.5.0-develop.9

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.
@@ -6,4 +6,4 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),g=require("../../utils/GridContext.js"),f=require("@progress/kendo-react-common"),o=require("@progress/kendo-svg-icons"),m=require("@progress/kendo-react-intl"),c=require("../../messages/index.js"),p=require("@progress/kendo-react-data-tools");function I(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,n.get?n:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const r=I(s),b=t=>{const e=r.useContext(g.GridContext),a=m.useLocalization(),n=t.expanded?c.groupCollapse:c.groupExpand,u=a.toLanguageString(n,c.messages[n]),l=e.dir==="rtl";return r.createElement("a",{onClick:i=>{var d;i.preventDefault(),e!=null&&e.itemChange&&e.itemChange({dataItem:t.dataItem,dataIndex:t.dataIndex,syntheticEvent:i,field:void 0,value:!t.expanded}),(d=e==null?void 0:e.dispatchGroupExpand)==null||d.call(e,{type:p.GROUP_EXPAND_ACTION.TOGGLE,group:t.group})},href:"#",tabIndex:-1,"aria-label":u},r.createElement(f.IconWrap,{name:t.expanded?"caret-alt-down":l?"caret-alt-left":"caret-alt-right",icon:t.expanded?o.caretAltDownIcon:l?o.caretAltLeftIcon:o.caretAltRightIcon}))};exports.GridGroupCellToggle=b;
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),m=require("../../utils/GridContext.js"),h=require("@progress/kendo-react-common"),a=require("@progress/kendo-svg-icons"),p=require("@progress/kendo-react-intl"),c=require("../../messages/index.js"),v=require("@progress/kendo-react-data-tools");function I(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const r=I(f),b=t=>{const e=r.useContext(m.GridContext),n=p.useLocalization(),o=t.expanded?c.groupCollapse:c.groupExpand,d=n.toLanguageString(o,c.messages[o]),i=e.dir==="rtl",u=i?"chevron-left":"chevron-right",g=i?a.chevronLeftIcon:a.chevronRightIcon;return r.createElement("a",{onClick:l=>{var s;l.preventDefault(),e!=null&&e.itemChange&&e.itemChange({dataItem:t.dataItem,dataIndex:t.dataIndex,syntheticEvent:l,field:void 0,value:!t.expanded}),(s=e==null?void 0:e.dispatchGroupExpand)==null||s.call(e,{type:v.GROUP_EXPAND_ACTION.TOGGLE,group:t.group})},href:"#",tabIndex:-1,"aria-label":d},r.createElement(h.IconWrap,{name:t.expanded?"chevron-down":u,icon:t.expanded?a.chevronDownIcon:g}))};exports.GridGroupCellToggle=b;
@@ -6,47 +6,47 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as a from "react";
10
- import { GridContext as m } from "../../utils/GridContext.mjs";
11
- import { IconWrap as d } from "@progress/kendo-react-common";
12
- import { caretAltDownIcon as s, caretAltLeftIcon as f, caretAltRightIcon as p } from "@progress/kendo-svg-icons";
13
- import { useLocalization as u } from "@progress/kendo-react-intl";
14
- import { groupCollapse as g, groupExpand as I, messages as h } from "../../messages/index.mjs";
15
- import { GROUP_EXPAND_ACTION as x } from "@progress/kendo-react-data-tools";
16
- const b = (t) => {
17
- const e = a.useContext(m), l = u(), o = t.expanded ? g : I, i = l.toLanguageString(o, h[o]), n = e.dir === "rtl";
9
+ import * as t from "react";
10
+ import { GridContext as d } from "../../utils/GridContext.mjs";
11
+ import { IconWrap as f } from "@progress/kendo-react-common";
12
+ import { chevronDownIcon as h, chevronLeftIcon as p, chevronRightIcon as u } from "@progress/kendo-svg-icons";
13
+ import { useLocalization as g } from "@progress/kendo-react-intl";
14
+ import { groupCollapse as I, groupExpand as v, messages as x } from "../../messages/index.mjs";
15
+ import { GROUP_EXPAND_ACTION as E } from "@progress/kendo-react-data-tools";
16
+ const D = (o) => {
17
+ const e = t.useContext(d), c = g(), n = o.expanded ? I : v, m = c.toLanguageString(n, x[n]), a = e.dir === "rtl", l = a ? "chevron-left" : "chevron-right", s = a ? p : u;
18
18
  return (
19
19
  // eslint-disable-next-line jsx-a11y/anchor-is-valid
20
- /* @__PURE__ */ a.createElement(
20
+ /* @__PURE__ */ t.createElement(
21
21
  "a",
22
22
  {
23
23
  onClick: (r) => {
24
- var c;
24
+ var i;
25
25
  r.preventDefault(), e != null && e.itemChange && e.itemChange({
26
- dataItem: t.dataItem,
27
- dataIndex: t.dataIndex,
26
+ dataItem: o.dataItem,
27
+ dataIndex: o.dataIndex,
28
28
  syntheticEvent: r,
29
29
  field: void 0,
30
- value: !t.expanded
31
- }), (c = e == null ? void 0 : e.dispatchGroupExpand) == null || c.call(e, {
32
- type: x.TOGGLE,
33
- group: t.group
30
+ value: !o.expanded
31
+ }), (i = e == null ? void 0 : e.dispatchGroupExpand) == null || i.call(e, {
32
+ type: E.TOGGLE,
33
+ group: o.group
34
34
  });
35
35
  },
36
36
  href: "#",
37
37
  tabIndex: -1,
38
- "aria-label": i
38
+ "aria-label": m
39
39
  },
40
- /* @__PURE__ */ a.createElement(
41
- d,
40
+ /* @__PURE__ */ t.createElement(
41
+ f,
42
42
  {
43
- name: t.expanded ? "caret-alt-down" : n ? "caret-alt-left" : "caret-alt-right",
44
- icon: t.expanded ? s : n ? f : p
43
+ name: o.expanded ? "chevron-down" : l,
44
+ icon: o.expanded ? h : s
45
45
  }
46
46
  )
47
47
  )
48
48
  );
49
49
  };
50
50
  export {
51
- b as GridGroupCellToggle
51
+ D as GridGroupCellToggle
52
52
  };
@@ -6,4 +6,4 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),v=require("@progress/kendo-react-common"),q=require("@progress/kendo-react-popup"),B=require("@progress/kendo-react-intl"),r=require("@progress/kendo-svg-icons"),o=require("../../messages/index.js"),x=require("../../utils/GridContext.js"),y=require("@progress/kendo-react-layout");function C(i){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(c,e,a.get?a:{enumerable:!0,get:()=>i[e]})}}return c.default=i,Object.freeze(c)}const n=C(w),D=i=>{const{dataItem:c}=i,e=n.useContext(x.GridContext),a=B.useLocalization(),b="#",u=e!=null&&e.getRowPinPosition?e.getRowPinPosition(c):"none",s=u!=="none",[I,l]=n.useState(!1),g=n.useRef(null),k=n.useCallback(t=>{t.preventDefault(),l(d=>!d)},[]),O=n.useCallback(t=>{!t.isAnchorClicked&&l(!1)},[]),p=a.toLanguageString(o.gridPinToTop,o.messages[o.gridPinToTop]),f=a.toLanguageString(o.gridPinToBottom,o.messages[o.gridPinToBottom]),m=a.toLanguageString(o.gridUnpin,o.messages[o.gridUnpin]),S=n.useMemo(()=>{const t=[];return s&&t.push({text:m,svgIcon:r.unpinOutlineIcon,data:{action:"unpin"}}),u!=="top"&&t.push({text:p,svgIcon:r.pinOutlineTopIcon,data:{action:"pinTop"}}),u!=="bottom"&&t.push({text:f,svgIcon:r.pinOutlineBottomIcon,data:{action:"pinBottom"}}),t},[s,m,u,p,f]),R=n.useCallback(t=>{var P,h,T;const d=(h=(P=t.item)==null?void 0:P.data)==null?void 0:h.action;(T=e==null?void 0:e.onRowPin)==null||T.call(e,d,c),l(!1)},[e,c]);return n.createElement(n.Fragment,null,n.createElement("a",{className:"k-pin-cell",ref:g,href:b,tabIndex:-1,onClick:k,"aria-label":s?m:p},n.createElement(v.IconWrap,{name:s?"unpin":"pin",icon:s?r.unpinOutlineIcon:r.pinOutlineIcon})),n.createElement(q.Popup,{anchor:g.current,show:I,anchorAlign:{vertical:"bottom",horizontal:"right"},popupClass:"k-menu-popup",onMouseDownOutside:O},n.createElement(y.Menu,{vertical:!0,items:S,onSelect:R})))};exports.GridPinDropdownButton=D;
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),q=require("@progress/kendo-react-common"),B=require("@progress/kendo-react-popup"),O=require("@progress/kendo-react-intl"),r=require("@progress/kendo-svg-icons"),o=require("../../messages/index.js"),x=require("../../utils/GridContext.js"),y=require("@progress/kendo-react-layout");function C(i){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(c,e,a.get?a:{enumerable:!0,get:()=>i[e]})}}return c.default=i,Object.freeze(c)}const n=C(v),D=i=>{const{dataItem:c}=i,e=n.useContext(x.GridContext),a=O.useLocalization(),b="#",u=e!=null&&e.getRowPinPosition?e.getRowPinPosition(c):"none",s=u!=="none",[I,l]=n.useState(!1),g=n.useRef(null),k=n.useCallback(t=>{t.preventDefault(),l(d=>!d)},[]),S=n.useCallback(t=>{!t.isAnchorClicked&&l(!1)},[]),p=a.toLanguageString(o.gridPinToTop,o.messages[o.gridPinToTop]),f=a.toLanguageString(o.gridPinToBottom,o.messages[o.gridPinToBottom]),m=a.toLanguageString(o.gridUnpin,o.messages[o.gridUnpin]),R=n.useMemo(()=>{const t=[];return s&&t.push({text:m,svgIcon:r.unpinIcon,data:{action:"unpin"}}),u!=="top"&&t.push({text:p,svgIcon:r.pinTopIcon,data:{action:"pinTop"}}),u!=="bottom"&&t.push({text:f,svgIcon:r.pinBottomIcon,data:{action:"pinBottom"}}),t},[s,m,u,p,f]),w=n.useCallback(t=>{var P,h,T;const d=(h=(P=t.item)==null?void 0:P.data)==null?void 0:h.action;(T=e==null?void 0:e.onRowPin)==null||T.call(e,d,c),l(!1)},[e,c]);return n.createElement(n.Fragment,null,n.createElement("a",{className:"k-pin-cell",ref:g,href:b,tabIndex:-1,onClick:k,"aria-label":s?m:p},n.createElement(q.IconWrap,{name:s?"unpin":"pin",icon:s?r.unpinIcon:r.pinIcon})),n.createElement(B.Popup,{anchor:g.current,show:I,anchorAlign:{vertical:"bottom",horizontal:"right"},popupClass:"k-menu-popup",onMouseDownOutside:S},n.createElement(y.Menu,{vertical:!0,items:R,onSelect:w})))};exports.GridPinDropdownButton=D;
@@ -8,20 +8,20 @@
8
8
  "use client";
9
9
  import * as o from "react";
10
10
  import { IconWrap as E } from "@progress/kendo-react-common";
11
- import { Popup as O } from "@progress/kendo-react-popup";
12
- import { useLocalization as C } from "@progress/kendo-react-intl";
13
- import { unpinOutlineIcon as P, pinOutlineTopIcon as L, pinOutlineBottomIcon as M, pinOutlineIcon as z } from "@progress/kendo-svg-icons";
14
- import { gridPinToTop as T, messages as u, gridPinToBottom as I, gridUnpin as w } from "../../messages/index.mjs";
15
- import { GridContext as D } from "../../utils/GridContext.mjs";
16
- import { Menu as A } from "@progress/kendo-react-layout";
11
+ import { Popup as C } from "@progress/kendo-react-popup";
12
+ import { useLocalization as L } from "@progress/kendo-react-intl";
13
+ import { unpinIcon as P, pinTopIcon as M, pinBottomIcon as z, pinIcon as D } from "@progress/kendo-svg-icons";
14
+ import { gridPinToTop as T, messages as m, gridPinToBottom as I, gridUnpin as w } from "../../messages/index.mjs";
15
+ import { GridContext as A } from "../../utils/GridContext.mjs";
16
+ import { Menu as G } from "@progress/kendo-react-layout";
17
17
  const q = (b) => {
18
- const { dataItem: a } = b, n = o.useContext(D), s = C(), k = "#", i = n != null && n.getRowPinPosition ? n.getRowPinPosition(a) : "none", e = i !== "none", [S, c] = o.useState(!1), m = o.useRef(null), v = o.useCallback((t) => {
18
+ const { dataItem: a } = b, n = o.useContext(A), s = L(), k = "#", i = n != null && n.getRowPinPosition ? n.getRowPinPosition(a) : "none", e = i !== "none", [S, c] = o.useState(!1), u = o.useRef(null), v = o.useCallback((t) => {
19
19
  t.preventDefault(), c((l) => !l);
20
20
  }, []), R = o.useCallback((t) => {
21
21
  !t.isAnchorClicked && c(!1);
22
- }, []), r = s.toLanguageString(T, u[T]), f = s.toLanguageString(I, u[I]), p = s.toLanguageString(w, u[w]), x = o.useMemo(() => {
22
+ }, []), r = s.toLanguageString(T, m[T]), f = s.toLanguageString(I, m[I]), p = s.toLanguageString(w, m[w]), x = o.useMemo(() => {
23
23
  const t = [];
24
- return e && t.push({ text: p, svgIcon: P, data: { action: "unpin" } }), i !== "top" && t.push({ text: r, svgIcon: L, data: { action: "pinTop" } }), i !== "bottom" && t.push({ text: f, svgIcon: M, data: { action: "pinBottom" } }), t;
24
+ return e && t.push({ text: p, svgIcon: P, data: { action: "unpin" } }), i !== "top" && t.push({ text: r, svgIcon: M, data: { action: "pinTop" } }), i !== "bottom" && t.push({ text: f, svgIcon: z, data: { action: "pinBottom" } }), t;
25
25
  }, [e, p, i, r, f]), B = o.useCallback(
26
26
  (t) => {
27
27
  var g, h, d;
@@ -34,23 +34,23 @@ const q = (b) => {
34
34
  "a",
35
35
  {
36
36
  className: "k-pin-cell",
37
- ref: m,
37
+ ref: u,
38
38
  href: k,
39
39
  tabIndex: -1,
40
40
  onClick: v,
41
41
  "aria-label": e ? p : r
42
42
  },
43
- /* @__PURE__ */ o.createElement(E, { name: e ? "unpin" : "pin", icon: e ? P : z })
43
+ /* @__PURE__ */ o.createElement(E, { name: e ? "unpin" : "pin", icon: e ? P : D })
44
44
  ), /* @__PURE__ */ o.createElement(
45
- O,
45
+ C,
46
46
  {
47
- anchor: m.current,
47
+ anchor: u.current,
48
48
  show: S,
49
49
  anchorAlign: { vertical: "bottom", horizontal: "right" },
50
50
  popupClass: "k-menu-popup",
51
51
  onMouseDownOutside: R
52
52
  },
53
- /* @__PURE__ */ o.createElement(A, { vertical: !0, items: x, onSelect: B })
53
+ /* @__PURE__ */ o.createElement(G, { vertical: !0, items: x, onSelect: B })
54
54
  ));
55
55
  };
56
56
  export {
@@ -6,4 +6,4 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const le=require("react"),w=require("@progress/kendo-data-query"),re=require("./GridColumnMenuItem.js"),ne=require("./GridColumnMenuItemGroup.js"),ie=require("./GridColumnMenuItemContent.js"),oe=require("@progress/kendo-react-intl"),i=require("../filterCommon.js"),u=require("../messages/index.js"),ae=require("./GridColumnMenuFilterUI.js"),R=require("@progress/kendo-react-buttons"),ue=require("@progress/kendo-svg-icons"),se=require("../utils/GridContext.js"),ce=require("./adaptiveContent/GridAdaptiveFilterMenu.js");function de(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const c in e)if(c!=="default"){const g=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(o,c,g.get?g:{enumerable:!0,get:()=>e[c]})}}return o.default=e,Object.freeze(o)}const l=de(le),E=e=>e||{filters:[],logic:"and"},h=(e,o)=>E(o).filters.filter(C=>w.isCompositeFilterDescriptor(C)?C.filters&&C.filters.length&&!C.filters.find(M=>w.isCompositeFilterDescriptor(M)||M.field!==e):!1)[0]||null,fe=(e,o)=>!!h(e,o),me=e=>{const o=l.useContext(se.GridContext),c=l.useCallback(()=>{let t;if(e.column&&e.column.field){const n=i.getFilterType(e.column.filter),r=i.getDefaultOperator(e.filterOperators,n);t=h(e.column.field,e.filter),t=t?{...t,filters:t.filters.map(a=>({...a}))}:{logic:"and",filters:[{field:e.column.field,operator:r,value:i.IsUnaryFilter(r)?null:void 0},{field:e.column.field,operator:r,value:i.IsUnaryFilter(r)?null:void 0}]},t.filters.filter(a=>a.field===e.column.field).length===1&&t.filters.splice(1,0,{field:e.column.field,operator:r})}return t},[e.column]),[g,C]=l.useState(e.expanded||!1),[M,b]=l.useState(!1),[d,q]=l.useState(c()),O=()=>e.expanded!==void 0,z=()=>{const t=O(),n=!(t?e.expanded:g);e.onExpandChange&&e.onExpandChange(n),b(!M),!t&&!o.mobileMode&&C(n)},H=t=>{T(0,t)},$=t=>{T(1,t)},T=(t,n)=>{const r=d.filters.map((a,s)=>s===t?{...a,value:n.value,operator:n.operator}:a);q({...d,filters:r})},Q=t=>{let n=t.target.value;t.target.tagName==="SPAN"&&(n=t.target.parentElement.value),q({...d,logic:n})},D=t=>{if(t.preventDefault(),!e.onFilterChange)return;const n=e.column.field,r=E(e.filter),a=h(n,e.filter),s=r.filters.filter(v=>v!==a);s.length?e.onFilterChange({...r,filters:s},t):e.onFilterChange(null,t),e.onCloseMenu&&e.onCloseMenu()},B=()=>({...d,filters:d.filters.filter(t=>t.value!==void 0&&t.value!==null&&t.value!==""||t.value===null&&t.operator)}),y=t=>{if(t.preventDefault(),!e.onFilterChange)return;const n=e.column.field,r=E(e.filter),a=h(n,e.filter),s=B();let v=null;if(a&&s.filters.length>0){const G=r.filters.map(x=>x===a?s:x);v={...r,filters:G}}else if(s.filters.length===0){const G=r.filters.filter(x=>x!==a);G.length&&(v={...r,filters:G})}else v={...r,filters:[...r.filters,s]};e.onFilterChange(v,t),e.onCloseMenu&&e.onCloseMenu()},{column:f,filterUI:J,hideSecondFilter:P,filterOperators:K}=e,m=oe.useLocalization();if(!f||!f.field)return l.createElement("div",null);const p=i.getFilterType(f.filter),W=P!==void 0?P:i.defaultHideSecondFilter[p],F=d.filters,L=i.operatorMap(K[p],m),U=i.operatorMap(i.booleanFilterValues,m),X={field:f.field,value:F[0].value,operator:F[0].operator,operators:L,booleanValues:U,onChange:H,filterType:p},Y={field:f.field,value:F[1].value,operator:F[1].operator,operators:L,booleanValues:U,onChange:$,filterType:p},A=d.logic,N=i.operatorMap(i.filterLogicList,m),S={value:N.find(t=>t.operator===(A===null?"":A)),onChange:Q,data:N},I=J,k={firstFilterProps:X,secondFilterProps:Y,logicData:S.data,logicValue:S.value,onLogicChange:S.onChange,hideSecondFilter:W},V=B().filters.length!==0||i.IsUnaryFilter(F[0].operator)||i.IsUnaryFilter(F[1].operator),_=O()?e.expanded:g,j=e.alwaysExpand&&!o.mobileMode,Z=()=>{b(!1)},ee=()=>{b(!1),e.onCloseMenu&&e.onCloseMenu()},te=`${m.toLanguageString(u.adaptiveColumnMenuFilterTitle,u.messages[u.adaptiveColumnMenuFilterTitle])} ${f.title||f.field}`;return l.createElement(ne.GridColumnMenuItemGroup,null,!j&&l.createElement("div",{className:"k-expander"},l.createElement(re.GridColumnMenuItem,{title:m.toLanguageString(u.filterTitle,u.messages[u.filterTitle]),iconClass:"k-i-filter",svgIcon:ue.filterIcon,expandable:!0,expanded:!!_,onClick:z})),o.mobileMode&&M?l.createElement(ce.GridAdaptiveFilterMenu,{FilterUI:I,filterUIProps:k,onBackView:Z,adaptiveTitle:te,handleClose:ee,submit:y,clear:D,isFilterValid:V}):l.createElement(ie.GridColumnMenuItemContent,{show:(j||!!_)&&!o.mobileMode},l.createElement("form",{className:"k-filter-menu",onSubmit:y,onReset:D},l.createElement("div",{className:"k-filter-menu-container"},I?l.createElement(I,{...k}):l.createElement(ae.GridColumnMenuFilterUI,{...k}),l.createElement("div",{className:"k-actions k-actions-stretched"},l.createElement(R.Button,{type:"button",themeColor:"primary",disabled:!V,onClick:y},m.toLanguageString(u.filterSubmitButton,u.messages[u.filterSubmitButton])),l.createElement(R.Button,{type:"reset"},m.toLanguageString(u.filterClearButton,u.messages[u.filterClearButton])))))))};exports.GridColumnMenuFilter=me;exports.filterGroupByField=h;exports.isColumnMenuFilterActive=fe;exports.rootFilterOrDefault=E;
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const le=require("react"),w=require("@progress/kendo-data-query"),re=require("./GridColumnMenuItem.js"),ne=require("./GridColumnMenuItemGroup.js"),ie=require("./GridColumnMenuItemContent.js"),oe=require("@progress/kendo-react-intl"),i=require("../filterCommon.js"),u=require("../messages/index.js"),ae=require("./GridColumnMenuFilterUI.js"),R=require("@progress/kendo-react-buttons"),ue=require("@progress/kendo-svg-icons"),se=require("../utils/GridContext.js"),ce=require("./adaptiveContent/GridAdaptiveFilterMenu.js");function de(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const c in e)if(c!=="default"){const g=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(a,c,g.get?g:{enumerable:!0,get:()=>e[c]})}}return a.default=e,Object.freeze(a)}const l=de(le),b=e=>e||{filters:[],logic:"and"},h=(e,a)=>b(a).filters.filter(C=>w.isCompositeFilterDescriptor(C)?C.filters&&C.filters.length&&!C.filters.find(M=>w.isCompositeFilterDescriptor(M)||M.field!==e):!1)[0]||null,fe=(e,a)=>!!h(e,a),me=e=>{const a=l.useContext(se.GridContext),c=l.useCallback(()=>{let t;if(e.column&&e.column.field){const n=i.getFilterType(e.column.filter),r=i.getDefaultOperator(e.filterOperators,n);t=h(e.column.field,e.filter),t=t?{...t,filters:t.filters.map(o=>({...o}))}:{logic:"and",filters:[{field:e.column.field,operator:r,value:i.IsUnaryFilter(r)?null:void 0},{field:e.column.field,operator:r,value:i.IsUnaryFilter(r)?null:void 0}]},t.filters.filter(o=>o.field===e.column.field).length===1&&t.filters.splice(1,0,{field:e.column.field,operator:r})}return t},[e.column]),[g,C]=l.useState(e.expanded||!1),[M,p]=l.useState(!1),[d,q]=l.useState(c()),O=()=>e.expanded!==void 0,z=()=>{const t=O(),n=!(t?e.expanded:g);e.onExpandChange&&e.onExpandChange(n),p(!M),!t&&!a.mobileMode&&C(n)},H=t=>{T(0,t)},$=t=>{T(1,t)},T=(t,n)=>{const r=d.filters.map((o,s)=>s===t?{...o,value:n.value,operator:n.operator}:o);q({...d,filters:r})},Q=t=>{let n=t.target.value;t.target.tagName==="SPAN"&&(n=t.target.parentElement.value),q({...d,logic:n})},D=t=>{if(t.preventDefault(),!e.onFilterChange)return;const n=e.column.field,r=b(e.filter),o=h(n,e.filter);if(!o){e.onCloseMenu&&e.onCloseMenu();return}const s=r.filters.filter(v=>v!==o);s.length?e.onFilterChange({...r,filters:s},t):e.onFilterChange(null,t),e.onCloseMenu&&e.onCloseMenu()},B=()=>({...d,filters:d.filters.filter(t=>t.value!==void 0&&t.value!==null&&t.value!==""||t.value===null&&i.IsUnaryFilter(t.operator))}),y=t=>{if(t.preventDefault(),!e.onFilterChange)return;const n=e.column.field,r=b(e.filter),o=h(n,e.filter),s=B();let v=null;if(o&&s.filters.length>0){const x=r.filters.map(E=>E===o?s:E);v={...r,filters:x}}else if(s.filters.length===0){const x=r.filters.filter(E=>E!==o);x.length&&(v={...r,filters:x})}else v={...r,filters:[...r.filters,s]};e.onFilterChange(v,t),e.onCloseMenu&&e.onCloseMenu()},{column:f,filterUI:J,hideSecondFilter:P,filterOperators:K}=e,m=oe.useLocalization();if(!f||!f.field)return l.createElement("div",null);const G=i.getFilterType(f.filter),W=P!==void 0?P:i.defaultHideSecondFilter[G],F=d.filters,U=i.operatorMap(K[G],m),L=i.operatorMap(i.booleanFilterValues,m),X={field:f.field,value:F[0].value,operator:F[0].operator,operators:U,booleanValues:L,onChange:H,filterType:G},Y={field:f.field,value:F[1].value,operator:F[1].operator,operators:U,booleanValues:L,onChange:$,filterType:G},A=d.logic,N=i.operatorMap(i.filterLogicList,m),S={value:N.find(t=>t.operator===(A===null?"":A)),onChange:Q,data:N},I=J,k={firstFilterProps:X,secondFilterProps:Y,logicData:S.data,logicValue:S.value,onLogicChange:S.onChange,hideSecondFilter:W},V=B().filters.length!==0||i.IsUnaryFilter(F[0].operator)||i.IsUnaryFilter(F[1].operator),_=O()?e.expanded:g,j=e.alwaysExpand&&!a.mobileMode,Z=()=>{p(!1)},ee=()=>{p(!1),e.onCloseMenu&&e.onCloseMenu()},te=`${m.toLanguageString(u.adaptiveColumnMenuFilterTitle,u.messages[u.adaptiveColumnMenuFilterTitle])} ${f.title||f.field}`;return l.createElement(ne.GridColumnMenuItemGroup,null,!j&&l.createElement("div",{className:"k-expander"},l.createElement(re.GridColumnMenuItem,{title:m.toLanguageString(u.filterTitle,u.messages[u.filterTitle]),iconClass:"k-i-filter",svgIcon:ue.filterIcon,expandable:!0,expanded:!!_,onClick:z})),a.mobileMode&&M?l.createElement(ce.GridAdaptiveFilterMenu,{FilterUI:I,filterUIProps:k,onBackView:Z,adaptiveTitle:te,handleClose:ee,submit:y,clear:D,isFilterValid:V}):l.createElement(ie.GridColumnMenuItemContent,{show:(j||!!_)&&!a.mobileMode},l.createElement("form",{className:"k-filter-menu",onSubmit:y,onReset:D},l.createElement("div",{className:"k-filter-menu-container"},I?l.createElement(I,{...k}):l.createElement(ae.GridColumnMenuFilterUI,{...k}),l.createElement("div",{className:"k-actions k-actions-stretched"},l.createElement(R.Button,{type:"button",themeColor:"primary",disabled:!V,onClick:y},m.toLanguageString(u.filterSubmitButton,u.messages[u.filterSubmitButton])),l.createElement(R.Button,{type:"reset"},m.toLanguageString(u.filterClearButton,u.messages[u.filterClearButton])))))))};exports.GridColumnMenuFilter=me;exports.filterGroupByField=h;exports.isColumnMenuFilterActive=fe;exports.rootFilterOrDefault=b;
@@ -12,82 +12,87 @@ import { GridColumnMenuItem as ce } from "./GridColumnMenuItem.mjs";
12
12
  import { GridColumnMenuItemGroup as se } from "./GridColumnMenuItemGroup.mjs";
13
13
  import { GridColumnMenuItemContent as ue } from "./GridColumnMenuItemContent.mjs";
14
14
  import { useLocalization as fe } from "@progress/kendo-react-intl";
15
- import { getFilterType as $, getDefaultOperator as de, IsUnaryFilter as v, operatorMap as y, defaultHideSecondFilter as me, filterLogicList as ge, booleanFilterValues as Ce } from "../filterCommon.mjs";
15
+ import { getFilterType as $, getDefaultOperator as de, IsUnaryFilter as C, operatorMap as y, defaultHideSecondFilter as me, filterLogicList as ge, booleanFilterValues as Ce } from "../filterCommon.mjs";
16
16
  import { adaptiveColumnMenuFilterTitle as j, messages as E, filterTitle as q, filterSubmitButton as J, filterClearButton as K } from "../messages/index.mjs";
17
17
  import { GridColumnMenuFilterUI as Fe } from "./GridColumnMenuFilterUI.mjs";
18
18
  import { Button as Q } from "@progress/kendo-react-buttons";
19
19
  import { filterIcon as he } from "@progress/kendo-svg-icons";
20
20
  import { GridContext as ve } from "../utils/GridContext.mjs";
21
21
  import { GridAdaptiveFilterMenu as Ee } from "./adaptiveContent/GridAdaptiveFilterMenu.mjs";
22
- const I = (e) => e || { filters: [], logic: "and" }, p = (e, a) => I(a).filters.filter((f) => R(f) ? f.filters && f.filters.length && !f.filters.find((g) => R(g) || g.field !== e) : !1)[0] || null, Ne = (e, a) => !!p(e, a), Oe = (e) => {
22
+ const I = (e) => e || { filters: [], logic: "and" }, x = (e, a) => I(a).filters.filter((f) => R(f) ? f.filters && f.filters.length && !f.filters.find((g) => R(g) || g.field !== e) : !1)[0] || null, Ne = (e, a) => !!x(e, a), Oe = (e) => {
23
23
  const a = l.useContext(ve), L = l.useCallback(() => {
24
24
  let t;
25
25
  if (e.column && e.column.field) {
26
- const i = $(e.column.filter), r = de(e.filterOperators, i);
27
- t = p(e.column.field, e.filter), t = t ? {
26
+ const n = $(e.column.filter), r = de(e.filterOperators, n);
27
+ t = x(e.column.field, e.filter), t = t ? {
28
28
  ...t,
29
- filters: t.filters.map((n) => ({ ...n }))
29
+ filters: t.filters.map((i) => ({ ...i }))
30
30
  } : {
31
31
  logic: "and",
32
32
  filters: [
33
33
  {
34
34
  field: e.column.field,
35
35
  operator: r,
36
- value: v(r) ? null : void 0
36
+ value: C(r) ? null : void 0
37
37
  },
38
38
  {
39
39
  field: e.column.field,
40
40
  operator: r,
41
- value: v(r) ? null : void 0
41
+ value: C(r) ? null : void 0
42
42
  }
43
43
  ]
44
- }, t.filters.filter((n) => n.field === e.column.field).length === 1 && t.filters.splice(1, 0, { field: e.column.field, operator: r });
44
+ }, t.filters.filter((i) => i.field === e.column.field).length === 1 && t.filters.splice(1, 0, { field: e.column.field, operator: r });
45
45
  }
46
46
  return t;
47
- }, [e.column]), [x, f] = l.useState(e.expanded || !1), [g, M] = l.useState(!1), [c, T] = l.useState(L()), D = () => e.expanded !== void 0, W = () => {
48
- const t = D(), i = !(t ? e.expanded : x);
49
- e.onExpandChange && e.onExpandChange(i), M(!g), !t && !a.mobileMode && f(i);
47
+ }, [e.column]), [M, f] = l.useState(e.expanded || !1), [g, p] = l.useState(!1), [c, T] = l.useState(L()), D = () => e.expanded !== void 0, W = () => {
48
+ const t = D(), n = !(t ? e.expanded : M);
49
+ e.onExpandChange && e.onExpandChange(n), p(!g), !t && !a.mobileMode && f(n);
50
50
  }, X = (t) => {
51
51
  P(0, t);
52
52
  }, Y = (t) => {
53
53
  P(1, t);
54
- }, P = (t, i) => {
55
- const r = c.filters.map((n, o) => o === t ? {
56
- ...n,
57
- value: i.value,
58
- operator: i.operator
59
- } : n);
54
+ }, P = (t, n) => {
55
+ const r = c.filters.map((i, o) => o === t ? {
56
+ ...i,
57
+ value: n.value,
58
+ operator: n.operator
59
+ } : i);
60
60
  T({
61
61
  ...c,
62
62
  filters: r
63
63
  });
64
64
  }, Z = (t) => {
65
- let i = t.target.value;
66
- t.target.tagName === "SPAN" && (i = t.target.parentElement.value), T({ ...c, logic: i });
65
+ let n = t.target.value;
66
+ t.target.tagName === "SPAN" && (n = t.target.parentElement.value), T({ ...c, logic: n });
67
67
  }, N = (t) => {
68
68
  if (t.preventDefault(), !e.onFilterChange)
69
69
  return;
70
- const i = e.column.field, r = I(e.filter), n = p(i, e.filter), o = r.filters.filter((m) => m !== n);
70
+ const n = e.column.field, r = I(e.filter), i = x(n, e.filter);
71
+ if (!i) {
72
+ e.onCloseMenu && e.onCloseMenu();
73
+ return;
74
+ }
75
+ const o = r.filters.filter((m) => m !== i);
71
76
  o.length ? e.onFilterChange({ ...r, filters: o }, t) : e.onFilterChange(null, t), e.onCloseMenu && e.onCloseMenu();
72
77
  }, O = () => ({
73
78
  ...c,
74
- filters: c.filters.filter((t) => t.value !== void 0 && t.value !== null && t.value !== "" || t.value === null && t.operator)
79
+ filters: c.filters.filter((t) => t.value !== void 0 && t.value !== null && t.value !== "" || t.value === null && C(t.operator))
75
80
  }), G = (t) => {
76
81
  if (t.preventDefault(), !e.onFilterChange)
77
82
  return;
78
- const i = e.column.field, r = I(e.filter), n = p(i, e.filter), o = O();
83
+ const n = e.column.field, r = I(e.filter), i = x(n, e.filter), o = O();
79
84
  let m = null;
80
- if (n && o.filters.length > 0) {
81
- const F = r.filters.map((h) => h === n ? o : h);
85
+ if (i && o.filters.length > 0) {
86
+ const h = r.filters.map((v) => v === i ? o : v);
82
87
  m = {
83
88
  ...r,
84
- filters: F
89
+ filters: h
85
90
  };
86
91
  } else if (o.filters.length === 0) {
87
- const F = r.filters.filter((h) => h !== n);
88
- F.length && (m = {
92
+ const h = r.filters.filter((v) => v !== i);
93
+ h.length && (m = {
89
94
  ...r,
90
- filters: F
95
+ filters: h
91
96
  });
92
97
  } else
93
98
  m = {
@@ -98,37 +103,37 @@ const I = (e) => e || { filters: [], logic: "and" }, p = (e, a) => I(a).filters.
98
103
  }, { column: s, filterUI: ee, hideSecondFilter: V, filterOperators: te } = e, u = fe();
99
104
  if (!s || !s.field)
100
105
  return /* @__PURE__ */ l.createElement("div", null);
101
- const C = $(s.filter), le = V !== void 0 ? V : me[C], d = c.filters, A = y(te[C], u), B = y(Ce, u), re = {
106
+ const F = $(s.filter), le = V !== void 0 ? V : me[F], d = c.filters, A = y(te[F], u), B = y(Ce, u), re = {
102
107
  field: s.field,
103
108
  value: d[0].value,
104
109
  operator: d[0].operator,
105
110
  operators: A,
106
111
  booleanValues: B,
107
112
  onChange: X,
108
- filterType: C
109
- }, ie = {
113
+ filterType: F
114
+ }, ne = {
110
115
  field: s.field,
111
116
  value: d[1].value,
112
117
  operator: d[1].operator,
113
118
  operators: A,
114
119
  booleanValues: B,
115
120
  onChange: Y,
116
- filterType: C
121
+ filterType: F
117
122
  }, U = c.logic, w = y(ge, u), S = {
118
123
  value: w.find((t) => t.operator === (U === null ? "" : U)),
119
124
  onChange: Z,
120
125
  data: w
121
126
  }, b = ee, k = {
122
127
  firstFilterProps: re,
123
- secondFilterProps: ie,
128
+ secondFilterProps: ne,
124
129
  logicData: S.data,
125
130
  logicValue: S.value,
126
131
  onLogicChange: S.onChange,
127
132
  hideSecondFilter: le
128
- }, _ = O().filters.length !== 0 || v(d[0].operator) || v(d[1].operator), z = D() ? e.expanded : x, H = e.alwaysExpand && !a.mobileMode, ne = () => {
129
- M(!1);
133
+ }, _ = O().filters.length !== 0 || C(d[0].operator) || C(d[1].operator), z = D() ? e.expanded : M, H = e.alwaysExpand && !a.mobileMode, ie = () => {
134
+ p(!1);
130
135
  }, oe = () => {
131
- M(!1), e.onCloseMenu && e.onCloseMenu();
136
+ p(!1), e.onCloseMenu && e.onCloseMenu();
132
137
  }, ae = `${u.toLanguageString(
133
138
  j,
134
139
  E[j]
@@ -148,7 +153,7 @@ const I = (e) => e || { filters: [], logic: "and" }, p = (e, a) => I(a).filters.
148
153
  {
149
154
  FilterUI: b,
150
155
  filterUIProps: k,
151
- onBackView: ne,
156
+ onBackView: ie,
152
157
  adaptiveTitle: ae,
153
158
  handleClose: oe,
154
159
  submit: G,
@@ -159,7 +164,7 @@ const I = (e) => e || { filters: [], logic: "and" }, p = (e, a) => I(a).filters.
159
164
  };
160
165
  export {
161
166
  Oe as GridColumnMenuFilter,
162
- p as filterGroupByField,
167
+ x as filterGroupByField,
163
168
  Ne as isColumnMenuFilterActive,
164
169
  I as rootFilterOrDefault
165
170
  };
@@ -6,4 +6,4 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react"),e=require("@progress/kendo-svg-icons"),v=require("@progress/kendo-react-intl"),M=require("@progress/kendo-react-layout"),t=require("./enums.js");function R(n){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const c in n)if(c!=="default"){const r=Object.getOwnPropertyDescriptor(n,c);Object.defineProperty(i,c,r.get?r:{enumerable:!0,get:()=>n[c]})}}return i.default=n,Object.freeze(i)}const s=R(S),x={[t.GridContextMenuItemNames.create]:{name:"create",text:"Add",icon:"plus",svgIcon:e.plusIcon,data:{action:"AddCommand"}},[t.GridContextMenuItemNames.edit]:{name:"edit",text:"Edit",icon:"pencil",svgIcon:e.pencilIcon,data:{action:"EditCommand"}},[t.GridContextMenuItemNames.delete]:{name:"delete",text:"Delete",icon:"trash",svgIcon:e.trashIcon,data:{action:"DeleteCommand"}},[t.GridContextMenuItemNames.select]:{name:"select",text:"Select",icon:"table-body",svgIcon:e.tableBodyIcon,items:[{name:"selectRow",text:"Row",icon:"table-row-groups",svgIcon:e.tableRowGroupsIcon,data:{action:"SelectRowCommand"}},{name:"selectAllRows",text:"All rows",icon:"grid",svgIcon:e.gridIcon,data:{action:"SelectAllRowsCommand"}},{name:"clearSelection",text:"Clear selection",icon:"table-unmerge",svgIcon:e.tableUnmergeIcon,data:{action:"ClearSelectionCommand"}}]},[t.GridContextMenuItemNames.pinRow]:{name:"pinRow",text:"Pin row",icon:"pin-outline",svgIcon:e.pinOutlineIcon,items:[{name:"pinTop",text:"Pin to Top",icon:"pin-outline-top",svgIcon:e.pinOutlineTopIcon,data:{action:"PinTopCommand"}},{name:"pinBottom",text:"Pin to Bottom",icon:"pin-outline-bottom",svgIcon:e.pinOutlineBottomIcon,data:{action:"PinBottomCommand"}},{name:"unpin",text:"Unpin",icon:"unpin-outline",svgIcon:e.unpinOutlineIcon,data:{action:"UnpinCommand"}}]},[t.GridContextMenuItemNames.pinTop]:{name:"pinTop",text:"Pin to Top",icon:"pin-outline-top",svgIcon:e.pinOutlineTopIcon,data:{action:"PinTopCommand"}},[t.GridContextMenuItemNames.pinBottom]:{name:"pinBottom",text:"Pin to Bottom",icon:"pin-outline-bottom",svgIcon:e.pinOutlineBottomIcon,data:{action:"PinBottomCommand"}},[t.GridContextMenuItemNames.unpin]:{name:"unpin",text:"Unpin",icon:"unpin-outline",svgIcon:e.unpinOutlineIcon,data:{action:"UnpinCommand"}},[t.GridContextMenuItemNames.copySelection]:{name:"copySelection",text:"Copy selection",icon:"page-header-section",svgIcon:e.pageHeaderSectionIcon,data:{action:"CopySelectionCommand"},options:"withHeaders"},[t.GridContextMenuItemNames.copySelectionNoHeaders]:{name:"copySelectionNoHeaders",text:"Copy selection (No Headers)",icon:"file-txt",svgIcon:e.fileTxtIcon,data:{action:"CopySelectionCommand"}},[t.GridContextMenuItemNames.paste]:{name:"paste",text:"Paste (use CTRL/⌘ + V)",icon:"clipboard",svgIcon:e.clipboardIcon,data:{action:"PasteCommand"}},[t.GridContextMenuItemNames.reorderRow]:{name:"reorderRow",text:"Reorder row",icon:"caret-alt-expand",svgIcon:e.caretAltExpandIcon,items:[{name:"reorderRowUp",text:"Up",icon:"caret-alt-up",svgIcon:e.caretAltUpIcon,data:{action:"ReorderRowCommand"}},{name:"reorderRowDown",text:"Down",icon:"caret-alt-down",svgIcon:e.caretAltDownIcon,data:{action:"ReorderRowCommand"}},{name:"reorderRowTop",text:"Top",icon:"caret-alt-to-top",svgIcon:e.caretAltToTopIcon,data:{action:"ReorderRowCommand"}},{name:"reorderRowBottom",text:"Bottom",icon:"caret-alt-to-bottom",svgIcon:e.caretAltToBottomIcon,data:{action:"ReorderRowCommand"}}]},[t.GridContextMenuItemNames.exportPDF]:{name:"exportPDF",text:"Export to PDF",icon:"file-pdf",svgIcon:e.filePdfIcon,data:{action:"ExportPDFCommand"}},[t.GridContextMenuItemNames.exportExcel]:{name:"exportExcel",text:"Export to Excel",icon:"file-excel",svgIcon:e.fileExcelIcon,items:[{name:"exportToExcelAll",text:"All",data:{action:"ExportExcelCommand"}},{name:"exportToExcelSelection",text:"Selection",data:{action:"ExportExcelCommand"},options:"selection,withHeaders"},{name:"exportToExcelSelectionNoHeaders",text:"Selection (No Headers)",data:{action:"ExportExcelCommand"},options:"selection"}]},[t.GridContextMenuItemNames.separator]:{name:"separator",separator:!0},[t.GridContextMenuItemNames.sortAsc]:{name:"sortAsc",text:"Sort Ascending",icon:"sort-asc-small",svgIcon:e.sortAscSmallIcon,data:{action:"SortCommand"}},[t.GridContextMenuItemNames.sortDesc]:{name:"sortDesc",text:"Sort Descending",icon:"sort-desc-small",svgIcon:e.sortDescSmallIcon,data:{action:"SortCommand"}}},f=n=>{const{show:i,offset:c,dataItem:r,field:d,items:m,onClose:I,onSelect:p}=n,u=v.useLocalization(),C=s.useCallback(a=>{p.call(void 0,{event:a,dataItem:r,field:d})},[p,r,d]),l=s.useCallback(a=>{const o=a;return o.text&&o.name&&(o.text=u.toLanguageString(`contextMenu.${o.name}`,o.text||"")),o.items&&Array.isArray(o.items)&&(o.items=o.items.map(w=>l(w))),o},[u]),g=s.useMemo(()=>m&&m.map(a=>{const o=typeof a=="string"?x[a]:a;return l(o)}),[m,l]);return s.createElement(M.ContextMenu,{show:i,offset:c,items:g,onClose:I,onSelect:C})};exports.GridContextMenu=f;exports.contextMenuItemsMap=x;
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),e=require("@progress/kendo-svg-icons"),S=require("@progress/kendo-react-intl"),M=require("@progress/kendo-react-layout"),t=require("./enums.js");function R(n){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const c in n)if(c!=="default"){const r=Object.getOwnPropertyDescriptor(n,c);Object.defineProperty(i,c,r.get?r:{enumerable:!0,get:()=>n[c]})}}return i.default=n,Object.freeze(i)}const s=R(w),I={[t.GridContextMenuItemNames.create]:{name:"create",text:"Add",icon:"plus",svgIcon:e.plusIcon,data:{action:"AddCommand"}},[t.GridContextMenuItemNames.edit]:{name:"edit",text:"Edit",icon:"pencil",svgIcon:e.pencilIcon,data:{action:"EditCommand"}},[t.GridContextMenuItemNames.delete]:{name:"delete",text:"Delete",icon:"trash",svgIcon:e.trashIcon,data:{action:"DeleteCommand"}},[t.GridContextMenuItemNames.select]:{name:"select",text:"Select",icon:"table-body",svgIcon:e.tableBodyIcon,items:[{name:"selectRow",text:"Row",icon:"table-row-groups",svgIcon:e.tableRowGroupsIcon,data:{action:"SelectRowCommand"}},{name:"selectAllRows",text:"All rows",icon:"grid",svgIcon:e.gridIcon,data:{action:"SelectAllRowsCommand"}},{name:"clearSelection",text:"Clear selection",icon:"table-unmerge",svgIcon:e.tableUnmergeIcon,data:{action:"ClearSelectionCommand"}}]},[t.GridContextMenuItemNames.pinRow]:{name:"pinRow",text:"Pin row",icon:"pin",svgIcon:e.pinIcon,items:[{name:"pinTop",text:"Pin to Top",icon:"pin-top",svgIcon:e.pinTopIcon,data:{action:"PinTopCommand"}},{name:"pinBottom",text:"Pin to Bottom",icon:"pin-bottom",svgIcon:e.pinBottomIcon,data:{action:"PinBottomCommand"}},{name:"unpin",text:"Unpin",icon:"unpin",svgIcon:e.unpinIcon,data:{action:"UnpinCommand"}}]},[t.GridContextMenuItemNames.pinTop]:{name:"pinTop",text:"Pin to Top",icon:"pin-top",svgIcon:e.pinTopIcon,data:{action:"PinTopCommand"}},[t.GridContextMenuItemNames.pinBottom]:{name:"pinBottom",text:"Pin to Bottom",icon:"pin-bottom",svgIcon:e.pinBottomIcon,data:{action:"PinBottomCommand"}},[t.GridContextMenuItemNames.unpin]:{name:"unpin",text:"Unpin",icon:"unpin",svgIcon:e.unpinIcon,data:{action:"UnpinCommand"}},[t.GridContextMenuItemNames.copySelection]:{name:"copySelection",text:"Copy selection",icon:"page-header-section",svgIcon:e.pageHeaderSectionIcon,data:{action:"CopySelectionCommand"},options:"withHeaders"},[t.GridContextMenuItemNames.copySelectionNoHeaders]:{name:"copySelectionNoHeaders",text:"Copy selection (No Headers)",icon:"file-txt",svgIcon:e.fileTxtIcon,data:{action:"CopySelectionCommand"}},[t.GridContextMenuItemNames.paste]:{name:"paste",text:"Paste (use CTRL/⌘ + V)",icon:"clipboard",svgIcon:e.clipboardIcon,data:{action:"PasteCommand"}},[t.GridContextMenuItemNames.reorderRow]:{name:"reorderRow",text:"Reorder row",icon:"caret-alt-expand",svgIcon:e.caretAltExpandIcon,items:[{name:"reorderRowUp",text:"Up",icon:"chevron-up",svgIcon:e.chevronUpIcon,data:{action:"ReorderRowCommand"}},{name:"reorderRowDown",text:"Down",icon:"chevron-down",svgIcon:e.chevronDownIcon,data:{action:"ReorderRowCommand"}},{name:"reorderRowTop",text:"Top",icon:"chevron-double-up",svgIcon:e.chevronDoubleUpIcon,data:{action:"ReorderRowCommand"}},{name:"reorderRowBottom",text:"Bottom",icon:"chevron-double-down",svgIcon:e.chevronDoubleDownIcon,data:{action:"ReorderRowCommand"}}]},[t.GridContextMenuItemNames.exportPDF]:{name:"exportPDF",text:"Export to PDF",icon:"file-pdf",svgIcon:e.filePdfIcon,data:{action:"ExportPDFCommand"}},[t.GridContextMenuItemNames.exportExcel]:{name:"exportExcel",text:"Export to Excel",icon:"file-excel",svgIcon:e.fileExcelIcon,items:[{name:"exportToExcelAll",text:"All",data:{action:"ExportExcelCommand"}},{name:"exportToExcelSelection",text:"Selection",data:{action:"ExportExcelCommand"},options:"selection,withHeaders"},{name:"exportToExcelSelectionNoHeaders",text:"Selection (No Headers)",data:{action:"ExportExcelCommand"},options:"selection"}]},[t.GridContextMenuItemNames.separator]:{name:"separator",separator:!0},[t.GridContextMenuItemNames.sortAsc]:{name:"sortAsc",text:"Sort Ascending",icon:"sort-asc-small",svgIcon:e.sortAscSmallIcon,data:{action:"SortCommand"}},[t.GridContextMenuItemNames.sortDesc]:{name:"sortDesc",text:"Sort Descending",icon:"sort-desc-small",svgIcon:e.sortDescSmallIcon,data:{action:"SortCommand"}}},b=n=>{const{show:i,offset:c,dataItem:r,field:l,items:m,onClose:u,onSelect:p}=n,x=S.useLocalization(),C=s.useCallback(a=>{p.call(void 0,{event:a,dataItem:r,field:l})},[p,r,l]),d=s.useCallback(a=>{const o=a;return o.text&&o.name&&(o.text=x.toLanguageString(`contextMenu.${o.name}`,o.text||"")),o.items&&Array.isArray(o.items)&&(o.items=o.items.map(v=>d(v))),o},[x]),g=s.useMemo(()=>m&&m.map(a=>{const o=typeof a=="string"?I[a]:a;return d(o)}),[m,d]);return s.createElement(M.ContextMenu,{show:i,offset:c,items:g,onClose:u,onSelect:C})};exports.GridContextMenu=b;exports.contextMenuItemsMap=I;
@@ -7,30 +7,30 @@
7
7
  */
8
8
  "use client";
9
9
  import * as a from "react";
10
- import { sortDescSmallIcon as S, sortAscSmallIcon as R, fileExcelIcon as f, filePdfIcon as E, caretAltUpIcon as A, caretAltDownIcon as T, caretAltToTopIcon as P, caretAltToBottomIcon as b, caretAltExpandIcon as y, clipboardIcon as D, fileTxtIcon as B, pageHeaderSectionIcon as H, unpinOutlineIcon as s, pinOutlineBottomIcon as d, pinOutlineTopIcon as p, pinOutlineIcon as U, tableRowGroupsIcon as h, gridIcon as M, tableUnmergeIcon as N, tableBodyIcon as F, trashIcon as O, pencilIcon as z, plusIcon as G } from "@progress/kendo-svg-icons";
11
- import { useLocalization as L } from "@progress/kendo-react-intl";
12
- import { ContextMenu as k } from "@progress/kendo-react-layout";
10
+ import { sortDescSmallIcon as S, sortAscSmallIcon as R, fileExcelIcon as f, filePdfIcon as E, chevronUpIcon as b, chevronDownIcon as D, chevronDoubleUpIcon as P, chevronDoubleDownIcon as h, caretAltExpandIcon as T, clipboardIcon as A, fileTxtIcon as y, pageHeaderSectionIcon as B, unpinIcon as d, pinBottomIcon as l, pinTopIcon as p, pinIcon as U, tableRowGroupsIcon as H, gridIcon as M, tableUnmergeIcon as N, tableBodyIcon as F, trashIcon as z, pencilIcon as G, plusIcon as L } from "@progress/kendo-svg-icons";
11
+ import { useLocalization as k } from "@progress/kendo-react-intl";
12
+ import { ContextMenu as V } from "@progress/kendo-react-layout";
13
13
  import { GridContextMenuItemNames as o } from "./enums.mjs";
14
- const V = {
14
+ const $ = {
15
15
  [o.create]: {
16
16
  name: "create",
17
17
  text: "Add",
18
18
  icon: "plus",
19
- svgIcon: G,
19
+ svgIcon: L,
20
20
  data: { action: "AddCommand" }
21
21
  },
22
22
  [o.edit]: {
23
23
  name: "edit",
24
24
  text: "Edit",
25
25
  icon: "pencil",
26
- svgIcon: z,
26
+ svgIcon: G,
27
27
  data: { action: "EditCommand" }
28
28
  },
29
29
  [o.delete]: {
30
30
  name: "delete",
31
31
  text: "Delete",
32
32
  icon: "trash",
33
- svgIcon: O,
33
+ svgIcon: z,
34
34
  data: { action: "DeleteCommand" }
35
35
  },
36
36
  [o.select]: {
@@ -43,7 +43,7 @@ const V = {
43
43
  name: "selectRow",
44
44
  text: "Row",
45
45
  icon: "table-row-groups",
46
- svgIcon: h,
46
+ svgIcon: H,
47
47
  data: { action: "SelectRowCommand" }
48
48
  },
49
49
  {
@@ -65,28 +65,28 @@ const V = {
65
65
  [o.pinRow]: {
66
66
  name: "pinRow",
67
67
  text: "Pin row",
68
- icon: "pin-outline",
68
+ icon: "pin",
69
69
  svgIcon: U,
70
70
  items: [
71
71
  {
72
72
  name: "pinTop",
73
73
  text: "Pin to Top",
74
- icon: "pin-outline-top",
74
+ icon: "pin-top",
75
75
  svgIcon: p,
76
76
  data: { action: "PinTopCommand" }
77
77
  },
78
78
  {
79
79
  name: "pinBottom",
80
80
  text: "Pin to Bottom",
81
- icon: "pin-outline-bottom",
82
- svgIcon: d,
81
+ icon: "pin-bottom",
82
+ svgIcon: l,
83
83
  data: { action: "PinBottomCommand" }
84
84
  },
85
85
  {
86
86
  name: "unpin",
87
87
  text: "Unpin",
88
- icon: "unpin-outline",
89
- svgIcon: s,
88
+ icon: "unpin",
89
+ svgIcon: d,
90
90
  data: { action: "UnpinCommand" }
91
91
  }
92
92
  ]
@@ -94,29 +94,29 @@ const V = {
94
94
  [o.pinTop]: {
95
95
  name: "pinTop",
96
96
  text: "Pin to Top",
97
- icon: "pin-outline-top",
97
+ icon: "pin-top",
98
98
  svgIcon: p,
99
99
  data: { action: "PinTopCommand" }
100
100
  },
101
101
  [o.pinBottom]: {
102
102
  name: "pinBottom",
103
103
  text: "Pin to Bottom",
104
- icon: "pin-outline-bottom",
105
- svgIcon: d,
104
+ icon: "pin-bottom",
105
+ svgIcon: l,
106
106
  data: { action: "PinBottomCommand" }
107
107
  },
108
108
  [o.unpin]: {
109
109
  name: "unpin",
110
110
  text: "Unpin",
111
- icon: "unpin-outline",
112
- svgIcon: s,
111
+ icon: "unpin",
112
+ svgIcon: d,
113
113
  data: { action: "UnpinCommand" }
114
114
  },
115
115
  [o.copySelection]: {
116
116
  name: "copySelection",
117
117
  text: "Copy selection",
118
118
  icon: "page-header-section",
119
- svgIcon: H,
119
+ svgIcon: B,
120
120
  data: { action: "CopySelectionCommand" },
121
121
  options: "withHeaders"
122
122
  },
@@ -124,48 +124,48 @@ const V = {
124
124
  name: "copySelectionNoHeaders",
125
125
  text: "Copy selection (No Headers)",
126
126
  icon: "file-txt",
127
- svgIcon: B,
127
+ svgIcon: y,
128
128
  data: { action: "CopySelectionCommand" }
129
129
  },
130
130
  [o.paste]: {
131
131
  name: "paste",
132
132
  text: "Paste (use CTRL/⌘ + V)",
133
133
  icon: "clipboard",
134
- svgIcon: D,
134
+ svgIcon: A,
135
135
  data: { action: "PasteCommand" }
136
136
  },
137
137
  [o.reorderRow]: {
138
138
  name: "reorderRow",
139
139
  text: "Reorder row",
140
140
  icon: "caret-alt-expand",
141
- svgIcon: y,
141
+ svgIcon: T,
142
142
  items: [
143
143
  {
144
144
  name: "reorderRowUp",
145
145
  text: "Up",
146
- icon: "caret-alt-up",
147
- svgIcon: A,
146
+ icon: "chevron-up",
147
+ svgIcon: b,
148
148
  data: { action: "ReorderRowCommand" }
149
149
  },
150
150
  {
151
151
  name: "reorderRowDown",
152
152
  text: "Down",
153
- icon: "caret-alt-down",
154
- svgIcon: T,
153
+ icon: "chevron-down",
154
+ svgIcon: D,
155
155
  data: { action: "ReorderRowCommand" }
156
156
  },
157
157
  {
158
158
  name: "reorderRowTop",
159
159
  text: "Top",
160
- icon: "caret-alt-to-top",
160
+ icon: "chevron-double-up",
161
161
  svgIcon: P,
162
162
  data: { action: "ReorderRowCommand" }
163
163
  },
164
164
  {
165
165
  name: "reorderRowBottom",
166
166
  text: "Bottom",
167
- icon: "caret-alt-to-bottom",
168
- svgIcon: b,
167
+ icon: "chevron-double-down",
168
+ svgIcon: h,
169
169
  data: { action: "ReorderRowCommand" }
170
170
  }
171
171
  ]
@@ -213,29 +213,29 @@ const V = {
213
213
  svgIcon: S,
214
214
  data: { action: "SortCommand" }
215
215
  }
216
- }, K = (x) => {
217
- const { show: I, offset: u, dataItem: i, field: m, items: n, onClose: g, onSelect: r } = x, l = L(), C = a.useCallback(
218
- (e) => {
216
+ }, O = (x) => {
217
+ const { show: I, offset: g, dataItem: i, field: m, items: n, onClose: C, onSelect: r } = x, s = k(), u = a.useCallback(
218
+ (t) => {
219
219
  r.call(void 0, {
220
- event: e,
220
+ event: t,
221
221
  dataItem: i,
222
222
  field: m
223
223
  });
224
224
  },
225
225
  [r, i, m]
226
226
  ), c = a.useCallback(
227
- (e) => {
228
- const t = e;
229
- return t.text && t.name && (t.text = l.toLanguageString(`contextMenu.${t.name}`, t.text || "")), t.items && Array.isArray(t.items) && (t.items = t.items.map((v) => c(v))), t;
227
+ (t) => {
228
+ const e = t;
229
+ return e.text && e.name && (e.text = s.toLanguageString(`contextMenu.${e.name}`, e.text || "")), e.items && Array.isArray(e.items) && (e.items = e.items.map((w) => c(w))), e;
230
230
  },
231
- [l]
232
- ), w = a.useMemo(() => n && n.map((e) => {
233
- const t = typeof e == "string" ? V[e] : e;
234
- return c(t);
231
+ [s]
232
+ ), v = a.useMemo(() => n && n.map((t) => {
233
+ const e = typeof t == "string" ? $[t] : t;
234
+ return c(e);
235
235
  }), [n, c]);
236
- return /* @__PURE__ */ a.createElement(k, { show: I, offset: u, items: w, onClose: g, onSelect: C });
236
+ return /* @__PURE__ */ a.createElement(V, { show: I, offset: g, items: v, onClose: C, onSelect: u });
237
237
  };
238
238
  export {
239
- K as GridContextMenu,
240
- V as contextMenuItemsMap
239
+ O as GridContextMenu,
240
+ $ as contextMenuItemsMap
241
241
  };