@bagelink/vue 0.0.1216 → 0.0.1220
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/Index.vue.d.ts +510 -0
- package/dist/components/Calendar/Index.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/header/Header.vue.d.ts +117 -0
- package/dist/components/Calendar/components/header/Header.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/month/AgendaEventTile.vue.d.ts +37 -0
- package/dist/components/Calendar/components/month/AgendaEventTile.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/month/AgendaEvents.vue.d.ts +37 -0
- package/dist/components/Calendar/components/month/AgendaEvents.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/month/Day.vue.d.ts +84 -0
- package/dist/components/Calendar/components/month/Day.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/month/Event.vue.d.ts +69 -0
- package/dist/components/Calendar/components/month/Event.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/month/Month.vue.d.ts +134 -0
- package/dist/components/Calendar/components/month/Month.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/month/WeekDay.vue.d.ts +7 -0
- package/dist/components/Calendar/components/month/WeekDay.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/partials/EventFlyout.vue.d.ts +122 -0
- package/dist/components/Calendar/components/partials/EventFlyout.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/week/Day.vue.d.ts +152 -0
- package/dist/components/Calendar/components/week/Day.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/week/DayEvent.vue.d.ts +136 -0
- package/dist/components/Calendar/components/week/DayEvent.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/week/DayTimeline.vue.d.ts +23 -0
- package/dist/components/Calendar/components/week/DayTimeline.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/week/FullDayEvent.vue.d.ts +42 -0
- package/dist/components/Calendar/components/week/FullDayEvent.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/week/Week.vue.d.ts +196 -0
- package/dist/components/Calendar/components/week/Week.vue.d.ts.map +1 -0
- package/dist/components/Calendar/components/week/WeekTimeline.vue.d.ts +21 -0
- package/dist/components/Calendar/components/week/WeekTimeline.vue.d.ts.map +1 -0
- package/dist/components/Calendar/constants.d.ts +13 -0
- package/dist/components/Calendar/constants.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/DayIntervals.d.ts +17 -0
- package/dist/components/Calendar/helpers/DayIntervals.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/EDate.d.ts +10 -0
- package/dist/components/Calendar/helpers/EDate.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/Errors.d.ts +18 -0
- package/dist/components/Calendar/helpers/Errors.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/EventChange.d.ts +19 -0
- package/dist/components/Calendar/helpers/EventChange.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/EventConcurrency.d.ts +12 -0
- package/dist/components/Calendar/helpers/EventConcurrency.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/EventFlyoutPosition.d.ts +14 -0
- package/dist/components/Calendar/helpers/EventFlyoutPosition.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/EventPosition.d.ts +11 -0
- package/dist/components/Calendar/helpers/EventPosition.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/EventsFilter.d.ts +11 -0
- package/dist/components/Calendar/helpers/EventsFilter.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/Helpers.d.ts +19 -0
- package/dist/components/Calendar/helpers/Helpers.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/Time.d.ts +118 -0
- package/dist/components/Calendar/helpers/Time.d.ts.map +1 -0
- package/dist/components/Calendar/helpers/Week.d.ts +10 -0
- package/dist/components/Calendar/helpers/Week.d.ts.map +1 -0
- package/dist/components/Calendar/index.d.ts +4 -0
- package/dist/components/Calendar/index.d.ts.map +1 -0
- package/dist/components/Calendar/language/index.d.ts +6 -0
- package/dist/components/Calendar/language/index.d.ts.map +1 -0
- package/dist/components/Calendar/language/keys.d.ts +90 -0
- package/dist/components/Calendar/language/keys.d.ts.map +1 -0
- package/dist/components/Calendar/models/Event.d.ts +50 -0
- package/dist/components/Calendar/models/Event.d.ts.map +1 -0
- package/dist/components/Calendar/typings/config.interface.d.ts +77 -0
- package/dist/components/Calendar/typings/config.interface.d.ts.map +1 -0
- package/dist/components/Calendar/typings/interfaces/day.interface.d.ts +10 -0
- package/dist/components/Calendar/typings/interfaces/day.interface.d.ts.map +1 -0
- package/dist/components/Calendar/typings/interfaces/event.interface.d.ts +32 -0
- package/dist/components/Calendar/typings/interfaces/event.interface.d.ts.map +1 -0
- package/dist/components/Calendar/typings/interfaces/full-day-events-week.type.d.ts +7 -0
- package/dist/components/Calendar/typings/interfaces/full-day-events-week.type.d.ts.map +1 -0
- package/dist/components/Calendar/typings/interfaces/period.interface.d.ts +6 -0
- package/dist/components/Calendar/typings/interfaces/period.interface.d.ts.map +1 -0
- package/dist/components/Calendar/typings/interfaces/time-modes.d.ts +6 -0
- package/dist/components/Calendar/typings/interfaces/time-modes.d.ts.map +1 -0
- package/dist/components/Calendar/typings/types.d.ts +21 -0
- package/dist/components/Calendar/typings/types.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.vue.d.ts.map +1 -1
- package/dist/components/Draggable/useDraggable.d.ts.map +1 -1
- package/dist/components/form/inputs/DatePick.vue.d.ts +8 -0
- package/dist/components/form/inputs/DatePick.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/NumberInput.vue.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/directives/index.d.ts +2 -0
- package/dist/directives/index.d.ts.map +1 -1
- package/dist/directives/vResize.d.ts +18 -0
- package/dist/directives/vResize.d.ts.map +1 -0
- package/dist/index.cjs +3657 -169
- package/dist/index.mjs +3658 -170
- package/dist/style.css +843 -77
- package/package.json +2 -1
- package/src/components/Calendar/Index.vue +420 -0
- package/src/components/Calendar/assets/base.css +60 -0
- package/src/components/Calendar/components/header/Header.vue +274 -0
- package/src/components/Calendar/components/month/AgendaEventTile.vue +137 -0
- package/src/components/Calendar/components/month/AgendaEvents.vue +107 -0
- package/src/components/Calendar/components/month/Day.vue +271 -0
- package/src/components/Calendar/components/month/Event.vue +221 -0
- package/src/components/Calendar/components/month/Month.vue +278 -0
- package/src/components/Calendar/components/month/WeekDay.vue +25 -0
- package/src/components/Calendar/components/partials/EventFlyout.vue +429 -0
- package/src/components/Calendar/components/week/Day.vue +212 -0
- package/src/components/Calendar/components/week/DayEvent.vue +585 -0
- package/src/components/Calendar/components/week/DayTimeline.vue +86 -0
- package/src/components/Calendar/components/week/FullDayEvent.vue +121 -0
- package/src/components/Calendar/components/week/Week.vue +414 -0
- package/src/components/Calendar/components/week/WeekTimeline.vue +126 -0
- package/src/components/Calendar/constants.ts +13 -0
- package/src/components/Calendar/env.d.ts +8 -0
- package/src/components/Calendar/helpers/DayIntervals.ts +48 -0
- package/src/components/Calendar/helpers/EDate.ts +18 -0
- package/src/components/Calendar/helpers/Errors.ts +69 -0
- package/src/components/Calendar/helpers/EventChange.ts +88 -0
- package/src/components/Calendar/helpers/EventConcurrency.ts +69 -0
- package/src/components/Calendar/helpers/EventFlyoutPosition.ts +96 -0
- package/src/components/Calendar/helpers/EventPosition.ts +154 -0
- package/src/components/Calendar/helpers/EventsFilter.ts +50 -0
- package/src/components/Calendar/helpers/Helpers.ts +86 -0
- package/src/components/Calendar/helpers/Time.ts +588 -0
- package/src/components/Calendar/helpers/Week.ts +37 -0
- package/src/components/Calendar/index.ts +4 -0
- package/src/components/Calendar/language/index.ts +37 -0
- package/src/components/Calendar/language/keys.ts +90 -0
- package/src/components/Calendar/models/Event.ts +112 -0
- package/src/components/Calendar/styles/_mixins.css +21 -0
- package/src/components/Calendar/styles/_variables.css +51 -0
- package/src/components/Calendar/typings/config.interface.ts +87 -0
- package/src/components/Calendar/typings/interfaces/day.interface.ts +10 -0
- package/src/components/Calendar/typings/interfaces/event.interface.ts +32 -0
- package/src/components/Calendar/typings/interfaces/full-day-events-week.type.ts +8 -0
- package/src/components/Calendar/typings/interfaces/period.interface.ts +5 -0
- package/src/components/Calendar/typings/interfaces/time-modes.ts +9 -0
- package/src/components/Calendar/typings/types.ts +23 -0
- package/src/components/DataTable/DataTable.vue +4 -0
- package/src/components/Draggable/useDraggable.ts +53 -37
- package/src/components/form/inputs/DatePick.vue +189 -152
- package/src/components/form/inputs/NumberInput.vue +1 -3
- package/src/components/index.ts +3 -6
- package/src/directives/index.ts +2 -0
- package/src/directives/vResize.ts +205 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export const languageKeys = {
|
|
2
|
+
/** The following three keys, describe the calendar modes */
|
|
3
|
+
week: {
|
|
4
|
+
"it-IT": "Settimana",
|
|
5
|
+
"en-US": "Week",
|
|
6
|
+
"de-DE": "Woche",
|
|
7
|
+
"sv-SE": "Vecka",
|
|
8
|
+
"zh-CN": "周",
|
|
9
|
+
"pt-BR": "Semana",
|
|
10
|
+
"fr-FR": "Semaine",
|
|
11
|
+
"th-TH": "สัปดาห์",
|
|
12
|
+
"nl-NL": "Week",
|
|
13
|
+
"ru-RU": "Неделя",
|
|
14
|
+
"ar-YE": "إسبوع",
|
|
15
|
+
"es-ES": "Semana",
|
|
16
|
+
"ja-JP": "週",
|
|
17
|
+
"pl-PL": "Tydzień",
|
|
18
|
+
"hu-HU": "Hét",
|
|
19
|
+
},
|
|
20
|
+
month: {
|
|
21
|
+
"it-IT": "Mese",
|
|
22
|
+
"en-US": "Month",
|
|
23
|
+
"de-DE": "Monat",
|
|
24
|
+
"sv-SE": "Månad",
|
|
25
|
+
"zh-CN": "月",
|
|
26
|
+
"pt-BR": "Mês",
|
|
27
|
+
"fr-FR": "Mois",
|
|
28
|
+
"th-TH": "เดือน",
|
|
29
|
+
"nl-NL": "Maand",
|
|
30
|
+
"ru-RU": "Месяц",
|
|
31
|
+
"ar-YE": "شهر",
|
|
32
|
+
"es-ES": "Mes",
|
|
33
|
+
"ja-JP": "月",
|
|
34
|
+
"pl-PL": "Miesiąc",
|
|
35
|
+
"hu-HU": "Hónap",
|
|
36
|
+
},
|
|
37
|
+
day: {
|
|
38
|
+
"it-IT": "Giorno",
|
|
39
|
+
"en-US": "Day",
|
|
40
|
+
"de-DE": "Tag",
|
|
41
|
+
"sv-SE": "Dag",
|
|
42
|
+
"zh-CN": "日",
|
|
43
|
+
"pt-BR": "Dia",
|
|
44
|
+
"fr-FR": "Jour",
|
|
45
|
+
"th-TH": "วัน",
|
|
46
|
+
"nl-NL": "Dag",
|
|
47
|
+
"ru-RU": "День",
|
|
48
|
+
"ar-YE": "يوم",
|
|
49
|
+
"es-ES": "Día",
|
|
50
|
+
"ja-JP": "日",
|
|
51
|
+
"pl-PL": "Dzień",
|
|
52
|
+
"hu-HU": "Nap",
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
/** Other keys */
|
|
56
|
+
moreEvents: {
|
|
57
|
+
"it-IT": "+ altri eventi",
|
|
58
|
+
"en-US": "+ more events",
|
|
59
|
+
"de-DE": "+ weitere Ereignisse",
|
|
60
|
+
"sv-SE": "+ fler event",
|
|
61
|
+
"zh-CN": "列出其他结果",
|
|
62
|
+
"pt-BR": "+ mais eventos",
|
|
63
|
+
"fr-FR": "+ d'autres événements",
|
|
64
|
+
"th-TH": "+ เหตุการณ์เพิ่มเติม",
|
|
65
|
+
"nl-NL": "meer evenementen",
|
|
66
|
+
"ru-RU": "+ ещё события",
|
|
67
|
+
"ar-YE": "+ المزيد من الأحداث",
|
|
68
|
+
"es-ES": "más eventos",
|
|
69
|
+
"ja-JP": "その他イベント",
|
|
70
|
+
"pl-PL": "+ więcej wydarzeń",
|
|
71
|
+
"hu-HU": "További események",
|
|
72
|
+
},
|
|
73
|
+
noEvent: {
|
|
74
|
+
'it-IT': 'Nessun evento',
|
|
75
|
+
'en-US': 'No events',
|
|
76
|
+
'de-DE': 'Keine Ereignisse',
|
|
77
|
+
'sv-SE': 'Inga event',
|
|
78
|
+
'zh-CN': '沒有活動',
|
|
79
|
+
'pt-BR': 'Sem eventos',
|
|
80
|
+
'fr-FR': 'Aucun Evènement',
|
|
81
|
+
'th-TH': 'ไม่มีกิจกรรม',
|
|
82
|
+
'nl-NL': 'Geen evenementen',
|
|
83
|
+
'ru-RU': 'Нет событий',
|
|
84
|
+
'ar-YE': 'لا أحداث',
|
|
85
|
+
'es-ES': 'No hay eventos',
|
|
86
|
+
"ja-JP": "イベントなし",
|
|
87
|
+
"pl-PL": "Brak wydarzeń",
|
|
88
|
+
"hu-HU": "Nincs esemény",
|
|
89
|
+
},
|
|
90
|
+
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type {EventColor, EventID, EventInterface} from "../typings/interfaces/event.interface";
|
|
2
|
+
import type {modeType} from "../typings/types";
|
|
3
|
+
|
|
4
|
+
export class EventImpl implements EventInterface {
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
topic?: string;
|
|
8
|
+
location?: string;
|
|
9
|
+
with?: string;
|
|
10
|
+
colorScheme?: string;
|
|
11
|
+
color?: EventColor;
|
|
12
|
+
isEditable?: boolean;
|
|
13
|
+
disableDnD?: modeType[];
|
|
14
|
+
disableResize?: modeType[];
|
|
15
|
+
isCustom?: boolean | modeType[];
|
|
16
|
+
|
|
17
|
+
// Properties that should not be set from outside Qalendar
|
|
18
|
+
nOfPreviousConcurrentEvents?: number;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
public time: { start: string; end: string },
|
|
22
|
+
public id: EventID,
|
|
23
|
+
) {}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class EventBuilder {
|
|
27
|
+
private eventImpl: EventImpl;
|
|
28
|
+
|
|
29
|
+
constructor(
|
|
30
|
+
public time: { start: string; end: string },
|
|
31
|
+
id?: EventID,
|
|
32
|
+
) {
|
|
33
|
+
if (!id) id = Math.random().toString(36).substring(2, 9);
|
|
34
|
+
this.eventImpl = new EventImpl(time, id);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
build() {
|
|
38
|
+
return this.eventImpl;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
withTitle(title: string) {
|
|
42
|
+
this.eventImpl.title = title;
|
|
43
|
+
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
withColor(color: EventColor) {
|
|
48
|
+
this.eventImpl.color = color;
|
|
49
|
+
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
withColorScheme(colorScheme: string) {
|
|
54
|
+
this.eventImpl.colorScheme = colorScheme;
|
|
55
|
+
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
withDescription(description: string) {
|
|
60
|
+
this.eventImpl.description = description;
|
|
61
|
+
|
|
62
|
+
return this;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
withTopic(topic: string) {
|
|
66
|
+
this.eventImpl.topic = topic;
|
|
67
|
+
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
withLocation(location: string) {
|
|
72
|
+
this.eventImpl.location = location;
|
|
73
|
+
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
withWith($with: string) {
|
|
78
|
+
this.eventImpl.with = $with;
|
|
79
|
+
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
withNOfPreviousConcurrentEvents(nOfPreviousConcurrentEvents: number) {
|
|
84
|
+
this.eventImpl.nOfPreviousConcurrentEvents = nOfPreviousConcurrentEvents;
|
|
85
|
+
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
withIsEditable(isEditable: boolean) {
|
|
90
|
+
this.eventImpl.isEditable = isEditable;
|
|
91
|
+
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
withIsCustom(isCustom: boolean | modeType[]) {
|
|
96
|
+
this.eventImpl.isCustom = isCustom;
|
|
97
|
+
|
|
98
|
+
return this;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
withDisableDnD(disableDnD: modeType[]) {
|
|
102
|
+
this.eventImpl.disableDnD = disableDnD;
|
|
103
|
+
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
withDisableResize(disableResize: modeType[]) {
|
|
108
|
+
this.eventImpl.disableResize = disableResize;
|
|
109
|
+
|
|
110
|
+
return this;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@media (min-width: 37.5rem) {
|
|
2
|
+
.screen-size-m {
|
|
3
|
+
/* Content goes here */
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@media (hover: hover) {
|
|
8
|
+
.hover {
|
|
9
|
+
/* Content goes here */
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@media (prefers-color-scheme: dark) {
|
|
14
|
+
.dark-mode {
|
|
15
|
+
/* Content goes here */
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
[style*='color-scheme: dark'] {
|
|
20
|
+
/* Content goes here */
|
|
21
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/** Color */
|
|
3
|
+
--qalendar-blue: rgb(38 132 255);
|
|
4
|
+
--qalendar-blue-transparent: rgba(38 132 255 / 90%);
|
|
5
|
+
--qalendar-gray-quite-dark: rgb(110 110 110);
|
|
6
|
+
--qalendar-gray: rgb(180 180 180);
|
|
7
|
+
--qalendar-green: rgb(51 182 121);
|
|
8
|
+
--qalendar-theme-color: var(--qalendar-blue);
|
|
9
|
+
--qalendar-light-gray: rgba(240 236 236 / 76%);
|
|
10
|
+
--qalendar-option-hover: var(--qalendar-light-gray);
|
|
11
|
+
|
|
12
|
+
--qalendar-dark-mode-elevated-surface: #383838;
|
|
13
|
+
--qalendar-dark-mode-lightly-elevated-surface: #2e2e2e;
|
|
14
|
+
--qalendar-dark-mode-text-primary: rgba(255 255 255 1);
|
|
15
|
+
--qalendar-dark-mode-text-secondary: rgba(255 255 255 0.7);
|
|
16
|
+
--qalendar-dark-mode-text-hint: rgba(255 255 255 0.5);
|
|
17
|
+
--qalendar-dark-mode-line-color: var(--qalendar-gray);
|
|
18
|
+
|
|
19
|
+
/** Borders */
|
|
20
|
+
--qalendar-border-gray-thin: 1px solid rgb(224 224 224);
|
|
21
|
+
--qalendar-border-dashed-gray-thin: 1px dashed rgb(224 224 224);
|
|
22
|
+
--qalendar-border-blue-thin: 1px solid var(--qalendar-theme-color);
|
|
23
|
+
--qalendar-border-radius: 8px;
|
|
24
|
+
|
|
25
|
+
/** Spacing */
|
|
26
|
+
--qalendar-spacing: 10px;
|
|
27
|
+
--qalendar-spacing-half: 5px;
|
|
28
|
+
--qalendar-spacing-double: 20px;
|
|
29
|
+
|
|
30
|
+
/** Miscellaneous */
|
|
31
|
+
--qalendar-box-shadow: 0 4px 4px rgba(0 0 0 / 6%), 0 1px 4px rgba(0 0 0 / 18%);
|
|
32
|
+
--qalendar-text-transition: color 0.2s ease;
|
|
33
|
+
--qalendar-week-padding-left: 56px;
|
|
34
|
+
|
|
35
|
+
/** Font */
|
|
36
|
+
--qalendar-font-3xs: 0.625rem;
|
|
37
|
+
--qalendar-font-2xs: 0.688rem;
|
|
38
|
+
--qalendar-font-xs: 0.75rem;
|
|
39
|
+
--qalendar-font-s: 0.875rem;
|
|
40
|
+
--qalendar-font-m: 1rem;
|
|
41
|
+
--qalendar-font-l: 1.25rem;
|
|
42
|
+
--qalendar-font-xl: 1.5rem;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@media (min-width: 62rem) {
|
|
46
|
+
.calendar-root {
|
|
47
|
+
--qalendar-spacing: 20px;
|
|
48
|
+
--qalendar-spacing-half: 10px;
|
|
49
|
+
--qalendar-spacing-double: 40px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { WEEK_START_DAY } from '../helpers/Time'
|
|
2
|
+
import type { modeType } from './types'
|
|
3
|
+
|
|
4
|
+
export enum DAY_TIME_POINT {
|
|
5
|
+
MIDNIGHT = 0,
|
|
6
|
+
ONE_AM = 100,
|
|
7
|
+
TWO_AM = 200,
|
|
8
|
+
THREE_AM = 300,
|
|
9
|
+
FOUR_AM = 400,
|
|
10
|
+
FIVE_AM = 500,
|
|
11
|
+
SIX_AM = 600,
|
|
12
|
+
SEVEN_AM = 700,
|
|
13
|
+
EIGHT_AM = 800,
|
|
14
|
+
NINE_AM = 900,
|
|
15
|
+
TEN_AM = 1000,
|
|
16
|
+
ELEVEN_AM = 1100,
|
|
17
|
+
TWELVE_PM = 1200,
|
|
18
|
+
ONE_PM = 1300,
|
|
19
|
+
TWO_PM = 1400,
|
|
20
|
+
THREE_PM = 1500,
|
|
21
|
+
FOUR_PM = 1600,
|
|
22
|
+
FIVE_PM = 1700,
|
|
23
|
+
SIX_PM = 1800,
|
|
24
|
+
SEVEN_PM = 1900,
|
|
25
|
+
EIGHT_PM = 2000,
|
|
26
|
+
NINE_PM = 2100,
|
|
27
|
+
TEN_PM = 2200,
|
|
28
|
+
ELEVEN_PM = 2300,
|
|
29
|
+
TWELVE_AM = 2400,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ColorScheme { color: string, backgroundColor: string }
|
|
33
|
+
|
|
34
|
+
export interface ColorSchemes {
|
|
35
|
+
[key: string]: ColorScheme
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type intervalLengthType = 15 | 30 | 60
|
|
39
|
+
|
|
40
|
+
// Lets the implementer define:
|
|
41
|
+
// a) length in minutes, of the day intervals
|
|
42
|
+
// b) the height of each individual interval
|
|
43
|
+
// c) whether the intervals should appear graphically as clickable elements or not
|
|
44
|
+
export interface DayIntervalsType {
|
|
45
|
+
length?: intervalLengthType
|
|
46
|
+
height?: number
|
|
47
|
+
displayClickableInterval?: boolean
|
|
48
|
+
intervalStyles?: { [key: string]: any }
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface ConfigInterface {
|
|
52
|
+
locale?: string
|
|
53
|
+
week?: {
|
|
54
|
+
nDays?: 5 | 7
|
|
55
|
+
startsOn?: WEEK_START_DAY
|
|
56
|
+
scrollToHour?: number
|
|
57
|
+
}
|
|
58
|
+
style?: {
|
|
59
|
+
fontFamily?: string
|
|
60
|
+
colorSchemes?: ColorSchemes
|
|
61
|
+
}
|
|
62
|
+
defaultMode?: modeType
|
|
63
|
+
disableModes?: ('week' | 'month' | string)[]
|
|
64
|
+
isSilent?: boolean
|
|
65
|
+
dayIntervals?: DayIntervalsType
|
|
66
|
+
eventDialog?: {
|
|
67
|
+
isDisabled?: boolean
|
|
68
|
+
isCustom?: boolean
|
|
69
|
+
closeOnClickOutside?: boolean
|
|
70
|
+
}
|
|
71
|
+
dayBoundaries?: {
|
|
72
|
+
start: number // integer between 0 and 24
|
|
73
|
+
end: number // integer between 0 and 24
|
|
74
|
+
}
|
|
75
|
+
showCurrentTime?: boolean
|
|
76
|
+
|
|
77
|
+
month?: {
|
|
78
|
+
// Hide the days of the next month and previous month in calendar to enhance the appearance
|
|
79
|
+
showTrailingAndLeadingDates?: boolean
|
|
80
|
+
showEventsOnMobileView?: boolean
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// The isSmall property is an internal API attached to the config object, and usage of this
|
|
84
|
+
// from an implementer is strongly discouraged
|
|
85
|
+
// TODO: create internal config interface and replace all usages in components with that
|
|
86
|
+
isSmall?: boolean
|
|
87
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EventInterface } from './event.interface'
|
|
2
|
+
import type { DayWithFullDayEvents } from './full-day-events-week.type'
|
|
3
|
+
|
|
4
|
+
export interface DayInterface {
|
|
5
|
+
isTrailingOrLeadingDate?: boolean
|
|
6
|
+
dayName: string
|
|
7
|
+
dateTimeString: string
|
|
8
|
+
events: EventInterface[]
|
|
9
|
+
fullDayEvents?: DayWithFullDayEvents
|
|
10
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { modeType } from '../types'
|
|
2
|
+
|
|
3
|
+
export type EventID = string | number
|
|
4
|
+
|
|
5
|
+
export type EVENT_TYPE = 'SINGLE_DAY_TIMED' | 'SINGLE_DAY_FULL_DAY' | 'SINGLE_HYBRID_DAY_TIMED' | 'MULTI_DAY_TIMED' | 'MULTI_DAY_FULL_DAY'
|
|
6
|
+
|
|
7
|
+
export type EventColor = 'blue' | 'yellow' | 'green' | 'red' | 'purple'
|
|
8
|
+
|
|
9
|
+
export interface EventInterface {
|
|
10
|
+
id: EventID
|
|
11
|
+
title?: string
|
|
12
|
+
time: { start: string, end: string } // YYYY-MM-DD hh:mm
|
|
13
|
+
description?: string
|
|
14
|
+
topic?: string
|
|
15
|
+
location?: string // Name of the event location
|
|
16
|
+
with?: string // Names of people
|
|
17
|
+
colorScheme?: string
|
|
18
|
+
color?: EventColor // Says 'color', but represents CSS-Property background-color
|
|
19
|
+
isEditable?: boolean // If true, the event has delete- and edit icons in Event-Flyout. Can also be dragged and dropped.
|
|
20
|
+
disableDnD?: modeType[] // Disable Drag and Drop for this event, in the modes specified
|
|
21
|
+
disableResize?: modeType[] // Disable Resize for this event, in the modes specified
|
|
22
|
+
isCustom?: boolean | modeType[] // If true, the event expects to be displayed using the event slot. It can also be specified as an array, of all modes, where the event should be displayed using the event slot.
|
|
23
|
+
|
|
24
|
+
// These are properties that should never be fed into the Calendar
|
|
25
|
+
// Instead, they are assigned to events, in order to for example position/style them correctly
|
|
26
|
+
zIndex?: number
|
|
27
|
+
nOfPreviousConcurrentEvents?: number
|
|
28
|
+
totalConcurrentEvents?: number
|
|
29
|
+
timeJS?: { start: Date, end: Date }
|
|
30
|
+
originalEvent?: Omit<EventInterface, 'originalEvent'>
|
|
31
|
+
eventType?: EVENT_TYPE
|
|
32
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export enum DAY_MODE {
|
|
2
|
+
// a regular day, starting and ending at 0:00 and 24:00
|
|
3
|
+
REGULAR = 'regular',
|
|
4
|
+
// a day with custom day boundaries, but within an actual calendar day
|
|
5
|
+
SHORTENED = 'shortened',
|
|
6
|
+
// a day with custom day boundaries, but spanning two actual calendar days,
|
|
7
|
+
// for example, a day that starts at 06:00 and ends at 04:00 the day after
|
|
8
|
+
FLEXIBLE = 'flexible',
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface DOMRect {
|
|
2
|
+
bottom: number;
|
|
3
|
+
height: number;
|
|
4
|
+
left: number;
|
|
5
|
+
right: number;
|
|
6
|
+
top: number;
|
|
7
|
+
width: number;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type modeType = "day" | "week" | "month" | "agenda";
|
|
13
|
+
|
|
14
|
+
export enum DRAG_N_RESIZE_DIRECTION {
|
|
15
|
+
BACKWARDS = "backwards",
|
|
16
|
+
FORWARDS = "forwards",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type DayInfo = {
|
|
20
|
+
daysTotalN: number;
|
|
21
|
+
thisDayIndex: number,
|
|
22
|
+
dateTimeString: string
|
|
23
|
+
}
|
|
@@ -35,6 +35,26 @@ export function useDraggable(options: DraggableOptions = {}) {
|
|
|
35
35
|
const dropIndicator = ref<HTMLElement | null>(null)
|
|
36
36
|
const dropTarget = ref<DraggableElement | null>(null)
|
|
37
37
|
|
|
38
|
+
// Only run in browser environment
|
|
39
|
+
const isBrowser = typeof window !== 'undefined'
|
|
40
|
+
|
|
41
|
+
// Move style injection into setup
|
|
42
|
+
if (isBrowser) {
|
|
43
|
+
const existingStyle = document.getElementById('draggable-style')
|
|
44
|
+
if (!existingStyle) {
|
|
45
|
+
const style = document.createElement('style')
|
|
46
|
+
style.id = 'draggable-style'
|
|
47
|
+
style.textContent = `
|
|
48
|
+
.draggable-ghost {
|
|
49
|
+
opacity: 0.5;
|
|
50
|
+
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
51
|
+
transition: transform 0.1s;
|
|
52
|
+
}
|
|
53
|
+
`
|
|
54
|
+
document.head.appendChild(style)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
38
58
|
const defaultOptions: DraggableOptions = {
|
|
39
59
|
animation: 150,
|
|
40
60
|
mode: 'line',
|
|
@@ -59,6 +79,7 @@ export function useDraggable(options: DraggableOptions = {}) {
|
|
|
59
79
|
const POSITION_CACHE = new Map<number, { top: number, bottom: number }>()
|
|
60
80
|
|
|
61
81
|
function createGhost(el: DraggableElement) {
|
|
82
|
+
if (!isBrowser) return null
|
|
62
83
|
const ghost = el.cloneNode(true) as HTMLElement
|
|
63
84
|
const rect = el.getBoundingClientRect()
|
|
64
85
|
ghost.style.position = 'fixed'
|
|
@@ -78,6 +99,7 @@ export function useDraggable(options: DraggableOptions = {}) {
|
|
|
78
99
|
}
|
|
79
100
|
|
|
80
101
|
function createDropIndicator(el: DraggableElement) {
|
|
102
|
+
if (!isBrowser) return null
|
|
81
103
|
const line = document.createElement('div')
|
|
82
104
|
line.classList.add(defaultOptions.dropIndicatorClass!)
|
|
83
105
|
line.style.position = 'fixed'
|
|
@@ -212,6 +234,8 @@ export function useDraggable(options: DraggableOptions = {}) {
|
|
|
212
234
|
}
|
|
213
235
|
|
|
214
236
|
function cleanup() {
|
|
237
|
+
if (!isBrowser) return
|
|
238
|
+
|
|
215
239
|
document.removeEventListener('mousemove', onDragMove)
|
|
216
240
|
document.removeEventListener('mouseup', onDragEnd)
|
|
217
241
|
document.removeEventListener('keydown', onKeyDown)
|
|
@@ -252,9 +276,12 @@ export function useDraggable(options: DraggableOptions = {}) {
|
|
|
252
276
|
|
|
253
277
|
isDragging.value = false
|
|
254
278
|
dropTarget.value = null
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
279
|
+
|
|
280
|
+
if (isBrowser) {
|
|
281
|
+
document.body.style.userSelect = ''
|
|
282
|
+
document.body.style.webkitUserSelect = ''
|
|
283
|
+
document.body.style.cursor = ''
|
|
284
|
+
}
|
|
258
285
|
|
|
259
286
|
if (scrollRAF) {
|
|
260
287
|
cancelAnimationFrame(scrollRAF)
|
|
@@ -273,7 +300,7 @@ export function useDraggable(options: DraggableOptions = {}) {
|
|
|
273
300
|
}
|
|
274
301
|
|
|
275
302
|
function onDragStart(e: MouseEvent) {
|
|
276
|
-
if (defaultOptions.disabled) return
|
|
303
|
+
if (!isBrowser || defaultOptions.disabled) return
|
|
277
304
|
if (e.button !== 0) return // Only left mouse button
|
|
278
305
|
if (e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) return
|
|
279
306
|
|
|
@@ -318,16 +345,16 @@ export function useDraggable(options: DraggableOptions = {}) {
|
|
|
318
345
|
defaultOptions.onStart?.(e)
|
|
319
346
|
|
|
320
347
|
// Prevent text selection during drag
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
348
|
+
if (isBrowser) {
|
|
349
|
+
document.body.style.userSelect = 'none'
|
|
350
|
+
document.body.style.webkitUserSelect = 'none'
|
|
351
|
+
document.body.style.cursor = 'grabbing'
|
|
352
|
+
|
|
353
|
+
window.addEventListener('blur', cleanup)
|
|
354
|
+
document.addEventListener('mousemove', onDragMove)
|
|
355
|
+
document.addEventListener('mouseup', onDragEnd)
|
|
356
|
+
document.addEventListener('keydown', onKeyDown)
|
|
357
|
+
}
|
|
331
358
|
}
|
|
332
359
|
|
|
333
360
|
function findScrollParent(element: Element): Element {
|
|
@@ -472,7 +499,7 @@ export function useDraggable(options: DraggableOptions = {}) {
|
|
|
472
499
|
}
|
|
473
500
|
|
|
474
501
|
function onTouchStart(e: TouchEvent) {
|
|
475
|
-
if (defaultOptions.disabled || !e.target) return
|
|
502
|
+
if (!isBrowser || defaultOptions.disabled || !e.target) return
|
|
476
503
|
|
|
477
504
|
const touch = e.touches[0]
|
|
478
505
|
if (!touch) return
|
|
@@ -515,17 +542,17 @@ export function useDraggable(options: DraggableOptions = {}) {
|
|
|
515
542
|
|
|
516
543
|
defaultOptions.onStart?.(e as unknown as MouseEvent)
|
|
517
544
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
545
|
+
if (isBrowser) {
|
|
546
|
+
// Prevent text selection during drag
|
|
547
|
+
document.body.style.userSelect = 'none'
|
|
548
|
+
document.body.style.webkitUserSelect = 'none'
|
|
549
|
+
document.body.style.cursor = 'grabbing'
|
|
521
550
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
document.addEventListener('touchend', onTouchEnd)
|
|
528
|
-
document.addEventListener('touchcancel', onTouchEnd)
|
|
551
|
+
window.addEventListener('blur', cleanup)
|
|
552
|
+
document.addEventListener('touchmove', onTouchMove, { passive: false })
|
|
553
|
+
document.addEventListener('touchend', onTouchEnd)
|
|
554
|
+
document.addEventListener('touchcancel', onTouchEnd)
|
|
555
|
+
}
|
|
529
556
|
}
|
|
530
557
|
|
|
531
558
|
function onTouchMove(e: TouchEvent) {
|
|
@@ -560,6 +587,7 @@ export function useDraggable(options: DraggableOptions = {}) {
|
|
|
560
587
|
}
|
|
561
588
|
|
|
562
589
|
function initDraggableContainer(container: HTMLElement) {
|
|
590
|
+
if (!isBrowser) return
|
|
563
591
|
cleanupFn?.()
|
|
564
592
|
|
|
565
593
|
// Reset state
|
|
@@ -618,15 +646,3 @@ export function useDraggable(options: DraggableOptions = {}) {
|
|
|
618
646
|
initDraggableContainer
|
|
619
647
|
}
|
|
620
648
|
}
|
|
621
|
-
|
|
622
|
-
// Simplified default styles
|
|
623
|
-
const style = document.createElement('style')
|
|
624
|
-
style.textContent = `
|
|
625
|
-
.draggable-ghost {
|
|
626
|
-
opacity: 0.5;
|
|
627
|
-
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
628
|
-
transition: transform 0.1s;
|
|
629
|
-
|
|
630
|
-
}
|
|
631
|
-
`
|
|
632
|
-
document.head.appendChild(style)
|