@veeqo/transfigure 1.1.2 → 1.1.4

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 (233) hide show
  1. package/dist/BusinessLogic/mocks.d.ts +1 -1
  2. package/dist/BusinessLogic/types.d.ts +2 -1
  3. package/dist/hooks/useUrlParams/useUrlParams.d.ts +1 -0
  4. package/dist/hooks/useUrlParams/useUrlParams.test.d.ts +1 -0
  5. package/dist/index.cjs +1 -1
  6. package/dist/index.js +160 -158
  7. package/dist/index10.cjs +1 -1
  8. package/dist/index10.js +184 -18
  9. package/dist/index100.cjs +19 -1
  10. package/dist/index100.js +24 -21
  11. package/dist/index101.cjs +1 -1
  12. package/dist/index101.js +15 -24
  13. package/dist/index102.cjs +1 -80
  14. package/dist/index102.js +21 -101
  15. package/dist/index103.cjs +80 -1
  16. package/dist/index103.js +101 -19
  17. package/dist/index104.cjs +1 -1
  18. package/dist/index104.js +2 -8
  19. package/dist/index105.cjs +1 -1
  20. package/dist/index105.js +17 -62
  21. package/dist/index106.cjs +1 -1
  22. package/dist/index106.js +7 -29
  23. package/dist/index107.cjs +1 -1
  24. package/dist/index107.js +64 -2
  25. package/dist/index108.cjs +1 -13
  26. package/dist/index108.js +30 -17
  27. package/dist/index109.cjs +13 -1
  28. package/dist/index109.js +14 -33
  29. package/dist/index11.cjs +1 -1
  30. package/dist/index11.js +18 -21
  31. package/dist/index110.cjs +1 -1
  32. package/dist/index110.js +32 -22
  33. package/dist/index111.cjs +1 -7
  34. package/dist/index111.js +26 -10
  35. package/dist/index112.cjs +1 -1
  36. package/dist/index112.js +1 -1
  37. package/dist/index113.cjs +7 -1
  38. package/dist/index113.js +10 -47
  39. package/dist/index114.cjs +1 -0
  40. package/dist/index114.js +49 -0
  41. package/dist/index12.cjs +1 -1
  42. package/dist/index12.js +19 -41
  43. package/dist/index13.cjs +1 -1
  44. package/dist/index13.js +41 -23
  45. package/dist/index14.cjs +1 -1
  46. package/dist/index14.js +24 -36
  47. package/dist/index15.cjs +1 -1
  48. package/dist/index15.js +37 -33
  49. package/dist/index16.cjs +1 -1
  50. package/dist/index16.js +32 -49
  51. package/dist/index17.cjs +1 -1
  52. package/dist/index17.js +47 -38
  53. package/dist/index18.cjs +1 -1
  54. package/dist/index18.js +29 -29
  55. package/dist/index19.cjs +1 -1
  56. package/dist/index19.js +41 -58
  57. package/dist/index2.cjs +1 -1
  58. package/dist/index2.js +2 -5
  59. package/dist/index20.cjs +1 -1
  60. package/dist/index20.js +48 -42
  61. package/dist/index21.cjs +1 -1
  62. package/dist/index21.js +50 -44
  63. package/dist/index22.cjs +1 -1
  64. package/dist/index22.js +46 -7
  65. package/dist/index23.cjs +1 -1
  66. package/dist/index23.js +7 -11
  67. package/dist/index24.cjs +1 -1
  68. package/dist/index24.js +11 -64
  69. package/dist/index25.cjs +1 -1
  70. package/dist/index25.js +40 -39
  71. package/dist/index26.cjs +1 -1
  72. package/dist/index26.js +60 -37
  73. package/dist/index27.cjs +1 -1
  74. package/dist/index27.js +36 -53
  75. package/dist/index28.cjs +1 -1
  76. package/dist/index28.js +54 -51
  77. package/dist/index29.cjs +1 -1
  78. package/dist/index29.js +50 -81
  79. package/dist/index3.cjs +1 -1
  80. package/dist/index3.js +5 -5
  81. package/dist/index30.cjs +1 -1
  82. package/dist/index30.js +81 -35
  83. package/dist/index31.cjs +1 -1
  84. package/dist/index31.js +38 -33
  85. package/dist/index32.cjs +1 -1
  86. package/dist/index32.js +33 -10
  87. package/dist/index33.cjs +1 -1
  88. package/dist/index33.js +10 -39
  89. package/dist/index34.cjs +1 -1
  90. package/dist/index34.js +38 -102
  91. package/dist/index35.cjs +1 -1
  92. package/dist/index35.js +103 -19
  93. package/dist/index36.cjs +1 -1
  94. package/dist/index36.js +17 -134
  95. package/dist/index37.cjs +1 -1
  96. package/dist/index37.js +135 -49
  97. package/dist/index38.cjs +1 -1
  98. package/dist/index38.js +51 -32
  99. package/dist/index39.cjs +1 -1
  100. package/dist/index39.js +31 -53
  101. package/dist/index4.cjs +1 -1
  102. package/dist/index4.js +5 -5
  103. package/dist/index40.cjs +1 -1
  104. package/dist/index40.js +54 -48
  105. package/dist/index41.cjs +1 -1
  106. package/dist/index41.js +41 -81
  107. package/dist/index42.cjs +1 -1
  108. package/dist/index42.js +81 -41
  109. package/dist/index43.cjs +1 -1
  110. package/dist/index43.js +48 -5
  111. package/dist/index44.cjs +1 -1
  112. package/dist/index44.js +5 -45
  113. package/dist/index45.cjs +1 -1
  114. package/dist/index45.js +44 -38
  115. package/dist/index46.cjs +1 -1
  116. package/dist/index46.js +39 -19
  117. package/dist/index47.cjs +1 -1
  118. package/dist/index47.js +19 -8
  119. package/dist/index48.cjs +1 -1
  120. package/dist/index48.js +7 -22
  121. package/dist/index49.cjs +1 -1
  122. package/dist/index49.js +23 -2
  123. package/dist/index5.cjs +1 -1
  124. package/dist/index5.js +5 -9
  125. package/dist/index50.cjs +1 -1
  126. package/dist/index50.js +2 -4
  127. package/dist/index51.cjs +1 -1
  128. package/dist/index51.js +4 -11
  129. package/dist/index52.cjs +1 -1
  130. package/dist/index52.js +10 -12
  131. package/dist/index53.cjs +1 -1
  132. package/dist/index53.js +12 -11
  133. package/dist/index54.cjs +1 -1
  134. package/dist/index54.js +11 -184
  135. package/dist/index55.cjs +1 -1
  136. package/dist/index55.js +183 -25
  137. package/dist/index56.cjs +1 -1
  138. package/dist/index56.js +26 -24
  139. package/dist/index57.cjs +1 -1
  140. package/dist/index57.js +19 -22
  141. package/dist/index58.cjs +1 -1
  142. package/dist/index58.js +25 -97
  143. package/dist/index59.cjs +1 -1
  144. package/dist/index59.js +99 -8
  145. package/dist/index6.cjs +1 -1
  146. package/dist/index6.js +8 -75
  147. package/dist/index60.cjs +1 -1
  148. package/dist/index60.js +8 -51
  149. package/dist/index61.cjs +1 -1
  150. package/dist/index61.js +50 -60
  151. package/dist/index62.cjs +1 -1
  152. package/dist/index62.js +57 -18
  153. package/dist/index63.cjs +1 -1
  154. package/dist/index63.js +22 -18
  155. package/dist/index64.cjs +1 -1
  156. package/dist/index64.js +16 -26
  157. package/dist/index65.cjs +1 -1
  158. package/dist/index65.js +26 -10
  159. package/dist/index66.cjs +1 -1
  160. package/dist/index66.js +57 -331
  161. package/dist/index67.cjs +1 -1
  162. package/dist/index67.js +337 -55
  163. package/dist/index68.cjs +1 -1
  164. package/dist/index68.js +50 -47
  165. package/dist/index69.cjs +1 -1
  166. package/dist/index69.js +51 -32
  167. package/dist/index7.cjs +1 -1
  168. package/dist/index7.js +76 -4
  169. package/dist/index70.cjs +1 -1
  170. package/dist/index70.js +30 -24
  171. package/dist/index71.cjs +1 -1
  172. package/dist/index71.js +26 -32
  173. package/dist/index72.cjs +1 -1
  174. package/dist/index72.js +37 -12
  175. package/dist/index73.cjs +1 -1
  176. package/dist/index73.js +13 -9
  177. package/dist/index74.cjs +1 -1
  178. package/dist/index74.js +9 -17
  179. package/dist/index75.cjs +1 -1
  180. package/dist/index75.js +14 -16
  181. package/dist/index76.cjs +1 -1
  182. package/dist/index76.js +18 -49
  183. package/dist/index77.cjs +1 -1
  184. package/dist/index77.js +50 -21
  185. package/dist/index78.cjs +1 -1
  186. package/dist/index78.js +21 -7
  187. package/dist/index79.cjs +1 -1
  188. package/dist/index79.js +7 -2
  189. package/dist/index8.cjs +1 -1
  190. package/dist/index8.js +4 -14
  191. package/dist/index80.cjs +1 -1
  192. package/dist/index80.js +2 -9
  193. package/dist/index81.cjs +1 -3
  194. package/dist/index81.js +8 -13
  195. package/dist/index82.cjs +3 -1
  196. package/dist/index82.js +13 -8
  197. package/dist/index83.cjs +1 -1
  198. package/dist/index83.js +7 -116
  199. package/dist/index84.cjs +1 -1
  200. package/dist/index84.js +117 -18
  201. package/dist/index85.cjs +1 -11
  202. package/dist/index85.js +19 -16
  203. package/dist/index86.cjs +11 -1
  204. package/dist/index86.js +16 -41
  205. package/dist/index87.cjs +1 -1
  206. package/dist/index87.js +40 -8
  207. package/dist/index88.cjs +1 -1
  208. package/dist/index88.js +9 -13
  209. package/dist/index89.cjs +1 -104
  210. package/dist/index89.js +13 -120
  211. package/dist/index9.cjs +1 -1
  212. package/dist/index9.js +13 -181
  213. package/dist/index90.cjs +104 -1
  214. package/dist/index90.js +117 -65
  215. package/dist/index91.cjs +1 -1
  216. package/dist/index91.js +63 -24
  217. package/dist/index92.cjs +1 -1
  218. package/dist/index92.js +29 -2
  219. package/dist/index93.cjs +1 -1
  220. package/dist/index93.js +2 -41
  221. package/dist/index94.cjs +1 -1
  222. package/dist/index94.js +39 -9
  223. package/dist/index95.cjs +1 -1
  224. package/dist/index95.js +10 -14
  225. package/dist/index96.cjs +1 -12
  226. package/dist/index96.js +24 -16
  227. package/dist/index97.cjs +1 -1
  228. package/dist/index97.js +4 -4
  229. package/dist/index99.cjs +11 -18
  230. package/dist/index99.js +12 -20
  231. package/dist/mobx/Filters/Filters.d.ts +1 -1
  232. package/dist/types.d.ts +4 -0
  233. package/package.json +1 -1
