@event-calendar/core 5.0.0 → 5.0.2
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 +8 -8
- package/dist/index.css +89 -31
- package/dist/index.js +284 -136
- package/package.json +2 -2
- package/src/lib/components/BaseDay.svelte +5 -1
- package/src/lib/utils.js +4 -0
- package/src/plugins/day-grid/Day.svelte +2 -2
- package/src/plugins/day-grid/View.svelte +3 -3
- package/src/plugins/interaction/Action.svelte +18 -11
- package/src/plugins/resource-time-grid/View.svelte +29 -13
- package/src/plugins/resource-time-grid/index.js +1 -0
- package/src/plugins/resource-timeline/Day.svelte +2 -2
- package/src/plugins/resource-timeline/Event.svelte +2 -2
- package/src/plugins/resource-timeline/NowIndicator.svelte +2 -2
- package/src/plugins/resource-timeline/View.svelte +4 -6
- package/src/plugins/resource-timeline/lib.js +1 -1
- package/src/plugins/time-grid/Day.svelte +2 -2
- package/src/plugins/time-grid/NowIndicator.svelte +9 -6
- package/src/plugins/time-grid/View.svelte +15 -13
- package/src/storage/options.js +2 -0
- package/src/storage/stores.js +3 -3
- package/src/styles/days.css +35 -6
- package/src/styles/index.css +8 -7
- package/src/styles/now-indicator.css +2 -1
- package/src/styles/sidebar.css +21 -11
- package/src/styles/slots.css +12 -2
- package/src/styles/toolbar.css +11 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event-calendar/core",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"title": "Event Calendar Core package",
|
|
5
5
|
"description": "Full-sized drag & drop event calendar with resource & timeline views",
|
|
6
6
|
"keywords": [
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
"#components": "./src/lib/components/index.js"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"svelte": "^5.
|
|
35
|
+
"svelte": "^5.46.0"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
disabled = false,
|
|
13
13
|
highlight = false,
|
|
14
14
|
role = 'cell',
|
|
15
|
+
noIeb = false,
|
|
16
|
+
noBeb = false,
|
|
15
17
|
children
|
|
16
18
|
} = $props();
|
|
17
19
|
|
|
@@ -25,7 +27,9 @@
|
|
|
25
27
|
$theme.weekdays?.[date.getUTCDay()],
|
|
26
28
|
isToday && $theme.today,
|
|
27
29
|
highlight && $theme.highlight,
|
|
28
|
-
disabled && $theme.disabled
|
|
30
|
+
disabled && $theme.disabled,
|
|
31
|
+
noIeb && $theme.noIeb,
|
|
32
|
+
noBeb && $theme.noBeb
|
|
29
33
|
]));
|
|
30
34
|
|
|
31
35
|
// dateFromPoint
|
package/src/lib/utils.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
} from '#lib';
|
|
6
6
|
import {BaseDay} from '#components';
|
|
7
7
|
|
|
8
|
-
let {day} = $props();
|
|
8
|
+
let {day, noIeb, noBeb} = $props();
|
|
9
9
|
|
|
10
10
|
let {
|
|
11
11
|
date, firstDay, moreLinkContent, theme, weekNumbers, weekNumberContent, _hiddenChunks, _intlDayCell, _popupDay
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
}
|
|
56
56
|
</script>
|
|
57
57
|
|
|
58
|
-
<BaseDay date={dayStart} allDay {classes} {disabled} {highlight}>
|
|
58
|
+
<BaseDay date={dayStart} allDay {classes} {disabled} {highlight} {noIeb} {noBeb}>
|
|
59
59
|
<div class="{$theme.dayHead}">
|
|
60
60
|
<time
|
|
61
61
|
datetime="{toISOString(dayStart, 10)}"
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
|
|
54
54
|
<div class="{$theme.body}">
|
|
55
55
|
<div bind:this={gridEl} class="{$theme.grid}">
|
|
56
|
-
{#each grid as days}
|
|
57
|
-
{#each days as day}
|
|
58
|
-
<Day {day}/>
|
|
56
|
+
{#each grid as days, i}
|
|
57
|
+
{#each days as day, j}
|
|
58
|
+
<Day {day} noIeb={j + 1 === days.length} noBeb={i + 1 === grid.length}/>
|
|
59
59
|
{/each}
|
|
60
60
|
{/each}
|
|
61
61
|
</div>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
let resource, newResource;
|
|
28
28
|
let fromX, fromY;
|
|
29
29
|
let toX, toY;
|
|
30
|
-
let gridEl,
|
|
30
|
+
let gridEl, allDaySlot;
|
|
31
31
|
let delta;
|
|
32
32
|
let allDay;
|
|
33
33
|
let iClass;
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
let dayEl = getElementWithPayload(toX, toY);
|
|
181
181
|
({allDay, date, resource} = getPayload(dayEl)(toX, toY));
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
allDaySlot = $_mainEl !== ancestor(dayEl, 3);
|
|
184
184
|
gridEl = ancestor(dayEl, 1);
|
|
185
185
|
calcViewport();
|
|
186
186
|
|
|
@@ -285,19 +285,19 @@
|
|
|
285
285
|
let thresholdX = 24;
|
|
286
286
|
animate(() => {
|
|
287
287
|
if (viewport) {
|
|
288
|
-
if (
|
|
288
|
+
if (!allDaySlot) {
|
|
289
289
|
if (toY < viewport.top + thresholdY) {
|
|
290
290
|
$_mainEl.scrollTop += max(-8, (toY - viewport.top - thresholdY) / 3);
|
|
291
291
|
}
|
|
292
292
|
if (toY > viewport.bottom - thresholdY) {
|
|
293
293
|
$_mainEl.scrollTop += min(8, (toY - viewport.bottom + thresholdY) / 3);
|
|
294
294
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
295
|
+
}
|
|
296
|
+
if (toX < viewport.left + thresholdX) {
|
|
297
|
+
$_mainEl.scrollLeft += max(-8, (toX - viewport.left - thresholdX) / 3);
|
|
298
|
+
}
|
|
299
|
+
if (toX > viewport.right - thresholdX) {
|
|
300
|
+
$_mainEl.scrollLeft += min(8, (toX - viewport.right + thresholdX) / 3);
|
|
301
301
|
}
|
|
302
302
|
if (toY < thresholdY) {
|
|
303
303
|
window.scrollBy(0, max(-8, (toY - thresholdY) / 3));
|
|
@@ -417,6 +417,13 @@
|
|
|
417
417
|
return findPayload(dayEl.previousElementSibling);
|
|
418
418
|
}
|
|
419
419
|
} else {
|
|
420
|
+
if (selecting() && payload.resource && !$_iEvents[0].resourceIds.includes(payload.resource.id)) {
|
|
421
|
+
if (toX > fromX) {
|
|
422
|
+
return findPayload(dayEl.previousElementSibling);
|
|
423
|
+
} else {
|
|
424
|
+
return findPayload(dayEl.nextElementSibling);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
420
427
|
return payload;
|
|
421
428
|
}
|
|
422
429
|
}
|
|
@@ -429,8 +436,8 @@
|
|
|
429
436
|
viewport = {
|
|
430
437
|
left: max(0, gridRect.left + $_mainEl.scrollLeft),
|
|
431
438
|
right: min(document.documentElement.clientWidth, mainRect.left + $_mainEl.clientWidth) - 2,
|
|
432
|
-
top: max(0, gridRect.top + (
|
|
433
|
-
bottom: min(document.documentElement.clientHeight,
|
|
439
|
+
top: max(0, gridRect.top + (!allDaySlot ? $_mainEl.scrollTop : 0)),
|
|
440
|
+
bottom: min(document.documentElement.clientHeight, !allDaySlot ? mainRect.top + $_mainEl.clientHeight : gridRect.bottom) - 2
|
|
434
441
|
};
|
|
435
442
|
}
|
|
436
443
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import {ColHead, DayHeader} from '#components';
|
|
5
5
|
import Label from './Label.svelte';
|
|
6
6
|
import View from '../time-grid/View.svelte';
|
|
7
|
+
import NowIndicator from '../time-grid/NowIndicator.svelte';
|
|
7
8
|
|
|
8
9
|
let {_viewDates, _viewResources, _slotTimeLimits, datesAboveResources, highlightedDates, validRange, theme} = getContext('state');
|
|
9
10
|
|
|
@@ -14,14 +15,13 @@
|
|
|
14
15
|
createGridFn={() => createGrid(
|
|
15
16
|
$_viewDates, $_viewResources, $_slotTimeLimits, $datesAboveResources, $validRange, $highlightedDates
|
|
16
17
|
)}
|
|
17
|
-
fullwidthNowIndicator={$datesAboveResources}
|
|
18
18
|
>
|
|
19
19
|
{#snippet header(grid)}
|
|
20
20
|
{#each grid as days, i}
|
|
21
21
|
{@const {dayStart: date, resource, disabled, highlight} = days[0]}
|
|
22
22
|
<ColHead
|
|
23
23
|
{date}
|
|
24
|
-
className={$theme.colGroup}
|
|
24
|
+
className={grid[0].length > 1 ? $theme.colGroup : undefined}
|
|
25
25
|
weekday={$datesAboveResources}
|
|
26
26
|
colSpan={days.length}
|
|
27
27
|
colIndex={1 + i * days.length}
|
|
@@ -35,17 +35,33 @@
|
|
|
35
35
|
{/if}
|
|
36
36
|
</ColHead>
|
|
37
37
|
{/each}
|
|
38
|
-
{#
|
|
39
|
-
{#each
|
|
40
|
-
{
|
|
41
|
-
|
|
42
|
-
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
{#if grid[0].length > 1}
|
|
39
|
+
{#each grid as days, i}
|
|
40
|
+
{#each days as day, j}
|
|
41
|
+
{@const {dayStart: date, resource, disabled, highlight} = day}
|
|
42
|
+
<ColHead {date} colIndex={1 + j + i * days.length} {disabled} {highlight}>
|
|
43
|
+
{#if $datesAboveResources}
|
|
44
|
+
<Label {resource} {date}/>
|
|
45
|
+
{:else}
|
|
46
|
+
<DayHeader {date} alPrefix={resourceLabels[i]}/>
|
|
47
|
+
{/if}
|
|
48
|
+
</ColHead>
|
|
49
|
+
{/each}
|
|
48
50
|
{/each}
|
|
49
|
-
{/
|
|
51
|
+
{/if}
|
|
52
|
+
{/snippet}
|
|
53
|
+
|
|
54
|
+
{#snippet nowIndicator(grid)}
|
|
55
|
+
{#if $datesAboveResources}
|
|
56
|
+
<NowIndicator days={grid.flat()} span={grid[0].length}/>
|
|
57
|
+
{:else}
|
|
58
|
+
{#if grid[0].length > 1}
|
|
59
|
+
{#each grid as days}
|
|
60
|
+
<NowIndicator {days} />
|
|
61
|
+
{/each}
|
|
62
|
+
{:else}
|
|
63
|
+
<NowIndicator days={grid.flat()} span={grid.length}/>
|
|
64
|
+
{/if}
|
|
65
|
+
{/if}
|
|
50
66
|
{/snippet}
|
|
51
67
|
</View>
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {addDuration, cloneDate, floor, rect} from '#lib';
|
|
4
4
|
import {BaseDay} from '#components';
|
|
5
5
|
|
|
6
|
-
let {day} = $props();
|
|
6
|
+
let {day, noIeb, noBeb} = $props();
|
|
7
7
|
|
|
8
8
|
let {_monthView, slotDuration, slotWidth} = getContext('state');
|
|
9
9
|
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
}
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
|
-
<BaseDay bind:el allDay={$_monthView} {date} {resource} {dateFromPoint} {disabled} {highlight}/>
|
|
21
|
+
<BaseDay bind:el allDay={$_monthView} {date} {resource} {dateFromPoint} {disabled} {highlight} {noIeb} {noBeb}/>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
let {slotDuration, slotWidth, _monthView} = getContext('state');
|
|
10
10
|
|
|
11
11
|
let el = $state();
|
|
12
|
-
let margin = $state(
|
|
12
|
+
let margin = $state(0);
|
|
13
13
|
let event = $derived(chunk.event);
|
|
14
14
|
// Style
|
|
15
15
|
let styles = $derived(style => {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
if (!$_monthView) {
|
|
19
19
|
let left = chunk.left / toSeconds($slotDuration) * $slotWidth;
|
|
20
20
|
style['inset-inline-start'] = `${left}px`;
|
|
21
|
-
style['inline-size'] = `${chunk.width / toSeconds($slotDuration) * $slotWidth
|
|
21
|
+
style['inline-size'] = `${chunk.width / toSeconds($slotDuration) * $slotWidth}px`;
|
|
22
22
|
}
|
|
23
23
|
let marginTop = margin;
|
|
24
24
|
if (event._margin) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import {getContext} from 'svelte';
|
|
3
|
-
import {datesEqual, toSeconds, intersectionObserver} from '#lib';
|
|
3
|
+
import {datesEqual, toSeconds, intersectionObserver, isRtl} from '#lib';
|
|
4
4
|
|
|
5
5
|
let {grid} = $props();
|
|
6
6
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
// Observe intersections
|
|
27
27
|
let observerOptions = $derived({
|
|
28
28
|
root: $_mainEl,
|
|
29
|
-
rootMargin: `0px 0px 0px -${$_sidebarWidth + 1}px`,
|
|
29
|
+
rootMargin: isRtl() ? `0px -${$_sidebarWidth + 1}px 0px 0px` : `0px 0px 0px -${$_sidebarWidth + 1}px`,
|
|
30
30
|
threshold: 0.0,
|
|
31
31
|
});
|
|
32
32
|
function onIntersect(el, entry) {
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
let scrollLeft = 0;
|
|
33
|
-
let gaps = 0;
|
|
34
33
|
let todayOutOfView = $_today < $_viewDates[0] || $_today > $_viewDates.at(-1);
|
|
35
34
|
for (let date of $_viewDates) {
|
|
36
35
|
let slotTimeLimits = getSlotTimeLimits($_dayTimeLimits, date);
|
|
@@ -42,10 +41,9 @@
|
|
|
42
41
|
break;
|
|
43
42
|
} else {
|
|
44
43
|
scrollLeft += toSeconds(slotTimeLimits.max) - toSeconds(slotTimeLimits.min);
|
|
45
|
-
++ gaps;
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
|
-
$_mainEl.scrollLeft = scrollLeft / toSeconds($slotDuration) * $slotWidth
|
|
46
|
+
$_mainEl.scrollLeft = scrollLeft / toSeconds($slotDuration) * $slotWidth * (document.dir === 'rtl' ? -1 : 1);
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
// Events reposition
|
|
@@ -109,9 +107,9 @@
|
|
|
109
107
|
{/each}
|
|
110
108
|
</aside>
|
|
111
109
|
<div class="{$theme.grid}" role="row">
|
|
112
|
-
{#each grid as days}
|
|
113
|
-
{#each days as day}
|
|
114
|
-
<Day {day}/>
|
|
110
|
+
{#each grid as days, i}
|
|
111
|
+
{#each days as day, j}
|
|
112
|
+
<Day {day} noIeb={j + 1 === days.length} noBeb={i + 1 === grid.length}/>
|
|
115
113
|
{/each}
|
|
116
114
|
{/each}
|
|
117
115
|
</div>
|
|
@@ -112,7 +112,7 @@ export function prepareChunks(chunks) {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
export function repositionEvent(chunk, height, monthView) {
|
|
115
|
-
let top =
|
|
115
|
+
let top = 0;
|
|
116
116
|
let bottom = top + height;
|
|
117
117
|
let dayChunks = chunk.day;
|
|
118
118
|
dayChunks.sort((a, b) => (a.top ?? Number.POSITIVE_INFINITY) - (b.top ?? Number.POSITIVE_INFINITY));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {addDuration, cloneDate, floor, rect} from '#lib';
|
|
4
4
|
import {BaseDay} from '#components';
|
|
5
5
|
|
|
6
|
-
let {day, allDay = false} = $props();
|
|
6
|
+
let {day, allDay = false, noIeb, noBeb} = $props();
|
|
7
7
|
|
|
8
8
|
let {slotDuration, slotHeight} = getContext('state');
|
|
9
9
|
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
}
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
|
-
<BaseDay bind:el {date} {allDay} {resource} {dateFromPoint} {disabled} {highlight}/>
|
|
21
|
+
<BaseDay bind:el {date} {allDay} {resource} {dateFromPoint} {disabled} {highlight} {noIeb} {noBeb}/>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import {getContext} from 'svelte';
|
|
3
|
-
import {datesEqual, toSeconds, intersectionObserver} from '#lib';
|
|
3
|
+
import {datesEqual, toSeconds, intersectionObserver, isRtl} from '#lib';
|
|
4
4
|
|
|
5
|
-
let {days,
|
|
5
|
+
let {days, span = 1} = $props();
|
|
6
6
|
|
|
7
7
|
let {_mainEl, _now, _today, _sidebarWidth, slotDuration, slotHeight, theme} = getContext('state');
|
|
8
8
|
|
|
9
9
|
// Layout
|
|
10
|
-
let {gridColumn, start} = $derived.by(() => {
|
|
10
|
+
let {gridColumn, start, end} = $derived.by(() => {
|
|
11
11
|
for (let day of days) {
|
|
12
12
|
if (datesEqual(day.dayStart, $_today)) {
|
|
13
13
|
return day;
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
return {};
|
|
17
17
|
});
|
|
18
18
|
let top = $derived.by(() => {
|
|
19
|
+
if ($_now < start || $_now > end) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
19
22
|
let step = toSeconds($slotDuration);
|
|
20
23
|
return ($_now - start) / 1000 / step * $slotHeight;
|
|
21
24
|
});
|
|
@@ -23,7 +26,7 @@
|
|
|
23
26
|
// Observe intersections
|
|
24
27
|
let observerOptions = $derived({
|
|
25
28
|
root: $_mainEl,
|
|
26
|
-
rootMargin: `0px 0px 0px -${$_sidebarWidth + 5.5}px`,
|
|
29
|
+
rootMargin: isRtl() ? `0px -${$_sidebarWidth + 5.5}px 0px 0px` : `0px 0px 0px -${$_sidebarWidth + 5.5}px`,
|
|
27
30
|
threshold: 0.0,
|
|
28
31
|
});
|
|
29
32
|
function onIntersect(el, entry) {
|
|
@@ -31,10 +34,10 @@
|
|
|
31
34
|
}
|
|
32
35
|
</script>
|
|
33
36
|
|
|
34
|
-
{#if gridColumn}
|
|
37
|
+
{#if gridColumn && top !== null}
|
|
35
38
|
<div {@attach intersectionObserver(onIntersect, observerOptions)}
|
|
36
39
|
class="{$theme.nowIndicator}"
|
|
37
|
-
style:grid-column="{gridColumn + 1}
|
|
40
|
+
style:grid-column="{gridColumn + 1} / span {span}"
|
|
38
41
|
style:inset-block-start="{top}px"
|
|
39
42
|
></div>
|
|
40
43
|
{/if}
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
import AllDayEvent from './AllDayEvent.svelte';
|
|
9
9
|
import NowIndicator from './NowIndicator.svelte';
|
|
10
10
|
|
|
11
|
-
let {header,
|
|
11
|
+
let {header, nowIndicator, createGridFn} = $props();
|
|
12
12
|
|
|
13
13
|
let {_mainEl, _filteredEvents, _iEvents, _sidebarWidth, _slotLabelPeriodicity, _slotTimeLimits, _slots,
|
|
14
|
-
_viewDates, allDayContent, allDaySlot, columnWidth, highlightedDates, nowIndicator
|
|
15
|
-
slotDuration, theme, validRange} = getContext('state');
|
|
14
|
+
_viewDates, allDayContent, allDaySlot, columnWidth, highlightedDates, nowIndicator: showNowIndicator,
|
|
15
|
+
scrollTime, slotHeight, slotDuration, theme, validRange} = getContext('state');
|
|
16
16
|
|
|
17
17
|
let headerHeight = $state(0);
|
|
18
18
|
let allDayText = $derived(createAllDayContent($allDayContent));
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
<div class="{$theme.allDay}">
|
|
72
72
|
<aside class="{$theme.sidebar}" {@attach contentFrom(allDayText)}></aside>
|
|
73
73
|
<div class="{$theme.grid}" role="row">
|
|
74
|
-
{#each grid as days}
|
|
75
|
-
{#each days as day}
|
|
76
|
-
<Day {day} allDay/>
|
|
74
|
+
{#each grid as days, i}
|
|
75
|
+
{#each days as day, j}
|
|
76
|
+
<Day {day} allDay noIeb={i + 1 === grid.length && j + 1 === days.length}/>
|
|
77
77
|
{/each}
|
|
78
78
|
{/each}
|
|
79
79
|
</div>
|
|
@@ -108,9 +108,9 @@
|
|
|
108
108
|
{/each}
|
|
109
109
|
</aside>
|
|
110
110
|
<div class="{$theme.grid}" role="row">
|
|
111
|
-
{#each grid as days}
|
|
112
|
-
{#each days as day}
|
|
113
|
-
<Day {day}/>
|
|
111
|
+
{#each grid as days, i}
|
|
112
|
+
{#each days as day, j}
|
|
113
|
+
<Day {day} noIeb={i + 1 === grid.length && j + 1 === days.length} noBeb/>
|
|
114
114
|
{/each}
|
|
115
115
|
{/each}
|
|
116
116
|
</div>
|
|
@@ -127,9 +127,11 @@
|
|
|
127
127
|
</div>
|
|
128
128
|
</div>
|
|
129
129
|
|
|
130
|
-
{#if $
|
|
131
|
-
{#
|
|
132
|
-
|
|
133
|
-
{
|
|
130
|
+
{#if $showNowIndicator}
|
|
131
|
+
{#if nowIndicator}
|
|
132
|
+
{@render nowIndicator(grid)}
|
|
133
|
+
{:else}
|
|
134
|
+
<NowIndicator days={grid[0]}/>
|
|
135
|
+
{/if}
|
|
134
136
|
{/if}
|
|
135
137
|
</section>
|
package/src/storage/options.js
CHANGED
|
@@ -80,6 +80,8 @@ export function createOptions(plugins) {
|
|
|
80
80
|
highlight: 'ec-highlight',
|
|
81
81
|
icon: 'ec-icon',
|
|
82
82
|
main: 'ec-main',
|
|
83
|
+
noBeb: 'ec-no-beb', // no block end border
|
|
84
|
+
noIeb: 'ec-no-ieb', // no inline end border
|
|
83
85
|
today: 'ec-today',
|
|
84
86
|
title: 'ec-title',
|
|
85
87
|
toolbar: 'ec-toolbar',
|
package/src/storage/stores.js
CHANGED
|
@@ -193,10 +193,10 @@ export function filteredEvents(state){
|
|
|
193
193
|
|
|
194
194
|
// Filter events
|
|
195
195
|
if (isFunction($eventFilter)) {
|
|
196
|
+
let events = $_events.map(toEventWithLocalDates);
|
|
196
197
|
result = result
|
|
197
|
-
.
|
|
198
|
-
|
|
199
|
-
event,
|
|
198
|
+
.filter((event, index) => $eventFilter({
|
|
199
|
+
event: toEventWithLocalDates(event),
|
|
200
200
|
index,
|
|
201
201
|
events,
|
|
202
202
|
view
|
package/src/styles/days.css
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
.ec-day {
|
|
2
2
|
--ec-day-bg-color: var(--ec-bg-color);
|
|
3
3
|
background-color: var(--ec-day-bg-color);
|
|
4
|
+
border: 1px solid var(--ec-border-color);
|
|
5
|
+
border-block-start: none;
|
|
6
|
+
border-inline-start: none;
|
|
4
7
|
|
|
5
8
|
&.ec-today {
|
|
6
9
|
--ec-day-bg-color: var(--ec-today-bg-color);
|
|
@@ -12,10 +15,10 @@
|
|
|
12
15
|
|
|
13
16
|
.ec-time-grid .ec-body & {
|
|
14
17
|
background-image:
|
|
15
|
-
linear-gradient(var(--ec-day-bg-color) 1px, transparent 1px),
|
|
16
|
-
linear-gradient(var(--ec-border-color) 1px, transparent 1px),
|
|
18
|
+
linear-gradient(to top, var(--ec-day-bg-color) 1px, transparent 1px),
|
|
19
|
+
linear-gradient(to top, var(--ec-border-color) 1px, transparent 1px),
|
|
17
20
|
linear-gradient(to right, var(--ec-day-bg-color) 1px, transparent 1px),
|
|
18
|
-
linear-gradient(var(--ec-border-color) 1px, transparent 1px);
|
|
21
|
+
linear-gradient(to top, var(--ec-border-color) 1px, transparent 1px);
|
|
19
22
|
background-size:
|
|
20
23
|
100% 100%,
|
|
21
24
|
100% calc(var(--ec-slot-height) * var(--ec-slot-label-periodicity)),
|
|
@@ -24,16 +27,26 @@
|
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
.ec-timeline:not(.ec-month-view) .ec-body & {
|
|
30
|
+
--ec-last-line-color: transparent;
|
|
31
|
+
--ec-direction: to left;
|
|
32
|
+
[dir="rtl"] & {
|
|
33
|
+
--ec-direction: to right;
|
|
34
|
+
}
|
|
27
35
|
background-image:
|
|
28
|
-
linear-gradient(
|
|
29
|
-
linear-gradient(
|
|
36
|
+
linear-gradient(var(--ec-direction), var(--ec-last-line-color) 1px, transparent 1px),
|
|
37
|
+
linear-gradient(var(--ec-direction), var(--ec-border-color) 1px, transparent 1px),
|
|
30
38
|
linear-gradient(var(--ec-day-bg-color) 1px, transparent 1px),
|
|
31
|
-
linear-gradient(
|
|
39
|
+
linear-gradient(var(--ec-direction), var(--ec-border-color) 1px, transparent 1px);
|
|
32
40
|
background-size:
|
|
33
41
|
100% 100%,
|
|
34
42
|
calc(var(--ec-slot-width) * var(--ec-slot-label-periodicity)) 100%,
|
|
35
43
|
100% 2px,
|
|
36
44
|
var(--ec-slot-width) 100%;
|
|
45
|
+
border-inline: none;
|
|
46
|
+
|
|
47
|
+
&.ec-no-ieb {
|
|
48
|
+
--ec-last-line-color: var(--ec-day-bg-color);
|
|
49
|
+
}
|
|
37
50
|
}
|
|
38
51
|
|
|
39
52
|
.ec-day-grid & {
|
|
@@ -46,6 +59,22 @@
|
|
|
46
59
|
.ec-day-grid .ec-uniform & {
|
|
47
60
|
min-block-size: auto;
|
|
48
61
|
}
|
|
62
|
+
|
|
63
|
+
.ec-list & {
|
|
64
|
+
border-inline: none;
|
|
65
|
+
|
|
66
|
+
&:last-child {
|
|
67
|
+
border: none;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
&.ec-no-ieb {
|
|
72
|
+
border-inline-end: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&.ec-no-beb {
|
|
76
|
+
border-block-end: none;
|
|
77
|
+
}
|
|
49
78
|
}
|
|
50
79
|
|
|
51
80
|
.ec-day-head {
|
package/src/styles/index.css
CHANGED
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
.ec-main {
|
|
16
16
|
display: grid;
|
|
17
|
-
gap: 1px;
|
|
18
|
-
background-color: var(--ec-border-color);
|
|
19
17
|
border: 1px solid var(--ec-border-color);
|
|
20
18
|
overflow: auto;
|
|
21
19
|
/*scrollbar-width: thin;*/
|
|
@@ -56,20 +54,15 @@
|
|
|
56
54
|
grid-area: 1 / 1 / 2 / -1;
|
|
57
55
|
display: grid;
|
|
58
56
|
grid-template-columns: subgrid;
|
|
59
|
-
gap: 1px;
|
|
60
|
-
background-color: var(--ec-border-color);
|
|
61
57
|
position: sticky;
|
|
62
58
|
inset-block-start: 0;
|
|
63
59
|
z-index: 2;
|
|
64
|
-
border-block-end: 1px solid var(--ec-border-color);
|
|
65
|
-
margin-block-end: -1px;
|
|
66
60
|
}
|
|
67
61
|
|
|
68
62
|
.ec-grid {
|
|
69
63
|
grid-area: 1 / 1 / -1 / -1;
|
|
70
64
|
display: grid;
|
|
71
65
|
grid-template-columns: subgrid;
|
|
72
|
-
gap: 1px;
|
|
73
66
|
|
|
74
67
|
.ec-body & {
|
|
75
68
|
grid-template-rows: subgrid;
|
|
@@ -97,6 +90,9 @@
|
|
|
97
90
|
text-align: center;
|
|
98
91
|
padding: .375rem .18em;
|
|
99
92
|
background-color: var(--ec-bg-color);
|
|
93
|
+
border: 1px solid var(--ec-border-color);
|
|
94
|
+
border-block-start: none;
|
|
95
|
+
border-inline-start: none;
|
|
100
96
|
overflow: clip;
|
|
101
97
|
text-overflow: ellipsis;
|
|
102
98
|
|
|
@@ -109,6 +105,11 @@
|
|
|
109
105
|
}
|
|
110
106
|
}
|
|
111
107
|
|
|
108
|
+
.ec-col-group:nth-last-child(1 of .ec-col-group),
|
|
109
|
+
.ec-col-head:nth-last-child(1 of .ec-col-head) {
|
|
110
|
+
border-inline-end: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
112
113
|
.ec-col-group > *,
|
|
113
114
|
.ec-timeline .ec-col-head > * {
|
|
114
115
|
position: sticky;
|