@shwfed/config 2.7.4 → 2.7.5
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 +25 -5
- package/dist/module.json +1 -1
- package/dist/preview/assets/{badge-BKq7Eh7r.js → badge-DamXUB_x.js} +1 -1
- package/dist/preview/assets/{config-DM58--pQ.js → config-CXgHZFVu.js} +1 -1
- package/dist/preview/assets/{config-DpTBe8_L.js → config-CYixJlBY.js} +1 -1
- package/dist/preview/assets/{config-CXomiRuI.js → config-CtPQb6dK.js} +1 -1
- package/dist/preview/assets/{config-C2XmKu42.js → config-DBviu6U0.js} +1 -1
- package/dist/preview/assets/{config-C31gRv6X.js → config-Dtj6xvFB.js} +1 -1
- package/dist/preview/assets/{config-De_RAxft.js → config-DyKtOYYU.js} +1 -1
- package/dist/preview/assets/{config-Dg3cJb4i.js → config-ISM4vT-S.js} +1 -1
- package/dist/preview/assets/{config-DD3McP6M.js → config-ulTPyAGw.js} +1 -1
- package/dist/preview/assets/{config-CnsvNcA2.js → config-v7KXfP3A.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-D-K8Bmbj.js → definition.vue_vue_type_script_setup_true_lang-C-3KP_in.js} +1 -1
- package/dist/preview/assets/index-CqWUukUH.css +1 -0
- package/dist/preview/assets/{index-CfwL2UCH.js → index-CzxZSeNm.js} +182 -182
- package/dist/preview/assets/{index-4Jigs5K_.js → index-D6fhWrrp.js} +1 -1
- package/dist/preview/assets/index-DUSkLHHf.js +1 -0
- package/dist/preview/assets/{item-DnUV5B-b.js → item-BAj_4_7-.js} +1 -1
- package/dist/preview/assets/{runtime-DnlIppMg.js → runtime-B7NcvR9y.js} +1 -1
- package/dist/preview/assets/{runtime-BCxzICuW.js → runtime-BqlrYWt_.js} +1 -1
- package/dist/preview/assets/{runtime-Dhi2Tk84.js → runtime-CiWg_Jub.js} +1 -1
- package/dist/preview/assets/{runtime-BqhvXsJ-.js → runtime-CpMT9U1z.js} +1 -1
- package/dist/preview/assets/{runtime-DAfJmoV1.js → runtime-CswN1gKf.js} +1 -1
- package/dist/preview/assets/{runtime-CG4uOgGu.js → runtime-DOK5OTJn.js} +1 -1
- package/dist/preview/assets/{runtime-W5CcSnyo.js → runtime-DldmFxn1.js} +1 -1
- package/dist/preview/assets/{runtime-ChaoQZI9.js → runtime-WZBVKYom.js} +1 -1
- package/dist/preview/assets/{runtime-Dj43RjZC.js → runtime-jVzpCkuu.js} +1 -1
- package/dist/preview/index.html +2 -2
- package/dist/runtime/components/block-layout-editor/index.d.vue.ts +19 -1
- package/dist/runtime/components/block-layout-editor/index.vue +131 -38
- package/dist/runtime/components/block-layout-editor/index.vue.d.ts +19 -1
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/config.d.vue.ts +4 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/config.vue.d.ts +4 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/runtime.d.vue.ts +4 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/runtime.vue.d.ts +4 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/schema.d.ts +4 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +4 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +4 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +4 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +4 -0
- package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +6 -0
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/runtime.vue +46 -26
- package/dist/runtime/components/config/blocks/2026-06-02/com.shwfed.block.card/schema.js +1 -1
- package/dist/runtime/components/form/config.vue +49 -1
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.actions/schema.js +4 -1
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.js +4 -1
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-18/com.shwfed.form.field.table/schema.js +4 -1
- package/dist/runtime/components/form/fields/2026-05-20/com.shwfed.form.field.collapsible/schema.d.ts +1 -0
- package/dist/runtime/components/form/fields/2026-05-20/com.shwfed.form.field.collapsible/schema.js +4 -1
- package/dist/runtime/components/form/index.d.vue.ts +1 -0
- package/dist/runtime/components/form/index.vue +8 -0
- package/dist/runtime/components/form/index.vue.d.ts +1 -0
- package/dist/runtime/components/form/schema.d.ts +25 -0
- package/dist/runtime/components/form/schema.js +17 -0
- package/dist/runtime/components/form/unit-config.vue +32 -4
- package/dist/runtime/components/form/utils/history.d.ts +8 -0
- package/dist/runtime/components/form/utils/history.js +8 -0
- package/dist/runtime/components/form/utils/resolve.d.ts +9 -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 +26 -26
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/config.vue.d.ts +26 -26
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.d.vue.ts +26 -26
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/config.vue.d.ts +26 -26
- package/dist/runtime/components/table/schema.d.ts +8 -0
- package/dist/runtime/components/ui/command/CommandItem.d.vue.ts +2 -2
- package/dist/runtime/components/ui/command/CommandItem.vue +1 -0
- package/dist/runtime/components/ui/command/CommandItem.vue.d.ts +2 -2
- package/dist/runtime/components/ui/context-menu/ContextMenuContent.d.vue.ts +0 -1
- package/dist/runtime/components/ui/context-menu/ContextMenuContent.vue +3 -4
- package/dist/runtime/components/ui/context-menu/ContextMenuContent.vue.d.ts +0 -1
- package/dist/runtime/components/ui/expression-editor/CodeMirrorInput.vue +17 -2
- package/dist/runtime/components/ui/input-group/InputGroupCombobox.d.vue.ts +2 -8
- package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue +6 -5
- package/dist/runtime/components/ui/input-group/InputGroupCombobox.vue.d.ts +2 -8
- package/dist/runtime/components/ui/popover/PopoverContent.d.vue.ts +0 -1
- package/dist/runtime/components/ui/popover/PopoverContent.vue +3 -4
- package/dist/runtime/components/ui/popover/PopoverContent.vue.d.ts +0 -1
- package/dist/runtime/components/ui/tooltip/TooltipContent.d.vue.ts +0 -1
- package/dist/runtime/components/ui/tooltip/TooltipContent.vue +3 -4
- package/dist/runtime/components/ui/tooltip/TooltipContent.vue.d.ts +0 -1
- package/package.json +1 -1
- package/dist/preview/assets/index-DNHGrCDe.css +0 -1
- package/dist/preview/assets/index-DUo1pTg2.js +0 -1
|
@@ -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-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};
|
|
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-CzxZSeNm.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b1 as e}from"./index-CzxZSeNm.js";import{b2 as f,b3 as r,b4 as s}from"./index-CzxZSeNm.js";export{f as TableConfig,r as createTableConfig,e as default,s as getColumnTechnicalKey};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as M,u as O,o as E,w as y,a as T,c as V,n as z,b as A,r as x,e as i,g as L,f as s,s as g,h as P,i as U,p as W,l as D,j as G,k as H,m as b,q as J,t as j}from"./index-
|
|
1
|
+
import{d as M,u as O,o as E,w as y,a as T,c as V,n as z,b as A,r as x,e as i,g as L,f as s,s as g,h as P,i as U,p as W,l as D,j as G,k as H,m as b,q as J,t as j}from"./index-CzxZSeNm.js";import K from"./index-D6fhWrrp.js";const X=M({name:"ShwfedBlockAnimatedNumberItem",__name:"item",props:{item:{}},setup(h){const n=h,S=J(),a=x(void 0),m=x(0);function u(){return H(S)}function w(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){const t=Number(e);return Number.isFinite(t)?t:0}return 0}const d=i(()=>a.value===void 0?b():g(a.value));function v(e){if(!e)return"";try{const t=j(s(e,{...u(),json:d.value}));return t==null?"":String(t)}catch{return""}}const _=i(()=>v(n.item.prefix)),C=i(()=>v(n.item.suffix));function F(e){if(e)try{const t=j(s(e,{...u(),json:d.value}));return t==null?void 0:typeof t=="string"||typeof t=="object"?t:String(t)}catch{return}}const I=i(()=>F(n.item.style));async function o(){const e=n.item.dataSource,t=u(),k=L(function*(){let r=b();if(e.request){const B=yield*s(e.request,t);r=g(yield*B.json())}const q=yield*s(e.value,{...t,json:r});return{json:P(r),value:q}});try{const r=await U(W(k,D));a.value=r.json,m.value=w(r.value)}catch(r){console.warn("[shwfed-animated-number] fetch failed",r)}}const l=i(()=>(n.item.pollingInterval??0)>0),N=i(()=>Math.max(1,n.item.pollingInterval??1)*1e3),c=G(),{pause:p,resume:f}=O(()=>{o()},N,{immediate:!1});return E(()=>{o(),l.value&&c.value&&f()}),y(c,e=>{l.value&&(e?(o(),f()):p())}),y(()=>[n.item.dataSource.request??"",n.item.dataSource.value,n.item.pollingInterval??0].join("|"),()=>{o(),l.value&&c.value?f():p()}),(e,t)=>(T(),V(A(K),{value:m.value,prefix:_.value,suffix:C.value,style:z(I.value)},null,8,["value","prefix","suffix","style"]))}});export{X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as c}from"./definition.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{_ as c}from"./definition.vue_vue_type_script_setup_true_lang-C-3KP_in.js";import{d as s,aJ as o,aU as i,c as r,b as f,aI as u,a as m}from"./index-CzxZSeNm.js";const g=s({name:"ShwfedEventDispatchActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const n=e,t=u(),a=o(()=>i(t,n.config.triggers));return(p,d)=>(m(),r(c,{"action-id":e.buttonId,effect:f(a)},null,8,["action-id","effect"]))}});export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as _,aJ as E,g as S,aN as r,aU as m,aV as b,aW as j,c as k,b as v,f as x,k as B,aI as L,q as C,a as R}from"./index-
|
|
1
|
+
import{d as _,aJ as E,g as S,aN as r,aU as m,aV as b,aW as j,c as k,b as v,f as x,k as B,aI as L,q as C,a as R}from"./index-CzxZSeNm.js";import{_ as U}from"./definition.vue_vue_type_script_setup_true_lang-C-3KP_in.js";const O=_({name:"ShwfedHttpDownloadActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(d){const c=d,g=C(),t=(e,n)=>x(e,{...B(g),...n}),l=L(),p=new Set(["success","error","warning","info"]);function f(e){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=e.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}const y=E(()=>S(function*(){const{template:e,messageExpression:n,resultExpression:o}=c.config,u=yield*t(e.request);if(!e.download){const s=yield*u.file();return yield*r(()=>f(s)),yield*m(l,c.config.onSuccess)}const a={json:yield*u.json()},i=o===void 0?"success":yield*b(t(o,a),s=>p.has(s)?s:"success");if(n!==void 0){const s=yield*t(n,a);yield*r(()=>j[i](s))}if(i==="success"||i==="info"){const h=yield*(yield*t(e.download,a)).file();yield*r(()=>f(h))}const w={success:c.config.onSuccess,warning:c.config.onWarning,error:c.config.onError,info:c.config.onInfo};return yield*m(l,w[i])}));return(e,n)=>(R(),k(U,{"action-id":d.buttonId,effect:v(y)},null,8,["action-id","effect"]))}});export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as u,aJ as p,aD as g,aK as a,aL as m,aG as d,c as l,b as x,f as E,k as _,aH as h,q as C,aI as I,a as b}from"./index-
|
|
1
|
+
import{d as u,aJ as p,aD as g,aK as a,aL as m,aG as d,c as l,b as x,f as E,k as _,aH as h,q as C,aI as I,a as b}from"./index-CzxZSeNm.js";import{_ as k}from"./definition.vue_vue_type_script_setup_true_lang-C-3KP_in.js";const B=u({name:"ShwfedHttpRequestActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(t){const e=t,c=C(),i=(n,s)=>E(n,{..._(c),...s}),r=I(),o=h(),f=p(()=>{const n=o?g(()=>o()):a(!0);return m(n,s=>s?d(e.config.expression,i,{messageExpression:e.config.messageExpression,resultExpression:e.config.resultExpression,channel:r,triggers:{success:e.config.onSuccess,warning:e.config.onWarning,error:e.config.onError,info:e.config.onInfo}}):a(void 0))});return(n,s)=>(b(),l(k,{"action-id":t.buttonId,effect:x(f)},null,8,["action-id","effect"]))}});export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as u,F as i,c as l,b as p,e as m,a as d,I as f,L as _,aE as k,f as w,k as x,q as g}from"./index-
|
|
1
|
+
import{d as u,F as i,c as l,b as p,e as m,a as d,I as f,L as _,aE as k,f as w,k as x,q as g}from"./index-CzxZSeNm.js";const B=u({name:"ShwfedMarkdownItemRuntime",__name:"runtime",props:{config:{}},setup(s){const o=s,{locale:t}=i(),a=g(),c=(e,n)=>w(e,{...x(a),...n}),r=m(()=>{const e=_(o.config.content,t.value)??"";return k(e,c)});return(e,n)=>(d(),l(p(f),{"data-slot":"buttons-markdown",source:r.value,class:"prose prose-sm prose-zinc px-1"},null,8,["source"]))}});export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as i,aJ as f,aL as r,aN as d,c as m,b as u,f as p,k as l,q as _,a as g}from"./index-
|
|
1
|
+
import{d as i,aJ as f,aL as r,aN as d,c as m,b as u,f as p,k as l,q as _,a as g}from"./index-CzxZSeNm.js";import{_ as b}from"./definition.vue_vue_type_script_setup_true_lang-C-3KP_in.js";const w=i({name:"ShwfedNavigationActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=e,o=_(),c=(n,a)=>p(n,{...l(o),...a}),s=f(()=>r(c(t.config.url),n=>d(()=>{window.open(n,t.config.mode)})));return(n,a)=>(g(),m(b,{"action-id":e.buttonId,effect:u(s)},null,8,["action-id","effect"]))}});export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as s,F as x,aO as T,g as p,L as c,aP as M,t as N,c as b,G as d,b as u,r as L,x as S,aI as k,aN as I,a as w,R as F,n as H,H as r,aQ as R,aR as A,aw as V,q as $,aS as f,C as m,aT as j}from"./index-
|
|
1
|
+
import{d as s,F as x,aO as T,g as p,L as c,aP as M,t as N,c as b,G as d,b as u,r as L,x as S,aI as k,aN as I,a as w,R as F,n as H,H as r,aQ as R,aR as A,aw as V,q as $,aS as f,C as m,aT as j}from"./index-CzxZSeNm.js";import{_ as z}from"./definition.vue_vue_type_script_setup_true_lang-C-3KP_in.js";const Y=s({name:"ShwfedModalLayoutActionRuntime",__name:"runtime",props:{buttonId:{},config:{},buttonTitle:{}},setup(n){const a=n,{locale:l}=x(),v=e=>{},g=$(),i=S(f,void 0),h=k(),o=L(null),C=T(a.buttonId,{close:()=>I(()=>{o.value?.()})},h),E=s({name:"ModalBoundaryBridge",setup(e,{slots:t}){return A(g),m(j,C),i&&m(f,i),()=>t.default?.()}}),_=(e,t)=>V()?.(e,t),y=p(function*(){const e=c(a.config.modalTitle,l.value)??c(a.buttonTitle,l.value)??"",{modal:t,close:B}=yield*M({title:e,width:a.config.modalWidth});o.value=()=>N(B()),yield*t,o.value=null});return(e,t)=>(w(),b(z,{"action-id":n.buttonId,effect:u(y)},{default:d(()=>[F("div",{style:H(n.config.modalMinHeight?`min-height: ${n.config.modalMinHeight}`:void 0)},[r(u(E),null,{default:d(()=>[r(R,{"slot-value":n.config.slot,configure:v,"find-entry":_},null,8,["slot-value"])]),_:1})],4)]),_:1},8,["action-id","effect"]))}});export{Y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as l,F as u,g,aD as d,L as m,aE as p,aF as x,aG as E,c as k,b as _,f as h,k as w,aH as C,q as I,aI as F,a as b}from"./index-
|
|
1
|
+
import{d as l,F as u,g,aD as d,L as m,aE as p,aF as x,aG as E,c as k,b as _,f as h,k as w,aH as C,q as I,aI as F,a as b}from"./index-CzxZSeNm.js";import{_ as q}from"./definition.vue_vue_type_script_setup_true_lang-C-3KP_in.js";const H=l({name:"ShwfedHttpRequestConfirmActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(s){const n=s,{locale:i}=u(),a=I(),t=(e,o)=>h(e,{...w(a),...o}),r=F(),c=C(),f=g(function*(){if(c&&!(yield*d(()=>c())))return;const e=m(n.config.markdown,i.value)??"",o=p(e,t);(yield*x({content:o,icon:n.config.icon,color:n.config.color}))||(yield*E(n.config.expression,t,{messageExpression:n.config.messageExpression,resultExpression:n.config.resultExpression,channel:r,triggers:{success:n.config.onSuccess,warning:n.config.onWarning,error:n.config.onError,info:n.config.onInfo}}))});return(e,o)=>(b(),k(q,{"action-id":s.buttonId,effect:_(f)},null,8,["action-id","effect"]))}});export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as l,aX as g,aJ as A,aL as y,aU as _,c as b,b as h,f as S,k,aI as j,aY as C,a as B,q as I}from"./index-
|
|
1
|
+
import{d as l,aX as g,aJ as A,aL as y,aU as _,c as b,b as h,f as S,k,aI as j,aY as C,a as B,q as I}from"./index-CzxZSeNm.js";import{_ as O}from"./definition.vue_vue_type_script_setup_true_lang-C-3KP_in.js";const F=l({name:"ShwfedStateWriteActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(r){const s=r,i=I(),f=(e,t)=>S(e,{...k(i),...t}),n=g(),c=n.kind==="form"&&n.parent?n.parent:n,u=j(),m=C((e,t,a)=>{if(Array.isArray(e[t])&&Array.isArray(a))return e[t]=a,!0});function o(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e,t){return o(e)&&o(t)?m({...t},e):t}const d=A(()=>y(f(s.config.expression),e=>{for(const t of Object.keys(e)){const a=p(c.getAt(t),e[t]);c.setAt(t,a)}return _(u,s.config.onSuccess)}));return(e,t)=>(B(),b(O,{"action-id":r.buttonId,effect:h(d)},null,8,["action-id","effect"]))}});export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as n}from"./definition.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{_ as n}from"./definition.vue_vue_type_script_setup_true_lang-C-3KP_in.js";import{d as o,c as a,b as c,a as f,aM as i}from"./index-CzxZSeNm.js";const _=o({name:"ShwfedPrototypeActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(t){const e=i;return(r,s)=>(f(),a(n,{"action-id":t.buttonId,effect:c(e)},null,8,["action-id","effect"]))}});export{_ as default};
|
package/dist/preview/index.html
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
`--primary`, the primary button variant renders as transparent. */
|
|
11
11
|
body { --primary: #009689; }
|
|
12
12
|
</style>
|
|
13
|
-
<script type="module" crossorigin src="./assets/index-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
13
|
+
<script type="module" crossorigin src="./assets/index-CzxZSeNm.js"></script>
|
|
14
|
+
<link rel="stylesheet" crossorigin href="./assets/index-CqWUukUH.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="app"></div>
|
|
@@ -20,6 +20,13 @@ declare const __VLS_export: <TItem extends {
|
|
|
20
20
|
min: number;
|
|
21
21
|
max: number;
|
|
22
22
|
}>;
|
|
23
|
+
/**
|
|
24
|
+
* When `false`, this item opts out of the fullscreen inline-config pane —
|
|
25
|
+
* a drill request falls back to emitting `drill-down` (which exits
|
|
26
|
+
* fullscreen). Absent / `true` → inline editing is offered while the host
|
|
27
|
+
* provides the `inline-config` slot. See the "Inline config" section below.
|
|
28
|
+
*/
|
|
29
|
+
inlineConfig?: boolean;
|
|
23
30
|
}>;
|
|
24
31
|
}> | undefined;
|
|
25
32
|
getItemLabel?: (item: TItem) => string;
|
|
@@ -70,7 +77,18 @@ declare const __VLS_export: <TItem extends {
|
|
|
70
77
|
} ? P : {});
|
|
71
78
|
expose: (exposed: {}) => void;
|
|
72
79
|
attrs: any;
|
|
73
|
-
slots: {
|
|
80
|
+
slots: {
|
|
81
|
+
/**
|
|
82
|
+
* Body of the right-docked config pane shown when a field is opened inline
|
|
83
|
+
* in fullscreen. Rendered inside the fullscreen element so editing doesn't
|
|
84
|
+
* unmount the canvas. Receives the item being edited and a `close` hook.
|
|
85
|
+
*/
|
|
86
|
+
'inline-config'(props: {
|
|
87
|
+
itemId: string;
|
|
88
|
+
item: TItem;
|
|
89
|
+
close: () => void;
|
|
90
|
+
}): unknown;
|
|
91
|
+
};
|
|
74
92
|
emit: (((evt: "paste", target: {
|
|
75
93
|
x: number;
|
|
76
94
|
y: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Icon } from "@iconify/vue";
|
|
3
3
|
import { useEventListener } from "@vueuse/core";
|
|
4
|
-
import { computed, onMounted, ref, watch } from "vue";
|
|
4
|
+
import { computed, nextTick, onMounted, ref, watch } from "vue";
|
|
5
5
|
import { Button } from "../ui/button";
|
|
6
6
|
import { CommandGroup, CommandItem } from "../ui/command";
|
|
7
7
|
import {
|
|
@@ -24,6 +24,7 @@ import { Field, FieldLabel } from "../ui/field";
|
|
|
24
24
|
import useInfinitePlane from "../../composables/useInfinitePlane";
|
|
25
25
|
import { DEFAULT_GAP, findFreePlacement } from "../../share/layout";
|
|
26
26
|
defineOptions({ name: "ShwfedBlockLayoutEditor" });
|
|
27
|
+
const slots = defineSlots();
|
|
27
28
|
const layouts = defineModel({ type: Array, ...{ required: true } });
|
|
28
29
|
const activeIndex = defineModel("activeIndex", { type: Number, ...{ default: 0 } });
|
|
29
30
|
const selectedItemIds = defineModel("selectedItemIds", { type: Array, ...{ default: () => [] } });
|
|
@@ -66,12 +67,21 @@ function captureAddModifiers(e) {
|
|
|
66
67
|
pendingAddSilent = e.metaKey || e.ctrlKey;
|
|
67
68
|
}
|
|
68
69
|
function emitAddNew(entry) {
|
|
69
|
-
const silent = pendingAddSilent;
|
|
70
|
+
const silent = pendingAddSilent || isFullscreen.value;
|
|
70
71
|
pendingAddSilent = false;
|
|
72
|
+
const before = isFullscreen.value ? new Set(props.items.map((it) => it.id)) : null;
|
|
71
73
|
emit("add-new", entry, { silent });
|
|
74
|
+
if (before) {
|
|
75
|
+
nextTick(() => {
|
|
76
|
+
const added = props.items.find((it) => !before.has(it.id));
|
|
77
|
+
if (added) setSelection([added.id]);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
72
80
|
}
|
|
73
81
|
const itemNoun = computed(() => props.itemNoun ?? "\u5757");
|
|
74
82
|
const CANVAS_STEP_PX = 24;
|
|
83
|
+
const INLINE_PANE_MIN_PX = 480;
|
|
84
|
+
const inlinePaneWidth = ref(720);
|
|
75
85
|
const activeLayout = computed(() => layouts.value[activeIndex.value]);
|
|
76
86
|
const editorGaps = ref(/* @__PURE__ */ new Map());
|
|
77
87
|
function getGap(i) {
|
|
@@ -185,8 +195,9 @@ function recenter() {
|
|
|
185
195
|
const frame = activeFrame.value;
|
|
186
196
|
const frameW = frame.cols * stepPx.value;
|
|
187
197
|
const frameH = frame.rows * stepPx.value;
|
|
198
|
+
const rightInset = inlineItem.value ? inlinePaneWidth.value : 0;
|
|
188
199
|
coordinate.value = {
|
|
189
|
-
x: Math.round((rect.width - frameW) / 2),
|
|
200
|
+
x: Math.round((rect.width - rightInset - frameW) / 2),
|
|
190
201
|
y: Math.round((rect.height - frameH) / 2)
|
|
191
202
|
};
|
|
192
203
|
}
|
|
@@ -782,26 +793,63 @@ const showPickerNewGroup = computed(
|
|
|
782
793
|
);
|
|
783
794
|
const canvasRef = ref(null);
|
|
784
795
|
const isFullscreen = ref(false);
|
|
785
|
-
|
|
786
|
-
isFullscreen.value =
|
|
796
|
+
function toggleFullscreen() {
|
|
797
|
+
isFullscreen.value = !isFullscreen.value;
|
|
787
798
|
recenterSoon();
|
|
799
|
+
}
|
|
800
|
+
function supportsInlineConfig(itemId) {
|
|
801
|
+
const it = getItem(itemId);
|
|
802
|
+
if (!it) return false;
|
|
803
|
+
const entry = props.findEntry(it.type, it.compatibilityDate);
|
|
804
|
+
return entry?.metadata.inlineConfig !== false;
|
|
805
|
+
}
|
|
806
|
+
const inlineItemId = computed(() => {
|
|
807
|
+
if (!isFullscreen.value || !slots["inline-config"]) return null;
|
|
808
|
+
if (selectedItemIds.value.length !== 1) return null;
|
|
809
|
+
const id = selectedItemIds.value[0];
|
|
810
|
+
if (!getItem(id) || !supportsInlineConfig(id)) return null;
|
|
811
|
+
return id;
|
|
788
812
|
});
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
813
|
+
const inlineItem = computed(
|
|
814
|
+
() => inlineItemId.value ? getItem(inlineItemId.value) ?? null : null
|
|
815
|
+
);
|
|
816
|
+
function requestDrill(itemId) {
|
|
817
|
+
if (isFullscreen.value && !!slots["inline-config"] && supportsInlineConfig(itemId)) {
|
|
818
|
+
setSelection([itemId]);
|
|
819
|
+
return;
|
|
796
820
|
}
|
|
821
|
+
emit("drill-down", itemId);
|
|
822
|
+
}
|
|
823
|
+
function closeInline() {
|
|
824
|
+
setSelection([]);
|
|
825
|
+
}
|
|
826
|
+
watch(() => inlineItemId.value !== null, () => recenterSoon());
|
|
827
|
+
let paneResize = null;
|
|
828
|
+
function beginPaneResize(e) {
|
|
829
|
+
if (e.button !== 0) return;
|
|
830
|
+
e.preventDefault();
|
|
831
|
+
e.stopPropagation();
|
|
832
|
+
paneResize = { startX: e.clientX, startW: inlinePaneWidth.value };
|
|
797
833
|
}
|
|
834
|
+
useEventListener("mousemove", (e) => {
|
|
835
|
+
if (!paneResize) return;
|
|
836
|
+
const delta = paneResize.startX - e.clientX;
|
|
837
|
+
const canvasW = canvasRef.value?.clientWidth ?? Infinity;
|
|
838
|
+
const max = Math.max(INLINE_PANE_MIN_PX, canvasW - 320);
|
|
839
|
+
inlinePaneWidth.value = Math.max(INLINE_PANE_MIN_PX, Math.min(max, paneResize.startW + delta));
|
|
840
|
+
});
|
|
841
|
+
useEventListener("mouseup", () => {
|
|
842
|
+
if (!paneResize) return;
|
|
843
|
+
paneResize = null;
|
|
844
|
+
recenterSoon();
|
|
845
|
+
});
|
|
798
846
|
</script>
|
|
799
847
|
|
|
800
848
|
<template>
|
|
801
849
|
<div
|
|
802
850
|
ref="canvasRef"
|
|
803
|
-
class="
|
|
804
|
-
:class="
|
|
851
|
+
class="overflow-hidden border border-zinc-200 bg-zinc-50 select-none"
|
|
852
|
+
:class="isFullscreen ? 'fixed inset-0 z-40 h-screen w-screen' : 'relative h-full rounded'"
|
|
805
853
|
>
|
|
806
854
|
<ContextMenu>
|
|
807
855
|
<ContextMenuTrigger as-child>
|
|
@@ -816,7 +864,6 @@ function toggleFullscreen() {
|
|
|
816
864
|
</ContextMenuTrigger>
|
|
817
865
|
<ContextMenuContent
|
|
818
866
|
class="min-w-auto p-1.5"
|
|
819
|
-
:to="isFullscreen ? canvasRef : null"
|
|
820
867
|
>
|
|
821
868
|
<ContextMenuItem @select="emit('paste', pendingPasteCell)">
|
|
822
869
|
<Icon icon="fluent:clipboard-paste-20-regular" />
|
|
@@ -832,7 +879,8 @@ function toggleFullscreen() {
|
|
|
832
879
|
/>
|
|
833
880
|
|
|
834
881
|
<div
|
|
835
|
-
class="absolute top-3 right-3"
|
|
882
|
+
class="absolute top-3 right-3 z-[70] transition-[right]"
|
|
883
|
+
:style="inlineItem ? { right: `${inlinePaneWidth + 12}px` } : void 0"
|
|
836
884
|
@mousedown.stop
|
|
837
885
|
>
|
|
838
886
|
<Button
|
|
@@ -866,7 +914,7 @@ function toggleFullscreen() {
|
|
|
866
914
|
@mousedown="beginDrag('move', entry.itemId, $event)"
|
|
867
915
|
@click="onItemClick(entry.itemId, $event)"
|
|
868
916
|
@contextmenu="onItemContextMenu(entry.itemId)"
|
|
869
|
-
@dblclick.stop="
|
|
917
|
+
@dblclick.stop="requestDrill(entry.itemId)"
|
|
870
918
|
>
|
|
871
919
|
<div
|
|
872
920
|
class="flex h-full p-1 pointer-events-none"
|
|
@@ -889,7 +937,7 @@ function toggleFullscreen() {
|
|
|
889
937
|
class="drill-button"
|
|
890
938
|
:title="`\u7F16\u8F91${itemNoun}`"
|
|
891
939
|
@mousedown.stop
|
|
892
|
-
@click.stop="
|
|
940
|
+
@click.stop="requestDrill(entry.itemId)"
|
|
893
941
|
>
|
|
894
942
|
<Icon
|
|
895
943
|
icon="fluent:arrow-up-right-20-regular"
|
|
@@ -935,7 +983,6 @@ function toggleFullscreen() {
|
|
|
935
983
|
</ContextMenuTrigger>
|
|
936
984
|
<ContextMenuContent
|
|
937
985
|
class="min-w-auto p-1.5"
|
|
938
|
-
:to="isFullscreen ? canvasRef : null"
|
|
939
986
|
>
|
|
940
987
|
<template v-if="selectedItemIds.length > 1 && isSelected(entry.itemId)">
|
|
941
988
|
<ContextMenuItem @select="emit('copy-items', [...selectedItemIds])">
|
|
@@ -959,7 +1006,7 @@ function toggleFullscreen() {
|
|
|
959
1006
|
<Icon icon="fluent:align-left-20-regular" />
|
|
960
1007
|
</ContextMenuRadioItem>
|
|
961
1008
|
</TooltipTrigger>
|
|
962
|
-
<TooltipContent
|
|
1009
|
+
<TooltipContent>
|
|
963
1010
|
左对齐
|
|
964
1011
|
</TooltipContent>
|
|
965
1012
|
</Tooltip>
|
|
@@ -974,7 +1021,7 @@ function toggleFullscreen() {
|
|
|
974
1021
|
<Icon icon="fluent:align-center-horizontal-20-regular" />
|
|
975
1022
|
</ContextMenuRadioItem>
|
|
976
1023
|
</TooltipTrigger>
|
|
977
|
-
<TooltipContent
|
|
1024
|
+
<TooltipContent>
|
|
978
1025
|
水平居中
|
|
979
1026
|
</TooltipContent>
|
|
980
1027
|
</Tooltip>
|
|
@@ -989,7 +1036,7 @@ function toggleFullscreen() {
|
|
|
989
1036
|
<Icon icon="fluent:align-right-20-regular" />
|
|
990
1037
|
</ContextMenuRadioItem>
|
|
991
1038
|
</TooltipTrigger>
|
|
992
|
-
<TooltipContent
|
|
1039
|
+
<TooltipContent>
|
|
993
1040
|
右对齐
|
|
994
1041
|
</TooltipContent>
|
|
995
1042
|
</Tooltip>
|
|
@@ -1004,7 +1051,7 @@ function toggleFullscreen() {
|
|
|
1004
1051
|
<Icon icon="fluent:arrow-autofit-width-20-regular" />
|
|
1005
1052
|
</ContextMenuRadioItem>
|
|
1006
1053
|
</TooltipTrigger>
|
|
1007
|
-
<TooltipContent
|
|
1054
|
+
<TooltipContent>
|
|
1008
1055
|
水平撑满
|
|
1009
1056
|
</TooltipContent>
|
|
1010
1057
|
</Tooltip>
|
|
@@ -1025,7 +1072,7 @@ function toggleFullscreen() {
|
|
|
1025
1072
|
<Icon icon="fluent:align-top-20-regular" />
|
|
1026
1073
|
</ContextMenuRadioItem>
|
|
1027
1074
|
</TooltipTrigger>
|
|
1028
|
-
<TooltipContent
|
|
1075
|
+
<TooltipContent>
|
|
1029
1076
|
顶部对齐
|
|
1030
1077
|
</TooltipContent>
|
|
1031
1078
|
</Tooltip>
|
|
@@ -1040,7 +1087,7 @@ function toggleFullscreen() {
|
|
|
1040
1087
|
<Icon icon="fluent:align-center-vertical-20-regular" />
|
|
1041
1088
|
</ContextMenuRadioItem>
|
|
1042
1089
|
</TooltipTrigger>
|
|
1043
|
-
<TooltipContent
|
|
1090
|
+
<TooltipContent>
|
|
1044
1091
|
垂直居中
|
|
1045
1092
|
</TooltipContent>
|
|
1046
1093
|
</Tooltip>
|
|
@@ -1055,7 +1102,7 @@ function toggleFullscreen() {
|
|
|
1055
1102
|
<Icon icon="fluent:align-bottom-20-regular" />
|
|
1056
1103
|
</ContextMenuRadioItem>
|
|
1057
1104
|
</TooltipTrigger>
|
|
1058
|
-
<TooltipContent
|
|
1105
|
+
<TooltipContent>
|
|
1059
1106
|
底部对齐
|
|
1060
1107
|
</TooltipContent>
|
|
1061
1108
|
</Tooltip>
|
|
@@ -1070,7 +1117,7 @@ function toggleFullscreen() {
|
|
|
1070
1117
|
<Icon icon="fluent:arrow-autofit-height-20-regular" />
|
|
1071
1118
|
</ContextMenuRadioItem>
|
|
1072
1119
|
</TooltipTrigger>
|
|
1073
|
-
<TooltipContent
|
|
1120
|
+
<TooltipContent>
|
|
1074
1121
|
垂直撑满
|
|
1075
1122
|
</TooltipContent>
|
|
1076
1123
|
</Tooltip>
|
|
@@ -1111,7 +1158,7 @@ function toggleFullscreen() {
|
|
|
1111
1158
|
<Icon icon="fluent:align-left-20-regular" />
|
|
1112
1159
|
</ContextMenuRadioItem>
|
|
1113
1160
|
</TooltipTrigger>
|
|
1114
|
-
<TooltipContent
|
|
1161
|
+
<TooltipContent>
|
|
1115
1162
|
左对齐
|
|
1116
1163
|
</TooltipContent>
|
|
1117
1164
|
</Tooltip>
|
|
@@ -1126,7 +1173,7 @@ function toggleFullscreen() {
|
|
|
1126
1173
|
<Icon icon="fluent:align-center-horizontal-20-regular" />
|
|
1127
1174
|
</ContextMenuRadioItem>
|
|
1128
1175
|
</TooltipTrigger>
|
|
1129
|
-
<TooltipContent
|
|
1176
|
+
<TooltipContent>
|
|
1130
1177
|
水平居中
|
|
1131
1178
|
</TooltipContent>
|
|
1132
1179
|
</Tooltip>
|
|
@@ -1141,7 +1188,7 @@ function toggleFullscreen() {
|
|
|
1141
1188
|
<Icon icon="fluent:align-right-20-regular" />
|
|
1142
1189
|
</ContextMenuRadioItem>
|
|
1143
1190
|
</TooltipTrigger>
|
|
1144
|
-
<TooltipContent
|
|
1191
|
+
<TooltipContent>
|
|
1145
1192
|
右对齐
|
|
1146
1193
|
</TooltipContent>
|
|
1147
1194
|
</Tooltip>
|
|
@@ -1156,7 +1203,7 @@ function toggleFullscreen() {
|
|
|
1156
1203
|
<Icon icon="fluent:arrow-autofit-width-20-regular" />
|
|
1157
1204
|
</ContextMenuRadioItem>
|
|
1158
1205
|
</TooltipTrigger>
|
|
1159
|
-
<TooltipContent
|
|
1206
|
+
<TooltipContent>
|
|
1160
1207
|
水平撑满
|
|
1161
1208
|
</TooltipContent>
|
|
1162
1209
|
</Tooltip>
|
|
@@ -1177,7 +1224,7 @@ function toggleFullscreen() {
|
|
|
1177
1224
|
<Icon icon="fluent:align-top-20-regular" />
|
|
1178
1225
|
</ContextMenuRadioItem>
|
|
1179
1226
|
</TooltipTrigger>
|
|
1180
|
-
<TooltipContent
|
|
1227
|
+
<TooltipContent>
|
|
1181
1228
|
顶部对齐
|
|
1182
1229
|
</TooltipContent>
|
|
1183
1230
|
</Tooltip>
|
|
@@ -1192,7 +1239,7 @@ function toggleFullscreen() {
|
|
|
1192
1239
|
<Icon icon="fluent:align-center-vertical-20-regular" />
|
|
1193
1240
|
</ContextMenuRadioItem>
|
|
1194
1241
|
</TooltipTrigger>
|
|
1195
|
-
<TooltipContent
|
|
1242
|
+
<TooltipContent>
|
|
1196
1243
|
垂直居中
|
|
1197
1244
|
</TooltipContent>
|
|
1198
1245
|
</Tooltip>
|
|
@@ -1207,7 +1254,7 @@ function toggleFullscreen() {
|
|
|
1207
1254
|
<Icon icon="fluent:align-bottom-20-regular" />
|
|
1208
1255
|
</ContextMenuRadioItem>
|
|
1209
1256
|
</TooltipTrigger>
|
|
1210
|
-
<TooltipContent
|
|
1257
|
+
<TooltipContent>
|
|
1211
1258
|
底部对齐
|
|
1212
1259
|
</TooltipContent>
|
|
1213
1260
|
</Tooltip>
|
|
@@ -1222,7 +1269,7 @@ function toggleFullscreen() {
|
|
|
1222
1269
|
<Icon icon="fluent:arrow-autofit-height-20-regular" />
|
|
1223
1270
|
</ContextMenuRadioItem>
|
|
1224
1271
|
</TooltipTrigger>
|
|
1225
|
-
<TooltipContent
|
|
1272
|
+
<TooltipContent>
|
|
1226
1273
|
垂直撑满
|
|
1227
1274
|
</TooltipContent>
|
|
1228
1275
|
</Tooltip>
|
|
@@ -1286,7 +1333,8 @@ function toggleFullscreen() {
|
|
|
1286
1333
|
|
|
1287
1334
|
<div
|
|
1288
1335
|
v-if="activeLayout && (showPickerNewGroup || unplacedItems.length > 0)"
|
|
1289
|
-
class="absolute bottom-3 right-3 w-60 rounded-md bg-white/95 backdrop-blur"
|
|
1336
|
+
class="absolute bottom-3 right-3 w-60 rounded-md bg-white/95 backdrop-blur transition-[right]"
|
|
1337
|
+
:style="inlineItem ? { right: `${inlinePaneWidth + 12}px` } : void 0"
|
|
1290
1338
|
@mousedown.stop
|
|
1291
1339
|
@click.capture="captureAddModifiers"
|
|
1292
1340
|
@keydown.capture="captureAddModifiers"
|
|
@@ -1297,7 +1345,6 @@ function toggleFullscreen() {
|
|
|
1297
1345
|
</InputGroupAddon>
|
|
1298
1346
|
<InputGroupCombobox
|
|
1299
1347
|
:placeholder="`\u6DFB\u52A0${itemNoun}`"
|
|
1300
|
-
:to="isFullscreen ? canvasRef : null"
|
|
1301
1348
|
>
|
|
1302
1349
|
<CommandGroup
|
|
1303
1350
|
v-if="unplacedItems.length > 0"
|
|
@@ -1340,9 +1387,55 @@ function toggleFullscreen() {
|
|
|
1340
1387
|
</InputGroupCombobox>
|
|
1341
1388
|
</InputGroup>
|
|
1342
1389
|
</div>
|
|
1390
|
+
|
|
1391
|
+
<!-- Inline config pane — docked to the right edge inside the fullscreen
|
|
1392
|
+
element so opening it doesn't unmount the canvas (which would exit
|
|
1393
|
+
fullscreen). The host supplies the body via the inline-config slot. -->
|
|
1394
|
+
<div
|
|
1395
|
+
v-if="inlineItem"
|
|
1396
|
+
class="inline-config-pane"
|
|
1397
|
+
:style="{ width: `${inlinePaneWidth}px` }"
|
|
1398
|
+
@mousedown.stop
|
|
1399
|
+
@dblclick.stop
|
|
1400
|
+
@contextmenu.stop
|
|
1401
|
+
>
|
|
1402
|
+
<div
|
|
1403
|
+
class="inline-config-resizer"
|
|
1404
|
+
title="拖动调整宽度"
|
|
1405
|
+
@mousedown="beginPaneResize"
|
|
1406
|
+
/>
|
|
1407
|
+
<div class="inline-config-header">
|
|
1408
|
+
<Icon
|
|
1409
|
+
:icon="getItemIcon(inlineItemId)"
|
|
1410
|
+
class="size-4 shrink-0 text-zinc-400"
|
|
1411
|
+
/>
|
|
1412
|
+
<span class="flex-1 truncate text-sm font-medium text-zinc-700">
|
|
1413
|
+
{{ resolveItemLabel(inlineItemId) }}
|
|
1414
|
+
</span>
|
|
1415
|
+
<button
|
|
1416
|
+
type="button"
|
|
1417
|
+
class="inline-config-close"
|
|
1418
|
+
title="关闭"
|
|
1419
|
+
@click="closeInline"
|
|
1420
|
+
>
|
|
1421
|
+
<Icon
|
|
1422
|
+
icon="fluent:dismiss-20-regular"
|
|
1423
|
+
class="size-4"
|
|
1424
|
+
/>
|
|
1425
|
+
</button>
|
|
1426
|
+
</div>
|
|
1427
|
+
<div class="inline-config-body">
|
|
1428
|
+
<slot
|
|
1429
|
+
name="inline-config"
|
|
1430
|
+
:item-id="inlineItemId"
|
|
1431
|
+
:item="inlineItem"
|
|
1432
|
+
:close="closeInline"
|
|
1433
|
+
/>
|
|
1434
|
+
</div>
|
|
1435
|
+
</div>
|
|
1343
1436
|
</div>
|
|
1344
1437
|
</template>
|
|
1345
1438
|
|
|
1346
1439
|
<style scoped>
|
|
1347
|
-
.field-block{border:1px solid #e4e4e7;cursor:move;position:absolute}.field-block.is-selected{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary)}.frame-outline{border:1px dashed hsla(240,5%,84%,.7)}.resize-handle{background:transparent;position:absolute}.handle-n{top:-3px}.handle-n,.handle-s{cursor:ns-resize;height:6px;left:12px;right:12px}.handle-s{bottom:-3px}.handle-e{right:-3px}.handle-e,.handle-w{bottom:12px;cursor:ew-resize;top:12px;width:6px}.handle-w{left:-3px}.handle-nw{cursor:nwse-resize;left:-3px}.handle-ne,.handle-nw{height:10px;top:-3px;width:10px}.handle-ne{cursor:nesw-resize;right:-3px}.handle-sw{cursor:nesw-resize;left:-3px}.handle-se,.handle-sw{bottom:-3px;height:10px;width:10px}.handle-se{cursor:nwse-resize;right:-3px}.drill-button{align-items:center;background:transparent;border-radius:4px;color:#71717a;cursor:pointer;display:inline-flex;height:22px;justify-content:center;opacity:0;position:absolute;right:4px;top:4px;transition:opacity .12s ease,background-color .12s ease,color .12s ease;width:22px;z-index:5}.drill-button:focus-visible,.field-block:hover .drill-button{opacity:1}.drill-button:hover{background:#f4f4f5;color:var(--primary)}.gap-input :deep(input){text-align:center}.dist-indicator{align-items:center;color:#f87171;display:flex;justify-content:center;z-index:40}.dist-bottom,.dist-top{flex-direction:column}.dist-left,.dist-right{flex-direction:row}.dist-line{background:currentColor;flex:1 1 0}.dist-bottom .dist-line,.dist-top .dist-line{width:1px}.dist-left .dist-line,.dist-right .dist-line{height:1px}.dist-label{background:#fafafa;border-radius:2px;color:#f87171;font-size:10px;font-variant-numeric:tabular-nums;line-height:1;padding:1px 4px}
|
|
1440
|
+
.field-block{border:1px solid #e4e4e7;cursor:move;position:absolute}.field-block.is-selected{border-color:var(--primary);box-shadow:0 0 0 1px var(--primary)}.frame-outline{border:1px dashed hsla(240,5%,84%,.7)}.resize-handle{background:transparent;position:absolute}.handle-n{top:-3px}.handle-n,.handle-s{cursor:ns-resize;height:6px;left:12px;right:12px}.handle-s{bottom:-3px}.handle-e{right:-3px}.handle-e,.handle-w{bottom:12px;cursor:ew-resize;top:12px;width:6px}.handle-w{left:-3px}.handle-nw{cursor:nwse-resize;left:-3px}.handle-ne,.handle-nw{height:10px;top:-3px;width:10px}.handle-ne{cursor:nesw-resize;right:-3px}.handle-sw{cursor:nesw-resize;left:-3px}.handle-se,.handle-sw{bottom:-3px;height:10px;width:10px}.handle-se{cursor:nwse-resize;right:-3px}.drill-button{align-items:center;background:transparent;border-radius:4px;color:#71717a;cursor:pointer;display:inline-flex;height:22px;justify-content:center;opacity:0;position:absolute;right:4px;top:4px;transition:opacity .12s ease,background-color .12s ease,color .12s ease;width:22px;z-index:5}.drill-button:focus-visible,.field-block:hover .drill-button{opacity:1}.drill-button:hover{background:#f4f4f5;color:var(--primary)}.gap-input :deep(input){text-align:center}.inline-config-pane{background:#fff;border-left:1px solid #e4e4e7;bottom:0;box-shadow:-4px 0 16px -8px rgba(0,0,0,.15);display:flex;flex-direction:column;position:absolute;right:0;top:0;-webkit-user-select:text;-moz-user-select:text;user-select:text;z-index:60}.inline-config-resizer{bottom:0;cursor:ew-resize;left:-3px;position:absolute;top:0;width:7px;z-index:1}.inline-config-resizer:after{background:transparent;bottom:0;content:"";left:3px;position:absolute;top:0;transition:background-color .12s ease;width:1px}.inline-config-resizer:hover:after{background:var(--primary)}.inline-config-header{align-items:center;border-bottom:1px solid #f4f4f5;display:flex;flex-shrink:0;gap:.5rem;padding:.5rem .5rem .5rem .75rem}.inline-config-close{align-items:center;border-radius:4px;color:#71717a;cursor:pointer;display:inline-flex;height:28px;justify-content:center;transition:background-color .12s ease,color .12s ease;width:28px}.inline-config-close:hover{background:#f4f4f5;color:#18181b}.inline-config-body{flex:1 1 0;min-height:0;overflow:auto;padding:1rem}.dist-indicator{align-items:center;color:#f87171;display:flex;justify-content:center;z-index:40}.dist-bottom,.dist-top{flex-direction:column}.dist-left,.dist-right{flex-direction:row}.dist-line{background:currentColor;flex:1 1 0}.dist-bottom .dist-line,.dist-top .dist-line{width:1px}.dist-left .dist-line,.dist-right .dist-line{height:1px}.dist-label{background:#fafafa;border-radius:2px;color:#f87171;font-size:10px;font-variant-numeric:tabular-nums;line-height:1;padding:1px 4px}
|
|
1348
1441
|
</style>
|