UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

1 lines 1.49 kB
{"version":3,"file":"skeleton.cjs","names":["SKELETON_RIPPLE_DURATION"],"sources":["../../../common/mixins/skeleton.js"],"sourcesContent":["import { SKELETON_RIPPLE_DURATION } from '@/components/skeleton/skeleton_constants';\n\n/**\n * @displayName Skeleton Animation Mixin\n */\nexport default {\n computed: {\n skeletonOffset () {\n const skeletonText = this.$refs.skeleton;\n if (!skeletonText) { return this.offset; }\n const { top, height } = skeletonText.getBoundingClientRect();\n return top + (height / 2);\n },\n\n skeletonStyle () {\n const style = {};\n\n if (this.skeletonOffset === -1 || (!this.animate && this.animationDuration === -1)) {\n return style;\n }\n const animationDelay = this.skeletonOffset * SKELETON_RIPPLE_DURATION / 1000;\n const animationDuration = this.animationDuration === -1 ? 1000 : this.animationDuration;\n style.animationDelay = `${animationDelay}ms`;\n style.animationDuration = `${animationDuration}ms`;\n return style;\n },\n },\n};\n"],"mappings":"4JAKA,IAAA,EAAe,CACb,SAAU,CACR,gBAAkB,CAChB,IAAM,EAAe,KAAK,MAAM,SAChC,GAAI,CAAC,EAAgB,OAAO,KAAK,OACjC,GAAM,CAAE,MAAK,UAAW,EAAa,uBAAuB,CAC5D,OAAO,EAAO,EAAS,GAGzB,eAAiB,CACf,IAAM,EAAQ,EAAE,CAEhB,GAAI,KAAK,iBAAmB,IAAO,CAAC,KAAK,SAAW,KAAK,oBAAsB,GAC7E,OAAO,EAET,IAAM,EAAiB,KAAK,eAAiBA,EAAAA,yBAA2B,IAClE,EAAoB,KAAK,oBAAsB,GAAK,IAAO,KAAK,kBAGtE,MAFA,GAAM,eAAiB,GAAG,EAAe,IACzC,EAAM,kBAAoB,GAAG,EAAkB,IACxC,GAEV,CACF"}