package/dist/index39.js CHANGED
@@ -1,56 +1,34 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useState as f, useEffect as l } from "react";
3
- import { LegacySortableViews as w } from "./index95.js";
4
- import { useCustomViews as d } from "./index63.js";
5
- import { useViews as g } from "./index60.js";
6
- import { patchCurrentUser as _ } from "./index3.js";
7
- import { useBusinessLogic as S } from "./index7.js";
8
- import { useStores as b } from "./index59.js";
9
- import { ErrorBoundary as v } from "./index10.js";
10
- const T = () => {
11
- const { VIEW_TYPE: m } = S(), { sortedCustomViews: s, isLoading: a } = g(), { mutate: n } = d({ type: m }), [u, e] = f(s);
12
- l(() => {
13
- e(s);
14
- }, [s]);
15
- const { Notifications: { notify: c } } = b(), p = async (o) => {
16
- e(o);
17
- const i = o.map((t) => t.id);
18
- try {
19
- await _({
20
- user_setting_attributes: {
21
- custom_view_positions: {
22
- order: i
23
- }
1
+ import { jsxs as f, Fragment as p, jsx as r } from "react/jsx-runtime";
2
+ import { observer as h } from "mobx-react";
3
+ import { useViews as v } from "./index61.js";
4
+ import { AnimatePresence as n } from "framer-motion";
5
+ import { useStores as g } from "./index60.js";
6
+ import { DraftPill as w } from "./index102.js";
7
+ import { UnsavedChangesPill as C } from "./index41.js";
8
+ const U = h(
9
+ ({
10
+ tabType: e,
11
+ isActive: o,
12
+ shouldShowCreateViewNotification: m,
13
+ handleSaveDraft: i
14
+ }) => {
15
+ var t;
16
+ const {
17
+ Filters: { hasUnsavedChanges: a, discardChanges: c, activeViewId: s }
18
+ } = g(), { viewsMap: l } = v(), d = s && ((t = l.get(s)) == null ? void 0 : t.label);
19
+ return /* @__PURE__ */ f(p, { children: [
20
+ /* @__PURE__ */ r(n, { children: e === "draft" && o && m && /* @__PURE__ */ r(w, { onClick: i }) }),
21
+ /* @__PURE__ */ r(n, { children: a && o && e === "saved" && /* @__PURE__ */ r(
22
+ C,
23
+ {
24
+ viewName: d,
25
+ onDiscard: () => c(),
26
+ onSaveDraft: i
24
27
  }
25
- }), await n(
26
- (t) => ({
27
- ...t,
28
- settings: {
29
- ...t.settings,
30
- custom_view_positions: {
31
- ...t.settings.custom_view_positions,
32
- order: i
33
- }
34
- }
35
- }),
36
- { revalidate: !1 }
37
- );
38
- } catch {
39
- e(s), c({
40
- type: "error",
41
- text: "Failed to update order of views"
42
- });
43
- }
44
- };
45
- return a || !s.length ? null : /* @__PURE__ */ r(v, { children: /* @__PURE__ */ r(
46
- w,
47
- {
48
- views: u,
49
- onChange: p,
50
- className: "act-sortable-views"
51
- }
52
- ) });
53
- };
28
+ ) })
29
+ ] });
30
+ }
31
+ );
54
32
  export {
55
- T as SortableViews
33
+ U as PillNotifications
56
34
  };
package/dist/index4.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index6.cjs"),i=require("./index51.cjs"),o=require("./index52.cjs"),a=(t,{attributes:e})=>s.axios.patch(`/api/v2/custom_views/${t}`,{data:{attributes:e,type:"custom_view"}},i.withCSRF(o.vndAPI));exports.patchCustomView=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index7.cjs"),t=require("./index52.cjs"),s=require("./index53.cjs"),n=(r={})=>e.axios.patch("/current_user",{user:r},t.withCSRF(s.vndAPI));exports.patchCurrentUser=n;
package/dist/index4.js CHANGED
@@ -1,7 +1,7 @@
1
- import { axios as i } from "./index6.js";
2
- import { withCSRF as m } from "./index51.js";
3
- import { vndAPI as p } from "./index52.js";
4
- const c = (t, { attributes: o }) => i.patch(`/api/v2/custom_views/${t}`, { data: { attributes: o, type: "custom_view" } }, m(p));
1
+ import { axios as t } from "./index7.js";
2
+ import { withCSRF as o } from "./index52.js";
3
+ import { vndAPI as e } from "./index53.js";
4
+ const s = (r = {}) => t.patch("/current_user", { user: r }, o(e));
5
5
  export {
6
- c as patchCustomView
6
+ s as patchCurrentUser
7
7
  };
