@event-calendar/core 5.2.1 → 5.2.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 +12 -3
- package/dist/index.css +20 -1
- package/dist/index.js +7 -3
- package/package.json +1 -1
- package/src/Calendar.svelte +3 -2
- package/src/storage/options.svelte.js +3 -1
- package/src/styles/index.css +1 -0
- package/src/styles/scrollbars.css +19 -0
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), it implements similar opti
|
|
|
41
41
|
- [buttonText](#buttontext)
|
|
42
42
|
- [columnWidth](#columnwidth)
|
|
43
43
|
- [customButtons](#custombuttons)
|
|
44
|
+
- [customScrollbars](#customscrollbars)
|
|
44
45
|
- [date](#date)
|
|
45
46
|
- [dateClick](#dateclick)
|
|
46
47
|
- [datesAboveResources](#datesaboveresources)
|
|
@@ -67,9 +68,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), it implements similar opti
|
|
|
67
68
|
- [eventDragStart](#eventdragstart)
|
|
68
69
|
- [eventDragStop](#eventdragstop)
|
|
69
70
|
- [eventDrop](#eventdrop)
|
|
70
|
-
- [eventDurationEditable](#eventdurationeditable)
|
|
71
71
|
</td><td>
|
|
72
72
|
|
|
73
|
+
- [eventDurationEditable](#eventdurationeditable)
|
|
73
74
|
- [eventFilter](#eventfilter)
|
|
74
75
|
- [eventLongPressDelay](#eventlongpressdelay)
|
|
75
76
|
- [eventMouseEnter](#eventmouseenter)
|
|
@@ -246,8 +247,8 @@ This bundle contains a version of the calendar that includes all plugins and is
|
|
|
246
247
|
|
|
247
248
|
The first step is to include the following lines of code in the `<head>` section of your page:
|
|
248
249
|
```html
|
|
249
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.2.
|
|
250
|
-
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.2.
|
|
250
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.2.2/dist/event-calendar.min.css">
|
|
251
|
+
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.2.2/dist/event-calendar.min.js"></script>
|
|
251
252
|
```
|
|
252
253
|
|
|
253
254
|
<details>
|
|
@@ -470,6 +471,14 @@ function (customButtons) {
|
|
|
470
471
|
</tr>
|
|
471
472
|
</table>
|
|
472
473
|
|
|
474
|
+
### customScrollbars
|
|
475
|
+
- Type `boolean`
|
|
476
|
+
- Default `false`
|
|
477
|
+
|
|
478
|
+
Enables scrollbars styling, which in turn prevents the scrollbars from being hidden in [supported](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/::-webkit-scrollbar#browser_compatibility) browsers.
|
|
479
|
+
|
|
480
|
+
This option can be useful, for example, for macOS users in `resourceTimeline` views to indicate that the calendar can be scrolled horizontally. On macOS, scrollbars can be hidden completely, and this option ensures they are always visible in [supported](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/::-webkit-scrollbar#browser_compatibility) browsers.
|
|
481
|
+
|
|
473
482
|
### date
|
|
474
483
|
- Type `Date` or `string`
|
|
475
484
|
- Default `new Date()`
|
package/dist/index.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* EventCalendar v5.2.
|
|
2
|
+
* EventCalendar v5.2.2
|
|
3
3
|
* https://github.com/vkurko/calendar
|
|
4
4
|
*/
|
|
5
5
|
.ec {
|
|
@@ -628,6 +628,25 @@
|
|
|
628
628
|
pointer-events: auto;
|
|
629
629
|
}
|
|
630
630
|
}
|
|
631
|
+
.ec-custom-scrollbars {
|
|
632
|
+
.ec-main {
|
|
633
|
+
&::-webkit-scrollbar {
|
|
634
|
+
background-color: transparent;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
&::-webkit-scrollbar-thumb {
|
|
638
|
+
border: 4px solid transparent;
|
|
639
|
+
box-shadow: none;
|
|
640
|
+
background-color: var(--ec-border-color);
|
|
641
|
+
background-clip: padding-box;
|
|
642
|
+
border-radius: 8px;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
646
|
+
background-color: var(--ec-color-400);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
}
|
|
631
650
|
.ec {
|
|
632
651
|
display: flex;
|
|
633
652
|
flex-direction: column;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* EventCalendar v5.2.
|
|
2
|
+
* EventCalendar v5.2.2
|
|
3
3
|
* https://github.com/vkurko/calendar
|
|
4
4
|
*/
|
|
5
5
|
import { untrack, getAbortSignal, tick, getContext, setContext, onMount, mount, unmount } from "svelte";
|
|
@@ -762,6 +762,8 @@ function createOptions(plugins) {
|
|
|
762
762
|
let options = {
|
|
763
763
|
buttonText: { today: "today" },
|
|
764
764
|
customButtons: {},
|
|
765
|
+
customScrollbars: false,
|
|
766
|
+
// ec option
|
|
765
767
|
date: /* @__PURE__ */ new Date(),
|
|
766
768
|
datesSet: void 0,
|
|
767
769
|
dayHeaderFormat: { weekday: "short", month: "numeric", day: "numeric" },
|
|
@@ -805,6 +807,7 @@ function createOptions(plugins) {
|
|
|
805
807
|
buttonGroup: "ec-button-group",
|
|
806
808
|
calendar: "ec",
|
|
807
809
|
colHead: "ec-col-head",
|
|
810
|
+
customScrollbars: "ec-custom-scrollbars",
|
|
808
811
|
day: "ec-day",
|
|
809
812
|
dayHead: "ec-day-head",
|
|
810
813
|
disabled: "ec-disabled",
|
|
@@ -1690,7 +1693,7 @@ function Calendar($$anchor, $$props) {
|
|
|
1690
1693
|
let plugins = $.prop($$props, "plugins", 19, () => []), options = $.prop($$props, "options", 19, () => ({}));
|
|
1691
1694
|
let mainState = new State(plugins(), options());
|
|
1692
1695
|
setContext("state", mainState);
|
|
1693
|
-
let auxComponents = $.derived(() => mainState.auxComponents), features = $.derived(() => mainState.features), events = $.derived(() => mainState.events), interaction = $.derived(() => mainState.interaction), iClass = $.derived(() => mainState.iClass), view2 = $.derived(() => mainState.view), View2 = $.derived(() => mainState.viewComponent), date = $.derived(() => mainState.options.date), duration = $.derived(() => mainState.options.duration), height2 = $.derived(() => mainState.options.height), hiddenDays = $.derived(() => mainState.options.hiddenDays), theme = $.derived(() => mainState.options.theme);
|
|
1696
|
+
let auxComponents = $.derived(() => mainState.auxComponents), features = $.derived(() => mainState.features), events = $.derived(() => mainState.events), interaction = $.derived(() => mainState.interaction), iClass = $.derived(() => mainState.iClass), view2 = $.derived(() => mainState.view), View2 = $.derived(() => mainState.viewComponent), date = $.derived(() => mainState.options.date), duration = $.derived(() => mainState.options.duration), height2 = $.derived(() => mainState.options.height), hiddenDays = $.derived(() => mainState.options.hiddenDays), customScrollbars = $.derived(() => mainState.options.customScrollbars), theme = $.derived(() => mainState.options.theme);
|
|
1694
1697
|
let prevOptions = { ...options() };
|
|
1695
1698
|
$.user_pre_effect(() => {
|
|
1696
1699
|
for (let [name, value] of diff(options(), prevOptions)) {
|
|
@@ -1828,7 +1831,8 @@ function Calendar($$anchor, $$props) {
|
|
|
1828
1831
|
$.set_class(div, 1, $.clsx([
|
|
1829
1832
|
$.get(theme).calendar,
|
|
1830
1833
|
$.get(theme).view,
|
|
1831
|
-
$.get(iClass) && $.get(theme)[$.get(iClass)]
|
|
1834
|
+
$.get(iClass) && $.get(theme)[$.get(iClass)],
|
|
1835
|
+
$.get(customScrollbars) && $.get(theme).customScrollbars
|
|
1832
1836
|
]));
|
|
1833
1837
|
$.set_attribute(div, "role", $0);
|
|
1834
1838
|
styles = $.set_style(div, "", styles, { height: $.get(height2) });
|
package/package.json
CHANGED
package/src/Calendar.svelte
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
let {
|
|
19
19
|
auxComponents, features, events, interaction, iClass, view, viewComponent: View,
|
|
20
|
-
options: {date, duration, height, hiddenDays, theme}
|
|
20
|
+
options: {date, duration, height, hiddenDays, customScrollbars, theme}
|
|
21
21
|
} = $derived(mainState);
|
|
22
22
|
|
|
23
23
|
// Reactively update options that did change
|
|
@@ -131,7 +131,8 @@
|
|
|
131
131
|
class={[
|
|
132
132
|
theme.calendar,
|
|
133
133
|
theme.view,
|
|
134
|
-
iClass && theme[iClass]
|
|
134
|
+
iClass && theme[iClass],
|
|
135
|
+
customScrollbars && theme.customScrollbars
|
|
135
136
|
]}
|
|
136
137
|
style:height
|
|
137
138
|
role="{features.includes('list') ? 'list' : 'table'}"
|
|
@@ -11,6 +11,7 @@ function createOptions(plugins) {
|
|
|
11
11
|
today: 'today',
|
|
12
12
|
},
|
|
13
13
|
customButtons: {},
|
|
14
|
+
customScrollbars: false, // ec option
|
|
14
15
|
date: new Date(),
|
|
15
16
|
datesSet: undefined,
|
|
16
17
|
dayHeaderFormat: {
|
|
@@ -31,7 +32,7 @@ function createOptions(plugins) {
|
|
|
31
32
|
eventColor: undefined,
|
|
32
33
|
eventContent: undefined,
|
|
33
34
|
eventDidMount: undefined,
|
|
34
|
-
eventFilter: undefined,
|
|
35
|
+
eventFilter: undefined, // ec option
|
|
35
36
|
eventMouseEnter: undefined,
|
|
36
37
|
eventMouseLeave: undefined,
|
|
37
38
|
eventOrder: undefined,
|
|
@@ -65,6 +66,7 @@ function createOptions(plugins) {
|
|
|
65
66
|
buttonGroup: 'ec-button-group',
|
|
66
67
|
calendar: 'ec',
|
|
67
68
|
colHead: 'ec-col-head',
|
|
69
|
+
customScrollbars: 'ec-custom-scrollbars',
|
|
68
70
|
day: 'ec-day',
|
|
69
71
|
dayHead: 'ec-day-head',
|
|
70
72
|
disabled: 'ec-disabled',
|
package/src/styles/index.css
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.ec-custom-scrollbars {
|
|
2
|
+
.ec-main {
|
|
3
|
+
&::-webkit-scrollbar {
|
|
4
|
+
background-color: transparent;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
&::-webkit-scrollbar-thumb {
|
|
8
|
+
border: 4px solid transparent;
|
|
9
|
+
box-shadow: none;
|
|
10
|
+
background-color: var(--ec-border-color);
|
|
11
|
+
background-clip: padding-box;
|
|
12
|
+
border-radius: 8px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
16
|
+
background-color: var(--ec-color-400);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|