@ynput/ayon-frontend-shared 0.7.5 → 0.8.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/DetailsPanel.es.js +471 -469
- package/dist/Feed.es.js +1 -1
- package/dist/ListTable.es.js +20 -20
- package/dist/NewEntity.es.js +7 -7
- package/dist/ProjectTreeTable.es.js +2523 -2502
- package/dist/ProjectsTable.es.js +5 -5
- package/dist/Slicer.es.js +28 -25
- package/dist/Views.es.js +150 -151
- package/dist/api.es.js +166 -165
- package/dist/chunks/Actions.es.js +9 -10
- package/dist/chunks/ColumnDropIndicator.es.js +4 -4
- package/dist/chunks/ColumnHeaderMenuUI.es.js +4 -5
- package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +2 -2
- package/dist/chunks/DetailsDialog.es.js +3 -3
- package/dist/chunks/EmptyPlaceholder.es.js +7 -7
- package/dist/chunks/EntityPath.es.js +38 -39
- package/dist/chunks/EntityPickerDialog.es.js +482 -462
- package/dist/chunks/EntityTooltip.es.js +18 -19
- package/dist/chunks/Feed.es.js +1382 -1355
- package/dist/chunks/FilmstripEntityCard.es.js +5201 -0
- package/dist/chunks/FilterErrorActions.es.js +3 -4
- package/dist/chunks/GroupSettingsFallback.es.js +4 -4
- package/dist/chunks/Menu.es.js +242 -240
- package/dist/chunks/MetaWidget.es.js +1948 -1875
- package/dist/chunks/ProjectFoldersContext.es.js +237 -0
- package/dist/chunks/RepresentationsList.es.js +1 -1
- package/dist/chunks/ReviewablesSelector.es.js +1260 -1190
- package/dist/chunks/SimpleTable.es.js +303 -297
- package/dist/chunks/Slicer.es.js +420 -413
- package/dist/chunks/TableExportContextInstance.es.js +622 -378
- package/dist/chunks/TableSettingsFallback.es.js +3 -4
- package/dist/chunks/ThumbnailSimple.es.js +114 -99
- package/dist/chunks/ThumbnailUploaderContext.es.js +48 -0
- package/dist/chunks/VideoPlayer.es.js +8 -9
- package/dist/chunks/Watchers.es.js +929 -872
- package/dist/chunks/{ColumnDropIndicator.styled.es.js → addonColumnTags.es.js} +60 -47
- package/dist/chunks/expandRelativeDates.es.js +1 -1
- package/dist/chunks/getThumbnailUrl.es.js +33 -21
- package/dist/chunks/getUris.es.js +1580 -1610
- package/dist/chunks/queryFilterToClientFilter.es.js +1 -1
- package/dist/chunks/realtimeUpdatesUtils.es.js +15 -15
- package/dist/chunks/searchTerms.es.js +773 -696
- package/dist/chunks/useAttributeEnums.es.js +22 -22
- package/dist/chunks/useDateRangeFilter.es.js +1 -1
- package/dist/chunks/useHierarchySelection.es.js +3 -4
- package/dist/chunks/useLoadModule.es.js +3 -4
- package/dist/components.es.js +1391 -1253
- package/dist/context.es.js +645 -668
- package/dist/hooks.es.js +193 -171
- package/dist/index.es.js +4 -4
- package/dist/types/Actions.d.ts +10 -8
- package/dist/types/DetailsPanel.d.ts +54 -76
- package/dist/types/EntityPickerDialog.d.ts +51 -2
- package/dist/types/Feed.d.ts +24 -24
- package/dist/types/ListTable.d.ts +33 -27
- package/dist/types/NewEntity.d.ts +26 -39
- package/dist/types/ProjectTreeTable.d.ts +318 -212
- package/dist/types/ProjectsTable.d.ts +6 -6
- package/dist/types/RepresentationsList.d.ts +4 -0
- package/dist/types/Slicer.d.ts +63 -246
- package/dist/types/Views.d.ts +71 -298
- package/dist/types/api.d.ts +3164 -2363
- package/dist/types/components.d.ts +537 -497
- package/dist/types/context.d.ts +293 -572
- package/dist/types/hooks.d.ts +76 -47
- package/dist/types/index.d.ts +6 -0
- package/dist/types/util.d.ts +141 -120
- package/dist/util.es.js +71 -68
- package/package.json +6 -6
- package/dist/chunks/EntityUpdatesContext.es.js +0 -61
- package/dist/chunks/PlayableIcon.es.js +0 -5020
- package/dist/chunks/ProjectContext.es.js +0 -158
- package/dist/chunks/useQueryArgumentChangeLoading.es.js +0 -11
- package/dist/chunks/viewUpdateHelper.es.js +0 -153
package/dist/chunks/Slicer.es.js
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
|
-
import { jsx as E, jsxs as G, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { Splitter as
|
|
4
|
-
import
|
|
5
|
-
import { i as
|
|
1
|
+
import { jsx as E, jsxs as G, Fragment as $e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as U, useCallback as O, useMemo as P, useContext as Ct, useEffect as ue, forwardRef as Lt, useRef as we, useId as wt, useImperativeHandle as Et, useLayoutEffect as _e } from "react";
|
|
3
|
+
import { Splitter as Dt, SplitterPanel as kt } from "primereact/splitter";
|
|
4
|
+
import B from "styled-components";
|
|
5
|
+
import { i as Rt, P as At, d as ze, U as it } from "./MetaWidget.es.js";
|
|
6
6
|
import "@module-federation/enhanced/runtime";
|
|
7
|
-
import { menuItemsAt as
|
|
8
|
-
import { toast as
|
|
9
|
-
import { InputText as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { menuItemsAt as Mt } from "@ynput/ayon-addon/host";
|
|
8
|
+
import { toast as Qe } from "react-toastify";
|
|
9
|
+
import { InputText as _t, Button as Pt, Icon as Ot } from "@ynput/ayon-react-components";
|
|
10
|
+
import { bs as Je, bD as Nt, bB as rt, bA as Ft, bG as jt } from "./searchTerms.es.js";
|
|
11
|
+
import { dx as lt, cP as $t, b_ as zt, bE as Ut } from "./getUris.es.js";
|
|
12
12
|
import "primereact/confirmdialog";
|
|
13
|
-
import { o as lt, y as ze, x as ye, d as $t, b as Ue, v as zt, ac as Ut, ab as Bt, u as ct, aj as Vt } from "./TableExportContextInstance.es.js";
|
|
14
13
|
import "lodash";
|
|
15
14
|
import "uuid";
|
|
16
15
|
import "axios";
|
|
16
|
+
import { l as ct, s as Ue, q as be, c as Bt, b as Be, m as Vt, ae as Ht, ad as Gt, u as dt, al as Wt, _ as Xe } from "./TableExportContextInstance.es.js";
|
|
17
17
|
import "semver";
|
|
18
18
|
import "./ContextMenuContextInstance.es.js";
|
|
19
|
-
import
|
|
19
|
+
import Y from "clsx";
|
|
20
20
|
import "react-dom";
|
|
21
|
-
import "react-redux";
|
|
22
21
|
import "react-router-dom";
|
|
23
|
-
import { E as
|
|
24
|
-
import "./
|
|
22
|
+
import { E as qt, u as Kt } from "./EntityPickerDialog.es.js";
|
|
23
|
+
import "./FilmstripEntityCard.es.js";
|
|
25
24
|
import "date-fns";
|
|
26
25
|
import "lexical";
|
|
27
26
|
import "@lexical/markdown";
|
|
@@ -33,60 +32,60 @@ import "@lexical/selection";
|
|
|
33
32
|
import "@lexical/utils";
|
|
34
33
|
import "@lexical/react/LexicalBlockWithAlignableContents";
|
|
35
34
|
import "@lexical/react/LexicalDecoratorBlockNode";
|
|
35
|
+
import { useContributions as Yt, prefetchPiece as Qt, runContribution as Jt } from "@ynput/ayon-addon";
|
|
36
36
|
import "@tanstack/react-table";
|
|
37
|
-
import
|
|
38
|
-
import { b as
|
|
39
|
-
import { D as
|
|
40
|
-
import { a as
|
|
41
|
-
import { g as
|
|
42
|
-
import { u as
|
|
43
|
-
import { b as
|
|
44
|
-
import { n as
|
|
45
|
-
import { a as
|
|
46
|
-
import { u as
|
|
47
|
-
import { u as
|
|
48
|
-
import {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
id: dt,
|
|
37
|
+
import "react-redux";
|
|
38
|
+
import { b as ge, H as Xt, a as Zt, e as en, S as tn } from "./SimpleTable.es.js";
|
|
39
|
+
import { D as nn, L as sn, s as on } from "./sortLists.es.js";
|
|
40
|
+
import { a as Ze, g as Pe } from "./getEntityTypeIcon.es.js";
|
|
41
|
+
import { g as an } from "./iconUtils.es.js";
|
|
42
|
+
import { u as rn, a as ln } from "./useAttributeEnums.es.js";
|
|
43
|
+
import { b as cn, s as dn } from "./buildHierarchicalTableRows.es.js";
|
|
44
|
+
import { n as Ce } from "./entityDefinitions.es.js";
|
|
45
|
+
import { a as un, K as pn } from "./platform.es.js";
|
|
46
|
+
import { u as mn } from "./NewEntityContextInstance.es.js";
|
|
47
|
+
import { u as fn } from "./VersionUploadContextInstance.es.js";
|
|
48
|
+
import { M as hn, a as gn } from "./Menu.es.js";
|
|
49
|
+
const ut = "default", Le = { id: "label", label: "Name", desc: !1 }, Oe = (e) => ({
|
|
50
|
+
id: ut,
|
|
52
51
|
label: e,
|
|
53
52
|
desc: !1
|
|
54
|
-
}),
|
|
55
|
-
if (e === "entityList") return
|
|
56
|
-
const [t] =
|
|
53
|
+
}), yn = ["hierarchy", "assignees", "author"], bn = ["status", "type", "taskType", "folderType"], Ve = (e) => yn.includes(e) ? [Le] : e === "entityList" ? sn : e.startsWith("attrib.") ? [Oe("Attribute order"), Le] : bn.includes(e) ? [Oe("Anatomy order"), Le] : [Oe("Default order"), Le], pt = (e) => {
|
|
54
|
+
if (e === "entityList") return nn;
|
|
55
|
+
const [t] = Ve(e);
|
|
57
56
|
return { by: t.id, desc: t.desc };
|
|
58
|
-
},
|
|
57
|
+
}, eo = (e, t) => {
|
|
59
58
|
const { by: s, desc: a } = t || {};
|
|
60
|
-
return
|
|
61
|
-
},
|
|
62
|
-
const u = (l) =>
|
|
59
|
+
return Ve(e).some((u) => u.id === s) ? { by: s, desc: !!a } : pt(e);
|
|
60
|
+
}, Sn = ["noValue", "hasValue"], Tn = (e) => e.id.startsWith("folder-"), vn = new Intl.Collator(void 0, { sensitivity: "base", numeric: !0 }), Ne = (e) => e.label || e.name || "", mt = (e, t, { by: s, desc: a }) => {
|
|
61
|
+
const u = (l) => Sn.includes(l.id) || t === "entityList" && Tn(l), c = e.filter(u), p = e.filter((l) => !u(l));
|
|
63
62
|
let g;
|
|
64
63
|
if (t === "entityList")
|
|
65
|
-
g =
|
|
64
|
+
g = on(
|
|
66
65
|
p.map((l) => ({
|
|
67
66
|
row: l,
|
|
68
|
-
label:
|
|
67
|
+
label: Ne(l),
|
|
69
68
|
active: l.data?.active ?? !0,
|
|
70
69
|
createdAt: l.data?.createdAt,
|
|
71
70
|
updatedAt: l.data?.updatedAt
|
|
72
71
|
})),
|
|
73
72
|
{ by: s, desc: a }
|
|
74
73
|
).map(({ row: l }) => l);
|
|
75
|
-
else if (s ===
|
|
74
|
+
else if (s === ut)
|
|
76
75
|
g = a ? [...p].reverse() : p;
|
|
77
76
|
else {
|
|
78
77
|
const l = a ? -1 : 1;
|
|
79
78
|
g = [...p].sort(
|
|
80
|
-
(m, y) =>
|
|
79
|
+
(m, y) => vn.compare(Ne(m), Ne(y)) * l
|
|
81
80
|
);
|
|
82
81
|
}
|
|
83
82
|
return [...c, ...g].map(
|
|
84
|
-
(l) => l.subRows?.length ? { ...l, subRows:
|
|
83
|
+
(l) => l.subRows?.length ? { ...l, subRows: mt(l.subRows, t, { by: s, desc: a }) } : l
|
|
85
84
|
);
|
|
86
|
-
},
|
|
87
|
-
const a =
|
|
88
|
-
return s.by !== "label" && s.by === a.by && s.desc === a.desc ? e :
|
|
89
|
-
},
|
|
85
|
+
}, In = (e, t, s) => {
|
|
86
|
+
const a = pt(t);
|
|
87
|
+
return s.by !== "label" && s.by === a.by && s.desc === a.desc ? e : mt(e, t, s);
|
|
88
|
+
}, xn = ({
|
|
90
89
|
options: e,
|
|
91
90
|
sort: t,
|
|
92
91
|
onChange: s,
|
|
@@ -113,7 +112,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
113
112
|
] : void 0
|
|
114
113
|
};
|
|
115
114
|
})
|
|
116
|
-
}),
|
|
115
|
+
}), Cn = 180, ft = 100, ht = 34, Ln = (e, t = [], s = ft) => e.map((a) => t.includes(a) ? ht : s), wn = (e, t, s, a) => {
|
|
117
116
|
const u = e.reduce((m, y) => m + y, 0), c = a.filter(Boolean).length;
|
|
118
117
|
if (!c || u === s) return e;
|
|
119
118
|
if (u < s) {
|
|
@@ -124,18 +123,18 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
124
123
|
if (!g) return e;
|
|
125
124
|
const l = u - s;
|
|
126
125
|
return e.map((m, y) => m - l * (p[y] / g));
|
|
127
|
-
},
|
|
126
|
+
}, En = (e, t, s = [], a = 0, u = Cn) => {
|
|
128
127
|
if (!t.length)
|
|
129
128
|
return { heights: [], mins: [], sizes: [], minSize: 2, height: a };
|
|
130
|
-
const c = t.filter((b) => !s.includes(b)).length, p = (t.length - c) *
|
|
129
|
+
const c = t.filter((b) => !s.includes(b)).length, p = (t.length - c) * ht, g = a && c ? Math.min(
|
|
131
130
|
u,
|
|
132
131
|
Math.max(
|
|
133
|
-
|
|
132
|
+
ft,
|
|
134
133
|
Math.floor((a - p) / c)
|
|
135
134
|
)
|
|
136
|
-
) : u, l =
|
|
135
|
+
) : u, l = Ln(t, s), m = t.map(
|
|
137
136
|
(b, i) => s.includes(b) ? l[i] : Math.max(e[b] ?? g, l[i])
|
|
138
|
-
), y = t.map((b) => !s.includes(b)), C = l.reduce((b, i) => b + i, 0), f = y.some(Boolean) ? Math.max(a, C) : C, h =
|
|
137
|
+
), y = t.map((b) => !s.includes(b)), C = l.reduce((b, i) => b + i, 0), f = y.some(Boolean) ? Math.max(a, C) : C, h = wn(m, l, f, y);
|
|
139
138
|
return {
|
|
140
139
|
heights: h,
|
|
141
140
|
mins: l,
|
|
@@ -144,7 +143,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
144
143
|
minSize: 2,
|
|
145
144
|
height: f
|
|
146
145
|
};
|
|
147
|
-
},
|
|
146
|
+
}, Dn = (e, t, s) => {
|
|
148
147
|
const a = e.map((l, m) => Math.max(l / 100 * t, s[m])), u = Math.max(
|
|
149
148
|
t,
|
|
150
149
|
s.reduce((l, m) => l + m, 0)
|
|
@@ -152,29 +151,29 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
152
151
|
if (c <= 0) return a;
|
|
153
152
|
const p = a.map((l, m) => l - s[m]), g = p.reduce((l, m) => l + m, 0);
|
|
154
153
|
return g ? a.map((l, m) => l - c * (p[m] / g)) : a;
|
|
155
|
-
},
|
|
154
|
+
}, kn = "slicer-splitter", et = {
|
|
156
155
|
minSize: 2,
|
|
157
156
|
size: 12
|
|
158
|
-
},
|
|
159
|
-
const [e, t] =
|
|
160
|
-
|
|
161
|
-
100 -
|
|
157
|
+
}, to = () => {
|
|
158
|
+
const [e, t] = ct(kn, [
|
|
159
|
+
et.size,
|
|
160
|
+
100 - et.size
|
|
162
161
|
]);
|
|
163
162
|
return [e, (a) => {
|
|
164
163
|
t(a.sizes);
|
|
165
164
|
}];
|
|
166
|
-
},
|
|
167
|
-
const [u, c] =
|
|
165
|
+
}, Rn = (e, t, s = [], a = 0) => {
|
|
166
|
+
const [u, c] = ct(
|
|
168
167
|
`slicer-panel-heights-${e}`,
|
|
169
168
|
{}
|
|
170
|
-
), [p, g] =
|
|
169
|
+
), [p, g] = U(0), l = Array.isArray(u) ? {} : u, {
|
|
171
170
|
sizes: m,
|
|
172
171
|
mins: y,
|
|
173
172
|
minSize: C,
|
|
174
173
|
height: f,
|
|
175
174
|
heights: h
|
|
176
|
-
} =
|
|
177
|
-
const I =
|
|
175
|
+
} = En(l, t, s, a), b = (i) => {
|
|
176
|
+
const I = Dn(i.sizes, f, y);
|
|
178
177
|
c({
|
|
179
178
|
...l,
|
|
180
179
|
...Object.fromEntries(
|
|
@@ -192,13 +191,13 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
192
191
|
layoutKey: `${t.join("|")}#${s.join("|")}#${p}`,
|
|
193
192
|
handleResizeEnd: b
|
|
194
193
|
};
|
|
195
|
-
},
|
|
194
|
+
}, An = ({
|
|
196
195
|
projectName: e,
|
|
197
196
|
movingEntities: t,
|
|
198
197
|
onClose: s,
|
|
199
198
|
onMoveComplete: a
|
|
200
199
|
}) => {
|
|
201
|
-
const [u] =
|
|
200
|
+
const [u] = lt(), c = Rt(), { folders: p } = Ue(), g = c?.tableData || [], l = O(
|
|
202
201
|
(b) => c?.getEntityById(b) || p.find((i) => i.id === b),
|
|
203
202
|
[p, c]
|
|
204
203
|
), m = O(
|
|
@@ -226,7 +225,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
226
225
|
}
|
|
227
226
|
a?.(i);
|
|
228
227
|
} catch (I) {
|
|
229
|
-
let r =
|
|
228
|
+
let r = Je(I) || "Failed to move entities";
|
|
230
229
|
if (r.includes("already exists"))
|
|
231
230
|
if (t.entities.length > 1)
|
|
232
231
|
r = "Cannot move some entities - one or more entities with the same name already exist in the target location";
|
|
@@ -237,7 +236,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
237
236
|
const o = r.match(/name '.*?, (.+?)' already exists/);
|
|
238
237
|
r = `Cannot move "${o ? o[1] : "this folder"}" - a folder with this name already exists in the target location`;
|
|
239
238
|
}
|
|
240
|
-
|
|
239
|
+
Qe.error(r);
|
|
241
240
|
} finally {
|
|
242
241
|
s();
|
|
243
242
|
}
|
|
@@ -265,8 +264,8 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
265
264
|
throw new Error(r || "Some move operations failed");
|
|
266
265
|
}
|
|
267
266
|
} catch (b) {
|
|
268
|
-
let i =
|
|
269
|
-
|
|
267
|
+
let i = Je(b) || "Failed to move entities to root";
|
|
268
|
+
Qe.error(i);
|
|
270
269
|
} finally {
|
|
271
270
|
s();
|
|
272
271
|
}
|
|
@@ -310,7 +309,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
310
309
|
) ? "Cannot move folder to its child" : "Cannot move to this location";
|
|
311
310
|
},
|
|
312
311
|
[t, p, g, l]
|
|
313
|
-
), h =
|
|
312
|
+
), h = P(() => t?.entities.every((b) => b.entityType === "folder") || !1, [t]);
|
|
314
313
|
return {
|
|
315
314
|
handleMoveSubmit: m,
|
|
316
315
|
handleMoveToRoot: y,
|
|
@@ -318,20 +317,20 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
318
317
|
getDisabledMessage: f,
|
|
319
318
|
canMoveToRoot: h
|
|
320
319
|
};
|
|
321
|
-
},
|
|
320
|
+
}, Mn = ({
|
|
322
321
|
projectName: e,
|
|
323
322
|
movingEntities: t,
|
|
324
323
|
onClose: s,
|
|
325
324
|
onMoveComplete: a
|
|
326
325
|
}) => {
|
|
327
|
-
const { handleMoveSubmit: u, handleMoveToRoot: c, getDisabledFolderIds: p, getDisabledMessage: g } =
|
|
326
|
+
const { handleMoveSubmit: u, handleMoveToRoot: c, getDisabledFolderIds: p, getDisabledMessage: g } = An({
|
|
328
327
|
projectName: e,
|
|
329
328
|
movingEntities: t ?? null,
|
|
330
329
|
onClose: s,
|
|
331
330
|
onMoveComplete: a
|
|
332
331
|
});
|
|
333
332
|
return t?.entities.length ? /* @__PURE__ */ E(
|
|
334
|
-
|
|
333
|
+
qt,
|
|
335
334
|
{
|
|
336
335
|
projectName: e,
|
|
337
336
|
entityType: "folder",
|
|
@@ -345,8 +344,8 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
345
344
|
getDisabledMessage: g
|
|
346
345
|
}
|
|
347
346
|
) : null;
|
|
348
|
-
},
|
|
349
|
-
const [s, { isLoading: a, isFetching: u }] =
|
|
347
|
+
}, _n = ({ projectName: e, useExtraSlices: t }) => {
|
|
348
|
+
const [s, { isLoading: a, isFetching: u }] = $t(), { formatAssignees: c } = t();
|
|
350
349
|
return {
|
|
351
350
|
getData: async () => {
|
|
352
351
|
const g = await s({ projectName: e || "" }, !0).unwrap();
|
|
@@ -354,39 +353,39 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
354
353
|
},
|
|
355
354
|
isLoading: a || u
|
|
356
355
|
};
|
|
357
|
-
},
|
|
358
|
-
const { isLoading: s, productTypes: a, ...u } =
|
|
356
|
+
}, Pn = ({ scopes: e, useExtraSlices: t }) => {
|
|
357
|
+
const { isLoading: s, productTypes: a, ...u } = be(), { formatStatuses: c, formatTaskTypes: p, formatProductTypes: g, formatTypes: l, formatAttribute: m } = t();
|
|
359
358
|
return { project: u, getStatuses: async () => c(u, e), getTypes: async () => l(u), getTaskTypes: async () => p(u), getProductTypes: async () => g(a), getAttribute: async (i) => m ? m(i).map(
|
|
360
|
-
(I) =>
|
|
359
|
+
(I) => Nt(I.icon ?? void 0) ? { ...I, icon: void 0, img: I.icon, imgShape: "circle" } : I
|
|
361
360
|
) : void 0, isLoading: s };
|
|
362
|
-
},
|
|
361
|
+
}, On = ({ entityTypes: e, request: t }) => {
|
|
363
362
|
const {
|
|
364
363
|
attributes: s,
|
|
365
364
|
isLoading: { siteInfo: a }
|
|
366
|
-
} =
|
|
367
|
-
return { attributes:
|
|
368
|
-
(m) => m.data.enum?.some((y) => y.hidden) ? { ...m, data: { ...m.data, enum:
|
|
365
|
+
} = Bt(), u = Ct(At), c = u?.attribFields?.length ? u.attribFields : s, { projectName: p } = be();
|
|
366
|
+
return { attributes: rn(c, { projectName: p, request: t ?? [] }).filter((m) => rt(m.data)).filter((m) => e.some((y) => m.scope?.includes(y))).map(
|
|
367
|
+
(m) => m.data.enum?.some((y) => y.hidden) ? { ...m, data: { ...m.data, enum: Ft(m.data.enum) } } : m
|
|
369
368
|
), isLoading: a };
|
|
370
|
-
},
|
|
369
|
+
}, Nn = "snippet_folder", ye = "folder", Fn = (e) => `${ye}-${e}`, Fe = (e) => [...e].sort((t, s) => {
|
|
371
370
|
if (t.active && !s.active) return -1;
|
|
372
371
|
if (!t.active && s.active) return 1;
|
|
373
372
|
const a = new Date(t.createdAt || 0);
|
|
374
373
|
return new Date(s.createdAt || 0).getTime() - a.getTime();
|
|
375
|
-
}),
|
|
376
|
-
const { projectName: t } =
|
|
374
|
+
}), jn = (e = !0) => {
|
|
375
|
+
const { projectName: t } = be(), { powerLicense: s } = Be(), {
|
|
377
376
|
data: a,
|
|
378
377
|
isLoading: u,
|
|
379
378
|
isFetching: c
|
|
380
|
-
} =
|
|
379
|
+
} = zt(
|
|
381
380
|
{ projectName: t || "" },
|
|
382
381
|
{
|
|
383
382
|
initialPageParam: { cursor: "" },
|
|
384
383
|
skip: !t || !e
|
|
385
384
|
}
|
|
386
|
-
), { data: p = [], isLoading: g } =
|
|
385
|
+
), { data: p = [], isLoading: g } = Ut(
|
|
387
386
|
{ projectName: t || "" },
|
|
388
387
|
{ skip: !t || !s || !e }
|
|
389
|
-
), l =
|
|
388
|
+
), l = P(() => {
|
|
390
389
|
if (!a?.pages) return [];
|
|
391
390
|
const C = a.pages.flatMap((f) => f.lists);
|
|
392
391
|
if (s && p.length > 0) {
|
|
@@ -429,7 +428,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
429
428
|
name: n.label,
|
|
430
429
|
label: n.label,
|
|
431
430
|
...T.length > 0 && { parents: T },
|
|
432
|
-
icon:
|
|
431
|
+
icon: Ze(n),
|
|
433
432
|
subRows: [],
|
|
434
433
|
data: {
|
|
435
434
|
id: n.id,
|
|
@@ -443,49 +442,49 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
443
442
|
updatedAt: n.updatedAt
|
|
444
443
|
}
|
|
445
444
|
}), I = (n) => n.sort((v, T) => {
|
|
446
|
-
const x = p.findIndex((
|
|
445
|
+
const x = p.findIndex((Q) => Q.id === v.id), D = p.findIndex((Q) => Q.id === T.id);
|
|
447
446
|
return x === -1 && D === -1 ? v.folder.label.localeCompare(T.folder.label) : x === -1 ? 1 : D === -1 ? -1 : x - D;
|
|
448
447
|
}), r = (n) => {
|
|
449
448
|
const v = n.items.map((T) => T.id);
|
|
450
449
|
for (const T of n.children.values())
|
|
451
450
|
v.push(...r(T));
|
|
452
451
|
return v;
|
|
453
|
-
}, d =
|
|
452
|
+
}, d = cn({
|
|
454
453
|
folderNodes: f,
|
|
455
454
|
rootFolderIds: h,
|
|
456
455
|
showEmptyFolders: !1,
|
|
457
|
-
buildFolderRowId:
|
|
456
|
+
buildFolderRowId: Fn,
|
|
458
457
|
createItemRow: i,
|
|
459
458
|
sortFolderNodes: I,
|
|
460
|
-
sortItems:
|
|
459
|
+
sortItems: Fe,
|
|
461
460
|
getFolderLabel: (n) => n.label,
|
|
462
|
-
getFolderIcon: (n) => n.data?.icon ||
|
|
461
|
+
getFolderIcon: (n) => n.data?.icon || Nn,
|
|
463
462
|
getFolderColor: (n) => n.data?.color,
|
|
464
463
|
getItemCount: (n) => n.items.length + Array.from(n.children.values()).reduce((v, T) => v + T.items.length, 0)
|
|
465
464
|
});
|
|
466
465
|
for (const n of d) {
|
|
467
|
-
if (n.id.startsWith(
|
|
468
|
-
const T = n.id.substring((
|
|
466
|
+
if (n.id.startsWith(ye + "-")) {
|
|
467
|
+
const T = n.id.substring((ye + "-").length), x = f.get(T);
|
|
469
468
|
x && (n.data = { ...n.data, childListIds: r(x) });
|
|
470
469
|
}
|
|
471
470
|
const v = [...n.subRows || []];
|
|
472
471
|
for (; v.length > 0; ) {
|
|
473
472
|
const T = v.shift();
|
|
474
|
-
if (T.id.startsWith(
|
|
475
|
-
const x = T.id.substring((
|
|
473
|
+
if (T.id.startsWith(ye + "-")) {
|
|
474
|
+
const x = T.id.substring((ye + "-").length), D = f.get(x);
|
|
476
475
|
D && (T.data = { ...T.data, childListIds: r(D) });
|
|
477
476
|
}
|
|
478
477
|
T.subRows && v.push(...T.subRows);
|
|
479
478
|
}
|
|
480
479
|
}
|
|
481
|
-
const o =
|
|
480
|
+
const o = Fe(b).map((n) => i(n));
|
|
482
481
|
return [...d, ...o];
|
|
483
482
|
}
|
|
484
|
-
return
|
|
483
|
+
return Fe(C).map((f) => ({
|
|
485
484
|
id: f.id,
|
|
486
485
|
name: f.label,
|
|
487
486
|
label: f.label,
|
|
488
|
-
icon:
|
|
487
|
+
icon: Ze(f),
|
|
489
488
|
subRows: [],
|
|
490
489
|
data: {
|
|
491
490
|
id: f.id,
|
|
@@ -504,14 +503,14 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
504
503
|
isLoading: u || c || g,
|
|
505
504
|
isExpandable: m
|
|
506
505
|
};
|
|
507
|
-
},
|
|
508
|
-
const c =
|
|
506
|
+
}, $n = (e, t, s, a) => e.id === "noValue" ? t.get(it)?.count ?? (a ? 0 : void 0) : e.id === "hasValue" ? a ? s : void 0 : t.get(e.id)?.count ?? (e.name ? t.get(e.name)?.count : void 0) ?? (a ? 0 : void 0), gt = (e, t, s, a) => t ? e.map((u) => {
|
|
507
|
+
const c = $n(u, t, s, a);
|
|
509
508
|
return {
|
|
510
509
|
...u,
|
|
511
510
|
badge: c != null ? String(c) : u.badge,
|
|
512
|
-
subRows: u.subRows?.length ?
|
|
511
|
+
subRows: u.subRows?.length ? gt(u.subRows, t, s, a) : u.subRows
|
|
513
512
|
};
|
|
514
|
-
}) : e,
|
|
513
|
+
}) : e, zn = (e) => ({
|
|
515
514
|
id: "noValue",
|
|
516
515
|
name: "noValue",
|
|
517
516
|
label: `No ${e}`,
|
|
@@ -520,7 +519,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
520
519
|
data: {
|
|
521
520
|
id: "noValue"
|
|
522
521
|
}
|
|
523
|
-
}),
|
|
522
|
+
}), Un = (e) => ({
|
|
524
523
|
id: "hasValue",
|
|
525
524
|
name: "hasValue",
|
|
526
525
|
label: `Some ${e}`,
|
|
@@ -529,7 +528,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
529
528
|
data: {
|
|
530
529
|
id: "hasValue"
|
|
531
530
|
}
|
|
532
|
-
}),
|
|
531
|
+
}), tt = [
|
|
533
532
|
{
|
|
534
533
|
label: "Hierarchy",
|
|
535
534
|
value: "hierarchy",
|
|
@@ -548,17 +547,17 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
548
547
|
{
|
|
549
548
|
label: "Task Type",
|
|
550
549
|
value: "taskType",
|
|
551
|
-
icon:
|
|
550
|
+
icon: Pe("task")
|
|
552
551
|
},
|
|
553
552
|
{
|
|
554
553
|
label: "Folder Type",
|
|
555
554
|
value: "folderType",
|
|
556
|
-
icon:
|
|
555
|
+
icon: Pe("folder")
|
|
557
556
|
},
|
|
558
557
|
{
|
|
559
558
|
label: "Product Type",
|
|
560
559
|
value: "productType",
|
|
561
|
-
icon:
|
|
560
|
+
icon: Pe("product")
|
|
562
561
|
},
|
|
563
562
|
{
|
|
564
563
|
label: "Author",
|
|
@@ -570,7 +569,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
570
569
|
value: "entityList",
|
|
571
570
|
icon: "list_alt"
|
|
572
571
|
}
|
|
573
|
-
],
|
|
572
|
+
], Bn = ({
|
|
574
573
|
sliceFields: e,
|
|
575
574
|
usedSliceTypes: t = [],
|
|
576
575
|
entityTypes: s = [],
|
|
@@ -586,13 +585,13 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
586
585
|
onSliceTypeChange: y,
|
|
587
586
|
useExtraSlices: C,
|
|
588
587
|
isLoadingExtraSlices: f
|
|
589
|
-
} =
|
|
590
|
-
...
|
|
588
|
+
} = ze(), h = p ?? m, b = g ?? y, { projectName: i } = be(), { formatAttribute: I } = C(), r = e.filter((w) => tt.some((R) => R.value === w.value)).map((w) => ({
|
|
589
|
+
...tt.find((F) => F.value === w.value),
|
|
591
590
|
...w
|
|
592
|
-
})), d = e.some((w) => w.value === "attributes"), o = h?.startsWith("attrib.") ? h.slice(7) : void 0, n =
|
|
591
|
+
})), d = e.some((w) => w.value === "attributes"), o = h?.startsWith("attrib.") ? h.slice(7) : void 0, n = P(
|
|
593
592
|
() => o ? [o] : [],
|
|
594
593
|
[o]
|
|
595
|
-
), { attributes: v, isLoading: T } =
|
|
594
|
+
), { attributes: v, isLoading: T } = On({
|
|
596
595
|
entityTypes: s,
|
|
597
596
|
request: n
|
|
598
597
|
});
|
|
@@ -600,33 +599,33 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
600
599
|
(w) => r.push({
|
|
601
600
|
label: w.data.title || w.name,
|
|
602
601
|
value: "attrib." + w.name,
|
|
603
|
-
icon:
|
|
602
|
+
icon: an(w.name, w.data.type, rt(w.data))
|
|
604
603
|
})
|
|
605
604
|
);
|
|
606
|
-
const [x, D] =
|
|
607
|
-
project:
|
|
608
|
-
getStatuses:
|
|
609
|
-
getTypes:
|
|
610
|
-
getTaskTypes:
|
|
605
|
+
const [x, D] = U(!1), pe = !!v.find((w) => w.name === o)?.enumIsLoading, {
|
|
606
|
+
project: me,
|
|
607
|
+
getStatuses: se,
|
|
608
|
+
getTypes: fe,
|
|
609
|
+
getTaskTypes: ee,
|
|
611
610
|
getProductTypes: oe,
|
|
612
|
-
getAttribute:
|
|
611
|
+
getAttribute: J,
|
|
613
612
|
isLoading: W
|
|
614
|
-
} =
|
|
615
|
-
data:
|
|
613
|
+
} = Pn({ scopes: s, useExtraSlices: C }), {
|
|
614
|
+
data: X,
|
|
616
615
|
getData: ae,
|
|
617
616
|
isFetching: L
|
|
618
|
-
} =
|
|
617
|
+
} = Kt({
|
|
619
618
|
projectName: i || "",
|
|
620
|
-
folderTypes:
|
|
619
|
+
folderTypes: me?.folderTypes || [],
|
|
621
620
|
includeColors: !0
|
|
622
|
-
}), { getData: A, isLoading:
|
|
621
|
+
}), { getData: A, isLoading: k } = _n({
|
|
623
622
|
projectName: i,
|
|
624
623
|
useExtraSlices: C
|
|
625
624
|
}), {
|
|
626
|
-
getData:
|
|
627
|
-
isLoading:
|
|
628
|
-
isExpandable:
|
|
629
|
-
} =
|
|
625
|
+
getData: te,
|
|
626
|
+
isLoading: Se,
|
|
627
|
+
isExpandable: Ee
|
|
628
|
+
} = jn(h === "entityList"), ne = L || W || k || f && h !== "hierarchy" || Se && h === "entityList" || T || pe, Z = {
|
|
630
629
|
hierarchy: {
|
|
631
630
|
getData: ae,
|
|
632
631
|
isLoading: L,
|
|
@@ -634,28 +633,28 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
634
633
|
},
|
|
635
634
|
assignees: {
|
|
636
635
|
getData: A,
|
|
637
|
-
isLoading:
|
|
636
|
+
isLoading: k,
|
|
638
637
|
isExpandable: !1,
|
|
639
638
|
noValue: !0,
|
|
640
639
|
hasValue: !0
|
|
641
640
|
},
|
|
642
641
|
author: {
|
|
643
642
|
getData: A,
|
|
644
|
-
isLoading:
|
|
643
|
+
isLoading: k,
|
|
645
644
|
isExpandable: !1
|
|
646
645
|
},
|
|
647
646
|
status: {
|
|
648
|
-
getData:
|
|
647
|
+
getData: se,
|
|
649
648
|
isLoading: W,
|
|
650
649
|
isExpandable: !1
|
|
651
650
|
},
|
|
652
651
|
type: {
|
|
653
|
-
getData:
|
|
652
|
+
getData: fe,
|
|
654
653
|
isLoading: W,
|
|
655
654
|
isExpandable: !0
|
|
656
655
|
},
|
|
657
656
|
taskType: {
|
|
658
|
-
getData:
|
|
657
|
+
getData: ee,
|
|
659
658
|
isLoading: W,
|
|
660
659
|
isExpandable: !1
|
|
661
660
|
},
|
|
@@ -665,80 +664,80 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
665
664
|
isExpandable: !1
|
|
666
665
|
},
|
|
667
666
|
entityList: {
|
|
668
|
-
getData:
|
|
669
|
-
isLoading:
|
|
670
|
-
isExpandable:
|
|
667
|
+
getData: te,
|
|
668
|
+
isLoading: Se,
|
|
669
|
+
isExpandable: Ee
|
|
671
670
|
}
|
|
672
671
|
};
|
|
673
672
|
for (const w of v)
|
|
674
|
-
|
|
675
|
-
getData: () =>
|
|
673
|
+
Z["attrib." + w.name] = {
|
|
674
|
+
getData: () => J(w),
|
|
676
675
|
isLoading: T || !!w.enumIsLoading,
|
|
677
676
|
isExpandable: !1,
|
|
678
677
|
isAttribute: !0
|
|
679
678
|
};
|
|
680
|
-
const ie = { data: [], isExpandable: !1 }, [
|
|
681
|
-
(w) =>
|
|
679
|
+
const ie = { data: [], isExpandable: !1 }, [V, _] = U(ie), q = Z[h], re = r.find(
|
|
680
|
+
(w) => Z[w.value] && !t.includes(w.value)
|
|
682
681
|
)?.value;
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
}, [
|
|
686
|
-
const
|
|
687
|
-
const F =
|
|
682
|
+
ue(() => {
|
|
683
|
+
ne || q || !re || b(re, !1);
|
|
684
|
+
}, [ne, q, re]);
|
|
685
|
+
const De = (w, R) => {
|
|
686
|
+
const F = Z[w];
|
|
688
687
|
if (!F) {
|
|
689
688
|
console.warn(`Slice type ${w} not found`);
|
|
690
689
|
return;
|
|
691
690
|
}
|
|
692
|
-
(F.isAttribute && d || e.some((le) => le.value === w)) && b(w,
|
|
691
|
+
(F.isAttribute && d || e.some((le) => le.value === w)) && b(w, R);
|
|
693
692
|
};
|
|
694
|
-
|
|
695
|
-
if (
|
|
693
|
+
ue(() => {
|
|
694
|
+
if (ne) return;
|
|
696
695
|
(async () => {
|
|
697
696
|
try {
|
|
698
|
-
if (!
|
|
697
|
+
if (!q) return;
|
|
699
698
|
D(!0);
|
|
700
|
-
const
|
|
701
|
-
if (
|
|
699
|
+
const R = await q.getData();
|
|
700
|
+
if (R === void 0)
|
|
702
701
|
throw window.alert(
|
|
703
702
|
"Slice options failed to load. This likely means the PowerFeatures addon is out of date. Please update to the latest version."
|
|
704
703
|
), b(re ?? "hierarchy", !1), new Error("Slice data is undefined");
|
|
705
|
-
|
|
706
|
-
data:
|
|
707
|
-
isExpandable:
|
|
704
|
+
q.hasValue && R.unshift(Un(h)), q.noValue && R.unshift(zn(h)), _({
|
|
705
|
+
data: R,
|
|
706
|
+
isExpandable: q.isExpandable
|
|
708
707
|
});
|
|
709
|
-
} catch (
|
|
710
|
-
console.error("Error fetching slice data:",
|
|
708
|
+
} catch (R) {
|
|
709
|
+
console.error("Error fetching slice data:", R), _(ie);
|
|
711
710
|
} finally {
|
|
712
711
|
D(!1);
|
|
713
712
|
}
|
|
714
713
|
})();
|
|
715
|
-
}, [h, i,
|
|
716
|
-
const
|
|
717
|
-
() =>
|
|
718
|
-
[
|
|
719
|
-
), j =
|
|
720
|
-
() =>
|
|
714
|
+
}, [h, i, ne, h === "hierarchy" ? X : null]);
|
|
715
|
+
const K = l?.by, Te = !!l?.desc, N = P(
|
|
716
|
+
() => K ? In(V.data, h, { by: K, desc: Te }) : V.data,
|
|
717
|
+
[V.data, h, K, Te]
|
|
718
|
+
), j = P(
|
|
719
|
+
() => gt(N, a, u, c),
|
|
721
720
|
[N, a, u, c]
|
|
722
|
-
),
|
|
723
|
-
const w = /* @__PURE__ */ new Map(),
|
|
724
|
-
for (;
|
|
725
|
-
const F =
|
|
721
|
+
), He = P(() => {
|
|
722
|
+
const w = /* @__PURE__ */ new Map(), R = [...j];
|
|
723
|
+
for (; R.length > 0; ) {
|
|
724
|
+
const F = R.shift();
|
|
726
725
|
if (F && (w.set(F.id, F), F.subRows && F.subRows.length > 0))
|
|
727
726
|
for (const le of F.subRows)
|
|
728
|
-
|
|
727
|
+
R.push(le);
|
|
729
728
|
}
|
|
730
729
|
return w;
|
|
731
730
|
}, [j]);
|
|
732
731
|
return {
|
|
733
732
|
sliceOptions: r,
|
|
734
|
-
table: { ...
|
|
735
|
-
sliceMap:
|
|
736
|
-
isLoading:
|
|
733
|
+
table: { ...V, data: j },
|
|
734
|
+
sliceMap: He,
|
|
735
|
+
isLoading: Z[h] && Z[h].isLoading || x || ne,
|
|
737
736
|
sliceType: h,
|
|
738
|
-
handleSliceTypeChange:
|
|
737
|
+
handleSliceTypeChange: De
|
|
739
738
|
};
|
|
740
|
-
},
|
|
741
|
-
const u =
|
|
739
|
+
}, Vn = /* @__PURE__ */ new Map(), Hn = (e, t, s, a) => {
|
|
740
|
+
const u = P(() => ({ id: t, desc: !1 }), [t]), c = P(
|
|
742
741
|
() => (s ?? []).filter((b) => b !== t).map((b) => ({ id: b, desc: !1 })),
|
|
743
742
|
[s, t]
|
|
744
743
|
), p = !!a || !e, g = e?.entity === "version" ? { entity: "version", groupBy: u, extraGroupBys: c, args: e.args, skip: p } : {
|
|
@@ -747,14 +746,14 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
747
746
|
extraGroupBys: c,
|
|
748
747
|
args: e?.args ?? { projectName: "" },
|
|
749
748
|
skip: p
|
|
750
|
-
}, { counts: l, total: m, complete: y } =
|
|
749
|
+
}, { counts: l, total: m, complete: y } = ln(g), C = l?.get(it)?.count ?? 0, f = Math.max(m - C, 0);
|
|
751
750
|
return {
|
|
752
|
-
counts: p ? void 0 : l ?? (y ?
|
|
751
|
+
counts: p ? void 0 : l ?? (y ? Vn : void 0),
|
|
753
752
|
total: m,
|
|
754
753
|
filled: f,
|
|
755
754
|
complete: !p && y
|
|
756
755
|
};
|
|
757
|
-
},
|
|
756
|
+
}, Gn = B.div`
|
|
758
757
|
display: flex;
|
|
759
758
|
align-items: center;
|
|
760
759
|
|
|
@@ -762,24 +761,24 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
762
761
|
flex: 1;
|
|
763
762
|
min-width: 0;
|
|
764
763
|
}
|
|
765
|
-
`,
|
|
764
|
+
`, Wn = B(_t)`
|
|
766
765
|
flex: 1;
|
|
767
766
|
min-width: 0;
|
|
768
767
|
height: 28px;
|
|
769
768
|
min-height: 28px;
|
|
770
|
-
`,
|
|
769
|
+
`, qn = ({ open: e, value: t, subject: s, onChange: a }) => {
|
|
771
770
|
const u = () => a(e ? void 0 : ""), c = (g) => {
|
|
772
771
|
g.key === "Escape" && a(void 0);
|
|
773
772
|
}, p = (g) => {
|
|
774
|
-
const l =
|
|
773
|
+
const l = jt(g.clipboardData.getData("text"));
|
|
775
774
|
if (l === null) return;
|
|
776
775
|
g.preventDefault();
|
|
777
776
|
const m = g.currentTarget, y = m.selectionStart ?? t.length, C = m.selectionEnd ?? t.length, f = y + l.length;
|
|
778
777
|
a(t.slice(0, y) + l + t.slice(C)), requestAnimationFrame(() => m.setSelectionRange(f, f));
|
|
779
778
|
};
|
|
780
|
-
return /* @__PURE__ */ G(
|
|
779
|
+
return /* @__PURE__ */ G(Gn, { className: Y({ open: e }), children: [
|
|
781
780
|
e && /* @__PURE__ */ E(
|
|
782
|
-
|
|
781
|
+
Wn,
|
|
783
782
|
{
|
|
784
783
|
value: t,
|
|
785
784
|
onChange: (g) => a(g.target.value),
|
|
@@ -790,22 +789,22 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
790
789
|
}
|
|
791
790
|
),
|
|
792
791
|
/* @__PURE__ */ E(
|
|
793
|
-
|
|
792
|
+
ge,
|
|
794
793
|
{
|
|
795
794
|
icon: e ? "close" : "search",
|
|
796
795
|
onClick: u,
|
|
797
|
-
className:
|
|
796
|
+
className: Y({ open: e }),
|
|
798
797
|
"data-tooltip": e ? "Close search" : `Search ${s}`
|
|
799
798
|
}
|
|
800
799
|
)
|
|
801
800
|
] });
|
|
802
|
-
},
|
|
803
|
-
e.toggleExpanded(t), e.subRows?.forEach((s) =>
|
|
804
|
-
},
|
|
805
|
-
const { onOpenNew: u } =
|
|
801
|
+
}, je = (e, t) => {
|
|
802
|
+
e.toggleExpanded(t), e.subRows?.forEach((s) => je(s, t));
|
|
803
|
+
}, nt = (e) => e.map((t) => t.id).filter(Boolean), Kn = (e, t, s, a) => {
|
|
804
|
+
const { onOpenNew: u } = mn(), { projectName: c } = be(), { setEntities: p } = Vt(), g = fn(), [l] = lt(), { deleteEntities: m } = Ht(), [y, C] = U(null), f = O(
|
|
806
805
|
(r, d) => d.map((o) => t?.get(o) || (o === r.id ? r : void 0)).filter((o) => !!o),
|
|
807
806
|
[t]
|
|
808
|
-
), h =
|
|
807
|
+
), h = P(
|
|
809
808
|
() => ({
|
|
810
809
|
onShowDetails: (r, d = [r.id]) => {
|
|
811
810
|
p({
|
|
@@ -874,12 +873,12 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
874
873
|
}), C(null));
|
|
875
874
|
},
|
|
876
875
|
[c, y, l]
|
|
877
|
-
), i =
|
|
876
|
+
), i = P(
|
|
878
877
|
() => [
|
|
879
878
|
(r, { row: d, selectedRows: o }) => ({
|
|
880
879
|
label: "Show details",
|
|
881
880
|
icon: "dock_to_left",
|
|
882
|
-
shortcut:
|
|
881
|
+
shortcut: un("click", [pn.Alt]),
|
|
883
882
|
command: () => h.onShowDetails(d.original, o)
|
|
884
883
|
}),
|
|
885
884
|
(r, { row: d }) => ({
|
|
@@ -897,7 +896,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
897
896
|
(r, { selectedTableRows: d }) => ({
|
|
898
897
|
label: "Expand all children",
|
|
899
898
|
icon: "expand_all",
|
|
900
|
-
command: () => d.filter((o) => o.getCanExpand() && !o.getIsExpanded()).forEach((o) =>
|
|
899
|
+
command: () => d.filter((o) => o.getCanExpand() && !o.getIsExpanded()).forEach((o) => je(o, !0)),
|
|
901
900
|
hidden: !d.some(
|
|
902
901
|
(o) => o.getCanExpand() && !o.getIsExpanded()
|
|
903
902
|
)
|
|
@@ -905,7 +904,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
905
904
|
(r, { selectedTableRows: d }) => ({
|
|
906
905
|
label: "Collapse all children",
|
|
907
906
|
icon: "collapse_all",
|
|
908
|
-
command: () => d.filter((o) => o.getCanExpand() && o.getIsExpanded()).forEach((o) =>
|
|
907
|
+
command: () => d.filter((o) => o.getCanExpand() && o.getIsExpanded()).forEach((o) => je(o, !1)),
|
|
909
908
|
hidden: !d.some(
|
|
910
909
|
(o) => o.getCanExpand() && o.getIsExpanded()
|
|
911
910
|
)
|
|
@@ -926,19 +925,19 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
926
925
|
hidden: !a
|
|
927
926
|
}),
|
|
928
927
|
(r, { row: d, selectedRows: o }) => ({
|
|
929
|
-
label:
|
|
930
|
-
icon:
|
|
928
|
+
label: Ce.folder.createLabel,
|
|
929
|
+
icon: Ce.folder.icon,
|
|
931
930
|
command: () => u?.("folder", {
|
|
932
|
-
parentFolderIds:
|
|
931
|
+
parentFolderIds: nt(
|
|
933
932
|
f(d.original, o)
|
|
934
933
|
)
|
|
935
934
|
})
|
|
936
935
|
}),
|
|
937
936
|
(r, { row: d, selectedRows: o }) => ({
|
|
938
|
-
label:
|
|
939
|
-
icon:
|
|
937
|
+
label: Ce.task.createLabel,
|
|
938
|
+
icon: Ce.task.icon,
|
|
940
939
|
command: () => u?.("task", {
|
|
941
|
-
parentFolderIds:
|
|
940
|
+
parentFolderIds: nt(
|
|
942
941
|
f(d.original, o)
|
|
943
942
|
)
|
|
944
943
|
})
|
|
@@ -964,7 +963,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
964
963
|
onSubmitRename: b,
|
|
965
964
|
onCancelRename: () => C(null)
|
|
966
965
|
};
|
|
967
|
-
},
|
|
966
|
+
}, Yn = B(Pt)`
|
|
968
967
|
/* put above the menu so it's still clickable */
|
|
969
968
|
/* NOTE: this will need fixing as this also puts it above dialogs */
|
|
970
969
|
/* z-index: 1001; */
|
|
@@ -995,7 +994,7 @@ const dt = "default", Ie = { id: "label", label: "Name", desc: !1 }, Pe = (e) =>
|
|
|
995
994
|
}
|
|
996
995
|
}
|
|
997
996
|
`;
|
|
998
|
-
|
|
997
|
+
B.div`
|
|
999
998
|
display: flex;
|
|
1000
999
|
flex-direction: column;
|
|
1001
1000
|
gap: var(--base-gap-large);
|
|
@@ -1017,10 +1016,10 @@ U.div`
|
|
|
1017
1016
|
font-weight: 600;
|
|
1018
1017
|
}
|
|
1019
1018
|
`;
|
|
1020
|
-
const
|
|
1019
|
+
const Qn = (e, t, s) => {
|
|
1021
1020
|
const a = `${t}${s === 1 ? "" : "s"}`;
|
|
1022
1021
|
return e === "created" ? `new ${a}` : e === "deleted" ? `${a} deleted` : `${s} ${a} ${e.replaceAll("_", " ")}`;
|
|
1023
|
-
},
|
|
1022
|
+
}, Jn = (e) => {
|
|
1024
1023
|
const t = /* @__PURE__ */ new Map();
|
|
1025
1024
|
return e.forEach((a) => {
|
|
1026
1025
|
const [, u, c] = a.topic.split(".");
|
|
@@ -1032,15 +1031,15 @@ const Kn = (e, t, s) => {
|
|
|
1032
1031
|
};
|
|
1033
1032
|
g.ids.add(a.entityId || String(a.id)), t.set(p, g);
|
|
1034
1033
|
}), `${Array.from(t.values()).map(
|
|
1035
|
-
({ entityType: a, updateType: u, ids: c }) =>
|
|
1034
|
+
({ entityType: a, updateType: u, ids: c }) => Qn(u, a, c.size)
|
|
1036
1035
|
).join(", ")} since last sync`;
|
|
1037
|
-
},
|
|
1036
|
+
}, Xn = Lt(
|
|
1038
1037
|
({ projectNames: e, topics: t, onSync: s, shouldSyncOnUpdate: a, hideWhenNoUpdates: u = !1, ...c }, p) => {
|
|
1039
|
-
const [g, l] =
|
|
1040
|
-
|
|
1038
|
+
const [g, l] = U(!1), [m, y] = Gt(), { setMenuOpen: C } = dt(), f = we(null), h = we(), b = wt();
|
|
1039
|
+
ue(() => () => {
|
|
1041
1040
|
const x = h.current;
|
|
1042
1041
|
h.current = void 0, x !== void 0 && clearTimeout(x);
|
|
1043
|
-
}, []),
|
|
1042
|
+
}, []), Et(p, () => f.current, []);
|
|
1044
1043
|
const i = async () => {
|
|
1045
1044
|
l(!0);
|
|
1046
1045
|
try {
|
|
@@ -1048,26 +1047,26 @@ const Kn = (e, t, s) => {
|
|
|
1048
1047
|
} finally {
|
|
1049
1048
|
l(!1);
|
|
1050
1049
|
}
|
|
1051
|
-
}, { updates: I, hasUpdates: r } =
|
|
1050
|
+
}, { updates: I, hasUpdates: r } = Wt({
|
|
1052
1051
|
projectNames: e,
|
|
1053
1052
|
topics: t,
|
|
1054
1053
|
isSyncing: g,
|
|
1055
1054
|
shouldSyncOnUpdate: a
|
|
1056
1055
|
});
|
|
1057
|
-
if (
|
|
1056
|
+
if (ue(() => {
|
|
1058
1057
|
const x = (D) => {
|
|
1059
|
-
D.repeat || !D.shiftKey || D.ctrlKey || D.metaKey || D.key.toLowerCase() !== "r" ||
|
|
1058
|
+
D.repeat || !D.shiftKey || D.ctrlKey || D.metaKey || D.key.toLowerCase() !== "r" || dn(D) || (D.preventDefault(), D.stopPropagation(), i());
|
|
1060
1059
|
};
|
|
1061
1060
|
return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
|
|
1062
1061
|
}, [i]), u && !r) return null;
|
|
1063
|
-
const d =
|
|
1062
|
+
const d = Jn(I), o = Object.values(m).some(Boolean);
|
|
1064
1063
|
Object.values(m).every(Boolean);
|
|
1065
1064
|
const n = () => {
|
|
1066
1065
|
h.current && clearTimeout(h.current);
|
|
1067
1066
|
};
|
|
1068
|
-
return /* @__PURE__ */ G(
|
|
1067
|
+
return /* @__PURE__ */ G($e, { children: [
|
|
1069
1068
|
/* @__PURE__ */ E(
|
|
1070
|
-
|
|
1069
|
+
Yn,
|
|
1071
1070
|
{
|
|
1072
1071
|
...c,
|
|
1073
1072
|
icon: "sync",
|
|
@@ -1079,7 +1078,7 @@ const Kn = (e, t, s) => {
|
|
|
1079
1078
|
onMouseLeave: () => {
|
|
1080
1079
|
n(), h.current = setTimeout(() => C(!1), 100);
|
|
1081
1080
|
},
|
|
1082
|
-
className:
|
|
1081
|
+
className: Y(c.className, {
|
|
1083
1082
|
syncing: g,
|
|
1084
1083
|
"has-updates": r,
|
|
1085
1084
|
"auto-sync": o && !Xe
|
|
@@ -1092,7 +1091,7 @@ const Kn = (e, t, s) => {
|
|
|
1092
1091
|
!Xe
|
|
1093
1092
|
] });
|
|
1094
1093
|
}
|
|
1095
|
-
),
|
|
1094
|
+
), st = B.div`
|
|
1096
1095
|
display: flex;
|
|
1097
1096
|
align-items: center;
|
|
1098
1097
|
gap: var(--base-gap-small);
|
|
@@ -1100,7 +1099,7 @@ const Kn = (e, t, s) => {
|
|
|
1100
1099
|
flex: 1;
|
|
1101
1100
|
min-width: 0;
|
|
1102
1101
|
color: var(--md-sys-color-outline);
|
|
1103
|
-
`,
|
|
1102
|
+
`, Zn = B.span`
|
|
1104
1103
|
display: flex;
|
|
1105
1104
|
align-items: center;
|
|
1106
1105
|
gap: 2px;
|
|
@@ -1113,18 +1112,18 @@ const Kn = (e, t, s) => {
|
|
|
1113
1112
|
border-radius: 50%;
|
|
1114
1113
|
object-fit: cover;
|
|
1115
1114
|
}
|
|
1116
|
-
`,
|
|
1117
|
-
const s =
|
|
1118
|
-
|
|
1115
|
+
`, es = ({ rowSelection: e, sliceMap: t }) => {
|
|
1116
|
+
const s = we(null), [a, u] = U(0);
|
|
1117
|
+
_e(() => {
|
|
1119
1118
|
const i = s.current;
|
|
1120
1119
|
if (!i) return;
|
|
1121
1120
|
const I = new ResizeObserver(([r]) => u(r.contentRect.width));
|
|
1122
1121
|
return I.observe(i), () => I.disconnect();
|
|
1123
1122
|
}, []);
|
|
1124
|
-
const c = Object.keys(e).filter((i) => e[i]).map((i) => t.get(i)).filter((i) => !!i), p = (i) => !!i.icon || !!i.img || !!i.startContent, [g, l] =
|
|
1125
|
-
if (
|
|
1123
|
+
const c = Object.keys(e).filter((i) => e[i]).map((i) => t.get(i)).filter((i) => !!i), p = (i) => !!i.icon || !!i.img || !!i.startContent, [g, l] = U(!0), m = c.length > 1 || !g, [y, C] = U(c.length), f = c.map((i) => i.id).join("|");
|
|
1124
|
+
if (_e(() => {
|
|
1126
1125
|
l(!0), C(c.length);
|
|
1127
|
-
}, [a, f]),
|
|
1126
|
+
}, [a, f]), _e(() => {
|
|
1128
1127
|
const i = s.current;
|
|
1129
1128
|
if (!i || !c.length) return;
|
|
1130
1129
|
const I = Array.from(i.querySelectorAll("[data-chip]")), r = i.querySelector("[data-overflow]")?.offsetWidth ?? 22, d = (x, D) => x.offsetLeft - i.offsetLeft + x.offsetWidth <= D;
|
|
@@ -1136,17 +1135,17 @@ const Kn = (e, t, s) => {
|
|
|
1136
1135
|
if (o && d(o, i.clientWidth)) return;
|
|
1137
1136
|
const n = i.clientWidth - r, v = I.filter((x) => d(x, n)).length, T = Math.max(1, v);
|
|
1138
1137
|
T !== y && C(T);
|
|
1139
|
-
}), !c.length) return /* @__PURE__ */ E(
|
|
1138
|
+
}), !c.length) return /* @__PURE__ */ E(st, { ref: s });
|
|
1140
1139
|
const h = c.slice(0, y), b = c.length - h.length;
|
|
1141
|
-
return /* @__PURE__ */ G(
|
|
1140
|
+
return /* @__PURE__ */ G(st, { ref: s, children: [
|
|
1142
1141
|
h.map((i) => /* @__PURE__ */ G(
|
|
1143
|
-
|
|
1142
|
+
Zn,
|
|
1144
1143
|
{
|
|
1145
1144
|
"data-chip": !0,
|
|
1146
1145
|
title: i.label || i.name,
|
|
1147
1146
|
"aria-label": i.label || i.name,
|
|
1148
1147
|
children: [
|
|
1149
|
-
i.startContent ?? (i.img ? /* @__PURE__ */ E("img", { src: i.img, alt: "" }) : i.icon && /* @__PURE__ */ E(
|
|
1148
|
+
i.startContent ?? (i.img ? /* @__PURE__ */ E("img", { src: i.img, alt: "" }) : i.icon && /* @__PURE__ */ E(Ot, { icon: i.icon, style: { color: i.iconColor } })),
|
|
1150
1149
|
!(m && p(i)) && /* @__PURE__ */ E("span", { children: i.label || i.name })
|
|
1151
1150
|
]
|
|
1152
1151
|
},
|
|
@@ -1157,12 +1156,12 @@ const Kn = (e, t, s) => {
|
|
|
1157
1156
|
b
|
|
1158
1157
|
] })
|
|
1159
1158
|
] });
|
|
1160
|
-
},
|
|
1159
|
+
}, ts = B.div`
|
|
1161
1160
|
height: 28px;
|
|
1162
1161
|
border-radius: 4px;
|
|
1163
1162
|
background: var(--md-sys-color-surface-container);
|
|
1164
1163
|
width: 100px;
|
|
1165
|
-
`,
|
|
1164
|
+
`, ns = B.div`
|
|
1166
1165
|
display: flex;
|
|
1167
1166
|
align-items: center;
|
|
1168
1167
|
gap: var(--base-gap-small);
|
|
@@ -1174,7 +1173,7 @@ const Kn = (e, t, s) => {
|
|
|
1174
1173
|
flex: 1;
|
|
1175
1174
|
min-width: 0;
|
|
1176
1175
|
}
|
|
1177
|
-
`,
|
|
1176
|
+
`, ss = B(Xt)`
|
|
1178
1177
|
.slicer-dropdown {
|
|
1179
1178
|
flex: 0 1 auto;
|
|
1180
1179
|
min-width: 48px;
|
|
@@ -1195,7 +1194,7 @@ const Kn = (e, t, s) => {
|
|
|
1195
1194
|
.power-feature .icon {
|
|
1196
1195
|
color: var(--md-sys-color-tertiary);
|
|
1197
1196
|
}
|
|
1198
|
-
`,
|
|
1197
|
+
`, os = B.div`
|
|
1199
1198
|
display: flex;
|
|
1200
1199
|
align-items: center;
|
|
1201
1200
|
gap: var(--base-gap-small);
|
|
@@ -1208,7 +1207,7 @@ const Kn = (e, t, s) => {
|
|
|
1208
1207
|
text-overflow: ellipsis;
|
|
1209
1208
|
white-space: nowrap;
|
|
1210
1209
|
}
|
|
1211
|
-
`,
|
|
1210
|
+
`, ot = "__splitSlicer__", at = ({
|
|
1212
1211
|
panel: e,
|
|
1213
1212
|
visibleSlices: t,
|
|
1214
1213
|
sliceFields: s,
|
|
@@ -1236,115 +1235,123 @@ const Kn = (e, t, s) => {
|
|
|
1236
1235
|
setPanelExpanded: T,
|
|
1237
1236
|
onSliceTypeChange: x,
|
|
1238
1237
|
isViewSyncPending: D,
|
|
1239
|
-
onOpenViewer:
|
|
1240
|
-
onAddToList:
|
|
1241
|
-
page:
|
|
1242
|
-
getSliceSort:
|
|
1243
|
-
setSliceSort:
|
|
1244
|
-
projectName:
|
|
1245
|
-
} =
|
|
1238
|
+
onOpenViewer: Q,
|
|
1239
|
+
onAddToList: pe,
|
|
1240
|
+
page: me,
|
|
1241
|
+
getSliceSort: se,
|
|
1242
|
+
setSliceSort: fe,
|
|
1243
|
+
projectName: ee
|
|
1244
|
+
} = ze(), { refetch: oe } = Ue(), { powerLicense: J, setPowerpackDialog: W } = Be(), X = o(e.id), ae = v(e.id), L = (S) => {
|
|
1246
1245
|
n(e.id, S);
|
|
1247
1246
|
}, A = O(
|
|
1248
1247
|
(S) => T(e.id, S),
|
|
1249
1248
|
[T, e.id]
|
|
1250
|
-
),
|
|
1249
|
+
), k = P(
|
|
1251
1250
|
() => typeof c == "function" ? c(e.sliceType) : c,
|
|
1252
1251
|
[c, e.sliceType]
|
|
1253
|
-
),
|
|
1252
|
+
), te = P(() => {
|
|
1254
1253
|
const S = t.map(($) => $.sliceType);
|
|
1255
1254
|
if (typeof c != "function") return S;
|
|
1256
|
-
const M = ($) => JSON.stringify([$?.entity, $?.args]), ce = M(
|
|
1255
|
+
const M = ($) => JSON.stringify([$?.entity, $?.args]), ce = M(k);
|
|
1257
1256
|
return S.filter(($) => $ === e.sliceType || M(c($)) === ce);
|
|
1258
|
-
}, [c,
|
|
1259
|
-
|
|
1257
|
+
}, [c, k, t, e.sliceType]), { counts: Se, filled: Ee, complete: ne } = Hn(
|
|
1258
|
+
k,
|
|
1260
1259
|
e.sliceType,
|
|
1261
|
-
|
|
1262
|
-
),
|
|
1260
|
+
te
|
|
1261
|
+
), Z = O(
|
|
1263
1262
|
(S, M) => {
|
|
1264
1263
|
y ? x(S, M) : d(e.id, S);
|
|
1265
1264
|
},
|
|
1266
1265
|
[y, x, d, e.id]
|
|
1267
|
-
), ie =
|
|
1266
|
+
), ie = P(
|
|
1268
1267
|
() => t.filter((S) => S.id !== e.id).map((S) => S.sliceType),
|
|
1269
1268
|
[t, e.id]
|
|
1270
1269
|
), {
|
|
1271
|
-
sliceOptions:
|
|
1272
|
-
sliceType:
|
|
1273
|
-
handleSliceTypeChange:
|
|
1274
|
-
table: { data: re, isExpandable:
|
|
1275
|
-
sliceMap:
|
|
1276
|
-
isLoading:
|
|
1277
|
-
} =
|
|
1270
|
+
sliceOptions: V,
|
|
1271
|
+
sliceType: _,
|
|
1272
|
+
handleSliceTypeChange: q,
|
|
1273
|
+
table: { data: re, isExpandable: De },
|
|
1274
|
+
sliceMap: K,
|
|
1275
|
+
isLoading: Te
|
|
1276
|
+
} = Bn({
|
|
1278
1277
|
sliceFields: s,
|
|
1279
1278
|
usedSliceTypes: ie,
|
|
1280
1279
|
entityTypes: a,
|
|
1281
|
-
counts:
|
|
1282
|
-
filled:
|
|
1283
|
-
countsComplete:
|
|
1280
|
+
counts: Se,
|
|
1281
|
+
filled: Ee,
|
|
1282
|
+
countsComplete: ne,
|
|
1284
1283
|
sliceType: e.sliceType,
|
|
1285
|
-
onSliceTypeChange:
|
|
1286
|
-
sort:
|
|
1287
|
-
}), N =
|
|
1288
|
-
p ||
|
|
1289
|
-
|
|
1290
|
-
|
|
1284
|
+
onSliceTypeChange: Z,
|
|
1285
|
+
sort: se(e.sliceType)
|
|
1286
|
+
}), N = _ === "hierarchy", j = !!m && I.includes(e.id), w = V.find((S) => S.value === _)?.label || _, R = C !== void 0, F = C ?? "", le = N ? "Folders" : w, H = Kn(
|
|
1287
|
+
p || pe,
|
|
1288
|
+
K,
|
|
1289
|
+
Q,
|
|
1291
1290
|
g
|
|
1292
|
-
), { contributions:
|
|
1293
|
-
() =>
|
|
1294
|
-
(S) => !S.sliceTypes?.length || S.sliceTypes.includes(
|
|
1291
|
+
), { contributions: Ge } = Yt("slicer.menuItem"), ke = P(
|
|
1292
|
+
() => Ge.filter(
|
|
1293
|
+
(S) => !S.sliceTypes?.length || S.sliceTypes.includes(_)
|
|
1295
1294
|
),
|
|
1296
|
-
[
|
|
1297
|
-
),
|
|
1295
|
+
[Ge, _]
|
|
1296
|
+
), Re = (S, M, ce = "bottom") => {
|
|
1298
1297
|
if (!M.length) return [];
|
|
1299
|
-
const $ = M.map((
|
|
1300
|
-
const
|
|
1298
|
+
const $ = _ === "hierarchy", Ie = M.map((z) => {
|
|
1299
|
+
const de = K.get(z), xe = de?.data?.entityType;
|
|
1301
1300
|
return {
|
|
1302
|
-
id:
|
|
1303
|
-
|
|
1304
|
-
|
|
1301
|
+
id: z,
|
|
1302
|
+
name: de?.name,
|
|
1303
|
+
label: de?.label || de?.name || void 0,
|
|
1304
|
+
// hierarchy rows are folders and tasks, like useHierarchyContextMenuItems reads them
|
|
1305
|
+
entityType: $ ? xe === "task" ? "task" : "folder" : xe
|
|
1305
1306
|
};
|
|
1306
|
-
}),
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1307
|
+
}), It = $ ? Ie.map(({ id: z, name: de, entityType: xe }) => ({
|
|
1308
|
+
id: z,
|
|
1309
|
+
entityType: xe,
|
|
1310
|
+
projectName: ee,
|
|
1311
|
+
name: de,
|
|
1312
|
+
label: K.get(z)?.label || void 0
|
|
1313
|
+
})) : [], xt = { projectName: ee, sliceType: _, selected: Ie, entities: It, menu: S };
|
|
1314
|
+
return Mt(ke, ce).filter((z) => !z.in?.length || z.in.includes(S)).map((z) => ({
|
|
1315
|
+
id: z.key,
|
|
1316
|
+
label: z.label,
|
|
1317
|
+
icon: z.icon,
|
|
1318
|
+
[S === "context" ? "command" : "onClick"]: () => Jt(z, xt)
|
|
1312
1319
|
}));
|
|
1313
|
-
},
|
|
1320
|
+
}, We = (S) => (M, { rowId: ce, selectedRows: $ }) => (S === "top" && ke.forEach((Ie) => Qt(Ie.run)), Re(
|
|
1314
1321
|
"context",
|
|
1315
1322
|
$.includes(ce) ? $ : [ce],
|
|
1316
1323
|
S
|
|
1317
|
-
)),
|
|
1318
|
-
|
|
1319
|
-
...N ?
|
|
1320
|
-
|
|
1321
|
-
...N ? [
|
|
1322
|
-
] : N ? [...
|
|
1323
|
-
() =>
|
|
1324
|
-
[
|
|
1325
|
-
),
|
|
1326
|
-
const S =
|
|
1324
|
+
)), yt = ke.length ? [
|
|
1325
|
+
We("top"),
|
|
1326
|
+
...N ? H.rowContextMenuBuilders : [],
|
|
1327
|
+
We("bottom"),
|
|
1328
|
+
...N ? [H.deleteContextMenuBuilder] : []
|
|
1329
|
+
] : N ? [...H.rowContextMenuBuilders, H.deleteContextMenuBuilder] : [], qe = P(
|
|
1330
|
+
() => V.map((S) => S.value).filter((S) => !t.some((M) => M.sliceType === S)),
|
|
1331
|
+
[V, t]
|
|
1332
|
+
), ve = !!l && qe.length > 0, Ae = P(() => {
|
|
1333
|
+
const S = V.map(
|
|
1327
1334
|
(M) => ie.includes(M.value) ? { ...M, disabled: !0, disabledMessage: "Already used by another panel" } : M
|
|
1328
1335
|
);
|
|
1329
|
-
return
|
|
1330
|
-
}, [
|
|
1331
|
-
if (!
|
|
1332
|
-
b(
|
|
1333
|
-
}, { menuOpen:
|
|
1334
|
-
...
|
|
1336
|
+
return ve && S.push({ label: "Split slicer", value: ot, icon: "splitscreen_add" }), S;
|
|
1337
|
+
}, [V, ie, ve]), Me = () => {
|
|
1338
|
+
if (!J) return W("slicer");
|
|
1339
|
+
b(qe[0]);
|
|
1340
|
+
}, { menuOpen: bt, toggleMenuOpen: Ke } = dt(), he = `slicer-menu-${me}-${e.id}`.replace(/[^\w-]/g, "-"), St = bt === he, Ye = Object.keys(X).filter((S) => X[S]), Tt = [
|
|
1341
|
+
...Re("dropdown", Ye, "top"),
|
|
1335
1342
|
{
|
|
1336
1343
|
id: "search",
|
|
1337
1344
|
label: `Search ${le}`,
|
|
1338
1345
|
icon: "search",
|
|
1339
1346
|
onClick: () => f("")
|
|
1340
1347
|
},
|
|
1341
|
-
...
|
|
1348
|
+
...ve && y ? [
|
|
1342
1349
|
{
|
|
1343
1350
|
id: "split",
|
|
1344
1351
|
label: "Split slicer",
|
|
1345
1352
|
icon: "splitscreen_add",
|
|
1346
1353
|
powerFeature: "slicer",
|
|
1347
|
-
onClick:
|
|
1354
|
+
onClick: Me
|
|
1348
1355
|
}
|
|
1349
1356
|
] : [],
|
|
1350
1357
|
...y ? [] : [
|
|
@@ -1355,33 +1362,33 @@ const Kn = (e, t, s) => {
|
|
|
1355
1362
|
onClick: () => i(e.id)
|
|
1356
1363
|
}
|
|
1357
1364
|
],
|
|
1358
|
-
|
|
1365
|
+
xn({
|
|
1359
1366
|
id: "sort",
|
|
1360
|
-
options:
|
|
1361
|
-
sort:
|
|
1362
|
-
onChange: (S) =>
|
|
1367
|
+
options: Ve(_),
|
|
1368
|
+
sort: se(_),
|
|
1369
|
+
onChange: (S) => fe(_, S)
|
|
1363
1370
|
}),
|
|
1364
|
-
...
|
|
1365
|
-
],
|
|
1371
|
+
...Re("dropdown", Ye)
|
|
1372
|
+
], vt = (S) => {
|
|
1366
1373
|
const M = String(S[0]);
|
|
1367
|
-
if (M ===
|
|
1368
|
-
|
|
1374
|
+
if (M === ot) {
|
|
1375
|
+
Me();
|
|
1369
1376
|
return;
|
|
1370
1377
|
}
|
|
1371
|
-
|
|
1378
|
+
q(M, !!y && u === _);
|
|
1372
1379
|
};
|
|
1373
|
-
return /* @__PURE__ */ G(
|
|
1380
|
+
return /* @__PURE__ */ G(Zt, { children: [
|
|
1374
1381
|
/* @__PURE__ */ G(
|
|
1375
|
-
|
|
1382
|
+
ss,
|
|
1376
1383
|
{
|
|
1377
|
-
className:
|
|
1384
|
+
className: Y({ collapsed: j }),
|
|
1378
1385
|
onClick: j ? () => r(e.id) : void 0,
|
|
1379
1386
|
children: [
|
|
1380
1387
|
m && /* @__PURE__ */ E(
|
|
1381
|
-
|
|
1388
|
+
ge,
|
|
1382
1389
|
{
|
|
1383
1390
|
icon: "expand_more",
|
|
1384
|
-
className:
|
|
1391
|
+
className: Y("collapse-toggle", { collapsed: j }),
|
|
1385
1392
|
"data-tooltip": j ? "Expand panel" : "Collapse panel",
|
|
1386
1393
|
"data-tooltip-delay": 0,
|
|
1387
1394
|
onClick: () => r(e.id)
|
|
@@ -1390,50 +1397,50 @@ const Kn = (e, t, s) => {
|
|
|
1390
1397
|
j ? (
|
|
1391
1398
|
// the dropdown cannot be used from a collapsed panel, but the dimension it
|
|
1392
1399
|
// shows has to read the same as the dropdown does when open
|
|
1393
|
-
/* @__PURE__ */ E(
|
|
1394
|
-
) : D ? /* @__PURE__ */ E(
|
|
1400
|
+
/* @__PURE__ */ E(os, { children: /* @__PURE__ */ E("span", { children: w }) })
|
|
1401
|
+
) : D ? /* @__PURE__ */ E(ts, {}) : !R && /* @__PURE__ */ E(
|
|
1395
1402
|
h,
|
|
1396
1403
|
{
|
|
1397
|
-
options:
|
|
1398
|
-
value: [
|
|
1404
|
+
options: Ae,
|
|
1405
|
+
value: [_],
|
|
1399
1406
|
sliceTypes: s.map((S) => S.value),
|
|
1400
|
-
onChange: (S) =>
|
|
1401
|
-
className:
|
|
1402
|
-
disableOpen:
|
|
1407
|
+
onChange: (S) => vt(S),
|
|
1408
|
+
className: Y("slicer-dropdown", { "single-option": Ae.length === 1 }),
|
|
1409
|
+
disableOpen: Ae.length === 1
|
|
1403
1410
|
}
|
|
1404
1411
|
),
|
|
1405
|
-
j && /* @__PURE__ */ E(
|
|
1412
|
+
j && /* @__PURE__ */ E(es, { rowSelection: X, sliceMap: K }),
|
|
1406
1413
|
/* @__PURE__ */ G(
|
|
1407
|
-
|
|
1414
|
+
ns,
|
|
1408
1415
|
{
|
|
1409
|
-
className:
|
|
1416
|
+
className: Y({ searching: R }),
|
|
1410
1417
|
onClick: (S) => S.stopPropagation(),
|
|
1411
1418
|
children: [
|
|
1412
|
-
!j && !
|
|
1419
|
+
!j && !R && /* @__PURE__ */ G($e, { children: [
|
|
1413
1420
|
/* @__PURE__ */ E(
|
|
1414
|
-
|
|
1421
|
+
ge,
|
|
1415
1422
|
{
|
|
1416
1423
|
icon: "more_horiz",
|
|
1417
|
-
id:
|
|
1418
|
-
className:
|
|
1424
|
+
id: he,
|
|
1425
|
+
className: Y("slicer-menu", { active: St }),
|
|
1419
1426
|
"data-tooltip": "More",
|
|
1420
1427
|
"data-tooltip-delay": 0,
|
|
1421
|
-
onClick: () => Ke(
|
|
1428
|
+
onClick: () => Ke(he)
|
|
1422
1429
|
}
|
|
1423
1430
|
),
|
|
1424
|
-
/* @__PURE__ */ E(
|
|
1431
|
+
/* @__PURE__ */ E(hn, { targetId: he, id: he, align: "left", children: /* @__PURE__ */ E(gn, { menu: Tt, onClose: () => Ke(!1) }) })
|
|
1425
1432
|
] }),
|
|
1426
1433
|
!j && /* @__PURE__ */ E(
|
|
1427
|
-
|
|
1434
|
+
qn,
|
|
1428
1435
|
{
|
|
1429
|
-
open:
|
|
1436
|
+
open: R,
|
|
1430
1437
|
value: F,
|
|
1431
1438
|
subject: le,
|
|
1432
1439
|
onChange: f
|
|
1433
1440
|
}
|
|
1434
1441
|
),
|
|
1435
1442
|
N && /* @__PURE__ */ E(
|
|
1436
|
-
|
|
1443
|
+
Xn,
|
|
1437
1444
|
{
|
|
1438
1445
|
topics: ["entity.folder.created"],
|
|
1439
1446
|
onSync: async () => {
|
|
@@ -1442,18 +1449,18 @@ const Kn = (e, t, s) => {
|
|
|
1442
1449
|
hideWhenNoUpdates: !0
|
|
1443
1450
|
}
|
|
1444
1451
|
),
|
|
1445
|
-
|
|
1446
|
-
|
|
1452
|
+
ve && y && !R && /* @__PURE__ */ E(
|
|
1453
|
+
ge,
|
|
1447
1454
|
{
|
|
1448
1455
|
icon: "splitscreen_add",
|
|
1449
|
-
className:
|
|
1450
|
-
"data-tooltip":
|
|
1456
|
+
className: Y({ "power-feature": !J }),
|
|
1457
|
+
"data-tooltip": J ? "Split slicer" : "Power feature - Slicer",
|
|
1451
1458
|
"data-tooltip-delay": 0,
|
|
1452
|
-
onClick:
|
|
1459
|
+
onClick: Me
|
|
1453
1460
|
}
|
|
1454
1461
|
),
|
|
1455
|
-
!y && !
|
|
1456
|
-
|
|
1462
|
+
!y && !R && /* @__PURE__ */ E(
|
|
1463
|
+
ge,
|
|
1457
1464
|
{
|
|
1458
1465
|
icon: "close",
|
|
1459
1466
|
"data-tooltip": "Remove panel",
|
|
@@ -1468,36 +1475,36 @@ const Kn = (e, t, s) => {
|
|
|
1468
1475
|
}
|
|
1469
1476
|
),
|
|
1470
1477
|
!j && /* @__PURE__ */ E(
|
|
1471
|
-
|
|
1478
|
+
en,
|
|
1472
1479
|
{
|
|
1473
|
-
rowSelection:
|
|
1480
|
+
rowSelection: X,
|
|
1474
1481
|
onRowSelectionChange: L,
|
|
1475
1482
|
expanded: ae,
|
|
1476
1483
|
setExpanded: A,
|
|
1477
|
-
data:
|
|
1484
|
+
data: K,
|
|
1478
1485
|
children: /* @__PURE__ */ E(
|
|
1479
|
-
|
|
1486
|
+
tn,
|
|
1480
1487
|
{
|
|
1481
1488
|
data: re,
|
|
1482
|
-
isExpandable:
|
|
1483
|
-
isLoading:
|
|
1484
|
-
forceUpdateTable:
|
|
1489
|
+
isExpandable: De,
|
|
1490
|
+
isLoading: Te || D,
|
|
1491
|
+
forceUpdateTable: _,
|
|
1485
1492
|
globalFilter: F,
|
|
1486
1493
|
rowIdPrefix: `slicer-${e.id}`,
|
|
1487
|
-
onRename: N ? (S, M) =>
|
|
1488
|
-
renamingId: N ?
|
|
1489
|
-
renameInitialValue: N ?
|
|
1490
|
-
onSubmitRename: N ? (S, M) =>
|
|
1491
|
-
onCancelRename: N ?
|
|
1492
|
-
onRowOptionClick: N ?
|
|
1493
|
-
rowContextMenuBuilders:
|
|
1494
|
-
addonShortcuts: { table: "slicer", projectName:
|
|
1494
|
+
onRename: N ? (S, M) => H.onRename(M.original) : void 0,
|
|
1495
|
+
renamingId: N ? H.renamingRow?.id : null,
|
|
1496
|
+
renameInitialValue: N ? H.renameInitialValue : void 0,
|
|
1497
|
+
onSubmitRename: N ? (S, M) => H.onSubmitRename(M) : void 0,
|
|
1498
|
+
onCancelRename: N ? H.onCancelRename : void 0,
|
|
1499
|
+
onRowOptionClick: N ? H.onOptionClick : void 0,
|
|
1500
|
+
rowContextMenuBuilders: yt,
|
|
1501
|
+
addonShortcuts: { table: "slicer", projectName: ee }
|
|
1495
1502
|
}
|
|
1496
1503
|
)
|
|
1497
1504
|
}
|
|
1498
1505
|
)
|
|
1499
1506
|
] });
|
|
1500
|
-
},
|
|
1507
|
+
}, as = B.div`
|
|
1501
1508
|
height: 100%;
|
|
1502
1509
|
width: 100%;
|
|
1503
1510
|
overflow-y: auto;
|
|
@@ -1511,7 +1518,7 @@ const Kn = (e, t, s) => {
|
|
|
1511
1518
|
}
|
|
1512
1519
|
`
|
|
1513
1520
|
).join("")}
|
|
1514
|
-
`,
|
|
1521
|
+
`, no = ({
|
|
1515
1522
|
sliceFields: e = [],
|
|
1516
1523
|
entityTypes: t = ["task"],
|
|
1517
1524
|
pinnedSliceType: s,
|
|
@@ -1519,47 +1526,47 @@ const Kn = (e, t, s) => {
|
|
|
1519
1526
|
onAddToList: u,
|
|
1520
1527
|
enableSplit: c
|
|
1521
1528
|
}) => {
|
|
1522
|
-
const { slices: p, page: g, setPanelExpanded: l, projectName: m, collapsedPanels: y } =
|
|
1529
|
+
const { slices: p, page: g, setPanelExpanded: l, projectName: m, collapsedPanels: y } = ze(), { powerLicense: C } = Be(), f = !!c, h = f && C ? p : p.slice(0, 1), [b, i] = U(null), I = O((L) => {
|
|
1523
1530
|
i("entities" in L ? L : { entities: [L] });
|
|
1524
1531
|
}, []), r = O(() => {
|
|
1525
1532
|
i(null);
|
|
1526
|
-
}, []), { getParentFolderIds: d } =
|
|
1533
|
+
}, []), { getParentFolderIds: d } = Ue(), o = O(
|
|
1527
1534
|
(L) => {
|
|
1528
1535
|
const A = [L, ...d(L)];
|
|
1529
1536
|
l(
|
|
1530
1537
|
"hierarchy",
|
|
1531
|
-
(
|
|
1532
|
-
...
|
|
1533
|
-
...Object.fromEntries(A.map((
|
|
1538
|
+
(k) => typeof k == "boolean" ? k || Object.fromEntries(A.map((te) => [te, !0])) : {
|
|
1539
|
+
...k,
|
|
1540
|
+
...Object.fromEntries(A.map((te) => [te, !0]))
|
|
1534
1541
|
}
|
|
1535
1542
|
);
|
|
1536
1543
|
},
|
|
1537
1544
|
[d, l]
|
|
1538
|
-
), n =
|
|
1539
|
-
|
|
1545
|
+
), n = we(null), [v, T] = U(0);
|
|
1546
|
+
ue(() => {
|
|
1540
1547
|
const L = n.current;
|
|
1541
1548
|
if (!L) return;
|
|
1542
|
-
const A = new ResizeObserver(([
|
|
1549
|
+
const A = new ResizeObserver(([k]) => T(k.contentRect.height));
|
|
1543
1550
|
return A.observe(L), () => A.disconnect();
|
|
1544
1551
|
}, [h.length]);
|
|
1545
1552
|
const x = h.map((L) => L.id), D = h.length > 1, {
|
|
1546
|
-
sizes:
|
|
1547
|
-
minSize:
|
|
1548
|
-
height:
|
|
1549
|
-
layoutKey:
|
|
1550
|
-
handleResizeEnd:
|
|
1551
|
-
} =
|
|
1553
|
+
sizes: Q,
|
|
1554
|
+
minSize: pe,
|
|
1555
|
+
height: me,
|
|
1556
|
+
layoutKey: se,
|
|
1557
|
+
handleResizeEnd: fe
|
|
1558
|
+
} = Rn(g, x, D ? y : [], v), ee = x.slice(0, -1).map(
|
|
1552
1559
|
(L, A) => D && (y.includes(L) || y.includes(x[A + 1])) ? A : -1
|
|
1553
|
-
).filter((L) => L >= 0), [oe,
|
|
1554
|
-
(L, A) =>
|
|
1560
|
+
).filter((L) => L >= 0), [oe, J] = U({}), W = O(
|
|
1561
|
+
(L, A) => J((k) => ({ ...k, [L]: A })),
|
|
1555
1562
|
[]
|
|
1556
|
-
),
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
const A = Object.keys(L).filter((
|
|
1560
|
-
return A.length === Object.keys(L).length ? L : Object.fromEntries(A.map((
|
|
1563
|
+
), X = x.join("|");
|
|
1564
|
+
ue(() => {
|
|
1565
|
+
J((L) => {
|
|
1566
|
+
const A = Object.keys(L).filter((k) => x.includes(k));
|
|
1567
|
+
return A.length === Object.keys(L).length ? L : Object.fromEntries(A.map((k) => [k, L[k]]));
|
|
1561
1568
|
});
|
|
1562
|
-
}, [
|
|
1569
|
+
}, [X]);
|
|
1563
1570
|
const ae = {
|
|
1564
1571
|
visibleSlices: h,
|
|
1565
1572
|
canCollapse: D,
|
|
@@ -1571,9 +1578,9 @@ const Kn = (e, t, s) => {
|
|
|
1571
1578
|
openMoveDialog: I,
|
|
1572
1579
|
splitEnabled: f
|
|
1573
1580
|
};
|
|
1574
|
-
return /* @__PURE__ */ G(
|
|
1581
|
+
return /* @__PURE__ */ G($e, { children: [
|
|
1575
1582
|
h.length === 1 ? /* @__PURE__ */ E(
|
|
1576
|
-
|
|
1583
|
+
at,
|
|
1577
1584
|
{
|
|
1578
1585
|
panel: h[0],
|
|
1579
1586
|
isPrimary: !0,
|
|
@@ -1581,29 +1588,29 @@ const Kn = (e, t, s) => {
|
|
|
1581
1588
|
onSearchChange: (L) => W(h[0].id, L),
|
|
1582
1589
|
...ae
|
|
1583
1590
|
}
|
|
1584
|
-
) : /* @__PURE__ */ E(
|
|
1585
|
-
|
|
1591
|
+
) : /* @__PURE__ */ E(as, { ref: n, $deadGutters: ee, children: /* @__PURE__ */ E(
|
|
1592
|
+
Dt,
|
|
1586
1593
|
{
|
|
1587
1594
|
layout: "vertical",
|
|
1588
|
-
onResizeEnd:
|
|
1595
|
+
onResizeEnd: fe,
|
|
1589
1596
|
style: {
|
|
1590
1597
|
width: "100%",
|
|
1591
|
-
height:
|
|
1598
|
+
height: me,
|
|
1592
1599
|
overflow: "hidden"
|
|
1593
1600
|
},
|
|
1594
1601
|
children: h.map((L, A) => /* @__PURE__ */ E(
|
|
1595
|
-
|
|
1602
|
+
kt,
|
|
1596
1603
|
{
|
|
1597
|
-
size:
|
|
1598
|
-
minSize:
|
|
1604
|
+
size: Q[A],
|
|
1605
|
+
minSize: pe,
|
|
1599
1606
|
style: { overflow: "hidden" },
|
|
1600
1607
|
children: /* @__PURE__ */ E(
|
|
1601
|
-
|
|
1608
|
+
at,
|
|
1602
1609
|
{
|
|
1603
1610
|
panel: L,
|
|
1604
1611
|
isPrimary: A === 0,
|
|
1605
1612
|
search: oe[L.id],
|
|
1606
|
-
onSearchChange: (
|
|
1613
|
+
onSearchChange: (k) => W(L.id, k),
|
|
1607
1614
|
...ae
|
|
1608
1615
|
}
|
|
1609
1616
|
)
|
|
@@ -1611,10 +1618,10 @@ const Kn = (e, t, s) => {
|
|
|
1611
1618
|
L.id
|
|
1612
1619
|
))
|
|
1613
1620
|
},
|
|
1614
|
-
|
|
1621
|
+
se
|
|
1615
1622
|
) }),
|
|
1616
1623
|
/* @__PURE__ */ E(
|
|
1617
|
-
|
|
1624
|
+
Mn,
|
|
1618
1625
|
{
|
|
1619
1626
|
projectName: m,
|
|
1620
1627
|
movingEntities: b,
|
|
@@ -1625,25 +1632,25 @@ const Kn = (e, t, s) => {
|
|
|
1625
1632
|
] });
|
|
1626
1633
|
};
|
|
1627
1634
|
export {
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1635
|
+
Cn as S,
|
|
1636
|
+
ft as a,
|
|
1637
|
+
et as b,
|
|
1638
|
+
kn as c,
|
|
1639
|
+
ut as d,
|
|
1640
|
+
no as e,
|
|
1641
|
+
Fn as f,
|
|
1642
|
+
Dn as g,
|
|
1643
|
+
tt as h,
|
|
1644
|
+
pt as i,
|
|
1645
|
+
Ve as j,
|
|
1646
|
+
En as k,
|
|
1647
|
+
Kn as l,
|
|
1648
|
+
Hn as m,
|
|
1649
|
+
Rn as n,
|
|
1650
|
+
to as o,
|
|
1651
|
+
Xn as p,
|
|
1652
|
+
xn as q,
|
|
1653
|
+
eo as r,
|
|
1654
|
+
In as s,
|
|
1655
|
+
jn as u
|
|
1649
1656
|
};
|