@number-flow/vue 0.4.2 → 0.4.3
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/index.js +6 -6
- package/dist/index.umd.cjs +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as V, provide as H, renderSlot as G, watch as I, nextTick as
|
|
1
|
+
import { defineComponent as V, provide as H, renderSlot as G, watch as I, nextTick as j, onUnmounted as z, ref as S, computed as T, inject as Y, openBlock as Z, createElementBlock as q, mergeProps as J, unref as k, onMounted as K, watchEffect as Q, toValue as P } from "vue";
|
|
2
2
|
import { NumberFlowLite as c, formatToData as tt, renderInnerHTML as et, define as it, canAnimate as nt, prefersReducedMotion as C } from "number-flow";
|
|
3
3
|
import { NumberFlowLite as Et } from "number-flow";
|
|
4
4
|
import { BROWSER as f } from "esm-env";
|
|
@@ -13,8 +13,8 @@ const W = Symbol(), Ct = /* @__PURE__ */ V({
|
|
|
13
13
|
async () => {
|
|
14
14
|
e || (e = !0, t.forEach(async (s) => {
|
|
15
15
|
var r;
|
|
16
|
-
!s.value || !s.value.created || (s.value.willUpdate(), await
|
|
17
|
-
}), await
|
|
16
|
+
!s.value || !s.value.created || (s.value.willUpdate(), await j(), (r = s.value) == null || r.didUpdate());
|
|
17
|
+
}), await j(), e = !1);
|
|
18
18
|
}
|
|
19
19
|
// { flush: 'pre' } // default
|
|
20
20
|
), z(() => {
|
|
@@ -60,7 +60,7 @@ const ot = String.raw, lt = f && typeof CSS < "u" && CSS.supports && CSS.support
|
|
|
60
60
|
} catch {
|
|
61
61
|
return !1;
|
|
62
62
|
}
|
|
63
|
-
})(), ct = "var(--number-flow-char-height, 1em)", p = "var(--number-flow-mask-height, 0.25em)", N = `calc(${p} / 2)`, A = "var(--number-flow-mask-width, 0.5em)", m = `calc(${A} / var(--scale-x))`, g = "#000 0, transparent 71%", L = ot`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${ct} !important}.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(${E}) / var(--width));transform:translateX(var(${w})) scaleX(var(--scale-x));margin:0 calc(-1 * ${A});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${m},#000 calc(100% - ${m}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${p},#000 calc(100% - ${p}),transparent 100% ),radial-gradient(at bottom right,${g}),radial-gradient(at bottom left,${g}),radial-gradient(at top left,${g}),radial-gradient(at top right,${g});-webkit-mask-size:100% calc(100% - ${p} * 2),calc(100% - ${m} * 2) 100%,${m} ${p},${m} ${p},${m} ${p},${m} ${p};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.
|
|
63
|
+
})(), ct = "var(--number-flow-char-height, 1em)", p = "var(--number-flow-mask-height, 0.25em)", N = `calc(${p} / 2)`, A = "var(--number-flow-mask-width, 0.5em)", m = `calc(${A} / var(--scale-x))`, g = "#000 0, transparent 71%", L = ot`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${ct} !important}.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(${E}) / var(--width));transform:translateX(var(${w})) scaleX(var(--scale-x));margin:0 calc(-1 * ${A});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${m},#000 calc(100% - ${m}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${p},#000 calc(100% - ${p}),transparent 100% ),radial-gradient(at bottom right,${g}),radial-gradient(at bottom left,${g}),radial-gradient(at top left,${g}),radial-gradient(at top right,${g});-webkit-mask-size:100% calc(100% - ${p} * 2),calc(100% - ${m} * 2) 100%,${m} ${p},${m} ${p},${m} ${p},${m} ${p};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${N} ${A};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${w})))}: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(${R})}.digit__num,.number .section::after{padding:${N} 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(${y}))}`, pt = f ? HTMLElement : class {
|
|
64
64
|
}, ut = ht && lt && dt;
|
|
65
65
|
let v;
|
|
66
66
|
class mt extends pt {
|
|
@@ -430,7 +430,7 @@ const vt = (a, t) => a == null ? t : t == null ? a : Math.max(a, t), $ = /* @__P
|
|
|
430
430
|
"aria-label": s.value.valueAsString
|
|
431
431
|
}, h.$attrs, {
|
|
432
432
|
role: "img",
|
|
433
|
-
manual: !!
|
|
433
|
+
manual: !!k(l),
|
|
434
434
|
trend: h.trend,
|
|
435
435
|
plugins: h.plugins,
|
|
436
436
|
animated: h.animated,
|
|
@@ -440,7 +440,7 @@ const vt = (a, t) => a == null ? t : t == null ? a : Math.max(a, t), $ = /* @__P
|
|
|
440
440
|
respectMotionPreference: h.respectMotionPreference,
|
|
441
441
|
"data-will-change": h.willChange ? "" : void 0,
|
|
442
442
|
digits: h.digits,
|
|
443
|
-
innerHTML:
|
|
443
|
+
innerHTML: k(r),
|
|
444
444
|
"data-allow-mismatch": "",
|
|
445
445
|
onAnimationsstart: d[0] || (d[0] = (U) => n("animationsstart")),
|
|
446
446
|
onAnimationsfinish: d[1] || (d[1] = (U) => n("animationsfinish")),
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(p,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue"),require("number-flow"),require("esm-env")):typeof define=="function"&&define.amd?define(["exports","vue","number-flow","esm-env"],l):(p=typeof globalThis<"u"?globalThis:p||self,l(p["number-flow-vue"]={},p.Vue,p.NumberFlow,p.Env))})(this,function(p,l,d,y){"use strict";const j=Symbol(),W=l.defineComponent({__name:"NumberFlowGroup",setup(a){const t=new Set;let e=!1;const i=(n,o)=>{t.add(n),l.watch(o,async()=>{e||(e=!0,t.forEach(async s=>{var r;!s.value||!s.value.created||(s.value.willUpdate(),await l.nextTick(),(r=s.value)==null||r.didUpdate())}),await l.nextTick(),e=!1)}),l.onUnmounted(()=>{t.delete(n)})};return l.provide(j,i),(n,o)=>l.renderSlot(n.$slots,"default")}}),f=(a,t,e)=>{const i=document.createElement(a),[n,o]=Array.isArray(t)?[void 0,t]:[t,e];return n&&Object.assign(i,n),o==null||o.forEach(s=>i.appendChild(s)),i},O=(a,t)=>{var e;return t==="left"?a.offsetLeft:(((e=a.offsetParent instanceof HTMLElement?a.offsetParent:null)==null?void 0:e.offsetWidth)??0)-a.offsetWidth-a.offsetLeft},X=a=>a.offsetWidth>0&&a.offsetHeight>0;function D(a,t,{reverse:e=!1}={}){const i=a.length;for(let n=e?i-1:0;e?n>=0:n<i;e?n--:n++)t(a[n],n)}const F=String.raw,H=y.BROWSER&&typeof CSS<"u"&&CSS.supports&&CSS.supports("animation-timing-function","linear(1,2)"),I=y.BROWSER&&typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),k=y.BROWSER&&typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,v="--_number-flow-d-opacity",S="--_number-flow-d-width",w="--_number-flow-dx",C="--_number-flow-d",q=(()=>{try{return CSS.registerProperty({name:v,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:w,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:S,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:C,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),z="var(--number-flow-char-height, 1em)",m="var(--number-flow-mask-height, 0.25em)",U=`calc(${m} / 2)`,$="var(--number-flow-mask-width, 0.5em)",g=`calc(${$} / var(--scale-x))`,_="#000 0, transparent 71%",x=F`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${z} !important}.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(${S}) / var(--width));transform:translateX(var(${w})) scaleX(var(--scale-x));margin:0 calc(-1 * ${$});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${g},#000 calc(100% - ${g}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${m},#000 calc(100% - ${m}),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% - ${m} * 2),calc(100% - ${g} * 2) 100%,${g} ${m},${g} ${m},${g} ${m},${g} ${m};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number:not(:has(.digit.is-spinning)){-webkit-mask-image:none}.number__inner{padding:${U} ${$};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${w})))}: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(${C})}.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(${v}))}`,G=y.BROWSER?HTMLElement:class{},Y=I&&H&&q;let b;class Z extends G{constructor(){super(),this.created=!1,this.manual=!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;if(t==null)return;const{pre:i,integer:n,fraction:o,post:s,value:r}=t;if(this.created){const h=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(h.value,r):this.trend,this.computedAnimated=Y&&this._animated&&(!this.respectMotionPreference||!(k!=null&&k.matches))&&X(this),(e=this.plugins)==null||e.forEach(c=>{var u;return(u=c.onUpdate)==null?void 0:u.call(c,t,h,this)}),this.manual||this.willUpdate(),this._pre.update(i),this._num.update({integer:n,fraction:o}),this._post.update(s),this.manual||this.didUpdate()}else{if(this._data=t,this.attachShadow({mode:"open"}),typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)b||(b=new CSSStyleSheet,b.replaceSync(x)),this.shadowRoot.adoptedStyleSheets=[b];else{const h=document.createElement("style");h.textContent=x,this.shadowRoot.appendChild(h)}this._pre=new N(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new J(this,n,o),this.shadowRoot.appendChild(this._num.el),this._post=new N(this,s,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el)}this.created=!0}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}}Z.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:(a,t)=>Math.sign(t-a),respectMotionPreference:!0,plugins:void 0,digits:void 0};class J{constructor(t,e,i,{className:n,...o}={}){this.flow=t,this._integer=new M(t,e,{justify:"right",part:"integer"}),this._fraction=new M(t,i,{justify:"left",part:"fraction"}),this._inner=f("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=f("span",{...o,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({[w]:[`${e}px`,"0px"],[S]:[n,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class P{constructor(t,e,{justify:i,className:n,...o},s){this.flow=t,this.children=new Map,this.onCharRemove=h=>()=>{this.children.delete(h)},this.justify=i;const r=e.map(h=>this.addChar(h).el);this.el=f("span",{...o,className:`section section--justify-${i} ${n??""}`},s?s(r):r)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const n=t.type==="integer"||t.type==="fraction"?new B(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new K(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]=`${O(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",o=n?"prepend":"append";if(D(t,s=>{let r;this.children.has(s.key)?(r=this.children.get(s.key),i.set(s,r),this.unpop(r),r.present=!0):(r=this.addChar(s,{startDigitsAtZero:!0,animateIn:!0}),e.set(s,r)),this.el[o](r.el)},{reverse:n}),this.flow.computedAnimated){const s=this.el.getBoundingClientRect();e.forEach(r=>{r.willUpdate(s)})}e.forEach((s,r)=>{s.update(r.value)}),i.forEach((s,r)=>{s.update(r.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 M extends P{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(o=>o.key===n)||e.set(n,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof B&&i.update(0)}),this.pop(e)}}class N extends P{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(o=>o.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 o;this.el.remove(),(o=this._onRemove)==null||o.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&n&&this.el.animate({[v]:[-.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({[v]: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 L extends R{constructor(t,e,i,n){super(t.flow,i,n),this.section=t,this.value=e,this.el=i}}class B extends L{constructor(t,e,i,n,o){var s,r;const h=(((r=(s=t.flow.digits)==null?void 0:s[n])==null?void 0:r.max)??9)+1,c=Array.from({length:h}).map((V,A)=>{const E=f("span",{className:"digit__num"},[document.createTextNode(String(A))]);return A!==i&&E.setAttribute("inert",""),E.style.setProperty("--n",String(A)),E}),u=f("span",{part:`digit ${e}-digit`,className:"digit"},c);u.style.setProperty("--current",String(i)),u.style.setProperty("--length",String(h)),super(t,i,u,o),this.pos=n,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=c,this.length=h}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,o=this.section.justify==="left"?i+n:i-n,s=this._prevCenter-o;s&&this.el.animate({transform:[`translateX(${s}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const r=this.getDelta();r&&(this.el.classList.add("is-spinning"),this.el.animate({[C]:[-r,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 o=(t=n.getDelta)==null?void 0:t.call(n,this.value,this._prevValue,this);if(o!=null)return o}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 K extends L{constructor(t,e,i,n){const o=f("span",{className:"symbol__value",textContent:i});super(t,i,f("span",{part:`symbol ${e}`,className:"symbol"},[o]),n),this.type=e,this._children=new Map,this._onChildRemove=s=>()=>{this._children.delete(s)},this._children.set(i,new R(this.flow,o,{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);if(e.present=!1,this._children.has(t)){const i=this._children.get(t);i.present=!0}else{const i=f("span",{className:"symbol__value",textContent:t});this.el.appendChild(i),this._children.set(t,new R(this.flow,i,{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 Q=(a,t)=>a==null?t:t==null?a:Math.max(a,t),T=new WeakMap,tt={onUpdate(a,t,e){if(T.set(e,void 0),!e.computedTrend)return;const i=t.integer.concat(t.fraction).filter(r=>r.type==="integer"||r.type==="fraction"),n=a.integer.concat(a.fraction).filter(r=>r.type==="integer"||r.type==="fraction"),o=i.find(r=>!n.find(h=>h.pos===r.pos&&h.value===r.value)),s=n.find(r=>!i.find(h=>r.pos===h.pos&&r.value===h.value));T.set(e,Q(o==null?void 0:o.pos,s==null?void 0:s.pos))},getDelta(a,t,e){const i=a-t,n=T.get(e.flow);if(!i&&n!=null&&n>=e.pos)return e.length*e.flow.computedTrend}},et=["aria-label","manual","trend","plugins","animated","transformTiming","spinTiming","opacityTiming","respectMotionPreference","data-will-change","digits","innerHTML","data"],it=l.defineComponent({inheritAttrs:!1,__name:"index",props:{transformTiming:{default:()=>d.NumberFlowLite.defaultProps.transformTiming},spinTiming:{default:()=>d.NumberFlowLite.defaultProps.spinTiming},opacityTiming:{default:()=>d.NumberFlowLite.defaultProps.opacityTiming},animated:{type:Boolean,default:()=>d.NumberFlowLite.defaultProps.animated},respectMotionPreference:{type:Boolean,default:()=>d.NumberFlowLite.defaultProps.respectMotionPreference},trend:{type:[Number,Function],default:()=>d.NumberFlowLite.defaultProps.trend},plugins:{default:()=>d.NumberFlowLite.defaultProps.plugins},digits:{default:()=>d.NumberFlowLite.defaultProps.digits},locales:{},format:{},value:{},prefix:{},suffix:{},willChange:{type:Boolean,default:!1}},emits:["animationsstart","animationsfinish"],setup(a,{expose:t,emit:e}){const i=l.ref();t({el:i});const n=e,o=l.computed(()=>new Intl.NumberFormat(a.locales,a.format)),s=l.computed(()=>d.formatToData(a.value,o.value,a.prefix,a.suffix)),r=y.BROWSER?void 0:d.renderInnerHTML(s.value),h=l.inject(j,void 0);return h==null||h(i,s),(c,u)=>(l.openBlock(),l.createElementBlock("number-flow-vue",l.mergeProps({ref_key:"el",ref:i,"aria-label":s.value.valueAsString},c.$attrs,{role:"img",manual:!!l.unref(h),trend:c.trend,plugins:c.plugins,animated:c.animated,transformTiming:c.transformTiming,spinTiming:c.spinTiming,opacityTiming:c.opacityTiming,respectMotionPreference:c.respectMotionPreference,"data-will-change":c.willChange?"":void 0,digits:c.digits,innerHTML:l.unref(r),"data-allow-mismatch":"",onAnimationsstart:u[0]||(u[0]=V=>n("animationsstart")),onAnimationsfinish:u[1]||(u[1]=V=>n("animationsfinish")),data:s.value}),null,16,et))}});d.define("number-flow-vue",d.NumberFlowLite);function nt({respectMotionPreference:a=!0}={}){const t=l.ref(!1),e=l.ref(!1);return l.onMounted(()=>{var i;t.value=d.canAnimate,e.value=((i=d.prefersReducedMotion)==null?void 0:i.matches)??!1}),l.watchEffect(i=>{var o;if(!l.toValue(a))return;const n=({matches:s})=>{e.value=s};(o=d.prefersReducedMotion)==null||o.addEventListener("change",n),i(()=>{var s;(s=d.prefersReducedMotion)==null||s.removeEventListener("change",n)})}),l.computed(()=>t.value&&(!l.toValue(a)||!e.value))}Object.defineProperty(p,"NumberFlowElement",{enumerable:!0,get:()=>d.NumberFlowLite}),p.NumberFlowGroup=W,p.continuous=tt,p.default=it,p.useCanAnimate=nt,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(p,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue"),require("number-flow"),require("esm-env")):typeof define=="function"&&define.amd?define(["exports","vue","number-flow","esm-env"],l):(p=typeof globalThis<"u"?globalThis:p||self,l(p["number-flow-vue"]={},p.Vue,p.NumberFlow,p.Env))})(this,function(p,l,d,y){"use strict";const j=Symbol(),W=l.defineComponent({__name:"NumberFlowGroup",setup(a){const t=new Set;let e=!1;const i=(n,o)=>{t.add(n),l.watch(o,async()=>{e||(e=!0,t.forEach(async s=>{var r;!s.value||!s.value.created||(s.value.willUpdate(),await l.nextTick(),(r=s.value)==null||r.didUpdate())}),await l.nextTick(),e=!1)}),l.onUnmounted(()=>{t.delete(n)})};return l.provide(j,i),(n,o)=>l.renderSlot(n.$slots,"default")}}),f=(a,t,e)=>{const i=document.createElement(a),[n,o]=Array.isArray(t)?[void 0,t]:[t,e];return n&&Object.assign(i,n),o==null||o.forEach(s=>i.appendChild(s)),i},O=(a,t)=>{var e;return t==="left"?a.offsetLeft:(((e=a.offsetParent instanceof HTMLElement?a.offsetParent:null)==null?void 0:e.offsetWidth)??0)-a.offsetWidth-a.offsetLeft},X=a=>a.offsetWidth>0&&a.offsetHeight>0;function D(a,t,{reverse:e=!1}={}){const i=a.length;for(let n=e?i-1:0;e?n>=0:n<i;e?n--:n++)t(a[n],n)}const F=String.raw,H=y.BROWSER&&typeof CSS<"u"&&CSS.supports&&CSS.supports("animation-timing-function","linear(1,2)"),I=y.BROWSER&&typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),U=y.BROWSER&&typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,v="--_number-flow-d-opacity",S="--_number-flow-d-width",w="--_number-flow-dx",C="--_number-flow-d",q=(()=>{try{return CSS.registerProperty({name:v,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:w,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:S,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:C,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),z="var(--number-flow-char-height, 1em)",m="var(--number-flow-mask-height, 0.25em)",x=`calc(${m} / 2)`,$="var(--number-flow-mask-width, 0.5em)",g=`calc(${$} / var(--scale-x))`,_="#000 0, transparent 71%",P=F`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${z} !important}.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(${S}) / var(--width));transform:translateX(var(${w})) scaleX(var(--scale-x));margin:0 calc(-1 * ${$});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${g},#000 calc(100% - ${g}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${m},#000 calc(100% - ${m}),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% - ${m} * 2),calc(100% - ${g} * 2) 100%,${g} ${m},${g} ${m},${g} ${m},${g} ${m};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${x} ${$};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${w})))}: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(${C})}.digit__num,.number .section::after{padding:${x} 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(${v}))}`,G=y.BROWSER?HTMLElement:class{},Y=I&&H&&q;let b;class Z extends G{constructor(){super(),this.created=!1,this.manual=!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;if(t==null)return;const{pre:i,integer:n,fraction:o,post:s,value:r}=t;if(this.created){const h=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(h.value,r):this.trend,this.computedAnimated=Y&&this._animated&&(!this.respectMotionPreference||!(U!=null&&U.matches))&&X(this),(e=this.plugins)==null||e.forEach(c=>{var u;return(u=c.onUpdate)==null?void 0:u.call(c,t,h,this)}),this.manual||this.willUpdate(),this._pre.update(i),this._num.update({integer:n,fraction:o}),this._post.update(s),this.manual||this.didUpdate()}else{if(this._data=t,this.attachShadow({mode:"open"}),typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)b||(b=new CSSStyleSheet,b.replaceSync(P)),this.shadowRoot.adoptedStyleSheets=[b];else{const h=document.createElement("style");h.textContent=P,this.shadowRoot.appendChild(h)}this._pre=new N(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new J(this,n,o),this.shadowRoot.appendChild(this._num.el),this._post=new N(this,s,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el)}this.created=!0}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}}Z.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:(a,t)=>Math.sign(t-a),respectMotionPreference:!0,plugins:void 0,digits:void 0};class J{constructor(t,e,i,{className:n,...o}={}){this.flow=t,this._integer=new M(t,e,{justify:"right",part:"integer"}),this._fraction=new M(t,i,{justify:"left",part:"fraction"}),this._inner=f("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=f("span",{...o,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({[w]:[`${e}px`,"0px"],[S]:[n,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class k{constructor(t,e,{justify:i,className:n,...o},s){this.flow=t,this.children=new Map,this.onCharRemove=h=>()=>{this.children.delete(h)},this.justify=i;const r=e.map(h=>this.addChar(h).el);this.el=f("span",{...o,className:`section section--justify-${i} ${n??""}`},s?s(r):r)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const n=t.type==="integer"||t.type==="fraction"?new B(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new K(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]=`${O(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",o=n?"prepend":"append";if(D(t,s=>{let r;this.children.has(s.key)?(r=this.children.get(s.key),i.set(s,r),this.unpop(r),r.present=!0):(r=this.addChar(s,{startDigitsAtZero:!0,animateIn:!0}),e.set(s,r)),this.el[o](r.el)},{reverse:n}),this.flow.computedAnimated){const s=this.el.getBoundingClientRect();e.forEach(r=>{r.willUpdate(s)})}e.forEach((s,r)=>{s.update(r.value)}),i.forEach((s,r)=>{s.update(r.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 M extends k{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(o=>o.key===n)||e.set(n,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof B&&i.update(0)}),this.pop(e)}}class N extends k{update(t){const e=new Map;this.children.forEach((i,n)=>{t.find(o=>o.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 o;this.el.remove(),(o=this._onRemove)==null||o.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&n&&this.el.animate({[v]:[-.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({[v]: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 L extends R{constructor(t,e,i,n){super(t.flow,i,n),this.section=t,this.value=e,this.el=i}}class B extends L{constructor(t,e,i,n,o){var s,r;const h=(((r=(s=t.flow.digits)==null?void 0:s[n])==null?void 0:r.max)??9)+1,c=Array.from({length:h}).map((V,A)=>{const E=f("span",{className:"digit__num"},[document.createTextNode(String(A))]);return A!==i&&E.setAttribute("inert",""),E.style.setProperty("--n",String(A)),E}),u=f("span",{part:`digit ${e}-digit`,className:"digit"},c);u.style.setProperty("--current",String(i)),u.style.setProperty("--length",String(h)),super(t,i,u,o),this.pos=n,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=c,this.length=h}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,o=this.section.justify==="left"?i+n:i-n,s=this._prevCenter-o;s&&this.el.animate({transform:[`translateX(${s}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const r=this.getDelta();r&&(this.el.classList.add("is-spinning"),this.el.animate({[C]:[-r,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 o=(t=n.getDelta)==null?void 0:t.call(n,this.value,this._prevValue,this);if(o!=null)return o}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 K extends L{constructor(t,e,i,n){const o=f("span",{className:"symbol__value",textContent:i});super(t,i,f("span",{part:`symbol ${e}`,className:"symbol"},[o]),n),this.type=e,this._children=new Map,this._onChildRemove=s=>()=>{this._children.delete(s)},this._children.set(i,new R(this.flow,o,{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);if(e.present=!1,this._children.has(t)){const i=this._children.get(t);i.present=!0}else{const i=f("span",{className:"symbol__value",textContent:t});this.el.appendChild(i),this._children.set(t,new R(this.flow,i,{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 Q=(a,t)=>a==null?t:t==null?a:Math.max(a,t),T=new WeakMap,tt={onUpdate(a,t,e){if(T.set(e,void 0),!e.computedTrend)return;const i=t.integer.concat(t.fraction).filter(r=>r.type==="integer"||r.type==="fraction"),n=a.integer.concat(a.fraction).filter(r=>r.type==="integer"||r.type==="fraction"),o=i.find(r=>!n.find(h=>h.pos===r.pos&&h.value===r.value)),s=n.find(r=>!i.find(h=>r.pos===h.pos&&r.value===h.value));T.set(e,Q(o==null?void 0:o.pos,s==null?void 0:s.pos))},getDelta(a,t,e){const i=a-t,n=T.get(e.flow);if(!i&&n!=null&&n>=e.pos)return e.length*e.flow.computedTrend}},et=["aria-label","manual","trend","plugins","animated","transformTiming","spinTiming","opacityTiming","respectMotionPreference","data-will-change","digits","innerHTML","data"],it=l.defineComponent({inheritAttrs:!1,__name:"index",props:{transformTiming:{default:()=>d.NumberFlowLite.defaultProps.transformTiming},spinTiming:{default:()=>d.NumberFlowLite.defaultProps.spinTiming},opacityTiming:{default:()=>d.NumberFlowLite.defaultProps.opacityTiming},animated:{type:Boolean,default:()=>d.NumberFlowLite.defaultProps.animated},respectMotionPreference:{type:Boolean,default:()=>d.NumberFlowLite.defaultProps.respectMotionPreference},trend:{type:[Number,Function],default:()=>d.NumberFlowLite.defaultProps.trend},plugins:{default:()=>d.NumberFlowLite.defaultProps.plugins},digits:{default:()=>d.NumberFlowLite.defaultProps.digits},locales:{},format:{},value:{},prefix:{},suffix:{},willChange:{type:Boolean,default:!1}},emits:["animationsstart","animationsfinish"],setup(a,{expose:t,emit:e}){const i=l.ref();t({el:i});const n=e,o=l.computed(()=>new Intl.NumberFormat(a.locales,a.format)),s=l.computed(()=>d.formatToData(a.value,o.value,a.prefix,a.suffix)),r=y.BROWSER?void 0:d.renderInnerHTML(s.value),h=l.inject(j,void 0);return h==null||h(i,s),(c,u)=>(l.openBlock(),l.createElementBlock("number-flow-vue",l.mergeProps({ref_key:"el",ref:i,"aria-label":s.value.valueAsString},c.$attrs,{role:"img",manual:!!l.unref(h),trend:c.trend,plugins:c.plugins,animated:c.animated,transformTiming:c.transformTiming,spinTiming:c.spinTiming,opacityTiming:c.opacityTiming,respectMotionPreference:c.respectMotionPreference,"data-will-change":c.willChange?"":void 0,digits:c.digits,innerHTML:l.unref(r),"data-allow-mismatch":"",onAnimationsstart:u[0]||(u[0]=V=>n("animationsstart")),onAnimationsfinish:u[1]||(u[1]=V=>n("animationsfinish")),data:s.value}),null,16,et))}});d.define("number-flow-vue",d.NumberFlowLite);function nt({respectMotionPreference:a=!0}={}){const t=l.ref(!1),e=l.ref(!1);return l.onMounted(()=>{var i;t.value=d.canAnimate,e.value=((i=d.prefersReducedMotion)==null?void 0:i.matches)??!1}),l.watchEffect(i=>{var o;if(!l.toValue(a))return;const n=({matches:s})=>{e.value=s};(o=d.prefersReducedMotion)==null||o.addEventListener("change",n),i(()=>{var s;(s=d.prefersReducedMotion)==null||s.removeEventListener("change",n)})}),l.computed(()=>t.value&&(!l.toValue(a)||!e.value))}Object.defineProperty(p,"NumberFlowElement",{enumerable:!0,get:()=>d.NumberFlowLite}),p.NumberFlowGroup=W,p.continuous=tt,p.default=it,p.useCanAnimate=nt,Object.defineProperties(p,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.4.
|
|
7
|
+
"version": "0.4.3",
|
|
8
8
|
"author": {
|
|
9
9
|
"name": "Maxwell Barvian",
|
|
10
10
|
"email": "max@barvian.me",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"esm-env": "^1.1.4",
|
|
48
|
-
"number-flow": "0.5.
|
|
48
|
+
"number-flow": "0.5.3"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@playwright/test": "^1.48.0",
|