@veeqo/transfigure 1.1.5 → 1.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ActionsDropdown/ActionsDropdown.d.ts +2 -0
- package/dist/components/ActionsDropdown/index.d.ts +1 -0
- package/dist/components/ActionsDropdown/types.d.ts +7 -0
- package/dist/components/Filters/Fields/NumberRangeFilter/MuiSlider.d.ts +1 -1
- package/dist/components/Views/PillNotifications/variants/styled.d.ts +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +146 -144
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +29 -21
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +21 -24
- package/dist/index102.cjs +16 -77
- package/dist/index102.js +19 -96
- package/dist/index103.cjs +12 -1
- package/dist/index103.js +16 -2
- package/dist/index104.cjs +80 -1
- package/dist/index104.js +101 -19
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +18 -7
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +7 -63
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +60 -26
- package/dist/index108.cjs +1 -13
- package/dist/index108.js +30 -17
- package/dist/index109.cjs +13 -1
- package/dist/index109.js +15 -24
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +27 -18
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +2 -36
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +35 -46
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +25 -62
- package/dist/index113.cjs +1 -7
- package/dist/index113.js +47 -10
- package/dist/index114.cjs +1 -0
- package/dist/index114.js +65 -0
- package/dist/index115.cjs +7 -0
- package/dist/index115.js +12 -0
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +18 -21
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +19 -41
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +41 -23
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +24 -36
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +37 -33
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +32 -49
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +47 -38
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +29 -29
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +41 -58
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +48 -42
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +50 -44
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +46 -7
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +7 -11
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +11 -64
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +40 -39
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +60 -37
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +36 -53
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +54 -51
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +2 -2
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +50 -81
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +81 -35
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +38 -33
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +33 -10
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +10 -39
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +38 -102
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +103 -19
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +17 -134
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +135 -49
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +51 -32
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +2 -2
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +31 -53
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +54 -48
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +41 -81
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +81 -41
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +48 -5
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +5 -45
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +44 -41
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +42 -19
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +19 -8
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +7 -22
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +2 -2
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +23 -2
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +2 -4
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +4 -11
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +10 -12
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +12 -11
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +11 -184
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +183 -25
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +26 -24
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +19 -22
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +25 -97
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +2 -2
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +99 -8
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +8 -51
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +50 -60
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +57 -18
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +22 -18
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +16 -26
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +27 -56
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +57 -341
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +337 -55
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +50 -47
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +4 -4
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +51 -32
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +30 -24
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +26 -32
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +37 -12
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +13 -9
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +9 -17
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +14 -16
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +18 -49
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +50 -21
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +21 -7
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +7 -2
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +2 -9
- package/dist/index82.cjs +1 -3
- package/dist/index82.js +8 -13
- package/dist/index83.cjs +3 -1
- package/dist/index83.js +13 -8
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +9 -41
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +4 -8
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +39 -116
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +9 -19
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +118 -13
- package/dist/index89.cjs +1 -104
- package/dist/index89.js +17 -118
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +13 -68
- package/dist/index91.cjs +104 -1
- package/dist/index91.js +119 -28
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +68 -2
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +27 -39
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +2 -11
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +37 -29
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +11 -29
- package/dist/index97.cjs +1 -19
- package/dist/index97.js +24 -24
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +1 -1
- package/dist/index99.cjs +1 -12
- package/dist/index99.js +33 -16
- package/package.json +1 -1
package/dist/index35.js
CHANGED
|
@@ -1,106 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
behavior: "smooth",
|
|
37
|
-
left: i.offsetLeft
|
|
38
|
-
});
|
|
39
|
-
}));
|
|
40
|
-
const h = C(() => t ? "draft" : e.editable ? "saved" : "fixed", [t, e.editable]), {
|
|
41
|
-
actions: {
|
|
42
|
-
create: { handleSaveDraft: j },
|
|
43
|
-
menu: { toggleDropdown: V },
|
|
44
|
-
delete: { closeDeleteConfirmation: B, handleDelete: q, handleDeleteDraftView: g }
|
|
45
|
-
},
|
|
46
|
-
state: { shouldShowDeleteConfirmation: H },
|
|
47
|
-
actions: O,
|
|
48
|
-
state: D
|
|
49
|
-
} = ee(e), U = C(() => {
|
|
50
|
-
if (w) return V;
|
|
51
|
-
if (t) return g;
|
|
52
|
-
}, [g, t, w, V]);
|
|
53
|
-
return /* @__PURE__ */ W(Y, { children: [
|
|
54
|
-
/* @__PURE__ */ s(
|
|
55
|
-
G,
|
|
56
|
-
{
|
|
57
|
-
colourPalette: L.colors.secondary.blue,
|
|
58
|
-
className: "act-react-listing-custom-view",
|
|
59
|
-
active: n,
|
|
60
|
-
id: e == null ? void 0 : e.id,
|
|
61
|
-
name: a,
|
|
62
|
-
type: h,
|
|
63
|
-
count: M ? /* @__PURE__ */ s(
|
|
64
|
-
J,
|
|
65
|
-
{
|
|
66
|
-
type: "ThreeDots",
|
|
67
|
-
width: 12,
|
|
68
|
-
height: 12,
|
|
69
|
-
color: n ? "#fff" : L.colors.neutral.ink.dark
|
|
70
|
-
}
|
|
71
|
-
) : P,
|
|
72
|
-
onClick: I,
|
|
73
|
-
subAction: U,
|
|
74
|
-
ariaContext: "orders",
|
|
75
|
-
ref: R,
|
|
76
|
-
"aria-controls": "options-dropdown",
|
|
77
|
-
"aria-expanded": D.shouldShowDropdown,
|
|
78
|
-
"aria-haspopup": "dialog"
|
|
79
|
-
},
|
|
80
|
-
e == null ? void 0 : e.id
|
|
81
|
-
),
|
|
82
|
-
/* @__PURE__ */ s(
|
|
83
|
-
re,
|
|
84
|
-
{
|
|
85
|
-
shouldShow: H,
|
|
86
|
-
viewName: a,
|
|
87
|
-
onCancel: B,
|
|
88
|
-
onDelete: q
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { observer as p } from "mobx-react";
|
|
3
|
+
import { Accordion as s, Stack as c } from "@veeqo/ui";
|
|
4
|
+
import { FilterChoiceValue as t } from "./index49.js";
|
|
5
|
+
import { MultipleFieldFilter as m } from "./index30.js";
|
|
6
|
+
import { NumberRangeFilter as f } from "./index31.js";
|
|
7
|
+
import { DateRangeFilter as u } from "./index29.js";
|
|
8
|
+
import { AsyncRadioFilter as F } from "./index27.js";
|
|
9
|
+
import { RadioFilter as y } from "./index32.js";
|
|
10
|
+
import { AsyncCheckboxFilter as T } from "./index26.js";
|
|
11
|
+
import { CheckboxFilter as h } from "./index28.js";
|
|
12
|
+
const k = p(({ data: i }) => {
|
|
13
|
+
const o = i.fields.filter(
|
|
14
|
+
(r) => r.filterType === t.TEXT || r.filterType === t.NUMBER
|
|
15
|
+
), n = i.fields.filter(
|
|
16
|
+
(r) => r.filterType !== t.TEXT && r.filterType !== t.NUMBER
|
|
17
|
+
);
|
|
18
|
+
return /* @__PURE__ */ e(s, { iconSlot: i.glyph, label: i.label, children: /* @__PURE__ */ l(c, { children: [
|
|
19
|
+
o.length > 0 ? /* @__PURE__ */ e(m, { fields: o, groupId: i.id }) : null,
|
|
20
|
+
n.map((r) => {
|
|
21
|
+
switch (r.filterType) {
|
|
22
|
+
case t.CHECKBOX:
|
|
23
|
+
return r.fetchAsyncFilterOptions ? /* @__PURE__ */ e(T, { field: r }) : /* @__PURE__ */ e(h, { field: r });
|
|
24
|
+
case t.RADIO:
|
|
25
|
+
return r.fetchAsyncFilterOptions ? /* @__PURE__ */ e(F, { field: r }) : /* @__PURE__ */ e(y, { field: r });
|
|
26
|
+
case t.DATE_RANGE:
|
|
27
|
+
return /* @__PURE__ */ e(u, { field: r });
|
|
28
|
+
case t.NUMBER_RANGE:
|
|
29
|
+
return /* @__PURE__ */ e(f, { field: r });
|
|
30
|
+
default:
|
|
31
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
32
|
+
r.id,
|
|
33
|
+
": Unknown filter type: ",
|
|
34
|
+
r.filterType
|
|
35
|
+
] }, r.id);
|
|
89
36
|
}
|
|
90
|
-
)
|
|
91
|
-
|
|
92
|
-
Z,
|
|
93
|
-
{
|
|
94
|
-
tabType: h,
|
|
95
|
-
isActive: n,
|
|
96
|
-
initialViewName: a,
|
|
97
|
-
shouldShowCreateViewNotification: t,
|
|
98
|
-
handleSaveDraft: j
|
|
99
|
-
}
|
|
100
|
-
),
|
|
101
|
-
/* @__PURE__ */ s(b, { referenceElement: i, tab: e, ...O, ...D })
|
|
102
|
-
] });
|
|
37
|
+
})
|
|
38
|
+
] }) });
|
|
103
39
|
});
|
|
104
40
|
export {
|
|
105
|
-
|
|
41
|
+
k as FilterGroup
|
|
106
42
|
};
|
package/dist/index36.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/jsx-runtime"),a=require("react"),c=require("@veeqo/ui"),W=require("mobx-react"),Y=require("./index65.cjs"),z=require("./index62.cjs"),G=require("./index40.cjs"),J=require("./index43.cjs"),K=require("./index56.cjs"),Q=require("./index99.cjs"),X=require("./index8.cjs"),Z=require("./index61.cjs"),$=require("./index100.cjs"),b=W.observer(({view:e})=>{const{VIEW_TYPE:S,SEARCH_FILTER_ID:l}=X.useBusinessLogic(),{Filters:{activeViewId:d,initFiltersFromView:w,discardChanges:f,initFromUrl:m,filters:x,setFilter:L},Views:{draftViewsMap:y},Notifications:{notify:T}}=Z.useStores(),{viewsMap:V,defaultCustomViewId:F,isLoading:j}=z.useViews(),{isLoading:N}=Y.useCustomViews({type:S}),{viewCounts:E,isLoadingViewCounts:M}=Q.useViewCounts(),[s,R]=a.useState(null),k=o=>{const q=x.get(l);if(V.has(o)){const n=V.get(o);n&&(w(n),f(!0),m())}else{const n=y.get(o);n?(w(n),f(!0),m()):T({type:"error",text:"Failed to load view"})}q&&L(l,q)},r=(e==null?void 0:e.id)===d,t=e.originalView!==void 0,h=e.originalView===void 0,P=E,u=(e==null?void 0:e.label)||"",A=j||N,g=a.useRef(!1);!A&&!g.current&&r&&e.id===F&&s&&(g.current=!0,s&&d===e.id&&window.requestAnimationFrame(()=>{var o;(o=s.parentElement)==null||o.scrollBy({behavior:"smooth",left:s.offsetLeft})}));const p=a.useMemo(()=>t?"draft":e.editable?"saved":"fixed",[t,e.editable]),{actions:{create:{handleSaveDraft:B},menu:{toggleDropdown:C},delete:{closeDeleteConfirmation:I,handleDelete:_,handleDeleteDraftView:D}},state:{shouldShowDeleteConfirmation:H},actions:O,state:v}=K.useDropdownManager(e),U=a.useMemo(()=>{if(h)return C;if(t)return D},[D,t,h,C]);return i.jsxs(i.Fragment,{children:[i.jsx(c.ViewTab,{colourPalette:c.theme.colors.secondary.blue,className:"act-react-listing-custom-view",active:r,id:e==null?void 0:e.id,name:u,type:p,count:M?i.jsx(c.Loader,{type:"ThreeDots",width:12,height:12,color:r?"#fff":c.theme.colors.neutral.ink.dark}):P,onClick:k,subAction:U,ariaContext:"orders",ref:R,"aria-controls":"options-dropdown","aria-expanded":v.shouldShowDropdown,"aria-haspopup":"dialog"},e==null?void 0:e.id),i.jsx($.Confirmation,{shouldShow:H,viewName:u,onCancel:I,onDelete:_}),i.jsx(G.PillNotifications,{tabType:p,isActive:r,initialViewName:u,shouldShowCreateViewNotification:t,handleSaveDraft:B}),i.jsx(J.ViewDropdowns,{referenceElement:s,tab:e,...O,...v})]})});exports.ViewTab=b;
|
package/dist/index36.js
CHANGED
|
@@ -1,22 +1,106 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsxs as W, Fragment as Y, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useRef as z, useMemo as C } from "react";
|
|
3
|
+
import { ViewTab as G, theme as L, Loader as J } from "@veeqo/ui";
|
|
4
|
+
import { observer as K } from "mobx-react";
|
|
5
|
+
import { useCustomViews as Q } from "./index65.js";
|
|
6
|
+
import { useViews as X } from "./index62.js";
|
|
7
|
+
import { PillNotifications as Z } from "./index40.js";
|
|
8
|
+
import { ViewDropdowns as b } from "./index43.js";
|
|
9
|
+
import { useDropdownManager as ee } from "./index56.js";
|
|
10
|
+
import { useViewCounts as oe } from "./index99.js";
|
|
11
|
+
import { useBusinessLogic as ie } from "./index8.js";
|
|
12
|
+
import { useStores as te } from "./index61.js";
|
|
13
|
+
import { Confirmation as re } from "./index100.js";
|
|
14
|
+
const ge = K(({ view: e }) => {
|
|
15
|
+
const { VIEW_TYPE: S, SEARCH_FILTER_ID: l } = ie(), {
|
|
16
|
+
Filters: { activeViewId: c, initFiltersFromView: d, discardChanges: f, initFromUrl: m, filters: F, setFilter: T },
|
|
17
|
+
Views: { draftViewsMap: y },
|
|
18
|
+
Notifications: { notify: x }
|
|
19
|
+
} = te(), { viewsMap: u, defaultCustomViewId: E, isLoading: N } = X(), { isLoading: k } = Q({ type: S }), { viewCounts: A, isLoadingViewCounts: M } = oe(), [i, R] = $(null), I = (o) => {
|
|
20
|
+
const v = F.get(l);
|
|
21
|
+
if (u.has(o)) {
|
|
22
|
+
const r = u.get(o);
|
|
23
|
+
r && (d(r), f(!0), m());
|
|
24
|
+
} else {
|
|
25
|
+
const r = y.get(o);
|
|
26
|
+
r ? (d(r), f(!0), m()) : x({
|
|
27
|
+
type: "error",
|
|
28
|
+
text: "Failed to load view"
|
|
29
|
+
});
|
|
17
30
|
}
|
|
18
|
-
|
|
19
|
-
};
|
|
31
|
+
v && T(l, v);
|
|
32
|
+
}, n = (e == null ? void 0 : e.id) === c, t = e.originalView !== void 0, w = e.originalView === void 0, P = A, a = (e == null ? void 0 : e.label) || "", _ = N || k, p = z(!1);
|
|
33
|
+
!_ && !p.current && n && e.id === E && i && (p.current = !0, i && c === e.id && window.requestAnimationFrame(() => {
|
|
34
|
+
var o;
|
|
35
|
+
(o = i.parentElement) == null || o.scrollBy({
|
|
36
|
+
behavior: "smooth",
|
|
37
|
+
left: i.offsetLeft
|
|
38
|
+
});
|
|
39
|
+
}));
|
|
40
|
+
const h = C(() => t ? "draft" : e.editable ? "saved" : "fixed", [t, e.editable]), {
|
|
41
|
+
actions: {
|
|
42
|
+
create: { handleSaveDraft: j },
|
|
43
|
+
menu: { toggleDropdown: V },
|
|
44
|
+
delete: { closeDeleteConfirmation: B, handleDelete: q, handleDeleteDraftView: g }
|
|
45
|
+
},
|
|
46
|
+
state: { shouldShowDeleteConfirmation: H },
|
|
47
|
+
actions: O,
|
|
48
|
+
state: D
|
|
49
|
+
} = ee(e), U = C(() => {
|
|
50
|
+
if (w) return V;
|
|
51
|
+
if (t) return g;
|
|
52
|
+
}, [g, t, w, V]);
|
|
53
|
+
return /* @__PURE__ */ W(Y, { children: [
|
|
54
|
+
/* @__PURE__ */ s(
|
|
55
|
+
G,
|
|
56
|
+
{
|
|
57
|
+
colourPalette: L.colors.secondary.blue,
|
|
58
|
+
className: "act-react-listing-custom-view",
|
|
59
|
+
active: n,
|
|
60
|
+
id: e == null ? void 0 : e.id,
|
|
61
|
+
name: a,
|
|
62
|
+
type: h,
|
|
63
|
+
count: M ? /* @__PURE__ */ s(
|
|
64
|
+
J,
|
|
65
|
+
{
|
|
66
|
+
type: "ThreeDots",
|
|
67
|
+
width: 12,
|
|
68
|
+
height: 12,
|
|
69
|
+
color: n ? "#fff" : L.colors.neutral.ink.dark
|
|
70
|
+
}
|
|
71
|
+
) : P,
|
|
72
|
+
onClick: I,
|
|
73
|
+
subAction: U,
|
|
74
|
+
ariaContext: "orders",
|
|
75
|
+
ref: R,
|
|
76
|
+
"aria-controls": "options-dropdown",
|
|
77
|
+
"aria-expanded": D.shouldShowDropdown,
|
|
78
|
+
"aria-haspopup": "dialog"
|
|
79
|
+
},
|
|
80
|
+
e == null ? void 0 : e.id
|
|
81
|
+
),
|
|
82
|
+
/* @__PURE__ */ s(
|
|
83
|
+
re,
|
|
84
|
+
{
|
|
85
|
+
shouldShow: H,
|
|
86
|
+
viewName: a,
|
|
87
|
+
onCancel: B,
|
|
88
|
+
onDelete: q
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ s(
|
|
92
|
+
Z,
|
|
93
|
+
{
|
|
94
|
+
tabType: h,
|
|
95
|
+
isActive: n,
|
|
96
|
+
initialViewName: a,
|
|
97
|
+
shouldShowCreateViewNotification: t,
|
|
98
|
+
handleSaveDraft: j
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ s(b, { referenceElement: i, tab: e, ...O, ...D })
|
|
102
|
+
] });
|
|
103
|
+
});
|
|
20
104
|
export {
|
|
21
|
-
|
|
105
|
+
ge as ViewTab
|
|
22
106
|
};
|
package/dist/index37.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@veeqo/components"),t=require("@veeqo/ui"),r=require("./index57.cjs"),{Glyph:s}=c.VeeqoCommon,l=({hideActionsPopover:i})=>{const{duplicateView:o}=r.useDuplicateActiveView(),n=()=>{o(),i()};return e.jsx(t.Button,{style:{width:"100%"},iconSlot:e.jsx(s,{name:"add",size:"sm",color:t.theme.colors.neutral.ink.base}),variant:"flat",onClick:n,children:"Create View"})};exports.CreateView=l;
|
package/dist/index37.js
CHANGED
|
@@ -1,139 +1,22 @@
|
|
|
1
|
-
import { jsx as e
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
onCloseDropdown: f,
|
|
12
|
-
onDelete: b,
|
|
13
|
-
onSave: y,
|
|
14
|
-
headerText: C,
|
|
15
|
-
e2ePrefix: s,
|
|
16
|
-
activeOption: S
|
|
17
|
-
}) => {
|
|
18
|
-
const { VIEW_TYPE: V } = M(), { canDeleteCustomViews: m, canUpdateCustomViews: o, canShareCustomViews: r, defaultCustomViewId: u } = j({
|
|
19
|
-
type: V
|
|
20
|
-
}), k = n.id === u, { handleSubmit: D, control: l, formState: h } = L({
|
|
21
|
-
mode: "onChange",
|
|
22
|
-
defaultValues: {
|
|
23
|
-
viewName: v,
|
|
24
|
-
isDefault: n.id === u,
|
|
25
|
-
shareOption: S.key
|
|
26
|
-
}
|
|
27
|
-
}), T = Object.values(F).map((t) => ({
|
|
28
|
-
key: t.key,
|
|
29
|
-
value: t.key,
|
|
30
|
-
label: t.text
|
|
31
|
-
}));
|
|
32
|
-
if (!g) return null;
|
|
33
|
-
const I = n.originalView === void 0;
|
|
34
|
-
return /* @__PURE__ */ e("form", { onSubmit: D(y), children: /* @__PURE__ */ a(
|
|
35
|
-
x,
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { VeeqoCommon as r } from "@veeqo/components";
|
|
3
|
+
import { Button as n, theme as c } from "@veeqo/ui";
|
|
4
|
+
import { useDuplicateActiveView as l } from "./index57.js";
|
|
5
|
+
const { Glyph: m } = r, u = ({ hideActionsPopover: o }) => {
|
|
6
|
+
const { duplicateView: t } = l(), i = () => {
|
|
7
|
+
t(), o();
|
|
8
|
+
};
|
|
9
|
+
return /* @__PURE__ */ e(
|
|
10
|
+
n,
|
|
36
11
|
{
|
|
37
|
-
style: { width: "
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
m && /* @__PURE__ */ e(
|
|
43
|
-
p,
|
|
44
|
-
{
|
|
45
|
-
variant: "destructive",
|
|
46
|
-
onClick: b,
|
|
47
|
-
className: `act-react-listing-custom-view-${s}-delete`,
|
|
48
|
-
children: "Delete"
|
|
49
|
-
}
|
|
50
|
-
),
|
|
51
|
-
(o || r) && /* @__PURE__ */ e(
|
|
52
|
-
p,
|
|
53
|
-
{
|
|
54
|
-
variant: "primary",
|
|
55
|
-
type: "submit",
|
|
56
|
-
className: `act-react-listing-custom-view-${s}-save`,
|
|
57
|
-
disabled: !h.isDirty && I || h.isSubmitting,
|
|
58
|
-
children: "Save"
|
|
59
|
-
}
|
|
60
|
-
)
|
|
61
|
-
] }) : null,
|
|
62
|
-
className: `act-react-listing-custom-view-${s}`,
|
|
63
|
-
children: [
|
|
64
|
-
!o && /* @__PURE__ */ e(
|
|
65
|
-
O,
|
|
66
|
-
{
|
|
67
|
-
variant: "warning",
|
|
68
|
-
title: "You need permission to edit this view",
|
|
69
|
-
message: "This is a company shared view"
|
|
70
|
-
}
|
|
71
|
-
),
|
|
72
|
-
/* @__PURE__ */ a(c, { alignX: "stretch", children: [
|
|
73
|
-
/* @__PURE__ */ e(
|
|
74
|
-
d,
|
|
75
|
-
{
|
|
76
|
-
name: "viewName",
|
|
77
|
-
control: l,
|
|
78
|
-
render: ({ onChange: t, value: i }) => /* @__PURE__ */ e(
|
|
79
|
-
_,
|
|
80
|
-
{
|
|
81
|
-
id: "view-name",
|
|
82
|
-
className: `act-react-listing-custom-view-${s}-field`,
|
|
83
|
-
label: "View name",
|
|
84
|
-
placeholder: "View name",
|
|
85
|
-
value: i,
|
|
86
|
-
onChange: t,
|
|
87
|
-
disabled: !n.editable,
|
|
88
|
-
maxLength: w,
|
|
89
|
-
hint: `${i.length} / ${w} characters`,
|
|
90
|
-
required: !0
|
|
91
|
-
}
|
|
92
|
-
)
|
|
93
|
-
}
|
|
94
|
-
),
|
|
95
|
-
/* @__PURE__ */ a(c, { children: [
|
|
96
|
-
/* @__PURE__ */ e($, { variant: "inputLabel", children: "Sharing options" }),
|
|
97
|
-
/* @__PURE__ */ e(
|
|
98
|
-
d,
|
|
99
|
-
{
|
|
100
|
-
name: "shareOption",
|
|
101
|
-
control: l,
|
|
102
|
-
render: ({ onChange: t, value: i }) => /* @__PURE__ */ e(
|
|
103
|
-
A,
|
|
104
|
-
{
|
|
105
|
-
onChange: (N) => r && t(N),
|
|
106
|
-
options: T,
|
|
107
|
-
selected: i
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
}
|
|
111
|
-
)
|
|
112
|
-
] }),
|
|
113
|
-
/* @__PURE__ */ e(
|
|
114
|
-
d,
|
|
115
|
-
{
|
|
116
|
-
name: "isDefault",
|
|
117
|
-
control: l,
|
|
118
|
-
render: ({ onChange: t, value: i }) => /* @__PURE__ */ e(
|
|
119
|
-
E,
|
|
120
|
-
{
|
|
121
|
-
disabled: k,
|
|
122
|
-
name: "makeViewDefault",
|
|
123
|
-
label: "Make default view",
|
|
124
|
-
checked: i,
|
|
125
|
-
onChange: t,
|
|
126
|
-
hint: "This will be the view this page will always open on"
|
|
127
|
-
}
|
|
128
|
-
)
|
|
129
|
-
}
|
|
130
|
-
)
|
|
131
|
-
] })
|
|
132
|
-
]
|
|
12
|
+
style: { width: "100%" },
|
|
13
|
+
iconSlot: /* @__PURE__ */ e(m, { name: "add", size: "sm", color: c.colors.neutral.ink.base }),
|
|
14
|
+
variant: "flat",
|
|
15
|
+
onClick: i,
|
|
16
|
+
children: "Create View"
|
|
133
17
|
}
|
|
134
|
-
)
|
|
18
|
+
);
|
|
135
19
|
};
|
|
136
20
|
export {
|
|
137
|
-
|
|
138
|
-
w as VIEWS_TITLE_MAX_CHAR_LIMIT
|
|
21
|
+
u as CreateView
|
|
139
22
|
};
|
package/dist/index38.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("@veeqo/ui"),o=require("react-hook-form"),I=require("./index65.cjs"),f=require("./index45.cjs"),D=require("./index8.cjs"),d=60,_=({tab:n,viewName:w,shouldShowDropdown:p,onCloseDropdown:v,onDelete:g,onSave:x,headerText:j,e2ePrefix:a,activeOption:C})=>{const{VIEW_TYPE:S}=D.useBusinessLogic(),{canDeleteCustomViews:u,canUpdateCustomViews:r,canShareCustomViews:l,defaultCustomViewId:m}=I.useCustomViews({type:S}),b=n.id===m,{handleSubmit:y,control:c,formState:h}=o.useForm({mode:"onChange",defaultValues:{viewName:w,isDefault:n.id===m,shareOption:C.key}}),V=Object.values(f.SHARING_OPTIONS).map(s=>({key:s.key,value:s.key,label:s.text}));if(!p)return null;const k=n.originalView===void 0;return e.jsx("form",{onSubmit:y(x),children:e.jsxs(t.Card,{style:{width:"400px"},title:j,subtitle:"Any filters you've applied and your chosen sort direction will be stored in this view",onClose:v,renderFooter:()=>u||r||l?e.jsxs(t.Stack,{direction:"horizontal",alignX:"end",children:[u&&e.jsx(t.Button,{variant:"destructive",onClick:g,className:`act-react-listing-custom-view-${a}-delete`,children:"Delete"}),(r||l)&&e.jsx(t.Button,{variant:"primary",type:"submit",className:`act-react-listing-custom-view-${a}-save`,disabled:!h.isDirty&&k||h.isSubmitting,children:"Save"})]}):null,className:`act-react-listing-custom-view-${a}`,children:[!r&&e.jsx(t.Alert,{variant:"warning",title:"You need permission to edit this view",message:"This is a company shared view"}),e.jsxs(t.Stack,{alignX:"stretch",children:[e.jsx(o.Controller,{name:"viewName",control:c,render:({onChange:s,value:i})=>e.jsx(t.TextField,{id:"view-name",className:`act-react-listing-custom-view-${a}-field`,label:"View name",placeholder:"View name",value:i,onChange:s,disabled:!n.editable,maxLength:d,hint:`${i.length} / ${d} characters`,required:!0})}),e.jsxs(t.Stack,{children:[e.jsx(t.Text,{variant:"inputLabel",children:"Sharing options"}),e.jsx(o.Controller,{name:"shareOption",control:c,render:({onChange:s,value:i})=>e.jsx(t.SegmentedControl,{onChange:T=>l&&s(T),options:V,selected:i})})]}),e.jsx(o.Controller,{name:"isDefault",control:c,render:({onChange:s,value:i})=>e.jsx(t.Checkbox,{disabled:b,name:"makeViewDefault",label:"Make default view",checked:i,onChange:s,hint:"This will be the view this page will always open on"})})]})]})})};exports.EditDropdown=_;exports.VIEWS_TITLE_MAX_CHAR_LIMIT=d;
|