@veeqo/transfigure 1.2.5 → 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 +157 -155
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +37 -30
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +11 -29
- package/dist/index101.cjs +19 -1
- package/dist/index101.js +24 -21
- package/dist/index102.cjs +1 -12
- package/dist/index102.js +21 -16
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +1 -1
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +36 -22
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +29 -7
- package/dist/index106.cjs +1 -80
- package/dist/index106.js +24 -101
- package/dist/index107.cjs +12 -1
- package/dist/index107.js +16 -2
- 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 -36
- package/dist/index114.cjs +13 -1
- package/dist/index114.js +15 -24
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +35 -62
- package/dist/index116.cjs +1 -7
- package/dist/index116.js +26 -10
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +5 -47
- package/dist/index118.cjs +7 -0
- package/dist/index118.js +12 -0
- 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/index2.cjs +1 -1
- package/dist/index2.js +3 -2
- 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/index34.cjs +1 -1
- package/dist/index34.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 +39 -38
- 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/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/index49.cjs +1 -1
- package/dist/index49.js +6 -5
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +22 -19
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +7 -5
- 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/index88.cjs +1 -1
- package/dist/index88.js +2 -5
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +4 -117
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +117 -18
- 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 -19
- package/dist/index98.js +2 -24
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +37 -34
- package/dist/storybookHelpers/apiMocks/views/custom_views.d.ts +7 -0
- package/dist/types.d.ts +14 -0
- package/dist/utils/getViewTheme/getViewTheme.d.ts +21 -0
- package/dist/utils/getViewTheme/getViewTheme.test.d.ts +1 -0
- package/dist/utils/getViewTheme/index.d.ts +1 -0
- 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/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/index34.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("./index8.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("./index8.cjs"),u=require("./index106.cjs"),c=require("./index35.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/index34.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 "./index8.js";
|
|
5
|
-
import { AdaptiveHeightContainer as p } from "./
|
|
5
|
+
import { AdaptiveHeightContainer as p } from "./index106.js";
|
|
6
6
|
import { FilterGroup as n } from "./index35.js";
|
|
7
7
|
const u = e(() => {
|
|
8
8
|
const { GROUP_MAP: t } = s();
|
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"),
|
|
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;
|
package/dist/index36.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { ViewTab as
|
|
1
|
+
import { jsxs as H, Fragment as U, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useRef as z, useMemo as S } from "react";
|
|
3
|
+
import { ViewTab as G, Loader as J, theme as K } from "@veeqo/ui";
|
|
4
4
|
import { observer as Q } from "mobx-react";
|
|
5
5
|
import { useCustomViews as X } from "./index65.js";
|
|
6
6
|
import { useViews as Z } from "./index62.js";
|
|
7
7
|
import { PillNotifications as b } from "./index40.js";
|
|
8
8
|
import { ViewDropdowns as ee } from "./index43.js";
|
|
9
9
|
import { useDropdownManager as oe } from "./index56.js";
|
|
10
|
-
import { useViewCounts as ie } from "./
|
|
10
|
+
import { useViewCounts as ie } from "./index104.js";
|
|
11
11
|
import { useBusinessLogic as te } from "./index8.js";
|
|
12
12
|
import { useStores as re } from "./index61.js";
|
|
13
|
-
import { Confirmation as se } from "./
|
|
13
|
+
import { Confirmation as se } from "./index105.js";
|
|
14
14
|
const ve = Q(({ view: e }) => {
|
|
15
|
-
const { VIEW_TYPE:
|
|
16
|
-
Filters: { activeViewId: d, initFiltersFromView: f, discardChanges: m, initFromUrl: u, filters:
|
|
17
|
-
Views: { draftViewsMap:
|
|
18
|
-
Notifications: { notify:
|
|
19
|
-
} = re(), { viewsMap: w, defaultCustomViewId:
|
|
20
|
-
const
|
|
15
|
+
const { VIEW_TYPE: L, IS_VIEWS_READONLY: n, SEARCH_FILTER_ID: c } = te(), {
|
|
16
|
+
Filters: { activeViewId: d, initFiltersFromView: f, discardChanges: m, initFromUrl: u, filters: T, setFilter: x },
|
|
17
|
+
Views: { draftViewsMap: E },
|
|
18
|
+
Notifications: { notify: F }
|
|
19
|
+
} = re(), { viewsMap: w, defaultCustomViewId: y, isLoading: N } = Z(), { isLoading: A } = X({ type: L }), { viewCounts: I, isLoadingViewCounts: R } = ie(), [i, _] = $(null), k = (o) => {
|
|
20
|
+
const D = T.get(c);
|
|
21
21
|
if (w.has(o)) {
|
|
22
22
|
const r = w.get(o);
|
|
23
23
|
r && (f(r), m(!0), u());
|
|
24
24
|
} else {
|
|
25
|
-
const r =
|
|
26
|
-
r ? (f(r), m(!0), u()) :
|
|
25
|
+
const r = E.get(o);
|
|
26
|
+
r ? (f(r), m(!0), u()) : F({
|
|
27
27
|
type: "error",
|
|
28
28
|
text: "Failed to load view"
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
}, a = (e == null ? void 0 : e.id) === d, t = e.originalView !== void 0, p = e.originalView === void 0,
|
|
33
|
-
!
|
|
31
|
+
D && x(c, D);
|
|
32
|
+
}, a = (e == null ? void 0 : e.id) === d, t = e.originalView !== void 0, p = e.originalView === void 0, M = I, l = (e == null ? void 0 : e.label) || "", P = N || A, V = z(!1);
|
|
33
|
+
!P && !V.current && a && e.id === y && i && (V.current = !0, i && d === e.id && window.requestAnimationFrame(() => {
|
|
34
34
|
var o;
|
|
35
35
|
(o = i.parentElement) == null || o.scrollBy({
|
|
36
36
|
behavior: "smooth",
|
|
@@ -39,44 +39,45 @@ const ve = Q(({ view: e }) => {
|
|
|
39
39
|
}));
|
|
40
40
|
const h = S(() => t ? "draft" : e.editable ? "saved" : "fixed", [t, e.editable]), {
|
|
41
41
|
actions: {
|
|
42
|
-
create: { handleSaveDraft:
|
|
42
|
+
create: { handleSaveDraft: j },
|
|
43
43
|
menu: { toggleDropdown: g },
|
|
44
|
-
delete: { closeDeleteConfirmation:
|
|
44
|
+
delete: { closeDeleteConfirmation: B, handleDelete: O, handleDeleteDraftView: v }
|
|
45
45
|
},
|
|
46
|
-
state: { shouldShowDeleteConfirmation:
|
|
47
|
-
actions:
|
|
48
|
-
state:
|
|
49
|
-
} = oe(e),
|
|
46
|
+
state: { shouldShowDeleteConfirmation: W },
|
|
47
|
+
actions: Y,
|
|
48
|
+
state: C
|
|
49
|
+
} = oe(e), q = S(() => {
|
|
50
50
|
if (!n) {
|
|
51
51
|
if (p) return g;
|
|
52
52
|
if (t) return v;
|
|
53
53
|
}
|
|
54
54
|
}, [v, t, p, g, n]);
|
|
55
|
-
return /* @__PURE__ */ U
|
|
55
|
+
return /* @__PURE__ */ H(U, { children: [
|
|
56
56
|
/* @__PURE__ */ s(
|
|
57
|
-
|
|
57
|
+
G,
|
|
58
58
|
{
|
|
59
|
-
|
|
59
|
+
customTextColour: e.customTextColour,
|
|
60
|
+
colourPalette: e.colourPalette,
|
|
60
61
|
className: "act-react-listing-custom-view",
|
|
61
62
|
active: a,
|
|
62
63
|
id: e == null ? void 0 : e.id,
|
|
63
64
|
name: l,
|
|
64
65
|
type: n ? void 0 : h,
|
|
65
|
-
count:
|
|
66
|
-
|
|
66
|
+
count: R ? /* @__PURE__ */ s(
|
|
67
|
+
J,
|
|
67
68
|
{
|
|
68
69
|
type: "ThreeDots",
|
|
69
70
|
width: 12,
|
|
70
71
|
height: 12,
|
|
71
|
-
color: a ? "#fff" :
|
|
72
|
+
color: a ? "#fff" : K.colors.neutral.ink.dark
|
|
72
73
|
}
|
|
73
|
-
) :
|
|
74
|
-
onClick:
|
|
75
|
-
subAction:
|
|
74
|
+
) : M,
|
|
75
|
+
onClick: k,
|
|
76
|
+
subAction: q,
|
|
76
77
|
ariaContext: "orders",
|
|
77
|
-
ref:
|
|
78
|
+
ref: _,
|
|
78
79
|
"aria-controls": "options-dropdown",
|
|
79
|
-
"aria-expanded":
|
|
80
|
+
"aria-expanded": C.shouldShowDropdown,
|
|
80
81
|
"aria-haspopup": "dialog"
|
|
81
82
|
},
|
|
82
83
|
e == null ? void 0 : e.id
|
|
@@ -84,10 +85,10 @@ const ve = Q(({ view: e }) => {
|
|
|
84
85
|
/* @__PURE__ */ s(
|
|
85
86
|
se,
|
|
86
87
|
{
|
|
87
|
-
shouldShow:
|
|
88
|
+
shouldShow: W,
|
|
88
89
|
viewName: l,
|
|
89
|
-
onCancel:
|
|
90
|
-
onDelete:
|
|
90
|
+
onCancel: B,
|
|
91
|
+
onDelete: O
|
|
91
92
|
}
|
|
92
93
|
),
|
|
93
94
|
/* @__PURE__ */ s(
|
|
@@ -97,10 +98,10 @@ const ve = Q(({ view: e }) => {
|
|
|
97
98
|
isActive: a,
|
|
98
99
|
initialViewName: l,
|
|
99
100
|
shouldShowCreateViewNotification: t,
|
|
100
|
-
handleSaveDraft:
|
|
101
|
+
handleSaveDraft: j
|
|
101
102
|
}
|
|
102
103
|
),
|
|
103
|
-
!n && /* @__PURE__ */ s(ee, { referenceElement: i, tab: e, ...
|
|
104
|
+
!n && /* @__PURE__ */ s(ee, { referenceElement: i, tab: e, ...Y, ...C })
|
|
104
105
|
] });
|
|
105
106
|
});
|
|
106
107
|
export {
|
package/dist/index39.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("./index101.cjs"),g=require("./index52.cjs"),j=require("./index51.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/index39.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 "./index101.js";
|
|
3
3
|
import { useModal as k } from "./index52.js";
|
|
4
4
|
import { ModalId as T } from "./index51.js";
|
|
5
5
|
const N = ({
|
package/dist/index40.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),P=require("mobx-react"),g=require("./index62.cjs"),o=require("framer-motion"),m=require("./index61.cjs"),v=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),P=require("mobx-react"),g=require("./index62.cjs"),o=require("framer-motion"),m=require("./index61.cjs"),v=require("./index102.cjs"),f=require("./index42.cjs"),h=P.observer(({tabType:s,isActive:r,shouldShowCreateViewNotification:a,handleSaveDraft:i})=>{var t;const{Filters:{hasUnsavedChanges:c,discardChanges:l,activeViewId:n}}=m.useStores(),{viewsMap:u}=g.useViews(),d=n&&((t=u.get(n))==null?void 0:t.label);return e.jsxs(e.Fragment,{children:[e.jsx(o.AnimatePresence,{children:s==="draft"&&r&&a&&e.jsx(v.DraftPill,{onClick:i})}),e.jsx(o.AnimatePresence,{children:c&&r&&s==="saved"&&e.jsx(f.UnsavedChangesPill,{viewName:d,onDiscard:()=>l(),onSaveDraft:i})})]})});exports.PillNotifications=h;
|
package/dist/index40.js
CHANGED
|
@@ -3,7 +3,7 @@ import { observer as h } from "mobx-react";
|
|
|
3
3
|
import { useViews as v } from "./index62.js";
|
|
4
4
|
import { AnimatePresence as n } from "framer-motion";
|
|
5
5
|
import { useStores as g } from "./index61.js";
|
|
6
|
-
import { DraftPill as w } from "./
|
|
6
|
+
import { DraftPill as w } from "./index102.js";
|
|
7
7
|
import { UnsavedChangesPill as C } from "./index42.js";
|
|
8
8
|
const U = h(
|
|
9
9
|
({
|
package/dist/index42.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@veeqo/ui"),c=require("mobx-react"),l=require("./index60.cjs"),n=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@veeqo/ui"),c=require("mobx-react"),l=require("./index60.cjs"),n=require("./index108.cjs"),d=i.theme.colors.secondary.blue.base,h=c.observer(({onDiscard:r,viewName:s,onSaveDraft:a})=>{const{saveChanges:o,isSubmitting:t}=l.usePersistUnsavedChanges();return e.jsx(n.Notification,{children:e.jsx(n.Container,{children:e.jsxs(i.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(n.Glyph,{ariaLabel:"attention",name:"attention",color:d}),e.jsxs(n.Wrap,{children:[e.jsx(n.Text,{variant:"body",margin:"0 4px 0 0",children:"You have unsaved changes to"}),s&&e.jsxs(n.Bold,{variant:"bodyBoldDark",children:["'",s,"'"]})]}),e.jsx(i.Button,{onClick:r,size:"sm",children:"Discard changes"}),e.jsxs(i.ActionMenu,{ctaProps:{children:"Save changes",variant:"primary"},children:[e.jsx(i.ActionMenu.Item,{onAction:a,isDisabled:t,children:e.jsx(n.Text,{variant:"body",children:"Create new view"})}),e.jsx(i.ActionMenu.Item,{onAction:o,isDisabled:t,children:e.jsxs(i.Stack,{direction:"horizontal",spacing:1,alignY:"center",children:[e.jsx(n.Text,{variant:"body",children:"Save changes to"}),e.jsx(n.Text,{variant:"bodyBold",children:s})]})})]})]})})})});exports.UnsavedChangesPill=h;
|
package/dist/index42.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as n, jsxs as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { Stack as t, theme as d, Button as h, ActionMenu as o } from "@veeqo/ui";
|
|
3
3
|
import { observer as m } from "mobx-react";
|
|
4
4
|
import { usePersistUnsavedChanges as v } from "./index60.js";
|
|
5
|
-
import { Notification as b, Container as g, Glyph as p, Wrap as u, Text as i, Bold as y } from "./
|
|
5
|
+
import { Notification as b, Container as g, Glyph as p, Wrap as u, Text as i, Bold as y } from "./index108.js";
|
|
6
6
|
const C = d.colors.secondary.blue.base, k = m(({
|
|
7
7
|
onDiscard: c,
|
|
8
8
|
viewName: r,
|
package/dist/index44.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),S=require("mobx-react"),i=require("@veeqo/ui"),u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),S=require("mobx-react"),i=require("@veeqo/ui"),u=require("./index107.cjs"),m=require("./index41.cjs"),q=require("./index62.cjs"),f=require("./index63.cjs"),p=require("./index37.cjs"),c=require("./index36.cjs"),v=require("./index8.cjs"),b=require("./index61.cjs"),a=require("./index12.cjs"),C=S.observer(({className:l})=>{const{IS_VIEWS_READONLY:r}=v.useBusinessLogic(),{Views:{draftViewsList:d}}=b.useStores(),{viewsArray:w,fixedViews:x}=q.useViews(),[n,o]=t.useState(!1),[V,h]=t.useState(null),j=()=>o(!1);return f.useViewUrlChange(),e.jsxs(e.Fragment,{children:[e.jsxs(i.ViewsContainer,{onClickMenu:r?void 0:()=>o(!0),ariaMenuControls:r?void 0:"views-menu",ariaMenuExpanded:r?!1:n,ref:h,className:l,children:[w.map(s=>e.jsx(a.ErrorBoundary,{children:e.jsx(c.ViewTab,{view:s})},s.id)),d.map(s=>e.jsx(a.ErrorBoundary,{children:e.jsx(c.ViewTab,{view:s})},s.id))]}),!r&&n&&e.jsx(i.Popover,{id:"views-menu",anchorElement:V,placement:"bottom",onShouldClose:()=>o(!1),children:e.jsxs(i.Card.Surface,{children:[e.jsx(u.FixedViews,{children:x.map(s=>e.jsx(i.Text,{variant:"placeholder",children:s.label},s.id||s.label))}),e.jsx(m.SortableViews,{}),e.jsx(u.Divider,{}),e.jsx(p.CreateView,{hideActionsPopover:j})]})})]})});exports.ViewList=C;
|
package/dist/index44.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as s, Fragment as w, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as n } from "react";
|
|
3
3
|
import { observer as V } from "mobx-react";
|
|
4
4
|
import { ViewsContainer as v, Popover as S, Card as x, Text as C } from "@veeqo/ui";
|
|
5
|
-
import { FixedViews as L, Divider as A } from "./
|
|
5
|
+
import { FixedViews as L, Divider as A } from "./index107.js";
|
|
6
6
|
import { SortableViews as E } from "./index41.js";
|
|
7
7
|
import { useViews as b } from "./index62.js";
|
|
8
8
|
import { useViewUrlChange as M } from "./index63.js";
|
package/dist/index46.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),N=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),N=require("./index90.cjs"),b=require("@veeqo/ui"),_=require("./index91.cjs"),j=require("mobx-react"),y=require("./index8.cjs"),B=require("./index52.cjs"),I=require("./index61.cjs"),O=require("./index62.cjs"),g=require("./index51.cjs"),w=j.observer(({columnDefinitions:T,pinnedRightColumnIds:i=[],pinnedLeftColumnIds:a=[]})=>{var M;const{DEFAULT_HIDDEN_COLUMNS:E,DEFAULT_VISIBLE_COLUMNS:p}=y.useBusinessLogic(),t=[...a,...i],l=E.filter(s=>!t.includes(s)),c=p.filter(s=>!t.includes(s)),S=[...l,...c],{closeModal:h,isModalOpen:q,openModal:A}=B.useModal(),{Filters:{activeViewId:n},Views:{draftViewsMap:f}}=I.useStores(),{viewsMap:x,isLoading:D}=O.useViews();if(!n||D)return null;const e=x.get(n),r=Array.isArray((M=e==null?void 0:e.columns)==null?void 0:M.columnIds),u=r?e.columns.columnIds.filter(s=>!t.includes(s)):c,L=r?S.filter(s=>!u.includes(s)):l,d=f.has(n),m=!(e!=null&&e.editable),v=m||d,C=d?"Please create a view to use table management":m?"Please choose a custom view to use table management":"Table management";return o.jsxs(o.Fragment,{children:[o.jsx(b.Tooltip,{text:C,children:o.jsx(b.Button,{"aria-label":"Open table management",onClick:()=>A(g.ModalId.ORDERS_TABLE_MANAGEMENT),size:"sm",iconSlot:o.jsx(_.TableManagementGlyph,{}),disabled:v})}),q(g.ModalId.ORDERS_TABLE_MANAGEMENT)&&o.jsx(N.TableManagementModal,{pinnedRightColumnIds:i,pinnedLeftColumnIds:a,visibleColumns:u,hiddenColumns:L,columnDefinitions:T,onClose:h})]})});exports.TableManagement=w;
|
package/dist/index46.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as v, Fragment as B, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { TableManagementModal as O } from "./
|
|
2
|
+
import { TableManagementModal as O } from "./index90.js";
|
|
3
3
|
import { Tooltip as w, Button as x } from "@veeqo/ui";
|
|
4
|
-
import { TableManagementGlyph as F } from "./
|
|
4
|
+
import { TableManagementGlyph as F } from "./index91.js";
|
|
5
5
|
import { observer as I } from "mobx-react";
|
|
6
6
|
import { useBusinessLogic as y } from "./index8.js";
|
|
7
7
|
import { useModal as P } from "./index52.js";
|
package/dist/index49.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=(e=>(e.TEXT="text",e.NUMBER="number",e.CHECKBOX="checkbox",e.RADIO="radio",e.DATE_RANGE="date_range",e.NUMBER_RANGE="number_range",e))(t||{});const a={revalidateOnFocus:!1,revalidateOnReconnect:!1,keepPreviousData:!0},R="Please enter at least 3 characters";exports.FilterChoiceValue=t;exports.MIN_SEARCH_ERROR_MESSAGE=R;exports.SWR_HOOK_OPTIONS=a;
|
package/dist/index49.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
const
|
|
1
|
+
var e = /* @__PURE__ */ ((a) => (a.TEXT = "text", a.NUMBER = "number", a.CHECKBOX = "checkbox", a.RADIO = "radio", a.DATE_RANGE = "date_range", a.NUMBER_RANGE = "number_range", a))(e || {});
|
|
2
|
+
const n = {
|
|
3
3
|
revalidateOnFocus: !1,
|
|
4
4
|
revalidateOnReconnect: !1,
|
|
5
5
|
keepPreviousData: !0
|
|
6
|
-
};
|
|
6
|
+
}, r = "Please enter at least 3 characters";
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
r as
|
|
8
|
+
e as FilterChoiceValue,
|
|
9
|
+
r as MIN_SEARCH_ERROR_MESSAGE,
|
|
10
|
+
n as SWR_HOOK_OPTIONS
|
|
10
11
|
};
|
package/dist/index78.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 d=require("@internationalized/date"),f=require("./index70.cjs"),F=require("./index69.cjs"),R=require("lodash/get"),A=require("./index93.cjs"),_=require("./index9.cjs"),T=r=>r&&r.__esModule?r:{default:r},n=T(R),h=({view:r,canUpdateCustomViews:g})=>{var u,c;const{DATE_RANGE_FILTERS:a,NUMBER_RANGE_FILTERS:o,GROUP_MAP:p}=_.BusinessLogicManager.getBusinessLogic(),l=Array.from(p.values()).flatMap(e=>e.fields),s=r.filters.filter||{},{colourPalette:m,customTextColour:b}=A.getViewTheme((u=r.view_attributes)==null?void 0:u.type);return{id:r.id,label:r.title,filterMaps:{filters:new Map(l.filter(e=>!a.includes(e.id)&&!o.includes(e.id)&&e.filterType!=="checkbox").map(e=>{const t=n.default(s,e.id);return[e.id,t!==void 0&&!Array.isArray(t)&&typeof t!="object"?String(t):""]}).filter(([,e])=>e!=="")),arrayFilters:new Map(l.filter(e=>e.filterType==="checkbox").map(e=>{const t=n.default(s,e.id);return[e.id,Array.isArray(t)?t:[]]}).filter(([,e])=>e.length>0)),rangeFilters:new Map(l.filter(e=>a.includes(e.id)).map(e=>{const t=n.default(s,e.id);if(!t)return null;let i;if(typeof t=="string")i=new f.RangeFilter(t);else if(typeof t=="object"&&t.gte&&t.lte){i=new f.RangeFilter("CUSTOM");const y=d.parseDate(t.gte),M=d.parseDate(t.lte);i.setDates(y,M)}else return null;return[e.id,i]}).filter(e=>e!==null)),numberRangeFilters:new Map(l.filter(e=>o.includes(e.id)).map(e=>{const t=n.default(s,e.id);if(!t||typeof t!="object")return null;const i=new F.NumberRangeFilter({filterId:e.id});return t.lte!==void 0&&i.setLte(Number(t.lte)),t.gte!==void 0&&i.setGte(Number(t.gte)),[e.id,i]}).filter(e=>e!==null))},page:r.filters.page,editable:r.editable&&g,isShared:r.shared,columns:r.columns,sort:(c=r.filters)==null?void 0:c.sort,colourPalette:m,customTextColour:b}};exports.viewsAdapter=h;
|
package/dist/index78.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { parseDate as
|
|
2
|
-
import { RangeFilter as
|
|
3
|
-
import { NumberRangeFilter as
|
|
1
|
+
import { parseDate as c } from "@internationalized/date";
|
|
2
|
+
import { RangeFilter as p } from "./index70.js";
|
|
3
|
+
import { NumberRangeFilter as M } from "./index69.js";
|
|
4
4
|
import n from "lodash/get";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { getViewTheme as F } from "./index93.js";
|
|
6
|
+
import { BusinessLogicManager as R } from "./index9.js";
|
|
7
|
+
const S = ({
|
|
7
8
|
view: r,
|
|
8
|
-
canUpdateCustomViews:
|
|
9
|
+
canUpdateCustomViews: m
|
|
9
10
|
}) => {
|
|
10
|
-
var f;
|
|
11
|
-
const { DATE_RANGE_FILTERS:
|
|
11
|
+
var u, f;
|
|
12
|
+
const { DATE_RANGE_FILTERS: o, NUMBER_RANGE_FILTERS: a, GROUP_MAP: d } = R.getBusinessLogic(), l = Array.from(d.values()).flatMap((e) => e.fields), s = r.filters.filter || {}, { colourPalette: g, customTextColour: b } = F((u = r.view_attributes) == null ? void 0 : u.type);
|
|
12
13
|
return {
|
|
13
14
|
id: r.id,
|
|
14
15
|
label: r.title,
|
|
15
16
|
filterMaps: {
|
|
16
17
|
filters: new Map(
|
|
17
18
|
l.filter(
|
|
18
|
-
(e) => !
|
|
19
|
+
(e) => !o.includes(e.id) && !a.includes(e.id) && e.filterType !== "checkbox"
|
|
19
20
|
).map((e) => {
|
|
20
21
|
const t = n(s, e.id);
|
|
21
22
|
return [e.id, t !== void 0 && !Array.isArray(t) && typeof t != "object" ? String(t) : ""];
|
|
@@ -28,37 +29,39 @@ const T = ({
|
|
|
28
29
|
}).filter(([, e]) => e.length > 0)
|
|
29
30
|
),
|
|
30
31
|
rangeFilters: new Map(
|
|
31
|
-
l.filter((e) =>
|
|
32
|
+
l.filter((e) => o.includes(e.id)).map((e) => {
|
|
32
33
|
const t = n(s, e.id);
|
|
33
34
|
if (!t) return null;
|
|
34
35
|
let i;
|
|
35
36
|
if (typeof t == "string")
|
|
36
|
-
i = new
|
|
37
|
+
i = new p(t);
|
|
37
38
|
else if (typeof t == "object" && t.gte && t.lte) {
|
|
38
|
-
i = new
|
|
39
|
-
const
|
|
40
|
-
i.setDates(
|
|
39
|
+
i = new p("CUSTOM");
|
|
40
|
+
const y = c(t.gte), A = c(t.lte);
|
|
41
|
+
i.setDates(y, A);
|
|
41
42
|
} else
|
|
42
43
|
return null;
|
|
43
44
|
return [e.id, i];
|
|
44
45
|
}).filter((e) => e !== null)
|
|
45
46
|
),
|
|
46
47
|
numberRangeFilters: new Map(
|
|
47
|
-
l.filter((e) =>
|
|
48
|
+
l.filter((e) => a.includes(e.id)).map((e) => {
|
|
48
49
|
const t = n(s, e.id);
|
|
49
50
|
if (!t || typeof t != "object") return null;
|
|
50
|
-
const i = new
|
|
51
|
+
const i = new M({ filterId: e.id });
|
|
51
52
|
return t.lte !== void 0 && i.setLte(Number(t.lte)), t.gte !== void 0 && i.setGte(Number(t.gte)), [e.id, i];
|
|
52
53
|
}).filter((e) => e !== null)
|
|
53
54
|
)
|
|
54
55
|
},
|
|
55
56
|
page: r.filters.page,
|
|
56
|
-
editable: r.editable &&
|
|
57
|
+
editable: r.editable && m,
|
|
57
58
|
isShared: r.shared,
|
|
58
59
|
columns: r.columns,
|
|
59
|
-
sort: (f = r.filters) == null ? void 0 : f.sort
|
|
60
|
+
sort: (f = r.filters) == null ? void 0 : f.sort,
|
|
61
|
+
colourPalette: g,
|
|
62
|
+
customTextColour: b
|
|
60
63
|
};
|
|
61
64
|
};
|
|
62
65
|
export {
|
|
63
|
-
|
|
66
|
+
S as viewsAdapter
|
|
64
67
|
};
|
package/dist/index79.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="all",
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@veeqo/ui"),e="all",r=()=>({id:e,label:"All",filterMaps:{filters:new Map,arrayFilters:new Map,rangeFilters:new Map,numberRangeFilters:new Map},page:{size:10},editable:!1,isShared:!1,columns:{columnIds:[],columnWidths:{}},colourPalette:l.theme.colors.secondary.blue});exports.ALL_VIEW_ID=e;exports.createAllView=r;
|
package/dist/index79.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { theme as e } from "@veeqo/ui";
|
|
2
|
+
const l = "all", r = () => ({
|
|
3
|
+
id: l,
|
|
3
4
|
label: "All",
|
|
4
5
|
filterMaps: {
|
|
5
6
|
filters: /* @__PURE__ */ new Map(),
|
|
@@ -15,9 +16,10 @@ const e = "all", l = () => ({
|
|
|
15
16
|
columns: {
|
|
16
17
|
columnIds: [],
|
|
17
18
|
columnWidths: {}
|
|
18
|
-
}
|
|
19
|
+
},
|
|
20
|
+
colourPalette: e.colors.secondary.blue
|
|
19
21
|
});
|
|
20
22
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
l as ALL_VIEW_ID,
|
|
24
|
+
r as createAllView
|
|
23
25
|
};
|
package/dist/index80.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index92.cjs"),w=require("./index79.cjs"),V=require("./index78.cjs"),d=({data:n,canUpdateCustomViews:u})=>{const l={fixedViews:[...r.INITIAL_VIEWS_STATE.fixedViews],customViews:[...r.INITIAL_VIEWS_STATE.customViews],viewsMap:new Map(r.INITIAL_VIEWS_STATE.viewsMap)};if(!n)return l;let o=!1;const i=n.reduce((e,s)=>{const t=V.viewsAdapter({view:s,canUpdateCustomViews:u});return e.viewsMap.set(s.id,t),s.editable?e.customViews.push(t):e.fixedViews.push(t),s.title==="All"&&(o=!0),e},l);return o&&(i.viewsMap.delete(w.ALL_VIEW_ID),i.fixedViews.shift()),i};exports.organiseViews=d;
|
package/dist/index80.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INITIAL_VIEWS_STATE as r } from "./
|
|
1
|
+
import { INITIAL_VIEWS_STATE as r } from "./index92.js";
|
|
2
2
|
import { ALL_VIEW_ID as p } from "./index79.js";
|
|
3
3
|
import { viewsAdapter as u } from "./index78.js";
|
|
4
4
|
const m = ({ data: o, canUpdateCustomViews: w }) => {
|
package/dist/index84.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./index109.cjs"),s=e=>{if(!l.isError(e))return e;if(e.stack){const t=e.stack.split(`
|
|
2
2
|
`);if(t.length<=10)return e;const n=t==null?void 0:t[0],i=t==null?void 0:t.splice(9),r=[n,...i].join(`
|
|
3
3
|
`);e.stack=r}return e};exports.filterErrorStack=s;
|