@ynput/ayon-frontend-shared 0.6.8 → 0.7.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/ContextMenu.es.js +44 -27
- package/dist/DetailsPanel.es.js +225 -224
- package/dist/Feed.es.js +64 -58
- package/dist/ListTable.es.js +423 -423
- package/dist/NewEntity.es.js +44 -43
- package/dist/ProjectTreeTable.es.js +3517 -3378
- package/dist/Slicer.es.js +301 -276
- package/dist/Views.es.js +366 -352
- package/dist/api.es.js +428 -413
- package/dist/chunks/Actions.es.js +18 -17
- package/dist/chunks/ColumnDropIndicator.es.js +21 -20
- package/dist/chunks/ColumnHeaderMenuUI.es.js +2 -2
- package/dist/chunks/ContextMenuContextInstance.es.js +4 -3
- package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +53 -41
- package/dist/chunks/DetailsDialog.es.js +26 -24
- package/dist/chunks/EmptyPlaceholder.es.js +3 -3
- package/dist/chunks/EmptyPlaceholderFlex.styled.es.js +40 -0
- package/dist/chunks/EntityPath.es.js +60 -59
- package/dist/chunks/EntityPickerDialog.es.js +88 -83
- package/dist/chunks/EntityTooltip.es.js +15 -14
- package/dist/chunks/EntityUpdatesContext.es.js +11 -11
- package/dist/chunks/Feed.es.js +1072 -1088
- package/dist/chunks/FilterErrorActions.es.js +4 -3
- package/dist/chunks/Menu.es.js +633 -289
- package/dist/chunks/MenuContext.es.js +1 -1
- package/dist/chunks/MetaWidget.es.js +2449 -2199
- package/dist/chunks/PlayableIcon.es.js +128 -88
- package/dist/chunks/ProjectContext.es.js +6 -6
- package/dist/chunks/RepresentationsList.es.js +1 -1
- package/dist/chunks/ReviewablesSelector.es.js +627 -611
- package/dist/chunks/SimpleForm.es.js +11 -10
- package/dist/chunks/SimpleTable.es.js +386 -363
- package/dist/chunks/Slicer.es.js +956 -823
- package/dist/chunks/{DeleteEntitiesContextInstance.es.js → TableExportContextInstance.es.js} +190 -186
- package/dist/chunks/TableSettingsFallback.es.js +4 -3
- package/dist/chunks/ThumbnailSimple.es.js +100 -99
- package/dist/chunks/VideoPlayer.es.js +1 -1
- package/dist/chunks/Watchers.es.js +224 -223
- package/dist/chunks/getBundleMode.es.js +33 -25
- package/dist/chunks/getEntityTypeIcon.es.js +5 -4
- package/dist/chunks/getUris.es.js +3873 -3736
- package/dist/chunks/realtimeUpdatesUtils.es.js +91 -82
- package/dist/chunks/searchTerms.es.js +621 -499
- package/dist/chunks/sortLists.es.js +22 -0
- package/dist/chunks/useAttributeEnums.es.js +43 -43
- package/dist/chunks/useDateRangeFilter.es.js +85 -59
- package/dist/chunks/useHierarchySelection.es.js +6 -5
- package/dist/chunks/useLoadModule.es.js +24 -23
- package/dist/chunks/viewUpdateHelper.es.js +41 -40
- package/dist/components.es.js +963 -891
- package/dist/context.es.js +528 -501
- package/dist/hooks.es.js +15 -15
- package/dist/index.es.js +6 -6
- package/dist/types/ContextMenu.d.ts +4 -1
- package/dist/types/Feed.d.ts +55 -1
- package/dist/types/ListTable.d.ts +1 -1
- package/dist/types/ProjectTreeTable.d.ts +128 -15
- package/dist/types/SimpleTable.d.ts +2 -1
- package/dist/types/Slicer.d.ts +26 -1
- package/dist/types/Views.d.ts +2 -0
- package/dist/types/api.d.ts +2359 -590
- package/dist/types/components.d.ts +542 -4
- package/dist/types/context.d.ts +94 -2
- package/dist/types/util.d.ts +58 -0
- package/dist/util.es.js +141 -129
- package/package.json +2 -2
- package/dist/chunks/MenuItem.es.js +0 -420
package/dist/chunks/Slicer.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as E, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Splitter as
|
|
4
|
-
import
|
|
5
|
-
import { h as
|
|
1
|
+
import { jsx as E, jsxs as H, Fragment as _e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as z, useCallback as N, useMemo as M, useContext as pt, useEffect as se, forwardRef as ft, useRef as Ie, useId as mt, useImperativeHandle as ht, useLayoutEffect as we } from "react";
|
|
3
|
+
import { Splitter as gt, SplitterPanel as yt } from "primereact/splitter";
|
|
4
|
+
import U from "styled-components";
|
|
5
|
+
import { h as bt, P as St, d as Me, U as Ye } from "./MetaWidget.es.js";
|
|
6
6
|
import "@module-federation/enhanced/runtime";
|
|
7
|
-
import { toast as
|
|
8
|
-
import { InputText as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { toast as $e } from "react-toastify";
|
|
8
|
+
import { InputText as Tt, Button as vt, Icon as It } from "@ynput/ayon-react-components";
|
|
9
|
+
import { bt as ze, bD as xt, bB as Qe, bA as Ct, bG as Lt } from "./searchTerms.es.js";
|
|
10
|
+
import { du as Je, cN as wt, bY as Et, bC as Dt } from "./getUris.es.js";
|
|
11
11
|
import "primereact/confirmdialog";
|
|
12
|
-
import { p as
|
|
12
|
+
import { p as Xe, y as Pe, x as me, d as Rt, a as Oe, o as kt, a7 as At, a6 as _t, u as Ze, ae as Mt } from "./TableExportContextInstance.es.js";
|
|
13
13
|
import "lodash";
|
|
14
14
|
import "uuid";
|
|
15
15
|
import "semver";
|
|
@@ -17,423 +17,498 @@ import "./ContextMenuContextInstance.es.js";
|
|
|
17
17
|
import W from "clsx";
|
|
18
18
|
import "react-dom";
|
|
19
19
|
import "react-redux";
|
|
20
|
-
import
|
|
20
|
+
import "react-router-dom";
|
|
21
|
+
import { E as Pt, u as Ot } from "./EntityPickerDialog.es.js";
|
|
21
22
|
import "./PlayableIcon.es.js";
|
|
22
23
|
import "date-fns";
|
|
23
24
|
import "lexical";
|
|
24
25
|
import "@lexical/markdown";
|
|
25
|
-
import "@lexical/react/LexicalBlockWithAlignableContents";
|
|
26
|
-
import "@lexical/react/LexicalDecoratorBlockNode";
|
|
27
26
|
import "match-sorter";
|
|
28
27
|
import "@lexical/code";
|
|
29
28
|
import "@lexical/list";
|
|
30
29
|
import "@lexical/rich-text";
|
|
31
30
|
import "@lexical/selection";
|
|
32
31
|
import "@lexical/utils";
|
|
32
|
+
import "@lexical/react/LexicalBlockWithAlignableContents";
|
|
33
|
+
import "@lexical/react/LexicalDecoratorBlockNode";
|
|
33
34
|
import "@tanstack/react-table";
|
|
34
|
-
import { b as
|
|
35
|
-
import {
|
|
36
|
-
import { g as
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import { u as
|
|
43
|
-
import {
|
|
44
|
-
import "./
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
import { b as pe, H as Nt, a as Ft, e as jt, S as $t } from "./SimpleTable.es.js";
|
|
36
|
+
import { D as zt, L as Ut, s as Vt } from "./sortLists.es.js";
|
|
37
|
+
import { a as Ue, g as Ee } from "./getEntityTypeIcon.es.js";
|
|
38
|
+
import { g as Bt } from "./iconUtils.es.js";
|
|
39
|
+
import { u as Ht, a as Gt } from "./useAttributeEnums.es.js";
|
|
40
|
+
import { b as Wt, s as Kt } from "./buildHierarchicalTableRows.es.js";
|
|
41
|
+
import { n as Te } from "./entityDefinitions.es.js";
|
|
42
|
+
import { a as qt, K as Yt } from "./platform.es.js";
|
|
43
|
+
import { u as Qt } from "./NewEntityContextInstance.es.js";
|
|
44
|
+
import { u as Jt } from "./VersionUploadContextInstance.es.js";
|
|
45
|
+
import { F as Ve } from "./EntityUpdatesContext.es.js";
|
|
46
|
+
import { M as Xt, a as Zt } from "./Menu.es.js";
|
|
47
|
+
const et = "default", ve = { id: "label", label: "Name", desc: !1 }, De = (e) => ({
|
|
48
|
+
id: et,
|
|
49
|
+
label: e,
|
|
50
|
+
desc: !1
|
|
51
|
+
}), en = ["hierarchy", "assignees", "author"], tn = ["status", "type", "taskType", "folderType"], Ne = (e) => en.includes(e) ? [ve] : e === "entityList" ? Ut : e.startsWith("attrib.") ? [De("Attribute order"), ve] : tn.includes(e) ? [De("Anatomy order"), ve] : [De("Default order"), ve], tt = (e) => {
|
|
52
|
+
if (e === "entityList") return zt;
|
|
53
|
+
const [t] = Ne(e);
|
|
54
|
+
return { by: t.id, desc: t.desc };
|
|
55
|
+
}, Ns = (e, t) => {
|
|
56
|
+
const { by: n, desc: s } = t || {};
|
|
57
|
+
return Ne(e).some((d) => d.id === n) ? { by: n, desc: !!s } : tt(e);
|
|
58
|
+
}, nn = ["noValue", "hasValue"], sn = (e) => e.id.startsWith("folder-"), an = new Intl.Collator(void 0, { sensitivity: "base", numeric: !0 }), Re = (e) => e.label || e.name || "", nt = (e, t, { by: n, desc: s }) => {
|
|
59
|
+
const d = (l) => nn.includes(l.id) || t === "entityList" && sn(l), c = e.filter(d), p = e.filter((l) => !d(l));
|
|
60
|
+
let h;
|
|
61
|
+
if (t === "entityList")
|
|
62
|
+
h = Vt(
|
|
63
|
+
p.map((l) => ({
|
|
64
|
+
row: l,
|
|
65
|
+
label: Re(l),
|
|
66
|
+
active: l.data?.active ?? !0,
|
|
67
|
+
createdAt: l.data?.createdAt,
|
|
68
|
+
updatedAt: l.data?.updatedAt
|
|
69
|
+
})),
|
|
70
|
+
{ by: n, desc: s }
|
|
71
|
+
).map(({ row: l }) => l);
|
|
72
|
+
else if (n === et)
|
|
73
|
+
h = s ? [...p].reverse() : p;
|
|
74
|
+
else {
|
|
75
|
+
const l = s ? -1 : 1;
|
|
76
|
+
h = [...p].sort(
|
|
77
|
+
(f, y) => an.compare(Re(f), Re(y)) * l
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
return [...c, ...h].map(
|
|
81
|
+
(l) => l.subRows?.length ? { ...l, subRows: nt(l.subRows, t, { by: n, desc: s }) } : l
|
|
82
|
+
);
|
|
83
|
+
}, on = (e, t, n) => {
|
|
84
|
+
const s = tt(t);
|
|
85
|
+
return n.by !== "label" && n.by === s.by && n.desc === s.desc ? e : nt(e, t, n);
|
|
86
|
+
}, rn = ({
|
|
87
|
+
options: e,
|
|
88
|
+
sort: t,
|
|
89
|
+
onChange: n,
|
|
90
|
+
id: s = "sort",
|
|
91
|
+
label: d = "Sort",
|
|
92
|
+
icon: c = "sort"
|
|
93
|
+
}) => ({
|
|
94
|
+
id: s,
|
|
95
|
+
label: d,
|
|
96
|
+
icon: c,
|
|
97
|
+
items: e.map((p) => {
|
|
98
|
+
const h = t.by === p.id;
|
|
99
|
+
return {
|
|
100
|
+
id: `${s}-${p.id}`,
|
|
101
|
+
label: p.label,
|
|
102
|
+
onClick: () => n({ by: p.id, desc: p.desc }),
|
|
103
|
+
selected: h,
|
|
104
|
+
endActions: h ? [
|
|
105
|
+
{
|
|
106
|
+
icon: t.desc ? "arrow_downward" : "arrow_upward",
|
|
107
|
+
tooltip: t.desc ? "Descending" : "Ascending",
|
|
108
|
+
onClick: () => n({ ...t, desc: !t.desc })
|
|
109
|
+
}
|
|
110
|
+
] : void 0
|
|
111
|
+
};
|
|
112
|
+
})
|
|
113
|
+
}), ln = 180, st = 100, at = 34, cn = (e, t = [], n = st) => e.map((s) => t.includes(s) ? at : n), dn = (e, t, n, s) => {
|
|
114
|
+
const d = e.reduce((f, y) => f + y, 0), c = s.filter(Boolean).length;
|
|
115
|
+
if (!c || d === n) return e;
|
|
116
|
+
if (d < n) {
|
|
117
|
+
const f = (n - d) / c;
|
|
118
|
+
return e.map((y, C) => s[C] ? y + f : y);
|
|
51
119
|
}
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
54
|
-
const
|
|
55
|
-
return e.map((
|
|
56
|
-
},
|
|
120
|
+
const p = e.map((f, y) => s[y] ? f - t[y] : 0), h = p.reduce((f, y) => f + y, 0);
|
|
121
|
+
if (!h) return e;
|
|
122
|
+
const l = d - n;
|
|
123
|
+
return e.map((f, y) => f - l * (p[y] / h));
|
|
124
|
+
}, un = (e, t, n = [], s = 0, d = ln) => {
|
|
57
125
|
if (!t.length)
|
|
58
|
-
return { heights: [], mins: [], sizes: [], minSize: 2, height:
|
|
59
|
-
const
|
|
60
|
-
|
|
126
|
+
return { heights: [], mins: [], sizes: [], minSize: 2, height: s };
|
|
127
|
+
const c = t.filter((S) => !n.includes(S)).length, p = (t.length - c) * at, h = s && c ? Math.min(
|
|
128
|
+
d,
|
|
61
129
|
Math.max(
|
|
62
|
-
|
|
63
|
-
Math.floor((
|
|
130
|
+
st,
|
|
131
|
+
Math.floor((s - p) / c)
|
|
64
132
|
)
|
|
65
|
-
) :
|
|
66
|
-
(
|
|
67
|
-
),
|
|
133
|
+
) : d, l = cn(t, n), f = t.map(
|
|
134
|
+
(S, r) => n.includes(S) ? l[r] : Math.max(e[S] ?? h, l[r])
|
|
135
|
+
), y = t.map((S) => !n.includes(S)), C = l.reduce((S, r) => S + r, 0), m = y.some(Boolean) ? Math.max(s, C) : C, g = dn(f, l, m, y);
|
|
68
136
|
return {
|
|
69
|
-
heights:
|
|
70
|
-
mins:
|
|
71
|
-
sizes:
|
|
137
|
+
heights: g,
|
|
138
|
+
mins: l,
|
|
139
|
+
sizes: g.map((S) => S / m * 100),
|
|
72
140
|
// primereact must allow the drag past the min; clampDraggedHeights puts it back
|
|
73
141
|
minSize: 2,
|
|
74
|
-
height:
|
|
142
|
+
height: m
|
|
75
143
|
};
|
|
76
|
-
},
|
|
77
|
-
const
|
|
144
|
+
}, pn = (e, t, n) => {
|
|
145
|
+
const s = e.map((l, f) => Math.max(l / 100 * t, n[f])), d = Math.max(
|
|
78
146
|
t,
|
|
79
|
-
|
|
80
|
-
),
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
return
|
|
84
|
-
},
|
|
147
|
+
n.reduce((l, f) => l + f, 0)
|
|
148
|
+
), c = s.reduce((l, f) => l + f, 0) - d;
|
|
149
|
+
if (c <= 0) return s;
|
|
150
|
+
const p = s.map((l, f) => l - n[f]), h = p.reduce((l, f) => l + f, 0);
|
|
151
|
+
return h ? s.map((l, f) => l - c * (p[f] / h)) : s;
|
|
152
|
+
}, fn = "slicer-splitter", Be = {
|
|
85
153
|
minSize: 2,
|
|
86
154
|
size: 12
|
|
87
|
-
},
|
|
88
|
-
const [e, t] =
|
|
89
|
-
|
|
90
|
-
100 -
|
|
155
|
+
}, Fs = () => {
|
|
156
|
+
const [e, t] = Xe(fn, [
|
|
157
|
+
Be.size,
|
|
158
|
+
100 - Be.size
|
|
91
159
|
]);
|
|
92
|
-
return [e, (
|
|
93
|
-
t(
|
|
160
|
+
return [e, (s) => {
|
|
161
|
+
t(s.sizes);
|
|
94
162
|
}];
|
|
95
|
-
},
|
|
96
|
-
const [
|
|
163
|
+
}, mn = (e, t, n = [], s = 0) => {
|
|
164
|
+
const [d, c] = Xe(
|
|
97
165
|
`slicer-panel-heights-${e}`,
|
|
98
166
|
{}
|
|
99
|
-
), [
|
|
100
|
-
sizes:
|
|
101
|
-
mins:
|
|
102
|
-
minSize:
|
|
103
|
-
height:
|
|
104
|
-
heights:
|
|
105
|
-
} =
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
...
|
|
167
|
+
), [p, h] = z(0), l = Array.isArray(d) ? {} : d, {
|
|
168
|
+
sizes: f,
|
|
169
|
+
mins: y,
|
|
170
|
+
minSize: C,
|
|
171
|
+
height: m,
|
|
172
|
+
heights: g
|
|
173
|
+
} = un(l, t, n, s), S = (r) => {
|
|
174
|
+
const u = pn(r.sizes, m, y);
|
|
175
|
+
c({
|
|
176
|
+
...l,
|
|
109
177
|
...Object.fromEntries(
|
|
110
|
-
t.map((
|
|
178
|
+
t.map((i, b) => [i, u[b]]).filter(([i]) => !n.includes(i))
|
|
111
179
|
)
|
|
112
|
-
}),
|
|
113
|
-
(
|
|
114
|
-
) &&
|
|
180
|
+
}), u.some(
|
|
181
|
+
(i, b) => Math.abs(i - r.sizes[b] / 100 * m) > 1
|
|
182
|
+
) && h((i) => i + 1);
|
|
115
183
|
};
|
|
116
184
|
return {
|
|
117
|
-
sizes:
|
|
118
|
-
minSize:
|
|
119
|
-
height:
|
|
120
|
-
panelHeights:
|
|
121
|
-
layoutKey: `${t.join("|")}#${
|
|
122
|
-
handleResizeEnd:
|
|
185
|
+
sizes: f,
|
|
186
|
+
minSize: C,
|
|
187
|
+
height: m,
|
|
188
|
+
panelHeights: g,
|
|
189
|
+
layoutKey: `${t.join("|")}#${n.join("|")}#${p}`,
|
|
190
|
+
handleResizeEnd: S
|
|
123
191
|
};
|
|
124
|
-
},
|
|
192
|
+
}, hn = ({
|
|
125
193
|
projectName: e,
|
|
126
194
|
movingEntities: t,
|
|
127
|
-
onClose:
|
|
128
|
-
onMoveComplete:
|
|
195
|
+
onClose: n,
|
|
196
|
+
onMoveComplete: s
|
|
129
197
|
}) => {
|
|
130
|
-
const [
|
|
131
|
-
(
|
|
132
|
-
[
|
|
133
|
-
),
|
|
134
|
-
async (
|
|
135
|
-
if (!t ||
|
|
136
|
-
const
|
|
198
|
+
const [d] = Je(), c = bt(), { folders: p } = Pe(), h = c?.tableData || [], l = N(
|
|
199
|
+
(S) => c?.getEntityById(S) || p.find((r) => r.id === S),
|
|
200
|
+
[p, c]
|
|
201
|
+
), f = N(
|
|
202
|
+
async (S) => {
|
|
203
|
+
if (!t || S.length === 0) return;
|
|
204
|
+
const r = S[0];
|
|
137
205
|
try {
|
|
138
|
-
const
|
|
139
|
-
(
|
|
140
|
-
id: `move-${
|
|
206
|
+
const u = t.entities.map(
|
|
207
|
+
(b, a) => ({
|
|
208
|
+
id: `move-${b.entityId}-${Date.now()}-${a}`,
|
|
141
209
|
type: "update",
|
|
142
|
-
entityType:
|
|
143
|
-
entityId:
|
|
144
|
-
data:
|
|
210
|
+
entityType: b.entityType,
|
|
211
|
+
entityId: b.entityId,
|
|
212
|
+
data: b.entityType === "folder" ? { parentId: r } : { folderId: r }
|
|
145
213
|
})
|
|
146
|
-
),
|
|
214
|
+
), i = (await d({
|
|
147
215
|
projectName: e,
|
|
148
216
|
operationsRequestModel: {
|
|
149
|
-
operations:
|
|
217
|
+
operations: u
|
|
150
218
|
}
|
|
151
|
-
}).unwrap())?.operations?.filter((
|
|
152
|
-
if (
|
|
153
|
-
const
|
|
154
|
-
throw new Error(
|
|
219
|
+
}).unwrap())?.operations?.filter((b) => b.success === !1) || [];
|
|
220
|
+
if (i.length > 0) {
|
|
221
|
+
const b = i.map((a) => a.detail).join(", ");
|
|
222
|
+
throw new Error(b || "Some move operations failed");
|
|
155
223
|
}
|
|
156
|
-
|
|
157
|
-
} catch (
|
|
158
|
-
let
|
|
159
|
-
if (
|
|
224
|
+
s?.(r);
|
|
225
|
+
} catch (u) {
|
|
226
|
+
let o = ze(u) || "Failed to move entities";
|
|
227
|
+
if (o.includes("already exists"))
|
|
160
228
|
if (t.entities.length > 1)
|
|
161
|
-
|
|
229
|
+
o = "Cannot move some entities - one or more entities with the same name already exist in the target location";
|
|
162
230
|
else if (t.entities[0].entityType === "task") {
|
|
163
|
-
const
|
|
164
|
-
|
|
231
|
+
const b = o.match(/name '.*?, (.+?)' already exists/);
|
|
232
|
+
o = `Cannot move "${b ? b[1] : "this task"}" - a task with this name already exists in the target folder`;
|
|
165
233
|
} else {
|
|
166
|
-
const
|
|
167
|
-
|
|
234
|
+
const b = o.match(/name '.*?, (.+?)' already exists/);
|
|
235
|
+
o = `Cannot move "${b ? b[1] : "this folder"}" - a folder with this name already exists in the target location`;
|
|
168
236
|
}
|
|
169
|
-
|
|
237
|
+
$e.error(o);
|
|
170
238
|
} finally {
|
|
171
|
-
|
|
239
|
+
n();
|
|
172
240
|
}
|
|
173
241
|
},
|
|
174
|
-
[t, e,
|
|
175
|
-
),
|
|
242
|
+
[t, e, d, n, s]
|
|
243
|
+
), y = N(async () => {
|
|
176
244
|
if (t)
|
|
177
245
|
try {
|
|
178
|
-
const
|
|
179
|
-
(
|
|
180
|
-
id: `move-to-root-${
|
|
246
|
+
const S = t.entities.map(
|
|
247
|
+
(o, i) => ({
|
|
248
|
+
id: `move-to-root-${o.entityId}-${Date.now()}-${i}`,
|
|
181
249
|
type: "update",
|
|
182
|
-
entityType:
|
|
183
|
-
entityId:
|
|
184
|
-
data:
|
|
250
|
+
entityType: o.entityType,
|
|
251
|
+
entityId: o.entityId,
|
|
252
|
+
data: o.entityType === "folder" ? { parentId: null } : { folderId: null }
|
|
185
253
|
})
|
|
186
|
-
),
|
|
254
|
+
), u = (await d({
|
|
187
255
|
projectName: e,
|
|
188
256
|
operationsRequestModel: {
|
|
189
|
-
operations:
|
|
257
|
+
operations: S
|
|
190
258
|
}
|
|
191
|
-
}).unwrap())?.operations?.filter((
|
|
192
|
-
if (
|
|
193
|
-
const
|
|
194
|
-
throw new Error(
|
|
259
|
+
}).unwrap())?.operations?.filter((o) => o.success === !1) || [];
|
|
260
|
+
if (u.length > 0) {
|
|
261
|
+
const o = u.map((i) => i.detail).join(", ");
|
|
262
|
+
throw new Error(o || "Some move operations failed");
|
|
195
263
|
}
|
|
196
|
-
} catch (
|
|
197
|
-
let
|
|
198
|
-
|
|
264
|
+
} catch (S) {
|
|
265
|
+
let r = ze(S) || "Failed to move entities to root";
|
|
266
|
+
$e.error(r);
|
|
199
267
|
} finally {
|
|
200
|
-
|
|
268
|
+
n();
|
|
201
269
|
}
|
|
202
|
-
}, [t, e,
|
|
270
|
+
}, [t, e, d, n]), C = N(() => {
|
|
203
271
|
if (!t) return [];
|
|
204
|
-
const
|
|
205
|
-
return t.entities.forEach((
|
|
206
|
-
|
|
207
|
-
}),
|
|
208
|
-
t.entities.some((
|
|
209
|
-
const
|
|
210
|
-
return
|
|
211
|
-
(
|
|
272
|
+
const S = [];
|
|
273
|
+
return t.entities.forEach((r) => {
|
|
274
|
+
S.push(r.entityId);
|
|
275
|
+
}), p.forEach((r) => {
|
|
276
|
+
t.entities.some((o) => {
|
|
277
|
+
const i = l(o.entityId);
|
|
278
|
+
return i?.name ? h.filter((a) => o.entityType === "folder" ? a.entityType === "folder" && a.parentId === r.id : o.entityType === "task" ? a.entityType === "task" && a.folderId === r.id : !1).some(
|
|
279
|
+
(a) => a.name === i.name && a.entityId !== o.entityId
|
|
212
280
|
) : !1;
|
|
213
|
-
}) &&
|
|
214
|
-
}), [...new Set(
|
|
215
|
-
}, [t,
|
|
216
|
-
(
|
|
281
|
+
}) && S.push(r.id);
|
|
282
|
+
}), [...new Set(S)];
|
|
283
|
+
}, [t, p, h, l]), m = N(
|
|
284
|
+
(S) => {
|
|
217
285
|
if (!t) return;
|
|
218
286
|
if (t.entities.some(
|
|
219
|
-
(
|
|
287
|
+
(b) => b.entityType === "folder" && b.entityId === S
|
|
220
288
|
))
|
|
221
289
|
return "Cannot move folder to itself";
|
|
222
290
|
if (t.entities.some(
|
|
223
|
-
(
|
|
291
|
+
(b) => b.currentParentId === S
|
|
224
292
|
))
|
|
225
293
|
return "Cannot move to the same location";
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
229
|
-
const x =
|
|
230
|
-
return x?.name ?
|
|
231
|
-
(v) => v.name === x.name && v.entityId !==
|
|
294
|
+
const o = p.find((b) => b.id === S);
|
|
295
|
+
if (o) {
|
|
296
|
+
const b = t.entities.find((a) => {
|
|
297
|
+
const x = l(a.entityId);
|
|
298
|
+
return x?.name ? h.filter((v) => a.entityType === "folder" ? v.entityType === "folder" && v.parentId === o.id : a.entityType === "task" ? v.entityType === "task" && v.folderId === o.id : !1).some(
|
|
299
|
+
(v) => v.name === x.name && v.entityId !== a.entityId
|
|
232
300
|
) : !1;
|
|
233
301
|
});
|
|
234
|
-
if (
|
|
235
|
-
return `Cannot move "${
|
|
302
|
+
if (b)
|
|
303
|
+
return `Cannot move "${l(b.entityId)?.name || "Entity"}" - an entity with the same name already exists in this folder`;
|
|
236
304
|
}
|
|
237
305
|
return t.entities.some(
|
|
238
|
-
(
|
|
306
|
+
(b) => b.entityType === "folder"
|
|
239
307
|
) ? "Cannot move folder to its child" : "Cannot move to this location";
|
|
240
308
|
},
|
|
241
|
-
[t,
|
|
242
|
-
),
|
|
309
|
+
[t, p, h, l]
|
|
310
|
+
), g = M(() => t?.entities.every((S) => S.entityType === "folder") || !1, [t]);
|
|
243
311
|
return {
|
|
244
|
-
handleMoveSubmit:
|
|
245
|
-
handleMoveToRoot:
|
|
246
|
-
getDisabledFolderIds:
|
|
247
|
-
getDisabledMessage:
|
|
248
|
-
canMoveToRoot:
|
|
312
|
+
handleMoveSubmit: f,
|
|
313
|
+
handleMoveToRoot: y,
|
|
314
|
+
getDisabledFolderIds: C,
|
|
315
|
+
getDisabledMessage: m,
|
|
316
|
+
canMoveToRoot: g
|
|
249
317
|
};
|
|
250
|
-
},
|
|
318
|
+
}, gn = ({
|
|
251
319
|
projectName: e,
|
|
252
320
|
movingEntities: t,
|
|
253
|
-
onClose:
|
|
254
|
-
onMoveComplete:
|
|
321
|
+
onClose: n,
|
|
322
|
+
onMoveComplete: s
|
|
255
323
|
}) => {
|
|
256
|
-
const { handleMoveSubmit:
|
|
324
|
+
const { handleMoveSubmit: d, handleMoveToRoot: c, getDisabledFolderIds: p, getDisabledMessage: h } = hn({
|
|
257
325
|
projectName: e,
|
|
258
326
|
movingEntities: t ?? null,
|
|
259
|
-
onClose:
|
|
260
|
-
onMoveComplete:
|
|
327
|
+
onClose: n,
|
|
328
|
+
onMoveComplete: s
|
|
261
329
|
});
|
|
262
330
|
return t?.entities.length ? /* @__PURE__ */ E(
|
|
263
|
-
|
|
331
|
+
Pt,
|
|
264
332
|
{
|
|
265
333
|
projectName: e,
|
|
266
334
|
entityType: "folder",
|
|
267
|
-
onSubmit:
|
|
268
|
-
onClose:
|
|
335
|
+
onSubmit: d,
|
|
336
|
+
onClose: n,
|
|
269
337
|
showMoveToRoot: t.entities.every(
|
|
270
|
-
(
|
|
338
|
+
(l) => l.entityType === "folder"
|
|
271
339
|
),
|
|
272
|
-
onMoveToRoot:
|
|
273
|
-
disabledIds:
|
|
274
|
-
getDisabledMessage:
|
|
340
|
+
onMoveToRoot: c,
|
|
341
|
+
disabledIds: p(),
|
|
342
|
+
getDisabledMessage: h
|
|
275
343
|
}
|
|
276
344
|
) : null;
|
|
277
|
-
},
|
|
278
|
-
const [
|
|
345
|
+
}, yn = ({ projectName: e, useExtraSlices: t }) => {
|
|
346
|
+
const [n, { isLoading: s, isFetching: d }] = wt(), { formatAssignees: c } = t();
|
|
279
347
|
return {
|
|
280
348
|
getData: async () => {
|
|
281
|
-
const
|
|
282
|
-
return
|
|
349
|
+
const h = await n({ projectName: e || "" }, !0).unwrap();
|
|
350
|
+
return c(h);
|
|
283
351
|
},
|
|
284
|
-
isLoading:
|
|
352
|
+
isLoading: s || d
|
|
285
353
|
};
|
|
286
|
-
},
|
|
287
|
-
const { isLoading:
|
|
288
|
-
return { project:
|
|
289
|
-
(
|
|
290
|
-
) : void 0, isLoading:
|
|
291
|
-
},
|
|
354
|
+
}, bn = ({ scopes: e, useExtraSlices: t }) => {
|
|
355
|
+
const { isLoading: n, productTypes: s, ...d } = me(), { formatStatuses: c, formatTaskTypes: p, formatProductTypes: h, formatTypes: l, formatAttribute: f } = t();
|
|
356
|
+
return { project: d, getStatuses: async () => c(d, e), getTypes: async () => l(d), getTaskTypes: async () => p(d), getProductTypes: async () => h(s), getAttribute: async (r) => f ? f(r).map(
|
|
357
|
+
(u) => xt(u.icon ?? void 0) ? { ...u, icon: void 0, img: u.icon, imgShape: "circle" } : u
|
|
358
|
+
) : void 0, isLoading: n };
|
|
359
|
+
}, Sn = ({ entityTypes: e, request: t }) => {
|
|
292
360
|
const {
|
|
293
|
-
attributes:
|
|
294
|
-
isLoading: { siteInfo:
|
|
295
|
-
} =
|
|
296
|
-
return { attributes:
|
|
297
|
-
(
|
|
298
|
-
), isLoading:
|
|
299
|
-
},
|
|
300
|
-
if (t.active && !
|
|
301
|
-
if (!t.active &&
|
|
302
|
-
const
|
|
303
|
-
return new Date(
|
|
304
|
-
}),
|
|
305
|
-
const { projectName: t } =
|
|
306
|
-
data:
|
|
307
|
-
isLoading:
|
|
308
|
-
isFetching:
|
|
309
|
-
} =
|
|
361
|
+
attributes: n,
|
|
362
|
+
isLoading: { siteInfo: s }
|
|
363
|
+
} = Rt(), d = pt(St), c = d?.attribFields?.length ? d.attribFields : n, { projectName: p } = me();
|
|
364
|
+
return { attributes: Ht(c, { projectName: p, request: t ?? [] }).filter((f) => Qe(f.data)).filter((f) => e.some((y) => f.scope?.includes(y))).map(
|
|
365
|
+
(f) => f.data.enum?.some((y) => y.hidden) ? { ...f, data: { ...f.data, enum: Ct(f.data.enum) } } : f
|
|
366
|
+
), isLoading: s };
|
|
367
|
+
}, Tn = "snippet_folder", fe = "folder", vn = (e) => `${fe}-${e}`, ke = (e) => [...e].sort((t, n) => {
|
|
368
|
+
if (t.active && !n.active) return -1;
|
|
369
|
+
if (!t.active && n.active) return 1;
|
|
370
|
+
const s = new Date(t.createdAt || 0);
|
|
371
|
+
return new Date(n.createdAt || 0).getTime() - s.getTime();
|
|
372
|
+
}), In = (e = !0) => {
|
|
373
|
+
const { projectName: t } = me(), { powerLicense: n } = Oe(), {
|
|
374
|
+
data: s,
|
|
375
|
+
isLoading: d,
|
|
376
|
+
isFetching: c
|
|
377
|
+
} = Et(
|
|
310
378
|
{ projectName: t || "" },
|
|
311
379
|
{
|
|
312
380
|
initialPageParam: { cursor: "" },
|
|
313
381
|
skip: !t || !e
|
|
314
382
|
}
|
|
315
|
-
), { data:
|
|
383
|
+
), { data: p = [], isLoading: h } = Dt(
|
|
316
384
|
{ projectName: t || "" },
|
|
317
|
-
{ skip: !t || !
|
|
318
|
-
),
|
|
319
|
-
if (!
|
|
320
|
-
const
|
|
321
|
-
if (
|
|
322
|
-
const
|
|
323
|
-
for (const
|
|
324
|
-
|
|
325
|
-
id:
|
|
326
|
-
folder:
|
|
385
|
+
{ skip: !t || !n || !e }
|
|
386
|
+
), l = M(() => {
|
|
387
|
+
if (!s?.pages) return [];
|
|
388
|
+
const C = s.pages.flatMap((m) => m.lists);
|
|
389
|
+
if (n && p.length > 0) {
|
|
390
|
+
const m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Set();
|
|
391
|
+
for (const a of p)
|
|
392
|
+
m.set(a.id, {
|
|
393
|
+
id: a.id,
|
|
394
|
+
folder: a,
|
|
327
395
|
children: /* @__PURE__ */ new Map(),
|
|
328
396
|
items: [],
|
|
329
397
|
hasAnyItems: !1
|
|
330
|
-
}),
|
|
331
|
-
for (const
|
|
332
|
-
if (
|
|
333
|
-
const x =
|
|
334
|
-
x.children.set(
|
|
398
|
+
}), a.parentId || g.add(a.id);
|
|
399
|
+
for (const a of p)
|
|
400
|
+
if (a.parentId && m.has(a.parentId)) {
|
|
401
|
+
const x = m.get(a.parentId), T = m.get(a.id);
|
|
402
|
+
x.children.set(a.id, T);
|
|
335
403
|
}
|
|
336
|
-
const
|
|
337
|
-
for (const
|
|
338
|
-
const x =
|
|
339
|
-
if (x &&
|
|
340
|
-
const T =
|
|
341
|
-
T.items.push(
|
|
404
|
+
const S = [];
|
|
405
|
+
for (const a of C) {
|
|
406
|
+
const x = a.entityListFolderId;
|
|
407
|
+
if (x && m.has(x)) {
|
|
408
|
+
const T = m.get(x);
|
|
409
|
+
T.items.push(a), T.hasAnyItems = !0;
|
|
342
410
|
} else
|
|
343
|
-
|
|
411
|
+
S.push(a);
|
|
344
412
|
}
|
|
345
|
-
for (const
|
|
346
|
-
if (
|
|
347
|
-
let x =
|
|
413
|
+
for (const a of m.values())
|
|
414
|
+
if (a.hasAnyItems) {
|
|
415
|
+
let x = a.folder;
|
|
348
416
|
for (; x.parentId; ) {
|
|
349
|
-
const T =
|
|
417
|
+
const T = m.get(x.parentId);
|
|
350
418
|
if (T)
|
|
351
419
|
T.hasAnyItems = !0, x = T.folder;
|
|
352
420
|
else
|
|
353
421
|
break;
|
|
354
422
|
}
|
|
355
423
|
}
|
|
356
|
-
const
|
|
357
|
-
id:
|
|
358
|
-
name:
|
|
359
|
-
label:
|
|
424
|
+
const r = (a, x, T = []) => ({
|
|
425
|
+
id: a.id,
|
|
426
|
+
name: a.label,
|
|
427
|
+
label: a.label,
|
|
360
428
|
...T.length > 0 && { parents: T },
|
|
361
|
-
icon:
|
|
429
|
+
icon: Ue(a),
|
|
362
430
|
subRows: [],
|
|
363
431
|
data: {
|
|
364
|
-
id:
|
|
365
|
-
name:
|
|
366
|
-
label:
|
|
367
|
-
entityType:
|
|
368
|
-
listId:
|
|
432
|
+
id: a.id,
|
|
433
|
+
name: a.label,
|
|
434
|
+
label: a.label,
|
|
435
|
+
entityType: a.entityType,
|
|
436
|
+
listId: a.id,
|
|
437
|
+
// for sorting
|
|
438
|
+
active: a.active,
|
|
439
|
+
createdAt: a.createdAt,
|
|
440
|
+
updatedAt: a.updatedAt
|
|
369
441
|
}
|
|
370
|
-
}),
|
|
371
|
-
const v =
|
|
442
|
+
}), u = (a) => a.sort((x, T) => {
|
|
443
|
+
const v = p.findIndex((K) => K.id === x.id), D = p.findIndex((K) => K.id === T.id);
|
|
372
444
|
return v === -1 && D === -1 ? x.folder.label.localeCompare(T.folder.label) : v === -1 ? 1 : D === -1 ? -1 : v - D;
|
|
373
|
-
}),
|
|
374
|
-
const x =
|
|
375
|
-
for (const T of
|
|
376
|
-
x.push(...
|
|
445
|
+
}), o = (a) => {
|
|
446
|
+
const x = a.items.map((T) => T.id);
|
|
447
|
+
for (const T of a.children.values())
|
|
448
|
+
x.push(...o(T));
|
|
377
449
|
return x;
|
|
378
|
-
},
|
|
379
|
-
folderNodes:
|
|
380
|
-
rootFolderIds:
|
|
450
|
+
}, i = Wt({
|
|
451
|
+
folderNodes: m,
|
|
452
|
+
rootFolderIds: g,
|
|
381
453
|
showEmptyFolders: !1,
|
|
382
|
-
buildFolderRowId:
|
|
383
|
-
createItemRow:
|
|
384
|
-
sortFolderNodes:
|
|
385
|
-
sortItems:
|
|
386
|
-
getFolderLabel: (
|
|
387
|
-
getFolderIcon: (
|
|
388
|
-
getFolderColor: (
|
|
389
|
-
getItemCount: (
|
|
454
|
+
buildFolderRowId: vn,
|
|
455
|
+
createItemRow: r,
|
|
456
|
+
sortFolderNodes: u,
|
|
457
|
+
sortItems: ke,
|
|
458
|
+
getFolderLabel: (a) => a.label,
|
|
459
|
+
getFolderIcon: (a) => a.data?.icon || Tn,
|
|
460
|
+
getFolderColor: (a) => a.data?.color,
|
|
461
|
+
getItemCount: (a) => a.items.length + Array.from(a.children.values()).reduce((x, T) => x + T.items.length, 0)
|
|
390
462
|
});
|
|
391
|
-
for (const
|
|
392
|
-
if (
|
|
393
|
-
const T =
|
|
394
|
-
v && (
|
|
463
|
+
for (const a of i) {
|
|
464
|
+
if (a.id.startsWith(fe + "-")) {
|
|
465
|
+
const T = a.id.substring((fe + "-").length), v = m.get(T);
|
|
466
|
+
v && (a.data = { ...a.data, childListIds: o(v) });
|
|
395
467
|
}
|
|
396
|
-
const x = [...
|
|
468
|
+
const x = [...a.subRows || []];
|
|
397
469
|
for (; x.length > 0; ) {
|
|
398
470
|
const T = x.shift();
|
|
399
|
-
if (T.id.startsWith(
|
|
400
|
-
const v = T.id.substring((
|
|
401
|
-
D && (T.data = { ...T.data, childListIds:
|
|
471
|
+
if (T.id.startsWith(fe + "-")) {
|
|
472
|
+
const v = T.id.substring((fe + "-").length), D = m.get(v);
|
|
473
|
+
D && (T.data = { ...T.data, childListIds: o(D) });
|
|
402
474
|
}
|
|
403
475
|
T.subRows && x.push(...T.subRows);
|
|
404
476
|
}
|
|
405
477
|
}
|
|
406
|
-
const
|
|
407
|
-
return [...
|
|
478
|
+
const b = ke(S).map((a) => r(a));
|
|
479
|
+
return [...i, ...b];
|
|
408
480
|
}
|
|
409
|
-
return
|
|
410
|
-
id:
|
|
411
|
-
name:
|
|
412
|
-
label:
|
|
413
|
-
icon:
|
|
481
|
+
return ke(C).map((m) => ({
|
|
482
|
+
id: m.id,
|
|
483
|
+
name: m.label,
|
|
484
|
+
label: m.label,
|
|
485
|
+
icon: Ue(m),
|
|
414
486
|
subRows: [],
|
|
415
487
|
data: {
|
|
416
|
-
id:
|
|
417
|
-
name:
|
|
418
|
-
label:
|
|
419
|
-
entityType:
|
|
420
|
-
listId:
|
|
488
|
+
id: m.id,
|
|
489
|
+
name: m.label,
|
|
490
|
+
label: m.label,
|
|
491
|
+
entityType: m.entityType,
|
|
492
|
+
listId: m.id,
|
|
493
|
+
active: m.active,
|
|
494
|
+
createdAt: m.createdAt,
|
|
495
|
+
updatedAt: m.updatedAt
|
|
421
496
|
}
|
|
422
497
|
}));
|
|
423
|
-
}, [
|
|
498
|
+
}, [s, n, p]), f = n && p.length > 0;
|
|
424
499
|
return {
|
|
425
|
-
getData:
|
|
426
|
-
isLoading:
|
|
427
|
-
isExpandable:
|
|
500
|
+
getData: N(async () => l, [l]),
|
|
501
|
+
isLoading: d || c || h,
|
|
502
|
+
isExpandable: f
|
|
428
503
|
};
|
|
429
|
-
},
|
|
430
|
-
const
|
|
504
|
+
}, xn = (e, t, n, s) => e.id === "noValue" ? t.get(Ye)?.count ?? (s ? 0 : void 0) : e.id === "hasValue" ? s ? n : void 0 : t.get(e.id)?.count ?? (e.name ? t.get(e.name)?.count : void 0) ?? (s ? 0 : void 0), ot = (e, t, n, s) => t ? e.map((d) => {
|
|
505
|
+
const c = xn(d, t, n, s);
|
|
431
506
|
return {
|
|
432
|
-
...
|
|
433
|
-
badge:
|
|
434
|
-
subRows:
|
|
507
|
+
...d,
|
|
508
|
+
badge: c != null ? String(c) : d.badge,
|
|
509
|
+
subRows: d.subRows?.length ? ot(d.subRows, t, n, s) : d.subRows
|
|
435
510
|
};
|
|
436
|
-
}) : e,
|
|
511
|
+
}) : e, Cn = (e) => ({
|
|
437
512
|
id: "noValue",
|
|
438
513
|
name: "noValue",
|
|
439
514
|
label: `No ${e}`,
|
|
@@ -442,7 +517,7 @@ const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.in
|
|
|
442
517
|
data: {
|
|
443
518
|
id: "noValue"
|
|
444
519
|
}
|
|
445
|
-
}),
|
|
520
|
+
}), Ln = (e) => ({
|
|
446
521
|
id: "hasValue",
|
|
447
522
|
name: "hasValue",
|
|
448
523
|
label: `Some ${e}`,
|
|
@@ -451,7 +526,7 @@ const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.in
|
|
|
451
526
|
data: {
|
|
452
527
|
id: "hasValue"
|
|
453
528
|
}
|
|
454
|
-
}),
|
|
529
|
+
}), He = [
|
|
455
530
|
{
|
|
456
531
|
label: "Hierarchy",
|
|
457
532
|
value: "hierarchy",
|
|
@@ -470,17 +545,17 @@ const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.in
|
|
|
470
545
|
{
|
|
471
546
|
label: "Task Type",
|
|
472
547
|
value: "taskType",
|
|
473
|
-
icon:
|
|
548
|
+
icon: Ee("task")
|
|
474
549
|
},
|
|
475
550
|
{
|
|
476
551
|
label: "Folder Type",
|
|
477
552
|
value: "folderType",
|
|
478
|
-
icon:
|
|
553
|
+
icon: Ee("folder")
|
|
479
554
|
},
|
|
480
555
|
{
|
|
481
556
|
label: "Product Type",
|
|
482
557
|
value: "productType",
|
|
483
|
-
icon:
|
|
558
|
+
icon: Ee("product")
|
|
484
559
|
},
|
|
485
560
|
{
|
|
486
561
|
label: "Author",
|
|
@@ -492,187 +567,191 @@ const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.in
|
|
|
492
567
|
value: "entityList",
|
|
493
568
|
icon: "list_alt"
|
|
494
569
|
}
|
|
495
|
-
],
|
|
570
|
+
], wn = ({
|
|
496
571
|
sliceFields: e,
|
|
497
572
|
usedSliceTypes: t = [],
|
|
498
|
-
entityTypes:
|
|
499
|
-
counts:
|
|
500
|
-
filled:
|
|
501
|
-
countsComplete:
|
|
502
|
-
sliceType:
|
|
503
|
-
onSliceTypeChange:
|
|
573
|
+
entityTypes: n = [],
|
|
574
|
+
counts: s,
|
|
575
|
+
filled: d = 0,
|
|
576
|
+
countsComplete: c = !1,
|
|
577
|
+
sliceType: p,
|
|
578
|
+
onSliceTypeChange: h,
|
|
579
|
+
sort: l
|
|
504
580
|
}) => {
|
|
505
581
|
const {
|
|
506
582
|
sliceType: f,
|
|
507
|
-
onSliceTypeChange:
|
|
508
|
-
useExtraSlices:
|
|
509
|
-
isLoadingExtraSlices:
|
|
510
|
-
} =
|
|
511
|
-
...
|
|
512
|
-
...
|
|
513
|
-
})),
|
|
514
|
-
() =>
|
|
515
|
-
[
|
|
516
|
-
), { attributes:
|
|
517
|
-
entityTypes:
|
|
518
|
-
request:
|
|
583
|
+
onSliceTypeChange: y,
|
|
584
|
+
useExtraSlices: C,
|
|
585
|
+
isLoadingExtraSlices: m
|
|
586
|
+
} = Me(), g = p ?? f, S = h ?? y, { projectName: r } = me(), { formatAttribute: u } = C(), o = e.filter((I) => He.some((A) => A.value === I.value)).map((I) => ({
|
|
587
|
+
...He.find((O) => O.value === I.value),
|
|
588
|
+
...I
|
|
589
|
+
})), i = e.some((I) => I.value === "attributes"), b = g?.startsWith("attrib.") ? g.slice(7) : void 0, a = M(
|
|
590
|
+
() => b ? [b] : [],
|
|
591
|
+
[b]
|
|
592
|
+
), { attributes: x, isLoading: T } = Sn({
|
|
593
|
+
entityTypes: n,
|
|
594
|
+
request: a
|
|
519
595
|
});
|
|
520
|
-
|
|
521
|
-
(
|
|
522
|
-
label:
|
|
523
|
-
value: "attrib." +
|
|
524
|
-
icon:
|
|
596
|
+
i && typeof u == "function" && x.forEach(
|
|
597
|
+
(I) => o.push({
|
|
598
|
+
label: I.data.title || I.name,
|
|
599
|
+
value: "attrib." + I.name,
|
|
600
|
+
icon: Bt(I.name, I.data.type, Qe(I.data))
|
|
525
601
|
})
|
|
526
602
|
);
|
|
527
|
-
const [
|
|
603
|
+
const [v, D] = z(!1), ae = !!x.find((I) => I.name === b)?.enumIsLoading, {
|
|
528
604
|
project: oe,
|
|
529
|
-
getStatuses:
|
|
530
|
-
getTypes:
|
|
531
|
-
getTaskTypes:
|
|
532
|
-
getProductTypes:
|
|
605
|
+
getStatuses: Z,
|
|
606
|
+
getTypes: ie,
|
|
607
|
+
getTaskTypes: re,
|
|
608
|
+
getProductTypes: q,
|
|
533
609
|
getAttribute: ee,
|
|
534
|
-
isLoading:
|
|
535
|
-
} =
|
|
536
|
-
data:
|
|
537
|
-
getData:
|
|
538
|
-
isFetching:
|
|
539
|
-
} =
|
|
540
|
-
projectName:
|
|
610
|
+
isLoading: V
|
|
611
|
+
} = bn({ scopes: n, useExtraSlices: C }), {
|
|
612
|
+
data: le,
|
|
613
|
+
getData: te,
|
|
614
|
+
isFetching: L
|
|
615
|
+
} = Ot({
|
|
616
|
+
projectName: r || "",
|
|
541
617
|
folderTypes: oe?.folderTypes || [],
|
|
542
618
|
includeColors: !0
|
|
543
|
-
}), { getData:
|
|
544
|
-
projectName:
|
|
545
|
-
useExtraSlices:
|
|
619
|
+
}), { getData: R, isLoading: k } = yn({
|
|
620
|
+
projectName: r,
|
|
621
|
+
useExtraSlices: C
|
|
546
622
|
}), {
|
|
547
|
-
getData:
|
|
548
|
-
isLoading:
|
|
549
|
-
isExpandable:
|
|
550
|
-
} =
|
|
623
|
+
getData: Q,
|
|
624
|
+
isLoading: he,
|
|
625
|
+
isExpandable: xe
|
|
626
|
+
} = In(g === "entityList"), J = L || V || k || m && g !== "hierarchy" || he && g === "entityList" || T || ae, B = {
|
|
551
627
|
hierarchy: {
|
|
552
|
-
getData:
|
|
553
|
-
isLoading:
|
|
628
|
+
getData: te,
|
|
629
|
+
isLoading: L,
|
|
554
630
|
isExpandable: !0
|
|
555
631
|
},
|
|
556
632
|
assignees: {
|
|
557
|
-
getData:
|
|
633
|
+
getData: R,
|
|
558
634
|
isLoading: k,
|
|
559
635
|
isExpandable: !1,
|
|
560
636
|
noValue: !0,
|
|
561
637
|
hasValue: !0
|
|
562
638
|
},
|
|
563
639
|
author: {
|
|
564
|
-
getData:
|
|
640
|
+
getData: R,
|
|
565
641
|
isLoading: k,
|
|
566
642
|
isExpandable: !1
|
|
567
643
|
},
|
|
568
644
|
status: {
|
|
569
|
-
getData:
|
|
570
|
-
isLoading:
|
|
645
|
+
getData: Z,
|
|
646
|
+
isLoading: V,
|
|
571
647
|
isExpandable: !1
|
|
572
648
|
},
|
|
573
649
|
type: {
|
|
574
|
-
getData:
|
|
575
|
-
isLoading:
|
|
650
|
+
getData: ie,
|
|
651
|
+
isLoading: V,
|
|
576
652
|
isExpandable: !0
|
|
577
653
|
},
|
|
578
654
|
taskType: {
|
|
579
|
-
getData:
|
|
580
|
-
isLoading:
|
|
655
|
+
getData: re,
|
|
656
|
+
isLoading: V,
|
|
581
657
|
isExpandable: !1
|
|
582
658
|
},
|
|
583
659
|
productType: {
|
|
584
|
-
getData:
|
|
660
|
+
getData: q,
|
|
585
661
|
isLoading: !1,
|
|
586
662
|
isExpandable: !1
|
|
587
663
|
},
|
|
588
664
|
entityList: {
|
|
589
|
-
getData:
|
|
590
|
-
isLoading:
|
|
591
|
-
isExpandable:
|
|
665
|
+
getData: Q,
|
|
666
|
+
isLoading: he,
|
|
667
|
+
isExpandable: xe
|
|
592
668
|
}
|
|
593
669
|
};
|
|
594
|
-
for (const
|
|
595
|
-
|
|
596
|
-
getData: () => ee(
|
|
597
|
-
isLoading:
|
|
670
|
+
for (const I of x)
|
|
671
|
+
B["attrib." + I.name] = {
|
|
672
|
+
getData: () => ee(I),
|
|
673
|
+
isLoading: T || !!I.enumIsLoading,
|
|
598
674
|
isExpandable: !1,
|
|
599
675
|
isAttribute: !0
|
|
600
676
|
};
|
|
601
|
-
const
|
|
602
|
-
(
|
|
677
|
+
const Y = { data: [], isExpandable: !1 }, [P, ge] = z(Y), G = B[g], ne = o.find(
|
|
678
|
+
(I) => B[I.value] && !t.includes(I.value)
|
|
603
679
|
)?.value;
|
|
604
680
|
se(() => {
|
|
605
|
-
|
|
606
|
-
}, [
|
|
607
|
-
const
|
|
608
|
-
const
|
|
609
|
-
if (!
|
|
610
|
-
console.warn(`Slice type ${
|
|
681
|
+
J || G || !ne || S(ne, !1);
|
|
682
|
+
}, [J, G, ne]);
|
|
683
|
+
const ce = (I, A) => {
|
|
684
|
+
const O = B[I];
|
|
685
|
+
if (!O) {
|
|
686
|
+
console.warn(`Slice type ${I} not found`);
|
|
611
687
|
return;
|
|
612
688
|
}
|
|
613
|
-
(
|
|
689
|
+
(O.isAttribute && i || e.some(($) => $.value === I)) && S(I, A);
|
|
614
690
|
};
|
|
615
691
|
se(() => {
|
|
616
|
-
if (
|
|
692
|
+
if (J) return;
|
|
617
693
|
(async () => {
|
|
618
694
|
try {
|
|
619
|
-
if (
|
|
620
|
-
|
|
621
|
-
const
|
|
622
|
-
if (
|
|
695
|
+
if (!G) return;
|
|
696
|
+
D(!0);
|
|
697
|
+
const A = await G.getData();
|
|
698
|
+
if (A === void 0)
|
|
623
699
|
throw window.alert(
|
|
624
700
|
"Slice options failed to load. This likely means the PowerFeatures addon is out of date. Please update to the latest version."
|
|
625
701
|
), S(ne ?? "hierarchy", !1), new Error("Slice data is undefined");
|
|
626
|
-
|
|
627
|
-
data:
|
|
628
|
-
isExpandable:
|
|
702
|
+
G.hasValue && A.unshift(Ln(g)), G.noValue && A.unshift(Cn(g)), ge({
|
|
703
|
+
data: A,
|
|
704
|
+
isExpandable: G.isExpandable
|
|
629
705
|
});
|
|
630
|
-
} catch (
|
|
631
|
-
console.error("Error fetching slice data:",
|
|
706
|
+
} catch (A) {
|
|
707
|
+
console.error("Error fetching slice data:", A), ge(Y);
|
|
632
708
|
} finally {
|
|
633
|
-
|
|
709
|
+
D(!1);
|
|
634
710
|
}
|
|
635
711
|
})();
|
|
636
|
-
}, [
|
|
637
|
-
const j =
|
|
638
|
-
() =>
|
|
639
|
-
[
|
|
640
|
-
),
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
712
|
+
}, [g, r, J, g === "hierarchy" ? le : null]);
|
|
713
|
+
const de = l?.by, F = !!l?.desc, j = M(
|
|
714
|
+
() => de ? on(P.data, g, { by: de, desc: F }) : P.data,
|
|
715
|
+
[P.data, g, de, F]
|
|
716
|
+
), ye = M(
|
|
717
|
+
() => ot(j, s, d, c),
|
|
718
|
+
[j, s, d, c]
|
|
719
|
+
), be = M(() => {
|
|
720
|
+
const I = /* @__PURE__ */ new Map(), A = [...ye];
|
|
721
|
+
for (; A.length > 0; ) {
|
|
722
|
+
const O = A.shift();
|
|
723
|
+
if (O && (I.set(O.id, O), O.subRows && O.subRows.length > 0))
|
|
724
|
+
for (const $ of O.subRows)
|
|
725
|
+
A.push($);
|
|
647
726
|
}
|
|
648
|
-
return
|
|
649
|
-
}, [
|
|
727
|
+
return I;
|
|
728
|
+
}, [ye]);
|
|
650
729
|
return {
|
|
651
|
-
sliceOptions:
|
|
652
|
-
table: { ...
|
|
653
|
-
sliceMap:
|
|
654
|
-
isLoading:
|
|
655
|
-
sliceType:
|
|
656
|
-
handleSliceTypeChange:
|
|
730
|
+
sliceOptions: o,
|
|
731
|
+
table: { ...P, data: ye },
|
|
732
|
+
sliceMap: be,
|
|
733
|
+
isLoading: B[g] && B[g].isLoading || v || J,
|
|
734
|
+
sliceType: g,
|
|
735
|
+
handleSliceTypeChange: ce
|
|
657
736
|
};
|
|
658
|
-
},
|
|
659
|
-
const
|
|
660
|
-
() => (
|
|
661
|
-
[
|
|
662
|
-
),
|
|
737
|
+
}, En = /* @__PURE__ */ new Map(), Dn = (e, t, n, s) => {
|
|
738
|
+
const d = M(() => ({ id: t, desc: !1 }), [t]), c = M(
|
|
739
|
+
() => (n ?? []).filter((S) => S !== t).map((S) => ({ id: S, desc: !1 })),
|
|
740
|
+
[n, t]
|
|
741
|
+
), p = !!s || !e, h = e?.entity === "version" ? { entity: "version", groupBy: d, extraGroupBys: c, args: e.args, skip: p } : {
|
|
663
742
|
entity: "task",
|
|
664
|
-
groupBy:
|
|
665
|
-
extraGroupBys:
|
|
743
|
+
groupBy: d,
|
|
744
|
+
extraGroupBys: c,
|
|
666
745
|
args: e?.args ?? { projectName: "" },
|
|
667
|
-
skip:
|
|
668
|
-
}, { counts:
|
|
746
|
+
skip: p
|
|
747
|
+
}, { counts: l, total: f, complete: y } = Gt(h), C = l?.get(Ye)?.count ?? 0, m = Math.max(f - C, 0);
|
|
669
748
|
return {
|
|
670
|
-
counts:
|
|
671
|
-
total:
|
|
672
|
-
filled:
|
|
673
|
-
complete: !
|
|
749
|
+
counts: p ? void 0 : l ?? (y ? En : void 0),
|
|
750
|
+
total: f,
|
|
751
|
+
filled: m,
|
|
752
|
+
complete: !p && y
|
|
674
753
|
};
|
|
675
|
-
},
|
|
754
|
+
}, Rn = U.div`
|
|
676
755
|
display: flex;
|
|
677
756
|
align-items: center;
|
|
678
757
|
|
|
@@ -680,206 +759,206 @@ const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.in
|
|
|
680
759
|
flex: 1;
|
|
681
760
|
min-width: 0;
|
|
682
761
|
}
|
|
683
|
-
`,
|
|
762
|
+
`, kn = U(Tt)`
|
|
684
763
|
flex: 1;
|
|
685
764
|
min-width: 0;
|
|
686
765
|
height: 28px;
|
|
687
766
|
min-height: 28px;
|
|
688
|
-
`,
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
},
|
|
692
|
-
const
|
|
693
|
-
if (
|
|
694
|
-
|
|
695
|
-
const
|
|
696
|
-
|
|
767
|
+
`, An = ({ open: e, value: t, subject: n, onChange: s }) => {
|
|
768
|
+
const d = () => s(e ? void 0 : ""), c = (h) => {
|
|
769
|
+
h.key === "Escape" && s(void 0);
|
|
770
|
+
}, p = (h) => {
|
|
771
|
+
const l = Lt(h.clipboardData.getData("text"));
|
|
772
|
+
if (l === null) return;
|
|
773
|
+
h.preventDefault();
|
|
774
|
+
const f = h.currentTarget, y = f.selectionStart ?? t.length, C = f.selectionEnd ?? t.length, m = y + l.length;
|
|
775
|
+
s(t.slice(0, y) + l + t.slice(C)), requestAnimationFrame(() => f.setSelectionRange(m, m));
|
|
697
776
|
};
|
|
698
|
-
return /* @__PURE__ */
|
|
777
|
+
return /* @__PURE__ */ H(Rn, { className: W({ open: e }), children: [
|
|
699
778
|
e && /* @__PURE__ */ E(
|
|
700
|
-
|
|
779
|
+
kn,
|
|
701
780
|
{
|
|
702
781
|
value: t,
|
|
703
|
-
onChange: (
|
|
782
|
+
onChange: (h) => s(h.target.value),
|
|
704
783
|
placeholder: "Search",
|
|
705
784
|
autoFocus: !0,
|
|
706
|
-
onKeyDown:
|
|
707
|
-
onPaste:
|
|
785
|
+
onKeyDown: c,
|
|
786
|
+
onPaste: p
|
|
708
787
|
}
|
|
709
788
|
),
|
|
710
789
|
/* @__PURE__ */ E(
|
|
711
|
-
|
|
790
|
+
pe,
|
|
712
791
|
{
|
|
713
792
|
icon: e ? "close" : "search",
|
|
714
|
-
onClick:
|
|
793
|
+
onClick: d,
|
|
715
794
|
className: W({ open: e }),
|
|
716
|
-
"data-tooltip": e ? "Close search" : `Search ${
|
|
795
|
+
"data-tooltip": e ? "Close search" : `Search ${n}`
|
|
717
796
|
}
|
|
718
797
|
)
|
|
719
798
|
] });
|
|
720
|
-
},
|
|
721
|
-
e.toggleExpanded(t), e.subRows?.forEach((
|
|
722
|
-
},
|
|
723
|
-
const { onOpenNew:
|
|
724
|
-
(
|
|
799
|
+
}, Ae = (e, t) => {
|
|
800
|
+
e.toggleExpanded(t), e.subRows?.forEach((n) => Ae(n, t));
|
|
801
|
+
}, Ge = (e) => e.map((t) => t.id).filter(Boolean), _n = (e, t, n, s) => {
|
|
802
|
+
const { onOpenNew: d } = Qt(), { projectName: c } = me(), { setEntities: p } = kt(), h = Jt(), [l] = Je(), { deleteEntities: f } = At(), [y, C] = z(null), m = N(
|
|
803
|
+
(u, o) => o.map((i) => t?.get(i) || (i === u.id ? u : void 0)).filter((i) => !!i),
|
|
725
804
|
[t]
|
|
726
|
-
),
|
|
805
|
+
), g = M(
|
|
727
806
|
() => ({
|
|
728
|
-
onShowDetails: (
|
|
729
|
-
|
|
807
|
+
onShowDetails: (u, o = [u.id]) => {
|
|
808
|
+
p({
|
|
730
809
|
entityType: "folder",
|
|
731
|
-
entities:
|
|
810
|
+
entities: o.map((i) => ({ id: i, projectName: c }))
|
|
732
811
|
});
|
|
733
812
|
},
|
|
734
813
|
onAddToList: e,
|
|
735
|
-
onMove: (
|
|
736
|
-
|
|
737
|
-
entities:
|
|
738
|
-
entityId:
|
|
739
|
-
entityType:
|
|
740
|
-
currentParentId:
|
|
814
|
+
onMove: (u) => {
|
|
815
|
+
s?.({
|
|
816
|
+
entities: u.map((o) => ({
|
|
817
|
+
entityId: o.id,
|
|
818
|
+
entityType: o.data?.entityType === "task" ? "task" : "folder",
|
|
819
|
+
currentParentId: o.parentId || o.data?.parentId
|
|
741
820
|
}))
|
|
742
821
|
});
|
|
743
822
|
},
|
|
744
|
-
onRename: (
|
|
745
|
-
onOpenViewer: (
|
|
746
|
-
onUploadVersion: (
|
|
747
|
-
const
|
|
748
|
-
|
|
749
|
-
folderId:
|
|
750
|
-
taskId:
|
|
823
|
+
onRename: (u) => C(u),
|
|
824
|
+
onOpenViewer: (u) => n?.(u, c),
|
|
825
|
+
onUploadVersion: (u) => {
|
|
826
|
+
const o = u.data?.entityType === "task", i = o ? u.parentId || u.data?.parentId : u.id;
|
|
827
|
+
i && h?.onOpenVersionUpload({
|
|
828
|
+
folderId: i,
|
|
829
|
+
taskId: o ? u.id : void 0
|
|
751
830
|
});
|
|
752
831
|
},
|
|
753
|
-
onDelete: (
|
|
754
|
-
const
|
|
755
|
-
const
|
|
832
|
+
onDelete: (u) => {
|
|
833
|
+
const o = u.map((i) => {
|
|
834
|
+
const b = i.data?.entityType === "task" ? "task" : "folder", a = i.parentId || i.data?.parentId;
|
|
756
835
|
return {
|
|
757
|
-
id:
|
|
758
|
-
entityType:
|
|
759
|
-
name:
|
|
760
|
-
label:
|
|
761
|
-
projectName:
|
|
762
|
-
folderId:
|
|
763
|
-
parentId:
|
|
836
|
+
id: i.id,
|
|
837
|
+
entityType: b,
|
|
838
|
+
name: i.name,
|
|
839
|
+
label: i.label,
|
|
840
|
+
projectName: c,
|
|
841
|
+
folderId: b === "task" ? a : void 0,
|
|
842
|
+
parentId: b === "folder" ? a : void 0
|
|
764
843
|
};
|
|
765
844
|
});
|
|
766
|
-
|
|
845
|
+
f(o);
|
|
767
846
|
}
|
|
768
847
|
}),
|
|
769
848
|
[
|
|
770
849
|
e,
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
m,
|
|
850
|
+
n,
|
|
851
|
+
s,
|
|
852
|
+
c,
|
|
775
853
|
p,
|
|
776
|
-
|
|
854
|
+
f,
|
|
855
|
+
h
|
|
777
856
|
]
|
|
778
|
-
),
|
|
779
|
-
(
|
|
780
|
-
|
|
781
|
-
projectName:
|
|
857
|
+
), S = N(
|
|
858
|
+
(u) => {
|
|
859
|
+
y && (l({
|
|
860
|
+
projectName: c,
|
|
782
861
|
operationsRequestModel: {
|
|
783
862
|
operations: [
|
|
784
863
|
{
|
|
785
864
|
type: "update",
|
|
786
|
-
entityType:
|
|
787
|
-
entityId:
|
|
788
|
-
data: { label:
|
|
865
|
+
entityType: y.data?.entityType === "task" ? "task" : "folder",
|
|
866
|
+
entityId: y.id,
|
|
867
|
+
data: { label: u }
|
|
789
868
|
}
|
|
790
869
|
]
|
|
791
870
|
}
|
|
792
|
-
}),
|
|
871
|
+
}), C(null));
|
|
793
872
|
},
|
|
794
|
-
[
|
|
873
|
+
[c, y, l]
|
|
795
874
|
);
|
|
796
875
|
return {
|
|
797
|
-
rowContextMenuBuilders:
|
|
876
|
+
rowContextMenuBuilders: M(
|
|
798
877
|
() => [
|
|
799
|
-
(
|
|
878
|
+
(u, { row: o, selectedRows: i }) => ({
|
|
800
879
|
label: "Show details",
|
|
801
880
|
icon: "dock_to_left",
|
|
802
|
-
shortcut:
|
|
803
|
-
command: () =>
|
|
881
|
+
shortcut: qt("click", [Yt.Alt]),
|
|
882
|
+
command: () => g.onShowDetails(o.original, i)
|
|
804
883
|
}),
|
|
805
|
-
(
|
|
884
|
+
(u, { row: o }) => ({
|
|
806
885
|
label: "Rename label",
|
|
807
886
|
icon: "titlecase",
|
|
808
887
|
shortcut: "R",
|
|
809
|
-
command: () =>
|
|
888
|
+
command: () => g.onRename(o.original)
|
|
810
889
|
}),
|
|
811
|
-
(
|
|
890
|
+
(u, { row: o }) => ({
|
|
812
891
|
label: "Open in viewer",
|
|
813
892
|
icon: "play_circle",
|
|
814
|
-
command: () =>
|
|
815
|
-
hidden: !
|
|
893
|
+
command: () => g.onOpenViewer(o.original),
|
|
894
|
+
hidden: !n
|
|
816
895
|
}),
|
|
817
|
-
(
|
|
896
|
+
(u, { selectedTableRows: o }) => ({
|
|
818
897
|
label: "Expand all children",
|
|
819
898
|
icon: "expand_all",
|
|
820
|
-
command: () =>
|
|
821
|
-
hidden: !
|
|
822
|
-
(
|
|
899
|
+
command: () => o.filter((i) => i.getCanExpand() && !i.getIsExpanded()).forEach((i) => Ae(i, !0)),
|
|
900
|
+
hidden: !o.some(
|
|
901
|
+
(i) => i.getCanExpand() && !i.getIsExpanded()
|
|
823
902
|
)
|
|
824
903
|
}),
|
|
825
|
-
(
|
|
904
|
+
(u, { selectedTableRows: o }) => ({
|
|
826
905
|
label: "Collapse all children",
|
|
827
906
|
icon: "collapse_all",
|
|
828
|
-
command: () =>
|
|
829
|
-
hidden: !
|
|
830
|
-
(
|
|
907
|
+
command: () => o.filter((i) => i.getCanExpand() && i.getIsExpanded()).forEach((i) => Ae(i, !1)),
|
|
908
|
+
hidden: !o.some(
|
|
909
|
+
(i) => i.getCanExpand() && i.getIsExpanded()
|
|
831
910
|
)
|
|
832
911
|
}),
|
|
833
|
-
(
|
|
834
|
-
const
|
|
835
|
-
return
|
|
912
|
+
(u, { row: o, selectedRows: i }) => {
|
|
913
|
+
const b = g.onAddToList?.(o.original, i);
|
|
914
|
+
return b ? Array.isArray(b) ? b : [b] : void 0;
|
|
836
915
|
},
|
|
837
|
-
(
|
|
916
|
+
(u, { row: o }) => ({
|
|
838
917
|
label: "Upload version",
|
|
839
918
|
icon: "upload",
|
|
840
|
-
command: () =>
|
|
919
|
+
command: () => g.onUploadVersion(o.original)
|
|
841
920
|
}),
|
|
842
|
-
(
|
|
921
|
+
(u, { row: o, selectedRows: i }) => ({
|
|
843
922
|
label: "Move",
|
|
844
923
|
icon: "drive_file_move",
|
|
845
|
-
command: () =>
|
|
846
|
-
hidden: !
|
|
924
|
+
command: () => g.onMove(m(o.original, i)),
|
|
925
|
+
hidden: !s
|
|
847
926
|
}),
|
|
848
|
-
(
|
|
849
|
-
label:
|
|
850
|
-
icon:
|
|
851
|
-
command: () =>
|
|
852
|
-
parentFolderIds:
|
|
853
|
-
|
|
927
|
+
(u, { row: o, selectedRows: i }) => ({
|
|
928
|
+
label: Te.folder.createLabel,
|
|
929
|
+
icon: Te.folder.icon,
|
|
930
|
+
command: () => d?.("folder", {
|
|
931
|
+
parentFolderIds: Ge(
|
|
932
|
+
m(o.original, i)
|
|
854
933
|
)
|
|
855
934
|
})
|
|
856
935
|
}),
|
|
857
|
-
(
|
|
858
|
-
label:
|
|
859
|
-
icon:
|
|
860
|
-
command: () =>
|
|
861
|
-
parentFolderIds:
|
|
862
|
-
|
|
936
|
+
(u, { row: o, selectedRows: i }) => ({
|
|
937
|
+
label: Te.task.createLabel,
|
|
938
|
+
icon: Te.task.icon,
|
|
939
|
+
command: () => d?.("task", {
|
|
940
|
+
parentFolderIds: Ge(
|
|
941
|
+
m(o.original, i)
|
|
863
942
|
)
|
|
864
943
|
})
|
|
865
944
|
}),
|
|
866
|
-
(
|
|
945
|
+
(u, { row: o, selectedRows: i }) => ({
|
|
867
946
|
label: "Delete",
|
|
868
947
|
icon: "delete",
|
|
869
948
|
danger: !0,
|
|
870
|
-
command: () =>
|
|
949
|
+
command: () => g.onDelete(m(o.original, i))
|
|
871
950
|
})
|
|
872
951
|
],
|
|
873
|
-
[
|
|
952
|
+
[g, m, d]
|
|
874
953
|
),
|
|
875
|
-
onOptionClick:
|
|
876
|
-
onRename:
|
|
877
|
-
renamingRow:
|
|
878
|
-
renameInitialValue:
|
|
879
|
-
onSubmitRename:
|
|
880
|
-
onCancelRename: () =>
|
|
954
|
+
onOptionClick: g.onShowDetails,
|
|
955
|
+
onRename: g.onRename,
|
|
956
|
+
renamingRow: y,
|
|
957
|
+
renameInitialValue: y?.label || y?.name || "",
|
|
958
|
+
onSubmitRename: S,
|
|
959
|
+
onCancelRename: () => C(null)
|
|
881
960
|
};
|
|
882
|
-
},
|
|
961
|
+
}, Mn = U(vt)`
|
|
883
962
|
/* put above the menu so it's still clickable */
|
|
884
963
|
/* NOTE: this will need fixing as this also puts it above dialogs */
|
|
885
964
|
/* z-index: 1001; */
|
|
@@ -910,7 +989,7 @@ const At = 180, Be = 100, Ge = 34, Ot = (e, t = [], a = Be) => e.map((r) => t.in
|
|
|
910
989
|
}
|
|
911
990
|
}
|
|
912
991
|
`;
|
|
913
|
-
|
|
992
|
+
U.div`
|
|
914
993
|
display: flex;
|
|
915
994
|
flex-direction: column;
|
|
916
995
|
gap: var(--base-gap-large);
|
|
@@ -932,82 +1011,82 @@ V.div`
|
|
|
932
1011
|
font-weight: 600;
|
|
933
1012
|
}
|
|
934
1013
|
`;
|
|
935
|
-
const
|
|
936
|
-
const
|
|
937
|
-
return e === "created" ? `new ${
|
|
938
|
-
},
|
|
1014
|
+
const Pn = (e, t, n) => {
|
|
1015
|
+
const s = `${t}${n === 1 ? "" : "s"}`;
|
|
1016
|
+
return e === "created" ? `new ${s}` : e === "deleted" ? `${s} deleted` : `${n} ${s} ${e.replaceAll("_", " ")}`;
|
|
1017
|
+
}, On = (e) => {
|
|
939
1018
|
const t = /* @__PURE__ */ new Map();
|
|
940
|
-
return e.forEach((
|
|
941
|
-
const [,
|
|
942
|
-
if (!
|
|
943
|
-
const
|
|
944
|
-
entityType:
|
|
945
|
-
updateType:
|
|
1019
|
+
return e.forEach((s) => {
|
|
1020
|
+
const [, d, c] = s.topic.split(".");
|
|
1021
|
+
if (!d || !c) return;
|
|
1022
|
+
const p = `${d}.${c}`, h = t.get(p) || {
|
|
1023
|
+
entityType: d,
|
|
1024
|
+
updateType: c,
|
|
946
1025
|
ids: /* @__PURE__ */ new Set()
|
|
947
1026
|
};
|
|
948
|
-
|
|
1027
|
+
h.ids.add(s.entityId || String(s.id)), t.set(p, h);
|
|
949
1028
|
}), `${Array.from(t.values()).map(
|
|
950
|
-
({ entityType:
|
|
1029
|
+
({ entityType: s, updateType: d, ids: c }) => Pn(d, s, c.size)
|
|
951
1030
|
).join(", ")} since last sync`;
|
|
952
|
-
},
|
|
953
|
-
({ projectNames: e, topics: t, onSync:
|
|
954
|
-
const [
|
|
1031
|
+
}, Nn = ft(
|
|
1032
|
+
({ projectNames: e, topics: t, onSync: n, shouldSyncOnUpdate: s, hideWhenNoUpdates: d = !1, ...c }, p) => {
|
|
1033
|
+
const [h, l] = z(!1), [f, y] = _t(), { setMenuOpen: C } = Ze(), m = Ie(null), g = Ie(), S = mt();
|
|
955
1034
|
se(() => () => {
|
|
956
|
-
const v =
|
|
957
|
-
|
|
958
|
-
}, []),
|
|
959
|
-
const
|
|
960
|
-
|
|
1035
|
+
const v = g.current;
|
|
1036
|
+
g.current = void 0, v !== void 0 && clearTimeout(v);
|
|
1037
|
+
}, []), ht(p, () => m.current, []);
|
|
1038
|
+
const r = async () => {
|
|
1039
|
+
l(!0);
|
|
961
1040
|
try {
|
|
962
|
-
await
|
|
1041
|
+
await n?.(u);
|
|
963
1042
|
} finally {
|
|
964
|
-
|
|
1043
|
+
l(!1);
|
|
965
1044
|
}
|
|
966
|
-
}, { updates:
|
|
1045
|
+
}, { updates: u, hasUpdates: o } = Mt({
|
|
967
1046
|
projectNames: e,
|
|
968
1047
|
topics: t,
|
|
969
|
-
isSyncing:
|
|
970
|
-
shouldSyncOnUpdate:
|
|
1048
|
+
isSyncing: h,
|
|
1049
|
+
shouldSyncOnUpdate: s
|
|
971
1050
|
});
|
|
972
1051
|
if (se(() => {
|
|
973
1052
|
const v = (D) => {
|
|
974
|
-
D.repeat || !D.shiftKey || D.ctrlKey || D.metaKey || D.key.toLowerCase() !== "r" ||
|
|
1053
|
+
D.repeat || !D.shiftKey || D.ctrlKey || D.metaKey || D.key.toLowerCase() !== "r" || Kt(D) || (D.preventDefault(), D.stopPropagation(), r());
|
|
975
1054
|
};
|
|
976
1055
|
return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
|
|
977
|
-
}, [
|
|
978
|
-
const
|
|
979
|
-
Object.values(
|
|
980
|
-
const
|
|
981
|
-
|
|
1056
|
+
}, [r]), d && !o) return null;
|
|
1057
|
+
const i = On(u), b = Object.values(f).some(Boolean);
|
|
1058
|
+
Object.values(f).every(Boolean);
|
|
1059
|
+
const a = () => {
|
|
1060
|
+
g.current && clearTimeout(g.current);
|
|
982
1061
|
};
|
|
983
|
-
return /* @__PURE__ */
|
|
1062
|
+
return /* @__PURE__ */ H(_e, { children: [
|
|
984
1063
|
/* @__PURE__ */ E(
|
|
985
|
-
|
|
1064
|
+
Mn,
|
|
986
1065
|
{
|
|
987
|
-
...
|
|
1066
|
+
...c,
|
|
988
1067
|
icon: "sync",
|
|
989
|
-
ref:
|
|
990
|
-
onClick:
|
|
1068
|
+
ref: m,
|
|
1069
|
+
onClick: r,
|
|
991
1070
|
onMouseEnter: () => {
|
|
992
|
-
|
|
1071
|
+
a(), C(S);
|
|
993
1072
|
},
|
|
994
1073
|
onMouseLeave: () => {
|
|
995
|
-
|
|
1074
|
+
a(), g.current = setTimeout(() => C(!1), 100);
|
|
996
1075
|
},
|
|
997
|
-
className: W(
|
|
998
|
-
syncing:
|
|
999
|
-
"has-updates":
|
|
1000
|
-
"auto-sync":
|
|
1076
|
+
className: W(c.className, {
|
|
1077
|
+
syncing: h,
|
|
1078
|
+
"has-updates": o,
|
|
1079
|
+
"auto-sync": b && !Ve
|
|
1001
1080
|
}),
|
|
1002
1081
|
"data-shortcut": "Shift+R",
|
|
1003
|
-
"data-tooltip":
|
|
1004
|
-
variant:
|
|
1082
|
+
"data-tooltip": o ? i : "Refresh data",
|
|
1083
|
+
variant: o ? "filled" : "surface"
|
|
1005
1084
|
}
|
|
1006
1085
|
),
|
|
1007
|
-
!
|
|
1086
|
+
!Ve
|
|
1008
1087
|
] });
|
|
1009
1088
|
}
|
|
1010
|
-
),
|
|
1089
|
+
), We = U.div`
|
|
1011
1090
|
display: flex;
|
|
1012
1091
|
align-items: center;
|
|
1013
1092
|
gap: var(--base-gap-small);
|
|
@@ -1015,7 +1094,7 @@ const rn = (e, t, a) => {
|
|
|
1015
1094
|
flex: 1;
|
|
1016
1095
|
min-width: 0;
|
|
1017
1096
|
color: var(--md-sys-color-outline);
|
|
1018
|
-
`,
|
|
1097
|
+
`, Fn = U.span`
|
|
1019
1098
|
display: flex;
|
|
1020
1099
|
align-items: center;
|
|
1021
1100
|
gap: 2px;
|
|
@@ -1028,56 +1107,56 @@ const rn = (e, t, a) => {
|
|
|
1028
1107
|
border-radius: 50%;
|
|
1029
1108
|
object-fit: cover;
|
|
1030
1109
|
}
|
|
1031
|
-
`,
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1034
|
-
const
|
|
1035
|
-
if (!
|
|
1036
|
-
const
|
|
1037
|
-
return
|
|
1110
|
+
`, jn = ({ rowSelection: e, sliceMap: t }) => {
|
|
1111
|
+
const n = Ie(null), [s, d] = z(0);
|
|
1112
|
+
we(() => {
|
|
1113
|
+
const r = n.current;
|
|
1114
|
+
if (!r) return;
|
|
1115
|
+
const u = new ResizeObserver(([o]) => d(o.contentRect.width));
|
|
1116
|
+
return u.observe(r), () => u.disconnect();
|
|
1038
1117
|
}, []);
|
|
1039
|
-
const
|
|
1040
|
-
if (
|
|
1041
|
-
|
|
1042
|
-
}, [
|
|
1043
|
-
const
|
|
1044
|
-
if (!
|
|
1045
|
-
const
|
|
1046
|
-
if (
|
|
1047
|
-
|
|
1118
|
+
const c = Object.keys(e).filter((r) => e[r]).map((r) => t.get(r)).filter((r) => !!r), p = (r) => !!r.icon || !!r.img || !!r.startContent, [h, l] = z(!0), f = c.length > 1 || !h, [y, C] = z(c.length), m = c.map((r) => r.id).join("|");
|
|
1119
|
+
if (we(() => {
|
|
1120
|
+
l(!0), C(c.length);
|
|
1121
|
+
}, [s, m]), we(() => {
|
|
1122
|
+
const r = n.current;
|
|
1123
|
+
if (!r || !c.length) return;
|
|
1124
|
+
const u = Array.from(r.querySelectorAll("[data-chip]")), o = r.querySelector("[data-overflow]")?.offsetWidth ?? 22, i = (v, D) => v.offsetLeft - r.offsetLeft + v.offsetWidth <= D;
|
|
1125
|
+
if (c.length === 1) {
|
|
1126
|
+
h && u[0] && !i(u[0], r.clientWidth) && p(c[0]) && l(!1);
|
|
1048
1127
|
return;
|
|
1049
1128
|
}
|
|
1050
|
-
const
|
|
1051
|
-
if (
|
|
1052
|
-
const
|
|
1053
|
-
T !==
|
|
1054
|
-
}), !
|
|
1055
|
-
const
|
|
1056
|
-
return /* @__PURE__ */
|
|
1057
|
-
|
|
1058
|
-
|
|
1129
|
+
const b = u[u.length - 1];
|
|
1130
|
+
if (b && i(b, r.clientWidth)) return;
|
|
1131
|
+
const a = r.clientWidth - o, x = u.filter((v) => i(v, a)).length, T = Math.max(1, x);
|
|
1132
|
+
T !== y && C(T);
|
|
1133
|
+
}), !c.length) return /* @__PURE__ */ E(We, { ref: n });
|
|
1134
|
+
const g = c.slice(0, y), S = c.length - g.length;
|
|
1135
|
+
return /* @__PURE__ */ H(We, { ref: n, children: [
|
|
1136
|
+
g.map((r) => /* @__PURE__ */ H(
|
|
1137
|
+
Fn,
|
|
1059
1138
|
{
|
|
1060
1139
|
"data-chip": !0,
|
|
1061
|
-
title:
|
|
1062
|
-
"aria-label":
|
|
1140
|
+
title: r.label || r.name,
|
|
1141
|
+
"aria-label": r.label || r.name,
|
|
1063
1142
|
children: [
|
|
1064
|
-
|
|
1065
|
-
!(
|
|
1143
|
+
r.startContent ?? (r.img ? /* @__PURE__ */ E("img", { src: r.img, alt: "" }) : r.icon && /* @__PURE__ */ E(It, { icon: r.icon, style: { color: r.iconColor } })),
|
|
1144
|
+
!(f && p(r)) && /* @__PURE__ */ E("span", { children: r.label || r.name })
|
|
1066
1145
|
]
|
|
1067
1146
|
},
|
|
1068
|
-
|
|
1147
|
+
r.id
|
|
1069
1148
|
)),
|
|
1070
|
-
|
|
1149
|
+
S > 0 && /* @__PURE__ */ H("span", { "data-overflow": !0, children: [
|
|
1071
1150
|
"+",
|
|
1072
|
-
|
|
1151
|
+
S
|
|
1073
1152
|
] })
|
|
1074
1153
|
] });
|
|
1075
|
-
},
|
|
1154
|
+
}, $n = U.div`
|
|
1076
1155
|
height: 28px;
|
|
1077
1156
|
border-radius: 4px;
|
|
1078
1157
|
background: var(--md-sys-color-surface-container);
|
|
1079
1158
|
width: 100px;
|
|
1080
|
-
`,
|
|
1159
|
+
`, zn = U.div`
|
|
1081
1160
|
display: flex;
|
|
1082
1161
|
align-items: center;
|
|
1083
1162
|
gap: var(--base-gap-small);
|
|
@@ -1089,7 +1168,7 @@ const rn = (e, t, a) => {
|
|
|
1089
1168
|
flex: 1;
|
|
1090
1169
|
min-width: 0;
|
|
1091
1170
|
}
|
|
1092
|
-
`,
|
|
1171
|
+
`, Un = U(Nt)`
|
|
1093
1172
|
.slicer-dropdown {
|
|
1094
1173
|
flex: 0 1 auto;
|
|
1095
1174
|
min-width: 48px;
|
|
@@ -1110,7 +1189,7 @@ const rn = (e, t, a) => {
|
|
|
1110
1189
|
.power-feature .icon {
|
|
1111
1190
|
color: var(--md-sys-color-tertiary);
|
|
1112
1191
|
}
|
|
1113
|
-
`,
|
|
1192
|
+
`, Vn = U.div`
|
|
1114
1193
|
display: flex;
|
|
1115
1194
|
align-items: center;
|
|
1116
1195
|
gap: var(--base-gap-small);
|
|
@@ -1123,176 +1202,224 @@ const rn = (e, t, a) => {
|
|
|
1123
1202
|
text-overflow: ellipsis;
|
|
1124
1203
|
white-space: nowrap;
|
|
1125
1204
|
}
|
|
1126
|
-
`,
|
|
1205
|
+
`, Ke = "__splitSlicer__", qe = ({
|
|
1127
1206
|
panel: e,
|
|
1128
1207
|
visibleSlices: t,
|
|
1129
|
-
sliceFields:
|
|
1130
|
-
entityTypes:
|
|
1131
|
-
pinnedSliceType:
|
|
1132
|
-
countsSource:
|
|
1133
|
-
onAddToList:
|
|
1134
|
-
openMoveDialog:
|
|
1135
|
-
splitEnabled:
|
|
1136
|
-
canCollapse:
|
|
1137
|
-
isPrimary:
|
|
1138
|
-
search:
|
|
1139
|
-
onSearchChange:
|
|
1208
|
+
sliceFields: n,
|
|
1209
|
+
entityTypes: s = ["task"],
|
|
1210
|
+
pinnedSliceType: d,
|
|
1211
|
+
countsSource: c,
|
|
1212
|
+
onAddToList: p,
|
|
1213
|
+
openMoveDialog: h,
|
|
1214
|
+
splitEnabled: l,
|
|
1215
|
+
canCollapse: f,
|
|
1216
|
+
isPrimary: y,
|
|
1217
|
+
search: C,
|
|
1218
|
+
onSearchChange: m
|
|
1140
1219
|
}) => {
|
|
1141
1220
|
const {
|
|
1142
|
-
SlicerDropdown:
|
|
1143
|
-
addSlicePanel:
|
|
1144
|
-
removeSlicePanel:
|
|
1145
|
-
collapsedPanels:
|
|
1146
|
-
togglePanelCollapsed:
|
|
1147
|
-
setPanelSliceType:
|
|
1148
|
-
getPanelSelection:
|
|
1149
|
-
setPanelSelection:
|
|
1221
|
+
SlicerDropdown: g,
|
|
1222
|
+
addSlicePanel: S,
|
|
1223
|
+
removeSlicePanel: r,
|
|
1224
|
+
collapsedPanels: u,
|
|
1225
|
+
togglePanelCollapsed: o,
|
|
1226
|
+
setPanelSliceType: i,
|
|
1227
|
+
getPanelSelection: b,
|
|
1228
|
+
setPanelSelection: a,
|
|
1150
1229
|
getPanelExpanded: x,
|
|
1151
1230
|
setPanelExpanded: T,
|
|
1152
1231
|
onSliceTypeChange: v,
|
|
1153
1232
|
isViewSyncPending: D,
|
|
1154
|
-
onOpenViewer:
|
|
1155
|
-
onAddToList:
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1233
|
+
onOpenViewer: K,
|
|
1234
|
+
onAddToList: ae,
|
|
1235
|
+
page: oe,
|
|
1236
|
+
getSliceSort: Z,
|
|
1237
|
+
setSliceSort: ie
|
|
1238
|
+
} = Me(), { refetch: re } = Pe(), { powerLicense: q, setPowerpackDialog: ee } = Oe(), V = b(e.id), le = x(e.id), te = (w) => {
|
|
1239
|
+
a(e.id, w);
|
|
1240
|
+
}, L = N(
|
|
1241
|
+
(w) => T(e.id, w),
|
|
1160
1242
|
[T, e.id]
|
|
1161
|
-
),
|
|
1162
|
-
() => typeof
|
|
1163
|
-
[
|
|
1164
|
-
),
|
|
1165
|
-
const
|
|
1166
|
-
if (typeof
|
|
1167
|
-
const
|
|
1168
|
-
return
|
|
1169
|
-
}, [
|
|
1170
|
-
|
|
1243
|
+
), R = M(
|
|
1244
|
+
() => typeof c == "function" ? c(e.sliceType) : c,
|
|
1245
|
+
[c, e.sliceType]
|
|
1246
|
+
), k = M(() => {
|
|
1247
|
+
const w = t.map((X) => X.sliceType);
|
|
1248
|
+
if (typeof c != "function") return w;
|
|
1249
|
+
const _ = (X) => JSON.stringify([X?.entity, X?.args]), ut = _(R);
|
|
1250
|
+
return w.filter((X) => X === e.sliceType || _(c(X)) === ut);
|
|
1251
|
+
}, [c, R, t, e.sliceType]), { counts: Q, filled: he, complete: xe } = Dn(
|
|
1252
|
+
R,
|
|
1171
1253
|
e.sliceType,
|
|
1172
|
-
|
|
1173
|
-
),
|
|
1174
|
-
(
|
|
1175
|
-
|
|
1254
|
+
k
|
|
1255
|
+
), J = N(
|
|
1256
|
+
(w, _) => {
|
|
1257
|
+
y ? v(w, _) : i(e.id, w);
|
|
1176
1258
|
},
|
|
1177
|
-
[
|
|
1178
|
-
),
|
|
1179
|
-
() => t.filter((
|
|
1259
|
+
[y, v, i, e.id]
|
|
1260
|
+
), B = M(
|
|
1261
|
+
() => t.filter((w) => w.id !== e.id).map((w) => w.sliceType),
|
|
1180
1262
|
[t, e.id]
|
|
1181
1263
|
), {
|
|
1182
|
-
sliceOptions:
|
|
1183
|
-
sliceType:
|
|
1184
|
-
handleSliceTypeChange:
|
|
1185
|
-
table: { data:
|
|
1186
|
-
sliceMap:
|
|
1187
|
-
isLoading:
|
|
1188
|
-
} =
|
|
1189
|
-
sliceFields:
|
|
1190
|
-
usedSliceTypes:
|
|
1191
|
-
entityTypes:
|
|
1192
|
-
counts:
|
|
1193
|
-
filled:
|
|
1194
|
-
countsComplete:
|
|
1264
|
+
sliceOptions: Y,
|
|
1265
|
+
sliceType: P,
|
|
1266
|
+
handleSliceTypeChange: ge,
|
|
1267
|
+
table: { data: G, isExpandable: ne },
|
|
1268
|
+
sliceMap: ce,
|
|
1269
|
+
isLoading: de
|
|
1270
|
+
} = wn({
|
|
1271
|
+
sliceFields: n,
|
|
1272
|
+
usedSliceTypes: B,
|
|
1273
|
+
entityTypes: s,
|
|
1274
|
+
counts: Q,
|
|
1275
|
+
filled: he,
|
|
1276
|
+
countsComplete: xe,
|
|
1195
1277
|
sliceType: e.sliceType,
|
|
1196
|
-
onSliceTypeChange:
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1278
|
+
onSliceTypeChange: J,
|
|
1279
|
+
sort: Z(e.sliceType)
|
|
1280
|
+
}), F = P === "hierarchy", j = !!f && u.includes(e.id), be = Y.find((w) => w.value === P)?.label || P, I = C !== void 0, A = C ?? "", O = F ? "Folders" : be, $ = _n(
|
|
1281
|
+
p || ae,
|
|
1282
|
+
ce,
|
|
1283
|
+
K,
|
|
1284
|
+
h
|
|
1285
|
+
), it = F ? $.rowContextMenuBuilders : [], Fe = M(
|
|
1286
|
+
() => Y.map((w) => w.value).filter((w) => !t.some((_) => _.sliceType === w)),
|
|
1287
|
+
[Y, t]
|
|
1288
|
+
), Se = !!l && Fe.length > 0, Ce = M(() => {
|
|
1289
|
+
const w = Y.map(
|
|
1290
|
+
(_) => B.includes(_.value) ? { ..._, disabled: !0, disabledMessage: "Already used by another panel" } : _
|
|
1208
1291
|
);
|
|
1209
|
-
return
|
|
1210
|
-
}, [
|
|
1211
|
-
if (!q) return
|
|
1212
|
-
|
|
1213
|
-
},
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1292
|
+
return Se && w.push({ label: "Split slicer", value: Ke, icon: "splitscreen_add" }), w;
|
|
1293
|
+
}, [Y, B, Se]), Le = () => {
|
|
1294
|
+
if (!q) return ee("slicer");
|
|
1295
|
+
S(Fe[0]);
|
|
1296
|
+
}, { menuOpen: rt, toggleMenuOpen: je } = Ze(), ue = `slicer-menu-${oe}-${e.id}`.replace(/[^\w-]/g, "-"), lt = rt === ue, ct = [
|
|
1297
|
+
{
|
|
1298
|
+
id: "search",
|
|
1299
|
+
label: `Search ${O}`,
|
|
1300
|
+
icon: "search",
|
|
1301
|
+
onClick: () => m("")
|
|
1302
|
+
},
|
|
1303
|
+
...Se && y ? [
|
|
1304
|
+
{
|
|
1305
|
+
id: "split",
|
|
1306
|
+
label: "Split slicer",
|
|
1307
|
+
icon: "splitscreen_add",
|
|
1308
|
+
powerFeature: "slicer",
|
|
1309
|
+
onClick: Le
|
|
1310
|
+
}
|
|
1311
|
+
] : [],
|
|
1312
|
+
...y ? [] : [
|
|
1313
|
+
{
|
|
1314
|
+
id: "remove-panel",
|
|
1315
|
+
label: "Remove panel",
|
|
1316
|
+
icon: "close",
|
|
1317
|
+
onClick: () => r(e.id)
|
|
1318
|
+
}
|
|
1319
|
+
],
|
|
1320
|
+
rn({
|
|
1321
|
+
id: "sort",
|
|
1322
|
+
options: Ne(P),
|
|
1323
|
+
sort: Z(P),
|
|
1324
|
+
onChange: (w) => ie(P, w)
|
|
1325
|
+
})
|
|
1326
|
+
], dt = (w) => {
|
|
1327
|
+
const _ = String(w[0]);
|
|
1328
|
+
if (_ === Ke) {
|
|
1329
|
+
Le();
|
|
1217
1330
|
return;
|
|
1218
1331
|
}
|
|
1219
|
-
|
|
1332
|
+
ge(_, !!y && d === P);
|
|
1220
1333
|
};
|
|
1221
|
-
return /* @__PURE__ */
|
|
1222
|
-
/* @__PURE__ */
|
|
1223
|
-
|
|
1334
|
+
return /* @__PURE__ */ H(Ft, { children: [
|
|
1335
|
+
/* @__PURE__ */ H(
|
|
1336
|
+
Un,
|
|
1224
1337
|
{
|
|
1225
1338
|
className: W({ collapsed: j }),
|
|
1226
|
-
onClick: j ? () =>
|
|
1339
|
+
onClick: j ? () => o(e.id) : void 0,
|
|
1227
1340
|
children: [
|
|
1228
|
-
|
|
1229
|
-
|
|
1341
|
+
f && /* @__PURE__ */ E(
|
|
1342
|
+
pe,
|
|
1230
1343
|
{
|
|
1231
1344
|
icon: "expand_more",
|
|
1232
1345
|
className: W("collapse-toggle", { collapsed: j }),
|
|
1233
1346
|
"data-tooltip": j ? "Expand panel" : "Collapse panel",
|
|
1234
1347
|
"data-tooltip-delay": 0,
|
|
1235
|
-
onClick: () =>
|
|
1348
|
+
onClick: () => o(e.id)
|
|
1236
1349
|
}
|
|
1237
1350
|
),
|
|
1238
1351
|
j ? (
|
|
1239
1352
|
// the dropdown cannot be used from a collapsed panel, but the dimension it
|
|
1240
1353
|
// shows has to read the same as the dropdown does when open
|
|
1241
|
-
/* @__PURE__ */ E(
|
|
1242
|
-
) : D ? /* @__PURE__ */ E(
|
|
1243
|
-
|
|
1354
|
+
/* @__PURE__ */ E(Vn, { children: /* @__PURE__ */ E("span", { children: be }) })
|
|
1355
|
+
) : D ? /* @__PURE__ */ E($n, {}) : !I && /* @__PURE__ */ E(
|
|
1356
|
+
g,
|
|
1244
1357
|
{
|
|
1245
|
-
options:
|
|
1246
|
-
value: [
|
|
1247
|
-
sliceTypes:
|
|
1248
|
-
onChange: (
|
|
1249
|
-
className: W("slicer-dropdown", { "single-option":
|
|
1250
|
-
disableOpen:
|
|
1358
|
+
options: Ce,
|
|
1359
|
+
value: [P],
|
|
1360
|
+
sliceTypes: n.map((w) => w.value),
|
|
1361
|
+
onChange: (w) => dt(w),
|
|
1362
|
+
className: W("slicer-dropdown", { "single-option": Ce.length === 1 }),
|
|
1363
|
+
disableOpen: Ce.length === 1
|
|
1251
1364
|
}
|
|
1252
1365
|
),
|
|
1253
|
-
j && /* @__PURE__ */ E(
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
|
|
1366
|
+
j && /* @__PURE__ */ E(jn, { rowSelection: V, sliceMap: ce }),
|
|
1367
|
+
/* @__PURE__ */ H(
|
|
1368
|
+
zn,
|
|
1256
1369
|
{
|
|
1257
|
-
className: W({ searching:
|
|
1258
|
-
onClick: (
|
|
1370
|
+
className: W({ searching: I }),
|
|
1371
|
+
onClick: (w) => w.stopPropagation(),
|
|
1259
1372
|
children: [
|
|
1373
|
+
!j && !I && /* @__PURE__ */ H(_e, { children: [
|
|
1374
|
+
/* @__PURE__ */ E(
|
|
1375
|
+
pe,
|
|
1376
|
+
{
|
|
1377
|
+
icon: "more_horiz",
|
|
1378
|
+
id: ue,
|
|
1379
|
+
className: W("slicer-menu", { active: lt }),
|
|
1380
|
+
"data-tooltip": "More",
|
|
1381
|
+
"data-tooltip-delay": 0,
|
|
1382
|
+
onClick: () => je(ue)
|
|
1383
|
+
}
|
|
1384
|
+
),
|
|
1385
|
+
/* @__PURE__ */ E(Xt, { targetId: ue, id: ue, align: "left", children: /* @__PURE__ */ E(Zt, { menu: ct, onClose: () => je(!1) }) })
|
|
1386
|
+
] }),
|
|
1260
1387
|
!j && /* @__PURE__ */ E(
|
|
1261
|
-
|
|
1388
|
+
An,
|
|
1262
1389
|
{
|
|
1263
|
-
open:
|
|
1264
|
-
value:
|
|
1265
|
-
subject:
|
|
1266
|
-
onChange:
|
|
1390
|
+
open: I,
|
|
1391
|
+
value: A,
|
|
1392
|
+
subject: O,
|
|
1393
|
+
onChange: m
|
|
1267
1394
|
}
|
|
1268
1395
|
),
|
|
1269
|
-
|
|
1270
|
-
|
|
1396
|
+
F && /* @__PURE__ */ E(
|
|
1397
|
+
Nn,
|
|
1271
1398
|
{
|
|
1272
1399
|
topics: ["entity.folder.created"],
|
|
1273
1400
|
onSync: async () => {
|
|
1274
|
-
await
|
|
1401
|
+
await re();
|
|
1275
1402
|
},
|
|
1276
1403
|
hideWhenNoUpdates: !0
|
|
1277
1404
|
}
|
|
1278
1405
|
),
|
|
1279
|
-
|
|
1280
|
-
|
|
1406
|
+
Se && y && !I && /* @__PURE__ */ E(
|
|
1407
|
+
pe,
|
|
1281
1408
|
{
|
|
1282
1409
|
icon: "splitscreen_add",
|
|
1283
1410
|
className: W({ "power-feature": !q }),
|
|
1284
1411
|
"data-tooltip": q ? "Split slicer" : "Power feature - Slicer",
|
|
1285
1412
|
"data-tooltip-delay": 0,
|
|
1286
|
-
onClick:
|
|
1413
|
+
onClick: Le
|
|
1287
1414
|
}
|
|
1288
1415
|
),
|
|
1289
|
-
!
|
|
1290
|
-
|
|
1416
|
+
!y && !I && /* @__PURE__ */ E(
|
|
1417
|
+
pe,
|
|
1291
1418
|
{
|
|
1292
1419
|
icon: "close",
|
|
1293
1420
|
"data-tooltip": "Remove panel",
|
|
1294
1421
|
"data-tooltip-delay": 0,
|
|
1295
|
-
onClick: () =>
|
|
1422
|
+
onClick: () => r(e.id)
|
|
1296
1423
|
}
|
|
1297
1424
|
)
|
|
1298
1425
|
]
|
|
@@ -1302,35 +1429,35 @@ const rn = (e, t, a) => {
|
|
|
1302
1429
|
}
|
|
1303
1430
|
),
|
|
1304
1431
|
!j && /* @__PURE__ */ E(
|
|
1305
|
-
|
|
1432
|
+
jt,
|
|
1306
1433
|
{
|
|
1307
|
-
rowSelection:
|
|
1308
|
-
onRowSelectionChange:
|
|
1309
|
-
expanded:
|
|
1310
|
-
setExpanded:
|
|
1311
|
-
data:
|
|
1434
|
+
rowSelection: V,
|
|
1435
|
+
onRowSelectionChange: te,
|
|
1436
|
+
expanded: le,
|
|
1437
|
+
setExpanded: L,
|
|
1438
|
+
data: ce,
|
|
1312
1439
|
children: /* @__PURE__ */ E(
|
|
1313
|
-
|
|
1440
|
+
$t,
|
|
1314
1441
|
{
|
|
1315
|
-
data:
|
|
1316
|
-
isExpandable:
|
|
1317
|
-
isLoading:
|
|
1318
|
-
forceUpdateTable:
|
|
1319
|
-
globalFilter:
|
|
1442
|
+
data: G,
|
|
1443
|
+
isExpandable: ne,
|
|
1444
|
+
isLoading: de || D,
|
|
1445
|
+
forceUpdateTable: P,
|
|
1446
|
+
globalFilter: A,
|
|
1320
1447
|
rowIdPrefix: `slicer-${e.id}`,
|
|
1321
|
-
onRename:
|
|
1322
|
-
renamingId:
|
|
1323
|
-
renameInitialValue:
|
|
1324
|
-
onSubmitRename:
|
|
1325
|
-
onCancelRename:
|
|
1326
|
-
onRowOptionClick:
|
|
1327
|
-
rowContextMenuBuilders:
|
|
1448
|
+
onRename: F ? (w, _) => $.onRename(_.original) : void 0,
|
|
1449
|
+
renamingId: F ? $.renamingRow?.id : null,
|
|
1450
|
+
renameInitialValue: F ? $.renameInitialValue : void 0,
|
|
1451
|
+
onSubmitRename: F ? (w, _) => $.onSubmitRename(_) : void 0,
|
|
1452
|
+
onCancelRename: F ? $.onCancelRename : void 0,
|
|
1453
|
+
onRowOptionClick: F ? $.onOptionClick : void 0,
|
|
1454
|
+
rowContextMenuBuilders: it
|
|
1328
1455
|
}
|
|
1329
1456
|
)
|
|
1330
1457
|
}
|
|
1331
1458
|
)
|
|
1332
1459
|
] });
|
|
1333
|
-
},
|
|
1460
|
+
}, Bn = U.div`
|
|
1334
1461
|
height: 100%;
|
|
1335
1462
|
width: 100%;
|
|
1336
1463
|
overflow-y: auto;
|
|
@@ -1344,133 +1471,139 @@ const rn = (e, t, a) => {
|
|
|
1344
1471
|
}
|
|
1345
1472
|
`
|
|
1346
1473
|
).join("")}
|
|
1347
|
-
`,
|
|
1474
|
+
`, js = ({
|
|
1348
1475
|
sliceFields: e = [],
|
|
1349
1476
|
entityTypes: t = ["task"],
|
|
1350
|
-
pinnedSliceType:
|
|
1351
|
-
countsSource:
|
|
1352
|
-
onAddToList:
|
|
1353
|
-
enableSplit:
|
|
1477
|
+
pinnedSliceType: n,
|
|
1478
|
+
countsSource: s,
|
|
1479
|
+
onAddToList: d,
|
|
1480
|
+
enableSplit: c
|
|
1354
1481
|
}) => {
|
|
1355
|
-
const { slices:
|
|
1356
|
-
|
|
1357
|
-
}, []),
|
|
1358
|
-
|
|
1359
|
-
}, []), { getParentFolderIds:
|
|
1360
|
-
(
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1482
|
+
const { slices: p, page: h, setPanelExpanded: l, projectName: f, collapsedPanels: y } = Me(), { powerLicense: C } = Oe(), m = !!c, g = m && C ? p : p.slice(0, 1), [S, r] = z(null), u = N((L) => {
|
|
1483
|
+
r("entities" in L ? L : { entities: [L] });
|
|
1484
|
+
}, []), o = N(() => {
|
|
1485
|
+
r(null);
|
|
1486
|
+
}, []), { getParentFolderIds: i } = Pe(), b = N(
|
|
1487
|
+
(L) => {
|
|
1488
|
+
const R = [L, ...i(L)];
|
|
1489
|
+
l(
|
|
1363
1490
|
"hierarchy",
|
|
1364
|
-
(
|
|
1365
|
-
...
|
|
1366
|
-
...Object.fromEntries(
|
|
1491
|
+
(k) => typeof k == "boolean" ? k || Object.fromEntries(R.map((Q) => [Q, !0])) : {
|
|
1492
|
+
...k,
|
|
1493
|
+
...Object.fromEntries(R.map((Q) => [Q, !0]))
|
|
1367
1494
|
}
|
|
1368
1495
|
);
|
|
1369
1496
|
},
|
|
1370
|
-
[
|
|
1371
|
-
),
|
|
1497
|
+
[i, l]
|
|
1498
|
+
), a = Ie(null), [x, T] = z(0);
|
|
1372
1499
|
se(() => {
|
|
1373
|
-
const
|
|
1374
|
-
if (!
|
|
1375
|
-
const
|
|
1376
|
-
return
|
|
1377
|
-
}, [
|
|
1378
|
-
const v =
|
|
1379
|
-
sizes:
|
|
1380
|
-
minSize:
|
|
1381
|
-
height:
|
|
1382
|
-
layoutKey:
|
|
1500
|
+
const L = a.current;
|
|
1501
|
+
if (!L) return;
|
|
1502
|
+
const R = new ResizeObserver(([k]) => T(k.contentRect.height));
|
|
1503
|
+
return R.observe(L), () => R.disconnect();
|
|
1504
|
+
}, [g.length]);
|
|
1505
|
+
const v = g.map((L) => L.id), D = g.length > 1, {
|
|
1506
|
+
sizes: K,
|
|
1507
|
+
minSize: ae,
|
|
1508
|
+
height: oe,
|
|
1509
|
+
layoutKey: Z,
|
|
1383
1510
|
handleResizeEnd: ie
|
|
1384
|
-
} =
|
|
1385
|
-
(
|
|
1386
|
-
).filter((
|
|
1387
|
-
(
|
|
1511
|
+
} = mn(h, v, D ? y : [], x), re = v.slice(0, -1).map(
|
|
1512
|
+
(L, R) => D && (y.includes(L) || y.includes(v[R + 1])) ? R : -1
|
|
1513
|
+
).filter((L) => L >= 0), [q, ee] = z({}), V = N(
|
|
1514
|
+
(L, R) => ee((k) => ({ ...k, [L]: R })),
|
|
1388
1515
|
[]
|
|
1389
|
-
),
|
|
1516
|
+
), le = v.join("|");
|
|
1390
1517
|
se(() => {
|
|
1391
|
-
|
|
1392
|
-
const
|
|
1393
|
-
return
|
|
1518
|
+
ee((L) => {
|
|
1519
|
+
const R = Object.keys(L).filter((k) => v.includes(k));
|
|
1520
|
+
return R.length === Object.keys(L).length ? L : Object.fromEntries(R.map((k) => [k, L[k]]));
|
|
1394
1521
|
});
|
|
1395
|
-
}, [
|
|
1396
|
-
const
|
|
1397
|
-
visibleSlices:
|
|
1522
|
+
}, [le]);
|
|
1523
|
+
const te = {
|
|
1524
|
+
visibleSlices: g,
|
|
1398
1525
|
canCollapse: D,
|
|
1399
1526
|
sliceFields: e,
|
|
1400
1527
|
entityTypes: t,
|
|
1401
|
-
pinnedSliceType:
|
|
1402
|
-
countsSource:
|
|
1403
|
-
onAddToList:
|
|
1404
|
-
openMoveDialog:
|
|
1405
|
-
splitEnabled:
|
|
1528
|
+
pinnedSliceType: n,
|
|
1529
|
+
countsSource: s,
|
|
1530
|
+
onAddToList: d,
|
|
1531
|
+
openMoveDialog: u,
|
|
1532
|
+
splitEnabled: m
|
|
1406
1533
|
};
|
|
1407
|
-
return /* @__PURE__ */
|
|
1408
|
-
|
|
1409
|
-
|
|
1534
|
+
return /* @__PURE__ */ H(_e, { children: [
|
|
1535
|
+
g.length === 1 ? /* @__PURE__ */ E(
|
|
1536
|
+
qe,
|
|
1410
1537
|
{
|
|
1411
|
-
panel:
|
|
1538
|
+
panel: g[0],
|
|
1412
1539
|
isPrimary: !0,
|
|
1413
|
-
search:
|
|
1414
|
-
onSearchChange: (
|
|
1415
|
-
...
|
|
1540
|
+
search: q[g[0].id],
|
|
1541
|
+
onSearchChange: (L) => V(g[0].id, L),
|
|
1542
|
+
...te
|
|
1416
1543
|
}
|
|
1417
|
-
) : /* @__PURE__ */ E(
|
|
1418
|
-
|
|
1544
|
+
) : /* @__PURE__ */ E(Bn, { ref: a, $deadGutters: re, children: /* @__PURE__ */ E(
|
|
1545
|
+
gt,
|
|
1419
1546
|
{
|
|
1420
1547
|
layout: "vertical",
|
|
1421
1548
|
onResizeEnd: ie,
|
|
1422
1549
|
style: {
|
|
1423
1550
|
width: "100%",
|
|
1424
|
-
height:
|
|
1551
|
+
height: oe,
|
|
1425
1552
|
overflow: "hidden"
|
|
1426
1553
|
},
|
|
1427
|
-
children:
|
|
1428
|
-
|
|
1554
|
+
children: g.map((L, R) => /* @__PURE__ */ E(
|
|
1555
|
+
yt,
|
|
1429
1556
|
{
|
|
1430
|
-
size:
|
|
1431
|
-
minSize:
|
|
1557
|
+
size: K[R],
|
|
1558
|
+
minSize: ae,
|
|
1432
1559
|
style: { overflow: "hidden" },
|
|
1433
1560
|
children: /* @__PURE__ */ E(
|
|
1434
|
-
|
|
1561
|
+
qe,
|
|
1435
1562
|
{
|
|
1436
|
-
panel:
|
|
1437
|
-
isPrimary:
|
|
1438
|
-
search:
|
|
1439
|
-
onSearchChange: (
|
|
1440
|
-
...
|
|
1563
|
+
panel: L,
|
|
1564
|
+
isPrimary: R === 0,
|
|
1565
|
+
search: q[L.id],
|
|
1566
|
+
onSearchChange: (k) => V(L.id, k),
|
|
1567
|
+
...te
|
|
1441
1568
|
}
|
|
1442
1569
|
)
|
|
1443
1570
|
},
|
|
1444
|
-
|
|
1571
|
+
L.id
|
|
1445
1572
|
))
|
|
1446
1573
|
},
|
|
1447
|
-
|
|
1574
|
+
Z
|
|
1448
1575
|
) }),
|
|
1449
1576
|
/* @__PURE__ */ E(
|
|
1450
|
-
|
|
1577
|
+
gn,
|
|
1451
1578
|
{
|
|
1452
|
-
projectName:
|
|
1453
|
-
movingEntities:
|
|
1454
|
-
onClose:
|
|
1455
|
-
onMoveComplete:
|
|
1579
|
+
projectName: f,
|
|
1580
|
+
movingEntities: S,
|
|
1581
|
+
onClose: o,
|
|
1582
|
+
onMoveComplete: b
|
|
1456
1583
|
}
|
|
1457
1584
|
)
|
|
1458
1585
|
] });
|
|
1459
1586
|
};
|
|
1460
1587
|
export {
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1588
|
+
ln as S,
|
|
1589
|
+
st as a,
|
|
1590
|
+
Be as b,
|
|
1591
|
+
fn as c,
|
|
1592
|
+
et as d,
|
|
1593
|
+
js as e,
|
|
1594
|
+
vn as f,
|
|
1595
|
+
pn as g,
|
|
1596
|
+
He as h,
|
|
1597
|
+
tt as i,
|
|
1598
|
+
Ne as j,
|
|
1599
|
+
un as k,
|
|
1600
|
+
_n as l,
|
|
1601
|
+
Dn as m,
|
|
1602
|
+
mn as n,
|
|
1603
|
+
Fs as o,
|
|
1604
|
+
Nn as p,
|
|
1605
|
+
rn as q,
|
|
1606
|
+
Ns as r,
|
|
1607
|
+
on as s,
|
|
1608
|
+
In as u
|
|
1476
1609
|
};
|