@veeqo/transfigure 0.0.6 → 0.0.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/constants/constants.d.ts +4 -0
- package/dist/hooks/usePersistColumns/usePersistColumns.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +82 -81
- package/dist/index101.cjs +80 -1
- package/dist/index101.js +94 -35
- package/dist/index102.cjs +7 -1
- package/dist/index102.js +10 -42
- package/dist/index103.cjs +1 -7
- package/dist/index103.js +42 -10
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +18 -16
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +20 -18
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +32 -30
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +34 -32
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +1 -1
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +1 -1
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +1 -1
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +1 -1
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +1 -1
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +1 -1
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +1 -1
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +7 -2
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +19 -17
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +8 -7
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +72 -92
- package/dist/index79.cjs +1 -80
- package/dist/index79.js +13 -95
- package/dist/index80.cjs +104 -1
- package/dist/index80.js +120 -13
- package/dist/index81.cjs +1 -104
- package/dist/index81.js +65 -117
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +24 -53
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +2 -29
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +40 -2
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +7 -33
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +23 -7
- package/dist/index88.cjs +19 -1
- package/dist/index88.js +24 -22
- package/dist/index89.cjs +1 -19
- package/dist/index89.js +14 -23
- package/dist/index90.cjs +78 -10
- package/dist/index90.js +92 -13
- package/dist/index91.cjs +12 -1
- package/dist/index91.js +16 -15
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +22 -24
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +2 -2
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +1 -1
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +1 -1
- package/dist/index99.cjs +1 -80
- package/dist/index99.js +35 -94
- package/package.json +1 -1
package/dist/index21.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as u } from "react";
|
|
3
|
-
import { observer as
|
|
4
|
-
import { Stack as
|
|
5
|
-
import
|
|
6
|
-
import { getAsyncOptions as
|
|
7
|
-
import { getFetcherFunction as
|
|
8
|
-
|
|
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 "./index68.js";
|
|
7
|
+
import { getFetcherFunction as L } from "./index69.js";
|
|
8
|
+
import { SWR_HOOK_OPTIONS as k } from "./index45.js";
|
|
9
|
+
const T = O(
|
|
9
10
|
({ field: t, editedValue: c, setEditedValue: a }) => {
|
|
10
11
|
var o, i;
|
|
11
12
|
const l = u(() => {
|
|
12
13
|
var e;
|
|
13
|
-
return
|
|
14
|
-
}, [(o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher]), { isLoading: m, isValidating: h, data: p, error: f } =
|
|
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(
|
|
15
16
|
(i = t.fetchAsyncFilterOptions) == null ? void 0 : i.URL,
|
|
16
|
-
l
|
|
17
|
-
|
|
18
|
-
|
|
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: [
|
|
19
21
|
/* @__PURE__ */ n(
|
|
20
|
-
|
|
22
|
+
F,
|
|
21
23
|
{
|
|
22
24
|
allowMultiple: !0,
|
|
23
25
|
title: t.label,
|
|
@@ -27,15 +29,15 @@ const z = b(
|
|
|
27
29
|
}
|
|
28
30
|
),
|
|
29
31
|
r && /* @__PURE__ */ n(
|
|
30
|
-
|
|
32
|
+
x,
|
|
31
33
|
{
|
|
32
34
|
width: "200px",
|
|
33
|
-
height:
|
|
35
|
+
height: y.sizes[5],
|
|
34
36
|
"aria-busy": !0,
|
|
35
37
|
"aria-label": `Loading ${t.label} filters`
|
|
36
38
|
}
|
|
37
39
|
),
|
|
38
|
-
!r && f && /* @__PURE__ */ s(
|
|
40
|
+
!r && f && /* @__PURE__ */ s(A, { variant: "errorSmall", children: [
|
|
39
41
|
"Error: failed to load filter for ",
|
|
40
42
|
t.label
|
|
41
43
|
] })
|
|
@@ -43,5 +45,5 @@ const z = b(
|
|
|
43
45
|
}
|
|
44
46
|
);
|
|
45
47
|
export {
|
|
46
|
-
|
|
48
|
+
T as ActiveAsyncCheckboxFilter
|
|
47
49
|
};
|
package/dist/index22.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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("./index68.cjs"),F=require("./index69.cjs"),A=e=>e&&e.__esModule?e:{default:e},x=A(p),
|
|
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("./index68.cjs"),F=require("./index69.cjs"),O=require("./index45.cjs"),A=e=>e&&e.__esModule?e:{default:e},x=A(p),S=m.observer(({field:e,editedValue:o,setEditedValue:a})=>{var i,c;const l=b.useMemo(()=>{var r;return F.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:d}=x.default((c=e.fetchAsyncFilterOptions)==null?void 0:c.URL,l,O.SWR_HOOK_OPTIONS),n=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]}`)}),n&&s.jsx(t.Skeleton,{width:"200px",height:t.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!n&&d&&s.jsxs(t.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.ActiveAsyncRadioFilter=S;
|
package/dist/index22.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { observer as
|
|
4
|
-
import { Stack as
|
|
5
|
-
import
|
|
6
|
-
import { getAsyncOptions as
|
|
7
|
-
import { getFetcherFunction as
|
|
8
|
-
|
|
2
|
+
import { useMemo as O } from "react";
|
|
3
|
+
import { observer as u } from "mobx-react";
|
|
4
|
+
import { Stack as F, ChoiceList as b, Skeleton as y, theme as A, Text as d } from "@veeqo/ui";
|
|
5
|
+
import x from "swr/immutable";
|
|
6
|
+
import { getAsyncOptions as S } from "./index68.js";
|
|
7
|
+
import { getFetcherFunction as L } from "./index69.js";
|
|
8
|
+
import { SWR_HOOK_OPTIONS as R } from "./index45.js";
|
|
9
|
+
const _ = u(
|
|
9
10
|
({ field: t, editedValue: c, setEditedValue: a }) => {
|
|
10
11
|
var o, i;
|
|
11
|
-
const l =
|
|
12
|
+
const l = O(() => {
|
|
12
13
|
var e;
|
|
13
|
-
return
|
|
14
|
-
}, [(o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher]), { isLoading: m, isValidating: h, data: p, error: f } =
|
|
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 } = x(
|
|
15
16
|
(i = t.fetchAsyncFilterOptions) == null ? void 0 : i.URL,
|
|
16
|
-
l
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
l,
|
|
18
|
+
R
|
|
19
|
+
), r = m || h, g = S({ data: p, config: t.fetchAsyncFilterOptions });
|
|
20
|
+
return /* @__PURE__ */ s(F, { spacing: "xs", alignX: "stretch", children: [
|
|
19
21
|
/* @__PURE__ */ n(
|
|
20
|
-
|
|
22
|
+
b,
|
|
21
23
|
{
|
|
22
24
|
title: t.label,
|
|
23
25
|
options: g,
|
|
@@ -26,15 +28,15 @@ const z = F(
|
|
|
26
28
|
}
|
|
27
29
|
),
|
|
28
30
|
r && /* @__PURE__ */ n(
|
|
29
|
-
|
|
31
|
+
y,
|
|
30
32
|
{
|
|
31
33
|
width: "200px",
|
|
32
|
-
height:
|
|
34
|
+
height: A.sizes[5],
|
|
33
35
|
"aria-busy": !0,
|
|
34
36
|
"aria-label": `Loading ${t.label} filters`
|
|
35
37
|
}
|
|
36
38
|
),
|
|
37
|
-
!r && f && /* @__PURE__ */ s(
|
|
39
|
+
!r && f && /* @__PURE__ */ s(d, { variant: "errorSmall", children: [
|
|
38
40
|
"Error: failed to load filter for ",
|
|
39
41
|
t.label
|
|
40
42
|
] })
|
|
@@ -42,5 +44,5 @@ const z = F(
|
|
|
42
44
|
}
|
|
43
45
|
);
|
|
44
46
|
export {
|
|
45
|
-
|
|
47
|
+
_ as ActiveAsyncRadioFilter
|
|
46
48
|
};
|
package/dist/index23.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("react"),C=require("mobx-react"),L=require("lodash/debounce"),s=require("@veeqo/ui"),R=require("swr/immutable"),j=require("./index68.cjs"),k=require("./index69.cjs"),V=require("./index45.cjs"),E=require("./index7.cjs"),I=require("./index57.cjs"),h=e=>e&&e.__esModule?e:{default:e},M=h(L),T=h(R),v=C.observer(({field:e})=>{var l,u;const{FILTERS_DEBOUCE_INTERVAL_MS:d}=E.useBusinessLogic(),g=o.useMemo(()=>{var t;return k.getFetcherFunction({fetcherName:(t=e.fetchAsyncFilterOptions)==null?void 0:t.fetcher})},[(l=e.fetchAsyncFilterOptions)==null?void 0:l.fetcher]),{isLoading:b,isValidating:F,data:S,error:y}=T.default((u=e.fetchAsyncFilterOptions)==null?void 0:u.URL,g,V.SWR_HOOK_OPTIONS),i=b||F,{Filters:{setArrayFilter:c,arrayFilters:p}}=I.useStores(),O=p.get(e.id)||[],[m,a]=o.useState(O),x=o.useCallback(M.default((t,n)=>{c(t,n)},d),[c]),_=t=>{const n=t.map(A=>`${A}`);a(n),x(e.id,n)},f=()=>{a([]),c(e.id,[])},q=j.getAsyncOptions({data:S,config:e.fetchAsyncFilterOptions});return r.jsxs(s.Stack,{spacing:"xs",alignX:"stretch",children:[r.jsx(s.Button,{variant:"link",onClick:f,children:"Clear"}),r.jsx(s.ChoiceList,{allowMultiple:!0,title:e.label,options:q,selected:m,onChange:t=>_(t)}),i&&r.jsx(s.Skeleton,{width:"200px",height:s.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!i&&y&&r.jsxs(s.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.AsyncCheckboxFilter=v;
|
package/dist/index23.js
CHANGED
|
@@ -1,61 +1,63 @@
|
|
|
1
1
|
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
2
|
+
import { useMemo as L, useState as x, useCallback as k } from "react";
|
|
3
3
|
import { observer as V } from "mobx-react";
|
|
4
4
|
import E from "lodash/debounce";
|
|
5
|
-
import { Stack as R, Button as
|
|
6
|
-
import
|
|
7
|
-
import { getAsyncOptions as
|
|
8
|
-
import { getFetcherFunction as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
5
|
+
import { Stack as R, Button as _, ChoiceList as I, Skeleton as T, theme as v, Text as w } from "@veeqo/ui";
|
|
6
|
+
import B from "swr/immutable";
|
|
7
|
+
import { getAsyncOptions as M } from "./index68.js";
|
|
8
|
+
import { getFetcherFunction as N } from "./index69.js";
|
|
9
|
+
import { SWR_HOOK_OPTIONS as j } from "./index45.js";
|
|
10
|
+
import { useBusinessLogic as U } from "./index7.js";
|
|
11
|
+
import { useStores as W } from "./index57.js";
|
|
12
|
+
const Y = V(({ field: t }) => {
|
|
12
13
|
var c, a;
|
|
13
|
-
const { FILTERS_DEBOUCE_INTERVAL_MS: m } =
|
|
14
|
+
const { FILTERS_DEBOUCE_INTERVAL_MS: m } = U(), u = L(() => {
|
|
14
15
|
var e;
|
|
15
|
-
return
|
|
16
|
-
}, [(c = t.fetchAsyncFilterOptions) == null ? void 0 : c.fetcher]), { isLoading: h, isValidating: p, data: f, error: g } =
|
|
16
|
+
return N({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
|
|
17
|
+
}, [(c = t.fetchAsyncFilterOptions) == null ? void 0 : c.fetcher]), { isLoading: h, isValidating: p, data: f, error: g } = B(
|
|
17
18
|
(a = t.fetchAsyncFilterOptions) == null ? void 0 : a.URL,
|
|
18
|
-
u
|
|
19
|
-
|
|
19
|
+
u,
|
|
20
|
+
j
|
|
21
|
+
), i = h || p, {
|
|
20
22
|
Filters: { setArrayFilter: o, arrayFilters: F }
|
|
21
|
-
} =
|
|
23
|
+
} = W(), d = F.get(t.id) || [], [S, n] = x(d), b = k(
|
|
22
24
|
E((e, r) => {
|
|
23
25
|
o(e, r);
|
|
24
26
|
}, m),
|
|
25
27
|
[o]
|
|
26
|
-
),
|
|
27
|
-
const r = e.map((
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
28
|
+
), O = (e) => {
|
|
29
|
+
const r = e.map((C) => `${C}`);
|
|
30
|
+
n(r), b(t.id, r);
|
|
31
|
+
}, y = () => {
|
|
32
|
+
n([]), o(t.id, []);
|
|
33
|
+
}, A = M({ data: f, config: t.fetchAsyncFilterOptions });
|
|
32
34
|
return /* @__PURE__ */ l(R, { spacing: "xs", alignX: "stretch", children: [
|
|
33
|
-
/* @__PURE__ */ s(
|
|
35
|
+
/* @__PURE__ */ s(_, { variant: "link", onClick: y, children: "Clear" }),
|
|
34
36
|
/* @__PURE__ */ s(
|
|
35
|
-
|
|
37
|
+
I,
|
|
36
38
|
{
|
|
37
39
|
allowMultiple: !0,
|
|
38
40
|
title: t.label,
|
|
39
|
-
options:
|
|
40
|
-
selected:
|
|
41
|
-
onChange: (e) =>
|
|
41
|
+
options: A,
|
|
42
|
+
selected: S,
|
|
43
|
+
onChange: (e) => O(e)
|
|
42
44
|
}
|
|
43
45
|
),
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
i && /* @__PURE__ */ s(
|
|
47
|
+
T,
|
|
46
48
|
{
|
|
47
49
|
width: "200px",
|
|
48
|
-
height:
|
|
50
|
+
height: v.sizes[5],
|
|
49
51
|
"aria-busy": !0,
|
|
50
52
|
"aria-label": `Loading ${t.label} filters`
|
|
51
53
|
}
|
|
52
54
|
),
|
|
53
|
-
!
|
|
55
|
+
!i && g && /* @__PURE__ */ l(w, { variant: "errorSmall", children: [
|
|
54
56
|
"Error: failed to load filter for ",
|
|
55
57
|
t.label
|
|
56
58
|
] })
|
|
57
59
|
] });
|
|
58
60
|
});
|
|
59
61
|
export {
|
|
60
|
-
|
|
62
|
+
Y as AsyncCheckboxFilter
|
|
61
63
|
};
|
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("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),R=require("mobx-react"),A=require("lodash/debounce"),s=require("@veeqo/ui"),L=require("swr/immutable"),j=require("./index68.cjs"),C=require("./index69.cjs"),V=require("./index45.cjs"),k=require("./index7.cjs"),E=require("./index57.cjs"),d=e=>e&&e.__esModule?e:{default:e},I=d(A),T=d(L),v=R.observer(({field:e})=>{var u,l;const{FILTERS_DEBOUCE_INTERVAL_MS:h}=k.useBusinessLogic(),g=o.useMemo(()=>{var t;return C.getFetcherFunction({fetcherName:(t=e.fetchAsyncFilterOptions)==null?void 0:t.fetcher})},[(u=e.fetchAsyncFilterOptions)==null?void 0:u.fetcher]),{isLoading:F,isValidating:S,data:b,error:O}=T.default((l=e.fetchAsyncFilterOptions)==null?void 0:l.URL,g,V.SWR_HOOK_OPTIONS),i=F||S,{Filters:{setFilter:c,filters:f}}=E.useStores(),_=f.get(e.id),[m,a]=o.useState(_),p=o.useCallback(I.default((t,r)=>{c(t,r)},h),[c]),q=t=>{const r=`${t[0]}`;a(r),p(e.id,r)},y=()=>{a(""),c(e.id,"")},x=j.getAsyncOptions({data:b,config:e.fetchAsyncFilterOptions});return n.jsxs(s.Stack,{spacing:"xs",alignX:"stretch",children:[n.jsx(s.Button,{variant:"link",onClick:y,children:"Clear"}),n.jsx(s.ChoiceList,{title:e.label,options:x,selected:[m],onChange:t=>q(t)}),i&&n.jsx(s.Skeleton,{width:"200px",height:s.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!i&&O&&n.jsxs(s.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.AsyncRadioFilter=v;
|
package/dist/index24.js
CHANGED
|
@@ -1,60 +1,62 @@
|
|
|
1
1
|
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { observer as
|
|
4
|
-
import
|
|
5
|
-
import { Stack as
|
|
6
|
-
import
|
|
7
|
-
import { getAsyncOptions as
|
|
8
|
-
import { getFetcherFunction as
|
|
2
|
+
import { useMemo as A, useState as C, useCallback as x } from "react";
|
|
3
|
+
import { observer as R } from "mobx-react";
|
|
4
|
+
import V from "lodash/debounce";
|
|
5
|
+
import { Stack as k, Button as E, ChoiceList as _, Skeleton as I, theme as T, Text as v } from "@veeqo/ui";
|
|
6
|
+
import B from "swr/immutable";
|
|
7
|
+
import { getAsyncOptions as N } from "./index68.js";
|
|
8
|
+
import { getFetcherFunction as j } from "./index69.js";
|
|
9
|
+
import { SWR_HOOK_OPTIONS as w } from "./index45.js";
|
|
9
10
|
import { useBusinessLogic as M } from "./index7.js";
|
|
10
|
-
import { useStores as
|
|
11
|
-
const
|
|
11
|
+
import { useStores as U } from "./index57.js";
|
|
12
|
+
const Q = R(({ field: t }) => {
|
|
12
13
|
var c, a;
|
|
13
|
-
const { FILTERS_DEBOUCE_INTERVAL_MS: m } = M(), h =
|
|
14
|
+
const { FILTERS_DEBOUCE_INTERVAL_MS: m } = M(), h = A(() => {
|
|
14
15
|
var e;
|
|
15
|
-
return
|
|
16
|
-
}, [(c = t.fetchAsyncFilterOptions) == null ? void 0 : c.fetcher]), { isLoading: u, isValidating: p, data: f, error: g } =
|
|
16
|
+
return j({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
|
|
17
|
+
}, [(c = t.fetchAsyncFilterOptions) == null ? void 0 : c.fetcher]), { isLoading: u, isValidating: p, data: f, error: g } = B(
|
|
17
18
|
(a = t.fetchAsyncFilterOptions) == null ? void 0 : a.URL,
|
|
18
|
-
h
|
|
19
|
-
|
|
19
|
+
h,
|
|
20
|
+
w
|
|
21
|
+
), i = u || p, {
|
|
20
22
|
Filters: { setFilter: o, filters: d }
|
|
21
|
-
} =
|
|
22
|
-
|
|
23
|
+
} = U(), F = d.get(t.id), [S, n] = C(F), O = x(
|
|
24
|
+
V((e, r) => {
|
|
23
25
|
o(e, r);
|
|
24
26
|
}, m),
|
|
25
27
|
[o]
|
|
26
|
-
),
|
|
28
|
+
), b = (e) => {
|
|
27
29
|
const r = `${e[0]}`;
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
return /* @__PURE__ */ l(
|
|
33
|
-
/* @__PURE__ */ s(
|
|
30
|
+
n(r), O(t.id, r);
|
|
31
|
+
}, L = () => {
|
|
32
|
+
n(""), o(t.id, "");
|
|
33
|
+
}, y = N({ data: f, config: t.fetchAsyncFilterOptions });
|
|
34
|
+
return /* @__PURE__ */ l(k, { spacing: "xs", alignX: "stretch", children: [
|
|
35
|
+
/* @__PURE__ */ s(E, { variant: "link", onClick: L, children: "Clear" }),
|
|
34
36
|
/* @__PURE__ */ s(
|
|
35
|
-
|
|
37
|
+
_,
|
|
36
38
|
{
|
|
37
39
|
title: t.label,
|
|
38
|
-
options:
|
|
39
|
-
selected: [
|
|
40
|
-
onChange: (e) =>
|
|
40
|
+
options: y,
|
|
41
|
+
selected: [S],
|
|
42
|
+
onChange: (e) => b(e)
|
|
41
43
|
}
|
|
42
44
|
),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
i && /* @__PURE__ */ s(
|
|
46
|
+
I,
|
|
45
47
|
{
|
|
46
48
|
width: "200px",
|
|
47
|
-
height:
|
|
49
|
+
height: T.sizes[5],
|
|
48
50
|
"aria-busy": !0,
|
|
49
51
|
"aria-label": `Loading ${t.label} filters`
|
|
50
52
|
}
|
|
51
53
|
),
|
|
52
|
-
!
|
|
54
|
+
!i && g && /* @__PURE__ */ l(v, { variant: "errorSmall", children: [
|
|
53
55
|
"Error: failed to load filter for ",
|
|
54
56
|
t.label
|
|
55
57
|
] })
|
|
56
58
|
] });
|
|
57
59
|
});
|
|
58
60
|
export {
|
|
59
|
-
|
|
61
|
+
Q as AsyncRadioFilter
|
|
60
62
|
};
|
package/dist/index28.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("./index99.cjs"),R=require("./index63.cjs"),p=require("./index7.cjs"),y=require("./index57.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/index28.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 "./index99.js";
|
|
7
7
|
import { NumberRangeFilter as h } from "./index63.js";
|
|
8
8
|
import { useBusinessLogic as B } from "./index7.js";
|
|
9
9
|
import { useStores as T } from "./index57.js";
|
package/dist/index31.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("mobx-react"),n=require("@veeqo/ui"),o=require("./index7.cjs"),u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("mobx-react"),n=require("@veeqo/ui"),o=require("./index7.cjs"),u=require("./index86.cjs"),c=require("./index32.cjs"),a=s.observer(()=>{const{GROUP_MAP:t}=o.useBusinessLogic();return e.jsx(u.AdaptiveHeightContainer,{style:{minWidth:"360px"},children:e.jsx(n.Stack,{alignX:"stretch",children:Array.from(t).map(([r,i])=>e.jsx(c.FilterGroup,{data:i},r))})})});exports.FiltersList=a;
|
package/dist/index31.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import { observer as e } from "mobx-react";
|
|
3
3
|
import { Stack as m } from "@veeqo/ui";
|
|
4
4
|
import { useBusinessLogic as s } from "./index7.js";
|
|
5
|
-
import { AdaptiveHeightContainer as p } from "./
|
|
5
|
+
import { AdaptiveHeightContainer as p } from "./index86.js";
|
|
6
6
|
import { FilterGroup as n } from "./index32.js";
|
|
7
7
|
const u = e(() => {
|
|
8
8
|
const { GROUP_MAP: t } = s();
|
package/dist/index36.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index88.cjs"),g=require("./index48.cjs"),j=require("./index47.cjs"),M=({tab:i,onMakeDefault:l,onEdit:n,onDuplicate:s,onDelete:o,shouldShowDropdown:a,handleCloseDropdown:c})=>{const{openModal:r}=g.useModal(),d=()=>{r(j.ModalId.ORDERS_TABLE_MANAGEMENT),c()},m=i.label!=="Picking In Progress"&&i.editable,u=i.default!==!1&&i.editable,p=i.editable,b=i.editable;return a?e.jsxs(t.MenuItems,{children:[u&&e.jsx(t.Item,{onClick:l,className:"act-react-listing-custom-view-make-default-menu-item",children:"Make default view"}),b&&e.jsx(t.Item,{onClick:n,className:"act-react-listing-custom-view-edit-menu-item",role:"option",children:"Edit"}),e.jsx(t.Item,{onClick:s,className:"act-react-listing-custom-view-duplicate-menu-item",role:"option",children:"Duplicate"}),m&&e.jsx(t.Item,{onClick:o,className:"act-react-listing-custom-view-delete-menu-item",role:"option",children:"Delete"}),p&&e.jsxs(e.Fragment,{children:[e.jsx(t.Divider,{}),e.jsx(t.Item,{onClick:d,role:"option",children:"Table management"})]})]}):null};exports.OptionsDropdown=M;
|
package/dist/index36.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as t, jsx as i, Fragment as f } from "react/jsx-runtime";
|
|
2
|
-
import { MenuItems as M, Item as l, Divider as h } from "./
|
|
2
|
+
import { MenuItems as M, Item as l, Divider as h } from "./index88.js";
|
|
3
3
|
import { useModal as k } from "./index48.js";
|
|
4
4
|
import { ModalId as T } from "./index47.js";
|
|
5
5
|
const N = ({
|
package/dist/index37.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react-transition-group"),f=require("mobx-react"),x=require("./index58.cjs"),v=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react-transition-group"),f=require("mobx-react"),x=require("./index58.cjs"),v=require("./index92.cjs"),g=require("./index39.cjs"),h=require("./index57.cjs"),S=f.observer(({tabType:i,isActive:n,shouldShowCreateViewNotification:c,handleSaveDraft:s})=>{var r;const{Filters:{hasUnsavedChanges:l,discardChanges:u,activeViewId:t}}=h.useStores(),d=window.location.pathname==="/orders"?"orders":"variants",{viewsMap:m}=x.useViews(),o=t&&((r=m.get(t))==null?void 0:r.label)||"failure";return e.jsxs(e.Fragment,{children:[e.jsx(a.CSSTransition,{in:i==="draft"&&n&&c,timeout:200,classNames:"notification",unmountOnExit:!0,children:e.jsx(v.InfoPill,{onClick:s,mainEntityLabelPlural:d})}),i!=="fixed"&&o&&e.jsx(a.CSSTransition,{in:l&&n&&i==="saved",timeout:200,classNames:"notification",unmountOnExit:!0,children:e.jsx(g.UnsavedChangesPill,{viewName:o,onDiscard:()=>u(),onSaveDraft:s})})]})});exports.PillNotifications=S;
|
package/dist/index37.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as u, Fragment as p, jsx as i } from "react/jsx-runtime";
|
|
|
2
2
|
import { CSSTransition as a } from "react-transition-group";
|
|
3
3
|
import { observer as h } from "mobx-react";
|
|
4
4
|
import { useViews as v } from "./index58.js";
|
|
5
|
-
import { InfoPill as w } from "./
|
|
5
|
+
import { InfoPill as w } from "./index92.js";
|
|
6
6
|
import { UnsavedChangesPill as x } from "./index39.js";
|
|
7
7
|
import { useStores as g } from "./index57.js";
|
|
8
8
|
const F = h(
|
package/dist/index38.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),d=require("react"),m=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),d=require("react"),m=require("./index89.cjs"),g=require("./index60.cjs"),S=require("./index58.cjs"),b=require("./index3.cjs"),y=require("./index7.cjs"),V=require("./index57.cjs"),p=require("./index10.cjs"),q=()=>{const{VIEW_TYPE:n}=y.useBusinessLogic(),{sortedCustomViews:s,isLoading:u}=S.useViews(),{mutate:a}=g.useCustomViews({type:n}),[c,t]=d.useState(s),{Notifications:{notify:l}}=V.useStores(),w=async o=>{t(o);const r=o.map(e=>e.id);try{await b.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:r}}}),await a(e=>({...e,settings:{...e.settings,custom_view_positions:{...e.settings.custom_view_positions,order:r}}}),{revalidate:!1})}catch{t(s),l({type:"error",text:"Failed to update order of views"})}};return u||!s.length?null:i.jsx(p.ErrorBoundary,{children:i.jsx(m.LegacySortableViews,{views:c,onChange:w,className:"act-sortable-views"})})};exports.SortableViews=q;
|
package/dist/index38.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as f } from "react";
|
|
3
|
-
import { LegacySortableViews as l } from "./
|
|
3
|
+
import { LegacySortableViews as l } from "./index89.js";
|
|
4
4
|
import { useCustomViews as w } from "./index60.js";
|
|
5
5
|
import { useViews as d } from "./index58.js";
|
|
6
6
|
import { patchCurrentUser as g } from "./index3.js";
|
package/dist/index39.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),s=require("@veeqo/ui"),h=require("mobx-react"),n=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),s=require("@veeqo/ui"),h=require("mobx-react"),n=require("./index90.cjs"),u=require("./index56.cjs"),g=s.theme.colors.secondary.blue.base,v=h.observer(({onDiscard:i,viewName:t,onSaveDraft:c})=>{const{saveChanges:o,isSubmitting:r}=u.usePersistUnsavedChanges(),[d,a]=l.useState(!1);return e.jsx(n.Notification,{children:e.jsx(n.Container,{className:"act-react-listing-custom-notification-unsaved-changes",children:e.jsxs(s.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(n.Glyph,{name:"attention",color:g}),e.jsxs(n.Wrap,{children:[e.jsx(n.Text,{variant:"body",margin:"0 4px 0 0",children:"You have unsaved changes to"}),e.jsx(n.Bold,{variant:"bodyBoldDark",children:`'${t}'`})]}),e.jsx(n.Button,{className:"act-react-listing-custom-notification-unsaved-changes-discard",onClick:i,size:"sm",children:"Discard changes"}),e.jsxs(s.AnimatedDropdown,{reversed:!0,shouldShowDropdown:d,onClickAway:()=>a(!1),cta:e.jsx(n.Button,{className:"act-react-listing-custom-notification-unsaved-changes-toggle-dropdown",variant:"primary",onClick:()=>a(!0),size:"sm",dropdown:!0,children:"Save changes"}),children:[e.jsx(n.Item,{onClick:c,className:"act-react-listing-custom-notification-unsaved-changes-create-new-view",children:e.jsx(n.Text,{variant:"body",children:"Create new view"})}),e.jsxs(n.Item,{onClick:o,disabled:r,className:"act-react-listing-custom-notification-unsaved-changes-save-to-existing-view",children:[e.jsx(n.Text,{variant:"body",margin:"0 4px 0 0",children:"Save changes to"}),e.jsx(n.Text,{variant:"bodyBoldDark",children:t})]})]})]})})})});exports.UnsavedChangesPill=v;
|
package/dist/index39.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as m } from "react";
|
|
3
3
|
import { Stack as g, theme as u, AnimatedDropdown as v } from "@veeqo/ui";
|
|
4
4
|
import { observer as p } from "mobx-react";
|
|
5
|
-
import { Notification as f, Container as w, Glyph as C, Wrap as b, Text as a, Bold as y, Button as o, Item as r } from "./
|
|
5
|
+
import { Notification as f, Container as w, Glyph as C, Wrap as b, Text as a, Bold as y, Button as o, Item as r } from "./index90.js";
|
|
6
6
|
import { usePersistUnsavedChanges as k } from "./index56.js";
|
|
7
7
|
const S = u.colors.secondary.blue.base, A = p(
|
|
8
8
|
({
|
package/dist/index41.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),V=require("mobx-react"),s=require("@veeqo/ui"),t=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),V=require("mobx-react"),s=require("@veeqo/ui"),t=require("./index91.cjs"),j=require("./index38.cjs"),m=require("./index58.cjs"),S=require("./index59.cjs"),q=require("./index34.cjs"),u=require("./index33.cjs"),p=require("./index57.cjs"),a=require("./index10.cjs"),b=V.observer(()=>{const{Views:{draftViewsList:c}}=p.useStores(),{viewsArray:l,fixedViews:d}=m.useViews(),[o,i]=n.useState(!1),[w,x]=n.useState(null),h=()=>i(!1);return S.useViewUrlChange(),e.jsxs(e.Fragment,{children:[e.jsxs(s.ViewsContainer,{onClickMenu:()=>i(!0),ariaMenuControls:"views-menu",ariaMenuExpanded:o,ref:x,children:[l.map(r=>e.jsx(a.ErrorBoundary,{children:e.jsx(u.ViewTab,{view:r})},r.id)),c.map(r=>e.jsx(a.ErrorBoundary,{children:e.jsx(u.ViewTab,{view:r})},r.id))]}),o&&e.jsx(s.Popover,{id:"views-menu",anchorElement:w,placement:"bottom",onShouldClose:()=>i(!1),children:e.jsxs(s.Card.Surface,{children:[e.jsx(t.FixedViews,{children:d.map(r=>e.jsx(s.Text,{variant:"placeholder",children:r.label},r.id||r.label))}),e.jsx(j.SortableViews,{}),e.jsx(t.Divider,{}),e.jsx(q.CreateView,{hideActionsPopover:h})]})})]})});exports.ViewList=b;
|
package/dist/index41.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as i, Fragment as u, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as n } from "react";
|
|
3
3
|
import { observer as h } from "mobx-react";
|
|
4
4
|
import { ViewsContainer as w, Popover as V, Card as v, Text as S } from "@veeqo/ui";
|
|
5
|
-
import { FixedViews as x, Divider as C } from "./
|
|
5
|
+
import { FixedViews as x, Divider as C } from "./index91.js";
|
|
6
6
|
import { SortableViews as b } from "./index38.js";
|
|
7
7
|
import { useViews as A } from "./index58.js";
|
|
8
8
|
import { useViewUrlChange as L } from "./index59.js";
|
package/dist/index45.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var n=(O=>(O.TEXT="text",O.NUMBER="number",O.CHECKBOX="checkbox",O.RADIO="radio",O.DATE_RANGE="date_range",O.NUMBER_RANGE="number_range",O))(n||{});const e={revalidateOnFocus:!1,revalidateOnReconnect:!1};exports.FilterChoiceValue=n;exports.SWR_HOOK_OPTIONS=e;
|
package/dist/index45.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
var
|
|
1
|
+
var O = /* @__PURE__ */ ((n) => (n.TEXT = "text", n.NUMBER = "number", n.CHECKBOX = "checkbox", n.RADIO = "radio", n.DATE_RANGE = "date_range", n.NUMBER_RANGE = "number_range", n))(O || {});
|
|
2
|
+
const E = {
|
|
3
|
+
revalidateOnFocus: !1,
|
|
4
|
+
revalidateOnReconnect: !1
|
|
5
|
+
};
|
|
2
6
|
export {
|
|
3
|
-
|
|
7
|
+
O as FilterChoiceValue,
|
|
8
|
+
E as SWR_HOOK_OPTIONS
|
|
4
9
|
};
|
package/dist/index58.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 C=require("swr"),c=require("react"),E=require("./index72.cjs"),O=require("./index71.cjs"),S=require("./index60.cjs"),y=require("./index45.cjs"),I=require("./index7.cjs"),b=require("./index51.cjs"),P=e=>e&&e.__esModule?e:{default:e},T=P(C),t=E.createAllView(),h=()=>{const{DEFAULT_PAGE_NUMBER:e,DEFAULT_PAGE_SIZE:m,VIEW_TYPE:w}=I.useBusinessLogic(),{canUpdateCustomViews:V,orderedListOfCustomViews:u,defaultCustomViewId:p,isLoading:g,isValidating:_}=S.useCustomViews({type:w}),{data:n,isLoading:M,isValidating:A,error:L,mutate:q}=T.default(`/api/v2/custom_views?filter[type]=${w}&page[number]=${e}&page[size]=${m}`,b.fetcherV2,y.SWR_HOOK_OPTIONS),f=c.useMemo(()=>({fixedViews:[t],customViews:[],viewsMap:new Map([[t.id,t]])}),[]),{viewsMap:v,customViews:o,fixedViews:l}=c.useMemo(()=>n?n.reduce((s,r)=>{const i=O.viewsAdapter({view:r,canUpdateCustomViews:V});return s.viewsMap.set(r.id,i),r.editable?s.customViews.push(i):s.fixedViews.push(i),s},{fixedViews:[t],customViews:[],viewsMap:new Map([[t.id,t]])}):f,[n,f,V]),x=c.useMemo(()=>o.sort((s,r)=>{const i=Array.isArray(u)?u:[],a=i.indexOf(s.id),d=i.indexOf(r.id);return a===-1&&d===-1?0:a===-1?1:d===-1?-1:a-d}),[o,u]);return{defaultCustomViewId:p,viewsArray:[...l,...o],fixedViews:l,customViews:o,sortedCustomViews:x,viewsMap:v,isLoading:M||A||g||_,error:L,mutate:q}};exports.useViews=h;
|
package/dist/index58.js
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import
|
|
1
|
+
import O from "swr";
|
|
2
2
|
import { useMemo as d } from "react";
|
|
3
|
-
import { createAllView as
|
|
3
|
+
import { createAllView as v } from "./index72.js";
|
|
4
4
|
import { viewsAdapter as I } from "./index71.js";
|
|
5
|
-
import { useCustomViews as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { useCustomViews as y } from "./index60.js";
|
|
6
|
+
import { SWR_HOOK_OPTIONS as S } from "./index45.js";
|
|
7
|
+
import { useBusinessLogic as P } from "./index7.js";
|
|
8
|
+
import { fetcherV2 as T } from "./index51.js";
|
|
9
|
+
const s = v(), F = () => {
|
|
10
|
+
const { DEFAULT_PAGE_NUMBER: V, DEFAULT_PAGE_SIZE: c, VIEW_TYPE: m } = P(), {
|
|
10
11
|
canUpdateCustomViews: w,
|
|
11
12
|
orderedListOfCustomViews: o,
|
|
12
13
|
defaultCustomViewId: l,
|
|
13
14
|
isLoading: g,
|
|
14
15
|
isValidating: x
|
|
15
|
-
} =
|
|
16
|
-
`/api/v2/custom_views?filter[type]=${m}&page[number]=${
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
} = y({ type: m }), { data: n, isLoading: A, isValidating: L, error: E, mutate: M } = O(
|
|
17
|
+
`/api/v2/custom_views?filter[type]=${m}&page[number]=${V}&page[size]=${c}`,
|
|
18
|
+
T,
|
|
19
|
+
S
|
|
20
|
+
), f = d(
|
|
19
21
|
() => ({
|
|
20
22
|
fixedViews: [s],
|
|
21
23
|
customViews: [],
|
|
22
24
|
viewsMap: /* @__PURE__ */ new Map([[s.id, s]])
|
|
23
25
|
}),
|
|
24
26
|
[]
|
|
25
|
-
), { viewsMap:
|
|
27
|
+
), { viewsMap: _, customViews: r, fixedViews: p } = d(() => n ? n.reduce(
|
|
26
28
|
(e, t) => {
|
|
27
29
|
const i = I({ view: t, canUpdateCustomViews: w });
|
|
28
30
|
return e.viewsMap.set(t.id, i), t.editable ? e.customViews.push(i) : e.fixedViews.push(i), e;
|
|
@@ -32,17 +34,17 @@ const s = y(), F = () => {
|
|
|
32
34
|
customViews: [],
|
|
33
35
|
viewsMap: /* @__PURE__ */ new Map([[s.id, s]])
|
|
34
36
|
}
|
|
35
|
-
) :
|
|
37
|
+
) : f, [n, f, w]), C = d(() => r.sort((e, t) => {
|
|
36
38
|
const i = Array.isArray(o) ? o : [], a = i.indexOf(e.id), u = i.indexOf(t.id);
|
|
37
39
|
return a === -1 && u === -1 ? 0 : a === -1 ? 1 : u === -1 ? -1 : a - u;
|
|
38
40
|
}), [r, o]);
|
|
39
41
|
return {
|
|
40
42
|
defaultCustomViewId: l,
|
|
41
|
-
viewsArray: [...
|
|
42
|
-
fixedViews:
|
|
43
|
+
viewsArray: [...p, ...r],
|
|
44
|
+
fixedViews: p,
|
|
43
45
|
customViews: r,
|
|
44
|
-
sortedCustomViews:
|
|
45
|
-
viewsMap:
|
|
46
|
+
sortedCustomViews: C,
|
|
47
|
+
viewsMap: _,
|
|
46
48
|
isLoading: A || L || g || x,
|
|
47
49
|
error: E,
|
|
48
50
|
mutate: M
|
package/dist/index60.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 g=require("./index45.cjs"),C=require("swr"),v=require("./index51.cjs"),O=e=>e&&e.__esModule?e:{default:e},h=O(C),q=({type:e})=>{var o,t,i,n,u,r,c,_;const{data:s,isLoading:m,isValidating:l,error:w,mutate:f}=h.default("/current_user",v.fetcherV1,g.SWR_HOOK_OPTIONS),p=(t=(o=s==null?void 0:s.settings)==null?void 0:o.custom_view_positions)==null?void 0:t[e],V=(u=(n=(i=s==null?void 0:s.settings)==null?void 0:i.default_custom_views)==null?void 0:n[e])==null?void 0:u.toString(),S=!!((r=s==null?void 0:s.permissions)!=null&&r.delete_company_custom_views),a=!!((c=s==null?void 0:s.permissions)!=null&&c.update_company_custom_views),d=!!((_=s==null?void 0:s.permissions)!=null&&_.share_custom_views);return{canDeleteCustomViews:S,canUpdateCustomViews:a,canShareCustomViews:d,orderedListOfCustomViews:p,defaultCustomViewId:V,isLoading:m,isValidating:l,error:w,mutate:f}};exports.useCustomViews=q;
|