@veeqo/transfigure 1.1.3 → 1.1.4
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.
- package/dist/hooks/useUrlParams/useUrlParams.d.ts +1 -0
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +14 -32
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +21 -29
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +1 -1
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +32 -22
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +22 -32
- package/dist/index112.cjs +1 -7
- package/dist/index112.js +63 -10
- package/dist/index113.cjs +7 -1
- package/dist/index113.js +10 -47
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +42 -58
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +1 -1
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +1 -1
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +1 -1
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +2 -2
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +1 -1
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +1 -1
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +54 -18
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +2 -2
- package/dist/index96.cjs +1 -12
- package/dist/index96.js +24 -16
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +31 -19
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +28 -23
- package/dist/index99.cjs +12 -1
- package/dist/index99.js +16 -15
- package/package.json +1 -1
package/dist/index101.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),l=require("./index109.cjs"),o=e=>i.jsx(l.StyledSortableViews,{...e,onChange:t=>{t.filter(r=>{var n;return(n=r.children)==null?void 0:n.length}).length||e.onChange(t)}});exports.LegacySortableViews=o;
|
package/dist/index101.js
CHANGED
|
@@ -1,35 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, [s, r, n]), m = !u ? `${a}?${c}` : null, {
|
|
13
|
-
data: t,
|
|
14
|
-
error: l,
|
|
15
|
-
isLoading: L,
|
|
16
|
-
mutate: d
|
|
17
|
-
} = p(
|
|
18
|
-
[m, { includeMeta: !0 }],
|
|
19
|
-
([e, f]) => E(e, f),
|
|
20
|
-
{
|
|
21
|
-
revalidateOnFocus: !1,
|
|
22
|
-
revalidateOnReconnect: !1,
|
|
23
|
-
keepPreviousData: !0
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { StyledSortableViews as i } from "./index109.js";
|
|
3
|
+
const h = (e) => /* @__PURE__ */ o(
|
|
4
|
+
i,
|
|
5
|
+
{
|
|
6
|
+
...e,
|
|
7
|
+
onChange: (t) => {
|
|
8
|
+
t.filter((n) => {
|
|
9
|
+
var r;
|
|
10
|
+
return (r = n.children) == null ? void 0 : r.length;
|
|
11
|
+
}).length || e.onChange(t);
|
|
24
12
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
viewCounts: (i = o == null ? void 0 : o.page) == null ? void 0 : i.total_count,
|
|
28
|
-
error: l,
|
|
29
|
-
isLoadingViewCounts: L,
|
|
30
|
-
mutate: d
|
|
31
|
-
};
|
|
32
|
-
};
|
|
13
|
+
}
|
|
14
|
+
);
|
|
33
15
|
export {
|
|
34
|
-
|
|
16
|
+
h as LegacySortableViews
|
|
35
17
|
};
|
package/dist/index102.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("@veeqo/ui"),i=require("./index103.cjs"),n=r.theme.colors.secondary.blue.base,a=({onClick:t})=>e.jsx(i.Notification,{children:e.jsx(i.Pill,{children:e.jsxs(r.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(i.Glyph,{ariaLabel:"info",name:"info",color:n}),e.jsxs(i.Wrap,{children:[e.jsx(i.Text,{variant:"body",margin:"0 4px 0 0",children:"You are currently in a"}),e.jsx(i.Bold,{variant:"bodyBoldDark",children:"draft view"}),e.jsx(i.Hint,{variant:"hintText",children:"Apply filters and save these by creating a custom view"})]}),e.jsx(i.Button,{variant:"primary",onClick:t,size:"sm",children:"Create view"})]})})});exports.DraftPill=a;
|
package/dist/index102.js
CHANGED
|
@@ -1,31 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
variant: "
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onClick: o,
|
|
22
|
-
variant: "primaryDestructive"
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
showHeaderCloseButton: !0,
|
|
26
|
-
children: /* @__PURE__ */ e(r, { variant: "body", children: "This cannot be undone." })
|
|
27
|
-
}
|
|
28
|
-
);
|
|
1
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { Stack as a, theme as n } from "@veeqo/ui";
|
|
3
|
+
import { Notification as t, Pill as o, Glyph as l, Wrap as c, Text as d, Bold as s, Hint as h, Button as m } from "./index103.js";
|
|
4
|
+
const p = n.colors.secondary.blue.base, b = ({ onClick: e }) => /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(o, { children: /* @__PURE__ */ i(a, { direction: "horizontal", alignY: "center", children: [
|
|
5
|
+
/* @__PURE__ */ r(l, { ariaLabel: "info", name: "info", color: p }),
|
|
6
|
+
/* @__PURE__ */ i(c, { children: [
|
|
7
|
+
/* @__PURE__ */ r(d, { variant: "body", margin: "0 4px 0 0", children: "You are currently in a" }),
|
|
8
|
+
/* @__PURE__ */ r(s, { variant: "bodyBoldDark", children: "draft view" }),
|
|
9
|
+
/* @__PURE__ */ r(h, { variant: "hintText", children: "Apply filters and save these by creating a custom view" })
|
|
10
|
+
] }),
|
|
11
|
+
/* @__PURE__ */ r(
|
|
12
|
+
m,
|
|
13
|
+
{
|
|
14
|
+
variant: "primary",
|
|
15
|
+
onClick: e,
|
|
16
|
+
size: "sm",
|
|
17
|
+
children: "Create view"
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
] }) }) });
|
|
29
21
|
export {
|
|
30
|
-
|
|
22
|
+
b as DraftPill
|
|
31
23
|
};
|
package/dist/index103.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("styled-components"),t=require("@veeqo/ui"),r=require("@veeqo/components"),l=require("framer-motion"),s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("styled-components"),t=require("@veeqo/ui"),r=require("@veeqo/components"),l=require("framer-motion"),s=require("./index111.cjs"),c=e=>e&&e.__esModule?e:{default:e},o=c(a),{Glyph:i}=r.VeeqoCommon,d=o.default(l.motion(t.BaseContainer)).attrs(()=>({variants:s.notificationVariants,initial:"initial",animate:"animate",exit:"exit"}))`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: fixed;
|
|
4
4
|
width: 100vw;
|
package/dist/index103.js
CHANGED
|
@@ -2,7 +2,7 @@ import t from "styled-components";
|
|
|
2
2
|
import { BaseContainer as n, theme as i, Text as e, Banner as a, Button as l } from "@veeqo/ui";
|
|
3
3
|
import { VeeqoCommon as s } from "@veeqo/components";
|
|
4
4
|
import { motion as c } from "framer-motion";
|
|
5
|
-
import { notificationVariants as p } from "./
|
|
5
|
+
import { notificationVariants as p } from "./index111.js";
|
|
6
6
|
const { Glyph: x } = s, u = t(c(n)).attrs(() => ({
|
|
7
7
|
variants: p,
|
|
8
8
|
initial: "initial",
|
package/dist/index110.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@veeqo/ui"),o=require("@material-ui/core/styles"),t=require("@material-ui/core/Slider"),l=e=>e&&e.__esModule?e:{default:e},i=l(t),a=o.withStyles({root:{color:r.theme.colors.secondary.blue.base,height:4},thumb:{height:20,width:20,backgroundColor:"#fff",border:"3px solid currentColor",marginTop:-8,marginLeft:-10,"&:focus, &:hover, &$active":{boxShadow:"inherit"}},valueLabel:{left:"calc(-50% - 1px)"},track:{height:4,borderRadius:4,backgroundColor:r.theme.colors.secondary.blue.light,opacity:1},rail:{height:4,borderRadius:4,backgroundColor:r.theme.colors.neutral.grey.dark,opacity:1}})(i.default);exports.MUISlider=a;
|
package/dist/index110.js
CHANGED
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
6
8
|
},
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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"
|
|
14
18
|
}
|
|
15
19
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
|
24
34
|
}
|
|
25
|
-
};
|
|
35
|
+
})(e);
|
|
26
36
|
export {
|
|
27
|
-
|
|
37
|
+
l as MUISlider
|
|
28
38
|
};
|
package/dist/index111.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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/index111.js
CHANGED
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
color: o.colors.secondary.blue.base,
|
|
7
|
-
height: 4
|
|
1
|
+
const a = {
|
|
2
|
+
initial: {
|
|
3
|
+
opacity: 0,
|
|
4
|
+
y: 50,
|
|
5
|
+
scale: 0.95
|
|
8
6
|
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"&:focus, &:hover, &$active": {
|
|
17
|
-
boxShadow: "inherit"
|
|
7
|
+
animate: {
|
|
8
|
+
opacity: 1,
|
|
9
|
+
y: 0,
|
|
10
|
+
scale: 1,
|
|
11
|
+
transition: {
|
|
12
|
+
duration: 0.2,
|
|
13
|
+
ease: "easeOut"
|
|
18
14
|
}
|
|
19
15
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
rail: {
|
|
30
|
-
height: 4,
|
|
31
|
-
borderRadius: 4,
|
|
32
|
-
backgroundColor: o.colors.neutral.grey.dark,
|
|
33
|
-
opacity: 1
|
|
16
|
+
exit: {
|
|
17
|
+
opacity: 0,
|
|
18
|
+
y: 20,
|
|
19
|
+
scale: 0.95,
|
|
20
|
+
transition: {
|
|
21
|
+
duration: 0.2,
|
|
22
|
+
ease: "easeIn"
|
|
23
|
+
}
|
|
34
24
|
}
|
|
35
|
-
}
|
|
25
|
+
};
|
|
36
26
|
export {
|
|
37
|
-
|
|
27
|
+
a as notificationVariants
|
|
38
28
|
};
|
package/dist/index112.cjs
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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("./index110.cjs"),y=p.observer(({data:m,editedValue:t,setEditedValue:c})=>{var b;if(!((b=m.options)!=null&&b.length))return null;const[u,x]=m.options,i=Number(u.value),a=Number(x.value),h=(s,n)=>{if(!Array.isArray(n)||n.length!==2||!t)return;const[e,j]=n,g=t==null?void 0:t.clone();g.setGte(e),g.setLte(j),c(g)},o={gte:(t==null?void 0:t.gte)||0,lte:(t==null?void 0:t.lte)||100},M=s=>{if(!t)return;const n=t.clone(),e=Number(s);e>n.lteMax||(e>=n.gteMin&&e<=n.lteMax&&n.setGte(e),(!n.lte||e>=n.lte)&&n.setLte(n.lteMax),c(n))},f=s=>{if(!t)return;const n=t.clone(),e=Number(s);e<n.gteMin||(e>=n.gteMin&&e<=n.lteMax&&n.setLte(e),(!n.gte||e<=n.gte)&&n.setGte(n.gteMin),c(n))},S=[o.gte,o.lte];return r.jsxs(l.Stack,{spacing:"xs",alignX:"stretch",children:[r.jsxs(l.Stack,{direction:"horizontal",children:[r.jsx(l.TextField,{label:u.label,type:"number",min:i,max:a,value:o.gte.toString(),onChange:M}),r.jsx(l.TextField,{label:x.label,type:"number",min:i,max:a,value:o.lte.toString(),onChange:f})]}),r.jsx(v.MUISlider,{value:S,onChange:h,min:i,max:a,valueLabelDisplay:"auto"})]})});exports.FilterNumberRangeFilter=y;
|
package/dist/index112.js
CHANGED
|
@@ -1,12 +1,65 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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 "./index110.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
|
-
|
|
64
|
+
j as FilterNumberRangeFilter
|
|
12
65
|
};
|
package/dist/index113.cjs
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("styled-components"),e=require("@veeqo/ui"),a=t=>t&&t.__esModule?t:{default:t},i=a(o),s=i.default(e.BaseContainer)`
|
|
2
|
+
padding: ${e.theme.sizes.sm};
|
|
3
|
+
// This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
|
|
4
|
+
// with an additional sizes.base offset at the bottom.
|
|
5
|
+
max-height: calc(100vh ${({offset:t})=>t&&`- ${t}px`} - ${e.theme.sizes.base});
|
|
6
|
+
overflow-y: auto;
|
|
7
|
+
`;exports.AdaptiveStyledContainer=s;
|
package/dist/index113.js
CHANGED
|
@@ -1,49 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
({ field: t, editedValue: c, setEditedValue: a }) => {
|
|
11
|
-
var o, i;
|
|
12
|
-
const l = u(() => {
|
|
13
|
-
var e;
|
|
14
|
-
return L({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
|
|
15
|
-
}, [(o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher]), { isLoading: m, isValidating: h, data: p, error: f } = S(
|
|
16
|
-
(i = t.fetchAsyncFilterOptions) == null ? void 0 : i.URL,
|
|
17
|
-
l,
|
|
18
|
-
k
|
|
19
|
-
), r = m || h, g = d({ data: p, config: t.fetchAsyncFilterOptions });
|
|
20
|
-
return /* @__PURE__ */ s(b, { spacing: "xs", alignX: "stretch", children: [
|
|
21
|
-
/* @__PURE__ */ n(
|
|
22
|
-
F,
|
|
23
|
-
{
|
|
24
|
-
allowMultiple: !0,
|
|
25
|
-
title: t.label,
|
|
26
|
-
options: g,
|
|
27
|
-
selected: c,
|
|
28
|
-
onChange: (e) => a(e)
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
r && /* @__PURE__ */ n(
|
|
32
|
-
x,
|
|
33
|
-
{
|
|
34
|
-
width: "200px",
|
|
35
|
-
height: y.sizes[5],
|
|
36
|
-
"aria-busy": !0,
|
|
37
|
-
"aria-label": `Loading ${t.label} filters`
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
!r && f && /* @__PURE__ */ s(A, { variant: "errorSmall", children: [
|
|
41
|
-
"Error: failed to load filter for ",
|
|
42
|
-
t.label
|
|
43
|
-
] })
|
|
44
|
-
] });
|
|
45
|
-
}
|
|
46
|
-
);
|
|
1
|
+
import o from "styled-components";
|
|
2
|
+
import { theme as e, BaseContainer as i } from "@veeqo/ui";
|
|
3
|
+
const h = o(i)`
|
|
4
|
+
padding: ${e.sizes.sm};
|
|
5
|
+
// This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
|
|
6
|
+
// with an additional sizes.base offset at the bottom.
|
|
7
|
+
max-height: calc(100vh ${({ offset: t }) => t && `- ${t}px`} - ${e.sizes.base});
|
|
8
|
+
overflow-y: auto;
|
|
9
|
+
`;
|
|
47
10
|
export {
|
|
48
|
-
|
|
11
|
+
h as AdaptiveStyledContainer
|
|
49
12
|
};
|
package/dist/index114.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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("./index74.cjs"),y=require("./index75.cjs"),F=require("./index48.cjs"),O=e=>e&&e.__esModule?e:{default:e},A=O(m),S=d.observer(({field:e,editedValue:o,setEditedValue:a})=>{var c,i;const l=p.useMemo(()=>{var r;return y.getFetcherFunction({fetcherName:(r=e.fetchAsyncFilterOptions)==null?void 0:r.fetcher})},[(c=e.fetchAsyncFilterOptions)==null?void 0:c.fetcher]),{isLoading:u,isValidating:h,data:g,error:b}=A.default((i=e.fetchAsyncFilterOptions)==null?void 0:i.URL,l,F.SWR_HOOK_OPTIONS),n=u||h,f=x.getAsyncOptions({data:g,config:e.fetchAsyncFilterOptions});return s.jsxs(t.Stack,{spacing:"xs",alignX:"stretch",children:[s.jsx(t.ChoiceList,{allowMultiple:!0,title:e.label,options:f,selected:o,onChange:r=>a(r)}),n&&s.jsx(t.Skeleton,{width:"200px",height:t.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!n&&b&&s.jsxs(t.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.ActiveAsyncCheckboxFilter=S;
|
package/dist/index114.js
CHANGED
|
@@ -1,65 +1,49 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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,
|
|
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 "./index74.js";
|
|
7
|
+
import { getFetcherFunction as L } from "./index75.js";
|
|
8
|
+
import { SWR_HOOK_OPTIONS as k } from "./index48.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,
|
|
52
23
|
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
24
|
+
allowMultiple: !0,
|
|
25
|
+
title: t.label,
|
|
26
|
+
options: g,
|
|
27
|
+
selected: c,
|
|
28
|
+
onChange: (e) => a(e)
|
|
58
29
|
}
|
|
59
|
-
)
|
|
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
|
+
] })
|
|
60
44
|
] });
|
|
61
45
|
}
|
|
62
46
|
);
|
|
63
47
|
export {
|
|
64
|
-
|
|
48
|
+
T as ActiveAsyncCheckboxFilter
|
|
65
49
|
};
|
package/dist/index16.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("./index48.cjs"),u=require("./
|
|
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("./index48.cjs"),u=require("./index114.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/index16.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 "./index48.js";
|
|
5
|
-
import { ActiveAsyncCheckboxFilter as c } from "./
|
|
5
|
+
import { ActiveAsyncCheckboxFilter as c } from "./index114.js";
|
|
6
6
|
const F = n(
|
|
7
7
|
({ data: r, editedValue: e, setEditedValue: o }) => {
|
|
8
8
|
var i;
|
package/dist/index21.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("./index68.cjs"),R=require("./
|
|
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("./index68.cjs"),R=require("./index112.cjs"),v=require("./index60.cjs"),N=require("./index23.cjs"),q=require("./index24.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/index21.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 "./index68.js";
|
|
6
|
-
import { FilterNumberRangeFilter as h } from "./
|
|
6
|
+
import { FilterNumberRangeFilter as h } from "./index112.js";
|
|
7
7
|
import { useStores as v } from "./index60.js";
|
|
8
8
|
import { ActiveFilterFooter as A } from "./index23.js";
|
|
9
9
|
import { ActiveFilterHeader as w } from "./index24.js";
|
package/dist/index30.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("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("react"),_=require("mobx-react"),j=require("lodash/debounce"),r=require("@veeqo/ui"),L=require("./index110.cjs"),R=require("./index68.cjs"),p=require("./index8.cjs"),y=require("./index60.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/index30.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 "./
|
|
6
|
+
import { MUISlider as A } from "./index110.js";
|
|
7
7
|
import { NumberRangeFilter as h } from "./index68.js";
|
|
8
8
|
import { useBusinessLogic as B } from "./index8.js";
|
|
9
9
|
import { useStores as T } from "./index60.js";
|
package/dist/index33.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("./
|
|
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("./index96.cjs"),c=require("./index34.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/index33.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 "./
|
|
5
|
+
import { AdaptiveHeightContainer as p } from "./index96.js";
|
|
6
6
|
import { FilterGroup as n } from "./index34.js";
|
|
7
7
|
const u = e(() => {
|
|
8
8
|
const { GROUP_MAP: t } = s();
|
package/dist/index35.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("./index64.cjs"),z=require("./index61.cjs"),G=require("./index39.cjs"),J=require("./index42.cjs"),K=require("./index55.cjs"),Q=require("./
|
|
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("./index64.cjs"),z=require("./index61.cjs"),G=require("./index39.cjs"),J=require("./index42.cjs"),K=require("./index55.cjs"),Q=require("./index97.cjs"),X=require("./index8.cjs"),Z=require("./index60.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;
|
package/dist/index35.js
CHANGED
|
@@ -7,10 +7,10 @@ import { useViews as X } from "./index61.js";
|
|
|
7
7
|
import { PillNotifications as Z } from "./index39.js";
|
|
8
8
|
import { ViewDropdowns as b } from "./index42.js";
|
|
9
9
|
import { useDropdownManager as ee } from "./index55.js";
|
|
10
|
-
import { useViewCounts as oe } from "./
|
|
10
|
+
import { useViewCounts as oe } from "./index97.js";
|
|
11
11
|
import { useBusinessLogic as ie } from "./index8.js";
|
|
12
12
|
import { useStores as te } from "./index60.js";
|
|
13
|
-
import { Confirmation as re } from "./
|
|
13
|
+
import { Confirmation as re } from "./index98.js";
|
|
14
14
|
const ge = K(({ view: e }) => {
|
|
15
15
|
const { VIEW_TYPE: S, SEARCH_FILTER_ID: l } = ie(), {
|
|
16
16
|
Filters: { activeViewId: c, initFiltersFromView: d, discardChanges: f, initFromUrl: m, filters: F, setFilter: T },
|
package/dist/index39.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("./index61.cjs"),o=require("framer-motion"),m=require("./index60.cjs"),v=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),P=require("mobx-react"),g=require("./index61.cjs"),o=require("framer-motion"),m=require("./index60.cjs"),v=require("./index102.cjs"),f=require("./index41.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/index39.js
CHANGED
|
@@ -3,7 +3,7 @@ import { observer as h } from "mobx-react";
|
|
|
3
3
|
import { useViews as v } from "./index61.js";
|
|
4
4
|
import { AnimatePresence as n } from "framer-motion";
|
|
5
5
|
import { useStores as g } from "./index60.js";
|
|
6
|
-
import { DraftPill as w } from "./
|
|
6
|
+
import { DraftPill as w } from "./index102.js";
|
|
7
7
|
import { UnsavedChangesPill as C } from "./index41.js";
|
|
8
8
|
const U = h(
|
|
9
9
|
({
|
package/dist/index40.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("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react"),m=require("./index101.cjs"),g=require("./index64.cjs"),S=require("./index61.cjs"),b=require("./index4.cjs"),y=require("./index8.cjs"),V=require("./index60.cjs"),p=require("./index11.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/index40.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 "./
|
|
3
|
+
import { LegacySortableViews as w } from "./index101.js";
|
|
4
4
|
import { useCustomViews as d } from "./index64.js";
|
|
5
5
|
import { useViews as g } from "./index61.js";
|
|
6
6
|
import { patchCurrentUser as _ } from "./index4.js";
|
package/dist/index43.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),V=require("mobx-react"),s=require("@veeqo/ui"),t=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),V=require("mobx-react"),s=require("@veeqo/ui"),t=require("./index99.cjs"),j=require("./index40.cjs"),m=require("./index61.cjs"),S=require("./index62.cjs"),q=require("./index36.cjs"),u=require("./index35.cjs"),p=require("./index60.cjs"),a=require("./index11.cjs"),b=V.observer(()=>{const{Views:{draftViewsList:c}}=p.useStores(),{viewsArray:l,fixedViews:d}=m.useViews(),[o,i]=n.useState(!1),[w,x]=n.useState(null),h=()=>i(!1);return S.useViewUrlChange(),e.jsxs(e.Fragment,{children:[e.jsxs(s.ViewsContainer,{onClickMenu:()=>i(!0),ariaMenuControls:"views-menu",ariaMenuExpanded:o,ref:x,children:[l.map(r=>e.jsx(a.ErrorBoundary,{children:e.jsx(u.ViewTab,{view:r})},r.id)),c.map(r=>e.jsx(a.ErrorBoundary,{children:e.jsx(u.ViewTab,{view:r})},r.id))]}),o&&e.jsx(s.Popover,{id:"views-menu",anchorElement:w,placement:"bottom",onShouldClose:()=>i(!1),children:e.jsxs(s.Card.Surface,{children:[e.jsx(t.FixedViews,{children:d.map(r=>e.jsx(s.Text,{variant:"placeholder",children:r.label},r.id||r.label))}),e.jsx(j.SortableViews,{}),e.jsx(t.Divider,{}),e.jsx(q.CreateView,{hideActionsPopover:h})]})})]})});exports.ViewList=b;
|
package/dist/index43.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as i, Fragment as u, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as n } from "react";
|
|
3
3
|
import { observer as h } from "mobx-react";
|
|
4
4
|
import { ViewsContainer as w, Popover as V, Card as v, Text as S } from "@veeqo/ui";
|
|
5
|
-
import { FixedViews as x, Divider as C } from "./
|
|
5
|
+
import { FixedViews as x, Divider as C } from "./index99.js";
|
|
6
6
|
import { SortableViews as b } from "./index40.js";
|
|
7
7
|
import { useViews as A } from "./index61.js";
|
|
8
8
|
import { useViewUrlChange as L } from "./index62.js";
|
package/dist/index66.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),c=require("./index2.cjs"),O=require("./index8.cjs"),w=require("./index60.cjs"),h=()=>{const{SORT_FILTER_ID:r,SORTING_MODE:s}=O.useBusinessLogic(),{Filters:{queryParamsObject:d},Table:{sortParam:o,sortState:e,setSortState:i}}=w.useStores(),f=a.useMemo(()=>{const t=d;switch(s){case c.SortingMode.CORAL:e.columnId&&(t.set("sort_order",e.direction),t.set("sort",e.columnId));break;case c.SortingMode.MONOLITH:default:o&&t.set(r,o)}return t.toString()},[d,o,s,r,e]),u=a.useCallback(()=>{const t=new URLSearchParams(window.location.search);switch(s){case c.SortingMode.CORAL:if(!e.columnId||t.get("sort_order")===e.direction&&t.get("sort")===e.columnId)break;t.set("sort_order",e.direction),t.set("sort",e.columnId);break;case c.SortingMode.MONOLITH:default:if(!o)break;if(t.get(r)===o)return;t.set(r,o)}t.toString()&&window.history.replaceState({},"",`${window.location.pathname}?${t.toString()}`)},[s,r,o,e]),l=a.useCallback(()=>{const t=new URLSearchParams(window.location.search),n=t.get(r),S=t.get("sort_order"),g=t.get("sort");switch(s){case c.SortingMode.CORAL:S&&g&&i({columnId:g,direction:S});break;case c.SortingMode.MONOLITH:default:{if(!n)break;const m=n.startsWith("-"),b=m?"desc":"asc",I=m?n.slice(1):n;i({columnId:I,direction:b})}}},[s,r,i]);return a.useEffect(()=>{l()},[l]),a.useEffect(()=>{u()},[e,u]),{queryParams:f,updateCurrentUrlWithTableSort:u}};exports.useUrlParams=h;
|
package/dist/index66.js
CHANGED
|
@@ -1,24 +1,60 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { SortingMode as
|
|
3
|
-
import { useBusinessLogic as
|
|
4
|
-
import { useStores as
|
|
5
|
-
const
|
|
6
|
-
const { SORT_FILTER_ID:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { useMemo as g, useCallback as f, useEffect as I } from "react";
|
|
2
|
+
import { SortingMode as a } from "./index2.js";
|
|
3
|
+
import { useBusinessLogic as h } from "./index8.js";
|
|
4
|
+
import { useStores as L } from "./index60.js";
|
|
5
|
+
const P = () => {
|
|
6
|
+
const { SORT_FILTER_ID: e, SORTING_MODE: s } = h(), {
|
|
7
|
+
Filters: { queryParamsObject: d },
|
|
8
|
+
Table: { sortParam: o, sortState: r, setSortState: n }
|
|
9
|
+
} = L(), w = g(() => {
|
|
10
|
+
const t = d;
|
|
11
|
+
switch (s) {
|
|
12
|
+
case a.CORAL:
|
|
13
|
+
r.columnId && (t.set("sort_order", r.direction), t.set("sort", r.columnId));
|
|
14
|
+
break;
|
|
15
|
+
case a.MONOLITH:
|
|
16
|
+
default:
|
|
17
|
+
o && t.set(e, o);
|
|
18
|
+
}
|
|
19
|
+
return t.toString();
|
|
20
|
+
}, [d, o, s, e, r]), i = f(() => {
|
|
21
|
+
const t = new URLSearchParams(window.location.search);
|
|
22
|
+
switch (s) {
|
|
23
|
+
case a.CORAL:
|
|
24
|
+
if (!r.columnId || t.get("sort_order") === r.direction && t.get("sort") === r.columnId)
|
|
13
25
|
break;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
26
|
+
t.set("sort_order", r.direction), t.set("sort", r.columnId);
|
|
27
|
+
break;
|
|
28
|
+
case a.MONOLITH:
|
|
29
|
+
default:
|
|
30
|
+
if (!o) break;
|
|
31
|
+
if (t.get(e) === o) return;
|
|
32
|
+
t.set(e, o);
|
|
33
|
+
}
|
|
34
|
+
t.toString() && window.history.replaceState({}, "", `${window.location.pathname}?${t.toString()}`);
|
|
35
|
+
}, [s, e, o, r]), l = f(() => {
|
|
36
|
+
const t = new URLSearchParams(window.location.search), c = t.get(e), u = t.get("sort_order"), m = t.get("sort");
|
|
37
|
+
switch (s) {
|
|
38
|
+
case a.CORAL:
|
|
39
|
+
u && m && n({ columnId: m, direction: u });
|
|
40
|
+
break;
|
|
41
|
+
case a.MONOLITH:
|
|
42
|
+
default: {
|
|
43
|
+
if (!c) break;
|
|
44
|
+
const S = c.startsWith("-"), O = S ? "desc" : "asc", b = S ? c.slice(1) : c;
|
|
45
|
+
n({ columnId: b, direction: O });
|
|
17
46
|
}
|
|
18
|
-
|
|
19
|
-
|
|
47
|
+
}
|
|
48
|
+
}, [s, e, n]);
|
|
49
|
+
return I(() => {
|
|
50
|
+
l();
|
|
51
|
+
}, [l]), I(() => {
|
|
52
|
+
i();
|
|
53
|
+
}, [r, i]), {
|
|
54
|
+
queryParams: w,
|
|
55
|
+
updateCurrentUrlWithTableSort: i
|
|
20
56
|
};
|
|
21
57
|
};
|
|
22
58
|
export {
|
|
23
|
-
|
|
59
|
+
P as useUrlParams
|
|
24
60
|
};
|
package/dist/index67.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var O=Object.defineProperty;var V=(A,t,a)=>t in A?O(A,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):A[t]=a;var g=(A,t,a)=>V(A,typeof t!="symbol"?t+"":t,a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("mobx"),L=require("@veeqo/ui"),I=require("@internationalized/date"),B=require("lodash/isEqual"),p=require("./index48.cjs"),P=require("./index2.cjs"),w=require("./index69.cjs"),N=require("./index68.cjs"),G=require("./index78.cjs"),q=require("./index76.cjs"),b=require("./index9.cjs"),z=A=>A&&A.__esModule?A:{default:A},C=z(B);class ${constructor(){g(this,"defaultPageSize");g(this,"pageSize");g(this,"currentPage");g(this,"defaultFilters");g(this,"defaultArrayFilters");g(this,"defaultDateRangeFilters");g(this,"defaultNumberRangeFilters");g(this,"filters");g(this,"arrayFilters");g(this,"dateRangeFilters");g(this,"numberRangeFilters");g(this,"activeViewId");g(this,"isFiltersDropdownVisible");g(this,"initDefaultFilterMaps",()=>{this.defaultFilters=new Map(this.filters),this.defaultArrayFilters=new Map(this.arrayFilters),this.defaultDateRangeFilters=new Map(this.dateRangeFilters),this.defaultNumberRangeFilters=new Map(this.numberRangeFilters)});g(this,"updateUrl",(t=!1)=>{try{const{SORT_FILTER_ID:a,SORTING_MODE:r}=b.BusinessLogicManager.getBusinessLogic(),e=new URLSearchParams(window.location.search),i=e.get(a),n=e.get("sort_order"),f=e.get("sort");let c;switch(r){case P.SortingMode.CORAL:if(i&&n&&f){const m=this.queryParamsObject;m.set("sort",f),m.set("sort_order",n),c=`${window.location.pathname}?${m.toString()}`}break;case P.SortingMode.MONOLITH:default:if(i){const m=this.queryParamsObject;m.set(a,i),c=`${window.location.pathname}?${m.toString()}`}}i||(c=`${window.location.pathname}?${this.queryParams}`),t?window.history.pushState({},"",c):window.history.replaceState({},"",c)}catch(a){console.log(a)}});g(this,"setCurrentPage",t=>{this.currentPage=t});g(this,"setPageSize",t=>{this.pageSize=t,this.updateUrl()});g(this,"setFilter",(t,a)=>{this.filters.set(t,a),this.updateUrl()});g(this,"clearFilter",t=>{this.filters.set(t,""),this.updateUrl()});g(this,"setArrayFilter",(t,a)=>{this.arrayFilters.set(t,a),this.updateUrl()});g(this,"clearArrayFilter",t=>{this.arrayFilters.set(t,[]),this.updateUrl()});g(this,"setRangeFilter",({key:t,range:a,dates:r})=>{a.setFilterType(t),a.setDates(r.start,r.end),this.updateUrl()});g(this,"clearRangeFilter",t=>{const a=this.dateRangeFilters.get(t);a&&(a.clear(),this.updateUrl())});g(this,"setNumberRangeFilter",({numberRange:t,gte:a,lte:r})=>{t.setGte(a),t.setLte(r),this.updateUrl()});g(this,"clearNumberRangeFilter",t=>{const a=this.numberRangeFilters.get(t);a&&(a.clear(),this.updateUrl())});g(this,"clearAllFilters",(t=!1)=>{const{SEARCH_FILTER_ID:a}=b.BusinessLogicManager.getBusinessLogic();this.filters.forEach((r,e)=>{e!==a&&this.filters.set(e,"")}),this.arrayFilters.forEach((r,e)=>this.arrayFilters.set(e,[])),this.dateRangeFilters.forEach(r=>r.clear()),this.numberRangeFilters.forEach(r=>r.clear()),t||this.updateUrl()});g(this,"clearFiltersForGroup",t=>{const{GROUP_MAP:a}=b.BusinessLogicManager.getBusinessLogic(),r=a.get(t);r&&r.fields.forEach(e=>{this.arrayFilters.has(e.id)?this.clearArrayFilter(e.id):this.dateRangeFilters.has(e.id)?this.clearRangeFilter(e.id):this.numberRangeFilters.has(e.id)?this.clearNumberRangeFilter(e.id):this.clearFilter(e.id)})});g(this,"setActiveViewId",t=>{this.activeViewId=t,this.updateUrl()});g(this,"toggleFiltersDropdownVisible",t=>{this.isFiltersDropdownVisible=t});g(this,"getFiltersForGroup",t=>{const{GROUP_MAP:a}=b.BusinessLogicManager.getBusinessLogic(),r=a.get(t);if(!r)return{};const e={};return r.fields.forEach(i=>{this.arrayFilters.has(i.id)?e[i.id]=this.arrayFilters.get(i.id):this.dateRangeFilters.has(i.id)?e[i.id]=this.dateRangeFilters.get(i.id):this.numberRangeFilters.has(i.id)?e[i.id]=this.numberRangeFilters.get(i.id):e[i.id]=this.filters.get(i.id)}),e});g(this,"initFiltersFromView",t=>{var r;const{PAGE_SIZE_OPTIONS:a}=b.BusinessLogicManager.getBusinessLogic();(r=t.page)!=null&&r.size&&a.includes(t.page.size)&&(this.defaultPageSize=t.page.size,this.pageSize=t.page.size),this.defaultFilters=new Map(t.filterMaps.filters),this.defaultArrayFilters=new Map(t.filterMaps.arrayFilters),this.defaultDateRangeFilters=new Map(Array.from(t.filterMaps.rangeFilters.entries()).map(([e,i])=>{const n=new w.RangeFilter(i.filterType);return i.gte&&i.lte&&n.setDates(i.gte,i.lte),[e,n]})),this.defaultNumberRangeFilters=new Map(Array.from(t.filterMaps.numberRangeFilters.entries()).map(([e,i])=>{const n=i.clone();return i.gte&&n.setGte(i.gte),i.lte&&n.setLte(i.lte),[e,n]})),this.filters=new Map(t.filterMaps.filters),this.arrayFilters=new Map(t.filterMaps.arrayFilters),this.dateRangeFilters=new Map(Array.from(t.filterMaps.rangeFilters.entries()).map(([e,i])=>{const n=new w.RangeFilter(i.filterType);return i.gte&&i.lte&&n.setDates(i.gte,i.lte),[e,n]})),this.numberRangeFilters=new Map(Array.from(t.filterMaps.numberRangeFilters.entries()).map(([e,i])=>{const n=i.clone();return i.gte&&n.setGte(i.gte),i.lte&&n.setLte(i.lte),[e,n]})),this.activeViewId=t.id});g(this,"initFromUrl",(t=!0)=>{const{GROUP_MAP:a,NUMBER_RANGE_FILTERS:r,DATE_RANGE_FILTERS:e,PAGE_SIZE_OPTIONS:i,PAGE_SIZE_FILTER_ID:n}=b.BusinessLogicManager.getBusinessLogic(),f=new URLSearchParams(window.location.search),c=Array.from(a.values()).flatMap(s=>s.fields),m=new Map,R=new Map,M=new Map,h=new Map,l=new Map;Array.from(f.entries()).forEach(([s,u])=>{(s.includes("[gte]")||s.includes("[lte]")||s.includes("[relative]"))&&l.set(s,u)}),Array.from(f.entries()).forEach(([s,u])=>{if(s==="view"&&t){this.activeViewId=u;return}if(s===n&&i.includes(Number(u))){this.pageSize=Number(u);return}let y=c.find(F=>F.id===s);const d=s.replace(/\[(gte|lte|relative)\]$/,"");if(y||(r.includes(d)?y=c.find(F=>F.id===d):e.includes(d)&&(y=c.find(F=>F.id===d))),!!y)switch(y.filterType){case p.FilterChoiceValue.CHECKBOX:u&&R.set(s,u.split(","));break;case p.FilterChoiceValue.DATE_RANGE:let F;if(q.isValidDateRange(u))F=new w.RangeFilter(u);else{const _=l.get(`${d}[gte]`),D=l.get(`${d}[lte]`);if(_&&D)try{const U=I.parseDate(_),v=I.parseDate(D);F=new w.RangeFilter("CUSTOM"),F.setDates(U,v)}catch{F=new w.RangeFilter(L.DateRanges.TODAY)}else F=new w.RangeFilter(L.DateRanges.TODAY)}M.set(d,F);break;case p.FilterChoiceValue.NUMBER_RANGE:const E=new N.NumberRangeFilter({filterId:y.id}),S=l.get(`${d}[gte]`),T=l.get(`${d}[lte]`);S&&E.setGte(Number(S)),T&&E.setLte(Number(T)),h.set(d,E);break;case p.FilterChoiceValue.TEXT:case p.FilterChoiceValue.NUMBER:case p.FilterChoiceValue.RADIO:m.set(s,u);break}}),this.filters=m,this.arrayFilters=R,this.dateRangeFilters=M,this.numberRangeFilters=h,this.updateUrl()});g(this,"discardChanges",(t=!1)=>{this.pageSize=this.defaultPageSize;const{SEARCH_FILTER_ID:a}=b.BusinessLogicManager.getBusinessLogic(),r=new Map(this.defaultFilters);this.filters.has(a)&&r.set(a,this.filters.get(a)),this.filters=r,this.arrayFilters=new Map(this.defaultArrayFilters),this.dateRangeFilters.clear(),this.defaultDateRangeFilters.forEach((e,i)=>{const n=new w.RangeFilter(e.filterType);n.setDates(e.gte,e.lte),this.dateRangeFilters.set(i,n)}),this.numberRangeFilters.clear(),this.defaultNumberRangeFilters.forEach((e,i)=>{this.numberRangeFilters.set(i,e.clone())}),this.updateUrl(t)});const{GROUP_MAP:t}=b.BusinessLogicManager.getBusinessLogic(),a=Array.from(t.values()).flatMap(r=>r.fields);this.filters=new Map(a.filter(r=>r.filterType===p.FilterChoiceValue.TEXT||r.filterType===p.FilterChoiceValue.NUMBER||r.filterType===p.FilterChoiceValue.RADIO||r.filterType===p.FilterChoiceValue.DATE_RANGE).map(r=>[r.id,""])),this.arrayFilters=new Map(a.filter(r=>r.filterType===p.FilterChoiceValue.CHECKBOX).map(r=>[r.id,[]])),this.dateRangeFilters=new Map(a.filter(r=>r.filterType===p.FilterChoiceValue.DATE_RANGE).map(r=>[r.id,new w.RangeFilter])),this.numberRangeFilters=new Map(a.filter(r=>r.filterType===p.FilterChoiceValue.NUMBER_RANGE).map(r=>{const e=new N.NumberRangeFilter({filterId:r.id});return[r.id,e]})),this.defaultArrayFilters=new Map,this.defaultFilters=new Map,this.defaultDateRangeFilters=new Map,this.defaultNumberRangeFilters=new Map,this.currentPage=1,this.pageSize=10,this.defaultPageSize=10,this.initDefaultFilterMaps(),this.isFiltersDropdownVisible=!1,this.activeViewId=void 0,o.makeObservable(this,{defaultPageSize:o.observable,pageSize:o.observable,currentPage:o.observable,defaultFilters:o.observable,defaultArrayFilters:o.observable,defaultDateRangeFilters:o.observable,defaultNumberRangeFilters:o.observable,filters:o.observable,arrayFilters:o.observable,numberRangeFilters:o.observable,dateRangeFilters:o.observable,isFiltersDropdownVisible:o.observable,activeViewId:o.observable,setPageSize:o.action,setCurrentPage:o.action,toggleFiltersDropdownVisible:o.action,setActiveViewId:o.action,setFilter:o.action,setArrayFilter:o.action,setRangeFilter:o.action,setNumberRangeFilter:o.action,clearFilter:o.action,clearArrayFilter:o.action,clearRangeFilter:o.action,clearNumberRangeFilter:o.action,clearAllFilters:o.action,getFiltersForGroup:o.action,clearFiltersForGroup:o.action,initFromUrl:o.action,initFiltersFromView:o.action,initDefaultFilterMaps:o.action,discardChanges:o.action,updateUrl:o.action,hasActiveFilters:o.computed,activeFilterKeysList:o.computed,queryParamsObject:o.computed,queryParams:o.computed,hasUnsavedChanges:o.computed})}get hasActiveFilters(){const{GROUP_MAP:t}=b.BusinessLogicManager.getBusinessLogic(),a=Array.from(t.values()).flatMap(e=>e.fields),r=new Set(a.map(e=>e.id));return Array.from(this.filters.entries()).filter(([e])=>r.has(e)).some(([,e])=>e!=="")||Array.from(this.arrayFilters.entries()).filter(([e])=>r.has(e)).some(([,e])=>e.length>0)||Array.from(this.dateRangeFilters.entries()).filter(([e])=>r.has(e)).some(([,e])=>e.filterType!==void 0)||Array.from(this.numberRangeFilters.entries()).filter(([e])=>r.has(e)).some(([,e])=>e.isActive)}get activeFilterKeysList(){const{DATE_RANGE_FILTERS:t,NUMBER_RANGE_FILTERS:a}=b.BusinessLogicManager.getBusinessLogic(),r=Array.from(this.filters.entries()).filter(([c,m])=>m!==""&&!t.includes(c)&&!a.includes(c)).map(([c])=>c),e=Array.from(this.arrayFilters.entries()).filter(([,c])=>c.length>0).map(([c])=>c),i=Array.from(this.dateRangeFilters.entries()).filter(([,c])=>c.filterType!==void 0).map(([c])=>c),n=Array.from(this.numberRangeFilters.entries()).filter(([,c])=>c.isActive).map(([c])=>c);return[...new Set([...r,...e,...i,...n])]}get queryParamsObject(){const{DATE_RANGE_FILTERS:t,NUMBER_RANGE_FILTERS:a,PAGE_SIZE_FILTER_ID:r,PAGE_NUMBER_FILTER_ID:e}=b.BusinessLogicManager.getBusinessLogic(),i=new URLSearchParams;return Array.from(this.filters.entries()).filter(([n,f])=>f!==""&&!t.includes(n)&&!a.includes(n)).forEach(([n,f])=>{i.append(n,f)}),Array.from(this.arrayFilters.entries()).filter(([,n])=>n.length>0).forEach(([n,f])=>{i.append(n,f.join(","))}),Array.from(this.dateRangeFilters.entries()).filter(([,n])=>n.filterType!==void 0).forEach(([n,f])=>{f.filterType==="CUSTOM"?(i.set(`${n}[gte]`,f.gte.toString()),i.set(`${n}[lte]`,f.lte.toString())):i.set(`${n}[relative]`,f.filterType)}),Array.from(this.numberRangeFilters.entries()).filter(([,n])=>n.isActive).forEach(([n,f])=>{f.gte!==void 0&&i.set(`${n}[gte]`,f.gte.toString()),f.isValidLte&&i.set(`${n}[lte]`,f.lte.toString())}),this.activeViewId&&i.set("view",this.activeViewId),i.set(r,this.pageSize.toString()),i.set(e,this.currentPage.toString()),i}get queryParams(){return this.queryParamsObject.toString()}get hasUnsavedChanges(){if(this.activeViewId===G.ALL_VIEW_ID)return!1;if(this.defaultPageSize!==this.pageSize)return!0;const{GROUP_MAP:t,SEARCH_FILTER_ID:a}=b.BusinessLogicManager.getBusinessLogic(),r=Array.from(t.values()).flatMap(h=>h.fields),e=new Set(r.map(h=>h.id));if(Array.from(this.filters.entries()).filter(([h])=>h!==a&&e.has(h)).some(([h,l])=>{const s=this.defaultFilters.get(h);return s===void 0&&l!==""||s!==void 0&&l!==s}))return!0;const n=Array.from(this.defaultArrayFilters.entries()).filter(([h])=>e.has(h)).some(([h,l])=>{const s=this.defaultArrayFilters.get(h)||[];return l.length>0||s.length>0?l.length!==s.length||!C.default(l,s):!1}),f=Array.from(this.arrayFilters.entries()).filter(([h])=>e.has(h)).some(([h,l])=>{const s=this.defaultArrayFilters.get(h)||[];return l.length>0||s.length>0?l.length!==s.length||!C.default(l,s):!1});if(n||f)return!0;const c=Array.from(this.numberRangeFilters.entries()).filter(([h])=>e.has(h)).some(([h,l])=>{const s=this.defaultNumberRangeFilters.get(h);return!l.isEqual(s)});if(Array.from(this.defaultNumberRangeFilters.entries()).filter(([h])=>e.has(h)).some(([h,l])=>{const s=this.numberRangeFilters.get(h);return!l.isEqual(s)})||c)return!0;const R=Array.from(this.defaultDateRangeFilters.entries()).filter(([h])=>e.has(h)).some(([h,l])=>{var u,y,d,F;const s=this.dateRangeFilters.get(h);return l!=null&&l.filterType&&!(s!=null&&s.filterType)||s!=null&&s.filterType&&!(l!=null&&l.filterType)||(s==null?void 0:s.filterType)!==(l==null?void 0:l.filterType)?!0:(s==null?void 0:s.filterType)==="CUSTOM"&&(l==null?void 0:l.filterType)==="CUSTOM"?((u=l.gte)==null?void 0:u.toString())!==((y=s.gte)==null?void 0:y.toString())||((d=l.lte)==null?void 0:d.toString())!==((F=s.lte)==null?void 0:F.toString()):!1});return Array.from(this.dateRangeFilters.entries()).filter(([h])=>e.has(h)).some(([h,l])=>{var u,y,d,F;const s=this.defaultDateRangeFilters.get(h);return l!=null&&l.filterType&&!(s!=null&&s.filterType)||s!=null&&s.filterType&&!(l!=null&&l.filterType)||(s==null?void 0:s.filterType)!==(l==null?void 0:l.filterType)?!0:(s==null?void 0:s.filterType)==="CUSTOM"&&(l==null?void 0:l.filterType)==="CUSTOM"?((u=l.gte)==null?void 0:u.toString())!==((y=s.gte)==null?void 0:y.toString())||((d=l.lte)==null?void 0:d.toString())!==((F=s.lte)==null?void 0:F.toString()):!1})||R}}exports.Filters=$;
|
|
1
|
+
"use strict";var O=Object.defineProperty;var V=(A,t,a)=>t in A?O(A,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):A[t]=a;var g=(A,t,a)=>V(A,typeof t!="symbol"?t+"":t,a);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("mobx"),L=require("@veeqo/ui"),I=require("@internationalized/date"),B=require("lodash/isEqual"),p=require("./index48.cjs"),P=require("./index2.cjs"),w=require("./index69.cjs"),N=require("./index68.cjs"),G=require("./index78.cjs"),q=require("./index76.cjs"),b=require("./index9.cjs"),z=A=>A&&A.__esModule?A:{default:A},C=z(B);class ${constructor(){g(this,"defaultPageSize");g(this,"pageSize");g(this,"currentPage");g(this,"defaultFilters");g(this,"defaultArrayFilters");g(this,"defaultDateRangeFilters");g(this,"defaultNumberRangeFilters");g(this,"filters");g(this,"arrayFilters");g(this,"dateRangeFilters");g(this,"numberRangeFilters");g(this,"activeViewId");g(this,"isFiltersDropdownVisible");g(this,"initDefaultFilterMaps",()=>{this.defaultFilters=new Map(this.filters),this.defaultArrayFilters=new Map(this.arrayFilters),this.defaultDateRangeFilters=new Map(this.dateRangeFilters),this.defaultNumberRangeFilters=new Map(this.numberRangeFilters)});g(this,"updateUrl",(t=!1)=>{try{const{SORT_FILTER_ID:a,SORTING_MODE:r}=b.BusinessLogicManager.getBusinessLogic(),e=new URLSearchParams(window.location.search),i=e.get(a),n=e.get("sort_order"),f=e.get("sort");let c="";switch(r){case P.SortingMode.CORAL:if(n&&f){const m=this.queryParamsObject;m.set("sort",f),m.set("sort_order",n),c=`${window.location.pathname}?${m.toString()}`}break;case P.SortingMode.MONOLITH:default:if(i){const m=this.queryParamsObject;m.set(a,i),c=`${window.location.pathname}?${m.toString()}`}}i||(c=`${window.location.pathname}?${this.queryParams}`),t?window.history.pushState({},"",c):window.history.replaceState({},"",c)}catch(a){console.log(a)}});g(this,"setCurrentPage",t=>{this.currentPage=t});g(this,"setPageSize",t=>{this.pageSize=t,this.updateUrl()});g(this,"setFilter",(t,a)=>{this.filters.set(t,a),this.updateUrl()});g(this,"clearFilter",t=>{this.filters.set(t,""),this.updateUrl()});g(this,"setArrayFilter",(t,a)=>{this.arrayFilters.set(t,a),this.updateUrl()});g(this,"clearArrayFilter",t=>{this.arrayFilters.set(t,[]),this.updateUrl()});g(this,"setRangeFilter",({key:t,range:a,dates:r})=>{a.setFilterType(t),a.setDates(r.start,r.end),this.updateUrl()});g(this,"clearRangeFilter",t=>{const a=this.dateRangeFilters.get(t);a&&(a.clear(),this.updateUrl())});g(this,"setNumberRangeFilter",({numberRange:t,gte:a,lte:r})=>{t.setGte(a),t.setLte(r),this.updateUrl()});g(this,"clearNumberRangeFilter",t=>{const a=this.numberRangeFilters.get(t);a&&(a.clear(),this.updateUrl())});g(this,"clearAllFilters",(t=!1)=>{const{SEARCH_FILTER_ID:a}=b.BusinessLogicManager.getBusinessLogic();this.filters.forEach((r,e)=>{e!==a&&this.filters.set(e,"")}),this.arrayFilters.forEach((r,e)=>this.arrayFilters.set(e,[])),this.dateRangeFilters.forEach(r=>r.clear()),this.numberRangeFilters.forEach(r=>r.clear()),t||this.updateUrl()});g(this,"clearFiltersForGroup",t=>{const{GROUP_MAP:a}=b.BusinessLogicManager.getBusinessLogic(),r=a.get(t);r&&r.fields.forEach(e=>{this.arrayFilters.has(e.id)?this.clearArrayFilter(e.id):this.dateRangeFilters.has(e.id)?this.clearRangeFilter(e.id):this.numberRangeFilters.has(e.id)?this.clearNumberRangeFilter(e.id):this.clearFilter(e.id)})});g(this,"setActiveViewId",t=>{this.activeViewId=t,this.updateUrl()});g(this,"toggleFiltersDropdownVisible",t=>{this.isFiltersDropdownVisible=t});g(this,"getFiltersForGroup",t=>{const{GROUP_MAP:a}=b.BusinessLogicManager.getBusinessLogic(),r=a.get(t);if(!r)return{};const e={};return r.fields.forEach(i=>{this.arrayFilters.has(i.id)?e[i.id]=this.arrayFilters.get(i.id):this.dateRangeFilters.has(i.id)?e[i.id]=this.dateRangeFilters.get(i.id):this.numberRangeFilters.has(i.id)?e[i.id]=this.numberRangeFilters.get(i.id):e[i.id]=this.filters.get(i.id)}),e});g(this,"initFiltersFromView",t=>{var r;const{PAGE_SIZE_OPTIONS:a}=b.BusinessLogicManager.getBusinessLogic();(r=t.page)!=null&&r.size&&a.includes(t.page.size)&&(this.defaultPageSize=t.page.size,this.pageSize=t.page.size),this.defaultFilters=new Map(t.filterMaps.filters),this.defaultArrayFilters=new Map(t.filterMaps.arrayFilters),this.defaultDateRangeFilters=new Map(Array.from(t.filterMaps.rangeFilters.entries()).map(([e,i])=>{const n=new w.RangeFilter(i.filterType);return i.gte&&i.lte&&n.setDates(i.gte,i.lte),[e,n]})),this.defaultNumberRangeFilters=new Map(Array.from(t.filterMaps.numberRangeFilters.entries()).map(([e,i])=>{const n=i.clone();return i.gte&&n.setGte(i.gte),i.lte&&n.setLte(i.lte),[e,n]})),this.filters=new Map(t.filterMaps.filters),this.arrayFilters=new Map(t.filterMaps.arrayFilters),this.dateRangeFilters=new Map(Array.from(t.filterMaps.rangeFilters.entries()).map(([e,i])=>{const n=new w.RangeFilter(i.filterType);return i.gte&&i.lte&&n.setDates(i.gte,i.lte),[e,n]})),this.numberRangeFilters=new Map(Array.from(t.filterMaps.numberRangeFilters.entries()).map(([e,i])=>{const n=i.clone();return i.gte&&n.setGte(i.gte),i.lte&&n.setLte(i.lte),[e,n]})),this.activeViewId=t.id});g(this,"initFromUrl",(t=!0)=>{const{GROUP_MAP:a,NUMBER_RANGE_FILTERS:r,DATE_RANGE_FILTERS:e,PAGE_SIZE_OPTIONS:i,PAGE_SIZE_FILTER_ID:n}=b.BusinessLogicManager.getBusinessLogic(),f=new URLSearchParams(window.location.search),c=Array.from(a.values()).flatMap(s=>s.fields),m=new Map,R=new Map,M=new Map,h=new Map,l=new Map;Array.from(f.entries()).forEach(([s,u])=>{(s.includes("[gte]")||s.includes("[lte]")||s.includes("[relative]"))&&l.set(s,u)}),Array.from(f.entries()).forEach(([s,u])=>{if(s==="view"&&t){this.activeViewId=u;return}if(s===n&&i.includes(Number(u))){this.pageSize=Number(u);return}let y=c.find(F=>F.id===s);const d=s.replace(/\[(gte|lte|relative)\]$/,"");if(y||(r.includes(d)?y=c.find(F=>F.id===d):e.includes(d)&&(y=c.find(F=>F.id===d))),!!y)switch(y.filterType){case p.FilterChoiceValue.CHECKBOX:u&&R.set(s,u.split(","));break;case p.FilterChoiceValue.DATE_RANGE:let F;if(q.isValidDateRange(u))F=new w.RangeFilter(u);else{const _=l.get(`${d}[gte]`),D=l.get(`${d}[lte]`);if(_&&D)try{const U=I.parseDate(_),v=I.parseDate(D);F=new w.RangeFilter("CUSTOM"),F.setDates(U,v)}catch{F=new w.RangeFilter(L.DateRanges.TODAY)}else F=new w.RangeFilter(L.DateRanges.TODAY)}M.set(d,F);break;case p.FilterChoiceValue.NUMBER_RANGE:const E=new N.NumberRangeFilter({filterId:y.id}),S=l.get(`${d}[gte]`),T=l.get(`${d}[lte]`);S&&E.setGte(Number(S)),T&&E.setLte(Number(T)),h.set(d,E);break;case p.FilterChoiceValue.TEXT:case p.FilterChoiceValue.NUMBER:case p.FilterChoiceValue.RADIO:m.set(s,u);break}}),this.filters=m,this.arrayFilters=R,this.dateRangeFilters=M,this.numberRangeFilters=h,this.updateUrl()});g(this,"discardChanges",(t=!1)=>{this.pageSize=this.defaultPageSize;const{SEARCH_FILTER_ID:a}=b.BusinessLogicManager.getBusinessLogic(),r=new Map(this.defaultFilters);this.filters.has(a)&&r.set(a,this.filters.get(a)),this.filters=r,this.arrayFilters=new Map(this.defaultArrayFilters),this.dateRangeFilters.clear(),this.defaultDateRangeFilters.forEach((e,i)=>{const n=new w.RangeFilter(e.filterType);n.setDates(e.gte,e.lte),this.dateRangeFilters.set(i,n)}),this.numberRangeFilters.clear(),this.defaultNumberRangeFilters.forEach((e,i)=>{this.numberRangeFilters.set(i,e.clone())}),this.updateUrl(t)});const{GROUP_MAP:t}=b.BusinessLogicManager.getBusinessLogic(),a=Array.from(t.values()).flatMap(r=>r.fields);this.filters=new Map(a.filter(r=>r.filterType===p.FilterChoiceValue.TEXT||r.filterType===p.FilterChoiceValue.NUMBER||r.filterType===p.FilterChoiceValue.RADIO||r.filterType===p.FilterChoiceValue.DATE_RANGE).map(r=>[r.id,""])),this.arrayFilters=new Map(a.filter(r=>r.filterType===p.FilterChoiceValue.CHECKBOX).map(r=>[r.id,[]])),this.dateRangeFilters=new Map(a.filter(r=>r.filterType===p.FilterChoiceValue.DATE_RANGE).map(r=>[r.id,new w.RangeFilter])),this.numberRangeFilters=new Map(a.filter(r=>r.filterType===p.FilterChoiceValue.NUMBER_RANGE).map(r=>{const e=new N.NumberRangeFilter({filterId:r.id});return[r.id,e]})),this.defaultArrayFilters=new Map,this.defaultFilters=new Map,this.defaultDateRangeFilters=new Map,this.defaultNumberRangeFilters=new Map,this.currentPage=1,this.pageSize=10,this.defaultPageSize=10,this.initDefaultFilterMaps(),this.isFiltersDropdownVisible=!1,this.activeViewId=void 0,o.makeObservable(this,{defaultPageSize:o.observable,pageSize:o.observable,currentPage:o.observable,defaultFilters:o.observable,defaultArrayFilters:o.observable,defaultDateRangeFilters:o.observable,defaultNumberRangeFilters:o.observable,filters:o.observable,arrayFilters:o.observable,numberRangeFilters:o.observable,dateRangeFilters:o.observable,isFiltersDropdownVisible:o.observable,activeViewId:o.observable,setPageSize:o.action,setCurrentPage:o.action,toggleFiltersDropdownVisible:o.action,setActiveViewId:o.action,setFilter:o.action,setArrayFilter:o.action,setRangeFilter:o.action,setNumberRangeFilter:o.action,clearFilter:o.action,clearArrayFilter:o.action,clearRangeFilter:o.action,clearNumberRangeFilter:o.action,clearAllFilters:o.action,getFiltersForGroup:o.action,clearFiltersForGroup:o.action,initFromUrl:o.action,initFiltersFromView:o.action,initDefaultFilterMaps:o.action,discardChanges:o.action,updateUrl:o.action,hasActiveFilters:o.computed,activeFilterKeysList:o.computed,queryParamsObject:o.computed,queryParams:o.computed,hasUnsavedChanges:o.computed})}get hasActiveFilters(){const{GROUP_MAP:t}=b.BusinessLogicManager.getBusinessLogic(),a=Array.from(t.values()).flatMap(e=>e.fields),r=new Set(a.map(e=>e.id));return Array.from(this.filters.entries()).filter(([e])=>r.has(e)).some(([,e])=>e!=="")||Array.from(this.arrayFilters.entries()).filter(([e])=>r.has(e)).some(([,e])=>e.length>0)||Array.from(this.dateRangeFilters.entries()).filter(([e])=>r.has(e)).some(([,e])=>e.filterType!==void 0)||Array.from(this.numberRangeFilters.entries()).filter(([e])=>r.has(e)).some(([,e])=>e.isActive)}get activeFilterKeysList(){const{DATE_RANGE_FILTERS:t,NUMBER_RANGE_FILTERS:a}=b.BusinessLogicManager.getBusinessLogic(),r=Array.from(this.filters.entries()).filter(([c,m])=>m!==""&&!t.includes(c)&&!a.includes(c)).map(([c])=>c),e=Array.from(this.arrayFilters.entries()).filter(([,c])=>c.length>0).map(([c])=>c),i=Array.from(this.dateRangeFilters.entries()).filter(([,c])=>c.filterType!==void 0).map(([c])=>c),n=Array.from(this.numberRangeFilters.entries()).filter(([,c])=>c.isActive).map(([c])=>c);return[...new Set([...r,...e,...i,...n])]}get queryParamsObject(){const{DATE_RANGE_FILTERS:t,NUMBER_RANGE_FILTERS:a,PAGE_SIZE_FILTER_ID:r,PAGE_NUMBER_FILTER_ID:e}=b.BusinessLogicManager.getBusinessLogic(),i=new URLSearchParams;return Array.from(this.filters.entries()).filter(([n,f])=>f!==""&&!t.includes(n)&&!a.includes(n)).forEach(([n,f])=>{i.append(n,f)}),Array.from(this.arrayFilters.entries()).filter(([,n])=>n.length>0).forEach(([n,f])=>{i.append(n,f.join(","))}),Array.from(this.dateRangeFilters.entries()).filter(([,n])=>n.filterType!==void 0).forEach(([n,f])=>{f.filterType==="CUSTOM"?(i.set(`${n}[gte]`,f.gte.toString()),i.set(`${n}[lte]`,f.lte.toString())):i.set(`${n}[relative]`,f.filterType)}),Array.from(this.numberRangeFilters.entries()).filter(([,n])=>n.isActive).forEach(([n,f])=>{f.gte!==void 0&&i.set(`${n}[gte]`,f.gte.toString()),f.isValidLte&&i.set(`${n}[lte]`,f.lte.toString())}),this.activeViewId&&i.set("view",this.activeViewId),i.set(r,this.pageSize.toString()),i.set(e,this.currentPage.toString()),i}get queryParams(){return this.queryParamsObject.toString()}get hasUnsavedChanges(){if(this.activeViewId===G.ALL_VIEW_ID)return!1;if(this.defaultPageSize!==this.pageSize)return!0;const{GROUP_MAP:t,SEARCH_FILTER_ID:a}=b.BusinessLogicManager.getBusinessLogic(),r=Array.from(t.values()).flatMap(h=>h.fields),e=new Set(r.map(h=>h.id));if(Array.from(this.filters.entries()).filter(([h])=>h!==a&&e.has(h)).some(([h,l])=>{const s=this.defaultFilters.get(h);return s===void 0&&l!==""||s!==void 0&&l!==s}))return!0;const n=Array.from(this.defaultArrayFilters.entries()).filter(([h])=>e.has(h)).some(([h,l])=>{const s=this.defaultArrayFilters.get(h)||[];return l.length>0||s.length>0?l.length!==s.length||!C.default(l,s):!1}),f=Array.from(this.arrayFilters.entries()).filter(([h])=>e.has(h)).some(([h,l])=>{const s=this.defaultArrayFilters.get(h)||[];return l.length>0||s.length>0?l.length!==s.length||!C.default(l,s):!1});if(n||f)return!0;const c=Array.from(this.numberRangeFilters.entries()).filter(([h])=>e.has(h)).some(([h,l])=>{const s=this.defaultNumberRangeFilters.get(h);return!l.isEqual(s)});if(Array.from(this.defaultNumberRangeFilters.entries()).filter(([h])=>e.has(h)).some(([h,l])=>{const s=this.numberRangeFilters.get(h);return!l.isEqual(s)})||c)return!0;const R=Array.from(this.defaultDateRangeFilters.entries()).filter(([h])=>e.has(h)).some(([h,l])=>{var u,y,d,F;const s=this.dateRangeFilters.get(h);return l!=null&&l.filterType&&!(s!=null&&s.filterType)||s!=null&&s.filterType&&!(l!=null&&l.filterType)||(s==null?void 0:s.filterType)!==(l==null?void 0:l.filterType)?!0:(s==null?void 0:s.filterType)==="CUSTOM"&&(l==null?void 0:l.filterType)==="CUSTOM"?((u=l.gte)==null?void 0:u.toString())!==((y=s.gte)==null?void 0:y.toString())||((d=l.lte)==null?void 0:d.toString())!==((F=s.lte)==null?void 0:F.toString()):!1});return Array.from(this.dateRangeFilters.entries()).filter(([h])=>e.has(h)).some(([h,l])=>{var u,y,d,F;const s=this.defaultDateRangeFilters.get(h);return l!=null&&l.filterType&&!(s!=null&&s.filterType)||s!=null&&s.filterType&&!(l!=null&&l.filterType)||(s==null?void 0:s.filterType)!==(l==null?void 0:l.filterType)?!0:(s==null?void 0:s.filterType)==="CUSTOM"&&(l==null?void 0:l.filterType)==="CUSTOM"?((u=l.gte)==null?void 0:u.toString())!==((y=s.gte)==null?void 0:y.toString())||((d=l.lte)==null?void 0:d.toString())!==((F=s.lte)==null?void 0:F.toString()):!1})||R}}exports.Filters=$;
|
package/dist/index67.js
CHANGED
|
@@ -38,10 +38,10 @@ class te {
|
|
|
38
38
|
h(this, "updateUrl", (t = !1) => {
|
|
39
39
|
try {
|
|
40
40
|
const { SORT_FILTER_ID: a, SORTING_MODE: r } = w.getBusinessLogic(), e = new URLSearchParams(window.location.search), i = e.get(a), n = e.get("sort_order"), F = e.get("sort");
|
|
41
|
-
let f;
|
|
41
|
+
let f = "";
|
|
42
42
|
switch (r) {
|
|
43
43
|
case O.CORAL:
|
|
44
|
-
if (
|
|
44
|
+
if (n && F) {
|
|
45
45
|
const y = this.queryParamsObject;
|
|
46
46
|
y.set("sort", F), y.set("sort_order", n), f = `${window.location.pathname}?${y.toString()}`;
|
|
47
47
|
}
|
package/dist/index96.cjs
CHANGED
|
@@ -1,12 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
padding: 8px;
|
|
5
|
-
padding-left: 35px;
|
|
6
|
-
margin: 8px;
|
|
7
|
-
background-color: ${t.theme.colors.neutral.grey.lightest};
|
|
8
|
-
`,l=r.default.hr`
|
|
9
|
-
width: 100%;
|
|
10
|
-
border-top: 1px solid ${t.theme.colors.neutral.grey.dark};
|
|
11
|
-
margin: 0 0 4px 0;
|
|
12
|
-
`;exports.Divider=l;exports.FixedViews=d;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),n=require("react"),l=require("./index113.cjs"),v=({children:i,style:o,className:c})=>{const r=n.useRef(null),[u,f]=n.useState(0);return n.useEffect(()=>{const e=r.current,s=()=>{if(e){const{top:a}=e.getBoundingClientRect();f(a)}};s();const t=new ResizeObserver(s);return e&&t.observe(e),()=>{e&&t.unobserve(e),t.disconnect()}},[]),d.jsx(l.AdaptiveStyledContainer,{style:o,className:c,offset:u,ref:r,children:i})};exports.AdaptiveHeightContainer=v;
|
package/dist/index96.js
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as a, useState as d, useEffect as m } from "react";
|
|
3
|
+
import { AdaptiveStyledContainer as v } from "./index113.js";
|
|
4
|
+
const R = ({
|
|
5
|
+
children: o,
|
|
6
|
+
style: s,
|
|
7
|
+
className: f
|
|
8
|
+
}) => {
|
|
9
|
+
const r = a(null), [i, c] = d(0);
|
|
10
|
+
return m(() => {
|
|
11
|
+
const e = r.current, n = () => {
|
|
12
|
+
if (e) {
|
|
13
|
+
const { top: u } = e.getBoundingClientRect();
|
|
14
|
+
c(u);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
n();
|
|
18
|
+
const t = new ResizeObserver(n);
|
|
19
|
+
return e && t.observe(e), () => {
|
|
20
|
+
e && t.unobserve(e), t.disconnect();
|
|
21
|
+
};
|
|
22
|
+
}, []), /* @__PURE__ */ p(v, { style: s, className: f, offset: i, ref: r, children: o });
|
|
23
|
+
};
|
|
15
24
|
export {
|
|
16
|
-
|
|
17
|
-
d as FixedViews
|
|
25
|
+
R as AdaptiveHeightContainer
|
|
18
26
|
};
|
package/dist/index97.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),f=require("swr"),R=require("./index60.cjs"),S=require("./index8.cjs"),P=require("./index61.cjs"),h=require("./index54.cjs"),m=e=>e&&e.__esModule?e:{default:e},q=m(f),E=()=>{var r;const{Filters:{queryParams:e}}=R.useStores(),{TABLE_DATA_URL:i,PAGE_NUMBER_FILTER_ID:u,PAGE_SIZE_FILTER_ID:n}=S.useBusinessLogic(),{isLoading:c}=P.useViews(),a=w.useMemo(()=>{const s=new URLSearchParams(e);return s.set(u,"1"),s.set(n,"1"),s.toString()},[e,u,n]),l=!c?`${i}?${a}`:null,{data:t,error:d,isLoading:_,mutate:L}=q.default([l,{includeMeta:!0}],([s,g])=>h.fetcherV2(s,g),{revalidateOnFocus:!1,revalidateOnReconnect:!1,keepPreviousData:!0}),o=t==null?void 0:t.meta;return{viewCounts:(r=o==null?void 0:o.page)==null?void 0:r.total_count,error:d,isLoadingViewCounts:_,mutate:L}};exports.useViewCounts=E;
|
package/dist/index97.js
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { useMemo as _ } from "react";
|
|
2
|
+
import p from "swr";
|
|
3
|
+
import { useStores as w } from "./index60.js";
|
|
4
|
+
import { useBusinessLogic as R } from "./index8.js";
|
|
5
|
+
import { useViews as g } from "./index61.js";
|
|
6
|
+
import { fetcherV2 as E } from "./index54.js";
|
|
7
|
+
const V = () => {
|
|
8
|
+
var i;
|
|
9
|
+
const { Filters: { queryParams: s } } = w(), { TABLE_DATA_URL: a, PAGE_NUMBER_FILTER_ID: r, PAGE_SIZE_FILTER_ID: n } = R(), { isLoading: u } = g(), c = _(() => {
|
|
10
|
+
const e = new URLSearchParams(s);
|
|
11
|
+
return e.set(r, "1"), e.set(n, "1"), e.toString();
|
|
12
|
+
}, [s, r, n]), m = !u ? `${a}?${c}` : null, {
|
|
13
|
+
data: t,
|
|
14
|
+
error: l,
|
|
15
|
+
isLoading: L,
|
|
16
|
+
mutate: d
|
|
17
|
+
} = p(
|
|
18
|
+
[m, { includeMeta: !0 }],
|
|
19
|
+
([e, f]) => E(e, f),
|
|
13
20
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
children: "Create view"
|
|
21
|
+
revalidateOnFocus: !1,
|
|
22
|
+
revalidateOnReconnect: !1,
|
|
23
|
+
keepPreviousData: !0
|
|
18
24
|
}
|
|
19
|
-
)
|
|
20
|
-
|
|
25
|
+
), o = t == null ? void 0 : t.meta;
|
|
26
|
+
return {
|
|
27
|
+
viewCounts: (i = o == null ? void 0 : o.page) == null ? void 0 : i.total_count,
|
|
28
|
+
error: l,
|
|
29
|
+
isLoadingViewCounts: L,
|
|
30
|
+
mutate: d
|
|
31
|
+
};
|
|
32
|
+
};
|
|
21
33
|
export {
|
|
22
|
-
|
|
34
|
+
V as useViewCounts
|
|
23
35
|
};
|
package/dist/index98.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@veeqo/ui"),r=({shouldShow:a,viewName:n,onCancel:t,onDelete:o})=>e.jsx(i.Modal,{headerTitle:`Delete '${n}' view?`,"data-testid":"act-react-listing-custom-confirmation-popup",variant:"sm",shouldShow:a,onClose:t,rightActions:[{className:"act-react-listing-custom-confirmation-popup-cancel",label:"Cancel",onClick:t,variant:"default"},{className:"act-react-listing-custom-confirmation-popup-delete",label:"Delete",onClick:o,variant:"primaryDestructive"}],showHeaderCloseButton:!0,children:e.jsx(i.Text,{variant:"body",children:"This cannot be undone."})});exports.Confirmation=r;
|
package/dist/index98.js
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Modal as n, Text as r } from "@veeqo/ui";
|
|
3
|
+
const s = ({ shouldShow: a, viewName: i, onCancel: t, onDelete: o }) => /* @__PURE__ */ e(
|
|
4
|
+
n,
|
|
5
|
+
{
|
|
6
|
+
headerTitle: `Delete '${i}' view?`,
|
|
7
|
+
"data-testid": "act-react-listing-custom-confirmation-popup",
|
|
8
|
+
variant: "sm",
|
|
9
|
+
shouldShow: a,
|
|
10
|
+
onClose: t,
|
|
11
|
+
rightActions: [
|
|
12
|
+
{
|
|
13
|
+
className: "act-react-listing-custom-confirmation-popup-cancel",
|
|
14
|
+
label: "Cancel",
|
|
15
|
+
onClick: t,
|
|
16
|
+
variant: "default"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
className: "act-react-listing-custom-confirmation-popup-delete",
|
|
20
|
+
label: "Delete",
|
|
21
|
+
onClick: o,
|
|
22
|
+
variant: "primaryDestructive"
|
|
15
23
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
}, []), /* @__PURE__ */ p(v, { style: s, className: f, offset: i, ref: r, children: o });
|
|
23
|
-
};
|
|
24
|
+
],
|
|
25
|
+
showHeaderCloseButton: !0,
|
|
26
|
+
children: /* @__PURE__ */ e(r, { variant: "body", children: "This cannot be undone." })
|
|
27
|
+
}
|
|
28
|
+
);
|
|
24
29
|
export {
|
|
25
|
-
|
|
30
|
+
s as Confirmation
|
|
26
31
|
};
|
package/dist/index99.cjs
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("styled-components"),t=require("@veeqo/ui"),o=e=>e&&e.__esModule?e:{default:e},r=o(i),d=r.default(t.BaseContainer)`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
padding: 8px;
|
|
5
|
+
padding-left: 35px;
|
|
6
|
+
margin: 8px;
|
|
7
|
+
background-color: ${t.theme.colors.neutral.grey.lightest};
|
|
8
|
+
`,l=r.default.hr`
|
|
9
|
+
width: 100%;
|
|
10
|
+
border-top: 1px solid ${t.theme.colors.neutral.grey.dark};
|
|
11
|
+
margin: 0 0 4px 0;
|
|
12
|
+
`;exports.Divider=l;exports.FixedViews=d;
|
package/dist/index99.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import r from "styled-components";
|
|
2
|
+
import { theme as o, BaseContainer as e } from "@veeqo/ui";
|
|
3
|
+
const d = r(e)`
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
padding: 8px;
|
|
7
|
+
padding-left: 35px;
|
|
8
|
+
margin: 8px;
|
|
9
|
+
background-color: ${o.colors.neutral.grey.lightest};
|
|
10
|
+
`, l = r.hr`
|
|
11
|
+
width: 100%;
|
|
12
|
+
border-top: 1px solid ${o.colors.neutral.grey.dark};
|
|
13
|
+
margin: 0 0 4px 0;
|
|
14
|
+
`;
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
l as Divider,
|
|
17
|
+
d as FixedViews
|
|
17
18
|
};
|