@veeqo/transfigure 2.4.0 → 2.4.1

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 (99) hide show
  1. package/dist/index100.cjs +1 -1
  2. package/dist/index100.js +14 -48
  3. package/dist/index101.cjs +1 -1
  4. package/dist/index101.js +12 -29
  5. package/dist/index102.cjs +1 -1
  6. package/dist/index102.js +8 -14
  7. package/dist/index103.cjs +1 -12
  8. package/dist/index103.js +50 -16
  9. package/dist/index104.cjs +1 -1
  10. package/dist/index104.js +28 -15
  11. package/dist/index105.cjs +1 -19
  12. package/dist/index105.js +21 -24
  13. package/dist/index106.cjs +1 -1
  14. package/dist/index106.js +14 -20
  15. package/dist/index107.cjs +19 -1
  16. package/dist/index107.js +24 -24
  17. package/dist/index108.cjs +12 -1
  18. package/dist/index108.js +16 -12
  19. package/dist/index109.cjs +1 -80
  20. package/dist/index109.js +24 -98
  21. package/dist/index11.cjs +1 -1
  22. package/dist/index11.js +1 -1
  23. package/dist/index110.cjs +80 -1
  24. package/dist/index110.js +97 -8
  25. package/dist/index111.cjs +1 -1
  26. package/dist/index111.js +19 -2
  27. package/dist/index112.cjs +1 -1
  28. package/dist/index112.js +7 -18
  29. package/dist/index113.cjs +1 -1
  30. package/dist/index113.js +60 -7
  31. package/dist/index114.cjs +1 -1
  32. package/dist/index114.js +26 -57
  33. package/dist/index115.cjs +13 -1
  34. package/dist/index115.js +17 -30
  35. package/dist/index116.cjs +1 -13
  36. package/dist/index116.js +2 -17
  37. package/dist/index120.cjs +7 -1
  38. package/dist/index120.js +10 -63
  39. package/dist/index121.cjs +1 -7
  40. package/dist/index121.js +63 -10
  41. package/dist/index13.cjs +1 -1
  42. package/dist/index13.js +1 -1
  43. package/dist/index19.cjs +1 -1
  44. package/dist/index19.js +1 -1
  45. package/dist/index22.cjs +1 -1
  46. package/dist/index22.js +1 -1
  47. package/dist/index30.cjs +1 -1
  48. package/dist/index30.js +1 -1
  49. package/dist/index34.cjs +1 -1
  50. package/dist/index34.js +1 -1
  51. package/dist/index36.cjs +1 -1
  52. package/dist/index36.js +2 -2
  53. package/dist/index39.cjs +1 -1
  54. package/dist/index39.js +1 -1
  55. package/dist/index40.cjs +1 -1
  56. package/dist/index40.js +1 -1
  57. package/dist/index41.cjs +1 -1
  58. package/dist/index41.js +1 -1
  59. package/dist/index42.cjs +1 -1
  60. package/dist/index42.js +1 -1
  61. package/dist/index44.cjs +1 -1
  62. package/dist/index44.js +1 -1
  63. package/dist/index46.cjs +1 -1
  64. package/dist/index46.js +1 -1
  65. package/dist/index47.cjs +1 -1
  66. package/dist/index47.js +2 -2
  67. package/dist/index57.cjs +1 -1
  68. package/dist/index57.js +1 -1
  69. package/dist/index65.cjs +1 -1
  70. package/dist/index65.js +1 -1
  71. package/dist/index69.cjs +1 -1
  72. package/dist/index69.js +1 -1
  73. package/dist/index70.cjs +1 -1
  74. package/dist/index70.js +2 -2
  75. package/dist/index73.cjs +1 -1
  76. package/dist/index73.js +7 -7
  77. package/dist/index80.cjs +1 -1
  78. package/dist/index80.js +1 -1
  79. package/dist/index82.cjs +1 -1
  80. package/dist/index82.js +1 -1
  81. package/dist/index86.cjs +1 -1
  82. package/dist/index86.js +1 -1
  83. package/dist/index87.cjs +1 -1
  84. package/dist/index87.js +1 -1
  85. package/dist/index88.cjs +1 -1
  86. package/dist/index88.js +5 -41
  87. package/dist/index89.cjs +1 -1
  88. package/dist/index89.js +2 -9
  89. package/dist/index90.cjs +1 -1
  90. package/dist/index90.js +39 -115
  91. package/dist/index91.cjs +1 -1
  92. package/dist/index91.js +9 -2
  93. package/dist/index92.cjs +1 -1
  94. package/dist/index92.js +116 -4
  95. package/dist/index93.cjs +1 -1
  96. package/dist/index93.js +2 -2
  97. package/dist/index95.cjs +1 -1
  98. package/dist/index95.js +2 -2
  99. package/package.json +1 -1
package/dist/index116.js CHANGED
@@ -1,19 +1,4 @@
1
- import { VeeqoUI as e } from "@veeqo/components";
2
- import { theme as o } from "@veeqo/ui";
3
- import t from "styled-components";
4
- const { SortableViews: r } = e, p = t(r)`
5
- .rst__rowTitle {
6
- span {
7
- white-space: nowrap;
8
- overflow: hidden;
9
- text-overflow: ellipsis;
10
- }
11
- }
12
-
13
- .rst__rowTitle > div:first-child {
14
- gap: ${o.sizes.sm};
15
- }
16
- `;
1
+ const o = (r) => r instanceof Error;
17
2
  export {
18
- p as StyledSortableViews
3
+ o as isError
19
4
  };
