@shwfed/config 2.9.10 → 2.9.11
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 +2 -2
- package/dist/module.json +1 -1
- package/dist/preview/assets/{FieldGroup.vue_vue_type_script_setup_true_lang-B_lv0Qb4.js → FieldGroup.vue_vue_type_script_setup_true_lang-CN4xD2hQ.js} +1 -1
- package/dist/preview/assets/{badge-DkCzSREV.js → badge-CzfW1Ked.js} +1 -1
- package/dist/preview/assets/config-BdX3zl4t.js +1 -0
- package/dist/preview/assets/{config-y0whCdxg.js → config-Bzwfqv6w.js} +1 -1
- package/dist/preview/assets/{config-CfTdhIiz.js → config-C2y2XI2Q.js} +1 -1
- package/dist/preview/assets/{config-CLszlI7X.js → config-CCXJvpik.js} +1 -1
- package/dist/preview/assets/{config-BQZZzdBi.js → config-CDYZN7EX.js} +1 -1
- package/dist/preview/assets/{config-BzUZdTRZ.js → config-CPuERNUd.js} +1 -1
- package/dist/preview/assets/{config-CJYUWHSt.js → config-D37gWDMV.js} +1 -1
- package/dist/preview/assets/{config-DG9kUyIX.js → config-DbNukLyq.js} +1 -1
- package/dist/preview/assets/{config-IAY_3DyY.js → config-Op5IHwI_.js} +1 -1
- package/dist/preview/assets/{config-DnxWfe-p.js → config-e5aOGFb2.js} +1 -1
- package/dist/preview/assets/{config-BO6oZNCA.js → config-jJQ2fulH.js} +1 -1
- package/dist/preview/assets/{config-DcOjw4Ib.js → config-jzfHh7bp.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-D6Dl1HG7.js → definition.vue_vue_type_script_setup_true_lang-BgssDGxW.js} +1 -1
- package/dist/preview/assets/index-0vF7XQ-J.js +1 -0
- package/dist/preview/assets/{index-BxEz7F0S.js → index-CAIvIAWJ.js} +1 -1
- package/dist/preview/assets/{index-CEpio2Ai.js → index-Cyjm-GKs.js} +138 -138
- package/dist/preview/assets/{index-DEk1Sey_.css → index-D0eGXK5P.css} +1 -1
- package/dist/preview/assets/{item-BgY4KzDy.js → item-CUoRMMz1.js} +1 -1
- package/dist/preview/assets/{runtime-C9L73GlB.js → runtime-BALr-Cq0.js} +1 -1
- package/dist/preview/assets/{runtime-ObPbN32X.js → runtime-BvcTYin8.js} +1 -1
- package/dist/preview/assets/{runtime-DNCNcjrA.js → runtime-CHQwYQ80.js} +1 -1
- package/dist/preview/assets/{runtime-DIHeE12q.js → runtime-CU5fYNMI.js} +1 -1
- package/dist/preview/assets/{runtime-B1vIYtF_.js → runtime-CWt21RRo.js} +1 -1
- package/dist/preview/assets/{runtime-B0yAZrhv.js → runtime-C_epees8.js} +1 -1
- package/dist/preview/assets/{runtime-BweDVL2G.js → runtime-D3TnRYXn.js} +1 -1
- package/dist/preview/assets/{runtime-74HxxB_6.js → runtime-DWKqftSK.js} +1 -1
- package/dist/preview/assets/{runtime-BrfrrA2a.js → runtime-V_usL1Fa.js} +1 -1
- package/dist/preview/assets/runtime-wAz72cCJ.js +1 -0
- package/dist/preview/assets/{schema-meta-dmADcmVf.js → schema-meta-DwWuSVqk.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/config.vue +6 -1
- package/dist/runtime/components/actions/config.d.vue.ts +1 -0
- package/dist/runtime/components/actions/config.vue +6 -2
- package/dist/runtime/components/actions/config.vue.d.ts +1 -0
- package/dist/runtime/components/block-layout-editor/index.vue +15 -2
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/config.vue +5 -2
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/config.vue +4 -1
- package/dist/runtime/components/config/config.d.vue.ts +1 -1
- package/dist/runtime/components/config/config.vue +2 -33
- package/dist/runtime/components/config/config.vue.d.ts +1 -1
- package/dist/runtime/components/config/use-editor.d.ts +19 -0
- package/dist/runtime/components/config/use-editor.js +36 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.markdown/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.markdown/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/config.d.vue.ts +2 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/config.vue +3 -2
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/config.vue.d.ts +2 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/runtime.vue +1 -1
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.d.ts +3 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.js +1 -1
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +6 -6
- package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.actions/config.vue +1 -0
- 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 +1 -1
- package/package.json +1 -1
- package/dist/preview/assets/config-9Ny1em1E.js +0 -1
- package/dist/preview/assets/index-eXjRNljQ.js +0 -1
- package/dist/preview/assets/runtime--G6ZYJWm.js +0 -1
package/dist/mcp.mjs
CHANGED
|
@@ -83185,7 +83185,7 @@ const metadata$18 = {
|
|
|
83185
83185
|
name: "Markdown",
|
|
83186
83186
|
icon: "fluent:markdown-20-regular",
|
|
83187
83187
|
w: { initial: 8, min: 2, max: Infinity },
|
|
83188
|
-
h: { initial: 2, min: 2, max: Infinity }
|
|
83188
|
+
h: { initial: 2, min: 2, max: Infinity, grow: true }
|
|
83189
83189
|
};
|
|
83190
83190
|
function schema$18(configure) {
|
|
83191
83191
|
return Struct({
|
|
@@ -83329,7 +83329,7 @@ const metadata$15 = {
|
|
|
83329
83329
|
};
|
|
83330
83330
|
function schema$15(configure) {
|
|
83331
83331
|
const { fields: actionFields } = ActionSchemaFields(configure);
|
|
83332
|
-
const {
|
|
83332
|
+
const { groups, items: items2, ...rest } = actionFields;
|
|
83333
83333
|
return Struct({
|
|
83334
83334
|
type: Literal2(type$15),
|
|
83335
83335
|
compatibilityDate: Literal2(compatibilityDate$15),
|
package/dist/module.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as l,o as s,R as r,P as t,a8 as n,b as p,a9 as c}from"./index-
|
|
1
|
+
import{d as l,o as s,R as r,P as t,a8 as n,b as p,a9 as c}from"./index-Cyjm-GKs.js";const f=l({__name:"FieldGroup",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(a){const e=a;return(o,u)=>(s(),r("div",{"data-slot":"field-group",class:n(p(c)("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",e.class))},[t(o.$slots,"default")],2))}});export{f as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as $,Y as q,v as E,x as F,y as p,o as f,R as O,c as w,S as x,b as m,Z as y,w as I,a as L,h as N,$ as S,a0 as z,B as t,C as A,D as J,E as g,F as P,G as V,H as D,I as G,J as H,A as K,K as R,M as T,a1 as U,a2 as W,N as Y,L as Z,O as Q}from"./index-
|
|
1
|
+
import{d as $,Y as q,v as E,x as F,y as p,o as f,R as O,c as w,S as x,b as m,Z as y,w as I,a as L,h as N,$ as S,a0 as z,B as t,C as A,D as J,E as g,F as P,G as V,H as D,I as G,J as H,A as K,K as R,M as T,a1 as U,a2 as W,N as Y,L as Z,O as Q}from"./index-Cyjm-GKs.js";const ee=$({name:"ShwfedBlockCardBadge",inheritAttrs:!1,__name:"badge",props:{badge:{}},setup(n){const a=n,{locale:C}=q(),k=T(),o=K(void 0);function i(){return R(k)}const b=t(()=>o.value===void 0?Z():Q(o.value)),c=t(()=>U(a.badge.content,C.value)||""),j=t(()=>c.value?W(c.value,g,{...i(),json:b.value}):""),B=t(()=>{const e=a.badge.show;if(!e)return!0;try{return Y(g(e,{...i(),json:b.value}))}catch(r){return console.warn("[shwfed-card-badge] show evaluation failed",r),!0}});async function s(){const e=a.badge.request;if(!e)return;const r=i(),_=A(function*(){const v=yield*J(yield*g(e,r));return P(v)});try{o.value=await V(D(_,G))}catch(v){console.warn("[shwfed-card-badge] fetch failed",v)}}const l=t(()=>!!a.badge.request&&(a.badge.interval??0)>0),M=t(()=>Math.max(1,a.badge.interval??1)*1e3),u=H(),{pause:h,resume:d}=E(()=>{s()},M,{immediate:!1});return F(()=>{s(),l.value&&u.value&&d()}),p(u,e=>{l.value&&(e?(s(),d()):h())}),p(()=>[a.badge.request??"",a.badge.interval??0].join("|"),()=>{s(),l.value&&u.value?d():h()}),(e,r)=>c.value&&B.value?(f(),O(S,{key:0},[n.badge.dot?(f(),w(m(y),x({key:0,variant:n.badge.variant??"default",class:"size-2.5 min-w-0 rounded-full p-0"},e.$attrs),null,16,["variant"])):(f(),w(m(y),x({key:1,variant:n.badge.variant??"default"},e.$attrs),{default:I(()=>[L(m(N),{source:j.value,class:"max-w-none text-inherit [&_*]:text-inherit [&_p]:m-0"},null,8,["source"])]),_:1},16,["variant"]))],64)):z("",!0)}});export{ee as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as le,u as te,ap as ae,aq as oe,y as I,ar as R,R as c,c as H,a as s,w as n,b as e,as as se,a0 as ne,$ as P,at as ie,t as p,j as v,au as W,av as h,aw as de,B as x,A as ue,Q as j,ax as ce,o as d,ay as K,az as O,ae as q,aA as Y,e as B,f as b,g as _,h as L,i as ve,_ as U,aB as Q,a6 as re,a7 as me,aC as fe,aD as pe,aE as xe,aF as ye}from"./index-Cyjm-GKs.js";const ke={key:0,class:"flex min-h-96 items-center justify-center p-8 text-sm text-zinc-400"},ge={key:1},Ie={key:2,class:"p-6 text-sm text-red-500"},Be={key:2,class:"flex flex-col gap-4"},be={class:"grid grid-cols-2 gap-4"},_e={key:0,class:"flex gap-2 min-h-96"},Le={class:"flex w-56 shrink-0 flex-col"},Ue={class:"flex flex-1 flex-col gap-2"},Ve={class:"flex-1"},De={key:1,class:"flex flex-col gap-2"},Ee={class:"h-96"},Se=le({name:"ShwfedModalLayoutActionConfig",__name:"config",props:de({configure:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(V){const i=te(V,"modelValue"),X=V,D=x(()=>X.configure??(()=>{})),E=ae(()=>{}),y=a=>re(E,a)??a,r=a=>me(E,a),G=x({get:()=>i.value.slot??fe(),set:a=>{i.value={...i.value,slot:a}}}),t=oe(G,{configure:D.value}),{copy:C,paste:S}=ce(t);function J(a){i.value={...i.value,modalTitle:a}}function T(a,l){const o=l.trim(),g={...i.value};o.length===0?Reflect.deleteProperty(g,a):g[a]=o,i.value=g}function M(){const a=t.layouts.value;t.layouts.value=[...a,{name:"新布局",layout:{columns:1,placements:{}}}],t.activeLayoutIndex.value=a.length}function z(a,l){t.addBlock(a,l)}function w(a){t.removeBlock(a)}function $(a){t.removeBlocks(a)}const u=ue(null),m=x(()=>{const a=u.value;return a?t.blocks.value.find(l=>l.id===a)??null:null}),A=x(()=>{const a=m.value;return a?pe()?.(a.type,a.compatibilityDate)??null:null});function N(a){u.value=a}function Z(){u.value=null}I(()=>t.blocks.value.map(a=>a.id),a=>{const l=u.value;l&&!a.includes(l)&&(u.value=null)});function ee(a){const l=u.value;l&&t.updateBlock(l,a)}const F=j(xe,null);if(F){const a=F.add();I(m,l=>{l?(a.label.value=t.getBlockLabel(l),a.back.value=Z):(a.label.value=null,a.back.value=null)},{immediate:!0}),R(()=>{a.dispose()})}const f=j(ye,null),k=x(()=>f?.target.value??null);return I(u,a=>{f?.drilled&&(f.drilled.value=!!a)},{immediate:!0}),R(()=>{f?.drilled&&(f.drilled.value=!1)}),(a,l)=>(d(),c(P,null,[k.value&&!u.value?(d(),H(se,{key:0,to:k.value},[s(e(O),{class:"flex-1"},{default:n(()=>[s(K,{"model-value":e(t).layouts.value,"active-index":e(t).activeLayoutIndex.value,"onUpdate:modelValue":l[0]||(l[0]=o=>{e(t).layouts.value=o}),"onUpdate:activeIndex":l[1]||(l[1]=o=>{e(t).activeLayoutIndex.value=o})},null,8,["model-value","active-index"])]),_:1}),s(e(Y),{variant:"ghost",size:"sm",onClick:l[2]||(l[2]=o=>M())},{default:n(()=>[s(e(q),{icon:"fluent:add-20-regular",class:"size-4"}),l[17]||(l[17]=v("span",null,"新增布局",-1))]),_:1})],8,["to"])):ne("",!0),u.value?(d(),c(P,{key:1},[m.value?A.value?(d(),c("div",ge,[(d(),H(ie(A.value.config),{"model-value":m.value,configure:D.value,"onUpdate:modelValue":l[3]||(l[3]=o=>ee(o))},null,8,["model-value","configure"]))])):(d(),c("div",Ie," 未注册的块类型:"+p(m.value.type)+"@"+p(m.value.compatibilityDate),1)):(d(),c("div",ke," 块已不存在 "))],64)):(d(),c("div",Be,[s(e(U),{orientation:"vertical"},{default:n(()=>[s(e(B),{class:"text-xs text-zinc-500"},b({default:n(()=>[_(" "+p(y("modalTitle")),1)]),_:2},[r("modalTitle")?{name:"tooltip",fn:n(()=>[s(e(L),{source:r("modalTitle"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(ve),{markdown:"","model-value":i.value.modalTitle,"translate-hint":y("modalTitle"),"onUpdate:modelValue":J},null,8,["model-value","translate-hint"])]),_:1}),v("div",be,[s(e(U),{orientation:"vertical"},{default:n(()=>[s(e(B),{class:"text-xs text-zinc-500"},b({default:n(()=>[_(" "+p(y("modalWidth")),1)]),_:2},[r("modalWidth")?{name:"tooltip",fn:n(()=>[s(e(L),{source:r("modalWidth"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(Q),{"model-value":i.value.modalWidth??"",placeholder:"例:720px / 60vw","onUpdate:modelValue":l[4]||(l[4]=o=>T("modalWidth",String(o)))},null,8,["model-value"])]),_:1}),s(e(U),{orientation:"vertical"},{default:n(()=>[s(e(B),{class:"text-xs text-zinc-500"},b({default:n(()=>[_(" "+p(y("modalMinHeight")),1)]),_:2},[r("modalMinHeight")?{name:"tooltip",fn:n(()=>[s(e(L),{source:r("modalMinHeight"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(Q),{"model-value":i.value.modalMinHeight??"",placeholder:"例:400px / 60vh","onUpdate:modelValue":l[5]||(l[5]=o=>T("modalMinHeight",String(o)))},null,8,["model-value"])]),_:1})]),k.value?(d(),c("div",De,[s(W,{"model-value":e(t).layouts.value,index:e(t).activeLayoutIndex.value,"onUpdate:modelValue":l[13]||(l[13]=o=>{e(t).layouts.value=o})},null,8,["model-value","index"]),v("div",Ee,[s(h,{"model-value":e(t).layouts.value,"active-index":e(t).activeLayoutIndex.value,"selected-item-ids":e(t).selectedBlockIds.value,items:e(t).blocks.value,"find-entry":e(t).findBlockMeta,"get-item-label":e(t).getBlockLabel,"picker-entries":e(t).pickerEntries.value,"can-delete":!0,"item-noun":"块","onUpdate:modelValue":l[14]||(l[14]=o=>{e(t).layouts.value=o}),"onUpdate:activeIndex":l[15]||(l[15]=o=>{e(t).activeLayoutIndex.value=o}),"onUpdate:selectedItemIds":l[16]||(l[16]=o=>{e(t).selectedBlockIds.value=o}),onAddNew:z,onDrillDown:N,onDeleteItem:w,onDeleteItems:$,onCopyItems:e(C),onPaste:e(S)},null,8,["model-value","active-index","selected-item-ids","items","find-entry","get-item-label","picker-entries","onCopyItems","onPaste"])])])):(d(),c("div",_e,[v("div",Le,[s(e(O),{class:"flex-1"},{default:n(()=>[s(K,{"model-value":e(t).layouts.value,"active-index":e(t).activeLayoutIndex.value,"onUpdate:modelValue":l[6]||(l[6]=o=>{e(t).layouts.value=o}),"onUpdate:activeIndex":l[7]||(l[7]=o=>{e(t).activeLayoutIndex.value=o})},null,8,["model-value","active-index"])]),_:1}),s(e(Y),{variant:"ghost",size:"sm",onClick:l[8]||(l[8]=o=>M())},{default:n(()=>[s(e(q),{icon:"fluent:add-20-regular",class:"size-4"}),l[18]||(l[18]=v("span",null,"新增布局",-1))]),_:1})]),v("div",Ue,[s(W,{"model-value":e(t).layouts.value,index:e(t).activeLayoutIndex.value,"onUpdate:modelValue":l[9]||(l[9]=o=>{e(t).layouts.value=o})},null,8,["model-value","index"]),v("div",Ve,[s(h,{"model-value":e(t).layouts.value,"active-index":e(t).activeLayoutIndex.value,"selected-item-ids":e(t).selectedBlockIds.value,items:e(t).blocks.value,"find-entry":e(t).findBlockMeta,"get-item-label":e(t).getBlockLabel,"picker-entries":e(t).pickerEntries.value,"can-delete":!0,"item-noun":"块","onUpdate:modelValue":l[10]||(l[10]=o=>{e(t).layouts.value=o}),"onUpdate:activeIndex":l[11]||(l[11]=o=>{e(t).activeLayoutIndex.value=o}),"onUpdate:selectedItemIds":l[12]||(l[12]=o=>{e(t).selectedBlockIds.value=o}),onAddNew:z,onDrillDown:N,onDeleteItem:w,onDeleteItems:$,onCopyItems:e(C),onPaste:e(S)},null,8,["model-value","active-index","selected-item-ids","items","find-entry","get-item-label","picker-entries","onCopyItems","onPaste"])])])]))]))],64))}});export{Se as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as _,u as y,ab as x,ac as b,R as c,j as i,a as n,w as o,b as t,o as l,ad as g,ae as u,af as v,ag as D,$ as h,a5 as $,c as w,ah as S,t as p,ai as k}from"./index-
|
|
1
|
+
import{d as _,u as y,ab as x,ac as b,R as c,j as i,a as n,w as o,b as t,o as l,ad as g,ae as u,af as v,ag as D,$ as h,a5 as $,c as w,ah as S,t as p,ai as k}from"./index-Cyjm-GKs.js";const B={class:"flex flex-col gap-3"},C={class:"flex-1"},V={class:"ml-auto text-xs tabular-nums text-zinc-400"},N=_({name:"ShwfedPrototypeActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(m){const r=y(m,"modelValue"),f=(()=>{const s=new Map;for(const e of x){if(e.type===b||e.deprecated)continue;const a=s.get(e.type);(!a||e.compatibilityDate>a.compatibilityDate)&&s.set(e.type,{type:e.type,compatibilityDate:e.compatibilityDate,name:e.metadata.name,icon:e.metadata.icon})}return[...s.values()].sort((e,a)=>e.name.localeCompare(a.name,"zh"))})();function d(s,e){r.value={type:s,compatibilityDate:e}}return(s,e)=>(l(),c("div",B,[e[0]||(e[0]=i("p",{class:"text-xs text-zinc-500"}," 原型按钮点击后无任何副作用,用于占位。选择下方任意类型可将其转换为正式按钮 —— 此转换仅能进行一次。 ",-1)),n(t(k),null,{default:o(()=>[n(t(g),{align:"inline-start"},{default:o(()=>[n(t(u),{icon:"fluent:arrow-swap-20-regular"})]),_:1}),n(t(v),null,{default:o(()=>[n(t(D),null,{default:o(()=>[(l(!0),c(h,null,$(t(f),a=>(l(),w(t(S),{key:a.type,value:a.type,onSelect:z=>d(a.type,a.compatibilityDate)},{default:o(()=>[n(t(u),{icon:a.icon,class:"size-4 shrink-0"},null,8,["icon"]),i("span",C,p(a.name),1),i("span",V,p(a.compatibilityDate),1)]),_:2},1032,["value","onSelect"]))),128))]),_:1})]),_:1})]),_:1})]))}});export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as x,u as g,
|
|
1
|
+
import{d as x,u as g,b9 as k,R as S,a as e,w as o,b as a,o as V,e as r,f as m,g as d,t as f,h as p,aB as w,_,i as $,a6 as b,a7 as h}from"./index-Cyjm-GKs.js";const z={class:"flex flex-col gap-4"},B=x({name:"ShwfedMarkdownItemConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(v){const t=g(v,"modelValue"),c=k(),u=l=>b(c,l)??l,s=l=>h(c,l);return(l,n)=>(V(),S("div",z,[e(a(_),{orientation:"vertical"},{default:o(()=>[e(a(r),{class:"text-xs text-zinc-500"},m({default:o(()=>[d(" "+f(u("name")),1)]),_:2},[s("name")?{name:"tooltip",fn:o(()=>[e(a(p),{source:s("name"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(w),{"model-value":t.value.name,placeholder:"仅用于编辑器内识别","onUpdate:modelValue":n[0]||(n[0]=i=>t.value={...t.value,name:String(i)})},null,8,["model-value"])]),_:1}),e(a(_),{orientation:"vertical"},{default:o(()=>[e(a(r),{class:"text-xs text-zinc-500"},m({default:o(()=>[d(" "+f(u("content")),1)]),_:2},[s("content")?{name:"tooltip",fn:o(()=>[e(a(p),{source:s("content"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a($),{markdown:"",multiline:"","model-value":t.value.content,"onUpdate:modelValue":n[1]||(n[1]=i=>t.value={...t.value,content:i})},null,8,["model-value"])]),_:1})]))}});export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as R,u as U,aa as k,R as v,a as e,w as a,b as t,j as _,$ as j,a5 as F,o as E,e as u,f as c,g as d,t as p,h as f,n as g,_ as m,a4 as b,a6 as N,a7 as $}from"./index-
|
|
1
|
+
import{d as R,u as U,aa as k,R as v,a as e,w as a,b as t,j as _,$ as j,a5 as F,o as E,e as u,f as c,g as d,t as p,h as f,n as g,_ as m,a4 as b,a6 as N,a7 as $}from"./index-Cyjm-GKs.js";const B={class:"flex flex-col gap-3"},D={class:"flex items-start gap-2"},H={class:"grid grid-cols-2 gap-3"},q=R({name:"ShwfedHttpRequestActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(h){const l=U(h,"modelValue"),x=k(()=>{}),i=o=>N(x,o)??o,n=o=>$(x,o),S=["onSuccess","onWarning","onError","onInfo"];function y(o){const s={...l.value};o.length===0?delete s.messageExpression:s.messageExpression=o,l.value=s}function z(o){const s={...l.value};o.length===0?delete s.resultExpression:s.resultExpression=o,l.value=s}function T(o,s){const r={...l.value};s.length===0?Reflect.deleteProperty(r,o):r[o]=s,l.value=r}function V(o){const s={...l.value};o.length===0?Reflect.deleteProperty(s,"before"):s.before=o,l.value=s}return(o,s)=>(E(),v("div",B,[e(t(m),{orientation:"vertical"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(t(g),{"model-value":l.value.expression,multiline:"",placeholder:"例:http.post('/api/foo').body({ id: row.id })","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":s[0]||(s[0]=r=>l.value={...l.value,expression:r})},null,8,["model-value"])]),_:1}),e(t(m),{orientation:"vertical"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("before")),1)]),_:2},[n("before")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("before"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(b,{triggers:l.value.before??[],"onUpdate:triggers":s[1]||(s[1]=r=>V(r))},null,8,["triggers"])]),_:1}),_("div",D,[e(t(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("messageExpression")),1)]),_:2},[n("messageExpression")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(t(g),{"model-value":l.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":y},null,8,["model-value"])]),_:1}),e(t(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i("resultExpression")),1)]),_:2},[n("resultExpression")?{name:"tooltip",fn:a(()=>[e(t(f),{source:n("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(t(g),{"model-value":l.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":z},null,8,["model-value"])]),_:1})]),_("div",H,[(E(),v(j,null,F(S,r=>e(t(m),{key:r,orientation:"vertical",class:"min-w-0"},{default:a(()=>[e(t(u),{class:"text-xs text-zinc-500"},c({default:a(()=>[d(" "+p(i(r)),1)]),_:2},[n(r)?{name:"tooltip",fn:a(()=>[e(t(f),{source:n(r),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(b,{triggers:l.value[r]??[],"onUpdate:triggers":w=>T(r,w)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]))}});export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as h,u as z,m as S,o as T,c as O,w as l,a as t,b as e,_ as p,e as u,f as c,g as d,t as m,h as f,n as v,j as $,i as j}from"./index-
|
|
1
|
+
import{d as h,u as z,m as S,o as T,c as O,w as l,a as t,b as e,_ as p,e as u,f as c,g as d,t as m,h as f,n as v,j as $,i as j}from"./index-Cyjm-GKs.js";import{_ as w}from"./FieldGroup.vue_vue_type_script_setup_true_lang-CN4xD2hQ.js";import{g as R,a as U}from"./schema-meta-DwWuSVqk.js";const C={class:"grid grid-cols-2 gap-4"},q=h({name:"ShwfedHttpRequestOperationConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(y){const r=z(y,"modelValue"),_=S(()=>{}),a=o=>R(_,o)??o,n=o=>U(_,o),k={json:{type:"dyn",label:"HTTP 响应"}},E={json:{type:"dyn",label:"HTTP 响应"},result:{type:"string",label:"执行结果"}};function x(o){const s={...r.value,...o};for(const[i,V]of Object.entries(o))V===void 0&&Reflect.deleteProperty(s,i);r.value=s}function g(o,s){x({[o]:s.length===0?void 0:s})}function b(o){const s=o.every(i=>i.message.trim().length===0);x({description:s?void 0:o})}return(o,s)=>(T(),O(e(w),null,{default:l(()=>[t(e(p),{orientation:"vertical"},{default:l(()=>[t(e(u),{class:"text-xs text-zinc-500"},c({default:l(()=>[d(" "+m(a("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:l(()=>[t(e(f),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(e(v),{"model-value":r.value.expression,multiline:"",placeholder:"例:http.post('/api/foo').body({ id: row.id })","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":s[0]||(s[0]=i=>x({expression:i}))},null,8,["model-value"])]),_:1}),$("div",C,[t(e(p),{orientation:"vertical"},{default:l(()=>[t(e(u),{class:"text-xs text-zinc-500"},c({default:l(()=>[d(" "+m(a("resultExpression")),1)]),_:2},[n("resultExpression")?{name:"tooltip",fn:l(()=>[t(e(f),{source:n("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(e(v),{"model-value":r.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":k,"onUpdate:modelValue":s[1]||(s[1]=i=>g("resultExpression",i))},null,8,["model-value"])]),_:1}),t(e(p),{orientation:"vertical"},{default:l(()=>[t(e(u),{class:"text-xs text-zinc-500"},c({default:l(()=>[d(" "+m(a("titleExpression")),1)]),_:2},[n("titleExpression")?{name:"tooltip",fn:l(()=>[t(e(f),{source:n("titleExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(e(v),{"model-value":r.value.titleExpression??"",placeholder:"例:result == 'error' ? '保存失败' : '保存成功'","result-type":"string","extra-vars":E,"onUpdate:modelValue":s[2]||(s[2]=i=>g("titleExpression",i))},null,8,["model-value"])]),_:1})]),t(e(p),{orientation:"vertical"},{default:l(()=>[t(e(u),{class:"text-xs text-zinc-500"},c({default:l(()=>[d(" "+m(a("description")),1)]),_:2},[n("description")?{name:"tooltip",fn:l(()=>[t(e(f),{source:n("description"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(e(j),{markdown:"","model-value":r.value.description,"onUpdate:modelValue":s[3]||(s[3]=i=>b(i))},null,8,["model-value"])]),_:1})]),_:1}))}});export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as v,u as S,
|
|
1
|
+
import{d as v,u as S,aJ as h,R as k,a as s,w as l,b as t,o as V,e as r,f as u,g as d,t as p,h as m,n as w,_ as f,a4 as y,a6 as T,a7 as z}from"./index-Cyjm-GKs.js";const $={class:"flex flex-col gap-3"},C=v({name:"ShwfedStateWriteActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(_){const o=S(_,"modelValue"),i=h(()=>{}),c=e=>T(i,e)??e,n=e=>z(i,e);function g(e){const a={...o.value};e.length===0?Reflect.deleteProperty(a,"onSuccess"):a.onSuccess=e,o.value=a}return(e,a)=>(V(),k("div",$,[s(t(f),{orientation:"vertical"},{default:l(()=>[s(t(r),{class:"text-xs text-zinc-500"},u({default:l(()=>[d(" "+p(c("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:l(()=>[s(t(m),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(t(w),{"model-value":o.value.expression,multiline:"",placeholder:"例:{ invoices: rows, totalAmount: rows.map(r, r.amount).sum() }","result-type":"map",class:"min-h-16","onUpdate:modelValue":a[0]||(a[0]=x=>o.value={...o.value,expression:x})},null,8,["model-value"])]),_:1}),s(t(f),{orientation:"vertical"},{default:l(()=>[s(t(r),{class:"text-xs text-zinc-500"},u({default:l(()=>[d(" "+p(c("onSuccess")),1)]),_:2},[n("onSuccess")?{name:"tooltip",fn:l(()=>[s(t(m),{source:n("onSuccess"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(y,{triggers:o.value.onSuccess??[],"onUpdate:triggers":g},null,8,["triggers"])]),_:1})]))}});export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as k,u as b,aj as S,R as m,a as e,w as l,b as a,o as f,e as _,f as v,g as i,t as r,h as p,n as V,_ as x,ak as h,al as w,am as y,an as z,$ as D,a5 as N,ao as T,a6 as C,a7 as F}from"./index-
|
|
1
|
+
import{d as k,u as b,aj as S,R as m,a as e,w as l,b as a,o as f,e as _,f as v,g as i,t as r,h as p,n as V,_ as x,ak as h,al as w,am as y,an as z,$ as D,a5 as N,ao as T,a6 as C,a7 as F}from"./index-Cyjm-GKs.js";const M={class:"flex flex-col gap-3"},B=k({name:"ShwfedNavigationActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(g){const t=b(g,"modelValue"),c=S(()=>{}),d=o=>C(c,o)??o,n=o=>F(c,o),$=[{value:"_self",label:"当前页面打开"},{value:"_blank",label:"新页面打开"}];return(o,u)=>(f(),m("div",M,[e(a(x),{orientation:"vertical"},{default:l(()=>[e(a(_),{class:"text-xs text-zinc-500"},v({default:l(()=>[i(" "+r(d("url")),1)]),_:2},[n("url")?{name:"tooltip",fn:l(()=>[e(a(p),{source:n("url"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(V),{"model-value":t.value.url??"",placeholder:"例:'/detail/' + string(row.id)","result-type":"string",multiline:"",class:"min-h-10","onUpdate:modelValue":u[0]||(u[0]=s=>t.value={...t.value,url:s})},null,8,["model-value"])]),_:1}),e(a(x),{orientation:"vertical"},{default:l(()=>[e(a(_),{class:"text-xs text-zinc-500"},v({default:l(()=>[i(" "+r(d("mode")),1)]),_:2},[n("mode")?{name:"tooltip",fn:l(()=>[e(a(p),{source:n("mode"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(h),{"model-value":t.value.mode??"_self","onUpdate:modelValue":u[1]||(u[1]=s=>t.value={...t.value,mode:s})},{default:l(()=>[e(a(w),{class:"w-full"},{default:l(()=>[e(a(y))]),_:1}),e(a(z),null,{default:l(()=>[(f(),m(D,null,N($,s=>e(a(T),{key:s.value,value:s.value},{default:l(()=>[i(r(s.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])]),_:1})]))}});export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as k,u as V,s as $,o as z,c as S,w as s,a as o,b as e,_ as d,e as u,f as m,g as f,t as p,h as _,i as b,j as y,k as w,l as B}from"./index-
|
|
1
|
+
import{d as k,u as V,s as $,o as z,c as S,w as s,a as o,b as e,_ as d,e as u,f as m,g as f,t as p,h as _,i as b,j as y,k as w,l as B}from"./index-Cyjm-GKs.js";import{_ as C}from"./FieldGroup.vue_vue_type_script_setup_true_lang-CN4xD2hQ.js";import{g as D,a as N}from"./schema-meta-DwWuSVqk.js";const T={class:"grid grid-cols-2 gap-4"},M=k({name:"ShwfedAlertOperationConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(g){const n=V(g,"modelValue"),v=$(),r=l=>D(v,l)??l,i=l=>N(v,l);function c(l){const t={...n.value,...l};for(const[a,x]of Object.entries(l))x===void 0&&Reflect.deleteProperty(t,a);n.value=t}return(l,t)=>(z(),S(e(C),null,{default:s(()=>[o(e(d),{orientation:"vertical"},{default:s(()=>[o(e(u),{class:"text-xs text-zinc-500"},m({default:s(()=>[f(" "+p(r("message")),1)]),_:2},[i("message")?{name:"tooltip",fn:s(()=>[o(e(_),{source:i("message"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),o(e(b),{markdown:"","model-value":n.value.message,"onUpdate:modelValue":t[0]||(t[0]=a=>c({message:a}))},null,8,["model-value"])]),_:1}),y("div",T,[o(e(d),{orientation:"vertical"},{default:s(()=>[o(e(u),{class:"text-xs text-zinc-500"},m({default:s(()=>[f(" "+p(r("icon")),1)]),_:2},[i("icon")?{name:"tooltip",fn:s(()=>[o(e(_),{source:i("icon"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),o(e(w),{"model-value":n.value.icon??"","onUpdate:modelValue":t[1]||(t[1]=a=>c(a.trim()===""?{icon:void 0}:{icon:a}))},null,8,["model-value"])]),_:1}),o(e(d),{orientation:"vertical"},{default:s(()=>[o(e(u),{class:"text-xs text-zinc-500"},m({default:s(()=>[f(" "+p(r("color")),1)]),_:2},[i("color")?{name:"tooltip",fn:s(()=>[o(e(_),{source:i("color"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),o(e(B),{"model-value":n.value.color??"","onUpdate:modelValue":t[2]||(t[2]=a=>c(a.trim()===""?{color:void 0}:{color:a}))},null,8,["model-value"])]),_:1})])]),_:1}))}});export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as y,u as z,
|
|
1
|
+
import{d as y,u as z,aK as V,o as O,R as S,a as s,w as a,b as o,e as i,f as u,g as c,t as d,h as p,n as x,_ as m,j as g,a4 as T,i as U,aL as $,a6 as j,a7 as B}from"./index-Cyjm-GKs.js";const N={class:"flex flex-col gap-3"},C={class:"grid grid-cols-2 gap-3 items-start"},M={class:"flex items-start gap-2"},D=y({name:"ShwfedHttpRequestBatchActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(_){const l=z(_,"modelValue"),v=V(()=>{}),r=t=>j(v,t)??t,n=t=>B(v,t);function k(t){const e={...l.value};t.length===0?delete e.messageExpression:e.messageExpression=t,l.value=e}function E(t){const e={...l.value};t.length===0?delete e.resultExpression:e.resultExpression=t,l.value=e}function b(t){const e={...l.value};t.length===0?Reflect.deleteProperty(e,"before"):e.before=t,l.value=e}function h(t){const e={...l.value};!t||t.length===0?delete e.markdown:e.markdown=t,l.value=e}function w(t){const e={...l.value};t?e.continueOnError=!0:delete e.continueOnError,l.value=e}return(t,e)=>(O(),S("div",N,[s(o(m),{orientation:"vertical"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("expression")),1)]),_:2},[n("expression")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o(x),{"model-value":l.value.expression,multiline:"",placeholder:"例:range(1, 10).map(i, http.post('/api/foo').body({ id: i }))","result-type":"list",class:"min-h-16","onUpdate:modelValue":e[0]||(e[0]=f=>l.value={...l.value,expression:f})},null,8,["model-value"])]),_:1}),g("div",C,[s(o(m),{orientation:"vertical",class:"min-w-0"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("before")),1)]),_:2},[n("before")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("before"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(T,{triggers:l.value.before??[],"onUpdate:triggers":e[1]||(e[1]=f=>b(f))},null,8,["triggers"])]),_:1}),s(o(m),{orientation:"vertical",class:"min-w-0"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("markdown")),1)]),_:2},[n("markdown")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("markdown"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o(U),{markdown:"","model-value":l.value.markdown,"onUpdate:modelValue":h},null,8,["model-value"])]),_:1})]),s(o(m),{orientation:"horizontal"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("continueOnError")),1)]),_:2},[n("continueOnError")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("continueOnError"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o($),{"model-value":l.value.continueOnError??!1,"onUpdate:modelValue":w},null,8,["model-value"])]),_:1}),g("div",M,[s(o(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("messageExpression")),1)]),_:2},[n("messageExpression")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o(x),{"model-value":l.value.messageExpression??"",placeholder:"例:string(jsons.size()) + ' 条已处理'","result-type":"string","extra-vars":{jsons:{type:"list",label:"HTTP 响应体列表(已解析 JSON,仅成功项)"}},"onUpdate:modelValue":k},null,8,["model-value"])]),_:1}),s(o(m),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:a(()=>[s(o(i),{class:"text-xs text-zinc-500"},u({default:a(()=>[c(" "+d(r("resultExpression")),1)]),_:2},[n("resultExpression")?{name:"tooltip",fn:a(()=>[s(o(p),{source:n("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(o(x),{"model-value":l.value.resultExpression??"",placeholder:"例:json.code == 0","result-type":"bool","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON),当前这一条响应"}},"onUpdate:modelValue":E},null,8,["model-value"])]),_:1})])]))}});export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as k,u as y,
|
|
1
|
+
import{d as k,u as y,aH as U,R as V,j as x,a as t,w as n,b as s,$ as D,a5 as F,o as z,e as i,g as u,h as c,n as d,_ as p,aI as g,f,t as _,a4 as H,a6 as $,a7 as B,B as S}from"./index-Cyjm-GKs.js";const C={class:"flex flex-col gap-3"},L={class:"grid grid-cols-2 gap-3"},N={class:"flex items-start gap-2"},I={class:"grid grid-cols-2 gap-3"},A=k({name:"ShwfedHttpDownloadActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(j){const l=y(j,"modelValue"),E=U(()=>{}),m=a=>$(E,a)??a,r=a=>B(E,a),q=["onSuccess","onWarning","onError","onInfo"],h=S({get:()=>l.value.template?.request??"",set:a=>{l.value={...l.value,template:{...l.value.template,request:a}}}}),w=S({get:()=>l.value.template?.download??"",set:a=>{const e=l.value.template??{request:""};if(a.length===0){const{download:o,...v}=e;l.value={...l.value,template:v}}else l.value={...l.value,template:{...e,download:a}}}});function R(a){const e={...l.value};a.length===0?delete e.messageExpression:e.messageExpression=a,l.value=e}function b(a){const e={...l.value};a.length===0?delete e.resultExpression:e.resultExpression=a,l.value=e}function T(a,e){const o={...l.value};e.length===0?Reflect.deleteProperty(o,a):o[a]=e,l.value=o}return(a,e)=>(z(),V("div",C,[x("div",L,[t(s(p),{orientation:"vertical"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},{tooltip:n(()=>[t(s(c),{source:r("template")??"返回 `HttpRequest` 的 CEL 表达式;未配置「下载请求」时直接下载其响应",block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),default:n(()=>[e[2]||(e[2]=u(" 请求 ",-1))]),_:1}),t(s(d),{"model-value":h.value,multiline:"",placeholder:"例:http.get('https://api.example.com/files/123')","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":e[0]||(e[0]=o=>h.value=o)},null,8,["model-value"])]),_:1}),t(s(p),{orientation:"vertical"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},{tooltip:n(()=>[t(s(c),{source:"可选的第二步:用第一步响应 `json` 中的凭据构造真正的下载请求,例如 `json.data.key`",block:"",class:"prose prose-sm prose-zinc"})]),default:n(()=>[e[3]||(e[3]=u(" 下载请求 ",-1))]),_:1}),t(s(d),{"model-value":w.value,multiline:"",placeholder:"例:http.get('https://api.example.com/download').query('key', json.data.key)","result-type":"HttpRequest","extra-vars":{json:s(g)},class:"min-h-16","onUpdate:modelValue":e[1]||(e[1]=o=>w.value=o)},null,8,["model-value","extra-vars"])]),_:1})]),x("div",N,[t(s(p),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},f({default:n(()=>[u(" "+_(m("messageExpression")),1)]),_:2},[r("messageExpression")?{name:"tooltip",fn:n(()=>[t(s(c),{source:r("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(s(d),{"model-value":l.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:s(g)},"onUpdate:modelValue":R},null,8,["model-value","extra-vars"])]),_:1}),t(s(p),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},f({default:n(()=>[u(" "+_(m("resultExpression")),1)]),_:2},[r("resultExpression")?{name:"tooltip",fn:n(()=>[t(s(c),{source:r("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(s(d),{"model-value":l.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:s(g)},"onUpdate:modelValue":b},null,8,["model-value","extra-vars"])]),_:1})]),x("div",I,[(z(),V(D,null,F(q,o=>t(s(p),{key:o,orientation:"vertical",class:"min-w-0"},{default:n(()=>[t(s(i),{class:"text-xs text-zinc-500"},f({default:n(()=>[u(" "+_(m(o)),1)]),_:2},[r(o)?{name:"tooltip",fn:n(()=>[t(s(c),{source:r(o),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),t(H,{triggers:l.value[o]??[],"onUpdate:triggers":v=>T(o,v)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]))}});export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as V,u as T,a3 as U,c as $,w as l,b as s,o as b,j as g,a as e,_ as u,e as d,f as p,g as m,t as f,h as v,n as _,i as j,a4 as z,k as B,l as F,R as N,$ as R,a5 as C,a6 as D,a7 as H}from"./index-
|
|
1
|
+
import{d as V,u as T,a3 as U,c as $,w as l,b as s,o as b,j as g,a as e,_ as u,e as d,f as p,g as m,t as f,h as v,n as _,i as j,a4 as z,k as B,l as F,R as N,$ as R,a5 as C,a6 as D,a7 as H}from"./index-Cyjm-GKs.js";import{_ as h}from"./FieldGroup.vue_vue_type_script_setup_true_lang-CN4xD2hQ.js";const q={class:"grid grid-cols-2 gap-4"},L={class:"grid grid-cols-2 gap-4"},O={class:"flex items-start gap-2"},P={class:"grid grid-cols-2 gap-3"},M=V({name:"ShwfedHttpRequestConfirmActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(E){const n=T(E,"modelValue"),k=U(()=>{}),i=r=>D(k,r)??r,a=r=>H(k,r);function c(r){const t={...n.value,...r};for(const[o,x]of Object.entries(r))x===void 0&&Reflect.deleteProperty(t,o);n.value=t}const w=["onSuccess","onWarning","onError","onInfo"];function y(r,t){c({[r]:t.length===0?void 0:t})}function S(r){c({before:r.length===0?void 0:r})}return(r,t)=>(b(),$(s(h),null,{default:l(()=>[g("div",q,[e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("expression")),1)]),_:2},[a("expression")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(_),{"model-value":n.value.expression,multiline:"",placeholder:"例:http.post('/api/foo').body({ id: row.id })","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":t[0]||(t[0]=o=>c({expression:o}))},null,8,["model-value"])]),_:1}),e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("markdown")),1)]),_:2},[a("markdown")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("markdown"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(j),{markdown:"","model-value":n.value.markdown,"onUpdate:modelValue":t[1]||(t[1]=o=>c({markdown:o}))},null,8,["model-value"])]),_:1})]),e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("before")),1)]),_:2},[a("before")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("before"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(z,{triggers:n.value.before??[],"onUpdate:triggers":t[2]||(t[2]=o=>S(o))},null,8,["triggers"])]),_:1}),g("div",L,[e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("icon")),1)]),_:2},[a("icon")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("icon"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(B),{"model-value":n.value.icon??"","onUpdate:modelValue":t[3]||(t[3]=o=>c(o.trim()===""?{icon:void 0}:{icon:o}))},null,8,["model-value"])]),_:1}),e(s(u),{orientation:"vertical"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("color")),1)]),_:2},[a("color")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("color"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(F),{"model-value":n.value.color??"","onUpdate:modelValue":t[4]||(t[4]=o=>c(o.trim()===""?{color:void 0}:{color:o}))},null,8,["model-value"])]),_:1})]),g("div",O,[e(s(u),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("messageExpression")),1)]),_:2},[a("messageExpression")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(_),{"model-value":n.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":t[5]||(t[5]=o=>c({messageExpression:o===""?void 0:o}))},null,8,["model-value"])]),_:1}),e(s(u),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("resultExpression")),1)]),_:2},[a("resultExpression")?{name:"tooltip",fn:l(()=>[e(s(v),{source:a("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(_),{"model-value":n.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":t[6]||(t[6]=o=>c({resultExpression:o===""?void 0:o}))},null,8,["model-value"])]),_:1})]),g("div",P,[(b(),N(R,null,C(w,o=>e(s(u),{key:o,orientation:"vertical",class:"min-w-0"},{default:l(()=>[e(s(d),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i(o)),1)]),_:2},[a(o)?{name:"tooltip",fn:l(()=>[e(s(v),{source:a(o),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(z,{triggers:n.value[o]??[],"onUpdate:triggers":x=>y(o,x)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]),_:1}))}});export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as g,u as d,a6 as u,
|
|
1
|
+
import{d as g,u as d,a6 as u,aG as f,R as m,a as s,w as i,b as r,o as p,e as _,g as v,t as x,a4 as h,_ as T,B as V}from"./index-Cyjm-GKs.js";const w={class:"flex flex-col gap-3"},C=g({name:"ShwfedEventDispatchActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(l){const t=d(l,"modelValue"),o=u(f(),"triggers")??"触发的操作",n=V(()=>t.value.triggers??[]);function c(a){const e={...t.value};a.length===0?Reflect.deleteProperty(e,"triggers"):e.triggers=a,t.value=e}return(a,e)=>(p(),m("div",w,[s(r(T),{orientation:"vertical"},{default:i(()=>[s(r(_),{class:"text-xs text-zinc-500"},{default:i(()=>[v(x(r(o)),1)]),_:1}),s(h,{triggers:n.value,"onUpdate:triggers":c},null,8,["triggers"])]),_:1})]))}});export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as f,
|
|
1
|
+
import{d as f,b6 as u,x as m,b7 as p,ar as g,a0 as l,Q as I,b8 as y}from"./index-Cyjm-GKs.js";const w=f({name:"ShwfedActionDefinition",inheritAttrs:!1,__name:"definition",props:{actionId:{},effect:{}},setup(r){const n=r,a=u(),t=I(y,void 0),i=crypto.randomUUID(),c=import.meta.dev;let e,s=!1;function d(){!c||s||(s=!0,console.warn("[shwfed-action-definition] must be used inside <shwfed-actions>."))}function o(){if(!t){d();return}e&&e!==n.actionId&&t.unregisterAction(e,i),t.registerAction({ownerId:i,actionId:n.actionId,effect:n.effect,render:a.default}),e=n.actionId}return o(),m(()=>{o()}),p(()=>{o()}),g(()=>{!t||!e||t.unregisterAction(e,i)}),(A,_)=>l("",!0)}});export{w as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ba as e}from"./index-Cyjm-GKs.js";import{bb as f,bc as r,bd as s}from"./index-Cyjm-GKs.js";export{f as TableConfig,r as createTableConfig,e as default,s as getColumnTechnicalKey};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as H,P as et,Q as it,o as nt,R as st,S as at,b as D,A as P,B as j,x as rt,T as ot,U as W,V as lt,y as ct,W as z,X as ht}from"./index-CEpio2Ai.js";const dt=String.raw,pt=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),ut=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),k=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,C="--_number-flow-d-opacity",V="--_number-flow-d-width",S="--_number-flow-dx",L="--_number-flow-d",mt=(()=>{try{return CSS.registerProperty({name:C,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:S,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:V,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:L,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),U="round(nearest, calc(var(--number-flow-mask-height, 0.25em) / 2), 1px)",v=`calc(${U} * 2)`,R="var(--number-flow-mask-width, 0.5em)",y=`calc(${R} / var(--scale-x))`,$="#000 0, transparent 71%",ft=dt`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:1}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${V}) / var(--width));transform:translateX(var(${S})) scaleX(var(--scale-x));margin:0 calc(-1 * ${R});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${y},#000 calc(100% - ${y}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${v},#000 calc(100% - ${v}),transparent 100% ),radial-gradient(at bottom right,${$}),radial-gradient(at bottom left,${$}),radial-gradient(at top left,${$}),radial-gradient(at top right,${$});-webkit-mask-size:100% calc(100% - ${v} * 2),calc(100% - ${y} * 2) 100%,${y} ${v},${y} ${v},${y} ${v},${y} ${v};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${U} ${R};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${S})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${L})}.digit__num,.number .section::after{padding:${U} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${C}))}`,gt=HTMLElement,vt=(s,t)=>s==null?t:t==null?s:Math.max(s,t),A=new WeakMap,jt={onUpdate(s,t,e){if(A.set(e,void 0),!e.computedTrend)return;const i=t.integer.concat(t.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),n=s.integer.concat(s.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),r=i.find(o=>!n.find(c=>c.pos===o.pos&&c.value===o.value)),a=n.find(o=>!i.find(c=>o.pos===c.pos&&o.value===c.value));A.set(e,vt(r?.pos,a?.pos))},getDelta(s,t,e){const i=s-t,n=A.get(e.flow);if(!i&&n!=null&&n>=e.pos)return e.length*e.flow.computedTrend}},g=(s,t,e)=>{const i=document.createElement(s),[n,r]=Array.isArray(t)?[void 0,t]:[t,e];return n&&Object.assign(i,n),r?.forEach(a=>i.appendChild(a)),i},yt=(s,t)=>{var e;return t==="left"?s.offsetLeft:(((e=s.offsetParent instanceof HTMLElement?s.offsetParent:null)==null?void 0:e.offsetWidth)??0)-s.offsetWidth-s.offsetLeft},wt=s=>s.offsetWidth>0&&s.offsetHeight>0,_t=(s,t)=>{!customElements.get(s)&&customElements.define(s,t)};function bt(s,t,{reverse:e=!1}={}){const i=s.length;for(let n=e?i-1:0;e?n>=0:n<i;e?n--:n++)t(s[n],n)}function $t(s,t,e,i){const n=t.formatToParts(s);e&&n.unshift({type:"prefix",value:e}),i&&n.push({type:"suffix",value:i});const r=[],a=[],o=[],c=[],l={},d=p=>`${p}:${l[p]=(l[p]??-1)+1}`;let m="",_=!1,b=!1;for(const p of n){m+=p.value;const h=p.type==="minusSign"||p.type==="plusSign"?"sign":p.type;h==="integer"?(_=!0,a.push(...p.value.split("").map(T=>({type:h,value:parseInt(T)})))):h==="group"?a.push({type:h,value:p.value}):h==="decimal"?(b=!0,o.push({type:h,value:p.value,key:d(h)})):h==="fraction"?o.push(...p.value.split("").map(T=>({type:h,value:parseInt(T),key:d(h),pos:-1-l[h]}))):(_||b?c:r).push({type:h,value:p.value,key:d(h)})}const F=[];for(let p=a.length-1;p>=0;p--){const h=a[p];F.unshift(h.type==="integer"?{...h,key:d(h.type),pos:l[h.type]}:{...h,key:d(h.type)})}return{pre:r,integer:F,fraction:o,post:c,valueAsString:m,value:typeof s=="string"?parseFloat(s):s}}const Y=ut&&pt&&mt;let u=class extends gt{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...e}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,e)}get animated(){return this._animated}set animated(t){var e;this.animated!==t&&(this._animated=t,(e=this.shadowRoot)==null||e.getAnimations().forEach(i=>i.finish()))}set data(t){var e,i;if(t==null)return;const{pre:n,integer:r,fraction:a,post:o,value:c}=t;if(this.created){const l=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(l.value,c):this.trend,this.computedAnimated=Y&&this._animated&&(!this.respectMotionPreference||!((e=k)!=null&&e.matches))&&wt(this)&&this.ownerDocument.visibilityState==="visible",(i=this.plugins)==null||i.forEach(d=>{var m;return(m=d.onUpdate)==null?void 0:m.call(d,t,l,this)}),this.batched||this.willUpdate(),this._pre.update(n),this._num.update({integer:r,fraction:a}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}const l=document.createElement("style");this.nonce&&(l.nonce=this.nonce),l.textContent=ft,this.shadowRoot.appendChild(l),this._pre=new O(this,n,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new xt(this,r,a),this.shadowRoot.appendChild(this._num.el),this._post=new O(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}};u.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(s,t)=>Math.sign(t-s),respectMotionPreference:!0,plugins:void 0,digits:void 0};class xt{constructor(t,e,i,{className:n,...r}={}){this.flow=t,this._integer=new I(t,e,{justify:"right",part:"integer"}),this._fraction=new I(t,i,{justify:"left",part:"fraction"}),this._inner=g("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=g("span",{...r,part:"number",className:`number ${n??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:e}){this._integer.update(t),this._fraction.update(e)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const e=this._prevLeft-t.left,i=this.el.offsetWidth,n=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[S]:[`${e}px`,"0px"],[V]:[n,0]},{...this.flow.transformTiming,composite:"accumulate"})}}let G=class{constructor(t,e,{justify:i,className:n,...r},a){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=i;const o=e.map(c=>this.addChar(c).el);this.el=g("span",{...r,className:`section section--justify-${i} ${n??""}`},a?a(o):o)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const n=t.type==="integer"||t.type==="fraction"?new q(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new kt(this,t.type,t.value,{...i,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,n),n}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${yt(e.el,this.justify)}px`}),t.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(t){const e=new Map,i=new Map,n=this.justify==="left",r=n?"prepend":"append";if(bt(t,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),i.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),e.set(a,o)),this.el[r](o.el)},{reverse:n}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();e.forEach(o=>{o.willUpdate(a)})}e.forEach((a,o)=>{a.update(o.value)}),i.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(e=>e.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(n=>n.didUpdate(t));const e=t[this.justify],i=this._prevOffset-e;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}};class I extends G{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(r=>r.key===n)||e.set(n,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof q&&i.update(0)}),this.pop(e)}}class O extends G{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(r=>r.key===n)||e.set(n,i)}),this.pop(e),this.addNewAndUpdateExisting(t)}}class M{constructor(t,e,{onRemove:i,animateIn:n=!1}={}){this.flow=t,this.el=e,this._present=!0,this._remove=()=>{var r;this.el.remove(),(r=this._onRemove)==null||r.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&n&&this.el.animate({[C]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[C]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class Z extends M{constructor(t,e,i,n){super(t.flow,i,n),this.section=t,this.value=e,this.el=i}}class q extends Z{constructor(t,e,i,n,r){var a,o;const c=(((o=(a=t.flow.digits)==null?void 0:a[n])==null?void 0:o.max)??9)+1,l=Array.from({length:c}).map((m,_)=>{const b=g("span",{className:"digit__num"},[document.createTextNode(String(_))]);return _!==i&&b.setAttribute("inert",""),b.style.setProperty("--n",String(_)),b}),d=g("span",{part:`digit ${e}-digit`,className:"digit"},l);d.style.setProperty("--current",String(i)),d.style.setProperty("--length",String(c)),super(t,i,d,r),this.pos=n,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=l,this.length=c}willUpdate(t){const e=this.el.getBoundingClientRect();this._prevValue=this.value;const i=e[this.section.justify]-t[this.section.justify],n=e.width/2;this._prevCenter=this.section.justify==="left"?i+n:i-n}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((e,i)=>i===t?e.removeAttribute("inert"):e.setAttribute("inert","")),this.value=t}didUpdate(t){const e=this.el.getBoundingClientRect(),i=e[this.section.justify]-t[this.section.justify],n=e.width/2,r=this.section.justify==="left"?i+n:i-n,a=this._prevCenter-r;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[L]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const n of this.flow.plugins){const r=(t=n.getDelta)==null?void 0:t.call(n,this.value,this._prevValue,this);if(r!=null)return r}const e=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(e);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:e}}class kt extends Z{constructor(t,e,i,n){const r=g("span",{className:"symbol__value",textContent:i});super(t,i,g("span",{part:`symbol ${e}`,className:"symbol"},[r]),n),this.type=e,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(i,new M(this.flow,r,{onRemove:this._onChildRemove(i)}))}willUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect();this._prevOffset=e[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const e=this._children.get(this.value);e&&(e.present=!1);const i=this._children.get(t);if(i)i.present=!0;else{const n=g("span",{className:"symbol__value",textContent:t});this.el.appendChild(n),this._children.set(t,new M(this.flow,n,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],i=this._prevOffset-e;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const X=String.raw;(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})();typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)");typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)");const J="--_number-flow-d-opacity",Q="--_number-flow-d-width",N="--_number-flow-dx",K="--_number-flow-d";(()=>{try{return CSS.registerProperty({name:J,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:N,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:Q,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:K,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})();const E="round(nearest, calc(var(--number-flow-mask-height, 0.25em) / 2), 1px)",f=`calc(${E} * 2)`,B="var(--number-flow-mask-width, 0.5em)",w=`calc(${B} / var(--scale-x))`,x="#000 0, transparent 71%",Ct=X`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:1}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${Q}) / var(--width));transform:translateX(var(${N})) scaleX(var(--scale-x));margin:0 calc(-1 * ${B});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${w},#000 calc(100% - ${w}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${f},#000 calc(100% - ${f}),transparent 100% ),radial-gradient(at bottom right,${x}),radial-gradient(at bottom left,${x}),radial-gradient(at top left,${x}),radial-gradient(at top right,${x});-webkit-mask-size:100% calc(100% - ${f} * 2),calc(100% - ${w} * 2) 100%,${w} ${f},${w} ${f},${w} ${f},${w} ${f};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${E} ${B};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${N})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${K})}.digit__num,.number .section::after{padding:${E} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${J}))}`,St=X`:host{display:inline-block;direction:ltr;white-space:nowrap;line-height:1}span{display:inline-block}:host([data-will-change]) span{will-change:transform}.number,.digit{padding:${E} 0}.symbol{white-space:pre}`,Et=(s="")=>X`:where(number-flow${s}){line-height:1}number-flow${s} > span{font-kerning:none;display:inline-block;padding:${f} 0}`,Tt=s=>[St,Et(s),Ct],tt=Symbol(),Mt=H({__name:"NumberFlowGroup",setup(s){const t=new Set;let e=!1;return lt(tt,(i,n)=>{t.add(i),ct(n,async()=>{e||(e=!0,t.forEach(async r=>{var a;!r.value||!r.value.created||(r.value.willUpdate(),await z(),(a=r.value)==null||a.didUpdate())}),await z(),e=!1)}),ht(()=>{t.delete(i)})}),(i,n)=>et(i.$slots,"default")}}),At=["batched","trend","plugins","animated","transformTiming","spinTiming","opacityTiming","respectMotionPreference","nonce","data-will-change","digits","innerHTML","data"],Nt=H({inheritAttrs:!1,__name:"index",props:{transformTiming:{default:()=>u.defaultProps.transformTiming},spinTiming:{default:()=>u.defaultProps.spinTiming},opacityTiming:{default:()=>u.defaultProps.opacityTiming},animated:{type:Boolean,default:()=>u.defaultProps.animated},respectMotionPreference:{type:Boolean,default:()=>u.defaultProps.respectMotionPreference},trend:{type:[Number,Function],default:()=>u.defaultProps.trend},plugins:{default:()=>u.defaultProps.plugins},digits:{default:()=>u.defaultProps.digits},locales:{},format:{},value:{},prefix:{},suffix:{},nonce:{},willChange:{type:Boolean,default:!1}},emits:["animationsstart","animationsfinish"],setup(s,{expose:t,emit:e}){const i=P();t({el:i});const n=e,r=j(()=>new Intl.NumberFormat(s.locales,s.format)),a=j(()=>$t(s.value,r.value,s.prefix,s.suffix)),o=void 0,c=it(tt,void 0);return c?.(i,a),(l,d)=>(nt(),st("number-flow-vue",at({ref_key:"el",ref:i},l.$attrs,{batched:!!D(c),trend:l.trend,plugins:l.plugins,animated:l.animated,transformTiming:l.transformTiming,spinTiming:l.spinTiming,opacityTiming:l.opacityTiming,respectMotionPreference:l.respectMotionPreference,nonce:l.nonce,"data-will-change":l.willChange?"":void 0,digits:l.digits,innerHTML:D(o),"data-allow-mismatch":"",onAnimationsstart:d[0]||(d[0]=m=>n("animationsstart")),onAnimationsfinish:d[1]||(d[1]=m=>n("animationsfinish")),data:a.value}),null,16,At))}}),Bt=Tt("-vue");_t("number-flow-vue",u);function Vt({respectMotionPreference:s=!0}={}){const t=P(!1),e=P(!1);return rt(()=>{var i;t.value=Y,e.value=((i=k)==null?void 0:i.matches)??!1}),ot(i=>{var n;if(!W(s))return;const r=({matches:a})=>{e.value=a};(n=k)==null||n.addEventListener("change",r),i(()=>{var a;(a=k)==null||a.removeEventListener("change",r)})}),j(()=>t.value&&(!W(s)||!e.value))}export{u as NumberFlowElement,Mt as NumberFlowGroup,jt as continuous,Nt as default,Bt as styles,Vt as useCanAnimate};
|
|
1
|
+
import{d as H,P as et,Q as it,o as nt,R as st,S as at,b as D,A as P,B as j,x as rt,T as ot,U as W,V as lt,y as ct,W as z,X as ht}from"./index-Cyjm-GKs.js";const dt=String.raw,pt=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),ut=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),k=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,C="--_number-flow-d-opacity",V="--_number-flow-d-width",S="--_number-flow-dx",L="--_number-flow-d",mt=(()=>{try{return CSS.registerProperty({name:C,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:S,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:V,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:L,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),U="round(nearest, calc(var(--number-flow-mask-height, 0.25em) / 2), 1px)",v=`calc(${U} * 2)`,R="var(--number-flow-mask-width, 0.5em)",y=`calc(${R} / var(--scale-x))`,$="#000 0, transparent 71%",ft=dt`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:1}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${V}) / var(--width));transform:translateX(var(${S})) scaleX(var(--scale-x));margin:0 calc(-1 * ${R});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${y},#000 calc(100% - ${y}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${v},#000 calc(100% - ${v}),transparent 100% ),radial-gradient(at bottom right,${$}),radial-gradient(at bottom left,${$}),radial-gradient(at top left,${$}),radial-gradient(at top right,${$});-webkit-mask-size:100% calc(100% - ${v} * 2),calc(100% - ${y} * 2) 100%,${y} ${v},${y} ${v},${y} ${v},${y} ${v};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${U} ${R};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${S})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${L})}.digit__num,.number .section::after{padding:${U} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${C}))}`,gt=HTMLElement,vt=(s,t)=>s==null?t:t==null?s:Math.max(s,t),A=new WeakMap,jt={onUpdate(s,t,e){if(A.set(e,void 0),!e.computedTrend)return;const i=t.integer.concat(t.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),n=s.integer.concat(s.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),r=i.find(o=>!n.find(c=>c.pos===o.pos&&c.value===o.value)),a=n.find(o=>!i.find(c=>o.pos===c.pos&&o.value===c.value));A.set(e,vt(r?.pos,a?.pos))},getDelta(s,t,e){const i=s-t,n=A.get(e.flow);if(!i&&n!=null&&n>=e.pos)return e.length*e.flow.computedTrend}},g=(s,t,e)=>{const i=document.createElement(s),[n,r]=Array.isArray(t)?[void 0,t]:[t,e];return n&&Object.assign(i,n),r?.forEach(a=>i.appendChild(a)),i},yt=(s,t)=>{var e;return t==="left"?s.offsetLeft:(((e=s.offsetParent instanceof HTMLElement?s.offsetParent:null)==null?void 0:e.offsetWidth)??0)-s.offsetWidth-s.offsetLeft},wt=s=>s.offsetWidth>0&&s.offsetHeight>0,_t=(s,t)=>{!customElements.get(s)&&customElements.define(s,t)};function bt(s,t,{reverse:e=!1}={}){const i=s.length;for(let n=e?i-1:0;e?n>=0:n<i;e?n--:n++)t(s[n],n)}function $t(s,t,e,i){const n=t.formatToParts(s);e&&n.unshift({type:"prefix",value:e}),i&&n.push({type:"suffix",value:i});const r=[],a=[],o=[],c=[],l={},d=p=>`${p}:${l[p]=(l[p]??-1)+1}`;let m="",_=!1,b=!1;for(const p of n){m+=p.value;const h=p.type==="minusSign"||p.type==="plusSign"?"sign":p.type;h==="integer"?(_=!0,a.push(...p.value.split("").map(T=>({type:h,value:parseInt(T)})))):h==="group"?a.push({type:h,value:p.value}):h==="decimal"?(b=!0,o.push({type:h,value:p.value,key:d(h)})):h==="fraction"?o.push(...p.value.split("").map(T=>({type:h,value:parseInt(T),key:d(h),pos:-1-l[h]}))):(_||b?c:r).push({type:h,value:p.value,key:d(h)})}const F=[];for(let p=a.length-1;p>=0;p--){const h=a[p];F.unshift(h.type==="integer"?{...h,key:d(h.type),pos:l[h.type]}:{...h,key:d(h.type)})}return{pre:r,integer:F,fraction:o,post:c,valueAsString:m,value:typeof s=="string"?parseFloat(s):s}}const Y=ut&&pt&&mt;let u=class extends gt{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...e}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,e)}get animated(){return this._animated}set animated(t){var e;this.animated!==t&&(this._animated=t,(e=this.shadowRoot)==null||e.getAnimations().forEach(i=>i.finish()))}set data(t){var e,i;if(t==null)return;const{pre:n,integer:r,fraction:a,post:o,value:c}=t;if(this.created){const l=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(l.value,c):this.trend,this.computedAnimated=Y&&this._animated&&(!this.respectMotionPreference||!((e=k)!=null&&e.matches))&&wt(this)&&this.ownerDocument.visibilityState==="visible",(i=this.plugins)==null||i.forEach(d=>{var m;return(m=d.onUpdate)==null?void 0:m.call(d,t,l,this)}),this.batched||this.willUpdate(),this._pre.update(n),this._num.update({integer:r,fraction:a}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}const l=document.createElement("style");this.nonce&&(l.nonce=this.nonce),l.textContent=ft,this.shadowRoot.appendChild(l),this._pre=new O(this,n,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new xt(this,r,a),this.shadowRoot.appendChild(this._num.el),this._post=new O(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}};u.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(s,t)=>Math.sign(t-s),respectMotionPreference:!0,plugins:void 0,digits:void 0};class xt{constructor(t,e,i,{className:n,...r}={}){this.flow=t,this._integer=new I(t,e,{justify:"right",part:"integer"}),this._fraction=new I(t,i,{justify:"left",part:"fraction"}),this._inner=g("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=g("span",{...r,part:"number",className:`number ${n??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:e}){this._integer.update(t),this._fraction.update(e)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const e=this._prevLeft-t.left,i=this.el.offsetWidth,n=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[S]:[`${e}px`,"0px"],[V]:[n,0]},{...this.flow.transformTiming,composite:"accumulate"})}}let G=class{constructor(t,e,{justify:i,className:n,...r},a){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=i;const o=e.map(c=>this.addChar(c).el);this.el=g("span",{...r,className:`section section--justify-${i} ${n??""}`},a?a(o):o)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const n=t.type==="integer"||t.type==="fraction"?new q(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new kt(this,t.type,t.value,{...i,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,n),n}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${yt(e.el,this.justify)}px`}),t.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(t){const e=new Map,i=new Map,n=this.justify==="left",r=n?"prepend":"append";if(bt(t,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),i.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),e.set(a,o)),this.el[r](o.el)},{reverse:n}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();e.forEach(o=>{o.willUpdate(a)})}e.forEach((a,o)=>{a.update(o.value)}),i.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(e=>e.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(n=>n.didUpdate(t));const e=t[this.justify],i=this._prevOffset-e;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}};class I extends G{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(r=>r.key===n)||e.set(n,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof q&&i.update(0)}),this.pop(e)}}class O extends G{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(r=>r.key===n)||e.set(n,i)}),this.pop(e),this.addNewAndUpdateExisting(t)}}class M{constructor(t,e,{onRemove:i,animateIn:n=!1}={}){this.flow=t,this.el=e,this._present=!0,this._remove=()=>{var r;this.el.remove(),(r=this._onRemove)==null||r.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&n&&this.el.animate({[C]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[C]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class Z extends M{constructor(t,e,i,n){super(t.flow,i,n),this.section=t,this.value=e,this.el=i}}class q extends Z{constructor(t,e,i,n,r){var a,o;const c=(((o=(a=t.flow.digits)==null?void 0:a[n])==null?void 0:o.max)??9)+1,l=Array.from({length:c}).map((m,_)=>{const b=g("span",{className:"digit__num"},[document.createTextNode(String(_))]);return _!==i&&b.setAttribute("inert",""),b.style.setProperty("--n",String(_)),b}),d=g("span",{part:`digit ${e}-digit`,className:"digit"},l);d.style.setProperty("--current",String(i)),d.style.setProperty("--length",String(c)),super(t,i,d,r),this.pos=n,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=l,this.length=c}willUpdate(t){const e=this.el.getBoundingClientRect();this._prevValue=this.value;const i=e[this.section.justify]-t[this.section.justify],n=e.width/2;this._prevCenter=this.section.justify==="left"?i+n:i-n}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((e,i)=>i===t?e.removeAttribute("inert"):e.setAttribute("inert","")),this.value=t}didUpdate(t){const e=this.el.getBoundingClientRect(),i=e[this.section.justify]-t[this.section.justify],n=e.width/2,r=this.section.justify==="left"?i+n:i-n,a=this._prevCenter-r;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[L]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const n of this.flow.plugins){const r=(t=n.getDelta)==null?void 0:t.call(n,this.value,this._prevValue,this);if(r!=null)return r}const e=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(e);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:e}}class kt extends Z{constructor(t,e,i,n){const r=g("span",{className:"symbol__value",textContent:i});super(t,i,g("span",{part:`symbol ${e}`,className:"symbol"},[r]),n),this.type=e,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(i,new M(this.flow,r,{onRemove:this._onChildRemove(i)}))}willUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect();this._prevOffset=e[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const e=this._children.get(this.value);e&&(e.present=!1);const i=this._children.get(t);if(i)i.present=!0;else{const n=g("span",{className:"symbol__value",textContent:t});this.el.appendChild(n),this._children.set(t,new M(this.flow,n,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],i=this._prevOffset-e;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const X=String.raw;(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})();typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)");typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)");const J="--_number-flow-d-opacity",Q="--_number-flow-d-width",N="--_number-flow-dx",K="--_number-flow-d";(()=>{try{return CSS.registerProperty({name:J,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:N,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:Q,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:K,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})();const E="round(nearest, calc(var(--number-flow-mask-height, 0.25em) / 2), 1px)",f=`calc(${E} * 2)`,B="var(--number-flow-mask-width, 0.5em)",w=`calc(${B} / var(--scale-x))`,x="#000 0, transparent 71%",Ct=X`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:1}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${Q}) / var(--width));transform:translateX(var(${N})) scaleX(var(--scale-x));margin:0 calc(-1 * ${B});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${w},#000 calc(100% - ${w}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${f},#000 calc(100% - ${f}),transparent 100% ),radial-gradient(at bottom right,${x}),radial-gradient(at bottom left,${x}),radial-gradient(at top left,${x}),radial-gradient(at top right,${x});-webkit-mask-size:100% calc(100% - ${f} * 2),calc(100% - ${w} * 2) 100%,${w} ${f},${w} ${f},${w} ${f},${w} ${f};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${E} ${B};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${N})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${K})}.digit__num,.number .section::after{padding:${E} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${J}))}`,St=X`:host{display:inline-block;direction:ltr;white-space:nowrap;line-height:1}span{display:inline-block}:host([data-will-change]) span{will-change:transform}.number,.digit{padding:${E} 0}.symbol{white-space:pre}`,Et=(s="")=>X`:where(number-flow${s}){line-height:1}number-flow${s} > span{font-kerning:none;display:inline-block;padding:${f} 0}`,Tt=s=>[St,Et(s),Ct],tt=Symbol(),Mt=H({__name:"NumberFlowGroup",setup(s){const t=new Set;let e=!1;return lt(tt,(i,n)=>{t.add(i),ct(n,async()=>{e||(e=!0,t.forEach(async r=>{var a;!r.value||!r.value.created||(r.value.willUpdate(),await z(),(a=r.value)==null||a.didUpdate())}),await z(),e=!1)}),ht(()=>{t.delete(i)})}),(i,n)=>et(i.$slots,"default")}}),At=["batched","trend","plugins","animated","transformTiming","spinTiming","opacityTiming","respectMotionPreference","nonce","data-will-change","digits","innerHTML","data"],Nt=H({inheritAttrs:!1,__name:"index",props:{transformTiming:{default:()=>u.defaultProps.transformTiming},spinTiming:{default:()=>u.defaultProps.spinTiming},opacityTiming:{default:()=>u.defaultProps.opacityTiming},animated:{type:Boolean,default:()=>u.defaultProps.animated},respectMotionPreference:{type:Boolean,default:()=>u.defaultProps.respectMotionPreference},trend:{type:[Number,Function],default:()=>u.defaultProps.trend},plugins:{default:()=>u.defaultProps.plugins},digits:{default:()=>u.defaultProps.digits},locales:{},format:{},value:{},prefix:{},suffix:{},nonce:{},willChange:{type:Boolean,default:!1}},emits:["animationsstart","animationsfinish"],setup(s,{expose:t,emit:e}){const i=P();t({el:i});const n=e,r=j(()=>new Intl.NumberFormat(s.locales,s.format)),a=j(()=>$t(s.value,r.value,s.prefix,s.suffix)),o=void 0,c=it(tt,void 0);return c?.(i,a),(l,d)=>(nt(),st("number-flow-vue",at({ref_key:"el",ref:i},l.$attrs,{batched:!!D(c),trend:l.trend,plugins:l.plugins,animated:l.animated,transformTiming:l.transformTiming,spinTiming:l.spinTiming,opacityTiming:l.opacityTiming,respectMotionPreference:l.respectMotionPreference,nonce:l.nonce,"data-will-change":l.willChange?"":void 0,digits:l.digits,innerHTML:D(o),"data-allow-mismatch":"",onAnimationsstart:d[0]||(d[0]=m=>n("animationsstart")),onAnimationsfinish:d[1]||(d[1]=m=>n("animationsfinish")),data:a.value}),null,16,At))}}),Bt=Tt("-vue");_t("number-flow-vue",u);function Vt({respectMotionPreference:s=!0}={}){const t=P(!1),e=P(!1);return rt(()=>{var i;t.value=Y,e.value=((i=k)==null?void 0:i.matches)??!1}),ot(i=>{var n;if(!W(s))return;const r=({matches:a})=>{e.value=a};(n=k)==null||n.addEventListener("change",r),i(()=>{var a;(a=k)==null||a.removeEventListener("change",r)})}),j(()=>t.value&&(!W(s)||!e.value))}export{u as NumberFlowElement,Mt as NumberFlowGroup,jt as continuous,Nt as default,Bt as styles,Vt as useCanAnimate};
|