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/lib/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":"AAAA;AACA,OAAO,8CAAP,C,CAEA;;AACA,OAAO,KAAP,MAAkB,UAAlB,C,CAEA;;AACA,OAAO,SAAP,MAAsB,wBAAtB;AACA,OAAO,SAAP,MAAsB,wBAAtB;AACA,OAAO,QAAP,MAAqB,uBAArB;AACA,OAAO,UAAP,MAAuB,yBAAvB;AACA,OAAO,SAAP,MAAsB,wBAAtB,C,CAEA;;AACA,SAAS,WAAT,QAA4B,oBAA5B;AACA,OAAO,MAAP,MAAmB,mBAAnB;AAeA;;AACA,eAAe,MAAM,CACnB,SADmB,EAEnB,SAFmB,EAGnB,UAHmB,EAInB,QAJmB,EAKnB,SALmB,CAAN,CAMb,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;AAy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,MAAA,KAAK,EAAE;AACL,8BAAsB,KAAK,QADtB;AAEL,2BAAmB,KAAK;AAFnB;AAFO,KAAR,EAML,QANK,CAAR;AAOD;;AA9LM,CANM,CAAf","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"}