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/VDatePicker/mixins/date-picker-table.js.map
2019-08-11 20:48:02 +02:00

1 line
No EOL
12 KiB
Text

{"version":3,"sources":["../../../../src/components/VDatePicker/mixins/date-picker-table.ts"],"names":[],"mappings":";;;;;;;AAAA;;AAGA;;AAGA;;AACA;;AACA;;AAGA;;AACA;;;;;;;;;;gBAUe,qBACb,kBADa,EAEb,kBAFa,EAGb;AACF;AAJe,EAKb,MALa,CAKN;AACP,EAAA,UAAU,EAAE;AAAE,IAAA,KAAK,EAAL;AAAF,GADL;AAGP,EAAA,KAAK,EAAE;AACL,IAAA,YAAY,EAAE,QADT;AAEL,IAAA,OAAO,EAAE,MAFJ;AAGL,IAAA,QAAQ,EAAE,OAHL;AAIL,IAAA,MAAM,EAAE,QAJH;AAKL,IAAA,MAAM,EAAE;AACN,MAAA,IAAI,EAAE,CAAC,KAAD,EAAQ,QAAR,EAAkB,MAAlB,CADA;AAEN,MAAA,OAAO,EAAE;AAAA,eAAM,IAAN;AAAA;AAFH,KALH;AASL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,CAAC,KAAD,EAAQ,QAAR,EAAkB,MAAlB,EAA0B,MAA1B,CADI;AAEV,MAAA,OAAO,EAAE;AAAA,eAAM,SAAN;AAAA;AAFC,KATP;AAaL,IAAA,GAAG,EAAE,MAbA;AAcL,IAAA,GAAG,EAAE,MAdA;AAeL,IAAA,QAAQ,EAAE,OAfL;AAgBL,IAAA,UAAU,EAAE,OAhBP;AAiBL,IAAA,SAAS,EAAE;AACT,MAAA,IAAI,EAAE,MADG;AAET,MAAA,QAAQ,EAAE;AAFD,KAjBN;AAqBL,IAAA,KAAK,EAAE,CAAC,MAAD,EAAS,KAAT;AArBF,GAHA;AA2BP,EAAA,IAAI,EAAE;AAAA,WAAO;AACX,MAAA,WAAW,EAAE;AADF,KAAP;AAAA,GA3BC;AA+BP,EAA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B;AAAE,QAAA,GAAG,EAAE,KAAK;AAAZ,OAA7B,EAAsD,QAAtD,CAAD,CAFgB,CAAnB;AAIA,UAAM,cAAc,GAAG;AACrB,QAAA,IAAI,EAAE,OADe;AAErB,QAAA,KAAK,EAAE;AACL,UAAA,IAAI,EAAE,cAAC,CAAD;AAAA,mBAAsB,CAAC,CAAC,OAAF,GAAY,CAAC,EAAd,IAAqB,MAAI,CAAC,KAAL,CAAW,CAAX,EAAc,kBAAd,CAA1C;AAAA,WADD;AAEL,UAAA,KAAK,EAAE,eAAC,CAAD;AAAA,mBAAsB,CAAC,CAAC,OAAF,GAAY,EAAb,IAAoB,MAAI,CAAC,KAAL,CAAW,CAAC,CAAZ,EAAe,kBAAf,CAAzC;AAAA;AAFF;AAFc,OAAvB;AAQA,aAAO,KAAK,cAAL,CAAoB,KAApB,EAA2B;AAChC,QAAA,WAAW,EAAX,WADgC;AAEhC,QAAA,KAAK;AACH,2CAAiC,KAAK;AADnC,WAEA,KAAK,YAFL,CAF2B;AAMhC,QAAA,EAAE,EAAG,CAAC,KAAK,QAAN,IAAkB,KAAK,UAAxB,GAAsC;AACxC,UAAA,KAAK,EAAE,eAAC,CAAD;AAAA,mBAAmB,MAAI,CAAC,KAAL,CAAW,CAAX,EAAc,kBAAd,CAAnB;AAAA;AADiC,SAAtC,GAEA,SAR4B;AAShC,QAAA,UAAU,EAAE,CAAC,cAAD;AAToB,OAA3B,EAUJ,CAAC,UAAD,CAVI,CAAP;AAWD;AArHM;AAjDF,CALM,C","sourcesContent":["import '../VDatePickerTable.sass'\n\n// Directives\nimport Touch, { TouchWrapper } from '../../../directives/touch'\n\n// Mixins\nimport Colorable from '../../../mixins/colorable'\nimport Localable from '../../../mixins/localable'\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 Localable,\n Themeable\n/* @vue/component */\n).extend({\n directives: { Touch },\n\n props: {\n allowedDates: Function as PropValidator<AllowedDateFunction | undefined>,\n current: String,\n disabled: Boolean,\n format: Function as PropValidator<DatePickerFormatter | undefined>,\n events: {\n type: [Array, Function, Object],\n default: () => null,\n } as any as PropValidator<DateEvents>,\n eventColor: {\n type: [Array, Function, Object, String],\n default: () => 'warning',\n } as any as PropValidator<DateEventColors>,\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-size--default': !isFloating,\n 'v-btn--active': isSelected,\n 'v-btn--flat': !isAllowed || this.disabled,\n 'v-btn--text': isSelected === isCurrent,\n 'v-btn--rounded': isFloating,\n 'v-btn--disabled': !isAllowed || this.disabled,\n 'v-btn--outlined': 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('update:table-date', calculateTableDate(e.deltaY))\n },\n touch (value: number, calculateTableDate: CalculateTableDateFunction) {\n this.$emit('update:table-date', 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":"","file":"date-picker-table.js"}