@bagelink/vue 1.2.15 → 1.2.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/calendar/CalendarTypes.d.ts +13 -0
- package/dist/components/calendar/CalendarTypes.d.ts.map +1 -0
- package/dist/components/calendar/Index.vue.d.ts +39 -507
- package/dist/components/calendar/Index.vue.d.ts.map +1 -1
- package/dist/components/calendar/utils.d.ts +31 -0
- package/dist/components/calendar/utils.d.ts.map +1 -0
- package/dist/components/calendar/views/AgendaView.vue.d.ts +16 -0
- package/dist/components/calendar/views/AgendaView.vue.d.ts.map +1 -0
- package/dist/components/calendar/views/DayView.vue.d.ts +50 -0
- package/dist/components/calendar/views/DayView.vue.d.ts.map +1 -0
- package/dist/components/calendar/views/MonthView.vue.d.ts +20 -0
- package/dist/components/calendar/views/MonthView.vue.d.ts.map +1 -0
- package/dist/components/calendar/views/WeekView.vue.d.ts +33 -0
- package/dist/components/calendar/views/WeekView.vue.d.ts.map +1 -0
- package/dist/components/form/BglMultiStepForm.vue.d.ts +63 -0
- package/dist/components/form/BglMultiStepForm.vue.d.ts.map +1 -0
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/inputs/CodeEditor/Index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts +3 -3
- package/dist/components/form/inputs/DateInput.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePicker.vue.d.ts +3 -3
- package/dist/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/SelectInput.vue.d.ts.map +1 -1
- package/dist/index.cjs +2241 -3891
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +2242 -3892
- package/dist/style.css +567 -633
- package/dist/utils/BagelFormUtils.d.ts +4 -2
- package/dist/utils/BagelFormUtils.d.ts.map +1 -1
- package/dist/utils/calendar/EDate.d.ts +2 -0
- package/dist/utils/calendar/EDate.d.ts.map +1 -0
- package/dist/utils/calendar/Helpers.d.ts +19 -0
- package/dist/utils/calendar/Helpers.d.ts.map +1 -0
- package/dist/utils/calendar/constants.d.ts +3 -0
- package/dist/utils/calendar/constants.d.ts.map +1 -0
- package/dist/utils/calendar/dateUtils.d.ts +30 -0
- package/dist/utils/calendar/dateUtils.d.ts.map +1 -0
- package/dist/utils/calendar/event.interface.d.ts +32 -0
- package/dist/utils/calendar/event.interface.d.ts.map +1 -0
- package/dist/utils/calendar/time.d.ts +117 -0
- package/dist/utils/calendar/time.d.ts.map +1 -0
- package/dist/utils/calendar/types.d.ts +27 -0
- package/dist/utils/calendar/types.d.ts.map +1 -0
- package/dist/utils/calendar/typings.d.ts +87 -0
- package/dist/utils/calendar/typings.d.ts.map +1 -0
- package/dist/utils/calendar/week.d.ts +117 -0
- package/dist/utils/calendar/week.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/calendar/CalendarTypes.ts +13 -0
- package/src/components/calendar/Index.vue +124 -389
- package/src/components/calendar/utils.ts +70 -0
- package/src/components/calendar/views/AgendaView.vue +263 -0
- package/src/components/calendar/views/DayView.vue +373 -0
- package/src/components/calendar/views/MonthView.vue +313 -0
- package/src/components/calendar/views/WeekView.vue +431 -0
- package/src/components/form/BglMultiStepForm.vue +383 -69
- package/src/components/form/index.ts +1 -0
- package/src/components/form/inputs/CodeEditor/Index.vue +11 -0
- package/src/components/form/inputs/DateInput.vue +3 -3
- package/src/components/form/inputs/DatePicker.vue +35 -30
- package/src/components/form/inputs/SelectInput.vue +2 -0
- package/src/components/form/inputs/Upload/upload.types.d.ts +0 -1
- package/src/index.ts +2 -2
- package/src/styles/inputs.css +138 -137
- package/src/styles/layout.css +3 -2
- package/src/styles/mobilLayout.css +4 -2
- package/src/utils/BagelFormUtils.ts +6 -2
- package/src/utils/calendar/EDate.ts +0 -0
- package/src/{components/calendar/helpers → utils/calendar}/Helpers.ts +6 -6
- package/src/utils/calendar/constants.ts +2 -0
- package/src/utils/{timeAgo.ts → calendar/dateUtils.ts} +38 -1
- package/src/utils/calendar/event.interface.ts +33 -0
- package/src/{components/calendar/helpers/Time.ts → utils/calendar/time.ts} +15 -15
- package/src/utils/calendar/types.ts +27 -0
- package/src/{components/calendar/typings/config.interface.ts → utils/calendar/typings.ts} +13 -6
- package/src/utils/calendar/week.ts +588 -0
- package/src/components/calendar/assets/base.css +0 -60
- package/src/components/calendar/components/header/Header.vue +0 -153
- package/src/components/calendar/components/month/AgendaEventTile.vue +0 -135
- package/src/components/calendar/components/month/AgendaEvents.vue +0 -72
- package/src/components/calendar/components/month/Day.vue +0 -256
- package/src/components/calendar/components/month/Event.vue +0 -164
- package/src/components/calendar/components/month/Month.vue +0 -241
- package/src/components/calendar/components/month/WeekDay.vue +0 -15
- package/src/components/calendar/components/partials/EventFlyout.vue +0 -430
- package/src/components/calendar/components/week/Day.vue +0 -198
- package/src/components/calendar/components/week/DayEvent.vue +0 -584
- package/src/components/calendar/components/week/DayTimeline.vue +0 -80
- package/src/components/calendar/components/week/FullDayEvent.vue +0 -121
- package/src/components/calendar/components/week/Week.vue +0 -414
- package/src/components/calendar/components/week/WeekTimeline.vue +0 -101
- package/src/components/calendar/constants.ts +0 -13
- package/src/components/calendar/helpers/DayIntervals.ts +0 -48
- package/src/components/calendar/helpers/EDate.ts +0 -18
- package/src/components/calendar/helpers/Errors.ts +0 -69
- package/src/components/calendar/helpers/EventChange.ts +0 -88
- package/src/components/calendar/helpers/EventConcurrency.ts +0 -69
- package/src/components/calendar/helpers/EventFlyoutPosition.ts +0 -96
- package/src/components/calendar/helpers/EventPosition.ts +0 -154
- package/src/components/calendar/helpers/EventsFilter.ts +0 -50
- package/src/components/calendar/helpers/Week.ts +0 -37
- package/src/components/calendar/language/index.ts +0 -41
- package/src/components/calendar/language/keys.ts +0 -99
- package/src/components/calendar/models/Event.ts +0 -112
- package/src/components/calendar/styles/_mixins.css +0 -21
- package/src/components/calendar/styles/_variables.css +0 -47
- package/src/components/calendar/typings/interfaces/day.interface.ts +0 -10
- package/src/components/calendar/typings/interfaces/event.interface.ts +0 -32
- package/src/components/calendar/typings/interfaces/full-day-events-week.type.ts +0 -8
- package/src/components/calendar/typings/interfaces/period.interface.ts +0 -5
- package/src/components/calendar/typings/interfaces/time-modes.ts +0 -11
- package/src/components/calendar/typings/types.ts +0 -27
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/* color palette from <https://github.com/vuejs/theme> */
|
|
2
|
-
:root {
|
|
3
|
-
--vt-c-white: #ffffff;
|
|
4
|
-
--vt-c-white-soft: #f8f8f8;
|
|
5
|
-
--vt-c-white-mute: #f2f2f2;
|
|
6
|
-
|
|
7
|
-
--vt-c-black: #181818;
|
|
8
|
-
--vt-c-black-soft: #222222;
|
|
9
|
-
--vt-c-black-mute: #282828;
|
|
10
|
-
|
|
11
|
-
--vt-c-indigo: #2c3e50;
|
|
12
|
-
|
|
13
|
-
--vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
|
|
14
|
-
--vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
|
|
15
|
-
--vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
|
|
16
|
-
--vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);
|
|
17
|
-
|
|
18
|
-
--vt-c-text-light-1: var(--vt-c-indigo);
|
|
19
|
-
--vt-c-text-light-2: rgba(60, 60, 60, 0.66);
|
|
20
|
-
--vt-c-text-dark-1: var(--vt-c-white);
|
|
21
|
-
--vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/* semantic color variables for this project */
|
|
25
|
-
:root {
|
|
26
|
-
--color-background: var(--vt-c-white);
|
|
27
|
-
--color-background-soft: var(--vt-c-white-soft);
|
|
28
|
-
--color-background-mute: var(--vt-c-white-mute);
|
|
29
|
-
|
|
30
|
-
--color-border: var(--vt-c-divider-light-2);
|
|
31
|
-
--color-border-hover: var(--vt-c-divider-light-1);
|
|
32
|
-
|
|
33
|
-
--color-heading: var(--vt-c-text-light-1);
|
|
34
|
-
--color-text: var(--vt-c-text-light-1);
|
|
35
|
-
|
|
36
|
-
--section-gap: 160px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@media (prefers-color-scheme: dark) {
|
|
40
|
-
:root {
|
|
41
|
-
--color-background: var(--vt-c-black);
|
|
42
|
-
--color-background-soft: var(--vt-c-black-soft);
|
|
43
|
-
--color-background-mute: var(--vt-c-black-mute);
|
|
44
|
-
|
|
45
|
-
--color-border: var(--vt-c-divider-dark-2);
|
|
46
|
-
--color-border-hover: var(--vt-c-divider-dark-1);
|
|
47
|
-
|
|
48
|
-
--color-heading: var(--vt-c-text-dark-1);
|
|
49
|
-
--color-text: var(--vt-c-text-dark-2);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
*,
|
|
54
|
-
*::before,
|
|
55
|
-
*::after {
|
|
56
|
-
box-sizing: border-box;
|
|
57
|
-
margin: 0;
|
|
58
|
-
position: relative;
|
|
59
|
-
font-weight: normal;
|
|
60
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { PropType } from 'vue'
|
|
3
|
-
import type Time from '../../helpers/Time'
|
|
4
|
-
import type { ConfigInterface } from '../../typings/config.interface'
|
|
5
|
-
import type { PeriodInterface } from '../../typings/interfaces/period.interface'
|
|
6
|
-
import type { ModeType } from '../../typings/types'
|
|
7
|
-
|
|
8
|
-
import { DateInput, TabsNav, Btn } from '@bagelink/vue'
|
|
9
|
-
import { ref, computed, watch } from 'vue'
|
|
10
|
-
import { translate } from '../../language'
|
|
11
|
-
|
|
12
|
-
const props = defineProps({
|
|
13
|
-
config: {
|
|
14
|
-
type: Object as PropType<ConfigInterface>,
|
|
15
|
-
default: () => ({}),
|
|
16
|
-
},
|
|
17
|
-
mode: {
|
|
18
|
-
type: String as PropType<ModeType>,
|
|
19
|
-
default: 'week',
|
|
20
|
-
},
|
|
21
|
-
time: {
|
|
22
|
-
type: Object as PropType<Time>,
|
|
23
|
-
default: () => ({}),
|
|
24
|
-
},
|
|
25
|
-
period: {
|
|
26
|
-
type: Object as PropType<PeriodInterface>,
|
|
27
|
-
required: true,
|
|
28
|
-
},
|
|
29
|
-
isSmall: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
required: true,
|
|
32
|
-
},
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
const emit = defineEmits<{
|
|
36
|
-
(e: 'changeMode', mode: ModeType): void
|
|
37
|
-
(e: 'updatedPeriod', value: PeriodInterface): void
|
|
38
|
-
}>()
|
|
39
|
-
|
|
40
|
-
const periodSelect = ref<InstanceType<typeof DateInput>>()
|
|
41
|
-
const currentPeriod = ref(props.period)
|
|
42
|
-
const modeOptions = ref<ModeType[]>(['month', 'week', 'day', 'agenda'])
|
|
43
|
-
|
|
44
|
-
// const icons = {
|
|
45
|
-
// chevronLeft: 'chevron_left',
|
|
46
|
-
// chevronRight: 'chevron_right',
|
|
47
|
-
// }
|
|
48
|
-
|
|
49
|
-
// const periodName = computed(() => {
|
|
50
|
-
// if (props.mode === 'week') {
|
|
51
|
-
// const startMonth = props.time.getLocalizedNameOfMonth(
|
|
52
|
-
// currentPeriod.value.start,
|
|
53
|
-
// 'short'
|
|
54
|
-
// )
|
|
55
|
-
// const endMonth = props.time.getLocalizedNameOfMonth(
|
|
56
|
-
// currentPeriod.value.end,
|
|
57
|
-
// 'short'
|
|
58
|
-
// )
|
|
59
|
-
|
|
60
|
-
// return startMonth === endMonth
|
|
61
|
-
// ? startMonth
|
|
62
|
-
// : `${startMonth} - ${endMonth}`
|
|
63
|
-
// }
|
|
64
|
-
|
|
65
|
-
// // day
|
|
66
|
-
// return `${props.time.getLocalizedNameOfMonth(
|
|
67
|
-
// currentPeriod.value.selectedDate,
|
|
68
|
-
// 'short'
|
|
69
|
-
// )} ${currentPeriod.value.selectedDate.getFullYear()}`
|
|
70
|
-
// })
|
|
71
|
-
|
|
72
|
-
const modeLocal = ref(props.mode)
|
|
73
|
-
|
|
74
|
-
const onlyDayModeIsEnabled = computed(() => {
|
|
75
|
-
const weekIsDisabled = props.config.disableModes?.includes('week')
|
|
76
|
-
const monthIsDisabled = props.config.disableModes?.includes('month')
|
|
77
|
-
|
|
78
|
-
return props.config.disableModes && weekIsDisabled && monthIsDisabled
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
watch(() => props.isSmall, (value) => {
|
|
82
|
-
if (value) modeOptions.value = ['day', 'month',]
|
|
83
|
-
else modeOptions.value = ['agenda', 'day', 'week', 'month']
|
|
84
|
-
}, { immediate: true })
|
|
85
|
-
|
|
86
|
-
function dateToPeriod(selectedDate: Date) {
|
|
87
|
-
const period: PeriodInterface = {
|
|
88
|
-
start: new Date(),
|
|
89
|
-
end: new Date(),
|
|
90
|
-
selectedDate
|
|
91
|
-
}
|
|
92
|
-
if (props.mode === 'week') {
|
|
93
|
-
period.start = props.time.getCalendarWeekDateObjects(selectedDate)[0]
|
|
94
|
-
period.end = props.time.getCalendarWeekDateObjects(selectedDate)[6]
|
|
95
|
-
} else if (props.mode === 'month') {
|
|
96
|
-
period.start = new Date(selectedDate.getFullYear(), selectedDate.getMonth(), 1)
|
|
97
|
-
period.end = new Date(selectedDate.getFullYear(), selectedDate.getMonth() + 1, 0)
|
|
98
|
-
} else {
|
|
99
|
-
period.start = selectedDate
|
|
100
|
-
period.end = selectedDate
|
|
101
|
-
}
|
|
102
|
-
return period
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function handlePeriodChange() {
|
|
106
|
-
if (!currentPeriod.value) return
|
|
107
|
-
currentPeriod.value = dateToPeriod(currentPeriod.value.selectedDate)
|
|
108
|
-
emit('updatedPeriod', currentPeriod.value)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function goToPeriod(direction: 'previous' | 'next') {
|
|
112
|
-
const date = currentPeriod.value.selectedDate
|
|
113
|
-
if (props.mode === 'month') {
|
|
114
|
-
date.setMonth(direction === 'previous' ? date.getMonth() - 1 : date.getMonth() + 1)
|
|
115
|
-
} else if (props.mode === 'week') {
|
|
116
|
-
date.setDate(direction === 'previous' ? date.getDate() - 7 : date.getDate() + 7)
|
|
117
|
-
} else {
|
|
118
|
-
date.setDate(direction === 'previous' ? date.getDate() - 1 : date.getDate() + 1)
|
|
119
|
-
}
|
|
120
|
-
currentPeriod.value = dateToPeriod(date)
|
|
121
|
-
emit('updatedPeriod', currentPeriod.value)
|
|
122
|
-
}
|
|
123
|
-
</script>
|
|
124
|
-
|
|
125
|
-
<template>
|
|
126
|
-
<div class="flex gap-05 space-between pb-1 datePick">
|
|
127
|
-
<div class="flex gap-1 m_gap-025">
|
|
128
|
-
<Btn flat icon="chevron_left" @click="goToPeriod('previous')" />
|
|
129
|
-
<DateInput
|
|
130
|
-
ref="periodSelect"
|
|
131
|
-
v-model="currentPeriod.selectedDate"
|
|
132
|
-
class="m-0 bg-input-transparent m_w-max-100px txt10 p-0"
|
|
133
|
-
:mode="mode"
|
|
134
|
-
center
|
|
135
|
-
@update:modelValue="handlePeriodChange"
|
|
136
|
-
/>
|
|
137
|
-
<Btn flat icon="chevron_right" @click="goToPeriod('next')" />
|
|
138
|
-
</div>
|
|
139
|
-
<TabsNav v-if="!onlyDayModeIsEnabled" v-model="modeLocal" :tabs="modeOptions.map(id => ({ id, label: translate(id) }))" group="mode" @update:model-value="emit('changeMode', $event)" />
|
|
140
|
-
</div>
|
|
141
|
-
</template>
|
|
142
|
-
|
|
143
|
-
<style>
|
|
144
|
-
.datePick input{
|
|
145
|
-
min-width: 2px !important;
|
|
146
|
-
}
|
|
147
|
-
@media screen and (max-width: 910px) {
|
|
148
|
-
.datePick{
|
|
149
|
-
--input-font-size: 0.75rem;
|
|
150
|
-
--btn-padding: 20px;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
</style>
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { PropType } from 'vue'
|
|
3
|
-
import type Time from '../../helpers/Time'
|
|
4
|
-
import type { ConfigInterface } from '../../typings/config.interface'
|
|
5
|
-
import type { EventInterface } from '../../typings/interfaces/event.interface'
|
|
6
|
-
import { Icon } from '@bagelink/vue'
|
|
7
|
-
import { ref, computed, onMounted } from 'vue'
|
|
8
|
-
import { DATE_TIME_STRING_PATTERN, EVENT_COLORS } from '../../constants'
|
|
9
|
-
|
|
10
|
-
const props = defineProps({
|
|
11
|
-
time: {
|
|
12
|
-
type: Object as PropType<Time>,
|
|
13
|
-
required: true,
|
|
14
|
-
},
|
|
15
|
-
calendarEvent: {
|
|
16
|
-
type: Object as PropType<EventInterface>,
|
|
17
|
-
required: true,
|
|
18
|
-
},
|
|
19
|
-
config: {
|
|
20
|
-
type: Object as PropType<ConfigInterface>,
|
|
21
|
-
required: true,
|
|
22
|
-
},
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const emit = defineEmits(['eventWasClicked'])
|
|
26
|
-
|
|
27
|
-
const icons = {
|
|
28
|
-
clock: 'clock',
|
|
29
|
-
user: 'user',
|
|
30
|
-
description: 'comment',
|
|
31
|
-
trash: 'delete',
|
|
32
|
-
edit: 'pen-to-square',
|
|
33
|
-
times: 'close',
|
|
34
|
-
topic: 'question-circle',
|
|
35
|
-
location: 'location_on',
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const colors = EVENT_COLORS as { [key: string]: string }
|
|
39
|
-
const eventBackgroundColor = ref('')
|
|
40
|
-
const eventColor = ref('#fff')
|
|
41
|
-
const eventIdPrefix = 'agenda__event-'
|
|
42
|
-
|
|
43
|
-
const eventTime = computed(() => {
|
|
44
|
-
return DATE_TIME_STRING_PATTERN.test(props.calendarEvent.time.start)
|
|
45
|
-
? props.time.getLocalizedTimeRange(
|
|
46
|
-
props.calendarEvent.time.start,
|
|
47
|
-
props.calendarEvent.time.end
|
|
48
|
-
)
|
|
49
|
-
: null
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
const elementId = computed(() => {
|
|
53
|
-
return eventIdPrefix + props.calendarEvent.id
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
function setColors() {
|
|
57
|
-
if (
|
|
58
|
-
props.calendarEvent.colorScheme
|
|
59
|
-
&& props.config.style?.colorSchemes
|
|
60
|
-
&& props.config.style.colorSchemes[props.calendarEvent.colorScheme]
|
|
61
|
-
) {
|
|
62
|
-
eventColor.value = props.config.style.colorSchemes[props.calendarEvent.colorScheme].color
|
|
63
|
-
eventBackgroundColor.value = props.config.style.colorSchemes[props.calendarEvent.colorScheme].backgroundColor
|
|
64
|
-
return
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (props.calendarEvent.color) {
|
|
68
|
-
eventBackgroundColor.value = colors[props.calendarEvent.color]
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
eventBackgroundColor.value = colors.blue
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function handleClickOnEvent() {
|
|
76
|
-
const eventElement = document.getElementById(elementId.value)
|
|
77
|
-
emit('eventWasClicked', {
|
|
78
|
-
clickedEvent: props.calendarEvent,
|
|
79
|
-
eventElement,
|
|
80
|
-
})
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
onMounted(() => {
|
|
84
|
-
setColors()
|
|
85
|
-
})
|
|
86
|
-
</script>
|
|
87
|
-
|
|
88
|
-
<!-- flex column align-items-start txt14 -->
|
|
89
|
-
<template>
|
|
90
|
-
<div
|
|
91
|
-
:id="elementId"
|
|
92
|
-
class="agenda__event is-event rounded mb-05 pointer user-select-none p-1 grid gap-1"
|
|
93
|
-
@click.prevent="handleClickOnEvent"
|
|
94
|
-
>
|
|
95
|
-
<div class="flex txt14 flex column align-items-start gap-025 opacity-6">
|
|
96
|
-
<span
|
|
97
|
-
v-if="eventTime && !calendarEvent.originalEvent"
|
|
98
|
-
class="agenda__event-time flex gap-025"
|
|
99
|
-
>
|
|
100
|
-
<Icon :icon="icons.clock" :size="0.8" />
|
|
101
|
-
{{ eventTime }}
|
|
102
|
-
</span>
|
|
103
|
-
|
|
104
|
-
<span
|
|
105
|
-
v-if="calendarEvent.location"
|
|
106
|
-
class="agenda__event-location flex gap-025"
|
|
107
|
-
>
|
|
108
|
-
<Icon :icon="icons.location" :size="1" />
|
|
109
|
-
{{ calendarEvent.location }}
|
|
110
|
-
</span>
|
|
111
|
-
</div>
|
|
112
|
-
<div>
|
|
113
|
-
<div class="agenda__event-title">
|
|
114
|
-
{{ calendarEvent.title }}
|
|
115
|
-
</div>
|
|
116
|
-
<div
|
|
117
|
-
v-if="calendarEvent.with"
|
|
118
|
-
class="agenda__event-with txt14 opacity-6"
|
|
119
|
-
>
|
|
120
|
-
<Icon :icon="icons.user" />
|
|
121
|
-
{{ calendarEvent.with }}
|
|
122
|
-
</div>
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
</template>
|
|
126
|
-
|
|
127
|
-
<style scoped>
|
|
128
|
-
.agenda__event {
|
|
129
|
-
border-inline-start: 0.75rem solid;
|
|
130
|
-
border-color: v-bind(eventBackgroundColor);
|
|
131
|
-
background: var(--input-bg);
|
|
132
|
-
grid-template-columns: 200px auto;
|
|
133
|
-
box-shadow: 0 0 0 1px var(--border-color);
|
|
134
|
-
}
|
|
135
|
-
</style>
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { PropType } from 'vue'
|
|
3
|
-
import type Time from '../../helpers/Time'
|
|
4
|
-
import type { ConfigInterface } from '../../typings/config.interface'
|
|
5
|
-
import type { DayInterface } from '../../typings/interfaces/day.interface'
|
|
6
|
-
import { getLanguage, languageKeys } from '../../language'
|
|
7
|
-
import AgendaEventTile from './AgendaEventTile.vue'
|
|
8
|
-
|
|
9
|
-
defineProps({
|
|
10
|
-
config: {
|
|
11
|
-
type: Object as PropType<ConfigInterface>,
|
|
12
|
-
required: true,
|
|
13
|
-
},
|
|
14
|
-
time: {
|
|
15
|
-
type: Object as PropType<Time>,
|
|
16
|
-
required: true,
|
|
17
|
-
},
|
|
18
|
-
day: {
|
|
19
|
-
type: Object as PropType<DayInterface>,
|
|
20
|
-
required: true,
|
|
21
|
-
},
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
const emit = defineEmits(['eventWasClicked'])
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<template>
|
|
28
|
-
<div class="agenda__wrapper grid align-items-start gap-1 h-100p ">
|
|
29
|
-
<header class="m_sticky">
|
|
30
|
-
<div class="agenda__header-day-name txt-center ">
|
|
31
|
-
{{ day.dayName.slice(0, 3) }}
|
|
32
|
-
</div>
|
|
33
|
-
<div class="agenda__header-date flex justify-content-center rounded p-025 txt24 line-height-04 ">
|
|
34
|
-
<!-- Here we want to display leading zero for days 1-9, in order to prevent layout shifts -->
|
|
35
|
-
{{ day.dateTimeString.substring(8, 10) }}
|
|
36
|
-
</div>
|
|
37
|
-
</header>
|
|
38
|
-
<div class="agenda__content flex column w-100p h-100p min-h-100px pt-05 border-start ps-1 m_pt-0 min-h-50px">
|
|
39
|
-
<div
|
|
40
|
-
v-if="day.events.length === 0"
|
|
41
|
-
class="align-items-center flex justify-content-center h-100p opacity-6"
|
|
42
|
-
>
|
|
43
|
-
{{ getLanguage(languageKeys.noEvent, time.CALENDAR_LOCALE) }}
|
|
44
|
-
</div>
|
|
45
|
-
<div
|
|
46
|
-
v-else
|
|
47
|
-
class="w-100p"
|
|
48
|
-
>
|
|
49
|
-
<AgendaEventTile
|
|
50
|
-
v-for="dayEvent of day.events"
|
|
51
|
-
:key="`agenda_event_${dayEvent.id}`"
|
|
52
|
-
:day="day"
|
|
53
|
-
:config="config"
|
|
54
|
-
:calendar-event="dayEvent"
|
|
55
|
-
:time="time"
|
|
56
|
-
@event-was-clicked="emit('eventWasClicked', $event)"
|
|
57
|
-
/>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
|
62
|
-
|
|
63
|
-
<style scoped>
|
|
64
|
-
.agenda__wrapper {
|
|
65
|
-
grid-template-columns: 100px 1fr;
|
|
66
|
-
}
|
|
67
|
-
@media screen and (max-width: 910px) {
|
|
68
|
-
.agenda__wrapper {
|
|
69
|
-
grid-template-columns: 40px 1fr;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
</style>
|
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import type { PropType } from 'vue'
|
|
3
|
-
import type Time from '../../helpers/Time'
|
|
4
|
-
import type { ConfigInterface } from '../../typings/config.interface'
|
|
5
|
-
import type { DayInterface } from '../../typings/interfaces/day.interface'
|
|
6
|
-
import type { EventInterface } from '../../typings/interfaces/event.interface'
|
|
7
|
-
import { ref, computed } from 'vue'
|
|
8
|
-
import { getLanguage } from '../../language'
|
|
9
|
-
import { languageKeys } from '../../language/keys'
|
|
10
|
-
import Event from './Event.vue'
|
|
11
|
-
|
|
12
|
-
const props = defineProps({
|
|
13
|
-
config: {
|
|
14
|
-
type: Object as PropType<ConfigInterface>,
|
|
15
|
-
required: true,
|
|
16
|
-
},
|
|
17
|
-
time: {
|
|
18
|
-
type: Object as PropType<Time>,
|
|
19
|
-
required: true,
|
|
20
|
-
},
|
|
21
|
-
day: {
|
|
22
|
-
type: Object as PropType<DayInterface>,
|
|
23
|
-
required: true,
|
|
24
|
-
},
|
|
25
|
-
isSelected: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default: false,
|
|
28
|
-
},
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
const emit = defineEmits<{
|
|
32
|
-
(e: 'eventWasClicked', event: EventInterface): void
|
|
33
|
-
(e: 'eventWasDragged', event: EventInterface): void
|
|
34
|
-
(e: 'updatedPeriod', period: { start: Date, end: Date, selectedDate: Date }): void
|
|
35
|
-
(e: 'dateWasClicked', date: string): void
|
|
36
|
-
(e: 'dayWasSelected', day: DayInterface): void
|
|
37
|
-
}>()
|
|
38
|
-
|
|
39
|
-
const isActiveDroppable = ref(false)
|
|
40
|
-
|
|
41
|
-
const canBeDropped = computed(() => isActiveDroppable.value)
|
|
42
|
-
|
|
43
|
-
const hideLeadingAndTrailingDate = computed(() => props.day.isTrailingOrLeadingDate === true && props.config.month?.showTrailingAndLeadingDates === false
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
const isToday = computed(() => {
|
|
47
|
-
const { year, month, date } = props.time.getAllVariablesFromDateTimeString(props.day.dateTimeString)
|
|
48
|
-
return props.time.dateIsToday(new Date(year, month, date))
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
function getMoreEvents() {
|
|
52
|
-
const { date, month, year } = props.time.getAllVariablesFromDateTimeString(props.day.dateTimeString)
|
|
53
|
-
const selectedDate = new Date(year, month, date)
|
|
54
|
-
const week = props.time.getCalendarWeekDateObjects(selectedDate)
|
|
55
|
-
const start = week[0]
|
|
56
|
-
const end = week[6]
|
|
57
|
-
emit('updatedPeriod', { start, end, selectedDate })
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function handleDragLeave() {
|
|
61
|
-
isActiveDroppable.value = false
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function handleDragEnd(mouseEvent: DragEvent) {
|
|
65
|
-
isActiveDroppable.value = false
|
|
66
|
-
mouseEvent.stopPropagation()
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function handleDrop(dropEvent: DragEvent) {
|
|
70
|
-
isActiveDroppable.value = false
|
|
71
|
-
dropEvent.stopPropagation()
|
|
72
|
-
|
|
73
|
-
if (!dropEvent || !dropEvent.dataTransfer) return
|
|
74
|
-
|
|
75
|
-
const calendarEvent: EventInterface = JSON.parse(dropEvent.dataTransfer.getData('json'))
|
|
76
|
-
const eventDroppedOnSameDay = props.time.dateStringsHaveEqualDates(
|
|
77
|
-
calendarEvent.time.start,
|
|
78
|
-
props.time.dateStringFrom(props.day.dateTimeString),
|
|
79
|
-
)
|
|
80
|
-
if (eventDroppedOnSameDay) return
|
|
81
|
-
|
|
82
|
-
calendarEvent.time.start = calendarEvent.time.start.replace(
|
|
83
|
-
/^\d{4}-\d{2}-\d{2}/,
|
|
84
|
-
props.time.dateStringFrom(props.day.dateTimeString)
|
|
85
|
-
)
|
|
86
|
-
calendarEvent.time.end = calendarEvent.time.end.replace(
|
|
87
|
-
/^\d{4}-\d{2}-\d{2}/,
|
|
88
|
-
props.time.dateStringFrom(props.day.dateTimeString)
|
|
89
|
-
)
|
|
90
|
-
emit('eventWasDragged', calendarEvent)
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function handleDragOver(e: DragEvent) {
|
|
94
|
-
isActiveDroppable.value = true
|
|
95
|
-
e.preventDefault()
|
|
96
|
-
return false
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function emitDayWasClicked() {
|
|
100
|
-
emit('dateWasClicked', props.time.dateStringFrom(props.day.dateTimeString))
|
|
101
|
-
if (props.config.isSmall) emit('dayWasSelected', props.day)
|
|
102
|
-
}
|
|
103
|
-
</script>
|
|
104
|
-
|
|
105
|
-
<template>
|
|
106
|
-
<div
|
|
107
|
-
v-if="!hideLeadingAndTrailingDate"
|
|
108
|
-
:id="`day-${time.dateStringFrom(day.dateTimeString)}`"
|
|
109
|
-
class="calendar-month__weekday"
|
|
110
|
-
:class="{
|
|
111
|
-
'is-droppable': canBeDropped,
|
|
112
|
-
'color-gray': day.isTrailingOrLeadingDate,
|
|
113
|
-
'is-selected': isSelected,
|
|
114
|
-
'is-today': isToday,
|
|
115
|
-
}"
|
|
116
|
-
@click.self="emitDayWasClicked"
|
|
117
|
-
@dragleave="handleDragLeave"
|
|
118
|
-
@dragover="handleDragOver"
|
|
119
|
-
@drop="handleDrop"
|
|
120
|
-
@dragend="handleDragEnd"
|
|
121
|
-
>
|
|
122
|
-
<slot
|
|
123
|
-
name="dayCell"
|
|
124
|
-
:day-data="day"
|
|
125
|
-
>
|
|
126
|
-
<div class="w-100p flex justify-content-end txt14 p-025 m_h-100p">
|
|
127
|
-
<p
|
|
128
|
-
class="calendar-month__day-date ms-auto flex aspect-ratio-1 w-30px h-30px justify-content-center m_mx-auto "
|
|
129
|
-
@click="emitDayWasClicked"
|
|
130
|
-
>
|
|
131
|
-
{{ day.dateTimeString.substring(8, 10).startsWith('0') ? day.dateTimeString.substring(9, 10) : day.dateTimeString.substring(8, 10) }}
|
|
132
|
-
</p>
|
|
133
|
-
</div>
|
|
134
|
-
|
|
135
|
-
<div class="calendar-month_events">
|
|
136
|
-
<template
|
|
137
|
-
v-for="(calendarEvent, index) in day.events"
|
|
138
|
-
:key="index"
|
|
139
|
-
>
|
|
140
|
-
<Event
|
|
141
|
-
v-if="index < 3"
|
|
142
|
-
:key="calendarEvent.id"
|
|
143
|
-
:calendar-event="calendarEvent"
|
|
144
|
-
:config="config"
|
|
145
|
-
:time="time"
|
|
146
|
-
:day="day"
|
|
147
|
-
@eventWasClicked="$event => emit('eventWasClicked', $event.clickedEvent)"
|
|
148
|
-
>
|
|
149
|
-
<template #monthEvent="p">
|
|
150
|
-
<slot
|
|
151
|
-
:event-data="p.eventData"
|
|
152
|
-
name="monthEvent"
|
|
153
|
-
/>
|
|
154
|
-
</template>
|
|
155
|
-
</Event>
|
|
156
|
-
</template>
|
|
157
|
-
<div
|
|
158
|
-
v-if="day.events.length >= 4"
|
|
159
|
-
class="calendar-month__weekday-more"
|
|
160
|
-
@click="getMoreEvents"
|
|
161
|
-
>
|
|
162
|
-
{{ getLanguage(languageKeys.moreEvents, time.CALENDAR_LOCALE) }}
|
|
163
|
-
</div>
|
|
164
|
-
</div>
|
|
165
|
-
</slot>
|
|
166
|
-
</div>
|
|
167
|
-
|
|
168
|
-
<div
|
|
169
|
-
v-else
|
|
170
|
-
class="space-reserver"
|
|
171
|
-
/>
|
|
172
|
-
</template>
|
|
173
|
-
|
|
174
|
-
<style scoped>
|
|
175
|
-
.calendar-month__weekday {
|
|
176
|
-
height: 100%;
|
|
177
|
-
flex: 1;
|
|
178
|
-
display: flex;
|
|
179
|
-
flex-flow: column;
|
|
180
|
-
align-items: center;
|
|
181
|
-
border-inline-end: var(--qalendar-border-gray-thin);
|
|
182
|
-
border-bottom: var(--qalendar-border-gray-thin);
|
|
183
|
-
overflow: hidden;
|
|
184
|
-
transition: background-color 0.2s ease-in-out;
|
|
185
|
-
}
|
|
186
|
-
.calendar-month__weekday:active {
|
|
187
|
-
background-color: var(--qalendar-light-gray);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.calendar-month__weekday.is-droppable {
|
|
191
|
-
background-color: var(--qalendar-light-gray);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.calendar-month__weekday:last-child {
|
|
195
|
-
border-inline-end: 0;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.calendar-month__weekday.is-selected {
|
|
199
|
-
box-shadow: inset 0 0 0 1px var(--bgl-primary);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
.calendar-month__weekday-more {
|
|
203
|
-
font-size: var(--qalendar-font-2xs);
|
|
204
|
-
width: 100%;
|
|
205
|
-
padding-inline-start: 4px;
|
|
206
|
-
color: var(--qalendar-gray-quite-dark);
|
|
207
|
-
cursor: pointer;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
.calendar-month_events {
|
|
211
|
-
width: 100%;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.qalendar-is-small .calendar-month_events {
|
|
215
|
-
display: flex;
|
|
216
|
-
flex-flow: row;
|
|
217
|
-
justify-content: center;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.qalendar-is-small .calendar-month_events .calendar-month__weekday-more {
|
|
221
|
-
display: none;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.calendar-month__weekday.is-today .calendar-month__day-date {
|
|
225
|
-
background-color: var(--bgl-primary);
|
|
226
|
-
color: #fff;
|
|
227
|
-
border-radius: 50%;
|
|
228
|
-
padding: 4px 6px;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.qalendar-is-small .calendar-month__weekday.is-today .calendar-month__day-date {
|
|
232
|
-
padding: 2px 4px;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.space-reserver {
|
|
236
|
-
height: 100%;
|
|
237
|
-
flex: 1;
|
|
238
|
-
display: flex;
|
|
239
|
-
flex-flow: column;
|
|
240
|
-
align-items: center;
|
|
241
|
-
border-inline-end: var(--qalendar-border-gray-thin);
|
|
242
|
-
border-bottom: var(--qalendar-border-gray-thin);
|
|
243
|
-
border-inline-end-color: transparent;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.space-reserver + .calendar-month__weekday:not(.trailing-or-leading) {
|
|
247
|
-
border-inline-start: var(--qalendar-border-gray-thin);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
@media (prefers-color-scheme: dark) {
|
|
251
|
-
.calendar-month__weekday,
|
|
252
|
-
.space-reserver {
|
|
253
|
-
border-color: var(--qalendar-dark-mode-line-color);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
</style>
|