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