@event-calendar/core 1.5.0 → 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 +19 -8
- package/index.js +198 -119
- package/package.json +2 -2
- package/src/Buttons.svelte +6 -7
- package/src/lib/a11y.js +30 -0
- package/src/lib.js +1 -0
- package/src/storage/state.js +1 -1
- package/src/storage/stores.js +1 -1
package/README.md
CHANGED
|
@@ -194,8 +194,8 @@ import '@event-calendar/core/index.css';
|
|
|
194
194
|
### Pre-built browser ready bundle
|
|
195
195
|
Include the following lines of code in the `<head>` section of your page:
|
|
196
196
|
```html
|
|
197
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.5.
|
|
198
|
-
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.5.
|
|
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>
|
|
199
199
|
```
|
|
200
200
|
|
|
201
201
|
<details>
|
|
@@ -284,24 +284,35 @@ When hidden with `false`, all-day events will not be displayed in `timeGrid`/`re
|
|
|
284
284
|
|
|
285
285
|
### buttonText
|
|
286
286
|
- Type `object` or `function`
|
|
287
|
-
- 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
|
+
|
|
288
299
|
|
|
289
300
|
Text that is displayed in buttons of the header toolbar.
|
|
290
301
|
|
|
291
|
-
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:
|
|
292
303
|
|
|
293
304
|
```js
|
|
294
|
-
function (
|
|
295
|
-
// return new button
|
|
305
|
+
function (text) {
|
|
306
|
+
// return new button text object
|
|
296
307
|
}
|
|
297
308
|
```
|
|
298
309
|
<table>
|
|
299
310
|
<tr>
|
|
300
311
|
<td>
|
|
301
312
|
|
|
302
|
-
`
|
|
313
|
+
`text`
|
|
303
314
|
</td>
|
|
304
|
-
<td>An object with default button
|
|
315
|
+
<td>An object with default button text</td>
|
|
305
316
|
</tr>
|
|
306
317
|
</table>
|
|
307
318
|
|
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
|
}
|
|
@@ -807,7 +837,7 @@ function diff(options) {
|
|
|
807
837
|
}
|
|
808
838
|
|
|
809
839
|
function monthMode(state) {
|
|
810
|
-
return derived(state.view, $view => $view
|
|
840
|
+
return derived(state.view, $view => $view?.startsWith('dayGrid'));
|
|
811
841
|
}
|
|
812
842
|
|
|
813
843
|
function activeRange(state) {
|
|
@@ -1053,7 +1083,7 @@ class State {
|
|
|
1053
1083
|
parseOpts(commonOpts, this);
|
|
1054
1084
|
let views = new Set([...Object.keys(options.views), ...Object.keys(input.views || {})]);
|
|
1055
1085
|
for (let view of views) {
|
|
1056
|
-
let viewOpts = assign({}, options.views[view]
|
|
1086
|
+
let viewOpts = assign({}, options.views[view] ?? {}, input.views?.[view] ?? {});
|
|
1057
1087
|
parseOpts(viewOpts, this);
|
|
1058
1088
|
let opts = assign({}, commonOpts, viewOpts);
|
|
1059
1089
|
// Change view component when view changes
|
|
@@ -1104,7 +1134,7 @@ function parseOpts(opts, state) {
|
|
|
1104
1134
|
}
|
|
1105
1135
|
}
|
|
1106
1136
|
|
|
1107
|
-
/* packages/core/src/Buttons.svelte generated by Svelte
|
|
1137
|
+
/* packages/core/src/Buttons.svelte generated by Svelte v4.1.1 */
|
|
1108
1138
|
|
|
1109
1139
|
function get_each_context$2(ctx, list, i) {
|
|
1110
1140
|
const child_ctx = ctx.slice();
|
|
@@ -1112,12 +1142,12 @@ function get_each_context$2(ctx, list, i) {
|
|
|
1112
1142
|
return child_ctx;
|
|
1113
1143
|
}
|
|
1114
1144
|
|
|
1115
|
-
// (
|
|
1116
|
-
function
|
|
1117
|
-
let
|
|
1145
|
+
// (37:27)
|
|
1146
|
+
function create_if_block_4(ctx) {
|
|
1147
|
+
let button_1;
|
|
1118
1148
|
let t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[23]] + "";
|
|
1119
1149
|
let t;
|
|
1120
|
-
let
|
|
1150
|
+
let button_1_class_value;
|
|
1121
1151
|
let mounted;
|
|
1122
1152
|
let dispose;
|
|
1123
1153
|
|
|
@@ -1127,19 +1157,19 @@ function create_else_block$1(ctx) {
|
|
|
1127
1157
|
|
|
1128
1158
|
return {
|
|
1129
1159
|
c() {
|
|
1130
|
-
|
|
1160
|
+
button_1 = element("button");
|
|
1131
1161
|
t = text(t_value);
|
|
1132
1162
|
|
|
1133
|
-
attr(
|
|
1163
|
+
attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + (/*$view*/ ctx[6] === /*button*/ ctx[23]
|
|
1134
1164
|
? ' ' + /*$theme*/ ctx[3].active
|
|
1135
1165
|
: '') + " ec-" + /*button*/ ctx[23]));
|
|
1136
1166
|
},
|
|
1137
1167
|
m(target, anchor) {
|
|
1138
|
-
insert(target,
|
|
1139
|
-
append(
|
|
1168
|
+
insert(target, button_1, anchor);
|
|
1169
|
+
append(button_1, t);
|
|
1140
1170
|
|
|
1141
1171
|
if (!mounted) {
|
|
1142
|
-
dispose = listen(
|
|
1172
|
+
dispose = listen(button_1, "click", click_handler_1);
|
|
1143
1173
|
mounted = true;
|
|
1144
1174
|
}
|
|
1145
1175
|
},
|
|
@@ -1147,86 +1177,94 @@ function create_else_block$1(ctx) {
|
|
|
1147
1177
|
ctx = new_ctx;
|
|
1148
1178
|
if (dirty & /*$buttonText, buttons*/ 33 && t_value !== (t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[23]] + "")) set_data(t, t_value);
|
|
1149
1179
|
|
|
1150
|
-
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]
|
|
1151
1181
|
? ' ' + /*$theme*/ ctx[3].active
|
|
1152
1182
|
: '') + " ec-" + /*button*/ ctx[23]))) {
|
|
1153
|
-
attr(
|
|
1183
|
+
attr(button_1, "class", button_1_class_value);
|
|
1154
1184
|
}
|
|
1155
1185
|
},
|
|
1156
1186
|
d(detaching) {
|
|
1157
|
-
if (detaching)
|
|
1187
|
+
if (detaching) {
|
|
1188
|
+
detach(button_1);
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1158
1191
|
mounted = false;
|
|
1159
1192
|
dispose();
|
|
1160
1193
|
}
|
|
1161
1194
|
};
|
|
1162
1195
|
}
|
|
1163
1196
|
|
|
1164
|
-
// (
|
|
1165
|
-
function
|
|
1166
|
-
let
|
|
1197
|
+
// (35:32)
|
|
1198
|
+
function create_if_block_3(ctx) {
|
|
1199
|
+
let button_1;
|
|
1167
1200
|
let t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[23]] + "";
|
|
1168
1201
|
let t;
|
|
1169
|
-
let
|
|
1202
|
+
let button_1_class_value;
|
|
1170
1203
|
let mounted;
|
|
1171
1204
|
let dispose;
|
|
1172
1205
|
|
|
1173
1206
|
return {
|
|
1174
1207
|
c() {
|
|
1175
|
-
|
|
1208
|
+
button_1 = element("button");
|
|
1176
1209
|
t = text(t_value);
|
|
1177
|
-
attr(
|
|
1178
|
-
|
|
1210
|
+
attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]));
|
|
1211
|
+
button_1.disabled = /*isToday*/ ctx[1];
|
|
1179
1212
|
},
|
|
1180
1213
|
m(target, anchor) {
|
|
1181
|
-
insert(target,
|
|
1182
|
-
append(
|
|
1214
|
+
insert(target, button_1, anchor);
|
|
1215
|
+
append(button_1, t);
|
|
1183
1216
|
|
|
1184
1217
|
if (!mounted) {
|
|
1185
|
-
dispose = listen(
|
|
1218
|
+
dispose = listen(button_1, "click", /*click_handler*/ ctx[19]);
|
|
1186
1219
|
mounted = true;
|
|
1187
1220
|
}
|
|
1188
1221
|
},
|
|
1189
1222
|
p(ctx, dirty) {
|
|
1190
1223
|
if (dirty & /*$buttonText, buttons*/ 33 && t_value !== (t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[23]] + "")) set_data(t, t_value);
|
|
1191
1224
|
|
|
1192
|
-
if (dirty & /*$theme, buttons*/ 9 &&
|
|
1193
|
-
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);
|
|
1194
1227
|
}
|
|
1195
1228
|
|
|
1196
1229
|
if (dirty & /*isToday*/ 2) {
|
|
1197
|
-
|
|
1230
|
+
button_1.disabled = /*isToday*/ ctx[1];
|
|
1198
1231
|
}
|
|
1199
1232
|
},
|
|
1200
1233
|
d(detaching) {
|
|
1201
|
-
if (detaching)
|
|
1234
|
+
if (detaching) {
|
|
1235
|
+
detach(button_1);
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1202
1238
|
mounted = false;
|
|
1203
1239
|
dispose();
|
|
1204
1240
|
}
|
|
1205
1241
|
};
|
|
1206
1242
|
}
|
|
1207
1243
|
|
|
1208
|
-
// (
|
|
1209
|
-
function
|
|
1210
|
-
let
|
|
1244
|
+
// (33:31)
|
|
1245
|
+
function create_if_block_2(ctx) {
|
|
1246
|
+
let button_1;
|
|
1211
1247
|
let i;
|
|
1212
1248
|
let i_class_value;
|
|
1213
|
-
let
|
|
1249
|
+
let button_1_class_value;
|
|
1250
|
+
let button_1_aria_label_value;
|
|
1214
1251
|
let mounted;
|
|
1215
1252
|
let dispose;
|
|
1216
1253
|
|
|
1217
1254
|
return {
|
|
1218
1255
|
c() {
|
|
1219
|
-
|
|
1256
|
+
button_1 = element("button");
|
|
1220
1257
|
i = element("i");
|
|
1221
1258
|
attr(i, "class", i_class_value = "" + (/*$theme*/ ctx[3].icon + " ec-" + /*button*/ ctx[23]));
|
|
1222
|
-
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);
|
|
1223
1261
|
},
|
|
1224
1262
|
m(target, anchor) {
|
|
1225
|
-
insert(target,
|
|
1226
|
-
append(
|
|
1263
|
+
insert(target, button_1, anchor);
|
|
1264
|
+
append(button_1, i);
|
|
1227
1265
|
|
|
1228
1266
|
if (!mounted) {
|
|
1229
|
-
dispose = listen(
|
|
1267
|
+
dispose = listen(button_1, "click", /*next*/ ctx[17]);
|
|
1230
1268
|
mounted = true;
|
|
1231
1269
|
}
|
|
1232
1270
|
},
|
|
@@ -1235,40 +1273,49 @@ function create_if_block_3(ctx) {
|
|
|
1235
1273
|
attr(i, "class", i_class_value);
|
|
1236
1274
|
}
|
|
1237
1275
|
|
|
1238
|
-
if (dirty & /*$theme, buttons*/ 9 &&
|
|
1239
|
-
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);
|
|
1240
1282
|
}
|
|
1241
1283
|
},
|
|
1242
1284
|
d(detaching) {
|
|
1243
|
-
if (detaching)
|
|
1285
|
+
if (detaching) {
|
|
1286
|
+
detach(button_1);
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1244
1289
|
mounted = false;
|
|
1245
1290
|
dispose();
|
|
1246
1291
|
}
|
|
1247
1292
|
};
|
|
1248
1293
|
}
|
|
1249
1294
|
|
|
1250
|
-
// (
|
|
1251
|
-
function
|
|
1252
|
-
let
|
|
1295
|
+
// (31:31)
|
|
1296
|
+
function create_if_block_1(ctx) {
|
|
1297
|
+
let button_1;
|
|
1253
1298
|
let i;
|
|
1254
1299
|
let i_class_value;
|
|
1255
|
-
let
|
|
1300
|
+
let button_1_class_value;
|
|
1301
|
+
let button_1_aria_label_value;
|
|
1256
1302
|
let mounted;
|
|
1257
1303
|
let dispose;
|
|
1258
1304
|
|
|
1259
1305
|
return {
|
|
1260
1306
|
c() {
|
|
1261
|
-
|
|
1307
|
+
button_1 = element("button");
|
|
1262
1308
|
i = element("i");
|
|
1263
1309
|
attr(i, "class", i_class_value = "" + (/*$theme*/ ctx[3].icon + " ec-" + /*button*/ ctx[23]));
|
|
1264
|
-
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);
|
|
1265
1312
|
},
|
|
1266
1313
|
m(target, anchor) {
|
|
1267
|
-
insert(target,
|
|
1268
|
-
append(
|
|
1314
|
+
insert(target, button_1, anchor);
|
|
1315
|
+
append(button_1, i);
|
|
1269
1316
|
|
|
1270
1317
|
if (!mounted) {
|
|
1271
|
-
dispose = listen(
|
|
1318
|
+
dispose = listen(button_1, "click", /*prev*/ ctx[16]);
|
|
1272
1319
|
mounted = true;
|
|
1273
1320
|
}
|
|
1274
1321
|
},
|
|
@@ -1277,20 +1324,27 @@ function create_if_block_2(ctx) {
|
|
|
1277
1324
|
attr(i, "class", i_class_value);
|
|
1278
1325
|
}
|
|
1279
1326
|
|
|
1280
|
-
if (dirty & /*$theme, buttons*/ 9 &&
|
|
1281
|
-
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);
|
|
1282
1333
|
}
|
|
1283
1334
|
},
|
|
1284
1335
|
d(detaching) {
|
|
1285
|
-
if (detaching)
|
|
1336
|
+
if (detaching) {
|
|
1337
|
+
detach(button_1);
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1286
1340
|
mounted = false;
|
|
1287
1341
|
dispose();
|
|
1288
1342
|
}
|
|
1289
1343
|
};
|
|
1290
1344
|
}
|
|
1291
1345
|
|
|
1292
|
-
// (
|
|
1293
|
-
function
|
|
1346
|
+
// (29:4) {#if button == 'title'}
|
|
1347
|
+
function create_if_block$1(ctx) {
|
|
1294
1348
|
let h2;
|
|
1295
1349
|
let t;
|
|
1296
1350
|
let h2_class_value;
|
|
@@ -1313,47 +1367,43 @@ function create_if_block_1(ctx) {
|
|
|
1313
1367
|
}
|
|
1314
1368
|
},
|
|
1315
1369
|
d(detaching) {
|
|
1316
|
-
if (detaching)
|
|
1370
|
+
if (detaching) {
|
|
1371
|
+
detach(h2);
|
|
1372
|
+
}
|
|
1317
1373
|
}
|
|
1318
1374
|
};
|
|
1319
1375
|
}
|
|
1320
1376
|
|
|
1321
|
-
// (29:4) {#if button == ''}
|
|
1322
|
-
function create_if_block$1(ctx) {
|
|
1323
|
-
return { c: noop, m: noop, p: noop, d: noop };
|
|
1324
|
-
}
|
|
1325
|
-
|
|
1326
1377
|
// (28:0) {#each buttons as button}
|
|
1327
1378
|
function create_each_block$2(ctx) {
|
|
1328
1379
|
let if_block_anchor;
|
|
1329
1380
|
|
|
1330
1381
|
function select_block_type(ctx, dirty) {
|
|
1331
|
-
if (/*button*/ ctx[23] == '') return create_if_block$1;
|
|
1332
|
-
if (/*button*/ ctx[23] == '
|
|
1333
|
-
if (/*button*/ ctx[23] == '
|
|
1334
|
-
if (/*button*/ ctx[23]
|
|
1335
|
-
if (/*button*/ ctx[23]
|
|
1336
|
-
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;
|
|
1337
1387
|
}
|
|
1338
1388
|
|
|
1339
1389
|
let current_block_type = select_block_type(ctx);
|
|
1340
|
-
let if_block = current_block_type(ctx);
|
|
1390
|
+
let if_block = current_block_type && current_block_type(ctx);
|
|
1341
1391
|
|
|
1342
1392
|
return {
|
|
1343
1393
|
c() {
|
|
1344
|
-
if_block.c();
|
|
1394
|
+
if (if_block) if_block.c();
|
|
1345
1395
|
if_block_anchor = empty();
|
|
1346
1396
|
},
|
|
1347
1397
|
m(target, anchor) {
|
|
1348
|
-
if_block.m(target, anchor);
|
|
1398
|
+
if (if_block) if_block.m(target, anchor);
|
|
1349
1399
|
insert(target, if_block_anchor, anchor);
|
|
1350
1400
|
},
|
|
1351
1401
|
p(ctx, dirty) {
|
|
1352
1402
|
if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
|
|
1353
1403
|
if_block.p(ctx, dirty);
|
|
1354
1404
|
} else {
|
|
1355
|
-
if_block.d(1);
|
|
1356
|
-
if_block = current_block_type(ctx);
|
|
1405
|
+
if (if_block) if_block.d(1);
|
|
1406
|
+
if_block = current_block_type && current_block_type(ctx);
|
|
1357
1407
|
|
|
1358
1408
|
if (if_block) {
|
|
1359
1409
|
if_block.c();
|
|
@@ -1362,15 +1412,20 @@ function create_each_block$2(ctx) {
|
|
|
1362
1412
|
}
|
|
1363
1413
|
},
|
|
1364
1414
|
d(detaching) {
|
|
1365
|
-
|
|
1366
|
-
|
|
1415
|
+
if (detaching) {
|
|
1416
|
+
detach(if_block_anchor);
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1419
|
+
if (if_block) {
|
|
1420
|
+
if_block.d(detaching);
|
|
1421
|
+
}
|
|
1367
1422
|
}
|
|
1368
1423
|
};
|
|
1369
1424
|
}
|
|
1370
1425
|
|
|
1371
1426
|
function create_fragment$3(ctx) {
|
|
1372
1427
|
let each_1_anchor;
|
|
1373
|
-
let each_value = /*buttons*/ ctx[0];
|
|
1428
|
+
let each_value = ensure_array_like(/*buttons*/ ctx[0]);
|
|
1374
1429
|
let each_blocks = [];
|
|
1375
1430
|
|
|
1376
1431
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
@@ -1395,8 +1450,8 @@ function create_fragment$3(ctx) {
|
|
|
1395
1450
|
insert(target, each_1_anchor, anchor);
|
|
1396
1451
|
},
|
|
1397
1452
|
p(ctx, [dirty]) {
|
|
1398
|
-
if (dirty &
|
|
1399
|
-
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]);
|
|
1400
1455
|
let i;
|
|
1401
1456
|
|
|
1402
1457
|
for (i = 0; i < each_value.length; i += 1) {
|
|
@@ -1421,8 +1476,11 @@ function create_fragment$3(ctx) {
|
|
|
1421
1476
|
i: noop,
|
|
1422
1477
|
o: noop,
|
|
1423
1478
|
d(detaching) {
|
|
1479
|
+
if (detaching) {
|
|
1480
|
+
detach(each_1_anchor);
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1424
1483
|
destroy_each(each_blocks, detaching);
|
|
1425
|
-
if (detaching) detach(each_1_anchor);
|
|
1426
1484
|
}
|
|
1427
1485
|
};
|
|
1428
1486
|
}
|
|
@@ -1509,7 +1567,7 @@ class Buttons extends SvelteComponent {
|
|
|
1509
1567
|
}
|
|
1510
1568
|
}
|
|
1511
1569
|
|
|
1512
|
-
/* packages/core/src/Toolbar.svelte generated by Svelte
|
|
1570
|
+
/* packages/core/src/Toolbar.svelte generated by Svelte v4.1.1 */
|
|
1513
1571
|
|
|
1514
1572
|
function get_each_context$1(ctx, list, i) {
|
|
1515
1573
|
const child_ctx = ctx.slice();
|
|
@@ -1525,34 +1583,34 @@ function get_each_context_1(ctx, list, i) {
|
|
|
1525
1583
|
|
|
1526
1584
|
// (28:16) {:else}
|
|
1527
1585
|
function create_else_block(ctx) {
|
|
1528
|
-
let
|
|
1586
|
+
let buttons_1;
|
|
1529
1587
|
let current;
|
|
1530
|
-
|
|
1588
|
+
buttons_1 = new Buttons({ props: { buttons: /*buttons*/ ctx[8] } });
|
|
1531
1589
|
|
|
1532
1590
|
return {
|
|
1533
1591
|
c() {
|
|
1534
|
-
create_component(
|
|
1592
|
+
create_component(buttons_1.$$.fragment);
|
|
1535
1593
|
},
|
|
1536
1594
|
m(target, anchor) {
|
|
1537
|
-
mount_component(
|
|
1595
|
+
mount_component(buttons_1, target, anchor);
|
|
1538
1596
|
current = true;
|
|
1539
1597
|
},
|
|
1540
1598
|
p(ctx, dirty) {
|
|
1541
|
-
const
|
|
1542
|
-
if (dirty & /*sections*/ 1)
|
|
1543
|
-
|
|
1599
|
+
const buttons_1_changes = {};
|
|
1600
|
+
if (dirty & /*sections*/ 1) buttons_1_changes.buttons = /*buttons*/ ctx[8];
|
|
1601
|
+
buttons_1.$set(buttons_1_changes);
|
|
1544
1602
|
},
|
|
1545
1603
|
i(local) {
|
|
1546
1604
|
if (current) return;
|
|
1547
|
-
transition_in(
|
|
1605
|
+
transition_in(buttons_1.$$.fragment, local);
|
|
1548
1606
|
current = true;
|
|
1549
1607
|
},
|
|
1550
1608
|
o(local) {
|
|
1551
|
-
transition_out(
|
|
1609
|
+
transition_out(buttons_1.$$.fragment, local);
|
|
1552
1610
|
current = false;
|
|
1553
1611
|
},
|
|
1554
1612
|
d(detaching) {
|
|
1555
|
-
destroy_component(
|
|
1613
|
+
destroy_component(buttons_1, detaching);
|
|
1556
1614
|
}
|
|
1557
1615
|
};
|
|
1558
1616
|
}
|
|
@@ -1560,26 +1618,26 @@ function create_else_block(ctx) {
|
|
|
1560
1618
|
// (24:16) {#if buttons.length > 1}
|
|
1561
1619
|
function create_if_block(ctx) {
|
|
1562
1620
|
let div;
|
|
1563
|
-
let
|
|
1621
|
+
let buttons_1;
|
|
1564
1622
|
let div_class_value;
|
|
1565
1623
|
let current;
|
|
1566
|
-
|
|
1624
|
+
buttons_1 = new Buttons({ props: { buttons: /*buttons*/ ctx[8] } });
|
|
1567
1625
|
|
|
1568
1626
|
return {
|
|
1569
1627
|
c() {
|
|
1570
1628
|
div = element("div");
|
|
1571
|
-
create_component(
|
|
1629
|
+
create_component(buttons_1.$$.fragment);
|
|
1572
1630
|
attr(div, "class", div_class_value = /*$theme*/ ctx[1].buttonGroup);
|
|
1573
1631
|
},
|
|
1574
1632
|
m(target, anchor) {
|
|
1575
1633
|
insert(target, div, anchor);
|
|
1576
|
-
mount_component(
|
|
1634
|
+
mount_component(buttons_1, div, null);
|
|
1577
1635
|
current = true;
|
|
1578
1636
|
},
|
|
1579
1637
|
p(ctx, dirty) {
|
|
1580
|
-
const
|
|
1581
|
-
if (dirty & /*sections*/ 1)
|
|
1582
|
-
|
|
1638
|
+
const buttons_1_changes = {};
|
|
1639
|
+
if (dirty & /*sections*/ 1) buttons_1_changes.buttons = /*buttons*/ ctx[8];
|
|
1640
|
+
buttons_1.$set(buttons_1_changes);
|
|
1583
1641
|
|
|
1584
1642
|
if (!current || dirty & /*$theme*/ 2 && div_class_value !== (div_class_value = /*$theme*/ ctx[1].buttonGroup)) {
|
|
1585
1643
|
attr(div, "class", div_class_value);
|
|
@@ -1587,16 +1645,19 @@ function create_if_block(ctx) {
|
|
|
1587
1645
|
},
|
|
1588
1646
|
i(local) {
|
|
1589
1647
|
if (current) return;
|
|
1590
|
-
transition_in(
|
|
1648
|
+
transition_in(buttons_1.$$.fragment, local);
|
|
1591
1649
|
current = true;
|
|
1592
1650
|
},
|
|
1593
1651
|
o(local) {
|
|
1594
|
-
transition_out(
|
|
1652
|
+
transition_out(buttons_1.$$.fragment, local);
|
|
1595
1653
|
current = false;
|
|
1596
1654
|
},
|
|
1597
1655
|
d(detaching) {
|
|
1598
|
-
if (detaching)
|
|
1599
|
-
|
|
1656
|
+
if (detaching) {
|
|
1657
|
+
detach(div);
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
destroy_component(buttons_1);
|
|
1600
1661
|
}
|
|
1601
1662
|
};
|
|
1602
1663
|
}
|
|
@@ -1665,8 +1726,11 @@ function create_each_block_1(ctx) {
|
|
|
1665
1726
|
current = false;
|
|
1666
1727
|
},
|
|
1667
1728
|
d(detaching) {
|
|
1729
|
+
if (detaching) {
|
|
1730
|
+
detach(if_block_anchor);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1668
1733
|
if_blocks[current_block_type_index].d(detaching);
|
|
1669
|
-
if (detaching) detach(if_block_anchor);
|
|
1670
1734
|
}
|
|
1671
1735
|
};
|
|
1672
1736
|
}
|
|
@@ -1676,7 +1740,7 @@ function create_each_block$1(ctx) {
|
|
|
1676
1740
|
let div;
|
|
1677
1741
|
let t;
|
|
1678
1742
|
let current;
|
|
1679
|
-
let each_value_1 = /*sections*/ ctx[0][/*key*/ ctx[5]];
|
|
1743
|
+
let each_value_1 = ensure_array_like(/*sections*/ ctx[0][/*key*/ ctx[5]]);
|
|
1680
1744
|
let each_blocks = [];
|
|
1681
1745
|
|
|
1682
1746
|
for (let i = 0; i < each_value_1.length; i += 1) {
|
|
@@ -1711,7 +1775,7 @@ function create_each_block$1(ctx) {
|
|
|
1711
1775
|
},
|
|
1712
1776
|
p(ctx, dirty) {
|
|
1713
1777
|
if (dirty & /*$theme, sections, Object*/ 3) {
|
|
1714
|
-
each_value_1 = /*sections*/ ctx[0][/*key*/ ctx[5]];
|
|
1778
|
+
each_value_1 = ensure_array_like(/*sections*/ ctx[0][/*key*/ ctx[5]]);
|
|
1715
1779
|
let i;
|
|
1716
1780
|
|
|
1717
1781
|
for (i = 0; i < each_value_1.length; i += 1) {
|
|
@@ -1756,7 +1820,10 @@ function create_each_block$1(ctx) {
|
|
|
1756
1820
|
current = false;
|
|
1757
1821
|
},
|
|
1758
1822
|
d(detaching) {
|
|
1759
|
-
if (detaching)
|
|
1823
|
+
if (detaching) {
|
|
1824
|
+
detach(div);
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1760
1827
|
destroy_each(each_blocks, detaching);
|
|
1761
1828
|
}
|
|
1762
1829
|
};
|
|
@@ -1766,7 +1833,7 @@ function create_fragment$2(ctx) {
|
|
|
1766
1833
|
let div;
|
|
1767
1834
|
let div_class_value;
|
|
1768
1835
|
let current;
|
|
1769
|
-
let each_value = Object.keys(/*sections*/ ctx[0]);
|
|
1836
|
+
let each_value = ensure_array_like(Object.keys(/*sections*/ ctx[0]));
|
|
1770
1837
|
let each_blocks = [];
|
|
1771
1838
|
|
|
1772
1839
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
@@ -1800,7 +1867,7 @@ function create_fragment$2(ctx) {
|
|
|
1800
1867
|
},
|
|
1801
1868
|
p(ctx, [dirty]) {
|
|
1802
1869
|
if (dirty & /*sections, Object, $theme*/ 3) {
|
|
1803
|
-
each_value = Object.keys(/*sections*/ ctx[0]);
|
|
1870
|
+
each_value = ensure_array_like(Object.keys(/*sections*/ ctx[0]));
|
|
1804
1871
|
let i;
|
|
1805
1872
|
|
|
1806
1873
|
for (i = 0; i < each_value.length; i += 1) {
|
|
@@ -1849,7 +1916,10 @@ function create_fragment$2(ctx) {
|
|
|
1849
1916
|
current = false;
|
|
1850
1917
|
},
|
|
1851
1918
|
d(detaching) {
|
|
1852
|
-
if (detaching)
|
|
1919
|
+
if (detaching) {
|
|
1920
|
+
detach(div);
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1853
1923
|
destroy_each(each_blocks, detaching);
|
|
1854
1924
|
}
|
|
1855
1925
|
};
|
|
@@ -1883,7 +1953,7 @@ class Toolbar extends SvelteComponent {
|
|
|
1883
1953
|
}
|
|
1884
1954
|
}
|
|
1885
1955
|
|
|
1886
|
-
/* packages/core/src/Auxiliary.svelte generated by Svelte
|
|
1956
|
+
/* packages/core/src/Auxiliary.svelte generated by Svelte v4.1.1 */
|
|
1887
1957
|
|
|
1888
1958
|
function get_each_context(ctx, list, i) {
|
|
1889
1959
|
const child_ctx = ctx.slice();
|
|
@@ -1898,7 +1968,7 @@ function create_each_block(ctx) {
|
|
|
1898
1968
|
let current;
|
|
1899
1969
|
var switch_value = /*component*/ ctx[11];
|
|
1900
1970
|
|
|
1901
|
-
function switch_props(ctx) {
|
|
1971
|
+
function switch_props(ctx, dirty) {
|
|
1902
1972
|
return {};
|
|
1903
1973
|
}
|
|
1904
1974
|
|
|
@@ -1949,7 +2019,10 @@ function create_each_block(ctx) {
|
|
|
1949
2019
|
current = false;
|
|
1950
2020
|
},
|
|
1951
2021
|
d(detaching) {
|
|
1952
|
-
if (detaching)
|
|
2022
|
+
if (detaching) {
|
|
2023
|
+
detach(switch_instance_anchor);
|
|
2024
|
+
}
|
|
2025
|
+
|
|
1953
2026
|
if (switch_instance) destroy_component(switch_instance, detaching);
|
|
1954
2027
|
}
|
|
1955
2028
|
};
|
|
@@ -1958,7 +2031,7 @@ function create_each_block(ctx) {
|
|
|
1958
2031
|
function create_fragment$1(ctx) {
|
|
1959
2032
|
let each_1_anchor;
|
|
1960
2033
|
let current;
|
|
1961
|
-
let each_value = /*$_auxiliary*/ ctx[0];
|
|
2034
|
+
let each_value = ensure_array_like(/*$_auxiliary*/ ctx[0]);
|
|
1962
2035
|
let each_blocks = [];
|
|
1963
2036
|
|
|
1964
2037
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
@@ -1989,7 +2062,7 @@ function create_fragment$1(ctx) {
|
|
|
1989
2062
|
},
|
|
1990
2063
|
p(ctx, [dirty]) {
|
|
1991
2064
|
if (dirty & /*$_auxiliary*/ 1) {
|
|
1992
|
-
each_value = /*$_auxiliary*/ ctx[0];
|
|
2065
|
+
each_value = ensure_array_like(/*$_auxiliary*/ ctx[0]);
|
|
1993
2066
|
let i;
|
|
1994
2067
|
|
|
1995
2068
|
for (i = 0; i < each_value.length; i += 1) {
|
|
@@ -2034,8 +2107,11 @@ function create_fragment$1(ctx) {
|
|
|
2034
2107
|
current = false;
|
|
2035
2108
|
},
|
|
2036
2109
|
d(detaching) {
|
|
2110
|
+
if (detaching) {
|
|
2111
|
+
detach(each_1_anchor);
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2037
2114
|
destroy_each(each_blocks, detaching);
|
|
2038
|
-
if (detaching) detach(each_1_anchor);
|
|
2039
2115
|
}
|
|
2040
2116
|
};
|
|
2041
2117
|
}
|
|
@@ -2085,7 +2161,7 @@ class Auxiliary extends SvelteComponent {
|
|
|
2085
2161
|
}
|
|
2086
2162
|
}
|
|
2087
2163
|
|
|
2088
|
-
/* packages/core/src/Calendar.svelte generated by Svelte
|
|
2164
|
+
/* packages/core/src/Calendar.svelte generated by Svelte v4.1.1 */
|
|
2089
2165
|
|
|
2090
2166
|
function create_fragment(ctx) {
|
|
2091
2167
|
let div;
|
|
@@ -2101,7 +2177,7 @@ function create_fragment(ctx) {
|
|
|
2101
2177
|
toolbar = new Toolbar({});
|
|
2102
2178
|
var switch_value = /*$_viewComponent*/ ctx[5];
|
|
2103
2179
|
|
|
2104
|
-
function switch_props(ctx) {
|
|
2180
|
+
function switch_props(ctx, dirty) {
|
|
2105
2181
|
return {};
|
|
2106
2182
|
}
|
|
2107
2183
|
|
|
@@ -2195,10 +2271,13 @@ function create_fragment(ctx) {
|
|
|
2195
2271
|
current = false;
|
|
2196
2272
|
},
|
|
2197
2273
|
d(detaching) {
|
|
2198
|
-
if (detaching)
|
|
2274
|
+
if (detaching) {
|
|
2275
|
+
detach(div);
|
|
2276
|
+
detach(t1);
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2199
2279
|
destroy_component(toolbar);
|
|
2200
2280
|
if (switch_instance) destroy_component(switch_instance);
|
|
2201
|
-
if (detaching) detach(t1);
|
|
2202
2281
|
destroy_component(auxiliary, detaching);
|
|
2203
2282
|
mounted = false;
|
|
2204
2283
|
dispose();
|
|
@@ -2473,4 +2552,4 @@ class Calendar extends SvelteComponent {
|
|
|
2473
2552
|
}
|
|
2474
2553
|
}
|
|
2475
2554
|
|
|
2476
|
-
export { DAY_IN_SECONDS, addDay, addDuration, ancestor, assign, bgEvent, 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, max, min, nextClosestDay, noTimePart, outsideEvent, pointerEvent, 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.5.
|
|
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/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.js
CHANGED
package/src/storage/state.js
CHANGED
|
@@ -72,7 +72,7 @@ export default class {
|
|
|
72
72
|
parseOpts(commonOpts, this);
|
|
73
73
|
let views = new Set([...Object.keys(options.views), ...Object.keys(input.views || {})]);
|
|
74
74
|
for (let view of views) {
|
|
75
|
-
let viewOpts = assign({}, options.views[view]
|
|
75
|
+
let viewOpts = assign({}, options.views[view] ?? {}, input.views?.[view] ?? {});
|
|
76
76
|
parseOpts(viewOpts, this);
|
|
77
77
|
let opts = assign({}, commonOpts, viewOpts);
|
|
78
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) {
|