@ynput/ayon-frontend-shared 0.4.7 → 0.6.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 +684 -649
- package/dist/Feed.es.js +22 -22
- package/dist/ListTable.es.js +78 -67
- package/dist/ProjectTreeTable.es.js +2185 -2132
- package/dist/Slicer.es.js +152 -120
- package/dist/Views.es.js +1 -1
- package/dist/api.es.js +332 -329
- package/dist/chunks/Actions.es.js +7 -7
- package/dist/chunks/ColumnDropIndicator.es.js +127 -241
- package/dist/chunks/DeleteEntitiesContext.es.js +109 -109
- package/dist/chunks/DetailsDialog.es.js +3 -3
- package/dist/chunks/DetailsPanelContext.es.js +155 -0
- package/dist/chunks/EntityPath.es.js +40 -40
- package/dist/chunks/EntityPickerDialog.es.js +1 -1
- package/dist/chunks/EntityTooltip.es.js +3 -3
- package/dist/chunks/EntityUpdatesContext.es.js +1 -1
- package/dist/chunks/Feed.es.js +2208 -2611
- package/dist/chunks/FilterErrorActions.es.js +5 -5
- package/dist/chunks/GlobalContext.es.js +21 -21
- package/dist/chunks/InfoMessage.es.js +146 -0
- package/dist/chunks/Menu.es.js +6 -6
- package/dist/chunks/MenuContext.es.js +51 -240
- package/dist/chunks/MenuItem.es.js +1 -1
- package/dist/chunks/MetaWidget.es.js +3211 -3761
- package/dist/chunks/NewEntityContext.es.js +539 -544
- package/dist/chunks/PlayableIcon.es.js +4261 -1163
- package/dist/chunks/ProjectContext.es.js +2 -2
- package/dist/chunks/ProjectFoldersContext.es.js +84 -76
- package/dist/chunks/RepresentationsList.es.js +3 -3
- package/dist/chunks/ReviewablesSelector.es.js +396 -384
- package/dist/chunks/SimpleForm.es.js +9 -9
- package/dist/chunks/SimpleTable.es.js +286 -283
- package/dist/chunks/Slicer.es.js +1129 -689
- package/dist/chunks/TableSettingsFallback.es.js +6 -6
- package/dist/chunks/ThumbnailSimple.es.js +410 -61
- package/dist/chunks/VersionUploadContext.es.js +30 -30
- package/dist/chunks/ViewsContext.es.js +97 -97
- package/dist/chunks/Watchers.es.js +628 -598
- package/dist/chunks/entityDefinitions.es.js +276 -134
- package/dist/chunks/expandRelativeDates.es.js +27 -0
- package/dist/chunks/getBundleMode.es.js +16 -61
- package/dist/chunks/getUris.es.js +329 -322
- package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
- package/dist/chunks/searchTerms.es.js +186 -173
- package/dist/chunks/uriUtils.es.js +48 -0
- package/dist/chunks/useAttributeEnums.es.js +69 -61
- package/dist/chunks/useColumnDragRestriction.es.js +37 -27
- package/dist/chunks/useDateRangeFilter.es.js +3 -3
- package/dist/chunks/useLocalStorage.es.js +8 -8
- package/dist/chunks/useSessionStorage.es.js +61 -0
- package/dist/chunks/viewUpdateHelper.es.js +8 -8
- package/dist/components.es.js +199 -194
- package/dist/context.es.js +60 -58
- package/dist/hooks.es.js +108 -101
- package/dist/index.es.js +20 -14
- package/dist/types/Actions.d.ts +16 -16
- package/dist/types/ContextMenu.d.ts +16 -16
- package/dist/types/DetailsPanel.d.ts +22 -16
- package/dist/types/EntityPickerDialog.d.ts +16 -16
- package/dist/types/Feed.d.ts +16 -16
- package/dist/types/ListTable.d.ts +16 -16
- package/dist/types/NewEntity.d.ts +16 -16
- package/dist/types/ProjectTreeTable.d.ts +48 -22
- package/dist/types/RepresentationsList.d.ts +19 -16
- package/dist/types/SimpleTable.d.ts +17 -16
- package/dist/types/Slicer.d.ts +119 -34
- package/dist/types/Views.d.ts +17 -17
- package/dist/types/api.d.ts +404 -95
- package/dist/types/components.d.ts +86 -25
- package/dist/types/context.d.ts +60 -17
- package/dist/types/hooks.d.ts +16 -16
- package/dist/types/index.d.ts +16 -16
- package/dist/types/util.d.ts +16 -16
- package/dist/util.es.js +108 -97
- package/package.json +26 -13
- package/dist/chunks/mentionTypeOptions.es.js +0 -15
- package/dist/chunks/useSlicerSplitter.es.js +0 -18
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { jsx as t, jsxs as p, Fragment as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { isEmpty as
|
|
1
|
+
import { jsx as t, jsxs as p, Fragment as ue } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Ve, useState as z, useRef as ce, useEffect as Le, useLayoutEffect as Je, useContext as Ce, useMemo as ge, createContext as Xe } from "react";
|
|
3
|
+
import { isEmpty as Te } from "lodash";
|
|
4
4
|
import "primereact/confirmdialog";
|
|
5
|
-
import { toast as
|
|
6
|
-
import { R as
|
|
7
|
-
import { p as be, c as
|
|
8
|
-
import { be as
|
|
9
|
-
import { Dropdown as
|
|
5
|
+
import { toast as me } from "react-toastify";
|
|
6
|
+
import { R as je, g as Ze } from "./realtimeUpdatesUtils.es.js";
|
|
7
|
+
import { p as be, c as Ge, a as Qe } from "./parseHtmlToPlainTextWithLinks.es.js";
|
|
8
|
+
import { be as Ye } from "./searchTerms.es.js";
|
|
9
|
+
import { Dropdown as qe, Icon as Q, InputText as he, Button as pe, InputSwitch as Ne, InputNumber as Me, Spacer as ze, theme as Fe, Dialog as et, ShortcutTag as tt, Toolbar as nt, SaveButton as at } from "@ynput/ayon-react-components";
|
|
10
10
|
import E from "styled-components";
|
|
11
|
-
import { a as
|
|
11
|
+
import { a as rt, K as ot } from "./platform.es.js";
|
|
12
12
|
import "uuid";
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import { n as
|
|
16
|
-
import {
|
|
17
|
-
import { a as
|
|
18
|
-
import { u as
|
|
19
|
-
import { a as
|
|
20
|
-
const
|
|
21
|
-
const
|
|
13
|
+
import { e as st, f as lt, g as it, p as ct, h as dt } from "./MetaWidget.es.js";
|
|
14
|
+
import Ae from "clsx";
|
|
15
|
+
import { n as te, b as ft, u as pt } from "./entityDefinitions.es.js";
|
|
16
|
+
import { dl as ut } from "./getUris.es.js";
|
|
17
|
+
import { a as Ee } from "./ProjectContext.es.js";
|
|
18
|
+
import { u as Be } from "./ProjectFoldersContext.es.js";
|
|
19
|
+
import { a as mt } from "./MenuContext.es.js";
|
|
20
|
+
const Oe = (r, m, u) => {
|
|
21
|
+
const d = r.match(/\d+$/), v = m.match(/\d+$/), h = d ? parseInt(d[0], 10) : NaN, O = (v ? parseInt(v[0], 10) : NaN) - h;
|
|
22
22
|
if (isNaN(O)) return [];
|
|
23
|
-
const
|
|
23
|
+
const o = [];
|
|
24
24
|
for (let D = 0; D < u; D++) {
|
|
25
|
-
const
|
|
25
|
+
const y = h + D * O, F = r.match(/\d+$/);
|
|
26
26
|
if (!F) return [];
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const A = String(y).padStart(F[0].length, "0"), _ = r.replace(/\d+$/, A);
|
|
28
|
+
o.push(_);
|
|
29
29
|
}
|
|
30
|
-
return
|
|
31
|
-
},
|
|
30
|
+
return o;
|
|
31
|
+
}, xe = Ve(
|
|
32
32
|
({
|
|
33
|
-
value:
|
|
33
|
+
value: r,
|
|
34
34
|
options: m,
|
|
35
35
|
onChange: u,
|
|
36
|
-
style:
|
|
37
|
-
mainStyle:
|
|
36
|
+
style: d,
|
|
37
|
+
mainStyle: v,
|
|
38
38
|
disabled: h,
|
|
39
39
|
placeholder: n,
|
|
40
40
|
isChanged: O,
|
|
41
|
-
align:
|
|
41
|
+
align: o,
|
|
42
42
|
type: D,
|
|
43
|
-
...
|
|
43
|
+
...y
|
|
44
44
|
}, F) => /* @__PURE__ */ t(
|
|
45
|
-
|
|
45
|
+
qe,
|
|
46
46
|
{
|
|
47
47
|
options: m,
|
|
48
48
|
dataKey: "name",
|
|
49
|
-
value:
|
|
50
|
-
valueStyle:
|
|
51
|
-
onChange: (
|
|
49
|
+
value: r,
|
|
50
|
+
valueStyle: d,
|
|
51
|
+
onChange: (A) => u(A[0]),
|
|
52
52
|
disabled: h,
|
|
53
53
|
isChanged: O,
|
|
54
54
|
placeholder: n,
|
|
@@ -56,15 +56,15 @@ const qe = (o, m, u) => {
|
|
|
56
56
|
search: !0,
|
|
57
57
|
searchFields: ["name"],
|
|
58
58
|
emptyMessage: "None Set",
|
|
59
|
-
style:
|
|
60
|
-
align:
|
|
59
|
+
style: v,
|
|
60
|
+
align: o,
|
|
61
61
|
ref: F,
|
|
62
|
-
...
|
|
62
|
+
...y
|
|
63
63
|
}
|
|
64
64
|
)
|
|
65
65
|
);
|
|
66
|
-
|
|
67
|
-
const
|
|
66
|
+
xe.displayName = "TypeEditor";
|
|
67
|
+
const ht = E.div`
|
|
68
68
|
position: relative;
|
|
69
69
|
display: flex;
|
|
70
70
|
flex-direction: column;
|
|
@@ -81,7 +81,7 @@ const gt = E.div`
|
|
|
81
81
|
&.task {
|
|
82
82
|
width: 100%;
|
|
83
83
|
}
|
|
84
|
-
`,
|
|
84
|
+
`, $e = E.div`
|
|
85
85
|
display: flex;
|
|
86
86
|
flex-direction: column;
|
|
87
87
|
/* panel */
|
|
@@ -112,7 +112,7 @@ const gt = E.div`
|
|
|
112
112
|
.form > .icon {
|
|
113
113
|
padding: 5px 0;
|
|
114
114
|
}
|
|
115
|
-
`,
|
|
115
|
+
`, yt = E($e)`
|
|
116
116
|
& > div {
|
|
117
117
|
align-items: center;
|
|
118
118
|
}
|
|
@@ -120,7 +120,7 @@ const gt = E.div`
|
|
|
120
120
|
border-radius: var(--border-radius-l);
|
|
121
121
|
padding-bottom: 4px;
|
|
122
122
|
padding: 2px 4px;
|
|
123
|
-
`,
|
|
123
|
+
`, Se = E.div`
|
|
124
124
|
display: flex;
|
|
125
125
|
flex-direction: row;
|
|
126
126
|
align-items: flex-end;
|
|
@@ -133,7 +133,7 @@ const gt = E.div`
|
|
|
133
133
|
strong {
|
|
134
134
|
font-weight: 700;
|
|
135
135
|
}
|
|
136
|
-
`,
|
|
136
|
+
`, re = E.div`
|
|
137
137
|
display: flex;
|
|
138
138
|
flex-direction: column;
|
|
139
139
|
width: min-content;
|
|
@@ -152,7 +152,7 @@ const gt = E.div`
|
|
|
152
152
|
text-overflow: ellipsis;
|
|
153
153
|
white-space: nowrap;
|
|
154
154
|
}
|
|
155
|
-
`,
|
|
155
|
+
`, gt = E.div`
|
|
156
156
|
display: flex;
|
|
157
157
|
flex-direction: column;
|
|
158
158
|
gap: var(--base-gap-small);
|
|
@@ -163,18 +163,18 @@ const gt = E.div`
|
|
|
163
163
|
display: none;
|
|
164
164
|
}
|
|
165
165
|
width: 100%;
|
|
166
|
-
`,
|
|
166
|
+
`, bt = E.div`
|
|
167
167
|
display: flex;
|
|
168
168
|
flex-direction: row;
|
|
169
169
|
align-items: center;
|
|
170
170
|
gap: var(--base-gap-small);
|
|
171
171
|
width: 100%;
|
|
172
|
-
`,
|
|
172
|
+
`, xt = E.div`
|
|
173
173
|
display: flex;
|
|
174
174
|
flex-direction: column;
|
|
175
175
|
gap: var(--base-gap-small);
|
|
176
176
|
z-index: 10;
|
|
177
|
-
`,
|
|
177
|
+
`, wt = E.span``, vt = E.span`
|
|
178
178
|
background-color: var(--md-sys-color-surface-container-low);
|
|
179
179
|
padding: 5px 8px;
|
|
180
180
|
border-radius: var(--border-radius);
|
|
@@ -185,16 +185,16 @@ const gt = E.div`
|
|
|
185
185
|
color: var(--md-sys-color-outline);
|
|
186
186
|
min-height: 30px;
|
|
187
187
|
`;
|
|
188
|
-
function
|
|
189
|
-
if (
|
|
190
|
-
return
|
|
188
|
+
function It(r, m, u = "") {
|
|
189
|
+
if (r.length <= m)
|
|
190
|
+
return r.map((d) => u + d).join(", ");
|
|
191
191
|
{
|
|
192
|
-
const
|
|
193
|
-
return `${
|
|
192
|
+
const d = r.slice(0, Math.ceil(m / 2)).map((h) => u + h), v = r.slice(-1).map((h) => u + h);
|
|
193
|
+
return `${d.join(", ")} ... ${v.join(", ")}`;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
return
|
|
196
|
+
function Re(r) {
|
|
197
|
+
return r === "Shot" ? {
|
|
198
198
|
base: "0010",
|
|
199
199
|
increment: "0020",
|
|
200
200
|
length: 10,
|
|
@@ -206,306 +206,306 @@ function Le(o) {
|
|
|
206
206
|
difference: 1
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
|
-
const
|
|
210
|
-
onChange:
|
|
209
|
+
const kt = ({
|
|
210
|
+
onChange: r,
|
|
211
211
|
parentId: m = null,
|
|
212
212
|
children: u,
|
|
213
|
-
depth:
|
|
214
|
-
onNew:
|
|
213
|
+
depth: d,
|
|
214
|
+
onNew: v,
|
|
215
215
|
index: h,
|
|
216
216
|
nesting: n = !0,
|
|
217
217
|
isRoot: O,
|
|
218
|
-
parentLabel:
|
|
218
|
+
parentLabel: o,
|
|
219
219
|
prefixDisabled: D,
|
|
220
|
-
typeSelectRef:
|
|
220
|
+
typeSelectRef: y,
|
|
221
221
|
onLastInputKeydown: F,
|
|
222
|
-
folders:
|
|
223
|
-
...
|
|
222
|
+
folders: A,
|
|
223
|
+
..._
|
|
224
224
|
}) => {
|
|
225
|
-
const { base: q, increment:
|
|
226
|
-
let
|
|
227
|
-
q &&
|
|
228
|
-
const [
|
|
229
|
-
|
|
230
|
-
let { value:
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
234
|
-
let
|
|
235
|
-
const
|
|
236
|
-
for (const
|
|
237
|
-
if (
|
|
238
|
-
|
|
225
|
+
const { base: q, increment: s, length: R, type: J, id: K, prefix: x, prefixDepth: ne, parentBases: W } = _, V = _.entityType, X = !n && O || D;
|
|
226
|
+
let ae = [];
|
|
227
|
+
q && s && R && (ae = Oe(q, s, R));
|
|
228
|
+
const [de, H] = z(ae), Y = ce(null), ee = ce(null), B = (i) => {
|
|
229
|
+
i?.preventDefault && i?.preventDefault();
|
|
230
|
+
let { value: C, id: $ } = i.target;
|
|
231
|
+
$ === "prefixDepth" && (C = parseInt(String(C), 10));
|
|
232
|
+
const T = { [$]: C }, I = { ..._, ...T };
|
|
233
|
+
if ($ === "type") {
|
|
234
|
+
let P = !1;
|
|
235
|
+
const c = A.find((j) => j.name === C);
|
|
236
|
+
for (const j of A) {
|
|
237
|
+
if (I.base === "") {
|
|
238
|
+
P = !0;
|
|
239
239
|
break;
|
|
240
240
|
}
|
|
241
|
-
for (const
|
|
242
|
-
if (typeof
|
|
243
|
-
|
|
241
|
+
for (const N in j)
|
|
242
|
+
if (typeof j[N] == "string" && I.base?.toLowerCase().includes(j[N].toLowerCase())) {
|
|
243
|
+
P = !0;
|
|
244
244
|
break;
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
if (!
|
|
248
|
-
const
|
|
249
|
-
|
|
247
|
+
if (!P || !c) return;
|
|
248
|
+
const Z = V === "folder" && c.shortName || c.name, M = Re(String(C));
|
|
249
|
+
I.base = Z + M.base, I.increment = Z + M.increment, I.length = M.length;
|
|
250
250
|
}
|
|
251
|
-
if (
|
|
252
|
-
const
|
|
253
|
-
|
|
251
|
+
if ($ === "base") {
|
|
252
|
+
const P = Re(I.type), c = String(C), Z = c.replace(/[^a-zA-Z]/g, ""), M = c.replace(/[^0-9]/g, ""), j = parseInt(M, 10), N = M.length, U = Z + (j + P.difference).toString().padStart(N, "0");
|
|
253
|
+
I.increment = U.replace("NaN", "");
|
|
254
254
|
}
|
|
255
|
-
if (
|
|
256
|
-
|
|
255
|
+
if (r(
|
|
256
|
+
I,
|
|
257
257
|
typeof K == "string" ? K : void 0,
|
|
258
|
-
|
|
259
|
-
),
|
|
260
|
-
const
|
|
261
|
-
|
|
258
|
+
V
|
|
259
|
+
), I.base && I.increment && I.length) {
|
|
260
|
+
const P = Oe(I.base, I.increment, I.length);
|
|
261
|
+
H(P);
|
|
262
262
|
}
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
$ === "type" && setTimeout(X ? () => {
|
|
264
|
+
Y.current?.focus(), Y.current?.select();
|
|
265
265
|
} : () => {
|
|
266
|
-
|
|
266
|
+
ee.current?.focus();
|
|
267
267
|
}, 50);
|
|
268
|
-
}, [a,
|
|
269
|
-
|
|
268
|
+
}, [a, f] = z(!0);
|
|
269
|
+
Le(
|
|
270
270
|
() => {
|
|
271
|
-
const
|
|
272
|
-
|
|
271
|
+
const i = setTimeout(() => {
|
|
272
|
+
f(!1);
|
|
273
273
|
}, 1e3);
|
|
274
|
-
return () => clearTimeout(
|
|
274
|
+
return () => clearTimeout(i);
|
|
275
275
|
},
|
|
276
276
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
277
277
|
[]
|
|
278
278
|
);
|
|
279
|
-
const
|
|
280
|
-
return
|
|
281
|
-
|
|
282
|
-
}, [
|
|
283
|
-
|
|
279
|
+
const g = It(de, 5, x ? o : void 0), S = ce(null), [l, b] = z(0);
|
|
280
|
+
return Je(() => {
|
|
281
|
+
S.current && b(S.current.offsetWidth);
|
|
282
|
+
}, [S.current, x]), V === "task" ? /* @__PURE__ */ t(
|
|
283
|
+
yt,
|
|
284
284
|
{
|
|
285
|
-
className:
|
|
286
|
-
style: { zIndex: 100 - (
|
|
287
|
-
children: /* @__PURE__ */ p(
|
|
288
|
-
/* @__PURE__ */ t(
|
|
285
|
+
className: Ae("task", { "is-new": a, nesting: n, "no-nesting": !n }),
|
|
286
|
+
style: { zIndex: 100 - (d ?? 0) - (h ?? 0) },
|
|
287
|
+
children: /* @__PURE__ */ p(Se, { className: "form", children: [
|
|
288
|
+
/* @__PURE__ */ t(Q, { icon: "task_alt" }),
|
|
289
289
|
/* @__PURE__ */ t("strong", { children: "Task" }),
|
|
290
290
|
/* @__PURE__ */ t("label", { children: "Type" }),
|
|
291
291
|
/* @__PURE__ */ t(
|
|
292
|
-
|
|
292
|
+
xe,
|
|
293
293
|
{
|
|
294
|
-
value: [
|
|
295
|
-
onChange: (
|
|
296
|
-
options:
|
|
294
|
+
value: [J],
|
|
295
|
+
onChange: (i) => B({ target: { value: i, id: "type" } }),
|
|
296
|
+
options: A,
|
|
297
297
|
style: { width: 160 },
|
|
298
298
|
align: "right"
|
|
299
299
|
}
|
|
300
300
|
),
|
|
301
301
|
/* @__PURE__ */ t("label", { children: "label" }),
|
|
302
302
|
/* @__PURE__ */ t(
|
|
303
|
-
|
|
303
|
+
he,
|
|
304
304
|
{
|
|
305
305
|
value: q,
|
|
306
306
|
id: "base",
|
|
307
|
-
onChange:
|
|
307
|
+
onChange: B,
|
|
308
308
|
placeholder: "compositing...",
|
|
309
309
|
autoComplete: "off"
|
|
310
310
|
}
|
|
311
311
|
),
|
|
312
312
|
/* @__PURE__ */ t(
|
|
313
|
-
|
|
313
|
+
pe,
|
|
314
314
|
{
|
|
315
315
|
icon: "close",
|
|
316
316
|
variant: "text",
|
|
317
|
-
onClick: () =>
|
|
317
|
+
onClick: () => r({ id: K, delete: !0 }, m),
|
|
318
318
|
className: "delete"
|
|
319
319
|
}
|
|
320
320
|
)
|
|
321
321
|
] })
|
|
322
322
|
}
|
|
323
|
-
) : /* @__PURE__ */ p(
|
|
324
|
-
/* @__PURE__ */ p(
|
|
325
|
-
n && /* @__PURE__ */ p(
|
|
326
|
-
/* @__PURE__ */ p(
|
|
327
|
-
|
|
328
|
-
|
|
323
|
+
) : /* @__PURE__ */ p(ht, { className: "folder", children: [
|
|
324
|
+
/* @__PURE__ */ p(bt, { className: "seq", style: { zIndex: 100 - (d ?? 0) - (h ?? 0) }, children: [
|
|
325
|
+
n && /* @__PURE__ */ p(xt, { className: "buttons", children: [
|
|
326
|
+
/* @__PURE__ */ p(Se, { children: [
|
|
327
|
+
d === 0 && /* @__PURE__ */ t(
|
|
328
|
+
pe,
|
|
329
329
|
{
|
|
330
330
|
icon: "south",
|
|
331
|
-
onClick: () =>
|
|
331
|
+
onClick: () => v?.(null),
|
|
332
332
|
label: "Root",
|
|
333
333
|
title: "add root folder"
|
|
334
334
|
}
|
|
335
335
|
),
|
|
336
336
|
/* @__PURE__ */ t(
|
|
337
|
-
|
|
337
|
+
pe,
|
|
338
338
|
{
|
|
339
|
-
icon:
|
|
340
|
-
onClick: () => K &&
|
|
341
|
-
label:
|
|
339
|
+
icon: te.folder.icon,
|
|
340
|
+
onClick: () => K && v?.(K, "folder"),
|
|
341
|
+
label: d === 0 ? te.folder.label : void 0,
|
|
342
342
|
title: "add nested folder"
|
|
343
343
|
}
|
|
344
344
|
)
|
|
345
345
|
] }),
|
|
346
346
|
/* @__PURE__ */ t(
|
|
347
|
-
|
|
347
|
+
pe,
|
|
348
348
|
{
|
|
349
|
-
icon:
|
|
350
|
-
onClick: () => K &&
|
|
351
|
-
label:
|
|
349
|
+
icon: te.task.icon,
|
|
350
|
+
onClick: () => K && v?.(K, "task"),
|
|
351
|
+
label: d === 0 ? te.task.label : void 0,
|
|
352
352
|
title: "add nested task",
|
|
353
353
|
style: { width: "max-content", marginLeft: "auto" }
|
|
354
354
|
}
|
|
355
355
|
)
|
|
356
356
|
] }),
|
|
357
357
|
/* @__PURE__ */ p(
|
|
358
|
-
|
|
358
|
+
$e,
|
|
359
359
|
{
|
|
360
|
-
className:
|
|
361
|
-
ref:
|
|
360
|
+
className: Ae({ "is-new": a, "no-nesting": !n }),
|
|
361
|
+
ref: S,
|
|
362
362
|
children: [
|
|
363
|
-
/* @__PURE__ */ p(
|
|
364
|
-
/* @__PURE__ */ p(
|
|
363
|
+
/* @__PURE__ */ p(Se, { className: "form folder", children: [
|
|
364
|
+
/* @__PURE__ */ p(re, { children: [
|
|
365
365
|
/* @__PURE__ */ t("label", { children: "Type" }),
|
|
366
366
|
/* @__PURE__ */ t(
|
|
367
|
-
|
|
367
|
+
xe,
|
|
368
368
|
{
|
|
369
|
-
value: [
|
|
370
|
-
onChange: (
|
|
371
|
-
options:
|
|
369
|
+
value: [J],
|
|
370
|
+
onChange: (i) => B({ target: { value: i, id: "type" } }),
|
|
371
|
+
options: A,
|
|
372
372
|
style: { width: 160 },
|
|
373
373
|
align: "right",
|
|
374
|
-
ref:
|
|
374
|
+
ref: y
|
|
375
375
|
}
|
|
376
376
|
)
|
|
377
377
|
] }),
|
|
378
|
-
/* @__PURE__ */ t(
|
|
379
|
-
(
|
|
380
|
-
/* @__PURE__ */ p(
|
|
381
|
-
/* @__PURE__ */ p(
|
|
378
|
+
/* @__PURE__ */ t(Q, { icon: "trending_flat" }),
|
|
379
|
+
(d !== 0 || !n) && /* @__PURE__ */ p(ue, { children: [
|
|
380
|
+
/* @__PURE__ */ p(ue, { children: [
|
|
381
|
+
/* @__PURE__ */ p(re, { children: [
|
|
382
382
|
/* @__PURE__ */ t("label", { children: "Prefix" }),
|
|
383
383
|
/* @__PURE__ */ t(
|
|
384
|
-
|
|
384
|
+
Ne,
|
|
385
385
|
{
|
|
386
|
-
checked:
|
|
386
|
+
checked: x,
|
|
387
387
|
id: "prefix",
|
|
388
|
-
onChange: () =>
|
|
389
|
-
disabled:
|
|
390
|
-
ref:
|
|
388
|
+
onChange: () => B({ target: { value: !x, id: "prefix" } }),
|
|
389
|
+
disabled: X,
|
|
390
|
+
ref: ee,
|
|
391
391
|
switchStyle: { margin: "4px 0" }
|
|
392
392
|
}
|
|
393
393
|
)
|
|
394
394
|
] }),
|
|
395
|
-
/* @__PURE__ */ t(
|
|
395
|
+
/* @__PURE__ */ t(Q, { icon: "trending_flat" })
|
|
396
396
|
] }),
|
|
397
|
-
n &&
|
|
397
|
+
n && x && /* @__PURE__ */ p(re, { children: [
|
|
398
398
|
/* @__PURE__ */ t("label", { children: "Depth" }),
|
|
399
399
|
/* @__PURE__ */ t(
|
|
400
|
-
|
|
400
|
+
Me,
|
|
401
401
|
{
|
|
402
|
-
value:
|
|
402
|
+
value: ne,
|
|
403
403
|
id: "prefixDepth",
|
|
404
|
-
onChange:
|
|
405
|
-
max:
|
|
404
|
+
onChange: B,
|
|
405
|
+
max: W?.length,
|
|
406
406
|
min: 0
|
|
407
407
|
}
|
|
408
408
|
)
|
|
409
409
|
] })
|
|
410
410
|
] }),
|
|
411
|
-
|
|
412
|
-
/* @__PURE__ */ p(
|
|
411
|
+
W && n && /* @__PURE__ */ t(re, { style: { display: x ? "flex" : "none" }, children: /* @__PURE__ */ t(vt, { children: W.join("") }) }),
|
|
412
|
+
/* @__PURE__ */ p(re, { className: "seq", children: [
|
|
413
413
|
/* @__PURE__ */ t("label", { children: "First Name" }),
|
|
414
414
|
/* @__PURE__ */ t(
|
|
415
|
-
|
|
415
|
+
he,
|
|
416
416
|
{
|
|
417
417
|
value: q,
|
|
418
418
|
id: "base",
|
|
419
|
-
ref:
|
|
420
|
-
onChange:
|
|
419
|
+
ref: Y,
|
|
420
|
+
onChange: B,
|
|
421
421
|
placeholder: "ep101...",
|
|
422
422
|
autoComplete: "off"
|
|
423
423
|
}
|
|
424
424
|
)
|
|
425
425
|
] }),
|
|
426
|
-
/* @__PURE__ */ t(
|
|
427
|
-
/* @__PURE__ */ p(
|
|
426
|
+
/* @__PURE__ */ t(Q, { icon: "trending_flat" }),
|
|
427
|
+
/* @__PURE__ */ p(re, { className: "seq", children: [
|
|
428
428
|
/* @__PURE__ */ t("label", { children: "Second Name" }),
|
|
429
429
|
/* @__PURE__ */ t(
|
|
430
|
-
|
|
430
|
+
he,
|
|
431
431
|
{
|
|
432
|
-
value:
|
|
432
|
+
value: s,
|
|
433
433
|
id: "increment",
|
|
434
|
-
onChange:
|
|
434
|
+
onChange: B,
|
|
435
435
|
placeholder: "ep102...",
|
|
436
436
|
autoComplete: "off"
|
|
437
437
|
}
|
|
438
438
|
)
|
|
439
439
|
] }),
|
|
440
|
-
/* @__PURE__ */ t(
|
|
441
|
-
/* @__PURE__ */ p(
|
|
440
|
+
/* @__PURE__ */ t(Q, { icon: "trending_flat" }),
|
|
441
|
+
/* @__PURE__ */ p(re, { children: [
|
|
442
442
|
/* @__PURE__ */ t("label", { children: "Count" }),
|
|
443
443
|
/* @__PURE__ */ t(
|
|
444
|
-
|
|
444
|
+
Me,
|
|
445
445
|
{
|
|
446
|
-
value:
|
|
446
|
+
value: R,
|
|
447
447
|
id: "length",
|
|
448
|
-
onChange:
|
|
448
|
+
onChange: B,
|
|
449
449
|
placeholder: "15...",
|
|
450
450
|
min: 2,
|
|
451
|
-
onFocus: (
|
|
451
|
+
onFocus: (i) => i.target.select(),
|
|
452
452
|
onKeyDown: F
|
|
453
453
|
}
|
|
454
454
|
)
|
|
455
455
|
] }),
|
|
456
|
-
/* @__PURE__ */ t(
|
|
456
|
+
/* @__PURE__ */ t(ze, {}),
|
|
457
457
|
n && /* @__PURE__ */ t(
|
|
458
|
-
|
|
458
|
+
pe,
|
|
459
459
|
{
|
|
460
460
|
icon: "close",
|
|
461
461
|
variant: "text",
|
|
462
|
-
onClick: () =>
|
|
463
|
-
disabled:
|
|
462
|
+
onClick: () => r({ id: K, delete: !0 }),
|
|
463
|
+
disabled: d === 0 && h === 0
|
|
464
464
|
}
|
|
465
465
|
)
|
|
466
466
|
] }),
|
|
467
|
-
!n && /* @__PURE__ */ p(
|
|
467
|
+
!n && /* @__PURE__ */ p(wt, { children: [
|
|
468
468
|
"Example: ",
|
|
469
|
-
|
|
469
|
+
g
|
|
470
470
|
] })
|
|
471
471
|
]
|
|
472
472
|
}
|
|
473
473
|
)
|
|
474
474
|
] }),
|
|
475
475
|
n && /* @__PURE__ */ t(
|
|
476
|
-
|
|
476
|
+
gt,
|
|
477
477
|
{
|
|
478
478
|
className: "children",
|
|
479
|
-
style: { width:
|
|
479
|
+
style: { width: l, zIndex: 99 - (d ?? 0) - (h ?? 0) },
|
|
480
480
|
children: u
|
|
481
481
|
}
|
|
482
482
|
)
|
|
483
483
|
] });
|
|
484
|
-
},
|
|
485
|
-
options:
|
|
484
|
+
}, St = ({
|
|
485
|
+
options: r,
|
|
486
486
|
onOpenNew: m,
|
|
487
487
|
enabled: u = !0
|
|
488
488
|
}) => {
|
|
489
|
-
const { menuOpen:
|
|
490
|
-
|
|
489
|
+
const { menuOpen: d } = Ce(mt) || { menuOpen: !1 }, { editingCellId: v } = Ce(st) || { editingCellId: null };
|
|
490
|
+
Le(() => {
|
|
491
491
|
if (!u) return;
|
|
492
492
|
const h = (n) => {
|
|
493
|
-
if (
|
|
493
|
+
if (d || n.target instanceof HTMLElement && (n.target.tagName === "INPUT" || n.target.tagName === "TEXTAREA" || n.target.isContentEditable || n.target.getAttribute("role") === "textbox") || v || n.ctrlKey || n.metaKey || n.altKey)
|
|
494
494
|
return;
|
|
495
|
-
const O = n.key.toUpperCase(),
|
|
496
|
-
|
|
495
|
+
const O = n.key.toUpperCase(), o = r.find((D) => D.shortcut === O);
|
|
496
|
+
o && !o.disabled && (n.preventDefault(), m(o.type, { isSequence: o.isSequence }));
|
|
497
497
|
};
|
|
498
498
|
return window.addEventListener("keydown", h), () => {
|
|
499
499
|
window.removeEventListener("keydown", h);
|
|
500
500
|
};
|
|
501
|
-
}, [u,
|
|
502
|
-
},
|
|
503
|
-
font-size: ${
|
|
501
|
+
}, [u, r, m, v, d]);
|
|
502
|
+
}, we = E.label`
|
|
503
|
+
font-size: ${Fe.labelMedium};
|
|
504
504
|
color: var(--md-sys-color-outline);
|
|
505
|
-
`,
|
|
505
|
+
`, Ct = E.span`
|
|
506
506
|
position: relative;
|
|
507
507
|
padding: 2px 6px;
|
|
508
|
-
font-size: ${
|
|
508
|
+
font-size: ${Fe.bodySmall};
|
|
509
509
|
display: inline-flex;
|
|
510
510
|
min-height: 20px;
|
|
511
511
|
gap: var(--base-gap-small);
|
|
@@ -522,8 +522,8 @@ const Ct = ({
|
|
|
522
522
|
display: flex;
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
`,
|
|
526
|
-
font-size: ${
|
|
525
|
+
`, Tt = E(he)`
|
|
526
|
+
font-size: ${Fe.bodySmall};
|
|
527
527
|
width: 100px;
|
|
528
528
|
max-width: 160px;
|
|
529
529
|
min-height: 0;
|
|
@@ -541,7 +541,7 @@ const Ct = ({
|
|
|
541
541
|
outline: 1px solid var(--md-sys-color-primary);
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
`,
|
|
544
|
+
`, De = E.div`
|
|
545
545
|
display: flex;
|
|
546
546
|
flex-direction: column;
|
|
547
547
|
align-items: flex-start;
|
|
@@ -556,83 +556,83 @@ const Ct = ({
|
|
|
556
556
|
font-size: 16px;
|
|
557
557
|
color: var(--md-sys-color-outline);
|
|
558
558
|
}
|
|
559
|
-
`,
|
|
559
|
+
`, Nt = E.div`
|
|
560
560
|
display: flex;
|
|
561
561
|
align-items: center;
|
|
562
562
|
margin-top: 6px;
|
|
563
563
|
gap: var(--base-gap-small);
|
|
564
564
|
width: 100%;
|
|
565
565
|
word-break: break-all;
|
|
566
|
-
`,
|
|
567
|
-
handleChange:
|
|
566
|
+
`, Et = ({
|
|
567
|
+
handleChange: r,
|
|
568
568
|
entityForm: m,
|
|
569
569
|
setNameFocused: u,
|
|
570
|
-
handleKeyDown:
|
|
571
|
-
labelRef:
|
|
570
|
+
handleKeyDown: d,
|
|
571
|
+
labelRef: v,
|
|
572
572
|
nameInfo: h = ""
|
|
573
573
|
}) => {
|
|
574
|
-
const [n, O] =
|
|
574
|
+
const [n, O] = z(!1), [o, D] = z(void 0), y = ce(null), F = () => {
|
|
575
575
|
O(!0), u(!0), D(m.name), setTimeout(() => {
|
|
576
|
-
|
|
576
|
+
y.current && (y.current.focus(), y.current.select());
|
|
577
577
|
}, 0);
|
|
578
|
-
},
|
|
579
|
-
const
|
|
580
|
-
(!
|
|
581
|
-
},
|
|
582
|
-
if (
|
|
583
|
-
|
|
578
|
+
}, A = (s) => {
|
|
579
|
+
const R = s.relatedTarget;
|
|
580
|
+
(!R || !y.current?.contains(R)) && (O(!1), u(!1), D(void 0));
|
|
581
|
+
}, _ = (s) => {
|
|
582
|
+
if (s.key === "ArrowDown" && !s.altKey || s.key === "Tab") {
|
|
583
|
+
s.preventDefault(), F();
|
|
584
584
|
return;
|
|
585
585
|
}
|
|
586
|
-
|
|
587
|
-
}, q = (
|
|
588
|
-
if (
|
|
589
|
-
if (
|
|
586
|
+
d(s, !0);
|
|
587
|
+
}, q = (s) => {
|
|
588
|
+
if (s.key === "Enter" || s.key === "Escape" || s.key === "ArrowUp" && !s.altKey) {
|
|
589
|
+
if (s.stopPropagation(), s.key === "Enter" && !n)
|
|
590
590
|
return F();
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
const
|
|
594
|
-
|
|
591
|
+
s.key === "Escape" && o !== void 0 && r(o, "name"), O(!1), u(!1), D(void 0), setTimeout(() => {
|
|
592
|
+
v.current?.focus();
|
|
593
|
+
const R = m.label.length || 0;
|
|
594
|
+
v.current?.setSelectionRange(R, R);
|
|
595
595
|
}, 0);
|
|
596
596
|
return;
|
|
597
597
|
}
|
|
598
598
|
};
|
|
599
|
-
return /* @__PURE__ */ p(
|
|
600
|
-
/* @__PURE__ */ t(
|
|
599
|
+
return /* @__PURE__ */ p(De, { style: { flex: 1 }, children: [
|
|
600
|
+
/* @__PURE__ */ t(we, { children: "Label" }),
|
|
601
601
|
/* @__PURE__ */ t(
|
|
602
|
-
|
|
602
|
+
he,
|
|
603
603
|
{
|
|
604
604
|
value: m.label,
|
|
605
|
-
onChange: (
|
|
606
|
-
ref:
|
|
605
|
+
onChange: (s) => r(s.target.value, "label"),
|
|
606
|
+
ref: v,
|
|
607
607
|
onFocus: () => u(!0),
|
|
608
|
-
onKeyDown:
|
|
608
|
+
onKeyDown: _,
|
|
609
609
|
style: { flex: 1, width: "100%" }
|
|
610
610
|
}
|
|
611
611
|
),
|
|
612
|
-
/* @__PURE__ */ p(
|
|
613
|
-
/* @__PURE__ */ t(
|
|
614
|
-
h && /* @__PURE__ */ t(
|
|
612
|
+
/* @__PURE__ */ p(Nt, { onKeyDown: q, children: [
|
|
613
|
+
/* @__PURE__ */ t(we, { children: "Name" }),
|
|
614
|
+
h && /* @__PURE__ */ t(Q, { icon: "info", "data-tooltip": h, "data-tooltip-delay": 0 }),
|
|
615
615
|
n ? /* @__PURE__ */ t(
|
|
616
|
-
|
|
616
|
+
Tt,
|
|
617
617
|
{
|
|
618
|
-
ref:
|
|
618
|
+
ref: y,
|
|
619
619
|
value: m.name,
|
|
620
|
-
onChange: (
|
|
621
|
-
onBlur:
|
|
620
|
+
onChange: (s) => r(s.target.value, "name"),
|
|
621
|
+
onBlur: A,
|
|
622
622
|
style: { flex: 1 }
|
|
623
623
|
}
|
|
624
|
-
) : /* @__PURE__ */ p(
|
|
624
|
+
) : /* @__PURE__ */ p(Ct, { onClick: F, tabIndex: 0, children: [
|
|
625
625
|
m.name,
|
|
626
626
|
" ",
|
|
627
|
-
/* @__PURE__ */ t(
|
|
627
|
+
/* @__PURE__ */ t(Q, { icon: "edit" })
|
|
628
628
|
] })
|
|
629
629
|
] })
|
|
630
630
|
] });
|
|
631
|
-
},
|
|
631
|
+
}, Ot = E(et)`
|
|
632
632
|
.body {
|
|
633
633
|
overflow: visible;
|
|
634
634
|
}
|
|
635
|
-
`,
|
|
635
|
+
`, Dt = E.div`
|
|
636
636
|
display: flex;
|
|
637
637
|
align-items: flex-start;
|
|
638
638
|
gap: var(--base-gap-large);
|
|
@@ -641,7 +641,7 @@ const Ct = ({
|
|
|
641
641
|
margin-right: 8px;
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
|
-
`,
|
|
644
|
+
`, qt = E(qe)`
|
|
645
645
|
overflow: visible;
|
|
646
646
|
min-width: fit-content;
|
|
647
647
|
.button {
|
|
@@ -661,12 +661,12 @@ const Ct = ({
|
|
|
661
661
|
background-color: var(--md-sys-color-primary-hover);
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
|
-
`,
|
|
664
|
+
`, Ke = E.span`
|
|
665
665
|
display: flex;
|
|
666
666
|
align-items: center;
|
|
667
667
|
min-height: 32px;
|
|
668
668
|
color: var(--md-sys-color-outline);
|
|
669
|
-
`,
|
|
669
|
+
`, Ft = E.span`
|
|
670
670
|
display: flex;
|
|
671
671
|
align-items: center;
|
|
672
672
|
gap: var(--base-gap-small);
|
|
@@ -682,120 +682,115 @@ const Ct = ({
|
|
|
682
682
|
&.disabled {
|
|
683
683
|
opacity: 0.5;
|
|
684
684
|
}
|
|
685
|
-
`,
|
|
686
|
-
disabled:
|
|
685
|
+
`, en = ({
|
|
686
|
+
disabled: r,
|
|
687
687
|
onNewEntities: m,
|
|
688
688
|
showButton: u = !0,
|
|
689
|
-
showDialog:
|
|
690
|
-
enableShortcuts:
|
|
689
|
+
showDialog: d = !0,
|
|
690
|
+
enableShortcuts: v = !0
|
|
691
691
|
}) => {
|
|
692
|
-
const { ...h } =
|
|
692
|
+
const { ...h } = Ee(), {
|
|
693
693
|
entityType: n,
|
|
694
694
|
setEntityType: O,
|
|
695
|
-
entityForm:
|
|
695
|
+
entityForm: o,
|
|
696
696
|
setEntityForm: D,
|
|
697
|
-
sequenceForm:
|
|
697
|
+
sequenceForm: y,
|
|
698
698
|
setSequenceForm: F,
|
|
699
|
-
onCreateNew:
|
|
700
|
-
onOpenNew:
|
|
699
|
+
onCreateNew: A,
|
|
700
|
+
onOpenNew: _,
|
|
701
701
|
config: q,
|
|
702
|
-
parentFolderIds:
|
|
703
|
-
} =
|
|
704
|
-
if (
|
|
705
|
-
const e = K ? Array.from(K).map((
|
|
702
|
+
parentFolderIds: s
|
|
703
|
+
} = jt(), [R, J] = z(!1), { selectedCells: K } = lt() || {}, x = ft(), { getFolderById: ne } = Be(), W = it(), V = W?.getEntityById, X = W?.showHierarchy ?? !0, ae = ge(() => {
|
|
704
|
+
if (s !== null) return s;
|
|
705
|
+
const e = K ? Array.from(K).map((k) => ct(k)) : [], w = Array.from(
|
|
706
706
|
new Set(
|
|
707
|
-
e.filter((
|
|
707
|
+
e.filter((k) => k && k.colId !== je).map((k) => k?.rowId).filter(Boolean)
|
|
708
708
|
)
|
|
709
|
-
),
|
|
709
|
+
), L = Array.from(
|
|
710
710
|
new Set(
|
|
711
|
-
e.filter((
|
|
711
|
+
e.filter((k) => k?.colId === je).map((k) => k?.rowId).filter(Boolean)
|
|
712
712
|
)
|
|
713
|
-
), le =
|
|
713
|
+
), le = w.length > 0 ? w : L;
|
|
714
714
|
if (le.length > 0) {
|
|
715
|
-
const
|
|
716
|
-
(
|
|
717
|
-
),
|
|
718
|
-
(
|
|
719
|
-
),
|
|
715
|
+
const k = le.map((G) => V?.(G)), ie = k.filter(
|
|
716
|
+
(G) => G?.entityType === "folder"
|
|
717
|
+
), ke = k.filter(
|
|
718
|
+
(G) => G?.entityType === "task"
|
|
719
|
+
), Pe = Array.from(
|
|
720
720
|
/* @__PURE__ */ new Set([
|
|
721
|
-
...
|
|
722
|
-
...
|
|
721
|
+
...ie.map((G) => G.id),
|
|
722
|
+
...ke.map((G) => G.folderId)
|
|
723
723
|
])
|
|
724
724
|
);
|
|
725
|
-
if (
|
|
725
|
+
if (Pe.length) return Pe;
|
|
726
726
|
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
return e ? Object.keys(e).filter((y) => e[y]) : [];
|
|
733
|
-
}, [l, T, G, L]), _ = n === "folder" && !ce ? ae : se, W = se.length > 0, a = ge(
|
|
734
|
-
() => _.map((e) => {
|
|
735
|
-
const y = Y?.(e) || Q(e);
|
|
736
|
-
return { value: e, label: y?.label || y?.name || e };
|
|
727
|
+
return x ? Object.keys(x).filter((k) => x[k]) : [];
|
|
728
|
+
}, [s, K, x, V]), de = ge(() => s !== null ? s : x ? Object.keys(x).filter((e) => x[e]) : [], [s, x]), H = n === "folder" && !X ? de : ae, Y = ae.length > 0, ee = ge(
|
|
729
|
+
() => H.map((e) => {
|
|
730
|
+
const w = V?.(e) || ne(e);
|
|
731
|
+
return { value: e, label: w?.label || w?.name || e };
|
|
737
732
|
}),
|
|
738
|
-
[
|
|
739
|
-
), [
|
|
740
|
-
let f =
|
|
741
|
-
f = f.filter((e) =>
|
|
742
|
-
const
|
|
733
|
+
[H, V, ne]
|
|
734
|
+
), [B, a] = z(null);
|
|
735
|
+
let f = B !== null ? B : H;
|
|
736
|
+
f = f.filter((e) => H.includes(e)), f.length === 0 && H.length > 0 && (f = H);
|
|
737
|
+
const g = f.map((e) => ee.find((w) => w.value === e)?.label || "").filter(Boolean), S = g[0] || "", l = Te(H), [b, i] = z(!1), [C, $] = z(!1), T = { label: "", subType: "", name: "" }, I = () => {
|
|
743
738
|
let e = "Add New ";
|
|
744
|
-
return
|
|
745
|
-
},
|
|
746
|
-
if (!
|
|
747
|
-
let
|
|
748
|
-
if (
|
|
749
|
-
const le =
|
|
750
|
-
if (
|
|
751
|
-
|
|
752
|
-
const
|
|
753
|
-
|
|
739
|
+
return l && n === "folder" && (e += "Root "), e += n ? te[n].label : "", l || (g.length > 2 ? e += " - " + g.slice(0, 2).join(", ") + ` +${g.length - 2} more` : e += " - " + g.join(", ")), e;
|
|
740
|
+
}, P = (n === "folder" ? h?.folderTypes : h?.taskTypes) || [], c = (e, w) => {
|
|
741
|
+
if (!w) return;
|
|
742
|
+
let L = { ...o };
|
|
743
|
+
if (L[w] = e, e && w === "subType") {
|
|
744
|
+
const le = P.find((ie) => ie.name === o.subType), k = P.find((ie) => ie.name === e);
|
|
745
|
+
if (k && o.label === le?.name) {
|
|
746
|
+
L.label = k.name;
|
|
747
|
+
const ke = be(o.label, q);
|
|
748
|
+
o.name === ke && (L.name = be(L.label, q));
|
|
754
749
|
}
|
|
755
750
|
setTimeout(() => {
|
|
756
|
-
|
|
751
|
+
j.current?.focus();
|
|
757
752
|
}, 100);
|
|
758
|
-
} else
|
|
759
|
-
D(
|
|
760
|
-
},
|
|
761
|
-
D({ ...
|
|
762
|
-
...
|
|
753
|
+
} else w === "label" ? (L.label = e, C || (L.name = be(e, q))) : w === "name" && ($(!0), L.name = e);
|
|
754
|
+
D(L);
|
|
755
|
+
}, Z = (e) => {
|
|
756
|
+
D({ ...o, label: e.base, subType: e.type }), F({
|
|
757
|
+
...y,
|
|
763
758
|
increment: e.increment,
|
|
764
759
|
length: e.length,
|
|
765
760
|
prefix: e.prefix,
|
|
766
761
|
prefixDepth: e.prefixDepth
|
|
767
762
|
});
|
|
768
|
-
},
|
|
769
|
-
O(null), D(
|
|
770
|
-
},
|
|
771
|
-
const
|
|
772
|
-
if (!
|
|
773
|
-
|
|
763
|
+
}, M = ce(null), j = ce(null), N = () => {
|
|
764
|
+
O(null), D(T), F((e) => ({ ...e, active: !1 })), $(!1), a(null);
|
|
765
|
+
}, U = () => setTimeout(() => M.current?.open(), 180), [oe, ye] = z(!1), se = async (e) => {
|
|
766
|
+
const w = Ge(o.label);
|
|
767
|
+
if (!w.valid) {
|
|
768
|
+
me.error(w.error || "Invalid label");
|
|
774
769
|
return;
|
|
775
770
|
}
|
|
776
|
-
const { valid:
|
|
777
|
-
if (!
|
|
778
|
-
|
|
771
|
+
const { valid: L, error: le } = Qe(o.name);
|
|
772
|
+
if (!L) {
|
|
773
|
+
me.error(le || "Invalid name");
|
|
779
774
|
return;
|
|
780
775
|
}
|
|
781
|
-
|
|
776
|
+
ye(!0);
|
|
782
777
|
try {
|
|
783
|
-
const
|
|
784
|
-
console.log(
|
|
778
|
+
const k = await A(f);
|
|
779
|
+
console.log(k), m?.(k, e), e ? (j.current && (j.current.focus(), j.current.select()), $(!1)) : N();
|
|
785
780
|
} catch {
|
|
786
781
|
} finally {
|
|
787
|
-
|
|
782
|
+
ye(!1);
|
|
788
783
|
}
|
|
789
|
-
},
|
|
790
|
-
e?.stopPropagation(), e.key === "Enter" ?
|
|
791
|
-
},
|
|
792
|
-
|
|
793
|
-
|
|
784
|
+
}, fe = (e, w) => {
|
|
785
|
+
e?.stopPropagation(), e.key === "Enter" ? w && !e.shiftKey || e.ctrlKey || e.metaKey ? (se(!1), J(!1)) : e.shiftKey && (se(!0), J(!0)) : e.key === "Escape" && N();
|
|
786
|
+
}, We = () => {
|
|
787
|
+
b && (i(!1), setTimeout(() => {
|
|
788
|
+
M.current?.open();
|
|
794
789
|
}, 100));
|
|
795
|
-
},
|
|
790
|
+
}, ve = ge(
|
|
796
791
|
() => [
|
|
797
792
|
{
|
|
798
|
-
...
|
|
793
|
+
...te.folder,
|
|
799
794
|
value: "folder",
|
|
800
795
|
type: "folder",
|
|
801
796
|
shortcut: "N"
|
|
@@ -809,100 +804,100 @@ const Ct = ({
|
|
|
809
804
|
isSequence: !0
|
|
810
805
|
},
|
|
811
806
|
{
|
|
812
|
-
...
|
|
807
|
+
...te.task,
|
|
813
808
|
value: "task",
|
|
814
809
|
type: "task",
|
|
815
810
|
shortcut: "T",
|
|
816
|
-
disabled: !
|
|
811
|
+
disabled: !Y,
|
|
817
812
|
disabledMessage: "Select a folder to create a task in"
|
|
818
813
|
}
|
|
819
814
|
],
|
|
820
|
-
[
|
|
815
|
+
[Y]
|
|
821
816
|
);
|
|
822
|
-
|
|
823
|
-
const
|
|
824
|
-
const
|
|
825
|
-
|
|
826
|
-
},
|
|
827
|
-
return /* @__PURE__ */ p(
|
|
817
|
+
St({ options: ve, onOpenNew: _, enabled: v });
|
|
818
|
+
const He = (e) => {
|
|
819
|
+
const w = ve.find((L) => L.value === e);
|
|
820
|
+
w && !w.disabled && _(w.type, { isSequence: w.isSequence });
|
|
821
|
+
}, Ie = n === "task" && Te(f), Ue = !o.label || !o.subType || Ie;
|
|
822
|
+
return /* @__PURE__ */ p(ue, { children: [
|
|
828
823
|
u && /* @__PURE__ */ t(
|
|
829
|
-
|
|
824
|
+
qt,
|
|
830
825
|
{
|
|
831
|
-
options:
|
|
826
|
+
options: ve,
|
|
832
827
|
value: [],
|
|
833
|
-
onChange: (e) =>
|
|
834
|
-
valueTemplate: () => /* @__PURE__ */ p(
|
|
835
|
-
/* @__PURE__ */ t(
|
|
828
|
+
onChange: (e) => He(e[0]),
|
|
829
|
+
valueTemplate: () => /* @__PURE__ */ p(ue, { children: [
|
|
830
|
+
/* @__PURE__ */ t(Q, { icon: "add" }),
|
|
836
831
|
/* @__PURE__ */ t("span", { children: "Create" })
|
|
837
832
|
] }),
|
|
838
833
|
itemTemplate: (e) => /* @__PURE__ */ p(
|
|
839
|
-
|
|
834
|
+
Ft,
|
|
840
835
|
{
|
|
841
836
|
className: e.disabled ? "disabled" : void 0,
|
|
842
837
|
"data-tooltip": e.disabled ? e.disabledMessage : void 0,
|
|
843
838
|
children: [
|
|
844
|
-
/* @__PURE__ */ t(
|
|
839
|
+
/* @__PURE__ */ t(Q, { icon: e.icon }),
|
|
845
840
|
/* @__PURE__ */ t("span", { className: "label", children: e.label }),
|
|
846
|
-
/* @__PURE__ */ t(
|
|
841
|
+
/* @__PURE__ */ t(tt, { children: e.shortcut })
|
|
847
842
|
]
|
|
848
843
|
}
|
|
849
844
|
),
|
|
850
845
|
itemStyle: {
|
|
851
846
|
paddingRight: 16
|
|
852
847
|
},
|
|
853
|
-
disabled:
|
|
848
|
+
disabled: r,
|
|
854
849
|
"data-tooltip": "Create new entity"
|
|
855
850
|
}
|
|
856
851
|
),
|
|
857
|
-
|
|
858
|
-
|
|
852
|
+
d && n && /* @__PURE__ */ t(
|
|
853
|
+
Ot,
|
|
859
854
|
{
|
|
860
|
-
header:
|
|
855
|
+
header: I(),
|
|
861
856
|
isOpen: !0,
|
|
862
|
-
onClose:
|
|
863
|
-
onShow:
|
|
864
|
-
size:
|
|
865
|
-
style: { maxWidth:
|
|
857
|
+
onClose: N,
|
|
858
|
+
onShow: U,
|
|
859
|
+
size: y.active ? "lg" : "md",
|
|
860
|
+
style: { maxWidth: y.active ? "unset" : 430 },
|
|
866
861
|
enableBackdropClose: !1,
|
|
867
|
-
footer: /* @__PURE__ */ p(
|
|
868
|
-
n === "folder" && /* @__PURE__ */ p(
|
|
862
|
+
footer: /* @__PURE__ */ p(nt, { onFocus: () => i(!1), style: { width: "100%" }, children: [
|
|
863
|
+
n === "folder" && /* @__PURE__ */ p(ue, { children: [
|
|
869
864
|
/* @__PURE__ */ t("span", { children: "Sequence" }),
|
|
870
865
|
/* @__PURE__ */ t(
|
|
871
|
-
|
|
866
|
+
Ne,
|
|
872
867
|
{
|
|
873
|
-
checked:
|
|
868
|
+
checked: y.active,
|
|
874
869
|
onChange: (e) => F({
|
|
875
|
-
...
|
|
870
|
+
...y,
|
|
876
871
|
active: e.target.checked
|
|
877
872
|
})
|
|
878
873
|
}
|
|
879
874
|
)
|
|
880
875
|
] }),
|
|
881
|
-
/* @__PURE__ */ t(
|
|
876
|
+
/* @__PURE__ */ t(ze, {}),
|
|
882
877
|
/* @__PURE__ */ t("span", { children: "Create more" }),
|
|
883
878
|
/* @__PURE__ */ t(
|
|
884
|
-
|
|
879
|
+
Ne,
|
|
885
880
|
{
|
|
886
|
-
checked:
|
|
887
|
-
onChange: (e) =>
|
|
881
|
+
checked: R,
|
|
882
|
+
onChange: (e) => J(e.target.checked)
|
|
888
883
|
}
|
|
889
884
|
),
|
|
890
885
|
/* @__PURE__ */ t(
|
|
891
|
-
|
|
886
|
+
at,
|
|
892
887
|
{
|
|
893
|
-
label:
|
|
894
|
-
onClick: () =>
|
|
895
|
-
active: !
|
|
896
|
-
disabled: !
|
|
897
|
-
"data-tooltip":
|
|
898
|
-
"data-shortcut":
|
|
899
|
-
saving:
|
|
888
|
+
label: te[n].createLabel,
|
|
889
|
+
onClick: () => se(R),
|
|
890
|
+
active: !Ue || oe,
|
|
891
|
+
disabled: !o.name || !o.label || Ie,
|
|
892
|
+
"data-tooltip": Ie ? "Select a parent folder" : void 0,
|
|
893
|
+
"data-shortcut": rt("Enter", [ot.Ctrl]),
|
|
894
|
+
saving: oe
|
|
900
895
|
}
|
|
901
896
|
)
|
|
902
897
|
] }),
|
|
903
|
-
onKeyDown: (e) =>
|
|
898
|
+
onKeyDown: (e) => fe(e),
|
|
904
899
|
onClick: (e) => {
|
|
905
|
-
e.target.tagName !== "INPUT" &&
|
|
900
|
+
e.target.tagName !== "INPUT" && i(!1);
|
|
906
901
|
},
|
|
907
902
|
children: /* @__PURE__ */ p(
|
|
908
903
|
"div",
|
|
@@ -913,65 +908,65 @@ const Ct = ({
|
|
|
913
908
|
gap: "var(--base-gap-large)"
|
|
914
909
|
},
|
|
915
910
|
children: [
|
|
916
|
-
/* @__PURE__ */ p(
|
|
917
|
-
/* @__PURE__ */ t(
|
|
918
|
-
|
|
919
|
-
|
|
911
|
+
/* @__PURE__ */ p(De, { children: [
|
|
912
|
+
/* @__PURE__ */ t(we, { children: "Parent folder" }),
|
|
913
|
+
H.length > 0 ? /* @__PURE__ */ t(
|
|
914
|
+
qe,
|
|
920
915
|
{
|
|
921
916
|
value: f,
|
|
922
|
-
options:
|
|
923
|
-
onChange: (e) =>
|
|
924
|
-
disabled:
|
|
917
|
+
options: ee,
|
|
918
|
+
onChange: (e) => a(e),
|
|
919
|
+
disabled: ee.length <= 1,
|
|
925
920
|
multiSelect: !0,
|
|
926
921
|
style: { width: "100%", minHeight: 32 }
|
|
927
922
|
}
|
|
928
|
-
) : n === "task" ? /* @__PURE__ */ t(
|
|
923
|
+
) : n === "task" ? /* @__PURE__ */ t(Ke, { children: "Select a folder to create a task in" }) : /* @__PURE__ */ t(Ke, { children: "Creating in the project root" })
|
|
929
924
|
] }),
|
|
930
|
-
|
|
925
|
+
y.active ? (
|
|
931
926
|
// @ts-ignore
|
|
932
927
|
/* @__PURE__ */ t(
|
|
933
|
-
|
|
928
|
+
kt,
|
|
934
929
|
{
|
|
935
|
-
base:
|
|
936
|
-
type:
|
|
937
|
-
increment:
|
|
938
|
-
length:
|
|
939
|
-
prefix:
|
|
940
|
-
prefixDepth:
|
|
941
|
-
parentLabel:
|
|
930
|
+
base: o.label,
|
|
931
|
+
type: o.subType,
|
|
932
|
+
increment: y.increment,
|
|
933
|
+
length: y.length,
|
|
934
|
+
prefix: y.prefix,
|
|
935
|
+
prefixDepth: y.prefixDepth,
|
|
936
|
+
parentLabel: S,
|
|
942
937
|
entityType: "folder",
|
|
943
938
|
nesting: !1,
|
|
944
|
-
onChange:
|
|
945
|
-
isRoot:
|
|
946
|
-
typeSelectRef:
|
|
947
|
-
onLastInputKeydown: (e) =>
|
|
939
|
+
onChange: Z,
|
|
940
|
+
isRoot: l,
|
|
941
|
+
typeSelectRef: M,
|
|
942
|
+
onLastInputKeydown: (e) => fe(e, !0),
|
|
948
943
|
folders: h?.folderTypes || []
|
|
949
944
|
}
|
|
950
945
|
)
|
|
951
|
-
) : /* @__PURE__ */ p(
|
|
952
|
-
/* @__PURE__ */ p(
|
|
953
|
-
/* @__PURE__ */ t(
|
|
946
|
+
) : /* @__PURE__ */ p(Dt, { children: [
|
|
947
|
+
/* @__PURE__ */ p(De, { children: [
|
|
948
|
+
/* @__PURE__ */ t(we, { children: "Type" }),
|
|
954
949
|
/* @__PURE__ */ t(
|
|
955
|
-
|
|
950
|
+
xe,
|
|
956
951
|
{
|
|
957
|
-
value: [
|
|
958
|
-
onChange: (e) =>
|
|
959
|
-
options:
|
|
952
|
+
value: [o.subType],
|
|
953
|
+
onChange: (e) => c(e, "subType"),
|
|
954
|
+
options: P,
|
|
960
955
|
style: { width: 160 },
|
|
961
|
-
ref:
|
|
962
|
-
onFocus:
|
|
963
|
-
onClick: () =>
|
|
956
|
+
ref: M,
|
|
957
|
+
onFocus: We,
|
|
958
|
+
onClick: () => i(!1)
|
|
964
959
|
}
|
|
965
960
|
)
|
|
966
961
|
] }),
|
|
967
962
|
/* @__PURE__ */ t(
|
|
968
|
-
|
|
963
|
+
Et,
|
|
969
964
|
{
|
|
970
|
-
handleChange:
|
|
971
|
-
entityForm:
|
|
972
|
-
labelRef:
|
|
973
|
-
setNameFocused:
|
|
974
|
-
handleKeyDown:
|
|
965
|
+
handleChange: c,
|
|
966
|
+
entityForm: o,
|
|
967
|
+
labelRef: j,
|
|
968
|
+
setNameFocused: i,
|
|
969
|
+
handleKeyDown: fe,
|
|
975
970
|
nameInfo: `Names are auto generated from the label using the Entity Naming setting on the project anatomy. Capitalization: ${q.capitalization}. Separator: "${q.separator}"`
|
|
976
971
|
}
|
|
977
972
|
)
|
|
@@ -982,31 +977,31 @@ const Ct = ({
|
|
|
982
977
|
}
|
|
983
978
|
)
|
|
984
979
|
] });
|
|
985
|
-
},
|
|
986
|
-
if (!
|
|
987
|
-
const
|
|
988
|
-
(
|
|
980
|
+
}, Pt = (r, m, u) => {
|
|
981
|
+
if (!r || !m) return "";
|
|
982
|
+
const d = (r === "folder" ? u?.folderTypes : u?.taskTypes)?.find(
|
|
983
|
+
(v) => v.name === m
|
|
989
984
|
);
|
|
990
|
-
return
|
|
991
|
-
},
|
|
992
|
-
const { projectName: m, ...u } =
|
|
985
|
+
return d ? d.name : "";
|
|
986
|
+
}, _e = Xe(void 0), tn = ({ children: r }) => {
|
|
987
|
+
const { projectName: m, ...u } = Ee(), { attribFields: d } = dt(), { findNonInheritedValues: v, getFolderById: h } = Be(), { attrib: n = {}, statuses: O } = u || {}, { anatomy: o } = Ee(), { entity_naming: D = { capitalization: "lower", separator: "_" } } = o, { rowSelection: y, sliceType: F } = pt(), A = O?.filter((a) => a.scope?.includes("task"))?.[0]?.name || O?.[0]?.name || "none", _ = O?.filter((a) => a.scope?.includes("folder"))?.[0]?.name || O?.[0]?.name || "none", [q, s] = z(null), [R, J] = z(null), K = { label: "", subType: "", name: "" }, [x, ne] = z(K), [W, V] = z({
|
|
993
988
|
active: !1,
|
|
994
989
|
increment: "",
|
|
995
990
|
length: 10,
|
|
996
991
|
prefix: !1,
|
|
997
992
|
prefixDepth: 0
|
|
998
|
-
}),
|
|
999
|
-
const
|
|
1000
|
-
if (F !== "hierarchy" && !
|
|
1001
|
-
const b = Object.keys(
|
|
1002
|
-
(
|
|
993
|
+
}), X = (a, f, g, S) => {
|
|
994
|
+
const l = {};
|
|
995
|
+
if (F !== "hierarchy" && !Te(y) && a === "task") {
|
|
996
|
+
const b = Object.keys(y).filter(
|
|
997
|
+
(i) => !["hasValue", "noValue"].includes(i)
|
|
1003
998
|
);
|
|
1004
999
|
switch (F) {
|
|
1005
1000
|
case "assignees":
|
|
1006
|
-
|
|
1001
|
+
l.assignees = b;
|
|
1007
1002
|
break;
|
|
1008
1003
|
case "status":
|
|
1009
|
-
|
|
1004
|
+
l.status = b[0];
|
|
1010
1005
|
break;
|
|
1011
1006
|
}
|
|
1012
1007
|
}
|
|
@@ -1014,104 +1009,104 @@ const Ct = ({
|
|
|
1014
1009
|
type: "create",
|
|
1015
1010
|
entityType: a,
|
|
1016
1011
|
data: {
|
|
1017
|
-
[`${a}Type`]:
|
|
1018
|
-
id:
|
|
1019
|
-
label:
|
|
1020
|
-
name:
|
|
1021
|
-
...
|
|
1022
|
-
...
|
|
1012
|
+
[`${a}Type`]: f,
|
|
1013
|
+
id: Ze(),
|
|
1014
|
+
label: g.label || g.name,
|
|
1015
|
+
name: g.name,
|
|
1016
|
+
...S && { [a === "folder" ? "parentId" : "folderId"]: S },
|
|
1017
|
+
...l
|
|
1023
1018
|
}
|
|
1024
1019
|
};
|
|
1025
|
-
},
|
|
1026
|
-
if (
|
|
1027
|
-
return
|
|
1020
|
+
}, ae = (a, f, g, S, l) => {
|
|
1021
|
+
if (S.length === 0 && a === "folder")
|
|
1022
|
+
return g.map((i) => X(a, f, { name: i }));
|
|
1028
1023
|
const b = [];
|
|
1029
|
-
for (const
|
|
1030
|
-
for (const
|
|
1031
|
-
const
|
|
1032
|
-
b.push(
|
|
1024
|
+
for (const i of S)
|
|
1025
|
+
for (const C of g) {
|
|
1026
|
+
const $ = l ? (i.label || i.name) + C : C;
|
|
1027
|
+
b.push(X(a, f, { name: $ }, i.id));
|
|
1033
1028
|
}
|
|
1034
1029
|
return b;
|
|
1035
|
-
},
|
|
1036
|
-
(b) =>
|
|
1037
|
-
),
|
|
1038
|
-
const
|
|
1039
|
-
for (const
|
|
1040
|
-
if (
|
|
1041
|
-
|
|
1042
|
-
else if (
|
|
1043
|
-
if (!
|
|
1044
|
-
console.warn("Task operation without folderId:",
|
|
1030
|
+
}, de = (a, f, g, S, l) => S.length === 0 && a === "folder" ? [X(a, f, { name: l, label: g })] : S.map(
|
|
1031
|
+
(b) => X(a, f, { name: l, label: g }, b)
|
|
1032
|
+
), H = (a, f = {}) => {
|
|
1033
|
+
const g = /* @__PURE__ */ new Set();
|
|
1034
|
+
for (const T of a)
|
|
1035
|
+
if (T.entityType === "folder")
|
|
1036
|
+
T.data?.parentId && g.add(T.data.parentId);
|
|
1037
|
+
else if (T.entityType === "task") {
|
|
1038
|
+
if (!T.data?.folderId) {
|
|
1039
|
+
console.warn("Task operation without folderId:", T);
|
|
1045
1040
|
continue;
|
|
1046
1041
|
}
|
|
1047
|
-
|
|
1042
|
+
g.add(T.data.folderId);
|
|
1048
1043
|
}
|
|
1049
|
-
const
|
|
1050
|
-
for (const
|
|
1051
|
-
if (!
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1054
|
-
|
|
1044
|
+
const S = /* @__PURE__ */ new Map();
|
|
1045
|
+
for (const T of g) {
|
|
1046
|
+
if (!T) continue;
|
|
1047
|
+
const I = v(
|
|
1048
|
+
T,
|
|
1049
|
+
d.map((P) => P.name)
|
|
1055
1050
|
);
|
|
1056
|
-
|
|
1051
|
+
S.set(T, I);
|
|
1057
1052
|
}
|
|
1058
|
-
const
|
|
1059
|
-
let
|
|
1060
|
-
for (const
|
|
1061
|
-
const
|
|
1062
|
-
const
|
|
1063
|
-
if (!
|
|
1064
|
-
const
|
|
1065
|
-
return
|
|
1066
|
-
...
|
|
1053
|
+
const l = a.filter((T) => T.entityType === "folder"), b = a.filter((T) => T.entityType === "task"), i = (T, I) => {
|
|
1054
|
+
let P = [];
|
|
1055
|
+
for (const c of T) {
|
|
1056
|
+
const Z = I === "folder" ? c.data.parentId : c.data.folderId, M = S.get(Z) || n, j = Object.keys(M).reduce((N, U) => {
|
|
1057
|
+
const oe = d.find((fe) => fe.name === U);
|
|
1058
|
+
if (!oe) return N;
|
|
1059
|
+
const ye = oe.scope?.includes(I), se = !!oe.data.inherit;
|
|
1060
|
+
return ye ? N[U] = M[U] : se && M[U] && (N[U] = {
|
|
1061
|
+
...M[U],
|
|
1067
1062
|
inherited: !0,
|
|
1068
|
-
inheritedFrom:
|
|
1069
|
-
}),
|
|
1063
|
+
inheritedFrom: Z
|
|
1064
|
+
}), N;
|
|
1070
1065
|
}, {});
|
|
1071
|
-
if (
|
|
1072
|
-
let
|
|
1073
|
-
|
|
1074
|
-
const
|
|
1066
|
+
if (I === "folder") {
|
|
1067
|
+
let N = c.data.parentId && f[c.data.parentId];
|
|
1068
|
+
N = N ? N + "/" + c.data.name : "";
|
|
1069
|
+
const U = {
|
|
1075
1070
|
type: "create",
|
|
1076
1071
|
entityType: "folder",
|
|
1077
|
-
entityId:
|
|
1072
|
+
entityId: c.data.id,
|
|
1078
1073
|
data: {
|
|
1079
|
-
...
|
|
1080
|
-
entityId:
|
|
1074
|
+
...c.data,
|
|
1075
|
+
entityId: c.data.id,
|
|
1081
1076
|
entityType: "folder",
|
|
1082
1077
|
projectName: m,
|
|
1083
|
-
folderType:
|
|
1078
|
+
folderType: c.data.folderType,
|
|
1084
1079
|
parents: [],
|
|
1085
1080
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1086
1081
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1087
|
-
status:
|
|
1082
|
+
status: _,
|
|
1088
1083
|
ownAttrib: [],
|
|
1089
|
-
path:
|
|
1084
|
+
path: N,
|
|
1090
1085
|
tags: [],
|
|
1091
|
-
attrib:
|
|
1086
|
+
attrib: j,
|
|
1092
1087
|
links: []
|
|
1093
1088
|
// Add empty links object
|
|
1094
1089
|
}
|
|
1095
1090
|
};
|
|
1096
|
-
|
|
1091
|
+
P.push(U);
|
|
1097
1092
|
} else {
|
|
1098
|
-
const
|
|
1093
|
+
const N = {
|
|
1099
1094
|
type: "create",
|
|
1100
1095
|
entityType: "task",
|
|
1101
|
-
entityId:
|
|
1096
|
+
entityId: c.data.id,
|
|
1102
1097
|
data: {
|
|
1103
|
-
...
|
|
1104
|
-
entityId:
|
|
1098
|
+
...c.data,
|
|
1099
|
+
entityId: c.data.id,
|
|
1105
1100
|
entityType: "task",
|
|
1106
|
-
label:
|
|
1107
|
-
taskType:
|
|
1108
|
-
folderId:
|
|
1101
|
+
label: c.data.label || c.data.name,
|
|
1102
|
+
taskType: c.data.taskType || "",
|
|
1103
|
+
folderId: c.data.folderId || "",
|
|
1109
1104
|
active: !0,
|
|
1110
|
-
assignees:
|
|
1105
|
+
assignees: c.data.assignees || [],
|
|
1111
1106
|
projectName: m,
|
|
1112
|
-
status:
|
|
1107
|
+
status: c.data.status || A,
|
|
1113
1108
|
folder: {
|
|
1114
|
-
path:
|
|
1109
|
+
path: c.data.folderId ? f[c.data.folderId] : "",
|
|
1115
1110
|
folderType: ""
|
|
1116
1111
|
},
|
|
1117
1112
|
tags: [],
|
|
@@ -1121,127 +1116,127 @@ const Ct = ({
|
|
|
1121
1116
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1122
1117
|
thumbnailHash: "",
|
|
1123
1118
|
subtasks: [],
|
|
1124
|
-
attrib:
|
|
1119
|
+
attrib: j,
|
|
1125
1120
|
hasReviewables: !1,
|
|
1126
1121
|
// Add required field
|
|
1127
1122
|
links: [],
|
|
1128
1123
|
// Add empty links object
|
|
1129
|
-
allAttrib: JSON.stringify(
|
|
1124
|
+
allAttrib: JSON.stringify(j),
|
|
1130
1125
|
parents: []
|
|
1131
1126
|
}
|
|
1132
1127
|
};
|
|
1133
|
-
|
|
1128
|
+
P.push(N);
|
|
1134
1129
|
}
|
|
1135
1130
|
}
|
|
1136
|
-
return
|
|
1137
|
-
},
|
|
1138
|
-
|
|
1131
|
+
return P;
|
|
1132
|
+
}, C = i(
|
|
1133
|
+
l,
|
|
1139
1134
|
"folder"
|
|
1140
|
-
),
|
|
1135
|
+
), $ = i(
|
|
1141
1136
|
b,
|
|
1142
1137
|
"task"
|
|
1143
1138
|
);
|
|
1144
|
-
return [...
|
|
1145
|
-
}, [
|
|
1146
|
-
if (!q || !
|
|
1147
|
-
throw
|
|
1139
|
+
return [...C, ...$];
|
|
1140
|
+
}, [Y] = ut(), ee = async (a) => {
|
|
1141
|
+
if (!q || !x.label || !x.name)
|
|
1142
|
+
throw me.error("Please provide a valid name and select an entity type"), new Error("Invalid entity type or label");
|
|
1148
1143
|
if (q === "task" && a.length === 0)
|
|
1149
|
-
throw
|
|
1150
|
-
let
|
|
1151
|
-
if (
|
|
1152
|
-
const
|
|
1153
|
-
for (const
|
|
1154
|
-
const
|
|
1155
|
-
|
|
1156
|
-
id:
|
|
1157
|
-
name:
|
|
1158
|
-
label:
|
|
1144
|
+
throw me.error("Cannot create a task without selecting a folder"), new Error("No folder selected for task creation");
|
|
1145
|
+
let f;
|
|
1146
|
+
if (W.active) {
|
|
1147
|
+
const l = [];
|
|
1148
|
+
for (const i of a) {
|
|
1149
|
+
const C = h(i);
|
|
1150
|
+
C && l.push({
|
|
1151
|
+
id: C.id,
|
|
1152
|
+
name: C.name,
|
|
1153
|
+
label: C.label || C.name
|
|
1159
1154
|
});
|
|
1160
1155
|
}
|
|
1161
|
-
const b =
|
|
1162
|
-
|
|
1156
|
+
const b = Oe(x.label, W.increment, W.length);
|
|
1157
|
+
f = ae(
|
|
1163
1158
|
q,
|
|
1164
|
-
|
|
1159
|
+
x.subType,
|
|
1165
1160
|
b,
|
|
1166
|
-
|
|
1167
|
-
|
|
1161
|
+
l,
|
|
1162
|
+
W.prefix
|
|
1168
1163
|
);
|
|
1169
1164
|
} else
|
|
1170
|
-
|
|
1165
|
+
f = de(
|
|
1171
1166
|
q,
|
|
1172
|
-
|
|
1173
|
-
|
|
1167
|
+
x.subType,
|
|
1168
|
+
x.label,
|
|
1174
1169
|
a,
|
|
1175
|
-
|
|
1170
|
+
x.name
|
|
1176
1171
|
);
|
|
1177
|
-
const
|
|
1178
|
-
for (const
|
|
1179
|
-
const b = h(
|
|
1180
|
-
b && (
|
|
1172
|
+
const g = {};
|
|
1173
|
+
for (const l of a) {
|
|
1174
|
+
const b = h(l);
|
|
1175
|
+
b && (g[b.id] = b.path);
|
|
1181
1176
|
}
|
|
1182
|
-
const
|
|
1177
|
+
const S = H(f, g);
|
|
1183
1178
|
try {
|
|
1184
|
-
const
|
|
1185
|
-
operationsRequestModel: { operations:
|
|
1179
|
+
const l = await Y({
|
|
1180
|
+
operationsRequestModel: { operations: f },
|
|
1186
1181
|
projectName: m,
|
|
1187
|
-
patchOperations:
|
|
1182
|
+
patchOperations: S
|
|
1188
1183
|
}).unwrap();
|
|
1189
|
-
if (
|
|
1190
|
-
return
|
|
1184
|
+
if (l?.success && l.operations)
|
|
1185
|
+
return l.operations;
|
|
1191
1186
|
throw {
|
|
1192
1187
|
error: (
|
|
1193
1188
|
// @ts-expect-error - res.operations may not be typed
|
|
1194
|
-
|
|
1189
|
+
l?.operations?.[0]?.error || "An error occurred while creating the entity. Please try again."
|
|
1195
1190
|
)
|
|
1196
1191
|
};
|
|
1197
|
-
} catch (
|
|
1198
|
-
console.log(
|
|
1199
|
-
const b =
|
|
1200
|
-
throw
|
|
1192
|
+
} catch (l) {
|
|
1193
|
+
console.log(l);
|
|
1194
|
+
const b = Ye(l);
|
|
1195
|
+
throw me.error(b), new Error(b);
|
|
1201
1196
|
}
|
|
1202
|
-
},
|
|
1203
|
-
|
|
1204
|
-
const
|
|
1205
|
-
subType:
|
|
1197
|
+
}, B = (a, f) => {
|
|
1198
|
+
s(a), J(f?.parentFolderIds ?? null);
|
|
1199
|
+
const l = ((a === "folder" ? u?.folderTypes : u?.taskTypes) || [])[0].name || "", b = Pt(a, l, u), i = {
|
|
1200
|
+
subType: l,
|
|
1206
1201
|
label: b,
|
|
1207
1202
|
name: be(b, D)
|
|
1208
1203
|
};
|
|
1209
|
-
|
|
1210
|
-
...
|
|
1204
|
+
f?.isSequence && V((C) => ({
|
|
1205
|
+
...C,
|
|
1211
1206
|
active: !0
|
|
1212
|
-
})),
|
|
1207
|
+
})), ne(i);
|
|
1213
1208
|
};
|
|
1214
1209
|
return /* @__PURE__ */ t(
|
|
1215
|
-
|
|
1210
|
+
_e.Provider,
|
|
1216
1211
|
{
|
|
1217
1212
|
value: {
|
|
1218
1213
|
config: D,
|
|
1219
1214
|
entityType: q,
|
|
1220
|
-
setEntityType:
|
|
1221
|
-
entityForm:
|
|
1222
|
-
setEntityForm:
|
|
1223
|
-
sequenceForm:
|
|
1224
|
-
setSequenceForm:
|
|
1225
|
-
onCreateNew:
|
|
1226
|
-
onOpenNew:
|
|
1227
|
-
parentFolderIds:
|
|
1215
|
+
setEntityType: s,
|
|
1216
|
+
entityForm: x,
|
|
1217
|
+
setEntityForm: ne,
|
|
1218
|
+
sequenceForm: W,
|
|
1219
|
+
setSequenceForm: V,
|
|
1220
|
+
onCreateNew: ee,
|
|
1221
|
+
onOpenNew: B,
|
|
1222
|
+
parentFolderIds: R
|
|
1228
1223
|
},
|
|
1229
|
-
children:
|
|
1224
|
+
children: r
|
|
1230
1225
|
}
|
|
1231
1226
|
);
|
|
1232
|
-
},
|
|
1233
|
-
const
|
|
1234
|
-
if (!
|
|
1227
|
+
}, jt = () => {
|
|
1228
|
+
const r = Ce(_e);
|
|
1229
|
+
if (!r)
|
|
1235
1230
|
throw new Error("useNewEntityContext must be used within a NewEntityProvider");
|
|
1236
|
-
return
|
|
1231
|
+
return r;
|
|
1237
1232
|
};
|
|
1238
1233
|
export {
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1234
|
+
we as I,
|
|
1235
|
+
Nt as N,
|
|
1236
|
+
De as a,
|
|
1237
|
+
en as b,
|
|
1238
|
+
Et as c,
|
|
1239
|
+
tn as d,
|
|
1240
|
+
Pt as g,
|
|
1241
|
+
jt as u
|
|
1247
1242
|
};
|