@veeqo/transfigure 0.0.4 → 0.0.6

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 (223) hide show
  1. package/dist/BusinessLogic/types.d.ts +2 -0
  2. package/dist/components/TableManagement/DndContainer.d.ts +11 -0
  3. package/dist/components/TableManagement/TableManagement.d.ts +6 -0
  4. package/dist/components/TableManagement/TableManagementGlyph.d.ts +4 -0
  5. package/dist/components/TableManagement/TableManagementModal.d.ts +2 -0
  6. package/dist/components/TableManagement/components/ColumnGroup.d.ts +2 -0
  7. package/dist/components/TableManagement/components/ColumnItem.d.ts +2 -0
  8. package/dist/components/TableManagement/components/DroppableArea.d.ts +8 -0
  9. package/dist/components/TableManagement/components/SortableItem.d.ts +7 -0
  10. package/dist/components/TableManagement/components/styled.d.ts +28 -0
  11. package/dist/components/TableManagement/components/types.d.ts +11 -0
  12. package/dist/components/TableManagement/hooks/useCollisionDetectionStrategy/index.d.ts +1 -0
  13. package/dist/components/TableManagement/hooks/useCollisionDetectionStrategy/types.d.ts +4 -0
  14. package/dist/components/TableManagement/hooks/useCollisionDetectionStrategy/useCollisionDetectionStrategy.d.ts +5 -0
  15. package/dist/components/TableManagement/hooks/useDragHandlers/index.d.ts +1 -0
  16. package/dist/components/TableManagement/hooks/useDragHandlers/types.d.ts +6 -0
  17. package/dist/components/TableManagement/hooks/useDragHandlers/useDragHandlers.d.ts +9 -0
  18. package/dist/components/TableManagement/index.d.ts +1 -0
  19. package/dist/components/TableManagement/types.d.ts +17 -0
  20. package/dist/components/TableManagement/utils/filterColumnsBySearch/filterColumnsBySearch.d.ts +2 -0
  21. package/dist/components/TableManagement/utils/filterColumnsBySearch/index.d.ts +1 -0
  22. package/dist/hooks/index.d.ts +1 -0
  23. package/dist/hooks/useHiddenColumns/index.d.ts +1 -0
  24. package/dist/hooks/useHiddenColumns/useHiddenColumns.d.ts +7 -0
  25. package/dist/hooks/usePersistColumns/index.d.ts +1 -0
  26. package/dist/hooks/usePersistColumns/usePersistColumns.d.ts +6 -0
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.d.ts +1 -0
  29. package/dist/index.js +79 -75
  30. package/dist/index100.cjs +13 -0
  31. package/dist/index100.js +19 -0
  32. package/dist/index101.cjs +1 -0
  33. package/dist/index101.js +38 -0
  34. package/dist/index102.cjs +1 -0
  35. package/dist/index102.js +44 -0
  36. package/dist/index103.cjs +7 -0
  37. package/dist/index103.js +12 -0
  38. package/dist/index11.cjs +1 -1
  39. package/dist/index11.js +1 -1
  40. package/dist/index12.cjs +1 -1
  41. package/dist/index12.js +1 -1
  42. package/dist/index13.cjs +1 -1
  43. package/dist/index13.js +1 -1
  44. package/dist/index14.cjs +1 -1
  45. package/dist/index14.js +2 -2
  46. package/dist/index15.cjs +1 -1
  47. package/dist/index15.js +2 -2
  48. package/dist/index16.cjs +1 -1
  49. package/dist/index16.js +1 -1
  50. package/dist/index17.cjs +1 -1
  51. package/dist/index17.js +1 -1
  52. package/dist/index18.cjs +1 -1
  53. package/dist/index18.js +2 -2
  54. package/dist/index19.cjs +1 -1
  55. package/dist/index19.js +2 -2
  56. package/dist/index2.cjs +1 -1
  57. package/dist/index2.js +2 -2
  58. package/dist/index20.cjs +1 -1
  59. package/dist/index20.js +3 -3
  60. package/dist/index21.cjs +1 -1
  61. package/dist/index21.js +2 -2
  62. package/dist/index22.cjs +1 -1
  63. package/dist/index22.js +2 -2
  64. package/dist/index23.cjs +1 -1
  65. package/dist/index23.js +3 -3
  66. package/dist/index24.cjs +1 -1
  67. package/dist/index24.js +3 -3
  68. package/dist/index25.cjs +1 -1
  69. package/dist/index25.js +1 -1
  70. package/dist/index26.cjs +1 -1
  71. package/dist/index26.js +2 -2
  72. package/dist/index27.cjs +1 -1
  73. package/dist/index27.js +2 -2
  74. package/dist/index28.cjs +1 -1
  75. package/dist/index28.js +3 -3
  76. package/dist/index29.cjs +1 -1
  77. package/dist/index29.js +1 -1
  78. package/dist/index3.cjs +1 -1
  79. package/dist/index3.js +2 -2
  80. package/dist/index30.cjs +1 -1
  81. package/dist/index30.js +1 -1
  82. package/dist/index31.cjs +1 -1
  83. package/dist/index31.js +1 -1
  84. package/dist/index32.cjs +1 -1
  85. package/dist/index32.js +1 -1
  86. package/dist/index33.cjs +1 -1
  87. package/dist/index33.js +5 -5
  88. package/dist/index34.cjs +1 -1
  89. package/dist/index34.js +1 -1
  90. package/dist/index35.cjs +1 -1
  91. package/dist/index35.js +1 -1
  92. package/dist/index36.cjs +1 -1
  93. package/dist/index36.js +3 -3
  94. package/dist/index37.cjs +1 -1
  95. package/dist/index37.js +3 -3
  96. package/dist/index38.cjs +1 -1
  97. package/dist/index38.js +4 -4
  98. package/dist/index39.cjs +1 -1
  99. package/dist/index39.js +1 -1
  100. package/dist/index4.cjs +1 -1
  101. package/dist/index4.js +2 -2
  102. package/dist/index41.cjs +1 -1
  103. package/dist/index41.js +4 -4
  104. package/dist/index43.cjs +1 -1
  105. package/dist/index43.js +46 -19
  106. package/dist/index44.cjs +1 -1
  107. package/dist/index44.js +19 -2
  108. package/dist/index45.cjs +1 -1
  109. package/dist/index45.js +2 -23
  110. package/dist/index46.cjs +1 -1
  111. package/dist/index46.js +23 -2
  112. package/dist/index47.cjs +1 -1
  113. package/dist/index47.js +2 -4
  114. package/dist/index48.cjs +1 -1
  115. package/dist/index48.js +4 -11
  116. package/dist/index49.cjs +1 -1
  117. package/dist/index49.js +10 -12
  118. package/dist/index5.cjs +1 -1
  119. package/dist/index5.js +2 -2
  120. package/dist/index50.cjs +1 -1
  121. package/dist/index50.js +12 -11
  122. package/dist/index51.cjs +1 -1
  123. package/dist/index51.js +11 -184
  124. package/dist/index52.cjs +1 -1
  125. package/dist/index52.js +183 -25
  126. package/dist/index53.cjs +1 -1
  127. package/dist/index53.js +26 -24
  128. package/dist/index54.cjs +1 -1
  129. package/dist/index54.js +19 -22
  130. package/dist/index55.cjs +1 -1
  131. package/dist/index55.js +25 -90
  132. package/dist/index56.cjs +1 -1
  133. package/dist/index56.js +92 -8
  134. package/dist/index57.cjs +1 -1
  135. package/dist/index57.js +8 -50
  136. package/dist/index58.cjs +1 -1
  137. package/dist/index58.js +49 -60
  138. package/dist/index59.cjs +1 -1
  139. package/dist/index59.js +61 -17
  140. package/dist/index6.cjs +1 -1
  141. package/dist/index6.js +4 -4
  142. package/dist/index60.cjs +1 -1
  143. package/dist/index60.js +18 -316
  144. package/dist/index61.cjs +1 -1
  145. package/dist/index61.js +25 -59
  146. package/dist/index62.cjs +1 -1
  147. package/dist/index62.js +309 -50
  148. package/dist/index63.cjs +1 -1
  149. package/dist/index63.js +54 -31
  150. package/dist/index64.cjs +1 -1
  151. package/dist/index64.js +52 -27
  152. package/dist/index65.cjs +1 -1
  153. package/dist/index65.js +37 -4
  154. package/dist/index66.cjs +1 -1
  155. package/dist/index66.js +32 -9
  156. package/dist/index67.cjs +1 -1
  157. package/dist/index67.js +4 -17
  158. package/dist/index68.cjs +1 -1
  159. package/dist/index68.js +9 -19
  160. package/dist/index69.cjs +1 -1
  161. package/dist/index69.js +16 -46
  162. package/dist/index70.cjs +1 -1
  163. package/dist/index70.js +19 -17
  164. package/dist/index71.cjs +1 -1
  165. package/dist/index71.js +48 -2
  166. package/dist/index72.cjs +1 -1
  167. package/dist/index72.js +21 -9
  168. package/dist/index73.cjs +1 -3
  169. package/dist/index73.js +2 -14
  170. package/dist/index74.cjs +1 -1
  171. package/dist/index74.js +8 -8
  172. package/dist/index75.cjs +3 -1
  173. package/dist/index75.js +13 -28
  174. package/dist/index76.cjs +1 -19
  175. package/dist/index76.js +9 -24
  176. package/dist/index77.cjs +1 -1
  177. package/dist/index77.js +154 -14
  178. package/dist/index78.cjs +1 -12
  179. package/dist/index78.js +19 -16
  180. package/dist/index80.cjs +1 -1
  181. package/dist/index80.js +13 -22
  182. package/dist/index81.cjs +104 -1
  183. package/dist/index81.js +119 -23
  184. package/dist/index82.cjs +1 -1
  185. package/dist/index82.js +58 -2
  186. package/dist/index83.cjs +1 -13
  187. package/dist/index83.js +28 -16
  188. package/dist/index84.cjs +1 -80
  189. package/dist/index84.js +2 -95
  190. package/dist/index85.cjs +1 -1
  191. package/dist/index85.js +33 -35
  192. package/dist/index86.cjs +1 -1
  193. package/dist/index86.js +8 -63
  194. package/dist/index87.cjs +1 -7
  195. package/dist/index87.js +29 -10
  196. package/dist/index88.cjs +1 -0
  197. package/dist/index88.js +24 -0
  198. package/dist/index89.cjs +19 -0
  199. package/dist/index89.js +26 -0
  200. package/dist/index9.cjs +1 -1
  201. package/dist/index9.js +17 -15
  202. package/dist/index90.cjs +12 -0
  203. package/dist/index90.js +18 -0
  204. package/dist/index91.cjs +1 -0
  205. package/dist/index91.js +17 -0
  206. package/dist/index92.cjs +1 -0
  207. package/dist/index92.js +26 -0
  208. package/dist/index93.cjs +1 -0
  209. package/dist/index93.js +4 -0
  210. package/dist/index94.cjs +1 -0
  211. package/dist/index94.js +21 -0
  212. package/dist/index95.cjs +1 -0
  213. package/dist/index95.js +10 -0
  214. package/dist/index96.cjs +1 -0
  215. package/dist/index96.js +66 -0
  216. package/dist/index97.cjs +1 -0
  217. package/dist/index97.js +32 -0
  218. package/dist/index98.cjs +1 -0
  219. package/dist/index98.js +65 -0
  220. package/dist/index99.cjs +80 -0
  221. package/dist/index99.js +97 -0
  222. package/dist/types.d.ts +8 -0
  223. package/package.json +11 -2
