@veeqo/transfigure 1.1.2 → 1.1.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/dist/BusinessLogic/mocks.d.ts +1 -1
- package/dist/BusinessLogic/types.d.ts +2 -1
- package/dist/hooks/useUrlParams/useUrlParams.test.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +160 -158
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +184 -18
- package/dist/index100.cjs +19 -1
- package/dist/index100.js +24 -21
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +32 -23
- package/dist/index102.cjs +1 -80
- package/dist/index102.js +28 -100
- package/dist/index103.cjs +80 -1
- package/dist/index103.js +101 -19
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +2 -8
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +17 -62
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +7 -29
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +64 -2
- package/dist/index108.cjs +1 -13
- package/dist/index108.js +30 -17
- package/dist/index109.cjs +13 -1
- package/dist/index109.js +14 -33
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +18 -21
- package/dist/index111.cjs +1 -7
- package/dist/index111.js +36 -10
- package/dist/index112.cjs +7 -1
- package/dist/index112.js +10 -63
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +3 -3
- package/dist/index114.cjs +1 -0
- package/dist/index114.js +65 -0
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +19 -41
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +41 -23
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +24 -36
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +37 -33
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +32 -49
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +47 -38
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +29 -29
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +41 -58
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +2 -5
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +48 -42
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +50 -44
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +46 -7
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +7 -11
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +11 -64
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +40 -39
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +60 -37
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +36 -53
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +54 -51
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +50 -81
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +5 -5
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +81 -35
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +38 -33
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +33 -10
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +10 -39
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +38 -102
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +103 -19
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +17 -134
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +135 -49
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +51 -32
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +31 -53
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +5 -5
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +54 -48
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +41 -81
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +81 -41
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +48 -5
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +5 -45
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +44 -38
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +39 -19
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +19 -8
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +7 -22
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +23 -2
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +5 -9
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +2 -4
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +4 -11
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +10 -12
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +12 -11
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +11 -184
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +183 -25
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +26 -24
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +19 -22
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +25 -97
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +99 -8
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +8 -75
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +8 -51
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +50 -60
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +57 -18
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +22 -18
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +16 -26
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +26 -10
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +21 -331
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +337 -55
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +50 -47
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +51 -32
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +76 -4
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +30 -24
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +26 -32
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +37 -12
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +13 -9
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +9 -17
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +14 -16
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +18 -49
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +50 -21
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +21 -7
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +7 -2
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +4 -14
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +2 -9
- package/dist/index81.cjs +1 -3
- package/dist/index81.js +8 -13
- package/dist/index82.cjs +3 -1
- package/dist/index82.js +13 -8
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +7 -116
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +117 -18
- package/dist/index85.cjs +1 -11
- package/dist/index85.js +19 -16
- package/dist/index86.cjs +11 -1
- package/dist/index86.js +16 -41
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +40 -8
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +9 -13
- package/dist/index89.cjs +1 -104
- package/dist/index89.js +13 -120
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +13 -181
- package/dist/index90.cjs +104 -1
- package/dist/index90.js +117 -65
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +63 -24
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +29 -2
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +2 -41
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +39 -9
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +10 -14
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +19 -31
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +23 -28
- package/dist/index99.cjs +1 -19
- package/dist/index99.js +14 -23
- package/dist/mobx/Filters/Filters.d.ts +1 -1
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/index26.js
CHANGED
|
@@ -1,42 +1,65 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { Stack as
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as C, useState as R, useCallback as V } from "react";
|
|
3
|
+
import { observer as k } from "mobx-react";
|
|
4
|
+
import v from "lodash/debounce";
|
|
5
|
+
import { Stack as u, Text as f, Button as E, ChoiceList as _, Skeleton as I, theme as N } from "@veeqo/ui";
|
|
6
|
+
import T from "swr/immutable";
|
|
7
|
+
import { getAsyncOptions as B } from "./index74.js";
|
|
8
|
+
import { getFetcherFunction as j } from "./index75.js";
|
|
9
|
+
import { SWR_HOOK_OPTIONS as w } from "./index48.js";
|
|
10
|
+
import { useBusinessLogic as M } from "./index8.js";
|
|
11
|
+
import { useStores as U } from "./index60.js";
|
|
12
|
+
const Q = k(({ field: t }) => {
|
|
13
|
+
var h, p;
|
|
14
|
+
const { FILTERS_DEBOUCE_INTERVAL_MS: g } = M(), d = C(() => {
|
|
15
|
+
var e;
|
|
16
|
+
return j({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
|
|
17
|
+
}, [(h = t.fetchAsyncFilterOptions) == null ? void 0 : h.fetcher]), { isLoading: c, isValidating: b, data: F, error: a } = T(
|
|
18
|
+
(p = t.fetchAsyncFilterOptions) == null ? void 0 : p.URL,
|
|
19
|
+
d,
|
|
20
|
+
w
|
|
21
|
+
), l = c || b, {
|
|
22
|
+
Filters: { setFilter: n, filters: S }
|
|
23
|
+
} = U(), O = S.get(t.id), [y, m] = R(O), L = V(
|
|
24
|
+
v((e, r) => {
|
|
25
|
+
n(e, r);
|
|
26
|
+
}, g),
|
|
27
|
+
[n]
|
|
28
|
+
), x = (e) => {
|
|
29
|
+
const r = `${e[0]}`;
|
|
30
|
+
m(r), L(t.id, r);
|
|
31
|
+
}, A = () => {
|
|
32
|
+
m(""), n(t.id, "");
|
|
33
|
+
}, i = B({ data: F, config: t.fetchAsyncFilterOptions });
|
|
34
|
+
return i && i.length === 0 && !c && !a ? /* @__PURE__ */ o(u, { spacing: "xs", alignX: "stretch", children: /* @__PURE__ */ s(f, { variant: "bodySmall", children: [
|
|
35
|
+
"No options available for ",
|
|
36
|
+
t.label
|
|
37
|
+
] }) }) : /* @__PURE__ */ s(u, { spacing: "xs", alignX: "stretch", children: [
|
|
38
|
+
/* @__PURE__ */ o(E, { variant: "link", onClick: A, children: "Clear" }),
|
|
39
|
+
/* @__PURE__ */ o(
|
|
40
|
+
_,
|
|
27
41
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
onChange: (t) => b(t)
|
|
42
|
+
title: t.label,
|
|
43
|
+
options: i,
|
|
44
|
+
selected: [y],
|
|
45
|
+
onChange: (e) => x(e)
|
|
33
46
|
}
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
),
|
|
48
|
+
l && /* @__PURE__ */ o(
|
|
49
|
+
I,
|
|
50
|
+
{
|
|
51
|
+
width: "200px",
|
|
52
|
+
height: N.sizes[5],
|
|
53
|
+
"aria-busy": !0,
|
|
54
|
+
"aria-label": `Loading ${t.label} filters`
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
!l && a && /* @__PURE__ */ s(f, { variant: "errorSmall", children: [
|
|
58
|
+
"Error: failed to load filter for ",
|
|
59
|
+
t.label
|
|
60
|
+
] })
|
|
61
|
+
] });
|
|
39
62
|
});
|
|
40
63
|
export {
|
|
41
|
-
|
|
64
|
+
Q as AsyncRadioFilter
|
|
42
65
|
};
|
package/dist/index27.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("mobx-react"),l=require("react"),C=require("lodash/debounce"),r=require("@veeqo/ui"),F=require("./index8.cjs"),_=require("./index60.cjs"),j=e=>e&&e.__esModule?e:{default:e},k=j(C),q=p.observer(({field:e})=>{var i;const{FILTERS_DEBOUCE_INTERVAL_MS:a}=F.useBusinessLogic(),{Filters:{setArrayFilter:o,arrayFilters:u}}=_.useStores(),d=u.get(e.id)||[],[b,c]=l.useState(d),h=l.useCallback(k.default((t,n)=>{o(t,n)},a),[o]),x=t=>{const n=t.map(g=>`${g}`);c(n),h(e.id,n)},S=()=>{c([]),o(e.id,[])};return(i=e.options)!=null&&i.length?s.jsxs(r.Stack,{spacing:"xs",children:[s.jsx(r.Button,{variant:"link",onClick:S,children:"Clear"}),s.jsx(r.ChoiceList,{allowMultiple:!0,title:e.label,options:e.options,selected:b,onChange:t=>x(t)})]}):s.jsx(r.Stack,{spacing:"xs",alignX:"stretch",children:s.jsxs(r.Text,{variant:"bodySmall",children:["No options available for ",e.label]})})});exports.CheckboxFilter=q;
|
package/dist/index27.js
CHANGED
|
@@ -1,59 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { useBusinessLogic as
|
|
7
|
-
import { useStores as
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
l({
|
|
28
|
-
dates: { start: e.gte, end: e.lte },
|
|
29
|
-
key: h,
|
|
30
|
-
range: e
|
|
31
|
-
});
|
|
32
|
-
}, m = (t) => {
|
|
33
|
-
if (t) {
|
|
34
|
-
if (!e) {
|
|
35
|
-
s();
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
e.setDates(t.start, t.end);
|
|
39
|
-
}
|
|
40
|
-
}, p = () => {
|
|
41
|
-
c(r.id);
|
|
42
|
-
}, F = e ? e.selectedRange : o;
|
|
43
|
-
return /* @__PURE__ */ D(E, { spacing: "xs", children: [
|
|
44
|
-
/* @__PURE__ */ i(P, { variant: "link", onClick: p, children: "Clear" }),
|
|
45
|
-
/* @__PURE__ */ i(
|
|
46
|
-
k,
|
|
1
|
+
import { jsx as s, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { observer as C } from "mobx-react";
|
|
3
|
+
import { useState as S, useCallback as x } from "react";
|
|
4
|
+
import F from "lodash/debounce";
|
|
5
|
+
import { Stack as a, Text as k, Button as V, ChoiceList as v } from "@veeqo/ui";
|
|
6
|
+
import { useBusinessLogic as y } from "./index8.js";
|
|
7
|
+
import { useStores as E } from "./index60.js";
|
|
8
|
+
const w = C(({ field: e }) => {
|
|
9
|
+
var i;
|
|
10
|
+
const { FILTERS_DEBOUCE_INTERVAL_MS: c } = y(), {
|
|
11
|
+
Filters: { setArrayFilter: o, arrayFilters: u }
|
|
12
|
+
} = E(), m = u.get(e.id) || [], [p, n] = S(m), h = x(
|
|
13
|
+
F((t, r) => {
|
|
14
|
+
o(t, r);
|
|
15
|
+
}, c),
|
|
16
|
+
[o]
|
|
17
|
+
), b = (t) => {
|
|
18
|
+
const r = t.map((g) => `${g}`);
|
|
19
|
+
n(r), h(e.id, r);
|
|
20
|
+
}, d = () => {
|
|
21
|
+
n([]), o(e.id, []);
|
|
22
|
+
};
|
|
23
|
+
return (i = e.options) != null && i.length ? /* @__PURE__ */ l(a, { spacing: "xs", children: [
|
|
24
|
+
/* @__PURE__ */ s(V, { variant: "link", onClick: d, children: "Clear" }),
|
|
25
|
+
/* @__PURE__ */ s(
|
|
26
|
+
v,
|
|
47
27
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
28
|
+
allowMultiple: !0,
|
|
29
|
+
title: e.label,
|
|
30
|
+
options: e.options,
|
|
31
|
+
selected: p,
|
|
32
|
+
onChange: (t) => b(t)
|
|
53
33
|
}
|
|
54
34
|
)
|
|
55
|
-
] })
|
|
35
|
+
] }) : /* @__PURE__ */ s(a, { spacing: "xs", alignX: "stretch", children: /* @__PURE__ */ l(k, { variant: "bodySmall", children: [
|
|
36
|
+
"No options available for ",
|
|
37
|
+
e.label
|
|
38
|
+
] }) });
|
|
56
39
|
});
|
|
57
40
|
export {
|
|
58
|
-
|
|
41
|
+
w as CheckboxFilter
|
|
59
42
|
};
|
package/dist/index28.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"),P=require("react"),q=require("mobx-react"),n=require("@veeqo/ui"),E=require("./index69.cjs"),b=require("./index8.cjs"),k=require("./index60.cjs"),v=q.observer(({field:s})=>{const{DEFAULT_DATE_PRESET:c,DEFAULT_DATE_RANGE:l}=b.useBusinessLogic(),{Filters:{dateRangeFilters:i,setRangeFilter:o,clearRangeFilter:g}}=k.useStores(),e=i.get(s.id),[u,R]=P.useState(!1),d=(e==null?void 0:e.filterSelection)||c,a=()=>{const t=new E.RangeFilter;i.set(s.id,t)},F=t=>{const T=t.value===n.DateRanges.TODAY&&e&&(e==null?void 0:e.filterType)===void 0;if(!t||T)return;if(!u){R(!0);return}if(!e){a();return}if(!e)return;const f=t.value;o({dates:{start:e.gte,end:e.lte},key:f,range:e})},S=t=>{if(t){if(!e){a();return}e.setDates(t.start,t.end)}},D=()=>{g(s.id)},h=e?e.selectedRange:l;return r.jsxs(n.Stack,{spacing:"xs",children:[r.jsx(n.Button,{variant:"link",onClick:D,children:"Clear"}),r.jsx(n.DateRangePicker,{"aria-label":`date range for ${s.label}`,selectedPreset:d,setSelectedPreset:F,selectedRange:h,setSelectedRange:S})]})});exports.DateRangeFilter=v;
|
package/dist/index28.js
CHANGED
|
@@ -1,56 +1,59 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { observer as
|
|
4
|
-
import { Stack as
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
const
|
|
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
|
-
case n.TEXT:
|
|
38
|
-
t = "text";
|
|
39
|
-
break;
|
|
1
|
+
import { jsxs as D, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as S } from "react";
|
|
3
|
+
import { observer as T } from "mobx-react";
|
|
4
|
+
import { Stack as E, Button as P, DateRangePicker as k, DateRanges as A } from "@veeqo/ui";
|
|
5
|
+
import { RangeFilter as v } from "./index69.js";
|
|
6
|
+
import { useBusinessLogic as C } from "./index8.js";
|
|
7
|
+
import { useStores as x } from "./index60.js";
|
|
8
|
+
const U = T(({ field: r }) => {
|
|
9
|
+
const { DEFAULT_DATE_PRESET: a, DEFAULT_DATE_RANGE: o } = C(), {
|
|
10
|
+
Filters: { dateRangeFilters: n, setRangeFilter: l, clearRangeFilter: c }
|
|
11
|
+
} = x(), e = n.get(r.id), [g, d] = S(!1), R = (e == null ? void 0 : e.filterSelection) || a, s = () => {
|
|
12
|
+
const t = new v();
|
|
13
|
+
n.set(r.id, t);
|
|
14
|
+
}, f = (t) => {
|
|
15
|
+
const u = t.value === A.TODAY && e && (e == null ? void 0 : e.filterType) === void 0;
|
|
16
|
+
if (!t || u) return;
|
|
17
|
+
if (!g) {
|
|
18
|
+
d(!0);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (!e) {
|
|
22
|
+
s();
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (!e) return;
|
|
26
|
+
const h = t.value;
|
|
27
|
+
l({
|
|
28
|
+
dates: { start: e.gte, end: e.lte },
|
|
29
|
+
key: h,
|
|
30
|
+
range: e
|
|
31
|
+
});
|
|
32
|
+
}, m = (t) => {
|
|
33
|
+
if (t) {
|
|
34
|
+
if (!e) {
|
|
35
|
+
s();
|
|
36
|
+
return;
|
|
40
37
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
e.setDates(t.start, t.end);
|
|
39
|
+
}
|
|
40
|
+
}, p = () => {
|
|
41
|
+
c(r.id);
|
|
42
|
+
}, F = e ? e.selectedRange : o;
|
|
43
|
+
return /* @__PURE__ */ D(E, { spacing: "xs", children: [
|
|
44
|
+
/* @__PURE__ */ i(P, { variant: "link", onClick: p, children: "Clear" }),
|
|
45
|
+
/* @__PURE__ */ i(
|
|
46
|
+
k,
|
|
47
|
+
{
|
|
48
|
+
"aria-label": `date range for ${r.label}`,
|
|
49
|
+
selectedPreset: R,
|
|
50
|
+
setSelectedPreset: f,
|
|
51
|
+
selectedRange: F,
|
|
52
|
+
setSelectedRange: m
|
|
53
|
+
}
|
|
54
|
+
)
|
|
52
55
|
] });
|
|
53
56
|
});
|
|
54
57
|
export {
|
|
55
|
-
|
|
58
|
+
U as DateRangeFilter
|
|
56
59
|
};
|
package/dist/index29.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"),c=require("react"),h=require("mobx-react"),o=require("@veeqo/ui"),x=require("lodash/debounce"),a=require("./index48.cjs"),E=require("./index8.cjs"),T=require("./index60.cjs"),g=r=>r&&r.__esModule?r:{default:r},k=g(x),m=h.observer(({fields:r,groupId:u})=>{const{FILTERS_DEBOUCE_INTERVAL_MS:d}=E.useBusinessLogic(),{Filters:{getFiltersForGroup:F,setFilter:l,clearFiltersForGroup:b}}=T.useStores(),p=F(u),[S,n]=c.useState(p),q=c.useCallback(k.default((e,t)=>{l(e,t)},d),[l]),C=(e,t)=>{n(s=>({...s,[e]:t})),q(e,t)},_=()=>{const e=r.reduce((t,s)=>({...t,[s.id]:""}),{});n(e),b(u)};return i.jsxs(o.Stack,{children:[i.jsx(o.Button,{variant:"link",onClick:_,children:"Clear"}),r.map(e=>{let t;switch(e.filterType){case a.FilterChoiceValue.NUMBER:t="number";break;case a.FilterChoiceValue.TEXT:t="text";break}return i.jsx(o.TextField,{type:t,value:S[e.id],label:e.label,onChange:s=>C(e.id,s)},e.id)})]})});exports.MultipleFieldFilter=m;
|
package/dist/index29.js
CHANGED
|
@@ -1,87 +1,56 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as C, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useCallback as h } from "react";
|
|
3
3
|
import { observer as k } from "mobx-react";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
const
|
|
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
|
-
}, L = (o) => {
|
|
41
|
-
if (e || m(), !e) return;
|
|
42
|
-
const t = Number(o);
|
|
43
|
-
if (t < e.gteMin) return;
|
|
44
|
-
let { lte: i } = e, { gte: n } = e;
|
|
45
|
-
t >= e.gteMin && t <= e.lteMax && (i = t), (!e.gte || t <= e.gte) && (n = e.gteMin), r({ gte: n, lte: i }), g({ numberRange: e, lte: i, gte: n });
|
|
46
|
-
}, v = [a.gte, a.lte];
|
|
47
|
-
return /* @__PURE__ */ R(c, { spacing: "xs", alignX: "stretch", children: [
|
|
48
|
-
/* @__PURE__ */ s(_, { variant: "link", onClick: C, children: "Clear" }),
|
|
49
|
-
/* @__PURE__ */ R(c, { direction: "horizontal", children: [
|
|
50
|
-
/* @__PURE__ */ s(
|
|
51
|
-
p,
|
|
52
|
-
{
|
|
53
|
-
label: e == null ? void 0 : e.gteMinLabel,
|
|
54
|
-
type: "number",
|
|
55
|
-
min: e == null ? void 0 : e.gteMin,
|
|
56
|
-
max: e == null ? void 0 : e.lteMax,
|
|
57
|
-
value: a.gte.toString(),
|
|
58
|
-
onChange: S
|
|
59
|
-
}
|
|
60
|
-
),
|
|
61
|
-
/* @__PURE__ */ s(
|
|
62
|
-
p,
|
|
63
|
-
{
|
|
64
|
-
label: e == null ? void 0 : e.lteMaxLabel,
|
|
65
|
-
type: "number",
|
|
66
|
-
min: e == null ? void 0 : e.gteMin,
|
|
67
|
-
max: e == null ? void 0 : e.lteMax,
|
|
68
|
-
value: a.lte.toString(),
|
|
69
|
-
onChange: L
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
] }),
|
|
73
|
-
/* @__PURE__ */ s(
|
|
74
|
-
A,
|
|
75
|
-
{
|
|
76
|
-
value: v,
|
|
77
|
-
onChange: N,
|
|
78
|
-
min: e == null ? void 0 : e.gteMin,
|
|
79
|
-
max: e == null ? void 0 : e.lteMax,
|
|
80
|
-
valueLabelDisplay: "auto"
|
|
4
|
+
import { Stack as S, Button as T, TextField as x } from "@veeqo/ui";
|
|
5
|
+
import V from "lodash/debounce";
|
|
6
|
+
import { FilterChoiceValue as n } from "./index48.js";
|
|
7
|
+
import { useBusinessLogic as f } from "./index8.js";
|
|
8
|
+
import { useStores as B } from "./index60.js";
|
|
9
|
+
const N = k(({ fields: o, groupId: s }) => {
|
|
10
|
+
const { FILTERS_DEBOUCE_INTERVAL_MS: a } = f(), {
|
|
11
|
+
Filters: { getFiltersForGroup: u, setFilter: i, clearFiltersForGroup: m }
|
|
12
|
+
} = B(), F = u(s), [p, l] = E(F), d = h(
|
|
13
|
+
V((e, t) => {
|
|
14
|
+
i(e, t);
|
|
15
|
+
}, a),
|
|
16
|
+
[i]
|
|
17
|
+
), b = (e, t) => {
|
|
18
|
+
l((r) => ({ ...r, [e]: t })), d(e, t);
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ C(S, { children: [
|
|
21
|
+
/* @__PURE__ */ c(T, { variant: "link", onClick: () => {
|
|
22
|
+
const e = o.reduce(
|
|
23
|
+
(t, r) => ({
|
|
24
|
+
...t,
|
|
25
|
+
[r.id]: ""
|
|
26
|
+
}),
|
|
27
|
+
{}
|
|
28
|
+
);
|
|
29
|
+
l(e), m(s);
|
|
30
|
+
}, children: "Clear" }),
|
|
31
|
+
o.map((e) => {
|
|
32
|
+
let t;
|
|
33
|
+
switch (e.filterType) {
|
|
34
|
+
case n.NUMBER:
|
|
35
|
+
t = "number";
|
|
36
|
+
break;
|
|
37
|
+
case n.TEXT:
|
|
38
|
+
t = "text";
|
|
39
|
+
break;
|
|
81
40
|
}
|
|
82
|
-
|
|
41
|
+
return /* @__PURE__ */ c(
|
|
42
|
+
x,
|
|
43
|
+
{
|
|
44
|
+
type: t,
|
|
45
|
+
value: p[e.id],
|
|
46
|
+
label: e.label,
|
|
47
|
+
onChange: (r) => b(e.id, r)
|
|
48
|
+
},
|
|
49
|
+
e.id
|
|
50
|
+
);
|
|
51
|
+
})
|
|
83
52
|
] });
|
|
84
53
|
});
|
|
85
54
|
export {
|
|
86
|
-
|
|
55
|
+
N as MultipleFieldFilter
|
|
87
56
|
};
|
package/dist/index3.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("./index7.cjs"),s=require("./index52.cjs"),i=require("./index53.cjs"),o=e=>t.axios.delete(`/api/v2/custom_views/${e}`,s.withCSRF(i.vndAPI));exports.deleteCustomView=o;
|
package/dist/index3.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { axios as t } from "./
|
|
2
|
-
import { withCSRF as
|
|
3
|
-
import { vndAPI as
|
|
4
|
-
const s = (
|
|
1
|
+
import { axios as t } from "./index7.js";
|
|
2
|
+
import { withCSRF as e } from "./index52.js";
|
|
3
|
+
import { vndAPI as i } from "./index53.js";
|
|
4
|
+
const s = (o) => t.delete(`/api/v2/custom_views/${o}`, e(i));
|
|
5
5
|
export {
|
|
6
|
-
s as
|
|
6
|
+
s as deleteCustomView
|
|
7
7
|
};
|
package/dist/index30.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/jsx-runtime"),d=require("react"),_=require("mobx-react"),j=require("lodash/debounce"),r=require("@veeqo/ui"),L=require("./index111.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;
|