@shwfed/config 2.3.13 → 2.3.14

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 (26) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/preview/assets/{config-9eu0BvKT.js → config-5AaI_ax_.js} +1 -1
  3. package/dist/preview/assets/{config-B1jKkIYg.js → config-B0lew-MO.js} +1 -1
  4. package/dist/preview/assets/{config-CVS1PW6h.js → config-C1ZsvtmX.js} +1 -1
  5. package/dist/preview/assets/{config-CDjs2Ohl.js → config-C7FRcZSK.js} +1 -1
  6. package/dist/preview/assets/{config-0UIjgMSM.js → config-C91ZpnXz.js} +1 -1
  7. package/dist/preview/assets/{config-BpTg08Vv.js → config-CDNNJHaU.js} +1 -1
  8. package/dist/preview/assets/{config-f56G9OU7.js → config-CJI9Ijy5.js} +1 -1
  9. package/dist/preview/assets/{config-DoQjG5TI.js → config-CKIUta3m.js} +1 -1
  10. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-DbnaeqGK.js → definition.vue_vue_type_script_setup_true_lang-Bwerv177.js} +1 -1
  11. package/dist/preview/assets/index-64FLV2BU.js +1 -0
  12. package/dist/preview/assets/{index-DDthcoXk.js → index-BTkCfbjK.js} +72 -72
  13. package/dist/preview/assets/{runtime-COMOofol.js → runtime-BD2IrVii.js} +1 -1
  14. package/dist/preview/assets/{runtime-CPPOlC0F.js → runtime-BhQOPtOX.js} +1 -1
  15. package/dist/preview/assets/{runtime-hKRNY9F6.js → runtime-CRgUQ59O.js} +1 -1
  16. package/dist/preview/assets/{runtime-BkZp9k_z.js → runtime-CSXOCy3p.js} +1 -1
  17. package/dist/preview/assets/{runtime-BqFFtMNw.js → runtime-CjQG0eYi.js} +1 -1
  18. package/dist/preview/assets/{runtime-DejxoCBP.js → runtime-DHsTwgfj.js} +1 -1
  19. package/dist/preview/assets/{runtime-YYdaCEw3.js → runtime-DMaKG-ry.js} +1 -1
  20. package/dist/preview/assets/{runtime-BICQC6bF.js → runtime-ZRdlKcQv.js} +1 -1
  21. package/dist/preview/index.html +1 -1
  22. package/dist/runtime/components/form/fields/2026-05-23/com.shwfed.form.field.tree.multi/runtime.vue +53 -13
  23. package/dist/runtime/components/ui/tree/TreeNode.vue +8 -10
  24. package/dist/runtime/components/ui/tree/useTreeState.js +0 -2
  25. package/package.json +1 -1
  26. package/dist/preview/assets/index-DhkKZ2ii.js +0 -1
