@veeqo/transfigure 1.1.6 → 1.1.8

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 (231) hide show
  1. package/dist/BusinessLogic/types.d.ts +1 -1
  2. package/dist/components/ActionsDropdown/ActionsDropdown.d.ts +2 -0
  3. package/dist/components/ActionsDropdown/index.d.ts +1 -0
  4. package/dist/components/ActionsDropdown/types.d.ts +7 -0
  5. package/dist/components/Filters/Fields/NumberRangeFilter/MuiSlider.d.ts +1 -1
  6. package/dist/components/Views/PillNotifications/variants/styled.d.ts +3 -3
  7. package/dist/hooks/usePersistUnsavedChanges/usePersistUnsavedChanges.d.ts +1 -1
  8. package/dist/index.cjs +1 -1
  9. package/dist/index.css +1 -1
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.js +146 -144
  12. package/dist/index100.cjs +1 -1
  13. package/dist/index100.js +3 -3
  14. package/dist/index102.cjs +16 -77
  15. package/dist/index102.js +19 -96
  16. package/dist/index103.cjs +1 -1
  17. package/dist/index103.js +21 -2
  18. package/dist/index104.cjs +80 -1
  19. package/dist/index104.js +101 -19
  20. package/dist/index105.cjs +1 -1
  21. package/dist/index105.js +18 -7
  22. package/dist/index106.cjs +1 -1
  23. package/dist/index106.js +7 -63
  24. package/dist/index107.cjs +1 -1
  25. package/dist/index107.js +60 -26
  26. package/dist/index108.cjs +1 -13
  27. package/dist/index108.js +30 -17
  28. package/dist/index109.cjs +13 -1
  29. package/dist/index109.js +14 -33
  30. package/dist/index11.cjs +1 -1
  31. package/dist/index11.js +27 -18
  32. package/dist/index110.cjs +1 -1
  33. package/dist/index110.js +32 -22
  34. package/dist/index111.cjs +1 -7
  35. package/dist/index111.js +2 -10
  36. package/dist/index112.cjs +1 -1
  37. package/dist/index112.js +25 -62
  38. package/dist/index113.cjs +7 -1
  39. package/dist/index113.js +10 -47
  40. package/dist/index114.cjs +1 -0
  41. package/dist/index114.js +65 -0
  42. package/dist/index115.cjs +1 -0
  43. package/dist/index115.js +49 -0
  44. package/dist/index12.cjs +1 -1
  45. package/dist/index12.js +18 -21
  46. package/dist/index13.cjs +1 -1
  47. package/dist/index13.js +19 -41
  48. package/dist/index14.cjs +1 -1
  49. package/dist/index14.js +41 -23
  50. package/dist/index15.cjs +1 -1
  51. package/dist/index15.js +24 -36
  52. package/dist/index16.cjs +1 -1
  53. package/dist/index16.js +37 -33
  54. package/dist/index17.cjs +1 -1
  55. package/dist/index17.js +32 -49
  56. package/dist/index18.cjs +1 -1
  57. package/dist/index18.js +47 -38
  58. package/dist/index19.cjs +1 -1
  59. package/dist/index19.js +29 -29
  60. package/dist/index20.cjs +1 -1
  61. package/dist/index20.js +41 -58
  62. package/dist/index21.cjs +1 -1
  63. package/dist/index21.js +48 -42
  64. package/dist/index22.cjs +1 -1
  65. package/dist/index22.js +50 -44
  66. package/dist/index23.cjs +1 -1
  67. package/dist/index23.js +46 -7
  68. package/dist/index24.cjs +1 -1
  69. package/dist/index24.js +7 -11
  70. package/dist/index25.cjs +1 -1
  71. package/dist/index25.js +11 -64
  72. package/dist/index26.cjs +1 -1
  73. package/dist/index26.js +40 -39
  74. package/dist/index27.cjs +1 -1
  75. package/dist/index27.js +60 -37
  76. package/dist/index28.cjs +1 -1
  77. package/dist/index28.js +36 -53
  78. package/dist/index29.cjs +1 -1
  79. package/dist/index29.js +54 -51
  80. package/dist/index3.cjs +1 -1
  81. package/dist/index3.js +2 -2
  82. package/dist/index30.cjs +1 -1
  83. package/dist/index30.js +50 -81
  84. package/dist/index31.cjs +1 -1
  85. package/dist/index31.js +81 -35
  86. package/dist/index32.cjs +1 -1
  87. package/dist/index32.js +38 -33
  88. package/dist/index33.cjs +1 -1
  89. package/dist/index33.js +33 -10
  90. package/dist/index34.cjs +1 -1
  91. package/dist/index34.js +10 -39
  92. package/dist/index35.cjs +1 -1
  93. package/dist/index35.js +38 -102
  94. package/dist/index36.cjs +1 -1
  95. package/dist/index36.js +103 -19
  96. package/dist/index37.cjs +1 -1
  97. package/dist/index37.js +17 -134
  98. package/dist/index38.cjs +1 -1
  99. package/dist/index38.js +135 -49
  100. package/dist/index39.cjs +1 -1
  101. package/dist/index39.js +51 -32
  102. package/dist/index4.cjs +1 -1
  103. package/dist/index4.js +2 -2
  104. package/dist/index40.cjs +1 -1
  105. package/dist/index40.js +31 -53
  106. package/dist/index41.cjs +1 -1
  107. package/dist/index41.js +54 -48
  108. package/dist/index42.cjs +1 -1
  109. package/dist/index42.js +41 -81
  110. package/dist/index43.cjs +1 -1
  111. package/dist/index43.js +81 -41
  112. package/dist/index44.cjs +1 -1
  113. package/dist/index44.js +48 -5
  114. package/dist/index45.cjs +1 -1
  115. package/dist/index45.js +5 -45
  116. package/dist/index46.cjs +1 -1
  117. package/dist/index46.js +44 -41
  118. package/dist/index47.cjs +1 -1
  119. package/dist/index47.js +42 -19
  120. package/dist/index48.cjs +1 -1
  121. package/dist/index48.js +19 -8
  122. package/dist/index49.cjs +1 -1
  123. package/dist/index49.js +7 -22
  124. package/dist/index5.cjs +1 -1
  125. package/dist/index5.js +2 -2
  126. package/dist/index50.cjs +1 -1
  127. package/dist/index50.js +23 -2
  128. package/dist/index51.cjs +1 -1
  129. package/dist/index51.js +2 -4
  130. package/dist/index52.cjs +1 -1
  131. package/dist/index52.js +4 -11
  132. package/dist/index53.cjs +1 -1
  133. package/dist/index53.js +10 -12
  134. package/dist/index54.cjs +1 -1
  135. package/dist/index54.js +12 -11
  136. package/dist/index55.cjs +1 -1
  137. package/dist/index55.js +11 -184
  138. package/dist/index56.cjs +1 -1
  139. package/dist/index56.js +183 -25
  140. package/dist/index57.cjs +1 -1
  141. package/dist/index57.js +26 -24
  142. package/dist/index58.cjs +1 -1
  143. package/dist/index58.js +19 -22
  144. package/dist/index59.cjs +1 -1
  145. package/dist/index59.js +25 -97
  146. package/dist/index6.cjs +1 -1
  147. package/dist/index6.js +2 -2
  148. package/dist/index60.cjs +1 -1
  149. package/dist/index60.js +99 -8
  150. package/dist/index61.cjs +1 -1
  151. package/dist/index61.js +8 -51
  152. package/dist/index62.cjs +1 -1
  153. package/dist/index62.js +50 -60
  154. package/dist/index63.cjs +1 -1
  155. package/dist/index63.js +57 -18
  156. package/dist/index64.cjs +1 -1
  157. package/dist/index64.js +22 -18
  158. package/dist/index65.cjs +1 -1
  159. package/dist/index65.js +16 -26
  160. package/dist/index66.cjs +1 -1
  161. package/dist/index66.js +27 -56
  162. package/dist/index67.cjs +1 -1
  163. package/dist/index67.js +57 -341
  164. package/dist/index68.cjs +1 -1
  165. package/dist/index68.js +337 -55
  166. package/dist/index69.cjs +1 -1
  167. package/dist/index69.js +50 -47
  168. package/dist/index7.cjs +1 -1
  169. package/dist/index7.js +4 -4
  170. package/dist/index70.cjs +1 -1
  171. package/dist/index70.js +51 -32
  172. package/dist/index71.cjs +1 -1
  173. package/dist/index71.js +30 -24
  174. package/dist/index72.cjs +1 -1
  175. package/dist/index72.js +26 -32
  176. package/dist/index73.cjs +1 -1
  177. package/dist/index73.js +37 -12
  178. package/dist/index74.cjs +1 -1
  179. package/dist/index74.js +13 -9
  180. package/dist/index75.cjs +1 -1
  181. package/dist/index75.js +9 -17
  182. package/dist/index76.cjs +1 -1
  183. package/dist/index76.js +14 -16
  184. package/dist/index77.cjs +1 -1
  185. package/dist/index77.js +18 -49
  186. package/dist/index78.cjs +1 -1
  187. package/dist/index78.js +50 -21
  188. package/dist/index79.cjs +1 -1
  189. package/dist/index79.js +21 -7
  190. package/dist/index80.cjs +1 -1
  191. package/dist/index80.js +7 -2
  192. package/dist/index81.cjs +1 -1
  193. package/dist/index81.js +2 -9
  194. package/dist/index82.cjs +1 -3
  195. package/dist/index82.js +8 -13
  196. package/dist/index83.cjs +3 -1
  197. package/dist/index83.js +13 -8
  198. package/dist/index84.cjs +1 -1
  199. package/dist/index84.js +9 -41
  200. package/dist/index85.cjs +1 -1
  201. package/dist/index85.js +41 -9
  202. package/dist/index86.cjs +1 -1
  203. package/dist/index86.js +8 -117
  204. package/dist/index87.cjs +1 -1
  205. package/dist/index87.js +5 -19
  206. package/dist/index88.cjs +1 -1
  207. package/dist/index88.js +118 -13
  208. package/dist/index89.cjs +1 -104
  209. package/dist/index89.js +17 -118
  210. package/dist/index90.cjs +1 -1
  211. package/dist/index90.js +13 -68
  212. package/dist/index91.cjs +104 -1
  213. package/dist/index91.js +119 -28
  214. package/dist/index92.cjs +1 -1
  215. package/dist/index92.js +68 -2
  216. package/dist/index93.cjs +1 -1
  217. package/dist/index93.js +27 -39
  218. package/dist/index94.cjs +1 -1
  219. package/dist/index94.js +2 -11
  220. package/dist/index95.cjs +1 -12
  221. package/dist/index95.js +41 -16
  222. package/dist/index96.cjs +1 -1
  223. package/dist/index96.js +10 -14
  224. package/dist/index97.cjs +1 -1
  225. package/dist/index97.js +1 -1
  226. package/dist/index98.cjs +12 -1
  227. package/dist/index98.js +16 -21
  228. package/dist/index99.cjs +1 -19
  229. package/dist/index99.js +14 -23
  230. package/dist/types.d.ts +1 -1
  231. package/package.json +1 -1
