@veeqo/transfigure 1.2.1 → 1.2.2

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.
Files changed (80) hide show
  1. package/dist/BusinessLogic/types.d.ts +1 -0
  2. package/dist/components/Views/ViewList/ViewsList.d.ts +5 -1
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +14 -13
  5. package/dist/index100.cjs +1 -1
  6. package/dist/index100.js +19 -31
  7. package/dist/index101.cjs +1 -1
  8. package/dist/index101.js +12 -26
  9. package/dist/index103.cjs +1 -1
  10. package/dist/index103.js +32 -14
  11. package/dist/index104.cjs +1 -1
  12. package/dist/index104.js +28 -23
  13. package/dist/index105.cjs +1 -1
  14. package/dist/index105.js +23 -6
  15. package/dist/index106.cjs +1 -1
  16. package/dist/index106.js +1 -1
  17. package/dist/index107.cjs +1 -1
  18. package/dist/index107.js +19 -2
  19. package/dist/index108.cjs +1 -1
  20. package/dist/index108.js +7 -18
  21. package/dist/index109.cjs +1 -1
  22. package/dist/index109.js +63 -7
  23. package/dist/index11.cjs +1 -1
  24. package/dist/index11.js +1 -1
  25. package/dist/index110.cjs +1 -1
  26. package/dist/index110.js +26 -60
  27. package/dist/index111.cjs +1 -1
  28. package/dist/index111.js +2 -30
  29. package/dist/index113.cjs +1 -1
  30. package/dist/index113.js +32 -22
  31. package/dist/index114.cjs +1 -1
  32. package/dist/index114.js +22 -32
  33. package/dist/index115.cjs +1 -7
  34. package/dist/index115.js +63 -10
  35. package/dist/index116.cjs +1 -1
  36. package/dist/index116.js +42 -58
  37. package/dist/index117.cjs +7 -1
  38. package/dist/index117.js +10 -47
  39. package/dist/index17.cjs +1 -1
  40. package/dist/index17.js +1 -1
  41. package/dist/index22.cjs +1 -1
  42. package/dist/index22.js +1 -1
  43. package/dist/index31.cjs +1 -1
  44. package/dist/index31.js +1 -1
  45. package/dist/index34.cjs +1 -1
  46. package/dist/index34.js +1 -1
  47. package/dist/index36.cjs +1 -1
  48. package/dist/index36.js +62 -60
  49. package/dist/index39.cjs +1 -1
  50. package/dist/index39.js +1 -1
  51. package/dist/index40.cjs +1 -1
  52. package/dist/index40.js +1 -1
  53. package/dist/index41.cjs +1 -1
  54. package/dist/index41.js +1 -1
  55. package/dist/index44.cjs +1 -1
  56. package/dist/index44.js +36 -34
  57. package/dist/index46.cjs +1 -1
  58. package/dist/index46.js +2 -2
  59. package/dist/index80.cjs +1 -1
  60. package/dist/index80.js +1 -1
  61. package/dist/index84.cjs +1 -1
  62. package/dist/index84.js +1 -1
  63. package/dist/index85.cjs +1 -1
  64. package/dist/index85.js +1 -1
  65. package/dist/index88.cjs +1 -1
  66. package/dist/index88.js +4 -117
  67. package/dist/index89.cjs +1 -1
  68. package/dist/index89.js +117 -18
  69. package/dist/index90.cjs +1 -1
  70. package/dist/index90.js +19 -5
  71. package/dist/index91.cjs +1 -1
  72. package/dist/index91.js +2 -2
  73. package/dist/index93.cjs +1 -1
  74. package/dist/index93.js +2 -2
  75. package/dist/index98.cjs +1 -19
  76. package/dist/index98.js +7 -24
  77. package/dist/index99.cjs +19 -1
  78. package/dist/index99.js +24 -21
  79. package/dist/storybookHelpers/Code.d.ts +3 -0
  80. package/package.json +1 -1
