@number-flow/vue
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -53,2 +53,4 @@ import { ComponentOptionsMixin } from 'vue'; | ||
value: Value; | ||
prefix?: string; | ||
suffix?: string; | ||
willChange?: boolean; | ||
@@ -55,0 +57,0 @@ }; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("number-flow"),f=Symbol(),p=e.defineComponent({__name:"NumberFlowGroup",setup(l){const u=new Set;let r=!1;const a=(o,s)=>{u.add(o),e.watch(s,async()=>{r||(r=!0,u.forEach(async t=>{var m;!t.value||!t.value.created||(t.value.willUpdate(),await e.nextTick(),(m=t.value)==null||m.didUpdate())}),await e.nextTick(),r=!1)}),e.onUnmounted(()=>{u.delete(o)})};return e.provide(f,a),(o,s)=>e.renderSlot(o.$slots,"default")}}),g=["manual","trend","continuous","animated","transformTiming","spinTiming","opacityTiming","respectMotionPreference","data-will-change","innerHTML","parts"],v=e.defineComponent({inheritAttrs:!1,__name:"index",props:{transformTiming:{default:()=>n.NumberFlowLite.defaultProps.transformTiming},spinTiming:{default:()=>n.NumberFlowLite.defaultProps.spinTiming},opacityTiming:{default:()=>n.NumberFlowLite.defaultProps.opacityTiming},animated:{type:Boolean,default:()=>n.NumberFlowLite.defaultProps.animated},respectMotionPreference:{type:Boolean,default:()=>n.NumberFlowLite.defaultProps.respectMotionPreference},trend:{type:[Boolean,String],default:()=>n.NumberFlowLite.defaultProps.trend},continuous:{type:Boolean,default:()=>n.NumberFlowLite.defaultProps.continuous},locales:{},format:{},value:{},willChange:{type:Boolean,default:!1}},emits:["animationsstart","animationsfinish"],setup(l,{expose:u,emit:r}){const a=e.ref();u({el:a});const o=r,s=e.computed(()=>new Intl.NumberFormat(l.locales,l.format)),t=e.computed(()=>n.partitionParts(l.value,s.value)),m=e.inject(f,void 0);return m==null||m(a,t),(i,d)=>(e.openBlock(),e.createElementBlock("number-flow-vue",e.mergeProps({ref_key:"el",ref:a},i.$attrs,{manual:!!e.unref(m),trend:i.trend,continuous:i.continuous,animated:i.animated,transformTiming:i.transformTiming,spinTiming:i.spinTiming,opacityTiming:i.opacityTiming,respectMotionPreference:i.respectMotionPreference,"data-will-change":i.willChange?"":void 0,innerHTML:e.unref(n.render)({formatted:t.value.formatted,willChange:i.willChange}),onAnimationsstart:d[0]||(d[0]=c=>o("animationsstart")),onAnimationsfinish:d[1]||(d[1]=c=>o("animationsfinish")),parts:t.value}),null,16,g))}});n.define("number-flow-vue",n.NumberFlowLite);function w({respectMotionPreference:l=!0}={}){const u=e.ref(n.canAnimate),r=e.ref(!1);return e.onMounted(()=>{var a;u.value=n.canAnimate,r.value=((a=n.prefersReducedMotion)==null?void 0:a.matches)??!1}),e.watchEffect(a=>{var s;if(!e.toValue(l))return;const o=({matches:t})=>{r.value=t};(s=n.prefersReducedMotion)==null||s.addEventListener("change",o),a(()=>{var t;(t=n.prefersReducedMotion)==null||t.removeEventListener("change",o)})}),e.computed(()=>u.value&&(!e.toValue(l)||!r.value))}Object.defineProperty(exports,"NumberFlowElement",{enumerable:!0,get:()=>n.NumberFlowLite});exports.NumberFlowGroup=p;exports.default=v;exports.useCanAnimate=w; | ||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),n=require("number-flow"),f=Symbol(),p=e.defineComponent({__name:"NumberFlowGroup",setup(r){const l=new Set;let u=!1;const a=(i,s)=>{l.add(i),e.watch(s,async()=>{u||(u=!0,l.forEach(async t=>{var m;!t.value||!t.value.created||(t.value.willUpdate(),await e.nextTick(),(m=t.value)==null||m.didUpdate())}),await e.nextTick(),u=!1)}),e.onUnmounted(()=>{l.delete(i)})};return e.provide(f,a),(i,s)=>e.renderSlot(i.$slots,"default")}}),g=["manual","trend","continuous","animated","transformTiming","spinTiming","opacityTiming","respectMotionPreference","data-will-change","innerHTML","data"],v=e.defineComponent({inheritAttrs:!1,__name:"index",props:{transformTiming:{default:()=>n.NumberFlowLite.defaultProps.transformTiming},spinTiming:{default:()=>n.NumberFlowLite.defaultProps.spinTiming},opacityTiming:{default:()=>n.NumberFlowLite.defaultProps.opacityTiming},animated:{type:Boolean,default:()=>n.NumberFlowLite.defaultProps.animated},respectMotionPreference:{type:Boolean,default:()=>n.NumberFlowLite.defaultProps.respectMotionPreference},trend:{type:[Boolean,String],default:()=>n.NumberFlowLite.defaultProps.trend},continuous:{type:Boolean,default:()=>n.NumberFlowLite.defaultProps.continuous},locales:{},format:{},value:{},prefix:{},suffix:{},willChange:{type:Boolean,default:!1}},emits:["animationsstart","animationsfinish"],setup(r,{expose:l,emit:u}){const a=e.ref();l({el:a});const i=u,s=e.computed(()=>new Intl.NumberFormat(r.locales,r.format)),t=e.computed(()=>n.formatToData(r.value,s.value,r.prefix,r.suffix)),m=e.inject(f,void 0);return m==null||m(a,t),(o,d)=>(e.openBlock(),e.createElementBlock("number-flow-vue",e.mergeProps({ref_key:"el",ref:a},o.$attrs,{manual:!!e.unref(m),trend:o.trend,continuous:o.continuous,animated:o.animated,transformTiming:o.transformTiming,spinTiming:o.spinTiming,opacityTiming:o.opacityTiming,respectMotionPreference:o.respectMotionPreference,"data-will-change":o.willChange?"":void 0,innerHTML:e.unref(n.render)({valueAsString:t.value.valueAsString,willChange:o.willChange}),onAnimationsstart:d[0]||(d[0]=c=>i("animationsstart")),onAnimationsfinish:d[1]||(d[1]=c=>i("animationsfinish")),data:t.value}),null,16,g))}});n.define("number-flow-vue",n.NumberFlowLite);function w({respectMotionPreference:r=!0}={}){const l=e.ref(n.canAnimate),u=e.ref(!1);return e.onMounted(()=>{var a;l.value=n.canAnimate,u.value=((a=n.prefersReducedMotion)==null?void 0:a.matches)??!1}),e.watchEffect(a=>{var s;if(!e.toValue(r))return;const i=({matches:t})=>{u.value=t};(s=n.prefersReducedMotion)==null||s.addEventListener("change",i),a(()=>{var t;(t=n.prefersReducedMotion)==null||t.removeEventListener("change",i)})}),e.computed(()=>l.value&&(!e.toValue(r)||!u.value))}Object.defineProperty(exports,"NumberFlowElement",{enumerable:!0,get:()=>n.NumberFlowLite});exports.NumberFlowGroup=p;exports.default=v;exports.useCanAnimate=w; |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"author": { | ||
@@ -47,3 +47,3 @@ "name": "Maxwell Barvian", | ||
"dependencies": { | ||
"number-flow": "0.3.7" | ||
"number-flow": "0.3.8" | ||
}, | ||
@@ -50,0 +50,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11970
159
+ Addedmagic-string@0.30.13(transitive)
+ Addednanoid@3.3.7(transitive)
+ Addednumber-flow@0.3.8(transitive)
- Removedmagic-string@0.30.14(transitive)
- Removednanoid@3.3.8(transitive)
- Removednumber-flow@0.3.7(transitive)
Updatednumber-flow@0.3.8