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AAL,CAAe,CAAf,EAAkB,GAAlB,CAAsB,KAAK,gBAA3B,CAAP;AACD,SA3JM;AA4JP,wBA5JO,4BA4JW,QA5JX,EA4J+B;AACpC,gBAAM,SAA6B,4BAAc,KAAK,cAAnB,CAAnC;AACA,gBAAM,QAAiB,KAAK,cAA5B;AACA,gBAAM,SAAS,KAAK,iBAAL,IAA0B,KAAK,wBAA9C;AACA,gBAAM,OAAO,OAAO,QAAP,CAAb;AACA,gBAAM,QAAQ,OAAO,KAAK,iBAAL,CAAuB,QAAvB,EAAiC,KAAjC,CAAP,GAAiD,SAA/D;AAEA,mBAAO,KAAK,cAAL,CAAoB,KAApB,EAA2B;AAChC,qBAAK,SAAS,IADkB;AAEhC,6BAAa,4BAFmB;AAGhC,uBAAO;AACL;AADK;AAHyB,aAA3B,EAMJ,CACD,KAAK,cAAL,CAAoB,KAApB,EAA2B;AACzB,6BAAa;AADY,aAA3B,EAEG,KAFH,CADC,CANI,CAAP;AAWD;AA9KM,KAtBiC;AAuM1C,UAvM0C,kBAuMlC,CAvMkC,EAuMjC;AACP,eAAO,EAAE,KAAF,EAAS;AACd,mBAAO,KAAK,OADE;AAEd,sBAAU;AACR,2BAAW,mBAAC,CAAD,EAAkB;AAC3B,sBAAE,cAAF;AACD;AAHO,aAFI;AAOd,wBAAY,CAAC;AACX,2BAAW,EAAE,OAAO,IAAT,EADA;AAEX,sBAAM,QAFK;AAGX,uBAAO,KAAK;AAHD,aAAD;AAPE,SAAT,EAYJ,CACD,CAAC,KAAK,UAAN,GAAmB,KAAK,OAAL,EAAnB,GAAoC,EADnC,EAED,KAAK,OAAL,EAFC,CAZI,CAAP;AAgBD;AAxNyC,CAA7B,C","sourcesContent":["// Styles\nimport '../../stylus/components/_calendar-daily.styl'\n\n// Types\nimport { VNode, VNodeChildren } from 'vue'\n\n// Directives\nimport Resize from '../../directives/resize'\n\n// Mixins\nimport CalendarWithIntervals from './mixins/calendar-with-intervals'\n\n// Util\nimport { convertToUnit } from '../../util/helpers'\nimport { VTimestamp } from './util/timestamp'\n\n/* @vue/component */\nexport default CalendarWithIntervals.extend({\n name: 'v-calendar-daily',\n\n directives: { Resize },\n\n data: () => ({\n scrollPush: 0\n }),\n\n computed: {\n classes (): object {\n return {\n 'v-calendar-daily': true,\n ...this.themeClasses\n }\n }\n },\n\n mounted () {\n this.init()\n },\n\n methods: {\n init () {\n this.$nextTick(this.onResize)\n },\n onResize () {\n this.scrollPush = this.getScrollPush()\n },\n getScrollPush (): number {\n const area = this.$refs.scrollArea as HTMLElement\n const pane = this.$refs.pane as HTMLElement\n\n return area && pane ? (area.offsetWidth - pane.offsetWidth) : 0\n },\n genHead (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-calendar-daily__head',\n style: {\n marginRight: this.scrollPush + 'px'\n }\n }, [\n this.genHeadIntervals(),\n ...this.genHeadDays()\n ])\n },\n genHeadIntervals (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-calendar-daily__intervals-head'\n })\n },\n genHeadDays (): VNode[] {\n return this.days.map(this.genHeadDay)\n },\n genHeadDay (day: VTimestamp): VNode {\n const slot = this.$scopedSlots.dayHeader\n\n return this.$createElement('div', {\n key: day.date,\n staticClass: 'v-calendar-daily_head-day',\n class: this.getRelativeClasses(day),\n on: this.getDefaultMouseEventHandlers(':day', _e => {\n return this.getSlotScope(day)\n })\n }, [\n this.genHeadWeekday(day),\n this.genHeadDayLabel(day),\n slot ? slot(day) : ''\n ])\n },\n genHeadWeekday (day: VTimestamp): VNode {\n const color = day.present ? this.color : undefined\n\n return this.$createElement('div', this.setTextColor(color, {\n staticClass: 'v-calendar-daily_head-weekday'\n }), this.weekdayFormatter(day, this.shortWeekdays))\n },\n genHeadDayLabel (day: VTimestamp): VNode {\n const color = day.present ? this.color : undefined\n\n return this.$createElement('div', this.setTextColor(color, {\n staticClass: 'v-calendar-daily_head-day-label',\n on: this.getMouseEventHandlers({\n 'click:date': { event: 'click', stop: true },\n 'contextmenu:date': { event: 'contextmenu', stop: true, prevent: true, result: false }\n }, _e => {\n return day\n })\n }), this.dayFormatter(day, false))\n },\n genBody (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-calendar-daily__body'\n }, [\n this.genScrollArea()\n ])\n },\n genScrollArea (): VNode {\n return this.$createElement('div', {\n ref: 'scrollArea',\n staticClass: 'v-calendar-daily__scroll-area'\n }, [\n this.genPane()\n ])\n },\n genPane (): VNode {\n return this.$createElement('div', {\n ref: 'pane',\n staticClass: 'v-calendar-daily__pane',\n style: {\n height: convertToUnit(this.bodyHeight)\n }\n }, [\n this.genDayContainer()\n ])\n },\n genDayContainer (): VNode {\n return this.$createElement('div', {\n staticClass: 'v-calendar-daily__day-container'\n }, [\n this.genBodyIntervals(),\n ...this.genDays()\n ])\n },\n genDays (): VNode[] {\n return this.days.map(this.genDay)\n },\n genDay (day: VTimestamp, index: number): VNode {\n const slot = this.$scopedSlots.dayBody\n const scope = this.getSlotScope(day)\n\n return this.$createElement('div', {\n key: day.date,\n staticClass: 'v-calendar-daily__day',\n class: this.getRelativeClasses(day),\n on: this.getDefaultMouseEventHandlers(':time', e => {\n return this.getSlotScope(this.getTimestampAtEvent(e, day))\n })\n }, [\n ...this.genDayIntervals(index),\n slot ? slot(scope) : ''\n ])\n },\n genDayIntervals (index: number): VNode[] {\n return this.intervals[index].map(this.genDayInterval)\n },\n genDayInterval (interval: VTimestamp): VNode {\n const height: string | undefined = convertToUnit(this.intervalHeight)\n const styler = this.intervalStyle || this.intervalStyleDefault\n const slot = this.$scopedSlots.interval\n const scope = this.getSlotScope(interval)\n\n const data = {\n key: interval.time,\n staticClass: 'v-calendar-daily__day-interval',\n style: {\n height,\n ...styler(interval)\n }\n }\n\n const children = slot ? slot(scope) as VNodeChildren : undefined\n\n return this.$createElement('div', data, children)\n },\n genBodyIntervals (): VNode {\n const data = {\n staticClass: 'v-calendar-daily__intervals-body',\n on: this.getDefaultMouseEventHandlers(':interval', e => {\n return this.getTimestampAtEvent(e, this.parsedStart)\n })\n }\n\n return this.$createElement('div', data, this.genIntervalLabels())\n },\n genIntervalLabels (): VNode[] {\n return this.intervals[0].map(this.genIntervalLabel)\n },\n genIntervalLabel (interval: VTimestamp): VNode {\n const height: string | undefined = convertToUnit(this.intervalHeight)\n const short: boolean = this.shortIntervals\n const shower = this.showIntervalLabel || this.showIntervalLabelDefault\n const show = shower(interval)\n const label = show ? this.intervalFormatter(interval, short) : undefined\n\n return this.$createElement('div', {\n key: interval.time,\n staticClass: 'v-calendar-daily__interval',\n style: {\n height\n }\n }, [\n this.$createElement('div', {\n staticClass: 'v-calendar-daily__interval-text'\n }, label)\n ])\n }\n },\n\n render (h): VNode {\n return h('div', {\n class: this.classes,\n nativeOn: {\n dragstart: (e: MouseEvent) => {\n e.preventDefault()\n }\n },\n directives: [{\n modifiers: { quiet: true },\n name: 'resize',\n value: this.onResize\n }]\n }, [\n !this.hideHeader ? this.genHead() : '',\n this.genBody()\n ])\n }\n})\n"],"sourceRoot":""}
|