dsh-workbench-tasks 5.14.4 → 5.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -1
- package/lib/client.js +2421 -398
- 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
|
|
|
@@ -4543,6 +4776,94 @@ var init_refresh_cw = __esm({
|
|
|
4543
4776
|
}
|
|
4544
4777
|
});
|
|
4545
4778
|
|
|
4779
|
+
// node_modules/.pnpm/lucide-react@1.70.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/ellipsis.mjs
|
|
4780
|
+
var ellipsis_exports = {};
|
|
4781
|
+
__export(ellipsis_exports, {
|
|
4782
|
+
__iconData: () => __iconData36,
|
|
4783
|
+
default: () => Ellipsis
|
|
4784
|
+
});
|
|
4785
|
+
var __iconData36, Ellipsis;
|
|
4786
|
+
var init_ellipsis = __esm({
|
|
4787
|
+
"node_modules/.pnpm/lucide-react@1.70.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/ellipsis.mjs"() {
|
|
4788
|
+
init_createLucideIcon();
|
|
4789
|
+
__iconData36 = {
|
|
4790
|
+
name: "ellipsis",
|
|
4791
|
+
size: 24,
|
|
4792
|
+
node: [
|
|
4793
|
+
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
4794
|
+
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
|
4795
|
+
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
|
|
4796
|
+
],
|
|
4797
|
+
aliases: ["more-horizontal"]
|
|
4798
|
+
};
|
|
4799
|
+
__iconData36.node;
|
|
4800
|
+
Ellipsis = createLucideIcon(__iconData36);
|
|
4801
|
+
}
|
|
4802
|
+
});
|
|
4803
|
+
|
|
4804
|
+
// node_modules/.pnpm/lucide-react@1.70.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-up.mjs
|
|
4805
|
+
var chevron_up_exports = {};
|
|
4806
|
+
__export(chevron_up_exports, {
|
|
4807
|
+
__iconData: () => __iconData37,
|
|
4808
|
+
default: () => ChevronUp
|
|
4809
|
+
});
|
|
4810
|
+
var __iconData37, ChevronUp;
|
|
4811
|
+
var init_chevron_up = __esm({
|
|
4812
|
+
"node_modules/.pnpm/lucide-react@1.70.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-up.mjs"() {
|
|
4813
|
+
init_createLucideIcon();
|
|
4814
|
+
__iconData37 = {
|
|
4815
|
+
name: "chevron-up",
|
|
4816
|
+
size: 24,
|
|
4817
|
+
node: [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]
|
|
4818
|
+
};
|
|
4819
|
+
__iconData37.node;
|
|
4820
|
+
ChevronUp = createLucideIcon(__iconData37);
|
|
4821
|
+
}
|
|
4822
|
+
});
|
|
4823
|
+
|
|
4824
|
+
// node_modules/.pnpm/lucide-react@1.70.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/layers.mjs
|
|
4825
|
+
var layers_exports = {};
|
|
4826
|
+
__export(layers_exports, {
|
|
4827
|
+
__iconData: () => __iconData38,
|
|
4828
|
+
default: () => Layers
|
|
4829
|
+
});
|
|
4830
|
+
var __iconData38, Layers;
|
|
4831
|
+
var init_layers = __esm({
|
|
4832
|
+
"node_modules/.pnpm/lucide-react@1.70.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/layers.mjs"() {
|
|
4833
|
+
init_createLucideIcon();
|
|
4834
|
+
__iconData38 = {
|
|
4835
|
+
name: "layers",
|
|
4836
|
+
size: 24,
|
|
4837
|
+
node: [
|
|
4838
|
+
[
|
|
4839
|
+
"path",
|
|
4840
|
+
{
|
|
4841
|
+
d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
|
|
4842
|
+
key: "zw3jo"
|
|
4843
|
+
}
|
|
4844
|
+
],
|
|
4845
|
+
[
|
|
4846
|
+
"path",
|
|
4847
|
+
{
|
|
4848
|
+
d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",
|
|
4849
|
+
key: "1wduqc"
|
|
4850
|
+
}
|
|
4851
|
+
],
|
|
4852
|
+
[
|
|
4853
|
+
"path",
|
|
4854
|
+
{
|
|
4855
|
+
d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",
|
|
4856
|
+
key: "kqbvx6"
|
|
4857
|
+
}
|
|
4858
|
+
]
|
|
4859
|
+
],
|
|
4860
|
+
aliases: ["layers-3"]
|
|
4861
|
+
};
|
|
4862
|
+
__iconData38.node;
|
|
4863
|
+
Layers = createLucideIcon(__iconData38);
|
|
4864
|
+
}
|
|
4865
|
+
});
|
|
4866
|
+
|
|
4546
4867
|
// packages/addons/tasks/client/ui/icons.cjs
|
|
4547
4868
|
var require_icons2 = __commonJS({
|
|
4548
4869
|
"packages/addons/tasks/client/ui/icons.cjs"(exports2, module2) {
|
|
@@ -4583,7 +4904,11 @@ var require_icons2 = __commonJS({
|
|
|
4583
4904
|
down: (init_chevron_down(), __toCommonJS(chevron_down_exports)).default,
|
|
4584
4905
|
tag: (init_tag(), __toCommonJS(tag_exports)).default,
|
|
4585
4906
|
clock: (init_clock(), __toCommonJS(clock_exports)).default,
|
|
4586
|
-
refresh: (init_refresh_cw(), __toCommonJS(refresh_cw_exports)).default
|
|
4907
|
+
refresh: (init_refresh_cw(), __toCommonJS(refresh_cw_exports)).default,
|
|
4908
|
+
// 窄屏顶栏与 chips 行:更多用三点、展开用上下折角、目录入口用叠层。
|
|
4909
|
+
more: (init_ellipsis(), __toCommonJS(ellipsis_exports)).default,
|
|
4910
|
+
up: (init_chevron_up(), __toCommonJS(chevron_up_exports)).default,
|
|
4911
|
+
layers: (init_layers(), __toCommonJS(layers_exports)).default
|
|
4587
4912
|
// 「原邮件」回链:从邮件建出来的任务要能跳回去看一眼原文。
|
|
4588
4913
|
}, {});
|
|
4589
4914
|
module2.exports = { ICONS: set.ICONS, Icon: set.Icon, label: set.label };
|
|
@@ -5204,6 +5529,7 @@ var require_node_scope_picker = __commonJS({
|
|
|
5204
5529
|
var require_stats = __commonJS({
|
|
5205
5530
|
"packages/addons/tasks/client/views/stats.cjs"(exports2, module2) {
|
|
5206
5531
|
var React = require("react");
|
|
5532
|
+
var DV = require_display_variants();
|
|
5207
5533
|
var h = React.createElement;
|
|
5208
5534
|
var charts = require_charts();
|
|
5209
5535
|
var configClient = require_config_client();
|
|
@@ -5513,6 +5839,7 @@ var require_stats = __commonJS({
|
|
|
5513
5839
|
}
|
|
5514
5840
|
function TasksStatsBody(props) {
|
|
5515
5841
|
var lang = props.lang === "en" ? "en" : "zh";
|
|
5842
|
+
var compactDisplay = props.display;
|
|
5516
5843
|
var t = COPY[lang];
|
|
5517
5844
|
var api = props.api;
|
|
5518
5845
|
var cfg = props.cfg || {};
|
|
@@ -5918,9 +6245,10 @@ var require_stats = __commonJS({
|
|
|
5918
6245
|
}
|
|
5919
6246
|
}
|
|
5920
6247
|
if (data) children.push(h(ch.Warnings, { key: "warn", items: data.warnings || [] }));
|
|
6248
|
+
var compact = DV.isCompact(compactDisplay);
|
|
5921
6249
|
return h(
|
|
5922
6250
|
"div",
|
|
5923
|
-
{ className: "wbt-stats" },
|
|
6251
|
+
{ className: "wbt-stats" + (compact ? " wbt-compact" : ""), "data-wb-layout": compact ? "compact" : "wide" },
|
|
5924
6252
|
h(ch.RangeSwitch, {
|
|
5925
6253
|
options,
|
|
5926
6254
|
value: customFrom || customTo ? null : range,
|
|
@@ -6034,6 +6362,25 @@ var require_copy = __commonJS({
|
|
|
6034
6362
|
all: "\u5168\u90E8",
|
|
6035
6363
|
empty: "\u8FD9\u4E2A\u89C6\u56FE\u8FD8\u6CA1\u6709\u4EFB\u52A1",
|
|
6036
6364
|
loading: "\u52A0\u8F7D\u4E2D\u2026",
|
|
6365
|
+
// 窄屏(屏 + 面板栈)专用文案:顶栏、作用域行、底条与选择模式各占一组。
|
|
6366
|
+
records: "\u8BB0\u5F55",
|
|
6367
|
+
dueToday: "\u4ECA\u5929\u5230\u671F",
|
|
6368
|
+
dueTomorrow: "\u660E\u5929\u5230\u671F",
|
|
6369
|
+
back: "\u8FD4\u56DE",
|
|
6370
|
+
more: "\u66F4\u591A",
|
|
6371
|
+
actions: "\u64CD\u4F5C",
|
|
6372
|
+
catalog: "\u76EE\u5F55",
|
|
6373
|
+
perPage: "\u6BCF\u9875",
|
|
6374
|
+
reset: "\u91CD\u7F6E",
|
|
6375
|
+
results: "\u663E\u793A {n} \u6761\u7ED3\u679C",
|
|
6376
|
+
emptyDir: "\u8FD9\u4E2A\u76EE\u5F55\u8FD8\u6CA1\u6709\u4EFB\u52A1",
|
|
6377
|
+
emptySearch: "\u6CA1\u6709\u5339\u914D\u7684\u4EFB\u52A1",
|
|
6378
|
+
daysLeft: "\u8FD8\u5269 {n} \u5929",
|
|
6379
|
+
overdue: "\u5DF2\u903E\u671F {n} \u5929",
|
|
6380
|
+
selectedCount: "\u5DF2\u9009 {n} \u9879",
|
|
6381
|
+
searchCount: "\u641C\u7D22 \xB7 {n} \u6761",
|
|
6382
|
+
viewAll: "\u67E5\u770B\u5168\u90E8",
|
|
6383
|
+
pageOf: "\u7B2C {n} / {total} \u9875",
|
|
6037
6384
|
error: "\u64CD\u4F5C\u5931\u8D25\uFF1A",
|
|
6038
6385
|
save: "\u4FDD\u5B58",
|
|
6039
6386
|
cancel: "\u53D6\u6D88",
|
|
@@ -6139,6 +6486,8 @@ var require_copy = __commonJS({
|
|
|
6139
6486
|
restart: "\u91CD\u542F",
|
|
6140
6487
|
complete: "\u5B8C\u6210",
|
|
6141
6488
|
shutdownOp: "\u5173\u95ED",
|
|
6489
|
+
refreshing: "\u5237\u65B0\u4E2D\u2026",
|
|
6490
|
+
releaseRefresh: "\u677E\u5F00\u5237\u65B0",
|
|
6142
6491
|
selected: "\u5DF2\u9009",
|
|
6143
6492
|
selectedTasks: "\u9009\u4E2D\u4EFB\u52A1",
|
|
6144
6493
|
batchTimeline: "\u5F52\u5E76\u65F6\u95F4\u7EBF",
|
|
@@ -6228,6 +6577,25 @@ var require_copy = __commonJS({
|
|
|
6228
6577
|
all: "All",
|
|
6229
6578
|
empty: "No tasks in this view",
|
|
6230
6579
|
loading: "Loading\u2026",
|
|
6580
|
+
// Narrow (screen + panel stack) copy: top bar, scope row, bottom bar, selection mode.
|
|
6581
|
+
records: "Records",
|
|
6582
|
+
dueToday: "Due today",
|
|
6583
|
+
dueTomorrow: "Due tomorrow",
|
|
6584
|
+
back: "Back",
|
|
6585
|
+
more: "More",
|
|
6586
|
+
actions: "Actions",
|
|
6587
|
+
catalog: "Folders",
|
|
6588
|
+
perPage: "Per page",
|
|
6589
|
+
reset: "Reset",
|
|
6590
|
+
results: "Show {n} results",
|
|
6591
|
+
emptyDir: "No tasks in this folder yet",
|
|
6592
|
+
emptySearch: "No matching tasks",
|
|
6593
|
+
daysLeft: "{n} days left",
|
|
6594
|
+
overdue: "{n} days overdue",
|
|
6595
|
+
selectedCount: "{n} selected",
|
|
6596
|
+
searchCount: "Search \xB7 {n}",
|
|
6597
|
+
viewAll: "View all",
|
|
6598
|
+
pageOf: "Page {n} / {total}",
|
|
6231
6599
|
error: "Failed: ",
|
|
6232
6600
|
save: "Save",
|
|
6233
6601
|
cancel: "Cancel",
|
|
@@ -6333,6 +6701,8 @@ var require_copy = __commonJS({
|
|
|
6333
6701
|
restart: "Restart",
|
|
6334
6702
|
complete: "Complete",
|
|
6335
6703
|
shutdownOp: "Close",
|
|
6704
|
+
refreshing: "Refreshing\u2026",
|
|
6705
|
+
releaseRefresh: "Release to refresh",
|
|
6336
6706
|
selected: "Selected",
|
|
6337
6707
|
selectedTasks: "Selected tasks",
|
|
6338
6708
|
batchTimeline: "Merge timeline",
|
|
@@ -6391,6 +6761,11 @@ var require_overlay = __commonJS({
|
|
|
6391
6761
|
"use strict";
|
|
6392
6762
|
var defaultReact = require("react");
|
|
6393
6763
|
var FOCUSABLE = "button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),a[href]";
|
|
6764
|
+
var SHEET_STYLES = [
|
|
6765
|
+
".wbov-mask.is-sheet.is-sheet{display:block;padding:0;background:var(--wb-card,#141414)}",
|
|
6766
|
+
".wbov-sheet.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)}",
|
|
6767
|
+
".wbov-sheet.wbov-sheet>*{max-width:100%}"
|
|
6768
|
+
].join("\n");
|
|
6394
6769
|
module2.exports = function createOverlay(options) {
|
|
6395
6770
|
var opts = options || {};
|
|
6396
6771
|
var React = opts.React || defaultReact;
|
|
@@ -6455,10 +6830,11 @@ var require_overlay = __commonJS({
|
|
|
6455
6830
|
}
|
|
6456
6831
|
}
|
|
6457
6832
|
var labelledBy = ariaLabelledByOf(props);
|
|
6833
|
+
var sheet = props.sheet === true;
|
|
6458
6834
|
return h(
|
|
6459
6835
|
"div",
|
|
6460
6836
|
{
|
|
6461
|
-
className: maskClass,
|
|
6837
|
+
className: maskClass + (sheet ? " is-sheet" : ""),
|
|
6462
6838
|
onMouseDown: function(e) {
|
|
6463
6839
|
var allowed = props.closeOnMask !== void 0 ? props.closeOnMask : closeOnMask(props);
|
|
6464
6840
|
if (e.target === e.currentTarget && props.onClose && allowed) props.onClose();
|
|
@@ -6467,7 +6843,7 @@ var require_overlay = __commonJS({
|
|
|
6467
6843
|
h(
|
|
6468
6844
|
tag,
|
|
6469
6845
|
{
|
|
6470
|
-
className: dialogClass + dialogClassOf(props),
|
|
6846
|
+
className: dialogClass + dialogClassOf(props) + (sheet ? " wbov-sheet" : ""),
|
|
6471
6847
|
role: "dialog",
|
|
6472
6848
|
"aria-modal": true,
|
|
6473
6849
|
"aria-label": labelledBy ? null : ariaLabelOf(props),
|
|
@@ -6483,6 +6859,7 @@ var require_overlay = __commonJS({
|
|
|
6483
6859
|
}
|
|
6484
6860
|
return Modal;
|
|
6485
6861
|
};
|
|
6862
|
+
module2.exports.sheetStyles = SHEET_STYLES;
|
|
6486
6863
|
}
|
|
6487
6864
|
});
|
|
6488
6865
|
|
|
@@ -6492,6 +6869,7 @@ var require_workspace_view = __commonJS({
|
|
|
6492
6869
|
"use strict";
|
|
6493
6870
|
module2.exports = function(deps) {
|
|
6494
6871
|
var React = deps.React, h = React.createElement;
|
|
6872
|
+
var DV = require_display_variants();
|
|
6495
6873
|
var createOverlay = deps.createOverlay;
|
|
6496
6874
|
var FormOverlay = createOverlay({
|
|
6497
6875
|
React,
|
|
@@ -6599,6 +6977,10 @@ var require_workspace_view = __commonJS({
|
|
|
6599
6977
|
}
|
|
6600
6978
|
};
|
|
6601
6979
|
var CSS = [
|
|
6980
|
+
/* 窄档:卡片单列铺满,操作按钮整行靠右,长标题换行不截断。 */
|
|
6981
|
+
".wbt-compact .wbt-ws-row{flex-direction:column;align-items:stretch;gap:10px}",
|
|
6982
|
+
".wbt-compact .wbt-ws-titleline{flex-wrap:wrap}",
|
|
6983
|
+
".wbt-compact .wbt-ws-ops{justify-content:flex-end;width:100%;flex-wrap:wrap}",
|
|
6602
6984
|
".wbt-ws-heading{display:flex;flex-direction:column;gap:2px;min-width:0}",
|
|
6603
6985
|
".wbt-ws-h2{margin:0;font-size:17px;line-height:1.3;font-weight:600}",
|
|
6604
6986
|
".wbt-ws-hint{font-size:12px;line-height:1.4;color:var(--dsw-alias-label-secondary,inherit);overflow-wrap:anywhere}",
|
|
@@ -6699,6 +7081,7 @@ var require_workspace_view = __commonJS({
|
|
|
6699
7081
|
}
|
|
6700
7082
|
function WorkspaceView(props) {
|
|
6701
7083
|
var lang = props.lang === "en" ? "en" : "zh", t = COPY[lang];
|
|
7084
|
+
var compact = DV.isCompact(props.display);
|
|
6702
7085
|
var api = props.api;
|
|
6703
7086
|
var listS = React.useState(null), records = listS[0], setRecords = listS[1];
|
|
6704
7087
|
var busyS = React.useState(true), busy = busyS[0], setBusy = busyS[1];
|
|
@@ -6845,7 +7228,7 @@ var require_workspace_view = __commonJS({
|
|
|
6845
7228
|
else body = shown.map(row);
|
|
6846
7229
|
return h(
|
|
6847
7230
|
"div",
|
|
6848
|
-
{ className: "wbt-root wbt-ws" },
|
|
7231
|
+
{ className: "wbt-root wbt-ws" + (compact ? " wbt-compact" : ""), "data-wb-layout": compact ? "compact" : "wide" },
|
|
6849
7232
|
h("style", null, CSS),
|
|
6850
7233
|
h(
|
|
6851
7234
|
"div",
|
|
@@ -7195,16 +7578,272 @@ var require_description = __commonJS({
|
|
|
7195
7578
|
}
|
|
7196
7579
|
});
|
|
7197
7580
|
|
|
7581
|
+
// packages/addons/lib/density-tokens.cjs
|
|
7582
|
+
var require_density_tokens = __commonJS({
|
|
7583
|
+
"packages/addons/lib/density-tokens.cjs"(exports2, module2) {
|
|
7584
|
+
"use strict";
|
|
7585
|
+
var CSS = [
|
|
7586
|
+
// 基础尺寸:全仓唯一允许出现控件高度像素的地方。
|
|
7587
|
+
":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}",
|
|
7588
|
+
// 缺省密度 = comfortable:没有 [data-wb-density] 时(独立预览页、老宿主)也有一组合法映射。
|
|
7589
|
+
':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)}',
|
|
7590
|
+
// 桌面大屏:更紧的间距,控件高度下降一档。
|
|
7591
|
+
'[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)}',
|
|
7592
|
+
// 显式声明的宽松档:只放大尺寸与间距,不引入第三套结构。
|
|
7593
|
+
'[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)}',
|
|
7594
|
+
// 触控底线:粗指针设备上把按钮撑到 32px,宽档(fine pointer)像素不变。
|
|
7595
|
+
'[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)}',
|
|
7596
|
+
// 触控端表单控件同样不能低于 32px,否则点按会漏。
|
|
7597
|
+
'[data-wb-pointer="coarse"] :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select){min-height:var(--wb-ctl-h-md)}'
|
|
7598
|
+
].join("\n");
|
|
7599
|
+
module2.exports = CSS;
|
|
7600
|
+
}
|
|
7601
|
+
});
|
|
7602
|
+
|
|
7198
7603
|
// packages/addons/lib/visual-tokens.cjs
|
|
7199
7604
|
var require_visual_tokens = __commonJS({
|
|
7200
7605
|
"packages/addons/lib/visual-tokens.cjs"(exports2, module2) {
|
|
7201
|
-
module2.exports = `
|
|
7606
|
+
module2.exports = require_density_tokens() + `
|
|
7202
7607
|
: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}
|
|
7203
7608
|
.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}
|
|
7204
7609
|
`;
|
|
7205
7610
|
}
|
|
7206
7611
|
});
|
|
7207
7612
|
|
|
7613
|
+
// packages/addons/lib/scroll-strip.cjs
|
|
7614
|
+
var require_scroll_strip = __commonJS({
|
|
7615
|
+
"packages/addons/lib/scroll-strip.cjs"(exports2, module2) {
|
|
7616
|
+
"use strict";
|
|
7617
|
+
var STYLES = [
|
|
7618
|
+
".wbstrip{position:relative;min-width:0}",
|
|
7619
|
+
".wbstrip-inner{display:flex;gap:6px;align-items:center;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-ms-overflow-style:none;scroll-behavior:smooth;padding:2px 0;overscroll-behavior-x:contain}",
|
|
7620
|
+
".wbstrip-inner::-webkit-scrollbar{display:none}",
|
|
7621
|
+
".wbstrip-inner>*{flex:none}",
|
|
7622
|
+
".wbstrip[data-edge=start] .wbstrip-inner,.wbstrip[data-edge=both] .wbstrip-inner{mask-image:linear-gradient(to right,transparent,currentColor 18px)}",
|
|
7623
|
+
".wbstrip[data-edge=end] .wbstrip-inner,.wbstrip[data-edge=both] .wbstrip-inner{mask-image:linear-gradient(to left,transparent,currentColor 18px)}",
|
|
7624
|
+
".wbstrip[data-edge=both] .wbstrip-inner{mask-image:linear-gradient(to right,transparent,currentColor 18px,currentColor calc(100% - 18px),transparent)}",
|
|
7625
|
+
".wbstrip-inner:focus-visible{outline:0;box-shadow:inset 0 0 0 2px var(--wb-accent);border-radius:8px}",
|
|
7626
|
+
"@media (prefers-reduced-motion: reduce){.wbstrip-inner{scroll-behavior:auto}}"
|
|
7627
|
+
].join("\n");
|
|
7628
|
+
function wheelDelta(input) {
|
|
7629
|
+
var deltaX = Number(input && input.deltaX) || 0;
|
|
7630
|
+
var deltaY = Number(input && input.deltaY) || 0;
|
|
7631
|
+
if (Math.abs(deltaX) >= Math.abs(deltaY)) return deltaX;
|
|
7632
|
+
return deltaY;
|
|
7633
|
+
}
|
|
7634
|
+
function edgeState(input) {
|
|
7635
|
+
var scrollLeft = Number(input && input.scrollLeft) || 0;
|
|
7636
|
+
var scrollWidth = Number(input && input.scrollWidth) || 0;
|
|
7637
|
+
var clientWidth = Number(input && input.clientWidth) || 0;
|
|
7638
|
+
var overflow = scrollWidth - clientWidth > 1;
|
|
7639
|
+
if (!overflow) return { scrollable: false, edge: "none" };
|
|
7640
|
+
var atStart = scrollLeft <= 1;
|
|
7641
|
+
var atEnd = scrollLeft + clientWidth >= scrollWidth - 1;
|
|
7642
|
+
if (atStart && atEnd) return { scrollable: false, edge: "none" };
|
|
7643
|
+
if (atStart) return { scrollable: true, edge: "end" };
|
|
7644
|
+
if (atEnd) return { scrollable: true, edge: "start" };
|
|
7645
|
+
return { scrollable: true, edge: "both" };
|
|
7646
|
+
}
|
|
7647
|
+
function ScrollStrip(props) {
|
|
7648
|
+
var h = props.h;
|
|
7649
|
+
var React = props.React;
|
|
7650
|
+
var ref = React.useRef ? React.useRef(null) : { current: null };
|
|
7651
|
+
var state = React.useState("none");
|
|
7652
|
+
var edge = state[0];
|
|
7653
|
+
var setEdge = state[1];
|
|
7654
|
+
function refresh() {
|
|
7655
|
+
var node = ref.current;
|
|
7656
|
+
if (!node) return;
|
|
7657
|
+
var next = edgeState({ scrollLeft: node.scrollLeft, scrollWidth: node.scrollWidth, clientWidth: node.clientWidth });
|
|
7658
|
+
setEdge(next.edge);
|
|
7659
|
+
}
|
|
7660
|
+
React.useEffect(function() {
|
|
7661
|
+
refresh();
|
|
7662
|
+
var node = ref.current;
|
|
7663
|
+
if (!node) return void 0;
|
|
7664
|
+
node.addEventListener("scroll", refresh, { passive: true });
|
|
7665
|
+
var observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(refresh) : null;
|
|
7666
|
+
if (observer) observer.observe(node);
|
|
7667
|
+
return function() {
|
|
7668
|
+
node.removeEventListener("scroll", refresh);
|
|
7669
|
+
if (observer) observer.disconnect();
|
|
7670
|
+
};
|
|
7671
|
+
}, []);
|
|
7672
|
+
function onWheel(event) {
|
|
7673
|
+
var node = ref.current;
|
|
7674
|
+
if (!node) return;
|
|
7675
|
+
var delta = wheelDelta({ deltaX: event.deltaX, deltaY: event.deltaY });
|
|
7676
|
+
if (!delta) return;
|
|
7677
|
+
var max = node.scrollWidth - node.clientWidth;
|
|
7678
|
+
if (max <= 0) return;
|
|
7679
|
+
event.preventDefault();
|
|
7680
|
+
node.scrollLeft = Math.max(0, Math.min(max, node.scrollLeft + delta));
|
|
7681
|
+
}
|
|
7682
|
+
function onKeyDown(event) {
|
|
7683
|
+
var node = ref.current;
|
|
7684
|
+
if (!node) return;
|
|
7685
|
+
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
7686
|
+
event.preventDefault();
|
|
7687
|
+
node.scrollLeft += event.key === "ArrowLeft" ? -120 : 120;
|
|
7688
|
+
}
|
|
7689
|
+
return h("div", { className: "wbstrip", "data-edge": edge }, [
|
|
7690
|
+
h("div", {
|
|
7691
|
+
className: "wbstrip-inner",
|
|
7692
|
+
key: "inner",
|
|
7693
|
+
ref,
|
|
7694
|
+
tabIndex: 0,
|
|
7695
|
+
role: props.role || "group",
|
|
7696
|
+
"aria-label": props.label,
|
|
7697
|
+
onWheel,
|
|
7698
|
+
onKeyDown
|
|
7699
|
+
}, props.children)
|
|
7700
|
+
]);
|
|
7701
|
+
}
|
|
7702
|
+
module2.exports = {
|
|
7703
|
+
styles: STYLES,
|
|
7704
|
+
wheelDelta,
|
|
7705
|
+
edgeState,
|
|
7706
|
+
ScrollStrip
|
|
7707
|
+
};
|
|
7708
|
+
}
|
|
7709
|
+
});
|
|
7710
|
+
|
|
7711
|
+
// packages/addons/tasks/client/ui/compact-styles.cjs
|
|
7712
|
+
var require_compact_styles = __commonJS({
|
|
7713
|
+
"packages/addons/tasks/client/ui/compact-styles.cjs"(exports2, module2) {
|
|
7714
|
+
"use strict";
|
|
7715
|
+
module2.exports = [
|
|
7716
|
+
// ── 屏骨架:屏自己是一列,中间那段是唯一滚动区,底条由 flex 压到底 ─────────────
|
|
7717
|
+
".wbtc{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;position:relative}",
|
|
7718
|
+
".wbtc-screen{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;background:var(--wb-surface)}",
|
|
7719
|
+
// ── 顶栏:一层装下返回、标题、动作;搜索展开时整行让给输入框 ─────────────────
|
|
7720
|
+
".wbtc-top{display:flex;align-items:center;gap:6px;flex:none;padding:6px 10px 6px 6px;background:var(--wb-surface);border-bottom:1px solid var(--wb-line)}",
|
|
7721
|
+
".wbtc-icon{display:inline-flex;align-items:center;justify-content:center;flex:none;width:36px;height:36px;border-radius:9px;border:1px solid transparent;background:transparent;color:var(--wb-text,currentColor);cursor:pointer}",
|
|
7722
|
+
".wbtc-icon:hover{background:color-mix(in oklab,var(--wb-text,currentColor) 8%,transparent)}",
|
|
7723
|
+
".wbtc-icon:focus-visible{outline:2px solid color-mix(in oklab,var(--wb-accent) 60%,transparent);outline-offset:1px}",
|
|
7724
|
+
".wbtc-icon:disabled{opacity:.35;cursor:default;background:transparent}",
|
|
7725
|
+
".wbtc-icon[aria-pressed=true]{background:color-mix(in oklab,var(--wb-accent) 16%,transparent);color:var(--wb-accent)}",
|
|
7726
|
+
".wbtc-headtext{display:flex;flex-direction:column;gap:1px;flex:1;min-width:0;text-align:left;border:0;background:transparent;padding:0 2px;color:inherit;font:inherit;cursor:pointer}",
|
|
7727
|
+
".wbtc-headtitle{font-size:15px;font-weight:600;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
7728
|
+
".wbtc-headsub{font-size:11.5px;color:var(--wb-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
7729
|
+
".wbtc-search{display:flex;align-items:center;gap:6px;flex:1;min-width:0;padding-right:2px}",
|
|
7730
|
+
".wbtc-search input{flex:1;min-width:0;height:36px;border-radius:9px;border:1px solid var(--wb-line);background:var(--wb-surface);color:var(--wb-text,currentColor);padding:0 10px;font:inherit;font-size:13.5px}",
|
|
7731
|
+
".wbtc-search input:focus-visible{outline:2px solid color-mix(in oklab,var(--wb-accent) 55%,transparent);outline-offset:-1px}",
|
|
7732
|
+
".wbtc-badge-dot{position:absolute;top:5px;right:5px;min-width:15px;height:15px;border-radius:8px;background:var(--wb-accent);color:var(--wb-on-accent,var(--dsw-alias-label-primary-inverted,#fff));font-size:10px;line-height:15px;text-align:center;padding:0 3px;font-variant-numeric:tabular-nums}",
|
|
7733
|
+
".wbtc-iconpos{position:relative}",
|
|
7734
|
+
// ── 作用域行:面包屑 + 条数 + 目录入口 ────────────────────────────────────────
|
|
7735
|
+
// 矮窗(横向手机):纵向预算只够「顶栏 + 作用域行 + 一排 chips + 底条 + 两张卡」,
|
|
7736
|
+
// 所以整屏每个部件都收一档,预设 chips 由 list-screen 直接不渲染。
|
|
7737
|
+
".wbtc-screen[data-dense=true]{gap:4px}",
|
|
7738
|
+
".wbtc-screen[data-dense=true] .wbtc-top{padding:4px 8px 4px 4px}",
|
|
7739
|
+
".wbtc-screen[data-dense=true] .wbtc-icon{width:32px;height:32px}",
|
|
7740
|
+
".wbtc-screen[data-dense=true] .wbtc-scope{min-height:28px;padding:2px 12px}",
|
|
7741
|
+
".wbtc-screen[data-dense=true] .wbtc-chip{height:26px;font-size:12px}",
|
|
7742
|
+
".wbtc-screen[data-dense=true] .wbtc-list{padding:6px 12px 8px;gap:6px}",
|
|
7743
|
+
".wbtc-screen[data-dense=true] .wbtc-card{padding:8px}",
|
|
7744
|
+
".wbtc-screen[data-dense=true] .wbtc-btn,.wbtc-screen[data-dense=true] .wbtc-primary{height:34px}",
|
|
7745
|
+
".wbtc-screen[data-dense=true] .wbbar{padding:4px 12px calc(4px + var(--wb-safe-bottom,0px))}",
|
|
7746
|
+
".wbtc-scope{display:flex;align-items:center;gap:8px;flex:none;padding:4px 12px;background:var(--wb-surface);font-size:12px;color:var(--wb-muted);min-height:32px}",
|
|
7747
|
+
".wbtc-scope .wbt-path{display:flex;align-items:center;gap:1px;flex:1;min-width:0;overflow:hidden}",
|
|
7748
|
+
".wbtc-scope .wbt-path button{max-width:9em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
7749
|
+
".wbtc-scope-count{flex:none;font-variant-numeric:tabular-nums;white-space:nowrap}",
|
|
7750
|
+
".wbtc-scope .wbtc-icon{width:28px;height:28px}",
|
|
7751
|
+
// ── chips 行(状态 + 快捷预设):横滑,预设默认一行、可展开两行 ────────────────
|
|
7752
|
+
".wbtc-chips{padding:2px 0 4px 12px;background:var(--wb-surface)}",
|
|
7753
|
+
".wbtc-chips .wbstrip-inner{gap:6px;padding-right:12px}",
|
|
7754
|
+
".wbtc-presets .wbstrip-inner{flex-wrap:nowrap}",
|
|
7755
|
+
".wbtc-presets[data-open=true] .wbstrip-inner{flex-wrap:wrap;overflow:visible}",
|
|
7756
|
+
".wbtc-chip{display:inline-flex;align-items:center;gap:5px;flex:none;height:30px;padding:0 11px;border-radius:999px;border:1px solid var(--wb-line);background:var(--wb-card);color:var(--wb-text,currentColor);font-size:12.5px;cursor:pointer;white-space:nowrap}",
|
|
7757
|
+
".wbtc-chip:hover{border-color:var(--wb-border)}",
|
|
7758
|
+
".wbtc-chip:focus-visible{outline:2px solid color-mix(in oklab,var(--wb-accent) 55%,transparent);outline-offset:1px}",
|
|
7759
|
+
".wbtc-chip[aria-pressed=true]{border-color:color-mix(in oklab,var(--wb-accent) 55%,var(--wb-line));background:color-mix(in oklab,var(--wb-accent) 14%,transparent);color:var(--wb-accent);font-weight:600}",
|
|
7760
|
+
".wbtc-chip .n{font-size:11px;opacity:.72;font-variant-numeric:tabular-nums}",
|
|
7761
|
+
".wbtc-chip.is-preset{height:26px;padding:0 10px;font-size:12px}",
|
|
7762
|
+
".wbtc-more{display:inline-flex;align-items:center;gap:3px;flex:none;height:26px;padding:0 8px;border-radius:999px;border:1px dashed var(--wb-line);background:transparent;color:var(--wb-muted);font-size:11.5px;cursor:pointer}",
|
|
7763
|
+
// ── 列表:唯一滚动层 ─────────────────────────────────────────────────────────
|
|
7764
|
+
".wbtc-list{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:8px 12px 12px;display:flex;flex-direction:column;gap:8px;-webkit-overflow-scrolling:touch}",
|
|
7765
|
+
".wbtc-list.is-empty{justify-content:center;align-items:center;padding-bottom:32px}",
|
|
7766
|
+
".wbtc-empty{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--wb-muted);font-size:13px;text-align:center;padding:24px 12px}",
|
|
7767
|
+
".wbtc-note{padding:10px 12px;border-radius:9px;border:1px solid color-mix(in oklab,var(--wb-danger) 40%,var(--wb-line));background:color-mix(in oklab,var(--wb-danger) 8%,transparent);color:var(--wb-danger);font-size:12.5px}",
|
|
7768
|
+
// ── 卡片:卡内不留操作按钮,长按出菜单 ───────────────────────────────────────
|
|
7769
|
+
".wbtc-card{display:flex;align-items:flex-start;gap:8px;cursor:pointer;border:1px solid var(--wb-line);border-radius:10px;background:var(--wb-card);padding:10px}",
|
|
7770
|
+
".wbtc-card:hover{border-color:var(--wb-border)}",
|
|
7771
|
+
".wbtc-card:focus-visible{outline:2px solid color-mix(in oklab,var(--wb-accent) 55%,transparent);outline-offset:1px}",
|
|
7772
|
+
".wbtc-card[aria-selected=true]{border-color:color-mix(in oklab,var(--wb-accent) 60%,var(--wb-line));background:color-mix(in oklab,var(--wb-accent) 8%,var(--wb-card))}",
|
|
7773
|
+
".wbtc-card-inner{display:flex;align-items:flex-start;gap:8px;flex:1;min-width:0}",
|
|
7774
|
+
".wbtc-card-body{display:flex;flex-direction:column;gap:5px;flex:1;min-width:0}",
|
|
7775
|
+
".wbtc-card-top{display:flex;align-items:center;gap:6px;min-width:0}",
|
|
7776
|
+
".wbtc-card-title{flex:1;min-width:0;font-size:14px;font-weight:600;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}",
|
|
7777
|
+
".wbtc-card-tags{display:flex;flex-wrap:wrap;gap:4px;min-width:0}",
|
|
7778
|
+
// 目标日期左、难度与发布时间右:一行装完,日期写「还剩 N 天」而不是倒计时秒数。
|
|
7779
|
+
".wbtc-card-foot{display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 8px;font-size:11px;color:var(--wb-muted);min-width:0}",
|
|
7780
|
+
".wbtc-card-due{flex:none;font-variant-numeric:tabular-nums;white-space:nowrap}",
|
|
7781
|
+
".wbtc-card-due.is-over{color:var(--wb-danger)}",
|
|
7782
|
+
".wbtc-card-right{margin-left:auto;display:flex;align-items:center;gap:8px;min-width:0;overflow:hidden}",
|
|
7783
|
+
".wbtc-card-stars{flex:none;letter-spacing:-1px}",
|
|
7784
|
+
// 发布日期不许被压成半截数字(320 宽时最容易发生):给右侧组撑住,必要时整体换行。
|
|
7785
|
+
".wbtc-card-pub{flex:none;font-variant-numeric:tabular-nums;white-space:nowrap}",
|
|
7786
|
+
".wbtc-card-right{flex:none;margin-left:auto;display:inline-flex;align-items:center;gap:8px}",
|
|
7787
|
+
".wbtc-card-ws{max-width:9em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
7788
|
+
".wbtc-card-go{flex:none;display:flex;align-items:center;color:var(--wb-muted);padding-top:2px}",
|
|
7789
|
+
".wbtc-check{flex:none;width:20px;height:20px;margin-top:2px;accent-color:var(--wb-accent)}",
|
|
7790
|
+
// ── 底条内部件 ───────────────────────────────────────────────────────────────
|
|
7791
|
+
".wbtc-pager{display:flex;align-items:center;gap:2px;flex:0 0 auto;min-width:0}",
|
|
7792
|
+
".wbtc-pager .wbtc-icon{width:32px;height:32px}",
|
|
7793
|
+
".wbtc-primary-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
7794
|
+
// 320 宽时主按钮只剩约 32px 内容宽,标签必须能截断而不是撑破底条
|
|
7795
|
+
".wbtc-pageno{min-width:0;flex:0 1 auto;padding:0 2px;text-align:center;font-size:12px;color:var(--wb-muted);font-variant-numeric:tabular-nums;white-space:nowrap}",
|
|
7796
|
+
".wbtc-perpage{flex:none;height:32px;border-radius:8px;border:1px solid var(--wb-line);background:var(--wb-card);color:var(--wb-text,currentColor);font:inherit;font-size:12px;padding:0 4px}",
|
|
7797
|
+
".wbtc-primary{display:inline-flex;align-items:center;justify-content:center;gap:4px;flex:1 1 auto;min-width:76px;padding:0 6px;height:40px;border-radius:10px;border:1px solid var(--wb-accent);background:var(--wb-accent);color:var(--wb-on-accent,var(--dsw-alias-label-primary-inverted,#fff));font:inherit;font-size:14px;font-weight:600;cursor:pointer}",
|
|
7798
|
+
".wbtc-primary:disabled{opacity:.5;cursor:default}",
|
|
7799
|
+
".wbtc-primary:focus-visible{outline:2px solid color-mix(in oklab,var(--wb-accent) 55%,transparent);outline-offset:2px}",
|
|
7800
|
+
".wbtc-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:40px;padding:0 12px;border-radius:10px;border:1px solid var(--wb-line);background:var(--wb-card);color:var(--wb-text,currentColor);font:inherit;font-size:13.5px;cursor:pointer;flex:none}",
|
|
7801
|
+
".wbtc-btn:hover{border-color:var(--wb-border)}",
|
|
7802
|
+
".wbtc-btn:disabled{opacity:.5;cursor:default}",
|
|
7803
|
+
".wbtc-btn.is-danger{color:var(--wb-danger);border-color:color-mix(in oklab,var(--wb-danger) 45%,var(--wb-line))}",
|
|
7804
|
+
// ── 详情屏:整页滚动,顶栏与底条固定 ─────────────────────────────────────────
|
|
7805
|
+
".wbtc-detail .wbt-ops{display:none}",
|
|
7806
|
+
// 详情屏的操作搬到底条(拇指区),正文里不再挂第二份入口
|
|
7807
|
+
".wbtc-detail{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:12px 12px 16px;display:flex;flex-direction:column;gap:12px}",
|
|
7808
|
+
".wbtc-detail-top{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12px;color:var(--wb-muted)}",
|
|
7809
|
+
".wbtc-detail-title{font-size:18px;font-weight:650;line-height:1.35;word-break:break-word}",
|
|
7810
|
+
".wbtc-detail-facts{display:flex;flex-direction:column;gap:4px;font-size:12.5px;color:var(--wb-muted)}",
|
|
7811
|
+
".wbtc-detail-facts .wbt-path{margin:0}",
|
|
7812
|
+
".wbtc-detail-id{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;color:var(--wb-muted);word-break:break-all;border:0;background:transparent;padding:0;text-align:left;cursor:copy}",
|
|
7813
|
+
// ── 长按菜单与筛选/目录面板内部 ──────────────────────────────────────────────
|
|
7814
|
+
".wbtc-actions{display:flex;flex-direction:column;gap:8px;padding:4px 0 calc(8px + var(--wb-safe-bottom,0px))}",
|
|
7815
|
+
".wbtc-actions .wbtc-btn{justify-content:flex-start;width:100%}",
|
|
7816
|
+
// 面板内容自己管滚动:目录树占满剩余高度、底部「新建组/新建表/管理模式」钉在面板底,
|
|
7817
|
+
// 否则树短的时候按钮会浮在半空、留下一大片空白。
|
|
7818
|
+
".wbtc-sheet{display:flex;flex-direction:column;gap:8px;flex:1;min-height:0;overflow:auto;padding:2px 0 8px}",
|
|
7819
|
+
".wbtc-sheet>.wbtc-tree-search,.wbtc-sheet>.wbtc-tree,.wbtc-sheet>.wbtc-tree-adds{flex:none}",
|
|
7820
|
+
".wbtc-sheet.is-catalog{overflow:hidden}",
|
|
7821
|
+
".wbtc-sheet.is-catalog>.wbtc-tree{flex:1 1 auto;min-height:0;overflow:auto;border-bottom:1px solid var(--wb-line)}",
|
|
7822
|
+
".wbtc-sheet .wbt-filter-panel{width:100%;max-height:none;flex:none;border:0;padding:0}",
|
|
7823
|
+
".wbtc-sheet .wbt-filter-toggle{display:none}",
|
|
7824
|
+
// 目录面板的窄屏树:一行一个 44px 高的触屏目标,展开箭头在左、名字在中间可点、
|
|
7825
|
+
// 条数在右、当前项用一个圆点而不是整行高亮(高亮在深色下会盖掉目录名)。
|
|
7826
|
+
".wbtc-tree{display:flex;flex-direction:column;gap:2px;padding:2px 0}",
|
|
7827
|
+
".wbtc-node{display:flex;align-items:center;gap:4px;min-height:44px;border-radius:8px}",
|
|
7828
|
+
".wbtc-node.is-current{background:var(--wb-surface)}",
|
|
7829
|
+
".wbtc-node-chev{flex:none;width:26px;height:32px;display:inline-flex;align-items:center;justify-content:center;border:0;background:none;color:var(--wb-muted);padding:0}",
|
|
7830
|
+
".wbtc-node-main{flex:1;display:flex;align-items:center;gap:8px;min-width:0;min-height:44px;border:0;background:none;color:var(--wb-text);font:inherit;text-align:left;padding:0 4px;cursor:pointer}",
|
|
7831
|
+
".wbtc-node-main .wbtc-node-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
7832
|
+
".wbtc-node-count{flex:none;color:var(--wb-muted);font-size:12px;font-variant-numeric:tabular-nums}",
|
|
7833
|
+
".wbtc-node-dot{flex:none;width:8px;height:8px;border-radius:50%;background:var(--wb-accent);margin-right:6px}",
|
|
7834
|
+
// 折叠的日期分组比常驻分组矮一档,标题字重也收一点,避免整页看起来全是标题。
|
|
7835
|
+
".wbtc-sheet .wb-disc.wbt-filter-fold{border-bottom:1px solid var(--wb-line);padding:2px 0}",
|
|
7836
|
+
".wbtc-sheet .wb-disc.wbt-filter-fold+ .wb-disc.wbt-filter-fold{border-top:0}",
|
|
7837
|
+
".wbtc-sheet-foot{flex:none;padding:8px 0 0;border-top:1px solid var(--wb-line);display:flex;gap:8px;align-items:center}",
|
|
7838
|
+
".wbtc-sheet-foot .wbtc-primary{flex:1}",
|
|
7839
|
+
".wbtc-tree-search{display:flex;gap:6px;flex:none}",
|
|
7840
|
+
".wbtc-tree-adds{display:flex;gap:6px;flex-wrap:wrap;flex:none;padding-top:8px;border-top:1px solid var(--wb-line)}",
|
|
7841
|
+
".wbtc-tree-adds:first-of-type{border-top:0}",
|
|
7842
|
+
".wbtc-crumb-bar{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--wb-muted)}"
|
|
7843
|
+
].join("\n");
|
|
7844
|
+
}
|
|
7845
|
+
});
|
|
7846
|
+
|
|
7208
7847
|
// packages/addons/lib/filter-checklist-styles.cjs
|
|
7209
7848
|
var require_filter_checklist_styles = __commonJS({
|
|
7210
7849
|
"packages/addons/lib/filter-checklist-styles.cjs"(exports2, module2) {
|
|
@@ -7241,7 +7880,7 @@ var require_filter_checklist_styles = __commonJS({
|
|
|
7241
7880
|
".wbck-meta{margin-left:auto;flex:none;font-size:11.5px;color:var(--wb-muted)}",
|
|
7242
7881
|
".wbck-note{font-size:12px;color:var(--wb-muted);padding:8px 6px}",
|
|
7243
7882
|
".wbck-more{font-size:11px;color:var(--wb-muted);text-align:center;padding:6px 0 2px;opacity:.8}",
|
|
7244
|
-
"
|
|
7883
|
+
":where([data-wb-lt760]) .wbck-list{max-height:200px}"
|
|
7245
7884
|
];
|
|
7246
7885
|
}
|
|
7247
7886
|
});
|
|
@@ -7620,8 +8259,8 @@ var require_stepper = __commonJS({
|
|
|
7620
8259
|
".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}",
|
|
7621
8260
|
".wbctl-step-opt{flex:none;font-size:10px;font-weight:400;opacity:.55}",
|
|
7622
8261
|
// 窄屏先藏提示,标题仍占满整行;再窄就把标题折行,宁可变高也不截字。
|
|
7623
|
-
"
|
|
7624
|
-
"
|
|
8262
|
+
":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}",
|
|
8263
|
+
":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}",
|
|
7625
8264
|
"@media (prefers-reduced-motion:reduce){.wbctl-step{transition:none}}"
|
|
7626
8265
|
];
|
|
7627
8266
|
module2.exports = { Steps, stepState, styles: STYLES };
|
|
@@ -7910,7 +8549,7 @@ var require_staged_dialog = __commonJS({
|
|
|
7910
8549
|
// 两列字段布局:内容多的弹窗不再单列拉长,窄屏回落单列。
|
|
7911
8550
|
".wbctl-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}",
|
|
7912
8551
|
".wbctl-form>.full{grid-column:1/-1}",
|
|
7913
|
-
"
|
|
8552
|
+
":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}",
|
|
7914
8553
|
"@media (prefers-reduced-motion:reduce){.wbctl-btn{transition:none}}"
|
|
7915
8554
|
];
|
|
7916
8555
|
module2.exports = {
|
|
@@ -7948,16 +8587,255 @@ var require_disclosure_styles = __commonJS({
|
|
|
7948
8587
|
}
|
|
7949
8588
|
});
|
|
7950
8589
|
|
|
8590
|
+
// packages/addons/lib/gestures.cjs
|
|
8591
|
+
var require_gestures = __commonJS({
|
|
8592
|
+
"packages/addons/lib/gestures.cjs"(exports2, module2) {
|
|
8593
|
+
"use strict";
|
|
8594
|
+
var LONG_PRESS_MS = 500;
|
|
8595
|
+
var LONG_PRESS_TOLERANCE = 10;
|
|
8596
|
+
var PULL_THRESHOLD = 60;
|
|
8597
|
+
var PULL_MAX = 120;
|
|
8598
|
+
var PULL_RESISTANCE = 0.55;
|
|
8599
|
+
var SWIPE_BACK_DISTANCE = 80;
|
|
8600
|
+
var SWIPE_BACK_VELOCITY = 0.5;
|
|
8601
|
+
var SWIPE_BACK_EDGE = 48;
|
|
8602
|
+
function longPressDecision(input) {
|
|
8603
|
+
var elapsed = Number(input && input.elapsed) || 0;
|
|
8604
|
+
var moved = Number(input && input.moved) || 0;
|
|
8605
|
+
var ms = Number(input && input.ms) > 0 ? Number(input.ms) : LONG_PRESS_MS;
|
|
8606
|
+
var tolerance = Number(input && input.tolerance) > 0 ? Number(input.tolerance) : LONG_PRESS_TOLERANCE;
|
|
8607
|
+
return elapsed >= ms && moved <= tolerance;
|
|
8608
|
+
}
|
|
8609
|
+
function pullDecision(input) {
|
|
8610
|
+
var dy = Number(input && input.dy) || 0;
|
|
8611
|
+
var atTop = !(input && input.atTop === false);
|
|
8612
|
+
var threshold = Number(input && input.threshold) > 0 ? Number(input.threshold) : PULL_THRESHOLD;
|
|
8613
|
+
var max = Number(input && input.max) > 0 ? Number(input.max) : PULL_MAX;
|
|
8614
|
+
if (!atTop || dy <= 0) return { distance: 0, trigger: false };
|
|
8615
|
+
var distance = Math.min(max, Math.round(dy * PULL_RESISTANCE));
|
|
8616
|
+
return { distance, trigger: distance >= threshold };
|
|
8617
|
+
}
|
|
8618
|
+
function swipeBackDecision(input) {
|
|
8619
|
+
var dx = Number(input && input.dx) || 0;
|
|
8620
|
+
var dy = Number(input && input.dy) || 0;
|
|
8621
|
+
var velocity = Number(input && input.velocity) || 0;
|
|
8622
|
+
var distance = Number(input && input.distance) > 0 ? Number(input.distance) : SWIPE_BACK_DISTANCE;
|
|
8623
|
+
var minVelocity = Number(input && input.velocityThreshold) > 0 ? Number(input.velocityThreshold) : SWIPE_BACK_VELOCITY;
|
|
8624
|
+
if (dx <= 0) return false;
|
|
8625
|
+
if (Math.abs(dy) > dx) return false;
|
|
8626
|
+
return dx >= distance || velocity >= minVelocity;
|
|
8627
|
+
}
|
|
8628
|
+
function followOffset(dx, width) {
|
|
8629
|
+
var limit = Math.max(80, (Number(width) || 360) / 3);
|
|
8630
|
+
return Math.max(0, Math.min(limit, Math.round(Number(dx) || 0)));
|
|
8631
|
+
}
|
|
8632
|
+
function useLongPress(React, options) {
|
|
8633
|
+
var opts = options || {};
|
|
8634
|
+
var ref = React.useRef ? React.useRef(null) : { current: null };
|
|
8635
|
+
var firedRef = React.useRef ? React.useRef(false) : { current: false };
|
|
8636
|
+
var state = React.useState(false);
|
|
8637
|
+
var pressing = state[0], setPressing = state[1];
|
|
8638
|
+
function clear() {
|
|
8639
|
+
var st = ref.current;
|
|
8640
|
+
if (st && st.timer) {
|
|
8641
|
+
clearTimeout(st.timer);
|
|
8642
|
+
st.timer = null;
|
|
8643
|
+
}
|
|
8644
|
+
ref.current = null;
|
|
8645
|
+
if (pressing) setPressing(false);
|
|
8646
|
+
}
|
|
8647
|
+
React.useEffect(function() {
|
|
8648
|
+
return clear;
|
|
8649
|
+
}, []);
|
|
8650
|
+
function onPointerDown(event) {
|
|
8651
|
+
if (opts.disabled) return;
|
|
8652
|
+
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
8653
|
+
firedRef.current = false;
|
|
8654
|
+
var timer = setTimeout(function() {
|
|
8655
|
+
var st = ref.current;
|
|
8656
|
+
if (!st) return;
|
|
8657
|
+
firedRef.current = true;
|
|
8658
|
+
setPressing(true);
|
|
8659
|
+
st.timer = null;
|
|
8660
|
+
if (typeof opts.onLongPress === "function") opts.onLongPress({ clientX: st.x, clientY: st.y, target: st.target });
|
|
8661
|
+
}, Number(opts.ms) > 0 ? Number(opts.ms) : LONG_PRESS_MS);
|
|
8662
|
+
ref.current = { x: event.clientX, y: event.clientY, target: event.currentTarget, timer };
|
|
8663
|
+
}
|
|
8664
|
+
function onPointerMove(event) {
|
|
8665
|
+
var st = ref.current;
|
|
8666
|
+
if (!st) return;
|
|
8667
|
+
var moved = Math.abs(event.clientX - st.x) + Math.abs(event.clientY - st.y);
|
|
8668
|
+
var tolerance = Number(opts.tolerance) > 0 ? Number(opts.tolerance) : LONG_PRESS_TOLERANCE;
|
|
8669
|
+
if (moved <= tolerance) return;
|
|
8670
|
+
if (st.timer) clearTimeout(st.timer);
|
|
8671
|
+
ref.current = null;
|
|
8672
|
+
}
|
|
8673
|
+
function onPointerUp() {
|
|
8674
|
+
clear();
|
|
8675
|
+
}
|
|
8676
|
+
function onPointerCancel() {
|
|
8677
|
+
clear();
|
|
8678
|
+
}
|
|
8679
|
+
return {
|
|
8680
|
+
pressing,
|
|
8681
|
+
/** 取一次「刚刚发生过长按」并复位:用于在 onClick 里吞掉长按之后紧跟的点击。 */
|
|
8682
|
+
consume: function() {
|
|
8683
|
+
var fired = firedRef.current;
|
|
8684
|
+
firedRef.current = false;
|
|
8685
|
+
return fired;
|
|
8686
|
+
},
|
|
8687
|
+
handlers: {
|
|
8688
|
+
onPointerDown,
|
|
8689
|
+
onPointerMove,
|
|
8690
|
+
onPointerUp,
|
|
8691
|
+
onPointerCancel,
|
|
8692
|
+
onPointerLeave: onPointerUp
|
|
8693
|
+
}
|
|
8694
|
+
};
|
|
8695
|
+
}
|
|
8696
|
+
function usePullToRefresh(React, options) {
|
|
8697
|
+
var opts = options || {};
|
|
8698
|
+
var startRef = React.useRef ? React.useRef(null) : { current: null };
|
|
8699
|
+
var pullState = React.useState(0);
|
|
8700
|
+
var pull = pullState[0], setPull = pullState[1];
|
|
8701
|
+
var refreshState = React.useState(false);
|
|
8702
|
+
var refreshing = refreshState[0], setRefreshing = refreshState[1];
|
|
8703
|
+
function containerOf(event) {
|
|
8704
|
+
return opts.containerRef && opts.containerRef.current || event.currentTarget;
|
|
8705
|
+
}
|
|
8706
|
+
function onPointerDown(event) {
|
|
8707
|
+
if (opts.disabled || refreshing) return;
|
|
8708
|
+
var node = containerOf(event);
|
|
8709
|
+
var atTop = !node || node.scrollTop <= 0;
|
|
8710
|
+
startRef.current = { y: event.clientY, x: event.clientX, atTop };
|
|
8711
|
+
}
|
|
8712
|
+
function onPointerMove(event) {
|
|
8713
|
+
var st = startRef.current;
|
|
8714
|
+
if (!st) return;
|
|
8715
|
+
var dy = event.clientY - st.y;
|
|
8716
|
+
var dx = event.clientX - st.x;
|
|
8717
|
+
if (Math.abs(dx) > Math.abs(dy)) {
|
|
8718
|
+
startRef.current = null;
|
|
8719
|
+
setPull(0);
|
|
8720
|
+
return;
|
|
8721
|
+
}
|
|
8722
|
+
var verdict = pullDecision({ dy, atTop: st.atTop, threshold: opts.threshold, max: opts.max });
|
|
8723
|
+
setPull(verdict.distance);
|
|
8724
|
+
st.trigger = verdict.trigger;
|
|
8725
|
+
}
|
|
8726
|
+
function onPointerUp() {
|
|
8727
|
+
var st = startRef.current;
|
|
8728
|
+
startRef.current = null;
|
|
8729
|
+
if (!st || !st.trigger) {
|
|
8730
|
+
setPull(0);
|
|
8731
|
+
return;
|
|
8732
|
+
}
|
|
8733
|
+
setRefreshing(true);
|
|
8734
|
+
setPull(Number(opts.threshold) > 0 ? Number(opts.threshold) : PULL_THRESHOLD);
|
|
8735
|
+
var result = null;
|
|
8736
|
+
try {
|
|
8737
|
+
result = typeof opts.onRefresh === "function" ? opts.onRefresh() : null;
|
|
8738
|
+
} catch (error) {
|
|
8739
|
+
if (typeof console !== "undefined") console.error("[gestures] \u4E0B\u62C9\u5237\u65B0\u56DE\u8C03\u629B\u9519", error);
|
|
8740
|
+
}
|
|
8741
|
+
var done = function() {
|
|
8742
|
+
setRefreshing(false);
|
|
8743
|
+
setPull(0);
|
|
8744
|
+
};
|
|
8745
|
+
if (result && typeof result.then === "function") result.then(done, done);
|
|
8746
|
+
else done();
|
|
8747
|
+
}
|
|
8748
|
+
return {
|
|
8749
|
+
pull,
|
|
8750
|
+
refreshing,
|
|
8751
|
+
handlers: {
|
|
8752
|
+
onPointerDown,
|
|
8753
|
+
onPointerMove,
|
|
8754
|
+
onPointerUp,
|
|
8755
|
+
onPointerCancel: onPointerUp
|
|
8756
|
+
}
|
|
8757
|
+
};
|
|
8758
|
+
}
|
|
8759
|
+
function useEdgeSwipeBack(React, options) {
|
|
8760
|
+
var opts = options || {};
|
|
8761
|
+
var enabled = opts.enabled !== false;
|
|
8762
|
+
var startRef = React.useRef ? React.useRef(null) : { current: null };
|
|
8763
|
+
var offsetState = React.useState(0);
|
|
8764
|
+
var offset = offsetState[0], setOffset = offsetState[1];
|
|
8765
|
+
function onPointerDown(event) {
|
|
8766
|
+
if (!enabled) return;
|
|
8767
|
+
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
8768
|
+
var rect = event.currentTarget && typeof event.currentTarget.getBoundingClientRect === "function" ? event.currentTarget.getBoundingClientRect() : { left: 0, width: 360 };
|
|
8769
|
+
var edge = Number(opts.edge) > 0 ? Number(opts.edge) : SWIPE_BACK_EDGE;
|
|
8770
|
+
if (event.clientX - rect.left > edge) return;
|
|
8771
|
+
startRef.current = { x: event.clientX, y: event.clientY, lastX: event.clientX, lastAt: Date.now(), width: rect.width, velocity: 0 };
|
|
8772
|
+
}
|
|
8773
|
+
function onPointerMove(event) {
|
|
8774
|
+
var st = startRef.current;
|
|
8775
|
+
if (!st) return;
|
|
8776
|
+
var now = Date.now();
|
|
8777
|
+
var dt = now - st.lastAt;
|
|
8778
|
+
if (dt > 0) st.velocity = (event.clientX - st.lastX) / dt;
|
|
8779
|
+
st.lastX = event.clientX;
|
|
8780
|
+
st.lastAt = now;
|
|
8781
|
+
var dx = event.clientX - st.x;
|
|
8782
|
+
if (dx <= 0) {
|
|
8783
|
+
setOffset(0);
|
|
8784
|
+
return;
|
|
8785
|
+
}
|
|
8786
|
+
setOffset(followOffset(dx, st.width));
|
|
8787
|
+
}
|
|
8788
|
+
function onPointerUp(event) {
|
|
8789
|
+
var st = startRef.current;
|
|
8790
|
+
startRef.current = null;
|
|
8791
|
+
if (!st) return;
|
|
8792
|
+
var dx = event && typeof event.clientX === "number" ? event.clientX - st.x : 0;
|
|
8793
|
+
var dy = event && typeof event.clientY === "number" ? event.clientY - st.y : 0;
|
|
8794
|
+
var verdict = swipeBackDecision({ dx, dy, velocity: st.velocity, distance: opts.distance, velocityThreshold: opts.velocityThreshold });
|
|
8795
|
+
setOffset(0);
|
|
8796
|
+
if (verdict && typeof opts.onBack === "function") opts.onBack();
|
|
8797
|
+
}
|
|
8798
|
+
return {
|
|
8799
|
+
offset,
|
|
8800
|
+
handlers: enabled ? { onPointerDown, onPointerMove, onPointerUp, onPointerCancel: function() {
|
|
8801
|
+
startRef.current = null;
|
|
8802
|
+
setOffset(0);
|
|
8803
|
+
} } : {}
|
|
8804
|
+
};
|
|
8805
|
+
}
|
|
8806
|
+
module2.exports = {
|
|
8807
|
+
LONG_PRESS_MS,
|
|
8808
|
+
LONG_PRESS_TOLERANCE,
|
|
8809
|
+
PULL_THRESHOLD,
|
|
8810
|
+
PULL_MAX,
|
|
8811
|
+
SWIPE_BACK_DISTANCE,
|
|
8812
|
+
SWIPE_BACK_EDGE,
|
|
8813
|
+
longPressDecision,
|
|
8814
|
+
pullDecision,
|
|
8815
|
+
swipeBackDecision,
|
|
8816
|
+
followOffset,
|
|
8817
|
+
useLongPress,
|
|
8818
|
+
usePullToRefresh,
|
|
8819
|
+
useEdgeSwipeBack
|
|
8820
|
+
};
|
|
8821
|
+
}
|
|
8822
|
+
});
|
|
8823
|
+
|
|
7951
8824
|
// packages/addons/lib/panel-host.cjs
|
|
7952
8825
|
var require_panel_host = __commonJS({
|
|
7953
8826
|
"packages/addons/lib/panel-host.cjs"(exports2, module2) {
|
|
7954
8827
|
"use strict";
|
|
8828
|
+
var gestures = require_gestures();
|
|
8829
|
+
var PANEL_CLOSE_DISTANCE = 96;
|
|
8830
|
+
var PANEL_CLOSE_VELOCITY = 0.5;
|
|
7955
8831
|
var STYLES = [
|
|
7956
8832
|
// 基础层必须自己撑满视图并成为纵向 flex 容器:宿主用 display:contents 包了一层,
|
|
7957
8833
|
// 若这里不给约束,子视图的 flex:1 + min-height:0 就失效,长列表会把整页撑高,
|
|
7958
8834
|
// 固定底条被推到内容末尾(窄屏表现为「底部按钮要滚到底才看得到」)。
|
|
7959
8835
|
".wbpanel-base{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}",
|
|
7960
|
-
|
|
8836
|
+
// 整屏面板打开时基础层「藏起来但不撤掉布局」:用 hidden/display:none 会让视图根节点的
|
|
8837
|
+
// 高度塌成 0,面板再按祖先盒定位就只剩一条缝。visibility 保留布局与高度,同时挡住交互。
|
|
8838
|
+
".wbpanel-base[data-veiled=true]{visibility:hidden;pointer-events:none}",
|
|
7961
8839
|
// 面板层要盖住「宿主视图」而不是「整个窗口」:工作台可能被 DSH 嵌在侧栏或分屏里,
|
|
7962
8840
|
// 用 fixed inset:0 会横跨整个窗口,窄屏一侧露着别的内容。位置由 JS 按宿主视图盒量出,
|
|
7963
8841
|
// 这里的默认值只用于没量到盒子时的兜底。
|
|
@@ -7984,7 +8862,16 @@ var require_panel_host = __commonJS({
|
|
|
7984
8862
|
".wbpanel-title{flex:1;min-width:0;font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
7985
8863
|
".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}",
|
|
7986
8864
|
".wbpanel-close:hover,.wbpanel-close:focus-visible{background:var(--wb-surface);color:var(--wb-text);outline:0}",
|
|
7987
|
-
|
|
8865
|
+
// 内容区做成 flex 列:面板里的内容想「占满剩余高度、自己决定谁滚」时可以直接 flex:1,
|
|
8866
|
+
// 否则子元素量到的高度只有内容高,底部的固定行会浮在半空(目录树就踩过这个坑)。
|
|
8867
|
+
".wbpanel-content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;flex-direction:column}",
|
|
8868
|
+
// 不在这里给子元素写 flex:none:那会比插件自己的 .wbtc-sheet{flex:1} 选择器更具体,
|
|
8869
|
+
// 把「占满剩余高度」的意图按死(目录树就是这么第一次没撑开的)。
|
|
8870
|
+
// 底条不属于滚动区:放进 content 里会跟着内容一起滚走(「显示 N 条结果」必须一直在手边)。
|
|
8871
|
+
".wbpanel-foot{flex:none;border-top:1px solid var(--wb-line);background:var(--wb-card);padding-bottom:var(--wb-safe-bottom,0px)}",
|
|
8872
|
+
// 右滑返回:跟手位移直接写在 transform 上(不走 React 状态),松手后按过渡回位。
|
|
8873
|
+
".wbpanel-body{transition:transform .16s ease-out}",
|
|
8874
|
+
".wbpanel-body[data-swiping=1]{transition:none}",
|
|
7988
8875
|
"@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}}}"
|
|
7989
8876
|
].join("\n");
|
|
7990
8877
|
function createStore(initial) {
|
|
@@ -8112,18 +8999,35 @@ var require_panel_host = __commonJS({
|
|
|
8112
8999
|
var boxState = React.useState(null);
|
|
8113
9000
|
var box = boxState[0], setBox = boxState[1];
|
|
8114
9001
|
React.useEffect(function() {
|
|
8115
|
-
if (!
|
|
8116
|
-
function
|
|
8117
|
-
var
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
var
|
|
8121
|
-
if (
|
|
8122
|
-
|
|
8123
|
-
return;
|
|
9002
|
+
if (!doc || typeof window === "undefined") return void 0;
|
|
9003
|
+
function containingBlock(el) {
|
|
9004
|
+
var node = el && el.parentElement;
|
|
9005
|
+
while (node && node !== doc.documentElement) {
|
|
9006
|
+
var cs = window.getComputedStyle(node);
|
|
9007
|
+
var will = cs.willChange || "";
|
|
9008
|
+
if (cs.transform !== "none" || cs.perspective !== "none" || cs.filter !== "none" || cs.backdropFilter && cs.backdropFilter !== "none" || will.indexOf("transform") >= 0 || will.indexOf("filter") >= 0 || cs.contain && cs.contain !== "none" || cs.containerType && cs.containerType !== "normal") {
|
|
9009
|
+
return node;
|
|
8124
9010
|
}
|
|
8125
|
-
|
|
9011
|
+
node = node.parentElement;
|
|
9012
|
+
}
|
|
9013
|
+
return null;
|
|
9014
|
+
}
|
|
9015
|
+
function measure() {
|
|
9016
|
+
var base = baseRef.current;
|
|
9017
|
+
if (!base) return;
|
|
9018
|
+
var frame = base.closest ? base.closest(".wb-immersive") : null;
|
|
9019
|
+
var rect = frame ? frame.getBoundingClientRect() : null;
|
|
9020
|
+
if (!rect || rect.width < 1 || rect.height < 1) {
|
|
9021
|
+
rect = { left: 0, top: 0, width: window.innerWidth, height: window.innerHeight };
|
|
8126
9022
|
}
|
|
9023
|
+
var block = containingBlock(base);
|
|
9024
|
+
var origin = block ? block.getBoundingClientRect() : { left: 0, top: 0 };
|
|
9025
|
+
setBox({
|
|
9026
|
+
left: Math.round(rect.left - origin.left),
|
|
9027
|
+
top: Math.round(rect.top - origin.top),
|
|
9028
|
+
width: Math.round(rect.width),
|
|
9029
|
+
height: Math.round(rect.height)
|
|
9030
|
+
});
|
|
8127
9031
|
}
|
|
8128
9032
|
measure();
|
|
8129
9033
|
window.addEventListener("resize", measure);
|
|
@@ -8132,7 +9036,7 @@ var require_panel_host = __commonJS({
|
|
|
8132
9036
|
window.removeEventListener("resize", measure);
|
|
8133
9037
|
window.removeEventListener("orientationchange", measure);
|
|
8134
9038
|
};
|
|
8135
|
-
}, [
|
|
9039
|
+
}, [doc]);
|
|
8136
9040
|
React.useEffect(function() {
|
|
8137
9041
|
if (!list.length || !doc) return void 0;
|
|
8138
9042
|
function onKey(event) {
|
|
@@ -8149,17 +9053,76 @@ var require_panel_host = __commonJS({
|
|
|
8149
9053
|
};
|
|
8150
9054
|
}, [list.length, store]);
|
|
8151
9055
|
React.useEffect(function() {
|
|
8152
|
-
if (!
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
doc.
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
|
|
9056
|
+
if (!list.length || !doc) return void 0;
|
|
9057
|
+
var top = store.top();
|
|
9058
|
+
if (!top) return void 0;
|
|
9059
|
+
function surfaceOf() {
|
|
9060
|
+
return doc.querySelector('[data-panel-id="' + String(top.id).replace(/["\\]/g, "\\$&") + '"] .wbpanel-body');
|
|
9061
|
+
}
|
|
9062
|
+
function items() {
|
|
9063
|
+
var surface = surfaceOf();
|
|
9064
|
+
if (!surface) return [];
|
|
9065
|
+
var list2 = surface.querySelectorAll('button:not([disabled]),[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])');
|
|
9066
|
+
return Array.prototype.slice.call(list2).filter(function(el) {
|
|
9067
|
+
return el.offsetParent !== null;
|
|
9068
|
+
});
|
|
9069
|
+
}
|
|
9070
|
+
var timer = setTimeout(function() {
|
|
9071
|
+
var surface = surfaceOf();
|
|
9072
|
+
if (!surface) return;
|
|
9073
|
+
if (doc.activeElement && surface.contains(doc.activeElement)) return;
|
|
9074
|
+
var wanted = surface.querySelector("[data-autofocus]");
|
|
9075
|
+
var first = wanted || items()[0];
|
|
9076
|
+
if (first && first.focus) {
|
|
9077
|
+
first.focus();
|
|
9078
|
+
return;
|
|
9079
|
+
}
|
|
9080
|
+
if (surface.focus) {
|
|
9081
|
+
surface.setAttribute("tabindex", "-1");
|
|
9082
|
+
surface.focus();
|
|
9083
|
+
}
|
|
9084
|
+
}, 0);
|
|
9085
|
+
function onTab(event) {
|
|
9086
|
+
if (event.key !== "Tab") return;
|
|
9087
|
+
var surface = surfaceOf();
|
|
9088
|
+
if (!surface) return;
|
|
9089
|
+
var focusables = items();
|
|
9090
|
+
if (!focusables.length) return;
|
|
9091
|
+
var first = focusables[0];
|
|
9092
|
+
var last = focusables[focusables.length - 1];
|
|
9093
|
+
if (!surface.contains(doc.activeElement)) {
|
|
9094
|
+
event.preventDefault();
|
|
9095
|
+
first.focus();
|
|
9096
|
+
return;
|
|
9097
|
+
}
|
|
9098
|
+
if (event.shiftKey && doc.activeElement === first) {
|
|
9099
|
+
event.preventDefault();
|
|
9100
|
+
last.focus();
|
|
9101
|
+
return;
|
|
9102
|
+
}
|
|
9103
|
+
if (!event.shiftKey && doc.activeElement === last) {
|
|
9104
|
+
event.preventDefault();
|
|
9105
|
+
first.focus();
|
|
9106
|
+
}
|
|
9107
|
+
}
|
|
9108
|
+
doc.addEventListener("keydown", onTab, true);
|
|
9109
|
+
return function() {
|
|
9110
|
+
clearTimeout(timer);
|
|
9111
|
+
doc.removeEventListener("keydown", onTab, true);
|
|
9112
|
+
};
|
|
9113
|
+
}, [list.length, store]);
|
|
9114
|
+
React.useEffect(function() {
|
|
9115
|
+
if (!doc || !doc.body) return void 0;
|
|
9116
|
+
if (list.length && !locked.current) {
|
|
9117
|
+
locked.current = true;
|
|
9118
|
+
lastFocus.current = doc.activeElement || null;
|
|
9119
|
+
doc.body.setAttribute("data-wb-panel-lock", "1");
|
|
9120
|
+
var prev = doc.body.style.overflow;
|
|
9121
|
+
doc.body.style.overflow = "hidden";
|
|
9122
|
+
return function() {
|
|
9123
|
+
doc.body.style.overflow = prev;
|
|
9124
|
+
doc.body.removeAttribute("data-wb-panel-lock");
|
|
9125
|
+
locked.current = false;
|
|
8163
9126
|
var back = lastFocus.current;
|
|
8164
9127
|
if (back && typeof back.focus === "function") {
|
|
8165
9128
|
try {
|
|
@@ -8194,17 +9157,29 @@ var require_panel_host = __commonJS({
|
|
|
8194
9157
|
}
|
|
8195
9158
|
}
|
|
8196
9159
|
layer.setAttribute("data-resizing", "1");
|
|
9160
|
+
var drag = { dy: 0, velocity: 0, lastY: startY, lastAt: Date.now() };
|
|
8197
9161
|
function move(moveEvent) {
|
|
9162
|
+
var now = Date.now();
|
|
9163
|
+
var dt = now - drag.lastAt;
|
|
9164
|
+
if (dt > 0) drag.velocity = (moveEvent.clientY - drag.lastY) / dt;
|
|
9165
|
+
drag.dy = moveEvent.clientY - startY;
|
|
9166
|
+
drag.lastY = moveEvent.clientY;
|
|
9167
|
+
drag.lastAt = now;
|
|
8198
9168
|
var next = startH + (startY - moveEvent.clientY);
|
|
8199
9169
|
next = Math.max(box2.height * 0.3, Math.min(box2.height * 0.92, next));
|
|
8200
9170
|
surface.style.setProperty("--wbpanel-h", Math.round(next / box2.height * 100) + "%");
|
|
8201
|
-
dragHeights.current[panel.id] = Math.round(next / box2.height * 100) + "%";
|
|
8202
9171
|
}
|
|
8203
9172
|
function end() {
|
|
8204
9173
|
layer.removeAttribute("data-resizing");
|
|
8205
9174
|
window.removeEventListener("pointermove", move);
|
|
8206
9175
|
window.removeEventListener("pointerup", end);
|
|
8207
9176
|
window.removeEventListener("pointercancel", end);
|
|
9177
|
+
var closed = drag.dy > PANEL_CLOSE_DISTANCE || drag.velocity > PANEL_CLOSE_VELOCITY;
|
|
9178
|
+
if (closed && panel.dismissible !== false) {
|
|
9179
|
+
store.pop(panel.id);
|
|
9180
|
+
return;
|
|
9181
|
+
}
|
|
9182
|
+
dragHeights.current[panel.id] = surface.style.getPropertyValue("--wbpanel-h") || void 0;
|
|
8208
9183
|
}
|
|
8209
9184
|
window.addEventListener("pointermove", move);
|
|
8210
9185
|
window.addEventListener("pointerup", end);
|
|
@@ -8213,6 +9188,53 @@ var require_panel_host = __commonJS({
|
|
|
8213
9188
|
}
|
|
8214
9189
|
};
|
|
8215
9190
|
}
|
|
9191
|
+
function swipeBackProps(panel) {
|
|
9192
|
+
if (panel.kind !== "full" && panel.kind !== "right") return {};
|
|
9193
|
+
if (panel.dismissible === false) return {};
|
|
9194
|
+
var start = null;
|
|
9195
|
+
return {
|
|
9196
|
+
onPointerDown: function(event) {
|
|
9197
|
+
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
9198
|
+
var body = event.currentTarget;
|
|
9199
|
+
var rect = body.getBoundingClientRect();
|
|
9200
|
+
if (event.clientX - rect.left > gestures.SWIPE_BACK_EDGE) return;
|
|
9201
|
+
start = { x: event.clientX, y: event.clientY, lastX: event.clientX, lastAt: Date.now(), width: rect.width, velocity: 0 };
|
|
9202
|
+
body.setAttribute("data-swiping", "1");
|
|
9203
|
+
if (body.setPointerCapture) {
|
|
9204
|
+
try {
|
|
9205
|
+
body.setPointerCapture(event.pointerId);
|
|
9206
|
+
} catch (error) {
|
|
9207
|
+
}
|
|
9208
|
+
}
|
|
9209
|
+
},
|
|
9210
|
+
onPointerMove: function(event) {
|
|
9211
|
+
if (!start) return;
|
|
9212
|
+
var now = Date.now();
|
|
9213
|
+
var dt = now - start.lastAt;
|
|
9214
|
+
if (dt > 0) start.velocity = (event.clientX - start.lastX) / dt;
|
|
9215
|
+
start.lastX = event.clientX;
|
|
9216
|
+
start.lastAt = now;
|
|
9217
|
+
var dx = event.clientX - start.x;
|
|
9218
|
+
event.currentTarget.style.transform = dx > 0 ? "translateX(" + gestures.followOffset(dx, start.width) + "px)" : "none";
|
|
9219
|
+
},
|
|
9220
|
+
onPointerUp: function(event) {
|
|
9221
|
+
if (!start) return;
|
|
9222
|
+
var body = event.currentTarget;
|
|
9223
|
+
var dx = event.clientX - start.x;
|
|
9224
|
+
var dy = event.clientY - start.y;
|
|
9225
|
+
var velocity = start.velocity;
|
|
9226
|
+
start = null;
|
|
9227
|
+
body.removeAttribute("data-swiping");
|
|
9228
|
+
body.style.transform = "none";
|
|
9229
|
+
if (gestures.swipeBackDecision({ dx, dy, velocity })) store.pop(panel.id);
|
|
9230
|
+
},
|
|
9231
|
+
onPointerCancel: function(event) {
|
|
9232
|
+
start = null;
|
|
9233
|
+
event.currentTarget.removeAttribute("data-swiping");
|
|
9234
|
+
event.currentTarget.style.transform = "none";
|
|
9235
|
+
}
|
|
9236
|
+
};
|
|
9237
|
+
}
|
|
8216
9238
|
function renderPanel(panel) {
|
|
8217
9239
|
var kind = panel.kind || "bottom";
|
|
8218
9240
|
var dismissible = panel.dismissible !== false;
|
|
@@ -8223,13 +9245,15 @@ var require_panel_host = __commonJS({
|
|
|
8223
9245
|
dismissible && panel.mask !== false ? h("button", { type: "button", className: "wbpanel-mask", key: "mask", "aria-label": panel.maskLabel || "\u5173\u95ED", onClick: function() {
|
|
8224
9246
|
store.pop(panel.id);
|
|
8225
9247
|
} }) : h("div", { className: "wbpanel-mask", key: "mask", "aria-hidden": "true" }),
|
|
8226
|
-
h("section", {
|
|
9248
|
+
h("section", Object.assign({
|
|
8227
9249
|
className: "wbpanel-body",
|
|
8228
9250
|
key: "body",
|
|
8229
|
-
role
|
|
8230
|
-
|
|
9251
|
+
// 有遮罩的面板都是模态的:role 必须是 dialog、aria-modal 必须是 true,否则读屏软件
|
|
9252
|
+
// 会把焦点跳到被遮住的列表上(§9 的无障碍判据)。
|
|
9253
|
+
role: dismissible && panel.mask !== false ? "dialog" : "region",
|
|
9254
|
+
"aria-modal": dismissible && panel.mask !== false ? "true" : void 0,
|
|
8231
9255
|
"aria-label": typeof panel.title === "string" ? panel.title : void 0
|
|
8232
|
-
}, [
|
|
9256
|
+
}, swipeBackProps(panel)), [
|
|
8233
9257
|
kind === "bottom" ? h("div", { key: "grab", ...grabProps(panel) }) : null,
|
|
8234
9258
|
panel.title || dismissible ? h("div", { className: "wbpanel-head", key: "head" }, [
|
|
8235
9259
|
h("div", { className: "wbpanel-title", key: "title" }, panel.title || ""),
|
|
@@ -8240,14 +9264,25 @@ var require_panel_host = __commonJS({
|
|
|
8240
9264
|
]) : null,
|
|
8241
9265
|
h("div", { className: "wbpanel-content", key: "content" }, typeof panel.render === "function" ? panel.render({ close: function() {
|
|
8242
9266
|
store.pop(panel.id);
|
|
8243
|
-
}, store, panel }) : panel.children || null)
|
|
9267
|
+
}, store, panel }) : panel.children || null),
|
|
9268
|
+
panel.footer ? h("div", { className: "wbpanel-foot", key: "foot" }, typeof panel.footer === "function" ? panel.footer({ close: function() {
|
|
9269
|
+
store.pop(panel.id);
|
|
9270
|
+
}, store, panel }) : panel.footer) : null
|
|
8244
9271
|
])
|
|
8245
9272
|
]);
|
|
8246
9273
|
}
|
|
8247
9274
|
return h("div", { className: "wbpanel-host", style: { display: "contents" } }, [
|
|
8248
|
-
h("div", {
|
|
8249
|
-
|
|
8250
|
-
|
|
9275
|
+
h("div", {
|
|
9276
|
+
className: "wbpanel-base",
|
|
9277
|
+
key: "base",
|
|
9278
|
+
ref: baseRef,
|
|
9279
|
+
"data-veiled": list.some(function(panel) {
|
|
9280
|
+
return panel.kind === "full" || panel.hideBase;
|
|
9281
|
+
}) ? "true" : void 0,
|
|
9282
|
+
"aria-hidden": list.some(function(panel) {
|
|
9283
|
+
return panel.kind === "full" || panel.hideBase;
|
|
9284
|
+
}) ? "true" : void 0
|
|
9285
|
+
}, props.children)
|
|
8251
9286
|
].concat(list.map(renderPanel)));
|
|
8252
9287
|
}
|
|
8253
9288
|
module2.exports = {
|
|
@@ -8398,8 +9433,14 @@ var require_sheet = __commonJS({
|
|
|
8398
9433
|
var require_card_list = __commonJS({
|
|
8399
9434
|
"packages/addons/lib/card-list.cjs"(exports2, module2) {
|
|
8400
9435
|
"use strict";
|
|
9436
|
+
var gestures = require_gestures();
|
|
8401
9437
|
var STYLES = [
|
|
8402
9438
|
".wbcard-list{display:flex;flex-direction:column;gap:8px;min-width:0}",
|
|
9439
|
+
// 下拉刷新:滚动容器由共享件提供,插件不再各自建一个 overflow:auto 再配一套指示条。
|
|
9440
|
+
".wbcard-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior-y:contain;display:flex;flex-direction:column}",
|
|
9441
|
+
".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}",
|
|
9442
|
+
".wbcard-pull[data-refreshing=1] .wbcard-pull-text{color:var(--wb-accent)}",
|
|
9443
|
+
".wbcard-item[data-pressing=1]{opacity:.72}",
|
|
8403
9444
|
".wbcard-list-bar{display:flex;align-items:center;gap:8px;justify-content:center;padding:10px 0;color:var(--wb-muted);font-size:12px}",
|
|
8404
9445
|
".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}",
|
|
8405
9446
|
".wbcard:hover{border-color:var(--wb-border)}",
|
|
@@ -8469,6 +9510,25 @@ var require_card_list = __commonJS({
|
|
|
8469
9510
|
props.actions ? h("div", { className: "wbcard-actions", key: "a" }, props.actions) : null
|
|
8470
9511
|
]);
|
|
8471
9512
|
}
|
|
9513
|
+
function CardRow(props) {
|
|
9514
|
+
var h = props.h;
|
|
9515
|
+
var React = props.React;
|
|
9516
|
+
var longPress = gestures.useLongPress(React, {
|
|
9517
|
+
disabled: !props.onLongPress,
|
|
9518
|
+
onLongPress: props.onLongPress ? function(point) {
|
|
9519
|
+
props.onLongPress(point);
|
|
9520
|
+
} : void 0
|
|
9521
|
+
});
|
|
9522
|
+
var handlers = props.onLongPress ? longPress.handlers : {};
|
|
9523
|
+
return h("div", Object.assign({
|
|
9524
|
+
className: "wbcard-item",
|
|
9525
|
+
"data-pressing": longPress.pressing ? "1" : "0",
|
|
9526
|
+
onClick: props.onLongPress ? function(event) {
|
|
9527
|
+
if (longPress.consume()) return;
|
|
9528
|
+
if (typeof props.onClick === "function") props.onClick(event);
|
|
9529
|
+
} : props.onClick
|
|
9530
|
+
}, handlers), props.children);
|
|
9531
|
+
}
|
|
8472
9532
|
function CardList(props) {
|
|
8473
9533
|
var h = props.h;
|
|
8474
9534
|
var React = props.React;
|
|
@@ -8514,7 +9574,17 @@ var require_card_list = __commonJS({
|
|
|
8514
9574
|
children.push(h("div", { className: "wbcard-empty", key: "empty" }, props.empty || "\u6CA1\u6709\u6570\u636E"));
|
|
8515
9575
|
} else {
|
|
8516
9576
|
items.forEach(function(item, index) {
|
|
8517
|
-
children.push(
|
|
9577
|
+
children.push(h(CardRow, {
|
|
9578
|
+
key: keyOf(item, index),
|
|
9579
|
+
h,
|
|
9580
|
+
React,
|
|
9581
|
+
onClick: props.onItemClick ? function(event) {
|
|
9582
|
+
props.onItemClick(item, event);
|
|
9583
|
+
} : void 0,
|
|
9584
|
+
onLongPress: props.onItemLongPress ? function(point) {
|
|
9585
|
+
props.onItemLongPress(item, point);
|
|
9586
|
+
} : void 0
|
|
9587
|
+
}, typeof props.renderItem === "function" ? props.renderItem(item, index) : h(Card, { h, title: String(item && item.title) })));
|
|
8518
9588
|
});
|
|
8519
9589
|
}
|
|
8520
9590
|
if (items.length && state === "more") {
|
|
@@ -8528,12 +9598,37 @@ var require_card_list = __commonJS({
|
|
|
8528
9598
|
}
|
|
8529
9599
|
return h("div", { className: "wbcard-list" + (props.className ? " " + props.className : "") }, children);
|
|
8530
9600
|
}
|
|
9601
|
+
function PullRefresh(props) {
|
|
9602
|
+
var h = props.h;
|
|
9603
|
+
var React = props.React;
|
|
9604
|
+
var ref = React.useRef ? React.useRef(null) : { current: null };
|
|
9605
|
+
var pull = gestures.usePullToRefresh(React, {
|
|
9606
|
+
containerRef: ref,
|
|
9607
|
+
onRefresh: props.onRefresh,
|
|
9608
|
+
disabled: props.disabled,
|
|
9609
|
+
threshold: props.threshold,
|
|
9610
|
+
max: props.max
|
|
9611
|
+
});
|
|
9612
|
+
var label = pull.refreshing ? props.refreshingLabel || "\u5237\u65B0\u4E2D\u2026" : pull.pull > 0 ? props.releaseLabel || "\u677E\u5F00\u5237\u65B0" : "";
|
|
9613
|
+
return h("div", Object.assign({ className: "wbcard-scroll" + (props.className ? " " + props.className : ""), ref }, pull.handlers), [
|
|
9614
|
+
h("div", {
|
|
9615
|
+
className: "wbcard-pull",
|
|
9616
|
+
key: "pull",
|
|
9617
|
+
"data-refreshing": pull.refreshing ? "1" : "0",
|
|
9618
|
+
style: { height: pull.pull ? pull.pull + "px" : "0px" },
|
|
9619
|
+
"aria-hidden": pull.pull || pull.refreshing ? "false" : "true"
|
|
9620
|
+
}, h("span", { className: "wbcard-pull-text" }, label)),
|
|
9621
|
+
h("div", { className: "wbcard-list-body", key: "body" }, props.children)
|
|
9622
|
+
]);
|
|
9623
|
+
}
|
|
8531
9624
|
module2.exports = {
|
|
8532
9625
|
styles: STYLES,
|
|
8533
9626
|
pageState,
|
|
8534
9627
|
skeletonRows,
|
|
8535
9628
|
Card,
|
|
8536
|
-
CardList
|
|
9629
|
+
CardList,
|
|
9630
|
+
CardRow,
|
|
9631
|
+
PullRefresh
|
|
8537
9632
|
};
|
|
8538
9633
|
}
|
|
8539
9634
|
});
|
|
@@ -8548,7 +9643,10 @@ var require_sticky_bar = __commonJS({
|
|
|
8548
9643
|
".wbbar[data-tone=accent]{border-top-color:color-mix(in oklab,var(--wb-accent) 45%,var(--wb-line))}",
|
|
8549
9644
|
".wbbar-grow{flex:1;min-width:0}",
|
|
8550
9645
|
".wbbar .wbcard-btn,.wbbar button{min-height:40px}",
|
|
8551
|
-
".wbbar-note{flex:1;min-width:0;font-size:12px;color:var(--wb-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"
|
|
9646
|
+
".wbbar-note{flex:1;min-width:0;font-size:12px;color:var(--wb-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
9647
|
+
// 面板里的底条:整屏面板本身已是 position:fixed 的盒子,条子再 fixed 会以视口为准,
|
|
9648
|
+
// 在桌面内嵌里掉到窗口底部。flow=inline 让条子回到文档流,由所在屏的 flex 列压到底。
|
|
9649
|
+
".wbbar[data-flow=inline]{position:static;left:auto;right:auto;bottom:auto;z-index:auto;box-shadow:none;flex:none}"
|
|
8552
9650
|
].join("\n");
|
|
8553
9651
|
function spacerStyle(extra) {
|
|
8554
9652
|
var pad = Number(extra) > 0 ? Number(extra) : 0;
|
|
@@ -8559,6 +9657,7 @@ var require_sticky_bar = __commonJS({
|
|
|
8559
9657
|
return h("div", {
|
|
8560
9658
|
className: "wbbar" + (props.className ? " " + props.className : ""),
|
|
8561
9659
|
"data-tone": props.tone || "default",
|
|
9660
|
+
"data-flow": props.flow || "fixed",
|
|
8562
9661
|
role: "toolbar",
|
|
8563
9662
|
"aria-label": props.label
|
|
8564
9663
|
}, [
|
|
@@ -8765,6 +9864,11 @@ var require_styles = __commonJS({
|
|
|
8765
9864
|
".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)}",
|
|
8766
9865
|
"@keyframes wbt-fade{from{opacity:0}to{opacity:1}}",
|
|
8767
9866
|
"@keyframes wbt-slide{from{transform:translateX(-14px);opacity:.5}to{transform:none;opacity:1}}",
|
|
9867
|
+
/* 窄档整屏 sheet:遮罩变页面背景,表单占满可用高度,指纹区固定为内边距。 */
|
|
9868
|
+
".wbt-modal-mask.is-sheet{align-items:stretch;justify-content:stretch;padding:0;background:var(--wbt-bg)}",
|
|
9869
|
+
".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))}",
|
|
9870
|
+
".wbt-modal.wbov-sheet .wbt-form{grid-template-columns:1fr}",
|
|
9871
|
+
".wbt-modal.wbov-sheet .wbt-modal-foot,.wbt-modal.wbov-sheet .wbt-formfoot{position:sticky;bottom:0;background:var(--wbt-bg);padding-top:10px}",
|
|
8768
9872
|
".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}",
|
|
8769
9873
|
".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}",
|
|
8770
9874
|
".wbt-modal.wide{width:820px}",
|
|
@@ -8846,9 +9950,9 @@ var require_styles = __commonJS({
|
|
|
8846
9950
|
'.wbt-countdown .wbt-cd-num{font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}',
|
|
8847
9951
|
".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)}",
|
|
8848
9952
|
".wbt-countdown.overdue{color:var(--dsw-alias-label-primary-inverted);background:var(--dsw-alias-state-error-primary);border-color:transparent}",
|
|
8849
|
-
"
|
|
8850
|
-
"
|
|
8851
|
-
"
|
|
9953
|
+
":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}",
|
|
9954
|
+
":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}",
|
|
9955
|
+
":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}",
|
|
8852
9956
|
// ── 插槽贡献:渲染在别的插件的界面里(如邮件详情动作条) ──
|
|
8853
9957
|
// 那里没有 .wbt-root,--wbt-* 变量不存在,所以每个变量都带主题变量兜底。
|
|
8854
9958
|
".wbt-metazone:empty{display:none}",
|
|
@@ -8864,31 +9968,10 @@ var require_styles = __commonJS({
|
|
|
8864
9968
|
".wbtx-slot-note{color:var(--wbt-muted,var(--wb-muted))}",
|
|
8865
9969
|
".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}",
|
|
8866
9970
|
".wbt-mailback{font-size:11.5px;padding:2px 7px}",
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
".wbtc-sum{font-size:12px;color:var(--wb-muted);white-space:nowrap}",
|
|
8872
|
-
".wbtc-crumbs{display:flex;min-width:0;flex:1;overflow:hidden}",
|
|
8873
|
-
".wbtc-desc{font-size:12px;color:var(--wb-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
8874
|
-
".wbtc-list{display:flex;flex-direction:column;gap:10px;min-height:0;flex:1}",
|
|
8875
|
-
".wbtc-sheet{display:flex;flex-direction:column;gap:8px;min-height:0;flex:1;overflow:auto}",
|
|
8876
|
-
".wbtc-sheet .wbt-filter-panel{width:100%;max-height:none;flex:1;border:0;padding:0}",
|
|
8877
|
-
".wbtc-sheet .wbt-filter-toggle{display:none}",
|
|
8878
|
-
".wbtc-foot-acts{display:flex;gap:8px;flex-wrap:wrap;align-items:center}",
|
|
8879
|
-
".wbtc-detail{display:flex;flex-direction:column;gap:10px;min-height:0;flex:1;overflow:auto}",
|
|
8880
|
-
".wbtc-pagerinfo{font-size:12px;color:var(--wb-muted);white-space:nowrap}",
|
|
8881
|
-
".wbtc-card{cursor:pointer;border:1px solid var(--wb-line);border-radius:10px;background:var(--wb-card);padding:10px 10px 9px}",
|
|
8882
|
-
".wbtc-card:hover{border-color:var(--wb-border)}",
|
|
8883
|
-
".wbtc-card-inner{display:flex;align-items:flex-start;gap:8px}",
|
|
8884
|
-
".wbtc-card-body{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}",
|
|
8885
|
-
".wbtc-card-top{display:flex;align-items:center;gap:6px;min-width:0}",
|
|
8886
|
-
".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}",
|
|
8887
|
-
".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}",
|
|
8888
|
-
".wbtc-card-tags{display:flex;flex-wrap:wrap;gap:4px}",
|
|
8889
|
-
".wbtc-card-meta{display:flex;flex-wrap:wrap;gap:4px 10px;font-size:11px;color:var(--wb-muted)}",
|
|
8890
|
-
".wbtc-card-ws{max-width:14em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
8891
|
-
".wbtc-card-go{flex:none;display:flex;align-items:center;color:var(--wb-muted);padding-top:2px}"
|
|
9971
|
+
require_overlay().sheetStyles,
|
|
9972
|
+
// 窄屏 chips 用 scroll-strip 的横滑容器:少了这份样式,chips 会退化成 block 然后换行。
|
|
9973
|
+
require_scroll_strip().styles,
|
|
9974
|
+
require_compact_styles()
|
|
8892
9975
|
].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");
|
|
8893
9976
|
}
|
|
8894
9977
|
});
|
|
@@ -8905,6 +9988,10 @@ var require_timeline_styles = __commonJS({
|
|
|
8905
9988
|
".wbt-timeline-toolbar-main .wbt-timeline-search{flex:1 1 220px;min-width:0}",
|
|
8906
9989
|
".wbt-timeline-toolbar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto}",
|
|
8907
9990
|
".wbt-timeline-columns{display:grid;grid-template-columns:minmax(240px,32%) minmax(0,1fr);gap:12px;align-items:start}",
|
|
9991
|
+
/* 窄档:两列改上下,列表按内容高度、成员占剩余空间,各自滚动。 */
|
|
9992
|
+
".wbt-compact .wbt-timeline-columns{display:flex;flex-direction:column;gap:12px}",
|
|
9993
|
+
".wbt-compact .wbt-timeline-left,.wbt-compact .wbt-timeline-right{width:100%;padding:12px}",
|
|
9994
|
+
".wbt-compact .wbt-timeline-list{max-height:45vh}",
|
|
8908
9995
|
".wbt-timeline-left,.wbt-timeline-right{min-width:0;border:1px solid var(--wbt-line);border-radius:var(--wb-radius-card,10px);padding:12px}",
|
|
8909
9996
|
".wbt-timeline-search input{min-width:0;flex:1}",
|
|
8910
9997
|
".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}",
|
|
@@ -8925,8 +10012,8 @@ var require_timeline_styles = __commonJS({
|
|
|
8925
10012
|
".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}",
|
|
8926
10013
|
".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}",
|
|
8927
10014
|
// 窄屏:搜索独占一行,操作按钮靠左并允许换行,避免「刷新」被推出屏幕。
|
|
8928
|
-
"
|
|
8929
|
-
"
|
|
10015
|
+
":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}",
|
|
10016
|
+
":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}"
|
|
8930
10017
|
].join("\n");
|
|
8931
10018
|
}
|
|
8932
10019
|
});
|
|
@@ -11636,12 +12723,19 @@ var require_task_filter_panel = __commonJS({
|
|
|
11636
12723
|
var DateFilter = require_date_filter().DateFilter;
|
|
11637
12724
|
var WorkspaceFilter = require_workspacefilter();
|
|
11638
12725
|
var NF = require_number_field();
|
|
12726
|
+
var disclosure = require_disclosure();
|
|
12727
|
+
var disclosureCache = null;
|
|
12728
|
+
function folds(React) {
|
|
12729
|
+
if (!disclosureCache) disclosureCache = disclosure.createDisclosure(React);
|
|
12730
|
+
return disclosureCache;
|
|
12731
|
+
}
|
|
11639
12732
|
module2.exports = function renderFilterPanel(React, p) {
|
|
11640
12733
|
var h = React.createElement, en = p.lang === "en", value = p.value;
|
|
12734
|
+
var D = folds(React);
|
|
11641
12735
|
var title = en ? "Filters" : "\u7B5B\u9009";
|
|
11642
12736
|
var labels = en ? { publish: "Publication range", done: "Completion range", shutdown: "Closure range", claimed: "Claim range", target: "Target range" } : { publish: "\u53D1\u5E03\u65F6\u95F4\u8303\u56F4", done: "\u5B8C\u6210\u65F6\u95F4\u8303\u56F4", shutdown: "\u5173\u95ED\u65F6\u95F4\u8303\u56F4", claimed: "\u63A5\u53D6\u65F6\u95F4\u8303\u56F4", target: "\u76EE\u6807\u65E5\u671F\u8303\u56F4" };
|
|
11643
12737
|
var options = [["all", en ? "All" : "\u5168\u90E8"], ["0", en ? "Opened" : "\u5DF2\u5F00\u542F"], ["2", en ? "Completed" : "\u5DF2\u5B8C\u6210"], ["1", en ? "Closed" : "\u5DF2\u5173\u95ED"], ["3", en ? "Restarted" : "\u5DF2\u91CD\u542F"], ["4", en ? "Claimed" : "\u5DF2\u63A5\u53D6"]];
|
|
11644
|
-
var presetNames =
|
|
12738
|
+
var presetNames = module2.exports.presetNames(p.lang);
|
|
11645
12739
|
var activePreset = model.activePreset(value);
|
|
11646
12740
|
var unitId = p.id + "-unit";
|
|
11647
12741
|
var units = en ? { priority: "0\u201310, higher is more urgent", difficulty: "0\u20135 in half steps, higher is harder" } : { priority: "0\u201310\uFF0C\u8D8A\u5927\u8D8A\u7D27\u6025", difficulty: "0\u20135\uFF0C\u534A\u6863\u9012\u589E\uFF0C\u8D8A\u5927\u8D8A\u96BE" };
|
|
@@ -11786,11 +12880,19 @@ var require_task_filter_panel = __commonJS({
|
|
|
11786
12880
|
setRange("target", next);
|
|
11787
12881
|
} })
|
|
11788
12882
|
),
|
|
12883
|
+
// 发布时间/完成/关闭/接取四组默认折叠:它们很少同时用,全展开会把「状态 + 标签」
|
|
12884
|
+
// 挤出首屏(窄屏整屏 sheet 里尤其明显)。已经填过的组保持展开,别把生效条件藏起来。
|
|
11789
12885
|
model.groups.map(function(key) {
|
|
12886
|
+
var filled = !!(value[key] && (value[key].from || value[key].to));
|
|
11790
12887
|
return h(
|
|
11791
|
-
|
|
11792
|
-
{
|
|
11793
|
-
|
|
12888
|
+
D.Disclosure,
|
|
12889
|
+
{
|
|
12890
|
+
key,
|
|
12891
|
+
className: "wbt-filter-group wbt-filter-fold",
|
|
12892
|
+
"data-filter-group": key,
|
|
12893
|
+
title: labels[key],
|
|
12894
|
+
defaultOpen: filled
|
|
12895
|
+
},
|
|
11794
12896
|
h(DateFilter, { lang: p.lang, kind: key, value: value[key], onChange: function(next) {
|
|
11795
12897
|
setRange(key, next);
|
|
11796
12898
|
} })
|
|
@@ -11801,6 +12903,9 @@ var require_task_filter_panel = __commonJS({
|
|
|
11801
12903
|
)
|
|
11802
12904
|
);
|
|
11803
12905
|
};
|
|
12906
|
+
module2.exports.presetNames = function(lang) {
|
|
12907
|
+
return lang === "en" ? { urgent: "Urgent (P8\u201310)", hard: "Hard (D4\u20135)", overdue: "Overdue", dueToday: "Due today", recentDone: "Done in 7 days", claimed: "Claimed" } : { urgent: "\u7D27\u6025\u4EFB\u52A1 P8\u201310", hard: "\u9AD8\u96BE\u5EA6 D4\u20135", overdue: "\u5DF2\u903E\u671F", dueToday: "\u4ECA\u65E5\u5230\u671F", recentDone: "\u8FD1 7 \u5929\u5B8C\u6210", claimed: "\u5DF2\u63A5\u53D6" };
|
|
12908
|
+
};
|
|
11804
12909
|
}
|
|
11805
12910
|
});
|
|
11806
12911
|
|
|
@@ -12415,6 +13520,7 @@ var require_tasks_state = __commonJS({
|
|
|
12415
13520
|
var cfg = ctx.cfg || {};
|
|
12416
13521
|
var viewParams = ctx.viewParams;
|
|
12417
13522
|
var lang = ctx.lang === "en" ? "en" : "zh";
|
|
13523
|
+
var compact = ctx.compact === true;
|
|
12418
13524
|
var t = ctx.t;
|
|
12419
13525
|
var allTables = ctx.allTables;
|
|
12420
13526
|
var treeWalk = ctx.treeWalk;
|
|
@@ -12684,6 +13790,18 @@ var require_tasks_state = __commonJS({
|
|
|
12684
13790
|
else next.add(String(id));
|
|
12685
13791
|
setExpanded(next);
|
|
12686
13792
|
}
|
|
13793
|
+
function expandIds(ids) {
|
|
13794
|
+
if (!ids || !ids.length) return;
|
|
13795
|
+
var next = new Set(expanded);
|
|
13796
|
+
var changed = false;
|
|
13797
|
+
ids.forEach(function(id) {
|
|
13798
|
+
var key = String(id);
|
|
13799
|
+
if (next.has(key)) return;
|
|
13800
|
+
next.add(key);
|
|
13801
|
+
changed = true;
|
|
13802
|
+
});
|
|
13803
|
+
if (changed) setExpanded(next);
|
|
13804
|
+
}
|
|
12687
13805
|
function addNode(parentId, type) {
|
|
12688
13806
|
setNodeModal({ parentId, type, node: null });
|
|
12689
13807
|
}
|
|
@@ -12998,6 +14116,7 @@ var require_tasks_state = __commonJS({
|
|
|
12998
14116
|
lang,
|
|
12999
14117
|
cfg,
|
|
13000
14118
|
cfgConfirm,
|
|
14119
|
+
compact,
|
|
13001
14120
|
tree,
|
|
13002
14121
|
expanded,
|
|
13003
14122
|
target,
|
|
@@ -13045,6 +14164,7 @@ var require_tasks_state = __commonJS({
|
|
|
13045
14164
|
pickNode,
|
|
13046
14165
|
pickPath,
|
|
13047
14166
|
toggleExpanded,
|
|
14167
|
+
expandIds,
|
|
13048
14168
|
addNode,
|
|
13049
14169
|
nodeSaved,
|
|
13050
14170
|
renameNode,
|
|
@@ -13189,10 +14309,12 @@ var require_tasks_overlays = __commonJS({
|
|
|
13189
14309
|
var ownership = require_ownership();
|
|
13190
14310
|
return function renderOverlays(m) {
|
|
13191
14311
|
var t = m.t;
|
|
14312
|
+
var sheet = m.compact === true;
|
|
13192
14313
|
var api = m.api;
|
|
13193
14314
|
var lang = m.lang;
|
|
13194
14315
|
return h("div", { className: "wbt-overlays", style: { display: "contents" } }, [
|
|
13195
14316
|
m.createState ? h(CreateModal, {
|
|
14317
|
+
sheet,
|
|
13196
14318
|
key: (m.createState.source || "0") + "-" + (m.createState.originTask && m.createState.originTask.id || ""),
|
|
13197
14319
|
t,
|
|
13198
14320
|
api,
|
|
@@ -13217,6 +14339,7 @@ var require_tasks_overlays = __commonJS({
|
|
|
13217
14339
|
}
|
|
13218
14340
|
}) : null,
|
|
13219
14341
|
m.timelineTask ? h(TimelineModal, {
|
|
14342
|
+
sheet,
|
|
13220
14343
|
key: m.timelineTask.id,
|
|
13221
14344
|
t,
|
|
13222
14345
|
api,
|
|
@@ -13281,6 +14404,7 @@ var require_tasks_overlays = __commonJS({
|
|
|
13281
14404
|
}
|
|
13282
14405
|
}) : null,
|
|
13283
14406
|
m.nodeModal ? h(NodeModal, {
|
|
14407
|
+
sheet,
|
|
13284
14408
|
key: "node-" + (m.nodeModal.node ? m.nodeModal.node.id : "new"),
|
|
13285
14409
|
t,
|
|
13286
14410
|
api,
|
|
@@ -13293,6 +14417,7 @@ var require_tasks_overlays = __commonJS({
|
|
|
13293
14417
|
onSaved: m.nodeSaved
|
|
13294
14418
|
}) : null,
|
|
13295
14419
|
m.editTask ? h(EditModal, {
|
|
14420
|
+
sheet,
|
|
13296
14421
|
key: "edit-" + m.editTask.id,
|
|
13297
14422
|
t,
|
|
13298
14423
|
api,
|
|
@@ -13310,6 +14435,7 @@ var require_tasks_overlays = __commonJS({
|
|
|
13310
14435
|
}
|
|
13311
14436
|
}) : null,
|
|
13312
14437
|
m.doneTask ? h(DoneModal, {
|
|
14438
|
+
sheet,
|
|
13313
14439
|
key: m.doneTask.id,
|
|
13314
14440
|
t,
|
|
13315
14441
|
api,
|
|
@@ -13330,6 +14456,7 @@ var require_tasks_overlays = __commonJS({
|
|
|
13330
14456
|
}
|
|
13331
14457
|
}) : null,
|
|
13332
14458
|
m.selectedOpen && m.batchMode ? h(BatchModal, {
|
|
14459
|
+
sheet,
|
|
13333
14460
|
key: m.batchMode,
|
|
13334
14461
|
t,
|
|
13335
14462
|
api,
|
|
@@ -13576,341 +14703,1213 @@ var require_tasks_wide_layout = __commonJS({
|
|
|
13576
14703
|
}
|
|
13577
14704
|
});
|
|
13578
14705
|
|
|
13579
|
-
// packages/addons/tasks/client/
|
|
13580
|
-
var
|
|
13581
|
-
"packages/addons/tasks/client/
|
|
14706
|
+
// packages/addons/tasks/client/views/compact/bars.cjs
|
|
14707
|
+
var require_bars = __commonJS({
|
|
14708
|
+
"packages/addons/tasks/client/views/compact/bars.cjs"(exports2, module2) {
|
|
13582
14709
|
"use strict";
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
var
|
|
13587
|
-
var statusInfo = deps.statusInfo;
|
|
13588
|
-
var
|
|
13589
|
-
var
|
|
13590
|
-
|
|
13591
|
-
|
|
13592
|
-
|
|
13593
|
-
|
|
14710
|
+
var filters = require_task_filter_model();
|
|
14711
|
+
var renderFilterPanel = require_task_filter_panel();
|
|
14712
|
+
module2.exports = function createBars(deps) {
|
|
14713
|
+
var React = deps.React, h = React.createElement;
|
|
14714
|
+
var Icon2 = deps.Icon, statusInfo = deps.statusInfo, cx = deps.cx;
|
|
14715
|
+
var SS = require_scroll_strip();
|
|
14716
|
+
var STATUS_IDS = ["0", "2", "1", "4", "3"];
|
|
14717
|
+
function IconButton(props) {
|
|
14718
|
+
return h("button", {
|
|
14719
|
+
type: "button",
|
|
14720
|
+
className: "wbtc-icon" + (props.className ? " " + props.className : ""),
|
|
14721
|
+
title: props.label,
|
|
14722
|
+
"aria-label": props.label,
|
|
14723
|
+
"aria-pressed": props.pressed === void 0 ? void 0 : !!props.pressed,
|
|
14724
|
+
disabled: !!props.disabled,
|
|
14725
|
+
onClick: props.onClick
|
|
14726
|
+
}, h(Icon2, { name: props.name, size: props.size || 17 }), props.children || null);
|
|
13594
14727
|
}
|
|
13595
|
-
|
|
14728
|
+
function TopBar(props) {
|
|
13596
14729
|
var t = props.t;
|
|
13597
|
-
|
|
13598
|
-
|
|
13599
|
-
|
|
13600
|
-
var openLike = String(task.status) === "0" || String(task.status) === "4";
|
|
13601
|
-
var myTags = Array.isArray(task.tags) ? task.tags : [];
|
|
13602
|
-
var shown = myTags.slice(0, 3);
|
|
13603
|
-
var rest = myTags.length - shown.length;
|
|
13604
|
-
var meta = [];
|
|
13605
|
-
if (task.publishDate) meta.push(h("span", { key: "p" }, t.publish + " " + task.publishDate));
|
|
13606
|
-
if (task.targetDate) {
|
|
13607
|
-
var cd = openLike ? daysBetween(task.targetDate) : null;
|
|
13608
|
-
meta.push(h("span", { key: "g" }, t.target + " " + task.targetDate + (cd == null ? "" : " \xB7 " + cd + "d")));
|
|
13609
|
-
} else if (task.doneDate) {
|
|
13610
|
-
meta.push(h("span", { key: "d" }, t.done + " " + task.doneDate));
|
|
13611
|
-
}
|
|
13612
|
-
if (Number(task.difficulty) > 0) {
|
|
13613
|
-
meta.push(h("span", { key: "s", className: "wbt-stars" }, stars(task.difficulty)));
|
|
13614
|
-
}
|
|
13615
|
-
var ws = Array.isArray(task.workspaces) && task.workspaces.length ? task.workspaces[0] : null;
|
|
13616
|
-
if (ws) meta.push(h("span", { key: "w", className: "wbtc-card-ws", title: ws.dir || "" }, ws.title || ws.id));
|
|
13617
|
-
var desc = preview(task.description);
|
|
13618
|
-
return h(
|
|
13619
|
-
"div",
|
|
13620
|
-
{ className: "wbtc-card-inner" },
|
|
13621
|
-
props.selectionMode ? h("input", {
|
|
13622
|
-
type: "checkbox",
|
|
13623
|
-
className: "wbt-check",
|
|
13624
|
-
checked: !!props.checked,
|
|
13625
|
-
onChange: function() {
|
|
13626
|
-
props.onCheck(task.id);
|
|
13627
|
-
},
|
|
13628
|
-
onClick: function(e) {
|
|
13629
|
-
e.stopPropagation();
|
|
13630
|
-
}
|
|
13631
|
-
}) : null,
|
|
13632
|
-
h(
|
|
14730
|
+
if (props.selection) {
|
|
14731
|
+
var sel = props.selection;
|
|
14732
|
+
return h(
|
|
13633
14733
|
"div",
|
|
13634
|
-
{ className: "wbtc-
|
|
14734
|
+
{ className: "wbtc-top", role: "toolbar", "aria-label": t.select },
|
|
14735
|
+
h(IconButton, { name: "close", label: t.cancelSelect, onClick: sel.onCancel }),
|
|
13635
14736
|
h(
|
|
13636
14737
|
"div",
|
|
13637
|
-
{ className: "wbtc-
|
|
13638
|
-
|
|
13639
|
-
h("
|
|
13640
|
-
h("div", { className: "wbtc-card-title" }, h(Highlight, { text: task.title, keyword: props.keyword }))
|
|
14738
|
+
{ className: "wbtc-headtext" },
|
|
14739
|
+
h("div", { className: "wbtc-headtitle" }, t.selectedCount.replace("{n}", String(sel.count))),
|
|
14740
|
+
h("div", { className: "wbtc-headsub" }, t.all + " " + (props.total || 0))
|
|
13641
14741
|
),
|
|
13642
|
-
|
|
13643
|
-
|
|
13644
|
-
|
|
13645
|
-
|
|
13646
|
-
|
|
13647
|
-
title: tag.name,
|
|
13648
|
-
onClick: props.onTagPick ? function(e) {
|
|
13649
|
-
e.stopPropagation();
|
|
13650
|
-
props.onTagPick(String(tag.id));
|
|
13651
|
-
} : null
|
|
13652
|
-
}, "#" + tag.name);
|
|
13653
|
-
}).concat(rest > 0 ? [h("span", { key: "more", className: "wbt-tag" }, "+" + rest)] : [])) : null,
|
|
13654
|
-
meta.length ? h("div", { className: "wbtc-card-meta" }, meta) : null
|
|
13655
|
-
),
|
|
13656
|
-
h("span", { className: "wbtc-card-go", "aria-hidden": "true" }, h(Icon2, { name: "right", size: 15 }))
|
|
13657
|
-
);
|
|
13658
|
-
};
|
|
13659
|
-
};
|
|
13660
|
-
}
|
|
13661
|
-
});
|
|
13662
|
-
|
|
13663
|
-
// packages/addons/tasks/client/views/layouts/tasks-compact-view.cjs
|
|
13664
|
-
var require_tasks_compact_view = __commonJS({
|
|
13665
|
-
"packages/addons/tasks/client/views/layouts/tasks-compact-view.cjs"(exports2, module2) {
|
|
13666
|
-
module2.exports = function createCompactView(deps) {
|
|
13667
|
-
var React = deps.React;
|
|
13668
|
-
var h = React.createElement;
|
|
13669
|
-
var PS = require_panel_host();
|
|
13670
|
-
var CL = require_card_list();
|
|
13671
|
-
var SB = require_sticky_bar();
|
|
13672
|
-
var TaskItem = deps.TaskItem;
|
|
13673
|
-
var TaskCardCompact = require_task_card_compact()(deps);
|
|
13674
|
-
var Icon2 = deps.Icon;
|
|
13675
|
-
var renderOverlays = require_tasks_overlays()(deps);
|
|
13676
|
-
function CompactView(props) {
|
|
13677
|
-
var m = props.model;
|
|
13678
|
-
var t = m.t;
|
|
13679
|
-
var store = React.useMemo(function() {
|
|
13680
|
-
return PS.createStore();
|
|
13681
|
-
}, []);
|
|
13682
|
-
function cardProps(task) {
|
|
13683
|
-
return {
|
|
13684
|
-
key: task.id,
|
|
13685
|
-
task,
|
|
13686
|
-
t,
|
|
13687
|
-
lang: m.lang,
|
|
13688
|
-
keyword: m.titleKey.trim(),
|
|
13689
|
-
bodyMode: m.cfg["ui.bodyMode"],
|
|
13690
|
-
selectionMode: m.selectionMode,
|
|
13691
|
-
checked: m.selectedIds.has(String(task.id)),
|
|
13692
|
-
onCheck: m.toggleSelect,
|
|
13693
|
-
update: m.update,
|
|
13694
|
-
toast: m.say,
|
|
13695
|
-
onEdit: function(x) {
|
|
13696
|
-
m.setEditTask(x);
|
|
13697
|
-
},
|
|
13698
|
-
onDone: function(x) {
|
|
13699
|
-
m.setDoneTask(x);
|
|
13700
|
-
},
|
|
13701
|
-
onRestart: function(x) {
|
|
13702
|
-
m.setCreateState({ source: "2", originTask: x });
|
|
13703
|
-
},
|
|
13704
|
-
onTimeline: function(x) {
|
|
13705
|
-
m.setTimelineTask(x);
|
|
13706
|
-
},
|
|
13707
|
-
onDelete: m.deleteTask,
|
|
13708
|
-
onPathPick: m.pickPath,
|
|
13709
|
-
onTagPick: m.toggleTagId
|
|
13710
|
-
};
|
|
13711
|
-
}
|
|
13712
|
-
function openTree() {
|
|
13713
|
-
store.push({
|
|
13714
|
-
id: "tree",
|
|
13715
|
-
kind: "bottom",
|
|
13716
|
-
title: t.tree,
|
|
13717
|
-
render: function(panel) {
|
|
13718
|
-
return h(
|
|
13719
|
-
"div",
|
|
13720
|
-
{ className: "wbtc-sheet" },
|
|
13721
|
-
h(
|
|
13722
|
-
"div",
|
|
13723
|
-
{ className: "wbt-drawer-search" },
|
|
13724
|
-
h("input", {
|
|
13725
|
-
className: "wbt-input",
|
|
13726
|
-
ref: m.treeSearchRef,
|
|
13727
|
-
placeholder: t.treeSearch,
|
|
13728
|
-
value: m.treeQuery,
|
|
13729
|
-
onChange: function(e) {
|
|
13730
|
-
m.setTreeQuery(e.target.value);
|
|
13731
|
-
}
|
|
13732
|
-
}),
|
|
13733
|
-
m.treeQuery ? h("button", {
|
|
13734
|
-
className: "wbt-search-clear",
|
|
13735
|
-
title: t.clear,
|
|
13736
|
-
"aria-label": t.clear,
|
|
13737
|
-
onClick: function() {
|
|
13738
|
-
m.setTreeQuery("");
|
|
13739
|
-
}
|
|
13740
|
-
}, h(Icon2, { name: "close", size: 13 })) : null
|
|
13741
|
-
),
|
|
13742
|
-
h("div", { className: "wbtc-sheet" }, m.treeBody),
|
|
13743
|
-
h(
|
|
13744
|
-
"div",
|
|
13745
|
-
{ className: "wbtc-foot-acts" },
|
|
13746
|
-
h(
|
|
13747
|
-
"button",
|
|
13748
|
-
{ className: "wbt-addbtn", onClick: function() {
|
|
13749
|
-
if (m.footGroupId) m.addNode(m.footGroupId, "0");
|
|
13750
|
-
} },
|
|
13751
|
-
h(Icon2, { name: "folderPlus", size: 13 }),
|
|
13752
|
-
t.addGroup
|
|
13753
|
-
),
|
|
13754
|
-
h(
|
|
13755
|
-
"button",
|
|
13756
|
-
{ className: "wbt-addbtn", onClick: function() {
|
|
13757
|
-
if (m.footGroupId) m.addNode(m.footGroupId, "1");
|
|
13758
|
-
} },
|
|
13759
|
-
h(Icon2, { name: "filePlus", size: 13 }),
|
|
13760
|
-
t.addTable
|
|
13761
|
-
),
|
|
13762
|
-
h(
|
|
13763
|
-
"button",
|
|
13764
|
-
{ className: "wbt-addbtn", onClick: function() {
|
|
13765
|
-
m.setManager(!m.manager);
|
|
13766
|
-
} },
|
|
13767
|
-
h(Icon2, { name: "pencil", size: 13 }),
|
|
13768
|
-
t.manager
|
|
13769
|
-
),
|
|
13770
|
-
h("button", { className: "wbt-addbtn", onClick: panel.close }, t.close)
|
|
13771
|
-
)
|
|
13772
|
-
);
|
|
13773
|
-
}
|
|
13774
|
-
});
|
|
14742
|
+
h("button", { type: "button", className: "wbtc-btn", onClick: sel.onSelectAll }, t.selectAll),
|
|
14743
|
+
// 右侧按 §4.6 收成「全选 / 取消」两个动作:取消退出选择模式,与左侧 ✕ 等价,
|
|
14744
|
+
// 留两份是因为单手拿手机时拇指更常落在右边。
|
|
14745
|
+
h("button", { type: "button", className: "wbtc-btn", onClick: sel.onCancel }, t.cancel)
|
|
14746
|
+
);
|
|
13775
14747
|
}
|
|
13776
|
-
|
|
13777
|
-
|
|
13778
|
-
|
|
13779
|
-
|
|
13780
|
-
|
|
13781
|
-
|
|
13782
|
-
|
|
13783
|
-
|
|
13784
|
-
|
|
13785
|
-
|
|
13786
|
-
|
|
13787
|
-
|
|
13788
|
-
|
|
13789
|
-
|
|
14748
|
+
if (props.searchOpen) {
|
|
14749
|
+
return h(
|
|
14750
|
+
"div",
|
|
14751
|
+
{ className: "wbtc-top" },
|
|
14752
|
+
h(IconButton, { name: "left", label: t.back, onClick: props.searchClose }),
|
|
14753
|
+
h(
|
|
14754
|
+
"form",
|
|
14755
|
+
{
|
|
14756
|
+
className: "wbtc-search",
|
|
14757
|
+
onSubmit: function(e) {
|
|
14758
|
+
e.preventDefault();
|
|
14759
|
+
props.searchSubmit();
|
|
14760
|
+
}
|
|
14761
|
+
},
|
|
14762
|
+
h("input", {
|
|
14763
|
+
className: "wbtc-search-input",
|
|
14764
|
+
type: "search",
|
|
14765
|
+
inputMode: "search",
|
|
14766
|
+
enterKeyHint: "search",
|
|
14767
|
+
placeholder: t.search,
|
|
14768
|
+
"aria-label": t.search,
|
|
14769
|
+
value: props.searchValue,
|
|
14770
|
+
autoFocus: true,
|
|
14771
|
+
onChange: function(e) {
|
|
14772
|
+
props.searchInput(e.target.value);
|
|
14773
|
+
}
|
|
14774
|
+
}),
|
|
14775
|
+
h(IconButton, { name: "search", label: t.search, onClick: props.searchSubmit })
|
|
14776
|
+
)
|
|
14777
|
+
);
|
|
13790
14778
|
}
|
|
13791
|
-
|
|
13792
|
-
var head = h(
|
|
14779
|
+
return h(
|
|
13793
14780
|
"div",
|
|
13794
|
-
{ className: "wbtc-
|
|
14781
|
+
{ className: "wbtc-top", role: "toolbar" },
|
|
14782
|
+
h(IconButton, { name: "left", label: t.back, onClick: props.onBack, disabled: props.backDisabled }),
|
|
13795
14783
|
h(
|
|
13796
14784
|
"button",
|
|
13797
|
-
{
|
|
13798
|
-
|
|
13799
|
-
|
|
13800
|
-
|
|
13801
|
-
|
|
14785
|
+
{
|
|
14786
|
+
type: "button",
|
|
14787
|
+
className: "wbtc-headtext",
|
|
14788
|
+
onClick: props.onTitleClick || null,
|
|
14789
|
+
"aria-label": props.title + (props.sub ? " \xB7 " + props.sub : "")
|
|
14790
|
+
},
|
|
14791
|
+
h("div", { className: "wbtc-headtitle" }, props.title),
|
|
14792
|
+
props.sub ? h("div", { className: "wbtc-headsub" }, props.sub) : null
|
|
13802
14793
|
),
|
|
13803
|
-
h(
|
|
13804
|
-
h(
|
|
13805
|
-
|
|
13806
|
-
|
|
13807
|
-
|
|
13808
|
-
|
|
13809
|
-
|
|
13810
|
-
|
|
13811
|
-
|
|
14794
|
+
h(IconButton, { name: "search", label: t.search, onClick: props.onSearch }),
|
|
14795
|
+
h(IconButton, { name: "more", label: t.more, onClick: props.onMore })
|
|
14796
|
+
);
|
|
14797
|
+
}
|
|
14798
|
+
function ScopeRow(props) {
|
|
14799
|
+
var t = props.t;
|
|
14800
|
+
var path = (props.path || []).slice(0, -1);
|
|
14801
|
+
var crumb = path.length ? h("div", { className: "wbt-path" }, path.map(function(p, i) {
|
|
14802
|
+
return h(
|
|
14803
|
+
React.Fragment,
|
|
14804
|
+
{ key: String(p.id) + "-" + i },
|
|
14805
|
+
i > 0 ? h("span", { className: "sep", children: "\u203A" }) : null,
|
|
14806
|
+
h("button", {
|
|
14807
|
+
type: "button",
|
|
14808
|
+
title: p.name || p.id,
|
|
14809
|
+
onClick: function(e) {
|
|
14810
|
+
e.stopPropagation();
|
|
14811
|
+
props.onPick(p, i, props.path);
|
|
14812
|
+
}
|
|
14813
|
+
}, p.name || p.id)
|
|
14814
|
+
);
|
|
14815
|
+
})) : h("div", { className: "wbt-path" }, t.all);
|
|
14816
|
+
return h(
|
|
14817
|
+
"div",
|
|
14818
|
+
{ className: "wbtc-scope" },
|
|
14819
|
+
crumb,
|
|
14820
|
+
h("span", { className: "wbtc-scope-count" }, props.count + " " + t.items),
|
|
14821
|
+
props.onFilter ? h(
|
|
14822
|
+
"span",
|
|
14823
|
+
{ className: "wbtc-iconpos" },
|
|
14824
|
+
h(IconButton, { name: "filter", label: t.filter, size: 15, onClick: props.onFilter }),
|
|
14825
|
+
props.filterCount >= 2 ? h("span", { className: "wbtc-badge-dot", "aria-hidden": "true" }, String(props.filterCount)) : null
|
|
14826
|
+
) : null,
|
|
14827
|
+
h(IconButton, { name: "layers", label: t.catalog, size: 15, onClick: props.onCatalog })
|
|
14828
|
+
);
|
|
14829
|
+
}
|
|
14830
|
+
function StatusChips(props) {
|
|
14831
|
+
var t = props.t, value = props.value;
|
|
14832
|
+
var all = !value.statuses.length;
|
|
14833
|
+
return h(
|
|
14834
|
+
SS.ScrollStrip,
|
|
14835
|
+
{ h, React, label: t.status },
|
|
13812
14836
|
h("button", {
|
|
13813
|
-
|
|
13814
|
-
|
|
13815
|
-
"aria-
|
|
13816
|
-
disabled: m.loading,
|
|
14837
|
+
type: "button",
|
|
14838
|
+
className: "wbtc-chip",
|
|
14839
|
+
"aria-pressed": all,
|
|
13817
14840
|
onClick: function() {
|
|
13818
|
-
|
|
13819
|
-
m.refreshTagNav();
|
|
14841
|
+
props.onChange(filters.toggle(value, "all"));
|
|
13820
14842
|
}
|
|
13821
|
-
},
|
|
13822
|
-
|
|
13823
|
-
|
|
13824
|
-
|
|
13825
|
-
|
|
13826
|
-
|
|
13827
|
-
|
|
13828
|
-
|
|
13829
|
-
|
|
13830
|
-
|
|
13831
|
-
keyOf: function(task) {
|
|
13832
|
-
return task.id;
|
|
13833
|
-
},
|
|
13834
|
-
renderItem: function(task) {
|
|
13835
|
-
return h(
|
|
13836
|
-
"div",
|
|
13837
|
-
{ className: "wbtc-card", onClick: function(e) {
|
|
13838
|
-
if (e.target.closest("input,button,select,.wbt-tag")) return;
|
|
13839
|
-
openDetail(task);
|
|
13840
|
-
} },
|
|
13841
|
-
h(TaskCardCompact, cardProps(task))
|
|
13842
|
-
);
|
|
13843
|
-
}
|
|
13844
|
-
});
|
|
13845
|
-
var sticky = m.selectionMode ? h(SB.StickyBar, {
|
|
13846
|
-
h,
|
|
13847
|
-
tone: "accent",
|
|
13848
|
-
children: [
|
|
13849
|
-
h("span", { key: "n", className: "wbtc-sum" }, t.selected + " " + m.selectedIds.size),
|
|
13850
|
-
h("button", {
|
|
13851
|
-
key: "all",
|
|
13852
|
-
className: "wbt-btn ghost",
|
|
14843
|
+
}, t.all),
|
|
14844
|
+
STATUS_IDS.map(function(id) {
|
|
14845
|
+
var info = statusInfo(id);
|
|
14846
|
+
var on = !all && filters.includes(value, id);
|
|
14847
|
+
return h("button", {
|
|
14848
|
+
key: id,
|
|
14849
|
+
type: "button",
|
|
14850
|
+
className: "wbtc-chip",
|
|
14851
|
+
"aria-pressed": on,
|
|
14852
|
+
"data-status": id,
|
|
13853
14853
|
onClick: function() {
|
|
13854
|
-
|
|
13855
|
-
return String(x.id);
|
|
13856
|
-
})));
|
|
14854
|
+
props.onChange(filters.toggle(value, id));
|
|
13857
14855
|
}
|
|
13858
|
-
},
|
|
13859
|
-
|
|
13860
|
-
|
|
13861
|
-
|
|
13862
|
-
|
|
13863
|
-
|
|
13864
|
-
|
|
14856
|
+
}, props.lang === "en" ? info.en : info.zh);
|
|
14857
|
+
})
|
|
14858
|
+
);
|
|
14859
|
+
}
|
|
14860
|
+
function PresetChips(props) {
|
|
14861
|
+
var t = props.t, value = props.value;
|
|
14862
|
+
var active = filters.activePreset(value);
|
|
14863
|
+
var openS = React.useState(false), open = openS[0], setOpen = openS[1];
|
|
14864
|
+
var names = renderFilterPanel.presetNames(props.lang);
|
|
14865
|
+
return h(
|
|
14866
|
+
"div",
|
|
14867
|
+
{ className: "wbtc-chips wbtc-presets", "data-open": open ? "true" : "false" },
|
|
14868
|
+
h(
|
|
14869
|
+
SS.ScrollStrip,
|
|
14870
|
+
{ h, React, label: t.filter },
|
|
14871
|
+
filters.presets.map(function(id) {
|
|
14872
|
+
var on = active === id;
|
|
14873
|
+
return h("button", {
|
|
14874
|
+
key: id,
|
|
14875
|
+
type: "button",
|
|
14876
|
+
className: "wbtc-chip is-preset",
|
|
14877
|
+
"data-preset": id,
|
|
14878
|
+
"aria-pressed": on,
|
|
14879
|
+
onClick: function() {
|
|
14880
|
+
props.onChange(on ? filters.empty() : filters.presetValue(id));
|
|
14881
|
+
}
|
|
14882
|
+
}, names[id] || id);
|
|
14883
|
+
}),
|
|
13865
14884
|
h("button", {
|
|
13866
|
-
|
|
13867
|
-
className: "
|
|
14885
|
+
type: "button",
|
|
14886
|
+
className: "wbtc-more",
|
|
14887
|
+
"aria-expanded": open,
|
|
13868
14888
|
onClick: function() {
|
|
13869
|
-
|
|
13870
|
-
m.clearSelection();
|
|
14889
|
+
setOpen(!open);
|
|
13871
14890
|
}
|
|
13872
|
-
}, t.
|
|
13873
|
-
|
|
13874
|
-
|
|
13875
|
-
|
|
13876
|
-
|
|
13877
|
-
|
|
13878
|
-
|
|
13879
|
-
|
|
14891
|
+
}, open ? t.hide : t.more, h(Icon2, { name: open ? "up" : "down", size: 12 }))
|
|
14892
|
+
)
|
|
14893
|
+
);
|
|
14894
|
+
}
|
|
14895
|
+
return { IconButton, TopBar, ScopeRow, StatusChips, PresetChips, STATUS_IDS };
|
|
14896
|
+
};
|
|
14897
|
+
}
|
|
14898
|
+
});
|
|
14899
|
+
|
|
14900
|
+
// packages/addons/tasks/client/views/compact/panels.cjs
|
|
14901
|
+
var require_panels = __commonJS({
|
|
14902
|
+
"packages/addons/tasks/client/views/compact/panels.cjs"(exports2, module2) {
|
|
14903
|
+
"use strict";
|
|
14904
|
+
var filters = require_task_filter_model();
|
|
14905
|
+
module2.exports = function createPanels(deps) {
|
|
14906
|
+
var React = deps.React, h = React.createElement;
|
|
14907
|
+
var Icon2 = deps.Icon;
|
|
14908
|
+
var SB = require_sticky_bar();
|
|
14909
|
+
function MenuRow(props) {
|
|
14910
|
+
return h("button", {
|
|
14911
|
+
type: "button",
|
|
14912
|
+
className: "wbtc-btn" + (props.danger ? " is-danger" : ""),
|
|
14913
|
+
onClick: props.onClick,
|
|
14914
|
+
"data-action": props.action
|
|
14915
|
+
}, props.icon ? h(Icon2, { name: props.icon, size: 15 }) : null, props.children);
|
|
14916
|
+
}
|
|
14917
|
+
function CatalogBody(props) {
|
|
14918
|
+
var m = props.m, t = m.t;
|
|
14919
|
+
var query = String(m.treeQuery || "").trim().toLowerCase();
|
|
14920
|
+
var expanded = m.expanded || /* @__PURE__ */ new Set();
|
|
14921
|
+
var tree = Array.isArray(m.tree) ? m.tree : [];
|
|
14922
|
+
var currentTable = String(m.target && m.target.tableId || "");
|
|
14923
|
+
var currentGroup = String(m.target && m.target.groupId || "");
|
|
14924
|
+
function isTable(node) {
|
|
14925
|
+
return String(node.type) === "1";
|
|
14926
|
+
}
|
|
14927
|
+
function isCurrent(node) {
|
|
14928
|
+
return isTable(node) ? String(node.id) === currentTable : !currentTable && String(node.id) === currentGroup;
|
|
14929
|
+
}
|
|
14930
|
+
function countOf(node) {
|
|
14931
|
+
return !isTable(node) && node.children && node.children.length ? node.children.length : 0;
|
|
14932
|
+
}
|
|
14933
|
+
function trailOf(nodes, id, trail) {
|
|
14934
|
+
for (var i = 0; i < (nodes || []).length; i += 1) {
|
|
14935
|
+
var node = nodes[i];
|
|
14936
|
+
var next = trail.concat([String(node.id)]);
|
|
14937
|
+
if (String(node.id) === id) return next;
|
|
14938
|
+
var hit = node.children ? trailOf(node.children, id, next) : null;
|
|
14939
|
+
if (hit) return hit;
|
|
14940
|
+
}
|
|
14941
|
+
return null;
|
|
14942
|
+
}
|
|
14943
|
+
var currentId = currentTable || currentGroup;
|
|
14944
|
+
React.useEffect(function() {
|
|
14945
|
+
if (!currentId || !m.expandIds) return;
|
|
14946
|
+
var trail = trailOf(tree, currentId, []);
|
|
14947
|
+
if (trail && trail.length > 1) m.expandIds(trail.slice(0, -1));
|
|
14948
|
+
}, [currentId, tree.length]);
|
|
14949
|
+
var rows = [];
|
|
14950
|
+
function walk(nodes, depth) {
|
|
14951
|
+
(nodes || []).forEach(function(node) {
|
|
14952
|
+
var name = String(node.name || "");
|
|
14953
|
+
var hit = !query || name.toLowerCase().indexOf(query) >= 0;
|
|
14954
|
+
if (hit) rows.push({ node, depth });
|
|
14955
|
+
var open = query ? true : expanded.has(String(node.id));
|
|
14956
|
+
if (!isTable(node) && open && node.children && node.children.length) walk(node.children, depth + 1);
|
|
14957
|
+
});
|
|
14958
|
+
}
|
|
14959
|
+
walk(tree, 0);
|
|
14960
|
+
function pick(node) {
|
|
14961
|
+
var id = String(node.id);
|
|
14962
|
+
if (!isTable(node)) {
|
|
14963
|
+
if (m.pickNode) m.pickNode(node);
|
|
14964
|
+
if (m.toggleExpanded && !expanded.has(id)) m.toggleExpanded(id);
|
|
14965
|
+
return;
|
|
14966
|
+
}
|
|
14967
|
+
if (m.pickNode) m.pickNode(node);
|
|
14968
|
+
props.close();
|
|
14969
|
+
}
|
|
14970
|
+
return h(
|
|
14971
|
+
"div",
|
|
14972
|
+
{ className: "wbtc-sheet is-catalog" },
|
|
14973
|
+
h(
|
|
14974
|
+
"form",
|
|
14975
|
+
{
|
|
14976
|
+
className: "wbtc-tree-search",
|
|
14977
|
+
onSubmit: function(e) {
|
|
14978
|
+
e.preventDefault();
|
|
14979
|
+
}
|
|
14980
|
+
},
|
|
14981
|
+
h("input", {
|
|
14982
|
+
className: "wbt-input",
|
|
14983
|
+
// 面板打开时焦点落在搜索框:手机上「找目录」几乎总是从输入开始(§4.2)。
|
|
14984
|
+
"data-autofocus": true,
|
|
14985
|
+
ref: m.treeSearchRef,
|
|
14986
|
+
type: "search",
|
|
14987
|
+
placeholder: t.treeSearch,
|
|
14988
|
+
"aria-label": t.treeSearch,
|
|
14989
|
+
value: m.treeQuery,
|
|
14990
|
+
onChange: function(e) {
|
|
14991
|
+
m.setTreeQuery(e.target.value);
|
|
14992
|
+
}
|
|
14993
|
+
})
|
|
14994
|
+
),
|
|
14995
|
+
h(
|
|
14996
|
+
"div",
|
|
14997
|
+
{ className: "wbtc-tree", role: "tree", "aria-label": t.tree },
|
|
14998
|
+
rows.length ? rows.map(function(row) {
|
|
14999
|
+
var node = row.node, leaf = isTable(node), kids = countOf(node);
|
|
15000
|
+
var open = query ? true : expanded.has(String(node.id));
|
|
15001
|
+
var cur = isCurrent(node);
|
|
15002
|
+
return h(
|
|
15003
|
+
"div",
|
|
15004
|
+
{
|
|
15005
|
+
key: String(node.id),
|
|
15006
|
+
className: "wbtc-node" + (leaf ? " is-leaf" : "") + (cur ? " is-current" : ""),
|
|
15007
|
+
role: "treeitem",
|
|
15008
|
+
"aria-selected": cur,
|
|
15009
|
+
"aria-expanded": leaf ? void 0 : !!open,
|
|
15010
|
+
"data-node-id": String(node.id),
|
|
15011
|
+
style: { paddingLeft: 6 + row.depth * 16 + "px" }
|
|
15012
|
+
},
|
|
15013
|
+
leaf ? h("span", { className: "wbtc-node-chev", "aria-hidden": true }) : h("button", {
|
|
15014
|
+
type: "button",
|
|
15015
|
+
className: "wbtc-node-chev",
|
|
15016
|
+
"aria-label": open ? t.hide : t.appear,
|
|
15017
|
+
onClick: function() {
|
|
15018
|
+
if (m.toggleExpanded) m.toggleExpanded(String(node.id));
|
|
15019
|
+
}
|
|
15020
|
+
}, h(Icon2, { name: open ? "down" : "right", size: 14 })),
|
|
15021
|
+
h(
|
|
15022
|
+
"button",
|
|
15023
|
+
{
|
|
15024
|
+
type: "button",
|
|
15025
|
+
className: "wbtc-node-main",
|
|
15026
|
+
onClick: function() {
|
|
15027
|
+
pick(node);
|
|
15028
|
+
}
|
|
15029
|
+
},
|
|
15030
|
+
h(Icon2, { name: leaf ? "table" : "folder", size: 14 }),
|
|
15031
|
+
h("span", { className: "wbtc-node-name" }, String(node.name || "")),
|
|
15032
|
+
kids ? h("span", { className: "wbtc-node-count" }, String(kids)) : null
|
|
15033
|
+
),
|
|
15034
|
+
cur ? h("span", { className: "wbtc-node-dot", "aria-hidden": true }) : null
|
|
15035
|
+
);
|
|
15036
|
+
}) : h("div", { className: "wbtc-empty", role: "status" }, h("div", { className: "wbtc-empty-title" }, t.treeNoMatch))
|
|
15037
|
+
),
|
|
15038
|
+
h(
|
|
15039
|
+
"div",
|
|
15040
|
+
{ className: "wbtc-tree-adds" },
|
|
15041
|
+
h(MenuRow, { icon: "folderPlus", action: "add-group", onClick: function() {
|
|
15042
|
+
m.setManager("add-group");
|
|
15043
|
+
props.close();
|
|
15044
|
+
} }, t.addGroup),
|
|
15045
|
+
h(MenuRow, { icon: "filePlus", action: "add-table", onClick: function() {
|
|
15046
|
+
m.setManager("add-table");
|
|
15047
|
+
props.close();
|
|
15048
|
+
} }, t.addTable),
|
|
15049
|
+
h(MenuRow, { icon: "settings", action: "manager", onClick: function() {
|
|
15050
|
+
m.setManager(true);
|
|
15051
|
+
props.close();
|
|
15052
|
+
} }, t.manager)
|
|
15053
|
+
)
|
|
15054
|
+
);
|
|
15055
|
+
}
|
|
15056
|
+
function FilterBody(props) {
|
|
15057
|
+
var m = props.m;
|
|
15058
|
+
return h("div", { className: "wbtc-sheet" }, m.filterPanel);
|
|
15059
|
+
}
|
|
15060
|
+
function FilterFooter(props) {
|
|
15061
|
+
var m = props.m, t = m.t;
|
|
15062
|
+
var total = m.data && typeof m.data.total === "number" ? m.data.total : 0;
|
|
15063
|
+
return h(
|
|
15064
|
+
SB.StickyBar,
|
|
15065
|
+
{ h, flow: "inline", label: t.filter },
|
|
15066
|
+
m.filterHint ? h("div", { className: "wbbar-note", role: "status" }, m.filterHint) : null,
|
|
15067
|
+
h("button", {
|
|
15068
|
+
type: "button",
|
|
15069
|
+
className: "wbtc-primary",
|
|
15070
|
+
onClick: function() {
|
|
15071
|
+
props.close();
|
|
15072
|
+
}
|
|
15073
|
+
}, h(Icon2, { name: "filter", size: 16 }), t.results.replace("{n}", String(total))),
|
|
15074
|
+
h("button", {
|
|
15075
|
+
type: "button",
|
|
15076
|
+
className: "wbtc-btn",
|
|
15077
|
+
onClick: function() {
|
|
15078
|
+
m.setFilterValue(filters.empty());
|
|
15079
|
+
m.setFilterTagIds([]);
|
|
15080
|
+
m.setDifficultyMissing(false);
|
|
15081
|
+
m.setPageNumber(1);
|
|
15082
|
+
}
|
|
15083
|
+
}, t.reset)
|
|
15084
|
+
);
|
|
15085
|
+
}
|
|
15086
|
+
function ActionsBody(props) {
|
|
15087
|
+
var m = props.m, t = m.t, task = props.task;
|
|
15088
|
+
var confirmS = React.useState(""), confirm = confirmS[0], setConfirm = confirmS[1];
|
|
15089
|
+
var openLike = String(task.status) === "0" || String(task.status) === "4";
|
|
15090
|
+
if (confirm === "delete") {
|
|
15091
|
+
return h(
|
|
15092
|
+
"div",
|
|
15093
|
+
{ className: "wbtc-sheet" },
|
|
15094
|
+
h("div", { className: "wbtc-note", role: "alert" }, t.deleteTaskConfirm),
|
|
15095
|
+
h(MenuRow, {
|
|
15096
|
+
danger: true,
|
|
15097
|
+
action: "delete-confirm",
|
|
13880
15098
|
onClick: function() {
|
|
13881
|
-
m.
|
|
15099
|
+
m.deleteTask(task);
|
|
15100
|
+
props.close();
|
|
13882
15101
|
}
|
|
13883
|
-
}, h(Icon2, { name: "
|
|
13884
|
-
|
|
15102
|
+
}, h(Icon2, { name: "trash", size: 15 }), t.del + " \xB7 " + task.title),
|
|
15103
|
+
h(MenuRow, { action: "delete-cancel", onClick: function() {
|
|
15104
|
+
setConfirm("");
|
|
15105
|
+
} }, t.cancel)
|
|
15106
|
+
);
|
|
15107
|
+
}
|
|
15108
|
+
return h(
|
|
15109
|
+
"div",
|
|
15110
|
+
{ className: "wbtc-sheet" },
|
|
15111
|
+
h(MenuRow, { icon: "pencil", action: "edit", onClick: function() {
|
|
15112
|
+
props.onEdit(task);
|
|
15113
|
+
props.close();
|
|
15114
|
+
} }, t.edit),
|
|
15115
|
+
openLike ? h(MenuRow, { icon: "check", action: "done", onClick: function() {
|
|
15116
|
+
props.onDone(task);
|
|
15117
|
+
props.close();
|
|
15118
|
+
} }, t.complete) : h(MenuRow, { icon: "restart", action: "restart", onClick: function() {
|
|
15119
|
+
props.onRestart(task);
|
|
15120
|
+
props.close();
|
|
15121
|
+
} }, t.restart),
|
|
15122
|
+
openLike ? h(MenuRow, { icon: "stop", action: "shutdown", onClick: function() {
|
|
15123
|
+
m.update(task, { type: "STATUS", status: "1", date: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10) });
|
|
15124
|
+
props.close();
|
|
15125
|
+
} }, t.shutdownOp) : null,
|
|
15126
|
+
h(MenuRow, { icon: "timeline", action: "timeline", onClick: function() {
|
|
15127
|
+
props.onTimeline(task);
|
|
15128
|
+
props.close();
|
|
15129
|
+
} }, t.timeline),
|
|
15130
|
+
h(MenuRow, {
|
|
15131
|
+
icon: "select",
|
|
15132
|
+
action: "select",
|
|
15133
|
+
onClick: function() {
|
|
15134
|
+
m.setSelectionMode(true);
|
|
15135
|
+
m.toggleSelect(task.id);
|
|
15136
|
+
props.close();
|
|
15137
|
+
}
|
|
15138
|
+
}, t.select),
|
|
15139
|
+
h(MenuRow, { danger: true, icon: "trash", action: "delete", onClick: function() {
|
|
15140
|
+
setConfirm("delete");
|
|
15141
|
+
} }, t.del)
|
|
15142
|
+
);
|
|
15143
|
+
}
|
|
15144
|
+
function MoreBody(props) {
|
|
15145
|
+
var m = props.m, t = m.t;
|
|
15146
|
+
function run(fn) {
|
|
15147
|
+
fn();
|
|
15148
|
+
props.close();
|
|
15149
|
+
}
|
|
15150
|
+
return h(
|
|
15151
|
+
"div",
|
|
15152
|
+
{ className: "wbtc-sheet" },
|
|
15153
|
+
h(MenuRow, { icon: "plus", action: "new", onClick: function() {
|
|
15154
|
+
run(props.onNew);
|
|
15155
|
+
} }, t.newTask),
|
|
15156
|
+
h(MenuRow, { icon: "folderPlus", action: "add-group", onClick: function() {
|
|
15157
|
+
run(function() {
|
|
15158
|
+
m.setManager("add-group");
|
|
15159
|
+
});
|
|
15160
|
+
} }, t.addGroup),
|
|
15161
|
+
h(MenuRow, { icon: "filePlus", action: "add-table", onClick: function() {
|
|
15162
|
+
run(function() {
|
|
15163
|
+
m.setManager("add-table");
|
|
15164
|
+
});
|
|
15165
|
+
} }, t.addTable),
|
|
15166
|
+
h(MenuRow, { icon: "settings", action: "manager", onClick: function() {
|
|
15167
|
+
run(function() {
|
|
15168
|
+
m.setManager(true);
|
|
15169
|
+
});
|
|
15170
|
+
} }, t.manager),
|
|
15171
|
+
h(MenuRow, { icon: "refresh", action: "refresh", onClick: function() {
|
|
15172
|
+
run(m.refreshList);
|
|
15173
|
+
} }, t.refresh),
|
|
15174
|
+
h(MenuRow, {
|
|
15175
|
+
icon: "select",
|
|
15176
|
+
action: "select",
|
|
15177
|
+
onClick: function() {
|
|
15178
|
+
run(function() {
|
|
15179
|
+
m.setSelectionMode(true);
|
|
15180
|
+
});
|
|
15181
|
+
}
|
|
15182
|
+
}, t.select)
|
|
15183
|
+
);
|
|
15184
|
+
}
|
|
15185
|
+
return {
|
|
15186
|
+
MenuRow,
|
|
15187
|
+
CatalogBody,
|
|
15188
|
+
FilterBody,
|
|
15189
|
+
FilterFooter,
|
|
15190
|
+
ActionsBody,
|
|
15191
|
+
MoreBody
|
|
15192
|
+
};
|
|
15193
|
+
};
|
|
15194
|
+
}
|
|
15195
|
+
});
|
|
15196
|
+
|
|
15197
|
+
// packages/addons/tasks/client/item/task-card-compact.cjs
|
|
15198
|
+
var require_task_card_compact = __commonJS({
|
|
15199
|
+
"packages/addons/tasks/client/item/task-card-compact.cjs"(exports2, module2) {
|
|
15200
|
+
"use strict";
|
|
15201
|
+
module2.exports = function createTaskCardCompact(deps) {
|
|
15202
|
+
var React = deps.React;
|
|
15203
|
+
var h = React.createElement;
|
|
15204
|
+
var Highlight = require_highlight2()(React);
|
|
15205
|
+
var statusInfo = deps.statusInfo;
|
|
15206
|
+
var stars = deps.stars;
|
|
15207
|
+
var pClass = deps.pClass;
|
|
15208
|
+
var daysBetween = deps.daysBetween;
|
|
15209
|
+
var Icon2 = deps.Icon;
|
|
15210
|
+
function shortDate(text) {
|
|
15211
|
+
var v = String(text || "");
|
|
15212
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(v) ? v.slice(5) : v;
|
|
15213
|
+
}
|
|
15214
|
+
function dueOf(task, t) {
|
|
15215
|
+
if (!task.targetDate) return { text: "", over: false };
|
|
15216
|
+
var label = t.target + " " + shortDate(task.targetDate);
|
|
15217
|
+
var openLike = String(task.status) === "0" || String(task.status) === "4";
|
|
15218
|
+
if (!openLike) return { text: label, over: false };
|
|
15219
|
+
var days = daysBetween(task.targetDate);
|
|
15220
|
+
if (days === null || days === void 0) return { text: label, over: false };
|
|
15221
|
+
if (days < 0) return { text: label + " \xB7 " + t.overdue.replace("{n}", String(-days)), over: true };
|
|
15222
|
+
if (days === 0) return { text: label + " \xB7 " + t.dueToday, over: true };
|
|
15223
|
+
if (days === 1) return { text: label + " \xB7 " + t.dueTomorrow, over: false };
|
|
15224
|
+
return { text: label + " \xB7 " + t.daysLeft.replace("{n}", String(days)), over: false };
|
|
15225
|
+
}
|
|
15226
|
+
function TaskCardCompact(props) {
|
|
15227
|
+
var t = props.t;
|
|
15228
|
+
var task = props.task;
|
|
15229
|
+
var st = statusInfo(task.status);
|
|
15230
|
+
var stName = props.lang === "en" ? st.en : st.zh;
|
|
15231
|
+
var openLike = String(task.status) === "0" || String(task.status) === "4";
|
|
15232
|
+
var tags = (task.tags || []).slice(0, 3);
|
|
15233
|
+
var rest = (task.tags || []).length - tags.length;
|
|
15234
|
+
var due = dueOf(task, t);
|
|
15235
|
+
return h(
|
|
15236
|
+
"div",
|
|
15237
|
+
{
|
|
15238
|
+
className: "wbtc-card",
|
|
15239
|
+
role: "button",
|
|
15240
|
+
tabIndex: props.selectionMode ? -1 : 0,
|
|
15241
|
+
"aria-selected": props.selectionMode ? !!props.checked : void 0,
|
|
15242
|
+
"data-task-id": String(task.id),
|
|
15243
|
+
onKeyDown: function(e) {
|
|
15244
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
15245
|
+
e.preventDefault();
|
|
15246
|
+
if (props.onKeyboardOpen) props.onKeyboardOpen(task);
|
|
15247
|
+
}
|
|
15248
|
+
},
|
|
15249
|
+
props.selectionMode ? h("input", {
|
|
15250
|
+
type: "checkbox",
|
|
15251
|
+
className: "wbtc-check",
|
|
15252
|
+
checked: !!props.checked,
|
|
15253
|
+
"aria-label": task.title,
|
|
15254
|
+
onChange: function(e) {
|
|
15255
|
+
e.stopPropagation();
|
|
15256
|
+
props.onCheck(task);
|
|
15257
|
+
},
|
|
15258
|
+
onClick: function(e) {
|
|
15259
|
+
e.stopPropagation();
|
|
15260
|
+
}
|
|
15261
|
+
}) : null,
|
|
15262
|
+
h(
|
|
15263
|
+
"div",
|
|
15264
|
+
{ className: "wbtc-card-inner" },
|
|
15265
|
+
h(
|
|
13885
15266
|
"div",
|
|
13886
|
-
{
|
|
13887
|
-
h(
|
|
15267
|
+
{ className: "wbtc-card-body" },
|
|
15268
|
+
h(
|
|
15269
|
+
"div",
|
|
15270
|
+
{ className: "wbtc-card-top" },
|
|
15271
|
+
h(
|
|
15272
|
+
"span",
|
|
15273
|
+
{ className: "wbt-prio " + (openLike ? pClass(task.priority) : "low") },
|
|
15274
|
+
openLike ? "P" + task.priority : "\u2014"
|
|
15275
|
+
),
|
|
15276
|
+
h("span", { className: "wbt-badge " + st.cls }, stName),
|
|
15277
|
+
h("div", { className: "wbtc-card-title" }, h(Highlight, { text: task.title, keyword: props.keyword }))
|
|
15278
|
+
),
|
|
15279
|
+
tags.length ? h("div", { className: "wbtc-card-tags" }, tags.map(function(tag) {
|
|
15280
|
+
return h("span", { key: String(tag.id), className: "wbt-tag", title: tag.name }, "#" + tag.name);
|
|
15281
|
+
}).concat(rest > 0 ? [h("span", { key: "rest", className: "wbt-tag" }, "+" + rest)] : [])) : null,
|
|
15282
|
+
due.text || Number(task.difficulty) > 0 || task.publishDate ? h(
|
|
15283
|
+
"div",
|
|
15284
|
+
{ className: "wbtc-card-foot" },
|
|
15285
|
+
due.text ? h("span", { className: "wbtc-card-due" + (due.over ? " is-over" : "") }, due.text) : null,
|
|
15286
|
+
h(
|
|
15287
|
+
"span",
|
|
15288
|
+
{ className: "wbtc-card-right" },
|
|
15289
|
+
Number(task.difficulty) > 0 ? h("span", {
|
|
15290
|
+
className: "wbtc-card-stars",
|
|
15291
|
+
title: t.difficulty + " " + Number(task.difficulty).toFixed(1),
|
|
15292
|
+
"aria-label": t.difficulty + " " + Number(task.difficulty).toFixed(1)
|
|
15293
|
+
}, stars(task.difficulty)) : null,
|
|
15294
|
+
task.publishDate ? h("span", { className: "wbtc-card-pub" }, shortDate(task.publishDate)) : null
|
|
15295
|
+
)
|
|
15296
|
+
) : null
|
|
15297
|
+
)
|
|
15298
|
+
),
|
|
15299
|
+
props.selectionMode ? null : h(
|
|
15300
|
+
"span",
|
|
15301
|
+
{ className: "wbtc-card-go", "aria-hidden": "true" },
|
|
15302
|
+
h(Icon2, { name: "right", size: 15 })
|
|
15303
|
+
)
|
|
15304
|
+
);
|
|
15305
|
+
}
|
|
15306
|
+
return TaskCardCompact;
|
|
15307
|
+
};
|
|
15308
|
+
}
|
|
15309
|
+
});
|
|
15310
|
+
|
|
15311
|
+
// packages/addons/tasks/client/views/compact/list-screen.cjs
|
|
15312
|
+
var require_list_screen = __commonJS({
|
|
15313
|
+
"packages/addons/tasks/client/views/compact/list-screen.cjs"(exports2, module2) {
|
|
15314
|
+
"use strict";
|
|
15315
|
+
var CL = require_card_list();
|
|
15316
|
+
var SB = require_sticky_bar();
|
|
15317
|
+
module2.exports = function createListScreen(deps) {
|
|
15318
|
+
var React = deps.React, h = React.createElement;
|
|
15319
|
+
var Icon2 = deps.Icon, cx = deps.cx;
|
|
15320
|
+
var TaskCardCompact = require_task_card_compact()(deps);
|
|
15321
|
+
var PER_PAGE = [12, 24, 48, 96];
|
|
15322
|
+
function activeCount(value, tagIds, missing) {
|
|
15323
|
+
var n = value.statuses.length ? 1 : 0;
|
|
15324
|
+
["publish", "done", "shutdown", "claimed", "target"].forEach(function(key) {
|
|
15325
|
+
if (value[key] && (value[key].from || value[key].to)) n += 1;
|
|
15326
|
+
});
|
|
15327
|
+
if (value.priority.min && value.priority.min !== "0" || value.priority.max && value.priority.max !== "10") n += 1;
|
|
15328
|
+
if (value.difficulty.min && value.difficulty.min !== "0" || value.difficulty.max && value.difficulty.max !== "5") n += 1;
|
|
15329
|
+
if (value.workspaceIds && value.workspaceIds.length) n += 1;
|
|
15330
|
+
if (value.noWorkspace) n += 1;
|
|
15331
|
+
if (tagIds && tagIds.length) n += 1;
|
|
15332
|
+
if (missing) n += 1;
|
|
15333
|
+
return n;
|
|
15334
|
+
}
|
|
15335
|
+
function BottomBar(props) {
|
|
15336
|
+
var m = props.m, t = m.t;
|
|
15337
|
+
if (m.selectionMode) {
|
|
15338
|
+
var none = !m.selectedIds.size;
|
|
15339
|
+
return h(
|
|
15340
|
+
SB.StickyBar,
|
|
15341
|
+
{ h, tone: "accent", flow: "inline", label: t.select },
|
|
15342
|
+
h("button", {
|
|
15343
|
+
type: "button",
|
|
15344
|
+
className: "wbtc-btn",
|
|
15345
|
+
disabled: none,
|
|
15346
|
+
onClick: function() {
|
|
15347
|
+
m.claimSelected();
|
|
15348
|
+
}
|
|
15349
|
+
}, h(Icon2, { name: "check", size: 15 }), t.claimSelected),
|
|
15350
|
+
h("button", {
|
|
15351
|
+
type: "button",
|
|
15352
|
+
className: "wbtc-btn is-danger",
|
|
15353
|
+
disabled: none,
|
|
15354
|
+
onClick: function() {
|
|
15355
|
+
m.batchDelete();
|
|
15356
|
+
}
|
|
15357
|
+
}, h(Icon2, { name: "trash", size: 15 }), t.batchDelete),
|
|
15358
|
+
h("button", {
|
|
15359
|
+
type: "button",
|
|
15360
|
+
className: "wbtc-btn",
|
|
15361
|
+
disabled: none,
|
|
15362
|
+
onClick: function() {
|
|
15363
|
+
m.openSelected();
|
|
15364
|
+
}
|
|
15365
|
+
}, h(Icon2, { name: "more", size: 15 }), t.more)
|
|
15366
|
+
);
|
|
15367
|
+
}
|
|
15368
|
+
var pages = m.totalPages || 1;
|
|
15369
|
+
return h(
|
|
15370
|
+
SB.StickyBar,
|
|
15371
|
+
{ h, flow: "inline", label: t.title },
|
|
15372
|
+
h(
|
|
15373
|
+
"div",
|
|
15374
|
+
{ className: "wbtc-pager" },
|
|
15375
|
+
h("button", {
|
|
15376
|
+
type: "button",
|
|
15377
|
+
className: "wbtc-icon",
|
|
15378
|
+
"aria-label": t.page,
|
|
15379
|
+
disabled: m.pageNumber <= 1,
|
|
15380
|
+
onClick: function() {
|
|
13888
15381
|
m.setPageNumber(Math.max(1, m.pageNumber - 1));
|
|
13889
|
-
}
|
|
13890
|
-
|
|
13891
|
-
|
|
13892
|
-
m.setPageNumber(Math.min(m.totalPages, m.pageNumber + 1));
|
|
13893
|
-
} }, h(Icon2, { name: "right", size: 14 }))
|
|
13894
|
-
) : null,
|
|
15382
|
+
}
|
|
15383
|
+
}, h(Icon2, { name: "left", size: 17 })),
|
|
15384
|
+
h("span", { className: "wbtc-pageno", "aria-live": "polite" }, m.pageNumber + " / " + pages),
|
|
13895
15385
|
h("button", {
|
|
13896
|
-
|
|
13897
|
-
className: "
|
|
13898
|
-
|
|
13899
|
-
|
|
15386
|
+
type: "button",
|
|
15387
|
+
className: "wbtc-icon",
|
|
15388
|
+
"aria-label": t.page,
|
|
15389
|
+
disabled: m.pageNumber >= pages,
|
|
13900
15390
|
onClick: function() {
|
|
13901
|
-
m.
|
|
15391
|
+
m.setPageNumber(Math.min(pages, m.pageNumber + 1));
|
|
13902
15392
|
}
|
|
13903
|
-
}, h(Icon2, { name: "
|
|
13904
|
-
|
|
13905
|
-
|
|
15393
|
+
}, h(Icon2, { name: "right", size: 17 }))
|
|
15394
|
+
),
|
|
15395
|
+
h("select", {
|
|
15396
|
+
className: "wbtc-perpage",
|
|
15397
|
+
"aria-label": t.perPage,
|
|
15398
|
+
value: String(m.pageSize),
|
|
15399
|
+
onChange: function(e) {
|
|
15400
|
+
m.setPageSize(Number(e.target.value));
|
|
15401
|
+
m.setPageNumber(1);
|
|
15402
|
+
}
|
|
15403
|
+
}, PER_PAGE.map(function(n) {
|
|
15404
|
+
return h("option", { key: n, value: String(n) }, String(n));
|
|
15405
|
+
})),
|
|
15406
|
+
h("button", {
|
|
15407
|
+
type: "button",
|
|
15408
|
+
className: "wbtc-primary",
|
|
15409
|
+
onClick: props.onNew
|
|
15410
|
+
}, h(Icon2, { name: "plus", size: 17 }), h("span", { className: "wbtc-primary-label" }, t.newTask))
|
|
15411
|
+
);
|
|
15412
|
+
}
|
|
15413
|
+
function ListScreen(props) {
|
|
15414
|
+
var m = props.m, t = m.t, bars = props.bars, view = props.view;
|
|
15415
|
+
var dense = props.dense === true;
|
|
15416
|
+
var records = m.data && m.data.records || [];
|
|
15417
|
+
var total = m.data && typeof m.data.total === "number" ? m.data.total : 0;
|
|
15418
|
+
var path = m.currentPath || [];
|
|
15419
|
+
var nodeName = path.length ? String(path[path.length - 1].name || "") : "";
|
|
15420
|
+
var listRef = React.useRef ? React.useRef(null) : { current: null };
|
|
15421
|
+
React.useEffect(function() {
|
|
15422
|
+
if (!view.needRestore || !view.needRestore.current) return void 0;
|
|
15423
|
+
if (!listRef.current || !records.length) return void 0;
|
|
15424
|
+
var target = view.scrollPos.current || 0;
|
|
15425
|
+
var timers = [];
|
|
15426
|
+
function apply() {
|
|
15427
|
+
var el = listRef.current;
|
|
15428
|
+
if (!el) return;
|
|
15429
|
+
if (Math.abs(el.scrollTop - target) > 1) el.scrollTop = target;
|
|
15430
|
+
if (!view.focusId) return;
|
|
15431
|
+
var card = el.querySelector('[data-task-id="' + view.focusId + '"]');
|
|
15432
|
+
if (card && card.focus && document.activeElement !== card) card.focus();
|
|
15433
|
+
}
|
|
15434
|
+
[16, 80, 200, 400].forEach(function(delay) {
|
|
15435
|
+
timers.push(setTimeout(apply, delay));
|
|
15436
|
+
});
|
|
15437
|
+
return function() {
|
|
15438
|
+
timers.forEach(function(id) {
|
|
15439
|
+
clearTimeout(id);
|
|
15440
|
+
});
|
|
15441
|
+
view.needRestore.current = false;
|
|
15442
|
+
};
|
|
15443
|
+
}, [records.length]);
|
|
15444
|
+
var sub = m.titleKey ? t.searchCount.replace("{n}", String(total)) : nodeName;
|
|
15445
|
+
var headProps = {
|
|
15446
|
+
t,
|
|
15447
|
+
selection: m.selectionMode ? {
|
|
15448
|
+
count: m.selectedIds.size,
|
|
15449
|
+
onCancel: function() {
|
|
15450
|
+
m.clearSelection();
|
|
15451
|
+
m.setSelectionMode(false);
|
|
15452
|
+
},
|
|
15453
|
+
onSelectAll: function() {
|
|
15454
|
+
var next = new Set(m.selectedIds);
|
|
15455
|
+
var allOn = records.length && records.every(function(r) {
|
|
15456
|
+
return next.has(String(r.id));
|
|
15457
|
+
});
|
|
15458
|
+
records.forEach(function(r) {
|
|
15459
|
+
if (allOn) next.delete(String(r.id));
|
|
15460
|
+
else next.add(String(r.id));
|
|
15461
|
+
});
|
|
15462
|
+
m.setSelectedIds(next);
|
|
15463
|
+
},
|
|
15464
|
+
onClear: function() {
|
|
15465
|
+
m.clearSelection();
|
|
15466
|
+
}
|
|
15467
|
+
} : null,
|
|
15468
|
+
total,
|
|
15469
|
+
title: t.records,
|
|
15470
|
+
sub,
|
|
15471
|
+
backDisabled: m.selectionMode ? false : path.length < 2,
|
|
15472
|
+
onBack: props.onBack,
|
|
15473
|
+
onTitleClick: function() {
|
|
15474
|
+
view.openCatalog();
|
|
15475
|
+
},
|
|
15476
|
+
searchOpen: view.searchOpen,
|
|
15477
|
+
searchValue: m.searchDraft,
|
|
15478
|
+
searchInput: function(v) {
|
|
15479
|
+
m.setSearchDraft(v);
|
|
15480
|
+
},
|
|
15481
|
+
searchSubmit: function() {
|
|
15482
|
+
m.setTitleKey(m.searchDraft);
|
|
15483
|
+
m.setPageNumber(1);
|
|
15484
|
+
},
|
|
15485
|
+
searchClose: function() {
|
|
15486
|
+
view.setSearchOpen(false);
|
|
15487
|
+
m.setSearchDraft("");
|
|
15488
|
+
m.setTitleKey("");
|
|
15489
|
+
m.setPageNumber(1);
|
|
15490
|
+
},
|
|
15491
|
+
onSearch: function() {
|
|
15492
|
+
view.setSearchOpen(!view.searchOpen);
|
|
15493
|
+
},
|
|
15494
|
+
onMore: function() {
|
|
15495
|
+
view.openMore();
|
|
15496
|
+
}
|
|
15497
|
+
};
|
|
15498
|
+
var emptyNode = h(
|
|
15499
|
+
"div",
|
|
15500
|
+
{ className: "wbtc-empty" },
|
|
15501
|
+
h(Icon2, { name: "list", size: 26 }),
|
|
15502
|
+
h("div", null, m.titleKey ? t.emptySearch : t.emptyDir),
|
|
15503
|
+
m.titleKey ? h(
|
|
15504
|
+
"button",
|
|
15505
|
+
{ type: "button", className: "wbtc-btn", onClick: function() {
|
|
15506
|
+
m.setSearchDraft("");
|
|
15507
|
+
m.setTitleKey("");
|
|
15508
|
+
m.setPageNumber(1);
|
|
15509
|
+
} },
|
|
15510
|
+
h(Icon2, { name: "close", size: 15 }),
|
|
15511
|
+
t.clear
|
|
15512
|
+
) : h(
|
|
15513
|
+
"button",
|
|
15514
|
+
{ type: "button", className: "wbtc-btn", onClick: props.onNew },
|
|
15515
|
+
h(Icon2, { name: "plus", size: 15 }),
|
|
15516
|
+
t.newTask
|
|
15517
|
+
)
|
|
15518
|
+
);
|
|
15519
|
+
var list = h(
|
|
15520
|
+
"div",
|
|
15521
|
+
{
|
|
15522
|
+
className: "wbtc-list",
|
|
15523
|
+
ref: listRef,
|
|
15524
|
+
onScroll: function(e) {
|
|
15525
|
+
view.scrollPos.current = e.currentTarget.scrollTop;
|
|
15526
|
+
},
|
|
15527
|
+
"aria-busy": m.loading && !records.length ? "true" : void 0
|
|
15528
|
+
},
|
|
15529
|
+
h(CL.CardList, {
|
|
15530
|
+
h,
|
|
15531
|
+
React,
|
|
15532
|
+
items: records,
|
|
15533
|
+
keyOf: function(item) {
|
|
15534
|
+
return String(item.id);
|
|
15535
|
+
},
|
|
15536
|
+
loading: m.loading && !records.length,
|
|
15537
|
+
className: "wbtc-cards",
|
|
15538
|
+
empty: emptyNode,
|
|
15539
|
+
error: m.error ? t.error + m.error : null,
|
|
15540
|
+
onRetry: function() {
|
|
15541
|
+
m.refreshList();
|
|
15542
|
+
},
|
|
15543
|
+
retryLabel: t.refresh,
|
|
15544
|
+
onItemClick: function(item) {
|
|
15545
|
+
if (m.selectionMode) {
|
|
15546
|
+
m.toggleSelect(item.id);
|
|
15547
|
+
return;
|
|
15548
|
+
}
|
|
15549
|
+
props.onDetail(item, listRef.current ? listRef.current.scrollTop : 0);
|
|
15550
|
+
},
|
|
15551
|
+
// 长按进选择模式并选中这一条(§4.6/§12 的双入口之一)。单条的动作菜单挂在
|
|
15552
|
+
// 详情屏右上角与选择模式底条上——卡片里不放按钮,长按也就不该再分叉出第二套语义。
|
|
15553
|
+
onItemLongPress: function(item) {
|
|
15554
|
+
props.onSelect(item);
|
|
15555
|
+
},
|
|
15556
|
+
renderItem: function(item) {
|
|
15557
|
+
return h(TaskCardCompact, {
|
|
15558
|
+
t,
|
|
15559
|
+
lang: m.lang,
|
|
15560
|
+
task: item,
|
|
15561
|
+
keyword: m.titleKey,
|
|
15562
|
+
selectionMode: m.selectionMode,
|
|
15563
|
+
checked: m.selectedIds.has(String(item.id)),
|
|
15564
|
+
onCheck: function() {
|
|
15565
|
+
m.toggleSelect(item.id);
|
|
15566
|
+
},
|
|
15567
|
+
onKeyboardOpen: function(x) {
|
|
15568
|
+
if (m.selectionMode) {
|
|
15569
|
+
m.toggleSelect(x.id);
|
|
15570
|
+
return;
|
|
15571
|
+
}
|
|
15572
|
+
props.onDetail(x);
|
|
15573
|
+
}
|
|
15574
|
+
});
|
|
15575
|
+
}
|
|
15576
|
+
})
|
|
15577
|
+
);
|
|
13906
15578
|
return h(
|
|
13907
15579
|
"div",
|
|
13908
|
-
{ className: "
|
|
15580
|
+
{ className: "wbtc-screen", "data-dense": dense ? "true" : void 0 },
|
|
15581
|
+
h(bars.TopBar, headProps),
|
|
15582
|
+
m.selectionMode ? null : h(bars.ScopeRow, {
|
|
15583
|
+
t,
|
|
15584
|
+
path,
|
|
15585
|
+
title: t.title,
|
|
15586
|
+
count: total,
|
|
15587
|
+
onPick: function(p, i, arr) {
|
|
15588
|
+
m.pickPath(p, i, arr);
|
|
15589
|
+
},
|
|
15590
|
+
onCatalog: function() {
|
|
15591
|
+
view.openCatalog();
|
|
15592
|
+
},
|
|
15593
|
+
onFilter: function() {
|
|
15594
|
+
view.openFilter();
|
|
15595
|
+
},
|
|
15596
|
+
filterCount: activeCount(m.filterValue, m.filterTagIds, m.difficultyMissing)
|
|
15597
|
+
}),
|
|
15598
|
+
m.selectionMode ? null : h(
|
|
15599
|
+
"div",
|
|
15600
|
+
{ className: "wbtc-chips" },
|
|
15601
|
+
h(bars.StatusChips, {
|
|
15602
|
+
t,
|
|
15603
|
+
lang: m.lang,
|
|
15604
|
+
value: m.filterValue,
|
|
15605
|
+
onChange: function(next) {
|
|
15606
|
+
m.setFilterValue(next);
|
|
15607
|
+
m.setPageNumber(1);
|
|
15608
|
+
}
|
|
15609
|
+
})
|
|
15610
|
+
),
|
|
15611
|
+
m.selectionMode || dense ? null : h(bars.PresetChips, {
|
|
15612
|
+
t,
|
|
15613
|
+
lang: m.lang,
|
|
15614
|
+
value: m.filterValue,
|
|
15615
|
+
onChange: function(next) {
|
|
15616
|
+
m.setFilterValue(next);
|
|
15617
|
+
m.setPageNumber(1);
|
|
15618
|
+
}
|
|
15619
|
+
}),
|
|
15620
|
+
list,
|
|
15621
|
+
h(BottomBar, { m, onNew: props.onNew })
|
|
15622
|
+
);
|
|
15623
|
+
}
|
|
15624
|
+
return { ListScreen, BottomBar, activeCount, PER_PAGE };
|
|
15625
|
+
};
|
|
15626
|
+
}
|
|
15627
|
+
});
|
|
15628
|
+
|
|
15629
|
+
// packages/addons/tasks/client/views/compact/detail-screen.cjs
|
|
15630
|
+
var require_detail_screen = __commonJS({
|
|
15631
|
+
"packages/addons/tasks/client/views/compact/detail-screen.cjs"(exports2, module2) {
|
|
15632
|
+
"use strict";
|
|
15633
|
+
var SB = require_sticky_bar();
|
|
15634
|
+
module2.exports = function createDetailScreen(deps) {
|
|
15635
|
+
var React = deps.React, h = React.createElement;
|
|
15636
|
+
var Icon2 = deps.Icon;
|
|
15637
|
+
var TaskItem = deps.TaskItem;
|
|
15638
|
+
function openLike(task) {
|
|
15639
|
+
var s = String(task && task.status);
|
|
15640
|
+
return s === "0" || s === "4";
|
|
15641
|
+
}
|
|
15642
|
+
function DetailScreen(props) {
|
|
15643
|
+
var m = props.m, t = m.t, task = props.task, bars = props.bars, view = props.view;
|
|
15644
|
+
var primary = openLike(task) ? h("button", {
|
|
15645
|
+
type: "button",
|
|
15646
|
+
className: "wbtc-primary",
|
|
15647
|
+
onClick: function() {
|
|
15648
|
+
props.onDone(task);
|
|
15649
|
+
}
|
|
15650
|
+
}, h(Icon2, { name: "check", size: 17 }), t.complete) : h("button", {
|
|
15651
|
+
type: "button",
|
|
15652
|
+
className: "wbtc-primary",
|
|
15653
|
+
onClick: function() {
|
|
15654
|
+
props.onRestart(task);
|
|
15655
|
+
}
|
|
15656
|
+
}, h(Icon2, { name: "restart", size: 17 }), t.restart);
|
|
15657
|
+
return h(
|
|
15658
|
+
"div",
|
|
15659
|
+
{ className: "wbtc-screen" },
|
|
15660
|
+
h(
|
|
15661
|
+
"div",
|
|
15662
|
+
{ className: "wbtc-top", role: "toolbar" },
|
|
15663
|
+
h(bars.IconButton, { name: "left", label: t.back, onClick: props.onBack }),
|
|
15664
|
+
h(
|
|
15665
|
+
"div",
|
|
15666
|
+
{ className: "wbtc-headtext" },
|
|
15667
|
+
h("div", { className: "wbtc-headtitle" }, t.detail),
|
|
15668
|
+
task.path && task.path.length ? h("div", { className: "wbtc-headsub" }, task.path[task.path.length - 1].name || "") : null
|
|
15669
|
+
),
|
|
15670
|
+
h(bars.IconButton, { name: "more", label: t.more, onClick: function() {
|
|
15671
|
+
view.openActions(task);
|
|
15672
|
+
} })
|
|
15673
|
+
),
|
|
13909
15674
|
h(
|
|
13910
|
-
|
|
13911
|
-
{
|
|
13912
|
-
h(
|
|
15675
|
+
"div",
|
|
15676
|
+
{ className: "wbtc-detail" },
|
|
15677
|
+
h(TaskItem, {
|
|
15678
|
+
task,
|
|
15679
|
+
t,
|
|
15680
|
+
lang: m.lang,
|
|
15681
|
+
bodyMode: m.cfg["ui.bodyMode"],
|
|
15682
|
+
update: m.update,
|
|
15683
|
+
onEdit: function(x) {
|
|
15684
|
+
props.onEdit(x);
|
|
15685
|
+
},
|
|
15686
|
+
onDone: function(x) {
|
|
15687
|
+
props.onDone(x);
|
|
15688
|
+
},
|
|
15689
|
+
onRestart: function(x) {
|
|
15690
|
+
props.onRestart(x);
|
|
15691
|
+
},
|
|
15692
|
+
onTimeline: function(x) {
|
|
15693
|
+
view.openTimeline(x);
|
|
15694
|
+
},
|
|
15695
|
+
onDelete: null,
|
|
15696
|
+
onPathPick: function(p, i, arr) {
|
|
15697
|
+
m.pickPath(p, i, arr);
|
|
15698
|
+
},
|
|
15699
|
+
onTagPick: function(id) {
|
|
15700
|
+
m.toggleTagId(id);
|
|
15701
|
+
}
|
|
15702
|
+
})
|
|
13913
15703
|
),
|
|
15704
|
+
h(
|
|
15705
|
+
SB.StickyBar,
|
|
15706
|
+
{ h, flow: "inline", label: t.detail },
|
|
15707
|
+
primary,
|
|
15708
|
+
h("button", {
|
|
15709
|
+
type: "button",
|
|
15710
|
+
className: "wbtc-btn",
|
|
15711
|
+
onClick: function() {
|
|
15712
|
+
props.onEdit(task);
|
|
15713
|
+
}
|
|
15714
|
+
}, h(Icon2, { name: "pencil", size: 15 }), t.edit),
|
|
15715
|
+
openLike(task) ? h("button", {
|
|
15716
|
+
type: "button",
|
|
15717
|
+
className: "wbtc-btn",
|
|
15718
|
+
"aria-label": t.more,
|
|
15719
|
+
onClick: function() {
|
|
15720
|
+
view.openActions(task);
|
|
15721
|
+
}
|
|
15722
|
+
}, h(Icon2, { name: "more", size: 15 })) : null
|
|
15723
|
+
)
|
|
15724
|
+
);
|
|
15725
|
+
}
|
|
15726
|
+
return { DetailScreen, openLike };
|
|
15727
|
+
};
|
|
15728
|
+
}
|
|
15729
|
+
});
|
|
15730
|
+
|
|
15731
|
+
// packages/addons/tasks/client/views/layouts/tasks-compact-view.cjs
|
|
15732
|
+
var require_tasks_compact_view = __commonJS({
|
|
15733
|
+
"packages/addons/tasks/client/views/layouts/tasks-compact-view.cjs"(exports2, module2) {
|
|
15734
|
+
"use strict";
|
|
15735
|
+
module2.exports = function createCompactView(deps) {
|
|
15736
|
+
var React = deps.React;
|
|
15737
|
+
var h = React.createElement;
|
|
15738
|
+
var PS = require_panel_host();
|
|
15739
|
+
var bars = require_bars()(deps);
|
|
15740
|
+
var panels = require_panels()(deps);
|
|
15741
|
+
var listScreen = require_list_screen()(deps);
|
|
15742
|
+
var detailScreen = require_detail_screen()(deps);
|
|
15743
|
+
var renderOverlays = require_tasks_overlays()(deps);
|
|
15744
|
+
function CompactView(props) {
|
|
15745
|
+
var m = props.model;
|
|
15746
|
+
var actions = {
|
|
15747
|
+
newTask: function() {
|
|
15748
|
+
m.setCreateState({ source: "0", originTask: null, defaultTableId: m.target ? m.target.tableId : "" });
|
|
15749
|
+
},
|
|
15750
|
+
edit: function(task2) {
|
|
15751
|
+
m.setEditTask(task2);
|
|
15752
|
+
},
|
|
15753
|
+
done: function(task2) {
|
|
15754
|
+
m.setDoneTask(task2);
|
|
15755
|
+
},
|
|
15756
|
+
restart: function(task2) {
|
|
15757
|
+
m.setCreateState({ source: "2", originTask: task2 });
|
|
15758
|
+
},
|
|
15759
|
+
timeline: function(task2) {
|
|
15760
|
+
m.setTimelineTask(task2);
|
|
15761
|
+
}
|
|
15762
|
+
};
|
|
15763
|
+
var store = React.useMemo(function() {
|
|
15764
|
+
return PS.createStore();
|
|
15765
|
+
}, []);
|
|
15766
|
+
var modelRef = React.useRef(m);
|
|
15767
|
+
modelRef.current = m;
|
|
15768
|
+
function panelModel() {
|
|
15769
|
+
return modelRef.current;
|
|
15770
|
+
}
|
|
15771
|
+
var searchS = React.useState(false), searchOpen = searchS[0], setSearchOpen = searchS[1];
|
|
15772
|
+
var screensS = React.useState([]), screens = screensS[0], setScreens = screensS[1];
|
|
15773
|
+
var scrollPos = React.useRef(0);
|
|
15774
|
+
var needRestore = React.useRef(false);
|
|
15775
|
+
var focusS = React.useState(""), focusId = focusS[0], setFocusId = focusS[1];
|
|
15776
|
+
function topScreen() {
|
|
15777
|
+
return screens.length ? screens[screens.length - 1] : null;
|
|
15778
|
+
}
|
|
15779
|
+
function goBack() {
|
|
15780
|
+
if (store.depth()) {
|
|
15781
|
+
store.pop();
|
|
15782
|
+
return;
|
|
15783
|
+
}
|
|
15784
|
+
if (screens.length) {
|
|
15785
|
+
var leaving = topScreen();
|
|
15786
|
+
setFocusId(leaving && leaving.id ? leaving.id : "");
|
|
15787
|
+
needRestore.current = true;
|
|
15788
|
+
setScreens(screens.slice(0, -1));
|
|
15789
|
+
return;
|
|
15790
|
+
}
|
|
15791
|
+
var path = m.currentPath || [];
|
|
15792
|
+
if (path.length > 1) {
|
|
15793
|
+
m.pickPath(path[path.length - 2], path.length - 2, path);
|
|
15794
|
+
return;
|
|
15795
|
+
}
|
|
15796
|
+
if (props.onExit) props.onExit();
|
|
15797
|
+
}
|
|
15798
|
+
function openDetail(task2, top) {
|
|
15799
|
+
if (typeof top === "number") scrollPos.current = top;
|
|
15800
|
+
setFocusId("");
|
|
15801
|
+
setScreens(screens.concat([{ kind: "detail", id: String(task2.id) }]));
|
|
15802
|
+
}
|
|
15803
|
+
function currentTask() {
|
|
15804
|
+
var screen = topScreen();
|
|
15805
|
+
if (!screen || screen.kind !== "detail") return null;
|
|
15806
|
+
var records = m.data && m.data.records || [];
|
|
15807
|
+
for (var i = 0; i < records.length; i += 1) {
|
|
15808
|
+
if (String(records[i].id) === screen.id) return records[i];
|
|
15809
|
+
}
|
|
15810
|
+
return null;
|
|
15811
|
+
}
|
|
15812
|
+
function openPanel(spec) {
|
|
15813
|
+
if (store.find(spec.id)) return;
|
|
15814
|
+
store.push(spec);
|
|
15815
|
+
}
|
|
15816
|
+
var view = {
|
|
15817
|
+
searchOpen,
|
|
15818
|
+
setSearchOpen,
|
|
15819
|
+
scrollPos,
|
|
15820
|
+
needRestore,
|
|
15821
|
+
focusId,
|
|
15822
|
+
openCatalog: function() {
|
|
15823
|
+
openPanel({
|
|
15824
|
+
id: "catalog",
|
|
15825
|
+
// 目录是「选完就走」的导航,不是来回翻的上下文:打开即占满整个视图(整屏面板),
|
|
15826
|
+
// 选叶子直接回到列表。底 sheet 只露一半时手机上既看不清层级、又挡住列表。
|
|
15827
|
+
kind: "full",
|
|
15828
|
+
title: m.t.catalog,
|
|
15829
|
+
render: function(arg) {
|
|
15830
|
+
return h(panels.CatalogBody, { m: panelModel(), close: arg.close });
|
|
15831
|
+
}
|
|
15832
|
+
});
|
|
15833
|
+
m.refreshTree();
|
|
15834
|
+
},
|
|
15835
|
+
openFilter: function() {
|
|
15836
|
+
if (!m.panelOpen) m.setPanelOpen(true);
|
|
15837
|
+
openPanel({
|
|
15838
|
+
id: "filter",
|
|
15839
|
+
kind: "full",
|
|
15840
|
+
title: m.t.filter,
|
|
15841
|
+
render: function() {
|
|
15842
|
+
return h(panels.FilterBody, { m: panelModel() });
|
|
15843
|
+
},
|
|
15844
|
+
footer: function(arg) {
|
|
15845
|
+
return h(panels.FilterFooter, { m: panelModel(), close: arg.close });
|
|
15846
|
+
}
|
|
15847
|
+
});
|
|
15848
|
+
},
|
|
15849
|
+
openMore: function() {
|
|
15850
|
+
openPanel({
|
|
15851
|
+
id: "more",
|
|
15852
|
+
kind: "bottom",
|
|
15853
|
+
title: m.t.more,
|
|
15854
|
+
render: function(arg) {
|
|
15855
|
+
return h(panels.MoreBody, { m: panelModel(), close: arg.close, onNew: actions.newTask });
|
|
15856
|
+
}
|
|
15857
|
+
});
|
|
15858
|
+
},
|
|
15859
|
+
openActions: function(task2) {
|
|
15860
|
+
if (!task2) return;
|
|
15861
|
+
openPanel({
|
|
15862
|
+
id: "actions-" + String(task2.id),
|
|
15863
|
+
kind: "bottom",
|
|
15864
|
+
title: task2.title,
|
|
15865
|
+
render: function(arg) {
|
|
15866
|
+
return h(panels.ActionsBody, {
|
|
15867
|
+
m: panelModel(),
|
|
15868
|
+
task: task2,
|
|
15869
|
+
close: arg.close,
|
|
15870
|
+
onEdit: actions.edit,
|
|
15871
|
+
onDone: actions.done,
|
|
15872
|
+
onRestart: actions.restart,
|
|
15873
|
+
onTimeline: actions.timeline
|
|
15874
|
+
});
|
|
15875
|
+
}
|
|
15876
|
+
});
|
|
15877
|
+
},
|
|
15878
|
+
openTimeline: function(task2) {
|
|
15879
|
+
actions.timeline(task2);
|
|
15880
|
+
if (store.depth()) store.closeAll();
|
|
15881
|
+
setScreens([]);
|
|
15882
|
+
}
|
|
15883
|
+
};
|
|
15884
|
+
var task = currentTask();
|
|
15885
|
+
var base = task ? h(detailScreen.DetailScreen, {
|
|
15886
|
+
m,
|
|
15887
|
+
task,
|
|
15888
|
+
bars,
|
|
15889
|
+
view,
|
|
15890
|
+
onBack: goBack,
|
|
15891
|
+
onEdit: actions.edit,
|
|
15892
|
+
onDone: actions.done,
|
|
15893
|
+
onRestart: actions.restart
|
|
15894
|
+
}) : h(listScreen.ListScreen, {
|
|
15895
|
+
m,
|
|
15896
|
+
bars,
|
|
15897
|
+
view,
|
|
15898
|
+
dense: props.variant === "short",
|
|
15899
|
+
onBack: goBack,
|
|
15900
|
+
onNew: actions.newTask,
|
|
15901
|
+
onDetail: openDetail,
|
|
15902
|
+
onSelect: function(item) {
|
|
15903
|
+
var next = new Set(m.selectedIds);
|
|
15904
|
+
next.add(String(item.id));
|
|
15905
|
+
m.setSelectedIds(next);
|
|
15906
|
+
m.setSelectionMode(true);
|
|
15907
|
+
}
|
|
15908
|
+
});
|
|
15909
|
+
return h(
|
|
15910
|
+
"div",
|
|
15911
|
+
{ className: "wbt-root wbtc" },
|
|
15912
|
+
h(PS.PanelHost, { h, React, store }, base),
|
|
13914
15913
|
renderOverlays(m)
|
|
13915
15914
|
);
|
|
13916
15915
|
}
|
|
@@ -13940,6 +15939,7 @@ var require_tasks_view = __commonJS({
|
|
|
13940
15939
|
function TasksViewBody(props) {
|
|
13941
15940
|
var lang = props.lang === "en" ? "en" : "zh";
|
|
13942
15941
|
var t = COPY[lang];
|
|
15942
|
+
var compact = !!COMPACT_VARIANTS[String(props.variant || "")];
|
|
13943
15943
|
var model = useTasksState({
|
|
13944
15944
|
React,
|
|
13945
15945
|
api: props.api,
|
|
@@ -13953,9 +15953,9 @@ var require_tasks_view = __commonJS({
|
|
|
13953
15953
|
Icon: deps.Icon,
|
|
13954
15954
|
TreeNode: deps.TreeNode,
|
|
13955
15955
|
TagFilter: deps.TagFilter,
|
|
13956
|
-
injectCss: deps.injectCss
|
|
15956
|
+
injectCss: deps.injectCss,
|
|
15957
|
+
compact
|
|
13957
15958
|
});
|
|
13958
|
-
var compact = !!COMPACT_VARIANTS[String(props.variant || "")];
|
|
13959
15959
|
return compact ? h(TasksCompactView, { model, h, variant: props.variant }) : TasksWideLayout({ model, h });
|
|
13960
15960
|
}
|
|
13961
15961
|
return TasksView;
|
|
@@ -14115,6 +16115,7 @@ var require_timeline_view = __commonJS({
|
|
|
14115
16115
|
module2.exports = function(deps) {
|
|
14116
16116
|
var React = deps.React, h = React.createElement, COPY = deps.COPY;
|
|
14117
16117
|
var controls = require_timeline_controls()(React), AddMembers = require_timeline_add_members()(React);
|
|
16118
|
+
var DV = require_display_variants();
|
|
14118
16119
|
var Merge = require_timeline_merge()(React);
|
|
14119
16120
|
var MemberRows = require_timeline_member_rows()(React, deps.statusInfo);
|
|
14120
16121
|
var TaskPreview = require_task_preview()(React, deps.TaskItem);
|
|
@@ -14144,6 +16145,7 @@ var require_timeline_view = __commonJS({
|
|
|
14144
16145
|
}
|
|
14145
16146
|
function TimelineView(props) {
|
|
14146
16147
|
var lang = props.lang === "en" ? "en" : "zh", t = COPY[lang], api = props.api;
|
|
16148
|
+
var compact = DV.isCompact(props.display);
|
|
14147
16149
|
var tr = require_timeline_copy()(t);
|
|
14148
16150
|
var queryS = React.useState(""), query = queryS[0], setQuery = queryS[1];
|
|
14149
16151
|
var draftS = React.useState(""), draft = draftS[0], setDraft = draftS[1];
|
|
@@ -14341,7 +16343,7 @@ var require_timeline_view = __commonJS({
|
|
|
14341
16343
|
}
|
|
14342
16344
|
return h(
|
|
14343
16345
|
"div",
|
|
14344
|
-
{ className: "wbt-root wbt-timeline-view" },
|
|
16346
|
+
{ className: "wbt-root wbt-timeline-view" + (compact ? " wbt-compact" : ""), "data-wb-layout": compact ? "compact" : "wide" },
|
|
14345
16347
|
h(
|
|
14346
16348
|
"div",
|
|
14347
16349
|
{ className: "wbt-timeline-toolbar" },
|
|
@@ -15095,13 +17097,20 @@ var require_timeline_view = __commonJS({
|
|
|
15095
17097
|
var TimelineView = require_timeline_view()({ React, COPY, injectCss, statusInfo, configClient, CFG_FALLBACK, TaskItem, EditModal, DoneModal, TimelineModal, CreateModal });
|
|
15096
17098
|
host.registerAddon({
|
|
15097
17099
|
id: "wb-addon-tasks",
|
|
15098
|
-
version: "5.
|
|
17100
|
+
version: "5.16.0",
|
|
15099
17101
|
icon: ICONS["list-checks"],
|
|
15100
17102
|
// 贡献声明写在 registerAddon 里:卸载任务插件时宿主按 addonId 一起撤销,
|
|
15101
17103
|
// 不会在邮件里留一个渲染即报错的孤儿按钮。
|
|
15102
17104
|
slots: [{ slot: "item.actions", id: "tasks.create-from-mail", order: 100, component: slotTaskFromMessage }],
|
|
15103
17105
|
views: [
|
|
15104
|
-
{
|
|
17106
|
+
{
|
|
17107
|
+
id: "stats",
|
|
17108
|
+
icon: tabIcon("chart"),
|
|
17109
|
+
title: { zh: "\u7EDF\u8BA1", en: "Stats" },
|
|
17110
|
+
component: statsView.TasksStatsView,
|
|
17111
|
+
keepAlive: true,
|
|
17112
|
+
display: [{ id: "compact", when: { maxWidth: 759 }, component: statsView.TasksStatsView }]
|
|
17113
|
+
},
|
|
15105
17114
|
{
|
|
15106
17115
|
id: "tasks",
|
|
15107
17116
|
icon: tabIcon("list"),
|
|
@@ -15118,8 +17127,22 @@ var require_timeline_view = __commonJS({
|
|
|
15118
17127
|
{ id: "compact", when: { maxWidth: 759 }, component: TasksView }
|
|
15119
17128
|
]
|
|
15120
17129
|
},
|
|
15121
|
-
|
|
15122
|
-
|
|
17130
|
+
// 统计/时间线/工作区:组件内部早就按 DV.isCompact 准备了窄档分支,但此前一条变体都没声明,
|
|
17131
|
+
// 宿主 resolveVariant 永远返回空,那几个分支是死代码。规格 §6 要求先只声明 compact。
|
|
17132
|
+
{
|
|
17133
|
+
id: "timeline",
|
|
17134
|
+
icon: tabIcon("timeline"),
|
|
17135
|
+
title: { zh: "\u65F6\u95F4\u7EBF", en: "Timeline" },
|
|
17136
|
+
component: TimelineView,
|
|
17137
|
+
display: [{ id: "compact", when: { maxWidth: 759 }, component: TimelineView }]
|
|
17138
|
+
},
|
|
17139
|
+
{
|
|
17140
|
+
id: "workspace",
|
|
17141
|
+
icon: tabIcon("folder"),
|
|
17142
|
+
title: { zh: "\u5DE5\u4F5C\u533A", en: "Workspaces" },
|
|
17143
|
+
component: workspaceView.WorkspaceView,
|
|
17144
|
+
display: [{ id: "compact", when: { maxWidth: 759 }, component: workspaceView.WorkspaceView }]
|
|
17145
|
+
}
|
|
15123
17146
|
]
|
|
15124
17147
|
});
|
|
15125
17148
|
module.exports = { name: "dsh-workbench-tasks", inject: [], apply: function() {
|