@veeqo/transfigure 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/BusinessLogic/types.d.ts +1 -1
  2. package/dist/hooks/usePersistUnsavedChanges/usePersistUnsavedChanges.d.ts +1 -1
  3. package/dist/index100.cjs +1 -1
  4. package/dist/index100.js +33 -29
  5. package/dist/index101.cjs +1 -1
  6. package/dist/index101.js +29 -21
  7. package/dist/index103.cjs +1 -12
  8. package/dist/index103.js +21 -16
  9. package/dist/index11.cjs +1 -1
  10. package/dist/index11.js +1 -1
  11. package/dist/index110.cjs +1 -1
  12. package/dist/index110.js +36 -2
  13. package/dist/index111.cjs +1 -1
  14. package/dist/index111.js +2 -36
  15. package/dist/index113.cjs +7 -1
  16. package/dist/index113.js +10 -47
  17. package/dist/index114.cjs +1 -1
  18. package/dist/index114.js +1 -1
  19. package/dist/index115.cjs +1 -7
  20. package/dist/index115.js +47 -10
  21. package/dist/index17.cjs +1 -1
  22. package/dist/index17.js +1 -1
  23. package/dist/index31.cjs +1 -1
  24. package/dist/index31.js +1 -1
  25. package/dist/index36.cjs +1 -1
  26. package/dist/index36.js +2 -2
  27. package/dist/index40.cjs +1 -1
  28. package/dist/index40.js +1 -1
  29. package/dist/index41.cjs +1 -1
  30. package/dist/index41.js +1 -1
  31. package/dist/index44.cjs +1 -1
  32. package/dist/index44.js +1 -1
  33. package/dist/index47.cjs +1 -1
  34. package/dist/index47.js +2 -2
  35. package/dist/index83.cjs +1 -1
  36. package/dist/index83.js +1 -1
  37. package/dist/index84.cjs +1 -1
  38. package/dist/index84.js +1 -1
  39. package/dist/index85.cjs +1 -1
  40. package/dist/index85.js +41 -5
  41. package/dist/index86.cjs +1 -1
  42. package/dist/index86.js +9 -41
  43. package/dist/index87.cjs +1 -1
  44. package/dist/index87.js +4 -8
  45. package/dist/index97.cjs +1 -1
  46. package/dist/index97.js +1 -1
  47. package/dist/index98.cjs +12 -1
  48. package/dist/index98.js +16 -15
  49. package/dist/index99.cjs +1 -1
  50. package/dist/index99.js +14 -32
  51. package/dist/types.d.ts +1 -1
  52. package/package.json +1 -1