package/dist/index40.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("./index58.cjs"),n=require("./index102.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 i=require("react/jsx-runtime"),n=require("react"),m=require("./index101.cjs"),g=require("./index64.cjs"),S=require("./index61.cjs"),b=require("./index4.cjs"),y=require("./index8.cjs"),V=require("./index60.cjs"),p=require("./index11.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/index40.js CHANGED
@@ -1,50 +1,56 @@
1
- import { jsx as n, jsxs as e } from "react/jsx-runtime";
2
- import { Stack as t, theme as d, Button as h, ActionMenu as o } from "@veeqo/ui";
3
- import { observer as m } from "mobx-react";
4
- import { usePersistUnsavedChanges as v } from "./index58.js";
5
- import { Notification as b, Container as g, Glyph as p, Wrap as u, Text as i, Bold as y } from "./index102.js";
6
- const C = d.colors.secondary.blue.base, k = m(({
7
- onDiscard: c,
8
- viewName: r,
9
- onSaveDraft: s
10
- }) => {
11
- const { saveChanges: l, isSubmitting: a } = v();
12
- return /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(g, { children: /* @__PURE__ */ e(t, { direction: "horizontal", alignY: "center", children: [
13
- /* @__PURE__ */ n(p, { ariaLabel: "attention", name: "attention", color: C }),
14
- /* @__PURE__ */ e(u, { children: [
15
- /* @__PURE__ */ n(i, { variant: "body", margin: "0 4px 0 0", children: "You have unsaved changes to" }),
16
- r && /* @__PURE__ */ e(y, { variant: "bodyBoldDark", children: [
17
- "'",
18
- r,
19
- "'"
20
- ] })
21
- ] }),
22
- /* @__PURE__ */ n(
23
- h,
24
- {
25
- onClick: c,
26
- size: "sm",
27
- children: "Discard changes"
28
- }
29
- ),
30
- /* @__PURE__ */ e(
31
- o,
32
- {
33
- ctaProps: {
34
- children: "Save changes",
35
- variant: "primary"
36
- },
37
- children: [
38
- /* @__PURE__ */ n(o.Item, { onAction: s, isDisabled: a, children: /* @__PURE__ */ n(i, { variant: "body", children: "Create new view" }) }),
39
- /* @__PURE__ */ n(o.Item, { onAction: l, isDisabled: a, children: /* @__PURE__ */ e(t, { direction: "horizontal", spacing: 1, alignY: "center", children: [
40
- /* @__PURE__ */ n(i, { variant: "body", children: "Save changes to" }),
41
- /* @__PURE__ */ n(i, { variant: "bodyBold", children: r })
42
- ] }) })
43
- ]
44
- }
45
- )
46
- ] }) }) });
47
- });
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { useState as f, useEffect as l } from "react";
3
+ import { LegacySortableViews as w } from "./index101.js";
4
+ import { useCustomViews as d } from "./index64.js";
5
+ import { useViews as g } from "./index61.js";
6
+ import { patchCurrentUser as _ } from "./index4.js";
7
+ import { useBusinessLogic as S } from "./index8.js";
8
+ import { useStores as b } from "./index60.js";
9
+ import { ErrorBoundary as v } from "./index11.js";
10
+ const T = () => {
11
+ const { VIEW_TYPE: m } = S(), { sortedCustomViews: s, isLoading: a } = g(), { mutate: n } = d({ type: m }), [u, e] = f(s);
12
+ l(() => {
13
+ e(s);
14
+ }, [s]);
15
+ const { Notifications: { notify: c } } = b(), p = async (o) => {
16
+ e(o);
17
+ const i = o.map((t) => t.id);
18
+ try {
19
+ await _({
20
+ user_setting_attributes: {
21
+ custom_view_positions: {
22
+ order: i
23
+ }
24
+ }
25
+ }), await n(
26
+ (t) => ({
27
+ ...t,
28
+ settings: {
29
+ ...t.settings,
30
+ custom_view_positions: {
31
+ ...t.settings.custom_view_positions,
32
+ order: i
33
+ }
34
+ }
35
+ }),
36
+ { revalidate: !1 }
37
+ );
38
+ } catch {
39
+ e(s), c({
40
+ type: "error",
41
+ text: "Failed to update order of views"
42
+ });
43
+ }
44
+ };
45
+ return a || !s.length ? null : /* @__PURE__ */ r(v, { children: /* @__PURE__ */ r(
46
+ w,
47
+ {
48
+ views: u,
49
+ onChange: p,
50
+ className: "act-sortable-views"
51
+ }
52
+ ) });
53
+ };
48
54
  export {
49
- k as UnsavedChangesPill
55
+ T as SortableViews
50
56
  };
