@veeqo/transfigure 0.0.21 → 0.0.23

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 (259) hide show
  1. package/dist/components/Filters/ActiveFilters/Variants/common/ActiveFilterFooter/ActiveFilterFooter.d.ts +6 -0
  2. package/dist/components/Filters/ActiveFilters/Variants/common/ActiveFilterFooter/index.d.ts +1 -0
  3. package/dist/components/Filters/ActiveFilters/Variants/common/ActiveFilterHeader/ActiveFilterHeader.d.ts +7 -0
  4. package/dist/components/Filters/ActiveFilters/Variants/common/ActiveFilterHeader/index.d.ts +1 -0
  5. package/dist/components/Filters/ActiveFilters/Variants/common/index.d.ts +2 -0
  6. package/dist/components/Filters/ActiveFilters/Variants/index.d.ts +3 -1
  7. package/dist/components/Filters/ActiveFilters/index.d.ts +0 -1
  8. package/dist/components/Filters/Fields/NumberRangeFilter/MuiSlider.d.ts +1 -1
  9. package/dist/components/RefreshButton/RefreshButton.d.ts +2 -1
  10. package/dist/components/RefreshButton/{usePollListOrders.d.ts → usePollData.d.ts} +1 -1
  11. package/dist/components/Views/OptionsDropdown/styled.d.ts +1 -1
  12. package/dist/components/Views/PillNotifications/constants.d.ts +25 -0
  13. package/dist/components/Views/PillNotifications/variants/DraftPill/DraftPill.d.ts +5 -0
  14. package/dist/components/Views/PillNotifications/variants/DraftPill/index.d.ts +1 -0
  15. package/dist/components/Views/PillNotifications/variants/UnsavedChangesPill/UnsavedChangesPill.d.ts +7 -0
  16. package/dist/components/Views/PillNotifications/variants/UnsavedChangesPill/index.d.ts +1 -0
  17. package/dist/components/Views/PillNotifications/variants/styled.d.ts +324 -0
  18. package/dist/components/Views/index.d.ts +1 -1
  19. package/dist/context/ModalContext/mocks/mockUseModal.d.ts +4 -4
  20. package/dist/hooks/useViewCountsHook/useViewCountsHook.d.ts +1 -1
  21. package/dist/hooks/useViews/mocks.d.ts +2 -0
  22. package/dist/hooks/useViews/useViews.d.ts +1 -2
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +121 -119
  25. package/dist/index100.cjs +1 -1
  26. package/dist/index100.js +2 -36
  27. package/dist/index101.cjs +13 -1
  28. package/dist/index101.js +17 -19
  29. package/dist/index102.cjs +1 -1
  30. package/dist/index102.js +25 -7
  31. package/dist/index103.cjs +1 -1
  32. package/dist/index103.js +17 -62
  33. package/dist/index104.cjs +1 -1
  34. package/dist/index104.js +7 -29
  35. package/dist/index105.cjs +1 -1
  36. package/dist/index105.js +63 -62
  37. package/dist/index106.cjs +1 -13
  38. package/dist/index106.js +30 -17
  39. package/dist/index107.cjs +1 -1
  40. package/dist/index107.js +31 -37
  41. package/dist/index109.cjs +1 -0
  42. package/dist/index109.js +49 -0
  43. package/dist/index11.cjs +1 -1
  44. package/dist/index11.js +1 -1
  45. package/dist/index110.cjs +1 -0
  46. package/dist/index110.js +65 -0
  47. package/dist/index111.cjs +1 -0
  48. package/dist/index111.js +44 -0
  49. package/dist/index12.cjs +1 -1
  50. package/dist/index12.js +1 -1
  51. package/dist/index13.cjs +1 -1
  52. package/dist/index13.js +14 -14
  53. package/dist/index14.cjs +1 -1
  54. package/dist/index14.js +36 -41
  55. package/dist/index15.cjs +1 -1
  56. package/dist/index15.js +33 -37
  57. package/dist/index16.cjs +1 -1
  58. package/dist/index16.js +49 -32
  59. package/dist/index17.cjs +1 -1
  60. package/dist/index17.js +38 -48
  61. package/dist/index18.cjs +1 -1
  62. package/dist/index18.js +27 -28
  63. package/dist/index19.cjs +1 -1
  64. package/dist/index19.js +36 -37
  65. package/dist/index2.cjs +1 -1
  66. package/dist/index2.js +2 -2
  67. package/dist/index20.cjs +1 -1
  68. package/dist/index20.js +35 -36
  69. package/dist/index21.cjs +1 -1
  70. package/dist/index21.js +20 -21
  71. package/dist/index22.cjs +1 -1
  72. package/dist/index22.js +7 -46
  73. package/dist/index23.cjs +1 -1
  74. package/dist/index23.js +11 -61
  75. package/dist/index24.cjs +1 -1
  76. package/dist/index24.js +36 -35
  77. package/dist/index25.cjs +1 -1
  78. package/dist/index25.js +55 -34
  79. package/dist/index26.cjs +1 -1
  80. package/dist/index26.js +34 -52
  81. package/dist/index27.cjs +1 -1
  82. package/dist/index27.js +54 -51
  83. package/dist/index28.cjs +1 -1
  84. package/dist/index28.js +50 -81
  85. package/dist/index29.cjs +1 -1
  86. package/dist/index29.js +80 -33
  87. package/dist/index3.cjs +1 -1
  88. package/dist/index3.js +2 -2
  89. package/dist/index30.cjs +1 -1
  90. package/dist/index30.js +37 -33
  91. package/dist/index31.cjs +1 -1
  92. package/dist/index31.js +33 -10
  93. package/dist/index32.cjs +1 -1
  94. package/dist/index32.js +10 -40
  95. package/dist/index33.cjs +1 -1
  96. package/dist/index33.js +38 -102
  97. package/dist/index34.cjs +1 -1
  98. package/dist/index34.js +103 -19
  99. package/dist/index35.cjs +1 -1
  100. package/dist/index35.js +17 -135
  101. package/dist/index36.cjs +1 -1
  102. package/dist/index36.js +135 -49
  103. package/dist/index37.cjs +1 -1
  104. package/dist/index37.js +51 -50
  105. package/dist/index38.cjs +1 -1
  106. package/dist/index38.js +31 -49
  107. package/dist/index39.cjs +1 -1
  108. package/dist/index39.js +48 -71
  109. package/dist/index4.cjs +1 -1
  110. package/dist/index4.js +2 -2
  111. package/dist/index40.cjs +1 -1
  112. package/dist/index40.js +58 -79
  113. package/dist/index41.cjs +1 -1
  114. package/dist/index41.js +81 -41
  115. package/dist/index42.cjs +1 -1
  116. package/dist/index42.js +48 -5
  117. package/dist/index43.cjs +1 -1
  118. package/dist/index43.js +5 -42
  119. package/dist/index44.cjs +1 -1
  120. package/dist/index44.js +42 -25
  121. package/dist/index45.cjs +1 -1
  122. package/dist/index45.js +30 -19
  123. package/dist/index46.cjs +1 -1
  124. package/dist/index46.js +19 -8
  125. package/dist/index47.cjs +1 -1
  126. package/dist/index47.js +7 -22
  127. package/dist/index48.cjs +1 -1
  128. package/dist/index48.js +23 -2
  129. package/dist/index49.cjs +1 -1
  130. package/dist/index49.js +2 -4
  131. package/dist/index5.cjs +1 -1
  132. package/dist/index5.js +2 -2
  133. package/dist/index50.cjs +1 -1
  134. package/dist/index50.js +4 -11
  135. package/dist/index51.cjs +1 -1
  136. package/dist/index51.js +10 -12
  137. package/dist/index52.cjs +1 -1
  138. package/dist/index52.js +12 -11
  139. package/dist/index53.cjs +1 -1
  140. package/dist/index53.js +11 -184
  141. package/dist/index54.cjs +1 -1
  142. package/dist/index54.js +183 -25
  143. package/dist/index55.cjs +1 -1
  144. package/dist/index55.js +26 -24
  145. package/dist/index56.cjs +1 -1
  146. package/dist/index56.js +19 -22
  147. package/dist/index57.cjs +1 -1
  148. package/dist/index57.js +25 -90
  149. package/dist/index58.cjs +1 -1
  150. package/dist/index58.js +93 -8
  151. package/dist/index59.cjs +1 -1
  152. package/dist/index59.js +8 -51
  153. package/dist/index6.cjs +1 -1
  154. package/dist/index6.js +4 -4
  155. package/dist/index60.cjs +1 -1
  156. package/dist/index60.js +50 -60
  157. package/dist/index61.cjs +1 -1
  158. package/dist/index61.js +61 -18
  159. package/dist/index62.cjs +1 -1
  160. package/dist/index62.js +16 -23
  161. package/dist/index63.cjs +1 -1
  162. package/dist/index63.js +25 -315
  163. package/dist/index64.cjs +1 -1
  164. package/dist/index64.js +311 -55
  165. package/dist/index65.cjs +1 -1
  166. package/dist/index65.js +50 -47
  167. package/dist/index66.cjs +1 -1
  168. package/dist/index66.js +51 -32
  169. package/dist/index67.cjs +1 -1
  170. package/dist/index67.js +30 -24
  171. package/dist/index68.cjs +1 -1
  172. package/dist/index68.js +32 -4
  173. package/dist/index69.cjs +1 -1
  174. package/dist/index69.js +4 -9
  175. package/dist/index70.cjs +1 -1
  176. package/dist/index70.js +9 -17
  177. package/dist/index71.cjs +1 -1
  178. package/dist/index71.js +14 -16
  179. package/dist/index72.cjs +1 -1
  180. package/dist/index72.js +18 -47
  181. package/dist/index73.cjs +1 -1
  182. package/dist/index73.js +48 -21
  183. package/dist/index74.cjs +1 -1
  184. package/dist/index74.js +21 -2
  185. package/dist/index75.cjs +1 -1
  186. package/dist/index75.js +2 -9
  187. package/dist/index76.cjs +1 -3
  188. package/dist/index76.js +8 -13
  189. package/dist/index77.cjs +3 -1
  190. package/dist/index77.js +13 -8
  191. package/dist/index78.cjs +1 -1
  192. package/dist/index78.js +7 -141
  193. package/dist/index79.cjs +8 -1
  194. package/dist/index79.js +12 -19
  195. package/dist/index80.cjs +1 -8
  196. package/dist/index80.js +41 -12
  197. package/dist/index81.cjs +1 -1
  198. package/dist/index81.js +8 -40
  199. package/dist/index82.cjs +1 -1
  200. package/dist/index82.js +143 -9
  201. package/dist/index83.cjs +1 -1
  202. package/dist/index83.js +19 -18
  203. package/dist/index84.cjs +1 -1
  204. package/dist/index84.js +18 -13
  205. package/dist/index85.cjs +15 -100
  206. package/dist/index85.js +19 -115
  207. package/dist/index86.cjs +1 -1
  208. package/dist/index86.js +28 -65
  209. package/dist/index87.cjs +1 -1
  210. package/dist/index87.js +29 -29
  211. package/dist/index88.cjs +1 -1
  212. package/dist/index88.js +15 -2
  213. package/dist/index89.cjs +1 -1
  214. package/dist/index89.js +20 -40
  215. package/dist/index9.cjs +1 -1
  216. package/dist/index9.js +57 -43
  217. package/dist/index90.cjs +80 -1
  218. package/dist/index90.js +103 -11
  219. package/dist/index91.cjs +1 -1
  220. package/dist/index91.js +13 -24
  221. package/dist/index92.cjs +100 -15
  222. package/dist/index92.js +115 -19
  223. package/dist/index93.cjs +1 -1
  224. package/dist/index93.js +65 -30
  225. package/dist/index94.cjs +1 -1
  226. package/dist/index94.js +29 -29
  227. package/dist/index95.cjs +1 -1
  228. package/dist/index95.js +2 -22
  229. package/dist/index96.cjs +1 -80
  230. package/dist/index96.js +41 -96
  231. package/dist/index97.cjs +1 -12
  232. package/dist/index97.js +11 -16
  233. package/dist/index98.cjs +12 -1
  234. package/dist/index98.js +16 -15
  235. package/dist/index99.cjs +1 -1
  236. package/dist/index99.js +24 -2
  237. package/dist/mobx/Filters/tests/Filters.arrayFilters.test.d.ts +1 -0
  238. package/dist/mobx/Filters/tests/Filters.clearOperations.test.d.ts +1 -0
  239. package/dist/mobx/Filters/tests/Filters.dateRangeFilters.test.d.ts +1 -0
  240. package/dist/mobx/Filters/tests/Filters.hasUnsavedChanges.test.d.ts +1 -0
  241. package/dist/mobx/Filters/tests/Filters.numberRangeFilters.test.d.ts +1 -0
  242. package/dist/mobx/Filters/tests/Filters.pagination.test.d.ts +1 -0
  243. package/dist/mobx/Filters/tests/Filters.textFilters.test.d.ts +1 -0
  244. package/dist/mobx/Filters/tests/Filters.urlHandling.test.d.ts +1 -0
  245. package/dist/mobx/Filters/tests/Filters.views.test.d.ts +1 -0
  246. package/dist/mobx/Notifications/Notifications.d.ts +7 -8
  247. package/dist/mobx/Notifications/Notifications.test.d.ts +1 -0
  248. package/dist/mobx/Notifications/index.d.ts +1 -0
  249. package/dist/mobx/NumberRangeFilter/NumberRangeFilter.test.d.ts +1 -0
  250. package/dist/mobx/RangeFilter/RangeFilter.test.d.ts +1 -0
  251. package/dist/mobx/Views/Views.test.d.ts +1 -0
  252. package/dist/types.d.ts +3 -0
  253. package/package.json +1 -1
  254. package/dist/components/Views/PillNotifications/InfoPill.d.ts +0 -1
  255. package/dist/components/Views/PillNotifications/styled.d.ts +0 -34
  256. package/dist/components/Views/UnsavedChanges/UnsavedChanges.d.ts +0 -5
  257. package/dist/components/Views/UnsavedChanges/index.d.ts +0 -1
  258. /package/dist/components/Filters/ActiveFilters/{ActiveFilterTag → Variants/ActiveFilterTag}/ActiveFilterTag.d.ts +0 -0
  259. /package/dist/components/Filters/ActiveFilters/{ActiveFilterTag → Variants/ActiveFilterTag}/index.d.ts +0 -0
