@veeqo/transfigure 1.2.0 → 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 (118) 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/constants/viewConstants.d.ts +2 -0
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.js +16 -14
  6. package/dist/index10.cjs +1 -1
  7. package/dist/index10.js +14 -13
  8. package/dist/index100.cjs +1 -1
  9. package/dist/index100.js +20 -14
  10. package/dist/index101.cjs +1 -19
  11. package/dist/index101.js +14 -23
  12. package/dist/index102.cjs +12 -1
  13. package/dist/index102.js +16 -24
  14. package/dist/index103.cjs +1 -12
  15. package/dist/index103.js +33 -16
  16. package/dist/index104.cjs +1 -80
  17. package/dist/index104.js +28 -100
  18. package/dist/index105.cjs +1 -1
  19. package/dist/index105.js +24 -2
  20. package/dist/index106.cjs +80 -1
  21. package/dist/index106.js +101 -19
  22. package/dist/index107.cjs +1 -1
  23. package/dist/index107.js +18 -7
  24. package/dist/index108.cjs +1 -1
  25. package/dist/index108.js +7 -63
  26. package/dist/index109.cjs +1 -1
  27. package/dist/index109.js +60 -26
  28. package/dist/index11.cjs +1 -1
  29. package/dist/index11.js +1 -1
  30. package/dist/index110.cjs +1 -13
  31. package/dist/index110.js +30 -17
  32. package/dist/index111.cjs +1 -1
  33. package/dist/index111.js +2 -26
  34. package/dist/index112.cjs +13 -1
  35. package/dist/index112.js +14 -33
  36. package/dist/index113.cjs +1 -7
  37. package/dist/index113.js +36 -10
  38. package/dist/index114.cjs +1 -1
  39. package/dist/index114.js +25 -62
  40. package/dist/index115.cjs +1 -1
  41. package/dist/index115.js +58 -42
  42. package/dist/index116.cjs +1 -0
  43. package/dist/index116.js +49 -0
  44. package/dist/index117.cjs +7 -0
  45. package/dist/index117.js +12 -0
  46. package/dist/index17.cjs +1 -1
  47. package/dist/index17.js +1 -1
  48. package/dist/index22.cjs +1 -1
  49. package/dist/index22.js +1 -1
  50. package/dist/index31.cjs +1 -1
  51. package/dist/index31.js +1 -1
  52. package/dist/index34.cjs +1 -1
  53. package/dist/index34.js +1 -1
  54. package/dist/index36.cjs +1 -1
  55. package/dist/index36.js +62 -60
  56. package/dist/index39.cjs +1 -1
  57. package/dist/index39.js +1 -1
  58. package/dist/index40.cjs +1 -1
  59. package/dist/index40.js +1 -1
  60. package/dist/index41.cjs +1 -1
  61. package/dist/index41.js +1 -1
  62. package/dist/index42.cjs +1 -1
  63. package/dist/index42.js +1 -1
  64. package/dist/index44.cjs +1 -1
  65. package/dist/index44.js +36 -34
  66. package/dist/index46.cjs +1 -1
  67. package/dist/index46.js +2 -2
  68. package/dist/index62.cjs +1 -1
  69. package/dist/index62.js +31 -49
  70. package/dist/index7.cjs +1 -1
  71. package/dist/index7.js +4 -4
  72. package/dist/index80.cjs +1 -1
  73. package/dist/index80.js +20 -6
  74. package/dist/index81.cjs +1 -1
  75. package/dist/index81.js +7 -2
  76. package/dist/index82.cjs +1 -1
  77. package/dist/index82.js +2 -9
  78. package/dist/index83.cjs +1 -3
  79. package/dist/index83.js +8 -13
  80. package/dist/index84.cjs +3 -1
  81. package/dist/index84.js +13 -8
  82. package/dist/index85.cjs +1 -1
  83. package/dist/index85.js +8 -4
  84. package/dist/index88.cjs +1 -1
  85. package/dist/index88.js +4 -117
  86. package/dist/index89.cjs +1 -1
  87. package/dist/index89.js +117 -18
  88. package/dist/index90.cjs +1 -1
  89. package/dist/index90.js +19 -13
  90. package/dist/index91.cjs +1 -104
  91. package/dist/index91.js +13 -120
  92. package/dist/index92.cjs +104 -1
  93. package/dist/index92.js +117 -65
  94. package/dist/index93.cjs +1 -1
  95. package/dist/index93.js +63 -24
  96. package/dist/index94.cjs +1 -1
  97. package/dist/index94.js +29 -2
  98. package/dist/index95.cjs +1 -1
  99. package/dist/index95.js +2 -41
  100. package/dist/index96.cjs +1 -1
  101. package/dist/index96.js +39 -9
  102. package/dist/index97.cjs +1 -1
  103. package/dist/index97.js +9 -31
  104. package/dist/index98.cjs +1 -1
  105. package/dist/index98.js +7 -29
  106. package/dist/index99.cjs +19 -1
  107. package/dist/index99.js +24 -21
  108. package/dist/mocks/createMockTransformedView.d.ts +2 -0
  109. package/dist/mocks/createMockView.d.ts +2 -0
  110. package/dist/storybookHelpers/Code.d.ts +3 -0
  111. package/dist/storybookHelpers/apiMocks/views/mockSeededAllView.d.ts +26 -0
  112. package/dist/types.d.ts +5 -0
  113. package/dist/utils/index.d.ts +1 -0
  114. package/dist/utils/organiseViews/index.d.ts +1 -0
  115. package/dist/utils/organiseViews/organiseViews.d.ts +18 -0
  116. package/dist/utils/organiseViews/organiseViews.test.d.ts +1 -0
  117. package/package.json +1 -1
  118. /package/dist/storybookHelpers/apiMocks/{custom_views.d.ts → views/custom_views.d.ts} +0 -0
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 "./index97.js";
11
- import { useBusinessLogic as ie } from "./index8.js";
12
- import { useStores as te } from "./index61.js";
13
- import { Confirmation as re } from "./index98.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("./index101.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 "./index101.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("./index100.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 "./index100.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/index42.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@veeqo/ui"),c=require("mobx-react"),l=require("./index60.cjs"),n=require("./index104.cjs"),d=i.theme.colors.secondary.blue.base,h=c.observer(({onDiscard:r,viewName:s,onSaveDraft:a})=>{const{saveChanges:o,isSubmitting:t}=l.usePersistUnsavedChanges();return e.jsx(n.Notification,{children:e.jsx(n.Container,{children:e.jsxs(i.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(n.Glyph,{ariaLabel:"attention",name:"attention",color:d}),e.jsxs(n.Wrap,{children:[e.jsx(n.Text,{variant:"body",margin:"0 4px 0 0",children:"You have unsaved changes to"}),s&&e.jsxs(n.Bold,{variant:"bodyBoldDark",children:["'",s,"'"]})]}),e.jsx(i.Button,{onClick:r,size:"sm",children:"Discard changes"}),e.jsxs(i.ActionMenu,{ctaProps:{children:"Save changes",variant:"primary"},children:[e.jsx(i.ActionMenu.Item,{onAction:a,isDisabled:t,children:e.jsx(n.Text,{variant:"body",children:"Create new view"})}),e.jsx(i.ActionMenu.Item,{onAction:o,isDisabled:t,children:e.jsxs(i.Stack,{direction:"horizontal",spacing:1,alignY:"center",children:[e.jsx(n.Text,{variant:"body",children:"Save changes to"}),e.jsx(n.Text,{variant:"bodyBold",children:s})]})})]})]})})})});exports.UnsavedChangesPill=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@veeqo/ui"),c=require("mobx-react"),l=require("./index60.cjs"),n=require("./index106.cjs"),d=i.theme.colors.secondary.blue.base,h=c.observer(({onDiscard:r,viewName:s,onSaveDraft:a})=>{const{saveChanges:o,isSubmitting:t}=l.usePersistUnsavedChanges();return e.jsx(n.Notification,{children:e.jsx(n.Container,{children:e.jsxs(i.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(n.Glyph,{ariaLabel:"attention",name:"attention",color:d}),e.jsxs(n.Wrap,{children:[e.jsx(n.Text,{variant:"body",margin:"0 4px 0 0",children:"You have unsaved changes to"}),s&&e.jsxs(n.Bold,{variant:"bodyBoldDark",children:["'",s,"'"]})]}),e.jsx(i.Button,{onClick:r,size:"sm",children:"Discard changes"}),e.jsxs(i.ActionMenu,{ctaProps:{children:"Save changes",variant:"primary"},children:[e.jsx(i.ActionMenu.Item,{onAction:a,isDisabled:t,children:e.jsx(n.Text,{variant:"body",children:"Create new view"})}),e.jsx(i.ActionMenu.Item,{onAction:o,isDisabled:t,children:e.jsxs(i.Stack,{direction:"horizontal",spacing:1,alignY:"center",children:[e.jsx(n.Text,{variant:"body",children:"Save changes to"}),e.jsx(n.Text,{variant:"bodyBold",children:s})]})})]})]})})})});exports.UnsavedChangesPill=h;
package/dist/index42.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as n, jsxs as e } from "react/jsx-runtime";
2
2
  import { Stack as t, theme as d, Button as h, ActionMenu as o } from "@veeqo/ui";
