@veeqo/transfigure 1.2.2 → 1.2.3

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 (61) hide show
  1. package/dist/index100.cjs +1 -1
  2. package/dist/index100.js +31 -19
  3. package/dist/index101.cjs +1 -1
  4. package/dist/index101.js +26 -12
  5. package/dist/index103.cjs +19 -1
  6. package/dist/index103.js +24 -33
  7. package/dist/index104.cjs +1 -1
  8. package/dist/index104.js +21 -29
  9. package/dist/index105.cjs +1 -1
  10. package/dist/index105.js +15 -24
  11. package/dist/index107.cjs +1 -1
  12. package/dist/index107.js +2 -19
  13. package/dist/index108.cjs +1 -1
  14. package/dist/index108.js +18 -7
  15. package/dist/index109.cjs +1 -1
  16. package/dist/index109.js +7 -63
  17. package/dist/index11.cjs +1 -1
  18. package/dist/index11.js +1 -1
  19. package/dist/index110.cjs +1 -1
  20. package/dist/index110.js +60 -26
  21. package/dist/index111.cjs +1 -1
  22. package/dist/index111.js +30 -2
  23. package/dist/index116.cjs +7 -1
  24. package/dist/index116.js +10 -47
  25. package/dist/index117.cjs +1 -7
  26. package/dist/index117.js +47 -10
  27. package/dist/index17.cjs +1 -1
  28. package/dist/index17.js +1 -1
  29. package/dist/index34.cjs +1 -1
  30. package/dist/index34.js +1 -1
  31. package/dist/index36.cjs +1 -1
  32. package/dist/index36.js +2 -2
  33. package/dist/index39.cjs +1 -1
  34. package/dist/index39.js +1 -1
  35. package/dist/index40.cjs +1 -1
  36. package/dist/index40.js +1 -1
  37. package/dist/index41.cjs +1 -1
  38. package/dist/index41.js +1 -1
  39. package/dist/index47.cjs +1 -1
  40. package/dist/index47.js +2 -2
  41. package/dist/index56.cjs +1 -1
  42. package/dist/index56.js +71 -71
  43. package/dist/index63.cjs +1 -1
  44. package/dist/index63.js +39 -38
  45. package/dist/index84.cjs +1 -1
  46. package/dist/index84.js +1 -1
  47. package/dist/index85.cjs +1 -1
  48. package/dist/index85.js +1 -1
  49. package/dist/index86.cjs +1 -1
  50. package/dist/index86.js +5 -41
  51. package/dist/index87.cjs +1 -1
  52. package/dist/index87.js +41 -9
  53. package/dist/index88.cjs +1 -1
  54. package/dist/index88.js +8 -4
  55. package/dist/index91.cjs +1 -1
  56. package/dist/index91.js +2 -2
  57. package/dist/index93.cjs +1 -1
  58. package/dist/index93.js +2 -2
  59. package/dist/index99.cjs +1 -19
  60. package/dist/index99.js +24 -24
  61. package/package.json +1 -1
