@veeqo/transfigure 1.2.0 → 1.2.2

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 (118) hide show
  1. package/dist/BusinessLogic/types.d.ts +1 -0
  2. package/dist/components/Views/ViewList/ViewsList.d.ts +5 -1
  3. package/dist/constants/viewConstants.d.ts +2 -0
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.js +16 -14
  6. package/dist/index10.cjs +1 -1
  7. package/dist/index10.js +14 -13
  8. package/dist/index100.cjs +1 -1
  9. package/dist/index100.js +20 -14
  10. package/dist/index101.cjs +1 -19
  11. package/dist/index101.js +14 -23
  12. package/dist/index102.cjs +12 -1
  13. package/dist/index102.js +16 -24
  14. package/dist/index103.cjs +1 -12
  15. package/dist/index103.js +33 -16
  16. package/dist/index104.cjs +1 -80
  17. package/dist/index104.js +28 -100
  18. package/dist/index105.cjs +1 -1
  19. package/dist/index105.js +24 -2
  20. package/dist/index106.cjs +80 -1
  21. package/dist/index106.js +101 -19
  22. package/dist/index107.cjs +1 -1
  23. package/dist/index107.js +18 -7
  24. package/dist/index108.cjs +1 -1
  25. package/dist/index108.js +7 -63
  26. package/dist/index109.cjs +1 -1
  27. package/dist/index109.js +60 -26
  28. package/dist/index11.cjs +1 -1
  29. package/dist/index11.js +1 -1
  30. package/dist/index110.cjs +1 -13
  31. package/dist/index110.js +30 -17
  32. package/dist/index111.cjs +1 -1
  33. package/dist/index111.js +2 -26
  34. package/dist/index112.cjs +13 -1
  35. package/dist/index112.js +14 -33
  36. package/dist/index113.cjs +1 -7
  37. package/dist/index113.js +36 -10
  38. package/dist/index114.cjs +1 -1
  39. package/dist/index114.js +25 -62
  40. package/dist/index115.cjs +1 -1
  41. package/dist/index115.js +58 -42
  42. package/dist/index116.cjs +1 -0
  43. package/dist/index116.js +49 -0
  44. package/dist/index117.cjs +7 -0
  45. package/dist/index117.js +12 -0
  46. package/dist/index17.cjs +1 -1
  47. package/dist/index17.js +1 -1
  48. package/dist/index22.cjs +1 -1
  49. package/dist/index22.js +1 -1
  50. package/dist/index31.cjs +1 -1
  51. package/dist/index31.js +1 -1
  52. package/dist/index34.cjs +1 -1
  53. package/dist/index34.js +1 -1
  54. package/dist/index36.cjs +1 -1
  55. package/dist/index36.js +62 -60
  56. package/dist/index39.cjs +1 -1
  57. package/dist/index39.js +1 -1
  58. package/dist/index40.cjs +1 -1
  59. package/dist/index40.js +1 -1
  60. package/dist/index41.cjs +1 -1
  61. package/dist/index41.js +1 -1
  62. package/dist/index42.cjs +1 -1
  63. package/dist/index42.js +1 -1
  64. package/dist/index44.cjs +1 -1
  65. package/dist/index44.js +36 -34
  66. package/dist/index46.cjs +1 -1
  67. package/dist/index46.js +2 -2
  68. package/dist/index62.cjs +1 -1
  69. package/dist/index62.js +31 -49
  70. package/dist/index7.cjs +1 -1
  71. package/dist/index7.js +4 -4
  72. package/dist/index80.cjs +1 -1
  73. package/dist/index80.js +20 -6
  74. package/dist/index81.cjs +1 -1
  75. package/dist/index81.js +7 -2
  76. package/dist/index82.cjs +1 -1
  77. package/dist/index82.js +2 -9
  78. package/dist/index83.cjs +1 -3
  79. package/dist/index83.js +8 -13
  80. package/dist/index84.cjs +3 -1
  81. package/dist/index84.js +13 -8
  82. package/dist/index85.cjs +1 -1
  83. package/dist/index85.js +8 -4
  84. package/dist/index88.cjs +1 -1
  85. package/dist/index88.js +4 -117
  86. package/dist/index89.cjs +1 -1
  87. package/dist/index89.js +117 -18
  88. package/dist/index90.cjs +1 -1
  89. package/dist/index90.js +19 -13
  90. package/dist/index91.cjs +1 -104
  91. package/dist/index91.js +13 -120
  92. package/dist/index92.cjs +104 -1
  93. package/dist/index92.js +117 -65
  94. package/dist/index93.cjs +1 -1
  95. package/dist/index93.js +63 -24
  96. package/dist/index94.cjs +1 -1
  97. package/dist/index94.js +29 -2
  98. package/dist/index95.cjs +1 -1
  99. package/dist/index95.js +2 -41
  100. package/dist/index96.cjs +1 -1
  101. package/dist/index96.js +39 -9
  102. package/dist/index97.cjs +1 -1
  103. package/dist/index97.js +9 -31
  104. package/dist/index98.cjs +1 -1
  105. package/dist/index98.js +7 -29
  106. package/dist/index99.cjs +19 -1
  107. package/dist/index99.js +24 -21
  108. package/dist/mocks/createMockTransformedView.d.ts +2 -0
  109. package/dist/mocks/createMockView.d.ts +2 -0
  110. package/dist/storybookHelpers/Code.d.ts +3 -0
  111. package/dist/storybookHelpers/apiMocks/views/mockSeededAllView.d.ts +26 -0
  112. package/dist/types.d.ts +5 -0
  113. package/dist/utils/index.d.ts +1 -0
  114. package/dist/utils/organiseViews/index.d.ts +1 -0
  115. package/dist/utils/organiseViews/organiseViews.d.ts +18 -0
  116. package/dist/utils/organiseViews/organiseViews.test.d.ts +1 -0
  117. package/package.json +1 -1
  118. /package/dist/storybookHelpers/apiMocks/{custom_views.d.ts → views/custom_views.d.ts} +0 -0
