@event-calendar/core 1.4.1 → 1.5.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 +58 -9
- package/index.js +222 -131
- package/package.json +2 -2
- package/src/Buttons.svelte +6 -7
- package/src/Calendar.svelte +1 -1
- package/src/lib/a11y.js +30 -0
- package/src/lib/events.js +18 -1
- package/src/lib.js +1 -0
- package/src/storage/options.js +3 -6
- package/src/storage/state.js +4 -6
- package/src/storage/stores.js +1 -1
package/README.md
CHANGED
|
@@ -35,6 +35,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options
|
|
|
35
35
|
- [editable](#editable)
|
|
36
36
|
- [events](#events)
|
|
37
37
|
- [eventBackgroundColor](#eventbackgroundcolor)
|
|
38
|
+
- [eventClassNames](#eventclassnames)
|
|
38
39
|
- [eventClick](#eventclick)
|
|
39
40
|
- [eventColor](#eventcolor)
|
|
40
41
|
- [eventContent](#eventcontent)
|
|
@@ -193,8 +194,8 @@ import '@event-calendar/core/index.css';
|
|
|
193
194
|
### Pre-built browser ready bundle
|
|
194
195
|
Include the following lines of code in the `<head>` section of your page:
|
|
195
196
|
```html
|
|
196
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.
|
|
197
|
-
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.
|
|
197
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.5.1/event-calendar.min.css">
|
|
198
|
+
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.5.1/event-calendar.min.js"></script>
|
|
198
199
|
```
|
|
199
200
|
|
|
200
201
|
<details>
|
|
@@ -283,24 +284,35 @@ When hidden with `false`, all-day events will not be displayed in `timeGrid`/`re
|
|
|
283
284
|
|
|
284
285
|
### buttonText
|
|
285
286
|
- Type `object` or `function`
|
|
286
|
-
- Default `{
|
|
287
|
+
- Default `{close: 'Close', dayGridMonth: 'month', listDay: 'list', listMonth: 'list', listWeek: 'list', listYear: 'list', resourceTimeGridDay: 'day', resourceTimeGridWeek: 'week', timeGridDay: 'day', timeGridWeek: 'week', today: 'today'}`
|
|
288
|
+
> Views override the default value as follows:
|
|
289
|
+
> - dayGridMonth `function (text) { return {...text, next: 'Next month', prev: 'Previous month'}; }`
|
|
290
|
+
> - listDay `function (text) { return {...text, next: 'Next day', prev: 'Previous day'}; }`
|
|
291
|
+
> - listMonth `function (text) { return {...text, next: 'Next month', prev: 'Previous month'}; }`
|
|
292
|
+
> - listWeek `function (text) { return {...text, next: 'Next week', prev: 'Previous week'}; }`
|
|
293
|
+
> - listYear `function (text) { return {...text, next: 'Next year', prev: 'Previous year'}; }`
|
|
294
|
+
> - resourceTimeGridDay `function (text) { return {...text, next: 'Next day', prev: 'Previous day'}; }`
|
|
295
|
+
> - resourceTimeGridWeek `function (text) { return {...text, next: 'Next week', prev: 'Previous week'}; }`
|
|
296
|
+
> - timeGridDay `function (text) { return {...text, next: 'Next day', prev: 'Previous day'}; }`
|
|
297
|
+
> - timeGridWeek `function (text) { return {...text, next: 'Next week', prev: 'Previous week'}; }`
|
|
298
|
+
|
|
287
299
|
|
|
288
300
|
Text that is displayed in buttons of the header toolbar.
|
|
289
301
|
|
|
290
|
-
This value can be either a plain object with all necessary properties, or a callback function that receives default button
|
|
302
|
+
This value can be either a plain object with all necessary properties, or a callback function that receives default button text object and should return a new one:
|
|
291
303
|
|
|
292
304
|
```js
|
|
293
|
-
function (
|
|
294
|
-
// return new button
|
|
305
|
+
function (text) {
|
|
306
|
+
// return new button text object
|
|
295
307
|
}
|
|
296
308
|
```
|
|
297
309
|
<table>
|
|
298
310
|
<tr>
|
|
299
311
|
<td>
|
|
300
312
|
|
|
301
|
-
`
|
|
313
|
+
`text`
|
|
302
314
|
</td>
|
|
303
|
-
<td>An object with default button
|
|
315
|
+
<td>An object with default button text</td>
|
|
304
316
|
</tr>
|
|
305
317
|
</table>
|
|
306
318
|
|
|
@@ -542,6 +554,43 @@ Sets the default background color for events on the calendar.
|
|
|
542
554
|
|
|
543
555
|
You can use any of the CSS color formats such `'#f00'`, `'#ff0000'`, `'rgb(255,0,0)'`, or `'red'`.
|
|
544
556
|
|
|
557
|
+
### eventClassNames
|
|
558
|
+
- Type `string`, `array` or `function`
|
|
559
|
+
- Default `undefined`
|
|
560
|
+
|
|
561
|
+
Sets additional CSS classes for events.
|
|
562
|
+
|
|
563
|
+
This value can be either a string containing class names `'class-1 class-2 ...'`, an array of strings `['class-1', 'class-2', ...]` or a function that returns any of the above formats:
|
|
564
|
+
|
|
565
|
+
```js
|
|
566
|
+
function (info) {
|
|
567
|
+
// return string or array
|
|
568
|
+
}
|
|
569
|
+
```
|
|
570
|
+
`info` is an object with the following properties:
|
|
571
|
+
<table>
|
|
572
|
+
<tr>
|
|
573
|
+
<td>
|
|
574
|
+
|
|
575
|
+
`event`
|
|
576
|
+
</td>
|
|
577
|
+
<td>
|
|
578
|
+
|
|
579
|
+
The associated [Event](#event-object) object
|
|
580
|
+
</td>
|
|
581
|
+
</tr>
|
|
582
|
+
<tr>
|
|
583
|
+
<td>
|
|
584
|
+
|
|
585
|
+
`view`
|
|
586
|
+
</td>
|
|
587
|
+
<td>
|
|
588
|
+
|
|
589
|
+
The current [View](#view-object) object
|
|
590
|
+
</td>
|
|
591
|
+
</tr>
|
|
592
|
+
</table>
|
|
593
|
+
|
|
545
594
|
### eventClick
|
|
546
595
|
- Type `function`
|
|
547
596
|
- Default `undefined`
|
|
@@ -596,7 +645,7 @@ The current [View](#view-object) object
|
|
|
596
645
|
This is currently an alias for the `eventBackgroundColor`.
|
|
597
646
|
|
|
598
647
|
### eventContent
|
|
599
|
-
- Type `string`, `object`or `function`
|
|
648
|
+
- Type `string`, `object` or `function`
|
|
600
649
|
- Default `undefined`
|
|
601
650
|
|
|
602
651
|
Defines the content that is rendered inside an event’s element.
|
package/index.js
CHANGED
|
@@ -1,7 +1,37 @@
|
|
|
1
|
-
import { run_all, is_function, noop, identity, tick, SvelteComponent, init, safe_not_equal, empty, insert,
|
|
1
|
+
import { run_all, is_function, noop, identity, tick, SvelteComponent, init, safe_not_equal, ensure_array_like, empty, insert, detach, destroy_each, component_subscribe, set_store_value, element, text, attr, append, listen, set_data, transition_in, group_outros, check_outros, transition_out, space, create_component, mount_component, destroy_component, construct_svelte_component, set_style, get_current_component } from 'svelte/internal';
|
|
2
2
|
import { getContext, setContext, beforeUpdate } from 'svelte';
|
|
3
3
|
import { writable, derived, get, readable } from 'svelte/store';
|
|
4
4
|
|
|
5
|
+
function keyEnter(fn) {
|
|
6
|
+
return function (e) {
|
|
7
|
+
return e.key === 'Enter' || e.key === ' ' ? fn.call(this, e) : undefined;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function btnTextDay(text) {
|
|
12
|
+
return btnText(text, 'day');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function btnTextWeek(text) {
|
|
16
|
+
return btnText(text, 'week');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function btnTextMonth(text) {
|
|
20
|
+
return btnText(text, 'month');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function btnTextYear(text) {
|
|
24
|
+
return btnText(text, 'year');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function btnText(text, period) {
|
|
28
|
+
return {
|
|
29
|
+
...text,
|
|
30
|
+
next: 'Next ' + period,
|
|
31
|
+
prev: 'Previous ' + period
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
5
35
|
function assign(...args) {
|
|
6
36
|
return Object.assign(...args);
|
|
7
37
|
}
|
|
@@ -540,6 +570,19 @@ function createEventContent(chunk, displayEventEnd, eventContent, theme, _intlEv
|
|
|
540
570
|
return [timeText, content];
|
|
541
571
|
}
|
|
542
572
|
|
|
573
|
+
function createEventClasses(eventClassNames, event, _view) {
|
|
574
|
+
if (eventClassNames) {
|
|
575
|
+
if (is_function(eventClassNames)) {
|
|
576
|
+
eventClassNames = eventClassNames({
|
|
577
|
+
event: toEventWithLocalDates(event),
|
|
578
|
+
view: toViewWithLocalDates(_view)
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
return Array.isArray(eventClassNames) ? eventClassNames : [eventClassNames];
|
|
582
|
+
}
|
|
583
|
+
return [];
|
|
584
|
+
}
|
|
585
|
+
|
|
543
586
|
function toEventWithLocalDates(event) {
|
|
544
587
|
return _cloneEvent(event, toLocalDate);
|
|
545
588
|
}
|
|
@@ -574,7 +617,7 @@ function eventIntersects(event, start, end, resource, timeMode) {
|
|
|
574
617
|
}
|
|
575
618
|
|
|
576
619
|
function helperEvent(display) {
|
|
577
|
-
return display
|
|
620
|
+
return previewEvent(display) || ghostEvent(display) || pointerEvent(display);
|
|
578
621
|
}
|
|
579
622
|
|
|
580
623
|
function bgEvent(display) {
|
|
@@ -589,6 +632,10 @@ function ghostEvent(display) {
|
|
|
589
632
|
return display === 'ghost';
|
|
590
633
|
}
|
|
591
634
|
|
|
635
|
+
function pointerEvent(display) {
|
|
636
|
+
return display === 'pointer';
|
|
637
|
+
}
|
|
638
|
+
|
|
592
639
|
function writable2(value, parser, start) {
|
|
593
640
|
return {
|
|
594
641
|
...writable(parser ? parser(value) : value, start),
|
|
@@ -659,6 +706,7 @@ function createOptions(plugins) {
|
|
|
659
706
|
events: [],
|
|
660
707
|
eventBackgroundColor: undefined,
|
|
661
708
|
eventTextColor: undefined,
|
|
709
|
+
eventClassNames: undefined,
|
|
662
710
|
eventClick: undefined,
|
|
663
711
|
eventColor: undefined,
|
|
664
712
|
eventContent: undefined,
|
|
@@ -744,9 +792,7 @@ function createOptions(plugins) {
|
|
|
744
792
|
};
|
|
745
793
|
|
|
746
794
|
for (let plugin of plugins) {
|
|
747
|
-
|
|
748
|
-
plugin.createOptions(options);
|
|
749
|
-
}
|
|
795
|
+
plugin.createOptions?.(options);
|
|
750
796
|
}
|
|
751
797
|
|
|
752
798
|
return options;
|
|
@@ -769,9 +815,7 @@ function createParsers(options, plugins) {
|
|
|
769
815
|
};
|
|
770
816
|
|
|
771
817
|
for (let plugin of plugins) {
|
|
772
|
-
|
|
773
|
-
plugin.createParsers(parsers, options);
|
|
774
|
-
}
|
|
818
|
+
plugin.createParsers?.(parsers, options);
|
|
775
819
|
}
|
|
776
820
|
|
|
777
821
|
return parsers;
|
|
@@ -793,7 +837,7 @@ function diff(options) {
|
|
|
793
837
|
}
|
|
794
838
|
|
|
795
839
|
function monthMode(state) {
|
|
796
|
-
return derived(state.view, $view => $view
|
|
840
|
+
return derived(state.view, $view => $view?.startsWith('dayGrid'));
|
|
797
841
|
}
|
|
798
842
|
|
|
799
843
|
function activeRange(state) {
|
|
@@ -1021,14 +1065,12 @@ class State {
|
|
|
1021
1065
|
// Interaction
|
|
1022
1066
|
this._interaction = writable({});
|
|
1023
1067
|
this._iEvents = writable([null, null]); // interaction events: [drag/resize, pointer]
|
|
1024
|
-
this.
|
|
1025
|
-
this._iClass = writable(undefined);
|
|
1068
|
+
this._iClasses = writable(identity); // interaction event css classes
|
|
1069
|
+
this._iClass = writable(undefined); // interaction css class for entire calendar
|
|
1026
1070
|
|
|
1027
1071
|
// Let plugins create their private stores
|
|
1028
1072
|
for (let plugin of plugins) {
|
|
1029
|
-
|
|
1030
|
-
plugin.createStores(this);
|
|
1031
|
-
}
|
|
1073
|
+
plugin.createStores?.(this);
|
|
1032
1074
|
}
|
|
1033
1075
|
|
|
1034
1076
|
if (input.view) {
|
|
@@ -1041,7 +1083,7 @@ class State {
|
|
|
1041
1083
|
parseOpts(commonOpts, this);
|
|
1042
1084
|
let views = new Set([...Object.keys(options.views), ...Object.keys(input.views || {})]);
|
|
1043
1085
|
for (let view of views) {
|
|
1044
|
-
let viewOpts = assign({}, options.views[view]
|
|
1086
|
+
let viewOpts = assign({}, options.views[view] ?? {}, input.views?.[view] ?? {});
|
|
1045
1087
|
parseOpts(viewOpts, this);
|
|
1046
1088
|
let opts = assign({}, commonOpts, viewOpts);
|
|
1047
1089
|
// Change view component when view changes
|
|
@@ -1092,7 +1134,7 @@ function parseOpts(opts, state) {
|
|
|
1092
1134
|
}
|
|
1093
1135
|
}
|
|
1094
1136
|
|
|
1095
|
-
/* packages/core/src/Buttons.svelte generated by Svelte
|
|
1137
|
+
/* packages/core/src/Buttons.svelte generated by Svelte v4.1.1 */
|
|
1096
1138
|
|
|
1097
1139
|
function get_each_context$2(ctx, list, i) {
|
|
1098
1140
|
const child_ctx = ctx.slice();
|
|
@@ -1100,12 +1142,12 @@ function get_each_context$2(ctx, list, i) {
|
|
|
1100
1142
|
return child_ctx;
|
|
1101
1143
|
}
|
|
1102
1144
|
|
|
1103
|
-
// (
|
|
1104
|
-
function
|
|
1105
|
-
let
|
|
1145
|
+
// (37:27)
|
|
1146
|
+
function create_if_block_4(ctx) {
|
|
1147
|
+
let button_1;
|
|
1106
1148
|
let t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[23]] + "";
|
|
1107
1149
|
let t;
|
|
1108
|
-
let
|
|
1150
|
+
let button_1_class_value;
|
|
1109
1151
|
let mounted;
|
|
1110
1152
|
let dispose;
|
|
1111
1153
|
|
|
@@ -1115,19 +1157,19 @@ function create_else_block$1(ctx) {
|
|
|
1115
1157
|
|
|
1116
1158
|
return {
|
|
1117
1159
|
c() {
|
|
1118
|
-
|
|
1160
|
+
button_1 = element("button");
|
|
1119
1161
|
t = text(t_value);
|
|
1120
1162
|
|
|
1121
|
-
attr(
|
|
1163
|
+
attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + (/*$view*/ ctx[6] === /*button*/ ctx[23]
|
|
1122
1164
|
? ' ' + /*$theme*/ ctx[3].active
|
|
1123
1165
|
: '') + " ec-" + /*button*/ ctx[23]));
|
|
1124
1166
|
},
|
|
1125
1167
|
m(target, anchor) {
|
|
1126
|
-
insert(target,
|
|
1127
|
-
append(
|
|
1168
|
+
insert(target, button_1, anchor);
|
|
1169
|
+
append(button_1, t);
|
|
1128
1170
|
|
|
1129
1171
|
if (!mounted) {
|
|
1130
|
-
dispose = listen(
|
|
1172
|
+
dispose = listen(button_1, "click", click_handler_1);
|
|
1131
1173
|
mounted = true;
|
|
1132
1174
|
}
|
|
1133
1175
|
},
|
|
@@ -1135,86 +1177,94 @@ function create_else_block$1(ctx) {
|
|
|
1135
1177
|
ctx = new_ctx;
|
|
1136
1178
|
if (dirty & /*$buttonText, buttons*/ 33 && t_value !== (t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[23]] + "")) set_data(t, t_value);
|
|
1137
1179
|
|
|
1138
|
-
if (dirty & /*$theme, $view, buttons*/ 73 &&
|
|
1180
|
+
if (dirty & /*$theme, $view, buttons*/ 73 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + (/*$view*/ ctx[6] === /*button*/ ctx[23]
|
|
1139
1181
|
? ' ' + /*$theme*/ ctx[3].active
|
|
1140
1182
|
: '') + " ec-" + /*button*/ ctx[23]))) {
|
|
1141
|
-
attr(
|
|
1183
|
+
attr(button_1, "class", button_1_class_value);
|
|
1142
1184
|
}
|
|
1143
1185
|
},
|
|
1144
1186
|
d(detaching) {
|
|
1145
|
-
if (detaching)
|
|
1187
|
+
if (detaching) {
|
|
1188
|
+
detach(button_1);
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1146
1191
|
mounted = false;
|
|
1147
1192
|
dispose();
|
|
1148
1193
|
}
|
|
1149
1194
|
};
|
|
1150
1195
|
}
|
|
1151
1196
|
|
|
1152
|
-
// (
|
|
1153
|
-
function
|
|
1154
|
-
let
|
|
1197
|
+
// (35:32)
|
|
1198
|
+
function create_if_block_3(ctx) {
|
|
1199
|
+
let button_1;
|
|
1155
1200
|
let t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[23]] + "";
|
|
1156
1201
|
let t;
|
|
1157
|
-
let
|
|
1202
|
+
let button_1_class_value;
|
|
1158
1203
|
let mounted;
|
|
1159
1204
|
let dispose;
|
|
1160
1205
|
|
|
1161
1206
|
return {
|
|
1162
1207
|
c() {
|
|
1163
|
-
|
|
1208
|
+
button_1 = element("button");
|
|
1164
1209
|
t = text(t_value);
|
|
1165
|
-
attr(
|
|
1166
|
-
|
|
1210
|
+
attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]));
|
|
1211
|
+
button_1.disabled = /*isToday*/ ctx[1];
|
|
1167
1212
|
},
|
|
1168
1213
|
m(target, anchor) {
|
|
1169
|
-
insert(target,
|
|
1170
|
-
append(
|
|
1214
|
+
insert(target, button_1, anchor);
|
|
1215
|
+
append(button_1, t);
|
|
1171
1216
|
|
|
1172
1217
|
if (!mounted) {
|
|
1173
|
-
dispose = listen(
|
|
1218
|
+
dispose = listen(button_1, "click", /*click_handler*/ ctx[19]);
|
|
1174
1219
|
mounted = true;
|
|
1175
1220
|
}
|
|
1176
1221
|
},
|
|
1177
1222
|
p(ctx, dirty) {
|
|
1178
1223
|
if (dirty & /*$buttonText, buttons*/ 33 && t_value !== (t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[23]] + "")) set_data(t, t_value);
|
|
1179
1224
|
|
|
1180
|
-
if (dirty & /*$theme, buttons*/ 9 &&
|
|
1181
|
-
attr(
|
|
1225
|
+
if (dirty & /*$theme, buttons*/ 9 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]))) {
|
|
1226
|
+
attr(button_1, "class", button_1_class_value);
|
|
1182
1227
|
}
|
|
1183
1228
|
|
|
1184
1229
|
if (dirty & /*isToday*/ 2) {
|
|
1185
|
-
|
|
1230
|
+
button_1.disabled = /*isToday*/ ctx[1];
|
|
1186
1231
|
}
|
|
1187
1232
|
},
|
|
1188
1233
|
d(detaching) {
|
|
1189
|
-
if (detaching)
|
|
1234
|
+
if (detaching) {
|
|
1235
|
+
detach(button_1);
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1190
1238
|
mounted = false;
|
|
1191
1239
|
dispose();
|
|
1192
1240
|
}
|
|
1193
1241
|
};
|
|
1194
1242
|
}
|
|
1195
1243
|
|
|
1196
|
-
// (
|
|
1197
|
-
function
|
|
1198
|
-
let
|
|
1244
|
+
// (33:31)
|
|
1245
|
+
function create_if_block_2(ctx) {
|
|
1246
|
+
let button_1;
|
|
1199
1247
|
let i;
|
|
1200
1248
|
let i_class_value;
|
|
1201
|
-
let
|
|
1249
|
+
let button_1_class_value;
|
|
1250
|
+
let button_1_aria_label_value;
|
|
1202
1251
|
let mounted;
|
|
1203
1252
|
let dispose;
|
|
1204
1253
|
|
|
1205
1254
|
return {
|
|
1206
1255
|
c() {
|
|
1207
|
-
|
|
1256
|
+
button_1 = element("button");
|
|
1208
1257
|
i = element("i");
|
|
1209
1258
|
attr(i, "class", i_class_value = "" + (/*$theme*/ ctx[3].icon + " ec-" + /*button*/ ctx[23]));
|
|
1210
|
-
attr(
|
|
1259
|
+
attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]));
|
|
1260
|
+
attr(button_1, "aria-label", button_1_aria_label_value = /*$buttonText*/ ctx[5].next);
|
|
1211
1261
|
},
|
|
1212
1262
|
m(target, anchor) {
|
|
1213
|
-
insert(target,
|
|
1214
|
-
append(
|
|
1263
|
+
insert(target, button_1, anchor);
|
|
1264
|
+
append(button_1, i);
|
|
1215
1265
|
|
|
1216
1266
|
if (!mounted) {
|
|
1217
|
-
dispose = listen(
|
|
1267
|
+
dispose = listen(button_1, "click", /*next*/ ctx[17]);
|
|
1218
1268
|
mounted = true;
|
|
1219
1269
|
}
|
|
1220
1270
|
},
|
|
@@ -1223,40 +1273,49 @@ function create_if_block_3(ctx) {
|
|
|
1223
1273
|
attr(i, "class", i_class_value);
|
|
1224
1274
|
}
|
|
1225
1275
|
|
|
1226
|
-
if (dirty & /*$theme, buttons*/ 9 &&
|
|
1227
|
-
attr(
|
|
1276
|
+
if (dirty & /*$theme, buttons*/ 9 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]))) {
|
|
1277
|
+
attr(button_1, "class", button_1_class_value);
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
if (dirty & /*$buttonText*/ 32 && button_1_aria_label_value !== (button_1_aria_label_value = /*$buttonText*/ ctx[5].next)) {
|
|
1281
|
+
attr(button_1, "aria-label", button_1_aria_label_value);
|
|
1228
1282
|
}
|
|
1229
1283
|
},
|
|
1230
1284
|
d(detaching) {
|
|
1231
|
-
if (detaching)
|
|
1285
|
+
if (detaching) {
|
|
1286
|
+
detach(button_1);
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1232
1289
|
mounted = false;
|
|
1233
1290
|
dispose();
|
|
1234
1291
|
}
|
|
1235
1292
|
};
|
|
1236
1293
|
}
|
|
1237
1294
|
|
|
1238
|
-
// (
|
|
1239
|
-
function
|
|
1240
|
-
let
|
|
1295
|
+
// (31:31)
|
|
1296
|
+
function create_if_block_1(ctx) {
|
|
1297
|
+
let button_1;
|
|
1241
1298
|
let i;
|
|
1242
1299
|
let i_class_value;
|
|
1243
|
-
let
|
|
1300
|
+
let button_1_class_value;
|
|
1301
|
+
let button_1_aria_label_value;
|
|
1244
1302
|
let mounted;
|
|
1245
1303
|
let dispose;
|
|
1246
1304
|
|
|
1247
1305
|
return {
|
|
1248
1306
|
c() {
|
|
1249
|
-
|
|
1307
|
+
button_1 = element("button");
|
|
1250
1308
|
i = element("i");
|
|
1251
1309
|
attr(i, "class", i_class_value = "" + (/*$theme*/ ctx[3].icon + " ec-" + /*button*/ ctx[23]));
|
|
1252
|
-
attr(
|
|
1310
|
+
attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]));
|
|
1311
|
+
attr(button_1, "aria-label", button_1_aria_label_value = /*$buttonText*/ ctx[5].prev);
|
|
1253
1312
|
},
|
|
1254
1313
|
m(target, anchor) {
|
|
1255
|
-
insert(target,
|
|
1256
|
-
append(
|
|
1314
|
+
insert(target, button_1, anchor);
|
|
1315
|
+
append(button_1, i);
|
|
1257
1316
|
|
|
1258
1317
|
if (!mounted) {
|
|
1259
|
-
dispose = listen(
|
|
1318
|
+
dispose = listen(button_1, "click", /*prev*/ ctx[16]);
|
|
1260
1319
|
mounted = true;
|
|
1261
1320
|
}
|
|
1262
1321
|
},
|
|
@@ -1265,20 +1324,27 @@ function create_if_block_2(ctx) {
|
|
|
1265
1324
|
attr(i, "class", i_class_value);
|
|
1266
1325
|
}
|
|
1267
1326
|
|
|
1268
|
-
if (dirty & /*$theme, buttons*/ 9 &&
|
|
1269
|
-
attr(
|
|
1327
|
+
if (dirty & /*$theme, buttons*/ 9 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]))) {
|
|
1328
|
+
attr(button_1, "class", button_1_class_value);
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
if (dirty & /*$buttonText*/ 32 && button_1_aria_label_value !== (button_1_aria_label_value = /*$buttonText*/ ctx[5].prev)) {
|
|
1332
|
+
attr(button_1, "aria-label", button_1_aria_label_value);
|
|
1270
1333
|
}
|
|
1271
1334
|
},
|
|
1272
1335
|
d(detaching) {
|
|
1273
|
-
if (detaching)
|
|
1336
|
+
if (detaching) {
|
|
1337
|
+
detach(button_1);
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1274
1340
|
mounted = false;
|
|
1275
1341
|
dispose();
|
|
1276
1342
|
}
|
|
1277
1343
|
};
|
|
1278
1344
|
}
|
|
1279
1345
|
|
|
1280
|
-
// (
|
|
1281
|
-
function
|
|
1346
|
+
// (29:4) {#if button == 'title'}
|
|
1347
|
+
function create_if_block$1(ctx) {
|
|
1282
1348
|
let h2;
|
|
1283
1349
|
let t;
|
|
1284
1350
|
let h2_class_value;
|
|
@@ -1301,47 +1367,43 @@ function create_if_block_1(ctx) {
|
|
|
1301
1367
|
}
|
|
1302
1368
|
},
|
|
1303
1369
|
d(detaching) {
|
|
1304
|
-
if (detaching)
|
|
1370
|
+
if (detaching) {
|
|
1371
|
+
detach(h2);
|
|
1372
|
+
}
|
|
1305
1373
|
}
|
|
1306
1374
|
};
|
|
1307
1375
|
}
|
|
1308
1376
|
|
|
1309
|
-
// (29:4) {#if button == ''}
|
|
1310
|
-
function create_if_block$1(ctx) {
|
|
1311
|
-
return { c: noop, m: noop, p: noop, d: noop };
|
|
1312
|
-
}
|
|
1313
|
-
|
|
1314
1377
|
// (28:0) {#each buttons as button}
|
|
1315
1378
|
function create_each_block$2(ctx) {
|
|
1316
1379
|
let if_block_anchor;
|
|
1317
1380
|
|
|
1318
1381
|
function select_block_type(ctx, dirty) {
|
|
1319
|
-
if (/*button*/ ctx[23] == '') return create_if_block$1;
|
|
1320
|
-
if (/*button*/ ctx[23] == '
|
|
1321
|
-
if (/*button*/ ctx[23] == '
|
|
1322
|
-
if (/*button*/ ctx[23]
|
|
1323
|
-
if (/*button*/ ctx[23]
|
|
1324
|
-
return create_else_block$1;
|
|
1382
|
+
if (/*button*/ ctx[23] == 'title') return create_if_block$1;
|
|
1383
|
+
if (/*button*/ ctx[23] == 'prev') return create_if_block_1;
|
|
1384
|
+
if (/*button*/ ctx[23] == 'next') return create_if_block_2;
|
|
1385
|
+
if (/*button*/ ctx[23] == 'today') return create_if_block_3;
|
|
1386
|
+
if (/*button*/ ctx[23] != '') return create_if_block_4;
|
|
1325
1387
|
}
|
|
1326
1388
|
|
|
1327
1389
|
let current_block_type = select_block_type(ctx);
|
|
1328
|
-
let if_block = current_block_type(ctx);
|
|
1390
|
+
let if_block = current_block_type && current_block_type(ctx);
|
|
1329
1391
|
|
|
1330
1392
|
return {
|
|
1331
1393
|
c() {
|
|
1332
|
-
if_block.c();
|
|
1394
|
+
if (if_block) if_block.c();
|
|
1333
1395
|
if_block_anchor = empty();
|
|
1334
1396
|
},
|
|
1335
1397
|
m(target, anchor) {
|
|
1336
|
-
if_block.m(target, anchor);
|
|
1398
|
+
if (if_block) if_block.m(target, anchor);
|
|
1337
1399
|
insert(target, if_block_anchor, anchor);
|
|
1338
1400
|
},
|
|
1339
1401
|
p(ctx, dirty) {
|
|
1340
1402
|
if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
|
|
1341
1403
|
if_block.p(ctx, dirty);
|
|
1342
1404
|
} else {
|
|
1343
|
-
if_block.d(1);
|
|
1344
|
-
if_block = current_block_type(ctx);
|
|
1405
|
+
if (if_block) if_block.d(1);
|
|
1406
|
+
if_block = current_block_type && current_block_type(ctx);
|
|
1345
1407
|
|
|
1346
1408
|
if (if_block) {
|
|
1347
1409
|
if_block.c();
|
|
@@ -1350,15 +1412,20 @@ function create_each_block$2(ctx) {
|
|
|
1350
1412
|
}
|
|
1351
1413
|
},
|
|
1352
1414
|
d(detaching) {
|
|
1353
|
-
|
|
1354
|
-
|
|
1415
|
+
if (detaching) {
|
|
1416
|
+
detach(if_block_anchor);
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
if (if_block) {
|
|
1420
|
+
if_block.d(detaching);
|
|
1421
|
+
}
|
|
1355
1422
|
}
|
|
1356
1423
|
};
|
|
1357
1424
|
}
|
|
1358
1425
|
|
|
1359
1426
|
function create_fragment$3(ctx) {
|
|
1360
1427
|
let each_1_anchor;
|
|
1361
|
-
let each_value = /*buttons*/ ctx[0];
|
|
1428
|
+
let each_value = ensure_array_like(/*buttons*/ ctx[0]);
|
|
1362
1429
|
let each_blocks = [];
|
|
1363
1430
|
|
|
1364
1431
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
@@ -1383,8 +1450,8 @@ function create_fragment$3(ctx) {
|
|
|
1383
1450
|
insert(target, each_1_anchor, anchor);
|
|
1384
1451
|
},
|
|
1385
1452
|
p(ctx, [dirty]) {
|
|
1386
|
-
if (dirty &
|
|
1387
|
-
each_value = /*buttons*/ ctx[0];
|
|
1453
|
+
if (dirty & /*$theme, $_viewTitle, buttons, $buttonText, prev, next, isToday, $date, today, $view*/ 229503) {
|
|
1454
|
+
each_value = ensure_array_like(/*buttons*/ ctx[0]);
|
|
1388
1455
|
let i;
|
|
1389
1456
|
|
|
1390
1457
|
for (i = 0; i < each_value.length; i += 1) {
|
|
@@ -1409,8 +1476,11 @@ function create_fragment$3(ctx) {
|
|
|
1409
1476
|
i: noop,
|
|
1410
1477
|
o: noop,
|
|
1411
1478
|
d(detaching) {
|
|
1479
|
+
if (detaching) {
|
|
1480
|
+
detach(each_1_anchor);
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1412
1483
|
destroy_each(each_blocks, detaching);
|
|
1413
|
-
if (detaching) detach(each_1_anchor);
|
|
1414
1484
|
}
|
|
1415
1485
|
};
|
|
1416
1486
|
}
|
|
@@ -1497,7 +1567,7 @@ class Buttons extends SvelteComponent {
|
|
|
1497
1567
|
}
|
|
1498
1568
|
}
|
|
1499
1569
|
|
|
1500
|
-
/* packages/core/src/Toolbar.svelte generated by Svelte
|
|
1570
|
+
/* packages/core/src/Toolbar.svelte generated by Svelte v4.1.1 */
|
|
1501
1571
|
|
|
1502
1572
|
function get_each_context$1(ctx, list, i) {
|
|
1503
1573
|
const child_ctx = ctx.slice();
|
|
@@ -1513,34 +1583,34 @@ function get_each_context_1(ctx, list, i) {
|
|
|
1513
1583
|
|
|
1514
1584
|
// (28:16) {:else}
|
|
1515
1585
|
function create_else_block(ctx) {
|
|
1516
|
-
let
|
|
1586
|
+
let buttons_1;
|
|
1517
1587
|
let current;
|
|
1518
|
-
|
|
1588
|
+
buttons_1 = new Buttons({ props: { buttons: /*buttons*/ ctx[8] } });
|
|
1519
1589
|
|
|
1520
1590
|
return {
|
|
1521
1591
|
c() {
|
|
1522
|
-
create_component(
|
|
1592
|
+
create_component(buttons_1.$$.fragment);
|
|
1523
1593
|
},
|
|
1524
1594
|
m(target, anchor) {
|
|
1525
|
-
mount_component(
|
|
1595
|
+
mount_component(buttons_1, target, anchor);
|
|
1526
1596
|
current = true;
|
|
1527
1597
|
},
|
|
1528
1598
|
p(ctx, dirty) {
|
|
1529
|
-
const
|
|
1530
|
-
if (dirty & /*sections*/ 1)
|
|
1531
|
-
|
|
1599
|
+
const buttons_1_changes = {};
|
|
1600
|
+
if (dirty & /*sections*/ 1) buttons_1_changes.buttons = /*buttons*/ ctx[8];
|
|
1601
|
+
buttons_1.$set(buttons_1_changes);
|
|
1532
1602
|
},
|
|
1533
1603
|
i(local) {
|
|
1534
1604
|
if (current) return;
|
|
1535
|
-
transition_in(
|
|
1605
|
+
transition_in(buttons_1.$$.fragment, local);
|
|
1536
1606
|
current = true;
|
|
1537
1607
|
},
|
|
1538
1608
|
o(local) {
|
|
1539
|
-
transition_out(
|
|
1609
|
+
transition_out(buttons_1.$$.fragment, local);
|
|
1540
1610
|
current = false;
|
|
1541
1611
|
},
|
|
1542
1612
|
d(detaching) {
|
|
1543
|
-
destroy_component(
|
|
1613
|
+
destroy_component(buttons_1, detaching);
|
|
1544
1614
|
}
|
|
1545
1615
|
};
|
|
1546
1616
|
}
|
|
@@ -1548,26 +1618,26 @@ function create_else_block(ctx) {
|
|
|
1548
1618
|
// (24:16) {#if buttons.length > 1}
|
|
1549
1619
|
function create_if_block(ctx) {
|
|
1550
1620
|
let div;
|
|
1551
|
-
let
|
|
1621
|
+
let buttons_1;
|
|
1552
1622
|
let div_class_value;
|
|
1553
1623
|
let current;
|
|
1554
|
-
|
|
1624
|
+
buttons_1 = new Buttons({ props: { buttons: /*buttons*/ ctx[8] } });
|
|
1555
1625
|
|
|
1556
1626
|
return {
|
|
1557
1627
|
c() {
|
|
1558
1628
|
div = element("div");
|
|
1559
|
-
create_component(
|
|
1629
|
+
create_component(buttons_1.$$.fragment);
|
|
1560
1630
|
attr(div, "class", div_class_value = /*$theme*/ ctx[1].buttonGroup);
|
|
1561
1631
|
},
|
|
1562
1632
|
m(target, anchor) {
|
|
1563
1633
|
insert(target, div, anchor);
|
|
1564
|
-
mount_component(
|
|
1634
|
+
mount_component(buttons_1, div, null);
|
|
1565
1635
|
current = true;
|
|
1566
1636
|
},
|
|
1567
1637
|
p(ctx, dirty) {
|
|
1568
|
-
const
|
|
1569
|
-
if (dirty & /*sections*/ 1)
|
|
1570
|
-
|
|
1638
|
+
const buttons_1_changes = {};
|
|
1639
|
+
if (dirty & /*sections*/ 1) buttons_1_changes.buttons = /*buttons*/ ctx[8];
|
|
1640
|
+
buttons_1.$set(buttons_1_changes);
|
|
1571
1641
|
|
|
1572
1642
|
if (!current || dirty & /*$theme*/ 2 && div_class_value !== (div_class_value = /*$theme*/ ctx[1].buttonGroup)) {
|
|
1573
1643
|
attr(div, "class", div_class_value);
|
|
@@ -1575,16 +1645,19 @@ function create_if_block(ctx) {
|
|
|
1575
1645
|
},
|
|
1576
1646
|
i(local) {
|
|
1577
1647
|
if (current) return;
|
|
1578
|
-
transition_in(
|
|
1648
|
+
transition_in(buttons_1.$$.fragment, local);
|
|
1579
1649
|
current = true;
|
|
1580
1650
|
},
|
|
1581
1651
|
o(local) {
|
|
1582
|
-
transition_out(
|
|
1652
|
+
transition_out(buttons_1.$$.fragment, local);
|
|
1583
1653
|
current = false;
|
|
1584
1654
|
},
|
|
1585
1655
|
d(detaching) {
|
|
1586
|
-
if (detaching)
|
|
1587
|
-
|
|
1656
|
+
if (detaching) {
|
|
1657
|
+
detach(div);
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
destroy_component(buttons_1);
|
|
1588
1661
|
}
|
|
1589
1662
|
};
|
|
1590
1663
|
}
|
|
@@ -1653,8 +1726,11 @@ function create_each_block_1(ctx) {
|
|
|
1653
1726
|
current = false;
|
|
1654
1727
|
},
|
|
1655
1728
|
d(detaching) {
|
|
1729
|
+
if (detaching) {
|
|
1730
|
+
detach(if_block_anchor);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1656
1733
|
if_blocks[current_block_type_index].d(detaching);
|
|
1657
|
-
if (detaching) detach(if_block_anchor);
|
|
1658
1734
|
}
|
|
1659
1735
|
};
|
|
1660
1736
|
}
|
|
@@ -1664,7 +1740,7 @@ function create_each_block$1(ctx) {
|
|
|
1664
1740
|
let div;
|
|
1665
1741
|
let t;
|
|
1666
1742
|
let current;
|
|
1667
|
-
let each_value_1 = /*sections*/ ctx[0][/*key*/ ctx[5]];
|
|
1743
|
+
let each_value_1 = ensure_array_like(/*sections*/ ctx[0][/*key*/ ctx[5]]);
|
|
1668
1744
|
let each_blocks = [];
|
|
1669
1745
|
|
|
1670
1746
|
for (let i = 0; i < each_value_1.length; i += 1) {
|
|
@@ -1699,7 +1775,7 @@ function create_each_block$1(ctx) {
|
|
|
1699
1775
|
},
|
|
1700
1776
|
p(ctx, dirty) {
|
|
1701
1777
|
if (dirty & /*$theme, sections, Object*/ 3) {
|
|
1702
|
-
each_value_1 = /*sections*/ ctx[0][/*key*/ ctx[5]];
|
|
1778
|
+
each_value_1 = ensure_array_like(/*sections*/ ctx[0][/*key*/ ctx[5]]);
|
|
1703
1779
|
let i;
|
|
1704
1780
|
|
|
1705
1781
|
for (i = 0; i < each_value_1.length; i += 1) {
|
|
@@ -1744,7 +1820,10 @@ function create_each_block$1(ctx) {
|
|
|
1744
1820
|
current = false;
|
|
1745
1821
|
},
|
|
1746
1822
|
d(detaching) {
|
|
1747
|
-
if (detaching)
|
|
1823
|
+
if (detaching) {
|
|
1824
|
+
detach(div);
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1748
1827
|
destroy_each(each_blocks, detaching);
|
|
1749
1828
|
}
|
|
1750
1829
|
};
|
|
@@ -1754,7 +1833,7 @@ function create_fragment$2(ctx) {
|
|
|
1754
1833
|
let div;
|
|
1755
1834
|
let div_class_value;
|
|
1756
1835
|
let current;
|
|
1757
|
-
let each_value = Object.keys(/*sections*/ ctx[0]);
|
|
1836
|
+
let each_value = ensure_array_like(Object.keys(/*sections*/ ctx[0]));
|
|
1758
1837
|
let each_blocks = [];
|
|
1759
1838
|
|
|
1760
1839
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
@@ -1788,7 +1867,7 @@ function create_fragment$2(ctx) {
|
|
|
1788
1867
|
},
|
|
1789
1868
|
p(ctx, [dirty]) {
|
|
1790
1869
|
if (dirty & /*sections, Object, $theme*/ 3) {
|
|
1791
|
-
each_value = Object.keys(/*sections*/ ctx[0]);
|
|
1870
|
+
each_value = ensure_array_like(Object.keys(/*sections*/ ctx[0]));
|
|
1792
1871
|
let i;
|
|
1793
1872
|
|
|
1794
1873
|
for (i = 0; i < each_value.length; i += 1) {
|
|
@@ -1837,7 +1916,10 @@ function create_fragment$2(ctx) {
|
|
|
1837
1916
|
current = false;
|
|
1838
1917
|
},
|
|
1839
1918
|
d(detaching) {
|
|
1840
|
-
if (detaching)
|
|
1919
|
+
if (detaching) {
|
|
1920
|
+
detach(div);
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1841
1923
|
destroy_each(each_blocks, detaching);
|
|
1842
1924
|
}
|
|
1843
1925
|
};
|
|
@@ -1871,7 +1953,7 @@ class Toolbar extends SvelteComponent {
|
|
|
1871
1953
|
}
|
|
1872
1954
|
}
|
|
1873
1955
|
|
|
1874
|
-
/* packages/core/src/Auxiliary.svelte generated by Svelte
|
|
1956
|
+
/* packages/core/src/Auxiliary.svelte generated by Svelte v4.1.1 */
|
|
1875
1957
|
|
|
1876
1958
|
function get_each_context(ctx, list, i) {
|
|
1877
1959
|
const child_ctx = ctx.slice();
|
|
@@ -1886,7 +1968,7 @@ function create_each_block(ctx) {
|
|
|
1886
1968
|
let current;
|
|
1887
1969
|
var switch_value = /*component*/ ctx[11];
|
|
1888
1970
|
|
|
1889
|
-
function switch_props(ctx) {
|
|
1971
|
+
function switch_props(ctx, dirty) {
|
|
1890
1972
|
return {};
|
|
1891
1973
|
}
|
|
1892
1974
|
|
|
@@ -1937,7 +2019,10 @@ function create_each_block(ctx) {
|
|
|
1937
2019
|
current = false;
|
|
1938
2020
|
},
|
|
1939
2021
|
d(detaching) {
|
|
1940
|
-
if (detaching)
|
|
2022
|
+
if (detaching) {
|
|
2023
|
+
detach(switch_instance_anchor);
|
|
2024
|
+
}
|
|
2025
|
+
|
|
1941
2026
|
if (switch_instance) destroy_component(switch_instance, detaching);
|
|
1942
2027
|
}
|
|
1943
2028
|
};
|
|
@@ -1946,7 +2031,7 @@ function create_each_block(ctx) {
|
|
|
1946
2031
|
function create_fragment$1(ctx) {
|
|
1947
2032
|
let each_1_anchor;
|
|
1948
2033
|
let current;
|
|
1949
|
-
let each_value = /*$_auxiliary*/ ctx[0];
|
|
2034
|
+
let each_value = ensure_array_like(/*$_auxiliary*/ ctx[0]);
|
|
1950
2035
|
let each_blocks = [];
|
|
1951
2036
|
|
|
1952
2037
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
@@ -1977,7 +2062,7 @@ function create_fragment$1(ctx) {
|
|
|
1977
2062
|
},
|
|
1978
2063
|
p(ctx, [dirty]) {
|
|
1979
2064
|
if (dirty & /*$_auxiliary*/ 1) {
|
|
1980
|
-
each_value = /*$_auxiliary*/ ctx[0];
|
|
2065
|
+
each_value = ensure_array_like(/*$_auxiliary*/ ctx[0]);
|
|
1981
2066
|
let i;
|
|
1982
2067
|
|
|
1983
2068
|
for (i = 0; i < each_value.length; i += 1) {
|
|
@@ -2022,8 +2107,11 @@ function create_fragment$1(ctx) {
|
|
|
2022
2107
|
current = false;
|
|
2023
2108
|
},
|
|
2024
2109
|
d(detaching) {
|
|
2110
|
+
if (detaching) {
|
|
2111
|
+
detach(each_1_anchor);
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2025
2114
|
destroy_each(each_blocks, detaching);
|
|
2026
|
-
if (detaching) detach(each_1_anchor);
|
|
2027
2115
|
}
|
|
2028
2116
|
};
|
|
2029
2117
|
}
|
|
@@ -2073,7 +2161,7 @@ class Auxiliary extends SvelteComponent {
|
|
|
2073
2161
|
}
|
|
2074
2162
|
}
|
|
2075
2163
|
|
|
2076
|
-
/* packages/core/src/Calendar.svelte generated by Svelte
|
|
2164
|
+
/* packages/core/src/Calendar.svelte generated by Svelte v4.1.1 */
|
|
2077
2165
|
|
|
2078
2166
|
function create_fragment(ctx) {
|
|
2079
2167
|
let div;
|
|
@@ -2089,7 +2177,7 @@ function create_fragment(ctx) {
|
|
|
2089
2177
|
toolbar = new Toolbar({});
|
|
2090
2178
|
var switch_value = /*$_viewComponent*/ ctx[5];
|
|
2091
2179
|
|
|
2092
|
-
function switch_props(ctx) {
|
|
2180
|
+
function switch_props(ctx, dirty) {
|
|
2093
2181
|
return {};
|
|
2094
2182
|
}
|
|
2095
2183
|
|
|
@@ -2183,10 +2271,13 @@ function create_fragment(ctx) {
|
|
|
2183
2271
|
current = false;
|
|
2184
2272
|
},
|
|
2185
2273
|
d(detaching) {
|
|
2186
|
-
if (detaching)
|
|
2274
|
+
if (detaching) {
|
|
2275
|
+
detach(div);
|
|
2276
|
+
detach(t1);
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2187
2279
|
destroy_component(toolbar);
|
|
2188
2280
|
if (switch_instance) destroy_component(switch_instance);
|
|
2189
|
-
if (detaching) detach(t1);
|
|
2190
2281
|
destroy_component(auxiliary, detaching);
|
|
2191
2282
|
mounted = false;
|
|
2192
2283
|
dispose();
|
|
@@ -2461,4 +2552,4 @@ class Calendar extends SvelteComponent {
|
|
|
2461
2552
|
}
|
|
2462
2553
|
}
|
|
2463
2554
|
|
|
2464
|
-
export { DAY_IN_SECONDS, addDay, addDuration, ancestor, assign, bgEvent, cloneDate, cloneEvent, createDate, createDuration, createElement, createEventChunk, createEventContent, createEventSources, createEvents, createView, datesEqual, debounce, Calendar as default, derived2, eventIntersects, floor, flushDebounce, formatRange, getElementWithPayload, getPayload, ghostEvent, hasPayload, hasYScroll, height, helperEvent, intl, intlRange, isObject, max, min, nextClosestDay, noTimePart, outsideEvent, prepareEventChunks, prevClosestDay, previewEvent, rect, repositionEvent, setContent, setMidnight, setPayload, sortEventChunks, subtractDay, subtractDuration, symbol, toEventWithLocalDates, toISOString, toLocalDate, toViewWithLocalDates, writable2 };
|
|
2555
|
+
export { DAY_IN_SECONDS, addDay, addDuration, ancestor, assign, bgEvent, btnTextDay, btnTextMonth, btnTextWeek, btnTextYear, cloneDate, cloneEvent, createDate, createDuration, createElement, createEventChunk, createEventClasses, createEventContent, createEventSources, createEvents, createView, datesEqual, debounce, Calendar as default, derived2, eventIntersects, floor, flushDebounce, formatRange, getElementWithPayload, getPayload, ghostEvent, hasPayload, hasYScroll, height, helperEvent, intl, intlRange, isObject, keyEnter, max, min, nextClosestDay, noTimePart, outsideEvent, pointerEvent, prepareEventChunks, prevClosestDay, previewEvent, rect, repositionEvent, setContent, setMidnight, setPayload, sortEventChunks, subtractDay, subtractDuration, symbol, toEventWithLocalDates, toISOString, toLocalDate, toViewWithLocalDates, writable2 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event-calendar/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"title": "Event Calendar Core package",
|
|
5
5
|
"description": "Full-sized drag & drop event calendar with resource view",
|
|
6
6
|
"keywords": [
|
|
@@ -27,6 +27,6 @@
|
|
|
27
27
|
"./package.json": "./package.json"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"svelte": "^
|
|
30
|
+
"svelte": "^4.1.1"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/src/Buttons.svelte
CHANGED
|
@@ -26,16 +26,15 @@
|
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
28
|
{#each buttons as button}
|
|
29
|
-
{#if button == ''}
|
|
30
|
-
{:else if button == 'title'}
|
|
29
|
+
{#if button == 'title'}
|
|
31
30
|
<h2 class="{$theme.title}">{$_viewTitle}</h2>
|
|
32
31
|
{:else if button == 'prev'}
|
|
33
|
-
<button class="{$theme.button} ec-{button}" on:click={prev}><i class="{$theme.icon} ec-{button}"></i></button>
|
|
34
|
-
{:else if button
|
|
35
|
-
<button class="{$theme.button} ec-{button}" on:click={next}><i class="{$theme.icon} ec-{button}"></i></button>
|
|
36
|
-
{:else if button
|
|
32
|
+
<button class="{$theme.button} ec-{button}" aria-label={$buttonText.prev} on:click={prev}><i class="{$theme.icon} ec-{button}"></i></button>
|
|
33
|
+
{:else if button == 'next'}
|
|
34
|
+
<button class="{$theme.button} ec-{button}" aria-label={$buttonText.next} on:click={next}><i class="{$theme.icon} ec-{button}"></i></button>
|
|
35
|
+
{:else if button == 'today'}
|
|
37
36
|
<button class="{$theme.button} ec-{button}" on:click={() => $date = cloneDate(today)} disabled={isToday}>{$buttonText[button]}</button>
|
|
38
|
-
{:else}
|
|
37
|
+
{:else if button != ''}
|
|
39
38
|
<button class="{$theme.button}{$view === button ? ' ' + $theme.active : ''} ec-{button}" on:click={() => $view = button}>{$buttonText[button]}</button>
|
|
40
39
|
{/if}
|
|
41
40
|
{/each}
|
package/src/Calendar.svelte
CHANGED
package/src/lib/a11y.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
export function keyEnter(fn) {
|
|
3
|
+
return function (e) {
|
|
4
|
+
return e.key === 'Enter' || e.key === ' ' ? fn.call(this, e) : undefined;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function btnTextDay(text) {
|
|
9
|
+
return btnText(text, 'day');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function btnTextWeek(text) {
|
|
13
|
+
return btnText(text, 'week');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function btnTextMonth(text) {
|
|
17
|
+
return btnText(text, 'month');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function btnTextYear(text) {
|
|
21
|
+
return btnText(text, 'year');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function btnText(text, period) {
|
|
25
|
+
return {
|
|
26
|
+
...text,
|
|
27
|
+
next: 'Next ' + period,
|
|
28
|
+
prev: 'Previous ' + period
|
|
29
|
+
};
|
|
30
|
+
}
|
package/src/lib/events.js
CHANGED
|
@@ -166,6 +166,19 @@ export function createEventContent(chunk, displayEventEnd, eventContent, theme,
|
|
|
166
166
|
return [timeText, content];
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
+
export function createEventClasses(eventClassNames, event, _view) {
|
|
170
|
+
if (eventClassNames) {
|
|
171
|
+
if (is_function(eventClassNames)) {
|
|
172
|
+
eventClassNames = eventClassNames({
|
|
173
|
+
event: toEventWithLocalDates(event),
|
|
174
|
+
view: toViewWithLocalDates(_view)
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return Array.isArray(eventClassNames) ? eventClassNames : [eventClassNames];
|
|
178
|
+
}
|
|
179
|
+
return [];
|
|
180
|
+
}
|
|
181
|
+
|
|
169
182
|
export function toEventWithLocalDates(event) {
|
|
170
183
|
return _cloneEvent(event, toLocalDate);
|
|
171
184
|
}
|
|
@@ -200,7 +213,7 @@ export function eventIntersects(event, start, end, resource, timeMode) {
|
|
|
200
213
|
}
|
|
201
214
|
|
|
202
215
|
export function helperEvent(display) {
|
|
203
|
-
return display
|
|
216
|
+
return previewEvent(display) || ghostEvent(display) || pointerEvent(display);
|
|
204
217
|
}
|
|
205
218
|
|
|
206
219
|
export function bgEvent(display) {
|
|
@@ -214,3 +227,7 @@ export function previewEvent(display) {
|
|
|
214
227
|
export function ghostEvent(display) {
|
|
215
228
|
return display === 'ghost';
|
|
216
229
|
}
|
|
230
|
+
|
|
231
|
+
export function pointerEvent(display) {
|
|
232
|
+
return display === 'pointer';
|
|
233
|
+
}
|
package/src/lib.js
CHANGED
package/src/storage/options.js
CHANGED
|
@@ -20,6 +20,7 @@ export function createOptions(plugins) {
|
|
|
20
20
|
events: [],
|
|
21
21
|
eventBackgroundColor: undefined,
|
|
22
22
|
eventTextColor: undefined,
|
|
23
|
+
eventClassNames: undefined,
|
|
23
24
|
eventClick: undefined,
|
|
24
25
|
eventColor: undefined,
|
|
25
26
|
eventContent: undefined,
|
|
@@ -105,9 +106,7 @@ export function createOptions(plugins) {
|
|
|
105
106
|
};
|
|
106
107
|
|
|
107
108
|
for (let plugin of plugins) {
|
|
108
|
-
|
|
109
|
-
plugin.createOptions(options);
|
|
110
|
-
}
|
|
109
|
+
plugin.createOptions?.(options);
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
return options;
|
|
@@ -130,9 +129,7 @@ export function createParsers(options, plugins) {
|
|
|
130
129
|
};
|
|
131
130
|
|
|
132
131
|
for (let plugin of plugins) {
|
|
133
|
-
|
|
134
|
-
plugin.createParsers(parsers, options);
|
|
135
|
-
}
|
|
132
|
+
plugin.createParsers?.(parsers, options);
|
|
136
133
|
}
|
|
137
134
|
|
|
138
135
|
return parsers;
|
package/src/storage/state.js
CHANGED
|
@@ -54,14 +54,12 @@ export default class {
|
|
|
54
54
|
// Interaction
|
|
55
55
|
this._interaction = writable({});
|
|
56
56
|
this._iEvents = writable([null, null]); // interaction events: [drag/resize, pointer]
|
|
57
|
-
this.
|
|
58
|
-
this._iClass = writable(undefined);
|
|
57
|
+
this._iClasses = writable(identity); // interaction event css classes
|
|
58
|
+
this._iClass = writable(undefined); // interaction css class for entire calendar
|
|
59
59
|
|
|
60
60
|
// Let plugins create their private stores
|
|
61
61
|
for (let plugin of plugins) {
|
|
62
|
-
|
|
63
|
-
plugin.createStores(this);
|
|
64
|
-
}
|
|
62
|
+
plugin.createStores?.(this);
|
|
65
63
|
}
|
|
66
64
|
|
|
67
65
|
if (input.view) {
|
|
@@ -74,7 +72,7 @@ export default class {
|
|
|
74
72
|
parseOpts(commonOpts, this);
|
|
75
73
|
let views = new Set([...Object.keys(options.views), ...Object.keys(input.views || {})]);
|
|
76
74
|
for (let view of views) {
|
|
77
|
-
let viewOpts = assign({}, options.views[view]
|
|
75
|
+
let viewOpts = assign({}, options.views[view] ?? {}, input.views?.[view] ?? {});
|
|
78
76
|
parseOpts(viewOpts, this);
|
|
79
77
|
let opts = assign({}, commonOpts, viewOpts);
|
|
80
78
|
// Change view component when view changes
|
package/src/storage/stores.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from '../lib.js';
|
|
21
21
|
|
|
22
22
|
export function monthMode(state) {
|
|
23
|
-
return derived(state.view, $view => $view
|
|
23
|
+
return derived(state.view, $view => $view?.startsWith('dayGrid'));
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export function activeRange(state) {
|