package/dist/index36.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs as t, jsx as i, Fragment as f } from "react/jsx-runtime";
2
- import { MenuItems as M, Item as l, Divider as h } from "./index76.js";
3
- import { useModal as k } from "./index47.js";
4
- import { ModalId as T } from "./index46.js";
2
+ import { MenuItems as M, Item as l, Divider as h } from "./index89.js";
3
+ import { useModal as k } from "./index48.js";
4
+ import { ModalId as T } from "./index47.js";
5
5
  const N = ({
6
6
  tab: e,
7
7
  onMakeDefault: n,
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("./index57.cjs"),v=require("./index80.cjs"),g=require("./index39.cjs"),h=require("./index56.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"),a=require("react-transition-group"),f=require("mobx-react"),x=require("./index58.cjs"),v=require("./index88.cjs"),g=require("./index39.cjs"),h=require("./index57.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;
package/dist/index37.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { jsxs as u, Fragment as p, jsx as i } from "react/jsx-runtime";
2
2
  import { CSSTransition as a } from "react-transition-group";
3
3
  import { observer as h } from "mobx-react";
4
- import { useViews as v } from "./index57.js";
5
- import { InfoPill as w } from "./index80.js";
4
+ import { useViews as v } from "./index58.js";
5
+ import { InfoPill as w } from "./index88.js";
6
6
  import { UnsavedChangesPill as x } from "./index39.js";
7
- import { useStores as g } from "./index56.js";
7
+ import { useStores as g } from "./index57.js";
8
8
  const F = h(
9
9
  ({
10
10
  tabType: o,
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("./index77.cjs"),g=require("./index59.cjs"),S=require("./index57.cjs"),b=require("./index3.cjs"),y=require("./index7.cjs"),V=require("./index56.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 i=require("react/jsx-runtime"),d=require("react"),m=require("./index91.cjs"),g=require("./index60.cjs"),S=require("./index58.cjs"),b=require("./index3.cjs"),y=require("./index7.cjs"),V=require("./index57.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/index38.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { useState as f } from "react";
3
- import { LegacySortableViews as l } from "./index77.js";
4
- import { useCustomViews as w } from "./index59.js";
5
- import { useViews as d } from "./index57.js";
3
+ import { LegacySortableViews as l } from "./index91.js";
4
+ import { useCustomViews as w } from "./index60.js";
5
+ import { useViews as d } from "./index58.js";
6
6
  import { patchCurrentUser as g } from "./index3.js";
7
7
  import { useBusinessLogic as _ } from "./index7.js";
8
- import { useStores as S } from "./index56.js";
8
+ import { useStores as S } from "./index57.js";
9
9
  import { ErrorBoundary as b } from "./index10.js";
10
10
  const N = () => {
11
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) => {
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"),n=require("./index79.cjs"),u=require("./index55.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(n.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(n.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 e=require("react/jsx-runtime"),l=require("react"),s=require("@veeqo/ui"),h=require("mobx-react"),n=require("./index79.cjs"),u=require("./index56.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(n.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(n.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;
package/dist/index39.js CHANGED
@@ -3,7 +3,7 @@ import { useState as m } from "react";
3
3
  import { Stack as g, theme as u, AnimatedDropdown as v } from "@veeqo/ui";
4
4
  import { observer as p } from "mobx-react";
5
5
  import { Notification as f, Container as w, Glyph as C, Wrap as b, Text as a, Bold as y, Button as o, Item as r } from "./index79.js";
6
- import { usePersistUnsavedChanges as k } from "./index55.js";
6
+ import { usePersistUnsavedChanges as k } from "./index56.js";
7
7
  const S = u.colors.secondary.blue.base, A = p(
8
8
  ({
9
9
  onDiscard: s,
package/dist/index4.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index6.cjs"),i=require("./index48.cjs"),o=require("./index49.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("./index49.cjs"),o=require("./index50.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 "./index48.js";
3
- import { vndAPI as p } from "./index49.js";
2
+ import { withCSRF as m } from "./index49.js";
3
+ import { vndAPI as p } from "./index50.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/index41.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("./index78.cjs"),j=require("./index38.cjs"),m=require("./index57.cjs"),S=require("./index58.cjs"),q=require("./index34.cjs"),u=require("./index33.cjs"),p=require("./index56.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"),n=require("react"),V=require("mobx-react"),s=require("@veeqo/ui"),t=require("./index90.cjs"),j=require("./index38.cjs"),m=require("./index58.cjs"),S=require("./index59.cjs"),q=require("./index34.cjs"),u=require("./index33.cjs"),p=require("./index57.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;
package/dist/index41.js CHANGED
@@ -2,13 +2,13 @@ import { jsxs as i, Fragment as u, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as n } from "react";
3
3
  import { observer as h } from "mobx-react";
4
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 "./index78.js";
5
+ import { FixedViews as x, Divider as C } from "./index90.js";
6
6
  import { SortableViews as b } from "./index38.js";
7
- import { useViews as A } from "./index57.js";
8
- import { useViewUrlChange as L } from "./index58.js";
7
+ import { useViews as A } from "./index58.js";
8
+ import { useViewUrlChange as L } from "./index59.js";
9
9
  import { CreateView as M } from "./index34.js";
10
10
  import { ViewTab as s } from "./index33.js";
11
- import { useStores as T } from "./index56.js";
11
+ import { useStores as T } from "./index57.js";
12
12
  import { ErrorBoundary as m } from "./index10.js";
13
13
  const z = h(() => {
14
14
  const {
package/dist/index43.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 s=require("react/jsx-runtime"),S=require("./index77.cjs"),u=require("@veeqo/ui"),q=require("./index78.cjs"),A=require("mobx-react"),I=require("./index7.cjs"),L=require("./index48.cjs"),p=require("./index57.cjs"),x=require("./index58.cjs"),c=require("./index47.cjs"),C=A.observer(({columnDefinitions:r})=>{var i;const{DEFAULT_HIDDEN_COLUMNS:o,DEFAULT_VISIBLE_COLUMNS:n}=I.useBusinessLogic(),m=[...o,...n],{closeModal:d,isModalOpen:M,openModal:b}=L.useModal(),{Filters:{activeViewId:t}}=p.useStores(),{viewsMap:T}=x.useViews();if(!t)return null;const e=T.get(t),a=Array.isArray((i=e==null?void 0:e.columns)==null?void 0:i.columnIds),l=a?e.columns.columnIds:n,g=a?m.filter(E=>!l.includes(E)):o;return s.jsxs(s.Fragment,{children:[s.jsx(u.Tooltip,{text:e!=null&&e.editable?"Table management":"Go to a custom view to use Table management",children:s.jsx(u.Button,{"aria-label":"Open table management",onClick:()=>b(c.ModalId.ORDERS_TABLE_MANAGEMENT),size:"sm",iconSlot:s.jsx(q.TableManagementGlyph,{}),disabled:!(e!=null&&e.editable)})}),M(c.ModalId.ORDERS_TABLE_MANAGEMENT)&&s.jsx(S.TableManagementModal,{visibleColumns:l,hiddenColumns:g,columnDefintions:r,onClose:d})]})});exports.TableManagement=C;
package/dist/index43.js CHANGED
@@ -1,21 +1,48 @@
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 E, Fragment as T, jsx as e } from "react/jsx-runtime";
2
+ import { TableManagementModal as A } from "./index77.js";
3
+ import { Tooltip as g, Button as C } from "@veeqo/ui";
4
+ import { TableManagementGlyph as L } from "./index78.js";
5
+ import { observer as S } from "mobx-react";
6
+ import { useBusinessLogic as _ } from "./index7.js";
7
+ import { useModal as D } from "./index48.js";
8
+ import { useStores as I } from "./index57.js";
9
+ import { useViews as N } from "./index58.js";
10
+ import { ModalId as i } from "./index47.js";
11
+ const j = S(({ columnDefinitions: r }) => {
12
+ var a;
13
+ const { DEFAULT_HIDDEN_COLUMNS: s, DEFAULT_VISIBLE_COLUMNS: n } = _(), c = [...s, ...n], { closeModal: d, isModalOpen: p, openModal: u } = D(), { Filters: { activeViewId: t } } = I(), { viewsMap: M } = N();
14
+ if (!t) return null;
15
+ const o = M.get(t), m = Array.isArray((a = o == null ? void 0 : o.columns) == null ? void 0 : a.columnIds), l = m ? o.columns.columnIds : n, b = m ? c.filter(
16
+ (f) => !l.includes(f)
17
+ ) : s;
18
+ return /* @__PURE__ */ E(T, { children: [
19
+ /* @__PURE__ */ e(
20
+ g,
21
+ {
22
+ text: o != null && o.editable ? "Table management" : "Go to a custom view to use Table management",
23
+ children: /* @__PURE__ */ e(
24
+ C,
25
+ {
26
+ "aria-label": "Open table management",
27
+ onClick: () => u(i.ORDERS_TABLE_MANAGEMENT),
28
+ size: "sm",
29
+ iconSlot: /* @__PURE__ */ e(L, {}),
30
+ disabled: !(o != null && o.editable)
31
+ }
32
+ )
33
+ }
34
+ ),
35
+ p(i.ORDERS_TABLE_MANAGEMENT) && /* @__PURE__ */ e(
36
+ A,
37
+ {
38
+ visibleColumns: l,
39
+ hiddenColumns: b,
40
+ columnDefintions: r,
41
+ onClose: d
42
+ }
43
+ )
44
+ ] });
45
+ });
18
46
  export {
19
- O as DateOptionMap,
20
- _ as DateValue
47
+ j as TableManagement
21
48
  };
package/dist/index44.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=(r=>(r.TEXT="text",r.NUMBER="number",r.CHECKBOX="checkbox",r.RADIO="radio",r.DATE_RANGE="date_range",r.NUMBER_RANGE="number_range",r))(n||{});exports.FilterChoiceValue=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/index44.js CHANGED
@@ -1,4 +1,21 @@
1
- var n = /* @__PURE__ */ ((E) => (E.TEXT = "text", E.NUMBER = "number", E.CHECKBOX = "checkbox", E.RADIO = "radio", E.DATE_RANGE = "date_range", E.NUMBER_RANGE = "number_range", E))(n || {});
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
+ ]);
2
18
  export {
3
- n as FilterChoiceValue
19
+ O as DateOptionMap,
20
+ _ as DateValue
4
21
  };
package/dist/index45.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 n=(r=>(r.TEXT="text",r.NUMBER="number",r.CHECKBOX="checkbox",r.RADIO="radio",r.DATE_RANGE="date_range",r.NUMBER_RANGE="number_range",r))(n||{});exports.FilterChoiceValue=n;
package/dist/index45.js CHANGED
@@ -1,25 +1,4 @@
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
- };
1
+ var n = /* @__PURE__ */ ((E) => (E.TEXT = "text", E.NUMBER = "number", E.CHECKBOX = "checkbox", E.RADIO = "radio", E.DATE_RANGE = "date_range", E.NUMBER_RANGE = "number_range", E))(n || {});
22
2
  export {
23
- v as ModalContext,
24
- f as ModalProvider
3
+ n as FilterChoiceValue
25
4
  };
package/dist/index46.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/index46.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/index47.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index45.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/index47.js CHANGED
@@ -1,6 +1,4 @@
1
- import { useContext as o } from "react";
2
- import { ModalContext as t } from "./index45.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/index48.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("./index46.cjs"),o=()=>e.useContext(t.ModalContext);exports.useModal=o;
package/dist/index48.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 "./index46.js";
3
+ const m = () => o(t);
11
4
  export {
12
- a as withCSRF
5
+ m as useModal
13
6
  };
package/dist/index49.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/index49.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/index5.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("kitsu-core"),r=require("./index6.cjs"),i=require("./index48.cjs"),o=require("./index49.cjs"),a=async({attributes:e})=>{const t=await r.axios.post("/api/v2/custom_views",{data:{attributes:e,type:"custom_view"}},i.withCSRF(o.vndAPI));return s.deserialise(t.data)};exports.createCustomView=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("kitsu-core"),r=require("./index6.cjs"),i=require("./index49.cjs"),o=require("./index50.cjs"),a=async({attributes:e})=>{const t=await r.axios.post("/api/v2/custom_views",{data:{attributes:e,type:"custom_view"}},i.withCSRF(o.vndAPI));return s.deserialise(t.data)};exports.createCustomView=a;
package/dist/index5.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { deserialise as r } from "kitsu-core";
2
2
  import { axios as e } from "./index6.js";
3
- import { withCSRF as i } from "./index48.js";
4
- import { vndAPI as s } from "./index49.js";
3
+ import { withCSRF as i } from "./index49.js";
4
+ import { vndAPI as s } from "./index50.js";
5
5
  const n = async ({ attributes: t }) => {
6
6
  const o = await e.post("/api/v2/custom_views", { data: { attributes: t, type: "custom_view" } }, i(s));
7
7
  return r(o.data);
package/dist/index50.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("kitsu-core"),a=require("./index48.cjs"),n=require("./index49.cjs"),i=require("./index6.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/index50.js CHANGED
@@ -1,14 +1,15 @@
1
- import { deserialise as f } from "kitsu-core";
2
- import { withCSRF as o } from "./index48.js";
3
- import { onlyJSON as m, vndAPI as p } from "./index49.js";
4
- import { axios as s } from "./index6.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/index51.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),C=require("./index70.cjs"),Y=require("./index69.cjs"),k=require("./index59.cjs"),G=require("./index52.cjs"),H=require("./index55.cjs"),W=require("./index57.cjs"),a=require("./index42.cjs"),N=require("./index3.cjs"),$=require("./index2.cjs"),B=require("./index7.cjs"),b=require("./index56.cjs"),j=require("./index5.cjs"),z=require("./index4.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:w,viewsMap:p,viewsArray:L}=W.useViews(),[I,o]=c.useState(!1),[A,h]=c.useState(!1),[f,n]=c.useState(!1),[F,S]=c.useState(!1),{Views:{removeDraftViewById:D,draftViewsMap:R},Filters:{initFiltersFromView:u,updateUrl:d,setActiveViewId:O},Notifications:{notify:s}}=b.useStores();return{actions:{delete:{handleDeleteDraftView:()=>{if(!e.originalView)throw Error("No draft view found");D(e.id);const t=p.get(E);if(t)t&&u(t);else{const i=p.get(C.ALL_VIEW_ID);i&&u(i)}d()},handleDelete:async()=>{try{if(_){await $.deleteCustomView(Number(e.id)),await w();const t=p.get(C.ALL_VIEW_ID);t&&u(t),d(),A&&h(!1),f&&n(f),s({type:"success",text:`'${e.label}' has been deleted`})}else s({type:"info",text:"You require additional user permissions to delete a company shared view"})}catch{s({type:"error",text:"Failed to delete view"})}},handleShowDeleteConfirmation:()=>{if(R.has(e.id)){D(e.id),e.originalView?O(e.originalView.id):O(C.ALL_VIEW_ID);return}_?h(!0):s({type:"info",text:"You require additional user permissions to delete a company shared view"})},closeDeleteConfirmation:()=>h(!1)},edit:{handleShowEditDropdown:()=>{o(!1),n(!0)},closeEditDropdown:()=>n(!1)},menu:{handleSave:async t=>{try{const{viewName:i,shareOption:m,isDefault:V}=t,y=m==="company"?a.SHARING_OPTIONS.COMPANY:a.SHARING_OPTIONS.PERSONAL,l={attributes:{title:i,shared:y.key===a.SHARING_OPTIONS.COMPANY.key}};await z.patchCustomView(e.id,l),V&&(await N.patchCurrentUser({user_setting_attributes:{default_custom_view:{id:Number(e.id),type:r}}}),await x()),await w(),d(),s({type:"success",text:`'${i}' view updated`}),n(!1)}catch{s({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}}}),s({type:"success",text:`'${e.label}' is now your default view`}),o(!1)}catch{s({type:"error",text:"Failed to set default view"})}},openDropdown:()=>o(!0),closeDropdown:()=>o(!1),toggleDropdown:()=>o(!I)},create:{handleCreate:async t=>{try{const{viewName:i,shareOption:m,isDefault:V}=t,y=m==="company"?a.SHARING_OPTIONS.COMPANY:a.SHARING_OPTIONS.PERSONAL,{arg:l}=q(),{data:v}=await j.createCustomView({attributes:{...l,title:i,shared:y.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},...V?{default_custom_view:{id:Number(v.id),type:r}}:{}}}),await w(),D(e.id);const T=Y.viewsAdapter({view:v,canUpdateCustomViews:M});u(T),d(),S(!1),s({type:"success",text:`New view '${l.title}' created`})}catch(i){console.log(i),s({type:"error",text:"Failed to save draft view"})}},closeCreateDropdown:()=>S(!1),handleSaveDraft:async()=>{S(!0)}}},state:{shouldShowDropdown:I,shouldShowEditDropdown:f,shouldShowCreateDropdown:F,shouldShowDeleteConfirmation:A}}};exports.useDropdownManager=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("kitsu-core"),a=require("./index49.cjs"),n=require("./index50.cjs"),i=require("./index6.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;