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AL,CAAW,WAAX,EAAwB,mBAAmB,KAAnB,CAAxB;AACD,SA5FM;AA6FP,gBA7FO,oBA6FG,WA7FH,EA6FwB,QA7FxB,EA6FiD,kBA7FjD,EA6F+F;AAAA;;AACpG,gBAAM,aAAa,KAAK,cAAL,CAAoB,YAApB,EAAkC;AACnD,uBAAO,EAAE,MAAM,KAAK,kBAAb;AAD4C,aAAlC,EAEhB,CAAC,KAAK,cAAL,CAAoB,OAApB,EAA6B,EAAE,KAAK,KAAK,SAAZ,EAA7B,EAAsD,QAAtD,CAAD,CAFgB,CAAnB;AAIA,gBAAM,iBAAiB;AACrB,sBAAM,OADe;AAErB,uBAAO;AACL,0BAAM,cAAC,CAAD;AAAA,+BAAsB,EAAE,OAAF,GAAY,CAAC,EAAd,IAAqB,OAAK,KAAL,CAAW,CAAX,EAAc,kBAAd,CAA1C;AAAA,qBADD;AAEL,2BAAO,eAAC,CAAD;AAAA,+BAAsB,EAAE,OAAF,GAAY,EAAb,IAAoB,OAAK,KAAL,CAAW,CAAC,CAAZ,EAAe,kBAAf,CAAzC;AAAA;AAFF;AAFc,aAAvB;AAQA,mBAAO,KAAK,cAAL,CAAoB,KAApB,EAA2B;AAChC,wCADgC;AAEhC;AACE,qDAAiC,KAAK;AADxC,mBAEK,KAAK,YAFV,CAFgC;AAMhC,oBAAK,CAAC,KAAK,QAAN,IAAkB,KAAK,UAAxB,GAAsC;AACxC,2BAAO,eAAC,CAAD;AAAA,+BAAmB,OAAK,KAAL,CAAW,CAAX,EAAc,kBAAd,CAAnB;AAAA;AADiC,iBAAtC,GAEA,SAR4B;AAShC,4BAAY,CAAC,cAAD;AAToB,aAA3B,EAUJ,CAAC,UAAD,CAVI,CAAP;AAWD;AArHM;AArDF,CAJM,C","sourcesContent":["import '../../../stylus/components/_date-picker-table.styl'\n\n// Directives\nimport Touch, { TouchWrapper } from '../../../directives/touch'\n\n// Mixins\nimport Colorable from '../../../mixins/colorable'\nimport Themeable from '../../../mixins/themeable'\n\n// Utils\nimport isDateAllowed, { AllowedDateFunction } from '../util/isDateAllowed'\nimport mixins from '../../../util/mixins'\n\n// Types\nimport { VNodeChildren } from 'vue'\nimport { PropValidator } from 'vue/types/options'\nimport { DatePickerFormatter } from '../util/createNativeLocaleFormatter'\nimport { DateEvents, DateEventColors, DateEventColorValue } from '../VDatePicker'\n\ntype CalculateTableDateFunction = (v: number) => string\n\nexport default mixins(\n Colorable,\n Themeable\n/* @vue/component */\n).extend({\n directives: { Touch },\n\n props: {\n allowedDates: Function as PropValidator,\n current: String,\n disabled: Boolean,\n format: Function as PropValidator,\n events: {\n type: [Array, Function, Object],\n default: () => null\n } as any as PropValidator,\n eventColor: {\n type: [Array, Function, Object, String],\n default: () => 'warning'\n } as any as PropValidator,\n locale: {\n type: String,\n default: 'en-us'\n },\n min: String,\n max: String,\n readonly: Boolean,\n scrollable: Boolean,\n tableDate: {\n type: String,\n required: true\n },\n value: [String, Array]\n },\n\n data: () => ({\n isReversing: false\n }),\n\n computed: {\n computedTransition (): string {\n return (this.isReversing === !this.$vuetify.rtl) ? 'tab-reverse-transition' : 'tab-transition'\n },\n displayedMonth (): number {\n return Number(this.tableDate.split('-')[1]) - 1\n },\n displayedYear (): number {\n return Number(this.tableDate.split('-')[0])\n }\n },\n\n watch: {\n tableDate (newVal: string, oldVal: string) {\n this.isReversing = newVal < oldVal\n }\n },\n\n methods: {\n genButtonClasses (isAllowed: boolean, isFloating: boolean, isSelected: boolean, isCurrent: boolean) {\n return {\n 'v-btn--active': isSelected,\n 'v-btn--flat': !isSelected,\n 'v-btn--icon': isSelected && isAllowed && isFloating,\n 'v-btn--floating': isFloating,\n 'v-btn--depressed': !isFloating && isSelected,\n 'v-btn--disabled': !isAllowed || (this.disabled && isSelected),\n 'v-btn--outline': isCurrent && !isSelected,\n ...this.themeClasses\n }\n },\n genButtonEvents (value: string, isAllowed: boolean, mouseEventType: string) {\n if (this.disabled) return undefined\n\n return {\n click: () => {\n isAllowed && !this.readonly && this.$emit('input', value)\n this.$emit(`click:${mouseEventType}`, value)\n },\n dblclick: () => this.$emit(`dblclick:${mouseEventType}`, value)\n }\n },\n genButton (value: string, isFloating: boolean, mouseEventType: string, formatter: DatePickerFormatter) {\n const isAllowed = isDateAllowed(value, this.min, this.max, this.allowedDates)\n const isSelected = value === this.value || (Array.isArray(this.value) && this.value.indexOf(value) !== -1)\n const isCurrent = value === this.current\n const setColor = isSelected ? this.setBackgroundColor : this.setTextColor\n const color = (isSelected || isCurrent) && (this.color || 'accent')\n\n return this.$createElement('button', setColor(color, {\n staticClass: 'v-btn',\n 'class': this.genButtonClasses(isAllowed, isFloating, isSelected, isCurrent),\n attrs: {\n type: 'button'\n },\n domProps: {\n disabled: this.disabled || !isAllowed\n },\n on: this.genButtonEvents(value, isAllowed, mouseEventType)\n }), [\n this.$createElement('div', {\n staticClass: 'v-btn__content'\n }, [formatter(value)]),\n this.genEvents(value)\n ])\n },\n getEventColors (date: string) {\n const arrayize = (v: string | string[]) => Array.isArray(v) ? v : [v]\n let eventData: boolean | DateEventColorValue\n let eventColors: string[] = []\n\n if (Array.isArray(this.events)) {\n eventData = this.events.includes(date)\n } else if (this.events instanceof Function) {\n eventData = this.events(date) || false\n } else if (this.events) {\n eventData = this.events[date] || false\n } else {\n eventData = false\n }\n\n if (!eventData) {\n return []\n } else if (eventData !== true) {\n eventColors = arrayize(eventData)\n } else if (typeof this.eventColor === 'string') {\n eventColors = [this.eventColor]\n } else if (typeof this.eventColor === 'function') {\n eventColors = arrayize(this.eventColor(date))\n } else if (Array.isArray(this.eventColor)) {\n eventColors = this.eventColor\n } else {\n eventColors = arrayize(this.eventColor[date])\n }\n\n return eventColors.filter(v => v)\n },\n genEvents (date: string) {\n const eventColors = this.getEventColors(date)\n\n return eventColors.length ? this.$createElement('div', {\n staticClass: 'v-date-picker-table__events'\n }, eventColors.map(color => this.$createElement('div', this.setBackgroundColor(color)))) : null\n },\n wheel (e: WheelEvent, calculateTableDate: CalculateTableDateFunction) {\n e.preventDefault()\n this.$emit('tableDate', calculateTableDate(e.deltaY))\n },\n touch (value: number, calculateTableDate: CalculateTableDateFunction) {\n this.$emit('tableDate', calculateTableDate(value))\n },\n genTable (staticClass: string, children: VNodeChildren, calculateTableDate: CalculateTableDateFunction) {\n const transition = this.$createElement('transition', {\n props: { name: this.computedTransition }\n }, [this.$createElement('table', { key: this.tableDate }, children)])\n\n const touchDirective = {\n name: 'touch',\n value: {\n left: (e: TouchWrapper) => (e.offsetX < -15) && this.touch(1, calculateTableDate),\n right: (e: TouchWrapper) => (e.offsetX > 15) && this.touch(-1, calculateTableDate)\n }\n }\n\n return this.$createElement('div', {\n staticClass,\n class: {\n 'v-date-picker-table--disabled': this.disabled,\n ...this.themeClasses\n },\n on: (!this.disabled && this.scrollable) ? {\n wheel: (e: WheelEvent) => this.wheel(e, calculateTableDate)\n } : undefined,\n directives: [touchDirective]\n }, [transition])\n }\n }\n})\n"],"sourceRoot":""}