@shwfed/config 2.3.25 → 2.3.27

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 (34) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/preview/assets/{config-CjlRnKnY.js → config-Bv_hUugV.js} +1 -1
  3. package/dist/preview/assets/{config-DZXC8YJ4.js → config-C45AT0tt.js} +1 -1
  4. package/dist/preview/assets/{config-CdH0Nxqa.js → config-CIcy6Jwg.js} +1 -1
  5. package/dist/preview/assets/{config-CV5P2_b2.js → config-CRqRJ0oF.js} +1 -1
  6. package/dist/preview/assets/{config-CrvG15To.js → config-CXaH7a2G.js} +1 -1
  7. package/dist/preview/assets/{config-CVAFGzPb.js → config-D-i-AFgH.js} +1 -1
  8. package/dist/preview/assets/{config-BoE06fMj.js → config-D0YS2Bpj.js} +1 -1
  9. package/dist/preview/assets/{config-BYTuKQZr.js → config-DrpESRR5.js} +1 -1
  10. package/dist/preview/assets/{config-QaYy6DCp.js → config-l3KurfL5.js} +1 -1
  11. package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-CBPR0zl_.js → definition.vue_vue_type_script_setup_true_lang-Ck8Pbwem.js} +1 -1
  12. package/dist/preview/assets/index-C3Ycah5_.js +643 -0
  13. package/dist/preview/assets/index-hWT4_I5k.js +1 -0
  14. package/dist/preview/assets/{runtime-C_R-VCbd.js → runtime-BSASeqgI.js} +1 -1
  15. package/dist/preview/assets/{runtime-DGdEDDUA.js → runtime-CmCvUWLV.js} +1 -1
  16. package/dist/preview/assets/{runtime-pM3u8QsQ.js → runtime-CvuGnDIa.js} +1 -1
  17. package/dist/preview/assets/{runtime-BsiLYYky.js → runtime-D42ecZyC.js} +1 -1
  18. package/dist/preview/assets/{runtime-C-h7PIyx.js → runtime-D6twt5H_.js} +1 -1
  19. package/dist/preview/assets/{runtime-BQiYt6n7.js → runtime-DUyUjFqF.js} +1 -1
  20. package/dist/preview/assets/{runtime-1AP_-j3e.js → runtime-Df715bRA.js} +1 -1
  21. package/dist/preview/assets/{runtime-CGW3z1YJ.js → runtime-tobnPKdV.js} +1 -1
  22. package/dist/preview/assets/{runtime-DwXjew7j.js → runtime-z_QPMN-R.js} +1 -1
  23. package/dist/preview/index.html +1 -1
  24. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
  25. package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
  26. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi/runtime.vue +36 -12
  27. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
  28. package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
  29. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi/runtime.vue +36 -12
  30. package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue +44 -12
  31. package/dist/runtime/components/ui/command/CommandItem.vue +12 -4
  32. package/package.json +1 -1
  33. package/dist/preview/assets/index-BbnG2cVz.js +0 -643
  34. package/dist/preview/assets/index-NFKAYzMi.js +0 -1
