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,2BAAO,4BADF;AAEL,6BAAY,KAAK,WAAjB,SAAgC,KAAK,WAArC,SAAoD,IAAI,KAAK,WAA7D,SAA4E,IAAI,KAAK;AAFhF;AAFO,aAAT,EAMJ,QANI,CAAP;AAOD;AA5BM,KA3F6B;AA0HtC,UA1HsC,kBA0H9B,CA1H8B,EA0H7B;AACP,YAAM,OAAO,EAAE,KAAF,EAAS,EAAE,aAAa,2BAAf,EAAT,EAAuD,KAAK,MAAL,CAAY,OAAnE,CAAb;AACA,YAAM,MAAM,KAAK,MAAL,CAAY,CAAZ,CAAZ;AAEA,eAAO,EAAE,KAAF,EAAS,KAAK,YAAL,CAAkB,KAAK,KAAvB,EAA8B;AAC5C,yBAAa,qBAD+B;AAE5C,mBAAO;AACL,wBAAQ,aADH;AAEL,iCAAiB,CAFZ;AAGL,iCAAiB,GAHZ;AAIL,iCAAiB,KAAK,aAAL,GAAqB,SAArB,GAAiC,KAAK;AAJlD,aAFqC;AAQ5C,mBAAO,KAAK,OARgC;AAS5C,mBAAO,KAAK,MATgC;AAU5C,gBAAI,KAAK;AAVmC,SAA9B,CAAT,EAWH,CAAC,GAAD,EAAM,IAAN,CAXG,CAAP;AAYD;AA1IqC,CAAzB,C","sourcesContent":["import '../../stylus/components/_progress-circular.styl'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\nimport mixins from '../../util/mixins'\n\n// Types\nimport { CreateElement, VNode, VNodeChildrenArrayContents } from 'vue'\n\n/* @vue/component */\nexport default mixins(Colorable).extend({\n name: 'v-progress-circular',\n\n props: {\n button: Boolean,\n\n indeterminate: Boolean,\n\n rotate: {\n type: [Number, String],\n default: 0\n },\n\n size: {\n type: [Number, String],\n default: 32\n },\n\n width: {\n type: [Number, String],\n default: 4\n },\n\n value: {\n type: [Number, String],\n default: 0\n }\n },\n\n computed: {\n calculatedSize (): number {\n return Number(this.size) + (this.button ? 8 : 0)\n },\n\n circumference (): number {\n return 2 * Math.PI * this.radius\n },\n\n classes (): object {\n return {\n 'v-progress-circular--indeterminate': this.indeterminate,\n 'v-progress-circular--button': this.button\n }\n },\n\n normalizedValue (): number {\n if (this.value < 0) {\n return 0\n }\n\n if (this.value > 100) {\n return 100\n }\n\n return parseFloat(this.value)\n },\n\n radius (): number {\n return 20\n },\n\n strokeDashArray (): number {\n return Math.round(this.circumference * 1000) / 1000\n },\n\n strokeDashOffset (): string {\n return ((100 - this.normalizedValue) / 100) * this.circumference + 'px'\n },\n\n strokeWidth (): number {\n return Number(this.width) / +this.size * this.viewBoxSize * 2\n },\n\n styles (): object {\n return {\n height: `${this.calculatedSize}px`,\n width: `${this.calculatedSize}px`\n }\n },\n\n svgStyles (): object {\n return {\n transform: `rotate(${Number(this.rotate)}deg)`\n }\n },\n\n viewBoxSize (): number {\n return this.radius / (1 - Number(this.width) / +this.size)\n }\n },\n\n methods: {\n genCircle (h: CreateElement, name: string, offset: string | number): VNode {\n return h('circle', {\n class: `v-progress-circular__${name}`,\n attrs: {\n fill: 'transparent',\n cx: 2 * this.viewBoxSize,\n cy: 2 * this.viewBoxSize,\n r: this.radius,\n 'stroke-width': this.strokeWidth,\n 'stroke-dasharray': this.strokeDashArray,\n 'stroke-dashoffset': offset\n }\n })\n },\n genSvg (h: CreateElement): VNode {\n const children = [\n this.indeterminate || this.genCircle(h, 'underlay', 0),\n this.genCircle(h, 'overlay', this.strokeDashOffset)\n ] as VNodeChildrenArrayContents\n\n return h('svg', {\n style: this.svgStyles,\n attrs: {\n xmlns: 'http://www.w3.org/2000/svg',\n viewBox: `${this.viewBoxSize} ${this.viewBoxSize} ${2 * this.viewBoxSize} ${2 * this.viewBoxSize}`\n }\n }, children)\n }\n },\n\n render (h): VNode {\n const info = h('div', { staticClass: 'v-progress-circular__info' }, this.$slots.default)\n const svg = this.genSvg(h)\n\n return h('div', this.setTextColor(this.color, {\n staticClass: 'v-progress-circular',\n attrs: {\n 'role': 'progressbar',\n 'aria-valuemin': 0,\n 'aria-valuemax': 100,\n 'aria-valuenow': this.indeterminate ? undefined : this.normalizedValue\n },\n class: this.classes,\n style: this.styles,\n on: this.$listeners\n }), [svg, info])\n }\n})\n"],"sourceRoot":""}
|