@event-calendar/core 5.3.3 → 5.4.1
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 +95 -7
- package/dist/index.css +1 -1
- package/dist/index.js +212 -262
- package/package.json +2 -2
- package/src/lib/resources.js +5 -5
- package/src/plugins/resource-timeline/Expander.svelte +21 -14
- package/src/plugins/resource-timeline/index.js +53 -38
- package/src/storage/options.js +2 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ See [demo](https://vkurko.github.io/calendar/) and [changelog](CHANGELOG.md).
|
|
|
5
5
|
Full-sized drag & drop JavaScript event calendar with resource & timeline views:
|
|
6
6
|
|
|
7
7
|
* Lightweight (35kb [br](https://en.wikipedia.org/wiki/Brotli) compressed)
|
|
8
|
-
*
|
|
8
|
+
* Minimal DOM structure (thanks to [CSS Grid](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Grid_layout))
|
|
9
9
|
* Zero-dependency (standalone bundle)
|
|
10
10
|
* Used on over 70,000 websites with [Bookly](https://wordpress.org/plugins/bookly-responsive-appointment-booking-tool/)
|
|
11
11
|
|
|
@@ -68,9 +68,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), it implements similar opti
|
|
|
68
68
|
- [eventDragStart](#eventdragstart)
|
|
69
69
|
- [eventDragStop](#eventdragstop)
|
|
70
70
|
- [eventDrop](#eventdrop)
|
|
71
|
+
- [eventDurationEditable](#eventdurationeditable)
|
|
71
72
|
</td><td>
|
|
72
73
|
|
|
73
|
-
- [eventDurationEditable](#eventdurationeditable)
|
|
74
74
|
- [eventFilter](#eventfilter)
|
|
75
75
|
- [eventLongPressDelay](#eventlongpressdelay)
|
|
76
76
|
- [eventMouseEnter](#eventmouseenter)
|
|
@@ -92,6 +92,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), it implements similar opti
|
|
|
92
92
|
- [height](#height)
|
|
93
93
|
- [hiddenDays](#hiddendays)
|
|
94
94
|
- [highlightedDates](#highlighteddates)
|
|
95
|
+
- [icons](#icons)
|
|
95
96
|
- [lazyFetching](#lazyfetching)
|
|
96
97
|
- [listDayFormat](#listdayformat)
|
|
97
98
|
- [listDaySideFormat](#listdaysideformat)
|
|
@@ -102,11 +103,12 @@ Inspired by [FullCalendar](https://fullcalendar.io/), it implements similar opti
|
|
|
102
103
|
- [noEventsClick](#noeventsclick)
|
|
103
104
|
- [noEventsContent](#noeventscontent)
|
|
104
105
|
- [nowIndicator](#nowindicator)
|
|
106
|
+
- [pointer](#pointer)
|
|
105
107
|
</td><td>
|
|
106
108
|
|
|
107
|
-
- [pointer](#pointer)
|
|
108
109
|
- [refetchResourcesOnNavigate](#refetchresourcesonnavigate)
|
|
109
110
|
- [resizeConstraint](#resizeconstraint)
|
|
111
|
+
- [resourceExpand](#resourceexpand)
|
|
110
112
|
- [resources](#resources)
|
|
111
113
|
- [resourceLabelContent](#resourcelabelcontent)
|
|
112
114
|
- [resourceLabelDidMount](#resourcelabeldidmount)
|
|
@@ -251,8 +253,8 @@ This bundle contains a version of the calendar that includes all plugins and is
|
|
|
251
253
|
|
|
252
254
|
The first step is to include the following lines of code in the `<head>` section of your page:
|
|
253
255
|
```html
|
|
254
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.
|
|
255
|
-
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.
|
|
256
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.4.1/dist/event-calendar.min.css">
|
|
257
|
+
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@5.4.1/dist/event-calendar.min.js"></script>
|
|
256
258
|
```
|
|
257
259
|
|
|
258
260
|
<details>
|
|
@@ -347,7 +349,7 @@ When hidden with `false`, all-day events will not be displayed in `timeGrid`/`re
|
|
|
347
349
|
<details>
|
|
348
350
|
<summary>Default</summary>
|
|
349
351
|
|
|
350
|
-
`{close: 'Close', dayGridDay: 'day', dayGridMonth: 'month', dayGridWeek: 'week', listDay: 'list', listMonth: 'list', listWeek: 'list', listYear: 'list', resourceTimeGridDay: 'resources', resourceTimeGridWeek: 'resources', resourceTimelineDay: 'timeline', resourceTimelineMonth: 'timeline', resourceTimelineWeek: 'timeline', timeGridDay: 'day', timeGridWeek: 'week', today: 'today'}`
|
|
352
|
+
`{collapse: 'Collapse', close: 'Close', dayGridDay: 'day', dayGridMonth: 'month', dayGridWeek: 'week', expand: 'Expand', listDay: 'list', listMonth: 'list', listWeek: 'list', listYear: 'list', resourceTimeGridDay: 'resources', resourceTimeGridWeek: 'resources', resourceTimelineDay: 'timeline', resourceTimelineMonth: 'timeline', resourceTimelineWeek: 'timeline', timeGridDay: 'day', timeGridWeek: 'week', today: 'today'}`
|
|
351
353
|
> Views override the default value as follows:
|
|
352
354
|
> - dayGridDay `text => ({...text, next: 'Next day', prev: 'Previous day'})`
|
|
353
355
|
> - dayGridMonth `text => ({...text, next: 'Next month', prev: 'Previous month'})`
|
|
@@ -1829,6 +1831,31 @@ Array of dates that need to be highlighted in the calendar.
|
|
|
1829
1831
|
|
|
1830
1832
|
Each date can be either an ISO8601 date string like `'2026-12-31'`, or a JavaScript Date object.
|
|
1831
1833
|
|
|
1834
|
+
### icons
|
|
1835
|
+
- Type `object`
|
|
1836
|
+
- Default `{collapse: {html: '−'}, expand: {html: '+'}}`
|
|
1837
|
+
|
|
1838
|
+
Defines icons used in some buttons, such as those for expanding nested resources in `resourceTimeline` views.
|
|
1839
|
+
|
|
1840
|
+
Each icon is specified as a [Content](#content) value.
|
|
1841
|
+
|
|
1842
|
+
This option can be either a plain object with all necessary properties, or a callback function that receives default icons object and should return a new one:
|
|
1843
|
+
|
|
1844
|
+
```js
|
|
1845
|
+
function (icons) {
|
|
1846
|
+
// return new icons object
|
|
1847
|
+
}
|
|
1848
|
+
```
|
|
1849
|
+
<table>
|
|
1850
|
+
<tr>
|
|
1851
|
+
<td>
|
|
1852
|
+
|
|
1853
|
+
`icons`
|
|
1854
|
+
</td>
|
|
1855
|
+
<td>An object with default icons</td>
|
|
1856
|
+
</tr>
|
|
1857
|
+
</table>
|
|
1858
|
+
|
|
1832
1859
|
### lazyFetching
|
|
1833
1860
|
- Type `boolean`
|
|
1834
1861
|
- Default `true`
|
|
@@ -2029,6 +2056,47 @@ Callback function that limits the date/time range within which the event is allo
|
|
|
2029
2056
|
|
|
2030
2057
|
The function is triggered during resizing for each cursor movement and takes the same parameters as [eventResize](#eventresize). The function should return `true` if the new size is allowed, and `false` otherwise.
|
|
2031
2058
|
|
|
2059
|
+
### resourceExpand
|
|
2060
|
+
- Type `function`
|
|
2061
|
+
- Default `undefined`
|
|
2062
|
+
|
|
2063
|
+
Callback function that is triggered when a resource with nested children is expanded or collapsed in `resourceTimeline` views.
|
|
2064
|
+
|
|
2065
|
+
|
|
2066
|
+
```js
|
|
2067
|
+
function (info) { }
|
|
2068
|
+
```
|
|
2069
|
+
`info` is an object with the following properties:
|
|
2070
|
+
<table>
|
|
2071
|
+
<tr>
|
|
2072
|
+
<td>
|
|
2073
|
+
|
|
2074
|
+
`resource`
|
|
2075
|
+
</td>
|
|
2076
|
+
<td>
|
|
2077
|
+
|
|
2078
|
+
The associated [Resource](#resource-object) object
|
|
2079
|
+
</td>
|
|
2080
|
+
</tr>
|
|
2081
|
+
<tr>
|
|
2082
|
+
<td>
|
|
2083
|
+
|
|
2084
|
+
`jsEvent`
|
|
2085
|
+
</td>
|
|
2086
|
+
<td>JavaScript native event object with low-level information such as click coordinates</td>
|
|
2087
|
+
</tr>
|
|
2088
|
+
<tr>
|
|
2089
|
+
<td>
|
|
2090
|
+
|
|
2091
|
+
`view`
|
|
2092
|
+
</td>
|
|
2093
|
+
<td>
|
|
2094
|
+
|
|
2095
|
+
The current [View](#view-object) object
|
|
2096
|
+
</td>
|
|
2097
|
+
</tr>
|
|
2098
|
+
</table>
|
|
2099
|
+
|
|
2032
2100
|
### resources
|
|
2033
2101
|
- Type `array`, `object` or `function`
|
|
2034
2102
|
- Default `[]`
|
|
@@ -3263,6 +3331,16 @@ The title of the resource. See [Content](#content)
|
|
|
3263
3331
|
<tr>
|
|
3264
3332
|
<td>
|
|
3265
3333
|
|
|
3334
|
+
`expanded`
|
|
3335
|
+
</td>
|
|
3336
|
+
<td>
|
|
3337
|
+
|
|
3338
|
+
A flag indicating whether the resource is expanded or collapsed if it has nested children
|
|
3339
|
+
</td>
|
|
3340
|
+
</tr>
|
|
3341
|
+
<tr>
|
|
3342
|
+
<td>
|
|
3343
|
+
|
|
3266
3344
|
`extendedProps`
|
|
3267
3345
|
</td>
|
|
3268
3346
|
<td>
|
|
@@ -3320,6 +3398,16 @@ Here are all admissible fields for the resource’s input object:
|
|
|
3320
3398
|
<tr>
|
|
3321
3399
|
<td>
|
|
3322
3400
|
|
|
3401
|
+
`expanded`
|
|
3402
|
+
</td>
|
|
3403
|
+
<td>
|
|
3404
|
+
|
|
3405
|
+
`boolean` Specifies whether the resource with nested children will be expanded or collapsed. Default `true`
|
|
3406
|
+
</td>
|
|
3407
|
+
</tr>
|
|
3408
|
+
<tr>
|
|
3409
|
+
<td>
|
|
3410
|
+
|
|
3323
3411
|
`extendedProps`
|
|
3324
3412
|
</td>
|
|
3325
3413
|
<td>
|
|
@@ -3336,7 +3424,7 @@ Here are all admissible fields for the resource’s input object:
|
|
|
3336
3424
|
</tr>
|
|
3337
3425
|
</table>
|
|
3338
3426
|
|
|
3339
|
-
The `
|
|
3427
|
+
The `resourceTimeline` views support displaying nested resources. Nested resources can be collapsed or expanded using an additional button that appears before the parent resource name. To pass nested resources, use the `children` field:
|
|
3340
3428
|
|
|
3341
3429
|
```js
|
|
3342
3430
|
resources: [
|
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* EventCalendar v5.
|
|
2
|
+
* EventCalendar v5.4.1
|
|
3
3
|
* https://github.com/vkurko/calendar
|
|
4
4
|
*/
|
|
5
5
|
import { untrack, tick, getAbortSignal, getContext, setContext, onMount, mount, unmount } from "svelte";
|
|
@@ -679,10 +679,10 @@ function outsideRange(date, range) {
|
|
|
679
679
|
}
|
|
680
680
|
function createResources(input) {
|
|
681
681
|
let result = [];
|
|
682
|
-
_createResources(input, 0, result);
|
|
682
|
+
_createResources(input, 0, false, result);
|
|
683
683
|
return result;
|
|
684
684
|
}
|
|
685
|
-
function _createResources(input, level, flat) {
|
|
685
|
+
function _createResources(input, level, hidden, flat) {
|
|
686
686
|
let result = [];
|
|
687
687
|
for (let item of input) {
|
|
688
688
|
let resource = createResource(item);
|
|
@@ -691,12 +691,11 @@ function _createResources(input, level, flat) {
|
|
|
691
691
|
let payload = {
|
|
692
692
|
level,
|
|
693
693
|
children: [],
|
|
694
|
-
|
|
695
|
-
hidden: false
|
|
694
|
+
hidden
|
|
696
695
|
};
|
|
697
696
|
setPayload(resource, payload);
|
|
698
697
|
if (item.children) {
|
|
699
|
-
payload.children = _createResources(item.children, level + 1, flat);
|
|
698
|
+
payload.children = _createResources(item.children, level + 1, hidden || !resource.expanded, flat);
|
|
700
699
|
}
|
|
701
700
|
}
|
|
702
701
|
return result;
|
|
@@ -707,6 +706,7 @@ function createResource(input) {
|
|
|
707
706
|
title: input.title || "",
|
|
708
707
|
eventBackgroundColor: eventBackgroundColor(input),
|
|
709
708
|
eventTextColor: eventTextColor(input),
|
|
709
|
+
expanded: input.expanded ?? true,
|
|
710
710
|
extendedProps: input.extendedProps ?? {}
|
|
711
711
|
};
|
|
712
712
|
}
|
|
@@ -851,6 +851,8 @@ function createOptions(plugins) {
|
|
|
851
851
|
hiddenDays: [],
|
|
852
852
|
highlightedDates: [],
|
|
853
853
|
// ec option
|
|
854
|
+
icons: {},
|
|
855
|
+
// ec option
|
|
854
856
|
lazyFetching: true,
|
|
855
857
|
loading: void 0,
|
|
856
858
|
locale: void 0,
|
|
@@ -922,7 +924,7 @@ function createParsers(plugins) {
|
|
|
922
924
|
}
|
|
923
925
|
return parsers;
|
|
924
926
|
}
|
|
925
|
-
const specialOptions = ["buttonText", "customButtons", "theme"];
|
|
927
|
+
const specialOptions = ["buttonText", "customButtons", "icons", "theme"];
|
|
926
928
|
function optionsState(plugins, userOptions) {
|
|
927
929
|
let defOptions = createOptions(plugins);
|
|
928
930
|
let parsers = createParsers(plugins);
|
|
@@ -1526,11 +1528,11 @@ class State {
|
|
|
1526
1528
|
}
|
|
1527
1529
|
}
|
|
1528
1530
|
var root_2$5 = $.from_html(`<h2></h2>`);
|
|
1531
|
+
var root_3$2 = $.from_html(`<button><i></i></button>`);
|
|
1529
1532
|
var root_4$1 = $.from_html(`<button><i></i></button>`);
|
|
1530
|
-
var
|
|
1531
|
-
var
|
|
1532
|
-
var
|
|
1533
|
-
var root_12$1 = $.from_html(`<button> </button>`);
|
|
1533
|
+
var root_5 = $.from_html(`<button> </button>`);
|
|
1534
|
+
var root_6$1 = $.from_html(`<button></button>`);
|
|
1535
|
+
var root_7$1 = $.from_html(`<button> </button>`);
|
|
1534
1536
|
function Buttons($$anchor, $$props) {
|
|
1535
1537
|
$.push($$props, true);
|
|
1536
1538
|
let mainState = getContext("state");
|
|
@@ -1596,151 +1598,81 @@ function Buttons($$anchor, $$props) {
|
|
|
1596
1598
|
$.template_effect(() => $.set_class(h2, 1, $.get(theme).title));
|
|
1597
1599
|
$.append($$anchor3, h2);
|
|
1598
1600
|
};
|
|
1599
|
-
var
|
|
1600
|
-
var
|
|
1601
|
-
var
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
$.append($$anchor7, button_4);
|
|
1667
|
-
};
|
|
1668
|
-
var alternate = ($$anchor7) => {
|
|
1669
|
-
var fragment_6 = $.comment();
|
|
1670
|
-
var node_6 = $.first_child(fragment_6);
|
|
1671
|
-
{
|
|
1672
|
-
var consequent_5 = ($$anchor8) => {
|
|
1673
|
-
var button_5 = root_12$1();
|
|
1674
|
-
button_5.__click = () => mainState.setOption("view", $.get(button));
|
|
1675
|
-
var text_1 = $.child(button_5, true);
|
|
1676
|
-
$.reset(button_5);
|
|
1677
|
-
$.template_effect(() => {
|
|
1678
|
-
$.set_class(button_5, 1, $.clsx([
|
|
1679
|
-
$.get(theme).button,
|
|
1680
|
-
`ec-${$.get(button)}`,
|
|
1681
|
-
$.get(view2) === $.get(button) && $.get(theme).active
|
|
1682
|
-
]));
|
|
1683
|
-
$.set_text(text_1, $.get(buttonText)[$.get(button)]);
|
|
1684
|
-
});
|
|
1685
|
-
$.append($$anchor8, button_5);
|
|
1686
|
-
};
|
|
1687
|
-
$.if(
|
|
1688
|
-
node_6,
|
|
1689
|
-
($$render) => {
|
|
1690
|
-
if ($.get(button) !== "") $$render(consequent_5);
|
|
1691
|
-
},
|
|
1692
|
-
true
|
|
1693
|
-
);
|
|
1694
|
-
}
|
|
1695
|
-
$.append($$anchor7, fragment_6);
|
|
1696
|
-
};
|
|
1697
|
-
$.if(
|
|
1698
|
-
node_5,
|
|
1699
|
-
($$render) => {
|
|
1700
|
-
if ($.get(customButtons)[$.get(button)]) $$render(consequent_4);
|
|
1701
|
-
else $$render(alternate, false);
|
|
1702
|
-
},
|
|
1703
|
-
true
|
|
1704
|
-
);
|
|
1705
|
-
}
|
|
1706
|
-
$.append($$anchor6, fragment_5);
|
|
1707
|
-
};
|
|
1708
|
-
$.if(
|
|
1709
|
-
node_4,
|
|
1710
|
-
($$render) => {
|
|
1711
|
-
if ($.get(button) === "today") $$render(consequent_3);
|
|
1712
|
-
else $$render(alternate_1, false);
|
|
1713
|
-
},
|
|
1714
|
-
true
|
|
1715
|
-
);
|
|
1716
|
-
}
|
|
1717
|
-
$.append($$anchor5, fragment_4);
|
|
1718
|
-
};
|
|
1719
|
-
$.if(
|
|
1720
|
-
node_3,
|
|
1721
|
-
($$render) => {
|
|
1722
|
-
if ($.get(button) === "next") $$render(consequent_2);
|
|
1723
|
-
else $$render(alternate_2, false);
|
|
1724
|
-
},
|
|
1725
|
-
true
|
|
1726
|
-
);
|
|
1727
|
-
}
|
|
1728
|
-
$.append($$anchor4, fragment_3);
|
|
1729
|
-
};
|
|
1730
|
-
$.if(
|
|
1731
|
-
node_2,
|
|
1732
|
-
($$render) => {
|
|
1733
|
-
if ($.get(button) === "prev") $$render(consequent_1);
|
|
1734
|
-
else $$render(alternate_3, false);
|
|
1735
|
-
},
|
|
1736
|
-
true
|
|
1737
|
-
);
|
|
1738
|
-
}
|
|
1739
|
-
$.append($$anchor3, fragment_2);
|
|
1601
|
+
var consequent_1 = ($$anchor3) => {
|
|
1602
|
+
var button_1 = root_3$2();
|
|
1603
|
+
var i = $.child(button_1);
|
|
1604
|
+
$.reset(button_1);
|
|
1605
|
+
$.template_effect(() => {
|
|
1606
|
+
$.set_class(button_1, 1, `${$.get(theme).button ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1607
|
+
$.set_attribute(button_1, "aria-label", $.get(buttonText).prev);
|
|
1608
|
+
$.set_attribute(button_1, "title", $.get(buttonText).prev);
|
|
1609
|
+
button_1.disabled = $.get(prevDisabled);
|
|
1610
|
+
$.set_class(i, 1, `${$.get(theme).icon ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1611
|
+
});
|
|
1612
|
+
$.delegated("click", button_1, prev);
|
|
1613
|
+
$.append($$anchor3, button_1);
|
|
1614
|
+
};
|
|
1615
|
+
var consequent_2 = ($$anchor3) => {
|
|
1616
|
+
var button_2 = root_4$1();
|
|
1617
|
+
var i_1 = $.child(button_2);
|
|
1618
|
+
$.reset(button_2);
|
|
1619
|
+
$.template_effect(() => {
|
|
1620
|
+
$.set_class(button_2, 1, `${$.get(theme).button ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1621
|
+
$.set_attribute(button_2, "aria-label", $.get(buttonText).next);
|
|
1622
|
+
$.set_attribute(button_2, "title", $.get(buttonText).next);
|
|
1623
|
+
button_2.disabled = $.get(nextDisabled);
|
|
1624
|
+
$.set_class(i_1, 1, `${$.get(theme).icon ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1625
|
+
});
|
|
1626
|
+
$.delegated("click", button_2, next);
|
|
1627
|
+
$.append($$anchor3, button_2);
|
|
1628
|
+
};
|
|
1629
|
+
var consequent_3 = ($$anchor3) => {
|
|
1630
|
+
var button_3 = root_5();
|
|
1631
|
+
var text = $.child(button_3, true);
|
|
1632
|
+
$.reset(button_3);
|
|
1633
|
+
$.template_effect(() => {
|
|
1634
|
+
$.set_class(button_3, 1, `${$.get(theme).button ?? ""} ec-${$.get(button) ?? ""}`);
|
|
1635
|
+
button_3.disabled = $.get(todayDisabled);
|
|
1636
|
+
$.set_text(text, $.get(buttonText)[$.get(button)]);
|
|
1637
|
+
});
|
|
1638
|
+
$.delegated("click", button_3, setToday);
|
|
1639
|
+
$.append($$anchor3, button_3);
|
|
1640
|
+
};
|
|
1641
|
+
var consequent_4 = ($$anchor3) => {
|
|
1642
|
+
var button_4 = root_6$1();
|
|
1643
|
+
$.attach(button_4, () => contentFrom($.get(customButtons)[$.get(button)].text));
|
|
1644
|
+
$.template_effect(() => $.set_class(button_4, 1, $.clsx([
|
|
1645
|
+
$.get(theme).button,
|
|
1646
|
+
`ec-${$.get(button)}`,
|
|
1647
|
+
$.get(customButtons)[$.get(button)].active && $.get(theme).active
|
|
1648
|
+
])));
|
|
1649
|
+
$.delegated("click", button_4, function(...$$args) {
|
|
1650
|
+
$.get(customButtons)[$.get(button)].click?.apply(this, $$args);
|
|
1651
|
+
});
|
|
1652
|
+
$.append($$anchor3, button_4);
|
|
1653
|
+
};
|
|
1654
|
+
var consequent_5 = ($$anchor3) => {
|
|
1655
|
+
var button_5 = root_7$1();
|
|
1656
|
+
var text_1 = $.child(button_5, true);
|
|
1657
|
+
$.reset(button_5);
|
|
1658
|
+
$.template_effect(() => {
|
|
1659
|
+
$.set_class(button_5, 1, $.clsx([
|
|
1660
|
+
$.get(theme).button,
|
|
1661
|
+
`ec-${$.get(button)}`,
|
|
1662
|
+
$.get(view2) === $.get(button) && $.get(theme).active
|
|
1663
|
+
]));
|
|
1664
|
+
$.set_text(text_1, $.get(buttonText)[$.get(button)]);
|
|
1665
|
+
});
|
|
1666
|
+
$.delegated("click", button_5, () => mainState.setOption("view", $.get(button)));
|
|
1667
|
+
$.append($$anchor3, button_5);
|
|
1740
1668
|
};
|
|
1741
1669
|
$.if(node_1, ($$render) => {
|
|
1742
1670
|
if ($.get(button) === "title") $$render(consequent);
|
|
1743
|
-
else $$render(
|
|
1671
|
+
else if ($.get(button) === "prev") $$render(consequent_1, 1);
|
|
1672
|
+
else if ($.get(button) === "next") $$render(consequent_2, 2);
|
|
1673
|
+
else if ($.get(button) === "today") $$render(consequent_3, 3);
|
|
1674
|
+
else if ($.get(customButtons)[$.get(button)]) $$render(consequent_4, 4);
|
|
1675
|
+
else if ($.get(button) !== "") $$render(consequent_5, 5);
|
|
1744
1676
|
});
|
|
1745
1677
|
}
|
|
1746
1678
|
$.append($$anchor2, fragment_1);
|
|
@@ -2132,9 +2064,6 @@ function BaseDay($$anchor, $$props) {
|
|
|
2132
2064
|
});
|
|
2133
2065
|
let onpointerdown = $.derived(() => !disabled() && $.get(action) ? (jsEvent) => $.get(action).select(jsEvent, $.get(snap2)) : void 0);
|
|
2134
2066
|
var div = root$9();
|
|
2135
|
-
div.__pointerdown = function(...$$args) {
|
|
2136
|
-
$.get(onpointerdown)?.apply(this, $$args);
|
|
2137
|
-
};
|
|
2138
2067
|
var node = $.child(div);
|
|
2139
2068
|
$.snippet(node, () => $$props.children ?? $.noop);
|
|
2140
2069
|
$.reset(div);
|
|
@@ -2143,6 +2072,9 @@ function BaseDay($$anchor, $$props) {
|
|
|
2143
2072
|
$.set_class(div, 1, $.clsx($.get(classNames)));
|
|
2144
2073
|
$.set_attribute(div, "role", role());
|
|
2145
2074
|
});
|
|
2075
|
+
$.delegated("pointerdown", div, function(...$$args) {
|
|
2076
|
+
$.get(onpointerdown)?.apply(this, $$args);
|
|
2077
|
+
});
|
|
2146
2078
|
$.append($$anchor, div);
|
|
2147
2079
|
$.pop();
|
|
2148
2080
|
}
|
|
@@ -2186,15 +2118,6 @@ function BaseEvent($$anchor, $$props) {
|
|
|
2186
2118
|
let onmouseenter = $.derived(() => createHandler($.get(eventMouseEnter), $.get(display)));
|
|
2187
2119
|
let onmouseleave = $.derived(() => createHandler($.get(eventMouseLeave), $.get(display)));
|
|
2188
2120
|
var article = root$8();
|
|
2189
|
-
article.__click = function(...$$args) {
|
|
2190
|
-
$.get(onclick)?.apply(this, $$args);
|
|
2191
|
-
};
|
|
2192
|
-
article.__keydown = function(...$$args) {
|
|
2193
|
-
$.get(onkeydown)?.apply(this, $$args);
|
|
2194
|
-
};
|
|
2195
|
-
article.__pointerdown = function(...$$args) {
|
|
2196
|
-
$$props.onpointerdown?.apply(this, $$args);
|
|
2197
|
-
};
|
|
2198
2121
|
{
|
|
2199
2122
|
const defaultBody = ($$anchor2) => {
|
|
2200
2123
|
var div = root_1$b();
|
|
@@ -2227,12 +2150,21 @@ function BaseEvent($$anchor, $$props) {
|
|
|
2227
2150
|
$.set_attribute(article, "role", $.get(onclick) ? "button" : void 0);
|
|
2228
2151
|
$.set_attribute(article, "tabindex", $.get(onclick) ? 0 : void 0);
|
|
2229
2152
|
});
|
|
2153
|
+
$.delegated("click", article, function(...$$args) {
|
|
2154
|
+
$.get(onclick)?.apply(this, $$args);
|
|
2155
|
+
});
|
|
2156
|
+
$.delegated("keydown", article, function(...$$args) {
|
|
2157
|
+
$.get(onkeydown)?.apply(this, $$args);
|
|
2158
|
+
});
|
|
2230
2159
|
$.event("mouseenter", article, function(...$$args) {
|
|
2231
2160
|
$.get(onmouseenter)?.apply(this, $$args);
|
|
2232
2161
|
});
|
|
2233
2162
|
$.event("mouseleave", article, function(...$$args) {
|
|
2234
2163
|
$.get(onmouseleave)?.apply(this, $$args);
|
|
2235
2164
|
});
|
|
2165
|
+
$.delegated("pointerdown", article, function(...$$args) {
|
|
2166
|
+
$$props.onpointerdown?.apply(this, $$args);
|
|
2167
|
+
});
|
|
2236
2168
|
$.append($$anchor, article);
|
|
2237
2169
|
$.pop();
|
|
2238
2170
|
}
|
|
@@ -2445,8 +2377,9 @@ function Day$3($$anchor, $$props) {
|
|
|
2445
2377
|
$.template_effect(($0) => $.set_attribute(time, "datetime", $0), [() => toISOString($.get(dayStart), 10)]);
|
|
2446
2378
|
$.append($$anchor3, time);
|
|
2447
2379
|
};
|
|
2380
|
+
var d = $.derived(() => $.get(features).includes("dayNumber"));
|
|
2448
2381
|
$.if(node, ($$render) => {
|
|
2449
|
-
if ($.get(
|
|
2382
|
+
if ($.get(d)) $$render(consequent);
|
|
2450
2383
|
});
|
|
2451
2384
|
}
|
|
2452
2385
|
var node_1 = $.sibling(node, 2);
|
|
@@ -2468,18 +2401,18 @@ function Day$3($$anchor, $$props) {
|
|
|
2468
2401
|
var consequent_2 = ($$anchor3) => {
|
|
2469
2402
|
var a = root_4();
|
|
2470
2403
|
var event_handler = $.derived(() => stopPropagation(showMore));
|
|
2471
|
-
a.__click = function(...$$args) {
|
|
2472
|
-
$.get(event_handler)?.apply(this, $$args);
|
|
2473
|
-
};
|
|
2474
2404
|
var event_handler_1 = $.derived(() => keyEnter(showMore));
|
|
2475
|
-
a.__keydown = function(...$$args) {
|
|
2476
|
-
$.get(event_handler_1)?.apply(this, $$args);
|
|
2477
|
-
};
|
|
2478
2405
|
var event_handler_2 = $.derived(stopPropagation);
|
|
2479
|
-
a.__pointerdown = function(...$$args) {
|
|
2480
|
-
$.get(event_handler_2)?.apply(this, $$args);
|
|
2481
|
-
};
|
|
2482
2406
|
$.attach(a, () => contentFrom($.get(moreLink)));
|
|
2407
|
+
$.delegated("click", a, function(...$$args) {
|
|
2408
|
+
$.get(event_handler)?.apply(this, $$args);
|
|
2409
|
+
});
|
|
2410
|
+
$.delegated("keydown", a, function(...$$args) {
|
|
2411
|
+
$.get(event_handler_1)?.apply(this, $$args);
|
|
2412
|
+
});
|
|
2413
|
+
$.delegated("pointerdown", a, function(...$$args) {
|
|
2414
|
+
$.get(event_handler_2)?.apply(this, $$args);
|
|
2415
|
+
});
|
|
2483
2416
|
$.append($$anchor3, a);
|
|
2484
2417
|
};
|
|
2485
2418
|
$.if(node_2, ($$render) => {
|
|
@@ -2677,13 +2610,7 @@ function Popup($$anchor, $$props) {
|
|
|
2677
2610
|
var a_1 = $.sibling(time, 2);
|
|
2678
2611
|
$.autofocus(a_1, true);
|
|
2679
2612
|
var event_handler = $.derived(() => stopPropagation(close));
|
|
2680
|
-
a_1.__click = function(...$$args) {
|
|
2681
|
-
$.get(event_handler)?.apply(this, $$args);
|
|
2682
|
-
};
|
|
2683
2613
|
var event_handler_1 = $.derived(() => keyEnter(close));
|
|
2684
|
-
a_1.__keydown = function(...$$args) {
|
|
2685
|
-
$.get(event_handler_1)?.apply(this, $$args);
|
|
2686
|
-
};
|
|
2687
2614
|
$.reset(header);
|
|
2688
2615
|
var div = $.sibling(header, 2);
|
|
2689
2616
|
$.each(div, 21, () => $.get(popupChunks), $.index, ($$anchor2, chunk) => {
|
|
@@ -2711,6 +2638,12 @@ function Popup($$anchor, $$props) {
|
|
|
2711
2638
|
);
|
|
2712
2639
|
$.event("pointerdownoutside", dialog, handlePointerDownOutside);
|
|
2713
2640
|
$.event("close", dialog, close);
|
|
2641
|
+
$.delegated("click", a_1, function(...$$args) {
|
|
2642
|
+
$.get(event_handler)?.apply(this, $$args);
|
|
2643
|
+
});
|
|
2644
|
+
$.delegated("keydown", a_1, function(...$$args) {
|
|
2645
|
+
$.get(event_handler_1)?.apply(this, $$args);
|
|
2646
|
+
});
|
|
2714
2647
|
$.append($$anchor, dialog);
|
|
2715
2648
|
$.pop();
|
|
2716
2649
|
}
|
|
@@ -2860,8 +2793,9 @@ function View$3($$anchor, $$props) {
|
|
|
2860
2793
|
);
|
|
2861
2794
|
$.append($$anchor2, section);
|
|
2862
2795
|
};
|
|
2796
|
+
var d = $.derived(() => !empty($.get(grid2)) && !empty($.get(grid2)[0]));
|
|
2863
2797
|
$.if(node, ($$render) => {
|
|
2864
|
-
if (
|
|
2798
|
+
if ($.get(d)) $$render(consequent_1);
|
|
2865
2799
|
});
|
|
2866
2800
|
}
|
|
2867
2801
|
$.append($$anchor, fragment);
|
|
@@ -3594,10 +3528,10 @@ function Resizer($$anchor, $$props) {
|
|
|
3594
3528
|
var consequent = ($$anchor2) => {
|
|
3595
3529
|
var div = root_1$8();
|
|
3596
3530
|
var event_handler = $.derived(() => createResizeHandler(true));
|
|
3597
|
-
div.__pointerdown = function(...$$args) {
|
|
3598
|
-
$.get(event_handler)?.apply(this, $$args);
|
|
3599
|
-
};
|
|
3600
3531
|
$.template_effect(() => $.set_class(div, 1, `${$.get(theme).resizer ?? ""} ${$.get(theme).start ?? ""}`));
|
|
3532
|
+
$.delegated("pointerdown", div, function(...$$args) {
|
|
3533
|
+
$.get(event_handler)?.apply(this, $$args);
|
|
3534
|
+
});
|
|
3601
3535
|
$.append($$anchor2, div);
|
|
3602
3536
|
};
|
|
3603
3537
|
$.if(node, ($$render) => {
|
|
@@ -3611,10 +3545,10 @@ function Resizer($$anchor, $$props) {
|
|
|
3611
3545
|
var consequent_1 = ($$anchor2) => {
|
|
3612
3546
|
var div_1 = root_2$2();
|
|
3613
3547
|
var event_handler_1 = $.derived(() => createResizeHandler(false));
|
|
3614
|
-
div_1.__pointerdown = function(...$$args) {
|
|
3615
|
-
$.get(event_handler_1)?.apply(this, $$args);
|
|
3616
|
-
};
|
|
3617
3548
|
$.template_effect(() => $.set_class(div_1, 1, $.get(theme).resizer));
|
|
3549
|
+
$.delegated("pointerdown", div_1, function(...$$args) {
|
|
3550
|
+
$.get(event_handler_1)?.apply(this, $$args);
|
|
3551
|
+
});
|
|
3618
3552
|
$.append($$anchor2, div_1);
|
|
3619
3553
|
};
|
|
3620
3554
|
$.if(node_2, ($$render) => {
|
|
@@ -3860,9 +3794,9 @@ function View$2($$anchor, $$props) {
|
|
|
3860
3794
|
{
|
|
3861
3795
|
var consequent = ($$anchor2) => {
|
|
3862
3796
|
var div = root_1$6();
|
|
3863
|
-
div.__click = onclick;
|
|
3864
3797
|
$.attach(div, () => contentFrom($.get(content)));
|
|
3865
3798
|
$.template_effect(() => $.set_class(div, 1, $.get(theme).noEvents));
|
|
3799
|
+
$.delegated("click", div, onclick);
|
|
3866
3800
|
$.append($$anchor2, div);
|
|
3867
3801
|
};
|
|
3868
3802
|
var alternate = ($$anchor2) => {
|
|
@@ -4905,8 +4839,9 @@ function View$1($$anchor, $$props) {
|
|
|
4905
4839
|
$.bind_element_size(header_1, "offsetHeight", ($$value) => $.set(headerHeight, $$value));
|
|
4906
4840
|
$.append($$anchor2, section);
|
|
4907
4841
|
};
|
|
4842
|
+
var d = $.derived(() => !empty($.get(grid2)) && !empty($.get(grid2)[0]));
|
|
4908
4843
|
$.if(node, ($$render) => {
|
|
4909
|
-
if (
|
|
4844
|
+
if ($.get(d)) $$render(consequent_4);
|
|
4910
4845
|
});
|
|
4911
4846
|
}
|
|
4912
4847
|
$.append($$anchor, fragment);
|
|
@@ -5072,8 +5007,9 @@ function View_1($$anchor, $$props) {
|
|
|
5072
5007
|
});
|
|
5073
5008
|
$.append($$anchor3, fragment_6);
|
|
5074
5009
|
};
|
|
5010
|
+
var d = $.derived(() => length($.get(grid2)[0]) > 1);
|
|
5075
5011
|
$.if(node_2, ($$render) => {
|
|
5076
|
-
if (
|
|
5012
|
+
if ($.get(d)) $$render(consequent_2);
|
|
5077
5013
|
});
|
|
5078
5014
|
}
|
|
5079
5015
|
$.append($$anchor2, fragment_1);
|
|
@@ -5112,6 +5048,7 @@ function View_1($$anchor, $$props) {
|
|
|
5112
5048
|
});
|
|
5113
5049
|
$.append($$anchor4, fragment_15);
|
|
5114
5050
|
};
|
|
5051
|
+
var d_1 = $.derived(() => length($.get(grid2)[0]) > 1);
|
|
5115
5052
|
var alternate_2 = ($$anchor4) => {
|
|
5116
5053
|
{
|
|
5117
5054
|
let $0 = $.derived(() => $.get(grid2).flat());
|
|
@@ -5127,7 +5064,7 @@ function View_1($$anchor, $$props) {
|
|
|
5127
5064
|
}
|
|
5128
5065
|
};
|
|
5129
5066
|
$.if(node_7, ($$render) => {
|
|
5130
|
-
if (
|
|
5067
|
+
if ($.get(d_1)) $$render(consequent_4);
|
|
5131
5068
|
else $$render(alternate_2, false);
|
|
5132
5069
|
});
|
|
5133
5070
|
}
|
|
@@ -5575,29 +5512,36 @@ function Event($$anchor, $$props) {
|
|
|
5575
5512
|
return $.pop($$exports);
|
|
5576
5513
|
}
|
|
5577
5514
|
var root_1$2 = $.from_html(`<span></span>`);
|
|
5578
|
-
var root_2 = $.from_html(`<button
|
|
5515
|
+
var root_2 = $.from_html(`<button></button>`);
|
|
5579
5516
|
var root = $.from_html(`<!> <span><!></span>`, 1);
|
|
5580
5517
|
function Expander($$anchor, $$props) {
|
|
5581
5518
|
$.push($$props, true);
|
|
5582
|
-
let
|
|
5519
|
+
let resource = $.prop($$props, "resource", 7);
|
|
5520
|
+
let $$d = $.derived(() => getContext("state")), resources = $.derived(() => $.get($$d).resources), view2 = $.derived(() => $.get($$d).view), buttonText = $.derived(() => $.get($$d).options.buttonText), icons = $.derived(() => $.get($$d).options.icons), resourceExpand = $.derived(() => $.get($$d).options.resourceExpand), theme = $.derived(() => $.get($$d).options.theme);
|
|
5583
5521
|
let payload = $.state({});
|
|
5584
|
-
let expanded = $.
|
|
5522
|
+
let expanded = $.derived(() => resource().expanded);
|
|
5523
|
+
let title = $.derived(() => $.get(buttonText)[$.get(expanded) ? "collapse" : "expand"]);
|
|
5585
5524
|
$.user_pre_effect(() => {
|
|
5586
|
-
$.set(payload, getPayload(
|
|
5587
|
-
$.set(expanded, $.get(payload).expanded, true);
|
|
5525
|
+
$.set(payload, getPayload(resource()));
|
|
5588
5526
|
});
|
|
5589
|
-
function onclick() {
|
|
5590
|
-
$.set(expanded, !$.get(expanded));
|
|
5591
|
-
$.get(payload).
|
|
5592
|
-
toggle($.get(payload).children, $.get(expanded));
|
|
5527
|
+
function onclick(jsEvent) {
|
|
5528
|
+
resource().expanded = $.set(expanded, !$.get(expanded));
|
|
5529
|
+
toggle($.get(payload).children);
|
|
5593
5530
|
$.get(resources).length = $.get(resources).length;
|
|
5531
|
+
if (isFunction($.get(resourceExpand))) {
|
|
5532
|
+
$.get(resourceExpand)({
|
|
5533
|
+
resource: resource(),
|
|
5534
|
+
jsEvent,
|
|
5535
|
+
view: toViewWithLocalDates($.get(view2))
|
|
5536
|
+
});
|
|
5537
|
+
}
|
|
5594
5538
|
}
|
|
5595
|
-
function toggle(children
|
|
5539
|
+
function toggle(children) {
|
|
5596
5540
|
for (let child of children) {
|
|
5597
5541
|
let payload2 = getPayload(child);
|
|
5598
|
-
payload2.hidden =
|
|
5599
|
-
if (
|
|
5600
|
-
toggle(payload2.children
|
|
5542
|
+
payload2.hidden = !$.get(expanded);
|
|
5543
|
+
if (child.expanded) {
|
|
5544
|
+
toggle(payload2.children);
|
|
5601
5545
|
}
|
|
5602
5546
|
}
|
|
5603
5547
|
}
|
|
@@ -5611,30 +5555,19 @@ function Expander($$anchor, $$props) {
|
|
|
5611
5555
|
var span_1 = $.sibling(node, 2);
|
|
5612
5556
|
var node_1 = $.child(span_1);
|
|
5613
5557
|
{
|
|
5614
|
-
var
|
|
5558
|
+
var consequent = ($$anchor2) => {
|
|
5615
5559
|
var button = root_2();
|
|
5616
|
-
button
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
var alternate = ($$anchor3) => {
|
|
5624
|
-
var text_1 = $.text("+");
|
|
5625
|
-
$.append($$anchor3, text_1);
|
|
5626
|
-
};
|
|
5627
|
-
$.if(node_2, ($$render) => {
|
|
5628
|
-
if ($.get(expanded)) $$render(consequent);
|
|
5629
|
-
else $$render(alternate, false);
|
|
5630
|
-
});
|
|
5631
|
-
}
|
|
5632
|
-
$.reset(button);
|
|
5633
|
-
$.template_effect(() => $.set_class(button, 1, $.get(theme).button));
|
|
5560
|
+
$.attach(button, () => contentFrom($.get(icons)[$.get(expanded) ? "collapse" : "expand"]));
|
|
5561
|
+
$.template_effect(() => {
|
|
5562
|
+
$.set_class(button, 1, $.get(theme).button);
|
|
5563
|
+
$.set_attribute(button, "aria-label", $.get(title));
|
|
5564
|
+
$.set_attribute(button, "title", $.get(title));
|
|
5565
|
+
});
|
|
5566
|
+
$.delegated("click", button, onclick);
|
|
5634
5567
|
$.append($$anchor2, button);
|
|
5635
5568
|
};
|
|
5636
5569
|
$.if(node_1, ($$render) => {
|
|
5637
|
-
if ($.get(payload).children?.length) $$render(
|
|
5570
|
+
if ($.get(payload).children?.length) $$render(consequent);
|
|
5638
5571
|
});
|
|
5639
5572
|
}
|
|
5640
5573
|
$.reset(span_1);
|
|
@@ -5955,8 +5888,9 @@ function View($$anchor, $$props) {
|
|
|
5955
5888
|
$.bind_element_size(header, "offsetHeight", ($$value) => $.set(headerHeight, $$value));
|
|
5956
5889
|
$.append($$anchor2, section);
|
|
5957
5890
|
};
|
|
5891
|
+
var d = $.derived(() => !empty($.get(grid2)) && !empty($.get(grid2)[0]));
|
|
5958
5892
|
$.if(node, ($$render) => {
|
|
5959
|
-
if (
|
|
5893
|
+
if ($.get(d)) $$render(consequent_3);
|
|
5960
5894
|
});
|
|
5961
5895
|
}
|
|
5962
5896
|
$.append($$anchor, fragment);
|
|
@@ -5966,43 +5900,59 @@ const index$1 = {
|
|
|
5966
5900
|
createOptions(options) {
|
|
5967
5901
|
createTRROptions(options);
|
|
5968
5902
|
createRROptions(options);
|
|
5969
|
-
options
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
options.
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
};
|
|
5986
|
-
options.
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
day: "numeric"
|
|
5903
|
+
assign(options, {
|
|
5904
|
+
resourceExpand: void 0,
|
|
5905
|
+
slotWidth: 32,
|
|
5906
|
+
// Common options
|
|
5907
|
+
view: "resourceTimelineWeek"
|
|
5908
|
+
});
|
|
5909
|
+
assign(options.buttonText, {
|
|
5910
|
+
expand: "Expand",
|
|
5911
|
+
collapse: "Collapse",
|
|
5912
|
+
resourceTimelineDay: "timeline",
|
|
5913
|
+
resourceTimelineWeek: "timeline",
|
|
5914
|
+
resourceTimelineMonth: "timeline"
|
|
5915
|
+
});
|
|
5916
|
+
assign(options.icons, {
|
|
5917
|
+
collapse: { html: "−" },
|
|
5918
|
+
expand: { html: "+" }
|
|
5919
|
+
});
|
|
5920
|
+
assign(options.theme, {
|
|
5921
|
+
expander: "ec-expander",
|
|
5922
|
+
rowHead: "ec-row-head",
|
|
5923
|
+
slots: "ec-slots"
|
|
5924
|
+
});
|
|
5925
|
+
assign(options.views, {
|
|
5926
|
+
resourceTimelineDay: {
|
|
5927
|
+
buttonText: btnTextDay,
|
|
5928
|
+
component: initViewComponent$1,
|
|
5929
|
+
displayEventEnd: false,
|
|
5930
|
+
dayHeaderFormat: { weekday: "long" },
|
|
5931
|
+
duration: { days: 1 },
|
|
5932
|
+
theme: themeView("ec-resource ec-timeline ec-day-view"),
|
|
5933
|
+
titleFormat: { year: "numeric", month: "long", day: "numeric" }
|
|
6000
5934
|
},
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
5935
|
+
resourceTimelineWeek: {
|
|
5936
|
+
buttonText: btnTextWeek,
|
|
5937
|
+
component: initViewComponent$1,
|
|
5938
|
+
displayEventEnd: false,
|
|
5939
|
+
duration: { weeks: 1 },
|
|
5940
|
+
theme: themeView("ec-resource ec-timeline ec-week-view")
|
|
5941
|
+
},
|
|
5942
|
+
resourceTimelineMonth: {
|
|
5943
|
+
buttonText: btnTextMonth,
|
|
5944
|
+
component: initMonthViewComponent,
|
|
5945
|
+
displayEventEnd: false,
|
|
5946
|
+
dayHeaderFormat: {
|
|
5947
|
+
weekday: "short",
|
|
5948
|
+
day: "numeric"
|
|
5949
|
+
},
|
|
5950
|
+
duration: { months: 1 },
|
|
5951
|
+
slotDuration: { days: 1 },
|
|
5952
|
+
theme: themeView("ec-resource ec-timeline ec-month-view"),
|
|
5953
|
+
titleFormat: { year: "numeric", month: "long" }
|
|
5954
|
+
}
|
|
5955
|
+
});
|
|
6006
5956
|
},
|
|
6007
5957
|
createParsers(parsers) {
|
|
6008
5958
|
createTRRParsers(parsers);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event-calendar/core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.1",
|
|
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.53.2"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/src/lib/resources.js
CHANGED
|
@@ -3,11 +3,11 @@ import {empty} from './utils.js';
|
|
|
3
3
|
|
|
4
4
|
export function createResources(input) {
|
|
5
5
|
let result = [];
|
|
6
|
-
_createResources(input, 0, result);
|
|
6
|
+
_createResources(input, 0, false, result);
|
|
7
7
|
return result;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
function _createResources(input, level, flat) {
|
|
10
|
+
function _createResources(input, level, hidden, flat) {
|
|
11
11
|
let result = [];
|
|
12
12
|
for (let item of input) {
|
|
13
13
|
let resource = createResource(item);
|
|
@@ -16,12 +16,11 @@ function _createResources(input, level, flat) {
|
|
|
16
16
|
let payload = {
|
|
17
17
|
level,
|
|
18
18
|
children: [],
|
|
19
|
-
|
|
20
|
-
hidden: false
|
|
19
|
+
hidden
|
|
21
20
|
};
|
|
22
21
|
setPayload(resource, payload);
|
|
23
22
|
if (item.children) {
|
|
24
|
-
payload.children = _createResources(item.children, level + 1, flat);
|
|
23
|
+
payload.children = _createResources(item.children, level + 1, hidden || !resource.expanded, flat);
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
return result;
|
|
@@ -33,6 +32,7 @@ export function createResource(input) {
|
|
|
33
32
|
title: input.title || '',
|
|
34
33
|
eventBackgroundColor: eventBackgroundColor(input),
|
|
35
34
|
eventTextColor: eventTextColor(input),
|
|
35
|
+
expanded: input.expanded ?? true,
|
|
36
36
|
extendedProps: input.extendedProps ?? {}
|
|
37
37
|
};
|
|
38
38
|
}
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import {getContext} from 'svelte';
|
|
3
|
-
import {getPayload} from '#lib';
|
|
3
|
+
import {contentFrom, getPayload, isFunction, toViewWithLocalDates} from '#lib';
|
|
4
4
|
|
|
5
5
|
let {resource} = $props();
|
|
6
6
|
|
|
7
|
-
let {resources, options: {theme}} = $derived(getContext('state'));
|
|
7
|
+
let {resources, view, options: {buttonText, icons, resourceExpand, theme}} = $derived(getContext('state'));
|
|
8
8
|
|
|
9
9
|
let payload = $state.raw({});
|
|
10
|
-
let expanded = $
|
|
10
|
+
let expanded = $derived(resource.expanded);
|
|
11
|
+
let title = $derived(buttonText[expanded ? 'collapse' : 'expand']);
|
|
11
12
|
|
|
12
13
|
$effect.pre(() => {
|
|
13
14
|
payload = getPayload(resource);
|
|
14
|
-
expanded = payload.expanded;
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
function onclick() {
|
|
18
|
-
expanded = !expanded;
|
|
19
|
-
payload.
|
|
20
|
-
toggle(payload.children, expanded);
|
|
17
|
+
function onclick(jsEvent) {
|
|
18
|
+
resource.expanded = expanded = !expanded;
|
|
19
|
+
toggle(payload.children);
|
|
21
20
|
resources.length = resources.length;
|
|
21
|
+
if (isFunction(resourceExpand)) {
|
|
22
|
+
resourceExpand({resource, jsEvent, view: toViewWithLocalDates(view)});
|
|
23
|
+
}
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
function toggle(children
|
|
26
|
+
function toggle(children) {
|
|
25
27
|
for (let child of children) {
|
|
26
28
|
let payload = getPayload(child);
|
|
27
|
-
payload.hidden = !
|
|
28
|
-
if (
|
|
29
|
-
toggle(payload.children
|
|
29
|
+
payload.hidden = !expanded;
|
|
30
|
+
if (child.expanded) {
|
|
31
|
+
toggle(payload.children);
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
}
|
|
@@ -38,8 +40,13 @@
|
|
|
38
40
|
|
|
39
41
|
<span class="{theme.expander}">
|
|
40
42
|
{#if payload.children?.length}
|
|
41
|
-
<button
|
|
42
|
-
{
|
|
43
|
+
<button
|
|
44
|
+
class="{theme.button}"
|
|
45
|
+
aria-label="{title}"
|
|
46
|
+
{title}
|
|
47
|
+
{onclick}
|
|
48
|
+
{@attach contentFrom(icons[expanded ? 'collapse' : 'expand'])}
|
|
49
|
+
>
|
|
43
50
|
</button>
|
|
44
51
|
{/if}
|
|
45
52
|
</span>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {btnTextDay, btnTextMonth, btnTextWeek, getPayload, themeView} from '#lib';
|
|
1
|
+
import {assign, btnTextDay, btnTextMonth, btnTextWeek, getPayload, themeView} from '#lib';
|
|
2
2
|
import {setExtensions} from '../time-grid/lib.js';
|
|
3
3
|
import {createTRROptions, createTRRParsers} from '../time-grid/options.js';
|
|
4
4
|
import {createRROptions} from '../resource-time-grid/options.js';
|
|
@@ -8,44 +8,59 @@ export default {
|
|
|
8
8
|
createOptions(options) {
|
|
9
9
|
createTRROptions(options);
|
|
10
10
|
createRROptions(options);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
day: 'numeric'
|
|
11
|
+
assign(options, {
|
|
12
|
+
resourceExpand: undefined,
|
|
13
|
+
slotWidth: 32,
|
|
14
|
+
// Common options
|
|
15
|
+
view: 'resourceTimelineWeek'
|
|
16
|
+
});
|
|
17
|
+
assign(options.buttonText, {
|
|
18
|
+
expand: 'Expand',
|
|
19
|
+
collapse: 'Collapse',
|
|
20
|
+
resourceTimelineDay: 'timeline',
|
|
21
|
+
resourceTimelineWeek: 'timeline',
|
|
22
|
+
resourceTimelineMonth: 'timeline'
|
|
23
|
+
});
|
|
24
|
+
assign(options.icons, {
|
|
25
|
+
collapse: {html: '−'},
|
|
26
|
+
expand: {html: '+'}
|
|
27
|
+
});
|
|
28
|
+
assign(options.theme, {
|
|
29
|
+
expander: 'ec-expander',
|
|
30
|
+
rowHead: 'ec-row-head',
|
|
31
|
+
slots: 'ec-slots'
|
|
32
|
+
});
|
|
33
|
+
assign(options.views, {
|
|
34
|
+
resourceTimelineDay: {
|
|
35
|
+
buttonText: btnTextDay,
|
|
36
|
+
component: initViewComponent,
|
|
37
|
+
displayEventEnd: false,
|
|
38
|
+
dayHeaderFormat: {weekday: 'long'},
|
|
39
|
+
duration: {days: 1},
|
|
40
|
+
theme: themeView('ec-resource ec-timeline ec-day-view'),
|
|
41
|
+
titleFormat: {year: 'numeric', month: 'long', day: 'numeric'}
|
|
43
42
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
resourceTimelineWeek: {
|
|
44
|
+
buttonText: btnTextWeek,
|
|
45
|
+
component: initViewComponent,
|
|
46
|
+
displayEventEnd: false,
|
|
47
|
+
duration: {weeks: 1},
|
|
48
|
+
theme: themeView('ec-resource ec-timeline ec-week-view')
|
|
49
|
+
},
|
|
50
|
+
resourceTimelineMonth: {
|
|
51
|
+
buttonText: btnTextMonth,
|
|
52
|
+
component: initMonthViewComponent,
|
|
53
|
+
displayEventEnd: false,
|
|
54
|
+
dayHeaderFormat: {
|
|
55
|
+
weekday: 'short',
|
|
56
|
+
day: 'numeric'
|
|
57
|
+
},
|
|
58
|
+
duration: {months: 1},
|
|
59
|
+
slotDuration: {days: 1},
|
|
60
|
+
theme: themeView('ec-resource ec-timeline ec-month-view'),
|
|
61
|
+
titleFormat: {year: 'numeric', month: 'long'}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
49
64
|
},
|
|
50
65
|
|
|
51
66
|
createParsers(parsers) {
|
package/src/storage/options.js
CHANGED
|
@@ -52,6 +52,7 @@ function createOptions(plugins) {
|
|
|
52
52
|
height: undefined,
|
|
53
53
|
hiddenDays: [],
|
|
54
54
|
highlightedDates: [], // ec option
|
|
55
|
+
icons: {}, // ec option
|
|
55
56
|
lazyFetching: true,
|
|
56
57
|
loading: undefined,
|
|
57
58
|
locale: undefined,
|
|
@@ -130,7 +131,7 @@ function createParsers(plugins) {
|
|
|
130
131
|
}
|
|
131
132
|
|
|
132
133
|
// Options where default value is passed to the function
|
|
133
|
-
const specialOptions = ['buttonText', 'customButtons', 'theme'];
|
|
134
|
+
const specialOptions = ['buttonText', 'customButtons', 'icons', 'theme'];
|
|
134
135
|
|
|
135
136
|
export function optionsState(plugins, userOptions) {
|
|
136
137
|
// Create default options and parsers
|