@dialpad/dialtone-vue
Version:
Vue component library for Dialpad's design system Dialtone
1 lines • 3.14 kB
Source Map (JSON)
{"version":3,"file":"skeleton-shape.cjs","sources":["../../../components/skeleton/skeleton-shape.vue"],"sourcesContent":["<template>\n <div\n ref=\"skeleton\"\n data-qa=\"skeleton-shape\"\n :class=\"[\n 'd-skeleton-placeholder',\n SKELETON_SHAPES[shape],\n {\n 'd-skeleton-placeholder--animate': animate,\n },\n contentClass,\n ]\"\n :style=\"shapeStyles\"\n />\n</template>\n\n<script>\nimport SkeletonAnimation from '@/common/mixins/skeleton';\nimport {\n SKELETON_SHAPES,\n SKELETON_SHAPE_SIZES,\n} from './skeleton_constants';\n\nexport default {\n name: 'DtSkeletonShape',\n\n mixins: [SkeletonAnimation],\n\n props: {\n /**\n * Defines the shape of the skeleton, accepts circle or square.\n * @values circle, square\n */\n shape: {\n type: String,\n default: 'circle',\n validator: shape => Object.keys(SKELETON_SHAPES).includes(shape),\n },\n\n /**\n * Size of the shape\n * @values xs, sm, md, lg, xl\n */\n size: {\n type: String,\n default: 'md',\n },\n\n /**\n * Duration time of the animation (ms), set -1 for an infinite animation.\n */\n animationDuration: {\n type: Number,\n default: -1,\n },\n\n /**\n * This property has higher priority than \"option.animate\"\n * @values true, false\n */\n animate: {\n type: Boolean,\n default: true,\n },\n\n /**\n * RippleDuration controls how long the delay is for the animation of a\n * placeholder 1000 pixels from the top of the page. Each placeholder\n * from the top down will have a delay duration from 0 to this offset.\n * The delay of each placeholder animation is based on how far down the page\n * the placeholder is rendered. This is a linear relationship. The unit\n * is milliseconds.\n */\n offset: {\n type: Number,\n default: 1,\n },\n\n /**\n * Additional class name for the content.\n */\n contentClass: {\n type: [String, Object, Array],\n default: '',\n },\n },\n\n data () {\n return {\n SKELETON_SHAPES,\n };\n },\n\n computed: {\n shapeStyles () {\n const size = SKELETON_SHAPE_SIZES[this.size] || this.size;\n return {\n ...this.skeletonStyle,\n 'min-width': size,\n 'max-width': size,\n 'min-height': size,\n 'max-height': size,\n };\n },\n },\n};\n</script>\n"],"names":["_sfc_main","SkeletonAnimation","shape","SKELETON_SHAPES","size","SKELETON_SHAPE_SIZES"],"mappings":"8PAuBAA,EAAA,CACA,KAAA,kBAEA,OAAA,CAAAC,EAAAA,OAAA,EAEA,MAAA,CAKA,MAAA,CACA,KAAA,OACA,QAAA,SACA,UAAAC,GAAA,OAAA,KAAAC,EAAAA,eAAA,EAAA,SAAAD,CAAA,CACA,EAMA,KAAA,CACA,KAAA,OACA,QAAA,IACA,EAKA,kBAAA,CACA,KAAA,OACA,QAAA,EACA,EAMA,QAAA,CACA,KAAA,QACA,QAAA,EACA,EAUA,OAAA,CACA,KAAA,OACA,QAAA,CACA,EAKA,aAAA,CACA,KAAA,CAAA,OAAA,OAAA,KAAA,EACA,QAAA,EACA,CACA,EAEA,MAAA,CACA,MAAA,CACA,gBAAAC,EAAAA,eACA,CACA,EAEA,SAAA,CACA,aAAA,CACA,MAAAC,EAAAC,EAAAA,qBAAA,KAAA,IAAA,GAAA,KAAA,KACA,MAAA,CACA,GAAA,KAAA,cACA,YAAAD,EACA,YAAAA,EACA,aAAAA,EACA,aAAAA,CACA,CACA,CACA,CACA"}