dsh-workbench-tasks 5.15.1 → 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 +10 -1
- package/lib/client.js +1726 -397
- package/package.json +3 -3
package/lib/client.js
CHANGED
|
@@ -4776,6 +4776,94 @@ var init_refresh_cw = __esm({
|
|
|
4776
4776
|
}
|
|
4777
4777
|
});
|
|
4778
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
|
+
|
|
4779
4867
|
// packages/addons/tasks/client/ui/icons.cjs
|
|
4780
4868
|
var require_icons2 = __commonJS({
|
|
4781
4869
|
"packages/addons/tasks/client/ui/icons.cjs"(exports2, module2) {
|
|
@@ -4816,7 +4904,11 @@ var require_icons2 = __commonJS({
|
|
|
4816
4904
|
down: (init_chevron_down(), __toCommonJS(chevron_down_exports)).default,
|
|
4817
4905
|
tag: (init_tag(), __toCommonJS(tag_exports)).default,
|
|
4818
4906
|
clock: (init_clock(), __toCommonJS(clock_exports)).default,
|
|
4819
|
-
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
|
|
4820
4912
|
// 「原邮件」回链:从邮件建出来的任务要能跳回去看一眼原文。
|
|
4821
4913
|
}, {});
|
|
4822
4914
|
module2.exports = { ICONS: set.ICONS, Icon: set.Icon, label: set.label };
|
|
@@ -6270,6 +6362,25 @@ var require_copy = __commonJS({
|
|
|
6270
6362
|
all: "\u5168\u90E8",
|
|
6271
6363
|
empty: "\u8FD9\u4E2A\u89C6\u56FE\u8FD8\u6CA1\u6709\u4EFB\u52A1",
|
|
6272
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",
|
|
6273
6384
|
error: "\u64CD\u4F5C\u5931\u8D25\uFF1A",
|
|
6274
6385
|
save: "\u4FDD\u5B58",
|
|
6275
6386
|
cancel: "\u53D6\u6D88",
|
|
@@ -6466,6 +6577,25 @@ var require_copy = __commonJS({
|
|
|
6466
6577
|
all: "All",
|
|
6467
6578
|
empty: "No tasks in this view",
|
|
6468
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}",
|
|
6469
6599
|
error: "Failed: ",
|
|
6470
6600
|
save: "Save",
|
|
6471
6601
|
cancel: "Cancel",
|
|
@@ -6632,9 +6762,9 @@ var require_overlay = __commonJS({
|
|
|
6632
6762
|
var defaultReact = require("react");
|
|
6633
6763
|
var FOCUSABLE = "button:not(:disabled),input:not(:disabled),textarea:not(:disabled),select:not(:disabled),a[href]";
|
|
6634
6764
|
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%}"
|
|
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%}"
|
|
6638
6768
|
].join("\n");
|
|
6639
6769
|
module2.exports = function createOverlay(options) {
|
|
6640
6770
|
var opts = options || {};
|
|
@@ -7480,6 +7610,240 @@ var require_visual_tokens = __commonJS({
|
|
|
7480
7610
|
}
|
|
7481
7611
|
});
|
|
7482
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
|
+
|
|
7483
7847
|
// packages/addons/lib/filter-checklist-styles.cjs
|
|
7484
7848
|
var require_filter_checklist_styles = __commonJS({
|
|
7485
7849
|
"packages/addons/lib/filter-checklist-styles.cjs"(exports2, module2) {
|
|
@@ -8462,12 +8826,16 @@ var require_panel_host = __commonJS({
|
|
|
8462
8826
|
"packages/addons/lib/panel-host.cjs"(exports2, module2) {
|
|
8463
8827
|
"use strict";
|
|
8464
8828
|
var gestures = require_gestures();
|
|
8829
|
+
var PANEL_CLOSE_DISTANCE = 96;
|
|
8830
|
+
var PANEL_CLOSE_VELOCITY = 0.5;
|
|
8465
8831
|
var STYLES = [
|
|
8466
8832
|
// 基础层必须自己撑满视图并成为纵向 flex 容器:宿主用 display:contents 包了一层,
|
|
8467
8833
|
// 若这里不给约束,子视图的 flex:1 + min-height:0 就失效,长列表会把整页撑高,
|
|
8468
8834
|
// 固定底条被推到内容末尾(窄屏表现为「底部按钮要滚到底才看得到」)。
|
|
8469
8835
|
".wbpanel-base{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}",
|
|
8470
|
-
|
|
8836
|
+
// 整屏面板打开时基础层「藏起来但不撤掉布局」:用 hidden/display:none 会让视图根节点的
|
|
8837
|
+
// 高度塌成 0,面板再按祖先盒定位就只剩一条缝。visibility 保留布局与高度,同时挡住交互。
|
|
8838
|
+
".wbpanel-base[data-veiled=true]{visibility:hidden;pointer-events:none}",
|
|
8471
8839
|
// 面板层要盖住「宿主视图」而不是「整个窗口」:工作台可能被 DSH 嵌在侧栏或分屏里,
|
|
8472
8840
|
// 用 fixed inset:0 会横跨整个窗口,窄屏一侧露着别的内容。位置由 JS 按宿主视图盒量出,
|
|
8473
8841
|
// 这里的默认值只用于没量到盒子时的兜底。
|
|
@@ -8494,7 +8862,13 @@ var require_panel_host = __commonJS({
|
|
|
8494
8862
|
".wbpanel-title{flex:1;min-width:0;font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
8495
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}",
|
|
8496
8864
|
".wbpanel-close:hover,.wbpanel-close:focus-visible{background:var(--wb-surface);color:var(--wb-text);outline:0}",
|
|
8497
|
-
|
|
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)}",
|
|
8498
8872
|
// 右滑返回:跟手位移直接写在 transform 上(不走 React 状态),松手后按过渡回位。
|
|
8499
8873
|
".wbpanel-body{transition:transform .16s ease-out}",
|
|
8500
8874
|
".wbpanel-body[data-swiping=1]{transition:none}",
|
|
@@ -8625,18 +8999,35 @@ var require_panel_host = __commonJS({
|
|
|
8625
8999
|
var boxState = React.useState(null);
|
|
8626
9000
|
var box = boxState[0], setBox = boxState[1];
|
|
8627
9001
|
React.useEffect(function() {
|
|
8628
|
-
if (!
|
|
8629
|
-
function
|
|
8630
|
-
var
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
var
|
|
8634
|
-
if (
|
|
8635
|
-
|
|
8636
|
-
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;
|
|
8637
9010
|
}
|
|
8638
|
-
|
|
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 };
|
|
8639
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
|
+
});
|
|
8640
9031
|
}
|
|
8641
9032
|
measure();
|
|
8642
9033
|
window.addEventListener("resize", measure);
|
|
@@ -8645,7 +9036,7 @@ var require_panel_host = __commonJS({
|
|
|
8645
9036
|
window.removeEventListener("resize", measure);
|
|
8646
9037
|
window.removeEventListener("orientationchange", measure);
|
|
8647
9038
|
};
|
|
8648
|
-
}, [
|
|
9039
|
+
}, [doc]);
|
|
8649
9040
|
React.useEffect(function() {
|
|
8650
9041
|
if (!list.length || !doc) return void 0;
|
|
8651
9042
|
function onKey(event) {
|
|
@@ -8661,6 +9052,65 @@ var require_panel_host = __commonJS({
|
|
|
8661
9052
|
doc.removeEventListener("keydown", onKey, true);
|
|
8662
9053
|
};
|
|
8663
9054
|
}, [list.length, store]);
|
|
9055
|
+
React.useEffect(function() {
|
|
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]);
|
|
8664
9114
|
React.useEffect(function() {
|
|
8665
9115
|
if (!doc || !doc.body) return void 0;
|
|
8666
9116
|
if (list.length && !locked.current) {
|
|
@@ -8707,17 +9157,29 @@ var require_panel_host = __commonJS({
|
|
|
8707
9157
|
}
|
|
8708
9158
|
}
|
|
8709
9159
|
layer.setAttribute("data-resizing", "1");
|
|
9160
|
+
var drag = { dy: 0, velocity: 0, lastY: startY, lastAt: Date.now() };
|
|
8710
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;
|
|
8711
9168
|
var next = startH + (startY - moveEvent.clientY);
|
|
8712
9169
|
next = Math.max(box2.height * 0.3, Math.min(box2.height * 0.92, next));
|
|
8713
9170
|
surface.style.setProperty("--wbpanel-h", Math.round(next / box2.height * 100) + "%");
|
|
8714
|
-
dragHeights.current[panel.id] = Math.round(next / box2.height * 100) + "%";
|
|
8715
9171
|
}
|
|
8716
9172
|
function end() {
|
|
8717
9173
|
layer.removeAttribute("data-resizing");
|
|
8718
9174
|
window.removeEventListener("pointermove", move);
|
|
8719
9175
|
window.removeEventListener("pointerup", end);
|
|
8720
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;
|
|
8721
9183
|
}
|
|
8722
9184
|
window.addEventListener("pointermove", move);
|
|
8723
9185
|
window.addEventListener("pointerup", end);
|
|
@@ -8786,8 +9248,10 @@ var require_panel_host = __commonJS({
|
|
|
8786
9248
|
h("section", Object.assign({
|
|
8787
9249
|
className: "wbpanel-body",
|
|
8788
9250
|
key: "body",
|
|
8789
|
-
role
|
|
8790
|
-
|
|
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,
|
|
8791
9255
|
"aria-label": typeof panel.title === "string" ? panel.title : void 0
|
|
8792
9256
|
}, swipeBackProps(panel)), [
|
|
8793
9257
|
kind === "bottom" ? h("div", { key: "grab", ...grabProps(panel) }) : null,
|
|
@@ -8800,14 +9264,25 @@ var require_panel_host = __commonJS({
|
|
|
8800
9264
|
]) : null,
|
|
8801
9265
|
h("div", { className: "wbpanel-content", key: "content" }, typeof panel.render === "function" ? panel.render({ close: function() {
|
|
8802
9266
|
store.pop(panel.id);
|
|
8803
|
-
}, 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
|
|
8804
9271
|
])
|
|
8805
9272
|
]);
|
|
8806
9273
|
}
|
|
8807
9274
|
return h("div", { className: "wbpanel-host", style: { display: "contents" } }, [
|
|
8808
|
-
h("div", {
|
|
8809
|
-
|
|
8810
|
-
|
|
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)
|
|
8811
9286
|
].concat(list.map(renderPanel)));
|
|
8812
9287
|
}
|
|
8813
9288
|
module2.exports = {
|
|
@@ -9168,7 +9643,10 @@ var require_sticky_bar = __commonJS({
|
|
|
9168
9643
|
".wbbar[data-tone=accent]{border-top-color:color-mix(in oklab,var(--wb-accent) 45%,var(--wb-line))}",
|
|
9169
9644
|
".wbbar-grow{flex:1;min-width:0}",
|
|
9170
9645
|
".wbbar .wbcard-btn,.wbbar button{min-height:40px}",
|
|
9171
|
-
".wbbar-note{flex:1;min-width:0;font-size:12px;color:var(--wb-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"
|
|
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}"
|
|
9172
9650
|
].join("\n");
|
|
9173
9651
|
function spacerStyle(extra) {
|
|
9174
9652
|
var pad = Number(extra) > 0 ? Number(extra) : 0;
|
|
@@ -9179,6 +9657,7 @@ var require_sticky_bar = __commonJS({
|
|
|
9179
9657
|
return h("div", {
|
|
9180
9658
|
className: "wbbar" + (props.className ? " " + props.className : ""),
|
|
9181
9659
|
"data-tone": props.tone || "default",
|
|
9660
|
+
"data-flow": props.flow || "fixed",
|
|
9182
9661
|
role: "toolbar",
|
|
9183
9662
|
"aria-label": props.label
|
|
9184
9663
|
}, [
|
|
@@ -9489,36 +9968,10 @@ var require_styles = __commonJS({
|
|
|
9489
9968
|
".wbtx-slot-note{color:var(--wbt-muted,var(--wb-muted))}",
|
|
9490
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}",
|
|
9491
9970
|
".wbt-mailback{font-size:11.5px;padding:2px 7px}",
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
".wbtc-sum{font-size:12px;color:var(--wb-muted);white-space:nowrap}",
|
|
9497
|
-
".wbtc-crumbs{display:flex;min-width:0;flex:1;overflow:hidden}",
|
|
9498
|
-
".wbtc-desc{font-size:12px;color:var(--wb-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
9499
|
-
".wbtc-list{display:flex;flex-direction:column;gap:10px;min-height:0;flex:1}",
|
|
9500
|
-
".wbtc-sheet{display:flex;flex-direction:column;gap:8px;min-height:0;flex:1;overflow:auto}",
|
|
9501
|
-
".wbtc-sheet .wbt-filter-panel{width:100%;max-height:none;flex:1;border:0;padding:0}",
|
|
9502
|
-
".wbtc-sheet .wbt-filter-toggle{display:none}",
|
|
9503
|
-
".wbtc-foot-acts{display:flex;gap:8px;flex-wrap:wrap;align-items:center}",
|
|
9504
|
-
".wbtc-detail{display:flex;flex-direction:column;gap:10px;min-height:0;flex:1;overflow:auto}",
|
|
9505
|
-
".wbtc-pagerinfo{font-size:12px;color:var(--wb-muted);white-space:nowrap}",
|
|
9506
|
-
".wbtc-card{cursor:pointer;border:1px solid var(--wb-line);border-radius:10px;background:var(--wb-card);padding:10px 10px 9px}",
|
|
9507
|
-
// 长按快捷菜单:一列整行按钮,触屏上比网格好点。
|
|
9508
|
-
".wbtc-actions{display:flex;flex-direction:column;gap:8px;padding:4px 0 calc(8px + var(--wb-safe-bottom,0px))}",
|
|
9509
|
-
".wbtc-actions .wbt-btn{min-height:var(--wb-btn-toolbar,32px);justify-content:flex-start;padding:0 12px;font-size:14px}",
|
|
9510
|
-
".wbtc-card:hover{border-color:var(--wb-border)}",
|
|
9511
|
-
".wbtc-card-inner{display:flex;align-items:flex-start;gap:8px}",
|
|
9512
|
-
".wbtc-card-body{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}",
|
|
9513
|
-
".wbtc-card-top{display:flex;align-items:center;gap:6px;min-width:0}",
|
|
9514
|
-
".wbtc-card-title{min-width:0;flex:1;font-size:14px;font-weight:600;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}",
|
|
9515
|
-
".wbtc-card-desc{font-size:12px;color:var(--wb-muted);line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}",
|
|
9516
|
-
".wbtc-card-tags{display:flex;flex-wrap:wrap;gap:4px}",
|
|
9517
|
-
".wbtc-card-meta{display:flex;flex-wrap:wrap;gap:4px 10px;font-size:11px;color:var(--wb-muted)}",
|
|
9518
|
-
".wbtc-card-ws{max-width:14em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
9519
|
-
".wbtc-card-go{flex:none;display:flex;align-items:center;color:var(--wb-muted);padding-top:2px}",
|
|
9520
|
-
,
|
|
9521
|
-
require_overlay().sheetStyles
|
|
9971
|
+
require_overlay().sheetStyles,
|
|
9972
|
+
// 窄屏 chips 用 scroll-strip 的横滑容器:少了这份样式,chips 会退化成 block 然后换行。
|
|
9973
|
+
require_scroll_strip().styles,
|
|
9974
|
+
require_compact_styles()
|
|
9522
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");
|
|
9523
9976
|
}
|
|
9524
9977
|
});
|
|
@@ -12270,12 +12723,19 @@ var require_task_filter_panel = __commonJS({
|
|
|
12270
12723
|
var DateFilter = require_date_filter().DateFilter;
|
|
12271
12724
|
var WorkspaceFilter = require_workspacefilter();
|
|
12272
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
|
+
}
|
|
12273
12732
|
module2.exports = function renderFilterPanel(React, p) {
|
|
12274
12733
|
var h = React.createElement, en = p.lang === "en", value = p.value;
|
|
12734
|
+
var D = folds(React);
|
|
12275
12735
|
var title = en ? "Filters" : "\u7B5B\u9009";
|
|
12276
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" };
|
|
12277
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"]];
|
|
12278
|
-
var presetNames =
|
|
12738
|
+
var presetNames = module2.exports.presetNames(p.lang);
|
|
12279
12739
|
var activePreset = model.activePreset(value);
|
|
12280
12740
|
var unitId = p.id + "-unit";
|
|
12281
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" };
|
|
@@ -12420,11 +12880,19 @@ var require_task_filter_panel = __commonJS({
|
|
|
12420
12880
|
setRange("target", next);
|
|
12421
12881
|
} })
|
|
12422
12882
|
),
|
|
12883
|
+
// 发布时间/完成/关闭/接取四组默认折叠:它们很少同时用,全展开会把「状态 + 标签」
|
|
12884
|
+
// 挤出首屏(窄屏整屏 sheet 里尤其明显)。已经填过的组保持展开,别把生效条件藏起来。
|
|
12423
12885
|
model.groups.map(function(key) {
|
|
12886
|
+
var filled = !!(value[key] && (value[key].from || value[key].to));
|
|
12424
12887
|
return h(
|
|
12425
|
-
|
|
12426
|
-
{
|
|
12427
|
-
|
|
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
|
+
},
|
|
12428
12896
|
h(DateFilter, { lang: p.lang, kind: key, value: value[key], onChange: function(next) {
|
|
12429
12897
|
setRange(key, next);
|
|
12430
12898
|
} })
|
|
@@ -12435,6 +12903,9 @@ var require_task_filter_panel = __commonJS({
|
|
|
12435
12903
|
)
|
|
12436
12904
|
);
|
|
12437
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
|
+
};
|
|
12438
12909
|
}
|
|
12439
12910
|
});
|
|
12440
12911
|
|
|
@@ -13319,6 +13790,18 @@ var require_tasks_state = __commonJS({
|
|
|
13319
13790
|
else next.add(String(id));
|
|
13320
13791
|
setExpanded(next);
|
|
13321
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
|
+
}
|
|
13322
13805
|
function addNode(parentId, type) {
|
|
13323
13806
|
setNodeModal({ parentId, type, node: null });
|
|
13324
13807
|
}
|
|
@@ -13681,6 +14164,7 @@ var require_tasks_state = __commonJS({
|
|
|
13681
14164
|
pickNode,
|
|
13682
14165
|
pickPath,
|
|
13683
14166
|
toggleExpanded,
|
|
14167
|
+
expandIds,
|
|
13684
14168
|
addNode,
|
|
13685
14169
|
nodeSaved,
|
|
13686
14170
|
renameNode,
|
|
@@ -14219,389 +14703,1213 @@ var require_tasks_wide_layout = __commonJS({
|
|
|
14219
14703
|
}
|
|
14220
14704
|
});
|
|
14221
14705
|
|
|
14222
|
-
// packages/addons/tasks/client/
|
|
14223
|
-
var
|
|
14224
|
-
"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) {
|
|
14225
14709
|
"use strict";
|
|
14226
|
-
|
|
14227
|
-
|
|
14228
|
-
|
|
14229
|
-
var
|
|
14230
|
-
var statusInfo = deps.statusInfo;
|
|
14231
|
-
var
|
|
14232
|
-
var
|
|
14233
|
-
|
|
14234
|
-
|
|
14235
|
-
|
|
14236
|
-
|
|
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);
|
|
14237
14727
|
}
|
|
14238
|
-
|
|
14728
|
+
function TopBar(props) {
|
|
14239
14729
|
var t = props.t;
|
|
14240
|
-
|
|
14241
|
-
|
|
14242
|
-
|
|
14243
|
-
var openLike = String(task.status) === "0" || String(task.status) === "4";
|
|
14244
|
-
var myTags = Array.isArray(task.tags) ? task.tags : [];
|
|
14245
|
-
var shown = myTags.slice(0, 3);
|
|
14246
|
-
var rest = myTags.length - shown.length;
|
|
14247
|
-
var meta = [];
|
|
14248
|
-
if (task.publishDate) meta.push(h("span", { key: "p" }, t.publish + " " + task.publishDate));
|
|
14249
|
-
if (task.targetDate) {
|
|
14250
|
-
var cd = openLike ? daysBetween(task.targetDate) : null;
|
|
14251
|
-
meta.push(h("span", { key: "g" }, t.target + " " + task.targetDate + (cd == null ? "" : " \xB7 " + cd + "d")));
|
|
14252
|
-
} else if (task.doneDate) {
|
|
14253
|
-
meta.push(h("span", { key: "d" }, t.done + " " + task.doneDate));
|
|
14254
|
-
}
|
|
14255
|
-
if (Number(task.difficulty) > 0) {
|
|
14256
|
-
meta.push(h("span", { key: "s", className: "wbt-stars" }, stars(task.difficulty)));
|
|
14257
|
-
}
|
|
14258
|
-
var ws = Array.isArray(task.workspaces) && task.workspaces.length ? task.workspaces[0] : null;
|
|
14259
|
-
if (ws) meta.push(h("span", { key: "w", className: "wbtc-card-ws", title: ws.dir || "" }, ws.title || ws.id));
|
|
14260
|
-
var desc = preview(task.description);
|
|
14261
|
-
return h(
|
|
14262
|
-
"div",
|
|
14263
|
-
{ className: "wbtc-card-inner" },
|
|
14264
|
-
props.selectionMode ? h("input", {
|
|
14265
|
-
type: "checkbox",
|
|
14266
|
-
className: "wbt-check",
|
|
14267
|
-
checked: !!props.checked,
|
|
14268
|
-
onChange: function() {
|
|
14269
|
-
props.onCheck(task.id);
|
|
14270
|
-
},
|
|
14271
|
-
onClick: function(e) {
|
|
14272
|
-
e.stopPropagation();
|
|
14273
|
-
}
|
|
14274
|
-
}) : null,
|
|
14275
|
-
h(
|
|
14730
|
+
if (props.selection) {
|
|
14731
|
+
var sel = props.selection;
|
|
14732
|
+
return h(
|
|
14276
14733
|
"div",
|
|
14277
|
-
{ className: "wbtc-
|
|
14734
|
+
{ className: "wbtc-top", role: "toolbar", "aria-label": t.select },
|
|
14735
|
+
h(IconButton, { name: "close", label: t.cancelSelect, onClick: sel.onCancel }),
|
|
14278
14736
|
h(
|
|
14279
14737
|
"div",
|
|
14280
|
-
{ className: "wbtc-
|
|
14281
|
-
|
|
14282
|
-
h("
|
|
14283
|
-
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))
|
|
14284
14741
|
),
|
|
14285
|
-
|
|
14286
|
-
|
|
14287
|
-
|
|
14288
|
-
|
|
14289
|
-
|
|
14290
|
-
|
|
14291
|
-
|
|
14292
|
-
|
|
14293
|
-
|
|
14294
|
-
|
|
14295
|
-
|
|
14296
|
-
|
|
14297
|
-
|
|
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
|
+
);
|
|
14747
|
+
}
|
|
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
|
+
);
|
|
14778
|
+
}
|
|
14779
|
+
return h(
|
|
14780
|
+
"div",
|
|
14781
|
+
{ className: "wbtc-top", role: "toolbar" },
|
|
14782
|
+
h(IconButton, { name: "left", label: t.back, onClick: props.onBack, disabled: props.backDisabled }),
|
|
14783
|
+
h(
|
|
14784
|
+
"button",
|
|
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
|
|
14298
14793
|
),
|
|
14299
|
-
h(
|
|
14794
|
+
h(IconButton, { name: "search", label: t.search, onClick: props.onSearch }),
|
|
14795
|
+
h(IconButton, { name: "more", label: t.more, onClick: props.onMore })
|
|
14300
14796
|
);
|
|
14301
|
-
}
|
|
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 },
|
|
14836
|
+
h("button", {
|
|
14837
|
+
type: "button",
|
|
14838
|
+
className: "wbtc-chip",
|
|
14839
|
+
"aria-pressed": all,
|
|
14840
|
+
onClick: function() {
|
|
14841
|
+
props.onChange(filters.toggle(value, "all"));
|
|
14842
|
+
}
|
|
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,
|
|
14853
|
+
onClick: function() {
|
|
14854
|
+
props.onChange(filters.toggle(value, id));
|
|
14855
|
+
}
|
|
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
|
+
}),
|
|
14884
|
+
h("button", {
|
|
14885
|
+
type: "button",
|
|
14886
|
+
className: "wbtc-more",
|
|
14887
|
+
"aria-expanded": open,
|
|
14888
|
+
onClick: function() {
|
|
14889
|
+
setOpen(!open);
|
|
14890
|
+
}
|
|
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 };
|
|
14302
14896
|
};
|
|
14303
14897
|
}
|
|
14304
14898
|
});
|
|
14305
14899
|
|
|
14306
|
-
// packages/addons/tasks/client/views/
|
|
14307
|
-
var
|
|
14308
|
-
"packages/addons/tasks/client/views/
|
|
14309
|
-
|
|
14310
|
-
|
|
14311
|
-
|
|
14312
|
-
var
|
|
14313
|
-
var
|
|
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;
|
|
14314
14908
|
var SB = require_sticky_bar();
|
|
14315
|
-
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14319
|
-
|
|
14320
|
-
|
|
14321
|
-
|
|
14322
|
-
|
|
14323
|
-
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
|
|
14332
|
-
|
|
14333
|
-
|
|
14334
|
-
|
|
14335
|
-
|
|
14336
|
-
|
|
14337
|
-
|
|
14338
|
-
onEdit: function(x) {
|
|
14339
|
-
m.setEditTask(x);
|
|
14340
|
-
},
|
|
14341
|
-
onDone: function(x) {
|
|
14342
|
-
m.setDoneTask(x);
|
|
14343
|
-
},
|
|
14344
|
-
onRestart: function(x) {
|
|
14345
|
-
m.setCreateState({ source: "2", originTask: x });
|
|
14346
|
-
},
|
|
14347
|
-
onTimeline: function(x) {
|
|
14348
|
-
m.setTimelineTask(x);
|
|
14349
|
-
},
|
|
14350
|
-
onDelete: m.deleteTask,
|
|
14351
|
-
onPathPick: m.pickPath,
|
|
14352
|
-
onTagPick: m.toggleTagId
|
|
14353
|
-
};
|
|
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;
|
|
14354
14932
|
}
|
|
14355
|
-
function
|
|
14356
|
-
|
|
14357
|
-
|
|
14358
|
-
|
|
14359
|
-
|
|
14360
|
-
|
|
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);
|
|
14361
15002
|
return h(
|
|
14362
15003
|
"div",
|
|
14363
|
-
{
|
|
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 })),
|
|
14364
15021
|
h(
|
|
14365
|
-
"
|
|
14366
|
-
{
|
|
14367
|
-
|
|
14368
|
-
className: "
|
|
14369
|
-
ref: m.treeSearchRef,
|
|
14370
|
-
placeholder: t.treeSearch,
|
|
14371
|
-
value: m.treeQuery,
|
|
14372
|
-
onChange: function(e) {
|
|
14373
|
-
m.setTreeQuery(e.target.value);
|
|
14374
|
-
}
|
|
14375
|
-
}),
|
|
14376
|
-
m.treeQuery ? h("button", {
|
|
14377
|
-
className: "wbt-search-clear",
|
|
14378
|
-
title: t.clear,
|
|
14379
|
-
"aria-label": t.clear,
|
|
15022
|
+
"button",
|
|
15023
|
+
{
|
|
15024
|
+
type: "button",
|
|
15025
|
+
className: "wbtc-node-main",
|
|
14380
15026
|
onClick: function() {
|
|
14381
|
-
|
|
15027
|
+
pick(node);
|
|
14382
15028
|
}
|
|
14383
|
-
},
|
|
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
|
|
14384
15033
|
),
|
|
14385
|
-
h("
|
|
14386
|
-
h(
|
|
14387
|
-
"div",
|
|
14388
|
-
{ className: "wbtc-foot-acts" },
|
|
14389
|
-
h(
|
|
14390
|
-
"button",
|
|
14391
|
-
{ className: "wbt-addbtn", onClick: function() {
|
|
14392
|
-
if (m.footGroupId) m.addNode(m.footGroupId, "0");
|
|
14393
|
-
} },
|
|
14394
|
-
h(Icon2, { name: "folderPlus", size: 13 }),
|
|
14395
|
-
t.addGroup
|
|
14396
|
-
),
|
|
14397
|
-
h(
|
|
14398
|
-
"button",
|
|
14399
|
-
{ className: "wbt-addbtn", onClick: function() {
|
|
14400
|
-
if (m.footGroupId) m.addNode(m.footGroupId, "1");
|
|
14401
|
-
} },
|
|
14402
|
-
h(Icon2, { name: "filePlus", size: 13 }),
|
|
14403
|
-
t.addTable
|
|
14404
|
-
),
|
|
14405
|
-
h(
|
|
14406
|
-
"button",
|
|
14407
|
-
{ className: "wbt-addbtn", onClick: function() {
|
|
14408
|
-
m.setManager(!m.manager);
|
|
14409
|
-
} },
|
|
14410
|
-
h(Icon2, { name: "pencil", size: 13 }),
|
|
14411
|
-
t.manager
|
|
14412
|
-
),
|
|
14413
|
-
h("button", { className: "wbt-addbtn", onClick: panel.close }, t.close)
|
|
14414
|
-
)
|
|
15034
|
+
cur ? h("span", { className: "wbtc-node-dot", "aria-hidden": true }) : null
|
|
14415
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();
|
|
14416
15072
|
}
|
|
14417
|
-
})
|
|
14418
|
-
|
|
14419
|
-
|
|
14420
|
-
|
|
14421
|
-
|
|
14422
|
-
|
|
14423
|
-
|
|
14424
|
-
|
|
14425
|
-
|
|
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
|
-
}));
|
|
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);
|
|
14459
15082
|
}
|
|
14460
|
-
})
|
|
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",
|
|
15098
|
+
onClick: function() {
|
|
15099
|
+
m.deleteTask(task);
|
|
15100
|
+
props.close();
|
|
15101
|
+
}
|
|
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
|
+
);
|
|
14461
15107
|
}
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14468
|
-
|
|
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();
|
|
14469
15137
|
}
|
|
14470
|
-
})
|
|
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();
|
|
14471
15149
|
}
|
|
14472
|
-
|
|
14473
|
-
var head = h(
|
|
15150
|
+
return h(
|
|
14474
15151
|
"div",
|
|
14475
|
-
{ className: "wbtc-
|
|
14476
|
-
h(
|
|
14477
|
-
|
|
14478
|
-
|
|
14479
|
-
|
|
14480
|
-
|
|
14481
|
-
|
|
14482
|
-
|
|
14483
|
-
),
|
|
14484
|
-
h(
|
|
14485
|
-
|
|
14486
|
-
|
|
14487
|
-
|
|
14488
|
-
|
|
14489
|
-
|
|
14490
|
-
|
|
14491
|
-
|
|
14492
|
-
|
|
14493
|
-
|
|
14494
|
-
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
|
|
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",
|
|
14498
15177
|
onClick: function() {
|
|
14499
|
-
|
|
14500
|
-
|
|
15178
|
+
run(function() {
|
|
15179
|
+
m.setSelectionMode(true);
|
|
15180
|
+
});
|
|
14501
15181
|
}
|
|
14502
|
-
},
|
|
15182
|
+
}, t.select)
|
|
14503
15183
|
);
|
|
14504
|
-
|
|
14505
|
-
|
|
14506
|
-
|
|
14507
|
-
|
|
14508
|
-
|
|
14509
|
-
|
|
14510
|
-
|
|
14511
|
-
|
|
14512
|
-
|
|
14513
|
-
|
|
14514
|
-
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
|
|
14518
|
-
|
|
14519
|
-
|
|
14520
|
-
|
|
14521
|
-
|
|
14522
|
-
|
|
14523
|
-
|
|
14524
|
-
|
|
14525
|
-
|
|
14526
|
-
|
|
14527
|
-
|
|
14528
|
-
|
|
14529
|
-
|
|
14530
|
-
|
|
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
|
+
}
|
|
14531
15248
|
},
|
|
14532
|
-
|
|
14533
|
-
|
|
14534
|
-
|
|
14535
|
-
|
|
14536
|
-
|
|
14537
|
-
|
|
14538
|
-
|
|
14539
|
-
|
|
14540
|
-
|
|
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(
|
|
15266
|
+
"div",
|
|
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 },
|
|
14541
15342
|
h("button", {
|
|
14542
|
-
|
|
14543
|
-
className: "
|
|
15343
|
+
type: "button",
|
|
15344
|
+
className: "wbtc-btn",
|
|
15345
|
+
disabled: none,
|
|
14544
15346
|
onClick: function() {
|
|
14545
|
-
m.
|
|
14546
|
-
return String(x.id);
|
|
14547
|
-
})));
|
|
15347
|
+
m.claimSelected();
|
|
14548
15348
|
}
|
|
14549
|
-
}, t.
|
|
14550
|
-
h("button", { key: "batch", className: "wbt-btn", onClick: function() {
|
|
14551
|
-
m.setBatchMode("timeline");
|
|
14552
|
-
m.setSelectedOpen(true);
|
|
14553
|
-
} }, t.batchTimeline),
|
|
14554
|
-
h("button", { key: "del", className: "wbt-btn danger", onClick: m.batchDelete }, t.del),
|
|
14555
|
-
h("button", { key: "clear", className: "wbt-btn ghost", onClick: m.clearSelection }, t.clear),
|
|
15349
|
+
}, h(Icon2, { name: "check", size: 15 }), t.claimSelected),
|
|
14556
15350
|
h("button", {
|
|
14557
|
-
|
|
14558
|
-
className: "
|
|
15351
|
+
type: "button",
|
|
15352
|
+
className: "wbtc-btn is-danger",
|
|
15353
|
+
disabled: none,
|
|
14559
15354
|
onClick: function() {
|
|
14560
|
-
m.
|
|
14561
|
-
m.clearSelection();
|
|
15355
|
+
m.batchDelete();
|
|
14562
15356
|
}
|
|
14563
|
-
}, t.
|
|
14564
|
-
]
|
|
14565
|
-
}) : h(SB.StickyBar, {
|
|
14566
|
-
h,
|
|
14567
|
-
children: [
|
|
15357
|
+
}, h(Icon2, { name: "trash", size: 15 }), t.batchDelete),
|
|
14568
15358
|
h("button", {
|
|
14569
|
-
|
|
14570
|
-
className: "
|
|
15359
|
+
type: "button",
|
|
15360
|
+
className: "wbtc-btn",
|
|
15361
|
+
disabled: none,
|
|
14571
15362
|
onClick: function() {
|
|
14572
|
-
m.
|
|
15363
|
+
m.openSelected();
|
|
14573
15364
|
}
|
|
14574
|
-
}, h(Icon2, { name: "
|
|
14575
|
-
|
|
14576
|
-
|
|
14577
|
-
|
|
14578
|
-
|
|
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() {
|
|
14579
15381
|
m.setPageNumber(Math.max(1, m.pageNumber - 1));
|
|
14580
|
-
}
|
|
14581
|
-
|
|
14582
|
-
|
|
14583
|
-
m.setPageNumber(Math.min(m.totalPages, m.pageNumber + 1));
|
|
14584
|
-
} }, h(Icon2, { name: "right", size: 14 }))
|
|
14585
|
-
) : null,
|
|
15382
|
+
}
|
|
15383
|
+
}, h(Icon2, { name: "left", size: 17 })),
|
|
15384
|
+
h("span", { className: "wbtc-pageno", "aria-live": "polite" }, m.pageNumber + " / " + pages),
|
|
14586
15385
|
h("button", {
|
|
14587
|
-
|
|
14588
|
-
className: "
|
|
14589
|
-
|
|
14590
|
-
|
|
15386
|
+
type: "button",
|
|
15387
|
+
className: "wbtc-icon",
|
|
15388
|
+
"aria-label": t.page,
|
|
15389
|
+
disabled: m.pageNumber >= pages,
|
|
14591
15390
|
onClick: function() {
|
|
14592
|
-
m.
|
|
15391
|
+
m.setPageNumber(Math.min(pages, m.pageNumber + 1));
|
|
14593
15392
|
}
|
|
14594
|
-
}, h(Icon2, { name: "
|
|
14595
|
-
|
|
14596
|
-
|
|
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
|
+
);
|
|
14597
15578
|
return h(
|
|
14598
15579
|
"div",
|
|
14599
|
-
{ 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" },
|
|
14600
15660
|
h(
|
|
14601
|
-
|
|
14602
|
-
{
|
|
14603
|
-
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
|
+
} })
|
|
14604
15673
|
),
|
|
15674
|
+
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
|
+
})
|
|
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),
|
|
14605
15913
|
renderOverlays(m)
|
|
14606
15914
|
);
|
|
14607
15915
|
}
|
|
@@ -15789,13 +17097,20 @@ var require_timeline_view = __commonJS({
|
|
|
15789
17097
|
var TimelineView = require_timeline_view()({ React, COPY, injectCss, statusInfo, configClient, CFG_FALLBACK, TaskItem, EditModal, DoneModal, TimelineModal, CreateModal });
|
|
15790
17098
|
host.registerAddon({
|
|
15791
17099
|
id: "wb-addon-tasks",
|
|
15792
|
-
version: "5.
|
|
17100
|
+
version: "5.16.0",
|
|
15793
17101
|
icon: ICONS["list-checks"],
|
|
15794
17102
|
// 贡献声明写在 registerAddon 里:卸载任务插件时宿主按 addonId 一起撤销,
|
|
15795
17103
|
// 不会在邮件里留一个渲染即报错的孤儿按钮。
|
|
15796
17104
|
slots: [{ slot: "item.actions", id: "tasks.create-from-mail", order: 100, component: slotTaskFromMessage }],
|
|
15797
17105
|
views: [
|
|
15798
|
-
{
|
|
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
|
+
},
|
|
15799
17114
|
{
|
|
15800
17115
|
id: "tasks",
|
|
15801
17116
|
icon: tabIcon("list"),
|
|
@@ -15812,8 +17127,22 @@ var require_timeline_view = __commonJS({
|
|
|
15812
17127
|
{ id: "compact", when: { maxWidth: 759 }, component: TasksView }
|
|
15813
17128
|
]
|
|
15814
17129
|
},
|
|
15815
|
-
|
|
15816
|
-
|
|
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
|
+
}
|
|
15817
17146
|
]
|
|
15818
17147
|
});
|
|
15819
17148
|
module.exports = { name: "dsh-workbench-tasks", inject: [], apply: function() {
|