package/dist/index110.js CHANGED
@@ -1,19 +1,32 @@
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
+ import { useRef as u, useCallback as d } from "react";
2
+ import { pointerWithin as p, rectIntersection as a, getFirstCollision as f, closestCenter as C } from "@dnd-kit/core";
3
+ const h = ({ items: n }) => {
4
+ const i = u(null);
5
+ return { collisionDetectionStrategy: d(
6
+ (e) => {
7
+ var r;
8
+ const o = p(e), s = o.length > 0 ? (
9
+ // If there are droppables intersecting with the pointer, return those
10
+ o
11
+ ) : a(e);
12
+ let t = f(s, "id");
13
+ if (t != null) {
14
+ if (t in n) {
15
+ const l = n[t];
16
+ l.length > 0 && (t = ((r = C({
17
+ ...e,
18
+ droppableContainers: e.droppableContainers.filter(
19
+ (c) => c.id !== t && l.includes(c.id)
20
+ )
21
+ })[0]) == null ? void 0 : r.id) ?? t);
22
+ }
23
+ return i.current = t, [{ id: t }];
24
+ }
25
+ return i.current ? [{ id: i.current }] : [];
26
+ },
27
+ [n]
28
+ ) };
29
+ };
17
30
  export {
18
- p as StyledSortableViews
31
+ h as useCollisionDetectionStrategy
19
32
  };
package/dist/index111.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={initial:{opacity:0,y:50,scale:.95},animate:{opacity:1,y:0,scale:1,transition:{duration:.2,ease:"easeOut"}},exit:{opacity:0,y:20,scale:.95,transition:{duration:.2,ease:"easeIn"}}};exports.notificationVariants=t;
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,28 +1,4 @@
1
- const a = {
2
- initial: {
3
- opacity: 0,
4
- y: 50,
5
- scale: 0.95
6
- },
7
- animate: {
8
- opacity: 1,
9
- y: 0,
10
- scale: 1,
11
- transition: {
12
- duration: 0.2,
13
- ease: "easeOut"
14
- }
15
- },
16
- exit: {
17
- opacity: 0,
18
- y: 20,
19
- scale: 0.95,
20
- transition: {
21
- duration: 0.2,
22
- ease: "easeIn"
23
- }
24
- }
25
- };
1
+ const o = (r) => r instanceof Error;
26
2
  export {
27
- a as notificationVariants
3
+ o as isError
28
4
  };
package/dist/index112.cjs CHANGED
@@ -1 +1,13 @@
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 t=require("@veeqo/components"),o=require("@veeqo/ui"),s=require("styled-components"),l=e=>e&&e.__esModule?e:{default:e},r=l(s),{SortableViews:i}=t.VeeqoUI,n=r.default(i)`
2
+ .rst__rowTitle {
3
+ span {
4
+ white-space: nowrap;
5
+ overflow: hidden;
6
+ text-overflow: ellipsis;
7
+ }
8
+ }
9
+
10
+ .rst__rowTitle > div:first-child {
11
+ gap: ${o.theme.sizes.sm};
12
+ }
13
+ `;exports.StyledSortableViews=n;
package/dist/index112.js CHANGED
@@ -1,38 +1,19 @@
1
+ import { VeeqoUI as e } from "@veeqo/components";
1
2
  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"
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;
18
10
  }
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
11
  }
