@icvdeveloper/common-module 0.0.104 → 0.0.105
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/module.json
CHANGED
|
@@ -5,21 +5,15 @@ import { get } from "lodash-es";
|
|
|
5
5
|
import { DateTime } from "luxon";
|
|
6
6
|
import { useTemplateConfigsStore } from "../../../store";
|
|
7
7
|
import "add-to-calendar-button";
|
|
8
|
-
import { Conference
|
|
9
|
-
|
|
8
|
+
import { Conference } from "../../../models/conference";
|
|
9
|
+
import { Presentation } from "../../../models/conference";
|
|
10
10
|
type Props = {
|
|
11
11
|
conference: Conference;
|
|
12
|
-
presentation
|
|
12
|
+
presentation: Presentation;
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
16
|
-
presentation: null,
|
|
17
|
-
});
|
|
18
|
-
|
|
14
|
+
const props = defineProps<Props>();
|
|
19
15
|
const { conference, presentation } = toRefs(props);
|
|
20
|
-
|
|
21
16
|
const { pagesConfigValue } = storeToRefs(useTemplateConfigsStore());
|
|
22
|
-
|
|
23
17
|
// Computed
|
|
24
18
|
const showAddToGoogleCalendar = computed((): boolean => {
|
|
25
19
|
return pagesConfigValue.value("agenda.add_to_google_calendar", false);
|
|
@@ -28,43 +22,35 @@ const showAddToGoogleCalendar = computed((): boolean => {
|
|
|
28
22
|
const showAddToMicrosoftCalendar = computed((): boolean => {
|
|
29
23
|
return pagesConfigValue.value("agenda.add_to_microsoft_calendar", false);
|
|
30
24
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{ zone: conference.value.timezone }
|
|
36
|
-
).toFormat("yyyy-MM-dd");
|
|
25
|
+
const presStartDate = computed((): string => {
|
|
26
|
+
return DateTime.fromSQL(presentation.value.date, {
|
|
27
|
+
zone: conference.timezone,
|
|
28
|
+
}).toFormat("yyyy-MM-dd");
|
|
37
29
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
{ zone: conference.value.timezone }
|
|
43
|
-
).toFormat("HH:mm");
|
|
30
|
+
const presStartTime = computed((): string => {
|
|
31
|
+
return DateTime.fromSQL(presentation.value.date, {
|
|
32
|
+
zone: conference.timezone,
|
|
33
|
+
}).toFormat("HH:mm");
|
|
44
34
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
{ zone: conference.value.timezone }
|
|
51
|
-
)
|
|
35
|
+
const presEndTime = computed((): string => {
|
|
36
|
+
let duration: number = get(presentation.value, "duration", 3600); // default to 60 min
|
|
37
|
+
return DateTime.fromSQL(presentation.value.date, {
|
|
38
|
+
zone: conference.timezone,
|
|
39
|
+
})
|
|
52
40
|
.plus(duration * 1000)
|
|
53
41
|
.toFormat("HH:mm");
|
|
54
42
|
});
|
|
55
|
-
|
|
56
43
|
const calendarOptions = computed((): string => {
|
|
57
|
-
|
|
58
|
-
if (showAddToGoogleCalendar
|
|
44
|
+
let opts = [];
|
|
45
|
+
if (showAddToGoogleCalendar) {
|
|
59
46
|
opts.push("Google");
|
|
60
47
|
}
|
|
61
|
-
if (showAddToMicrosoftCalendar
|
|
48
|
+
if (showAddToMicrosoftCalendar) {
|
|
62
49
|
opts.push("iCal");
|
|
63
50
|
}
|
|
64
|
-
|
|
51
|
+
let optsQuoted = opts.map((opt) => `'${opt}'`);
|
|
65
52
|
return optsQuoted.join(",");
|
|
66
53
|
});
|
|
67
|
-
|
|
68
54
|
const cssPath = computed((): string => {
|
|
69
55
|
// atcb.css required in template/playground public folder
|
|
70
56
|
return window.location.origin + "/atcb.css";
|
|
@@ -74,23 +60,21 @@ const cssPath = computed((): string => {
|
|
|
74
60
|
<template>
|
|
75
61
|
<div>
|
|
76
62
|
<add-to-calendar-button
|
|
77
|
-
:name="presentation
|
|
78
|
-
:description="
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
:
|
|
82
|
-
:
|
|
83
|
-
:end-time="eventEndTime"
|
|
84
|
-
:time-zone="conference.timezone"
|
|
63
|
+
:name="presentation.name"
|
|
64
|
+
:description="presentation.description"
|
|
65
|
+
:startDate="presStartDate"
|
|
66
|
+
:startTime="presStartTime"
|
|
67
|
+
:endTime="presEndTime"
|
|
68
|
+
:timeZone="conference.timezone"
|
|
85
69
|
:location="conference.location"
|
|
86
|
-
|
|
70
|
+
listStyle="dropdown"
|
|
87
71
|
trigger="click"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
72
|
+
lightMode="bodyScheme"
|
|
73
|
+
buttonStyle="custom"
|
|
74
|
+
:customCss="cssPath"
|
|
75
|
+
hideIconButton
|
|
76
|
+
hideBackground
|
|
77
|
+
hideCheckmark
|
|
94
78
|
:options="calendarOptions"
|
|
95
79
|
></add-to-calendar-button>
|
|
96
80
|
</div>
|