package/dist/index41.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@veeqo/ui"),p=require("./index43.cjs"),O=require("./index37.cjs"),c=require("./index36.cjs"),P=({referenceElement:t,tab:o,create:{handleCreate:w,closeCreateDropdown:u},menu:{handleSave:v,handleDuplicate:m,handleMakeDefault:x,closeDropdown:n},edit:{handleShowEditDropdown:S,closeEditDropdown:h},delete:{handleShowDeleteConfirmation:i,handleDelete:D},shouldShowDropdown:d,shouldShowEditDropdown:s,shouldShowCreateDropdown:l})=>{const a=o.isShared?p.SHARING_OPTIONS.COMPANY:p.SHARING_OPTIONS.PERSONAL;return e.jsxs(e.Fragment,{children:[d&&e.jsx(r.Popover,{anchorElement:t,placement:"bottom-start",onShouldClose:n,id:"options-dropdown",children:e.jsx(O.OptionsDropdown,{tab:o,onMakeDefault:x,onDelete:i,onDuplicate:m,onEdit:S,shouldShowDropdown:d,handleCloseDropdown:n})}),s&&e.jsx(r.Popover,{anchorElement:t,placement:"bottom-start",onShouldClose:n,id:"edit-dropdown",children:e.jsx(c.EditDropdown,{e2ePrefix:"edit-view-dropdown",viewName:o.label,shouldShowDropdown:s,onCloseDropdown:h,onSave:v,onDelete:D,headerText:"Edit view",tab:o,activeOption:a})}),l&&e.jsx(r.Popover,{anchorElement:t,placement:"bottom-start",onShouldClose:n,id:"create-dropdown",children:e.jsx(c.EditDropdown,{e2ePrefix:"create-view-dropdown",viewName:o.label,shouldShowDropdown:l,onCloseDropdown:u,onSave:w,onDelete:i,headerText:"Create new view",tab:o,activeOption:a})})]})};exports.ViewDropdowns=P;
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("./index59.cjs"),n=require("./index103.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/index41.js CHANGED
@@ -1,90 +1,50 @@
1
- import { jsxs as D, Fragment as N, jsx as o } from "react/jsx-runtime";
2
- import { Popover as r } from "@veeqo/ui";
3
- import { SHARING_OPTIONS as m } from "./index43.js";
4
- import { OptionsDropdown as O } from "./index37.js";
5
- import { EditDropdown as s } from "./index36.js";
6
- const j = ({
7
- referenceElement: n,
8
- tab: e,
9
- create: { handleCreate: w, closeCreateDropdown: c },
10
- menu: { handleSave: h, handleDuplicate: v, handleMakeDefault: x, closeDropdown: t },
11
- edit: { handleShowEditDropdown: S, closeEditDropdown: u },
12
- delete: { handleShowDeleteConfirmation: d, handleDelete: C },
13
- shouldShowDropdown: i,
14
- shouldShowEditDropdown: l,
15
- shouldShowCreateDropdown: p
1
+ import { jsx as n, jsxs as e } from "react/jsx-runtime";
2
+ import { Stack as t, theme as d, Button as h, ActionMenu as o } from "@veeqo/ui";
3
+ import { observer as m } from "mobx-react";
4
+ import { usePersistUnsavedChanges as v } from "./index59.js";
5
+ import { Notification as b, Container as g, Glyph as p, Wrap as u, Text as i, Bold as y } from "./index103.js";
6
+ const C = d.colors.secondary.blue.base, k = m(({
7
+ onDiscard: c,
8
+ viewName: r,
9
+ onSaveDraft: s
16
10
  }) => {
17
- const a = e.isShared ? m.COMPANY : m.PERSONAL;
18
- return /* @__PURE__ */ D(N, { children: [
19
- i && /* @__PURE__ */ o(
20
- r,
11
+ const { saveChanges: l, isSubmitting: a } = v();
12
+ return /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(g, { children: /* @__PURE__ */ e(t, { direction: "horizontal", alignY: "center", children: [
13
+ /* @__PURE__ */ n(p, { ariaLabel: "attention", name: "attention", color: C }),
14
+ /* @__PURE__ */ e(u, { children: [
15
+ /* @__PURE__ */ n(i, { variant: "body", margin: "0 4px 0 0", children: "You have unsaved changes to" }),
16
+ r && /* @__PURE__ */ e(y, { variant: "bodyBoldDark", children: [
17
+ "'",
18
+ r,
19
+ "'"
20
+ ] })
21
+ ] }),
22
+ /* @__PURE__ */ n(
23
+ h,
21
24
  {
22
- anchorElement: n,
23
- placement: "bottom-start",
24
- onShouldClose: t,
25
- id: "options-dropdown",
26
- children: /* @__PURE__ */ o(
27
- O,
28
- {
29
- tab: e,
30
- onMakeDefault: x,
31
- onDelete: d,
32
- onDuplicate: v,
33
- onEdit: S,
34
- shouldShowDropdown: i,
35
- handleCloseDropdown: t
36
- }
37
- )
25
+ onClick: c,
26
+ size: "sm",
27
+ children: "Discard changes"
38
28
  }
39
29
  ),
40
- l && /* @__PURE__ */ o(
41
- r,
30
+ /* @__PURE__ */ e(
31
+ o,
42
32
  {
43
- anchorElement: n,
44
- placement: "bottom-start",
45
- onShouldClose: t,
46
- id: "edit-dropdown",
47
- children: /* @__PURE__ */ o(
48
- s,
49
- {
50
- e2ePrefix: "edit-view-dropdown",
51
- viewName: e.label,
52
- shouldShowDropdown: l,
53
- onCloseDropdown: u,
54
- onSave: h,
55
- onDelete: C,
56
- headerText: "Edit view",
57
- tab: e,
58
- activeOption: a
59
- }
60
- )
61
- }
62
- ),
63
- p && /* @__PURE__ */ o(
64
- r,
65
- {
66
- anchorElement: n,
67
- placement: "bottom-start",
68
- onShouldClose: t,
69
- id: "create-dropdown",
70
- children: /* @__PURE__ */ o(
71
- s,
72
- {
73
- e2ePrefix: "create-view-dropdown",
74
- viewName: e.label,
75
- shouldShowDropdown: p,
76
- onCloseDropdown: c,
77
- onSave: w,
78
- onDelete: d,
79
- headerText: "Create new view",
80
- tab: e,
81
- activeOption: a
82
- }
83
- )
33
+ ctaProps: {
34
+ children: "Save changes",
35
+ variant: "primary"
36
+ },
37
+ children: [
38
+ /* @__PURE__ */ n(o.Item, { onAction: s, isDisabled: a, children: /* @__PURE__ */ n(i, { variant: "body", children: "Create new view" }) }),
39
+ /* @__PURE__ */ n(o.Item, { onAction: l, isDisabled: a, children: /* @__PURE__ */ e(t, { direction: "horizontal", spacing: 1, alignY: "center", children: [
40
+ /* @__PURE__ */ n(i, { variant: "body", children: "Save changes to" }),
41
+ /* @__PURE__ */ n(i, { variant: "bodyBold", children: r })
42
+ ] }) })
43
+ ]
84
44
  }
85
45
  )
86
- ] });
87
- };
46
+ ] }) }) });
47
+ });
88
48
  export {
89
- j as ViewDropdowns
49
+ k as UnsavedChangesPill
90
50
  };
package/dist/index42.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("./index96.cjs"),j=require("./index39.cjs"),m=require("./index60.cjs"),S=require("./index61.cjs"),q=require("./index35.cjs"),u=require("./index34.cjs"),p=require("./index59.cjs"),a=require("./index10.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"),r=require("@veeqo/ui"),p=require("./index44.cjs"),O=require("./index38.cjs"),c=require("./index37.cjs"),P=({referenceElement:t,tab:o,create:{handleCreate:w,closeCreateDropdown:u},menu:{handleSave:v,handleDuplicate:m,handleMakeDefault:x,closeDropdown:n},edit:{handleShowEditDropdown:S,closeEditDropdown:h},delete:{handleShowDeleteConfirmation:i,handleDelete:D},shouldShowDropdown:d,shouldShowEditDropdown:s,shouldShowCreateDropdown:l})=>{const a=o.isShared?p.SHARING_OPTIONS.COMPANY:p.SHARING_OPTIONS.PERSONAL;return e.jsxs(e.Fragment,{children:[d&&e.jsx(r.Popover,{anchorElement:t,placement:"bottom-start",onShouldClose:n,id:"options-dropdown",children:e.jsx(O.OptionsDropdown,{tab:o,onMakeDefault:x,onDelete:i,onDuplicate:m,onEdit:S,shouldShowDropdown:d,handleCloseDropdown:n})}),s&&e.jsx(r.Popover,{anchorElement:t,placement:"bottom-start",onShouldClose:n,id:"edit-dropdown",children:e.jsx(c.EditDropdown,{e2ePrefix:"edit-view-dropdown",viewName:o.label,shouldShowDropdown:s,onCloseDropdown:h,onSave:v,onDelete:D,headerText:"Edit view",tab:o,activeOption:a})}),l&&e.jsx(r.Popover,{anchorElement:t,placement:"bottom-start",onShouldClose:n,id:"create-dropdown",children:e.jsx(c.EditDropdown,{e2ePrefix:"create-view-dropdown",viewName:o.label,shouldShowDropdown:l,onCloseDropdown:u,onSave:w,onDelete:i,headerText:"Create new view",tab:o,activeOption:a})})]})};exports.ViewDropdowns=P;
package/dist/index42.js CHANGED
@@ -1,50 +1,90 @@
1
- import { jsxs as i, Fragment as u, jsx as e } from "react/jsx-runtime";
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 "./index96.js";
6
- import { SortableViews as b } from "./index39.js";
7
- import { useViews as A } from "./index60.js";
8
- import { useViewUrlChange as L } from "./index61.js";
9
- import { CreateView as M } from "./index35.js";
10
- import { ViewTab as s } from "./index34.js";
11
- import { useStores as T } from "./index59.js";
12
- import { ErrorBoundary as m } from "./index10.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,
1
+ import { jsxs as D, Fragment as N, jsx as o } from "react/jsx-runtime";
2
+ import { Popover as r } from "@veeqo/ui";
3
+ import { SHARING_OPTIONS as m } from "./index44.js";
4
+ import { OptionsDropdown as O } from "./index38.js";
5
+ import { EditDropdown as s } from "./index37.js";
6
+ const j = ({
7
+ referenceElement: n,
8
+ tab: e,
9
+ create: { handleCreate: w, closeCreateDropdown: c },
10
+ menu: { handleSave: h, handleDuplicate: v, handleMakeDefault: x, closeDropdown: t },
11
+ edit: { handleShowEditDropdown: S, closeEditDropdown: u },
12
+ delete: { handleShowDeleteConfirmation: d, handleDelete: C },
13
+ shouldShowDropdown: i,
14
+ shouldShowEditDropdown: l,
15
+ shouldShowCreateDropdown: p
16
+ }) => {
17
+ const a = e.isShared ? m.COMPANY : m.PERSONAL;
18
+ return /* @__PURE__ */ D(N, { children: [
19
+ i && /* @__PURE__ */ o(
20
+ r,
20
21
  {
21
- onClickMenu: () => o(!0),
22
- ariaMenuControls: "views-menu",
23
- ariaMenuExpanded: t,
24
- ref: c,
25
- 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
- ]
22
+ anchorElement: n,
23
+ placement: "bottom-start",
24
+ onShouldClose: t,
25
+ id: "options-dropdown",
26
+ children: /* @__PURE__ */ o(
27
+ O,
28
+ {
29
+ tab: e,
30
+ onMakeDefault: x,
31
+ onDelete: d,
32
+ onDuplicate: v,
33
+ onEdit: S,
34
+ shouldShowDropdown: i,
35
+ handleCloseDropdown: t
36
+ }
37
+ )
29
38
  }
30
39
  ),
31
- t && /* @__PURE__ */ e(
32
- V,
40
+ l && /* @__PURE__ */ o(
41
+ r,
33
42
  {
34
- id: "views-menu",
35
- anchorElement: p,
36
- 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 })
43
- ] })
43
+ anchorElement: n,
44
+ placement: "bottom-start",
45
+ onShouldClose: t,
46
+ id: "edit-dropdown",
47
+ children: /* @__PURE__ */ o(
48
+ s,
49
+ {
50
+ e2ePrefix: "edit-view-dropdown",
51
+ viewName: e.label,
52
+ shouldShowDropdown: l,
53
+ onCloseDropdown: u,
54
+ onSave: h,
55
+ onDelete: C,
56
+ headerText: "Edit view",
57
+ tab: e,
58
+ activeOption: a
59
+ }
60
+ )
61
+ }
62
+ ),
63
+ p && /* @__PURE__ */ o(
64
+ r,
65
+ {
66
+ anchorElement: n,
67
+ placement: "bottom-start",
68
+ onShouldClose: t,
69
+ id: "create-dropdown",
70
+ children: /* @__PURE__ */ o(
71
+ s,
72
+ {
73
+ e2ePrefix: "create-view-dropdown",
74
+ viewName: e.label,
75
+ shouldShowDropdown: p,
76
+ onCloseDropdown: c,
77
+ onSave: w,
78
+ onDelete: d,
79
+ headerText: "Create new view",
80
+ tab: e,
81
+ activeOption: a
82
+ }
83
+ )
44
84
  }
45
85
  )
46
86
  ] });
