rowvia 0.3.3 → 0.3.4
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/rowvia.css +1 -1
- package/dist/rowvia.es.js +353 -347
- package/dist/rowvia.umd.cjs +12 -12
- package/dist/types/work-items/workflow-detail-types.d.ts +4 -0
- package/package.json +3 -2
package/dist/rowvia.es.js
CHANGED
|
@@ -179,13 +179,13 @@ function ht(s) {
|
|
|
179
179
|
}
|
|
180
180
|
return e;
|
|
181
181
|
}
|
|
182
|
-
const
|
|
182
|
+
const Bt = {
|
|
183
183
|
SUM: (s) => ht(s).reduce((e, t) => e + t, 0),
|
|
184
184
|
AVERAGE: (s) => {
|
|
185
185
|
const e = ht(s);
|
|
186
186
|
return e.length ? e.reduce((t, n) => t + n, 0) / e.length : 0;
|
|
187
187
|
},
|
|
188
|
-
AVG: (s) =>
|
|
188
|
+
AVG: (s) => Bt.AVERAGE(s, {}),
|
|
189
189
|
MIN: (s) => {
|
|
190
190
|
const e = ht(s);
|
|
191
191
|
return e.length ? Math.min(...e) : 0;
|
|
@@ -262,9 +262,9 @@ const Vt = {
|
|
|
262
262
|
VALUE: (s) => we(s[0]),
|
|
263
263
|
NUMBER: (s) => we(s[0]),
|
|
264
264
|
BETWEEN: (s) => we(s[0]) >= we(s[1]) && we(s[0]) <= we(s[2])
|
|
265
|
-
}, rn = Object.keys(
|
|
265
|
+
}, rn = Object.keys(Bt);
|
|
266
266
|
function Za(s, e) {
|
|
267
|
-
|
|
267
|
+
Bt[s.toUpperCase()] = e, rn.includes(s.toUpperCase()) || rn.push(s.toUpperCase());
|
|
268
268
|
}
|
|
269
269
|
function Oi(s, e) {
|
|
270
270
|
const t = /^([A-Za-z]{1,3})(\d+)$/.exec(s);
|
|
@@ -293,7 +293,7 @@ function bt(s, e) {
|
|
|
293
293
|
case "unary":
|
|
294
294
|
return -we(bt(s.operand, e));
|
|
295
295
|
case "call": {
|
|
296
|
-
const t =
|
|
296
|
+
const t = Bt[s.name];
|
|
297
297
|
if (!t) throw new Ve("#NAME?");
|
|
298
298
|
const n = s.args.map((i) => bt(i, e));
|
|
299
299
|
return t(n, e);
|
|
@@ -341,14 +341,14 @@ function bt(s, e) {
|
|
|
341
341
|
throw new Ve("#ERROR!");
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function Pt(s, e = {}) {
|
|
345
345
|
const t = s.startsWith("=") ? s.slice(1) : s, n = Hi(Pi(t));
|
|
346
346
|
return bt(n, e);
|
|
347
347
|
}
|
|
348
348
|
function yn(s) {
|
|
349
349
|
return typeof s == "string" && s.trimStart().startsWith("=");
|
|
350
350
|
}
|
|
351
|
-
function
|
|
351
|
+
function qt(s, e) {
|
|
352
352
|
if (s == null) return;
|
|
353
353
|
if (e in s) return s[e];
|
|
354
354
|
const t = e.split(".");
|
|
@@ -362,21 +362,21 @@ function zt(s, e) {
|
|
|
362
362
|
function Ce(s, e, t) {
|
|
363
363
|
const n = s.colDef, i = (e.group || e.footer) && !!e.groupData && e.groupData[s.colId] !== void 0, o = i ? e.groupData : e.data, a = s.valueGetter ?? n.valueGetter;
|
|
364
364
|
if (a)
|
|
365
|
-
return (typeof a == "string" ? (r) => yn(a) ?
|
|
365
|
+
return (typeof a == "string" ? (r) => yn(a) ? Pt(a, { data: r.data }) : qt(r.data, a) : a)({
|
|
366
366
|
data: i ? e.groupData : e.data,
|
|
367
367
|
node: e,
|
|
368
368
|
column: s,
|
|
369
369
|
api: t,
|
|
370
370
|
colDef: n,
|
|
371
|
-
getValue: (r) =>
|
|
371
|
+
getValue: (r) => qt(i ? e.groupData : e.data, r)
|
|
372
372
|
});
|
|
373
373
|
if (s.field && yn(s.field))
|
|
374
|
-
return
|
|
374
|
+
return Pt(s.field, { data: e.data });
|
|
375
375
|
if (s.field && s.colDef.expression && /[+*/^-]/.test(s.field))
|
|
376
|
-
return
|
|
377
|
-
if (s.field) return
|
|
376
|
+
return Pt(`=${s.field}`, { data: e.data });
|
|
377
|
+
if (s.field) return qt(o, s.field);
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Ot(s, e, t) {
|
|
380
380
|
var o;
|
|
381
381
|
const n = Ce(s, e, t), i = s.colDef;
|
|
382
382
|
if (i.showValueAs && typeof n == "number" && t) {
|
|
@@ -1125,7 +1125,7 @@ class zi {
|
|
|
1125
1125
|
r = e.groupData[t.colId];
|
|
1126
1126
|
else {
|
|
1127
1127
|
const c = [];
|
|
1128
|
-
|
|
1128
|
+
Ht(e, c);
|
|
1129
1129
|
const p = c.map((h) => Ce(t, h, null));
|
|
1130
1130
|
r = Et(t, t.aggFunc, p);
|
|
1131
1131
|
}
|
|
@@ -1237,7 +1237,7 @@ class zi {
|
|
|
1237
1237
|
for (const x of b.children) x.parent = b;
|
|
1238
1238
|
b.allChildrenCount = ni(b), b.data = { ...b.data };
|
|
1239
1239
|
const N = [];
|
|
1240
|
-
|
|
1240
|
+
Ht(b, N);
|
|
1241
1241
|
const I = {};
|
|
1242
1242
|
for (const x of t) {
|
|
1243
1243
|
const G = N.map((E) => Ce(x, E, null));
|
|
@@ -1319,7 +1319,7 @@ class zi {
|
|
|
1319
1319
|
n || (n = new Je(null, this.rowNodeServices, t), this.rowNodeMap.set(t, n)), n.group = !1, n.footer = !0, n.level = 0, n.uiLevel = 0, n.selected = !1, n.selectable = !1;
|
|
1320
1320
|
const i = this.columns().filter((l) => l.aggFunc && !l.rowGroup), o = [];
|
|
1321
1321
|
for (const l of this.rootRowNodes)
|
|
1322
|
-
l.group ?
|
|
1322
|
+
l.group ? Ht(l, o) : l.__passesFilter && o.push(l);
|
|
1323
1323
|
const a = {};
|
|
1324
1324
|
for (const l of i) {
|
|
1325
1325
|
const r = o.map((d) => Ce(l, d, null));
|
|
@@ -1364,12 +1364,12 @@ function Nt(s) {
|
|
|
1364
1364
|
function ni(s) {
|
|
1365
1365
|
return !s.children || s.children.length === 0 ? 1 : s.children.reduce((e, t) => e + ni(t), 0);
|
|
1366
1366
|
}
|
|
1367
|
-
function
|
|
1367
|
+
function Ht(s, e) {
|
|
1368
1368
|
if (!s.children || s.children.length === 0) {
|
|
1369
1369
|
e.push(s);
|
|
1370
1370
|
return;
|
|
1371
1371
|
}
|
|
1372
|
-
for (const t of s.children)
|
|
1372
|
+
for (const t of s.children) Ht(t, e);
|
|
1373
1373
|
}
|
|
1374
1374
|
function Wi(s, e) {
|
|
1375
1375
|
return e;
|
|
@@ -4065,11 +4065,11 @@ function Hs(s) {
|
|
|
4065
4065
|
}
|
|
4066
4066
|
return a;
|
|
4067
4067
|
}
|
|
4068
|
-
async function
|
|
4068
|
+
async function zt(s, e) {
|
|
4069
4069
|
const t = new DataView(s), n = new Uint8Array(s), i = it(t, e.localHeaderOffset + 26), o = it(t, e.localHeaderOffset + 28), a = e.localHeaderOffset + 30 + i + o, l = n.subarray(a, a + e.compressedSize);
|
|
4070
4070
|
return e.compressionMethod === 0 ? l : Ps(l);
|
|
4071
4071
|
}
|
|
4072
|
-
function
|
|
4072
|
+
function _t(s) {
|
|
4073
4073
|
return new DOMParser().parseFromString(s, "application/xml");
|
|
4074
4074
|
}
|
|
4075
4075
|
function Os(s) {
|
|
@@ -4082,13 +4082,13 @@ function Os(s) {
|
|
|
4082
4082
|
async function Bs(s) {
|
|
4083
4083
|
const e = Hs(s), t = e.find((d) => d.name === "xl/workbook.xml"), n = [];
|
|
4084
4084
|
if (t) {
|
|
4085
|
-
const c =
|
|
4085
|
+
const c = _t(new TextDecoder().decode(await zt(s, t))).getElementsByTagName("sheet");
|
|
4086
4086
|
for (let p = 0; p < c.length; p++)
|
|
4087
4087
|
n.push(c[p].getAttribute("name") || `Sheet${p + 1}`), c[p].getAttribute("r:id") || c[p].getAttribute("id");
|
|
4088
4088
|
}
|
|
4089
4089
|
const i = [], o = e.find((d) => d.name === "xl/sharedStrings.xml");
|
|
4090
4090
|
if (o) {
|
|
4091
|
-
const c =
|
|
4091
|
+
const c = _t(new TextDecoder().decode(await zt(s, o))).getElementsByTagName("si");
|
|
4092
4092
|
for (let p = 0; p < c.length; p++) {
|
|
4093
4093
|
const h = c[p].getElementsByTagName("t");
|
|
4094
4094
|
let u = "";
|
|
@@ -4098,7 +4098,7 @@ async function Bs(s) {
|
|
|
4098
4098
|
}
|
|
4099
4099
|
const l = e.filter((d) => /^xl\/worksheets\/sheet\d+\.xml$/.test(d.name)).sort((d, c) => d.name.localeCompare(c.name, void 0, { numeric: !0 })), r = [];
|
|
4100
4100
|
for (let d = 0; d < l.length; d++) {
|
|
4101
|
-
const p =
|
|
4101
|
+
const p = _t(new TextDecoder().decode(await zt(s, l[d]))).getElementsByTagName("row"), h = [];
|
|
4102
4102
|
for (let u = 0; u < p.length; u++) {
|
|
4103
4103
|
const f = p[u], g = [], v = f.getElementsByTagName("c");
|
|
4104
4104
|
for (let m = 0; m < v.length; m++) {
|
|
@@ -4224,7 +4224,7 @@ class js {
|
|
|
4224
4224
|
}), i && n.length === 0 ? this.getExportRows({ ...e, onlySelected: !1 }) : n;
|
|
4225
4225
|
}
|
|
4226
4226
|
getCellValueForExport(e, t, n) {
|
|
4227
|
-
let i = Ce(e, t, this.grid.getApi()), o =
|
|
4227
|
+
let i = Ce(e, t, this.grid.getApi()), o = Ot(e, t, this.grid.getApi());
|
|
4228
4228
|
if (n.processCellCallback) {
|
|
4229
4229
|
const l = n.processCellCallback({
|
|
4230
4230
|
value: i,
|
|
@@ -4891,7 +4891,7 @@ class Xs {
|
|
|
4891
4891
|
this.grid.getRowModel().forEachNode((n, i) => {
|
|
4892
4892
|
if (!(n.group || n.footer))
|
|
4893
4893
|
for (const o of t) {
|
|
4894
|
-
const a =
|
|
4894
|
+
const a = Ot(o, n, this.grid.getApi()) ?? "", l = this.matchCase ? a : a.toLowerCase(), r = this.matchCase ? e : e.toLowerCase();
|
|
4895
4895
|
l.includes(r) && this.matches.push({ rowIndex: i, colId: o.colId });
|
|
4896
4896
|
}
|
|
4897
4897
|
});
|
|
@@ -4955,7 +4955,7 @@ class Zs {
|
|
|
4955
4955
|
return;
|
|
4956
4956
|
}
|
|
4957
4957
|
try {
|
|
4958
|
-
const v =
|
|
4958
|
+
const v = Pt(a.value, { data: g.data });
|
|
4959
4959
|
l.textContent = `${this.grid.t("formulaPreview")}: ${v == null ? "" : String(v)}`, l.classList.remove("ag-formula-error");
|
|
4960
4960
|
} catch (v) {
|
|
4961
4961
|
l.textContent = `${this.grid.t("formulaError")}: ${(v == null ? void 0 : v.code) || (v == null ? void 0 : v.message) || this.grid.t("invalidFormula")}`, l.classList.add("ag-formula-error");
|
|
@@ -6145,7 +6145,7 @@ class co {
|
|
|
6145
6145
|
if (t.addEventListener("click", (r) => {
|
|
6146
6146
|
this.ctx.eventService.dispatchEvent("columnHeaderClicked", { column: e, api: null }), e.sortable && this.ctx.onSortRequested(e, r, r.shiftKey || r.ctrlKey || r.metaKey);
|
|
6147
6147
|
}), t.addEventListener("contextmenu", (r) => {
|
|
6148
|
-
r.preventDefault(), this.ctx.eventService.dispatchEvent("columnHeaderContextMenu", { column: e, event: r }), this.ctx.onColumnMenuClicked(e, t);
|
|
6148
|
+
r.preventDefault(), this.ctx.eventService.dispatchEvent("columnHeaderContextMenu", { column: e, event: r }), !this.ctx.isColumnMenuSuppressed(e) && !e.suppressMenu && this.ctx.onColumnMenuClicked(e, t);
|
|
6149
6149
|
}), t.addEventListener("dblclick", (r) => {
|
|
6150
6150
|
const d = t.getBoundingClientRect();
|
|
6151
6151
|
r.clientX > d.right - 8 && e.resizable && this.ctx.eventService.dispatchEvent("columnResized", { column: e, source: "autoSize" });
|
|
@@ -6375,7 +6375,7 @@ class It {
|
|
|
6375
6375
|
}
|
|
6376
6376
|
updateCellContent(e) {
|
|
6377
6377
|
var d;
|
|
6378
|
-
const { column: t, node: n } = { column: e.column, node: this.node }, i = Ce(t, n, null), o =
|
|
6378
|
+
const { column: t, node: n } = { column: e.column, node: this.node }, i = Ce(t, n, null), o = Ot(t, n, null);
|
|
6379
6379
|
e.lastValue = i, e.lastFormatted = o;
|
|
6380
6380
|
const a = typeof t.cellRenderer == "string" ? t.cellRenderer : null, l = typeof t.cellRenderer == "function" ? t.cellRenderer : null;
|
|
6381
6381
|
if (a || l) {
|
|
@@ -6427,7 +6427,7 @@ class It {
|
|
|
6427
6427
|
if (c.rendererInstance && typeof c.rendererInstance.refresh == "function") {
|
|
6428
6428
|
c.rendererInstance.refresh({
|
|
6429
6429
|
value: p,
|
|
6430
|
-
valueFormatted:
|
|
6430
|
+
valueFormatted: Ot(c.column, this.node, null),
|
|
6431
6431
|
data: this.node.data,
|
|
6432
6432
|
node: this.node,
|
|
6433
6433
|
column: c.column,
|
|
@@ -6971,7 +6971,7 @@ class je {
|
|
|
6971
6971
|
if (t !== void 0) throw t;
|
|
6972
6972
|
}
|
|
6973
6973
|
}
|
|
6974
|
-
function
|
|
6974
|
+
function De(s, e, t = {}, n = []) {
|
|
6975
6975
|
const i = new je(), o = /* @__PURE__ */ new Set(), a = (h) => [...o].some((u) => u.contains(h)), l = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new WeakMap(), d = (h) => {
|
|
6976
6976
|
const u = h.target;
|
|
6977
6977
|
if (!(u != null && u.closest)) return;
|
|
@@ -7040,7 +7040,7 @@ const po = {
|
|
|
7040
7040
|
treeDataChildrenField: "children",
|
|
7041
7041
|
suppressClickEdit: !1
|
|
7042
7042
|
};
|
|
7043
|
-
class
|
|
7043
|
+
class Vt {
|
|
7044
7044
|
constructor(e, t) {
|
|
7045
7045
|
y(this, "interactions");
|
|
7046
7046
|
y(this, "onInteraction");
|
|
@@ -7109,7 +7109,7 @@ class Gt {
|
|
|
7109
7109
|
var d, c, p, h;
|
|
7110
7110
|
this.eGridDiv = e, this.options = { ...po, ...t }, this.quickFilter = this.options.quickFilterText || "", this.context = this.options.context, this.localeText = es(this.options.localeText), this.eGridDiv.classList.add("ag-grid-root");
|
|
7111
7111
|
const n = this.options.theme || "ag-theme-alpine";
|
|
7112
|
-
this.eGridDiv.classList.add(n), this.eRoot = document.createElement("div"), this.eRoot.className = "ag-root", this.eGridDiv.appendChild(this.eRoot), this.interactions =
|
|
7112
|
+
this.eGridDiv.classList.add(n), this.eRoot = document.createElement("div"), this.eRoot.className = "ag-root", this.eGridDiv.appendChild(this.eRoot), this.interactions = De(this.eRoot, "grid", this.options), this.onInteraction = this.interactions.onInteraction, this.eMain = document.createElement("div"), this.eMain.className = "ag-main", this.eRoot.appendChild(this.eMain), this.eHeader = document.createElement("div"), this.eHeader.className = "ag-header-wrapper", this.eMain.appendChild(this.eHeader), this.rowNodeServices = {
|
|
7113
7113
|
selectNode: (u, f) => this.selectionService.selectNode(u, f),
|
|
7114
7114
|
deselectNode: (u) => this.selectionService.deselectNode(u),
|
|
7115
7115
|
isNodeSelected: (u) => this.selectionService.isNodeSelected(u)
|
|
@@ -7603,7 +7603,7 @@ class Gt {
|
|
|
7603
7603
|
if (l && r) {
|
|
7604
7604
|
const p = r({ data: t.data, node: t, api: this.api }), h = document.createElement("div");
|
|
7605
7605
|
h.style.height = "100%", h.style.padding = "8px 16px", o.appendChild(h), setTimeout(() => {
|
|
7606
|
-
new
|
|
7606
|
+
new Vt(h, {
|
|
7607
7607
|
...l,
|
|
7608
7608
|
rowData: p,
|
|
7609
7609
|
theme: this.options.theme
|
|
@@ -7641,13 +7641,13 @@ class Gt {
|
|
|
7641
7641
|
}
|
|
7642
7642
|
}
|
|
7643
7643
|
function fo(s, e) {
|
|
7644
|
-
const t = new
|
|
7644
|
+
const t = new Vt(s, e);
|
|
7645
7645
|
return { api: t.getApi(), columnApi: t.getColumnApi(), grid: t };
|
|
7646
7646
|
}
|
|
7647
7647
|
function go(s, e = {}) {
|
|
7648
7648
|
const t = document.createElement("dialog");
|
|
7649
7649
|
t.className = "rowvia-detail-dialog";
|
|
7650
|
-
const n =
|
|
7650
|
+
const n = De(t, "detail-dialog", e), i = () => {
|
|
7651
7651
|
var d;
|
|
7652
7652
|
return (d = e.onClose) == null ? void 0 : d.call(e);
|
|
7653
7653
|
};
|
|
@@ -7918,7 +7918,7 @@ function Ze(s) {
|
|
|
7918
7918
|
function He(s) {
|
|
7919
7919
|
return /* @__PURE__ */ new Date(`${s}T00:00:00`);
|
|
7920
7920
|
}
|
|
7921
|
-
function
|
|
7921
|
+
function $e(s, e) {
|
|
7922
7922
|
return new Date(s.getTime() + e * ri);
|
|
7923
7923
|
}
|
|
7924
7924
|
function _e(s, e) {
|
|
@@ -7931,11 +7931,11 @@ function Ct() {
|
|
|
7931
7931
|
function bo(s) {
|
|
7932
7932
|
return s.status !== "done" && s.end && s.end < Ct() && s.progress < 100 ? "delayed" : s.status;
|
|
7933
7933
|
}
|
|
7934
|
-
function
|
|
7934
|
+
function Wt(s) {
|
|
7935
7935
|
const e = He(s);
|
|
7936
7936
|
return `${e.getMonth() + 1}月${e.getDate()}日`;
|
|
7937
7937
|
}
|
|
7938
|
-
const Co = ["day", "week", "biweek", "month", "bimonth", "quarter", "halfyear", "year"],
|
|
7938
|
+
const Co = ["day", "week", "biweek", "month", "bimonth", "quarter", "halfyear", "year"], Ut = {
|
|
7939
7939
|
day: "天",
|
|
7940
7940
|
biweek: "双周",
|
|
7941
7941
|
bimonth: "双月",
|
|
@@ -7947,13 +7947,13 @@ const Co = ["day", "week", "biweek", "month", "bimonth", "quarter", "halfyear",
|
|
|
7947
7947
|
}, So = { day: 26, week: 26, biweek: 26, month: 26, bimonth: 13, quarter: 8.7, halfyear: 4.3, year: 2.2 };
|
|
7948
7948
|
function dn(s) {
|
|
7949
7949
|
const e = (s.getDay() + 6) % 7;
|
|
7950
|
-
return
|
|
7950
|
+
return $e(s, -e);
|
|
7951
7951
|
}
|
|
7952
7952
|
function xo(s, e) {
|
|
7953
7953
|
const t = Math.max(1, _e(s, e) + 1);
|
|
7954
7954
|
let n = 0;
|
|
7955
7955
|
for (let i = 0; i < t; i++) {
|
|
7956
|
-
const o =
|
|
7956
|
+
const o = $e(s, i).getDay();
|
|
7957
7957
|
o !== 0 && o !== 6 && n++;
|
|
7958
7958
|
}
|
|
7959
7959
|
return Math.max(1, n);
|
|
@@ -7966,7 +7966,7 @@ function In(s, e, t) {
|
|
|
7966
7966
|
if (s === "day") {
|
|
7967
7967
|
let r = new Date(e);
|
|
7968
7968
|
for (; r < t; ) {
|
|
7969
|
-
const d =
|
|
7969
|
+
const d = $e(r, 1);
|
|
7970
7970
|
n.push({
|
|
7971
7971
|
start: new Date(r),
|
|
7972
7972
|
end: d,
|
|
@@ -7979,7 +7979,7 @@ function In(s, e, t) {
|
|
|
7979
7979
|
if (s === "week" || s === "biweek") {
|
|
7980
7980
|
let r = dn(e);
|
|
7981
7981
|
for (; r < t; ) {
|
|
7982
|
-
const d =
|
|
7982
|
+
const d = $e(r, s === "biweek" ? 14 : 7);
|
|
7983
7983
|
n.push({
|
|
7984
7984
|
start: new Date(r),
|
|
7985
7985
|
end: d,
|
|
@@ -8111,11 +8111,11 @@ class Mo {
|
|
|
8111
8111
|
const r = this.tasksById.get(l.id);
|
|
8112
8112
|
if (r) {
|
|
8113
8113
|
if (r.kind === "task" && (!r.start || !r.end)) {
|
|
8114
|
-
const d = this.pointAt(e.clientX, e.clientY), c = Math.floor(d.x / this.dayWidth), p = Ze(
|
|
8114
|
+
const d = this.pointAt(e.clientX, e.clientY), c = Math.floor(d.x / this.dayWidth), p = Ze($e(this.epochStart, c));
|
|
8115
8115
|
this.options.onTaskChange({
|
|
8116
8116
|
...r,
|
|
8117
8117
|
start: p,
|
|
8118
|
-
end: Ze(
|
|
8118
|
+
end: Ze($e(He(p), 4)),
|
|
8119
8119
|
progress: 0,
|
|
8120
8120
|
status: "not-started"
|
|
8121
8121
|
}), this.options.onSelect(l.id);
|
|
@@ -8132,7 +8132,7 @@ class Mo {
|
|
|
8132
8132
|
t.moved = !0;
|
|
8133
8133
|
const i = this.dayWidth, o = Math.round((e.clientX - t.startX) / i), a = He(t.originStart), l = He(t.originEnd), r = _e(a, l);
|
|
8134
8134
|
let d, c;
|
|
8135
|
-
t.mode === "resize-l" ? (d =
|
|
8135
|
+
t.mode === "resize-l" ? (d = $e(a, Math.min(o, r)), c = l) : t.mode === "resize-r" ? (d = a, c = $e(l, Math.max(o, -r))) : (d = $e(a, o), c = $e(l, o)), n.milestone && (d = c), t.start = Ze(d), t.end = Ze(c), this.ghost = { id: t.id, start: t.start, end: t.end }, this.markDirty(), this.eTooltip.style.display = "", this.eTooltip.textContent = n.milestone ? Wt(t.start) : `${Wt(t.start)} → ${Wt(t.end)}`;
|
|
8136
8136
|
const p = this.eRoot.getBoundingClientRect();
|
|
8137
8137
|
this.eTooltip.style.left = `${e.clientX - p.left + 12}px`, this.eTooltip.style.top = `${e.clientY - p.top + 16}px`;
|
|
8138
8138
|
});
|
|
@@ -8150,7 +8150,7 @@ class Mo {
|
|
|
8150
8150
|
const t = e.target;
|
|
8151
8151
|
this.ePopup && !this.ePopup.contains(t) && this.closeAssigneePopup(), this.eStepMenu && !this.eStepMenu.contains(t) && !this.eRulerTools.contains(t) && this.closeStepMenu();
|
|
8152
8152
|
});
|
|
8153
|
-
this.options = t, this.eRoot = document.createElement("div"), this.interactions =
|
|
8153
|
+
this.options = t, this.eRoot = document.createElement("div"), this.interactions = De(this.eRoot, "gantt-chart", t), this.onInteraction = this.interactions.onInteraction, this.eRoot.className = "gt-root", e.appendChild(this.eRoot), this.eHeader = document.createElement("div"), this.eHeader.className = "gt-header", this.eRuler = document.createElement("canvas"), this.eRuler.className = "gt-ruler", this.eHeader.appendChild(this.eRuler), this.eRoot.appendChild(this.eHeader), this.rulerCtx = this.eRuler.getContext("2d"), this.buildRulerTools(), this.eScroll = document.createElement("div"), this.eScroll.className = "gt-scroll", this.eSpacer = document.createElement("div"), this.eSpacer.className = "gt-spacer", this.eCanvas = document.createElement("canvas"), this.eCanvas.className = "gt-canvas", this.eScroll.append(this.eSpacer, this.eCanvas), this.eRoot.appendChild(this.eScroll), this.ctx = this.eCanvas.getContext("2d"), this.eTooltip = document.createElement("div"), this.eTooltip.className = "gt-tooltip", this.eTooltip.style.display = "none", this.eRoot.appendChild(this.eTooltip), this.eTodayBadge = document.createElement("div"), this.eTodayBadge.className = "gt-today-badge", this.eRoot.appendChild(this.eTodayBadge), this.eScroll.addEventListener("scroll", this.onScroll), this.eCanvas.addEventListener("mousedown", this.onCanvasMouseDown), this.eCanvas.addEventListener("mousemove", this.onCanvasMouseMove), this.eRoot.addEventListener("mouseleave", this.onRootMouseLeave);
|
|
8154
8154
|
const n = () => {
|
|
8155
8155
|
this.resizeCanvases(), this.markDirty();
|
|
8156
8156
|
};
|
|
@@ -8226,7 +8226,7 @@ class Mo {
|
|
|
8226
8226
|
!o.start || !o.end || ((!e || o.start < e) && (e = o.start), (!t || o.end > t) && (t = o.end));
|
|
8227
8227
|
const n = Ct();
|
|
8228
8228
|
(!e || e > n) && (e = n), (!t || t < n) && (t = n);
|
|
8229
|
-
const i = dn(
|
|
8229
|
+
const i = dn($e(He(e), -7));
|
|
8230
8230
|
this.epochStart = i, this.totalDays = Math.max(_e(i, He(t)) + 730, 1095);
|
|
8231
8231
|
}
|
|
8232
8232
|
dateX(e) {
|
|
@@ -8252,7 +8252,7 @@ class Mo {
|
|
|
8252
8252
|
drawRuler(e, t) {
|
|
8253
8253
|
const n = this.rulerCtx, i = this.eHeader.clientWidth, o = this.eHeader.clientHeight, a = this.eScroll.scrollLeft;
|
|
8254
8254
|
n.clearRect(0, 0, i, o), n.fillStyle = "#fff", n.fillRect(0, 0, i, o);
|
|
8255
|
-
const l =
|
|
8255
|
+
const l = $e(this.epochStart, this.totalDays), r = (p, h, u, f) => {
|
|
8256
8256
|
for (const g of p) {
|
|
8257
8257
|
const v = this.dateX(Ze(g.start)) - a, m = _e(g.start, g.end) * e;
|
|
8258
8258
|
if (v + m <= 0 || v >= i) continue;
|
|
@@ -8267,7 +8267,7 @@ class Mo {
|
|
|
8267
8267
|
n.fillStyle = Le.text, n.font = "11px " + We, n.textAlign = "left", n.textBaseline = "alphabetic", n.fillText(g.primary, b, N), g.secondary && (n.fillStyle = Le.textTertiary, n.font = "10px " + We, n.fillText(g.secondary, b, N + 12));
|
|
8268
8268
|
}
|
|
8269
8269
|
}
|
|
8270
|
-
}, d = 40, c =
|
|
8270
|
+
}, d = 40, c = $e(this.epochStart, Math.floor(a / e));
|
|
8271
8271
|
n.fillStyle = Le.text, n.font = "14px " + We, n.textAlign = "left", n.textBaseline = "middle", n.fillText(this.unit === "day" || this.unit === "week" || this.unit === "biweek" ? `${c.getFullYear()}年${c.getMonth() + 1}月` : `${c.getFullYear()} 年`, 16, 22), r(In(this.unit, this.epochStart, l), d + 1, o - d - 1), n.strokeStyle = Le.border, n.beginPath(), n.moveTo(0, o - 0.5), n.lineTo(i, o - 0.5), n.stroke();
|
|
8272
8272
|
}
|
|
8273
8273
|
drawBody(e, t, n, i) {
|
|
@@ -8287,11 +8287,11 @@ class Mo {
|
|
|
8287
8287
|
let o = dn(this.epochStart);
|
|
8288
8288
|
for (; _e(this.epochStart, o) < this.totalDays; ) {
|
|
8289
8289
|
const a = this.dateX(Ze(o)) + 5 * e;
|
|
8290
|
-
a < t && i.fillRect(Math.max(0, a), 0, e * 2, n), o =
|
|
8290
|
+
a < t && i.fillRect(Math.max(0, a), 0, e * 2, n), o = $e(o, 7);
|
|
8291
8291
|
}
|
|
8292
8292
|
}
|
|
8293
8293
|
drawGridlines(e, t, n) {
|
|
8294
|
-
const i = this.ctx, o =
|
|
8294
|
+
const i = this.ctx, o = $e(this.epochStart, this.totalDays);
|
|
8295
8295
|
for (const a of In(this.unit, this.epochStart, o)) {
|
|
8296
8296
|
const l = Math.round(this.dateX(Ze(a.start))) + 0.5;
|
|
8297
8297
|
if (l < 0 || l > t) continue;
|
|
@@ -8361,7 +8361,7 @@ class Mo {
|
|
|
8361
8361
|
const i = this.ctx, o = ((u = this.ghost) == null ? void 0 : u.id) === e.id ? this.ghost : null, a = (o == null ? void 0 : o.start) ?? e.start, l = (o == null ? void 0 : o.end) ?? e.end, r = this.dateX(a), d = Math.max(28, (_e(a, l) + 1) * this.dayWidth), c = At[e.status];
|
|
8362
8362
|
i.save(), i.globalAlpha = this.selectedId === e.id || this.hoverId === e.id ? 1 : 0.55, i.fillStyle = this.theme === "color" ? "#eaf2ff" : "#fff", i.strokeStyle = this.selectedId === e.id ? Le.accent : "#dee0e3", i.lineWidth = 1, ct(i, r, n, d, qe, 4), i.fill(), i.stroke(), i.save(), ct(i, r, n, d, qe, 4), i.clip(), i.beginPath(), i.arc(r + 14, n + 14, 6, 0, Math.PI * 2), i.fillStyle = c, i.fill(), i.font = "12px " + We, i.textBaseline = "middle", i.textAlign = "left", i.fillStyle = Le.text;
|
|
8363
8363
|
const p = this.options.members.find((f) => f.id === e.owner), h = i.measureText(e.name).width;
|
|
8364
|
-
d > h + 58 ? (i.fillText(e.name, r + 26, n + 14), p &&
|
|
8364
|
+
d > h + 58 ? (i.fillText(e.name, r + 26, n + 14), p && jt(i, r + h + 42, n + 14, 7, $t(p.id), p.name.slice(0, 1))) : p && d > 46 && jt(i, r + 38, n + 14, 7, $t(p.id), p.name.slice(0, 1)), d > 100 && (i.fillStyle = Le.textTertiary, i.textAlign = "right", i.fillText(String(xo(He(a), He(l))), r + d - 8, n + 14)), i.restore(), i.restore(), this.pushHit({ id: e.id, rowIndex: t, kind: "task", x: r, y: n, w: d, h: qe, mode: "move", avatar: p ? { x: r + (d > h + 58 ? h + 42 : 38), y: n + 14, r: 7 } : void 0 });
|
|
8365
8365
|
}
|
|
8366
8366
|
drawSummaryBar(e, t, n) {
|
|
8367
8367
|
if (!e.start || !e.end) return;
|
|
@@ -8379,7 +8379,7 @@ class Mo {
|
|
|
8379
8379
|
let g;
|
|
8380
8380
|
if (e.owner) {
|
|
8381
8381
|
const m = this.options.members.find((w) => w.id === e.owner);
|
|
8382
|
-
m && (
|
|
8382
|
+
m && (jt(i, f + u - 12, n + qe / 2, 9, $t(m.id), m.name.slice(0, 1)), g = { x: f + u - 12, y: n + qe / 2, r: 9 });
|
|
8383
8383
|
}
|
|
8384
8384
|
this.pushHit({ id: e.id, rowIndex: t, kind: "milestone", x: f, y: n, w: u, h: qe, mode: "move", avatar: g });
|
|
8385
8385
|
}
|
|
@@ -8427,7 +8427,7 @@ class Mo {
|
|
|
8427
8427
|
buildRulerTools() {
|
|
8428
8428
|
this.eRulerTools = document.createElement("div"), this.eRulerTools.className = "gt-ruler-tools", this.eHeader.appendChild(this.eRulerTools);
|
|
8429
8429
|
const e = document.createElement("button");
|
|
8430
|
-
e.type = "button", e.className = "gt-ruler-btn gt-ruler-step", this.eStepLabel = document.createElement("span"), this.eStepLabel.className = "gt-ruler-step-label", this.eStepLabel.textContent =
|
|
8430
|
+
e.type = "button", e.className = "gt-ruler-btn gt-ruler-step", this.eStepLabel = document.createElement("span"), this.eStepLabel.className = "gt-ruler-step-label", this.eStepLabel.textContent = Ut[this.unit];
|
|
8431
8431
|
const t = document.createElement("span");
|
|
8432
8432
|
t.className = "gt-ruler-caret", t.textContent = "▾", e.append(this.eStepLabel, t), e.addEventListener("click", (o) => {
|
|
8433
8433
|
o.stopPropagation(), this.toggleStepMenu();
|
|
@@ -8465,7 +8465,7 @@ class Mo {
|
|
|
8465
8465
|
const o = document.createElement("div");
|
|
8466
8466
|
o.className = "gt-step-item", o.setAttribute("role", "menuitemradio"), o.setAttribute("aria-checked", String(i === this.unit)), o.tabIndex = 0, o.addEventListener("keydown", (a) => {
|
|
8467
8467
|
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), this.setUnit(i), this.closeStepMenu());
|
|
8468
|
-
}), i === this.unit && o.classList.add("gt-step-item-active"), o.textContent =
|
|
8468
|
+
}), i === this.unit && o.classList.add("gt-step-item-active"), o.textContent = Ut[i], o.addEventListener("click", (a) => {
|
|
8469
8469
|
a.stopPropagation(), this.setUnit(i), this.closeStepMenu();
|
|
8470
8470
|
}), e.appendChild(o);
|
|
8471
8471
|
}
|
|
@@ -8477,7 +8477,7 @@ class Mo {
|
|
|
8477
8477
|
(e = this.eStepMenu) == null || e.remove(), this.eStepMenu = null, document.removeEventListener("mousedown", this.onDocumentMouseDown);
|
|
8478
8478
|
}
|
|
8479
8479
|
updateRulerTools() {
|
|
8480
|
-
this.eStepLabel.textContent =
|
|
8480
|
+
this.eStepLabel.textContent = Ut[this.unit], this.eZoomValue.textContent = `${Math.round(this.zoom * 100)}%`;
|
|
8481
8481
|
}
|
|
8482
8482
|
// ---- assignee popup ----
|
|
8483
8483
|
openAssigneePopup(e, t) {
|
|
@@ -8519,7 +8519,7 @@ function ct(s, e, t, n, i, o) {
|
|
|
8519
8519
|
const r = Math.max(0, Math.min(o, a / 2, l / 2));
|
|
8520
8520
|
s.beginPath(), s.moveTo(e + r, t), s.lineTo(e + a - r, t), s.arcTo(e + a, t, e + a, t + r, r), s.lineTo(e + a, t + l - r), s.arcTo(e + a, t + l, e + a - r, t + l, r), s.lineTo(e + r, t + l), s.arcTo(e, t + l, e, t + l - r, r), s.lineTo(e, t + r), s.arcTo(e, t, e + r, t, r), s.closePath();
|
|
8521
8521
|
}
|
|
8522
|
-
function
|
|
8522
|
+
function jt(s, e, t, n, i, o) {
|
|
8523
8523
|
s.beginPath(), s.arc(e, t, n, 0, Math.PI * 2), s.fillStyle = i, s.fill(), s.lineWidth = 1.5, s.strokeStyle = "#fff", s.stroke(), s.fillStyle = "#fff", s.font = `10px ${We}`, s.textAlign = "center", s.textBaseline = "middle", s.fillText(o, e, t + 1);
|
|
8524
8524
|
}
|
|
8525
8525
|
function Ro(s, e, t) {
|
|
@@ -8650,7 +8650,7 @@ function Qa(s, e) {
|
|
|
8650
8650
|
<div class="gantt-status" aria-live="polite"></div>
|
|
8651
8651
|
<div class="gt-settings" hidden><div class="gt-settings-title">甘特条样式</div><label><input type="checkbox" data-setting="children" checked>甘特条显示子节点</label><label class="gt-indented"><input type="radio" name="nodes" value="all" checked>显示全部节点</label><label class="gt-indented"><input type="radio" name="nodes" value="milestones">显示里程碑节点</label><div class="gt-theme-options"><label><input type="radio" name="theme" value="content" checked>内容优先</label><label><input type="radio" name="theme" value="color">颜色优先</label></div></div>
|
|
8652
8652
|
</div>`, s.append(t);
|
|
8653
|
-
const n =
|
|
8653
|
+
const n = De(t, "gantt", e), i = e.onTaskOpen ? null : go(t), o = (R) => t.querySelector(R);
|
|
8654
8654
|
o(".gantt-title-name").textContent = e.title ?? "甘特图";
|
|
8655
8655
|
let a = structuredClone(e.tasks), l = new Map(a.map((R) => [R.id, R])), r = null, d, c = !0, p = !1;
|
|
8656
8656
|
const h = o(".gantt-left");
|
|
@@ -8720,7 +8720,7 @@ function Qa(s, e) {
|
|
|
8720
8720
|
field: R,
|
|
8721
8721
|
hide: !0,
|
|
8722
8722
|
filter: !0
|
|
8723
|
-
})), I = new
|
|
8723
|
+
})), I = new Vt(o(".grid"), {
|
|
8724
8724
|
columnDefs: N,
|
|
8725
8725
|
rowData: a,
|
|
8726
8726
|
treeData: !0,
|
|
@@ -8901,7 +8901,7 @@ function Ho(s, e) {
|
|
|
8901
8901
|
<div class="rowvia-nf-canvas-surface" data-surface></div>
|
|
8902
8902
|
</div>
|
|
8903
8903
|
</div>`, s.append(t);
|
|
8904
|
-
const i =
|
|
8904
|
+
const i = De(t, "flow-canvas", e), o = t.querySelector("[data-viewport]"), a = t.querySelector("[data-sizer]"), l = t.querySelector("[data-surface]"), r = t.querySelector("[data-zoom]"), d = t.querySelector("[data-legend]");
|
|
8905
8905
|
let c = e.flow, p = e.selectedNodeId, h = e.query ?? "", u = 1;
|
|
8906
8906
|
const f = (E, T, A) => {
|
|
8907
8907
|
if (E.hiddenReason)
|
|
@@ -9086,7 +9086,7 @@ function zo(s) {
|
|
|
9086
9086
|
function _o(s, e) {
|
|
9087
9087
|
const t = document.createElement("div"), n = new je();
|
|
9088
9088
|
t.className = "rowvia-nf-card", s.append(t);
|
|
9089
|
-
const i =
|
|
9089
|
+
const i = De(t, "node-card", e);
|
|
9090
9090
|
let o = e.node ?? null, a = { ...e }, l = !1;
|
|
9091
9091
|
const r = () => {
|
|
9092
9092
|
var E;
|
|
@@ -9179,7 +9179,7 @@ function Wo(s, e) {
|
|
|
9179
9179
|
function Uo(s, e) {
|
|
9180
9180
|
const t = document.createElement("div"), n = new je();
|
|
9181
9181
|
t.className = "rowvia-nf-contextbar", s.append(t);
|
|
9182
|
-
const i =
|
|
9182
|
+
const i = De(t, "flow-context", e);
|
|
9183
9183
|
let o = e.flow, a = e.query ?? "", l = !1;
|
|
9184
9184
|
const r = () => {
|
|
9185
9185
|
const c = Ao(o), p = !!(o.templateVersion && o.latestTemplateVersion && o.templateVersion !== o.latestTemplateVersion);
|
|
@@ -9240,7 +9240,7 @@ function Uo(s, e) {
|
|
|
9240
9240
|
function jo(s, e) {
|
|
9241
9241
|
const t = document.createElement("div");
|
|
9242
9242
|
t.className = "rowvia-nf-timeline", s.append(t);
|
|
9243
|
-
const n =
|
|
9243
|
+
const n = De(t, "node-timeline", e);
|
|
9244
9244
|
let i = e.flow, o = e.selectedNodeId, a = "timeline", l = "all", r = null;
|
|
9245
9245
|
const d = [
|
|
9246
9246
|
{ key: "all", label: "全部状态" },
|
|
@@ -9316,7 +9316,7 @@ function Ja(s, e) {
|
|
|
9316
9316
|
}
|
|
9317
9317
|
const r = document.createElement("div");
|
|
9318
9318
|
r.className = "rowvia-nf-body", r.innerHTML = '<div data-region="context"></div><div data-region="canvas"></div><div data-region="card"></div><div data-region="timeline"></div><aside class="rowvia-nf-rules" data-region="rules" hidden></aside>', l.append(r), s.append(l);
|
|
9319
|
-
const d =
|
|
9319
|
+
const d = De(l, "node-flow", e), c = (E) => r.querySelector('[data-region="' + E + '"]'), p = (E) => t.nodes.find((T) => T.id === E) ?? null, h = Uo(c("context"), {
|
|
9320
9320
|
flow: t,
|
|
9321
9321
|
query: i,
|
|
9322
9322
|
onQuery: (E) => {
|
|
@@ -9411,11 +9411,11 @@ function Ja(s, e) {
|
|
|
9411
9411
|
};
|
|
9412
9412
|
}
|
|
9413
9413
|
const Xo = (s, e, t = {}) => ({ id: s, name: e, ...t });
|
|
9414
|
-
function
|
|
9414
|
+
function Fe(s) {
|
|
9415
9415
|
return { groupId: "g1", completionMode: "and", ...s };
|
|
9416
9416
|
}
|
|
9417
9417
|
function er() {
|
|
9418
|
-
const s = (t, n, i) =>
|
|
9418
|
+
const s = (t, n, i) => Fe({
|
|
9419
9419
|
id: t,
|
|
9420
9420
|
name: n,
|
|
9421
9421
|
status: "pending",
|
|
@@ -9425,7 +9425,7 @@ function er() {
|
|
|
9425
9425
|
schedule: "09-02 ~ 09-06",
|
|
9426
9426
|
estimate: "2d"
|
|
9427
9427
|
}), e = [
|
|
9428
|
-
|
|
9428
|
+
Fe({
|
|
9429
9429
|
id: "n-start",
|
|
9430
9430
|
name: "开始",
|
|
9431
9431
|
status: "done",
|
|
@@ -9436,7 +9436,7 @@ function er() {
|
|
|
9436
9436
|
conclusion: "通过",
|
|
9437
9437
|
events: [{ trigger: "arrive", text: "需求状态 → 选题" }]
|
|
9438
9438
|
}),
|
|
9439
|
-
|
|
9439
|
+
Fe({
|
|
9440
9440
|
id: "n-meeting",
|
|
9441
9441
|
name: "选题会",
|
|
9442
9442
|
status: "inProgress",
|
|
@@ -9471,7 +9471,7 @@ function er() {
|
|
|
9471
9471
|
actionRoles: ["节点负责人", "管理员"],
|
|
9472
9472
|
deleteRoles: ["管理员"]
|
|
9473
9473
|
}),
|
|
9474
|
-
|
|
9474
|
+
Fe({
|
|
9475
9475
|
id: "n-topic",
|
|
9476
9476
|
name: "确定选题",
|
|
9477
9477
|
status: "pending",
|
|
@@ -9483,7 +9483,7 @@ function er() {
|
|
|
9483
9483
|
progressMode: "手动填写",
|
|
9484
9484
|
predecessors: ["选题会"]
|
|
9485
9485
|
}),
|
|
9486
|
-
|
|
9486
|
+
Fe({
|
|
9487
9487
|
id: "n-ads",
|
|
9488
9488
|
name: "广告植入",
|
|
9489
9489
|
status: "pending",
|
|
@@ -9492,8 +9492,8 @@ function er() {
|
|
|
9492
9492
|
estimate: "1d",
|
|
9493
9493
|
predecessors: ["确定选题"]
|
|
9494
9494
|
}),
|
|
9495
|
-
|
|
9496
|
-
|
|
9495
|
+
Fe({ id: "n-script", name: "脚本制作", status: "pending", groupId: "g2", owner: "周野", schedule: "08-18 ~ 08-20", estimate: "3d" }),
|
|
9496
|
+
Fe({
|
|
9497
9497
|
id: "n-review",
|
|
9498
9498
|
name: "脚本评审",
|
|
9499
9499
|
status: "pending",
|
|
@@ -9505,7 +9505,7 @@ function er() {
|
|
|
9505
9505
|
conclusionOptions: ["通过", "不通过"],
|
|
9506
9506
|
events: [{ trigger: "complete", text: "「脚本状态」字段 → 已评审" }]
|
|
9507
9507
|
}),
|
|
9508
|
-
|
|
9508
|
+
Fe({ id: "n-plan", name: "制定计划表", status: "pending", groupId: "g3", owner: "制片人", schedule: "08-22 ~ 08-23", estimate: "2d" }),
|
|
9509
9509
|
s("n-shoot", "拍摄", "导演组"),
|
|
9510
9510
|
s("n-edit", "剪辑", "剪辑师"),
|
|
9511
9511
|
s("n-art", "美术", "美术组"),
|
|
@@ -9515,7 +9515,7 @@ function er() {
|
|
|
9515
9515
|
s("n-color", "调色", "调色师"),
|
|
9516
9516
|
s("n-mix", "混音", "混音师"),
|
|
9517
9517
|
s("n-cover", "封面", "设计师"),
|
|
9518
|
-
|
|
9518
|
+
Fe({
|
|
9519
9519
|
id: "n-final",
|
|
9520
9520
|
name: "成片",
|
|
9521
9521
|
status: "pending",
|
|
@@ -9527,7 +9527,7 @@ function er() {
|
|
|
9527
9527
|
estimate: "0d",
|
|
9528
9528
|
predecessors: ["全部并行节点"]
|
|
9529
9529
|
}),
|
|
9530
|
-
|
|
9530
|
+
Fe({
|
|
9531
9531
|
id: "n-final-review",
|
|
9532
9532
|
name: "成片评审会",
|
|
9533
9533
|
status: "pending",
|
|
@@ -9561,8 +9561,8 @@ function er() {
|
|
|
9561
9561
|
],
|
|
9562
9562
|
events: [{ trigger: "complete", text: "需求状态 → 待发布" }]
|
|
9563
9563
|
}),
|
|
9564
|
-
|
|
9565
|
-
|
|
9564
|
+
Fe({ id: "n-publish", name: "发布", status: "pending", groupId: "g5", owner: "运营", schedule: "09-10", estimate: "1d" }),
|
|
9565
|
+
Fe({
|
|
9566
9566
|
id: "n-monitor",
|
|
9567
9567
|
name: "数据监控",
|
|
9568
9568
|
status: "pending",
|
|
@@ -9575,7 +9575,7 @@ function er() {
|
|
|
9575
9575
|
progressMode: "同步自计算字段",
|
|
9576
9576
|
delayed: !1
|
|
9577
9577
|
}),
|
|
9578
|
-
|
|
9578
|
+
Fe({
|
|
9579
9579
|
id: "n-retro",
|
|
9580
9580
|
name: "项目复盘",
|
|
9581
9581
|
status: "pending",
|
|
@@ -9586,7 +9586,7 @@ function er() {
|
|
|
9586
9586
|
delayed: !0,
|
|
9587
9587
|
info: "09-18"
|
|
9588
9588
|
}),
|
|
9589
|
-
|
|
9589
|
+
Fe({ id: "n-end", name: "结束", status: "pending", groupId: "g6", owner: "系统", estimate: "0d" })
|
|
9590
9590
|
];
|
|
9591
9591
|
for (const t of e)
|
|
9592
9592
|
t.info || (t.info = t.schedule ? t.schedule.split(" ~ ")[0] : "");
|
|
@@ -9609,7 +9609,7 @@ function er() {
|
|
|
9609
9609
|
};
|
|
9610
9610
|
}
|
|
9611
9611
|
const Ie = (s) => Date.parse(`${s}T00:00:00Z`) / 864e5, Oe = (s) => new Date(s * 864e5).toISOString().slice(0, 10), On = (s) => /^\d{4}-\d{2}-\d{2}$/.test(s) && Number.isFinite(Ie(s)) && Oe(Ie(s)) === s, hn = (s) => !!s.start && !!s.end;
|
|
9612
|
-
function
|
|
9612
|
+
function Kt(s, e) {
|
|
9613
9613
|
const t = new Set(s.map((n) => n.id));
|
|
9614
9614
|
if (t.size !== s.length || new Set(e.map((n) => n.id)).size !== e.length) throw new Error("Duplicate schedule ID");
|
|
9615
9615
|
for (const n of e) {
|
|
@@ -9693,7 +9693,7 @@ function Qo(s, e) {
|
|
|
9693
9693
|
C(".ps-total").textContent = `ⓘ 总人数 ${R.length} 总估分 ${Bn(M).estimate.toFixed(2)} pd ···`;
|
|
9694
9694
|
}
|
|
9695
9695
|
function tr(s, e) {
|
|
9696
|
-
|
|
9696
|
+
Kt(e.people, e.items);
|
|
9697
9697
|
let t = structuredClone(e.people), n = structuredClone(e.items);
|
|
9698
9698
|
const i = e.today ?? (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
9699
9699
|
let o = new Set(t.map((W) => W.id)), a = !1, l = "", r = "", d = "", c = !1, p = 1, h = !1, u = !1, f = !1, g = !0, v = Ie(i) - (/* @__PURE__ */ new Date(`${i}T00:00:00Z`)).getUTCDay(), m = 90, w = `${i.slice(0, 7)}-01`, k = Oe(Date.UTC(Number(i.slice(0, 4)), Number(i.slice(5, 7)) + 1, 0) / 864e5), C = !1, b = !1;
|
|
@@ -9702,7 +9702,7 @@ function tr(s, e) {
|
|
|
9702
9702
|
<div class="ps-toolbar"><button class="ps-tint" data-action="people">◎ 人员筛选</button><button class="ps-tint" data-action="filter">▽ 筛选 · ${F(e.workItemLabel ?? "工作项")}</button><button data-action="sort">☷ 人员排序</button><span class="ps-space"></span><button class="ps-round" data-action="minus" aria-label="缩小">−</button><input class="ps-zoom" type="range" min="0" max="4" step="1" value="1" aria-label="时间缩放"><button class="ps-round" data-action="plus" aria-label="放大">+</button><button class="ps-save" data-action="save">▣ 存为视图</button><button data-action="settings" aria-label="显示设置">⚙</button></div>
|
|
9703
9703
|
<div class="ps-scroll"><div class="ps-table"><div class="ps-time-header"><div class="ps-date-nav"><button data-action="date" class="ps-date-label"></button><button data-action="prev" aria-label="上一时间段">‹</button><button data-action="today" aria-label="回到今天">•</button><button data-action="next" aria-label="下一时间段">›</button></div><div class="ps-weeks"></div></div><div class="ps-rows"></div></div></div>
|
|
9704
9704
|
<footer class="ps-total"></footer><div class="ps-popover" hidden></div><aside class="ps-detail" hidden></aside><div class="ps-toast" role="status" hidden></div>`, s.append(N);
|
|
9705
|
-
const I =
|
|
9705
|
+
const I = De(N, "personnel", e), x = (W) => N.querySelector(W), G = x(".ps-scroll"), E = x(".ps-rows"), T = x(".ps-popover"), A = x(".ps-detail"), H = new AbortController(), q = H.signal;
|
|
9706
9706
|
let R;
|
|
9707
9707
|
const P = () => [22, 43, 64, 86, 120][p];
|
|
9708
9708
|
function L(W) {
|
|
@@ -9731,7 +9731,7 @@ function tr(s, e) {
|
|
|
9731
9731
|
else if (W === "save") T.innerHTML = '<div class="ps-panel-title">存为视图</div><input data-view-name placeholder="视图名称" aria-label="视图名称"><button class="ps-primary" data-action="save-view">保存</button>';
|
|
9732
9732
|
else if (W === "views") {
|
|
9733
9733
|
const V = ie();
|
|
9734
|
-
T.innerHTML = `<div class="ps-panel-title">视图列表</div>${V.length ? V.map((se,
|
|
9734
|
+
T.innerHTML = `<div class="ps-panel-title">视图列表</div>${V.length ? V.map((se, de) => `<button class="ps-view" data-view="${de}">▦ ${F(se.name)}</button>`).join("") : "<p>暂无保存的视图</p>"}`;
|
|
9735
9735
|
}
|
|
9736
9736
|
}
|
|
9737
9737
|
let z = /* @__PURE__ */ new Date(`${w}T00:00:00Z`), j = !1;
|
|
@@ -9769,7 +9769,7 @@ function tr(s, e) {
|
|
|
9769
9769
|
var V;
|
|
9770
9770
|
if (!n.some((se) => se.id === W)) throw new Error(`Unknown schedule item: ${W}`);
|
|
9771
9771
|
const oe = n.map((se) => se.id === W ? { ...se, ...Z } : se);
|
|
9772
|
-
|
|
9772
|
+
Kt(t, oe), n = oe, M();
|
|
9773
9773
|
const S = n.find((se) => se.id === W);
|
|
9774
9774
|
S && ((V = e.onItemChange) == null || V.call(e, structuredClone(S)));
|
|
9775
9775
|
}
|
|
@@ -9808,13 +9808,13 @@ function tr(s, e) {
|
|
|
9808
9808
|
return;
|
|
9809
9809
|
}
|
|
9810
9810
|
if (oe.dataset.preset) {
|
|
9811
|
-
const V = Number(oe.dataset.preset), se = Ie(i),
|
|
9812
|
-
w = Oe(V < 2 ? se -
|
|
9811
|
+
const V = Number(oe.dataset.preset), se = Ie(i), de = new Date(se * 864e5);
|
|
9812
|
+
w = Oe(V < 2 ? se - de.getUTCDay() : V < 4 ? Date.UTC(de.getUTCFullYear(), de.getUTCMonth(), 1) / 864e5 : se), k = Oe(V === 2 || V === 3 ? Date.UTC(de.getUTCFullYear(), de.getUTCMonth() + (V === 2 ? 1 : 2), 0) / 864e5 : Ie(w) + [6, 13, 29, 60, 13, 59, 364][V]), j = !1, pe(), T.hidden = !0;
|
|
9813
9813
|
return;
|
|
9814
9814
|
}
|
|
9815
9815
|
if (oe.dataset.view) {
|
|
9816
9816
|
const V = ie()[Number(oe.dataset.view)];
|
|
9817
|
-
V && (o = new Set(V.selected.filter((se) => t.some((
|
|
9817
|
+
V && (o = new Set(V.selected.filter((se) => t.some((de) => de.id === se))), { query: l, status: r, sort: d, descending: c, zoom: p, from: v, days: m, rangeStart: w, rangeEnd: k, expanded: h, children: u, loose: f, colorFirst: g, onlyScheduled: a } = V, M(), fe(), T.hidden = !0, L(`已打开 ${V.name}`));
|
|
9818
9818
|
return;
|
|
9819
9819
|
}
|
|
9820
9820
|
const S = oe.dataset.action;
|
|
@@ -9903,7 +9903,7 @@ function tr(s, e) {
|
|
|
9903
9903
|
const W = X;
|
|
9904
9904
|
X = null, b && (ge(W.id, { start: Oe(W.start + (W.edge === "end" ? 0 : W.delta)), end: Oe(W.end + (W.edge === "start" ? 0 : W.delta)) }), L("排期已更新"));
|
|
9905
9905
|
}, { signal: q }), e.initialRange ? ye(e.initialRange) : M(), { setRange: ye, onInteraction: I.onInteraction, setData(W, Z) {
|
|
9906
|
-
|
|
9906
|
+
Kt(W, Z), t = structuredClone(W), n = structuredClone(Z), o = new Set(t.map((oe) => oe.id)), T.hidden = !0, A.hidden = !0, M();
|
|
9907
9907
|
}, getItems: () => structuredClone(n), updateItem: ge, setPeople(W) {
|
|
9908
9908
|
o = new Set(W.filter((Z) => t.some((oe) => oe.id === Z))), M();
|
|
9909
9909
|
}, destroy() {
|
|
@@ -10000,7 +10000,7 @@ function ta(s) {
|
|
|
10000
10000
|
});
|
|
10001
10001
|
return { nodes: i, paths: a, width: n + 16 };
|
|
10002
10002
|
}
|
|
10003
|
-
const
|
|
10003
|
+
const Pe = (s) => `<svg class="wf-icon" viewBox="0 0 16 16" aria-hidden="true">${{
|
|
10004
10004
|
caret: '<path d="M13.706 6.437 8.503 12.421a.667.667 0 0 1-1.006 0L2.293 6.437a.667.667 0 0 1 .503-1.104h10.407a.667.667 0 0 1 .503 1.104Z" fill="currentColor"/>',
|
|
10005
10005
|
chevron: '<path d="m4 6 4 4 4-4" fill="none" stroke="currentColor" stroke-width="1.5"/>',
|
|
10006
10006
|
more: '<g fill="currentColor"><circle cx="3" cy="8" r="1.5"/><circle cx="8" cy="8" r="1.5"/><circle cx="13" cy="8" r="1.5"/></g>',
|
|
@@ -10009,26 +10009,26 @@ const $e = (s) => `<svg class="wf-icon" viewBox="0 0 16 16" aria-hidden="true">$
|
|
|
10009
10009
|
list: '<path d="M6 4h8M6 8h8M6 12h8M2 4h1M2 8h1M2 12h1" stroke="currentColor" stroke-width="1.4"/>',
|
|
10010
10010
|
detail: '<rect x="2" y="2" width="12" height="12" rx="2" fill="none" stroke="currentColor"/><path d="M5 6h6M5 9h6" stroke="currentColor"/>',
|
|
10011
10011
|
plus: '<path d="M8 2v12M2 8h12" stroke="currentColor" stroke-width="1.5"/>'
|
|
10012
|
-
}[s]}</svg>`,
|
|
10012
|
+
}[s]}</svg>`, Yt = { pending: "未开始", inProgress: "进行中", done: "已完成", failed: "未通过" }, qn = { estimate: "填写估分", "group-chat": "节点建群", "delete-node": "删除节点" };
|
|
10013
10013
|
function nr(s) {
|
|
10014
|
-
var
|
|
10014
|
+
var de, xe;
|
|
10015
10015
|
let e = { ...s }, t = s.flow, n = t.detail, i = !1, o = !1, a = 0;
|
|
10016
10016
|
const l = /* @__PURE__ */ new Map(), r = document.createElement("section");
|
|
10017
10017
|
r.className = "workitem-module-detail-workflow rv-workflow-detail", r.dataset.module = "detail:workflow";
|
|
10018
10018
|
const d = document.createElement("section");
|
|
10019
10019
|
d.className = "workflow-node-details rv-workflow-detail", d.dataset.module = "detail:tabs:schedule";
|
|
10020
10020
|
const c = new AbortController();
|
|
10021
|
-
let p = s.selectedNodeId ?? ((
|
|
10021
|
+
let p = s.selectedNodeId ?? ((de = t.nodes.find((D) => D.status === "inProgress")) == null ? void 0 : de.id) ?? ((xe = t.nodes[0]) == null ? void 0 : xe.id) ?? "";
|
|
10022
10022
|
const h = /* @__PURE__ */ new Set([p]);
|
|
10023
10023
|
let u = "details", f = "", g = 1;
|
|
10024
10024
|
const v = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set(), k = /* @__PURE__ */ new Map(), C = (D) => t.nodes.find((B) => B.id === D), b = (D) => {
|
|
10025
|
-
var B, _,
|
|
10026
|
-
return ((
|
|
10027
|
-
}, N = (D) => `<i class="wf-dot ${D.status}" aria-hidden="true"></i>`, I = (D) => `${N(D)}<strong>${F(D.name)}</strong><span class="wf-status ${D.status}">${
|
|
10025
|
+
var B, _, K;
|
|
10026
|
+
return ((K = (_ = (B = e.context) == null ? void 0 : B.people) == null ? void 0 : _.find((Y) => Y.id === D)) == null ? void 0 : K.name) ?? D ?? "";
|
|
10027
|
+
}, N = (D) => `<i class="wf-dot ${D.status}" aria-hidden="true"></i>`, I = (D) => `${N(D)}<strong>${F(D.name)}</strong><span class="wf-status ${D.status}">${Yt[D.status]}</span>`, x = () => Jo(t);
|
|
10028
10028
|
function G(D, B, _) {
|
|
10029
|
-
var
|
|
10030
|
-
const
|
|
10031
|
-
return !i && !o && !e.readonly && !!
|
|
10029
|
+
var Y;
|
|
10030
|
+
const K = e.onCommand || (D === "configure" ? e.onFlowChange : D === "action" ? e.onAction : D === "create-task" ? e.onCreateTask || e.onChange : D === "delete" ? e.onDelete : D === "complete" && e.onComplete || e.onChange);
|
|
10031
|
+
return !i && !o && !e.readonly && !!K && ((Y = e.can) == null ? void 0 : Y.call(e, D, B, _)) !== !1;
|
|
10032
10032
|
}
|
|
10033
10033
|
function E(D) {
|
|
10034
10034
|
var B;
|
|
@@ -10043,13 +10043,13 @@ function nr(s) {
|
|
|
10043
10043
|
return "edit";
|
|
10044
10044
|
}
|
|
10045
10045
|
function T(D) {
|
|
10046
|
-
var _,
|
|
10046
|
+
var _, K, Y, J;
|
|
10047
10047
|
const B = { flow: t, signal: c.signal };
|
|
10048
|
-
return e.onCommand ? e.onCommand(D, B) : D.type === "delete-node" ? (_ = e.onDelete) == null ? void 0 : _.call(e, D.nodeId, B) : D.type === "update-flow" ? (
|
|
10048
|
+
return e.onCommand ? e.onCommand(D, B) : D.type === "delete-node" ? (_ = e.onDelete) == null ? void 0 : _.call(e, D.nodeId, B) : D.type === "update-flow" ? (K = e.onFlowChange) == null ? void 0 : K.call(e, D.detail, B) : D.type === "action" ? D.actionId === "__create-task" && e.onCreateTask ? e.onCreateTask(D.nodeId, B) : (Y = e.onAction) == null ? void 0 : Y.call(e, D.nodeId, D.actionId, B) : D.patch.status === "done" && e.onComplete ? e.onComplete(D.nodeId, B) : (J = e.onChange) == null ? void 0 : J.call(e, D.nodeId, D.patch, D.detail, B);
|
|
10049
10049
|
}
|
|
10050
10050
|
async function A(D) {
|
|
10051
10051
|
var ne;
|
|
10052
|
-
const B = "nodeId" in D ? C(D.nodeId) : void 0, _ = D.type === "action" ? D.actionId : D.type === "update-node" ? Object.keys(D.patch)[0] : void 0,
|
|
10052
|
+
const B = "nodeId" in D ? C(D.nodeId) : void 0, _ = D.type === "action" ? D.actionId : D.type === "update-node" ? Object.keys(D.patch)[0] : void 0, K = D.type !== "update-node" || Object.keys(D.patch).every((Q) => G(E({ ...D, patch: { [Q]: D.patch[Q] } }), B, Q)), Y = D.type !== "update-node" || [
|
|
10053
10053
|
...(D.patch.form ?? []).filter((Q) => {
|
|
10054
10054
|
var te, ue;
|
|
10055
10055
|
return Q.value !== ((ue = (te = B == null ? void 0 : B.form) == null ? void 0 : te.find((he) => he.id === Q.id)) == null ? void 0 : ue.value);
|
|
@@ -10062,20 +10062,20 @@ function nr(s) {
|
|
|
10062
10062
|
var te, ue, he;
|
|
10063
10063
|
return ((te = e.can) == null ? void 0 : te.call(e, "edit", B, Q.id)) !== !1 && !((he = (ue = B == null ? void 0 : B.fields) == null ? void 0 : ue.find((be) => be.id === Q.id)) != null && he.readonly);
|
|
10064
10064
|
});
|
|
10065
|
-
if (!G(E(D), B, _) || !
|
|
10065
|
+
if (!G(E(D), B, _) || !K || !Y || D.type === "delete-node" && B && !x().node(B).deletable)
|
|
10066
10066
|
return i || Se(), !1;
|
|
10067
10067
|
const J = a;
|
|
10068
10068
|
o = !0, r.querySelectorAll(".wf-error").forEach((Q) => Q.remove()), P(r), P(d);
|
|
10069
|
-
let
|
|
10069
|
+
let ae, re = !1;
|
|
10070
10070
|
try {
|
|
10071
10071
|
const Q = T(D), te = Q instanceof Promise ? await Q : Q;
|
|
10072
10072
|
return i ? !1 : (te && a === J && (t = te, n = te.detail, a++), !0);
|
|
10073
10073
|
} catch (Q) {
|
|
10074
|
-
return
|
|
10074
|
+
return ae = Q, re = !0, !1;
|
|
10075
10075
|
} finally {
|
|
10076
|
-
if (o = !1, !i && (Se(),
|
|
10076
|
+
if (o = !1, !i && (Se(), re)) {
|
|
10077
10077
|
const Q = document.createElement("p");
|
|
10078
|
-
Q.className = "wf-error", Q.role = "alert", Q.textContent =
|
|
10078
|
+
Q.className = "wf-error", Q.role = "alert", Q.textContent = ae instanceof Error ? ae.message : "保存失败,请重试", r.querySelector(".wf-card-area").prepend(Q), (ne = e.onError) == null || ne.call(e, ae, D);
|
|
10079
10079
|
}
|
|
10080
10080
|
}
|
|
10081
10081
|
}
|
|
@@ -10091,8 +10091,8 @@ function nr(s) {
|
|
|
10091
10091
|
pending: o,
|
|
10092
10092
|
signal: c.signal,
|
|
10093
10093
|
context: e.context ?? { currentUser: e.currentUser, workItems: e.workItems },
|
|
10094
|
-
can: (_,
|
|
10095
|
-
commit: (_,
|
|
10094
|
+
can: (_, K) => G(_, D, K),
|
|
10095
|
+
commit: (_, K = "更新节点字段") => U(D, _, K),
|
|
10096
10096
|
action: (_) => A({ type: "action", nodeId: D.id, actionId: _ })
|
|
10097
10097
|
};
|
|
10098
10098
|
}
|
|
@@ -10100,23 +10100,23 @@ function nr(s) {
|
|
|
10100
10100
|
const B = [];
|
|
10101
10101
|
l.set(D, B), D.querySelectorAll("[data-node]").forEach((_) => {
|
|
10102
10102
|
var ne, Q;
|
|
10103
|
-
const
|
|
10104
|
-
if (!
|
|
10105
|
-
const
|
|
10103
|
+
const K = C(_.dataset.node);
|
|
10104
|
+
if (!K) return;
|
|
10105
|
+
const Y = q(K, D);
|
|
10106
10106
|
e.renderTaskField && _.querySelectorAll("[data-task-cell]").forEach((te) => {
|
|
10107
10107
|
var Ee, me;
|
|
10108
|
-
const ue = (Ee =
|
|
10108
|
+
const ue = (Ee = K.tasks) == null ? void 0 : Ee.find((Te) => Te.id === te.dataset.taskCell), he = (me = e.taskColumns) == null ? void 0 : me.call(e, K).find((Te) => Te.key === te.dataset.taskColumn);
|
|
10109
10109
|
if (!ue || !he) return;
|
|
10110
|
-
const be = e.renderTaskField(te, ue, he,
|
|
10110
|
+
const be = e.renderTaskField(te, ue, he, Y);
|
|
10111
10111
|
be && B.push(be);
|
|
10112
10112
|
}), e.renderTaskActions && _.querySelectorAll("[data-task-actions]").forEach((te) => {
|
|
10113
10113
|
var be;
|
|
10114
|
-
const ue = (be =
|
|
10114
|
+
const ue = (be = K.tasks) == null ? void 0 : be.find((Ee) => Ee.id === te.dataset.taskActions);
|
|
10115
10115
|
if (!ue) return;
|
|
10116
|
-
const he = e.renderTaskActions(te, ue,
|
|
10116
|
+
const he = e.renderTaskActions(te, ue, Y);
|
|
10117
10117
|
he && B.push(he);
|
|
10118
10118
|
});
|
|
10119
|
-
const J = (D === r ? "selected:" : "list:") +
|
|
10119
|
+
const J = (D === r ? "selected:" : "list:") + K.id;
|
|
10120
10120
|
if (m.has(J)) {
|
|
10121
10121
|
const te = _.querySelector(".wf-card-body"), ue = _.querySelector(".wf-node-schedule");
|
|
10122
10122
|
te && (te.hidden = !0), ue && (ue.hidden = !0), (ne = _.querySelector('[data-wf="collapse-card"]')) == null || ne.setAttribute("aria-expanded", "false");
|
|
@@ -10125,32 +10125,32 @@ function nr(s) {
|
|
|
10125
10125
|
const te = _.querySelector(".wf-task-table");
|
|
10126
10126
|
te && (te.hidden = !0), (Q = _.querySelector('[data-wf="toggle-tasks"]')) == null || Q.setAttribute("aria-expanded", "false");
|
|
10127
10127
|
}
|
|
10128
|
-
const
|
|
10129
|
-
if (
|
|
10130
|
-
const te = e.renderNodeFields(
|
|
10128
|
+
const ae = _.querySelector("[data-node-fields-slot]");
|
|
10129
|
+
if (ae && e.renderNodeFields) {
|
|
10130
|
+
const te = e.renderNodeFields(K, ae, Y);
|
|
10131
10131
|
te && B.push(te);
|
|
10132
10132
|
}
|
|
10133
|
-
const
|
|
10134
|
-
if (
|
|
10135
|
-
const te = e.renderNodeForm(
|
|
10133
|
+
const re = _.querySelector("[data-node-form-slot]");
|
|
10134
|
+
if (re && e.renderNodeForm) {
|
|
10135
|
+
const te = e.renderNodeForm(K, re, Y);
|
|
10136
10136
|
te && B.push(te);
|
|
10137
10137
|
}
|
|
10138
10138
|
if (e.renderField && _.querySelectorAll("[data-field-slot]").forEach((te) => {
|
|
10139
10139
|
var be;
|
|
10140
|
-
const ue = [...x().node(
|
|
10140
|
+
const ue = [...x().node(K).form, ...K.fields ?? []].find((Ee) => Ee.id === te.dataset.fieldSlot);
|
|
10141
10141
|
if (!ue) return;
|
|
10142
|
-
const he = e.renderField(te, ue, { ...
|
|
10142
|
+
const he = e.renderField(te, ue, { ...Y, readonly: Y.readonly || ((be = e.can) == null ? void 0 : be.call(e, "edit", K, ue.id)) === !1 || "readonly" in ue && !!ue.readonly });
|
|
10143
10143
|
he && B.push(he);
|
|
10144
10144
|
}), e.renderSystemField && _.querySelectorAll("[data-system-slot]").forEach((te) => {
|
|
10145
10145
|
var be;
|
|
10146
|
-
const ue = x().node(
|
|
10146
|
+
const ue = x().node(K).fields.find((Ee) => Ee.key === te.dataset.systemSlot);
|
|
10147
10147
|
if (!ue) return;
|
|
10148
|
-
const he = e.renderSystemField(te, ue, { ...
|
|
10148
|
+
const he = e.renderSystemField(te, ue, { ...Y, readonly: Y.readonly || ((be = e.can) == null ? void 0 : be.call(e, "edit", K, ue.key)) === !1 });
|
|
10149
10149
|
he && B.push(he);
|
|
10150
10150
|
}), e.renderActions) {
|
|
10151
10151
|
const te = _.querySelector("[data-actions-slot]");
|
|
10152
10152
|
if (te) {
|
|
10153
|
-
const ue = e.renderActions(te,
|
|
10153
|
+
const ue = e.renderActions(te, K.buttons ?? [], Y);
|
|
10154
10154
|
ue && B.push(ue);
|
|
10155
10155
|
}
|
|
10156
10156
|
}
|
|
@@ -10158,10 +10158,10 @@ function nr(s) {
|
|
|
10158
10158
|
}
|
|
10159
10159
|
function P(D) {
|
|
10160
10160
|
D.setAttribute("aria-busy", String(o)), D.querySelectorAll("input,button,select").forEach((B) => {
|
|
10161
|
-
var
|
|
10162
|
-
const _ = C(((
|
|
10163
|
-
let
|
|
10164
|
-
(B.dataset.field || B.dataset.form || B.dataset.nodeField ||
|
|
10161
|
+
var ae, re, ne;
|
|
10162
|
+
const _ = C(((ae = B.closest("[data-node]")) == null ? void 0 : ae.dataset.node) ?? ""), K = B.dataset.wf;
|
|
10163
|
+
let Y, J;
|
|
10164
|
+
(B.dataset.field || B.dataset.form || B.dataset.nodeField || K === "edit-reference" || K === "estimate") && (Y = "edit", J = B.dataset.field ?? B.dataset.form ?? B.dataset.nodeField ?? B.dataset.referenceField ?? "estimate"), B.dataset.task && (Y = "toggle-task"), K === "add-task" && (Y = "create-task"), K === "complete" && (Y = "complete"), (K === "delete-node" || K === "confirm-delete") && (Y = "delete"), (B.dataset.switch || B.dataset.removeTag) && (Y = "configure"), (B.dataset.action || K === "group-chat") && (Y = "action", J = B.dataset.action ?? K), Y && (B.disabled = !G(Y, _, J) || Y === "delete" && !!_ && !x().node(_).deletable || !!B.dataset.nodeField && !!((ne = (re = _ == null ? void 0 : _.fields) == null ? void 0 : re.find((Q) => Q.id === B.dataset.nodeField)) != null && ne.readonly));
|
|
10165
10165
|
});
|
|
10166
10166
|
}
|
|
10167
10167
|
function L(D) {
|
|
@@ -10177,51 +10177,51 @@ function nr(s) {
|
|
|
10177
10177
|
}
|
|
10178
10178
|
function $(D, B) {
|
|
10179
10179
|
var gt, mt;
|
|
10180
|
-
const _ = `${B}:${D.id}`,
|
|
10181
|
-
var
|
|
10182
|
-
return
|
|
10183
|
-
}),
|
|
10180
|
+
const _ = `${B}:${D.id}`, K = D.tasks ?? [], Y = k.get(_) ?? 0, J = K.filter((ve) => {
|
|
10181
|
+
var le;
|
|
10182
|
+
return Y === 2 ? !ve.done : Y === 3 ? ve.done : Y === 1 ? ve.owner === (((le = e.context) == null ? void 0 : le.currentUser) ?? e.currentUser ?? "体验官") : !0;
|
|
10183
|
+
}), ae = ((gt = e.taskColumns) == null ? void 0 : gt.call(e, D)) ?? [], re = [
|
|
10184
10184
|
{ key: "name", label: "名称", width: 250 },
|
|
10185
10185
|
{ key: "owner", label: "当前负责人", width: 150 },
|
|
10186
10186
|
{ key: "deliverable", label: "交付物", expanded: !0 },
|
|
10187
10187
|
{ key: "estimate", label: "估分" },
|
|
10188
10188
|
{ key: "schedule", label: "排期", width: 190 }
|
|
10189
|
-
], ne = e.taskColumnsMode === "replace" ?
|
|
10190
|
-
if (
|
|
10191
|
-
if (
|
|
10192
|
-
const Re =
|
|
10193
|
-
return `<span class="${
|
|
10194
|
-
}, Ye = J.map((ve) => `<div class="wf-task-row"${Ee}>${be.map((
|
|
10195
|
-
return `<section class="wf-tasks" data-module="node:task"><div class="wf-section-head"><div class="wf-task-title"><button type="button" data-wf="toggle-tasks" aria-label="折叠任务" aria-expanded="true"><span class="wf-caret">${
|
|
10189
|
+
], ne = e.taskColumnsMode === "replace" ? ae : [...re.filter((ve) => !ae.some((le) => le.key === ve.key)), ...ae], Q = (ve) => ve.expanded ?? !["name", "owner", "estimate", "actual", "schedule", "dependency"].includes(ve.key), te = ((mt = e.taskCanExpand) == null ? void 0 : mt.call(e, D)) ?? (ae.some(Q) || K.some((ve) => !!ve.deliverable)), ue = te && v.has(_), he = ue ? ne.filter(Q) : [], be = ue ? ne.filter((ve) => !Q(ve) && !("hideWhenExpanded" in ve && ve.hideWhenExpanded)) : ne, Ee = ' style="grid-template-columns:' + be.map((ve) => ve.key === "name" ? "minmax(250px,1fr)" : Math.max(80, ve.width ?? 140) + "px").join(" ") + ";min-width:" + be.reduce((ve, le) => ve + (le.width ?? (le.key === "name" ? 250 : 140)), 0) + 'px"', me = (ve, le) => String(ve[le] ?? ""), Te = (ve, le) => {
|
|
10190
|
+
if (le === "name") return `<label><input type="checkbox" data-task="${F(ve.id)}" aria-label="完成任务:${F(ve.name)}" ${ve.done ? "checked" : ""}><span title="${F(ve.name)}">${F(ve.name)}</span>${ue && ve.done ? '<b class="wf-task-status">已完成</b>' : ""}${e.renderTaskActions ? `<span class="wf-task-actions" data-task-actions="${F(ve.id)}"></span>` : ""}</label>`;
|
|
10191
|
+
if (ae.some((tt) => tt.key === le)) return `<div class="wf-task-value" data-task-cell="${F(ve.id)}" data-task-column="${F(le)}"></div>`;
|
|
10192
|
+
const Re = le === "owner" ? b(me(ve, le)) : me(ve, le);
|
|
10193
|
+
return `<span class="${le === "deliverable" ? "wf-task-deliverable" : ""}" title="${F(Re || "暂无")}">${F(Re || (ue ? "待填" : "暂无"))}</span>`;
|
|
10194
|
+
}, Ye = J.map((ve) => `<div class="wf-task-row"${Ee}>${be.map((le) => Te(ve, le.key)).join("")}</div>${he.length ? `<div class="wf-task-details" data-task-details="${F(ve.id)}">${he.map((le) => `<div class="wf-task-detail"><span class="wf-task-detail-label">${F(le.label)}</span>${Te(ve, le.key)}</div>`).join("")}</div>` : ""}`).join("");
|
|
10195
|
+
return `<section class="wf-tasks" data-module="node:task"><div class="wf-section-head"><div class="wf-task-title"><button type="button" data-wf="toggle-tasks" aria-label="折叠任务" aria-expanded="true"><span class="wf-caret">${Pe("caret")}</span></button><button type="button" data-wf="task-filter">${["全部任务", "我参与的", "未完成", "已完成"][Y]} (${K.filter((ve) => ve.done).length}/${K.length}) ${Pe("chevron")}</button></div>${te ? `<button type="button" data-wf="expand-tasks">${Pe(ue ? "list" : "expand")} ${ue ? "列表模式" : "展开模式"}</button>` : ""}</div><div class="wf-task-table ${ue ? "is-expanded" : ""}"><div class="wf-task-row wf-task-heading"${Ee}>${be.map((ve) => `<span>${F(ue ? ve.expandedLabel ?? ve.label : ve.label)}</span>`).join("")}</div>${Ye}<button type="button" class="wf-add-task" data-wf="add-task">${Pe("plus")} 新增任务</button></div></section>`;
|
|
10196
10196
|
}
|
|
10197
10197
|
function z(D) {
|
|
10198
10198
|
return e.renderNodeFields ? '<div class="wf-fields" data-module="node:schedule" data-node-fields-slot></div>' : '<div class="wf-fields" data-module="node:schedule">' + x().node(D).fields.map((B) => {
|
|
10199
10199
|
var J;
|
|
10200
|
-
const _ = D[B.key] ?? "",
|
|
10201
|
-
return '<label class="wf-field-' + B.key + '"><span>' + F(B.label) + "</span>" +
|
|
10200
|
+
const _ = D[B.key] ?? "", K = (J = e.context) == null ? void 0 : J.people, Y = e.renderSystemField ? '<span data-system-slot="' + B.key + '"></span>' : B.key === "owner" && K ? '<select data-field="owner" aria-label="' + F(B.label) + '"><option value="">待填</option>' + (_ && !K.some((ae) => ae.id === _) ? '<option selected value="' + F(_) + '">' + F(_) + "</option>" : "") + K.map((ae) => '<option value="' + F(ae.id) + '"' + (ae.id === _ ? " selected" : "") + ">" + F(ae.name) + "</option>").join("") + "</select>" : '<input data-field="' + B.key + '" aria-label="' + F(B.label) + '" placeholder="待填" value="' + F(_) + '">';
|
|
10201
|
+
return '<label class="wf-field-' + B.key + '"><span>' + F(B.label) + "</span>" + Y + "</label>";
|
|
10202
10202
|
}).join("") + "</div>";
|
|
10203
10203
|
}
|
|
10204
10204
|
function j(D) {
|
|
10205
|
-
if (e.renderNodeForm) return '<details class="wf-node-form" data-module="node:form" open><summary><span class="wf-caret">' +
|
|
10205
|
+
if (e.renderNodeForm) return '<details class="wf-node-form" data-module="node:form" open><summary><span class="wf-caret">' + Pe("caret") + '</span>节点表单</summary><div class="wf-form-fields" data-node-form-slot></div></details>';
|
|
10206
10206
|
const B = x().node(D).form;
|
|
10207
|
-
return B.length ? `<details class="wf-node-form" data-module="node:form" open><summary><span class="wf-caret">${
|
|
10208
|
-
var
|
|
10209
|
-
return F(((
|
|
10210
|
-
}).join("、") : "待填"}</span>${
|
|
10207
|
+
return B.length ? `<details class="wf-node-form" data-module="node:form" open><summary><span class="wf-caret">${Pe("caret")}</span>节点表单</summary><div class="wf-form-fields">${B.map((_) => `<div class="wf-form-row"><label><span>${F(_.label)}${_.required ? "<b> *</b>" : ""}</span>${e.renderField ? `<span data-field-slot="${F(_.id)}"></span>` : _.control === "workItemSelect" ? `<button type="button" class="wf-reference-field ${_.value ? "" : "is-empty"}" data-wf="edit-reference" data-reference-field="${F(_.id)}" aria-label="${F(_.label)}"><span>${_.value ? _.value.split(",").map((K) => {
|
|
10208
|
+
var Y, J, ae;
|
|
10209
|
+
return F(((ae = (J = ((Y = e.context) == null ? void 0 : Y.workItems) ?? e.workItems) == null ? void 0 : J.find((re) => re.id === K)) == null ? void 0 : ae.name) ?? K);
|
|
10210
|
+
}).join("、") : "待填"}</span>${Pe("chevron")}</button>` : _.type === "select" ? `<select data-form="${F(_.id)}" aria-label="${F(_.label)}"><option value="">待填</option>${(_.options ?? []).map((K) => `<option ${K === _.value ? "selected" : ""}>${F(K)}</option>`).join("")}</select>` : `<input data-form="${F(_.id)}" type="${_.type === "date" ? "date" : _.type === "number" ? "number" : "text"}" aria-label="${F(_.label)}" placeholder="待填" value="${F(_.value || "")}">`}</label></div>`).join("")}</div></details>` : "";
|
|
10211
10211
|
}
|
|
10212
10212
|
function ee(D, B) {
|
|
10213
|
-
return B ? "" : `<div class="wf-card-actions" data-module="node:button-group">${D.status === "inProgress" ? `<button type="button" class="wf-complete" data-wf="complete">${F(x().node(D).completeLabel)}</button>` : `<span class="wf-state-hint">${
|
|
10213
|
+
return B ? "" : `<div class="wf-card-actions" data-module="node:button-group">${D.status === "inProgress" ? `<button type="button" class="wf-complete" data-wf="complete">${F(x().node(D).completeLabel)}</button>` : `<span class="wf-state-hint">${Yt[D.status]}</span>`}${M(D, "inline")}<button type="button" data-wf="more" class="wf-more" aria-label="节点更多操作" aria-expanded="false">${Pe("more")}</button></div>`;
|
|
10214
10214
|
}
|
|
10215
|
-
function ce(D, B = !1, _ = "selected") {
|
|
10216
|
-
const
|
|
10217
|
-
return `<article class="wf-card" data-module="workflow:node" data-surface="${_}" data-node="${F(D.id)}"><div class="wf-node-basic" data-module="node:basic"><header class="wf-card-head"><button type="button" class="wf-card-title" data-wf="collapse-card" aria-expanded="
|
|
10215
|
+
function ce(D, B = !1, _ = "selected", K = !1) {
|
|
10216
|
+
const Y = x().node(D), J = K || B ? "" : Y.sections.map((ae) => ae === "form" ? j(D) : $(D, _)).join("");
|
|
10217
|
+
return `<article class="wf-card${K ? " is-collapsed" : ""}" data-module="workflow:node" data-surface="${_}" data-node="${F(D.id)}"><div class="wf-node-basic" data-module="node:basic"><header class="wf-card-head"><button type="button" class="wf-card-title" data-wf="${K ? "expand-card" : "collapse-card"}" aria-expanded="${!K}"><span class="wf-caret">${Pe("caret")}</span>${I(D)}</button>${ee(D, B)}</header><div class="wf-node-schedule">${z(D)}</div></div>${K || B ? "" : `<div class="wf-card-body wf-node-sections">${L(D)}${J}</div>`}</article>`;
|
|
10218
10218
|
}
|
|
10219
10219
|
function fe() {
|
|
10220
10220
|
r.querySelector(".wf-meta").innerHTML = `<div class="wf-roles">${((n == null ? void 0 : n.tags) ?? []).filter((D) => D.enabled !== !1).map((D) => `<span class="wf-role" style="background:${F(D.color || "#eff0f1")}">${F(D.label)}<button type="button" data-remove-tag="${F(D.id)}" aria-label="移除${F(D.label)}">×</button></span>`).join("")}</div>${n != null && n.tags.length && n.switches.length ? '<i class="wf-meta-divider"></i>' : ""}${((n == null ? void 0 : n.switches) ?? []).map((D) => `<label class="wf-switch"><input type="checkbox" data-switch="${F(D.id)}" ${D.checked ? "checked" : ""}>${F(D.label)}</label>`).join("")}`, P(r);
|
|
10221
10221
|
}
|
|
10222
10222
|
function ye() {
|
|
10223
|
-
const D = r.querySelector(".wf-canvas-viewport"), B = D.scrollLeft, { nodes: _, paths:
|
|
10224
|
-
D.innerHTML = `<div class="wf-graph-size" style="width:${
|
|
10223
|
+
const D = r.querySelector(".wf-canvas-viewport"), B = D.scrollLeft, { nodes: _, paths: K, width: Y } = ta(x().graph);
|
|
10224
|
+
D.innerHTML = `<div class="wf-graph-size" style="width:${Y * g}px;height:${420 * g}px"><div class="wf-graph" style="width:${Y}px;transform:scale(${g})"><svg width="${Y}" height="420" aria-hidden="true">${K.map((J) => `<path d="${J}"/>`).join("")}</svg>${_.map(({ node: J, x: ae, y: re, width: ne }) => `<button type="button" class="wf-node ${J.id === p ? "is-selected" : ""}" data-select-node="${F(J.id)}" aria-pressed="${J.id === p}" style="left:${ae}px;top:${re}px;width:${ne}px">${N(J)}<span>${F(J.name)}</span></button>`).join("")}</div></div>`, D.scrollLeft = B;
|
|
10225
10225
|
}
|
|
10226
10226
|
function pe() {
|
|
10227
10227
|
H(r);
|
|
@@ -10229,7 +10229,10 @@ function nr(s) {
|
|
|
10229
10229
|
r.querySelector(".wf-card-area").innerHTML = D ? ce(D) : '<p class="wf-empty">暂无节点</p>', R(r);
|
|
10230
10230
|
}
|
|
10231
10231
|
function ge() {
|
|
10232
|
-
H(d), d.innerHTML = `<div class="wf-list-toolbar"><div class="wf-filter-wrap"><button type="button" data-wf="filter" class="wf-filter-button"
|
|
10232
|
+
H(d), d.querySelector(".wf-list-toolbar") || (d.innerHTML = `<div class="wf-list-toolbar"><div class="wf-filter-wrap"><button type="button" data-wf="filter" class="wf-filter-button" aria-haspopup="dialog" aria-expanded="false"></button><div class="wf-filter-menu" hidden><label>节点状态<select data-status-filter aria-label="筛选节点状态"><option value="">全部状态</option>${Object.entries(Yt).map(([D, B]) => `<option value="${D}">${B}</option>`).join("")}</select></label></div></div><div class="wf-views" role="tablist" aria-label="节点视图"><button type="button" role="tab" data-view="details">${Pe("detail")} 节点详情</button><button type="button" role="tab" data-view="schedule">${Pe("list")} 排期信息</button></div></div><div class="wf-list-rows"></div>`), d.querySelector('[data-wf="filter"]').innerHTML = `${Pe("filter")} ${F(e.filterLabel || "筛选")} ${Pe("chevron")}`, d.querySelectorAll("[data-view]").forEach((D) => D.setAttribute("aria-selected", String(u === D.dataset.view))), d.querySelector(".wf-list-rows").innerHTML = x().nodeList.filter((D) => {
|
|
10233
|
+
var B;
|
|
10234
|
+
return (!f || D.status === f) && ((B = e.filterNode) == null ? void 0 : B.call(e, D)) !== !1;
|
|
10235
|
+
}).map((D) => ce(D, u === "schedule", "list", !h.has(D.id) || u === "schedule")).join("") || '<p class="wf-empty">暂无匹配节点</p>', R(d);
|
|
10233
10236
|
}
|
|
10234
10237
|
function Se() {
|
|
10235
10238
|
var D;
|
|
@@ -10242,51 +10245,51 @@ function nr(s) {
|
|
|
10242
10245
|
function U(D, B, _) {
|
|
10243
10246
|
return A({ type: "update-node", nodeId: D.id, patch: B, detail: _ });
|
|
10244
10247
|
}
|
|
10245
|
-
function ie(D, B, _,
|
|
10246
|
-
var
|
|
10247
|
-
(
|
|
10248
|
-
const
|
|
10249
|
-
|
|
10250
|
-
const J =
|
|
10251
|
-
J.value.trim() ?
|
|
10248
|
+
function ie(D, B, _, K) {
|
|
10249
|
+
var re;
|
|
10250
|
+
(re = D.querySelector(".wf-inline-editor")) == null || re.remove();
|
|
10251
|
+
const Y = document.createElement("div");
|
|
10252
|
+
Y.className = "wf-inline-editor", Y.innerHTML = `<input aria-label="${F(B)}" placeholder="${F(B)}" value="${F(_)}"><button type="button" data-save>保存</button><button type="button" data-cancel>取消</button>`, D.append(Y);
|
|
10253
|
+
const J = Y.querySelector("input"), ae = () => {
|
|
10254
|
+
J.value.trim() ? K(J.value.trim()) : J.focus();
|
|
10252
10255
|
};
|
|
10253
|
-
|
|
10254
|
-
ne.key === "Enter" && (ne.preventDefault(),
|
|
10256
|
+
Y.querySelector("[data-save]").addEventListener("click", ae), Y.querySelector("[data-cancel]").addEventListener("click", () => Y.remove()), J.addEventListener("keydown", (ne) => {
|
|
10257
|
+
ne.key === "Enter" && (ne.preventDefault(), ae()), ne.key === "Escape" && Y.remove();
|
|
10255
10258
|
}), J.focus();
|
|
10256
10259
|
}
|
|
10257
10260
|
function X(D, B, _) {
|
|
10258
10261
|
var Q, te, ue, he;
|
|
10259
|
-
const
|
|
10260
|
-
if (!
|
|
10262
|
+
const K = (Q = B.form) == null ? void 0 : Q.find((be) => be.id === _);
|
|
10263
|
+
if (!K) return;
|
|
10261
10264
|
(te = D.querySelector(".wf-reference-picker")) == null || te.remove();
|
|
10262
|
-
const
|
|
10263
|
-
J.className = "wf-reference-picker", J.setAttribute("role", "dialog"), J.setAttribute("aria-label", `选择${
|
|
10264
|
-
const
|
|
10265
|
+
const Y = new Set(((ue = K.value) == null ? void 0 : ue.split(",").filter(Boolean)) ?? []), J = document.createElement("div");
|
|
10266
|
+
J.className = "wf-reference-picker", J.setAttribute("role", "dialog"), J.setAttribute("aria-label", `选择${K.label}`), J.innerHTML = '<input aria-label="查找工作项" placeholder="搜索工作项"><div class="wf-reference-options"></div><footer><button type="button" data-cancel>取消</button><button type="button" data-save>确定</button></footer>', (he = Array.from(D.querySelectorAll("[data-reference-field]")).find((be) => be.dataset.referenceField === _)) == null || he.after(J);
|
|
10267
|
+
const ae = J.querySelector("input"), re = J.querySelector(".wf-reference-options"), ne = () => {
|
|
10265
10268
|
var Ee;
|
|
10266
|
-
const be = (((Ee = e.context) == null ? void 0 : Ee.workItems) ?? e.workItems ?? []).filter((me) => me.name.includes(
|
|
10267
|
-
|
|
10269
|
+
const be = (((Ee = e.context) == null ? void 0 : Ee.workItems) ?? e.workItems ?? []).filter((me) => me.name.includes(ae.value)).slice(0, 50);
|
|
10270
|
+
re.innerHTML = be.map((me) => `<label><input type="checkbox" value="${F(me.id)}" ${Y.has(me.id) ? "checked" : ""}><span>${F(me.name)}</span></label>`).join("") || "<p>暂无匹配工作项</p>";
|
|
10268
10271
|
};
|
|
10269
|
-
|
|
10272
|
+
re.addEventListener("change", (be) => {
|
|
10270
10273
|
const Ee = be.target;
|
|
10271
|
-
Ee.checked ?
|
|
10272
|
-
}),
|
|
10274
|
+
Ee.checked ? Y.add(Ee.value) : Y.delete(Ee.value);
|
|
10275
|
+
}), ae.addEventListener("input", ne), J.querySelector("[data-cancel]").addEventListener("click", () => J.remove()), J.querySelector("[data-save]").addEventListener("click", () => {
|
|
10273
10276
|
var be;
|
|
10274
|
-
return U(B, { form: (be = B.form) == null ? void 0 : be.map((Ee) => Ee.id === _ ? { ...Ee, value: [...
|
|
10277
|
+
return U(B, { form: (be = B.form) == null ? void 0 : be.map((Ee) => Ee.id === _ ? { ...Ee, value: [...Y].join(",") } : Ee) }, `更新${K.label}`);
|
|
10275
10278
|
}), J.addEventListener("keydown", (be) => {
|
|
10276
10279
|
be.key === "Escape" && J.remove();
|
|
10277
|
-
}), ne(),
|
|
10280
|
+
}), ne(), ae.focus();
|
|
10278
10281
|
}
|
|
10279
10282
|
function W(D, B) {
|
|
10280
|
-
var J,
|
|
10283
|
+
var J, ae, re, ne;
|
|
10281
10284
|
const _ = [...x().node(D).form, ...D.fields ?? []].find((Q) => {
|
|
10282
10285
|
var te;
|
|
10283
10286
|
return Q.required && !((te = Q.value) != null && te.trim());
|
|
10284
|
-
}),
|
|
10285
|
-
(
|
|
10286
|
-
const
|
|
10287
|
-
if (_ ||
|
|
10287
|
+
}), K = (J = D.tasks) == null ? void 0 : J.find((Q) => Q.blocking && !Q.done);
|
|
10288
|
+
(ae = B.querySelector(".wf-error")) == null || ae.remove();
|
|
10289
|
+
const Y = (re = D.gates) == null ? void 0 : re.find((Q) => !Q.met);
|
|
10290
|
+
if (_ || K || Y) {
|
|
10288
10291
|
const Q = document.createElement("p");
|
|
10289
|
-
Q.className = "wf-error", Q.role = "alert", Q.textContent = _ ? `请先填写${_.label}` :
|
|
10292
|
+
Q.className = "wf-error", Q.role = "alert", Q.textContent = _ ? `请先填写${_.label}` : K ? `请先完成任务:${K.name}` : Y.label, (ne = B.querySelector(".wf-card-head")) == null || ne.after(Q);
|
|
10290
10293
|
return;
|
|
10291
10294
|
}
|
|
10292
10295
|
U(D, { status: "done" }, "完成节点");
|
|
@@ -10301,14 +10304,14 @@ function nr(s) {
|
|
|
10301
10304
|
me && A({ type: "action", nodeId: me, actionId: _.dataset.action });
|
|
10302
10305
|
return;
|
|
10303
10306
|
}
|
|
10304
|
-
const
|
|
10305
|
-
if (
|
|
10306
|
-
ke(
|
|
10307
|
+
const K = B.closest("[data-select-node]");
|
|
10308
|
+
if (K) {
|
|
10309
|
+
ke(K.dataset.selectNode);
|
|
10307
10310
|
return;
|
|
10308
10311
|
}
|
|
10309
|
-
const
|
|
10310
|
-
if (
|
|
10311
|
-
u =
|
|
10312
|
+
const Y = B.closest("[data-view]");
|
|
10313
|
+
if (Y) {
|
|
10314
|
+
u = Y.dataset.view, ge();
|
|
10312
10315
|
return;
|
|
10313
10316
|
}
|
|
10314
10317
|
const J = B.closest("[data-remove-tag]");
|
|
@@ -10316,59 +10319,62 @@ function nr(s) {
|
|
|
10316
10319
|
A({ type: "update-flow", detail: { ...n, tags: n.tags.map((me) => me.id === J.dataset.removeTag ? { ...me, enabled: !1 } : me) } });
|
|
10317
10320
|
return;
|
|
10318
10321
|
}
|
|
10319
|
-
const
|
|
10320
|
-
if (!
|
|
10321
|
-
const
|
|
10322
|
-
if (
|
|
10323
|
-
const me =
|
|
10324
|
-
me.classList.toggle("is-open"),
|
|
10322
|
+
const ae = B.closest("[data-wf]");
|
|
10323
|
+
if (!ae) return;
|
|
10324
|
+
const re = ae.dataset.wf, ne = ae.closest("[data-node]"), Q = C((ne == null ? void 0 : ne.dataset.node) ?? p);
|
|
10325
|
+
if (re === "legend") {
|
|
10326
|
+
const me = ae.closest(".wf-legend-wrap");
|
|
10327
|
+
me.classList.toggle("is-open"), ae.setAttribute("aria-expanded", String(me.classList.contains("is-open")));
|
|
10325
10328
|
return;
|
|
10326
10329
|
}
|
|
10327
|
-
if (
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
+
if (re === "filter") {
|
|
10331
|
+
if (e.onFilter) e.onFilter(ae);
|
|
10332
|
+
else {
|
|
10333
|
+
const me = d.querySelector(".wf-filter-menu");
|
|
10334
|
+
me.hidden = !me.hidden, ae.setAttribute("aria-expanded", String(!me.hidden));
|
|
10335
|
+
}
|
|
10330
10336
|
return;
|
|
10331
10337
|
}
|
|
10332
10338
|
if (!Q || !ne) return;
|
|
10333
10339
|
const te = `${ne.dataset.surface ?? "list"}:${Q.id}`;
|
|
10334
|
-
if (
|
|
10335
|
-
X(ne, Q,
|
|
10340
|
+
if (re === "edit-reference") {
|
|
10341
|
+
X(ne, Q, ae.dataset.referenceField);
|
|
10336
10342
|
return;
|
|
10337
10343
|
}
|
|
10338
|
-
if (
|
|
10344
|
+
if (re === "collapse-card")
|
|
10339
10345
|
if (m.has(te) ? m.delete(te) : m.add(te), d.contains(ne))
|
|
10340
10346
|
h.delete(Q.id), ge();
|
|
10341
10347
|
else {
|
|
10342
10348
|
const me = ne.querySelector(".wf-card-body");
|
|
10343
|
-
me.hidden = !me.hidden, ne.querySelector(".wf-node-schedule").hidden = me.hidden,
|
|
10349
|
+
me.hidden = !me.hidden, ne.querySelector(".wf-node-schedule").hidden = me.hidden, ae.setAttribute("aria-expanded", String(!me.hidden));
|
|
10344
10350
|
}
|
|
10345
|
-
else if (
|
|
10351
|
+
else if (re === "expand-card")
|
|
10346
10352
|
m.delete(te), h.add(Q.id), ge();
|
|
10347
|
-
else if (
|
|
10353
|
+
else if (re === "toggle-tasks") {
|
|
10348
10354
|
w.has(te) ? w.delete(te) : w.add(te);
|
|
10349
10355
|
const me = ne.querySelector(".wf-task-table");
|
|
10350
|
-
me.hidden = !me.hidden,
|
|
10351
|
-
} else if (
|
|
10356
|
+
me.hidden = !me.hidden, ae.setAttribute("aria-expanded", String(!me.hidden));
|
|
10357
|
+
} else if (re === "task-filter") {
|
|
10352
10358
|
const me = ne.querySelector(".wf-task-filter-menu");
|
|
10353
10359
|
if (me) {
|
|
10354
10360
|
me.remove();
|
|
10355
10361
|
return;
|
|
10356
10362
|
}
|
|
10357
|
-
|
|
10358
|
-
} else if (
|
|
10359
|
-
k.set(te, Number(
|
|
10360
|
-
else if (
|
|
10363
|
+
ae.insertAdjacentHTML("afterend", '<div class="wf-task-filter-menu" role="menu">' + ["全部任务", "我参与的", "未完成", "已完成"].map((Te, Ye) => `<button type="button" role="menuitem" data-wf="task-filter-option" data-task-filter="${Ye}">${Te}</button>`).join("") + "</div>");
|
|
10364
|
+
} else if (re === "task-filter-option")
|
|
10365
|
+
k.set(te, Number(ae.dataset.taskFilter)), pe(), ge();
|
|
10366
|
+
else if (re === "expand-tasks")
|
|
10361
10367
|
v.has(te) ? v.delete(te) : v.add(te), pe(), ge();
|
|
10362
|
-
else if (
|
|
10363
|
-
else if (
|
|
10364
|
-
else if (
|
|
10365
|
-
else if (
|
|
10368
|
+
else if (re === "add-task" && e.onCreateTask) A({ type: "action", nodeId: Q.id, actionId: "__create-task" });
|
|
10369
|
+
else if (re === "add-task") ie(ne.querySelector(".wf-task-table"), "任务名称", "", (me) => U(Q, { tasks: [...Q.tasks ?? [], { id: crypto.randomUUID(), name: me, done: !1 }] }, "新增任务"));
|
|
10370
|
+
else if (re === "complete") W(Q, ne);
|
|
10371
|
+
else if (re === "more") {
|
|
10366
10372
|
const me = ne.querySelector(".wf-menu");
|
|
10367
10373
|
r.querySelectorAll(".wf-menu").forEach((Te) => Te.remove()), d.querySelectorAll(".wf-menu").forEach((Te) => Te.remove()), me || ne.insertAdjacentHTML("beforeend", `<div class="wf-menu" role="menu">${((n == null ? void 0 : n.menu) ?? []).map((Te) => `<button type="button" role="menuitem" data-wf="${Te}" ${Te === "delete-node" && !x().node(Q).deletable ? "disabled" : ""}>${Te === "delete-node" && !x().node(Q).deletable ? '<span title="流程配置不允许删除该节点">' + qn[Te] + "</span>" : qn[Te]}</button>`).join("")}${M(Q, "more")}</div>`), P(ne);
|
|
10368
|
-
} else
|
|
10374
|
+
} else re === "estimate" ? ((he = ne.querySelector(".wf-menu")) == null || he.remove(), ie(ne, "节点估分", Q.estimate ?? "", (me) => U(Q, { estimate: me }, "填写估分"))) : re === "group-chat" ? A({ type: "action", nodeId: Q.id, actionId: "group-chat" }) : re === "delete-node" ? ((be = ne.querySelector(".wf-menu")) == null || be.remove(), ne.insertAdjacentHTML("beforeend", '<div class="wf-delete-confirm" role="alertdialog" aria-label="删除节点"><span>删除此节点?</span><button type="button" data-wf="cancel-delete">取消</button><button type="button" data-wf="confirm-delete">删除</button></div>')) : re === "cancel-delete" ? (Ee = ne.querySelector(".wf-delete-confirm")) == null || Ee.remove() : re === "confirm-delete" && A({ type: "delete-node", nodeId: Q.id });
|
|
10369
10375
|
}
|
|
10370
10376
|
function oe(D) {
|
|
10371
|
-
var
|
|
10377
|
+
var K, Y, J, ae, re, ne, Q;
|
|
10372
10378
|
const B = D.target;
|
|
10373
10379
|
if (!(B instanceof HTMLInputElement || B instanceof HTMLSelectElement) || B.closest("[data-node-fields-slot],[data-node-form-slot],[data-field-slot],[data-system-slot],[data-actions-slot],[data-task-cell]")) return;
|
|
10374
10380
|
if (B.dataset.statusFilter !== void 0) {
|
|
@@ -10380,24 +10386,24 @@ function nr(s) {
|
|
|
10380
10386
|
A({ type: "update-flow", detail: { ...n, switches: n.switches.map((ue) => ue.id === B.dataset.switch ? { ...ue, checked: te } : ue) } });
|
|
10381
10387
|
return;
|
|
10382
10388
|
}
|
|
10383
|
-
const _ = C(((
|
|
10389
|
+
const _ = C(((K = B.closest("[data-node]")) == null ? void 0 : K.dataset.node) ?? "");
|
|
10384
10390
|
if (_) {
|
|
10385
10391
|
if (B.dataset.nodeField) {
|
|
10386
|
-
const te = (
|
|
10392
|
+
const te = (Y = _.fields) == null ? void 0 : Y.find((ue) => ue.id === B.dataset.nodeField);
|
|
10387
10393
|
if (te != null && te.readonly || ((J = e.can) == null ? void 0 : J.call(e, "edit", _, B.dataset.nodeField)) === !1) {
|
|
10388
10394
|
Se();
|
|
10389
10395
|
return;
|
|
10390
10396
|
}
|
|
10391
|
-
U(_, { fields: (
|
|
10397
|
+
U(_, { fields: (ae = _.fields) == null ? void 0 : ae.map((ue) => ue.id === B.dataset.nodeField ? { ...ue, value: B.value } : ue) }, "更新节点字段");
|
|
10392
10398
|
}
|
|
10393
|
-
if (B.dataset.form && ((
|
|
10399
|
+
if (B.dataset.form && ((re = e.can) == null ? void 0 : re.call(e, "edit", _, B.dataset.form)) === !1) {
|
|
10394
10400
|
Se();
|
|
10395
10401
|
return;
|
|
10396
10402
|
}
|
|
10397
10403
|
B.dataset.field && U(_, { [B.dataset.field]: B.value }, `更新${B.ariaLabel}`), B.dataset.form && U(_, { form: (ne = _.form) == null ? void 0 : ne.map((te) => te.id === B.dataset.form ? { ...te, value: B.value } : te) }, "填写节点表单"), B.dataset.task && B instanceof HTMLInputElement && U(_, { tasks: (Q = _.tasks) == null ? void 0 : Q.map((te) => te.id === B.dataset.task ? { ...te, done: B.checked } : te) }, "更新节点任务");
|
|
10398
10404
|
}
|
|
10399
10405
|
}
|
|
10400
|
-
r.innerHTML = `<div class="wf-workflow-graph" data-module="workflow:graph"><div class="wf-meta" data-module="workflow:graph:controls"></div><div class="wf-canvas" data-module="workflow:graph:canvas"><div class="wf-legend-wrap"><button type="button" class="wf-legend-trigger" data-wf="legend" aria-label="节点图例" aria-expanded="false">${
|
|
10406
|
+
r.innerHTML = `<div class="wf-workflow-graph" data-module="workflow:graph"><div class="wf-meta" data-module="workflow:graph:controls"></div><div class="wf-canvas" data-module="workflow:graph:canvas"><div class="wf-legend-wrap"><button type="button" class="wf-legend-trigger" data-wf="legend" aria-label="节点图例" aria-expanded="false">${Pe("list")}</button><div class="wf-legend" role="tooltip"><strong>节点图例</strong><span>○ 节点</span><span>◇ 里程碑</span><span>⊙ 含未完成子任务</span><span><i class="wf-dot pending"></i>未开始</span><span><i class="wf-dot inProgress"></i>进行中</span><span><i class="wf-dot done"></i>已完成</span></div></div><div class="wf-canvas-viewport" aria-label="节点流程图"></div></div></div><div class="wf-card-area" data-module="workflow:selected-node"></div>`;
|
|
10401
10407
|
for (const D of [r, d])
|
|
10402
10408
|
D.addEventListener("click", Z, { signal: c.signal }), D.addEventListener("change", oe, { signal: c.signal });
|
|
10403
10409
|
document.addEventListener("pointerdown", (D) => {
|
|
@@ -11129,7 +11135,7 @@ function ir(s) {
|
|
|
11129
11135
|
};
|
|
11130
11136
|
}
|
|
11131
11137
|
const Qe = (s) => String(s).padStart(2, "0"), un = (s) => `${s.getFullYear()}-${Qe(s.getMonth() + 1)}-${Qe(s.getDate())}`;
|
|
11132
|
-
function
|
|
11138
|
+
function Ft(s) {
|
|
11133
11139
|
if (!/^(\d{4})-(\d{2})-(\d{2})$/.exec(s)) return !1;
|
|
11134
11140
|
const t = /* @__PURE__ */ new Date(`${s}T12:00:00`);
|
|
11135
11141
|
return !Number.isNaN(t.getTime()) && un(t) === s;
|
|
@@ -11148,12 +11154,12 @@ function pi(s) {
|
|
|
11148
11154
|
}
|
|
11149
11155
|
function fi(s) {
|
|
11150
11156
|
const { time: e, range: t, seconds: n } = hi(s), i = O("div", "fc-calendar"), o = Array.isArray(s.value) ? s.value : [s.value], a = [0, 1].map((U) => String(o[U] || "").slice(0, 10)), l = [0, 1].map((U) => (String(o[U] || "").slice(11, 16) || "00:00") + (n ? ":" + (String(o[U] || "").slice(17, 19) || "00") : ""));
|
|
11151
|
-
let r = 0, d = !1, c =
|
|
11157
|
+
let r = 0, d = !1, c = Ft(a[0]) ? /* @__PURE__ */ new Date(`${a[0]}T12:00:00`) : /* @__PURE__ */ new Date();
|
|
11152
11158
|
c = new Date(c.getFullYear(), c.getMonth(), 1);
|
|
11153
11159
|
const p = O("div", "fc-calendar-panel"), h = O("div", "fc-calendar-inputs"), u = [], f = () => i.dispatchEvent(new Event("change", { bubbles: !0 })), g = O("div", "fc-error");
|
|
11154
11160
|
g.setAttribute("role", "status");
|
|
11155
11161
|
const v = () => {
|
|
11156
|
-
if (a.some((U) => U && !
|
|
11162
|
+
if (a.some((U) => U && !Ft(U))) return "请输入有效日期,格式为 YYYY-MM-DD";
|
|
11157
11163
|
if (s.field.required && !a[0]) return "请选择日期";
|
|
11158
11164
|
if (t && !!a[0] != !!a[1]) return "请选择完整的日期范围";
|
|
11159
11165
|
if (e && l.slice(0, t ? 2 : 1).some((U) => !(n ? /^([01]\d|2[0-3]):[0-5]\d:[0-5]\d$/ : /^([01]\d|2[0-3]):[0-5]\d$/).test(U))) return "请输入有效时间";
|
|
@@ -11164,13 +11170,13 @@ function fi(s) {
|
|
|
11164
11170
|
for (let U = 0; U < (t ? 2 : 1); U++) {
|
|
11165
11171
|
const ie = O("input", "fc-input fc-calendar-date");
|
|
11166
11172
|
ie.type = "text", ie.value = a[U], ie.placeholder = t ? U ? "结束日期" : "开始日期" : "YYYY-MM-DD", ie.ariaLabel = t ? ie.placeholder : s.field.label, ie.disabled = s.readonly, ie.onfocus = () => {
|
|
11167
|
-
if (r = U, d = U === 1,
|
|
11173
|
+
if (r = U, d = U === 1, Ft(a[U])) {
|
|
11168
11174
|
const X = /* @__PURE__ */ new Date(`${a[U]}T12:00:00`);
|
|
11169
11175
|
c = new Date(X.getFullYear(), X.getMonth(), 1);
|
|
11170
11176
|
}
|
|
11171
11177
|
$();
|
|
11172
11178
|
}, ie.addEventListener("change", (X) => {
|
|
11173
|
-
if (X.stopPropagation(), a[U] = ie.value.trim(),
|
|
11179
|
+
if (X.stopPropagation(), a[U] = ie.value.trim(), Ft(a[U])) {
|
|
11174
11180
|
const W = /* @__PURE__ */ new Date(`${a[U]}T12:00:00`);
|
|
11175
11181
|
c = new Date(W.getFullYear(), W.getMonth(), 1);
|
|
11176
11182
|
}
|
|
@@ -11573,7 +11579,7 @@ function gn(s, e, t, n) {
|
|
|
11573
11579
|
i.className = e, i.innerHTML = t;
|
|
11574
11580
|
const o = mi(s);
|
|
11575
11581
|
s.append(i);
|
|
11576
|
-
const a = new je(), l =
|
|
11582
|
+
const a = new je(), l = De(i, e, n);
|
|
11577
11583
|
return a.listen(i, "click", (r) => {
|
|
11578
11584
|
var p;
|
|
11579
11585
|
const d = r.target.closest("[data-action]");
|
|
@@ -12280,7 +12286,7 @@ function ha(s = {}) {
|
|
|
12280
12286
|
}, e;
|
|
12281
12287
|
}
|
|
12282
12288
|
function gr(s = {}) {
|
|
12283
|
-
const e = ha(s), t =
|
|
12289
|
+
const e = ha(s), t = De(e, "work-item-detail-header", s);
|
|
12284
12290
|
return { element: e, onInteraction: t.onInteraction, destroy() {
|
|
12285
12291
|
t.destroy(), e.onclick = null, e.remove();
|
|
12286
12292
|
} };
|
|
@@ -12288,7 +12294,7 @@ function gr(s = {}) {
|
|
|
12288
12294
|
function mr(s, e = {}) {
|
|
12289
12295
|
const t = document.createElement("div");
|
|
12290
12296
|
t.className = "rowvia-work-items rowvia-field-scope", t.style.display = "contents", s.append(t);
|
|
12291
|
-
const n = new je(), i =
|
|
12297
|
+
const n = new je(), i = De(t, "work-item-layers", e);
|
|
12292
12298
|
let o = null, a = null, l = null, r, d = null;
|
|
12293
12299
|
const c = (u, f, g) => {
|
|
12294
12300
|
var v, m;
|
|
@@ -12581,7 +12587,7 @@ class Ge {
|
|
|
12581
12587
|
}
|
|
12582
12588
|
}));
|
|
12583
12589
|
}
|
|
12584
|
-
this.interactions ?? (this.interactions =
|
|
12590
|
+
this.interactions ?? (this.interactions = De(this.mounted ? this.element : e.element, `field:${this.options.field.key}`, {
|
|
12585
12591
|
onInteraction: (n) => {
|
|
12586
12592
|
var i, o;
|
|
12587
12593
|
(o = (i = this.options).onInteraction) == null || o.call(i, n);
|
|
@@ -12677,7 +12683,7 @@ function mn(s) {
|
|
|
12677
12683
|
function Lt(s) {
|
|
12678
12684
|
return O("div", "fc-value fc-plain fc-" + (s.className || "") + (s.value == null || s.value === "" ? " fc-empty" : ""), at(s.value) || "待填");
|
|
12679
12685
|
}
|
|
12680
|
-
function
|
|
12686
|
+
function Gt(s, e) {
|
|
12681
12687
|
const t = e === "textarea" ? O("textarea", "fc-input fc-textarea") : O("input", "fc-input");
|
|
12682
12688
|
return t instanceof HTMLInputElement && (t.type = e), t instanceof HTMLTextAreaElement && yi(t), t.value = at(s.value), t.disabled = s.readonly, t.required = !!s.field.required, t.ariaLabel = s.field.label, t.placeholder = s.field.placeholder || "请输入" + s.field.label, s.field.maxLength !== void 0 && (t.maxLength = s.field.maxLength), {
|
|
12683
12689
|
element: t,
|
|
@@ -13164,7 +13170,7 @@ class Ma extends et {
|
|
|
13164
13170
|
return { element: Lt(e) };
|
|
13165
13171
|
}
|
|
13166
13172
|
renderEditing(e) {
|
|
13167
|
-
return
|
|
13173
|
+
return Gt(e, "textarea");
|
|
13168
13174
|
}
|
|
13169
13175
|
}
|
|
13170
13176
|
class Xn extends et {
|
|
@@ -13172,17 +13178,17 @@ class Xn extends et {
|
|
|
13172
13178
|
return { element: fa(e) };
|
|
13173
13179
|
}
|
|
13174
13180
|
renderEditing(e) {
|
|
13175
|
-
return
|
|
13181
|
+
return Gt(e, "url");
|
|
13176
13182
|
}
|
|
13177
13183
|
}
|
|
13178
13184
|
class Ra extends et {
|
|
13179
13185
|
renderEditing(e) {
|
|
13180
|
-
return
|
|
13186
|
+
return Gt(e, "email");
|
|
13181
13187
|
}
|
|
13182
13188
|
}
|
|
13183
13189
|
class La extends et {
|
|
13184
13190
|
renderEditing(e) {
|
|
13185
|
-
return
|
|
13191
|
+
return Gt(e, "tel");
|
|
13186
13192
|
}
|
|
13187
13193
|
}
|
|
13188
13194
|
class Tt extends Ge {
|
|
@@ -13715,9 +13721,9 @@ function vr(s, e = {}) {
|
|
|
13715
13721
|
}
|
|
13716
13722
|
const b = (S) => d.find((V) => V.key === S);
|
|
13717
13723
|
function N(S, V, se) {
|
|
13718
|
-
var B, _,
|
|
13719
|
-
const
|
|
13720
|
-
return { visible:
|
|
13724
|
+
var B, _, K;
|
|
13725
|
+
const de = Be(S.visibleWhen, l, r) && ut((B = S.permission) == null ? void 0 : B.view, r) && (!V || Be(V.visibleWhen, l, r)) && (!se || Be(se.visibleWhen, l, r) && ut(se.visibleScope, r)) && (t !== "create" || S.createVisible !== !1), xe = !!S.required || (S.requiredWhen ? Be(S.requiredWhen, l, r) : !1) || (V != null && V.requiredWhen ? Be(V.requiredWhen, l, r) : !1) || ((_ = S.permission) != null && _.required ? ut(S.permission.required, r) : !1), D = S.editable !== !1 && ut((K = S.permission) == null ? void 0 : K.edit, r);
|
|
13726
|
+
return { visible: de, required: !!xe, editable: D };
|
|
13721
13727
|
}
|
|
13722
13728
|
function I(S) {
|
|
13723
13729
|
if (l[S.key] === void 0 && (S.defaultMode === "always" && S.defaultValue !== void 0 && (l[S.key] = S.defaultValue), S.defaultMode === "conditional")) {
|
|
@@ -13730,11 +13736,11 @@ function vr(s, e = {}) {
|
|
|
13730
13736
|
}
|
|
13731
13737
|
const x = document.createElement(t === "create" ? "form" : "article");
|
|
13732
13738
|
t === "create" && (x.noValidate = !0);
|
|
13733
|
-
const G =
|
|
13739
|
+
const G = De(x, "form-surface", s);
|
|
13734
13740
|
x.className = t === "create" ? "rowvia-work-items rowvia-field-scope create-dialog form-surface" : `rowvia-work-items rowvia-field-scope drawer form-surface${n === "fullscreen" ? " is-fullscreen" : ""}`, x.dataset.variant = t, x.dataset.presentation = n, x.dataset.fieldState = g;
|
|
13735
13741
|
let E = [];
|
|
13736
13742
|
function T() {
|
|
13737
|
-
var xe, D, B, _,
|
|
13743
|
+
var xe, D, B, _, K, Y;
|
|
13738
13744
|
for (const J of E) J.destroy();
|
|
13739
13745
|
E = [], x.innerHTML = "";
|
|
13740
13746
|
const S = document.createElement("div");
|
|
@@ -13754,26 +13760,26 @@ function vr(s, e = {}) {
|
|
|
13754
13760
|
if (t === "detail" && V.length) {
|
|
13755
13761
|
const J = document.createElement("div");
|
|
13756
13762
|
J.className = "detail-tabs", J.setAttribute("role", "tablist");
|
|
13757
|
-
for (const
|
|
13763
|
+
for (const re of V) {
|
|
13758
13764
|
const ne = document.createElement("button");
|
|
13759
|
-
ne.type = "button", ne.className = `detail-tab${
|
|
13765
|
+
ne.type = "button", ne.className = `detail-tab${re.id === P ? " active" : ""}`, ne.dataset.tabId = re.id, ne.dataset.detailTab = re.label, ne.setAttribute("role", "tab"), ne.setAttribute("aria-selected", String(re.id === P)), ne.textContent = re.label, ne.onclick = () => ie(re.id), J.append(ne);
|
|
13760
13766
|
}
|
|
13761
|
-
const
|
|
13762
|
-
|
|
13767
|
+
const ae = document.createElement("div");
|
|
13768
|
+
ae.className = "spacer", J.append(ae), (K = s.slots) != null && K.tabSuffix && A(J, s.slots.tabSuffix), x.append(J);
|
|
13763
13769
|
}
|
|
13764
13770
|
const se = document.createElement("div");
|
|
13765
13771
|
se.className = t === "create" ? "create-body" : "drawer-body", t === "create" && s.simpleMode !== void 0 && se.append(H());
|
|
13766
|
-
const
|
|
13767
|
-
if (se.append(L(
|
|
13772
|
+
const de = V.find((J) => J.id === P);
|
|
13773
|
+
if (se.append(L(de)), x.append(se), (Y = s.slots) != null && Y.footer) {
|
|
13768
13774
|
const J = document.createElement("div");
|
|
13769
13775
|
J.className = "form-surface-slot-footer", A(J, s.slots.footer), x.append(J);
|
|
13770
13776
|
}
|
|
13771
13777
|
u.length && x.append(q()), t === "create" && (x.onsubmit = (J) => {
|
|
13772
|
-
var
|
|
13778
|
+
var re, ne;
|
|
13773
13779
|
if (J.preventDefault(), k) return;
|
|
13774
|
-
const
|
|
13775
|
-
if (
|
|
13776
|
-
(
|
|
13780
|
+
const ae = Se();
|
|
13781
|
+
if (ae) {
|
|
13782
|
+
(re = a.onInvalid) == null || re.call(a, ae);
|
|
13777
13783
|
return;
|
|
13778
13784
|
}
|
|
13779
13785
|
(ne = a.onSubmit) == null || ne.call(a, ge());
|
|
@@ -13792,20 +13798,20 @@ function vr(s, e = {}) {
|
|
|
13792
13798
|
for (const V of u) {
|
|
13793
13799
|
if (!Be(V.visibleWhen, l, r)) continue;
|
|
13794
13800
|
if (V.kind === "checkbox") {
|
|
13795
|
-
const
|
|
13796
|
-
|
|
13801
|
+
const de = document.createElement("label");
|
|
13802
|
+
de.className = "continuous", de.innerHTML = `<input id="${F(V.id)}" type="checkbox"${V.checked ? " checked" : ""}>${F(V.label || "")}`, S.append(de);
|
|
13797
13803
|
continue;
|
|
13798
13804
|
}
|
|
13799
13805
|
if (V.kind === "submit") {
|
|
13800
|
-
const
|
|
13801
|
-
|
|
13806
|
+
const de = document.createElement("button");
|
|
13807
|
+
de.type = "submit", de.className = V.variant || "primary", de.dataset.action = V.id, de.textContent = V.label || i.submit, S.append(de);
|
|
13802
13808
|
continue;
|
|
13803
13809
|
}
|
|
13804
13810
|
S.insertAdjacentHTML("beforeend", Ne(V.id, V.label || "", V.glyph || "", V.variant || ""));
|
|
13805
13811
|
const se = S.lastElementChild;
|
|
13806
13812
|
se.onclick = () => {
|
|
13807
|
-
var
|
|
13808
|
-
k || S.parentElement !== x || se.disabled || ((V.id === "close-overlay" || V.id === "cancel") && a.onCancel ? a.onCancel() : V.id === "save-draft" && a.onSaveDraft ? a.onSaveDraft(ge()) : (
|
|
13813
|
+
var de;
|
|
13814
|
+
k || S.parentElement !== x || se.disabled || ((V.id === "close-overlay" || V.id === "cancel") && a.onCancel ? a.onCancel() : V.id === "save-draft" && a.onSaveDraft ? a.onSaveDraft(ge()) : (de = a.onAction) == null || de.call(a, V.id, ge()));
|
|
13809
13815
|
};
|
|
13810
13816
|
}
|
|
13811
13817
|
return S;
|
|
@@ -13819,18 +13825,18 @@ function vr(s, e = {}) {
|
|
|
13819
13825
|
const V = { data: l, context: r, variant: t, tab: S }, se = document.createElement("div");
|
|
13820
13826
|
if (se.className = t === "create" ? "form-surface-body" : "detail-fields form-surface-body", !S || S.kind === "form") {
|
|
13821
13827
|
const B = (S == null ? void 0 : S.items) ?? p;
|
|
13822
|
-
for (const
|
|
13823
|
-
const
|
|
13824
|
-
|
|
13828
|
+
for (const K of B) {
|
|
13829
|
+
const Y = M(K, V);
|
|
13830
|
+
Y && se.append(Y);
|
|
13825
13831
|
}
|
|
13826
13832
|
const _ = (S == null ? void 0 : S.blocks) ?? h;
|
|
13827
|
-
for (const
|
|
13828
|
-
const
|
|
13829
|
-
|
|
13833
|
+
for (const K of _) {
|
|
13834
|
+
const Y = j(K, V);
|
|
13835
|
+
Y && se.append(Y);
|
|
13830
13836
|
}
|
|
13831
13837
|
return se;
|
|
13832
13838
|
}
|
|
13833
|
-
const
|
|
13839
|
+
const de = S.kind === "custom" ? S.render : ((D = e.renderers) == null ? void 0 : D[S.kind]) || S.render, xe = de ? de(V) : "";
|
|
13834
13840
|
return typeof xe == "string" ? se.innerHTML = xe : xe && se.append(xe), se;
|
|
13835
13841
|
}
|
|
13836
13842
|
function M(S, V) {
|
|
@@ -13840,82 +13846,82 @@ function vr(s, e = {}) {
|
|
|
13840
13846
|
}
|
|
13841
13847
|
function $(S, V) {
|
|
13842
13848
|
var B;
|
|
13843
|
-
const se = Be(S.visibleWhen, l, r),
|
|
13844
|
-
if (!se && !
|
|
13849
|
+
const se = Be(S.visibleWhen, l, r), de = S.layoutRole === "column";
|
|
13850
|
+
if (!se && !de) return null;
|
|
13845
13851
|
const xe = [];
|
|
13846
13852
|
for (const _ of se ? S.items : []) {
|
|
13847
|
-
const
|
|
13848
|
-
|
|
13853
|
+
const K = M(_, V);
|
|
13854
|
+
K && xe.push(K);
|
|
13849
13855
|
}
|
|
13850
|
-
if (!
|
|
13856
|
+
if (!de && !xe.some((_) => _.dataset.layoutRole !== "column" || _.childElementCount > 0)) return null;
|
|
13851
13857
|
const D = document.createElement("section");
|
|
13852
|
-
if (D.className = "form-group", D.dataset.group = S.id,
|
|
13858
|
+
if (D.className = "form-group", D.dataset.group = S.id, de)
|
|
13853
13859
|
return D.className = "form-layout-column", D.dataset.layoutRole = "column", D.append(...xe), D;
|
|
13854
13860
|
if (S.columns === 2 && !v) {
|
|
13855
13861
|
D.classList.add("form-group--columns");
|
|
13856
|
-
const _ = ((B = S.columnRatio) == null ? void 0 : B.length) === 2 && S.columnRatio.every((
|
|
13857
|
-
D.style.display = "grid", D.style.gridTemplateColumns = _.map((
|
|
13862
|
+
const _ = ((B = S.columnRatio) == null ? void 0 : B.length) === 2 && S.columnRatio.every((K) => Number.isFinite(K) && K > 0) ? S.columnRatio : [1, 1];
|
|
13863
|
+
D.style.display = "grid", D.style.gridTemplateColumns = _.map((K) => `minmax(0, ${K}fr)`).join(" "), D.style.columnGap = "24px";
|
|
13858
13864
|
}
|
|
13859
13865
|
return D.innerHTML = `<p class="form-group-title">${F(S.label)}</p>`, D.firstElementChild.style.gridColumn = "1 / -1", D.append(...xe), D;
|
|
13860
13866
|
}
|
|
13861
13867
|
function z(S) {
|
|
13862
|
-
var
|
|
13868
|
+
var K;
|
|
13863
13869
|
const V = b(S.field);
|
|
13864
13870
|
if (!V) return null;
|
|
13865
13871
|
const se = N(V, S, ce());
|
|
13866
13872
|
if (!se.visible || v && !m.has(V.key)) return null;
|
|
13867
13873
|
I(V);
|
|
13868
|
-
const
|
|
13869
|
-
|
|
13874
|
+
const de = document.createElement("div");
|
|
13875
|
+
de.className = t === "create" ? "create-field" : "detail-row", de.dataset.field = V.key, S.span === 2 && (de.classList.add("span-2"), de.style.gridColumn = "1 / -1"), (S.labelPosition || ((K = s.layout) == null ? void 0 : K.labelPosition) || "side") === "top" && de.classList.add("label-top");
|
|
13870
13876
|
const D = se.required, B = t === "create" ? "<em>*</em>" : " *";
|
|
13871
|
-
|
|
13872
|
-
const _ =
|
|
13873
|
-
return ye(_, { ...V, required: D }, D),
|
|
13877
|
+
de.innerHTML = `<label for="${f}-${F(V.key)}">${F(V.label)}${D ? B : ""}</label><div class="field-value"><div class="fc-host" data-control-field="${F(V.key)}" data-control-mode="${t}"></div>` + (V.description ? `<small class="field-description">${F(V.description)}</small>` : "") + "</div>";
|
|
13878
|
+
const _ = de.querySelector(".fc-host");
|
|
13879
|
+
return ye(_, { ...V, required: D }, D), de;
|
|
13874
13880
|
}
|
|
13875
13881
|
function j(S, V) {
|
|
13876
13882
|
var xe;
|
|
13877
13883
|
if (!Be(S.visibleWhen, l, r) || v && !m.has(S.id)) return null;
|
|
13878
|
-
const se = (xe = e.renderers) != null && xe.block ? e.renderers.block({ ...V, block: S }) : S.render ? S.render(V) : ee(S, V),
|
|
13879
|
-
return
|
|
13884
|
+
const se = (xe = e.renderers) != null && xe.block ? e.renderers.block({ ...V, block: S }) : S.render ? S.render(V) : ee(S, V), de = document.createElement("div");
|
|
13885
|
+
return de.className = `form-surface-block block-${S.kind}`, de.dataset.block = S.id, typeof se == "string" ? de.innerHTML = se : se && de.append(se), de;
|
|
13880
13886
|
}
|
|
13881
13887
|
function ee(S, V) {
|
|
13882
|
-
var se,
|
|
13888
|
+
var se, de;
|
|
13883
13889
|
if (S.kind === "roles") {
|
|
13884
13890
|
const xe = document.createElement("div");
|
|
13885
13891
|
xe.className = t === "create" ? "create-field" : "detail-row", xe.innerHTML = `<label>${F(S.label || "角色与人员")}${(se = S.requiredRoles) != null && se.length ? "<em>*</em>" : ""}</label><div class="role-body"><div class="role-rows"></div><div class="role-actions">${Ne("add-role", i.addRole, "", "outline")}</div></div>`;
|
|
13886
|
-
const D = xe.querySelector(".role-rows"), B = (
|
|
13887
|
-
const
|
|
13888
|
-
return
|
|
13892
|
+
const D = xe.querySelector(".role-rows"), B = (de = S.roleOptions) != null && de.length ? S.roleOptions : ["提报人"], _ = S.people ?? [], K = () => {
|
|
13893
|
+
const ae = Array.isArray(l.roles) ? l.roles : [];
|
|
13894
|
+
return ae.length || ae.push({ name: B[0], person: String(l.owner ?? V.context.currentUser ?? "") }), l.roles = ae, ae;
|
|
13889
13895
|
};
|
|
13890
|
-
let
|
|
13896
|
+
let Y = [];
|
|
13891
13897
|
const J = () => {
|
|
13892
|
-
for (const
|
|
13893
|
-
|
|
13894
|
-
|
|
13895
|
-
const
|
|
13896
|
-
|
|
13898
|
+
for (const re of Y)
|
|
13899
|
+
re.destroy(), E = E.filter((ne) => ne !== re);
|
|
13900
|
+
Y = [], D.replaceChildren();
|
|
13901
|
+
const ae = K();
|
|
13902
|
+
ae.forEach((re, ne) => {
|
|
13897
13903
|
const Q = document.createElement("div");
|
|
13898
13904
|
Q.className = "role-line";
|
|
13899
13905
|
const te = document.createElement("div");
|
|
13900
13906
|
te.className = "fc-host role-select";
|
|
13901
13907
|
const ue = document.createElement("div");
|
|
13902
|
-
if (ue.className = "fc-host role-person", Q.append(te, ue),
|
|
13908
|
+
if (ue.className = "fc-host role-person", Q.append(te, ue), ae.length > 1) {
|
|
13903
13909
|
const he = document.createElement("button");
|
|
13904
13910
|
he.type = "button", he.className = "role-remove", he.dataset.roleRemove = String(ne), he.setAttribute("aria-label", "移除角色"), he.textContent = "×", Q.append(he);
|
|
13905
13911
|
}
|
|
13906
|
-
D.append(Q),
|
|
13912
|
+
D.append(Q), Y.push(
|
|
13907
13913
|
ye(
|
|
13908
13914
|
te,
|
|
13909
13915
|
{ key: `role-${ne}`, label: "角色", kind: "select", options: B, editable: !0 },
|
|
13910
13916
|
!1,
|
|
13911
13917
|
{
|
|
13912
|
-
get: () =>
|
|
13918
|
+
get: () => re.name,
|
|
13913
13919
|
set: (he) => {
|
|
13914
|
-
|
|
13920
|
+
re.name = String(he ?? "");
|
|
13915
13921
|
},
|
|
13916
13922
|
notify: () => {
|
|
13917
13923
|
var he;
|
|
13918
|
-
return (he = a.onCommit) == null ? void 0 : he.call(a, "roles",
|
|
13924
|
+
return (he = a.onCommit) == null ? void 0 : he.call(a, "roles", K(), l);
|
|
13919
13925
|
}
|
|
13920
13926
|
}
|
|
13921
13927
|
),
|
|
@@ -13931,32 +13937,32 @@ function vr(s, e = {}) {
|
|
|
13931
13937
|
},
|
|
13932
13938
|
() => {
|
|
13933
13939
|
var he;
|
|
13934
|
-
return !!((he = S.requiredRoles) != null && he.includes(
|
|
13940
|
+
return !!((he = S.requiredRoles) != null && he.includes(re.name));
|
|
13935
13941
|
},
|
|
13936
13942
|
{
|
|
13937
|
-
get: () =>
|
|
13943
|
+
get: () => re.person,
|
|
13938
13944
|
set: (he) => {
|
|
13939
|
-
|
|
13945
|
+
re.person = String(he ?? "");
|
|
13940
13946
|
},
|
|
13941
13947
|
notify: () => {
|
|
13942
13948
|
var he, be;
|
|
13943
|
-
ne === 0 && (l.owner =
|
|
13949
|
+
ne === 0 && (l.owner = re.person, (he = a.onCommit) == null || he.call(a, "owner", re.person, l)), (be = a.onCommit) == null || be.call(a, "roles", K(), l);
|
|
13944
13950
|
}
|
|
13945
13951
|
}
|
|
13946
13952
|
)
|
|
13947
13953
|
);
|
|
13948
13954
|
});
|
|
13949
13955
|
};
|
|
13950
|
-
return J(), xe.addEventListener("click", (
|
|
13956
|
+
return J(), xe.addEventListener("click", (ae) => {
|
|
13951
13957
|
var Q, te, ue;
|
|
13952
|
-
const
|
|
13958
|
+
const re = ae.target, ne = re.closest("[data-role-remove]");
|
|
13953
13959
|
if (ne) {
|
|
13954
|
-
const he =
|
|
13960
|
+
const he = K();
|
|
13955
13961
|
he.splice(Number(ne.dataset.roleRemove), 1), he.length || he.push({ name: B[0], person: "" }), l.owner = ((Q = he[0]) == null ? void 0 : Q.person) ?? "", J(), (te = a.onChange) == null || te.call(a, "roles", he, l);
|
|
13956
13962
|
return;
|
|
13957
13963
|
}
|
|
13958
|
-
if (
|
|
13959
|
-
const he =
|
|
13964
|
+
if (re.closest('[data-action="add-role"]')) {
|
|
13965
|
+
const he = K();
|
|
13960
13966
|
he.push({ name: B.find((be) => !he.some((Ee) => Ee.name === be)) ?? B[0], person: "" }), J(), (ue = a.onChange) == null || ue.call(a, "roles", he, l);
|
|
13961
13967
|
}
|
|
13962
13968
|
}), xe;
|
|
@@ -13996,14 +14002,14 @@ function vr(s, e = {}) {
|
|
|
13996
14002
|
}
|
|
13997
14003
|
};
|
|
13998
14004
|
}
|
|
13999
|
-
function ye(S, V, se,
|
|
14005
|
+
function ye(S, V, se, de) {
|
|
14000
14006
|
var ve;
|
|
14001
|
-
const xe = () => typeof se == "function" ? se() : se, D = V.editable !== !1 && ut((ve = V.permission) == null ? void 0 : ve.edit, r), B = fe(V, D,
|
|
14002
|
-
|
|
14003
|
-
const
|
|
14004
|
-
|
|
14007
|
+
const xe = () => typeof se == "function" ? se() : se, D = V.editable !== !1 && ut((ve = V.permission) == null ? void 0 : ve.edit, r), B = fe(V, D, de), _ = o.resolve(V), K = ["radio", "switch", "attitudeVote", "singleVote", "multiVote"].includes(_.id), Y = _.createEditor(B), J = "input,select,textarea,[role=textbox]", ae = [Y.content, Y.element].filter((le) => !!le).map((le) => le.matches(J) ? le : le.querySelector(J)).find(Boolean);
|
|
14008
|
+
ae && (ae.id = `${f}-${V.key}`);
|
|
14009
|
+
const re = document.createElement("div");
|
|
14010
|
+
re.className = "fc-error", re.setAttribute("role", "status");
|
|
14005
14011
|
const ne = document.createElement("div");
|
|
14006
|
-
ne.className = "fc-detail-editor", ne.dataset.mode = "editing", ne.dataset.box = Mt(_), ne.append(
|
|
14012
|
+
ne.className = "fc-detail-editor", ne.dataset.mode = "editing", ne.dataset.box = Mt(_), ne.append(Y.element), S.classList.add("fc-detail-host"), S.classList.toggle("fc-direct-control", K), S.dataset.page = "basic", S.dataset.mode = "default", S.dataset.surface = t === "create" ? "create" : "detail", S.append(ne, re);
|
|
14007
14013
|
const Q = document.createElement("div");
|
|
14008
14014
|
Q.className = "fc-detail-preview", Q.dataset.box = Mt(_), Q.dataset.editable = String(D), Q.dataset.surface = t === "create" ? "create" : "detail", S.prepend(Q);
|
|
14009
14015
|
const te = () => {
|
|
@@ -14012,27 +14018,27 @@ function vr(s, e = {}) {
|
|
|
14012
14018
|
return;
|
|
14013
14019
|
}
|
|
14014
14020
|
S.style.minHeight = `${ne.offsetHeight}px`;
|
|
14015
|
-
}, ue = (
|
|
14016
|
-
ne.style.minHeight = `${
|
|
14021
|
+
}, ue = (le) => {
|
|
14022
|
+
ne.style.minHeight = `${le}px`, ne.style.maxHeight = `${le}px`;
|
|
14017
14023
|
}, he = () => {
|
|
14018
14024
|
ne.style.maxHeight = "", te();
|
|
14019
14025
|
}, be = Mt(_) === "rich", Ee = () => {
|
|
14020
14026
|
var Re, tt, vt;
|
|
14021
|
-
if (
|
|
14022
|
-
(Re =
|
|
14027
|
+
if (K) {
|
|
14028
|
+
(Re = Y.focus) == null || Re.call(Y);
|
|
14023
14029
|
return;
|
|
14024
14030
|
}
|
|
14025
14031
|
if (!D || S.classList.contains("editing")) return;
|
|
14026
|
-
const
|
|
14027
|
-
S.classList.add("editing"), S.dataset.mode = "editing", be || ue(
|
|
14032
|
+
const le = Q.offsetHeight;
|
|
14033
|
+
S.classList.add("editing"), S.dataset.mode = "editing", be || ue(le), te(), (tt = Y.focus) == null || tt.call(Y), (vt = a.onFieldStateChange) == null || vt.call(a, V.key, "edit");
|
|
14028
14034
|
}, me = () => {
|
|
14029
|
-
if (
|
|
14035
|
+
if (K) {
|
|
14030
14036
|
Q.hidden = !0;
|
|
14031
14037
|
return;
|
|
14032
14038
|
}
|
|
14033
|
-
if (Q.replaceChildren(_.render({ ...fe(V, D,
|
|
14034
|
-
const
|
|
14035
|
-
|
|
14039
|
+
if (Q.replaceChildren(_.render({ ...fe(V, D, de), readonly: !0, canEdit: !1, mode: "default", value: de ? de.get() : l[V.key] ?? "" })), Q.dataset.box === "select") {
|
|
14040
|
+
const le = document.createElement("span");
|
|
14041
|
+
le.className = "fc-field-chevron", le.setAttribute("aria-hidden", "true"), Q.append(le);
|
|
14036
14042
|
}
|
|
14037
14043
|
if (D) {
|
|
14038
14044
|
Q.tabIndex = 0, Q.setAttribute("role", "button"), Q.setAttribute("aria-label", `编辑${V.label}`), Q.onclick = (Re) => {
|
|
@@ -14040,45 +14046,45 @@ function vr(s, e = {}) {
|
|
|
14040
14046
|
}, Q.onkeydown = (Re) => {
|
|
14041
14047
|
(Re.key === "Enter" || Re.key === " ") && (Re.preventDefault(), Ee());
|
|
14042
14048
|
};
|
|
14043
|
-
const
|
|
14044
|
-
|
|
14049
|
+
const le = document.createElement("button");
|
|
14050
|
+
le.type = "button", le.className = "fc-detail-edit", le.tabIndex = -1, le.textContent = "编辑", le.ariaLabel = `编辑${V.label}`, le.onclick = (Re) => {
|
|
14045
14051
|
Re.stopPropagation(), Ee();
|
|
14046
|
-
}, Q.append(
|
|
14052
|
+
}, Q.append(le);
|
|
14047
14053
|
} else
|
|
14048
14054
|
Q.removeAttribute("role"), Q.removeAttribute("tabindex"), Q.onclick = null, Q.onkeydown = null;
|
|
14049
14055
|
};
|
|
14050
14056
|
me();
|
|
14051
14057
|
const Te = () => {
|
|
14052
14058
|
var Re;
|
|
14053
|
-
const
|
|
14054
|
-
return
|
|
14059
|
+
const le = xe() && !pe(Y.read()) ? i.required : (Re = Y.validate) == null ? void 0 : Re.call(Y);
|
|
14060
|
+
return re.textContent = le || "", S.classList.toggle("is-error", !!le), le;
|
|
14055
14061
|
}, Ye = () => {
|
|
14056
14062
|
var Re, tt, vt;
|
|
14057
14063
|
if (!D) return !0;
|
|
14058
|
-
const
|
|
14059
|
-
if (
|
|
14060
|
-
const rt =
|
|
14061
|
-
JSON.stringify(Ti) !== JSON.stringify(rt) && (
|
|
14064
|
+
const le = Te();
|
|
14065
|
+
if (le && he(), !le) {
|
|
14066
|
+
const rt = Y.read(), Ti = de ? de.get() : l[V.key];
|
|
14067
|
+
JSON.stringify(Ti) !== JSON.stringify(rt) && (de ? (de.set(rt), (Re = de.notify) == null || Re.call(de, rt)) : (l[V.key] = rt, (tt = a.onCommit) == null || tt.call(a, V.key, rt, l))), (vt = a.onChange) == null || vt.call(a, V.key, rt, l), me();
|
|
14062
14068
|
}
|
|
14063
|
-
return !
|
|
14069
|
+
return !le;
|
|
14064
14070
|
}, gt = () => {
|
|
14065
|
-
var
|
|
14066
|
-
S.classList.remove("editing"), S.dataset.mode = "default", S.style.minHeight = "", ne.style.minHeight = "", ne.style.maxHeight = "", (
|
|
14071
|
+
var le;
|
|
14072
|
+
S.classList.remove("editing"), S.dataset.mode = "default", S.style.minHeight = "", ne.style.minHeight = "", ne.style.maxHeight = "", (le = a.onFieldStateChange) == null || le.call(a, V.key, "display");
|
|
14067
14073
|
};
|
|
14068
14074
|
S.addEventListener("input", () => {
|
|
14069
|
-
var
|
|
14070
|
-
he(), (
|
|
14075
|
+
var le;
|
|
14076
|
+
he(), (le = a.onChange) == null || le.call(a, V.key, Y.read(), l);
|
|
14071
14077
|
}), S.addEventListener("pointerdown", () => {
|
|
14072
14078
|
S.classList.contains("editing") && he();
|
|
14073
|
-
}, !0), S.addEventListener("mousedown", (
|
|
14079
|
+
}, !0), S.addEventListener("mousedown", (le) => {
|
|
14074
14080
|
var Re;
|
|
14075
|
-
_.id !== "richText" || !S.classList.contains("editing") ||
|
|
14081
|
+
_.id !== "richText" || !S.classList.contains("editing") || le.target.closest("button,a,input,textarea,select,[contenteditable=true]") || (le.preventDefault(), !S.contains(document.activeElement) && !Ke(document.activeElement, S) && ((Re = Y.focus) == null || Re.call(Y)));
|
|
14076
14082
|
}), S.addEventListener("change", () => {
|
|
14077
14083
|
he(), Ye();
|
|
14078
14084
|
}), S.addEventListener("fc-collapse", () => {
|
|
14079
14085
|
Ye(), gt(), me();
|
|
14080
|
-
}), S.addEventListener("focusout", (
|
|
14081
|
-
|
|
14086
|
+
}), S.addEventListener("focusout", (le) => {
|
|
14087
|
+
K || le.relatedTarget instanceof Node && (S.contains(le.relatedTarget) || Ke(le.relatedTarget, S)) || queueMicrotask(() => {
|
|
14082
14088
|
if (!(k || !S.isConnected)) {
|
|
14083
14089
|
if (S.contains(document.activeElement) || Ke(document.activeElement, S)) {
|
|
14084
14090
|
te();
|
|
@@ -14093,17 +14099,17 @@ function vr(s, e = {}) {
|
|
|
14093
14099
|
const mt = {
|
|
14094
14100
|
key: V.key,
|
|
14095
14101
|
host: S,
|
|
14096
|
-
editor:
|
|
14102
|
+
editor: Y,
|
|
14097
14103
|
editable: D,
|
|
14098
14104
|
check: Te,
|
|
14099
14105
|
commit: Ye,
|
|
14100
14106
|
beginEdit: Ee,
|
|
14101
|
-
write: (
|
|
14102
|
-
|
|
14107
|
+
write: (le) => {
|
|
14108
|
+
de ? de.set(le) : l[V.key] = le;
|
|
14103
14109
|
},
|
|
14104
14110
|
destroy: () => {
|
|
14105
|
-
var
|
|
14106
|
-
return (
|
|
14111
|
+
var le;
|
|
14112
|
+
return (le = Y.destroy) == null ? void 0 : le.call(Y);
|
|
14107
14113
|
}
|
|
14108
14114
|
};
|
|
14109
14115
|
return E.push(mt), mt;
|
|
@@ -14132,7 +14138,7 @@ function vr(s, e = {}) {
|
|
|
14132
14138
|
}
|
|
14133
14139
|
function ie(S) {
|
|
14134
14140
|
var se;
|
|
14135
|
-
if (S === P || !R().some((
|
|
14141
|
+
if (S === P || !R().some((de) => de.id === S)) return;
|
|
14136
14142
|
P = S;
|
|
14137
14143
|
const V = ce();
|
|
14138
14144
|
T(), V && ((se = a.onTabChange) == null || se.call(a, S, V));
|
|
@@ -14206,7 +14212,7 @@ export {
|
|
|
14206
14212
|
rn as FORMULA_FUNCTIONS,
|
|
14207
14213
|
Co as GANTT_UNITS,
|
|
14208
14214
|
Mo as GanttChart,
|
|
14209
|
-
|
|
14215
|
+
Vt as Grid,
|
|
14210
14216
|
Xn as LinkField,
|
|
14211
14217
|
Ha as LocationField,
|
|
14212
14218
|
$a as MultiCascadeField,
|
|
@@ -14226,7 +14232,7 @@ export {
|
|
|
14226
14232
|
Fa as SwitchField,
|
|
14227
14233
|
et as TextField,
|
|
14228
14234
|
Ma as TextareaField,
|
|
14229
|
-
|
|
14235
|
+
Ut as UNIT_LABEL,
|
|
14230
14236
|
vn as VoteField,
|
|
14231
14237
|
sr as adaptOperationRecords,
|
|
14232
14238
|
Io as allGatesMet,
|
|
@@ -14259,12 +14265,12 @@ export {
|
|
|
14259
14265
|
rr as createWorkItemTabs,
|
|
14260
14266
|
lr as createWorkItemToolbar,
|
|
14261
14267
|
nr as createWorkflowDetail,
|
|
14262
|
-
|
|
14268
|
+
Vt as default,
|
|
14263
14269
|
ar as emptyView,
|
|
14264
14270
|
F as escapeHtml,
|
|
14265
14271
|
Be as evalFormCondition,
|
|
14266
14272
|
ut as evalFormScope,
|
|
14267
|
-
|
|
14273
|
+
Pt as evaluateFormula,
|
|
14268
14274
|
Fn as evaluateGates,
|
|
14269
14275
|
Ue as formatNumberCommas,
|
|
14270
14276
|
Do as groupNodes,
|