@@ -13,7 +13,7 @@ export type BusinessLogicType = {
13
13
  DEFAULT_DATE_PRESET: SelectOption;
14
14
  DEFAULT_PAGE_SIZE: string;
15
15
  DEFAULT_PAGE_NUMBER: string;
16
- VIEW_TYPE: 'order' | 'inventory';
16
+ VIEW_TYPE: 'order' | 'inventory' | 'catalog';
17
17
  FIELDS_MAP: Map<string, Filter>;
18
18
  GROUP_MAP: Map<string, FilterGroupType>;
19
19
  FILTERS_DEBOUCE_INTERVAL_MS: number;
@@ -2,7 +2,7 @@ import { TransformedView } from 'src/types';
2
2
  export declare const usePersistUnsavedChanges: () => {
3
3
  getActiveViewInAPIFormat: () => {
4
4
  arg: {
5
- type: "order" | "inventory";
5
+ type: "order" | "inventory" | "catalog";
6
6
  filters: {
7
7
  filter: Record<string, any>;
8
8
  page: {
package/dist/index100.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@veeqo/ui"),r=({shouldShow:a,viewName:n,onCancel:t,onDelete:o})=>e.jsx(i.Modal,{headerTitle:`Delete '${n}' view?`,"data-testid":"act-react-listing-custom-confirmation-popup",variant:"sm",shouldShow:a,onClose:t,rightActions:[{className:"act-react-listing-custom-confirmation-popup-cancel",label:"Cancel",onClick:t,variant:"default"},{className:"act-react-listing-custom-confirmation-popup-delete",label:"Delete",onClick:o,variant:"primaryDestructive"}],showHeaderCloseButton:!0,children:e.jsx(i.Text,{variant:"body",children:"This cannot be undone."})});exports.Confirmation=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),f=require("swr"),R=require("./index61.cjs"),S=require("./index8.cjs"),P=require("./index62.cjs"),h=require("./index55.cjs"),m=e=>e&&e.__esModule?e:{default:e},q=m(f),E=()=>{var r;const{Filters:{queryParams:e}}=R.useStores(),{TABLE_DATA_URL:i,PAGE_NUMBER_FILTER_ID:u,PAGE_SIZE_FILTER_ID:n}=S.useBusinessLogic(),{isLoading:c}=P.useViews(),a=w.useMemo(()=>{const s=new URLSearchParams(e);return s.set(u,"1"),s.set(n,"1"),s.toString()},[e,u,n]),l=!c?`${i}?${a}`:null,{data:t,error:d,isLoading:_,mutate:L}=q.default([l,{includeMeta:!0}],([s,g])=>h.fetcherV2(s,g),{revalidateOnFocus:!1,revalidateOnReconnect:!1,keepPreviousData:!0}),o=t==null?void 0:t.meta;return{viewCounts:(r=o==null?void 0:o.page)==null?void 0:r.total_count,error:d,isLoadingViewCounts:_,mutate:L}};exports.useViewCounts=E;
package/dist/index100.js CHANGED
@@ -1,31 +1,35 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { Modal as n, Text as r } from "@veeqo/ui";
3
- const s = ({ shouldShow: a, viewName: i, onCancel: t, onDelete: o }) => /* @__PURE__ */ e(
4
- n,
5
- {
6
- headerTitle: `Delete '${i}' view?`,
7
- "data-testid": "act-react-listing-custom-confirmation-popup",
8
- variant: "sm",
9
- shouldShow: a,
10
- onClose: t,
11
- rightActions: [
12
- {
13
- className: "act-react-listing-custom-confirmation-popup-cancel",
14
- label: "Cancel",
15
- onClick: t,
16
- variant: "default"
17
- },
18
- {
19
- className: "act-react-listing-custom-confirmation-popup-delete",
20
- label: "Delete",
21
- onClick: o,
22
- variant: "primaryDestructive"
23
- }
24
- ],
25
- showHeaderCloseButton: !0,
26
- children: /* @__PURE__ */ e(r, { variant: "body", children: "This cannot be undone." })
27
- }
28
- );
1
+ import { useMemo as _ } from "react";
2
+ import p from "swr";
3
+ import { useStores as w } from "./index61.js";
4
+ import { useBusinessLogic as R } from "./index8.js";
5
+ import { useViews as g } from "./index62.js";
6
+ import { fetcherV2 as E } from "./index55.js";
7
+ const V = () => {
8
+ var i;
9
+ const { Filters: { queryParams: s } } = w(), { TABLE_DATA_URL: a, PAGE_NUMBER_FILTER_ID: r, PAGE_SIZE_FILTER_ID: n } = R(), { isLoading: u } = g(), c = _(() => {
10
+ const e = new URLSearchParams(s);
11
+ return e.set(r, "1"), e.set(n, "1"), e.toString();
12
+ }, [s, r, n]), m = !u ? `${a}?${c}` : null, {
13
+ data: t,
14
+ error: l,
15
+ isLoading: L,
16
+ mutate: d
17
+ } = p(
18
+ [m, { includeMeta: !0 }],
19
+ ([e, f]) => E(e, f),
20
+ {
21
+ revalidateOnFocus: !1,
22
+ revalidateOnReconnect: !1,
23
+ keepPreviousData: !0
24
+ }
25
+ ), o = t == null ? void 0 : t.meta;
26
+ return {
27
+ viewCounts: (i = o == null ? void 0 : o.page) == null ? void 0 : i.total_count,
28
+ error: l,
29
+ isLoadingViewCounts: L,
30
+ mutate: d
31
+ };
32
+ };
29
33
  export {
30
- s as Confirmation
34
+ V as useViewCounts
31
35
  };
package/dist/index101.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@veeqo/ui"),i=require("./index104.cjs"),n=r.theme.colors.secondary.blue.base,a=({onClick:t})=>e.jsx(i.Notification,{children:e.jsx(i.Pill,{children:e.jsxs(r.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(i.Glyph,{ariaLabel:"info",name:"info",color:n}),e.jsxs(i.Wrap,{children:[e.jsx(i.Text,{variant:"body",margin:"0 4px 0 0",children:"You are currently in a"}),e.jsx(i.Bold,{variant:"bodyBoldDark",children:"draft view"}),e.jsx(i.Hint,{variant:"hintText",children:"Apply filters and save these by creating a custom view"})]}),e.jsx(i.Button,{variant:"primary",onClick:t,size:"sm",children:"Create view"})]})})});exports.DraftPill=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@veeqo/ui"),r=({shouldShow:a,viewName:n,onCancel:t,onDelete:o})=>e.jsx(i.Modal,{headerTitle:`Delete '${n}' view?`,"data-testid":"act-react-listing-custom-confirmation-popup",variant:"sm",shouldShow:a,onClose:t,rightActions:[{className:"act-react-listing-custom-confirmation-popup-cancel",label:"Cancel",onClick:t,variant:"default"},{className:"act-react-listing-custom-confirmation-popup-delete",label:"Delete",onClick:o,variant:"primaryDestructive"}],showHeaderCloseButton:!0,children:e.jsx(i.Text,{variant:"body",children:"This cannot be undone."})});exports.Confirmation=r;
package/dist/index101.js CHANGED
@@ -1,23 +1,31 @@
1
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
- import { Stack as a, theme as n } from "@veeqo/ui";
3
- import { Notification as t, Pill as o, Glyph as l, Wrap as c, Text as d, Bold as s, Hint as h, Button as m } from "./index104.js";
4
- const p = n.colors.secondary.blue.base, b = ({ onClick: e }) => /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(o, { children: /* @__PURE__ */ i(a, { direction: "horizontal", alignY: "center", children: [
5
- /* @__PURE__ */ r(l, { ariaLabel: "info", name: "info", color: p }),
6
- /* @__PURE__ */ i(c, { children: [
7
- /* @__PURE__ */ r(d, { variant: "body", margin: "0 4px 0 0", children: "You are currently in a" }),
8
- /* @__PURE__ */ r(s, { variant: "bodyBoldDark", children: "draft view" }),
9
- /* @__PURE__ */ r(h, { variant: "hintText", children: "Apply filters and save these by creating a custom view" })
10
- ] }),
11
- /* @__PURE__ */ r(
12
- m,
13
- {
14
- variant: "primary",
15
- onClick: e,
16
- size: "sm",
17
- children: "Create view"
18
- }
19
- )
20
- ] }) }) });
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { Modal as n, Text as r } from "@veeqo/ui";
3
+ const s = ({ shouldShow: a, viewName: i, onCancel: t, onDelete: o }) => /* @__PURE__ */ e(
4
+ n,
5
+ {
6
+ headerTitle: `Delete '${i}' view?`,
7
+ "data-testid": "act-react-listing-custom-confirmation-popup",
8
+ variant: "sm",
9
+ shouldShow: a,
10
+ onClose: t,
11
+ rightActions: [
12
+ {
13
+ className: "act-react-listing-custom-confirmation-popup-cancel",
14
+ label: "Cancel",
15
+ onClick: t,
16
+ variant: "default"
17
+ },
18
+ {
19
+ className: "act-react-listing-custom-confirmation-popup-delete",
20
+ label: "Delete",
21
+ onClick: o,
22
+ variant: "primaryDestructive"
23
+ }
24
+ ],
25
+ showHeaderCloseButton: !0,
26
+ children: /* @__PURE__ */ e(r, { variant: "body", children: "This cannot be undone." })
27
+ }
28
+ );
21
29
  export {
22
- b as DraftPill
30
+ s as Confirmation
23
31
  };
package/dist/index103.cjs CHANGED
@@ -1,12 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("styled-components"),t=require("@veeqo/ui"),o=e=>e&&e.__esModule?e:{default:e},r=o(i),d=r.default(t.BaseContainer)`
2
- display: flex;
3
- flex-direction: column;
4
- padding: 8px;
5
- padding-left: 35px;
6
- margin: 8px;
7
- background-color: ${t.theme.colors.neutral.grey.lightest};
8
- `,l=r.default.hr`
9
- width: 100%;
10
- border-top: 1px solid ${t.theme.colors.neutral.grey.dark};
11
- margin: 0 0 4px 0;
12
- `;exports.Divider=l;exports.FixedViews=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@veeqo/ui"),i=require("./index104.cjs"),n=r.theme.colors.secondary.blue.base,a=({onClick:t})=>e.jsx(i.Notification,{children:e.jsx(i.Pill,{children:e.jsxs(r.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(i.Glyph,{ariaLabel:"info",name:"info",color:n}),e.jsxs(i.Wrap,{children:[e.jsx(i.Text,{variant:"body",margin:"0 4px 0 0",children:"You are currently in a"}),e.jsx(i.Bold,{variant:"bodyBoldDark",children:"draft view"}),e.jsx(i.Hint,{variant:"hintText",children:"Apply filters and save these by creating a custom view"})]}),e.jsx(i.Button,{variant:"primary",onClick:t,size:"sm",children:"Create view"})]})})});exports.DraftPill=a;
package/dist/index103.js CHANGED
@@ -1,18 +1,23 @@
1
- import r from "styled-components";
2
- import { theme as o, BaseContainer as e } from "@veeqo/ui";
3
- const d = r(e)`
4
- display: flex;
5
- flex-direction: column;
6
- padding: 8px;
7
- padding-left: 35px;
8
- margin: 8px;
9
- background-color: ${o.colors.neutral.grey.lightest};
10
- `, l = r.hr`
11
- width: 100%;
12
- border-top: 1px solid ${o.colors.neutral.grey.dark};
13
- margin: 0 0 4px 0;
14
- `;
1
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
2
+ import { Stack as a, theme as n } from "@veeqo/ui";
3
+ import { Notification as t, Pill as o, Glyph as l, Wrap as c, Text as d, Bold as s, Hint as h, Button as m } from "./index104.js";
4
+ const p = n.colors.secondary.blue.base, b = ({ onClick: e }) => /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(o, { children: /* @__PURE__ */ i(a, { direction: "horizontal", alignY: "center", children: [
5
+ /* @__PURE__ */ r(l, { ariaLabel: "info", name: "info", color: p }),
6
+ /* @__PURE__ */ i(c, { children: [
7
+ /* @__PURE__ */ r(d, { variant: "body", margin: "0 4px 0 0", children: "You are currently in a" }),
8
+ /* @__PURE__ */ r(s, { variant: "bodyBoldDark", children: "draft view" }),
9
+ /* @__PURE__ */ r(h, { variant: "hintText", children: "Apply filters and save these by creating a custom view" })
10
+ ] }),
11
+ /* @__PURE__ */ r(
12
+ m,
13
+ {
14
+ variant: "primary",
15
+ onClick: e,
16
+ size: "sm",
17
+ children: "Create view"
18
+ }
19
+ )
20
+ ] }) }) });
15
21
  export {
16
- l as Divider,
17
- d as FixedViews
22
+ b as DraftPill
18
23
  };
package/dist/index11.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("react"),t=require("@veeqo/ui"),h=require("pluralize"),m=require("./index85.cjs"),f=e=>e&&e.__esModule?e:{default:e},w=f(h),S=({children:e,totalCount:i,selectedCount:o,itemLabel:r="item"})=>{const[l,c]=p.useState(!1),n=o>0,a=n?o:i,d=w.default(r,a),u=`Actions will apply to ${n?`${o} selected`:`${i} filtered`} ${d}`;return s.jsxs(t.Dropdown,{id:"actions-dropdown",ctaProps:{children:"Actions",variant:"primary",size:"sm"},shouldShow:l,setShouldShow:c,style:{padding:t.theme.sizes.none,minWidth:"300px"},children:[s.jsx("div",{className:m.default.actionsHeaderContainer,children:s.jsx(t.MiniAlert,{title:u,variant:"default",customIconColour:t.theme.colors.secondary.blue.base})}),e]})};exports.ActionsDropdown=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("react"),t=require("@veeqo/ui"),h=require("pluralize"),m=require("./index87.cjs"),f=e=>e&&e.__esModule?e:{default:e},w=f(h),S=({children:e,totalCount:i,selectedCount:o,itemLabel:r="item"})=>{const[l,c]=p.useState(!1),n=o>0,a=n?o:i,d=w.default(r,a),u=`Actions will apply to ${n?`${o} selected`:`${i} filtered`} ${d}`;return s.jsxs(t.Dropdown,{id:"actions-dropdown",ctaProps:{children:"Actions",variant:"primary",size:"sm"},shouldShow:l,setShouldShow:c,style:{padding:t.theme.sizes.none,minWidth:"300px"},children:[s.jsx("div",{className:m.default.actionsHeaderContainer,children:s.jsx(t.MiniAlert,{title:u,variant:"default",customIconColour:t.theme.colors.secondary.blue.base})}),e]})};exports.ActionsDropdown=S;
package/dist/index11.js CHANGED
@@ -2,7 +2,7 @@ import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
2
  import { useState as p } from "react";
3
3
  import { Dropdown as h, theme as e, MiniAlert as u } from "@veeqo/ui";
4
4
  import f from "pluralize";
5
- import w from "./index85.js";
5
+ import w from "./index87.js";
6
6
  const b = ({ children: s, totalCount: t, selectedCount: o, itemLabel: n = "item" }) => {
7
7
  const [l, a] = p(!1), i = o > 0, c = f(n, i ? o : t), d = `Actions will apply to ${i ? `${o} selected` : `${t} filtered`} ${c}`;
8
8
  return /* @__PURE__ */ m(
package/dist/index110.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=r=>r instanceof Error;exports.isError=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@veeqo/ui"),o=require("@material-ui/core/styles"),t=require("@material-ui/core/Slider"),l=e=>e&&e.__esModule?e:{default:e},i=l(t),a=o.withStyles({root:{color:r.theme.colors.secondary.blue.base,height:4},thumb:{height:20,width:20,backgroundColor:"#fff",border:"3px solid currentColor",marginTop:-8,marginLeft:-10,"&:focus, &:hover, &$active":{boxShadow:"inherit"}},valueLabel:{left:"calc(-50% - 1px)"},track:{height:4,borderRadius:4,backgroundColor:r.theme.colors.secondary.blue.light,opacity:1},rail:{height:4,borderRadius:4,backgroundColor:r.theme.colors.neutral.grey.dark,opacity:1}})(i.default);exports.MUISlider=a;
package/dist/index110.js CHANGED
@@ -1,4 +1,38 @@
1
- const o = (r) => r instanceof Error;
1
+ import { theme as o } from "@veeqo/ui";
2
+ import { withStyles as r } from "@material-ui/core/styles";
3
+ import e from "@material-ui/core/Slider";
4
+ const l = r({
5
+ root: {
6
+ color: o.colors.secondary.blue.base,
7
+ height: 4
8
+ },
9
+ thumb: {
10
+ height: 20,
11
+ width: 20,
12
+ backgroundColor: "#fff",
13
+ border: "3px solid currentColor",
14
+ marginTop: -8,
15
+ marginLeft: -10,
16
+ "&:focus, &:hover, &$active": {
17
+ boxShadow: "inherit"
18
+ }
19
+ },
20
+ valueLabel: {
21
+ left: "calc(-50% - 1px)"
22
+ },
23
+ track: {
24
+ height: 4,
25
+ borderRadius: 4,
26
+ backgroundColor: o.colors.secondary.blue.light,
27
+ opacity: 1
28
+ },
29
+ rail: {
30
+ height: 4,
31
+ borderRadius: 4,
32
+ backgroundColor: o.colors.neutral.grey.dark,
33
+ opacity: 1
34
+ }
35
+ })(e);
2
36
  export {
3
- o as isError
37
+ l as MUISlider
4
38
  };
package/dist/index111.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@veeqo/ui"),o=require("@material-ui/core/styles"),t=require("@material-ui/core/Slider"),l=e=>e&&e.__esModule?e:{default:e},i=l(t),a=o.withStyles({root:{color:r.theme.colors.secondary.blue.base,height:4},thumb:{height:20,width:20,backgroundColor:"#fff",border:"3px solid currentColor",marginTop:-8,marginLeft:-10,"&:focus, &:hover, &$active":{boxShadow:"inherit"}},valueLabel:{left:"calc(-50% - 1px)"},track:{height:4,borderRadius:4,backgroundColor:r.theme.colors.secondary.blue.light,opacity:1},rail:{height:4,borderRadius:4,backgroundColor:r.theme.colors.neutral.grey.dark,opacity:1}})(i.default);exports.MUISlider=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=r=>r instanceof Error;exports.isError=e;
package/dist/index111.js CHANGED
@@ -1,38 +1,4 @@
1
- import { theme as o } from "@veeqo/ui";
2
- import { withStyles as r } from "@material-ui/core/styles";
3
- import e from "@material-ui/core/Slider";
4
- const l = r({
5
- root: {
6
- color: o.colors.secondary.blue.base,
7
- height: 4
8
- },
9
- thumb: {
10
- height: 20,
11
- width: 20,
12
- backgroundColor: "#fff",
13
- border: "3px solid currentColor",
14
- marginTop: -8,
15
- marginLeft: -10,
16
- "&:focus, &:hover, &$active": {
17
- boxShadow: "inherit"
18
- }
19
- },
20
- valueLabel: {
21
- left: "calc(-50% - 1px)"
22
- },
23
- track: {
24
- height: 4,
25
- borderRadius: 4,
26
- backgroundColor: o.colors.secondary.blue.light,
27
- opacity: 1
28
- },
29
- rail: {
30
- height: 4,
31
- borderRadius: 4,
32
- backgroundColor: o.colors.neutral.grey.dark,
33
- opacity: 1
34
- }
35
- })(e);
1
+ const o = (r) => r instanceof Error;
36
2
  export {
37
- l as MUISlider
3
+ o as isError
38
4
  };
package/dist/index113.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/index113.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/index114.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),p=require("mobx-react"),l=require("@veeqo/ui"),v=require("./index111.cjs"),y=p.observer(({data:m,editedValue:t,setEditedValue:c})=>{var b;if(!((b=m.options)!=null&&b.length))return null;const[u,x]=m.options,i=Number(u.value),a=Number(x.value),h=(s,n)=>{if(!Array.isArray(n)||n.length!==2||!t)return;const[e,j]=n,g=t==null?void 0:t.clone();g.setGte(e),g.setLte(j),c(g)},o={gte:(t==null?void 0:t.gte)||0,lte:(t==null?void 0:t.lte)||100},M=s=>{if(!t)return;const n=t.clone(),e=Number(s);e>n.lteMax||(e>=n.gteMin&&e<=n.lteMax&&n.setGte(e),(!n.lte||e>=n.lte)&&n.setLte(n.lteMax),c(n))},f=s=>{if(!t)return;const n=t.clone(),e=Number(s);e<n.gteMin||(e>=n.gteMin&&e<=n.lteMax&&n.setLte(e),(!n.gte||e<=n.gte)&&n.setGte(n.gteMin),c(n))},S=[o.gte,o.lte];return r.jsxs(l.Stack,{spacing:"xs",alignX:"stretch",children:[r.jsxs(l.Stack,{direction:"horizontal",children:[r.jsx(l.TextField,{label:u.label,type:"number",min:i,max:a,value:o.gte.toString(),onChange:M}),r.jsx(l.TextField,{label:x.label,type:"number",min:i,max:a,value:o.lte.toString(),onChange:f})]}),r.jsx(v.MUISlider,{value:S,onChange:h,min:i,max:a,valueLabelDisplay:"auto"})]})});exports.FilterNumberRangeFilter=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),p=require("mobx-react"),l=require("@veeqo/ui"),v=require("./index110.cjs"),y=p.observer(({data:m,editedValue:t,setEditedValue:c})=>{var b;if(!((b=m.options)!=null&&b.length))return null;const[u,x]=m.options,i=Number(u.value),a=Number(x.value),h=(s,n)=>{if(!Array.isArray(n)||n.length!==2||!t)return;const[e,j]=n,g=t==null?void 0:t.clone();g.setGte(e),g.setLte(j),c(g)},o={gte:(t==null?void 0:t.gte)||0,lte:(t==null?void 0:t.lte)||100},M=s=>{if(!t)return;const n=t.clone(),e=Number(s);e>n.lteMax||(e>=n.gteMin&&e<=n.lteMax&&n.setGte(e),(!n.lte||e>=n.lte)&&n.setLte(n.lteMax),c(n))},f=s=>{if(!t)return;const n=t.clone(),e=Number(s);e<n.gteMin||(e>=n.gteMin&&e<=n.lteMax&&n.setLte(e),(!n.gte||e<=n.gte)&&n.setGte(n.gteMin),c(n))},S=[o.gte,o.lte];return r.jsxs(l.Stack,{spacing:"xs",alignX:"stretch",children:[r.jsxs(l.Stack,{direction:"horizontal",children:[r.jsx(l.TextField,{label:u.label,type:"number",min:i,max:a,value:o.gte.toString(),onChange:M}),r.jsx(l.TextField,{label:x.label,type:"number",min:i,max:a,value:o.lte.toString(),onChange:f})]}),r.jsx(v.MUISlider,{value:S,onChange:h,min:i,max:a,valueLabelDisplay:"auto"})]})});exports.FilterNumberRangeFilter=y;
package/dist/index114.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsxs as b, jsx as a } from "react/jsx-runtime";
2
2
  import { observer as N } from "mobx-react";