package/dist/index46.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),h=require("./index84.cjs"),e=require("@veeqo/ui"),o=require("./index85.cjs"),d=require("./index60.cjs"),m=({isLoading:a,refetch:n,trackMetricClick:s,tooltipText:l="Refresh data",buttonProps:i={size:"sm",variant:"default"}})=>{const{hasChanges:r,acknowledgeButtonClick:u}=h.usePollData(),{Notifications:{notify:c}}=d.useStores(),f=async()=>{try{await n(),await u(),s==null||s()}catch{c({type:"error",text:"Failed to refresh data"})}};return t.jsxs(e.Tooltip,{className:o.default.refreshTooltip,text:l,children:[t.jsx(e.Button,{className:o.default.refreshButton,onClick:f,loading:a,disabled:a,iconSlot:t.jsx(e.RefreshIcon,{color:e.theme.colors.neutral.ink.base}),"aria-label":r?"refresh table with changes":"refresh table","aria-live":"polite",...i}),t.jsx(e.Indicator,{className:o.default.refreshIndicator,color:"red",size:"xs",style:{opacity:r?1:0}})]})};exports.RefreshButton=m;
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;
package/dist/index46.js CHANGED
@@ -1,44 +1,47 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { usePollData as c } from "./index84.js";
3
- import { Tooltip as d, Button as p, RefreshIcon as u, theme as y, Indicator as x } from "@veeqo/ui";
4
- import t from "./index85.js";
5
- import { useStores as b } from "./index60.js";
6
- const j = ({
7
- isLoading: s,
8
- refetch: a,
9
- trackMetricClick: e,
10
- tooltipText: l = "Refresh data",
11
- buttonProps: n = {
12
- size: "sm",
13
- variant: "default"
1
+ import { jsxs as v, Fragment as B, jsx as s } from "react/jsx-runtime";
2
+ import { TableManagementModal as O } from "./index88.js";
3
+ import { Tooltip as w, Button as x } from "@veeqo/ui";
4
+ import { TableManagementGlyph as F } from "./index89.js";
5
+ import { observer as I } from "mobx-react";
6
+ import { useBusinessLogic as y } from "./index8.js";
7
+ import { useModal as P } from "./index52.js";
8
+ import { useStores as U } from "./index61.js";
9
+ import { useViews as G } from "./index62.js";
10
+ import { ModalId as M } from "./index51.js";
11
+ const X = I(
12
+ ({ columnDefinitions: f, pinnedRightColumnIds: i = [], pinnedLeftColumnIds: l = [] }) => {
13
+ var p;
14
+ const { DEFAULT_HIDDEN_COLUMNS: b, DEFAULT_VISIBLE_COLUMNS: g } = y(), t = [...l, ...i], a = b.filter((o) => !t.includes(o)), m = g.filter((o) => !t.includes(o)), T = [...a, ...m], { closeModal: E, isModalOpen: A, openModal: D } = P(), {
15
+ Filters: { activeViewId: n },
16
+ Views: { draftViewsMap: h }
17
+ } = U(), { viewsMap: C, isLoading: L } = G();
18
+ if (!n || L) return null;
19
+ const e = C.get(n), r = Array.isArray((p = e == null ? void 0 : e.columns) == null ? void 0 : p.columnIds), c = r ? e.columns.columnIds.filter((o) => !t.includes(o)) : m, N = r ? T.filter((o) => !c.includes(o)) : a, u = h.has(n), d = !(e != null && e.editable), S = d || u, _ = u ? "Please create a view to use table management" : d ? "Please choose a custom view to use table management" : "Table management";
20
+ return /* @__PURE__ */ v(B, { children: [
21
+ /* @__PURE__ */ s(w, { text: _, children: /* @__PURE__ */ s(
22
+ x,
23
+ {
24
+ "aria-label": "Open table management",
25
+ onClick: () => D(M.ORDERS_TABLE_MANAGEMENT),
26
+ size: "sm",
27
+ iconSlot: /* @__PURE__ */ s(F, {}),
28
+ disabled: S
29
+ }
30
+ ) }),
31
+ A(M.ORDERS_TABLE_MANAGEMENT) && /* @__PURE__ */ s(
32
+ O,
33
+ {
34
+ pinnedRightColumnIds: i,
35
+ pinnedLeftColumnIds: l,
36
+ visibleColumns: c,
37
+ hiddenColumns: N,
38
+ columnDefinitions: f,
39
+ onClose: E
40
+ }
41
+ )
42
+ ] });
14
43
  }
15
- }) => {
16
- const { hasChanges: r, acknowledgeButtonClick: i } = c(), {
17
- Notifications: { notify: f }
18
- } = b(), h = async () => {
19
- try {
20
- await a(), await i(), e == null || e();
21
- } catch {
22
- f({ type: "error", text: "Failed to refresh data" });
23
- }
24
- };
25
- return /* @__PURE__ */ m(d, { className: t.refreshTooltip, text: l, children: [
26
- /* @__PURE__ */ o(
27
- p,
28
- {
29
- className: t.refreshButton,
30
- onClick: h,
31
- loading: s,
32
- disabled: s,
33
- iconSlot: /* @__PURE__ */ o(u, { color: y.colors.neutral.ink.base }),
34
- "aria-label": r ? "refresh table with changes" : "refresh table",
35
- "aria-live": "polite",
36
- ...n
37
- }
38
- ),
39
- /* @__PURE__ */ o(x, { className: t.refreshIndicator, color: "red", size: "xs", style: { opacity: r ? 1 : 0 } })
40
- ] });
41
- };
44
+ );
42
45
  export {
43
- j as RefreshButton
46
+ X as TableManagement
44
47
  };
package/dist/index47.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("@veeqo/ui"),_={...T.DateRanges,CUSTOM:"CUSTOM"},A=new Map([["CUSTOM",T.DATE_RANGE_OPTIONS[0]],[_.TODAY,T.DATE_RANGE_OPTIONS[1]],[_.YESTERDAY,T.DATE_RANGE_OPTIONS[2]],[_.LAST_7_DAYS,T.DATE_RANGE_OPTIONS[3]],[_.LAST_30_DAYS,T.DATE_RANGE_OPTIONS[4]],[_.LAST_90_DAYS,T.DATE_RANGE_OPTIONS[5]],[_.LAST_MONTH,T.DATE_RANGE_OPTIONS[6]],[_.LAST_12_MONTHS,T.DATE_RANGE_OPTIONS[7]],[_.WEEK_TO_DATE,T.DATE_RANGE_OPTIONS[8]],[_.MONTH_TO_DATE,T.DATE_RANGE_OPTIONS[9]],[_.YEAR_TO_DATE,T.DATE_RANGE_OPTIONS[10]]]);exports.DateOptionMap=A;exports.DateValue=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),h=require("./index85.cjs"),e=require("@veeqo/ui"),o=require("./index86.cjs"),d=require("./index61.cjs"),m=({isLoading:a,refetch:n,trackMetricClick:s,tooltipText:l="Refresh data",buttonProps:i={size:"sm",variant:"default"}})=>{const{hasChanges:r,acknowledgeButtonClick:u}=h.usePollData(),{Notifications:{notify:c}}=d.useStores(),f=async()=>{try{await n(),await u(),s==null||s()}catch{c({type:"error",text:"Failed to refresh data"})}};return t.jsxs(e.Tooltip,{className:o.default.refreshTooltip,text:l,children:[t.jsx(e.Button,{className:o.default.refreshButton,onClick:f,loading:a,disabled:a,iconSlot:t.jsx(e.RefreshIcon,{color:e.theme.colors.neutral.ink.base}),"aria-label":r?"refresh table with changes":"refresh table","aria-live":"polite",...i}),t.jsx(e.Indicator,{className:o.default.refreshIndicator,color:"red",size:"xs",style:{opacity:r?1:0}})]})};exports.RefreshButton=m;
package/dist/index47.js CHANGED
@@ -1,21 +1,44 @@
1
- import { DateRanges as A, DATE_RANGE_OPTIONS as T } from "@veeqo/ui";
2
- const _ = {
3
- ...A,
4
- CUSTOM: "CUSTOM"
5
- }, O = /* @__PURE__ */ new Map([
6
- ["CUSTOM", T[0]],
7
- [_.TODAY, T[1]],
8
- [_.YESTERDAY, T[2]],
9
- [_.LAST_7_DAYS, T[3]],
10
- [_.LAST_30_DAYS, T[4]],
11
- [_.LAST_90_DAYS, T[5]],
12
- [_.LAST_MONTH, T[6]],
13
- [_.LAST_12_MONTHS, T[7]],
14
- [_.WEEK_TO_DATE, T[8]],
15
- [_.MONTH_TO_DATE, T[9]],
16
- [_.YEAR_TO_DATE, T[10]]
17
- ]);
1
+ import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
+ import { usePollData as c } from "./index85.js";
3
+ import { Tooltip as d, Button as p, RefreshIcon as u, theme as y, Indicator as x } from "@veeqo/ui";
4
+ import t from "./index86.js";
5
+ import { useStores as b } from "./index61.js";
6
+ const j = ({
7
+ isLoading: s,
8
+ refetch: a,
9
+ trackMetricClick: e,
10
+ tooltipText: l = "Refresh data",
11
+ buttonProps: n = {
12
+ size: "sm",
13
+ variant: "default"
14
+ }
15
+ }) => {
16
+ const { hasChanges: r, acknowledgeButtonClick: i } = c(), {
17
+ Notifications: { notify: f }
18
+ } = b(), h = async () => {
19
+ try {
20
+ await a(), await i(), e == null || e();
21
+ } catch {
22
+ f({ type: "error", text: "Failed to refresh data" });
23
+ }
24
+ };
25
+ return /* @__PURE__ */ m(d, { className: t.refreshTooltip, text: l, children: [
26
+ /* @__PURE__ */ o(
27
+ p,
28
+ {
29
+ className: t.refreshButton,
30
+ onClick: h,
31
+ loading: s,
32
+ disabled: s,
33
+ iconSlot: /* @__PURE__ */ o(u, { color: y.colors.neutral.ink.base }),
34
+ "aria-label": r ? "refresh table with changes" : "refresh table",
35
+ "aria-live": "polite",
36
+ ...n
37
+ }
38
+ ),
39
+ /* @__PURE__ */ o(x, { className: t.refreshIndicator, color: "red", size: "xs", style: { opacity: r ? 1 : 0 } })
40
+ ] });
41
+ };
18
42
  export {
19
- O as DateOptionMap,
20
- _ as DateValue
43
+ j as RefreshButton
21
44
  };
