diff --git a/packages/vue/src/components/BaseTag/BaseTag.vue b/packages/vue/src/components/BaseTag/BaseTag.vue index 152155d7..73127a40 100644 --- a/packages/vue/src/components/BaseTag/BaseTag.vue +++ b/packages/vue/src/components/BaseTag/BaseTag.vue @@ -11,7 +11,7 @@ const variantMap: Attributes = { const sizeMap: Attributes = { sm: 'text-xs border-t-2 py-1 px-2.5', md: 'text-xs lg:text-base border-t py-1.5 px-3.5', - lg: 'text-base lg:text-lg border-t py-1.5 px-5' + lg: 'text-base lg:text-lg border-t pt-1.5 pb-1 px-5' } interface BaseTagProps { diff --git a/packages/vue/src/components/CalendarButton/CalendarButton.vue b/packages/vue/src/components/CalendarButton/CalendarButton.vue index 5e77d8c8..45d3bbea 100644 --- a/packages/vue/src/components/CalendarButton/CalendarButton.vue +++ b/packages/vue/src/components/CalendarButton/CalendarButton.vue @@ -64,13 +64,18 @@ export default defineComponent({ options: undefined } }, + computed: { + icsDescription() { + return `${(this.description ? this.description + '\n\n' : '') + window?.location.href}` + } + }, mounted() { this.init() }, methods: { init() { - let recurrence = {} + let recurrence = undefined if (this.endDatetime && this.isAllDay) { // Calculate how many full days const startDateDayjs = dayjs(this.startDatetime) @@ -81,21 +86,15 @@ export default defineComponent({ this.options = { title: this.title ? this.title : undefined, - location: this.location ? this.addSlashes(this.location) : undefined, - description: this.description ? this.description : undefined, + location: this.location ? this.location : undefined, + description: this.icsDescription, start: new Date(this.startDatetime), end: !this.isAllDay && this.endDatetime ? new Date(this.endDatetime) : undefined, recurrence } + this.icalendar = new ICalendar(this.options) }, - addSlashes(string: string): string { - // Escape special characters COMMA, SEMI-COLON and BACKSLASH - // as temporary fix for this issue https://github.com/jshor/datebook/issues/179 - // regex based of https://stackoverflow.com/a/770533 - // eslint-disable-next-line - return string.replace(/[,;\\]/g, '\\$&').replace(/\u0000/g, '\\0') - }, handleDownload() { const ics = this.icalendar.render() const blob = new Blob([ics], { diff --git a/packages/vue/src/components/EventCard/EventCard.vue b/packages/vue/src/components/EventCard/EventCard.vue index 25934eab..554fc5b8 100644 --- a/packages/vue/src/components/EventCard/EventCard.vue +++ b/packages/vue/src/components/EventCard/EventCard.vue @@ -65,12 +65,22 @@ v-if="splitDate" class="hidden md:block absolute top-0 left-0 z-10 px-4 py-4 text-center text-white bg-primary" > -