@event-calendar/core 2.6.1 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,6 +22,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options
22
22
  - [allDayContent](#alldaycontent)
23
23
  - [allDaySlot](#alldayslot)
24
24
  - [buttonText](#buttontext)
25
+ - [customButtons](#custombuttons)
25
26
  - [date](#date)
26
27
  - [dateClick](#dateclick)
27
28
  - [datesAboveResources](#datesaboveresources)
@@ -45,9 +46,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options
45
46
  - [eventDidMount](#eventdidmount)
46
47
  - [eventDragMinDistance](#eventdragmindistance)
47
48
  - [eventDragStart](#eventdragstart)
48
- - [eventDragStop](#eventdragstop)
49
49
  </td><td>
50
50
 
51
+ - [eventDragStop](#eventdragstop)
51
52
  - [eventDrop](#eventdrop)
52
53
  - [eventDurationEditable](#eventdurationeditable)
53
54
  - [eventLongPressDelay](#eventlongpressdelay)
@@ -74,9 +75,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options
74
75
  - [locale](#locale)
75
76
  - [longPressDelay](#longpressdelay)
76
77
  - [moreLinkContent](#morelinkcontent)
77
- - [noEventsClick](#noeventsclick)
78
78
  </td><td>
79
79
 
80
+ - [noEventsClick](#noeventsclick)
80
81
  - [noEventsContent](#noeventscontent)
81
82
  - [nowIndicator](#nowindicator)
82
83
  - [pointer](#pointer)
@@ -199,8 +200,8 @@ import '@event-calendar/core/index.css';
199
200
  ### Pre-built browser ready bundle
200
201
  Include the following lines of code in the `<head>` section of your page:
201
202
  ```html
202
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@2.6.1/event-calendar.min.css">
203
- <script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@2.6.1/event-calendar.min.js"></script>
203
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@2.7.0/event-calendar.min.css">
204
+ <script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@2.7.0/event-calendar.min.js"></script>
204
205
  ```
205
206
 
206
207
  <details>
@@ -321,6 +322,54 @@ function (text) {
321
322
  </tr>
322
323
  </table>
323
324
 
325
+ ### customButtons
326
+ - Type `object`
327
+ - Default `undefined`
328
+
329
+ Defines custom buttons that can be used in the [headerToolbar](#headertoolbar).
330
+
331
+ First, specify the custom buttons as key-value pairs. Then reference them from the `headerToolbar` option.
332
+
333
+ <details>
334
+ <summary>Example</summary>
335
+
336
+ ```js
337
+ let options = {
338
+ customButtons: {
339
+ myCustomButton: {
340
+ text: 'custom!',
341
+ click: function() {
342
+ alert('clicked the custom button!');
343
+ }
344
+ }
345
+ },
346
+ headerToolbar: {
347
+ start: 'title myCustomButton',
348
+ center: '',
349
+ end: 'today prev,next'
350
+ }
351
+ };
352
+ ```
353
+ </details>
354
+
355
+ Each `customButton` entry accepts the following properties:
356
+ <table>
357
+ <tr>
358
+ <td>
359
+
360
+ `text `
361
+ </td>
362
+ <td>The text to be display on the button itself</td>
363
+ </tr>
364
+ <tr>
365
+ <td>
366
+
367
+ `click`
368
+ </td>
369
+ <td>A callback function that is called when the button is clicked. Accepts one argument <a href="https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent">mouseEvent</a></td>
370
+ </tr>
371
+ </table>
372
+
324
373
  ### date
325
374
  - Type `Date` or `string`
326
375
  - Default `new Date()`
@@ -1288,7 +1337,7 @@ This option is used instead of the `events` option.
1288
1337
  </td>
1289
1338
  <td>
1290
1339
 
1291
- A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data
1340
+ A URL that the calendar will fetch [Event](#event-object) objects from. HTTP requests with the following parameters will be sent to this URL whenever the calendar needs new event data:
1292
1341
  <table>
1293
1342
  <tr>
1294
1343
  <td>
package/index.js CHANGED
@@ -673,6 +673,7 @@ function createOptions(plugins) {
673
673
  buttonText: {
674
674
  today: 'today',
675
675
  },
676
+ customButtons: {},
676
677
  date: new Date(),
677
678
  datesSet: undefined,
678
679
  dayHeaderFormat: {
@@ -1169,25 +1170,25 @@ function validKey(key, state) {
1169
1170
  return state.hasOwnProperty(key) && key[0] !== '_';
1170
1171
  }
1171
1172
 
1172
- /* packages/core/src/Buttons.svelte generated by Svelte v4.2.8 */
1173
+ /* packages/core/src/Buttons.svelte generated by Svelte v4.2.16 */
1173
1174
 
1174
1175
  function get_each_context$2(ctx, list, i) {
1175
1176
  const child_ctx = ctx.slice();
1176
- child_ctx[23] = list[i];
1177
+ child_ctx[25] = list[i];
1177
1178
  return child_ctx;
1178
1179
  }
1179
1180
 
1180
- // (52:27)
1181
- function create_if_block_4(ctx) {
1181
+ // (57:27)
1182
+ function create_if_block_5(ctx) {
1182
1183
  let button_1;
1183
- let t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[23]] + "";
1184
+ let t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[25]] + "";
1184
1185
  let t;
1185
1186
  let button_1_class_value;
1186
1187
  let mounted;
1187
1188
  let dispose;
1188
1189
 
1189
1190
  function click_handler_1() {
1190
- return /*click_handler_1*/ ctx[20](/*button*/ ctx[23]);
1191
+ return /*click_handler_1*/ ctx[22](/*button*/ ctx[25]);
1191
1192
  }
1192
1193
 
1193
1194
  return {
@@ -1195,9 +1196,9 @@ function create_if_block_4(ctx) {
1195
1196
  button_1 = element("button");
1196
1197
  t = text(t_value);
1197
1198
 
1198
- attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + (/*$view*/ ctx[6] === /*button*/ ctx[23]
1199
+ attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + (/*$view*/ ctx[7] === /*button*/ ctx[25]
1199
1200
  ? ' ' + /*$theme*/ ctx[3].active
1200
- : '') + " ec-" + /*button*/ ctx[23]));
1201
+ : '') + " ec-" + /*button*/ ctx[25]));
1201
1202
  },
1202
1203
  m(target, anchor) {
1203
1204
  insert(target, button_1, anchor);
@@ -1210,11 +1211,57 @@ function create_if_block_4(ctx) {
1210
1211
  },
1211
1212
  p(new_ctx, dirty) {
1212
1213
  ctx = new_ctx;
1213
- if (dirty & /*$buttonText, buttons*/ 33 && t_value !== (t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[23]] + "")) set_data(t, t_value);
1214
+ if (dirty & /*$buttonText, buttons*/ 33 && t_value !== (t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[25]] + "")) set_data(t, t_value);
1214
1215
 
1215
- if (dirty & /*$theme, $view, buttons*/ 73 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + (/*$view*/ ctx[6] === /*button*/ ctx[23]
1216
+ if (dirty & /*$theme, $view, buttons*/ 137 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + (/*$view*/ ctx[7] === /*button*/ ctx[25]
1216
1217
  ? ' ' + /*$theme*/ ctx[3].active
1217
- : '') + " ec-" + /*button*/ ctx[23]))) {
1218
+ : '') + " ec-" + /*button*/ ctx[25]))) {
1219
+ attr(button_1, "class", button_1_class_value);
1220
+ }
1221
+ },
1222
+ d(detaching) {
1223
+ if (detaching) {
1224
+ detach(button_1);
1225
+ }
1226
+
1227
+ mounted = false;
1228
+ dispose();
1229
+ }
1230
+ };
1231
+ }
1232
+
1233
+ // (52:37)
1234
+ function create_if_block_4(ctx) {
1235
+ let button_1;
1236
+ let t_value = /*$customButtons*/ ctx[6][/*button*/ ctx[25]].text + "";
1237
+ let t;
1238
+ let button_1_class_value;
1239
+ let mounted;
1240
+ let dispose;
1241
+
1242
+ return {
1243
+ c() {
1244
+ button_1 = element("button");
1245
+ t = text(t_value);
1246
+ attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[25]));
1247
+ },
1248
+ m(target, anchor) {
1249
+ insert(target, button_1, anchor);
1250
+ append(button_1, t);
1251
+
1252
+ if (!mounted) {
1253
+ dispose = listen(button_1, "click", function () {
1254
+ if (is_function(/*$customButtons*/ ctx[6][/*button*/ ctx[25]].click)) /*$customButtons*/ ctx[6][/*button*/ ctx[25]].click.apply(this, arguments);
1255
+ });
1256
+
1257
+ mounted = true;
1258
+ }
1259
+ },
1260
+ p(new_ctx, dirty) {
1261
+ ctx = new_ctx;
1262
+ if (dirty & /*$customButtons, buttons*/ 65 && t_value !== (t_value = /*$customButtons*/ ctx[6][/*button*/ ctx[25]].text + "")) set_data(t, t_value);
1263
+
1264
+ if (dirty & /*$theme, buttons*/ 9 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[25]))) {
1218
1265
  attr(button_1, "class", button_1_class_value);
1219
1266
  }
1220
1267
  },
@@ -1232,7 +1279,7 @@ function create_if_block_4(ctx) {
1232
1279
  // (46:32)
1233
1280
  function create_if_block_3(ctx) {
1234
1281
  let button_1;
1235
- let t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[23]] + "";
1282
+ let t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[25]] + "";
1236
1283
  let t;
1237
1284
  let button_1_class_value;
1238
1285
  let mounted;
@@ -1242,7 +1289,7 @@ function create_if_block_3(ctx) {
1242
1289
  c() {
1243
1290
  button_1 = element("button");
1244
1291
  t = text(t_value);
1245
- attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]));
1292
+ attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[25]));
1246
1293
  button_1.disabled = /*isToday*/ ctx[1];
1247
1294
  },
1248
1295
  m(target, anchor) {
@@ -1250,14 +1297,14 @@ function create_if_block_3(ctx) {
1250
1297
  append(button_1, t);
1251
1298
 
1252
1299
  if (!mounted) {
1253
- dispose = listen(button_1, "click", /*click_handler*/ ctx[19]);
1300
+ dispose = listen(button_1, "click", /*click_handler*/ ctx[21]);
1254
1301
  mounted = true;
1255
1302
  }
1256
1303
  },
1257
1304
  p(ctx, dirty) {
1258
- if (dirty & /*$buttonText, buttons*/ 33 && t_value !== (t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[23]] + "")) set_data(t, t_value);
1305
+ if (dirty & /*$buttonText, buttons*/ 33 && t_value !== (t_value = /*$buttonText*/ ctx[5][/*button*/ ctx[25]] + "")) set_data(t, t_value);
1259
1306
 
1260
- if (dirty & /*$theme, buttons*/ 9 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]))) {
1307
+ if (dirty & /*$theme, buttons*/ 9 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[25]))) {
1261
1308
  attr(button_1, "class", button_1_class_value);
1262
1309
  }
1263
1310
 
@@ -1291,8 +1338,8 @@ function create_if_block_2(ctx) {
1291
1338
  c() {
1292
1339
  button_1 = element("button");
1293
1340
  i = element("i");
1294
- attr(i, "class", i_class_value = "" + (/*$theme*/ ctx[3].icon + " ec-" + /*button*/ ctx[23]));
1295
- attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]));
1341
+ attr(i, "class", i_class_value = "" + (/*$theme*/ ctx[3].icon + " ec-" + /*button*/ ctx[25]));
1342
+ attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[25]));
1296
1343
  attr(button_1, "aria-label", button_1_aria_label_value = /*$buttonText*/ ctx[5].next);
1297
1344
  attr(button_1, "title", button_1_title_value = /*$buttonText*/ ctx[5].next);
1298
1345
  },
@@ -1301,16 +1348,16 @@ function create_if_block_2(ctx) {
1301
1348
  append(button_1, i);
1302
1349
 
1303
1350
  if (!mounted) {
1304
- dispose = listen(button_1, "click", /*next*/ ctx[17]);
1351
+ dispose = listen(button_1, "click", /*next*/ ctx[19]);
1305
1352
  mounted = true;
1306
1353
  }
1307
1354
  },
1308
1355
  p(ctx, dirty) {
1309
- if (dirty & /*$theme, buttons*/ 9 && i_class_value !== (i_class_value = "" + (/*$theme*/ ctx[3].icon + " ec-" + /*button*/ ctx[23]))) {
1356
+ if (dirty & /*$theme, buttons*/ 9 && i_class_value !== (i_class_value = "" + (/*$theme*/ ctx[3].icon + " ec-" + /*button*/ ctx[25]))) {
1310
1357
  attr(i, "class", i_class_value);
1311
1358
  }
1312
1359
 
1313
- if (dirty & /*$theme, buttons*/ 9 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]))) {
1360
+ if (dirty & /*$theme, buttons*/ 9 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[25]))) {
1314
1361
  attr(button_1, "class", button_1_class_value);
1315
1362
  }
1316
1363
 
@@ -1348,8 +1395,8 @@ function create_if_block_1(ctx) {
1348
1395
  c() {
1349
1396
  button_1 = element("button");
1350
1397
  i = element("i");
1351
- attr(i, "class", i_class_value = "" + (/*$theme*/ ctx[3].icon + " ec-" + /*button*/ ctx[23]));
1352
- attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]));
1398
+ attr(i, "class", i_class_value = "" + (/*$theme*/ ctx[3].icon + " ec-" + /*button*/ ctx[25]));
1399
+ attr(button_1, "class", button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[25]));
1353
1400
  attr(button_1, "aria-label", button_1_aria_label_value = /*$buttonText*/ ctx[5].prev);
1354
1401
  attr(button_1, "title", button_1_title_value = /*$buttonText*/ ctx[5].prev);
1355
1402
  },
@@ -1358,16 +1405,16 @@ function create_if_block_1(ctx) {
1358
1405
  append(button_1, i);
1359
1406
 
1360
1407
  if (!mounted) {
1361
- dispose = listen(button_1, "click", /*prev*/ ctx[16]);
1408
+ dispose = listen(button_1, "click", /*prev*/ ctx[18]);
1362
1409
  mounted = true;
1363
1410
  }
1364
1411
  },
1365
1412
  p(ctx, dirty) {
1366
- if (dirty & /*$theme, buttons*/ 9 && i_class_value !== (i_class_value = "" + (/*$theme*/ ctx[3].icon + " ec-" + /*button*/ ctx[23]))) {
1413
+ if (dirty & /*$theme, buttons*/ 9 && i_class_value !== (i_class_value = "" + (/*$theme*/ ctx[3].icon + " ec-" + /*button*/ ctx[25]))) {
1367
1414
  attr(i, "class", i_class_value);
1368
1415
  }
1369
1416
 
1370
- if (dirty & /*$theme, buttons*/ 9 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[23]))) {
1417
+ if (dirty & /*$theme, buttons*/ 9 && button_1_class_value !== (button_1_class_value = "" + (/*$theme*/ ctx[3].button + " ec-" + /*button*/ ctx[25]))) {
1371
1418
  attr(button_1, "class", button_1_class_value);
1372
1419
  }
1373
1420
 
@@ -1434,11 +1481,12 @@ function create_each_block$2(ctx) {
1434
1481
  let if_block_anchor;
1435
1482
 
1436
1483
  function select_block_type(ctx, dirty) {
1437
- if (/*button*/ ctx[23] == 'title') return create_if_block$1;
1438
- if (/*button*/ ctx[23] == 'prev') return create_if_block_1;
1439
- if (/*button*/ ctx[23] == 'next') return create_if_block_2;
1440
- if (/*button*/ ctx[23] == 'today') return create_if_block_3;
1441
- if (/*button*/ ctx[23] != '') return create_if_block_4;
1484
+ if (/*button*/ ctx[25] == 'title') return create_if_block$1;
1485
+ if (/*button*/ ctx[25] == 'prev') return create_if_block_1;
1486
+ if (/*button*/ ctx[25] == 'next') return create_if_block_2;
1487
+ if (/*button*/ ctx[25] == 'today') return create_if_block_3;
1488
+ if (/*$customButtons*/ ctx[6][/*button*/ ctx[25]]) return create_if_block_4;
1489
+ if (/*button*/ ctx[25] != '') return create_if_block_5;
1442
1490
  }
1443
1491
 
1444
1492
  let current_block_type = select_block_type(ctx);
@@ -1505,7 +1553,7 @@ function create_fragment$3(ctx) {
1505
1553
  insert(target, each_1_anchor, anchor);
1506
1554
  },
1507
1555
  p(ctx, [dirty]) {
1508
- if (dirty & /*$theme, $_viewTitle, buttons, $buttonText, prev, next, isToday, $date, today, $view*/ 229503) {
1556
+ if (dirty & /*$theme, $_viewTitle, buttons, $buttonText, prev, next, isToday, $date, today, $customButtons, $view*/ 917759) {
1509
1557
  each_value = ensure_array_like(/*buttons*/ ctx[0]);
1510
1558
  let i;
1511
1559
 
@@ -1548,17 +1596,19 @@ function instance$3($$self, $$props, $$invalidate) {
1548
1596
  let $theme;
1549
1597
  let $_viewTitle;
1550
1598
  let $buttonText;
1599
+ let $customButtons;
1551
1600
  let $view;
1552
1601
  let { buttons } = $$props;
1553
- let { _currentRange, _viewTitle, buttonText, date, duration, hiddenDays, theme, view } = getContext('state');
1554
- component_subscribe($$self, _currentRange, value => $$invalidate(18, $_currentRange = value));
1602
+ let { _currentRange, _viewTitle, buttonText, customButtons, date, duration, hiddenDays, theme, view } = getContext('state');
1603
+ component_subscribe($$self, _currentRange, value => $$invalidate(20, $_currentRange = value));
1555
1604
  component_subscribe($$self, _viewTitle, value => $$invalidate(4, $_viewTitle = value));
1556
1605
  component_subscribe($$self, buttonText, value => $$invalidate(5, $buttonText = value));
1606
+ component_subscribe($$self, customButtons, value => $$invalidate(6, $customButtons = value));
1557
1607
  component_subscribe($$self, date, value => $$invalidate(2, $date = value));
1558
- component_subscribe($$self, duration, value => $$invalidate(21, $duration = value));
1559
- component_subscribe($$self, hiddenDays, value => $$invalidate(22, $hiddenDays = value));
1608
+ component_subscribe($$self, duration, value => $$invalidate(23, $duration = value));
1609
+ component_subscribe($$self, hiddenDays, value => $$invalidate(24, $hiddenDays = value));
1560
1610
  component_subscribe($$self, theme, value => $$invalidate(3, $theme = value));
1561
- component_subscribe($$self, view, value => $$invalidate(6, $view = value));
1611
+ component_subscribe($$self, view, value => $$invalidate(7, $view = value));
1562
1612
  let today = setMidnight(createDate()), isToday;
1563
1613
 
1564
1614
  function prev() {
@@ -1585,7 +1635,7 @@ function instance$3($$self, $$props, $$invalidate) {
1585
1635
  };
1586
1636
 
1587
1637
  $$self.$$.update = () => {
1588
- if ($$self.$$.dirty & /*$_currentRange*/ 262144) {
1638
+ if ($$self.$$.dirty & /*$_currentRange*/ 1048576) {
1589
1639
  $$invalidate(1, isToday = today >= $_currentRange.start && today < $_currentRange.end || null);
1590
1640
  }
1591
1641
  };
@@ -1597,10 +1647,12 @@ function instance$3($$self, $$props, $$invalidate) {
1597
1647
  $theme,
1598
1648
  $_viewTitle,
1599
1649
  $buttonText,
1650
+ $customButtons,
1600
1651
  $view,
1601
1652
  _currentRange,
1602
1653
  _viewTitle,
1603
1654
  buttonText,
1655
+ customButtons,
1604
1656
  date,
1605
1657
  duration,
1606
1658
  hiddenDays,
@@ -1622,7 +1674,7 @@ class Buttons extends SvelteComponent {
1622
1674
  }
1623
1675
  }
1624
1676
 
1625
- /* packages/core/src/Toolbar.svelte generated by Svelte v4.2.8 */
1677
+ /* packages/core/src/Toolbar.svelte generated by Svelte v4.2.16 */
1626
1678
 
1627
1679
  function get_each_context$1(ctx, list, i) {
1628
1680
  const child_ctx = ctx.slice();
@@ -2008,7 +2060,7 @@ class Toolbar extends SvelteComponent {
2008
2060
  }
2009
2061
  }
2010
2062
 
2011
- /* packages/core/src/Auxiliary.svelte generated by Svelte v4.2.8 */
2063
+ /* packages/core/src/Auxiliary.svelte generated by Svelte v4.2.16 */
2012
2064
 
2013
2065
  function get_each_context(ctx, list, i) {
2014
2066
  const child_ctx = ctx.slice();
@@ -2216,7 +2268,7 @@ class Auxiliary extends SvelteComponent {
2216
2268
  }
2217
2269
  }
2218
2270
 
2219
- /* packages/core/src/Calendar.svelte generated by Svelte v4.2.8 */
2271
+ /* packages/core/src/Calendar.svelte generated by Svelte v4.2.16 */
2220
2272
 
2221
2273
  function create_fragment(ctx) {
2222
2274
  let div;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@event-calendar/core",
3
- "version": "2.6.1",
3
+ "version": "2.7.0",
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": "^4.2.8"
30
+ "svelte": "^4.2.16"
31
31
  }
32
32
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  export let buttons;
6
6
 
7
- let {_currentRange, _viewTitle, buttonText, date, duration, hiddenDays, theme, view} = getContext('state');
7
+ let {_currentRange, _viewTitle, buttonText, customButtons, date, duration, hiddenDays, theme, view} = getContext('state');
8
8
 
9
9
  let today = setMidnight(createDate()), isToday;
10
10
 
@@ -49,6 +49,11 @@
49
49
  on:click={() => $date = cloneDate(today)}
50
50
  disabled={isToday}
51
51
  >{$buttonText[button]}</button>
52
+ {:else if $customButtons[button]}
53
+ <button
54
+ class="{$theme.button} ec-{button}"
55
+ on:click={$customButtons[button].click}
56
+ >{$customButtons[button].text}</button>
52
57
  {:else if button != ''}
53
58
  <button
54
59
  class="{$theme.button}{$view === button ? ' ' + $theme.active : ''} ec-{button}"
@@ -7,6 +7,7 @@ export function createOptions(plugins) {
7
7
  buttonText: {
8
8
  today: 'today',
9
9
  },
10
+ customButtons: {},
10
11
  date: new Date(),
11
12
  datesSet: undefined,
12
13
  dayHeaderFormat: {