@event-calendar/core 0.5.0 → 0.6.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 +8 -1
- package/index.css +1 -1
- package/index.js +13 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -63,6 +63,7 @@ Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options
|
|
|
63
63
|
- [monthMode](#monthmode)
|
|
64
64
|
- [noEventsClick](#noeventsclick)
|
|
65
65
|
- [noEventsContent](#noeventscontent)
|
|
66
|
+
- [pointer](#pointer)
|
|
66
67
|
- [resources](#resources)
|
|
67
68
|
- [scrollTime](#scrolltime)
|
|
68
69
|
- [slotDuration](#slotduration)
|
|
@@ -1183,6 +1184,12 @@ function () {
|
|
|
1183
1184
|
}
|
|
1184
1185
|
```
|
|
1185
1186
|
|
|
1187
|
+
### pointer
|
|
1188
|
+
- Type `boolean`
|
|
1189
|
+
- Default `false`
|
|
1190
|
+
|
|
1191
|
+
Enables mouse cursor pointer in `timeGrid`/`resourceTimeGrid` views.
|
|
1192
|
+
|
|
1186
1193
|
### resources
|
|
1187
1194
|
- Type `Array`
|
|
1188
1195
|
- Default `[]`
|
|
@@ -1606,7 +1613,7 @@ Here are all admissible fields for the event’s input object:
|
|
|
1606
1613
|
</td>
|
|
1607
1614
|
<td>
|
|
1608
1615
|
|
|
1609
|
-
`boolean` Overrides the master [
|
|
1616
|
+
`boolean` Overrides the master [eventStartEditable](#eventstarteditable) option for this single event. Default `undefined`
|
|
1610
1617
|
</td>
|
|
1611
1618
|
</tr>
|
|
1612
1619
|
<tr>
|
package/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.ec-flex{display:flex}.ec-body.ec-month,.ec-days,.ec-day,.ec-day-title,.ec-resource{flex:1 1 0%;min-width:0;max-width:100%}.ec{display:flex;flex-direction:column}.ec ::-webkit-scrollbar{background:#fff}.ec ::-webkit-scrollbar-thumb{border:4px solid #fff;box-shadow:none;background:#dadce0;border-radius:8px;min-height:40px}.ec :hover::-webkit-scrollbar-thumb{background:#bdc1c6}.ec-hidden-scroll{display:none;overflow-y:scroll;visibility:hidden;flex-shrink:0}.ec-with-scroll .ec-hidden-scroll{display:block}.ec-toolbar{flex:0 0 auto;display:flex;justify-content:space-between;align-items:center;margin-bottom:1em}.ec-toolbar>*{margin-bottom:-0.5em}.ec-toolbar>*>*{margin-bottom:.5em}.ec-toolbar>*>*:not(:last-child){margin-right:.75em}.ec-title{margin:0}.ec-button{background-color:#fff;border:1px solid #ced4da;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem}.ec-button:not(:disabled){color:#212529;cursor:pointer}.ec-button:not(:disabled):hover,.ec-button.ec-active{background-color:#ececec;border-color:#b1bbc4}.ec-button-group{display:inline-flex}.ec-button-group .ec-button:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.ec-button-group .ec-button:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.ec-icon{display:inline-block;width:1em}.ec-icon.ec-prev:after,.ec-icon.ec-next:after{content:"";position:relative;width:.5em;height:.5em;border-top:2px solid #212529;border-right:2px solid #212529;display:inline-block}.ec-icon.ec-prev:after{transform:rotate(-135deg) translate(-2px, 2px)}.ec-icon.ec-next:after{transform:rotate(45deg) translate(-2px, 2px)}.ec-header,.ec-body,.ec-days,.ec-day{border:1px solid #dadce0}.ec-header{display:flex;flex-shrink:0}.ec-header .ec-resource{flex-direction:column}.ec-header .ec-resource .ec-days{border-top-style:solid}.ec-header .ec-days{border-bottom:none}.ec-header .ec-day{min-height:24px;line-height:24px;text-align:center;overflow:hidden;text-overflow:ellipsis}.ec-body{position:relative;overflow-x:hidden;overflow-y:auto}.ec-body:not(.ec-list){border-top:none}.ec-sidebar{flex:0 0 auto;width:auto;max-width:100%;padding:0 4px 0 8px}.ec-content{display:flex}.ec-month .ec-content{flex-direction:column;height:100%}.ec-list .ec-content{flex-direction:column}.ec-resource{display:flex}.ec-days{display:flex;border-style:none none solid}.ec-days:last-child{border-bottom:none}.ec-month .ec-days,.ec-resource .ec-days{flex:1 0 auto}.ec-day{border-style:none none none solid}.ec-day.ec-today{background-color:#fcf8e3}.ec-day.ec-highlight{background-color:#e5f7fe}.ec-month .ec-day{min-height:5em}.ec-month .ec-day:first-child{border-left:none}.ec-day.ec-other-month .ec-day-head{opacity:.3}.ec-list .ec-day{flex:1 0 auto;background-color:#fff;border-style:solid none;padding:8px 14px;font-weight:bold;position:sticky;top:0;z-index:1}.ec-list .ec-day:first-child{border-top:none}.ec-month .ec-day-head{text-align:right;padding:4px}.ec-
|
|
1
|
+
.ec-flex{display:flex}.ec-body.ec-month,.ec-days,.ec-day,.ec-day-title,.ec-resource{flex:1 1 0%;min-width:0;max-width:100%}.ec{display:flex;flex-direction:column}.ec ::-webkit-scrollbar{background:#fff}.ec ::-webkit-scrollbar-thumb{border:4px solid #fff;box-shadow:none;background:#dadce0;border-radius:8px;min-height:40px}.ec :hover::-webkit-scrollbar-thumb{background:#bdc1c6}.ec-hidden-scroll{display:none;overflow-y:scroll;visibility:hidden;flex-shrink:0}.ec-with-scroll .ec-hidden-scroll{display:block}.ec-toolbar{flex:0 0 auto;display:flex;justify-content:space-between;align-items:center;margin-bottom:1em}.ec-toolbar>*{margin-bottom:-0.5em}.ec-toolbar>*>*{margin-bottom:.5em}.ec-toolbar>*>*:not(:last-child){margin-right:.75em}.ec-title{margin:0}.ec-button{background-color:#fff;border:1px solid #ced4da;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem}.ec-button:not(:disabled){color:#212529;cursor:pointer}.ec-button:not(:disabled):hover,.ec-button.ec-active{background-color:#ececec;border-color:#b1bbc4}.ec-button-group{display:inline-flex}.ec-button-group .ec-button:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0;margin-left:-1px}.ec-button-group .ec-button:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.ec-icon{display:inline-block;width:1em}.ec-icon.ec-prev:after,.ec-icon.ec-next:after{content:"";position:relative;width:.5em;height:.5em;border-top:2px solid #212529;border-right:2px solid #212529;display:inline-block}.ec-icon.ec-prev:after{transform:rotate(-135deg) translate(-2px, 2px)}.ec-icon.ec-next:after{transform:rotate(45deg) translate(-2px, 2px)}.ec-header,.ec-body,.ec-days,.ec-day{border:1px solid #dadce0}.ec-header{display:flex;flex-shrink:0}.ec-header .ec-resource{flex-direction:column}.ec-header .ec-resource .ec-days{border-top-style:solid}.ec-header .ec-days{border-bottom:none}.ec-header .ec-day{min-height:24px;line-height:24px;text-align:center;overflow:hidden;text-overflow:ellipsis}.ec-body{position:relative;overflow-x:hidden;overflow-y:auto}.ec-body:not(.ec-list){border-top:none}.ec-sidebar{flex:0 0 auto;width:auto;max-width:100%;padding:0 4px 0 8px}.ec-content{display:flex}.ec-month .ec-content{flex-direction:column;height:100%}.ec-list .ec-content{flex-direction:column}.ec-resource{display:flex}.ec-days{display:flex;border-style:none none solid}.ec-days:last-child{border-bottom:none}.ec-month .ec-days,.ec-resource .ec-days{flex:1 0 auto}.ec-day{border-style:none none none solid}.ec-day.ec-today{background-color:#fcf8e3}.ec-day.ec-highlight{background-color:#e5f7fe}.ec-month.ec-body .ec-day{min-height:5em}.ec-month .ec-day:first-child{border-left:none}.ec-day.ec-other-month .ec-day-head{opacity:.3}.ec-list .ec-day{flex:1 0 auto;background-color:#fff;border-style:solid none;padding:8px 14px;font-weight:bold;position:sticky;top:0;z-index:1}.ec-list .ec-day:first-child{border-top:none}.ec-month .ec-day-head{text-align:right;padding:4px}.ec-list .ec-day-side{float:right}.ec-list .ec-no-events{text-align:center;padding:5em 0}.ec-events{margin:0 6px 0 0}.ec-week .ec-events,.ec-events.ec-preview{position:relative}.ec-event{display:flex;flex-direction:column;padding:2px;color:#fff;box-sizing:border-box;box-shadow:0 0 1px 0 #dadce0;background-color:#039be5;border-radius:3px;font-size:.85em;line-height:1.5;z-index:1}.ec-month .ec-event{position:relative}.ec-week .ec-event{position:absolute}.ec-list .ec-event{flex-direction:row;padding:8px 14px;color:inherit;background-color:transparent;border-radius:0}.ec-event.ec-preview{cursor:pointer;position:absolute;z-index:99999;width:100%;-webkit-user-select:none;user-select:none;opacity:.8}.ec-event.ec-pointer{color:inherit;pointer-events:none;-webkit-user-select:none;user-select:none;position:absolute;z-index:0;display:none}.ec-day:hover .ec-event.ec-pointer{display:flex}.ec-event-tag{width:4px;border-radius:2px;margin-right:8px}.ec-event-time{overflow:hidden;white-space:nowrap;margin-bottom:1px;flex-shrink:0}.ec-event-title{overflow:hidden}.ec-week .ec-event-title{position:sticky;top:0}.ec-list .ec-event-title{font-size:1rem}.ec-draggable{cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:none}.ec-ghost{opacity:.5;-webkit-user-select:none;user-select:none;touch-action:none}.ec-bg-events{position:relative}.ec-bg-event{position:absolute;background-color:#dadce0;opacity:.3;width:100%}.ec-hidden-times{visibility:hidden;overflow-y:hidden;height:0}.ec-time,.ec-line{height:24px}.ec-time{position:relative;line-height:24px;top:-12px;text-align:right;white-space:nowrap}.ec-lines{width:8px}.ec-line:not(:first-child):after{content:"";position:absolute;width:100%;border-bottom:1px solid #dadce0;pointer-events:none}.ec-body:not(.ec-compact) .ec-line:nth-child(even):after{border-bottom-style:dotted}
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { is_function, tick, noop, SvelteComponent, init, safe_not_equal, empty, insert, detach, destroy_each, component_subscribe, set_store_value, element, text, attr, append, listen, set_data, space, transition_in, group_outros, transition_out, check_outros, create_component, mount_component, destroy_component, set_style } from 'svelte/internal';
|
|
1
|
+
import { is_function, tick, noop, identity, SvelteComponent, init, safe_not_equal, empty, insert, detach, destroy_each, component_subscribe, set_store_value, element, text, attr, append, listen, set_data, space, transition_in, group_outros, transition_out, check_outros, create_component, mount_component, destroy_component, set_style } from 'svelte/internal';
|
|
2
2
|
import { getContext, setContext } from 'svelte';
|
|
3
3
|
import { derived, writable, get } from 'svelte/store';
|
|
4
4
|
import { setMidnight, createDate, createDuration, createEvents, createEventSources, assign, cloneDate, prevClosestDay, addDuration, subtractDay, derived2, addDay, createView, nextClosestDay, DAY_IN_SECONDS, toLocalDate, toISOString, writable2, intl, intlRange, subtractDuration, toEventWithLocalDates, toViewWithLocalDates } from '@event-calendar/common';
|
|
@@ -361,9 +361,12 @@ class State {
|
|
|
361
361
|
this._viewDates = viewDates(this);
|
|
362
362
|
this._view = view(this);
|
|
363
363
|
this._viewComponent = writable(undefined);
|
|
364
|
+
// Interaction
|
|
364
365
|
this._interaction = writable({});
|
|
365
|
-
this.
|
|
366
|
-
this.
|
|
366
|
+
this._interactionEvents = writable([null, null]); // drag, pointer
|
|
367
|
+
this._draggable = writable(noop);
|
|
368
|
+
this._classes = writable(identity);
|
|
369
|
+
this._scroll = writable(undefined);
|
|
367
370
|
|
|
368
371
|
// Let plugins create their private stores
|
|
369
372
|
for (let plugin of plugins) {
|
|
@@ -1227,7 +1230,7 @@ function create_fragment(ctx) {
|
|
|
1227
1230
|
switch_instance0 = new switch_value(switch_props());
|
|
1228
1231
|
}
|
|
1229
1232
|
|
|
1230
|
-
var switch_value_1 = /*$
|
|
1233
|
+
var switch_value_1 = /*$_interaction*/ ctx[3].component;
|
|
1231
1234
|
|
|
1232
1235
|
function switch_props_1(ctx) {
|
|
1233
1236
|
return {};
|
|
@@ -1288,7 +1291,7 @@ function create_fragment(ctx) {
|
|
|
1288
1291
|
}
|
|
1289
1292
|
}
|
|
1290
1293
|
|
|
1291
|
-
if (switch_value_1 !== (switch_value_1 = /*$
|
|
1294
|
+
if (switch_value_1 !== (switch_value_1 = /*$_interaction*/ ctx[3].component)) {
|
|
1292
1295
|
if (switch_instance1) {
|
|
1293
1296
|
group_outros();
|
|
1294
1297
|
const old_component = switch_instance1;
|
|
@@ -1344,14 +1347,14 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
1344
1347
|
let $theme;
|
|
1345
1348
|
let $height;
|
|
1346
1349
|
let $_viewComponent;
|
|
1347
|
-
let $
|
|
1350
|
+
let $_interaction;
|
|
1348
1351
|
let { plugins = [] } = $$props;
|
|
1349
1352
|
let { options = {} } = $$props;
|
|
1350
1353
|
let state = new State(plugins, options);
|
|
1351
1354
|
setContext('state', state);
|
|
1352
|
-
let { _viewComponent,
|
|
1355
|
+
let { _viewComponent, _interaction, height, theme } = state;
|
|
1353
1356
|
component_subscribe($$self, _viewComponent, value => $$invalidate(2, $_viewComponent = value));
|
|
1354
|
-
component_subscribe($$self,
|
|
1357
|
+
component_subscribe($$self, _interaction, value => $$invalidate(3, $_interaction = value));
|
|
1355
1358
|
component_subscribe($$self, height, value => $$invalidate(1, $height = value));
|
|
1356
1359
|
component_subscribe($$self, theme, value => $$invalidate(0, $theme = value));
|
|
1357
1360
|
|
|
@@ -1435,9 +1438,9 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
1435
1438
|
$theme,
|
|
1436
1439
|
$height,
|
|
1437
1440
|
$_viewComponent,
|
|
1438
|
-
$
|
|
1441
|
+
$_interaction,
|
|
1439
1442
|
_viewComponent,
|
|
1440
|
-
|
|
1443
|
+
_interaction,
|
|
1441
1444
|
height,
|
|
1442
1445
|
theme,
|
|
1443
1446
|
plugins,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event-calendar/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"title": "Event Calendar Core package",
|
|
5
5
|
"description": "Full-sized drag & drop event calendar with resource view",
|
|
6
6
|
"keywords": ["calendar", "event", "resource", "full-sized"],
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"./package.json": "./package.json"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@event-calendar/common": "~0.
|
|
21
|
+
"@event-calendar/common": "~0.6.0",
|
|
22
22
|
"svelte": "^3.42.4"
|
|
23
23
|
}
|
|
24
24
|
}
|