@veeqo/transfigure 1.2.2 → 1.2.4
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 +10 -0
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +88 -78
- package/dist/index100.cjs +19 -1
- package/dist/index100.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 +28 -23
- package/dist/index105.cjs +12 -1
- package/dist/index105.js +16 -24
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +1 -1
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +1 -1
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index116.cjs +7 -1
- package/dist/index116.js +10 -47
- package/dist/index117.cjs +1 -7
- package/dist/index117.js +47 -10
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +1 -1
- 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/index44.cjs +1 -1
- package/dist/index44.js +1 -1
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +2 -2
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +71 -71
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +35 -33
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +11 -10
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +46 -44
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +202 -201
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +41 -29
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +1 -1
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +5 -41
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +41 -9
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +8 -4
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +7 -7
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +7 -13
- package/dist/index92.cjs +1 -104
- package/dist/index92.js +13 -120
- package/dist/index93.cjs +104 -1
- package/dist/index93.js +117 -65
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +63 -24
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +29 -2
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +2 -41
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +39 -9
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +10 -6
- package/dist/index99.cjs +1 -19
- package/dist/index99.js +24 -24
- package/dist/mobx/Filters/Filters.d.ts +1 -1
- package/dist/storybookHelpers/apiMocks/views/custom_views.d.ts +45 -4
- package/package.json +5 -2
package/dist/index116.js
CHANGED
|
@@ -1,49 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
({ field: t, editedValue: c, setEditedValue: a }) => {
|
|
11
|
-
var o, i;
|
|
12
|
-
const l = u(() => {
|
|
13
|
-
var e;
|
|
14
|
-
return L({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
|
|
15
|
-
}, [(o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher]), { isLoading: m, isValidating: h, data: p, error: f } = S(
|
|
16
|
-
(i = t.fetchAsyncFilterOptions) == null ? void 0 : i.URL,
|
|
17
|
-
l,
|
|
18
|
-
k
|
|
19
|
-
), r = m || h, g = d({ data: p, config: t.fetchAsyncFilterOptions });
|
|
20
|
-
return /* @__PURE__ */ s(b, { spacing: "xs", alignX: "stretch", children: [
|
|
21
|
-
/* @__PURE__ */ n(
|
|
22
|
-
F,
|
|
23
|
-
{
|
|
24
|
-
allowMultiple: !0,
|
|
25
|
-
title: t.label,
|
|
26
|
-
options: g,
|
|
27
|
-
selected: c,
|
|
28
|
-
onChange: (e) => a(e)
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
r && /* @__PURE__ */ n(
|
|
32
|
-
x,
|
|
33
|
-
{
|
|
34
|
-
width: "200px",
|
|
35
|
-
height: y.sizes[5],
|
|
36
|
-
"aria-busy": !0,
|
|
37
|
-
"aria-label": `Loading ${t.label} filters`
|
|
38
|
-
}
|
|
39
|
-
),
|
|
40
|
-
!r && f && /* @__PURE__ */ s(A, { variant: "errorSmall", children: [
|
|
41
|
-
"Error: failed to load filter for ",
|
|
42
|
-
t.label
|
|
43
|
-
] })
|
|
44
|
-
] });
|
|
45
|
-
}
|
|
46
|
-
);
|
|
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
|
+
`;
|
|
47
10
|
export {
|
|
48
|
-
|
|
11
|
+
h as AdaptiveStyledContainer
|
|
49
12
|
};
|
package/dist/index117.cjs
CHANGED
|
@@ -1,7 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),p=require("react"),d=require("mobx-react"),t=require("@veeqo/ui"),m=require("swr/immutable"),x=require("./index75.cjs"),y=require("./index76.cjs"),F=require("./index49.cjs"),O=e=>e&&e.__esModule?e:{default:e},A=O(m),S=d.observer(({field:e,editedValue:o,setEditedValue:a})=>{var c,i;const l=p.useMemo(()=>{var r;return y.getFetcherFunction({fetcherName:(r=e.fetchAsyncFilterOptions)==null?void 0:r.fetcher})},[(c=e.fetchAsyncFilterOptions)==null?void 0:c.fetcher]),{isLoading:u,isValidating:h,data:g,error:b}=A.default((i=e.fetchAsyncFilterOptions)==null?void 0:i.URL,l,F.SWR_HOOK_OPTIONS),n=u||h,f=x.getAsyncOptions({data:g,config:e.fetchAsyncFilterOptions});return s.jsxs(t.Stack,{spacing:"xs",alignX:"stretch",children:[s.jsx(t.ChoiceList,{allowMultiple:!0,title:e.label,options:f,selected:o,onChange:r=>a(r)}),n&&s.jsx(t.Skeleton,{width:"200px",height:t.theme.sizes[5],"aria-busy":!0,"aria-label":`Loading ${e.label} filters`}),!n&&b&&s.jsxs(t.Text,{variant:"errorSmall",children:["Error: failed to load filter for ",e.label]})]})});exports.ActiveAsyncCheckboxFilter=S;
|
package/dist/index117.js
CHANGED
|
@@ -1,12 +1,49 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as u } from "react";
|
|
3
|
+
import { observer as O } from "mobx-react";
|
|
4
|
+
import { Stack as b, ChoiceList as F, Skeleton as x, theme as y, Text as A } from "@veeqo/ui";
|
|
5
|
+
import S from "swr/immutable";
|
|
6
|
+
import { getAsyncOptions as d } from "./index75.js";
|
|
7
|
+
import { getFetcherFunction as L } from "./index76.js";
|
|
8
|
+
import { SWR_HOOK_OPTIONS as k } from "./index49.js";
|
|
9
|
+
const T = O(
|
|
10
|
+
({ field: t, editedValue: c, setEditedValue: a }) => {
|
|
11
|
+
var o, i;
|
|
12
|
+
const l = u(() => {
|
|
13
|
+
var e;
|
|
14
|
+
return L({ fetcherName: (e = t.fetchAsyncFilterOptions) == null ? void 0 : e.fetcher });
|
|
15
|
+
}, [(o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher]), { isLoading: m, isValidating: h, data: p, error: f } = S(
|
|
16
|
+
(i = t.fetchAsyncFilterOptions) == null ? void 0 : i.URL,
|
|
17
|
+
l,
|
|
18
|
+
k
|
|
19
|
+
), r = m || h, g = d({ data: p, config: t.fetchAsyncFilterOptions });
|
|
20
|
+
return /* @__PURE__ */ s(b, { spacing: "xs", alignX: "stretch", children: [
|
|
21
|
+
/* @__PURE__ */ n(
|
|
22
|
+
F,
|
|
23
|
+
{
|
|
24
|
+
allowMultiple: !0,
|
|
25
|
+
title: t.label,
|
|
26
|
+
options: g,
|
|
27
|
+
selected: c,
|
|
28
|
+
onChange: (e) => a(e)
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
r && /* @__PURE__ */ n(
|
|
32
|
+
x,
|
|
33
|
+
{
|
|
34
|
+
width: "200px",
|
|
35
|
+
height: y.sizes[5],
|
|
36
|
+
"aria-busy": !0,
|
|
37
|
+
"aria-label": `Loading ${t.label} filters`
|
|
38
|
+
}
|
|
39
|
+
),
|
|
40
|
+
!r && f && /* @__PURE__ */ s(A, { variant: "errorSmall", children: [
|
|
41
|
+
"Error: failed to load filter for ",
|
|
42
|
+
t.label
|
|
43
|
+
] })
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
);
|
|
10
47
|
export {
|
|
11
|
-
|
|
48
|
+
T as ActiveAsyncCheckboxFilter
|
|
12
49
|
};
|
package/dist/index17.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),l=require("mobx-react"),s=require("@veeqo/ui"),c=require("./index49.cjs"),u=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),l=require("mobx-react"),s=require("@veeqo/ui"),c=require("./index49.cjs"),u=require("./index117.cjs"),h=l.observer(({data:e,editedValue:r,setEditedValue:t})=>{var i;switch(e.filterType){case c.FilterChoiceValue.CHECKBOX:return e.fetchAsyncFilterOptions?o.jsx(u.ActiveAsyncCheckboxFilter,{field:e,setEditedValue:t,editedValue:r}):o.jsx(s.ChoiceList,{allowMultiple:!0,title:e.label,options:(i=e.options)!=null&&i.length?e.options:[],selected:r,onChange:n=>t(n)});default:return null}});exports.FilterArrayField=h;
|
package/dist/index17.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { observer as n } from "mobx-react";
|
|
3
3
|
import { ChoiceList as p } from "@veeqo/ui";
|
|
4
4
|
import { FilterChoiceValue as s } from "./index49.js";
|
|
5
|
-
import { ActiveAsyncCheckboxFilter as c } from "./
|
|
5
|
+
import { ActiveAsyncCheckboxFilter as c } from "./index117.js";
|
|
6
6
|
const F = n(
|
|
7
7
|
({ data: r, editedValue: e, setEditedValue: o }) => {
|
|
8
8
|
var i;
|
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("./index99.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 "./index99.js";
|
|
6
6
|
import { FilterGroup as n } from "./index35.js";
|
|
7
7
|
const u = e(() => {
|
|
8
8
|
const { GROUP_MAP: t } = s();
|
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("./index100.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 "./index100.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/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("./index105.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 "./index105.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/index47.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),h=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),h=require("./index87.cjs"),e=require("@veeqo/ui"),o=require("./index88.cjs"),d=require("./index61.cjs"),m=({isLoading:a,refetch:n,trackMetricClick:s,tooltipText:l="Refresh data",buttonProps:i={size:"sm",variant:"default"}})=>{const{hasChanges:r,acknowledgeButtonClick:u}=h.usePollData(),{Notifications:{notify:c}}=d.useStores(),f=async()=>{try{await n(),await u(),s==null||s()}catch{c({type:"error",text:"Failed to refresh data"})}};return t.jsxs(e.Tooltip,{className:o.default.refreshTooltip,text:l,children:[t.jsx(e.Button,{className:o.default.refreshButton,onClick:f,loading:a,disabled:a,iconSlot:t.jsx(e.RefreshIcon,{color:e.theme.colors.neutral.ink.base}),"aria-label":r?"refresh table with changes":"refresh table","aria-live":"polite",...i}),t.jsx(e.Indicator,{className:o.default.refreshIndicator,color:"red",size:"xs",style:{opacity:r?1:0}})]})};exports.RefreshButton=m;
|
package/dist/index47.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { usePollData as c } from "./
|
|
2
|
+
import { usePollData as c } from "./index87.js";
|
|
3
3
|
import { Tooltip as d, Button as p, RefreshIcon as u, theme as y, Indicator as x } from "@veeqo/ui";
|
|
4
|
-
import t from "./
|
|
4
|
+
import t from "./index88.js";
|
|
5
5
|
import { useStores as b } from "./index61.js";
|
|
6
6
|
const j = ({
|
|
7
7
|
isLoading: s,
|
package/dist/index56.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 w=require("react"),f=require("./index79.cjs"),Y=require("./index78.cjs"),k=require("./index65.cjs"),G=require("./index57.cjs"),H=require("./index60.cjs"),W=require("./index62.cjs"),n=require("./index45.cjs"),N=require("./index4.cjs"),$=require("./index3.cjs"),B=require("./index8.cjs"),b=require("./index61.cjs"),j=require("./index6.cjs"),z=require("./index5.cjs"),J=e=>{const{VIEW_TYPE:u}=B.useBusinessLogic(),{duplicateView:q}=G.useDuplicateActiveView(),{getActiveViewInAPIFormat:E}=H.usePersistUnsavedChanges(),{canDeleteCustomViews:O,defaultCustomViewId:L,canUpdateCustomViews:M,mutate:x}=k.useCustomViews({type:u}),{mutate:p,viewsMap:d,viewsArray:t}=W.useViews(),[g,a]=w.useState(!1),[A,h]=w.useState(!1),[D,l]=w.useState(!1),[F,S]=w.useState(!1),{Views:{removeDraftViewById:m,draftViewsMap:R},Filters:{initFiltersFromView:r,updateUrl:c,setActiveViewId:V},Notifications:{notify:o}}=b.useStores();return{actions:{delete:{handleDeleteDraftView:()=>{if(!e.originalView)throw Error("No draft view found");m(e.id);const s=d.get(L);if(s)s&&r(s);else{const i=d.get(f.ALL_VIEW_ID);i?r(i):t!=null&&t[0]&&r(t[0])}c()},handleDelete:async()=>{try{if(O){await $.deleteCustomView(Number(e.id)),await p();const s=d.get(f.ALL_VIEW_ID);s?r(s):t!=null&&t[0]&&r(t[0]),c(),A&&h(!1),D&&l(D),o({type:"success",text:`'${e.label}' has been deleted`})}else o({type:"info",text:"You require additional user permissions to delete a company shared view"})}catch{o({type:"error",text:"Failed to delete view"})}},handleShowDeleteConfirmation:()=>{if(R.has(e.id)){m(e.id),e.originalView?V(e.originalView.id):d.has(f.ALL_VIEW_ID)?V(f.ALL_VIEW_ID):t!=null&&t[0]&&V(t[0].id);return}O?h(!0):o({type:"info",text:"You require additional user permissions to delete a company shared view"})},closeDeleteConfirmation:()=>h(!1)},edit:{handleShowEditDropdown:()=>{a(!1),l(!0)},closeEditDropdown:()=>l(!1)},menu:{handleSave:async s=>{try{const{viewName:i,shareOption:C,isDefault:y}=s,v=C==="company"?n.SHARING_OPTIONS.COMPANY:n.SHARING_OPTIONS.PERSONAL,_={attributes:{title:i,shared:v.key===n.SHARING_OPTIONS.COMPANY.key}};await z.patchCustomView(e.id,_),y&&(await N.patchCurrentUser({user_setting_attributes:{default_custom_view:{id:Number(e.id),type:u}}}),await x()),await p(),c(),o({type:"success",text:`'${i}' view updated`}),l(!1)}catch{o({type:"error",text:"Failed to save view"})}},handleDuplicate:()=>{q(),a(!1)},handleMakeDefault:async()=>{try{await N.patchCurrentUser({user_setting_attributes:{default_custom_view:{id:Number(e.id),type:u}}}),o({type:"success",text:`'${e.label}' is now your default view`}),a(!1)}catch{o({type:"error",text:"Failed to set default view"})}},openDropdown:()=>a(!0),closeDropdown:()=>a(!1),toggleDropdown:()=>a(!g)},create:{handleCreate:async s=>{try{const{viewName:i,shareOption:C,isDefault:y}=s,v=C==="company"?n.SHARING_OPTIONS.COMPANY:n.SHARING_OPTIONS.PERSONAL,{arg:_}=E(),{data:I}=await j.createCustomView({attributes:{..._,title:i,shared:v.key===n.SHARING_OPTIONS.COMPANY.key}}),P=t.map(U=>U.id);P.push(I.id),await N.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:P},...y?{default_custom_view:{id:Number(I.id),type:u}}:{}}}),await p(),m(e.id);const T=Y.viewsAdapter({view:I,canUpdateCustomViews:M});r(T),c(),S(!1),o({type:"success",text:`New view '${i}' created`})}catch(i){console.log(i),o({type:"error",text:"Failed to save draft view"})}},closeCreateDropdown:()=>S(!1),handleSaveDraft:async()=>{S(!0)}}},state:{shouldShowDropdown:g,shouldShowEditDropdown:D,shouldShowCreateDropdown:F,shouldShowDeleteConfirmation:A}}};exports.useDropdownManager=J;
|
package/dist/index56.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
import { useState as w } from "react";
|
|
2
|
-
import { ALL_VIEW_ID as
|
|
2
|
+
import { ALL_VIEW_ID as f } from "./index79.js";
|
|
3
3
|
import { viewsAdapter as R } from "./index78.js";
|
|
4
4
|
import { useCustomViews as q } from "./index65.js";
|
|
5
5
|
import { useDuplicateActiveView as B } from "./index57.js";
|
|
6
6
|
import { usePersistUnsavedChanges as T } from "./index60.js";
|
|
7
7
|
import { useViews as W } from "./index62.js";
|
|
8
|
-
import { SHARING_OPTIONS as
|
|
9
|
-
import { patchCurrentUser as
|
|
8
|
+
import { SHARING_OPTIONS as n } from "./index45.js";
|
|
9
|
+
import { patchCurrentUser as N } from "./index4.js";
|
|
10
10
|
import { deleteCustomView as G } from "./index3.js";
|
|
11
11
|
import { useBusinessLogic as H } from "./index8.js";
|
|
12
12
|
import { useStores as b } from "./index61.js";
|
|
13
13
|
import { createCustomView as j } from "./index6.js";
|
|
14
14
|
import { patchCustomView as z } from "./index5.js";
|
|
15
|
-
const
|
|
16
|
-
const { VIEW_TYPE:
|
|
17
|
-
canDeleteCustomViews:
|
|
18
|
-
defaultCustomViewId:
|
|
19
|
-
canUpdateCustomViews:
|
|
20
|
-
mutate:
|
|
15
|
+
const Ve = (e) => {
|
|
16
|
+
const { VIEW_TYPE: d } = H(), { duplicateView: A } = B(), { getActiveViewInAPIFormat: P } = T(), {
|
|
17
|
+
canDeleteCustomViews: O,
|
|
18
|
+
defaultCustomViewId: M,
|
|
19
|
+
canUpdateCustomViews: F,
|
|
20
|
+
mutate: Y
|
|
21
21
|
} = q({
|
|
22
|
-
type:
|
|
23
|
-
}), { mutate:
|
|
24
|
-
Views: { removeDraftViewById:
|
|
25
|
-
Filters: { initFiltersFromView:
|
|
26
|
-
Notifications: { notify:
|
|
22
|
+
type: d
|
|
23
|
+
}), { mutate: p, viewsMap: l, viewsArray: t } = W(), [x, a] = w(!1), [E, m] = w(!1), [h, c] = w(!1), [k, D] = w(!1), {
|
|
24
|
+
Views: { removeDraftViewById: V, draftViewsMap: L },
|
|
25
|
+
Filters: { initFiltersFromView: r, updateUrl: u, setActiveViewId: y },
|
|
26
|
+
Notifications: { notify: s }
|
|
27
27
|
} = b();
|
|
28
28
|
return {
|
|
29
29
|
actions: {
|
|
30
30
|
delete: {
|
|
31
31
|
handleDeleteDraftView: () => {
|
|
32
32
|
if (!e.originalView) throw Error("No draft view found");
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
if (
|
|
36
|
-
|
|
33
|
+
V(e.id);
|
|
34
|
+
const o = l.get(M);
|
|
35
|
+
if (o)
|
|
36
|
+
o && r(o);
|
|
37
37
|
else {
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const i = l.get(f);
|
|
39
|
+
i ? r(i) : t != null && t[0] && r(t[0]);
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
u();
|
|
42
42
|
},
|
|
43
43
|
handleDelete: async () => {
|
|
44
44
|
try {
|
|
45
|
-
if (
|
|
46
|
-
await G(Number(e.id)), await
|
|
47
|
-
const
|
|
48
|
-
t &&
|
|
45
|
+
if (O) {
|
|
46
|
+
await G(Number(e.id)), await p();
|
|
47
|
+
const o = l.get(f);
|
|
48
|
+
o ? r(o) : t != null && t[0] && r(t[0]), u(), E && m(!1), h && c(h), s({
|
|
49
49
|
type: "success",
|
|
50
50
|
text: `'${e.label}' has been deleted`
|
|
51
51
|
});
|
|
52
52
|
} else
|
|
53
|
-
|
|
53
|
+
s({
|
|
54
54
|
type: "info",
|
|
55
55
|
text: "You require additional user permissions to delete a company shared view"
|
|
56
56
|
});
|
|
57
57
|
} catch {
|
|
58
|
-
|
|
58
|
+
s({
|
|
59
59
|
type: "error",
|
|
60
60
|
text: "Failed to delete view"
|
|
61
61
|
});
|
|
@@ -63,67 +63,67 @@ const ye = (e) => {
|
|
|
63
63
|
},
|
|
64
64
|
handleShowDeleteConfirmation: () => {
|
|
65
65
|
if (L.has(e.id)) {
|
|
66
|
-
|
|
66
|
+
V(e.id), e.originalView ? y(e.originalView.id) : l.has(f) ? y(f) : t != null && t[0] && y(t[0].id);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
O ? m(!0) : s({
|
|
70
70
|
type: "info",
|
|
71
71
|
text: "You require additional user permissions to delete a company shared view"
|
|
72
72
|
});
|
|
73
73
|
},
|
|
74
|
-
closeDeleteConfirmation: () =>
|
|
74
|
+
closeDeleteConfirmation: () => m(!1)
|
|
75
75
|
},
|
|
76
76
|
edit: {
|
|
77
77
|
handleShowEditDropdown: () => {
|
|
78
|
-
a(!1),
|
|
78
|
+
a(!1), c(!0);
|
|
79
79
|
},
|
|
80
|
-
closeEditDropdown: () =>
|
|
80
|
+
closeEditDropdown: () => c(!1)
|
|
81
81
|
},
|
|
82
82
|
menu: {
|
|
83
|
-
handleSave: async (
|
|
83
|
+
handleSave: async (o) => {
|
|
84
84
|
try {
|
|
85
|
-
const { viewName:
|
|
85
|
+
const { viewName: i, shareOption: S, isDefault: v } = o, C = S === "company" ? n.COMPANY : n.PERSONAL, _ = {
|
|
86
86
|
attributes: {
|
|
87
|
-
title:
|
|
88
|
-
shared:
|
|
87
|
+
title: i,
|
|
88
|
+
shared: C.key === n.COMPANY.key
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
|
-
await z(e.id,
|
|
91
|
+
await z(e.id, _), v && (await N({
|
|
92
92
|
user_setting_attributes: {
|
|
93
93
|
default_custom_view: {
|
|
94
94
|
id: Number(e.id),
|
|
95
|
-
type:
|
|
95
|
+
type: d
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
}), await
|
|
98
|
+
}), await Y()), await p(), u(), s({
|
|
99
99
|
type: "success",
|
|
100
|
-
text: `'${
|
|
101
|
-
}),
|
|
100
|
+
text: `'${i}' view updated`
|
|
101
|
+
}), c(!1);
|
|
102
102
|
} catch {
|
|
103
|
-
|
|
103
|
+
s({
|
|
104
104
|
type: "error",
|
|
105
105
|
text: "Failed to save view"
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
109
|
handleDuplicate: () => {
|
|
110
|
-
|
|
110
|
+
A(), a(!1);
|
|
111
111
|
},
|
|
112
112
|
handleMakeDefault: async () => {
|
|
113
113
|
try {
|
|
114
|
-
await
|
|
114
|
+
await N({
|
|
115
115
|
user_setting_attributes: {
|
|
116
116
|
default_custom_view: {
|
|
117
117
|
id: Number(e.id),
|
|
118
|
-
type:
|
|
118
|
+
type: d
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
}),
|
|
121
|
+
}), s({
|
|
122
122
|
type: "success",
|
|
123
123
|
text: `'${e.label}' is now your default view`
|
|
124
124
|
}), a(!1);
|
|
125
125
|
} catch {
|
|
126
|
-
|
|
126
|
+
s({
|
|
127
127
|
type: "error",
|
|
128
128
|
text: "Failed to set default view"
|
|
129
129
|
});
|
|
@@ -131,57 +131,57 @@ const ye = (e) => {
|
|
|
131
131
|
},
|
|
132
132
|
openDropdown: () => a(!0),
|
|
133
133
|
closeDropdown: () => a(!1),
|
|
134
|
-
toggleDropdown: () => a(!
|
|
134
|
+
toggleDropdown: () => a(!x)
|
|
135
135
|
},
|
|
136
136
|
create: {
|
|
137
|
-
handleCreate: async (
|
|
137
|
+
handleCreate: async (o) => {
|
|
138
138
|
try {
|
|
139
|
-
const { viewName:
|
|
139
|
+
const { viewName: i, shareOption: S, isDefault: v } = o, C = S === "company" ? n.COMPANY : n.PERSONAL, { arg: _ } = P(), { data: g } = await j({
|
|
140
140
|
attributes: {
|
|
141
|
-
...
|
|
142
|
-
title:
|
|
143
|
-
shared:
|
|
141
|
+
..._,
|
|
142
|
+
title: i,
|
|
143
|
+
shared: C.key === n.COMPANY.key
|
|
144
144
|
}
|
|
145
|
-
}),
|
|
146
|
-
|
|
145
|
+
}), I = t.map(($) => $.id);
|
|
146
|
+
I.push(g.id), await N({
|
|
147
147
|
user_setting_attributes: {
|
|
148
148
|
custom_view_positions: {
|
|
149
|
-
order:
|
|
149
|
+
order: I
|
|
150
150
|
},
|
|
151
|
-
...
|
|
151
|
+
...v ? {
|
|
152
152
|
default_custom_view: {
|
|
153
|
-
id: Number(
|
|
154
|
-
type:
|
|
153
|
+
id: Number(g.id),
|
|
154
|
+
type: d
|
|
155
155
|
}
|
|
156
156
|
} : {}
|
|
157
157
|
}
|
|
158
|
-
}), await
|
|
159
|
-
const U = R({ view:
|
|
160
|
-
|
|
158
|
+
}), await p(), V(e.id);
|
|
159
|
+
const U = R({ view: g, canUpdateCustomViews: F });
|
|
160
|
+
r(U), u(), D(!1), s({
|
|
161
161
|
type: "success",
|
|
162
|
-
text: `New view '${
|
|
162
|
+
text: `New view '${i}' created`
|
|
163
163
|
});
|
|
164
|
-
} catch (
|
|
165
|
-
console.log(
|
|
164
|
+
} catch (i) {
|
|
165
|
+
console.log(i), s({
|
|
166
166
|
type: "error",
|
|
167
167
|
text: "Failed to save draft view"
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
},
|
|
171
|
-
closeCreateDropdown: () =>
|
|
171
|
+
closeCreateDropdown: () => D(!1),
|
|
172
172
|
handleSaveDraft: async () => {
|
|
173
|
-
|
|
173
|
+
D(!0);
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
},
|
|
177
177
|
state: {
|
|
178
|
-
shouldShowDropdown:
|
|
179
|
-
shouldShowEditDropdown:
|
|
178
|
+
shouldShowDropdown: x,
|
|
179
|
+
shouldShowEditDropdown: h,
|
|
180
180
|
shouldShowCreateDropdown: k,
|
|
181
|
-
shouldShowDeleteConfirmation:
|
|
181
|
+
shouldShowDeleteConfirmation: E
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
185
|
export {
|
|
186
|
-
|
|
186
|
+
Ve as useDropdownManager
|
|
187
187
|
};
|
package/dist/index63.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 m=require("react"),q=require("qs"),E=require("./index79.cjs"),I=require("./index65.cjs"),C=require("./index62.cjs"),D=require("./index8.cjs"),F=require("./index61.cjs"),P=t=>t&&t.__esModule?t:{default:t},v=P(q),S=()=>{const{VIEW_TYPE:t,SEARCH_FILTER_ID:l}=D.useBusinessLogic(),{Filters:{activeViewId:g,initFiltersFromView:e,initFromUrl:i,discardChanges:f,updateUrl:L,setFilter:V}}=F.useStores(),{isLoading:_}=I.useCustomViews({type:t}),{viewsMap:s,defaultCustomViewId:w,isLoading:h,viewsArray:n}=C.useViews(),p=h||_;m.useEffect(()=>{if(p)return;const o=v.default.parse(window.location.search,{ignoreQueryPrefix:!0}),d=o.view,a=o[l],r=Object.keys(o).length>0;if(!g){if(d){const u=s.get(d);if(u)e(u),r&&i();else{const c=s.get(w);c&&(e(c),r&&i(!1))}}else{const u=s.get(w);if(u)e(u),f(!0),r&&i();else{const c=s.get(E.ALL_VIEW_ID);c?e(c):n!=null&&n[0]&&e(n[0])}}a&&V(l,a)}},[l,g,w,f,e,i,p,V,L,s,n]),m.useEffect(()=>{const o=()=>{const a=v.default.parse(window.location.search,{ignoreQueryPrefix:!0}).view;if(!a)return;const r=s.get(a);r&&(e(r),i())};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[f,e,i,s])};exports.useViewUrlChange=S;
|