@event-calendar/core 1.0.0 → 1.1.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 +49 -3
- package/index.js +9 -10
- package/package.json +2 -12
- package/src/Calendar.svelte +3 -4
- package/src/storage/options.js +1 -1
- package/src/storage/state.js +1 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ See [demo](https://vkurko.github.io/calendar/) and [changelog](CHANGELOG.md).
|
|
|
4
4
|
|
|
5
5
|
Full-sized drag & drop JavaScript event calendar with resource view:
|
|
6
6
|
|
|
7
|
-
* Lightweight (
|
|
7
|
+
* Lightweight (28kb [br](https://en.wikipedia.org/wiki/Brotli) compressed)
|
|
8
8
|
* Zero-dependency (pre-built bundle)
|
|
9
9
|
* Used on over 60,000 websites with [Bookly](https://wordpress.org/plugins/bookly-responsive-appointment-booking-tool/)
|
|
10
10
|
|
|
@@ -54,6 +54,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options
|
|
|
54
54
|
- [eventResizeStop](#eventresizestop)
|
|
55
55
|
- [eventSources](#eventsources)
|
|
56
56
|
- [eventStartEditable](#eventstarteditable)
|
|
57
|
+
- [eventTextColor](#eventtextcolor)
|
|
57
58
|
- [eventTimeFormat](#eventtimeformat)
|
|
58
59
|
- [filterResourcesWithEvents](#filterresourceswithevents)
|
|
59
60
|
- [firstDay](#firstday)
|
|
@@ -192,8 +193,8 @@ import '@event-calendar/core/index.css';
|
|
|
192
193
|
### Pre-built browser ready bundle
|
|
193
194
|
Include the following lines of code in the `<head>` section of your page:
|
|
194
195
|
```html
|
|
195
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.
|
|
196
|
-
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.
|
|
196
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.1.1/event-calendar.min.css">
|
|
197
|
+
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.1.1/event-calendar.min.js"></script>
|
|
197
198
|
```
|
|
198
199
|
|
|
199
200
|
<details>
|
|
@@ -1248,6 +1249,14 @@ function (time) {
|
|
|
1248
1249
|
</tr>
|
|
1249
1250
|
</table>
|
|
1250
1251
|
|
|
1252
|
+
### eventTextColor
|
|
1253
|
+
- Type `string`
|
|
1254
|
+
- Default `undefined`
|
|
1255
|
+
|
|
1256
|
+
Sets the default text color for events on the calendar.
|
|
1257
|
+
|
|
1258
|
+
You can use any of the CSS color formats such `'#f00'`, `'#ff0000'`, `'rgb(255,0,0)'`, or `'red'`.
|
|
1259
|
+
|
|
1251
1260
|
### filterResourcesWithEvents
|
|
1252
1261
|
- Type `boolean`
|
|
1253
1262
|
- Default `false`
|
|
@@ -2187,6 +2196,16 @@ The [eventBackgroundColor](#eventbackgroundcolor) override for this specific eve
|
|
|
2187
2196
|
<tr>
|
|
2188
2197
|
<td>
|
|
2189
2198
|
|
|
2199
|
+
`textColor`
|
|
2200
|
+
</td>
|
|
2201
|
+
<td>
|
|
2202
|
+
|
|
2203
|
+
The [eventTextColor](#eventtextcolor) override for this specific event
|
|
2204
|
+
</td>
|
|
2205
|
+
</tr>
|
|
2206
|
+
<tr>
|
|
2207
|
+
<td>
|
|
2208
|
+
|
|
2190
2209
|
`extendedProps`
|
|
2191
2210
|
</td>
|
|
2192
2211
|
<td>
|
|
@@ -2324,6 +2343,16 @@ Here are all admissible fields for the event’s input object:
|
|
|
2324
2343
|
<tr>
|
|
2325
2344
|
<td>
|
|
2326
2345
|
|
|
2346
|
+
`textColor`
|
|
2347
|
+
</td>
|
|
2348
|
+
<td>
|
|
2349
|
+
|
|
2350
|
+
`string` Sets the event’s text color just like the calendar-wide [eventTextColor](#eventtextcolor) option. Default `undefined`
|
|
2351
|
+
</td>
|
|
2352
|
+
</tr>
|
|
2353
|
+
<tr>
|
|
2354
|
+
<td>
|
|
2355
|
+
|
|
2327
2356
|
`color`
|
|
2328
2357
|
</td>
|
|
2329
2358
|
<td>
|
|
@@ -2426,6 +2455,13 @@ Here are all properties that exist in Resource object:
|
|
|
2426
2455
|
</td>
|
|
2427
2456
|
<td>Default background color for this resource's events</td>
|
|
2428
2457
|
</tr>
|
|
2458
|
+
<tr>
|
|
2459
|
+
<td>
|
|
2460
|
+
|
|
2461
|
+
`eventTextColor`
|
|
2462
|
+
</td>
|
|
2463
|
+
<td>Default text color for this resource's events</td>
|
|
2464
|
+
</tr>
|
|
2429
2465
|
</table>
|
|
2430
2466
|
|
|
2431
2467
|
### Parsing resource from a plain object
|
|
@@ -2473,6 +2509,16 @@ Here are all admissible fields for the resource’s input object:
|
|
|
2473
2509
|
`string` Sets the default background color for this resource's events just like the calendar-wide [eventBackgroundColor](#eventbackgroundcolor) option. Default `undefined`
|
|
2474
2510
|
</td>
|
|
2475
2511
|
</tr>
|
|
2512
|
+
<tr>
|
|
2513
|
+
<td>
|
|
2514
|
+
|
|
2515
|
+
`eventTextColor`
|
|
2516
|
+
</td>
|
|
2517
|
+
<td>
|
|
2518
|
+
|
|
2519
|
+
`string` Sets the default text color for this resource's events just like the calendar-wide [eventTextColor](#eventtextcolor) option. Default `undefined`
|
|
2520
|
+
</td>
|
|
2521
|
+
</tr>
|
|
2476
2522
|
</table>
|
|
2477
2523
|
|
|
2478
2524
|
## View object
|
package/index.js
CHANGED
|
@@ -11,7 +11,6 @@ function createOptions(plugins) {
|
|
|
11
11
|
today: 'today',
|
|
12
12
|
},
|
|
13
13
|
date: new Date(),
|
|
14
|
-
dateClick: undefined,
|
|
15
14
|
datesSet: undefined,
|
|
16
15
|
dayHeaderFormat: {
|
|
17
16
|
weekday: 'short',
|
|
@@ -22,6 +21,7 @@ function createOptions(plugins) {
|
|
|
22
21
|
duration: {weeks: 1},
|
|
23
22
|
events: [],
|
|
24
23
|
eventBackgroundColor: undefined,
|
|
24
|
+
eventTextColor: undefined,
|
|
25
25
|
eventClick: undefined,
|
|
26
26
|
eventColor: undefined,
|
|
27
27
|
eventContent: undefined,
|
|
@@ -380,11 +380,10 @@ class State {
|
|
|
380
380
|
this._viewComponent = writable(undefined);
|
|
381
381
|
// Resources
|
|
382
382
|
this._resBgColor = writable(noop);
|
|
383
|
+
this._resTxtColor = writable(noop);
|
|
383
384
|
// Interaction
|
|
384
385
|
this._interaction = writable({});
|
|
385
386
|
this._iEvents = writable([null, null]); // interaction events: [drag/resize, pointer]
|
|
386
|
-
this._draggable = writable(noop);
|
|
387
|
-
this._resizable = writable(noop);
|
|
388
387
|
this._classes = writable(identity);
|
|
389
388
|
this._iClass = writable(undefined);
|
|
390
389
|
|
|
@@ -1562,8 +1561,8 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
1562
1561
|
let $_bodyEl;
|
|
1563
1562
|
let $_scrollable;
|
|
1564
1563
|
let $_queue;
|
|
1565
|
-
let $events;
|
|
1566
1564
|
let $_events;
|
|
1565
|
+
let $events;
|
|
1567
1566
|
let $eventSources;
|
|
1568
1567
|
let $_interaction;
|
|
1569
1568
|
let $theme;
|
|
@@ -1582,10 +1581,10 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
1582
1581
|
component_subscribe($$self, _bodyEl, value => $$invalidate(33, $_bodyEl = value));
|
|
1583
1582
|
component_subscribe($$self, _interaction, value => $$invalidate(38, $_interaction = value));
|
|
1584
1583
|
component_subscribe($$self, _iClass, value => $$invalidate(3, $_iClass = value));
|
|
1585
|
-
component_subscribe($$self, _events, value => $$invalidate(
|
|
1584
|
+
component_subscribe($$self, _events, value => $$invalidate(35, $_events = value));
|
|
1586
1585
|
component_subscribe($$self, _queue, value => $$invalidate(34, $_queue = value));
|
|
1587
1586
|
component_subscribe($$self, _scrollable, value => $$invalidate(0, $_scrollable = value));
|
|
1588
|
-
component_subscribe($$self, events, value => $$invalidate(
|
|
1587
|
+
component_subscribe($$self, events, value => $$invalidate(36, $events = value));
|
|
1589
1588
|
component_subscribe($$self, eventSources, value => $$invalidate(37, $eventSources = value));
|
|
1590
1589
|
component_subscribe($$self, height, value => $$invalidate(4, $height = value));
|
|
1591
1590
|
component_subscribe($$self, theme, value => $$invalidate(1, $theme = value));
|
|
@@ -1676,10 +1675,10 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
1676
1675
|
}
|
|
1677
1676
|
|
|
1678
1677
|
function updateEvents(func) {
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
set_store_value(events, $events =
|
|
1678
|
+
set_store_value(_events, $_events = func($_events), $_events);
|
|
1679
|
+
|
|
1680
|
+
if (!$eventSources.length) {
|
|
1681
|
+
set_store_value(events, $events = $_events, $events);
|
|
1683
1682
|
}
|
|
1684
1683
|
}
|
|
1685
1684
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event-calendar/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"title": "Event Calendar Core package",
|
|
5
5
|
"description": "Full-sized drag & drop event calendar with resource view",
|
|
6
6
|
"keywords": [
|
|
@@ -15,16 +15,6 @@
|
|
|
15
15
|
"url": "https://github.com/vkurko/calendar.git",
|
|
16
16
|
"directory": "packages/core"
|
|
17
17
|
},
|
|
18
|
-
"funding": [
|
|
19
|
-
{
|
|
20
|
-
"type": "paypal_$10",
|
|
21
|
-
"url": "https://paypal.me/vkurko/10usd"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"type": "paypal_$1",
|
|
25
|
-
"url": "https://paypal.me/vkurko/1usd"
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
18
|
"license": "MIT",
|
|
29
19
|
"type": "module",
|
|
30
20
|
"svelte": "src/index.js",
|
|
@@ -37,7 +27,7 @@
|
|
|
37
27
|
"./package.json": "./package.json"
|
|
38
28
|
},
|
|
39
29
|
"dependencies": {
|
|
40
|
-
"@event-calendar/common": "~1.
|
|
30
|
+
"@event-calendar/common": "~1.1.1",
|
|
41
31
|
"svelte": "^3.55.1"
|
|
42
32
|
}
|
|
43
33
|
}
|
package/src/Calendar.svelte
CHANGED
|
@@ -111,10 +111,9 @@
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
function updateEvents(func) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
$events = func($events);
|
|
114
|
+
$_events = func($_events);
|
|
115
|
+
if (!$eventSources.length) {
|
|
116
|
+
$events = $_events;
|
|
118
117
|
}
|
|
119
118
|
}
|
|
120
119
|
|
package/src/storage/options.js
CHANGED
|
@@ -10,7 +10,6 @@ export function createOptions(plugins) {
|
|
|
10
10
|
today: 'today',
|
|
11
11
|
},
|
|
12
12
|
date: new Date(),
|
|
13
|
-
dateClick: undefined,
|
|
14
13
|
datesSet: undefined,
|
|
15
14
|
dayHeaderFormat: {
|
|
16
15
|
weekday: 'short',
|
|
@@ -21,6 +20,7 @@ export function createOptions(plugins) {
|
|
|
21
20
|
duration: {weeks: 1},
|
|
22
21
|
events: [],
|
|
23
22
|
eventBackgroundColor: undefined,
|
|
23
|
+
eventTextColor: undefined,
|
|
24
24
|
eventClick: undefined,
|
|
25
25
|
eventColor: undefined,
|
|
26
26
|
eventContent: undefined,
|
package/src/storage/state.js
CHANGED
|
@@ -51,11 +51,10 @@ export default class {
|
|
|
51
51
|
this._viewComponent = writable(undefined);
|
|
52
52
|
// Resources
|
|
53
53
|
this._resBgColor = writable(noop);
|
|
54
|
+
this._resTxtColor = writable(noop);
|
|
54
55
|
// Interaction
|
|
55
56
|
this._interaction = writable({});
|
|
56
57
|
this._iEvents = writable([null, null]); // interaction events: [drag/resize, pointer]
|
|
57
|
-
this._draggable = writable(noop);
|
|
58
|
-
this._resizable = writable(noop);
|
|
59
58
|
this._classes = writable(identity);
|
|
60
59
|
this._iClass = writable(undefined);
|
|
61
60
|
|