@veeqo/transfigure 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -53
- package/dist/BusinessLogic/mocks.d.ts +3 -3
- package/dist/BusinessLogic/types.d.ts +3 -2
- package/dist/components/Filters/ActiveFilters/Categories/index.d.ts +2 -0
- package/dist/components/Filters/ActiveFilters/Variants/ActiveAsyncCheckboxFilter/ActiveAsyncCheckboxFilter.d.ts +8 -0
- package/dist/components/Filters/ActiveFilters/Variants/ActiveAsyncCheckboxFilter/index.d.ts +1 -0
- package/dist/components/Filters/ActiveFilters/Variants/ActiveAsyncRadioFilter/ActiveAsyncRadioFilter.d.ts +8 -0
- package/dist/components/Filters/ActiveFilters/Variants/ActiveAsyncRadioFilter/index.d.ts +1 -0
- package/dist/components/Filters/{Fields → ActiveFilters/Variants/ActiveFilterNumberRangeTag}/FilterNumberRangeFilter/FilterNumberRangeFilter.d.ts +1 -1
- package/dist/components/Filters/ActiveFilters/Variants/index.d.ts +5 -0
- package/dist/components/Filters/ActiveFilters/index.d.ts +2 -3
- package/dist/components/Filters/Fields/index.d.ts +0 -6
- package/dist/components/Filters/{Fields/FilterGroup → FilterGroup}/FilterGroup.d.ts +1 -1
- package/dist/components/Filters/FilterGroup/index.d.ts +1 -0
- package/dist/components/Filters/index.d.ts +1 -0
- package/dist/components/TableControls/TableControls.d.ts +1 -0
- package/dist/components/TableControls/index.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +75 -75
- package/dist/index10.js +3 -12
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +19 -19
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +42 -21
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +23 -38
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +39 -37
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +36 -54
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +32 -46
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +50 -42
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +39 -50
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +59 -37
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +53 -37
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +45 -53
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +43 -33
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +56 -57
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +57 -18
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +38 -31
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +55 -39
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +52 -34
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +81 -47
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +36 -107
- package/dist/index3.js +1 -3
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +31 -31
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +10 -30
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +40 -14
- package/dist/index33.js +49 -48
- package/dist/index34.js +12 -11
- package/dist/index35.js +104 -39
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +47 -24
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +43 -22
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +22 -27
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +67 -26
- package/dist/index4.js +1 -8
- package/dist/index40.js +71 -21
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +31 -18
- package/dist/index42.js +2 -8
- package/dist/index43.js +13 -1
- package/dist/index45.js +14 -12
- package/dist/index48.js +1 -3
- package/dist/index5.js +2 -9
- package/dist/index50.js +3 -12
- package/dist/index51.js +8 -42
- package/dist/index52.js +20 -35
- package/dist/index53.js +16 -25
- package/dist/index54.js +18 -27
- package/dist/index55.js +31 -36
- package/dist/index57.js +22 -32
- package/dist/index58.js +14 -15
- package/dist/index59.js +2 -10
- package/dist/index6.js +8 -40
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +226 -209
- package/dist/index61.js +5 -9
- package/dist/index62.js +3 -9
- package/dist/index65.js +1 -6
- package/dist/index66.js +1 -4
- package/dist/index67.js +1 -3
- package/dist/index69.js +28 -23
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +2 -4
- package/dist/index76.js +26 -16
- package/dist/index77.cjs +1 -19
- package/dist/index77.js +14 -29
- package/dist/index78.cjs +19 -1
- package/dist/index78.js +24 -16
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +22 -9
- package/dist/index80.cjs +78 -10
- package/dist/index80.js +92 -13
- package/dist/index81.cjs +10 -78
- package/dist/index81.js +13 -94
- package/dist/index83.cjs +1 -80
- package/dist/index83.js +35 -96
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +62 -35
- package/dist/index85.js +1 -3
- package/dist/index86.cjs +80 -7
- package/dist/index86.js +93 -10
- package/dist/index87.cjs +7 -0
- package/dist/index87.js +12 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +99 -84
- package/dist/mobx/Filters/Filters.d.ts +5 -0
- package/dist/mocks/internal/mockUseStores/index.d.ts +1 -0
- package/dist/mocks/internal/mockUseStores/mockUseStores.d.ts +6 -0
- package/dist/types.d.ts +1 -1
- package/package.json +4 -5
- package/dist/components/Filters/Fields/AsyncInlineCheckboxFilter/AsyncInlineCheckboxFilter.d.ts +0 -8
- package/dist/components/Filters/Fields/AsyncInlineCheckboxFilter/index.d.ts +0 -1
- package/dist/components/Filters/Fields/AsyncInlineRadioFilter/AsyncInlineRadioFilter.d.ts +0 -8
- package/dist/components/Filters/Fields/AsyncInlineRadioFilter/index.d.ts +0 -1
- package/dist/components/Filters/Fields/FilterGroup/index.d.ts +0 -1
- package/dist/components/Table/Table.d.ts +0 -1
- /package/dist/components/Filters/{Fields → ActiveFilters/Categories}/FilterArrayField/FilterArrayField.d.ts +0 -0
- /package/dist/components/Filters/{Fields → ActiveFilters/Categories}/FilterArrayField/index.d.ts +0 -0
- /package/dist/components/Filters/{Fields → ActiveFilters/Categories}/FilterField/FilterField.d.ts +0 -0
- /package/dist/components/Filters/{Fields → ActiveFilters/Categories}/FilterField/index.d.ts +0 -0
- /package/dist/components/Filters/ActiveFilters/{ActiveFilterArrayTag → Variants/ActiveFilterArrayTag}/ActiveFilterArrayTag.d.ts +0 -0
- /package/dist/components/Filters/ActiveFilters/{ActiveFilterArrayTag → Variants/ActiveFilterArrayTag}/index.d.ts +0 -0
- /package/dist/components/Filters/ActiveFilters/{ActiveFilterDateRangeTag → Variants/ActiveFilterDateRangeTag}/ActiveFilterDateRangeTag.d.ts +0 -0
- /package/dist/components/Filters/ActiveFilters/{ActiveFilterDateRangeTag → Variants/ActiveFilterDateRangeTag}/index.d.ts +0 -0
- /package/dist/components/Filters/ActiveFilters/{ActiveFilterNumberRangeTag → Variants/ActiveFilterNumberRangeTag}/ActiveFilterNumberRangeTag.d.ts +0 -0
- /package/dist/components/Filters/{Fields → ActiveFilters/Variants/ActiveFilterNumberRangeTag}/FilterNumberRangeFilter/index.d.ts +0 -0
- /package/dist/components/Filters/ActiveFilters/{ActiveFilterNumberRangeTag → Variants/ActiveFilterNumberRangeTag}/index.d.ts +0 -0
package/dist/index13.js
CHANGED
|
@@ -1,42 +1,27 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { observer as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
clearFilter: c,
|
|
15
|
-
setFilter: a
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { ToastsLayout as m } from "@veeqo/ui";
|
|
3
|
+
import { observer as i } from "mobx-react";
|
|
4
|
+
import { useEffect as n } from "react";
|
|
5
|
+
import { useStores as a } from "./index56.js";
|
|
6
|
+
const y = i(() => {
|
|
7
|
+
const { Notifications: { toasts: o, removeByKey: t } } = a();
|
|
8
|
+
return n(() => {
|
|
9
|
+
if (o.length > 0) {
|
|
10
|
+
const r = o[0], e = setTimeout(() => {
|
|
11
|
+
t(r.key);
|
|
12
|
+
}, 2e3);
|
|
13
|
+
return () => clearTimeout(e);
|
|
16
14
|
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
c(e.id);
|
|
27
|
-
}, u = () => {
|
|
28
|
-
a(e.id, r);
|
|
29
|
-
};
|
|
30
|
-
return /* @__PURE__ */ t(y, { shouldCloseOnClickAway: !0, header: /* @__PURE__ */ t("div", { children: "Edit filter (style and semant me pls)" }), label: e.label, text: m || "Loading...", content: /* @__PURE__ */ t(o, { style: {
|
|
31
|
-
padding: n.sizes.md
|
|
32
|
-
}, children: /* @__PURE__ */ t(x, { data: e, editedValue: r, setEditedValue: (h) => s(h) }) }), footer: /* @__PURE__ */ t(o, { style: {
|
|
33
|
-
padding: n.sizes.sm,
|
|
34
|
-
width: "200px"
|
|
35
|
-
}, children: /* @__PURE__ */ f(C, { direction: "horizontal", alignX: "end", children: [
|
|
36
|
-
/* @__PURE__ */ t(d, { variant: "default", size: "sm", onClick: p, children: "Clear" }),
|
|
37
|
-
/* @__PURE__ */ t(d, { variant: "primary", size: "sm", onClick: u, children: "Apply" })
|
|
38
|
-
] }) }) });
|
|
15
|
+
}, [o, t]), /* @__PURE__ */ s(
|
|
16
|
+
m,
|
|
17
|
+
{
|
|
18
|
+
max: 10,
|
|
19
|
+
minWidth: "",
|
|
20
|
+
toasts: o,
|
|
21
|
+
onClose: t
|
|
22
|
+
}
|
|
23
|
+
);
|
|
39
24
|
});
|
|
40
25
|
export {
|
|
41
|
-
|
|
26
|
+
y as ToastsManager
|
|
42
27
|
};
|
package/dist/index14.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"),c=require("react"),m=require("mobx-react"),t=require("@veeqo/ui"),x=require("./index54.cjs"),g=require("./index17.cjs"),j=require("./index56.cjs"),p=m.observer(({filterData:i})=>{const{Filters:{filters:l,clearFilter:o,setFilter:d}}=j.useStores(),s=l.get(i.id),{filterLabel:a}=x.useFilterLabel({filterData:i}),[r,n]=c.useState(s||"");c.useEffect(()=>{r!==s&&n(s||"")},[i.id,s,l]);const u=()=>{o(i.id)},F=()=>{d(i.id,r)};return e.jsx(t.FilterTag,{shouldCloseOnClickAway:!0,header:e.jsx("div",{children:"Edit filter (style and semant me pls)"}),label:i.label,text:a||"Loading...",content:e.jsx(t.BaseContainer,{style:{padding:t.theme.sizes.md},children:e.jsx(g.FilterField,{data:i,editedValue:r,setEditedValue:h=>n(h)})}),footer:e.jsx(t.BaseContainer,{style:{padding:t.theme.sizes.sm,width:"200px"},children:e.jsxs(t.Stack,{direction:"horizontal",alignX:"end",children:[e.jsx(t.Button,{variant:"default",size:"sm",onClick:u,children:"Clear"}),e.jsx(t.Button,{variant:"primary",size:"sm",onClick:F,children:"Apply"})]})})})});exports.ActiveFilterTag=p;
|
package/dist/index14.js
CHANGED
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as F, useEffect as
|
|
3
|
-
import { observer as
|
|
4
|
-
import { FilterTag as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { useStores as
|
|
8
|
-
const
|
|
9
|
-
filterData: e
|
|
10
|
-
}) => {
|
|
1
|
+
import { jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useState as F, useEffect as g } from "react";
|
|
3
|
+
import { observer as v } from "mobx-react";
|
|
4
|
+
import { FilterTag as y, BaseContainer as o, theme as n, Stack as C, Button as d } from "@veeqo/ui";
|
|
5
|
+
import { useFilterLabel as b } from "./index54.js";
|
|
6
|
+
import { FilterField as x } from "./index17.js";
|
|
7
|
+
import { useStores as z } from "./index56.js";
|
|
8
|
+
const w = v(({ filterData: e }) => {
|
|
11
9
|
const {
|
|
12
|
-
Filters: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
Filters: { filters: l, clearFilter: c, setFilter: a }
|
|
11
|
+
} = z(), i = l.get(e.id), { filterLabel: m } = b({ filterData: e }), [r, s] = F(i || "");
|
|
12
|
+
g(() => {
|
|
13
|
+
r !== i && s(i || "");
|
|
14
|
+
}, [e.id, i, l]);
|
|
15
|
+
const p = () => {
|
|
16
|
+
c(e.id);
|
|
17
|
+
}, u = () => {
|
|
18
|
+
a(e.id, r);
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ t(
|
|
21
|
+
y,
|
|
22
|
+
{
|
|
23
|
+
shouldCloseOnClickAway: !0,
|
|
24
|
+
header: /* @__PURE__ */ t("div", { children: "Edit filter (style and semant me pls)" }),
|
|
25
|
+
label: e.label,
|
|
26
|
+
text: m || "Loading...",
|
|
27
|
+
content: /* @__PURE__ */ t(o, { style: { padding: n.sizes.md }, children: /* @__PURE__ */ t(
|
|
28
|
+
x,
|
|
29
|
+
{
|
|
30
|
+
data: e,
|
|
31
|
+
editedValue: r,
|
|
32
|
+
setEditedValue: (h) => s(h)
|
|
33
|
+
}
|
|
34
|
+
) }),
|
|
35
|
+
footer: /* @__PURE__ */ t(o, { style: { padding: n.sizes.sm, width: "200px" }, children: /* @__PURE__ */ f(C, { direction: "horizontal", alignX: "end", children: [
|
|
36
|
+
/* @__PURE__ */ t(d, { variant: "default", size: "sm", onClick: p, children: "Clear" }),
|
|
37
|
+
/* @__PURE__ */ t(d, { variant: "primary", size: "sm", onClick: u, children: "Apply" })
|
|
38
|
+
] }) })
|
|
16
39
|
}
|
|
17
|
-
|
|
18
|
-
A(() => {
|
|
19
|
-
i !== t && s(t || []);
|
|
20
|
-
}, [e.id, t, l]);
|
|
21
|
-
const m = () => {
|
|
22
|
-
a(e.id);
|
|
23
|
-
}, p = () => {
|
|
24
|
-
c(e.id, i);
|
|
25
|
-
}, {
|
|
26
|
-
filterLabel: u
|
|
27
|
-
} = C({
|
|
28
|
-
filterData: e
|
|
29
|
-
});
|
|
30
|
-
return /* @__PURE__ */ r(v, { shouldCloseOnClickAway: !0, header: /* @__PURE__ */ r("div", { children: "Edit filter (style and semant me pls)" }), label: e.label, text: u || "", content: /* @__PURE__ */ r(o, { style: {
|
|
31
|
-
padding: d.sizes.md
|
|
32
|
-
}, children: /* @__PURE__ */ r(b, { data: e, editedValue: i || [], setEditedValue: (y) => s(y) }) }), footer: /* @__PURE__ */ r(o, { style: {
|
|
33
|
-
padding: d.sizes.sm,
|
|
34
|
-
width: "200px"
|
|
35
|
-
}, children: /* @__PURE__ */ h(g, { direction: "horizontal", alignX: "end", children: [
|
|
36
|
-
/* @__PURE__ */ r(n, { variant: "default", size: "sm", onClick: m, children: "Clear" }),
|
|
37
|
-
/* @__PURE__ */ r(n, { variant: "primary", size: "sm", onClick: p, children: "Apply" })
|
|
38
|
-
] }) }) });
|
|
40
|
+
);
|
|
39
41
|
});
|
|
40
42
|
export {
|
|
41
|
-
|
|
43
|
+
w as ActiveFilterTag
|
|
42
44
|
};
|
package/dist/index15.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=require("react/jsx-runtime"),F=require("mobx-react"),s=require("@veeqo/ui"),r=require("./index44.cjs"),A=require("./index18.cjs"),g=require("./index19.cjs"),v=require("./index20.cjs"),h=require("./index14.cjs"),T=require("./index7.cjs"),f=require("./index56.cjs"),x=F.observer(()=>{const{FIELDS_MAP:c}=T.useBusinessLogic(),{Filters:{hasActiveFilters:a,activeFilterKeysList:l,clearAllFilters:n}}=f.useStores();if(!a)return null;const o=Array.from(c).filter(([e])=>l.includes(e));return t.jsxs(s.Stack,{direction:"horizontal",alignY:"center",children:[t.jsx(s.Button,{variant:"link",onClick:()=>n(),children:"Clear all"}),o.map(([e,i])=>{const u=()=>{switch(i.filterType){case r.FilterChoiceValue.CHECKBOX:return t.jsx(A.ActiveFilterArrayTag,{filterData:i},e);case r.FilterChoiceValue.DATE_RANGE:return t.jsx(g.ActiveFilterDateRangeTag,{filterData:i},e);case r.FilterChoiceValue.NUMBER_RANGE:return t.jsx(v.ActiveFilterNumberRangeTag,{filterData:i},e);case r.FilterChoiceValue.TEXT:case r.FilterChoiceValue.NUMBER:case r.FilterChoiceValue.RADIO:return t.jsx(h.ActiveFilterTag,{filterData:i},e);default:return t.jsx(s.Alert,{size:"xs",variant:"error",title:`Unsupport filter "${e}"`},e)}};return t.jsx("div",{children:u()})})]})});exports.ActiveFilters=x;
|
package/dist/index15.js
CHANGED
|
@@ -1,57 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
key: e.filterType,
|
|
38
|
-
range: t
|
|
39
|
-
});
|
|
40
|
-
}, R = (e == null ? void 0 : e.filterSelection) || d, T = (r) => {
|
|
41
|
-
r && (e || F(), e == null || e.setFilterType(r.value));
|
|
42
|
-
}, A = (r) => {
|
|
43
|
-
!r || !e || e.setDates(r.start, r.end);
|
|
44
|
-
}, E = e ? e.selectedRange : p;
|
|
45
|
-
return /* @__PURE__ */ n(b, { shouldCloseOnClickAway: !0, header: /* @__PURE__ */ n("div", { children: "Edit filter (style and semant me pls)" }), label: i.label, text: (t == null ? void 0 : t.filterLabel) || "", content: /* @__PURE__ */ n(a, { style: {
|
|
46
|
-
padding: o.sizes.md
|
|
47
|
-
}, children: /* @__PURE__ */ n(P, { "aria-label": `date range for ${i.label}`, selectedPreset: R, setSelectedPreset: T, selectedRange: E, setSelectedRange: A }) }), footer: /* @__PURE__ */ n(a, { style: {
|
|
48
|
-
padding: o.sizes.sm,
|
|
49
|
-
width: "200px"
|
|
50
|
-
}, children: /* @__PURE__ */ u(k, { direction: "horizontal", alignX: "end", children: [
|
|
51
|
-
/* @__PURE__ */ n(c, { variant: "default", size: "sm", onClick: h, children: "Clear" }),
|
|
52
|
-
/* @__PURE__ */ n(c, { variant: "primary", size: "sm", onClick: y, children: "Apply" })
|
|
53
|
-
] }) }) });
|
|
1
|
+
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { observer as m } from "mobx-react";
|
|
3
|
+
import { Stack as f, Button as p, Alert as A } from "@veeqo/ui";
|
|
4
|
+
import { FilterChoiceValue as e } from "./index44.js";
|
|
5
|
+
import { ActiveFilterArrayTag as u } from "./index18.js";
|
|
6
|
+
import { ActiveFilterDateRangeTag as F } from "./index19.js";
|
|
7
|
+
import { ActiveFilterNumberRangeTag as h } from "./index20.js";
|
|
8
|
+
import { ActiveFilterTag as d } from "./index14.js";
|
|
9
|
+
import { useBusinessLogic as g } from "./index7.js";
|
|
10
|
+
import { useStores as v } from "./index56.js";
|
|
11
|
+
const U = m(() => {
|
|
12
|
+
const { FIELDS_MAP: o } = g(), {
|
|
13
|
+
Filters: { hasActiveFilters: s, activeFilterKeysList: a, clearAllFilters: n }
|
|
14
|
+
} = v();
|
|
15
|
+
if (!s) return null;
|
|
16
|
+
const l = Array.from(o).filter(([r]) => a.includes(r));
|
|
17
|
+
return /* @__PURE__ */ c(f, { direction: "horizontal", alignY: "center", children: [
|
|
18
|
+
/* @__PURE__ */ t(p, { variant: "link", onClick: () => n(), children: "Clear all" }),
|
|
19
|
+
l.map(([r, i]) => /* @__PURE__ */ t("div", { children: (() => {
|
|
20
|
+
switch (i.filterType) {
|
|
21
|
+
case e.CHECKBOX:
|
|
22
|
+
return /* @__PURE__ */ t(u, { filterData: i }, r);
|
|
23
|
+
case e.DATE_RANGE:
|
|
24
|
+
return /* @__PURE__ */ t(F, { filterData: i }, r);
|
|
25
|
+
case e.NUMBER_RANGE:
|
|
26
|
+
return /* @__PURE__ */ t(h, { filterData: i }, r);
|
|
27
|
+
case e.TEXT:
|
|
28
|
+
case e.NUMBER:
|
|
29
|
+
case e.RADIO:
|
|
30
|
+
return /* @__PURE__ */ t(d, { filterData: i }, r);
|
|
31
|
+
default:
|
|
32
|
+
return /* @__PURE__ */ t(A, { size: "xs", variant: "error", title: `Unsupport filter "${r}"` }, r);
|
|
33
|
+
}
|
|
34
|
+
})() }))
|
|
35
|
+
] });
|
|
54
36
|
});
|
|
55
37
|
export {
|
|
56
|
-
|
|
38
|
+
U as ActiveFilters
|
|
57
39
|
};
|
package/dist/index16.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 o=require("react/jsx-runtime"),l=require("mobx-react"),s=require("@veeqo/ui"),c=require("./index44.cjs"),u=require("./index21.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
|
@@ -1,49 +1,35 @@
|
|
|
1
|
-
import { jsx as t
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { observer as n } from "mobx-react";
|
|
3
|
+
import { ChoiceList as p } from "@veeqo/ui";
|
|
4
|
+
import { FilterChoiceValue as s } from "./index44.js";
|
|
5
|
+
import { ActiveAsyncCheckboxFilter as c } from "./index21.js";
|
|
6
|
+
const F = n(
|
|
7
|
+
({ data: r, editedValue: e, setEditedValue: o }) => {
|
|
8
|
+
var i;
|
|
9
|
+
switch (r.filterType) {
|
|
10
|
+
case s.CHECKBOX:
|
|
11
|
+
return r.fetchAsyncFilterOptions ? /* @__PURE__ */ t(
|
|
12
|
+
c,
|
|
13
|
+
{
|
|
14
|
+
field: r,
|
|
15
|
+
setEditedValue: o,
|
|
16
|
+
editedValue: e
|
|
17
|
+
}
|
|
18
|
+
) : /* @__PURE__ */ t(
|
|
19
|
+
p,
|
|
20
|
+
{
|
|
21
|
+
allowMultiple: !0,
|
|
22
|
+
title: r.label,
|
|
23
|
+
options: (i = r.options) != null && i.length ? r.options : [],
|
|
24
|
+
selected: e,
|
|
25
|
+
onChange: (l) => o(l)
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
default:
|
|
29
|
+
return null;
|
|
16
30
|
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
filterId: r.id
|
|
20
|
-
});
|
|
21
|
-
return e && (e.gte && i.setGte(e.gte), e.lte && i.setLte(e.lte)), i;
|
|
22
|
-
}, [r.id, e]);
|
|
23
|
-
h(() => {
|
|
24
|
-
const i = s();
|
|
25
|
-
l(i);
|
|
26
|
-
}, [s, e]);
|
|
27
|
-
const g = () => {
|
|
28
|
-
c(r.id);
|
|
29
|
-
}, p = () => {
|
|
30
|
-
!e || !n || u({
|
|
31
|
-
numberRange: e,
|
|
32
|
-
// update the original value
|
|
33
|
-
lte: n.lte,
|
|
34
|
-
gte: n.gte
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
return /* @__PURE__ */ t(v, { shouldCloseOnClickAway: !0, header: /* @__PURE__ */ t("div", { children: "Edit filter (style and semant me pls)" }), label: r.label, text: (e == null ? void 0 : e.filterLabel) || "Loading...", content: /* @__PURE__ */ t(o, { style: {
|
|
38
|
-
padding: a.sizes.md
|
|
39
|
-
}, children: /* @__PURE__ */ t(N, { data: r, editedValue: n, setEditedValue: l }) }), footer: /* @__PURE__ */ t(o, { style: {
|
|
40
|
-
padding: a.sizes.sm,
|
|
41
|
-
width: "200px"
|
|
42
|
-
}, children: /* @__PURE__ */ F(y, { direction: "horizontal", alignX: "end", children: [
|
|
43
|
-
/* @__PURE__ */ t(d, { variant: "default", size: "sm", onClick: g, children: "Clear" }),
|
|
44
|
-
/* @__PURE__ */ t(d, { variant: "primary", size: "sm", onClick: p, children: "Apply" })
|
|
45
|
-
] }) }) });
|
|
46
|
-
});
|
|
31
|
+
}
|
|
32
|
+
);
|
|
47
33
|
export {
|
|
48
|
-
|
|
34
|
+
F as FilterArrayField
|
|
49
35
|
};
|
package/dist/index17.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 o=require("react/jsx-runtime"),u=require("mobx-react"),n=require("@veeqo/ui"),i=require("./index44.cjs"),F=require("./index22.cjs"),h=u.observer(({data:e,editedValue:r,setEditedValue:t})=>{var s;let l;switch(e.filterType){case i.FilterChoiceValue.NUMBER:l="number";break;case i.FilterChoiceValue.TEXT:l="text";break}switch(e.filterType){case i.FilterChoiceValue.TEXT:case i.FilterChoiceValue.NUMBER:return o.jsx(n.TextField,{label:e.label,type:l,value:r,onChange:c=>t(c)});case i.FilterChoiceValue.RADIO:case i.FilterChoiceValue.DATE_RANGE:return e.fetchAsyncFilterOptions?o.jsx(F.ActiveAsyncRadioFilter,{field:e,setEditedValue:t,editedValue:r}):o.jsx(n.ChoiceList,{title:e.label,options:(s=e.options)!=null&&s.length?e.options:[],selected:[r],onChange:c=>t(`${c[0]}`)});default:return null}});exports.FilterField=h;
|
package/dist/index17.js
CHANGED
|
@@ -1,45 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { observer as
|
|
3
|
-
import {
|
|
4
|
-
import { FilterChoiceValue as
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { observer as c } from "mobx-react";
|
|
3
|
+
import { ChoiceList as p, TextField as f } from "@veeqo/ui";
|
|
4
|
+
import { FilterChoiceValue as r } from "./index44.js";
|
|
5
|
+
import { ActiveAsyncRadioFilter as m } from "./index22.js";
|
|
6
|
+
const u = c(({ data: e, editedValue: o, setEditedValue: i }) => {
|
|
7
|
+
var s;
|
|
8
|
+
let t;
|
|
9
|
+
switch (e.filterType) {
|
|
10
|
+
case r.NUMBER:
|
|
11
|
+
t = "number";
|
|
12
|
+
break;
|
|
13
|
+
case r.TEXT:
|
|
14
|
+
t = "text";
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
switch (e.filterType) {
|
|
18
|
+
case r.TEXT:
|
|
19
|
+
case r.NUMBER:
|
|
20
|
+
return /* @__PURE__ */ n(
|
|
21
|
+
f,
|
|
22
|
+
{
|
|
23
|
+
label: e.label,
|
|
24
|
+
type: t,
|
|
25
|
+
value: o,
|
|
26
|
+
onChange: (l) => i(l)
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
case r.RADIO:
|
|
30
|
+
case r.DATE_RANGE:
|
|
31
|
+
return e.fetchAsyncFilterOptions ? /* @__PURE__ */ n(
|
|
32
|
+
m,
|
|
33
|
+
{
|
|
34
|
+
field: e,
|
|
35
|
+
setEditedValue: i,
|
|
36
|
+
editedValue: o
|
|
37
|
+
}
|
|
38
|
+
) : /* @__PURE__ */ n(
|
|
39
|
+
p,
|
|
40
|
+
{
|
|
41
|
+
title: e.label,
|
|
42
|
+
options: (s = e.options) != null && s.length ? e.options : [],
|
|
43
|
+
selected: [o],
|
|
44
|
+
onChange: (l) => i(`${l[0]}`)
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
default:
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
42
50
|
});
|
|
43
51
|
export {
|
|
44
|
-
|
|
52
|
+
u as FilterField
|
|
45
53
|
};
|
package/dist/index18.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"),a=require("react"),A=require("mobx-react"),r=require("@veeqo/ui"),h=require("./index53.cjs"),m=require("./index16.cjs"),x=require("./index56.cjs"),j=A.observer(({filterData:t})=>{const{Filters:{arrayFilters:l,clearArrayFilter:c,setArrayFilter:d}}=x.useStores(),i=l.get(t.id),[s,n]=a.useState(i||[]);a.useEffect(()=>{s!==i&&n(i||[])},[t.id,i,l]);const o=()=>{c(t.id)},u=()=>{d(t.id,s)},{filterLabel:y}=h.useFilterArrayLabel({filterData:t});return e.jsx(r.FilterTag,{shouldCloseOnClickAway:!0,header:e.jsx("div",{children:"Edit filter (style and semant me pls)"}),label:t.label,text:y||"",content:e.jsx(r.BaseContainer,{style:{padding:r.theme.sizes.md},children:e.jsx(m.FilterArrayField,{data:t,editedValue:s||[],setEditedValue:F=>n(F)})}),footer:e.jsx(r.BaseContainer,{style:{padding:r.theme.sizes.sm,width:"200px"},children:e.jsxs(r.Stack,{direction:"horizontal",alignX:"end",children:[e.jsx(r.Button,{variant:"default",size:"sm",onClick:o,children:"Clear"}),e.jsx(r.Button,{variant:"primary",size:"sm",onClick:u,children:"Apply"})]})})})});exports.ActiveFilterArrayTag=j;
|
package/dist/index18.js
CHANGED
|
@@ -1,55 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { observer as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { useBusinessLogic as N } from "./index7.js";
|
|
10
|
-
import { useStores as U } from "./index56.js";
|
|
11
|
-
const P = V(({
|
|
12
|
-
field: t
|
|
13
|
-
}) => {
|
|
14
|
-
var c, a;
|
|
1
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import { useState as F, useEffect as A } from "react";
|
|
3
|
+
import { observer as f } from "mobx-react";
|
|
4
|
+
import { FilterTag as v, BaseContainer as o, theme as d, Stack as g, Button as n } from "@veeqo/ui";
|
|
5
|
+
import { useFilterArrayLabel as C } from "./index53.js";
|
|
6
|
+
import { FilterArrayField as b } from "./index16.js";
|
|
7
|
+
import { useStores as x } from "./index56.js";
|
|
8
|
+
const B = f(({ filterData: e }) => {
|
|
15
9
|
const {
|
|
16
|
-
|
|
17
|
-
} =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
Filters: { arrayFilters: l, clearArrayFilter: a, setArrayFilter: c }
|
|
11
|
+
} = x(), t = l.get(e.id), [i, s] = F(t || []);
|
|
12
|
+
A(() => {
|
|
13
|
+
i !== t && s(t || []);
|
|
14
|
+
}, [e.id, t, l]);
|
|
15
|
+
const m = () => {
|
|
16
|
+
a(e.id);
|
|
17
|
+
}, p = () => {
|
|
18
|
+
c(e.id, i);
|
|
19
|
+
}, { filterLabel: u } = C({ filterData: e });
|
|
20
|
+
return /* @__PURE__ */ r(
|
|
21
|
+
v,
|
|
22
|
+
{
|
|
23
|
+
shouldCloseOnClickAway: !0,
|
|
24
|
+
header: /* @__PURE__ */ r("div", { children: "Edit filter (style and semant me pls)" }),
|
|
25
|
+
label: e.label,
|
|
26
|
+
text: u || "",
|
|
27
|
+
content: /* @__PURE__ */ r(o, { style: { padding: d.sizes.md }, children: /* @__PURE__ */ r(
|
|
28
|
+
b,
|
|
29
|
+
{
|
|
30
|
+
data: e,
|
|
31
|
+
editedValue: i || [],
|
|
32
|
+
setEditedValue: (y) => s(y)
|
|
33
|
+
}
|
|
34
|
+
) }),
|
|
35
|
+
footer: /* @__PURE__ */ r(o, { style: { padding: d.sizes.sm, width: "200px" }, children: /* @__PURE__ */ h(g, { direction: "horizontal", alignX: "end", children: [
|
|
36
|
+
/* @__PURE__ */ r(n, { variant: "default", size: "sm", onClick: m, children: "Clear" }),
|
|
37
|
+
/* @__PURE__ */ r(n, { variant: "primary", size: "sm", onClick: p, children: "Apply" })
|
|
38
|
+
] }) })
|
|
31
39
|
}
|
|
32
|
-
|
|
33
|
-
o(e, r);
|
|
34
|
-
}, m), [o]), S = (e) => {
|
|
35
|
-
const r = e.map((L) => `${L}`);
|
|
36
|
-
i(r), y(t.id, r);
|
|
37
|
-
}, A = () => {
|
|
38
|
-
i([]), o(t.id, []);
|
|
39
|
-
}, C = _({
|
|
40
|
-
data: f,
|
|
41
|
-
config: t.fetchAsyncFilterOptions
|
|
42
|
-
});
|
|
43
|
-
return /* @__PURE__ */ l(R, { spacing: "xs", alignX: "stretch", children: [
|
|
44
|
-
/* @__PURE__ */ s(v, { variant: "link", onClick: A, children: "Clear" }),
|
|
45
|
-
/* @__PURE__ */ s(w, { allowMultiple: !0, title: t.label, options: C, selected: b, onChange: (e) => S(e) }),
|
|
46
|
-
n && /* @__PURE__ */ s(B, { width: "200px", height: I.sizes[5], "aria-busy": !0, "aria-label": `Loading ${t.label} filters` }),
|
|
47
|
-
!n && g && /* @__PURE__ */ l(M, { variant: "errorSmall", children: [
|
|
48
|
-
"Error: failed to load filter for ",
|
|
49
|
-
t.label
|
|
50
|
-
] })
|
|
51
|
-
] });
|
|
40
|
+
);
|
|
52
41
|
});
|
|
53
42
|
export {
|
|
54
|
-
|
|
43
|
+
B as ActiveFilterArrayTag
|
|
55
44
|
};
|
package/dist/index19.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 r=require("react/jsx-runtime"),c=require("react"),x=require("mobx-react"),n=require("@veeqo/ui"),o=require("./index62.cjs"),A=require("./index7.cjs"),j=require("./index56.cjs"),v=x.observer(({filterData:i})=>{const{DEFAULT_DATE_PRESET:g,DEFAULT_DATE_RANGE:d}=A.useBusinessLogic(),{Filters:{dateRangeFilters:l,clearRangeFilter:u,setRangeFilter:F}}=j.useStores(),t=l.get(i.id),[e,a]=c.useState(l.get(i.id)),R=()=>{const s=new o.RangeFilter;return s.setFilterType(t==null?void 0:t.filterType),a(s),s};c.useEffect(()=>{if(!t)return;const s=new o.RangeFilter;s.setFilterType(t.filterType),t.gte&&t.lte&&s.setDates(t.gte,t.lte),a(s)},[t]);const p=()=>{u(i.id)},y=()=>{t&&(e!=null&&e.filterType)&&F({dates:{start:e.gte,end:e.lte},key:e.filterType,range:t})},h=(e==null?void 0:e.filterSelection)||g,T=s=>{s&&(e||R(),e==null||e.setFilterType(s.value))},f=s=>{!s||!e||e.setDates(s.start,s.end)},m=e?e.selectedRange:d;return r.jsx(n.FilterTag,{shouldCloseOnClickAway:!0,header:r.jsx("div",{children:"Edit filter (style and semant me pls)"}),label:i.label,text:(t==null?void 0:t.filterLabel)||"",content:r.jsx(n.BaseContainer,{style:{padding:n.theme.sizes.md},children:r.jsx(n.DateRangePicker,{"aria-label":`date range for ${i.label}`,selectedPreset:h,setSelectedPreset:T,selectedRange:m,setSelectedRange:f})}),footer:r.jsx(n.BaseContainer,{style:{padding:n.theme.sizes.sm,width:"200px"},children:r.jsxs(n.Stack,{direction:"horizontal",alignX:"end",children:[r.jsx(n.Button,{variant:"default",size:"sm",onClick:p,children:"Clear"}),r.jsx(n.Button,{variant:"primary",size:"sm",onClick:y,children:"Apply"})]})})})});exports.ActiveFilterDateRangeTag=v;
|