@veeqo/transfigure 1.2.1 → 1.2.2
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/types.d.ts +1 -0
- package/dist/components/Views/ViewList/ViewsList.d.ts +5 -1
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +14 -13
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +19 -31
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +12 -26
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +32 -14
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +28 -23
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +23 -6
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +1 -1
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +19 -2
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +7 -18
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +63 -7
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +26 -60
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +2 -30
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +32 -22
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +22 -32
- package/dist/index115.cjs +1 -7
- package/dist/index115.js +63 -10
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +42 -58
- package/dist/index117.cjs +7 -1
- package/dist/index117.js +10 -47
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +1 -1
- 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/index36.cjs +1 -1
- package/dist/index36.js +62 -60
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +1 -1
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +1 -1
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +36 -34
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +2 -2
- 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 +4 -117
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +117 -18
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +19 -5
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +2 -2
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +2 -2
- package/dist/index98.cjs +1 -19
- package/dist/index98.js +7 -24
- package/dist/index99.cjs +19 -1
- package/dist/index99.js +24 -21
- package/dist/storybookHelpers/Code.d.ts +3 -0
- package/package.json +1 -1
package/dist/index36.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),u=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("./index103.cjs"),Z=require("./index8.cjs"),$=require("./index61.cjs"),b=require("./index104.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:y},Views:{draftViewsMap:T},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,k]=c.useState(null),A=o=>{const q=L.get(d);if(h.has(o)){const n=h.get(o);n&&(f(n),m(!0),V())}else{const n=T.get(o);n?(f(n),m(!0),V()):E({type:"error",text:"Failed to load view"})}q&&y(d,q)},a=(e==null?void 0:e.id)===w,t=e.originalView!==void 0,g=e.originalView===void 0,I=M,l=(e==null?void 0:e.label)||"",P=N||j,p=c.useRef(!1);!P&&!p.current&&a&&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 D=c.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:_},menu:{toggleDropdown:v},delete:{closeDeleteConfirmation:B,handleDelete:O,handleDeleteDraftView:C}},state:{shouldShowDeleteConfirmation:H},actions:W,state:S}=Q.useDropdownManager(e),Y=c.useMemo(()=>{if(!r){if(g)return v;if(t)return C}},[C,t,g,v,r]);return i.jsxs(i.Fragment,{children:[i.jsx(u.ViewTab,{colourPalette:u.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:a,id:e==null?void 0:e.id,name:l,type:r?void 0:D,count:R?i.jsx(u.Loader,{type:"ThreeDots",width:12,height:12,color:a?"#fff":u.theme.colors.neutral.ink.dark}):I,onClick:A,subAction:Y,ariaContext:"orders",ref:k,"aria-controls":"options-dropdown","aria-expanded":S.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx(b.Confirmation,{shouldShow:H,viewName:l,onCancel:B,onDelete:O}),i.jsx(J.PillNotifications,{tabType:D,isActive:a,initialViewName:l,shouldShowCreateViewNotification:t,handleSaveDraft:_}),!r&&i.jsx(K.ViewDropdowns,{referenceElement:s,tab:e,...W,...S})]})});exports.ViewTab=ee;
|
package/dist/index36.js
CHANGED
|
@@ -1,78 +1,80 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { ViewTab as
|
|
4
|
-
import { observer as
|
|
5
|
-
import { useCustomViews as
|
|
6
|
-
import { useViews as
|
|
7
|
-
import { PillNotifications as
|
|
8
|
-
import { ViewDropdowns as
|
|
9
|
-
import { useDropdownManager as
|
|
10
|
-
import { useViewCounts as
|
|
11
|
-
import { useBusinessLogic as
|
|
12
|
-
import { useStores as
|
|
13
|
-
import { Confirmation as
|
|
14
|
-
const
|
|
15
|
-
const { VIEW_TYPE:
|
|
16
|
-
Filters: { activeViewId:
|
|
17
|
-
Views: { draftViewsMap:
|
|
18
|
-
Notifications: { notify:
|
|
19
|
-
} =
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const r =
|
|
23
|
-
r && (
|
|
1
|
+
import { jsxs as U, Fragment as $, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as z, useRef as G, useMemo as S } from "react";
|
|
3
|
+
import { ViewTab as J, theme as L, Loader as K } from "@veeqo/ui";
|
|
4
|
+
import { observer as Q } from "mobx-react";
|
|
5
|
+
import { useCustomViews as X } from "./index65.js";
|
|
6
|
+
import { useViews as Z } from "./index62.js";
|
|
7
|
+
import { PillNotifications as b } from "./index40.js";
|
|
8
|
+
import { ViewDropdowns as ee } from "./index43.js";
|
|
9
|
+
import { useDropdownManager as oe } from "./index56.js";
|
|
10
|
+
import { useViewCounts as ie } from "./index103.js";
|
|
11
|
+
import { useBusinessLogic as te } from "./index8.js";
|
|
12
|
+
import { useStores as re } from "./index61.js";
|
|
13
|
+
import { Confirmation as se } from "./index104.js";
|
|
14
|
+
const ve = Q(({ view: e }) => {
|
|
15
|
+
const { VIEW_TYPE: y, IS_VIEWS_READONLY: n, SEARCH_FILTER_ID: c } = te(), {
|
|
16
|
+
Filters: { activeViewId: d, initFiltersFromView: f, discardChanges: m, initFromUrl: u, filters: E, setFilter: F },
|
|
17
|
+
Views: { draftViewsMap: T },
|
|
18
|
+
Notifications: { notify: N }
|
|
19
|
+
} = re(), { viewsMap: w, defaultCustomViewId: x, isLoading: A } = Z(), { isLoading: I } = X({ type: y }), { viewCounts: R, isLoadingViewCounts: _ } = ie(), [i, k] = z(null), M = (o) => {
|
|
20
|
+
const C = E.get(c);
|
|
21
|
+
if (w.has(o)) {
|
|
22
|
+
const r = w.get(o);
|
|
23
|
+
r && (f(r), m(!0), u());
|
|
24
24
|
} else {
|
|
25
|
-
const r =
|
|
26
|
-
r ? (
|
|
25
|
+
const r = T.get(o);
|
|
26
|
+
r ? (f(r), m(!0), u()) : N({
|
|
27
27
|
type: "error",
|
|
28
28
|
text: "Failed to load view"
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
!
|
|
31
|
+
C && F(c, C);
|
|
32
|
+
}, a = (e == null ? void 0 : e.id) === d, t = e.originalView !== void 0, p = e.originalView === void 0, P = R, l = (e == null ? void 0 : e.label) || "", j = A || I, V = G(!1);
|
|
33
|
+
!j && !V.current && a && e.id === x && 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",
|
|
37
37
|
left: i.offsetLeft
|
|
38
38
|
});
|
|
39
39
|
}));
|
|
40
|
-
const h =
|
|
40
|
+
const h = S(() => t ? "draft" : e.editable ? "saved" : "fixed", [t, e.editable]), {
|
|
41
41
|
actions: {
|
|
42
|
-
create: { handleSaveDraft:
|
|
43
|
-
menu: { toggleDropdown:
|
|
44
|
-
delete: { closeDeleteConfirmation:
|
|
42
|
+
create: { handleSaveDraft: B },
|
|
43
|
+
menu: { toggleDropdown: g },
|
|
44
|
+
delete: { closeDeleteConfirmation: O, handleDelete: W, handleDeleteDraftView: v }
|
|
45
45
|
},
|
|
46
|
-
state: { shouldShowDeleteConfirmation:
|
|
47
|
-
actions:
|
|
46
|
+
state: { shouldShowDeleteConfirmation: Y },
|
|
47
|
+
actions: q,
|
|
48
48
|
state: D
|
|
49
|
-
} =
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
} = oe(e), H = S(() => {
|
|
50
|
+
if (!n) {
|
|
51
|
+
if (p) return g;
|
|
52
|
+
if (t) return v;
|
|
53
|
+
}
|
|
54
|
+
}, [v, t, p, g, n]);
|
|
55
|
+
return /* @__PURE__ */ U($, { children: [
|
|
54
56
|
/* @__PURE__ */ s(
|
|
55
|
-
|
|
57
|
+
J,
|
|
56
58
|
{
|
|
57
59
|
colourPalette: L.colors.secondary.blue,
|
|
58
60
|
className: "act-react-listing-custom-view",
|
|
59
|
-
active:
|
|
61
|
+
active: a,
|
|
60
62
|
id: e == null ? void 0 : e.id,
|
|
61
|
-
name:
|
|
62
|
-
type: h,
|
|
63
|
-
count:
|
|
64
|
-
|
|
63
|
+
name: l,
|
|
64
|
+
type: n ? void 0 : h,
|
|
65
|
+
count: _ ? /* @__PURE__ */ s(
|
|
66
|
+
K,
|
|
65
67
|
{
|
|
66
68
|
type: "ThreeDots",
|
|
67
69
|
width: 12,
|
|
68
70
|
height: 12,
|
|
69
|
-
color:
|
|
71
|
+
color: a ? "#fff" : L.colors.neutral.ink.dark
|
|
70
72
|
}
|
|
71
73
|
) : P,
|
|
72
|
-
onClick:
|
|
73
|
-
subAction:
|
|
74
|
+
onClick: M,
|
|
75
|
+
subAction: H,
|
|
74
76
|
ariaContext: "orders",
|
|
75
|
-
ref:
|
|
77
|
+
ref: k,
|
|
76
78
|
"aria-controls": "options-dropdown",
|
|
77
79
|
"aria-expanded": D.shouldShowDropdown,
|
|
78
80
|
"aria-haspopup": "dialog"
|
|
@@ -80,27 +82,27 @@ const ge = K(({ view: e }) => {
|
|
|
80
82
|
e == null ? void 0 : e.id
|
|
81
83
|
),
|
|
82
84
|
/* @__PURE__ */ s(
|
|
83
|
-
|
|
85
|
+
se,
|
|
84
86
|
{
|
|
85
|
-
shouldShow:
|
|
86
|
-
viewName:
|
|
87
|
-
onCancel:
|
|
88
|
-
onDelete:
|
|
87
|
+
shouldShow: Y,
|
|
88
|
+
viewName: l,
|
|
89
|
+
onCancel: O,
|
|
90
|
+
onDelete: W
|
|
89
91
|
}
|
|
90
92
|
),
|
|
91
93
|
/* @__PURE__ */ s(
|
|
92
|
-
|
|
94
|
+
b,
|
|
93
95
|
{
|
|
94
96
|
tabType: h,
|
|
95
|
-
isActive:
|
|
96
|
-
initialViewName:
|
|
97
|
+
isActive: a,
|
|
98
|
+
initialViewName: l,
|
|
97
99
|
shouldShowCreateViewNotification: t,
|
|
98
|
-
handleSaveDraft:
|
|
100
|
+
handleSaveDraft: B
|
|
99
101
|
}
|
|
100
102
|
),
|
|
101
|
-
/* @__PURE__ */ s(
|
|
103
|
+
!n && /* @__PURE__ */ s(ee, { referenceElement: i, tab: e, ...q, ...D })
|
|
102
104
|
] });
|
|
103
105
|
});
|
|
104
106
|
export {
|
|
105
|
-
|
|
107
|
+
ve as ViewTab
|
|
106
108
|
};
|
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("./index99.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 "./index99.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("./index100.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 "./index100.js";
|
|
7
7
|
import { UnsavedChangesPill as C } from "./index42.js";
|
|
8
8
|
const U = h(
|
|
9
9
|
({
|
package/dist/index41.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react"),m=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("react"),m=require("./index101.cjs"),g=require("./index65.cjs"),S=require("./index62.cjs"),b=require("./index4.cjs"),y=require("./index8.cjs"),V=require("./index61.cjs"),p=require("./index12.cjs"),q=()=>{const{VIEW_TYPE:u}=y.useBusinessLogic(),{sortedCustomViews:s,isLoading:a}=S.useViews(),{mutate:c}=g.useCustomViews({type:u}),[l,t]=n.useState(s);n.useEffect(()=>{t(s)},[s]);const{Notifications:{notify:w}}=V.useStores(),d=async o=>{t(o);const r=o.map(e=>e.id);try{await b.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:r}}}),await c(e=>({...e,settings:{...e.settings,custom_view_positions:{...e.settings.custom_view_positions,order:r}}}),{revalidate:!1})}catch{t(s),w({type:"error",text:"Failed to update order of views"})}};return a||!s.length?null:i.jsx(p.ErrorBoundary,{children:i.jsx(m.LegacySortableViews,{views:l,onChange:d,className:"act-sortable-views"})})};exports.SortableViews=q;
|
package/dist/index41.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as f, useEffect as l } from "react";
|
|
3
|
-
import { LegacySortableViews as w } from "./
|
|
3
|
+
import { LegacySortableViews as w } from "./index101.js";
|
|
4
4
|
import { useCustomViews as d } from "./index65.js";
|
|
5
5
|
import { useViews as g } from "./index62.js";
|
|
6
6
|
import { patchCurrentUser as _ } from "./index4.js";
|
package/dist/index44.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
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("./index102.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
|
@@ -1,50 +1,52 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, Fragment as w, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as n } from "react";
|
|
3
|
-
import { observer as
|
|
4
|
-
import { ViewsContainer as
|
|
5
|
-
import { FixedViews as
|
|
6
|
-
import { SortableViews as
|
|
7
|
-
import { useViews as
|
|
8
|
-
import { useViewUrlChange as
|
|
9
|
-
import { CreateView as
|
|
10
|
-
import { ViewTab as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
3
|
+
import { observer as V } from "mobx-react";
|
|
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 "./index102.js";
|
|
6
|
+
import { SortableViews as E } from "./index41.js";
|
|
7
|
+
import { useViews as b } from "./index62.js";
|
|
8
|
+
import { useViewUrlChange as M } from "./index63.js";
|
|
9
|
+
import { CreateView as T } from "./index37.js";
|
|
10
|
+
import { ViewTab as m } from "./index36.js";
|
|
11
|
+
import { useBusinessLogic as g } from "./index8.js";
|
|
12
|
+
import { useStores as R } from "./index61.js";
|
|
13
|
+
import { ErrorBoundary as l } from "./index12.js";
|
|
14
|
+
const Y = V(({ className: a }) => {
|
|
15
|
+
const { IS_VIEWS_READONLY: r } = g(), {
|
|
16
|
+
Views: { draftViewsList: d }
|
|
17
|
+
} = R(), { viewsArray: c, fixedViews: p } = b(), [t, i] = n(!1), [f, u] = n(null), h = () => i(!1);
|
|
18
|
+
return M(), /* @__PURE__ */ s(w, { children: [
|
|
19
|
+
/* @__PURE__ */ s(
|
|
20
|
+
v,
|
|
20
21
|
{
|
|
21
|
-
onClickMenu: () =>
|
|
22
|
-
ariaMenuControls: "views-menu",
|
|
23
|
-
ariaMenuExpanded: t,
|
|
24
|
-
ref:
|
|
22
|
+
onClickMenu: r ? void 0 : () => i(!0),
|
|
23
|
+
ariaMenuControls: r ? void 0 : "views-menu",
|
|
24
|
+
ariaMenuExpanded: r ? !1 : t,
|
|
25
|
+
ref: u,
|
|
26
|
+
className: a,
|
|
25
27
|
children: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
c.map((o) => /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(m, { view: o }) }, o.id)),
|
|
29
|
+
d.map((o) => /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e(m, { view: o }) }, o.id))
|
|
28
30
|
]
|
|
29
31
|
}
|
|
30
32
|
),
|
|
31
|
-
t && /* @__PURE__ */ e(
|
|
32
|
-
|
|
33
|
+
!r && t && /* @__PURE__ */ e(
|
|
34
|
+
S,
|
|
33
35
|
{
|
|
34
36
|
id: "views-menu",
|
|
35
|
-
anchorElement:
|
|
37
|
+
anchorElement: f,
|
|
36
38
|
placement: "bottom",
|
|
37
|
-
onShouldClose: () =>
|
|
38
|
-
children: /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */ e(
|
|
40
|
-
/* @__PURE__ */ e(
|
|
41
|
-
/* @__PURE__ */ e(
|
|
42
|
-
/* @__PURE__ */ e(
|
|
39
|
+
onShouldClose: () => i(!1),
|
|
40
|
+
children: /* @__PURE__ */ s(x.Surface, { children: [
|
|
41
|
+
/* @__PURE__ */ e(L, { children: p.map((o) => /* @__PURE__ */ e(C, { variant: "placeholder", children: o.label }, o.id || o.label)) }),
|
|
42
|
+
/* @__PURE__ */ e(E, {}),
|
|
43
|
+
/* @__PURE__ */ e(A, {}),
|
|
44
|
+
/* @__PURE__ */ e(T, { hideActionsPopover: h })
|
|
43
45
|
] })
|
|
44
46
|
}
|
|
45
47
|
)
|
|
46
48
|
] });
|
|
47
49
|
});
|
|
48
50
|
export {
|
|
49
|
-
|
|
51
|
+
Y as ViewList
|
|
50
52
|
};
|
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("./index89.cjs"),b=require("@veeqo/ui"),_=require("./index90.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 "./index89.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 "./index90.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/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("./index98.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 "./index98.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("./index111.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;
|
package/dist/index84.js
CHANGED
package/dist/index85.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index111.cjs"),n=({customError:t,originalError:e,type:c})=>{!s.isError(e)||!s.isError(t)||(e.stack&&(e.stack=t.stack),e.name&&(e.name=`${c} (${e.name})`))};exports.injectIntoError=n;
|
package/dist/index85.js
CHANGED
package/dist/index88.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="_actionsHeaderContainer_fgqms_1",t={actionsHeaderContainer:e};exports.actionsHeaderContainer=e;exports.default=t;
|
package/dist/index88.js
CHANGED
|
@@ -1,120 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 "./index91.js";
|
|
6
|
-
import { Container as Y, ColumnGroupsGrid as j, VerticalSeparator as z, VerticalText as B, HeaderContainer as L, ColumnSearch as Q } from "./index92.js";
|
|
7
|
-
import { DndContainer as R } from "./index93.js";
|
|
8
|
-
import { ColumnItem as q } from "./index94.js";
|
|
9
|
-
import { ColumnGroupIds as n } from "./index95.js";
|
|
10
|
-
import { TableManagementGlyph as P } from "./index89.js";
|
|
11
|
-
import { usePersistColumns as _ } from "./index96.js";
|
|
12
|
-
import { filterColumnsBySearch as V } from "./index97.js";
|
|
13
|
-
const { Glyph: E } = I, te = ({
|
|
14
|
-
onClose: l,
|
|
15
|
-
columnDefinitions: k,
|
|
16
|
-
hiddenColumns: s,
|
|
17
|
-
visibleColumns: m,
|
|
18
|
-
pinnedLeftColumnIds: D,
|
|
19
|
-
pinnedRightColumnIds: H
|
|
20
|
-
}) => {
|
|
21
|
-
const [o, b] = v(""), i = f(() => new Map(k.map((a) => [a.id, a])), []), [t, u] = v(() => ({
|
|
22
|
-
[n.Hidden]: s,
|
|
23
|
-
[n.Visible]: m
|
|
24
|
-
})), M = f(() => {
|
|
25
|
-
const a = t[n.Visible].map((r) => i.get(`${r}`));
|
|
26
|
-
return V(a, o);
|
|
27
|
-
}, [t, i, o]), x = f(() => {
|
|
28
|
-
const a = t[n.Hidden].map((r) => i.get(`${r}`));
|
|
29
|
-
return V(a, o);
|
|
30
|
-
}, [t, i, o]), { isSavingColumns: d, saveColumns: G } = _({ pinnedLeftColumnIds: D, pinnedRightColumnIds: H }), T = () => {
|
|
31
|
-
b(""), u({
|
|
32
|
-
[n.Hidden]: s,
|
|
33
|
-
[n.Visible]: m
|
|
34
|
-
});
|
|
35
|
-
}, C = y(
|
|
36
|
-
(a) => {
|
|
37
|
-
if (b(a), !a) {
|
|
38
|
-
const r = /* @__PURE__ */ new Set([...s, ...m]);
|
|
39
|
-
u((S) => ({
|
|
40
|
-
[n.Hidden]: S[n.Hidden].filter((g) => r.has(`${g}`)),
|
|
41
|
-
[n.Visible]: S[n.Visible].filter((g) => r.has(`${g}`))
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
[s, m]
|
|
46
|
-
), $ = y(
|
|
47
|
-
(a) => {
|
|
48
|
-
const r = i.get(`${a}`);
|
|
49
|
-
return r ? /* @__PURE__ */ e(q, { column: r, isDragOverlay: !0 }) : null;
|
|
50
|
-
},
|
|
51
|
-
[i]
|
|
52
|
-
);
|
|
53
|
-
return /* @__PURE__ */ e(
|
|
54
|
-
O,
|
|
55
|
-
{
|
|
56
|
-
variant: "lg",
|
|
57
|
-
style: { overflowY: "hidden" },
|
|
58
|
-
shouldShow: !0,
|
|
59
|
-
onClose: () => l == null ? void 0 : l(),
|
|
60
|
-
headerSlot: /* @__PURE__ */ c(L, { children: [
|
|
61
|
-
/* @__PURE__ */ c(h, { direction: "horizontal", alignX: "between", alignY: "center", children: [
|
|
62
|
-
/* @__PURE__ */ c(h, { direction: "horizontal", alignX: "start", alignY: "center", spacing: "sm", children: [
|
|
63
|
-
/* @__PURE__ */ e(P, { height: 32, width: 32 }),
|
|
64
|
-
/* @__PURE__ */ e(p, { variant: "headingLarge", as: "h1", children: "Table management" })
|
|
65
|
-
] }),
|
|
66
|
-
/* @__PURE__ */ e(X, { "aria-label": "Close modal", onClick: l, variant: "flat", iconSlot: /* @__PURE__ */ e(E, { name: "close" }) })
|
|
67
|
-
] }),
|
|
68
|
-
/* @__PURE__ */ c(p, { variant: "subheadingMedium", children: [
|
|
69
|
-
"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",
|
|
70
|
-
" ",
|
|
71
|
-
/* @__PURE__ */ e(A, { href: "#", target: "_blank", children: "help guide (TODO)" }),
|
|
72
|
-
"."
|
|
73
|
-
] }),
|
|
74
|
-
/* @__PURE__ */ e(p, { variant: "headingSmall", children: "Column management" }),
|
|
75
|
-
/* @__PURE__ */ e(
|
|
76
|
-
Q,
|
|
77
|
-
{
|
|
78
|
-
name: "column-search-query",
|
|
79
|
-
placeholder: "Search",
|
|
80
|
-
value: o,
|
|
81
|
-
onChange: C,
|
|
82
|
-
onClearClick: () => C(""),
|
|
83
|
-
fill: "100%"
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
] }),
|
|
87
|
-
leftActions: [
|
|
88
|
-
{
|
|
89
|
-
label: "Reset",
|
|
90
|
-
onClick: T,
|
|
91
|
-
variant: "default",
|
|
92
|
-
disabled: d
|
|
93
|
-
}
|
|
94
|
-
],
|
|
95
|
-
rightActions: [
|
|
96
|
-
{
|
|
97
|
-
label: "Cancel",
|
|
98
|
-
onClick: l,
|
|
99
|
-
variant: "default",
|
|
100
|
-
disabled: d
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
label: "Save",
|
|
104
|
-
onClick: () => G({ visibleColumns: t[n.Visible] }),
|
|
105
|
-
variant: "primary",
|
|
106
|
-
disabled: d,
|
|
107
|
-
loading: d
|
|
108
|
-
}
|
|
109
|
-
],
|
|
110
|
-
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: [
|
|
111
|
-
/* @__PURE__ */ e(w, { id: n.Visible, title: "Shown columns:", columns: M }),
|
|
112
|
-
/* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(B, { children: "Drag & Drop columns" }) }),
|
|
113
|
-
/* @__PURE__ */ e(w, { id: n.Hidden, title: "Hidden columns:", columns: x })
|
|
114
|
-
] }) }) }) }) })
|
|
115
|
-
}
|
|
116
|
-
);
|
|
1
|
+
const e = "_actionsHeaderContainer_fgqms_1", a = {
|
|
2
|
+
actionsHeaderContainer: e
|
|
117
3
|
};
|
|
118
4
|
export {
|
|
119
|
-
|
|
5
|
+
e as actionsHeaderContainer,
|
|
6
|
+
a as default
|
|
120
7
|
};
|
package/dist/index89.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=({
|
|
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("./index91.cjs"),i=require("./index92.cjs"),T=require("./index93.cjs"),V=require("./index94.cjs"),n=require("./index95.cjs"),D=require("./index90.cjs"),H=require("./index96.cjs"),j=require("./index97.cjs"),{Glyph:O}=w.VeeqoCommon,$=({onClose:u,columnDefinitions: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=$;
|