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