@veeqo/transfigure 2.1.1 → 2.1.3
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/helpGuideUrls.d.ts +3 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +81 -79
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +10 -23
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +24 -15
- package/dist/index102.cjs +19 -1
- package/dist/index102.js +24 -21
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +3 -3
- package/dist/index105.cjs +1 -12
- package/dist/index105.js +15 -16
- package/dist/index106.cjs +11 -18
- package/dist/index106.js +12 -20
- package/dist/index107.cjs +1 -80
- package/dist/index107.js +21 -98
- package/dist/index108.cjs +80 -1
- package/dist/index108.js +98 -2
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +2 -19
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +18 -7
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +7 -63
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +57 -26
- package/dist/index113.cjs +1 -13
- package/dist/index113.js +30 -17
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +32 -22
- package/dist/index115.cjs +13 -1
- package/dist/index115.js +14 -33
- package/dist/index116.cjs +1 -7
- package/dist/index116.js +26 -10
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +58 -42
- package/dist/index119.cjs +7 -1
- package/dist/index119.js +10 -63
- package/dist/index120.cjs +1 -0
- package/dist/index120.js +49 -0
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +2 -2
- 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 +2 -2
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +2 -2
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +4 -4
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +2 -2
- 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 +3 -3
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +4 -4
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +4 -4
- 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/index3.cjs +1 -1
- package/dist/index3.js +2 -2
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +3 -3
- 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/index35.cjs +1 -1
- package/dist/index35.js +1 -1
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +4 -4
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +1 -1
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +1 -1
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +3 -3
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +2 -2
- 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 +2 -2
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +4 -4
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +5 -5
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +3 -3
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +4 -9
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +2 -2
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +9 -23
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +23 -2
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +2 -4
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +4 -11
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +10 -12
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +12 -11
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +11 -184
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +183 -25
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +26 -24
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +19 -22
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +2 -2
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +25 -97
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +99 -8
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +8 -33
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +33 -63
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +59 -19
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +23 -18
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +16 -29
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +30 -59
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +60 -349
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +345 -55
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +4 -4
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +48 -47
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +51 -32
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +30 -24
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +26 -32
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +38 -4
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +4 -13
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +12 -16
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +14 -16
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +18 -65
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +66 -24
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +24 -21
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +20 -6
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +7 -2
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +2 -9
- package/dist/index84.cjs +1 -3
- package/dist/index84.js +8 -13
- package/dist/index85.cjs +3 -1
- package/dist/index85.js +13 -8
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +9 -2
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +115 -39
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +2 -9
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +39 -114
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +8 -6
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +7 -13
- package/dist/index94.cjs +1 -104
- package/dist/index94.js +13 -119
- package/dist/index95.cjs +104 -1
- package/dist/index95.js +116 -65
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +63 -23
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +28 -2
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +2 -41
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +39 -9
- package/package.json +1 -1
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("./index88.cjs"),i=require("@veeqo/ui"),I=require("mobx-react"),N=require("./index8.cjs"),_=require("./index53.cjs"),j=require("./index62.cjs"),O=require("./index63.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,12 +1,12 @@
|
|
|
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 "./index88.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
|
-
import { useModal as U } from "./
|
|
7
|
-
import { useStores as y } from "./
|
|
8
|
-
import { useViews as R } from "./
|
|
9
|
-
import { ModalId as p } from "./
|
|
6
|
+
import { useModal as U } from "./index53.js";
|
|
7
|
+
import { useStores as y } from "./index62.js";
|
|
8
|
+
import { useViews as R } from "./index63.js";
|
|
9
|
+
import { ModalId as p } from "./index52.js";
|
|
10
10
|
const Q = F(
|
|
11
11
|
({ columnDefinitions: f, pinnedRightColumnIds: i = [], pinnedLeftColumnIds: l = [] }) => {
|
|
12
12
|
var M;
|
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("./index90.cjs"),e=require("@veeqo/ui"),o=require("./index91.cjs"),d=require("./index62.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 "./index90.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 "./index91.js";
|
|
5
|
+
import { useStores as b } from "./index62.js";
|
|
6
6
|
const j = ({
|
|
7
7
|
isLoading: s,
|
|
8
8
|
refetch: a,
|
package/dist/index49.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://help.veeqo.com",t=`${e}/en/articles/`,_={ORDER_VIEWS_AND_TABLE_CUSTOMIZATION:`${t}3802856`};exports.helpGuideUrls=_;
|
package/dist/index49.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
revalidateOnReconnect: !1,
|
|
5
|
-
keepPreviousData: !0
|
|
6
|
-
}, r = "Please enter at least 3 characters";
|
|
1
|
+
const _ = "https://help.veeqo.com", E = `${_}/en/articles/`, e = {
|
|
2
|
+
ORDER_VIEWS_AND_TABLE_CUSTOMIZATION: `${E}3802856`
|
|
3
|
+
};
|
|
7
4
|
export {
|
|
8
|
-
e as
|
|
9
|
-
r as MIN_SEARCH_ERROR_MESSAGE,
|
|
10
|
-
n as SWR_HOOK_OPTIONS
|
|
5
|
+
e as helpGuideUrls
|
|
11
6
|
};
|
package/dist/index5.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index7.cjs"),i=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index7.cjs"),i=require("./index54.cjs"),o=require("./index55.cjs"),a=(t,{attributes:e})=>s.axios.patch(`/api/v2/custom_views/${t}`,{data:{attributes:e,type:"custom_view"}},i.withCSRF(o.vndAPI));exports.patchCustomView=a;
|
package/dist/index5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { axios as i } from "./index7.js";
|
|
2
|
-
import { withCSRF as m } from "./
|
|
3
|
-
import { vndAPI as p } from "./
|
|
2
|
+
import { withCSRF as m } from "./index54.js";
|
|
3
|
+
import { vndAPI as p } from "./index55.js";
|
|
4
4
|
const c = (t, { attributes: o }) => i.patch(`/api/v2/custom_views/${t}`, { data: { attributes: o, type: "custom_view" } }, m(p));
|
|
5
5
|
export {
|
|
6
6
|
c as patchCustomView
|
package/dist/index50.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=(e=>(e.TEXT="text",e.NUMBER="number",e.CHECKBOX="checkbox",e.RADIO="radio",e.DATE_RANGE="date_range",e.NUMBER_RANGE="number_range",e))(t||{});const a={revalidateOnFocus:!1,revalidateOnReconnect:!1,keepPreviousData:!0},R="Please enter at least 3 characters";exports.FilterChoiceValue=t;exports.MIN_SEARCH_ERROR_MESSAGE=R;exports.SWR_HOOK_OPTIONS=a;
|
package/dist/index50.js
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
), t = n(() => {
|
|
8
|
-
a(null);
|
|
9
|
-
}, []), l = n((o) => {
|
|
10
|
-
a(o);
|
|
11
|
-
}, []), c = n(
|
|
12
|
-
(o) => {
|
|
13
|
-
e(o) ? t() : l(o);
|
|
14
|
-
},
|
|
15
|
-
[t, e, l]
|
|
16
|
-
), M = u(
|
|
17
|
-
() => ({ closeModal: t, isModalOpen: e, openModal: l, toggleModal: c }),
|
|
18
|
-
[t, e, l, c]
|
|
19
|
-
);
|
|
20
|
-
return /* @__PURE__ */ d(v.Provider, { value: M, children: r });
|
|
21
|
-
};
|
|
1
|
+
var e = /* @__PURE__ */ ((a) => (a.TEXT = "text", a.NUMBER = "number", a.CHECKBOX = "checkbox", a.RADIO = "radio", a.DATE_RANGE = "date_range", a.NUMBER_RANGE = "number_range", a))(e || {});
|
|
2
|
+
const n = {
|
|
3
|
+
revalidateOnFocus: !1,
|
|
4
|
+
revalidateOnReconnect: !1,
|
|
5
|
+
keepPreviousData: !0
|
|
6
|
+
}, r = "Please enter at least 3 characters";
|
|
22
7
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
e as FilterChoiceValue,
|
|
9
|
+
r as MIN_SEARCH_ERROR_MESSAGE,
|
|
10
|
+
n as SWR_HOOK_OPTIONS
|
|
25
11
|
};
|
package/dist/index51.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),e=require("react"),r=e.createContext(null),M=({children:u})=>{const[s,n]=e.useState(null),t=e.useCallback(o=>o===s,[s]),l=e.useCallback(()=>{n(null)},[]),a=e.useCallback(o=>{n(o)},[]),c=e.useCallback(o=>{t(o)?l():a(o)},[l,t,a]),d=e.useMemo(()=>({closeModal:l,isModalOpen:t,openModal:a,toggleModal:c}),[l,t,a,c]);return i.jsx(r.Provider,{value:d,children:u})};exports.ModalContext=r;exports.ModalProvider=M;
|
package/dist/index51.js
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as i, useCallback as n, useMemo as u, createContext as p } from "react";
|
|
3
|
+
const v = p(null), f = ({ children: r }) => {
|
|
4
|
+
const [s, a] = i(null), e = n(
|
|
5
|
+
(o) => o === s,
|
|
6
|
+
[s]
|
|
7
|
+
), t = n(() => {
|
|
8
|
+
a(null);
|
|
9
|
+
}, []), l = n((o) => {
|
|
10
|
+
a(o);
|
|
11
|
+
}, []), c = n(
|
|
12
|
+
(o) => {
|
|
13
|
+
e(o) ? t() : l(o);
|
|
14
|
+
},
|
|
15
|
+
[t, e, l]
|
|
16
|
+
), M = u(
|
|
17
|
+
() => ({ closeModal: t, isModalOpen: e, openModal: l, toggleModal: c }),
|
|
18
|
+
[t, e, l, c]
|
|
19
|
+
);
|
|
20
|
+
return /* @__PURE__ */ d(v.Provider, { value: M, children: r });
|
|
21
|
+
};
|
|
2
22
|
export {
|
|
3
|
-
|
|
23
|
+
v as ModalContext,
|
|
24
|
+
f as ModalProvider
|
|
4
25
|
};
|
package/dist/index52.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var E=(e=>(e.ORDERS_TABLE_MANAGEMENT="ORDERS_TABLE_MANAGEMENT",e))(E||{});exports.ModalId=E;
|
package/dist/index52.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { ModalContext as t } from "./index50.js";
|
|
3
|
-
const m = () => o(t);
|
|
1
|
+
var A = /* @__PURE__ */ ((E) => (E.ORDERS_TABLE_MANAGEMENT = "ORDERS_TABLE_MANAGEMENT", E))(A || {});
|
|
4
2
|
export {
|
|
5
|
-
|
|
3
|
+
A as ModalId
|
|
6
4
|
};
|
package/dist/index53.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index51.cjs"),o=()=>e.useContext(t.ModalContext);exports.useModal=o;
|
package/dist/index53.js
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
...t,
|
|
5
|
-
headers: {
|
|
6
|
-
...n,
|
|
7
|
-
"x-csrf-token": o
|
|
8
|
-
}
|
|
9
|
-
} : t;
|
|
10
|
-
};
|
|
1
|
+
import { useContext as o } from "react";
|
|
2
|
+
import { ModalContext as t } from "./index51.js";
|
|
3
|
+
const m = () => o(t);
|
|
11
4
|
export {
|
|
12
|
-
|
|
5
|
+
m as useModal
|
|
13
6
|
};
|
package/dist/index54.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 c=(t={})=>{const{headers:r={}}=t,e=document.querySelector('meta[name="csrf-token"]'),n=e?e.content:null,o=window.localStorage.csrf||n;return o?{...t,headers:{...r,"x-csrf-token":o}}:t};exports.withCSRF=c;
|
package/dist/index54.js
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
headers: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
1
|
+
const a = (t = {}) => {
|
|
2
|
+
const { headers: n = {} } = t, e = document.querySelector('meta[name="csrf-token"]'), r = e ? e.content : null, o = window.localStorage.csrf || r;
|
|
3
|
+
return o ? {
|
|
4
|
+
...t,
|
|
5
|
+
headers: {
|
|
6
|
+
...n,
|
|
7
|
+
"x-csrf-token": o
|
|
8
|
+
}
|
|
9
|
+
} : t;
|
|
11
10
|
};
|
|
12
11
|
export {
|
|
13
|
-
|
|
14
|
-
p as vndAPI
|
|
12
|
+
a as withCSRF
|
|
15
13
|
};
|
package/dist/index55.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 n={headers:{Accept:"application/json","Content-Type":"application/json"}},o={headers:{"Content-Type":"application/vnd.api+json",Accept:"application/vnd.api+json"}};exports.onlyJSON=n;exports.vndAPI=o;
|
package/dist/index55.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
const n = {
|
|
2
|
+
headers: {
|
|
3
|
+
Accept: "application/json",
|
|
4
|
+
"Content-Type": "application/json"
|
|
5
|
+
}
|
|
6
|
+
}, p = {
|
|
7
|
+
headers: {
|
|
8
|
+
"Content-Type": "application/vnd.api+json",
|
|
9
|
+
Accept: "application/vnd.api+json"
|
|
10
|
+
}
|
|
10
11
|
};
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
n as onlyJSON,
|
|
14
|
+
p as vndAPI
|
|
14
15
|
};
|
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 d=require("kitsu-core"),a=require("./index54.cjs"),n=require("./index55.cjs"),i=require("./index7.cjs"),f=async e=>(await i.axios.get(e,a.withCSRF(n.onlyJSON))).data,l=async(e,t={})=>{const{serialize:o=!0,includeMeta:c=!1}=t,r=await i.axios.get(e,a.withCSRF(n.vndAPI));if(!o)return r.data;const{data:s,meta:u}=d.deserialise(r.data);return c?{data:s,meta:u}:s};exports.fetcherV1=f;exports.fetcherV2=l;
|
package/dist/index56.js
CHANGED
|
@@ -1,187 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { deleteCustomView as G } from "./index3.js";
|
|
11
|
-
import { useBusinessLogic as H } from "./index8.js";
|
|
12
|
-
import { useStores as b } from "./index61.js";
|
|
13
|
-
import { createCustomView as j } from "./index6.js";
|
|
14
|
-
import { patchCustomView as z } from "./index5.js";
|
|
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
|
-
} = q({
|
|
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
|
-
} = b();
|
|
28
|
-
return {
|
|
29
|
-
actions: {
|
|
30
|
-
delete: {
|
|
31
|
-
handleDeleteDraftView: () => {
|
|
32
|
-
if (!e.originalView) throw Error("No draft view found");
|
|
33
|
-
V(e.id);
|
|
34
|
-
const o = l.get(M);
|
|
35
|
-
if (o)
|
|
36
|
-
o && r(o);
|
|
37
|
-
else {
|
|
38
|
-
const i = l.get(f);
|
|
39
|
-
i ? r(i) : t != null && t[0] && r(t[0]);
|
|
40
|
-
}
|
|
41
|
-
u();
|
|
42
|
-
},
|
|
43
|
-
handleDelete: async () => {
|
|
44
|
-
try {
|
|
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
|
-
type: "success",
|
|
50
|
-
text: `'${e.label}' has been deleted`
|
|
51
|
-
});
|
|
52
|
-
} else
|
|
53
|
-
s({
|
|
54
|
-
type: "info",
|
|
55
|
-
text: "You require additional user permissions to delete a company shared view"
|
|
56
|
-
});
|
|
57
|
-
} catch {
|
|
58
|
-
s({
|
|
59
|
-
type: "error",
|
|
60
|
-
text: "Failed to delete view"
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
handleShowDeleteConfirmation: () => {
|
|
65
|
-
if (L.has(e.id)) {
|
|
66
|
-
V(e.id), e.originalView ? y(e.originalView.id) : l.has(f) ? y(f) : t != null && t[0] && y(t[0].id);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
O ? m(!0) : s({
|
|
70
|
-
type: "info",
|
|
71
|
-
text: "You require additional user permissions to delete a company shared view"
|
|
72
|
-
});
|
|
73
|
-
},
|
|
74
|
-
closeDeleteConfirmation: () => m(!1)
|
|
75
|
-
},
|
|
76
|
-
edit: {
|
|
77
|
-
handleShowEditDropdown: () => {
|
|
78
|
-
a(!1), c(!0);
|
|
79
|
-
},
|
|
80
|
-
closeEditDropdown: () => c(!1)
|
|
81
|
-
},
|
|
82
|
-
menu: {
|
|
83
|
-
handleSave: async (o) => {
|
|
84
|
-
try {
|
|
85
|
-
const { viewName: i, shareOption: S, isDefault: v } = o, C = S === "company" ? n.COMPANY : n.PERSONAL, _ = {
|
|
86
|
-
attributes: {
|
|
87
|
-
title: i,
|
|
88
|
-
shared: C.key === n.COMPANY.key
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
await z(e.id, _), v && (await N({
|
|
92
|
-
user_setting_attributes: {
|
|
93
|
-
default_custom_view: {
|
|
94
|
-
id: Number(e.id),
|
|
95
|
-
type: d
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}), await Y()), await p(), u(), s({
|
|
99
|
-
type: "success",
|
|
100
|
-
text: `'${i}' view updated`
|
|
101
|
-
}), c(!1);
|
|
102
|
-
} catch {
|
|
103
|
-
s({
|
|
104
|
-
type: "error",
|
|
105
|
-
text: "Failed to save view"
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
handleDuplicate: () => {
|
|
110
|
-
A(), a(!1);
|
|
111
|
-
},
|
|
112
|
-
handleMakeDefault: async () => {
|
|
113
|
-
try {
|
|
114
|
-
await N({
|
|
115
|
-
user_setting_attributes: {
|
|
116
|
-
default_custom_view: {
|
|
117
|
-
id: Number(e.id),
|
|
118
|
-
type: d
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}), s({
|
|
122
|
-
type: "success",
|
|
123
|
-
text: `'${e.label}' is now your default view`
|
|
124
|
-
}), a(!1);
|
|
125
|
-
} catch {
|
|
126
|
-
s({
|
|
127
|
-
type: "error",
|
|
128
|
-
text: "Failed to set default view"
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
openDropdown: () => a(!0),
|
|
133
|
-
closeDropdown: () => a(!1),
|
|
134
|
-
toggleDropdown: () => a(!x)
|
|
135
|
-
},
|
|
136
|
-
create: {
|
|
137
|
-
handleCreate: async (o) => {
|
|
138
|
-
try {
|
|
139
|
-
const { viewName: i, shareOption: S, isDefault: v } = o, C = S === "company" ? n.COMPANY : n.PERSONAL, { arg: _ } = P(), { data: g } = await j({
|
|
140
|
-
attributes: {
|
|
141
|
-
..._,
|
|
142
|
-
title: i,
|
|
143
|
-
shared: C.key === n.COMPANY.key
|
|
144
|
-
}
|
|
145
|
-
}), I = t.map(($) => $.id);
|
|
146
|
-
I.push(g.id), await N({
|
|
147
|
-
user_setting_attributes: {
|
|
148
|
-
custom_view_positions: {
|
|
149
|
-
order: I
|
|
150
|
-
},
|
|
151
|
-
...v ? {
|
|
152
|
-
default_custom_view: {
|
|
153
|
-
id: Number(g.id),
|
|
154
|
-
type: d
|
|
155
|
-
}
|
|
156
|
-
} : {}
|
|
157
|
-
}
|
|
158
|
-
}), await p(), V(e.id);
|
|
159
|
-
const U = R({ view: g, canUpdateCustomViews: F });
|
|
160
|
-
r(U), u(), D(!1), s({
|
|
161
|
-
type: "success",
|
|
162
|
-
text: `New view '${i}' created`
|
|
163
|
-
});
|
|
164
|
-
} catch (i) {
|
|
165
|
-
console.log(i), s({
|
|
166
|
-
type: "error",
|
|
167
|
-
text: "Failed to save draft view"
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
closeCreateDropdown: () => D(!1),
|
|
172
|
-
handleSaveDraft: async () => {
|
|
173
|
-
D(!0);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
state: {
|
|
178
|
-
shouldShowDropdown: x,
|
|
179
|
-
shouldShowEditDropdown: h,
|
|
180
|
-
shouldShowCreateDropdown: k,
|
|
181
|
-
shouldShowDeleteConfirmation: E
|
|
182
|
-
}
|
|
183
|
-
};
|
|
1
|
+
import { deserialise as f } from "kitsu-core";
|
|
2
|
+
import { withCSRF as o } from "./index54.js";
|
|
3
|
+
import { onlyJSON as m, vndAPI as p } from "./index55.js";
|
|
4
|
+
import { axios as s } from "./index7.js";
|
|
5
|
+
const w = async (t) => (await s.get(t, o(m))).data, y = async (t, e = {}) => {
|
|
6
|
+
const { serialize: n = !0, includeMeta: i = !1 } = e, r = await s.get(t, o(p));
|
|
7
|
+
if (!n) return r.data;
|
|
8
|
+
const { data: a, meta: c } = f(r.data);
|
|
9
|
+
return i ? { data: a, meta: c } : a;
|
|
184
10
|
};
|
|
185
11
|
export {
|
|
186
|
-
|
|
12
|
+
w as fetcherV1,
|
|
13
|
+
y as fetcherV2
|
|
187
14
|
};
|
package/dist/index57.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("./index80.cjs"),Y=require("./index79.cjs"),k=require("./index66.cjs"),G=require("./index58.cjs"),H=require("./index61.cjs"),W=require("./index63.cjs"),n=require("./index45.cjs"),N=require("./index4.cjs"),$=require("./index3.cjs"),B=require("./index8.cjs"),b=require("./index62.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;
|