@veeqo/transfigure 0.0.19 → 0.0.21
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/components/RefreshButton/RefreshButton.d.ts +1 -1
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +35 -62
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +19 -36
- package/dist/index102.cjs +1 -13
- package/dist/index102.js +8 -17
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +62 -17
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +29 -7
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +62 -63
- package/dist/index106.cjs +13 -1
- package/dist/index106.js +17 -30
- package/dist/index107.cjs +1 -7
- package/dist/index107.js +42 -10
- package/dist/index108.cjs +7 -1
- package/dist/index108.js +10 -42
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +21 -21
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +1 -1
- 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/index33.cjs +1 -1
- package/dist/index33.js +2 -2
- 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/index43.cjs +1 -1
- package/dist/index43.js +2 -2
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +3 -3
- package/dist/index78.cjs +1 -8
- package/dist/index78.js +143 -12
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +18 -40
- package/dist/index80.cjs +8 -1
- package/dist/index80.js +12 -9
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +39 -141
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +7 -17
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +13 -33
- package/dist/index85.cjs +104 -1
- package/dist/index85.js +118 -27
- package/dist/index86.cjs +1 -19
- package/dist/index86.js +67 -23
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +28 -23
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +2 -22
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +40 -14
- package/dist/index90.cjs +1 -80
- package/dist/index90.js +11 -96
- package/dist/index91.cjs +1 -12
- package/dist/index91.js +24 -16
- package/dist/index92.cjs +19 -1
- package/dist/index92.js +24 -13
- package/dist/index93.cjs +1 -104
- package/dist/index93.js +32 -119
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +28 -67
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +20 -27
- package/dist/index96.cjs +80 -1
- package/dist/index96.js +96 -2
- package/dist/index97.cjs +12 -1
- package/dist/index97.js +16 -41
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +14 -10
- package/package.json +1 -1
package/dist/index107.js
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import "react";
|
|
2
|
+
const n = /* @__PURE__ */ Object.freeze({
|
|
3
|
+
Translate: {
|
|
4
|
+
toString(t) {
|
|
5
|
+
if (!t)
|
|
6
|
+
return;
|
|
7
|
+
const {
|
|
8
|
+
x: r,
|
|
9
|
+
y: e
|
|
10
|
+
} = t;
|
|
11
|
+
return "translate3d(" + (r ? Math.round(r) : 0) + "px, " + (e ? Math.round(e) : 0) + "px, 0)";
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
Scale: {
|
|
15
|
+
toString(t) {
|
|
16
|
+
if (!t)
|
|
17
|
+
return;
|
|
18
|
+
const {
|
|
19
|
+
scaleX: r,
|
|
20
|
+
scaleY: e
|
|
21
|
+
} = t;
|
|
22
|
+
return "scaleX(" + r + ") scaleY(" + e + ")";
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
Transform: {
|
|
26
|
+
toString(t) {
|
|
27
|
+
if (t)
|
|
28
|
+
return [n.Translate.toString(t), n.Scale.toString(t)].join(" ");
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
Transition: {
|
|
32
|
+
toString(t) {
|
|
33
|
+
let {
|
|
34
|
+
property: r,
|
|
35
|
+
duration: e,
|
|
36
|
+
easing: i
|
|
37
|
+
} = t;
|
|
38
|
+
return r + " " + e + "ms " + i;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
10
42
|
export {
|
|
11
|
-
|
|
43
|
+
n as CSS
|
|
12
44
|
};
|
package/dist/index108.cjs
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("styled-components"),e=require("@veeqo/ui"),a=t=>t&&t.__esModule?t:{default:t},i=a(o),s=i.default(e.BaseContainer)`
|
|
2
|
+
padding: ${e.theme.sizes.sm};
|
|
3
|
+
// This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
|
|
4
|
+
// with an additional sizes.base offset at the bottom.
|
|
5
|
+
max-height: calc(100vh ${({offset:t})=>t&&`- ${t}px`} - ${e.theme.sizes.base});
|
|
6
|
+
overflow-y: auto;
|
|
7
|
+
`;exports.AdaptiveStyledContainer=s;
|
package/dist/index108.js
CHANGED
|
@@ -1,44 +1,12 @@
|
|
|
1
|
-
import "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} = t;
|
|
11
|
-
return "translate3d(" + (r ? Math.round(r) : 0) + "px, " + (e ? Math.round(e) : 0) + "px, 0)";
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
Scale: {
|
|
15
|
-
toString(t) {
|
|
16
|
-
if (!t)
|
|
17
|
-
return;
|
|
18
|
-
const {
|
|
19
|
-
scaleX: r,
|
|
20
|
-
scaleY: e
|
|
21
|
-
} = t;
|
|
22
|
-
return "scaleX(" + r + ") scaleY(" + e + ")";
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
Transform: {
|
|
26
|
-
toString(t) {
|
|
27
|
-
if (t)
|
|
28
|
-
return [n.Translate.toString(t), n.Scale.toString(t)].join(" ");
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
Transition: {
|
|
32
|
-
toString(t) {
|
|
33
|
-
let {
|
|
34
|
-
property: r,
|
|
35
|
-
duration: e,
|
|
36
|
-
easing: i
|
|
37
|
-
} = t;
|
|
38
|
-
return r + " " + e + "ms " + i;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
1
|
+
import o from "styled-components";
|
|
2
|
+
import { theme as e, BaseContainer as i } from "@veeqo/ui";
|
|
3
|
+
const h = o(i)`
|
|
4
|
+
padding: ${e.sizes.sm};
|
|
5
|
+
// This calculation limits the height to a max of 100% of the viewport and uses offset as the position of the CTA button
|
|
6
|
+
// with an additional sizes.base offset at the bottom.
|
|
7
|
+
max-height: calc(100vh ${({ offset: t }) => t && `- ${t}px`} - ${e.sizes.base});
|
|
8
|
+
overflow-y: auto;
|
|
9
|
+
`;
|
|
42
10
|
export {
|
|
43
|
-
|
|
11
|
+
h as AdaptiveStyledContainer
|
|
44
12
|
};
|
package/dist/index15.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),F=require("mobx-react"),s=require("@veeqo/ui"),r=require("./index46.cjs"),A=require("./index18.cjs"),g=require("./index19.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),F=require("mobx-react"),s=require("@veeqo/ui"),r=require("./index46.cjs"),A=require("./index18.cjs"),g=require("./index19.cjs"),h=require("./index20.cjs"),v=require("./index14.cjs"),T=require("./index7.cjs"),f=require("./index58.cjs"),x=F.observer(()=>{const{FIELDS_MAP:c}=T.useBusinessLogic(),{Filters:{hasActiveFilters:a,activeFilterKeysList:l,clearAllFilters:n}}=f.useStores();if(!a)return null;const o=Array.from(c).filter(([e])=>l.includes(e));return t.jsxs(s.Stack,{direction:"horizontal",alignY:"center",style:{flexWrap:"wrap",rowGap:s.theme.sizes.sm},children:[t.jsx(s.Button,{variant:"link",onClick:()=>n(),children:"Clear all"}),o.map(([e,i])=>{const u=()=>{switch(i.filterType){case r.FilterChoiceValue.CHECKBOX:return t.jsx(A.ActiveFilterArrayTag,{filterData:i},e);case r.FilterChoiceValue.DATE_RANGE:return t.jsx(g.ActiveFilterDateRangeTag,{filterData:i},e);case r.FilterChoiceValue.NUMBER_RANGE:return t.jsx(h.ActiveFilterNumberRangeTag,{filterData:i},e);case r.FilterChoiceValue.TEXT:case r.FilterChoiceValue.NUMBER:case r.FilterChoiceValue.RADIO:return t.jsx(v.ActiveFilterTag,{filterData:i},e);default:return t.jsx(s.Alert,{size:"xs",variant:"error",title:`Unsupport filter "${e}"`},e)}};return t.jsx("div",{children:u()})})]})});exports.ActiveFilters=x;
|
package/dist/index15.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { observer as m } from "mobx-react";
|
|
3
|
-
import { Stack as f,
|
|
3
|
+
import { Stack as f, theme as p, Button as A, Alert as u } from "@veeqo/ui";
|
|
4
4
|
import { FilterChoiceValue as e } from "./index46.js";
|
|
5
|
-
import { ActiveFilterArrayTag as
|
|
6
|
-
import { ActiveFilterDateRangeTag as
|
|
7
|
-
import { ActiveFilterNumberRangeTag as
|
|
8
|
-
import { ActiveFilterTag as
|
|
9
|
-
import { useBusinessLogic as
|
|
10
|
-
import { useStores as
|
|
11
|
-
const
|
|
12
|
-
const { FIELDS_MAP: o } =
|
|
13
|
-
Filters: { hasActiveFilters: s, activeFilterKeysList: a, clearAllFilters:
|
|
14
|
-
} =
|
|
5
|
+
import { ActiveFilterArrayTag as F } from "./index18.js";
|
|
6
|
+
import { ActiveFilterDateRangeTag as h } from "./index19.js";
|
|
7
|
+
import { ActiveFilterNumberRangeTag as d } from "./index20.js";
|
|
8
|
+
import { ActiveFilterTag as g } from "./index14.js";
|
|
9
|
+
import { useBusinessLogic as v } from "./index7.js";
|
|
10
|
+
import { useStores as D } from "./index58.js";
|
|
11
|
+
const M = m(() => {
|
|
12
|
+
const { FIELDS_MAP: o } = v(), {
|
|
13
|
+
Filters: { hasActiveFilters: s, activeFilterKeysList: a, clearAllFilters: l }
|
|
14
|
+
} = D();
|
|
15
15
|
if (!s) return null;
|
|
16
|
-
const
|
|
17
|
-
return /* @__PURE__ */ c(f, { direction: "horizontal", alignY: "center", children: [
|
|
18
|
-
/* @__PURE__ */ t(
|
|
19
|
-
|
|
16
|
+
const n = Array.from(o).filter(([r]) => a.includes(r));
|
|
17
|
+
return /* @__PURE__ */ c(f, { direction: "horizontal", alignY: "center", style: { flexWrap: "wrap", rowGap: p.sizes.sm }, children: [
|
|
18
|
+
/* @__PURE__ */ t(A, { variant: "link", onClick: () => l(), children: "Clear all" }),
|
|
19
|
+
n.map(([r, i]) => /* @__PURE__ */ t("div", { children: (() => {
|
|
20
20
|
switch (i.filterType) {
|
|
21
21
|
case e.CHECKBOX:
|
|
22
|
-
return /* @__PURE__ */ t(u, { filterData: i }, r);
|
|
23
|
-
case e.DATE_RANGE:
|
|
24
22
|
return /* @__PURE__ */ t(F, { filterData: i }, r);
|
|
25
|
-
case e.
|
|
23
|
+
case e.DATE_RANGE:
|
|
26
24
|
return /* @__PURE__ */ t(h, { filterData: i }, r);
|
|
25
|
+
case e.NUMBER_RANGE:
|
|
26
|
+
return /* @__PURE__ */ t(d, { filterData: i }, r);
|
|
27
27
|
case e.TEXT:
|
|
28
28
|
case e.NUMBER:
|
|
29
29
|
case e.RADIO:
|
|
30
|
-
return /* @__PURE__ */ t(
|
|
30
|
+
return /* @__PURE__ */ t(g, { filterData: i }, r);
|
|
31
31
|
default:
|
|
32
|
-
return /* @__PURE__ */ t(
|
|
32
|
+
return /* @__PURE__ */ t(u, { size: "xs", variant: "error", title: `Unsupport filter "${r}"` }, r);
|
|
33
33
|
}
|
|
34
34
|
})() }))
|
|
35
35
|
] });
|
|
36
36
|
});
|
|
37
37
|
export {
|
|
38
|
-
|
|
38
|
+
M as ActiveFilters
|
|
39
39
|
};
|
package/dist/index20.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),b=require("mobx-react"),r=require("@veeqo/ui"),F=require("./index64.cjs"),R=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("react"),b=require("mobx-react"),r=require("@veeqo/ui"),F=require("./index64.cjs"),R=require("./index105.cjs"),h=require("./index58.cjs"),x=b.observer(({filterData:i})=>{const{Filters:{numberRangeFilters:o,clearNumberRangeFilter:u,setNumberRangeFilter:d}}=h.useStores(),e=o.get(i.id),[s,a]=l.useState(e),c=l.useCallback(()=>{const n=new F.NumberRangeFilter({filterId:i.id});return e&&(e.gte&&n.setGte(e.gte),e.lte&&n.setLte(e.lte)),n},[i.id,e]);l.useEffect(()=>{const n=c();a(n)},[c,e]);const g=()=>{u(i.id)},m=()=>{!e||!s||d({numberRange:e,lte:s.lte,gte:s.gte})};return t.jsx(r.FilterTag,{shouldCloseOnClickAway:!0,header:t.jsx("div",{children:"Edit filter (style and semant me pls)"}),label:i.label,text:(e==null?void 0:e.filterLabel)||"Loading...",content:t.jsx(r.BaseContainer,{style:{padding:r.theme.sizes.md},children:t.jsx(R.FilterNumberRangeFilter,{data:i,editedValue:s,setEditedValue:a})}),footer:t.jsx(r.BaseContainer,{style:{padding:r.theme.sizes.sm,width:"200px"},children:t.jsxs(r.Stack,{direction:"horizontal",alignX:"end",children:[t.jsx(r.Button,{variant:"default",size:"sm",onClick:g,children:"Clear"}),t.jsx(r.Button,{variant:"primary",size:"sm",onClick:m,children:"Apply"})]})})})});exports.ActiveFilterNumberRangeTag=x;
|
package/dist/index20.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useState as b, useCallback as f, useEffect as h } from "react";
|
|
|
3
3
|
import { observer as R } from "mobx-react";
|
|
4
4
|
import { FilterTag as v, BaseContainer as o, theme as a, Stack as y, Button as d } from "@veeqo/ui";
|
|
5
5
|
import { NumberRangeFilter as C } from "./index64.js";
|
|
6
|
-
import { FilterNumberRangeFilter as N } from "./
|
|
6
|
+
import { FilterNumberRangeFilter as N } from "./index105.js";
|
|
7
7
|
import { useStores as w } from "./index58.js";
|
|
8
8
|
const j = R(
|
|
9
9
|
({ filterData: r }) => {
|
package/dist/index28.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),R=require("react"),_=require("mobx-react"),j=require("lodash/debounce"),o=require("@veeqo/ui"),L=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),R=require("react"),_=require("mobx-react"),j=require("lodash/debounce"),o=require("@veeqo/ui"),L=require("./index100.cjs"),d=require("./index64.cjs"),p=require("./index7.cjs"),y=require("./index58.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),[r,g]=R.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 d.NumberRangeFilter({filterId:i.id});return u.set(i.id,l),l},c=R.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 d.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=[r.gte,r.lte];return a.jsxs(o.Stack,{spacing:"xs",alignX:"stretch",children:[a.jsx(o.Button,{variant:"link",onClick:h,children:"Clear"}),a.jsxs(o.Stack,{direction:"horizontal",children:[a.jsx(o.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:r.gte.toString(),onChange:N}),a.jsx(o.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:r.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 "./index100.js";
|
|
7
7
|
import { NumberRangeFilter as h } from "./index64.js";
|
|
8
8
|
import { useBusinessLogic as B } from "./index7.js";
|
|
9
9
|
import { useStores as T } from "./index58.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("./index91.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 "./index91.js";
|
|
6
6
|
import { FilterGroup as n } from "./index32.js";
|
|
7
7
|
const u = e(() => {
|
|
8
8
|
const { GROUP_MAP: t } = s();
|
package/dist/index33.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),a=require("react"),c=require("@veeqo/ui"),W=require("mobx-react"),Y=require("./index61.cjs"),z=require("./index59.cjs"),G=require("./index37.cjs"),J=require("./index40.cjs"),K=require("./index53.cjs"),Q=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),a=require("react"),c=require("@veeqo/ui"),W=require("mobx-react"),Y=require("./index61.cjs"),z=require("./index59.cjs"),G=require("./index37.cjs"),J=require("./index40.cjs"),K=require("./index53.cjs"),Q=require("./index93.cjs"),X=require("./index7.cjs"),Z=require("./index58.cjs"),$=require("./index94.cjs"),b=W.observer(({view:e})=>{const{VIEW_TYPE:S,SEARCH_FILTER_ID:l}=X.useBusinessLogic(),{Filters:{activeViewId:d,initFiltersFromView:w,discardChanges:f,initFromUrl:m,filters:x,setFilter:L},Views:{draftViewsMap:T},Notifications:{notify:y}}=Z.useStores(),{viewsMap:V,defaultCustomViewId:F,isLoading:j}=z.useViews(),{isLoading:N}=Y.useCustomViews({type:S}),{viewCounts:E,isLoadingTableData:M}=Q.useViewCounts(e.id),[s,R]=a.useState(null),k=o=>{const q=x.get(l);if(V.has(o)){const n=V.get(o);n&&(w(n),f(!0),m())}else{const n=T.get(o);n?(w(n),f(!0),m()):y({type:"error",text:"Failed to load view"})}q&&L(l,q)},r=(e==null?void 0:e.id)===d,t=e.originalView!==void 0,h=e.originalView===void 0,P=E,u=(e==null?void 0:e.label)||"",A=j||N,g=a.useRef(!1);!A&&!g.current&&r&&e.id===F&&s&&(g.current=!0,s&&d===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const p=a.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:B},menu:{toggleDropdown:D},delete:{closeDeleteConfirmation:I,handleDelete:_,handleDeleteDraftView:C}},state:{shouldShowDeleteConfirmation:H},actions:O,state:v}=K.useDropdownManager(e),U=a.useMemo(()=>{if(h)return D;if(t)return C},[C,t,h,D]);return i.jsxs(i.Fragment,{children:[i.jsx(c.ViewTab,{colourPalette:c.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:r,id:e==null?void 0:e.id,name:u,type:p,count:M?i.jsx(c.Loader,{type:"ThreeDots",width:12,height:12,color:r?"#fff":c.theme.colors.neutral.ink.dark}):P,onClick:k,subAction:U,ariaContext:"orders",ref:R,"aria-controls":"options-dropdown","aria-expanded":v.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx($.Confirmation,{shouldShow:H,viewName:u,onCancel:I,onDelete:_}),i.jsx(G.PillNotifications,{tabType:p,isActive:r,initialViewName:u,shouldShowCreateViewNotification:t,handleSaveDraft:B}),i.jsx(J.ViewDropdowns,{referenceElement:s,tab:e,...O,...v})]})});exports.ViewTab=b;
|
package/dist/index33.js
CHANGED
|
@@ -7,10 +7,10 @@ import { useViews as X } from "./index59.js";
|
|
|
7
7
|
import { PillNotifications as Z } from "./index37.js";
|
|
8
8
|
import { ViewDropdowns as b } from "./index40.js";
|
|
9
9
|
import { useDropdownManager as ee } from "./index53.js";
|
|
10
|
-
import { useViewCounts as oe } from "./
|
|
10
|
+
import { useViewCounts as oe } from "./index93.js";
|
|
11
11
|
import { useBusinessLogic as ie } from "./index7.js";
|
|
12
12
|
import { useStores as te } from "./index58.js";
|
|
13
|
-
import { Confirmation as re } from "./
|
|
13
|
+
import { Confirmation as re } from "./index94.js";
|
|
14
14
|
const ge = K(({ view: e }) => {
|
|
15
15
|
const { VIEW_TYPE: S, SEARCH_FILTER_ID: l } = ie(), {
|
|
16
16
|
Filters: { activeViewId: c, initFiltersFromView: d, discardChanges: f, initFromUrl: m, filters: T, setFilter: F },
|
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("./index92.cjs"),g=require("./index49.cjs"),j=require("./index48.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 "./index92.js";
|
|
3
3
|
import { useModal as k } from "./index49.js";
|
|
4
4
|
import { ModalId as T } from "./index48.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("./index59.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("./index59.cjs"),v=require("./index95.cjs"),g=require("./index39.cjs"),h=require("./index58.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 "./index59.js";
|
|
5
|
-
import { InfoPill as w } from "./
|
|
5
|
+
import { InfoPill as w } from "./index95.js";
|
|
6
6
|
import { UnsavedChangesPill as x } from "./index39.js";
|
|
7
7
|
import { useStores as g } from "./index58.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("./index98.cjs"),g=require("./index61.cjs"),S=require("./index59.cjs"),b=require("./index3.cjs"),y=require("./index7.cjs"),V=require("./index58.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 "./index98.js";
|
|
4
4
|
import { useCustomViews as w } from "./index61.js";
|
|
5
5
|
import { useViews as d } from "./index59.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"),u=require("./index57.cjs"),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"),u=require("./index57.cjs"),n=require("./index96.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(s.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(s.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
|
@@ -3,7 +3,7 @@ import { useState as m } from "react";
|
|
|
3
3
|
import { Stack as g, theme as u, Button as o, AnimatedDropdown as v } from "@veeqo/ui";
|
|
4
4
|
import { observer as p } from "mobx-react";
|
|
5
5
|
import { usePersistUnsavedChanges as f } from "./index57.js";
|
|
6
|
-
import { Notification as w, Container as C, Glyph as b, Wrap as y, Text as a, Bold as k, Item as r } from "./
|
|
6
|
+
import { Notification as w, Container as C, Glyph as b, Wrap as y, Text as a, Bold as k, Item as r } from "./index96.js";
|
|
7
7
|
const S = u.colors.secondary.blue.base, A = p(
|
|
8
8
|
({
|
|
9
9
|
onDiscard: s,
|
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("./index97.cjs"),j=require("./index38.cjs"),m=require("./index59.cjs"),S=require("./index60.cjs"),q=require("./index34.cjs"),u=require("./index33.cjs"),p=require("./index58.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 "./index97.js";
|
|
6
6
|
import { SortableViews as b } from "./index38.js";
|
|
7
7
|
import { useViews as A } from "./index59.js";
|
|
8
8
|
import { useViewUrlChange as L } from "./index60.js";
|
package/dist/index43.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("./index78.cjs"),b=require("@veeqo/ui"),_=require("./index79.cjs"),j=require("mobx-react"),y=require("./index7.cjs"),B=require("./index49.cjs"),I=require("./index58.cjs"),O=require("./index59.cjs"),g=require("./index48.cjs"),w=j.observer(({columnDefinitions:T,pinnedRightColumnIds:i=[],pinnedLeftColumnIds:a=[]})=>{var M;const{DEFAULT_HIDDEN_COLUMNS:E,DEFAULT_VISIBLE_COLUMNS:p}=y.useBusinessLogic(),n=[...a,...i],l=E.filter(s=>!n.includes(s)),c=p.filter(s=>!n.includes(s)),S=[...l,...c],{closeModal:f,isModalOpen:h,openModal:q}=B.useModal(),{Filters:{activeViewId:t},Views:{draftViewsMap:A}}=I.useStores(),{viewsMap:D,isLoading:x}=O.useViews();if(!t||x)return null;const e=D.get(t),r=Array.isArray((M=e==null?void 0:e.columns)==null?void 0:M.columnIds),u=r?e.columns.columnIds.filter(s=>!n.includes(s)):c,L=r?S.filter(s=>!u.includes(s)):l,d=A.has(t),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:()=>q(g.ModalId.ORDERS_TABLE_MANAGEMENT),size:"sm",iconSlot:o.jsx(_.TableManagementGlyph,{}),disabled:v})}),h(g.ModalId.ORDERS_TABLE_MANAGEMENT)&&o.jsx(N.TableManagementModal,{pinnedRightColumnIds:i,pinnedLeftColumnIds:a,visibleColumns:u,hiddenColumns:L,columnDefintions:T,onClose:f})]})});exports.TableManagement=w;
|
package/dist/index43.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 "./index78.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 "./index79.js";
|
|
5
5
|
import { observer as I } from "mobx-react";
|
|
6
6
|
import { useBusinessLogic as y } from "./index7.js";
|
|
7
7
|
import { useModal as P } from "./index49.js";
|
package/dist/index44.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("@veeqo/ui"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("@veeqo/ui"),r=require("./index80.cjs"),a=require("./index81.cjs"),d=require("./index82.cjs"),h=({isLoading:t,refetch:n,trackMetricClick:s})=>{const{hasChanges:o,acknowledgeButtonClick:l}=a.usePollListOrders(),i=async()=>{n(),l(),s==null||s()};return e.jsx(u.Tooltip,{text:"Refresh orders",children:e.jsx(r.StyledButton,{onClick:i,variant:"default",size:"sm",loading:t,disabled:t,iconSlot:e.jsx(d.RefreshIcon,{}),"aria-label":o?"refresh table with changes":"refresh table","aria-live":"polite",children:e.jsx(r.StyledIndicator,{color:"red",size:"xs",style:{opacity:o?1:0}})})})};exports.RefreshButton=h;
|
package/dist/index44.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Tooltip as n } from "@veeqo/ui";
|
|
3
|
-
import { StyledButton as i, StyledIndicator as a } from "./
|
|
4
|
-
import { usePollListOrders as f } from "./
|
|
5
|
-
import { RefreshIcon as h } from "./
|
|
3
|
+
import { StyledButton as i, StyledIndicator as a } from "./index80.js";
|
|
4
|
+
import { usePollListOrders as f } from "./index81.js";
|
|
5
|
+
import { RefreshIcon as h } from "./index82.js";
|
|
6
6
|
const R = ({ isLoading: r, refetch: t, trackMetricClick: o }) => {
|
|
7
7
|
const { hasChanges: s, acknowledgeButtonClick: l } = f();
|
|
8
8
|
return /* @__PURE__ */ e(n, { text: "Refresh orders", children: /* @__PURE__ */ e(
|
package/dist/index78.cjs
CHANGED
|
@@ -1,8 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
padding-right: ${t.theme.sizes.sm};
|
|
3
|
-
`,n=s.default(t.Indicator)`
|
|
4
|
-
height: ${t.theme.sizes[3]};
|
|
5
|
-
min-width: ${t.theme.sizes[3]};
|
|
6
|
-
top: -${t.theme.sizes.xs};
|
|
7
|
-
right: -${t.theme.sizes.xs};
|
|
8
|
-
`;exports.StyledButton=o;exports.StyledIndicator=n;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("@veeqo/ui"),s=require("react"),w=require("@veeqo/components"),S=require("./index84.cjs"),i=require("./index85.cjs"),T=require("./index86.cjs"),V=require("./index87.cjs"),n=require("./index88.cjs"),D=require("./index79.cjs"),H=require("./index89.cjs"),j=require("./index90.cjs"),{Glyph:O}=w.VeeqoCommon,$=({onClose:u,columnDefintions:G,hiddenColumns:d,visibleColumns:m,pinnedLeftColumnIds:y,pinnedRightColumnIds:f})=>{const[c,p]=s.useState(""),a=s.useMemo(()=>new Map(G.map(r=>[r.id,r])),[]),[o,g]=s.useState(()=>({[n.ColumnGroupIds.Hidden]:d,[n.ColumnGroupIds.Visible]:m})),I=s.useMemo(()=>{const r=o[n.ColumnGroupIds.Visible].map(t=>a.get(`${t}`));return j.filterColumnsBySearch(r,c)},[o,a,c]),v=s.useMemo(()=>{const r=o[n.ColumnGroupIds.Hidden].map(t=>a.get(`${t}`));return j.filterColumnsBySearch(r,c)},[o,a,c]),{isSavingColumns:h,saveColumns:M}=H.usePersistColumns({pinnedLeftColumnIds:y,pinnedRightColumnIds:f}),q=()=>{p(""),g({[n.ColumnGroupIds.Hidden]:d,[n.ColumnGroupIds.Visible]:m})},x=s.useCallback(r=>{if(p(r),!r){const t=new Set([...d,...m]);g(b=>({[n.ColumnGroupIds.Hidden]:b[n.ColumnGroupIds.Hidden].filter(C=>t.has(`${C}`)),[n.ColumnGroupIds.Visible]:b[n.ColumnGroupIds.Visible].filter(C=>t.has(`${C}`))}))}},[d,m]),k=s.useCallback(r=>{const t=a.get(`${r}`);return t?e.jsx(V.ColumnItem,{column:t,isDragOverlay:!0}):null},[a]);return e.jsx(l.Modal,{variant:"lg",style:{overflowY:"hidden"},shouldShow:!0,onClose:()=>u==null?void 0:u(),headerSlot:e.jsxs(i.HeaderContainer,{children:[e.jsxs(l.Stack,{direction:"horizontal",alignX:"between",alignY:"center",children:[e.jsxs(l.Stack,{direction:"horizontal",alignX:"start",alignY:"center",spacing:"sm",children:[e.jsx(D.TableManagementGlyph,{height:32,width:32}),e.jsx(l.Text,{variant:"headingLarge",as:"h1",children:"Table management"})]}),e.jsx(l.Button,{"aria-label":"Close modal",onClick:u,variant:"flat",iconSlot:e.jsx(O,{name:"close"})})]}),e.jsxs(l.Text,{variant:"subheadingMedium",children:["Show, hide, or change the order of the columns in the view, so you always see the data that's most important to you. Learn more with our"," ",e.jsx(l.Anchor,{href:"#",target:"_blank",children:"help guide (TODO)"}),"."]}),e.jsx(l.Text,{variant:"headingSmall",children:"Column management"}),e.jsx(i.ColumnSearch,{name:"column-search-query",placeholder:"Search",value:c,onChange:x,onClearClick:()=>x(""),fill:"100%"})]}),leftActions:[{label:"Reset",onClick:q,variant:"default",disabled:h}],rightActions:[{label:"Cancel",onClick:u,variant:"default",disabled:h},{label:"Save",onClick:()=>M({visibleColumns:o[n.ColumnGroupIds.Visible]}),variant:"primary",disabled:h,loading:h}],children:e.jsx(l.Stack,{spacing:"md",alignX:"stretch",children:e.jsx(l.Stack,{spacing:4,alignX:"stretch",children:e.jsx(T.DndContainer,{items:o,setItems:g,renderDragOverlay:k,children:e.jsx(i.Container,{children:e.jsxs(i.ColumnGroupsGrid,{columns:2,spacing:"xl",children:[e.jsx(S.ColumnGroup,{id:n.ColumnGroupIds.Visible,title:"Shown columns:",columns:I}),e.jsx(i.VerticalSeparator,{children:e.jsx(i.VerticalText,{children:"Drag & Drop columns"})}),e.jsx(S.ColumnGroup,{id:n.ColumnGroupIds.Hidden,title:"Hidden columns:",columns:v})]})})})})})})};exports.TableManagementModal=$;
|
package/dist/index78.js
CHANGED
|
@@ -1,14 +1,145 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { Modal as O, Stack as h, Text as p, Button as X, Anchor as A } from "@veeqo/ui";
|
|
3
|
+
import { useState as v, useMemo as f, useCallback as y } from "react";
|
|
4
|
+
import { VeeqoCommon as I } from "@veeqo/components";
|
|
5
|
+
import { ColumnGroup as w } from "./index84.js";
|
|
6
|
+
import { Container as Y, ColumnGroupsGrid as j, VerticalSeparator as z, VerticalText as B, HeaderContainer as L, ColumnSearch as Q } from "./index85.js";
|
|
7
|
+
import { DndContainer as R } from "./index86.js";
|
|
8
|
+
import { ColumnItem as q } from "./index87.js";
|
|
9
|
+
import { ColumnGroupIds as n } from "./index88.js";
|
|
10
|
+
import { TableManagementGlyph as P } from "./index79.js";
|
|
11
|
+
import { usePersistColumns as _ } from "./index89.js";
|
|
12
|
+
import { filterColumnsBySearch as V } from "./index90.js";
|
|
13
|
+
const { Glyph: E } = I, te = ({
|
|
14
|
+
onClose: l,
|
|
15
|
+
columnDefintions: k,
|
|
16
|
+
hiddenColumns: s,
|
|
17
|
+
visibleColumns: m,
|
|
18
|
+
pinnedLeftColumnIds: D,
|
|
19
|
+
pinnedRightColumnIds: H
|
|
20
|
+
}) => {
|
|
21
|
+
const [o, b] = v(""), i = f(
|
|
22
|
+
() => new Map(k.map((a) => [a.id, a])),
|
|
23
|
+
[]
|
|
24
|
+
), [t, u] = v(() => ({
|
|
25
|
+
[n.Hidden]: s,
|
|
26
|
+
[n.Visible]: m
|
|
27
|
+
})), M = f(() => {
|
|
28
|
+
const a = t[n.Visible].map((r) => i.get(`${r}`));
|
|
29
|
+
return V(a, o);
|
|
30
|
+
}, [t, i, o]), x = f(() => {
|
|
31
|
+
const a = t[n.Hidden].map((r) => i.get(`${r}`));
|
|
32
|
+
return V(a, o);
|
|
33
|
+
}, [t, i, o]), { isSavingColumns: d, saveColumns: G } = _({ pinnedLeftColumnIds: D, pinnedRightColumnIds: H }), T = () => {
|
|
34
|
+
b(""), u({
|
|
35
|
+
[n.Hidden]: s,
|
|
36
|
+
[n.Visible]: m
|
|
37
|
+
});
|
|
38
|
+
}, C = y(
|
|
39
|
+
(a) => {
|
|
40
|
+
if (b(a), !a) {
|
|
41
|
+
const r = /* @__PURE__ */ new Set([...s, ...m]);
|
|
42
|
+
u((S) => ({
|
|
43
|
+
[n.Hidden]: S[n.Hidden].filter((g) => r.has(`${g}`)),
|
|
44
|
+
[n.Visible]: S[n.Visible].filter((g) => r.has(`${g}`))
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
[s, m]
|
|
49
|
+
), $ = y(
|
|
50
|
+
(a) => {
|
|
51
|
+
const r = i.get(`${a}`);
|
|
52
|
+
return r ? /* @__PURE__ */ e(q, { column: r, isDragOverlay: !0 }) : null;
|
|
53
|
+
},
|
|
54
|
+
[i]
|
|
55
|
+
);
|
|
56
|
+
return /* @__PURE__ */ e(
|
|
57
|
+
O,
|
|
58
|
+
{
|
|
59
|
+
variant: "lg",
|
|
60
|
+
style: { overflowY: "hidden" },
|
|
61
|
+
shouldShow: !0,
|
|
62
|
+
onClose: () => l == null ? void 0 : l(),
|
|
63
|
+
headerSlot: /* @__PURE__ */ c(L, { children: [
|
|
64
|
+
/* @__PURE__ */ c(h, { direction: "horizontal", alignX: "between", alignY: "center", children: [
|
|
65
|
+
/* @__PURE__ */ c(h, { direction: "horizontal", alignX: "start", alignY: "center", spacing: "sm", children: [
|
|
66
|
+
/* @__PURE__ */ e(P, { height: 32, width: 32 }),
|
|
67
|
+
/* @__PURE__ */ e(p, { variant: "headingLarge", as: "h1", children: "Table management" })
|
|
68
|
+
] }),
|
|
69
|
+
/* @__PURE__ */ e(
|
|
70
|
+
X,
|
|
71
|
+
{
|
|
72
|
+
"aria-label": "Close modal",
|
|
73
|
+
onClick: l,
|
|
74
|
+
variant: "flat",
|
|
75
|
+
iconSlot: /* @__PURE__ */ e(E, { name: "close" })
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ c(p, { variant: "subheadingMedium", children: [
|
|
80
|
+
"Show, hide, or change the order of the columns in the view, so you always see the data that's most important to you. Learn more with our",
|
|
81
|
+
" ",
|
|
82
|
+
/* @__PURE__ */ e(A, { href: "#", target: "_blank", children: "help guide (TODO)" }),
|
|
83
|
+
"."
|
|
84
|
+
] }),
|
|
85
|
+
/* @__PURE__ */ e(p, { variant: "headingSmall", children: "Column management" }),
|
|
86
|
+
/* @__PURE__ */ e(
|
|
87
|
+
Q,
|
|
88
|
+
{
|
|
89
|
+
name: "column-search-query",
|
|
90
|
+
placeholder: "Search",
|
|
91
|
+
value: o,
|
|
92
|
+
onChange: C,
|
|
93
|
+
onClearClick: () => C(""),
|
|
94
|
+
fill: "100%"
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
] }),
|
|
98
|
+
leftActions: [
|
|
99
|
+
{
|
|
100
|
+
label: "Reset",
|
|
101
|
+
onClick: T,
|
|
102
|
+
variant: "default",
|
|
103
|
+
disabled: d
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
rightActions: [
|
|
107
|
+
{
|
|
108
|
+
label: "Cancel",
|
|
109
|
+
onClick: l,
|
|
110
|
+
variant: "default",
|
|
111
|
+
disabled: d
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
label: "Save",
|
|
115
|
+
onClick: () => G({ visibleColumns: t[n.Visible] }),
|
|
116
|
+
variant: "primary",
|
|
117
|
+
disabled: d,
|
|
118
|
+
loading: d
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
children: /* @__PURE__ */ e(h, { spacing: "md", alignX: "stretch", children: /* @__PURE__ */ e(h, { spacing: 4, alignX: "stretch", children: /* @__PURE__ */ e(R, { items: t, setItems: u, renderDragOverlay: $, children: /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ c(j, { columns: 2, spacing: "xl", children: [
|
|
122
|
+
/* @__PURE__ */ e(
|
|
123
|
+
w,
|
|
124
|
+
{
|
|
125
|
+
id: n.Visible,
|
|
126
|
+
title: "Shown columns:",
|
|
127
|
+
columns: M
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(B, { children: "Drag & Drop columns" }) }),
|
|
131
|
+
/* @__PURE__ */ e(
|
|
132
|
+
w,
|
|
133
|
+
{
|
|
134
|
+
id: n.Hidden,
|
|
135
|
+
title: "Hidden columns:",
|
|
136
|
+
columns: x
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
] }) }) }) }) })
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
};
|
|
11
143
|
export {
|
|
12
|
-
|
|
13
|
-
n as StyledIndicator
|
|
144
|
+
te as TableManagementModal
|
|
14
145
|
};
|
package/dist/index79.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 e=require("react/jsx-runtime"),t=({height:H=16,width:V=16})=>e.jsx("svg",{width:V,height:H,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12.6667 3.33333V12.6667H3.33333V3.33333H12.6667ZM13.4 2H2.6C2.26667 2 2 2.26667 2 2.6V13.4C2 13.6667 2.26667 14 2.6 14H13.4C13.6667 14 14 13.6667 14 13.4V2.6C14 2.26667 13.6667 2 13.4 2ZM7.33333 4.66667H11.3333V6H7.33333V4.66667ZM7.33333 7.33333H11.3333V8.66667H7.33333V7.33333ZM7.33333 10H11.3333V11.3333H7.33333V10ZM4.66667 4.66667H6V6H4.66667V4.66667ZM4.66667 7.33333H6V8.66667H4.66667V7.33333ZM4.66667 10H6V11.3333H4.66667V10Z",fill:"#37424D"})});exports.TableManagementGlyph=t;
|