@shwfed/config 2.7.2 → 2.7.4
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 +1106 -1019
- package/dist/module.json +1 -1
- package/dist/preview/assets/badge-BKq7Eh7r.js +1 -0
- package/dist/preview/assets/{config-OQtpit00.js → config-C2XmKu42.js} +1 -1
- package/dist/preview/assets/{config-D8tXo17l.js → config-C31gRv6X.js} +1 -1
- package/dist/preview/assets/{config-DtCRvYa9.js → config-CXomiRuI.js} +1 -1
- package/dist/preview/assets/{config-B-uvT_pb.js → config-CnsvNcA2.js} +1 -1
- package/dist/preview/assets/{config-D9pA2oC8.js → config-DD3McP6M.js} +1 -1
- package/dist/preview/assets/{config-BRiILJ2a.js → config-DM58--pQ.js} +1 -1
- package/dist/preview/assets/{config-dtgP-3mj.js → config-De_RAxft.js} +1 -1
- package/dist/preview/assets/{config-QHRydAV_.js → config-Dg3cJb4i.js} +1 -1
- package/dist/preview/assets/{config-CbMKku2N.js → config-DpTBe8_L.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-Dp8O3US_.js → definition.vue_vue_type_script_setup_true_lang-D-K8Bmbj.js} +1 -1
- package/dist/preview/assets/{index-BWNTkzpm.js → index-4Jigs5K_.js} +1 -1
- package/dist/preview/assets/{index-BBJQYeyQ.js → index-CfwL2UCH.js} +175 -175
- package/dist/preview/assets/index-DNHGrCDe.css +1 -0
- package/dist/preview/assets/index-DUo1pTg2.js +1 -0
- package/dist/preview/assets/{item-BpzTGOEt.js → item-DnUV5B-b.js} +1 -1
- package/dist/preview/assets/{runtime-Busbr90M.js → runtime-BCxzICuW.js} +1 -1
- package/dist/preview/assets/{runtime-DMsEFiBw.js → runtime-BqhvXsJ-.js} +1 -1
- package/dist/preview/assets/{runtime-DfP3qvGT.js → runtime-CG4uOgGu.js} +1 -1
- package/dist/preview/assets/{runtime-By0VH4uC.js → runtime-ChaoQZI9.js} +1 -1
- package/dist/preview/assets/{runtime-C29fORZL.js → runtime-DAfJmoV1.js} +1 -1
- package/dist/preview/assets/{runtime-BjB2wvFX.js → runtime-Dhi2Tk84.js} +1 -1
- package/dist/preview/assets/{runtime-B5S6icpw.js → runtime-Dj43RjZC.js} +1 -1
- package/dist/preview/assets/{runtime-BDyVuoP3.js → runtime-DnlIppMg.js} +1 -1
- package/dist/preview/assets/{runtime-DiTvLHpE.js → runtime-W5CcSnyo.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/config.d.vue.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/config.vue +27 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/config.vue.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/runtime.d.vue.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/runtime.vue +18 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/runtime.vue.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/schema.d.ts +2 -1
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.markdown/schema.js +10 -1
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/badge.vue +11 -1
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/config.d.vue.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/config.vue +48 -21
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/config.vue.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/runtime.d.vue.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/runtime.vue.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.d.ts +2 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.js +11 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.icon/config.d.vue.ts +34 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.icon/config.vue +153 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.icon/config.vue.d.ts +34 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.icon/runtime.d.vue.ts +34 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.icon/runtime.vue +41 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.icon/runtime.vue.d.ts +34 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.icon/schema.d.ts +33 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.icon/schema.js +45 -0
- package/dist/runtime/components/config/config.vue +135 -22
- package/dist/runtime/components/config/index.d.vue.ts +4 -0
- package/dist/runtime/components/config/index.vue +26 -2
- package/dist/runtime/components/config/index.vue.d.ts +4 -0
- package/dist/runtime/components/config/schema.d.ts +20 -0
- package/dist/runtime/components/config/schema.js +15 -1
- package/dist/runtime/components/form/FormUnitRenderer.vue +2 -8
- 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/share/slot-renderer.vue +2 -8
- package/package.json +1 -1
- package/dist/preview/assets/badge-CJpxWUkB.js +0 -1
- package/dist/preview/assets/index-ChitoGhE.js +0 -1
- package/dist/preview/assets/index-DFKLSxdT.css +0 -1
package/dist/module.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as M,F,u as $,o as z,w as p,a as v,y as E,c as w,z as x,b as f,_ as y,G as I,H as L,I as N,J as P,K as S,e as t,g as V,f as m,i as A,p as G,l as H,j as J,r as K,k as O,q as T,L as W,M as D,t as Q,m as R,s as U}from"./index-CfwL2UCH.js";const Y=M({name:"ShwfedBlockCardBadge",inheritAttrs:!1,__name:"badge",props:{badge:{}},setup(n){const a=n,{locale:k}=F(),j=T(),o=K(void 0);function i(){return O(j)}const g=t(()=>o.value===void 0?R():U(o.value)),l=t(()=>W(a.badge.content,k.value)||""),C=t(()=>l.value?D(l.value,m,{...i(),json:g.value}):""),B=t(()=>{const e=a.badge.show;if(!e)return!0;try{return Q(m(e,{...i(),json:g.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(),q=V(function*(){return yield*(yield*m(e,r)).json()});try{o.value=await A(G(q,H))}catch(h){console.warn("[shwfed-card-badge] fetch failed",h)}}const u=t(()=>!!a.badge.request&&(a.badge.interval??0)>0),_=t(()=>Math.max(1,a.badge.interval??1)*1e3),c=J(),{pause:b,resume:d}=$(()=>{s()},_,{immediate:!1});return z(()=>{s(),u.value&&c.value&&d()}),p(c,e=>{u.value&&(e?(s(),d()):b())}),p(()=>[a.badge.request??"",a.badge.interval??0].join("|"),()=>{s(),u.value&&c.value?d():b()}),(e,r)=>l.value&&B.value?(v(),E(P,{key:0},[n.badge.dot?(v(),w(f(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"])):(v(),w(f(y),x({key:1,variant:n.badge.variant??"default"},e.$attrs),{default:I(()=>[L(f(N),{source:C.value,class:"max-w-none text-inherit [&_*]:text-inherit [&_p]:m-0"},null,8,["source"])]),_:1},16,["variant"]))],64)):S("",!0)}});export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as k,P as S,ad as V,y as m,H as e,G as l,b as a,a as f,T as _,U as v,V as u,W as r,I as p,X as b,S as x,ae as y,af as h,ag as T,ah as w,J as z,a0 as D,ai as N,a2 as C,a3 as F}from"./index-
|
|
1
|
+
import{d as k,P as S,ad as V,y as m,H as e,G as l,b as a,a as f,T as _,U as v,V as u,W as r,I as p,X as b,S as x,ae as y,af as h,ag as T,ah as w,J as z,a0 as D,ai as N,a2 as C,a3 as F}from"./index-CfwL2UCH.js";const M={class:"flex flex-col gap-3"},U=k({name:"ShwfedNavigationActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(g){const t=S(g,"modelValue"),c=V(()=>{}),d=o=>C(c,o)??o,n=o=>F(c,o),$=[{value:"_self",label:"当前页面打开"},{value:"_blank",label:"新页面打开"}];return(o,i)=>(f(),m("div",M,[e(a(x),{orientation:"vertical"},{default:l(()=>[e(a(_),{class:"text-xs text-zinc-500"},v({default:l(()=>[u(" "+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(b),{"model-value":t.value.url??"",placeholder:"例:'/detail/' + string(row.id)","result-type":"string",class:"min-h-10","onUpdate:modelValue":i[0]||(i[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(()=>[u(" "+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(y),{"model-value":t.value.mode??"_self","onUpdate:modelValue":i[1]||(i[1]=s=>t.value={...t.value,mode:s})},{default:l(()=>[e(a(h),{class:"w-full"},{default:l(()=>[e(a(T))]),_:1}),e(a(w),null,{default:l(()=>[(f(),m(z,null,D($,s=>e(a(N),{key:s.value,value:s.value},{default:l(()=>[u(r(s.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"])]),_:1})]))}});export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as x,P as k,b0 as S,y as V,H as e,G as l,b as a,a as g,T as r,U as m,V as d,W as f,I as p,au as $,S as _,Y as b,a2 as w,a3 as y}from"./index-
|
|
1
|
+
import{d as x,P as k,b0 as S,y as V,H as e,G as l,b as a,a as g,T as r,U as m,V as d,W as f,I as p,au as $,S as _,Y as b,a2 as w,a3 as y}from"./index-CfwL2UCH.js";const z={class:"flex flex-col gap-4"},h=x({name:"ShwfedMarkdownItemConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(v){const t=k(v,"modelValue"),c=S(),u=o=>w(c,o)??o,s=o=>y(c,o);return(o,n)=>(g(),V("div",z,[e(a(_),{orientation:"vertical"},{default:l(()=>[e(a(r),{class:"text-xs text-zinc-500"},m({default:l(()=>[d(" "+f(u("name")),1)]),_:2},[s("name")?{name:"tooltip",fn:l(()=>[e(a(p),{source:s("name"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a($),{"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:l(()=>[e(a(r),{class:"text-xs text-zinc-500"},m({default:l(()=>[d(" "+f(u("content")),1)]),_:2},[s("content")?{name:"tooltip",fn:l(()=>[e(a(p),{source:s("content"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(a(b),{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{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as y,P as U,aA as k,y as w,R as x,H as t,G as n,b as s,J as D,a0 as F,a as S,T as i,V as u,I as c,X as d,S as p,aB as g,U as f,W as _,a1 as H,a2 as B,a3 as C,e as z}from"./index-
|
|
1
|
+
import{d as y,P as U,aA as k,y as w,R as x,H as t,G as n,b as s,J as D,a0 as F,a as S,T as i,V as u,I as c,X as d,S as p,aB as g,U as f,W as _,a1 as H,a2 as B,a3 as C,e as z}from"./index-CfwL2UCH.js";const L={class:"flex flex-col gap-3"},N={class:"grid grid-cols-2 gap-3"},$={class:"flex items-start gap-2"},A={class:"grid grid-cols-2 gap-3"},M=y({name:"ShwfedHttpDownloadActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(q){const l=U(q,"modelValue"),E=k(()=>{}),m=a=>B(E,a)??a,r=a=>C(E,a),R=["onSuccess","onWarning","onError","onInfo"],h=z({get:()=>l.value.template?.request??"",set:a=>{l.value={...l.value,template:{...l.value.template,request:a}}}}),V=z({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 T(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 j(a,e){const o={...l.value};e.length===0?Reflect.deleteProperty(o,a):o[a]=e,l.value=o}return(a,e)=>(S(),w("div",L,[x("div",N,[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":V.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=>V.value=o)},null,8,["model-value","extra-vars"])]),_:1})]),x("div",$,[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":T},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",A,[(S(),w(D,null,F(R,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=>j(o,v)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]))}});export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as _,P as y,a5 as x,a6 as b,y as c,R as i,H as n,G as o,b as t,a as l,a7 as v,a8 as u,a9 as g,aa as D,J as h,a0 as S,c as $,ab as k,W as p,ac as w}from"./index-
|
|
1
|
+
import{d as _,P as y,a5 as x,a6 as b,y as c,R as i,H as n,G as o,b as t,a as l,a7 as v,a8 as u,a9 as g,aa as D,J as h,a0 as S,c as $,ab as k,W as p,ac as w}from"./index-CfwL2UCH.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(w),null,{default:o(()=>[n(t(v),{align:"inline-start"},{default:o(()=>[n(t(u),{icon:"fluent:arrow-swap-20-regular"})]),_:1}),n(t(g),null,{default:o(()=>[n(t(D),null,{default:o(()=>[(l(!0),c(h,null,S(t(f),a=>(l(),$(t(k),{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 Z,P as ee,aj as le,ak as te,w as I,al as A,y as v,c as H,H as n,G as s,b as l,am as ae,K as oe,J as R,an as ne,W as p,R as c,ao as W,ap as F,aq as se,e as x,r as ie,x as K,a as d,ar as j,as as O,a8 as Y,at as h,T as B,U as b,V as U,I as V,Y as de,S as L,au as q,a2 as ue,a3 as ve,av as ce,aw as re,ax as me,ay as fe}from"./index-
|
|
1
|
+
import{d as Z,P as ee,aj as le,ak as te,w as I,al as A,y as v,c as H,H as n,G as s,b as l,am as ae,K as oe,J as R,an as ne,W as p,R as c,ao as W,ap as F,aq as se,e as x,r as ie,x as K,a as d,ar as j,as as O,a8 as Y,at as h,T as B,U as b,V as U,I as V,Y as de,S as L,au as q,a2 as ue,a3 as ve,av as ce,aw as re,ax as me,ay as fe}from"./index-CfwL2UCH.js";const pe={key:0,class:"flex min-h-96 items-center justify-center p-8 text-sm text-zinc-400"},xe={key:1},ke={key:2,class:"p-6 text-sm text-red-500"},ye={key:2,class:"flex flex-col gap-4"},ge={class:"grid grid-cols-2 gap-4"},Ie={key:0,class:"flex gap-2 min-h-96"},Be={class:"flex w-56 shrink-0 flex-col"},be={class:"flex flex-1 flex-col gap-2"},Ue={class:"flex-1"},Ve={key:1,class:"flex flex-col gap-2"},Le={class:"h-96"},De=Z({name:"ShwfedModalLayoutActionConfig",__name:"config",props:se({configure:{type:Function}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(_){const i=ee(_,"modelValue"),P=_,D=x(()=>P.configure??(()=>{})),E=le(()=>{}),k=a=>ue(E,a)??a,r=a=>ve(E,a),G=x({get:()=>i.value.slot??ce(),set:a=>{i.value={...i.value,slot:a}}}),t=te(G,{configure:D.value});function J(a){i.value={...i.value,modalTitle:a}}function T(a,e){const o=e.trim(),g={...i.value};o.length===0?Reflect.deleteProperty(g,a):g[a]=o,i.value=g}function S(){const a=t.layouts.value;t.layouts.value=[...a,{name:"新布局",layout:{columns:1,placements:{}}}],t.activeLayoutIndex.value=a.length}function M(a,e){t.addBlock(a,e)}function w(a){t.removeBlock(a)}function z(a){t.removeBlocks(a)}const u=ie(null),m=x(()=>{const a=u.value;return a?t.blocks.value.find(e=>e.id===a)??null:null}),$=x(()=>{const a=m.value;return a?re()?.(a.type,a.compatibilityDate)??null:null});function C(a){u.value=a}function X(){u.value=null}I(()=>t.blocks.value.map(a=>a.id),a=>{const e=u.value;e&&!a.includes(e)&&(u.value=null)});function Q(a){const e=u.value;e&&t.updateBlock(e,a)}const N=K(me,null);if(N){const a=N.add();I(m,e=>{e?(a.label.value=t.getBlockLabel(e),a.back.value=X):(a.label.value=null,a.back.value=null)},{immediate:!0}),A(()=>{a.dispose()})}const f=K(fe,null),y=x(()=>f?.target.value??null);return I(u,a=>{f?.drilled&&(f.drilled.value=!!a)},{immediate:!0}),A(()=>{f?.drilled&&(f.drilled.value=!1)}),(a,e)=>(d(),v(R,null,[y.value&&!u.value?(d(),H(ae,{key:0,to:y.value},[n(l(O),{class:"flex-1"},{default:s(()=>[n(j,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[0]||(e[0]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[1]||(e[1]=o=>{l(t).activeLayoutIndex.value=o})},null,8,["model-value","active-index"])]),_:1}),n(l(h),{variant:"ghost",size:"sm",onClick:e[2]||(e[2]=o=>S())},{default:s(()=>[n(l(Y),{icon:"fluent:add-20-regular",class:"size-4"}),e[17]||(e[17]=c("span",null,"新增布局",-1))]),_:1})],8,["to"])):oe("",!0),u.value?(d(),v(R,{key:1},[m.value?$.value?(d(),v("div",xe,[(d(),H(ne($.value.config),{"model-value":m.value,configure:D.value,"onUpdate:modelValue":e[3]||(e[3]=o=>Q(o))},null,8,["model-value","configure"]))])):(d(),v("div",ke," 未注册的块类型:"+p(m.value.type)+"@"+p(m.value.compatibilityDate),1)):(d(),v("div",pe," 块已不存在 "))],64)):(d(),v("div",ye,[n(l(L),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[U(" "+p(k("modalTitle")),1)]),_:2},[r("modalTitle")?{name:"tooltip",fn:s(()=>[n(l(V),{source:r("modalTitle"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(de),{markdown:"","model-value":i.value.modalTitle,"translate-hint":k("modalTitle"),"onUpdate:modelValue":J},null,8,["model-value","translate-hint"])]),_:1}),c("div",ge,[n(l(L),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[U(" "+p(k("modalWidth")),1)]),_:2},[r("modalWidth")?{name:"tooltip",fn:s(()=>[n(l(V),{source:r("modalWidth"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(q),{"model-value":i.value.modalWidth??"",placeholder:"例:720px / 60vw","onUpdate:modelValue":e[4]||(e[4]=o=>T("modalWidth",String(o)))},null,8,["model-value"])]),_:1}),n(l(L),{orientation:"vertical"},{default:s(()=>[n(l(B),{class:"text-xs text-zinc-500"},b({default:s(()=>[U(" "+p(k("modalMinHeight")),1)]),_:2},[r("modalMinHeight")?{name:"tooltip",fn:s(()=>[n(l(V),{source:r("modalMinHeight"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),n(l(q),{"model-value":i.value.modalMinHeight??"",placeholder:"例:400px / 60vh","onUpdate:modelValue":e[5]||(e[5]=o=>T("modalMinHeight",String(o)))},null,8,["model-value"])]),_:1})]),y.value?(d(),v("div",Ve,[n(W,{"model-value":l(t).layouts.value,index:l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[13]||(e[13]=o=>{l(t).layouts.value=o})},null,8,["model-value","index"]),c("div",Le,[n(F,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"selected-item-ids":l(t).selectedBlockIds.value,items:l(t).blocks.value,"find-entry":l(t).findBlockMeta,"get-item-label":l(t).getBlockLabel,"picker-entries":l(t).pickerEntries.value,"can-delete":!0,"item-noun":"块","onUpdate:modelValue":e[14]||(e[14]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[15]||(e[15]=o=>{l(t).activeLayoutIndex.value=o}),"onUpdate:selectedItemIds":e[16]||(e[16]=o=>{l(t).selectedBlockIds.value=o}),onAddNew:M,onDrillDown:C,onDeleteItem:w,onDeleteItems:z},null,8,["model-value","active-index","selected-item-ids","items","find-entry","get-item-label","picker-entries"])])])):(d(),v("div",Ie,[c("div",Be,[n(l(O),{class:"flex-1"},{default:s(()=>[n(j,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[6]||(e[6]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[7]||(e[7]=o=>{l(t).activeLayoutIndex.value=o})},null,8,["model-value","active-index"])]),_:1}),n(l(h),{variant:"ghost",size:"sm",onClick:e[8]||(e[8]=o=>S())},{default:s(()=>[n(l(Y),{icon:"fluent:add-20-regular",class:"size-4"}),e[18]||(e[18]=c("span",null,"新增布局",-1))]),_:1})]),c("div",be,[n(W,{"model-value":l(t).layouts.value,index:l(t).activeLayoutIndex.value,"onUpdate:modelValue":e[9]||(e[9]=o=>{l(t).layouts.value=o})},null,8,["model-value","index"]),c("div",Ue,[n(F,{"model-value":l(t).layouts.value,"active-index":l(t).activeLayoutIndex.value,"selected-item-ids":l(t).selectedBlockIds.value,items:l(t).blocks.value,"find-entry":l(t).findBlockMeta,"get-item-label":l(t).getBlockLabel,"picker-entries":l(t).pickerEntries.value,"can-delete":!0,"item-noun":"块","onUpdate:modelValue":e[10]||(e[10]=o=>{l(t).layouts.value=o}),"onUpdate:activeIndex":e[11]||(e[11]=o=>{l(t).activeLayoutIndex.value=o}),"onUpdate:selectedItemIds":e[12]||(e[12]=o=>{l(t).selectedBlockIds.value=o}),onAddNew:M,onDrillDown:C,onDeleteItem:w,onDeleteItems:z},null,8,["model-value","active-index","selected-item-ids","items","find-entry","get-item-label","picker-entries"])])])]))]))],64))}});export{De as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as g,P as d,a2 as u,az as f,y as m,H as s,G as i,b as r,a as p,T as _,V as v,W as x,a1 as h,S as T,e as V}from"./index-
|
|
1
|
+
import{d as g,P as d,a2 as u,az as f,y as m,H as s,G as i,b as r,a as p,T as _,V as v,W as x,a1 as h,S as T,e as V}from"./index-CfwL2UCH.js";const S={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",S,[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 z,a as y,y as E,v as V,N as T,b as e,O as U,P as $,Q as j,c as F,G as l,R as v,H as s,S as d,T as u,U as p,V as m,W as f,I as g,X as b,Y as N,Z as h,$ as B,J as C,a0 as H,a1 as O,a2 as R,a3 as D}from"./index-
|
|
1
|
+
import{d as z,a as y,y as E,v as V,N as T,b as e,O as U,P as $,Q as j,c as F,G as l,R as v,H as s,S as d,T as u,U as p,V as m,W as f,I as g,X as b,Y as N,Z as h,$ as B,J as C,a0 as H,a1 as O,a2 as R,a3 as D}from"./index-CfwL2UCH.js";const P=z({__name:"FieldGroup",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(_){const r=_;return(x,i)=>(y(),E("div",{"data-slot":"field-group",class:T(e(U)("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",r.class))},[V(x.$slots,"default")],2))}}),q={class:"grid grid-cols-2 gap-4"},I={class:"grid grid-cols-2 gap-4"},J={class:"flex items-start gap-2"},L={class:"grid grid-cols-2 gap-3"},G=z({name:"ShwfedHttpRequestConfirmActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(_){const r=$(_,"modelValue"),x=j(()=>{}),i=n=>R(x,n)??n,a=n=>D(x,n);function c(n){const t={...r.value,...n};for(const[o,k]of Object.entries(n))k===void 0&&Reflect.deleteProperty(t,o);r.value=t}const S=["onSuccess","onWarning","onError","onInfo"];function w(n,t){c({[n]:t.length===0?void 0:t})}return(n,t)=>(y(),F(e(P),null,{default:l(()=>[v("div",q,[s(e(d),{orientation:"vertical"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("expression")),1)]),_:2},[a("expression")?{name:"tooltip",fn:l(()=>[s(e(g),{source:a("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(b),{"model-value":r.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}),s(e(d),{orientation:"vertical"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("markdown")),1)]),_:2},[a("markdown")?{name:"tooltip",fn:l(()=>[s(e(g),{source:a("markdown"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(N),{markdown:"","model-value":r.value.markdown,"onUpdate:modelValue":t[1]||(t[1]=o=>c({markdown:o}))},null,8,["model-value"])]),_:1})]),v("div",I,[s(e(d),{orientation:"vertical"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("icon")),1)]),_:2},[a("icon")?{name:"tooltip",fn:l(()=>[s(e(g),{source:a("icon"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(h),{"model-value":r.value.icon??"","onUpdate:modelValue":t[2]||(t[2]=o=>c(o.trim()===""?{icon:void 0}:{icon:o}))},null,8,["model-value"])]),_:1}),s(e(d),{orientation:"vertical"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("color")),1)]),_:2},[a("color")?{name:"tooltip",fn:l(()=>[s(e(g),{source:a("color"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(B),{"model-value":r.value.color??"","onUpdate:modelValue":t[3]||(t[3]=o=>c(o.trim()===""?{color:void 0}:{color:o}))},null,8,["model-value"])]),_:1})]),v("div",J,[s(e(d),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("messageExpression")),1)]),_:2},[a("messageExpression")?{name:"tooltip",fn:l(()=>[s(e(g),{source:a("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(b),{"model-value":r.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":t[4]||(t[4]=o=>c({messageExpression:o===""?void 0:o}))},null,8,["model-value"])]),_:1}),s(e(d),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i("resultExpression")),1)]),_:2},[a("resultExpression")?{name:"tooltip",fn:l(()=>[s(e(g),{source:a("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(e(b),{"model-value":r.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":t[5]||(t[5]=o=>c({resultExpression:o===""?void 0:o}))},null,8,["model-value"])]),_:1})]),v("div",L,[(y(),E(C,null,H(S,o=>s(e(d),{key:o,orientation:"vertical",class:"min-w-0"},{default:l(()=>[s(e(u),{class:"text-xs text-zinc-500"},p({default:l(()=>[m(" "+f(i(o)),1)]),_:2},[a(o)?{name:"tooltip",fn:l(()=>[s(e(g),{source:a(o),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),s(O,{triggers:r.value[o]??[],"onUpdate:triggers":k=>w(o,k)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]),_:1}))}});export{G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as z,P as U,a4 as w,y as v,H as e,G as n,b as s,R as _,J as R,a0 as F,a as E,T as c,U as u,V as d,W as p,I as m,X as f,S as x,a1 as H,a2 as N,a3 as j}from"./index-
|
|
1
|
+
import{d as z,P as U,a4 as w,y as v,H as e,G as n,b as s,R as _,J as R,a0 as F,a as E,T as c,U as u,V as d,W as p,I as m,X as f,S as x,a1 as H,a2 as N,a3 as j}from"./index-CfwL2UCH.js";const k={class:"flex flex-col gap-3"},D={class:"flex items-start gap-2"},P={class:"grid grid-cols-2 gap-3"},q=z({name:"ShwfedHttpRequestActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(h){const o=U(h,"modelValue"),g=w(()=>{}),i=t=>N(g,t)??t,r=t=>j(g,t),S=["onSuccess","onWarning","onError","onInfo"];function T(t){const l={...o.value};t.length===0?delete l.messageExpression:l.messageExpression=t,o.value=l}function b(t){const l={...o.value};t.length===0?delete l.resultExpression:l.resultExpression=t,o.value=l}function V(t,l){const a={...o.value};l.length===0?Reflect.deleteProperty(a,t):a[t]=l,o.value=a}return(t,l)=>(E(),v("div",k,[e(s(x),{orientation:"vertical"},{default:n(()=>[e(s(c),{class:"text-xs text-zinc-500"},u({default:n(()=>[d(" "+p(i("expression")),1)]),_:2},[r("expression")?{name:"tooltip",fn:n(()=>[e(s(m),{source:r("expression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(f),{"model-value":o.value.expression,multiline:"",placeholder:"例:http.post('/api/foo').body({ id: row.id })","result-type":"HttpRequest",class:"min-h-16","onUpdate:modelValue":l[0]||(l[0]=a=>o.value={...o.value,expression:a})},null,8,["model-value"])]),_:1}),_("div",D,[e(s(x),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:n(()=>[e(s(c),{class:"text-xs text-zinc-500"},u({default:n(()=>[d(" "+p(i("messageExpression")),1)]),_:2},[r("messageExpression")?{name:"tooltip",fn:n(()=>[e(s(m),{source:r("messageExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(f),{"model-value":o.value.messageExpression??"",placeholder:"例:string(json.message)","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":T},null,8,["model-value"])]),_:1}),e(s(x),{orientation:"vertical",class:"flex-1 basis-0 min-w-0"},{default:n(()=>[e(s(c),{class:"text-xs text-zinc-500"},u({default:n(()=>[d(" "+p(i("resultExpression")),1)]),_:2},[r("resultExpression")?{name:"tooltip",fn:n(()=>[e(s(m),{source:r("resultExpression"),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(s(f),{"model-value":o.value.resultExpression??"",placeholder:"例:json.code == 0 ? 'success' : 'error'","result-type":"string","extra-vars":{json:{type:"dyn",label:"HTTP 响应体(已解析 JSON)"}},"onUpdate:modelValue":b},null,8,["model-value"])]),_:1})]),_("div",P,[(E(),v(R,null,F(S,a=>e(s(x),{key:a,orientation:"vertical",class:"min-w-0"},{default:n(()=>[e(s(c),{class:"text-xs text-zinc-500"},u({default:n(()=>[d(" "+p(i(a)),1)]),_:2},[r(a)?{name:"tooltip",fn:n(()=>[e(s(m),{source:r(a),block:"",class:"prose prose-sm prose-zinc"},null,8,["source"])]),key:"0"}:void 0]),1024),e(H,{triggers:o.value[a]??[],"onUpdate:triggers":y=>V(a,y)},null,8,["triggers","onUpdate:triggers"])]),_:2},1024)),64))])]))}});export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as v,P as S,aC as h,a as V,y as k,H as s,G as l,b as t,T as r,U as u,V as d,W as p,I as m,X as y,S as f,a1 as T,a2 as w,a3 as z}from"./index-
|
|
1
|
+
import{d as v,P as S,aC as h,a as V,y as k,H as s,G as l,b as t,T as r,U as u,V as d,W as p,I as m,X as y,S as f,a1 as T,a2 as w,a3 as z}from"./index-CfwL2UCH.js";const C={class:"flex flex-col gap-3"},b=v({name:"ShwfedStateWriteActionConfig",__name:"config",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(_){const o=S(_,"modelValue"),i=h(()=>{}),c=e=>w(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",C,[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(y),{"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(T,{triggers:o.value.onSuccess??[],"onUpdate:triggers":g},null,8,["triggers"])]),_:1})]))}});export{b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as f,aZ as u,o as m,a_ as p,al as g,K as l,x as I,a$ as _}from"./index-
|
|
1
|
+
import{d as f,aZ as u,o as m,a_ as p,al as g,K as l,x as I,a$ as _}from"./index-CfwL2UCH.js";const w=f({name:"ShwfedActionDefinition",inheritAttrs:!1,__name:"definition",props:{actionId:{},effect:{}},setup(r){const n=r,a=u(),t=I(_,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)}),(y,A)=>l("",!0)}});export{w as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as H,v as et,x as it,a as nt,y as st,z as at,b as D,r as P,e as j,o as rt,A as ot,B as z,C as lt,w as ct,D as W,E as ht}from"./index-BBJQYeyQ.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",L="--_number-flow-d-width",S="--_number-flow-dx",V="--_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:L,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:V,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)`,M="var(--number-flow-mask-width, 0.5em)",y=`calc(${M} / 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(${L}) / var(--width));transform:translateX(var(${S})) scaleX(var(--scale-x));margin:0 calc(-1 * ${M});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} ${M};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(${V})}.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),T=new WeakMap,jt={onUpdate(s,t,e){if(T.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));T.set(e,vt(r?.pos,a?.pos))},getDelta(s,t,e){const i=s-t,n=T.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(A=>({type:h,value:parseInt(A)})))):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(A=>({type:h,value:parseInt(A),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"],[L]:[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 R{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 R{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({[V]:[-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 R(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 R(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",K="--_number-flow-d-width",N="--_number-flow-dx",Q="--_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:K,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Q,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(${K}) / 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(${Q})}.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}`,At=s=>[St,Et(s),Ct],tt=Symbol(),Rt=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 W(),(a=r.value)==null||a.didUpdate())}),await W(),e=!1)}),ht(()=>{t.delete(i)})}),(i,n)=>et(i.$slots,"default")}}),Tt=["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,Tt))}}),Bt=At("-vue");_t("number-flow-vue",u);function Lt({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(!z(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&&(!z(s)||!e.value))}export{u as NumberFlowElement,Rt as NumberFlowGroup,jt as continuous,Nt as default,Bt as styles,Lt as useCanAnimate};
|
|
1
|
+
import{d as H,v as et,x as it,a as nt,y as st,z as at,b as D,r as P,e as j,o as rt,A as ot,B as z,C as lt,w as ct,D as W,E as ht}from"./index-CfwL2UCH.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",L="--_number-flow-d-width",S="--_number-flow-dx",V="--_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:L,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:V,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)`,M="var(--number-flow-mask-width, 0.5em)",y=`calc(${M} / 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(${L}) / var(--width));transform:translateX(var(${S})) scaleX(var(--scale-x));margin:0 calc(-1 * ${M});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} ${M};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(${V})}.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),T=new WeakMap,jt={onUpdate(s,t,e){if(T.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));T.set(e,vt(r?.pos,a?.pos))},getDelta(s,t,e){const i=s-t,n=T.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(A=>({type:h,value:parseInt(A)})))):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(A=>({type:h,value:parseInt(A),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"],[L]:[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 R{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 R{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({[V]:[-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 R(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 R(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",K="--_number-flow-d-width",N="--_number-flow-dx",Q="--_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:K,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:Q,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(${K}) / 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(${Q})}.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}`,At=s=>[St,Et(s),Ct],tt=Symbol(),Rt=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 W(),(a=r.value)==null||a.didUpdate())}),await W(),e=!1)}),ht(()=>{t.delete(i)})}),(i,n)=>et(i.$slots,"default")}}),Tt=["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,Tt))}}),Bt=At("-vue");_t("number-flow-vue",u);function Lt({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(!z(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&&(!z(s)||!e.value))}export{u as NumberFlowElement,Rt as NumberFlowGroup,jt as continuous,Nt as default,Bt as styles,Lt as useCanAnimate};
|