package/dist/index36.js CHANGED
@@ -1,53 +1,139 @@
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 "./index92.js";
3
- import { useModal as k } from "./index49.js";
4
- import { ModalId as T } from "./index48.js";
5
- const N = ({
6
- tab: e,
7
- onMakeDefault: n,
8
- onEdit: a,
9
- onDuplicate: o,
10
- onDelete: c,
11
- shouldShowDropdown: s,
12
- handleCloseDropdown: r
1
+ import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
+ import { Card as x, Alert as O, Stack as c, TextField as _, Text as $, SegmentedControl as A, Checkbox as E, Button as p } from "@veeqo/ui";
3
+ import { useForm as L, Controller as d } from "react-hook-form";
4
+ import { useCustomViews as j } from "./index62.js";
5
+ import { SHARING_OPTIONS as F } from "./index43.js";
6
+ import { useBusinessLogic as M } from "./index7.js";
7
+ const w = 60, z = ({
8
+ tab: n,
9
+ viewName: v,
10
+ shouldShowDropdown: g,
11
+ onCloseDropdown: f,
12
+ onDelete: b,
13
+ onSave: y,
14
+ headerText: C,
15
+ e2ePrefix: s,
16
+ activeOption: S
13
17
  }) => {
14
- const { openModal: m } = k(), d = () => {
15
- m(T.ORDERS_TABLE_MANAGEMENT), r();
16
- }, u = e.label !== "Picking In Progress" && e.editable, p = e.default !== !1 && e.editable, b = e.editable, g = e.editable;
17
- return s ? /* @__PURE__ */ t(M, { children: [
18
- p && /* @__PURE__ */ i(
19
- l,
20
- {
21
- onClick: n,
22
- className: "act-react-listing-custom-view-make-default-menu-item",
23
- children: "Make default view"
24
- }
25
- ),
26
- g && /* @__PURE__ */ i(l, { onClick: a, className: "act-react-listing-custom-view-edit-menu-item", role: "option", children: "Edit" }),
27
- /* @__PURE__ */ i(
28
- l,
29
- {
30
- onClick: o,
31
- className: "act-react-listing-custom-view-duplicate-menu-item",
32
- role: "option",
33
- children: "Duplicate"
34
- }
35
- ),
36
- u && /* @__PURE__ */ i(
37
- l,
38
- {
39
- onClick: c,
40
- className: "act-react-listing-custom-view-delete-menu-item",
41
- role: "option",
42
- children: "Delete"
43
- }
44
- ),
45
- b && /* @__PURE__ */ t(f, { children: [
46
- /* @__PURE__ */ i(h, {}),
47
- /* @__PURE__ */ i(l, { onClick: d, role: "option", children: "Table management" })
48
- ] })
49
- ] }) : null;
18
+ const { VIEW_TYPE: V } = M(), { canDeleteCustomViews: m, canUpdateCustomViews: o, canShareCustomViews: r, defaultCustomViewId: u } = j({
19
+ type: V
20
+ }), k = n.id === u, { handleSubmit: D, control: l, formState: h } = L({
21
+ mode: "onChange",
22
+ defaultValues: {
23
+ viewName: v,
24
+ isDefault: n.id === u,
25
+ shareOption: S.key
26
+ }
27
+ }), T = Object.values(F).map((t) => ({
28
+ key: t.key,
29
+ value: t.key,
30
+ label: t.text
31
+ }));
32
+ if (!g) return null;
33
+ const I = n.originalView === void 0;
34
+ return /* @__PURE__ */ e("form", { onSubmit: D(y), children: /* @__PURE__ */ a(
35
+ x,
36
+ {
37
+ style: { width: "400px" },
38
+ title: C,
39
+ subtitle: "Any filters you've applied and your chosen sort direction will be stored in this view",
40
+ onClose: f,
41
+ renderFooter: () => m || o || r ? /* @__PURE__ */ a(c, { direction: "horizontal", alignX: "end", children: [
42
+ m && /* @__PURE__ */ e(
43
+ p,
44
+ {
45
+ variant: "destructive",
46
+ onClick: b,
47
+ className: `act-react-listing-custom-view-${s}-delete`,
48
+ children: "Delete"
49
+ }
50
+ ),
51
+ (o || r) && /* @__PURE__ */ e(
52
+ p,
53
+ {
54
+ variant: "primary",
55
+ type: "submit",
56
+ className: `act-react-listing-custom-view-${s}-save`,
57
+ disabled: !h.isDirty && I || h.isSubmitting,
58
+ children: "Save"
59
+ }
60
+ )
61
+ ] }) : null,
62
+ className: `act-react-listing-custom-view-${s}`,
63
+ children: [
64
+ !o && /* @__PURE__ */ e(
65
+ O,
66
+ {
67
+ variant: "warning",
68
+ title: "You need permission to edit this view",
69
+ message: "This is a company shared view"
70
+ }
71
+ ),
72
+ /* @__PURE__ */ a(c, { alignX: "stretch", children: [
73
+ /* @__PURE__ */ e(
74
+ d,
75
+ {
76
+ name: "viewName",
77
+ control: l,
78
+ render: ({ onChange: t, value: i }) => /* @__PURE__ */ e(
79
+ _,
80
+ {
81
+ id: "view-name",
82
+ className: `act-react-listing-custom-view-${s}-field`,
83
+ label: "View name",
84
+ placeholder: "View name",
85
+ value: i,
86
+ onChange: t,
87
+ disabled: !n.editable,
88
+ maxLength: w,
89
+ hint: `${i.length} / ${w} characters`,
90
+ required: !0
91
+ }
92
+ )
93
+ }
94
+ ),
95
+ /* @__PURE__ */ a(c, { children: [
96
+ /* @__PURE__ */ e($, { variant: "inputLabel", children: "Sharing options" }),
97
+ /* @__PURE__ */ e(
98
+ d,
99
+ {
100
+ name: "shareOption",
101
+ control: l,
102
+ render: ({ onChange: t, value: i }) => /* @__PURE__ */ e(
103
+ A,
104
+ {
105
+ onChange: (N) => r && t(N),
106
+ options: T,
107
+ selected: i
108
+ }
109
+ )
110
+ }
111
+ )
112
+ ] }),
113
+ /* @__PURE__ */ e(
114
+ d,
115
+ {
116
+ name: "isDefault",
117
+ control: l,
118
+ render: ({ onChange: t, value: i }) => /* @__PURE__ */ e(
119
+ E,
120
+ {
121
+ disabled: k,
122
+ name: "makeViewDefault",
123
+ label: "Make default view",
124
+ checked: i,
125
+ onChange: t,
126
+ hint: "This will be the view this page will always open on"
127
+ }
128
+ )
129
+ }
130
+ )
131
+ ] })
132
+ ]
133
+ }
134
+ ) });
50
135
  };
51
136
  export {
52
- N as OptionsDropdown
137
+ z as EditDropdown,
138
+ w as VIEWS_TITLE_MAX_CHAR_LIMIT
53
139
  };
package/dist/index37.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react-transition-group"),f=require("mobx-react"),x=require("./index59.cjs"),v=require("./index95.cjs"),g=require("./index39.cjs"),h=require("./index58.cjs"),S=f.observer(({tabType:i,isActive:n,shouldShowCreateViewNotification:c,handleSaveDraft:s})=>{var r;const{Filters:{hasUnsavedChanges:l,discardChanges:u,activeViewId:t}}=h.useStores(),d=window.location.pathname==="/orders"?"orders":"variants",{viewsMap:m}=x.useViews(),o=t&&((r=m.get(t))==null?void 0:r.label)||"failure";return e.jsxs(e.Fragment,{children:[e.jsx(a.CSSTransition,{in:i==="draft"&&n&&c,timeout:200,classNames:"notification",unmountOnExit:!0,children:e.jsx(v.InfoPill,{onClick:s,mainEntityLabelPlural:d})}),i!=="fixed"&&o&&e.jsx(a.CSSTransition,{in:l&&n&&i==="saved",timeout:200,classNames:"notification",unmountOnExit:!0,children:e.jsx(g.UnsavedChangesPill,{viewName:o,onDiscard:()=>u(),onSaveDraft:s})})]})});exports.PillNotifications=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index85.cjs"),g=require("./index50.cjs"),j=require("./index49.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/index37.js CHANGED
@@ -1,52 +1,53 @@
1
- import { jsxs as u, Fragment as p, jsx as i } from "react/jsx-runtime";
2
- import { CSSTransition as a } from "react-transition-group";
3
- import { observer as h } from "mobx-react";
4
- import { useViews as v } from "./index59.js";
5
- import { InfoPill as w } from "./index95.js";
6
- import { UnsavedChangesPill as x } from "./index39.js";
7
- import { useStores as g } from "./index58.js";
8
- const F = h(
9
- ({
10
- tabType: o,
11
- isActive: n,
12
- shouldShowCreateViewNotification: m,
13
- handleSaveDraft: t
14
- }) => {
15
- var s;
16
- const {
17
- Filters: { hasUnsavedChanges: l, discardChanges: c, activeViewId: r }
18
- } = g(), f = window.location.pathname === "/orders" ? "orders" : "variants", { viewsMap: d } = v(), e = r && ((s = d.get(r)) == null ? void 0 : s.label) || "failure";
19
- return /* @__PURE__ */ u(p, { children: [
20
- /* @__PURE__ */ i(
21
- a,
22
- {
23
- in: o === "draft" && n && m,
24
- timeout: 200,
25
- classNames: "notification",
26
- unmountOnExit: !0,
27
- children: /* @__PURE__ */ i(w, { onClick: t, mainEntityLabelPlural: f })
28
- }
29
- ),
30
- o !== "fixed" && e && /* @__PURE__ */ i(
31
- a,
32
- {
33
- in: l && n && o === "saved",
34
- timeout: 200,
35
- classNames: "notification",
36
- unmountOnExit: !0,
37
- children: /* @__PURE__ */ i(
38
- x,
39
- {
40
- viewName: e,
41
- onDiscard: () => c(),
42
- onSaveDraft: t
43
- }
44
- )
45
- }
46
- )
47
- ] });
48
- }
49
- );
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 "./index85.js";
3
+ import { useModal as k } from "./index50.js";
4
+ import { ModalId as T } from "./index49.js";
5
+ const N = ({
6
+ tab: e,
7
+ onMakeDefault: n,
8
+ onEdit: a,
9
+ onDuplicate: o,
10
+ onDelete: c,
11
+ shouldShowDropdown: s,
12
+ handleCloseDropdown: r
13
+ }) => {
14
+ const { openModal: m } = k(), d = () => {
15
+ m(T.ORDERS_TABLE_MANAGEMENT), r();
16
+ }, u = e.label !== "Picking In Progress" && e.editable, p = e.default !== !1 && e.editable, b = e.editable, g = e.editable;
17
+ return s ? /* @__PURE__ */ t(M, { children: [
18
+ p && /* @__PURE__ */ i(
19
+ l,
20
+ {
21
+ onClick: n,
22
+ className: "act-react-listing-custom-view-make-default-menu-item",
23
+ children: "Make default view"
24
+ }
25
+ ),
26
+ g && /* @__PURE__ */ i(l, { onClick: a, className: "act-react-listing-custom-view-edit-menu-item", role: "option", children: "Edit" }),
27
+ /* @__PURE__ */ i(
28
+ l,
29
+ {
30
+ onClick: o,
31
+ className: "act-react-listing-custom-view-duplicate-menu-item",
32
+ role: "option",
33
+ children: "Duplicate"
34
+ }
35
+ ),
36
+ u && /* @__PURE__ */ i(
37
+ l,
38
+ {
39
+ onClick: c,
40
+ className: "act-react-listing-custom-view-delete-menu-item",
41
+ role: "option",
42
+ children: "Delete"
43
+ }
44
+ ),
45
+ b && /* @__PURE__ */ t(f, { children: [
46
+ /* @__PURE__ */ i(h, {}),
47
+ /* @__PURE__ */ i(l, { onClick: d, role: "option", children: "Table management" })
48
+ ] })
49
+ ] }) : null;
50
+ };
50
51
  export {
51
- F as PillNotifications
52
+ N as OptionsDropdown
52
53
  };
package/dist/index38.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),d=require("react"),m=require("./index98.cjs"),g=require("./index61.cjs"),S=require("./index59.cjs"),b=require("./index3.cjs"),y=require("./index7.cjs"),V=require("./index58.cjs"),p=require("./index10.cjs"),q=()=>{const{VIEW_TYPE:n}=y.useBusinessLogic(),{sortedCustomViews:s,isLoading:u}=S.useViews(),{mutate:a}=g.useCustomViews({type:n}),[c,t]=d.useState(s),{Notifications:{notify:l}}=V.useStores(),w=async o=>{t(o);const r=o.map(e=>e.id);try{await b.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:r}}}),await a(e=>({...e,settings:{...e.settings,custom_view_positions:{...e.settings.custom_view_positions,order:r}}}),{revalidate:!1})}catch{t(s),l({type:"error",text:"Failed to update order of views"})}};return u||!s.length?null:i.jsx(p.ErrorBoundary,{children:i.jsx(m.LegacySortableViews,{views:c,onChange:w,className:"act-sortable-views"})})};exports.SortableViews=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),P=require("mobx-react"),g=require("./index60.cjs"),o=require("framer-motion"),m=require("./index59.cjs"),v=require("./index89.cjs"),f=require("./index40.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/index38.js CHANGED
@@ -1,52 +1,34 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import { useState as f } from "react";
3
- import { LegacySortableViews as l } from "./index98.js";
4
- import { useCustomViews as w } from "./index61.js";
5
- import { useViews as d } from "./index59.js";
6
- import { patchCurrentUser as g } from "./index3.js";
7
- import { useBusinessLogic as _ } from "./index7.js";
8
- import { useStores as S } from "./index58.js";
9
- import { ErrorBoundary as b } from "./index10.js";
10
- const N = () => {
11
- const { VIEW_TYPE: m } = _(), { sortedCustomViews: s, isLoading: a } = d(), { mutate: n } = w({ type: m }), [u, o] = f(s), { Notifications: { notify: c } } = S(), p = async (e) => {
12
- o(e);
13
- const i = e.map((t) => t.id);
14
- try {
15
- await g({
16
- user_setting_attributes: {
17
- custom_view_positions: {
18
- order: i
19
- }
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 "./index60.js";
4
+ import { AnimatePresence as n } from "framer-motion";
5
+ import { useStores as g } from "./index59.js";
6
+ import { DraftPill as w } from "./index89.js";
7
+ import { UnsavedChangesPill as C } from "./index40.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
20
27
  }
21
- }), await n(
22
- (t) => ({
23
- ...t,
24
- settings: {
25
- ...t.settings,
26
- custom_view_positions: {
27
- ...t.settings.custom_view_positions,
28
- order: i
29
- }
30
- }
31
- }),
32
- { revalidate: !1 }
33
- );
34
- } catch {
35
- o(s), c({
36
- type: "error",
37
- text: "Failed to update order of views"
38
- });
39
- }
40
- };
41
- return a || !s.length ? null : /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(
42
- l,
43
- {
44
- views: u,
45
- onChange: p,
46
- className: "act-sortable-views"
47
- }
48
- ) });
49
- };
28
+ ) })
29
+ ] });
30
+ }
31
+ );
50
32
  export {
51
- N as SortableViews
33
+ U as PillNotifications
52
34
  };
