@veeqo/transfigure 1.2.6 → 1.2.7
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 -0
- package/dist/components/Filters/ActiveFilters/Categories/FilterField/FilterField.d.ts +3 -1
- package/dist/constants/constants.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +89 -88
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +37 -30
- package/dist/index100.cjs +1 -12
- package/dist/index100.js +11 -16
- package/dist/index101.cjs +19 -1
- package/dist/index101.js +24 -38
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +21 -29
- package/dist/index103.cjs +1 -19
- package/dist/index103.js +14 -23
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +36 -19
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +26 -12
- package/dist/index107.cjs +10 -78
- package/dist/index107.js +13 -98
- package/dist/index108.cjs +80 -1
- package/dist/index108.js +101 -19
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +2 -8
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +17 -62
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +7 -29
- package/dist/index112.cjs +1 -13
- package/dist/index112.js +63 -16
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +30 -2
- package/dist/index114.cjs +13 -1
- package/dist/index114.js +14 -33
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +32 -22
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +25 -62
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +5 -47
- package/dist/index119.cjs +1 -0
- package/dist/index119.js +65 -0
- package/dist/index120.cjs +1 -0
- package/dist/index120.js +49 -0
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +16 -15
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +10 -9
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +33 -26
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +21 -20
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +40 -37
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +1 -1
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +7 -7
- package/dist/index36.cjs +1 -1
- package/dist/index36.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/index41.cjs +1 -1
- package/dist/index41.js +1 -1
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +1 -1
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +1 -1
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +2 -2
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +2 -2
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +6 -5
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +1 -1
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +1 -1
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +1 -1
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +1 -1
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +41 -5
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +8 -117
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +2 -19
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +5 -41
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +117 -8
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +19 -13
- package/dist/index92.cjs +1 -104
- package/dist/index92.js +7 -120
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +16 -66
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +13 -29
- package/dist/index95.cjs +104 -1
- package/dist/index95.js +120 -2
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +65 -38
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +26 -8
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +2 -18
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +40 -6
- package/dist/utils/isTextFilterValid/index.d.ts +1 -0
- package/dist/utils/isTextFilterValid/isTextFilterValid.d.ts +7 -0
- package/dist/utils/isTextFilterValid/isTextFilterValid.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/index119.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
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 "./index115.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
|
+
);
|
|
63
|
+
export {
|
|
64
|
+
j as FilterNumberRangeFilter
|
|
65
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("react"),d=require("mobx-react"),t=require("@veeqo/ui"),m=require("swr/immutable"),x=require("./index75.cjs"),y=require("./index76.cjs"),F=require("./index49.cjs"),O=e=>e&&e.__esModule?e:{default:e},A=O(m),S=d.observer(({field:e,editedValue:o,setEditedValue:a})=>{var c,i;const l=p.useMemo(()=>{var r;return y.getFetcherFunction({fetcherName:(r=e.fetchAsyncFilterOptions)==null?void 0:r.fetcher})},[(c=e.fetchAsyncFilterOptions)==null?void 0:c.fetcher]),{isLoading:u,isValidating:h,data:g,error:b}=A.default((i=e.fetchAsyncFilterOptions)==null?void 0:i.URL,l,F.SWR_HOOK_OPTIONS),n=u||h,f=x.getAsyncOptions({data:g,config:e.fetchAsyncFilterOptions});return s.jsxs(t.Stack,{spacing:"xs",alignX:"stretch",children:[s.jsx(t.ChoiceList,{allowMultiple:!0,title:e.label,options:f,selected:o,onChange:r=>a(r)}),n&&s.jsx(t.Skeleton,{width:"200px",height:t.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!n&&b&&s.jsxs(t.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.ActiveAsyncCheckboxFilter=S;
|
package/dist/index120.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as u } from "react";
|
|
3
|
+
import { observer as O } from "mobx-react";
|
|
4
|
+
import { Stack as b, ChoiceList as F, Skeleton as x, theme as y, Text as A } from "@veeqo/ui";
|
|
5
|
+
import S from "swr/immutable";
|
|
6
|
+
import { getAsyncOptions as d } from "./index75.js";
|
|
7
|
+
import { getFetcherFunction as L } from "./index76.js";
|
|
8
|
+
import { SWR_HOOK_OPTIONS as k } from "./index49.js";
|
|
9
|
+
const T = O(
|
|
10
|
+
({ field: t, editedValue: c, setEditedValue: a }) => {
|
|
11
|
+
var o, i;
|
|
12
|
+
const l = u(() => {
|
|
13
|
+
var e;
|
|
14
|
+
return L({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
|
|
15
|
+
}, [(o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher]), { isLoading: m, isValidating: h, data: p, error: f } = S(
|
|
16
|
+
(i = t.fetchAsyncFilterOptions) == null ? void 0 : i.URL,
|
|
17
|
+
l,
|
|
18
|
+
k
|
|
19
|
+
), r = m || h, g = d({ data: p, config: t.fetchAsyncFilterOptions });
|
|
20
|
+
return /* @__PURE__ */ s(b, { spacing: "xs", alignX: "stretch", children: [
|
|
21
|
+
/* @__PURE__ */ n(
|
|
22
|
+
F,
|
|
23
|
+
{
|
|
24
|
+
allowMultiple: !0,
|
|
25
|
+
title: t.label,
|
|
26
|
+
options: g,
|
|
27
|
+
selected: c,
|
|
28
|
+
onChange: (e) => a(e)
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
r && /* @__PURE__ */ n(
|
|
32
|
+
x,
|
|
33
|
+
{
|
|
34
|
+
width: "200px",
|
|
35
|
+
height: y.sizes[5],
|
|
36
|
+
"aria-busy": !0,
|
|
37
|
+
"aria-label": `Loading ${t.label} filters`
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
!r && f && /* @__PURE__ */ s(A, { variant: "errorSmall", children: [
|
|
41
|
+
"Error: failed to load filter for ",
|
|
42
|
+
t.label
|
|
43
|
+
] })
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
export {
|
|
48
|
+
T as ActiveAsyncCheckboxFilter
|
|
49
|
+
};
|
package/dist/index13.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),_=require("mobx-react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),_=require("mobx-react"),f=require("@veeqo/ui"),b=require("lodash/debounce"),o=require("react"),q=require("./index88.cjs"),x=require("./index8.cjs"),g=require("./index61.cjs"),h=e=>e&&e.__esModule?e:{default:e},E=h(b),F=_.observer(({onChange:e,capture:R,...c})=>{const{SEARCH_FILTER_ID:s,FILTERS_DEBOUCE_INTERVAL_MS:i}=x.useBusinessLogic(),{Filters:{setFilter:r,filters:n}}=g.useStores(),[a,l]=o.useState(n.get(s)||""),d=o.useCallback(E.default(t=>{r(s,t)},i),[r,s]),S=t=>{l(t),q.isTextFilterValid(t)&&d(t),e&&e(t)};return u.jsx("div",{style:{flexGrow:1},children:u.jsx(f.Search,{value:a,onChange:S,...c})})});exports.SearchBar=F;
|
package/dist/index13.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { observer as
|
|
3
|
-
import { Search as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { observer as f } from "mobx-react";
|
|
3
|
+
import { Search as u } from "@veeqo/ui";
|
|
4
4
|
import p from "lodash/debounce";
|
|
5
|
-
import { useState as S, useCallback as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import { useState as S, useCallback as d } from "react";
|
|
6
|
+
import { isTextFilterValid as h } from "./index88.js";
|
|
7
|
+
import { useBusinessLogic as E } from "./index8.js";
|
|
8
|
+
import { useStores as C } from "./index61.js";
|
|
9
|
+
const v = f(({ onChange: o, capture: F, ...s }) => {
|
|
10
|
+
const { SEARCH_FILTER_ID: r, FILTERS_DEBOUCE_INTERVAL_MS: n } = E(), {
|
|
11
|
+
Filters: { setFilter: t, filters: m }
|
|
12
|
+
} = C(), [a, l] = S(m.get(r) || ""), c = d(
|
|
12
13
|
p((e) => {
|
|
13
14
|
t(r, e);
|
|
14
|
-
},
|
|
15
|
+
}, n),
|
|
15
16
|
[t, r]
|
|
16
17
|
);
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
|
|
19
|
-
}, ...
|
|
18
|
+
return /* @__PURE__ */ i("div", { style: { flexGrow: 1 }, children: /* @__PURE__ */ i(u, { value: a, onChange: (e) => {
|
|
19
|
+
l(e), h(e) && c(e), o && o(e);
|
|
20
|
+
}, ...s }) });
|
|
20
21
|
});
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
+
v as SearchBar
|
|
23
24
|
};
|
package/dist/index17.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),l=require("mobx-react"),s=require("@veeqo/ui"),c=require("./index49.cjs"),u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),l=require("mobx-react"),s=require("@veeqo/ui"),c=require("./index49.cjs"),u=require("./index120.cjs"),h=l.observer(({data:e,editedValue:r,setEditedValue:t})=>{var i;switch(e.filterType){case c.FilterChoiceValue.CHECKBOX:return e.fetchAsyncFilterOptions?o.jsx(u.ActiveAsyncCheckboxFilter,{field:e,setEditedValue:t,editedValue:r}):o.jsx(s.ChoiceList,{allowMultiple:!0,title:e.label,options:(i=e.options)!=null&&i.length?e.options:[],selected:r,onChange:n=>t(n)});default:return null}});exports.FilterArrayField=h;
|
package/dist/index17.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { observer as n } from "mobx-react";
|
|
3
3
|
import { ChoiceList as p } from "@veeqo/ui";
|
|
4
4
|
import { FilterChoiceValue as s } from "./index49.js";
|
|
5
|
-
import { ActiveAsyncCheckboxFilter as c } from "./
|
|
5
|
+
import { ActiveAsyncCheckboxFilter as c } from "./index120.js";
|
|
6
6
|
const F = n(
|
|
7
7
|
({ data: r, editedValue: e, setEditedValue: o }) => {
|
|
8
8
|
var i;
|
package/dist/index18.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),F=require("mobx-react"),s=require("@veeqo/ui"),i=require("./index49.cjs"),h=require("./index23.cjs"),b=F.observer(({data:e,editedValue:r,setEditedValue:t,error:u})=>{var n;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(s.TextField,{label:e.label,type:l,value:r,onChange:c=>t(c),error:u});case i.FilterChoiceValue.RADIO:return e.fetchAsyncFilterOptions?o.jsx(h.ActiveAsyncRadioFilter,{field:e,setEditedValue:t,editedValue:r}):o.jsx(s.ChoiceList,{title:e.label,options:(n=e.options)!=null&&n.length?e.options:[],selected:[r],onChange:c=>t(`${c[0]}`)});default:return null}});exports.FilterField=b;
|
package/dist/index18.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { observer as
|
|
3
|
-
import { ChoiceList as
|
|
2
|
+
import { observer as p } from "mobx-react";
|
|
3
|
+
import { ChoiceList as f, TextField as m } from "@veeqo/ui";
|
|
4
4
|
import { FilterChoiceValue as r } from "./index49.js";
|
|
5
|
-
import { ActiveAsyncRadioFilter as
|
|
6
|
-
const
|
|
5
|
+
import { ActiveAsyncRadioFilter as h } from "./index23.js";
|
|
6
|
+
const x = p(({ data: e, editedValue: o, setEditedValue: i, error: c }) => {
|
|
7
7
|
var s;
|
|
8
8
|
let t;
|
|
9
9
|
switch (e.filterType) {
|
|
@@ -18,24 +18,25 @@ const y = c(({ data: e, editedValue: o, setEditedValue: i }) => {
|
|
|
18
18
|
case r.TEXT:
|
|
19
19
|
case r.NUMBER:
|
|
20
20
|
return /* @__PURE__ */ n(
|
|
21
|
-
|
|
21
|
+
m,
|
|
22
22
|
{
|
|
23
23
|
label: e.label,
|
|
24
24
|
type: t,
|
|
25
25
|
value: o,
|
|
26
|
-
onChange: (l) => i(l)
|
|
26
|
+
onChange: (l) => i(l),
|
|
27
|
+
error: c
|
|
27
28
|
}
|
|
28
29
|
);
|
|
29
30
|
case r.RADIO:
|
|
30
31
|
return e.fetchAsyncFilterOptions ? /* @__PURE__ */ n(
|
|
31
|
-
|
|
32
|
+
h,
|
|
32
33
|
{
|
|
33
34
|
field: e,
|
|
34
35
|
setEditedValue: i,
|
|
35
36
|
editedValue: o
|
|
36
37
|
}
|
|
37
38
|
) : /* @__PURE__ */ n(
|
|
38
|
-
|
|
39
|
+
f,
|
|
39
40
|
{
|
|
40
41
|
title: e.label,
|
|
41
42
|
options: (s = e.options) != null && s.length ? e.options : [],
|
|
@@ -48,5 +49,5 @@ const y = c(({ data: e, editedValue: o, setEditedValue: i }) => {
|
|
|
48
49
|
}
|
|
49
50
|
});
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
+
x as FilterField
|
|
52
53
|
};
|
package/dist/index19.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("react"),g=require("mobx-react"),v=require("@veeqo/ui"),x=require("./index88.cjs"),l=require("./index49.cjs"),T=require("./index117.cjs"),V=require("./index61.cjs"),y=require("./index59.cjs"),h=require("./index24.cjs"),j=require("./index18.cjs"),p=require("./index25.cjs"),R=g.observer(({filterData:e})=>{const{Filters:{filters:o,clearFilter:F,setFilter:a}}=V.useStores(),r=o.get(e.id),{filterLabel:q}=y.useFilterLabel({filterData:e}),[i,c]=s.useState(r||""),[n,b]=s.useState("");s.useEffect(()=>{i!==r&&c(r||"")},[e.id,r,o]);const A=()=>{F(e.id)},E=()=>{n||a(e.id,i)},S=u=>{let d="";(e.filterType===l.FilterChoiceValue.TEXT||e.filterType===l.FilterChoiceValue.NUMBER)&&(d=x.isTextFilterValid(String(u))?"":l.MIN_SEARCH_ERROR_MESSAGE),c(u),b(d)};return t.jsx(v.FilterTag,{shouldCloseOnClickAway:!0,header:t.jsx(p.ActiveFilterHeader,{filterLabel:e.label,glyph:e.glyph}),label:e.label,text:q||"Loading...",content:t.jsx("div",{className:T.default.fieldContainer,children:t.jsx(j.FilterField,{data:e,editedValue:i,setEditedValue:S,error:n})}),footer:t.jsx(h.ActiveFilterFooter,{clearActiveFilter:A,applyActiveFilter:E})})});exports.ActiveFilterTag=R;
|
package/dist/index19.js
CHANGED
|
@@ -1,43 +1,50 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { observer as
|
|
4
|
-
import { FilterTag as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d, useEffect as b } from "react";
|
|
3
|
+
import { observer as g } from "mobx-react";
|
|
4
|
+
import { FilterTag as y } from "@veeqo/ui";
|
|
5
|
+
import { isTextFilterValid as S } from "./index88.js";
|
|
6
|
+
import { FilterChoiceValue as n, MIN_SEARCH_ERROR_MESSAGE as T } from "./index49.js";
|
|
7
|
+
import V from "./index117.js";
|
|
5
8
|
import { useStores as h } from "./index61.js";
|
|
6
9
|
import { useFilterLabel as v } from "./index59.js";
|
|
7
|
-
import { ActiveFilterFooter as
|
|
8
|
-
import { FilterField as
|
|
9
|
-
import { ActiveFilterHeader as
|
|
10
|
-
const
|
|
10
|
+
import { ActiveFilterFooter as C } from "./index24.js";
|
|
11
|
+
import { FilterField as R } from "./index18.js";
|
|
12
|
+
import { ActiveFilterHeader as x } from "./index25.js";
|
|
13
|
+
const U = g(({ filterData: e }) => {
|
|
11
14
|
const {
|
|
12
|
-
Filters: { filters: i, clearFilter:
|
|
13
|
-
} = h(),
|
|
14
|
-
|
|
15
|
-
o !==
|
|
16
|
-
}, [e.id,
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
15
|
+
Filters: { filters: i, clearFilter: p, setFilter: f }
|
|
16
|
+
} = h(), t = i.get(e.id), { filterLabel: u } = v({ filterData: e }), [o, l] = d(t || ""), [s, F] = d("");
|
|
17
|
+
b(() => {
|
|
18
|
+
o !== t && l(t || "");
|
|
19
|
+
}, [e.id, t, i]);
|
|
20
|
+
const E = () => {
|
|
21
|
+
p(e.id);
|
|
22
|
+
}, A = () => {
|
|
23
|
+
s || f(e.id, o);
|
|
24
|
+
}, a = (m) => {
|
|
25
|
+
let c = "";
|
|
26
|
+
(e.filterType === n.TEXT || e.filterType === n.NUMBER) && (c = S(String(m)) ? "" : T), l(m), F(c);
|
|
21
27
|
};
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
|
|
28
|
+
return /* @__PURE__ */ r(
|
|
29
|
+
y,
|
|
24
30
|
{
|
|
25
31
|
shouldCloseOnClickAway: !0,
|
|
26
|
-
header: /* @__PURE__ */
|
|
32
|
+
header: /* @__PURE__ */ r(x, { filterLabel: e.label, glyph: e.glyph }),
|
|
27
33
|
label: e.label,
|
|
28
|
-
text:
|
|
29
|
-
content: /* @__PURE__ */
|
|
30
|
-
|
|
34
|
+
text: u || "Loading...",
|
|
35
|
+
content: /* @__PURE__ */ r("div", { className: V.fieldContainer, children: /* @__PURE__ */ r(
|
|
36
|
+
R,
|
|
31
37
|
{
|
|
32
38
|
data: e,
|
|
33
39
|
editedValue: o,
|
|
34
|
-
setEditedValue:
|
|
40
|
+
setEditedValue: a,
|
|
41
|
+
error: s
|
|
35
42
|
}
|
|
36
43
|
) }),
|
|
37
|
-
footer: /* @__PURE__ */
|
|
44
|
+
footer: /* @__PURE__ */ r(C, { clearActiveFilter: E, applyActiveFilter: A })
|
|
38
45
|
}
|
|
39
46
|
);
|
|
40
47
|
});
|
|
41
48
|
export {
|
|
42
|
-
|
|
49
|
+
U as ActiveFilterTag
|
|
43
50
|
};
|
package/dist/index20.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"),c=require("react"),A=require("mobx-react"),y=require("@veeqo/ui"),b=require("./index58.cjs"),v=require("./index17.cjs"),q=require("./index117.cjs"),g=require("./index61.cjs"),x=require("./index24.cjs"),j=require("./index25.cjs"),V=A.observer(({filterData:e})=>{const{Filters:{arrayFilters:l,clearArrayFilter:o,setArrayFilter:u}}=g.useStores(),t=l.get(e.id),[i,s]=c.useState(t||[]);c.useEffect(()=>{i!==t&&s(t||[])},[e.id,t,l]);const a=()=>{o(e.id)},n=()=>{u(e.id,i)},{filterLabel:d}=b.useFilterArrayLabel({filterData:e});return r.jsx(y.FilterTag,{shouldCloseOnClickAway:!0,header:r.jsx(j.ActiveFilterHeader,{filterLabel:e.label,glyph:e.glyph}),label:e.label,text:d||"",content:r.jsx("div",{className:q.default.fieldContainer,children:r.jsx(v.FilterArrayField,{data:e,editedValue:i||[],setEditedValue:F=>s(F)})}),footer:r.jsx(x.ActiveFilterFooter,{clearActiveFilter:a,applyActiveFilter:n})})});exports.ActiveFilterArrayTag=V;
|
package/dist/index20.js
CHANGED
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as p, useEffect as F } from "react";
|
|
3
3
|
import { observer as u } from "mobx-react";
|
|
4
|
-
import { FilterTag as y
|
|
5
|
-
import { useFilterArrayLabel as
|
|
6
|
-
import { FilterArrayField as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
4
|
+
import { FilterTag as y } from "@veeqo/ui";
|
|
5
|
+
import { useFilterArrayLabel as A } from "./index58.js";
|
|
6
|
+
import { FilterArrayField as f } from "./index17.js";
|
|
7
|
+
import b from "./index117.js";
|
|
8
|
+
import { useStores as v } from "./index61.js";
|
|
9
|
+
import { ActiveFilterFooter as g } from "./index24.js";
|
|
10
|
+
import { ActiveFilterHeader as h } from "./index25.js";
|
|
11
|
+
const H = u(({ filterData: e }) => {
|
|
11
12
|
const {
|
|
12
|
-
Filters: { arrayFilters:
|
|
13
|
-
} =
|
|
13
|
+
Filters: { arrayFilters: i, clearArrayFilter: s, setArrayFilter: m }
|
|
14
|
+
} = v(), t = i.get(e.id), [o, l] = p(t || []);
|
|
14
15
|
F(() => {
|
|
15
|
-
|
|
16
|
-
}, [e.id, t,
|
|
17
|
-
const
|
|
16
|
+
o !== t && l(t || []);
|
|
17
|
+
}, [e.id, t, i]);
|
|
18
|
+
const d = () => {
|
|
18
19
|
s(e.id);
|
|
19
20
|
}, c = () => {
|
|
20
|
-
|
|
21
|
-
}, { filterLabel: a } =
|
|
21
|
+
m(e.id, o);
|
|
22
|
+
}, { filterLabel: a } = A({ filterData: e });
|
|
22
23
|
return /* @__PURE__ */ r(
|
|
23
24
|
y,
|
|
24
25
|
{
|
|
25
26
|
shouldCloseOnClickAway: !0,
|
|
26
|
-
header: /* @__PURE__ */ r(
|
|
27
|
+
header: /* @__PURE__ */ r(h, { filterLabel: e.label, glyph: e.glyph }),
|
|
27
28
|
label: e.label,
|
|
28
29
|
text: a || "",
|
|
29
|
-
content: /* @__PURE__ */ r(
|
|
30
|
-
|
|
30
|
+
content: /* @__PURE__ */ r("div", { className: b.fieldContainer, children: /* @__PURE__ */ r(
|
|
31
|
+
f,
|
|
31
32
|
{
|
|
32
33
|
data: e,
|
|
33
|
-
editedValue:
|
|
34
|
+
editedValue: o || [],
|
|
34
35
|
setEditedValue: (n) => l(n)
|
|
35
36
|
}
|
|
36
37
|
) }),
|
|
37
|
-
footer: /* @__PURE__ */ r(
|
|
38
|
+
footer: /* @__PURE__ */ r(g, { clearActiveFilter: d, applyActiveFilter: c })
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
41
|
});
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
H as ActiveFilterArrayTag
|
|
43
44
|
};
|
package/dist/index22.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("react"),d=require("mobx-react"),l=require("@veeqo/ui"),m=require("./index69.cjs"),R=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),s=require("react"),d=require("mobx-react"),l=require("@veeqo/ui"),m=require("./index69.cjs"),R=require("./index119.cjs"),v=require("./index61.cjs"),N=require("./index24.cjs"),q=require("./index25.cjs"),A=d.observer(({filterData:t})=>{const{Filters:{numberRangeFilters:u,clearNumberRangeFilter:a,setNumberRangeFilter:g}}=v.useStores(),e=u.get(t.id),[n,c]=s.useState(e),o=s.useCallback(()=>{const r=new m.NumberRangeFilter({filterId:t.id});return e&&(e.gte&&r.setGte(e.gte),e.lte&&r.setLte(e.lte)),r},[t.id,e]);s.useEffect(()=>{const r=o();c(r)},[o,e]);const F=()=>{a(t.id)},b=()=>{!e||!n||g({numberRange:e,lte:n.lte,gte:n.gte})};return i.jsx(l.FilterTag,{shouldCloseOnClickAway:!0,header:i.jsx(q.ActiveFilterHeader,{filterLabel:t.label,glyph:t.glyph}),label:t.label,text:(e==null?void 0:e.filterLabel)||"Loading...",content:i.jsx(l.BaseContainer,{style:{padding:l.theme.sizes.md},children:i.jsx(R.FilterNumberRangeFilter,{data:t,editedValue:n,setEditedValue:c})}),footer:i.jsx(N.ActiveFilterFooter,{clearActiveFilter:F,applyActiveFilter:b})})});exports.ActiveFilterNumberRangeTag=A;
|
package/dist/index22.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useState as a, useCallback as d, useEffect as F } from "react";
|
|
|
3
3
|
import { observer as b } from "mobx-react";
|
|
4
4
|
import { FilterTag as p, BaseContainer as f, theme as R } from "@veeqo/ui";
|
|
5
5
|
import { NumberRangeFilter as N } from "./index69.js";
|
|
6
|
-
import { FilterNumberRangeFilter as h } from "./
|
|
6
|
+
import { FilterNumberRangeFilter as h } from "./index119.js";
|
|
7
7
|
import { useStores as v } from "./index61.js";
|
|
8
8
|
import { ActiveFilterFooter as A } from "./index24.js";
|
|
9
9
|
import { ActiveFilterHeader as w } from "./index25.js";
|
package/dist/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 l=require("react/jsx-runtime"),o=require("react"),g=require("mobx-react"),u=require("@veeqo/ui"),h=require("lodash/debounce"),n=require("./index49.cjs"),j=require("./index88.cjs"),m=require("./index8.cjs"),y=require("./index61.cjs"),k=r=>r&&r.__esModule?r:{default:r},B=k(h),v=g.observer(({fields:r,groupId:c})=>{const{FILTERS_DEBOUCE_INTERVAL_MS:S}=m.useBusinessLogic(),{Filters:{getFiltersForGroup:p,setFilter:a,clearFiltersForGroup:V}}=y.useStores(),_=p(c),[d,F]=o.useState(_),[E,x]=o.useState({}),C=o.useCallback(B.default((e,t)=>{a(e,t)},S),[a]),q=(e,t)=>{const s={...d,[e]:t},i={...E},T=Object.entries(s).every(([b,M])=>j.isTextFilterValid(String(M))?(i[b]="",!0):(i[b]=n.MIN_SEARCH_ERROR_MESSAGE,!1));F(s),x(i),T&&C(e,t)},R=()=>{const e=r.reduce((t,s)=>({...t,[s.id]:""}),{});F(e),V(c)};return l.jsxs(u.FlexCol,{children:[l.jsx(u.Button,{variant:"link",onClick:R,children:"Clear"}),r.map(e=>{let t;switch(e.filterType){case n.FilterChoiceValue.NUMBER:t="number";break;case n.FilterChoiceValue.TEXT:t="text";break}return l.jsx(u.TextField,{type:t,value:d[e.id],error:E[e.id],label:e.label,onChange:s=>q(e.id,s)},e.id)})]})});exports.MultipleFieldFilter=v;
|
package/dist/index30.js
CHANGED
|
@@ -1,50 +1,53 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { observer as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { FilterChoiceValue as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { jsxs as T, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useCallback as h } from "react";
|
|
3
|
+
import { observer as _ } from "mobx-react";
|
|
4
|
+
import { FlexCol as k, Button as M, TextField as g } from "@veeqo/ui";
|
|
5
|
+
import y from "lodash/debounce";
|
|
6
|
+
import { FilterChoiceValue as F, MIN_SEARCH_ERROR_MESSAGE as B } from "./index49.js";
|
|
7
|
+
import { isTextFilterValid as G } from "./index88.js";
|
|
8
|
+
import { useBusinessLogic as j } from "./index8.js";
|
|
9
|
+
import { useStores as v } from "./index61.js";
|
|
10
|
+
const q = _(({ fields: s, groupId: i }) => {
|
|
11
|
+
const { FILTERS_DEBOUCE_INTERVAL_MS: p } = j(), {
|
|
12
|
+
Filters: { getFiltersForGroup: E, setFilter: l, clearFiltersForGroup: b }
|
|
13
|
+
} = v(), C = E(i), [n, a] = m(C), [c, S] = m({}), V = h(
|
|
14
|
+
y((e, r) => {
|
|
15
|
+
l(e, r);
|
|
16
|
+
}, p),
|
|
17
|
+
[l]
|
|
18
|
+
), f = (e, r) => {
|
|
19
|
+
const t = { ...n, [e]: r }, o = { ...c }, x = Object.entries(t).every(([u, R]) => G(String(R)) ? (o[u] = "", !0) : (o[u] = B, !1));
|
|
20
|
+
a(t), S(o), x && V(e, r);
|
|
19
21
|
};
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
const e =
|
|
23
|
-
(
|
|
24
|
-
...
|
|
25
|
-
[
|
|
22
|
+
return /* @__PURE__ */ T(k, { children: [
|
|
23
|
+
/* @__PURE__ */ d(M, { variant: "link", onClick: () => {
|
|
24
|
+
const e = s.reduce(
|
|
25
|
+
(r, t) => ({
|
|
26
|
+
...r,
|
|
27
|
+
[t.id]: ""
|
|
26
28
|
}),
|
|
27
29
|
{}
|
|
28
30
|
);
|
|
29
|
-
|
|
31
|
+
a(e), b(i);
|
|
30
32
|
}, children: "Clear" }),
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
+
s.map((e) => {
|
|
34
|
+
let r;
|
|
33
35
|
switch (e.filterType) {
|
|
34
|
-
case
|
|
35
|
-
|
|
36
|
+
case F.NUMBER:
|
|
37
|
+
r = "number";
|
|
36
38
|
break;
|
|
37
|
-
case
|
|
38
|
-
|
|
39
|
+
case F.TEXT:
|
|
40
|
+
r = "text";
|
|
39
41
|
break;
|
|
40
42
|
}
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
43
|
+
return /* @__PURE__ */ d(
|
|
44
|
+
g,
|
|
43
45
|
{
|
|
44
|
-
type:
|
|
45
|
-
value:
|
|
46
|
+
type: r,
|
|
47
|
+
value: n[e.id],
|
|
48
|
+
error: c[e.id],
|
|
46
49
|
label: e.label,
|
|
47
|
-
onChange: (
|
|
50
|
+
onChange: (t) => f(e.id, t)
|
|
48
51
|
},
|
|
49
52
|
e.id
|
|
50
53
|
);
|
|
@@ -52,5 +55,5 @@ const N = k(({ fields: o, groupId: s }) => {
|
|
|
52
55
|
] });
|
|
53
56
|
});
|
|
54
57
|
export {
|
|
55
|
-
|
|
58
|
+
q as MultipleFieldFilter
|
|
56
59
|
};
|
package/dist/index31.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),d=require("react"),_=require("mobx-react"),j=require("lodash/debounce"),r=require("@veeqo/ui"),L=require("./
|
|
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("./index115.cjs"),R=require("./index69.cjs"),p=require("./index8.cjs"),y=require("./index61.cjs"),v=i=>i&&i.__esModule?i:{default:i},k=v(j),I=_.observer(({field:i})=>{var M;const{FILTERS_DEBOUCE_INTERVAL_MS:f}=p.useBusinessLogic(),{Filters:{numberRangeFilters:u,setNumberRangeFilter:x,clearNumberRangeFilter:F}}=y.useStores(),e=u.get(i.id),[o,g]=d.useState({gte:(e==null?void 0:e.gte)??0,lte:(e==null?void 0:e.lte)??100});if(!((M=i.options)!=null&&M.length))return null;const b=()=>{const l=new R.NumberRangeFilter({filterId:i.id});return u.set(i.id,l),l},c=d.useCallback(k.default(({numberRange:l,lte:t,gte:n})=>{x({numberRange:l,lte:t,gte:n})},f),[x]),h=()=>{g({gte:0,lte:100}),F(i.id)},S=(l,t)=>{let n=new R.NumberRangeFilter({filterId:i.id});if(e||(n=b()),!Array.isArray(t)||t.length!==2)return;const[s,m]=t;g({gte:s,lte:m}),c(e?{numberRange:e,lte:m,gte:s}:{numberRange:n,lte:m,gte:s})},N=l=>{if(e||b(),!e)return;const t=Number(l);if(t>e.lteMax)return;let{lte:n}=e,{gte:s}=e;t>=e.gteMin&&t<=e.lteMax&&(s=t),(!e.lte||t>=e.lte)&&(n=e.lteMax),g({gte:s,lte:n}),c({numberRange:e,lte:n,gte:s})},C=l=>{if(e||b(),!e)return;const t=Number(l);if(t<e.gteMin)return;let{lte:n}=e,{gte:s}=e;t>=e.gteMin&&t<=e.lteMax&&(n=t),(!e.gte||t<=e.gte)&&(s=e.gteMin),g({gte:s,lte:n}),c({numberRange:e,lte:n,gte:s})},q=[o.gte,o.lte];return a.jsxs(r.Stack,{spacing:"xs",alignX:"stretch",children:[a.jsx(r.Button,{variant:"link",onClick:h,children:"Clear"}),a.jsxs(r.Stack,{direction:"horizontal",children:[a.jsx(r.TextField,{label:e==null?void 0:e.gteMinLabel,type:"number",min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,value:o.gte.toString(),onChange:N}),a.jsx(r.TextField,{label:e==null?void 0:e.lteMaxLabel,type:"number",min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,value:o.lte.toString(),onChange:C})]}),a.jsx(L.MUISlider,{value:q,onChange:S,min:e==null?void 0:e.gteMin,max:e==null?void 0:e.lteMax,valueLabelDisplay:"auto"})]})});exports.NumberRangeFilter=I;
|
package/dist/index31.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useState as y, useCallback as I } from "react";
|
|
|
3
3
|
import { observer as k } from "mobx-react";
|
|
4
4
|
import E from "lodash/debounce";
|
|
5
5
|
import { Stack as c, Button as _, TextField as p } from "@veeqo/ui";
|
|
6
|
-
import { MUISlider as A } from "./
|
|
6
|
+
import { MUISlider as A } from "./index115.js";
|
|
7
7
|
import { NumberRangeFilter as h } from "./index69.js";
|
|
8
8
|
import { useBusinessLogic as B } from "./index8.js";
|
|
9
9
|
import { useStores as T } from "./index61.js";
|
package/dist/index35.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("mobx-react"),s=require("@veeqo/ui"),t=require("./index49.cjs"),o=require("./index30.cjs"),u=require("./index31.cjs"),F=require("./index29.cjs"),a=require("./index27.cjs"),h=require("./index32.cjs"),x=require("./index26.cjs"),p=require("./index28.cjs"),y=c.observer(({data:i})=>{const l=i.fields.filter(e=>e.filterType===t.FilterChoiceValue.TEXT||e.filterType===t.FilterChoiceValue.NUMBER),n=i.fields.filter(e=>e.filterType!==t.FilterChoiceValue.TEXT&&e.filterType!==t.FilterChoiceValue.NUMBER);return r.jsx(s.Accordion,{iconSlot:i.glyph,label:i.label,children:r.jsxs(s.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),c=require("mobx-react"),s=require("@veeqo/ui"),t=require("./index49.cjs"),o=require("./index30.cjs"),u=require("./index31.cjs"),F=require("./index29.cjs"),a=require("./index27.cjs"),h=require("./index32.cjs"),x=require("./index26.cjs"),p=require("./index28.cjs"),y=c.observer(({data:i})=>{const l=i.fields.filter(e=>e.filterType===t.FilterChoiceValue.TEXT||e.filterType===t.FilterChoiceValue.NUMBER),n=i.fields.filter(e=>e.filterType!==t.FilterChoiceValue.TEXT&&e.filterType!==t.FilterChoiceValue.NUMBER);return r.jsx(s.Accordion,{iconSlot:i.glyph,label:i.label,children:r.jsxs(s.FlexCol,{children:[l.length>0?r.jsx(o.MultipleFieldFilter,{fields:l,groupId:i.id}):null,n.map(e=>{switch(e.filterType){case t.FilterChoiceValue.CHECKBOX:return e.fetchAsyncFilterOptions?r.jsx(x.AsyncCheckboxFilter,{field:e}):r.jsx(p.CheckboxFilter,{field:e});case t.FilterChoiceValue.RADIO:return e.fetchAsyncFilterOptions?r.jsx(a.AsyncRadioFilter,{field:e}):r.jsx(h.RadioFilter,{field:e});case t.FilterChoiceValue.DATE_RANGE:return r.jsx(F.DateRangeFilter,{field:e});case t.FilterChoiceValue.NUMBER_RANGE:return r.jsx(u.NumberRangeFilter,{field:e});default:return r.jsxs("div",{children:[e.id,": Unknown filter type: ",e.filterType]},e.id)}})]})})});exports.FilterGroup=y;
|
package/dist/index35.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { observer as p } from "mobx-react";
|
|
3
|
-
import { Accordion as s,
|
|
3
|
+
import { Accordion as s, FlexCol as c } from "@veeqo/ui";
|
|
4
4
|
import { FilterChoiceValue as t } from "./index49.js";
|
|
5
5
|
import { MultipleFieldFilter as m } from "./index30.js";
|
|
6
6
|
import { NumberRangeFilter as f } from "./index31.js";
|
|
@@ -9,14 +9,14 @@ import { AsyncRadioFilter as F } from "./index27.js";
|
|
|
9
9
|
import { RadioFilter as y } from "./index32.js";
|
|
10
10
|
import { AsyncCheckboxFilter as T } from "./index26.js";
|
|
11
11
|
import { CheckboxFilter as h } from "./index28.js";
|
|
12
|
-
const
|
|
13
|
-
const
|
|
12
|
+
const M = p(({ data: o }) => {
|
|
13
|
+
const i = o.fields.filter(
|
|
14
14
|
(r) => r.filterType === t.TEXT || r.filterType === t.NUMBER
|
|
15
|
-
), n =
|
|
15
|
+
), n = o.fields.filter(
|
|
16
16
|
(r) => r.filterType !== t.TEXT && r.filterType !== t.NUMBER
|
|
17
17
|
);
|
|
18
|
-
return /* @__PURE__ */ e(s, { iconSlot:
|
|
19
|
-
|
|
18
|
+
return /* @__PURE__ */ e(s, { iconSlot: o.glyph, label: o.label, children: /* @__PURE__ */ l(c, { children: [
|
|
19
|
+
i.length > 0 ? /* @__PURE__ */ e(m, { fields: i, groupId: o.id }) : null,
|
|
20
20
|
n.map((r) => {
|
|
21
21
|
switch (r.filterType) {
|
|
22
22
|
case t.CHECKBOX:
|
|
@@ -38,5 +38,5 @@ const k = p(({ data: i }) => {
|
|
|
38
38
|
] }) });
|
|
39
39
|
});
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
M as FilterGroup
|
|
42
42
|
};
|
package/dist/index36.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),l=require("@veeqo/ui"),U=require("mobx-react"),z=require("./index65.cjs"),G=require("./index62.cjs"),J=require("./index40.cjs"),K=require("./index43.cjs"),Q=require("./index56.cjs"),X=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),l=require("@veeqo/ui"),U=require("mobx-react"),z=require("./index65.cjs"),G=require("./index62.cjs"),J=require("./index40.cjs"),K=require("./index43.cjs"),Q=require("./index56.cjs"),X=require("./index104.cjs"),Z=require("./index8.cjs"),$=require("./index61.cjs"),b=require("./index105.cjs"),ee=U.observer(({view:e})=>{const{VIEW_TYPE:x,IS_VIEWS_READONLY:r,SEARCH_FILTER_ID:d}=Z.useBusinessLogic(),{Filters:{activeViewId:w,initFiltersFromView:f,discardChanges:m,initFromUrl:V,filters:L,setFilter:T},Views:{draftViewsMap:y},Notifications:{notify:E}}=$.useStores(),{viewsMap:h,defaultCustomViewId:F,isLoading:N}=G.useViews(),{isLoading:j}=z.useCustomViews({type:x}),{viewCounts:M,isLoadingViewCounts:R}=X.useViewCounts(),[s,P]=c.useState(null),k=o=>{const q=L.get(d);if(h.has(o)){const n=h.get(o);n&&(f(n),m(!0),V())}else{const n=y.get(o);n?(f(n),m(!0),V()):E({type:"error",text:"Failed to load view"})}q&&T(d,q)},u=(e==null?void 0:e.id)===w,t=e.originalView!==void 0,g=e.originalView===void 0,A=M,a=(e==null?void 0:e.label)||"",I=N||j,p=c.useRef(!1);!I&&!p.current&&u&&e.id===F&&s&&(p.current=!0,s&&w===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const C=c.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:_},menu:{toggleDropdown:D},delete:{closeDeleteConfirmation:B,handleDelete:O,handleDeleteDraftView:v}},state:{shouldShowDeleteConfirmation:H},actions:W,state:S}=Q.useDropdownManager(e),Y=c.useMemo(()=>{if(!r){if(g)return D;if(t)return v}},[v,t,g,D,r]);return i.jsxs(i.Fragment,{children:[i.jsx(l.ViewTab,{customTextColour:e.customTextColour,colourPalette:e.colourPalette,className:"act-react-listing-custom-view",active:u,id:e==null?void 0:e.id,name:a,type:r?void 0:C,count:R?i.jsx(l.Loader,{type:"ThreeDots",width:12,height:12,color:u?"#fff":l.theme.colors.neutral.ink.dark}):A,onClick:k,subAction:Y,ariaContext:"orders",ref:P,"aria-controls":"options-dropdown","aria-expanded":S.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx(b.Confirmation,{shouldShow:H,viewName:a,onCancel:B,onDelete:O}),i.jsx(J.PillNotifications,{tabType:C,isActive:u,initialViewName:a,shouldShowCreateViewNotification:t,handleSaveDraft:_}),!r&&i.jsx(K.ViewDropdowns,{referenceElement:s,tab:e,...W,...S})]})});exports.ViewTab=ee;
|