This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/vuetify/es5/components/VRating/VRating.js.map
2019-08-11 20:48:02 +02:00

1 line
No EOL
11 KiB
Text

{"version":3,"sources":["../../../src/components/VRating/VRating.ts"],"names":[],"mappings":";;;;;;;AACA;;AAGA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AACA;;;;AAfA;AAGA;AAGA;AAOA;;AAiBA;eACe,qBACb,kBADa,EAEb,kBAFa,EAGb,mBAHa,EAIb,iBAJa,EAKb,kBALa,EAMb,MANa,CAMN;AACP,EAAA,IAAI,EAAE,UADC;AAGP,EAAA,KAAK,EAAE;AACL,IAAA,eAAe,EAAE;AACf,MAAA,IAAI,EAAE,MADS;AAEf,MAAA,OAAO,EAAE;AAFM,KADZ;AAKL,IAAA,KAAK,EAAE;AACL,MAAA,IAAI,EAAE,MADD;AAEL,MAAA,OAAO,EAAE;AAFJ,KALF;AASL,IAAA,SAAS,EAAE,OATN;AAUL,IAAA,KAAK,EAAE,OAVF;AAWL,IAAA,SAAS,EAAE;AACT,MAAA,IAAI,EAAE,MADG;AAET,MAAA,OAAO,EAAE;AAFA,KAXN;AAeL,IAAA,QAAQ,EAAE;AACR,MAAA,IAAI,EAAE,MADE;AAER,MAAA,OAAO,EAAE;AAFD,KAfL;AAmBL,IAAA,QAAQ,EAAE;AACR,MAAA,IAAI,EAAE,MADE;AAER,MAAA,OAAO,EAAE;AAFD,KAnBL;AAuBL,IAAA,cAAc,EAAE,OAvBX;AAwBL,IAAA,KAAK,EAAE,OAxBF;AAyBL,IAAA,MAAM,EAAE;AACN,MAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CADA;AAEN,MAAA,OAAO,EAAE;AAFH,KAzBH;AA6BL,IAAA,QAAQ,EAAE,OA7BL;AA8BL,IAAA,IAAI,EAAE,CAAC,MAAD,EAAS,MAAT,CA9BD;AA+BL,IAAA,KAAK,EAAE;AACL,MAAA,IA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lB,EAAiC,GAAjC,CAAqC,UAAA,CAAC;AAAA,aAAI,MAAI,CAAC,OAAL,CAAa,CAAb,CAAJ;AAAA,KAAtC,CAAjB;AAEA,WAAO,CAAC,CAAC,KAAD,EAAQ;AACd,MAAA,WAAW,EAAE,UADC;AAEd,MAAA,KAAK,EAAE;AACL,8BAAsB,KAAK,QADtB;AAEL,2BAAmB,KAAK;AAFnB;AAFO,KAAR,EAML,QANK,CAAR;AAOD;AA9LM,CANM,C","sourcesContent":["// Styles\nimport './VRating.sass'\n\n// Components\nimport VIcon from '../VIcon'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\nimport Delayable from '../../mixins/delayable'\nimport Sizeable from '../../mixins/sizeable'\nimport Rippleable from '../../mixins/rippleable'\nimport Themeable from '../../mixins/themeable'\n\n// Utilities\nimport { createRange } from '../../util/helpers'\nimport mixins from '../../util/mixins'\n\n// Types\nimport { VNode, VNodeDirective, VNodeChildren } from 'vue'\n\ntype ItemSlotProps = {\n index: number\n value: number\n isFilled: boolean\n isHalfFilled?: boolean | undefined\n isHovered: boolean\n isHalfHovered?: boolean | undefined\n click: Function\n}\n\n/* @vue/component */\nexport default mixins(\n Colorable,\n Delayable,\n Rippleable,\n Sizeable,\n Themeable\n).extend({\n name: 'v-rating',\n\n props: {\n backgroundColor: {\n type: String,\n default: 'accent',\n },\n color: {\n type: String,\n default: 'primary',\n },\n clearable: Boolean,\n dense: Boolean,\n emptyIcon: {\n type: String,\n default: '$vuetify.icons.ratingEmpty',\n },\n fullIcon: {\n type: String,\n default: '$vuetify.icons.ratingFull',\n },\n halfIcon: {\n type: String,\n default: '$vuetify.icons.ratingHalf',\n },\n halfIncrements: Boolean,\n hover: Boolean,\n length: {\n type: [Number, String],\n default: 5,\n },\n readonly: Boolean,\n size: [Number, String],\n value: {\n type: Number,\n default: 0,\n },\n },\n\n data () {\n return {\n hoverIndex: -1,\n internalValue: this.value,\n }\n },\n\n computed: {\n directives (): VNodeDirective[] {\n if (this.readonly || !this.ripple) return []\n\n return [{\n name: 'ripple',\n value: { circle: true },\n } as VNodeDirective]\n },\n iconProps (): object {\n const {\n dark,\n medium,\n large,\n light,\n small,\n size,\n xLarge,\n } = this.$props\n\n return {\n dark,\n medium,\n large,\n light,\n size,\n small,\n xLarge,\n }\n },\n isHovering (): boolean {\n return this.hover && this.hoverIndex >= 0\n },\n },\n\n watch: {\n internalValue (val) {\n val !== this.value && this.$emit('input', val)\n },\n value (val) {\n this.internalValue = val\n },\n },\n\n methods: {\n createClickFn (i: number): Function {\n return (e: MouseEvent) => {\n if (this.readonly) return\n\n const newValue = this.genHoverIndex(e, i)\n if (this.clearable && this.internalValue === newValue) {\n this.internalValue = 0\n } else {\n this.internalValue = newValue\n }\n }\n },\n createProps (i: number): ItemSlotProps {\n const props: ItemSlotProps = {\n index: i,\n value: this.internalValue,\n click: this.createClickFn(i),\n isFilled: Math.floor(this.internalValue) > i,\n isHovered: Math.floor(this.hoverIndex) > i,\n }\n\n if (this.halfIncrements) {\n props.isHalfHovered = !props.isHovered && (this.hoverIndex - i) % 1 > 0\n props.isHalfFilled = !props.isFilled && (this.internalValue - i) % 1 > 0\n }\n\n return props\n },\n genHoverIndex (e: MouseEvent, i: number) {\n return i + (this.isHalfEvent(e) ? 0.5 : 1)\n },\n getIconName (props: ItemSlotProps): string {\n const isFull = this.isHovering ? props.isHovered : props.isFilled\n const isHalf = this.isHovering ? props.isHalfHovered : props.isHalfFilled\n\n return isFull ? this.fullIcon : isHalf ? this.halfIcon : this.emptyIcon\n },\n getColor (props: ItemSlotProps): string {\n if (this.isHovering) {\n if (props.isHovered || props.isHalfHovered) return this.color\n } else {\n if (props.isFilled || props.isHalfFilled) return this.color\n }\n\n return this.backgroundColor\n },\n isHalfEvent (e: MouseEvent): boolean {\n if (this.halfIncrements) {\n const rect = e.target && (e.target as HTMLElement).getBoundingClientRect()\n if (rect && (e.pageX - rect.left) < rect.width / 2) return true\n }\n\n return false\n },\n onMouseEnter (e: MouseEvent, i: number): void {\n this.runDelay('open', () => {\n this.hoverIndex = this.genHoverIndex(e, i)\n })\n },\n onMouseLeave (): void {\n this.runDelay('close', () => (this.hoverIndex = -1))\n },\n genItem (i: number): VNode | VNodeChildren | string {\n const props = this.createProps(i)\n\n if (this.$scopedSlots.item) return this.$scopedSlots.item(props)\n\n const listeners: Record<string, Function> = {\n click: props.click,\n }\n\n if (this.hover) {\n listeners.mouseenter = (e: MouseEvent) => this.onMouseEnter(e, i)\n listeners.mouseleave = this.onMouseLeave\n\n if (this.halfIncrements) {\n listeners.mousemove = (e: MouseEvent) => this.onMouseEnter(e, i)\n }\n }\n\n return this.$createElement(VIcon, this.setTextColor(this.getColor(props), {\n directives: this.directives,\n props: this.iconProps,\n on: listeners,\n }), [this.getIconName(props)])\n },\n },\n\n render (h): VNode {\n const children = createRange(Number(this.length)).map(i => this.genItem(i))\n\n return h('div', {\n staticClass: 'v-rating',\n class: {\n 'v-rating--readonly': this.readonly,\n 'v-rating--dense': this.dense,\n },\n }, children)\n },\n})\n"],"sourceRoot":"","file":"VRating.js"}