package/dist/index48.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var O=(e=>(e.TEXT="text",e.NUMBER="number",e.CHECKBOX="checkbox",e.RADIO="radio",e.DATE_RANGE="date_range",e.NUMBER_RANGE="number_range",e))(O||{});const n={revalidateOnFocus:!1,revalidateOnReconnect:!1,keepPreviousData:!0};exports.FilterChoiceValue=O;exports.SWR_HOOK_OPTIONS=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("@veeqo/ui"),_={...T.DateRanges,CUSTOM:"CUSTOM"},A=new Map([["CUSTOM",T.DATE_RANGE_OPTIONS[0]],[_.TODAY,T.DATE_RANGE_OPTIONS[1]],[_.YESTERDAY,T.DATE_RANGE_OPTIONS[2]],[_.LAST_7_DAYS,T.DATE_RANGE_OPTIONS[3]],[_.LAST_30_DAYS,T.DATE_RANGE_OPTIONS[4]],[_.LAST_90_DAYS,T.DATE_RANGE_OPTIONS[5]],[_.LAST_MONTH,T.DATE_RANGE_OPTIONS[6]],[_.LAST_12_MONTHS,T.DATE_RANGE_OPTIONS[7]],[_.WEEK_TO_DATE,T.DATE_RANGE_OPTIONS[8]],[_.MONTH_TO_DATE,T.DATE_RANGE_OPTIONS[9]],[_.YEAR_TO_DATE,T.DATE_RANGE_OPTIONS[10]]]);exports.DateOptionMap=A;exports.DateValue=_;
package/dist/index48.js CHANGED
@@ -1,10 +1,21 @@
1
- var a = /* @__PURE__ */ ((n) => (n.TEXT = "text", n.NUMBER = "number", n.CHECKBOX = "checkbox", n.RADIO = "radio", n.DATE_RANGE = "date_range", n.NUMBER_RANGE = "number_range", n))(a || {});
2
- const r = {
3
- revalidateOnFocus: !1,
4
- revalidateOnReconnect: !1,
5
- keepPreviousData: !0
6
- };
1
+ import { DateRanges as A, DATE_RANGE_OPTIONS as T } from "@veeqo/ui";
2
+ const _ = {
3
+ ...A,
4
+ CUSTOM: "CUSTOM"
5
+ }, O = /* @__PURE__ */ new Map([
6
+ ["CUSTOM", T[0]],
7
+ [_.TODAY, T[1]],
8
+ [_.YESTERDAY, T[2]],
9
+ [_.LAST_7_DAYS, T[3]],
10
+ [_.LAST_30_DAYS, T[4]],
11
+ [_.LAST_90_DAYS, T[5]],
12
+ [_.LAST_MONTH, T[6]],
13
+ [_.LAST_12_MONTHS, T[7]],
14
+ [_.WEEK_TO_DATE, T[8]],
15
+ [_.MONTH_TO_DATE, T[9]],
16
+ [_.YEAR_TO_DATE, T[10]]
17
+ ]);
7
18
  export {
8
- a as FilterChoiceValue,
9
- r as SWR_HOOK_OPTIONS
19
+ O as DateOptionMap,
20
+ _ as DateValue
10
21
  };