package/dist/index39.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),s=require("@veeqo/ui"),h=require("mobx-react"),u=require("./index57.cjs"),n=require("./index96.cjs"),g=s.theme.colors.secondary.blue.base,v=h.observer(({onDiscard:i,viewName:t,onSaveDraft:c})=>{const{saveChanges:o,isSubmitting:r}=u.usePersistUnsavedChanges(),[d,a]=l.useState(!1);return e.jsx(n.Notification,{children:e.jsx(n.Container,{className:"act-react-listing-custom-notification-unsaved-changes",children:e.jsxs(s.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(n.Glyph,{name:"attention",color:g}),e.jsxs(n.Wrap,{children:[e.jsx(n.Text,{variant:"body",margin:"0 4px 0 0",children:"You have unsaved changes to"}),e.jsx(n.Bold,{variant:"bodyBoldDark",children:`'${t}'`})]}),e.jsx(s.Button,{className:"act-react-listing-custom-notification-unsaved-changes-discard",onClick:i,size:"sm",children:"Discard changes"}),e.jsxs(s.AnimatedDropdown,{reversed:!0,shouldShowDropdown:d,onClickAway:()=>a(!1),cta:e.jsx(s.Button,{className:"act-react-listing-custom-notification-unsaved-changes-toggle-dropdown",variant:"primary",onClick:()=>a(!0),size:"sm",dropdown:!0,children:"Save changes"}),children:[e.jsx(n.Item,{onClick:c,className:"act-react-listing-custom-notification-unsaved-changes-create-new-view",children:e.jsx(n.Text,{variant:"body",children:"Create new view"})}),e.jsxs(n.Item,{onClick:o,disabled:r,className:"act-react-listing-custom-notification-unsaved-changes-save-to-existing-view",children:[e.jsx(n.Text,{variant:"body",margin:"0 4px 0 0",children:"Save changes to"}),e.jsx(n.Text,{variant:"bodyBoldDark",children:t})]})]})]})})})});exports.UnsavedChangesPill=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),d=require("react"),m=require("./index88.cjs"),g=require("./index62.cjs"),S=require("./index60.cjs"),b=require("./index3.cjs"),y=require("./index7.cjs"),V=require("./index59.cjs"),p=require("./index10.cjs"),q=()=>{const{VIEW_TYPE:n}=y.useBusinessLogic(),{sortedCustomViews:s,isLoading:u}=S.useViews(),{mutate:a}=g.useCustomViews({type:n}),[c,t]=d.useState(s),{Notifications:{notify:l}}=V.useStores(),w=async o=>{t(o);const r=o.map(e=>e.id);try{await b.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:r}}}),await a(e=>({...e,settings:{...e.settings,custom_view_positions:{...e.settings.custom_view_positions,order:r}}}),{revalidate:!1})}catch{t(s),l({type:"error",text:"Failed to update order of views"})}};return u||!s.length?null:i.jsx(p.ErrorBoundary,{children:i.jsx(m.LegacySortableViews,{views:c,onChange:w,className:"act-sortable-views"})})};exports.SortableViews=q;
package/dist/index39.js CHANGED
@@ -1,75 +1,52 @@
1
- import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
- import { useState as m } from "react";
3
- import { Stack as g, theme as u, Button as o, AnimatedDropdown as v } from "@veeqo/ui";
4
- import { observer as p } from "mobx-react";
5
- import { usePersistUnsavedChanges as f } from "./index57.js";
6
- import { Notification as w, Container as C, Glyph as b, Wrap as y, Text as a, Bold as k, Item as r } from "./index96.js";
7
- const S = u.colors.secondary.blue.base, A = p(
8
- ({
9
- onDiscard: s,
10
- viewName: i,
11
- onSaveDraft: c
12
- }) => {
13
- const { saveChanges: d, isSubmitting: l } = f(), [h, t] = m(!1);
14
- return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(C, { className: "act-react-listing-custom-notification-unsaved-changes", children: /* @__PURE__ */ n(g, { direction: "horizontal", alignY: "center", children: [
15
- /* @__PURE__ */ e(b, { name: "attention", color: S }),
16
- /* @__PURE__ */ n(y, { children: [
17
- /* @__PURE__ */ e(a, { variant: "body", margin: "0 4px 0 0", children: "You have unsaved changes to" }),
18
- /* @__PURE__ */ e(k, { variant: "bodyBoldDark", children: `'${i}'` })
19
- ] }),
20
- /* @__PURE__ */ e(
21
- o,
22
- {
23
- className: "act-react-listing-custom-notification-unsaved-changes-discard",
24
- onClick: s,
25
- size: "sm",
26
- children: "Discard changes"
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { useState as f } from "react";
3
+ import { LegacySortableViews as l } from "./index88.js";
4
+ import { useCustomViews as w } from "./index62.js";
5
+ import { useViews as d } from "./index60.js";
6
+ import { patchCurrentUser as g } from "./index3.js";
7
+ import { useBusinessLogic as _ } from "./index7.js";
8
+ import { useStores as S } from "./index59.js";
9
+ import { ErrorBoundary as b } from "./index10.js";
10
+ const N = () => {
11
+ const { VIEW_TYPE: m } = _(), { sortedCustomViews: s, isLoading: a } = d(), { mutate: n } = w({ type: m }), [u, o] = f(s), { Notifications: { notify: c } } = S(), p = async (e) => {
12
+ o(e);
13
+ const i = e.map((t) => t.id);
14
+ try {
15
+ await g({
16
+ user_setting_attributes: {
17
+ custom_view_positions: {
18
+ order: i
19
+ }
27
20
  }
28
- ),
29
- /* @__PURE__ */ n(
30
- v,
31
- {
32
- reversed: !0,
33
- shouldShowDropdown: h,
34
- onClickAway: () => t(!1),
35
- cta: /* @__PURE__ */ e(
36
- o,
37
- {
38
- className: "act-react-listing-custom-notification-unsaved-changes-toggle-dropdown",
39
- variant: "primary",
40
- onClick: () => t(!0),
41
- size: "sm",
42
- dropdown: !0,
43
- children: "Save changes"
21
+ }), await n(
22
+ (t) => ({
23
+ ...t,
24
+ settings: {
25
+ ...t.settings,
26
+ custom_view_positions: {
27
+ ...t.settings.custom_view_positions,
28
+ order: i
44
29
  }
45
- ),
46
- children: [
47
- /* @__PURE__ */ e(
48
- r,
49
- {
50
- onClick: c,
51
- className: "act-react-listing-custom-notification-unsaved-changes-create-new-view",
52
- children: /* @__PURE__ */ e(a, { variant: "body", children: "Create new view" })
53
- }
54
- ),
55
- /* @__PURE__ */ n(
56
- r,
57
- {
58
- onClick: d,
59
- disabled: l,
60
- className: "act-react-listing-custom-notification-unsaved-changes-save-to-existing-view",
61
- children: [
62
- /* @__PURE__ */ e(a, { variant: "body", margin: "0 4px 0 0", children: "Save changes to" }),
63
- /* @__PURE__ */ e(a, { variant: "bodyBoldDark", children: i })
64
- ]
65
- }
66
- )
67
- ]
68
- }
69
- )
70
- ] }) }) });
71
- }
72
- );
30
+ }
31
+ }),
32
+ { revalidate: !1 }
33
+ );
34
+ } catch {
35
+ o(s), c({
36
+ type: "error",
37
+ text: "Failed to update order of views"
38
+ });
39
+ }
40
+ };
41
+ return a || !s.length ? null : /* @__PURE__ */ r(b, { children: /* @__PURE__ */ r(
42
+ l,
43
+ {
44
+ views: u,
45
+ onChange: p,
46
+ className: "act-sortable-views"
47
+ }
48
+ ) });
49
+ };
73
50
  export {
74
- A as UnsavedChangesPill
51
+ N as SortableViews
75
52
  };
