dsh-workbench-salary 0.4.6 → 0.4.10

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.
Files changed (2) hide show
  1. package/lib/client.js +136 -44
  2. package/package.json +3 -3
package/lib/client.js CHANGED
@@ -39,6 +39,25 @@ var __copyProps = (to, from, except, desc) => {
39
39
  };
40
40
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
41
41
 
42
+ // packages/addons/lib/icon-label.cjs
43
+ var require_icon_label = __commonJS({
44
+ "packages/addons/lib/icon-label.cjs"(exports2, module2) {
45
+ "use strict";
46
+ var VISUALLY_HIDDEN = "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap";
47
+ module2.exports = function iconLabel(h, Icon2, text, options) {
48
+ var opts = options || {};
49
+ var cls = "wb-icon-label" + (opts.short ? " wb-icon-label-short" : "") + (Icon2 ? "" : " wb-icon-label-fallback");
50
+ return h(
51
+ "span",
52
+ { className: cls, title: typeof text === "string" ? text : void 0 },
53
+ Icon2 ? h(Icon2, { size: 14, strokeWidth: 2, "aria-hidden": true, focusable: false }) : null,
54
+ h("span", { className: "wb-icon-label-text" }, text)
55
+ );
56
+ };
57
+ module2.exports.styles = ".wb-icon-label{display:inline-flex;align-items:center;gap:5px;max-width:100%;vertical-align:middle;text-align:start}.wb-icon-label>svg{flex:none}.wb-icon-label>span{min-width:0;overflow-wrap:anywhere}button .wb-icon-label:not(.wb-icon-label-fallback) .wb-icon-label-text{" + VISUALLY_HIDDEN + "}button .wb-icon-label.wb-icon-label-short .wb-icon-label-text{position:static;width:auto;height:auto;margin:0;overflow:visible;clip-path:none;white-space:normal}";
58
+ }
59
+ });
60
+
42
61
  // packages/addons/lib/icons.cjs