3
3
  import { observer as m } from "mobx-react";
4
4
  import { usePersistUnsavedChanges as v } from "./index60.js";
5
- import { Notification as b, Container as g, Glyph as p, Wrap as u, Text as i, Bold as y } from "./index104.js";
5
+ import { Notification as b, Container as g, Glyph as p, Wrap as u, Text as i, Bold as y } from "./index106.js";
6
6
  const C = d.colors.secondary.blue.base, k = m(({
7
7
  onDiscard: c,
8
8
  viewName: r,
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("./index103.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 "./index103.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/index62.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("swr"),c=require("react"),x=require("./index79.cjs"),E=require("./index78.cjs"),O=require("./index65.cjs"),S=require("./index49.cjs"),y=require("./index8.cjs"),C=require("./index55.cjs"),I=e=>e&&e.__esModule?e:{default:e},b=I(v),i=x.createAllView(),P=()=>{const{DEFAULT_PAGE_NUMBER:e,DEFAULT_PAGE_SIZE:m,VIEW_TYPE:w}=y.useBusinessLogic(),{canUpdateCustomViews:V,orderedListOfCustomViews:u,defaultCustomViewId:p,isLoading:_}=O.useCustomViews({type:w}),{data:n,isLoading:M,error:A,mutate:g}=b.default(`/api/v2/custom_views?filter[type]=${w}&page[number]=${e}&page[size]=${m}`,C.fetcherV2,S.SWR_HOOK_OPTIONS),f=c.useMemo(()=>({fixedViews:[i],customViews:[],viewsMap:new Map([[i.id,i]])}),[]),{viewsMap:L,customViews:o,fixedViews:l}=c.useMemo(()=>n?n.reduce((s,r)=>{const t=E.viewsAdapter({view:r,canUpdateCustomViews:V});return s.viewsMap.set(r.id,t),r.editable?s.customViews.push(t):s.fixedViews.push(t),s},{fixedViews:[i],customViews:[],viewsMap:new Map([[i.id,i]])}):f,[n,f,V]),q=c.useMemo(()=>o.sort((s,r)=>{const t=Array.isArray(u)?u:[],a=t.indexOf(s.id),d=t.indexOf(r.id);return a===-1&&d===-1?0:a===-1?1:d===-1?-1:a-d}),[o,u]);return{defaultCustomViewId:p,viewsArray:[...l,...o],fixedViews:l,customViews:o,sortedCustomViews:q,viewsMap:L,isLoading:M||_,error:A,mutate:g}};exports.useViews=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("swr"),d=require("react"),q=require("./index49.cjs"),y=require("./index8.cjs"),A=require("./index65.cjs"),C=require("./index55.cjs"),S=require("./index80.cjs"),I=e=>e&&e.__esModule?e:{default:e},M=I(O),v=()=>{const{DEFAULT_PAGE_NUMBER:e,DEFAULT_PAGE_SIZE:f,VIEW_TYPE:o}=y.useBusinessLogic(),{canUpdateCustomViews:u,orderedListOfCustomViews:t,defaultCustomViewId:w,isLoading:V}=A.useCustomViews({type:o}),{data:n,isLoading:m,error:_,mutate:g}=M.default(`/api/v2/custom_views?filter[type]=${o}&page[number]=${e}&page[size]=${f}`,C.fetcherV2,q.SWR_HOOK_OPTIONS),{viewsMap:l,customViews:s,fixedViews:c}=d.useMemo(()=>S.organiseViews({data:n,canUpdateCustomViews:u}),[n,u]),L=d.useMemo(()=>s.sort((p,E)=>{const a=Array.isArray(t)?t:[],i=a.indexOf(p.id),r=a.indexOf(E.id);return i===-1&&r===-1?0:i===-1?1:r===-1?-1:i-r}),[s,t]);return{defaultCustomViewId:w,viewsArray:[...c,...s],fixedViews:c,customViews:s,sortedCustomViews:L,viewsMap:l,isLoading:m||V,error:_,mutate:g}};exports.useViews=v;
package/dist/index62.js CHANGED
@@ -1,54 +1,36 @@
1
- import g from "swr";
2
- import { useMemo as d } from "react";
3
- import { createAllView as O } from "./index79.js";
4
- import { viewsAdapter as v } from "./index78.js";
5
- import { useCustomViews as C } from "./index65.js";
6
- import { SWR_HOOK_OPTIONS as I } from "./index49.js";
7
- import { useBusinessLogic as y } from "./index8.js";
8
- import { fetcherV2 as S } from "./index55.js";
9
- const s = O(), B = () => {
10
- const { DEFAULT_PAGE_NUMBER: V, DEFAULT_PAGE_SIZE: c, VIEW_TYPE: a } = y(), {
11
- canUpdateCustomViews: w,
12
- orderedListOfCustomViews: o,
13
- defaultCustomViewId: l,
14
- isLoading: x
15
- } = C({ type: a }), { data: n, isLoading: A, error: L, mutate: E } = g(
16
- `/api/v2/custom_views?filter[type]=${a}&page[number]=${V}&page[size]=${c}`,
17
- S,
18
- I
19
- ), f = d(
20
- () => ({
21
- fixedViews: [s],
22
- customViews: [],
23
- viewsMap: /* @__PURE__ */ new Map([[s.id, s]])
24
- }),
25
- []
26
- ), { viewsMap: M, customViews: r, fixedViews: p } = d(() => n ? n.reduce(
27
- (e, t) => {
28
- const i = v({ view: t, canUpdateCustomViews: w });
29
- return e.viewsMap.set(t.id, i), t.editable ? e.customViews.push(i) : e.fixedViews.push(i), e;
30
- },
31
- {
32
- fixedViews: [s],
33
- customViews: [],
34
- viewsMap: /* @__PURE__ */ new Map([[s.id, s]])
35
- }
36
- ) : f, [n, f, w]), _ = d(() => r.sort((e, t) => {
37
- const i = Array.isArray(o) ? o : [], u = i.indexOf(e.id), m = i.indexOf(t.id);
38
- return u === -1 && m === -1 ? 0 : u === -1 ? 1 : m === -1 ? -1 : u - m;
39
- }), [r, o]);
1
+ import O from "swr";
2
+ import { useMemo as a } from "react";
3
+ import { SWR_HOOK_OPTIONS as x } from "./index49.js";
4
+ import { useBusinessLogic as C } from "./index8.js";
5
+ import { useCustomViews as I } from "./index65.js";
6
+ import { fetcherV2 as y } from "./index55.js";
7
+ import { organiseViews as v } from "./index80.js";
8
+ const $ = () => {
9
+ const { DEFAULT_PAGE_NUMBER: d, DEFAULT_PAGE_SIZE: f, VIEW_TYPE: t } = C(), {
10
+ canUpdateCustomViews: o,
11
+ orderedListOfCustomViews: r,
12
+ defaultCustomViewId: p,
13
+ isLoading: c
14
+ } = I({ type: t }), { data: n, isLoading: w, error: V, mutate: L } = O(
15
+ `/api/v2/custom_views?filter[type]=${t}&page[number]=${d}&page[size]=${f}`,
16
+ y,
17
+ x
18
+ ), { viewsMap: g, customViews: e, fixedViews: m } = a(() => v({ data: n, canUpdateCustomViews: o }), [n, o]), E = a(() => e.sort((_, A) => {
19
+ const u = Array.isArray(r) ? r : [], s = u.indexOf(_.id), i = u.indexOf(A.id);
20
+ return s === -1 && i === -1 ? 0 : s === -1 ? 1 : i === -1 ? -1 : s - i;
21
+ }), [e, r]);
40
22
  return {
41
- defaultCustomViewId: l,
42
- viewsArray: [...p, ...r],
43
- fixedViews: p,
44
- customViews: r,
45
- sortedCustomViews: _,
46
- viewsMap: M,
47
- isLoading: A || x,
48
- error: L,
49
- mutate: E
23
+ defaultCustomViewId: p,
24
+ viewsArray: [...m, ...e],
25
+ fixedViews: m,
26
+ customViews: e,
27
+ sortedCustomViews: E,
28
+ viewsMap: g,
29
+ isLoading: w || c,
30
+ error: V,
31
+ mutate: L
50
32
  };
51
33
  };
52
34
  export {
53
- B as useViews
35
+ $ as useViews
54
36
  };
package/dist/index7.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("axios"),i=require("./index81.cjs"),s=require("./index82.cjs"),l=require("./index83.cjs"),E=require("./index84.cjs"),p=t=>t&&t.__esModule?t:{default:t},c=p(u),y=async(t,a)=>{const o=new Error,r=s.filterOptionalArgsGetDelete(t,a);try{return await c.default.get(...r)}catch(e){throw l.filterErrorStack(o),E.injectIntoError({customError:o,originalError:e,type:i.AxiosErrorType.GET}),e}},f=async(t,a)=>{const o=new Error,r=s.filterOptionalArgsGetDelete(t,a);try{return await c.default.delete(...r)}catch(e){throw l.filterErrorStack(o),E.injectIntoError({customError:o,originalError:e,type:i.AxiosErrorType.DELETE}),e}},g=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.post(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.POST}),n}},w=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.patch(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PATCH}),n}},A=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.put(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PUT}),n}},d=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.postForm(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.POST_FORM}),n}},h=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.putForm(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PUT_FORM}),n}},T=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.patchForm(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PATCH_FORM}),n}},m={get:y,delete:f,post:g,patch:w,put:A,postForm:d,putForm:h,patchForm:T,CancelToken:c.default.CancelToken,isCancel:c.default.isCancel,getUri:c.default.getUri,isAxiosError:c.default.isAxiosError};exports.axios=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("axios"),i=require("./index82.cjs"),s=require("./index83.cjs"),l=require("./index84.cjs"),E=require("./index85.cjs"),p=t=>t&&t.__esModule?t:{default:t},c=p(u),y=async(t,a)=>{const o=new Error,r=s.filterOptionalArgsGetDelete(t,a);try{return await c.default.get(...r)}catch(e){throw l.filterErrorStack(o),E.injectIntoError({customError:o,originalError:e,type:i.AxiosErrorType.GET}),e}},f=async(t,a)=>{const o=new Error,r=s.filterOptionalArgsGetDelete(t,a);try{return await c.default.delete(...r)}catch(e){throw l.filterErrorStack(o),E.injectIntoError({customError:o,originalError:e,type:i.AxiosErrorType.DELETE}),e}},g=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.post(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.POST}),n}},w=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.patch(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PATCH}),n}},A=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.put(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PUT}),n}},d=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.postForm(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.POST_FORM}),n}},h=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.putForm(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PUT_FORM}),n}},T=async(t,a,o)=>{const r=new Error,e=s.filterOptionalArgs(t,a,o);try{return await c.default.patchForm(...e)}catch(n){throw l.filterErrorStack(r),E.injectIntoError({customError:r,originalError:n,type:i.AxiosErrorType.PATCH_FORM}),n}},m={get:y,delete:f,post:g,patch:w,put:A,postForm:d,putForm:h,patchForm:T,CancelToken:c.default.CancelToken,isCancel:c.default.isCancel,getUri:c.default.getUri,isAxiosError:c.default.isAxiosError};exports.axios=m;
package/dist/index7.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import a from "axios";
2
- import { AxiosErrorType as e } from "./index81.js";
3
- import { filterOptionalArgsGetDelete as y, filterOptionalArgs as p } from "./index82.js";
4
- import { filterErrorStack as i } from "./index83.js";
5
- import { injectIntoError as E } from "./index84.js";
2
+ import { AxiosErrorType as e } from "./index82.js";
3
+ import { filterOptionalArgsGetDelete as y, filterOptionalArgs as p } from "./index83.js";
4
+ import { filterErrorStack as i } from "./index84.js";
5
+ import { injectIntoError as E } from "./index85.js";
6
6
  const m = async (n, s) => {
7
7
  const o = new Error(), r = y(n, s);
8
8
  try {
package/dist/index80.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index61.cjs"),t=e=>{o.useStores.mockImplementation(()=>({...e}))};exports.mockUseStores=t;
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,9 +1,23 @@
1
- import { useStores as e } from "./index61.js";
2
- const m = (o) => {
3
- e.mockImplementation(() => ({
4
- ...o
5
- }));
1
+ import { INITIAL_VIEWS_STATE as r } from "./index98.js";
2
+ import { ALL_VIEW_ID as p } from "./index79.js";
3
+ import { viewsAdapter as u } from "./index78.js";
4
+ const m = ({ data: o, canUpdateCustomViews: w }) => {
5
+ const f = {
6
+ fixedViews: [...r.fixedViews],
7
+ customViews: [...r.customViews],
8
+ viewsMap: new Map(r.viewsMap)
9
+ };
10
+ if (!o) return f;
11
+ let l = !1;
12
+ const s = o.reduce(
13
+ (e, i) => {
14
+ const t = u({ view: i, canUpdateCustomViews: w });
15
+ return e.viewsMap.set(i.id, t), i.editable ? e.customViews.push(t) : e.fixedViews.push(t), i.title === "All" && (l = !0), e;
16
+ },
17
+ f
18
+ );
19
+ return l && (s.viewsMap.delete(p), s.fixedViews.shift()), s;
6
20
  };
7
21
  export {
8
- m as mockUseStores
22
+ m as organiseViews
9
23
  };
package/dist/index81.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var P=(t=>(t.GET="AxiosGet",t.DELETE="AxiosDelete",t.POST="AxiosPost",t.PATCH="AxiosPatch",t.PUT="AxiosPut",t.POST_FORM="AxioPostForm",t.PUT_FORM="AxiosPutForm",t.PATCH_FORM="AxiosPatchForm",t))(P||{});exports.AxiosErrorType=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index61.cjs"),t=e=>{o.useStores.mockImplementation(()=>({...e}))};exports.mockUseStores=t;
package/dist/index81.js CHANGED
@@ -1,4 +1,9 @@
1
- var t = /* @__PURE__ */ ((P) => (P.GET = "AxiosGet", P.DELETE = "AxiosDelete", P.POST = "AxiosPost", P.PATCH = "AxiosPatch", P.PUT = "AxiosPut", P.POST_FORM = "AxioPostForm", P.PUT_FORM = "AxiosPutForm", P.PATCH_FORM = "AxiosPatchForm", P))(t || {});
1
+ import { useStores as e } from "./index61.js";
2
+ const m = (o) => {
3
+ e.mockImplementation(() => ({
4
+ ...o
5
+ }));
6
+ };
2
7
  export {
3
- t as AxiosErrorType
8
+ m as mockUseStores
4
9
  };
package/dist/index82.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=(r,t)=>{const e=[r];return t!==void 0&&e.push(t),e},l=(r,t,e)=>{const i=[r];return t!==void 0&&i.push(t),e!==void 0&&i.push(e),i};exports.filterOptionalArgs=l;exports.filterOptionalArgsGetDelete=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var P=(t=>(t.GET="AxiosGet",t.DELETE="AxiosDelete",t.POST="AxiosPost",t.PATCH="AxiosPatch",t.PUT="AxiosPut",t.POST_FORM="AxioPostForm",t.PUT_FORM="AxiosPutForm",t.PATCH_FORM="AxiosPatchForm",t))(P||{});exports.AxiosErrorType=P;
package/dist/index82.js CHANGED
@@ -1,11 +1,4 @@
1
- const i = (s, t) => {
2
- const r = [s];
3
- return t !== void 0 && r.push(t), r;
4
- }, o = (s, t, r) => {
5
- const e = [s];
6
- return t !== void 0 && e.push(t), r !== void 0 && e.push(r), e;
7
- };
1
+ var t = /* @__PURE__ */ ((P) => (P.GET = "AxiosGet", P.DELETE = "AxiosDelete", P.POST = "AxiosPost", P.PATCH = "AxiosPatch", P.PUT = "AxiosPut", P.POST_FORM = "AxioPostForm", P.PUT_FORM = "AxiosPutForm", P.PATCH_FORM = "AxiosPatchForm", P))(t || {});
8
2
  export {
9
- o as filterOptionalArgs,
10
- i as filterOptionalArgsGetDelete
3
+ t as AxiosErrorType
11
4
  };
package/dist/index83.cjs CHANGED
@@ -1,3 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index105.cjs"),s=e=>{if(!l.isError(e))return e;if(e.stack){const t=e.stack.split(`
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
- `);e.stack=r}return e};exports.filterErrorStack=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=(r,t)=>{const e=[r];return t!==void 0&&e.push(t),e},l=(r,t,e)=>{const i=[r];return t!==void 0&&i.push(t),e!==void 0&&i.push(e),i};exports.filterOptionalArgs=l;exports.filterOptionalArgsGetDelete=s;
package/dist/index83.js CHANGED
@@ -1,16 +1,11 @@
1
- import { isError as l } from "./index105.js";
2
- const s = (e) => {
3
- if (!l(e)) return e;
4
- if (e.stack) {
5
- const n = e.stack.split(`
6
- `);
7
- if (n.length <= 10) return e;
8
- const i = n == null ? void 0 : n[0], t = n == null ? void 0 : n.splice(9), f = [i, ...t].join(`
9
- `);
10
- e.stack = f;
11
- }
12
- return e;
1
+ const i = (s, t) => {
2
+ const r = [s];
3
+ return t !== void 0 && r.push(t), r;
4
+ }, o = (s, t, r) => {
5
+ const e = [s];
6
+ return t !== void 0 && e.push(t), r !== void 0 && e.push(r), e;
13
7
  };
14
8
  export {
15
- s as filterErrorStack
9
+ o as filterOptionalArgs,
10
+ i as filterOptionalArgsGetDelete
16
11
  };
package/dist/index84.cjs CHANGED
@@ -1 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index105.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 l=require("./index111.cjs"),s=e=>{if(!l.isError(e))return e;if(e.stack){const t=e.stack.split(`
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
+ `);e.stack=r}return e};exports.filterErrorStack=s;