rowvia 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/rowvia.css +1 -1
- package/dist/rowvia.es.js +1266 -1260
- package/dist/rowvia.umd.cjs +29 -29
- package/dist/types/grid.d.ts +2 -0
- package/package.json +2 -2
package/dist/rowvia.es.js
CHANGED
|
@@ -186,7 +186,7 @@ function Dn(s) {
|
|
|
186
186
|
if (e < s.length) throw new Pe("#ERROR!");
|
|
187
187
|
return r;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function le(s) {
|
|
190
190
|
if (s == null || s === "") return 0;
|
|
191
191
|
if (typeof s == "number") return s;
|
|
192
192
|
if (typeof s == "boolean") return s ? 1 : 0;
|
|
@@ -221,39 +221,39 @@ const qt = {
|
|
|
221
221
|
},
|
|
222
222
|
COUNT: (s) => wt(s).length,
|
|
223
223
|
COUNTA: (s) => s.filter((e) => e != null && e !== "").length,
|
|
224
|
-
ABS: (s) => Math.abs(
|
|
224
|
+
ABS: (s) => Math.abs(le(s[0])),
|
|
225
225
|
ROUND: (s) => {
|
|
226
|
-
const e = s.length > 1 ?
|
|
227
|
-
return Math.round(
|
|
226
|
+
const e = s.length > 1 ? le(s[1]) : 0, t = Math.pow(10, e);
|
|
227
|
+
return Math.round(le(s[0]) * t) / t;
|
|
228
228
|
},
|
|
229
|
-
FLOOR: (s) => Math.floor(
|
|
230
|
-
CEIL: (s) => Math.ceil(
|
|
231
|
-
CEILING: (s) => Math.ceil(
|
|
229
|
+
FLOOR: (s) => Math.floor(le(s[0])),
|
|
230
|
+
CEIL: (s) => Math.ceil(le(s[0])),
|
|
231
|
+
CEILING: (s) => Math.ceil(le(s[0])),
|
|
232
232
|
SQRT: (s) => {
|
|
233
|
-
const e =
|
|
233
|
+
const e = le(s[0]);
|
|
234
234
|
return e < 0 ? (() => {
|
|
235
235
|
throw new Pe("#NUM!");
|
|
236
236
|
})() : Math.sqrt(e);
|
|
237
237
|
},
|
|
238
|
-
POWER: (s) => Math.pow(
|
|
239
|
-
POW: (s) => Math.pow(
|
|
238
|
+
POWER: (s) => Math.pow(le(s[0]), le(s[1])),
|
|
239
|
+
POW: (s) => Math.pow(le(s[0]), le(s[1])),
|
|
240
240
|
MOD: (s) => {
|
|
241
|
-
const e =
|
|
241
|
+
const e = le(s[1]);
|
|
242
242
|
if (e === 0) throw new Pe("#DIV/0!");
|
|
243
|
-
return
|
|
243
|
+
return le(s[0]) % e;
|
|
244
244
|
},
|
|
245
245
|
CONCAT: (s) => s.map((e) => e == null ? "" : String(e)).join(""),
|
|
246
246
|
CONCATENATE: (s) => s.map((e) => e == null ? "" : String(e)).join(""),
|
|
247
247
|
UPPER: (s) => String(s[0] ?? "").toUpperCase(),
|
|
248
248
|
LOWER: (s) => String(s[0] ?? "").toLowerCase(),
|
|
249
249
|
LEN: (s) => String(s[0] ?? "").length,
|
|
250
|
-
LEFT: (s) => String(s[0] ?? "").slice(0, s.length > 1 ?
|
|
250
|
+
LEFT: (s) => String(s[0] ?? "").slice(0, s.length > 1 ? le(s[1]) : 1),
|
|
251
251
|
RIGHT: (s) => {
|
|
252
|
-
const e = String(s[0] ?? ""), t = s.length > 1 ?
|
|
252
|
+
const e = String(s[0] ?? ""), t = s.length > 1 ? le(s[1]) : 1;
|
|
253
253
|
return t <= 0 ? "" : e.slice(-t);
|
|
254
254
|
},
|
|
255
255
|
MID: (s) => {
|
|
256
|
-
const e = String(s[0] ?? ""), t = Math.max(0,
|
|
256
|
+
const e = String(s[0] ?? ""), t = Math.max(0, le(s[1]) - 1), i = s.length > 2 ? le(s[2]) : e.length - t;
|
|
257
257
|
return e.slice(t, t + i);
|
|
258
258
|
},
|
|
259
259
|
TRIM: (s) => String(s[0] ?? "").trim(),
|
|
@@ -284,9 +284,9 @@ const qt = {
|
|
|
284
284
|
MONTH: (s) => new Date(s[0]).getMonth() + 1,
|
|
285
285
|
DAY: (s) => new Date(s[0]).getDate(),
|
|
286
286
|
TEXT: (s) => String(s[0] ?? ""),
|
|
287
|
-
VALUE: (s) =>
|
|
288
|
-
NUMBER: (s) =>
|
|
289
|
-
BETWEEN: (s) =>
|
|
287
|
+
VALUE: (s) => le(s[0]),
|
|
288
|
+
NUMBER: (s) => le(s[0]),
|
|
289
|
+
BETWEEN: (s) => le(s[0]) >= le(s[1]) && le(s[0]) <= le(s[2])
|
|
290
290
|
}, ri = Object.keys(qt);
|
|
291
291
|
function ra(s, e) {
|
|
292
292
|
qt[s.toUpperCase()] = e, ri.includes(s.toUpperCase()) || ri.push(s.toUpperCase());
|
|
@@ -316,7 +316,7 @@ function Et(s, e) {
|
|
|
316
316
|
case "cell":
|
|
317
317
|
return An(s.value, e);
|
|
318
318
|
case "unary":
|
|
319
|
-
return -
|
|
319
|
+
return -le(Et(s.operand, e));
|
|
320
320
|
case "call": {
|
|
321
321
|
const t = qt[s.name];
|
|
322
322
|
if (!t) throw new Pe("#NAME?");
|
|
@@ -327,22 +327,22 @@ function Et(s, e) {
|
|
|
327
327
|
const t = Et(s.left, e), i = Et(s.right, e);
|
|
328
328
|
switch (s.operator) {
|
|
329
329
|
case "+":
|
|
330
|
-
return typeof t == "string" || typeof i == "string" ? `${t ?? ""}${i ?? ""}` :
|
|
330
|
+
return typeof t == "string" || typeof i == "string" ? `${t ?? ""}${i ?? ""}` : le(t) + le(i);
|
|
331
331
|
case "-":
|
|
332
|
-
return
|
|
332
|
+
return le(t) - le(i);
|
|
333
333
|
case "*":
|
|
334
|
-
return
|
|
334
|
+
return le(t) * le(i);
|
|
335
335
|
case "/": {
|
|
336
|
-
const n =
|
|
336
|
+
const n = le(i);
|
|
337
337
|
if (n === 0) throw new Pe("#DIV/0!");
|
|
338
|
-
return
|
|
338
|
+
return le(t) / n;
|
|
339
339
|
}
|
|
340
340
|
case "^":
|
|
341
|
-
return Math.pow(
|
|
341
|
+
return Math.pow(le(t), le(i));
|
|
342
342
|
case "%": {
|
|
343
|
-
const n =
|
|
343
|
+
const n = le(i);
|
|
344
344
|
if (n === 0) throw new Pe("#DIV/0!");
|
|
345
|
-
return
|
|
345
|
+
return le(t) % n;
|
|
346
346
|
}
|
|
347
347
|
case "&":
|
|
348
348
|
return `${t ?? ""}${i ?? ""}`;
|
|
@@ -351,13 +351,13 @@ function Et(s, e) {
|
|
|
351
351
|
case "<>":
|
|
352
352
|
return t !== i;
|
|
353
353
|
case "<":
|
|
354
|
-
return
|
|
354
|
+
return le(t) < le(i);
|
|
355
355
|
case "<=":
|
|
356
|
-
return
|
|
356
|
+
return le(t) <= le(i);
|
|
357
357
|
case ">":
|
|
358
|
-
return
|
|
358
|
+
return le(t) > le(i);
|
|
359
359
|
case ">=":
|
|
360
|
-
return
|
|
360
|
+
return le(t) >= le(i);
|
|
361
361
|
default:
|
|
362
362
|
throw new Pe("#ERROR!");
|
|
363
363
|
}
|
|
@@ -384,7 +384,7 @@ function Yt(s, e) {
|
|
|
384
384
|
}
|
|
385
385
|
return i;
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function de(s, e, t) {
|
|
388
388
|
const i = s.colDef, n = (e.group || e.footer) && !!e.groupData && e.groupData[s.colId] !== void 0, o = n ? e.groupData : e.data, a = s.valueGetter ?? i.valueGetter;
|
|
389
389
|
if (a)
|
|
390
390
|
return (typeof a == "string" ? (l) => Ni(a) ? Ot(a, { data: l.data }) : Yt(l.data, a) : a)({
|
|
@@ -403,7 +403,7 @@ function ce(s, e, t) {
|
|
|
403
403
|
}
|
|
404
404
|
function Ut(s, e, t) {
|
|
405
405
|
var o;
|
|
406
|
-
let i =
|
|
406
|
+
let i = de(s, e, t);
|
|
407
407
|
const n = s.colDef;
|
|
408
408
|
if (n.showValueAs && typeof i == "number" && t) {
|
|
409
409
|
const a = (o = t.__columnTotalCache) == null ? void 0 : o.get(s.colId);
|
|
@@ -455,7 +455,7 @@ function Li(s, e) {
|
|
|
455
455
|
function Di(s) {
|
|
456
456
|
const t = s.colDef.comparator, i = s.type;
|
|
457
457
|
return (n, o) => {
|
|
458
|
-
const a =
|
|
458
|
+
const a = de(s, n, null), r = de(s, o, null);
|
|
459
459
|
if (t)
|
|
460
460
|
return t(a, r, n, o);
|
|
461
461
|
if (i === "numberColumn") {
|
|
@@ -1087,7 +1087,7 @@ function Fi(s) {
|
|
|
1087
1087
|
const e = s.replace(/([A-Z])/g, " $1").replace(/[_-]/g, " ").trim();
|
|
1088
1088
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
1089
1089
|
}
|
|
1090
|
-
class
|
|
1090
|
+
class st {
|
|
1091
1091
|
constructor(e, t, i) {
|
|
1092
1092
|
v(this, "id");
|
|
1093
1093
|
v(this, "__id");
|
|
@@ -1266,7 +1266,7 @@ class Vn {
|
|
|
1266
1266
|
this.refreshModel(), this.eventService.dispatchEvent("rowDataUpdated", { api: this.gridApi });
|
|
1267
1267
|
}
|
|
1268
1268
|
createRowNode(e, t, i = null, n = 0) {
|
|
1269
|
-
const o = new
|
|
1269
|
+
const o = new st(e, this.rowNodeServices, t);
|
|
1270
1270
|
return o.parent = i, o.level = n, o.uiLevel = n, o.__id = o.id, this.rowNodeMap.set(o.id, o), o;
|
|
1271
1271
|
}
|
|
1272
1272
|
buildTreeData(e, t) {
|
|
@@ -1365,7 +1365,7 @@ class Vn {
|
|
|
1365
1365
|
if (!n) return !0;
|
|
1366
1366
|
const C = t.toLowerCase(), h = this.options.includeHiddenColumnsInQuickFilter ? o : o.filter((m) => m.visible);
|
|
1367
1367
|
for (const m of h) {
|
|
1368
|
-
const y =
|
|
1368
|
+
const y = de(m, p, null);
|
|
1369
1369
|
if (Nn(C, y)) return !0;
|
|
1370
1370
|
}
|
|
1371
1371
|
return !1;
|
|
@@ -1393,7 +1393,7 @@ class Vn {
|
|
|
1393
1393
|
else {
|
|
1394
1394
|
const d = [];
|
|
1395
1395
|
Vt(e, d);
|
|
1396
|
-
const u = d.map((f) =>
|
|
1396
|
+
const u = d.map((f) => de(t, f, null));
|
|
1397
1397
|
l = Mt(t, t.aggFunc, u);
|
|
1398
1398
|
}
|
|
1399
1399
|
const c = { ...e, data: { [t.colId]: l }, groupData: null, __aggregationTest: !0 };
|
|
@@ -1409,7 +1409,7 @@ class Vn {
|
|
|
1409
1409
|
const { condition1: l, condition2: c, ...d } = i, u = [this.doesNodePassFilter(e, t, { ...d, ...l || {} })];
|
|
1410
1410
|
return c && u.push(this.doesNodePassFilter(e, t, { ...d, ...c })), (i.operator || "AND") === "OR" ? u.some(Boolean) : u.every(Boolean);
|
|
1411
1411
|
}
|
|
1412
|
-
const n =
|
|
1412
|
+
const n = de(t, e, null), o = Wn(t, n), a = n, r = i.filterType || "text";
|
|
1413
1413
|
if (r === "text") {
|
|
1414
1414
|
const l = String(i.filter ?? "").toLowerCase();
|
|
1415
1415
|
if (!l) return !0;
|
|
@@ -1494,21 +1494,21 @@ class Vn {
|
|
|
1494
1494
|
const g = e[d], p = /* @__PURE__ */ new Map(), C = [];
|
|
1495
1495
|
for (const m of c) {
|
|
1496
1496
|
if (!m.__passesFilter) continue;
|
|
1497
|
-
const y =
|
|
1497
|
+
const y = de(g, m, null), E = zn(y);
|
|
1498
1498
|
p.has(E) || (p.set(E, []), C.push(E)), p.get(E).push(m);
|
|
1499
1499
|
}
|
|
1500
1500
|
const h = [];
|
|
1501
1501
|
for (const m of C) {
|
|
1502
|
-
const y = p.get(m), E = `${f}|${g.colId}:${m}`, R = this.rowNodeMap.get(E), S = R || new
|
|
1502
|
+
const y = p.get(m), E = `${f}|${g.colId}:${m}`, R = this.rowNodeMap.get(E), S = R || new st({ [g.colId]: m }, this.rowNodeServices, E);
|
|
1503
1503
|
S.group = !0, S.key = m, S.level = u, S.uiLevel = u, S.parent = null, S.children = i(y, d + 1, u + 1, E);
|
|
1504
|
-
for (const
|
|
1504
|
+
for (const A of S.children) A.parent = S;
|
|
1505
1505
|
S.allChildrenCount = un(S), S.data = { ...S.data };
|
|
1506
|
-
const
|
|
1507
|
-
Vt(S,
|
|
1506
|
+
const P = [];
|
|
1507
|
+
Vt(S, P);
|
|
1508
1508
|
const O = {};
|
|
1509
|
-
for (const
|
|
1510
|
-
const j =
|
|
1511
|
-
O[
|
|
1509
|
+
for (const A of t) {
|
|
1510
|
+
const j = P.map((W) => de(A, W, null));
|
|
1511
|
+
O[A.colId] = Mt(A, A.aggFunc, j);
|
|
1512
1512
|
}
|
|
1513
1513
|
O[g.colId] = m, S.groupData = O, R || this.rowNodeMap.set(E, S), h.push(S);
|
|
1514
1514
|
}
|
|
@@ -1524,7 +1524,7 @@ class Vn {
|
|
|
1524
1524
|
const l = (c, d) => {
|
|
1525
1525
|
const u = e[d], f = u.sort === "desc" ? -1 : 1, g = Di(u);
|
|
1526
1526
|
c.sort((p, C) => {
|
|
1527
|
-
const h =
|
|
1527
|
+
const h = de(u, p, null), m = de(u, C, null);
|
|
1528
1528
|
return g({ ...p, data: { [u.colId]: h } }, { ...C, data: { [u.colId]: m } }) * f;
|
|
1529
1529
|
});
|
|
1530
1530
|
};
|
|
@@ -1578,18 +1578,18 @@ class Vn {
|
|
|
1578
1578
|
createFooterNode(e, t) {
|
|
1579
1579
|
const i = `${e.id}|footer`;
|
|
1580
1580
|
let n = this.rowNodeMap.get(i);
|
|
1581
|
-
return n || (n = new
|
|
1581
|
+
return n || (n = new st(e.data, this.rowNodeServices, i), this.rowNodeMap.set(i, n)), n.group = !1, n.footer = !0, n.level = e.level, n.uiLevel = t, n.parent = e, n.selected = !1, n.selectable = !1, n.groupData = { ...e.groupData, __footerFor: e.id }, n;
|
|
1582
1582
|
}
|
|
1583
1583
|
createGrandTotalNode(e) {
|
|
1584
1584
|
const t = "ag-grid-grand-total";
|
|
1585
1585
|
let i = this.rowNodeMap.get(t);
|
|
1586
|
-
i || (i = new
|
|
1586
|
+
i || (i = new st(null, this.rowNodeServices, t), this.rowNodeMap.set(t, i)), i.group = !1, i.footer = !0, i.level = 0, i.uiLevel = 0, i.selected = !1, i.selectable = !1;
|
|
1587
1587
|
const n = this.columns().filter((r) => r.aggFunc && !r.rowGroup), o = [];
|
|
1588
1588
|
for (const r of this.rootRowNodes)
|
|
1589
1589
|
r.group ? Vt(r, o) : r.__passesFilter && o.push(r);
|
|
1590
1590
|
const a = {};
|
|
1591
1591
|
for (const r of n) {
|
|
1592
|
-
const l = o.map((c) =>
|
|
1592
|
+
const l = o.map((c) => de(r, c, null));
|
|
1593
1593
|
a[r.colId] = Mt(r, r.aggFunc, l);
|
|
1594
1594
|
}
|
|
1595
1595
|
return a.__grandTotal = !0, i.groupData = a, i;
|
|
@@ -1887,8 +1887,8 @@ class Xn {
|
|
|
1887
1887
|
this.buildDisplayRows(), this.eventService.dispatchEvent("modelUpdated", {});
|
|
1888
1888
|
}
|
|
1889
1889
|
createNode(e, t, i, n) {
|
|
1890
|
-
const o = jn(e), a = (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null ? String(e.id) : `${t}#${n}`, r = this.rowNodeMap.get(a), l = r instanceof
|
|
1891
|
-
return l.data = e, l.rowIndex = i, o && (l.group = !0, l.key = String(
|
|
1890
|
+
const o = jn(e), a = (e == null ? void 0 : e.id) !== void 0 && (e == null ? void 0 : e.id) !== null ? String(e.id) : `${t}#${n}`, r = this.rowNodeMap.get(a), l = r instanceof st ? r : new st(e, this.rowNodeServices, a);
|
|
1891
|
+
return l.data = e, l.rowIndex = i, o && (l.group = !0, l.key = String(de(this.columns().find((c) => c.rowGroup), l, null) ?? ""), l.level = t ? t.split("|").length : 0, l.uiLevel = l.level, l.allChildrenCount = typeof e.childCount == "number" ? e.childCount : null, l.expanded = this.stores.has(`${t ? t + "|" : ""}${l.key}`)), this.rowNodeMap.set(a, l), l;
|
|
1892
1892
|
}
|
|
1893
1893
|
buildDisplayRows() {
|
|
1894
1894
|
const e = [], t = (i, n) => {
|
|
@@ -2056,7 +2056,7 @@ class Yn {
|
|
|
2056
2056
|
this.loading = !1, this.lastRow = n ?? null, i.forEach((o, a) => {
|
|
2057
2057
|
const r = (o == null ? void 0 : o.id) !== void 0 ? String(o.id) : `row-${e + a}`;
|
|
2058
2058
|
let l = this.rowNodeMap.get(r);
|
|
2059
|
-
l || (l = new
|
|
2059
|
+
l || (l = new st(o, this.rowNodeServices, r), this.rowNodeMap.set(r, l)), l.data = o, l.rowIndex = e + a, this.nodes[e + a] = l;
|
|
2060
2060
|
}), this.eventService.dispatchEvent("modelUpdated", {});
|
|
2061
2061
|
},
|
|
2062
2062
|
failCallback: () => {
|
|
@@ -2159,7 +2159,7 @@ class Qn {
|
|
|
2159
2159
|
this.loading = !1, i.forEach((n, o) => {
|
|
2160
2160
|
const a = (n == null ? void 0 : n.id) !== void 0 ? String(n.id) : `vrow-${e + o}`;
|
|
2161
2161
|
let r = this.rowNodeMap.get(a);
|
|
2162
|
-
r || (r = new
|
|
2162
|
+
r || (r = new st(n, this.rowNodeServices, a), this.rowNodeMap.set(a, r)), r.data = n, r.rowIndex = e + o, this.nodes[e + o - e] = r;
|
|
2163
2163
|
}), this.eventService.dispatchEvent("modelUpdated", {});
|
|
2164
2164
|
},
|
|
2165
2165
|
failCallback: () => {
|
|
@@ -2365,37 +2365,37 @@ function Pi(s, e, t, i = {}) {
|
|
|
2365
2365
|
if (!o || o.length < 1) return n;
|
|
2366
2366
|
const a = i.type || "line", r = Math.min(...o, 0), c = Math.max(...o, 0) - r || 1, d = ((m = i.tooltip) == null ? void 0 : m.enabled) === !0, u = ((y = i.axis) == null ? void 0 : y.type) || "number", f = ((E = i.pointsOfInterest) == null ? void 0 : E.show) === !0, g = (R, S) => u === "category" ? `${R + 1}: ${S}` : String(S);
|
|
2367
2367
|
if (f && o.length > 1) {
|
|
2368
|
-
const R = o.indexOf(Math.min(...o)), S = o.indexOf(Math.max(...o)),
|
|
2369
|
-
const
|
|
2370
|
-
|
|
2368
|
+
const R = o.indexOf(Math.min(...o)), S = o.indexOf(Math.max(...o)), P = e / Math.max(1, o.length - 1), O = (j) => t - 2 - (j - r) / c * (t - 4), A = (j, W) => {
|
|
2369
|
+
const T = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
2370
|
+
T.setAttribute("cx", String(j * P)), T.setAttribute("cy", String(O(o[j]))), T.setAttribute("r", "2.5"), T.setAttribute("fill", W), n.appendChild(T);
|
|
2371
2371
|
};
|
|
2372
|
-
|
|
2372
|
+
A(0, "#4caf50"), A(o.length - 1, "#f44336"), A(R, "#2196f3"), A(S, "#ff9800");
|
|
2373
2373
|
}
|
|
2374
2374
|
if (d) {
|
|
2375
2375
|
const R = document.createElementNS("http://www.w3.org/2000/svg", "title");
|
|
2376
|
-
R.textContent = o.map((S,
|
|
2376
|
+
R.textContent = o.map((S, P) => g(P, S)).join(`
|
|
2377
2377
|
`), n.appendChild(R), n.style.cursor = "default";
|
|
2378
2378
|
}
|
|
2379
2379
|
if (a === "bar") {
|
|
2380
2380
|
const R = i.direction === "vertical", S = o.length;
|
|
2381
2381
|
if (R) {
|
|
2382
|
-
const
|
|
2383
|
-
o.forEach((
|
|
2384
|
-
const W = j * (e / S),
|
|
2385
|
-
|
|
2382
|
+
const P = Math.max(1, e / S - 1), O = t - 2 - (0 - r) / c * (t - 4);
|
|
2383
|
+
o.forEach((A, j) => {
|
|
2384
|
+
const W = j * (e / S), T = t - 2 - (A - r) / c * (t - 4), F = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2385
|
+
F.setAttribute("x", String(W)), F.setAttribute("width", String(P)), F.setAttribute("y", String(Math.min(T, O))), F.setAttribute("height", String(Math.max(1, Math.abs(O - T)))), F.setAttribute("fill", "currentColor"), n.appendChild(F);
|
|
2386
2386
|
});
|
|
2387
2387
|
} else {
|
|
2388
|
-
const
|
|
2389
|
-
o.forEach((
|
|
2390
|
-
const W = j * (t / S),
|
|
2391
|
-
|
|
2388
|
+
const P = Math.max(1, t / S - 1), O = 2 + (0 - r) / c * (e - 4);
|
|
2389
|
+
o.forEach((A, j) => {
|
|
2390
|
+
const W = j * (t / S), T = 2 + (A - r) / c * (e - 4), F = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2391
|
+
F.setAttribute("y", String(W)), F.setAttribute("height", String(P)), F.setAttribute("x", String(Math.min(T, O))), F.setAttribute("width", String(Math.max(1, Math.abs(O - T)))), F.setAttribute("fill", "currentColor"), n.appendChild(F);
|
|
2392
2392
|
});
|
|
2393
2393
|
}
|
|
2394
2394
|
return n;
|
|
2395
2395
|
}
|
|
2396
2396
|
const p = e / Math.max(1, o.length - 1), C = o.map((R, S) => {
|
|
2397
|
-
const
|
|
2398
|
-
return `${
|
|
2397
|
+
const P = S * p, O = t - 2 - (R - r) / c * (t - 4);
|
|
2398
|
+
return `${P.toFixed(1)},${O.toFixed(1)}`;
|
|
2399
2399
|
});
|
|
2400
2400
|
if (a === "area") {
|
|
2401
2401
|
const R = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
|
|
@@ -2663,7 +2663,7 @@ function fo(s) {
|
|
|
2663
2663
|
var e, t;
|
|
2664
2664
|
return (s == null ? void 0 : s.allowTyping) === !0 || ((t = (e = s == null ? void 0 : s.column) == null ? void 0 : e.cellEditorParams) == null ? void 0 : t.allowTyping) === !0;
|
|
2665
2665
|
}
|
|
2666
|
-
const
|
|
2666
|
+
const ut = {
|
|
2667
2667
|
agTextCellEditor: (s) => new lo(s),
|
|
2668
2668
|
agNumberCellEditor: (s) => new ro(s),
|
|
2669
2669
|
agSelectCellEditor: (s) => new co(s),
|
|
@@ -2734,7 +2734,7 @@ class xo {
|
|
|
2734
2734
|
if (t != null && t.closest('input, textarea, select, [contenteditable="true"]')) return;
|
|
2735
2735
|
const i = this.eViewport;
|
|
2736
2736
|
let n = e.deltaY, o = e.deltaX;
|
|
2737
|
-
e.deltaMode === 1 ? (n *= 33, o *= 33) : e.deltaMode === 2 && (n *= i.clientHeight, o *= i.clientWidth), n && (i.scrollTop += n), o && (i.scrollLeft += o), this.syncPinnedScroll(), this.scheduleScrollRender(), this.ctx.onViewportScroll && this.ctx.onViewportScroll(), e.preventDefault();
|
|
2737
|
+
e.deltaMode === 1 ? (n *= 33, o *= 33) : e.deltaMode === 2 && (n *= i.clientHeight, o *= i.clientWidth), e.shiftKey && !o && (o = n, n = 0), n && (i.scrollTop += n), o && (i.scrollLeft += o), this.syncPinnedScroll(), this.scheduleScrollRender(), this.ctx.onViewportScroll && this.ctx.onViewportScroll(), e.preventDefault();
|
|
2738
2738
|
});
|
|
2739
2739
|
v(this, "onBodyMouseOver", (e) => {
|
|
2740
2740
|
var o;
|
|
@@ -2955,7 +2955,8 @@ class xo {
|
|
|
2955
2955
|
return Math.max(0, this.eViewport.offsetWidth - this.eViewport.clientWidth);
|
|
2956
2956
|
}
|
|
2957
2957
|
setHorizontalScrollLeft(e) {
|
|
2958
|
-
|
|
2958
|
+
var t, i;
|
|
2959
|
+
this.eViewport.scrollLeft = e, this.syncPinnedScroll(), (i = (t = this.ctx).onViewportScroll) == null || i.call(t);
|
|
2959
2960
|
}
|
|
2960
2961
|
/**
|
|
2961
2962
|
* Re-renders the group rows that stick to the top of the viewport. A group
|
|
@@ -3076,7 +3077,7 @@ class xo {
|
|
|
3076
3077
|
event: e,
|
|
3077
3078
|
node: t.node,
|
|
3078
3079
|
column: t.column,
|
|
3079
|
-
value:
|
|
3080
|
+
value: de(t.column, t.node, null),
|
|
3080
3081
|
rowIndex: this.getRowIndexForNode(t.node),
|
|
3081
3082
|
colDef: t.column.colDef
|
|
3082
3083
|
});
|
|
@@ -3095,7 +3096,7 @@ class xo {
|
|
|
3095
3096
|
event: e,
|
|
3096
3097
|
node: t.node,
|
|
3097
3098
|
column: t.column,
|
|
3098
|
-
value:
|
|
3099
|
+
value: de(t.column, t.node, null),
|
|
3099
3100
|
rowIndex: this.getRowIndexForNode(t.node),
|
|
3100
3101
|
colDef: t.column.colDef
|
|
3101
3102
|
});
|
|
@@ -3113,7 +3114,7 @@ class xo {
|
|
|
3113
3114
|
event: e,
|
|
3114
3115
|
node: t.node,
|
|
3115
3116
|
column: t.column,
|
|
3116
|
-
value:
|
|
3117
|
+
value: de(t.column, t.node, null),
|
|
3117
3118
|
rowIndex: this.getRowIndexForNode(t.node)
|
|
3118
3119
|
});
|
|
3119
3120
|
}
|
|
@@ -3123,7 +3124,7 @@ class xo {
|
|
|
3123
3124
|
event: e,
|
|
3124
3125
|
node: t.node,
|
|
3125
3126
|
column: t.column,
|
|
3126
|
-
value:
|
|
3127
|
+
value: de(t.column, t.node, null),
|
|
3127
3128
|
rowIndex: this.getRowIndexForNode(t.node)
|
|
3128
3129
|
});
|
|
3129
3130
|
}
|
|
@@ -3182,7 +3183,7 @@ class Ft {
|
|
|
3182
3183
|
const d = t[c], u = this.createCell(d, e);
|
|
3183
3184
|
let f = 1;
|
|
3184
3185
|
typeof d.colDef.colSpan == "function" && (f = Math.max(1, Math.round(d.colDef.colSpan({
|
|
3185
|
-
value:
|
|
3186
|
+
value: de(d, e, null),
|
|
3186
3187
|
data: e.data,
|
|
3187
3188
|
node: e,
|
|
3188
3189
|
column: d,
|
|
@@ -3206,7 +3207,7 @@ class Ft {
|
|
|
3206
3207
|
const n = e.colId.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
3207
3208
|
n && i.classList.add(`ag-col-${n}`);
|
|
3208
3209
|
const o = {
|
|
3209
|
-
value:
|
|
3210
|
+
value: de(e, t, null),
|
|
3210
3211
|
data: t.data,
|
|
3211
3212
|
node: t,
|
|
3212
3213
|
column: e,
|
|
@@ -3228,7 +3229,7 @@ class Ft {
|
|
|
3228
3229
|
const a = document.createElement("span");
|
|
3229
3230
|
a.className = "ag-cell-value", i.appendChild(a), this.ctx.options.enableCellTextSelection && (i.style.userSelect = "text", i.style.cursor = "text"), i.setAttribute("role", "gridcell"), i.setAttribute("aria-colindex", String(this.cellColumnIndex(e)));
|
|
3230
3231
|
const r = (u = (d = this.ctx).getNote) == null ? void 0 : u.call(d, t.id, e.colId, e.colDef.note, {
|
|
3231
|
-
value:
|
|
3232
|
+
value: de(e, t, null),
|
|
3232
3233
|
data: t.data,
|
|
3233
3234
|
node: t,
|
|
3234
3235
|
column: e,
|
|
@@ -3249,7 +3250,7 @@ class Ft {
|
|
|
3249
3250
|
}), i.appendChild(f);
|
|
3250
3251
|
}
|
|
3251
3252
|
const l = e.tooltipField;
|
|
3252
|
-
l && t.data && t.data[l] !== void 0 ? i.title = String(t.data[l]) : e.tooltipValueGetter && (i.title = String(e.tooltipValueGetter({ value:
|
|
3253
|
+
l && t.data && t.data[l] !== void 0 ? i.title = String(t.data[l]) : e.tooltipValueGetter && (i.title = String(e.tooltipValueGetter({ value: de(e, t, null), valueFormatted: null, data: t.data, node: t, column: e, api: null, colDef: e.colDef })));
|
|
3253
3254
|
const c = {
|
|
3254
3255
|
column: e,
|
|
3255
3256
|
eCell: i,
|
|
@@ -3263,7 +3264,7 @@ class Ft {
|
|
|
3263
3264
|
}
|
|
3264
3265
|
updateCellContent(e) {
|
|
3265
3266
|
var c;
|
|
3266
|
-
const { column: t, node: i } = { column: e.column, node: this.node }, n =
|
|
3267
|
+
const { column: t, node: i } = { column: e.column, node: this.node }, n = de(t, i, null), o = Ut(t, i, null);
|
|
3267
3268
|
e.lastValue = n, e.lastFormatted = o;
|
|
3268
3269
|
const a = typeof t.cellRenderer == "string" ? t.cellRenderer : null, r = typeof t.cellRenderer == "function" ? t.cellRenderer : null;
|
|
3269
3270
|
if (a || r) {
|
|
@@ -3309,7 +3310,7 @@ class Ft {
|
|
|
3309
3310
|
const n = e && e.length ? new Set(e.map((d) => d.colId)) : null;
|
|
3310
3311
|
for (const d of this.cellComps) {
|
|
3311
3312
|
if (n && !n.has(d.column.colId)) continue;
|
|
3312
|
-
const u =
|
|
3313
|
+
const u = de(d.column, this.node, null), f = t || u !== d.lastValue;
|
|
3313
3314
|
if (!f && !i) continue;
|
|
3314
3315
|
const g = d.eValue.textContent;
|
|
3315
3316
|
if (d.rendererInstance && typeof d.rendererInstance.refresh == "function") {
|
|
@@ -3747,7 +3748,7 @@ class Mo {
|
|
|
3747
3748
|
}
|
|
3748
3749
|
const n = this.findCellElement(t, e.rowIndex);
|
|
3749
3750
|
if (!n) return;
|
|
3750
|
-
const o =
|
|
3751
|
+
const o = de(t, i, this.grid.getApi()), a = {
|
|
3751
3752
|
value: e.charPress !== void 0 ? e.charPress : o,
|
|
3752
3753
|
oldValue: o,
|
|
3753
3754
|
data: i.data,
|
|
@@ -3763,13 +3764,13 @@ class Mo {
|
|
|
3763
3764
|
};
|
|
3764
3765
|
let r = null;
|
|
3765
3766
|
if (typeof t.cellEditor == "string")
|
|
3766
|
-
r = (
|
|
3767
|
+
r = (ut[t.cellEditor] || ut.agTextCellEditor)(a);
|
|
3767
3768
|
else if (typeof t.cellEditor == "function") {
|
|
3768
3769
|
const d = t.cellEditor(a);
|
|
3769
3770
|
r = d && typeof d.getGui == "function" ? d : { getGui: () => d, getValue: () => d == null ? void 0 : d.value };
|
|
3770
3771
|
} else {
|
|
3771
3772
|
const d = t.type === "numberColumn" ? "agNumberCellEditor" : t.type === "dateColumn" ? "agDateCellEditor" : "agTextCellEditor";
|
|
3772
|
-
r =
|
|
3773
|
+
r = ut[d](a);
|
|
3773
3774
|
}
|
|
3774
3775
|
if (!r) return;
|
|
3775
3776
|
this.editing = {
|
|
@@ -3796,7 +3797,7 @@ class Mo {
|
|
|
3796
3797
|
for (const o of n) {
|
|
3797
3798
|
const a = this.findCellElement(o, e);
|
|
3798
3799
|
if (!a) continue;
|
|
3799
|
-
const r =
|
|
3800
|
+
const r = de(o, t, this.grid.getApi()), l = this.createEditor(o, t, e, r, i);
|
|
3800
3801
|
if (!l) continue;
|
|
3801
3802
|
a.classList.add("ag-cell-inline-editing", "ag-cell-editing");
|
|
3802
3803
|
const c = l.getGui();
|
|
@@ -3821,13 +3822,13 @@ class Mo {
|
|
|
3821
3822
|
...e.cellEditorParams
|
|
3822
3823
|
};
|
|
3823
3824
|
if (typeof e.cellEditor == "string")
|
|
3824
|
-
return (
|
|
3825
|
+
return (ut[e.cellEditor] || ut.agTextCellEditor)(a);
|
|
3825
3826
|
if (typeof e.cellEditor == "function") {
|
|
3826
3827
|
const c = e.cellEditor(a);
|
|
3827
3828
|
return c && typeof c.getGui == "function" ? c : { getGui: () => c, getValue: () => c == null ? void 0 : c.value };
|
|
3828
3829
|
}
|
|
3829
3830
|
const r = e.type === "numberColumn" ? "agNumberCellEditor" : e.type === "dateColumn" ? "agDateCellEditor" : "agTextCellEditor";
|
|
3830
|
-
return
|
|
3831
|
+
return ut[r](a);
|
|
3831
3832
|
}
|
|
3832
3833
|
stopEditing(e = !1) {
|
|
3833
3834
|
var c, d, u, f;
|
|
@@ -3875,7 +3876,7 @@ class Mo {
|
|
|
3875
3876
|
applyValueSetter(e, t, i) {
|
|
3876
3877
|
if (e.valueSetter) {
|
|
3877
3878
|
if (e.valueSetter({
|
|
3878
|
-
oldValue:
|
|
3879
|
+
oldValue: de(e, t, this.grid.getApi()),
|
|
3879
3880
|
newValue: i,
|
|
3880
3881
|
data: t.data,
|
|
3881
3882
|
node: t,
|
|
@@ -4357,23 +4358,23 @@ class Io {
|
|
|
4357
4358
|
R.className = "ag-filter-inputs";
|
|
4358
4359
|
const S = document.createElement("input");
|
|
4359
4360
|
S.type = "number", S.className = "ag-filter-input", S.value = c.filter ?? "", S.placeholder = this.grid.t("from"), S.addEventListener("input", () => {
|
|
4360
|
-
d = { ...c, filter: S.value, filterTo:
|
|
4361
|
+
d = { ...c, filter: S.value, filterTo: P.value };
|
|
4361
4362
|
});
|
|
4362
|
-
const
|
|
4363
|
-
|
|
4364
|
-
d = { ...c, filter: S.value, filterTo:
|
|
4365
|
-
}), R.appendChild(S), R.appendChild(
|
|
4363
|
+
const P = document.createElement("input");
|
|
4364
|
+
P.type = "number", P.className = "ag-filter-input", P.value = c.filterTo ?? "", P.placeholder = this.grid.t("to"), P.addEventListener("input", () => {
|
|
4365
|
+
d = { ...c, filter: S.value, filterTo: P.value };
|
|
4366
|
+
}), R.appendChild(S), R.appendChild(P), a.appendChild(R);
|
|
4366
4367
|
} else if (i === "date") {
|
|
4367
4368
|
const R = document.createElement("div");
|
|
4368
4369
|
R.className = "ag-filter-inputs";
|
|
4369
4370
|
const S = document.createElement("input");
|
|
4370
4371
|
S.type = "date", S.className = "ag-filter-input", S.value = c.dateFrom ?? "", S.addEventListener("input", () => {
|
|
4371
|
-
d = { ...c, dateFrom: S.value, dateTo:
|
|
4372
|
+
d = { ...c, dateFrom: S.value, dateTo: P.value };
|
|
4372
4373
|
});
|
|
4373
|
-
const
|
|
4374
|
-
|
|
4375
|
-
d = { ...c, dateFrom: S.value, dateTo:
|
|
4376
|
-
}), R.appendChild(S), R.appendChild(
|
|
4374
|
+
const P = document.createElement("input");
|
|
4375
|
+
P.type = "date", P.className = "ag-filter-input", P.value = c.dateTo ?? "", P.addEventListener("input", () => {
|
|
4376
|
+
d = { ...c, dateFrom: S.value, dateTo: P.value };
|
|
4377
|
+
}), R.appendChild(S), R.appendChild(P), a.appendChild(R);
|
|
4377
4378
|
} else {
|
|
4378
4379
|
const R = document.createElement("input");
|
|
4379
4380
|
R.type = i === "number" ? "number" : "text", R.className = "ag-filter-input", R.value = c.filter ?? "", R.placeholder = this.grid.t("filterOoo"), R.addEventListener("input", () => {
|
|
@@ -4393,8 +4394,8 @@ class Io {
|
|
|
4393
4394
|
const R = this.buildConditionSelect(
|
|
4394
4395
|
i === "number" ? xt : St,
|
|
4395
4396
|
((h = c.condition2) == null ? void 0 : h.type) || (i === "number" ? xt : St)[0],
|
|
4396
|
-
(
|
|
4397
|
-
d || (d = { ...c }), d.condition2 = { ...d.condition2, type:
|
|
4397
|
+
(P) => {
|
|
4398
|
+
d || (d = { ...c }), d.condition2 = { ...d.condition2, type: P };
|
|
4398
4399
|
}
|
|
4399
4400
|
);
|
|
4400
4401
|
y.appendChild(R);
|
|
@@ -4419,7 +4420,7 @@ class Io {
|
|
|
4419
4420
|
o.type = "text", o.className = "ag-filter-input", o.placeholder = this.grid.t("search"), n.appendChild(o);
|
|
4420
4421
|
const a = /* @__PURE__ */ new Set();
|
|
4421
4422
|
this.grid.getRowModel().forEachNode((C) => {
|
|
4422
|
-
!C.group && !C.footer && a.add(
|
|
4423
|
+
!C.group && !C.footer && a.add(de(e, C, this.grid.getApi()));
|
|
4423
4424
|
});
|
|
4424
4425
|
let l = [...a].sort((C, h) => C === h ? 0 : C < h ? -1 : 1);
|
|
4425
4426
|
const c = document.createElement("div");
|
|
@@ -4492,31 +4493,31 @@ class Io {
|
|
|
4492
4493
|
g.className = "ag-multi-filter-list", r.appendChild(g);
|
|
4493
4494
|
const p = () => {
|
|
4494
4495
|
g.innerHTML = "", o.forEach((R, S) => {
|
|
4495
|
-
const
|
|
4496
|
-
|
|
4496
|
+
const P = document.createElement("div");
|
|
4497
|
+
P.className = "ag-multi-filter-row";
|
|
4497
4498
|
const O = document.createElement("select");
|
|
4498
4499
|
O.className = "ag-filter-condition";
|
|
4499
|
-
const
|
|
4500
|
-
for (const
|
|
4501
|
-
const
|
|
4502
|
-
|
|
4500
|
+
const A = ["text", "number", "date", "set", "boolean"];
|
|
4501
|
+
for (const F of A) {
|
|
4502
|
+
const N = document.createElement("option");
|
|
4503
|
+
N.value = F, N.textContent = F.charAt(0).toUpperCase() + F.slice(1), F === R.filterType && (N.selected = !0), O.appendChild(N);
|
|
4503
4504
|
}
|
|
4504
4505
|
O.addEventListener("change", () => {
|
|
4505
4506
|
o[S] = { ...this.getDefaultModel(O.value) }, p();
|
|
4506
|
-
}),
|
|
4507
|
-
const j = R.filterType === "number" ? xt : St, W = this.buildConditionSelect(j, R.type || j[0], (
|
|
4508
|
-
o[S].type =
|
|
4507
|
+
}), P.appendChild(O);
|
|
4508
|
+
const j = R.filterType === "number" ? xt : St, W = this.buildConditionSelect(j, R.type || j[0], (F) => {
|
|
4509
|
+
o[S].type = F;
|
|
4509
4510
|
});
|
|
4510
|
-
if (
|
|
4511
|
-
const
|
|
4512
|
-
|
|
4513
|
-
o[S].filter =
|
|
4514
|
-
}),
|
|
4511
|
+
if (P.appendChild(W), R.filterType !== "blank" && R.type !== "blank" && R.type !== "notBlank") {
|
|
4512
|
+
const F = document.createElement("input");
|
|
4513
|
+
F.type = R.filterType === "number" ? "number" : "text", F.className = "ag-filter-input", F.value = R.filter ?? "", F.placeholder = this.grid.t("value"), F.addEventListener("input", () => {
|
|
4514
|
+
o[S].filter = F.value;
|
|
4515
|
+
}), P.appendChild(F);
|
|
4515
4516
|
}
|
|
4516
|
-
const
|
|
4517
|
-
|
|
4517
|
+
const T = document.createElement("button");
|
|
4518
|
+
T.className = "ag-button ag-button-small", T.textContent = "×", T.title = this.grid.t("removeFilter"), T.addEventListener("click", () => {
|
|
4518
4519
|
o.splice(S, 1), p();
|
|
4519
|
-
}),
|
|
4520
|
+
}), P.appendChild(T), g.appendChild(P);
|
|
4520
4521
|
});
|
|
4521
4522
|
};
|
|
4522
4523
|
p();
|
|
@@ -4547,29 +4548,29 @@ class Io {
|
|
|
4547
4548
|
const c = document.createElement("div");
|
|
4548
4549
|
c.className = "ag-advanced-filter-list", a.appendChild(c);
|
|
4549
4550
|
const d = () => [...this.grid.getColumns().left, ...this.grid.getColumns().center, ...this.grid.getColumns().right].filter((S) => S.filter), u = () => {
|
|
4550
|
-
c.innerHTML = "", n.forEach((S,
|
|
4551
|
+
c.innerHTML = "", n.forEach((S, P) => {
|
|
4551
4552
|
const O = document.createElement("div");
|
|
4552
4553
|
O.className = "ag-advanced-filter-row";
|
|
4553
|
-
const
|
|
4554
|
-
|
|
4554
|
+
const A = document.createElement("select");
|
|
4555
|
+
A.className = "ag-filter-condition";
|
|
4555
4556
|
for (const _ of d()) {
|
|
4556
4557
|
const Q = document.createElement("option");
|
|
4557
|
-
Q.value = _.colId, Q.textContent = _.headerName || _.field || _.colId, _.colId === S.colId && (Q.selected = !0),
|
|
4558
|
+
Q.value = _.colId, Q.textContent = _.headerName || _.field || _.colId, _.colId === S.colId && (Q.selected = !0), A.appendChild(Q);
|
|
4558
4559
|
}
|
|
4559
|
-
|
|
4560
|
-
n[
|
|
4561
|
-
}), O.appendChild(
|
|
4562
|
-
const j = this.grid.getColumn(S.colId), W = j && j.filter !== !1 ? String(j.filter) : "text",
|
|
4563
|
-
n[
|
|
4560
|
+
A.addEventListener("change", () => {
|
|
4561
|
+
n[P].colId = A.value;
|
|
4562
|
+
}), O.appendChild(A);
|
|
4563
|
+
const j = this.grid.getColumn(S.colId), W = j && j.filter !== !1 ? String(j.filter) : "text", T = W === "number" ? xt : St, F = this.buildConditionSelect(T, S.type || "contains", (_) => {
|
|
4564
|
+
n[P].type = _;
|
|
4564
4565
|
});
|
|
4565
|
-
O.appendChild(
|
|
4566
|
-
const
|
|
4567
|
-
|
|
4568
|
-
n[
|
|
4569
|
-
}), O.appendChild(
|
|
4566
|
+
O.appendChild(F);
|
|
4567
|
+
const N = document.createElement("input");
|
|
4568
|
+
N.type = W === "number" ? "number" : "text", N.className = "ag-filter-input", N.value = S.filter ?? "", N.placeholder = this.grid.t("value"), N.addEventListener("input", () => {
|
|
4569
|
+
n[P].filter = N.value;
|
|
4570
|
+
}), O.appendChild(N);
|
|
4570
4571
|
const z = document.createElement("button");
|
|
4571
4572
|
z.className = "ag-button ag-button-small", z.textContent = "×", z.addEventListener("click", () => {
|
|
4572
|
-
n.splice(
|
|
4573
|
+
n.splice(P, 1), u();
|
|
4573
4574
|
}), O.appendChild(z), c.appendChild(O);
|
|
4574
4575
|
});
|
|
4575
4576
|
};
|
|
@@ -4591,7 +4592,7 @@ class Io {
|
|
|
4591
4592
|
h.className = "ag-popup-buttons";
|
|
4592
4593
|
const m = document.createElement("button");
|
|
4593
4594
|
m.className = "ag-button ag-button-primary", m.textContent = this.grid.t("apply"), m.addEventListener("click", () => {
|
|
4594
|
-
const S = n.filter((
|
|
4595
|
+
const S = n.filter((P) => P.filter !== void 0 && P.filter !== "");
|
|
4595
4596
|
S.length ? t.setAdvancedFilterModel({ filterType: "advanced", operator: o, conditions: S }) : t.setAdvancedFilterModel(null), r();
|
|
4596
4597
|
});
|
|
4597
4598
|
const y = document.createElement("button");
|
|
@@ -4909,7 +4910,7 @@ class Ao {
|
|
|
4909
4910
|
if (c.length === 0) break;
|
|
4910
4911
|
const d = i.getSelectedNodes().filter((f) => !f.group && !f.footer), u = [];
|
|
4911
4912
|
for (const f of c) {
|
|
4912
|
-
const p = d.map((y) =>
|
|
4913
|
+
const p = d.map((y) => de(f, y, i)).filter((y) => typeof y == "number" && !isNaN(y)), C = p.reduce((y, E) => y + E, 0), h = (y) => y === null ? "" : Je(y, f.decimals), m = [
|
|
4913
4914
|
[this.grid.translate("average", "Average"), p.length ? C / p.length : null],
|
|
4914
4915
|
[this.grid.translate("count", "Count"), p.length],
|
|
4915
4916
|
[this.grid.translate("min", "Min"), p.length ? Math.min(...p) : null],
|
|
@@ -5229,7 +5230,7 @@ class Po {
|
|
|
5229
5230
|
this.grid.getRowModel().forEachNode((i, n) => {
|
|
5230
5231
|
if (!(i.group || i.footer))
|
|
5231
5232
|
for (const o of t) {
|
|
5232
|
-
|
|
5233
|
+
de(o, i, this.grid.getApi());
|
|
5233
5234
|
const a = Ut(o, i, this.grid.getApi()) ?? "", r = this.matchCase ? a : a.toLowerCase(), l = this.matchCase ? e : e.toLowerCase();
|
|
5234
5235
|
r.includes(l) && this.matches.push({ rowIndex: n, colId: o.colId });
|
|
5235
5236
|
}
|
|
@@ -5427,7 +5428,7 @@ class $o {
|
|
|
5427
5428
|
function Bi(s) {
|
|
5428
5429
|
return String(s).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
5429
5430
|
}
|
|
5430
|
-
const
|
|
5431
|
+
const ot = ["#3ba1ff", "#47cf7c", "#ffb700", "#ff6b6b", "#a86dd7", "#00c2c7"];
|
|
5431
5432
|
class Go {
|
|
5432
5433
|
constructor(e, t) {
|
|
5433
5434
|
v(this, "charts", /* @__PURE__ */ new Map());
|
|
@@ -5448,7 +5449,7 @@ class Go {
|
|
|
5448
5449
|
((c, d) => {
|
|
5449
5450
|
for (const u of c)
|
|
5450
5451
|
if (u.group) {
|
|
5451
|
-
const f = i[0] ? String(
|
|
5452
|
+
const f = i[0] ? String(de(i[0], u, this.grid.getApi()) ?? "") : u.key ?? "";
|
|
5452
5453
|
a.push(f);
|
|
5453
5454
|
for (let g = 0; g < o.length; g++) {
|
|
5454
5455
|
const p = [];
|
|
@@ -5458,10 +5459,10 @@ class Go {
|
|
|
5458
5459
|
})(this.grid.getRowModel().getTopLevelRows());
|
|
5459
5460
|
else if (n || (n = this.grid.getColumns().center.find((l) => l.field && l.type !== "numberColumn") || this.grid.getColumns().center[0]), this.grid.getRowModel().forEachNode((l) => {
|
|
5460
5461
|
if (l.group || l.footer) return;
|
|
5461
|
-
const c = n ?
|
|
5462
|
+
const c = n ? de(n, l, this.grid.getApi()) : "";
|
|
5462
5463
|
a.push(String(c ?? ""));
|
|
5463
5464
|
for (let d = 0; d < o.length; d++) {
|
|
5464
|
-
const u =
|
|
5465
|
+
const u = de(o[d], l, this.grid.getApi());
|
|
5465
5466
|
r[d].push(typeof u == "number" ? u : Number(u) || 0);
|
|
5466
5467
|
}
|
|
5467
5468
|
}), a.length > 200) {
|
|
@@ -5682,11 +5683,11 @@ class Go {
|
|
|
5682
5683
|
const r = getComputedStyle(this.grid.getRootElement()), l = r.getPropertyValue("--ag-chart-text-color") || "#666", c = r.getPropertyValue("--ag-border-color") || "rgba(128,128,128,0.25)", d = { top: 20, right: 20, bottom: 34, left: 56 }, u = o - d.left - d.right, f = a - d.top - d.bottom;
|
|
5683
5684
|
i.font = "11px sans-serif", i.fillStyle = l, i.strokeStyle = c, i.lineWidth = 1;
|
|
5684
5685
|
const g = (j = e.canvas.parentElement) == null ? void 0 : j.querySelector(".ag-chart-legend");
|
|
5685
|
-
if (g && (g.innerHTML = "", e.data.series.forEach((W,
|
|
5686
|
-
const
|
|
5687
|
-
|
|
5688
|
-
const
|
|
5689
|
-
|
|
5686
|
+
if (g && (g.innerHTML = "", e.data.series.forEach((W, T) => {
|
|
5687
|
+
const F = document.createElement("span");
|
|
5688
|
+
F.className = "ag-chart-legend-item";
|
|
5689
|
+
const N = document.createElement("span");
|
|
5690
|
+
N.className = "ag-chart-legend-swatch", N.style.backgroundColor = ot[T % ot.length], F.appendChild(N), F.appendChild(document.createTextNode(W.title)), g.appendChild(F);
|
|
5690
5691
|
})), e.type === "pie") {
|
|
5691
5692
|
this.renderPie(i, e.data, o, a, l);
|
|
5692
5693
|
return;
|
|
@@ -5699,51 +5700,51 @@ class Go {
|
|
|
5699
5700
|
const y = C - h || 1, E = (W) => d.top + f - (W - h) / y * f, R = 5;
|
|
5700
5701
|
i.textAlign = "right", i.textBaseline = "middle";
|
|
5701
5702
|
for (let W = 0; W <= R; W++) {
|
|
5702
|
-
const
|
|
5703
|
-
i.beginPath(), i.moveTo(d.left,
|
|
5703
|
+
const T = h + y * W / R, F = E(T);
|
|
5704
|
+
i.beginPath(), i.moveTo(d.left, F), i.lineTo(o - d.right, F), i.stroke(), i.fillText(this.formatTick(T), d.left - 6, F);
|
|
5704
5705
|
}
|
|
5705
|
-
const S = e.data.categories,
|
|
5706
|
-
if (
|
|
5707
|
-
i.textAlign = "left", S.forEach((
|
|
5708
|
-
const
|
|
5706
|
+
const S = e.data.categories, P = e.type === "bar", O = Math.max(1, S.length), A = (P ? f : u) / O;
|
|
5707
|
+
if (P) {
|
|
5708
|
+
i.textAlign = "left", S.forEach((T, F) => {
|
|
5709
|
+
const N = d.top + F * A, z = Math.max(2, A * 0.7 / e.data.series.length);
|
|
5709
5710
|
e.data.series.forEach((_, Q) => {
|
|
5710
|
-
const
|
|
5711
|
-
i.fillStyle =
|
|
5712
|
-
}), i.fillStyle = l, i.fillText(this.truncate(
|
|
5711
|
+
const ie = _.data[F] || 0, U = Math.abs(ie) / y * u, $ = d.left + (0 - h) / y * u;
|
|
5712
|
+
i.fillStyle = ot[Q % ot.length], i.fillRect($, N + Q * z, Math.max(1, U), z - 1);
|
|
5713
|
+
}), i.fillStyle = l, i.fillText(this.truncate(T, 18), d.left + 4, N + A / 2);
|
|
5713
5714
|
});
|
|
5714
5715
|
const W = d.left + (0 - h) / y * u;
|
|
5715
5716
|
i.beginPath(), i.moveTo(W, d.top), i.lineTo(W, d.top + f), i.strokeStyle = l, i.stroke();
|
|
5716
5717
|
} else {
|
|
5717
5718
|
const W = Math.max(1, Math.ceil(O / 12));
|
|
5718
|
-
i.textAlign = "center", i.textBaseline = "top", S.forEach((
|
|
5719
|
+
i.textAlign = "center", i.textBaseline = "top", S.forEach((N, z) => {
|
|
5719
5720
|
if (z % W !== 0) return;
|
|
5720
|
-
const _ = d.left +
|
|
5721
|
-
i.fillStyle = l, i.fillText(this.truncate(
|
|
5721
|
+
const _ = d.left + A * (z + 0.5);
|
|
5722
|
+
i.fillStyle = l, i.fillText(this.truncate(N, 10), _, d.top + f + 6);
|
|
5722
5723
|
});
|
|
5723
|
-
const
|
|
5724
|
-
e.data.series.forEach((
|
|
5725
|
-
const _ =
|
|
5724
|
+
const T = e.data.series.length, F = Math.max(1, A * 0.7 / Math.max(1, T));
|
|
5725
|
+
e.data.series.forEach((N, z) => {
|
|
5726
|
+
const _ = ot[z % ot.length];
|
|
5726
5727
|
if (e.type === "column")
|
|
5727
|
-
i.fillStyle = _,
|
|
5728
|
-
const U = d.left +
|
|
5729
|
-
i.fillRect(U, F
|
|
5728
|
+
i.fillStyle = _, N.data.forEach((Q, ie) => {
|
|
5729
|
+
const U = d.left + A * ie + (A - F * T) / 2 + z * F, $ = E(Q);
|
|
5730
|
+
i.fillRect(U, $, F - 1, d.top + f - $);
|
|
5730
5731
|
});
|
|
5731
5732
|
else if (e.type === "area") {
|
|
5732
|
-
i.beginPath(),
|
|
5733
|
-
const
|
|
5734
|
-
U === 0 ? i.moveTo(
|
|
5733
|
+
i.beginPath(), N.data.forEach((ie, U) => {
|
|
5734
|
+
const $ = d.left + A * (U + 0.5), q = E(ie);
|
|
5735
|
+
U === 0 ? i.moveTo($, q) : i.lineTo($, q);
|
|
5735
5736
|
});
|
|
5736
|
-
const Q = d.left +
|
|
5737
|
-
i.lineTo(Q, d.top + f), i.lineTo(d.left +
|
|
5738
|
-
const
|
|
5739
|
-
U === 0 ? i.moveTo(
|
|
5737
|
+
const Q = d.left + A * (N.data.length - 0.5);
|
|
5738
|
+
i.lineTo(Q, d.top + f), i.lineTo(d.left + A * 0.5, d.top + f), i.closePath(), i.globalAlpha = 0.25, i.fillStyle = _, i.fill(), i.globalAlpha = 1, i.beginPath(), N.data.forEach((ie, U) => {
|
|
5739
|
+
const $ = d.left + A * (U + 0.5), q = E(ie);
|
|
5740
|
+
U === 0 ? i.moveTo($, q) : i.lineTo($, q);
|
|
5740
5741
|
}), i.strokeStyle = _, i.lineWidth = 2, i.stroke();
|
|
5741
|
-
} else e.type === "scatter" ? (i.fillStyle = _,
|
|
5742
|
-
const U = d.left +
|
|
5743
|
-
i.beginPath(), i.arc(U,
|
|
5744
|
-
})) : (i.beginPath(),
|
|
5745
|
-
const U = d.left +
|
|
5746
|
-
|
|
5742
|
+
} else e.type === "scatter" ? (i.fillStyle = _, N.data.forEach((Q, ie) => {
|
|
5743
|
+
const U = d.left + A * (ie + 0.5), $ = E(Q);
|
|
5744
|
+
i.beginPath(), i.arc(U, $, 3, 0, Math.PI * 2), i.fill();
|
|
5745
|
+
})) : (i.beginPath(), N.data.forEach((Q, ie) => {
|
|
5746
|
+
const U = d.left + A * (ie + 0.5), $ = E(Q);
|
|
5747
|
+
ie === 0 ? i.moveTo(U, $) : i.lineTo(U, $);
|
|
5747
5748
|
}), i.strokeStyle = _, i.lineWidth = 2, i.stroke());
|
|
5748
5749
|
});
|
|
5749
5750
|
}
|
|
@@ -5755,7 +5756,7 @@ class Go {
|
|
|
5755
5756
|
let u = -Math.PI / 2;
|
|
5756
5757
|
a.data.forEach((f, g) => {
|
|
5757
5758
|
const p = Math.abs(f) / r * Math.PI * 2;
|
|
5758
|
-
e.beginPath(), e.moveTo(l, c), e.arc(l, c, d, u, u + p), e.closePath(), e.fillStyle =
|
|
5759
|
+
e.beginPath(), e.moveTo(l, c), e.arc(l, c, d, u, u + p), e.closePath(), e.fillStyle = ot[g % ot.length], e.fill();
|
|
5759
5760
|
const C = u + p / 2, h = l + Math.cos(C) * (d * 0.7), m = c + Math.sin(C) * (d * 0.7), y = Math.round(Math.abs(f) / r * 100);
|
|
5760
5761
|
y >= 5 && (e.fillStyle = "#fff", e.font = "bold 11px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText(`${y}%`, h, m)), u += p;
|
|
5761
5762
|
}), e.fillStyle = o;
|
|
@@ -5776,7 +5777,7 @@ class Go {
|
|
|
5776
5777
|
function gn(s, e, t) {
|
|
5777
5778
|
const i = s.children;
|
|
5778
5779
|
if (!i || i.length === 0) {
|
|
5779
|
-
const n =
|
|
5780
|
+
const n = de(e, s, null);
|
|
5780
5781
|
typeof n == "number" && !isNaN(n) && t.push(n);
|
|
5781
5782
|
return;
|
|
5782
5783
|
}
|
|
@@ -5927,33 +5928,33 @@ function Xo(s, e = {}) {
|
|
|
5927
5928
|
const f = u("<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>"), g = u("<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica-Bold >>"), p = [];
|
|
5928
5929
|
for (const y of s) {
|
|
5929
5930
|
let E = "";
|
|
5930
|
-
const R = y.columnWidths.reduce((
|
|
5931
|
-
let
|
|
5932
|
-
e.title && (E += `BT /F2 ${o + 4} Tf ${O} ${
|
|
5933
|
-
`,
|
|
5931
|
+
const R = y.columnWidths.reduce((N, z) => N + z, 0), S = Math.min(1, (t - n * 2) / (R || 1)), P = y.columnWidths.map((N) => N * S), O = n;
|
|
5932
|
+
let A = i - n - (e.title ? 24 : 0);
|
|
5933
|
+
e.title && (E += `BT /F2 ${o + 4} Tf ${O} ${A} Td (${Oi(e.title)}) Tj ET
|
|
5934
|
+
`, A -= 18), y.rows.forEach((N, z) => {
|
|
5934
5935
|
var U;
|
|
5935
5936
|
const _ = z === 0, Q = ((U = y.rowFill) == null ? void 0 : U[z]) ?? (_ ? r : void 0);
|
|
5936
|
-
Q && (E += `${Q[0]} ${Q[1]} ${Q[2]} rg ${O} ${(
|
|
5937
|
+
Q && (E += `${Q[0]} ${Q[1]} ${Q[2]} rg ${O} ${(A - a + 4).toFixed(2)} ${R * S} ${a} re f
|
|
5937
5938
|
`);
|
|
5938
|
-
let
|
|
5939
|
-
|
|
5940
|
-
const Z =
|
|
5941
|
-
let
|
|
5942
|
-
|
|
5943
|
-
`,
|
|
5944
|
-
}), E += `${l[0]} ${l[1]} ${l[2]} RG 0.5 w ${O} ${(
|
|
5945
|
-
`,
|
|
5939
|
+
let ie = O;
|
|
5940
|
+
N.forEach(($, q) => {
|
|
5941
|
+
const Z = P[q] ?? 0, te = Oi(Ko($.text ?? "", Z - 6, o)), Ce = $.bold || _ ? g : f, fe = ($.text ?? "").length * o * 0.5;
|
|
5942
|
+
let ce = ie + 3;
|
|
5943
|
+
$.align === "right" || !$.align && q > 0 && /^-?[\d,.%$£€\s]+$/.test($.text ?? "") ? ce = ie + Z - 3 - Math.min(fe, Z - 6) : $.align === "center" && (ce = ie + (Z - Math.min(fe, Z - 6)) / 2), E += `BT /F${Ce === g ? 2 : 1} ${o} Tf ${ce.toFixed(2)} ${(A - o + 2).toFixed(2)} Td (${te}) Tj ET
|
|
5944
|
+
`, ie += Z;
|
|
5945
|
+
}), E += `${l[0]} ${l[1]} ${l[2]} RG 0.5 w ${O} ${(A - a + 4).toFixed(2)} m ${(O + R * S).toFixed(2)} ${(A - a + 4).toFixed(2)} l S
|
|
5946
|
+
`, A -= a;
|
|
5946
5947
|
});
|
|
5947
5948
|
const j = y.rows.length * a;
|
|
5948
|
-
E += `${l[0]} ${l[1]} ${l[2]} RG 0.5 w ${O} ${(
|
|
5949
|
+
E += `${l[0]} ${l[1]} ${l[2]} RG 0.5 w ${O} ${(A + a - 4).toFixed(2)} m ${O} ${(A + j + a - 4).toFixed(2)} l ${(O + R * S).toFixed(2)} ${(A + j + a - 4).toFixed(2)} l ${(O + R * S).toFixed(2)} ${(A + a - 4).toFixed(2)} l S
|
|
5949
5950
|
`;
|
|
5950
|
-
const W = c.encode(E),
|
|
5951
|
+
const W = c.encode(E), T = u(`<< /Length ${W.length} >>
|
|
5951
5952
|
stream
|
|
5952
5953
|
${E}
|
|
5953
|
-
endstream`),
|
|
5954
|
-
`<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${t} ${i}] /Resources << /Font << /F1 ${f} 0 R /F2 ${g} 0 R >> >> /Contents ${
|
|
5954
|
+
endstream`), F = u(
|
|
5955
|
+
`<< /Type /Page /Parent 2 0 R /MediaBox [0 0 ${t} ${i}] /Resources << /Font << /F1 ${f} 0 R /F2 ${g} 0 R >> >> /Contents ${T} 0 R >>`
|
|
5955
5956
|
);
|
|
5956
|
-
p.push(
|
|
5957
|
+
p.push(F);
|
|
5957
5958
|
}
|
|
5958
5959
|
d[0] = "<< /Type /Catalog /Pages 2 0 R >>", d[1] = `<< /Type /Pages /Kids [${p.map((y) => `${y} 0 R`).join(" ")}] /Count ${p.length} >>`;
|
|
5959
5960
|
let C = `%PDF-1.4
|
|
@@ -5984,7 +5985,7 @@ ${m}
|
|
|
5984
5985
|
function ft(s, e) {
|
|
5985
5986
|
return s.getUint32(e, !0);
|
|
5986
5987
|
}
|
|
5987
|
-
function
|
|
5988
|
+
function ht(s, e) {
|
|
5988
5989
|
return s.getUint16(e, !0);
|
|
5989
5990
|
}
|
|
5990
5991
|
async function Yo(s) {
|
|
@@ -6005,17 +6006,17 @@ function Qo(s) {
|
|
|
6005
6006
|
break;
|
|
6006
6007
|
}
|
|
6007
6008
|
if (i < 0) throw new Error("Not a valid XLSX (ZIP) file");
|
|
6008
|
-
const n =
|
|
6009
|
+
const n = ht(e, i + 10);
|
|
6009
6010
|
let o = ft(e, i + 16);
|
|
6010
6011
|
const a = [];
|
|
6011
6012
|
for (let r = 0; r < n && ft(e, o) === 33639248; r++) {
|
|
6012
|
-
const l =
|
|
6013
|
+
const l = ht(e, o + 10), c = ft(e, o + 20), d = ft(e, o + 24), u = ht(e, o + 28), f = ht(e, o + 30), g = ht(e, o + 32), p = ft(e, o + 42), C = new TextDecoder().decode(t.subarray(o + 46, o + 46 + u));
|
|
6013
6014
|
a.push({ name: C, compressionMethod: l, compressedSize: c, uncompressedSize: d, localHeaderOffset: p }), o += 46 + u + f + g;
|
|
6014
6015
|
}
|
|
6015
6016
|
return a;
|
|
6016
6017
|
}
|
|
6017
6018
|
async function Qt(s, e) {
|
|
6018
|
-
const t = new DataView(s), i = new Uint8Array(s), n =
|
|
6019
|
+
const t = new DataView(s), i = new Uint8Array(s), n = ht(t, e.localHeaderOffset + 26), o = ht(t, e.localHeaderOffset + 28), a = e.localHeaderOffset + 30 + n + o, r = i.subarray(a, a + e.compressedSize);
|
|
6019
6020
|
return e.compressionMethod === 0 ? r : Yo(r);
|
|
6020
6021
|
}
|
|
6021
6022
|
function Jt(s) {
|
|
@@ -6054,17 +6055,17 @@ async function Zo(s) {
|
|
|
6054
6055
|
const y = h[m], E = y.getAttribute("r") || "", R = y.getAttribute("t") || "";
|
|
6055
6056
|
let S = "";
|
|
6056
6057
|
if (R === "s") {
|
|
6057
|
-
const O = y.getElementsByTagName("v")[0],
|
|
6058
|
-
S = n[
|
|
6058
|
+
const O = y.getElementsByTagName("v")[0], A = Number((O == null ? void 0 : O.textContent) || "0");
|
|
6059
|
+
S = n[A] ?? "";
|
|
6059
6060
|
} else if (R === "inlineStr") {
|
|
6060
6061
|
const O = y.getElementsByTagName("t");
|
|
6061
|
-
for (let
|
|
6062
|
+
for (let A = 0; A < O.length; A++) S += O[A].textContent || "";
|
|
6062
6063
|
} else {
|
|
6063
6064
|
const O = y.getElementsByTagName("v")[0];
|
|
6064
6065
|
S = (O == null ? void 0 : O.textContent) ?? "";
|
|
6065
6066
|
}
|
|
6066
|
-
const
|
|
6067
|
-
C[
|
|
6067
|
+
const P = E ? Jo(E) : m;
|
|
6068
|
+
C[P] = S;
|
|
6068
6069
|
}
|
|
6069
6070
|
f.push(C.map((m) => m ?? ""));
|
|
6070
6071
|
}
|
|
@@ -6092,7 +6093,7 @@ class es {
|
|
|
6092
6093
|
}), n && i.length === 0 ? this.getExportRows({ ...e, onlySelected: !1 }) : i;
|
|
6093
6094
|
}
|
|
6094
6095
|
getCellValueForExport(e, t, i) {
|
|
6095
|
-
let n =
|
|
6096
|
+
let n = de(e, t, this.grid.getApi()), o = Ut(e, t, this.grid.getApi());
|
|
6096
6097
|
if (i.processCellCallback) {
|
|
6097
6098
|
const a = i.processCellCallback({
|
|
6098
6099
|
value: n,
|
|
@@ -6141,7 +6142,7 @@ class es {
|
|
|
6141
6142
|
for (const o of i)
|
|
6142
6143
|
n.push(
|
|
6143
6144
|
t.map((a) => {
|
|
6144
|
-
let r =
|
|
6145
|
+
let r = de(a, o, this.grid.getApi());
|
|
6145
6146
|
return o.footer && o.groupData && o.groupData[a.colId] !== void 0 && (r = o.groupData[a.colId]), o.group && o.groupData && o.groupData[a.colId] !== void 0 && (r = o.groupData[a.colId]), r instanceof Date && (r = r.toISOString().slice(0, 10)), { value: r };
|
|
6146
6147
|
})
|
|
6147
6148
|
);
|
|
@@ -6171,7 +6172,7 @@ class es {
|
|
|
6171
6172
|
t.map((h) => {
|
|
6172
6173
|
let m = this.getCellValueForExport(h, C, e);
|
|
6173
6174
|
if (e.processCellCallback) {
|
|
6174
|
-
const y = e.processCellCallback({ value:
|
|
6175
|
+
const y = e.processCellCallback({ value: de(h, C, this.grid.getApi()), formattedValue: m, node: C, column: h, api: this.grid.getApi() });
|
|
6175
6176
|
y != null && (m = String(y));
|
|
6176
6177
|
}
|
|
6177
6178
|
return {
|
|
@@ -6619,7 +6620,7 @@ function as(s) {
|
|
|
6619
6620
|
getValue: (i, n) => {
|
|
6620
6621
|
const o = typeof i == "string" ? s.getColumn(i) : i;
|
|
6621
6622
|
if (!(!o || !n))
|
|
6622
|
-
return
|
|
6623
|
+
return de(o, n, s.getApi());
|
|
6623
6624
|
},
|
|
6624
6625
|
// ---- selection ----
|
|
6625
6626
|
getSelectedRows: () => s.getSelectionService().getSelectedRows(),
|
|
@@ -7119,7 +7120,7 @@ class Kt {
|
|
|
7119
7120
|
(C = this.serverSideRowModel) == null || C.onViewportChanged(g, p), (h = this.infiniteRowModel) == null || h.onViewportChanged(g, p), (m = this.viewportRowModel) == null || m.onViewportChanged(g, p);
|
|
7120
7121
|
},
|
|
7121
7122
|
getCellText: (g, p) => {
|
|
7122
|
-
const C =
|
|
7123
|
+
const C = de(g, p, this.api);
|
|
7123
7124
|
return C == null ? "" : String(C);
|
|
7124
7125
|
},
|
|
7125
7126
|
renderDetailRow: (g) => this.renderDetailRow(g),
|
|
@@ -7247,7 +7248,7 @@ class Kt {
|
|
|
7247
7248
|
const o = /* @__PURE__ */ new Map();
|
|
7248
7249
|
(n = (i = this.rowModel).forEachLeafNode) == null || n.call(i, (a) => {
|
|
7249
7250
|
for (const r of t) {
|
|
7250
|
-
const l =
|
|
7251
|
+
const l = de(r, a, this.api);
|
|
7251
7252
|
typeof l == "number" && !isNaN(l) && o.set(r.colId, (o.get(r.colId) ?? 0) + l);
|
|
7252
7253
|
}
|
|
7253
7254
|
});
|
|
@@ -7347,10 +7348,10 @@ class Kt {
|
|
|
7347
7348
|
return this.selectionService.syncWithModel(), this.overlayService.updateAuto(), this.statusBarService.update(), (i = this.paginationService) == null || i.update(), this.chartService.refreshCharts(), this.eventService.dispatchEvent("rowDataUpdated", { api: this.api }), t;
|
|
7348
7349
|
}
|
|
7349
7350
|
setCellValue(e, t, i, n = "api", o) {
|
|
7350
|
-
const a = o !== void 0 ? o :
|
|
7351
|
+
const a = o !== void 0 ? o : de(e, t, this.api);
|
|
7351
7352
|
if (e.valueSetter) {
|
|
7352
7353
|
if (e.valueSetter({
|
|
7353
|
-
oldValue:
|
|
7354
|
+
oldValue: de(e, t, this.api),
|
|
7354
7355
|
newValue: i,
|
|
7355
7356
|
data: t.data,
|
|
7356
7357
|
node: t,
|
|
@@ -7402,7 +7403,7 @@ class Kt {
|
|
|
7402
7403
|
var a, r, l, c;
|
|
7403
7404
|
const { node: t, column: i, event: n } = e;
|
|
7404
7405
|
if (this.options.enableRangeSelection, i.checkboxSelection) {
|
|
7405
|
-
this.selectionService.toggleNode(t), this.rowRenderer.refreshCells({ rowNodes: [t] }), (r = (a = this.options).onCellClicked) == null || r.call(a, { ...e, api: this.api, colDef: i.colDef, value:
|
|
7406
|
+
this.selectionService.toggleNode(t), this.rowRenderer.refreshCells({ rowNodes: [t] }), (r = (a = this.options).onCellClicked) == null || r.call(a, { ...e, api: this.api, colDef: i.colDef, value: de(i, t, this.api) });
|
|
7406
7407
|
return;
|
|
7407
7408
|
}
|
|
7408
7409
|
if (n.target.closest(".ag-group-value-expanded-icon")) {
|
|
@@ -7413,7 +7414,7 @@ class Kt {
|
|
|
7413
7414
|
...e,
|
|
7414
7415
|
api: this.api,
|
|
7415
7416
|
colDef: i.colDef,
|
|
7416
|
-
value:
|
|
7417
|
+
value: de(i, t, this.api)
|
|
7417
7418
|
});
|
|
7418
7419
|
}
|
|
7419
7420
|
onCellMouseDown(e) {
|
|
@@ -7499,6 +7500,10 @@ class Kt {
|
|
|
7499
7500
|
var e, t, i, n, o, a, r;
|
|
7500
7501
|
this.updateColumnTotalCache(), this.rowRenderer.refreshRows(), this.options.__loadingRows = this.isRemoteLoading(), this.overlayService.updateAuto(), this.statusBarService.update(), (e = this.paginationService) == null || e.update(), this.rangeSelectionService.applyHighlight(), this.findService.applyHighlight(), this.chartService.refreshCharts(), this.gridReadyDispatched || (this.gridReadyDispatched = !0, this.eventService.dispatchEvent("firstDataRendered", { api: this.api }), (i = (t = this.options).onFirstDataRendered) == null || i.call(t, { api: this.api })), (o = (n = this.options).onModelUpdated) == null || o.call(n, { api: this.api }), (r = (a = this.options).onRowDataChanged) == null || r.call(a, { api: this.api });
|
|
7501
7502
|
}
|
|
7503
|
+
/** Synchronize an external horizontal scrollbar with body and header immediately. */
|
|
7504
|
+
setHorizontalScrollLeft(e) {
|
|
7505
|
+
this.rowRenderer.setHorizontalScrollLeft(e);
|
|
7506
|
+
}
|
|
7502
7507
|
onGridSizeChanged() {
|
|
7503
7508
|
var o, a, r;
|
|
7504
7509
|
if (this.destroyed) return;
|
|
@@ -7614,7 +7619,7 @@ const ds = ["day", "week", "biweek", "month", "bimonth", "quarter", "halfyear",
|
|
|
7614
7619
|
month: "月",
|
|
7615
7620
|
quarter: "季度",
|
|
7616
7621
|
year: "年"
|
|
7617
|
-
}, us = { day: 26, week: 26, biweek: 26, month: 26, bimonth: 13, quarter: 8.7, halfyear: 4.3, year: 2.2 },
|
|
7622
|
+
}, us = { day: 26, week: 26, biweek: 26, month: 26, bimonth: 13, quarter: 8.7, halfyear: 4.3, year: 2.2 }, Ee = {
|
|
7618
7623
|
accent: "#4555e5",
|
|
7619
7624
|
text: "#1f2329",
|
|
7620
7625
|
textTertiary: "#8f959e",
|
|
@@ -7926,16 +7931,16 @@ class fs {
|
|
|
7926
7931
|
const y = Math.max(0, Math.min(h + m, n) - Math.max(0, h));
|
|
7927
7932
|
if (this.unit === "day" || this.unit === "week") {
|
|
7928
7933
|
const S = C.start.getDay();
|
|
7929
|
-
(S === 0 || S === 6) && (i.fillStyle =
|
|
7934
|
+
(S === 0 || S === 6) && (i.fillStyle = Ee.weekend, i.fillRect(Math.max(0, h), f, y, g));
|
|
7930
7935
|
}
|
|
7931
7936
|
const E = i.measureText(C.primary).width;
|
|
7932
7937
|
if (E + 8 < y) {
|
|
7933
|
-
const S = Math.max(0, h) + y / 2 - E / 2,
|
|
7934
|
-
i.fillStyle =
|
|
7938
|
+
const S = Math.max(0, h) + y / 2 - E / 2, P = f + g / 2 + 5;
|
|
7939
|
+
i.fillStyle = Ee.text, i.font = "11px " + Ye, i.textAlign = "left", i.textBaseline = "alphabetic", i.fillText(C.primary, S, P), C.secondary && (i.fillStyle = Ee.textTertiary, i.font = "10px " + Ye, i.fillText(C.secondary, S, P + 12));
|
|
7935
7940
|
}
|
|
7936
7941
|
}
|
|
7937
7942
|
}, c = 40, d = De(this.epochStart, Math.floor(a / e));
|
|
7938
|
-
i.fillStyle =
|
|
7943
|
+
i.fillStyle = Ee.text, i.font = "14px " + Ye, i.textAlign = "left", i.textBaseline = "middle", i.fillText(this.unit === "day" || this.unit === "week" || this.unit === "biweek" ? `${d.getFullYear()}年${d.getMonth() + 1}月` : `${d.getFullYear()} 年`, 16, 22), l(zi(this.unit, this.epochStart, r), c + 1, o - c - 1), i.strokeStyle = Ee.border, i.beginPath(), i.moveTo(0, o - 0.5), i.lineTo(n, o - 0.5), i.stroke();
|
|
7939
7944
|
}
|
|
7940
7945
|
drawBody(e, t, i, n) {
|
|
7941
7946
|
const o = this.ctx, a = this.eScroll.clientWidth, r = this.eScroll.clientHeight, l = this.eScroll.scrollLeft, c = this.eScroll.scrollTop;
|
|
@@ -7943,14 +7948,14 @@ class fs {
|
|
|
7943
7948
|
const d = this.rows.findIndex((f) => f.id === this.hoverId), u = this.hoverId ? this.tasksById.get(this.hoverId) : null;
|
|
7944
7949
|
if (d >= 0 && (u == null ? void 0 : u.kind) === "task" && !u.start) {
|
|
7945
7950
|
const f = d * n + 6;
|
|
7946
|
-
o.fillStyle = "#fff", o.strokeStyle = "#dee0e3", o.lineWidth = 1, mt(o, l + 4, f, Math.max(0, a - 8), 28, 4), o.fill(), o.stroke(), o.fillStyle =
|
|
7951
|
+
o.fillStyle = "#fff", o.strokeStyle = "#dee0e3", o.lineWidth = 1, mt(o, l + 4, f, Math.max(0, a - 8), 28, 4), o.fill(), o.stroke(), o.fillStyle = Ee.textTertiary, o.font = "14px " + Ye, o.textAlign = "center", o.fillText("新建排期", l + a / 2, f + 19);
|
|
7947
7952
|
}
|
|
7948
7953
|
this.drawDependencies(n), this.drawBars(n), this.drawTodayLine(t, Math.max(i, c + r)), o.restore(), this.drawTodayLabel(), this.drawLocateButtons(), this.updateRulerTools();
|
|
7949
7954
|
}
|
|
7950
7955
|
drawWeekends(e, t, i) {
|
|
7951
7956
|
if (this.unit !== "day" && this.unit !== "week") return;
|
|
7952
7957
|
const n = this.ctx;
|
|
7953
|
-
n.fillStyle =
|
|
7958
|
+
n.fillStyle = Ee.weekend;
|
|
7954
7959
|
let o = di(this.epochStart);
|
|
7955
7960
|
for (; qe(this.epochStart, o) < this.totalDays; ) {
|
|
7956
7961
|
const a = this.dateX(Xe(o)) + 5 * e;
|
|
@@ -7963,31 +7968,31 @@ class fs {
|
|
|
7963
7968
|
const r = Math.round(this.dateX(Xe(a.start))) + 0.5;
|
|
7964
7969
|
if (r < 0 || r > t) continue;
|
|
7965
7970
|
const l = this.unit === "day" && a.start.getDate() === 1;
|
|
7966
|
-
n.strokeStyle = l ?
|
|
7971
|
+
n.strokeStyle = l ? Ee.gridlineMonth : Ee.gridline, n.beginPath(), n.moveTo(r, 0), n.lineTo(r, i), n.stroke();
|
|
7967
7972
|
}
|
|
7968
7973
|
}
|
|
7969
7974
|
drawRowBackgrounds(e, t) {
|
|
7970
7975
|
const i = this.ctx;
|
|
7971
|
-
i.strokeStyle =
|
|
7976
|
+
i.strokeStyle = Ee.rowLine, i.lineWidth = 1, i.beginPath();
|
|
7972
7977
|
for (let n = 1; n < this.rows.length; n++) {
|
|
7973
7978
|
const o = Math.round(n * t) + 0.5;
|
|
7974
7979
|
i.moveTo(0, o), i.lineTo(e, o);
|
|
7975
7980
|
}
|
|
7976
7981
|
i.stroke(), this.rows.forEach((n, o) => {
|
|
7977
7982
|
const a = this.selectedId === n.id, r = this.hoverId === n.id;
|
|
7978
|
-
(a || r) && (i.fillStyle = a ?
|
|
7983
|
+
(a || r) && (i.fillStyle = a ? Ee.selected : r ? Ee.hover : Ee.groupRow, i.fillRect(0, o * t, e, t));
|
|
7979
7984
|
});
|
|
7980
7985
|
}
|
|
7981
7986
|
drawTodayLine(e, t) {
|
|
7982
7987
|
const i = this.ctx, n = Math.round(this.dateX(Rt()) + this.dayWidth / 2) + 0.5;
|
|
7983
|
-
n < 0 || n > e || (i.strokeStyle =
|
|
7988
|
+
n < 0 || n > e || (i.strokeStyle = Ee.accent, i.lineWidth = 1.5, i.beginPath(), i.moveTo(n, 0), i.lineTo(n, t), i.stroke(), this.todayLabelX = n - this.eScroll.scrollLeft);
|
|
7984
7989
|
}
|
|
7985
7990
|
drawTodayLabel() {
|
|
7986
7991
|
this.eTodayBadge.hidden = this.todayLabelX < 0 || this.todayLabelX > this.eScroll.clientWidth, this.eTodayBadge.textContent = Rt().slice(5), this.eTodayBadge.style.left = `${this.todayLabelX - 25}px`, this.eTodayBadge.style.top = `${this.eHeader.clientHeight - 10}px`;
|
|
7987
7992
|
}
|
|
7988
7993
|
drawDependencies(e) {
|
|
7989
7994
|
const t = new Map(this.rows.map((n, o) => [n.id, o])), i = this.ctx;
|
|
7990
|
-
i.strokeStyle =
|
|
7995
|
+
i.strokeStyle = Ee.accent, i.lineWidth = 1.2;
|
|
7991
7996
|
for (const n of this.rows) {
|
|
7992
7997
|
const o = this.tasksById.get(n.id);
|
|
7993
7998
|
if (!o || o.kind !== "task" || !o.start || !o.end) continue;
|
|
@@ -8026,14 +8031,14 @@ class fs {
|
|
|
8026
8031
|
drawTaskBar(e, t, i) {
|
|
8027
8032
|
var g;
|
|
8028
8033
|
const n = this.ctx, o = ((g = this.ghost) == null ? void 0 : g.id) === e.id ? this.ghost : null, a = (o == null ? void 0 : o.start) ?? e.start, r = (o == null ? void 0 : o.end) ?? e.end, l = this.dateX(a), c = Math.max(28, (qe(a, r) + 1) * this.dayWidth), d = Pt[e.status];
|
|
8029
|
-
n.save(), n.globalAlpha = this.selectedId === e.id || this.hoverId === e.id ? 1 : 0.55, n.fillStyle = this.theme === "color" ? "#eaf2ff" : "#fff", n.strokeStyle = this.selectedId === e.id ?
|
|
8034
|
+
n.save(), n.globalAlpha = this.selectedId === e.id || this.hoverId === e.id ? 1 : 0.55, n.fillStyle = this.theme === "color" ? "#eaf2ff" : "#fff", n.strokeStyle = this.selectedId === e.id ? Ee.accent : "#dee0e3", n.lineWidth = 1, mt(n, l, i, c, He, 4), n.fill(), n.stroke(), n.save(), mt(n, l, i, c, He, 4), n.clip(), n.beginPath(), n.arc(l + 14, i + 14, 6, 0, Math.PI * 2), n.fillStyle = d, n.fill(), n.font = "12px " + Ye, n.textBaseline = "middle", n.textAlign = "left", n.fillStyle = Ee.text;
|
|
8030
8035
|
const u = this.options.members.find((p) => p.id === e.owner), f = n.measureText(e.name).width;
|
|
8031
|
-
c > f + 58 ? (n.fillText(e.name, l + 26, i + 14), u && ti(n, l + f + 42, i + 14, 7, $t(u.id), u.name.slice(0, 1))) : u && c > 46 && ti(n, l + 38, i + 14, 7, $t(u.id), u.name.slice(0, 1)), c > 100 && (n.fillStyle =
|
|
8036
|
+
c > f + 58 ? (n.fillText(e.name, l + 26, i + 14), u && ti(n, l + f + 42, i + 14, 7, $t(u.id), u.name.slice(0, 1))) : u && c > 46 && ti(n, l + 38, i + 14, 7, $t(u.id), u.name.slice(0, 1)), c > 100 && (n.fillStyle = Ee.textTertiary, n.textAlign = "right", n.fillText(String(ps(Fe(a), Fe(r))), l + c - 8, i + 14)), n.restore(), n.restore(), this.pushHit({ id: e.id, rowIndex: t, kind: "task", x: l, y: i, w: c, h: He, mode: "move", avatar: u ? { x: l + (c > f + 58 ? f + 42 : 38), y: i + 14, r: 7 } : void 0 });
|
|
8032
8037
|
}
|
|
8033
8038
|
drawSummaryBar(e, t, i) {
|
|
8034
8039
|
if (!e.start || !e.end) return;
|
|
8035
8040
|
const n = this.tasks.filter((d) => d.path.length === e.path.length + 1 && d.path.slice(0, -1).join("/") === e.path.join("/") && d.start), o = n[0], a = this.ctx, r = this.dateX(e.start), l = Math.max(92, (qe(e.start, e.end) + 1) * this.dayWidth);
|
|
8036
|
-
a.fillStyle = this.theme === "color" ? "#0565db" : "#fff", a.strokeStyle = this.selectedId === e.id ?
|
|
8041
|
+
a.fillStyle = this.theme === "color" ? "#0565db" : "#fff", a.strokeStyle = this.selectedId === e.id ? Ee.accent : "#dee0e3", a.lineWidth = 1, mt(a, r, i, l, He, 4), a.fill(), a.stroke(), a.fillStyle = o ? Pt[o.status] : Pt[e.status], a.beginPath(), a.arc(r + 14, i + 14, 5, 0, Math.PI * 2), a.fill(), a.fillStyle = this.theme === "color" ? "#fff" : Ee.text, a.font = "11px " + Ye, a.textAlign = "left", a.textBaseline = "middle";
|
|
8037
8042
|
const c = ((o == null ? void 0 : o.name) ?? e.name) + (n.length > 1 ? ` +${n.length - 1}` : "");
|
|
8038
8043
|
a.fillText(ms(a, c, l - 32), r + 25, i + 14), this.pushHit({ id: e.id, rowIndex: t, kind: "summary", x: r, y: i, w: l, h: He, mode: "move" });
|
|
8039
8044
|
}
|
|
@@ -8052,7 +8057,7 @@ class fs {
|
|
|
8052
8057
|
const n = this.ctx, o = this.dayWidth, a = ((h = this.ghost) == null ? void 0 : h.id) === e.id ? this.ghost : null, r = a ? a.start : e.start, l = cs(e), c = Pt[l], d = this.dateX(r) + o / 2;
|
|
8053
8058
|
n.font = "12px " + Ye;
|
|
8054
8059
|
const u = n.measureText(e.name).width, f = e.owner ? 24 : 0, g = 19 + u + f + 14, p = d - g / 2;
|
|
8055
|
-
n.fillStyle = "#fff", n.strokeStyle = c, n.lineWidth = 1.5, mt(n, p, i, g, He, 4), n.fill(), n.stroke(), n.fillStyle = c, n.beginPath(), n.arc(p + 7 + 3, i + He / 2, 3, 0, Math.PI * 2), n.fill(), n.fillStyle =
|
|
8060
|
+
n.fillStyle = "#fff", n.strokeStyle = c, n.lineWidth = 1.5, mt(n, p, i, g, He, 4), n.fill(), n.stroke(), n.fillStyle = c, n.beginPath(), n.arc(p + 7 + 3, i + He / 2, 3, 0, Math.PI * 2), n.fill(), n.fillStyle = Ee.text, n.textAlign = "left", n.textBaseline = "middle", n.fillText(e.name, p + 14 + 5, i + He / 2 + 1);
|
|
8056
8061
|
let C;
|
|
8057
8062
|
if (e.owner) {
|
|
8058
8063
|
const m = this.options.members.find((y) => y.id === e.owner);
|
|
@@ -8215,7 +8220,7 @@ function Wi(s, e, t, i, n, o, a) {
|
|
|
8215
8220
|
s.beginPath(), s.moveTo(e, t), s.lineTo(i - 5, t), s.quadraticCurveTo(i, t, i, t + 5 * l), s.lineTo(i, n - 5 * l), s.quadraticCurveTo(i, n, i + 5 * l, n), s.lineTo(o, a), s.stroke();
|
|
8216
8221
|
}
|
|
8217
8222
|
function vs(s, e, t) {
|
|
8218
|
-
s.fillStyle =
|
|
8223
|
+
s.fillStyle = Ee.accent, s.beginPath(), s.moveTo(e + 5, t), s.lineTo(e - 1, t - 3.5), s.lineTo(e - 1, t + 3.5), s.closePath(), s.fill();
|
|
8219
8224
|
}
|
|
8220
8225
|
const Ui = ["#7e80e7", "#47a8f8", "#87cf2b", "#f3a23a", "#e46ba6", "#00c2c7", "#ff6b6b", "#a86dd7"];
|
|
8221
8226
|
function $t(s) {
|
|
@@ -8565,57 +8570,57 @@ function ca(s, e) {
|
|
|
8565
8570
|
<div class="gantt-status" aria-live="polite"></div>
|
|
8566
8571
|
<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>
|
|
8567
8572
|
</div>`, s.append(t);
|
|
8568
|
-
const i = e.onTaskOpen ? null : rs(t), n = (
|
|
8573
|
+
const i = e.onTaskOpen ? null : rs(t), n = (N) => t.querySelector(N);
|
|
8569
8574
|
n(".gantt-title-name").textContent = e.title ?? "甘特图";
|
|
8570
|
-
let o = structuredClone(e.tasks), a = new Map(o.map((
|
|
8575
|
+
let o = structuredClone(e.tasks), a = new Map(o.map((N) => [N.id, N])), r, l, c = !0, d = !1;
|
|
8571
8576
|
const u = n(".gantt-left");
|
|
8572
8577
|
u.style.width = `${e.tableWidth ?? 280}px`;
|
|
8573
8578
|
const f = new AbortController(), g = f.signal, p = n(".gantt-status");
|
|
8574
8579
|
function C() {
|
|
8575
8580
|
if (!r || d) return;
|
|
8576
8581
|
m.setTasks(o);
|
|
8577
|
-
const
|
|
8578
|
-
m.setRows(
|
|
8582
|
+
const N = Array.from({ length: r.getDisplayedRowCount() }, (Q, ie) => r.getDisplayedRowAtIndex(ie)).filter(Boolean);
|
|
8583
|
+
m.setRows(N.map((Q) => ({ id: Q.id, group: !!Q.group, expanded: !!Q.expanded })));
|
|
8579
8584
|
const z = o.filter((Q) => Q.path.length === 1), _ = z.filter((Q) => Q.status === "done").length;
|
|
8580
8585
|
p.textContent = `总工作项数 ${z.length} 完成进度 ${z.length ? Math.round(_ / z.length * 100) : 0}%`;
|
|
8581
8586
|
}
|
|
8582
|
-
function h(
|
|
8587
|
+
function h(N) {
|
|
8583
8588
|
var Q;
|
|
8584
|
-
o = o.map((
|
|
8585
|
-
const z = [
|
|
8586
|
-
let _ =
|
|
8589
|
+
o = o.map((ie) => ie.id === N.id ? { ...N } : ie), a = new Map(o.map((ie) => [ie.id, ie]));
|
|
8590
|
+
const z = [N];
|
|
8591
|
+
let _ = N.path.slice(0, -1);
|
|
8587
8592
|
for (; _.length; ) {
|
|
8588
|
-
const
|
|
8589
|
-
if (!
|
|
8590
|
-
const U = o.filter((Z) => Z.path.length === _.length + 1 && Z.path.slice(0, -1).join("/") === _.join("/")),
|
|
8591
|
-
|
|
8593
|
+
const ie = o.find((Z) => Z.path.join("/") === _.join("/"));
|
|
8594
|
+
if (!ie) break;
|
|
8595
|
+
const U = o.filter((Z) => Z.path.length === _.length + 1 && Z.path.slice(0, -1).join("/") === _.join("/")), $ = U.flatMap((Z) => Z.start ? [Z.start] : []).sort(), q = U.flatMap((Z) => Z.end ? [Z.end] : []).sort();
|
|
8596
|
+
ie.start = $[0] ?? null, ie.end = q[q.length - 1] ?? null, z.push(ie), _ = _.slice(0, -1);
|
|
8592
8597
|
}
|
|
8593
|
-
r.applyTransaction({ update: z }), C(), (Q = e.onTaskChange) == null || Q.call(e, structuredClone(
|
|
8598
|
+
r.applyTransaction({ update: z }), C(), (Q = e.onTaskChange) == null || Q.call(e, structuredClone(N));
|
|
8594
8599
|
}
|
|
8595
8600
|
const m = new fs(n(".gantt-right"), {
|
|
8596
8601
|
members: e.members ?? [],
|
|
8597
8602
|
rowHeight: 40,
|
|
8598
|
-
onSelect: (
|
|
8603
|
+
onSelect: (N) => {
|
|
8599
8604
|
var _;
|
|
8600
|
-
m.setSelected(
|
|
8601
|
-
const z =
|
|
8605
|
+
m.setSelected(N);
|
|
8606
|
+
const z = N ? r == null ? void 0 : r.getRowNode(N) : null;
|
|
8602
8607
|
z && ((_ = r.selectNode) == null || _.call(r, z, !0));
|
|
8603
8608
|
},
|
|
8604
|
-
onHover: (
|
|
8609
|
+
onHover: (N) => {
|
|
8605
8610
|
var z;
|
|
8606
|
-
t.querySelectorAll(".ag-row-hover").forEach((_) => _.classList.remove("ag-row-hover")),
|
|
8611
|
+
t.querySelectorAll(".ag-row-hover").forEach((_) => _.classList.remove("ag-row-hover")), N && ((z = Array.from(t.querySelectorAll(".ag-row")).find((_) => _.dataset.rowid === N)) == null || z.classList.add("ag-row-hover"));
|
|
8607
8612
|
},
|
|
8608
8613
|
onTaskChange: h,
|
|
8609
|
-
onAssign: (
|
|
8610
|
-
const _ = a.get(
|
|
8614
|
+
onAssign: (N, z) => {
|
|
8615
|
+
const _ = a.get(N);
|
|
8611
8616
|
_ && h({ ..._, owner: z });
|
|
8612
8617
|
}
|
|
8613
8618
|
});
|
|
8614
|
-
function y(
|
|
8615
|
-
const z =
|
|
8616
|
-
if (_.className = "gt-task-name", z.path.length > 1 ? _.classList.add("gt-child-name") :
|
|
8617
|
-
const
|
|
8618
|
-
|
|
8619
|
+
function y(N) {
|
|
8620
|
+
const z = N.data, _ = document.createElement("span");
|
|
8621
|
+
if (_.className = "gt-task-name", z.path.length > 1 ? _.classList.add("gt-child-name") : N.node.group || _.classList.add("gt-root-leaf"), z.path.length > 1) {
|
|
8622
|
+
const ie = document.createElement("span");
|
|
8623
|
+
ie.className = `gt-node-dot gt-node-${z.status}`, _.append(ie);
|
|
8619
8624
|
}
|
|
8620
8625
|
const Q = document.createElement("button");
|
|
8621
8626
|
return Q.className = "gt-title-link", Q.textContent = z.name, Q.title = z.name, Q.addEventListener("click", () => {
|
|
@@ -8624,17 +8629,17 @@ function ca(s, e) {
|
|
|
8624
8629
|
}
|
|
8625
8630
|
const E = document.createElement("button");
|
|
8626
8631
|
E.className = "gt-tree-toggle", E.textContent = "▾", E.title = "收起全部子层级", E.setAttribute("aria-label", E.title);
|
|
8627
|
-
function R(
|
|
8628
|
-
c =
|
|
8632
|
+
function R(N) {
|
|
8633
|
+
c = N, N ? r.expandAll() : r.collapseAll(), E.textContent = N ? "▾" : "▸", E.title = N ? "收起全部子层级" : "展开全部子层级", E.setAttribute("aria-label", E.title), C();
|
|
8629
8634
|
}
|
|
8630
8635
|
E.addEventListener("click", () => R(!c));
|
|
8631
|
-
const S = ["name", "status", "start", "end", "owner", "progress"].map((
|
|
8636
|
+
const S = ["name", "status", "start", "end", "owner", "progress"].map((N) => ({ field: N, hide: !0, filter: !0 }));
|
|
8632
8637
|
l = new Kt(n(".grid"), {
|
|
8633
8638
|
columnDefs: S,
|
|
8634
8639
|
rowData: o,
|
|
8635
8640
|
treeData: !0,
|
|
8636
|
-
getDataPath: (
|
|
8637
|
-
getRowId: (
|
|
8641
|
+
getDataPath: (N) => N.path,
|
|
8642
|
+
getRowId: (N) => N.data.id,
|
|
8638
8643
|
groupDefaultExpanded: -1,
|
|
8639
8644
|
includeHiddenColumnsInQuickFilter: !0,
|
|
8640
8645
|
rowHeight: 40,
|
|
@@ -8650,60 +8655,60 @@ function ca(s, e) {
|
|
|
8650
8655
|
sortable: !1,
|
|
8651
8656
|
resizable: !1,
|
|
8652
8657
|
headerComponent: () => {
|
|
8653
|
-
const
|
|
8654
|
-
return
|
|
8658
|
+
const N = document.createElement("div");
|
|
8659
|
+
return N.className = "gt-title-header", N.append(E, document.createTextNode("标题")), N;
|
|
8655
8660
|
},
|
|
8656
8661
|
cellRenderer: "agGroupCellRenderer",
|
|
8657
8662
|
cellRendererParams: { suppressCount: !0, innerRenderer: y }
|
|
8658
8663
|
},
|
|
8659
|
-
onGridReady: (
|
|
8660
|
-
r =
|
|
8664
|
+
onGridReady: (N) => {
|
|
8665
|
+
r = N.api, C();
|
|
8661
8666
|
},
|
|
8662
|
-
onModelUpdated: (
|
|
8663
|
-
r =
|
|
8667
|
+
onModelUpdated: (N) => {
|
|
8668
|
+
r = N.api, C();
|
|
8664
8669
|
},
|
|
8665
8670
|
onRowGroupOpened: C,
|
|
8666
|
-
onRowClicked: (
|
|
8671
|
+
onRowClicked: (N) => {
|
|
8667
8672
|
var z;
|
|
8668
|
-
return m.setSelected(((z =
|
|
8673
|
+
return m.setSelected(((z = N.node) == null ? void 0 : z.id) ?? null);
|
|
8669
8674
|
}
|
|
8670
8675
|
}), r = l.getApi();
|
|
8671
|
-
const
|
|
8676
|
+
const P = n(".ag-body-viewport");
|
|
8672
8677
|
let O = !1;
|
|
8673
|
-
const
|
|
8674
|
-
O || (O = !0, z.scrollTop =
|
|
8678
|
+
const A = (N, z) => {
|
|
8679
|
+
O || (O = !0, z.scrollTop = N.scrollTop, O = !1);
|
|
8675
8680
|
};
|
|
8676
|
-
|
|
8677
|
-
const z =
|
|
8681
|
+
P.addEventListener("scroll", () => A(P, m.scrollElement), { signal: g }), m.scrollElement.addEventListener("scroll", () => A(m.scrollElement, P), { signal: g }), P.addEventListener("mousemove", (N) => {
|
|
8682
|
+
const z = N.target.closest(".ag-row");
|
|
8678
8683
|
m.setHover((z == null ? void 0 : z.dataset.rowid) ?? null);
|
|
8679
|
-
}, { signal: g }),
|
|
8684
|
+
}, { signal: g }), P.addEventListener("mouseleave", () => m.setHover(null), { signal: g });
|
|
8680
8685
|
const j = new bs(r, t, { filter: [{ colId: "name", label: "标题", kind: "text" }, { colId: "status", label: "状态", kind: "text", options: [{ value: "not-started", label: "未开始" }, { value: "in-progress", label: "进行中" }, { value: "done", label: "已完成" }] }, { colId: "start", label: "开始日期", kind: "date" }], sort: [{ colId: "name", label: "标题" }, { colId: "start", label: "开始日期" }, { colId: "end", label: "结束日期" }] }, {
|
|
8681
|
-
onFilterButton: (
|
|
8682
|
-
onSortButton: (
|
|
8686
|
+
onFilterButton: (N) => n('[data-action="filter"]').classList.toggle("gt-btn-active", N),
|
|
8687
|
+
onSortButton: (N) => n('[data-action="sort"]').classList.toggle("gt-btn-active", N)
|
|
8683
8688
|
});
|
|
8684
|
-
n('[data-action="filter"]').addEventListener("click", (
|
|
8685
|
-
const W = n(".gt-settings"),
|
|
8686
|
-
|
|
8687
|
-
W.hidden = !W.hidden,
|
|
8688
|
-
}, { signal: g }), document.addEventListener("pointerdown", (
|
|
8689
|
-
!W.contains(
|
|
8689
|
+
n('[data-action="filter"]').addEventListener("click", (N) => j.openFilterPanel(N.currentTarget), { signal: g }), n('[data-action="sort"]').addEventListener("click", (N) => j.openSortPanel(N.currentTarget), { signal: g }), n('[type="search"]').addEventListener("input", (N) => r.setQuickFilter(N.target.value), { signal: g });
|
|
8690
|
+
const W = n(".gt-settings"), T = n('[data-action="settings"]');
|
|
8691
|
+
T.addEventListener("click", () => {
|
|
8692
|
+
W.hidden = !W.hidden, T.setAttribute("aria-expanded", String(!W.hidden));
|
|
8693
|
+
}, { signal: g }), document.addEventListener("pointerdown", (N) => {
|
|
8694
|
+
!W.contains(N.target) && !T.contains(N.target) && (W.hidden = !0, T.setAttribute("aria-expanded", "false"));
|
|
8690
8695
|
}, { signal: g });
|
|
8691
|
-
const
|
|
8692
|
-
return W.querySelectorAll('[type="radio"]').forEach((
|
|
8693
|
-
const z =
|
|
8694
|
-
|
|
8695
|
-
z === "theme" ? m.setTheme(
|
|
8696
|
+
const F = Math.random().toString(36).slice(2);
|
|
8697
|
+
return W.querySelectorAll('[type="radio"]').forEach((N) => {
|
|
8698
|
+
const z = N.name;
|
|
8699
|
+
N.name = z + F, N.addEventListener("change", () => {
|
|
8700
|
+
z === "theme" ? m.setTheme(N.value) : m.setMilestonesOnly(N.value === "milestones");
|
|
8696
8701
|
}, { signal: g });
|
|
8697
|
-
}), n('[data-setting="children"]').addEventListener("change", (
|
|
8698
|
-
|
|
8702
|
+
}), n('[data-setting="children"]').addEventListener("change", (N) => m.setShowChildren(N.target.checked), { signal: g }), t.addEventListener("keydown", (N) => {
|
|
8703
|
+
N.key === "Escape" && (W.hidden = !0, j.closeAll());
|
|
8699
8704
|
}, { signal: g }), C(), e.unit && m.setUnit(e.unit), m.scrollToToday(0.5), {
|
|
8700
8705
|
grid: r,
|
|
8701
8706
|
chart: m,
|
|
8702
8707
|
expandAll: () => R(!0),
|
|
8703
8708
|
collapseAll: () => R(!1),
|
|
8704
|
-
scrollToTask: (
|
|
8705
|
-
setTasks(
|
|
8706
|
-
o = structuredClone(
|
|
8709
|
+
scrollToTask: (N) => m.scrollToTask(N),
|
|
8710
|
+
setTasks(N) {
|
|
8711
|
+
o = structuredClone(N), a = new Map(o.map((z) => [z.id, z])), r.setRowData(o), C();
|
|
8707
8712
|
},
|
|
8708
8713
|
destroy() {
|
|
8709
8714
|
d || (d = !0, f.abort(), j.destroy(), i == null || i.destroy(), m.destroy(), l.destroy(), t.remove());
|
|
@@ -8736,26 +8741,26 @@ function da(s, e) {
|
|
|
8736
8741
|
let t = structuredClone(e.people), i = structuredClone(e.items);
|
|
8737
8742
|
const n = e.today ?? (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
8738
8743
|
let o = new Set(t.map((K) => K.id)), a = !1, r = "", l = "", c = "", d = !1, u = 1, f = !1, g = !1, p = !1, C = !0, h = Ae(n) - (/* @__PURE__ */ new Date(`${n}T00:00:00Z`)).getUTCDay(), m = 90, y = `${n.slice(0, 7)}-01`, E = Be(Date.UTC(Number(n.slice(0, 4)), Number(n.slice(5, 7)) + 1, 0) / 864e5), R = !1, S = !1;
|
|
8739
|
-
const
|
|
8740
|
-
|
|
8744
|
+
const P = document.createElement("section");
|
|
8745
|
+
P.className = "personnel-schedule", P.innerHTML = `<header class="ps-title"><span class="ps-app-icon">▦</span><strong>${we(e.title ?? "人员排期")}</strong><nav><button class="active" data-action="schedule">人员排期</button><button data-action="views">视图列表</button></nav></header>
|
|
8741
8746
|
<div class="ps-toolbar"><button class="ps-tint" data-action="people">◎ 人员筛选</button><button class="ps-tint" data-action="filter">▽ 筛选 · ${we(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>
|
|
8742
8747
|
<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>
|
|
8743
|
-
<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(
|
|
8744
|
-
const O = (K) =>
|
|
8748
|
+
<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(P);
|
|
8749
|
+
const O = (K) => P.querySelector(K), A = O(".ps-scroll"), j = O(".ps-rows"), W = O(".ps-popover"), T = O(".ps-detail"), F = new AbortController(), N = F.signal;
|
|
8745
8750
|
let z;
|
|
8746
|
-
const _ = () => [22, 43, 64, 86, 120][u], Q = () => i.filter((K) => (!r || K.name.includes(r)) && (!l || K.status === l) && (g || !K.parentId)),
|
|
8751
|
+
const _ = () => [22, 43, 64, 86, 120][u], Q = () => i.filter((K) => (!r || K.name.includes(r)) && (!l || K.status === l) && (g || !K.parentId)), ie = () => {
|
|
8747
8752
|
const K = Q();
|
|
8748
8753
|
return t.filter((X) => o.has(X.id) && (!a || K.some((J) => J.personId === X.id && Nt(J)))).sort((X, J) => {
|
|
8749
8754
|
if (!c) return 0;
|
|
8750
|
-
const Y = Gt(K.filter((he) => he.personId === X.id)),
|
|
8751
|
-
return (c === "estimate" ? Y.estimate -
|
|
8755
|
+
const Y = Gt(K.filter((he) => he.personId === X.id)), ne = Gt(K.filter((he) => he.personId === J.id));
|
|
8756
|
+
return (c === "estimate" ? Y.estimate - ne.estimate : Y.scheduled - ne.scheduled) * (d ? -1 : 1);
|
|
8752
8757
|
});
|
|
8753
8758
|
};
|
|
8754
8759
|
function U(K) {
|
|
8755
8760
|
const X = O(".ps-toast");
|
|
8756
8761
|
X.textContent = K, X.hidden = !1, clearTimeout(z), z = setTimeout(() => X.hidden = !0, 2200);
|
|
8757
8762
|
}
|
|
8758
|
-
function
|
|
8763
|
+
function $() {
|
|
8759
8764
|
if (R) return;
|
|
8760
8765
|
const K = _(), X = m * K;
|
|
8761
8766
|
O(".ps-table").style.width = `${X + 200}px`;
|
|
@@ -8768,39 +8773,39 @@ function da(s, e) {
|
|
|
8768
8773
|
$e.style.width = `${Math.min(7, m - Re) * K}px`, $e.textContent = `${Be(h + Re).slice(5).replace("-", "/")}~${Be(h + Re + 6).slice(5).replace("-", "/")}`, Y.append($e);
|
|
8769
8774
|
}
|
|
8770
8775
|
j.replaceChildren();
|
|
8771
|
-
const
|
|
8776
|
+
const ne = Q(), he = ie();
|
|
8772
8777
|
for (const Re of he) {
|
|
8773
|
-
const $e =
|
|
8778
|
+
const $e = ne.filter((me) => me.personId === Re.id), Ne = Gt($e), pt = xs($e, f), Oe = Math.max(0, ...pt.map((me) => me.lane)), Dt = Math.max(p ? 154 : 126, 60 + (Oe + 1) * (p ? 48 : 36)), lt = document.createElement("div");
|
|
8774
8779
|
lt.className = "ps-person-row", lt.style.height = `${Dt}px`, lt.dataset.person = Re.id;
|
|
8775
|
-
const
|
|
8776
|
-
|
|
8777
|
-
const yt =
|
|
8780
|
+
const gt = document.createElement("div");
|
|
8781
|
+
gt.className = "ps-person", gt.innerHTML = `<div class="ps-person-name"><span class="ps-avatar"></span><strong>${we(Re.name)}</strong></div><div>已排期项 <b>${Ne.scheduled}</b></div><div>总估分 <b>${Ne.estimate.toFixed(2)}</b></div><div>未排期·${Ne.unscheduled}<button data-action="unplanned" data-person="${we(Re.id)}">查看</button></div>`;
|
|
8782
|
+
const yt = gt.querySelector(".ps-avatar");
|
|
8778
8783
|
yt.textContent = Re.name.slice(-2), yt.style.background = Re.color || qi[t.indexOf(Re) % qi.length];
|
|
8779
8784
|
const Ve = document.createElement("div");
|
|
8780
8785
|
Ve.className = "ps-timeline", Ve.style.width = `${X}px`, Ve.style.setProperty("--day", `${K}px`);
|
|
8781
|
-
for (let
|
|
8782
|
-
const
|
|
8783
|
-
|
|
8786
|
+
for (let me = 0; me < m; me++) if ([0, 6].includes(new Date((h + me) * 864e5).getUTCDay())) {
|
|
8787
|
+
const et = document.createElement("i");
|
|
8788
|
+
et.className = "ps-weekend", et.style.left = `${me * K}px`, et.style.width = `${K}px`, Ve.append(et);
|
|
8784
8789
|
}
|
|
8785
8790
|
const rt = Ae(n) - h;
|
|
8786
8791
|
if (rt >= 0 && rt < m) {
|
|
8787
|
-
const
|
|
8788
|
-
|
|
8792
|
+
const me = document.createElement("i");
|
|
8793
|
+
me.className = "ps-today", me.style.left = `${(rt + 0.5) * K}px`, Ve.append(me);
|
|
8789
8794
|
}
|
|
8790
|
-
for (const { item:
|
|
8791
|
-
const
|
|
8792
|
-
if (ze < h ||
|
|
8793
|
-
const
|
|
8794
|
-
Ge.className = `ps-bar ${C ? "ps-color" : "ps-content"}`, Ge.dataset.item =
|
|
8795
|
+
for (const { item: me, lane: et } of pt) {
|
|
8796
|
+
const tt = Ae(me.start), ze = Ae(me.end);
|
|
8797
|
+
if (ze < h || tt >= h + m) continue;
|
|
8798
|
+
const it = Math.max(0, tt - h) * K, ct = Math.min(m, ze - h + 1) * K, Ge = document.createElement("button");
|
|
8799
|
+
Ge.className = `ps-bar ${C ? "ps-color" : "ps-content"}`, Ge.dataset.item = me.id, Ge.setAttribute("aria-label", `${me.name},${me.start} 至 ${me.end}`), Ge.style.left = `${it}px`, Ge.style.width = `${ct - it}px`, Ge.style.top = `${52 + et * (p ? 48 : 36)}px`, Ge.style.setProperty("--bar-color", me.color || "#8cafeb"), Ge.innerHTML = `<span class="ps-resize" data-edge="start"></span><span class="ps-bar-name">${we(me.name)}</span><span class="ps-status">${we(me.status)}</span><span class="ps-node">● ${we(me.node)}</span><span class="ps-effort">${me.estimate || ""}</span><span class="ps-resize" data-edge="end"></span>`, Ve.append(Ge);
|
|
8795
8800
|
}
|
|
8796
|
-
if (!
|
|
8797
|
-
const
|
|
8798
|
-
|
|
8801
|
+
if (!pt.length) {
|
|
8802
|
+
const me = document.createElement("span");
|
|
8803
|
+
me.className = "ps-no-schedule", me.textContent = "暂无排期", Ve.append(me);
|
|
8799
8804
|
}
|
|
8800
|
-
lt.append(
|
|
8805
|
+
lt.append(gt, Ve), j.append(lt);
|
|
8801
8806
|
}
|
|
8802
8807
|
he.length || (j.innerHTML = '<div class="ps-empty">没有符合条件的人员</div>');
|
|
8803
|
-
const ke =
|
|
8808
|
+
const ke = ne.filter((Re) => he.some(($e) => $e.id === Re.personId));
|
|
8804
8809
|
O(".ps-total").textContent = `ⓘ 总人数 ${he.length} 总估分 ${Gt(ke).estimate.toFixed(2)} pd ···`;
|
|
8805
8810
|
}
|
|
8806
8811
|
function q(K, X) {
|
|
@@ -8809,61 +8814,61 @@ function da(s, e) {
|
|
|
8809
8814
|
return;
|
|
8810
8815
|
}
|
|
8811
8816
|
W.dataset.kind = K, W.hidden = !1;
|
|
8812
|
-
const J =
|
|
8813
|
-
if (W.style.left = `${Math.max(12, Math.min(((Y == null ? void 0 : Y.left) ?? J.left) - J.left,
|
|
8814
|
-
W.innerHTML = `<div class="ps-panel-title">包含 ${o.size} 人<label><input type="checkbox" data-control="only" ${a ? "checked" : ""}>仅查看有排期的用户</label></div><div class="ps-person-filter"><span>甘特图显示人员</span><span>包含</span><span>全部排期人员</span></div><input class="ps-person-search" placeholder="搜索人员" aria-label="搜索人员"><div class="ps-person-options">${t.map((
|
|
8817
|
+
const J = P.getBoundingClientRect(), Y = X == null ? void 0 : X.getBoundingClientRect();
|
|
8818
|
+
if (W.style.left = `${Math.max(12, Math.min(((Y == null ? void 0 : Y.left) ?? J.left) - J.left, P.clientWidth - (K === "unplanned" ? 760 : 420) - 16))}px`, W.style.top = `${Y ? Y.bottom - J.top + 6 : 96}px`, W.className = `ps-popover ps-panel-${K}`, K === "people")
|
|
8819
|
+
W.innerHTML = `<div class="ps-panel-title">包含 ${o.size} 人<label><input type="checkbox" data-control="only" ${a ? "checked" : ""}>仅查看有排期的用户</label></div><div class="ps-person-filter"><span>甘特图显示人员</span><span>包含</span><span>全部排期人员</span></div><input class="ps-person-search" placeholder="搜索人员" aria-label="搜索人员"><div class="ps-person-options">${t.map((ne) => `<label><input type="checkbox" data-person="${we(ne.id)}" ${o.has(ne.id) ? "checked" : ""}>${we(ne.name)}</label>`).join("")}</div>`;
|
|
8815
8820
|
else if (K === "sort")
|
|
8816
8821
|
W.innerHTML = `<div class="ps-panel-title">设置排序条件 ⓘ</div><div class="ps-sort-fields"><select aria-label="排序字段" data-control="sort"><option value="">请选择排序项</option><option value="estimate">总估分</option><option value="scheduled">已排期项</option></select><button data-action="asc" class="${d ? "" : "selected"}">小 → 大</button><button data-action="desc" class="${d ? "selected" : ""}">大 → 小</button></div><button class="ps-link" data-action="clear-sort">清空全部条件</button>`, W.querySelector("select").value = c;
|
|
8817
8822
|
else if (K === "filter")
|
|
8818
|
-
W.innerHTML = `<div class="ps-panel-title">筛选工作项</div><label>工作项类型 <span class="ps-chip">${we(e.workItemLabel ?? "工作项")}</span></label><label>名称包含 <input data-control="query" value="${we(r)}" placeholder="输入名称"></label><label>状态 <select data-control="status"><option value="">全部状态</option>${[...new Set(i.map((
|
|
8823
|
+
W.innerHTML = `<div class="ps-panel-title">筛选工作项</div><label>工作项类型 <span class="ps-chip">${we(e.workItemLabel ?? "工作项")}</span></label><label>名称包含 <input data-control="query" value="${we(r)}" placeholder="输入名称"></label><label>状态 <select data-control="status"><option value="">全部状态</option>${[...new Set(i.map((ne) => ne.status))].map((ne) => `<option>${we(ne)}</option>`).join("")}</select></label><button data-action="clear-filter" class="ps-link">清空筛选</button>`, W.querySelector("select").value = l;
|
|
8819
8824
|
else if (K === "settings")
|
|
8820
8825
|
W.innerHTML = `<div class="ps-panel-title">数据显示</div><label><input type="checkbox" data-control="expanded" ${f ? "checked" : ""}>展开全部排期项</label><label><input type="checkbox" data-control="children" ${g ? "checked" : ""}>展示全部子项</label><div class="ps-panel-title">内容显示</div><div class="ps-segment"><button data-action="compact" class="${p ? "" : "selected"}">紧凑</button><button data-action="loose" class="${p ? "selected" : ""}">宽松</button></div><div class="ps-panel-title">甘特条样式 ⓘ</div><div class="ps-style-options"><button data-action="content" class="${C ? "" : "selected"}"><i></i>◉ 内容优先</button><button data-action="color" class="${C ? "selected" : ""}"><i></i>◉ 颜色优先</button></div>`;
|
|
8821
8826
|
else if (K === "date") Ce();
|
|
8822
8827
|
else if (K === "save") W.innerHTML = '<div class="ps-panel-title">存为视图</div><input data-view-name placeholder="视图名称" aria-label="视图名称"><button class="ps-primary" data-action="save-view">保存</button>';
|
|
8823
8828
|
else if (K === "views") {
|
|
8824
|
-
const
|
|
8825
|
-
W.innerHTML = `<div class="ps-panel-title">视图列表</div>${
|
|
8829
|
+
const ne = Ze();
|
|
8830
|
+
W.innerHTML = `<div class="ps-panel-title">视图列表</div>${ne.length ? ne.map((he, ke) => `<button class="ps-view" data-view="${ke}">▦ ${we(he.name)}</button>`).join("") : "<p>暂无保存的视图</p>"}`;
|
|
8826
8831
|
}
|
|
8827
8832
|
}
|
|
8828
|
-
let Z = /* @__PURE__ */ new Date(`${y}T00:00:00Z`),
|
|
8833
|
+
let Z = /* @__PURE__ */ new Date(`${y}T00:00:00Z`), te = !1;
|
|
8829
8834
|
function Ce() {
|
|
8830
8835
|
let K = `<div class="ps-range-inputs"><input type="date" data-control="range-start" value="${y}" aria-label="开始日期">—<input type="date" data-control="range-end" value="${E}" aria-label="结束日期"></div><div class="ps-calendars">`;
|
|
8831
8836
|
for (let X = 0; X < 2; X++) {
|
|
8832
8837
|
const J = new Date(Date.UTC(Z.getUTCFullYear(), Z.getUTCMonth() + X, 1));
|
|
8833
|
-
K += `<div class="ps-calendar"><div><button data-action="cal-prev">‹</button><strong>${J.getUTCFullYear()}年 ${J.getUTCMonth() + 1}月</strong><button data-action="cal-next">›</button></div><div class="ps-calendar-grid">${"日一二三四五六".split("").map((
|
|
8834
|
-
for (let
|
|
8838
|
+
K += `<div class="ps-calendar"><div><button data-action="cal-prev">‹</button><strong>${J.getUTCFullYear()}年 ${J.getUTCMonth() + 1}月</strong><button data-action="cal-next">›</button></div><div class="ps-calendar-grid">${"日一二三四五六".split("").map((ne) => `<span>${ne}</span>`).join("")}`;
|
|
8839
|
+
for (let ne = 0; ne < J.getUTCDay(); ne++) K += "<span></span>";
|
|
8835
8840
|
const Y = new Date(Date.UTC(J.getUTCFullYear(), J.getUTCMonth() + 1, 0)).getUTCDate();
|
|
8836
|
-
for (let
|
|
8837
|
-
const he = Be(Date.UTC(J.getUTCFullYear(), J.getUTCMonth(),
|
|
8838
|
-
K += `<button data-date="${he}" class="${he >= y && he <= E ? "in-range" : ""} ${he === y || he === E ? "selected" : ""}">${
|
|
8841
|
+
for (let ne = 1; ne <= Y; ne++) {
|
|
8842
|
+
const he = Be(Date.UTC(J.getUTCFullYear(), J.getUTCMonth(), ne) / 864e5);
|
|
8843
|
+
K += `<button data-date="${he}" class="${he >= y && he <= E ? "in-range" : ""} ${he === y || he === E ? "selected" : ""}">${ne}</button>`;
|
|
8839
8844
|
}
|
|
8840
8845
|
K += "</div></div>";
|
|
8841
8846
|
}
|
|
8842
8847
|
W.innerHTML = K + `</div><div class="ps-presets">${["本周", "本双周", "本月", "本双月", "2周内", "2个月内", "1年内"].map((X, J) => `<button data-preset="${J}">${X}</button>`).join("")}</div>`;
|
|
8843
8848
|
}
|
|
8844
|
-
function
|
|
8845
|
-
E < y && ([y, E] = [E, y]), h = Ae(y), h -= new Date(h * 864e5).getUTCDay(), m = Math.max(35, Ae(E) - h + 8),
|
|
8849
|
+
function fe() {
|
|
8850
|
+
E < y && ([y, E] = [E, y]), h = Ae(y), h -= new Date(h * 864e5).getUTCDay(), m = Math.max(35, Ae(E) - h + 8), A.scrollLeft = 0, $();
|
|
8846
8851
|
}
|
|
8847
|
-
function
|
|
8848
|
-
var
|
|
8852
|
+
function ce(K, X) {
|
|
8853
|
+
var ne;
|
|
8849
8854
|
if (!i.some((he) => he.id === K)) throw new Error(`Unknown schedule item: ${K}`);
|
|
8850
8855
|
const J = i.map((he) => he.id === K ? { ...he, ...X } : he);
|
|
8851
|
-
ii(t, J), i = J,
|
|
8856
|
+
ii(t, J), i = J, $();
|
|
8852
8857
|
const Y = i.find((he) => he.id === K);
|
|
8853
|
-
Y && ((
|
|
8858
|
+
Y && ((ne = e.onItemChange) == null || ne.call(e, structuredClone(Y)));
|
|
8854
8859
|
}
|
|
8855
8860
|
function Te(K) {
|
|
8856
8861
|
var J;
|
|
8857
8862
|
const X = i.find((Y) => Y.id === K);
|
|
8858
|
-
(J = e.onItemOpen) == null || J.call(e, structuredClone(X)),
|
|
8863
|
+
(J = e.onItemOpen) == null || J.call(e, structuredClone(X)), T.hidden = !1, T.dataset.item = K, T.innerHTML = `<header><strong>${we(X.name)}</strong><button data-action="close-detail" aria-label="关闭详情">×</button></header><div class="ps-detail-body"><span class="ps-chip">${we(X.status)}</span><h3>● ${we(X.node)}</h3><form><label>名称<input name="name" required value="${we(X.name)}"></label><label>负责人<select name="personId">${t.map((Y) => `<option value="${we(Y.id)}" ${Y.id === X.personId ? "selected" : ""}>${we(Y.name)}</option>`).join("")}</select></label><label>总估分(pd)<input name="estimate" type="number" min="0" step="0.1" value="${X.estimate}" required></label><label>开始日期<input type="date" name="start" value="${X.start || ""}"></label><label>结束日期<input type="date" name="end" value="${X.end || ""}"></label><p class="ps-error" role="alert"></p><button class="ps-primary" type="submit">保存排期</button><button type="button" data-action="unschedule">移至未排期</button></form></div>`;
|
|
8859
8864
|
}
|
|
8860
|
-
function
|
|
8865
|
+
function at(K, X) {
|
|
8861
8866
|
q("unplanned", X), W.hidden = !1;
|
|
8862
8867
|
const J = t.find((Y) => Y.id === K);
|
|
8863
8868
|
W.innerHTML = `<div class="ps-panel-title">未排期工作项 ${we(J.name)}</div><table><thead><tr><th>名称</th><th>节点 / 状态</th><th>估分</th><th>排期</th></tr></thead><tbody>${i.filter((Y) => Y.personId === K && !Nt(Y)).map((Y) => `<tr><td><button data-open="${we(Y.id)}">${we(Y.name)}</button></td><td>● ${we(Y.node)}</td><td><input type="number" min="0" step="0.1" value="${Y.estimate || ""}" placeholder="待填" data-estimate="${we(Y.id)}" aria-label="${we(Y.name)}估分"></td><td><button class="ps-link" data-open="${we(Y.id)}">待填</button></td></tr>`).join("") || '<tr><td colspan="4">暂无未排期工作项</td></tr>'}</tbody></table>`;
|
|
8864
8869
|
}
|
|
8865
8870
|
const Lt = e.viewStorageKey ?? "rowvia-personnel-views-v1";
|
|
8866
|
-
function
|
|
8871
|
+
function Ze() {
|
|
8867
8872
|
try {
|
|
8868
8873
|
const K = JSON.parse(localStorage.getItem(Lt) || "[]");
|
|
8869
8874
|
return Array.isArray(K) ? K : [];
|
|
@@ -8871,7 +8876,7 @@ function da(s, e) {
|
|
|
8871
8876
|
return [];
|
|
8872
8877
|
}
|
|
8873
8878
|
}
|
|
8874
|
-
|
|
8879
|
+
P.addEventListener("click", (K) => {
|
|
8875
8880
|
const X = K.target, J = X.closest("button");
|
|
8876
8881
|
if (!J) return;
|
|
8877
8882
|
if (J.dataset.open) {
|
|
@@ -8883,17 +8888,17 @@ function da(s, e) {
|
|
|
8883
8888
|
return;
|
|
8884
8889
|
}
|
|
8885
8890
|
if (J.dataset.date) {
|
|
8886
|
-
|
|
8891
|
+
te ? (E = J.dataset.date, te = !1, fe()) : (y = J.dataset.date, E = y, te = !0), Ce();
|
|
8887
8892
|
return;
|
|
8888
8893
|
}
|
|
8889
8894
|
if (J.dataset.preset) {
|
|
8890
|
-
const
|
|
8891
|
-
y = Be(
|
|
8895
|
+
const ne = Number(J.dataset.preset), he = Ae(n), ke = new Date(he * 864e5);
|
|
8896
|
+
y = Be(ne < 2 ? he - ke.getUTCDay() : ne < 4 ? Date.UTC(ke.getUTCFullYear(), ke.getUTCMonth(), 1) / 864e5 : he), E = Be(ne === 2 || ne === 3 ? Date.UTC(ke.getUTCFullYear(), ke.getUTCMonth() + (ne === 2 ? 1 : 2), 0) / 864e5 : Ae(y) + [6, 13, 29, 60, 13, 59, 364][ne]), te = !1, fe(), W.hidden = !0;
|
|
8892
8897
|
return;
|
|
8893
8898
|
}
|
|
8894
8899
|
if (J.dataset.view) {
|
|
8895
|
-
const
|
|
8896
|
-
|
|
8900
|
+
const ne = Ze()[Number(J.dataset.view)];
|
|
8901
|
+
ne && (o = new Set(ne.selected.filter((he) => t.some((ke) => ke.id === he))), { query: r, status: l, sort: c, descending: d, zoom: u, from: h, days: m, rangeStart: y, rangeEnd: E, expanded: f, children: g, loose: p, colorFirst: C, onlyScheduled: a } = ne, $(), W.hidden = !0, U(`已打开 ${ne.name}`));
|
|
8897
8902
|
return;
|
|
8898
8903
|
}
|
|
8899
8904
|
const Y = J.dataset.action;
|
|
@@ -8902,32 +8907,32 @@ function da(s, e) {
|
|
|
8902
8907
|
return;
|
|
8903
8908
|
}
|
|
8904
8909
|
if (Y === "unplanned") {
|
|
8905
|
-
|
|
8910
|
+
at(J.dataset.person, J);
|
|
8906
8911
|
return;
|
|
8907
8912
|
}
|
|
8908
|
-
if (Y === "close-detail" && (
|
|
8909
|
-
const
|
|
8910
|
-
if (!
|
|
8911
|
-
const he =
|
|
8912
|
-
he.push({ name:
|
|
8913
|
+
if (Y === "close-detail" && (T.hidden = !0), Y === "unschedule" && (ce(T.dataset.item, { start: null, end: null }), T.hidden = !0), (Y === "plus" || Y === "minus") && (u = Math.max(0, Math.min(4, u + (Y === "plus" ? 1 : -1))), $()), (Y === "prev" || Y === "next" || Y === "today") && (h = Y === "today" ? Ae(n) - (/* @__PURE__ */ new Date(`${n}T00:00:00Z`)).getUTCDay() : h + (Y === "prev" ? -14 : 14), y = Be(h), E = Be(h + 59), A.scrollLeft = 0, $()), (Y === "asc" || Y === "desc" || Y === "clear-sort") && (d = Y === "desc", Y === "clear-sort" && (c = ""), $(), W.hidden = !0), Y === "clear-filter" && (r = "", l = "", $(), W.hidden = !0), ["compact", "loose", "content", "color"].includes(Y || "") && (Y === "compact" || Y === "loose" ? p = Y === "loose" : C = Y === "color", $(), W.hidden = !0, q("settings", O('[data-action="settings"]'))), (Y === "cal-prev" || Y === "cal-next") && (Z = new Date(Date.UTC(Z.getUTCFullYear(), Z.getUTCMonth() + (Y === "cal-prev" ? -1 : 1), 1)), Ce()), Y === "save-view") {
|
|
8914
|
+
const ne = W.querySelector("[data-view-name]").value.trim();
|
|
8915
|
+
if (!ne) return;
|
|
8916
|
+
const he = Ze();
|
|
8917
|
+
he.push({ name: ne, selected: [...o], query: r, status: l, sort: c, descending: d, zoom: u, from: h, days: m, rangeStart: y, rangeEnd: E, expanded: f, children: g, loose: p, colorFirst: C, onlyScheduled: a });
|
|
8913
8918
|
try {
|
|
8914
8919
|
localStorage.setItem(Lt, JSON.stringify(he)), W.hidden = !0, U("视图已保存");
|
|
8915
8920
|
} catch {
|
|
8916
8921
|
U("浏览器存储不可用,视图未保存");
|
|
8917
8922
|
}
|
|
8918
8923
|
}
|
|
8919
|
-
Y === "schedule" && (W.hidden = !0,
|
|
8920
|
-
}, { signal:
|
|
8924
|
+
Y === "schedule" && (W.hidden = !0, T.hidden = !0);
|
|
8925
|
+
}, { signal: N }), P.addEventListener("input", (K) => {
|
|
8921
8926
|
const X = K.target;
|
|
8922
|
-
X.classList.contains("ps-zoom") && (u = Number(X.value),
|
|
8927
|
+
X.classList.contains("ps-zoom") && (u = Number(X.value), $()), X.classList.contains("ps-person-search") && W.querySelectorAll(".ps-person-options label").forEach((J) => {
|
|
8923
8928
|
var Y;
|
|
8924
8929
|
return J.hidden = !((Y = J.textContent) != null && Y.includes(X.value));
|
|
8925
|
-
}), X.dataset.control === "query" && (r = X.value,
|
|
8926
|
-
}, { signal:
|
|
8930
|
+
}), X.dataset.control === "query" && (r = X.value, $());
|
|
8931
|
+
}, { signal: N }), P.addEventListener("change", (K) => {
|
|
8927
8932
|
const X = K.target;
|
|
8928
|
-
if (X.dataset.person && (X.checked ? o.add(X.dataset.person) : o.delete(X.dataset.person),
|
|
8933
|
+
if (X.dataset.person && (X.checked ? o.add(X.dataset.person) : o.delete(X.dataset.person), $()), X.dataset.estimate) {
|
|
8929
8934
|
const J = Number(X.value);
|
|
8930
|
-
Number.isFinite(J) && J >= 0 &&
|
|
8935
|
+
Number.isFinite(J) && J >= 0 && ce(X.dataset.estimate, { estimate: J });
|
|
8931
8936
|
return;
|
|
8932
8937
|
}
|
|
8933
8938
|
switch (X.dataset.control) {
|
|
@@ -8947,46 +8952,46 @@ function da(s, e) {
|
|
|
8947
8952
|
g = X.checked;
|
|
8948
8953
|
break;
|
|
8949
8954
|
case "range-start":
|
|
8950
|
-
X.value && (y = X.value,
|
|
8955
|
+
X.value && (y = X.value, fe(), Ce());
|
|
8951
8956
|
return;
|
|
8952
8957
|
case "range-end":
|
|
8953
|
-
X.value && (E = X.value,
|
|
8958
|
+
X.value && (E = X.value, fe(), Ce());
|
|
8954
8959
|
return;
|
|
8955
8960
|
}
|
|
8956
|
-
|
|
8957
|
-
}, { signal:
|
|
8961
|
+
$();
|
|
8962
|
+
}, { signal: N }), T.addEventListener("submit", (K) => {
|
|
8958
8963
|
K.preventDefault();
|
|
8959
8964
|
const X = new FormData(K.target), J = String(X.get("start") || "") || null, Y = String(X.get("end") || "") || null;
|
|
8960
8965
|
if (!!J != !!Y || J && Y && J > Y) {
|
|
8961
|
-
|
|
8966
|
+
T.querySelector(".ps-error").textContent = "请填写完整日期,结束日期不能早于开始日期";
|
|
8962
8967
|
return;
|
|
8963
8968
|
}
|
|
8964
|
-
|
|
8965
|
-
}, { signal:
|
|
8966
|
-
|
|
8967
|
-
}, { signal:
|
|
8968
|
-
K.key === "Escape" && (W.hidden = !0,
|
|
8969
|
-
}, { signal:
|
|
8969
|
+
ce(T.dataset.item, { name: String(X.get("name")), personId: String(X.get("personId")), estimate: Number(X.get("estimate")), start: J, end: Y }), T.hidden = !0, U("排期已更新");
|
|
8970
|
+
}, { signal: N }), document.addEventListener("pointerdown", (K) => {
|
|
8971
|
+
P.contains(K.target) ? !W.contains(K.target) && !K.target.closest("[data-action]") && (W.hidden = !0) : W.hidden = !0;
|
|
8972
|
+
}, { signal: N }), P.addEventListener("keydown", (K) => {
|
|
8973
|
+
K.key === "Escape" && (W.hidden = !0, T.hidden = !0);
|
|
8974
|
+
}, { signal: N });
|
|
8970
8975
|
let ve = null;
|
|
8971
8976
|
return j.addEventListener("pointerdown", (K) => {
|
|
8972
8977
|
const X = K.target, J = X.closest(".ps-bar");
|
|
8973
8978
|
if (!J || K.button !== 0) return;
|
|
8974
|
-
const Y = i.find((
|
|
8975
|
-
S = !1, ve = { id: Y.id, x: K.clientX, start: Ae(Y.start), end: Ae(Y.end), edge: X.dataset.edge || "move", bar: J, left: parseFloat(J.style.left), size: parseFloat(J.style.width), delta: 0, scroll:
|
|
8976
|
-
}, { signal:
|
|
8979
|
+
const Y = i.find((ne) => ne.id === J.dataset.item);
|
|
8980
|
+
S = !1, ve = { id: Y.id, x: K.clientX, start: Ae(Y.start), end: Ae(Y.end), edge: X.dataset.edge || "move", bar: J, left: parseFloat(J.style.left), size: parseFloat(J.style.width), delta: 0, scroll: A.scrollLeft };
|
|
8981
|
+
}, { signal: N }), document.addEventListener("pointermove", (K) => {
|
|
8977
8982
|
if (!ve) return;
|
|
8978
|
-
const X = Math.round((K.clientX - ve.x +
|
|
8983
|
+
const X = Math.round((K.clientX - ve.x + A.scrollLeft - ve.scroll) / _());
|
|
8979
8984
|
ve.delta = ve.edge === "start" ? Math.min(X, ve.end - ve.start) : ve.edge === "end" ? Math.max(X, ve.start - ve.end) : X, Math.abs(K.clientX - ve.x) > 4 && (S = !0), S && (ve.bar.style.opacity = ".8", ve.edge === "move" ? ve.bar.style.transform = `translateX(${ve.delta * _()}px)` : (ve.bar.style.left = `${ve.left + (ve.edge === "start" ? ve.delta * _() : 0)}px`, ve.bar.style.width = `${ve.size + (ve.edge === "start" ? -1 : 1) * ve.delta * _()}px`));
|
|
8980
|
-
}, { signal:
|
|
8985
|
+
}, { signal: N }), document.addEventListener("pointerup", () => {
|
|
8981
8986
|
if (!ve) return;
|
|
8982
8987
|
const K = ve;
|
|
8983
|
-
ve = null, S && (
|
|
8984
|
-
}, { signal:
|
|
8985
|
-
ii(K, X), t = structuredClone(K), i = structuredClone(X), o = new Set(t.map((J) => J.id)), W.hidden = !0,
|
|
8986
|
-
}, getItems: () => structuredClone(i), updateItem:
|
|
8987
|
-
o = new Set(K.filter((X) => t.some((J) => J.id === X))),
|
|
8988
|
+
ve = null, S && (ce(K.id, { start: Be(K.start + (K.edge === "end" ? 0 : K.delta)), end: Be(K.end + (K.edge === "start" ? 0 : K.delta)) }), U("排期已更新"));
|
|
8989
|
+
}, { signal: N }), $(), { setData(K, X) {
|
|
8990
|
+
ii(K, X), t = structuredClone(K), i = structuredClone(X), o = new Set(t.map((J) => J.id)), W.hidden = !0, T.hidden = !0, $();
|
|
8991
|
+
}, getItems: () => structuredClone(i), updateItem: ce, setPeople(K) {
|
|
8992
|
+
o = new Set(K.filter((X) => t.some((J) => J.id === X))), $();
|
|
8988
8993
|
}, destroy() {
|
|
8989
|
-
R = !0,
|
|
8994
|
+
R = !0, F.abort(), clearTimeout(z), P.remove();
|
|
8990
8995
|
} };
|
|
8991
8996
|
}
|
|
8992
8997
|
function It(s, e, t, i) {
|
|
@@ -9355,15 +9360,15 @@ function ua(s, e = {}) {
|
|
|
9355
9360
|
maximumFractionDigits: 2
|
|
9356
9361
|
});
|
|
9357
9362
|
function a(m) {
|
|
9358
|
-
var
|
|
9363
|
+
var P, O, A;
|
|
9359
9364
|
const y = document.createElement("div");
|
|
9360
9365
|
y.className = "ticker-cell";
|
|
9361
9366
|
const E = document.createElement("img");
|
|
9362
|
-
E.src = Ds(String(((
|
|
9367
|
+
E.src = Ds(String(((P = m.data) == null ? void 0 : P.ticker) ?? "")), E.alt = `${((O = m.data) == null ? void 0 : O.name) ?? ""} logo`, y.appendChild(E);
|
|
9363
9368
|
const R = document.createElement("b");
|
|
9364
9369
|
R.className = "custom-ticker", R.textContent = String(m.value ?? ""), y.appendChild(R);
|
|
9365
9370
|
const S = document.createElement("span");
|
|
9366
|
-
return S.className = "ticker-name", S.textContent = ` ${((
|
|
9371
|
+
return S.className = "ticker-name", S.textContent = ` ${((A = m.data) == null ? void 0 : A.name) ?? ""}`, y.appendChild(S), y;
|
|
9367
9372
|
}
|
|
9368
9373
|
const r = [
|
|
9369
9374
|
{
|
|
@@ -9508,20 +9513,20 @@ function ha(s, e = {}) {
|
|
|
9508
9513
|
return h.split(/\s+/).map((m) => m[0]).join("").slice(0, 2).toUpperCase();
|
|
9509
9514
|
}
|
|
9510
9515
|
function l(h) {
|
|
9511
|
-
var
|
|
9516
|
+
var A;
|
|
9512
9517
|
const m = document.createElement("div");
|
|
9513
9518
|
m.className = "employeeCell";
|
|
9514
|
-
const y = h.data || {}, E = h.node.group ? h.value : ((
|
|
9519
|
+
const y = h.data || {}, E = h.node.group ? h.value : ((A = y.orgHierarchy) == null ? void 0 : A[y.orgHierarchy.length - 1]) ?? "", R = document.createElement("div");
|
|
9515
9520
|
R.className = "avatar", R.style.backgroundColor = a(String(E)), R.textContent = r(String(E));
|
|
9516
9521
|
const S = document.createElement("div");
|
|
9517
9522
|
S.className = "employeeData";
|
|
9518
|
-
const
|
|
9519
|
-
|
|
9523
|
+
const P = document.createElement("span");
|
|
9524
|
+
P.className = "name", P.textContent = String(E);
|
|
9520
9525
|
const O = document.createElement("span");
|
|
9521
|
-
return O.className = "description", O.textContent = y.jobTitle ?? "", S.appendChild(
|
|
9526
|
+
return O.className = "description", O.textContent = y.jobTitle ?? "", S.appendChild(P), S.appendChild(O), m.appendChild(R), m.appendChild(S), m;
|
|
9522
9527
|
}
|
|
9523
9528
|
function c(h) {
|
|
9524
|
-
const m = String(h.valueFormatted ?? h.value ?? ""), y = Object.keys(zt).find((
|
|
9529
|
+
const m = String(h.valueFormatted ?? h.value ?? ""), y = Object.keys(zt).find((P) => zt[P] === m) ?? "", E = document.createElement("div");
|
|
9525
9530
|
E.className = `tag ${y}Tag`;
|
|
9526
9531
|
const R = document.createElement("span");
|
|
9527
9532
|
R.className = `circle ${y}Circle`, E.appendChild(R);
|
|
@@ -9547,12 +9552,12 @@ function ha(s, e = {}) {
|
|
|
9547
9552
|
return E.textContent = m, y.appendChild(E), y;
|
|
9548
9553
|
}
|
|
9549
9554
|
function f(h) {
|
|
9550
|
-
var
|
|
9555
|
+
var P;
|
|
9551
9556
|
const m = document.createElement("div");
|
|
9552
9557
|
m.className = "contact-cell";
|
|
9553
9558
|
const y = document.createElement("div");
|
|
9554
9559
|
y.className = "iconContainer", y.title = "LinkedIn", y.innerHTML = '<svg viewBox="0 0 24 24" width="14" height="14" fill="#0a66c2"><path d="M4.98 3.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM3 9h4v12H3V9zm7 0h3.8v1.7h.05c.53-1 1.83-2.05 3.77-2.05C21.4 8.65 22 11 22 14.1V21h-4v-6.1c0-1.5-.54-2.5-1.87-2.5-1.02 0-1.63.69-1.9 1.35-.1.23-.13.56-.13.9V21h-4V9z"/></svg>', y.addEventListener("click", () => window.open("https://www.linkedin.com/company/ag-grid/", "_blank")), m.appendChild(y);
|
|
9555
|
-
const E = ((
|
|
9560
|
+
const E = ((P = h.data) == null ? void 0 : P.orgHierarchy) ?? [], R = (E[E.length - 1] ?? "").toLowerCase().replace(/\s+/g, "."), S = document.createElement("div");
|
|
9556
9561
|
return S.className = "iconContainer", S.title = "Email", S.innerHTML = '<svg viewBox="0 0 24 24" width="14" height="14" fill="#39485d"><path d="M2 5h20v14H2V5zm2 2v.7l8 5 8-5V7H4zm0 3.9V17h16v-6.1l-8 5-8-5z"/></svg>', S.addEventListener("click", () => {
|
|
9557
9562
|
window.location.href = `mailto:${R}@company.com`;
|
|
9558
9563
|
}), m.appendChild(S), m;
|
|
@@ -9716,15 +9721,15 @@ function pa(s, e = {}) {
|
|
|
9716
9721
|
return o[String(m.value ?? "all")] ?? String(m.value ?? "");
|
|
9717
9722
|
}
|
|
9718
9723
|
function r(m) {
|
|
9719
|
-
var O,
|
|
9724
|
+
var O, A, j;
|
|
9720
9725
|
const y = document.createElement("div");
|
|
9721
9726
|
y.className = "productCell";
|
|
9722
9727
|
const E = document.createElement("img");
|
|
9723
|
-
E.src = ((O = m.data) == null ? void 0 : O.image) ?? "", E.alt = ((
|
|
9728
|
+
E.src = ((O = m.data) == null ? void 0 : O.image) ?? "", E.alt = ((A = m.data) == null ? void 0 : A.product) ?? "", y.appendChild(E);
|
|
9724
9729
|
const R = document.createElement("div"), S = document.createElement("div");
|
|
9725
9730
|
S.textContent = String(m.value ?? "");
|
|
9726
|
-
const
|
|
9727
|
-
return
|
|
9731
|
+
const P = document.createElement("div");
|
|
9732
|
+
return P.className = "stockCell", P.textContent = ((j = m.data) == null ? void 0 : j.category) ?? "", R.appendChild(S), R.appendChild(P), y.appendChild(R), y;
|
|
9728
9733
|
}
|
|
9729
9734
|
function l(m) {
|
|
9730
9735
|
const y = String(m.value ?? ""), E = document.createElement("div");
|
|
@@ -9735,11 +9740,11 @@ function pa(s, e = {}) {
|
|
|
9735
9740
|
return S.textContent = o[y] ?? y, E.appendChild(S), E;
|
|
9736
9741
|
}
|
|
9737
9742
|
function c(m) {
|
|
9738
|
-
var
|
|
9743
|
+
var P, O;
|
|
9739
9744
|
const y = document.createElement("div");
|
|
9740
9745
|
y.className = "stock";
|
|
9741
9746
|
const E = document.createElement("span");
|
|
9742
|
-
E.textContent = String(((
|
|
9747
|
+
E.textContent = String(((P = m.data) == null ? void 0 : P.available) ?? "");
|
|
9743
9748
|
const R = document.createElement("span");
|
|
9744
9749
|
R.className = "stockText", R.textContent = "Stock /";
|
|
9745
9750
|
const S = document.createElement("span");
|
|
@@ -10013,31 +10018,31 @@ function ga(s, e = {}) {
|
|
|
10013
10018
|
Sweden: "🇸🇪"
|
|
10014
10019
|
}, a = (S) => S.value == null ? "" : `$${Math.round(S.value).toLocaleString("en-US")}`;
|
|
10015
10020
|
function r(S) {
|
|
10016
|
-
const
|
|
10017
|
-
|
|
10021
|
+
const P = document.createElement("span");
|
|
10022
|
+
P.style.display = "inline-flex", P.style.alignItems = "center", P.style.gap = "6px";
|
|
10018
10023
|
const O = document.createElement("span");
|
|
10019
10024
|
O.textContent = o[String(S.value)] ?? "🏳️", O.style.fontSize = "15px";
|
|
10020
|
-
const
|
|
10021
|
-
return
|
|
10025
|
+
const A = document.createElement("span");
|
|
10026
|
+
return A.textContent = String(S.value ?? ""), A.style.overflow = "hidden", A.style.textOverflow = "ellipsis", A.style.whiteSpace = "nowrap", P.appendChild(O), P.appendChild(A), P;
|
|
10022
10027
|
}
|
|
10023
10028
|
const l = '<svg class="starIcon" viewBox="0 0 24 24" width="12" height="12" fill="#f59e0b"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>';
|
|
10024
10029
|
function c(S) {
|
|
10025
|
-
const
|
|
10026
|
-
|
|
10030
|
+
const P = document.createElement("span");
|
|
10031
|
+
P.className = "v-align";
|
|
10027
10032
|
const O = Number(S.value ?? 0);
|
|
10028
10033
|
if (O === 0 && S.isFilterRenderer)
|
|
10029
|
-
return
|
|
10030
|
-
for (let
|
|
10034
|
+
return P.textContent = "(No stars)", P;
|
|
10035
|
+
for (let A = 0; A < O; A++) {
|
|
10031
10036
|
const j = document.createElement("span");
|
|
10032
|
-
j.innerHTML = l,
|
|
10037
|
+
j.innerHTML = l, P.appendChild(j);
|
|
10033
10038
|
}
|
|
10034
|
-
return
|
|
10039
|
+
return P;
|
|
10035
10040
|
}
|
|
10036
10041
|
function d(S) {
|
|
10037
10042
|
return S.value === null || S.value === void 0 ? null : S.value < 0 ? { color: "#e11d48", fontWeight: "bold" } : null;
|
|
10038
10043
|
}
|
|
10039
10044
|
function u(S) {
|
|
10040
|
-
const
|
|
10045
|
+
const P = [
|
|
10041
10046
|
{
|
|
10042
10047
|
headerName: "Participant",
|
|
10043
10048
|
groupId: "participant",
|
|
@@ -10157,7 +10162,7 @@ function ga(s, e = {}) {
|
|
|
10157
10162
|
sortable: !1,
|
|
10158
10163
|
filter: !1,
|
|
10159
10164
|
cellRenderer: "agSparklineCellRenderer",
|
|
10160
|
-
valueGetter: (O) => fi.map((
|
|
10165
|
+
valueGetter: (O) => fi.map((A) => ({ month: A, value: O.data[A] })),
|
|
10161
10166
|
cellRendererParams: {
|
|
10162
10167
|
sparklineOptions: { type: "area" }
|
|
10163
10168
|
}
|
|
@@ -10172,9 +10177,9 @@ function ga(s, e = {}) {
|
|
|
10172
10177
|
filter: "number",
|
|
10173
10178
|
filterParams: { buttons: ["reset"], inRangeInclusive: !0 },
|
|
10174
10179
|
cellClassRules: {
|
|
10175
|
-
"good-score": (
|
|
10176
|
-
"bad-score": (
|
|
10177
|
-
"currency-cell": (
|
|
10180
|
+
"good-score": (A) => typeof A.value == "number" && A.value > 5e4,
|
|
10181
|
+
"bad-score": (A) => typeof A.value == "number" && A.value < 1e4,
|
|
10182
|
+
"currency-cell": (A) => typeof A.value == "number" && A.value >= 1e4 && A.value <= 5e4
|
|
10178
10183
|
},
|
|
10179
10184
|
editable: !0
|
|
10180
10185
|
}))
|
|
@@ -10182,27 +10187,27 @@ function ga(s, e = {}) {
|
|
|
10182
10187
|
}
|
|
10183
10188
|
];
|
|
10184
10189
|
if (S > 0) {
|
|
10185
|
-
const O = Us(S),
|
|
10190
|
+
const O = Us(S), A = /* @__PURE__ */ new Map();
|
|
10186
10191
|
for (const j of O)
|
|
10187
|
-
|
|
10188
|
-
for (const [j, W] of
|
|
10189
|
-
|
|
10192
|
+
A.has(j.group) || A.set(j.group, []), A.get(j.group).push(j);
|
|
10193
|
+
for (const [j, W] of A)
|
|
10194
|
+
P.push({
|
|
10190
10195
|
headerName: j,
|
|
10191
10196
|
groupId: `extra-${j}`,
|
|
10192
10197
|
openByDefault: !0,
|
|
10193
|
-
children: W.map((
|
|
10194
|
-
field:
|
|
10195
|
-
headerName:
|
|
10196
|
-
width:
|
|
10198
|
+
children: W.map((T) => ({
|
|
10199
|
+
field: T.field,
|
|
10200
|
+
headerName: T.field,
|
|
10201
|
+
width: T.width,
|
|
10197
10202
|
editable: !0,
|
|
10198
|
-
cellDataType:
|
|
10199
|
-
filter:
|
|
10200
|
-
valueFormatter:
|
|
10201
|
-
aggFunc:
|
|
10203
|
+
cellDataType: T.dataType !== "text",
|
|
10204
|
+
filter: T.dataType === "text" ? "set" : "number",
|
|
10205
|
+
valueFormatter: T.dataType === "percent" ? (F) => F.value == null ? "" : `${F.value.toFixed(1)}%` : T.dataType === "currency" ? a : void 0,
|
|
10206
|
+
aggFunc: T.dataType === "text" ? void 0 : "sum"
|
|
10202
10207
|
}))
|
|
10203
10208
|
});
|
|
10204
10209
|
}
|
|
10205
|
-
return
|
|
10210
|
+
return P;
|
|
10206
10211
|
}
|
|
10207
10212
|
const f = i.querySelector("#performanceGrid"), g = i.querySelector("#data-size"), p = i.querySelector("#theme-select"), C = i.querySelector("#global-filter");
|
|
10208
10213
|
let h = null, m, y = 0;
|
|
@@ -10211,9 +10216,9 @@ function ga(s, e = {}) {
|
|
|
10211
10216
|
}
|
|
10212
10217
|
function R() {
|
|
10213
10218
|
var Q;
|
|
10214
|
-
const S = ++y, [
|
|
10219
|
+
const S = ++y, [P, O] = g.value.split("x").map(Number), A = Math.max(0, O - 24), j = p.value;
|
|
10215
10220
|
if (h && (h.destroy(), h = null, f.innerHTML = ""), h = n(f, {
|
|
10216
|
-
columnDefs: u(
|
|
10221
|
+
columnDefs: u(A),
|
|
10217
10222
|
rowData: [],
|
|
10218
10223
|
theme: j,
|
|
10219
10224
|
rowNumbers: !0,
|
|
@@ -10244,20 +10249,20 @@ function ga(s, e = {}) {
|
|
|
10244
10249
|
enableCharts: !0
|
|
10245
10250
|
}).api, (Q = e.gridOptions) != null && Q.rowData) return;
|
|
10246
10251
|
h.showLoadingOverlay();
|
|
10247
|
-
const W =
|
|
10248
|
-
let
|
|
10249
|
-
const
|
|
10252
|
+
const W = P > 1e4 ? 1e4 : 1e3, T = Math.ceil(P / W);
|
|
10253
|
+
let F = 0;
|
|
10254
|
+
const N = [], z = Date.now();
|
|
10250
10255
|
Os();
|
|
10251
10256
|
const _ = () => {
|
|
10252
10257
|
if (S !== y) return;
|
|
10253
|
-
const
|
|
10254
|
-
if (
|
|
10258
|
+
const ie = zs(Math.min(W, P - F * W), A);
|
|
10259
|
+
if (N.push(...ie), F++, F < T)
|
|
10255
10260
|
t.timeout(_, 0);
|
|
10256
10261
|
else {
|
|
10257
|
-
const U = Date.now() - z,
|
|
10262
|
+
const U = Date.now() - z, $ = Math.max(0, 500 - U);
|
|
10258
10263
|
t.timeout(() => {
|
|
10259
|
-
S === y && (h == null || h.hideOverlay(), h == null || h.setRowData(
|
|
10260
|
-
},
|
|
10264
|
+
S === y && (h == null || h.hideOverlay(), h == null || h.setRowData(N));
|
|
10265
|
+
}, $);
|
|
10261
10266
|
}
|
|
10262
10267
|
};
|
|
10263
10268
|
t.timeout(_, 0);
|
|
@@ -10293,52 +10298,52 @@ function fa(s, e = {}) {
|
|
|
10293
10298
|
started: `${2015 + h % 10}-0${1 + h % 9}-1${h % 9}`
|
|
10294
10299
|
})), u = 120;
|
|
10295
10300
|
function f(C) {
|
|
10296
|
-
var S,
|
|
10301
|
+
var S, P;
|
|
10297
10302
|
let h = d.slice();
|
|
10298
10303
|
const m = Object.entries(C.filterModel || {});
|
|
10299
10304
|
if (m.length && (h = h.filter(
|
|
10300
|
-
(O) => m.every(([
|
|
10301
|
-
const W = O[
|
|
10302
|
-
if (!
|
|
10305
|
+
(O) => m.every(([A, j]) => {
|
|
10306
|
+
const W = O[A], T = String(W).toLowerCase(), F = String(j.filter ?? "").toLowerCase();
|
|
10307
|
+
if (!F) return !0;
|
|
10303
10308
|
switch (j.type) {
|
|
10304
10309
|
case "notEqual":
|
|
10305
|
-
return
|
|
10310
|
+
return T !== F;
|
|
10306
10311
|
case "startsWith":
|
|
10307
|
-
return
|
|
10312
|
+
return T.startsWith(F);
|
|
10308
10313
|
case "endsWith":
|
|
10309
|
-
return
|
|
10314
|
+
return T.endsWith(F);
|
|
10310
10315
|
default:
|
|
10311
|
-
return
|
|
10316
|
+
return T.includes(F);
|
|
10312
10317
|
}
|
|
10313
10318
|
})
|
|
10314
10319
|
)), (S = C.sortModel) != null && S.length) {
|
|
10315
|
-
const { colId: O, sort:
|
|
10320
|
+
const { colId: O, sort: A } = C.sortModel[0];
|
|
10316
10321
|
h = h.slice().sort((j, W) => {
|
|
10317
|
-
const
|
|
10318
|
-
return
|
|
10322
|
+
const T = j[O] === W[O] ? 0 : j[O] < W[O] ? -1 : 1;
|
|
10323
|
+
return A === "asc" ? T : -T;
|
|
10319
10324
|
});
|
|
10320
10325
|
}
|
|
10321
|
-
const y = C.groupKeys || [], E = (
|
|
10326
|
+
const y = C.groupKeys || [], E = (P = C.rowGroupCols) == null ? void 0 : P[y.length];
|
|
10322
10327
|
if (E) {
|
|
10323
10328
|
const O = h.filter(
|
|
10324
|
-
(
|
|
10325
|
-
const z = C.rowGroupCols[
|
|
10326
|
-
return String(
|
|
10329
|
+
(T) => y.every((F, N) => {
|
|
10330
|
+
const z = C.rowGroupCols[N];
|
|
10331
|
+
return String(T[z.field]) === F;
|
|
10327
10332
|
})
|
|
10328
|
-
),
|
|
10329
|
-
for (const
|
|
10330
|
-
const
|
|
10331
|
-
|
|
10332
|
-
const
|
|
10333
|
-
|
|
10334
|
-
}
|
|
10335
|
-
const W = j.map((
|
|
10336
|
-
const
|
|
10337
|
-
id: `group-${y.join("/")}-${E.field}-${
|
|
10333
|
+
), A = /* @__PURE__ */ new Map(), j = [];
|
|
10334
|
+
for (const T of O) {
|
|
10335
|
+
const F = String(T[E.field]);
|
|
10336
|
+
A.has(F) || (A.set(F, { count: 0, salary: [] }), j.push(F));
|
|
10337
|
+
const N = A.get(F);
|
|
10338
|
+
N.count++, N.salary.push(T.salary);
|
|
10339
|
+
}
|
|
10340
|
+
const W = j.map((T) => {
|
|
10341
|
+
const F = A.get(T), N = {
|
|
10342
|
+
id: `group-${y.join("/")}-${E.field}-${T}`,
|
|
10338
10343
|
__isGroup: !0,
|
|
10339
|
-
childCount:
|
|
10344
|
+
childCount: F.count
|
|
10340
10345
|
};
|
|
10341
|
-
return
|
|
10346
|
+
return N[E.field] = T, N.salary = Math.round(F.salary.reduce((z, _) => z + _, 0) / F.salary.length), N;
|
|
10342
10347
|
});
|
|
10343
10348
|
return { rows: W, lastRow: W.length };
|
|
10344
10349
|
}
|
|
@@ -10436,161 +10441,161 @@ function qs(s) {
|
|
|
10436
10441
|
n.hidden = !0;
|
|
10437
10442
|
let o = null, a = !1, r = [i.innerHTML], l = 0, c = !1, d = null;
|
|
10438
10443
|
const u = () => {
|
|
10439
|
-
const
|
|
10440
|
-
|
|
10444
|
+
const T = window.getSelection();
|
|
10445
|
+
T != null && T.rangeCount && i.contains(T.anchorNode) && i.contains(T.focusNode) && (o = T.getRangeAt(0).cloneRange());
|
|
10441
10446
|
}, f = () => {
|
|
10442
10447
|
i.focus();
|
|
10443
|
-
const
|
|
10444
|
-
if (!
|
|
10445
|
-
const
|
|
10446
|
-
|
|
10448
|
+
const T = window.getSelection();
|
|
10449
|
+
if (!T) return;
|
|
10450
|
+
const F = o && i.contains(o.commonAncestorContainer) ? o : document.createRange();
|
|
10451
|
+
F !== o && (F.selectNodeContents(i), F.collapse(!1)), T.removeAllRanges(), T.addRange(F), o = F;
|
|
10447
10452
|
}, g = () => {
|
|
10448
10453
|
n.hidden = !0, n.replaceChildren();
|
|
10449
10454
|
}, p = /* @__PURE__ */ new Map(), C = () => {
|
|
10450
|
-
var
|
|
10455
|
+
var T;
|
|
10451
10456
|
p.get("撤销").disabled = s.readonly || l === 0, p.get("重做").disabled = s.readonly || l === r.length - 1;
|
|
10452
|
-
for (const [
|
|
10453
|
-
const z = p.get(
|
|
10457
|
+
for (const [F, N] of [["加粗", "bold"], ["斜体", "italic"], ["下划线", "underline"], ["删除线", "strikeThrough"], ["有序列表", "insertOrderedList"], ["无序列表", "insertUnorderedList"]]) {
|
|
10458
|
+
const z = p.get(F);
|
|
10454
10459
|
if (!z) continue;
|
|
10455
|
-
const _ = !!((
|
|
10460
|
+
const _ = !!((T = document.queryCommandState) != null && T.call(document, N));
|
|
10456
10461
|
z.classList.toggle("active", _), z.setAttribute("aria-pressed", String(_));
|
|
10457
10462
|
}
|
|
10458
10463
|
}, h = () => {
|
|
10459
10464
|
c || (i.innerHTML !== r[l] && (r = r.slice(0, l + 1), r.push(i.innerHTML), r.length > 100 && r.shift(), l = r.length - 1), u(), C());
|
|
10460
10465
|
}, m = () => {
|
|
10461
10466
|
h(), i.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
10462
|
-
}, y = (
|
|
10463
|
-
const
|
|
10464
|
-
|
|
10465
|
-
}, E = (
|
|
10466
|
-
s.readonly || (f(), document.execCommand(
|
|
10467
|
-
}, R = (
|
|
10467
|
+
}, y = (T) => {
|
|
10468
|
+
const F = l + T;
|
|
10469
|
+
F < 0 || F >= r.length || (l = F, c = !0, i.innerHTML = r[l], o = null, f(), c = !1, C(), i.dispatchEvent(new Event("change", { bubbles: !0 })));
|
|
10470
|
+
}, E = (T, F) => {
|
|
10471
|
+
s.readonly || (f(), document.execCommand(T, !1, F), u(), g(), m());
|
|
10472
|
+
}, R = (T) => {
|
|
10468
10473
|
if (s.readonly) return;
|
|
10469
10474
|
f();
|
|
10470
|
-
const
|
|
10471
|
-
|
|
10472
|
-
}, S = (
|
|
10475
|
+
const F = window.getSelection().getRangeAt(0);
|
|
10476
|
+
F.deleteContents(), F.insertNode(T), F.setStartAfter(T), F.collapse(!0), o = F.cloneRange(), g(), m();
|
|
10477
|
+
}, S = (T, F, N, z = !0) => {
|
|
10473
10478
|
const _ = ye("button", z ? "fc-rich-tool fc-rich-advanced" : "fc-rich-tool");
|
|
10474
|
-
return _.type = "button", _.ariaLabel =
|
|
10479
|
+
return _.type = "button", _.ariaLabel = T, _.title = T, _.disabled = s.readonly, ni[F] ? _.innerHTML = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${ni[F]}</svg>` : _.textContent = F, _.onmousedown = (Q) => {
|
|
10475
10480
|
Q.preventDefault(), u();
|
|
10476
10481
|
}, _.onclick = (Q) => {
|
|
10477
|
-
Q.stopPropagation(),
|
|
10478
|
-
}, t.append(_), p.set(
|
|
10479
|
-
},
|
|
10480
|
-
if (u(), !n.hidden && n.ariaLabel ===
|
|
10482
|
+
Q.stopPropagation(), N();
|
|
10483
|
+
}, t.append(_), p.set(T, _), _;
|
|
10484
|
+
}, P = (T, F) => {
|
|
10485
|
+
if (u(), !n.hidden && n.ariaLabel === T) {
|
|
10481
10486
|
g();
|
|
10482
10487
|
return;
|
|
10483
10488
|
}
|
|
10484
|
-
n.replaceChildren(), n.className = "fc-rich-menu", n.ariaLabel =
|
|
10485
|
-
const
|
|
10486
|
-
n.style.left = `${Math.max(4, Math.min(
|
|
10487
|
-
}, O = (
|
|
10488
|
-
const
|
|
10489
|
-
return
|
|
10490
|
-
z.stopPropagation(),
|
|
10491
|
-
}, n.append(
|
|
10489
|
+
n.replaceChildren(), n.className = "fc-rich-menu", n.ariaLabel = T, F(), n.hidden = !1;
|
|
10490
|
+
const N = p.get(T);
|
|
10491
|
+
n.style.left = `${Math.max(4, Math.min(N.offsetLeft, e.clientWidth - 280))}px`;
|
|
10492
|
+
}, O = (T, F) => {
|
|
10493
|
+
const N = ye("button", "fc-rich-menu-option", T);
|
|
10494
|
+
return N.type = "button", N.onmousedown = (z) => z.preventDefault(), N.onclick = (z) => {
|
|
10495
|
+
z.stopPropagation(), F();
|
|
10496
|
+
}, n.append(N), N;
|
|
10492
10497
|
};
|
|
10493
10498
|
S("撤销", "undo", () => y(-1), !1), S("重做", "redo", () => y(1), !1), S("格式刷", "paint", () => {
|
|
10494
10499
|
u();
|
|
10495
|
-
const
|
|
10496
|
-
!
|
|
10497
|
-
}), S("正文样式", "Aa⌄", () =>
|
|
10498
|
-
for (const [
|
|
10500
|
+
const T = o == null ? void 0 : o.startContainer, F = (T == null ? void 0 : T.nodeType) === 1 ? T : T == null ? void 0 : T.parentElement;
|
|
10501
|
+
!F || !i.contains(F) || (d = { tag: /^(B|STRONG|I|EM|U|S)$/.test(F.tagName) ? F.tagName.toLowerCase() : "span", css: F.getAttribute("style") || "" }, p.get("格式刷").classList.add("active"));
|
|
10502
|
+
}), S("正文样式", "Aa⌄", () => P("正文样式", () => {
|
|
10503
|
+
for (const [T, F] of [["正文", "p"], ["标题 1", "h1"], ["标题 2", "h2"], ["标题 3", "h3"], ["标题 4", "h4"], ["标题 5", "h5"]]) O(T, () => E("formatBlock", F));
|
|
10499
10504
|
}));
|
|
10500
|
-
const
|
|
10501
|
-
for (const [
|
|
10502
|
-
S(
|
|
10505
|
+
const A = ["#1f2329", "#8f959e", "#ffffff", "#f54a45", "#ff8800", "#ffc60a", "#34c724", "#14b8a6", "#3370ff", "#7f3bf5", "#f7cdd9", "#fce2cf", "#fff3b8", "#d9f5d6", "#d6e8ff", "#e9ddfa"];
|
|
10506
|
+
for (const [T, F, N] of [["文字颜色", "A⌄", "foreColor"], ["背景高亮", "▰⌄", "hiliteColor"]])
|
|
10507
|
+
S(T, F, () => P(T, () => {
|
|
10503
10508
|
n.classList.add("fc-rich-colors");
|
|
10504
|
-
for (const z of
|
|
10505
|
-
const _ = O(z, () => E(
|
|
10506
|
-
_.textContent = "", _.style.backgroundColor = z, _.ariaLabel = `${
|
|
10509
|
+
for (const z of A) {
|
|
10510
|
+
const _ = O(z, () => E(N, z));
|
|
10511
|
+
_.textContent = "", _.style.backgroundColor = z, _.ariaLabel = `${T} ${z}`;
|
|
10507
10512
|
}
|
|
10508
|
-
O("清除", () => E(
|
|
10513
|
+
O("清除", () => E(N, N === "foreColor" ? "#1f2329" : "transparent"));
|
|
10509
10514
|
}));
|
|
10510
|
-
for (const [
|
|
10511
|
-
S("对齐", "☰⌄", () =>
|
|
10512
|
-
for (const [
|
|
10515
|
+
for (const [T, F, N] of [["加粗", "B", "bold"], ["斜体", "I", "italic"], ["下划线", "U", "underline"], ["删除线", "S", "strikeThrough"]]) S(T, F, () => E(N));
|
|
10516
|
+
S("对齐", "☰⌄", () => P("对齐", () => {
|
|
10517
|
+
for (const [T, F] of [["左对齐", "justifyLeft"], ["居中对齐", "justifyCenter"], ["右对齐", "justifyRight"], ["两端对齐", "justifyFull"]]) O(T, () => E(F));
|
|
10513
10518
|
})), S("有序列表", "1≡", () => E("insertOrderedList")), S("无序列表", "•≡", () => E("insertUnorderedList")), S("任务列表", "task", () => {
|
|
10514
10519
|
f();
|
|
10515
|
-
const
|
|
10516
|
-
|
|
10520
|
+
const T = window.getSelection().getRangeAt(0), F = ye("ul"), N = ye("li");
|
|
10521
|
+
N.dataset.task = "true";
|
|
10517
10522
|
const z = ye("input");
|
|
10518
|
-
z.type = "checkbox", z.contentEditable = "false",
|
|
10519
|
-
}), S("引用", "quote", () => E("formatBlock", "blockquote")), S("缩进", "indent", () =>
|
|
10523
|
+
z.type = "checkbox", z.contentEditable = "false", N.append(z, T.extractContents()), N.textContent || N.append(document.createTextNode("待办事项")), F.append(N), R(F);
|
|
10524
|
+
}), S("引用", "quote", () => E("formatBlock", "blockquote")), S("缩进", "indent", () => P("缩进", () => {
|
|
10520
10525
|
O("增加缩进", () => E("indent")), O("减少缩进", () => E("outdent"));
|
|
10521
|
-
})), S("分隔线", "line", () => R(ye("hr"))), S("表格", "table", () =>
|
|
10522
|
-
const
|
|
10523
|
-
n.append(
|
|
10524
|
-
for (let
|
|
10526
|
+
})), S("分隔线", "line", () => R(ye("hr"))), S("表格", "table", () => P("表格", () => {
|
|
10527
|
+
const T = ye("p", "", "选择行列"), F = ye("div", "fc-rich-table-grid");
|
|
10528
|
+
n.append(T, F);
|
|
10529
|
+
for (let N = 1; N <= 6; N++) for (let z = 1; z <= 6; z++) {
|
|
10525
10530
|
const _ = ye("button");
|
|
10526
|
-
_.type = "button", _.ariaLabel = `${
|
|
10527
|
-
|
|
10531
|
+
_.type = "button", _.ariaLabel = `${N}行${z}列表格`, _.dataset.row = String(N), _.dataset.col = String(z), _.onmousedown = (Q) => Q.preventDefault(), _.onmouseenter = () => {
|
|
10532
|
+
T.textContent = `${N} × ${z}`, F.querySelectorAll("button").forEach((Q) => Q.classList.toggle("active", Number(Q.dataset.row) <= N && Number(Q.dataset.col) <= z));
|
|
10528
10533
|
}, _.onclick = () => {
|
|
10529
|
-
const Q = ye("table"),
|
|
10530
|
-
for (let
|
|
10534
|
+
const Q = ye("table"), ie = ye("tbody");
|
|
10535
|
+
for (let $ = 0; $ < N; $++) {
|
|
10531
10536
|
const q = ye("tr");
|
|
10532
10537
|
for (let Z = 0; Z < z; Z++) {
|
|
10533
|
-
const
|
|
10534
|
-
|
|
10538
|
+
const te = ye("td");
|
|
10539
|
+
te.append(ye("br")), q.append(te);
|
|
10535
10540
|
}
|
|
10536
|
-
|
|
10541
|
+
ie.append(q);
|
|
10537
10542
|
}
|
|
10538
|
-
Q.append(
|
|
10543
|
+
Q.append(ie), R(Q);
|
|
10539
10544
|
const U = document.createRange();
|
|
10540
10545
|
U.selectNodeContents(Q.querySelector("td")), U.collapse(!0), o = U, f();
|
|
10541
|
-
},
|
|
10546
|
+
}, F.append(_);
|
|
10542
10547
|
}
|
|
10543
10548
|
}));
|
|
10544
|
-
const j = () =>
|
|
10545
|
-
const
|
|
10546
|
-
|
|
10547
|
-
const
|
|
10548
|
-
|
|
10549
|
-
const
|
|
10549
|
+
const j = () => P("链接", () => {
|
|
10550
|
+
const T = ye("input", "fc-input");
|
|
10551
|
+
T.ariaLabel = "链接文本", T.placeholder = "输入文本", T.value = (o == null ? void 0 : o.toString()) || "";
|
|
10552
|
+
const F = ye("input", "fc-input");
|
|
10553
|
+
F.ariaLabel = "链接地址", F.placeholder = "粘贴或输入超链接";
|
|
10554
|
+
const N = ye("div", "fc-error"), z = ye("button", "primary", "确定");
|
|
10550
10555
|
z.type = "button", z.onclick = () => {
|
|
10551
|
-
const _ =
|
|
10556
|
+
const _ = F.value.trim();
|
|
10552
10557
|
if (!Cn(_)) {
|
|
10553
|
-
|
|
10558
|
+
N.textContent = "请输入 http、https 或 mailto 链接";
|
|
10554
10559
|
return;
|
|
10555
10560
|
}
|
|
10556
|
-
const Q = ye("a", "",
|
|
10561
|
+
const Q = ye("a", "", T.value || _);
|
|
10557
10562
|
Q.href = _, Q.target = "_blank", Q.rel = "noopener noreferrer", R(Q);
|
|
10558
|
-
}, n.append(ye("span", "", "文本"),
|
|
10563
|
+
}, n.append(ye("span", "", "文本"), T, ye("span", "", "链接"), F, N, z), T.focus();
|
|
10559
10564
|
});
|
|
10560
|
-
S("链接", "link", j), S("代码块", "{ }", () => E("formatBlock", "pre")), S("表情", "☺", () =>
|
|
10565
|
+
S("链接", "link", j), S("代码块", "{ }", () => E("formatBlock", "pre")), S("表情", "☺", () => P("表情", () => {
|
|
10561
10566
|
n.classList.add("fc-rich-emojis");
|
|
10562
|
-
for (const
|
|
10567
|
+
for (const T of ["😀", "😊", "😂", "👍", "👏", "🎉", "❤️", "🔥", "✅", "💡", "🚀", "👀", "🤔", "🙏", "💪", "⭐"]) O(T, () => R(document.createTextNode(T)));
|
|
10563
10568
|
}));
|
|
10564
10569
|
const W = S("全屏编辑", "expand", () => {
|
|
10565
10570
|
u(), a = !a, e.classList.toggle("is-fullscreen", a), g(), W.ariaLabel = W.title = a ? "收起全屏" : "全屏编辑", W.innerHTML = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7">${ni[a ? "collapse" : "expand"]}</svg>`, f();
|
|
10566
10571
|
}, !1);
|
|
10567
10572
|
return W.disabled = !1, W.classList.add("fc-rich-expand"), i.addEventListener("input", h), i.addEventListener("mouseup", () => {
|
|
10568
10573
|
if (u(), C(), d && o && !o.collapsed) {
|
|
10569
|
-
const
|
|
10570
|
-
|
|
10574
|
+
const T = o, F = ye(d.tag);
|
|
10575
|
+
F.style.cssText = d.css, F.append(T.extractContents()), T.insertNode(F), d = null, p.get("格式刷").classList.remove("active"), m();
|
|
10571
10576
|
}
|
|
10572
10577
|
}), i.addEventListener("keyup", () => {
|
|
10573
10578
|
u(), C();
|
|
10574
|
-
}), i.addEventListener("click", (
|
|
10575
|
-
const
|
|
10576
|
-
|
|
10577
|
-
}), i.addEventListener("drop", (
|
|
10578
|
-
var
|
|
10579
|
-
|
|
10580
|
-
const
|
|
10581
|
-
if (
|
|
10579
|
+
}), i.addEventListener("click", (T) => {
|
|
10580
|
+
const F = T.target;
|
|
10581
|
+
F.tagName === "A" && T.preventDefault(), F instanceof HTMLInputElement && F.type === "checkbox" && (F.toggleAttribute("checked", F.checked), m()), g();
|
|
10582
|
+
}), i.addEventListener("drop", (T) => T.preventDefault()), i.addEventListener("paste", (T) => {
|
|
10583
|
+
var N, z;
|
|
10584
|
+
T.preventDefault(), u();
|
|
10585
|
+
const F = (N = T.clipboardData) == null ? void 0 : N.getData("text/html");
|
|
10586
|
+
if (F) {
|
|
10582
10587
|
const _ = document.createElement("template");
|
|
10583
|
-
_.innerHTML = Wt(
|
|
10584
|
-
const Q = _.content,
|
|
10585
|
-
Q.append(
|
|
10588
|
+
_.innerHTML = Wt(F);
|
|
10589
|
+
const Q = _.content, ie = document.createTextNode("");
|
|
10590
|
+
Q.append(ie), f();
|
|
10586
10591
|
const U = window.getSelection().getRangeAt(0);
|
|
10587
|
-
U.deleteContents(), U.insertNode(Q), U.setStartAfter(
|
|
10588
|
-
} else R(document.createTextNode(((z =
|
|
10589
|
-
}), e.addEventListener("keydown", (
|
|
10590
|
-
|
|
10592
|
+
U.deleteContents(), U.insertNode(Q), U.setStartAfter(ie), U.collapse(!0), o = U.cloneRange(), m();
|
|
10593
|
+
} else R(document.createTextNode(((z = T.clipboardData) == null ? void 0 : z.getData("text/plain")) || ""));
|
|
10594
|
+
}), e.addEventListener("keydown", (T) => {
|
|
10595
|
+
T.key === "Escape" && !n.hidden ? (T.preventDefault(), T.stopPropagation(), g(), f()) : T.key === "Escape" && a ? (T.preventDefault(), T.stopPropagation(), W.click()) : (T.metaKey || T.ctrlKey) && T.key.toLowerCase() === "z" ? (T.preventDefault(), y(T.shiftKey ? 1 : -1)) : (T.metaKey || T.ctrlKey) && T.key.toLowerCase() === "k" && (T.preventDefault(), u(), j());
|
|
10591
10596
|
}), e.append(t, i, n), C(), { element: e, read: () => Wt(i.innerHTML), validate: () => {
|
|
10592
|
-
var
|
|
10593
|
-
return s.field.required && !((
|
|
10597
|
+
var T;
|
|
10598
|
+
return s.field.required && !((T = i.textContent) != null && T.trim()) ? "请填写内容" : void 0;
|
|
10594
10599
|
}, focus: () => i.focus() };
|
|
10595
10600
|
}
|
|
10596
10601
|
const Se = (s, e, t) => {
|
|
@@ -10629,27 +10634,27 @@ function js(s) {
|
|
|
10629
10634
|
g.textContent = p() || "", g.textContent || f();
|
|
10630
10635
|
};
|
|
10631
10636
|
for (let U = 0; U < (t ? 2 : 1); U++) {
|
|
10632
|
-
const
|
|
10633
|
-
|
|
10637
|
+
const $ = Se("input", "fc-input fc-calendar-date");
|
|
10638
|
+
$.type = "text", $.value = o[U], $.placeholder = t ? U ? "结束日期" : "开始日期" : "YYYY-MM-DD", $.ariaLabel = t ? $.placeholder : s.field.label, $.disabled = s.readonly, $.onfocus = () => {
|
|
10634
10639
|
if (r = U, l = U === 1, Bt(o[U])) {
|
|
10635
10640
|
const q = /* @__PURE__ */ new Date(`${o[U]}T12:00:00`);
|
|
10636
10641
|
c = new Date(q.getFullYear(), q.getMonth(), 1);
|
|
10637
10642
|
}
|
|
10638
10643
|
Q();
|
|
10639
|
-
},
|
|
10640
|
-
if (q.stopPropagation(), o[U] =
|
|
10644
|
+
}, $.addEventListener("change", (q) => {
|
|
10645
|
+
if (q.stopPropagation(), o[U] = $.value.trim(), Bt(o[U])) {
|
|
10641
10646
|
const Z = /* @__PURE__ */ new Date(`${o[U]}T12:00:00`);
|
|
10642
10647
|
c = new Date(Z.getFullYear(), Z.getMonth(), 1);
|
|
10643
10648
|
}
|
|
10644
10649
|
Q(), C();
|
|
10645
|
-
}), d.append(
|
|
10650
|
+
}), d.append($), u.push($);
|
|
10646
10651
|
}
|
|
10647
10652
|
const h = Se("div", "fc-calendar-header"), m = Se("button", "fc-calendar-month");
|
|
10648
10653
|
m.type = "button", m.ariaLabel = "选择年份和月份", m.setAttribute("aria-expanded", "false"), m.setAttribute("aria-live", "polite");
|
|
10649
|
-
const y = (U,
|
|
10654
|
+
const y = (U, $, q) => {
|
|
10650
10655
|
const Z = Se("button", "fc-calendar-nav");
|
|
10651
|
-
return Z.type = "button", Z.ariaLabel = U, Z.innerHTML = `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${q ? "M10 6l-6 6 6 6M19 6l-6 6 6 6" : "M15 6l-6 6 6 6"}"/></svg>`,
|
|
10652
|
-
c = new Date(c.getFullYear(), c.getMonth() +
|
|
10656
|
+
return Z.type = "button", Z.ariaLabel = U, Z.innerHTML = `<svg viewBox="0 0 24 24" aria-hidden="true"><path d="${q ? "M10 6l-6 6 6 6M19 6l-6 6 6 6" : "M15 6l-6 6 6 6"}"/></svg>`, $ > 0 && Z.classList.add("next"), Z.onclick = () => {
|
|
10657
|
+
c = new Date(c.getFullYear(), c.getMonth() + $, 1), Q();
|
|
10653
10658
|
}, Z;
|
|
10654
10659
|
};
|
|
10655
10660
|
h.append(y("上一年", -12, !0), y("上个月", -1, !1), m, y("下个月", 1, !1), y("下一年", 12, !0));
|
|
@@ -10659,78 +10664,78 @@ function js(s) {
|
|
|
10659
10664
|
R.setAttribute("role", "group"), R.ariaLabel = "选择日期";
|
|
10660
10665
|
const S = Se("div", "fc-calendar-period");
|
|
10661
10666
|
S.hidden = !0;
|
|
10662
|
-
const
|
|
10663
|
-
|
|
10664
|
-
const O = Se("div", "fc-calendar-period-columns"),
|
|
10665
|
-
|
|
10667
|
+
const P = Se("button", "fc-calendar-back", "‹ 返回选择日期");
|
|
10668
|
+
P.type = "button";
|
|
10669
|
+
const O = Se("div", "fc-calendar-period-columns"), A = Se("div", "fc-calendar-period-list");
|
|
10670
|
+
A.setAttribute("role", "group"), A.ariaLabel = "年份";
|
|
10666
10671
|
const j = Se("div", "fc-calendar-period-list");
|
|
10667
|
-
j.setAttribute("role", "group"), j.ariaLabel = "月份", O.append(
|
|
10668
|
-
let W = "period",
|
|
10669
|
-
const
|
|
10670
|
-
const
|
|
10671
|
-
for (const [Z,
|
|
10672
|
-
for (const
|
|
10673
|
-
const
|
|
10674
|
-
|
|
10675
|
-
}
|
|
10676
|
-
}, z = (U,
|
|
10672
|
+
j.setAttribute("role", "group"), j.ariaLabel = "月份", O.append(A, j), S.append(P, O);
|
|
10673
|
+
let W = "period", T = 0;
|
|
10674
|
+
const F = [], N = (U = !1) => {
|
|
10675
|
+
const $ = a[T].split(":").map(Number), q = W === "period" ? [[A, c.getFullYear(), "年"], [j, c.getMonth() + 1, "月"]] : [[A, $[0], "时"], [j, $[1], "分"]];
|
|
10676
|
+
for (const [Z, te, Ce] of q)
|
|
10677
|
+
for (const fe of Z.querySelectorAll("button")) {
|
|
10678
|
+
const ce = Number(fe.dataset.value) === te;
|
|
10679
|
+
fe.classList.toggle("selected", ce), fe.setAttribute("aria-pressed", String(ce)), fe.textContent = `${W === "time" ? Tt(Number(fe.dataset.value)) : fe.dataset.value}${ce ? Ce : ""}`, ce && U && (Z.scrollTop = Math.max(0, fe.offsetTop - 108));
|
|
10680
|
+
}
|
|
10681
|
+
}, z = (U, $) => {
|
|
10677
10682
|
const q = Se("button", "fc-calendar-period-option", String(U));
|
|
10678
|
-
return q.type = "button", q.dataset.value = String(U), q.ariaLabel = `${W === "time" ? Tt(U) : U}${W === "time" ?
|
|
10683
|
+
return q.type = "button", q.dataset.value = String(U), q.ariaLabel = `${W === "time" ? Tt(U) : U}${W === "time" ? $ ? "时" : "分" : $ ? "年" : "月"}`, q.disabled = W === "time" && s.readonly, q.onclick = () => {
|
|
10679
10684
|
if (W === "time") {
|
|
10680
|
-
const Z = a[
|
|
10681
|
-
Z[
|
|
10685
|
+
const Z = a[T].split(":");
|
|
10686
|
+
Z[$ ? 0 : 1] = Tt(U), a[T] = Z.join(":"), F[T].textContent = a[T], N(), C();
|
|
10682
10687
|
return;
|
|
10683
10688
|
}
|
|
10684
|
-
c.setFullYear(
|
|
10689
|
+
c.setFullYear($ ? U : c.getFullYear(), $ ? c.getMonth() : U - 1, 1), N(), Q();
|
|
10685
10690
|
}, q;
|
|
10686
|
-
}, _ = (U,
|
|
10687
|
-
if (W = U,
|
|
10688
|
-
for (let q = Math.max(1, c.getFullYear() - 100); q <= Math.min(9999, c.getFullYear() + 100); q++)
|
|
10691
|
+
}, _ = (U, $ = 0) => {
|
|
10692
|
+
if (W = U, T = $, A.replaceChildren(), j.replaceChildren(), A.ariaLabel = U === "period" ? "年份" : "小时", j.ariaLabel = U === "period" ? "月份" : "分钟", U === "period") {
|
|
10693
|
+
for (let q = Math.max(1, c.getFullYear() - 100); q <= Math.min(9999, c.getFullYear() + 100); q++) A.append(z(q, !0));
|
|
10689
10694
|
for (let q = 1; q <= 12; q++) j.append(z(q, !1));
|
|
10690
10695
|
} else {
|
|
10691
|
-
for (let q = 0; q < 24; q++)
|
|
10696
|
+
for (let q = 0; q < 24; q++) A.append(z(q, !0));
|
|
10692
10697
|
for (let q = 0; q < 60; q++) j.append(z(q, !1));
|
|
10693
10698
|
}
|
|
10694
|
-
i.classList.add("choosing-period"), S.hidden = !1, (U === "period" ? m :
|
|
10699
|
+
i.classList.add("choosing-period"), S.hidden = !1, (U === "period" ? m : F[$]).setAttribute("aria-expanded", "true"), N(!0), P.focus();
|
|
10695
10700
|
};
|
|
10696
|
-
m.onclick = () => _("period"),
|
|
10701
|
+
m.onclick = () => _("period"), P.onclick = () => {
|
|
10697
10702
|
i.classList.remove("choosing-period"), S.hidden = !0;
|
|
10698
|
-
const U = W === "period" ? m :
|
|
10703
|
+
const U = W === "period" ? m : F[T];
|
|
10699
10704
|
U.setAttribute("aria-expanded", "false"), Q(), U.focus();
|
|
10700
10705
|
}, S.addEventListener("keydown", (U) => {
|
|
10701
|
-
if (U.key === "Escape" && (U.preventDefault(), U.stopPropagation(),
|
|
10702
|
-
const
|
|
10706
|
+
if (U.key === "Escape" && (U.preventDefault(), U.stopPropagation(), P.click()), !["ArrowUp", "ArrowDown", "Home", "End"].includes(U.key)) return;
|
|
10707
|
+
const $ = U.target, q = $.closest(".fc-calendar-period-list");
|
|
10703
10708
|
if (!q) return;
|
|
10704
|
-
const Z = [...q.querySelectorAll("button")],
|
|
10709
|
+
const Z = [...q.querySelectorAll("button")], te = Z.indexOf($), Ce = U.key === "Home" ? 0 : U.key === "End" ? Z.length - 1 : Math.max(0, Math.min(Z.length - 1, te + (U.key === "ArrowDown" ? 1 : -1)));
|
|
10705
10710
|
U.preventDefault(), Z[Ce].focus();
|
|
10706
10711
|
});
|
|
10707
10712
|
function Q() {
|
|
10708
|
-
m.textContent = `${c.getFullYear()}年 ${c.getMonth() + 1}月`, u.forEach((
|
|
10709
|
-
for (let
|
|
10713
|
+
m.textContent = `${c.getFullYear()}年 ${c.getMonth() + 1}月`, u.forEach(($, q) => $.classList.toggle("active", q === r)), R.replaceChildren();
|
|
10714
|
+
for (let $ = 0; $ < c.getDay(); $++) R.append(Se("span", "fc-calendar-blank"));
|
|
10710
10715
|
const U = new Date(c.getFullYear(), c.getMonth() + 1, 0).getDate();
|
|
10711
|
-
for (let
|
|
10712
|
-
const q = mi(new Date(c.getFullYear(), c.getMonth(),
|
|
10716
|
+
for (let $ = 1; $ <= U; $++) {
|
|
10717
|
+
const q = mi(new Date(c.getFullYear(), c.getMonth(), $)), Z = Se("button", "fc-calendar-day", String($));
|
|
10713
10718
|
Z.type = "button", Z.ariaLabel = q, Z.disabled = s.readonly;
|
|
10714
|
-
const
|
|
10715
|
-
Z.classList.toggle("selected",
|
|
10719
|
+
const te = o[0] === q || t && o[1] === q;
|
|
10720
|
+
Z.classList.toggle("selected", te), Z.setAttribute("aria-pressed", String(te)), Z.classList.toggle("in-range", t && !!o[0] && !!o[1] && q > o[0] && q < o[1]), q === mi(/* @__PURE__ */ new Date()) && (Z.classList.add("today"), Z.setAttribute("aria-current", "date")), Z.onclick = () => {
|
|
10716
10721
|
var Ce;
|
|
10717
|
-
t ? l ? (o[1] = q, o[0] && o[1] < o[0] && ([o[0], o[1]] = [o[1], o[0]]), r = 0, l = !1) : (o[0] = q, o[1] = "", r = 1, l = !0) : o[0] = q, u.forEach((
|
|
10722
|
+
t ? l ? (o[1] = q, o[0] && o[1] < o[0] && ([o[0], o[1]] = [o[1], o[0]]), r = 0, l = !1) : (o[0] = q, o[1] = "", r = 1, l = !0) : o[0] = q, u.forEach((fe, ce) => fe.value = o[ce]), Q(), !t || o[1] ? C() : g.textContent = "", (Ce = R.querySelector(`[aria-label="${q}"]`)) == null || Ce.focus();
|
|
10718
10723
|
}, R.append(Z);
|
|
10719
10724
|
}
|
|
10720
10725
|
}
|
|
10721
10726
|
if (i.append(d, h, E, R, S), e) {
|
|
10722
10727
|
const U = Se("div", "fc-calendar-time");
|
|
10723
|
-
for (let
|
|
10724
|
-
const q = Se("div", "fc-calendar-time-field"), Z = t ?
|
|
10725
|
-
|
|
10728
|
+
for (let $ = 0; $ < (t ? 2 : 1); $++) {
|
|
10729
|
+
const q = Se("div", "fc-calendar-time-field"), Z = t ? $ ? "结束时间" : "开始时间" : "时间", te = Se("button", "fc-input fc-calendar-time-trigger", a[$]);
|
|
10730
|
+
te.type = "button", te.disabled = s.readonly, te.ariaLabel = Z, te.setAttribute("aria-expanded", "false"), te.onclick = () => _("time", $), F.push(te), q.append(Se("span", "", Z), te), U.append(q);
|
|
10726
10731
|
}
|
|
10727
10732
|
i.append(U);
|
|
10728
10733
|
}
|
|
10729
|
-
const
|
|
10730
|
-
return
|
|
10734
|
+
const ie = Se("button", "fc-calendar-clear", "清空");
|
|
10735
|
+
return ie.type = "button", ie.disabled = s.readonly, ie.onclick = () => {
|
|
10731
10736
|
o.fill(""), u.forEach((U) => U.value = ""), r = 0, l = !1, Q(), C();
|
|
10732
|
-
}, i.append(
|
|
10733
|
-
const U = o.slice(0, t ? 2 : 1).map((
|
|
10737
|
+
}, i.append(ie, g), Q(), { element: i, read: () => {
|
|
10738
|
+
const U = o.slice(0, t ? 2 : 1).map(($, q) => $ ? $ + (e ? `T${a[q]}` : "") : "");
|
|
10734
10739
|
return t ? U.some(Boolean) ? U : [] : U[0];
|
|
10735
10740
|
}, validate: p, focus: () => u[0].focus() };
|
|
10736
10741
|
}
|
|
@@ -11006,10 +11011,10 @@ const ln = {
|
|
|
11006
11011
|
menu: '<path d="M4 6h16M4 12h12M4 18h16"/>',
|
|
11007
11012
|
more: '<circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/>',
|
|
11008
11013
|
inbox: '<path d="m5 4-3 10v6h20v-6L19 4ZM2 14h6l2 3h4l2-3h6"/>'
|
|
11009
|
-
},
|
|
11014
|
+
}, xe = (s) => `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${ln[s] || ln.check}</svg>`, ae = (s) => String(s ?? "").replace(
|
|
11010
11015
|
/[&<>"']/g,
|
|
11011
11016
|
(e) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[e]
|
|
11012
|
-
), se = (s, e, t = "", i = "") => `<button type="button" data-action="${s}" class="${i}" aria-label="${ae(e)}">${t ?
|
|
11017
|
+
), se = (s, e, t = "", i = "") => `<button type="button" data-action="${s}" class="${i}" aria-label="${ae(e)}">${t ? xe(t) : ""}${e ? `<span>${ae(e)}</span>` : ""}</button>`;
|
|
11013
11018
|
function ma(s) {
|
|
11014
11019
|
s = { ...s, fields: s.fields.map((w) => ({ ...w })) }, s.container.classList.add("rowvia-work-items");
|
|
11015
11020
|
const e = Xs(s.controls);
|
|
@@ -11033,50 +11038,50 @@ function ma(s) {
|
|
|
11033
11038
|
), g = s.storageKey, p = (w, b = s.container) => b.querySelector(`:scope ${w}`), C = an(g, s.items);
|
|
11034
11039
|
for (const w of C.items)
|
|
11035
11040
|
w.comments ?? (w.comments = []), w.history ?? (w.history = []), w.roles ?? (w.roles = []), w.meetings ?? (w.meetings = []);
|
|
11036
|
-
let h = on(), m = "全部", y = "", E = !1, R = 0, S = null,
|
|
11041
|
+
let h = on(), m = "全部", y = "", E = !1, R = 0, S = null, P = null, O = null, A = null, j = null, W = "基本信息", T = 0, F = 0, N = "", z = [];
|
|
11037
11042
|
s.container.innerHTML = `<section class="content">
|
|
11038
11043
|
<div class="work-page"><section class="list-area"><div class="list-tabs" role="tablist">${["全部", "最近浏览", "我创建的", "我参与的", "我关注的", "我收藏的"].map((w, b) => `<button class="list-tab ${b === 0 ? "active" : ""}" role="tab" aria-selected="${b === 0}" data-tab="${w}">${w}</button>`).join("")}<div class="create-button">${se("create", "新建", "plus", "primary")}${se("create-menu", "", "down", "primary")}</div></div>
|
|
11039
11044
|
<div class="toolbar">${se("filter", "筛选", "filter")}${se("sort", "排序", "sort")}${se("group", "分组", "group")}${se("color", "设置颜色", "color")}<div class="search-wrap hidden"><input id="search" aria-label="按标题查找" placeholder="按标题查找"><span id="matches"></span>${se("previous-match", "", "up")}${se("next-match", "", "down")}<label><input id="filter-search" type="checkbox">过滤</label>${se("close-search", "", "close")}</div>${se("search", "查找", "search")}<div class="right">${se("reset", "重置", "", "hidden")}${se("controls", "控件管理", "edit")}${se("saved-views", "切换视图", "down")}${se("save-view", "存为视图", "save", "outline")}</div></div><div class="selection-bar hidden"></div><div class="grid-wrap"><div id="grid"></div></div></section></div></section>`;
|
|
11040
11045
|
function _(w, b) {
|
|
11041
|
-
var
|
|
11046
|
+
var L, B;
|
|
11042
11047
|
if (!w) return '<span class="placeholder">暂无</span>';
|
|
11043
11048
|
let x = b === "status" ? w === "废弃" || w === "选题通过" ? "green" : w === "进入选题会" ? "cyan" : "" : b === "category" ? w === "干货洞察" ? "teal" : "green" : b === "format" && w === "图文" ? "purple" : "pink";
|
|
11044
|
-
const
|
|
11045
|
-
return `<span class="tag ${x}" ${
|
|
11049
|
+
const M = (B = (L = u(b)) == null ? void 0 : L.colors) == null ? void 0 : B[w];
|
|
11050
|
+
return `<span class="tag ${x}" ${M ? `style="background:${ae(M)}"` : ""}>${ae(w)}</span>`;
|
|
11046
11051
|
}
|
|
11047
11052
|
const Q = (w) => w ? `<span class="person"><span class="avatar">体验官</span>${ae(w)}</span>` : '<span class="placeholder">暂无</span>';
|
|
11048
|
-
function
|
|
11053
|
+
function ie(w) {
|
|
11049
11054
|
if (w.node.group) return "";
|
|
11050
|
-
const b = w.data, x = w.colDef.field,
|
|
11051
|
-
|
|
11052
|
-
const
|
|
11053
|
-
if (
|
|
11054
|
-
|
|
11055
|
-
else if ((
|
|
11055
|
+
const b = w.data, x = w.colDef.field, M = document.createElement("div");
|
|
11056
|
+
M.className = "rendered-cell";
|
|
11057
|
+
const L = u(x);
|
|
11058
|
+
if (L && (L.control || !["title", "vote", "status", "person", "relation"].includes(L.kind || "text")))
|
|
11059
|
+
M.append(e.resolve(L).render(Oe(L, b, "cell")));
|
|
11060
|
+
else if ((L == null ? void 0 : L.kind) === "title") {
|
|
11056
11061
|
const B = document.createElement("a");
|
|
11057
|
-
B.className = "item-name", B.href = `#item/${b.id}`, B.textContent = b[x], B.title = b[x], B.addEventListener("click", (
|
|
11058
|
-
|
|
11059
|
-
}),
|
|
11060
|
-
const
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
}, (
|
|
11064
|
-
} else (
|
|
11062
|
+
B.className = "item-name", B.href = `#item/${b.id}`, B.textContent = b[x], B.title = b[x], B.addEventListener("click", (D) => {
|
|
11063
|
+
D.preventDefault(), clearTimeout(F), D.detail === 0 ? Ne(b) : D.detail === 1 && (F = window.setTimeout(() => Ne(b), 280));
|
|
11064
|
+
}), M.append(B);
|
|
11065
|
+
const H = document.createElement("button");
|
|
11066
|
+
H.className = "inline-edit", H.innerHTML = xe("pencil"), H.ariaLabel = "编辑选题概要", H.onclick = (D) => {
|
|
11067
|
+
D.stopPropagation(), ze(M, x, b, w.rowIndex);
|
|
11068
|
+
}, (L == null ? void 0 : L.editable) !== !1 && M.append(H);
|
|
11069
|
+
} else (L == null ? void 0 : L.kind) === "vote" ? (M.innerHTML = `<button class="vote ${b.vote ? "voted" : ""}" aria-label="${b.vote ? "取消投票" : "投票"}">${xe("plus")}${b.vote ? "1" : "投票"}</button>`, p("button", M).onclick = (B) => {
|
|
11065
11070
|
B.stopPropagation(), Ce(b, "vote", b.vote ? "" : "体验官");
|
|
11066
|
-
}) : (
|
|
11067
|
-
B.stopPropagation(), ze(
|
|
11068
|
-
})) : (
|
|
11069
|
-
B.stopPropagation(), ze(
|
|
11070
|
-
})) : (
|
|
11071
|
-
if (
|
|
11071
|
+
}) : (L == null ? void 0 : L.kind) === "person" ? (M.innerHTML = Q(b[x]), L.editable !== !1 && (M.onclick = () => ze(M, x, b, w.rowIndex))) : (L == null ? void 0 : L.kind) === "status" ? (M.innerHTML = `${_(b.status, x)}<span class="status-days">20 天</span>`, (L == null ? void 0 : L.editable) !== !1 && (M.onclick = (B) => {
|
|
11072
|
+
B.stopPropagation(), ze(M, x, b, w.rowIndex);
|
|
11073
|
+
})) : (L == null ? void 0 : L.kind) === "relation" ? (M.innerHTML = b[x] ? `<button class="relation-tag ${b.id === "7105330263" ? "pink" : ""}" title="${ae(b[x])}">${ae(b[x])}</button>` : '<span class="placeholder">暂无</span>', (L == null ? void 0 : L.editable) !== !1 && (M.onclick = () => ze(M, x, b, w.rowIndex))) : (L == null ? void 0 : L.kind) === "multiSelect" ? M.innerHTML = (Array.isArray(b[x]) ? b[x] : []).map((B) => _(B, x)).join("") || '<span class="placeholder">暂无</span>' : f[x] ? (M.innerHTML = ["creator", "owner", "space"].includes(x) ? ae(b[x]) : _(b[x], x), (L == null ? void 0 : L.editable) !== !1 && (M.onclick = (B) => {
|
|
11074
|
+
B.stopPropagation(), ze(M, x, b, w.rowIndex);
|
|
11075
|
+
})) : (M.innerHTML = `<span class="cell-text">${ae(b[x] || "暂无")}</span>`, b[x] || M.classList.add("placeholder"));
|
|
11076
|
+
if (L && L.editable !== !1 && L.kind !== "vote" && L.kind !== "title") {
|
|
11072
11077
|
const B = document.createElement("button");
|
|
11073
|
-
B.className = "inline-edit field-control", B.ariaLabel = `${
|
|
11074
|
-
|
|
11075
|
-
), B.onclick = (
|
|
11076
|
-
|
|
11077
|
-
},
|
|
11078
|
+
B.className = "inline-edit field-control", B.ariaLabel = `${L.kind === "status" ? "流转" : "编辑"}${L.label}`, B.innerHTML = xe(
|
|
11079
|
+
L.kind === "status" ? "transition" : ["select", "multiSelect", "person"].includes(L.kind || "") ? "down" : "pencil"
|
|
11080
|
+
), B.onclick = (H) => {
|
|
11081
|
+
H.stopPropagation(), ze(M, x, b, w.rowIndex);
|
|
11082
|
+
}, M.append(B);
|
|
11078
11083
|
}
|
|
11079
|
-
return
|
|
11084
|
+
return M.title = String(b[x] ?? ""), M;
|
|
11080
11085
|
}
|
|
11081
11086
|
function U() {
|
|
11082
11087
|
return [
|
|
@@ -11097,8 +11102,8 @@ function ma(s) {
|
|
|
11097
11102
|
cellRenderer: (w) => {
|
|
11098
11103
|
if (w.node.group) return "";
|
|
11099
11104
|
const b = document.createElement("div");
|
|
11100
|
-
return b.className = "row-controls", b.innerHTML = `<span class="row-number">${w.rowIndex + 1}</span><input class="row-checkbox" type="checkbox" aria-label="选择第 ${w.rowIndex + 1} 行" ${w.node.isSelected() ? "checked" : ""}><button class="row-open" aria-label="展开详情">${
|
|
11101
|
-
x.stopPropagation(),
|
|
11105
|
+
return b.className = "row-controls", b.innerHTML = `<span class="row-number">${w.rowIndex + 1}</span><input class="row-checkbox" type="checkbox" aria-label="选择第 ${w.rowIndex + 1} 行" ${w.node.isSelected() ? "checked" : ""}><button class="row-open" aria-label="展开详情">${xe("expand")}</button>`, p("input", b).onclick = (x) => x.stopPropagation(), p("input", b).onchange = (x) => w.node.setSelected(x.target.checked), p("button", b).onclick = (x) => {
|
|
11106
|
+
x.stopPropagation(), Ne(w.data);
|
|
11102
11107
|
}, b;
|
|
11103
11108
|
}
|
|
11104
11109
|
},
|
|
@@ -11115,9 +11120,9 @@ function ma(s) {
|
|
|
11115
11120
|
comparator: w.options ? (b, x) => w.options.indexOf(b) - w.options.indexOf(x) : void 0,
|
|
11116
11121
|
sortable: !1,
|
|
11117
11122
|
suppressMenu: !0,
|
|
11118
|
-
cellRenderer:
|
|
11123
|
+
cellRenderer: ie,
|
|
11119
11124
|
cellStyle: ({ data: b }) => {
|
|
11120
|
-
const x = b && h.colors.find((
|
|
11125
|
+
const x = b && h.colors.find((M) => !!M.scope && M.scope !== "row" && M.field === w.key && ve(b, M));
|
|
11121
11126
|
return x ? { backgroundColor: x.color } : {};
|
|
11122
11127
|
},
|
|
11123
11128
|
tooltipField: w.key,
|
|
@@ -11128,8 +11133,10 @@ function ma(s) {
|
|
|
11128
11133
|
{
|
|
11129
11134
|
colId: "_add",
|
|
11130
11135
|
suppressMovable: !0,
|
|
11131
|
-
headerName: "
|
|
11132
|
-
width:
|
|
11136
|
+
headerName: "新增字段",
|
|
11137
|
+
width: 40,
|
|
11138
|
+
minWidth: 40,
|
|
11139
|
+
maxWidth: 40,
|
|
11133
11140
|
sortable: !1,
|
|
11134
11141
|
resizable: !1,
|
|
11135
11142
|
suppressMenu: !0,
|
|
@@ -11137,7 +11144,7 @@ function ma(s) {
|
|
|
11137
11144
|
}
|
|
11138
11145
|
];
|
|
11139
11146
|
}
|
|
11140
|
-
const
|
|
11147
|
+
const $ = yn(p("#grid"), {
|
|
11141
11148
|
columnDefs: U(),
|
|
11142
11149
|
rowData: C.items,
|
|
11143
11150
|
getRowId: ({ data: w }) => w.id,
|
|
@@ -11159,11 +11166,11 @@ function ma(s) {
|
|
|
11159
11166
|
},
|
|
11160
11167
|
onCellValueChanged: (w) => {
|
|
11161
11168
|
w.data.history.push(`更新${w.colDef.headerName}:${w.newValue}`), q(), queueMicrotask(() => {
|
|
11162
|
-
l ||
|
|
11169
|
+
l || te();
|
|
11163
11170
|
});
|
|
11164
11171
|
},
|
|
11165
11172
|
onSelectionChanged: () => {
|
|
11166
|
-
|
|
11173
|
+
ne(), $.api.refreshCells({ force: !0 });
|
|
11167
11174
|
},
|
|
11168
11175
|
onRowGroupOpened: () => J(),
|
|
11169
11176
|
localeText: {
|
|
@@ -11175,20 +11182,20 @@ function ma(s) {
|
|
|
11175
11182
|
searchOoo: "搜索…"
|
|
11176
11183
|
}
|
|
11177
11184
|
});
|
|
11178
|
-
|
|
11185
|
+
$.grid.getEventService().addEventListener(
|
|
11179
11186
|
"rowDragEnd",
|
|
11180
11187
|
(w) => {
|
|
11181
11188
|
if (!w.overNode || w.overNode.group || w.node.id === w.overNode.id)
|
|
11182
11189
|
return;
|
|
11183
|
-
const b = C.items.findIndex((
|
|
11190
|
+
const b = C.items.findIndex((L) => L.id === w.node.id), x = C.items.findIndex((L) => L.id === w.overNode.id);
|
|
11184
11191
|
if (b < 0 || x < 0) return;
|
|
11185
|
-
const [
|
|
11186
|
-
C.items.splice(x, 0,
|
|
11192
|
+
const [M] = C.items.splice(b, 1);
|
|
11193
|
+
C.items.splice(x, 0, M), h.sorts = [], q(), te();
|
|
11187
11194
|
}
|
|
11188
|
-
),
|
|
11195
|
+
), $.grid.getEventService().addEventListener(
|
|
11189
11196
|
"columnHeaderClicked",
|
|
11190
11197
|
(w) => {
|
|
11191
|
-
w.column.colId === "_add" &&
|
|
11198
|
+
w.column.colId === "_add" && ct(
|
|
11192
11199
|
p('.ag-header-cell[data-colid="_add"]'),
|
|
11193
11200
|
"_add",
|
|
11194
11201
|
!1
|
|
@@ -11201,7 +11208,7 @@ function ma(s) {
|
|
|
11201
11208
|
try {
|
|
11202
11209
|
localStorage.setItem(g, JSON.stringify(C));
|
|
11203
11210
|
} catch {
|
|
11204
|
-
|
|
11211
|
+
fe("浏览器存储不可用,本次修改仅在当前页面保留");
|
|
11205
11212
|
}
|
|
11206
11213
|
}
|
|
11207
11214
|
function Z() {
|
|
@@ -11209,8 +11216,8 @@ function ma(s) {
|
|
|
11209
11216
|
(w) => (h.showTerminated || w.status !== "已终止") && sn(w, h.filters) && (m !== "最近浏览" || w.viewed) && (m !== "我关注的" || w.followed) && (m !== "我收藏的" || w.starred) && (m !== "我参与的" || w.owner === s.currentUser) && (m !== "我创建的" || w.creator === s.currentUser) && (!E || !y || w.name.toLowerCase().includes(y.toLowerCase()))
|
|
11210
11217
|
);
|
|
11211
11218
|
}
|
|
11212
|
-
function
|
|
11213
|
-
o == null || o(),
|
|
11219
|
+
function te() {
|
|
11220
|
+
o == null || o(), $.api.setRowData(Z()), $.api.setSortModel(h.sorts), $.columnApi.setRowGroupColumns(h.groups), $.api.redrawRows(), it();
|
|
11214
11221
|
for (const [w, b] of [
|
|
11215
11222
|
["filter", h.filters.length],
|
|
11216
11223
|
["sort", h.sorts.length],
|
|
@@ -11219,120 +11226,125 @@ function ma(s) {
|
|
|
11219
11226
|
]) {
|
|
11220
11227
|
const x = p(`[data-action="${w}"]`);
|
|
11221
11228
|
x.classList.toggle("is-set", !!b);
|
|
11222
|
-
const
|
|
11229
|
+
const M = {
|
|
11223
11230
|
filter: "筛选",
|
|
11224
11231
|
sort: "排序",
|
|
11225
11232
|
group: "分组",
|
|
11226
11233
|
color: "设置颜色"
|
|
11227
11234
|
};
|
|
11228
|
-
p("span", x).textContent =
|
|
11235
|
+
p("span", x).textContent = M[w] + (b ? ` · ${b}` : "");
|
|
11229
11236
|
}
|
|
11230
11237
|
p('[data-action="reset"]').classList.toggle(
|
|
11231
11238
|
"hidden",
|
|
11232
11239
|
!h.filters.length && !h.sorts.length && !h.groups.length && !h.colors.length
|
|
11233
|
-
),
|
|
11240
|
+
), ne(), Y(), J();
|
|
11234
11241
|
}
|
|
11235
11242
|
function Ce(w, b, x) {
|
|
11236
|
-
var
|
|
11243
|
+
var M;
|
|
11237
11244
|
w[b] = x, w.history.push(
|
|
11238
|
-
`更新${((
|
|
11239
|
-
), q(),
|
|
11245
|
+
`更新${((M = d.find(([L]) => L === b)) == null ? void 0 : M[1]) || b}:${String(x)}`
|
|
11246
|
+
), q(), te();
|
|
11240
11247
|
}
|
|
11241
|
-
function
|
|
11248
|
+
function fe(w) {
|
|
11242
11249
|
var x;
|
|
11243
|
-
(x = p(".toast")) == null || x.remove(), clearTimeout(
|
|
11250
|
+
(x = p(".toast")) == null || x.remove(), clearTimeout(T);
|
|
11244
11251
|
const b = document.createElement("div");
|
|
11245
|
-
b.className = "toast", b.setAttribute("role", "status"), b.innerHTML =
|
|
11252
|
+
b.className = "toast", b.setAttribute("role", "status"), b.innerHTML = xe("check") + ae(w), s.container.append(b), T = window.setTimeout(() => b.remove(), 2500);
|
|
11246
11253
|
}
|
|
11247
|
-
function
|
|
11254
|
+
function ce(w = !0) {
|
|
11248
11255
|
var b;
|
|
11249
|
-
w && n && !n() || (n = null, (b = i == null ? void 0 : i.destroy) == null || b.call(i), i = null, S == null || S.remove(), S = null,
|
|
11256
|
+
w && n && !n() || (n = null, (b = i == null ? void 0 : i.destroy) == null || b.call(i), i = null, S == null || S.remove(), S = null, N = "");
|
|
11250
11257
|
}
|
|
11251
|
-
function Te(w, b, x,
|
|
11252
|
-
|
|
11258
|
+
function Te(w, b, x, M = 460, L = "") {
|
|
11259
|
+
ce(), S = document.createElement("section"), S.className = `popup ${L}`, S.setAttribute("role", "dialog"), S.ariaLabel = b || "列操作", S.style.width = `${M}px`, S.innerHTML = `${b ? `<div class="popup-head"><span>${ae(b)}</span>${se("close-popup", "", "close")}</div>` : ""}${x}`, s.container.append(S);
|
|
11253
11260
|
const B = w.getBoundingClientRect();
|
|
11254
|
-
return S.style.left = `${Math.max(12, Math.min(B.left, innerWidth -
|
|
11261
|
+
return S.style.left = `${Math.max(12, Math.min(B.left, innerWidth - M - 16))}px`, S.style.top = `${Math.min(B.bottom + 8, Math.max(12, innerHeight - S.offsetHeight - 16))}px`, S;
|
|
11255
11262
|
}
|
|
11256
|
-
function
|
|
11257
|
-
return `<select ${x}>${w.map(([
|
|
11263
|
+
function at(w, b, x = "") {
|
|
11264
|
+
return `<select ${x}>${w.map(([M, L]) => `<option value="${ae(M)}" ${M === b ? "selected" : ""}>${ae(L)}</option>`).join("")}</select>`;
|
|
11258
11265
|
}
|
|
11259
11266
|
function Lt(w, b, x) {
|
|
11260
|
-
const
|
|
11267
|
+
const M = Te(
|
|
11261
11268
|
w,
|
|
11262
11269
|
d.find(([B]) => B === b)[1],
|
|
11263
11270
|
'<input class="value-search" placeholder="搜索" aria-label="搜索选项"><div class="value-options"></div>',
|
|
11264
11271
|
240
|
|
11265
|
-
),
|
|
11266
|
-
p(".value-options",
|
|
11267
|
-
(
|
|
11272
|
+
), L = (B = "") => {
|
|
11273
|
+
p(".value-options", M).innerHTML = [...f[b] || []].filter((H) => H.includes(B)).map(
|
|
11274
|
+
(H) => `<button class="menu-option" data-value="${ae(H)}">${_(H, b)}<span class="spacer"></span>${(Array.isArray(x[b]) ? x[b].includes(H) : x[b] === H) ? "✓" : ""}</button>`
|
|
11268
11275
|
).join("") + '<button class="menu-option" data-value="">清空</button>';
|
|
11269
11276
|
};
|
|
11270
|
-
|
|
11271
|
-
var
|
|
11272
|
-
const
|
|
11277
|
+
L(), p("input", M).oninput = (B) => L(B.target.value), M.onclick = (B) => {
|
|
11278
|
+
var D;
|
|
11279
|
+
const H = B.target.closest(
|
|
11273
11280
|
"[data-value]"
|
|
11274
11281
|
);
|
|
11275
|
-
if (
|
|
11276
|
-
if (B.stopPropagation(), ((
|
|
11277
|
-
const
|
|
11282
|
+
if (H)
|
|
11283
|
+
if (B.stopPropagation(), ((D = u(b)) == null ? void 0 : D.kind) === "multiSelect") {
|
|
11284
|
+
const k = H.dataset.value, I = Array.isArray(x[b]) ? x[b] : [];
|
|
11278
11285
|
Ce(
|
|
11279
11286
|
x,
|
|
11280
11287
|
b,
|
|
11281
|
-
|
|
11282
|
-
),
|
|
11288
|
+
k ? I.includes(k) ? I.filter((G) => G !== k) : [...I, k] : []
|
|
11289
|
+
), L(p("input", M).value);
|
|
11283
11290
|
} else
|
|
11284
|
-
Ce(x, b,
|
|
11291
|
+
Ce(x, b, H.dataset.value), ce();
|
|
11285
11292
|
};
|
|
11286
11293
|
}
|
|
11287
|
-
function
|
|
11288
|
-
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11294
|
+
function Ze(w, b, x = {}) {
|
|
11295
|
+
s.container.querySelectorAll(".field-picker").forEach((D) => D.remove());
|
|
11296
|
+
const M = document.createElement("div");
|
|
11297
|
+
M.className = "field-picker", M.innerHTML = `<input placeholder="搜索字段" aria-label="搜索字段"><div class="picker-tabs">${["推荐", "文本", "选择", "人员", "时间", "关系", "其他"].map((D) => `<button data-kind="${D}">${D}</button>`).join("")}</div><div class="field-options"></div>`, s.container.append(M);
|
|
11298
|
+
const L = w.getBoundingClientRect();
|
|
11299
|
+
M.style.left = `${Math.max(12, Math.min(L.left, innerWidth - 410))}px`, M.style.top = `${Math.max(12, Math.min(L.bottom + 4, innerHeight - 340))}px`;
|
|
11300
|
+
let B = "推荐";
|
|
11301
|
+
const H = (D = "推荐", k = "") => {
|
|
11302
|
+
p(".field-options", M).innerHTML = d.filter(
|
|
11303
|
+
([I, G]) => {
|
|
11304
|
+
var V, ee, re, oe, ue, pe;
|
|
11305
|
+
return (!x.available || x.available(I)) && G.includes(k) && (D === "推荐" || D === "文本" && ["title", "text", "longText", "richText"].includes(
|
|
11306
|
+
((V = u(I)) == null ? void 0 : V.kind) || "text"
|
|
11307
|
+
) || D === "选择" && ["status", "select", "multiSelect"].includes(((ee = u(I)) == null ? void 0 : ee.kind) || "") || D === "人员" && ((re = u(I)) == null ? void 0 : re.kind) === "person" || D === "时间" && ["date", "dateTime"].includes(((oe = u(I)) == null ? void 0 : oe.kind) || "") || D === "关系" && ((ue = u(I)) == null ? void 0 : ue.kind) === "relation" || D === "其他" && ((pe = u(I)) == null ? void 0 : pe.kind) === "vote");
|
|
11299
11308
|
}
|
|
11300
11309
|
).map(
|
|
11301
|
-
([
|
|
11302
|
-
).join("")
|
|
11310
|
+
([I, G]) => `<button data-field="${ae(I)}" ${x.onCreate ? `data-insert="${ae(I)}"` : ""} class="menu-option">${xe("table")}${ae(G)}</button>`
|
|
11311
|
+
).join(""), x.onCreate && p(".field-options", M).insertAdjacentHTML("beforeend", `<button class="menu-option new-field" data-create-field>${xe("add")}添加字段</button>`), M.querySelectorAll("[data-kind]").forEach((I) => {
|
|
11312
|
+
I.classList.toggle("active", I.dataset.kind === D), I.setAttribute("aria-pressed", String(I.dataset.kind === D));
|
|
11313
|
+
});
|
|
11303
11314
|
};
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11315
|
+
H(), p("input", M).oninput = (D) => H(B, D.target.value), M.onclick = (D) => {
|
|
11316
|
+
var I;
|
|
11317
|
+
const k = D.target.closest("button");
|
|
11318
|
+
k && (D.stopPropagation(), k.dataset.kind && (B = k.dataset.kind, H(B, p("input", M).value)), k.dataset.field && (M.remove(), b(k.dataset.field)), k.hasAttribute("data-create-field") && (M.remove(), (I = x.onCreate) == null || I.call(x)));
|
|
11307
11319
|
};
|
|
11308
11320
|
}
|
|
11309
11321
|
function ve(w, b) {
|
|
11310
11322
|
return !!b.field && (!!b.value || ["blank", "notBlank"].includes(b.operator)) && sn(w, [b]);
|
|
11311
11323
|
}
|
|
11312
11324
|
function K(w) {
|
|
11313
|
-
const b = h.colors.map((
|
|
11325
|
+
const b = h.colors.map((I, G) => {
|
|
11314
11326
|
var ue;
|
|
11315
|
-
const V = (ue = u(
|
|
11316
|
-
["contains", f[
|
|
11327
|
+
const V = (ue = u(I.field)) == null ? void 0 : ue.label, ee = I.field ? [
|
|
11328
|
+
["contains", f[I.field] ? "存在选项属于" : "包含"],
|
|
11317
11329
|
["equals", "等于"],
|
|
11318
11330
|
["notEqual", "不等于"],
|
|
11319
11331
|
["blank", "为空"],
|
|
11320
11332
|
["notBlank", "不为空"]
|
|
11321
|
-
] : [["", "运算符"]],
|
|
11333
|
+
] : [["", "运算符"]], re = !I.field || ["blank", "notBlank"].includes(I.operator), oe = f[I.field] ? at([["", "请选择目标值"], ...f[I.field].map((pe) => [pe, pe])], I.value, `data-rule-value="${G}" aria-label="目标值" ${re ? "disabled" : ""}`) : `<input data-rule-value="${G}" aria-label="目标值" placeholder="请选择目标值" value="${ae(I.value)}" ${re ? "disabled" : ""}>`;
|
|
11322
11334
|
return `<div class="color-condition" data-color-row="${G}">
|
|
11323
11335
|
<button class="color-drag" draggable="true" title="拖动调整条件优先级" aria-label="拖动条件">⠿</button>
|
|
11324
|
-
<button type="button" class="color-swatch" data-color="${G}" style="background-color:${ae(
|
|
11325
|
-
<button type="button" class="field-select" data-color-scope="${G}" aria-label="着色范围" aria-expanded="false">${!
|
|
11326
|
-
<button class="field-select ${V ? "" : "empty"}" data-pick="${G}">${ae(V || "请选择筛选项")}${
|
|
11327
|
-
${
|
|
11328
|
-
${
|
|
11329
|
-
<button class="color-remove" data-remove="${G}" aria-label="删除条件" title="删除条件">${
|
|
11330
|
-
<div class="color-more-wrap"><button class="color-more" data-color-more="${G}" aria-label="更多条件操作" aria-expanded="false">${
|
|
11336
|
+
<button type="button" class="color-swatch" data-color="${G}" style="background-color:${ae(I.color)}" aria-label="着色颜色" title="设置颜色" aria-expanded="false"></button>
|
|
11337
|
+
<button type="button" class="field-select" data-color-scope="${G}" aria-label="着色范围" aria-expanded="false">${!I.scope || I.scope === "row" ? "整行" : "单元格"}${xe("down")}</button>
|
|
11338
|
+
<button class="field-select ${V ? "" : "empty"}" data-pick="${G}">${ae(V || "请选择筛选项")}${xe("down")}</button>
|
|
11339
|
+
${at(ee, I.field ? I.operator : "", `data-operator="${G}" aria-label="运算符" ${I.field ? "" : "disabled"}`)}
|
|
11340
|
+
${oe}
|
|
11341
|
+
<button class="color-remove" data-remove="${G}" aria-label="删除条件" title="删除条件">${xe("close")}</button>
|
|
11342
|
+
<div class="color-more-wrap"><button class="color-more" data-color-more="${G}" aria-label="更多条件操作" aria-expanded="false">${xe("more")}</button><div class="color-rule-menu hidden"><button data-color-copy="${G}">复制条件</button><button data-color-up="${G}" ${G === 0 ? "disabled" : ""}>上移</button><button data-color-down="${G}" ${G === h.colors.length - 1 ? "disabled" : ""}>下移</button></div></div>
|
|
11331
11343
|
</div>`;
|
|
11332
|
-
}).join(""), x = Te(w, "", `<div class="color-panel-title">设置颜色条件<span class="color-help" tabindex="0" title="按条件优先级着色;同一范围满足多个条件时,使用最上方条件的颜色。" aria-label="颜色条件说明">i</span></div><div class="color-conditions">${b}</div><div class="color-panel-footer"><button class="add-condition">${
|
|
11333
|
-
x.ariaLabel = "设置颜色条件",
|
|
11334
|
-
const
|
|
11335
|
-
|
|
11344
|
+
}).join(""), x = Te(w, "", `<div class="color-panel-title">设置颜色条件<span class="color-help" tabindex="0" title="按条件优先级着色;同一范围满足多个条件时,使用最上方条件的颜色。" aria-label="颜色条件说明">i</span></div><div class="color-conditions">${b}</div><div class="color-panel-footer"><button class="add-condition">${xe("plus")}添加着色条件</button><button class="clear-rules" ${h.colors.length ? "" : "disabled"}>清空全部条件</button></div>`, Math.min(944, innerWidth - 24), "color-panel");
|
|
11345
|
+
x.ariaLabel = "设置颜色条件", N = "color";
|
|
11346
|
+
const M = () => K(w), L = () => {
|
|
11347
|
+
te(), M();
|
|
11336
11348
|
}, B = [
|
|
11337
11349
|
"#ffe5e5",
|
|
11338
11350
|
"#ffe7d4",
|
|
@@ -11360,98 +11372,98 @@ function ma(s) {
|
|
|
11360
11372
|
"#e3d0ff",
|
|
11361
11373
|
"#efc9f5",
|
|
11362
11374
|
"#fbc5e7"
|
|
11363
|
-
],
|
|
11364
|
-
var
|
|
11365
|
-
(
|
|
11366
|
-
},
|
|
11367
|
-
var
|
|
11368
|
-
(
|
|
11375
|
+
], H = () => {
|
|
11376
|
+
var I;
|
|
11377
|
+
(I = x.querySelector(".color-palette")) == null || I.remove(), x.querySelectorAll("[data-color]").forEach((G) => G.setAttribute("aria-expanded", "false"));
|
|
11378
|
+
}, D = () => {
|
|
11379
|
+
var I, G;
|
|
11380
|
+
(I = x.querySelector(".color-scope-picker")) == null || I.remove(), (G = i == null ? void 0 : i.destroy) == null || G.call(i), i = null, x.querySelectorAll("[data-color-scope]").forEach((V) => V.setAttribute("aria-expanded", "false"));
|
|
11369
11381
|
};
|
|
11370
|
-
let
|
|
11371
|
-
x.querySelectorAll(".color-condition").forEach((
|
|
11372
|
-
|
|
11382
|
+
let k = -1;
|
|
11383
|
+
x.querySelectorAll(".color-condition").forEach((I, G) => {
|
|
11384
|
+
I.ondragstart = (V) => {
|
|
11373
11385
|
var ee;
|
|
11374
|
-
|
|
11375
|
-
},
|
|
11376
|
-
if (V.preventDefault(),
|
|
11377
|
-
const [ee] = h.colors.splice(
|
|
11378
|
-
h.colors.splice(G, 0, ee),
|
|
11386
|
+
k = G, (ee = V.dataTransfer) == null || ee.setData("text/plain", String(G));
|
|
11387
|
+
}, I.ondragover = (V) => V.preventDefault(), I.ondrop = (V) => {
|
|
11388
|
+
if (V.preventDefault(), k < 0 || k === G) return;
|
|
11389
|
+
const [ee] = h.colors.splice(k, 1);
|
|
11390
|
+
h.colors.splice(G, 0, ee), L();
|
|
11379
11391
|
};
|
|
11380
|
-
}), x.onclick = (
|
|
11381
|
-
var ee,
|
|
11382
|
-
|
|
11383
|
-
const G =
|
|
11384
|
-
if (
|
|
11392
|
+
}), x.onclick = (I) => {
|
|
11393
|
+
var ee, re;
|
|
11394
|
+
I.stopPropagation();
|
|
11395
|
+
const G = I.target.closest("button");
|
|
11396
|
+
if (I.target.closest(".color-scope-picker")) return;
|
|
11385
11397
|
const V = (G == null ? void 0 : G.getAttribute("aria-expanded")) === "true";
|
|
11386
|
-
if (
|
|
11387
|
-
|
|
11398
|
+
if (D(), !G || G.disabled) {
|
|
11399
|
+
H();
|
|
11388
11400
|
return;
|
|
11389
11401
|
}
|
|
11390
11402
|
if (G.dataset.colorScope !== void 0) {
|
|
11391
|
-
if (
|
|
11392
|
-
const
|
|
11403
|
+
if (H(), V) return;
|
|
11404
|
+
const oe = Number(G.dataset.colorScope), ue = h.colors[oe], pe = { key: "colorScope", label: "着色范围", kind: "select", options: ["整行", "单元格"], required: !0 }, Ie = e.resolve(pe).createEditor({ field: pe, value: !ue.scope || ue.scope === "row" ? "整行" : "单元格", item: Ve(), surface: "cell", readonly: !1, openDetail: () => {
|
|
11393
11405
|
} });
|
|
11394
|
-
i =
|
|
11395
|
-
const
|
|
11396
|
-
|
|
11406
|
+
i = Ie;
|
|
11407
|
+
const ge = document.createElement("div");
|
|
11408
|
+
ge.className = "popup fc-popup fc-choice-popup color-scope-picker", ge.style.width = "272px", ge.append(Ie.element), x.append(ge);
|
|
11397
11409
|
const je = G.getBoundingClientRect();
|
|
11398
|
-
|
|
11410
|
+
ge.style.left = `${Math.max(8, Math.min(je.left, innerWidth - 280))}px`, ge.style.top = `${Math.max(8, Math.min(je.bottom + 6, innerHeight - ge.offsetHeight - 8))}px`, G.setAttribute("aria-expanded", "true"), Ie.element.addEventListener("change", (_e) => {
|
|
11399
11411
|
var Ei, Ri;
|
|
11400
|
-
_e.stopPropagation(), !((Ei =
|
|
11401
|
-
}),
|
|
11402
|
-
_e.key === "Escape" && (_e.stopPropagation(),
|
|
11403
|
-
}, (ee =
|
|
11412
|
+
_e.stopPropagation(), !((Ei = Ie.validate) != null && Ei.call(Ie)) && (ue.scope = Ie.read() === "整行" ? "row" : "cell", L(), (Ri = S == null ? void 0 : S.querySelector(`[data-color-scope="${oe}"]`)) == null || Ri.focus());
|
|
11413
|
+
}), ge.onkeydown = (_e) => {
|
|
11414
|
+
_e.key === "Escape" && (_e.stopPropagation(), D(), G.focus());
|
|
11415
|
+
}, (ee = Ie.focus) == null || ee.call(Ie);
|
|
11404
11416
|
return;
|
|
11405
11417
|
}
|
|
11406
11418
|
if (G.dataset.paletteColor !== void 0) {
|
|
11407
|
-
const
|
|
11408
|
-
h.colors[
|
|
11419
|
+
const oe = Number(G.closest(".color-palette").dataset.ruleIndex);
|
|
11420
|
+
h.colors[oe].color = G.dataset.paletteColor, L(), (re = S == null ? void 0 : S.querySelector(`[data-color="${oe}"]`)) == null || re.focus();
|
|
11409
11421
|
return;
|
|
11410
11422
|
}
|
|
11411
11423
|
if (G.dataset.color !== void 0) {
|
|
11412
|
-
const
|
|
11413
|
-
if (
|
|
11414
|
-
const ue = Number(G.dataset.color),
|
|
11415
|
-
|
|
11416
|
-
const
|
|
11417
|
-
|
|
11418
|
-
|
|
11424
|
+
const oe = G.getAttribute("aria-expanded") === "true";
|
|
11425
|
+
if (H(), oe) return;
|
|
11426
|
+
const ue = Number(G.dataset.color), pe = document.createElement("div");
|
|
11427
|
+
pe.className = "color-palette", pe.dataset.ruleIndex = String(ue), pe.setAttribute("role", "group"), pe.ariaLabel = "选择着色颜色", pe.innerHTML = B.map((ge) => `<button type="button" class="color-palette-option" data-palette-color="${ge}" style="background-color:${ge}" aria-label="颜色 ${ge}" aria-pressed="${ge === h.colors[ue].color.toLowerCase()}"></button>`).join(""), x.append(pe);
|
|
11428
|
+
const Ie = G.getBoundingClientRect();
|
|
11429
|
+
pe.style.left = `${Math.max(8, Math.min(Ie.left, innerWidth - pe.offsetWidth - 8))}px`, pe.style.top = `${Math.max(8, Math.min(Ie.bottom + 6, innerHeight - pe.offsetHeight - 8))}px`, G.setAttribute("aria-expanded", "true"), pe.onkeydown = (ge) => {
|
|
11430
|
+
ge.key === "Escape" && (ge.stopPropagation(), H(), G.focus());
|
|
11419
11431
|
};
|
|
11420
11432
|
return;
|
|
11421
11433
|
}
|
|
11422
|
-
if (
|
|
11423
|
-
h.colors.push({ field: "", operator: "contains", value: "", color: "#fff5d6", scope: "row" }),
|
|
11434
|
+
if (H(), G.classList.contains("add-condition"))
|
|
11435
|
+
h.colors.push({ field: "", operator: "contains", value: "", color: "#fff5d6", scope: "row" }), L();
|
|
11424
11436
|
else if (G.dataset.pick !== void 0) {
|
|
11425
|
-
const
|
|
11426
|
-
|
|
11427
|
-
h.colors[
|
|
11437
|
+
const oe = +G.dataset.pick;
|
|
11438
|
+
Ze(G, (ue) => {
|
|
11439
|
+
h.colors[oe].field = ue, h.colors[oe].value = "", h.colors[oe].operator = "contains", L();
|
|
11428
11440
|
});
|
|
11429
11441
|
} else if (G.dataset.remove !== void 0)
|
|
11430
|
-
h.colors.splice(+G.dataset.remove, 1),
|
|
11442
|
+
h.colors.splice(+G.dataset.remove, 1), L();
|
|
11431
11443
|
else if (G.classList.contains("clear-rules"))
|
|
11432
|
-
h.colors = [],
|
|
11444
|
+
h.colors = [], L();
|
|
11433
11445
|
else if (G.dataset.colorMore !== void 0) {
|
|
11434
|
-
const
|
|
11435
|
-
x.querySelectorAll(".color-rule-menu").forEach((
|
|
11446
|
+
const oe = G.nextElementSibling, ue = oe.classList.contains("hidden");
|
|
11447
|
+
x.querySelectorAll(".color-rule-menu").forEach((pe) => pe.classList.add("hidden")), x.querySelectorAll("[data-color-more]").forEach((pe) => pe.setAttribute("aria-expanded", "false")), oe.classList.toggle("hidden", !ue), G.setAttribute("aria-expanded", String(ue));
|
|
11436
11448
|
} else if (G.dataset.colorCopy !== void 0) {
|
|
11437
|
-
const
|
|
11438
|
-
h.colors.splice(
|
|
11449
|
+
const oe = +G.dataset.colorCopy;
|
|
11450
|
+
h.colors.splice(oe + 1, 0, structuredClone(h.colors[oe])), L();
|
|
11439
11451
|
} else if (G.dataset.colorUp !== void 0 || G.dataset.colorDown !== void 0) {
|
|
11440
|
-
const
|
|
11441
|
-
h.colors.splice(
|
|
11452
|
+
const oe = Number(G.dataset.colorUp ?? G.dataset.colorDown), [ue] = h.colors.splice(oe, 1);
|
|
11453
|
+
h.colors.splice(oe + (G.dataset.colorUp !== void 0 ? -1 : 1), 0, ue), L();
|
|
11442
11454
|
}
|
|
11443
|
-
}, x.onchange = (
|
|
11444
|
-
const G =
|
|
11455
|
+
}, x.onchange = (I) => {
|
|
11456
|
+
const G = I.target;
|
|
11445
11457
|
if (G.dataset.operator !== void 0) {
|
|
11446
|
-
h.colors[+G.dataset.operator].operator = G.value,
|
|
11458
|
+
h.colors[+G.dataset.operator].operator = G.value, L();
|
|
11447
11459
|
return;
|
|
11448
11460
|
}
|
|
11449
|
-
G.dataset.ruleValue !== void 0 && (h.colors[+G.dataset.ruleValue].value = G.value),
|
|
11450
|
-
}, x.oninput = (
|
|
11451
|
-
const G =
|
|
11461
|
+
G.dataset.ruleValue !== void 0 && (h.colors[+G.dataset.ruleValue].value = G.value), te();
|
|
11462
|
+
}, x.oninput = (I) => {
|
|
11463
|
+
const G = I.target;
|
|
11452
11464
|
if (G.dataset.ruleValue !== void 0) h.colors[+G.dataset.ruleValue].value = G.value;
|
|
11453
11465
|
else return;
|
|
11454
|
-
|
|
11466
|
+
te();
|
|
11455
11467
|
};
|
|
11456
11468
|
}
|
|
11457
11469
|
function X(w, b) {
|
|
@@ -11459,14 +11471,14 @@ function ma(s) {
|
|
|
11459
11471
|
K(b);
|
|
11460
11472
|
return;
|
|
11461
11473
|
}
|
|
11462
|
-
const x = { filter: "筛选", sort: "排序", group: "分组", color: "颜色" }[w],
|
|
11474
|
+
const x = { filter: "筛选", sort: "排序", group: "分组", color: "颜色" }[w], M = w === "filter" ? h.filters : w === "sort" ? h.sorts : w === "group" ? h.groups : h.colors, L = M.map((k, I) => {
|
|
11463
11475
|
var ue;
|
|
11464
|
-
const G = w === "sort" ?
|
|
11476
|
+
const G = w === "sort" ? k.colId : w === "group" ? k : k.field, V = ((ue = d.find(([pe]) => pe === G)) == null ? void 0 : ue[1]) || G, ee = `<button class="field-select" data-pick="${I}">${ae(V)}${xe("down")}</button>`;
|
|
11465
11477
|
if (w === "sort")
|
|
11466
|
-
return `<div class="condition">${ee}<button class="sort-direction ${
|
|
11478
|
+
return `<div class="condition">${ee}<button class="sort-direction ${k.sort === "asc" ? "selected" : ""}" data-dir="asc" data-index="${I}">首项 → 末项</button><button class="sort-direction ${k.sort === "desc" ? "selected" : ""}" data-dir="desc" data-index="${I}">末项 → 首项</button><button data-remove="${I}" aria-label="删除条件">${xe("close")}</button></div>`;
|
|
11467
11479
|
if (w === "group")
|
|
11468
|
-
return `<div class="condition">${ee}<span class="spacer"></span><button data-remove="${
|
|
11469
|
-
const
|
|
11480
|
+
return `<div class="condition">${ee}<span class="spacer"></span><button data-remove="${I}" aria-label="删除条件">${xe("close")}</button></div>`;
|
|
11481
|
+
const re = at(
|
|
11470
11482
|
[
|
|
11471
11483
|
["contains", f[G] ? "存在选项属于" : "包含"],
|
|
11472
11484
|
["equals", "等于"],
|
|
@@ -11474,59 +11486,59 @@ function ma(s) {
|
|
|
11474
11486
|
["blank", "为空"],
|
|
11475
11487
|
["notBlank", "不为空"]
|
|
11476
11488
|
],
|
|
11477
|
-
|
|
11478
|
-
`data-operator="${
|
|
11479
|
-
),
|
|
11489
|
+
k.operator,
|
|
11490
|
+
`data-operator="${I}" aria-label="运算符"`
|
|
11491
|
+
), oe = ["blank", "notBlank"].includes(k.operator) ? "" : f[G] ? at(
|
|
11480
11492
|
[
|
|
11481
11493
|
["", "请选择目标值"],
|
|
11482
|
-
...f[G].map((
|
|
11494
|
+
...f[G].map((pe) => [pe, pe])
|
|
11483
11495
|
],
|
|
11484
|
-
|
|
11485
|
-
`data-rule-value="${
|
|
11486
|
-
) : `<input data-rule-value="${
|
|
11487
|
-
return `<div class="condition">${ee}${
|
|
11496
|
+
k.value,
|
|
11497
|
+
`data-rule-value="${I}" aria-label="目标值"`
|
|
11498
|
+
) : `<input data-rule-value="${I}" aria-label="目标值" value="${ae(k.value)}" placeholder="请选择目标值">`;
|
|
11499
|
+
return `<div class="condition">${ee}${re}${oe}${w === "color" ? `<input type="color" data-color="${I}" value="${k.color}" aria-label="行颜色">` : ""}<button data-remove="${I}" aria-label="删除条件">${xe("close")}</button></div>`;
|
|
11488
11500
|
}).join(""), B = Te(
|
|
11489
11501
|
b,
|
|
11490
11502
|
`设置${x}条件`,
|
|
11491
|
-
`${w === "filter" ? `<label class="terminated"><input type="checkbox" id="terminated" ${h.showTerminated ? "checked" : ""}>显示已终止数据</label>` : ""}${
|
|
11503
|
+
`${w === "filter" ? `<label class="terminated"><input type="checkbox" id="terminated" ${h.showTerminated ? "checked" : ""}>显示已终止数据</label>` : ""}${L}<button class="add-condition">${xe("plus")}添加${w === "color" ? "着色" : x}条件</button>${M.length ? '<button class="clear-rules">清空全部条件</button>' : ""}`,
|
|
11492
11504
|
w === "color" ? 650 : 560
|
|
11493
11505
|
);
|
|
11494
|
-
|
|
11495
|
-
const
|
|
11496
|
-
let
|
|
11497
|
-
B.querySelectorAll(".condition").forEach((
|
|
11498
|
-
|
|
11506
|
+
N = w;
|
|
11507
|
+
const H = () => X(w, b);
|
|
11508
|
+
let D = -1;
|
|
11509
|
+
B.querySelectorAll(".condition").forEach((k, I) => {
|
|
11510
|
+
k.draggable = !0, k.ondragstart = (G) => {
|
|
11499
11511
|
var V;
|
|
11500
|
-
|
|
11501
|
-
},
|
|
11502
|
-
if (G.preventDefault(),
|
|
11503
|
-
const [V] =
|
|
11504
|
-
|
|
11512
|
+
D = I, (V = G.dataTransfer) == null || V.setData("text/plain", String(I));
|
|
11513
|
+
}, k.ondragover = (G) => G.preventDefault(), k.ondrop = (G) => {
|
|
11514
|
+
if (G.preventDefault(), D < 0 || D === I) return;
|
|
11515
|
+
const [V] = M.splice(D, 1);
|
|
11516
|
+
M.splice(I, 0, V), te(), H();
|
|
11505
11517
|
};
|
|
11506
|
-
}), B.onclick = (
|
|
11507
|
-
const
|
|
11508
|
-
|
|
11518
|
+
}), B.onclick = (k) => {
|
|
11519
|
+
const I = k.target.closest("button");
|
|
11520
|
+
I && (I.classList.contains("add-condition") && Ze(I, (G) => {
|
|
11509
11521
|
w === "filter" && h.filters.push({ field: G, operator: "contains", value: "" }), w === "sort" && h.sorts.push({ colId: G, sort: "asc" }), w === "group" && !h.groups.includes(G) && h.groups.push(G), w === "color" && h.colors.push({
|
|
11510
11522
|
field: G,
|
|
11511
11523
|
operator: "contains",
|
|
11512
11524
|
value: "",
|
|
11513
11525
|
color: "#e9f2ff"
|
|
11514
|
-
}),
|
|
11515
|
-
}),
|
|
11516
|
-
const V = +
|
|
11517
|
-
w === "sort" ? h.sorts[V].colId = G : w === "group" ? h.groups[V] = G : (
|
|
11518
|
-
}),
|
|
11519
|
-
}, B.onchange = (
|
|
11520
|
-
const
|
|
11521
|
-
|
|
11522
|
-
}, B.oninput = (
|
|
11523
|
-
const
|
|
11524
|
-
|
|
11526
|
+
}), te(), H();
|
|
11527
|
+
}), I.dataset.pick !== void 0 && Ze(I, (G) => {
|
|
11528
|
+
const V = +I.dataset.pick;
|
|
11529
|
+
w === "sort" ? h.sorts[V].colId = G : w === "group" ? h.groups[V] = G : (M[V].field = G, M[V].value = ""), te(), H();
|
|
11530
|
+
}), I.dataset.remove !== void 0 && (M.splice(+I.dataset.remove, 1), te(), H()), I.classList.contains("clear-rules") && (M.splice(0), te(), H()), I.dataset.dir && (h.sorts[+I.dataset.index].sort = I.dataset.dir, te(), H()));
|
|
11531
|
+
}, B.onchange = (k) => {
|
|
11532
|
+
const I = k.target;
|
|
11533
|
+
I.id === "terminated" && (h.showTerminated = I.checked), I.dataset.operator !== void 0 && (M[+I.dataset.operator].operator = I.value, H()), I.dataset.ruleValue !== void 0 && (M[+I.dataset.ruleValue].value = I.value), I.dataset.color !== void 0 && (h.colors[+I.dataset.color].color = I.value), te();
|
|
11534
|
+
}, B.oninput = (k) => {
|
|
11535
|
+
const I = k.target;
|
|
11536
|
+
I.tagName === "INPUT" && I.dataset.ruleValue !== void 0 && (M[+I.dataset.ruleValue].value = I.value, te());
|
|
11525
11537
|
};
|
|
11526
11538
|
}
|
|
11527
11539
|
function J() {
|
|
11528
|
-
const w =
|
|
11529
|
-
x.style.width = `${Math.min(B, b +
|
|
11540
|
+
const w = $.api.getDisplayedRowCount(), b = $.api.getAllColumns().filter((I) => I.visible).reduce((I, G) => I + G.width, 0), x = p(".grid-wrap"), M = p(".list-area"), L = getComputedStyle(M), B = Math.max(0, M.clientWidth - parseFloat(L.paddingLeft || "0") - parseFloat(L.paddingRight || "0")), H = Math.max(0, M.clientHeight - x.offsetTop - parseFloat(L.paddingBottom || "0")), D = p(".ag-header-wrapper", x).getBoundingClientRect().height || 33, k = Math.max(1, w) * 37 + D + 1;
|
|
11541
|
+
x.style.width = `${Math.min(B, b + 1)}px`, x.style.height = `${Math.min(H, k)}px`;
|
|
11530
11542
|
}
|
|
11531
11543
|
function Y() {
|
|
11532
11544
|
var b;
|
|
@@ -11534,116 +11546,116 @@ function ma(s) {
|
|
|
11534
11546
|
(x) => y && x.name.toLowerCase().includes(y.toLowerCase())
|
|
11535
11547
|
).map((x) => x.id);
|
|
11536
11548
|
if (R = Math.max(0, Math.min(R, w.length - 1)), p("#matches").textContent = y ? `${w.length ? R + 1 : 0}/${w.length}` : "", s.container.querySelectorAll(".item-name").forEach((x) => {
|
|
11537
|
-
const
|
|
11538
|
-
x.classList.toggle("find-match", w.includes(
|
|
11549
|
+
const M = x.hash.replace("#item/", "");
|
|
11550
|
+
x.classList.toggle("find-match", w.includes(M)), x.classList.toggle("find-current", w[R] === M);
|
|
11539
11551
|
}), w[R]) {
|
|
11540
11552
|
let x = -1;
|
|
11541
|
-
for (let
|
|
11542
|
-
((b =
|
|
11543
|
-
x >= 0 &&
|
|
11553
|
+
for (let M = 0; M < $.api.getDisplayedRowCount(); M++)
|
|
11554
|
+
((b = $.api.getDisplayedRowAtIndex(M)) == null ? void 0 : b.id) === w[R] && (x = M);
|
|
11555
|
+
x >= 0 && $.api.ensureIndexVisible(x);
|
|
11544
11556
|
}
|
|
11545
11557
|
p('[data-action="previous-match"]').toggleAttribute(
|
|
11546
11558
|
"disabled",
|
|
11547
11559
|
!w.length
|
|
11548
11560
|
), p('[data-action="next-match"]').toggleAttribute("disabled", !w.length);
|
|
11549
11561
|
}
|
|
11550
|
-
function
|
|
11551
|
-
const w =
|
|
11562
|
+
function ne() {
|
|
11563
|
+
const w = $.api.getSelectedRows(), b = p(".selection-bar");
|
|
11552
11564
|
b.classList.toggle("hidden", !w.length), b.innerHTML = `${se("deselect", "", "close")}<span>已选择 ${w.length} 项</span>${se("batch-status", "更新状态")}${se("batch-owner", "更新负责人")}${se("batch-export", "导出")}${se("batch-archive", "终止")}${se("deselect", "取消选择")}`;
|
|
11553
11565
|
}
|
|
11554
11566
|
function he(w) {
|
|
11555
11567
|
const b = Te(
|
|
11556
11568
|
w,
|
|
11557
11569
|
"表格显示设置",
|
|
11558
|
-
`<input class="column-search" placeholder="搜索字段" aria-label="搜索字段"><div class="column-options">${
|
|
11570
|
+
`<input class="column-search" placeholder="搜索字段" aria-label="搜索字段"><div class="column-options">${$.api.getAllColumns().filter((x) => !x.colId.startsWith("_")).map(
|
|
11559
11571
|
(x) => `<label class="column-option"><input type="checkbox" data-column="${x.colId}" ${x.visible ? "checked" : ""}><span>${ae(x.headerName)}</span><button type="button" data-pin="${x.colId}">${x.pinned ? "取消冻结" : "冻结"}</button></label>`
|
|
11560
11572
|
).join("")}</div>`,
|
|
11561
11573
|
320
|
|
11562
11574
|
);
|
|
11563
11575
|
b.onchange = (x) => {
|
|
11564
|
-
const
|
|
11565
|
-
|
|
11576
|
+
const M = x.target;
|
|
11577
|
+
M.dataset.column && $.columnApi.setColumnVisible(M.dataset.column, M.checked);
|
|
11566
11578
|
}, b.onclick = (x) => {
|
|
11567
|
-
const
|
|
11568
|
-
if (
|
|
11579
|
+
const M = x.target.closest("[data-pin]");
|
|
11580
|
+
if (M) {
|
|
11569
11581
|
x.preventDefault();
|
|
11570
|
-
const
|
|
11571
|
-
|
|
11582
|
+
const L = $.columnApi.getColumn(M.dataset.pin);
|
|
11583
|
+
$.columnApi.setColumnPinned(L, L.pinned ? null : "left"), he(w);
|
|
11572
11584
|
}
|
|
11573
11585
|
}, p("input", b).oninput = (x) => {
|
|
11574
|
-
const
|
|
11575
|
-
b.querySelectorAll(".column-option").forEach((
|
|
11586
|
+
const M = x.target.value;
|
|
11587
|
+
b.querySelectorAll(".column-option").forEach((L) => L.hidden = !L.textContent.includes(M));
|
|
11576
11588
|
};
|
|
11577
11589
|
}
|
|
11578
11590
|
function ke() {
|
|
11579
11591
|
t.forEach((w) => {
|
|
11580
11592
|
var b;
|
|
11581
11593
|
return (b = w.destroy) == null ? void 0 : b.call(w);
|
|
11582
|
-
}), t = [],
|
|
11594
|
+
}), t = [], P == null || P.remove(), P = null, A = null, j = null, O == null || O.focus(), s.syncLocationHash && location.hash.startsWith("#item/") && history.replaceState(null, "", location.pathname + location.search);
|
|
11583
11595
|
}
|
|
11584
11596
|
function Re(w, b = "dialog-overlay") {
|
|
11585
|
-
return
|
|
11586
|
-
var
|
|
11587
|
-
return (
|
|
11588
|
-
}), t = [],
|
|
11589
|
-
x.target ===
|
|
11590
|
-
}),
|
|
11597
|
+
return ce(), s.container.querySelectorAll(".field-picker").forEach((x) => x.remove()), t.forEach((x) => {
|
|
11598
|
+
var M;
|
|
11599
|
+
return (M = x.destroy) == null ? void 0 : M.call(x);
|
|
11600
|
+
}), t = [], P == null || P.remove(), O = document.activeElement, P = document.createElement("div"), P.className = `overlay ${b}`, P.innerHTML = w, P.setAttribute("role", "dialog"), P.setAttribute("aria-modal", "true"), s.container.append(P), P.addEventListener("click", (x) => {
|
|
11601
|
+
x.target === P && ke();
|
|
11602
|
+
}), P;
|
|
11591
11603
|
}
|
|
11592
11604
|
function $e(w, b, x) {
|
|
11593
|
-
const
|
|
11605
|
+
const M = Re(
|
|
11594
11606
|
`<form class="dialog"><h2>${ae(w)}</h2><input aria-label="${ae(w)}" value="${ae(b)}" required><div class="actions">${se("close-overlay", "取消", "", "outline")}<button class="primary" type="submit">确定</button></div></form>`
|
|
11595
11607
|
);
|
|
11596
|
-
p("form",
|
|
11597
|
-
|
|
11598
|
-
const B = p("input",
|
|
11608
|
+
p("form", M).onsubmit = (L) => {
|
|
11609
|
+
L.preventDefault();
|
|
11610
|
+
const B = p("input", M).value.trim();
|
|
11599
11611
|
B && (ke(), x(B));
|
|
11600
|
-
}, p("input",
|
|
11601
|
-
}
|
|
11602
|
-
function
|
|
11603
|
-
var B,
|
|
11604
|
-
w.viewed = !0, q(),
|
|
11605
|
-
const x = s.detailForm.fields,
|
|
11606
|
-
var
|
|
11607
|
-
return `<div class="detail-row"><label for="detail-${
|
|
11608
|
-
}).join("")}<div class="detail-row" data-block="roles"><label>角色与人员</label><div>提报人 ${Q(w.owner)}<p>${se("add-role", "添加角色", "", "outline")}</p><div class="extra-roles"></div></div></div></div><section class="detail-section" data-block="meetings"><p>进入选题会</p><div class="meeting-table"><div>选题会<span>提报人</span><span>操作</span></div><div class="meeting-rows"></div>${se("add-meeting", "添加一组进入选题会", "add")}</div><div class="detail-row" data-block="approval"><label>选题是否通过</label><div class="radios">${["是", "待定", "废弃"].map((
|
|
11609
|
-
`<article class="drawer"><div class="drawer-header"><span class="page-logo">${
|
|
11612
|
+
}, p("input", M).focus();
|
|
11613
|
+
}
|
|
11614
|
+
function Ne(w, b = "基本信息") {
|
|
11615
|
+
var B, H;
|
|
11616
|
+
w.viewed = !0, q(), A = w, W = b, s.syncLocationHash && history.replaceState(null, "", `#item/${w.id}`);
|
|
11617
|
+
const x = s.detailForm.fields, M = b === "基本信息" ? `<div class="detail-fields">${x.map((D) => {
|
|
11618
|
+
var k, I;
|
|
11619
|
+
return `<div class="detail-row"><label for="detail-${D.field}">${ae(D.label || ((k = u(D.field)) == null ? void 0 : k.label) || D.field)}${D.required ?? ((I = u(D.field)) == null ? void 0 : I.required) ? " *" : ""}</label>${pt(D, w, "detail")}</div>`;
|
|
11620
|
+
}).join("")}<div class="detail-row" data-block="roles"><label>角色与人员</label><div>提报人 ${Q(w.owner)}<p>${se("add-role", "添加角色", "", "outline")}</p><div class="extra-roles"></div></div></div></div><section class="detail-section" data-block="meetings"><p>进入选题会</p><div class="meeting-table"><div>选题会<span>提报人</span><span>操作</span></div><div class="meeting-rows"></div>${se("add-meeting", "添加一组进入选题会", "add")}</div><div class="detail-row" data-block="approval"><label>选题是否通过</label><div class="radios">${["是", "待定", "废弃"].map((D) => `<label><input type="radio" name="approved" value="${D}" data-detail="approved" ${w.approved === D ? "checked" : ""}>${D}</label>`).join("")}</div></div></section><section class="detail-section" data-block="votes"><div class="detail-row"><label>选题投票</label><div>${se("detail-vote", w.vote ? "1" : "投票", "plus", "vote")}</div></div><div class="detail-row"><label>是否展示投票结果</label><div class="radios">${["是", "否"].map((D) => `<label><input type="radio" name="showVotes" value="${D}" data-detail="showVotes" ${w.showVotes === D ? "checked" : ""}>${D}</label>`).join("")}</div></div></section><div class="detail-row muted"><label>父级工作项</label><span>暂无关联WBS 父工作项</span></div>` : b === "评论/备注" ? `<div class="comment-list">${w.comments.length ? w.comments.map((D) => `<article>${Q("体验官")}<p>${ae(D)}</p></article>`).join("") : '<p class="muted">暂无评论/备注</p>'}</div>` : b === "操作记录" ? `<div class="history-list">${w.history.length ? w.history.map((D) => `<p>${ae(D)}</p>`).join("") : '<p class="muted">暂无操作记录</p>'}</div>` : `<div class="muted">${(B = w.materials) != null && B.length ? w.materials.map((D) => `<p>${ae(D)}</p>`).join("") : "暂无关联素材"}</div>${se("link-material", "关联素材", "add", "outline")}`, L = Re(
|
|
11621
|
+
`<article class="drawer"><div class="drawer-header"><span class="page-logo">${xe("check")}</span><strong>${ae(w.name)}</strong>${_(w.status, "approved")}<span class="muted">已进行 20 天</span><div class="spacer"></div>${se("follow", w.followed ? "已关注" : "关注", "people", w.followed ? "is-set" : "")}${se("star", w.starred ? "已收藏" : "收藏", "book", w.starred ? "is-set" : "")}${se("detail-more", "", "more")}${se("close-overlay", "", "close", "outline")}</div><div class="detail-navigation">${se("prev-item", "", "up")}${se("next-item", "", "down")}</div><div class="detail-tabs">${["基本信息", "素材管理", "评论/备注", "操作记录"].map((D) => `<button data-detail-tab="${D}" class="detail-tab ${D === b ? "active" : ""}">${D}</button>`).join("")}<div class="spacer"></div>${Q(w.owner)}${se("detail-status", w.status, "down", "primary")}</div><div class="drawer-body">${M}</div><form class="comment-form"><span class="avatar">体验官</span><textarea aria-label="评论" placeholder="请输入评论(Enter 换行,⌘ + Enter 发送)"></textarea><button type="submit">发送</button></form></article>`,
|
|
11610
11622
|
"detail-overlay"
|
|
11611
11623
|
);
|
|
11612
|
-
|
|
11613
|
-
for (const [
|
|
11624
|
+
A = w, j = w, Dt(L, w, s.detailForm.fields, "detail"), me();
|
|
11625
|
+
for (const [D, k] of [
|
|
11614
11626
|
["roles", s.detailForm.showRoles],
|
|
11615
11627
|
["meetings", s.detailForm.showMeetings],
|
|
11616
11628
|
["approval", s.detailForm.showApproval],
|
|
11617
11629
|
["votes", s.detailForm.showVotes]
|
|
11618
11630
|
])
|
|
11619
|
-
|
|
11620
|
-
|
|
11621
|
-
var
|
|
11622
|
-
const
|
|
11623
|
-
if (
|
|
11631
|
+
k || (H = L.querySelector(`[data-block="${D}"]`)) == null || H.remove();
|
|
11632
|
+
L.onchange = (D) => {
|
|
11633
|
+
var I;
|
|
11634
|
+
const k = D.target;
|
|
11635
|
+
if (k.dataset.detail) {
|
|
11624
11636
|
const G = s.detailForm.fields.find(
|
|
11625
|
-
(V) => V.field ===
|
|
11637
|
+
(V) => V.field === k.dataset.detail
|
|
11626
11638
|
);
|
|
11627
|
-
if (G && !(G.editable ?? ((
|
|
11639
|
+
if (G && !(G.editable ?? ((I = u(G.field)) == null ? void 0 : I.editable) !== !1))
|
|
11628
11640
|
return;
|
|
11629
|
-
if (
|
|
11630
|
-
|
|
11641
|
+
if (k.dataset.detail === "name" && !k.value.trim()) {
|
|
11642
|
+
k.value = w.name;
|
|
11631
11643
|
return;
|
|
11632
11644
|
}
|
|
11633
|
-
Ce(w,
|
|
11645
|
+
Ce(w, k.dataset.detail, k.value);
|
|
11634
11646
|
}
|
|
11635
|
-
}, p("form",
|
|
11636
|
-
|
|
11637
|
-
const
|
|
11647
|
+
}, p("form", L).onsubmit = (D) => {
|
|
11648
|
+
D.preventDefault();
|
|
11649
|
+
const k = p(
|
|
11638
11650
|
"textarea",
|
|
11639
|
-
p("form",
|
|
11651
|
+
p("form", L)
|
|
11640
11652
|
).value.trim();
|
|
11641
|
-
|
|
11642
|
-
}, p("form textarea",
|
|
11643
|
-
|
|
11653
|
+
k && (w.comments.push(k), q(), Ne(w, "评论/备注"), fe("评论已添加到本地 demo"));
|
|
11654
|
+
}, p("form textarea", L).onkeydown = (D) => {
|
|
11655
|
+
D.key === "Enter" && (D.metaKey || D.ctrlKey) && (D.preventDefault(), p("form", L).requestSubmit());
|
|
11644
11656
|
};
|
|
11645
11657
|
}
|
|
11646
|
-
function
|
|
11658
|
+
function pt(w, b, x) {
|
|
11647
11659
|
return u(w.field) ? `<div class="fc-host" data-control-field="${ae(w.field)}" data-control-mode="${x}"></div>` : "";
|
|
11648
11660
|
}
|
|
11649
11661
|
function Oe(w, b, x) {
|
|
@@ -11653,153 +11665,153 @@ function ma(s) {
|
|
|
11653
11665
|
item: b,
|
|
11654
11666
|
surface: x,
|
|
11655
11667
|
readonly: w.editable === !1,
|
|
11656
|
-
openDetail: (
|
|
11657
|
-
const
|
|
11658
|
-
|
|
11668
|
+
openDetail: (M) => {
|
|
11669
|
+
const L = C.items.find((B) => B.id === M);
|
|
11670
|
+
L ? Ne(L) : fe("未找到关联工作项");
|
|
11659
11671
|
}
|
|
11660
11672
|
};
|
|
11661
11673
|
}
|
|
11662
|
-
function Dt(w, b, x,
|
|
11663
|
-
const
|
|
11674
|
+
function Dt(w, b, x, M) {
|
|
11675
|
+
const L = [];
|
|
11664
11676
|
for (const B of w.querySelectorAll("[data-control-field]")) {
|
|
11665
|
-
const
|
|
11666
|
-
...
|
|
11667
|
-
label:
|
|
11668
|
-
required:
|
|
11669
|
-
editable:
|
|
11670
|
-
},
|
|
11671
|
-
t.push(V),
|
|
11677
|
+
const H = x.find((ge) => ge.field === B.dataset.controlField), D = u(H.field), k = {
|
|
11678
|
+
...D,
|
|
11679
|
+
label: H.label || D.label,
|
|
11680
|
+
required: H.required ?? D.required,
|
|
11681
|
+
editable: D.editable !== !1 && H.editable !== !1
|
|
11682
|
+
}, I = Oe(k, b, M === "new" ? "create" : "detail"), G = e.resolve(k), V = G.createEditor(I);
|
|
11683
|
+
t.push(V), L.push({ editor: V, field: k });
|
|
11672
11684
|
const ee = V.element.matches("input,select,textarea,[role=textbox]") ? V.element : V.element.querySelector("input,select,textarea,[role=textbox]");
|
|
11673
|
-
ee && (ee.id = `${
|
|
11674
|
-
const
|
|
11675
|
-
|
|
11676
|
-
const
|
|
11677
|
-
|
|
11685
|
+
ee && (ee.id = `${M}-${k.key}`);
|
|
11686
|
+
const re = document.createElement("div");
|
|
11687
|
+
re.className = "fc-error", re.setAttribute("role", "status");
|
|
11688
|
+
const oe = document.createElement("div");
|
|
11689
|
+
oe.className = "fc-detail-editor", oe.append(V.element, re), B.append(oe);
|
|
11678
11690
|
let ue;
|
|
11679
|
-
|
|
11680
|
-
const
|
|
11681
|
-
if (ue && (ue.replaceChildren(G.render(Oe(
|
|
11682
|
-
const
|
|
11683
|
-
|
|
11691
|
+
M === "detail" && (B.classList.add("fc-detail-host"), ue = document.createElement("div"), ue.className = "fc-detail-preview", B.prepend(ue));
|
|
11692
|
+
const pe = () => {
|
|
11693
|
+
if (ue && (ue.replaceChildren(G.render(Oe(k, b, "detail"))), k.editable)) {
|
|
11694
|
+
const ge = document.createElement("button");
|
|
11695
|
+
ge.type = "button", ge.className = "fc-detail-edit", ge.textContent = "编辑", ge.ariaLabel = `编辑${k.label}`, ge.onclick = (je) => {
|
|
11684
11696
|
var _e;
|
|
11685
11697
|
je.stopPropagation(), B.classList.add("editing"), (_e = V.focus) == null || _e.call(V);
|
|
11686
|
-
}, ue.append(
|
|
11698
|
+
}, ue.append(ge);
|
|
11687
11699
|
}
|
|
11688
11700
|
};
|
|
11689
|
-
|
|
11690
|
-
const
|
|
11701
|
+
pe();
|
|
11702
|
+
const Ie = () => {
|
|
11691
11703
|
var je;
|
|
11692
|
-
if (!
|
|
11693
|
-
const
|
|
11694
|
-
if (
|
|
11704
|
+
if (!k.editable) return !0;
|
|
11705
|
+
const ge = (je = V.validate) == null ? void 0 : je.call(V);
|
|
11706
|
+
if (re.textContent = ge || "", !ge && M === "detail") {
|
|
11695
11707
|
const _e = V.read();
|
|
11696
|
-
JSON.stringify(b[
|
|
11708
|
+
JSON.stringify(b[k.key]) !== JSON.stringify(_e) && Ce(b, k.key, _e), pe();
|
|
11697
11709
|
}
|
|
11698
|
-
return !
|
|
11710
|
+
return !ge;
|
|
11699
11711
|
};
|
|
11700
|
-
if (
|
|
11701
|
-
const
|
|
11702
|
-
|
|
11703
|
-
je.stopPropagation(),
|
|
11704
|
-
},
|
|
11712
|
+
if (M === "detail" && k.editable) {
|
|
11713
|
+
const ge = document.createElement("button");
|
|
11714
|
+
ge.type = "button", ge.className = "fc-detail-done", ge.textContent = "完成", ge.onclick = (je) => {
|
|
11715
|
+
je.stopPropagation(), Ie() && B.classList.remove("editing");
|
|
11716
|
+
}, oe.append(ge);
|
|
11705
11717
|
}
|
|
11706
|
-
B.addEventListener("change",
|
|
11718
|
+
B.addEventListener("change", Ie), B.addEventListener("focusout", () => {
|
|
11707
11719
|
queueMicrotask(() => {
|
|
11708
|
-
B.isConnected && !B.contains(document.activeElement) &&
|
|
11720
|
+
B.isConnected && !B.contains(document.activeElement) && Ie() && B.classList.remove("editing");
|
|
11709
11721
|
});
|
|
11710
11722
|
});
|
|
11711
11723
|
}
|
|
11712
11724
|
return () => {
|
|
11713
|
-
var B,
|
|
11714
|
-
for (const { editor:
|
|
11715
|
-
if (!
|
|
11716
|
-
const
|
|
11717
|
-
if (
|
|
11718
|
-
return
|
|
11719
|
-
}
|
|
11720
|
-
for (const { editor:
|
|
11725
|
+
var B, H;
|
|
11726
|
+
for (const { editor: D, field: k } of L) {
|
|
11727
|
+
if (!k.editable) continue;
|
|
11728
|
+
const I = (B = D.validate) == null ? void 0 : B.call(D);
|
|
11729
|
+
if (I)
|
|
11730
|
+
return fe(`${k.label}:${I}`), (H = D.focus) == null || H.call(D), !1;
|
|
11731
|
+
}
|
|
11732
|
+
for (const { editor: D, field: k } of L) k.editable && (b[k.key] = D.read());
|
|
11721
11733
|
return !0;
|
|
11722
11734
|
};
|
|
11723
11735
|
}
|
|
11724
11736
|
function lt(w, b, x) {
|
|
11725
11737
|
var G;
|
|
11726
|
-
o == null || o(),
|
|
11727
|
-
const
|
|
11728
|
-
|
|
11729
|
-
const
|
|
11730
|
-
|
|
11731
|
-
let
|
|
11732
|
-
const
|
|
11733
|
-
var
|
|
11734
|
-
if (
|
|
11738
|
+
o == null || o(), ce();
|
|
11739
|
+
const M = w.closest(".ag-cell") || w, L = [...M.childNodes], B = e.resolve(b).createEditor(Oe(b, x, "cell")), H = document.createElement("div");
|
|
11740
|
+
H.className = "fc-inline-error", H.setAttribute("role", "status");
|
|
11741
|
+
const D = document.createElement("div");
|
|
11742
|
+
D.className = "fc-inline-editor", D.append(B.element, H), M.replaceChildren(D), M.classList.add("fc-inline-editing");
|
|
11743
|
+
let k = !1;
|
|
11744
|
+
const I = (V) => {
|
|
11745
|
+
var re, oe;
|
|
11746
|
+
if (k) return;
|
|
11735
11747
|
if (V) {
|
|
11736
|
-
const ue = (
|
|
11748
|
+
const ue = (re = B.validate) == null ? void 0 : re.call(B);
|
|
11737
11749
|
if (ue) {
|
|
11738
|
-
|
|
11750
|
+
H.textContent = ue, B.element.setAttribute("aria-invalid", "true");
|
|
11739
11751
|
return;
|
|
11740
11752
|
}
|
|
11741
11753
|
}
|
|
11742
11754
|
const ee = V ? B.read() : void 0;
|
|
11743
|
-
|
|
11755
|
+
k = !0, o = null, (oe = B.destroy) == null || oe.call(B), M.classList.remove("fc-inline-editing"), M.replaceChildren(...L), V && x[b.key] !== ee && Ce(x, b.key, ee);
|
|
11744
11756
|
};
|
|
11745
|
-
o = () =>
|
|
11746
|
-
(V.key === "Enter" || V.key === "Escape") && (V.preventDefault(), V.stopPropagation(),
|
|
11747
|
-
}),
|
|
11748
|
-
|
|
11749
|
-
}),
|
|
11757
|
+
o = () => I(!1), D.addEventListener("keydown", (V) => {
|
|
11758
|
+
(V.key === "Enter" || V.key === "Escape") && (V.preventDefault(), V.stopPropagation(), I(V.key === "Enter"));
|
|
11759
|
+
}), D.addEventListener("focusout", (V) => {
|
|
11760
|
+
D.contains(V.relatedTarget) || I(!0);
|
|
11761
|
+
}), D.addEventListener("click", (V) => V.stopPropagation()), (G = B.focus) == null || G.call(B), B.element instanceof HTMLInputElement && B.element.select();
|
|
11750
11762
|
}
|
|
11751
|
-
function
|
|
11763
|
+
function gt(w, b, x) {
|
|
11752
11764
|
var G;
|
|
11753
|
-
const
|
|
11754
|
-
if (
|
|
11765
|
+
const M = e.resolve(b), L = M.id === "select" || M.id === "multiSelect", B = M.id === "dateTime", H = M.id === "richText", D = Te(w, L || B || H ? "" : b.label, '<div class="fc-editor-host"></div><div class="fc-error" role="status"></div>' + (L || H ? "" : '<div class="actions"><button type="button" class="fc-cancel">取消</button><button type="button" class="primary fc-save">保存</button></div>'), H ? 240 : L ? 272 : 320, H ? "fc-popup fc-rich-popup" : L ? "fc-popup fc-choice-popup" : "fc-popup");
|
|
11766
|
+
if (L || H) {
|
|
11755
11767
|
const V = w.getBoundingClientRect();
|
|
11756
|
-
|
|
11757
|
-
}
|
|
11758
|
-
const
|
|
11759
|
-
i =
|
|
11760
|
-
const
|
|
11761
|
-
var
|
|
11762
|
-
const ee = (
|
|
11763
|
-
if (p(".fc-error",
|
|
11764
|
-
const
|
|
11765
|
-
V &&
|
|
11768
|
+
D.style.top = `${Math.max(8, Math.min(V.top, innerHeight - 360))}px`;
|
|
11769
|
+
}
|
|
11770
|
+
const k = M.createEditor(Oe(b, x, "cell"));
|
|
11771
|
+
i = k, p(".fc-editor-host", D).append(k.element);
|
|
11772
|
+
const I = (V = !0) => {
|
|
11773
|
+
var oe;
|
|
11774
|
+
const ee = (oe = k.validate) == null ? void 0 : oe.call(k);
|
|
11775
|
+
if (p(".fc-error", D).textContent = ee || "", ee) return;
|
|
11776
|
+
const re = k.read();
|
|
11777
|
+
V && ce(), Ce(x, b.key, re);
|
|
11766
11778
|
};
|
|
11767
|
-
|
|
11768
|
-
var
|
|
11769
|
-
const V = (
|
|
11770
|
-
if (p(".fc-error",
|
|
11771
|
-
const ee =
|
|
11779
|
+
H ? n = () => {
|
|
11780
|
+
var re;
|
|
11781
|
+
const V = (re = k.validate) == null ? void 0 : re.call(k);
|
|
11782
|
+
if (p(".fc-error", D).textContent = V || "", V) return !1;
|
|
11783
|
+
const ee = k.read();
|
|
11772
11784
|
return x[b.key] !== ee && Ce(x, b.key, ee), !0;
|
|
11773
|
-
} :
|
|
11774
|
-
V.key === "Enter" && (V.ctrlKey || V.metaKey || V.target instanceof HTMLInputElement) && (V.preventDefault(),
|
|
11775
|
-
})), (G =
|
|
11785
|
+
} : L ? k.element.addEventListener("change", () => I(M.id === "select")) : (p(".fc-cancel", D).onclick = () => ce(!1), p(".fc-save", D).onclick = () => I(), D.addEventListener("keydown", (V) => {
|
|
11786
|
+
V.key === "Enter" && (V.ctrlKey || V.metaKey || V.target instanceof HTMLInputElement) && (V.preventDefault(), I());
|
|
11787
|
+
})), (G = k.focus) == null || G.call(k);
|
|
11776
11788
|
}
|
|
11777
11789
|
function yt(w = "text") {
|
|
11778
11790
|
var G;
|
|
11779
|
-
const b = e.list(), x = b.find((V) => V.id === w) || b[0],
|
|
11780
|
-
let
|
|
11781
|
-
t.push(
|
|
11782
|
-
const
|
|
11783
|
-
const V = p(".fc-preview-cell",
|
|
11784
|
-
V.replaceChildren(x.render(Oe(
|
|
11791
|
+
const b = e.list(), x = b.find((V) => V.id === w) || b[0], M = Re(`<section class="control-manager"><header><div><h2>控件管理</h2><p>统一管理字段的展示和编辑方式</p></div>${se("close-overlay", "关闭", "close")}</header><div class="control-manager-body"><nav>${b.map((V) => `<button type="button" data-control-id="${ae(V.id)}" class="${V.id === x.id ? "active" : ""}"><span>${ae(V.glyph)}</span>${ae(V.label)}</button>`).join("")}</nav><main><h3>${ae(x.label)}</h3><p>${ae(x.description)}</p><div class="fc-preview-grid"><section><h4>表格单元格</h4><div class="fc-preview-cell"></div><p class="hint">双击或点击编辑</p></section><section><h4>详情页</h4><div class="fc-preview-detail"></div></section></div><div class="fc-preview-edit"></div><div class="fc-error" role="status"></div><div class="actions"><button type="button" class="primary fc-preview-save">应用预览</button></div><p class="hint">在字段类型中选择控件。自定义控件通过 controls 配置或 registerControl() 注册,两处共用同一套展示与编辑接口。</p></main></div></section>`), L = { key: "preview", label: x.label, kind: x.id, options: ["待开始", "进行中", "已完成"], editable: !0 }, B = { ...C.items[0], preview: x.id === "number" ? 128 : x.id === "multiSelect" ? ["进行中"] : x.id === "select" ? "进行中" : x.id === "dateTime" ? "2026-09-23T10:30" : x.id === "detail" ? ((G = C.items[0]) == null ? void 0 : G.id) || "" : "内容示例" };
|
|
11792
|
+
let H, D = x.createEditor(Oe(L, B, "detail"));
|
|
11793
|
+
t.push(D), p(".fc-preview-detail", M).append(D.element);
|
|
11794
|
+
const k = () => {
|
|
11795
|
+
const V = p(".fc-preview-cell", M);
|
|
11796
|
+
V.replaceChildren(x.render(Oe(L, B, "cell")));
|
|
11785
11797
|
const ee = document.createElement("button");
|
|
11786
|
-
ee.type = "button", ee.textContent = "编辑", ee.onclick =
|
|
11787
|
-
},
|
|
11788
|
-
var ee,
|
|
11789
|
-
(ee =
|
|
11798
|
+
ee.type = "button", ee.textContent = "编辑", ee.onclick = I, V.append(ee), V.ondblclick = I;
|
|
11799
|
+
}, I = () => {
|
|
11800
|
+
var ee, re;
|
|
11801
|
+
(ee = H == null ? void 0 : H.destroy) == null || ee.call(H), H = x.createEditor(Oe(L, B, "cell")), p(x.id === "text" ? ".fc-preview-cell" : ".fc-preview-edit", M).replaceChildren(H.element), (re = H.focus) == null || re.call(H);
|
|
11790
11802
|
};
|
|
11791
|
-
t.push({ element:
|
|
11803
|
+
t.push({ element: M, read: () => {
|
|
11792
11804
|
}, destroy: () => {
|
|
11793
11805
|
var V;
|
|
11794
|
-
return (V =
|
|
11795
|
-
} }),
|
|
11796
|
-
var
|
|
11797
|
-
const V =
|
|
11798
|
-
if (p(".fc-error",
|
|
11799
|
-
B.preview = V.read(),
|
|
11800
|
-
const
|
|
11801
|
-
t.splice(t.indexOf(
|
|
11802
|
-
},
|
|
11806
|
+
return (V = H == null ? void 0 : H.destroy) == null ? void 0 : V.call(H);
|
|
11807
|
+
} }), k(), p(".fc-preview-save", M).onclick = () => {
|
|
11808
|
+
var oe, ue, pe;
|
|
11809
|
+
const V = H || D, ee = (oe = V.validate) == null ? void 0 : oe.call(V);
|
|
11810
|
+
if (p(".fc-error", M).textContent = ee || "", ee) return;
|
|
11811
|
+
B.preview = V.read(), k(), (ue = D.destroy) == null || ue.call(D);
|
|
11812
|
+
const re = x.createEditor(Oe(L, B, "detail"));
|
|
11813
|
+
t.splice(t.indexOf(D), 1, re), p(".fc-preview-detail", M).replaceChildren(re.element), D = re, (pe = H == null ? void 0 : H.destroy) == null || pe.call(H), H = void 0, p(".fc-preview-edit", M).replaceChildren();
|
|
11814
|
+
}, M.querySelectorAll("[data-control-id]").forEach((V) => V.onclick = () => yt(V.dataset.controlId));
|
|
11803
11815
|
}
|
|
11804
11816
|
function Ve() {
|
|
11805
11817
|
return {
|
|
@@ -11832,53 +11844,53 @@ function ma(s) {
|
|
|
11832
11844
|
}
|
|
11833
11845
|
function rt(w) {
|
|
11834
11846
|
const b = w ? structuredClone(w) : Ve(), x = Re(
|
|
11835
|
-
`<form class="create-dialog"><div class="drawer-header"><span class="page-logo">${
|
|
11836
|
-
var B,
|
|
11837
|
-
return `<div class="create-field ${((B = u(
|
|
11838
|
-
}).join("")}${s.createForm.showRoles ? `<div class="create-field extended-field"><label>角色与人员</label><div><div class="role-line">${
|
|
11847
|
+
`<form class="create-dialog"><div class="drawer-header"><span class="page-logo">${xe("check")}</span><strong>${ae(s.title)}</strong><div class="spacer"></div>${se("drafts", "草稿箱", "inbox", "outline")}${se("close-overlay", "", "close")}</div><div class="create-body"><div class="simple-mode"><label><input type="checkbox" id="simple-mode">简洁模式</label></div>${s.createForm.fields.map((L) => {
|
|
11848
|
+
var B, H, D;
|
|
11849
|
+
return `<div class="create-field ${((B = u(L.field)) == null ? void 0 : B.kind) === "longText" ? "extended-field" : ""}"><label for="new-${L.field}">${ae(L.label || ((H = u(L.field)) == null ? void 0 : H.label) || L.field)} ${L.required ?? ((D = u(L.field)) == null ? void 0 : D.required) ? "<em>*</em>" : ""}</label>${pt(L, b, "new")}</div>`;
|
|
11850
|
+
}).join("")}${s.createForm.showRoles ? `<div class="create-field extended-field"><label>角色与人员</label><div><div class="role-line">${at([["提报人", "提报人"]], "提报人", 'aria-label="角色"')}<div class="role-person">${Q(s.currentUser)}</div></div>${se("add-role", "添加角色", "", "outline")}<div class="extra-roles"></div></div></div>` : ""}${s.createForm.showMeetings ? `<section class="detail-section extended-field"><p>进入选题会</p><div class="meeting-table"><div>选题会<span>提报人</span><span>操作</span></div><div class="meeting-rows"></div>${se("add-meeting", "添加一组进入选题会", "add")}</div></section>` : ""}</div><div class="drawer-footer"><label class="continuous"><input id="continuous" type="checkbox">连续创建</label>${se("close-overlay", "取消", "", "outline")}${se("save-draft", "存草稿", "", "outline")}<button type="submit" class="primary">确认创建</button></div></form>`
|
|
11839
11851
|
);
|
|
11840
|
-
j = b,
|
|
11841
|
-
const
|
|
11842
|
-
p("#simple-mode", x).onchange = (
|
|
11843
|
-
(B) => B.classList.toggle("hidden",
|
|
11852
|
+
j = b, me();
|
|
11853
|
+
const M = Dt(x, b, s.createForm.fields, "new");
|
|
11854
|
+
p("#simple-mode", x).onchange = (L) => x.querySelectorAll(".extended-field").forEach(
|
|
11855
|
+
(B) => B.classList.toggle("hidden", L.target.checked)
|
|
11844
11856
|
), p('[data-action="save-draft"]', x).onclick = () => {
|
|
11845
|
-
if (!
|
|
11846
|
-
const
|
|
11847
|
-
|
|
11848
|
-
}, p("form", x).onsubmit = (
|
|
11849
|
-
if (
|
|
11857
|
+
if (!M()) return;
|
|
11858
|
+
const L = C.drafts.findIndex((B) => B.id === b.id);
|
|
11859
|
+
L >= 0 ? C.drafts[L] = b : C.drafts.push(b), q(), ke(), fe("已存入草稿箱");
|
|
11860
|
+
}, p("form", x).onsubmit = (L) => {
|
|
11861
|
+
if (L.preventDefault(), !M()) return;
|
|
11850
11862
|
if (!b.name.trim()) {
|
|
11851
11863
|
p("#new-name", x).focus();
|
|
11852
11864
|
return;
|
|
11853
11865
|
}
|
|
11854
11866
|
const B = p("#continuous", x).checked;
|
|
11855
|
-
C.items.unshift(b), C.drafts = C.drafts.filter((
|
|
11867
|
+
C.items.unshift(b), C.drafts = C.drafts.filter((H) => H.id !== b.id), q(), te(), ke(), fe("创建成功"), B && (rt(), p("#continuous").checked = !0);
|
|
11856
11868
|
};
|
|
11857
11869
|
}
|
|
11858
|
-
function
|
|
11859
|
-
if (!
|
|
11870
|
+
function me() {
|
|
11871
|
+
if (!P || !j) return;
|
|
11860
11872
|
const w = j;
|
|
11861
11873
|
for (const [b, x] of [
|
|
11862
11874
|
["roles", ".extra-roles"],
|
|
11863
11875
|
["meetings", ".meeting-rows"]
|
|
11864
11876
|
]) {
|
|
11865
|
-
const
|
|
11866
|
-
if (!
|
|
11867
|
-
const
|
|
11868
|
-
|
|
11869
|
-
(B,
|
|
11870
|
-
).join(""),
|
|
11871
|
-
const
|
|
11872
|
-
|
|
11873
|
-
},
|
|
11874
|
-
const
|
|
11877
|
+
const M = P.querySelector(x);
|
|
11878
|
+
if (!M) continue;
|
|
11879
|
+
const L = w[b] || [];
|
|
11880
|
+
M.innerHTML = L.map(
|
|
11881
|
+
(B, H) => `<div class="role-line"><input data-relation-index="${H}" data-relation-field="name" aria-label="${b === "roles" ? "角色名称" : "选题会"}" placeholder="${b === "roles" ? "角色名称" : "选择选题会"}" value="${ae(B.name)}"><input data-relation-index="${H}" data-relation-field="person" aria-label="人员" value="${ae(B.person)}"><button type="button" data-relation-remove="${H}" aria-label="移除">×</button></div>`
|
|
11882
|
+
).join(""), M.onchange = (B) => {
|
|
11883
|
+
const H = B.target, D = Number(H.dataset.relationIndex);
|
|
11884
|
+
H.dataset.relationField && (L[D][H.dataset.relationField] = H.value, A && q());
|
|
11885
|
+
}, M.onclick = (B) => {
|
|
11886
|
+
const H = B.target.closest(
|
|
11875
11887
|
"[data-relation-remove]"
|
|
11876
11888
|
);
|
|
11877
|
-
|
|
11889
|
+
H && (L.splice(Number(H.dataset.relationRemove), 1), me(), A && q());
|
|
11878
11890
|
};
|
|
11879
11891
|
}
|
|
11880
11892
|
}
|
|
11881
|
-
function
|
|
11893
|
+
function et(w) {
|
|
11882
11894
|
const b = Te(
|
|
11883
11895
|
w,
|
|
11884
11896
|
"存为视图",
|
|
@@ -11887,24 +11899,24 @@ function ma(s) {
|
|
|
11887
11899
|
);
|
|
11888
11900
|
p("form", b).onsubmit = (x) => {
|
|
11889
11901
|
x.preventDefault();
|
|
11890
|
-
const
|
|
11902
|
+
const M = p(
|
|
11891
11903
|
'input[name="name"]',
|
|
11892
11904
|
b
|
|
11893
11905
|
).value.trim();
|
|
11894
|
-
|
|
11895
|
-
name:
|
|
11906
|
+
M && (C.views.push({
|
|
11907
|
+
name: M,
|
|
11896
11908
|
state: structuredClone(h),
|
|
11897
|
-
columns:
|
|
11898
|
-
gridState:
|
|
11909
|
+
columns: $.columnApi.getColumnState(),
|
|
11910
|
+
gridState: $.api.getState(),
|
|
11899
11911
|
tab: m,
|
|
11900
11912
|
search: y,
|
|
11901
11913
|
filterSearch: E,
|
|
11902
11914
|
collaborators: p('[name="collaborators"]', b).value,
|
|
11903
11915
|
visibility: p('[name="visibility"]:checked', b).value
|
|
11904
|
-
}), q(),
|
|
11916
|
+
}), q(), tt(), ce(), fe("视图已保存"));
|
|
11905
11917
|
};
|
|
11906
11918
|
}
|
|
11907
|
-
function
|
|
11919
|
+
function tt() {
|
|
11908
11920
|
p('[data-action="saved-views"]').classList.toggle("hidden", !C.views.length);
|
|
11909
11921
|
}
|
|
11910
11922
|
document.addEventListener(
|
|
@@ -11916,75 +11928,84 @@ function ma(s) {
|
|
|
11916
11928
|
);
|
|
11917
11929
|
if (!b) return;
|
|
11918
11930
|
w.preventDefault();
|
|
11919
|
-
const x = Number(b.dataset.view),
|
|
11931
|
+
const x = Number(b.dataset.view), M = C.views[x], L = Te(
|
|
11920
11932
|
b,
|
|
11921
|
-
|
|
11933
|
+
M.name,
|
|
11922
11934
|
'<button class="menu-option" data-view-menu="rename">重命名</button><button class="menu-option" data-view-menu="duplicate">复制视图</button><button class="menu-option" data-view-menu="remove">删除视图</button>',
|
|
11923
11935
|
220
|
|
11924
11936
|
);
|
|
11925
|
-
|
|
11926
|
-
var
|
|
11927
|
-
const
|
|
11937
|
+
L.onclick = (B) => {
|
|
11938
|
+
var D;
|
|
11939
|
+
const H = (D = B.target.closest(
|
|
11928
11940
|
"[data-view-menu]"
|
|
11929
|
-
)) == null ? void 0 :
|
|
11930
|
-
if (
|
|
11931
|
-
if (
|
|
11932
|
-
|
|
11933
|
-
}),
|
|
11934
|
-
const
|
|
11935
|
-
|
|
11941
|
+
)) == null ? void 0 : D.dataset.viewMenu;
|
|
11942
|
+
if (H) {
|
|
11943
|
+
if (ce(), H === "rename" && $e("重命名视图", M.name, (k) => {
|
|
11944
|
+
M.name = k, q(), tt();
|
|
11945
|
+
}), H === "duplicate") {
|
|
11946
|
+
const k = structuredClone(M);
|
|
11947
|
+
k.name += "(副本)", C.views.push(k), q(), tt();
|
|
11936
11948
|
}
|
|
11937
|
-
|
|
11949
|
+
H === "remove" && (C.views.splice(x, 1), q(), tt(), fe("视图已删除"));
|
|
11938
11950
|
}
|
|
11939
11951
|
};
|
|
11940
11952
|
},
|
|
11941
11953
|
{ signal: r.signal }
|
|
11942
11954
|
);
|
|
11943
|
-
function ze(w, b, x,
|
|
11944
|
-
const
|
|
11945
|
-
if (
|
|
11946
|
-
if (
|
|
11947
|
-
|
|
11955
|
+
function ze(w, b, x, M) {
|
|
11956
|
+
const L = u(b);
|
|
11957
|
+
if (L) {
|
|
11958
|
+
if (L.editable === !1) {
|
|
11959
|
+
fe("系统字段,不支持修改");
|
|
11948
11960
|
return;
|
|
11949
11961
|
}
|
|
11950
|
-
if (
|
|
11962
|
+
if (L.kind === "vote") {
|
|
11951
11963
|
Ce(x, b, x[b] ? "" : s.currentUser);
|
|
11952
11964
|
return;
|
|
11953
11965
|
}
|
|
11954
|
-
["text", "number"].includes(e.resolve(
|
|
11966
|
+
["text", "number"].includes(e.resolve(L).id) ? lt(w, L, x) : gt(w, L, x);
|
|
11955
11967
|
}
|
|
11956
11968
|
}
|
|
11957
11969
|
p("#grid").addEventListener("keydown", (w) => {
|
|
11958
11970
|
if (!["Enter", "F2"].includes(w.key) || w.target.closest("button,input,textarea,select")) return;
|
|
11959
|
-
const b = w.target.closest(".ag-cell[data-colid]"), x = b == null ? void 0 : b.closest("[data-rowid]"),
|
|
11960
|
-
b &&
|
|
11971
|
+
const b = w.target.closest(".ag-cell[data-colid]"), x = b == null ? void 0 : b.closest("[data-rowid]"), M = C.items.find((L) => L.id === (x == null ? void 0 : x.dataset.rowid));
|
|
11972
|
+
b && M && (w.preventDefault(), ze(b, b.dataset.colid, M));
|
|
11961
11973
|
}, { capture: !0, signal: r.signal });
|
|
11962
|
-
function
|
|
11974
|
+
function it() {
|
|
11963
11975
|
p("#grid").querySelectorAll(".ag-header-cell").forEach((w) => {
|
|
11964
|
-
var B,
|
|
11976
|
+
var B, H;
|
|
11965
11977
|
const b = w.dataset.colid;
|
|
11978
|
+
if (b === "_add") {
|
|
11979
|
+
if (!w.querySelector(".work-add-column")) {
|
|
11980
|
+
const D = w.querySelector(".ag-header-cell-label"), k = document.createElement("button");
|
|
11981
|
+
k.type = "button", k.className = "work-add-column", k.ariaLabel = "新增字段", k.title = "新增字段", k.innerHTML = xe("add"), k.onmousedown = (I) => I.stopPropagation(), k.onclick = (I) => {
|
|
11982
|
+
I.stopPropagation(), ct(k, "_add", !1);
|
|
11983
|
+
}, D.replaceChildren(k);
|
|
11984
|
+
}
|
|
11985
|
+
return;
|
|
11986
|
+
}
|
|
11966
11987
|
if (!u(b)) return;
|
|
11967
11988
|
if (!w.querySelector(".work-header-sort")) {
|
|
11968
|
-
const
|
|
11969
|
-
|
|
11970
|
-
const
|
|
11971
|
-
|
|
11972
|
-
G.stopPropagation(), Ge(
|
|
11973
|
-
},
|
|
11989
|
+
const D = document.createElement("span");
|
|
11990
|
+
D.className = "work-header-sort", (B = w.querySelector(".ag-header-cell-label")) == null || B.append(D);
|
|
11991
|
+
const k = document.createElement("button");
|
|
11992
|
+
k.className = "work-header-menu", k.ariaLabel = `${u(b).label}操作`, k.innerHTML = xe("more"), k.onclick = (G) => {
|
|
11993
|
+
G.stopPropagation(), Ge(k, b);
|
|
11994
|
+
}, k.onmousedown = (G) => G.stopPropagation(), w.append(k);
|
|
11974
11995
|
for (const G of ["right", "left"]) {
|
|
11975
11996
|
const V = document.createElement("button");
|
|
11976
|
-
V.className = "work-header-add", V.dataset.insertSide = G, V.ariaLabel = `在${u(b).label}${G === "right" ? "右" : "左"}侧插入列`, V.title = "插入列", V.innerHTML =
|
|
11977
|
-
ee.stopPropagation(),
|
|
11997
|
+
V.className = "work-header-add", V.dataset.insertSide = G, V.ariaLabel = `在${u(b).label}${G === "right" ? "右" : "左"}侧插入列`, V.title = "插入列", V.innerHTML = xe("add"), V.onclick = (ee) => {
|
|
11998
|
+
ee.stopPropagation(), ct(V, b, G === "right");
|
|
11978
11999
|
}, V.onmousedown = (ee) => ee.stopPropagation(), w.append(V);
|
|
11979
12000
|
}
|
|
11980
|
-
const
|
|
11981
|
-
const G = w.getBoundingClientRect(), V = p(".grid-wrap").getBoundingClientRect(),
|
|
11982
|
-
w.querySelectorAll(".work-header-add").forEach((
|
|
11983
|
-
const ue =
|
|
11984
|
-
|
|
12001
|
+
const I = () => {
|
|
12002
|
+
const G = w.getBoundingClientRect(), V = p(".grid-wrap").getBoundingClientRect(), re = w.closest(".ag-header-viewport,.ag-pinned-left-header,.ag-pinned-right-header").getBoundingClientRect();
|
|
12003
|
+
w.querySelectorAll(".work-header-add").forEach((oe) => {
|
|
12004
|
+
const ue = oe.dataset.insertSide === "left" ? G.left : G.right;
|
|
12005
|
+
oe.style.left = `${ue - 12}px`, oe.style.top = `${G.top - 20}px`, oe.style.setProperty("--insert-line-height", `${Math.max(0, V.bottom - G.top + 8)}px`), oe.style.display = ue < Math.max(V.left, re.left) - 1 || ue > Math.min(V.right, re.right) + 1 ? "none" : "";
|
|
11985
12006
|
}), w.classList.add("insert-points-ready");
|
|
11986
12007
|
};
|
|
11987
|
-
w.addEventListener("mouseenter",
|
|
12008
|
+
w.addEventListener("mouseenter", I), w.addEventListener("focusin", I), w.addEventListener(
|
|
11988
12009
|
"click",
|
|
11989
12010
|
(G) => {
|
|
11990
12011
|
var ee;
|
|
@@ -11994,97 +12015,82 @@ function ma(s) {
|
|
|
11994
12015
|
return;
|
|
11995
12016
|
G.stopImmediatePropagation();
|
|
11996
12017
|
const V = (ee = h.sorts.find(
|
|
11997
|
-
(
|
|
12018
|
+
(re) => re.colId === b
|
|
11998
12019
|
)) == null ? void 0 : ee.sort;
|
|
11999
12020
|
h.sorts = V === "desc" ? [] : [
|
|
12000
12021
|
{
|
|
12001
12022
|
colId: b,
|
|
12002
12023
|
sort: V === "asc" ? "desc" : "asc"
|
|
12003
12024
|
}
|
|
12004
|
-
],
|
|
12025
|
+
], te();
|
|
12005
12026
|
},
|
|
12006
12027
|
{ capture: !0 }
|
|
12007
12028
|
);
|
|
12008
12029
|
}
|
|
12009
|
-
const x = (
|
|
12010
|
-
|
|
12030
|
+
const x = (H = h.sorts.find((D) => D.colId === b)) == null ? void 0 : H.sort, M = w.querySelector(".work-header-sort"), L = x === "asc" ? "↑" : x === "desc" ? "↓" : "↕";
|
|
12031
|
+
M.textContent !== L && (M.textContent = L), M.classList.toggle("sorted", !!x), w.setAttribute(
|
|
12011
12032
|
"aria-sort",
|
|
12012
12033
|
x === "asc" ? "ascending" : x === "desc" ? "descending" : "none"
|
|
12013
12034
|
);
|
|
12014
12035
|
});
|
|
12015
12036
|
}
|
|
12016
|
-
function
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
var N;
|
|
12026
|
-
return H.label.includes($) && !((N = F.columnApi.getColumn(H.key)) != null && N.visible);
|
|
12027
|
-
}
|
|
12028
|
-
).map(
|
|
12029
|
-
(H) => `<button class="menu-option" data-insert="${ae(H.key)}">${ae(H.label)}</button>`
|
|
12030
|
-
).join("") || '<p class="muted">暂无未显示字段</p>';
|
|
12031
|
-
}, B = ($) => {
|
|
12032
|
-
var P;
|
|
12033
|
-
const N = F.columnApi.getColumnState().findIndex((G) => G.colId === b) + (x ? 1 : 0);
|
|
12034
|
-
F.columnApi.setColumnVisible($, !0), F.columnApi.setColumnPinned(
|
|
12035
|
-
$,
|
|
12036
|
-
b === "_add" ? null : ((P = F.columnApi.getColumn(b)) == null ? void 0 : P.pinned) ?? null
|
|
12037
|
-
), F.columnApi.moveColumn($, Math.max(1, N)), de(), J(), tt();
|
|
12037
|
+
function ct(w, b, x) {
|
|
12038
|
+
ce();
|
|
12039
|
+
const M = (B) => {
|
|
12040
|
+
var k;
|
|
12041
|
+
const D = $.columnApi.getColumnState().findIndex((I) => I.colId === b) + (x ? 1 : 0);
|
|
12042
|
+
$.columnApi.setColumnVisible(B, !0), $.columnApi.setColumnPinned(
|
|
12043
|
+
B,
|
|
12044
|
+
b === "_add" ? null : ((k = $.columnApi.getColumn(b)) == null ? void 0 : k.pinned) ?? null
|
|
12045
|
+
), $.columnApi.moveColumn(B, Math.max(1, D)), ce(), J(), it();
|
|
12038
12046
|
};
|
|
12039
|
-
|
|
12040
|
-
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
|
|
12044
|
-
|
|
12045
|
-
B(
|
|
12046
|
-
|
|
12047
|
-
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
|
|
12056
|
-
|
|
12057
|
-
|
|
12058
|
-
|
|
12059
|
-
|
|
12060
|
-
|
|
12061
|
-
|
|
12062
|
-
|
|
12063
|
-
|
|
12064
|
-
|
|
12065
|
-
|
|
12047
|
+
Ze(w, M, {
|
|
12048
|
+
available: (B) => {
|
|
12049
|
+
var H;
|
|
12050
|
+
return !((H = $.columnApi.getColumn(B)) != null && H.visible);
|
|
12051
|
+
},
|
|
12052
|
+
onCreate: () => {
|
|
12053
|
+
const B = Te(
|
|
12054
|
+
w,
|
|
12055
|
+
"新建字段",
|
|
12056
|
+
`<form class="new-field-form"><label>字段名称<input name="label" aria-label="字段名称" required maxlength="80"></label><label>字段类型<select name="kind" aria-label="字段类型">${e.list().map((H) => `<option value="${ae(H.id)}">${ae(H.label)}</option>`).join("")}<option value="person">人员</option><option value="relation">关联</option></select></label><label>选项(每行一个)<textarea name="options" aria-label="字段选项"></textarea></label><label class="choice-limit hidden">最多可选数量<input name="maxSelections" type="number" min="1" step="1" placeholder="不限" aria-label="最多可选数量"></label><button class="primary" type="submit">确认创建</button></form>`,
|
|
12057
|
+
320
|
|
12058
|
+
);
|
|
12059
|
+
p('[name="kind"]', B).onchange = (H) => {
|
|
12060
|
+
p(".choice-limit", B).classList.toggle("hidden", H.target.value !== "multiSelect");
|
|
12061
|
+
}, p("form", B).onsubmit = (H) => {
|
|
12062
|
+
H.preventDefault();
|
|
12063
|
+
const D = new FormData(H.target), k = String(D.get("label") || "").trim();
|
|
12064
|
+
if (!k) return;
|
|
12065
|
+
const I = `field_${Date.now()}_${Math.random().toString(36).slice(2, 6)}`, G = String(D.get("kind")), V = {
|
|
12066
|
+
key: I,
|
|
12067
|
+
label: k,
|
|
12068
|
+
kind: G,
|
|
12069
|
+
editable: !0,
|
|
12070
|
+
width: 160
|
|
12071
|
+
};
|
|
12072
|
+
["select", "multiSelect", "person"].includes(G) && (V.options = [
|
|
12073
|
+
...new Set(
|
|
12074
|
+
String(D.get("options") || "").split(`
|
|
12075
|
+
`).map((oe) => oe.trim()).filter(Boolean)
|
|
12076
|
+
)
|
|
12077
|
+
]);
|
|
12078
|
+
const ee = Number(D.get("maxSelections"));
|
|
12079
|
+
G === "multiSelect" && Number.isInteger(ee) && ee > 0 && (V.maxSelections = ee), s.fields.push(V), d.push([I, k]), V.options && (f[I] = V.options), C.customFields.push(V);
|
|
12080
|
+
const re = $.columnApi.getColumnState();
|
|
12081
|
+
$.api.setColumnDefs(U()), $.columnApi.applyColumnState(re, !0), M(I), q(), te();
|
|
12066
12082
|
};
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
String(G.get("options") || "").split(`
|
|
12070
|
-
`).map((Ne) => Ne.trim()).filter(Boolean)
|
|
12071
|
-
)
|
|
12072
|
-
]);
|
|
12073
|
-
const ue = Number(G.get("maxSelections"));
|
|
12074
|
-
le === "multiSelect" && Number.isInteger(ue) && ue > 0 && (te.maxSelections = ue), s.fields.push(te), d.push([ee, V]), te.options && (f[ee] = te.options), C.customFields.push(te);
|
|
12075
|
-
const me = F.columnApi.getColumnState();
|
|
12076
|
-
F.api.setColumnDefs(U()), F.columnApi.applyColumnState(me, !0), B(ee), q(), ie();
|
|
12077
|
-
};
|
|
12078
|
-
};
|
|
12083
|
+
}
|
|
12084
|
+
});
|
|
12079
12085
|
}
|
|
12080
12086
|
function Ge(w, b) {
|
|
12081
|
-
const x =
|
|
12087
|
+
const x = $.columnApi.getColumn(b);
|
|
12082
12088
|
if (!x || b === "_select") return;
|
|
12083
12089
|
if (b === "_add") {
|
|
12084
|
-
|
|
12090
|
+
ct(w, b, !1);
|
|
12085
12091
|
return;
|
|
12086
12092
|
}
|
|
12087
|
-
const
|
|
12093
|
+
const M = [
|
|
12088
12094
|
"向左插入列",
|
|
12089
12095
|
"向右插入列",
|
|
12090
12096
|
f[b] ? "以 首项 → 末项 排序" : "以 A → Z 排序",
|
|
@@ -12094,36 +12100,36 @@ function ma(s) {
|
|
|
12094
12100
|
"编辑列",
|
|
12095
12101
|
"删除列",
|
|
12096
12102
|
"以此分组"
|
|
12097
|
-
],
|
|
12103
|
+
], L = Te(
|
|
12098
12104
|
w,
|
|
12099
12105
|
"",
|
|
12100
12106
|
[[0, 1], [2, 3], [4, 8], [5, 6, 7]].map((B) => B.map(
|
|
12101
|
-
(
|
|
12107
|
+
(H) => `<button class="menu-option${H === 7 ? " destructive" : ""}" data-col-menu="${H}" ${H === 7 && b === "name" ? "disabled" : ""}>${M[H]}</button>`
|
|
12102
12108
|
).join("")).join('<div class="column-menu-separator" role="separator"></div>'),
|
|
12103
12109
|
240,
|
|
12104
12110
|
"column-menu"
|
|
12105
12111
|
);
|
|
12106
|
-
|
|
12107
|
-
const
|
|
12112
|
+
L.dataset.headerMenu = "true", L.onclick = (B) => {
|
|
12113
|
+
const H = B.target.closest(
|
|
12108
12114
|
"[data-col-menu]"
|
|
12109
12115
|
);
|
|
12110
|
-
if (
|
|
12111
|
-
const
|
|
12112
|
-
|
|
12116
|
+
if (!H) return;
|
|
12117
|
+
const D = +H.dataset.colMenu;
|
|
12118
|
+
ce(), (D === 0 || D === 1) && ct(w, b, D === 1), (D === 2 || D === 3) && (h.sorts = [{ colId: b, sort: D === 2 ? "asc" : "desc" }], te()), D === 4 && (h.filters.push({
|
|
12113
12119
|
field: b,
|
|
12114
12120
|
operator: "contains",
|
|
12115
12121
|
value: ""
|
|
12116
|
-
}), X("filter", p('[data-action="filter"]'))),
|
|
12122
|
+
}), X("filter", p('[data-action="filter"]'))), D === 5 && $.columnApi.setColumnPinned(
|
|
12117
12123
|
b,
|
|
12118
12124
|
x.pinned ? null : "left"
|
|
12119
|
-
),
|
|
12120
|
-
const
|
|
12121
|
-
|
|
12122
|
-
const G =
|
|
12123
|
-
V && (V.headerName =
|
|
12124
|
-
const ee =
|
|
12125
|
-
|
|
12126
|
-
}),
|
|
12125
|
+
), D === 6 && $e("编辑列", x.headerName, (k) => {
|
|
12126
|
+
const I = u(b);
|
|
12127
|
+
I && (I.label = k);
|
|
12128
|
+
const G = $.api.getColumnDefs(), V = G.find((re) => re.field === b);
|
|
12129
|
+
V && (V.headerName = k);
|
|
12130
|
+
const ee = $.columnApi.getColumnState();
|
|
12131
|
+
$.api.setColumnDefs(G), $.columnApi.applyColumnState(ee, !0), it();
|
|
12132
|
+
}), D === 7 && $.columnApi.setColumnVisible(b, !1), D === 8 && (h.groups.includes(b) || h.groups.push(b), te());
|
|
12127
12133
|
};
|
|
12128
12134
|
}
|
|
12129
12135
|
p("#grid").addEventListener("contextmenu", (w) => {
|
|
@@ -12138,44 +12144,44 @@ function ma(s) {
|
|
|
12138
12144
|
const x = w.target.closest(".ag-cell");
|
|
12139
12145
|
if (x) {
|
|
12140
12146
|
w.preventDefault();
|
|
12141
|
-
const
|
|
12147
|
+
const M = Te(
|
|
12142
12148
|
x,
|
|
12143
12149
|
"单元格",
|
|
12144
12150
|
se("copy-cell", "复制") + se("paste-cell", "粘贴") + se("export", "导出表格"),
|
|
12145
12151
|
200
|
|
12146
12152
|
);
|
|
12147
|
-
p('[data-action="copy-cell"]',
|
|
12153
|
+
p('[data-action="copy-cell"]', M).onclick = async () => {
|
|
12148
12154
|
try {
|
|
12149
|
-
await navigator.clipboard.writeText(x.textContent || ""),
|
|
12155
|
+
await navigator.clipboard.writeText(x.textContent || ""), fe("已复制");
|
|
12150
12156
|
} catch {
|
|
12151
|
-
|
|
12157
|
+
fe("复制失败,请使用 ⌘C");
|
|
12152
12158
|
}
|
|
12153
|
-
|
|
12159
|
+
ce();
|
|
12154
12160
|
};
|
|
12155
12161
|
}
|
|
12156
12162
|
}
|
|
12157
12163
|
}), p("#grid").addEventListener(
|
|
12158
12164
|
"dblclick",
|
|
12159
12165
|
(w) => {
|
|
12160
|
-
var
|
|
12166
|
+
var H;
|
|
12161
12167
|
const b = w.target.closest(".ag-cell");
|
|
12162
12168
|
if (!b || w.target.closest(
|
|
12163
12169
|
"input,textarea,select,.ag-cell-edit-input"
|
|
12164
12170
|
))
|
|
12165
12171
|
return;
|
|
12166
|
-
const x = b.dataset.colid,
|
|
12167
|
-
(
|
|
12168
|
-
var
|
|
12169
|
-
return
|
|
12172
|
+
const x = b.dataset.colid, M = C.items.find(
|
|
12173
|
+
(D) => {
|
|
12174
|
+
var k;
|
|
12175
|
+
return D.id === ((k = b.closest(".ag-row")) == null ? void 0 : k.dataset.rowid);
|
|
12170
12176
|
}
|
|
12171
12177
|
);
|
|
12172
|
-
if (!
|
|
12173
|
-
clearTimeout(
|
|
12174
|
-
const
|
|
12178
|
+
if (!M || !u(x)) return;
|
|
12179
|
+
clearTimeout(F), w.stopImmediatePropagation(), w.preventDefault();
|
|
12180
|
+
const L = $.api.getDisplayedRowCount();
|
|
12175
12181
|
let B = 0;
|
|
12176
|
-
for (; B <
|
|
12182
|
+
for (; B < L && ((H = $.api.getDisplayedRowAtIndex(B)) == null ? void 0 : H.id) !== M.id; B++)
|
|
12177
12183
|
;
|
|
12178
|
-
ze(b, x,
|
|
12184
|
+
ze(b, x, M);
|
|
12179
12185
|
},
|
|
12180
12186
|
{ capture: !0, signal: r.signal }
|
|
12181
12187
|
), document.addEventListener(
|
|
@@ -12183,79 +12189,79 @@ function ma(s) {
|
|
|
12183
12189
|
(w) => {
|
|
12184
12190
|
s.container.querySelectorAll(".field-picker").forEach((b) => {
|
|
12185
12191
|
b.contains(w.target) || b.remove();
|
|
12186
|
-
}), p("#grid").contains(w.target) || (
|
|
12192
|
+
}), p("#grid").contains(w.target) || ($.api.getCellRanges().length && $.api.clearRangeSelection(), $.api.getFocusedCell() && $.api.clearFocusedCell()), (S == null ? void 0 : S.dataset.headerMenu) === "true" && !S.contains(w.target) && ce();
|
|
12187
12193
|
},
|
|
12188
12194
|
{ capture: !0, signal: r.signal }
|
|
12189
12195
|
), document.addEventListener(
|
|
12190
12196
|
"click",
|
|
12191
12197
|
async (w) => {
|
|
12192
|
-
const b = w.target, x = (
|
|
12193
|
-
(
|
|
12198
|
+
const b = w.target, x = (k) => w.composedPath().some(
|
|
12199
|
+
(I) => I instanceof Element && I.matches(k)
|
|
12194
12200
|
);
|
|
12195
12201
|
if (!w.composedPath().includes(s.container)) {
|
|
12196
|
-
|
|
12202
|
+
ce();
|
|
12197
12203
|
return;
|
|
12198
12204
|
}
|
|
12199
12205
|
x(
|
|
12200
12206
|
".popup,.field-picker,.toolbar,.ag-cell,.ag-header-cell,.list-bottom,.create-button"
|
|
12201
|
-
) ||
|
|
12202
|
-
const
|
|
12203
|
-
if (
|
|
12204
|
-
m =
|
|
12205
|
-
|
|
12206
|
-
}),
|
|
12207
|
+
) || ce();
|
|
12208
|
+
const M = b.closest("[data-tab]");
|
|
12209
|
+
if (M) {
|
|
12210
|
+
m = M.dataset.tab, s.container.querySelectorAll("[data-tab]").forEach((k) => {
|
|
12211
|
+
k.classList.toggle("active", k === M), k.setAttribute("aria-selected", String(k === M));
|
|
12212
|
+
}), te();
|
|
12207
12213
|
return;
|
|
12208
12214
|
}
|
|
12209
|
-
const
|
|
12210
|
-
if (
|
|
12211
|
-
const
|
|
12212
|
-
h = structuredClone(
|
|
12213
|
-
|
|
12215
|
+
const L = b.closest("[data-view]");
|
|
12216
|
+
if (L) {
|
|
12217
|
+
const k = C.views[+L.dataset.view];
|
|
12218
|
+
h = structuredClone(k.state), m = k.tab || "全部", y = k.search || "", E = !!k.filterSearch, s.container.querySelectorAll("[data-tab]").forEach((I) => {
|
|
12219
|
+
I.classList.toggle("active", I.dataset.tab === m), I.setAttribute(
|
|
12214
12220
|
"aria-selected",
|
|
12215
|
-
String(
|
|
12221
|
+
String(I.dataset.tab === m)
|
|
12216
12222
|
);
|
|
12217
|
-
}), p("#search").value = y, p("#filter-search").checked = E, p(".search-wrap").classList.toggle("hidden", !y), p('[data-action="search"]').classList.toggle("hidden", !!y),
|
|
12218
|
-
|
|
12223
|
+
}), p("#search").value = y, p("#filter-search").checked = E, p(".search-wrap").classList.toggle("hidden", !y), p('[data-action="search"]').classList.toggle("hidden", !!y), ce(), te(), k.gridState ? $.api.setState(k.gridState) : k.columns && $.columnApi.applyColumnState(
|
|
12224
|
+
k.columns,
|
|
12219
12225
|
!0
|
|
12220
12226
|
), Y();
|
|
12221
12227
|
return;
|
|
12222
12228
|
}
|
|
12223
12229
|
const B = b.closest("[data-detail-tab]");
|
|
12224
|
-
if (B &&
|
|
12225
|
-
|
|
12230
|
+
if (B && A) {
|
|
12231
|
+
Ne(A, B.dataset.detailTab);
|
|
12226
12232
|
return;
|
|
12227
12233
|
}
|
|
12228
|
-
const
|
|
12229
|
-
if (
|
|
12230
|
-
const
|
|
12231
|
-
if (["filter", "sort", "group", "color"].includes(
|
|
12232
|
-
|
|
12234
|
+
const H = b.closest("[data-action]");
|
|
12235
|
+
if (!H) return;
|
|
12236
|
+
const D = H.dataset.action;
|
|
12237
|
+
if (["filter", "sort", "group", "color"].includes(D)) {
|
|
12238
|
+
N === D ? ce() : X(D, H);
|
|
12233
12239
|
return;
|
|
12234
12240
|
}
|
|
12235
|
-
switch (
|
|
12241
|
+
switch (D) {
|
|
12236
12242
|
case "controls":
|
|
12237
12243
|
yt();
|
|
12238
12244
|
break;
|
|
12239
12245
|
case "close-popup":
|
|
12240
|
-
|
|
12246
|
+
ce();
|
|
12241
12247
|
break;
|
|
12242
12248
|
case "create":
|
|
12243
12249
|
rt();
|
|
12244
12250
|
break;
|
|
12245
12251
|
case "create-menu":
|
|
12246
12252
|
Te(
|
|
12247
|
-
|
|
12253
|
+
H,
|
|
12248
12254
|
"新建",
|
|
12249
12255
|
se("create", "新建选题", "plus", "menu-option") + se("drafts", "草稿箱", "inbox", "menu-option"),
|
|
12250
12256
|
180
|
|
12251
12257
|
);
|
|
12252
12258
|
break;
|
|
12253
12259
|
case "drafts": {
|
|
12254
|
-
const
|
|
12255
|
-
`<section class="dialog"><h2>草稿箱</h2>${C.drafts.length ? C.drafts.map((
|
|
12260
|
+
const k = Re(
|
|
12261
|
+
`<section class="dialog"><h2>草稿箱</h2>${C.drafts.length ? C.drafts.map((I, G) => `<button class="menu-option" data-draft="${G}">${ae(I.name || "未命名选题")}</button>`).join("") : '<p class="muted">暂无草稿</p>'}<div class="actions">${se("close-overlay", "关闭", "", "outline")}</div></section>`
|
|
12256
12262
|
);
|
|
12257
|
-
|
|
12258
|
-
const G =
|
|
12263
|
+
k.onclick = (I) => {
|
|
12264
|
+
const G = I.target.closest(
|
|
12259
12265
|
"[data-draft]"
|
|
12260
12266
|
);
|
|
12261
12267
|
G && rt(C.drafts[+G.dataset.draft]);
|
|
@@ -12266,10 +12272,10 @@ function ma(s) {
|
|
|
12266
12272
|
ke();
|
|
12267
12273
|
break;
|
|
12268
12274
|
case "search":
|
|
12269
|
-
p(".search-wrap").classList.remove("hidden"),
|
|
12275
|
+
p(".search-wrap").classList.remove("hidden"), H.classList.add("hidden"), p("#search").focus();
|
|
12270
12276
|
break;
|
|
12271
12277
|
case "close-search":
|
|
12272
|
-
y = "", E = !1, p("#search").value = "", p("#filter-search").checked = !1, p(".search-wrap").classList.add("hidden"), p('[data-action="search"]').classList.remove("hidden"),
|
|
12278
|
+
y = "", E = !1, p("#search").value = "", p("#filter-search").checked = !1, p(".search-wrap").classList.add("hidden"), p('[data-action="search"]').classList.remove("hidden"), te();
|
|
12273
12279
|
break;
|
|
12274
12280
|
case "previous-match":
|
|
12275
12281
|
R--, Y();
|
|
@@ -12278,49 +12284,49 @@ function ma(s) {
|
|
|
12278
12284
|
R++, Y();
|
|
12279
12285
|
break;
|
|
12280
12286
|
case "reset":
|
|
12281
|
-
h = on(),
|
|
12287
|
+
h = on(), te(), ce();
|
|
12282
12288
|
break;
|
|
12283
12289
|
case "columns":
|
|
12284
12290
|
case "layout":
|
|
12285
|
-
he(
|
|
12291
|
+
he(H);
|
|
12286
12292
|
break;
|
|
12287
12293
|
case "save-view":
|
|
12288
12294
|
case "pin-view":
|
|
12289
|
-
|
|
12295
|
+
et(H);
|
|
12290
12296
|
break;
|
|
12291
12297
|
case "saved-views":
|
|
12292
12298
|
Te(
|
|
12293
|
-
|
|
12299
|
+
H,
|
|
12294
12300
|
"切换视图",
|
|
12295
|
-
C.views.map((
|
|
12301
|
+
C.views.map((k, I) => `<button class="menu-option" data-view="${I}">${xe("table")}<span>${ae(k.name)}</span></button>`).join(""),
|
|
12296
12302
|
260
|
|
12297
12303
|
);
|
|
12298
12304
|
break;
|
|
12299
12305
|
case "share": {
|
|
12300
|
-
const
|
|
12301
|
-
|
|
12306
|
+
const k = Te(
|
|
12307
|
+
H,
|
|
12302
12308
|
"分享工作项列表",
|
|
12303
12309
|
`<input readonly value="${ae(location.href.split("#")[0])}" aria-label="分享链接"><p class="hint">复制此 demo 的访问地址</p><button class="primary" id="copy-link">复制链接</button>`,
|
|
12304
12310
|
380
|
|
12305
12311
|
);
|
|
12306
|
-
p("#copy-link",
|
|
12312
|
+
p("#copy-link", k).onclick = async () => {
|
|
12307
12313
|
try {
|
|
12308
|
-
await navigator.clipboard.writeText(location.href.split("#")[0]),
|
|
12314
|
+
await navigator.clipboard.writeText(location.href.split("#")[0]), fe("链接已复制"), ce();
|
|
12309
12315
|
} catch {
|
|
12310
|
-
p("input",
|
|
12316
|
+
p("input", k).select(), fe("请按 ⌘C 复制链接");
|
|
12311
12317
|
}
|
|
12312
12318
|
};
|
|
12313
12319
|
break;
|
|
12314
12320
|
}
|
|
12315
12321
|
case "deselect":
|
|
12316
|
-
|
|
12322
|
+
$.api.deselectAll();
|
|
12317
12323
|
break;
|
|
12318
12324
|
case "batch-status":
|
|
12319
12325
|
case "batch-owner": {
|
|
12320
|
-
const
|
|
12321
|
-
|
|
12326
|
+
const k = D === "batch-status" ? "status" : "owner", I = $.api.getSelectedRows(), G = Te(
|
|
12327
|
+
H,
|
|
12322
12328
|
"批量更新",
|
|
12323
|
-
f[
|
|
12329
|
+
f[k].map(
|
|
12324
12330
|
(V) => `<button class="menu-option" data-batch-value="${V}">${V}</button>`
|
|
12325
12331
|
).join(""),
|
|
12326
12332
|
220
|
|
@@ -12329,79 +12335,79 @@ function ma(s) {
|
|
|
12329
12335
|
const ee = V.target.closest(
|
|
12330
12336
|
"[data-batch-value]"
|
|
12331
12337
|
);
|
|
12332
|
-
ee && (
|
|
12333
|
-
|
|
12334
|
-
}), q(),
|
|
12338
|
+
ee && (I.forEach((re) => {
|
|
12339
|
+
re[k] = ee.dataset.batchValue, re.history.push(`批量更新${k}:${re[k]}`);
|
|
12340
|
+
}), q(), te(), ce(), fe(`已更新 ${I.length} 项`));
|
|
12335
12341
|
};
|
|
12336
12342
|
break;
|
|
12337
12343
|
}
|
|
12338
12344
|
case "batch-archive": {
|
|
12339
|
-
const
|
|
12340
|
-
|
|
12345
|
+
const k = $.api.getSelectedRows();
|
|
12346
|
+
k.forEach((I) => I.status = "已终止"), q(), te(), fe(`已终止 ${k.length} 项,可在筛选中显示`);
|
|
12341
12347
|
break;
|
|
12342
12348
|
}
|
|
12343
12349
|
case "batch-export":
|
|
12344
|
-
|
|
12350
|
+
$.api.exportToCsv({
|
|
12345
12351
|
fileName: "选题库.csv",
|
|
12346
12352
|
onlySelected: !0,
|
|
12347
|
-
columnKeys: d.map(([
|
|
12353
|
+
columnKeys: d.map(([k]) => k)
|
|
12348
12354
|
});
|
|
12349
12355
|
break;
|
|
12350
12356
|
case "export":
|
|
12351
|
-
|
|
12357
|
+
$.api.exportToCsv({
|
|
12352
12358
|
fileName: "选题库.csv",
|
|
12353
|
-
columnKeys: d.map(([
|
|
12354
|
-
}),
|
|
12359
|
+
columnKeys: d.map(([k]) => k)
|
|
12360
|
+
}), ce();
|
|
12355
12361
|
break;
|
|
12356
12362
|
case "paste-cell":
|
|
12357
|
-
|
|
12363
|
+
$.api.pasteFromClipboard(), ce();
|
|
12358
12364
|
break;
|
|
12359
12365
|
case "follow":
|
|
12360
|
-
|
|
12366
|
+
A && (A.followed = !A.followed, q(), Ne(A, W));
|
|
12361
12367
|
break;
|
|
12362
12368
|
case "star":
|
|
12363
|
-
|
|
12369
|
+
A && (A.starred = !A.starred, q(), Ne(A, W));
|
|
12364
12370
|
break;
|
|
12365
12371
|
case "detail-vote":
|
|
12366
|
-
|
|
12372
|
+
A && (Ce(A, "vote", A.vote ? "" : "体验官"), Ne(A));
|
|
12367
12373
|
break;
|
|
12368
12374
|
case "detail-status":
|
|
12369
|
-
|
|
12375
|
+
A && Lt(H, "status", A);
|
|
12370
12376
|
break;
|
|
12371
12377
|
case "prev-item":
|
|
12372
12378
|
case "next-item":
|
|
12373
|
-
if (
|
|
12374
|
-
const
|
|
12375
|
-
C.items[
|
|
12379
|
+
if (A) {
|
|
12380
|
+
const k = C.items.indexOf(A) + (D === "prev-item" ? -1 : 1);
|
|
12381
|
+
C.items[k] && Ne(C.items[k], W);
|
|
12376
12382
|
}
|
|
12377
12383
|
break;
|
|
12378
12384
|
case "detail-more":
|
|
12379
12385
|
Te(
|
|
12380
|
-
|
|
12386
|
+
H,
|
|
12381
12387
|
"更多操作",
|
|
12382
12388
|
se("duplicate", "复制工作项", "", "menu-option") + se("terminate-item", "终止工作项", "", "menu-option"),
|
|
12383
12389
|
220
|
|
12384
12390
|
);
|
|
12385
12391
|
break;
|
|
12386
12392
|
case "duplicate":
|
|
12387
|
-
if (
|
|
12388
|
-
const
|
|
12389
|
-
|
|
12393
|
+
if (A) {
|
|
12394
|
+
const k = structuredClone(A);
|
|
12395
|
+
k.id = crypto.randomUUID(), k.name += "(副本)", k.comments = [], k.history = [], C.items.unshift(k), q(), te(), Ne(k);
|
|
12390
12396
|
}
|
|
12391
12397
|
break;
|
|
12392
12398
|
case "terminate-item":
|
|
12393
|
-
|
|
12399
|
+
A && (Ce(A, "status", "已终止"), ke(), fe("工作项已终止"));
|
|
12394
12400
|
break;
|
|
12395
12401
|
case "add-role":
|
|
12396
|
-
j && (j.roles ?? (j.roles = []), j.roles.push({ name: "", person: s.currentUser }),
|
|
12402
|
+
j && (j.roles ?? (j.roles = []), j.roles.push({ name: "", person: s.currentUser }), me(), A && q());
|
|
12397
12403
|
break;
|
|
12398
12404
|
case "add-meeting":
|
|
12399
|
-
j && (j.meetings ?? (j.meetings = []), j.meetings.push({ name: "", person: s.currentUser }),
|
|
12405
|
+
j && (j.meetings ?? (j.meetings = []), j.meetings.push({ name: "", person: s.currentUser }), me(), A && q());
|
|
12400
12406
|
break;
|
|
12401
12407
|
case "link-material": {
|
|
12402
|
-
const
|
|
12403
|
-
|
|
12404
|
-
|
|
12408
|
+
const k = A;
|
|
12409
|
+
k && $e("关联素材", "", (I) => {
|
|
12410
|
+
k.materials ?? (k.materials = []), k.materials.push(I), k.history.push(`关联素材:${I}`), q(), Ne(k, "素材管理");
|
|
12405
12411
|
});
|
|
12406
12412
|
break;
|
|
12407
12413
|
}
|
|
@@ -12409,84 +12415,84 @@ function ma(s) {
|
|
|
12409
12415
|
},
|
|
12410
12416
|
{ signal: r.signal }
|
|
12411
12417
|
), p("#search").oninput = (w) => {
|
|
12412
|
-
y = w.target.value, R = 0, E ?
|
|
12418
|
+
y = w.target.value, R = 0, E ? te() : Y();
|
|
12413
12419
|
}, p("#filter-search").onchange = (w) => {
|
|
12414
|
-
E = w.target.checked,
|
|
12420
|
+
E = w.target.checked, te();
|
|
12415
12421
|
}, document.addEventListener(
|
|
12416
12422
|
"keydown",
|
|
12417
12423
|
(w) => {
|
|
12418
|
-
if (s.container.contains(w.target) && (w.key === "Escape" && (s.container.querySelector(".field-picker") ? s.container.querySelectorAll(".field-picker").forEach((b) => b.remove()) : S ?
|
|
12424
|
+
if (s.container.contains(w.target) && (w.key === "Escape" && (s.container.querySelector(".field-picker") ? s.container.querySelectorAll(".field-picker").forEach((b) => b.remove()) : S ? ce(!1) : P && ke()), w.key === "Tab" && P)) {
|
|
12419
12425
|
const b = [
|
|
12420
|
-
...
|
|
12426
|
+
...P.querySelectorAll(
|
|
12421
12427
|
'button:not([disabled]),input,select,textarea,[tabindex="0"]'
|
|
12422
12428
|
)
|
|
12423
|
-
].filter((
|
|
12424
|
-
w.shiftKey && document.activeElement === x ? (w.preventDefault(),
|
|
12429
|
+
].filter((L) => L.offsetParent !== null), x = b[0], M = b[b.length - 1];
|
|
12430
|
+
w.shiftKey && document.activeElement === x ? (w.preventDefault(), M == null || M.focus()) : !w.shiftKey && document.activeElement === M && (w.preventDefault(), x == null || x.focus());
|
|
12425
12431
|
}
|
|
12426
12432
|
},
|
|
12427
12433
|
{ signal: r.signal }
|
|
12428
|
-
), window.addEventListener("pagehide", () =>
|
|
12434
|
+
), window.addEventListener("pagehide", () => $.grid.destroy(), {
|
|
12429
12435
|
once: !0,
|
|
12430
12436
|
signal: r.signal
|
|
12431
12437
|
});
|
|
12432
|
-
const be = p("#grid .ag-body-viewport"),
|
|
12438
|
+
const be = p("#grid .ag-body-viewport"), nt = p(".grid-wrap"), We = document.createElement("div");
|
|
12433
12439
|
We.className = "work-horizontal-scrollbar", We.setAttribute("aria-label", "横向滚动表格");
|
|
12434
12440
|
const wi = document.createElement("div");
|
|
12435
|
-
We.append(wi),
|
|
12441
|
+
We.append(wi), nt.append(We);
|
|
12436
12442
|
const Ue = document.createElement("div");
|
|
12437
12443
|
Ue.className = "work-vertical-scrollbar", Ue.setAttribute("aria-label", "纵向滚动表格");
|
|
12438
12444
|
const yi = document.createElement("div");
|
|
12439
|
-
Ue.append(yi),
|
|
12445
|
+
Ue.append(yi), nt.append(Ue);
|
|
12440
12446
|
const bi = () => {
|
|
12441
|
-
const w = be.getBoundingClientRect(), b =
|
|
12447
|
+
const w = be.getBoundingClientRect(), b = nt.getBoundingClientRect();
|
|
12442
12448
|
We.style.left = `${w.left - b.left - 1}px`, We.style.width = `${be.clientWidth}px`, wi.style.width = `${be.scrollWidth}px`, We.hidden = be.scrollWidth <= be.clientWidth, We.scrollLeft = be.scrollLeft, Ue.style.top = `${w.top - b.top - 1}px`, Ue.style.height = `${be.clientHeight}px`, yi.style.height = `${be.scrollHeight}px`, Ue.hidden = be.scrollHeight <= be.clientHeight, Ue.scrollTop = be.scrollTop;
|
|
12443
12449
|
};
|
|
12444
12450
|
We.addEventListener("scroll", () => {
|
|
12445
|
-
|
|
12451
|
+
$.grid.setHorizontalScrollLeft(We.scrollLeft);
|
|
12446
12452
|
}, { passive: !0, signal: r.signal }), Ue.addEventListener("scroll", () => {
|
|
12447
12453
|
be.scrollTop = Ue.scrollTop;
|
|
12448
12454
|
}, { passive: !0, signal: r.signal });
|
|
12449
12455
|
let Xt = 0;
|
|
12450
12456
|
be.addEventListener("pointermove", (w) => {
|
|
12451
12457
|
const b = be.getBoundingClientRect();
|
|
12452
|
-
be.classList.toggle("scrollbar-near-right", b.right - w.clientX <= 16), be.classList.toggle("scrollbar-near-bottom", b.bottom - w.clientY <= 16),
|
|
12458
|
+
be.classList.toggle("scrollbar-near-right", b.right - w.clientX <= 16), be.classList.toggle("scrollbar-near-bottom", b.bottom - w.clientY <= 16), nt.classList.toggle("scrollbar-near-right", b.right - w.clientX <= 16), nt.classList.toggle("scrollbar-near-bottom", b.bottom - w.clientY <= 16);
|
|
12453
12459
|
}, { signal: r.signal }), be.addEventListener("pointerleave", () => {
|
|
12454
|
-
be.classList.remove("scrollbar-near-right", "scrollbar-near-bottom"),
|
|
12460
|
+
be.classList.remove("scrollbar-near-right", "scrollbar-near-bottom"), nt.classList.remove("scrollbar-near-right", "scrollbar-near-bottom");
|
|
12455
12461
|
}, { signal: r.signal }), be.addEventListener("scroll", () => {
|
|
12456
|
-
be.classList.add("scrollbar-scrolling"),
|
|
12457
|
-
be.classList.remove("scrollbar-scrolling"),
|
|
12462
|
+
be.classList.add("scrollbar-scrolling"), nt.classList.add("scrollbar-scrolling"), We.scrollLeft = be.scrollLeft, Ue.scrollTop = be.scrollTop, clearTimeout(Xt), Xt = window.setTimeout(() => {
|
|
12463
|
+
be.classList.remove("scrollbar-scrolling"), nt.classList.remove("scrollbar-scrolling");
|
|
12458
12464
|
}, 900);
|
|
12459
12465
|
}, { passive: !0, signal: r.signal });
|
|
12460
12466
|
const Si = () => {
|
|
12461
12467
|
p("#grid").querySelectorAll(".insert-points-ready").forEach((w) => w.classList.remove("insert-points-ready"));
|
|
12462
12468
|
};
|
|
12463
12469
|
window.addEventListener("scroll", Si, { capture: !0, signal: r.signal }), window.addEventListener("resize", Si, { signal: r.signal });
|
|
12464
|
-
const
|
|
12470
|
+
const dt = new ResizeObserver(() => {
|
|
12465
12471
|
J(), bi();
|
|
12466
12472
|
});
|
|
12467
|
-
|
|
12468
|
-
const xi = new window.MutationObserver(() =>
|
|
12473
|
+
dt.observe(p(".list-area")), dt.observe(p(".toolbar")), dt.observe(p(".list-tabs")), dt.observe(p(".ag-header-wrapper")), dt.observe(be), dt.observe(p(".ag-body-container")), bi();
|
|
12474
|
+
const xi = new window.MutationObserver(() => it());
|
|
12469
12475
|
if (xi.observe(p("#grid .ag-header"), {
|
|
12470
12476
|
childList: !0,
|
|
12471
12477
|
subtree: !0
|
|
12472
|
-
}),
|
|
12478
|
+
}), it(), tt(), J(), s.syncLocationHash && location.hash.startsWith("#item/")) {
|
|
12473
12479
|
const w = C.items.find((b) => b.id === location.hash.slice(6));
|
|
12474
|
-
w &&
|
|
12480
|
+
w && Ne(w);
|
|
12475
12481
|
}
|
|
12476
12482
|
return {
|
|
12477
12483
|
registerControl: (w) => {
|
|
12478
|
-
e.register(w),
|
|
12484
|
+
e.register(w), $.api.refreshCells({ force: !0 });
|
|
12479
12485
|
},
|
|
12480
12486
|
getControls: () => e.list(),
|
|
12481
|
-
api:
|
|
12482
|
-
columnApi:
|
|
12487
|
+
api: $.api,
|
|
12488
|
+
columnApi: $.columnApi,
|
|
12483
12489
|
getViewState: () => ({
|
|
12484
12490
|
...structuredClone(h),
|
|
12485
|
-
columns:
|
|
12491
|
+
columns: $.columnApi.getColumnState()
|
|
12486
12492
|
}),
|
|
12487
12493
|
getItems: () => structuredClone(C.items),
|
|
12488
12494
|
destroy: () => {
|
|
12489
|
-
l = !0, o == null || o(), xi.disconnect(),
|
|
12495
|
+
l = !0, o == null || o(), xi.disconnect(), dt.disconnect(), r.abort(), clearTimeout(T), clearTimeout(F), clearTimeout(Xt), ce(), ke(), $.grid.destroy(), s.container.replaceChildren(), s.container.classList.remove("rowvia-work-items");
|
|
12490
12496
|
}
|
|
12491
12497
|
};
|
|
12492
12498
|
}
|
|
@@ -12605,10 +12611,10 @@ function Ca(s, e) {
|
|
|
12605
12611
|
ci[s] = e;
|
|
12606
12612
|
}
|
|
12607
12613
|
function wa(s, e) {
|
|
12608
|
-
|
|
12614
|
+
ut[s] = e;
|
|
12609
12615
|
}
|
|
12610
12616
|
export {
|
|
12611
|
-
|
|
12617
|
+
ut as CELL_EDITORS,
|
|
12612
12618
|
ci as CELL_RENDERERS,
|
|
12613
12619
|
Un as DEFAULT_LOCALE_TEXT,
|
|
12614
12620
|
ri as FORMULA_FUNCTIONS,
|