43
62
  var require_icons = __commonJS({
44
63
  "packages/addons/lib/icons.cjs"(exports2, module2) {
@@ -62,6 +81,11 @@ var require_icons = __commonJS({
62
81
  return h(C, attrs);
63
82
  }
64
83
  var set = { ICONS, Icon: Icon2 };
84
+ set.label = function(name, text, options2) {
85
+ return require_icon_label()(h, function NamedIcon(props) {
86
+ return h(Icon2, Object.assign({ name }, props));
87
+ }, text, options2);
88
+ };
65
89
  if (opts.tabIcon) {
66
90
  set.tabIcon = function(name) {
67
91
  return function TabIcon() {
@@ -469,6 +493,29 @@ var init_wallet = __esm({
469
493
  }
470
494
  });
471
495
 
496
+ // node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/plus.mjs
497
+ var plus_exports = {};
498
+ __export(plus_exports, {
499
+ __iconData: () => __iconData5,
500
+ default: () => Plus
501
+ });
502
+ var __iconData5, Plus;
503
+ var init_plus = __esm({
504
+ "node_modules/.pnpm/lucide-react@1.70.0_react@19.2.0/node_modules/lucide-react/dist/esm/icons/plus.mjs"() {
505
+ init_createLucideIcon();
506
+ __iconData5 = {
507
+ name: "plus",
508
+ size: 24,
509
+ node: [
510
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
511
+ ["path", { d: "M12 5v14", key: "s699le" }]
512
+ ]
513
+ };
514
+ __iconData5.node;
515
+ Plus = createLucideIcon(__iconData5);
516
+ }
517
+ });
518
+
472
519
  // packages/addons/salary/client/ui/icons.cjs
473
520
  var require_icons2 = __commonJS({
474
521
  "packages/addons/salary/client/ui/icons.cjs"(exports2, module2) {
@@ -478,9 +525,10 @@ var require_icons2 = __commonJS({
478
525
  "chart-column": (init_chart_column(), __toCommonJS(chart_column_exports)).default,
479
526
  "database": (init_database(), __toCommonJS(database_exports)).default,
480
527
  "list": (init_list(), __toCommonJS(list_exports)).default,
481
- "wallet": (init_wallet(), __toCommonJS(wallet_exports)).default
528
+ "wallet": (init_wallet(), __toCommonJS(wallet_exports)).default,
529
+ "plus": (init_plus(), __toCommonJS(plus_exports)).default
482
530
  });
483
- module2.exports = { ICONS: set.ICONS, Icon: set.Icon };
531
+ module2.exports = { ICONS: set.ICONS, Icon: set.Icon, label: set.label };
484
532
  }
485
533
  });
486
534
 
@@ -512,18 +560,21 @@ var require_client_base_styles = __commonJS({
512
560
  s + "-table th{font-weight:600;color:var(--wb-muted,#6b7280);white-space:nowrap}",
513
561
  s + "-btn{border:1px solid var(--wb-border,#d1d5db);background:var(--wb-surface,#fff);color:inherit;border-radius:7px;padding:5px 10px;font-size:12px;cursor:pointer}",
514
562
  s + "-btn:hover:not(:disabled){border-color:var(--wb-accent,#2563eb)}" + s + "-btn:disabled{opacity:.5;cursor:default}",
515
- s + "-btn.primary{background:var(--wb-accent,#2563eb);border-color:var(--wb-accent,#2563eb);color:#fff}",
516
- s + "-btn.danger{color:#b91c1c;border-color:#fecaca}",
563
+ s + "-btn.primary{background:var(--wb-accent,#2563eb);border-color:var(--wb-accent,#2563eb);color:var(--dsw-alias-label-primary-inverted,#fff)}",
564
+ s + "-btn.danger{color:var(--wb-danger,#b91c1c);border-color:color-mix(in oklab,var(--wb-danger,#b91c1c) 35%,transparent)}",
517
565
  s + "-field{display:flex;flex-direction:column;gap:4px;font-size:12px}" + s + "-label{font-weight:600}",
518
566
  s + "-field input," + s + "-field select," + s + "-field textarea{border:1px solid var(--wb-border,#d1d5db);border-radius:7px;padding:6px 8px;font:inherit;background:var(--wb-surface,#fff);color:inherit;min-width:0}",
519
- s + "-hint{color:var(--wb-muted,#6b7280);font-size:11px}" + s + "-notice{padding:8px 10px;border-radius:8px;font-size:12px;background:#eff6ff;color:#1e40af}",
520
- s + "-notice.error{background:#fef2f2;color:#b91c1c}" + s + "-notice.ok{background:#ecfdf5;color:#047857}",
567
+ s + "-hint{color:var(--wb-muted,#6b7280);font-size:11px}" + s + "-notice{padding:8px 10px;border-radius:8px;font-size:12px;background:color-mix(in oklab,var(--wb-accent,#2563eb) 9%,transparent);color:var(--dsw-alias-label-primary,inherit)}",
568
+ s + "-notice.error{background:color-mix(in oklab,var(--wb-danger,#b91c1c) 10%,transparent);color:var(--wb-danger,#b91c1c)}" + s + "-notice.ok{background:color-mix(in oklab,var(--wb-ok,#047857) 10%,transparent);color:var(--wb-ok,#047857)}",
521
569
  s + "-empty{padding:18px;text-align:center;color:var(--wb-muted,#6b7280);font-size:12px;border:1px dashed var(--wb-border,#e5e7eb);border-radius:8px}",
522
- s + "-pill{display:inline-block;padding:1px 7px;border-radius:999px;font-size:11px;background:#f3f4f6;color:#374151}",
523
- s + "-pill.ok{background:#ecfdf5;color:#047857}" + s + "-pill.error{background:#fef2f2;color:#b91c1c}" + s + "-pill.warn{background:#fffbeb;color:#b45309}",
524
- s + "-json{margin:0;padding:8px;background:#f8fafc;border-radius:8px;font-size:11px;max-height:240px;overflow:auto}",
570
+ s + "-pill{display:inline-block;padding:1px 7px;border-radius:999px;font-size:11px;background:color-mix(in oklab,currentColor 7%,transparent);color:inherit}",
571
+ s + "-pill.ok{background:color-mix(in oklab,var(--wb-ok,#047857) 12%,transparent);color:var(--wb-ok,#047857)}" + s + "-pill.error{background:color-mix(in oklab,var(--wb-danger,#b91c1c) 12%,transparent);color:var(--wb-danger,#b91c1c)}" + s + "-pill.warn{background:color-mix(in oklab,var(--wb-warn,#b45309) 14%,transparent);color:var(--wb-warn,#b45309)}",
572
+ s + "-json{margin:0;padding:8px;background:color-mix(in oklab,currentColor 4%,transparent);border-radius:8px;font-size:11px;max-height:240px;overflow:auto}",
525
573
  s + "-muted{color:var(--wb-muted,#6b7280)}" + s + "-link{color:var(--wb-accent,#2563eb);cursor:pointer;text-decoration:none}",
526
- s + "-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}"
574
+ s + "-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}",
575
+ // 窄屏:页面容器不再自带左右内边距(宿主的 .wb-immersive-main 已经给过),
576
+ // 卡片与栅格收紧,把宽度尽量留给内容——窄屏下两侧留白比桌面更影响可读性。
577
+ "@media(max-width:760px){" + s + "-wrap{padding:0 0 8px;gap:10px}" + s + "-card{padding:12px;border-radius:10px}" + s + "-grid{grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px}" + s + "-form{grid-template-columns:minmax(0,1fr)}" + s + "-title{font-size:15px}" + s + "-btn." + s + "-icon-text ." + s + "-btn-label{display:none}" + s + "-btn." + s + "-icon-text{padding-left:8px;padding-right:8px}" + s + "-table-wrap{overflow-x:auto;max-width:100%}" + s + "-table{width:max-content;min-width:100%}}button .wb-icon-label:not(.wb-icon-label-fallback) .wb-icon-label-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}button .wb-icon-label.wb-icon-label-short .wb-icon-label-text{position:static;width:auto;height:auto;margin:0;overflow:visible;clip-path:none;white-space:normal}@media(max-width:420px){" + s + "-wrap{padding:0 0 6px}" + s + "-card{padding:10px}" + s + "-grid{grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}}"
527
578
  ]);
528
579
  };
529
580
  module2.exports.secretFieldStyles = SECRET_FIELD;
@@ -1223,7 +1274,7 @@ var require_styles = __commonJS({
1223
1274
  ".wbsal-field{display:flex;flex-direction:column;gap:4px;font-size:12px;min-width:0}",
1224
1275
  ".wbsal-label{font-size:11.5px;font-weight:600;color:var(--wb-muted,#8b94a6)}",
1225
1276
  ".wbsal-hint{font-size:11px;color:var(--wb-muted,#8b94a6)}",
1226
- ".wbsal-muted{font-size:12px;color:var(--wb-muted,#8b94a6)}",
1277
+ ".wbsal-muted{font-size:12px;color:var(--wb-muted,#8b94a6);min-width:0;overflow-wrap:anywhere}",
1227
1278
  ".wbsal-danger{color:var(--wb-danger,#b91c1c);font-size:12px}",
1228
1279
  /* 月份分组 + 记录表 */
1229
1280
  ".wbsal-months{display:flex;flex-direction:column;gap:10px}",
@@ -1406,7 +1457,10 @@ var require_styles = __commonJS({
1406
1457
  /* 响应式 */
1407
1458
  "@media (max-width:1100px){.wbsal-detail{grid-template-columns:repeat(2,minmax(0,1fr))}}",
1408
1459
  "@media (max-width:900px){.wbsal-table th.hide-md,.wbsal-table td.hide-md{display:none}}",
1409
- "@media (max-width:760px){.wbsal-detail{grid-template-columns:minmax(0,1fr)}.wbsal-page{padding:16px 14px 36px}.wbsal-table th,.wbsal-table td{padding:9px 10px}.wbsal-opt,.wbsal-table th.opt{display:none}.wbsal-comp-row{grid-template-columns:80px minmax(50px,1fr) 112px}.wbsal-chart{height:170px}}"
1460
+ "@media (max-width:760px){.wbsal-detail{grid-template-columns:minmax(0,1fr)}.wbsal-page{padding:0 0 32px}.wbsal-table th,.wbsal-table td{padding:9px 10px}.wbsal-opt,.wbsal-table th.opt{display:none}.wbsal-comp-row{grid-template-columns:80px minmax(50px,1fr) 112px}.wbsal-chart{height:170px}.wbsal-month{flex-wrap:wrap;gap:2px}.wbsal-toolbar{padding:10px 12px}}",
1461
+ // 手机宽度:记录表只留「发薪日 / 实发 / 展开」三列。结算方式与用工类型在展开详情里已有,
1462
+ // 不再和金额抢宽度;表格外层允许横向滚动兜底,避免列被直接裁掉。
1463
+ "@media (max-width:600px){.wbsal-c-cycle,.wbsal-c-emp{display:none}.wbsal-table-wrap{overflow-x:auto}.wbsal-toolbar{flex-direction:column;align-items:stretch;gap:10px}.wbsal-toolbar .wbsal-field{width:100%}.wbsal-toolbar .wbsal-input{width:100%;box-sizing:border-box}.wbsal-toolbar-end{margin-left:0;justify-content:space-between}.wbsal-month-total{font-size:11.5px}.wbsal-record-row td{padding-top:8px;padding-bottom:8px}}"
1410
1464
  ];
1411
1465
  var DATE = require_date_picker_styles()("wbsal");
1412
1466
  var AMOUNT = [
@@ -1420,12 +1474,43 @@ var require_styles = __commonJS({
1420
1474
  }
1421
1475
  });
1422
1476
 
1477
+ // packages/addons/lib/inject-styles.cjs
1478
+ var require_inject_styles = __commonJS({
1479
+ "packages/addons/lib/inject-styles.cjs"(exports2, module2) {
1480
+ "use strict";
1481
+ function toCss(value) {
1482
+ var v = typeof value === "function" ? value() : value;
1483
+ if (Array.isArray(v)) return v.filter(Boolean).join("\n");
1484
+ if (v === null || v === void 0) return "";
1485
+ return String(v);
1486
+ }
1487
+ module2.exports = function injectStyles(options) {
1488
+ var opts = options || {};
1489
+ var css = toCss(opts.css);
1490
+ if (typeof document === "undefined" || !document.head) return "";
1491
+ var id = opts.id;
1492
+ var old = id ? document.getElementById(id) : null;
1493
+ if (old) {
1494
+ if (old.textContent !== css) old.textContent = css;
1495
+ return css;
1496
+ }
1497
+ var style = document.createElement("style");
1498
+ if (id) style.id = id;
1499
+ if (opts.addon) style.setAttribute("data-wb-addon", opts.addon);
1500
+ style.textContent = css;
1501
+ document.head.appendChild(style);
1502
+ return css;
1503
+ };
1504
+ module2.exports.toCss = toCss;
1505
+ }
1506
+ });
1507
+
1423
1508
  // packages/addons/lib/switch.cjs
1424
1509
  var require_switch = __commonJS({
1425
1510
  "packages/addons/lib/switch.cjs"(exports2, module2) {
1426
1511
  "use strict";
1427
1512
  var SWITCH_STYLES = [
1428
- ".wbctl-switch{display:inline-flex;align-items:center;gap:7px;min-height:24px;padding:2px;border:0;background:transparent;font:inherit;font-size:12px;color:var(--wb-muted,#6b7280);cursor:pointer;user-select:none;border-radius:999px}",
1513
+ ".wbctl-switch{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;min-height:24px;padding:2px;border:0;background:transparent;font:inherit;font-size:12px;color:var(--wb-muted,#6b7280);cursor:pointer;user-select:none;border-radius:999px}",
1429
1514
  ".wbctl-switch-track{position:relative;display:inline-flex;align-items:center;box-sizing:border-box;width:34px;height:20px;padding:2px;border-radius:999px;background:color-mix(in oklab,currentColor 22%,transparent);transition:background .16s ease;flex:none}",
1430
1515
  ".wbctl-switch-knob{display:block;width:16px;height:16px;border-radius:50%;background:var(--wb-card,#fff);box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .16s ease}",
1431
1516
  ".wbctl-switch[aria-checked=true]{color:var(--wb-accent,#2563eb)}",
@@ -3500,6 +3585,7 @@ var require_records = __commonJS({
3500
3585
  "use strict";
3501
3586
  var staged = require_staged_dialog();
3502
3587
  var salaryCommon = require_common();
3588
+ var salaryIcons = require_icons2();
3503
3589
  var NF = require_number_field();
3504
3590
  var FormDialog = staged.createStagedDialog({
3505
3591
  maskClass: "wbsal-mask",
@@ -3988,12 +4074,12 @@ var require_records = __commonJS({
3988
4074
  h("td", { className: "left" }, h("span", { className: "wbsal-date" }, h("b", null, String(item.payDate).slice(5)), h("span", null, F.weekday(item.payDate)))),
3989
4075
  h(
3990
4076
  "td",
3991
- { className: "left" },
4077
+ { className: "left wbsal-c-cycle" },
3992
4078
  h(C.Pill, { h, kind: item.cycle === "daily" ? "warn" : "ok" }, item.cycle === "daily" ? "\u65E5\u7ED3" : "\u6708\u7ED3"),
3993
4079
  h("div", { className: "wbsal-muted" }, item.incomePeriod ? F.monthLabel(item.incomePeriod) : "\u672A\u5F52\u5C5E")
3994
4080
  ),
3995
- h("td", { className: "left" }, h(C.Pill, { h, kind: item.employmentType === "regular" ? "ok" : item.employmentType === "probation" ? "warn" : "" }, F.employmentLabel(item.employmentType))),
3996
- h("td", null, h("span", { className: "wbsal-net" }, F.money(item.netPay))),
4081
+ h("td", { className: "left wbsal-c-emp" }, h(C.Pill, { h, kind: item.employmentType === "regular" ? "ok" : item.employmentType === "probation" ? "warn" : "" }, F.employmentLabel(item.employmentType))),
4082
+ h("td", { className: "wbsal-c-net" }, h("span", { className: "wbsal-net" }, F.money(item.netPay))),
3997
4083
  h("td", { className: "wbsal-opt" }, F.money(item.grossPay)),
3998
4084
  h("td", { className: "wbsal-opt hide-md" }, F.money(F.sumValues(item, F.SOCIAL_KEYS))),
3999
4085
  h("td", { className: "wbsal-opt hide-md" }, F.money(item.incomeTax)),
@@ -4017,7 +4103,7 @@ var require_records = __commonJS({
4017
4103
  filter.year || filter.cycle || filter.employmentType ? h(C.Btn, { h, onClick: function() {
4018
4104
  setFilter({ year: "", cycle: "", employmentType: "" });
4019
4105
  } }, "\u6E05\u9664\u7B5B\u9009") : null,
4020
- h(C.Btn, { h, kind: "primary", onClick: openCreate }, "\uFF0B \u8BB0\u4E00\u7B14")
4106
+ h(C.Btn, { h, kind: "primary", onClick: openCreate }, salaryIcons.label("plus", "\u8BB0\u8D26", { short: true }))
4021
4107
  )
4022
4108
  );
4023
4109
  } else {
@@ -4050,10 +4136,10 @@ var require_records = __commonJS({
4050
4136
  "tr",
4051
4137
  null,
4052
4138
  h("th", { className: "left" }, "\u53D1\u85AA\u65E5"),
4053
- h("th", { className: "left" }, "\u7ED3\u7B97"),
4054
- h("th", { className: "left" }, "\u7528\u5DE5\u7C7B\u578B"),
4055
- h("th", null, "\u5B9E\u53D1"),
4056
- h("th", null, "\u5E94\u53D1"),
4139
+ h("th", { className: "left wbsal-c-cycle" }, "\u7ED3\u7B97"),
4140
+ h("th", { className: "left wbsal-c-emp" }, "\u7528\u5DE5\u7C7B\u578B"),
4141
+ h("th", { className: "wbsal-c-net" }, "\u5B9E\u53D1"),
4142
+ h("th", { className: "wbsal-opt" }, "\u5E94\u53D1"),
4057
4143
  h("th", { className: "hide-md" }, "\u793E\u4FDD\u516C\u79EF\u91D1"),
4058
4144
  h("th", { className: "hide-md" }, "\u4E2A\u7A0E"),
4059
4145
  h("th", null, "")
@@ -4102,7 +4188,7 @@ var require_records = __commonJS({
4102
4188
  "div",
4103
4189
  { className: "wbsal-toolbar-end" },
4104
4190
  h("span", { className: "wbsal-toolbar-count" }, "\u5171 ", h("b", null, total), " \u7B14"),
4105
- h(C.Btn, { h, kind: "primary", onClick: openCreate }, "\uFF0B \u8BB0\u4E00\u7B14")
4191
+ h(C.Btn, { h, kind: "primary", onClick: openCreate }, salaryIcons.label("plus", "\u8BB0\u8D26", { short: true }))
4106
4192
  )
4107
4193
  ),
4108
4194
  h(C.Notice, { h, kind: msg && msg.kind, text: msg && !form ? msg.text : "" }),
@@ -5334,18 +5420,19 @@ var require_action_schema_style = __commonJS({
5334
5420
  "use strict";
5335
5421
  module2.exports = function(PREFIX, DOMAIN) {
5336
5422
  var P = PREFIX + "-as";
5423
+ var hairline = "1px solid color-mix(in oklab,currentColor 8%,transparent)";
5337
5424
  var CSS = [
5338
5425
  "." + P + "{display:flex;flex-direction:column;gap:12px;width:100%;min-width:0;font-size:13px;color:inherit}",
5339
5426
  "." + P + "-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}",
5340
5427
  "." + P + "-title{font-size:15px;font-weight:660;margin:0}",
5341
- "." + P + "-badge{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--wb-border,#e3e5e9);border-radius:999px;padding:1px 8px;font-size:11px;color:var(--dsw-alias-label-secondary,currentColor);font-variant-numeric:tabular-nums}",
5428
+ "." + P + "-badge{display:inline-flex;align-items:center;gap:4px;max-width:100%;border:1px solid var(--wb-border,#e3e5e9);border-radius:999px;padding:1px 8px;font-size:11px;color:var(--dsw-alias-label-secondary,currentColor);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}",
5342
5429
  "." + P + "-mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px}",
5343
5430
  "." + P + "-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}",
5344
5431
  "." + P + "-search{position:relative;flex:1 1 220px;min-width:0;display:flex;align-items:center}",
5345
5432
  "." + P + "-search input{width:100%;border:1px solid var(--wb-border,#e3e5e9);border-radius:8px;background:var(--wb-surface,var(--dsw-alias-bg-layer-1,transparent));color:inherit;font:inherit;padding:6px 10px 6px 30px}",
5346
5433
  "." + P + "-search input:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f6ef7);outline-offset:1px}",
5347
5434
  "." + P + "-search .wbi-svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--dsw-alias-label-tertiary,inherit)}",
5348
- "." + P + " select{border:1px solid var(--wb-border,#e3e5e9);border-radius:8px;background:var(--wb-surface,var(--dsw-alias-bg-layer-1,transparent));color:inherit;font:inherit;padding:6px 8px}",
5435
+ "." + P + " select{border:1px solid var(--wb-border,#e3e5e9);border-radius:8px;background:var(--wb-surface,var(--dsw-alias-bg-layer-1,transparent));color:inherit;font:inherit;padding:6px 8px;max-width:100%}",
5349
5436
  "." + P + " select:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f6ef7);outline-offset:1px}",
5350
5437
  "." + P + "-list{display:flex;flex-direction:column;gap:8px}",
5351
5438
  "." + P + "-card{border:1px solid var(--wb-border,#e3e5e9);border-radius:10px;padding:10px 12px;background:var(--wb-surface,var(--dsw-alias-bg-layer-1,transparent));display:flex;flex-direction:column;gap:8px;min-width:0}",
@@ -5353,7 +5440,7 @@ var require_action_schema_style = __commonJS({
5353
5440
  "." + P + "-cardmeta{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0;min-height:24px}",
5354
5441
  "." + P + "-cardhead code{font-weight:640;overflow-wrap:anywhere;min-width:0}",
5355
5442
  "." + P + "-hintline{margin:0;color:var(--dsw-alias-label-tertiary,inherit);font-size:11.5px;line-height:1.5}",
5356
- "." + P + "-origins{display:inline-flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}",
5443
+ "." + P + "-origins{display:inline-flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;min-width:0}",
5357
5444
  "." + P + "-origins-label{font-size:11px;color:var(--wb-muted);white-space:nowrap}",
5358
5445
  "." + P + "-origin{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;color:var(--wb-muted);cursor:pointer;user-select:none}",
5359
5446
  // 该 action 本身不支持的来源:整项置灰、不可点,示意「不是没开,是开不了」。
@@ -5361,17 +5448,17 @@ var require_action_schema_style = __commonJS({
5361
5448
  "." + P + "-origin input[type=checkbox]{width:13px;height:13px;margin:0;accent-color:var(--wb-accent);cursor:inherit}",
5362
5449
  "." + P + "-origin input[type=checkbox]:focus-visible{outline:2px solid var(--wb-accent);outline-offset:2px}",
5363
5450
  "." + P + "-locked{border-color:var(--wb-warn,#b7791f);color:var(--wb-warn,#b7791f)}",
5364
- "." + P + "-desc{margin:0;color:var(--dsw-alias-label-secondary,inherit);line-height:1.55;font-size:12.5px}",
5451
+ "." + P + "-desc{margin:0;color:var(--dsw-alias-label-secondary,inherit);line-height:1.55;font-size:12.5px;overflow-wrap:anywhere}",
5365
5452
  // 搜索命中:用品牌色透明度叠加而不是写死浅色,深浅主题都可读;继承文字颜色、不覆盖 ::selection。
5366
5453
  "." + P + " mark." + P + "-hit{background:color-mix(in oklab,var(--dsw-alias-brand-primary,#4f6ef7) 22%,transparent);color:inherit;border-radius:2px;padding:0;font:inherit;box-decoration-break:clone;-webkit-box-decoration-break:clone}",
5367
5454
  "." + P + "-table{width:100%;border-collapse:collapse;font-size:12px;table-layout:auto}",
5368
5455
  "." + P + "-table th{text-align:left;font-weight:620;font-size:11px;letter-spacing:.4px;text-transform:uppercase;color:var(--dsw-alias-label-tertiary,inherit);padding:4px 8px 4px 0;white-space:nowrap}",
5369
- "." + P + "-table td{padding:4px 8px 4px 0;vertical-align:top;border-top:1px solid color-mix(in oklab,currentColor 8%,transparent);line-height:1.5}",
5456
+ "." + P + "-table td{padding:4px 8px 4px 0;vertical-align:top;border-top:" + hairline + ";line-height:1.5;overflow-wrap:anywhere}",
5370
5457
  "." + P + "-req{color:var(--dsw-alias-state-error-primary,#d9534f);font-weight:620}",
5371
5458
  "." + P + "-opt{color:var(--dsw-alias-label-tertiary,inherit)}",
5372
5459
  "." + P + "-none{color:var(--dsw-alias-label-tertiary,inherit);font-size:12px}",
5373
- "." + P + "-example{position:relative;display:flex;flex-direction:column;gap:4px}",
5374
- "." + P + "-examplehead{display:flex;align-items:center;justify-content:space-between;gap:8px}",
5460
+ "." + P + "-example{position:relative;display:flex;flex-direction:column;gap:4px;min-width:0}",
5461
+ "." + P + "-examplehead{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}",
5375
5462
  "." + P + "-pre{margin:0;padding:8px 10px;border-radius:8px;background:var(--dsw-alias-bg-skeleton,#f2f3f5);color:inherit;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;line-height:1.5;overflow:auto;max-height:280px;white-space:pre-wrap;word-break:break-word}",
5376
5463
  "." + P + "-copy{border:1px solid var(--wb-border,#e3e5e9);border-radius:7px;background:transparent;color:inherit;font:inherit;font-size:11.5px;padding:2px 8px;cursor:pointer}",
5377
5464
  "." + P + "-copy:hover{background:var(--dsw-alias-interactive-bg-hover,color-mix(in oklab,currentColor 5%,transparent))}",
@@ -5379,9 +5466,14 @@ var require_action_schema_style = __commonJS({
5379
5466
  "." + P + " details>summary{cursor:pointer;font-size:11.5px;color:var(--dsw-alias-label-secondary,inherit);width:max-content}",
5380
5467
  "." + P + " details>summary:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#4f6ef7);outline-offset:2px}",
5381
5468
  "." + P + "-empty{padding:24px;text-align:center;border:1px dashed var(--wb-border,#e3e5e9);border-radius:10px;color:var(--dsw-alias-label-tertiary,inherit)}",
5382
- "." + P + "-error{padding:12px;border:1px solid var(--dsw-alias-state-error-primary,#d9534f);border-radius:10px;color:var(--dsw-alias-state-error-primary,#d9534f);display:flex;gap:10px;align-items:center}",
5383
- "." + P + "-toast{position:sticky;bottom:8px;align-self:flex-start;border-radius:999px;padding:3px 10px;background:var(--dsw-alias-bg-skeleton,#f2f3f5);font-size:11.5px}",
5384
- "@media(max-width:600px){." + P + "-table thead{display:none}." + P + "-table td{display:block;border-top:0;padding:2px 0}." + P + "-table tr{display:block;border-top:1px solid color-mix(in oklab,currentColor 8%,transparent);padding:4px 0}}"
5469
+ "." + P + "-error{padding:12px;border:1px solid var(--dsw-alias-state-error-primary,#d9534f);border-radius:10px;color:var(--dsw-alias-state-error-primary,#d9534f);display:flex;gap:10px;align-items:center;flex-wrap:wrap;overflow-wrap:anywhere}",
5470
+ "." + P + "-toast{position:sticky;bottom:8px;align-self:flex-start;border-radius:999px;padding:3px 10px;background:var(--dsw-alias-bg-skeleton,#f2f3f5);font-size:11.5px;max-width:100%}",
5471
+ // 窄屏:五列参数表压成一列会丢失列名、且 table 布局按最小内容宽度撑破容器,
5472
+ // 这里整体改成块级网格:每行 = 名称 / 类型 / 必填 + 约束行 + 说明行,行间用细线分隔。
5473
+ "@media(max-width:760px){." + P + "-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:end}." + P + "-search{grid-column:1/-1}." + P + "-toolbar>label{display:flex;flex-direction:column;align-items:stretch;gap:4px;min-width:0}." + P + "-toolbar select{width:100%;min-width:0}." + P + "-cardhead{grid-template-columns:minmax(0,1fr);row-gap:6px}." + P + "-origins{justify-content:flex-start}." + P + "-table{display:block}." + P + "-table thead{display:none}." + P + "-table tbody{display:block}." + P + '-table tr{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"name type need" "extra extra extra" "desc desc desc";column-gap:8px;padding:9px 0;border-top:' + hairline + "}." + P + "-table tr:first-child{border-top:0;padding-top:2px}." + P + "-table tr:last-child{padding-bottom:2px}." + P + "-table td{display:block;border:0;padding:0;min-width:0}." + P + "-table td:empty{display:none}." + P + "-pname{grid-area:name;font-weight:640}." + P + "-ptype{grid-area:type;justify-self:start;align-self:center;color:var(--dsw-alias-label-tertiary,inherit)}." + P + "-pneed{grid-area:need;justify-self:end;align-self:center;font-size:11px;line-height:1.6;white-space:nowrap}." + P + "-pextra{grid-area:extra;margin-top:3px;color:var(--dsw-alias-label-secondary,inherit);line-height:1.55}." + P + "-pdesc{grid-area:desc;margin-top:3px;color:var(--dsw-alias-label-secondary,inherit);line-height:1.55}}",
5474
+ // 中等宽度(521–760px)三个筛选项正好排成一行,避免第三项独占一行显得参差。
5475
+ "@media(min-width:521px) and (max-width:760px){." + P + "-toolbar{grid-template-columns:repeat(3,minmax(0,1fr))}}",
5476
+ "@media(max-width:420px){." + P + "-toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}." + P + "-card{padding:10px}." + P + "-table tr{padding:8px 0}}"
5385
5477
  ].join("\n");
5386
5478
  return function injectCss() {
5387
5479
  if (typeof document === "undefined") return;
@@ -5793,12 +5885,16 @@ var require_action_schema_view = __commonJS({
5793
5885
  return h(
5794
5886
  "tr",
5795
5887
  { key: row.name },
5796
- h("td", { className: P + "-mono" }, Highlight.hit(row.name, kw)),
5797
- h("td", { className: P + "-mono" }, Highlight.hit(row.type, kw)),
5798
- h("td", { className: row.required ? P + "-req" : P + "-opt" }, row.required ? t.required : t.optional),
5888
+ h("td", { className: P + "-mono " + P + "-pname" }, Highlight.hit(row.name, kw)),
5889
+ h("td", { className: P + "-mono " + P + "-ptype" }, Highlight.hit(row.type, kw)),
5890
+ h(
5891
+ "td",
5892
+ { className: row.required ? P + "-req " + P + "-pneed" : P + "-opt " + P + "-pneed" },
5893
+ row.required ? t.required : t.optional
5894
+ ),
5799
5895
  // extra(默认 / 枚举 / 约束)不在过滤 haystack 里,因此也不高亮,保持「显示即命中」口径。
5800
- h("td", { className: P + "-mono" }, extra),
5801
- h("td", null, Highlight.hit(row.description, kw))
5896
+ h("td", { className: P + "-mono " + P + "-pextra" }, extra),
5897
+ h("td", { className: P + "-pdesc" }, Highlight.hit(row.description, kw))
5802
5898
  );
5803
5899
  }
5804
5900
  function originsChips(action) {
@@ -6054,18 +6150,14 @@ var GLYPHS = require_icons2().ICONS;
6054
6150
  return h(Inner, { api: props.api, lang: props.lang === "en" ? "en" : "zh", h, React, title });
6055
6151
  };
6056
6152
  }
6153
+ var injectStyles = require_inject_styles();
6057
6154
  function ensureStyles() {
6058
- if (typeof document === "undefined" || !document.head) return;
6059
- if (document.getElementById("wb-salary-style")) return;
6060
- var style = document.createElement("style");
6061
- style.id = "wb-salary-style";
6062
- style.textContent = CSS;
6063
- document.head.appendChild(style);
6155
+ injectStyles({ id: "wb-salary-style", css: CSS, addon: "wb-addon-salary" });
6064
6156
  }
6065
6157
  ensureStyles();
6066
6158
  host.registerAddon({
6067
6159
  id: "wb-addon-salary",
6068
- version: "0.4.6",
6160
+ version: "0.4.10",
6069
6161
  icon: GLYPHS["wallet"],
6070
6162
  views: [
6071
6163
  { id: "stats", icon: tabIcon("stats"), title: { zh: "\u7EDF\u8BA1", en: "Stats" }, component: withProps(require_stats(), "\u7EDF\u8BA1") },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-workbench-salary",
3
- "version": "0.4.6",
3
+ "version": "0.4.10",
4
4
  "description": "个人工作台工资插件:按发薪日期记录工资构成、扣款与实发",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -16,7 +16,7 @@
16
16
  "addon": {
17
17
  "id": "wb-addon-salary",
18
18
  "title": "工资",
19
- "version": "0.4.6",
19
+ "version": "0.4.10",
20
20
  "minShell": "0.8.0",
21
21
  "tables": [
22
22
  "salary_record"
@@ -43,7 +43,7 @@
43
43
  }
44
44
  },
45
45
  "dependencies": {
46
- "dsh-workbench-host": "^0.10.0"
46
+ "dsh-workbench-host": "^0.10.4"
47
47
  },
48
48
  "dsh": {
49
49
  "bundle": {