@@ -0,0 +1 @@
1
+ import{aL as e}from"./index-C3Ycah5_.js";import{aM as r,aN as s,aO as t}from"./index-C3Ycah5_.js";export{r as TableConfig,s as createTableConfig,e as default,t as getColumnTechnicalKey};
@@ -1 +1 @@
1
- import{d as u,ae as l,e as i,u as p,$ as m,o as d,k as f,ag as _,ah as k,ak as g,al as w,am as x}from"./index-BbnG2cVz.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=m(()=>{const e=_(s.config.content,o.value)??"";return k(e,c)});return(e,a)=>(d(),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,ae as l,e as i,u as p,$ as m,o as d,k as f,ag as _,ah as k,ak as g,al as w,am as x}from"./index-C3Ycah5_.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=m(()=>{const e=_(s.config.content,o.value)??"";return k(e,c)});return(e,a)=>(d(),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 o}from"./definition.vue_vue_type_script_setup_true_lang-CBPR0zl_.js";import{d as s,ao as c,aB as i,e as r,u as f,an as u,o as m}from"./index-BbnG2cVz.js";const g=s({name:"ShwfedEventDispatchActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const n=e,t=u(),a=c(()=>i(t,n.config.triggers));return(p,d)=>(m(),r(o,{"action-id":e.buttonId,effect:f(a)},null,8,["action-id","effect"]))}});export{g as default};
1
+ import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-Ck8Pbwem.js";import{d as s,ao as c,aB as i,e as r,u as f,an as u,o as m}from"./index-C3Ycah5_.js";const g=s({name:"ShwfedEventDispatchActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const n=e,t=u(),a=c(()=>i(t,n.config.triggers));return(p,d)=>(m(),r(o,{"action-id":e.buttonId,effect:f(a)},null,8,["action-id","effect"]))}});export{g as default};
@@ -1 +1 @@
1
- import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-CBPR0zl_.js";import{d as n,e as a,u as c,o as f,ap as i}from"./index-BbnG2cVz.js";const p=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{p as default};
1
+ import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-Ck8Pbwem.js";import{d as n,e as a,u as c,o as f,ap as i}from"./index-C3Ycah5_.js";const p=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{p as default};
@@ -1 +1 @@
1
- import{d as r,ao as f,aj as u,e as p,u as g,ak as m,al as l,am as d,an as x,o as E}from"./index-BbnG2cVz.js";import{_}from"./definition.vue_vue_type_script_setup_true_lang-CBPR0zl_.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,ao as f,aj as u,e as p,u as g,ak as m,al as l,am as d,an as x,o as E}from"./index-C3Ycah5_.js";import{_}from"./definition.vue_vue_type_script_setup_true_lang-Ck8Pbwem.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 _,ao as B,af as E,ar as r,aB as m,aC as S,aD as j,e as k,u as v,ak as x,al as C,an as L,am as b,o as R}from"./index-BbnG2cVz.js";import{_ as T}from"./definition.vue_vue_type_script_setup_true_lang-CBPR0zl_.js";const q=_({name:"ShwfedHttpDownloadActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(d){const c=d,g=b(),t=(e,n)=>x(e,{...C(g),...n}),l=L(),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=B(()=>E(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*S(t(o,a),s=>p.has(s)?s:"success");if(n!==void 0){const s=yield*t(n,a);yield*r(()=>j[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)=>(R(),k(T,{"action-id":d.buttonId,effect:v(y)},null,8,["action-id","effect"]))}});export{q as default};
1
+ import{d as _,ao as B,af as E,ar as r,aB as m,aC as S,aD as j,e as k,u as v,ak as x,al as C,an as L,am as b,o as R}from"./index-C3Ycah5_.js";import{_ as T}from"./definition.vue_vue_type_script_setup_true_lang-Ck8Pbwem.js";const q=_({name:"ShwfedHttpDownloadActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(d){const c=d,g=b(),t=(e,n)=>x(e,{...C(g),...n}),l=L(),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=B(()=>E(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*S(t(o,a),s=>p.has(s)?s:"success");if(n!==void 0){const s=yield*t(n,a);yield*r(()=>j[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)=>(R(),k(T,{"action-id":d.buttonId,effect:v(y)},null,8,["action-id","effect"]))}});export{q as default};
@@ -1 +1 @@
1
- import{d as f,ae as u,af as l,ag as g,ah as m,ai as p,aj as d,e as x,u as E,ak as _,al as h,am as k,an as w,o as C}from"./index-BbnG2cVz.js";import{_ as I}from"./definition.vue_vue_type_script_setup_true_lang-CBPR0zl_.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=m(e,t);(yield*p({content:o,icon:n.config.icon,color:n.config.color}))||(yield*d(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,ae as u,af as l,ag as g,ah as m,ai as p,aj as d,e as x,u as E,ak as _,al as h,am as k,an as w,o as C}from"./index-C3Ycah5_.js";import{_ as I}from"./definition.vue_vue_type_script_setup_true_lang-Ck8Pbwem.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=m(e,t);(yield*p({content:o,icon:n.config.icon,color:n.config.color}))||(yield*d(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 i,ae as x,as as p,af as M,ag as c,at as T,au as N,e as b,w as d,u,a0 as k,a1 as w,an as L,ar as S,o as A,f as I,av as z,g as r,aw as F,ax as H,a7 as V,am as $,ay as f,az as m,aA as j}from"./index-BbnG2cVz.js";import{_ as K}from"./definition.vue_vue_type_script_setup_true_lang-CBPR0zl_.js";const O=i({name:"ShwfedModalLayoutActionRuntime",__name:"runtime",props:{buttonId:{},config:{},buttonTitle:{}},setup(a){const n=a,{locale:l}=x(),v=e=>{},g=$(),s=w(f,void 0),h=L(),o=k(null),C=p(n.buttonId,{close:()=>S(()=>{o.value?.()})},h),y=i({name:"ModalBoundaryBridge",setup(e,{slots:t}){return H(g),m(j,C),s&&m(f,s),()=>t.default?.()}}),E=(e,t)=>V()?.(e,t),_=M(function*(){const e=c(n.config.modalTitle,l.value)??c(n.buttonTitle,l.value)??"",{modal:t,close:B}=yield*T({title:e,width:n.config.modalWidth});o.value=()=>N(B()),yield*t,o.value=null});return(e,t)=>(A(),b(K,{"action-id":a.buttonId,effect:u(_)},{default:d(()=>[I("div",{style:z(a.config.modalMinHeight?`min-height: ${a.config.modalMinHeight}`:void 0)},[r(u(y),null,{default:d(()=>[r(F,{"slot-value":a.config.slot,configure:v,"find-entry":E},null,8,["slot-value"])]),_:1})],4)]),_:1},8,["action-id","effect"]))}});export{O as default};
1
+ import{d as i,ae as x,as as p,af as M,ag as c,at as T,au as N,e as b,w as d,u,a0 as k,a1 as w,an as L,ar as S,o as A,f as I,av as z,g as r,aw as F,ax as H,a7 as V,am as $,ay as f,az as m,aA as j}from"./index-C3Ycah5_.js";import{_ as K}from"./definition.vue_vue_type_script_setup_true_lang-Ck8Pbwem.js";const O=i({name:"ShwfedModalLayoutActionRuntime",__name:"runtime",props:{buttonId:{},config:{},buttonTitle:{}},setup(a){const n=a,{locale:l}=x(),v=e=>{},g=$(),s=w(f,void 0),h=L(),o=k(null),C=p(n.buttonId,{close:()=>S(()=>{o.value?.()})},h),y=i({name:"ModalBoundaryBridge",setup(e,{slots:t}){return H(g),m(j,C),s&&m(f,s),()=>t.default?.()}}),E=(e,t)=>V()?.(e,t),_=M(function*(){const e=c(n.config.modalTitle,l.value)??c(n.buttonTitle,l.value)??"",{modal:t,close:B}=yield*T({title:e,width:n.config.modalWidth});o.value=()=>N(B()),yield*t,o.value=null});return(e,t)=>(A(),b(K,{"action-id":a.buttonId,effect:u(_)},{default:d(()=>[I("div",{style:z(a.config.modalMinHeight?`min-height: ${a.config.modalMinHeight}`:void 0)},[r(u(y),null,{default:d(()=>[r(F,{"slot-value":a.config.slot,configure:v,"find-entry":E},null,8,["slot-value"])]),_:1})],4)]),_:1},8,["action-id","effect"]))}});export{O as default};
@@ -1 +1 @@
1
- import{d as i,ao as f,aq as r,ar as d,e as m,u,ak as l,al as p,am as _,o as g}from"./index-BbnG2cVz.js";import{_ as h}from"./definition.vue_vue_type_script_setup_true_lang-CBPR0zl_.js";const x=i({name:"ShwfedNavigationActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=e,o=_(),c=(n,a)=>l(n,{...p(o),...a}),s=f(()=>r(c(t.config.url),n=>d(()=>{window.open(n,t.config.mode)})));return(n,a)=>(g(),m(h,{"action-id":e.buttonId,effect:u(s)},null,8,["action-id","effect"]))}});export{x as default};
1
+ import{d as i,ao as f,aq as r,ar as d,e as m,u,ak as l,al as p,am as _,o as g}from"./index-C3Ycah5_.js";import{_ as h}from"./definition.vue_vue_type_script_setup_true_lang-Ck8Pbwem.js";const x=i({name:"ShwfedNavigationActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=e,o=_(),c=(n,a)=>l(n,{...p(o),...a}),s=f(()=>r(c(t.config.url),n=>d(()=>{window.open(n,t.config.mode)})));return(n,a)=>(g(),m(h,{"action-id":e.buttonId,effect:u(s)},null,8,["action-id","effect"]))}});export{x as default};
@@ -1 +1 @@
1
- import{d as l,aE as g,ao as A,aq as y,aB as _,e as h,u as S,ak as b,al as k,an as j,aF as B,o as C,am as E}from"./index-BbnG2cVz.js";import{_ as F}from"./definition.vue_vue_type_script_setup_true_lang-CBPR0zl_.js";const I=l({name:"ShwfedStateWriteActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(r){const s=r,i=E(),f=(e,t)=>b(e,{...k(i),...t}),n=g(),o=n.kind==="form"&&n.parent?n.parent:n,u=j(),m=B((e,t,a)=>{if(Array.isArray(e[t])&&Array.isArray(a))return e[t]=a,!0});function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e,t){return c(e)&&c(t)?m({...t},e):t}const d=A(()=>y(f(s.config.expression),e=>{for(const t of Object.keys(e)){const a=p(o.getAt(t),e[t]);o.setAt(t,a)}return _(u,s.config.onSuccess)}));return(e,t)=>(C(),h(F,{"action-id":r.buttonId,effect:S(d)},null,8,["action-id","effect"]))}});export{I as default};
1
+ import{d as l,aE as g,ao as A,aq as y,aB as _,e as h,u as S,ak as b,al as k,an as j,aF as B,o as C,am as E}from"./index-C3Ycah5_.js";import{_ as F}from"./definition.vue_vue_type_script_setup_true_lang-Ck8Pbwem.js";const I=l({name:"ShwfedStateWriteActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(r){const s=r,i=E(),f=(e,t)=>b(e,{...k(i),...t}),n=g(),o=n.kind==="form"&&n.parent?n.parent:n,u=j(),m=B((e,t,a)=>{if(Array.isArray(e[t])&&Array.isArray(a))return e[t]=a,!0});function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e,t){return c(e)&&c(t)?m({...t},e):t}const d=A(()=>y(f(s.config.expression),e=>{for(const t of Object.keys(e)){const a=p(o.getAt(t),e[t]);o.setAt(t,a)}return _(u,s.config.onSuccess)}));return(e,t)=>(C(),h(F,{"action-id":r.buttonId,effect:S(d)},null,8,["action-id","effect"]))}});export{I 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-BbnG2cVz.js"></script>
13
+ <script type="module" crossorigin src="./assets/index-C3Ycah5_.js"></script>
14
14
  <link rel="stylesheet" crossorigin href="./assets/index-BCE-G4Ha.css">
15
15
  </head>
16
16
  <body>
@@ -43,7 +43,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
43
43
  readonly accessor: string;
44
44
  readonly options: string;
45
45
  readonly enableSorting?: boolean | undefined;
46
- readonly successMessage?: string | undefined;
47
46
  readonly optionValue: string;
48
47
  readonly optionLabel: readonly [{
49
48
  readonly locale: "zh";
@@ -52,6 +51,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
52
51
  readonly locale: "en" | "ja" | "ko";
53
52
  readonly message: string;
54
53
  }[]];
54
+ readonly successMessage?: string | undefined;
55
55
  }) => any;
56
56
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
57
57
  "onUpdate:modelValue"?: ((value: {
@@ -94,7 +94,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
94
94
  readonly accessor: string;
95
95
  readonly options: string;
96
96
  readonly enableSorting?: boolean | undefined;
97
- readonly successMessage?: string | undefined;
98
97
  readonly optionValue: string;
99
98
  readonly optionLabel: readonly [{
100
99
  readonly locale: "zh";
@@ -103,6 +102,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
102
  readonly locale: "en" | "ja" | "ko";
104
103
  readonly message: string;
105
104
  }[]];
105
+ readonly successMessage?: string | undefined;
106
106
  }) => any) | undefined;
107
107
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
108
108
  declare const _default: typeof __VLS_export;
@@ -43,7 +43,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
43
43
  readonly accessor: string;
44
44
  readonly options: string;
45
45
  readonly enableSorting?: boolean | undefined;
46
- readonly successMessage?: string | undefined;
47
46
  readonly optionValue: string;
48
47
  readonly optionLabel: readonly [{
49
48
  readonly locale: "zh";
@@ -52,6 +51,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
52
51
  readonly locale: "en" | "ja" | "ko";
53
52
  readonly message: string;
54
53
  }[]];
54
+ readonly successMessage?: string | undefined;
55
55
  }) => any;
56
56
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
57
57
  "onUpdate:modelValue"?: ((value: {
@@ -94,7 +94,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
94
94
  readonly accessor: string;
95
95
  readonly options: string;
96
96
  readonly enableSorting?: boolean | undefined;
97
- readonly successMessage?: string | undefined;
98
97
  readonly optionValue: string;
99
98
  readonly optionLabel: readonly [{
100
99
  readonly locale: "zh";
@@ -103,6 +102,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
102
  readonly locale: "en" | "ja" | "ko";
104
103
  readonly message: string;
105
104
  }[]];
105
+ readonly successMessage?: string | undefined;
106
106
  }) => any) | undefined;
107
107
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
108
108
  declare const _default: typeof __VLS_export;
@@ -110,27 +110,51 @@ const selectedEntries = computed(() => {
110
110
  return list;
111
111
  });
112
112
  const selectedKeys = computed(() => selectedEntries.value.map((e) => e.key));
113
- const selectedKeySet = computed(() => new Set(selectedKeys.value));
113
+ const pendingKeys = ref(null);
114
+ const open = ref(false);
115
+ watch(open, (next, prev) => {
116
+ if (!prev && next) {
117
+ pendingKeys.value = [...selectedKeys.value];
118
+ return;
119
+ }
120
+ if (prev && !next && pendingKeys.value !== null) {
121
+ const mapped = [];
122
+ for (const key of pendingKeys.value) {
123
+ const entry = entries.value.find((e) => e.key === key);
124
+ if (entry) mapped.push(entry.value);
125
+ }
126
+ formState.setAt(props.column.binding, mapped);
127
+ pendingKeys.value = null;
128
+ }
129
+ });
130
+ const displayKeys = computed(
131
+ () => pendingKeys.value ?? selectedKeys.value
132
+ );
133
+ const displayKeySet = computed(() => new Set(displayKeys.value));
134
+ const displayEntries = computed(() => {
135
+ if (pendingKeys.value === null) return selectedEntries.value;
136
+ const list = [];
137
+ for (const key of displayKeys.value) {
138
+ const entry = entries.value.find((e) => e.key === key);
139
+ if (entry) list.push(entry);
140
+ }
141
+ return list;
142
+ });
114
143
  const triggerLabel = computed(() => {
115
- const arr = selectedEntries.value;
144
+ const arr = displayEntries.value;
116
145
  if (arr.length === 0) return "";
117
146
  if (arr.length === 1) return arr[0].label;
118
147
  return `${arr[0].label} +${arr.length - 1}`;
119
148
  });
120
- const open = ref(false);
121
149
  function handleSelect(next) {
122
150
  const keys = Array.isArray(next) ? next.filter((k) => typeof k === "string") : [];
123
- const mapped = [];
124
- for (const key of keys) {
125
- const entry = entries.value.find((e) => e.key === key);
126
- if (entry) mapped.push(entry.value);
127
- }
128
- formState.setAt(props.column.binding, mapped);
151
+ pendingKeys.value = keys;
129
152
  }
130
153
  const showClear = computed(
131
- () => !isDisabled.value && selectedEntries.value.length > 0
154
+ () => !isDisabled.value && displayEntries.value.length > 0
132
155
  );
133
156
  function handleClear() {
157
+ pendingKeys.value = null;
134
158
  formState.setAt(props.column.binding, []);
135
159
  open.value = false;
136
160
  }
@@ -203,7 +227,7 @@ const anyHasTooltip = computed(
203
227
  :style="{ width: 'var(--reka-popover-trigger-width)' }"
204
228
  >
205
229
  <Command
206
- :model-value="selectedKeys"
230
+ :model-value="displayKeys"
207
231
  :multiple="true"
208
232
  :disabled="isDisabled"
209
233
  @update:model-value="handleSelect"
@@ -223,7 +247,7 @@ const anyHasTooltip = computed(
223
247
  >
224
248
  <span class="flex-1">{{ entry.label }}</span>
225
249
  <Icon
226
- v-if="selectedKeySet.has(entry.key)"
250
+ v-if="displayKeySet.has(entry.key)"
227
251
  icon="fluent:checkmark-20-regular"
228
252
  class="size-3 text-zinc-700"
229
253
  />
@@ -43,7 +43,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
43
43
  readonly accessor: string;
44
44
  readonly options: string;
45
45
  readonly enableSorting?: boolean | undefined;
46
- readonly successMessage?: string | undefined;
47
46
  readonly optionValue: string;
48
47
  readonly optionLabel: readonly [{
49
48
  readonly locale: "zh";
@@ -52,6 +51,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
52
51
  readonly locale: "en" | "ja" | "ko";
53
52
  readonly message: string;
54
53
  }[]];
54
+ readonly successMessage?: string | undefined;
55
55
  }) => any;
56
56
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
57
57
  "onUpdate:modelValue"?: ((value: {
@@ -94,7 +94,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
94
94
  readonly accessor: string;
95
95
  readonly options: string;
96
96
  readonly enableSorting?: boolean | undefined;
97
- readonly successMessage?: string | undefined;
98
97
  readonly optionValue: string;
99
98
  readonly optionLabel: readonly [{
100
99
  readonly locale: "zh";
@@ -103,6 +102,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
102
  readonly locale: "en" | "ja" | "ko";
104
103
  readonly message: string;
105
104
  }[]];
105
+ readonly successMessage?: string | undefined;
106
106
  }) => any) | undefined;
107
107
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
108
108
  declare const _default: typeof __VLS_export;
@@ -43,7 +43,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
43
43
  readonly accessor: string;
44
44
  readonly options: string;
45
45
  readonly enableSorting?: boolean | undefined;
46
- readonly successMessage?: string | undefined;
47
46
  readonly optionValue: string;
48
47
  readonly optionLabel: readonly [{
49
48
  readonly locale: "zh";
@@ -52,6 +51,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
52
51
  readonly locale: "en" | "ja" | "ko";
53
52
  readonly message: string;
54
53
  }[]];
54
+ readonly successMessage?: string | undefined;
55
55
  }) => any;
56
56
  }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
57
57
  "onUpdate:modelValue"?: ((value: {
@@ -94,7 +94,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
94
94
  readonly accessor: string;
95
95
  readonly options: string;
96
96
  readonly enableSorting?: boolean | undefined;
97
- readonly successMessage?: string | undefined;
98
97
  readonly optionValue: string;
99
98
  readonly optionLabel: readonly [{
100
99
  readonly locale: "zh";
@@ -103,6 +102,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
103
102
  readonly locale: "en" | "ja" | "ko";
104
103
  readonly message: string;
105
104
  }[]];
105
+ readonly successMessage?: string | undefined;
106
106
  }) => any) | undefined;
107
107
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
108
108
  declare const _default: typeof __VLS_export;
@@ -212,27 +212,51 @@ const selectedEntries = computed(() => {
212
212
  return list;
213
213
  });
214
214
  const selectedKeys = computed(() => selectedEntries.value.map((e) => e.key));
215
- const selectedKeySet = computed(() => new Set(selectedKeys.value));
215
+ const pendingKeys = ref(null);
216
+ const open = ref(false);
217
+ watch(open, (next, prev) => {
218
+ if (!prev && next) {
219
+ pendingKeys.value = [...selectedKeys.value];
220
+ return;
221
+ }
222
+ if (prev && !next && pendingKeys.value !== null) {
223
+ const mapped = [];
224
+ for (const key of pendingKeys.value) {
225
+ const entry = entries.value.find((e) => e.key === key);
226
+ if (entry) mapped.push(entry.value);
227
+ }
228
+ formState.setAt(props.column.binding, mapped);
229
+ pendingKeys.value = null;
230
+ }
231
+ });
232
+ const displayKeys = computed(
233
+ () => pendingKeys.value ?? selectedKeys.value
234
+ );
235
+ const displayKeySet = computed(() => new Set(displayKeys.value));
236
+ const displayEntries = computed(() => {
237
+ if (pendingKeys.value === null) return selectedEntries.value;
238
+ const list = [];
239
+ for (const key of displayKeys.value) {
240
+ const entry = entries.value.find((e) => e.key === key);
241
+ if (entry) list.push(entry);
242
+ }
243
+ return list;
244
+ });
216
245
  const triggerLabel = computed(() => {
217
- const arr = selectedEntries.value;
246
+ const arr = displayEntries.value;
218
247
  if (arr.length === 0) return "";
219
248
  if (arr.length === 1) return arr[0].label;
220
249
  return `${arr[0].label} +${arr.length - 1}`;
221
250
  });
222
- const open = ref(false);
223
251
  function handleSelect(next) {
224
252
  const keys = Array.isArray(next) ? next.filter((k) => typeof k === "string") : [];
225
- const mapped = [];
226
- for (const key of keys) {
227
- const entry = entries.value.find((e) => e.key === key);
228
- if (entry) mapped.push(entry.value);
229
- }
230
- formState.setAt(props.column.binding, mapped);
253
+ pendingKeys.value = keys;
231
254
  }
232
255
  const showClear = computed(
233
- () => !isDisabled.value && selectedEntries.value.length > 0
256
+ () => !isDisabled.value && displayEntries.value.length > 0
234
257
  );
235
258
  function handleClear() {
259
+ pendingKeys.value = null;
236
260
  formState.setAt(props.column.binding, []);
237
261
  open.value = false;
238
262
  }
@@ -315,7 +339,7 @@ const anyHasTooltip = computed(
315
339
  :style="{ width: 'var(--reka-popover-trigger-width)' }"
316
340
  >
317
341
  <Command
318
- :model-value="selectedKeys"
342
+ :model-value="displayKeys"
319
343
  :multiple="true"
320
344
  :disabled="isDisabled"
321
345
  @update:model-value="handleSelect"
@@ -343,7 +367,7 @@ const anyHasTooltip = computed(
343
367
  >
344
368
  <span class="flex-1"><Markdown :source="entry.label" /></span>
345
369
  <Icon
346
- v-if="selectedKeySet.has(entry.key)"
370
+ v-if="displayKeySet.has(entry.key)"
347
371
  icon="fluent:checkmark-20-regular"
348
372
  class="size-3 text-zinc-700"
349
373
  />
@@ -4,7 +4,7 @@ import { Effect } from "effect";
4
4
  import { Fetch } from "fx-fetch";
5
5
  import { watchDebounced } from "@vueuse/core";
6
6
  import { toast } from "vue-sonner";
7
- import { computed, ref, watch } from "vue";
7
+ import { computed, ref } from "vue";
8
8
  import { useI18n } from "vue-i18n";
9
9
  import { cel as _rawCel } from "../../../../../utils/cel";
10
10
  import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
@@ -204,7 +204,7 @@ function isEqual(a, b) {
204
204
  }
205
205
  return false;
206
206
  }
207
- const selectedEntries = computed(() => {
207
+ const committedEntries = computed(() => {
208
208
  const list = [];
209
209
  for (const v of cellValue.value) {
210
210
  const entry = entries.value.find((e) => isEqual(e.value, v));
@@ -212,8 +212,14 @@ const selectedEntries = computed(() => {
212
212
  }
213
213
  return list;
214
214
  });
215
- const selectedKeys = computed(() => selectedEntries.value.map((e) => e.key));
215
+ const committedKeys = computed(() => committedEntries.value.map((e) => e.key));
216
+ const draftKeys = ref(null);
217
+ const draftDirty = ref(false);
218
+ const selectedKeys = computed(() => draftKeys.value ?? committedKeys.value);
216
219
  const selectedKeySet = computed(() => new Set(selectedKeys.value));
220
+ const selectedEntries = computed(
221
+ () => selectedKeys.value.map((k) => entries.value.find((e) => e.key === k)).filter((e) => !!e)
222
+ );
217
223
  const triggerLabel = computed(() => {
218
224
  const arr = selectedEntries.value;
219
225
  if (arr.length === 0) return "";
@@ -254,26 +260,51 @@ async function submit(next) {
254
260
  pending.value = false;
255
261
  }
256
262
  }
257
- function handleSelect(next) {
258
- const keys = Array.isArray(next) ? next.filter((k) => typeof k === "string") : [];
263
+ async function commit(keys) {
264
+ draftKeys.value = [...keys];
259
265
  const mapped = [];
260
266
  for (const key of keys) {
261
267
  const entry = entries.value.find((e) => e.key === key);
262
268
  if (entry) mapped.push(entry.value);
263
269
  }
264
- void submit(mapped);
270
+ try {
271
+ await submit(mapped);
272
+ } finally {
273
+ draftKeys.value = null;
274
+ }
275
+ }
276
+ function handleSelect(next) {
277
+ const keys = Array.isArray(next) ? next.filter((k) => typeof k === "string") : [];
278
+ draftKeys.value = keys;
279
+ draftDirty.value = true;
265
280
  }
266
281
  const showClear = computed(
267
282
  () => !isDisabled.value && selectedEntries.value.length > 0
268
283
  );
284
+ const hoveredKey = ref(null);
285
+ function handleOpenChange(next) {
286
+ if (next === open.value) return;
287
+ open.value = next;
288
+ hoveredKey.value = next ? entries.value[0]?.key ?? null : null;
289
+ if (next) {
290
+ draftKeys.value = [...committedKeys.value];
291
+ draftDirty.value = false;
292
+ return;
293
+ }
294
+ const wasDirty = draftDirty.value;
295
+ draftDirty.value = false;
296
+ if (!wasDirty) {
297
+ draftKeys.value = null;
298
+ return;
299
+ }
300
+ void commit(draftKeys.value ?? []);
301
+ }
269
302
  function handleClear() {
303
+ draftDirty.value = false;
270
304
  open.value = false;
271
- void submit([]);
305
+ hoveredKey.value = null;
306
+ void commit([]);
272
307
  }
273
- const hoveredKey = ref(null);
274
- watch(open, (isOpen) => {
275
- hoveredKey.value = isOpen ? entries.value[0]?.key ?? null : null;
276
- });
277
308
  const hoveredEntry = computed(
278
309
  () => entries.value.find((e) => e.key === hoveredKey.value)
279
310
  );
@@ -297,7 +328,8 @@ const anyHasTooltip = computed(
297
328
  </span>
298
329
  <Popover
299
330
  v-else
300
- v-model:open="open"
331
+ :open="open"
332
+ @update:open="handleOpenChange"
301
333
  >
302
334
  <PopoverAnchor as-child>
303
335
  <InputGroup
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { reactiveOmit, useCurrentElement } from "@vueuse/core";
3
- import { ListboxItem, useForwardPropsEmits, useId } from "reka-ui";
3
+ import { injectListboxRootContext, ListboxItem, useForwardPropsEmits, useId } from "reka-ui";
4
4
  import { computed, onMounted, onUnmounted, ref } from "vue";
5
5
  import { cn } from "../../../utils/cn";
6
6
  import { useCommand, useCommandGroup } from ".";
@@ -17,6 +17,16 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
17
17
  const id = useId();
18
18
  const { filterState, allItems, allGroups } = useCommand();
19
19
  const groupContext = useCommandGroup();
20
+ const listboxRoot = injectListboxRootContext();
21
+ function handleSelect(event) {
22
+ filterState.search = "";
23
+ if (!listboxRoot.multiple.value) return;
24
+ event.preventDefault();
25
+ listboxRoot.onValueChange(props.value);
26
+ if (currentElement.value instanceof HTMLElement) {
27
+ listboxRoot.changeHighlight(currentElement.value);
28
+ }
29
+ }
20
30
  const isRender = computed(() => {
21
31
  if (!filterState.search) {
22
32
  return true;
@@ -56,9 +66,7 @@ onUnmounted(() => {
56
66
  ref="itemRef"
57
67
  data-slot="command-item"
58
68
  :class="cn('data-highlighted:bg-zinc-100 data-highlighted:text-zinc-700 hover:bg-zinc-50 [&_svg:not([class*=\'text-\'])]:text-zinc-700 cursor-pointer relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=\'size-\'])]:size-4', props.class)"
59
- @select="() => {
60
- filterState.search = '';
61
- }"
69
+ @select="handleSelect"
62
70
  >
63
71
  <slot />
64
72
  </ListboxItem>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/config",
3
- "version": "2.3.25",
3
+ "version": "2.3.27",
4
4
  "description": "Configurable UI for SHWFED",
5
5
  "type": "module",
6
6
  "publishConfig": {