@shwfed/config 2.9.6 → 2.9.7
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/module.json +1 -1
- package/dist/preview/assets/{FieldGroup.vue_vue_type_script_setup_true_lang-B-Cwm94m.js → FieldGroup.vue_vue_type_script_setup_true_lang-tkU7rYrs.js} +1 -1
- package/dist/preview/assets/{badge-nn3uvUrR.js → badge-C55P2V8D.js} +1 -1
- package/dist/preview/assets/{config-BNQXbhtM.js → config-B3-xqMew.js} +1 -1
- package/dist/preview/assets/{config-Bg95dd9K.js → config-Bc2N2jlD.js} +1 -1
- package/dist/preview/assets/{config-C6LousLT.js → config-Bu1S_DR5.js} +1 -1
- package/dist/preview/assets/{config-DbjXscRV.js → config-CH2QpakU.js} +1 -1
- package/dist/preview/assets/{config-d8ZhbBPg.js → config-CnxzerC5.js} +1 -1
- package/dist/preview/assets/{config-DiD-8mMw.js → config-D0j4njOQ.js} +1 -1
- package/dist/preview/assets/{config-Dvq_Xh7I.js → config-DeaHg7ps.js} +1 -1
- package/dist/preview/assets/{config-DO77XC7j.js → config-DqibnZH4.js} +1 -1
- package/dist/preview/assets/{config-e8Li9jh4.js → config-DzKcQKJj.js} +1 -1
- package/dist/preview/assets/{config-CGhV-PCy.js → config-j1oKH3Ci.js} +1 -1
- package/dist/preview/assets/{config-CUkEZF8G.js → config-rL7m78ZC.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-DuO-EwWA.js → definition.vue_vue_type_script_setup_true_lang-G748uLwi.js} +1 -1
- package/dist/preview/assets/{index-Bpap7h0Q.js → index-C16exop7.js} +29 -29
- package/dist/preview/assets/index-CSm6dB4o.js +1 -0
- package/dist/preview/assets/{index-DZyYLnIs.js → index-dIh1Jn4U.js} +1 -1
- package/dist/preview/assets/{item-BqnYkxMr.js → item-BCWcrKaL.js} +1 -1
- package/dist/preview/assets/runtime-BTFesnrJ.js +1 -0
- package/dist/preview/assets/runtime-BsqCaddm.js +1 -0
- package/dist/preview/assets/{runtime-D6blej8e.js → runtime-C-KLJ71q.js} +1 -1
- package/dist/preview/assets/{runtime-CfdnDil3.js → runtime-C5-cN3M1.js} +1 -1
- package/dist/preview/assets/runtime-CBg0VVCJ.js +1 -0
- package/dist/preview/assets/runtime-D3LGPlv3.js +1 -0
- package/dist/preview/assets/runtime-DO8ov3J6.js +1 -0
- package/dist/preview/assets/runtime-DZiqhnCm.js +1 -0
- package/dist/preview/assets/{runtime-CqoGHW0U.js → runtime-bRCsEM7S.js} +1 -1
- package/dist/preview/assets/{runtime-DrnADq2i.js → runtime-zoq6YaMz.js} +1 -1
- package/dist/preview/index.html +1 -1
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/runtime.vue +1 -1
- package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/runtime.vue +1 -1
- package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/runtime.vue +5 -1
- package/dist/runtime/components/actions/buttons/2026-05-21/com.shwfed.actions.button.http.download/runtime.vue +2 -2
- package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/runtime.vue +1 -1
- package/dist/runtime/components/actions/buttons/2026-06-08/com.shwfed.actions.button.http.request.json.batch/runtime.vue +1 -1
- package/dist/runtime/components/actions/utils/resolve.js +1 -1
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +4 -4
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +6 -6
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +2 -2
- package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +2 -2
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.d.vue.ts +4 -4
- package/dist/runtime/components/form/fields/2026-05-24/com.shwfed.form.field.monthrange/config.vue.d.ts +4 -4
- package/dist/runtime/components/operations/utils/resolve.d.ts +7 -0
- package/dist/runtime/components/operations/utils/resolve.js +1 -1
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/runtime.vue +2 -1
- package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch.remote/runtime.vue +2 -1
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-remote/runtime.vue +1 -1
- package/dist/runtime/components/table/columns/2026-05-24/com.shwfed.table.column.combobox-single.remote.options-static/runtime.vue +1 -1
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-remote/runtime.vue +1 -1
- package/dist/runtime/components/table/columns/2026-05-25/com.shwfed.table.column.combobox-multi.remote.options-static/runtime.vue +1 -1
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-multi.remote/runtime.vue +1 -1
- package/dist/runtime/components/table/columns/2026-05-26/com.shwfed.table.column.combobox-single.remote/runtime.vue +1 -1
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-multi/runtime.vue +1 -1
- package/dist/runtime/components/table/columns/2026-05-28/com.shwfed.table.column.combobox-single/runtime.vue +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.d.vue.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue.d.ts +1 -1
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.d.vue.ts +2 -2
- package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue.d.ts +2 -2
- package/dist/runtime/share/event-bus.d.ts +20 -2
- package/dist/runtime/share/event-bus.js +4 -3
- package/package.json +1 -1
- package/dist/preview/assets/index-jHSCIEVi.js +0 -1
- package/dist/preview/assets/runtime-BFAxoqEC.js +0 -1
- package/dist/preview/assets/runtime-BntIEgRD.js +0 -1
- package/dist/preview/assets/runtime-Bu6BEaxq.js +0 -1
- package/dist/preview/assets/runtime-DEsY0ihh.js +0 -1
- package/dist/preview/assets/runtime-JW4LSnRF.js +0 -1
- package/dist/preview/assets/runtime-U7gyBbWI.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b8 as e}from"./index-C16exop7.js";import{b9 as f,ba as r,bb as s}from"./index-C16exop7.js";export{f as TableConfig,r as createTableConfig,e as default,s as getColumnTechnicalKey};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as H,N as et,O as it,o as nt,P as st,Q as at,e as D,y as A,z as j,r as rt,R as ot,S as z,T as lt,v as ct,U as W,V as ht}from"./index-Bpap7h0Q.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",B="--_number-flow-d-width",S="--_number-flow-dx",L="--_number-flow-d",mt=(()=>{try{return CSS.registerProperty({name:C,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:S,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:B,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:L,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),U="round(nearest, calc(var(--number-flow-mask-height, 0.25em) / 2), 1px)",v=`calc(${U} * 2)`,R="var(--number-flow-mask-width, 0.5em)",y=`calc(${R} / var(--scale-x))`,$="#000 0, transparent 71%",ft=dt`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:1}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${B}) / var(--width));transform:translateX(var(${S})) scaleX(var(--scale-x));margin:0 calc(-1 * ${R});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${y},#000 calc(100% - ${y}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${v},#000 calc(100% - ${v}),transparent 100% ),radial-gradient(at bottom right,${$}),radial-gradient(at bottom left,${$}),radial-gradient(at top left,${$}),radial-gradient(at top right,${$});-webkit-mask-size:100% calc(100% - ${v} * 2),calc(100% - ${y} * 2) 100%,${y} ${v},${y} ${v},${y} ${v},${y} ${v};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${U} ${R};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${S})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${L})}.digit__num,.number .section::after{padding:${U} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${C}))}`,gt=HTMLElement,vt=(s,t)=>s==null?t:t==null?s:Math.max(s,t),P=new WeakMap,jt={onUpdate(s,t,e){if(P.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));P.set(e,vt(r?.pos,a?.pos))},getDelta(s,t,e){const i=s-t,n=P.get(e.flow);if(!i&&n!=null&&n>=e.pos)return e.length*e.flow.computedTrend}},g=(s,t,e)=>{const i=document.createElement(s),[n,r]=Array.isArray(t)?[void 0,t]:[t,e];return n&&Object.assign(i,n),r?.forEach(a=>i.appendChild(a)),i},yt=(s,t)=>{var e;return t==="left"?s.offsetLeft:(((e=s.offsetParent instanceof HTMLElement?s.offsetParent:null)==null?void 0:e.offsetWidth)??0)-s.offsetWidth-s.offsetLeft},wt=s=>s.offsetWidth>0&&s.offsetHeight>0,_t=(s,t)=>{!customElements.get(s)&&customElements.define(s,t)};function bt(s,t,{reverse:e=!1}={}){const i=s.length;for(let n=e?i-1:0;e?n>=0:n<i;e?n--:n++)t(s[n],n)}function $t(s,t,e,i){const n=t.formatToParts(s);e&&n.unshift({type:"prefix",value:e}),i&&n.push({type:"suffix",value:i});const r=[],a=[],o=[],c=[],l={},d=p=>`${p}:${l[p]=(l[p]??-1)+1}`;let m="",_=!1,b=!1;for(const p of n){m+=p.value;const h=p.type==="minusSign"||p.type==="plusSign"?"sign":p.type;h==="integer"?(_=!0,a.push(...p.value.split("").map(T=>({type:h,value:parseInt(T)})))):h==="group"?a.push({type:h,value:p.value}):h==="decimal"?(b=!0,o.push({type:h,value:p.value,key:d(h)})):h==="fraction"?o.push(...p.value.split("").map(T=>({type:h,value:parseInt(T),key:d(h),pos:-1-l[h]}))):(_||b?c:r).push({type:h,value:p.value,key:d(h)})}const F=[];for(let p=a.length-1;p>=0;p--){const h=a[p];F.unshift(h.type==="integer"?{...h,key:d(h.type),pos:l[h.type]}:{...h,key:d(h.type)})}return{pre:r,integer:F,fraction:o,post:c,valueAsString:m,value:typeof s=="string"?parseFloat(s):s}}const Y=ut&&pt&&mt;let u=class extends gt{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...e}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,e)}get animated(){return this._animated}set animated(t){var e;this.animated!==t&&(this._animated=t,(e=this.shadowRoot)==null||e.getAnimations().forEach(i=>i.finish()))}set data(t){var e,i;if(t==null)return;const{pre:n,integer:r,fraction:a,post:o,value:c}=t;if(this.created){const l=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(l.value,c):this.trend,this.computedAnimated=Y&&this._animated&&(!this.respectMotionPreference||!((e=k)!=null&&e.matches))&&wt(this)&&this.ownerDocument.visibilityState==="visible",(i=this.plugins)==null||i.forEach(d=>{var m;return(m=d.onUpdate)==null?void 0:m.call(d,t,l,this)}),this.batched||this.willUpdate(),this._pre.update(n),this._num.update({integer:r,fraction:a}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}const l=document.createElement("style");this.nonce&&(l.nonce=this.nonce),l.textContent=ft,this.shadowRoot.appendChild(l),this._pre=new O(this,n,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new xt(this,r,a),this.shadowRoot.appendChild(this._num.el),this._post=new O(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}};u.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(s,t)=>Math.sign(t-s),respectMotionPreference:!0,plugins:void 0,digits:void 0};class xt{constructor(t,e,i,{className:n,...r}={}){this.flow=t,this._integer=new I(t,e,{justify:"right",part:"integer"}),this._fraction=new I(t,i,{justify:"left",part:"fraction"}),this._inner=g("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=g("span",{...r,part:"number",className:`number ${n??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:e}){this._integer.update(t),this._fraction.update(e)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const e=this._prevLeft-t.left,i=this.el.offsetWidth,n=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[S]:[`${e}px`,"0px"],[B]:[n,0]},{...this.flow.transformTiming,composite:"accumulate"})}}let G=class{constructor(t,e,{justify:i,className:n,...r},a){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=i;const o=e.map(c=>this.addChar(c).el);this.el=g("span",{...r,className:`section section--justify-${i} ${n??""}`},a?a(o):o)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const n=t.type==="integer"||t.type==="fraction"?new q(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new kt(this,t.type,t.value,{...i,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,n),n}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${yt(e.el,this.justify)}px`}),t.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(t){const e=new Map,i=new Map,n=this.justify==="left",r=n?"prepend":"append";if(bt(t,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),i.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),e.set(a,o)),this.el[r](o.el)},{reverse:n}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();e.forEach(o=>{o.willUpdate(a)})}e.forEach((a,o)=>{a.update(o.value)}),i.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(e=>e.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(n=>n.didUpdate(t));const e=t[this.justify],i=this._prevOffset-e;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}};class I extends G{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(r=>r.key===n)||e.set(n,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof q&&i.update(0)}),this.pop(e)}}class O extends G{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(r=>r.key===n)||e.set(n,i)}),this.pop(e),this.addNewAndUpdateExisting(t)}}class M{constructor(t,e,{onRemove:i,animateIn:n=!1}={}){this.flow=t,this.el=e,this._present=!0,this._remove=()=>{var r;this.el.remove(),(r=this._onRemove)==null||r.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&n&&this.el.animate({[C]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[C]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class Z extends M{constructor(t,e,i,n){super(t.flow,i,n),this.section=t,this.value=e,this.el=i}}class q extends Z{constructor(t,e,i,n,r){var a,o;const c=(((o=(a=t.flow.digits)==null?void 0:a[n])==null?void 0:o.max)??9)+1,l=Array.from({length:c}).map((m,_)=>{const b=g("span",{className:"digit__num"},[document.createTextNode(String(_))]);return _!==i&&b.setAttribute("inert",""),b.style.setProperty("--n",String(_)),b}),d=g("span",{part:`digit ${e}-digit`,className:"digit"},l);d.style.setProperty("--current",String(i)),d.style.setProperty("--length",String(c)),super(t,i,d,r),this.pos=n,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=l,this.length=c}willUpdate(t){const e=this.el.getBoundingClientRect();this._prevValue=this.value;const i=e[this.section.justify]-t[this.section.justify],n=e.width/2;this._prevCenter=this.section.justify==="left"?i+n:i-n}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((e,i)=>i===t?e.removeAttribute("inert"):e.setAttribute("inert","")),this.value=t}didUpdate(t){const e=this.el.getBoundingClientRect(),i=e[this.section.justify]-t[this.section.justify],n=e.width/2,r=this.section.justify==="left"?i+n:i-n,a=this._prevCenter-r;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[L]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const n of this.flow.plugins){const r=(t=n.getDelta)==null?void 0:t.call(n,this.value,this._prevValue,this);if(r!=null)return r}const e=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(e);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:e}}class kt extends Z{constructor(t,e,i,n){const r=g("span",{className:"symbol__value",textContent:i});super(t,i,g("span",{part:`symbol ${e}`,className:"symbol"},[r]),n),this.type=e,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(i,new M(this.flow,r,{onRemove:this._onChildRemove(i)}))}willUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect();this._prevOffset=e[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const e=this._children.get(this.value);e&&(e.present=!1);const i=this._children.get(t);if(i)i.present=!0;else{const n=g("span",{className:"symbol__value",textContent:t});this.el.appendChild(n),this._children.set(t,new M(this.flow,n,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],i=this._prevOffset-e;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const X=String.raw;(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})();typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)");typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)");const J="--_number-flow-d-opacity",Q="--_number-flow-d-width",N="--_number-flow-dx",K="--_number-flow-d";(()=>{try{return CSS.registerProperty({name:J,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:N,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:Q,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:K,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})();const E="round(nearest, calc(var(--number-flow-mask-height, 0.25em) / 2), 1px)",f=`calc(${E} * 2)`,V="var(--number-flow-mask-width, 0.5em)",w=`calc(${V} / var(--scale-x))`,x="#000 0, transparent 71%",Ct=X`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:1}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${Q}) / var(--width));transform:translateX(var(${N})) scaleX(var(--scale-x));margin:0 calc(-1 * ${V});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} ${V};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${N})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${K})}.digit__num,.number .section::after{padding:${E} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${J}))}`,St=X`:host{display:inline-block;direction:ltr;white-space:nowrap;line-height:1}span{display:inline-block}:host([data-will-change]) span{will-change:transform}.number,.digit{padding:${E} 0}.symbol{white-space:pre}`,Et=(s="")=>X`:where(number-flow${s}){line-height:1}number-flow${s} > span{font-kerning:none;display:inline-block;padding:${f} 0}`,Tt=s=>[St,Et(s),Ct],tt=Symbol(),Mt=H({__name:"NumberFlowGroup",setup(s){const t=new Set;let e=!1;return lt(tt,(i,n)=>{t.add(i),ct(n,async()=>{e||(e=!0,t.forEach(async r=>{var a;!r.value||!r.value.created||(r.value.willUpdate(),await W(),(a=r.value)==null||a.didUpdate())}),await W(),e=!1)}),ht(()=>{t.delete(i)})}),(i,n)=>et(i.$slots,"default")}}),Pt=["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=A();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,Pt))}}),Vt=Tt("-vue");_t("number-flow-vue",u);function Bt({respectMotionPreference:s=!0}={}){const t=A(!1),e=A(!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,Mt as NumberFlowGroup,jt as continuous,Nt as default,Vt as styles,Bt as useCanAnimate};
|
|
1
|
+
import{d as H,N as et,O as it,o as nt,P as st,Q as at,e as D,y as A,z as j,r as rt,R as ot,S as z,T as lt,v as ct,U as W,V as ht}from"./index-C16exop7.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",B="--_number-flow-d-width",S="--_number-flow-dx",L="--_number-flow-d",mt=(()=>{try{return CSS.registerProperty({name:C,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:S,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:B,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:L,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),U="round(nearest, calc(var(--number-flow-mask-height, 0.25em) / 2), 1px)",v=`calc(${U} * 2)`,R="var(--number-flow-mask-width, 0.5em)",y=`calc(${R} / var(--scale-x))`,$="#000 0, transparent 71%",ft=dt`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:1}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${B}) / var(--width));transform:translateX(var(${S})) scaleX(var(--scale-x));margin:0 calc(-1 * ${R});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${y},#000 calc(100% - ${y}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${v},#000 calc(100% - ${v}),transparent 100% ),radial-gradient(at bottom right,${$}),radial-gradient(at bottom left,${$}),radial-gradient(at top left,${$}),radial-gradient(at top right,${$});-webkit-mask-size:100% calc(100% - ${v} * 2),calc(100% - ${y} * 2) 100%,${y} ${v},${y} ${v},${y} ${v},${y} ${v};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${U} ${R};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${S})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${L})}.digit__num,.number .section::after{padding:${U} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${C}))}`,gt=HTMLElement,vt=(s,t)=>s==null?t:t==null?s:Math.max(s,t),P=new WeakMap,jt={onUpdate(s,t,e){if(P.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));P.set(e,vt(r?.pos,a?.pos))},getDelta(s,t,e){const i=s-t,n=P.get(e.flow);if(!i&&n!=null&&n>=e.pos)return e.length*e.flow.computedTrend}},g=(s,t,e)=>{const i=document.createElement(s),[n,r]=Array.isArray(t)?[void 0,t]:[t,e];return n&&Object.assign(i,n),r?.forEach(a=>i.appendChild(a)),i},yt=(s,t)=>{var e;return t==="left"?s.offsetLeft:(((e=s.offsetParent instanceof HTMLElement?s.offsetParent:null)==null?void 0:e.offsetWidth)??0)-s.offsetWidth-s.offsetLeft},wt=s=>s.offsetWidth>0&&s.offsetHeight>0,_t=(s,t)=>{!customElements.get(s)&&customElements.define(s,t)};function bt(s,t,{reverse:e=!1}={}){const i=s.length;for(let n=e?i-1:0;e?n>=0:n<i;e?n--:n++)t(s[n],n)}function $t(s,t,e,i){const n=t.formatToParts(s);e&&n.unshift({type:"prefix",value:e}),i&&n.push({type:"suffix",value:i});const r=[],a=[],o=[],c=[],l={},d=p=>`${p}:${l[p]=(l[p]??-1)+1}`;let m="",_=!1,b=!1;for(const p of n){m+=p.value;const h=p.type==="minusSign"||p.type==="plusSign"?"sign":p.type;h==="integer"?(_=!0,a.push(...p.value.split("").map(T=>({type:h,value:parseInt(T)})))):h==="group"?a.push({type:h,value:p.value}):h==="decimal"?(b=!0,o.push({type:h,value:p.value,key:d(h)})):h==="fraction"?o.push(...p.value.split("").map(T=>({type:h,value:parseInt(T),key:d(h),pos:-1-l[h]}))):(_||b?c:r).push({type:h,value:p.value,key:d(h)})}const F=[];for(let p=a.length-1;p>=0;p--){const h=a[p];F.unshift(h.type==="integer"?{...h,key:d(h.type),pos:l[h.type]}:{...h,key:d(h.type)})}return{pre:r,integer:F,fraction:o,post:c,valueAsString:m,value:typeof s=="string"?parseFloat(s):s}}const Y=ut&&pt&&mt;let u=class extends gt{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...e}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,e)}get animated(){return this._animated}set animated(t){var e;this.animated!==t&&(this._animated=t,(e=this.shadowRoot)==null||e.getAnimations().forEach(i=>i.finish()))}set data(t){var e,i;if(t==null)return;const{pre:n,integer:r,fraction:a,post:o,value:c}=t;if(this.created){const l=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(l.value,c):this.trend,this.computedAnimated=Y&&this._animated&&(!this.respectMotionPreference||!((e=k)!=null&&e.matches))&&wt(this)&&this.ownerDocument.visibilityState==="visible",(i=this.plugins)==null||i.forEach(d=>{var m;return(m=d.onUpdate)==null?void 0:m.call(d,t,l,this)}),this.batched||this.willUpdate(),this._pre.update(n),this._num.update({integer:r,fraction:a}),this._post.update(o),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}const l=document.createElement("style");this.nonce&&(l.nonce=this.nonce),l.textContent=ft,this.shadowRoot.appendChild(l),this._pre=new O(this,n,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new xt(this,r,a),this.shadowRoot.appendChild(this._num.el),this._post=new O(this,o,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}};u.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(s,t)=>Math.sign(t-s),respectMotionPreference:!0,plugins:void 0,digits:void 0};class xt{constructor(t,e,i,{className:n,...r}={}){this.flow=t,this._integer=new I(t,e,{justify:"right",part:"integer"}),this._fraction=new I(t,i,{justify:"left",part:"fraction"}),this._inner=g("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=g("span",{...r,part:"number",className:`number ${n??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:e}){this._integer.update(t),this._fraction.update(e)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const e=this._prevLeft-t.left,i=this.el.offsetWidth,n=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[S]:[`${e}px`,"0px"],[B]:[n,0]},{...this.flow.transformTiming,composite:"accumulate"})}}let G=class{constructor(t,e,{justify:i,className:n,...r},a){this.flow=t,this.children=new Map,this.onCharRemove=c=>()=>{this.children.delete(c)},this.justify=i;const o=e.map(c=>this.addChar(c).el);this.el=g("span",{...r,className:`section section--justify-${i} ${n??""}`},a?a(o):o)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const n=t.type==="integer"||t.type==="fraction"?new q(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new kt(this,t.type,t.value,{...i,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,n),n}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${yt(e.el,this.justify)}px`}),t.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(t){const e=new Map,i=new Map,n=this.justify==="left",r=n?"prepend":"append";if(bt(t,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),i.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),e.set(a,o)),this.el[r](o.el)},{reverse:n}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();e.forEach(o=>{o.willUpdate(a)})}e.forEach((a,o)=>{a.update(o.value)}),i.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(e=>e.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(n=>n.didUpdate(t));const e=t[this.justify],i=this._prevOffset-e;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}};class I extends G{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(r=>r.key===n)||e.set(n,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof q&&i.update(0)}),this.pop(e)}}class O extends G{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(r=>r.key===n)||e.set(n,i)}),this.pop(e),this.addNewAndUpdateExisting(t)}}class M{constructor(t,e,{onRemove:i,animateIn:n=!1}={}){this.flow=t,this.el=e,this._present=!0,this._remove=()=>{var r;this.el.remove(),(r=this._onRemove)==null||r.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&n&&this.el.animate({[C]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[C]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class Z extends M{constructor(t,e,i,n){super(t.flow,i,n),this.section=t,this.value=e,this.el=i}}class q extends Z{constructor(t,e,i,n,r){var a,o;const c=(((o=(a=t.flow.digits)==null?void 0:a[n])==null?void 0:o.max)??9)+1,l=Array.from({length:c}).map((m,_)=>{const b=g("span",{className:"digit__num"},[document.createTextNode(String(_))]);return _!==i&&b.setAttribute("inert",""),b.style.setProperty("--n",String(_)),b}),d=g("span",{part:`digit ${e}-digit`,className:"digit"},l);d.style.setProperty("--current",String(i)),d.style.setProperty("--length",String(c)),super(t,i,d,r),this.pos=n,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=l,this.length=c}willUpdate(t){const e=this.el.getBoundingClientRect();this._prevValue=this.value;const i=e[this.section.justify]-t[this.section.justify],n=e.width/2;this._prevCenter=this.section.justify==="left"?i+n:i-n}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((e,i)=>i===t?e.removeAttribute("inert"):e.setAttribute("inert","")),this.value=t}didUpdate(t){const e=this.el.getBoundingClientRect(),i=e[this.section.justify]-t[this.section.justify],n=e.width/2,r=this.section.justify==="left"?i+n:i-n,a=this._prevCenter-r;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[L]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const n of this.flow.plugins){const r=(t=n.getDelta)==null?void 0:t.call(n,this.value,this._prevValue,this);if(r!=null)return r}const e=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(e);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:e}}class kt extends Z{constructor(t,e,i,n){const r=g("span",{className:"symbol__value",textContent:i});super(t,i,g("span",{part:`symbol ${e}`,className:"symbol"},[r]),n),this.type=e,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(i,new M(this.flow,r,{onRemove:this._onChildRemove(i)}))}willUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect();this._prevOffset=e[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const e=this._children.get(this.value);e&&(e.present=!1);const i=this._children.get(t);if(i)i.present=!0;else{const n=g("span",{className:"symbol__value",textContent:t});this.el.appendChild(n),this._children.set(t,new M(this.flow,n,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],i=this._prevOffset-e;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const X=String.raw;(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})();typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)");typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)");const J="--_number-flow-d-opacity",Q="--_number-flow-d-width",N="--_number-flow-dx",K="--_number-flow-d";(()=>{try{return CSS.registerProperty({name:J,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:N,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:Q,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:K,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})();const E="round(nearest, calc(var(--number-flow-mask-height, 0.25em) / 2), 1px)",f=`calc(${E} * 2)`,V="var(--number-flow-mask-width, 0.5em)",w=`calc(${V} / var(--scale-x))`,x="#000 0, transparent 71%",Ct=X`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:1}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${Q}) / var(--width));transform:translateX(var(${N})) scaleX(var(--scale-x));margin:0 calc(-1 * ${V});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} ${V};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${N})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${K})}.digit__num,.number .section::after{padding:${E} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${J}))}`,St=X`:host{display:inline-block;direction:ltr;white-space:nowrap;line-height:1}span{display:inline-block}:host([data-will-change]) span{will-change:transform}.number,.digit{padding:${E} 0}.symbol{white-space:pre}`,Et=(s="")=>X`:where(number-flow${s}){line-height:1}number-flow${s} > span{font-kerning:none;display:inline-block;padding:${f} 0}`,Tt=s=>[St,Et(s),Ct],tt=Symbol(),Mt=H({__name:"NumberFlowGroup",setup(s){const t=new Set;let e=!1;return lt(tt,(i,n)=>{t.add(i),ct(n,async()=>{e||(e=!0,t.forEach(async r=>{var a;!r.value||!r.value.created||(r.value.willUpdate(),await W(),(a=r.value)==null||a.didUpdate())}),await W(),e=!1)}),ht(()=>{t.delete(i)})}),(i,n)=>et(i.$slots,"default")}}),Pt=["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=A();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,Pt))}}),Vt=Tt("-vue");_t("number-flow-vue",u);function Bt({respectMotionPreference:s=!0}={}){const t=A(!1),e=A(!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,Mt as NumberFlowGroup,jt as continuous,Nt as default,Vt as styles,Bt as useCanAnimate};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as q,q as M,r as O,v as y,o as k,c as E,x as z,e as A,y as x,z as r,A as J,B as L,C as s,D as T,E as V,F as D,G,H,I as K,J as g,K as P,L as h,M as U}from"./index-
|
|
1
|
+
import{d as q,q as M,r as O,v as y,o as k,c as E,x as z,e as A,y as x,z as r,A as J,B as L,C as s,D as T,E as V,F as D,G,H,I as K,J as g,K as P,L as h,M as U}from"./index-C16exop7.js";import W from"./index-dIh1Jn4U.js";const X=q({name:"ShwfedBlockAnimatedNumberItem",__name:"item",props:{item:{}},setup(b){const n=b,j=P(),a=x(void 0),m=x(0);function u(){return K(j)}function S(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=r(()=>a.value===void 0?g():U(a.value));function v(e){if(!e)return"";try{const t=h(s(e,{...u(),json:d.value}));return t==null?"":String(t)}catch{return""}}const w=r(()=>v(n.item.prefix)),C=r(()=>v(n.item.suffix));function F(e){if(e)try{const t=h(s(e,{...u(),json:d.value}));return t==null?void 0:typeof t=="string"||typeof t=="object"?t:String(t)}catch{return}}const I=r(()=>F(n.item.style));async function i(){const e=n.item.dataSource,t=u(),B=J(function*(){let o=g();e.request&&(o=yield*L(yield*s(e.request,t)));const N=yield*s(e.value,{...t,json:o});return{json:T(o),value:N}});try{const o=await V(D(B,G));a.value=o.json,m.value=S(o.value)}catch(o){console.warn("[shwfed-animated-number] fetch failed",o)}}const l=r(()=>(n.item.pollingInterval??0)>0),_=r(()=>Math.max(1,n.item.pollingInterval??1)*1e3),c=H(),{pause:p,resume:f}=M(()=>{i()},_,{immediate:!1});return O(()=>{i(),l.value&&c.value&&f()}),y(c,e=>{l.value&&(e?(i(),f()):p())}),y(()=>[n.item.dataSource.request??"",n.item.dataSource.value,n.item.pollingInterval??0].join("|"),()=>{i(),l.value&&c.value?f():p()}),(e,t)=>(k(),E(A(W),{value:m.value,prefix:w.value,suffix:C.value,style:z(I.value)},null,8,["value","prefix","suffix","style"]))}});export{X as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as r,aP as f,aK as d,c as u,e as m,aO as p,o as l,C as g,I as h,K as _}from"./index-C16exop7.js";import{_ as C}from"./definition.vue_vue_type_script_setup_true_lang-G748uLwi.js";const E=r({name:"ShwfedEventDispatchActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const c=e,s=_(),a=(n,t)=>g(n,{...h(s),...t}),o=p(),i=f(()=>d(o,c.config.triggers,a));return(n,t)=>(l(),u(C,{"action-id":e.buttonId,effect:m(i)},null,8,["action-id","effect"]))}});export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as f,W as u,aP as p,aQ as d,aK as l,b3 as m,$ as g,c as x,e as h,C as E,I as _,aO as B,o as C,K as b}from"./index-C16exop7.js";import{_ as k}from"./definition.vue_vue_type_script_setup_true_lang-G748uLwi.js";const O=f({name:"ShwfedHttpRequestBatchActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(n){const e=n,{locale:a}=u(),c=b(),s=(t,o)=>E(t,{..._(c),...o}),i=B(),r=p(()=>d(l(i,e.config.before,s),()=>m(e.config.expression,s,{messageExpression:e.config.messageExpression,resultExpression:e.config.resultExpression,continueOnError:e.config.continueOnError,markdown:g(e.config.markdown,a.value)??""})));return(t,o)=>(C(),x(k,{"action-id":n.buttonId,effect:h(r)},null,8,["action-id","effect"]))}});export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as u,W as i,c as l,e as p,z as m,o as d,k as f,$ as _,aL as k,C as w,I as x,K as g}from"./index-
|
|
1
|
+
import{d as u,W as i,c as l,e as p,z as m,o as d,k as f,$ as _,aL as k,C as w,I as x,K as g}from"./index-C16exop7.js";const h=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{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as f,aP as u,aS as l,aT as d,c as m,e as w,C as p,I as _,K as g,o as h}from"./index-
|
|
1
|
+
import{d as f,aP as u,aS as l,aT as d,c as m,e as w,C as p,I as _,K as g,o as h}from"./index-C16exop7.js";import{_ as v}from"./definition.vue_vue_type_script_setup_true_lang-G748uLwi.js";function x(){return{resolve:e=>({href:new URL(e,window.location.href).href})}}function b(e,t){return window.location.assign(e),Promise.resolve()}const R=f({name:"ShwfedNavigationActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=e,i=x(),a=g(),r=(n,o)=>p(n,{..._(a),...o});function c(n){try{return new URL(n,window.location.href).origin!==window.location.origin}catch{return!1}}const s=u(()=>l(r(t.config.url),n=>d(async()=>{const o=c(n);if(t.config.mode==="_blank"){window.open(o?n:i.resolve(n).href,"_blank");return}await b(n)})));return(n,o)=>(h(),m(v,{"action-id":e.buttonId,effect:w(s)},null,8,["action-id","effect"]))}});export{R as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as l,b1 as g,aP as A,aS as y,aK as b,c as S,e as _,C as h,I as C,aO as j,b2 as k,K as O,o as B}from"./index-C16exop7.js";import{_ as I}from"./definition.vue_vue_type_script_setup_true_lang-G748uLwi.js";const E=l({name:"ShwfedStateWriteActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(s){const a=s,f=O(),c=(e,t)=>h(e,{...C(f),...t}),n=g(),o=n.kind==="form"&&n.parent?n.parent:n,u=j(),m=k((e,t,r)=>{if(Array.isArray(e[t])&&Array.isArray(r))return e[t]=r,!0});function i(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e,t){return i(e)&&i(t)?m({...t},e):t}const d=A(()=>y(c(a.config.expression),e=>{for(const t of Object.keys(e)){const r=p(o.getAt(t),e[t]);o.setAt(t,r)}return b(u,a.config.onSuccess,c)}));return(e,t)=>(B(),S(I,{"action-id":s.buttonId,effect:_(d)},null,8,["action-id","effect"]))}});export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as r,aP as f,aQ as u,aK as g,aN as p,c as d,e as m,C as l,I as x,aO as h,K as E,o as _}from"./index-C16exop7.js";import{_ as C}from"./definition.vue_vue_type_script_setup_true_lang-G748uLwi.js";const B=r({name:"ShwfedHttpRequestActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(n){const e=n,i=E(),s=(t,c)=>l(t,{...x(i),...c}),o=h(),a=f(()=>u(g(o,e.config.before,s),()=>p(e.config.expression,s,{messageExpression:e.config.messageExpression,resultExpression:e.config.resultExpression,channel:o,triggers:{success:e.config.onSuccess,warning:e.config.onWarning,error:e.config.onError,info:e.config.onInfo}})));return(t,c)=>(_(),d(C,{"action-id":n.buttonId,effect:m(a)},null,8,["action-id","effect"]))}});export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as f,W as g,A as l,aK as u,$ as d,aL as p,aM as m,aN as x,c as E,e as _,C as h,I as C,aO as w,K as I,o as k}from"./index-C16exop7.js";import{_ as b}from"./definition.vue_vue_type_script_setup_true_lang-G748uLwi.js";const L=f({name:"ShwfedHttpRequestConfirmActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(c){const e=c,{locale:i}=g(),a=I(),s=(n,o)=>h(n,{...C(a),...o}),t=w(),r=l(function*(){yield*u(t,e.config.before,s);const n=d(e.config.markdown,i.value)??"",o=p(n,s);(yield*m({content:o,icon:e.config.icon,color:e.config.color}))||(yield*x(e.config.expression,s,{messageExpression:e.config.messageExpression,resultExpression:e.config.resultExpression,channel:t,triggers:{success:e.config.onSuccess,warning:e.config.onWarning,error:e.config.onError,info:e.config.onInfo}}))});return(n,o)=>(k(),E(b,{"action-id":c.buttonId,effect:_(r)},null,8,["action-id","effect"]))}});export{L as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as _,aP as E,A as S,aW as r,aK as m,a$ as b,b0 as j,c as v,e as x,C as B,I as C,aO as L,K as k,o as R}from"./index-C16exop7.js";import{_ as I}from"./definition.vue_vue_type_script_setup_true_lang-G748uLwi.js";const A=_({name:"ShwfedHttpDownloadActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(d){const c=d,g=k(),t=(e,n)=>B(e,{...C(g),...n}),l=L(),p=new Set(["success","error","warning","info"]);function f(e){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=e.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}const y=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,t)}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],t)}));return(e,n)=>(R(),v(I,{"action-id":d.buttonId,effect:x(y)},null,8,["action-id","effect"]))}});export{A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as s,W as x,aU as T,A as p,$ as c,aV as M,L as b,c as L,w as d,e as u,y as N,O as k,aO as S,aW as w,o as A,m as I,x as V,b as r,aX as $,aY as F,aB as H,K,aZ as f,T as m,a_ as O}from"./index-
|
|
1
|
+
import{d as s,W as x,aU as T,A as p,$ as c,aV as M,L as b,c as L,w as d,e as u,y as N,O as k,aO as S,aW as w,o as A,m as I,x as V,b as r,aX as $,aY as F,aB as H,K,aZ as f,T as m,a_ as O}from"./index-C16exop7.js";import{_ as W}from"./definition.vue_vue_type_script_setup_true_lang-G748uLwi.js";const z=s({name:"ShwfedModalLayoutActionRuntime",__name:"runtime",props:{buttonId:{},config:{},buttonTitle:{}},setup(n){const a=n,{locale:l}=x(),v=e=>{},h=K(),i=k(f,void 0),g=S(),o=N(null),C=T(a.buttonId,{close:()=>w(()=>{o.value?.()})},g),_=s({name:"ModalBoundaryBridge",setup(e,{slots:t}){return F(h),m(O,C),i&&m(f,i),()=>t.default?.()}}),y=(e,t)=>H()?.(e,t),E=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=()=>b(B()),yield*t,o.value=null});return(e,t)=>(A(),L(W,{"action-id":n.buttonId,effect:u(E)},{default:d(()=>[I("div",{style:V(n.config.modalMinHeight?`min-height: ${n.config.modalMinHeight}`:void 0)},[r(u(_),null,{default:d(()=>[r($,{"slot-value":n.config.slot,configure:v,"find-entry":y},null,8,["slot-value"])]),_:1})],4)]),_:1},8,["action-id","effect"]))}});export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-G748uLwi.js";import{d as n,c,e as a,o as f,aR as i}from"./index-C16exop7.js";const _=n({name:"ShwfedPrototypeActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=i;return(r,s)=>(f(),c(o,{"action-id":e.buttonId,effect:a(t)},null,8,["action-id","effect"]))}});export{_ as default};
|
package/dist/preview/index.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
`--primary`, the primary button variant renders as transparent. */
|
|
11
11
|
body { --primary: #009689; }
|
|
12
12
|
</style>
|
|
13
|
-
<script type="module" crossorigin src="./assets/index-
|
|
13
|
+
<script type="module" crossorigin src="./assets/index-C16exop7.js"></script>
|
|
14
14
|
<link rel="stylesheet" crossorigin href="./assets/index-vPcvbp7e.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
@@ -15,7 +15,7 @@ const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inher
|
|
|
15
15
|
const channel = useEventChannel();
|
|
16
16
|
const effect = Effect.suspend(
|
|
17
17
|
() => Effect.andThen(
|
|
18
|
-
dispatchTriggers(channel, props.config.before),
|
|
18
|
+
dispatchTriggers(channel, props.config.before, $cel),
|
|
19
19
|
() => executeHttpRequest(props.config.expression, $cel, {
|
|
20
20
|
messageExpression: props.config.messageExpression,
|
|
21
21
|
resultExpression: props.config.resultExpression,
|
|
@@ -18,7 +18,7 @@ const inherited = injectCELContext();
|
|
|
18
18
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
19
19
|
const channel = useEventChannel();
|
|
20
20
|
const effect = Effect.gen(function* () {
|
|
21
|
-
yield* dispatchTriggers(channel, props.config.before);
|
|
21
|
+
yield* dispatchTriggers(channel, props.config.before, $cel);
|
|
22
22
|
const raw = getLocalizedText(props.config.markdown, locale.value) ?? "";
|
|
23
23
|
const content = interpolateMarkdown(raw, $cel);
|
|
24
24
|
if (yield* reject({ content, icon: props.config.icon, color: props.config.color })) return;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
+
import { cel as _rawCel } from "../../../../../utils/cel";
|
|
4
|
+
import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
|
|
3
5
|
import ShwfedActionDefinition from "../../../components/definition.vue";
|
|
4
6
|
import { dispatchTriggers, useEventChannel } from "../../../../../share/event-bus";
|
|
5
7
|
defineOptions({ name: "ShwfedEventDispatchActionRuntime" });
|
|
@@ -7,8 +9,10 @@ const props = defineProps({
|
|
|
7
9
|
buttonId: { type: String, required: true },
|
|
8
10
|
config: { type: null, required: true }
|
|
9
11
|
});
|
|
12
|
+
const inherited = injectCELContext();
|
|
13
|
+
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
10
14
|
const channel = useEventChannel();
|
|
11
|
-
const effect = Effect.suspend(() => dispatchTriggers(channel, props.config.triggers));
|
|
15
|
+
const effect = Effect.suspend(() => dispatchTriggers(channel, props.config.triggers, $cel));
|
|
12
16
|
</script>
|
|
13
17
|
|
|
14
18
|
<template>
|
|
@@ -30,7 +30,7 @@ const effect = Effect.suspend(() => Effect.gen(function* () {
|
|
|
30
30
|
if (!template.download) {
|
|
31
31
|
const file = yield* requestBuilder.file();
|
|
32
32
|
yield* Effect.sync(() => saveFile(file));
|
|
33
|
-
return yield* dispatchTriggers(channel, props.config.onSuccess);
|
|
33
|
+
return yield* dispatchTriggers(channel, props.config.onSuccess, $cel);
|
|
34
34
|
}
|
|
35
35
|
const json = yield* requestBuilder.json();
|
|
36
36
|
const context = { json };
|
|
@@ -50,7 +50,7 @@ const effect = Effect.suspend(() => Effect.gen(function* () {
|
|
|
50
50
|
error: props.config.onError,
|
|
51
51
|
info: props.config.onInfo
|
|
52
52
|
};
|
|
53
|
-
return yield* dispatchTriggers(channel, triggers[kind]);
|
|
53
|
+
return yield* dispatchTriggers(channel, triggers[kind], $cel);
|
|
54
54
|
}));
|
|
55
55
|
</script>
|
|
56
56
|
|
|
@@ -39,7 +39,7 @@ const effect = Effect.suspend(
|
|
|
39
39
|
const merged = mergeAtKey(formState.getAt(key), result[key]);
|
|
40
40
|
formState.setAt(key, merged);
|
|
41
41
|
}
|
|
42
|
-
return dispatchTriggers(channel, props.config.onSuccess);
|
|
42
|
+
return dispatchTriggers(channel, props.config.onSuccess, $cel);
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
45
|
);
|
|
@@ -18,7 +18,7 @@ const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inher
|
|
|
18
18
|
const channel = useEventChannel();
|
|
19
19
|
const effect = Effect.suspend(
|
|
20
20
|
() => Effect.andThen(
|
|
21
|
-
dispatchTriggers(channel, props.config.before),
|
|
21
|
+
dispatchTriggers(channel, props.config.before, $cel),
|
|
22
22
|
() => executeHttpRequestBatch(props.config.expression, $cel, {
|
|
23
23
|
messageExpression: props.config.messageExpression,
|
|
24
24
|
resultExpression: props.config.resultExpression,
|
|
@@ -205,7 +205,7 @@ function classifyAndDispatch($cel, context, outcome) {
|
|
|
205
205
|
$cel(messageExpression, context),
|
|
206
206
|
(message) => Effect.sync(() => toast[kind](message))
|
|
207
207
|
);
|
|
208
|
-
return Effect.andThen(toasted, dispatchTriggers(channel, triggers?.[kind]));
|
|
208
|
+
return Effect.andThen(toasted, dispatchTriggers(channel, triggers?.[kind], $cel));
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
export function executeHttpRequest(expression, $cel, outcome = {}) {
|
|
@@ -33,9 +33,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
33
33
|
readonly expression: string;
|
|
34
34
|
} | undefined;
|
|
35
35
|
readonly numberOfMonths?: number | undefined;
|
|
36
|
-
readonly format?: string | undefined;
|
|
37
|
-
readonly valueFormat?: string | undefined;
|
|
38
36
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
37
|
+
readonly format?: string | undefined;
|
|
39
38
|
readonly startPlaceholder?: readonly [{
|
|
40
39
|
readonly locale: "zh";
|
|
41
40
|
readonly message: string;
|
|
@@ -50,6 +49,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
50
49
|
readonly locale: "en" | "ja" | "ko";
|
|
51
50
|
readonly message: string;
|
|
52
51
|
}[]] | undefined;
|
|
52
|
+
readonly valueFormat?: string | undefined;
|
|
53
53
|
readonly validations?: readonly {
|
|
54
54
|
readonly message: readonly [{
|
|
55
55
|
readonly locale: "zh";
|
|
@@ -105,9 +105,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
105
105
|
readonly expression: string;
|
|
106
106
|
} | undefined;
|
|
107
107
|
readonly numberOfMonths?: number | undefined;
|
|
108
|
-
readonly format?: string | undefined;
|
|
109
|
-
readonly valueFormat?: string | undefined;
|
|
110
108
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
109
|
+
readonly format?: string | undefined;
|
|
111
110
|
readonly startPlaceholder?: readonly [{
|
|
112
111
|
readonly locale: "zh";
|
|
113
112
|
readonly message: string;
|
|
@@ -122,6 +121,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
122
121
|
readonly locale: "en" | "ja" | "ko";
|
|
123
122
|
readonly message: string;
|
|
124
123
|
}[]] | undefined;
|
|
124
|
+
readonly valueFormat?: string | undefined;
|
|
125
125
|
readonly validations?: readonly {
|
|
126
126
|
readonly message: readonly [{
|
|
127
127
|
readonly locale: "zh";
|
|
@@ -33,9 +33,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
33
33
|
readonly expression: string;
|
|
34
34
|
} | undefined;
|
|
35
35
|
readonly numberOfMonths?: number | undefined;
|
|
36
|
-
readonly format?: string | undefined;
|
|
37
|
-
readonly valueFormat?: string | undefined;
|
|
38
36
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
37
|
+
readonly format?: string | undefined;
|
|
39
38
|
readonly startPlaceholder?: readonly [{
|
|
40
39
|
readonly locale: "zh";
|
|
41
40
|
readonly message: string;
|
|
@@ -50,6 +49,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
50
49
|
readonly locale: "en" | "ja" | "ko";
|
|
51
50
|
readonly message: string;
|
|
52
51
|
}[]] | undefined;
|
|
52
|
+
readonly valueFormat?: string | undefined;
|
|
53
53
|
readonly validations?: readonly {
|
|
54
54
|
readonly message: readonly [{
|
|
55
55
|
readonly locale: "zh";
|
|
@@ -105,9 +105,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
105
105
|
readonly expression: string;
|
|
106
106
|
} | undefined;
|
|
107
107
|
readonly numberOfMonths?: number | undefined;
|
|
108
|
-
readonly format?: string | undefined;
|
|
109
|
-
readonly valueFormat?: string | undefined;
|
|
110
108
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
109
|
+
readonly format?: string | undefined;
|
|
111
110
|
readonly startPlaceholder?: readonly [{
|
|
112
111
|
readonly locale: "zh";
|
|
113
112
|
readonly message: string;
|
|
@@ -122,6 +121,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
122
121
|
readonly locale: "en" | "ja" | "ko";
|
|
123
122
|
readonly message: string;
|
|
124
123
|
}[]] | undefined;
|
|
124
|
+
readonly valueFormat?: string | undefined;
|
|
125
125
|
readonly validations?: readonly {
|
|
126
126
|
readonly message: readonly [{
|
|
127
127
|
readonly locale: "zh";
|
|
@@ -34,10 +34,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
34
34
|
} | undefined;
|
|
35
35
|
readonly numberOfMonths?: number | undefined;
|
|
36
36
|
readonly hourCycle?: 12 | 24 | undefined;
|
|
37
|
-
readonly format?: string | undefined;
|
|
38
|
-
readonly valueFormat?: string | undefined;
|
|
39
|
-
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
40
37
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
38
|
+
readonly format?: string | undefined;
|
|
41
39
|
readonly startPlaceholder?: readonly [{
|
|
42
40
|
readonly locale: "zh";
|
|
43
41
|
readonly message: string;
|
|
@@ -52,6 +50,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
52
50
|
readonly locale: "en" | "ja" | "ko";
|
|
53
51
|
readonly message: string;
|
|
54
52
|
}[]] | undefined;
|
|
53
|
+
readonly valueFormat?: string | undefined;
|
|
54
|
+
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
55
55
|
readonly validations?: readonly {
|
|
56
56
|
readonly message: readonly [{
|
|
57
57
|
readonly locale: "zh";
|
|
@@ -108,10 +108,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
108
108
|
} | undefined;
|
|
109
109
|
readonly numberOfMonths?: number | undefined;
|
|
110
110
|
readonly hourCycle?: 12 | 24 | undefined;
|
|
111
|
-
readonly format?: string | undefined;
|
|
112
|
-
readonly valueFormat?: string | undefined;
|
|
113
|
-
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
114
111
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
112
|
+
readonly format?: string | undefined;
|
|
115
113
|
readonly startPlaceholder?: readonly [{
|
|
116
114
|
readonly locale: "zh";
|
|
117
115
|
readonly message: string;
|
|
@@ -126,6 +124,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
126
124
|
readonly locale: "en" | "ja" | "ko";
|
|
127
125
|
readonly message: string;
|
|
128
126
|
}[]] | undefined;
|
|
127
|
+
readonly valueFormat?: string | undefined;
|
|
128
|
+
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
129
129
|
readonly validations?: readonly {
|
|
130
130
|
readonly message: readonly [{
|
|
131
131
|
readonly locale: "zh";
|
|
@@ -34,10 +34,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
34
34
|
} | undefined;
|
|
35
35
|
readonly numberOfMonths?: number | undefined;
|
|
36
36
|
readonly hourCycle?: 12 | 24 | undefined;
|
|
37
|
-
readonly format?: string | undefined;
|
|
38
|
-
readonly valueFormat?: string | undefined;
|
|
39
|
-
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
40
37
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
38
|
+
readonly format?: string | undefined;
|
|
41
39
|
readonly startPlaceholder?: readonly [{
|
|
42
40
|
readonly locale: "zh";
|
|
43
41
|
readonly message: string;
|
|
@@ -52,6 +50,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
52
50
|
readonly locale: "en" | "ja" | "ko";
|
|
53
51
|
readonly message: string;
|
|
54
52
|
}[]] | undefined;
|
|
53
|
+
readonly valueFormat?: string | undefined;
|
|
54
|
+
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
55
55
|
readonly validations?: readonly {
|
|
56
56
|
readonly message: readonly [{
|
|
57
57
|
readonly locale: "zh";
|
|
@@ -108,10 +108,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
108
108
|
} | undefined;
|
|
109
109
|
readonly numberOfMonths?: number | undefined;
|
|
110
110
|
readonly hourCycle?: 12 | 24 | undefined;
|
|
111
|
-
readonly format?: string | undefined;
|
|
112
|
-
readonly valueFormat?: string | undefined;
|
|
113
|
-
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
114
111
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
112
|
+
readonly format?: string | undefined;
|
|
115
113
|
readonly startPlaceholder?: readonly [{
|
|
116
114
|
readonly locale: "zh";
|
|
117
115
|
readonly message: string;
|
|
@@ -126,6 +124,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
126
124
|
readonly locale: "en" | "ja" | "ko";
|
|
127
125
|
readonly message: string;
|
|
128
126
|
}[]] | undefined;
|
|
127
|
+
readonly valueFormat?: string | undefined;
|
|
128
|
+
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
129
129
|
readonly validations?: readonly {
|
|
130
130
|
readonly message: readonly [{
|
|
131
131
|
readonly locale: "zh";
|
|
@@ -33,9 +33,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
33
33
|
readonly expression: string;
|
|
34
34
|
} | undefined;
|
|
35
35
|
readonly hourCycle?: 12 | 24 | undefined;
|
|
36
|
+
readonly rangeSeparatorIcon?: string | undefined;
|
|
36
37
|
readonly valueFormat?: string | undefined;
|
|
37
38
|
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
38
|
-
readonly rangeSeparatorIcon?: string | undefined;
|
|
39
39
|
readonly validations?: readonly {
|
|
40
40
|
readonly message: readonly [{
|
|
41
41
|
readonly locale: "zh";
|
|
@@ -79,9 +79,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
79
79
|
readonly expression: string;
|
|
80
80
|
} | undefined;
|
|
81
81
|
readonly hourCycle?: 12 | 24 | undefined;
|
|
82
|
+
readonly rangeSeparatorIcon?: string | undefined;
|
|
82
83
|
readonly valueFormat?: string | undefined;
|
|
83
84
|
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
84
|
-
readonly rangeSeparatorIcon?: string | undefined;
|
|
85
85
|
readonly validations?: readonly {
|
|
86
86
|
readonly message: readonly [{
|
|
87
87
|
readonly locale: "zh";
|
|
@@ -33,9 +33,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
33
33
|
readonly expression: string;
|
|
34
34
|
} | undefined;
|
|
35
35
|
readonly hourCycle?: 12 | 24 | undefined;
|
|
36
|
+
readonly rangeSeparatorIcon?: string | undefined;
|
|
36
37
|
readonly valueFormat?: string | undefined;
|
|
37
38
|
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
38
|
-
readonly rangeSeparatorIcon?: string | undefined;
|
|
39
39
|
readonly validations?: readonly {
|
|
40
40
|
readonly message: readonly [{
|
|
41
41
|
readonly locale: "zh";
|
|
@@ -79,9 +79,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
79
79
|
readonly expression: string;
|
|
80
80
|
} | undefined;
|
|
81
81
|
readonly hourCycle?: 12 | 24 | undefined;
|
|
82
|
+
readonly rangeSeparatorIcon?: string | undefined;
|
|
82
83
|
readonly valueFormat?: string | undefined;
|
|
83
84
|
readonly timeGranularity?: "hour" | "minute" | "second" | undefined;
|
|
84
|
-
readonly rangeSeparatorIcon?: string | undefined;
|
|
85
85
|
readonly validations?: readonly {
|
|
86
86
|
readonly message: readonly [{
|
|
87
87
|
readonly locale: "zh";
|
|
@@ -32,9 +32,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
32
32
|
readonly mode: "formula" | "prefill";
|
|
33
33
|
readonly expression: string;
|
|
34
34
|
} | undefined;
|
|
35
|
-
readonly format?: string | undefined;
|
|
36
|
-
readonly valueFormat?: string | undefined;
|
|
37
35
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
36
|
+
readonly format?: string | undefined;
|
|
38
37
|
readonly startPlaceholder?: readonly [{
|
|
39
38
|
readonly locale: "zh";
|
|
40
39
|
readonly message: string;
|
|
@@ -49,6 +48,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
49
48
|
readonly locale: "en" | "ja" | "ko";
|
|
50
49
|
readonly message: string;
|
|
51
50
|
}[]] | undefined;
|
|
51
|
+
readonly valueFormat?: string | undefined;
|
|
52
52
|
readonly validations?: readonly {
|
|
53
53
|
readonly message: readonly [{
|
|
54
54
|
readonly locale: "zh";
|
|
@@ -103,9 +103,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
103
103
|
readonly mode: "formula" | "prefill";
|
|
104
104
|
readonly expression: string;
|
|
105
105
|
} | undefined;
|
|
106
|
-
readonly format?: string | undefined;
|
|
107
|
-
readonly valueFormat?: string | undefined;
|
|
108
106
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
107
|
+
readonly format?: string | undefined;
|
|
109
108
|
readonly startPlaceholder?: readonly [{
|
|
110
109
|
readonly locale: "zh";
|
|
111
110
|
readonly message: string;
|
|
@@ -120,6 +119,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
120
119
|
readonly locale: "en" | "ja" | "ko";
|
|
121
120
|
readonly message: string;
|
|
122
121
|
}[]] | undefined;
|
|
122
|
+
readonly valueFormat?: string | undefined;
|
|
123
123
|
readonly validations?: readonly {
|
|
124
124
|
readonly message: readonly [{
|
|
125
125
|
readonly locale: "zh";
|
|
@@ -32,9 +32,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
32
32
|
readonly mode: "formula" | "prefill";
|
|
33
33
|
readonly expression: string;
|
|
34
34
|
} | undefined;
|
|
35
|
-
readonly format?: string | undefined;
|
|
36
|
-
readonly valueFormat?: string | undefined;
|
|
37
35
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
36
|
+
readonly format?: string | undefined;
|
|
38
37
|
readonly startPlaceholder?: readonly [{
|
|
39
38
|
readonly locale: "zh";
|
|
40
39
|
readonly message: string;
|
|
@@ -49,6 +48,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
49
48
|
readonly locale: "en" | "ja" | "ko";
|
|
50
49
|
readonly message: string;
|
|
51
50
|
}[]] | undefined;
|
|
51
|
+
readonly valueFormat?: string | undefined;
|
|
52
52
|
readonly validations?: readonly {
|
|
53
53
|
readonly message: readonly [{
|
|
54
54
|
readonly locale: "zh";
|
|
@@ -103,9 +103,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
103
103
|
readonly mode: "formula" | "prefill";
|
|
104
104
|
readonly expression: string;
|
|
105
105
|
} | undefined;
|
|
106
|
-
readonly format?: string | undefined;
|
|
107
|
-
readonly valueFormat?: string | undefined;
|
|
108
106
|
readonly rangeSeparatorIcon?: string | undefined;
|
|
107
|
+
readonly format?: string | undefined;
|
|
109
108
|
readonly startPlaceholder?: readonly [{
|
|
110
109
|
readonly locale: "zh";
|
|
111
110
|
readonly message: string;
|
|
@@ -120,6 +119,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {},
|
|
|
120
119
|
readonly locale: "en" | "ja" | "ko";
|
|
121
120
|
readonly message: string;
|
|
122
121
|
}[]] | undefined;
|
|
122
|
+
readonly valueFormat?: string | undefined;
|
|
123
123
|
readonly validations?: readonly {
|
|
124
124
|
readonly message: readonly [{
|
|
125
125
|
readonly locale: "zh";
|
|
@@ -40,6 +40,13 @@ export declare function findOperation(type: string, compatibilityDate: string):
|
|
|
40
40
|
* the request's `params` to the registered `handler` with `ctx`. Unknown
|
|
41
41
|
* refs are skipped. Hosts merge the result with any bespoke param-less
|
|
42
42
|
* handlers (e.g. the page's `close`).
|
|
43
|
+
*
|
|
44
|
+
* When the request carries an emit-site evaluator (`request.cel`, the
|
|
45
|
+
* dispatching button's own scope), it overrides `ctx.cel` for that one call —
|
|
46
|
+
* so a handler's CEL-bearing params resolve where they were authored (the
|
|
47
|
+
* button, with `row` live) instead of against the host. Handlers read `ctx.cel`
|
|
48
|
+
* unchanged; the swap is invisible to them. Falls back to the host's evaluator
|
|
49
|
+
* when the emitter supplied none.
|
|
43
50
|
*/
|
|
44
51
|
export declare function operationHandlers(exposed: ReadonlyArray<{
|
|
45
52
|
type: string;
|
|
@@ -70,7 +70,7 @@ export function operationHandlers(exposed, ctx) {
|
|
|
70
70
|
for (const { type, compatibilityDate } of exposed) {
|
|
71
71
|
const entry = findOperation(type, compatibilityDate);
|
|
72
72
|
if (!entry) continue;
|
|
73
|
-
handlers[type] = (params) => entry.handler(params, ctx);
|
|
73
|
+
handlers[type] = (params, cel) => entry.handler(params, cel ? { ...ctx, cel } : ctx);
|
|
74
74
|
}
|
|
75
75
|
return handlers;
|
|
76
76
|
}
|
package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/runtime.vue
CHANGED
|
@@ -15,6 +15,7 @@ const props = defineProps({
|
|
|
15
15
|
});
|
|
16
16
|
const celContext = injectCELContext();
|
|
17
17
|
const eventChannel = useEventChannel();
|
|
18
|
+
const triggerCel = (expression, context) => $cel(expression, { ...celBindings(celContext), ...context });
|
|
18
19
|
const rawValue = computed(() => props.ctx.cell.getValue());
|
|
19
20
|
const isMissing = computed(() => rawValue.value === void 0 || rawValue.value === null);
|
|
20
21
|
const checked = computed(() => rawValue.value === true);
|
|
@@ -54,7 +55,7 @@ async function onUpdate(next) {
|
|
|
54
55
|
console.error("[shwfed-table] switch successMessage failed", e);
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
await Effect.runPromise(dispatchTriggers(eventChannel, props.column.triggers));
|
|
58
|
+
await Effect.runPromise(dispatchTriggers(eventChannel, props.column.triggers, triggerCel));
|
|
58
59
|
} catch (e) {
|
|
59
60
|
console.error("[shwfed-table] switch onChange failed", e);
|
|
60
61
|
toast.error("\u8BF7\u6C42\u5931\u8D25");
|