Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.lib.labs.VCalendar.VCalendarInterval.mjs.map Maven / Gradle / Ivy
{"version":3,"file":"VCalendarInterval.mjs","names":["VCalendarIntervalEvent","useDate","computed","convertToUnit","genericComponent","propsFactory","useRender","makeVCalendarIntervalProps","day","type","Object","default","dayIndex","Number","events","Array","intervalDivisions","intervalDuration","intervalHeight","intervalFormat","String","Function","intervalStart","VCalendarInterval","name","props","index","required","setup","_ref","emit","slots","adapter","interval","start","addMinutes","startOfDay","date","end","label","format","filter","e","allDay","isEqual","isWithinRange","map","first","last","_createVNode","value","some","event"],"sources":["../../../src/labs/VCalendar/VCalendarInterval.tsx"],"sourcesContent":["// Styles\nimport './VCalendarInterval.sass'\n\n// Components\nimport { VCalendarIntervalEvent } from './VCalendarIntervalEvent'\n\n// Composables\nimport { useDate } from '@/composables/date'\n\n// Utilities\nimport { computed } from 'vue'\nimport { convertToUnit, genericComponent, propsFactory, useRender } from '@/util'\n\nexport const makeVCalendarIntervalProps = propsFactory({\n day: {\n type: Object,\n default: () => ({}),\n },\n dayIndex: Number,\n events: Array,\n intervalDivisions: {\n type: Number,\n default: 2,\n },\n intervalDuration: {\n type: Number,\n default: 60,\n },\n intervalHeight: {\n type: Number,\n default: 48,\n },\n intervalFormat: {\n type: [String, Function],\n default: 'fullTime12h',\n },\n intervalStart: {\n type: Number,\n default: 0,\n },\n}, 'VCalendarInterval')\n\nexport const VCalendarInterval = genericComponent()({\n name: 'VCalendarInterval',\n\n props: {\n index: {\n type: Number,\n required: true,\n },\n\n ...makeVCalendarIntervalProps(),\n },\n\n setup (props, { emit, slots }) {\n const adapter = useDate()\n const interval = computed(() => {\n const start = adapter.addMinutes(adapter.startOfDay(props.day.date), (props.intervalDuration * (props.index + props.intervalStart)))\n const end = adapter.addMinutes(\n adapter.startOfDay(props.day.date),\n (props.intervalDuration * (props.index + props.intervalStart + 1)) - 1\n )\n return {\n ...props.day,\n label: adapter.format(start, 'fullTime24h'),\n start,\n end,\n events: props.events\n ? props.events\n .filter(e => !e.allDay &&\n (adapter.isEqual(start, e.start) ||\n adapter.isWithinRange(e.start, [start, end]) ||\n adapter.isWithinRange(start, [e.start, e.end]) ||\n adapter.isEqual(end, e.end))\n )\n .map(e => {\n return {\n ...e,\n first: adapter.isEqual(start, e.start) || adapter.isWithinRange(e.start, [start, end]),\n last: adapter.isEqual(end, e.end) || adapter.isWithinRange(e.end, [start, end]),\n }\n })\n : [],\n }\n })\n\n useRender(() => {\n return (\n props.dayIndex === 0 ? (\n \n
\n \n { props.index\n ? props.intervalFormat\n ? typeof props.intervalFormat === 'string'\n ? adapter.format(interval.value.start, 'hours12h')\n : props.intervalFormat(interval.value)\n : interval.value.label\n : ''\n }\n \n
\n
\n
!e.last)\n ? 'v-calendar-day__row-content-through'\n : '']}\n >\n \n { interval.value.events?.map(event => (\n \n ))}\n \n
\n
\n ) : (\n \n
!e.last)\n ? 'v-calendar-day__row-content-through'\n : '']}\n >\n \n { interval.value.events?.filter(event => !event.allDay).map(event => (\n \n ))}\n \n
\n
\n )\n )\n })\n\n return { interval }\n },\n})\n\nexport type VCalendarInterval = InstanceType\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,sBAAsB,wCAE/B;AAAA,SACSC,OAAO,4CAEhB;AACA,SAASC,QAAQ,QAAQ,KAAK;AAAA,SACrBC,aAAa,EAAEC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS;AAEjE,OAAO,MAAMC,0BAA0B,GAAGF,YAAY,CAAC;EACrDG,GAAG,EAAE;IACHC,IAAI,EAAEC,MAAM;IACZC,OAAO,EAAEA,CAAA,MAAO,CAAC,CAAC;EACpB,CAAC;EACDC,QAAQ,EAAEC,MAAM;EAChBC,MAAM,EAAEC,KAAU;EAClBC,iBAAiB,EAAE;IACjBP,IAAI,EAAEI,MAAM;IACZF,OAAO,EAAE;EACX,CAAC;EACDM,g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