@nomideusz/svelte-calendar 1.4.3 → 1.6.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 +13 -0
- package/dist/calendar/Calendar.svelte +2 -2
- package/dist/calendar/Calendar.svelte.d.ts +7 -0
- package/dist/views/agenda/AgendaDay.svelte +20 -7
- package/dist/views/agenda/AgendaWeek.svelte +10 -4
- package/dist/views/mobile/MobileDay.svelte +7 -2
- package/dist/views/mobile/MobileWeek.svelte +6 -3
- package/dist/views/month/MonthGrid.svelte +7 -3
- package/dist/views/planner/PlannerScroll.svelte +8 -5
- package/dist/views/planner/PlannerWeek.svelte +7 -3
- package/package.json +1 -1
- package/widget/widget.js +117 -211
package/README.md
CHANGED
|
@@ -470,6 +470,8 @@ Component fallbacks use system fonts and a neutral blue accent, so the package s
|
|
|
470
470
|
| `--dt-text-3` | Tertiary text |
|
|
471
471
|
| `--dt-accent` | Accent color |
|
|
472
472
|
| `--dt-accent-dim` | Accent at ~12% opacity (selection, highlights) |
|
|
473
|
+
| `--dt-ev-fill` | Event wash, as a percentage of the event's colour (default `0%`; the `eventFill` prop sets it) |
|
|
474
|
+
| `--dt-ev-bar` | Width of an event's colour bar (default `3px`; the `eventBar` prop sets it) |
|
|
473
475
|
| `--dt-event` | Bar color of an event without its own `color` (the presets set it to the text color, so such events draw in ink) |
|
|
474
476
|
| `--dt-accent-fg` | Text on the planner's today-number badge (default `#fff`; not set by the presets) |
|
|
475
477
|
| `--dt-btn-text` | Text on accent-filled buttons and badges |
|
|
@@ -535,6 +537,14 @@ const palette = generatePalette('#e11d48'); // (accent?, count = 15)
|
|
|
535
537
|
const adapter = createMemoryAdapter(events, { palette });
|
|
536
538
|
```
|
|
537
539
|
|
|
540
|
+
Events are transparent by default: a bar in the event's colour, ink text on the paper. To give them a background, or change the bar:
|
|
541
|
+
|
|
542
|
+
```svelte
|
|
543
|
+
<Calendar {adapter} eventFill={0.15} /> <!-- a light wash in each event's colour -->
|
|
544
|
+
<Calendar {adapter} eventFill={0.15} eventBar={0} /> <!-- wash only, no bar -->
|
|
545
|
+
<Calendar {adapter} eventBar={5} /> <!-- a heavier bar -->
|
|
546
|
+
```
|
|
547
|
+
|
|
538
548
|
Related exports: `VIVID_PALETTE` (the vivid palette, the default before 1.4) and `extractAccent(themeString)` (the accent color of a `--dt-*` theme string).
|
|
539
549
|
|
|
540
550
|
### Multi-day & All-day
|
|
@@ -1053,6 +1063,7 @@ The widget renders inside shadow DOM: host-page CSS cannot affect the calendar a
|
|
|
1053
1063
|
| `days` | `7` | Days in week views, `1`–`7` |
|
|
1054
1064
|
| `compact` | `false` | `"true"` for compact agenda rows |
|
|
1055
1065
|
| `timezone` | viewer's zone | IANA zone, e.g. `Europe/Warsaw` (read when the element mounts) |
|
|
1066
|
+
| `mincolumnwidth` | `110` | Minimum day-column width in px for the week grid; a container narrower than the days need scrolls sideways |
|
|
1056
1067
|
|
|
1057
1068
|
Each event in `api` responses and `events` needs `start` and `end` as date strings (ISO 8601) and may carry `id`, `title`, `color`, `allDay`, `subtitle` and `location`; other fields are ignored, as are events with an invalid or empty range. Changing an attribute updates the calendar in place.
|
|
1058
1069
|
|
|
@@ -1106,6 +1117,8 @@ Every `<Calendar>` prop (`CalendarProps`), grouped by what it controls.
|
|
|
1106
1117
|
| `theme` | `string` | `auto` | CSS theme string of `--dt-*` properties. `auto` probes the host page. |
|
|
1107
1118
|
| `autoTheme` | `AutoThemeOptions \| false` | `undefined` (probe) | Fine-tune auto-detection: `{ mode, accent, font }`. `false` disables probing. |
|
|
1108
1119
|
| `borderRadius` | `number` | `0` | Corner radius in px (square by default) |
|
|
1120
|
+
| `eventFill` | `number` | `0` | Wash each event in its own colour, 0–1 (`0.15` = a light tint). Sets `--dt-ev-fill` |
|
|
1121
|
+
| `eventBar` | `number` | `3` | Width in px of the colour bar on an event's leading edge; `0` removes it. Sets `--dt-ev-bar` |
|
|
1109
1122
|
|
|
1110
1123
|
### Locale and timezone
|
|
1111
1124
|
|
|
@@ -95,7 +95,7 @@ import { wrapAdapterWithTimezone, toZonedTime, fromZonedTime } from "../core/tim
|
|
|
95
95
|
import { isReadOnlyError, isNotFoundError } from "../adapters/errors.js";
|
|
96
96
|
/** Breakpoint (px) at which auto-mobile activates */
|
|
97
97
|
const MOBILE_BREAKPOINT = 768;
|
|
98
|
-
let { adapter, views = defaultViews, view: activeViewId, theme = auto, autoTheme, mondayStart = true, height: heightProp = 600, borderRadius = 0, dir, locale, labels: labelsProp, readOnly = false, visibleHours, initialDate, snapInterval = 15, minColumnWidth = 110, showModePills = true, showNavigation = true, equalDays = false, showDates = true, hideDays, currentDate, blockedSlots, days, minDuration, maxDuration, disabledDates, compact = false, columns = false, mobile: mobileProp = "auto", event: eventSnippet, empty: emptySnippet, dayHeader: dayHeaderSnippet, header: headerSnippet, navigation: navigationSnippet, oneventclick, oneventcreate, onexternaldrop, oneventmove, onviewchange, ondatechange, oneventhover, ondayclick, onerror, timezone } = $props();
|
|
98
|
+
let { adapter, views = defaultViews, view: activeViewId, theme = auto, autoTheme, mondayStart = true, height: heightProp = 600, borderRadius = 0, eventFill, eventBar, dir, locale, labels: labelsProp, readOnly = false, visibleHours, initialDate, snapInterval = 15, minColumnWidth = 110, showModePills = true, showNavigation = true, equalDays = false, showDates = true, hideDays, currentDate, blockedSlots, days, minDuration, maxDuration, disabledDates, compact = false, columns = false, mobile: mobileProp = "auto", event: eventSnippet, empty: emptySnippet, dayHeader: dayHeaderSnippet, header: headerSnippet, navigation: navigationSnippet, oneventclick, oneventcreate, onexternaldrop, oneventmove, onviewchange, ondatechange, oneventhover, ondayclick, onerror, timezone } = $props();
|
|
99
99
|
// In readOnly mode, suppress mutation callbacks. With a timezone, the
|
|
100
100
|
// drag plane is zoned wall-clock — hosts always receive real instants.
|
|
101
101
|
const unzone = (d) => timezone ? fromZonedTime(d, timezone) : d;
|
|
@@ -672,7 +672,7 @@ const navCtx = $derived({
|
|
|
672
672
|
<div
|
|
673
673
|
class="cal"
|
|
674
674
|
bind:this={calEl}
|
|
675
|
-
style="{effectiveTheme}; {heightProp === 'auto' ? '' : `--cal-h: ${heightProp}px;`} --cal-r: {borderRadius}px"
|
|
675
|
+
style="{effectiveTheme}; {heightProp === 'auto' ? '' : `--cal-h: ${heightProp}px;`} --cal-r: {borderRadius}px;{eventFill == null ? '' : ` --dt-ev-fill: ${eventFill * 100}%;`}{eventBar == null ? '' : ` --dt-ev-bar: ${eventBar}px;`}"
|
|
676
676
|
class:cal--auto={heightProp === 'auto'}
|
|
677
677
|
role="region"
|
|
678
678
|
aria-label={L.calendar}
|
|
@@ -71,6 +71,13 @@ export interface CalendarProps {
|
|
|
71
71
|
height?: number | 'auto';
|
|
72
72
|
/** Border radius in px (default: 0, square-cut). */
|
|
73
73
|
borderRadius?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Wash each event in its own colour, 0–1 (default 0: transparent). Text
|
|
76
|
+
* stays the theme's ink, so a light tint (0.1–0.2) reads best.
|
|
77
|
+
*/
|
|
78
|
+
eventFill?: number;
|
|
79
|
+
/** Width in px of the colour bar on an event's leading edge (default 3). 0 removes it. */
|
|
80
|
+
eventBar?: number;
|
|
74
81
|
/** Text direction: 'ltr' (default), 'rtl', or 'auto' */
|
|
75
82
|
dir?: 'ltr' | 'rtl' | 'auto';
|
|
76
83
|
/** BCP 47 locale tag (e.g. 'en-US', 'ar-SA') — sets lang and locale for formatting */
|
|
@@ -600,6 +600,9 @@ const hiddenDoneCount = $derived(showAllDone ? 0 : Math.max(0, dayCat.past.lengt
|
|
|
600
600
|
align-items: stretch;
|
|
601
601
|
border-radius: 0;
|
|
602
602
|
background: transparent;
|
|
603
|
+
/* eventFill: a wash in the event's colour; hover/current set background-color under it */
|
|
604
|
+
--_fill: color-mix(in srgb, var(--ev-color) var(--dt-ev-fill, 0%), transparent);
|
|
605
|
+
background-image: linear-gradient(var(--_fill), var(--_fill));
|
|
603
606
|
border: none;
|
|
604
607
|
border-bottom: 1px solid var(--dt-border, rgba(15, 15, 15, 0.3));
|
|
605
608
|
overflow: hidden;
|
|
@@ -612,12 +615,12 @@ const hiddenDoneCount = $derived(showAllDone ? 0 : Math.max(0, dayCat.past.lengt
|
|
|
612
615
|
left: 0;
|
|
613
616
|
top: 0;
|
|
614
617
|
bottom: 0;
|
|
615
|
-
width: 3px;
|
|
618
|
+
width: var(--dt-ev-bar, 3px);
|
|
616
619
|
background: var(--ev-color);
|
|
617
620
|
}
|
|
618
621
|
.ag-card:hover,
|
|
619
622
|
.ag-card:active {
|
|
620
|
-
background: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
623
|
+
background-color: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
621
624
|
}
|
|
622
625
|
.ag-card:focus-visible {
|
|
623
626
|
outline: none;
|
|
@@ -859,6 +862,9 @@ const hiddenDoneCount = $derived(showAllDone ? 0 : Math.max(0, dayCat.past.lengt
|
|
|
859
862
|
margin-bottom: 8px;
|
|
860
863
|
border-radius: 0;
|
|
861
864
|
background: var(--dt-accent-dim, color-mix(in srgb, var(--dt-accent, #1d4fd7) 12%, transparent));
|
|
865
|
+
/* eventFill: a wash in the event's colour; hover/current set background-color under it */
|
|
866
|
+
--_fill: color-mix(in srgb, var(--ev-color) var(--dt-ev-fill, 0%), transparent);
|
|
867
|
+
background-image: linear-gradient(var(--_fill), var(--_fill));
|
|
862
868
|
border: none;
|
|
863
869
|
border-bottom: 1px solid var(--dt-border, rgba(15, 15, 15, 0.3));
|
|
864
870
|
cursor: pointer;
|
|
@@ -870,12 +876,13 @@ const hiddenDoneCount = $derived(showAllDone ? 0 : Math.max(0, dayCat.past.lengt
|
|
|
870
876
|
left: 0;
|
|
871
877
|
top: 0;
|
|
872
878
|
bottom: 0;
|
|
873
|
-
width: 3px;
|
|
879
|
+
width: var(--dt-ev-bar, 3px);
|
|
874
880
|
background: var(--ev-color, var(--dt-accent));
|
|
875
881
|
}
|
|
876
882
|
.ag-q-now:hover,
|
|
877
883
|
.ag-q-now:active {
|
|
878
884
|
background:
|
|
885
|
+
linear-gradient(var(--_fill), var(--_fill)),
|
|
879
886
|
linear-gradient(var(--dt-hover, rgba(15, 15, 15, 0.04)), var(--dt-hover, rgba(15, 15, 15, 0.04))),
|
|
880
887
|
var(--dt-accent-dim, color-mix(in srgb, var(--dt-accent, #1d4fd7) 12%, transparent));
|
|
881
888
|
}
|
|
@@ -998,6 +1005,9 @@ const hiddenDoneCount = $derived(showAllDone ? 0 : Math.max(0, dayCat.past.lengt
|
|
|
998
1005
|
display: none;
|
|
999
1006
|
}
|
|
1000
1007
|
.ag-log-row {
|
|
1008
|
+
/* eventFill: a wash in the event's colour; hover/current set background-color under it */
|
|
1009
|
+
--_fill: color-mix(in srgb, var(--ev-color) var(--dt-ev-fill, 0%), transparent);
|
|
1010
|
+
background-image: linear-gradient(var(--_fill), var(--_fill));
|
|
1001
1011
|
display: flex;
|
|
1002
1012
|
align-items: baseline;
|
|
1003
1013
|
gap: 10px;
|
|
@@ -1016,7 +1026,7 @@ const hiddenDoneCount = $derived(showAllDone ? 0 : Math.max(0, dayCat.past.lengt
|
|
|
1016
1026
|
}
|
|
1017
1027
|
.ag-log-row:hover,
|
|
1018
1028
|
.ag-log-row:active {
|
|
1019
|
-
background: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
1029
|
+
background-color: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
1020
1030
|
}
|
|
1021
1031
|
.ag-log-row:focus-visible {
|
|
1022
1032
|
outline: none;
|
|
@@ -1042,7 +1052,7 @@ const hiddenDoneCount = $derived(showAllDone ? 0 : Math.max(0, dayCat.past.lengt
|
|
|
1042
1052
|
/* The colour dot of a past row becomes its 3px start bar (dimmed: it is over). */
|
|
1043
1053
|
.ag-log-dot {
|
|
1044
1054
|
align-self: stretch;
|
|
1045
|
-
width: 3px;
|
|
1055
|
+
width: var(--dt-ev-bar, 3px);
|
|
1046
1056
|
border-radius: 0;
|
|
1047
1057
|
flex-shrink: 0;
|
|
1048
1058
|
opacity: 0.45;
|
|
@@ -1080,6 +1090,9 @@ const hiddenDoneCount = $derived(showAllDone ? 0 : Math.max(0, dayCat.past.lengt
|
|
|
1080
1090
|
.ag-compact-list::-webkit-scrollbar { display: none; }
|
|
1081
1091
|
/* A compact row: 3px start bar, hairline beneath, ink text. */
|
|
1082
1092
|
.ag-compact-row {
|
|
1093
|
+
/* eventFill: a wash in the event's colour; hover/current set background-color under it */
|
|
1094
|
+
--_fill: color-mix(in srgb, var(--ev-color) var(--dt-ev-fill, 0%), transparent);
|
|
1095
|
+
background-image: linear-gradient(var(--_fill), var(--_fill));
|
|
1083
1096
|
position: relative;
|
|
1084
1097
|
display: flex;
|
|
1085
1098
|
align-items: baseline;
|
|
@@ -1096,7 +1109,7 @@ const hiddenDoneCount = $derived(showAllDone ? 0 : Math.max(0, dayCat.past.lengt
|
|
|
1096
1109
|
left: 0;
|
|
1097
1110
|
top: 0;
|
|
1098
1111
|
bottom: 0;
|
|
1099
|
-
width: 3px;
|
|
1112
|
+
width: var(--dt-ev-bar, 3px);
|
|
1100
1113
|
background: var(--ev-color, var(--dt-accent));
|
|
1101
1114
|
}
|
|
1102
1115
|
.ag-compact-row--selected {
|
|
@@ -1106,7 +1119,7 @@ const hiddenDoneCount = $derived(showAllDone ? 0 : Math.max(0, dayCat.past.lengt
|
|
|
1106
1119
|
.ag-compact-row:active .ag-compact-row-title { color: var(--dt-text); }
|
|
1107
1120
|
.ag-compact-row:hover,
|
|
1108
1121
|
.ag-compact-row:active {
|
|
1109
|
-
background: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
1122
|
+
background-color: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
1110
1123
|
}
|
|
1111
1124
|
.ag-compact-row:focus-visible {
|
|
1112
1125
|
outline: none;
|
|
@@ -639,6 +639,9 @@ const weekDays = $derived.by(() => {
|
|
|
639
639
|
align-items: stretch;
|
|
640
640
|
border-radius: 0;
|
|
641
641
|
background: transparent;
|
|
642
|
+
/* eventFill: a wash in the event's colour; hover/current set background-color under it */
|
|
643
|
+
--_fill: color-mix(in srgb, var(--ev-color) var(--dt-ev-fill, 0%), transparent);
|
|
644
|
+
background-image: linear-gradient(var(--_fill), var(--_fill));
|
|
642
645
|
border: none;
|
|
643
646
|
border-bottom: 1px solid var(--dt-border, rgba(15, 15, 15, 0.3));
|
|
644
647
|
overflow: hidden;
|
|
@@ -651,12 +654,12 @@ const weekDays = $derived.by(() => {
|
|
|
651
654
|
left: 0;
|
|
652
655
|
top: 0;
|
|
653
656
|
bottom: 0;
|
|
654
|
-
width: 3px;
|
|
657
|
+
width: var(--dt-ev-bar, 3px);
|
|
655
658
|
background: var(--ev-color);
|
|
656
659
|
}
|
|
657
660
|
.ag-card:hover,
|
|
658
661
|
.ag-card:active {
|
|
659
|
-
background: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
662
|
+
background-color: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
660
663
|
}
|
|
661
664
|
.ag-card:focus-visible {
|
|
662
665
|
outline: none;
|
|
@@ -939,6 +942,9 @@ const weekDays = $derived.by(() => {
|
|
|
939
942
|
}
|
|
940
943
|
/* A compact row: 3px start bar, hairline beneath, ink text. */
|
|
941
944
|
.ag-compact {
|
|
945
|
+
/* eventFill: a wash in the event's colour; hover/current set background-color under it */
|
|
946
|
+
--_fill: color-mix(in srgb, var(--ev-color) var(--dt-ev-fill, 0%), transparent);
|
|
947
|
+
background-image: linear-gradient(var(--_fill), var(--_fill));
|
|
942
948
|
position: relative;
|
|
943
949
|
display: flex;
|
|
944
950
|
align-items: baseline;
|
|
@@ -955,7 +961,7 @@ const weekDays = $derived.by(() => {
|
|
|
955
961
|
left: 0;
|
|
956
962
|
top: 0;
|
|
957
963
|
bottom: 0;
|
|
958
|
-
width: 3px;
|
|
964
|
+
width: var(--dt-ev-bar, 3px);
|
|
959
965
|
background: var(--ev-color, var(--dt-accent));
|
|
960
966
|
}
|
|
961
967
|
.ag-compact--selected {
|
|
@@ -967,7 +973,7 @@ const weekDays = $derived.by(() => {
|
|
|
967
973
|
}
|
|
968
974
|
.ag-compact:hover,
|
|
969
975
|
.ag-compact:active {
|
|
970
|
-
background: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
976
|
+
background-color: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
971
977
|
}
|
|
972
978
|
.ag-compact:focus-visible {
|
|
973
979
|
outline: none;
|
|
@@ -968,6 +968,9 @@ $effect(() => {
|
|
|
968
968
|
border-radius: 0;
|
|
969
969
|
cursor: pointer;
|
|
970
970
|
background: transparent;
|
|
971
|
+
/* eventFill: a wash in the event's colour; hover/current set background-color under it */
|
|
972
|
+
--_fill: color-mix(in srgb, var(--ev-color) var(--dt-ev-fill, 0%), transparent);
|
|
973
|
+
background-image: linear-gradient(var(--_fill), var(--_fill));
|
|
971
974
|
border: none;
|
|
972
975
|
border-bottom: 1px solid var(--dt-border, rgba(15, 15, 15, 0.3));
|
|
973
976
|
box-sizing: border-box;
|
|
@@ -982,7 +985,7 @@ $effect(() => {
|
|
|
982
985
|
}
|
|
983
986
|
.mb-event:hover,
|
|
984
987
|
.mb-event:active {
|
|
985
|
-
background: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
988
|
+
background-color: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
986
989
|
}
|
|
987
990
|
/* Short blocks keep their duration-proportional height, but get a 44px
|
|
988
991
|
transparent hit-slop so taps still land. */
|
|
@@ -1009,6 +1012,7 @@ $effect(() => {
|
|
|
1009
1012
|
laid over the paper, opaque, so the line runs beneath its text. */
|
|
1010
1013
|
.mb-event.mb-event--current {
|
|
1011
1014
|
background:
|
|
1015
|
+
linear-gradient(var(--_fill), var(--_fill)),
|
|
1012
1016
|
linear-gradient(var(--dt-accent-dim, rgba(29, 79, 215, 0.12)), var(--dt-accent-dim, rgba(29, 79, 215, 0.12))),
|
|
1013
1017
|
var(--dt-paper, none),
|
|
1014
1018
|
var(--dt-bg, #efebe9);
|
|
@@ -1016,6 +1020,7 @@ $effect(() => {
|
|
|
1016
1020
|
.mb-event.mb-event--current:hover,
|
|
1017
1021
|
.mb-event.mb-event--current:active {
|
|
1018
1022
|
background:
|
|
1023
|
+
linear-gradient(var(--_fill), var(--_fill)),
|
|
1019
1024
|
linear-gradient(var(--dt-hover, rgba(15, 15, 15, 0.04)), var(--dt-hover, rgba(15, 15, 15, 0.04))),
|
|
1020
1025
|
var(--dt-paper, none),
|
|
1021
1026
|
var(--dt-bg, #efebe9);
|
|
@@ -1127,7 +1132,7 @@ $effect(() => {
|
|
|
1127
1132
|
}
|
|
1128
1133
|
|
|
1129
1134
|
.mb-ev-stripe {
|
|
1130
|
-
width: 3px;
|
|
1135
|
+
width: var(--dt-ev-bar, 3px);
|
|
1131
1136
|
background: var(--ev-color);
|
|
1132
1137
|
flex-shrink: 0;
|
|
1133
1138
|
border-radius: 0;
|
|
@@ -422,6 +422,9 @@ function handleDayKeydown(e, dayMs) {
|
|
|
422
422
|
min-height: 44px;
|
|
423
423
|
border-radius: 0;
|
|
424
424
|
background: transparent;
|
|
425
|
+
/* eventFill: a wash in the event's colour; hover/current set background-color under it */
|
|
426
|
+
--_fill: color-mix(in srgb, var(--ev-color) var(--dt-ev-fill, 0%), transparent);
|
|
427
|
+
background-image: linear-gradient(var(--_fill), var(--_fill));
|
|
425
428
|
overflow: hidden;
|
|
426
429
|
cursor: pointer;
|
|
427
430
|
transition: background 120ms;
|
|
@@ -434,13 +437,13 @@ function handleDayKeydown(e, dayMs) {
|
|
|
434
437
|
}
|
|
435
438
|
.mw-ev:hover,
|
|
436
439
|
.mw-ev:active {
|
|
437
|
-
background: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
440
|
+
background-color: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
438
441
|
}
|
|
439
442
|
.mw-ev--selected {
|
|
440
443
|
box-shadow: inset 0 0 0 1px var(--ev-color);
|
|
441
444
|
}
|
|
442
445
|
.mw-ev--current {
|
|
443
|
-
background: var(--dt-accent-dim, rgba(29, 79, 215, 0.12));
|
|
446
|
+
background-color: var(--dt-accent-dim, rgba(29, 79, 215, 0.12));
|
|
444
447
|
}
|
|
445
448
|
/* All day: a solid band on the event colour, no tint. */
|
|
446
449
|
.mw-ev--allday {
|
|
@@ -486,7 +489,7 @@ function handleDayKeydown(e, dayMs) {
|
|
|
486
489
|
}
|
|
487
490
|
|
|
488
491
|
.mw-ev-stripe {
|
|
489
|
-
width: 3px;
|
|
492
|
+
width: var(--dt-ev-bar, 3px);
|
|
490
493
|
align-self: stretch;
|
|
491
494
|
background: var(--ev-color, var(--dt-accent));
|
|
492
495
|
flex-shrink: 0;
|
|
@@ -456,6 +456,9 @@ function chipTime(e) {
|
|
|
456
456
|
gap: 5px;
|
|
457
457
|
border: none;
|
|
458
458
|
background: none;
|
|
459
|
+
/* eventFill: a wash in the event's colour; hover/current set background-color under it */
|
|
460
|
+
--_fill: color-mix(in srgb, var(--mg-chip-color) var(--dt-ev-fill, 0%), transparent);
|
|
461
|
+
background-image: linear-gradient(var(--_fill), var(--_fill));
|
|
459
462
|
padding: 1px 4px;
|
|
460
463
|
border-radius: 0;
|
|
461
464
|
font: 400 12.5px/1.3 var(--dt-sans, system-ui, sans-serif);
|
|
@@ -465,14 +468,14 @@ function chipTime(e) {
|
|
|
465
468
|
text-align: left;
|
|
466
469
|
}
|
|
467
470
|
.mg-chip:hover {
|
|
468
|
-
background: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
471
|
+
background-color: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
469
472
|
}
|
|
470
473
|
.mg-chip:focus-visible {
|
|
471
474
|
box-shadow: 0 0 0 2px var(--dt-accent, #1d4fd7);
|
|
472
475
|
outline: none;
|
|
473
476
|
}
|
|
474
477
|
.mg-chip--selected {
|
|
475
|
-
background: var(--dt-accent-dim);
|
|
478
|
+
background-color: var(--dt-accent-dim);
|
|
476
479
|
}
|
|
477
480
|
.mg-chip--cancelled {
|
|
478
481
|
text-decoration: line-through;
|
|
@@ -486,7 +489,7 @@ function chipTime(e) {
|
|
|
486
489
|
.mg-chip-dot {
|
|
487
490
|
flex: none;
|
|
488
491
|
align-self: stretch;
|
|
489
|
-
width: 3px;
|
|
492
|
+
width: var(--dt-ev-bar, 3px);
|
|
490
493
|
border-radius: 0;
|
|
491
494
|
background: var(--mg-chip-color);
|
|
492
495
|
}
|
|
@@ -558,6 +561,7 @@ function chipTime(e) {
|
|
|
558
561
|
}
|
|
559
562
|
.mg--dots .mg-chip {
|
|
560
563
|
padding: 3px;
|
|
564
|
+
background-image: none; /* a mark, not a chip: no eventFill wash */
|
|
561
565
|
min-height: 0;
|
|
562
566
|
}
|
|
563
567
|
.mg--dots .mg-chip-title,
|
|
@@ -1372,6 +1372,9 @@ function onCellKeydown(e, ms) {
|
|
|
1372
1372
|
padding: 0 3px 0 9px;
|
|
1373
1373
|
border-radius: 0;
|
|
1374
1374
|
background: transparent;
|
|
1375
|
+
/* eventFill: a wash in the event's colour; hover/current set background-color under it */
|
|
1376
|
+
--_fill: color-mix(in srgb, var(--ev-color) var(--dt-ev-fill, 0%), transparent);
|
|
1377
|
+
background-image: linear-gradient(var(--_fill), var(--_fill));
|
|
1375
1378
|
cursor: pointer;
|
|
1376
1379
|
overflow: hidden;
|
|
1377
1380
|
transition: background 0.12s, box-shadow 0.12s;
|
|
@@ -1381,12 +1384,12 @@ function onCellKeydown(e, ms) {
|
|
|
1381
1384
|
content: '';
|
|
1382
1385
|
position: absolute;
|
|
1383
1386
|
inset: 0 auto 0 0;
|
|
1384
|
-
width: 3px;
|
|
1387
|
+
width: var(--dt-ev-bar, 3px);
|
|
1385
1388
|
background: var(--ev-color);
|
|
1386
1389
|
}
|
|
1387
1390
|
|
|
1388
1391
|
.wg-ev:hover {
|
|
1389
|
-
background: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
1392
|
+
background-color: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
1390
1393
|
}
|
|
1391
1394
|
|
|
1392
1395
|
.wg-ev--drag-preview {
|
|
@@ -1396,7 +1399,7 @@ function onCellKeydown(e, ms) {
|
|
|
1396
1399
|
z-index: 8;
|
|
1397
1400
|
opacity: 0.95;
|
|
1398
1401
|
pointer-events: none;
|
|
1399
|
-
background: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
1402
|
+
background-color: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
1400
1403
|
box-shadow: inset 0 0 0 1px var(--ev-color);
|
|
1401
1404
|
cursor: grabbing;
|
|
1402
1405
|
}
|
|
@@ -1406,7 +1409,7 @@ function onCellKeydown(e, ms) {
|
|
|
1406
1409
|
}
|
|
1407
1410
|
|
|
1408
1411
|
.wg-ev--current {
|
|
1409
|
-
background: var(--dt-accent-dim, rgba(29, 79, 215, 0.12));
|
|
1412
|
+
background-color: var(--dt-accent-dim, rgba(29, 79, 215, 0.12));
|
|
1410
1413
|
}
|
|
1411
1414
|
|
|
1412
1415
|
/* Printed states: struck through, grey, or a dashed bar — never a tint */
|
|
@@ -1497,7 +1500,7 @@ function onCellKeydown(e, ms) {
|
|
|
1497
1500
|
|
|
1498
1501
|
.wg-ev--dragging {
|
|
1499
1502
|
cursor: grabbing;
|
|
1500
|
-
background: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
1503
|
+
background-color: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
1501
1504
|
box-shadow: inset 0 0 0 1px var(--ev-color);
|
|
1502
1505
|
}
|
|
1503
1506
|
</style>
|
|
@@ -1656,6 +1656,9 @@ function onWindowKeydown(e) {
|
|
|
1656
1656
|
z-index: 6;
|
|
1657
1657
|
border-radius: 0;
|
|
1658
1658
|
background: transparent;
|
|
1659
|
+
/* eventFill: a wash in the event's colour; hover/current set background-color under it */
|
|
1660
|
+
--_fill: color-mix(in srgb, var(--ev-color) var(--dt-ev-fill, 0%), transparent);
|
|
1661
|
+
background-image: linear-gradient(var(--_fill), var(--_fill));
|
|
1659
1662
|
display: flex;
|
|
1660
1663
|
align-items: stretch;
|
|
1661
1664
|
overflow: hidden;
|
|
@@ -1668,7 +1671,7 @@ function onWindowKeydown(e) {
|
|
|
1668
1671
|
-webkit-tap-highlight-color: transparent;
|
|
1669
1672
|
}
|
|
1670
1673
|
.tw-ev:hover {
|
|
1671
|
-
background: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
1674
|
+
background-color: var(--dt-hover, rgba(15, 15, 15, 0.04));
|
|
1672
1675
|
z-index: 8;
|
|
1673
1676
|
}
|
|
1674
1677
|
/* Short blocks keep duration-proportional height, but get a 44px
|
|
@@ -1688,12 +1691,13 @@ function onWindowKeydown(e) {
|
|
|
1688
1691
|
z-index: 9;
|
|
1689
1692
|
}
|
|
1690
1693
|
.tw-ev--current {
|
|
1691
|
-
background: var(--dt-accent-dim, rgba(29, 79, 215, 0.12));
|
|
1694
|
+
background-color: var(--dt-accent-dim, rgba(29, 79, 215, 0.12));
|
|
1692
1695
|
}
|
|
1693
1696
|
/* An event the now line crosses lays its column's ground (and its own
|
|
1694
1697
|
wash) over the paper, so the line passes beneath its text. */
|
|
1695
1698
|
.tw-ev.tw-ev--on-now {
|
|
1696
1699
|
background:
|
|
1700
|
+
linear-gradient(var(--_fill), var(--_fill)),
|
|
1697
1701
|
linear-gradient(var(--tw-ev-wash, transparent), var(--tw-ev-wash, transparent)),
|
|
1698
1702
|
linear-gradient(var(--tw-col-wash, transparent), var(--tw-col-wash, transparent)),
|
|
1699
1703
|
var(--dt-paper, none),
|
|
@@ -1737,7 +1741,7 @@ function onWindowKeydown(e) {
|
|
|
1737
1741
|
.tw-ev--readonly { cursor: default; }
|
|
1738
1742
|
|
|
1739
1743
|
.tw-ev-stripe {
|
|
1740
|
-
width: 3px;
|
|
1744
|
+
width: var(--dt-ev-bar, 3px);
|
|
1741
1745
|
background: var(--ev-color);
|
|
1742
1746
|
flex-shrink: 0;
|
|
1743
1747
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomideusz/svelte-calendar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "A themeable Svelte 5 calendar: day, week, scrolling-week and month views, agenda lists, touch-first mobile layouts, drag-and-drop, timezones, a headless API and an embeddable web component.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|