47
- });
87
+ };
48
88
  export {
49
- z as ViewList
89
+ j as ViewDropdowns
50
90
  };
package/dist/index43.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={PERSONAL:{key:"personal",text:"Personal"},COMPANY:{key:"company",text:"Company"}};exports.SHARING_OPTIONS=e;
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("./index99.cjs"),j=require("./index40.cjs"),m=require("./index61.cjs"),S=require("./index62.cjs"),q=require("./index36.cjs"),u=require("./index35.cjs"),p=require("./index60.cjs"),a=require("./index11.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;
package/dist/index43.js CHANGED
@@ -1,7 +1,50 @@
1
- const e = {
2
- PERSONAL: { key: "personal", text: "Personal" },
3
- COMPANY: { key: "company", text: "Company" }
4
- };
1
+ import { jsxs as i, Fragment as u, jsx as e } from "react/jsx-runtime";
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 "./index99.js";
6
+ import { SortableViews as b } from "./index40.js";
7
+ import { useViews as A } from "./index61.js";
8
+ import { useViewUrlChange as L } from "./index62.js";
9
+ import { CreateView as M } from "./index36.js";
10
+ import { ViewTab as s } from "./index35.js";
11
+ import { useStores as T } from "./index60.js";
12
+ import { ErrorBoundary as m } from "./index11.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,
20
+ {
21
+ onClickMenu: () => o(!0),
22
+ ariaMenuControls: "views-menu",
23
+ ariaMenuExpanded: t,
24
+ ref: c,
25
+ 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
+ ]
29
+ }
30
+ ),
31
+ t && /* @__PURE__ */ e(
32
+ V,
33
+ {
34
+ id: "views-menu",
35
+ anchorElement: p,
36
+ 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 })
43
+ ] })
44
+ }
45
+ )
46
+ ] });
47
+ });
5
48
  export {
6
- e as SHARING_OPTIONS
49
+ z as ViewList
7
50
  };
package/dist/index44.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),N=require("./index83.cjs"),b=require("@veeqo/ui"),_=require("./index84.cjs"),j=require("mobx-react"),y=require("./index7.cjs"),B=require("./index50.cjs"),I=require("./index59.cjs"),O=require("./index60.cjs"),g=require("./index49.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 e={PERSONAL:{key:"personal",text:"Personal"},COMPANY:{key:"company",text:"Company"}};exports.SHARING_OPTIONS=e;