package/dist/index116.cjs CHANGED
@@ -1 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("react"),d=require("mobx-react"),t=require("@veeqo/ui"),m=require("swr/immutable"),x=require("./index75.cjs"),y=require("./index76.cjs"),F=require("./index49.cjs"),O=e=>e&&e.__esModule?e:{default:e},A=O(m),S=d.observer(({field:e,editedValue:o,setEditedValue:a})=>{var c,i;const l=p.useMemo(()=>{var r;return y.getFetcherFunction({fetcherName:(r=e.fetchAsyncFilterOptions)==null?void 0:r.fetcher})},[(c=e.fetchAsyncFilterOptions)==null?void 0:c.fetcher]),{isLoading:u,isValidating:h,data:g,error:b}=A.default((i=e.fetchAsyncFilterOptions)==null?void 0:i.URL,l,F.SWR_HOOK_OPTIONS),n=u||h,f=x.getAsyncOptions({data:g,config:e.fetchAsyncFilterOptions});return s.jsxs(t.Stack,{spacing:"xs",alignX:"stretch",children:[s.jsx(t.ChoiceList,{allowMultiple:!0,title:e.label,options:f,selected:o,onChange:r=>a(r)}),n&&s.jsx(t.Skeleton,{width:"200px",height:t.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!n&&b&&s.jsxs(t.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.ActiveAsyncCheckboxFilter=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("styled-components"),e=require("@veeqo/ui"),a=t=>t&&t.__esModule?t:{default:t},i=a(o),s=i.default(e.BaseContainer)`
2
+ padding: ${e.theme.sizes.sm};
3
+ // This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
4
+ // with an additional sizes.base offset at the bottom.
5
+ max-height: calc(100vh ${({offset:t})=>t&&`- ${t}px`} - ${e.theme.sizes.base});
6
+ overflow-y: auto;
7
+ `;exports.AdaptiveStyledContainer=s;
package/dist/index116.js CHANGED
@@ -1,49 +1,12 @@
1
- import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
- import { useMemo as u } from "react";
3
- import { observer as O } from "mobx-react";
4
- import { Stack as b, ChoiceList as F, Skeleton as x, theme as y, Text as A } from "@veeqo/ui";
5
- import S from "swr/immutable";
6
- import { getAsyncOptions as d } from "./index75.js";
7
- import { getFetcherFunction as L } from "./index76.js";
8
- import { SWR_HOOK_OPTIONS as k } from "./index49.js";
9
- const T = O(
10
- ({ field: t, editedValue: c, setEditedValue: a }) => {
11
- var o, i;
12
- const l = u(() => {
13
- var e;
14
- return L({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
15
- }, [(o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher]), { isLoading: m, isValidating: h, data: p, error: f } = S(
16
- (i = t.fetchAsyncFilterOptions) == null ? void 0 : i.URL,
17
- l,
18
- k
19
- ), r = m || h, g = d({ data: p, config: t.fetchAsyncFilterOptions });
20
- return /* @__PURE__ */ s(b, { spacing: "xs", alignX: "stretch", children: [
21
- /* @__PURE__ */ n(
22
- F,
23
- {
24
- allowMultiple: !0,
25
- title: t.label,
26
- options: g,
27
- selected: c,
28
- onChange: (e) => a(e)
29
- }
30
- ),
31
- r && /* @__PURE__ */ n(
32
- x,
33
- {
34
- width: "200px",
35
- height: y.sizes[5],
36
- "aria-busy": !0,
37
- "aria-label": `Loading ${t.label} filters`
38
- }
39
- ),
40
- !r && f && /* @__PURE__ */ s(A, { variant: "errorSmall", children: [
41
- "Error: failed to load filter for ",
42
- t.label
43
- ] })
44
- ] });
45
- }
46
- );
1
+ import o from "styled-components";
2
+ import { theme as e, BaseContainer as i } from "@veeqo/ui";
3
+ const h = o(i)`
4
+ padding: ${e.sizes.sm};
5
+ // This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
6
+ // with an additional sizes.base offset at the bottom.
7
+ max-height: calc(100vh ${({ offset: t }) => t && `- ${t}px`} - ${e.sizes.base});
8
+ overflow-y: auto;
9
+ `;
47
10
  export {
48
- T as ActiveAsyncCheckboxFilter
11
+ h as AdaptiveStyledContainer
49
12
  };
package/dist/index117.cjs CHANGED
@@ -1,7 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("styled-components"),e=require("@veeqo/ui"),a=t=>t&&t.__esModule?t:{default:t},i=a(o),s=i.default(e.BaseContainer)`
2
- padding: ${e.theme.sizes.sm};
3
- // This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
4
- // with an additional sizes.base offset at the bottom.
5
- max-height: calc(100vh ${({offset:t})=>t&&`- ${t}px`} - ${e.theme.sizes.base});
6
- overflow-y: auto;
7
- `;exports.AdaptiveStyledContainer=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("react"),d=require("mobx-react"),t=require("@veeqo/ui"),m=require("swr/immutable"),x=require("./index75.cjs"),y=require("./index76.cjs"),F=require("./index49.cjs"),O=e=>e&&e.__esModule?e:{default:e},A=O(m),S=d.observer(({field:e,editedValue:o,setEditedValue:a})=>{var c,i;const l=p.useMemo(()=>{var r;return y.getFetcherFunction({fetcherName:(r=e.fetchAsyncFilterOptions)==null?void 0:r.fetcher})},[(c=e.fetchAsyncFilterOptions)==null?void 0:c.fetcher]),{isLoading:u,isValidating:h,data:g,error:b}=A.default((i=e.fetchAsyncFilterOptions)==null?void 0:i.URL,l,F.SWR_HOOK_OPTIONS),n=u||h,f=x.getAsyncOptions({data:g,config:e.fetchAsyncFilterOptions});return s.jsxs(t.Stack,{spacing:"xs",alignX:"stretch",children:[s.jsx(t.ChoiceList,{allowMultiple:!0,title:e.label,options:f,selected:o,onChange:r=>a(r)}),n&&s.jsx(t.Skeleton,{width:"200px",height:t.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!n&&b&&s.jsxs(t.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.ActiveAsyncCheckboxFilter=S;
package/dist/index117.js CHANGED
@@ -1,12 +1,49 @@
1
- import o from "styled-components";
2
- import { theme as e, BaseContainer as i } from "@veeqo/ui";
3
- const h = o(i)`
4
- padding: ${e.sizes.sm};
5
- // This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
6
- // with an additional sizes.base offset at the bottom.
7
- max-height: calc(100vh ${({ offset: t }) => t && `- ${t}px`} - ${e.sizes.base});
8
- overflow-y: auto;
9
- `;
1
+ import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
+ import { useMemo as u } from "react";
3
+ import { observer as O } from "mobx-react";
4
+ import { Stack as b, ChoiceList as F, Skeleton as x, theme as y, Text as A } from "@veeqo/ui";
5
+ import S from "swr/immutable";
6
+ import { getAsyncOptions as d } from "./index75.js";
7
+ import { getFetcherFunction as L } from "./index76.js";
8
+ import { SWR_HOOK_OPTIONS as k } from "./index49.js";
9
+ const T = O(
10
+ ({ field: t, editedValue: c, setEditedValue: a }) => {
11
+ var o, i;
12
+ const l = u(() => {
13
+ var e;
14
+ return L({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
15
+ }, [(o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher]), { isLoading: m, isValidating: h, data: p, error: f } = S(
16
+ (i = t.fetchAsyncFilterOptions) == null ? void 0 : i.URL,
17
+ l,
18
+ k
19
+ ), r = m || h, g = d({ data: p, config: t.fetchAsyncFilterOptions });
20
+ return /* @__PURE__ */ s(b, { spacing: "xs", alignX: "stretch", children: [
21
+ /* @__PURE__ */ n(
22
+ F,
23
+ {
24
+ allowMultiple: !0,
25
+ title: t.label,
26
+ options: g,
27
+ selected: c,
28
+ onChange: (e) => a(e)
29
+ }
30
+ ),
31
+ r && /* @__PURE__ */ n(
32
+ x,
33
+ {
34
+ width: "200px",
35
+ height: y.sizes[5],
36
+ "aria-busy": !0,
37
+ "aria-label": `Loading ${t.label} filters`
38
+ }
39
+ ),
40
+ !r && f && /* @__PURE__ */ s(A, { variant: "errorSmall", children: [
41
+ "Error: failed to load filter for ",
42
+ t.label
43
+ ] })
44
+ ] });
45
+ }
46
+ );
10
47
  export {
11
- h as AdaptiveStyledContainer
48
+ T as ActiveAsyncCheckboxFilter
12
49
  };
package/dist/index17.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),l=require("mobx-react"),s=require("@veeqo/ui"),c=require("./index49.cjs"),u=require("./index116.cjs"),h=l.observer(({data:e,editedValue:r,setEditedValue:t})=>{var i;switch(e.filterType){case c.FilterChoiceValue.CHECKBOX:return e.fetchAsyncFilterOptions?o.jsx(u.ActiveAsyncCheckboxFilter,{field:e,setEditedValue:t,editedValue:r}):o.jsx(s.ChoiceList,{allowMultiple:!0,title:e.label,options:(i=e.options)!=null&&i.length?e.options:[],selected:r,onChange:n=>t(n)});default:return null}});exports.FilterArrayField=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),l=require("mobx-react"),s=require("@veeqo/ui"),c=require("./index49.cjs"),u=require("./index117.cjs"),h=l.observer(({data:e,editedValue:r,setEditedValue:t})=>{var i;switch(e.filterType){case c.FilterChoiceValue.CHECKBOX:return e.fetchAsyncFilterOptions?o.jsx(u.ActiveAsyncCheckboxFilter,{field:e,setEditedValue:t,editedValue:r}):o.jsx(s.ChoiceList,{allowMultiple:!0,title:e.label,options:(i=e.options)!=null&&i.length?e.options:[],selected:r,onChange:n=>t(n)});default:return null}});exports.FilterArrayField=h;
package/dist/index17.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
2
2
  import { observer as n } from "mobx-react";
3
3
  import { ChoiceList as p } from "@veeqo/ui";
4
4
  import { FilterChoiceValue as s } from "./index49.js";
5
- import { ActiveAsyncCheckboxFilter as c } from "./index116.js";
5
+ import { ActiveAsyncCheckboxFilter as c } from "./index117.js";
6
6
  const F = n(
7
7
  ({ data: r, editedValue: e, setEditedValue: o }) => {
8
8
  var i;
package/dist/index34.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("mobx-react"),n=require("@veeqo/ui"),o=require("./index8.cjs"),u=require("./index105.cjs"),c=require("./index35.cjs"),a=s.observer(()=>{const{GROUP_MAP:t}=o.useBusinessLogic();return e.jsx(u.AdaptiveHeightContainer,{style:{minWidth:"360px"},children:e.jsx(n.Stack,{alignX:"stretch",children:Array.from(t).map(([r,i])=>e.jsx(c.FilterGroup,{data:i},r))})})});exports.FiltersList=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("mobx-react"),n=require("@veeqo/ui"),o=require("./index8.cjs"),u=require("./index99.cjs"),c=require("./index35.cjs"),a=s.observer(()=>{const{GROUP_MAP:t}=o.useBusinessLogic();return e.jsx(u.AdaptiveHeightContainer,{style:{minWidth:"360px"},children:e.jsx(n.Stack,{alignX:"stretch",children:Array.from(t).map(([r,i])=>e.jsx(c.FilterGroup,{data:i},r))})})});exports.FiltersList=a;
package/dist/index34.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as r } from "react/jsx-runtime";
2
2
  import { observer as e } from "mobx-react";
3
3
  import { Stack as m } from "@veeqo/ui";
4
4
  import { useBusinessLogic as s } from "./index8.js";
5
- import { AdaptiveHeightContainer as p } from "./index105.js";
5
+ import { AdaptiveHeightContainer as p } from "./index99.js";
6
6
  import { FilterGroup as n } from "./index35.js";
7
7
  const u = e(() => {
8
8
  const { GROUP_MAP: t } = s();
package/dist/index36.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),u=require("@veeqo/ui"),U=require("mobx-react"),z=require("./index65.cjs"),G=require("./index62.cjs"),J=require("./index40.cjs"),K=require("./index43.cjs"),Q=require("./index56.cjs"),X=require("./index103.cjs"),Z=require("./index8.cjs"),$=require("./index61.cjs"),b=require("./index104.cjs"),ee=U.observer(({view:e})=>{const{VIEW_TYPE:x,IS_VIEWS_READONLY:r,SEARCH_FILTER_ID:d}=Z.useBusinessLogic(),{Filters:{activeViewId:w,initFiltersFromView:f,discardChanges:m,initFromUrl:V,filters:L,setFilter:y},Views:{draftViewsMap:T},Notifications:{notify:E}}=$.useStores(),{viewsMap:h,defaultCustomViewId:F,isLoading:N}=G.useViews(),{isLoading:j}=z.useCustomViews({type:x}),{viewCounts:M,isLoadingViewCounts:R}=X.useViewCounts(),[s,k]=c.useState(null),A=o=>{const q=L.get(d);if(h.has(o)){const n=h.get(o);n&&(f(n),m(!0),V())}else{const n=T.get(o);n?(f(n),m(!0),V()):E({type:"error",text:"Failed to load view"})}q&&y(d,q)},a=(e==null?void 0:e.id)===w,t=e.originalView!==void 0,g=e.originalView===void 0,I=M,l=(e==null?void 0:e.label)||"",P=N||j,p=c.useRef(!1);!P&&!p.current&&a&&e.id===F&&s&&(p.current=!0,s&&w===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const D=c.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:_},menu:{toggleDropdown:v},delete:{closeDeleteConfirmation:B,handleDelete:O,handleDeleteDraftView:C}},state:{shouldShowDeleteConfirmation:H},actions:W,state:S}=Q.useDropdownManager(e),Y=c.useMemo(()=>{if(!r){if(g)return v;if(t)return C}},[C,t,g,v,r]);return i.jsxs(i.Fragment,{children:[i.jsx(u.ViewTab,{colourPalette:u.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:a,id:e==null?void 0:e.id,name:l,type:r?void 0:D,count:R?i.jsx(u.Loader,{type:"ThreeDots",width:12,height:12,color:a?"#fff":u.theme.colors.neutral.ink.dark}):I,onClick:A,subAction:Y,ariaContext:"orders",ref:k,"aria-controls":"options-dropdown","aria-expanded":S.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx(b.Confirmation,{shouldShow:H,viewName:l,onCancel:B,onDelete:O}),i.jsx(J.PillNotifications,{tabType:D,isActive:a,initialViewName:l,shouldShowCreateViewNotification:t,handleSaveDraft:_}),!r&&i.jsx(K.ViewDropdowns,{referenceElement:s,tab:e,...W,...S})]})});exports.ViewTab=ee;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),u=require("@veeqo/ui"),U=require("mobx-react"),z=require("./index65.cjs"),G=require("./index62.cjs"),J=require("./index40.cjs"),K=require("./index43.cjs"),Q=require("./index56.cjs"),X=require("./index100.cjs"),Z=require("./index8.cjs"),$=require("./index61.cjs"),b=require("./index101.cjs"),ee=U.observer(({view:e})=>{const{VIEW_TYPE:x,IS_VIEWS_READONLY:r,SEARCH_FILTER_ID:d}=Z.useBusinessLogic(),{Filters:{activeViewId:w,initFiltersFromView:f,discardChanges:m,initFromUrl:V,filters:L,setFilter:y},Views:{draftViewsMap:T},Notifications:{notify:E}}=$.useStores(),{viewsMap:h,defaultCustomViewId:F,isLoading:N}=G.useViews(),{isLoading:j}=z.useCustomViews({type:x}),{viewCounts:M,isLoadingViewCounts:R}=X.useViewCounts(),[s,k]=c.useState(null),A=o=>{const q=L.get(d);if(h.has(o)){const n=h.get(o);n&&(f(n),m(!0),V())}else{const n=T.get(o);n?(f(n),m(!0),V()):E({type:"error",text:"Failed to load view"})}q&&y(d,q)},a=(e==null?void 0:e.id)===w,t=e.originalView!==void 0,g=e.originalView===void 0,I=M,l=(e==null?void 0:e.label)||"",P=N||j,p=c.useRef(!1);!P&&!p.current&&a&&e.id===F&&s&&(p.current=!0,s&&w===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const D=c.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:_},menu:{toggleDropdown:v},delete:{closeDeleteConfirmation:B,handleDelete:O,handleDeleteDraftView:C}},state:{shouldShowDeleteConfirmation:H},actions:W,state:S}=Q.useDropdownManager(e),Y=c.useMemo(()=>{if(!r){if(g)return v;if(t)return C}},[C,t,g,v,r]);return i.jsxs(i.Fragment,{children:[i.jsx(u.ViewTab,{colourPalette:u.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:a,id:e==null?void 0:e.id,name:l,type:r?void 0:D,count:R?i.jsx(u.Loader,{type:"ThreeDots",width:12,height:12,color:a?"#fff":u.theme.colors.neutral.ink.dark}):I,onClick:A,subAction:Y,ariaContext:"orders",ref:k,"aria-controls":"options-dropdown","aria-expanded":S.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx(b.Confirmation,{shouldShow:H,viewName:l,onCancel:B,onDelete:O}),i.jsx(J.PillNotifications,{tabType:D,isActive:a,initialViewName:l,shouldShowCreateViewNotification:t,handleSaveDraft:_}),!r&&i.jsx(K.ViewDropdowns,{referenceElement:s,tab:e,...W,...S})]})});exports.ViewTab=ee;
package/dist/index36.js CHANGED
@@ -7,10 +7,10 @@ import { useViews as Z } from "./index62.js";
7
7
  import { PillNotifications as b } from "./index40.js";
8
8
  import { ViewDropdowns as ee } from "./index43.js";
9
9
  import { useDropdownManager as oe } from "./index56.js";
10
- import { useViewCounts as ie } from "./index103.js";
10
+ import { useViewCounts as ie } from "./index100.js";
11
11
  import { useBusinessLogic as te } from "./index8.js";
12
12
  import { useStores as re } from "./index61.js";
13
- import { Confirmation as se } from "./index104.js";
13
+ import { Confirmation as se } from "./index101.js";
14
14
  const ve = Q(({ view: e }) => {
15
15
  const { VIEW_TYPE: y, IS_VIEWS_READONLY: n, SEARCH_FILTER_ID: c } = te(), {
16
16
  Filters: { activeViewId: d, initFiltersFromView: f, discardChanges: m, initFromUrl: u, filters: E, setFilter: F },
package/dist/index39.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index99.cjs"),g=require("./index52.cjs"),j=require("./index51.cjs"),M=({tab:i,onMakeDefault:l,onEdit:n,onDuplicate:s,onDelete:o,shouldShowDropdown:a,handleCloseDropdown:c})=>{const{openModal:r}=g.useModal(),d=()=>{r(j.ModalId.ORDERS_TABLE_MANAGEMENT),c()},m=i.label!=="Picking In Progress"&&i.editable,u=i.default!==!1&&i.editable,p=i.editable,b=i.editable;return a?e.jsxs(t.MenuItems,{children:[u&&e.jsx(t.Item,{onClick:l,className:"act-react-listing-custom-view-make-default-menu-item",children:"Make default view"}),b&&e.jsx(t.Item,{onClick:n,className:"act-react-listing-custom-view-edit-menu-item",role:"option",children:"Edit"}),e.jsx(t.Item,{onClick:s,className:"act-react-listing-custom-view-duplicate-menu-item",role:"option",children:"Duplicate"}),m&&e.jsx(t.Item,{onClick:o,className:"act-react-listing-custom-view-delete-menu-item",role:"option",children:"Delete"}),p&&e.jsxs(e.Fragment,{children:[e.jsx(t.Divider,{}),e.jsx(t.Item,{onClick:d,role:"option",children:"Table management"})]})]}):null};exports.OptionsDropdown=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index103.cjs"),g=require("./index52.cjs"),j=require("./index51.cjs"),M=({tab:i,onMakeDefault:l,onEdit:n,onDuplicate:s,onDelete:o,shouldShowDropdown:a,handleCloseDropdown:c})=>{const{openModal:r}=g.useModal(),d=()=>{r(j.ModalId.ORDERS_TABLE_MANAGEMENT),c()},m=i.label!=="Picking In Progress"&&i.editable,u=i.default!==!1&&i.editable,p=i.editable,b=i.editable;return a?e.jsxs(t.MenuItems,{children:[u&&e.jsx(t.Item,{onClick:l,className:"act-react-listing-custom-view-make-default-menu-item",children:"Make default view"}),b&&e.jsx(t.Item,{onClick:n,className:"act-react-listing-custom-view-edit-menu-item",role:"option",children:"Edit"}),e.jsx(t.Item,{onClick:s,className:"act-react-listing-custom-view-duplicate-menu-item",role:"option",children:"Duplicate"}),m&&e.jsx(t.Item,{onClick:o,className:"act-react-listing-custom-view-delete-menu-item",role:"option",children:"Delete"}),p&&e.jsxs(e.Fragment,{children:[e.jsx(t.Divider,{}),e.jsx(t.Item,{onClick:d,role:"option",children:"Table management"})]})]}):null};exports.OptionsDropdown=M;
package/dist/index39.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs as t, jsx as i, Fragment as f } from "react/jsx-runtime";
2
- import { MenuItems as M, Item as l, Divider as h } from "./index99.js";
2
+ import { MenuItems as M, Item as l, Divider as h } from "./index103.js";
3
3
  import { useModal as k } from "./index52.js";
4
4
  import { ModalId as T } from "./index51.js";
5
5
  const N = ({
package/dist/index40.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),P=require("mobx-react"),g=require("./index62.cjs"),o=require("framer-motion"),m=require("./index61.cjs"),v=require("./index100.cjs"),f=require("./index42.cjs"),h=P.observer(({tabType:s,isActive:r,shouldShowCreateViewNotification:a,handleSaveDraft:i})=>{var t;const{Filters:{hasUnsavedChanges:c,discardChanges:l,activeViewId:n}}=m.useStores(),{viewsMap:u}=g.useViews(),d=n&&((t=u.get(n))==null?void 0:t.label);return e.jsxs(e.Fragment,{children:[e.jsx(o.AnimatePresence,{children:s==="draft"&&r&&a&&e.jsx(v.DraftPill,{onClick:i})}),e.jsx(o.AnimatePresence,{children:c&&r&&s==="saved"&&e.jsx(f.UnsavedChangesPill,{viewName:d,onDiscard:()=>l(),onSaveDraft:i})})]})});exports.PillNotifications=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),P=require("mobx-react"),g=require("./index62.cjs"),o=require("framer-motion"),m=require("./index61.cjs"),v=require("./index104.cjs"),f=require("./index42.cjs"),h=P.observer(({tabType:s,isActive:r,shouldShowCreateViewNotification:a,handleSaveDraft:i})=>{var t;const{Filters:{hasUnsavedChanges:c,discardChanges:l,activeViewId:n}}=m.useStores(),{viewsMap:u}=g.useViews(),d=n&&((t=u.get(n))==null?void 0:t.label);return e.jsxs(e.Fragment,{children:[e.jsx(o.AnimatePresence,{children:s==="draft"&&r&&a&&e.jsx(v.DraftPill,{onClick:i})}),e.jsx(o.AnimatePresence,{children:c&&r&&s==="saved"&&e.jsx(f.UnsavedChangesPill,{viewName:d,onDiscard:()=>l(),onSaveDraft:i})})]})});exports.PillNotifications=h;
package/dist/index40.js CHANGED
@@ -3,7 +3,7 @@ import { observer as h } from "mobx-react";
3
3
  import { useViews as v } from "./index62.js";
4
4
  import { AnimatePresence as n } from "framer-motion";
5
5
  import { useStores as g } from "./index61.js";
6
- import { DraftPill as w } from "./index100.js";
6
+ import { DraftPill as w } from "./index104.js";
7
7
  import { UnsavedChangesPill as C } from "./index42.js";
8
8
  const U = h(
9
9
  ({
package/dist/index41.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react"),m=require("./index101.cjs"),g=require("./index65.cjs"),S=require("./index62.cjs"),b=require("./index4.cjs"),y=require("./index8.cjs"),V=require("./index61.cjs"),p=require("./index12.cjs"),q=()=>{const{VIEW_TYPE:u}=y.useBusinessLogic(),{sortedCustomViews:s,isLoading:a}=S.useViews(),{mutate:c}=g.useCustomViews({type:u}),[l,t]=n.useState(s);n.useEffect(()=>{t(s)},[s]);const{Notifications:{notify:w}}=V.useStores(),d=async o=>{t(o);const r=o.map(e=>e.id);try{await b.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:r}}}),await c(e=>({...e,settings:{...e.settings,custom_view_positions:{...e.settings.custom_view_positions,order:r}}}),{revalidate:!1})}catch{t(s),w({type:"error",text:"Failed to update order of views"})}};return a||!s.length?null:i.jsx(p.ErrorBoundary,{children:i.jsx(m.LegacySortableViews,{views:l,onChange:d,className:"act-sortable-views"})})};exports.SortableViews=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react"),m=require("./index105.cjs"),g=require("./index65.cjs"),S=require("./index62.cjs"),b=require("./index4.cjs"),y=require("./index8.cjs"),V=require("./index61.cjs"),p=require("./index12.cjs"),q=()=>{const{VIEW_TYPE:u}=y.useBusinessLogic(),{sortedCustomViews:s,isLoading:a}=S.useViews(),{mutate:c}=g.useCustomViews({type:u}),[l,t]=n.useState(s);n.useEffect(()=>{t(s)},[s]);const{Notifications:{notify:w}}=V.useStores(),d=async o=>{t(o);const r=o.map(e=>e.id);try{await b.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:r}}}),await c(e=>({...e,settings:{...e.settings,custom_view_positions:{...e.settings.custom_view_positions,order:r}}}),{revalidate:!1})}catch{t(s),w({type:"error",text:"Failed to update order of views"})}};return a||!s.length?null:i.jsx(p.ErrorBoundary,{children:i.jsx(m.LegacySortableViews,{views:l,onChange:d,className:"act-sortable-views"})})};exports.SortableViews=q;
package/dist/index41.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { useState as f, useEffect as l } from "react";
3
- import { LegacySortableViews as w } from "./index101.js";
3
+ import { LegacySortableViews as w } from "./index105.js";
4
4
  import { useCustomViews as d } from "./index65.js";
5
5
  import { useViews as g } from "./index62.js";
6
6
  import { patchCurrentUser as _ } from "./index4.js";
package/dist/index47.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),h=require("./index86.cjs"),e=require("@veeqo/ui"),o=require("./index87.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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),h=require("./index87.cjs"),e=require("@veeqo/ui"),o=require("./index88.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,7 +1,7 @@
1
1
  import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { usePollData as c } from "./index86.js";
2
+ import { usePollData as c } from "./index87.js";
3
3
  import { Tooltip as d, Button as p, RefreshIcon as u, theme as y, Indicator as x } from "@veeqo/ui";
4
- import t from "./index87.js";
4
+ import t from "./index88.js";
5
5
  import { useStores as b } from "./index61.js";
6
6
  const j = ({
7
7
  isLoading: s,
package/dist/index56.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),C=require("./index79.cjs"),Y=require("./index78.cjs"),k=require("./index65.cjs"),G=require("./index57.cjs"),H=require("./index60.cjs"),W=require("./index62.cjs"),a=require("./index45.cjs"),N=require("./index4.cjs"),$=require("./index3.cjs"),B=require("./index8.cjs"),b=require("./index61.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 w=require("react"),f=require("./index79.cjs"),Y=require("./index78.cjs"),k=require("./index65.cjs"),G=require("./index57.cjs"),H=require("./index60.cjs"),W=require("./index62.cjs"),n=require("./index45.cjs"),N=require("./index4.cjs"),$=require("./index3.cjs"),B=require("./index8.cjs"),b=require("./index61.cjs"),j=require("./index6.cjs"),z=require("./index5.cjs"),J=e=>{const{VIEW_TYPE:u}=B.useBusinessLogic(),{duplicateView:q}=G.useDuplicateActiveView(),{getActiveViewInAPIFormat:E}=H.usePersistUnsavedChanges(),{canDeleteCustomViews:O,defaultCustomViewId:L,canUpdateCustomViews:M,mutate:x}=k.useCustomViews({type:u}),{mutate:p,viewsMap:d,viewsArray:t}=W.useViews(),[g,a]=w.useState(!1),[A,h]=w.useState(!1),[D,l]=w.useState(!1),[F,S]=w.useState(!1),{Views:{removeDraftViewById:m,draftViewsMap:R},Filters:{initFiltersFromView:r,updateUrl:c,setActiveViewId:V},Notifications:{notify:o}}=b.useStores();return{actions:{delete:{handleDeleteDraftView:()=>{if(!e.originalView)throw Error("No draft view found");m(e.id);const s=d.get(L);if(s)s&&r(s);else{const i=d.get(f.ALL_VIEW_ID);i?r(i):t!=null&&t[0]&&r(t[0])}c()},handleDelete:async()=>{try{if(O){await $.deleteCustomView(Number(e.id)),await p();const s=d.get(f.ALL_VIEW_ID);s?r(s):t!=null&&t[0]&&r(t[0]),c(),A&&h(!1),D&&l(D),o({type:"success",text:`'${e.label}' has been deleted`})}else o({type:"info",text:"You require additional user permissions to delete a company shared view"})}catch{o({type:"error",text:"Failed to delete view"})}},handleShowDeleteConfirmation:()=>{if(R.has(e.id)){m(e.id),e.originalView?V(e.originalView.id):d.has(f.ALL_VIEW_ID)?V(f.ALL_VIEW_ID):t!=null&&t[0]&&V(t[0].id);return}O?h(!0):o({type:"info",text:"You require additional user permissions to delete a company shared view"})},closeDeleteConfirmation:()=>h(!1)},edit:{handleShowEditDropdown:()=>{a(!1),l(!0)},closeEditDropdown:()=>l(!1)},menu:{handleSave:async s=>{try{const{viewName:i,shareOption:C,isDefault:y}=s,v=C==="company"?n.SHARING_OPTIONS.COMPANY:n.SHARING_OPTIONS.PERSONAL,_={attributes:{title:i,shared:v.key===n.SHARING_OPTIONS.COMPANY.key}};await z.patchCustomView(e.id,_),y&&(await N.patchCurrentUser({user_setting_attributes:{default_custom_view:{id:Number(e.id),type:u}}}),await x()),await p(),c(),o({type:"success",text:`'${i}' view updated`}),l(!1)}catch{o({type:"error",text:"Failed to save view"})}},handleDuplicate:()=>{q(),a(!1)},handleMakeDefault:async()=>{try{await N.patchCurrentUser({user_setting_attributes:{default_custom_view:{id:Number(e.id),type:u}}}),o({type:"success",text:`'${e.label}' is now your default view`}),a(!1)}catch{o({type:"error",text:"Failed to set default view"})}},openDropdown:()=>a(!0),closeDropdown:()=>a(!1),toggleDropdown:()=>a(!g)},create:{handleCreate:async s=>{try{const{viewName:i,shareOption:C,isDefault:y}=s,v=C==="company"?n.SHARING_OPTIONS.COMPANY:n.SHARING_OPTIONS.PERSONAL,{arg:_}=E(),{data:I}=await j.createCustomView({attributes:{..._,title:i,shared:v.key===n.SHARING_OPTIONS.COMPANY.key}}),P=t.map(U=>U.id);P.push(I.id),await N.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:P},...y?{default_custom_view:{id:Number(I.id),type:u}}:{}}}),await p(),m(e.id);const T=Y.viewsAdapter({view:I,canUpdateCustomViews:M});r(T),c(),S(!1),o({type:"success",text:`New view '${i}' created`})}catch(i){console.log(i),o({type:"error",text:"Failed to save draft view"})}},closeCreateDropdown:()=>S(!1),handleSaveDraft:async()=>{S(!0)}}},state:{shouldShowDropdown:g,shouldShowEditDropdown:D,shouldShowCreateDropdown:F,shouldShowDeleteConfirmation:A}}};exports.useDropdownManager=J;
package/dist/index56.js CHANGED
@@ -1,61 +1,61 @@
1
1
  import { useState as w } from "react";
2
- import { ALL_VIEW_ID as C } from "./index79.js";
2
+ import { ALL_VIEW_ID as f } from "./index79.js";
3
3
  import { viewsAdapter as R } from "./index78.js";
4
4
  import { useCustomViews as q } from "./index65.js";
5
5
  import { useDuplicateActiveView as B } from "./index57.js";
6
6
  import { usePersistUnsavedChanges as T } from "./index60.js";
7
7
  import { useViews as W } from "./index62.js";
8
- import { SHARING_OPTIONS as s } from "./index45.js";
9
- import { patchCurrentUser as _ } from "./index4.js";
8
+ import { SHARING_OPTIONS as n } from "./index45.js";
9
+ import { patchCurrentUser as N } from "./index4.js";
10
10
  import { deleteCustomView as G } from "./index3.js";
11
11
  import { useBusinessLogic as H } from "./index8.js";
12
12
  import { useStores as b } from "./index61.js";
13
13
  import { createCustomView as j } from "./index6.js";
14
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
15
+ const Ve = (e) => {
16
+ const { VIEW_TYPE: d } = H(), { duplicateView: A } = B(), { getActiveViewInAPIFormat: P } = T(), {
17
+ canDeleteCustomViews: O,
18
+ defaultCustomViewId: M,
19
+ canUpdateCustomViews: F,
20
+ mutate: Y
21
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 }
22
+ type: d
23
+ }), { mutate: p, viewsMap: l, viewsArray: t } = W(), [x, a] = w(!1), [E, m] = w(!1), [h, c] = w(!1), [k, D] = w(!1), {
24
+ Views: { removeDraftViewById: V, draftViewsMap: L },
25
+ Filters: { initFiltersFromView: r, updateUrl: u, setActiveViewId: y },
26
+ Notifications: { notify: s }
27
27
  } = b();
28
28
  return {
29
29
  actions: {
30
30
  delete: {
31
31
  handleDeleteDraftView: () => {
32
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);
33
+ V(e.id);
34
+ const o = l.get(M);
35
+ if (o)
36
+ o && r(o);
37
37
  else {
38
- const o = u.get(C);
39
- o && d(o);
38
+ const i = l.get(f);
39
+ i ? r(i) : t != null && t[0] && r(t[0]);
40
40
  }
41
- l();
41
+ u();
42
42
  },
43
43
  handleDelete: async () => {
44
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({
45
+ if (O) {
46
+ await G(Number(e.id)), await p();
47
+ const o = l.get(f);
48
+ o ? r(o) : t != null && t[0] && r(t[0]), u(), E && m(!1), h && c(h), s({
49
49
  type: "success",
50
50
  text: `'${e.label}' has been deleted`
51
51
  });
52
52
  } else
53
- i({
53
+ s({
54
54
  type: "info",
55
55
  text: "You require additional user permissions to delete a company shared view"
56
56
  });
57
57
  } catch {
58
- i({
58
+ s({
59
59
  type: "error",
60
60
  text: "Failed to delete view"
61
61
  });
@@ -63,67 +63,67 @@ const ye = (e) => {
63
63
  },
64
64
  handleShowDeleteConfirmation: () => {
65
65
  if (L.has(e.id)) {
66
- h(e.id), e.originalView ? O(e.originalView.id) : O(C);
66
+ V(e.id), e.originalView ? y(e.originalView.id) : l.has(f) ? y(f) : t != null && t[0] && y(t[0].id);
67
67
  return;
68
68
  }
69
- g ? f(!0) : i({
69
+ O ? m(!0) : s({
70
70
  type: "info",
71
71
  text: "You require additional user permissions to delete a company shared view"
72
72
  });
73
73
  },
74
- closeDeleteConfirmation: () => f(!1)
74
+ closeDeleteConfirmation: () => m(!1)
75
75
  },
76
76
  edit: {
77
77
  handleShowEditDropdown: () => {
78
- a(!1), n(!0);
78
+ a(!1), c(!0);
79
79
  },
80
- closeEditDropdown: () => n(!1)
80
+ closeEditDropdown: () => c(!1)
81
81
  },
82
82
  menu: {
83
- handleSave: async (t) => {
83
+ handleSave: async (o) => {
84
84
  try {
85
- const { viewName: o, shareOption: D, isDefault: y } = t, v = D === "company" ? s.COMPANY : s.PERSONAL, V = {
85
+ const { viewName: i, shareOption: S, isDefault: v } = o, C = S === "company" ? n.COMPANY : n.PERSONAL, _ = {
86
86
  attributes: {
87
- title: o,
88
- shared: v.key === s.COMPANY.key
87
+ title: i,
88
+ shared: C.key === n.COMPANY.key
89
89
  }
90
90
  };
91
- await z(e.id, V), y && (await _({
91
+ await z(e.id, _), v && (await N({
92
92
  user_setting_attributes: {
93
93
  default_custom_view: {
94
94
  id: Number(e.id),
95
- type: r
95
+ type: d
96
96
  }
97
97
  }
98
- }), await F()), await c(), l(), i({
98
+ }), await Y()), await p(), u(), s({
99
99
  type: "success",
100
- text: `'${o}' view updated`
101
- }), n(!1);
100
+ text: `'${i}' view updated`
101
+ }), c(!1);
102
102
  } catch {
103
- i({
103
+ s({
104
104
  type: "error",
105
105
  text: "Failed to save view"
106
106
  });
107
107
  }
108
108
  },
109
109
  handleDuplicate: () => {
110
- E(), a(!1);
110
+ A(), a(!1);
111
111
  },
112
112
  handleMakeDefault: async () => {
113
113
  try {
114
- await _({
114
+ await N({
115
115
  user_setting_attributes: {
116
116
  default_custom_view: {
117
117
  id: Number(e.id),
118
- type: r
118
+ type: d
119
119
  }
120
120
  }
121
- }), i({
121
+ }), s({
122
122
  type: "success",
123
123
  text: `'${e.label}' is now your default view`
124
124
  }), a(!1);
125
125
  } catch {
126
- i({
126
+ s({
127
127
  type: "error",
128
128
  text: "Failed to set default view"
129
129
  });
@@ -131,57 +131,57 @@ const ye = (e) => {
131
131
  },
132
132
  openDropdown: () => a(!0),
133
133
  closeDropdown: () => a(!1),
134
- toggleDropdown: () => a(!N)
134
+ toggleDropdown: () => a(!x)
135
135
  },
136
136
  create: {
137
- handleCreate: async (t) => {
137
+ handleCreate: async (o) => {
138
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({
139
+ const { viewName: i, shareOption: S, isDefault: v } = o, C = S === "company" ? n.COMPANY : n.PERSONAL, { arg: _ } = P(), { data: g } = await j({
140
140
  attributes: {
141
- ...V,
142
- title: o,
143
- shared: v.key === s.COMPANY.key
141
+ ..._,
142
+ title: i,
143
+ shared: C.key === n.COMPANY.key
144
144
  }
145
- }), x = Y.map(($) => $.id);
146
- x.push(S.id), await _({
145
+ }), I = t.map(($) => $.id);
146
+ I.push(g.id), await N({
147
147
  user_setting_attributes: {
148
148
  custom_view_positions: {
149
- order: x
149
+ order: I
150
150
  },
151
- ...y ? {
151
+ ...v ? {
152
152
  default_custom_view: {
153
- id: Number(S.id),
154
- type: r
153
+ id: Number(g.id),
154
+ type: d
155
155
  }
156
156
  } : {}
157
157
  }
158
- }), await c(), h(e.id);
159
- const U = R({ view: S, canUpdateCustomViews: M });
160
- d(U), l(), m(!1), i({
158
+ }), await p(), V(e.id);
159
+ const U = R({ view: g, canUpdateCustomViews: F });
160
+ r(U), u(), D(!1), s({
161
161
  type: "success",
162
- text: `New view '${o}' created`
162
+ text: `New view '${i}' created`
163
163
  });
164
- } catch (o) {
165
- console.log(o), i({
164
+ } catch (i) {
165
+ console.log(i), s({
166
166
  type: "error",
167
167
  text: "Failed to save draft view"
168
168
  });
169
169
  }
170
170
  },
171
- closeCreateDropdown: () => m(!1),
171
+ closeCreateDropdown: () => D(!1),
172
172
  handleSaveDraft: async () => {
173
- m(!0);
173
+ D(!0);
174
174
  }
175
175
  }
176
176
  },
177
177
  state: {
178
- shouldShowDropdown: N,
179
- shouldShowEditDropdown: p,
178
+ shouldShowDropdown: x,
179
+ shouldShowEditDropdown: h,
180
180
  shouldShowCreateDropdown: k,
181
- shouldShowDeleteConfirmation: A
181
+ shouldShowDeleteConfirmation: E
182
182
  }
183
183
  };
184
184
  };
185
185
  export {
186
- ye as useDropdownManager
186
+ Ve as useDropdownManager
187
187
  };
package/dist/index63.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react"),h=require("./index79.cjs"),E=require("./index65.cjs"),I=require("./index62.cjs"),C=require("./index8.cjs"),S=require("./index61.cjs"),F=()=>{const{VIEW_TYPE:m,SEARCH_FILTER_ID:c}=C.useBusinessLogic(),{Filters:{activeViewId:d,initFiltersFromView:e,initFromUrl:t,discardChanges:u,updateUrl:L,setFilter:f}}=S.useStores(),{isLoading:v}=E.useCustomViews({type:m}),{viewsMap:s,defaultCustomViewId:w,isLoading:p}=I.useViews(),g=p||v;V.useEffect(()=>{if(g)return;const i=new URLSearchParams(window.location.search),l=i.get("view"),o=i.get(c),n=i.size>0;if(!d){if(l){const r=s.get(l);if(r)e(r),n&&t();else{const a=s.get(w);a&&(e(a),n&&t(!1))}}else{const r=s.get(w);if(r)e(r),u(!0),n&&t();else{const a=s.get(h.ALL_VIEW_ID);a&&e(a)}}o&&f(c,o)}},[c,d,w,u,e,t,g,f,L,s]),V.useEffect(()=>{const i=()=>{const o=new URLSearchParams(window.location.search).get("view");if(!o)return;const n=s.get(o);n&&(e(n),t())};return window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)},[u,e,t,s])};exports.useViewUrlChange=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),E=require("./index79.cjs"),I=require("./index65.cjs"),C=require("./index62.cjs"),S=require("./index8.cjs"),F=require("./index61.cjs"),q=()=>{const{VIEW_TYPE:L,SEARCH_FILTER_ID:u}=S.useBusinessLogic(),{Filters:{activeViewId:f,initFiltersFromView:e,initFromUrl:t,discardChanges:w,updateUrl:p,setFilter:g}}=F.useStores(),{isLoading:v}=I.useCustomViews({type:L}),{viewsMap:s,defaultCustomViewId:l,isLoading:h,viewsArray:o}=C.useViews(),V=h||v;m.useEffect(()=>{if(V)return;const i=new URLSearchParams(window.location.search),d=i.get("view"),r=i.get(u),n=i.size>0;if(!f){if(d){const a=s.get(d);if(a)e(a),n&&t();else{const c=s.get(l);c&&(e(c),n&&t(!1))}}else{const a=s.get(l);if(a)e(a),w(!0),n&&t();else{const c=s.get(E.ALL_VIEW_ID);c?e(c):o!=null&&o[0]&&e(o[0])}}r&&g(u,r)}},[u,f,l,w,e,t,V,g,p,s,o]),m.useEffect(()=>{const i=()=>{const r=new URLSearchParams(window.location.search).get("view");if(!r)return;const n=s.get(r);n&&(e(n),t())};return window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)},[w,e,t,s])};exports.useViewUrlChange=q;