package/dist/index36.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),a=require("react"),c=require("@veeqo/ui"),W=require("mobx-react"),Y=require("./index65.cjs"),z=require("./index62.cjs"),G=require("./index40.cjs"),J=require("./index43.cjs"),K=require("./index56.cjs"),Q=require("./index100.cjs"),X=require("./index8.cjs"),Z=require("./index61.cjs"),$=require("./index101.cjs"),b=W.observer(({view:e})=>{const{VIEW_TYPE:S,SEARCH_FILTER_ID:l}=X.useBusinessLogic(),{Filters:{activeViewId:d,initFiltersFromView:w,discardChanges:f,initFromUrl:m,filters:x,setFilter:L},Views:{draftViewsMap:y},Notifications:{notify:T}}=Z.useStores(),{viewsMap:V,defaultCustomViewId:F,isLoading:j}=z.useViews(),{isLoading:N}=Y.useCustomViews({type:S}),{viewCounts:E,isLoadingViewCounts:M}=Q.useViewCounts(),[s,R]=a.useState(null),k=o=>{const q=x.get(l);if(V.has(o)){const n=V.get(o);n&&(w(n),f(!0),m())}else{const n=y.get(o);n?(w(n),f(!0),m()):T({type:"error",text:"Failed to load view"})}q&&L(l,q)},r=(e==null?void 0:e.id)===d,t=e.originalView!==void 0,h=e.originalView===void 0,P=E,u=(e==null?void 0:e.label)||"",A=j||N,g=a.useRef(!1);!A&&!g.current&&r&&e.id===F&&s&&(g.current=!0,s&&d===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const p=a.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:B},menu:{toggleDropdown:C},delete:{closeDeleteConfirmation:I,handleDelete:_,handleDeleteDraftView:D}},state:{shouldShowDeleteConfirmation:H},actions:O,state:v}=K.useDropdownManager(e),U=a.useMemo(()=>{if(h)return C;if(t)return D},[D,t,h,C]);return i.jsxs(i.Fragment,{children:[i.jsx(c.ViewTab,{colourPalette:c.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:r,id:e==null?void 0:e.id,name:u,type:p,count:M?i.jsx(c.Loader,{type:"ThreeDots",width:12,height:12,color:r?"#fff":c.theme.colors.neutral.ink.dark}):P,onClick:k,subAction:U,ariaContext:"orders",ref:R,"aria-controls":"options-dropdown","aria-expanded":v.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx($.Confirmation,{shouldShow:H,viewName:u,onCancel:I,onDelete:_}),i.jsx(G.PillNotifications,{tabType:p,isActive:r,initialViewName:u,shouldShowCreateViewNotification:t,handleSaveDraft:B}),i.jsx(J.ViewDropdowns,{referenceElement:s,tab:e,...O,...v})]})});exports.ViewTab=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),u=require("@veeqo/ui"),U=require("mobx-react"),z=require("./index65.cjs"),G=require("./index62.cjs"),J=require("./index40.cjs"),K=require("./index43.cjs"),Q=require("./index56.cjs"),X=require("./index103.cjs"),Z=require("./index8.cjs"),$=require("./index61.cjs"),b=require("./index104.cjs"),ee=U.observer(({view:e})=>{const{VIEW_TYPE:x,IS_VIEWS_READONLY:r,SEARCH_FILTER_ID:d}=Z.useBusinessLogic(),{Filters:{activeViewId:w,initFiltersFromView:f,discardChanges:m,initFromUrl:V,filters:L,setFilter:y},Views:{draftViewsMap:T},Notifications:{notify:E}}=$.useStores(),{viewsMap:h,defaultCustomViewId:F,isLoading:N}=G.useViews(),{isLoading:j}=z.useCustomViews({type:x}),{viewCounts:M,isLoadingViewCounts:R}=X.useViewCounts(),[s,k]=c.useState(null),A=o=>{const q=L.get(d);if(h.has(o)){const n=h.get(o);n&&(f(n),m(!0),V())}else{const n=T.get(o);n?(f(n),m(!0),V()):E({type:"error",text:"Failed to load view"})}q&&y(d,q)},a=(e==null?void 0:e.id)===w,t=e.originalView!==void 0,g=e.originalView===void 0,I=M,l=(e==null?void 0:e.label)||"",P=N||j,p=c.useRef(!1);!P&&!p.current&&a&&e.id===F&&s&&(p.current=!0,s&&w===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const D=c.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:_},menu:{toggleDropdown:v},delete:{closeDeleteConfirmation:B,handleDelete:O,handleDeleteDraftView:C}},state:{shouldShowDeleteConfirmation:H},actions:W,state:S}=Q.useDropdownManager(e),Y=c.useMemo(()=>{if(!r){if(g)return v;if(t)return C}},[C,t,g,v,r]);return i.jsxs(i.Fragment,{children:[i.jsx(u.ViewTab,{colourPalette:u.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:a,id:e==null?void 0:e.id,name:l,type:r?void 0:D,count:R?i.jsx(u.Loader,{type:"ThreeDots",width:12,height:12,color:a?"#fff":u.theme.colors.neutral.ink.dark}):I,onClick:A,subAction:Y,ariaContext:"orders",ref:k,"aria-controls":"options-dropdown","aria-expanded":S.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx(b.Confirmation,{shouldShow:H,viewName:l,onCancel:B,onDelete:O}),i.jsx(J.PillNotifications,{tabType:D,isActive:a,initialViewName:l,shouldShowCreateViewNotification:t,handleSaveDraft:_}),!r&&i.jsx(K.ViewDropdowns,{referenceElement:s,tab:e,...W,...S})]})});exports.ViewTab=ee;
package/dist/index36.js CHANGED
@@ -1,78 +1,80 @@
1
- import { jsxs as W, Fragment as Y, jsx as s } from "react/jsx-runtime";
2
- import { useState as $, useRef as z, useMemo as C } from "react";
3
- import { ViewTab as G, theme as L, Loader as J } from "@veeqo/ui";
4
- import { observer as K } from "mobx-react";
5
- import { useCustomViews as Q } from "./index65.js";
6
- import { useViews as X } from "./index62.js";
7
- import { PillNotifications as Z } from "./index40.js";
8
- import { ViewDropdowns as b } from "./index43.js";
9
- import { useDropdownManager as ee } from "./index56.js";
10
- import { useViewCounts as oe } from "./index100.js";
11
- import { useBusinessLogic as ie } from "./index8.js";
12
- import { useStores as te } from "./index61.js";
13
- import { Confirmation as re } from "./index101.js";
14
- const ge = K(({ view: e }) => {
15
- const { VIEW_TYPE: S, SEARCH_FILTER_ID: l } = ie(), {
16
- Filters: { activeViewId: c, initFiltersFromView: d, discardChanges: f, initFromUrl: m, filters: F, setFilter: T },
17
- Views: { draftViewsMap: y },
18
- Notifications: { notify: x }
19
- } = te(), { viewsMap: u, defaultCustomViewId: E, isLoading: N } = X(), { isLoading: k } = Q({ type: S }), { viewCounts: A, isLoadingViewCounts: M } = oe(), [i, R] = $(null), I = (o) => {
20
- const v = F.get(l);
21
- if (u.has(o)) {
22
- const r = u.get(o);
23
- r && (d(r), f(!0), m());
1
+ import { jsxs as U, Fragment as $, jsx as s } from "react/jsx-runtime";
2
+ import { useState as z, useRef as G, useMemo as S } from "react";
3
+ import { ViewTab as J, theme as L, Loader as K } from "@veeqo/ui";
4
+ import { observer as Q } from "mobx-react";
5
+ import { useCustomViews as X } from "./index65.js";
6
+ import { useViews as Z } from "./index62.js";
7
+ import { PillNotifications as b } from "./index40.js";
8
+ import { ViewDropdowns as ee } from "./index43.js";
9
+ import { useDropdownManager as oe } from "./index56.js";
10
+ import { useViewCounts as ie } from "./index103.js";
11
+ import { useBusinessLogic as te } from "./index8.js";
12
+ import { useStores as re } from "./index61.js";
13
+ import { Confirmation as se } from "./index104.js";
14
+ const ve = Q(({ view: e }) => {
15
+ const { VIEW_TYPE: y, IS_VIEWS_READONLY: n, SEARCH_FILTER_ID: c } = te(), {
16
+ Filters: { activeViewId: d, initFiltersFromView: f, discardChanges: m, initFromUrl: u, filters: E, setFilter: F },
17
+ Views: { draftViewsMap: T },
18
+ Notifications: { notify: N }
19
+ } = re(), { viewsMap: w, defaultCustomViewId: x, isLoading: A } = Z(), { isLoading: I } = X({ type: y }), { viewCounts: R, isLoadingViewCounts: _ } = ie(), [i, k] = z(null), M = (o) => {
20
+ const C = E.get(c);
21
+ if (w.has(o)) {
22
+ const r = w.get(o);
23
+ r && (f(r), m(!0), u());
24
24
  } else {
25
- const r = y.get(o);
26
- r ? (d(r), f(!0), m()) : x({
25
+ const r = T.get(o);
26
+ r ? (f(r), m(!0), u()) : N({
27
27
  type: "error",
28
28
  text: "Failed to load view"
29
29
  });
30
30
  }
31
- v && T(l, v);
32
- }, n = (e == null ? void 0 : e.id) === c, t = e.originalView !== void 0, w = e.originalView === void 0, P = A, a = (e == null ? void 0 : e.label) || "", _ = N || k, p = z(!1);
33
- !_ && !p.current && n && e.id === E && i && (p.current = !0, i && c === e.id && window.requestAnimationFrame(() => {
31
+ C && F(c, C);
32
+ }, a = (e == null ? void 0 : e.id) === d, t = e.originalView !== void 0, p = e.originalView === void 0, P = R, l = (e == null ? void 0 : e.label) || "", j = A || I, V = G(!1);
33
+ !j && !V.current && a && e.id === x && i && (V.current = !0, i && d === e.id && window.requestAnimationFrame(() => {
34
34
  var o;
35
35
  (o = i.parentElement) == null || o.scrollBy({
36
36
  behavior: "smooth",
37
37
  left: i.offsetLeft
38
38
  });
39
39
  }));
40
- const h = C(() => t ? "draft" : e.editable ? "saved" : "fixed", [t, e.editable]), {
40
+ const h = S(() => t ? "draft" : e.editable ? "saved" : "fixed", [t, e.editable]), {
41
41
  actions: {
42
- create: { handleSaveDraft: j },
43
- menu: { toggleDropdown: V },
44
- delete: { closeDeleteConfirmation: B, handleDelete: q, handleDeleteDraftView: g }
42
+ create: { handleSaveDraft: B },
43
+ menu: { toggleDropdown: g },
44
+ delete: { closeDeleteConfirmation: O, handleDelete: W, handleDeleteDraftView: v }
45
45
  },
46
- state: { shouldShowDeleteConfirmation: H },
47
- actions: O,
46
+ state: { shouldShowDeleteConfirmation: Y },
47
+ actions: q,
48
48
  state: D
49
- } = ee(e), U = C(() => {
50
- if (w) return V;
51
- if (t) return g;
52
- }, [g, t, w, V]);
53
- return /* @__PURE__ */ W(Y, { children: [
49
+ } = oe(e), H = S(() => {
50
+ if (!n) {
51
+ if (p) return g;
52
+ if (t) return v;
53
+ }
54
+ }, [v, t, p, g, n]);
55
+ return /* @__PURE__ */ U($, { children: [
54
56
  /* @__PURE__ */ s(
55
- G,
57
+ J,
56
58
  {
57
59
  colourPalette: L.colors.secondary.blue,
58
60
  className: "act-react-listing-custom-view",
59
- active: n,
61
+ active: a,
60
62
  id: e == null ? void 0 : e.id,
61
- name: a,
62
- type: h,
63
- count: M ? /* @__PURE__ */ s(
64
- J,
63
+ name: l,
64
+ type: n ? void 0 : h,
65
+ count: _ ? /* @__PURE__ */ s(
66
+ K,
65
67
  {
66
68
  type: "ThreeDots",
67
69
  width: 12,
68
70
  height: 12,
69
- color: n ? "#fff" : L.colors.neutral.ink.dark
71
+ color: a ? "#fff" : L.colors.neutral.ink.dark
70
72
  }
71
73
  ) : P,
72
- onClick: I,
73
- subAction: U,
74
+ onClick: M,
75
+ subAction: H,
74
76
  ariaContext: "orders",
75
- ref: R,
77
+ ref: k,
76
78
  "aria-controls": "options-dropdown",
77
79
  "aria-expanded": D.shouldShowDropdown,
78
80
  "aria-haspopup": "dialog"
@@ -80,27 +82,27 @@ const ge = K(({ view: e }) => {
80
82
  e == null ? void 0 : e.id
81
83
  ),
82
84
  /* @__PURE__ */ s(
83
- re,
85
+ se,
84
86
  {
85
- shouldShow: H,
86
- viewName: a,
87
- onCancel: B,
88
- onDelete: q
87
+ shouldShow: Y,
88
+ viewName: l,
89
+ onCancel: O,
90
+ onDelete: W
89
91
  }
90
92
  ),
91
93
  /* @__PURE__ */ s(
92
- Z,
94
+ b,
93
95
  {
94
96
  tabType: h,
95
- isActive: n,
96
- initialViewName: a,
97
+ isActive: a,
98
+ initialViewName: l,
97
99
  shouldShowCreateViewNotification: t,
98
- handleSaveDraft: j
100
+ handleSaveDraft: B
99
101
  }
100
102
  ),
101
- /* @__PURE__ */ s(b, { referenceElement: i, tab: e, ...O, ...D })
103
+ !n && /* @__PURE__ */ s(ee, { referenceElement: i, tab: e, ...q, ...D })
102
104
  ] });
103
105
  });
104
106
  export {
105
- ge as ViewTab
107
+ ve as ViewTab
106
108
  };
package/dist/index39.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index98.cjs"),g=require("./index52.cjs"),j=require("./index51.cjs"),M=({tab:i,onMakeDefault:l,onEdit:n,onDuplicate:s,onDelete:o,shouldShowDropdown:a,handleCloseDropdown:c})=>{const{openModal:r}=g.useModal(),d=()=>{r(j.ModalId.ORDERS_TABLE_MANAGEMENT),c()},m=i.label!=="Picking In Progress"&&i.editable,u=i.default!==!1&&i.editable,p=i.editable,b=i.editable;return a?e.jsxs(t.MenuItems,{children:[u&&e.jsx(t.Item,{onClick:l,className:"act-react-listing-custom-view-make-default-menu-item",children:"Make default view"}),b&&e.jsx(t.Item,{onClick:n,className:"act-react-listing-custom-view-edit-menu-item",role:"option",children:"Edit"}),e.jsx(t.Item,{onClick:s,className:"act-react-listing-custom-view-duplicate-menu-item",role:"option",children:"Duplicate"}),m&&e.jsx(t.Item,{onClick:o,className:"act-react-listing-custom-view-delete-menu-item",role:"option",children:"Delete"}),p&&e.jsxs(e.Fragment,{children:[e.jsx(t.Divider,{}),e.jsx(t.Item,{onClick:d,role:"option",children:"Table management"})]})]}):null};exports.OptionsDropdown=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index99.cjs"),g=require("./index52.cjs"),j=require("./index51.cjs"),M=({tab:i,onMakeDefault:l,onEdit:n,onDuplicate:s,onDelete:o,shouldShowDropdown:a,handleCloseDropdown:c})=>{const{openModal:r}=g.useModal(),d=()=>{r(j.ModalId.ORDERS_TABLE_MANAGEMENT),c()},m=i.label!=="Picking In Progress"&&i.editable,u=i.default!==!1&&i.editable,p=i.editable,b=i.editable;return a?e.jsxs(t.MenuItems,{children:[u&&e.jsx(t.Item,{onClick:l,className:"act-react-listing-custom-view-make-default-menu-item",children:"Make default view"}),b&&e.jsx(t.Item,{onClick:n,className:"act-react-listing-custom-view-edit-menu-item",role:"option",children:"Edit"}),e.jsx(t.Item,{onClick:s,className:"act-react-listing-custom-view-duplicate-menu-item",role:"option",children:"Duplicate"}),m&&e.jsx(t.Item,{onClick:o,className:"act-react-listing-custom-view-delete-menu-item",role:"option",children:"Delete"}),p&&e.jsxs(e.Fragment,{children:[e.jsx(t.Divider,{}),e.jsx(t.Item,{onClick:d,role:"option",children:"Table management"})]})]}):null};exports.OptionsDropdown=M;
package/dist/index39.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs as t, jsx as i, Fragment as f } from "react/jsx-runtime";
2
- import { MenuItems as M, Item as l, Divider as h } from "./index98.js";
2
+ import { MenuItems as M, Item as l, Divider as h } from "./index99.js";
3
3
  import { useModal as k } from "./index52.js";
4
4
  import { ModalId as T } from "./index51.js";
5
5
  const N = ({
package/dist/index40.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),P=require("mobx-react"),g=require("./index62.cjs"),o=require("framer-motion"),m=require("./index61.cjs"),v=require("./index99.cjs"),f=require("./index42.cjs"),h=P.observer(({tabType:s,isActive:r,shouldShowCreateViewNotification:a,handleSaveDraft:i})=>{var t;const{Filters:{hasUnsavedChanges:c,discardChanges:l,activeViewId:n}}=m.useStores(),{viewsMap:u}=g.useViews(),d=n&&((t=u.get(n))==null?void 0:t.label);return e.jsxs(e.Fragment,{children:[e.jsx(o.AnimatePresence,{children:s==="draft"&&r&&a&&e.jsx(v.DraftPill,{onClick:i})}),e.jsx(o.AnimatePresence,{children:c&&r&&s==="saved"&&e.jsx(f.UnsavedChangesPill,{viewName:d,onDiscard:()=>l(),onSaveDraft:i})})]})});exports.PillNotifications=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),P=require("mobx-react"),g=require("./index62.cjs"),o=require("framer-motion"),m=require("./index61.cjs"),v=require("./index100.cjs"),f=require("./index42.cjs"),h=P.observer(({tabType:s,isActive:r,shouldShowCreateViewNotification:a,handleSaveDraft:i})=>{var t;const{Filters:{hasUnsavedChanges:c,discardChanges:l,activeViewId:n}}=m.useStores(),{viewsMap:u}=g.useViews(),d=n&&((t=u.get(n))==null?void 0:t.label);return e.jsxs(e.Fragment,{children:[e.jsx(o.AnimatePresence,{children:s==="draft"&&r&&a&&e.jsx(v.DraftPill,{onClick:i})}),e.jsx(o.AnimatePresence,{children:c&&r&&s==="saved"&&e.jsx(f.UnsavedChangesPill,{viewName:d,onDiscard:()=>l(),onSaveDraft:i})})]})});exports.PillNotifications=h;
package/dist/index40.js CHANGED
@@ -3,7 +3,7 @@ import { observer as h } from "mobx-react";
3
3
  import { useViews as v } from "./index62.js";
4
4
  import { AnimatePresence as n } from "framer-motion";
5
5
  import { useStores as g } from "./index61.js";
6
- import { DraftPill as w } from "./index99.js";
6
+ import { DraftPill as w } from "./index100.js";
7
7
  import { UnsavedChangesPill as C } from "./index42.js";
8
8
  const U = h(
9
9
  ({
package/dist/index41.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react"),m=require("./index103.cjs"),g=require("./index65.cjs"),S=require("./index62.cjs"),b=require("./index4.cjs"),y=require("./index8.cjs"),V=require("./index61.cjs"),p=require("./index12.cjs"),q=()=>{const{VIEW_TYPE:u}=y.useBusinessLogic(),{sortedCustomViews:s,isLoading:a}=S.useViews(),{mutate:c}=g.useCustomViews({type:u}),[l,t]=n.useState(s);n.useEffect(()=>{t(s)},[s]);const{Notifications:{notify:w}}=V.useStores(),d=async o=>{t(o);const r=o.map(e=>e.id);try{await b.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:r}}}),await c(e=>({...e,settings:{...e.settings,custom_view_positions:{...e.settings.custom_view_positions,order:r}}}),{revalidate:!1})}catch{t(s),w({type:"error",text:"Failed to update order of views"})}};return a||!s.length?null:i.jsx(p.ErrorBoundary,{children:i.jsx(m.LegacySortableViews,{views:l,onChange:d,className:"act-sortable-views"})})};exports.SortableViews=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react"),m=require("./index101.cjs"),g=require("./index65.cjs"),S=require("./index62.cjs"),b=require("./index4.cjs"),y=require("./index8.cjs"),V=require("./index61.cjs"),p=require("./index12.cjs"),q=()=>{const{VIEW_TYPE:u}=y.useBusinessLogic(),{sortedCustomViews:s,isLoading:a}=S.useViews(),{mutate:c}=g.useCustomViews({type:u}),[l,t]=n.useState(s);n.useEffect(()=>{t(s)},[s]);const{Notifications:{notify:w}}=V.useStores(),d=async o=>{t(o);const r=o.map(e=>e.id);try{await b.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:r}}}),await c(e=>({...e,settings:{...e.settings,custom_view_positions:{...e.settings.custom_view_positions,order:r}}}),{revalidate:!1})}catch{t(s),w({type:"error",text:"Failed to update order of views"})}};return a||!s.length?null:i.jsx(p.ErrorBoundary,{children:i.jsx(m.LegacySortableViews,{views:l,onChange:d,className:"act-sortable-views"})})};exports.SortableViews=q;
package/dist/index41.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { useState as f, useEffect as l } from "react";
3
- import { LegacySortableViews as w } from "./index103.js";
3
+ import { LegacySortableViews as w } from "./index101.js";
4
4
  import { useCustomViews as d } from "./index65.js";
5
5
  import { useViews as g } from "./index62.js";
6
6
  import { patchCurrentUser as _ } from "./index4.js";
package/dist/index44.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),V=require("mobx-react"),s=require("@veeqo/ui"),t=require("./index102.cjs"),j=require("./index41.cjs"),m=require("./index62.cjs"),S=require("./index63.cjs"),q=require("./index37.cjs"),u=require("./index36.cjs"),p=require("./index61.cjs"),a=require("./index12.cjs"),b=V.observer(()=>{const{Views:{draftViewsList:c}}=p.useStores(),{viewsArray:l,fixedViews:d}=m.useViews(),[o,i]=n.useState(!1),[w,x]=n.useState(null),h=()=>i(!1);return S.useViewUrlChange(),e.jsxs(e.Fragment,{children:[e.jsxs(s.ViewsContainer,{onClickMenu:()=>i(!0),ariaMenuControls:"views-menu",ariaMenuExpanded:o,ref:x,children:[l.map(r=>e.jsx(a.ErrorBoundary,{children:e.jsx(u.ViewTab,{view:r})},r.id)),c.map(r=>e.jsx(a.ErrorBoundary,{children:e.jsx(u.ViewTab,{view:r})},r.id))]}),o&&e.jsx(s.Popover,{id:"views-menu",anchorElement:w,placement:"bottom",onShouldClose:()=>i(!1),children:e.jsxs(s.Card.Surface,{children:[e.jsx(t.FixedViews,{children:d.map(r=>e.jsx(s.Text,{variant:"placeholder",children:r.label},r.id||r.label))}),e.jsx(j.SortableViews,{}),e.jsx(t.Divider,{}),e.jsx(q.CreateView,{hideActionsPopover:h})]})})]})});exports.ViewList=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),S=require("mobx-react"),i=require("@veeqo/ui"),u=require("./index102.cjs"),m=require("./index41.cjs"),q=require("./index62.cjs"),f=require("./index63.cjs"),p=require("./index37.cjs"),c=require("./index36.cjs"),v=require("./index8.cjs"),b=require("./index61.cjs"),a=require("./index12.cjs"),C=S.observer(({className:l})=>{const{IS_VIEWS_READONLY:r}=v.useBusinessLogic(),{Views:{draftViewsList:d}}=b.useStores(),{viewsArray:w,fixedViews:x}=q.useViews(),[n,o]=t.useState(!1),[V,h]=t.useState(null),j=()=>o(!1);return f.useViewUrlChange(),e.jsxs(e.Fragment,{children:[e.jsxs(i.ViewsContainer,{onClickMenu:r?void 0:()=>o(!0),ariaMenuControls:r?void 0:"views-menu",ariaMenuExpanded:r?!1:n,ref:h,className:l,children:[w.map(s=>e.jsx(a.ErrorBoundary,{children:e.jsx(c.ViewTab,{view:s})},s.id)),d.map(s=>e.jsx(a.ErrorBoundary,{children:e.jsx(c.ViewTab,{view:s})},s.id))]}),!r&&n&&e.jsx(i.Popover,{id:"views-menu",anchorElement:V,placement:"bottom",onShouldClose:()=>o(!1),children:e.jsxs(i.Card.Surface,{children:[e.jsx(u.FixedViews,{children:x.map(s=>e.jsx(i.Text,{variant:"placeholder",children:s.label},s.id||s.label))}),e.jsx(m.SortableViews,{}),e.jsx(u.Divider,{}),e.jsx(p.CreateView,{hideActionsPopover:j})]})})]})});exports.ViewList=C;
package/dist/index44.js CHANGED
@@ -1,50 +1,52 @@
1
- import { jsxs as i, Fragment as u, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as s, Fragment as w, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as n } from "react";
3
- import { observer as h } from "mobx-react";
4
- import { ViewsContainer as w, Popover as V, Card as v, Text as S } from "@veeqo/ui";
5
- import { FixedViews as x, Divider as C } from "./index102.js";
6
- import { SortableViews as b } from "./index41.js";
7
- import { useViews as A } from "./index62.js";
8
- import { useViewUrlChange as L } from "./index63.js";
9
- import { CreateView as M } from "./index37.js";
10
- import { ViewTab as s } from "./index36.js";
11
- import { useStores as T } from "./index61.js";
12
- import { ErrorBoundary as m } from "./index12.js";
13
- const z = h(() => {
14
- const {
15
- Views: { draftViewsList: l }
16
- } = T(), { viewsArray: a, fixedViews: d } = A(), [t, o] = n(!1), [p, c] = n(null), f = () => o(!1);
17
- return L(), /* @__PURE__ */ i(u, { children: [
18
- /* @__PURE__ */ i(
19
- w,
3
+ import { observer as V } from "mobx-react";
4
+ import { ViewsContainer as v, Popover as S, Card as x, Text as C } from "@veeqo/ui";
5
+ import { FixedViews as L, Divider as A } from "./index102.js";
6
+ import { SortableViews as E } from "./index41.js";
7
+ import { useViews as b } from "./index62.js";
8
+ import { useViewUrlChange as M } from "./index63.js";
9
+ import { CreateView as T } from "./index37.js";
10
+ import { ViewTab as m } from "./index36.js";
11
+ import { useBusinessLogic as g } from "./index8.js";
12
+ import { useStores as R } from "./index61.js";
13
+ import { ErrorBoundary as l } from "./index12.js";
14
+ const Y = V(({ className: a }) => {
15
+ const { IS_VIEWS_READONLY: r } = g(), {
16
+ Views: { draftViewsList: d }
17
+ } = R(), { viewsArray: c, fixedViews: p } = b(), [t, i] = n(!1), [f, u] = n(null), h = () => i(!1);
18
+ return M(), /* @__PURE__ */ s(w, { children: [
19
+ /* @__PURE__ */ s(
20
+ v,
20
21
  {
21
- onClickMenu: () => o(!0),
22
- ariaMenuControls: "views-menu",
23
- ariaMenuExpanded: t,
24
- ref: c,
22
+ onClickMenu: r ? void 0 : () => i(!0),
23
+ ariaMenuControls: r ? void 0 : "views-menu",
24
+ ariaMenuExpanded: r ? !1 : t,
25
+ ref: u,
26
+ className: a,
25
27
  children: [
26
- a.map((r) => /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(s, { view: r }) }, r.id)),
27
- l.map((r) => /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(s, { view: r }) }, r.id))
28
+ c.map((o) => /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(m, { view: o }) }, o.id)),
29
+ d.map((o) => /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(m, { view: o }) }, o.id))
28
30
  ]
29
31
  }
30
32
  ),
31
- t && /* @__PURE__ */ e(
32
- V,
33
+ !r && t && /* @__PURE__ */ e(
34
+ S,
33
35
  {
34
36
  id: "views-menu",
35
- anchorElement: p,
37
+ anchorElement: f,
36
38
  placement: "bottom",
37
- onShouldClose: () => o(!1),
38
- children: /* @__PURE__ */ i(v.Surface, { children: [
39
- /* @__PURE__ */ e(x, { children: d.map((r) => /* @__PURE__ */ e(S, { variant: "placeholder", children: r.label }, r.id || r.label)) }),
40
- /* @__PURE__ */ e(b, {}),
41
- /* @__PURE__ */ e(C, {}),
42
- /* @__PURE__ */ e(M, { hideActionsPopover: f })
39
+ onShouldClose: () => i(!1),
40
+ children: /* @__PURE__ */ s(x.Surface, { children: [
41
+ /* @__PURE__ */ e(L, { children: p.map((o) => /* @__PURE__ */ e(C, { variant: "placeholder", children: o.label }, o.id || o.label)) }),
42
+ /* @__PURE__ */ e(E, {}),
43
+ /* @__PURE__ */ e(A, {}),
44
+ /* @__PURE__ */ e(T, { hideActionsPopover: h })
43
45
  ] })
44
46
  }
45
47
  )
46
48
  ] });
47
49
  });
48
50
  export {
49
- z as ViewList
51
+ Y as ViewList
50
52
  };
package/dist/index46.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),N=require("./index88.cjs"),b=require("@veeqo/ui"),_=require("./index89.cjs"),j=require("mobx-react"),y=require("./index8.cjs"),B=require("./index52.cjs"),I=require("./index61.cjs"),O=require("./index62.cjs"),g=require("./index51.cjs"),w=j.observer(({columnDefinitions:T,pinnedRightColumnIds:i=[],pinnedLeftColumnIds:a=[]})=>{var M;const{DEFAULT_HIDDEN_COLUMNS:E,DEFAULT_VISIBLE_COLUMNS:p}=y.useBusinessLogic(),t=[...a,...i],l=E.filter(s=>!t.includes(s)),c=p.filter(s=>!t.includes(s)),S=[...l,...c],{closeModal:h,isModalOpen:q,openModal:A}=B.useModal(),{Filters:{activeViewId:n},Views:{draftViewsMap:f}}=I.useStores(),{viewsMap:x,isLoading:D}=O.useViews();if(!n||D)return null;const e=x.get(n),r=Array.isArray((M=e==null?void 0:e.columns)==null?void 0:M.columnIds),u=r?e.columns.columnIds.filter(s=>!t.includes(s)):c,L=r?S.filter(s=>!u.includes(s)):l,d=f.has(n),m=!(e!=null&&e.editable),v=m||d,C=d?"Please create a view to use table management":m?"Please choose a custom view to use table management":"Table management";return o.jsxs(o.Fragment,{children:[o.jsx(b.Tooltip,{text:C,children:o.jsx(b.Button,{"aria-label":"Open table management",onClick:()=>A(g.ModalId.ORDERS_TABLE_MANAGEMENT),size:"sm",iconSlot:o.jsx(_.TableManagementGlyph,{}),disabled:v})}),q(g.ModalId.ORDERS_TABLE_MANAGEMENT)&&o.jsx(N.TableManagementModal,{pinnedRightColumnIds:i,pinnedLeftColumnIds:a,visibleColumns:u,hiddenColumns:L,columnDefinitions:T,onClose:h})]})});exports.TableManagement=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),N=require("./index89.cjs"),b=require("@veeqo/ui"),_=require("./index90.cjs"),j=require("mobx-react"),y=require("./index8.cjs"),B=require("./index52.cjs"),I=require("./index61.cjs"),O=require("./index62.cjs"),g=require("./index51.cjs"),w=j.observer(({columnDefinitions:T,pinnedRightColumnIds:i=[],pinnedLeftColumnIds:a=[]})=>{var M;const{DEFAULT_HIDDEN_COLUMNS:E,DEFAULT_VISIBLE_COLUMNS:p}=y.useBusinessLogic(),t=[...a,...i],l=E.filter(s=>!t.includes(s)),c=p.filter(s=>!t.includes(s)),S=[...l,...c],{closeModal:h,isModalOpen:q,openModal:A}=B.useModal(),{Filters:{activeViewId:n},Views:{draftViewsMap:f}}=I.useStores(),{viewsMap:x,isLoading:D}=O.useViews();if(!n||D)return null;const e=x.get(n),r=Array.isArray((M=e==null?void 0:e.columns)==null?void 0:M.columnIds),u=r?e.columns.columnIds.filter(s=>!t.includes(s)):c,L=r?S.filter(s=>!u.includes(s)):l,d=f.has(n),m=!(e!=null&&e.editable),v=m||d,C=d?"Please create a view to use table management":m?"Please choose a custom view to use table management":"Table management";return o.jsxs(o.Fragment,{children:[o.jsx(b.Tooltip,{text:C,children:o.jsx(b.Button,{"aria-label":"Open table management",onClick:()=>A(g.ModalId.ORDERS_TABLE_MANAGEMENT),size:"sm",iconSlot:o.jsx(_.TableManagementGlyph,{}),disabled:v})}),q(g.ModalId.ORDERS_TABLE_MANAGEMENT)&&o.jsx(N.TableManagementModal,{pinnedRightColumnIds:i,pinnedLeftColumnIds:a,visibleColumns:u,hiddenColumns:L,columnDefinitions:T,onClose:h})]})});exports.TableManagement=w;
package/dist/index46.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs as v, Fragment as B, jsx as s } from "react/jsx-runtime";
2
- import { TableManagementModal as O } from "./index88.js";
2
+ import { TableManagementModal as O } from "./index89.js";
3
3
  import { Tooltip as w, Button as x } from "@veeqo/ui";
4
- import { TableManagementGlyph as F } from "./index89.js";
4
+ import { TableManagementGlyph as F } from "./index90.js";
5
5
  import { observer as I } from "mobx-react";
6
6
  import { useBusinessLogic as y } from "./index8.js";
7
7
  import { useModal as P } from "./index52.js";
package/dist/index80.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index105.cjs"),w=require("./index79.cjs"),V=require("./index78.cjs"),d=({data:n,canUpdateCustomViews:u})=>{const l={fixedViews:[...r.INITIAL_VIEWS_STATE.fixedViews],customViews:[...r.INITIAL_VIEWS_STATE.customViews],viewsMap:new Map(r.INITIAL_VIEWS_STATE.viewsMap)};if(!n)return l;let o=!1;const i=n.reduce((e,s)=>{const t=V.viewsAdapter({view:s,canUpdateCustomViews:u});return e.viewsMap.set(s.id,t),s.editable?e.customViews.push(t):e.fixedViews.push(t),s.title==="All"&&(o=!0),e},l);return o&&(i.viewsMap.delete(w.ALL_VIEW_ID),i.fixedViews.shift()),i};exports.organiseViews=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index98.cjs"),w=require("./index79.cjs"),V=require("./index78.cjs"),d=({data:n,canUpdateCustomViews:u})=>{const l={fixedViews:[...r.INITIAL_VIEWS_STATE.fixedViews],customViews:[...r.INITIAL_VIEWS_STATE.customViews],viewsMap:new Map(r.INITIAL_VIEWS_STATE.viewsMap)};if(!n)return l;let o=!1;const i=n.reduce((e,s)=>{const t=V.viewsAdapter({view:s,canUpdateCustomViews:u});return e.viewsMap.set(s.id,t),s.editable?e.customViews.push(t):e.fixedViews.push(t),s.title==="All"&&(o=!0),e},l);return o&&(i.viewsMap.delete(w.ALL_VIEW_ID),i.fixedViews.shift()),i};exports.organiseViews=d;
package/dist/index80.js CHANGED
@@ -1,4 +1,4 @@
1
- import { INITIAL_VIEWS_STATE as r } from "./index105.js";
1
+ import { INITIAL_VIEWS_STATE as r } from "./index98.js";
2
2
  import { ALL_VIEW_ID as p } from "./index79.js";
3
3
  import { viewsAdapter as u } from "./index78.js";
4
4
  const m = ({ data: o, canUpdateCustomViews: w }) => {
package/dist/index84.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index107.cjs"),s=e=>{if(!l.isError(e))return e;if(e.stack){const t=e.stack.split(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index111.cjs"),s=e=>{if(!l.isError(e))return e;if(e.stack){const t=e.stack.split(`
2
2
  `);if(t.length<=10)return e;const n=t==null?void 0:t[0],i=t==null?void 0:t.splice(9),r=[n,...i].join(`
3
3
  `);e.stack=r}return e};exports.filterErrorStack=s;
package/dist/index84.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isError as l } from "./index107.js";
1
+ import { isError as l } from "./index111.js";
2
2
  const s = (e) => {
3
3
  if (!l(e)) return e;
4
4
  if (e.stack) {
package/dist/index85.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index107.cjs"),n=({customError:t,originalError:e,type:c})=>{!s.isError(e)||!s.isError(t)||(e.stack&&(e.stack=t.stack),e.name&&(e.name=`${c} (${e.name})`))};exports.injectIntoError=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index111.cjs"),n=({customError:t,originalError:e,type:c})=>{!s.isError(e)||!s.isError(t)||(e.stack&&(e.stack=t.stack),e.name&&(e.name=`${c} (${e.name})`))};exports.injectIntoError=n;
package/dist/index85.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isError as c } from "./index107.js";
1
+ import { isError as c } from "./index111.js";
2
2
  const s = ({
3
3
  customError: e,
4
4
  originalError: t,
package/dist/index88.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("@veeqo/ui"),s=require("react"),w=require("@veeqo/components"),S=require("./index91.cjs"),i=require("./index92.cjs"),T=require("./index93.cjs"),V=require("./index94.cjs"),n=require("./index95.cjs"),D=require("./index89.cjs"),H=require("./index96.cjs"),j=require("./index97.cjs"),{Glyph:O}=w.VeeqoCommon,$=({onClose:u,columnDefinitions:G,hiddenColumns:d,visibleColumns:m,pinnedLeftColumnIds:y,pinnedRightColumnIds:f})=>{const[c,p]=s.useState(""),a=s.useMemo(()=>new Map(G.map(r=>[r.id,r])),[]),[o,g]=s.useState(()=>({[n.ColumnGroupIds.Hidden]:d,[n.ColumnGroupIds.Visible]:m})),I=s.useMemo(()=>{const r=o[n.ColumnGroupIds.Visible].map(t=>a.get(`${t}`));return j.filterColumnsBySearch(r,c)},[o,a,c]),v=s.useMemo(()=>{const r=o[n.ColumnGroupIds.Hidden].map(t=>a.get(`${t}`));return j.filterColumnsBySearch(r,c)},[o,a,c]),{isSavingColumns:h,saveColumns:M}=H.usePersistColumns({pinnedLeftColumnIds:y,pinnedRightColumnIds:f}),q=()=>{p(""),g({[n.ColumnGroupIds.Hidden]:d,[n.ColumnGroupIds.Visible]:m})},x=s.useCallback(r=>{if(p(r),!r){const t=new Set([...d,...m]);g(b=>({[n.ColumnGroupIds.Hidden]:b[n.ColumnGroupIds.Hidden].filter(C=>t.has(`${C}`)),[n.ColumnGroupIds.Visible]:b[n.ColumnGroupIds.Visible].filter(C=>t.has(`${C}`))}))}},[d,m]),k=s.useCallback(r=>{const t=a.get(`${r}`);return t?e.jsx(V.ColumnItem,{column:t,isDragOverlay:!0}):null},[a]);return e.jsx(l.Modal,{variant:"lg",style:{overflowY:"hidden"},shouldShow:!0,onClose:()=>u==null?void 0:u(),headerSlot:e.jsxs(i.HeaderContainer,{children:[e.jsxs(l.Stack,{direction:"horizontal",alignX:"between",alignY:"center",children:[e.jsxs(l.Stack,{direction:"horizontal",alignX:"start",alignY:"center",spacing:"sm",children:[e.jsx(D.TableManagementGlyph,{height:32,width:32}),e.jsx(l.Text,{variant:"headingLarge",as:"h1",children:"Table management"})]}),e.jsx(l.Button,{"aria-label":"Close modal",onClick:u,variant:"flat",iconSlot:e.jsx(O,{name:"close"})})]}),e.jsxs(l.Text,{variant:"subheadingMedium",children:["Show, hide, or change the order of the columns in the view, so you always see the data that's most important to you. Learn more with our"," ",e.jsx(l.Anchor,{href:"#",target:"_blank",children:"help guide (TODO)"}),"."]}),e.jsx(l.Text,{variant:"headingSmall",children:"Column management"}),e.jsx(i.ColumnSearch,{name:"column-search-query",placeholder:"Search",value:c,onChange:x,onClearClick:()=>x(""),fill:"100%"})]}),leftActions:[{label:"Reset",onClick:q,variant:"default",disabled:h}],rightActions:[{label:"Cancel",onClick:u,variant:"default",disabled:h},{label:"Save",onClick:()=>M({visibleColumns:o[n.ColumnGroupIds.Visible]}),variant:"primary",disabled:h,loading:h}],children:e.jsx(l.Stack,{spacing:"md",alignX:"stretch",children:e.jsx(l.Stack,{spacing:4,alignX:"stretch",children:e.jsx(T.DndContainer,{items:o,setItems:g,renderDragOverlay:k,children:e.jsx(i.Container,{children:e.jsxs(i.ColumnGroupsGrid,{columns:2,spacing:"xl",children:[e.jsx(S.ColumnGroup,{id:n.ColumnGroupIds.Visible,title:"Shown columns:",columns:I}),e.jsx(i.VerticalSeparator,{children:e.jsx(i.VerticalText,{children:"Drag & Drop columns"})}),e.jsx(S.ColumnGroup,{id:n.ColumnGroupIds.Hidden,title:"Hidden columns:",columns:v})]})})})})})})};exports.TableManagementModal=$;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_actionsHeaderContainer_fgqms_1",t={actionsHeaderContainer:e};exports.actionsHeaderContainer=e;exports.default=t;
package/dist/index88.js CHANGED
@@ -1,120 +1,7 @@
1
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
- import { Modal as O, Stack as h, Text as p, Button as X, Anchor as A } from "@veeqo/ui";
3
- import { useState as v, useMemo as f, useCallback as y } from "react";
4
- import { VeeqoCommon as I } from "@veeqo/components";
5
- import { ColumnGroup as w } from "./index91.js";
6
- import { Container as Y, ColumnGroupsGrid as j, VerticalSeparator as z, VerticalText as B, HeaderContainer as L, ColumnSearch as Q } from "./index92.js";
7
- import { DndContainer as R } from "./index93.js";
8
- import { ColumnItem as q } from "./index94.js";
9
- import { ColumnGroupIds as n } from "./index95.js";
10
- import { TableManagementGlyph as P } from "./index89.js";
11
- import { usePersistColumns as _ } from "./index96.js";
12
- import { filterColumnsBySearch as V } from "./index97.js";
13
- const { Glyph: E } = I, te = ({
14
- onClose: l,
15
- columnDefinitions: k,
16
- hiddenColumns: s,
17
- visibleColumns: m,
18
- pinnedLeftColumnIds: D,
19
- pinnedRightColumnIds: H
20
- }) => {
21
- const [o, b] = v(""), i = f(() => new Map(k.map((a) => [a.id, a])), []), [t, u] = v(() => ({
22
- [n.Hidden]: s,
23
- [n.Visible]: m
24
- })), M = f(() => {
25
- const a = t[n.Visible].map((r) => i.get(`${r}`));
26
- return V(a, o);
27
- }, [t, i, o]), x = f(() => {
28
- const a = t[n.Hidden].map((r) => i.get(`${r}`));
29
- return V(a, o);
30
- }, [t, i, o]), { isSavingColumns: d, saveColumns: G } = _({ pinnedLeftColumnIds: D, pinnedRightColumnIds: H }), T = () => {
31
- b(""), u({
32
- [n.Hidden]: s,
33
- [n.Visible]: m
34
- });
35
- }, C = y(
36
- (a) => {
37
- if (b(a), !a) {
38
- const r = /* @__PURE__ */ new Set([...s, ...m]);
39
- u((S) => ({
40
- [n.Hidden]: S[n.Hidden].filter((g) => r.has(`${g}`)),
41
- [n.Visible]: S[n.Visible].filter((g) => r.has(`${g}`))
42
- }));
43
- }
44
- },
45
- [s, m]
46
- ), $ = y(
47
- (a) => {
48
- const r = i.get(`${a}`);
49
- return r ? /* @__PURE__ */ e(q, { column: r, isDragOverlay: !0 }) : null;
50
- },
51
- [i]
52
- );
53
- return /* @__PURE__ */ e(
54
- O,
55
- {
56
- variant: "lg",
57
- style: { overflowY: "hidden" },
58
- shouldShow: !0,
59
- onClose: () => l == null ? void 0 : l(),
60
- headerSlot: /* @__PURE__ */ c(L, { children: [
61
- /* @__PURE__ */ c(h, { direction: "horizontal", alignX: "between", alignY: "center", children: [
62
- /* @__PURE__ */ c(h, { direction: "horizontal", alignX: "start", alignY: "center", spacing: "sm", children: [
63
- /* @__PURE__ */ e(P, { height: 32, width: 32 }),
64
- /* @__PURE__ */ e(p, { variant: "headingLarge", as: "h1", children: "Table management" })
65
- ] }),
66
- /* @__PURE__ */ e(X, { "aria-label": "Close modal", onClick: l, variant: "flat", iconSlot: /* @__PURE__ */ e(E, { name: "close" }) })
67
- ] }),
68
- /* @__PURE__ */ c(p, { variant: "subheadingMedium", children: [
69
- "Show, hide, or change the order of the columns in the view, so you always see the data that's most important to you. Learn more with our",
70
- " ",
71
- /* @__PURE__ */ e(A, { href: "#", target: "_blank", children: "help guide (TODO)" }),
72
- "."
73
- ] }),
74
- /* @__PURE__ */ e(p, { variant: "headingSmall", children: "Column management" }),
75
- /* @__PURE__ */ e(
76
- Q,
77
- {
78
- name: "column-search-query",
79
- placeholder: "Search",
80
- value: o,
81
- onChange: C,
82
- onClearClick: () => C(""),
83
- fill: "100%"
84
- }
85
- )
86
- ] }),
87
- leftActions: [
88
- {
89
- label: "Reset",
90
- onClick: T,
91
- variant: "default",
92
- disabled: d
93
- }
94
- ],
95
- rightActions: [
96
- {
97
- label: "Cancel",
98
- onClick: l,
99
- variant: "default",
100
- disabled: d
101
- },
102
- {
103
- label: "Save",
104
- onClick: () => G({ visibleColumns: t[n.Visible] }),
105
- variant: "primary",
106
- disabled: d,
107
- loading: d
108
- }
109
- ],
110
- children: /* @__PURE__ */ e(h, { spacing: "md", alignX: "stretch", children: /* @__PURE__ */ e(h, { spacing: 4, alignX: "stretch", children: /* @__PURE__ */ e(R, { items: t, setItems: u, renderDragOverlay: $, children: /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ c(j, { columns: 2, spacing: "xl", children: [
111
- /* @__PURE__ */ e(w, { id: n.Visible, title: "Shown columns:", columns: M }),
112
- /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(B, { children: "Drag & Drop columns" }) }),
113
- /* @__PURE__ */ e(w, { id: n.Hidden, title: "Hidden columns:", columns: x })
114
- ] }) }) }) }) })
115
- }
116
- );
1
+ const e = "_actionsHeaderContainer_fgqms_1", a = {
2
+ actionsHeaderContainer: e
117
3
  };
118
4
  export {
119
- te as TableManagementModal
5
+ e as actionsHeaderContainer,
6
+ a as default
120
7
  };
package/dist/index89.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=({height:H=16,width:V=16})=>e.jsx("svg",{width:V,height:H,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.6667 3.33333V12.6667H3.33333V3.33333H12.6667ZM13.4 2H2.6C2.26667 2 2 2.26667 2 2.6V13.4C2 13.6667 2.26667 14 2.6 14H13.4C13.6667 14 14 13.6667 14 13.4V2.6C14 2.26667 13.6667 2 13.4 2ZM7.33333 4.66667H11.3333V6H7.33333V4.66667ZM7.33333 7.33333H11.3333V8.66667H7.33333V7.33333ZM7.33333 10H11.3333V11.3333H7.33333V10ZM4.66667 4.66667H6V6H4.66667V4.66667ZM4.66667 7.33333H6V8.66667H4.66667V7.33333ZM4.66667 10H6V11.3333H4.66667V10Z",fill:"#37424D"})});exports.TableManagementGlyph=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("@veeqo/ui"),s=require("react"),w=require("@veeqo/components"),S=require("./index91.cjs"),i=require("./index92.cjs"),T=require("./index93.cjs"),V=require("./index94.cjs"),n=require("./index95.cjs"),D=require("./index90.cjs"),H=require("./index96.cjs"),j=require("./index97.cjs"),{Glyph:O}=w.VeeqoCommon,$=({onClose:u,columnDefinitions:G,hiddenColumns:d,visibleColumns:m,pinnedLeftColumnIds:y,pinnedRightColumnIds:f})=>{const[c,p]=s.useState(""),a=s.useMemo(()=>new Map(G.map(r=>[r.id,r])),[]),[o,g]=s.useState(()=>({[n.ColumnGroupIds.Hidden]:d,[n.ColumnGroupIds.Visible]:m})),I=s.useMemo(()=>{const r=o[n.ColumnGroupIds.Visible].map(t=>a.get(`${t}`));return j.filterColumnsBySearch(r,c)},[o,a,c]),v=s.useMemo(()=>{const r=o[n.ColumnGroupIds.Hidden].map(t=>a.get(`${t}`));return j.filterColumnsBySearch(r,c)},[o,a,c]),{isSavingColumns:h,saveColumns:M}=H.usePersistColumns({pinnedLeftColumnIds:y,pinnedRightColumnIds:f}),q=()=>{p(""),g({[n.ColumnGroupIds.Hidden]:d,[n.ColumnGroupIds.Visible]:m})},x=s.useCallback(r=>{if(p(r),!r){const t=new Set([...d,...m]);g(b=>({[n.ColumnGroupIds.Hidden]:b[n.ColumnGroupIds.Hidden].filter(C=>t.has(`${C}`)),[n.ColumnGroupIds.Visible]:b[n.ColumnGroupIds.Visible].filter(C=>t.has(`${C}`))}))}},[d,m]),k=s.useCallback(r=>{const t=a.get(`${r}`);return t?e.jsx(V.ColumnItem,{column:t,isDragOverlay:!0}):null},[a]);return e.jsx(l.Modal,{variant:"lg",style:{overflowY:"hidden"},shouldShow:!0,onClose:()=>u==null?void 0:u(),headerSlot:e.jsxs(i.HeaderContainer,{children:[e.jsxs(l.Stack,{direction:"horizontal",alignX:"between",alignY:"center",children:[e.jsxs(l.Stack,{direction:"horizontal",alignX:"start",alignY:"center",spacing:"sm",children:[e.jsx(D.TableManagementGlyph,{height:32,width:32}),e.jsx(l.Text,{variant:"headingLarge",as:"h1",children:"Table management"})]}),e.jsx(l.Button,{"aria-label":"Close modal",onClick:u,variant:"flat",iconSlot:e.jsx(O,{name:"close"})})]}),e.jsxs(l.Text,{variant:"subheadingMedium",children:["Show, hide, or change the order of the columns in the view, so you always see the data that's most important to you. Learn more with our"," ",e.jsx(l.Anchor,{href:"#",target:"_blank",children:"help guide (TODO)"}),"."]}),e.jsx(l.Text,{variant:"headingSmall",children:"Column management"}),e.jsx(i.ColumnSearch,{name:"column-search-query",placeholder:"Search",value:c,onChange:x,onClearClick:()=>x(""),fill:"100%"})]}),leftActions:[{label:"Reset",onClick:q,variant:"default",disabled:h}],rightActions:[{label:"Cancel",onClick:u,variant:"default",disabled:h},{label:"Save",onClick:()=>M({visibleColumns:o[n.ColumnGroupIds.Visible]}),variant:"primary",disabled:h,loading:h}],children:e.jsx(l.Stack,{spacing:"md",alignX:"stretch",children:e.jsx(l.Stack,{spacing:4,alignX:"stretch",children:e.jsx(T.DndContainer,{items:o,setItems:g,renderDragOverlay:k,children:e.jsx(i.Container,{children:e.jsxs(i.ColumnGroupsGrid,{columns:2,spacing:"xl",children:[e.jsx(S.ColumnGroup,{id:n.ColumnGroupIds.Visible,title:"Shown columns:",columns:I}),e.jsx(i.VerticalSeparator,{children:e.jsx(i.VerticalText,{children:"Drag & Drop columns"})}),e.jsx(S.ColumnGroup,{id:n.ColumnGroupIds.Hidden,title:"Hidden columns:",columns:v})]})})})})})})};exports.TableManagementModal=$;