@veeqo/transfigure 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/viewConstants.d.ts +2 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useCreateEmptyDraftView/index.d.ts +1 -0
- package/dist/hooks/useCreateEmptyDraftView/useCreateEmptyDraftView.d.ts +3 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +72 -70
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +48 -19
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +28 -17
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +15 -24
- package/dist/index103.cjs +11 -18
- package/dist/index103.js +12 -20
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +15 -14
- package/dist/index105.cjs +19 -1
- package/dist/index105.js +24 -7
- package/dist/index106.cjs +1 -12
- package/dist/index106.js +21 -16
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +23 -49
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +12 -29
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +1 -1
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +8 -18
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +2 -8
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +17 -59
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +7 -29
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +61 -2
- package/dist/index115.cjs +1 -13
- package/dist/index115.js +30 -17
- package/dist/index116.cjs +13 -1
- package/dist/index116.js +15 -24
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +22 -32
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +36 -5
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +5 -63
- package/dist/index120.cjs +1 -7
- package/dist/index120.js +63 -10
- package/dist/index121.cjs +7 -1
- package/dist/index121.js +10 -47
- package/dist/index122.cjs +1 -0
- package/dist/index122.js +49 -0
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +1 -1
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +3 -3
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +3 -3
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +2 -2
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +3 -3
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -2
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +3 -3
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +3 -3
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +1 -1
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +2 -2
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +1 -1
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +3 -3
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +1 -1
- package/dist/index33.cjs +1 -1
- package/dist/index33.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 +35 -35
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +10 -10
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +40 -37
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +3 -3
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +4 -4
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +1 -1
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +4 -4
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +3 -3
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +3 -3
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +33 -33
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +2 -2
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +10 -23
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +19 -22
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +26 -96
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +97 -8
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +8 -33
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +33 -63
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +59 -19
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +23 -18
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +16 -29
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +30 -60
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +61 -376
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +4 -4
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +372 -53
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +48 -47
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +51 -32
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +40 -24
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +26 -32
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +38 -4
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +4 -13
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +12 -16
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +14 -16
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +18 -65
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +67 -24
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +24 -21
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +19 -6
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +7 -2
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +2 -9
- package/dist/index85.cjs +1 -3
- package/dist/index85.js +8 -13
- package/dist/index86.cjs +3 -1
- package/dist/index86.js +13 -8
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +8 -4
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +39 -115
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +9 -41
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +116 -8
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +5 -13
- package/dist/index93.cjs +1 -104
- package/dist/index93.js +13 -119
- package/dist/index94.cjs +104 -1
- package/dist/index94.js +116 -65
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +63 -23
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +28 -2
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +2 -41
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +39 -9
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +10 -8
- package/dist/mobx/Views/Views.d.ts +1 -0
- package/dist/types.d.ts +4 -7
- package/dist/utils/createEmptyTransformedView/createEmptyTransformedView.d.ts +6 -0
- package/dist/utils/createEmptyTransformedView/createEmptyTransformedView.test.d.ts +1 -0
- package/dist/utils/createEmptyTransformedView/index.d.ts +1 -0
- package/dist/utils/getViewTheme/getViewTheme.d.ts +10 -13
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/viewsAdapter/viewsAdapter.d.ts +1 -1
- package/package.json +1 -1
- package/dist/utils/createAllView/createAllView.d.ts +0 -3
- package/dist/utils/createAllView/index.d.ts +0 -1
- /package/dist/{utils/createAllView/createAllView.test.d.ts → hooks/useCreateEmptyDraftView/useCreateEmptyDraftView.test.d.ts} +0 -0
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("./index105.cjs"),g=require("./index53.cjs"),j=require("./index52.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 "./index105.js";
|
|
3
3
|
import { useModal as k } from "./index53.js";
|
|
4
4
|
import { ModalId as T } from "./index52.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("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),P=require("mobx-react"),g=require("./index64.cjs"),o=require("framer-motion"),m=require("./index63.cjs"),v=require("./index106.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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as f, Fragment as p, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { observer as h } from "mobx-react";
|
|
3
|
-
import { useViews as v } from "./
|
|
3
|
+
import { useViews as v } from "./index64.js";
|
|
4
4
|
import { AnimatePresence as n } from "framer-motion";
|
|
5
|
-
import { useStores as g } from "./
|
|
6
|
-
import { DraftPill as w } from "./
|
|
5
|
+
import { useStores as g } from "./index63.js";
|
|
6
|
+
import { DraftPill as w } from "./index106.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("./index102.cjs"),g=require("./index67.cjs"),S=require("./index64.cjs"),b=require("./index4.cjs"),y=require("./index8.cjs"),V=require("./index63.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,11 +1,11 @@
|
|
|
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 "./
|
|
4
|
-
import { useCustomViews as d } from "./
|
|
5
|
-
import { useViews as g } from "./
|
|
3
|
+
import { LegacySortableViews as w } from "./index102.js";
|
|
4
|
+
import { useCustomViews as d } from "./index67.js";
|
|
5
|
+
import { useViews as g } from "./index64.js";
|
|
6
6
|
import { patchCurrentUser as _ } from "./index4.js";
|
|
7
7
|
import { useBusinessLogic as S } from "./index8.js";
|
|
8
|
-
import { useStores as b } from "./
|
|
8
|
+
import { useStores as b } from "./index63.js";
|
|
9
9
|
import { ErrorBoundary as v } from "./index12.js";
|
|
10
10
|
const T = () => {
|
|
11
11
|
const { VIEW_TYPE: m } = S(), { sortedCustomViews: s, isLoading: a } = g(), { mutate: n } = d({ type: m }), [u, e] = f(s);
|
package/dist/index42.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@veeqo/ui"),c=require("mobx-react"),l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("@veeqo/ui"),c=require("mobx-react"),l=require("./index62.cjs"),n=require("./index109.cjs"),d=i.theme.colors.secondary.blue.base,h=c.observer(({onDiscard:r,viewName:s,onSaveDraft:a})=>{const{saveChanges:o,isSubmitting:t}=l.usePersistUnsavedChanges();return e.jsx(n.Notification,{children:e.jsx(n.Container,{children:e.jsxs(i.Stack,{direction:"horizontal",alignY:"center",children:[e.jsx(i.AttentionIcon,{role:"img","aria-label":"attention",color:d}),e.jsxs(n.Wrap,{children:[e.jsx(n.Text,{variant:"body",margin:"0 4px 0 0",children:"You have unsaved changes to"}),s&&e.jsxs(n.Bold,{variant:"bodyBoldDark",children:["'",s,"'"]})]}),e.jsx(i.Button,{onClick:r,size:"sm",children:"Discard changes"}),e.jsxs(i.ActionMenu,{ctaProps:{children:"Save changes",variant:"primary"},children:[e.jsx(i.ActionMenu.Item,{onAction:a,isDisabled:t,children:e.jsx(n.Text,{variant:"body",children:"Create new view"})}),e.jsx(i.ActionMenu.Item,{onAction:o,isDisabled:t,children:e.jsxs(i.Stack,{direction:"horizontal",spacing:1,alignY:"center",children:[e.jsx(n.Text,{variant:"body",children:"Save changes to"}),e.jsx(n.Text,{variant:"bodyBold",children:s})]})})]})]})})})});exports.UnsavedChangesPill=h;
|
package/dist/index42.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as n, jsxs as e } from "react/jsx-runtime";
|
|
2
2
|
import { Stack as a, AttentionIcon as d, theme as h, Button as m, ActionMenu as o } from "@veeqo/ui";
|
|
3
3
|
import { observer as g } from "mobx-react";
|
|
4
|
-
import { usePersistUnsavedChanges as v } from "./
|
|
4
|
+
import { usePersistUnsavedChanges as v } from "./index62.js";
|
|
5
5
|
import { Notification as b, Container as p, Wrap as u, Text as i, Bold as y } from "./index109.js";
|
|
6
6
|
const C = h.colors.secondary.blue.base, S = g(({ onDiscard: c, viewName: r, onSaveDraft: l }) => {
|
|
7
7
|
const { saveChanges: s, isSubmitting: t } = v();
|
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"),m=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"),m=require("mobx-react"),i=require("@veeqo/ui"),u=require("./index103.cjs"),q=require("./index41.cjs"),f=require("./index64.cjs"),p=require("./index65.cjs"),v=require("./index37.cjs"),c=require("./index36.cjs"),b=require("./index8.cjs"),C=require("./index63.cjs"),a=require("./index12.cjs"),L=m.observer(({className:l,appearance:d})=>{const{IS_VIEWS_READONLY:r}=b.useBusinessLogic(),{Views:{draftViewsList:w}}=C.useStores(),{viewsArray:x,fixedViews:V}=f.useViews(),[n,o]=t.useState(!1),[h,j]=t.useState(null),S=()=>o(!1);return p.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:j,className:l,appearance:d,children:[x.map(s=>e.jsx(a.ErrorBoundary,{children:e.jsx(c.ViewTab,{view:s})},s.id)),w.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:h,placement:"bottom",onShouldClose:()=>o(!1),children:e.jsxs(i.Card.Surface,{children:[e.jsx(u.FixedViews,{children:V.map(s=>e.jsx(i.Text,{variant:"placeholder",children:s.label},s.id||s.label))}),e.jsx(q.SortableViews,{}),e.jsx(u.Divider,{}),e.jsx(v.CreateView,{hideActionsPopover:S})]})})]})});exports.ViewsList=L;
|
package/dist/index44.js
CHANGED
|
@@ -2,14 +2,14 @@ import { jsxs as s, Fragment as V, 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 S, Popover as x, Card as C, Text as L } from "@veeqo/ui";
|
|
5
|
-
import { FixedViews as A, Divider as E } from "./
|
|
5
|
+
import { FixedViews as A, Divider as E } from "./index103.js";
|
|
6
6
|
import { SortableViews as b } from "./index41.js";
|
|
7
|
-
import { useViews as M } from "./
|
|
8
|
-
import { useViewUrlChange as T } from "./
|
|
7
|
+
import { useViews as M } from "./index64.js";
|
|
8
|
+
import { useViewUrlChange as T } from "./index65.js";
|
|
9
9
|
import { CreateView as g } from "./index37.js";
|
|
10
10
|
import { ViewTab as m } from "./index36.js";
|
|
11
11
|
import { useBusinessLogic as R } from "./index8.js";
|
|
12
|
-
import { useStores as j } from "./
|
|
12
|
+
import { useStores as j } from "./index63.js";
|
|
13
13
|
import { ErrorBoundary as l } from "./index12.js";
|
|
14
14
|
const q = v(({ className: a, appearance: d }) => {
|
|
15
15
|
const { IS_VIEWS_READONLY: r } = R(), {
|
package/dist/index46.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),C=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),C=require("./index90.cjs"),i=require("@veeqo/ui"),I=require("mobx-react"),N=require("./index8.cjs"),_=require("./index53.cjs"),j=require("./index63.cjs"),O=require("./index64.cjs"),g=require("./index52.cjs"),w=I.observer(({columnDefinitions:T,pinnedRightColumnIds:a=[],pinnedLeftColumnIds:l=[]})=>{var b;const{DEFAULT_HIDDEN_COLUMNS:E,DEFAULT_VISIBLE_COLUMNS:S}=N.useBusinessLogic(),t=[...l,...a],c=E.filter(s=>!t.includes(s)),r=S.filter(s=>!t.includes(s)),A=[...c,...r],{closeModal:L,isModalOpen:f,openModal:p}=_.useModal(),{Filters:{activeViewId:n},Views:{draftViewsMap:q}}=j.useStores(),{viewsMap:x,isLoading:D}=O.useViews();if(!n||D)return null;const e=x.get(n),u=Array.isArray((b=e==null?void 0:e.columns)==null?void 0:b.columnIds),d=u?e.columns.columnIds.filter(s=>!t.includes(s)):r,h=u?A.filter(s=>!d.includes(s)):c,m=q.has(n),M=!(e!=null&&e.editable),v=M||m,B=m?"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(i.Tooltip,{text:B,children:o.jsx(i.Button,{"aria-label":"Open table management",onClick:()=>p(g.ModalId.ORDERS_TABLE_MANAGEMENT),size:"sm",iconSlot:o.jsx(i.ListBoardIcon,{}),disabled:v})}),f(g.ModalId.ORDERS_TABLE_MANAGEMENT)&&o.jsx(C.TableManagementModal,{pinnedRightColumnIds:a,pinnedLeftColumnIds:l,visibleColumns:d,hiddenColumns:h,columnDefinitions:T,onClose:L})]})});exports.TableManagement=w;
|
package/dist/index46.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as v, Fragment as B, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { TableManagementModal as I } from "./
|
|
2
|
+
import { TableManagementModal as I } from "./index90.js";
|
|
3
3
|
import { Tooltip as O, Button as w, ListBoardIcon as x } from "@veeqo/ui";
|
|
4
4
|
import { observer as F } from "mobx-react";
|
|
5
5
|
import { useBusinessLogic as P } from "./index8.js";
|
|
6
6
|
import { useModal as U } from "./index53.js";
|
|
7
|
-
import { useStores as y } from "./
|
|
8
|
-
import { useViews as R } from "./
|
|
7
|
+
import { useStores as y } from "./index63.js";
|
|
8
|
+
import { useViews as R } from "./index64.js";
|
|
9
9
|
import { ModalId as p } from "./index52.js";
|
|
10
10
|
const Q = F(
|
|
11
11
|
({ columnDefinitions: f, pinnedRightColumnIds: i = [], pinnedLeftColumnIds: l = [] }) => {
|
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("./index88.cjs"),e=require("@veeqo/ui"),o=require("./index89.cjs"),d=require("./index63.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,8 +1,8 @@
|
|
|
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 "./index88.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 "./
|
|
5
|
-
import { useStores as b } from "./
|
|
4
|
+
import t from "./index89.js";
|
|
5
|
+
import { useStores as b } from "./index63.js";
|
|
6
6
|
const j = ({
|
|
7
7
|
isLoading: s,
|
|
8
8
|
refetch: a,
|
package/dist/index57.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),f=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),f=require("./index108.cjs"),Y=require("./index80.cjs"),k=require("./index67.cjs"),G=require("./index58.cjs"),H=require("./index62.cjs"),W=require("./index64.cjs"),r=require("./index45.cjs"),N=require("./index4.cjs"),$=require("./index3.cjs"),B=require("./index8.cjs"),b=require("./index63.cjs"),j=require("./index6.cjs"),z=require("./index5.cjs"),J=e=>{const{VIEW_TYPE:u}=B.useBusinessLogic(),{duplicateView:E}=G.useDuplicateActiveView(),{getActiveViewInAPIFormat:L}=H.usePersistUnsavedChanges(),{canDeleteCustomViews:O,defaultCustomViewId:M,canUpdateCustomViews:x,mutate:F}=k.useCustomViews({type:u}),{mutate:h,viewsMap:d,viewsArray:t}=W.useViews(),[g,a]=w.useState(!1),[A,p]=w.useState(!1),[D,l]=w.useState(!1),[R,S]=w.useState(!1),{Views:{removeDraftViewById:m,draftViewsMap:P},Filters:{initFiltersFromView:n,updateUrl:c,setActiveViewId:V},Notifications:{notify:o}}=b.useStores();return{actions:{delete:{handleDeleteDraftView:()=>{if(!P.has(e.id))throw Error("No draft view found");m(e.id);const s=d.get(M);if(s)s&&n(s);else{const i=d.get(f.ALL_VIEW_ID);i?n(i):t!=null&&t[0]&&n(t[0])}c()},handleDelete:async()=>{try{if(O){await $.deleteCustomView(Number(e.id)),await h();const s=d.get(f.ALL_VIEW_ID);s?n(s):t!=null&&t[0]&&n(t[0]),c(),A&&p(!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(P.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?p(!0):o({type:"info",text:"You require additional user permissions to delete a company shared view"})},closeDeleteConfirmation:()=>p(!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"?r.SHARING_OPTIONS.COMPANY:r.SHARING_OPTIONS.PERSONAL,_={attributes:{title:i,shared:v.key===r.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 F()),await h(),c(),o({type:"success",text:`'${i}' view updated`}),l(!1)}catch{o({type:"error",text:"Failed to save view"})}},handleDuplicate:()=>{E(),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"?r.SHARING_OPTIONS.COMPANY:r.SHARING_OPTIONS.PERSONAL,{arg:_}=L(),{data:I}=await j.createCustomView({attributes:{..._,title:i,shared:v.key===r.SHARING_OPTIONS.COMPANY.key}}),q=t.map(U=>U.id);q.push(I.id),await N.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:q},...y?{default_custom_view:{id:Number(I.id),type:u}}:{}}}),await h(),m(e.id);const T=Y.viewsAdapter({view:I,canUpdateCustomViews:x});n(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:R,shouldShowDeleteConfirmation:A}}};exports.useDropdownManager=J;
|
package/dist/index57.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { useState as w } from "react";
|
|
2
|
-
import { ALL_VIEW_ID as f } from "./
|
|
3
|
-
import { viewsAdapter as R } from "./
|
|
4
|
-
import { useCustomViews as q } from "./
|
|
2
|
+
import { ALL_VIEW_ID as f } from "./index108.js";
|
|
3
|
+
import { viewsAdapter as R } from "./index80.js";
|
|
4
|
+
import { useCustomViews as q } from "./index67.js";
|
|
5
5
|
import { useDuplicateActiveView as B } from "./index58.js";
|
|
6
|
-
import { usePersistUnsavedChanges as T } from "./
|
|
7
|
-
import { useViews as W } from "./
|
|
6
|
+
import { usePersistUnsavedChanges as T } from "./index62.js";
|
|
7
|
+
import { useViews as W } from "./index64.js";
|
|
8
8
|
import { SHARING_OPTIONS as n } from "./index45.js";
|
|
9
|
-
import { patchCurrentUser as
|
|
9
|
+
import { patchCurrentUser as g } from "./index4.js";
|
|
10
10
|
import { deleteCustomView as G } from "./index3.js";
|
|
11
11
|
import { useBusinessLogic as H } from "./index8.js";
|
|
12
|
-
import { useStores as b } from "./
|
|
12
|
+
import { useStores as b } from "./index63.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: d } = H(), { duplicateView:
|
|
15
|
+
const ye = (e) => {
|
|
16
|
+
const { VIEW_TYPE: d } = H(), { duplicateView: P } = B(), { getActiveViewInAPIFormat: M } = T(), {
|
|
17
17
|
canDeleteCustomViews: O,
|
|
18
|
-
defaultCustomViewId:
|
|
19
|
-
canUpdateCustomViews:
|
|
20
|
-
mutate:
|
|
18
|
+
defaultCustomViewId: F,
|
|
19
|
+
canUpdateCustomViews: Y,
|
|
20
|
+
mutate: k
|
|
21
21
|
} = q({
|
|
22
22
|
type: d
|
|
23
|
-
}), { mutate: p, viewsMap: l, viewsArray: t } = W(), [x, a] = w(!1), [E, m] = w(!1), [h, c] = w(!1), [
|
|
24
|
-
Views: { removeDraftViewById:
|
|
25
|
-
Filters: { initFiltersFromView: r, updateUrl: u, setActiveViewId:
|
|
23
|
+
}), { mutate: p, viewsMap: l, viewsArray: t } = W(), [x, a] = w(!1), [E, m] = w(!1), [h, c] = w(!1), [L, D] = w(!1), {
|
|
24
|
+
Views: { removeDraftViewById: y, draftViewsMap: I },
|
|
25
|
+
Filters: { initFiltersFromView: r, updateUrl: u, setActiveViewId: V },
|
|
26
26
|
Notifications: { notify: s }
|
|
27
27
|
} = b();
|
|
28
28
|
return {
|
|
29
29
|
actions: {
|
|
30
30
|
delete: {
|
|
31
31
|
handleDeleteDraftView: () => {
|
|
32
|
-
if (!e.
|
|
33
|
-
|
|
34
|
-
const o = l.get(
|
|
32
|
+
if (!I.has(e.id)) throw Error("No draft view found");
|
|
33
|
+
y(e.id);
|
|
34
|
+
const o = l.get(F);
|
|
35
35
|
if (o)
|
|
36
36
|
o && r(o);
|
|
37
37
|
else {
|
|
@@ -62,8 +62,8 @@ const Ve = (e) => {
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
handleShowDeleteConfirmation: () => {
|
|
65
|
-
if (
|
|
66
|
-
|
|
65
|
+
if (I.has(e.id)) {
|
|
66
|
+
y(e.id), e.originalView ? V(e.originalView.id) : l.has(f) ? V(f) : t != null && t[0] && V(t[0].id);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
O ? m(!0) : s({
|
|
@@ -88,14 +88,14 @@ const Ve = (e) => {
|
|
|
88
88
|
shared: C.key === n.COMPANY.key
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
|
-
await z(e.id, _), v && (await
|
|
91
|
+
await z(e.id, _), v && (await g({
|
|
92
92
|
user_setting_attributes: {
|
|
93
93
|
default_custom_view: {
|
|
94
94
|
id: Number(e.id),
|
|
95
95
|
type: d
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
}), await
|
|
98
|
+
}), await k()), await p(), u(), s({
|
|
99
99
|
type: "success",
|
|
100
100
|
text: `'${i}' view updated`
|
|
101
101
|
}), c(!1);
|
|
@@ -107,11 +107,11 @@ const Ve = (e) => {
|
|
|
107
107
|
}
|
|
108
108
|
},
|
|
109
109
|
handleDuplicate: () => {
|
|
110
|
-
|
|
110
|
+
P(), a(!1);
|
|
111
111
|
},
|
|
112
112
|
handleMakeDefault: async () => {
|
|
113
113
|
try {
|
|
114
|
-
await
|
|
114
|
+
await g({
|
|
115
115
|
user_setting_attributes: {
|
|
116
116
|
default_custom_view: {
|
|
117
117
|
id: Number(e.id),
|
|
@@ -136,27 +136,27 @@ const Ve = (e) => {
|
|
|
136
136
|
create: {
|
|
137
137
|
handleCreate: async (o) => {
|
|
138
138
|
try {
|
|
139
|
-
const { viewName: i, shareOption: S, isDefault: v } = o, C = S === "company" ? n.COMPANY : n.PERSONAL, { arg: _ } =
|
|
139
|
+
const { viewName: i, shareOption: S, isDefault: v } = o, C = S === "company" ? n.COMPANY : n.PERSONAL, { arg: _ } = M(), { data: N } = await j({
|
|
140
140
|
attributes: {
|
|
141
141
|
..._,
|
|
142
142
|
title: i,
|
|
143
143
|
shared: C.key === n.COMPANY.key
|
|
144
144
|
}
|
|
145
|
-
}),
|
|
146
|
-
|
|
145
|
+
}), A = t.map(($) => $.id);
|
|
146
|
+
A.push(N.id), await g({
|
|
147
147
|
user_setting_attributes: {
|
|
148
148
|
custom_view_positions: {
|
|
149
|
-
order:
|
|
149
|
+
order: A
|
|
150
150
|
},
|
|
151
151
|
...v ? {
|
|
152
152
|
default_custom_view: {
|
|
153
|
-
id: Number(
|
|
153
|
+
id: Number(N.id),
|
|
154
154
|
type: d
|
|
155
155
|
}
|
|
156
156
|
} : {}
|
|
157
157
|
}
|
|
158
|
-
}), await p(),
|
|
159
|
-
const U = R({ view:
|
|
158
|
+
}), await p(), y(e.id);
|
|
159
|
+
const U = R({ view: N, canUpdateCustomViews: Y });
|
|
160
160
|
r(U), u(), D(!1), s({
|
|
161
161
|
type: "success",
|
|
162
162
|
text: `New view '${i}' created`
|
|
@@ -177,11 +177,11 @@ const Ve = (e) => {
|
|
|
177
177
|
state: {
|
|
178
178
|
shouldShowDropdown: x,
|
|
179
179
|
shouldShowEditDropdown: h,
|
|
180
|
-
shouldShowCreateDropdown:
|
|
180
|
+
shouldShowCreateDropdown: L,
|
|
181
181
|
shouldShowDeleteConfirmation: E
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
185
|
export {
|
|
186
|
-
|
|
186
|
+
ye as useDropdownManager
|
|
187
187
|
};
|
package/dist/index58.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index64.cjs"),u=require("./index63.cjs"),c=()=>{const{viewsMap:r}=a.useViews(),{Filters:{activeViewId:i,initFiltersFromView:s,updateUrl:w},Views:{addDraftView:o,draftViewsMap:n}}=u.useStores();return{duplicateView:()=>{if(!i)throw Error("Creating views from all is not supported...implement me");if(r.has(i)){const e=r.get(i);if(!e)throw Error("Could not find view in viewsMap");const t=o({...e});s(t)}else{const e=n.get(i);if(!e)throw Error("Could not find view in draftViewsMap");const t=o({...e});s(t)}w()}}};exports.useDuplicateActiveView=c;
|
package/dist/index58.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useViews as a } from "./
|
|
2
|
-
import { useStores as f } from "./
|
|
1
|
+
import { useViews as a } from "./index64.js";
|
|
2
|
+
import { useStores as f } from "./index63.js";
|
|
3
3
|
const d = () => {
|
|
4
4
|
const { viewsMap: r } = a(), {
|
|
5
5
|
Filters: { activeViewId: i, initFiltersFromView: o, updateUrl: s },
|
package/dist/index59.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 s=require("./index63.cjs"),a=()=>{const{Filters:{initFiltersFromView:e,updateUrl:t},Views:{addEmptyDraftView:r}}=s.useStores();return{createEmptyDraftView:()=>{const i=r();e(i),t()}}};exports.useCreateEmptyDraftView=a;
|
package/dist/index59.js
CHANGED
|
@@ -1,27 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { getFetcherFunction as p } from "./index77.js";
|
|
4
|
-
import l from "swr/immutable";
|
|
5
|
-
import { useStores as f } from "./index62.js";
|
|
6
|
-
const a = ({ filterData: e }) => {
|
|
7
|
-
var s;
|
|
1
|
+
import { useStores as s } from "./index63.js";
|
|
2
|
+
const w = () => {
|
|
8
3
|
const {
|
|
9
|
-
Filters: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
})(e.fetchAsyncFilterOptions.URL);
|
|
17
|
-
},
|
|
18
|
-
{ revalidateOnFocus: !1 }
|
|
19
|
-
);
|
|
20
|
-
return { filterLabel: i(() => {
|
|
21
|
-
const r = n ? m({ data: n, config: e.fetchAsyncFilterOptions }) : e.options;
|
|
22
|
-
return (r == null ? void 0 : r.filter((t) => o == null ? void 0 : o.includes(t.value.toString())).map((t) => t.label).join(", ")) || "";
|
|
23
|
-
}, [n, e.options, o, e.fetchAsyncFilterOptions]) };
|
|
4
|
+
Filters: { initFiltersFromView: t, updateUrl: e },
|
|
5
|
+
Views: { addEmptyDraftView: r }
|
|
6
|
+
} = s();
|
|
7
|
+
return { createEmptyDraftView: () => {
|
|
8
|
+
const i = r();
|
|
9
|
+
t(i), e();
|
|
10
|
+
} };
|
|
24
11
|
};
|
|
25
12
|
export {
|
|
26
|
-
|
|
13
|
+
w as useCreateEmptyDraftView
|
|
27
14
|
};
|
package/dist/index60.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),u=require("./index77.cjs"),l=require("./index78.cjs"),a=require("swr/immutable"),F=require("./index63.cjs"),y=e=>e&&e.__esModule?e:{default:e},d=y(a),f=({filterData:e})=>{var c;const{Filters:{arrayFilters:o}}=F.useStores(),s=o.get(e.id),{data:r}=d.default((c=e.fetchAsyncFilterOptions)==null?void 0:c.URL,()=>{var t;return l.getFetcherFunction({fetcherName:(t=e.fetchAsyncFilterOptions)==null?void 0:t.fetcher})(e.fetchAsyncFilterOptions.URL)},{revalidateOnFocus:!1});return{filterLabel:i.useMemo(()=>{const n=r?u.getAsyncOptions({data:r,config:e.fetchAsyncFilterOptions}):e.options;return(n==null?void 0:n.filter(t=>s==null?void 0:s.includes(t.value.toString())).map(t=>t.label).join(", "))||""},[r,e.options,s,e.fetchAsyncFilterOptions])}};exports.useFilterArrayLabel=f;
|
package/dist/index60.js
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { getAsyncOptions as m } from "./
|
|
3
|
-
import { getFetcherFunction as
|
|
4
|
-
import
|
|
5
|
-
import { useStores as
|
|
6
|
-
const
|
|
7
|
-
var
|
|
1
|
+
import { useMemo as i } from "react";
|
|
2
|
+
import { getAsyncOptions as m } from "./index77.js";
|
|
3
|
+
import { getFetcherFunction as p } from "./index78.js";
|
|
4
|
+
import l from "swr/immutable";
|
|
5
|
+
import { useStores as f } from "./index63.js";
|
|
6
|
+
const a = ({ filterData: e }) => {
|
|
7
|
+
var s;
|
|
8
8
|
const {
|
|
9
|
-
Filters: {
|
|
10
|
-
} =
|
|
11
|
-
(
|
|
9
|
+
Filters: { arrayFilters: c }
|
|
10
|
+
} = f(), o = c.get(e.id), { data: n } = l(
|
|
11
|
+
(s = e.fetchAsyncFilterOptions) == null ? void 0 : s.URL,
|
|
12
12
|
() => {
|
|
13
|
-
var
|
|
14
|
-
return
|
|
15
|
-
fetcherName: (
|
|
16
|
-
})(
|
|
13
|
+
var t;
|
|
14
|
+
return p({
|
|
15
|
+
fetcherName: (t = e.fetchAsyncFilterOptions) == null ? void 0 : t.fetcher
|
|
16
|
+
})(e.fetchAsyncFilterOptions.URL);
|
|
17
17
|
},
|
|
18
18
|
{ revalidateOnFocus: !1 }
|
|
19
19
|
);
|
|
20
|
-
return { filterLabel:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const n = s ? m({ data: s, config: t.fetchAsyncFilterOptions }) : t.options;
|
|
25
|
-
return ((o = n == null ? void 0 : n.find((i) => i.value.toString() === (e == null ? void 0 : e.toString()))) == null ? void 0 : o.label) || "";
|
|
26
|
-
}, [s, t.options, e, t.fetchAsyncFilterOptions]) };
|
|
20
|
+
return { filterLabel: i(() => {
|
|
21
|
+
const r = n ? m({ data: n, config: e.fetchAsyncFilterOptions }) : e.options;
|
|
22
|
+
return (r == null ? void 0 : r.filter((t) => o == null ? void 0 : o.includes(t.value.toString())).map((t) => t.label).join(", ")) || "";
|
|
23
|
+
}, [n, e.options, o, e.fetchAsyncFilterOptions]) };
|
|
27
24
|
};
|
|
28
25
|
export {
|
|
29
|
-
|
|
26
|
+
a as useFilterArrayLabel
|
|
30
27
|
};
|
package/dist/index61.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 u=require("react"),l=require("./index77.cjs"),F=require("./index78.cjs"),f=require("swr/immutable"),h=require("./index63.cjs"),p=e=>e&&e.__esModule?e:{default:e},d=p(f),y=({filterData:e})=>{var o;const{Filters:{filters:r}}=h.useStores(),t=r.get(e.id),{data:c}=d.default((o=e.fetchAsyncFilterOptions)==null?void 0:o.URL,()=>{var n;return F.getFetcherFunction({fetcherName:(n=e.fetchAsyncFilterOptions)==null?void 0:n.fetcher})(e.fetchAsyncFilterOptions.URL)},{revalidateOnFocus:!1});return{filterLabel:u.useMemo(()=>{var n;if(!e.options&&!e.fetchAsyncFilterOptions)return t;const s=c?l.getAsyncOptions({data:c,config:e.fetchAsyncFilterOptions}):e.options;return((n=s==null?void 0:s.find(i=>i.value.toString()===(t==null?void 0:t.toString())))==null?void 0:n.label)||""},[c,e.options,t,e.fetchAsyncFilterOptions])}};exports.useFilterLabel=y;
|
package/dist/index61.js
CHANGED
|
@@ -1,100 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
initFiltersFromView: A,
|
|
18
|
-
pageSize: l
|
|
1
|
+
import { useMemo as p } from "react";
|
|
2
|
+
import { getAsyncOptions as m } from "./index77.js";
|
|
3
|
+
import { getFetcherFunction as f } from "./index78.js";
|
|
4
|
+
import h from "swr/immutable";
|
|
5
|
+
import { useStores as u } from "./index63.js";
|
|
6
|
+
const b = ({ filterData: t }) => {
|
|
7
|
+
var c;
|
|
8
|
+
const {
|
|
9
|
+
Filters: { filters: r }
|
|
10
|
+
} = u(), e = r.get(t.id), { data: s } = h(
|
|
11
|
+
(c = t.fetchAsyncFilterOptions) == null ? void 0 : c.URL,
|
|
12
|
+
() => {
|
|
13
|
+
var o;
|
|
14
|
+
return f({
|
|
15
|
+
fetcherName: (o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher
|
|
16
|
+
})(t.fetchAsyncFilterOptions.URL);
|
|
19
17
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (!
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
r[e] = t;
|
|
30
|
-
}), Array.from(d.entries()).filter(([, e]) => e.filterType !== void 0).forEach(([e, t]) => {
|
|
31
|
-
t.filterType === "CUSTOM" ? r[e] = {
|
|
32
|
-
gte: t.gte.toString(),
|
|
33
|
-
lte: t.lte.toString()
|
|
34
|
-
} : r[e] = t.filterType;
|
|
35
|
-
}), Array.from(E.entries()).filter(([, e]) => e.gte !== void 0 || e.lte !== void 0).forEach(([e, t]) => {
|
|
36
|
-
r[e] = {}, t.gte !== void 0 && (r[e].gte = t.gte.toString()), t.isValidLte && t.lte && (r[e].lte = t.lte.toString());
|
|
37
|
-
});
|
|
38
|
-
let s = n.get(o);
|
|
39
|
-
return n.has(o) || (s = S.get(o)), { arg: {
|
|
40
|
-
type: y,
|
|
41
|
-
filters: {
|
|
42
|
-
filter: r,
|
|
43
|
-
sort: f,
|
|
44
|
-
page: {
|
|
45
|
-
size: Number(l)
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
title: s == null ? void 0 : s.label
|
|
49
|
-
}, currentView: s };
|
|
50
|
-
};
|
|
51
|
-
return {
|
|
52
|
-
getActiveViewInAPIFormat: m,
|
|
53
|
-
saveChanges: async () => {
|
|
54
|
-
if (o)
|
|
55
|
-
try {
|
|
56
|
-
c(!0);
|
|
57
|
-
const { arg: r, currentView: s } = m();
|
|
58
|
-
await O(o, { attributes: r }), await T();
|
|
59
|
-
const p = {
|
|
60
|
-
...s,
|
|
61
|
-
filterMaps: {
|
|
62
|
-
filters: new Map(
|
|
63
|
-
Object.entries(r.filters.filter).filter(
|
|
64
|
-
([e, t]) => !Array.isArray(t) && typeof t == "string" && !a.includes(e)
|
|
65
|
-
).map(([e, t]) => [e, t])
|
|
66
|
-
),
|
|
67
|
-
arrayFilters: new Map(
|
|
68
|
-
Object.entries(r.filters.filter).filter(([, e]) => Array.isArray(e)).map(([e, t]) => [e, t])
|
|
69
|
-
),
|
|
70
|
-
rangeFilters: new Map(
|
|
71
|
-
Object.entries(r.filters.filter).filter(([e]) => a.includes(e)).map(([e, t]) => {
|
|
72
|
-
const i = new V();
|
|
73
|
-
return typeof t == "object" ? (i.setFilterType("CUSTOM"), i.setDates(g(t.gte), g(t.lte))) : i.setFilterType(t), [e, i];
|
|
74
|
-
})
|
|
75
|
-
),
|
|
76
|
-
numberRangeFilters: new Map(
|
|
77
|
-
Object.entries(r.filters.filter).filter(([e]) => u.includes(e)).map(([e, t]) => {
|
|
78
|
-
const i = new M({ filterId: e });
|
|
79
|
-
return t.gte && i.setGte(Number(t.gte)), t.lte && i.setLte(Number(t.lte)), [e, i];
|
|
80
|
-
})
|
|
81
|
-
)
|
|
82
|
-
},
|
|
83
|
-
page: {
|
|
84
|
-
size: l
|
|
85
|
-
},
|
|
86
|
-
sort: f
|
|
87
|
-
};
|
|
88
|
-
A(p);
|
|
89
|
-
} catch (r) {
|
|
90
|
-
console.log(r), h({ type: "error", text: "Failed to save changes to your view" });
|
|
91
|
-
} finally {
|
|
92
|
-
c(!1);
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
isSubmitting: R
|
|
96
|
-
};
|
|
18
|
+
{ revalidateOnFocus: !1 }
|
|
19
|
+
);
|
|
20
|
+
return { filterLabel: p(() => {
|
|
21
|
+
var o;
|
|
22
|
+
if (!t.options && !t.fetchAsyncFilterOptions)
|
|
23
|
+
return e;
|
|
24
|
+
const n = s ? m({ data: s, config: t.fetchAsyncFilterOptions }) : t.options;
|
|
25
|
+
return ((o = n == null ? void 0 : n.find((i) => i.value.toString() === (e == null ? void 0 : e.toString()))) == null ? void 0 : o.label) || "";
|
|
26
|
+
}, [s, t.options, e, t.fetchAsyncFilterOptions]) };
|
|
97
27
|
};
|
|
98
28
|
export {
|
|
99
|
-
|
|
29
|
+
b as useFilterLabel
|
|
100
30
|
};
|
package/dist/index62.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 V=require("react"),p=require("@internationalized/date"),M=require("./index71.cjs"),I=require("./index72.cjs"),N=require("./index64.cjs"),v=require("./index8.cjs"),C=require("./index63.cjs"),q=require("./index5.cjs"),O=()=>{const{DATE_RANGE_FILTERS:n,NUMBER_RANGE_FILTERS:m,SEARCH_FILTER_ID:w,VIEW_TYPE:y}=v.useBusinessLogic(),{Filters:{activeViewId:a,filters:F,arrayFilters:b,dateRangeFilters:d,numberRangeFilters:S,initFiltersFromView:h,pageSize:o},Table:{sortParam:l},Views:{draftViewsMap:E},Notifications:{notify:A}}=C.useStores(),{viewsMap:f,mutate:R}=N.useViews(),[T,c]=V.useState(!1),u=()=>{if(!a)throw Error("No active view");const r={};Array.from(F.entries()).filter(([e,t])=>t!==""&&e!==w).forEach(([e,t])=>{r[e]=t}),Array.from(b.entries()).filter(([,e])=>e.length>0).forEach(([e,t])=>{r[e]=t}),Array.from(d.entries()).filter(([,e])=>e.filterType!==void 0).forEach(([e,t])=>{t.filterType==="CUSTOM"?r[e]={gte:t.gte.toString(),lte:t.lte.toString()}:r[e]=t.filterType}),Array.from(S.entries()).filter(([,e])=>e.gte!==void 0||e.lte!==void 0).forEach(([e,t])=>{r[e]={},t.gte!==void 0&&(r[e].gte=t.gte.toString()),t.isValidLte&&t.lte&&(r[e].lte=t.lte.toString())});let s=f.get(a);return f.has(a)||(s=E.get(a)),{arg:{type:y,filters:{filter:r,sort:l,page:{size:Number(o)}},title:s==null?void 0:s.label},currentView:s}};return{getActiveViewInAPIFormat:u,saveChanges:async()=>{if(a)try{c(!0);const{arg:r,currentView:s}=u();await q.patchCustomView(a,{attributes:r}),await R();const g={...s,filterMaps:{filters:new Map(Object.entries(r.filters.filter).filter(([e,t])=>!Array.isArray(t)&&typeof t=="string"&&!n.includes(e)).map(([e,t])=>[e,t])),arrayFilters:new Map(Object.entries(r.filters.filter).filter(([,e])=>Array.isArray(e)).map(([e,t])=>[e,t])),rangeFilters:new Map(Object.entries(r.filters.filter).filter(([e])=>n.includes(e)).map(([e,t])=>{const i=new I.RangeFilter;return typeof t=="object"?(i.setFilterType("CUSTOM"),i.setDates(p.parseDate(t.gte),p.parseDate(t.lte))):i.setFilterType(t),[e,i]})),numberRangeFilters:new Map(Object.entries(r.filters.filter).filter(([e])=>m.includes(e)).map(([e,t])=>{const i=new M.NumberRangeFilter({filterId:e});return t.gte&&i.setGte(Number(t.gte)),t.lte&&i.setLte(Number(t.lte)),[e,i]}))},page:{size:o},sort:l};h(g)}catch(r){console.log(r),A({type:"error",text:"Failed to save changes to your view"})}finally{c(!1)}},isSubmitting:T}};exports.usePersistUnsavedChanges=O;
|