package/dist/index120.cjs CHANGED
@@ -1 +1,7 @@
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("./index118.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 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/index120.js CHANGED
@@ -1,65 +1,12 @@
1
- import { jsxs as b, jsx as a } from "react/jsx-runtime";
2
- import { observer as N } from "mobx-react";
3
- import { Stack as h, TextField as u } from "@veeqo/ui";
4
- import { MUISlider as L } from "./index118.js";
5
- const j = N(
6
- ({ data: g, editedValue: t, setEditedValue: l }) => {
7
- var f;
8
- if (!((f = g.options) != null && f.length)) return null;
9
- const [i, x] = g.options, s = Number(i.value), c = Number(x.value), p = (e, n) => {
10
- if (!Array.isArray(n) || n.length !== 2 || !t) return;
11
- const [r, y] = n, m = t == null ? void 0 : t.clone();
12
- m.setGte(r), m.setLte(y), l(m);
13
- }, o = {
14
- gte: (t == null ? void 0 : t.gte) || 0,
15
- lte: (t == null ? void 0 : t.lte) || 100
16
- }, M = (e) => {
17
- if (!t) return;
18
- const n = t.clone(), r = Number(e);
19
- r > n.lteMax || (r >= n.gteMin && r <= n.lteMax && n.setGte(r), (!n.lte || r >= n.lte) && n.setLte(n.lteMax), l(n));
20
- }, v = (e) => {
21
- if (!t) return;
22
- const n = t.clone(), r = Number(e);
23
- r < n.gteMin || (r >= n.gteMin && r <= n.lteMax && n.setLte(r), (!n.gte || r <= n.gte) && n.setGte(n.gteMin), l(n));
24
- }, C = [o.gte, o.lte];
25
- return /* @__PURE__ */ b(h, { spacing: "xs", alignX: "stretch", children: [
26
- /* @__PURE__ */ b(h, { direction: "horizontal", children: [
27
- /* @__PURE__ */ a(
28
- u,
29
- {
30
- label: i.label,
31
- type: "number",
32
- min: s,
33
- max: c,
34
- value: o.gte.toString(),
35
- onChange: M
36
- }
37
- ),
38
- /* @__PURE__ */ a(
39
- u,
40
- {
41
- label: x.label,
42
- type: "number",
43
- min: s,
44
- max: c,
45
- value: o.lte.toString(),
46
- onChange: v
47
- }
48
- )
49
- ] }),
50
- /* @__PURE__ */ a(
51
- L,
52
- {
53
- value: C,
54
- onChange: p,
55
- min: s,
56
- max: c,
57
- valueLabelDisplay: "auto"
58
- }
59
- )
60
- ] });
61
- }
62
- );
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
+ `;
63
10
  export {
64
- j as FilterNumberRangeFilter
11
+ h as AdaptiveStyledContainer
65
12
  };
package/dist/index121.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 r=require("react/jsx-runtime"),p=require("mobx-react"),l=require("@veeqo/ui"),v=require("./index118.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/index121.js CHANGED
@@ -1,12 +1,65 @@
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 b, jsx as a } from "react/jsx-runtime";
2
+ import { observer as N } from "mobx-react";
3
+ import { Stack as h, TextField as u } from "@veeqo/ui";
4
+ import { MUISlider as L } from "./index118.js";
5
+ const j = N(
6
+ ({ data: g, editedValue: t, setEditedValue: l }) => {
7
+ var f;
8
+ if (!((f = g.options) != null && f.length)) return null;
9
+ const [i, x] = g.options, s = Number(i.value), c = Number(x.value), p = (e, n) => {
10
+ if (!Array.isArray(n) || n.length !== 2 || !t) return;
11
+ const [r, y] = n, m = t == null ? void 0 : t.clone();
12
+ m.setGte(r), m.setLte(y), l(m);
13
+ }, o = {
14
+ gte: (t == null ? void 0 : t.gte) || 0,
15
+ lte: (t == null ? void 0 : t.lte) || 100
16
+ }, M = (e) => {
17
+ if (!t) return;
18
+ const n = t.clone(), r = Number(e);
19
+ r > n.lteMax || (r >= n.gteMin && r <= n.lteMax && n.setGte(r), (!n.lte || r >= n.lte) && n.setLte(n.lteMax), l(n));
20
+ }, v = (e) => {
21
+ if (!t) return;
22
+ const n = t.clone(), r = Number(e);
23
+ r < n.gteMin || (r >= n.gteMin && r <= n.lteMax && n.setLte(r), (!n.gte || r <= n.gte) && n.setGte(n.gteMin), l(n));
24
+ }, C = [o.gte, o.lte];
25
+ return /* @__PURE__ */ b(h, { spacing: "xs", alignX: "stretch", children: [
26
+ /* @__PURE__ */ b(h, { direction: "horizontal", children: [
27
+ /* @__PURE__ */ a(
28
+ u,
29
+ {
30
+ label: i.label,
31
+ type: "number",
32
+ min: s,
33
+ max: c,
34
+ value: o.gte.toString(),
35
+ onChange: M
36
+ }
37
+ ),
38
+ /* @__PURE__ */ a(
39
+ u,
40
+ {
41
+ label: x.label,
42
+ type: "number",
43
+ min: s,
44
+ max: c,
45
+ value: o.lte.toString(),
46
+ onChange: v
47
+ }
48
+ )
49
+ ] }),
50
+ /* @__PURE__ */ a(
51
+ L,
52
+ {
53
+ value: C,
54
+ onChange: p,
55
+ min: s,
56
+ max: c,
57
+ valueLabelDisplay: "auto"
58
+ }
59
+ )
60
+ ] });
61
+ }
62
+ );
10
63
  export {
11
- h as AdaptiveStyledContainer
64
+ j as FilterNumberRangeFilter
12
65
  };
package/dist/index13.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),_=require("mobx-react"),f=require("@veeqo/ui"),b=require("lodash/debounce"),o=require("react"),q=require("./index91.cjs"),x=require("./index8.cjs"),g=require("./index63.cjs"),h=e=>e&&e.__esModule?e:{default:e},E=h(b),F=_.observer(({onChange:e,capture:R,...c})=>{const{SEARCH_FILTER_ID:s,FILTERS_DEBOUNCE_INTERVAL_MS:i}=x.useBusinessLogic(),{Filters:{setFilter:r,filters:n}}=g.useStores(),[a,l]=o.useState(n.get(s)||""),d=o.useCallback(E.default(t=>{r(s,t)},i),[r,s]),S=t=>{l(t),q.isTextFilterValid(t)&&d(t),e&&e(t)};return u.jsx("div",{style:{flexGrow:1},children:u.jsx(f.Search,{value:a,onChange:S,...c})})});exports.SearchBar=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),_=require("mobx-react"),f=require("@veeqo/ui"),b=require("lodash/debounce"),o=require("react"),q=require("./index89.cjs"),x=require("./index8.cjs"),g=require("./index63.cjs"),h=e=>e&&e.__esModule?e:{default:e},E=h(b),F=_.observer(({onChange:e,capture:R,...c})=>{const{SEARCH_FILTER_ID:s,FILTERS_DEBOUNCE_INTERVAL_MS:i}=x.useBusinessLogic(),{Filters:{setFilter:r,filters:n}}=g.useStores(),[a,l]=o.useState(n.get(s)||""),d=o.useCallback(E.default(t=>{r(s,t)},i),[r,s]),S=t=>{l(t),q.isTextFilterValid(t)&&d(t),e&&e(t)};return u.jsx("div",{style:{flexGrow:1},children:u.jsx(f.Search,{value:a,onChange:S,...c})})});exports.SearchBar=F;
package/dist/index13.js CHANGED
@@ -3,7 +3,7 @@ import { observer as f } from "mobx-react";
3
3
  import { Search as u } from "@veeqo/ui";
4
4
  import p from "lodash/debounce";
5
5
  import { useState as S, useCallback as d } from "react";
6
- import { isTextFilterValid as h } from "./index91.js";
6
+ import { isTextFilterValid as h } from "./index89.js";
7
7
  import { useBusinessLogic as E } from "./index8.js";
8
8
  import { useStores as C } from "./index63.js";
9
9
  const v = f(({ onChange: o, capture: F, ...s }) => {
package/dist/index19.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("react"),v=require("mobx-react"),x=require("@veeqo/ui"),T=require("./index91.cjs"),l=require("./index50.cjs"),V=require("./index119.cjs"),g=require("./index63.cjs"),j=require("./index61.cjs"),R=require("./index24.cjs"),y=require("./index18.cjs"),C=require("./index25.cjs"),f=v.observer(({filterData:e})=>{const{Filters:{filters:o,clearFilter:F,setFilter:a}}=g.useStores(),r=o.get(e.id),{filterLabel:q}=j.useFilterLabel({filterData:e}),[i,c]=s.useState(r||""),[n,b]=s.useState("");s.useEffect(()=>{i!==r&&c(r||"")},[e.id,r,o]);const A=()=>{F(e.id)},E=()=>{n||a(e.id,i)},S=u=>{let d="";(e.filterType===l.FilterChoiceValue.TEXT||e.filterType===l.FilterChoiceValue.NUMBER)&&(d=T.isTextFilterValid(String(u))?"":l.MIN_SEARCH_ERROR_MESSAGE),c(u),b(d)};return t.jsx(x.FilterTag,{shouldCloseOnClickAway:!0,header:t.jsx(C.ActiveFilterHeader,{filterLabel:e.label,icon:e.icon}),label:e.label,text:q||"Loading...",content:t.jsx("div",{className:V.default.fieldContainer,children:t.jsx(y.FilterField,{data:e,editedValue:i,setEditedValue:S,error:n})}),footer:t.jsx(R.ActiveFilterFooter,{clearActiveFilter:A,applyActiveFilter:E})})});exports.ActiveFilterTag=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("react"),v=require("mobx-react"),x=require("@veeqo/ui"),T=require("./index89.cjs"),l=require("./index50.cjs"),V=require("./index119.cjs"),g=require("./index63.cjs"),j=require("./index61.cjs"),R=require("./index24.cjs"),y=require("./index18.cjs"),C=require("./index25.cjs"),f=v.observer(({filterData:e})=>{const{Filters:{filters:o,clearFilter:F,setFilter:a}}=g.useStores(),r=o.get(e.id),{filterLabel:q}=j.useFilterLabel({filterData:e}),[i,c]=s.useState(r||""),[n,b]=s.useState("");s.useEffect(()=>{i!==r&&c(r||"")},[e.id,r,o]);const A=()=>{F(e.id)},E=()=>{n||a(e.id,i)},S=u=>{let d="";(e.filterType===l.FilterChoiceValue.TEXT||e.filterType===l.FilterChoiceValue.NUMBER)&&(d=T.isTextFilterValid(String(u))?"":l.MIN_SEARCH_ERROR_MESSAGE),c(u),b(d)};return t.jsx(x.FilterTag,{shouldCloseOnClickAway:!0,header:t.jsx(C.ActiveFilterHeader,{filterLabel:e.label,icon:e.icon}),label:e.label,text:q||"Loading...",content:t.jsx("div",{className:V.default.fieldContainer,children:t.jsx(y.FilterField,{data:e,editedValue:i,setEditedValue:S,error:n})}),footer:t.jsx(R.ActiveFilterFooter,{clearActiveFilter:A,applyActiveFilter:E})})});exports.ActiveFilterTag=f;
package/dist/index19.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as r } from "react/jsx-runtime";
2
2
  import { useState as n, useEffect as b } from "react";
3
3
  import { observer as S } from "mobx-react";
4
4
  import { FilterTag as T } from "@veeqo/ui";
5
- import { isTextFilterValid as V } from "./index91.js";
5
+ import { isTextFilterValid as V } from "./index89.js";
6
6
  import { FilterChoiceValue as d, MIN_SEARCH_ERROR_MESSAGE as v } from "./index50.js";
7
7
  import g from "./index119.js";
8
8
  import { useStores as y } from "./index63.js";
package/dist/index22.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("react"),d=require("mobx-react"),l=require("@veeqo/ui"),m=require("./index71.cjs"),R=require("./index120.cjs"),v=require("./index63.cjs"),N=require("./index24.cjs"),q=require("./index25.cjs"),A=d.observer(({filterData:t})=>{const{Filters:{numberRangeFilters:u,clearNumberRangeFilter:a,setNumberRangeFilter:F}}=v.useStores(),e=u.get(t.id),[n,c]=s.useState(e),o=s.useCallback(()=>{const r=new m.NumberRangeFilter({filterId:t.id});return e&&(e.gte&&r.setGte(e.gte),e.lte&&r.setLte(e.lte)),r},[t.id,e]);s.useEffect(()=>{const r=o();c(r)},[o,e]);const g=()=>{a(t.id)},b=()=>{!e||!n||F({numberRange:e,lte:n.lte,gte:n.gte})};return i.jsx(l.FilterTag,{shouldCloseOnClickAway:!0,header:i.jsx(q.ActiveFilterHeader,{filterLabel:t.label,icon:t.icon}),label:t.label,text:(e==null?void 0:e.filterLabel)||"Loading...",content:i.jsx(l.BaseContainer,{style:{padding:l.theme.sizes.md},children:i.jsx(R.FilterNumberRangeFilter,{data:t,editedValue:n,setEditedValue:c})}),footer:i.jsx(N.ActiveFilterFooter,{clearActiveFilter:g,applyActiveFilter:b})})});exports.ActiveFilterNumberRangeTag=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("react"),d=require("mobx-react"),l=require("@veeqo/ui"),m=require("./index71.cjs"),R=require("./index121.cjs"),v=require("./index63.cjs"),N=require("./index24.cjs"),q=require("./index25.cjs"),A=d.observer(({filterData:t})=>{const{Filters:{numberRangeFilters:u,clearNumberRangeFilter:a,setNumberRangeFilter:F}}=v.useStores(),e=u.get(t.id),[n,c]=s.useState(e),o=s.useCallback(()=>{const r=new m.NumberRangeFilter({filterId:t.id});return e&&(e.gte&&r.setGte(e.gte),e.lte&&r.setLte(e.lte)),r},[t.id,e]);s.useEffect(()=>{const r=o();c(r)},[o,e]);const g=()=>{a(t.id)},b=()=>{!e||!n||F({numberRange:e,lte:n.lte,gte:n.gte})};return i.jsx(l.FilterTag,{shouldCloseOnClickAway:!0,header:i.jsx(q.ActiveFilterHeader,{filterLabel:t.label,icon:t.icon}),label:t.label,text:(e==null?void 0:e.filterLabel)||"Loading...",content:i.jsx(l.BaseContainer,{style:{padding:l.theme.sizes.md},children:i.jsx(R.FilterNumberRangeFilter,{data:t,editedValue:n,setEditedValue:c})}),footer:i.jsx(N.ActiveFilterFooter,{clearActiveFilter:g,applyActiveFilter:b})})});exports.ActiveFilterNumberRangeTag=A;
package/dist/index22.js CHANGED
@@ -3,7 +3,7 @@ import { useState as d, useCallback as g, useEffect as F } from "react";
3
3
  import { observer as b } from "mobx-react";
4
4
  import { FilterTag as p, BaseContainer as f, theme as R } from "@veeqo/ui";
5
5
  import { NumberRangeFilter as N } from "./index71.js";
6
- import { FilterNumberRangeFilter as v } from "./index120.js";
6
+ import { FilterNumberRangeFilter as v } from "./index121.js";
7
7
  import { useStores as A } from "./index63.js";
8
8
  import { ActiveFilterFooter as w } from "./index24.js";
9
9
  import { ActiveFilterHeader as h } from "./index25.js";
package/dist/index30.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),g=require("mobx-react"),u=require("@veeqo/ui"),h=require("lodash/debounce"),n=require("./index50.cjs"),j=require("./index91.cjs"),m=require("./index8.cjs"),y=require("./index63.cjs"),k=r=>r&&r.__esModule?r:{default:r},B=k(h),v=g.observer(({fields:r,groupId:c})=>{const{FILTERS_DEBOUNCE_INTERVAL_MS:S}=m.useBusinessLogic(),{Filters:{getFiltersForGroup:p,setFilter:a,clearFiltersForGroup:V}}=y.useStores(),_=p(c),[d,F]=o.useState(_),[E,x]=o.useState({}),C=o.useCallback(B.default((e,t)=>{a(e,t)},S),[a]),q=(e,t)=>{const s={...d,[e]:t},i={...E},T=Object.entries(s).every(([b,M])=>j.isTextFilterValid(String(M))?(i[b]="",!0):(i[b]=n.MIN_SEARCH_ERROR_MESSAGE,!1));F(s),x(i),T&&C(e,t)},R=()=>{const e=r.reduce((t,s)=>({...t,[s.id]:""}),{});F(e),V(c)};return l.jsxs(u.FlexCol,{children:[l.jsx(u.Button,{variant:"link",onClick:R,children:"Clear"}),r.map(e=>{let t;switch(e.filterType){case n.FilterChoiceValue.NUMBER:t="number";break;case n.FilterChoiceValue.TEXT:t="text";break}return l.jsx(u.TextField,{type:t,value:d[e.id],error:E[e.id],label:e.label,onChange:s=>q(e.id,s)},e.id)})]})});exports.MultipleFieldFilter=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),o=require("react"),g=require("mobx-react"),u=require("@veeqo/ui"),h=require("lodash/debounce"),n=require("./index50.cjs"),j=require("./index89.cjs"),m=require("./index8.cjs"),y=require("./index63.cjs"),k=r=>r&&r.__esModule?r:{default:r},B=k(h),v=g.observer(({fields:r,groupId:c})=>{const{FILTERS_DEBOUNCE_INTERVAL_MS:S}=m.useBusinessLogic(),{Filters:{getFiltersForGroup:p,setFilter:a,clearFiltersForGroup:V}}=y.useStores(),_=p(c),[d,F]=o.useState(_),[E,x]=o.useState({}),C=o.useCallback(B.default((e,t)=>{a(e,t)},S),[a]),q=(e,t)=>{const s={...d,[e]:t},i={...E},T=Object.entries(s).every(([b,M])=>j.isTextFilterValid(String(M))?(i[b]="",!0):(i[b]=n.MIN_SEARCH_ERROR_MESSAGE,!1));F(s),x(i),T&&C(e,t)},R=()=>{const e=r.reduce((t,s)=>({...t,[s.id]:""}),{});F(e),V(c)};return l.jsxs(u.FlexCol,{children:[l.jsx(u.Button,{variant:"link",onClick:R,children:"Clear"}),r.map(e=>{let t;switch(e.filterType){case n.FilterChoiceValue.NUMBER:t="number";break;case n.FilterChoiceValue.TEXT:t="text";break}return l.jsx(u.TextField,{type:t,value:d[e.id],error:E[e.id],label:e.label,onChange:s=>q(e.id,s)},e.id)})]})});exports.MultipleFieldFilter=v;
package/dist/index30.js CHANGED
@@ -4,7 +4,7 @@ import { observer as _ } from "mobx-react";
4
4
  import { FlexCol as k, Button as M, TextField as g } from "@veeqo/ui";
5
5
  import y from "lodash/debounce";
6
6
  import { FilterChoiceValue as F, MIN_SEARCH_ERROR_MESSAGE as B } from "./index50.js";
7
- import { isTextFilterValid as G } from "./index91.js";
7
+ import { isTextFilterValid as G } from "./index89.js";
8
8
  import { useBusinessLogic as N } from "./index8.js";
9
9
  import { useStores as j } from "./index63.js";
10
10
  const q = _(({ fields: s, groupId: 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("./index107.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("./index109.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 "./index107.js";
5
+ import { AdaptiveHeightContainer as p } from "./index109.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"),l=require("@veeqo/ui"),U=require("mobx-react"),z=require("./index67.cjs"),G=require("./index64.cjs"),J=require("./index40.cjs"),K=require("./index43.cjs"),Q=require("./index57.cjs"),X=require("./index100.cjs"),Z=require("./index8.cjs"),$=require("./index63.cjs"),b=require("./index101.cjs"),ee=U.observer(({view:e})=>{const{VIEW_TYPE:L,IS_VIEWS_READONLY:r,SEARCH_FILTER_ID:d}=Z.useBusinessLogic(),{Filters:{activeViewId:w,initFiltersFromView:f,discardChanges:m,initFromUrl:V,filters:T,setFilter:y},Views:{draftViewsMap:h},Notifications:{notify:E}}=$.useStores(),{viewsMap:g,defaultCustomViewId:F,isLoading:N}=G.useViews(),{isLoading:j}=z.useCustomViews({type:L}),{viewCounts:M,isLoadingViewCounts:R}=X.useViewCounts(e.id),[t,P]=c.useState(null),k=s=>{const x=T.get(d);if(g.has(s)){const n=g.get(s);n&&(f(n),m(!0),V())}else{const n=h.get(s);n?(f(n),m(!0),V()):E({type:"error",text:"Failed to load view"})}x&&y(d,x)},u=(e==null?void 0:e.id)===w,o=h.has(e.id),p=!o,A=M,a=(e==null?void 0:e.label)||"",I=N||j,C=c.useRef(!1);!I&&!C.current&&u&&e.id===F&&t&&(C.current=!0,t&&w===e.id&&window.requestAnimationFrame(()=>{var s;(s=t.parentElement)==null||s.scrollBy({behavior:"smooth",left:t.offsetLeft})}));const D=c.useMemo(()=>o?"draft":e.editable?"saved":"fixed",[o,e.editable]),{actions:{create:{handleSaveDraft:_},menu:{toggleDropdown:v},delete:{closeDeleteConfirmation:B,handleDelete:O,handleDeleteDraftView:S}},state:{shouldShowDeleteConfirmation:H},actions:W,state:q}=Q.useDropdownManager(e),Y=c.useMemo(()=>{if(!r){if(p)return v;if(o)return S}},[S,o,p,v,r]);return i.jsxs(i.Fragment,{children:[i.jsx(l.ViewTab,{customTextColour:e.customTextColour,colourPalette:e.colourPalette,className:"act-react-listing-custom-view",active:u,id:e==null?void 0:e.id,name:a,type:r?void 0:D,count:R?i.jsx(l.Loader,{type:"ThreeDots",width:12,height:12,color:u?"#fff":l.theme.colors.neutral.ink.dark}):A,onClick:k,subAction:Y,ariaContext:"orders",ref:P,"aria-controls":"options-dropdown","aria-expanded":q.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx(b.Confirmation,{shouldShow:H,viewName:a,onCancel:B,onDelete:O}),i.jsx(J.PillNotifications,{tabType:D,isActive:u,initialViewName:a,shouldShowCreateViewNotification:o,handleSaveDraft:_}),!r&&i.jsx(K.ViewDropdowns,{referenceElement:t,tab:e,...W,...q})]})});exports.ViewTab=ee;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),l=require("@veeqo/ui"),U=require("mobx-react"),z=require("./index67.cjs"),G=require("./index64.cjs"),J=require("./index40.cjs"),K=require("./index43.cjs"),Q=require("./index57.cjs"),X=require("./index103.cjs"),Z=require("./index8.cjs"),$=require("./index63.cjs"),b=require("./index104.cjs"),ee=U.observer(({view:e})=>{const{VIEW_TYPE:L,IS_VIEWS_READONLY:r,SEARCH_FILTER_ID:d}=Z.useBusinessLogic(),{Filters:{activeViewId:w,initFiltersFromView:f,discardChanges:m,initFromUrl:V,filters:T,setFilter:y},Views:{draftViewsMap:h},Notifications:{notify:E}}=$.useStores(),{viewsMap:g,defaultCustomViewId:F,isLoading:N}=G.useViews(),{isLoading:j}=z.useCustomViews({type:L}),{viewCounts:M,isLoadingViewCounts:R}=X.useViewCounts(e.id),[t,P]=c.useState(null),k=s=>{const x=T.get(d);if(g.has(s)){const n=g.get(s);n&&(f(n),m(!0),V())}else{const n=h.get(s);n?(f(n),m(!0),V()):E({type:"error",text:"Failed to load view"})}x&&y(d,x)},u=(e==null?void 0:e.id)===w,o=h.has(e.id),p=!o,A=M,a=(e==null?void 0:e.label)||"",I=N||j,C=c.useRef(!1);!I&&!C.current&&u&&e.id===F&&t&&(C.current=!0,t&&w===e.id&&window.requestAnimationFrame(()=>{var s;(s=t.parentElement)==null||s.scrollBy({behavior:"smooth",left:t.offsetLeft})}));const D=c.useMemo(()=>o?"draft":e.editable?"saved":"fixed",[o,e.editable]),{actions:{create:{handleSaveDraft:_},menu:{toggleDropdown:v},delete:{closeDeleteConfirmation:B,handleDelete:O,handleDeleteDraftView:S}},state:{shouldShowDeleteConfirmation:H},actions:W,state:q}=Q.useDropdownManager(e),Y=c.useMemo(()=>{if(!r){if(p)return v;if(o)return S}},[S,o,p,v,r]);return i.jsxs(i.Fragment,{children:[i.jsx(l.ViewTab,{customTextColour:e.customTextColour,colourPalette:e.colourPalette,className:"act-react-listing-custom-view",active:u,id:e==null?void 0:e.id,name:a,type:r?void 0:D,count:R?i.jsx(l.Loader,{type:"ThreeDots",width:12,height:12,color:u?"#fff":l.theme.colors.neutral.ink.dark}):A,onClick:k,subAction:Y,ariaContext:"orders",ref:P,"aria-controls":"options-dropdown","aria-expanded":q.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx(b.Confirmation,{shouldShow:H,viewName:a,onCancel:B,onDelete:O}),i.jsx(J.PillNotifications,{tabType:D,isActive:u,initialViewName:a,shouldShowCreateViewNotification:o,handleSaveDraft:_}),!r&&i.jsx(K.ViewDropdowns,{referenceElement:t,tab:e,...W,...q})]})});exports.ViewTab=ee;
package/dist/index36.js CHANGED
@@ -7,10 +7,10 @@ import { useViews as Z } from "./index64.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 "./index57.js";
10
- import { useViewCounts as ie } from "./index100.js";
10
+ import { useViewCounts as ie } from "./index103.js";
11
11
  import { useBusinessLogic as te } from "./index8.js";
12
12
  import { useStores as re } from "./index63.js";
13
- import { Confirmation as se } from "./index101.js";
13
+ import { Confirmation as se } from "./index104.js";
14
14
  const Ce = Q(({ view: e }) => {
15
15
  const { VIEW_TYPE: T, IS_VIEWS_READONLY: n, SEARCH_FILTER_ID: c } = te(), {
16
16
  Filters: { activeViewId: d, initFiltersFromView: f, discardChanges: m, initFromUrl: u, filters: x, setFilter: E },
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("./index105.cjs"),g=require("./index53.cjs"),j=require("./index52.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("./index107.cjs"),g=require("./index53.cjs"),j=require("./index52.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 "./index105.js";
2
+ import { MenuItems as M, Item as l, Divider as h } from "./index107.js";
3
3
  import { useModal as k } from "./index53.js";
4
4
  import { ModalId as T } from "./index52.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("./index64.cjs"),o=require("framer-motion"),m=require("./index63.cjs"),v=require("./index106.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("./index64.cjs"),o=require("framer-motion"),m=require("./index63.cjs"),v=require("./index105.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 "./index64.js";
4
4
  import { AnimatePresence as n } from "framer-motion";
5
5
  import { useStores as g } from "./index63.js";
6
- import { DraftPill as w } from "./index106.js";
6
+ import { DraftPill as w } from "./index105.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("./index102.cjs"),g=require("./index67.cjs"),S=require("./index64.cjs"),b=require("./index4.cjs"),y=require("./index8.cjs"),V=require("./index63.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("./index106.cjs"),g=require("./index67.cjs"),S=require("./index64.cjs"),b=require("./index4.cjs"),y=require("./index8.cjs"),V=require("./index63.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 "./index102.js";
3
+ import { LegacySortableViews as w } from "./index106.js";
4
4
  import { useCustomViews as d } from "./index67.js";
5
5
  import { useViews as g } from "./index64.js";
6
6
  import { patchCurrentUser as _ } from "./index4.js";
package/dist/index42.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@veeqo/ui"),c=require("mobx-react"),l=require("./index62.cjs"),n=require("./index109.cjs"),d=i.theme.colors.secondary.blue.base,h=c.observer(({onDiscard:r,viewName:s,onSaveDraft:a})=>{const{saveChanges:o,isSubmitting:t}=l.usePersistUnsavedChanges();return e.jsx(n.Notification,{children:e.jsx(n.Container,{children:e.jsxs(i.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(i.AttentionIcon,{role:"img","aria-label":"attention",color:d}),e.jsxs(n.Wrap,{children:[e.jsx(n.Text,{variant:"body",margin:"0 4px 0 0",children:"You have unsaved changes to"}),s&&e.jsxs(n.Bold,{variant:"bodyBoldDark",children:["'",s,"'"]})]}),e.jsx(i.Button,{onClick:r,size:"sm",children:"Discard changes"}),e.jsxs(i.ActionMenu,{ctaProps:{children:"Save changes",variant:"primary"},children:[e.jsx(i.ActionMenu.Item,{onAction:a,isDisabled:t,children:e.jsx(n.Text,{variant:"body",children:"Create new view"})}),e.jsx(i.ActionMenu.Item,{onAction:o,isDisabled:t,children:e.jsxs(i.Stack,{direction:"horizontal",spacing:1,alignY:"center",children:[e.jsx(n.Text,{variant:"body",children:"Save changes to"}),e.jsx(n.Text,{variant:"bodyBold",children:s})]})})]})]})})})});exports.UnsavedChangesPill=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@veeqo/ui"),c=require("mobx-react"),l=require("./index62.cjs"),n=require("./index110.cjs"),d=i.theme.colors.secondary.blue.base,h=c.observer(({onDiscard:r,viewName:s,onSaveDraft:a})=>{const{saveChanges:o,isSubmitting:t}=l.usePersistUnsavedChanges();return e.jsx(n.Notification,{children:e.jsx(n.Container,{children:e.jsxs(i.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(i.AttentionIcon,{role:"img","aria-label":"attention",color:d}),e.jsxs(n.Wrap,{children:[e.jsx(n.Text,{variant:"body",margin:"0 4px 0 0",children:"You have unsaved changes to"}),s&&e.jsxs(n.Bold,{variant:"bodyBoldDark",children:["'",s,"'"]})]}),e.jsx(i.Button,{onClick:r,size:"sm",children:"Discard changes"}),e.jsxs(i.ActionMenu,{ctaProps:{children:"Save changes",variant:"primary"},children:[e.jsx(i.ActionMenu.Item,{onAction:a,isDisabled:t,children:e.jsx(n.Text,{variant:"body",children:"Create new view"})}),e.jsx(i.ActionMenu.Item,{onAction:o,isDisabled:t,children:e.jsxs(i.Stack,{direction:"horizontal",spacing:1,alignY:"center",children:[e.jsx(n.Text,{variant:"body",children:"Save changes to"}),e.jsx(n.Text,{variant:"bodyBold",children:s})]})})]})]})})})});exports.UnsavedChangesPill=h;
package/dist/index42.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as n, jsxs as e } from "react/jsx-runtime";
2
2
  import { Stack as a, AttentionIcon as d, theme as h, Button as m, ActionMenu as o } from "@veeqo/ui";
3
3
  import { observer as g } from "mobx-react";
4
4
  import { usePersistUnsavedChanges as v } from "./index62.js";
5
- import { Notification as b, Container as p, Wrap as u, Text as i, Bold as y } from "./index109.js";
5
+ import { Notification as b, Container as p, Wrap as u, Text as i, Bold as y } from "./index110.js";
6
6
  const C = h.colors.secondary.blue.base, S = g(({ onDiscard: c, viewName: r, onSaveDraft: l }) => {
7
7
  const { saveChanges: s, isSubmitting: t } = v();
8
8
  return /* @__PURE__ */ n(b, { children: /* @__PURE__ */ n(p, { children: /* @__PURE__ */ e(a, { direction: "horizontal", alignY: "center", children: [
package/dist/index44.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),m=require("mobx-react"),i=require("@veeqo/ui"),u=require("./index103.cjs"),q=require("./index41.cjs"),f=require("./index64.cjs"),p=require("./index65.cjs"),v=require("./index37.cjs"),c=require("./index36.cjs"),b=require("./index8.cjs"),C=require("./index63.cjs"),a=require("./index12.cjs"),L=m.observer(({className:l,appearance:d})=>{const{IS_VIEWS_READONLY:r}=b.useBusinessLogic(),{Views:{draftViewsList:w}}=C.useStores(),{viewsArray:x,fixedViews:V}=f.useViews(),[n,o]=t.useState(!1),[h,j]=t.useState(null),S=()=>o(!1);return p.useViewUrlChange(),e.jsxs(e.Fragment,{children:[e.jsxs(i.ViewsContainer,{onClickMenu:r?void 0:()=>o(!0),ariaMenuControls:r?void 0:"views-menu",ariaMenuExpanded:r?!1:n,ref:j,className:l,appearance:d,children:[x.map(s=>e.jsx(a.ErrorBoundary,{children:e.jsx(c.ViewTab,{view:s})},s.id)),w.map(s=>e.jsx(a.ErrorBoundary,{children:e.jsx(c.ViewTab,{view:s})},s.id))]}),!r&&n&&e.jsx(i.Popover,{id:"views-menu",anchorElement:h,placement:"bottom",onShouldClose:()=>o(!1),children:e.jsxs(i.Card.Surface,{children:[e.jsx(u.FixedViews,{children:V.map(s=>e.jsx(i.Text,{variant:"placeholder",children:s.label},s.id||s.label))}),e.jsx(q.SortableViews,{}),e.jsx(u.Divider,{}),e.jsx(v.CreateView,{hideActionsPopover:S})]})})]})});exports.ViewsList=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),m=require("mobx-react"),i=require("@veeqo/ui"),u=require("./index108.cjs"),q=require("./index41.cjs"),f=require("./index64.cjs"),p=require("./index65.cjs"),v=require("./index37.cjs"),c=require("./index36.cjs"),b=require("./index8.cjs"),C=require("./index63.cjs"),a=require("./index12.cjs"),L=m.observer(({className:l,appearance:d})=>{const{IS_VIEWS_READONLY:r}=b.useBusinessLogic(),{Views:{draftViewsList:w}}=C.useStores(),{viewsArray:x,fixedViews:V}=f.useViews(),[n,o]=t.useState(!1),[h,j]=t.useState(null),S=()=>o(!1);return p.useViewUrlChange(),e.jsxs(e.Fragment,{children:[e.jsxs(i.ViewsContainer,{onClickMenu:r?void 0:()=>o(!0),ariaMenuControls:r?void 0:"views-menu",ariaMenuExpanded:r?!1:n,ref:j,className:l,appearance:d,children:[x.map(s=>e.jsx(a.ErrorBoundary,{children:e.jsx(c.ViewTab,{view:s})},s.id)),w.map(s=>e.jsx(a.ErrorBoundary,{children:e.jsx(c.ViewTab,{view:s})},s.id))]}),!r&&n&&e.jsx(i.Popover,{id:"views-menu",anchorElement:h,placement:"bottom",onShouldClose:()=>o(!1),children:e.jsxs(i.Card.Surface,{children:[e.jsx(u.FixedViews,{children:V.map(s=>e.jsx(i.Text,{variant:"placeholder",children:s.label},s.id||s.label))}),e.jsx(q.SortableViews,{}),e.jsx(u.Divider,{}),e.jsx(v.CreateView,{hideActionsPopover:S})]})})]})});exports.ViewsList=L;
package/dist/index44.js CHANGED
@@ -2,7 +2,7 @@ import { jsxs as s, Fragment as V, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as n } from "react";
3
3
  import { observer as v } from "mobx-react";
4
4
  import { ViewsContainer as S, Popover as x, Card as C, Text as L } from "@veeqo/ui";
5
- import { FixedViews as A, Divider as E } from "./index103.js";
5
+ import { FixedViews as A, Divider as E } from "./index108.js";
6
6
  import { SortableViews as b } from "./index41.js";
7
7
  import { useViews as M } from "./index64.js";
8
8
  import { useViewUrlChange as T } from "./index65.js";
package/dist/index46.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),C=require("./index90.cjs"),i=require("@veeqo/ui"),I=require("mobx-react"),N=require("./index8.cjs"),_=require("./index53.cjs"),j=require("./index63.cjs"),O=require("./index64.cjs"),g=require("./index52.cjs"),w=I.observer(({columnDefinitions:T,pinnedRightColumnIds:a=[],pinnedLeftColumnIds:l=[]})=>{var b;const{DEFAULT_HIDDEN_COLUMNS:E,DEFAULT_VISIBLE_COLUMNS:S}=N.useBusinessLogic(),t=[...l,...a],c=E.filter(s=>!t.includes(s)),r=S.filter(s=>!t.includes(s)),A=[...c,...r],{closeModal:L,isModalOpen:f,openModal:p}=_.useModal(),{Filters:{activeViewId:n},Views:{draftViewsMap:q}}=j.useStores(),{viewsMap:x,isLoading:D}=O.useViews();if(!n||D)return null;const e=x.get(n),u=Array.isArray((b=e==null?void 0:e.columns)==null?void 0:b.columnIds),d=u?e.columns.columnIds.filter(s=>!t.includes(s)):r,h=u?A.filter(s=>!d.includes(s)):c,m=q.has(n),M=!(e!=null&&e.editable),v=M||m,B=m?"Please create a view to use table management":M?"Please choose a custom view to use table management":"Table management";return o.jsxs(o.Fragment,{children:[o.jsx(i.Tooltip,{text:B,children:o.jsx(i.Button,{"aria-label":"Open table management",onClick:()=>p(g.ModalId.ORDERS_TABLE_MANAGEMENT),size:"sm",iconSlot:o.jsx(i.ListBoardIcon,{}),disabled:v})}),f(g.ModalId.ORDERS_TABLE_MANAGEMENT)&&o.jsx(C.TableManagementModal,{pinnedRightColumnIds:a,pinnedLeftColumnIds:l,visibleColumns:d,hiddenColumns:h,columnDefinitions:T,onClose:L})]})});exports.TableManagement=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),C=require("./index92.cjs"),i=require("@veeqo/ui"),I=require("mobx-react"),N=require("./index8.cjs"),_=require("./index53.cjs"),j=require("./index63.cjs"),O=require("./index64.cjs"),g=require("./index52.cjs"),w=I.observer(({columnDefinitions:T,pinnedRightColumnIds:a=[],pinnedLeftColumnIds:l=[]})=>{var b;const{DEFAULT_HIDDEN_COLUMNS:E,DEFAULT_VISIBLE_COLUMNS:S}=N.useBusinessLogic(),t=[...l,...a],c=E.filter(s=>!t.includes(s)),r=S.filter(s=>!t.includes(s)),A=[...c,...r],{closeModal:L,isModalOpen:f,openModal:p}=_.useModal(),{Filters:{activeViewId:n},Views:{draftViewsMap:q}}=j.useStores(),{viewsMap:x,isLoading:D}=O.useViews();if(!n||D)return null;const e=x.get(n),u=Array.isArray((b=e==null?void 0:e.columns)==null?void 0:b.columnIds),d=u?e.columns.columnIds.filter(s=>!t.includes(s)):r,h=u?A.filter(s=>!d.includes(s)):c,m=q.has(n),M=!(e!=null&&e.editable),v=M||m,B=m?"Please create a view to use table management":M?"Please choose a custom view to use table management":"Table management";return o.jsxs(o.Fragment,{children:[o.jsx(i.Tooltip,{text:B,children:o.jsx(i.Button,{"aria-label":"Open table management",onClick:()=>p(g.ModalId.ORDERS_TABLE_MANAGEMENT),size:"sm",iconSlot:o.jsx(i.ListBoardIcon,{}),disabled:v})}),f(g.ModalId.ORDERS_TABLE_MANAGEMENT)&&o.jsx(C.TableManagementModal,{pinnedRightColumnIds:a,pinnedLeftColumnIds:l,visibleColumns:d,hiddenColumns:h,columnDefinitions:T,onClose:L})]})});exports.TableManagement=w;
package/dist/index46.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsxs as v, Fragment as B, jsx as s } from "react/jsx-runtime";
2
- import { TableManagementModal as I } from "./index90.js";
2
+ import { TableManagementModal as I } from "./index92.js";
3
3
  import { Tooltip as O, Button as w, ListBoardIcon as x } from "@veeqo/ui";
4
4
  import { observer as F } from "mobx-react";
5
5
  import { useBusinessLogic as P } from "./index8.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("./index88.cjs"),e=require("@veeqo/ui"),o=require("./index89.cjs"),d=require("./index63.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("./index90.cjs"),e=require("@veeqo/ui"),o=require("./index91.cjs"),d=require("./index63.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 "./index88.js";
2
+ import { usePollData as c } from "./index90.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 "./index89.js";
4
+ import t from "./index91.js";
5
5
  import { useStores as b } from "./index63.js";
6
6
  const j = ({
7
7
  isLoading: s,
package/dist/index57.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),f=require("./index108.cjs"),Y=require("./index80.cjs"),k=require("./index67.cjs"),G=require("./index58.cjs"),H=require("./index62.cjs"),W=require("./index64.cjs"),r=require("./index45.cjs"),N=require("./index4.cjs"),$=require("./index3.cjs"),B=require("./index8.cjs"),b=require("./index63.cjs"),j=require("./index6.cjs"),z=require("./index5.cjs"),J=e=>{const{VIEW_TYPE:u}=B.useBusinessLogic(),{duplicateView:E}=G.useDuplicateActiveView(),{getActiveViewInAPIFormat:L}=H.usePersistUnsavedChanges(),{canDeleteCustomViews:O,defaultCustomViewId:M,canUpdateCustomViews:x,mutate:F}=k.useCustomViews({type:u}),{mutate:h,viewsMap:d,viewsArray:t}=W.useViews(),[g,a]=w.useState(!1),[A,p]=w.useState(!1),[D,l]=w.useState(!1),[R,S]=w.useState(!1),{Views:{removeDraftViewById:m,draftViewsMap:P},Filters:{initFiltersFromView:n,updateUrl:c,setActiveViewId:V},Notifications:{notify:o}}=b.useStores();return{actions:{delete:{handleDeleteDraftView:()=>{if(!P.has(e.id))throw Error("No draft view found");m(e.id);const s=d.get(M);if(s)s&&n(s);else{const i=d.get(f.ALL_VIEW_ID);i?n(i):t!=null&&t[0]&&n(t[0])}c()},handleDelete:async()=>{try{if(O){await $.deleteCustomView(Number(e.id)),await h();const s=d.get(f.ALL_VIEW_ID);s?n(s):t!=null&&t[0]&&n(t[0]),c(),A&&p(!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(P.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?p(!0):o({type:"info",text:"You require additional user permissions to delete a company shared view"})},closeDeleteConfirmation:()=>p(!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"?r.SHARING_OPTIONS.COMPANY:r.SHARING_OPTIONS.PERSONAL,_={attributes:{title:i,shared:v.key===r.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 F()),await h(),c(),o({type:"success",text:`'${i}' view updated`}),l(!1)}catch{o({type:"error",text:"Failed to save view"})}},handleDuplicate:()=>{E(),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"?r.SHARING_OPTIONS.COMPANY:r.SHARING_OPTIONS.PERSONAL,{arg:_}=L(),{data:I}=await j.createCustomView({attributes:{..._,title:i,shared:v.key===r.SHARING_OPTIONS.COMPANY.key}}),q=t.map(U=>U.id);q.push(I.id),await N.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:q},...y?{default_custom_view:{id:Number(I.id),type:u}}:{}}}),await h(),m(e.id);const T=Y.viewsAdapter({view:I,canUpdateCustomViews:x});n(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:R,shouldShowDeleteConfirmation:A}}};exports.useDropdownManager=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),f=require("./index101.cjs"),Y=require("./index80.cjs"),k=require("./index67.cjs"),G=require("./index58.cjs"),H=require("./index62.cjs"),W=require("./index64.cjs"),r=require("./index45.cjs"),N=require("./index4.cjs"),$=require("./index3.cjs"),B=require("./index8.cjs"),b=require("./index63.cjs"),j=require("./index6.cjs"),z=require("./index5.cjs"),J=e=>{const{VIEW_TYPE:u}=B.useBusinessLogic(),{duplicateView:E}=G.useDuplicateActiveView(),{getActiveViewInAPIFormat:L}=H.usePersistUnsavedChanges(),{canDeleteCustomViews:O,defaultCustomViewId:M,canUpdateCustomViews:x,mutate:F}=k.useCustomViews({type:u}),{mutate:h,viewsMap:d,viewsArray:t}=W.useViews(),[g,a]=w.useState(!1),[A,p]=w.useState(!1),[D,l]=w.useState(!1),[R,S]=w.useState(!1),{Views:{removeDraftViewById:m,draftViewsMap:P},Filters:{initFiltersFromView:n,updateUrl:c,setActiveViewId:V},Notifications:{notify:o}}=b.useStores();return{actions:{delete:{handleDeleteDraftView:()=>{if(!P.has(e.id))throw Error("No draft view found");m(e.id);const s=d.get(M);if(s)s&&n(s);else{const i=d.get(f.ALL_VIEW_ID);i?n(i):t!=null&&t[0]&&n(t[0])}c()},handleDelete:async()=>{try{if(O){await $.deleteCustomView(Number(e.id)),await h();const s=d.get(f.ALL_VIEW_ID);s?n(s):t!=null&&t[0]&&n(t[0]),c(),A&&p(!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(P.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?p(!0):o({type:"info",text:"You require additional user permissions to delete a company shared view"})},closeDeleteConfirmation:()=>p(!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"?r.SHARING_OPTIONS.COMPANY:r.SHARING_OPTIONS.PERSONAL,_={attributes:{title:i,shared:v.key===r.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 F()),await h(),c(),o({type:"success",text:`'${i}' view updated`}),l(!1)}catch{o({type:"error",text:"Failed to save view"})}},handleDuplicate:()=>{E(),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"?r.SHARING_OPTIONS.COMPANY:r.SHARING_OPTIONS.PERSONAL,{arg:_}=L(),{data:I}=await j.createCustomView({attributes:{..._,title:i,shared:v.key===r.SHARING_OPTIONS.COMPANY.key}}),q=t.map(U=>U.id);q.push(I.id),await N.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:q},...y?{default_custom_view:{id:Number(I.id),type:u}}:{}}}),await h(),m(e.id);const T=Y.viewsAdapter({view:I,canUpdateCustomViews:x});n(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:R,shouldShowDeleteConfirmation:A}}};exports.useDropdownManager=J;
package/dist/index57.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useState as w } from "react";
2
- import { ALL_VIEW_ID as f } from "./index108.js";
2
+ import { ALL_VIEW_ID as f } from "./index101.js";
3
3
  import { viewsAdapter as R } from "./index80.js";
4
4
  import { useCustomViews as q } from "./index67.js";
5
5
  import { useDuplicateActiveView as B } from "./index58.js";
package/dist/index65.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),q=require("qs"),C=require("./index108.cjs"),E=require("./index67.cjs"),I=require("./index64.cjs"),D=require("./index8.cjs"),F=require("./index63.cjs"),P=t=>t&&t.__esModule?t:{default:t},m=P(q),S=()=>{const{VIEW_TYPE:t,SEARCH_FILTER_ID:f}=D.useBusinessLogic(),{Filters:{activeViewId:g,initFiltersFromView:e,initFromUrl:i,discardChanges:l,updateUrl:L,setFilter:p}}=F.useStores(),{isLoading:_}=E.useCustomViews({type:t}),{viewsMap:s,defaultCustomViewId:w,isLoading:h,viewsArray:r}=I.useViews(),V=h||_;v.useEffect(()=>{if(V)return;const o=m.default.parse(window.location.search,{ignoreQueryPrefix:!0}),d=o.view,a=o[f],n=Object.keys(o).length>0;if(!g){if(d){const u=s.get(d);if(u)e(u),n&&i();else{const c=s.get(w);c&&(e(c),n&&i(!1))}}else{const u=s.get(w);if(u)e(u),l(!0),n&&i();else{const c=s.get(C.ALL_VIEW_ID);c?e(c):r!=null&&r[0]&&e(r[0])}}a&&p(f,a)}},[f,g,w,l,e,i,V,p,L,s,r]),v.useEffect(()=>{const o=()=>{const a=m.default.parse(window.location.search,{ignoreQueryPrefix:!0}).view;if(!a)return;const n=s.get(a);n&&(e(n),i())};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[l,e,i,s])};exports.useViewUrlChange=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),q=require("qs"),C=require("./index101.cjs"),E=require("./index67.cjs"),I=require("./index64.cjs"),D=require("./index8.cjs"),F=require("./index63.cjs"),P=t=>t&&t.__esModule?t:{default:t},m=P(q),S=()=>{const{VIEW_TYPE:t,SEARCH_FILTER_ID:f}=D.useBusinessLogic(),{Filters:{activeViewId:g,initFiltersFromView:e,initFromUrl:i,discardChanges:l,updateUrl:L,setFilter:p}}=F.useStores(),{isLoading:_}=E.useCustomViews({type:t}),{viewsMap:s,defaultCustomViewId:w,isLoading:h,viewsArray:r}=I.useViews(),V=h||_;v.useEffect(()=>{if(V)return;const o=m.default.parse(window.location.search,{ignoreQueryPrefix:!0}),d=o.view,a=o[f],n=Object.keys(o).length>0;if(!g){if(d){const u=s.get(d);if(u)e(u),n&&i();else{const c=s.get(w);c&&(e(c),n&&i(!1))}}else{const u=s.get(w);if(u)e(u),l(!0),n&&i();else{const c=s.get(C.ALL_VIEW_ID);c?e(c):r!=null&&r[0]&&e(r[0])}}a&&p(f,a)}},[f,g,w,l,e,i,V,p,L,s,r]),v.useEffect(()=>{const o=()=>{const a=m.default.parse(window.location.search,{ignoreQueryPrefix:!0}).view;if(!a)return;const n=s.get(a);n&&(e(n),i())};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[l,e,i,s])};exports.useViewUrlChange=S;
package/dist/index65.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { useEffect as g } from "react";
2
2
  import V from "qs";
3
- import { ALL_VIEW_ID as E } from "./index108.js";
3
+ import { ALL_VIEW_ID as E } from "./index101.js";
4
4
  import { useCustomViews as F } from "./index67.js";
5
5
  import { useViews as C } from "./index64.js";
6
6
  import { useBusinessLogic as D } from "./index8.js";
package/dist/index69.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),a=require("./index2.cjs"),w=require("./index110.cjs"),M=require("qs"),y=require("./index8.cjs"),_=require("./index63.cjs"),k=e=>e&&e.__esModule?e:{default:e},n=k(M),p=()=>{const{SORT_FILTER_ID:e,SORTING_MODE:s}=y.useBusinessLogic(),{Filters:{queryParamsObject:d,activeViewId:g},Table:{sortParam:o,sortState:t,setSortState:u}}=_.useStores(),I=!!g,O=c.useMemo(()=>{const r={...d};switch(s){case a.SortingMode.CORAL:t.columnId&&(r.sort_order=t.direction,r.sort=t.columnId);break;case a.SortingMode.MONOLITH:default:o&&(r[e]=o)}return n.default.stringify(r,{arrayFormat:"brackets"})},[d,o,s,e,t]),l=c.useCallback(()=>{const r=n.default.parse(window.location.search,{ignoreQueryPrefix:!0});switch(s){case a.SortingMode.CORAL:if(!t.columnId||r.sort_order===t.direction&&r.sort===t.columnId)break;r.sort_order=t.direction,r.sort=t.columnId;break;case a.SortingMode.MONOLITH:default:if(!o)break;if(r[e]===o)return;r[e]=o}const i=n.default.stringify(r,{arrayFormat:"brackets"});i&&window.history.replaceState({},"",`${window.location.pathname}?${i}`)},[s,e,o,t]),f=c.useCallback(()=>{const r=n.default.parse(window.location.search,{ignoreQueryPrefix:!0}),i=r[e],S=r.sort_order,m=r.sort;switch(s){case a.SortingMode.CORAL:S&&m&&u({columnId:m,direction:S});break;case a.SortingMode.MONOLITH:default:{if(!i)break;const b=w.parseSortString(i);b.columnId&&u(b)}}},[s,e,u]);return c.useEffect(()=>{f()},[f]),c.useEffect(()=>{l()},[t,l]),{queryParams:O,hasActiveView:I,updateCurrentUrlWithTableSort:l}};exports.useUrlParams=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),a=require("./index2.cjs"),w=require("./index102.cjs"),M=require("qs"),y=require("./index8.cjs"),_=require("./index63.cjs"),k=e=>e&&e.__esModule?e:{default:e},n=k(M),p=()=>{const{SORT_FILTER_ID:e,SORTING_MODE:s}=y.useBusinessLogic(),{Filters:{queryParamsObject:d,activeViewId:g},Table:{sortParam:o,sortState:t,setSortState:u}}=_.useStores(),I=!!g,O=c.useMemo(()=>{const r={...d};switch(s){case a.SortingMode.CORAL:t.columnId&&(r.sort_order=t.direction,r.sort=t.columnId);break;case a.SortingMode.MONOLITH:default:o&&(r[e]=o)}return n.default.stringify(r,{arrayFormat:"brackets"})},[d,o,s,e,t]),l=c.useCallback(()=>{const r=n.default.parse(window.location.search,{ignoreQueryPrefix:!0});switch(s){case a.SortingMode.CORAL:if(!t.columnId||r.sort_order===t.direction&&r.sort===t.columnId)break;r.sort_order=t.direction,r.sort=t.columnId;break;case a.SortingMode.MONOLITH:default:if(!o)break;if(r[e]===o)return;r[e]=o}const i=n.default.stringify(r,{arrayFormat:"brackets"});i&&window.history.replaceState({},"",`${window.location.pathname}?${i}`)},[s,e,o,t]),f=c.useCallback(()=>{const r=n.default.parse(window.location.search,{ignoreQueryPrefix:!0}),i=r[e],S=r.sort_order,m=r.sort;switch(s){case a.SortingMode.CORAL:S&&m&&u({columnId:m,direction:S});break;case a.SortingMode.MONOLITH:default:{if(!i)break;const b=w.parseSortString(i);b.columnId&&u(b)}}},[s,e,u]);return c.useEffect(()=>{f()},[f]),c.useEffect(()=>{l()},[t,l]),{queryParams:O,hasActiveView:I,updateCurrentUrlWithTableSort:l}};exports.useUrlParams=p;
package/dist/index69.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { useMemo as h, useCallback as p, useEffect as I } from "react";
2
2
  import { SortingMode as a } from "./index2.js";
3
- import { parseSortString as k } from "./index110.js";
3
+ import { parseSortString as k } from "./index102.js";
4
4
  import c from "qs";
5
5
  import { useBusinessLogic as y } from "./index8.js";
6
6
  import { useStores as L } from "./index63.js";