package/dist/index49.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),e=require("react"),r=e.createContext(null),M=({children:u})=>{const[s,n]=e.useState(null),t=e.useCallback(o=>o===s,[s]),l=e.useCallback(()=>{n(null)},[]),a=e.useCallback(o=>{n(o)},[]),c=e.useCallback(o=>{t(o)?l():a(o)},[l,t,a]),d=e.useMemo(()=>({closeModal:l,isModalOpen:t,openModal:a,toggleModal:c}),[l,t,a,c]);return i.jsx(r.Provider,{value:d,children:u})};exports.ModalContext=r;exports.ModalProvider=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var O=(e=>(e.TEXT="text",e.NUMBER="number",e.CHECKBOX="checkbox",e.RADIO="radio",e.DATE_RANGE="date_range",e.NUMBER_RANGE="number_range",e))(O||{});const n={revalidateOnFocus:!1,revalidateOnReconnect:!1,keepPreviousData:!0};exports.FilterChoiceValue=O;exports.SWR_HOOK_OPTIONS=n;
package/dist/index49.js CHANGED
@@ -1,25 +1,10 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { useState as i, useCallback as n, useMemo as u, createContext as p } from "react";
3
- const v = p(null), f = ({ children: r }) => {
4
- const [s, a] = i(null), e = n(
5
- (o) => o === s,
6
- [s]
7
- ), t = n(() => {
8
- a(null);
9
- }, []), l = n((o) => {
10
- a(o);
11
- }, []), c = n(
12
- (o) => {
13
- e(o) ? t() : l(o);
14
- },
15
- [t, e, l]
16
- ), M = u(
17
- () => ({ closeModal: t, isModalOpen: e, openModal: l, toggleModal: c }),
18
- [t, e, l, c]
19
- );
20
- return /* @__PURE__ */ d(v.Provider, { value: M, children: r });
1
+ var a = /* @__PURE__ */ ((n) => (n.TEXT = "text", n.NUMBER = "number", n.CHECKBOX = "checkbox", n.RADIO = "radio", n.DATE_RANGE = "date_range", n.NUMBER_RANGE = "number_range", n))(a || {});
2
+ const r = {
3
+ revalidateOnFocus: !1,
4
+ revalidateOnReconnect: !1,
5
+ keepPreviousData: !0
21
6
  };
22
7
  export {
23
- v as ModalContext,
24
- f as ModalProvider
8
+ a as FilterChoiceValue,
9
+ r as SWR_HOOK_OPTIONS
25
10
  };
package/dist/index5.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index7.cjs"),i=require("./index52.cjs"),o=require("./index53.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("./index7.cjs"),i=require("./index53.cjs"),o=require("./index54.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/index5.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { axios as i } from "./index7.js";
2
- import { withCSRF as m } from "./index52.js";
3
- import { vndAPI as p } from "./index53.js";
2
+ import { withCSRF as m } from "./index53.js";
3
+ import { vndAPI as p } from "./index54.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/index50.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var E=(e=>(e.ORDERS_TABLE_MANAGEMENT="ORDERS_TABLE_MANAGEMENT",e))(E||{});exports.ModalId=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),e=require("react"),r=e.createContext(null),M=({children:u})=>{const[s,n]=e.useState(null),t=e.useCallback(o=>o===s,[s]),l=e.useCallback(()=>{n(null)},[]),a=e.useCallback(o=>{n(o)},[]),c=e.useCallback(o=>{t(o)?l():a(o)},[l,t,a]),d=e.useMemo(()=>({closeModal:l,isModalOpen:t,openModal:a,toggleModal:c}),[l,t,a,c]);return i.jsx(r.Provider,{value:d,children:u})};exports.ModalContext=r;exports.ModalProvider=M;
package/dist/index50.js CHANGED
@@ -1,4 +1,25 @@
1
- var A = /* @__PURE__ */ ((E) => (E.ORDERS_TABLE_MANAGEMENT = "ORDERS_TABLE_MANAGEMENT", E))(A || {});
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { useState as i, useCallback as n, useMemo as u, createContext as p } from "react";
3
+ const v = p(null), f = ({ children: r }) => {
4
+ const [s, a] = i(null), e = n(
5
+ (o) => o === s,
6
+ [s]
7
+ ), t = n(() => {
8
+ a(null);
9
+ }, []), l = n((o) => {
10
+ a(o);
11
+ }, []), c = n(
12
+ (o) => {
13
+ e(o) ? t() : l(o);
14
+ },
15
+ [t, e, l]
16
+ ), M = u(
17
+ () => ({ closeModal: t, isModalOpen: e, openModal: l, toggleModal: c }),
18
+ [t, e, l, c]
19
+ );
20
+ return /* @__PURE__ */ d(v.Provider, { value: M, children: r });
21
+ };
2
22
  export {
3
- A as ModalId
23
+ v as ModalContext,
24
+ f as ModalProvider
4
25
  };
package/dist/index51.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index49.cjs"),o=()=>e.useContext(t.ModalContext);exports.useModal=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var E=(e=>(e.ORDERS_TABLE_MANAGEMENT="ORDERS_TABLE_MANAGEMENT",e))(E||{});exports.ModalId=E;
package/dist/index51.js CHANGED
@@ -1,6 +1,4 @@
1
- import { useContext as o } from "react";
2
- import { ModalContext as t } from "./index49.js";
3
- const m = () => o(t);
1
+ var A = /* @__PURE__ */ ((E) => (E.ORDERS_TABLE_MANAGEMENT = "ORDERS_TABLE_MANAGEMENT", E))(A || {});
4
2
  export {
5
- m as useModal
3
+ A as ModalId
6
4
  };
package/dist/index52.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=(t={})=>{const{headers:r={}}=t,e=document.querySelector('meta[name="csrf-token"]'),n=e?e.content:null,o=window.localStorage.csrf||n;return o?{...t,headers:{...r,"x-csrf-token":o}}:t};exports.withCSRF=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index50.cjs"),o=()=>e.useContext(t.ModalContext);exports.useModal=o;
package/dist/index52.js CHANGED
@@ -1,13 +1,6 @@
1
- const a = (t = {}) => {
2
- const { headers: n = {} } = t, e = document.querySelector('meta[name="csrf-token"]'), r = e ? e.content : null, o = window.localStorage.csrf || r;
3
- return o ? {
4
- ...t,
5
- headers: {
6
- ...n,
7
- "x-csrf-token": o
8
- }
9
- } : t;
10
- };
1
+ import { useContext as o } from "react";
2
+ import { ModalContext as t } from "./index50.js";
3
+ const m = () => o(t);
11
4
  export {
12
- a as withCSRF
5
+ m as useModal
13
6
  };
package/dist/index53.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n={headers:{Accept:"application/json","Content-Type":"application/json"}},o={headers:{"Content-Type":"application/vnd.api+json",Accept:"application/vnd.api+json"}};exports.onlyJSON=n;exports.vndAPI=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=(t={})=>{const{headers:r={}}=t,e=document.querySelector('meta[name="csrf-token"]'),n=e?e.content:null,o=window.localStorage.csrf||n;return o?{...t,headers:{...r,"x-csrf-token":o}}:t};exports.withCSRF=c;
package/dist/index53.js CHANGED
@@ -1,15 +1,13 @@
1
- const n = {
2
- headers: {
3
- Accept: "application/json",
4
- "Content-Type": "application/json"
5
- }
6
- }, p = {
7
- headers: {
8
- "Content-Type": "application/vnd.api+json",
9
- Accept: "application/vnd.api+json"
10
- }
1
+ const a = (t = {}) => {
2
+ const { headers: n = {} } = t, e = document.querySelector('meta[name="csrf-token"]'), r = e ? e.content : null, o = window.localStorage.csrf || r;
3
+ return o ? {
4
+ ...t,
5
+ headers: {
6
+ ...n,
7
+ "x-csrf-token": o
8
+ }
9
+ } : t;
11
10
  };
12
11
  export {
13
- n as onlyJSON,
14
- p as vndAPI
12
+ a as withCSRF
15
13
  };
package/dist/index54.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("kitsu-core"),a=require("./index52.cjs"),n=require("./index53.cjs"),i=require("./index7.cjs"),f=async e=>(await i.axios.get(e,a.withCSRF(n.onlyJSON))).data,l=async(e,t={})=>{const{serialize:o=!0,includeMeta:c=!1}=t,r=await i.axios.get(e,a.withCSRF(n.vndAPI));if(!o)return r.data;const{data:s,meta:u}=d.deserialise(r.data);return c?{data:s,meta:u}:s};exports.fetcherV1=f;exports.fetcherV2=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n={headers:{Accept:"application/json","Content-Type":"application/json"}},o={headers:{"Content-Type":"application/vnd.api+json",Accept:"application/vnd.api+json"}};exports.onlyJSON=n;exports.vndAPI=o;
package/dist/index54.js CHANGED
@@ -1,14 +1,15 @@
1
- import { deserialise as f } from "kitsu-core";
2
- import { withCSRF as o } from "./index52.js";
3
- import { onlyJSON as m, vndAPI as p } from "./index53.js";
4
- import { axios as s } from "./index7.js";
5
- const w = async (t) => (await s.get(t, o(m))).data, y = async (t, e = {}) => {
6
- const { serialize: n = !0, includeMeta: i = !1 } = e, r = await s.get(t, o(p));
7
- if (!n) return r.data;
8
- const { data: a, meta: c } = f(r.data);
9
- return i ? { data: a, meta: c } : a;
1
+ const n = {
2
+ headers: {
3
+ Accept: "application/json",
4
+ "Content-Type": "application/json"
5
+ }
6
+ }, p = {
7
+ headers: {
8
+ "Content-Type": "application/vnd.api+json",
9
+ Accept: "application/vnd.api+json"
10
+ }
10
11
  };
11
12
  export {
12
- w as fetcherV1,
13
- y as fetcherV2
13
+ n as onlyJSON,
14
+ p as vndAPI
14
15
  };
package/dist/index55.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),C=require("./index78.cjs"),Y=require("./index77.cjs"),k=require("./index64.cjs"),G=require("./index56.cjs"),H=require("./index59.cjs"),W=require("./index61.cjs"),a=require("./index44.cjs"),N=require("./index4.cjs"),$=require("./index3.cjs"),B=require("./index8.cjs"),b=require("./index60.cjs"),j=require("./index6.cjs"),z=require("./index5.cjs"),J=e=>{const{VIEW_TYPE:r}=B.useBusinessLogic(),{duplicateView:P}=G.useDuplicateActiveView(),{getActiveViewInAPIFormat:q}=H.usePersistUnsavedChanges(),{canDeleteCustomViews:_,defaultCustomViewId:E,canUpdateCustomViews:M,mutate:x}=k.useCustomViews({type:r}),{mutate:l,viewsMap:w,viewsArray:L}=W.useViews(),[I,o]=c.useState(!1),[A,p]=c.useState(!1),[h,n]=c.useState(!1),[F,f]=c.useState(!1),{Views:{removeDraftViewById:S,draftViewsMap:R},Filters:{initFiltersFromView:u,updateUrl:d,setActiveViewId:O},Notifications:{notify:i}}=b.useStores();return{actions:{delete:{handleDeleteDraftView:()=>{if(!e.originalView)throw Error("No draft view found");S(e.id);const t=w.get(E);if(t)t&&u(t);else{const s=w.get(C.ALL_VIEW_ID);s&&u(s)}d()},handleDelete:async()=>{try{if(_){await $.deleteCustomView(Number(e.id)),await l();const t=w.get(C.ALL_VIEW_ID);t&&u(t),d(),A&&p(!1),h&&n(h),i({type:"success",text:`'${e.label}' has been deleted`})}else i({type:"info",text:"You require additional user permissions to delete a company shared view"})}catch{i({type:"error",text:"Failed to delete view"})}},handleShowDeleteConfirmation:()=>{if(R.has(e.id)){S(e.id),e.originalView?O(e.originalView.id):O(C.ALL_VIEW_ID);return}_?p(!0):i({type:"info",text:"You require additional user permissions to delete a company shared view"})},closeDeleteConfirmation:()=>p(!1)},edit:{handleShowEditDropdown:()=>{o(!1),n(!0)},closeEditDropdown:()=>n(!1)},menu:{handleSave:async t=>{try{const{viewName:s,shareOption:D,isDefault:m}=t,V=D==="company"?a.SHARING_OPTIONS.COMPANY:a.SHARING_OPTIONS.PERSONAL,y={attributes:{title:s,shared:V.key===a.SHARING_OPTIONS.COMPANY.key}};await z.patchCustomView(e.id,y),m&&(await N.patchCurrentUser({user_setting_attributes:{default_custom_view:{id:Number(e.id),type:r}}}),await x()),await l(),d(),i({type:"success",text:`'${s}' view updated`}),n(!1)}catch{i({type:"error",text:"Failed to save view"})}},handleDuplicate:()=>{P(),o(!1)},handleMakeDefault:async()=>{try{await N.patchCurrentUser({user_setting_attributes:{default_custom_view:{id:Number(e.id),type:r}}}),i({type:"success",text:`'${e.label}' is now your default view`}),o(!1)}catch{i({type:"error",text:"Failed to set default view"})}},openDropdown:()=>o(!0),closeDropdown:()=>o(!1),toggleDropdown:()=>o(!I)},create:{handleCreate:async t=>{try{const{viewName:s,shareOption:D,isDefault:m}=t,V=D==="company"?a.SHARING_OPTIONS.COMPANY:a.SHARING_OPTIONS.PERSONAL,{arg:y}=q(),{data:v}=await j.createCustomView({attributes:{...y,title:s,shared:V.key===a.SHARING_OPTIONS.COMPANY.key}}),g=L.map(U=>U.id);g.push(v.id),await N.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:g},...m?{default_custom_view:{id:Number(v.id),type:r}}:{}}}),await l(),S(e.id);const T=Y.viewsAdapter({view:v,canUpdateCustomViews:M});u(T),d(),f(!1),i({type:"success",text:`New view '${s}' created`})}catch(s){console.log(s),i({type:"error",text:"Failed to save draft view"})}},closeCreateDropdown:()=>f(!1),handleSaveDraft:async()=>{f(!0)}}},state:{shouldShowDropdown:I,shouldShowEditDropdown:h,shouldShowCreateDropdown:F,shouldShowDeleteConfirmation:A}}};exports.useDropdownManager=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("kitsu-core"),a=require("./index53.cjs"),n=require("./index54.cjs"),i=require("./index7.cjs"),f=async e=>(await i.axios.get(e,a.withCSRF(n.onlyJSON))).data,l=async(e,t={})=>{const{serialize:o=!0,includeMeta:c=!1}=t,r=await i.axios.get(e,a.withCSRF(n.vndAPI));if(!o)return r.data;const{data:s,meta:u}=d.deserialise(r.data);return c?{data:s,meta:u}:s};exports.fetcherV1=f;exports.fetcherV2=l;
package/dist/index55.js CHANGED
@@ -1,187 +1,14 @@
1
- import { useState as w } from "react";
2
- import { ALL_VIEW_ID as C } from "./index78.js";
3
- import { viewsAdapter as R } from "./index77.js";
4
- import { useCustomViews as q } from "./index64.js";
5
- import { useDuplicateActiveView as B } from "./index56.js";
6
- import { usePersistUnsavedChanges as T } from "./index59.js";
7
- import { useViews as W } from "./index61.js";
8
- import { SHARING_OPTIONS as s } from "./index44.js";
9
- import { patchCurrentUser as _ } from "./index4.js";
10
- import { deleteCustomView as G } from "./index3.js";
11
- import { useBusinessLogic as H } from "./index8.js";
12
- import { useStores as b } from "./index60.js";
13
- import { createCustomView as j } from "./index6.js";
14
- import { patchCustomView as z } from "./index5.js";
15
- const ye = (e) => {
16
- const { VIEW_TYPE: r } = H(), { duplicateView: E } = B(), { getActiveViewInAPIFormat: I } = T(), {
17
- canDeleteCustomViews: g,
18
- defaultCustomViewId: P,
19
- canUpdateCustomViews: M,
20
- mutate: F
21
- } = q({
22
- type: r
23
- }), { mutate: c, viewsMap: u, viewsArray: Y } = W(), [N, a] = w(!1), [A, f] = w(!1), [p, n] = w(!1), [k, m] = w(!1), {
24
- Views: { removeDraftViewById: h, draftViewsMap: L },
25
- Filters: { initFiltersFromView: d, updateUrl: l, setActiveViewId: O },
26
- Notifications: { notify: i }
27
- } = b();
28
- return {
29
- actions: {
30
- delete: {
31
- handleDeleteDraftView: () => {
32
- if (!e.originalView) throw Error("No draft view found");
33
- h(e.id);
34
- const t = u.get(P);
35
- if (t)
36
- t && d(t);
37
- else {
38
- const o = u.get(C);
39
- o && d(o);
40
- }
41
- l();
42
- },
43
- handleDelete: async () => {
44
- try {
45
- if (g) {
46
- await G(Number(e.id)), await c();
47
- const t = u.get(C);
48
- t && d(t), l(), A && f(!1), p && n(p), i({
49
- type: "success",
50
- text: `'${e.label}' has been deleted`
51
- });
52
- } else
53
- i({
54
- type: "info",
55
- text: "You require additional user permissions to delete a company shared view"
56
- });
57
- } catch {
58
- i({
59
- type: "error",
60
- text: "Failed to delete view"
61
- });
62
- }
63
- },
64
- handleShowDeleteConfirmation: () => {
65
- if (L.has(e.id)) {
66
- h(e.id), e.originalView ? O(e.originalView.id) : O(C);
67
- return;
68
- }
69
- g ? f(!0) : i({
70
- type: "info",
71
- text: "You require additional user permissions to delete a company shared view"
72
- });
73
- },
74
- closeDeleteConfirmation: () => f(!1)
75
- },
76
- edit: {
77
- handleShowEditDropdown: () => {
78
- a(!1), n(!0);
79
- },
80
- closeEditDropdown: () => n(!1)
81
- },
82
- menu: {
83
- handleSave: async (t) => {
84
- try {
85
- const { viewName: o, shareOption: D, isDefault: y } = t, v = D === "company" ? s.COMPANY : s.PERSONAL, V = {
86
- attributes: {
87
- title: o,
88
- shared: v.key === s.COMPANY.key
89
- }
90
- };
91
- await z(e.id, V), y && (await _({
92
- user_setting_attributes: {
93
- default_custom_view: {
94
- id: Number(e.id),
95
- type: r
96
- }
97
- }
98
- }), await F()), await c(), l(), i({
99
- type: "success",
100
- text: `'${o}' view updated`
101
- }), n(!1);
102
- } catch {
103
- i({
104
- type: "error",
105
- text: "Failed to save view"
106
- });
107
- }
108
- },
109
- handleDuplicate: () => {
110
- E(), a(!1);
111
- },
112
- handleMakeDefault: async () => {
113
- try {
114
- await _({
115
- user_setting_attributes: {
116
- default_custom_view: {
117
- id: Number(e.id),
118
- type: r
119
- }
120
- }
121
- }), i({
122
- type: "success",
123
- text: `'${e.label}' is now your default view`
124
- }), a(!1);
125
- } catch {
126
- i({
127
- type: "error",
128
- text: "Failed to set default view"
129
- });
130
- }
131
- },
132
- openDropdown: () => a(!0),
133
- closeDropdown: () => a(!1),
134
- toggleDropdown: () => a(!N)
135
- },
136
- create: {
137
- handleCreate: async (t) => {
138
- try {
139
- const { viewName: o, shareOption: D, isDefault: y } = t, v = D === "company" ? s.COMPANY : s.PERSONAL, { arg: V } = I(), { data: S } = await j({
140
- attributes: {
141
- ...V,
142
- title: o,
143
- shared: v.key === s.COMPANY.key
144
- }
145
- }), x = Y.map(($) => $.id);
146
- x.push(S.id), await _({
147
- user_setting_attributes: {
148
- custom_view_positions: {
149
- order: x
150
- },
151
- ...y ? {
152
- default_custom_view: {
153
- id: Number(S.id),
154
- type: r
155
- }
156
- } : {}
157
- }
158
- }), await c(), h(e.id);
159
- const U = R({ view: S, canUpdateCustomViews: M });
160
- d(U), l(), m(!1), i({
161
- type: "success",
162
- text: `New view '${o}' created`
163
- });
164
- } catch (o) {
165
- console.log(o), i({
166
- type: "error",
167
- text: "Failed to save draft view"
168
- });
169
- }
170
- },
171
- closeCreateDropdown: () => m(!1),
172
- handleSaveDraft: async () => {
173
- m(!0);
174
- }
175
- }
176
- },
177
- state: {
178
- shouldShowDropdown: N,
179
- shouldShowEditDropdown: p,
180
- shouldShowCreateDropdown: k,
181
- shouldShowDeleteConfirmation: A
182
- }
183
- };
1
+ import { deserialise as f } from "kitsu-core";
2
+ import { withCSRF as o } from "./index53.js";
3
+ import { onlyJSON as m, vndAPI as p } from "./index54.js";
4
+ import { axios as s } from "./index7.js";
5
+ const w = async (t) => (await s.get(t, o(m))).data, y = async (t, e = {}) => {
6
+ const { serialize: n = !0, includeMeta: i = !1 } = e, r = await s.get(t, o(p));
7
+ if (!n) return r.data;
8
+ const { data: a, meta: c } = f(r.data);
9
+ return i ? { data: a, meta: c } : a;
184
10
  };
185
11
  export {
186
- ye as useDropdownManager
12
+ w as fetcherV1,
13
+ y as fetcherV2
187
14
  };