package/dist/index4.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index6.cjs"),i=require("./index50.cjs"),o=require("./index51.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 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;
package/dist/index4.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { axios as i } from "./index6.js";
2
- import { withCSRF as m } from "./index50.js";
3
- import { vndAPI as p } from "./index51.js";
2
+ import { withCSRF as m } from "./index51.js";
3
+ import { vndAPI as p } from "./index52.js";
4
4
  const c = (t, { attributes: o }) => i.patch(`/api/v2/custom_views/${t}`, { data: { attributes: o, type: "custom_view" } }, m(p));
5
5
  export {
6
6
  c as patchCustomView
package/dist/index40.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("./index42.cjs"),O=require("./index36.cjs"),c=require("./index35.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"),l=require("react"),s=require("@veeqo/ui"),h=require("mobx-react"),u=require("./index58.cjs"),n=require("./index90.cjs"),x=s.theme.colors.secondary.blue.base,j=h.observer(({onDiscard:a,viewName:r,onSaveDraft:i})=>{const{saveChanges:o,isSubmitting:c}=u.usePersistUnsavedChanges(),[d,t]=l.useState(!1);return e.jsx(n.Notification,{children:e.jsx(n.Container,{children:e.jsxs(s.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(n.Glyph,{ariaLabel:"attention",name:"attention",color:x}),e.jsxs(n.Wrap,{children:[e.jsx(n.Text,{variant:"body",margin:"0 4px 0 0",children:"You have unsaved changes"}),r&&e.jsx(n.Bold,{variant:"bodyBoldDark",children:`to '${r}'`})]}),e.jsx(s.Button,{onClick:a,size:"sm",children:"Discard changes"}),e.jsxs(s.AnimatedDropdown,{reversed:!0,shouldShowDropdown:d,onClickAway:()=>t(!1),cta:e.jsx(s.Button,{variant:"primary",onClick:()=>t(!0),size:"sm",dropdown:!0,children:"Save changes"}),children:[e.jsx(n.Item,{onClick:i,children:e.jsx(n.Text,{variant:"body",children:"Create new view"})}),e.jsxs(n.Item,{onClick:o,disabled:c,children:[e.jsx(n.Text,{variant:"body",margin:"0 4px 0 0",children:"Save changes to"}),e.jsx(n.Text,{variant:"bodyBoldDark",children:r})]})]})]})})})});exports.UnsavedChangesPill=j;