dsh-workbench-tasks 5.13.9 → 5.15.1
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/CHANGELOG.md +51 -1
- package/lib/client.js +2769 -846
- package/lib/index.js +3 -0
- package/package.json +3 -3
package/lib/client.js
CHANGED
|
@@ -837,6 +837,233 @@ var require_workspacefilter = __commonJS({
|
|
|
837
837
|
}
|
|
838
838
|
});
|
|
839
839
|
|
|
840
|
+
// packages/addons/lib/display-variants.cjs
|
|
841
|
+
var require_display_variants = __commonJS({
|
|
842
|
+
"packages/addons/lib/display-variants.cjs"(exports2, module2) {
|
|
843
|
+
"use strict";
|
|
844
|
+
var LEAF_KEYS = [
|
|
845
|
+
"minWidth",
|
|
846
|
+
"maxWidth",
|
|
847
|
+
"minHeight",
|
|
848
|
+
"maxHeight",
|
|
849
|
+
"minAspect",
|
|
850
|
+
"maxAspect",
|
|
851
|
+
"orientation",
|
|
852
|
+
"pointer",
|
|
853
|
+
"hover",
|
|
854
|
+
"platform"
|
|
855
|
+
];
|
|
856
|
+
var NUMERIC_KEYS = { minWidth: 1, maxWidth: 1, minHeight: 1, maxHeight: 1, minAspect: 1, maxAspect: 1 };
|
|
857
|
+
var warned = /* @__PURE__ */ Object.create(null);
|
|
858
|
+
function warnOnce(label, message) {
|
|
859
|
+
if (warned[label]) return;
|
|
860
|
+
warned[label] = true;
|
|
861
|
+
try {
|
|
862
|
+
if (typeof console !== "undefined" && console && typeof console.warn === "function") console.warn("[display] " + message);
|
|
863
|
+
} catch (e) {
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
function isPlainObject(value) {
|
|
867
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
868
|
+
}
|
|
869
|
+
function matchLeaf(key, expected, display) {
|
|
870
|
+
if (NUMERIC_KEYS[key]) {
|
|
871
|
+
if (typeof expected !== "number" || !isFinite(expected)) {
|
|
872
|
+
warnOnce("num:" + key, key + " \u5FC5\u987B\u662F\u6709\u9650\u6570\u5B57\uFF0C\u5DF2\u5FFD\u7565\u8BE5\u53D8\u4F53");
|
|
873
|
+
return null;
|
|
874
|
+
}
|
|
875
|
+
var actual;
|
|
876
|
+
if (key === "minAspect" || key === "maxAspect") actual = display.aspect;
|
|
877
|
+
else if (key === "minHeight" || key === "maxHeight") actual = display.height;
|
|
878
|
+
else actual = display.width;
|
|
879
|
+
if (typeof actual !== "number" || !isFinite(actual)) return null;
|
|
880
|
+
if (key.indexOf("min") === 0) return actual >= expected;
|
|
881
|
+
return actual <= expected;
|
|
882
|
+
}
|
|
883
|
+
if (key === "hover") {
|
|
884
|
+
if (typeof expected !== "boolean") {
|
|
885
|
+
warnOnce("hover", "hover \u53EA\u80FD\u662F\u5E03\u5C14\u503C\uFF0C\u5DF2\u5FFD\u7565\u8BE5\u53D8\u4F53");
|
|
886
|
+
return null;
|
|
887
|
+
}
|
|
888
|
+
return display.hover === expected;
|
|
889
|
+
}
|
|
890
|
+
if (key === "platform") {
|
|
891
|
+
if (Array.isArray(expected)) return expected.indexOf(display.platform) >= 0;
|
|
892
|
+
if (typeof expected === "string") return display.platform === expected;
|
|
893
|
+
warnOnce("platform", "platform \u53EA\u80FD\u662F\u5B57\u7B26\u4E32\u6216\u5B57\u7B26\u4E32\u6570\u7EC4\uFF0C\u5DF2\u5FFD\u7565\u8BE5\u53D8\u4F53");
|
|
894
|
+
return null;
|
|
895
|
+
}
|
|
896
|
+
if (typeof expected === "string") return display[key] === expected;
|
|
897
|
+
warnOnce(key, key + " \u53EA\u80FD\u662F\u5B57\u7B26\u4E32\uFF0C\u5DF2\u5FFD\u7565\u8BE5\u53D8\u4F53");
|
|
898
|
+
return null;
|
|
899
|
+
}
|
|
900
|
+
function specificityOnPath(when, display) {
|
|
901
|
+
if (when === void 0 || when === null) return 0;
|
|
902
|
+
if (!isPlainObject(when)) {
|
|
903
|
+
warnOnce("shape", "when \u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
904
|
+
return null;
|
|
905
|
+
}
|
|
906
|
+
var keys = Object.keys(when);
|
|
907
|
+
var total = 0;
|
|
908
|
+
for (var i = 0; i < keys.length; i++) {
|
|
909
|
+
var key = keys[i];
|
|
910
|
+
if (key === "all" || key === "any") continue;
|
|
911
|
+
if (LEAF_KEYS.indexOf(key) < 0) {
|
|
912
|
+
warnOnce("key:" + key, "\u672A\u77E5\u8C13\u8BCD\u952E " + key + "\uFF0C\u5DF2\u5FFD\u7565\u8BE5\u53D8\u4F53");
|
|
913
|
+
return null;
|
|
914
|
+
}
|
|
915
|
+
var hit = matchLeaf(key, when[key], display || {});
|
|
916
|
+
if (hit === null) return null;
|
|
917
|
+
if (!hit) return null;
|
|
918
|
+
total += 1;
|
|
919
|
+
}
|
|
920
|
+
if ("all" in when) {
|
|
921
|
+
if (!Array.isArray(when.all)) {
|
|
922
|
+
warnOnce("all", "all \u5FC5\u987B\u662F\u6570\u7EC4");
|
|
923
|
+
return null;
|
|
924
|
+
}
|
|
925
|
+
for (var a = 0; a < when.all.length; a++) {
|
|
926
|
+
var sub = specificityOnPath(when.all[a], display);
|
|
927
|
+
if (sub === null) return null;
|
|
928
|
+
total += sub;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
if ("any" in when) {
|
|
932
|
+
if (!Array.isArray(when.any)) {
|
|
933
|
+
warnOnce("any", "any \u5FC5\u987B\u662F\u6570\u7EC4");
|
|
934
|
+
return null;
|
|
935
|
+
}
|
|
936
|
+
var best = -1;
|
|
937
|
+
for (var b = 0; b < when.any.length; b++) {
|
|
938
|
+
var branch = specificityOnPath(when.any[b], display);
|
|
939
|
+
if (branch !== null && branch > best) best = branch;
|
|
940
|
+
}
|
|
941
|
+
if (best < 0) return null;
|
|
942
|
+
total += best;
|
|
943
|
+
}
|
|
944
|
+
return total;
|
|
945
|
+
}
|
|
946
|
+
function matchWhen(when, display) {
|
|
947
|
+
return specificityOnPath(when, display) !== null;
|
|
948
|
+
}
|
|
949
|
+
function specificityOf(when, display) {
|
|
950
|
+
var score = specificityOnPath(when, display);
|
|
951
|
+
return score === null ? -1 : score;
|
|
952
|
+
}
|
|
953
|
+
function resolveVariant(view, display) {
|
|
954
|
+
var source = view || {};
|
|
955
|
+
var component = source.component;
|
|
956
|
+
var variants = Array.isArray(source.display) ? source.display : null;
|
|
957
|
+
if (!variants || !variants.length) {
|
|
958
|
+
return { id: "default", component, variant: null, specificity: 0, index: -1, unsupported: false, reason: "no-variants" };
|
|
959
|
+
}
|
|
960
|
+
if (!display) {
|
|
961
|
+
return { id: "default", component, variant: null, specificity: 0, index: -1, unsupported: false, reason: "no-display" };
|
|
962
|
+
}
|
|
963
|
+
var best = null;
|
|
964
|
+
for (var i = 0; i < variants.length; i++) {
|
|
965
|
+
var variant = variants[i];
|
|
966
|
+
if (!isPlainObject(variant)) {
|
|
967
|
+
warnOnce("variant:" + i, "\u53D8\u4F53\u5FC5\u987B\u662F\u5BF9\u8C61\uFF0C\u5DF2\u8DF3\u8FC7\u7B2C " + i + " \u6761");
|
|
968
|
+
continue;
|
|
969
|
+
}
|
|
970
|
+
if (!variant.id) {
|
|
971
|
+
warnOnce("variant-id:" + i, "\u53D8\u4F53\u7F3A\u5C11 id\uFF0C\u5DF2\u8DF3\u8FC7\u7B2C " + i + " \u6761");
|
|
972
|
+
continue;
|
|
973
|
+
}
|
|
974
|
+
if (typeof variant.component !== "function") {
|
|
975
|
+
warnOnce("variant-comp:" + i, "\u53D8\u4F53 " + variant.id + " \u6CA1\u6709 component\uFF0C\u5DF2\u8DF3\u8FC7");
|
|
976
|
+
continue;
|
|
977
|
+
}
|
|
978
|
+
var score = specificityOnPath(variant.when, display);
|
|
979
|
+
if (score === null) continue;
|
|
980
|
+
if (!best || score >= best.specificity) best = { variant, specificity: score, index: i };
|
|
981
|
+
}
|
|
982
|
+
if (!best) {
|
|
983
|
+
return { id: "default", component, variant: null, specificity: 0, index: -1, unsupported: false, reason: "no-match" };
|
|
984
|
+
}
|
|
985
|
+
return {
|
|
986
|
+
id: best.variant.id,
|
|
987
|
+
component: best.variant.component,
|
|
988
|
+
variant: best.variant,
|
|
989
|
+
specificity: best.specificity,
|
|
990
|
+
index: best.index,
|
|
991
|
+
unsupported: Boolean(best.variant.unsupported),
|
|
992
|
+
reason: "matched"
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
function whenText(when) {
|
|
996
|
+
if (when === void 0 || when === null) return "\u515C\u5E95\uFF08\u65E0\u6761\u4EF6\uFF09";
|
|
997
|
+
if (!isPlainObject(when)) return "\u975E\u6CD5\u8C13\u8BCD";
|
|
998
|
+
var parts = [];
|
|
999
|
+
var label = {
|
|
1000
|
+
minWidth: "\u5BBD\u5EA6 \u2265",
|
|
1001
|
+
maxWidth: "\u5BBD\u5EA6 \u2264",
|
|
1002
|
+
minHeight: "\u9AD8\u5EA6 \u2265",
|
|
1003
|
+
maxHeight: "\u9AD8\u5EA6 \u2264",
|
|
1004
|
+
minAspect: "\u5BBD\u9AD8\u6BD4 \u2265",
|
|
1005
|
+
maxAspect: "\u5BBD\u9AD8\u6BD4 \u2264",
|
|
1006
|
+
orientation: "\u65B9\u5411 =",
|
|
1007
|
+
pointer: "\u6307\u9488 =",
|
|
1008
|
+
hover: "\u53EF\u60AC\u505C =",
|
|
1009
|
+
platform: "\u5E73\u53F0 ="
|
|
1010
|
+
};
|
|
1011
|
+
Object.keys(when).forEach(function(key) {
|
|
1012
|
+
if (key === "all" || key === "any") return;
|
|
1013
|
+
var value = when[key];
|
|
1014
|
+
if (Array.isArray(value)) parts.push(label[key] + " " + value.join("/"));
|
|
1015
|
+
else parts.push((label[key] || key) + " " + String(value));
|
|
1016
|
+
});
|
|
1017
|
+
if (Array.isArray(when.all) && when.all.length) parts.push("\u5168\u90E8\u6EE1\u8DB3\uFF08" + when.all.map(whenText).join("\uFF1B") + "\uFF09");
|
|
1018
|
+
if (Array.isArray(when.any) && when.any.length) parts.push("\u4EFB\u4E00\u6EE1\u8DB3\uFF08" + when.any.map(whenText).join("\uFF1B") + "\uFF09");
|
|
1019
|
+
return parts.length ? parts.join(" \u4E14 ") : "\u515C\u5E95\uFF08\u65E0\u6761\u4EF6\uFF09";
|
|
1020
|
+
}
|
|
1021
|
+
function displayCacheKey(display) {
|
|
1022
|
+
if (!display) return "";
|
|
1023
|
+
var w = Math.round(Number(display.width) || 0);
|
|
1024
|
+
var h = Math.round(Number(display.height) || 0);
|
|
1025
|
+
return w + "x" + h + "|" + (display.pointer || "-") + "|" + (display.hover === true ? "hover" : "nohover") + "|" + (display.platform || "-");
|
|
1026
|
+
}
|
|
1027
|
+
function hasVariants(view) {
|
|
1028
|
+
return Boolean(view && Array.isArray(view.display) && view.display.some(function(v) {
|
|
1029
|
+
return v && typeof v.component === "function";
|
|
1030
|
+
}));
|
|
1031
|
+
}
|
|
1032
|
+
function describeFromBox(box, env) {
|
|
1033
|
+
var width = Math.max(0, Math.round(Number(box && box.width || 0)));
|
|
1034
|
+
var height = Math.max(0, Math.round(Number(box && box.height || 0)));
|
|
1035
|
+
var e = env || {};
|
|
1036
|
+
var aspect = height > 0 ? Math.round(width / height * 100) / 100 : 0;
|
|
1037
|
+
var orientation = width > height ? "landscape" : width < height ? "portrait" : "square";
|
|
1038
|
+
return {
|
|
1039
|
+
width,
|
|
1040
|
+
height,
|
|
1041
|
+
aspect,
|
|
1042
|
+
orientation,
|
|
1043
|
+
pointer: e.pointer === "coarse" ? "coarse" : e.pointer === "none" ? "none" : "fine",
|
|
1044
|
+
hover: e.hover === true,
|
|
1045
|
+
platform: typeof e.platform === "string" && e.platform ? e.platform : "web",
|
|
1046
|
+
safe: e.safe && typeof e.safe === "object" ? e.safe : { top: 0, right: 0, bottom: 0, left: 0 }
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
function isCompact(display) {
|
|
1050
|
+
if (!display) return false;
|
|
1051
|
+
return display.pointer === "coarse" || Number(display.width) < 760;
|
|
1052
|
+
}
|
|
1053
|
+
module2.exports = {
|
|
1054
|
+
isCompact,
|
|
1055
|
+
LEAF_KEYS,
|
|
1056
|
+
matchWhen,
|
|
1057
|
+
specificityOf,
|
|
1058
|
+
resolveVariant,
|
|
1059
|
+
whenText,
|
|
1060
|
+
displayCacheKey,
|
|
1061
|
+
hasVariants,
|
|
1062
|
+
describeFromBox
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
});
|
|
1066
|
+
|
|
840
1067
|
// packages/addons/lib/date-picker.cjs
|
|
841
1068
|
var require_date_picker = __commonJS({
|
|
842
1069
|
"packages/addons/lib/date-picker.cjs"(exports2, module2) {
|
|
@@ -1390,8 +1617,8 @@ var require_stats_charts = __commonJS({
|
|
|
1390
1617
|
".@-warn{grid-column:span 12;border:1px dashed var(--dsw-alias-state-warn-primary);border-radius:10px;padding:9px 12px;font-size:12px;color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 6%,transparent)}",
|
|
1391
1618
|
".@-sk{height:14px;border-radius:6px;background:var(--dsw-alias-bg-skeleton);margin:7px 0;animation:@-pulse 1.2s ease-in-out infinite}",
|
|
1392
1619
|
"@keyframes @-pulse{0%,100%{opacity:.55}50%{opacity:1}}",
|
|
1393
|
-
"
|
|
1394
|
-
"
|
|
1620
|
+
":where([data-wb-lt900]) .@-scard{grid-column:span 12}:where([data-wb-lt900]) .@-span-3, :where([data-wb-lt900]) .@-span-4, :where([data-wb-lt900]) .@-span-6, :where([data-wb-lt900]) .@-span-8{grid-column:span 12}:where([data-wb-lt900]) .@-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}",
|
|
1621
|
+
":where([data-wb-lt600]) .@-stats{padding-bottom:16px}:where([data-wb-lt600]) .@-hist{height:130px}:where([data-wb-lt600]) .@-kpi-v{font-size:22px}",
|
|
1395
1622
|
"@media (prefers-reduced-motion:reduce){.@-sk{animation:none}}"
|
|
1396
1623
|
].concat(extra || []).concat([require_date_picker_styles()(prefix)]).join("\n").replace(/@-/g, prefix + "-");
|
|
1397
1624
|
}
|
|
@@ -2061,7 +2288,7 @@ var require_charts = __commonJS({
|
|
|
2061
2288
|
".@-tl-chip{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 8px;border-radius:999px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font-size:11.5px}",
|
|
2062
2289
|
".@-tl-mem-more{color:var(--dsw-alias-label-tertiary);font-size:11.5px}",
|
|
2063
2290
|
".@-tl-mem-hint{color:var(--dsw-alias-label-tertiary)}",
|
|
2064
|
-
"
|
|
2291
|
+
":where([data-wb-lt760]) .@-tl-table{min-width:620px}:where([data-wb-lt760]) .@-tl-name{min-width:170px;max-width:240px}:where([data-wb-lt760]) .@-tl-rate-cell{width:104px}:where([data-wb-lt760]) .@-tl-limit-l{display:none}:where([data-wb-lt760]) .@-tl-act{display:none}:where([data-wb-lt760]) .@-tl-th-act{display:none}",
|
|
2065
2292
|
// 「任务节点」全局范围选择器:按钮 + 可搜索树形浮层,颜色全部来自主题 token。
|
|
2066
2293
|
".@-nsp{position:relative;display:inline-flex}",
|
|
2067
2294
|
".@-nsp-trigger{appearance:none;display:inline-flex;align-items:center;gap:6px;max-width:240px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);border-radius:8px;font:inherit;font-size:12px;padding:5px 9px;cursor:pointer}",
|
|
@@ -2086,7 +2313,7 @@ var require_charts = __commonJS({
|
|
|
2086
2313
|
".@-nsp-check{display:inline-flex;align-items:center;color:var(--dsw-alias-brand-primary);flex:none}",
|
|
2087
2314
|
".@-nsp-empty{padding:10px 8px;color:var(--dsw-alias-label-tertiary);font-size:12px;text-align:center}",
|
|
2088
2315
|
".@-nsp-scope{padding:2px 2px 0;color:var(--dsw-alias-label-tertiary);font-size:11.5px;overflow-wrap:anywhere}",
|
|
2089
|
-
"
|
|
2316
|
+
":where([data-wb-lt760]) .@-nsp-trigger{max-width:170px}:where([data-wb-lt760]) .@-nsp-trigger-value{max-width:96px}:where([data-wb-lt760]) .@-nsp-pop{width:min(84vw,300px)}",
|
|
2090
2317
|
// 难度分布的口径切换:轻量 tablist,视觉上与页首时间范围分段保持一致。
|
|
2091
2318
|
".@-dims{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:0 0 8px}",
|
|
2092
2319
|
".@-dims button{appearance:none;border:1px solid transparent;background:transparent;color:inherit;font:inherit;font-size:11.5px;padding:3px 8px;border-radius:6px;cursor:pointer;opacity:.7;white-space:nowrap}",
|
|
@@ -2094,6 +2321,10 @@ var require_charts = __commonJS({
|
|
|
2094
2321
|
".@-dims button[aria-selected=true]{border-color:var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-skeleton);font-weight:600;opacity:1}",
|
|
2095
2322
|
".@-dims button:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}",
|
|
2096
2323
|
".@-sgrid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:12px}",
|
|
2324
|
+
/* 窄档:12 列栅格收成单列,图表与宽表在卡片内横向滚,不再挤压。 */
|
|
2325
|
+
".wbt-compact .@-sgrid{display:flex;flex-direction:column;gap:12px}",
|
|
2326
|
+
".wbt-compact .@-sgrid>*{grid-column:auto;min-width:0}",
|
|
2327
|
+
".wbt-compact .@-card{overflow-x:auto}",
|
|
2097
2328
|
// 分区容器:把 12 栅格切成「一眼看清 → 结构 → 风险 → 排行 → 明细」几段,
|
|
2098
2329
|
// 每段自己一条标题带,卡片之间仍按 span 排;段与段之间用更大的间距制造阅读停顿。
|
|
2099
2330
|
".@-sect{grid-column:span 12;display:flex;flex-direction:column;gap:8px;min-width:0}",
|
|
@@ -2169,7 +2400,7 @@ var require_charts = __commonJS({
|
|
|
2169
2400
|
".@-dot-off{width:8px;height:8px;border-radius:50%;border:1px solid;flex:0 0 auto}",
|
|
2170
2401
|
".@-table-scroll{max-width:100%;overflow-x:auto}.@-table{width:100%;border-collapse:collapse;font-size:12px}",
|
|
2171
2402
|
// 窄屏按列裁剪:统计页的两张排行/明细表在 390px 只保留主列与关键数值列。
|
|
2172
|
-
"
|
|
2403
|
+
":where([data-wb-lt600]) .@-table .wbt-c-total, :where([data-wb-lt600]) .@-table .wbt-c-open, :where([data-wb-lt600]) .@-table .wbt-c-difficulty, :where([data-wb-lt600]) .@-table .wbt-c-tabletitle{display:none}:where([data-wb-lt600]) .@-table th, :where([data-wb-lt600]) .@-table td{padding-left:6px;padding-right:6px}:where([data-wb-lt600]) .@-table .wbt-table-link{white-space:normal;text-align:left}",
|
|
2173
2404
|
".@-table th{text-align:left;font-weight:500;color:var(--dsw-alias-label-tertiary);padding:6px 8px;border-bottom:1px solid var(--dsw-alias-border-l2);white-space:nowrap}",
|
|
2174
2405
|
".@-table td{padding:7px 8px;border-bottom:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);vertical-align:top}",
|
|
2175
2406
|
".@-table tr:last-child td{border-bottom:0}",
|
|
@@ -2179,8 +2410,10 @@ var require_charts = __commonJS({
|
|
|
2179
2410
|
".@-warnbar{grid-column:span 12;border:1px dashed var(--dsw-alias-state-warn-primary);border-radius:10px;padding:9px 12px;font-size:12px;color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 6%,transparent)}",
|
|
2180
2411
|
".@-sk{height:14px;border-radius:6px;background:var(--dsw-alias-bg-skeleton);margin:7px 0;animation:@-pulse 1.2s ease-in-out infinite}",
|
|
2181
2412
|
"@keyframes @-pulse{0%,100%{opacity:.55}50%{opacity:1}}",
|
|
2182
|
-
|
|
2183
|
-
"
|
|
2413
|
+
/* 卡片跨列与 KPI 排布由窄档声明承担(.wbt-compact),媒体查询只留字号与高度这类像素细节。 */
|
|
2414
|
+
".wbt-compact .@-scard,.wbt-compact .@-span-3,.wbt-compact .@-span-4,.wbt-compact .@-span-6,.wbt-compact .@-span-8{grid-column:auto}",
|
|
2415
|
+
".wbt-compact .@-kpis,.wbt-compact .@-kpis-main,.wbt-compact .@-kpis-sub{grid-template-columns:repeat(2,minmax(0,1fr))}",
|
|
2416
|
+
":where([data-wb-lt600]) .@-stats{padding-bottom:16px;gap:14px}:where([data-wb-lt600]) .@-hist{height:130px}:where([data-wb-lt600]) .@-kpi-v{font-size:22px}:where([data-wb-lt600]) .@-kpi-lg .@-kpi-v{font-size:24px}:where([data-wb-lt600]) .@-kpi-sm .@-kpi-v{font-size:18px}",
|
|
2184
2417
|
"@media (prefers-reduced-motion:reduce){.@-sk{animation:none}}",
|
|
2185
2418
|
require_date_picker_styles()(prefix)
|
|
2186
2419
|
].join("\n").replace(/@-/g, prefix + "-");
|
|
@@ -2562,7 +2795,7 @@ var require_charts = __commonJS({
|
|
|
2562
2795
|
statusColors: STATUS_COLORS
|
|
2563
2796
|
};
|
|
2564
2797
|
}
|
|
2565
|
-
module2.exports = { makeCharts };
|
|
2798
|
+
module2.exports = { makeCharts, stylesFor: css };
|
|
2566
2799
|
}
|
|
2567
2800
|
});
|
|
2568
2801
|
|
|
@@ -5204,6 +5437,7 @@ var require_node_scope_picker = __commonJS({
|
|
|
5204
5437
|
var require_stats = __commonJS({
|
|
5205
5438
|
"packages/addons/tasks/client/views/stats.cjs"(exports2, module2) {
|
|
5206
5439
|
var React = require("react");
|
|
5440
|
+
var DV = require_display_variants();
|
|
5207
5441
|
var h = React.createElement;
|
|
5208
5442
|
var charts = require_charts();
|
|
5209
5443
|
var configClient = require_config_client();
|
|
@@ -5513,6 +5747,7 @@ var require_stats = __commonJS({
|
|
|
5513
5747
|
}
|
|
5514
5748
|
function TasksStatsBody(props) {
|
|
5515
5749
|
var lang = props.lang === "en" ? "en" : "zh";
|
|
5750
|
+
var compactDisplay = props.display;
|
|
5516
5751
|
var t = COPY[lang];
|
|
5517
5752
|
var api = props.api;
|
|
5518
5753
|
var cfg = props.cfg || {};
|
|
@@ -5918,9 +6153,10 @@ var require_stats = __commonJS({
|
|
|
5918
6153
|
}
|
|
5919
6154
|
}
|
|
5920
6155
|
if (data) children.push(h(ch.Warnings, { key: "warn", items: data.warnings || [] }));
|
|
6156
|
+
var compact = DV.isCompact(compactDisplay);
|
|
5921
6157
|
return h(
|
|
5922
6158
|
"div",
|
|
5923
|
-
{ className: "wbt-stats" },
|
|
6159
|
+
{ className: "wbt-stats" + (compact ? " wbt-compact" : ""), "data-wb-layout": compact ? "compact" : "wide" },
|
|
5924
6160
|
h(ch.RangeSwitch, {
|
|
5925
6161
|
options,
|
|
5926
6162
|
value: customFrom || customTo ? null : range,
|
|
@@ -6026,6 +6262,9 @@ var require_copy = __commonJS({
|
|
|
6026
6262
|
search: "\u641C\u7D22\u6807\u9898 / \u63CF\u8FF0 / \u611F\u53D7 / \u4EFB\u52A1 ID",
|
|
6027
6263
|
newTask: "\u65B0\u5EFA\u4EFB\u52A1",
|
|
6028
6264
|
tree: "\u4EFB\u52A1\u6811",
|
|
6265
|
+
filter: "\u7B5B\u9009",
|
|
6266
|
+
selectAll: "\u5168\u9009",
|
|
6267
|
+
detail: "\u4EFB\u52A1\u8BE6\u60C5",
|
|
6029
6268
|
select: "\u9009\u62E9",
|
|
6030
6269
|
cancelSelect: "\u9000\u51FA\u9009\u62E9",
|
|
6031
6270
|
all: "\u5168\u90E8",
|
|
@@ -6136,6 +6375,8 @@ var require_copy = __commonJS({
|
|
|
6136
6375
|
restart: "\u91CD\u542F",
|
|
6137
6376
|
complete: "\u5B8C\u6210",
|
|
6138
6377
|
shutdownOp: "\u5173\u95ED",
|
|
6378
|
+
refreshing: "\u5237\u65B0\u4E2D\u2026",
|
|
6379
|
+
releaseRefresh: "\u677E\u5F00\u5237\u65B0",
|
|
6139
6380
|
selected: "\u5DF2\u9009",
|
|
6140
6381
|
selectedTasks: "\u9009\u4E2D\u4EFB\u52A1",
|
|
6141
6382
|
batchTimeline: "\u5F52\u5E76\u65F6\u95F4\u7EBF",
|
|
@@ -6217,6 +6458,9 @@ var require_copy = __commonJS({
|
|
|
6217
6458
|
search: "Search title / description / feeling / task ID",
|
|
6218
6459
|
newTask: "New task",
|
|
6219
6460
|
tree: "Task tree",
|
|
6461
|
+
filter: "Filter",
|
|
6462
|
+
selectAll: "Select all",
|
|
6463
|
+
detail: "Task details",
|
|
6220
6464
|
select: "Select",
|
|
6221
6465
|
cancelSelect: "Exit select",
|
|
6222
6466
|
all: "All",
|
|
@@ -6327,6 +6571,8 @@ var require_copy = __commonJS({
|
|
|
6327
6571
|
restart: "Restart",
|
|
6328
6572
|
complete: "Complete",
|
|
6329
6573
|
shutdownOp: "Close",
|
|
6574
|
+
refreshing: "Refreshing\u2026",
|
|
6575
|
+
releaseRefresh: "Release to refresh",
|
|
6330
6576
|
selected: "Selected",
|
|
6331
6577
|
selectedTasks: "Selected tasks",
|
|
6332
6578
|
batchTimeline: "Merge timeline",
|
|
@@ -6385,6 +6631,11 @@ var require_overlay = __commonJS({
|
|
|
6385
6631
|
"use strict";
|
|
6386
6632
|
var defaultReact = require("react");
|
|
6387
6633
|
var FOCUSABLE = "button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),a[href]";
|
|
6634
|
+
var SHEET_STYLES = [
|
|
6635
|
+
".wbov-mask.is-sheet{display:block;padding:0;background:var(--wb-card,#141414)}",
|
|
6636
|
+
".wbov-sheet{position:static;inset:auto;width:auto;max-width:none;height:100%;max-height:none;border-radius:0;box-shadow:none;display:flex;flex-direction:column;overflow:hidden;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}",
|
|
6637
|
+
".wbov-sheet>*{max-width:100%}"
|
|
6638
|
+
].join("\n");
|
|
6388
6639
|
module2.exports = function createOverlay(options) {
|
|
6389
6640
|
var opts = options || {};
|
|
6390
6641
|
var React = opts.React || defaultReact;
|
|
@@ -6449,10 +6700,11 @@ var require_overlay = __commonJS({
|
|
|
6449
6700
|
}
|
|
6450
6701
|
}
|
|
6451
6702
|
var labelledBy = ariaLabelledByOf(props);
|
|
6703
|
+
var sheet = props.sheet === true;
|
|
6452
6704
|
return h(
|
|
6453
6705
|
"div",
|
|
6454
6706
|
{
|
|
6455
|
-
className: maskClass,
|
|
6707
|
+
className: maskClass + (sheet ? " is-sheet" : ""),
|
|
6456
6708
|
onMouseDown: function(e) {
|
|
6457
6709
|
var allowed = props.closeOnMask !== void 0 ? props.closeOnMask : closeOnMask(props);
|
|
6458
6710
|
if (e.target === e.currentTarget && props.onClose && allowed) props.onClose();
|
|
@@ -6461,7 +6713,7 @@ var require_overlay = __commonJS({
|
|
|
6461
6713
|
h(
|
|
6462
6714
|
tag,
|
|
6463
6715
|
{
|
|
6464
|
-
className: dialogClass + dialogClassOf(props),
|
|
6716
|
+
className: dialogClass + dialogClassOf(props) + (sheet ? " wbov-sheet" : ""),
|
|
6465
6717
|
role: "dialog",
|
|
6466
6718
|
"aria-modal": true,
|
|
6467
6719
|
"aria-label": labelledBy ? null : ariaLabelOf(props),
|
|
@@ -6477,6 +6729,7 @@ var require_overlay = __commonJS({
|
|
|
6477
6729
|
}
|
|
6478
6730
|
return Modal;
|
|
6479
6731
|
};
|
|
6732
|
+
module2.exports.sheetStyles = SHEET_STYLES;
|
|
6480
6733
|
}
|
|
6481
6734
|
});
|
|
6482
6735
|
|
|
@@ -6486,6 +6739,7 @@ var require_workspace_view = __commonJS({
|
|
|
6486
6739
|
"use strict";
|
|
6487
6740
|
module2.exports = function(deps) {
|
|
6488
6741
|
var React = deps.React, h = React.createElement;
|
|
6742
|
+
var DV = require_display_variants();
|
|
6489
6743
|
var createOverlay = deps.createOverlay;
|
|
6490
6744
|
var FormOverlay = createOverlay({
|
|
6491
6745
|
React,
|
|
@@ -6593,6 +6847,10 @@ var require_workspace_view = __commonJS({
|
|
|
6593
6847
|
}
|
|
6594
6848
|
};
|
|
6595
6849
|
var CSS = [
|
|
6850
|
+
/* 窄档:卡片单列铺满,操作按钮整行靠右,长标题换行不截断。 */
|
|
6851
|
+
".wbt-compact .wbt-ws-row{flex-direction:column;align-items:stretch;gap:10px}",
|
|
6852
|
+
".wbt-compact .wbt-ws-titleline{flex-wrap:wrap}",
|
|
6853
|
+
".wbt-compact .wbt-ws-ops{justify-content:flex-end;width:100%;flex-wrap:wrap}",
|
|
6596
6854
|
".wbt-ws-heading{display:flex;flex-direction:column;gap:2px;min-width:0}",
|
|
6597
6855
|
".wbt-ws-h2{margin:0;font-size:17px;line-height:1.3;font-weight:600}",
|
|
6598
6856
|
".wbt-ws-hint{font-size:12px;line-height:1.4;color:var(--dsw-alias-label-secondary,inherit);overflow-wrap:anywhere}",
|
|
@@ -6693,6 +6951,7 @@ var require_workspace_view = __commonJS({
|
|
|
6693
6951
|
}
|
|
6694
6952
|
function WorkspaceView(props) {
|
|
6695
6953
|
var lang = props.lang === "en" ? "en" : "zh", t = COPY[lang];
|
|
6954
|
+
var compact = DV.isCompact(props.display);
|
|
6696
6955
|
var api = props.api;
|
|
6697
6956
|
var listS = React.useState(null), records = listS[0], setRecords = listS[1];
|
|
6698
6957
|
var busyS = React.useState(true), busy = busyS[0], setBusy = busyS[1];
|
|
@@ -6839,7 +7098,7 @@ var require_workspace_view = __commonJS({
|
|
|
6839
7098
|
else body = shown.map(row);
|
|
6840
7099
|
return h(
|
|
6841
7100
|
"div",
|
|
6842
|
-
{ className: "wbt-root wbt-ws" },
|
|
7101
|
+
{ className: "wbt-root wbt-ws" + (compact ? " wbt-compact" : ""), "data-wb-layout": compact ? "compact" : "wide" },
|
|
6843
7102
|
h("style", null, CSS),
|
|
6844
7103
|
h(
|
|
6845
7104
|
"div",
|
|
@@ -7189,10 +7448,32 @@ var require_description = __commonJS({
|
|
|
7189
7448
|
}
|
|
7190
7449
|
});
|
|
7191
7450
|
|
|
7451
|
+
// packages/addons/lib/density-tokens.cjs
|
|
7452
|
+
var require_density_tokens = __commonJS({
|
|
7453
|
+
"packages/addons/lib/density-tokens.cjs"(exports2, module2) {
|
|
7454
|
+
"use strict";
|
|
7455
|
+
var CSS = [
|
|
7456
|
+
// 基础尺寸:全仓唯一允许出现控件高度像素的地方。
|
|
7457
|
+
":root{--wb-ctl-h-xs:22px;--wb-ctl-h-sm:26px;--wb-ctl-h-md:32px;--wb-ctl-h-lg:40px;--wb-ctl-h-xl:46px;--wb-ctl-px-xs:6px;--wb-ctl-px-sm:10px;--wb-ctl-px-md:14px;--wb-ctl-px-lg:18px;--wb-ctl-font-sm:11px;--wb-ctl-font-md:12px;--wb-ctl-font-lg:13px}",
|
|
7458
|
+
// 缺省密度 = comfortable:没有 [data-wb-density] 时(独立预览页、老宿主)也有一组合法映射。
|
|
7459
|
+
':root,[data-wb-density="comfortable"]{--wb-btn-primary:var(--wb-ctl-h-lg);--wb-btn-toolbar:var(--wb-ctl-h-md);--wb-btn-row:var(--wb-ctl-h-sm);--wb-btn-icon:var(--wb-ctl-h-md);--wb-field-h:var(--wb-ctl-h-md);--wb-gap-block:14px;--wb-font-body:var(--wb-ctl-font-md)}',
|
|
7460
|
+
// 桌面大屏:更紧的间距,控件高度下降一档。
|
|
7461
|
+
'[data-wb-density="compact"]{--wb-btn-primary:var(--wb-ctl-h-md);--wb-btn-toolbar:var(--wb-ctl-h-sm);--wb-btn-row:var(--wb-ctl-h-xs);--wb-btn-icon:var(--wb-ctl-h-sm);--wb-field-h:var(--wb-ctl-h-sm);--wb-gap-block:10px;--wb-font-body:var(--wb-ctl-font-md)}',
|
|
7462
|
+
// 显式声明的宽松档:只放大尺寸与间距,不引入第三套结构。
|
|
7463
|
+
'[data-wb-density="spacious"]{--wb-btn-primary:var(--wb-ctl-h-xl);--wb-btn-toolbar:var(--wb-ctl-h-lg);--wb-btn-row:var(--wb-ctl-h-md);--wb-btn-icon:var(--wb-ctl-h-lg);--wb-field-h:var(--wb-ctl-h-lg);--wb-gap-block:18px;--wb-font-body:var(--wb-ctl-font-lg)}',
|
|
7464
|
+
// 触控底线:粗指针设备上把按钮撑到 32px,宽档(fine pointer)像素不变。
|
|
7465
|
+
'[data-wb-pointer="coarse"] :is(button,[role="button"],input[type="button"],input[type="submit"],select){min-height:var(--wb-ctl-h-md);min-width:var(--wb-ctl-h-sm)}',
|
|
7466
|
+
// 触控端表单控件同样不能低于 32px,否则点按会漏。
|
|
7467
|
+
'[data-wb-pointer="coarse"] :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select){min-height:var(--wb-ctl-h-md)}'
|
|
7468
|
+
].join("\n");
|
|
7469
|
+
module2.exports = CSS;
|
|
7470
|
+
}
|
|
7471
|
+
});
|
|
7472
|
+
|
|
7192
7473
|
// packages/addons/lib/visual-tokens.cjs
|
|
7193
7474
|
var require_visual_tokens = __commonJS({
|
|
7194
7475
|
"packages/addons/lib/visual-tokens.cjs"(exports2, module2) {
|
|
7195
|
-
module2.exports = `
|
|
7476
|
+
module2.exports = require_density_tokens() + `
|
|
7196
7477
|
:where(.wbt-root,.wbi-root,.wbi-cfg,.wbt-data,.wbs-data,.wbg-data,.wbi-data,.wb-desc){--wb-radius-sm:8px;--wb-radius-card:12px;--wb-space-sm:8px;--wb-space-md:14px;--wb-border:var(--dsw-alias-border-l2,color-mix(in oklab,currentColor 16%,transparent));--wb-description-bg:color-mix(in oklab,var(--dsw-alias-brand-primary,#5b7fd6) 7%,transparent);--wb-description-line:color-mix(in oklab,var(--dsw-alias-brand-primary,#5b7fd6) 34%,transparent);--wb-motion:140ms;--wb-btn-bg:transparent;--wb-btn-hover-bg:color-mix(in oklab,currentColor 6%,transparent);--wb-btn-active-bg:color-mix(in oklab,currentColor 11%,transparent);--wb-btn-primary-bg:var(--dsw-alias-brand-primary,#2563eb);--wb-btn-primary-fg:var(--dsw-alias-label-primary-inverted,#fff);--wb-btn-danger-fg:var(--dsw-alias-state-error-primary,#b91c1c);--wb-btn-size-sm:32px;--wb-btn-focus:2px solid var(--dsw-alias-brand-primary,#2563eb);--wb-btn-focus-offset:2px}
|
|
7197
7478
|
.wb-desc{background:var(--wb-description-bg);border-left-color:var(--wb-description-line);border-radius:0 var(--wb-radius-sm) var(--wb-radius-sm) 0}
|
|
7198
7479
|
`;
|
|
@@ -7235,7 +7516,7 @@ var require_filter_checklist_styles = __commonJS({
|
|
|
7235
7516
|
".wbck-meta{margin-left:auto;flex:none;font-size:11.5px;color:var(--wb-muted)}",
|
|
7236
7517
|
".wbck-note{font-size:12px;color:var(--wb-muted);padding:8px 6px}",
|
|
7237
7518
|
".wbck-more{font-size:11px;color:var(--wb-muted);text-align:center;padding:6px 0 2px;opacity:.8}",
|
|
7238
|
-
"
|
|
7519
|
+
":where([data-wb-lt760]) .wbck-list{max-height:200px}"
|
|
7239
7520
|
];
|
|
7240
7521
|
}
|
|
7241
7522
|
});
|
|
@@ -7518,9 +7799,9 @@ var require_number_field = __commonJS({
|
|
|
7518
7799
|
".wbctl-num-box{display:inline-flex;align-items:center;gap:6px;min-width:0}",
|
|
7519
7800
|
".wbctl-num-input{box-sizing:border-box;width:96px;min-width:0;padding:6px 9px;border:1px solid var(--wb-line,rgba(127,127,127,.35));border-radius:6px;background:var(--wb-surface,var(--wb-card,transparent));color:inherit;font:inherit;font-size:13px;font-variant-numeric:tabular-nums;transition:border-color .14s ease,outline-color .14s ease}",
|
|
7520
7801
|
".wbctl-num-input:hover:not(:disabled){border-color:var(--wb-border,var(--wb-line))}",
|
|
7521
|
-
".wbctl-num-input:focus{outline:2px solid color-mix(in oklab,var(--wb-accent) 55%,transparent);outline-offset:1px;border-color:var(--wb-accent)}",
|
|
7802
|
+
".wbctl-num-input:focus-visible{outline:2px solid color-mix(in oklab,var(--wb-accent) 55%,transparent);outline-offset:1px;border-color:var(--wb-accent)}",
|
|
7522
7803
|
".wbctl-num-input.is-invalid{border-color:var(--wb-danger)}",
|
|
7523
|
-
".wbctl-num-input.is-invalid:focus{outline-color:color-mix(in oklab,var(--wb-danger) 55%,transparent)}",
|
|
7804
|
+
".wbctl-num-input.is-invalid:focus-visible{outline-color:color-mix(in oklab,var(--wb-danger) 55%,transparent)}",
|
|
7524
7805
|
".wbctl-num-input:disabled{opacity:.5;cursor:not-allowed}",
|
|
7525
7806
|
".wbctl-num-unit{color:var(--wb-muted,inherit);font-size:12px;white-space:nowrap}",
|
|
7526
7807
|
".wbctl-num-hint{color:var(--wb-muted,inherit);font-size:11px;line-height:1.4}",
|
|
@@ -7614,8 +7895,8 @@ var require_stepper = __commonJS({
|
|
|
7614
7895
|
".wbctl-step-hint{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:400;opacity:.62}",
|
|
7615
7896
|
".wbctl-step-opt{flex:none;font-size:10px;font-weight:400;opacity:.55}",
|
|
7616
7897
|
// 窄屏先藏提示,标题仍占满整行;再窄就把标题折行,宁可变高也不截字。
|
|
7617
|
-
"
|
|
7618
|
-
"
|
|
7898
|
+
":where([data-wb-lt760]) .wbctl-step-list{flex-wrap:wrap}:where([data-wb-lt760]) .wbctl-step{padding:6px 7px;font-size:11.5px}:where([data-wb-lt760]) .wbctl-step-hint, :where([data-wb-lt760]) .wbctl-step-opt{display:none}:where([data-wb-lt760]) .wbctl-step-index{width:18px;height:18px;font-size:10px}",
|
|
7899
|
+
":where([data-wb-lt520]) .wbctl-step-list{gap:4px}:where([data-wb-lt520]) .wbctl-step-label{white-space:normal;overflow-wrap:anywhere}:where([data-wb-lt520]) .wbctl-step{gap:5px}",
|
|
7619
7900
|
"@media (prefers-reduced-motion:reduce){.wbctl-step{transition:none}}"
|
|
7620
7901
|
];
|
|
7621
7902
|
module2.exports = { Steps, stepState, styles: STYLES };
|
|
@@ -7893,7 +8174,7 @@ var require_staged_dialog = __commonJS({
|
|
|
7893
8174
|
".wbctl-btn:focus-visible{outline:2px solid var(--wb-accent,#2563eb);outline-offset:2px}",
|
|
7894
8175
|
".wbctl-btn:disabled{opacity:.55;cursor:default}",
|
|
7895
8176
|
".wbctl-btn.wbctl-btn-p{background:var(--wb-accent,#2563eb);border-color:transparent;color:var(--wb-on-accent,#fff)}",
|
|
7896
|
-
".wbctl-btn.wbctl-btn-p:hover:not(:disabled){background:color-mix(in oklab,var(--wb-accent,#2563eb)
|
|
8177
|
+
".wbctl-btn.wbctl-btn-p:hover:not(:disabled){background:color-mix(in oklab,var(--wb-accent,#2563eb) 88%,transparent)}",
|
|
7897
8178
|
// 确认步:键值对清单,各插件共用,避免再各写一套只读摘要。
|
|
7898
8179
|
".wbctl-review{display:flex;flex-direction:column;border:1px solid var(--wb-line,var(--wb-border));border-radius:10px;overflow:hidden}",
|
|
7899
8180
|
".wbctl-review-row{display:grid;grid-template-columns:96px minmax(0,1fr);gap:10px;padding:8px 12px;font-size:12.5px;background:var(--wb-surface,transparent)}",
|
|
@@ -7904,7 +8185,7 @@ var require_staged_dialog = __commonJS({
|
|
|
7904
8185
|
// 两列字段布局:内容多的弹窗不再单列拉长,窄屏回落单列。
|
|
7905
8186
|
".wbctl-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}",
|
|
7906
8187
|
".wbctl-form>.full{grid-column:1/-1}",
|
|
7907
|
-
"
|
|
8188
|
+
":where([data-wb-lt760]) .wbctl-dialog{width:calc(100vw - 16px);max-height:94vh}:where([data-wb-lt760]) .wbctl-form{grid-template-columns:1fr}:where([data-wb-lt760]) .wbctl-form>.full{grid-column:auto}",
|
|
7908
8189
|
"@media (prefers-reduced-motion:reduce){.wbctl-btn{transition:none}}"
|
|
7909
8190
|
];
|
|
7910
8191
|
module2.exports = {
|
|
@@ -7942,6 +8223,978 @@ var require_disclosure_styles = __commonJS({
|
|
|
7942
8223
|
}
|
|
7943
8224
|
});
|
|
7944
8225
|
|
|
8226
|
+
// packages/addons/lib/gestures.cjs
|
|
8227
|
+
var require_gestures = __commonJS({
|
|
8228
|
+
"packages/addons/lib/gestures.cjs"(exports2, module2) {
|
|
8229
|
+
"use strict";
|
|
8230
|
+
var LONG_PRESS_MS = 500;
|
|
8231
|
+
var LONG_PRESS_TOLERANCE = 10;
|
|
8232
|
+
var PULL_THRESHOLD = 60;
|
|
8233
|
+
var PULL_MAX = 120;
|
|
8234
|
+
var PULL_RESISTANCE = 0.55;
|
|
8235
|
+
var SWIPE_BACK_DISTANCE = 80;
|
|
8236
|
+
var SWIPE_BACK_VELOCITY = 0.5;
|
|
8237
|
+
var SWIPE_BACK_EDGE = 48;
|
|
8238
|
+
function longPressDecision(input) {
|
|
8239
|
+
var elapsed = Number(input && input.elapsed) || 0;
|
|
8240
|
+
var moved = Number(input && input.moved) || 0;
|
|
8241
|
+
var ms = Number(input && input.ms) > 0 ? Number(input.ms) : LONG_PRESS_MS;
|
|
8242
|
+
var tolerance = Number(input && input.tolerance) > 0 ? Number(input.tolerance) : LONG_PRESS_TOLERANCE;
|
|
8243
|
+
return elapsed >= ms && moved <= tolerance;
|
|
8244
|
+
}
|
|
8245
|
+
function pullDecision(input) {
|
|
8246
|
+
var dy = Number(input && input.dy) || 0;
|
|
8247
|
+
var atTop = !(input && input.atTop === false);
|
|
8248
|
+
var threshold = Number(input && input.threshold) > 0 ? Number(input.threshold) : PULL_THRESHOLD;
|
|
8249
|
+
var max = Number(input && input.max) > 0 ? Number(input.max) : PULL_MAX;
|
|
8250
|
+
if (!atTop || dy <= 0) return { distance: 0, trigger: false };
|
|
8251
|
+
var distance = Math.min(max, Math.round(dy * PULL_RESISTANCE));
|
|
8252
|
+
return { distance, trigger: distance >= threshold };
|
|
8253
|
+
}
|
|
8254
|
+
function swipeBackDecision(input) {
|
|
8255
|
+
var dx = Number(input && input.dx) || 0;
|
|
8256
|
+
var dy = Number(input && input.dy) || 0;
|
|
8257
|
+
var velocity = Number(input && input.velocity) || 0;
|
|
8258
|
+
var distance = Number(input && input.distance) > 0 ? Number(input.distance) : SWIPE_BACK_DISTANCE;
|
|
8259
|
+
var minVelocity = Number(input && input.velocityThreshold) > 0 ? Number(input.velocityThreshold) : SWIPE_BACK_VELOCITY;
|
|
8260
|
+
if (dx <= 0) return false;
|
|
8261
|
+
if (Math.abs(dy) > dx) return false;
|
|
8262
|
+
return dx >= distance || velocity >= minVelocity;
|
|
8263
|
+
}
|
|
8264
|
+
function followOffset(dx, width) {
|
|
8265
|
+
var limit = Math.max(80, (Number(width) || 360) / 3);
|
|
8266
|
+
return Math.max(0, Math.min(limit, Math.round(Number(dx) || 0)));
|
|
8267
|
+
}
|
|
8268
|
+
function useLongPress(React, options) {
|
|
8269
|
+
var opts = options || {};
|
|
8270
|
+
var ref = React.useRef ? React.useRef(null) : { current: null };
|
|
8271
|
+
var firedRef = React.useRef ? React.useRef(false) : { current: false };
|
|
8272
|
+
var state = React.useState(false);
|
|
8273
|
+
var pressing = state[0], setPressing = state[1];
|
|
8274
|
+
function clear() {
|
|
8275
|
+
var st = ref.current;
|
|
8276
|
+
if (st && st.timer) {
|
|
8277
|
+
clearTimeout(st.timer);
|
|
8278
|
+
st.timer = null;
|
|
8279
|
+
}
|
|
8280
|
+
ref.current = null;
|
|
8281
|
+
if (pressing) setPressing(false);
|
|
8282
|
+
}
|
|
8283
|
+
React.useEffect(function() {
|
|
8284
|
+
return clear;
|
|
8285
|
+
}, []);
|
|
8286
|
+
function onPointerDown(event) {
|
|
8287
|
+
if (opts.disabled) return;
|
|
8288
|
+
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
8289
|
+
firedRef.current = false;
|
|
8290
|
+
var timer = setTimeout(function() {
|
|
8291
|
+
var st = ref.current;
|
|
8292
|
+
if (!st) return;
|
|
8293
|
+
firedRef.current = true;
|
|
8294
|
+
setPressing(true);
|
|
8295
|
+
st.timer = null;
|
|
8296
|
+
if (typeof opts.onLongPress === "function") opts.onLongPress({ clientX: st.x, clientY: st.y, target: st.target });
|
|
8297
|
+
}, Number(opts.ms) > 0 ? Number(opts.ms) : LONG_PRESS_MS);
|
|
8298
|
+
ref.current = { x: event.clientX, y: event.clientY, target: event.currentTarget, timer };
|
|
8299
|
+
}
|
|
8300
|
+
function onPointerMove(event) {
|
|
8301
|
+
var st = ref.current;
|
|
8302
|
+
if (!st) return;
|
|
8303
|
+
var moved = Math.abs(event.clientX - st.x) + Math.abs(event.clientY - st.y);
|
|
8304
|
+
var tolerance = Number(opts.tolerance) > 0 ? Number(opts.tolerance) : LONG_PRESS_TOLERANCE;
|
|
8305
|
+
if (moved <= tolerance) return;
|
|
8306
|
+
if (st.timer) clearTimeout(st.timer);
|
|
8307
|
+
ref.current = null;
|
|
8308
|
+
}
|
|
8309
|
+
function onPointerUp() {
|
|
8310
|
+
clear();
|
|
8311
|
+
}
|
|
8312
|
+
function onPointerCancel() {
|
|
8313
|
+
clear();
|
|
8314
|
+
}
|
|
8315
|
+
return {
|
|
8316
|
+
pressing,
|
|
8317
|
+
/** 取一次「刚刚发生过长按」并复位:用于在 onClick 里吞掉长按之后紧跟的点击。 */
|
|
8318
|
+
consume: function() {
|
|
8319
|
+
var fired = firedRef.current;
|
|
8320
|
+
firedRef.current = false;
|
|
8321
|
+
return fired;
|
|
8322
|
+
},
|
|
8323
|
+
handlers: {
|
|
8324
|
+
onPointerDown,
|
|
8325
|
+
onPointerMove,
|
|
8326
|
+
onPointerUp,
|
|
8327
|
+
onPointerCancel,
|
|
8328
|
+
onPointerLeave: onPointerUp
|
|
8329
|
+
}
|
|
8330
|
+
};
|
|
8331
|
+
}
|
|
8332
|
+
function usePullToRefresh(React, options) {
|
|
8333
|
+
var opts = options || {};
|
|
8334
|
+
var startRef = React.useRef ? React.useRef(null) : { current: null };
|
|
8335
|
+
var pullState = React.useState(0);
|
|
8336
|
+
var pull = pullState[0], setPull = pullState[1];
|
|
8337
|
+
var refreshState = React.useState(false);
|
|
8338
|
+
var refreshing = refreshState[0], setRefreshing = refreshState[1];
|
|
8339
|
+
function containerOf(event) {
|
|
8340
|
+
return opts.containerRef && opts.containerRef.current || event.currentTarget;
|
|
8341
|
+
}
|
|
8342
|
+
function onPointerDown(event) {
|
|
8343
|
+
if (opts.disabled || refreshing) return;
|
|
8344
|
+
var node = containerOf(event);
|
|
8345
|
+
var atTop = !node || node.scrollTop <= 0;
|
|
8346
|
+
startRef.current = { y: event.clientY, x: event.clientX, atTop };
|
|
8347
|
+
}
|
|
8348
|
+
function onPointerMove(event) {
|
|
8349
|
+
var st = startRef.current;
|
|
8350
|
+
if (!st) return;
|
|
8351
|
+
var dy = event.clientY - st.y;
|
|
8352
|
+
var dx = event.clientX - st.x;
|
|
8353
|
+
if (Math.abs(dx) > Math.abs(dy)) {
|
|
8354
|
+
startRef.current = null;
|
|
8355
|
+
setPull(0);
|
|
8356
|
+
return;
|
|
8357
|
+
}
|
|
8358
|
+
var verdict = pullDecision({ dy, atTop: st.atTop, threshold: opts.threshold, max: opts.max });
|
|
8359
|
+
setPull(verdict.distance);
|
|
8360
|
+
st.trigger = verdict.trigger;
|
|
8361
|
+
}
|
|
8362
|
+
function onPointerUp() {
|
|
8363
|
+
var st = startRef.current;
|
|
8364
|
+
startRef.current = null;
|
|
8365
|
+
if (!st || !st.trigger) {
|
|
8366
|
+
setPull(0);
|
|
8367
|
+
return;
|
|
8368
|
+
}
|
|
8369
|
+
setRefreshing(true);
|
|
8370
|
+
setPull(Number(opts.threshold) > 0 ? Number(opts.threshold) : PULL_THRESHOLD);
|
|
8371
|
+
var result = null;
|
|
8372
|
+
try {
|
|
8373
|
+
result = typeof opts.onRefresh === "function" ? opts.onRefresh() : null;
|
|
8374
|
+
} catch (error) {
|
|
8375
|
+
if (typeof console !== "undefined") console.error("[gestures] \u4E0B\u62C9\u5237\u65B0\u56DE\u8C03\u629B\u9519", error);
|
|
8376
|
+
}
|
|
8377
|
+
var done = function() {
|
|
8378
|
+
setRefreshing(false);
|
|
8379
|
+
setPull(0);
|
|
8380
|
+
};
|
|
8381
|
+
if (result && typeof result.then === "function") result.then(done, done);
|
|
8382
|
+
else done();
|
|
8383
|
+
}
|
|
8384
|
+
return {
|
|
8385
|
+
pull,
|
|
8386
|
+
refreshing,
|
|
8387
|
+
handlers: {
|
|
8388
|
+
onPointerDown,
|
|
8389
|
+
onPointerMove,
|
|
8390
|
+
onPointerUp,
|
|
8391
|
+
onPointerCancel: onPointerUp
|
|
8392
|
+
}
|
|
8393
|
+
};
|
|
8394
|
+
}
|
|
8395
|
+
function useEdgeSwipeBack(React, options) {
|
|
8396
|
+
var opts = options || {};
|
|
8397
|
+
var enabled = opts.enabled !== false;
|
|
8398
|
+
var startRef = React.useRef ? React.useRef(null) : { current: null };
|
|
8399
|
+
var offsetState = React.useState(0);
|
|
8400
|
+
var offset = offsetState[0], setOffset = offsetState[1];
|
|
8401
|
+
function onPointerDown(event) {
|
|
8402
|
+
if (!enabled) return;
|
|
8403
|
+
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
8404
|
+
var rect = event.currentTarget && typeof event.currentTarget.getBoundingClientRect === "function" ? event.currentTarget.getBoundingClientRect() : { left: 0, width: 360 };
|
|
8405
|
+
var edge = Number(opts.edge) > 0 ? Number(opts.edge) : SWIPE_BACK_EDGE;
|
|
8406
|
+
if (event.clientX - rect.left > edge) return;
|
|
8407
|
+
startRef.current = { x: event.clientX, y: event.clientY, lastX: event.clientX, lastAt: Date.now(), width: rect.width, velocity: 0 };
|
|
8408
|
+
}
|
|
8409
|
+
function onPointerMove(event) {
|
|
8410
|
+
var st = startRef.current;
|
|
8411
|
+
if (!st) return;
|
|
8412
|
+
var now = Date.now();
|
|
8413
|
+
var dt = now - st.lastAt;
|
|
8414
|
+
if (dt > 0) st.velocity = (event.clientX - st.lastX) / dt;
|
|
8415
|
+
st.lastX = event.clientX;
|
|
8416
|
+
st.lastAt = now;
|
|
8417
|
+
var dx = event.clientX - st.x;
|
|
8418
|
+
if (dx <= 0) {
|
|
8419
|
+
setOffset(0);
|
|
8420
|
+
return;
|
|
8421
|
+
}
|
|
8422
|
+
setOffset(followOffset(dx, st.width));
|
|
8423
|
+
}
|
|
8424
|
+
function onPointerUp(event) {
|
|
8425
|
+
var st = startRef.current;
|
|
8426
|
+
startRef.current = null;
|
|
8427
|
+
if (!st) return;
|
|
8428
|
+
var dx = event && typeof event.clientX === "number" ? event.clientX - st.x : 0;
|
|
8429
|
+
var dy = event && typeof event.clientY === "number" ? event.clientY - st.y : 0;
|
|
8430
|
+
var verdict = swipeBackDecision({ dx, dy, velocity: st.velocity, distance: opts.distance, velocityThreshold: opts.velocityThreshold });
|
|
8431
|
+
setOffset(0);
|
|
8432
|
+
if (verdict && typeof opts.onBack === "function") opts.onBack();
|
|
8433
|
+
}
|
|
8434
|
+
return {
|
|
8435
|
+
offset,
|
|
8436
|
+
handlers: enabled ? { onPointerDown, onPointerMove, onPointerUp, onPointerCancel: function() {
|
|
8437
|
+
startRef.current = null;
|
|
8438
|
+
setOffset(0);
|
|
8439
|
+
} } : {}
|
|
8440
|
+
};
|
|
8441
|
+
}
|
|
8442
|
+
module2.exports = {
|
|
8443
|
+
LONG_PRESS_MS,
|
|
8444
|
+
LONG_PRESS_TOLERANCE,
|
|
8445
|
+
PULL_THRESHOLD,
|
|
8446
|
+
PULL_MAX,
|
|
8447
|
+
SWIPE_BACK_DISTANCE,
|
|
8448
|
+
SWIPE_BACK_EDGE,
|
|
8449
|
+
longPressDecision,
|
|
8450
|
+
pullDecision,
|
|
8451
|
+
swipeBackDecision,
|
|
8452
|
+
followOffset,
|
|
8453
|
+
useLongPress,
|
|
8454
|
+
usePullToRefresh,
|
|
8455
|
+
useEdgeSwipeBack
|
|
8456
|
+
};
|
|
8457
|
+
}
|
|
8458
|
+
});
|
|
8459
|
+
|
|
8460
|
+
// packages/addons/lib/panel-host.cjs
|
|
8461
|
+
var require_panel_host = __commonJS({
|
|
8462
|
+
"packages/addons/lib/panel-host.cjs"(exports2, module2) {
|
|
8463
|
+
"use strict";
|
|
8464
|
+
var gestures = require_gestures();
|
|
8465
|
+
var STYLES = [
|
|
8466
|
+
// 基础层必须自己撑满视图并成为纵向 flex 容器:宿主用 display:contents 包了一层,
|
|
8467
|
+
// 若这里不给约束,子视图的 flex:1 + min-height:0 就失效,长列表会把整页撑高,
|
|
8468
|
+
// 固定底条被推到内容末尾(窄屏表现为「底部按钮要滚到底才看得到」)。
|
|
8469
|
+
".wbpanel-base{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}",
|
|
8470
|
+
".wbpanel-base[hidden]{display:none}",
|
|
8471
|
+
// 面板层要盖住「宿主视图」而不是「整个窗口」:工作台可能被 DSH 嵌在侧栏或分屏里,
|
|
8472
|
+
// 用 fixed inset:0 会横跨整个窗口,窄屏一侧露着别的内容。位置由 JS 按宿主视图盒量出,
|
|
8473
|
+
// 这里的默认值只用于没量到盒子时的兜底。
|
|
8474
|
+
".wbpanel{position:fixed;left:0;top:0;width:100%;height:100%;z-index:900;display:flex}",
|
|
8475
|
+
".wbpanel[data-kind=bottom]{align-items:flex-end}",
|
|
8476
|
+
".wbpanel[data-kind=right]{align-items:stretch;justify-content:flex-end}",
|
|
8477
|
+
".wbpanel[data-kind=full]{align-items:stretch}",
|
|
8478
|
+
".wbpanel[data-kind=dialog]{align-items:center;justify-content:center;padding:16px}",
|
|
8479
|
+
".wbpanel-mask{position:absolute;inset:0;background:color-mix(in oklab,var(--wb-text,currentColor) 42%,transparent);border:0;padding:0;margin:0;cursor:default}",
|
|
8480
|
+
".wbpanel-body{position:relative;display:flex;flex-direction:column;min-height:0;background:var(--wb-card);color:var(--wb-text);box-shadow:0 -8px 28px color-mix(in oklab,var(--wb-text,currentColor) 18%,transparent)}",
|
|
8481
|
+
// 底部 sheet 默认占 62%:既露出后面列表的位置感,又够放下搜索与几层树。
|
|
8482
|
+
// 高度百分比相对「面板层」而不是视口,因为面板层本身已经是宿主视图盒。
|
|
8483
|
+
".wbpanel[data-kind=bottom] .wbpanel-body{width:100%;height:var(--wbpanel-h,62%);max-height:92%;border-radius:14px 14px 0 0;padding-bottom:var(--wb-safe-bottom,0px);transition:height .16s ease-out}",
|
|
8484
|
+
".wbpanel[data-kind=bottom][data-resizing] .wbpanel-body{transition:none}",
|
|
8485
|
+
// 拖拽把手:36×4 的横条,命中区放大到 22px 高,手指才好抓。
|
|
8486
|
+
".wbpanel-grab{flex:none;display:flex;align-items:center;justify-content:center;height:22px;cursor:grab;touch-action:none;background:transparent;border:0;padding:0}",
|
|
8487
|
+
'.wbpanel-grab::before{content:"";width:36px;height:4px;border-radius:2px;background:var(--wb-line)}',
|
|
8488
|
+
".wbpanel-grab:active{cursor:grabbing}",
|
|
8489
|
+
"@media (prefers-reduced-motion: reduce){.wbpanel[data-kind=bottom] .wbpanel-body{transition:none}}",
|
|
8490
|
+
".wbpanel[data-kind=right] .wbpanel-body{width:min(420px,92vw);height:100%;border-left:1px solid var(--wb-line)}",
|
|
8491
|
+
".wbpanel[data-kind=full] .wbpanel-body{width:100%;height:100%}",
|
|
8492
|
+
".wbpanel[data-kind=dialog] .wbpanel-body{width:min(520px,100%);max-height:86dvh;border-radius:12px;border:1px solid var(--wb-line)}",
|
|
8493
|
+
".wbpanel-head{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--wb-line);flex:none}",
|
|
8494
|
+
".wbpanel-title{flex:1;min-width:0;font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
8495
|
+
".wbpanel-close{flex:none;width:32px;height:32px;border-radius:8px;border:0;background:transparent;color:var(--wb-muted);cursor:pointer;font:inherit;font-size:18px;line-height:1}",
|
|
8496
|
+
".wbpanel-close:hover,.wbpanel-close:focus-visible{background:var(--wb-surface);color:var(--wb-text);outline:0}",
|
|
8497
|
+
".wbpanel-content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}",
|
|
8498
|
+
// 右滑返回:跟手位移直接写在 transform 上(不走 React 状态),松手后按过渡回位。
|
|
8499
|
+
".wbpanel-body{transition:transform .16s ease-out}",
|
|
8500
|
+
".wbpanel-body[data-swiping=1]{transition:none}",
|
|
8501
|
+
"@media (prefers-reduced-motion: no-preference){.wbpanel-body{animation:wbpanel-in .16s ease-out}@keyframes wbpanel-in{from{transform:translateY(8px);opacity:.6}to{transform:none;opacity:1}}}"
|
|
8502
|
+
].join("\n");
|
|
8503
|
+
function createStore(initial) {
|
|
8504
|
+
var panels = Array.isArray(initial) ? initial.slice() : [];
|
|
8505
|
+
var listeners = [];
|
|
8506
|
+
var seq = 0;
|
|
8507
|
+
function snapshot() {
|
|
8508
|
+
return panels;
|
|
8509
|
+
}
|
|
8510
|
+
function emit() {
|
|
8511
|
+
var list = listeners.slice();
|
|
8512
|
+
for (var i = 0; i < list.length; i += 1) {
|
|
8513
|
+
try {
|
|
8514
|
+
list[i](panels);
|
|
8515
|
+
} catch (error) {
|
|
8516
|
+
if (typeof console !== "undefined") console.error("[panel-stack] \u8BA2\u9605\u8005\u629B\u9519", error);
|
|
8517
|
+
}
|
|
8518
|
+
}
|
|
8519
|
+
}
|
|
8520
|
+
var store = {
|
|
8521
|
+
/** 当前栈(自底向上)。 */
|
|
8522
|
+
get list() {
|
|
8523
|
+
return panels;
|
|
8524
|
+
},
|
|
8525
|
+
depth: function() {
|
|
8526
|
+
return panels.length;
|
|
8527
|
+
},
|
|
8528
|
+
top: function() {
|
|
8529
|
+
return panels.length ? panels[panels.length - 1] : null;
|
|
8530
|
+
},
|
|
8531
|
+
subscribe: function(fn) {
|
|
8532
|
+
listeners.push(fn);
|
|
8533
|
+
return function() {
|
|
8534
|
+
var index = listeners.indexOf(fn);
|
|
8535
|
+
if (index >= 0) listeners.splice(index, 1);
|
|
8536
|
+
};
|
|
8537
|
+
},
|
|
8538
|
+
/** 压入一层。缺 id 时自动生成,便于调用方临时开一个匿名面板。 */
|
|
8539
|
+
push: function(panel) {
|
|
8540
|
+
if (!panel) return null;
|
|
8541
|
+
var item = panel;
|
|
8542
|
+
if (!item.id) {
|
|
8543
|
+
seq += 1;
|
|
8544
|
+
item = Object.assign({}, panel, { id: "panel-" + seq });
|
|
8545
|
+
}
|
|
8546
|
+
panels = panels.concat([item]);
|
|
8547
|
+
emit();
|
|
8548
|
+
return item;
|
|
8549
|
+
},
|
|
8550
|
+
/**
|
|
8551
|
+
* 关掉栈顶(或指定 id 的那层)。返回被关掉的面板,栈空时返回 null。
|
|
8552
|
+
* 幂等:重复关闭同一个 id 不会再触发一次关闭回调。
|
|
8553
|
+
*/
|
|
8554
|
+
pop: function(id) {
|
|
8555
|
+
if (!panels.length) return null;
|
|
8556
|
+
var index = panels.length - 1;
|
|
8557
|
+
if (id !== void 0 && id !== null) {
|
|
8558
|
+
for (var i = panels.length - 1; i >= 0; i -= 1) {
|
|
8559
|
+
if (panels[i] && panels[i].id === id) {
|
|
8560
|
+
index = i;
|
|
8561
|
+
break;
|
|
8562
|
+
}
|
|
8563
|
+
}
|
|
8564
|
+
if (!panels[index] || panels[index].id !== id) return null;
|
|
8565
|
+
}
|
|
8566
|
+
var removed = panels[index];
|
|
8567
|
+
if (removed && typeof removed.onClose === "function") {
|
|
8568
|
+
try {
|
|
8569
|
+
removed.onClose();
|
|
8570
|
+
} catch (error) {
|
|
8571
|
+
if (typeof console !== "undefined") console.error("[panel-stack] onClose \u629B\u9519", error);
|
|
8572
|
+
}
|
|
8573
|
+
}
|
|
8574
|
+
panels = panels.slice(0, index).concat(panels.slice(index + 1));
|
|
8575
|
+
emit();
|
|
8576
|
+
return removed;
|
|
8577
|
+
},
|
|
8578
|
+
/** 关掉全部面板(例如切视图/切插件时统一收口)。 */
|
|
8579
|
+
closeAll: function() {
|
|
8580
|
+
while (panels.length) store.pop();
|
|
8581
|
+
},
|
|
8582
|
+
/** 用新面板替换栈顶(同一层内容变化时避免「关一个再开一个」的闪动)。 */
|
|
8583
|
+
replace: function(panel) {
|
|
8584
|
+
if (!panels.length) return store.push(panel);
|
|
8585
|
+
var item = panel && panel.id ? panel : Object.assign({}, panel, { id: panels[panels.length - 1].id });
|
|
8586
|
+
panels = panels.slice(0, panels.length - 1).concat([item]);
|
|
8587
|
+
emit();
|
|
8588
|
+
return item;
|
|
8589
|
+
},
|
|
8590
|
+
/** 找到指定 id 的面板(详情屏判断「是不是我」时用)。 */
|
|
8591
|
+
find: function(id) {
|
|
8592
|
+
for (var i = panels.length - 1; i >= 0; i -= 1) {
|
|
8593
|
+
if (panels[i] && panels[i].id === id) return panels[i];
|
|
8594
|
+
}
|
|
8595
|
+
return null;
|
|
8596
|
+
}
|
|
8597
|
+
};
|
|
8598
|
+
return store;
|
|
8599
|
+
}
|
|
8600
|
+
function usePanels(React, store) {
|
|
8601
|
+
if (!React || typeof store.subscribe !== "function") return { list: store && store.list ? store.list : [], depth: 0 };
|
|
8602
|
+
var list = typeof React.useSyncExternalStore === "function" ? React.useSyncExternalStore(store.subscribe, function() {
|
|
8603
|
+
return store.list;
|
|
8604
|
+
}) : (function() {
|
|
8605
|
+
var state = React.useState(store.list);
|
|
8606
|
+
React.useEffect(function() {
|
|
8607
|
+
return store.subscribe(function(next) {
|
|
8608
|
+
state[1](next);
|
|
8609
|
+
});
|
|
8610
|
+
}, [store]);
|
|
8611
|
+
return state[0];
|
|
8612
|
+
})();
|
|
8613
|
+
return { list: list || [], depth: (list || []).length };
|
|
8614
|
+
}
|
|
8615
|
+
function PanelHost(props) {
|
|
8616
|
+
var h = props.h;
|
|
8617
|
+
var React = props.React;
|
|
8618
|
+
var store = props.store;
|
|
8619
|
+
var state = usePanels(React, store);
|
|
8620
|
+
var list = state.list || [];
|
|
8621
|
+
var doc = typeof document !== "undefined" ? document : null;
|
|
8622
|
+
var lastFocus = React.useRef ? React.useRef(null) : { current: null };
|
|
8623
|
+
var locked = React.useRef ? React.useRef(false) : { current: false };
|
|
8624
|
+
var baseRef = React.useRef ? React.useRef(null) : { current: null };
|
|
8625
|
+
var boxState = React.useState(null);
|
|
8626
|
+
var box = boxState[0], setBox = boxState[1];
|
|
8627
|
+
React.useEffect(function() {
|
|
8628
|
+
if (!list.length || !doc || typeof window === "undefined") return void 0;
|
|
8629
|
+
function measure() {
|
|
8630
|
+
var target = baseRef.current;
|
|
8631
|
+
if (target) target = target.parentElement;
|
|
8632
|
+
while (target && typeof target.getBoundingClientRect === "function") {
|
|
8633
|
+
var box2 = target.getBoundingClientRect();
|
|
8634
|
+
if (box2.width >= 1 && box2.height >= 1) {
|
|
8635
|
+
setBox({ left: Math.round(box2.left), top: Math.round(box2.top), width: Math.round(box2.width), height: Math.round(box2.height) });
|
|
8636
|
+
return;
|
|
8637
|
+
}
|
|
8638
|
+
target = target.parentElement;
|
|
8639
|
+
}
|
|
8640
|
+
}
|
|
8641
|
+
measure();
|
|
8642
|
+
window.addEventListener("resize", measure);
|
|
8643
|
+
window.addEventListener("orientationchange", measure);
|
|
8644
|
+
return function() {
|
|
8645
|
+
window.removeEventListener("resize", measure);
|
|
8646
|
+
window.removeEventListener("orientationchange", measure);
|
|
8647
|
+
};
|
|
8648
|
+
}, [list.length]);
|
|
8649
|
+
React.useEffect(function() {
|
|
8650
|
+
if (!list.length || !doc) return void 0;
|
|
8651
|
+
function onKey(event) {
|
|
8652
|
+
if (event.key !== "Escape") return;
|
|
8653
|
+
var top = store.top();
|
|
8654
|
+
if (!top) return;
|
|
8655
|
+
if (top.dismissible === false) return;
|
|
8656
|
+
event.stopPropagation();
|
|
8657
|
+
store.pop();
|
|
8658
|
+
}
|
|
8659
|
+
doc.addEventListener("keydown", onKey, true);
|
|
8660
|
+
return function() {
|
|
8661
|
+
doc.removeEventListener("keydown", onKey, true);
|
|
8662
|
+
};
|
|
8663
|
+
}, [list.length, store]);
|
|
8664
|
+
React.useEffect(function() {
|
|
8665
|
+
if (!doc || !doc.body) return void 0;
|
|
8666
|
+
if (list.length && !locked.current) {
|
|
8667
|
+
locked.current = true;
|
|
8668
|
+
lastFocus.current = doc.activeElement || null;
|
|
8669
|
+
doc.body.setAttribute("data-wb-panel-lock", "1");
|
|
8670
|
+
var prev = doc.body.style.overflow;
|
|
8671
|
+
doc.body.style.overflow = "hidden";
|
|
8672
|
+
return function() {
|
|
8673
|
+
doc.body.style.overflow = prev;
|
|
8674
|
+
doc.body.removeAttribute("data-wb-panel-lock");
|
|
8675
|
+
locked.current = false;
|
|
8676
|
+
var back = lastFocus.current;
|
|
8677
|
+
if (back && typeof back.focus === "function") {
|
|
8678
|
+
try {
|
|
8679
|
+
back.focus();
|
|
8680
|
+
} catch (error) {
|
|
8681
|
+
}
|
|
8682
|
+
}
|
|
8683
|
+
lastFocus.current = null;
|
|
8684
|
+
};
|
|
8685
|
+
}
|
|
8686
|
+
return void 0;
|
|
8687
|
+
}, [list.length]);
|
|
8688
|
+
var dragHeights = React.useRef ? React.useRef({}) : { current: {} };
|
|
8689
|
+
function grabProps(panel) {
|
|
8690
|
+
return {
|
|
8691
|
+
className: "wbpanel-grab",
|
|
8692
|
+
role: "separator",
|
|
8693
|
+
"aria-label": "\u62D6\u52A8\u8C03\u6574\u9AD8\u5EA6",
|
|
8694
|
+
onPointerDown: function(event) {
|
|
8695
|
+
var surface = event.currentTarget.parentElement;
|
|
8696
|
+
var layer = surface && surface.parentElement;
|
|
8697
|
+
if (!surface || !layer) return;
|
|
8698
|
+
var box2 = layer.getBoundingClientRect();
|
|
8699
|
+
if (box2.height < 1) return;
|
|
8700
|
+
var saved = dragHeights.current[panel.id];
|
|
8701
|
+
var startH = saved ? saved : box2.height * 0.62;
|
|
8702
|
+
var startY = event.clientY;
|
|
8703
|
+
if (event.currentTarget.setPointerCapture) {
|
|
8704
|
+
try {
|
|
8705
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
8706
|
+
} catch (error) {
|
|
8707
|
+
}
|
|
8708
|
+
}
|
|
8709
|
+
layer.setAttribute("data-resizing", "1");
|
|
8710
|
+
function move(moveEvent) {
|
|
8711
|
+
var next = startH + (startY - moveEvent.clientY);
|
|
8712
|
+
next = Math.max(box2.height * 0.3, Math.min(box2.height * 0.92, next));
|
|
8713
|
+
surface.style.setProperty("--wbpanel-h", Math.round(next / box2.height * 100) + "%");
|
|
8714
|
+
dragHeights.current[panel.id] = Math.round(next / box2.height * 100) + "%";
|
|
8715
|
+
}
|
|
8716
|
+
function end() {
|
|
8717
|
+
layer.removeAttribute("data-resizing");
|
|
8718
|
+
window.removeEventListener("pointermove", move);
|
|
8719
|
+
window.removeEventListener("pointerup", end);
|
|
8720
|
+
window.removeEventListener("pointercancel", end);
|
|
8721
|
+
}
|
|
8722
|
+
window.addEventListener("pointermove", move);
|
|
8723
|
+
window.addEventListener("pointerup", end);
|
|
8724
|
+
window.addEventListener("pointercancel", end);
|
|
8725
|
+
event.preventDefault();
|
|
8726
|
+
}
|
|
8727
|
+
};
|
|
8728
|
+
}
|
|
8729
|
+
function swipeBackProps(panel) {
|
|
8730
|
+
if (panel.kind !== "full" && panel.kind !== "right") return {};
|
|
8731
|
+
if (panel.dismissible === false) return {};
|
|
8732
|
+
var start = null;
|
|
8733
|
+
return {
|
|
8734
|
+
onPointerDown: function(event) {
|
|
8735
|
+
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
8736
|
+
var body = event.currentTarget;
|
|
8737
|
+
var rect = body.getBoundingClientRect();
|
|
8738
|
+
if (event.clientX - rect.left > gestures.SWIPE_BACK_EDGE) return;
|
|
8739
|
+
start = { x: event.clientX, y: event.clientY, lastX: event.clientX, lastAt: Date.now(), width: rect.width, velocity: 0 };
|
|
8740
|
+
body.setAttribute("data-swiping", "1");
|
|
8741
|
+
if (body.setPointerCapture) {
|
|
8742
|
+
try {
|
|
8743
|
+
body.setPointerCapture(event.pointerId);
|
|
8744
|
+
} catch (error) {
|
|
8745
|
+
}
|
|
8746
|
+
}
|
|
8747
|
+
},
|
|
8748
|
+
onPointerMove: function(event) {
|
|
8749
|
+
if (!start) return;
|
|
8750
|
+
var now = Date.now();
|
|
8751
|
+
var dt = now - start.lastAt;
|
|
8752
|
+
if (dt > 0) start.velocity = (event.clientX - start.lastX) / dt;
|
|
8753
|
+
start.lastX = event.clientX;
|
|
8754
|
+
start.lastAt = now;
|
|
8755
|
+
var dx = event.clientX - start.x;
|
|
8756
|
+
event.currentTarget.style.transform = dx > 0 ? "translateX(" + gestures.followOffset(dx, start.width) + "px)" : "none";
|
|
8757
|
+
},
|
|
8758
|
+
onPointerUp: function(event) {
|
|
8759
|
+
if (!start) return;
|
|
8760
|
+
var body = event.currentTarget;
|
|
8761
|
+
var dx = event.clientX - start.x;
|
|
8762
|
+
var dy = event.clientY - start.y;
|
|
8763
|
+
var velocity = start.velocity;
|
|
8764
|
+
start = null;
|
|
8765
|
+
body.removeAttribute("data-swiping");
|
|
8766
|
+
body.style.transform = "none";
|
|
8767
|
+
if (gestures.swipeBackDecision({ dx, dy, velocity })) store.pop(panel.id);
|
|
8768
|
+
},
|
|
8769
|
+
onPointerCancel: function(event) {
|
|
8770
|
+
start = null;
|
|
8771
|
+
event.currentTarget.removeAttribute("data-swiping");
|
|
8772
|
+
event.currentTarget.style.transform = "none";
|
|
8773
|
+
}
|
|
8774
|
+
};
|
|
8775
|
+
}
|
|
8776
|
+
function renderPanel(panel) {
|
|
8777
|
+
var kind = panel.kind || "bottom";
|
|
8778
|
+
var dismissible = panel.dismissible !== false;
|
|
8779
|
+
var place = box ? { left: box.left + "px", top: box.top + "px", width: box.width + "px", height: box.height + "px" } : null;
|
|
8780
|
+
var savedH = dragHeights.current[panel.id];
|
|
8781
|
+
if (place && kind === "bottom" && savedH) place["--wbpanel-h"] = savedH;
|
|
8782
|
+
return h("div", { className: "wbpanel", "data-kind": kind, "data-panel-id": panel.id, key: panel.id, style: place || void 0 }, [
|
|
8783
|
+
dismissible && panel.mask !== false ? h("button", { type: "button", className: "wbpanel-mask", key: "mask", "aria-label": panel.maskLabel || "\u5173\u95ED", onClick: function() {
|
|
8784
|
+
store.pop(panel.id);
|
|
8785
|
+
} }) : h("div", { className: "wbpanel-mask", key: "mask", "aria-hidden": "true" }),
|
|
8786
|
+
h("section", Object.assign({
|
|
8787
|
+
className: "wbpanel-body",
|
|
8788
|
+
key: "body",
|
|
8789
|
+
role: kind === "dialog" ? "dialog" : "region",
|
|
8790
|
+
"aria-modal": "true",
|
|
8791
|
+
"aria-label": typeof panel.title === "string" ? panel.title : void 0
|
|
8792
|
+
}, swipeBackProps(panel)), [
|
|
8793
|
+
kind === "bottom" ? h("div", { key: "grab", ...grabProps(panel) }) : null,
|
|
8794
|
+
panel.title || dismissible ? h("div", { className: "wbpanel-head", key: "head" }, [
|
|
8795
|
+
h("div", { className: "wbpanel-title", key: "title" }, panel.title || ""),
|
|
8796
|
+
panel.headExtra || null,
|
|
8797
|
+
dismissible ? h("button", { type: "button", className: "wbpanel-close", key: "close", "aria-label": "\u5173\u95ED", onClick: function() {
|
|
8798
|
+
store.pop(panel.id);
|
|
8799
|
+
} }, "\xD7") : null
|
|
8800
|
+
]) : null,
|
|
8801
|
+
h("div", { className: "wbpanel-content", key: "content" }, typeof panel.render === "function" ? panel.render({ close: function() {
|
|
8802
|
+
store.pop(panel.id);
|
|
8803
|
+
}, store, panel }) : panel.children || null)
|
|
8804
|
+
])
|
|
8805
|
+
]);
|
|
8806
|
+
}
|
|
8807
|
+
return h("div", { className: "wbpanel-host", style: { display: "contents" } }, [
|
|
8808
|
+
h("div", { className: "wbpanel-base", key: "base", ref: baseRef, hidden: list.some(function(panel) {
|
|
8809
|
+
return panel.kind === "full" || panel.hideBase;
|
|
8810
|
+
}) }, props.children)
|
|
8811
|
+
].concat(list.map(renderPanel)));
|
|
8812
|
+
}
|
|
8813
|
+
module2.exports = {
|
|
8814
|
+
styles: STYLES,
|
|
8815
|
+
createStore,
|
|
8816
|
+
usePanels,
|
|
8817
|
+
PanelHost
|
|
8818
|
+
};
|
|
8819
|
+
}
|
|
8820
|
+
});
|
|
8821
|
+
|
|
8822
|
+
// packages/addons/lib/sheet.cjs
|
|
8823
|
+
var require_sheet = __commonJS({
|
|
8824
|
+
"packages/addons/lib/sheet.cjs"(exports2, module2) {
|
|
8825
|
+
"use strict";
|
|
8826
|
+
var CLOSE_DISTANCE = 96;
|
|
8827
|
+
var CLOSE_VELOCITY = 0.5;
|
|
8828
|
+
var EXPAND_DISTANCE = 48;
|
|
8829
|
+
var SNAP_COLLAPSED = "50dvh";
|
|
8830
|
+
var SNAP_EXPANDED = "92dvh";
|
|
8831
|
+
var STYLES = [
|
|
8832
|
+
".wbsheet{position:relative;display:flex;flex-direction:column;min-height:0;width:100%;background:var(--wb-card);color:var(--wb-text);border-radius:14px 14px 0 0;box-shadow:0 -6px 24px color-mix(in oklab,var(--wb-text,currentColor) 16%,transparent);transition:height .16s ease}",
|
|
8833
|
+
".wbsheet[data-dragging=1]{transition:none}",
|
|
8834
|
+
".wbsheet-grip{flex:none;display:flex;justify-content:center;align-items:center;height:22px;cursor:grab;touch-action:none;background:transparent;border:0;padding:0;width:100%}",
|
|
8835
|
+
".wbsheet-grip::before{content:'';width:36px;height:4px;border-radius:2px;background:var(--wb-line)}",
|
|
8836
|
+
".wbsheet-grip:focus-visible{outline:0;box-shadow:inset 0 0 0 2px var(--wb-accent)}",
|
|
8837
|
+
".wbsheet-head{flex:none;display:flex;align-items:center;gap:8px;padding:0 14px 8px}",
|
|
8838
|
+
".wbsheet-title{flex:1;min-width:0;font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
8839
|
+
".wbsheet-close{flex:none;width:32px;height:32px;border-radius:8px;border:0;background:transparent;color:var(--wb-muted);font:inherit;font-size:17px;cursor:pointer}",
|
|
8840
|
+
".wbsheet-close:hover,.wbsheet-close:focus-visible{background:var(--wb-surface);color:var(--wb-text);outline:0}",
|
|
8841
|
+
".wbsheet-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 14px}",
|
|
8842
|
+
".wbsheet-foot{flex:none;display:flex;gap:8px;align-items:center;padding:10px 14px calc(10px + var(--wb-safe-bottom,0px));border-top:1px solid var(--wb-line)}",
|
|
8843
|
+
"@media (prefers-reduced-motion: reduce){.wbsheet{transition:none}}"
|
|
8844
|
+
].join("\n");
|
|
8845
|
+
function sheetDrag(input) {
|
|
8846
|
+
var dy = Number(input && input.dy) || 0;
|
|
8847
|
+
var velocity = Number(input && input.velocity) || 0;
|
|
8848
|
+
var expanded = !!(input && input.expanded);
|
|
8849
|
+
var closeDistance = Number(input && input.closeDistance) > 0 ? Number(input.closeDistance) : CLOSE_DISTANCE;
|
|
8850
|
+
var closeVelocity = Number(input && input.closeVelocity) > 0 ? Number(input.closeVelocity) : CLOSE_VELOCITY;
|
|
8851
|
+
var expandDistance = Number(input && input.expandDistance) > 0 ? Number(input.expandDistance) : EXPAND_DISTANCE;
|
|
8852
|
+
if (dy > closeDistance || velocity > closeVelocity) return { action: "close", expanded: false };
|
|
8853
|
+
if (dy < -expandDistance && !expanded) return { action: "expand", expanded: true };
|
|
8854
|
+
if (dy > expandDistance && expanded) return { action: "collapse", expanded: false };
|
|
8855
|
+
return { action: "none", expanded };
|
|
8856
|
+
}
|
|
8857
|
+
function sheetHeight(expanded) {
|
|
8858
|
+
return expanded ? SNAP_EXPANDED : SNAP_COLLAPSED;
|
|
8859
|
+
}
|
|
8860
|
+
function SheetSurface(props) {
|
|
8861
|
+
var h = props.h;
|
|
8862
|
+
var React = props.React;
|
|
8863
|
+
var state = React.useState(!!props.expanded);
|
|
8864
|
+
var expanded = state[0];
|
|
8865
|
+
var setExpanded = state[1];
|
|
8866
|
+
var startRef = React.useRef ? React.useRef(null) : { current: null };
|
|
8867
|
+
var dragState = React.useState(null);
|
|
8868
|
+
var drag = dragState[0];
|
|
8869
|
+
var setDrag = dragState[1];
|
|
8870
|
+
React.useEffect(function() {
|
|
8871
|
+
if (props.expanded !== void 0 && props.expanded !== expanded) setExpanded(!!props.expanded);
|
|
8872
|
+
}, [props.expanded]);
|
|
8873
|
+
function onPointerDown(event) {
|
|
8874
|
+
if (props.draggable === false) return;
|
|
8875
|
+
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
8876
|
+
event.preventDefault();
|
|
8877
|
+
startRef.current = { y: event.clientY, lastY: event.clientY, lastAt: Date.now() };
|
|
8878
|
+
setDrag({ dy: 0, velocity: 0 });
|
|
8879
|
+
var target = event.currentTarget;
|
|
8880
|
+
if (target && typeof target.setPointerCapture === "function") {
|
|
8881
|
+
try {
|
|
8882
|
+
target.setPointerCapture(event.pointerId);
|
|
8883
|
+
} catch (error) {
|
|
8884
|
+
}
|
|
8885
|
+
}
|
|
8886
|
+
}
|
|
8887
|
+
function onPointerMove(event) {
|
|
8888
|
+
var st = startRef.current;
|
|
8889
|
+
if (!st || !drag) return;
|
|
8890
|
+
var now = Date.now();
|
|
8891
|
+
var dt = now - st.lastAt;
|
|
8892
|
+
var velocity = dt > 0 ? (event.clientY - st.lastY) / dt : 0;
|
|
8893
|
+
st.lastY = event.clientY;
|
|
8894
|
+
st.lastAt = now;
|
|
8895
|
+
var dy = event.clientY - st.y;
|
|
8896
|
+
setDrag({ dy, velocity });
|
|
8897
|
+
}
|
|
8898
|
+
function onPointerUp() {
|
|
8899
|
+
if (!drag) return;
|
|
8900
|
+
var outcome = sheetDrag({ dy: drag.dy, velocity: drag.velocity, expanded });
|
|
8901
|
+
startRef.current = null;
|
|
8902
|
+
setDrag(null);
|
|
8903
|
+
if (outcome.action === "close") {
|
|
8904
|
+
if (typeof props.onClose === "function") props.onClose();
|
|
8905
|
+
return;
|
|
8906
|
+
}
|
|
8907
|
+
if (outcome.action === "expand" || outcome.action === "collapse") {
|
|
8908
|
+
setExpanded(outcome.expanded);
|
|
8909
|
+
if (typeof props.onExpanded === "function") props.onExpanded(outcome.expanded);
|
|
8910
|
+
}
|
|
8911
|
+
}
|
|
8912
|
+
var offset = drag ? drag.dy > 0 ? Math.min(drag.dy, 320) : Math.max(drag.dy, -24) : 0;
|
|
8913
|
+
return h("section", {
|
|
8914
|
+
className: "wbsheet",
|
|
8915
|
+
"data-dragging": drag ? "1" : "0",
|
|
8916
|
+
style: Object.assign({ height: sheetHeight(expanded), maxHeight: SNAP_EXPANDED, transform: offset ? "translateY(" + Math.round(offset) + "px)" : "none" }, props.style)
|
|
8917
|
+
}, [
|
|
8918
|
+
h("button", {
|
|
8919
|
+
key: "grip",
|
|
8920
|
+
type: "button",
|
|
8921
|
+
className: "wbsheet-grip",
|
|
8922
|
+
"aria-label": expanded ? "\u6536\u8D77\u62BD\u5C49" : "\u6491\u5F00\u62BD\u5C49",
|
|
8923
|
+
onPointerDown,
|
|
8924
|
+
onPointerMove,
|
|
8925
|
+
onPointerUp,
|
|
8926
|
+
onPointerCancel: onPointerUp,
|
|
8927
|
+
onKeyDown: function(event) {
|
|
8928
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
8929
|
+
event.preventDefault();
|
|
8930
|
+
setExpanded(!expanded);
|
|
8931
|
+
},
|
|
8932
|
+
onClick: props.draggable === false ? function() {
|
|
8933
|
+
setExpanded(!expanded);
|
|
8934
|
+
} : void 0
|
|
8935
|
+
}),
|
|
8936
|
+
props.title || props.onClose ? h("div", { className: "wbsheet-head", key: "head" }, [
|
|
8937
|
+
h("div", { className: "wbsheet-title", key: "title" }, props.title || ""),
|
|
8938
|
+
props.headExtra || null,
|
|
8939
|
+
typeof props.onClose === "function" ? h("button", { key: "close", type: "button", className: "wbsheet-close", "aria-label": "\u5173\u95ED", onClick: props.onClose }, "\xD7") : null
|
|
8940
|
+
]) : null,
|
|
8941
|
+
h("div", { className: "wbsheet-body", key: "body" }, props.children),
|
|
8942
|
+
props.footer ? h("div", { className: "wbsheet-foot", key: "foot" }, props.footer) : null
|
|
8943
|
+
]);
|
|
8944
|
+
}
|
|
8945
|
+
module2.exports = {
|
|
8946
|
+
styles: STYLES,
|
|
8947
|
+
CLOSE_DISTANCE,
|
|
8948
|
+
CLOSE_VELOCITY,
|
|
8949
|
+
EXPAND_DISTANCE,
|
|
8950
|
+
sheetDrag,
|
|
8951
|
+
sheetHeight,
|
|
8952
|
+
SheetSurface
|
|
8953
|
+
};
|
|
8954
|
+
}
|
|
8955
|
+
});
|
|
8956
|
+
|
|
8957
|
+
// packages/addons/lib/card-list.cjs
|
|
8958
|
+
var require_card_list = __commonJS({
|
|
8959
|
+
"packages/addons/lib/card-list.cjs"(exports2, module2) {
|
|
8960
|
+
"use strict";
|
|
8961
|
+
var gestures = require_gestures();
|
|
8962
|
+
var STYLES = [
|
|
8963
|
+
".wbcard-list{display:flex;flex-direction:column;gap:8px;min-width:0}",
|
|
8964
|
+
// 下拉刷新:滚动容器由共享件提供,插件不再各自建一个 overflow:auto 再配一套指示条。
|
|
8965
|
+
".wbcard-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior-y:contain;display:flex;flex-direction:column}",
|
|
8966
|
+
".wbcard-pull{flex:none;display:flex;align-items:center;justify-content:center;overflow:hidden;color:var(--wb-muted);font-size:12px;transition:height .12s ease}",
|
|
8967
|
+
".wbcard-pull[data-refreshing=1] .wbcard-pull-text{color:var(--wb-accent)}",
|
|
8968
|
+
".wbcard-item[data-pressing=1]{opacity:.72}",
|
|
8969
|
+
".wbcard-list-bar{display:flex;align-items:center;gap:8px;justify-content:center;padding:10px 0;color:var(--wb-muted);font-size:12px}",
|
|
8970
|
+
".wbcard{border:1px solid var(--wb-line);border-radius:var(--wb-radius-card,10px);background:var(--wb-card);color:var(--wb-text);padding:11px 12px;display:flex;flex-direction:column;gap:8px;min-width:0;cursor:pointer;transition:border-color .12s ease,background .12s ease}",
|
|
8971
|
+
".wbcard:hover{border-color:var(--wb-border)}",
|
|
8972
|
+
".wbcard:focus-visible{outline:0;box-shadow:inset 0 0 0 2px var(--wb-accent)}",
|
|
8973
|
+
".wbcard[data-active=1]{border-color:var(--wb-accent)}",
|
|
8974
|
+
".wbcard-top{display:flex;align-items:flex-start;gap:8px;min-width:0}",
|
|
8975
|
+
".wbcard-title{flex:1;min-width:0;font-size:14px;font-weight:600;line-height:1.35;overflow-wrap:anywhere}",
|
|
8976
|
+
".wbcard-badges{display:flex;flex-wrap:wrap;gap:4px}",
|
|
8977
|
+
".wbcard-badge{font-size:11px;line-height:1.6;padding:0 6px;border-radius:999px;border:1px solid var(--wb-line);color:var(--wb-muted);background:var(--wb-surface);white-space:nowrap}",
|
|
8978
|
+
".wbcard-badge[data-tone=ok]{color:var(--wb-ok);border-color:color-mix(in oklab,var(--wb-ok) 40%,var(--wb-line))}",
|
|
8979
|
+
".wbcard-badge[data-tone=warn]{color:var(--wb-warn);border-color:color-mix(in oklab,var(--wb-warn) 40%,var(--wb-line))}",
|
|
8980
|
+
".wbcard-badge[data-tone=danger]{color:var(--wb-danger);border-color:color-mix(in oklab,var(--wb-danger) 40%,var(--wb-line))}",
|
|
8981
|
+
".wbcard-meta{display:flex;flex-wrap:wrap;gap:6px 10px;font-size:12px;color:var(--wb-muted);min-width:0}",
|
|
8982
|
+
".wbcard-meta>span{min-width:0;overflow-wrap:anywhere}",
|
|
8983
|
+
".wbcard-body{font-size:13px;line-height:1.5;color:var(--wb-text)}",
|
|
8984
|
+
".wbcard-actions{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}",
|
|
8985
|
+
".wbcard-actions .wbcard-btn{min-height:32px}",
|
|
8986
|
+
".wbcard-empty{padding:28px 12px;text-align:center;color:var(--wb-muted);font-size:13px}",
|
|
8987
|
+
".wbcard-error{padding:14px 12px;border:1px solid color-mix(in oklab,var(--wb-danger) 40%,var(--wb-line));border-radius:10px;color:var(--wb-danger);font-size:13px;display:flex;gap:10px;align-items:center;justify-content:space-between}",
|
|
8988
|
+
".wbcard-skel{border:1px solid var(--wb-line);border-radius:10px;padding:12px;display:flex;flex-direction:column;gap:8px}",
|
|
8989
|
+
".wbcard-skel i{display:block;height:10px;border-radius:5px;background:var(--wb-surface);animation:wbcard-pulse 1.3s ease-in-out infinite}",
|
|
8990
|
+
".wbcard-skel i:nth-child(1){width:56%}.wbcard-skel i:nth-child(2){width:88%}.wbcard-skel i:nth-child(3){width:34%}",
|
|
8991
|
+
"@media (prefers-reduced-motion: reduce){.wbcard-skel i{animation:none}}",
|
|
8992
|
+
"@keyframes wbcard-pulse{0%,100%{opacity:.55}50%{opacity:1}}"
|
|
8993
|
+
].join("\n");
|
|
8994
|
+
function pageState(input) {
|
|
8995
|
+
var loading = !!(input && input.loading);
|
|
8996
|
+
var hasMore = !!(input && input.hasMore);
|
|
8997
|
+
var count = Number(input && input.count) || 0;
|
|
8998
|
+
if (loading) return "loading";
|
|
8999
|
+
if (!count) return "empty";
|
|
9000
|
+
if (hasMore) return "more";
|
|
9001
|
+
return "end";
|
|
9002
|
+
}
|
|
9003
|
+
function skeletonRows(count) {
|
|
9004
|
+
var n = count === void 0 || count === null || count === "" ? 3 : Number(count);
|
|
9005
|
+
return Math.max(1, Math.min(6, Math.round(n)));
|
|
9006
|
+
}
|
|
9007
|
+
function Card(props) {
|
|
9008
|
+
var h = props.h;
|
|
9009
|
+
var badges = Array.isArray(props.badges) ? props.badges : [];
|
|
9010
|
+
var meta = Array.isArray(props.meta) ? props.meta : [];
|
|
9011
|
+
return h(props.href ? "a" : "div", {
|
|
9012
|
+
className: "wbcard" + (props.className ? " " + props.className : ""),
|
|
9013
|
+
"data-active": props.active ? "1" : "0",
|
|
9014
|
+
href: props.href,
|
|
9015
|
+
role: props.href ? void 0 : "button",
|
|
9016
|
+
tabIndex: props.href ? void 0 : 0,
|
|
9017
|
+
onClick: props.onClick,
|
|
9018
|
+
onKeyDown: props.href ? void 0 : function(event) {
|
|
9019
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
9020
|
+
event.preventDefault();
|
|
9021
|
+
if (typeof props.onClick === "function") props.onClick(event);
|
|
9022
|
+
}
|
|
9023
|
+
}, [
|
|
9024
|
+
h("div", { className: "wbcard-top", key: "top" }, [
|
|
9025
|
+
h("div", { className: "wbcard-title", key: "t" }, props.title || ""),
|
|
9026
|
+
badges.length ? h("div", { className: "wbcard-badges", key: "b" }, badges.map(function(badge, index) {
|
|
9027
|
+
var item = typeof badge === "string" ? { text: badge } : badge;
|
|
9028
|
+
return h("span", { className: "wbcard-badge", "data-tone": item.tone || "neutral", key: (item.text || "") + index }, item.text || "");
|
|
9029
|
+
})) : null
|
|
9030
|
+
]),
|
|
9031
|
+
meta.length ? h("div", { className: "wbcard-meta", key: "m" }, meta.filter(Boolean).map(function(text, index) {
|
|
9032
|
+
return h("span", { key: index }, typeof text === "string" ? text : text && text.text || "");
|
|
9033
|
+
})) : null,
|
|
9034
|
+
props.body ? h("div", { className: "wbcard-body", key: "body" }, props.body) : null,
|
|
9035
|
+
props.actions ? h("div", { className: "wbcard-actions", key: "a" }, props.actions) : null
|
|
9036
|
+
]);
|
|
9037
|
+
}
|
|
9038
|
+
function CardRow(props) {
|
|
9039
|
+
var h = props.h;
|
|
9040
|
+
var React = props.React;
|
|
9041
|
+
var longPress = gestures.useLongPress(React, {
|
|
9042
|
+
disabled: !props.onLongPress,
|
|
9043
|
+
onLongPress: props.onLongPress ? function(point) {
|
|
9044
|
+
props.onLongPress(point);
|
|
9045
|
+
} : void 0
|
|
9046
|
+
});
|
|
9047
|
+
var handlers = props.onLongPress ? longPress.handlers : {};
|
|
9048
|
+
return h("div", Object.assign({
|
|
9049
|
+
className: "wbcard-item",
|
|
9050
|
+
"data-pressing": longPress.pressing ? "1" : "0",
|
|
9051
|
+
onClick: props.onLongPress ? function(event) {
|
|
9052
|
+
if (longPress.consume()) return;
|
|
9053
|
+
if (typeof props.onClick === "function") props.onClick(event);
|
|
9054
|
+
} : props.onClick
|
|
9055
|
+
}, handlers), props.children);
|
|
9056
|
+
}
|
|
9057
|
+
function CardList(props) {
|
|
9058
|
+
var h = props.h;
|
|
9059
|
+
var React = props.React;
|
|
9060
|
+
var items = Array.isArray(props.items) ? props.items : [];
|
|
9061
|
+
var state = pageState({ loading: props.loading, hasMore: props.hasMore, count: items.length });
|
|
9062
|
+
var sentinel = React.useRef ? React.useRef(null) : { current: null };
|
|
9063
|
+
React.useEffect(function() {
|
|
9064
|
+
if (typeof props.onLoadMore !== "function" || !props.hasMore || props.loading) return void 0;
|
|
9065
|
+
var node = sentinel.current;
|
|
9066
|
+
if (!node || typeof IntersectionObserver === "undefined") return void 0;
|
|
9067
|
+
var observer = new IntersectionObserver(function(entries) {
|
|
9068
|
+
if (entries.some(function(entry) {
|
|
9069
|
+
return entry.isIntersecting;
|
|
9070
|
+
})) props.onLoadMore();
|
|
9071
|
+
}, { rootMargin: "160px" });
|
|
9072
|
+
observer.observe(node);
|
|
9073
|
+
return function() {
|
|
9074
|
+
observer.disconnect();
|
|
9075
|
+
};
|
|
9076
|
+
}, [props.hasMore, props.loading, props.onLoadMore, items.length]);
|
|
9077
|
+
function keyOf(item, index) {
|
|
9078
|
+
if (typeof props.keyOf === "function") {
|
|
9079
|
+
var key = props.keyOf(item, index);
|
|
9080
|
+
return key === void 0 || key === null ? String(index) : String(key);
|
|
9081
|
+
}
|
|
9082
|
+
return String(index);
|
|
9083
|
+
}
|
|
9084
|
+
var children = [];
|
|
9085
|
+
if (props.loading && !items.length) {
|
|
9086
|
+
for (var i = 0; i < skeletonRows(props.skeletonCount); i += 1) {
|
|
9087
|
+
children.push(h("div", { className: "wbcard-skel", key: "skel-" + i, "aria-hidden": "true" }, [
|
|
9088
|
+
h("i", { key: "a" }),
|
|
9089
|
+
h("i", { key: "b" }),
|
|
9090
|
+
h("i", { key: "c" })
|
|
9091
|
+
]));
|
|
9092
|
+
}
|
|
9093
|
+
} else if (props.error) {
|
|
9094
|
+
children.push(h("div", { className: "wbcard-error", key: "err", role: "alert" }, [
|
|
9095
|
+
h("span", { key: "t" }, String(props.error)),
|
|
9096
|
+
typeof props.onRetry === "function" ? h("button", { key: "r", type: "button", className: "wbcard-btn", onClick: props.onRetry }, props.retryLabel || "\u91CD\u8BD5") : null
|
|
9097
|
+
]));
|
|
9098
|
+
} else if (!items.length) {
|
|
9099
|
+
children.push(h("div", { className: "wbcard-empty", key: "empty" }, props.empty || "\u6CA1\u6709\u6570\u636E"));
|
|
9100
|
+
} else {
|
|
9101
|
+
items.forEach(function(item, index) {
|
|
9102
|
+
children.push(h(CardRow, {
|
|
9103
|
+
key: keyOf(item, index),
|
|
9104
|
+
h,
|
|
9105
|
+
React,
|
|
9106
|
+
onClick: props.onItemClick ? function(event) {
|
|
9107
|
+
props.onItemClick(item, event);
|
|
9108
|
+
} : void 0,
|
|
9109
|
+
onLongPress: props.onItemLongPress ? function(point) {
|
|
9110
|
+
props.onItemLongPress(item, point);
|
|
9111
|
+
} : void 0
|
|
9112
|
+
}, typeof props.renderItem === "function" ? props.renderItem(item, index) : h(Card, { h, title: String(item && item.title) })));
|
|
9113
|
+
});
|
|
9114
|
+
}
|
|
9115
|
+
if (items.length && state === "more") {
|
|
9116
|
+
children.push(h(
|
|
9117
|
+
"div",
|
|
9118
|
+
{ className: "wbcard-list-bar", key: "more", ref: sentinel },
|
|
9119
|
+
props.loading ? "\u52A0\u8F7D\u4E2D\u2026" : typeof props.onLoadMore === "function" ? h("button", { type: "button", className: "wbcard-btn", onClick: props.onLoadMore }, props.moreLabel || "\u52A0\u8F7D\u66F4\u591A") : "\u8FD8\u6709\u66F4\u591A"
|
|
9120
|
+
));
|
|
9121
|
+
} else if (items.length && state === "end" && props.endLabel) {
|
|
9122
|
+
children.push(h("div", { className: "wbcard-list-bar", key: "end" }, props.endLabel));
|
|
9123
|
+
}
|
|
9124
|
+
return h("div", { className: "wbcard-list" + (props.className ? " " + props.className : "") }, children);
|
|
9125
|
+
}
|
|
9126
|
+
function PullRefresh(props) {
|
|
9127
|
+
var h = props.h;
|
|
9128
|
+
var React = props.React;
|
|
9129
|
+
var ref = React.useRef ? React.useRef(null) : { current: null };
|
|
9130
|
+
var pull = gestures.usePullToRefresh(React, {
|
|
9131
|
+
containerRef: ref,
|
|
9132
|
+
onRefresh: props.onRefresh,
|
|
9133
|
+
disabled: props.disabled,
|
|
9134
|
+
threshold: props.threshold,
|
|
9135
|
+
max: props.max
|
|
9136
|
+
});
|
|
9137
|
+
var label = pull.refreshing ? props.refreshingLabel || "\u5237\u65B0\u4E2D\u2026" : pull.pull > 0 ? props.releaseLabel || "\u677E\u5F00\u5237\u65B0" : "";
|
|
9138
|
+
return h("div", Object.assign({ className: "wbcard-scroll" + (props.className ? " " + props.className : ""), ref }, pull.handlers), [
|
|
9139
|
+
h("div", {
|
|
9140
|
+
className: "wbcard-pull",
|
|
9141
|
+
key: "pull",
|
|
9142
|
+
"data-refreshing": pull.refreshing ? "1" : "0",
|
|
9143
|
+
style: { height: pull.pull ? pull.pull + "px" : "0px" },
|
|
9144
|
+
"aria-hidden": pull.pull || pull.refreshing ? "false" : "true"
|
|
9145
|
+
}, h("span", { className: "wbcard-pull-text" }, label)),
|
|
9146
|
+
h("div", { className: "wbcard-list-body", key: "body" }, props.children)
|
|
9147
|
+
]);
|
|
9148
|
+
}
|
|
9149
|
+
module2.exports = {
|
|
9150
|
+
styles: STYLES,
|
|
9151
|
+
pageState,
|
|
9152
|
+
skeletonRows,
|
|
9153
|
+
Card,
|
|
9154
|
+
CardList,
|
|
9155
|
+
CardRow,
|
|
9156
|
+
PullRefresh
|
|
9157
|
+
};
|
|
9158
|
+
}
|
|
9159
|
+
});
|
|
9160
|
+
|
|
9161
|
+
// packages/addons/lib/sticky-bar.cjs
|
|
9162
|
+
var require_sticky_bar = __commonJS({
|
|
9163
|
+
"packages/addons/lib/sticky-bar.cjs"(exports2, module2) {
|
|
9164
|
+
"use strict";
|
|
9165
|
+
var BAR_HEIGHT = 56;
|
|
9166
|
+
var STYLES = [
|
|
9167
|
+
".wbbar{position:fixed;left:0;right:0;bottom:0;z-index:850;display:flex;gap:8px;align-items:center;padding:8px 12px calc(8px + var(--wb-safe-bottom,0px));background:var(--wb-card);border-top:1px solid var(--wb-line);box-shadow:0 -4px 18px color-mix(in oklab,var(--wb-text,currentColor) 12%,transparent);min-height:calc(" + BAR_HEIGHT + "px + var(--wb-safe-bottom,0px))}",
|
|
9168
|
+
".wbbar[data-tone=accent]{border-top-color:color-mix(in oklab,var(--wb-accent) 45%,var(--wb-line))}",
|
|
9169
|
+
".wbbar-grow{flex:1;min-width:0}",
|
|
9170
|
+
".wbbar .wbcard-btn,.wbbar button{min-height:40px}",
|
|
9171
|
+
".wbbar-note{flex:1;min-width:0;font-size:12px;color:var(--wb-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"
|
|
9172
|
+
].join("\n");
|
|
9173
|
+
function spacerStyle(extra) {
|
|
9174
|
+
var pad = Number(extra) > 0 ? Number(extra) : 0;
|
|
9175
|
+
return { paddingBottom: "calc(" + (BAR_HEIGHT + pad) + "px + var(--wb-safe-bottom,0px))" };
|
|
9176
|
+
}
|
|
9177
|
+
function StickyBar(props) {
|
|
9178
|
+
var h = props.h;
|
|
9179
|
+
return h("div", {
|
|
9180
|
+
className: "wbbar" + (props.className ? " " + props.className : ""),
|
|
9181
|
+
"data-tone": props.tone || "default",
|
|
9182
|
+
role: "toolbar",
|
|
9183
|
+
"aria-label": props.label
|
|
9184
|
+
}, [
|
|
9185
|
+
props.note ? h("div", { className: "wbbar-note", key: "note" }, props.note) : null,
|
|
9186
|
+
props.children
|
|
9187
|
+
]);
|
|
9188
|
+
}
|
|
9189
|
+
module2.exports = {
|
|
9190
|
+
styles: STYLES,
|
|
9191
|
+
BAR_HEIGHT,
|
|
9192
|
+
spacerStyle,
|
|
9193
|
+
StickyBar
|
|
9194
|
+
};
|
|
9195
|
+
}
|
|
9196
|
+
});
|
|
9197
|
+
|
|
7945
9198
|
// packages/addons/tasks/client/ui/styles.cjs
|
|
7946
9199
|
var require_styles = __commonJS({
|
|
7947
9200
|
"packages/addons/tasks/client/ui/styles.cjs"(exports2, module2) {
|
|
@@ -7968,7 +9221,7 @@ var require_styles = __commonJS({
|
|
|
7968
9221
|
".wbt-btn.danger{color:var(--dsw-alias-state-error-primary);border-color:color-mix(in oklab,var(--dsw-alias-state-error-primary) 45%,transparent)}",
|
|
7969
9222
|
".wbt-btn:disabled{opacity:.5;cursor:not-allowed}",
|
|
7970
9223
|
".wbt-input,.wbt-select,.wbt-textarea{border:1px solid var(--wbt-line);background:transparent;color:inherit;border-radius:8px;padding:7px 10px;font-size:13px;outline:none;min-width:0}",
|
|
7971
|
-
".wbt-input:focus,.wbt-select:focus,.wbt-textarea:focus{border-color:var(--wbt-accent)}",
|
|
9224
|
+
".wbt-input:focus,.wbt-select:focus,.wbt-textarea:focus-visible{border-color:var(--wbt-accent)}",
|
|
7972
9225
|
".wbt-input:focus-visible,.wbt-select:focus-visible,.wbt-textarea:focus-visible{outline:none !important;border-color:var(--wbt-accent) !important;box-shadow:0 0 0 3px color-mix(in oklab,var(--wbt-accent) 18%,transparent) !important}",
|
|
7973
9226
|
".wbt-btn:focus-visible,.wbt-icon:focus-visible,.wbt-tw:focus-visible,.wbt-tab:focus-visible,.wbt-tacts button:focus-visible,.wbt-addbtn:focus-visible,.wbt-search-clear:focus-visible{outline:2px solid color-mix(in oklab,var(--wbt-accent) 55%,transparent);outline-offset:1px}",
|
|
7974
9227
|
".wbt-search{width:220px;max-width:46vw}",
|
|
@@ -7993,7 +9246,7 @@ var require_styles = __commonJS({
|
|
|
7993
9246
|
".wbt-crumb .sep{opacity:.35}",
|
|
7994
9247
|
".wbt-list{display:flex;flex-direction:column;gap:7px;min-height:0}",
|
|
7995
9248
|
".wbt-item{display:flex;gap:12px;align-items:flex-start;border:1px solid var(--wbt-line);border-radius:var(--wb-radius-card);background:var(--wbt-surface);padding:var(--wb-space-md);min-width:0;max-width:100%;box-sizing:border-box;min-height:0;overflow:hidden;overflow-wrap:anywhere;transition:border-color .14s ease,box-shadow .14s ease}",
|
|
7996
|
-
".wbt-item:hover{border-color:color-mix(in oklab,var(--wbt-accent) 30%,var(--wbt-line));box-shadow:0 2px 10px
|
|
9249
|
+
".wbt-item:hover{border-color:color-mix(in oklab,var(--wbt-accent) 30%,var(--wbt-line));box-shadow:0 2px 10px color-mix(in oklab,var(--wbt-accent) 10%,transparent)}",
|
|
7997
9250
|
".wbt-item.closed{opacity:.62}",
|
|
7998
9251
|
".wbt-item.closed .wbt-title{text-decoration:line-through}",
|
|
7999
9252
|
".wbt-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}",
|
|
@@ -8132,6 +9385,11 @@ var require_styles = __commonJS({
|
|
|
8132
9385
|
".wbt-tacts button.wbt-danger:hover{color:var(--dsw-alias-state-error-primary);background:color-mix(in oklab,var(--dsw-alias-state-error-primary) 12%,transparent)}",
|
|
8133
9386
|
"@keyframes wbt-fade{from{opacity:0}to{opacity:1}}",
|
|
8134
9387
|
"@keyframes wbt-slide{from{transform:translateX(-14px);opacity:.5}to{transform:none;opacity:1}}",
|
|
9388
|
+
/* 窄档整屏 sheet:遮罩变页面背景,表单占满可用高度,指纹区固定为内边距。 */
|
|
9389
|
+
".wbt-modal-mask.is-sheet{align-items:stretch;justify-content:stretch;padding:0;background:var(--wbt-bg)}",
|
|
9390
|
+
".wbt-modal.wbov-sheet{width:auto;max-width:none;max-height:none;height:100%;border:0;border-radius:0;box-shadow:none;padding:14px 14px calc(14px + env(safe-area-inset-bottom,0px))}",
|
|
9391
|
+
".wbt-modal.wbov-sheet .wbt-form{grid-template-columns:1fr}",
|
|
9392
|
+
".wbt-modal.wbov-sheet .wbt-modal-foot,.wbt-modal.wbov-sheet .wbt-formfoot{position:sticky;bottom:0;background:var(--wbt-bg);padding-top:10px}",
|
|
8135
9393
|
".wbt-modal-mask{position:fixed;inset:0;background:rgba(0,0,0,.28);z-index:1000;display:flex;align-items:center;justify-content:center;padding:16px}",
|
|
8136
9394
|
".wbt-modal{width:560px;max-width:96vw;max-height:90vh;overflow:auto;background-color:var(--wbt-bg);background-image:linear-gradient(var(--wbt-bg),var(--wbt-bg)),linear-gradient(var(--wbt-bg),var(--wbt-bg)),linear-gradient(var(--wbt-bg),var(--wbt-bg));-webkit-backdrop-filter:blur(30px) saturate(1.4);backdrop-filter:blur(30px) saturate(1.4);border:1px solid var(--wbt-line);border-radius:14px;box-shadow:0 20px 60px rgba(26,20,12,.3);padding:15px 17px;display:flex;flex-direction:column;gap:11px}",
|
|
8137
9395
|
".wbt-modal.wide{width:820px}",
|
|
@@ -8213,9 +9471,9 @@ var require_styles = __commonJS({
|
|
|
8213
9471
|
'.wbt-countdown .wbt-cd-num{font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}',
|
|
8214
9472
|
".wbt-countdown.soon{background:color-mix(in oklab,var(--dsw-alias-state-error-primary) 14%,transparent);border-color:color-mix(in oklab,var(--dsw-alias-state-error-primary) 32%,transparent)}",
|
|
8215
9473
|
".wbt-countdown.overdue{color:var(--dsw-alias-label-primary-inverted);background:var(--dsw-alias-state-error-primary);border-color:transparent}",
|
|
8216
|
-
"
|
|
8217
|
-
"
|
|
8218
|
-
"
|
|
9474
|
+
":where([data-wb-lt760]) .wbt-body{flex-direction:column;gap:8px}:where([data-wb-lt760]) .wbt-nav{flex-direction:row;width:100%;flex:0 0 auto;overflow-x:auto;border-right:none;border-bottom:1px solid var(--wbt-line);padding:0 0 6px}:where([data-wb-lt760]) .wbt-tab{width:auto;white-space:nowrap;padding:6px 9px}:where([data-wb-lt760]) .wbt-tab.on{box-shadow:inset 0 -2px 0 var(--wbt-accent)}:where([data-wb-lt760]) .wbt-nav-sep{width:1px;height:18px;flex:none;margin:auto 4px}:where([data-wb-lt760]) .wbt-tree-slot{flex:0 0 auto;width:auto;margin-right:0}:where([data-wb-lt760]) .wbt-pathrow .wbt-search{flex:1 1 160px;max-width:none}",
|
|
9475
|
+
":where([data-wb-lt760]) .wbt-filter-panel{width:100%;flex:0 0 auto;padding:8px;max-height:40%}:where([data-wb-lt760]) .wbt-filter-toggle{display:inline-flex}:where([data-wb-lt760]) .wbt-filter-panel:not(.expanded) .wbt-filter-content{display:none}:where([data-wb-lt760]) .wbt-filter-panel.expanded .wbt-filter-content{padding-top:10px}:where([data-wb-lt760]) .wbt-content{width:100%;box-sizing:border-box}",
|
|
9476
|
+
":where([data-wb-lt640]) .wbt-form{grid-template-columns:1fr}:where([data-wb-lt640]) .wbt-drawer{width:94vw}:where([data-wb-lt640]) .wbt-search{width:100%}:where([data-wb-lt640]) .wbt-item{padding:9px}:where([data-wb-lt640]) .wbt-ops{width:100%;justify-content:flex-end}",
|
|
8219
9477
|
// ── 插槽贡献:渲染在别的插件的界面里(如邮件详情动作条) ──
|
|
8220
9478
|
// 那里没有 .wbt-root,--wbt-* 变量不存在,所以每个变量都带主题变量兜底。
|
|
8221
9479
|
".wbt-metazone:empty{display:none}",
|
|
@@ -8230,8 +9488,38 @@ var require_styles = __commonJS({
|
|
|
8230
9488
|
".wbtx-slot-done{display:inline-flex;align-items:center;gap:8px;font-size:12px}",
|
|
8231
9489
|
".wbtx-slot-note{color:var(--wbt-muted,var(--wb-muted))}",
|
|
8232
9490
|
".wbtx-slot-link{border:0;background:transparent;padding:0;font:inherit;font-size:12px;color:var(--wbt-accent,var(--wb-accent));cursor:pointer;text-decoration:underline}",
|
|
8233
|
-
".wbt-mailback{font-size:11.5px;padding:2px 7px}"
|
|
8234
|
-
|
|
9491
|
+
".wbt-mailback{font-size:11.5px;padding:2px 7px}",
|
|
9492
|
+
// 窄档:一屏一件事 + 面板栈;底条留白由 sticky-bar 的 spacerStyle 提供。
|
|
9493
|
+
".wbtc{display:flex;flex-direction:column;min-height:0;flex:1;position:relative}",
|
|
9494
|
+
".wbtc-screen{display:flex;flex-direction:column;gap:10px;min-height:0;flex:1;padding-bottom:calc(64px + var(--wb-safe-bottom,0px))}",
|
|
9495
|
+
".wbtc-head{display:flex;align-items:center;gap:6px;min-width:0}",
|
|
9496
|
+
".wbtc-sum{font-size:12px;color:var(--wb-muted);white-space:nowrap}",
|
|
9497
|
+
".wbtc-crumbs{display:flex;min-width:0;flex:1;overflow:hidden}",
|
|
9498
|
+
".wbtc-desc{font-size:12px;color:var(--wb-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
9499
|
+
".wbtc-list{display:flex;flex-direction:column;gap:10px;min-height:0;flex:1}",
|
|
9500
|
+
".wbtc-sheet{display:flex;flex-direction:column;gap:8px;min-height:0;flex:1;overflow:auto}",
|
|
9501
|
+
".wbtc-sheet .wbt-filter-panel{width:100%;max-height:none;flex:1;border:0;padding:0}",
|
|
9502
|
+
".wbtc-sheet .wbt-filter-toggle{display:none}",
|
|
9503
|
+
".wbtc-foot-acts{display:flex;gap:8px;flex-wrap:wrap;align-items:center}",
|
|
9504
|
+
".wbtc-detail{display:flex;flex-direction:column;gap:10px;min-height:0;flex:1;overflow:auto}",
|
|
9505
|
+
".wbtc-pagerinfo{font-size:12px;color:var(--wb-muted);white-space:nowrap}",
|
|
9506
|
+
".wbtc-card{cursor:pointer;border:1px solid var(--wb-line);border-radius:10px;background:var(--wb-card);padding:10px 10px 9px}",
|
|
9507
|
+
// 长按快捷菜单:一列整行按钮,触屏上比网格好点。
|
|
9508
|
+
".wbtc-actions{display:flex;flex-direction:column;gap:8px;padding:4px 0 calc(8px + var(--wb-safe-bottom,0px))}",
|
|
9509
|
+
".wbtc-actions .wbt-btn{min-height:var(--wb-btn-toolbar,32px);justify-content:flex-start;padding:0 12px;font-size:14px}",
|
|
9510
|
+
".wbtc-card:hover{border-color:var(--wb-border)}",
|
|
9511
|
+
".wbtc-card-inner{display:flex;align-items:flex-start;gap:8px}",
|
|
9512
|
+
".wbtc-card-body{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}",
|
|
9513
|
+
".wbtc-card-top{display:flex;align-items:center;gap:6px;min-width:0}",
|
|
9514
|
+
".wbtc-card-title{min-width:0;flex:1;font-size:14px;font-weight:600;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}",
|
|
9515
|
+
".wbtc-card-desc{font-size:12px;color:var(--wb-muted);line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}",
|
|
9516
|
+
".wbtc-card-tags{display:flex;flex-wrap:wrap;gap:4px}",
|
|
9517
|
+
".wbtc-card-meta{display:flex;flex-wrap:wrap;gap:4px 10px;font-size:11px;color:var(--wb-muted)}",
|
|
9518
|
+
".wbtc-card-ws{max-width:14em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
9519
|
+
".wbtc-card-go{flex:none;display:flex;align-items:center;color:var(--wb-muted);padding-top:2px}",
|
|
9520
|
+
,
|
|
9521
|
+
require_overlay().sheetStyles
|
|
9522
|
+
].concat(require_filter_checklist_styles(), require_date_picker_styles()("wbt"), require_switch().styles, require_icon_toggle().styles, require_number_field().styles, require_stepper().styles, require_staged_dialog().styles, require_disclosure_styles(), require_panel_host().styles, require_sheet().styles, require_card_list().styles, require_sticky_bar().styles).join("\n");
|
|
8235
9523
|
}
|
|
8236
9524
|
});
|
|
8237
9525
|
|
|
@@ -8247,6 +9535,10 @@ var require_timeline_styles = __commonJS({
|
|
|
8247
9535
|
".wbt-timeline-toolbar-main .wbt-timeline-search{flex:1 1 220px;min-width:0}",
|
|
8248
9536
|
".wbt-timeline-toolbar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto}",
|
|
8249
9537
|
".wbt-timeline-columns{display:grid;grid-template-columns:minmax(240px,32%) minmax(0,1fr);gap:12px;align-items:start}",
|
|
9538
|
+
/* 窄档:两列改上下,列表按内容高度、成员占剩余空间,各自滚动。 */
|
|
9539
|
+
".wbt-compact .wbt-timeline-columns{display:flex;flex-direction:column;gap:12px}",
|
|
9540
|
+
".wbt-compact .wbt-timeline-left,.wbt-compact .wbt-timeline-right{width:100%;padding:12px}",
|
|
9541
|
+
".wbt-compact .wbt-timeline-list{max-height:45vh}",
|
|
8250
9542
|
".wbt-timeline-left,.wbt-timeline-right{min-width:0;border:1px solid var(--wbt-line);border-radius:var(--wb-radius-card,10px);padding:12px}",
|
|
8251
9543
|
".wbt-timeline-search input{min-width:0;flex:1}",
|
|
8252
9544
|
".wbt-timeline-list{max-height:840px;overflow:auto;overscroll-behavior:contain}.wbt-timeline-left>.wbt-timeline-list,.wbt-timeline-left>.wbt-err{margin-top:2px}.wbt-timeline-view .wbt-timeline-option{position:relative;box-sizing:border-box;min-height:56px;padding:10px 12px;border:0;border-bottom:1px solid var(--wbt-line);border-radius:var(--wb-radius-sm,6px);display:flex;flex-direction:column;gap:4px;cursor:pointer;color:inherit;background:transparent;background-image:none}",
|
|
@@ -8267,8 +9559,8 @@ var require_timeline_styles = __commonJS({
|
|
|
8267
9559
|
".wbt-modal.wide.wbt-timeline-modal{display:flex;flex-direction:column;max-height:90vh;overflow:hidden}.wbt-timeline-modal-body{min-height:0;overflow:auto;flex:1;padding:12px}.wbt-timeline-member-section{min-width:0;margin-top:12px}.wbt-timeline-member-scroll{max-height:40vh;overflow:auto;overscroll-behavior:contain}.wbt-timeline-pick{border-top:1px solid var(--wbt-line);padding-top:12px;margin-top:12px}.wbt-timeline-empty{padding:12px 0}.wbt-picker-selected{font-size:12px;margin:6px 0;min-height:16px}.wbt-picker-list{max-height:220px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--wbt-line);border-radius:var(--wb-radius-sm,6px);padding:4px;background:var(--wbt-surface)}.wbt-picker-note{margin:6px;font-size:12px;opacity:.7}.wbt-picker-opt{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:6px 8px;border:0;border-radius:var(--wb-radius-sm,6px);background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.wbt-picker-opt:hover,.wbt-picker-opt:focus-visible{background:color-mix(in oklab,var(--wbt-accent) 12%,transparent)}.wbt-picker-opt:focus-visible{outline:2px solid var(--wbt-accent);outline-offset:-2px}.wbt-picker-opt.selected{background:color-mix(in oklab,var(--wbt-accent) 16%,transparent);font-weight:600}.wbt-picker-opt-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wbt-picker-opt-count{font-size:11px;opacity:.6;white-space:nowrap}.wbt-timeline-confirm{padding:12px;border:1px solid var(--wbt-line);border-radius:var(--wb-radius-card,10px);margin:8px 0;line-height:1.6;background:var(--wbt-surface)}.wbt-timeline-confirm .wbt-btn{margin:8px 8px 0 0}",
|
|
8268
9560
|
".wbt-timeline-desc.expanded{max-height:none}.wbt-timeline-selected{min-width:0;overflow-wrap:anywhere;flex:1}.wbt-modal-foot.wbt-timeline-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;flex:none}.wbt-timeline-modal .wbt-empty{padding:12px;margin:8px 0;border:1px solid var(--wbt-line);border-radius:var(--wb-radius-card,10px);background:var(--wbt-surface);line-height:1.6}",
|
|
8269
9561
|
// 窄屏:搜索独占一行,操作按钮靠左并允许换行,避免「刷新」被推出屏幕。
|
|
8270
|
-
"
|
|
8271
|
-
"
|
|
9562
|
+
":where([data-wb-lt600]) .wbt-timeline-toolbar{flex-direction:column;align-items:stretch}:where([data-wb-lt600]) .wbt-timeline-toolbar-main{flex:1 1 100%}:where([data-wb-lt600]) .wbt-timeline-toolbar-main .wbt-timeline-search{flex:1 1 100%}:where([data-wb-lt600]) .wbt-timeline-toolbar-actions{margin-left:0;justify-content:flex-start;gap:6px}:where([data-wb-lt600]) .wbt-timeline-toolbar-actions .wbt-btn{padding-left:10px;padding-right:10px}",
|
|
9563
|
+
":where([data-wb-lt720]) .wbt-timeline-selected{flex:1 1 100%}:where([data-wb-lt720]) .wbt-picker-list{max-height:180px}:where([data-wb-lt720]) wbt-timeline-toolbar-main{flex:1 1 100%}:where([data-wb-lt720]) .wbt-timeline-toolbar-actions{flex:1 1 100%;justify-content:flex-end;margin-left:0}:where([data-wb-lt720]) .wbt-timeline-list{max-height:320px}:where([data-wb-lt720]) .wbt-timeline-toolbar{flex-wrap:wrap}:where([data-wb-lt720]) .wbt-timeline-member-row{grid-template-columns:76px 8px minmax(0,1fr) auto 28px;gap:4px}:where([data-wb-lt720]) .wbt-timeline-left, :where([data-wb-lt720]) .wbt-timeline-right{padding:12px}:where([data-wb-lt720]) .wbt-timeline-date{font-size:10.5px}:where([data-wb-lt720]) .wbt-timeline-member-row>.wbt-badge{font-size:10.5px;padding:2px 4px}:where([data-wb-lt720]) .wbt-timeline-actions>.wbt-act-del{margin-left:0}:where([data-wb-lt720]) .wbt-timeline-id{max-width:140px}"
|
|
8272
9564
|
].join("\n");
|
|
8273
9565
|
}
|
|
8274
9566
|
});
|
|
@@ -11186,65 +12478,9 @@ var require_claim_batch = __commonJS({
|
|
|
11186
12478
|
}
|
|
11187
12479
|
});
|
|
11188
12480
|
|
|
11189
|
-
// packages/addons/
|
|
11190
|
-
var
|
|
11191
|
-
"packages/addons/
|
|
11192
|
-
"use strict";
|
|
11193
|
-
module2.exports = function renderSelectionBar(h, Icon2, p) {
|
|
11194
|
-
var t = p.t;
|
|
11195
|
-
return h(
|
|
11196
|
-
"div",
|
|
11197
|
-
{ className: "wbt-selbar" },
|
|
11198
|
-
h("b", null, t.selected + " " + p.count),
|
|
11199
|
-
h("button", { className: "wbt-btn", onClick: p.openSelected }, t.selectedTasks),
|
|
11200
|
-
h("button", { className: "wbt-btn", onClick: p.batchTimeline }, t.batchTimeline),
|
|
11201
|
-
h("button", { className: "wbt-btn", onClick: p.batchMigrate }, t.batchMigrate),
|
|
11202
|
-
h("button", { className: "wbt-btn", onClick: p.claimSelected }, t.claimSelected),
|
|
11203
|
-
h("button", { className: "wbt-btn wbt-act-del", onClick: p.batchDelete }, h(Icon2, { name: "trash", size: 13 }), t.batchDelete),
|
|
11204
|
-
h("button", { className: "wbt-btn ghost", onClick: p.clear }, t.clear)
|
|
11205
|
-
);
|
|
11206
|
-
};
|
|
11207
|
-
}
|
|
11208
|
-
});
|
|
11209
|
-
|
|
11210
|
-
// packages/addons/tasks/client/modals/task-preview.cjs
|
|
11211
|
-
var require_task_preview = __commonJS({
|
|
11212
|
-
"packages/addons/tasks/client/modals/task-preview.cjs"(exports2, module2) {
|
|
11213
|
-
"use strict";
|
|
11214
|
-
var createOverlay = require_overlay();
|
|
11215
|
-
module2.exports = function createTaskPreview(React, TaskItem) {
|
|
11216
|
-
var h = React.createElement;
|
|
11217
|
-
var Overlay = createOverlay({
|
|
11218
|
-
maskClass: "wbt-modal-mask",
|
|
11219
|
-
dialogClass: "wbt-modal wide wbt-preview",
|
|
11220
|
-
ariaLabelledByOf: function() {
|
|
11221
|
-
return "wbt-preview-title";
|
|
11222
|
-
},
|
|
11223
|
-
// 关闭按钮自己带 autoFocus,外壳不要抢首焦点。
|
|
11224
|
-
autoFocusDialog: false
|
|
11225
|
-
});
|
|
11226
|
-
function TaskPreview(props) {
|
|
11227
|
-
var t = props.t, task = props.task;
|
|
11228
|
-
return h(
|
|
11229
|
-
Overlay,
|
|
11230
|
-
{ onClose: props.onClose, autoFocus: false },
|
|
11231
|
-
h(
|
|
11232
|
-
"div",
|
|
11233
|
-
{ className: "wbt-modal-head wbt-preview-head" },
|
|
11234
|
-
h("h3", { id: "wbt-preview-title" }, String(task.title || "").trim() || t.previewUntitled),
|
|
11235
|
-
h("button", { type: "button", className: "wbt-icon", title: t.close, "aria-label": t.close, autoFocus: true, onClick: props.onClose }, "\xD7")
|
|
11236
|
-
),
|
|
11237
|
-
h("div", { className: "wbt-preview-body" }, h(TaskItem, props.cardProps))
|
|
11238
|
-
);
|
|
11239
|
-
}
|
|
11240
|
-
return TaskPreview;
|
|
11241
|
-
};
|
|
11242
|
-
}
|
|
11243
|
-
});
|
|
11244
|
-
|
|
11245
|
-
// packages/addons/lib/client/query.cjs
|
|
11246
|
-
var require_query = __commonJS({
|
|
11247
|
-
"packages/addons/lib/client/query.cjs"(exports2, module2) {
|
|
12481
|
+
// packages/addons/lib/client/query.cjs
|
|
12482
|
+
var require_query = __commonJS({
|
|
12483
|
+
"packages/addons/lib/client/query.cjs"(exports2, module2) {
|
|
11248
12484
|
"use strict";
|
|
11249
12485
|
var React = require("react");
|
|
11250
12486
|
var DEFAULT_STALE_TIME = 0;
|
|
@@ -11793,608 +13029,992 @@ var require_query = __commonJS({
|
|
|
11793
13029
|
}
|
|
11794
13030
|
});
|
|
11795
13031
|
|
|
11796
|
-
// packages/addons/tasks/client/views/tasks-
|
|
11797
|
-
var
|
|
11798
|
-
"packages/addons/tasks/client/views/tasks-
|
|
11799
|
-
|
|
11800
|
-
var
|
|
11801
|
-
|
|
11802
|
-
|
|
13032
|
+
// packages/addons/tasks/client/views/layouts/tasks-state.cjs
|
|
13033
|
+
var require_tasks_state = __commonJS({
|
|
13034
|
+
"packages/addons/tasks/client/views/layouts/tasks-state.cjs"(exports2, module2) {
|
|
13035
|
+
function expandedByDepth(nodes, depth) {
|
|
13036
|
+
var out = /* @__PURE__ */ new Set();
|
|
13037
|
+
(function walk(list, d) {
|
|
13038
|
+
(list || []).forEach(function(n) {
|
|
13039
|
+
if (d >= depth || !n.children || !n.children.length) return;
|
|
13040
|
+
out.add(String(n.id));
|
|
13041
|
+
walk(n.children, d + 1);
|
|
13042
|
+
});
|
|
13043
|
+
})(nodes, 0);
|
|
13044
|
+
return out;
|
|
13045
|
+
}
|
|
13046
|
+
module2.exports = function useTasksState(ctx) {
|
|
13047
|
+
var React = ctx.React;
|
|
13048
|
+
var api = ctx.api;
|
|
13049
|
+
var cfg = ctx.cfg || {};
|
|
13050
|
+
var viewParams = ctx.viewParams;
|
|
13051
|
+
var lang = ctx.lang === "en" ? "en" : "zh";
|
|
13052
|
+
var compact = ctx.compact === true;
|
|
13053
|
+
var t = ctx.t;
|
|
13054
|
+
var allTables = ctx.allTables;
|
|
13055
|
+
var treeWalk = ctx.treeWalk;
|
|
13056
|
+
var cx = ctx.cx;
|
|
13057
|
+
var Icon2 = ctx.Icon;
|
|
13058
|
+
var TreeNode = ctx.TreeNode;
|
|
13059
|
+
var TagFilter = ctx.TagFilter;
|
|
13060
|
+
var injectCss = ctx.injectCss;
|
|
13061
|
+
var h = React.createElement;
|
|
13062
|
+
var filters = require_task_filter_model();
|
|
13063
|
+
var renderFilters = require_task_filter_panel();
|
|
13064
|
+
var claimBatch = require_claim_batch();
|
|
11803
13065
|
var SW = require_switch();
|
|
11804
13066
|
var Query = require_query();
|
|
11805
|
-
var
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
|
|
11810
|
-
|
|
11811
|
-
|
|
11812
|
-
|
|
11813
|
-
|
|
11814
|
-
|
|
11815
|
-
|
|
11816
|
-
|
|
11817
|
-
|
|
11818
|
-
|
|
11819
|
-
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
11823
|
-
|
|
11824
|
-
|
|
11825
|
-
|
|
11826
|
-
|
|
11827
|
-
|
|
11828
|
-
|
|
11829
|
-
|
|
11830
|
-
|
|
11831
|
-
|
|
11832
|
-
|
|
11833
|
-
|
|
11834
|
-
|
|
11835
|
-
|
|
11836
|
-
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
|
|
11871
|
-
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
|
|
11876
|
-
|
|
11877
|
-
|
|
11878
|
-
|
|
11879
|
-
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
11884
|
-
|
|
11885
|
-
|
|
11886
|
-
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
|
|
11896
|
-
|
|
11897
|
-
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
11907
|
-
|
|
11908
|
-
|
|
11909
|
-
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
|
|
11913
|
-
|
|
11914
|
-
|
|
11915
|
-
|
|
11916
|
-
|
|
11917
|
-
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
|
|
11921
|
-
|
|
11922
|
-
|
|
11923
|
-
|
|
11924
|
-
var timelineReload = timelineReloadS[0], setTimelineReload = timelineReloadS[1];
|
|
11925
|
-
var editS = React.useState(null);
|
|
11926
|
-
var edit = editS[0], setEdit = editS[1];
|
|
11927
|
-
var nodeModalS = React.useState(null);
|
|
11928
|
-
var nodeModal = nodeModalS[0], setNodeModal = nodeModalS[1];
|
|
11929
|
-
var editNameS = React.useState("");
|
|
11930
|
-
var editName = editNameS[0], setEditName = editNameS[1];
|
|
11931
|
-
var dragS = React.useState(null);
|
|
11932
|
-
var dragId = dragS[0], setDragId = dragS[1];
|
|
11933
|
-
var dropS = React.useState(null);
|
|
11934
|
-
var dropId = dropS[0], setDropId = dropS[1];
|
|
11935
|
-
var toastS = React.useState("");
|
|
11936
|
-
var toast = toastS[0], setToast = toastS[1];
|
|
11937
|
-
var refreshRef = React.useRef({}), initialNavigation = React.useRef(true);
|
|
11938
|
-
React.useEffect(function() {
|
|
11939
|
-
if (initialNavigation.current) {
|
|
11940
|
-
initialNavigation.current = false;
|
|
11941
|
-
if (storedFilters || taskNavigation) return;
|
|
11942
|
-
}
|
|
11943
|
-
if (taskNavigation) {
|
|
11944
|
-
setSearchDraft(taskNavigation);
|
|
11945
|
-
setTitleKey(taskNavigation);
|
|
11946
|
-
setFilterValue(filters.empty());
|
|
11947
|
-
setTarget({ groupId: "1", tableId: null });
|
|
11948
|
-
setDifficultyMissing(false);
|
|
11949
|
-
setFilterHint("");
|
|
11950
|
-
setFilterTagIds([]);
|
|
11951
|
-
setPageNumber(1);
|
|
11952
|
-
setSelectedIds(/* @__PURE__ */ new Set());
|
|
11953
|
-
setSelectionMode(false);
|
|
11954
|
-
return;
|
|
11955
|
-
}
|
|
11956
|
-
if (!activityNavigation && !nodeNavigation) return;
|
|
11957
|
-
setFilterValue(activityNavigation || defaultPreset || filters.empty());
|
|
11958
|
-
setTarget(tableNavigation ? { tableId: String(tableNavigation), groupId: props.viewParams.groupId } : { groupId: groupNavigation ? String(groupNavigation) : "1", tableId: null });
|
|
13067
|
+
var activityNavigation = filters.navigation(viewParams);
|
|
13068
|
+
var taskNavigation = filters.taskNavigation(viewParams);
|
|
13069
|
+
var tableNavigation = !activityNavigation && viewParams && viewParams.tableId;
|
|
13070
|
+
var groupNavigation = !activityNavigation && !tableNavigation && viewParams && viewParams.groupId;
|
|
13071
|
+
var nodeNavigation = tableNavigation || groupNavigation;
|
|
13072
|
+
var cfgSize = Math.floor(Number(cfg["list.pageSize"]));
|
|
13073
|
+
if (!(cfgSize > 0)) cfgSize = 12;
|
|
13074
|
+
var cfgDepth = Math.floor(Number(cfg["ui.expandDepth"]));
|
|
13075
|
+
if (!(cfgDepth >= 0)) cfgDepth = 2;
|
|
13076
|
+
var cfgSort = typeof cfg["list.sort"] === "string" ? cfg["list.sort"] : "auto";
|
|
13077
|
+
var cfgConfirm = cfg["ui.confirmDelete"] !== false;
|
|
13078
|
+
var treeS = React.useState([]);
|
|
13079
|
+
var tree = treeS[0], setTree = treeS[1];
|
|
13080
|
+
var expS = React.useState(/* @__PURE__ */ new Set());
|
|
13081
|
+
var expanded = expS[0], setExpanded = expS[1];
|
|
13082
|
+
var expInitRef = React.useRef(false);
|
|
13083
|
+
var targetS = React.useState(taskNavigation ? { groupId: "1", tableId: null } : tableNavigation ? { tableId: String(tableNavigation), groupId: viewParams.groupId } : { groupId: groupNavigation ? String(groupNavigation) : "1", tableId: null });
|
|
13084
|
+
var target = targetS[0], setTarget = targetS[1];
|
|
13085
|
+
var pathS = React.useState([]);
|
|
13086
|
+
var currentPath = pathS[0], setCurrentPath = pathS[1];
|
|
13087
|
+
var storedFilters = taskNavigation ? null : filters.load(viewParams);
|
|
13088
|
+
var initialMissing = taskNavigation ? false : storedFilters ? storedFilters.missing : !activityNavigation && !nodeNavigation && !!(viewParams && viewParams.difficultyMissing === true);
|
|
13089
|
+
var missingS = React.useState(initialMissing);
|
|
13090
|
+
var difficultyMissing = missingS[0], setDifficultyMissing = missingS[1];
|
|
13091
|
+
var defaultPreset = filters.presetValue(cfg["ui.defaultPreset"]);
|
|
13092
|
+
var filterState = React.useState(taskNavigation ? filters.empty() : storedFilters && storedFilters.value || activityNavigation || defaultPreset || filters.empty());
|
|
13093
|
+
var filterValue = filterState[0], setFilterValue = filterState[1];
|
|
13094
|
+
React.useEffect(function() {
|
|
13095
|
+
filters.save(filterValue, difficultyMissing, viewParams);
|
|
13096
|
+
}, [filterValue, difficultyMissing, JSON.stringify(viewParams || {})]);
|
|
13097
|
+
var panelState = React.useState(false), panelOpen = panelState[0], setPanelOpen = panelState[1];
|
|
13098
|
+
var hintState = React.useState(""), filterHint = hintState[0], setFilterHint = hintState[1];
|
|
13099
|
+
var panelId = React.useId();
|
|
13100
|
+
var searchS = React.useState(taskNavigation || "");
|
|
13101
|
+
var searchDraft = searchS[0], setSearchDraft = searchS[1];
|
|
13102
|
+
var tqS = React.useState("");
|
|
13103
|
+
var treeQuery = tqS[0], setTreeQuery = tqS[1];
|
|
13104
|
+
var titleS = React.useState(taskNavigation || "");
|
|
13105
|
+
var titleKey = titleS[0], setTitleKey = titleS[1];
|
|
13106
|
+
var tagReloadS = React.useState(0);
|
|
13107
|
+
var tagReload = tagReloadS[0], setTagReload = tagReloadS[1];
|
|
13108
|
+
var filterTagIdsS = React.useState([]);
|
|
13109
|
+
var filterTagIds = filterTagIdsS[0], setFilterTagIds = filterTagIdsS[1];
|
|
13110
|
+
var pageS = React.useState(1);
|
|
13111
|
+
var pageNumber = pageS[0], setPageNumber = pageS[1];
|
|
13112
|
+
var sizeS = React.useState(cfgSize);
|
|
13113
|
+
var pageSize = sizeS[0], setPageSize = sizeS[1];
|
|
13114
|
+
var listQ = Query.useQuery(React, api, {
|
|
13115
|
+
action: "tasks.list",
|
|
13116
|
+
args: Object.assign({
|
|
13117
|
+
titleKey,
|
|
13118
|
+
tableId: target.tableId,
|
|
13119
|
+
groupId: target.tableId ? null : target.groupId,
|
|
13120
|
+
pageNumber,
|
|
13121
|
+
pageSize,
|
|
13122
|
+
tagIds: filterTagIds,
|
|
13123
|
+
difficultyMissing,
|
|
13124
|
+
sort: nodeNavigation || cfgSort === "auto" ? void 0 : cfgSort
|
|
13125
|
+
}, filters.args(filterValue)),
|
|
13126
|
+
invalidateOn: [{ event: "tasks-changed" }, { event: "task-workspaces-changed" }]
|
|
13127
|
+
});
|
|
13128
|
+
var data = listQ.data || { records: [], total: 0, current: 1, size: 0, pageable: false };
|
|
13129
|
+
var loading = listQ.loading;
|
|
13130
|
+
var treeErrorS = React.useState("");
|
|
13131
|
+
var error = listQ.error || treeErrorS[0];
|
|
13132
|
+
var setError = treeErrorS[1];
|
|
13133
|
+
var refreshList = function() {
|
|
13134
|
+
return listQ.refetch();
|
|
13135
|
+
};
|
|
13136
|
+
var drawerS = React.useState(false);
|
|
13137
|
+
var drawer = drawerS[0], setDrawer = drawerS[1];
|
|
13138
|
+
var managerS = React.useState(false);
|
|
13139
|
+
var manager = managerS[0], setManager = managerS[1];
|
|
13140
|
+
var selModeS = React.useState(false);
|
|
13141
|
+
var selectionMode = selModeS[0], setSelectionMode = selModeS[1];
|
|
13142
|
+
var selS = React.useState(/* @__PURE__ */ new Set());
|
|
13143
|
+
var selectedIds = selS[0], setSelectedIds = selS[1];
|
|
13144
|
+
var selItemsS = React.useState([]);
|
|
13145
|
+
var selectedItems = selItemsS[0], setSelectedItems = selItemsS[1];
|
|
13146
|
+
var selOpenS = React.useState(false);
|
|
13147
|
+
var selectedOpen = selOpenS[0], setSelectedOpen = selOpenS[1];
|
|
13148
|
+
var batchS = React.useState(null);
|
|
13149
|
+
var batchMode = batchS[0], setBatchMode = batchS[1];
|
|
13150
|
+
var createS = React.useState(null);
|
|
13151
|
+
var createState = createS[0], setCreateState = createS[1];
|
|
13152
|
+
var timelineS = React.useState(null);
|
|
13153
|
+
var timelineTask = timelineS[0], setTimelineTask = timelineS[1];
|
|
13154
|
+
var doneS = React.useState(null);
|
|
13155
|
+
var doneTask = doneS[0], setDoneTask = doneS[1];
|
|
13156
|
+
var editTaskS = React.useState(null);
|
|
13157
|
+
var editTask = editTaskS[0], setEditTask = editTaskS[1];
|
|
13158
|
+
var timelinePreviewS = React.useState(null);
|
|
13159
|
+
var timelinePreview = timelinePreviewS[0], setTimelinePreview = timelinePreviewS[1];
|
|
13160
|
+
var timelineTrigger = React.useRef(null);
|
|
13161
|
+
var timelineReloadS = React.useState(0);
|
|
13162
|
+
var timelineReload = timelineReloadS[0], setTimelineReload = timelineReloadS[1];
|
|
13163
|
+
var editS = React.useState(null);
|
|
13164
|
+
var edit = editS[0], setEdit = editS[1];
|
|
13165
|
+
var nodeModalS = React.useState(null);
|
|
13166
|
+
var nodeModal = nodeModalS[0], setNodeModal = nodeModalS[1];
|
|
13167
|
+
var editNameS = React.useState("");
|
|
13168
|
+
var editName = editNameS[0], setEditName = editNameS[1];
|
|
13169
|
+
var dragS = React.useState(null);
|
|
13170
|
+
var dragId = dragS[0], setDragId = dragS[1];
|
|
13171
|
+
var dropS = React.useState(null);
|
|
13172
|
+
var dropId = dropS[0], setDropId = dropS[1];
|
|
13173
|
+
var toastS = React.useState("");
|
|
13174
|
+
var toast = toastS[0], setToast = toastS[1];
|
|
13175
|
+
var refreshRef = React.useRef({}), initialNavigation = React.useRef(true);
|
|
13176
|
+
React.useEffect(function() {
|
|
13177
|
+
if (initialNavigation.current) {
|
|
13178
|
+
initialNavigation.current = false;
|
|
13179
|
+
if (storedFilters || taskNavigation) return;
|
|
13180
|
+
}
|
|
13181
|
+
if (taskNavigation) {
|
|
13182
|
+
setSearchDraft(taskNavigation);
|
|
13183
|
+
setTitleKey(taskNavigation);
|
|
13184
|
+
setFilterValue(filters.empty());
|
|
13185
|
+
setTarget({ groupId: "1", tableId: null });
|
|
11959
13186
|
setDifficultyMissing(false);
|
|
11960
13187
|
setFilterHint("");
|
|
11961
|
-
setSearchDraft("");
|
|
11962
|
-
setTitleKey("");
|
|
11963
13188
|
setFilterTagIds([]);
|
|
11964
13189
|
setPageNumber(1);
|
|
11965
13190
|
setSelectedIds(/* @__PURE__ */ new Set());
|
|
11966
13191
|
setSelectionMode(false);
|
|
11967
|
-
|
|
11968
|
-
function say(msg) {
|
|
11969
|
-
setToast(String(msg || ""));
|
|
13192
|
+
return;
|
|
11970
13193
|
}
|
|
11971
|
-
|
|
11972
|
-
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
|
|
11982
|
-
|
|
11983
|
-
|
|
11984
|
-
|
|
11985
|
-
|
|
11986
|
-
|
|
11987
|
-
|
|
11988
|
-
|
|
11989
|
-
|
|
11990
|
-
|
|
11991
|
-
|
|
11992
|
-
|
|
11993
|
-
|
|
11994
|
-
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
|
|
13194
|
+
if (!activityNavigation && !nodeNavigation) return;
|
|
13195
|
+
setFilterValue(activityNavigation || defaultPreset || filters.empty());
|
|
13196
|
+
setTarget(tableNavigation ? { tableId: String(tableNavigation), groupId: viewParams.groupId } : { groupId: groupNavigation ? String(groupNavigation) : "1", tableId: null });
|
|
13197
|
+
setDifficultyMissing(false);
|
|
13198
|
+
setFilterHint("");
|
|
13199
|
+
setSearchDraft("");
|
|
13200
|
+
setTitleKey("");
|
|
13201
|
+
setFilterTagIds([]);
|
|
13202
|
+
setPageNumber(1);
|
|
13203
|
+
setSelectedIds(/* @__PURE__ */ new Set());
|
|
13204
|
+
setSelectionMode(false);
|
|
13205
|
+
}, [JSON.stringify(viewParams || {})]);
|
|
13206
|
+
function say(msg) {
|
|
13207
|
+
setToast(String(msg || ""));
|
|
13208
|
+
}
|
|
13209
|
+
React.useEffect(function() {
|
|
13210
|
+
if (!toast) return;
|
|
13211
|
+
var id = setTimeout(function() {
|
|
13212
|
+
setToast("");
|
|
13213
|
+
}, 3200);
|
|
13214
|
+
return function() {
|
|
13215
|
+
clearTimeout(id);
|
|
13216
|
+
};
|
|
13217
|
+
}, [toast]);
|
|
13218
|
+
var treeSearchRef = React.useRef(null);
|
|
13219
|
+
React.useEffect(function() {
|
|
13220
|
+
if (!drawer) return;
|
|
13221
|
+
var id = setTimeout(function() {
|
|
13222
|
+
if (treeSearchRef.current) treeSearchRef.current.focus();
|
|
13223
|
+
}, 40);
|
|
13224
|
+
function onKey(e) {
|
|
13225
|
+
if (e.key === "Escape") setDrawer(false);
|
|
13226
|
+
}
|
|
13227
|
+
window.addEventListener("keydown", onKey);
|
|
13228
|
+
return function() {
|
|
13229
|
+
clearTimeout(id);
|
|
13230
|
+
window.removeEventListener("keydown", onKey);
|
|
13231
|
+
};
|
|
13232
|
+
}, [drawer]);
|
|
13233
|
+
var refreshTree = React.useCallback(function() {
|
|
13234
|
+
return api.call("taskNodes.tree").then(function(r) {
|
|
13235
|
+
if (r && r.ok) {
|
|
13236
|
+
var nodes = Array.isArray(r.result) ? r.result : [];
|
|
13237
|
+
setTree(nodes);
|
|
13238
|
+
if (!expInitRef.current) {
|
|
13239
|
+
let reveal2 = function(list, parents) {
|
|
13240
|
+
(list || []).forEach(function(n) {
|
|
13241
|
+
if (String(n.id) === String(nodeNavigation)) parents.forEach(function(id) {
|
|
13242
|
+
open.add(id);
|
|
12007
13243
|
});
|
|
12008
|
-
|
|
12009
|
-
|
|
12010
|
-
|
|
12011
|
-
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
}).catch(function(e) {
|
|
12017
|
-
setError(String(e && e.message || e));
|
|
12018
|
-
});
|
|
12019
|
-
}, [api]);
|
|
12020
|
-
var refreshTagNav = React.useCallback(function() {
|
|
12021
|
-
setTagReload(function(n) {
|
|
12022
|
-
return n + 1;
|
|
12023
|
-
});
|
|
12024
|
-
}, []);
|
|
12025
|
-
var refreshPath = React.useCallback(function(id) {
|
|
12026
|
-
if (!id) {
|
|
12027
|
-
setCurrentPath([]);
|
|
12028
|
-
return Promise.resolve();
|
|
12029
|
-
}
|
|
12030
|
-
return api.call("taskNodes.path", { id }).then(function(r) {
|
|
12031
|
-
if (r && r.ok) setCurrentPath(Array.isArray(r.result) ? r.result : []);
|
|
12032
|
-
}).catch(function() {
|
|
12033
|
-
});
|
|
12034
|
-
}, [api]);
|
|
12035
|
-
refreshRef.current = { tree: refreshTree, list: refreshList, path: refreshPath, tags: refreshTagNav };
|
|
12036
|
-
React.useEffect(function() {
|
|
12037
|
-
injectCss();
|
|
12038
|
-
refreshTree();
|
|
12039
|
-
refreshTagNav();
|
|
12040
|
-
refreshPath("1");
|
|
12041
|
-
}, [refreshTree, refreshTagNav, refreshPath]);
|
|
12042
|
-
React.useEffect(function() {
|
|
12043
|
-
var off = api.subscribe(function(p) {
|
|
12044
|
-
if (!p) return;
|
|
12045
|
-
if (p.event === "tasks-changed") refreshRef.current.tags();
|
|
12046
|
-
if (p.event === "task-nodes-changed") {
|
|
12047
|
-
refreshRef.current.tree();
|
|
12048
|
-
refreshRef.current.path(target.tableId || target.groupId);
|
|
13244
|
+
reveal2(n.children, parents.concat(String(n.id)));
|
|
13245
|
+
});
|
|
13246
|
+
};
|
|
13247
|
+
var reveal = reveal2;
|
|
13248
|
+
expInitRef.current = true;
|
|
13249
|
+
var open = expandedByDepth(nodes, cfgDepth);
|
|
13250
|
+
if (nodeNavigation) reveal2(nodes, []);
|
|
13251
|
+
setExpanded(open);
|
|
12049
13252
|
}
|
|
12050
|
-
});
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
|
|
12056
|
-
function
|
|
12057
|
-
|
|
12058
|
-
|
|
12059
|
-
|
|
12060
|
-
|
|
12061
|
-
|
|
13253
|
+
} else setError(r && r.error || "tree load failed");
|
|
13254
|
+
}).catch(function(e) {
|
|
13255
|
+
setError(String(e && e.message || e));
|
|
13256
|
+
});
|
|
13257
|
+
}, [api]);
|
|
13258
|
+
var refreshTagNav = React.useCallback(function() {
|
|
13259
|
+
setTagReload(function(n) {
|
|
13260
|
+
return n + 1;
|
|
13261
|
+
});
|
|
13262
|
+
}, []);
|
|
13263
|
+
var refreshPath = React.useCallback(function(id) {
|
|
13264
|
+
if (!id) {
|
|
13265
|
+
setCurrentPath([]);
|
|
13266
|
+
return Promise.resolve();
|
|
12062
13267
|
}
|
|
12063
|
-
|
|
12064
|
-
if (
|
|
12065
|
-
|
|
12066
|
-
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
|
|
12070
|
-
|
|
12071
|
-
|
|
12072
|
-
|
|
12073
|
-
|
|
12074
|
-
|
|
13268
|
+
return api.call("taskNodes.path", { id }).then(function(r) {
|
|
13269
|
+
if (r && r.ok) setCurrentPath(Array.isArray(r.result) ? r.result : []);
|
|
13270
|
+
}).catch(function() {
|
|
13271
|
+
});
|
|
13272
|
+
}, [api]);
|
|
13273
|
+
refreshRef.current = { tree: refreshTree, list: refreshList, path: refreshPath, tags: refreshTagNav };
|
|
13274
|
+
React.useEffect(function() {
|
|
13275
|
+
injectCss();
|
|
13276
|
+
refreshTree();
|
|
13277
|
+
refreshTagNav();
|
|
13278
|
+
refreshPath("1");
|
|
13279
|
+
}, [refreshTree, refreshTagNav, refreshPath]);
|
|
13280
|
+
React.useEffect(function() {
|
|
13281
|
+
var off = api.subscribe(function(p) {
|
|
13282
|
+
if (!p) return;
|
|
13283
|
+
if (p.event === "tasks-changed") refreshRef.current.tags();
|
|
13284
|
+
if (p.event === "task-nodes-changed") {
|
|
13285
|
+
refreshRef.current.tree();
|
|
13286
|
+
refreshRef.current.path(target.tableId || target.groupId);
|
|
12075
13287
|
}
|
|
12076
|
-
|
|
13288
|
+
});
|
|
13289
|
+
return off;
|
|
13290
|
+
}, [api, target.tableId, target.groupId]);
|
|
13291
|
+
React.useEffect(function() {
|
|
13292
|
+
refreshPath(target.tableId || target.groupId);
|
|
13293
|
+
}, [target.tableId, target.groupId, refreshPath]);
|
|
13294
|
+
function update(task, patch) {
|
|
13295
|
+
var args = Object.assign({ id: task.id }, patch);
|
|
13296
|
+
api.call("tasks.update", args).then(function(r) {
|
|
13297
|
+
if (r && r.ok) refreshList();
|
|
13298
|
+
else say(r && r.error || "update failed");
|
|
13299
|
+
});
|
|
13300
|
+
}
|
|
13301
|
+
function pickNode(node) {
|
|
13302
|
+
if (String(node.type) === "1") setTarget({ groupId: String(node.parent || node.parentId || ""), tableId: String(node.id) });
|
|
13303
|
+
else setTarget({ groupId: String(node.id), tableId: null });
|
|
13304
|
+
setPageNumber(1);
|
|
13305
|
+
setDrawer(false);
|
|
13306
|
+
}
|
|
13307
|
+
function pickPath(p, i, path) {
|
|
13308
|
+
if (String(p.type) === "1") {
|
|
13309
|
+
var parent = i > 0 ? path[i - 1] : null;
|
|
13310
|
+
setTarget({ groupId: parent ? String(parent.id) : "", tableId: String(p.id) });
|
|
13311
|
+
} else {
|
|
13312
|
+
setTarget({ groupId: String(p.id), tableId: null });
|
|
12077
13313
|
}
|
|
12078
|
-
|
|
13314
|
+
setPageNumber(1);
|
|
13315
|
+
}
|
|
13316
|
+
function toggleExpanded(id) {
|
|
13317
|
+
var next = new Set(expanded);
|
|
13318
|
+
if (next.has(String(id))) next.delete(String(id));
|
|
13319
|
+
else next.add(String(id));
|
|
13320
|
+
setExpanded(next);
|
|
13321
|
+
}
|
|
13322
|
+
function addNode(parentId, type) {
|
|
13323
|
+
setNodeModal({ parentId, type, node: null });
|
|
13324
|
+
}
|
|
13325
|
+
function nodeSaved(op) {
|
|
13326
|
+
var cur = nodeModal;
|
|
13327
|
+
setNodeModal(null);
|
|
13328
|
+
if (cur && cur.parentId) {
|
|
12079
13329
|
var next = new Set(expanded);
|
|
12080
|
-
|
|
12081
|
-
else next.add(String(id));
|
|
13330
|
+
next.add(String(cur.parentId));
|
|
12082
13331
|
setExpanded(next);
|
|
12083
13332
|
}
|
|
12084
|
-
|
|
12085
|
-
|
|
12086
|
-
|
|
12087
|
-
|
|
12088
|
-
|
|
12089
|
-
|
|
12090
|
-
|
|
12091
|
-
|
|
12092
|
-
|
|
12093
|
-
setExpanded(next);
|
|
12094
|
-
}
|
|
12095
|
-
refreshTree();
|
|
12096
|
-
say(op === "create" ? t.created : t.saved);
|
|
12097
|
-
}
|
|
12098
|
-
function renameNode(id, name) {
|
|
12099
|
-
if (!edit || String(edit.id) !== String(id)) return;
|
|
12100
|
-
var v = String(name || "").trim();
|
|
12101
|
-
if (!v || v === String(edit.name || "")) {
|
|
12102
|
-
setEdit(null);
|
|
12103
|
-
return;
|
|
12104
|
-
}
|
|
12105
|
-
api.call("taskNodes.rename", { id, name: v }).then(function(r) {
|
|
12106
|
-
setEdit(null);
|
|
12107
|
-
if (r && r.ok) {
|
|
12108
|
-
refreshTree();
|
|
12109
|
-
say(t.saved);
|
|
12110
|
-
} else say(r && r.error || "rename failed");
|
|
12111
|
-
});
|
|
12112
|
-
}
|
|
12113
|
-
function deleteTask(task) {
|
|
12114
|
-
if (cfgConfirm && !window.confirm(t.deleteTaskConfirm)) return;
|
|
12115
|
-
api.call("tasks.delete", { id: task.id }).then(function(r) {
|
|
12116
|
-
if (r && r.ok) {
|
|
12117
|
-
refreshList();
|
|
12118
|
-
refreshTagNav();
|
|
12119
|
-
say(t.deleted);
|
|
12120
|
-
} else say(r && r.error || "delete failed");
|
|
12121
|
-
});
|
|
12122
|
-
}
|
|
12123
|
-
function openTimelinePreview(member, event) {
|
|
12124
|
-
timelineTrigger.current = event && event.currentTarget || timelineTrigger.current;
|
|
12125
|
-
api.call("tasks.get", { id: member.id }).then(function(r) {
|
|
12126
|
-
if (r && r.ok && r.result && r.result.task) return r.result.task;
|
|
12127
|
-
return member;
|
|
12128
|
-
}).catch(function() {
|
|
12129
|
-
return member;
|
|
12130
|
-
}).then(function(task) {
|
|
12131
|
-
if (task) setTimelinePreview(task);
|
|
12132
|
-
});
|
|
12133
|
-
}
|
|
12134
|
-
function closeTimelinePreview() {
|
|
12135
|
-
setTimelinePreview(null);
|
|
12136
|
-
var trigger = timelineTrigger.current;
|
|
12137
|
-
timelineTrigger.current = null;
|
|
12138
|
-
if (trigger && trigger.isConnected) trigger.focus({ preventScroll: true });
|
|
12139
|
-
}
|
|
12140
|
-
function bumpTimeline() {
|
|
12141
|
-
setTimelineReload(function(n) {
|
|
12142
|
-
return n + 1;
|
|
12143
|
-
});
|
|
12144
|
-
}
|
|
12145
|
-
function deletePreviewTask(task) {
|
|
12146
|
-
if (cfgConfirm && !window.confirm(t.deleteTaskConfirm)) return;
|
|
12147
|
-
api.call("tasks.delete", { id: task.id }).then(function(r) {
|
|
12148
|
-
if (r && r.ok) {
|
|
12149
|
-
closeTimelinePreview();
|
|
12150
|
-
refreshList();
|
|
12151
|
-
refreshTagNav();
|
|
12152
|
-
bumpTimeline();
|
|
12153
|
-
say(t.deleted);
|
|
12154
|
-
} else say(r && r.error || "delete failed");
|
|
12155
|
-
});
|
|
13333
|
+
refreshTree();
|
|
13334
|
+
say(op === "create" ? t.created : t.saved);
|
|
13335
|
+
}
|
|
13336
|
+
function renameNode(id, name) {
|
|
13337
|
+
if (!edit || String(edit.id) !== String(id)) return;
|
|
13338
|
+
var v = String(name || "").trim();
|
|
13339
|
+
if (!v || v === String(edit.name || "")) {
|
|
13340
|
+
setEdit(null);
|
|
13341
|
+
return;
|
|
12156
13342
|
}
|
|
12157
|
-
|
|
12158
|
-
|
|
12159
|
-
if (
|
|
12160
|
-
|
|
12161
|
-
|
|
12162
|
-
|
|
12163
|
-
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
return null;
|
|
12170
|
-
});
|
|
12171
|
-
})).then(function() {
|
|
12172
|
-
clearSelection();
|
|
13343
|
+
api.call("taskNodes.rename", { id, name: v }).then(function(r) {
|
|
13344
|
+
setEdit(null);
|
|
13345
|
+
if (r && r.ok) {
|
|
13346
|
+
refreshTree();
|
|
13347
|
+
say(t.saved);
|
|
13348
|
+
} else say(r && r.error || "rename failed");
|
|
13349
|
+
});
|
|
13350
|
+
}
|
|
13351
|
+
function deleteTask(task) {
|
|
13352
|
+
if (cfgConfirm && !window.confirm(t.deleteTaskConfirm)) return;
|
|
13353
|
+
api.call("tasks.delete", { id: task.id }).then(function(r) {
|
|
13354
|
+
if (r && r.ok) {
|
|
12173
13355
|
refreshList();
|
|
12174
13356
|
refreshTagNav();
|
|
12175
|
-
say(
|
|
12176
|
-
});
|
|
12177
|
-
}
|
|
12178
|
-
var claimSelected = claimBatch.makeClaimSelected({
|
|
12179
|
-
api,
|
|
12180
|
-
t,
|
|
12181
|
-
ids: function() {
|
|
12182
|
-
return Array.from(selectedIds);
|
|
12183
|
-
},
|
|
12184
|
-
setIds: setSelectedIds,
|
|
12185
|
-
clear: clearSelection,
|
|
12186
|
-
say,
|
|
12187
|
-
refreshList,
|
|
12188
|
-
refreshTagNav
|
|
13357
|
+
say(t.deleted);
|
|
13358
|
+
} else say(r && r.error || "delete failed");
|
|
12189
13359
|
});
|
|
12190
|
-
|
|
12191
|
-
|
|
12192
|
-
|
|
12193
|
-
|
|
12194
|
-
|
|
12195
|
-
|
|
12196
|
-
|
|
12197
|
-
|
|
12198
|
-
|
|
12199
|
-
|
|
12200
|
-
}
|
|
12201
|
-
|
|
12202
|
-
|
|
12203
|
-
|
|
12204
|
-
|
|
12205
|
-
|
|
12206
|
-
|
|
12207
|
-
|
|
12208
|
-
|
|
12209
|
-
|
|
12210
|
-
|
|
12211
|
-
|
|
12212
|
-
|
|
12213
|
-
|
|
12214
|
-
|
|
12215
|
-
}
|
|
12216
|
-
|
|
12217
|
-
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12221
|
-
|
|
12222
|
-
|
|
12223
|
-
}
|
|
12224
|
-
|
|
12225
|
-
|
|
12226
|
-
|
|
12227
|
-
|
|
12228
|
-
|
|
12229
|
-
|
|
12230
|
-
function
|
|
12231
|
-
|
|
12232
|
-
|
|
12233
|
-
|
|
12234
|
-
return;
|
|
12235
|
-
}
|
|
12236
|
-
|
|
12237
|
-
|
|
12238
|
-
setSelectedItems(Array.isArray(r.result) ? r.result : []);
|
|
12239
|
-
setSelectedOpen(true);
|
|
12240
|
-
} else say(r && r.error || "load failed");
|
|
13360
|
+
}
|
|
13361
|
+
function openTimelinePreview(member, event) {
|
|
13362
|
+
timelineTrigger.current = event && event.currentTarget || timelineTrigger.current;
|
|
13363
|
+
api.call("tasks.get", { id: member.id }).then(function(r) {
|
|
13364
|
+
if (r && r.ok && r.result && r.result.task) return r.result.task;
|
|
13365
|
+
return member;
|
|
13366
|
+
}).catch(function() {
|
|
13367
|
+
return member;
|
|
13368
|
+
}).then(function(task) {
|
|
13369
|
+
if (task) setTimelinePreview(task);
|
|
13370
|
+
});
|
|
13371
|
+
}
|
|
13372
|
+
function closeTimelinePreview() {
|
|
13373
|
+
setTimelinePreview(null);
|
|
13374
|
+
var trigger = timelineTrigger.current;
|
|
13375
|
+
timelineTrigger.current = null;
|
|
13376
|
+
if (trigger && trigger.isConnected) trigger.focus({ preventScroll: true });
|
|
13377
|
+
}
|
|
13378
|
+
function bumpTimeline() {
|
|
13379
|
+
setTimelineReload(function(n) {
|
|
13380
|
+
return n + 1;
|
|
13381
|
+
});
|
|
13382
|
+
}
|
|
13383
|
+
function deletePreviewTask(task) {
|
|
13384
|
+
if (cfgConfirm && !window.confirm(t.deleteTaskConfirm)) return;
|
|
13385
|
+
api.call("tasks.delete", { id: task.id }).then(function(r) {
|
|
13386
|
+
if (r && r.ok) {
|
|
13387
|
+
closeTimelinePreview();
|
|
13388
|
+
refreshList();
|
|
13389
|
+
refreshTagNav();
|
|
13390
|
+
bumpTimeline();
|
|
13391
|
+
say(t.deleted);
|
|
13392
|
+
} else say(r && r.error || "delete failed");
|
|
13393
|
+
});
|
|
13394
|
+
}
|
|
13395
|
+
function batchDelete() {
|
|
13396
|
+
var ids = Array.from(selectedIds);
|
|
13397
|
+
if (!ids.length) return;
|
|
13398
|
+
if (cfgConfirm && !window.confirm(t.batchDeleteConfirm.replace("{n}", String(ids.length)))) return;
|
|
13399
|
+
var ok = 0, fail = 0;
|
|
13400
|
+
Promise.all(ids.map(function(id) {
|
|
13401
|
+
return api.call("tasks.delete", { id }).then(function(r) {
|
|
13402
|
+
if (r && r.ok) ok++;
|
|
13403
|
+
else fail++;
|
|
13404
|
+
return r;
|
|
13405
|
+
}).catch(function() {
|
|
13406
|
+
fail++;
|
|
13407
|
+
return null;
|
|
12241
13408
|
});
|
|
12242
|
-
}
|
|
12243
|
-
function clearSelection() {
|
|
12244
|
-
setSelectedIds(/* @__PURE__ */ new Set());
|
|
12245
|
-
setSelectedItems([]);
|
|
12246
|
-
setSelectedOpen(false);
|
|
12247
|
-
setBatchMode(null);
|
|
12248
|
-
}
|
|
12249
|
-
function batchDone() {
|
|
12250
|
-
setBatchMode(null);
|
|
12251
|
-
setSelectedOpen(false);
|
|
13409
|
+
})).then(function() {
|
|
12252
13410
|
clearSelection();
|
|
12253
13411
|
refreshList();
|
|
12254
|
-
|
|
12255
|
-
|
|
12256
|
-
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
|
|
12261
|
-
|
|
12262
|
-
|
|
12263
|
-
|
|
12264
|
-
|
|
12265
|
-
|
|
12266
|
-
|
|
12267
|
-
|
|
12268
|
-
|
|
12269
|
-
|
|
12270
|
-
|
|
12271
|
-
|
|
12272
|
-
|
|
12273
|
-
|
|
12274
|
-
|
|
12275
|
-
|
|
12276
|
-
|
|
12277
|
-
|
|
12278
|
-
}
|
|
12279
|
-
onRename: renameNode,
|
|
12280
|
-
onDelete: deleteNode,
|
|
12281
|
-
onDragStart: function(id) {
|
|
12282
|
-
setDragId(String(id));
|
|
12283
|
-
},
|
|
12284
|
-
onDragOver: function(id) {
|
|
12285
|
-
setDropId(String(id));
|
|
12286
|
-
},
|
|
12287
|
-
onMove: moveNode
|
|
12288
|
-
};
|
|
12289
|
-
function flatTreeRow(item) {
|
|
12290
|
-
var node = item.node;
|
|
12291
|
-
var isTable = String(node.type) === "1";
|
|
12292
|
-
var selected = String(target.tableId || "") === String(node.id) || !target.tableId && String(target.groupId || "") === String(node.id);
|
|
12293
|
-
return h(
|
|
12294
|
-
"div",
|
|
12295
|
-
{
|
|
12296
|
-
key: node.id,
|
|
12297
|
-
className: cx("wbt-tree-row", selected && "sel"),
|
|
12298
|
-
style: { paddingLeft: 3 + item.depth * 15 + "px" }
|
|
12299
|
-
},
|
|
12300
|
-
h("span", { className: "wbt-tw void" }),
|
|
12301
|
-
h("span", { className: "wbt-ti" }, h(Icon2, { name: isTable ? "table" : "folder", size: 13 })),
|
|
12302
|
-
h(
|
|
12303
|
-
"div",
|
|
12304
|
-
{ className: "wbt-tn", onClick: function() {
|
|
12305
|
-
pickNode(node);
|
|
12306
|
-
}, title: node.description ? node.name + "\n" + node.description : node.name },
|
|
12307
|
-
h("span", { className: "nm" }, node.name),
|
|
12308
|
-
node.description ? h("span", { className: "wbt-tdesc" }, String(node.description).replace(/\s+/g, " ")) : null,
|
|
12309
|
-
!isTable && node.children && node.children.length ? h("span", { className: "wbt-tcnt" }, node.children.length) : null
|
|
12310
|
-
)
|
|
12311
|
-
);
|
|
12312
|
-
}
|
|
12313
|
-
var flatNodes = treeWalk(tree);
|
|
12314
|
-
var rootId = tree.length ? String(tree[0].id) : "";
|
|
12315
|
-
var nodeById = {};
|
|
12316
|
-
flatNodes.forEach(function(x) {
|
|
12317
|
-
nodeById[String(x.node.id)] = x.node;
|
|
13412
|
+
refreshTagNav();
|
|
13413
|
+
say(fail ? t.deleted + " " + ok + " \xB7 " + t.deletePartial + " " + fail : t.deleted + " " + ok);
|
|
13414
|
+
});
|
|
13415
|
+
}
|
|
13416
|
+
var claimSelected = claimBatch.makeClaimSelected({
|
|
13417
|
+
api,
|
|
13418
|
+
t,
|
|
13419
|
+
ids: function() {
|
|
13420
|
+
return Array.from(selectedIds);
|
|
13421
|
+
},
|
|
13422
|
+
setIds: setSelectedIds,
|
|
13423
|
+
clear: clearSelection,
|
|
13424
|
+
say,
|
|
13425
|
+
refreshList,
|
|
13426
|
+
refreshTagNav
|
|
13427
|
+
});
|
|
13428
|
+
function deleteNode(node) {
|
|
13429
|
+
if (cfgConfirm && !window.confirm(t.deleteConfirm)) return;
|
|
13430
|
+
api.call("taskNodes.delete", { id: node.id }).then(function(r) {
|
|
13431
|
+
if (r && r.ok) {
|
|
13432
|
+
refreshTree();
|
|
13433
|
+
setTarget({ groupId: "1", tableId: null });
|
|
13434
|
+
setPageNumber(1);
|
|
13435
|
+
say(t.deleted);
|
|
13436
|
+
} else say(r && r.error || "delete failed");
|
|
12318
13437
|
});
|
|
12319
|
-
|
|
12320
|
-
|
|
12321
|
-
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
if (
|
|
12325
|
-
|
|
13438
|
+
}
|
|
13439
|
+
function moveNode(sourceId, targetId, moveType) {
|
|
13440
|
+
setDropId(null);
|
|
13441
|
+
setDragId(null);
|
|
13442
|
+
api.call("taskNodes.move", { sourceId, targetId, moveType }).then(function(r) {
|
|
13443
|
+
if (r && r.ok) {
|
|
13444
|
+
if (String(moveType) === "0") {
|
|
13445
|
+
var next = new Set(expanded);
|
|
13446
|
+
next.add(String(targetId));
|
|
13447
|
+
setExpanded(next);
|
|
13448
|
+
}
|
|
13449
|
+
refreshTree();
|
|
13450
|
+
say(t.updated);
|
|
13451
|
+
} else say(r && r.error || "move failed");
|
|
12326
13452
|
});
|
|
12327
|
-
|
|
12328
|
-
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
|
|
12332
|
-
|
|
13453
|
+
}
|
|
13454
|
+
function toggleTagId(id) {
|
|
13455
|
+
var next = filterTagIds.slice();
|
|
13456
|
+
var idx = next.indexOf(String(id));
|
|
13457
|
+
if (idx >= 0) next.splice(idx, 1);
|
|
13458
|
+
else next.push(String(id));
|
|
13459
|
+
setFilterTagIds(next);
|
|
13460
|
+
setPageNumber(1);
|
|
13461
|
+
}
|
|
13462
|
+
function toggleSelect(id) {
|
|
13463
|
+
var next = new Set(selectedIds);
|
|
13464
|
+
if (next.has(String(id))) next.delete(String(id));
|
|
13465
|
+
else next.add(String(id));
|
|
13466
|
+
setSelectedIds(next);
|
|
13467
|
+
}
|
|
13468
|
+
function openSelected() {
|
|
13469
|
+
var ids = Array.from(selectedIds);
|
|
13470
|
+
if (!ids.length) {
|
|
13471
|
+
say("\u8BF7\u5148\u52FE\u9009\u4EFB\u52A1");
|
|
13472
|
+
return;
|
|
13473
|
+
}
|
|
13474
|
+
api.call("tasks.selected", { ids }).then(function(r) {
|
|
13475
|
+
if (r && r.ok) {
|
|
13476
|
+
setSelectedItems(Array.isArray(r.result) ? r.result : []);
|
|
13477
|
+
setSelectedOpen(true);
|
|
13478
|
+
} else say(r && r.error || "load failed");
|
|
12333
13479
|
});
|
|
12334
|
-
|
|
12335
|
-
|
|
12336
|
-
|
|
12337
|
-
|
|
12338
|
-
|
|
12339
|
-
|
|
12340
|
-
|
|
12341
|
-
|
|
12342
|
-
|
|
12343
|
-
|
|
13480
|
+
}
|
|
13481
|
+
function clearSelection() {
|
|
13482
|
+
setSelectedIds(/* @__PURE__ */ new Set());
|
|
13483
|
+
setSelectedItems([]);
|
|
13484
|
+
setSelectedOpen(false);
|
|
13485
|
+
setBatchMode(null);
|
|
13486
|
+
}
|
|
13487
|
+
function batchDone() {
|
|
13488
|
+
setBatchMode(null);
|
|
13489
|
+
setSelectedOpen(false);
|
|
13490
|
+
clearSelection();
|
|
13491
|
+
refreshList();
|
|
13492
|
+
say(t.updated);
|
|
13493
|
+
}
|
|
13494
|
+
var tables = allTables(tree);
|
|
13495
|
+
var pageable = true;
|
|
13496
|
+
var totalPages = pageable && data.total ? Math.ceil(data.total / pageSize) : 1;
|
|
13497
|
+
var treeProps = {
|
|
13498
|
+
t,
|
|
13499
|
+
expanded,
|
|
13500
|
+
selectedTable: target.tableId,
|
|
13501
|
+
selectedGroup: target.groupId,
|
|
13502
|
+
manager,
|
|
13503
|
+
dragId,
|
|
13504
|
+
dropId,
|
|
13505
|
+
edit,
|
|
13506
|
+
editName,
|
|
13507
|
+
onToggle: toggleExpanded,
|
|
13508
|
+
onSelect: pickNode,
|
|
13509
|
+
onAdd: addNode,
|
|
13510
|
+
onEdit: function(node) {
|
|
13511
|
+
setNodeModal({ parentId: node.parent || node.parentId, type: node.type, node });
|
|
13512
|
+
},
|
|
13513
|
+
onEditName: setEditName,
|
|
13514
|
+
onCancelEdit: function() {
|
|
13515
|
+
setEdit(null);
|
|
13516
|
+
},
|
|
13517
|
+
onRename: renameNode,
|
|
13518
|
+
onDelete: deleteNode,
|
|
13519
|
+
onDragStart: function(id) {
|
|
13520
|
+
setDragId(String(id));
|
|
13521
|
+
},
|
|
13522
|
+
onDragOver: function(id) {
|
|
13523
|
+
setDropId(String(id));
|
|
13524
|
+
},
|
|
13525
|
+
onMove: moveNode
|
|
13526
|
+
};
|
|
13527
|
+
function flatTreeRow(item) {
|
|
13528
|
+
var node = item.node;
|
|
13529
|
+
var isTable = String(node.type) === "1";
|
|
13530
|
+
var selected = String(target.tableId || "") === String(node.id) || !target.tableId && String(target.groupId || "") === String(node.id);
|
|
13531
|
+
return h(
|
|
13532
|
+
"div",
|
|
13533
|
+
{
|
|
13534
|
+
key: node.id,
|
|
13535
|
+
className: cx("wbt-tree-row", selected && "sel"),
|
|
13536
|
+
style: { paddingLeft: 3 + item.depth * 15 + "px" }
|
|
12344
13537
|
},
|
|
13538
|
+
h("span", { className: "wbt-tw void" }),
|
|
13539
|
+
h("span", { className: "wbt-ti" }, h(Icon2, { name: isTable ? "table" : "folder", size: 13 })),
|
|
13540
|
+
h(
|
|
13541
|
+
"div",
|
|
13542
|
+
{ className: "wbt-tn", onClick: function() {
|
|
13543
|
+
pickNode(node);
|
|
13544
|
+
}, title: node.description ? node.name + "\n" + node.description : node.name },
|
|
13545
|
+
h("span", { className: "nm" }, node.name),
|
|
13546
|
+
node.description ? h("span", { className: "wbt-tdesc" }, String(node.description).replace(/\s+/g, " ")) : null,
|
|
13547
|
+
!isTable && node.children && node.children.length ? h("span", { className: "wbt-tcnt" }, node.children.length) : null
|
|
13548
|
+
)
|
|
13549
|
+
);
|
|
13550
|
+
}
|
|
13551
|
+
var flatNodes = treeWalk(tree);
|
|
13552
|
+
var rootId = tree.length ? String(tree[0].id) : "";
|
|
13553
|
+
var nodeById = {};
|
|
13554
|
+
flatNodes.forEach(function(x) {
|
|
13555
|
+
nodeById[String(x.node.id)] = x.node;
|
|
13556
|
+
});
|
|
13557
|
+
var curNode = nodeById[String(target.tableId || target.groupId || "")] || null;
|
|
13558
|
+
var footGroupId = curNode ? String(curNode.type) === "1" ? String(curNode.parent || curNode.parentId || rootId) : String(curNode.id) : rootId;
|
|
13559
|
+
var groupCount = 0;
|
|
13560
|
+
var tableCount = 0;
|
|
13561
|
+
flatNodes.forEach(function(x) {
|
|
13562
|
+
if (String(x.node.type) === "1") tableCount++;
|
|
13563
|
+
else groupCount++;
|
|
13564
|
+
});
|
|
13565
|
+
var tq = treeQuery.trim().toLowerCase();
|
|
13566
|
+
var treeHits = tq ? flatNodes.filter(function(x) {
|
|
13567
|
+
return String(x.node.name || "").toLowerCase().indexOf(tq) >= 0;
|
|
13568
|
+
}) : [];
|
|
13569
|
+
var treeBody = !tree.length ? h("div", { className: "wbt-empty" }, t.emptyTree) : tq ? treeHits.length ? treeHits.map(flatTreeRow) : h("div", { className: "wbt-empty" }, t.treeNoMatch) : tree.map(function(n) {
|
|
13570
|
+
return h(TreeNode, Object.assign({}, treeProps, { key: n.id, node: n, depth: 0 }));
|
|
13571
|
+
});
|
|
13572
|
+
var curDesc = curNode ? String(curNode.description || "") : "";
|
|
13573
|
+
var filterPanel = renderFilters(React, {
|
|
13574
|
+
lang,
|
|
13575
|
+
value: filterValue,
|
|
13576
|
+
open: panelOpen,
|
|
13577
|
+
id: panelId,
|
|
13578
|
+
hint: filterHint,
|
|
13579
|
+
onHint: setFilterHint,
|
|
13580
|
+
onToggle: function() {
|
|
13581
|
+
setPanelOpen(!panelOpen);
|
|
13582
|
+
},
|
|
13583
|
+
onChange: function(next) {
|
|
13584
|
+
setFilterValue(next);
|
|
13585
|
+
setPageNumber(1);
|
|
13586
|
+
},
|
|
13587
|
+
difficultyMissing,
|
|
13588
|
+
onMissingChange: function(next) {
|
|
13589
|
+
setDifficultyMissing(next);
|
|
13590
|
+
setPageNumber(1);
|
|
13591
|
+
},
|
|
13592
|
+
search: h(
|
|
13593
|
+
"form",
|
|
13594
|
+
{ className: "wbt-filter-search", onSubmit: function(e) {
|
|
13595
|
+
e.preventDefault();
|
|
13596
|
+
setTitleKey(searchDraft);
|
|
13597
|
+
setPageNumber(1);
|
|
13598
|
+
} },
|
|
13599
|
+
h("input", { className: "wbt-input", placeholder: t.search, "aria-label": t.search, value: searchDraft, onChange: function(e) {
|
|
13600
|
+
setSearchDraft(e.target.value);
|
|
13601
|
+
} }),
|
|
13602
|
+
h("button", { type: "submit", className: "wbt-btn ghost", "aria-label": t.search }, h(Icon2, { name: "search", size: 14 }))
|
|
13603
|
+
),
|
|
13604
|
+
tags: h(TagFilter, {
|
|
13605
|
+
api,
|
|
13606
|
+
t,
|
|
13607
|
+
Icon: Icon2,
|
|
13608
|
+
ids: filterTagIds,
|
|
13609
|
+
reloadKey: tagReload,
|
|
12345
13610
|
onChange: function(next) {
|
|
12346
|
-
|
|
13611
|
+
setFilterTagIds(next);
|
|
12347
13612
|
setPageNumber(1);
|
|
12348
|
-
}
|
|
12349
|
-
|
|
12350
|
-
|
|
13613
|
+
}
|
|
13614
|
+
}),
|
|
13615
|
+
// 与难度区间互斥:两者同时生效必然是空集,勾选「仅未填难度」时清掉难度区间。
|
|
13616
|
+
api,
|
|
13617
|
+
t,
|
|
13618
|
+
Icon: Icon2,
|
|
13619
|
+
missing: h(SW.Switch, {
|
|
13620
|
+
h,
|
|
13621
|
+
checked: !!difficultyMissing,
|
|
13622
|
+
label: t.difficultyMissing,
|
|
13623
|
+
onChange: function(next) {
|
|
12351
13624
|
setDifficultyMissing(next);
|
|
13625
|
+
if (next) setFilterValue(filters.clearDifficulty(filterValue));
|
|
12352
13626
|
setPageNumber(1);
|
|
12353
|
-
}
|
|
12354
|
-
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
13627
|
+
}
|
|
13628
|
+
})
|
|
13629
|
+
});
|
|
13630
|
+
return {
|
|
13631
|
+
t,
|
|
13632
|
+
api,
|
|
13633
|
+
lang,
|
|
13634
|
+
cfg,
|
|
13635
|
+
cfgConfirm,
|
|
13636
|
+
compact,
|
|
13637
|
+
tree,
|
|
13638
|
+
expanded,
|
|
13639
|
+
target,
|
|
13640
|
+
currentPath,
|
|
13641
|
+
difficultyMissing,
|
|
13642
|
+
filterValue,
|
|
13643
|
+
panelOpen,
|
|
13644
|
+
filterHint,
|
|
13645
|
+
panelId,
|
|
13646
|
+
searchDraft,
|
|
13647
|
+
treeQuery,
|
|
13648
|
+
titleKey,
|
|
13649
|
+
tagReload,
|
|
13650
|
+
filterTagIds,
|
|
13651
|
+
pageNumber,
|
|
13652
|
+
pageSize,
|
|
13653
|
+
data,
|
|
13654
|
+
loading,
|
|
13655
|
+
error,
|
|
13656
|
+
drawer,
|
|
13657
|
+
manager,
|
|
13658
|
+
selectionMode,
|
|
13659
|
+
selectedIds,
|
|
13660
|
+
selectedItems,
|
|
13661
|
+
selectedOpen,
|
|
13662
|
+
batchMode,
|
|
13663
|
+
createState,
|
|
13664
|
+
timelineTask,
|
|
13665
|
+
doneTask,
|
|
13666
|
+
editTask,
|
|
13667
|
+
timelinePreview,
|
|
13668
|
+
timelineReload,
|
|
13669
|
+
edit,
|
|
13670
|
+
nodeModal,
|
|
13671
|
+
editName,
|
|
13672
|
+
dragId,
|
|
13673
|
+
dropId,
|
|
13674
|
+
toast,
|
|
13675
|
+
treeSearchRef,
|
|
13676
|
+
refreshRef,
|
|
13677
|
+
refreshTree,
|
|
13678
|
+
refreshTagNav,
|
|
13679
|
+
refreshPath,
|
|
13680
|
+
update,
|
|
13681
|
+
pickNode,
|
|
13682
|
+
pickPath,
|
|
13683
|
+
toggleExpanded,
|
|
13684
|
+
addNode,
|
|
13685
|
+
nodeSaved,
|
|
13686
|
+
renameNode,
|
|
13687
|
+
deleteTask,
|
|
13688
|
+
openTimelinePreview,
|
|
13689
|
+
closeTimelinePreview,
|
|
13690
|
+
bumpTimeline,
|
|
13691
|
+
deletePreviewTask,
|
|
13692
|
+
batchDelete,
|
|
13693
|
+
claimSelected,
|
|
13694
|
+
deleteNode,
|
|
13695
|
+
moveNode,
|
|
13696
|
+
toggleTagId,
|
|
13697
|
+
toggleSelect,
|
|
13698
|
+
openSelected,
|
|
13699
|
+
clearSelection,
|
|
13700
|
+
batchDone,
|
|
13701
|
+
say,
|
|
13702
|
+
refreshList,
|
|
13703
|
+
setTarget,
|
|
13704
|
+
setTree,
|
|
13705
|
+
setExpanded,
|
|
13706
|
+
setCurrentPath,
|
|
13707
|
+
setDifficultyMissing,
|
|
13708
|
+
setFilterValue,
|
|
13709
|
+
setPanelOpen,
|
|
13710
|
+
setFilterHint,
|
|
13711
|
+
setFilterTagIds,
|
|
13712
|
+
setPageNumber,
|
|
13713
|
+
setPageSize,
|
|
13714
|
+
setSearchDraft,
|
|
13715
|
+
setTreeQuery,
|
|
13716
|
+
setTitleKey,
|
|
13717
|
+
setTagReload,
|
|
13718
|
+
setError,
|
|
13719
|
+
setDrawer,
|
|
13720
|
+
setManager,
|
|
13721
|
+
setSelectionMode,
|
|
13722
|
+
setSelectedIds,
|
|
13723
|
+
setSelectedItems,
|
|
13724
|
+
setSelectedOpen,
|
|
13725
|
+
setBatchMode,
|
|
13726
|
+
setCreateState,
|
|
13727
|
+
setTimelineTask,
|
|
13728
|
+
setDoneTask,
|
|
13729
|
+
setEditTask,
|
|
13730
|
+
setTimelinePreview,
|
|
13731
|
+
setTimelineReload,
|
|
13732
|
+
setEdit,
|
|
13733
|
+
setNodeModal,
|
|
13734
|
+
setEditName,
|
|
13735
|
+
setDragId,
|
|
13736
|
+
setDropId,
|
|
13737
|
+
setToast,
|
|
13738
|
+
tables,
|
|
13739
|
+
pageable,
|
|
13740
|
+
totalPages,
|
|
13741
|
+
treeProps,
|
|
13742
|
+
treeBody,
|
|
13743
|
+
curDesc,
|
|
13744
|
+
groupCount,
|
|
13745
|
+
tableCount,
|
|
13746
|
+
footGroupId,
|
|
13747
|
+
filterPanel,
|
|
13748
|
+
flatTreeRow,
|
|
13749
|
+
treeHits
|
|
13750
|
+
};
|
|
13751
|
+
};
|
|
13752
|
+
}
|
|
13753
|
+
});
|
|
13754
|
+
|
|
13755
|
+
// packages/addons/tasks/client/views/selection-bar.cjs
|
|
13756
|
+
var require_selection_bar = __commonJS({
|
|
13757
|
+
"packages/addons/tasks/client/views/selection-bar.cjs"(exports2, module2) {
|
|
13758
|
+
"use strict";
|
|
13759
|
+
module2.exports = function renderSelectionBar(h, Icon2, p) {
|
|
13760
|
+
var t = p.t;
|
|
13761
|
+
return h(
|
|
13762
|
+
"div",
|
|
13763
|
+
{ className: "wbt-selbar" },
|
|
13764
|
+
h("b", null, t.selected + " " + p.count),
|
|
13765
|
+
h("button", { className: "wbt-btn", onClick: p.openSelected }, t.selectedTasks),
|
|
13766
|
+
h("button", { className: "wbt-btn", onClick: p.batchTimeline }, t.batchTimeline),
|
|
13767
|
+
h("button", { className: "wbt-btn", onClick: p.batchMigrate }, t.batchMigrate),
|
|
13768
|
+
h("button", { className: "wbt-btn", onClick: p.claimSelected }, t.claimSelected),
|
|
13769
|
+
h("button", { className: "wbt-btn wbt-act-del", onClick: p.batchDelete }, h(Icon2, { name: "trash", size: 13 }), t.batchDelete),
|
|
13770
|
+
h("button", { className: "wbt-btn ghost", onClick: p.clear }, t.clear)
|
|
13771
|
+
);
|
|
13772
|
+
};
|
|
13773
|
+
}
|
|
13774
|
+
});
|
|
13775
|
+
|
|
13776
|
+
// packages/addons/tasks/client/modals/task-preview.cjs
|
|
13777
|
+
var require_task_preview = __commonJS({
|
|
13778
|
+
"packages/addons/tasks/client/modals/task-preview.cjs"(exports2, module2) {
|
|
13779
|
+
"use strict";
|
|
13780
|
+
var createOverlay = require_overlay();
|
|
13781
|
+
module2.exports = function createTaskPreview(React, TaskItem) {
|
|
13782
|
+
var h = React.createElement;
|
|
13783
|
+
var Overlay = createOverlay({
|
|
13784
|
+
maskClass: "wbt-modal-mask",
|
|
13785
|
+
dialogClass: "wbt-modal wide wbt-preview",
|
|
13786
|
+
ariaLabelledByOf: function() {
|
|
13787
|
+
return "wbt-preview-title";
|
|
13788
|
+
},
|
|
13789
|
+
// 关闭按钮自己带 autoFocus,外壳不要抢首焦点。
|
|
13790
|
+
autoFocusDialog: false
|
|
13791
|
+
});
|
|
13792
|
+
function TaskPreview(props) {
|
|
13793
|
+
var t = props.t, task = props.task;
|
|
13794
|
+
return h(
|
|
13795
|
+
Overlay,
|
|
13796
|
+
{ onClose: props.onClose, autoFocus: false },
|
|
13797
|
+
h(
|
|
13798
|
+
"div",
|
|
13799
|
+
{ className: "wbt-modal-head wbt-preview-head" },
|
|
13800
|
+
h("h3", { id: "wbt-preview-title" }, String(task.title || "").trim() || t.previewUntitled),
|
|
13801
|
+
h("button", { type: "button", className: "wbt-icon", title: t.close, "aria-label": t.close, autoFocus: true, onClick: props.onClose }, "\xD7")
|
|
12365
13802
|
),
|
|
12366
|
-
|
|
13803
|
+
h("div", { className: "wbt-preview-body" }, h(TaskItem, props.cardProps))
|
|
13804
|
+
);
|
|
13805
|
+
}
|
|
13806
|
+
return TaskPreview;
|
|
13807
|
+
};
|
|
13808
|
+
}
|
|
13809
|
+
});
|
|
13810
|
+
|
|
13811
|
+
// packages/addons/tasks/client/views/layouts/tasks-overlays.cjs
|
|
13812
|
+
var require_tasks_overlays = __commonJS({
|
|
13813
|
+
"packages/addons/tasks/client/views/layouts/tasks-overlays.cjs"(exports2, module2) {
|
|
13814
|
+
module2.exports = function createOverlays(deps) {
|
|
13815
|
+
var React = deps.React;
|
|
13816
|
+
var h = React.createElement;
|
|
13817
|
+
var TaskItem = deps.TaskItem;
|
|
13818
|
+
var CreateModal = deps.CreateModal;
|
|
13819
|
+
var TimelineModal = deps.TimelineModal;
|
|
13820
|
+
var NodeModal = deps.NodeModal;
|
|
13821
|
+
var EditModal = deps.EditModal;
|
|
13822
|
+
var DoneModal = deps.DoneModal;
|
|
13823
|
+
var BatchModal = deps.BatchModal;
|
|
13824
|
+
var TaskPreview = require_task_preview()(React, TaskItem);
|
|
13825
|
+
var ownership = require_ownership();
|
|
13826
|
+
return function renderOverlays(m) {
|
|
13827
|
+
var t = m.t;
|
|
13828
|
+
var sheet = m.compact === true;
|
|
13829
|
+
var api = m.api;
|
|
13830
|
+
var lang = m.lang;
|
|
13831
|
+
return h("div", { className: "wbt-overlays", style: { display: "contents" } }, [
|
|
13832
|
+
m.createState ? h(CreateModal, {
|
|
13833
|
+
sheet,
|
|
13834
|
+
key: (m.createState.source || "0") + "-" + (m.createState.originTask && m.createState.originTask.id || ""),
|
|
13835
|
+
t,
|
|
12367
13836
|
api,
|
|
13837
|
+
tree: m.tree,
|
|
13838
|
+
source: m.createState.source,
|
|
13839
|
+
originTask: m.createState.originTask,
|
|
13840
|
+
defaultTableId: m.createState.defaultTableId,
|
|
13841
|
+
defaults: {
|
|
13842
|
+
priority: m.cfg["form.defaultPriority"],
|
|
13843
|
+
difficulty: m.cfg["form.defaultDifficulty"],
|
|
13844
|
+
targetOffset: m.cfg["form.defaultTargetOffset"]
|
|
13845
|
+
},
|
|
13846
|
+
onClose: function() {
|
|
13847
|
+
m.setCreateState(null);
|
|
13848
|
+
},
|
|
13849
|
+
onCreated: function(result) {
|
|
13850
|
+
m.setCreateState(null);
|
|
13851
|
+
m.refreshList();
|
|
13852
|
+
m.refreshTree();
|
|
13853
|
+
m.bumpTimeline();
|
|
13854
|
+
m.say(ownership.receipt(result));
|
|
13855
|
+
}
|
|
13856
|
+
}) : null,
|
|
13857
|
+
m.timelineTask ? h(TimelineModal, {
|
|
13858
|
+
sheet,
|
|
13859
|
+
key: m.timelineTask.id,
|
|
12368
13860
|
t,
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
|
|
13861
|
+
api,
|
|
13862
|
+
task: m.timelineTask,
|
|
13863
|
+
onChanged: m.refreshList,
|
|
13864
|
+
refreshKey: m.timelineReload,
|
|
13865
|
+
onClose: function() {
|
|
13866
|
+
m.setTimelineTask(null);
|
|
13867
|
+
m.setTimelinePreview(null);
|
|
13868
|
+
},
|
|
13869
|
+
// 成员行只开只读预览;预览里的「编辑」才进编辑面板。
|
|
13870
|
+
onOpen: m.openTimelinePreview,
|
|
13871
|
+
onCreateTimeline: function(originTask) {
|
|
13872
|
+
m.setTimelineTask(null);
|
|
13873
|
+
m.setTimelinePreview(null);
|
|
13874
|
+
m.setCreateState({ source: "1", originTask, defaultTableId: originTask.tableId });
|
|
12375
13875
|
}
|
|
12376
|
-
}),
|
|
12377
|
-
|
|
12378
|
-
|
|
12379
|
-
|
|
12380
|
-
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
|
|
12384
|
-
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
13876
|
+
}) : null,
|
|
13877
|
+
m.timelineTask && m.timelinePreview ? h(TaskPreview, {
|
|
13878
|
+
key: "preview-" + m.timelinePreview.id,
|
|
13879
|
+
t,
|
|
13880
|
+
task: m.timelinePreview,
|
|
13881
|
+
onClose: m.closeTimelinePreview,
|
|
13882
|
+
cardProps: {
|
|
13883
|
+
task: m.timelinePreview,
|
|
13884
|
+
t,
|
|
13885
|
+
lang,
|
|
13886
|
+
keyword: "",
|
|
13887
|
+
bodyMode: m.cfg["ui.bodyMode"],
|
|
13888
|
+
update: function(task, patch) {
|
|
13889
|
+
api.call("tasks.update", Object.assign({ id: task.id }, patch)).then(function(r) {
|
|
13890
|
+
if (!r || !r.ok) {
|
|
13891
|
+
m.say(r && r.error || "update failed");
|
|
13892
|
+
return;
|
|
13893
|
+
}
|
|
13894
|
+
return api.call("tasks.get", { id: task.id }).then(function(next) {
|
|
13895
|
+
if (next && next.ok && next.result && next.result.task) m.setTimelinePreview(next.result.task);
|
|
13896
|
+
m.refreshList();
|
|
13897
|
+
m.bumpTimeline();
|
|
13898
|
+
});
|
|
13899
|
+
}).catch(function(e) {
|
|
13900
|
+
m.say(String(e && e.message || e));
|
|
13901
|
+
});
|
|
13902
|
+
},
|
|
13903
|
+
onEdit: function(task) {
|
|
13904
|
+
m.closeTimelinePreview();
|
|
13905
|
+
m.setEditTask(task);
|
|
13906
|
+
},
|
|
13907
|
+
onDone: function(task) {
|
|
13908
|
+
m.closeTimelinePreview();
|
|
13909
|
+
m.setDoneTask(task);
|
|
13910
|
+
},
|
|
13911
|
+
onRestart: function(task) {
|
|
13912
|
+
m.closeTimelinePreview();
|
|
13913
|
+
m.setCreateState({ source: "2", originTask: task });
|
|
13914
|
+
},
|
|
13915
|
+
onTimeline: function(task) {
|
|
13916
|
+
m.closeTimelinePreview();
|
|
13917
|
+
m.setTimelineTask(task);
|
|
13918
|
+
},
|
|
13919
|
+
onDelete: m.deletePreviewTask
|
|
12389
13920
|
}
|
|
12390
|
-
})
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
13921
|
+
}) : null,
|
|
13922
|
+
m.nodeModal ? h(NodeModal, {
|
|
13923
|
+
sheet,
|
|
13924
|
+
key: "node-" + (m.nodeModal.node ? m.nodeModal.node.id : "new"),
|
|
13925
|
+
t,
|
|
13926
|
+
api,
|
|
13927
|
+
node: m.nodeModal.node,
|
|
13928
|
+
parentId: m.nodeModal.parentId,
|
|
13929
|
+
type: m.nodeModal.type,
|
|
13930
|
+
onClose: function() {
|
|
13931
|
+
m.setNodeModal(null);
|
|
13932
|
+
},
|
|
13933
|
+
onSaved: m.nodeSaved
|
|
13934
|
+
}) : null,
|
|
13935
|
+
m.editTask ? h(EditModal, {
|
|
13936
|
+
sheet,
|
|
13937
|
+
key: "edit-" + m.editTask.id,
|
|
13938
|
+
t,
|
|
13939
|
+
api,
|
|
13940
|
+
task: m.editTask,
|
|
13941
|
+
lang,
|
|
13942
|
+
tree: m.tree,
|
|
13943
|
+
onClose: function() {
|
|
13944
|
+
m.setEditTask(null);
|
|
13945
|
+
},
|
|
13946
|
+
onSaved: function(result) {
|
|
13947
|
+
m.setEditTask(null);
|
|
13948
|
+
m.refreshList();
|
|
13949
|
+
m.bumpTimeline();
|
|
13950
|
+
m.say(ownership.receipt(result));
|
|
13951
|
+
}
|
|
13952
|
+
}) : null,
|
|
13953
|
+
m.doneTask ? h(DoneModal, {
|
|
13954
|
+
sheet,
|
|
13955
|
+
key: m.doneTask.id,
|
|
13956
|
+
t,
|
|
13957
|
+
api,
|
|
13958
|
+
task: m.doneTask,
|
|
13959
|
+
lang,
|
|
13960
|
+
onClose: function() {
|
|
13961
|
+
m.setDoneTask(null);
|
|
13962
|
+
},
|
|
13963
|
+
onDone: function() {
|
|
13964
|
+
m.setDoneTask(null);
|
|
13965
|
+
m.refreshList();
|
|
13966
|
+
m.bumpTimeline();
|
|
13967
|
+
m.say(t.doneSuccess);
|
|
13968
|
+
},
|
|
13969
|
+
onError: function(e) {
|
|
13970
|
+
m.setDoneTask(null);
|
|
13971
|
+
m.say(e);
|
|
13972
|
+
}
|
|
13973
|
+
}) : null,
|
|
13974
|
+
m.selectedOpen && m.batchMode ? h(BatchModal, {
|
|
13975
|
+
sheet,
|
|
13976
|
+
key: m.batchMode,
|
|
13977
|
+
t,
|
|
13978
|
+
api,
|
|
13979
|
+
mode: m.batchMode,
|
|
13980
|
+
items: m.selectedItems,
|
|
13981
|
+
tables: m.tables,
|
|
13982
|
+
tree: m.tree,
|
|
13983
|
+
onClose: function() {
|
|
13984
|
+
m.setBatchMode(null);
|
|
13985
|
+
},
|
|
13986
|
+
onDone: m.batchDone
|
|
13987
|
+
}) : null,
|
|
13988
|
+
m.toast ? h("div", { className: "wbt-toast", key: "toast" }, m.toast) : null
|
|
13989
|
+
]);
|
|
13990
|
+
};
|
|
13991
|
+
};
|
|
13992
|
+
}
|
|
13993
|
+
});
|
|
13994
|
+
|
|
13995
|
+
// packages/addons/tasks/client/views/layouts/tasks-wide-layout.cjs
|
|
13996
|
+
var require_tasks_wide_layout = __commonJS({
|
|
13997
|
+
"packages/addons/tasks/client/views/layouts/tasks-wide-layout.cjs"(exports2, module2) {
|
|
13998
|
+
module2.exports = function createWideLayout(deps) {
|
|
13999
|
+
var React = deps.React;
|
|
14000
|
+
var h = React.createElement;
|
|
14001
|
+
var IT = require_icon_toggle();
|
|
14002
|
+
var renderSelectionBar = require_selection_bar();
|
|
14003
|
+
var TaskItem = deps.TaskItem;
|
|
14004
|
+
var PathCrumbs = deps.PathCrumbs;
|
|
14005
|
+
var Icon2 = deps.Icon;
|
|
14006
|
+
var renderOverlays = require_tasks_overlays()(deps);
|
|
14007
|
+
return function TasksWideLayout(props) {
|
|
14008
|
+
var m = props.model;
|
|
14009
|
+
var h2 = props.h || React.createElement;
|
|
14010
|
+
var IconToggle = IT.IconToggle;
|
|
14011
|
+
var t = m.t, lang = m.lang, cfg = m.cfg, tree = m.tree, target = m.target, currentPath = m.currentPath, treeQuery = m.treeQuery, titleKey = m.titleKey, pageNumber = m.pageNumber, pageSize = m.pageSize, data = m.data, loading = m.loading, error = m.error, drawer = m.drawer, manager = m.manager, selectionMode = m.selectionMode, selectedIds = m.selectedIds, toast = m.toast, treeSearchRef = m.treeSearchRef, refreshTree = m.refreshTree, refreshTagNav = m.refreshTagNav, update = m.update, pickPath = m.pickPath, addNode = m.addNode, deleteTask = m.deleteTask, batchDelete = m.batchDelete, claimSelected = m.claimSelected, toggleTagId = m.toggleTagId, toggleSelect = m.toggleSelect, openSelected = m.openSelected, clearSelection = m.clearSelection, say = m.say, refreshList = m.refreshList, setPageNumber = m.setPageNumber, setPageSize = m.setPageSize, setTreeQuery = m.setTreeQuery, setDrawer = m.setDrawer, setManager = m.setManager, setSelectionMode = m.setSelectionMode, setBatchMode = m.setBatchMode, setCreateState = m.setCreateState, setTimelineTask = m.setTimelineTask, setDoneTask = m.setDoneTask, setEditTask = m.setEditTask, tables = m.tables, pageable = m.pageable, totalPages = m.totalPages, treeBody = m.treeBody, curDesc = m.curDesc, groupCount = m.groupCount, tableCount = m.tableCount, footGroupId = m.footGroupId, filterPanel = m.filterPanel;
|
|
14012
|
+
var listBody = loading ? h2("div", { className: "wbt-empty" }, t.loading) : error ? h2("div", { className: "wbt-err" }, t.error + error) : data.records.length === 0 ? h2("div", { className: "wbt-empty" }, t.empty) : h2("div", { className: "wbt-list" }, data.records.map(function(task) {
|
|
14013
|
+
return h2(TaskItem, {
|
|
12394
14014
|
key: task.id,
|
|
12395
14015
|
task,
|
|
12396
14016
|
t,
|
|
12397
|
-
lang
|
|
14017
|
+
lang,
|
|
12398
14018
|
keyword: titleKey.trim(),
|
|
12399
14019
|
bodyMode: cfg["ui.bodyMode"],
|
|
12400
14020
|
selectionMode,
|
|
@@ -12419,24 +14039,24 @@ var require_tasks_view = __commonJS({
|
|
|
12419
14039
|
onTagPick: toggleTagId
|
|
12420
14040
|
});
|
|
12421
14041
|
}));
|
|
12422
|
-
return
|
|
14042
|
+
return h2(
|
|
12423
14043
|
"div",
|
|
12424
14044
|
{ className: "wbt-root" },
|
|
12425
|
-
|
|
14045
|
+
h2(
|
|
12426
14046
|
"div",
|
|
12427
14047
|
{ className: "wbt-pathrow" },
|
|
12428
|
-
|
|
14048
|
+
h2(
|
|
12429
14049
|
"div",
|
|
12430
14050
|
{ className: "wbt-tree-slot" },
|
|
12431
|
-
|
|
14051
|
+
h2("button", { className: "wbt-btn", onClick: function() {
|
|
12432
14052
|
setDrawer(true);
|
|
12433
14053
|
refreshTree();
|
|
12434
|
-
} },
|
|
14054
|
+
} }, h2(Icon2, { name: "tree", size: 13 }), t.tree)
|
|
12435
14055
|
),
|
|
12436
|
-
|
|
12437
|
-
|
|
12438
|
-
|
|
12439
|
-
|
|
14056
|
+
h2("span", { className: "wbt-sum", role: "status", "aria-live": "polite" }, t.total + " " + data.total + " " + t.items),
|
|
14057
|
+
h2(PathCrumbs, { path: currentPath, onPick: pickPath }),
|
|
14058
|
+
h2("div", { className: "wbt-grow" }),
|
|
14059
|
+
h2("button", {
|
|
12440
14060
|
className: "wbt-btn ghost",
|
|
12441
14061
|
title: t.refresh,
|
|
12442
14062
|
"aria-label": t.refresh,
|
|
@@ -12445,50 +14065,50 @@ var require_tasks_view = __commonJS({
|
|
|
12445
14065
|
refreshList();
|
|
12446
14066
|
refreshTagNav();
|
|
12447
14067
|
}
|
|
12448
|
-
},
|
|
12449
|
-
|
|
14068
|
+
}, h2(Icon2, { name: "refresh", size: 13 }), t.refresh),
|
|
14069
|
+
h2("button", { className: "wbt-btn " + (selectionMode ? "primary" : "ghost"), onClick: function() {
|
|
12450
14070
|
if (selectionMode) {
|
|
12451
14071
|
setSelectionMode(false);
|
|
12452
14072
|
clearSelection();
|
|
12453
14073
|
} else setSelectionMode(true);
|
|
12454
|
-
} },
|
|
12455
|
-
|
|
14074
|
+
} }, h2(Icon2, { name: "select", size: 13 }), selectionMode ? t.cancelSelect : t.select),
|
|
14075
|
+
h2("button", { className: "wbt-btn primary", onClick: function() {
|
|
12456
14076
|
setCreateState({ source: "0", originTask: null, defaultTableId: target.tableId });
|
|
12457
|
-
} },
|
|
14077
|
+
} }, h2(Icon2, { name: "plus", size: 14 }), t.newTask)
|
|
12458
14078
|
),
|
|
12459
|
-
curDesc ?
|
|
12460
|
-
|
|
14079
|
+
curDesc ? h2("div", { className: "wbt-tabledesc", title: curDesc }, curDesc.length > 220 ? curDesc.slice(0, 220) + "\u2026" : curDesc) : null,
|
|
14080
|
+
h2(
|
|
12461
14081
|
"div",
|
|
12462
14082
|
{ className: "wbt-body" },
|
|
12463
14083
|
filterPanel,
|
|
12464
|
-
|
|
14084
|
+
h2(
|
|
12465
14085
|
"div",
|
|
12466
14086
|
{ className: "wbt-content" },
|
|
12467
|
-
|
|
12468
|
-
pageable ?
|
|
14087
|
+
h2("div", { className: "wbt-list-scroll", tabIndex: 0, role: "region", "aria-label": lang === "en" ? "Task list" : "\u4EFB\u52A1\u5217\u8868", key: pageNumber + ":" + pageSize }, listBody),
|
|
14088
|
+
pageable ? h2(
|
|
12469
14089
|
"div",
|
|
12470
14090
|
{ className: "wbt-pager" },
|
|
12471
|
-
|
|
14091
|
+
h2("button", { className: "wbt-btn ghost", disabled: pageNumber <= 1, onClick: function() {
|
|
12472
14092
|
setPageNumber(Math.max(1, pageNumber - 1));
|
|
12473
|
-
} },
|
|
12474
|
-
|
|
12475
|
-
|
|
14093
|
+
} }, h2(Icon2, { name: "left", size: 14 })),
|
|
14094
|
+
h2("span", null, t.page + " " + pageNumber + " / " + totalPages),
|
|
14095
|
+
h2(
|
|
12476
14096
|
"select",
|
|
12477
14097
|
{ className: "wbt-select", value: pageSize, onChange: function(e) {
|
|
12478
14098
|
setPageSize(Number(e.target.value));
|
|
12479
14099
|
setPageNumber(1);
|
|
12480
14100
|
} },
|
|
12481
14101
|
[6, 12, 24].map(function(n) {
|
|
12482
|
-
return
|
|
14102
|
+
return h2("option", { key: n, value: n }, n + " / " + t.page);
|
|
12483
14103
|
})
|
|
12484
14104
|
),
|
|
12485
|
-
|
|
14105
|
+
h2("button", { className: "wbt-btn ghost", disabled: pageNumber >= totalPages, onClick: function() {
|
|
12486
14106
|
setPageNumber(Math.min(totalPages, pageNumber + 1));
|
|
12487
|
-
} },
|
|
14107
|
+
} }, h2(Icon2, { name: "right", size: 14 }))
|
|
12488
14108
|
) : null
|
|
12489
14109
|
)
|
|
12490
14110
|
),
|
|
12491
|
-
selectionMode && selectedIds.size ? renderSelectionBar(
|
|
14111
|
+
selectionMode && selectedIds.size ? renderSelectionBar(h2, Icon2, {
|
|
12492
14112
|
t,
|
|
12493
14113
|
count: selectedIds.size,
|
|
12494
14114
|
openSelected,
|
|
@@ -12504,41 +14124,41 @@ var require_tasks_view = __commonJS({
|
|
|
12504
14124
|
openSelected();
|
|
12505
14125
|
}
|
|
12506
14126
|
}) : null,
|
|
12507
|
-
drawer ?
|
|
14127
|
+
drawer ? h2(
|
|
12508
14128
|
"div",
|
|
12509
14129
|
{ className: "wbt-drawer-mask", onMouseDown: function(e) {
|
|
12510
14130
|
if (e.target === e.currentTarget) setDrawer(false);
|
|
12511
14131
|
} },
|
|
12512
|
-
|
|
14132
|
+
h2(
|
|
12513
14133
|
"div",
|
|
12514
14134
|
{ className: "wbt-drawer", role: "dialog", "aria-label": t.tree },
|
|
12515
|
-
|
|
14135
|
+
h2(
|
|
12516
14136
|
"div",
|
|
12517
14137
|
{ className: "wbt-drawer-head" },
|
|
12518
|
-
|
|
12519
|
-
|
|
14138
|
+
h2(Icon2, { name: "tree", size: 15 }),
|
|
14139
|
+
h2(
|
|
12520
14140
|
"div",
|
|
12521
14141
|
{ className: "wbt-drawer-title" },
|
|
12522
|
-
|
|
12523
|
-
|
|
14142
|
+
h2("b", null, t.tree),
|
|
14143
|
+
h2("span", { className: "wbt-drawer-meta" }, groupCount + " " + t.groups + " \xB7 " + tableCount + " " + t.tables)
|
|
12524
14144
|
),
|
|
12525
|
-
|
|
12526
|
-
h,
|
|
14145
|
+
h2(IT.IconToggle, {
|
|
14146
|
+
h: h2,
|
|
12527
14147
|
on: manager,
|
|
12528
|
-
icon:
|
|
14148
|
+
icon: h2(Icon2, { name: "pencil", size: 14 }),
|
|
12529
14149
|
label: t.manager,
|
|
12530
14150
|
onClick: function(next) {
|
|
12531
14151
|
setManager(next);
|
|
12532
14152
|
}
|
|
12533
14153
|
}),
|
|
12534
|
-
|
|
14154
|
+
h2("button", { className: "wbt-icon", title: t.close, "aria-label": t.close, onClick: function() {
|
|
12535
14155
|
setDrawer(false);
|
|
12536
|
-
} },
|
|
14156
|
+
} }, h2(Icon2, { name: "close", size: 15 }))
|
|
12537
14157
|
),
|
|
12538
|
-
|
|
14158
|
+
h2(
|
|
12539
14159
|
"div",
|
|
12540
14160
|
{ className: "wbt-drawer-search" },
|
|
12541
|
-
|
|
14161
|
+
h2("input", {
|
|
12542
14162
|
className: "wbt-input",
|
|
12543
14163
|
ref: treeSearchRef,
|
|
12544
14164
|
placeholder: t.treeSearch,
|
|
@@ -12554,7 +14174,7 @@ var require_tasks_view = __commonJS({
|
|
|
12554
14174
|
}
|
|
12555
14175
|
}
|
|
12556
14176
|
}),
|
|
12557
|
-
treeQuery ?
|
|
14177
|
+
treeQuery ? h2("button", {
|
|
12558
14178
|
className: "wbt-search-clear",
|
|
12559
14179
|
title: t.clear,
|
|
12560
14180
|
"aria-label": t.clear,
|
|
@@ -12562,188 +14182,473 @@ var require_tasks_view = __commonJS({
|
|
|
12562
14182
|
setTreeQuery("");
|
|
12563
14183
|
if (treeSearchRef.current) treeSearchRef.current.focus();
|
|
12564
14184
|
}
|
|
12565
|
-
},
|
|
14185
|
+
}, h2(Icon2, { name: "close", size: 13 })) : null
|
|
12566
14186
|
),
|
|
12567
|
-
|
|
12568
|
-
|
|
14187
|
+
h2("div", { className: "wbt-drawer-body" }, treeBody),
|
|
14188
|
+
h2(
|
|
12569
14189
|
"div",
|
|
12570
14190
|
{ className: "wbt-drawer-foot" },
|
|
12571
|
-
|
|
14191
|
+
h2(
|
|
12572
14192
|
"div",
|
|
12573
14193
|
{ className: "wbt-drawer-acts" },
|
|
12574
|
-
|
|
14194
|
+
h2(
|
|
12575
14195
|
"button",
|
|
12576
14196
|
{ className: "wbt-addbtn", title: t.addGroup, onClick: function() {
|
|
12577
14197
|
if (footGroupId) addNode(footGroupId, "0");
|
|
12578
14198
|
} },
|
|
12579
|
-
|
|
14199
|
+
h2(Icon2, { name: "folderPlus", size: 13 }),
|
|
12580
14200
|
t.addGroup
|
|
12581
14201
|
),
|
|
12582
|
-
|
|
14202
|
+
h2(
|
|
12583
14203
|
"button",
|
|
12584
14204
|
{ className: "wbt-addbtn", title: t.addTable, onClick: function() {
|
|
12585
14205
|
if (footGroupId) addNode(footGroupId, "1");
|
|
12586
14206
|
} },
|
|
12587
|
-
|
|
14207
|
+
h2(Icon2, { name: "filePlus", size: 13 }),
|
|
12588
14208
|
t.addTable
|
|
12589
14209
|
)
|
|
12590
14210
|
),
|
|
12591
|
-
|
|
14211
|
+
h2("div", { className: "wbt-drawer-hint" }, t.treeHint)
|
|
12592
14212
|
)
|
|
12593
14213
|
)
|
|
12594
14214
|
) : null,
|
|
12595
|
-
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12605
|
-
|
|
12606
|
-
|
|
12607
|
-
|
|
12608
|
-
|
|
12609
|
-
|
|
14215
|
+
renderOverlays(m)
|
|
14216
|
+
);
|
|
14217
|
+
};
|
|
14218
|
+
};
|
|
14219
|
+
}
|
|
14220
|
+
});
|
|
14221
|
+
|
|
14222
|
+
// packages/addons/tasks/client/item/task-card-compact.cjs
|
|
14223
|
+
var require_task_card_compact = __commonJS({
|
|
14224
|
+
"packages/addons/tasks/client/item/task-card-compact.cjs"(exports2, module2) {
|
|
14225
|
+
"use strict";
|
|
14226
|
+
module2.exports = function createTaskCardCompact(deps) {
|
|
14227
|
+
var React = deps.React;
|
|
14228
|
+
var h = React.createElement;
|
|
14229
|
+
var Highlight = require_highlight2()(React);
|
|
14230
|
+
var statusInfo = deps.statusInfo;
|
|
14231
|
+
var stars = deps.stars;
|
|
14232
|
+
var pClass = deps.pClass;
|
|
14233
|
+
var daysBetween = deps.daysBetween;
|
|
14234
|
+
var Icon2 = deps.Icon;
|
|
14235
|
+
function preview(text) {
|
|
14236
|
+
return String(text || "").replace(/```[\s\S]*?```/g, " ").replace(/!\[[^\]]*\]\([^)]*\)/g, " ").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/[#>*`_~|-]{1,}/g, " ").replace(/\s+/g, " ").trim();
|
|
14237
|
+
}
|
|
14238
|
+
return function TaskCardCompact(props) {
|
|
14239
|
+
var t = props.t;
|
|
14240
|
+
var task = props.task;
|
|
14241
|
+
var st = statusInfo(task.status);
|
|
14242
|
+
var stName = props.lang === "en" ? st.en : st.zh;
|
|
14243
|
+
var openLike = String(task.status) === "0" || String(task.status) === "4";
|
|
14244
|
+
var myTags = Array.isArray(task.tags) ? task.tags : [];
|
|
14245
|
+
var shown = myTags.slice(0, 3);
|
|
14246
|
+
var rest = myTags.length - shown.length;
|
|
14247
|
+
var meta = [];
|
|
14248
|
+
if (task.publishDate) meta.push(h("span", { key: "p" }, t.publish + " " + task.publishDate));
|
|
14249
|
+
if (task.targetDate) {
|
|
14250
|
+
var cd = openLike ? daysBetween(task.targetDate) : null;
|
|
14251
|
+
meta.push(h("span", { key: "g" }, t.target + " " + task.targetDate + (cd == null ? "" : " \xB7 " + cd + "d")));
|
|
14252
|
+
} else if (task.doneDate) {
|
|
14253
|
+
meta.push(h("span", { key: "d" }, t.done + " " + task.doneDate));
|
|
14254
|
+
}
|
|
14255
|
+
if (Number(task.difficulty) > 0) {
|
|
14256
|
+
meta.push(h("span", { key: "s", className: "wbt-stars" }, stars(task.difficulty)));
|
|
14257
|
+
}
|
|
14258
|
+
var ws = Array.isArray(task.workspaces) && task.workspaces.length ? task.workspaces[0] : null;
|
|
14259
|
+
if (ws) meta.push(h("span", { key: "w", className: "wbtc-card-ws", title: ws.dir || "" }, ws.title || ws.id));
|
|
14260
|
+
var desc = preview(task.description);
|
|
14261
|
+
return h(
|
|
14262
|
+
"div",
|
|
14263
|
+
{ className: "wbtc-card-inner" },
|
|
14264
|
+
props.selectionMode ? h("input", {
|
|
14265
|
+
type: "checkbox",
|
|
14266
|
+
className: "wbt-check",
|
|
14267
|
+
checked: !!props.checked,
|
|
14268
|
+
onChange: function() {
|
|
14269
|
+
props.onCheck(task.id);
|
|
12610
14270
|
},
|
|
12611
|
-
|
|
12612
|
-
|
|
12613
|
-
refreshList();
|
|
12614
|
-
refreshTree();
|
|
12615
|
-
bumpTimeline();
|
|
12616
|
-
say(require_ownership().receipt(result));
|
|
14271
|
+
onClick: function(e) {
|
|
14272
|
+
e.stopPropagation();
|
|
12617
14273
|
}
|
|
12618
14274
|
}) : null,
|
|
12619
|
-
|
|
12620
|
-
|
|
14275
|
+
h(
|
|
14276
|
+
"div",
|
|
14277
|
+
{ className: "wbtc-card-body" },
|
|
14278
|
+
h(
|
|
14279
|
+
"div",
|
|
14280
|
+
{ className: "wbtc-card-top" },
|
|
14281
|
+
openLike ? h("span", { className: "wbt-prio " + pClass(task.priority) }, "P" + task.priority) : h("span", { className: "wbt-prio low" }, "\u2014"),
|
|
14282
|
+
h("span", { className: "wbt-badge " + st.cls }, stName),
|
|
14283
|
+
h("div", { className: "wbtc-card-title" }, h(Highlight, { text: task.title, keyword: props.keyword }))
|
|
14284
|
+
),
|
|
14285
|
+
desc ? h("div", { className: "wbtc-card-desc" }, desc) : null,
|
|
14286
|
+
shown.length ? h("div", { className: "wbt-tags wbtc-card-tags" }, shown.map(function(tag) {
|
|
14287
|
+
return h("span", {
|
|
14288
|
+
key: "tag-" + String(tag.id),
|
|
14289
|
+
className: "wbt-tag",
|
|
14290
|
+
title: tag.name,
|
|
14291
|
+
onClick: props.onTagPick ? function(e) {
|
|
14292
|
+
e.stopPropagation();
|
|
14293
|
+
props.onTagPick(String(tag.id));
|
|
14294
|
+
} : null
|
|
14295
|
+
}, "#" + tag.name);
|
|
14296
|
+
}).concat(rest > 0 ? [h("span", { key: "more", className: "wbt-tag" }, "+" + rest)] : [])) : null,
|
|
14297
|
+
meta.length ? h("div", { className: "wbtc-card-meta" }, meta) : null
|
|
14298
|
+
),
|
|
14299
|
+
h("span", { className: "wbtc-card-go", "aria-hidden": "true" }, h(Icon2, { name: "right", size: 15 }))
|
|
14300
|
+
);
|
|
14301
|
+
};
|
|
14302
|
+
};
|
|
14303
|
+
}
|
|
14304
|
+
});
|
|
14305
|
+
|
|
14306
|
+
// packages/addons/tasks/client/views/layouts/tasks-compact-view.cjs
|
|
14307
|
+
var require_tasks_compact_view = __commonJS({
|
|
14308
|
+
"packages/addons/tasks/client/views/layouts/tasks-compact-view.cjs"(exports2, module2) {
|
|
14309
|
+
module2.exports = function createCompactView(deps) {
|
|
14310
|
+
var React = deps.React;
|
|
14311
|
+
var h = React.createElement;
|
|
14312
|
+
var PS = require_panel_host();
|
|
14313
|
+
var CL = require_card_list();
|
|
14314
|
+
var SB = require_sticky_bar();
|
|
14315
|
+
var TaskItem = deps.TaskItem;
|
|
14316
|
+
var TaskCardCompact = require_task_card_compact()(deps);
|
|
14317
|
+
var Icon2 = deps.Icon;
|
|
14318
|
+
var renderOverlays = require_tasks_overlays()(deps);
|
|
14319
|
+
function CompactView(props) {
|
|
14320
|
+
var m = props.model;
|
|
14321
|
+
var t = m.t;
|
|
14322
|
+
var store = React.useMemo(function() {
|
|
14323
|
+
return PS.createStore();
|
|
14324
|
+
}, []);
|
|
14325
|
+
function cardProps(task) {
|
|
14326
|
+
return {
|
|
14327
|
+
key: task.id,
|
|
14328
|
+
task,
|
|
12621
14329
|
t,
|
|
12622
|
-
|
|
12623
|
-
|
|
12624
|
-
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
14330
|
+
lang: m.lang,
|
|
14331
|
+
keyword: m.titleKey.trim(),
|
|
14332
|
+
bodyMode: m.cfg["ui.bodyMode"],
|
|
14333
|
+
selectionMode: m.selectionMode,
|
|
14334
|
+
checked: m.selectedIds.has(String(task.id)),
|
|
14335
|
+
onCheck: m.toggleSelect,
|
|
14336
|
+
update: m.update,
|
|
14337
|
+
toast: m.say,
|
|
14338
|
+
onEdit: function(x) {
|
|
14339
|
+
m.setEditTask(x);
|
|
12629
14340
|
},
|
|
12630
|
-
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
14341
|
+
onDone: function(x) {
|
|
14342
|
+
m.setDoneTask(x);
|
|
14343
|
+
},
|
|
14344
|
+
onRestart: function(x) {
|
|
14345
|
+
m.setCreateState({ source: "2", originTask: x });
|
|
14346
|
+
},
|
|
14347
|
+
onTimeline: function(x) {
|
|
14348
|
+
m.setTimelineTask(x);
|
|
14349
|
+
},
|
|
14350
|
+
onDelete: m.deleteTask,
|
|
14351
|
+
onPathPick: m.pickPath,
|
|
14352
|
+
onTagPick: m.toggleTagId
|
|
14353
|
+
};
|
|
14354
|
+
}
|
|
14355
|
+
function openTree() {
|
|
14356
|
+
store.push({
|
|
14357
|
+
id: "tree",
|
|
14358
|
+
kind: "bottom",
|
|
14359
|
+
title: t.tree,
|
|
14360
|
+
render: function(panel) {
|
|
14361
|
+
return h(
|
|
14362
|
+
"div",
|
|
14363
|
+
{ className: "wbtc-sheet" },
|
|
14364
|
+
h(
|
|
14365
|
+
"div",
|
|
14366
|
+
{ className: "wbt-drawer-search" },
|
|
14367
|
+
h("input", {
|
|
14368
|
+
className: "wbt-input",
|
|
14369
|
+
ref: m.treeSearchRef,
|
|
14370
|
+
placeholder: t.treeSearch,
|
|
14371
|
+
value: m.treeQuery,
|
|
14372
|
+
onChange: function(e) {
|
|
14373
|
+
m.setTreeQuery(e.target.value);
|
|
14374
|
+
}
|
|
14375
|
+
}),
|
|
14376
|
+
m.treeQuery ? h("button", {
|
|
14377
|
+
className: "wbt-search-clear",
|
|
14378
|
+
title: t.clear,
|
|
14379
|
+
"aria-label": t.clear,
|
|
14380
|
+
onClick: function() {
|
|
14381
|
+
m.setTreeQuery("");
|
|
14382
|
+
}
|
|
14383
|
+
}, h(Icon2, { name: "close", size: 13 })) : null
|
|
14384
|
+
),
|
|
14385
|
+
h("div", { className: "wbtc-sheet" }, m.treeBody),
|
|
14386
|
+
h(
|
|
14387
|
+
"div",
|
|
14388
|
+
{ className: "wbtc-foot-acts" },
|
|
14389
|
+
h(
|
|
14390
|
+
"button",
|
|
14391
|
+
{ className: "wbt-addbtn", onClick: function() {
|
|
14392
|
+
if (m.footGroupId) m.addNode(m.footGroupId, "0");
|
|
14393
|
+
} },
|
|
14394
|
+
h(Icon2, { name: "folderPlus", size: 13 }),
|
|
14395
|
+
t.addGroup
|
|
14396
|
+
),
|
|
14397
|
+
h(
|
|
14398
|
+
"button",
|
|
14399
|
+
{ className: "wbt-addbtn", onClick: function() {
|
|
14400
|
+
if (m.footGroupId) m.addNode(m.footGroupId, "1");
|
|
14401
|
+
} },
|
|
14402
|
+
h(Icon2, { name: "filePlus", size: 13 }),
|
|
14403
|
+
t.addTable
|
|
14404
|
+
),
|
|
14405
|
+
h(
|
|
14406
|
+
"button",
|
|
14407
|
+
{ className: "wbt-addbtn", onClick: function() {
|
|
14408
|
+
m.setManager(!m.manager);
|
|
14409
|
+
} },
|
|
14410
|
+
h(Icon2, { name: "pencil", size: 13 }),
|
|
14411
|
+
t.manager
|
|
14412
|
+
),
|
|
14413
|
+
h("button", { className: "wbt-addbtn", onClick: panel.close }, t.close)
|
|
14414
|
+
)
|
|
14415
|
+
);
|
|
12636
14416
|
}
|
|
12637
|
-
})
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
|
|
12646
|
-
|
|
12647
|
-
|
|
12648
|
-
|
|
12649
|
-
|
|
12650
|
-
|
|
12651
|
-
|
|
12652
|
-
|
|
12653
|
-
|
|
14417
|
+
});
|
|
14418
|
+
}
|
|
14419
|
+
function openFilter() {
|
|
14420
|
+
store.push({ id: "filter", kind: "bottom", title: t.filter, render: function() {
|
|
14421
|
+
return h("div", { className: "wbtc-sheet" }, m.filterPanel);
|
|
14422
|
+
} });
|
|
14423
|
+
}
|
|
14424
|
+
function openActions(task) {
|
|
14425
|
+
var active = task.status === 0 || task.status === 4;
|
|
14426
|
+
var actions = [
|
|
14427
|
+
{ key: "edit", label: t.edit, run: function() {
|
|
14428
|
+
m.setEditTask(task);
|
|
14429
|
+
} },
|
|
14430
|
+
active ? { key: "done", label: t.complete, run: function() {
|
|
14431
|
+
m.setDoneTask(task);
|
|
14432
|
+
} } : null,
|
|
14433
|
+
{ key: "timeline", label: t.timeline, run: function() {
|
|
14434
|
+
m.setTimelineTask(task);
|
|
14435
|
+
} },
|
|
14436
|
+
{ key: "select", label: t.select, run: function() {
|
|
14437
|
+
m.setSelectionMode(true);
|
|
14438
|
+
m.toggleSelect(task);
|
|
14439
|
+
} },
|
|
14440
|
+
{ key: "del", label: t.del, run: function() {
|
|
14441
|
+
m.deleteTask(task);
|
|
14442
|
+
}, danger: true }
|
|
14443
|
+
].filter(Boolean);
|
|
14444
|
+
store.push({
|
|
14445
|
+
id: "actions-" + task.id,
|
|
14446
|
+
kind: "bottom",
|
|
14447
|
+
title: task.title || t.editTitle,
|
|
14448
|
+
render: function(panel) {
|
|
14449
|
+
return h("div", { className: "wbtc-actions" }, actions.map(function(item) {
|
|
14450
|
+
return h("button", {
|
|
14451
|
+
key: item.key,
|
|
14452
|
+
className: "wbt-btn" + (item.danger ? " danger" : ""),
|
|
14453
|
+
onClick: function() {
|
|
14454
|
+
panel.close();
|
|
14455
|
+
item.run();
|
|
12654
14456
|
}
|
|
12655
|
-
|
|
12656
|
-
|
|
12657
|
-
refreshList();
|
|
12658
|
-
bumpTimeline();
|
|
12659
|
-
});
|
|
12660
|
-
}).catch(function(e) {
|
|
12661
|
-
say(String(e && e.message || e));
|
|
12662
|
-
});
|
|
12663
|
-
},
|
|
12664
|
-
onEdit: function(task) {
|
|
12665
|
-
closeTimelinePreview();
|
|
12666
|
-
setEditTask(task);
|
|
12667
|
-
},
|
|
12668
|
-
onDone: function(task) {
|
|
12669
|
-
closeTimelinePreview();
|
|
12670
|
-
setDoneTask(task);
|
|
12671
|
-
},
|
|
12672
|
-
onRestart: function(task) {
|
|
12673
|
-
closeTimelinePreview();
|
|
12674
|
-
setCreateState({ source: "2", originTask: task });
|
|
12675
|
-
},
|
|
12676
|
-
onTimeline: function(task) {
|
|
12677
|
-
closeTimelinePreview();
|
|
12678
|
-
setTimelineTask(task);
|
|
12679
|
-
},
|
|
12680
|
-
onDelete: deletePreviewTask
|
|
14457
|
+
}, item.label);
|
|
14458
|
+
}));
|
|
12681
14459
|
}
|
|
12682
|
-
})
|
|
12683
|
-
|
|
12684
|
-
|
|
12685
|
-
|
|
12686
|
-
|
|
12687
|
-
|
|
12688
|
-
|
|
12689
|
-
|
|
12690
|
-
|
|
12691
|
-
setNodeModal(null);
|
|
12692
|
-
},
|
|
12693
|
-
onSaved: nodeSaved
|
|
12694
|
-
}) : null,
|
|
12695
|
-
editTask ? h(EditModal, {
|
|
12696
|
-
key: "edit-" + editTask.id,
|
|
12697
|
-
t,
|
|
12698
|
-
api,
|
|
12699
|
-
task: editTask,
|
|
12700
|
-
lang: props.lang,
|
|
12701
|
-
tree,
|
|
12702
|
-
onClose: function() {
|
|
12703
|
-
setEditTask(null);
|
|
12704
|
-
},
|
|
12705
|
-
onSaved: function(result) {
|
|
12706
|
-
setEditTask(null);
|
|
12707
|
-
refreshList();
|
|
12708
|
-
bumpTimeline();
|
|
12709
|
-
say(require_ownership().receipt(result));
|
|
14460
|
+
});
|
|
14461
|
+
}
|
|
14462
|
+
function openDetail(task) {
|
|
14463
|
+
store.push({
|
|
14464
|
+
id: "detail-" + task.id,
|
|
14465
|
+
kind: "full",
|
|
14466
|
+
title: t.detail,
|
|
14467
|
+
render: function() {
|
|
14468
|
+
return h("div", { className: "wbtc-detail" }, h(TaskItem, cardProps(task)));
|
|
12710
14469
|
}
|
|
12711
|
-
})
|
|
12712
|
-
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
14470
|
+
});
|
|
14471
|
+
}
|
|
14472
|
+
var filtered = !!(m.filterValue && JSON.stringify(m.filterValue) !== JSON.stringify(require_task_filter_model().empty())) || m.difficultyMissing;
|
|
14473
|
+
var head = h(
|
|
14474
|
+
"div",
|
|
14475
|
+
{ className: "wbtc-head" },
|
|
14476
|
+
h(
|
|
14477
|
+
"button",
|
|
14478
|
+
{ className: "wbt-btn ghost", title: t.tree, "aria-label": t.tree, onClick: function() {
|
|
14479
|
+
openTree();
|
|
14480
|
+
m.refreshTree();
|
|
14481
|
+
} },
|
|
14482
|
+
h(Icon2, { name: "tree", size: 16 })
|
|
14483
|
+
),
|
|
14484
|
+
h("div", { className: "wbtc-crumbs" }, h(deps.PathCrumbs, { path: m.currentPath, onPick: m.pickPath })),
|
|
14485
|
+
h("span", { className: "wbtc-sum", role: "status" }, String(m.data.total)),
|
|
14486
|
+
h("button", {
|
|
14487
|
+
className: "wbt-btn ghost",
|
|
14488
|
+
title: t.filter,
|
|
14489
|
+
"aria-label": t.filter,
|
|
14490
|
+
style: { position: "relative" },
|
|
14491
|
+
onClick: openFilter
|
|
14492
|
+
}, h(Icon2, { name: "filter", size: 16 }), filtered ? h("span", { className: "wbtc-filter-dot" }) : null),
|
|
14493
|
+
h("button", {
|
|
14494
|
+
className: "wbt-btn ghost",
|
|
14495
|
+
title: t.refresh,
|
|
14496
|
+
"aria-label": t.refresh,
|
|
14497
|
+
disabled: m.loading,
|
|
14498
|
+
onClick: function() {
|
|
14499
|
+
m.refreshList();
|
|
14500
|
+
m.refreshTagNav();
|
|
12730
14501
|
}
|
|
12731
|
-
}
|
|
12732
|
-
selectedOpen && batchMode ? h(BatchModal, {
|
|
12733
|
-
key: batchMode,
|
|
12734
|
-
t,
|
|
12735
|
-
api,
|
|
12736
|
-
mode: batchMode,
|
|
12737
|
-
items: selectedItems,
|
|
12738
|
-
tables,
|
|
12739
|
-
tree,
|
|
12740
|
-
onClose: function() {
|
|
12741
|
-
setBatchMode(null);
|
|
12742
|
-
},
|
|
12743
|
-
onDone: batchDone
|
|
12744
|
-
}) : null,
|
|
12745
|
-
toast ? h("div", { className: "wbt-toast" }, toast) : null
|
|
14502
|
+
}, h(Icon2, { name: "refresh", size: 16 }))
|
|
12746
14503
|
);
|
|
14504
|
+
var list = h(CL.PullRefresh, {
|
|
14505
|
+
h,
|
|
14506
|
+
React,
|
|
14507
|
+
// 下拉刷新同时刷列表与标签导航:窄屏没有刷新按钮的位置感,手势就是主入口。
|
|
14508
|
+
onRefresh: function() {
|
|
14509
|
+
m.refreshList();
|
|
14510
|
+
m.refreshTagNav();
|
|
14511
|
+
},
|
|
14512
|
+
refreshingLabel: t.refreshing,
|
|
14513
|
+
releaseLabel: t.releaseRefresh
|
|
14514
|
+
}, h(CL.CardList, {
|
|
14515
|
+
h,
|
|
14516
|
+
React,
|
|
14517
|
+
items: m.data.records || [],
|
|
14518
|
+
loading: m.loading,
|
|
14519
|
+
error: m.error,
|
|
14520
|
+
onRetry: m.refreshList,
|
|
14521
|
+
empty: t.empty,
|
|
14522
|
+
keyOf: function(task) {
|
|
14523
|
+
return task.id;
|
|
14524
|
+
},
|
|
14525
|
+
onItemClick: function(task, event) {
|
|
14526
|
+
if (event && event.target && event.target.closest && event.target.closest("input,button,select,.wbt-tag")) return;
|
|
14527
|
+
openDetail(task);
|
|
14528
|
+
},
|
|
14529
|
+
onItemLongPress: function(task) {
|
|
14530
|
+
openActions(task);
|
|
14531
|
+
},
|
|
14532
|
+
renderItem: function(task) {
|
|
14533
|
+
return h("div", { className: "wbtc-card" }, h(TaskCardCompact, cardProps(task)));
|
|
14534
|
+
}
|
|
14535
|
+
}));
|
|
14536
|
+
var sticky = m.selectionMode ? h(SB.StickyBar, {
|
|
14537
|
+
h,
|
|
14538
|
+
tone: "accent",
|
|
14539
|
+
children: [
|
|
14540
|
+
h("span", { key: "n", className: "wbtc-sum" }, t.selected + " " + m.selectedIds.size),
|
|
14541
|
+
h("button", {
|
|
14542
|
+
key: "all",
|
|
14543
|
+
className: "wbt-btn ghost",
|
|
14544
|
+
onClick: function() {
|
|
14545
|
+
m.setSelectedIds(new Set((m.data.records || []).map(function(x) {
|
|
14546
|
+
return String(x.id);
|
|
14547
|
+
})));
|
|
14548
|
+
}
|
|
14549
|
+
}, t.selectAll),
|
|
14550
|
+
h("button", { key: "batch", className: "wbt-btn", onClick: function() {
|
|
14551
|
+
m.setBatchMode("timeline");
|
|
14552
|
+
m.setSelectedOpen(true);
|
|
14553
|
+
} }, t.batchTimeline),
|
|
14554
|
+
h("button", { key: "del", className: "wbt-btn danger", onClick: m.batchDelete }, t.del),
|
|
14555
|
+
h("button", { key: "clear", className: "wbt-btn ghost", onClick: m.clearSelection }, t.clear),
|
|
14556
|
+
h("button", {
|
|
14557
|
+
key: "off",
|
|
14558
|
+
className: "wbt-btn ghost",
|
|
14559
|
+
onClick: function() {
|
|
14560
|
+
m.setSelectionMode(false);
|
|
14561
|
+
m.clearSelection();
|
|
14562
|
+
}
|
|
14563
|
+
}, t.cancelSelect)
|
|
14564
|
+
]
|
|
14565
|
+
}) : h(SB.StickyBar, {
|
|
14566
|
+
h,
|
|
14567
|
+
children: [
|
|
14568
|
+
h("button", {
|
|
14569
|
+
key: "new",
|
|
14570
|
+
className: "wbt-btn primary",
|
|
14571
|
+
onClick: function() {
|
|
14572
|
+
m.setCreateState({ source: "0", originTask: null, defaultTableId: m.target.tableId });
|
|
14573
|
+
}
|
|
14574
|
+
}, h(Icon2, { name: "plus", size: 15 }), t.newTask),
|
|
14575
|
+
m.pageable ? h(
|
|
14576
|
+
"div",
|
|
14577
|
+
{ key: "pager", className: "wbtc-foot-acts" },
|
|
14578
|
+
h("button", { className: "wbt-btn ghost", disabled: m.pageNumber <= 1, onClick: function() {
|
|
14579
|
+
m.setPageNumber(Math.max(1, m.pageNumber - 1));
|
|
14580
|
+
} }, h(Icon2, { name: "left", size: 14 })),
|
|
14581
|
+
h("span", { className: "wbtc-pagerinfo" }, m.pageNumber + " / " + m.totalPages),
|
|
14582
|
+
h("button", { className: "wbt-btn ghost", disabled: m.pageNumber >= m.totalPages, onClick: function() {
|
|
14583
|
+
m.setPageNumber(Math.min(m.totalPages, m.pageNumber + 1));
|
|
14584
|
+
} }, h(Icon2, { name: "right", size: 14 }))
|
|
14585
|
+
) : null,
|
|
14586
|
+
h("button", {
|
|
14587
|
+
key: "sel",
|
|
14588
|
+
className: "wbt-btn ghost",
|
|
14589
|
+
title: t.select,
|
|
14590
|
+
"aria-label": t.select,
|
|
14591
|
+
onClick: function() {
|
|
14592
|
+
m.setSelectionMode(true);
|
|
14593
|
+
}
|
|
14594
|
+
}, h(Icon2, { name: "select", size: 15 }))
|
|
14595
|
+
]
|
|
14596
|
+
});
|
|
14597
|
+
return h(
|
|
14598
|
+
"div",
|
|
14599
|
+
{ className: "wbt-root wbtc" },
|
|
14600
|
+
h(
|
|
14601
|
+
PS.PanelHost,
|
|
14602
|
+
{ h, React, store },
|
|
14603
|
+
h("div", { className: "wbtc-screen" }, head, m.curDesc ? h("div", { className: "wbtc-desc" }, m.curDesc) : null, list, sticky)
|
|
14604
|
+
),
|
|
14605
|
+
renderOverlays(m)
|
|
14606
|
+
);
|
|
14607
|
+
}
|
|
14608
|
+
return CompactView;
|
|
14609
|
+
};
|
|
14610
|
+
}
|
|
14611
|
+
});
|
|
14612
|
+
|
|
14613
|
+
// packages/addons/tasks/client/views/tasks-view.cjs
|
|
14614
|
+
var require_tasks_view = __commonJS({
|
|
14615
|
+
"packages/addons/tasks/client/views/tasks-view.cjs"(exports2, module2) {
|
|
14616
|
+
module2.exports = function createTasksView(deps) {
|
|
14617
|
+
var React = deps.React, configClient = deps.configClient, CFG_FALLBACK = deps.CFG_FALLBACK, COPY = deps.COPY;
|
|
14618
|
+
var h = React.createElement;
|
|
14619
|
+
var useTasksState = require_tasks_state();
|
|
14620
|
+
var TasksWideLayout = require_tasks_wide_layout()(deps);
|
|
14621
|
+
var TasksCompactView = require_tasks_compact_view()(deps);
|
|
14622
|
+
var COMPACT_VARIANTS = { compact: 1, short: 1, "org-compact": 1 };
|
|
14623
|
+
function TasksView(props) {
|
|
14624
|
+
var lang = props.lang === "en" ? "en" : "zh";
|
|
14625
|
+
var cfg = configClient.useConfig(props.api, "tasks", CFG_FALLBACK);
|
|
14626
|
+
if (!cfg.ready) {
|
|
14627
|
+
return h("div", { style: { padding: "48px", textAlign: "center", fontSize: "12.5px", opacity: 0.6 } }, lang === "en" ? "Loading\u2026" : "\u8F7D\u5165\u4E2D\u2026");
|
|
14628
|
+
}
|
|
14629
|
+
return h(TasksViewBody, Object.assign({}, props, { cfg: cfg.values }));
|
|
14630
|
+
}
|
|
14631
|
+
function TasksViewBody(props) {
|
|
14632
|
+
var lang = props.lang === "en" ? "en" : "zh";
|
|
14633
|
+
var t = COPY[lang];
|
|
14634
|
+
var compact = !!COMPACT_VARIANTS[String(props.variant || "")];
|
|
14635
|
+
var model = useTasksState({
|
|
14636
|
+
React,
|
|
14637
|
+
api: props.api,
|
|
14638
|
+
cfg: props.cfg || {},
|
|
14639
|
+
viewParams: props.viewParams,
|
|
14640
|
+
lang,
|
|
14641
|
+
t,
|
|
14642
|
+
allTables: deps.allTables,
|
|
14643
|
+
treeWalk: deps.treeWalk,
|
|
14644
|
+
cx: deps.cx,
|
|
14645
|
+
Icon: deps.Icon,
|
|
14646
|
+
TreeNode: deps.TreeNode,
|
|
14647
|
+
TagFilter: deps.TagFilter,
|
|
14648
|
+
injectCss: deps.injectCss,
|
|
14649
|
+
compact
|
|
14650
|
+
});
|
|
14651
|
+
return compact ? h(TasksCompactView, { model, h, variant: props.variant }) : TasksWideLayout({ model, h });
|
|
12747
14652
|
}
|
|
12748
14653
|
return TasksView;
|
|
12749
14654
|
};
|
|
@@ -12902,6 +14807,7 @@ var require_timeline_view = __commonJS({
|
|
|
12902
14807
|
module2.exports = function(deps) {
|
|
12903
14808
|
var React = deps.React, h = React.createElement, COPY = deps.COPY;
|
|
12904
14809
|
var controls = require_timeline_controls()(React), AddMembers = require_timeline_add_members()(React);
|
|
14810
|
+
var DV = require_display_variants();
|
|
12905
14811
|
var Merge = require_timeline_merge()(React);
|
|
12906
14812
|
var MemberRows = require_timeline_member_rows()(React, deps.statusInfo);
|
|
12907
14813
|
var TaskPreview = require_task_preview()(React, deps.TaskItem);
|
|
@@ -12931,6 +14837,7 @@ var require_timeline_view = __commonJS({
|
|
|
12931
14837
|
}
|
|
12932
14838
|
function TimelineView(props) {
|
|
12933
14839
|
var lang = props.lang === "en" ? "en" : "zh", t = COPY[lang], api = props.api;
|
|
14840
|
+
var compact = DV.isCompact(props.display);
|
|
12934
14841
|
var tr = require_timeline_copy()(t);
|
|
12935
14842
|
var queryS = React.useState(""), query = queryS[0], setQuery = queryS[1];
|
|
12936
14843
|
var draftS = React.useState(""), draft = draftS[0], setDraft = draftS[1];
|
|
@@ -13128,7 +15035,7 @@ var require_timeline_view = __commonJS({
|
|
|
13128
15035
|
}
|
|
13129
15036
|
return h(
|
|
13130
15037
|
"div",
|
|
13131
|
-
{ className: "wbt-root wbt-timeline-view" },
|
|
15038
|
+
{ className: "wbt-root wbt-timeline-view" + (compact ? " wbt-compact" : ""), "data-wb-layout": compact ? "compact" : "wide" },
|
|
13132
15039
|
h(
|
|
13133
15040
|
"div",
|
|
13134
15041
|
{ className: "wbt-timeline-toolbar" },
|
|
@@ -13877,18 +15784,34 @@ var require_timeline_view = __commonJS({
|
|
|
13877
15784
|
"stats.recentClaimedLimit": 10,
|
|
13878
15785
|
"stats.sections": ["eventTrend", "trend", "status", "priority", "difficulty", "aging", "overdue", "tables", "groups", "workspaces", "recent"]
|
|
13879
15786
|
};
|
|
13880
|
-
var
|
|
15787
|
+
var tasksViewDeps = { React, statusInfo, stars, pClass, daysBetween, configClient, CFG_FALLBACK, COPY, injectCss, allTables, findFirstTable, treeWalk, treeFlat, cx, Icon: Icon2, TaskItem, PathCrumbs, TagFilter, WorkspaceFilter, TreeNode, CreateModal, TimelineModal, NodeModal, EditModal, DoneModal, BatchModal };
|
|
15788
|
+
var TasksView = require_tasks_view()(tasksViewDeps);
|
|
13881
15789
|
var TimelineView = require_timeline_view()({ React, COPY, injectCss, statusInfo, configClient, CFG_FALLBACK, TaskItem, EditModal, DoneModal, TimelineModal, CreateModal });
|
|
13882
15790
|
host.registerAddon({
|
|
13883
15791
|
id: "wb-addon-tasks",
|
|
13884
|
-
version: "5.
|
|
15792
|
+
version: "5.15.1",
|
|
13885
15793
|
icon: ICONS["list-checks"],
|
|
13886
15794
|
// 贡献声明写在 registerAddon 里:卸载任务插件时宿主按 addonId 一起撤销,
|
|
13887
15795
|
// 不会在邮件里留一个渲染即报错的孤儿按钮。
|
|
13888
15796
|
slots: [{ slot: "item.actions", id: "tasks.create-from-mail", order: 100, component: slotTaskFromMessage }],
|
|
13889
15797
|
views: [
|
|
13890
15798
|
{ id: "stats", icon: tabIcon("chart"), title: { zh: "\u7EDF\u8BA1", en: "Stats" }, component: statsView.TasksStatsView, keepAlive: true },
|
|
13891
|
-
{
|
|
15799
|
+
{
|
|
15800
|
+
id: "tasks",
|
|
15801
|
+
icon: tabIcon("list"),
|
|
15802
|
+
title: { zh: "\u8BB0\u5F55", en: "Records" },
|
|
15803
|
+
component: TasksView,
|
|
15804
|
+
// 形态声明:命中的变体用同一个窄档壳,靠谓词区分「手机/横屏矮窗/触摸设备」三种成因。
|
|
15805
|
+
// 声明顺序即同分优先级(后写者胜),所以 maxWidth 放在最后,与设备矩阵的预期一致。
|
|
15806
|
+
// 三条窄档声明都指向同一个入口组件:入口按宿主解析出的 variant 自行挑壳。
|
|
15807
|
+
// 变体组件收到的是宿主透传的 viewProps(含 variant),拿不到状态模型,
|
|
15808
|
+
// 所以不能把窄档壳本身当 component 声明(2026-12-06 白屏事故就是这么来的)。
|
|
15809
|
+
display: [
|
|
15810
|
+
{ id: "org-compact", when: { pointer: "coarse" }, component: TasksView },
|
|
15811
|
+
{ id: "short", when: { maxHeight: 560 }, component: TasksView },
|
|
15812
|
+
{ id: "compact", when: { maxWidth: 759 }, component: TasksView }
|
|
15813
|
+
]
|
|
15814
|
+
},
|
|
13892
15815
|
{ id: "timeline", icon: tabIcon("timeline"), title: { zh: "\u65F6\u95F4\u7EBF", en: "Timeline" }, component: TimelineView },
|
|
13893
15816
|
{ id: "workspace", icon: tabIcon("folder"), title: { zh: "\u5DE5\u4F5C\u533A", en: "Workspaces" }, component: workspaceView.WorkspaceView }
|
|
13894
15817
|
]
|