@veeqo/transfigure 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BusinessLogic/types.d.ts +2 -0
- package/dist/components/TableManagement/DndContainer.d.ts +11 -0
- package/dist/components/TableManagement/TableManagement.d.ts +6 -0
- package/dist/components/TableManagement/TableManagementGlyph.d.ts +4 -0
- package/dist/components/TableManagement/TableManagementModal.d.ts +2 -0
- package/dist/components/TableManagement/components/ColumnGroup.d.ts +2 -0
- package/dist/components/TableManagement/components/ColumnItem.d.ts +2 -0
- package/dist/components/TableManagement/components/DroppableArea.d.ts +8 -0
- package/dist/components/TableManagement/components/SortableItem.d.ts +7 -0
- package/dist/components/TableManagement/components/styled.d.ts +28 -0
- package/dist/components/TableManagement/components/types.d.ts +11 -0
- package/dist/components/TableManagement/hooks/useCollisionDetectionStrategy/index.d.ts +1 -0
- package/dist/components/TableManagement/hooks/useCollisionDetectionStrategy/types.d.ts +4 -0
- package/dist/components/TableManagement/hooks/useCollisionDetectionStrategy/useCollisionDetectionStrategy.d.ts +5 -0
- package/dist/components/TableManagement/hooks/useDragHandlers/index.d.ts +1 -0
- package/dist/components/TableManagement/hooks/useDragHandlers/types.d.ts +6 -0
- package/dist/components/TableManagement/hooks/useDragHandlers/useDragHandlers.d.ts +9 -0
- package/dist/components/TableManagement/index.d.ts +1 -0
- package/dist/components/TableManagement/types.d.ts +17 -0
- package/dist/components/TableManagement/utils/filterColumnsBySearch/filterColumnsBySearch.d.ts +2 -0
- package/dist/components/TableManagement/utils/filterColumnsBySearch/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useHiddenColumns/index.d.ts +1 -0
- package/dist/hooks/useHiddenColumns/useHiddenColumns.d.ts +7 -0
- package/dist/hooks/usePersistColumns/index.d.ts +1 -0
- package/dist/hooks/usePersistColumns/usePersistColumns.d.ts +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +79 -75
- package/dist/index100.cjs +13 -0
- package/dist/index100.js +19 -0
- package/dist/index101.cjs +1 -0
- package/dist/index101.js +38 -0
- package/dist/index102.cjs +1 -0
- package/dist/index102.js +44 -0
- package/dist/index103.cjs +7 -0
- package/dist/index103.js +12 -0
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +1 -1
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +2 -2
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +2 -2
- 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/index18.cjs +1 -1
- package/dist/index18.js +2 -2
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +2 -2
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +2 -2
- 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 +2 -2
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +3 -3
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +3 -3
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +1 -1
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +2 -2
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +2 -2
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +3 -3
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +1 -1
- package/dist/index3.cjs +1 -1
- package/dist/index3.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 +1 -1
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +1 -1
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +5 -5
- 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 +3 -3
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +3 -3
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +4 -4
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +1 -1
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +2 -2
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +4 -4
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +46 -19
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +19 -2
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +2 -23
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +23 -2
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +2 -4
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +4 -11
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +10 -12
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +2 -2
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +12 -11
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +11 -184
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +183 -25
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +26 -24
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +19 -22
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +25 -90
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +92 -8
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +8 -50
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +49 -60
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +61 -17
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +4 -4
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +18 -316
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +25 -59
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +309 -50
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +54 -31
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +52 -27
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +37 -4
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +32 -9
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +4 -17
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +9 -19
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +16 -46
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +19 -17
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +48 -2
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +21 -9
- package/dist/index73.cjs +1 -3
- package/dist/index73.js +2 -14
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +8 -8
- package/dist/index75.cjs +3 -1
- package/dist/index75.js +13 -28
- package/dist/index76.cjs +1 -19
- package/dist/index76.js +9 -24
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +154 -14
- package/dist/index78.cjs +1 -12
- package/dist/index78.js +19 -16
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +13 -22
- package/dist/index81.cjs +104 -1
- package/dist/index81.js +119 -23
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +58 -2
- package/dist/index83.cjs +1 -13
- package/dist/index83.js +28 -16
- package/dist/index84.cjs +1 -80
- package/dist/index84.js +2 -95
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +33 -35
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +8 -63
- package/dist/index87.cjs +1 -7
- package/dist/index87.js +29 -10
- package/dist/index88.cjs +1 -0
- package/dist/index88.js +24 -0
- package/dist/index89.cjs +19 -0
- package/dist/index89.js +26 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +17 -15
- package/dist/index90.cjs +12 -0
- package/dist/index90.js +18 -0
- package/dist/index91.cjs +1 -0
- package/dist/index91.js +17 -0
- package/dist/index92.cjs +1 -0
- package/dist/index92.js +26 -0
- package/dist/index93.cjs +1 -0
- package/dist/index93.js +4 -0
- package/dist/index94.cjs +1 -0
- package/dist/index94.js +21 -0
- package/dist/index95.cjs +1 -0
- package/dist/index95.js +10 -0
- package/dist/index96.cjs +1 -0
- package/dist/index96.js +66 -0
- package/dist/index97.cjs +1 -0
- package/dist/index97.js +32 -0
- package/dist/index98.cjs +1 -0
- package/dist/index98.js +65 -0
- package/dist/index99.cjs +80 -0
- package/dist/index99.js +97 -0
- package/dist/types.d.ts +8 -0
- package/package.json +11 -2
package/dist/index51.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 "./index2.js";
|
|
11
|
-
import { useBusinessLogic as H } from "./index7.js";
|
|
12
|
-
import { useStores as b } from "./index56.js";
|
|
13
|
-
import { createCustomView as j } from "./index5.js";
|
|
14
|
-
import { patchCustomView as z } from "./index4.js";
|
|
15
|
-
const ye = (e) => {
|
|
16
|
-
const { VIEW_TYPE: r } = H(), { duplicateView: E } = B(), { getActiveViewInAPIFormat: I } = T(), {
|
|
17
|
-
canDeleteCustomViews: g,
|
|
18
|
-
defaultCustomViewId: P,
|
|
19
|
-
canUpdateCustomViews: M,
|
|
20
|
-
mutate: F
|
|
21
|
-
} = q({
|
|
22
|
-
type: r
|
|
23
|
-
}), { mutate: u, viewsMap: f, viewsArray: Y } = W(), [N, a] = c(!1), [A, p] = c(!1), [m, n] = c(!1), [k, h] = c(!1), {
|
|
24
|
-
Views: { removeDraftViewById: D, draftViewsMap: L },
|
|
25
|
-
Filters: { initFiltersFromView: d, updateUrl: l, setActiveViewId: O },
|
|
26
|
-
Notifications: { notify: o }
|
|
27
|
-
} = b();
|
|
28
|
-
return {
|
|
29
|
-
actions: {
|
|
30
|
-
delete: {
|
|
31
|
-
handleDeleteDraftView: () => {
|
|
32
|
-
if (!e.originalView) throw Error("No draft view found");
|
|
33
|
-
D(e.id);
|
|
34
|
-
const t = f.get(P);
|
|
35
|
-
if (t)
|
|
36
|
-
t && d(t);
|
|
37
|
-
else {
|
|
38
|
-
const i = f.get(C);
|
|
39
|
-
i && d(i);
|
|
40
|
-
}
|
|
41
|
-
l();
|
|
42
|
-
},
|
|
43
|
-
handleDelete: async () => {
|
|
44
|
-
try {
|
|
45
|
-
if (g) {
|
|
46
|
-
await G(Number(e.id)), await u();
|
|
47
|
-
const t = f.get(C);
|
|
48
|
-
t && d(t), l(), A && p(!1), m && n(m), o({
|
|
49
|
-
type: "success",
|
|
50
|
-
text: `'${e.label}' has been deleted`
|
|
51
|
-
});
|
|
52
|
-
} else
|
|
53
|
-
o({
|
|
54
|
-
type: "info",
|
|
55
|
-
text: "You require additional user permissions to delete a company shared view"
|
|
56
|
-
});
|
|
57
|
-
} catch {
|
|
58
|
-
o({
|
|
59
|
-
type: "error",
|
|
60
|
-
text: "Failed to delete view"
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
handleShowDeleteConfirmation: () => {
|
|
65
|
-
if (L.has(e.id)) {
|
|
66
|
-
D(e.id), e.originalView ? O(e.originalView.id) : O(C);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
g ? p(!0) : o({
|
|
70
|
-
type: "info",
|
|
71
|
-
text: "You require additional user permissions to delete a company shared view"
|
|
72
|
-
});
|
|
73
|
-
},
|
|
74
|
-
closeDeleteConfirmation: () => p(!1)
|
|
75
|
-
},
|
|
76
|
-
edit: {
|
|
77
|
-
handleShowEditDropdown: () => {
|
|
78
|
-
a(!1), n(!0);
|
|
79
|
-
},
|
|
80
|
-
closeEditDropdown: () => n(!1)
|
|
81
|
-
},
|
|
82
|
-
menu: {
|
|
83
|
-
handleSave: async (t) => {
|
|
84
|
-
try {
|
|
85
|
-
const { viewName: i, shareOption: y, isDefault: v } = t, V = y === "company" ? s.COMPANY : s.PERSONAL, w = {
|
|
86
|
-
attributes: {
|
|
87
|
-
title: i,
|
|
88
|
-
shared: V.key === s.COMPANY.key
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
await z(e.id, w), v && (await _({
|
|
92
|
-
user_setting_attributes: {
|
|
93
|
-
default_custom_view: {
|
|
94
|
-
id: Number(e.id),
|
|
95
|
-
type: r
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}), await F()), await u(), l(), o({
|
|
99
|
-
type: "success",
|
|
100
|
-
text: `'${i}' view updated`
|
|
101
|
-
}), n(!1);
|
|
102
|
-
} catch {
|
|
103
|
-
o({
|
|
104
|
-
type: "error",
|
|
105
|
-
text: "Failed to save view"
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
handleDuplicate: () => {
|
|
110
|
-
E(), a(!1);
|
|
111
|
-
},
|
|
112
|
-
handleMakeDefault: async () => {
|
|
113
|
-
try {
|
|
114
|
-
await _({
|
|
115
|
-
user_setting_attributes: {
|
|
116
|
-
default_custom_view: {
|
|
117
|
-
id: Number(e.id),
|
|
118
|
-
type: r
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}), o({
|
|
122
|
-
type: "success",
|
|
123
|
-
text: `'${e.label}' is now your default view`
|
|
124
|
-
}), a(!1);
|
|
125
|
-
} catch {
|
|
126
|
-
o({
|
|
127
|
-
type: "error",
|
|
128
|
-
text: "Failed to set default view"
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
openDropdown: () => a(!0),
|
|
133
|
-
closeDropdown: () => a(!1),
|
|
134
|
-
toggleDropdown: () => a(!N)
|
|
135
|
-
},
|
|
136
|
-
create: {
|
|
137
|
-
handleCreate: async (t) => {
|
|
138
|
-
try {
|
|
139
|
-
const { viewName: i, shareOption: y, isDefault: v } = t, V = y === "company" ? s.COMPANY : s.PERSONAL, { arg: w } = I(), { data: S } = await j({
|
|
140
|
-
attributes: {
|
|
141
|
-
...w,
|
|
142
|
-
title: i,
|
|
143
|
-
shared: V.key === s.COMPANY.key
|
|
144
|
-
}
|
|
145
|
-
}), x = Y.map(($) => $.id);
|
|
146
|
-
x.push(S.id), await _({
|
|
147
|
-
user_setting_attributes: {
|
|
148
|
-
custom_view_positions: {
|
|
149
|
-
order: x
|
|
150
|
-
},
|
|
151
|
-
...v ? {
|
|
152
|
-
default_custom_view: {
|
|
153
|
-
id: Number(S.id),
|
|
154
|
-
type: r
|
|
155
|
-
}
|
|
156
|
-
} : {}
|
|
157
|
-
}
|
|
158
|
-
}), await u(), D(e.id);
|
|
159
|
-
const U = R({ view: S, canUpdateCustomViews: M });
|
|
160
|
-
d(U), l(), h(!1), o({
|
|
161
|
-
type: "success",
|
|
162
|
-
text: `New view '${w.title}' created`
|
|
163
|
-
});
|
|
164
|
-
} catch (i) {
|
|
165
|
-
console.log(i), o({
|
|
166
|
-
type: "error",
|
|
167
|
-
text: "Failed to save draft view"
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
closeCreateDropdown: () => h(!1),
|
|
172
|
-
handleSaveDraft: async () => {
|
|
173
|
-
h(!0);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
state: {
|
|
178
|
-
shouldShowDropdown: N,
|
|
179
|
-
shouldShowEditDropdown: m,
|
|
180
|
-
shouldShowCreateDropdown: k,
|
|
181
|
-
shouldShowDeleteConfirmation: A
|
|
182
|
-
}
|
|
183
|
-
};
|
|
1
|
+
import { deserialise as f } from "kitsu-core";
|
|
2
|
+
import { withCSRF as o } from "./index49.js";
|
|
3
|
+
import { onlyJSON as m, vndAPI as p } from "./index50.js";
|
|
4
|
+
import { axios as s } from "./index6.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/index52.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index57.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),C=require("./index72.cjs"),Y=require("./index71.cjs"),k=require("./index60.cjs"),G=require("./index53.cjs"),H=require("./index56.cjs"),W=require("./index58.cjs"),a=require("./index42.cjs"),N=require("./index3.cjs"),$=require("./index2.cjs"),B=require("./index7.cjs"),b=require("./index57.cjs"),j=require("./index5.cjs"),z=require("./index4.cjs"),J=e=>{const{VIEW_TYPE:r}=B.useBusinessLogic(),{duplicateView:P}=G.useDuplicateActiveView(),{getActiveViewInAPIFormat:q}=H.usePersistUnsavedChanges(),{canDeleteCustomViews:_,defaultCustomViewId:E,canUpdateCustomViews:M,mutate:x}=k.useCustomViews({type:r}),{mutate:w,viewsMap:p,viewsArray:L}=W.useViews(),[I,o]=c.useState(!1),[A,h]=c.useState(!1),[f,n]=c.useState(!1),[F,S]=c.useState(!1),{Views:{removeDraftViewById:D,draftViewsMap:R},Filters:{initFiltersFromView:u,updateUrl:d,setActiveViewId:O},Notifications:{notify:s}}=b.useStores();return{actions:{delete:{handleDeleteDraftView:()=>{if(!e.originalView)throw Error("No draft view found");D(e.id);const t=p.get(E);if(t)t&&u(t);else{const i=p.get(C.ALL_VIEW_ID);i&&u(i)}d()},handleDelete:async()=>{try{if(_){await $.deleteCustomView(Number(e.id)),await w();const t=p.get(C.ALL_VIEW_ID);t&&u(t),d(),A&&h(!1),f&&n(f),s({type:"success",text:`'${e.label}' has been deleted`})}else s({type:"info",text:"You require additional user permissions to delete a company shared view"})}catch{s({type:"error",text:"Failed to delete view"})}},handleShowDeleteConfirmation:()=>{if(R.has(e.id)){D(e.id),e.originalView?O(e.originalView.id):O(C.ALL_VIEW_ID);return}_?h(!0):s({type:"info",text:"You require additional user permissions to delete a company shared view"})},closeDeleteConfirmation:()=>h(!1)},edit:{handleShowEditDropdown:()=>{o(!1),n(!0)},closeEditDropdown:()=>n(!1)},menu:{handleSave:async t=>{try{const{viewName:i,shareOption:m,isDefault:V}=t,y=m==="company"?a.SHARING_OPTIONS.COMPANY:a.SHARING_OPTIONS.PERSONAL,l={attributes:{title:i,shared:y.key===a.SHARING_OPTIONS.COMPANY.key}};await z.patchCustomView(e.id,l),V&&(await N.patchCurrentUser({user_setting_attributes:{default_custom_view:{id:Number(e.id),type:r}}}),await x()),await w(),d(),s({type:"success",text:`'${i}' view updated`}),n(!1)}catch{s({type:"error",text:"Failed to save view"})}},handleDuplicate:()=>{P(),o(!1)},handleMakeDefault:async()=>{try{await N.patchCurrentUser({user_setting_attributes:{default_custom_view:{id:Number(e.id),type:r}}}),s({type:"success",text:`'${e.label}' is now your default view`}),o(!1)}catch{s({type:"error",text:"Failed to set default view"})}},openDropdown:()=>o(!0),closeDropdown:()=>o(!1),toggleDropdown:()=>o(!I)},create:{handleCreate:async t=>{try{const{viewName:i,shareOption:m,isDefault:V}=t,y=m==="company"?a.SHARING_OPTIONS.COMPANY:a.SHARING_OPTIONS.PERSONAL,{arg:l}=q(),{data:v}=await j.createCustomView({attributes:{...l,title:i,shared:y.key===a.SHARING_OPTIONS.COMPANY.key}}),g=L.map(U=>U.id);g.push(v.id),await N.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:g},...V?{default_custom_view:{id:Number(v.id),type:r}}:{}}}),await w(),D(e.id);const T=Y.viewsAdapter({view:v,canUpdateCustomViews:M});u(T),d(),S(!1),s({type:"success",text:`New view '${l.title}' created`})}catch(i){console.log(i),s({type:"error",text:"Failed to save draft view"})}},closeCreateDropdown:()=>S(!1),handleSaveDraft:async()=>{S(!0)}}},state:{shouldShowDropdown:I,shouldShowEditDropdown:f,shouldShowCreateDropdown:F,shouldShowDeleteConfirmation:A}}};exports.useDropdownManager=J;
|
package/dist/index52.js
CHANGED
|
@@ -1,29 +1,187 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { useState as c } from "react";
|
|
2
|
+
import { ALL_VIEW_ID as C } from "./index72.js";
|
|
3
|
+
import { viewsAdapter as R } from "./index71.js";
|
|
4
|
+
import { useCustomViews as q } from "./index60.js";
|
|
5
|
+
import { useDuplicateActiveView as B } from "./index53.js";
|
|
6
|
+
import { usePersistUnsavedChanges as T } from "./index56.js";
|
|
7
|
+
import { useViews as W } from "./index58.js";
|
|
8
|
+
import { SHARING_OPTIONS as s } from "./index42.js";
|
|
9
|
+
import { patchCurrentUser as _ } from "./index3.js";
|
|
10
|
+
import { deleteCustomView as G } from "./index2.js";
|
|
11
|
+
import { useBusinessLogic as H } from "./index7.js";
|
|
12
|
+
import { useStores as b } from "./index57.js";
|
|
13
|
+
import { createCustomView as j } from "./index5.js";
|
|
14
|
+
import { patchCustomView as z } from "./index4.js";
|
|
15
|
+
const ye = (e) => {
|
|
16
|
+
const { VIEW_TYPE: r } = H(), { duplicateView: E } = B(), { getActiveViewInAPIFormat: I } = T(), {
|
|
17
|
+
canDeleteCustomViews: g,
|
|
18
|
+
defaultCustomViewId: P,
|
|
19
|
+
canUpdateCustomViews: M,
|
|
20
|
+
mutate: F
|
|
21
|
+
} = q({
|
|
22
|
+
type: r
|
|
23
|
+
}), { mutate: u, viewsMap: f, viewsArray: Y } = W(), [N, a] = c(!1), [A, p] = c(!1), [m, n] = c(!1), [k, h] = c(!1), {
|
|
24
|
+
Views: { removeDraftViewById: D, draftViewsMap: L },
|
|
25
|
+
Filters: { initFiltersFromView: d, updateUrl: l, setActiveViewId: O },
|
|
26
|
+
Notifications: { notify: o }
|
|
27
|
+
} = b();
|
|
28
|
+
return {
|
|
29
|
+
actions: {
|
|
30
|
+
delete: {
|
|
31
|
+
handleDeleteDraftView: () => {
|
|
32
|
+
if (!e.originalView) throw Error("No draft view found");
|
|
33
|
+
D(e.id);
|
|
34
|
+
const t = f.get(P);
|
|
35
|
+
if (t)
|
|
36
|
+
t && d(t);
|
|
37
|
+
else {
|
|
38
|
+
const i = f.get(C);
|
|
39
|
+
i && d(i);
|
|
40
|
+
}
|
|
41
|
+
l();
|
|
42
|
+
},
|
|
43
|
+
handleDelete: async () => {
|
|
44
|
+
try {
|
|
45
|
+
if (g) {
|
|
46
|
+
await G(Number(e.id)), await u();
|
|
47
|
+
const t = f.get(C);
|
|
48
|
+
t && d(t), l(), A && p(!1), m && n(m), o({
|
|
49
|
+
type: "success",
|
|
50
|
+
text: `'${e.label}' has been deleted`
|
|
51
|
+
});
|
|
52
|
+
} else
|
|
53
|
+
o({
|
|
54
|
+
type: "info",
|
|
55
|
+
text: "You require additional user permissions to delete a company shared view"
|
|
56
|
+
});
|
|
57
|
+
} catch {
|
|
58
|
+
o({
|
|
59
|
+
type: "error",
|
|
60
|
+
text: "Failed to delete view"
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
handleShowDeleteConfirmation: () => {
|
|
65
|
+
if (L.has(e.id)) {
|
|
66
|
+
D(e.id), e.originalView ? O(e.originalView.id) : O(C);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
g ? p(!0) : o({
|
|
70
|
+
type: "info",
|
|
71
|
+
text: "You require additional user permissions to delete a company shared view"
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
closeDeleteConfirmation: () => p(!1)
|
|
75
|
+
},
|
|
76
|
+
edit: {
|
|
77
|
+
handleShowEditDropdown: () => {
|
|
78
|
+
a(!1), n(!0);
|
|
79
|
+
},
|
|
80
|
+
closeEditDropdown: () => n(!1)
|
|
81
|
+
},
|
|
82
|
+
menu: {
|
|
83
|
+
handleSave: async (t) => {
|
|
84
|
+
try {
|
|
85
|
+
const { viewName: i, shareOption: y, isDefault: v } = t, V = y === "company" ? s.COMPANY : s.PERSONAL, w = {
|
|
86
|
+
attributes: {
|
|
87
|
+
title: i,
|
|
88
|
+
shared: V.key === s.COMPANY.key
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
await z(e.id, w), v && (await _({
|
|
92
|
+
user_setting_attributes: {
|
|
93
|
+
default_custom_view: {
|
|
94
|
+
id: Number(e.id),
|
|
95
|
+
type: r
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}), await F()), await u(), l(), o({
|
|
99
|
+
type: "success",
|
|
100
|
+
text: `'${i}' view updated`
|
|
101
|
+
}), n(!1);
|
|
102
|
+
} catch {
|
|
103
|
+
o({
|
|
104
|
+
type: "error",
|
|
105
|
+
text: "Failed to save view"
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
handleDuplicate: () => {
|
|
110
|
+
E(), a(!1);
|
|
111
|
+
},
|
|
112
|
+
handleMakeDefault: async () => {
|
|
113
|
+
try {
|
|
114
|
+
await _({
|
|
115
|
+
user_setting_attributes: {
|
|
116
|
+
default_custom_view: {
|
|
117
|
+
id: Number(e.id),
|
|
118
|
+
type: r
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}), o({
|
|
122
|
+
type: "success",
|
|
123
|
+
text: `'${e.label}' is now your default view`
|
|
124
|
+
}), a(!1);
|
|
125
|
+
} catch {
|
|
126
|
+
o({
|
|
127
|
+
type: "error",
|
|
128
|
+
text: "Failed to set default view"
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
openDropdown: () => a(!0),
|
|
133
|
+
closeDropdown: () => a(!1),
|
|
134
|
+
toggleDropdown: () => a(!N)
|
|
135
|
+
},
|
|
136
|
+
create: {
|
|
137
|
+
handleCreate: async (t) => {
|
|
138
|
+
try {
|
|
139
|
+
const { viewName: i, shareOption: y, isDefault: v } = t, V = y === "company" ? s.COMPANY : s.PERSONAL, { arg: w } = I(), { data: S } = await j({
|
|
140
|
+
attributes: {
|
|
141
|
+
...w,
|
|
142
|
+
title: i,
|
|
143
|
+
shared: V.key === s.COMPANY.key
|
|
144
|
+
}
|
|
145
|
+
}), x = Y.map(($) => $.id);
|
|
146
|
+
x.push(S.id), await _({
|
|
147
|
+
user_setting_attributes: {
|
|
148
|
+
custom_view_positions: {
|
|
149
|
+
order: x
|
|
150
|
+
},
|
|
151
|
+
...v ? {
|
|
152
|
+
default_custom_view: {
|
|
153
|
+
id: Number(S.id),
|
|
154
|
+
type: r
|
|
155
|
+
}
|
|
156
|
+
} : {}
|
|
157
|
+
}
|
|
158
|
+
}), await u(), D(e.id);
|
|
159
|
+
const U = R({ view: S, canUpdateCustomViews: M });
|
|
160
|
+
d(U), l(), h(!1), o({
|
|
161
|
+
type: "success",
|
|
162
|
+
text: `New view '${w.title}' created`
|
|
163
|
+
});
|
|
164
|
+
} catch (i) {
|
|
165
|
+
console.log(i), o({
|
|
166
|
+
type: "error",
|
|
167
|
+
text: "Failed to save draft view"
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
closeCreateDropdown: () => h(!1),
|
|
172
|
+
handleSaveDraft: async () => {
|
|
173
|
+
h(!0);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
state: {
|
|
178
|
+
shouldShowDropdown: N,
|
|
179
|
+
shouldShowEditDropdown: m,
|
|
180
|
+
shouldShowCreateDropdown: k,
|
|
181
|
+
shouldShowDeleteConfirmation: A
|
|
23
182
|
}
|
|
24
|
-
|
|
25
|
-
} };
|
|
183
|
+
};
|
|
26
184
|
};
|
|
27
185
|
export {
|
|
28
|
-
|
|
186
|
+
ye as useDropdownManager
|
|
29
187
|
};
|
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 a=require("./index58.cjs"),u=require("./index57.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/index53.js
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { useViews as a } from "./index58.js";
|
|
2
|
+
import { useStores as f } from "./index57.js";
|
|
3
|
+
const d = () => {
|
|
4
|
+
const { viewsMap: r } = a(), {
|
|
5
|
+
Filters: { activeViewId: i, initFiltersFromView: o, updateUrl: s },
|
|
6
|
+
Views: { addDraftView: w, draftViewsMap: n }
|
|
7
|
+
} = f();
|
|
8
|
+
return { duplicateView: () => {
|
|
9
|
+
if (!i)
|
|
10
|
+
throw Error("Creating views from all is not supported...implement me");
|
|
11
|
+
if (r.has(i)) {
|
|
12
|
+
const e = r.get(i);
|
|
13
|
+
if (!e)
|
|
14
|
+
throw Error("Could not find view in viewsMap");
|
|
15
|
+
const t = w({ ...e });
|
|
16
|
+
o(t);
|
|
17
|
+
} else {
|
|
18
|
+
const e = n.get(i);
|
|
19
|
+
if (!e)
|
|
20
|
+
throw Error("Could not find view in draftViewsMap");
|
|
21
|
+
const t = w({ ...e });
|
|
22
|
+
o(t);
|
|
23
|
+
}
|
|
24
|
+
s();
|
|
25
|
+
} };
|
|
24
26
|
};
|
|
25
27
|
export {
|
|
26
|
-
|
|
28
|
+
d as useDuplicateActiveView
|
|
27
29
|
};
|
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 i=require("react"),u=require("./index68.cjs"),l=require("./index69.cjs"),a=require("swr/immutable"),F=require("./index57.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/index54.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 "./index68.js";
|
|
3
|
+
import { getFetcherFunction as p } from "./index69.js";
|
|
4
|
+
import l from "swr/immutable";
|
|
5
|
+
import { useStores as f } from "./index57.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/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 u=require("react"),l=require("./index68.cjs"),F=require("./index69.cjs"),f=require("swr/immutable"),h=require("./index57.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;
|