@number-flow/vue
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -14,2 +14,20 @@ import { ComponentOptionsMixin } from 'vue'; | ||
declare const __VLS_component: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>; | ||
declare function __VLS_template(): { | ||
slots: { | ||
default?(_: {}): any; | ||
}; | ||
refs: {}; | ||
attrs: Partial<{}>; | ||
}; | ||
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>; | ||
declare type __VLS_WithTemplateSlots<T, S> = T & { | ||
new (): { | ||
$slots: S; | ||
}; | ||
}; | ||
declare const _default: DefineComponent<Props, { | ||
@@ -30,2 +48,4 @@ el: Ref<NumberFlowElement | undefined, NumberFlowElement | undefined>; | ||
export declare const NumberFlowGroup: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>; | ||
declare type Props = Partial<Props_2> & { | ||
@@ -32,0 +52,0 @@ locales?: Intl.LocalesArgument; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),e=require("number-flow"),d=["trend","continuous","animated","transformTiming","spinTiming","opacityTiming","respectMotionPreference","data-will-change","innerHTML","parts"],c=n.defineComponent({inheritAttrs:!1,__name:"index",props:{transformTiming:{default:()=>e.NumberFlowLite.defaultProps.transformTiming},spinTiming:{default:()=>e.NumberFlowLite.defaultProps.spinTiming},opacityTiming:{default:()=>e.NumberFlowLite.defaultProps.opacityTiming},animated:{type:Boolean,default:()=>e.NumberFlowLite.defaultProps.animated},respectMotionPreference:{type:Boolean,default:()=>e.NumberFlowLite.defaultProps.respectMotionPreference},trend:{type:[Boolean,String],default:()=>e.NumberFlowLite.defaultProps.trend},continuous:{type:Boolean,default:()=>e.NumberFlowLite.defaultProps.continuous},locales:{},format:{},value:{},willChange:{type:Boolean,default:!1}},emits:["animationsstart","animationsfinish"],setup(a,{expose:l,emit:r}){const i=n.ref();l({el:i});const u=r,s=n.computed(()=>new Intl.NumberFormat(a.locales,a.format)),o=n.computed(()=>e.partitionParts(a.value,s.value));return(t,m)=>(n.openBlock(),n.createElementBlock("number-flow-vue",n.mergeProps({ref_key:"el",ref:i},t.$attrs,{trend:t.trend,continuous:t.continuous,animated:t.animated,transformTiming:t.transformTiming,spinTiming:t.spinTiming,opacityTiming:t.opacityTiming,respectMotionPreference:t.respectMotionPreference,"data-will-change":t.willChange?"":void 0,innerHTML:n.unref(e.render)({formatted:o.value.formatted,willChange:t.willChange}),onAnimationsstart:m[0]||(m[0]=f=>u("animationsstart")),onAnimationsfinish:m[1]||(m[1]=f=>u("animationsfinish")),parts:o.value}),null,16,d))}});e.define("number-flow-vue",e.NumberFlowLite);function p({respectMotionPreference:a=!0}={}){const l=n.ref(e.canAnimate),r=n.ref(!1);return n.onMounted(()=>{var i;l.value=e.canAnimate,r.value=((i=e.prefersReducedMotion)==null?void 0:i.matches)??!1}),n.watchEffect(i=>{var s;if(!n.toValue(a))return;const u=({matches:o})=>{r.value=o};(s=e.prefersReducedMotion)==null||s.addEventListener("change",u),i(()=>{var o;(o=e.prefersReducedMotion)==null||o.removeEventListener("change",u)})}),n.computed(()=>l.value&&(!n.toValue(a)||!r.value))}Object.defineProperty(exports,"NumberFlowElement",{enumerable:!0,get:()=>e.NumberFlowLite});exports.default=c;exports.useCanAnimate=p; | ||
"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(s){const u=new Set;let l=!1;const o=(a,m)=>{u.add(a),e.watch(m,async()=>{l||(l=!0,u.forEach(t=>{var i;(i=t.value)==null||i.willUpdate()}),await e.nextTick(),u.forEach(t=>{var i;(i=t.value)==null||i.didUpdate()}),l=!1)}),e.onUnmounted(()=>{u.delete(a)})};return e.provide(f,o),(a,m)=>e.renderSlot(a.$slots,"default")}}),g=["manual","trend","continuous","animated","transformTiming","spinTiming","opacityTiming","respectMotionPreference","data-will-change","innerHTML","parts"],w=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(s,{expose:u,emit:l}){const o=e.ref();u({el:o});const a=l,m=e.computed(()=>new Intl.NumberFormat(s.locales,s.format)),t=e.computed(()=>n.partitionParts(s.value,m.value)),i=e.inject(f,void 0);return i==null||i(o,t),(r,d)=>(e.openBlock(),e.createElementBlock("number-flow-vue",e.mergeProps({ref_key:"el",ref:o},r.$attrs,{manual:!!e.unref(i),trend:r.trend,continuous:r.continuous,animated:r.animated,transformTiming:r.transformTiming,spinTiming:r.spinTiming,opacityTiming:r.opacityTiming,respectMotionPreference:r.respectMotionPreference,"data-will-change":r.willChange?"":void 0,innerHTML:e.unref(n.render)({formatted:t.value.formatted,willChange:r.willChange}),onAnimationsstart:d[0]||(d[0]=c=>a("animationsstart")),onAnimationsfinish:d[1]||(d[1]=c=>a("animationsfinish")),parts:t.value}),null,16,g))}});n.define("number-flow-vue",n.NumberFlowLite);function v({respectMotionPreference:s=!0}={}){const u=e.ref(n.canAnimate),l=e.ref(!1);return e.onMounted(()=>{var o;u.value=n.canAnimate,l.value=((o=n.prefersReducedMotion)==null?void 0:o.matches)??!1}),e.watchEffect(o=>{var m;if(!e.toValue(s))return;const a=({matches:t})=>{l.value=t};(m=n.prefersReducedMotion)==null||m.addEventListener("change",a),o(()=>{var t;(t=n.prefersReducedMotion)==null||t.removeEventListener("change",a)})}),e.computed(()=>u.value&&(!e.toValue(s)||!l.value))}Object.defineProperty(exports,"NumberFlowElement",{enumerable:!0,get:()=>n.NumberFlowLite});exports.NumberFlowGroup=p;exports.default=w;exports.useCanAnimate=v; |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"author": { | ||
@@ -9,0 +9,0 @@ "name": "Maxwell Barvian", |
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
11840
158