@event-calendar/core 4.7.1 → 5.0.0
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/README.md +29 -51
- package/dist/index.css +627 -731
- package/dist/index.js +2499 -3191
- package/package.json +2 -2
- package/src/Auxiliary.svelte +2 -13
- package/src/Buttons.svelte +62 -52
- package/src/Calendar.svelte +9 -3
- package/src/lib/a11y.js +2 -2
- package/src/lib/attachments.js +61 -0
- package/src/lib/chunks.js +117 -0
- package/src/lib/components/BaseDay.svelte +50 -0
- package/src/lib/components/BaseEvent.svelte +3 -3
- package/src/lib/components/ColHead.svelte +34 -0
- package/src/lib/components/DayHeader.svelte +14 -0
- package/src/lib/components/InteractableEvent.svelte +1 -3
- package/src/lib/components/index.js +3 -0
- package/src/lib/date.js +1 -1
- package/src/lib/dom.js +0 -4
- package/src/lib/events.js +10 -134
- package/src/lib/index.js +3 -2
- package/src/lib/{times.js → slots.js} +14 -19
- package/src/lib/stores.js +0 -33
- package/src/lib/utils.js +11 -2
- package/src/lib/view.js +0 -4
- package/src/plugins/day-grid/Day.svelte +36 -129
- package/src/plugins/day-grid/Event.svelte +42 -41
- package/src/plugins/day-grid/Popup.svelte +65 -48
- package/src/plugins/day-grid/View.svelte +76 -4
- package/src/plugins/day-grid/index.js +5 -5
- package/src/plugins/day-grid/lib.js +61 -0
- package/src/plugins/day-grid/stores.js +2 -20
- package/src/plugins/interaction/Action.svelte +37 -43
- package/src/plugins/interaction/Auxiliary.svelte +4 -4
- package/src/plugins/interaction/Pointer.svelte +8 -12
- package/src/plugins/interaction/Resizer.svelte +2 -2
- package/src/plugins/interaction/lib/utils.js +1 -5
- package/src/plugins/list/Day.svelte +8 -24
- package/src/plugins/list/View.svelte +39 -2
- package/src/plugins/resource-time-grid/Label.svelte +2 -2
- package/src/plugins/resource-time-grid/View.svelte +38 -82
- package/src/plugins/resource-time-grid/index.js +18 -10
- package/src/plugins/resource-time-grid/lib.js +31 -0
- package/src/plugins/resource-time-grid/options.js +10 -0
- package/src/plugins/resource-time-grid/stores.js +34 -0
- package/src/plugins/resource-timeline/Day.svelte +10 -73
- package/src/plugins/resource-timeline/Event.svelte +14 -23
- package/src/plugins/resource-timeline/Header.svelte +5 -5
- package/src/plugins/resource-timeline/Label.svelte +4 -12
- package/src/plugins/resource-timeline/NowIndicator.svelte +33 -28
- package/src/plugins/resource-timeline/View.svelte +129 -14
- package/src/plugins/resource-timeline/index.js +26 -23
- package/src/plugins/resource-timeline/lib.js +115 -118
- package/src/plugins/resource-timeline/stores.js +11 -7
- package/src/plugins/time-grid/AllDayEvent.svelte +31 -0
- package/src/plugins/time-grid/Day.svelte +11 -99
- package/src/plugins/time-grid/Event.svelte +18 -20
- package/src/plugins/time-grid/NowIndicator.svelte +32 -10
- package/src/plugins/time-grid/View.svelte +127 -35
- package/src/plugins/time-grid/index.js +10 -8
- package/src/plugins/time-grid/lib.js +142 -0
- package/src/plugins/time-grid/options.js +57 -0
- package/src/plugins/time-grid/stores.js +41 -8
- package/src/storage/options.js +4 -39
- package/src/storage/state.js +1 -4
- package/src/storage/stores.js +42 -11
- package/src/styles/days.css +91 -0
- package/src/styles/events.css +180 -0
- package/src/styles/index.css +126 -0
- package/src/styles/now-indicator.css +35 -0
- package/src/styles/popup.css +30 -0
- package/src/styles/sidebar.css +59 -0
- package/src/styles/slots.css +42 -0
- package/src/styles/theme.css +68 -0
- package/src/styles/toolbar.css +80 -0
- package/src/lib/actions.js +0 -52
- package/src/plugins/day-grid/Body.svelte +0 -54
- package/src/plugins/day-grid/Header.svelte +0 -20
- package/src/plugins/day-grid/Week.svelte +0 -60
- package/src/plugins/list/Body.svelte +0 -44
- package/src/plugins/resource-timeline/Body.svelte +0 -67
- package/src/plugins/resource-timeline/Days.svelte +0 -72
- package/src/plugins/resource-timeline/Sidebar.svelte +0 -35
- package/src/plugins/time-grid/Body.svelte +0 -43
- package/src/plugins/time-grid/Section.svelte +0 -29
- package/src/plugins/time-grid/all-day/Day.svelte +0 -65
- package/src/plugins/time-grid/all-day/Event.svelte +0 -37
- package/src/plugins/time-grid/all-day/Week.svelte +0 -65
- package/src/plugins/time-grid/utils.js +0 -58
- package/src/styles/day-grid.scss +0 -51
- package/src/styles/index.scss +0 -553
- package/src/styles/theme.scss +0 -95
- package/src/styles/time-grid.scss +0 -83
- package/src/styles/timeline.scss +0 -152
|
@@ -1,16 +1,49 @@
|
|
|
1
|
-
import {derived} from 'svelte/store';
|
|
2
|
-
import {createDate, createSlotTimeLimits,
|
|
1
|
+
import {derived, writable} from 'svelte/store';
|
|
2
|
+
import {ceil, createDate, createSlotTimeLimits, createSlots, intl, setMidnight, toSeconds} from '#lib';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function slotTimeLimits(state) {
|
|
5
5
|
return derived(
|
|
6
|
-
[state.
|
|
7
|
-
args =>
|
|
6
|
+
[state.slotMinTime, state.slotMaxTime, state.flexibleSlotTimeLimits, state._viewDates, state._filteredEvents],
|
|
7
|
+
args => createSlotTimeLimits(...args)
|
|
8
8
|
);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
function slotLabelPeriodicity(state) {
|
|
12
12
|
return derived(
|
|
13
|
-
[state.
|
|
14
|
-
|
|
13
|
+
[state.slotDuration, state.slotLabelInterval],
|
|
14
|
+
([$slotDuration, $slotLabelInterval]) => {
|
|
15
|
+
if ($slotLabelInterval === undefined) {
|
|
16
|
+
return toSeconds($slotDuration) < 3600 ? 2 : 1;
|
|
17
|
+
}
|
|
18
|
+
return ceil(toSeconds($slotLabelInterval) / toSeconds($slotDuration)) || 1;
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function slots(state) {
|
|
24
|
+
return derived(
|
|
25
|
+
[state.slotDuration, state._slotLabelPeriodicity, state._slotTimeLimits, state._intlSlotLabel],
|
|
26
|
+
args => createSlots(setMidnight(createDate()), ...args)
|
|
15
27
|
);
|
|
16
28
|
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* TimeGrid + ResourceTimeGrid + ResourceTimeline
|
|
32
|
+
*/
|
|
33
|
+
export function createTRRStores(state) {
|
|
34
|
+
if (!('_sidebarWidth' in state)) {
|
|
35
|
+
state._intlSlotLabel = intl(state.locale, state.slotLabelFormat);
|
|
36
|
+
state._slotLabelPeriodicity = slotLabelPeriodicity(state);
|
|
37
|
+
state._sidebarWidth = writable(0);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* TimeGrid + ResourceTimeGrid
|
|
43
|
+
*/
|
|
44
|
+
export function createTRStores(state) {
|
|
45
|
+
if (!('_slots' in state)) {
|
|
46
|
+
state._slotTimeLimits = slotTimeLimits(state); // flexible limits
|
|
47
|
+
state._slots = slots(state);
|
|
48
|
+
}
|
|
49
|
+
}
|
package/src/storage/options.js
CHANGED
|
@@ -7,8 +7,6 @@ export const specialOptions = ['buttonText', 'customButtons', 'theme'];
|
|
|
7
7
|
|
|
8
8
|
export function createOptions(plugins) {
|
|
9
9
|
let options = {
|
|
10
|
-
allDayContent: undefined,
|
|
11
|
-
allDaySlot: true,
|
|
12
10
|
buttonText: {
|
|
13
11
|
today: 'today',
|
|
14
12
|
},
|
|
@@ -44,9 +42,7 @@ export function createOptions(plugins) {
|
|
|
44
42
|
minute: '2-digit'
|
|
45
43
|
},
|
|
46
44
|
filterEventsWithResources: false,
|
|
47
|
-
filterResourcesWithEvents: false,
|
|
48
45
|
firstDay: 0,
|
|
49
|
-
flexibleSlotTimeLimits: false, // ec option
|
|
50
46
|
headerToolbar: {
|
|
51
47
|
start: 'title',
|
|
52
48
|
center: '',
|
|
@@ -58,23 +54,8 @@ export function createOptions(plugins) {
|
|
|
58
54
|
lazyFetching: true,
|
|
59
55
|
loading: undefined,
|
|
60
56
|
locale: undefined,
|
|
61
|
-
nowIndicator: false,
|
|
62
|
-
resourceLabelContent: undefined,
|
|
63
|
-
resourceLabelDidMount: undefined,
|
|
64
57
|
resources: [],
|
|
65
58
|
selectable: false,
|
|
66
|
-
scrollTime: '06:00:00',
|
|
67
|
-
slotDuration: '00:30:00',
|
|
68
|
-
slotEventOverlap: true,
|
|
69
|
-
slotHeight: 24, // ec option
|
|
70
|
-
slotLabelInterval: undefined,
|
|
71
|
-
slotLabelFormat: {
|
|
72
|
-
hour: 'numeric',
|
|
73
|
-
minute: '2-digit'
|
|
74
|
-
},
|
|
75
|
-
slotMaxTime: '24:00:00',
|
|
76
|
-
slotMinTime: '00:00:00',
|
|
77
|
-
slotWidth: 72,
|
|
78
59
|
theme: {
|
|
79
60
|
allDay: 'ec-all-day',
|
|
80
61
|
active: 'ec-active',
|
|
@@ -84,37 +65,26 @@ export function createOptions(plugins) {
|
|
|
84
65
|
button: 'ec-button',
|
|
85
66
|
buttonGroup: 'ec-button-group',
|
|
86
67
|
calendar: 'ec',
|
|
87
|
-
|
|
68
|
+
colHead: 'ec-col-head',
|
|
88
69
|
day: 'ec-day',
|
|
89
70
|
dayHead: 'ec-day-head',
|
|
90
|
-
days: 'ec-days',
|
|
91
71
|
disabled: 'ec-disabled',
|
|
92
72
|
event: 'ec-event',
|
|
93
73
|
eventBody: 'ec-event-body',
|
|
94
74
|
eventTime: 'ec-event-time',
|
|
95
75
|
eventTitle: 'ec-event-title',
|
|
96
76
|
events: 'ec-events',
|
|
97
|
-
|
|
98
|
-
handle: 'ec-handle',
|
|
77
|
+
grid: 'ec-grid',
|
|
99
78
|
header: 'ec-header',
|
|
100
|
-
|
|
79
|
+
hidden: 'ec-hidden',
|
|
101
80
|
highlight: 'ec-highlight',
|
|
102
81
|
icon: 'ec-icon',
|
|
103
|
-
|
|
104
|
-
lines: 'ec-lines',
|
|
105
|
-
minor: 'ec-minor',
|
|
106
|
-
nowIndicator: 'ec-now-indicator',
|
|
107
|
-
otherMonth: 'ec-other-month',
|
|
108
|
-
resource: 'ec-resource',
|
|
109
|
-
sidebar: 'ec-sidebar',
|
|
110
|
-
sidebarTitle: 'ec-sidebar-title',
|
|
82
|
+
main: 'ec-main',
|
|
111
83
|
today: 'ec-today',
|
|
112
|
-
time: 'ec-time',
|
|
113
84
|
title: 'ec-title',
|
|
114
85
|
toolbar: 'ec-toolbar',
|
|
115
86
|
view: '',
|
|
116
87
|
weekdays: ['ec-sun', 'ec-mon', 'ec-tue', 'ec-wed', 'ec-thu', 'ec-fri', 'ec-sat'],
|
|
117
|
-
withScroll: 'ec-with-scroll'
|
|
118
88
|
},
|
|
119
89
|
titleFormat: {
|
|
120
90
|
year: 'numeric',
|
|
@@ -143,11 +113,6 @@ export function createParsers(plugins) {
|
|
|
143
113
|
hiddenDays: days => [...new Set(days)],
|
|
144
114
|
highlightedDates: dates => dates.map(date => setMidnight(createDate(date))),
|
|
145
115
|
resources: createResources,
|
|
146
|
-
scrollTime: createDuration,
|
|
147
|
-
slotDuration: createDuration,
|
|
148
|
-
slotLabelInterval: input => input !== undefined ? createDuration(input) : undefined,
|
|
149
|
-
slotMaxTime: createDuration,
|
|
150
|
-
slotMinTime: createDuration,
|
|
151
116
|
validRange: createDateRange
|
|
152
117
|
};
|
|
153
118
|
|
package/src/storage/state.js
CHANGED
|
@@ -30,16 +30,13 @@ export default class {
|
|
|
30
30
|
this._activeRange = activeRange(this);
|
|
31
31
|
this._fetchedRange = writable({start: undefined, end: undefined});
|
|
32
32
|
this._events = events(this);
|
|
33
|
+
this._mainEl = writable(undefined);
|
|
33
34
|
this._now = now();
|
|
34
35
|
this._today = today(this);
|
|
35
36
|
this._intlEventTime = intlRange(this.locale, this.eventTimeFormat);
|
|
36
|
-
this._intlSlotLabel = intl(this.locale, this.slotLabelFormat);
|
|
37
37
|
this._intlDayHeader = intl(this.locale, this.dayHeaderFormat);
|
|
38
38
|
this._intlDayHeaderAL = intl(this.locale, this.dayHeaderAriaLabelFormat);
|
|
39
39
|
this._intlTitle = intlRange(this.locale, this.titleFormat);
|
|
40
|
-
this._bodyEl = writable(undefined);
|
|
41
|
-
this._scrollable = writable(false);
|
|
42
|
-
this._recheckScrollable = writable(false);
|
|
43
40
|
this._viewTitle = viewTitle(this);
|
|
44
41
|
this._viewDates = viewDates(this);
|
|
45
42
|
this._view = view2(this);
|
package/src/storage/stores.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {derived, get, readable, writable} from 'svelte/store';
|
|
2
2
|
import {
|
|
3
|
-
addDay, addDuration, assign, cloneDate, createDate, createEvents, createView, DAY_IN_SECONDS, debounce,
|
|
4
|
-
isFunction, nextClosestDay, prevClosestDay, setMidnight, subtractDay, toISOString,
|
|
3
|
+
addDay, addDuration, assign, cloneDate, createDate, createEvents, createView, datesEqual, DAY_IN_SECONDS, debounce,
|
|
4
|
+
isFunction, nextClosestDay, prevClosestDay, setMidnight, subtractDay, toEventWithLocalDates, toISOString,
|
|
5
|
+
toLocalDate
|
|
5
6
|
} from '#lib';
|
|
6
7
|
|
|
7
8
|
export function dayGrid(state) {
|
|
@@ -184,19 +185,40 @@ export function filteredEvents(state){
|
|
|
184
185
|
state._view.subscribe($_view => view = $_view);
|
|
185
186
|
let debounceHandle = {};
|
|
186
187
|
return derived(
|
|
187
|
-
[state._events, state.eventFilter],
|
|
188
|
+
[state._events, state.eventFilter, state.eventOrder, state.filterEventsWithResources, state.resources],
|
|
188
189
|
(values, set) => debounce(() => {
|
|
189
|
-
let [$_events, $eventFilter] = values;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
let [$_events, $eventFilter, $eventOrder, $filterEventsWithResources, $resources] = values;
|
|
191
|
+
|
|
192
|
+
let result = [...$_events];
|
|
193
|
+
|
|
194
|
+
// Filter events
|
|
195
|
+
if (isFunction($eventFilter)) {
|
|
196
|
+
result = result
|
|
197
|
+
.map(toEventWithLocalDates)
|
|
198
|
+
.filter((event, index, events) => $eventFilter({
|
|
193
199
|
event,
|
|
194
200
|
index,
|
|
195
201
|
events,
|
|
196
202
|
view
|
|
197
|
-
}))
|
|
198
|
-
|
|
199
|
-
)
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
205
|
+
if ($filterEventsWithResources) {
|
|
206
|
+
result = result.filter(event => $resources.some(resource => event.resourceIds.includes(resource.id)));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Sort events
|
|
210
|
+
if (isFunction($eventOrder)) {
|
|
211
|
+
result.sort((a, b) => $eventOrder(
|
|
212
|
+
toEventWithLocalDates(a),
|
|
213
|
+
toEventWithLocalDates(b)
|
|
214
|
+
));
|
|
215
|
+
} else {
|
|
216
|
+
// Sort by start date (all-day events always on top)
|
|
217
|
+
result.sort((a, b) => a.start - b.start || b.allDay - a.allDay);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
set(result);
|
|
221
|
+
|
|
200
222
|
}, debounceHandle, state._queue),
|
|
201
223
|
[]
|
|
202
224
|
);
|
|
@@ -213,5 +235,14 @@ export function now() {
|
|
|
213
235
|
}
|
|
214
236
|
|
|
215
237
|
export function today(state) {
|
|
216
|
-
|
|
238
|
+
let $today = createDate();
|
|
239
|
+
let today = writable($today);
|
|
240
|
+
derived(state._now, $_now => setMidnight(cloneDate($_now))).subscribe(newToday => {
|
|
241
|
+
if (!datesEqual($today, newToday)) {
|
|
242
|
+
$today = newToday;
|
|
243
|
+
today.set(newToday);
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
return today;
|
|
217
248
|
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
.ec-day {
|
|
2
|
+
--ec-day-bg-color: var(--ec-bg-color);
|
|
3
|
+
background-color: var(--ec-day-bg-color);
|
|
4
|
+
|
|
5
|
+
&.ec-today {
|
|
6
|
+
--ec-day-bg-color: var(--ec-today-bg-color);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&.ec-highlight {
|
|
10
|
+
--ec-day-bg-color: var(--ec-highlight-color);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ec-time-grid .ec-body & {
|
|
14
|
+
background-image:
|
|
15
|
+
linear-gradient(var(--ec-day-bg-color) 1px, transparent 1px),
|
|
16
|
+
linear-gradient(var(--ec-border-color) 1px, transparent 1px),
|
|
17
|
+
linear-gradient(to right, var(--ec-day-bg-color) 1px, transparent 1px),
|
|
18
|
+
linear-gradient(var(--ec-border-color) 1px, transparent 1px);
|
|
19
|
+
background-size:
|
|
20
|
+
100% 100%,
|
|
21
|
+
100% calc(var(--ec-slot-height) * var(--ec-slot-label-periodicity)),
|
|
22
|
+
2px 100%,
|
|
23
|
+
100% var(--ec-slot-height);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ec-timeline:not(.ec-month-view) .ec-body & {
|
|
27
|
+
background-image:
|
|
28
|
+
linear-gradient(to right, var(--ec-day-bg-color) 1px, transparent 1px),
|
|
29
|
+
linear-gradient(to right, var(--ec-border-color) 1px, transparent 1px),
|
|
30
|
+
linear-gradient(var(--ec-day-bg-color) 1px, transparent 1px),
|
|
31
|
+
linear-gradient(to right, var(--ec-border-color) 1px, transparent 1px);
|
|
32
|
+
background-size:
|
|
33
|
+
100% 100%,
|
|
34
|
+
calc(var(--ec-slot-width) * var(--ec-slot-label-periodicity)) 100%,
|
|
35
|
+
100% 2px,
|
|
36
|
+
var(--ec-slot-width) 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ec-day-grid & {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
min-block-size: 5em;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ec-day-grid .ec-uniform & {
|
|
47
|
+
min-block-size: auto;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ec-day-head {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: row-reverse;
|
|
54
|
+
justify-content: space-between;
|
|
55
|
+
padding: .375rem;
|
|
56
|
+
|
|
57
|
+
.ec-day.ec-other-month & time {
|
|
58
|
+
opacity: .3;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ec-list & {
|
|
62
|
+
background-color: var(--ec-day-bg-color);
|
|
63
|
+
border-block-end: 1px solid var(--ec-border-color);
|
|
64
|
+
flex-direction: unset;
|
|
65
|
+
margin: 0 0 -1px;
|
|
66
|
+
padding: .5em 1.5em;
|
|
67
|
+
position: sticky;
|
|
68
|
+
inset-block-start: 0;
|
|
69
|
+
z-index: 2;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ec-day-foot {
|
|
74
|
+
padding: .18rem;
|
|
75
|
+
font-size: .85em;
|
|
76
|
+
|
|
77
|
+
a {
|
|
78
|
+
cursor: pointer;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ec-disabled {
|
|
83
|
+
position: relative;
|
|
84
|
+
&:after {
|
|
85
|
+
content: '';
|
|
86
|
+
position: absolute;
|
|
87
|
+
inset: 0 0 0 0;
|
|
88
|
+
background-color: var(--ec-bg-event-color);
|
|
89
|
+
opacity: var(--ec-bg-event-opacity);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
.ec-events {
|
|
2
|
+
grid-area: 1 / 2 / -1 / -1;
|
|
3
|
+
display: grid;
|
|
4
|
+
grid-template: subgrid / subgrid;
|
|
5
|
+
isolation: isolate;
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
|
|
8
|
+
.ec-day-grid & {
|
|
9
|
+
grid-column-start: 1;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ec-event {
|
|
14
|
+
display: flex;
|
|
15
|
+
position: relative;
|
|
16
|
+
padding: 2px;
|
|
17
|
+
color: var(--ec-event-text-color);
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
box-shadow: 0 0 1px 0 var(--ec-border-color);
|
|
20
|
+
background-color: var(--ec-event-bg-color);
|
|
21
|
+
border-radius: 3px;
|
|
22
|
+
font-size: .85em;
|
|
23
|
+
line-height: 1.5;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
pointer-events: all;
|
|
26
|
+
inline-size: calc(100% - var(--ec-event-col-gap));
|
|
27
|
+
|
|
28
|
+
.ec-time-grid & {
|
|
29
|
+
grid-row: 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ec-day-grid &,
|
|
33
|
+
.ec-all-day &,
|
|
34
|
+
.ec-timeline & {
|
|
35
|
+
block-size: fit-content;
|
|
36
|
+
margin-block-end: var(--ec-event-col-gap);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ec-list & {
|
|
40
|
+
flex-direction: row;
|
|
41
|
+
padding: .5em 1.5em;
|
|
42
|
+
color: inherit;
|
|
43
|
+
background-color: var(--ec-day-bg-color);
|
|
44
|
+
border-radius: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&.ec-preview {
|
|
48
|
+
z-index: 1000;
|
|
49
|
+
user-select: none;
|
|
50
|
+
opacity: .8;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&.ec-pointer {
|
|
54
|
+
color: inherit;
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
user-select: none;
|
|
57
|
+
z-index: 0;
|
|
58
|
+
box-shadow: none;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.ec-bg-event {
|
|
63
|
+
grid-row: 1;
|
|
64
|
+
position: relative;
|
|
65
|
+
background-color: var(--ec-bg-event-color);
|
|
66
|
+
opacity: var(--ec-bg-event-opacity);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ec-draggable {
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
user-select: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ec-ghost {
|
|
75
|
+
opacity: .5;
|
|
76
|
+
user-select: none;
|
|
77
|
+
pointer-events: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.ec-event-body {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
inline-size: 100%;
|
|
84
|
+
|
|
85
|
+
.ec-day-grid &,
|
|
86
|
+
.ec-all-day &,
|
|
87
|
+
.ec-timeline & {
|
|
88
|
+
flex-direction: row;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ec-event-tag {
|
|
93
|
+
inline-size: 4px;
|
|
94
|
+
border-radius: 2px;
|
|
95
|
+
margin-inline-end: 8px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.ec-event-time {
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
white-space: nowrap;
|
|
101
|
+
margin: 0 0 1px 0;
|
|
102
|
+
flex-shrink: 0;
|
|
103
|
+
max-block-size: 100%;
|
|
104
|
+
|
|
105
|
+
.ec-day-grid &,
|
|
106
|
+
.ec-timeline & {
|
|
107
|
+
margin: 0 3px 0 0;
|
|
108
|
+
max-inline-size: 100%;
|
|
109
|
+
text-overflow: ellipsis;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.ec-event-title {
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
margin: 0;
|
|
116
|
+
font-weight: inherit;
|
|
117
|
+
|
|
118
|
+
.ec-time-grid & {
|
|
119
|
+
position: sticky;
|
|
120
|
+
inset-block-start: var(--ec-header-height);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.ec-day-grid &,
|
|
124
|
+
.ec-all-day &,
|
|
125
|
+
.ec-timeline & {
|
|
126
|
+
min-block-size: 1.5em;
|
|
127
|
+
white-space: nowrap;
|
|
128
|
+
text-overflow: ellipsis;
|
|
129
|
+
position: sticky;
|
|
130
|
+
inset-inline-start: calc(var(--ec-sidebar-width) + .18em);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.ec-list & {
|
|
134
|
+
font-size: 1rem;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.ec-resizer {
|
|
139
|
+
position: absolute;
|
|
140
|
+
user-select: none;
|
|
141
|
+
|
|
142
|
+
.ec-time-grid .ec-body & {
|
|
143
|
+
inset: auto 0 0 0;
|
|
144
|
+
block-size: 50%;
|
|
145
|
+
max-block-size: 8px;
|
|
146
|
+
cursor: ns-resize;
|
|
147
|
+
|
|
148
|
+
&.ec-start {
|
|
149
|
+
inset: 0 0 auto 0;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
.ec-day-grid &,
|
|
153
|
+
.ec-all-day &,
|
|
154
|
+
.ec-timeline & {
|
|
155
|
+
inset: 0 0 0 auto;
|
|
156
|
+
inline-size: 50%;
|
|
157
|
+
max-inline-size: 8px;
|
|
158
|
+
cursor: ew-resize;
|
|
159
|
+
|
|
160
|
+
&.ec-start {
|
|
161
|
+
inset: 0 auto 0 0;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.ec-dragging, .ec-dragging * {
|
|
167
|
+
cursor: pointer!important;
|
|
168
|
+
}
|
|
169
|
+
.ec-resizing-y, .ec-resizing-y * {
|
|
170
|
+
cursor: ns-resize!important;
|
|
171
|
+
}
|
|
172
|
+
.ec-resizing-x, .ec-resizing-x * {
|
|
173
|
+
cursor: ew-resize!important;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.ec-no-events {
|
|
177
|
+
text-align: center;
|
|
178
|
+
padding: 5em 0;
|
|
179
|
+
background-color: var(--ec-bg-color);
|
|
180
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
@import "theme.css";
|
|
2
|
+
@import "days.css";
|
|
3
|
+
@import "toolbar.css";
|
|
4
|
+
@import "sidebar.css";
|
|
5
|
+
@import "slots.css";
|
|
6
|
+
@import "events.css";
|
|
7
|
+
@import "now-indicator.css";
|
|
8
|
+
@import "popup.css";
|
|
9
|
+
|
|
10
|
+
.ec {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ec-main {
|
|
16
|
+
display: grid;
|
|
17
|
+
gap: 1px;
|
|
18
|
+
background-color: var(--ec-border-color);
|
|
19
|
+
border: 1px solid var(--ec-border-color);
|
|
20
|
+
overflow: auto;
|
|
21
|
+
/*scrollbar-width: thin;*/
|
|
22
|
+
|
|
23
|
+
.ec-time-grid & {
|
|
24
|
+
grid-template-columns: max-content repeat(var(--ec-grid-cols), var(--ec-col-width));
|
|
25
|
+
grid-template-rows: repeat(2, max-content);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.ec-day-grid & {
|
|
29
|
+
--ec-row-height: auto;
|
|
30
|
+
grid-template-columns: repeat(var(--ec-grid-cols), minmax(0, 1fr));
|
|
31
|
+
grid-template-rows: max-content repeat(var(--ec-grid-rows), var(--ec-row-height));
|
|
32
|
+
|
|
33
|
+
&.ec-uniform {
|
|
34
|
+
--ec-row-height: minmax(0, 1fr);
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
flex-grow: 1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.ec-timeline & {
|
|
41
|
+
grid-template-columns: max-content repeat(var(--ec-grid-cols), min-content);
|
|
42
|
+
grid-template-rows: max-content repeat(calc(var(--ec-grid-rows) - 1), auto) minmax(auto, 1fr);
|
|
43
|
+
flex-grow: 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ec-timeline.ec-month-view & {
|
|
47
|
+
grid-template-columns: max-content repeat(var(--ec-grid-cols), var(--ec-col-width));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ec-list & {
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ec-header {
|
|
56
|
+
grid-area: 1 / 1 / 2 / -1;
|
|
57
|
+
display: grid;
|
|
58
|
+
grid-template-columns: subgrid;
|
|
59
|
+
gap: 1px;
|
|
60
|
+
background-color: var(--ec-border-color);
|
|
61
|
+
position: sticky;
|
|
62
|
+
inset-block-start: 0;
|
|
63
|
+
z-index: 2;
|
|
64
|
+
border-block-end: 1px solid var(--ec-border-color);
|
|
65
|
+
margin-block-end: -1px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ec-grid {
|
|
69
|
+
grid-area: 1 / 1 / -1 / -1;
|
|
70
|
+
display: grid;
|
|
71
|
+
grid-template-columns: subgrid;
|
|
72
|
+
gap: 1px;
|
|
73
|
+
|
|
74
|
+
.ec-body & {
|
|
75
|
+
grid-template-rows: subgrid;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ec-time-grid &,
|
|
79
|
+
.ec-timeline & {
|
|
80
|
+
grid-column-start: 2;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.ec-all-day {
|
|
85
|
+
grid-area: 2 / 1 / auto / -1;
|
|
86
|
+
display: grid;
|
|
87
|
+
grid-template-columns: subgrid;
|
|
88
|
+
min-block-size: var(--ec-slot-height);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ec-col-group {
|
|
92
|
+
grid-column: span var(--ec-col-group-span);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ec-col-group,
|
|
96
|
+
.ec-col-head {
|
|
97
|
+
text-align: center;
|
|
98
|
+
padding: .375rem .18em;
|
|
99
|
+
background-color: var(--ec-bg-color);
|
|
100
|
+
overflow: clip;
|
|
101
|
+
text-overflow: ellipsis;
|
|
102
|
+
|
|
103
|
+
&.ec-today {
|
|
104
|
+
background-color: var(--ec-today-bg-color);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&.ec-highlight {
|
|
108
|
+
background-color: var(--ec-highlight-color);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ec-col-group > *,
|
|
113
|
+
.ec-timeline .ec-col-head > * {
|
|
114
|
+
position: sticky;
|
|
115
|
+
inset-inline-start: calc(var(--ec-sidebar-width) + .18em);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.ec-body {
|
|
119
|
+
grid-area: 2 / 1 / -1 / -1;
|
|
120
|
+
display: grid;
|
|
121
|
+
grid-template: subgrid / subgrid;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.ec-hidden {
|
|
125
|
+
visibility: hidden;
|
|
126
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
.ec-now-indicator {
|
|
2
|
+
grid-row: 2;
|
|
3
|
+
position: relative;
|
|
4
|
+
pointer-events: none;
|
|
5
|
+
will-change: inset;
|
|
6
|
+
|
|
7
|
+
.ec-time-grid & {
|
|
8
|
+
inline-size: 100%;
|
|
9
|
+
block-size: 0;
|
|
10
|
+
border-block-start: var(--ec-now-indicator-color) solid 2px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ec-timeline & {
|
|
14
|
+
inline-size: 0;
|
|
15
|
+
border-inline-start: var(--ec-now-indicator-color) solid 2px;
|
|
16
|
+
|
|
17
|
+
&:before {
|
|
18
|
+
inset-block-start: calc(var(--ec-header-height) - 6.5px);
|
|
19
|
+
z-index: 2;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:before {
|
|
24
|
+
background: var(--ec-now-indicator-color);
|
|
25
|
+
border-radius: 50%;
|
|
26
|
+
content: "";
|
|
27
|
+
display: block;
|
|
28
|
+
block-size: 12px;
|
|
29
|
+
inline-size: 12px;
|
|
30
|
+
margin: -7px 0 0 -7px;
|
|
31
|
+
position: sticky;
|
|
32
|
+
inset-inline-start: calc(var(--ec-sidebar-width) - 6.5px);
|
|
33
|
+
z-index: 1;
|
|
34
|
+
}
|
|
35
|
+
}
|