Vulture/VApp/node_modules/vuetify/lib/components/VTimePicker/VTimePickerClock.mjs.map

1 line
18 KiB
Plaintext
Raw Normal View History

{"version":3,"file":"VTimePickerClock.mjs","names":["Colorable","Themeable","mixins","extend","name","props","allowedValues","Function","ampm","Boolean","disabled","double","format","type","default","val","max","Number","required","min","scrollable","readonly","rotate","step","value","data","inputValue","isDragging","valueOnMouseDown","valueOnMouseUp","computed","count","degreesPerUnit","roundCount","degrees","Math","PI","displayedValue","innerRadiusScale","watch","methods","wheel","e","preventDefault","delta","sign","deltaY","isAllowed","update","isInner","handScale","genValues","children","color","push","$createElement","setBackgroundColor","staticClass","class","style","getTransform","domProps","innerHTML","genHand","scale","angle","transform","i","x","y","getPosition","left","top","rotateRadians","sin","cos","onMouseDown","onDragMove","onMouseUp","stopPropagation","$emit","$refs","clock","width","getBoundingClientRect","innerWidth","innerClock","clientX","clientY","touches","center","coords","handAngle","round","insideClick","euclidean","checksCount","ceil","angleToValue","setMouseDownValue","p0","p1","dx","dy","sqrt","atan2","abs","render","h","themeClasses","on","undefined","mousedown","mouseup","mouseleave","touchstart","touchend","mousemove","touchmove","ref"],"sources":["../../../src/components/VTimePicker/VTimePickerClock.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable */\n\nimport './VTimePickerClock.sass'\n\n// Mixins\nimport Colorable from '../../mixins/colorable'\nimport Themeable from '../../mixins/themeable'\n\n// Types\nimport mixins, { ExtractVue } from '../../util/mixins'\nimport Vue, { VNode, PropType, VNodeData } from 'vue'\nimport { PropValidator } from 'vue/types/options'\n\ninterface Point {\n x: number\n y: number\n}\n\ninterface options extends Vue {\n $refs: {\n clock: HTMLElement\n innerClock: HTMLElement\n }\n}\n\nexport default mixins<options &\n/* eslint-disable indent */\n ExtractVue<[\n typeof Colorable,\n typeof Themeable\n ]>\n/* eslint-enable indent */\n>(\n Colorable,\n Themeable\n/* @vue/component */\n).extend({\n name: 'v-time-picker-clock',\n\n props: {\n allowedValues: Function as PropType<(value: number) => boolean>,\n ampm: Boolean,\n disabled: Boolean,\n double: Boolean,\n format: {\n type: Function,\n default: (val: string | number) => val,\n } as PropValidator<(val: string | number) => string | number>,\n max: {\n type: Number,\n required: true,\n },\n min: {\n type: Number,\n required: true,\n },\n scrollable: Boolean,\n readonly: Boolean,\n rotate: {\n type: Number,\n default: 0,\n },\n step: {\n type: Number,\n default: 1,\n },\n value: Number,\n },\n\n data () {\n return {\n inputValue: this.value,\n isDragging: false,\n valueOnMouseDown: null as number | null,\n valueOnMouseUp: null as number | null,\n }\n },\n\n computed: {\n count (): number {\n return this.max - this.min + 1\n },\n degreesPerUnit (): number {\n return 360 / this.roundCount\n },\n degrees (): number {\n return this.degreesPerUnit * Math.PI / 180\n },\n displayedValue (): number {\n return this.value == null ? this.min : this.value\n },\n innerRadiusScale (): number {\n return 0.62\n },\n roundCount (): number {\n return this.double ? (this.count / 2) : this.count\n },\n },\n\n watch: {\n value (value) {\n this.inputValue = value\n },\n },\n\n methods: {\n wheel (e: WheelEvent) {\n e.preventDefault()\n\n const delta = Math.sign(-e.deltaY || 1)\n let value = this.displayedValue\n do {\n value = value + delta\n value = (value - this.min + this.count) % this.count + this.min\n } while (!this.isAllowed(value) && value !== this.displayedValue)\n\n if (value !== this.displayedValue) {\n this.update(value)\n }\n },\n isInner (value: number) {\n return this.double && (value - this.min >= this.roundCoun