@event-calendar/core 0.14.0 → 0.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@ See [demo](https://vkurko.github.io/calendar/).
4
4
 
5
5
  Full-sized drag & drop JavaScript event calendar with resource view:
6
6
 
7
- * Lightweight (55kb [br](https://en.wikipedia.org/wiki/Brotli) compressed `modern` version)
7
+ * Lightweight (54kb [br](https://en.wikipedia.org/wiki/Brotli) compressed `modern` version)
8
8
  * Zero-dependency (pre-built bundle)
9
9
  * Used by [Bookly](https://wordpress.org/plugins/bookly-responsive-appointment-booking-tool/)
10
10
 
@@ -43,9 +43,9 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options
43
43
  - [eventDragStart](#eventdragstart)
44
44
  - [eventDragStop](#eventdragstop)
45
45
  - [eventDrop](#eventdrop)
46
+ - [eventDurationEditable](#eventdurationeditable)
46
47
  </td><td>
47
48
 
48
- - [eventDurationEditable](#eventdurationeditable)
49
49
  - [eventLongPressDelay](#eventlongpressdelay)
50
50
  - [eventMouseEnter](#eventmouseenter)
51
51
  - [eventMouseLeave](#eventmouseleave)
@@ -69,14 +69,16 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options
69
69
  - [locale](#locale)
70
70
  - [longPressDelay](#longpressdelay)
71
71
  - [monthMode](#monthmode)
72
- </td><td>
73
-
74
72
  - [moreLinkContent](#morelinkcontent)
75
73
  - [noEventsClick](#noeventsclick)
74
+ </td><td>
75
+
76
76
  - [noEventsContent](#noeventscontent)
77
77
  - [nowIndicator](#nowindicator)
78
78
  - [pointer](#pointer)
79
79
  - [resources](#resources)
80
+ - [resourceLabelContent](#resourcelabelcontent)
81
+ - [resourceLabelDidMount](#resourcelabeldidmount)
80
82
  - [select](#select)
81
83
  - [selectable](#selectable)
82
84
  - [selectBackgroundColor](#selectbackgroundcolor)
@@ -1503,6 +1505,77 @@ Enables mouse cursor pointer in `timeGrid`/`resourceTimeGrid` views.
1503
1505
 
1504
1506
  Array of plain objects that will be parsed into [Resource](#resource-object) objects for displaying in the resource view.
1505
1507
 
1508
+ ### resourceLabelContent
1509
+ - Type `string`, `object`or `function`
1510
+ - Default `undefined`
1511
+
1512
+ Defines the content that is rendered inside an element with a resource title.
1513
+
1514
+ This value can be either a string containing text `'...'`, an object containing the HTML string `{html: '<p>...</p>'}`, an object containing an array of DOM nodes `{domNodes: [node1, node2, ...]}` or a function that returns any of the above formats:
1515
+
1516
+ ```js
1517
+ function (info) {
1518
+ // return string or object
1519
+ }
1520
+ ```
1521
+ `info` is an object with the following properties:
1522
+ <table>
1523
+ <tr>
1524
+ <td>
1525
+
1526
+ `resource`
1527
+ </td>
1528
+ <td>
1529
+
1530
+ The associated [Resource](#resource-object) object
1531
+ </td>
1532
+ </tr>
1533
+ <tr>
1534
+ <td>
1535
+
1536
+ `date`
1537
+ </td>
1538
+ <td>If it is a column that is within a specific date, this will be a Date object</td>
1539
+ </tr>
1540
+ </table>
1541
+
1542
+ ### resourceLabelDidMount
1543
+ - Type `function`
1544
+ - Default `undefined`
1545
+
1546
+ Callback function that is triggered right after the element has been added to the DOM. If the resource data changes, this is not called again.
1547
+
1548
+ ```js
1549
+ function (info) { }
1550
+ ```
1551
+ `info` is an object with the following properties:
1552
+ <table>
1553
+ <tr>
1554
+ <td>
1555
+
1556
+ `el`
1557
+ </td>
1558
+ <td>The HTML element for the label</td>
1559
+ </tr>
1560
+ <tr>
1561
+ <td>
1562
+
1563
+ `resource`
1564
+ </td>
1565
+ <td>
1566
+
1567
+ The associated [Resource](#resource-object) object
1568
+ </td>
1569
+ </tr>
1570
+ <tr>
1571
+ <td>
1572
+
1573
+ `date`
1574
+ </td>
1575
+ <td>If it is a column that is within a specific date, this will be a Date object</td>
1576
+ </tr>
1577
+ </table>
1578
+
1506
1579
  ### select
1507
1580
  - Type `function`
1508
1581
  - Default `undefined`
package/index.js CHANGED
@@ -465,7 +465,7 @@ function parseOpts(opts, state) {
465
465
  }
466
466
  }
467
467
 
468
- /* packages/core/src/Buttons.svelte generated by Svelte v3.51.0 */
468
+ /* packages/core/src/Buttons.svelte generated by Svelte v3.55.0 */
469
469
 
470
470
  function get_each_context$1(ctx, list, i) {
471
471
  const child_ctx = ctx.slice();
@@ -868,7 +868,7 @@ class Buttons extends SvelteComponent {
868
868
  }
869
869
  }
870
870
 
871
- /* packages/core/src/Toolbar.svelte generated by Svelte v3.51.0 */
871
+ /* packages/core/src/Toolbar.svelte generated by Svelte v3.55.0 */
872
872
 
873
873
  function get_each_context(ctx, list, i) {
874
874
  const child_ctx = ctx.slice();
@@ -1238,7 +1238,7 @@ class Toolbar extends SvelteComponent {
1238
1238
  }
1239
1239
  }
1240
1240
 
1241
- /* packages/core/src/Calendar.svelte generated by Svelte v3.51.0 */
1241
+ /* packages/core/src/Calendar.svelte generated by Svelte v3.55.0 */
1242
1242
 
1243
1243
  function create_fragment(ctx) {
1244
1244
  let div;
@@ -1424,9 +1424,11 @@ function instance($$self, $$props, $$invalidate) {
1424
1424
  }
1425
1425
 
1426
1426
  function getOption(name) {
1427
- return state.hasOwnProperty(name)
1427
+ let value = state.hasOwnProperty(name)
1428
1428
  ? get(state[name])
1429
1429
  : undefined;
1430
+
1431
+ return value instanceof Date ? toLocalDate(value) : value;
1430
1432
  }
1431
1433
 
1432
1434
  function refetchEvents() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@event-calendar/core",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "title": "Event Calendar Core package",
5
5
  "description": "Full-sized drag & drop event calendar with resource view",
6
6
  "keywords": [
@@ -29,12 +29,15 @@
29
29
  "type": "module",
30
30
  "svelte": "src/index.js",
31
31
  "exports": {
32
- ".": "./index.js",
32
+ ".": {
33
+ "svelte": "./src/index.js",
34
+ "default": "./index.js"
35
+ },
33
36
  "./index.css": "./index.css",
34
37
  "./package.json": "./package.json"
35
38
  },
36
39
  "dependencies": {
37
- "@event-calendar/common": "~0.14.0",
38
- "svelte": "^3.51.0"
40
+ "@event-calendar/common": "~0.14.2",
41
+ "svelte": "^3.55.0"
39
42
  }
40
43
  }
@@ -5,7 +5,7 @@
5
5
  import {diff} from './storage/options';
6
6
  import State from './storage/state';
7
7
  import Toolbar from './Toolbar.svelte';
8
- import {assign, toEventWithLocalDates, toViewWithLocalDates, ignore} from '@event-calendar/common';
8
+ import {assign, toEventWithLocalDates, toViewWithLocalDates, toLocalDate, ignore} from '@event-calendar/common';
9
9
 
10
10
  export let plugins = [];
11
11
  export let options = {};
@@ -32,7 +32,8 @@
32
32
  }
33
33
 
34
34
  export function getOption(name) {
35
- return state.hasOwnProperty(name) ? get(state[name]) : undefined;
35
+ let value = state.hasOwnProperty(name) ? get(state[name]) : undefined;
36
+ return value instanceof Date ? toLocalDate(value) : value;
36
37
  }
37
38
 
38
39
  export function refetchEvents() {