35
- })(e);
12
+
13
+ .rst__rowTitle > div:first-child {
14
+ gap: ${o.sizes.sm};
15
+ }
16
+ `;
36
17
  export {
37
- l as MUISlider
18
+ p as StyledSortableViews
38
19
  };
package/dist/index113.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("@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/index113.js CHANGED
@@ -1,12 +1,38 @@
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 { 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);
10
36
  export {
11
- h as AdaptiveStyledContainer
37
+ l as MUISlider
12
38
  };
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("./index112.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 t={initial:{opacity:0,y:50,scale:.95},animate:{opacity:1,y:0,scale:1,transition:{duration:.2,ease:"easeOut"}},exit:{opacity:0,y:20,scale:.95,transition:{duration:.2,ease:"easeIn"}}};exports.notificationVariants=t;
package/dist/index114.js CHANGED
@@ -1,65 +1,28 @@
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 "./index112.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
- ] });
1
+ const a = {
2
+ initial: {
3
+ opacity: 0,
4
+ y: 50,
5
+ scale: 0.95
6
+ },
7
+ animate: {
8
+ opacity: 1,
9
+ y: 0,
10
+ scale: 1,
11
+ transition: {
12
+ duration: 0.2,
13
+ ease: "easeOut"
14
+ }
15
+ },
16
+ exit: {
17
+ opacity: 0,
18
+ y: 20,
19
+ scale: 0.95,
20
+ transition: {
21
+ duration: 0.2,
22
+ ease: "easeIn"
23
+ }
61
24
  }
62
- );
25
+ };
63
26
  export {
64
- j as FilterNumberRangeFilter
27
+ a as notificationVariants
65
28
  };
package/dist/index115.cjs CHANGED
@@ -1 +1 @@
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 r=require("react/jsx-runtime"),p=require("mobx-react"),l=require("@veeqo/ui"),v=require("./index113.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/index115.js CHANGED
@@ -1,49 +1,65 @@
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,
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 "./index113.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,
23
52
  {
24
- allowMultiple: !0,
25
- title: t.label,
26
- options: g,
27
- selected: c,
28
- onChange: (e) => a(e)
53
+ value: C,
54
+ onChange: p,
55
+ min: s,
56
+ max: c,
57
+ valueLabelDisplay: "auto"
29
58
  }
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
- ] })
59
+ )
44
60
  ] });
45
61
  }
46
62
  );
47
63
  export {
48
- T as ActiveAsyncCheckboxFilter
64
+ j as FilterNumberRangeFilter
49
65
  };
@@ -0,0 +1 @@
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;
@@ -0,0 +1,49 @@
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
+ );
47
+ export {
48
+ T as ActiveAsyncCheckboxFilter
49
+ };
@@ -0,0 +1,7 @@
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;
@@ -0,0 +1,12 @@
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
+ `;
10
+ export {
11
+ h as AdaptiveStyledContainer
12
+ };
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("./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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),l=require("mobx-react"),s=require("@veeqo/ui"),c=require("./index49.cjs"),u=require("./index116.cjs"),h=l.observer(({data:e,editedValue:r,setEditedValue:t})=>{var i;switch(e.filterType){case c.FilterChoiceValue.CHECKBOX:return e.fetchAsyncFilterOptions?o.jsx(u.ActiveAsyncCheckboxFilter,{field:e,setEditedValue:t,editedValue:r}):o.jsx(s.ChoiceList,{allowMultiple:!0,title:e.label,options:(i=e.options)!=null&&i.length?e.options:[],selected:r,onChange:n=>t(n)});default:return null}});exports.FilterArrayField=h;
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 "./index115.js";
5
+ import { ActiveAsyncCheckboxFilter as c } from "./index116.js";
6
6
  const F = n(
7
7
  ({ data: r, editedValue: e, setEditedValue: o }) => {
8
8
  var i;
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("./index69.cjs"),R=require("./index114.cjs"),v=require("./index61.cjs"),N=require("./index24.cjs"),q=require("./index25.cjs"),A=d.observer(({filterData:t})=>{const{Filters:{numberRangeFilters:u,clearNumberRangeFilter:a,setNumberRangeFilter:g}}=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 F=()=>{a(t.id)},b=()=>{!e||!n||g({numberRange:e,lte:n.lte,gte:n.gte})};return i.jsx(l.FilterTag,{shouldCloseOnClickAway:!0,header:i.jsx(q.ActiveFilterHeader,{filterLabel:t.label,glyph:t.glyph}),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:F,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("./index69.cjs"),R=require("./index115.cjs"),v=require("./index61.cjs"),N=require("./index24.cjs"),q=require("./index25.cjs"),A=d.observer(({filterData:t})=>{const{Filters:{numberRangeFilters:u,clearNumberRangeFilter:a,setNumberRangeFilter:g}}=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 F=()=>{a(t.id)},b=()=>{!e||!n||g({numberRange:e,lte:n.lte,gte:n.gte})};return i.jsx(l.FilterTag,{shouldCloseOnClickAway:!0,header:i.jsx(q.ActiveFilterHeader,{filterLabel:t.label,glyph:t.glyph}),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:F,applyActiveFilter:b})})});exports.ActiveFilterNumberRangeTag=A;
package/dist/index22.js CHANGED
@@ -3,7 +3,7 @@ import { useState as a, useCallback as d, 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 "./index69.js";
6
- import { FilterNumberRangeFilter as h } from "./index114.js";
6
+ import { FilterNumberRangeFilter as h } from "./index115.js";
7
7
  import { useStores as v } from "./index61.js";
8
8
  import { ActiveFilterFooter as A } from "./index24.js";
9
9
  import { ActiveFilterHeader as w } from "./index25.js";
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("./index112.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("./index113.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 "./index112.js";
6
+ import { MUISlider as A } from "./index113.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/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("./index102.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("./index105.cjs"),c=require("./index35.cjs"),a=s.observer(()=>{const{GROUP_MAP:t}=o.useBusinessLogic();return e.jsx(u.AdaptiveHeightContainer,{style:{minWidth:"360px"},children:e.jsx(n.Stack,{alignX:"stretch",children:Array.from(t).map(([r,i])=>e.jsx(c.FilterGroup,{data:i},r))})})});exports.FiltersList=a;
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 "./index102.js";
5
+ import { AdaptiveHeightContainer as p } from "./index105.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"),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("./index97.cjs"),X=require("./index8.cjs"),Z=require("./index61.cjs"),$=require("./index98.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"),c=require("react"),u=require("@veeqo/ui"),U=require("mobx-react"),z=require("./index65.cjs"),G=require("./index62.cjs"),J=require("./index40.cjs"),K=require("./index43.cjs"),Q=require("./index56.cjs"),X=require("./index103.cjs"),Z=require("./index8.cjs"),$=require("./index61.cjs"),b=require("./index104.cjs"),ee=U.observer(({view:e})=>{const{VIEW_TYPE:x,IS_VIEWS_READONLY:r,SEARCH_FILTER_ID:d}=Z.useBusinessLogic(),{Filters:{activeViewId:w,initFiltersFromView:f,discardChanges:m,initFromUrl:V,filters:L,setFilter:y},Views:{draftViewsMap:T},Notifications:{notify:E}}=$.useStores(),{viewsMap:h,defaultCustomViewId:F,isLoading:N}=G.useViews(),{isLoading:j}=z.useCustomViews({type:x}),{viewCounts:M,isLoadingViewCounts:R}=X.useViewCounts(),[s,k]=c.useState(null),A=o=>{const q=L.get(d);if(h.has(o)){const n=h.get(o);n&&(f(n),m(!0),V())}else{const n=T.get(o);n?(f(n),m(!0),V()):E({type:"error",text:"Failed to load view"})}q&&y(d,q)},a=(e==null?void 0:e.id)===w,t=e.originalView!==void 0,g=e.originalView===void 0,I=M,l=(e==null?void 0:e.label)||"",P=N||j,p=c.useRef(!1);!P&&!p.current&&a&&e.id===F&&s&&(p.current=!0,s&&w===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const D=c.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:_},menu:{toggleDropdown:v},delete:{closeDeleteConfirmation:B,handleDelete:O,handleDeleteDraftView:C}},state:{shouldShowDeleteConfirmation:H},actions:W,state:S}=Q.useDropdownManager(e),Y=c.useMemo(()=>{if(!r){if(g)return v;if(t)return C}},[C,t,g,v,r]);return i.jsxs(i.Fragment,{children:[i.jsx(u.ViewTab,{colourPalette:u.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:a,id:e==null?void 0:e.id,name:l,type:r?void 0:D,count:R?i.jsx(u.Loader,{type:"ThreeDots",width:12,height:12,color:a?"#fff":u.theme.colors.neutral.ink.dark}):I,onClick:A,subAction:Y,ariaContext:"orders",ref:k,"aria-controls":"options-dropdown","aria-expanded":S.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx(b.Confirmation,{shouldShow:H,viewName:l,onCancel:B,onDelete:O}),i.jsx(J.PillNotifications,{tabType:D,isActive:a,initialViewName:l,shouldShowCreateViewNotification:t,handleSaveDraft:_}),!r&&i.jsx(K.ViewDropdowns,{referenceElement:s,tab:e,...W,...S})]})});exports.ViewTab=ee;