@shwfed/config 2.5.2 → 2.6.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/dist/mcp.mjs +8 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +6 -1
- package/dist/preview/assets/{config-Du8jTCck.js → config-BF-HYbrD.js} +1 -1
- package/dist/preview/assets/{config-D9Igjtte.js → config-CevoqLCe.js} +1 -1
- package/dist/preview/assets/{config-BVTakYXq.js → config-Co--BPbb.js} +1 -1
- package/dist/preview/assets/{config-Bo8qCYUr.js → config-DMOAQ9zl.js} +1 -1
- package/dist/preview/assets/{config-DLuQtN-6.js → config-Du7AdGIY.js} +1 -1
- package/dist/preview/assets/{config-DO6VRND9.js → config-LdNKbqCx.js} +1 -1
- package/dist/preview/assets/{config-CoykdrWz.js → config-RACtdV3v.js} +1 -1
- package/dist/preview/assets/{config-CMWb8uI8.js → config-VChcvg_y.js} +1 -1
- package/dist/preview/assets/{config-BHInx1QR.js → config-oBOXGUjR.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-CjPPVjHf.js → definition.vue_vue_type_script_setup_true_lang-Ma8i-2ox.js} +1 -1
- package/dist/preview/assets/index-C-nzF9-u.js +1 -0
- package/dist/preview/assets/index-CHEiFlnE.css +1 -0
- package/dist/preview/assets/index-rxUrWg1Y.js +680 -0
- package/dist/preview/assets/{runtime-BnXLPPWc.js → runtime-BNzaUtd-.js} +1 -1
- package/dist/preview/assets/{runtime-CCBYA0xX.js → runtime-CAj4SjAs.js} +1 -1
- package/dist/preview/assets/{runtime-as-8tVjx.js → runtime-CE_42oyr.js} +1 -1
- package/dist/preview/assets/{runtime-D7cNZpnE.js → runtime-CLMz0SYI.js} +1 -1
- package/dist/preview/assets/{runtime-Cxl0E6Hg.js → runtime-COCfVWBL.js} +1 -1
- package/dist/preview/assets/{runtime-DTC0oZPz.js → runtime-GfHY6wxJ.js} +1 -1
- package/dist/preview/assets/{runtime-ePHYJvDG.js → runtime-Y00C-S73.js} +1 -1
- package/dist/preview/assets/{runtime-Bs_EtAsE.js → runtime-llw5ZA1Z.js} +1 -1
- package/dist/preview/assets/{runtime-BVShchDS.js → runtime-wAJ77Q3a.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/config.vue +37 -16
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.number-input/config.vue +80 -34
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.switch.local/config.vue +48 -18
- package/dist/runtime/components/table/columns/2026-05-20/com.shwfed.table.column.text-input/config.vue +44 -17
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +2 -2
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +2 -2
- package/dist/runtime/components/table/config.vue +17 -1
- package/dist/runtime/components/table/index.vue +1 -0
- package/dist/runtime/components/table/row-provider.d.vue.ts +1 -0
- package/dist/runtime/components/table/row-provider.vue +9 -2
- package/dist/runtime/components/table/row-provider.vue.d.ts +1 -0
- package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.d.vue.ts +22 -0
- package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue +134 -0
- package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue.d.ts +22 -0
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +2 -2
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +71 -50
- package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +2 -2
- package/dist/runtime/components/ui/expression-editor/cel-language.d.ts +16 -0
- package/dist/runtime/components/ui/expression-editor/cel-language.js +114 -0
- package/dist/runtime/components/ui/expression-editor/chip-extension.d.ts +5 -0
- package/dist/runtime/components/ui/expression-editor/chip-extension.js +123 -0
- package/dist/runtime/components/ui/expression-editor/picker-entries.d.ts +17 -0
- package/dist/runtime/components/ui/expression-editor/picker-entries.js +34 -0
- package/dist/runtime/components/ui/expression-editor/scope-refs.d.ts +20 -0
- package/dist/runtime/components/ui/expression-editor/scope-refs.js +39 -0
- package/dist/runtime/share/expression.js +9 -0
- package/dist/runtime/utils/cel-context.d.ts +36 -0
- package/dist/runtime/utils/cel-context.js +39 -0
- package/package.json +6 -1
- package/dist/preview/assets/index-CLhRphC4.js +0 -668
- package/dist/preview/assets/index-DRXgXfoM.js +0 -1
- package/dist/preview/assets/index-nvAUAYGM.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-Ma8i-2ox.js";import{d as n,e as a,u as c,o as f,at as i}from"./index-rxUrWg1Y.js";const _=n({name:"ShwfedPrototypeActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(t){const e=i;return(r,s)=>(f(),a(o,{"action-id":t.buttonId,effect:c(e)},null,8,["action-id","effect"]))}});export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as u,ae as i,e as l,u as p,$ as m,o as d,k as f,ah as _,ai as k,al as w,am as x,ao as g}from"./index-
|
|
1
|
+
import{d as u,ae as i,e as l,u as p,$ as m,o as d,k as f,ah as _,ai as k,al as w,am as x,ao as g}from"./index-rxUrWg1Y.js";const B=u({name:"ShwfedMarkdownItemRuntime",__name:"runtime",props:{config:{}},setup(n){const o=n,{locale:s}=i(),t=g(),c=(e,a)=>w(e,{...x(t),...a}),r=m(()=>{const e=_(o.config.content,s.value)??"";return k(e,c)});return(e,a)=>(d(),l(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{d as l,ae as u,af as g,ag as m,ah as d,ai as p,aj as x,ak as k,e as E,u as _,al as h,am as w,an as C,ao as I,ap as j,o as v}from"./index-
|
|
1
|
+
import{d as l,ae as u,af as g,ag as m,ah as d,ai as p,aj as x,ak as k,e as E,u as _,al as h,am as w,an as C,ao as I,ap as j,o as v}from"./index-rxUrWg1Y.js";import{_ as y}from"./definition.vue_vue_type_script_setup_true_lang-Ma8i-2ox.js";const q=l({name:"ShwfedHttpRequestConfirmActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(s){const e=s,{locale:c}=u(),i=I(),t=(n,o)=>h(n,{...w(i),...o}),r=j(),a=C(),f=g(function*(){if(a&&!(yield*m(()=>a())))return;const n=d(e.config.markdown,c.value)??"",o=p(n,t);(yield*x({content:o,icon:e.config.icon,color:e.config.color}))||(yield*k(e.config.expression,t,{messageExpression:e.config.messageExpression,resultExpression:e.config.resultExpression,channel:r,triggers:{success:e.config.onSuccess,warning:e.config.onWarning,error:e.config.onError,info:e.config.onInfo}}))});return(n,o)=>(v(),E(y,{"action-id":s.buttonId,effect:_(f)},null,8,["action-id","effect"]))}});export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as s,ae as p,av as x,af as M,ah as c,aw as T,ax as N,e as b,w as d,u,a0 as k,a1 as w,ap as L,au as S,o as A,f as I,ay as z,g as f,az as F,aA as H,a7 as V,ao as $,aB as r,aC as m,aD as j}from"./index-
|
|
1
|
+
import{d as s,ae as p,av as x,af as M,ah as c,aw as T,ax as N,e as b,w as d,u,a0 as k,a1 as w,ap as L,au as S,o as A,f as I,ay as z,g as f,az as F,aA as H,a7 as V,ao as $,aB as r,aC as m,aD as j}from"./index-rxUrWg1Y.js";import{_ as K}from"./definition.vue_vue_type_script_setup_true_lang-Ma8i-2ox.js";const D=s({name:"ShwfedModalLayoutActionRuntime",__name:"runtime",props:{buttonId:{},config:{},buttonTitle:{}},setup(t){const n=t,{locale:l}=p(),v=e=>{},h=$(),i=w(r,void 0),g=L(),o=k(null),C=x(n.buttonId,{close:()=>S(()=>{o.value?.()})},g),y=s({name:"ModalBoundaryBridge",setup(e,{slots:a}){return H(h),m(j,C),i&&m(r,i),()=>a.default?.()}}),E=(e,a)=>V()?.(e,a),_=M(function*(){const e=c(n.config.modalTitle,l.value)??c(n.buttonTitle,l.value)??"",{modal:a,close:B}=yield*T({title:e,width:n.config.modalWidth});o.value=()=>N(B()),yield*a,o.value=null});return(e,a)=>(A(),b(K,{"action-id":t.buttonId,effect:u(_)},{default:d(()=>[I("div",{style:z(t.config.modalMinHeight?`min-height: ${t.config.modalMinHeight}`:void 0)},[f(u(y),null,{default:d(()=>[f(F,{"slot-value":t.config.slot,configure:v,"find-entry":E},null,8,["slot-value"])]),_:1})],4)]),_:1},8,["action-id","effect"]))}});export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as u,aq as p,ag as g,ar as a,as as m,ak as l,e as d,u as x,al as E,am as _,an as h,ao as C,ap as k,o as q}from"./index-
|
|
1
|
+
import{d as u,aq as p,ag as g,ar as a,as as m,ak as l,e as d,u as x,al as E,am as _,an as h,ao as C,ap as k,o as q}from"./index-rxUrWg1Y.js";import{_ as v}from"./definition.vue_vue_type_script_setup_true_lang-Ma8i-2ox.js";const R=u({name:"ShwfedHttpRequestActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(o){const e=o,c=C(),i=(n,s)=>E(n,{..._(c),...s}),r=k(),t=h(),f=p(()=>{const n=t?g(()=>t()):a(!0);return m(n,s=>s?l(e.config.expression,i,{messageExpression:e.config.messageExpression,resultExpression:e.config.resultExpression,channel:r,triggers:{success:e.config.onSuccess,warning:e.config.onWarning,error:e.config.onError,info:e.config.onInfo}}):a(void 0))});return(n,s)=>(q(),d(v,{"action-id":o.buttonId,effect:x(f)},null,8,["action-id","effect"]))}});export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as l,aH as g,aq as A,as as y,aE as _,e as h,u as S,al as b,am as j,ap as k,aI as C,o as B,ao as E}from"./index-
|
|
1
|
+
import{d as l,aH as g,aq as A,as as y,aE as _,e as h,u as S,al as b,am as j,ap as k,aI as C,o as B,ao as E}from"./index-rxUrWg1Y.js";import{_ as I}from"./definition.vue_vue_type_script_setup_true_lang-Ma8i-2ox.js";const F=l({name:"ShwfedStateWriteActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(r){const s=r,i=E(),f=(e,t)=>b(e,{...j(i),...t}),n=g(),o=n.kind==="form"&&n.parent?n.parent:n,u=k(),m=C((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)=>(B(),h(I,{"action-id":r.buttonId,effect:S(d)},null,8,["action-id","effect"]))}});export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as s}from"./definition.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{_ as s}from"./definition.vue_vue_type_script_setup_true_lang-Ma8i-2ox.js";import{d as c,aq as o,aE as i,e as r,u as f,ap as u,o as p}from"./index-rxUrWg1Y.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(m,d)=>(p(),r(s,{"action-id":e.buttonId,effect:f(a)},null,8,["action-id","effect"]))}});export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as E,aq as _,af as S,au as r,aE as m,aF as j,aG as v,e as x,u as B,al as L,am as b,ap as k,ao as C,o as R}from"./index-
|
|
1
|
+
import{d as E,aq as _,af as S,au as r,aE as m,aF as j,aG as v,e as x,u as B,al as L,am as b,ap as k,ao as C,o as R}from"./index-rxUrWg1Y.js";import{_ as T}from"./definition.vue_vue_type_script_setup_true_lang-Ma8i-2ox.js";const O=E({name:"ShwfedHttpDownloadActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(d){const c=d,g=C(),t=(e,n)=>L(e,{...b(g),...n}),l=k(),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=_(()=>S(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*j(t(o,a),s=>p.has(s)?s:"success");if(n!==void 0){const s=yield*t(n,a);yield*r(()=>v[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(),x(T,{"action-id":d.buttonId,effect:B(y)},null,8,["action-id","effect"]))}});export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as i,aq as f,as as r,au as u,e as d,u as m,al as l,am as p,ao as _,o as g}from"./index-
|
|
1
|
+
import{d as i,aq as f,as as r,au as u,e as d,u as m,al as l,am as p,ao as _,o as g}from"./index-rxUrWg1Y.js";import{_ as h}from"./definition.vue_vue_type_script_setup_true_lang-Ma8i-2ox.js";const B=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=>u(()=>{window.open(n,t.config.mode)})));return(n,a)=>(g(),d(h,{"action-id":e.buttonId,effect:m(s)},null,8,["action-id","effect"]))}});export{B as default};
|
package/dist/preview/index.html
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
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-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
13
|
+
<script type="module" crossorigin src="./assets/index-rxUrWg1Y.js"></script>
|
|
14
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CHEiFlnE.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="app"></div>
|
|
@@ -50,28 +50,44 @@ const JSON_VARS = {
|
|
|
50
50
|
const disabledModel = computed({
|
|
51
51
|
get: () => value.value.disabled ?? "",
|
|
52
52
|
set: (v) => {
|
|
53
|
-
if (v === "")
|
|
54
|
-
|
|
53
|
+
if (v === "") {
|
|
54
|
+
const { disabled: _drop, ...rest } = value.value;
|
|
55
|
+
value.value = rest;
|
|
56
|
+
} else {
|
|
57
|
+
value.value = { ...value.value, disabled: v };
|
|
58
|
+
}
|
|
55
59
|
}
|
|
56
60
|
});
|
|
57
61
|
const onChangeModel = computed({
|
|
58
62
|
get: () => value.value.onChange ?? "",
|
|
59
63
|
set: (v) => {
|
|
60
|
-
if (v === "")
|
|
61
|
-
|
|
64
|
+
if (v === "") {
|
|
65
|
+
const { onChange: _drop, ...rest } = value.value;
|
|
66
|
+
value.value = rest;
|
|
67
|
+
} else {
|
|
68
|
+
value.value = { ...value.value, onChange: v };
|
|
69
|
+
}
|
|
62
70
|
}
|
|
63
71
|
});
|
|
64
72
|
const successMessageModel = computed({
|
|
65
73
|
get: () => value.value.successMessage ?? "",
|
|
66
74
|
set: (v) => {
|
|
67
|
-
if (v === "")
|
|
68
|
-
|
|
75
|
+
if (v === "") {
|
|
76
|
+
const { successMessage: _drop, ...rest } = value.value;
|
|
77
|
+
value.value = rest;
|
|
78
|
+
} else {
|
|
79
|
+
value.value = { ...value.value, successMessage: v };
|
|
80
|
+
}
|
|
69
81
|
}
|
|
70
82
|
});
|
|
71
83
|
const triggers = computed(() => value.value.triggers ?? []);
|
|
72
84
|
function updateTriggers(next) {
|
|
73
|
-
if (next.length === 0)
|
|
74
|
-
|
|
85
|
+
if (next.length === 0) {
|
|
86
|
+
const { triggers: _drop, ...rest } = value.value;
|
|
87
|
+
value.value = rest;
|
|
88
|
+
} else {
|
|
89
|
+
value.value = { ...value.value, triggers: next };
|
|
90
|
+
}
|
|
75
91
|
}
|
|
76
92
|
</script>
|
|
77
93
|
|
|
@@ -92,7 +108,10 @@ function updateTriggers(next) {
|
|
|
92
108
|
</template>
|
|
93
109
|
{{ fieldTitle("title") }}
|
|
94
110
|
</FieldLabel>
|
|
95
|
-
<Locale
|
|
111
|
+
<Locale
|
|
112
|
+
:model-value="value.title"
|
|
113
|
+
@update:model-value="(v) => value = { ...value, title: v }"
|
|
114
|
+
/>
|
|
96
115
|
</Field>
|
|
97
116
|
<Field orientation="vertical">
|
|
98
117
|
<FieldLabel class="text-xs text-zinc-500">
|
|
@@ -109,8 +128,9 @@ function updateTriggers(next) {
|
|
|
109
128
|
{{ fieldTitle("tooltip") }}
|
|
110
129
|
</FieldLabel>
|
|
111
130
|
<Locale
|
|
112
|
-
|
|
131
|
+
:model-value="value.tooltip"
|
|
113
132
|
markdown
|
|
133
|
+
@update:model-value="(v) => value = { ...value, tooltip: v }"
|
|
114
134
|
/>
|
|
115
135
|
</Field>
|
|
116
136
|
</div>
|
|
@@ -130,10 +150,11 @@ function updateTriggers(next) {
|
|
|
130
150
|
{{ fieldTitle("accessor") }}
|
|
131
151
|
</FieldLabel>
|
|
132
152
|
<ExpressionEditor
|
|
133
|
-
|
|
153
|
+
:model-value="value.accessor"
|
|
134
154
|
placeholder="如 row.enabled"
|
|
135
155
|
result-type="bool"
|
|
136
156
|
:extra-vars="ROW_VARS"
|
|
157
|
+
@update:model-value="(v) => value = { ...value, accessor: v }"
|
|
137
158
|
/>
|
|
138
159
|
</Field>
|
|
139
160
|
<Field orientation="vertical">
|
|
@@ -166,7 +187,7 @@ function updateTriggers(next) {
|
|
|
166
187
|
<DropdownMenuItem
|
|
167
188
|
v-for="opt in ALIGN_OPTIONS"
|
|
168
189
|
:key="opt.value"
|
|
169
|
-
@select="value
|
|
190
|
+
@select="value = { ...value, align: opt.value }"
|
|
170
191
|
>
|
|
171
192
|
<Icon :icon="opt.icon" />
|
|
172
193
|
{{ opt.label }}
|
|
@@ -178,13 +199,13 @@ function updateTriggers(next) {
|
|
|
178
199
|
:model-value="value.size"
|
|
179
200
|
:disabled="value.grow"
|
|
180
201
|
:min="0"
|
|
181
|
-
@update:model-value="(v) => value
|
|
202
|
+
@update:model-value="(v) => value = { ...value, size: v }"
|
|
182
203
|
/>
|
|
183
204
|
<InputGroupAddon align="inline-end">
|
|
184
205
|
<InputGroupButton
|
|
185
206
|
:variant="value.grow ? 'primary' : 'ghost'"
|
|
186
207
|
size="xs"
|
|
187
|
-
@click="value
|
|
208
|
+
@click="value = { ...value, grow: !value.grow }"
|
|
188
209
|
>
|
|
189
210
|
<Icon :icon="value.grow ? 'fluent:lock-closed-20-regular' : 'fluent:arrow-autofit-width-20-regular'" />
|
|
190
211
|
{{ fieldTitle("grow") }}
|
|
@@ -299,13 +320,13 @@ function updateTriggers(next) {
|
|
|
299
320
|
<InputGroupInput
|
|
300
321
|
:model-value="value.sortKey"
|
|
301
322
|
placeholder="例:created_at"
|
|
302
|
-
@update:model-value="(v) => value
|
|
323
|
+
@update:model-value="(v) => value = { ...value, sortKey: v || void 0 }"
|
|
303
324
|
/>
|
|
304
325
|
<InputGroupAddon align="inline-end">
|
|
305
326
|
<InputGroupButton
|
|
306
327
|
:variant="value.enableSorting ? 'primary' : 'ghost'"
|
|
307
328
|
size="xs"
|
|
308
|
-
@click="value
|
|
329
|
+
@click="value = { ...value, enableSorting: !value.enableSorting }"
|
|
309
330
|
>
|
|
310
331
|
<Icon :icon="value.enableSorting ? 'fluent:arrow-sort-up-16-regular' : 'fluent:arrow-sort-16-regular'" />
|
|
311
332
|
{{ fieldTitle("enableSorting") }}
|
|
@@ -42,36 +42,56 @@ const bindingText = computed({
|
|
|
42
42
|
get: () => value.value.binding ?? "",
|
|
43
43
|
set: (v) => {
|
|
44
44
|
const trimmed = v.trim();
|
|
45
|
-
if (trimmed === "")
|
|
46
|
-
|
|
45
|
+
if (trimmed === "") {
|
|
46
|
+
const { binding: _drop, ...rest } = value.value;
|
|
47
|
+
value.value = rest;
|
|
48
|
+
} else {
|
|
49
|
+
value.value = { ...value.value, binding: trimmed };
|
|
50
|
+
}
|
|
47
51
|
}
|
|
48
52
|
});
|
|
49
53
|
const hiddenModel = computed({
|
|
50
54
|
get: () => value.value.hidden ?? "",
|
|
51
55
|
set: (v) => {
|
|
52
|
-
if (v === "")
|
|
53
|
-
|
|
56
|
+
if (v === "") {
|
|
57
|
+
const { hidden: _drop, ...rest } = value.value;
|
|
58
|
+
value.value = rest;
|
|
59
|
+
} else {
|
|
60
|
+
value.value = { ...value.value, hidden: v };
|
|
61
|
+
}
|
|
54
62
|
}
|
|
55
63
|
});
|
|
56
64
|
const disabledModel = computed({
|
|
57
65
|
get: () => value.value.disabled ?? "",
|
|
58
66
|
set: (v) => {
|
|
59
|
-
if (v === "")
|
|
60
|
-
|
|
67
|
+
if (v === "") {
|
|
68
|
+
const { disabled: _drop, ...rest } = value.value;
|
|
69
|
+
value.value = rest;
|
|
70
|
+
} else {
|
|
71
|
+
value.value = { ...value.value, disabled: v };
|
|
72
|
+
}
|
|
61
73
|
}
|
|
62
74
|
});
|
|
63
75
|
const readonlyModel = computed({
|
|
64
76
|
get: () => value.value.readonly ?? "",
|
|
65
77
|
set: (v) => {
|
|
66
|
-
if (v === "")
|
|
67
|
-
|
|
78
|
+
if (v === "") {
|
|
79
|
+
const { readonly: _drop, ...rest } = value.value;
|
|
80
|
+
value.value = rest;
|
|
81
|
+
} else {
|
|
82
|
+
value.value = { ...value.value, readonly: v };
|
|
83
|
+
}
|
|
68
84
|
}
|
|
69
85
|
});
|
|
70
86
|
const derivedModel = computed({
|
|
71
87
|
get: () => value.value.derived,
|
|
72
88
|
set: (v) => {
|
|
73
|
-
if (v == null)
|
|
74
|
-
|
|
89
|
+
if (v == null) {
|
|
90
|
+
const { derived: _drop, ...rest } = value.value;
|
|
91
|
+
value.value = rest;
|
|
92
|
+
} else {
|
|
93
|
+
value.value = { ...value.value, derived: v };
|
|
94
|
+
}
|
|
75
95
|
}
|
|
76
96
|
});
|
|
77
97
|
const currentRoundingModeLabel = computed(
|
|
@@ -79,23 +99,48 @@ const currentRoundingModeLabel = computed(
|
|
|
79
99
|
);
|
|
80
100
|
function onPrecisionChange(v) {
|
|
81
101
|
if (v === void 0) {
|
|
82
|
-
|
|
83
|
-
|
|
102
|
+
const { precision: _p, roundingMode: _r, ...rest } = value.value;
|
|
103
|
+
value.value = rest;
|
|
104
|
+
} else if (value.value.roundingMode === void 0) {
|
|
105
|
+
value.value = { ...value.value, precision: v, roundingMode: "round" };
|
|
84
106
|
} else {
|
|
85
|
-
value.value.precision
|
|
86
|
-
if (value.value.roundingMode === void 0) value.value.roundingMode = "round";
|
|
107
|
+
value.value = { ...value.value, precision: v };
|
|
87
108
|
}
|
|
88
109
|
}
|
|
89
110
|
function onRoundingModeChange(mode) {
|
|
90
|
-
value.value.roundingMode
|
|
111
|
+
value.value = { ...value.value, roundingMode: mode };
|
|
91
112
|
}
|
|
92
113
|
function onStepChange(v) {
|
|
93
|
-
if (v === void 0 || !(v > 0))
|
|
94
|
-
|
|
114
|
+
if (v === void 0 || !(v > 0)) {
|
|
115
|
+
const { step: _drop, ...rest } = value.value;
|
|
116
|
+
value.value = rest;
|
|
117
|
+
} else {
|
|
118
|
+
value.value = { ...value.value, step: v };
|
|
119
|
+
}
|
|
95
120
|
}
|
|
96
121
|
function onValueAsStringChange(next) {
|
|
97
|
-
if (next)
|
|
98
|
-
|
|
122
|
+
if (next) {
|
|
123
|
+
value.value = { ...value.value, valueAsString: true };
|
|
124
|
+
} else {
|
|
125
|
+
const { valueAsString: _drop, ...rest } = value.value;
|
|
126
|
+
value.value = rest;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function onMinChange(v) {
|
|
130
|
+
if (v.length > 0) {
|
|
131
|
+
value.value = { ...value.value, min: v };
|
|
132
|
+
} else {
|
|
133
|
+
const { min: _drop, ...rest } = value.value;
|
|
134
|
+
value.value = rest;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function onMaxChange(v) {
|
|
138
|
+
if (v.length > 0) {
|
|
139
|
+
value.value = { ...value.value, max: v };
|
|
140
|
+
} else {
|
|
141
|
+
const { max: _drop, ...rest } = value.value;
|
|
142
|
+
value.value = rest;
|
|
143
|
+
}
|
|
99
144
|
}
|
|
100
145
|
</script>
|
|
101
146
|
|
|
@@ -116,7 +161,10 @@ function onValueAsStringChange(next) {
|
|
|
116
161
|
</template>
|
|
117
162
|
{{ fieldTitle("title") }}
|
|
118
163
|
</FieldLabel>
|
|
119
|
-
<Locale
|
|
164
|
+
<Locale
|
|
165
|
+
:model-value="value.title"
|
|
166
|
+
@update:model-value="(v) => value = { ...value, title: v }"
|
|
167
|
+
/>
|
|
120
168
|
</Field>
|
|
121
169
|
<Field orientation="vertical">
|
|
122
170
|
<FieldLabel class="text-xs text-zinc-500">
|
|
@@ -133,8 +181,9 @@ function onValueAsStringChange(next) {
|
|
|
133
181
|
{{ fieldTitle("tooltip") }}
|
|
134
182
|
</FieldLabel>
|
|
135
183
|
<Locale
|
|
136
|
-
|
|
184
|
+
:model-value="value.tooltip"
|
|
137
185
|
markdown
|
|
186
|
+
@update:model-value="(v) => value = { ...value, tooltip: v }"
|
|
138
187
|
/>
|
|
139
188
|
</Field>
|
|
140
189
|
</div>
|
|
@@ -175,7 +224,10 @@ function onValueAsStringChange(next) {
|
|
|
175
224
|
</template>
|
|
176
225
|
{{ fieldTitle("placeholder") }}
|
|
177
226
|
</FieldLabel>
|
|
178
|
-
<Locale
|
|
227
|
+
<Locale
|
|
228
|
+
:model-value="value.placeholder"
|
|
229
|
+
@update:model-value="(v) => value = { ...value, placeholder: v }"
|
|
230
|
+
/>
|
|
179
231
|
</Field>
|
|
180
232
|
<Field orientation="vertical">
|
|
181
233
|
<FieldLabel class="text-xs text-zinc-500">
|
|
@@ -196,13 +248,13 @@ function onValueAsStringChange(next) {
|
|
|
196
248
|
:model-value="value.size"
|
|
197
249
|
:disabled="value.grow"
|
|
198
250
|
:min="0"
|
|
199
|
-
@update:model-value="(v) => value
|
|
251
|
+
@update:model-value="(v) => value = { ...value, size: v }"
|
|
200
252
|
/>
|
|
201
253
|
<InputGroupAddon align="inline-end">
|
|
202
254
|
<InputGroupButton
|
|
203
255
|
:variant="value.grow ? 'primary' : 'ghost'"
|
|
204
256
|
size="xs"
|
|
205
|
-
@click="value
|
|
257
|
+
@click="value = { ...value, grow: !value.grow }"
|
|
206
258
|
>
|
|
207
259
|
<Icon :icon="value.grow ? 'fluent:lock-closed-20-regular' : 'fluent:arrow-autofit-width-20-regular'" />
|
|
208
260
|
{{ fieldTitle("grow") }}
|
|
@@ -325,10 +377,7 @@ function onValueAsStringChange(next) {
|
|
|
325
377
|
result-type="number"
|
|
326
378
|
class="min-h-10"
|
|
327
379
|
:extra-vars="ROW_VARS"
|
|
328
|
-
@update:model-value="
|
|
329
|
-
if (v.length > 0) value.min = v;
|
|
330
|
-
else delete value.min;
|
|
331
|
-
}"
|
|
380
|
+
@update:model-value="onMinChange"
|
|
332
381
|
/>
|
|
333
382
|
</Field>
|
|
334
383
|
<Field orientation="vertical">
|
|
@@ -351,10 +400,7 @@ function onValueAsStringChange(next) {
|
|
|
351
400
|
result-type="number"
|
|
352
401
|
class="min-h-10"
|
|
353
402
|
:extra-vars="ROW_VARS"
|
|
354
|
-
@update:model-value="
|
|
355
|
-
if (v.length > 0) value.max = v;
|
|
356
|
-
else delete value.max;
|
|
357
|
-
}"
|
|
403
|
+
@update:model-value="onMaxChange"
|
|
358
404
|
/>
|
|
359
405
|
</Field>
|
|
360
406
|
</div>
|
|
@@ -469,13 +515,13 @@ function onValueAsStringChange(next) {
|
|
|
469
515
|
<InputGroupInput
|
|
470
516
|
:model-value="value.sortKey"
|
|
471
517
|
placeholder="例:created_at"
|
|
472
|
-
@update:model-value="(v) => value
|
|
518
|
+
@update:model-value="(v) => value = { ...value, sortKey: v || void 0 }"
|
|
473
519
|
/>
|
|
474
520
|
<InputGroupAddon align="inline-end">
|
|
475
521
|
<InputGroupButton
|
|
476
522
|
:variant="value.enableSorting ? 'primary' : 'ghost'"
|
|
477
523
|
size="xs"
|
|
478
|
-
@click="value
|
|
524
|
+
@click="value = { ...value, enableSorting: !value.enableSorting }"
|
|
479
525
|
>
|
|
480
526
|
<Icon :icon="value.enableSorting ? 'fluent:arrow-sort-up-16-regular' : 'fluent:arrow-sort-16-regular'" />
|
|
481
527
|
{{ fieldTitle("enableSorting") }}
|
|
@@ -30,36 +30,56 @@ const bindingText = computed({
|
|
|
30
30
|
get: () => value.value.binding ?? "",
|
|
31
31
|
set: (v) => {
|
|
32
32
|
const trimmed = v.trim();
|
|
33
|
-
if (trimmed === "")
|
|
34
|
-
|
|
33
|
+
if (trimmed === "") {
|
|
34
|
+
const { binding: _drop, ...rest } = value.value;
|
|
35
|
+
value.value = rest;
|
|
36
|
+
} else {
|
|
37
|
+
value.value = { ...value.value, binding: trimmed };
|
|
38
|
+
}
|
|
35
39
|
}
|
|
36
40
|
});
|
|
37
41
|
const hiddenModel = computed({
|
|
38
42
|
get: () => value.value.hidden ?? "",
|
|
39
43
|
set: (v) => {
|
|
40
|
-
if (v === "")
|
|
41
|
-
|
|
44
|
+
if (v === "") {
|
|
45
|
+
const { hidden: _drop, ...rest } = value.value;
|
|
46
|
+
value.value = rest;
|
|
47
|
+
} else {
|
|
48
|
+
value.value = { ...value.value, hidden: v };
|
|
49
|
+
}
|
|
42
50
|
}
|
|
43
51
|
});
|
|
44
52
|
const disabledModel = computed({
|
|
45
53
|
get: () => value.value.disabled ?? "",
|
|
46
54
|
set: (v) => {
|
|
47
|
-
if (v === "")
|
|
48
|
-
|
|
55
|
+
if (v === "") {
|
|
56
|
+
const { disabled: _drop, ...rest } = value.value;
|
|
57
|
+
value.value = rest;
|
|
58
|
+
} else {
|
|
59
|
+
value.value = { ...value.value, disabled: v };
|
|
60
|
+
}
|
|
49
61
|
}
|
|
50
62
|
});
|
|
51
63
|
const readonlyModel = computed({
|
|
52
64
|
get: () => value.value.readonly ?? "",
|
|
53
65
|
set: (v) => {
|
|
54
|
-
if (v === "")
|
|
55
|
-
|
|
66
|
+
if (v === "") {
|
|
67
|
+
const { readonly: _drop, ...rest } = value.value;
|
|
68
|
+
value.value = rest;
|
|
69
|
+
} else {
|
|
70
|
+
value.value = { ...value.value, readonly: v };
|
|
71
|
+
}
|
|
56
72
|
}
|
|
57
73
|
});
|
|
58
74
|
const derivedModel = computed({
|
|
59
75
|
get: () => value.value.derived,
|
|
60
76
|
set: (v) => {
|
|
61
|
-
if (v == null)
|
|
62
|
-
|
|
77
|
+
if (v == null) {
|
|
78
|
+
const { derived: _drop, ...rest } = value.value;
|
|
79
|
+
value.value = rest;
|
|
80
|
+
} else {
|
|
81
|
+
value.value = { ...value.value, derived: v };
|
|
82
|
+
}
|
|
63
83
|
}
|
|
64
84
|
});
|
|
65
85
|
</script>
|
|
@@ -81,7 +101,10 @@ const derivedModel = computed({
|
|
|
81
101
|
</template>
|
|
82
102
|
{{ fieldTitle("title") }}
|
|
83
103
|
</FieldLabel>
|
|
84
|
-
<Locale
|
|
104
|
+
<Locale
|
|
105
|
+
:model-value="value.title"
|
|
106
|
+
@update:model-value="(v) => value = { ...value, title: v }"
|
|
107
|
+
/>
|
|
85
108
|
</Field>
|
|
86
109
|
<Field orientation="vertical">
|
|
87
110
|
<FieldLabel class="text-xs text-zinc-500">
|
|
@@ -98,8 +121,9 @@ const derivedModel = computed({
|
|
|
98
121
|
{{ fieldTitle("tooltip") }}
|
|
99
122
|
</FieldLabel>
|
|
100
123
|
<Locale
|
|
101
|
-
|
|
124
|
+
:model-value="value.tooltip"
|
|
102
125
|
markdown
|
|
126
|
+
@update:model-value="(v) => value = { ...value, tooltip: v }"
|
|
103
127
|
/>
|
|
104
128
|
</Field>
|
|
105
129
|
</div>
|
|
@@ -145,13 +169,13 @@ const derivedModel = computed({
|
|
|
145
169
|
:model-value="value.size"
|
|
146
170
|
:disabled="value.grow"
|
|
147
171
|
:min="0"
|
|
148
|
-
@update:model-value="(v) => value
|
|
172
|
+
@update:model-value="(v) => value = { ...value, size: v }"
|
|
149
173
|
/>
|
|
150
174
|
<InputGroupAddon align="inline-end">
|
|
151
175
|
<InputGroupButton
|
|
152
176
|
:variant="value.grow ? 'primary' : 'ghost'"
|
|
153
177
|
size="xs"
|
|
154
|
-
@click="value
|
|
178
|
+
@click="value = { ...value, grow: !value.grow }"
|
|
155
179
|
>
|
|
156
180
|
<Icon :icon="value.grow ? 'fluent:lock-closed-20-regular' : 'fluent:arrow-autofit-width-20-regular'" />
|
|
157
181
|
{{ fieldTitle("grow") }}
|
|
@@ -173,7 +197,10 @@ const derivedModel = computed({
|
|
|
173
197
|
</template>
|
|
174
198
|
{{ fieldTitle("trueLabel") }}
|
|
175
199
|
</FieldLabel>
|
|
176
|
-
<Locale
|
|
200
|
+
<Locale
|
|
201
|
+
:model-value="value.trueLabel"
|
|
202
|
+
@update:model-value="(v) => value = { ...value, trueLabel: v }"
|
|
203
|
+
/>
|
|
177
204
|
</Field>
|
|
178
205
|
<Field orientation="vertical">
|
|
179
206
|
<FieldLabel class="text-xs text-zinc-500">
|
|
@@ -189,7 +216,10 @@ const derivedModel = computed({
|
|
|
189
216
|
</template>
|
|
190
217
|
{{ fieldTitle("falseLabel") }}
|
|
191
218
|
</FieldLabel>
|
|
192
|
-
<Locale
|
|
219
|
+
<Locale
|
|
220
|
+
:model-value="value.falseLabel"
|
|
221
|
+
@update:model-value="(v) => value = { ...value, falseLabel: v }"
|
|
222
|
+
/>
|
|
193
223
|
</Field>
|
|
194
224
|
</div>
|
|
195
225
|
<div class="grid grid-cols-2 gap-x-6 gap-y-4">
|
|
@@ -303,13 +333,13 @@ const derivedModel = computed({
|
|
|
303
333
|
<InputGroupInput
|
|
304
334
|
:model-value="value.sortKey"
|
|
305
335
|
placeholder="例:created_at"
|
|
306
|
-
@update:model-value="(v) => value
|
|
336
|
+
@update:model-value="(v) => value = { ...value, sortKey: v || void 0 }"
|
|
307
337
|
/>
|
|
308
338
|
<InputGroupAddon align="inline-end">
|
|
309
339
|
<InputGroupButton
|
|
310
340
|
:variant="value.enableSorting ? 'primary' : 'ghost'"
|
|
311
341
|
size="xs"
|
|
312
|
-
@click="value
|
|
342
|
+
@click="value = { ...value, enableSorting: !value.enableSorting }"
|
|
313
343
|
>
|
|
314
344
|
<Icon :icon="value.enableSorting ? 'fluent:arrow-sort-up-16-regular' : 'fluent:arrow-sort-16-regular'" />
|
|
315
345
|
{{ fieldTitle("enableSorting") }}
|