@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/index19.js
CHANGED
|
@@ -1,39 +1,61 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { observer as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
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
|
-
|
|
1
|
+
import { jsx as n, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v, useEffect as C } from "react";
|
|
3
|
+
import { observer as S } from "mobx-react";
|
|
4
|
+
import { FilterTag as b, BaseContainer as a, theme as o, Stack as k, Button as c, DateRangePicker as P } from "@veeqo/ui";
|
|
5
|
+
import { RangeFilter as g } from "./index62.js";
|
|
6
|
+
import { useBusinessLogic as w } from "./index7.js";
|
|
7
|
+
import { useStores as x } from "./index56.js";
|
|
8
|
+
const G = S(
|
|
9
|
+
({ filterData: i }) => {
|
|
10
|
+
const { DEFAULT_DATE_PRESET: d, DEFAULT_DATE_RANGE: p } = w(), {
|
|
11
|
+
Filters: { dateRangeFilters: s, clearRangeFilter: m, setRangeFilter: f }
|
|
12
|
+
} = x(), t = s.get(i.id), [e, l] = v(s.get(i.id)), F = () => {
|
|
13
|
+
const r = new g();
|
|
14
|
+
return r.setFilterType(t == null ? void 0 : t.filterType), l(r), r;
|
|
15
|
+
};
|
|
16
|
+
C(() => {
|
|
17
|
+
if (!t) return;
|
|
18
|
+
const r = new g();
|
|
19
|
+
r.setFilterType(t.filterType), t.gte && t.lte && r.setDates(t.gte, t.lte), l(r);
|
|
20
|
+
}, [t]);
|
|
21
|
+
const h = () => {
|
|
22
|
+
m(i.id);
|
|
23
|
+
}, y = () => {
|
|
24
|
+
t && (e != null && e.filterType) && f({
|
|
25
|
+
dates: { start: e.gte, end: e.lte },
|
|
26
|
+
key: e.filterType,
|
|
27
|
+
range: t
|
|
28
|
+
});
|
|
29
|
+
}, R = (e == null ? void 0 : e.filterSelection) || d, T = (r) => {
|
|
30
|
+
r && (e || F(), e == null || e.setFilterType(r.value));
|
|
31
|
+
}, A = (r) => {
|
|
32
|
+
!r || !e || e.setDates(r.start, r.end);
|
|
33
|
+
}, E = e ? e.selectedRange : p;
|
|
34
|
+
return /* @__PURE__ */ n(
|
|
35
|
+
b,
|
|
36
|
+
{
|
|
37
|
+
shouldCloseOnClickAway: !0,
|
|
38
|
+
header: /* @__PURE__ */ n("div", { children: "Edit filter (style and semant me pls)" }),
|
|
39
|
+
label: i.label,
|
|
40
|
+
text: (t == null ? void 0 : t.filterLabel) || "",
|
|
41
|
+
content: /* @__PURE__ */ n(a, { style: { padding: o.sizes.md }, children: /* @__PURE__ */ n(
|
|
42
|
+
P,
|
|
43
|
+
{
|
|
44
|
+
"aria-label": `date range for ${i.label}`,
|
|
45
|
+
selectedPreset: R,
|
|
46
|
+
setSelectedPreset: T,
|
|
47
|
+
selectedRange: E,
|
|
48
|
+
setSelectedRange: A
|
|
49
|
+
}
|
|
50
|
+
) }),
|
|
51
|
+
footer: /* @__PURE__ */ n(a, { style: { padding: o.sizes.sm, width: "200px" }, children: /* @__PURE__ */ u(k, { direction: "horizontal", alignX: "end", children: [
|
|
52
|
+
/* @__PURE__ */ n(c, { variant: "default", size: "sm", onClick: h, children: "Clear" }),
|
|
53
|
+
/* @__PURE__ */ n(c, { variant: "primary", size: "sm", onClick: y, children: "Apply" })
|
|
54
|
+
] }) })
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
37
59
|
export {
|
|
38
|
-
|
|
60
|
+
G as ActiveFilterDateRangeTag
|
|
39
61
|
};
|
package/dist/index20.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"),l=require("react"),b=require("mobx-react"),r=require("@veeqo/ui"),F=require("./index61.cjs"),R=require("./index84.cjs"),h=require("./index56.cjs"),x=b.observer(({filterData:i})=>{const{Filters:{numberRangeFilters:o,clearNumberRangeFilter:u,setNumberRangeFilter:d}}=h.useStores(),e=o.get(i.id),[s,a]=l.useState(e),c=l.useCallback(()=>{const n=new F.NumberRangeFilter({filterId:i.id});return e&&(e.gte&&n.setGte(e.gte),e.lte&&n.setLte(e.lte)),n},[i.id,e]);l.useEffect(()=>{const n=c();a(n)},[c,e]);const g=()=>{u(i.id)},m=()=>{!e||!s||d({numberRange:e,lte:s.lte,gte:s.gte})};return t.jsx(r.FilterTag,{shouldCloseOnClickAway:!0,header:t.jsx("div",{children:"Edit filter (style and semant me pls)"}),label:i.label,text:(e==null?void 0:e.filterLabel)||"Loading...",content:t.jsx(r.BaseContainer,{style:{padding:r.theme.sizes.md},children:t.jsx(R.FilterNumberRangeFilter,{data:i,editedValue:s,setEditedValue:a})}),footer:t.jsx(r.BaseContainer,{style:{padding:r.theme.sizes.sm,width:"200px"},children:t.jsxs(r.Stack,{direction:"horizontal",alignX:"end",children:[t.jsx(r.Button,{variant:"default",size:"sm",onClick:g,children:"Clear"}),t.jsx(r.Button,{variant:"primary",size:"sm",onClick:m,children:"Apply"})]})})})});exports.ActiveFilterNumberRangeTag=x;
|
package/dist/index20.js
CHANGED
|
@@ -1,39 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { observer as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
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
|
-
|
|
1
|
+
import { jsx as t, jsxs as F } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useCallback as f, useEffect as h } from "react";
|
|
3
|
+
import { observer as R } from "mobx-react";
|
|
4
|
+
import { FilterTag as v, BaseContainer as o, theme as a, Stack as y, Button as d } from "@veeqo/ui";
|
|
5
|
+
import { NumberRangeFilter as C } from "./index61.js";
|
|
6
|
+
import { FilterNumberRangeFilter as N } from "./index84.js";
|
|
7
|
+
import { useStores as w } from "./index56.js";
|
|
8
|
+
const j = R(
|
|
9
|
+
({ filterData: r }) => {
|
|
10
|
+
const {
|
|
11
|
+
Filters: { numberRangeFilters: m, clearNumberRangeFilter: c, setNumberRangeFilter: u }
|
|
12
|
+
} = w(), e = m.get(r.id), [n, l] = b(e), s = f(() => {
|
|
13
|
+
const i = new C({ filterId: r.id });
|
|
14
|
+
return e && (e.gte && i.setGte(e.gte), e.lte && i.setLte(e.lte)), i;
|
|
15
|
+
}, [r.id, e]);
|
|
16
|
+
h(() => {
|
|
17
|
+
const i = s();
|
|
18
|
+
l(i);
|
|
19
|
+
}, [s, e]);
|
|
20
|
+
const g = () => {
|
|
21
|
+
c(r.id);
|
|
22
|
+
}, p = () => {
|
|
23
|
+
!e || !n || u({
|
|
24
|
+
numberRange: e,
|
|
25
|
+
// update the original value
|
|
26
|
+
lte: n.lte,
|
|
27
|
+
gte: n.gte
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ t(
|
|
31
|
+
v,
|
|
32
|
+
{
|
|
33
|
+
shouldCloseOnClickAway: !0,
|
|
34
|
+
header: /* @__PURE__ */ t("div", { children: "Edit filter (style and semant me pls)" }),
|
|
35
|
+
label: r.label,
|
|
36
|
+
text: (e == null ? void 0 : e.filterLabel) || "Loading...",
|
|
37
|
+
content: /* @__PURE__ */ t(o, { style: { padding: a.sizes.md }, children: /* @__PURE__ */ t(
|
|
38
|
+
N,
|
|
39
|
+
{
|
|
40
|
+
data: r,
|
|
41
|
+
editedValue: n,
|
|
42
|
+
setEditedValue: l
|
|
43
|
+
}
|
|
44
|
+
) }),
|
|
45
|
+
footer: /* @__PURE__ */ t(o, { style: { padding: a.sizes.sm, width: "200px" }, children: /* @__PURE__ */ F(y, { direction: "horizontal", alignX: "end", children: [
|
|
46
|
+
/* @__PURE__ */ t(d, { variant: "default", size: "sm", onClick: g, children: "Clear" }),
|
|
47
|
+
/* @__PURE__ */ t(d, { variant: "primary", size: "sm", onClick: p, children: "Apply" })
|
|
48
|
+
] }) })
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
37
53
|
export {
|
|
38
|
-
|
|
54
|
+
j as ActiveFilterNumberRangeTag
|
|
39
55
|
};
|
package/dist/index21.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("./index66.cjs"),y=require("./index67.cjs"),F=e=>e&&e.__esModule?e:{default:e},A=F(m),q=d.observer(({field:e,editedValue:o,setEditedValue:a})=>{var i,c;const l=p.useMemo(()=>{var r;return y.getFetcherFunction({fetcherName:(r=e.fetchAsyncFilterOptions)==null?void 0:r.fetcher})},[(i=e.fetchAsyncFilterOptions)==null?void 0:i.fetcher]),{isLoading:u,isValidating:h,data:g,error:b}=A.default((c=e.fetchAsyncFilterOptions)==null?void 0:c.URL,l),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=q;
|
package/dist/index21.js
CHANGED
|
@@ -1,55 +1,47 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { observer as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/* @__PURE__ */ s(v, { title: t.label, options: A, selected: [b], onChange: (e) => L(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(T, { variant: "errorSmall", children: [
|
|
48
|
-
"Error: failed to load filter for ",
|
|
49
|
-
t.label
|
|
50
|
-
] })
|
|
51
|
-
] });
|
|
52
|
-
});
|
|
1
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as u } from "react";
|
|
3
|
+
import { observer as b } from "mobx-react";
|
|
4
|
+
import { Stack as F, ChoiceList as x, Skeleton as y, theme as A, Text as d } from "@veeqo/ui";
|
|
5
|
+
import L from "swr/immutable";
|
|
6
|
+
import { getAsyncOptions as O } from "./index66.js";
|
|
7
|
+
import { getFetcherFunction as S } from "./index67.js";
|
|
8
|
+
const z = b(
|
|
9
|
+
({ field: t, editedValue: c, setEditedValue: a }) => {
|
|
10
|
+
var o, i;
|
|
11
|
+
const l = u(() => {
|
|
12
|
+
var e;
|
|
13
|
+
return S({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
|
|
14
|
+
}, [(o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher]), { isLoading: m, isValidating: h, data: p, error: f } = L(
|
|
15
|
+
(i = t.fetchAsyncFilterOptions) == null ? void 0 : i.URL,
|
|
16
|
+
l
|
|
17
|
+
), r = m || h, g = O({ data: p, config: t.fetchAsyncFilterOptions });
|
|
18
|
+
return /* @__PURE__ */ s(F, { spacing: "xs", alignX: "stretch", children: [
|
|
19
|
+
/* @__PURE__ */ n(
|
|
20
|
+
x,
|
|
21
|
+
{
|
|
22
|
+
allowMultiple: !0,
|
|
23
|
+
title: t.label,
|
|
24
|
+
options: g,
|
|
25
|
+
selected: c,
|
|
26
|
+
onChange: (e) => a(e)
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
r && /* @__PURE__ */ n(
|
|
30
|
+
y,
|
|
31
|
+
{
|
|
32
|
+
width: "200px",
|
|
33
|
+
height: A.sizes[5],
|
|
34
|
+
"aria-busy": !0,
|
|
35
|
+
"aria-label": `Loading ${t.label} filters`
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
!r && f && /* @__PURE__ */ s(d, { variant: "errorSmall", children: [
|
|
39
|
+
"Error: failed to load filter for ",
|
|
40
|
+
t.label
|
|
41
|
+
] })
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
);
|
|
53
45
|
export {
|
|
54
|
-
|
|
46
|
+
z as ActiveAsyncCheckboxFilter
|
|
55
47
|
};
|
package/dist/index22.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"),b=require("react"),m=require("mobx-react"),t=require("@veeqo/ui"),p=require("swr/immutable"),y=require("./index66.cjs"),F=require("./index67.cjs"),A=e=>e&&e.__esModule?e:{default:e},x=A(p),q=m.observer(({field:e,editedValue:o,setEditedValue:a})=>{var n,c;const l=b.useMemo(()=>{var r;return F.getFetcherFunction({fetcherName:(r=e.fetchAsyncFilterOptions)==null?void 0:r.fetcher})},[(n=e.fetchAsyncFilterOptions)==null?void 0:n.fetcher]),{isLoading:u,isValidating:h,data:g,error:d}=x.default((c=e.fetchAsyncFilterOptions)==null?void 0:c.URL,l),i=u||h,f=y.getAsyncOptions({data:g,config:e.fetchAsyncFilterOptions});return s.jsxs(t.Stack,{spacing:"xs",alignX:"stretch",children:[s.jsx(t.ChoiceList,{title:e.label,options:f,selected:[o],onChange:r=>a(`${r[0]}`)}),i&&s.jsx(t.Skeleton,{width:"200px",height:t.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!i&&d&&s.jsxs(t.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.ActiveAsyncRadioFilter=q;
|
package/dist/index22.js
CHANGED
|
@@ -1,36 +1,46 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as u } from "react";
|
|
2
3
|
import { observer as F } from "mobx-react";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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
|
-
}
|
|
4
|
+
import { Stack as b, ChoiceList as y, Skeleton as A, theme as d, Text as x } from "@veeqo/ui";
|
|
5
|
+
import L from "swr/immutable";
|
|
6
|
+
import { getAsyncOptions as O } from "./index66.js";
|
|
7
|
+
import { getFetcherFunction as S } from "./index67.js";
|
|
8
|
+
const z = F(
|
|
9
|
+
({ field: t, editedValue: c, setEditedValue: a }) => {
|
|
10
|
+
var o, i;
|
|
11
|
+
const l = u(() => {
|
|
12
|
+
var e;
|
|
13
|
+
return S({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
|
|
14
|
+
}, [(o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher]), { isLoading: m, isValidating: h, data: p, error: f } = L(
|
|
15
|
+
(i = t.fetchAsyncFilterOptions) == null ? void 0 : i.URL,
|
|
16
|
+
l
|
|
17
|
+
), r = m || h, g = O({ data: p, config: t.fetchAsyncFilterOptions });
|
|
18
|
+
return /* @__PURE__ */ s(b, { spacing: "xs", alignX: "stretch", children: [
|
|
19
|
+
/* @__PURE__ */ n(
|
|
20
|
+
y,
|
|
21
|
+
{
|
|
22
|
+
title: t.label,
|
|
23
|
+
options: g,
|
|
24
|
+
selected: [c],
|
|
25
|
+
onChange: (e) => a(`${e[0]}`)
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
r && /* @__PURE__ */ n(
|
|
29
|
+
A,
|
|
30
|
+
{
|
|
31
|
+
width: "200px",
|
|
32
|
+
height: d.sizes[5],
|
|
33
|
+
"aria-busy": !0,
|
|
34
|
+
"aria-label": `Loading ${t.label} filters`
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
!r && f && /* @__PURE__ */ s(x, { variant: "errorSmall", children: [
|
|
38
|
+
"Error: failed to load filter for ",
|
|
39
|
+
t.label
|
|
40
|
+
] })
|
|
41
|
+
] });
|
|
42
|
+
}
|
|
43
|
+
);
|
|
34
44
|
export {
|
|
35
|
-
|
|
45
|
+
z as ActiveAsyncRadioFilter
|
|
36
46
|
};
|
package/dist/index23.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("react"),L=require("mobx-react"),O=require("lodash/debounce"),s=require("@veeqo/ui"),j=require("swr/immutable"),k=require("./index66.cjs"),R=require("./index67.cjs"),V=require("./index7.cjs"),E=require("./index56.cjs"),h=e=>e&&e.__esModule?e:{default:e},M=h(O),v=h(j),B=L.observer(({field:e})=>{var l,u;const{FILTERS_DEBOUCE_INTERVAL_MS:d}=V.useBusinessLogic(),g=o.useMemo(()=>{var t;return R.getFetcherFunction({fetcherName:(t=e.fetchAsyncFilterOptions)==null?void 0:t.fetcher})},[(l=e.fetchAsyncFilterOptions)==null?void 0:l.fetcher]),{isLoading:b,isValidating:F,data:y,error:S}=v.default((u=e.fetchAsyncFilterOptions)==null?void 0:u.URL,g),i=b||F,{Filters:{setArrayFilter:c,arrayFilters:p}}=E.useStores(),m=p.get(e.id)||[],[x,a]=o.useState(m),f=o.useCallback(M.default((t,n)=>{c(t,n)},d),[c]),A=t=>{const n=t.map(C=>`${C}`);a(n),f(e.id,n)},q=()=>{a([]),c(e.id,[])},_=k.getAsyncOptions({data:y,config:e.fetchAsyncFilterOptions});return r.jsxs(s.Stack,{spacing:"xs",alignX:"stretch",children:[r.jsx(s.Button,{variant:"link",onClick:q,children:"Clear"}),r.jsx(s.ChoiceList,{allowMultiple:!0,title:e.label,options:_,selected:x,onChange:t=>A(t)}),i&&r.jsx(s.Skeleton,{width:"200px",height:s.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!i&&S&&r.jsxs(s.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.AsyncCheckboxFilter=B;
|
package/dist/index23.js
CHANGED
|
@@ -1,62 +1,61 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { observer as
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
range: e
|
|
43
|
-
});
|
|
44
|
-
}, m = (t) => {
|
|
45
|
-
if (t) {
|
|
46
|
-
if (!e) {
|
|
47
|
-
s();
|
|
48
|
-
return;
|
|
1
|
+
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as x, useState as O, useCallback as k } from "react";
|
|
3
|
+
import { observer as V } from "mobx-react";
|
|
4
|
+
import E from "lodash/debounce";
|
|
5
|
+
import { Stack as R, Button as v, ChoiceList as w, Skeleton as B, theme as I, Text as M } from "@veeqo/ui";
|
|
6
|
+
import T from "swr/immutable";
|
|
7
|
+
import { getAsyncOptions as _ } from "./index66.js";
|
|
8
|
+
import { getFetcherFunction as j } from "./index67.js";
|
|
9
|
+
import { useBusinessLogic as N } from "./index7.js";
|
|
10
|
+
import { useStores as U } from "./index56.js";
|
|
11
|
+
const P = V(({ field: t }) => {
|
|
12
|
+
var c, a;
|
|
13
|
+
const { FILTERS_DEBOUCE_INTERVAL_MS: m } = N(), u = x(() => {
|
|
14
|
+
var e;
|
|
15
|
+
return j({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
|
|
16
|
+
}, [(c = t.fetchAsyncFilterOptions) == null ? void 0 : c.fetcher]), { isLoading: h, isValidating: p, data: f, error: g } = T(
|
|
17
|
+
(a = t.fetchAsyncFilterOptions) == null ? void 0 : a.URL,
|
|
18
|
+
u
|
|
19
|
+
), n = h || p, {
|
|
20
|
+
Filters: { setArrayFilter: o, arrayFilters: F }
|
|
21
|
+
} = U(), d = F.get(t.id) || [], [b, i] = O(d), y = k(
|
|
22
|
+
E((e, r) => {
|
|
23
|
+
o(e, r);
|
|
24
|
+
}, m),
|
|
25
|
+
[o]
|
|
26
|
+
), S = (e) => {
|
|
27
|
+
const r = e.map((L) => `${L}`);
|
|
28
|
+
i(r), y(t.id, r);
|
|
29
|
+
}, A = () => {
|
|
30
|
+
i([]), o(t.id, []);
|
|
31
|
+
}, C = _({ data: f, config: t.fetchAsyncFilterOptions });
|
|
32
|
+
return /* @__PURE__ */ l(R, { spacing: "xs", alignX: "stretch", children: [
|
|
33
|
+
/* @__PURE__ */ s(v, { variant: "link", onClick: A, children: "Clear" }),
|
|
34
|
+
/* @__PURE__ */ s(
|
|
35
|
+
w,
|
|
36
|
+
{
|
|
37
|
+
allowMultiple: !0,
|
|
38
|
+
title: t.label,
|
|
39
|
+
options: C,
|
|
40
|
+
selected: b,
|
|
41
|
+
onChange: (e) => S(e)
|
|
49
42
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
),
|
|
44
|
+
n && /* @__PURE__ */ s(
|
|
45
|
+
B,
|
|
46
|
+
{
|
|
47
|
+
width: "200px",
|
|
48
|
+
height: I.sizes[5],
|
|
49
|
+
"aria-busy": !0,
|
|
50
|
+
"aria-label": `Loading ${t.label} filters`
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
!n && g && /* @__PURE__ */ l(M, { variant: "errorSmall", children: [
|
|
54
|
+
"Error: failed to load filter for ",
|
|
55
|
+
t.label
|
|
56
|
+
] })
|
|
58
57
|
] });
|
|
59
58
|
});
|
|
60
59
|
export {
|
|
61
|
-
|
|
60
|
+
P as AsyncCheckboxFilter
|
|
62
61
|
};
|
package/dist/index24.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("mobx-react"),s=require("@veeqo/ui"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),L=require("mobx-react"),O=require("lodash/debounce"),s=require("@veeqo/ui"),R=require("swr/immutable"),j=require("./index66.cjs"),C=require("./index67.cjs"),V=require("./index7.cjs"),k=require("./index56.cjs"),d=e=>e&&e.__esModule?e:{default:e},E=d(O),v=d(R),B=L.observer(({field:e})=>{var l,u;const{FILTERS_DEBOUCE_INTERVAL_MS:h}=V.useBusinessLogic(),g=o.useMemo(()=>{var t;return C.getFetcherFunction({fetcherName:(t=e.fetchAsyncFilterOptions)==null?void 0:t.fetcher})},[(l=e.fetchAsyncFilterOptions)==null?void 0:l.fetcher]),{isLoading:F,isValidating:b,data:S,error:f}=v.default((u=e.fetchAsyncFilterOptions)==null?void 0:u.URL,g),i=F||b,{Filters:{setFilter:c,filters:m}}=k.useStores(),p=m.get(e.id),[y,a]=o.useState(p),q=o.useCallback(E.default((t,r)=>{c(t,r)},h),[c]),x=t=>{const r=`${t[0]}`;a(r),q(e.id,r)},_=()=>{a(""),c(e.id,"")},A=j.getAsyncOptions({data:S,config:e.fetchAsyncFilterOptions});return n.jsxs(s.Stack,{spacing:"xs",alignX:"stretch",children:[n.jsx(s.Button,{variant:"link",onClick:_,children:"Clear"}),n.jsx(s.ChoiceList,{title:e.label,options:A,selected:[y],onChange:t=>x(t)}),i&&n.jsx(s.Skeleton,{width:"200px",height:s.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!i&&f&&n.jsxs(s.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.AsyncRadioFilter=B;
|