3
3
  import { Stack as h, TextField as u } from "@veeqo/ui";
4
- import { MUISlider as L } from "./index111.js";
4
+ import { MUISlider as L } from "./index110.js";
5
5
  const j = N(
6
6
  ({ data: g, editedValue: t, setEditedValue: l }) => {
7
7
  var f;
package/dist/index115.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/index115.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("./index113.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("./index115.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 "./index113.js";
5
+ import { ActiveAsyncCheckboxFilter as c } from "./index115.js";
6
6
  const F = n(
7
7
  ({ data: r, editedValue: e, setEditedValue: o }) => {
8
8
  var i;
package/dist/index31.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("react"),_=require("mobx-react"),j=require("lodash/debounce"),r=require("@veeqo/ui"),L=require("./index111.cjs"),R=require("./index69.cjs"),p=require("./index8.cjs"),y=require("./index61.cjs"),v=i=>i&&i.__esModule?i:{default:i},k=v(j),I=_.observer(({field:i})=>{var M;const{FILTERS_DEBOUCE_INTERVAL_MS:f}=p.useBusinessLogic(),{Filters:{numberRangeFilters:u,setNumberRangeFilter:x,clearNumberRangeFilter:F}}=y.useStores(),e=u.get(i.id),[o,g]=d.useState({gte:(e==null?void 0:e.gte)??0,lte:(e==null?void 0:e.lte)??100});if(!((M=i.options)!=null&&M.length))return null;const b=()=>{const l=new R.NumberRangeFilter({filterId:i.id});return u.set(i.id,l),l},c=d.useCallback(k.default(({numberRange:l,lte:t,gte:n})=>{x({numberRange:l,lte:t,gte:n})},f),[x]),h=()=>{g({gte:0,lte:100}),F(i.id)},S=(l,t)=>{let n=new R.NumberRangeFilter({filterId:i.id});if(e||(n=b()),!Array.isArray(t)||t.length!==2)return;const[s,m]=t;g({gte:s,lte:m}),c(e?{numberRange:e,lte:m,gte:s}:{numberRange:n,lte:m,gte:s})},N=l=>{if(e||b(),!e)return;const t=Number(l);if(t>e.lteMax)return;let{lte:n}=e,{gte:s}=e;t>=e.gteMin&&t<=e.lteMax&&(s=t),(!e.lte||t>=e.lte)&&(n=e.lteMax),g({gte:s,lte:n}),c({numberRange:e,lte:n,gte:s})},C=l=>{if(e||b(),!e)return;const t=Number(l);if(t<e.gteMin)return;let{lte:n}=e,{gte:s}=e;t>=e.gteMin&&t<=e.lteMax&&(n=t),(!e.gte||t<=e.gte)&&(s=e.gteMin),g({gte:s,lte:n}),c({numberRange:e,lte:n,gte:s})},q=[o.gte,o.lte];return a.jsxs(r.Stack,{spacing:"xs",alignX:"stretch",children:[a.jsx(r.Button,{variant:"link",onClick:h,children:"Clear"}),a.jsxs(r.Stack,{direction:"horizontal",children:[a.jsx(r.TextField,{label:e==null?void 0:e.gteMinLabel,type:"number",min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,value:o.gte.toString(),onChange:N}),a.jsx(r.TextField,{label:e==null?void 0:e.lteMaxLabel,type:"number",min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,value:o.lte.toString(),onChange:C})]}),a.jsx(L.MUISlider,{value:q,onChange:S,min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,valueLabelDisplay:"auto"})]})});exports.NumberRangeFilter=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("react"),_=require("mobx-react"),j=require("lodash/debounce"),r=require("@veeqo/ui"),L=require("./index110.cjs"),R=require("./index69.cjs"),p=require("./index8.cjs"),y=require("./index61.cjs"),v=i=>i&&i.__esModule?i:{default:i},k=v(j),I=_.observer(({field:i})=>{var M;const{FILTERS_DEBOUCE_INTERVAL_MS:f}=p.useBusinessLogic(),{Filters:{numberRangeFilters:u,setNumberRangeFilter:x,clearNumberRangeFilter:F}}=y.useStores(),e=u.get(i.id),[o,g]=d.useState({gte:(e==null?void 0:e.gte)??0,lte:(e==null?void 0:e.lte)??100});if(!((M=i.options)!=null&&M.length))return null;const b=()=>{const l=new R.NumberRangeFilter({filterId:i.id});return u.set(i.id,l),l},c=d.useCallback(k.default(({numberRange:l,lte:t,gte:n})=>{x({numberRange:l,lte:t,gte:n})},f),[x]),h=()=>{g({gte:0,lte:100}),F(i.id)},S=(l,t)=>{let n=new R.NumberRangeFilter({filterId:i.id});if(e||(n=b()),!Array.isArray(t)||t.length!==2)return;const[s,m]=t;g({gte:s,lte:m}),c(e?{numberRange:e,lte:m,gte:s}:{numberRange:n,lte:m,gte:s})},N=l=>{if(e||b(),!e)return;const t=Number(l);if(t>e.lteMax)return;let{lte:n}=e,{gte:s}=e;t>=e.gteMin&&t<=e.lteMax&&(s=t),(!e.lte||t>=e.lte)&&(n=e.lteMax),g({gte:s,lte:n}),c({numberRange:e,lte:n,gte:s})},C=l=>{if(e||b(),!e)return;const t=Number(l);if(t<e.gteMin)return;let{lte:n}=e,{gte:s}=e;t>=e.gteMin&&t<=e.lteMax&&(n=t),(!e.gte||t<=e.gte)&&(s=e.gteMin),g({gte:s,lte:n}),c({numberRange:e,lte:n,gte:s})},q=[o.gte,o.lte];return a.jsxs(r.Stack,{spacing:"xs",alignX:"stretch",children:[a.jsx(r.Button,{variant:"link",onClick:h,children:"Clear"}),a.jsxs(r.Stack,{direction:"horizontal",children:[a.jsx(r.TextField,{label:e==null?void 0:e.gteMinLabel,type:"number",min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,value:o.gte.toString(),onChange:N}),a.jsx(r.TextField,{label:e==null?void 0:e.lteMaxLabel,type:"number",min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,value:o.lte.toString(),onChange:C})]}),a.jsx(L.MUISlider,{value:q,onChange:S,min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,valueLabelDisplay:"auto"})]})});exports.NumberRangeFilter=I;
package/dist/index31.js CHANGED
@@ -3,7 +3,7 @@ import { useState as y, useCallback as I } from "react";
3
3
  import { observer as k } from "mobx-react";
4
4
  import E from "lodash/debounce";
5
5
  import { Stack as c, Button as _, TextField as p } from "@veeqo/ui";
6
- import { MUISlider as A } from "./index111.js";
6
+ import { MUISlider as A } from "./index110.js";
7
7
  import { NumberRangeFilter as h } from "./index69.js";
8
8
  import { useBusinessLogic as B } from "./index8.js";
9
9
  import { useStores as T } from "./index61.js";
package/dist/index36.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),a=require("react"),c=require("@veeqo/ui"),W=require("mobx-react"),Y=require("./index65.cjs"),z=require("./index62.cjs"),G=require("./index40.cjs"),J=require("./index43.cjs"),K=require("./index56.cjs"),Q=require("./index99.cjs"),X=require("./index8.cjs"),Z=require("./index61.cjs"),$=require("./index100.cjs"),b=W.observer(({view:e})=>{const{VIEW_TYPE:S,SEARCH_FILTER_ID:l}=X.useBusinessLogic(),{Filters:{activeViewId:d,initFiltersFromView:w,discardChanges:f,initFromUrl:m,filters:x,setFilter:L},Views:{draftViewsMap:y},Notifications:{notify:T}}=Z.useStores(),{viewsMap:V,defaultCustomViewId:F,isLoading:j}=z.useViews(),{isLoading:N}=Y.useCustomViews({type:S}),{viewCounts:E,isLoadingViewCounts:M}=Q.useViewCounts(),[s,R]=a.useState(null),k=o=>{const q=x.get(l);if(V.has(o)){const n=V.get(o);n&&(w(n),f(!0),m())}else{const n=y.get(o);n?(w(n),f(!0),m()):T({type:"error",text:"Failed to load view"})}q&&L(l,q)},r=(e==null?void 0:e.id)===d,t=e.originalView!==void 0,h=e.originalView===void 0,P=E,u=(e==null?void 0:e.label)||"",A=j||N,g=a.useRef(!1);!A&&!g.current&&r&&e.id===F&&s&&(g.current=!0,s&&d===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const p=a.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:B},menu:{toggleDropdown:C},delete:{closeDeleteConfirmation:I,handleDelete:_,handleDeleteDraftView:D}},state:{shouldShowDeleteConfirmation:H},actions:O,state:v}=K.useDropdownManager(e),U=a.useMemo(()=>{if(h)return C;if(t)return D},[D,t,h,C]);return i.jsxs(i.Fragment,{children:[i.jsx(c.ViewTab,{colourPalette:c.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:r,id:e==null?void 0:e.id,name:u,type:p,count:M?i.jsx(c.Loader,{type:"ThreeDots",width:12,height:12,color:r?"#fff":c.theme.colors.neutral.ink.dark}):P,onClick:k,subAction:U,ariaContext:"orders",ref:R,"aria-controls":"options-dropdown","aria-expanded":v.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx($.Confirmation,{shouldShow:H,viewName:u,onCancel:I,onDelete:_}),i.jsx(G.PillNotifications,{tabType:p,isActive:r,initialViewName:u,shouldShowCreateViewNotification:t,handleSaveDraft:B}),i.jsx(J.ViewDropdowns,{referenceElement:s,tab:e,...O,...v})]})});exports.ViewTab=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),a=require("react"),c=require("@veeqo/ui"),W=require("mobx-react"),Y=require("./index65.cjs"),z=require("./index62.cjs"),G=require("./index40.cjs"),J=require("./index43.cjs"),K=require("./index56.cjs"),Q=require("./index100.cjs"),X=require("./index8.cjs"),Z=require("./index61.cjs"),$=require("./index101.cjs"),b=W.observer(({view:e})=>{const{VIEW_TYPE:S,SEARCH_FILTER_ID:l}=X.useBusinessLogic(),{Filters:{activeViewId:d,initFiltersFromView:w,discardChanges:f,initFromUrl:m,filters:x,setFilter:L},Views:{draftViewsMap:y},Notifications:{notify:T}}=Z.useStores(),{viewsMap:V,defaultCustomViewId:F,isLoading:j}=z.useViews(),{isLoading:N}=Y.useCustomViews({type:S}),{viewCounts:E,isLoadingViewCounts:M}=Q.useViewCounts(),[s,R]=a.useState(null),k=o=>{const q=x.get(l);if(V.has(o)){const n=V.get(o);n&&(w(n),f(!0),m())}else{const n=y.get(o);n?(w(n),f(!0),m()):T({type:"error",text:"Failed to load view"})}q&&L(l,q)},r=(e==null?void 0:e.id)===d,t=e.originalView!==void 0,h=e.originalView===void 0,P=E,u=(e==null?void 0:e.label)||"",A=j||N,g=a.useRef(!1);!A&&!g.current&&r&&e.id===F&&s&&(g.current=!0,s&&d===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const p=a.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:B},menu:{toggleDropdown:C},delete:{closeDeleteConfirmation:I,handleDelete:_,handleDeleteDraftView:D}},state:{shouldShowDeleteConfirmation:H},actions:O,state:v}=K.useDropdownManager(e),U=a.useMemo(()=>{if(h)return C;if(t)return D},[D,t,h,C]);return i.jsxs(i.Fragment,{children:[i.jsx(c.ViewTab,{colourPalette:c.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:r,id:e==null?void 0:e.id,name:u,type:p,count:M?i.jsx(c.Loader,{type:"ThreeDots",width:12,height:12,color:r?"#fff":c.theme.colors.neutral.ink.dark}):P,onClick:k,subAction:U,ariaContext:"orders",ref:R,"aria-controls":"options-dropdown","aria-expanded":v.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx($.Confirmation,{shouldShow:H,viewName:u,onCancel:I,onDelete:_}),i.jsx(G.PillNotifications,{tabType:p,isActive:r,initialViewName:u,shouldShowCreateViewNotification:t,handleSaveDraft:B}),i.jsx(J.ViewDropdowns,{referenceElement:s,tab:e,...O,...v})]})});exports.ViewTab=b;
package/dist/index36.js CHANGED
@@ -7,10 +7,10 @@ import { useViews as X } from "./index62.js";
7
7
  import { PillNotifications as Z } from "./index40.js";
8
8
  import { ViewDropdowns as b } from "./index43.js";
9
9
  import { useDropdownManager as ee } from "./index56.js";
10
- import { useViewCounts as oe } from "./index99.js";
10
+ import { useViewCounts as oe } from "./index100.js";
11
11
  import { useBusinessLogic as ie } from "./index8.js";
12
12
  import { useStores as te } from "./index61.js";
13
- import { Confirmation as re } from "./index100.js";
13
+ import { Confirmation as re } from "./index101.js";
14
14
  const ge = K(({ view: e }) => {
15
15
  const { VIEW_TYPE: S, SEARCH_FILTER_ID: l } = ie(), {
16
16
  Filters: { activeViewId: c, initFiltersFromView: d, discardChanges: f, initFromUrl: m, filters: F, setFilter: T },
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("./index101.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("./index103.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 "./index101.js";
6
+ import { DraftPill as w } from "./index103.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("./index98.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("./index99.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 "./index98.js";
3
+ import { LegacySortableViews as w } from "./index99.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/index44.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("./index103.cjs"),j=require("./index41.cjs"),m=require("./index62.cjs"),S=require("./index63.cjs"),q=require("./index37.cjs"),u=require("./index36.cjs"),p=require("./index61.cjs"),a=require("./index12.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("./index98.cjs"),j=require("./index41.cjs"),m=require("./index62.cjs"),S=require("./index63.cjs"),q=require("./index37.cjs"),u=require("./index36.cjs"),p=require("./index61.cjs"),a=require("./index12.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/index44.js CHANGED
@@ -2,7 +2,7 @@ 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 "./index103.js";
5
+ import { FixedViews as x, Divider as C } from "./index98.js";
6
6
  import { SortableViews as b } from "./index41.js";
7
7
  import { useViews as A } from "./index62.js";
8
8
  import { useViewUrlChange as L } from "./index63.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("./index85.cjs"),e=require("@veeqo/ui"),o=require("./index86.cjs"),d=require("./index61.cjs"),m=({isLoading:a,refetch:n,trackMetricClick:s,tooltipText:l="Refresh data",buttonProps:i={size:"sm",variant:"default"}})=>{const{hasChanges:r,acknowledgeButtonClick:u}=h.usePollData(),{Notifications:{notify:c}}=d.useStores(),f=async()=>{try{await n(),await u(),s==null||s()}catch{c({type:"error",text:"Failed to refresh data"})}};return t.jsxs(e.Tooltip,{className:o.default.refreshTooltip,text:l,children:[t.jsx(e.Button,{className:o.default.refreshButton,onClick:f,loading:a,disabled:a,iconSlot:t.jsx(e.RefreshIcon,{color:e.theme.colors.neutral.ink.base}),"aria-label":r?"refresh table with changes":"refresh table","aria-live":"polite",...i}),t.jsx(e.Indicator,{className:o.default.refreshIndicator,color:"red",size:"xs",style:{opacity:r?1:0}})]})};exports.RefreshButton=m;
package/dist/index47.js CHANGED
@@ -1,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 "./index85.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 "./index86.js";
5
5
  import { useStores as b } from "./index61.js";
6
6
  const j = ({
7
7
  isLoading: s,
package/dist/index83.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index110.cjs"),s=e=>{if(!l.isError(e))return e;if(e.stack){const t=e.stack.split(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index111.cjs"),s=e=>{if(!l.isError(e))return e;if(e.stack){const t=e.stack.split(`
2
2
  `);if(t.length<=10)return e;const n=t==null?void 0:t[0],i=t==null?void 0:t.splice(9),r=[n,...i].join(`
3
3
  `);e.stack=r}return e};exports.filterErrorStack=s;
package/dist/index83.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isError as l } from "./index110.js";
1
+ import { isError as l } from "./index111.js";
2
2
  const s = (e) => {
3
3
  if (!l(e)) return e;
4
4
  if (e.stack) {
package/dist/index84.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index110.cjs"),n=({customError:t,originalError:e,type:c})=>{!s.isError(e)||!s.isError(t)||(e.stack&&(e.stack=t.stack),e.name&&(e.name=`${c} (${e.name})`))};exports.injectIntoError=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index111.cjs"),n=({customError:t,originalError:e,type:c})=>{!s.isError(e)||!s.isError(t)||(e.stack&&(e.stack=t.stack),e.name&&(e.name=`${c} (${e.name})`))};exports.injectIntoError=n;
package/dist/index84.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isError as c } from "./index110.js";
1
+ import { isError as c } from "./index111.js";
2
2
  const s = ({
3
3
  customError: e,
4
4
  originalError: t,
package/dist/index85.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_actionsHeaderContainer_fgqms_1",t={actionsHeaderContainer:e};exports.actionsHeaderContainer=e;exports.default=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),w=require("react-use"),L=require("./index8.cjs"),m=require("./index61.cjs"),v=require("./index67.cjs"),q=require("./index55.cjs");function V(){const{TABLE_DATA_URL:h}=L.useBusinessLogic(),{Filters:{pageSize:s,activeViewId:n}}=m.useStores(),{queryParams:S}=v.useUrlParams();async function c(){const e=`${h}?${S}`,g=await q.fetcherV2(e);return JSON.stringify(g)}const[u,a]=t.useState(null),[o,l]=t.useState(!1),[f,C]=t.useState(n),[y,P]=t.useState(s),i=3e5,[D,r]=t.useState(i);return t.useEffect(()=>{const e=()=>{document.hidden?r(null):r(i)};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),w.useInterval(async()=>{const e=await c();if(u===null||f!==n||y!==s){a(e),C(n),P(s);return}const d=e!==u;d&&(a(e),l(d))},o?null:D),{hasChanges:o,acknowledgeButtonClick:async()=>{l(!1),r(i),a(await c())}}}exports.usePollData=V;
package/dist/index85.js CHANGED
@@ -1,7 +1,43 @@
1
- const e = "_actionsHeaderContainer_fgqms_1", a = {
2
- actionsHeaderContainer: e
3
- };
1
+ import { useState as t, useEffect as p } from "react";
2
+ import { useInterval as P } from "react-use";
3
+ import { useBusinessLogic as S } from "./index8.js";
4
+ import { useStores as L } from "./index61.js";
5
+ import { useUrlParams as v } from "./index67.js";
6
+ import { fetcherV2 as V } from "./index55.js";
7
+ function T() {
8
+ const { TABLE_DATA_URL: h } = S(), {
9
+ Filters: {
10
+ pageSize: n,
11
+ activeViewId: s
12
+ }
13
+ } = L(), { queryParams: m } = v();
14
+ async function r() {
15
+ const e = `${h}?${m}`, g = await V(e);
16
+ return JSON.stringify(g);
17
+ }
18
+ const [c, a] = t(null), [l, u] = t(!1), [f, C] = t(s), [w, y] = t(n), i = 3e5, [D, o] = t(i);
19
+ return p(() => {
20
+ const e = () => {
21
+ document.hidden ? o(null) : o(i);
22
+ };
23
+ return document.addEventListener("visibilitychange", e), () => {
24
+ document.removeEventListener("visibilitychange", e);
25
+ };
26
+ }, []), P(
27
+ async () => {
28
+ const e = await r();
29
+ if (c === null || f !== s || w !== n) {
30
+ a(e), C(s), y(n);
31
+ return;
32
+ }
33
+ const d = e !== c;
34
+ d && (a(e), u(d));
35
+ },
36
+ l ? null : D
37
+ ), { hasChanges: l, acknowledgeButtonClick: async () => {
38
+ u(!1), o(i), a(await r());
39
+ } };
40
+ }
4
41
  export {
5
- e as actionsHeaderContainer,
6
- a as default
42
+ T as usePollData
7
43
  };
package/dist/index86.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),w=require("react-use"),L=require("./index8.cjs"),m=require("./index61.cjs"),v=require("./index67.cjs"),q=require("./index55.cjs");function V(){const{TABLE_DATA_URL:h}=L.useBusinessLogic(),{Filters:{pageSize:s,activeViewId:n}}=m.useStores(),{queryParams:S}=v.useUrlParams();async function c(){const e=`${h}?${S}`,g=await q.fetcherV2(e);return JSON.stringify(g)}const[u,a]=t.useState(null),[o,l]=t.useState(!1),[f,C]=t.useState(n),[y,P]=t.useState(s),i=3e5,[D,r]=t.useState(i);return t.useEffect(()=>{const e=()=>{document.hidden?r(null):r(i)};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[]),w.useInterval(async()=>{const e=await c();if(u===null||f!==n||y!==s){a(e),C(n),P(s);return}const d=e!==u;d&&(a(e),l(d))},o?null:D),{hasChanges:o,acknowledgeButtonClick:async()=>{l(!1),r(i),a(await c())}}}exports.usePollData=V;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_refreshTooltip_v0eu8_1",r="_refreshButton_v0eu8_5",t="_refreshIndicator_v0eu8_9",o={refreshTooltip:e,refreshButton:r,refreshIndicator:t};exports.default=o;exports.refreshButton=r;exports.refreshIndicator=t;exports.refreshTooltip=e;
package/dist/index86.js CHANGED
@@ -1,43 +1,11 @@
1
- import { useState as t, useEffect as p } from "react";
2
- import { useInterval as P } from "react-use";
3
- import { useBusinessLogic as S } from "./index8.js";
4
- import { useStores as L } from "./index61.js";
5
- import { useUrlParams as v } from "./index67.js";
6
- import { fetcherV2 as V } from "./index55.js";
7
- function T() {
8
- const { TABLE_DATA_URL: h } = S(), {
9
- Filters: {
10
- pageSize: n,
11
- activeViewId: s
12
- }
13
- } = L(), { queryParams: m } = v();
14
- async function r() {
15
- const e = `${h}?${m}`, g = await V(e);
16
- return JSON.stringify(g);
17
- }
18
- const [c, a] = t(null), [l, u] = t(!1), [f, C] = t(s), [w, y] = t(n), i = 3e5, [D, o] = t(i);
19
- return p(() => {
20
- const e = () => {
21
- document.hidden ? o(null) : o(i);
22
- };
23
- return document.addEventListener("visibilitychange", e), () => {
24
- document.removeEventListener("visibilitychange", e);
25
- };
26
- }, []), P(
27
- async () => {
28
- const e = await r();
29
- if (c === null || f !== s || w !== n) {
30
- a(e), C(s), y(n);
31
- return;
32
- }
33
- const d = e !== c;
34
- d && (a(e), u(d));
35
- },
36
- l ? null : D
37
- ), { hasChanges: l, acknowledgeButtonClick: async () => {
38
- u(!1), o(i), a(await r());
39
- } };
40
- }
1
+ const e = "_refreshTooltip_v0eu8_1", r = "_refreshButton_v0eu8_5", t = "_refreshIndicator_v0eu8_9", o = {
2
+ refreshTooltip: e,
3
+ refreshButton: r,
4
+ refreshIndicator: t
5
+ };
41
6
  export {
42
- T as usePollData
7
+ o as default,
8
+ r as refreshButton,
9
+ t as refreshIndicator,
10
+ e as refreshTooltip
43
11
  };
package/dist/index87.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_refreshTooltip_v0eu8_1",r="_refreshButton_v0eu8_5",t="_refreshIndicator_v0eu8_9",o={refreshTooltip:e,refreshButton:r,refreshIndicator:t};exports.default=o;exports.refreshButton=r;exports.refreshIndicator=t;exports.refreshTooltip=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_actionsHeaderContainer_fgqms_1",t={actionsHeaderContainer:e};exports.actionsHeaderContainer=e;exports.default=t;
package/dist/index87.js CHANGED
@@ -1,11 +1,7 @@
1
- const e = "_refreshTooltip_v0eu8_1", r = "_refreshButton_v0eu8_5", t = "_refreshIndicator_v0eu8_9", o = {
2
- refreshTooltip: e,
3
- refreshButton: r,
4
- refreshIndicator: t
1
+ const e = "_actionsHeaderContainer_fgqms_1", a = {
2
+ actionsHeaderContainer: e
5
3
  };
6
4
  export {
7
- o as default,
8
- r as refreshButton,
9
- t as refreshIndicator,
10
- e as refreshTooltip
5
+ e as actionsHeaderContainer,
6
+ a as default
11
7
  };
package/dist/index97.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),n=require("react"),l=require("./index115.cjs"),v=({children:i,style:o,className:c})=>{const r=n.useRef(null),[u,f]=n.useState(0);return n.useEffect(()=>{const e=r.current,s=()=>{if(e){const{top:a}=e.getBoundingClientRect();f(a)}};s();const t=new ResizeObserver(s);return e&&t.observe(e),()=>{e&&t.unobserve(e),t.disconnect()}},[]),d.jsx(l.AdaptiveStyledContainer,{style:o,className:c,offset:u,ref:r,children:i})};exports.AdaptiveHeightContainer=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),n=require("react"),l=require("./index113.cjs"),v=({children:i,style:o,className:c})=>{const r=n.useRef(null),[u,f]=n.useState(0);return n.useEffect(()=>{const e=r.current,s=()=>{if(e){const{top:a}=e.getBoundingClientRect();f(a)}};s();const t=new ResizeObserver(s);return e&&t.observe(e),()=>{e&&t.unobserve(e),t.disconnect()}},[]),d.jsx(l.AdaptiveStyledContainer,{style:o,className:c,offset:u,ref:r,children:i})};exports.AdaptiveHeightContainer=v;
package/dist/index97.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
2
  import { useRef as a, useState as d, useEffect as m } from "react";
3
- import { AdaptiveStyledContainer as v } from "./index115.js";
3
+ import { AdaptiveStyledContainer as v } from "./index113.js";
4
4
  const R = ({
5
5
  children: o,
6
6
  style: s,
package/dist/index98.cjs CHANGED
@@ -1 +1,12 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("./index109.cjs"),o=e=>i.jsx(l.StyledSortableViews,{...e,onChange:t=>{t.filter(r=>{var n;return(n=r.children)==null?void 0:n.length}).length||e.onChange(t)}});exports.LegacySortableViews=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("styled-components"),t=require("@veeqo/ui"),o=e=>e&&e.__esModule?e:{default:e},r=o(i),d=r.default(t.BaseContainer)`
2
+ display: flex;
3
+ flex-direction: column;
4
+ padding: 8px;
5
+ padding-left: 35px;
6
+ margin: 8px;
7
+ background-color: ${t.theme.colors.neutral.grey.lightest};
8
+ `,l=r.default.hr`
9
+ width: 100%;
10
+ border-top: 1px solid ${t.theme.colors.neutral.grey.dark};
11
+ margin: 0 0 4px 0;
12
+ `;exports.Divider=l;exports.FixedViews=d;
package/dist/index98.js CHANGED
@@ -1,17 +1,18 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { StyledSortableViews as i } from "./index109.js";
3
- const h = (e) => /* @__PURE__ */ o(
4
- i,
5
- {
6
- ...e,
7
- onChange: (t) => {
8
- t.filter((n) => {
9
- var r;
10
- return (r = n.children) == null ? void 0 : r.length;
11
- }).length || e.onChange(t);
12
- }
13
- }
14
- );
1
+ import r from "styled-components";
2
+ import { theme as o, BaseContainer as e } from "@veeqo/ui";
3
+ const d = r(e)`
4
+ display: flex;
5
+ flex-direction: column;
6
+ padding: 8px;
7
+ padding-left: 35px;
8
+ margin: 8px;
9
+ background-color: ${o.colors.neutral.grey.lightest};
10
+ `, l = r.hr`
11
+ width: 100%;
12
+ border-top: 1px solid ${o.colors.neutral.grey.dark};
13
+ margin: 0 0 4px 0;
14
+ `;
15
15
  export {
16
- h as LegacySortableViews
16
+ l as Divider,
17
+ d as FixedViews
17
18
  };
package/dist/index99.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),f=require("swr"),R=require("./index61.cjs"),S=require("./index8.cjs"),P=require("./index62.cjs"),h=require("./index55.cjs"),m=e=>e&&e.__esModule?e:{default:e},q=m(f),E=()=>{var r;const{Filters:{queryParams:e}}=R.useStores(),{TABLE_DATA_URL:i,PAGE_NUMBER_FILTER_ID:u,PAGE_SIZE_FILTER_ID:n}=S.useBusinessLogic(),{isLoading:c}=P.useViews(),a=w.useMemo(()=>{const s=new URLSearchParams(e);return s.set(u,"1"),s.set(n,"1"),s.toString()},[e,u,n]),l=!c?`${i}?${a}`:null,{data:t,error:d,isLoading:_,mutate:L}=q.default([l,{includeMeta:!0}],([s,g])=>h.fetcherV2(s,g),{revalidateOnFocus:!1,revalidateOnReconnect:!1,keepPreviousData:!0}),o=t==null?void 0:t.meta;return{viewCounts:(r=o==null?void 0:o.page)==null?void 0:r.total_count,error:d,isLoadingViewCounts:_,mutate:L}};exports.useViewCounts=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("./index109.cjs"),o=e=>i.jsx(l.StyledSortableViews,{...e,onChange:t=>{t.filter(r=>{var n;return(n=r.children)==null?void 0:n.length}).length||e.onChange(t)}});exports.LegacySortableViews=o;
package/dist/index99.js CHANGED
@@ -1,35 +1,17 @@
1
- import { useMemo as _ } from "react";
2
- import p from "swr";
3
- import { useStores as w } from "./index61.js";
4
- import { useBusinessLogic as R } from "./index8.js";
5
- import { useViews as g } from "./index62.js";
6
- import { fetcherV2 as E } from "./index55.js";
7
- const V = () => {
8
- var i;
9
- const { Filters: { queryParams: s } } = w(), { TABLE_DATA_URL: a, PAGE_NUMBER_FILTER_ID: r, PAGE_SIZE_FILTER_ID: n } = R(), { isLoading: u } = g(), c = _(() => {
10
- const e = new URLSearchParams(s);
11
- return e.set(r, "1"), e.set(n, "1"), e.toString();
12
- }, [s, r, n]), m = !u ? `${a}?${c}` : null, {
13
- data: t,
14
- error: l,
15
- isLoading: L,
16
- mutate: d
17
- } = p(
18
- [m, { includeMeta: !0 }],
19
- ([e, f]) => E(e, f),
20
- {
21
- revalidateOnFocus: !1,
22
- revalidateOnReconnect: !1,
23
- keepPreviousData: !0
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { StyledSortableViews as i } from "./index109.js";
3
+ const h = (e) => /* @__PURE__ */ o(
4
+ i,
5
+ {
6
+ ...e,
7
+ onChange: (t) => {
8
+ t.filter((n) => {
9
+ var r;
10
+ return (r = n.children) == null ? void 0 : r.length;
11
+ }).length || e.onChange(t);
24
12
  }
25
- ), o = t == null ? void 0 : t.meta;
26
- return {
27
- viewCounts: (i = o == null ? void 0 : o.page) == null ? void 0 : i.total_count,
28
- error: l,
29
- isLoadingViewCounts: L,
30
- mutate: d
31
- };
32
- };
13
+ }
14
+ );
33
15
  export {
34
- V as useViewCounts
16
+ h as LegacySortableViews
35
17
  };
package/dist/types.d.ts CHANGED
@@ -36,7 +36,7 @@ export type Range = {
36
36
  gte: string;
37
37
  lte: string;
38
38
  };
39
- export type ViewType = 'order' | 'inventory';
39
+ export type ViewType = 'order' | 'inventory' | 'catalog';
40
40
  type UserRelationship = {
41
41
  data: {
42
42
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veeqo/transfigure",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.cjs",