dsh-workbench-tasks 5.14.4 → 5.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -1
- package/lib/client.js +735 -41
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
# 任务插件 CHANGELOG
|
|
2
2
|
|
|
3
|
-
> 包名:`dsh-workbench-tasks`;当前版本:5.
|
|
3
|
+
> 包名:`dsh-workbench-tasks`;当前版本:5.15.1 `package.json` 为准)。
|
|
4
4
|
> 源码入口 `lib/index.js` 只保留用途与当前版本,版本历史统一记录在这里;此后发版只追加本文件,不再往源码写版本史。
|
|
5
5
|
|
|
6
|
+
## 5.15.1 — 2026-12-06
|
|
7
|
+
|
|
8
|
+
- 任务列表、统计、时间线三处窄档样式改由宿主宽度阶梯属性驱动:把 `@media(max-width:Npx)` 换成宿主编译出的 `[data-wb-ltN]`,
|
|
9
|
+
阈值只在宿主 `packages/shell/client/display.cjs` 的宽度阶梯里出现一次,插件不再自己判断视口。
|
|
10
|
+
|
|
11
|
+
## 5.15.0 — 2026-12-06
|
|
12
|
+
|
|
13
|
+
- 窄档的一次性表单(新建 / 编辑 / 完成 / 关闭 / 节点 / 批量)铺成整屏 sheet,共享浮层外壳新增
|
|
14
|
+
`sheet` 开关与 `sheetStyles`;宽档仍是居中对话框,像素不变。
|
|
15
|
+
- 统计、时间线、工作区三个次级视图补窄档形态:12 列栅格收单列、KPI 两块一行、两列改上下、
|
|
16
|
+
工作区卡片竖排且操作整行;原先靠 `@media(max-width:900px/720px)` 切布局的规则改由
|
|
17
|
+
窄档声明承担,媒体查询只留字号与高度这类像素细节。
|
|
18
|
+
- 状态模型新增 `compact` 字段(宽窄共用一份弹窗接线),弹窗据此决定形态。
|
|
19
|
+
|
|
6
20
|
## 5.14.4 — 2026-12-06
|
|
7
21
|
|
|
8
22
|
- 窄屏列表换成摘要卡片(`item/task-card-compact.cjs`):标题最多两行、状态与优先级一行、
|
package/lib/client.js
CHANGED
|
@@ -837,6 +837,233 @@ var require_workspacefilter = __commonJS({
|
|
|
837
837
|
}
|
|
838
838
|
});
|
|
839
839
|
|
|
840
|
+
// packages/addons/lib/display-variants.cjs
|
|
841
|
+
var require_display_variants = __commonJS({
|
|
842
|
+
"packages/addons/lib/display-variants.cjs"(exports2, module2) {
|
|
843
|
+
"use strict";
|
|
844
|
+
var LEAF_KEYS = [
|
|
845
|
+
"minWidth",
|
|
846
|
+
"maxWidth",
|
|
847
|
+
"minHeight",
|
|
848
|
+
"maxHeight",
|
|
849
|
+
"minAspect",
|
|
850
|
+
"maxAspect",
|
|
851
|
+
"orientation",
|
|
852
|
+
"pointer",
|
|
853
|
+
"hover",
|
|
854
|
+
"platform"
|
|
855
|
+
];
|
|
856
|
+
var NUMERIC_KEYS = { minWidth: 1, maxWidth: 1, minHeight: 1, maxHeight: 1, minAspect: 1, maxAspect: 1 };
|
|
857
|
+
var warned = /* @__PURE__ */ Object.create(null);
|
|
858
|
+
function warnOnce(label, message) {
|
|
859
|
+
if (warned[label]) return;
|
|
860
|
+
warned[label] = true;
|
|
861
|
+
try {
|
|
862
|
+
if (typeof console !== "undefined" && console && typeof console.warn === "function") console.warn("[display] " + message);
|
|
863
|
+
} catch (e) {
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
function isPlainObject(value) {
|
|
867
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
868
|
+
}
|
|
869
|
+
function matchLeaf(key, expected, display) {
|
|
870
|
+
if (NUMERIC_KEYS[key]) {
|
|
871
|
+
if (typeof expected !== "number" || !isFinite(expected)) {
|
|
872
|
+
warnOnce("num:" + key, key + " \u5FC5\u987B\u662F\u6709\u9650\u6570\u5B57\uFF0C\u5DF2\u5FFD\u7565\u8BE5\u53D8\u4F53");
|
|
873
|
+
return null;
|
|
874
|
+
}
|
|
875
|
+
var actual;
|
|
876
|
+
if (key === "minAspect" || key === "maxAspect") actual = display.aspect;
|
|
877
|
+
else if (key === "minHeight" || key === "maxHeight") actual = display.height;
|
|
878
|
+
else actual = display.width;
|
|
879
|
+
if (typeof actual !== "number" || !isFinite(actual)) return null;
|
|
880
|
+
if (key.indexOf("min") === 0) return actual >= expected;
|
|
881
|
+
return actual <= expected;
|
|
882
|
+
}
|
|
883
|
+
if (key === "hover") {
|
|
884
|
+
if (typeof expected !== "boolean") {
|
|
885
|
+
warnOnce("hover", "hover \u53EA\u80FD\u662F\u5E03\u5C14\u503C\uFF0C\u5DF2\u5FFD\u7565\u8BE5\u53D8\u4F53");
|
|
886
|
+
return null;
|
|
887
|
+
}
|
|
888
|
+
return display.hover === expected;
|
|
889
|
+
}
|
|
890
|
+
if (key === "platform") {
|
|
891
|
+
if (Array.isArray(expected)) return expected.indexOf(display.platform) >= 0;
|
|
892
|
+
if (typeof expected === "string") return display.platform === expected;
|
|
893
|
+
warnOnce("platform", "platform \u53EA\u80FD\u662F\u5B57\u7B26\u4E32\u6216\u5B57\u7B26\u4E32\u6570\u7EC4\uFF0C\u5DF2\u5FFD\u7565\u8BE5\u53D8\u4F53");
|
|
894
|
+
return null;
|
|
895
|
+
}
|
|
896
|
+
if (typeof expected === "string") return display[key] === expected;
|
|
897
|
+
warnOnce(key, key + " \u53EA\u80FD\u662F\u5B57\u7B26\u4E32\uFF0C\u5DF2\u5FFD\u7565\u8BE5\u53D8\u4F53");
|
|
898
|
+
return null;
|
|
899
|
+
}
|
|
900
|
+
function specificityOnPath(when, display) {
|
|
901
|
+
if (when === void 0 || when === null) return 0;
|
|
902
|
+
if (!isPlainObject(when)) {
|
|
903
|
+
warnOnce("shape", "when \u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
904
|
+
return null;
|
|
905
|
+
}
|
|
906
|
+
var keys = Object.keys(when);
|
|
907
|
+
var total = 0;
|
|
908
|
+
for (var i = 0; i < keys.length; i++) {
|
|
909
|
+
var key = keys[i];
|
|
910
|
+
if (key === "all" || key === "any") continue;
|
|
911
|
+
if (LEAF_KEYS.indexOf(key) < 0) {
|
|
912
|
+
warnOnce("key:" + key, "\u672A\u77E5\u8C13\u8BCD\u952E " + key + "\uFF0C\u5DF2\u5FFD\u7565\u8BE5\u53D8\u4F53");
|
|
913
|
+
return null;
|
|
914
|
+
}
|
|
915
|
+
var hit = matchLeaf(key, when[key], display || {});
|
|
916
|
+
if (hit === null) return null;
|
|
917
|
+
if (!hit) return null;
|
|
918
|
+
total += 1;
|
|
919
|
+
}
|
|
920
|
+
if ("all" in when) {
|
|
921
|
+
if (!Array.isArray(when.all)) {
|
|
922
|
+
warnOnce("all", "all \u5FC5\u987B\u662F\u6570\u7EC4");
|
|
923
|
+
return null;
|
|
924
|
+
}
|
|
925
|
+
for (var a = 0; a < when.all.length; a++) {
|
|
926
|
+
var sub = specificityOnPath(when.all[a], display);
|
|
927
|
+
if (sub === null) return null;
|
|
928
|
+
total += sub;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
if ("any" in when) {
|
|
932
|
+
if (!Array.isArray(when.any)) {
|
|
933
|
+
warnOnce("any", "any \u5FC5\u987B\u662F\u6570\u7EC4");
|
|
934
|
+
return null;
|
|
935
|
+
}
|
|
936
|
+
var best = -1;
|
|
937
|
+
for (var b = 0; b < when.any.length; b++) {
|
|
938
|
+
var branch = specificityOnPath(when.any[b], display);
|
|
939
|
+
if (branch !== null && branch > best) best = branch;
|
|
940
|
+
}
|
|
941
|
+
if (best < 0) return null;
|
|
942
|
+
total += best;
|
|
943
|
+
}
|
|
944
|
+
return total;
|
|
945
|
+
}
|
|
946
|
+
function matchWhen(when, display) {
|
|
947
|
+
return specificityOnPath(when, display) !== null;
|
|
948
|
+
}
|
|
949
|
+
function specificityOf(when, display) {
|
|
950
|
+
var score = specificityOnPath(when, display);
|
|
951
|
+
return score === null ? -1 : score;
|
|
952
|
+
}
|
|
953
|
+
function resolveVariant(view, display) {
|
|
954
|
+
var source = view || {};
|
|
955
|
+
var component = source.component;
|
|
956
|
+
var variants = Array.isArray(source.display) ? source.display : null;
|
|
957
|
+
if (!variants || !variants.length) {
|
|
958
|
+
return { id: "default", component, variant: null, specificity: 0, index: -1, unsupported: false, reason: "no-variants" };
|
|
959
|
+
}
|
|
960
|
+
if (!display) {
|
|
961
|
+
return { id: "default", component, variant: null, specificity: 0, index: -1, unsupported: false, reason: "no-display" };
|
|
962
|
+
}
|
|
963
|
+
var best = null;
|
|
964
|
+
for (var i = 0; i < variants.length; i++) {
|
|
965
|
+
var variant = variants[i];
|
|
966
|
+
if (!isPlainObject(variant)) {
|
|
967
|
+
warnOnce("variant:" + i, "\u53D8\u4F53\u5FC5\u987B\u662F\u5BF9\u8C61\uFF0C\u5DF2\u8DF3\u8FC7\u7B2C " + i + " \u6761");
|
|
968
|
+
continue;
|
|
969
|
+
}
|
|
970
|
+
if (!variant.id) {
|
|
971
|
+
warnOnce("variant-id:" + i, "\u53D8\u4F53\u7F3A\u5C11 id\uFF0C\u5DF2\u8DF3\u8FC7\u7B2C " + i + " \u6761");
|
|
972
|
+
continue;
|
|
973
|
+
}
|
|
974
|
+
if (typeof variant.component !== "function") {
|
|
975
|
+
warnOnce("variant-comp:" + i, "\u53D8\u4F53 " + variant.id + " \u6CA1\u6709 component\uFF0C\u5DF2\u8DF3\u8FC7");
|
|
976
|
+
continue;
|
|
977
|
+
}
|
|
978
|
+
var score = specificityOnPath(variant.when, display);
|
|
979
|
+
if (score === null) continue;
|
|
980
|
+
if (!best || score >= best.specificity) best = { variant, specificity: score, index: i };
|
|
981
|
+
}
|
|
982
|
+
if (!best) {
|
|
983
|
+
return { id: "default", component, variant: null, specificity: 0, index: -1, unsupported: false, reason: "no-match" };
|
|
984
|
+
}
|
|
985
|
+
return {
|
|
986
|
+
id: best.variant.id,
|
|
987
|
+
component: best.variant.component,
|
|
988
|
+
variant: best.variant,
|
|
989
|
+
specificity: best.specificity,
|
|
990
|
+
index: best.index,
|
|
991
|
+
unsupported: Boolean(best.variant.unsupported),
|
|
992
|
+
reason: "matched"
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
function whenText(when) {
|
|
996
|
+
if (when === void 0 || when === null) return "\u515C\u5E95\uFF08\u65E0\u6761\u4EF6\uFF09";
|
|
997
|
+
if (!isPlainObject(when)) return "\u975E\u6CD5\u8C13\u8BCD";
|
|
998
|
+
var parts = [];
|
|
999
|
+
var label = {
|
|
1000
|
+
minWidth: "\u5BBD\u5EA6 \u2265",
|
|
1001
|
+
maxWidth: "\u5BBD\u5EA6 \u2264",
|
|
1002
|
+
minHeight: "\u9AD8\u5EA6 \u2265",
|
|
1003
|
+
maxHeight: "\u9AD8\u5EA6 \u2264",
|
|
1004
|
+
minAspect: "\u5BBD\u9AD8\u6BD4 \u2265",
|
|
1005
|
+
maxAspect: "\u5BBD\u9AD8\u6BD4 \u2264",
|
|
1006
|
+
orientation: "\u65B9\u5411 =",
|
|
1007
|
+
pointer: "\u6307\u9488 =",
|
|
1008
|
+
hover: "\u53EF\u60AC\u505C =",
|
|
1009
|
+
platform: "\u5E73\u53F0 ="
|
|
1010
|
+
};
|
|
1011
|
+
Object.keys(when).forEach(function(key) {
|
|
1012
|
+
if (key === "all" || key === "any") return;
|
|
1013
|
+
var value = when[key];
|
|
1014
|
+
if (Array.isArray(value)) parts.push(label[key] + " " + value.join("/"));
|
|
1015
|
+
else parts.push((label[key] || key) + " " + String(value));
|
|
1016
|
+
});
|
|
1017
|
+
if (Array.isArray(when.all) && when.all.length) parts.push("\u5168\u90E8\u6EE1\u8DB3\uFF08" + when.all.map(whenText).join("\uFF1B") + "\uFF09");
|
|
1018
|
+
if (Array.isArray(when.any) && when.any.length) parts.push("\u4EFB\u4E00\u6EE1\u8DB3\uFF08" + when.any.map(whenText).join("\uFF1B") + "\uFF09");
|
|
1019
|
+
return parts.length ? parts.join(" \u4E14 ") : "\u515C\u5E95\uFF08\u65E0\u6761\u4EF6\uFF09";
|
|
1020
|
+
}
|
|
1021
|
+
function displayCacheKey(display) {
|
|
1022
|
+
if (!display) return "";
|
|
1023
|
+
var w = Math.round(Number(display.width) || 0);
|
|
1024
|
+
var h = Math.round(Number(display.height) || 0);
|
|
1025
|
+
return w + "x" + h + "|" + (display.pointer || "-") + "|" + (display.hover === true ? "hover" : "nohover") + "|" + (display.platform || "-");
|
|
1026
|
+
}
|
|
1027
|
+
function hasVariants(view) {
|
|
1028
|
+
return Boolean(view && Array.isArray(view.display) && view.display.some(function(v) {
|
|
1029
|
+
return v && typeof v.component === "function";
|
|
1030
|
+
}));
|
|
1031
|
+
}
|
|
1032
|
+
function describeFromBox(box, env) {
|
|
1033
|
+
var width = Math.max(0, Math.round(Number(box && box.width || 0)));
|
|
1034
|
+
var height = Math.max(0, Math.round(Number(box && box.height || 0)));
|
|
1035
|
+
var e = env || {};
|
|
1036
|
+
var aspect = height > 0 ? Math.round(width / height * 100) / 100 : 0;
|
|
1037
|
+
var orientation = width > height ? "landscape" : width < height ? "portrait" : "square";
|
|
1038
|
+
return {
|
|
1039
|
+
width,
|
|
1040
|
+
height,
|
|
1041
|
+
aspect,
|
|
1042
|
+
orientation,
|
|
1043
|
+
pointer: e.pointer === "coarse" ? "coarse" : e.pointer === "none" ? "none" : "fine",
|
|
1044
|
+
hover: e.hover === true,
|
|
1045
|
+
platform: typeof e.platform === "string" && e.platform ? e.platform : "web",
|
|
1046
|
+
safe: e.safe && typeof e.safe === "object" ? e.safe : { top: 0, right: 0, bottom: 0, left: 0 }
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
function isCompact(display) {
|
|
1050
|
+
if (!display) return false;
|
|
1051
|
+
return display.pointer === "coarse" || Number(display.width) < 760;
|
|
1052
|
+
}
|
|
1053
|
+
module2.exports = {
|
|
1054
|
+
isCompact,
|
|
1055
|
+
LEAF_KEYS,
|
|
1056
|
+
matchWhen,
|
|
1057
|
+
specificityOf,
|
|
1058
|
+
resolveVariant,
|
|
1059
|
+
whenText,
|
|
1060
|
+
displayCacheKey,
|
|
1061
|
+
hasVariants,
|
|
1062
|
+
describeFromBox
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
});
|
|
1066
|
+
|
|
840
1067
|
// packages/addons/lib/date-picker.cjs
|
|
841
1068
|
var require_date_picker = __commonJS({
|
|
842
1069
|
"packages/addons/lib/date-picker.cjs"(exports2, module2) {
|
|
@@ -1390,8 +1617,8 @@ var require_stats_charts = __commonJS({
|
|
|
1390
1617
|
".@-warn{grid-column:span 12;border:1px dashed var(--dsw-alias-state-warn-primary);border-radius:10px;padding:9px 12px;font-size:12px;color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 6%,transparent)}",
|
|
1391
1618
|
".@-sk{height:14px;border-radius:6px;background:var(--dsw-alias-bg-skeleton);margin:7px 0;animation:@-pulse 1.2s ease-in-out infinite}",
|
|
1392
1619
|
"@keyframes @-pulse{0%,100%{opacity:.55}50%{opacity:1}}",
|
|
1393
|
-
"
|
|
1394
|
-
"
|
|
1620
|
+
":where([data-wb-lt900]) .@-scard{grid-column:span 12}:where([data-wb-lt900]) .@-span-3, :where([data-wb-lt900]) .@-span-4, :where([data-wb-lt900]) .@-span-6, :where([data-wb-lt900]) .@-span-8{grid-column:span 12}:where([data-wb-lt900]) .@-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}",
|
|
1621
|
+
":where([data-wb-lt600]) .@-stats{padding-bottom:16px}:where([data-wb-lt600]) .@-hist{height:130px}:where([data-wb-lt600]) .@-kpi-v{font-size:22px}",
|
|
1395
1622
|
"@media (prefers-reduced-motion:reduce){.@-sk{animation:none}}"
|
|
1396
1623
|
].concat(extra || []).concat([require_date_picker_styles()(prefix)]).join("\n").replace(/@-/g, prefix + "-");
|
|
1397
1624
|
}
|
|
@@ -2061,7 +2288,7 @@ var require_charts = __commonJS({
|
|
|
2061
2288
|
".@-tl-chip{max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px 8px;border-radius:999px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font-size:11.5px}",
|
|
2062
2289
|
".@-tl-mem-more{color:var(--dsw-alias-label-tertiary);font-size:11.5px}",
|
|
2063
2290
|
".@-tl-mem-hint{color:var(--dsw-alias-label-tertiary)}",
|
|
2064
|
-
"
|
|
2291
|
+
":where([data-wb-lt760]) .@-tl-table{min-width:620px}:where([data-wb-lt760]) .@-tl-name{min-width:170px;max-width:240px}:where([data-wb-lt760]) .@-tl-rate-cell{width:104px}:where([data-wb-lt760]) .@-tl-limit-l{display:none}:where([data-wb-lt760]) .@-tl-act{display:none}:where([data-wb-lt760]) .@-tl-th-act{display:none}",
|
|
2065
2292
|
// 「任务节点」全局范围选择器:按钮 + 可搜索树形浮层,颜色全部来自主题 token。
|
|
2066
2293
|
".@-nsp{position:relative;display:inline-flex}",
|
|
2067
2294
|
".@-nsp-trigger{appearance:none;display:inline-flex;align-items:center;gap:6px;max-width:240px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);border-radius:8px;font:inherit;font-size:12px;padding:5px 9px;cursor:pointer}",
|
|
@@ -2086,7 +2313,7 @@ var require_charts = __commonJS({
|
|
|
2086
2313
|
".@-nsp-check{display:inline-flex;align-items:center;color:var(--dsw-alias-brand-primary);flex:none}",
|
|
2087
2314
|
".@-nsp-empty{padding:10px 8px;color:var(--dsw-alias-label-tertiary);font-size:12px;text-align:center}",
|
|
2088
2315
|
".@-nsp-scope{padding:2px 2px 0;color:var(--dsw-alias-label-tertiary);font-size:11.5px;overflow-wrap:anywhere}",
|
|
2089
|
-
"
|
|
2316
|
+
":where([data-wb-lt760]) .@-nsp-trigger{max-width:170px}:where([data-wb-lt760]) .@-nsp-trigger-value{max-width:96px}:where([data-wb-lt760]) .@-nsp-pop{width:min(84vw,300px)}",
|
|
2090
2317
|
// 难度分布的口径切换:轻量 tablist,视觉上与页首时间范围分段保持一致。
|
|
2091
2318
|
".@-dims{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:0 0 8px}",
|
|
2092
2319
|
".@-dims button{appearance:none;border:1px solid transparent;background:transparent;color:inherit;font:inherit;font-size:11.5px;padding:3px 8px;border-radius:6px;cursor:pointer;opacity:.7;white-space:nowrap}",
|
|
@@ -2094,6 +2321,10 @@ var require_charts = __commonJS({
|
|
|
2094
2321
|
".@-dims button[aria-selected=true]{border-color:var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-skeleton);font-weight:600;opacity:1}",
|
|
2095
2322
|
".@-dims button:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}",
|
|
2096
2323
|
".@-sgrid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:12px}",
|
|
2324
|
+
/* 窄档:12 列栅格收成单列,图表与宽表在卡片内横向滚,不再挤压。 */
|
|
2325
|
+
".wbt-compact .@-sgrid{display:flex;flex-direction:column;gap:12px}",
|
|
2326
|
+
".wbt-compact .@-sgrid>*{grid-column:auto;min-width:0}",
|
|
2327
|
+
".wbt-compact .@-card{overflow-x:auto}",
|
|
2097
2328
|
// 分区容器:把 12 栅格切成「一眼看清 → 结构 → 风险 → 排行 → 明细」几段,
|
|
2098
2329
|
// 每段自己一条标题带,卡片之间仍按 span 排;段与段之间用更大的间距制造阅读停顿。
|
|
2099
2330
|
".@-sect{grid-column:span 12;display:flex;flex-direction:column;gap:8px;min-width:0}",
|
|
@@ -2169,7 +2400,7 @@ var require_charts = __commonJS({
|
|
|
2169
2400
|
".@-dot-off{width:8px;height:8px;border-radius:50%;border:1px solid;flex:0 0 auto}",
|
|
2170
2401
|
".@-table-scroll{max-width:100%;overflow-x:auto}.@-table{width:100%;border-collapse:collapse;font-size:12px}",
|
|
2171
2402
|
// 窄屏按列裁剪:统计页的两张排行/明细表在 390px 只保留主列与关键数值列。
|
|
2172
|
-
"
|
|
2403
|
+
":where([data-wb-lt600]) .@-table .wbt-c-total, :where([data-wb-lt600]) .@-table .wbt-c-open, :where([data-wb-lt600]) .@-table .wbt-c-difficulty, :where([data-wb-lt600]) .@-table .wbt-c-tabletitle{display:none}:where([data-wb-lt600]) .@-table th, :where([data-wb-lt600]) .@-table td{padding-left:6px;padding-right:6px}:where([data-wb-lt600]) .@-table .wbt-table-link{white-space:normal;text-align:left}",
|
|
2173
2404
|
".@-table th{text-align:left;font-weight:500;color:var(--dsw-alias-label-tertiary);padding:6px 8px;border-bottom:1px solid var(--dsw-alias-border-l2);white-space:nowrap}",
|
|
2174
2405
|
".@-table td{padding:7px 8px;border-bottom:1px solid var(--dsw-alias-border-l1);color:var(--dsw-alias-label-secondary);vertical-align:top}",
|
|
2175
2406
|
".@-table tr:last-child td{border-bottom:0}",
|
|
@@ -2179,8 +2410,10 @@ var require_charts = __commonJS({
|
|
|
2179
2410
|
".@-warnbar{grid-column:span 12;border:1px dashed var(--dsw-alias-state-warn-primary);border-radius:10px;padding:9px 12px;font-size:12px;color:var(--dsw-alias-state-warn-primary);background:color-mix(in srgb,var(--dsw-alias-state-warn-primary) 6%,transparent)}",
|
|
2180
2411
|
".@-sk{height:14px;border-radius:6px;background:var(--dsw-alias-bg-skeleton);margin:7px 0;animation:@-pulse 1.2s ease-in-out infinite}",
|
|
2181
2412
|
"@keyframes @-pulse{0%,100%{opacity:.55}50%{opacity:1}}",
|
|
2182
|
-
|
|
2183
|
-
"
|
|
2413
|
+
/* 卡片跨列与 KPI 排布由窄档声明承担(.wbt-compact),媒体查询只留字号与高度这类像素细节。 */
|
|
2414
|
+
".wbt-compact .@-scard,.wbt-compact .@-span-3,.wbt-compact .@-span-4,.wbt-compact .@-span-6,.wbt-compact .@-span-8{grid-column:auto}",
|
|
2415
|
+
".wbt-compact .@-kpis,.wbt-compact .@-kpis-main,.wbt-compact .@-kpis-sub{grid-template-columns:repeat(2,minmax(0,1fr))}",
|
|
2416
|
+
":where([data-wb-lt600]) .@-stats{padding-bottom:16px;gap:14px}:where([data-wb-lt600]) .@-hist{height:130px}:where([data-wb-lt600]) .@-kpi-v{font-size:22px}:where([data-wb-lt600]) .@-kpi-lg .@-kpi-v{font-size:24px}:where([data-wb-lt600]) .@-kpi-sm .@-kpi-v{font-size:18px}",
|
|
2184
2417
|
"@media (prefers-reduced-motion:reduce){.@-sk{animation:none}}",
|
|
2185
2418
|
require_date_picker_styles()(prefix)
|
|
2186
2419
|
].join("\n").replace(/@-/g, prefix + "-");
|
|
@@ -2562,7 +2795,7 @@ var require_charts = __commonJS({
|
|
|
2562
2795
|
statusColors: STATUS_COLORS
|
|
2563
2796
|
};
|
|
2564
2797
|
}
|
|
2565
|
-
module2.exports = { makeCharts };
|
|
2798
|
+
module2.exports = { makeCharts, stylesFor: css };
|
|
2566
2799
|
}
|
|
2567
2800
|
});
|
|
2568
2801
|
|
|
@@ -5204,6 +5437,7 @@ var require_node_scope_picker = __commonJS({
|
|
|
5204
5437
|
var require_stats = __commonJS({
|
|
5205
5438
|
"packages/addons/tasks/client/views/stats.cjs"(exports2, module2) {
|
|
5206
5439
|
var React = require("react");
|
|
5440
|
+
var DV = require_display_variants();
|
|
5207
5441
|
var h = React.createElement;
|
|
5208
5442
|
var charts = require_charts();
|
|
5209
5443
|
var configClient = require_config_client();
|
|
@@ -5513,6 +5747,7 @@ var require_stats = __commonJS({
|
|
|
5513
5747
|
}
|
|
5514
5748
|
function TasksStatsBody(props) {
|
|
5515
5749
|
var lang = props.lang === "en" ? "en" : "zh";
|
|
5750
|
+
var compactDisplay = props.display;
|
|
5516
5751
|
var t = COPY[lang];
|
|
5517
5752
|
var api = props.api;
|
|
5518
5753
|
var cfg = props.cfg || {};
|
|
@@ -5918,9 +6153,10 @@ var require_stats = __commonJS({
|
|
|
5918
6153
|
}
|
|
5919
6154
|
}
|
|
5920
6155
|
if (data) children.push(h(ch.Warnings, { key: "warn", items: data.warnings || [] }));
|
|
6156
|
+
var compact = DV.isCompact(compactDisplay);
|
|
5921
6157
|
return h(
|
|
5922
6158
|
"div",
|
|
5923
|
-
{ className: "wbt-stats" },
|
|
6159
|
+
{ className: "wbt-stats" + (compact ? " wbt-compact" : ""), "data-wb-layout": compact ? "compact" : "wide" },
|
|
5924
6160
|
h(ch.RangeSwitch, {
|
|
5925
6161
|
options,
|
|
5926
6162
|
value: customFrom || customTo ? null : range,
|
|
@@ -6139,6 +6375,8 @@ var require_copy = __commonJS({
|
|
|
6139
6375
|
restart: "\u91CD\u542F",
|
|
6140
6376
|
complete: "\u5B8C\u6210",
|
|
6141
6377
|
shutdownOp: "\u5173\u95ED",
|
|
6378
|
+
refreshing: "\u5237\u65B0\u4E2D\u2026",
|
|
6379
|
+
releaseRefresh: "\u677E\u5F00\u5237\u65B0",
|
|
6142
6380
|
selected: "\u5DF2\u9009",
|
|
6143
6381
|
selectedTasks: "\u9009\u4E2D\u4EFB\u52A1",
|
|
6144
6382
|
batchTimeline: "\u5F52\u5E76\u65F6\u95F4\u7EBF",
|
|
@@ -6333,6 +6571,8 @@ var require_copy = __commonJS({
|
|
|
6333
6571
|
restart: "Restart",
|
|
6334
6572
|
complete: "Complete",
|
|
6335
6573
|
shutdownOp: "Close",
|
|
6574
|
+
refreshing: "Refreshing\u2026",
|
|
6575
|
+
releaseRefresh: "Release to refresh",
|
|
6336
6576
|
selected: "Selected",
|
|
6337
6577
|
selectedTasks: "Selected tasks",
|
|
6338
6578
|
batchTimeline: "Merge timeline",
|
|
@@ -6391,6 +6631,11 @@ var require_overlay = __commonJS({
|
|
|
6391
6631
|
"use strict";
|
|
6392
6632
|
var defaultReact = require("react");
|
|
6393
6633
|
var FOCUSABLE = "button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),a[href]";
|
|
6634
|
+
var SHEET_STYLES = [
|
|
6635
|
+
".wbov-mask.is-sheet{display:block;padding:0;background:var(--wb-card,#141414)}",
|
|
6636
|
+
".wbov-sheet{position:static;inset:auto;width:auto;max-width:none;height:100%;max-height:none;border-radius:0;box-shadow:none;display:flex;flex-direction:column;overflow:hidden;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}",
|
|
6637
|
+
".wbov-sheet>*{max-width:100%}"
|
|
6638
|
+
].join("\n");
|
|
6394
6639
|
module2.exports = function createOverlay(options) {
|
|
6395
6640
|
var opts = options || {};
|
|
6396
6641
|
var React = opts.React || defaultReact;
|
|
@@ -6455,10 +6700,11 @@ var require_overlay = __commonJS({
|
|
|
6455
6700
|
}
|
|
6456
6701
|
}
|
|
6457
6702
|
var labelledBy = ariaLabelledByOf(props);
|
|
6703
|
+
var sheet = props.sheet === true;
|
|
6458
6704
|
return h(
|
|
6459
6705
|
"div",
|
|
6460
6706
|
{
|
|
6461
|
-
className: maskClass,
|
|
6707
|
+
className: maskClass + (sheet ? " is-sheet" : ""),
|
|
6462
6708
|
onMouseDown: function(e) {
|
|
6463
6709
|
var allowed = props.closeOnMask !== void 0 ? props.closeOnMask : closeOnMask(props);
|
|
6464
6710
|
if (e.target === e.currentTarget && props.onClose && allowed) props.onClose();
|
|
@@ -6467,7 +6713,7 @@ var require_overlay = __commonJS({
|
|
|
6467
6713
|
h(
|
|
6468
6714
|
tag,
|
|
6469
6715
|
{
|
|
6470
|
-
className: dialogClass + dialogClassOf(props),
|
|
6716
|
+
className: dialogClass + dialogClassOf(props) + (sheet ? " wbov-sheet" : ""),
|
|
6471
6717
|
role: "dialog",
|
|
6472
6718
|
"aria-modal": true,
|
|
6473
6719
|
"aria-label": labelledBy ? null : ariaLabelOf(props),
|
|
@@ -6483,6 +6729,7 @@ var require_overlay = __commonJS({
|
|
|
6483
6729
|
}
|
|
6484
6730
|
return Modal;
|
|
6485
6731
|
};
|
|
6732
|
+
module2.exports.sheetStyles = SHEET_STYLES;
|
|
6486
6733
|
}
|
|
6487
6734
|
});
|
|
6488
6735
|
|
|
@@ -6492,6 +6739,7 @@ var require_workspace_view = __commonJS({
|
|
|
6492
6739
|
"use strict";
|
|
6493
6740
|
module2.exports = function(deps) {
|
|
6494
6741
|
var React = deps.React, h = React.createElement;
|
|
6742
|
+
var DV = require_display_variants();
|
|
6495
6743
|
var createOverlay = deps.createOverlay;
|
|
6496
6744
|
var FormOverlay = createOverlay({
|
|
6497
6745
|
React,
|
|
@@ -6599,6 +6847,10 @@ var require_workspace_view = __commonJS({
|
|
|
6599
6847
|
}
|
|
6600
6848
|
};
|
|
6601
6849
|
var CSS = [
|
|
6850
|
+
/* 窄档:卡片单列铺满,操作按钮整行靠右,长标题换行不截断。 */
|
|
6851
|
+
".wbt-compact .wbt-ws-row{flex-direction:column;align-items:stretch;gap:10px}",
|
|
6852
|
+
".wbt-compact .wbt-ws-titleline{flex-wrap:wrap}",
|
|
6853
|
+
".wbt-compact .wbt-ws-ops{justify-content:flex-end;width:100%;flex-wrap:wrap}",
|
|
6602
6854
|
".wbt-ws-heading{display:flex;flex-direction:column;gap:2px;min-width:0}",
|
|
6603
6855
|
".wbt-ws-h2{margin:0;font-size:17px;line-height:1.3;font-weight:600}",
|
|
6604
6856
|
".wbt-ws-hint{font-size:12px;line-height:1.4;color:var(--dsw-alias-label-secondary,inherit);overflow-wrap:anywhere}",
|
|
@@ -6699,6 +6951,7 @@ var require_workspace_view = __commonJS({
|
|
|
6699
6951
|
}
|
|
6700
6952
|
function WorkspaceView(props) {
|
|
6701
6953
|
var lang = props.lang === "en" ? "en" : "zh", t = COPY[lang];
|
|
6954
|
+
var compact = DV.isCompact(props.display);
|
|
6702
6955
|
var api = props.api;
|
|
6703
6956
|
var listS = React.useState(null), records = listS[0], setRecords = listS[1];
|
|
6704
6957
|
var busyS = React.useState(true), busy = busyS[0], setBusy = busyS[1];
|
|
@@ -6845,7 +7098,7 @@ var require_workspace_view = __commonJS({
|
|
|
6845
7098
|
else body = shown.map(row);
|
|
6846
7099
|
return h(
|
|
6847
7100
|
"div",
|
|
6848
|
-
{ className: "wbt-root wbt-ws" },
|
|
7101
|
+
{ className: "wbt-root wbt-ws" + (compact ? " wbt-compact" : ""), "data-wb-layout": compact ? "compact" : "wide" },
|
|
6849
7102
|
h("style", null, CSS),
|
|
6850
7103
|
h(
|
|
6851
7104
|
"div",
|
|
@@ -7195,10 +7448,32 @@ var require_description = __commonJS({
|
|
|
7195
7448
|
}
|
|
7196
7449
|
});
|
|
7197
7450
|
|
|
7451
|
+
// packages/addons/lib/density-tokens.cjs
|
|
7452
|
+
var require_density_tokens = __commonJS({
|
|
7453
|
+
"packages/addons/lib/density-tokens.cjs"(exports2, module2) {
|
|
7454
|
+
"use strict";
|
|
7455
|
+
var CSS = [
|
|
7456
|
+
// 基础尺寸:全仓唯一允许出现控件高度像素的地方。
|
|
7457
|
+
":root{--wb-ctl-h-xs:22px;--wb-ctl-h-sm:26px;--wb-ctl-h-md:32px;--wb-ctl-h-lg:40px;--wb-ctl-h-xl:46px;--wb-ctl-px-xs:6px;--wb-ctl-px-sm:10px;--wb-ctl-px-md:14px;--wb-ctl-px-lg:18px;--wb-ctl-font-sm:11px;--wb-ctl-font-md:12px;--wb-ctl-font-lg:13px}",
|
|
7458
|
+
// 缺省密度 = comfortable:没有 [data-wb-density] 时(独立预览页、老宿主)也有一组合法映射。
|
|
7459
|
+
':root,[data-wb-density="comfortable"]{--wb-btn-primary:var(--wb-ctl-h-lg);--wb-btn-toolbar:var(--wb-ctl-h-md);--wb-btn-row:var(--wb-ctl-h-sm);--wb-btn-icon:var(--wb-ctl-h-md);--wb-field-h:var(--wb-ctl-h-md);--wb-gap-block:14px;--wb-font-body:var(--wb-ctl-font-md)}',
|
|
7460
|
+
// 桌面大屏:更紧的间距,控件高度下降一档。
|
|
7461
|
+
'[data-wb-density="compact"]{--wb-btn-primary:var(--wb-ctl-h-md);--wb-btn-toolbar:var(--wb-ctl-h-sm);--wb-btn-row:var(--wb-ctl-h-xs);--wb-btn-icon:var(--wb-ctl-h-sm);--wb-field-h:var(--wb-ctl-h-sm);--wb-gap-block:10px;--wb-font-body:var(--wb-ctl-font-md)}',
|
|
7462
|
+
// 显式声明的宽松档:只放大尺寸与间距,不引入第三套结构。
|
|
7463
|
+
'[data-wb-density="spacious"]{--wb-btn-primary:var(--wb-ctl-h-xl);--wb-btn-toolbar:var(--wb-ctl-h-lg);--wb-btn-row:var(--wb-ctl-h-md);--wb-btn-icon:var(--wb-ctl-h-lg);--wb-field-h:var(--wb-ctl-h-lg);--wb-gap-block:18px;--wb-font-body:var(--wb-ctl-font-lg)}',
|
|
7464
|
+
// 触控底线:粗指针设备上把按钮撑到 32px,宽档(fine pointer)像素不变。
|
|
7465
|
+
'[data-wb-pointer="coarse"] :is(button,[role="button"],input[type="button"],input[type="submit"],select){min-height:var(--wb-ctl-h-md);min-width:var(--wb-ctl-h-sm)}',
|
|
7466
|
+
// 触控端表单控件同样不能低于 32px,否则点按会漏。
|
|
7467
|
+
'[data-wb-pointer="coarse"] :is(input:not([type="checkbox"]):not([type="radio"]),textarea,select){min-height:var(--wb-ctl-h-md)}'
|
|
7468
|
+
].join("\n");
|
|
7469
|
+
module2.exports = CSS;
|
|
7470
|
+
}
|
|
7471
|
+
});
|
|
7472
|
+
|
|
7198
7473
|
// packages/addons/lib/visual-tokens.cjs
|
|
7199
7474
|
var require_visual_tokens = __commonJS({
|
|
7200
7475
|
"packages/addons/lib/visual-tokens.cjs"(exports2, module2) {
|
|
7201
|
-
module2.exports = `
|
|
7476
|
+
module2.exports = require_density_tokens() + `
|
|
7202
7477
|
:where(.wbt-root,.wbi-root,.wbi-cfg,.wbt-data,.wbs-data,.wbg-data,.wbi-data,.wb-desc){--wb-radius-sm:8px;--wb-radius-card:12px;--wb-space-sm:8px;--wb-space-md:14px;--wb-border:var(--dsw-alias-border-l2,color-mix(in oklab,currentColor 16%,transparent));--wb-description-bg:color-mix(in oklab,var(--dsw-alias-brand-primary,#5b7fd6) 7%,transparent);--wb-description-line:color-mix(in oklab,var(--dsw-alias-brand-primary,#5b7fd6) 34%,transparent);--wb-motion:140ms;--wb-btn-bg:transparent;--wb-btn-hover-bg:color-mix(in oklab,currentColor 6%,transparent);--wb-btn-active-bg:color-mix(in oklab,currentColor 11%,transparent);--wb-btn-primary-bg:var(--dsw-alias-brand-primary,#2563eb);--wb-btn-primary-fg:var(--dsw-alias-label-primary-inverted,#fff);--wb-btn-danger-fg:var(--dsw-alias-state-error-primary,#b91c1c);--wb-btn-size-sm:32px;--wb-btn-focus:2px solid var(--dsw-alias-brand-primary,#2563eb);--wb-btn-focus-offset:2px}
|
|
7203
7478
|
.wb-desc{background:var(--wb-description-bg);border-left-color:var(--wb-description-line);border-radius:0 var(--wb-radius-sm) var(--wb-radius-sm) 0}
|
|
7204
7479
|
`;
|
|
@@ -7241,7 +7516,7 @@ var require_filter_checklist_styles = __commonJS({
|
|
|
7241
7516
|
".wbck-meta{margin-left:auto;flex:none;font-size:11.5px;color:var(--wb-muted)}",
|
|
7242
7517
|
".wbck-note{font-size:12px;color:var(--wb-muted);padding:8px 6px}",
|
|
7243
7518
|
".wbck-more{font-size:11px;color:var(--wb-muted);text-align:center;padding:6px 0 2px;opacity:.8}",
|
|
7244
|
-
"
|
|
7519
|
+
":where([data-wb-lt760]) .wbck-list{max-height:200px}"
|
|
7245
7520
|
];
|
|
7246
7521
|
}
|
|
7247
7522
|
});
|
|
@@ -7620,8 +7895,8 @@ var require_stepper = __commonJS({
|
|
|
7620
7895
|
".wbctl-step-hint{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:400;opacity:.62}",
|
|
7621
7896
|
".wbctl-step-opt{flex:none;font-size:10px;font-weight:400;opacity:.55}",
|
|
7622
7897
|
// 窄屏先藏提示,标题仍占满整行;再窄就把标题折行,宁可变高也不截字。
|
|
7623
|
-
"
|
|
7624
|
-
"
|
|
7898
|
+
":where([data-wb-lt760]) .wbctl-step-list{flex-wrap:wrap}:where([data-wb-lt760]) .wbctl-step{padding:6px 7px;font-size:11.5px}:where([data-wb-lt760]) .wbctl-step-hint, :where([data-wb-lt760]) .wbctl-step-opt{display:none}:where([data-wb-lt760]) .wbctl-step-index{width:18px;height:18px;font-size:10px}",
|
|
7899
|
+
":where([data-wb-lt520]) .wbctl-step-list{gap:4px}:where([data-wb-lt520]) .wbctl-step-label{white-space:normal;overflow-wrap:anywhere}:where([data-wb-lt520]) .wbctl-step{gap:5px}",
|
|
7625
7900
|
"@media (prefers-reduced-motion:reduce){.wbctl-step{transition:none}}"
|
|
7626
7901
|
];
|
|
7627
7902
|
module2.exports = { Steps, stepState, styles: STYLES };
|
|
@@ -7910,7 +8185,7 @@ var require_staged_dialog = __commonJS({
|
|
|
7910
8185
|
// 两列字段布局:内容多的弹窗不再单列拉长,窄屏回落单列。
|
|
7911
8186
|
".wbctl-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}",
|
|
7912
8187
|
".wbctl-form>.full{grid-column:1/-1}",
|
|
7913
|
-
"
|
|
8188
|
+
":where([data-wb-lt760]) .wbctl-dialog{width:calc(100vw - 16px);max-height:94vh}:where([data-wb-lt760]) .wbctl-form{grid-template-columns:1fr}:where([data-wb-lt760]) .wbctl-form>.full{grid-column:auto}",
|
|
7914
8189
|
"@media (prefers-reduced-motion:reduce){.wbctl-btn{transition:none}}"
|
|
7915
8190
|
];
|
|
7916
8191
|
module2.exports = {
|
|
@@ -7948,10 +8223,245 @@ var require_disclosure_styles = __commonJS({
|
|
|
7948
8223
|
}
|
|
7949
8224
|
});
|
|
7950
8225
|
|
|
8226
|
+
// packages/addons/lib/gestures.cjs
|
|
8227
|
+
var require_gestures = __commonJS({
|
|
8228
|
+
"packages/addons/lib/gestures.cjs"(exports2, module2) {
|
|
8229
|
+
"use strict";
|
|
8230
|
+
var LONG_PRESS_MS = 500;
|
|
8231
|
+
var LONG_PRESS_TOLERANCE = 10;
|
|
8232
|
+
var PULL_THRESHOLD = 60;
|
|
8233
|
+
var PULL_MAX = 120;
|
|
8234
|
+
var PULL_RESISTANCE = 0.55;
|
|
8235
|
+
var SWIPE_BACK_DISTANCE = 80;
|
|
8236
|
+
var SWIPE_BACK_VELOCITY = 0.5;
|
|
8237
|
+
var SWIPE_BACK_EDGE = 48;
|
|
8238
|
+
function longPressDecision(input) {
|
|
8239
|
+
var elapsed = Number(input && input.elapsed) || 0;
|
|
8240
|
+
var moved = Number(input && input.moved) || 0;
|
|
8241
|
+
var ms = Number(input && input.ms) > 0 ? Number(input.ms) : LONG_PRESS_MS;
|
|
8242
|
+
var tolerance = Number(input && input.tolerance) > 0 ? Number(input.tolerance) : LONG_PRESS_TOLERANCE;
|
|
8243
|
+
return elapsed >= ms && moved <= tolerance;
|
|
8244
|
+
}
|
|
8245
|
+
function pullDecision(input) {
|
|
8246
|
+
var dy = Number(input && input.dy) || 0;
|
|
8247
|
+
var atTop = !(input && input.atTop === false);
|
|
8248
|
+
var threshold = Number(input && input.threshold) > 0 ? Number(input.threshold) : PULL_THRESHOLD;
|
|
8249
|
+
var max = Number(input && input.max) > 0 ? Number(input.max) : PULL_MAX;
|
|
8250
|
+
if (!atTop || dy <= 0) return { distance: 0, trigger: false };
|
|
8251
|
+
var distance = Math.min(max, Math.round(dy * PULL_RESISTANCE));
|
|
8252
|
+
return { distance, trigger: distance >= threshold };
|
|
8253
|
+
}
|
|
8254
|
+
function swipeBackDecision(input) {
|
|
8255
|
+
var dx = Number(input && input.dx) || 0;
|
|
8256
|
+
var dy = Number(input && input.dy) || 0;
|
|
8257
|
+
var velocity = Number(input && input.velocity) || 0;
|
|
8258
|
+
var distance = Number(input && input.distance) > 0 ? Number(input.distance) : SWIPE_BACK_DISTANCE;
|
|
8259
|
+
var minVelocity = Number(input && input.velocityThreshold) > 0 ? Number(input.velocityThreshold) : SWIPE_BACK_VELOCITY;
|
|
8260
|
+
if (dx <= 0) return false;
|
|
8261
|
+
if (Math.abs(dy) > dx) return false;
|
|
8262
|
+
return dx >= distance || velocity >= minVelocity;
|
|
8263
|
+
}
|
|
8264
|
+
function followOffset(dx, width) {
|
|
8265
|
+
var limit = Math.max(80, (Number(width) || 360) / 3);
|
|
8266
|
+
return Math.max(0, Math.min(limit, Math.round(Number(dx) || 0)));
|
|
8267
|
+
}
|
|
8268
|
+
function useLongPress(React, options) {
|
|
8269
|
+
var opts = options || {};
|
|
8270
|
+
var ref = React.useRef ? React.useRef(null) : { current: null };
|
|
8271
|
+
var firedRef = React.useRef ? React.useRef(false) : { current: false };
|
|
8272
|
+
var state = React.useState(false);
|
|
8273
|
+
var pressing = state[0], setPressing = state[1];
|
|
8274
|
+
function clear() {
|
|
8275
|
+
var st = ref.current;
|
|
8276
|
+
if (st && st.timer) {
|
|
8277
|
+
clearTimeout(st.timer);
|
|
8278
|
+
st.timer = null;
|
|
8279
|
+
}
|
|
8280
|
+
ref.current = null;
|
|
8281
|
+
if (pressing) setPressing(false);
|
|
8282
|
+
}
|
|
8283
|
+
React.useEffect(function() {
|
|
8284
|
+
return clear;
|
|
8285
|
+
}, []);
|
|
8286
|
+
function onPointerDown(event) {
|
|
8287
|
+
if (opts.disabled) return;
|
|
8288
|
+
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
8289
|
+
firedRef.current = false;
|
|
8290
|
+
var timer = setTimeout(function() {
|
|
8291
|
+
var st = ref.current;
|
|
8292
|
+
if (!st) return;
|
|
8293
|
+
firedRef.current = true;
|
|
8294
|
+
setPressing(true);
|
|
8295
|
+
st.timer = null;
|
|
8296
|
+
if (typeof opts.onLongPress === "function") opts.onLongPress({ clientX: st.x, clientY: st.y, target: st.target });
|
|
8297
|
+
}, Number(opts.ms) > 0 ? Number(opts.ms) : LONG_PRESS_MS);
|
|
8298
|
+
ref.current = { x: event.clientX, y: event.clientY, target: event.currentTarget, timer };
|
|
8299
|
+
}
|
|
8300
|
+
function onPointerMove(event) {
|
|
8301
|
+
var st = ref.current;
|
|
8302
|
+
if (!st) return;
|
|
8303
|
+
var moved = Math.abs(event.clientX - st.x) + Math.abs(event.clientY - st.y);
|
|
8304
|
+
var tolerance = Number(opts.tolerance) > 0 ? Number(opts.tolerance) : LONG_PRESS_TOLERANCE;
|
|
8305
|
+
if (moved <= tolerance) return;
|
|
8306
|
+
if (st.timer) clearTimeout(st.timer);
|
|
8307
|
+
ref.current = null;
|
|
8308
|
+
}
|
|
8309
|
+
function onPointerUp() {
|
|
8310
|
+
clear();
|
|
8311
|
+
}
|
|
8312
|
+
function onPointerCancel() {
|
|
8313
|
+
clear();
|
|
8314
|
+
}
|
|
8315
|
+
return {
|
|
8316
|
+
pressing,
|
|
8317
|
+
/** 取一次「刚刚发生过长按」并复位:用于在 onClick 里吞掉长按之后紧跟的点击。 */
|
|
8318
|
+
consume: function() {
|
|
8319
|
+
var fired = firedRef.current;
|
|
8320
|
+
firedRef.current = false;
|
|
8321
|
+
return fired;
|
|
8322
|
+
},
|
|
8323
|
+
handlers: {
|
|
8324
|
+
onPointerDown,
|
|
8325
|
+
onPointerMove,
|
|
8326
|
+
onPointerUp,
|
|
8327
|
+
onPointerCancel,
|
|
8328
|
+
onPointerLeave: onPointerUp
|
|
8329
|
+
}
|
|
8330
|
+
};
|
|
8331
|
+
}
|
|
8332
|
+
function usePullToRefresh(React, options) {
|
|
8333
|
+
var opts = options || {};
|
|
8334
|
+
var startRef = React.useRef ? React.useRef(null) : { current: null };
|
|
8335
|
+
var pullState = React.useState(0);
|
|
8336
|
+
var pull = pullState[0], setPull = pullState[1];
|
|
8337
|
+
var refreshState = React.useState(false);
|
|
8338
|
+
var refreshing = refreshState[0], setRefreshing = refreshState[1];
|
|
8339
|
+
function containerOf(event) {
|
|
8340
|
+
return opts.containerRef && opts.containerRef.current || event.currentTarget;
|
|
8341
|
+
}
|
|
8342
|
+
function onPointerDown(event) {
|
|
8343
|
+
if (opts.disabled || refreshing) return;
|
|
8344
|
+
var node = containerOf(event);
|
|
8345
|
+
var atTop = !node || node.scrollTop <= 0;
|
|
8346
|
+
startRef.current = { y: event.clientY, x: event.clientX, atTop };
|
|
8347
|
+
}
|
|
8348
|
+
function onPointerMove(event) {
|
|
8349
|
+
var st = startRef.current;
|
|
8350
|
+
if (!st) return;
|
|
8351
|
+
var dy = event.clientY - st.y;
|
|
8352
|
+
var dx = event.clientX - st.x;
|
|
8353
|
+
if (Math.abs(dx) > Math.abs(dy)) {
|
|
8354
|
+
startRef.current = null;
|
|
8355
|
+
setPull(0);
|
|
8356
|
+
return;
|
|
8357
|
+
}
|
|
8358
|
+
var verdict = pullDecision({ dy, atTop: st.atTop, threshold: opts.threshold, max: opts.max });
|
|
8359
|
+
setPull(verdict.distance);
|
|
8360
|
+
st.trigger = verdict.trigger;
|
|
8361
|
+
}
|
|
8362
|
+
function onPointerUp() {
|
|
8363
|
+
var st = startRef.current;
|
|
8364
|
+
startRef.current = null;
|
|
8365
|
+
if (!st || !st.trigger) {
|
|
8366
|
+
setPull(0);
|
|
8367
|
+
return;
|
|
8368
|
+
}
|
|
8369
|
+
setRefreshing(true);
|
|
8370
|
+
setPull(Number(opts.threshold) > 0 ? Number(opts.threshold) : PULL_THRESHOLD);
|
|
8371
|
+
var result = null;
|
|
8372
|
+
try {
|
|
8373
|
+
result = typeof opts.onRefresh === "function" ? opts.onRefresh() : null;
|
|
8374
|
+
} catch (error) {
|
|
8375
|
+
if (typeof console !== "undefined") console.error("[gestures] \u4E0B\u62C9\u5237\u65B0\u56DE\u8C03\u629B\u9519", error);
|
|
8376
|
+
}
|
|
8377
|
+
var done = function() {
|
|
8378
|
+
setRefreshing(false);
|
|
8379
|
+
setPull(0);
|
|
8380
|
+
};
|
|
8381
|
+
if (result && typeof result.then === "function") result.then(done, done);
|
|
8382
|
+
else done();
|
|
8383
|
+
}
|
|
8384
|
+
return {
|
|
8385
|
+
pull,
|
|
8386
|
+
refreshing,
|
|
8387
|
+
handlers: {
|
|
8388
|
+
onPointerDown,
|
|
8389
|
+
onPointerMove,
|
|
8390
|
+
onPointerUp,
|
|
8391
|
+
onPointerCancel: onPointerUp
|
|
8392
|
+
}
|
|
8393
|
+
};
|
|
8394
|
+
}
|
|
8395
|
+
function useEdgeSwipeBack(React, options) {
|
|
8396
|
+
var opts = options || {};
|
|
8397
|
+
var enabled = opts.enabled !== false;
|
|
8398
|
+
var startRef = React.useRef ? React.useRef(null) : { current: null };
|
|
8399
|
+
var offsetState = React.useState(0);
|
|
8400
|
+
var offset = offsetState[0], setOffset = offsetState[1];
|
|
8401
|
+
function onPointerDown(event) {
|
|
8402
|
+
if (!enabled) return;
|
|
8403
|
+
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
8404
|
+
var rect = event.currentTarget && typeof event.currentTarget.getBoundingClientRect === "function" ? event.currentTarget.getBoundingClientRect() : { left: 0, width: 360 };
|
|
8405
|
+
var edge = Number(opts.edge) > 0 ? Number(opts.edge) : SWIPE_BACK_EDGE;
|
|
8406
|
+
if (event.clientX - rect.left > edge) return;
|
|
8407
|
+
startRef.current = { x: event.clientX, y: event.clientY, lastX: event.clientX, lastAt: Date.now(), width: rect.width, velocity: 0 };
|
|
8408
|
+
}
|
|
8409
|
+
function onPointerMove(event) {
|
|
8410
|
+
var st = startRef.current;
|
|
8411
|
+
if (!st) return;
|
|
8412
|
+
var now = Date.now();
|
|
8413
|
+
var dt = now - st.lastAt;
|
|
8414
|
+
if (dt > 0) st.velocity = (event.clientX - st.lastX) / dt;
|
|
8415
|
+
st.lastX = event.clientX;
|
|
8416
|
+
st.lastAt = now;
|
|
8417
|
+
var dx = event.clientX - st.x;
|
|
8418
|
+
if (dx <= 0) {
|
|
8419
|
+
setOffset(0);
|
|
8420
|
+
return;
|
|
8421
|
+
}
|
|
8422
|
+
setOffset(followOffset(dx, st.width));
|
|
8423
|
+
}
|
|
8424
|
+
function onPointerUp(event) {
|
|
8425
|
+
var st = startRef.current;
|
|
8426
|
+
startRef.current = null;
|
|
8427
|
+
if (!st) return;
|
|
8428
|
+
var dx = event && typeof event.clientX === "number" ? event.clientX - st.x : 0;
|
|
8429
|
+
var dy = event && typeof event.clientY === "number" ? event.clientY - st.y : 0;
|
|
8430
|
+
var verdict = swipeBackDecision({ dx, dy, velocity: st.velocity, distance: opts.distance, velocityThreshold: opts.velocityThreshold });
|
|
8431
|
+
setOffset(0);
|
|
8432
|
+
if (verdict && typeof opts.onBack === "function") opts.onBack();
|
|
8433
|
+
}
|
|
8434
|
+
return {
|
|
8435
|
+
offset,
|
|
8436
|
+
handlers: enabled ? { onPointerDown, onPointerMove, onPointerUp, onPointerCancel: function() {
|
|
8437
|
+
startRef.current = null;
|
|
8438
|
+
setOffset(0);
|
|
8439
|
+
} } : {}
|
|
8440
|
+
};
|
|
8441
|
+
}
|
|
8442
|
+
module2.exports = {
|
|
8443
|
+
LONG_PRESS_MS,
|
|
8444
|
+
LONG_PRESS_TOLERANCE,
|
|
8445
|
+
PULL_THRESHOLD,
|
|
8446
|
+
PULL_MAX,
|
|
8447
|
+
SWIPE_BACK_DISTANCE,
|
|
8448
|
+
SWIPE_BACK_EDGE,
|
|
8449
|
+
longPressDecision,
|
|
8450
|
+
pullDecision,
|
|
8451
|
+
swipeBackDecision,
|
|
8452
|
+
followOffset,
|
|
8453
|
+
useLongPress,
|
|
8454
|
+
usePullToRefresh,
|
|
8455
|
+
useEdgeSwipeBack
|
|
8456
|
+
};
|
|
8457
|
+
}
|
|
8458
|
+
});
|
|
8459
|
+
|
|
7951
8460
|
// packages/addons/lib/panel-host.cjs
|
|
7952
8461
|
var require_panel_host = __commonJS({
|
|
7953
8462
|
"packages/addons/lib/panel-host.cjs"(exports2, module2) {
|
|
7954
8463
|
"use strict";
|
|
8464
|
+
var gestures = require_gestures();
|
|
7955
8465
|
var STYLES = [
|
|
7956
8466
|
// 基础层必须自己撑满视图并成为纵向 flex 容器:宿主用 display:contents 包了一层,
|
|
7957
8467
|
// 若这里不给约束,子视图的 flex:1 + min-height:0 就失效,长列表会把整页撑高,
|
|
@@ -7985,6 +8495,9 @@ var require_panel_host = __commonJS({
|
|
|
7985
8495
|
".wbpanel-close{flex:none;width:32px;height:32px;border-radius:8px;border:0;background:transparent;color:var(--wb-muted);cursor:pointer;font:inherit;font-size:18px;line-height:1}",
|
|
7986
8496
|
".wbpanel-close:hover,.wbpanel-close:focus-visible{background:var(--wb-surface);color:var(--wb-text);outline:0}",
|
|
7987
8497
|
".wbpanel-content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}",
|
|
8498
|
+
// 右滑返回:跟手位移直接写在 transform 上(不走 React 状态),松手后按过渡回位。
|
|
8499
|
+
".wbpanel-body{transition:transform .16s ease-out}",
|
|
8500
|
+
".wbpanel-body[data-swiping=1]{transition:none}",
|
|
7988
8501
|
"@media (prefers-reduced-motion: no-preference){.wbpanel-body{animation:wbpanel-in .16s ease-out}@keyframes wbpanel-in{from{transform:translateY(8px);opacity:.6}to{transform:none;opacity:1}}}"
|
|
7989
8502
|
].join("\n");
|
|
7990
8503
|
function createStore(initial) {
|
|
@@ -8213,6 +8726,53 @@ var require_panel_host = __commonJS({
|
|
|
8213
8726
|
}
|
|
8214
8727
|
};
|
|
8215
8728
|
}
|
|
8729
|
+
function swipeBackProps(panel) {
|
|
8730
|
+
if (panel.kind !== "full" && panel.kind !== "right") return {};
|
|
8731
|
+
if (panel.dismissible === false) return {};
|
|
8732
|
+
var start = null;
|
|
8733
|
+
return {
|
|
8734
|
+
onPointerDown: function(event) {
|
|
8735
|
+
if (event.pointerType === "mouse" && event.button !== 0) return;
|
|
8736
|
+
var body = event.currentTarget;
|
|
8737
|
+
var rect = body.getBoundingClientRect();
|
|
8738
|
+
if (event.clientX - rect.left > gestures.SWIPE_BACK_EDGE) return;
|
|
8739
|
+
start = { x: event.clientX, y: event.clientY, lastX: event.clientX, lastAt: Date.now(), width: rect.width, velocity: 0 };
|
|
8740
|
+
body.setAttribute("data-swiping", "1");
|
|
8741
|
+
if (body.setPointerCapture) {
|
|
8742
|
+
try {
|
|
8743
|
+
body.setPointerCapture(event.pointerId);
|
|
8744
|
+
} catch (error) {
|
|
8745
|
+
}
|
|
8746
|
+
}
|
|
8747
|
+
},
|
|
8748
|
+
onPointerMove: function(event) {
|
|
8749
|
+
if (!start) return;
|
|
8750
|
+
var now = Date.now();
|
|
8751
|
+
var dt = now - start.lastAt;
|
|
8752
|
+
if (dt > 0) start.velocity = (event.clientX - start.lastX) / dt;
|
|
8753
|
+
start.lastX = event.clientX;
|
|
8754
|
+
start.lastAt = now;
|
|
8755
|
+
var dx = event.clientX - start.x;
|
|
8756
|
+
event.currentTarget.style.transform = dx > 0 ? "translateX(" + gestures.followOffset(dx, start.width) + "px)" : "none";
|
|
8757
|
+
},
|
|
8758
|
+
onPointerUp: function(event) {
|
|
8759
|
+
if (!start) return;
|
|
8760
|
+
var body = event.currentTarget;
|
|
8761
|
+
var dx = event.clientX - start.x;
|
|
8762
|
+
var dy = event.clientY - start.y;
|
|
8763
|
+
var velocity = start.velocity;
|
|
8764
|
+
start = null;
|
|
8765
|
+
body.removeAttribute("data-swiping");
|
|
8766
|
+
body.style.transform = "none";
|
|
8767
|
+
if (gestures.swipeBackDecision({ dx, dy, velocity })) store.pop(panel.id);
|
|
8768
|
+
},
|
|
8769
|
+
onPointerCancel: function(event) {
|
|
8770
|
+
start = null;
|
|
8771
|
+
event.currentTarget.removeAttribute("data-swiping");
|
|
8772
|
+
event.currentTarget.style.transform = "none";
|
|
8773
|
+
}
|
|
8774
|
+
};
|
|
8775
|
+
}
|
|
8216
8776
|
function renderPanel(panel) {
|
|
8217
8777
|
var kind = panel.kind || "bottom";
|
|
8218
8778
|
var dismissible = panel.dismissible !== false;
|
|
@@ -8223,13 +8783,13 @@ var require_panel_host = __commonJS({
|
|
|
8223
8783
|
dismissible && panel.mask !== false ? h("button", { type: "button", className: "wbpanel-mask", key: "mask", "aria-label": panel.maskLabel || "\u5173\u95ED", onClick: function() {
|
|
8224
8784
|
store.pop(panel.id);
|
|
8225
8785
|
} }) : h("div", { className: "wbpanel-mask", key: "mask", "aria-hidden": "true" }),
|
|
8226
|
-
h("section", {
|
|
8786
|
+
h("section", Object.assign({
|
|
8227
8787
|
className: "wbpanel-body",
|
|
8228
8788
|
key: "body",
|
|
8229
8789
|
role: kind === "dialog" ? "dialog" : "region",
|
|
8230
8790
|
"aria-modal": "true",
|
|
8231
8791
|
"aria-label": typeof panel.title === "string" ? panel.title : void 0
|
|
8232
|
-
}, [
|
|
8792
|
+
}, swipeBackProps(panel)), [
|
|
8233
8793
|
kind === "bottom" ? h("div", { key: "grab", ...grabProps(panel) }) : null,
|
|
8234
8794
|
panel.title || dismissible ? h("div", { className: "wbpanel-head", key: "head" }, [
|
|
8235
8795
|
h("div", { className: "wbpanel-title", key: "title" }, panel.title || ""),
|
|
@@ -8398,8 +8958,14 @@ var require_sheet = __commonJS({
|
|
|
8398
8958
|
var require_card_list = __commonJS({
|
|
8399
8959
|
"packages/addons/lib/card-list.cjs"(exports2, module2) {
|
|
8400
8960
|
"use strict";
|
|
8961
|
+
var gestures = require_gestures();
|
|
8401
8962
|
var STYLES = [
|
|
8402
8963
|
".wbcard-list{display:flex;flex-direction:column;gap:8px;min-width:0}",
|
|
8964
|
+
// 下拉刷新:滚动容器由共享件提供,插件不再各自建一个 overflow:auto 再配一套指示条。
|
|
8965
|
+
".wbcard-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior-y:contain;display:flex;flex-direction:column}",
|
|
8966
|
+
".wbcard-pull{flex:none;display:flex;align-items:center;justify-content:center;overflow:hidden;color:var(--wb-muted);font-size:12px;transition:height .12s ease}",
|
|
8967
|
+
".wbcard-pull[data-refreshing=1] .wbcard-pull-text{color:var(--wb-accent)}",
|
|
8968
|
+
".wbcard-item[data-pressing=1]{opacity:.72}",
|
|
8403
8969
|
".wbcard-list-bar{display:flex;align-items:center;gap:8px;justify-content:center;padding:10px 0;color:var(--wb-muted);font-size:12px}",
|
|
8404
8970
|
".wbcard{border:1px solid var(--wb-line);border-radius:var(--wb-radius-card,10px);background:var(--wb-card);color:var(--wb-text);padding:11px 12px;display:flex;flex-direction:column;gap:8px;min-width:0;cursor:pointer;transition:border-color .12s ease,background .12s ease}",
|
|
8405
8971
|
".wbcard:hover{border-color:var(--wb-border)}",
|
|
@@ -8469,6 +9035,25 @@ var require_card_list = __commonJS({
|
|
|
8469
9035
|
props.actions ? h("div", { className: "wbcard-actions", key: "a" }, props.actions) : null
|
|
8470
9036
|
]);
|
|
8471
9037
|
}
|
|
9038
|
+
function CardRow(props) {
|
|
9039
|
+
var h = props.h;
|
|
9040
|
+
var React = props.React;
|
|
9041
|
+
var longPress = gestures.useLongPress(React, {
|
|
9042
|
+
disabled: !props.onLongPress,
|
|
9043
|
+
onLongPress: props.onLongPress ? function(point) {
|
|
9044
|
+
props.onLongPress(point);
|
|
9045
|
+
} : void 0
|
|
9046
|
+
});
|
|
9047
|
+
var handlers = props.onLongPress ? longPress.handlers : {};
|
|
9048
|
+
return h("div", Object.assign({
|
|
9049
|
+
className: "wbcard-item",
|
|
9050
|
+
"data-pressing": longPress.pressing ? "1" : "0",
|
|
9051
|
+
onClick: props.onLongPress ? function(event) {
|
|
9052
|
+
if (longPress.consume()) return;
|
|
9053
|
+
if (typeof props.onClick === "function") props.onClick(event);
|
|
9054
|
+
} : props.onClick
|
|
9055
|
+
}, handlers), props.children);
|
|
9056
|
+
}
|
|
8472
9057
|
function CardList(props) {
|
|
8473
9058
|
var h = props.h;
|
|
8474
9059
|
var React = props.React;
|
|
@@ -8514,7 +9099,17 @@ var require_card_list = __commonJS({
|
|
|
8514
9099
|
children.push(h("div", { className: "wbcard-empty", key: "empty" }, props.empty || "\u6CA1\u6709\u6570\u636E"));
|
|
8515
9100
|
} else {
|
|
8516
9101
|
items.forEach(function(item, index) {
|
|
8517
|
-
children.push(
|
|
9102
|
+
children.push(h(CardRow, {
|
|
9103
|
+
key: keyOf(item, index),
|
|
9104
|
+
h,
|
|
9105
|
+
React,
|
|
9106
|
+
onClick: props.onItemClick ? function(event) {
|
|
9107
|
+
props.onItemClick(item, event);
|
|
9108
|
+
} : void 0,
|
|
9109
|
+
onLongPress: props.onItemLongPress ? function(point) {
|
|
9110
|
+
props.onItemLongPress(item, point);
|
|
9111
|
+
} : void 0
|
|
9112
|
+
}, typeof props.renderItem === "function" ? props.renderItem(item, index) : h(Card, { h, title: String(item && item.title) })));
|
|
8518
9113
|
});
|
|
8519
9114
|
}
|
|
8520
9115
|
if (items.length && state === "more") {
|
|
@@ -8528,12 +9123,37 @@ var require_card_list = __commonJS({
|
|
|
8528
9123
|
}
|
|
8529
9124
|
return h("div", { className: "wbcard-list" + (props.className ? " " + props.className : "") }, children);
|
|
8530
9125
|
}
|
|
9126
|
+
function PullRefresh(props) {
|
|
9127
|
+
var h = props.h;
|
|
9128
|
+
var React = props.React;
|
|
9129
|
+
var ref = React.useRef ? React.useRef(null) : { current: null };
|
|
9130
|
+
var pull = gestures.usePullToRefresh(React, {
|
|
9131
|
+
containerRef: ref,
|
|
9132
|
+
onRefresh: props.onRefresh,
|
|
9133
|
+
disabled: props.disabled,
|
|
9134
|
+
threshold: props.threshold,
|
|
9135
|
+
max: props.max
|
|
9136
|
+
});
|
|
9137
|
+
var label = pull.refreshing ? props.refreshingLabel || "\u5237\u65B0\u4E2D\u2026" : pull.pull > 0 ? props.releaseLabel || "\u677E\u5F00\u5237\u65B0" : "";
|
|
9138
|
+
return h("div", Object.assign({ className: "wbcard-scroll" + (props.className ? " " + props.className : ""), ref }, pull.handlers), [
|
|
9139
|
+
h("div", {
|
|
9140
|
+
className: "wbcard-pull",
|
|
9141
|
+
key: "pull",
|
|
9142
|
+
"data-refreshing": pull.refreshing ? "1" : "0",
|
|
9143
|
+
style: { height: pull.pull ? pull.pull + "px" : "0px" },
|
|
9144
|
+
"aria-hidden": pull.pull || pull.refreshing ? "false" : "true"
|
|
9145
|
+
}, h("span", { className: "wbcard-pull-text" }, label)),
|
|
9146
|
+
h("div", { className: "wbcard-list-body", key: "body" }, props.children)
|
|
9147
|
+
]);
|
|
9148
|
+
}
|
|
8531
9149
|
module2.exports = {
|
|
8532
9150
|
styles: STYLES,
|
|
8533
9151
|
pageState,
|
|
8534
9152
|
skeletonRows,
|
|
8535
9153
|
Card,
|
|
8536
|
-
CardList
|
|
9154
|
+
CardList,
|
|
9155
|
+
CardRow,
|
|
9156
|
+
PullRefresh
|
|
8537
9157
|
};
|
|
8538
9158
|
}
|
|
8539
9159
|
});
|
|
@@ -8765,6 +9385,11 @@ var require_styles = __commonJS({
|
|
|
8765
9385
|
".wbt-tacts button.wbt-danger:hover{color:var(--dsw-alias-state-error-primary);background:color-mix(in oklab,var(--dsw-alias-state-error-primary) 12%,transparent)}",
|
|
8766
9386
|
"@keyframes wbt-fade{from{opacity:0}to{opacity:1}}",
|
|
8767
9387
|
"@keyframes wbt-slide{from{transform:translateX(-14px);opacity:.5}to{transform:none;opacity:1}}",
|
|
9388
|
+
/* 窄档整屏 sheet:遮罩变页面背景,表单占满可用高度,指纹区固定为内边距。 */
|
|
9389
|
+
".wbt-modal-mask.is-sheet{align-items:stretch;justify-content:stretch;padding:0;background:var(--wbt-bg)}",
|
|
9390
|
+
".wbt-modal.wbov-sheet{width:auto;max-width:none;max-height:none;height:100%;border:0;border-radius:0;box-shadow:none;padding:14px 14px calc(14px + env(safe-area-inset-bottom,0px))}",
|
|
9391
|
+
".wbt-modal.wbov-sheet .wbt-form{grid-template-columns:1fr}",
|
|
9392
|
+
".wbt-modal.wbov-sheet .wbt-modal-foot,.wbt-modal.wbov-sheet .wbt-formfoot{position:sticky;bottom:0;background:var(--wbt-bg);padding-top:10px}",
|
|
8768
9393
|
".wbt-modal-mask{position:fixed;inset:0;background:rgba(0,0,0,.28);z-index:1000;display:flex;align-items:center;justify-content:center;padding:16px}",
|
|
8769
9394
|
".wbt-modal{width:560px;max-width:96vw;max-height:90vh;overflow:auto;background-color:var(--wbt-bg);background-image:linear-gradient(var(--wbt-bg),var(--wbt-bg)),linear-gradient(var(--wbt-bg),var(--wbt-bg)),linear-gradient(var(--wbt-bg),var(--wbt-bg));-webkit-backdrop-filter:blur(30px) saturate(1.4);backdrop-filter:blur(30px) saturate(1.4);border:1px solid var(--wbt-line);border-radius:14px;box-shadow:0 20px 60px rgba(26,20,12,.3);padding:15px 17px;display:flex;flex-direction:column;gap:11px}",
|
|
8770
9395
|
".wbt-modal.wide{width:820px}",
|
|
@@ -8846,9 +9471,9 @@ var require_styles = __commonJS({
|
|
|
8846
9471
|
'.wbt-countdown .wbt-cd-num{font-variant-numeric:tabular-nums;font-feature-settings:"tnum"}',
|
|
8847
9472
|
".wbt-countdown.soon{background:color-mix(in oklab,var(--dsw-alias-state-error-primary) 14%,transparent);border-color:color-mix(in oklab,var(--dsw-alias-state-error-primary) 32%,transparent)}",
|
|
8848
9473
|
".wbt-countdown.overdue{color:var(--dsw-alias-label-primary-inverted);background:var(--dsw-alias-state-error-primary);border-color:transparent}",
|
|
8849
|
-
"
|
|
8850
|
-
"
|
|
8851
|
-
"
|
|
9474
|
+
":where([data-wb-lt760]) .wbt-body{flex-direction:column;gap:8px}:where([data-wb-lt760]) .wbt-nav{flex-direction:row;width:100%;flex:0 0 auto;overflow-x:auto;border-right:none;border-bottom:1px solid var(--wbt-line);padding:0 0 6px}:where([data-wb-lt760]) .wbt-tab{width:auto;white-space:nowrap;padding:6px 9px}:where([data-wb-lt760]) .wbt-tab.on{box-shadow:inset 0 -2px 0 var(--wbt-accent)}:where([data-wb-lt760]) .wbt-nav-sep{width:1px;height:18px;flex:none;margin:auto 4px}:where([data-wb-lt760]) .wbt-tree-slot{flex:0 0 auto;width:auto;margin-right:0}:where([data-wb-lt760]) .wbt-pathrow .wbt-search{flex:1 1 160px;max-width:none}",
|
|
9475
|
+
":where([data-wb-lt760]) .wbt-filter-panel{width:100%;flex:0 0 auto;padding:8px;max-height:40%}:where([data-wb-lt760]) .wbt-filter-toggle{display:inline-flex}:where([data-wb-lt760]) .wbt-filter-panel:not(.expanded) .wbt-filter-content{display:none}:where([data-wb-lt760]) .wbt-filter-panel.expanded .wbt-filter-content{padding-top:10px}:where([data-wb-lt760]) .wbt-content{width:100%;box-sizing:border-box}",
|
|
9476
|
+
":where([data-wb-lt640]) .wbt-form{grid-template-columns:1fr}:where([data-wb-lt640]) .wbt-drawer{width:94vw}:where([data-wb-lt640]) .wbt-search{width:100%}:where([data-wb-lt640]) .wbt-item{padding:9px}:where([data-wb-lt640]) .wbt-ops{width:100%;justify-content:flex-end}",
|
|
8852
9477
|
// ── 插槽贡献:渲染在别的插件的界面里(如邮件详情动作条) ──
|
|
8853
9478
|
// 那里没有 .wbt-root,--wbt-* 变量不存在,所以每个变量都带主题变量兜底。
|
|
8854
9479
|
".wbt-metazone:empty{display:none}",
|
|
@@ -8879,6 +9504,9 @@ var require_styles = __commonJS({
|
|
|
8879
9504
|
".wbtc-detail{display:flex;flex-direction:column;gap:10px;min-height:0;flex:1;overflow:auto}",
|
|
8880
9505
|
".wbtc-pagerinfo{font-size:12px;color:var(--wb-muted);white-space:nowrap}",
|
|
8881
9506
|
".wbtc-card{cursor:pointer;border:1px solid var(--wb-line);border-radius:10px;background:var(--wb-card);padding:10px 10px 9px}",
|
|
9507
|
+
// 长按快捷菜单:一列整行按钮,触屏上比网格好点。
|
|
9508
|
+
".wbtc-actions{display:flex;flex-direction:column;gap:8px;padding:4px 0 calc(8px + var(--wb-safe-bottom,0px))}",
|
|
9509
|
+
".wbtc-actions .wbt-btn{min-height:var(--wb-btn-toolbar,32px);justify-content:flex-start;padding:0 12px;font-size:14px}",
|
|
8882
9510
|
".wbtc-card:hover{border-color:var(--wb-border)}",
|
|
8883
9511
|
".wbtc-card-inner{display:flex;align-items:flex-start;gap:8px}",
|
|
8884
9512
|
".wbtc-card-body{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}",
|
|
@@ -8888,7 +9516,9 @@ var require_styles = __commonJS({
|
|
|
8888
9516
|
".wbtc-card-tags{display:flex;flex-wrap:wrap;gap:4px}",
|
|
8889
9517
|
".wbtc-card-meta{display:flex;flex-wrap:wrap;gap:4px 10px;font-size:11px;color:var(--wb-muted)}",
|
|
8890
9518
|
".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}"
|
|
9519
|
+
".wbtc-card-go{flex:none;display:flex;align-items:center;color:var(--wb-muted);padding-top:2px}",
|
|
9520
|
+
,
|
|
9521
|
+
require_overlay().sheetStyles
|
|
8892
9522
|
].concat(require_filter_checklist_styles(), require_date_picker_styles()("wbt"), require_switch().styles, require_icon_toggle().styles, require_number_field().styles, require_stepper().styles, require_staged_dialog().styles, require_disclosure_styles(), require_panel_host().styles, require_sheet().styles, require_card_list().styles, require_sticky_bar().styles).join("\n");
|
|
8893
9523
|
}
|
|
8894
9524
|
});
|
|
@@ -8905,6 +9535,10 @@ var require_timeline_styles = __commonJS({
|
|
|
8905
9535
|
".wbt-timeline-toolbar-main .wbt-timeline-search{flex:1 1 220px;min-width:0}",
|
|
8906
9536
|
".wbt-timeline-toolbar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto}",
|
|
8907
9537
|
".wbt-timeline-columns{display:grid;grid-template-columns:minmax(240px,32%) minmax(0,1fr);gap:12px;align-items:start}",
|
|
9538
|
+
/* 窄档:两列改上下,列表按内容高度、成员占剩余空间,各自滚动。 */
|
|
9539
|
+
".wbt-compact .wbt-timeline-columns{display:flex;flex-direction:column;gap:12px}",
|
|
9540
|
+
".wbt-compact .wbt-timeline-left,.wbt-compact .wbt-timeline-right{width:100%;padding:12px}",
|
|
9541
|
+
".wbt-compact .wbt-timeline-list{max-height:45vh}",
|
|
8908
9542
|
".wbt-timeline-left,.wbt-timeline-right{min-width:0;border:1px solid var(--wbt-line);border-radius:var(--wb-radius-card,10px);padding:12px}",
|
|
8909
9543
|
".wbt-timeline-search input{min-width:0;flex:1}",
|
|
8910
9544
|
".wbt-timeline-list{max-height:840px;overflow:auto;overscroll-behavior:contain}.wbt-timeline-left>.wbt-timeline-list,.wbt-timeline-left>.wbt-err{margin-top:2px}.wbt-timeline-view .wbt-timeline-option{position:relative;box-sizing:border-box;min-height:56px;padding:10px 12px;border:0;border-bottom:1px solid var(--wbt-line);border-radius:var(--wb-radius-sm,6px);display:flex;flex-direction:column;gap:4px;cursor:pointer;color:inherit;background:transparent;background-image:none}",
|
|
@@ -8925,8 +9559,8 @@ var require_timeline_styles = __commonJS({
|
|
|
8925
9559
|
".wbt-modal.wide.wbt-timeline-modal{display:flex;flex-direction:column;max-height:90vh;overflow:hidden}.wbt-timeline-modal-body{min-height:0;overflow:auto;flex:1;padding:12px}.wbt-timeline-member-section{min-width:0;margin-top:12px}.wbt-timeline-member-scroll{max-height:40vh;overflow:auto;overscroll-behavior:contain}.wbt-timeline-pick{border-top:1px solid var(--wbt-line);padding-top:12px;margin-top:12px}.wbt-timeline-empty{padding:12px 0}.wbt-picker-selected{font-size:12px;margin:6px 0;min-height:16px}.wbt-picker-list{max-height:220px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--wbt-line);border-radius:var(--wb-radius-sm,6px);padding:4px;background:var(--wbt-surface)}.wbt-picker-note{margin:6px;font-size:12px;opacity:.7}.wbt-picker-opt{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:6px 8px;border:0;border-radius:var(--wb-radius-sm,6px);background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.wbt-picker-opt:hover,.wbt-picker-opt:focus-visible{background:color-mix(in oklab,var(--wbt-accent) 12%,transparent)}.wbt-picker-opt:focus-visible{outline:2px solid var(--wbt-accent);outline-offset:-2px}.wbt-picker-opt.selected{background:color-mix(in oklab,var(--wbt-accent) 16%,transparent);font-weight:600}.wbt-picker-opt-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wbt-picker-opt-count{font-size:11px;opacity:.6;white-space:nowrap}.wbt-timeline-confirm{padding:12px;border:1px solid var(--wbt-line);border-radius:var(--wb-radius-card,10px);margin:8px 0;line-height:1.6;background:var(--wbt-surface)}.wbt-timeline-confirm .wbt-btn{margin:8px 8px 0 0}",
|
|
8926
9560
|
".wbt-timeline-desc.expanded{max-height:none}.wbt-timeline-selected{min-width:0;overflow-wrap:anywhere;flex:1}.wbt-modal-foot.wbt-timeline-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;flex:none}.wbt-timeline-modal .wbt-empty{padding:12px;margin:8px 0;border:1px solid var(--wbt-line);border-radius:var(--wb-radius-card,10px);background:var(--wbt-surface);line-height:1.6}",
|
|
8927
9561
|
// 窄屏:搜索独占一行,操作按钮靠左并允许换行,避免「刷新」被推出屏幕。
|
|
8928
|
-
"
|
|
8929
|
-
"
|
|
9562
|
+
":where([data-wb-lt600]) .wbt-timeline-toolbar{flex-direction:column;align-items:stretch}:where([data-wb-lt600]) .wbt-timeline-toolbar-main{flex:1 1 100%}:where([data-wb-lt600]) .wbt-timeline-toolbar-main .wbt-timeline-search{flex:1 1 100%}:where([data-wb-lt600]) .wbt-timeline-toolbar-actions{margin-left:0;justify-content:flex-start;gap:6px}:where([data-wb-lt600]) .wbt-timeline-toolbar-actions .wbt-btn{padding-left:10px;padding-right:10px}",
|
|
9563
|
+
":where([data-wb-lt720]) .wbt-timeline-selected{flex:1 1 100%}:where([data-wb-lt720]) .wbt-picker-list{max-height:180px}:where([data-wb-lt720]) wbt-timeline-toolbar-main{flex:1 1 100%}:where([data-wb-lt720]) .wbt-timeline-toolbar-actions{flex:1 1 100%;justify-content:flex-end;margin-left:0}:where([data-wb-lt720]) .wbt-timeline-list{max-height:320px}:where([data-wb-lt720]) .wbt-timeline-toolbar{flex-wrap:wrap}:where([data-wb-lt720]) .wbt-timeline-member-row{grid-template-columns:76px 8px minmax(0,1fr) auto 28px;gap:4px}:where([data-wb-lt720]) .wbt-timeline-left, :where([data-wb-lt720]) .wbt-timeline-right{padding:12px}:where([data-wb-lt720]) .wbt-timeline-date{font-size:10.5px}:where([data-wb-lt720]) .wbt-timeline-member-row>.wbt-badge{font-size:10.5px;padding:2px 4px}:where([data-wb-lt720]) .wbt-timeline-actions>.wbt-act-del{margin-left:0}:where([data-wb-lt720]) .wbt-timeline-id{max-width:140px}"
|
|
8930
9564
|
].join("\n");
|
|
8931
9565
|
}
|
|
8932
9566
|
});
|
|
@@ -12415,6 +13049,7 @@ var require_tasks_state = __commonJS({
|
|
|
12415
13049
|
var cfg = ctx.cfg || {};
|
|
12416
13050
|
var viewParams = ctx.viewParams;
|
|
12417
13051
|
var lang = ctx.lang === "en" ? "en" : "zh";
|
|
13052
|
+
var compact = ctx.compact === true;
|
|
12418
13053
|
var t = ctx.t;
|
|
12419
13054
|
var allTables = ctx.allTables;
|
|
12420
13055
|
var treeWalk = ctx.treeWalk;
|
|
@@ -12998,6 +13633,7 @@ var require_tasks_state = __commonJS({
|
|
|
12998
13633
|
lang,
|
|
12999
13634
|
cfg,
|
|
13000
13635
|
cfgConfirm,
|
|
13636
|
+
compact,
|
|
13001
13637
|
tree,
|
|
13002
13638
|
expanded,
|
|
13003
13639
|
target,
|
|
@@ -13189,10 +13825,12 @@ var require_tasks_overlays = __commonJS({
|
|
|
13189
13825
|
var ownership = require_ownership();
|
|
13190
13826
|
return function renderOverlays(m) {
|
|
13191
13827
|
var t = m.t;
|
|
13828
|
+
var sheet = m.compact === true;
|
|
13192
13829
|
var api = m.api;
|
|
13193
13830
|
var lang = m.lang;
|
|
13194
13831
|
return h("div", { className: "wbt-overlays", style: { display: "contents" } }, [
|
|
13195
13832
|
m.createState ? h(CreateModal, {
|
|
13833
|
+
sheet,
|
|
13196
13834
|
key: (m.createState.source || "0") + "-" + (m.createState.originTask && m.createState.originTask.id || ""),
|
|
13197
13835
|
t,
|
|
13198
13836
|
api,
|
|
@@ -13217,6 +13855,7 @@ var require_tasks_overlays = __commonJS({
|
|
|
13217
13855
|
}
|
|
13218
13856
|
}) : null,
|
|
13219
13857
|
m.timelineTask ? h(TimelineModal, {
|
|
13858
|
+
sheet,
|
|
13220
13859
|
key: m.timelineTask.id,
|
|
13221
13860
|
t,
|
|
13222
13861
|
api,
|
|
@@ -13281,6 +13920,7 @@ var require_tasks_overlays = __commonJS({
|
|
|
13281
13920
|
}
|
|
13282
13921
|
}) : null,
|
|
13283
13922
|
m.nodeModal ? h(NodeModal, {
|
|
13923
|
+
sheet,
|
|
13284
13924
|
key: "node-" + (m.nodeModal.node ? m.nodeModal.node.id : "new"),
|
|
13285
13925
|
t,
|
|
13286
13926
|
api,
|
|
@@ -13293,6 +13933,7 @@ var require_tasks_overlays = __commonJS({
|
|
|
13293
13933
|
onSaved: m.nodeSaved
|
|
13294
13934
|
}) : null,
|
|
13295
13935
|
m.editTask ? h(EditModal, {
|
|
13936
|
+
sheet,
|
|
13296
13937
|
key: "edit-" + m.editTask.id,
|
|
13297
13938
|
t,
|
|
13298
13939
|
api,
|
|
@@ -13310,6 +13951,7 @@ var require_tasks_overlays = __commonJS({
|
|
|
13310
13951
|
}
|
|
13311
13952
|
}) : null,
|
|
13312
13953
|
m.doneTask ? h(DoneModal, {
|
|
13954
|
+
sheet,
|
|
13313
13955
|
key: m.doneTask.id,
|
|
13314
13956
|
t,
|
|
13315
13957
|
api,
|
|
@@ -13330,6 +13972,7 @@ var require_tasks_overlays = __commonJS({
|
|
|
13330
13972
|
}
|
|
13331
13973
|
}) : null,
|
|
13332
13974
|
m.selectedOpen && m.batchMode ? h(BatchModal, {
|
|
13975
|
+
sheet,
|
|
13333
13976
|
key: m.batchMode,
|
|
13334
13977
|
t,
|
|
13335
13978
|
api,
|
|
@@ -13778,6 +14421,44 @@ var require_tasks_compact_view = __commonJS({
|
|
|
13778
14421
|
return h("div", { className: "wbtc-sheet" }, m.filterPanel);
|
|
13779
14422
|
} });
|
|
13780
14423
|
}
|
|
14424
|
+
function openActions(task) {
|
|
14425
|
+
var active = task.status === 0 || task.status === 4;
|
|
14426
|
+
var actions = [
|
|
14427
|
+
{ key: "edit", label: t.edit, run: function() {
|
|
14428
|
+
m.setEditTask(task);
|
|
14429
|
+
} },
|
|
14430
|
+
active ? { key: "done", label: t.complete, run: function() {
|
|
14431
|
+
m.setDoneTask(task);
|
|
14432
|
+
} } : null,
|
|
14433
|
+
{ key: "timeline", label: t.timeline, run: function() {
|
|
14434
|
+
m.setTimelineTask(task);
|
|
14435
|
+
} },
|
|
14436
|
+
{ key: "select", label: t.select, run: function() {
|
|
14437
|
+
m.setSelectionMode(true);
|
|
14438
|
+
m.toggleSelect(task);
|
|
14439
|
+
} },
|
|
14440
|
+
{ key: "del", label: t.del, run: function() {
|
|
14441
|
+
m.deleteTask(task);
|
|
14442
|
+
}, danger: true }
|
|
14443
|
+
].filter(Boolean);
|
|
14444
|
+
store.push({
|
|
14445
|
+
id: "actions-" + task.id,
|
|
14446
|
+
kind: "bottom",
|
|
14447
|
+
title: task.title || t.editTitle,
|
|
14448
|
+
render: function(panel) {
|
|
14449
|
+
return h("div", { className: "wbtc-actions" }, actions.map(function(item) {
|
|
14450
|
+
return h("button", {
|
|
14451
|
+
key: item.key,
|
|
14452
|
+
className: "wbt-btn" + (item.danger ? " danger" : ""),
|
|
14453
|
+
onClick: function() {
|
|
14454
|
+
panel.close();
|
|
14455
|
+
item.run();
|
|
14456
|
+
}
|
|
14457
|
+
}, item.label);
|
|
14458
|
+
}));
|
|
14459
|
+
}
|
|
14460
|
+
});
|
|
14461
|
+
}
|
|
13781
14462
|
function openDetail(task) {
|
|
13782
14463
|
store.push({
|
|
13783
14464
|
id: "detail-" + task.id,
|
|
@@ -13820,7 +14501,17 @@ var require_tasks_compact_view = __commonJS({
|
|
|
13820
14501
|
}
|
|
13821
14502
|
}, h(Icon2, { name: "refresh", size: 16 }))
|
|
13822
14503
|
);
|
|
13823
|
-
var list = h(CL.
|
|
14504
|
+
var list = h(CL.PullRefresh, {
|
|
14505
|
+
h,
|
|
14506
|
+
React,
|
|
14507
|
+
// 下拉刷新同时刷列表与标签导航:窄屏没有刷新按钮的位置感,手势就是主入口。
|
|
14508
|
+
onRefresh: function() {
|
|
14509
|
+
m.refreshList();
|
|
14510
|
+
m.refreshTagNav();
|
|
14511
|
+
},
|
|
14512
|
+
refreshingLabel: t.refreshing,
|
|
14513
|
+
releaseLabel: t.releaseRefresh
|
|
14514
|
+
}, h(CL.CardList, {
|
|
13824
14515
|
h,
|
|
13825
14516
|
React,
|
|
13826
14517
|
items: m.data.records || [],
|
|
@@ -13831,17 +14522,17 @@ var require_tasks_compact_view = __commonJS({
|
|
|
13831
14522
|
keyOf: function(task) {
|
|
13832
14523
|
return task.id;
|
|
13833
14524
|
},
|
|
14525
|
+
onItemClick: function(task, event) {
|
|
14526
|
+
if (event && event.target && event.target.closest && event.target.closest("input,button,select,.wbt-tag")) return;
|
|
14527
|
+
openDetail(task);
|
|
14528
|
+
},
|
|
14529
|
+
onItemLongPress: function(task) {
|
|
14530
|
+
openActions(task);
|
|
14531
|
+
},
|
|
13834
14532
|
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
|
-
);
|
|
14533
|
+
return h("div", { className: "wbtc-card" }, h(TaskCardCompact, cardProps(task)));
|
|
13843
14534
|
}
|
|
13844
|
-
});
|
|
14535
|
+
}));
|
|
13845
14536
|
var sticky = m.selectionMode ? h(SB.StickyBar, {
|
|
13846
14537
|
h,
|
|
13847
14538
|
tone: "accent",
|
|
@@ -13940,6 +14631,7 @@ var require_tasks_view = __commonJS({
|
|
|
13940
14631
|
function TasksViewBody(props) {
|
|
13941
14632
|
var lang = props.lang === "en" ? "en" : "zh";
|
|
13942
14633
|
var t = COPY[lang];
|
|
14634
|
+
var compact = !!COMPACT_VARIANTS[String(props.variant || "")];
|
|
13943
14635
|
var model = useTasksState({
|
|
13944
14636
|
React,
|
|
13945
14637
|
api: props.api,
|
|
@@ -13953,9 +14645,9 @@ var require_tasks_view = __commonJS({
|
|
|
13953
14645
|
Icon: deps.Icon,
|
|
13954
14646
|
TreeNode: deps.TreeNode,
|
|
13955
14647
|
TagFilter: deps.TagFilter,
|
|
13956
|
-
injectCss: deps.injectCss
|
|
14648
|
+
injectCss: deps.injectCss,
|
|
14649
|
+
compact
|
|
13957
14650
|
});
|
|
13958
|
-
var compact = !!COMPACT_VARIANTS[String(props.variant || "")];
|
|
13959
14651
|
return compact ? h(TasksCompactView, { model, h, variant: props.variant }) : TasksWideLayout({ model, h });
|
|
13960
14652
|
}
|
|
13961
14653
|
return TasksView;
|
|
@@ -14115,6 +14807,7 @@ var require_timeline_view = __commonJS({
|
|
|
14115
14807
|
module2.exports = function(deps) {
|
|
14116
14808
|
var React = deps.React, h = React.createElement, COPY = deps.COPY;
|
|
14117
14809
|
var controls = require_timeline_controls()(React), AddMembers = require_timeline_add_members()(React);
|
|
14810
|
+
var DV = require_display_variants();
|
|
14118
14811
|
var Merge = require_timeline_merge()(React);
|
|
14119
14812
|
var MemberRows = require_timeline_member_rows()(React, deps.statusInfo);
|
|
14120
14813
|
var TaskPreview = require_task_preview()(React, deps.TaskItem);
|
|
@@ -14144,6 +14837,7 @@ var require_timeline_view = __commonJS({
|
|
|
14144
14837
|
}
|
|
14145
14838
|
function TimelineView(props) {
|
|
14146
14839
|
var lang = props.lang === "en" ? "en" : "zh", t = COPY[lang], api = props.api;
|
|
14840
|
+
var compact = DV.isCompact(props.display);
|
|
14147
14841
|
var tr = require_timeline_copy()(t);
|
|
14148
14842
|
var queryS = React.useState(""), query = queryS[0], setQuery = queryS[1];
|
|
14149
14843
|
var draftS = React.useState(""), draft = draftS[0], setDraft = draftS[1];
|
|
@@ -14341,7 +15035,7 @@ var require_timeline_view = __commonJS({
|
|
|
14341
15035
|
}
|
|
14342
15036
|
return h(
|
|
14343
15037
|
"div",
|
|
14344
|
-
{ className: "wbt-root wbt-timeline-view" },
|
|
15038
|
+
{ className: "wbt-root wbt-timeline-view" + (compact ? " wbt-compact" : ""), "data-wb-layout": compact ? "compact" : "wide" },
|
|
14345
15039
|
h(
|
|
14346
15040
|
"div",
|
|
14347
15041
|
{ className: "wbt-timeline-toolbar" },
|
|
@@ -15095,7 +15789,7 @@ var require_timeline_view = __commonJS({
|
|
|
15095
15789
|
var TimelineView = require_timeline_view()({ React, COPY, injectCss, statusInfo, configClient, CFG_FALLBACK, TaskItem, EditModal, DoneModal, TimelineModal, CreateModal });
|
|
15096
15790
|
host.registerAddon({
|
|
15097
15791
|
id: "wb-addon-tasks",
|
|
15098
|
-
version: "5.
|
|
15792
|
+
version: "5.15.1",
|
|
15099
15793
|
icon: ICONS["list-checks"],
|
|
15100
15794
|
// 贡献声明写在 registerAddon 里:卸载任务插件时宿主按 addonId 一起撤销,
|
|
15101
15795
|
// 不会在邮件里留一个渲染即报错的孤儿按钮。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-workbench-tasks",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.15.1",
|
|
4
4
|
"description": "个人工作台任务插件:任务树、优先级、截止日、时间线与重启",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"id": "wb-addon-tasks",
|
|
19
19
|
"title": "任务",
|
|
20
20
|
"description": "任务树 + 统计/记录/时间线/工作区四个视图:紧急/已关闭/已开启/已完成/总览,可按标签筛选,附统计报表;配置项由宿主统一配置中心渲染",
|
|
21
|
-
"version": "5.
|
|
21
|
+
"version": "5.15.1",
|
|
22
22
|
"minShell": "0.21.0",
|
|
23
23
|
"tables": [
|
|
24
24
|
"task",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"./package.json": "./package.json"
|
|
93
93
|
},
|
|
94
94
|
"dependencies": {
|
|
95
|
-
"dsh-workbench-host": "^0.35.
|
|
95
|
+
"dsh-workbench-host": "^0.35.9"
|
|
96
96
|
},
|
|
97
97
|
"dsh": {
|
|
98
98
|
"bundle": {
|