@event-calendar/build 0.13.4 → 0.14.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
@@ -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 (54kb [br](https://en.wikipedia.org/wiki/Brotli) compressed `modern` version)
7
+ * Lightweight (55kb [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
 
@@ -182,6 +182,10 @@ let ec = new Calendar({
182
182
  }
183
183
  });
184
184
  ```
185
+ The CSS is located at `@event-calendar/core/index.css`. If your build tool supports CSS processing, you can import it like this:
186
+ ```js
187
+ import '@event-calendar/core/index.css';
188
+ ```
185
189
 
186
190
  ### Pre-built browser ready bundle
187
191
  Include the following lines of code in the `<head>` section of your page:
@@ -234,7 +238,7 @@ In Svelte, you can simply update the original `options` object.
234
238
 
235
239
  Defines the content that is displayed as a title of the `all-day` slot.
236
240
 
237
- This value can be either a string containing HTML `'<p>...</p>'`, 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:
241
+ 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:
238
242
 
239
243
  ```js
240
244
  function (arg) {
@@ -284,9 +288,9 @@ This value can be either a JavaScript Date object, or an ISO8601 date string lik
284
288
  Callback function that is triggered when the user clicks on a date or a time.
285
289
 
286
290
  ```js
287
- function (dateClickInfo) {}
291
+ function (info) {}
288
292
  ```
289
- `dateClickInfo` is an object with the following properties:
293
+ `info` is an object with the following properties:
290
294
  <table>
291
295
  <tr>
292
296
  <td>
@@ -305,6 +309,15 @@ function (dateClickInfo) {}
305
309
  <tr>
306
310
  <td>
307
311
 
312
+ `allDay`
313
+ </td>
314
+ <td>
315
+
316
+ `true` or `false`. Determines if the click has occurred in the `all-day` slot. Clicks in month and list views are treated as all-day too</td>
317
+ </tr>
318
+ <tr>
319
+ <td>
320
+
308
321
  `dayEl`
309
322
  </td>
310
323
  <td>HTML element that represents the whole-day that was clicked on</td>
@@ -502,9 +515,9 @@ You can use any of the CSS color formats such `'#f00'`, `'#ff0000'`, `'rgb(255,0
502
515
  Callback function that is triggered when the user clicks an event.
503
516
 
504
517
  ```js
505
- function (eventClickInfo) { }
518
+ function (info) { }
506
519
  ```
507
- `eventClickInfo` is an object with the following properties:
520
+ `info` is an object with the following properties:
508
521
  <table>
509
522
  <tr>
510
523
  <td>
@@ -554,14 +567,14 @@ This is currently an alias for the `eventBackgroundColor`.
554
567
 
555
568
  Defines the content that is rendered inside an event’s element.
556
569
 
557
- This value can be either a string containing HTML `'<p>...</p>'`, 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:
570
+ 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:
558
571
 
559
572
  ```js
560
- function (eventInfo) {
573
+ function (info) {
561
574
  // return string or object
562
575
  }
563
576
  ```
564
- `eventInfo` is an object with the following properties:
577
+ `info` is an object with the following properties:
565
578
  <table>
566
579
  <tr>
567
580
  <td>
@@ -599,9 +612,9 @@ The current [View](#view-object) object
599
612
  Callback function that is triggered right after the element has been added to the DOM. If the event data changes, this is not called again.
600
613
 
601
614
  ```js
602
- function (mountInfo) { }
615
+ function (info) { }
603
616
  ```
604
- `mountInfo` is an object with the following properties:
617
+ `info` is an object with the following properties:
605
618
  <table>
606
619
  <tr>
607
620
  <td>
@@ -840,9 +853,9 @@ If not specified, it falls back to [longPressDelay](#longpressdelay).
840
853
  Callback function that is triggered when the user hovers over an event with the cursor (mouse pointer).
841
854
 
842
855
  ```js
843
- function (mouseEnterInfo) { }
856
+ function (info) { }
844
857
  ```
845
- `mouseEnterInfo` is an object with the following properties:
858
+ `info` is an object with the following properties:
846
859
  <table>
847
860
  <tr>
848
861
  <td>
@@ -887,9 +900,9 @@ The current [View](#view-object) object
887
900
  Callback function that is triggered when the cursor (mouse pointer) is moved out of an event.
888
901
 
889
902
  ```js
890
- function (mouseLeaveInfo) { }
903
+ function (info) { }
891
904
  ```
892
- `mouseLeaveInfo` is an object with the following properties:
905
+ `info` is an object with the following properties:
893
906
  <table>
894
907
  <tr>
895
908
  <td>
@@ -1400,7 +1413,7 @@ Tells the calendar that visible dates should start from the [firstDay](#firstday
1400
1413
 
1401
1414
  Defines the text that is displayed instead of the default `+2 more` created by the [dayMaxEvents](#daymaxevents) option.
1402
1415
 
1403
- This value can be either a string containing HTML `'<p>...</p>'`, 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:
1416
+ 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:
1404
1417
 
1405
1418
  ```js
1406
1419
  function (arg) {
@@ -1435,9 +1448,9 @@ The default text like `+2 more`
1435
1448
  Callback function that is triggered when the user clicks _No events_ area in list view.
1436
1449
 
1437
1450
  ```js
1438
- function (clickInfo) { }
1451
+ function (info) { }
1439
1452
  ```
1440
- `clickInfo` is an object with the following properties:
1453
+ `info` is an object with the following properties:
1441
1454
  <table>
1442
1455
  <tr>
1443
1456
  <td>
@@ -1464,7 +1477,7 @@ The current [View](#view-object) object
1464
1477
 
1465
1478
  Defines the text that is displayed in list view when there are no events to display.
1466
1479
 
1467
- This value can be either a string containing HTML `'<p>...</p>'`, 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:
1480
+ 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:
1468
1481
 
1469
1482
  ```js
1470
1483
  function () {
@@ -1497,9 +1510,9 @@ Array of plain objects that will be parsed into [Resource](#resource-object) obj
1497
1510
  Callback function that is triggered when a date/time selection is made.
1498
1511
 
1499
1512
  ```js
1500
- function (selectInfo) { }
1513
+ function (info) { }
1501
1514
  ```
1502
- `selectInfo` is an object with the following properties:
1515
+ `info` is an object with the following properties:
1503
1516
  <table>
1504
1517
  <tr>
1505
1518
  <td>
@@ -1536,7 +1549,7 @@ function (selectInfo) { }
1536
1549
  </td>
1537
1550
  <td>
1538
1551
 
1539
- Boolean (`true` or `false`). Determines if the selection has occurred in the `all-day` slot</td>
1552
+ `true` or `false`. Determines if the selection has occurred in the `all-day` slot</td>
1540
1553
  </tr>
1541
1554
  <tr>
1542
1555
  <td>
@@ -1591,7 +1604,7 @@ If not specified, it falls back to [longPressDelay](#longpressdelay).
1591
1604
 
1592
1605
  ### selectMinDistance
1593
1606
  - Type `integer`
1594
- - Default `0`
1607
+ - Default `5`
1595
1608
 
1596
1609
  Defines how many pixels the user’s mouse must move before the selection begins.
1597
1610
 
@@ -1779,9 +1792,9 @@ The view that is displayed in the calendar. Can be `'dayGridMonth'`, `'listDay'`
1779
1792
  Callback function that is triggered right after the view has been added to the DOM.
1780
1793
 
1781
1794
  ```js
1782
- function (mountInfo) { }
1795
+ function (info) { }
1783
1796
  ```
1784
- `mountInfo` is an object with the following properties:
1797
+ `info` is an object with the following properties:
1785
1798
  <table>
1786
1799
  <tr>
1787
1800
  <td>
@@ -1927,7 +1940,7 @@ Here are all properties that exist in Event object:
1927
1940
  </td>
1928
1941
  <td>
1929
1942
 
1930
- Boolean (`true` or `false`). Determines if the event is shown in the `all-day` slot</td>
1943
+ `true` or `false`. Determines if the event is shown in the `all-day` slot</td>
1931
1944
  </tr>
1932
1945
  <tr>
1933
1946
  <td>
@@ -1953,11 +1966,18 @@ Boolean (`true` or `false`). Determines if the event is shown in the `all-day` s
1953
1966
  <tr>
1954
1967
  <td>
1955
1968
 
1969
+ `titleHTML`
1970
+ </td>
1971
+ <td>The HTML version of the title</td>
1972
+ </tr>
1973
+ <tr>
1974
+ <td>
1975
+
1956
1976
  `editable`
1957
1977
  </td>
1958
1978
  <td>
1959
1979
 
1960
- Boolean (`true` or `false`) or `undefined`. The value overriding the [editable](#editable) setting for this specific event
1980
+ `true`, `false` or `undefined`. The value overriding the [editable](#editable) setting for this specific event
1961
1981
  </td>
1962
1982
  </tr>
1963
1983
  <tr>
@@ -1967,7 +1987,7 @@ Boolean (`true` or `false`) or `undefined`. The value overriding the [editable](
1967
1987
  </td>
1968
1988
  <td>
1969
1989
 
1970
- Boolean (`true` or `false`) or `undefined`. The value overriding the [eventStartEditable](#eventstarteditable) setting for this specific event
1990
+ `true`, `false` or `undefined`. The value overriding the [eventStartEditable](#eventstarteditable) setting for this specific event
1971
1991
  </td>
1972
1992
  </tr>
1973
1993
  <tr>
@@ -1977,7 +1997,7 @@ Boolean (`true` or `false`) or `undefined`. The value overriding the [eventStart
1977
1997
  </td>
1978
1998
  <td>
1979
1999
 
1980
- Boolean (`true` or `false`) or `undefined`. The value overriding the [eventDurationEditable](#eventdurationeditable) setting for this specific event
2000
+ `true`, `false` or `undefined`. The value overriding the [eventDurationEditable](#eventdurationeditable) setting for this specific event
1981
2001
  </td>
1982
2002
  </tr>
1983
2003
  <tr>
@@ -2092,6 +2112,16 @@ Here are all admissible fields for the event’s input object:
2092
2112
  <tr>
2093
2113
  <td>
2094
2114
 
2115
+ `titleHTML`
2116
+ </td>
2117
+ <td>
2118
+
2119
+ `string` The HTML version of the title to be displayed instead of the text version. Default `''`
2120
+ </td>
2121
+ </tr>
2122
+ <tr>
2123
+ <td>
2124
+
2095
2125
  `editable`
2096
2126
  </td>
2097
2127
  <td>
@@ -2220,6 +2250,13 @@ Here are all properties that exist in Resource object:
2220
2250
  </td>
2221
2251
  <td>The title of the resource</td>
2222
2252
  </tr>
2253
+ <tr>
2254
+ <td>
2255
+
2256
+ `titleHTML`
2257
+ </td>
2258
+ <td>The HTML version of the title</td>
2259
+ </tr>
2223
2260
  </table>
2224
2261
 
2225
2262
  ### Parsing resource from a plain object
@@ -2247,6 +2284,16 @@ Here are all admissible fields for the resource’s input object:
2247
2284
  `string` Text that will be displayed on the resource when it is rendered. Default `''`
2248
2285
  </td>
2249
2286
  </tr>
2287
+ <tr>
2288
+ <td>
2289
+
2290
+ `titleHTML`
2291
+ </td>
2292
+ <td>
2293
+
2294
+ `string` The HTML version of the title to be displayed instead of the text version. Default `''`
2295
+ </td>
2296
+ </tr>
2250
2297
  </table>
2251
2298
 
2252
2299
  ## View object