@@ -1 +1 @@
1
- import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-DbnaeqGK.js";import{d as n,e as a,u as c,o as f,ao as i}from"./index-DDthcoXk.js";const _=n({name:"ShwfedPrototypeActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=i;return(r,s)=>(f(),a(o,{"action-id":e.buttonId,effect:c(t)},null,8,["action-id","effect"]))}});export{_ as default};
1
+ import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-Bwerv177.js";import{d as n,e as a,u as c,o as f,ao as i}from"./index-BTkCfbjK.js";const _=n({name:"ShwfedPrototypeActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=i;return(r,s)=>(f(),a(o,{"action-id":e.buttonId,effect:c(t)},null,8,["action-id","effect"]))}});export{_ as default};
@@ -1 +1 @@
1
- import{d as r,an as f,ai as u,e as p,u as g,aj as m,ak as l,al as d,am as x,o as E}from"./index-DDthcoXk.js";import{_}from"./definition.vue_vue_type_script_setup_true_lang-DbnaeqGK.js";const k=r({name:"ShwfedHttpRequestActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(n){const e=n,t=d(),c=(s,o)=>m(s,{...l(t),...o}),i=x(),a=f(()=>u(e.config.expression,c,{messageExpression:e.config.messageExpression,resultExpression:e.config.resultExpression,channel:i,triggers:{success:e.config.onSuccess,warning:e.config.onWarning,error:e.config.onError,info:e.config.onInfo}}));return(s,o)=>(E(),p(_,{"action-id":n.buttonId,effect:g(a)},null,8,["action-id","effect"]))}});export{k as default};
1
+ import{d as r,an as f,ai as u,e as p,u as g,aj as m,ak as l,al as d,am as x,o as E}from"./index-BTkCfbjK.js";import{_}from"./definition.vue_vue_type_script_setup_true_lang-Bwerv177.js";const k=r({name:"ShwfedHttpRequestActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(n){const e=n,t=d(),c=(s,o)=>m(s,{...l(t),...o}),i=x(),a=f(()=>u(e.config.expression,c,{messageExpression:e.config.messageExpression,resultExpression:e.config.resultExpression,channel:i,triggers:{success:e.config.onSuccess,warning:e.config.onWarning,error:e.config.onError,info:e.config.onInfo}}));return(s,o)=>(E(),p(_,{"action-id":n.buttonId,effect:g(a)},null,8,["action-id","effect"]))}});export{k as default};
@@ -1 +1 @@
1
- import{d as u,ad as l,e as i,u as p,$ as d,o as m,k as f,af as _,ag as k,aj as g,ak as w,al as x}from"./index-DDthcoXk.js";const B=u({name:"ShwfedMarkdownItemRuntime",__name:"runtime",props:{config:{}},setup(n){const s=n,{locale:o}=l(),t=x(),c=(e,a)=>g(e,{...w(t),...a}),r=d(()=>{const e=_(s.config.content,o.value)??"";return k(e,c)});return(e,a)=>(m(),i(p(f),{"data-slot":"buttons-markdown",source:r.value,class:"prose prose-sm prose-zinc px-1"},null,8,["source"]))}});export{B as default};
1
+ import{d as u,ad as l,e as i,u as p,$ as d,o as m,k as f,af as _,ag as k,aj as g,ak as w,al as x}from"./index-BTkCfbjK.js";const B=u({name:"ShwfedMarkdownItemRuntime",__name:"runtime",props:{config:{}},setup(n){const s=n,{locale:o}=l(),t=x(),c=(e,a)=>g(e,{...w(t),...a}),r=d(()=>{const e=_(s.config.content,o.value)??"";return k(e,c)});return(e,a)=>(m(),i(p(f),{"data-slot":"buttons-markdown",source:r.value,class:"prose prose-sm prose-zinc px-1"},null,8,["source"]))}});export{B as default};
@@ -1 +1 @@
1
- import{_ as s}from"./definition.vue_vue_type_script_setup_true_lang-DbnaeqGK.js";import{d as c,an as o,az as i,e as r,u as f,am as u,o as m}from"./index-DDthcoXk.js";const g=c({name:"ShwfedEventDispatchActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const n=e,t=u(),a=o(()=>i(t,n.config.triggers));return(p,d)=>(m(),r(s,{"action-id":e.buttonId,effect:f(a)},null,8,["action-id","effect"]))}});export{g as default};
1
+ import{_ as s}from"./definition.vue_vue_type_script_setup_true_lang-Bwerv177.js";import{d as c,an as o,az as i,e as r,u as f,am as u,o as m}from"./index-BTkCfbjK.js";const g=c({name:"ShwfedEventDispatchActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const n=e,t=u(),a=o(()=>i(t,n.config.triggers));return(p,d)=>(m(),r(s,{"action-id":e.buttonId,effect:f(a)},null,8,["action-id","effect"]))}});export{g as default};
@@ -1 +1 @@
1
- import{d as s,ad as B,ar as E,ae as _,af as i,as as x,at as p,e as M,w as c,u as d,a0 as N,am as b,aq as k,o as w,f as L,au as T,g as u,av as I,aw as H,a7 as S,al as V,ax as $,ay as z}from"./index-DDthcoXk.js";import{_ as A}from"./definition.vue_vue_type_script_setup_true_lang-DbnaeqGK.js";const F=s({name:"ShwfedModalLayoutActionRuntime",__name:"runtime",props:{buttonId:{},config:{},buttonTitle:{}},setup(a){const n=a,{locale:l}=B(),f=e=>{},r=V(),m=b(),o=N(null),v=E(n.buttonId,{close:()=>k(()=>{o.value?.()})},m),g=s({name:"ModalBoundaryBridge",setup(e,{slots:t}){return H(r),$(z,v),()=>t.default?.()}}),h=(e,t)=>S()?.(e,t),C=_(function*(){const e=i(n.config.modalTitle,l.value)??i(n.buttonTitle,l.value)??"",{modal:t,close:y}=yield*x({title:e,width:n.config.modalWidth});o.value=()=>p(y()),yield*t,o.value=null});return(e,t)=>(w(),M(A,{"action-id":a.buttonId,effect:d(C)},{default:c(()=>[L("div",{style:T(a.config.modalMinHeight?`min-height: ${a.config.modalMinHeight}`:void 0)},[u(d(g),null,{default:c(()=>[u(I,{"slot-value":a.config.slot,configure:f,"find-entry":h},null,8,["slot-value"])]),_:1})],4)]),_:1},8,["action-id","effect"]))}});export{F as default};
1
+ import{d as s,ad as B,ar as E,ae as _,af as i,as as x,at as p,e as M,w as c,u as d,a0 as N,am as b,aq as k,o as w,f as L,au as T,g as u,av as I,aw as H,a7 as S,al as V,ax as $,ay as z}from"./index-BTkCfbjK.js";import{_ as A}from"./definition.vue_vue_type_script_setup_true_lang-Bwerv177.js";const F=s({name:"ShwfedModalLayoutActionRuntime",__name:"runtime",props:{buttonId:{},config:{},buttonTitle:{}},setup(a){const n=a,{locale:l}=B(),f=e=>{},r=V(),m=b(),o=N(null),v=E(n.buttonId,{close:()=>k(()=>{o.value?.()})},m),g=s({name:"ModalBoundaryBridge",setup(e,{slots:t}){return H(r),$(z,v),()=>t.default?.()}}),h=(e,t)=>S()?.(e,t),C=_(function*(){const e=i(n.config.modalTitle,l.value)??i(n.buttonTitle,l.value)??"",{modal:t,close:y}=yield*x({title:e,width:n.config.modalWidth});o.value=()=>p(y()),yield*t,o.value=null});return(e,t)=>(w(),M(A,{"action-id":a.buttonId,effect:d(C)},{default:c(()=>[L("div",{style:T(a.config.modalMinHeight?`min-height: ${a.config.modalMinHeight}`:void 0)},[u(d(g),null,{default:c(()=>[u(I,{"slot-value":a.config.slot,configure:f,"find-entry":h},null,8,["slot-value"])]),_:1})],4)]),_:1},8,["action-id","effect"]))}});export{F as default};
@@ -1 +1 @@
1
- import{d as f,ad as u,ae as l,af as g,ag as d,ah as m,ai as p,e as x,u as E,aj as _,ak as h,al as k,am as w,o as C}from"./index-DDthcoXk.js";import{_ as I}from"./definition.vue_vue_type_script_setup_true_lang-DbnaeqGK.js";const R=f({name:"ShwfedHttpRequestConfirmActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(s){const n=s,{locale:c}=u(),a=k(),t=(e,o)=>_(e,{...h(a),...o}),i=w(),r=l(function*(){const e=g(n.config.markdown,c.value)??"",o=d(e,t);(yield*m({content:o,icon:n.config.icon,color:n.config.color}))||(yield*p(n.config.expression,t,{messageExpression:n.config.messageExpression,resultExpression:n.config.resultExpression,channel:i,triggers:{success:n.config.onSuccess,warning:n.config.onWarning,error:n.config.onError,info:n.config.onInfo}}))});return(e,o)=>(C(),x(I,{"action-id":s.buttonId,effect:E(r)},null,8,["action-id","effect"]))}});export{R as default};
1
+ import{d as f,ad as u,ae as l,af as g,ag as d,ah as m,ai as p,e as x,u as E,aj as _,ak as h,al as k,am as w,o as C}from"./index-BTkCfbjK.js";import{_ as I}from"./definition.vue_vue_type_script_setup_true_lang-Bwerv177.js";const R=f({name:"ShwfedHttpRequestConfirmActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(s){const n=s,{locale:c}=u(),a=k(),t=(e,o)=>_(e,{...h(a),...o}),i=w(),r=l(function*(){const e=g(n.config.markdown,c.value)??"",o=d(e,t);(yield*m({content:o,icon:n.config.icon,color:n.config.color}))||(yield*p(n.config.expression,t,{messageExpression:n.config.messageExpression,resultExpression:n.config.resultExpression,channel:i,triggers:{success:n.config.onSuccess,warning:n.config.onWarning,error:n.config.onError,info:n.config.onInfo}}))});return(e,o)=>(C(),x(I,{"action-id":s.buttonId,effect:E(r)},null,8,["action-id","effect"]))}});export{R as default};
@@ -1 +1 @@
1
- import{d as _,an as j,ae as B,aq as r,az as m,aA as E,aB as S,e as k,u as v,aj as x,ak as L,am as b,o as C,al as R}from"./index-DDthcoXk.js";import{_ as T}from"./definition.vue_vue_type_script_setup_true_lang-DbnaeqGK.js";const I=_({name:"ShwfedHttpDownloadActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(d){const c=d,g=R(),t=(e,n)=>x(e,{...L(g),...n}),l=b(),p=new Set(["success","error","warning","info"]);function f(e){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=e.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}const y=j(()=>B(function*(){const{template:e,messageExpression:n,resultExpression:o}=c.config,u=yield*t(e.request);if(!e.download){const s=yield*u.file();return yield*r(()=>f(s)),yield*m(l,c.config.onSuccess)}const a={json:yield*u.json()},i=o===void 0?"success":yield*E(t(o,a),s=>p.has(s)?s:"success");if(n!==void 0){const s=yield*t(n,a);yield*r(()=>S[i](s))}if(i==="success"||i==="info"){const h=yield*(yield*t(e.download,a)).file();yield*r(()=>f(h))}const w={success:c.config.onSuccess,warning:c.config.onWarning,error:c.config.onError,info:c.config.onInfo};return yield*m(l,w[i])}));return(e,n)=>(C(),k(T,{"action-id":d.buttonId,effect:v(y)},null,8,["action-id","effect"]))}});export{I as default};
1
+ import{d as _,an as j,ae as B,aq as r,az as m,aA as E,aB as S,e as k,u as v,aj as x,ak as L,am as b,o as C,al as R}from"./index-BTkCfbjK.js";import{_ as T}from"./definition.vue_vue_type_script_setup_true_lang-Bwerv177.js";const I=_({name:"ShwfedHttpDownloadActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(d){const c=d,g=R(),t=(e,n)=>x(e,{...L(g),...n}),l=b(),p=new Set(["success","error","warning","info"]);function f(e){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=e.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}const y=j(()=>B(function*(){const{template:e,messageExpression:n,resultExpression:o}=c.config,u=yield*t(e.request);if(!e.download){const s=yield*u.file();return yield*r(()=>f(s)),yield*m(l,c.config.onSuccess)}const a={json:yield*u.json()},i=o===void 0?"success":yield*E(t(o,a),s=>p.has(s)?s:"success");if(n!==void 0){const s=yield*t(n,a);yield*r(()=>S[i](s))}if(i==="success"||i==="info"){const h=yield*(yield*t(e.download,a)).file();yield*r(()=>f(h))}const w={success:c.config.onSuccess,warning:c.config.onWarning,error:c.config.onError,info:c.config.onInfo};return yield*m(l,w[i])}));return(e,n)=>(C(),k(T,{"action-id":d.buttonId,effect:v(y)},null,8,["action-id","effect"]))}});export{I as default};
@@ -1 +1 @@
1
- import{d as i,an as f,ap as r,aq as d,e as u,u as m,aj as p,ak as l,al as _,o as g}from"./index-DDthcoXk.js";import{_ as h}from"./definition.vue_vue_type_script_setup_true_lang-DbnaeqGK.js";const x=i({name:"ShwfedNavigationActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=e,o=_(),c=(n,a)=>p(n,{...l(o),...a}),s=f(()=>r(c(t.config.url),n=>d(()=>{window.open(n,t.config.mode)})));return(n,a)=>(g(),u(h,{"action-id":e.buttonId,effect:m(s)},null,8,["action-id","effect"]))}});export{x as default};
1
+ import{d as i,an as f,ap as r,aq as d,e as u,u as m,aj as p,ak as l,al as _,o as g}from"./index-BTkCfbjK.js";import{_ as h}from"./definition.vue_vue_type_script_setup_true_lang-Bwerv177.js";const x=i({name:"ShwfedNavigationActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=e,o=_(),c=(n,a)=>p(n,{...l(o),...a}),s=f(()=>r(c(t.config.url),n=>d(()=>{window.open(n,t.config.mode)})));return(n,a)=>(g(),u(h,{"action-id":e.buttonId,effect:m(s)},null,8,["action-id","effect"]))}});export{x as default};
@@ -10,7 +10,7 @@
10
10
  `--primary`, the primary button variant renders as transparent. */
11
11
  body { --primary: #009689; }
12
12
  </style>
13
- <script type="module" crossorigin src="./assets/index-DDthcoXk.js"></script>
13
+ <script type="module" crossorigin src="./assets/index-BTkCfbjK.js"></script>
14
14
  <link rel="stylesheet" crossorigin href="./assets/index-Br_eXThF.css">
15
15
  </head>
16
16
  <body>
@@ -8,7 +8,7 @@ import { cel as _rawCel } from "../../../../../utils/cel";
8
8
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
9
9
  import { getLocalizedText } from "../../../../../share/locale";
10
10
  import { Field, FieldLabel } from "../../../../ui/field";
11
- import { InputGroup, InputGroupButton, InputGroupInput } from "../../../../ui/input-group";
11
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "../../../../ui/input-group";
12
12
  import { Markdown } from "../../../../ui/markdown";
13
13
  import { Tree as UiTree } from "../../../../ui/tree";
14
14
  import { interpolateMarkdown } from "../../../../table/utils/runtime";
@@ -19,7 +19,38 @@ const props = defineProps({
19
19
  fieldId: { type: String, required: true },
20
20
  config: { type: null, required: true }
21
21
  });
22
- const { locale } = useI18n();
22
+ const { locale, t } = useI18n({
23
+ inheritLocale: true,
24
+ messages: {
25
+ zh: {
26
+ "tree-multi-search-label": "\u641C\u7D22",
27
+ "tree-multi-search-clear": "\u6E05\u9664\u641C\u7D22",
28
+ "tree-multi-load-error": "\u52A0\u8F7D\u5931\u8D25",
29
+ "tree-multi-loading": "\u52A0\u8F7D\u4E2D\u2026",
30
+ "tree-multi-empty": "\u65E0\u53EF\u9009\u9879",
31
+ "tree-multi-readonly-empty": "\u2014",
32
+ "tree-multi-readonly-separator": "\u3001"
33
+ },
34
+ en: {
35
+ "tree-multi-search-label": "Search",
36
+ "tree-multi-search-clear": "Clear search",
37
+ "tree-multi-load-error": "Failed to load",
38
+ "tree-multi-loading": "Loading\u2026",
39
+ "tree-multi-empty": "No options",
40
+ "tree-multi-readonly-empty": "\u2014",
41
+ "tree-multi-readonly-separator": ", "
42
+ },
43
+ ja: {
44
+ "tree-multi-search-label": "\u691C\u7D22",
45
+ "tree-multi-search-clear": "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
46
+ "tree-multi-load-error": "\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
47
+ "tree-multi-loading": "\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026",
48
+ "tree-multi-empty": "\u9078\u629E\u80A2\u306A\u3057",
49
+ "tree-multi-readonly-empty": "\u2014",
50
+ "tree-multi-readonly-separator": "\u3001"
51
+ }
52
+ }
53
+ });
23
54
  const { state, getAt, setAt } = useFormState();
24
55
  const inherited = injectCELContext();
25
56
  const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
@@ -203,11 +234,12 @@ function filterPredicate(node, query) {
203
234
  }
204
235
  const filterLabelText = computed(() => {
205
236
  const localized = props.config.filter?.label ? getLocalizedText(props.config.filter.label, locale.value) : void 0;
206
- return localized && localized.length > 0 ? localized : "\u641C\u7D22";
237
+ return localized && localized.length > 0 ? localized : t("tree-multi-search-label");
207
238
  });
208
239
  const readonlyText = computed(() => {
209
240
  const selected = new Set(model.value);
210
- if (selected.size === 0) return "\u2014";
241
+ const empty = t("tree-multi-readonly-empty");
242
+ if (selected.size === 0) return empty;
211
243
  const found = /* @__PURE__ */ new Map();
212
244
  const stack = [...roots.value];
213
245
  while (stack.length) {
@@ -218,7 +250,7 @@ const readonlyText = computed(() => {
218
250
  if (kids && kids.length) stack.push(...kids);
219
251
  }
220
252
  const labels = model.value.map((id) => found.get(id) ?? id).filter((l) => l.length > 0);
221
- return labels.length > 0 ? labels.join("\u3001") : "\u2014";
253
+ return labels.length > 0 ? labels.join(t("tree-multi-readonly-separator")) : empty;
222
254
  });
223
255
  </script>
224
256
 
@@ -257,17 +289,25 @@ const readonlyText = computed(() => {
257
289
  >
258
290
  <FieldLabel>{{ filterLabelText }}</FieldLabel>
259
291
  <InputGroup>
292
+ <InputGroupAddon align="inline-start">
293
+ <Icon icon="lucide:search" />
294
+ </InputGroupAddon>
260
295
  <InputGroupInput
261
296
  v-model="filterQuery"
262
297
  :disabled="isDisabled"
263
298
  />
264
- <InputGroupButton
299
+ <InputGroupAddon
265
300
  v-if="filterQuery.length > 0"
266
- aria-label="清除搜索"
267
- @click="filterQuery = ''"
301
+ align="inline-end"
268
302
  >
269
- <Icon icon="lucide:x" />
270
- </InputGroupButton>
303
+ <InputGroupButton
304
+ size="icon-xs"
305
+ :aria-label="t('tree-multi-search-clear')"
306
+ @click="filterQuery = ''"
307
+ >
308
+ <Icon icon="lucide:x" />
309
+ </InputGroupButton>
310
+ </InputGroupAddon>
271
311
  </InputGroup>
272
312
  </Field>
273
313
 
@@ -275,13 +315,13 @@ const readonlyText = computed(() => {
275
315
  v-if="fetchError && roots.length === 0"
276
316
  class="min-h-9 py-1.5 text-sm text-red-500"
277
317
  >
278
- 加载失败
318
+ {{ t("tree-multi-load-error") }}
279
319
  </div>
280
320
  <div
281
321
  v-else-if="loading && roots.length === 0"
282
322
  class="min-h-9 py-1.5 text-sm text-zinc-400"
283
323
  >
284
- 加载中…
324
+ {{ t("tree-multi-loading") }}
285
325
  </div>
286
326
 
287
327
  <UiTree
@@ -315,7 +355,7 @@ const readonlyText = computed(() => {
315
355
 
316
356
  <template #empty>
317
357
  <div class="min-h-9 py-1.5 text-sm text-zinc-400">
318
- 无可选项
358
+ {{ t("tree-multi-empty") }}
319
359
  </div>
320
360
  </template>
321
361
  </UiTree>
@@ -2,6 +2,7 @@
2
2
  import { computed } from "vue";
3
3
  import { Icon } from "@iconify/vue";
4
4
  import { cn } from "../../../utils/cn";
5
+ import { Checkbox } from "../checkbox";
5
6
  defineOptions({ name: "UiTreeNode", inheritAttrs: false });
6
7
  const props = defineProps({
7
8
  node: { type: null, required: true },
@@ -136,19 +137,16 @@ const showChildren = computed(() => expandable.value && expanded.value);
136
137
  class="inline-block size-4 shrink-0"
137
138
  />
138
139
 
139
- <!-- selector: component-owned, vendored as <input> for testability;
140
- host visuals come from the #node slot which sits next to it. -->
140
+ <!-- selector: shadcn-styled Checkbox for multi; raw radio for single
141
+ (no standalone shadcn radio RadioGroupItem requires a group). -->
141
142
  <template v-if="selectionMode !== 'none' && userSelectable">
142
- <input
143
+ <Checkbox
143
144
  v-if="selectionMode === 'multi'"
144
- type="checkbox"
145
- class="size-4 shrink-0 accent-(--primary) cursor-pointer"
146
- :checked="selectedFlag"
147
- :data-state="indeterminateFlag ? 'indeterminate' : selectedFlag ? 'checked' : 'unchecked'"
148
- :aria-checked="indeterminateFlag ? 'mixed' : selectedFlag"
145
+ :model-value="indeterminateFlag ? 'indeterminate' : selectedFlag"
149
146
  data-tree-toggle="checkbox"
150
- @click.stop="onToggleSelect"
151
- >
147
+ @update:model-value="onToggleSelect"
148
+ @click.stop
149
+ />
152
150
  <input
153
151
  v-else
154
152
  type="radio"
@@ -189,7 +189,6 @@ export function useTreeState(opts) {
189
189
  }
190
190
  function isIndeterminate(node, depth) {
191
191
  if (opts.selectionMode() !== "multi") return false;
192
- if (opts.cascade() !== "cascade-both") return false;
193
192
  const { selectedCount, total } = descendantSelectionStats(node, depth);
194
193
  if (total === 0) return false;
195
194
  return selectedCount > 0 && selectedCount < total;
@@ -198,7 +197,6 @@ export function useTreeState(opts) {
198
197
  const k = opts.getKey(node);
199
198
  if (selected.has(k)) return true;
200
199
  if (opts.selectionMode() !== "multi") return false;
201
- if (opts.cascade() !== "cascade-both") return false;
202
200
  const { selectedCount, total } = descendantSelectionStats(node, depth);
203
201
  return total > 0 && selectedCount === total;
204
202
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/config",
3
- "version": "2.3.13",
3
+ "version": "2.3.14",
4
4
  "description": "Configurable UI for SHWFED",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1 +0,0 @@
1
- import{aH as e}from"./index-DDthcoXk.js";import{aI as r,aJ as s,aK as t}from"./index-DDthcoXk.js";export{r as TableConfig,s as createTableConfig,e as default,t as getColumnTechnicalKey};