@event-calendar/core 0.17.0 → 0.18.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 +44 -6
- package/index.css +1 -0
- package/index.js +298 -143
- package/package.json +2 -2
- package/src/Auxiliary.svelte +27 -0
- package/src/Calendar.svelte +2 -1
- package/src/index.scss +1 -0
- package/src/storage/state.js +4 -1
- package/src/storage/stores.js +2 -20
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# Event Calendar [](https://www.jsdelivr.com/package/npm/@event-calendar/build) [](https://www.npmjs.com/package/@event-calendar/core)
|
|
1
|
+
# Event Calendar [](https://www.jsdelivr.com/package/npm/@event-calendar/build) [](https://www.npmjs.com/package/@event-calendar/core)
|
|
2
2
|
|
|
3
3
|
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 (38kb [br](https://en.wikipedia.org/wiki/Brotli) compressed)
|
|
8
8
|
* Zero-dependency (pre-built bundle)
|
|
9
|
-
* Used
|
|
9
|
+
* Used on over 60,000 websites with [Bookly](https://wordpress.org/plugins/bookly-responsive-appointment-booking-tool/)
|
|
10
10
|
|
|
11
11
|
Inspired by [FullCalendar](https://fullcalendar.io/), implements similar options.
|
|
12
12
|
|
|
@@ -192,8 +192,8 @@ import '@event-calendar/core/index.css';
|
|
|
192
192
|
### Pre-built browser ready bundle
|
|
193
193
|
Include the following lines of code in the `<head>` section of your page:
|
|
194
194
|
```html
|
|
195
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.
|
|
196
|
-
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.
|
|
195
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.18.0/event-calendar.min.css">
|
|
196
|
+
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.18.0/event-calendar.min.js"></script>
|
|
197
197
|
```
|
|
198
198
|
|
|
199
199
|
<details>
|
|
@@ -476,6 +476,7 @@ Determines whether to display an event’s end time.
|
|
|
476
476
|
### dragScroll
|
|
477
477
|
- Type `boolean`
|
|
478
478
|
- Default `true`
|
|
479
|
+
- Requires `Interaction` plugin
|
|
479
480
|
|
|
480
481
|
Determines whether the calendar should automatically scroll during the event drag-and-drop when the mouse crosses the edge.
|
|
481
482
|
|
|
@@ -500,6 +501,7 @@ This should be a value that can be parsed into a [Duration](#duration-object) ob
|
|
|
500
501
|
### editable
|
|
501
502
|
- Type `boolean`
|
|
502
503
|
- Default `false`
|
|
504
|
+
- Requires `Interaction` plugin
|
|
503
505
|
|
|
504
506
|
Determines whether the events on the calendar can be dragged and resized (both at the same time).
|
|
505
507
|
|
|
@@ -668,12 +670,14 @@ The current [View](#view-object) object
|
|
|
668
670
|
### eventDragMinDistance
|
|
669
671
|
- Type `integer`
|
|
670
672
|
- Default `5`
|
|
673
|
+
- Requires `Interaction` plugin
|
|
671
674
|
|
|
672
675
|
Defines how many pixels the user’s mouse must move before the event dragging begins.
|
|
673
676
|
|
|
674
677
|
### eventDragStart
|
|
675
678
|
- Type `function`
|
|
676
679
|
- Default `undefined`
|
|
680
|
+
- Requires `Interaction` plugin
|
|
677
681
|
|
|
678
682
|
Callback function that is triggered when the event dragging begins.
|
|
679
683
|
|
|
@@ -714,6 +718,7 @@ The current [View](#view-object) object
|
|
|
714
718
|
### eventDragStop
|
|
715
719
|
- Type `function`
|
|
716
720
|
- Default `undefined`
|
|
721
|
+
- Requires `Interaction` plugin
|
|
717
722
|
|
|
718
723
|
Callback function that is triggered when the event dragging stops.
|
|
719
724
|
|
|
@@ -756,6 +761,7 @@ The current [View](#view-object) object
|
|
|
756
761
|
### eventDrop
|
|
757
762
|
- Type `function`
|
|
758
763
|
- Default `undefined`
|
|
764
|
+
- Requires `Interaction` plugin
|
|
759
765
|
|
|
760
766
|
Callback function that is triggered when dragging stops, and the event has moved to a different day/time.
|
|
761
767
|
|
|
@@ -848,12 +854,14 @@ The current [View](#view-object) object
|
|
|
848
854
|
### eventDurationEditable
|
|
849
855
|
- Type `boolean`
|
|
850
856
|
- Default `true`
|
|
857
|
+
- Requires `Interaction` plugin
|
|
851
858
|
|
|
852
859
|
Determines whether calendar events can be resized.
|
|
853
860
|
|
|
854
861
|
### eventLongPressDelay
|
|
855
862
|
- Type `integer`
|
|
856
863
|
- Default `undefined`
|
|
864
|
+
- Requires `Interaction` plugin
|
|
857
865
|
|
|
858
866
|
For touch devices, the amount of time (in milliseconds) the user must hold down a tap before the event becomes draggable/resizable.
|
|
859
867
|
|
|
@@ -956,6 +964,7 @@ The current [View](#view-object) object
|
|
|
956
964
|
### eventResize
|
|
957
965
|
- Type `function`
|
|
958
966
|
- Default `undefined`
|
|
967
|
+
- Requires `Interaction` plugin
|
|
959
968
|
|
|
960
969
|
Callback function that is triggered when resizing stops, and the duration of the event has changed.
|
|
961
970
|
|
|
@@ -1028,6 +1037,7 @@ The current [View](#view-object) object
|
|
|
1028
1037
|
### eventResizeStart
|
|
1029
1038
|
- Type `function`
|
|
1030
1039
|
- Default `undefined`
|
|
1040
|
+
- Requires `Interaction` plugin
|
|
1031
1041
|
|
|
1032
1042
|
Callback function that is triggered when the event resizing begins.
|
|
1033
1043
|
|
|
@@ -1068,6 +1078,7 @@ The current [View](#view-object) object
|
|
|
1068
1078
|
### eventResizeStop
|
|
1069
1079
|
- Type `function`
|
|
1070
1080
|
- Default `undefined`
|
|
1081
|
+
- Requires `Interaction` plugin
|
|
1071
1082
|
|
|
1072
1083
|
Callback function that is triggered when the event resizing stops.
|
|
1073
1084
|
|
|
@@ -1209,6 +1220,7 @@ Instead of calling `successCallback` and `failureCallback`, you may return the r
|
|
|
1209
1220
|
### eventStartEditable
|
|
1210
1221
|
- Type `boolean`
|
|
1211
1222
|
- Default `true`
|
|
1223
|
+
- Requires `Interaction` plugin
|
|
1212
1224
|
|
|
1213
1225
|
Determines whether the events on the calendar can be dragged.
|
|
1214
1226
|
|
|
@@ -1507,6 +1519,7 @@ Enables a marker indicating the current time in `timeGrid`/`resourceTimeGrid` vi
|
|
|
1507
1519
|
### pointer
|
|
1508
1520
|
- Type `boolean`
|
|
1509
1521
|
- Default `false`
|
|
1522
|
+
- Requires `Interaction` plugin
|
|
1510
1523
|
|
|
1511
1524
|
Enables mouse cursor pointer in `timeGrid`/`resourceTimeGrid` views.
|
|
1512
1525
|
|
|
@@ -1590,6 +1603,7 @@ The associated [Resource](#resource-object) object
|
|
|
1590
1603
|
### select
|
|
1591
1604
|
- Type `function`
|
|
1592
1605
|
- Default `undefined`
|
|
1606
|
+
- Requires `Interaction` plugin
|
|
1593
1607
|
|
|
1594
1608
|
Callback function that is triggered when a date/time selection is made.
|
|
1595
1609
|
|
|
@@ -1667,12 +1681,14 @@ If the current view is a resource view, the [Resource](#resource-object) object
|
|
|
1667
1681
|
### selectable
|
|
1668
1682
|
- Type `boolean`
|
|
1669
1683
|
- Default `false`
|
|
1684
|
+
- Requires `Interaction` plugin
|
|
1670
1685
|
|
|
1671
1686
|
Determines whether the user is allowed to highlight multiple days or time slots by clicking and moving the pointer.
|
|
1672
1687
|
|
|
1673
1688
|
### selectBackgroundColor
|
|
1674
1689
|
- Type `string`
|
|
1675
1690
|
- Default `undefined`
|
|
1691
|
+
- Requires `Interaction` plugin
|
|
1676
1692
|
|
|
1677
1693
|
Sets the background color for the event indicating the current selection. See [selectable](#selectable).
|
|
1678
1694
|
|
|
@@ -1681,6 +1697,7 @@ You can use any of the CSS color formats such `'#f00'`, `'#ff0000'`, `'rgb(255,0
|
|
|
1681
1697
|
### selectLongPressDelay
|
|
1682
1698
|
- Type `integer`
|
|
1683
1699
|
- Default `undefined`
|
|
1700
|
+
- Requires `Interaction` plugin
|
|
1684
1701
|
|
|
1685
1702
|
For touch devices, the amount of time (in milliseconds) the user must hold down a tap before the date becomes selectable.
|
|
1686
1703
|
|
|
@@ -1689,6 +1706,7 @@ If not specified, it falls back to [longPressDelay](#longpressdelay).
|
|
|
1689
1706
|
### selectMinDistance
|
|
1690
1707
|
- Type `integer`
|
|
1691
1708
|
- Default `5`
|
|
1709
|
+
- Requires `Interaction` plugin
|
|
1692
1710
|
|
|
1693
1711
|
Defines how many pixels the user’s mouse must move before the selection begins.
|
|
1694
1712
|
|
|
@@ -1811,6 +1829,7 @@ function (date) {
|
|
|
1811
1829
|
### unselect
|
|
1812
1830
|
- Type `function`
|
|
1813
1831
|
- Default `undefined`
|
|
1832
|
+
- Requires `Interaction` plugin
|
|
1814
1833
|
|
|
1815
1834
|
Callback function that is triggered when the current selection is cleared.
|
|
1816
1835
|
|
|
@@ -1852,12 +1871,14 @@ The current [View](#view-object) object
|
|
|
1852
1871
|
### unselectAuto
|
|
1853
1872
|
- Type `boolean`
|
|
1854
1873
|
- Default `true`
|
|
1874
|
+
- Requires `Interaction` plugin
|
|
1855
1875
|
|
|
1856
1876
|
Determines whether clicking elsewhere on the page will clear the current selection. See [selectable](#selectable).
|
|
1857
1877
|
|
|
1858
1878
|
### unselectCancel
|
|
1859
1879
|
- Type `string`
|
|
1860
1880
|
- Default `''`
|
|
1881
|
+
- Requires `Interaction` plugin
|
|
1861
1882
|
|
|
1862
1883
|
A CSS selector that specifies elements that will ignore the [unselectAuto](#unselectauto) option.
|
|
1863
1884
|
|
|
@@ -2179,7 +2200,7 @@ Here are all admissible fields for the event’s input object:
|
|
|
2179
2200
|
</td>
|
|
2180
2201
|
<td>
|
|
2181
2202
|
|
|
2182
|
-
`boolean` Determines if the event is shown in the all-day slot.
|
|
2203
|
+
`boolean` Determines if the event is shown in the all-day slot. Defaults to `true` if `start` and `end` are both passed without a time part, `false` otherwise
|
|
2183
2204
|
</td>
|
|
2184
2205
|
</tr>
|
|
2185
2206
|
<tr>
|
|
@@ -2360,6 +2381,13 @@ Here are all properties that exist in Resource object:
|
|
|
2360
2381
|
</td>
|
|
2361
2382
|
<td>The HTML version of the title</td>
|
|
2362
2383
|
</tr>
|
|
2384
|
+
<tr>
|
|
2385
|
+
<td>
|
|
2386
|
+
|
|
2387
|
+
`eventBackgroundColor`
|
|
2388
|
+
</td>
|
|
2389
|
+
<td>Default background color for this resource's events</td>
|
|
2390
|
+
</tr>
|
|
2363
2391
|
</table>
|
|
2364
2392
|
|
|
2365
2393
|
### Parsing resource from a plain object
|
|
@@ -2397,6 +2425,16 @@ Here are all admissible fields for the resource’s input object:
|
|
|
2397
2425
|
`string` The HTML version of the title to be displayed instead of the text version. Default `''`
|
|
2398
2426
|
</td>
|
|
2399
2427
|
</tr>
|
|
2428
|
+
<tr>
|
|
2429
|
+
<td>
|
|
2430
|
+
|
|
2431
|
+
`eventBackgroundColor`
|
|
2432
|
+
</td>
|
|
2433
|
+
<td>
|
|
2434
|
+
|
|
2435
|
+
`string` Sets the default background color for this resource's events just like the calendar-wide [eventBackgroundColor](#eventbackgroundcolor) option. Default `undefined`
|
|
2436
|
+
</td>
|
|
2437
|
+
</tr>
|
|
2400
2438
|
</table>
|
|
2401
2439
|
|
|
2402
2440
|
## View object
|
package/index.css
CHANGED
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { is_function, noop, identity, tick, SvelteComponent, init, safe_not_equal, empty, insert, destroy_each, detach, component_subscribe, set_store_value, element, text, attr, append, listen, set_data, transition_in, group_outros, check_outros, transition_out, space, create_component, mount_component, destroy_component, construct_svelte_component, set_style, get_current_component } from 'svelte/internal';
|
|
2
2
|
import { getContext, setContext, beforeUpdate } from 'svelte';
|
|
3
3
|
import { derived, writable, readable, get } from 'svelte/store';
|
|
4
|
-
import { assign, setMidnight, createDate, createDuration, createEvents, createEventSources, cloneDate, prevClosestDay, nextClosestDay, DAY_IN_SECONDS, addDuration, subtractDay,
|
|
4
|
+
import { assign, setMidnight, createDate, createDuration, createEvents, createEventSources, cloneDate, prevClosestDay, nextClosestDay, DAY_IN_SECONDS, addDuration, subtractDay, derived2, addDay, createView, debounce, toISOString, toLocalDate, writable2, intl, intlRange, subtractDuration, toViewWithLocalDates, flushDebounce, toEventWithLocalDates, hasFn, runFn, ignore } from '@event-calendar/common';
|
|
5
5
|
|
|
6
6
|
function createOptions(plugins) {
|
|
7
7
|
let options = {
|
|
@@ -157,7 +157,7 @@ function diff(options) {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
function activeRange(state) {
|
|
160
|
-
|
|
160
|
+
return derived(
|
|
161
161
|
[state._currentRange, state.firstDay, state.monthMode, state.slotMinTime, state.slotMaxTime],
|
|
162
162
|
([$_currentRange, $firstDay, $monthMode, $slotMinTime, $slotMaxTime]) => {
|
|
163
163
|
let start = cloneDate($_currentRange.start);
|
|
@@ -178,24 +178,6 @@ function activeRange(state) {
|
|
|
178
178
|
return {start, end};
|
|
179
179
|
}
|
|
180
180
|
);
|
|
181
|
-
|
|
182
|
-
let debounceHandle = {};
|
|
183
|
-
derived([_activeRange, state.datesSet], values => {
|
|
184
|
-
let [, $datesSet] = values;
|
|
185
|
-
if ($datesSet) {
|
|
186
|
-
debounce(() => {
|
|
187
|
-
let [$_activeRange, $datesSet] = values;
|
|
188
|
-
$datesSet({
|
|
189
|
-
start: toLocalDate($_activeRange.start),
|
|
190
|
-
end: toLocalDate($_activeRange.end),
|
|
191
|
-
startStr: toISOString($_activeRange.start),
|
|
192
|
-
endStr: toISOString($_activeRange.end)
|
|
193
|
-
});
|
|
194
|
-
}, debounceHandle, state._queue);
|
|
195
|
-
}
|
|
196
|
-
}).subscribe(noop);
|
|
197
|
-
|
|
198
|
-
return _activeRange;
|
|
199
181
|
}
|
|
200
182
|
|
|
201
183
|
function currentRange(state) {
|
|
@@ -374,6 +356,7 @@ class State {
|
|
|
374
356
|
|
|
375
357
|
// Private stores
|
|
376
358
|
this._queue = writable(new Map()); // debounce queue
|
|
359
|
+
this._auxiliary = writable([]); // auxiliary components
|
|
377
360
|
this._currentRange = currentRange(this);
|
|
378
361
|
this._activeRange = activeRange(this);
|
|
379
362
|
this._fetchedRange = writable({start: undefined, end: undefined});
|
|
@@ -391,6 +374,8 @@ class State {
|
|
|
391
374
|
this._view = view(this);
|
|
392
375
|
this._viewComponent = writable(undefined);
|
|
393
376
|
this._viewClass = writable(undefined);
|
|
377
|
+
// Resources
|
|
378
|
+
this._resBgColor = writable(noop);
|
|
394
379
|
// Interaction
|
|
395
380
|
this._interaction = writable({});
|
|
396
381
|
this._iEvents = writable([null, null]); // interaction events: [drag/resize, pointer]
|
|
@@ -470,7 +455,7 @@ function parseOpts(opts, state) {
|
|
|
470
455
|
|
|
471
456
|
/* packages/core/src/Buttons.svelte generated by Svelte v3.55.1 */
|
|
472
457
|
|
|
473
|
-
function get_each_context$
|
|
458
|
+
function get_each_context$2(ctx, list, i) {
|
|
474
459
|
const child_ctx = ctx.slice();
|
|
475
460
|
child_ctx[23] = list[i];
|
|
476
461
|
return child_ctx;
|
|
@@ -688,7 +673,7 @@ function create_if_block$1(ctx) {
|
|
|
688
673
|
}
|
|
689
674
|
|
|
690
675
|
// (28:0) {#each buttons as button}
|
|
691
|
-
function create_each_block$
|
|
676
|
+
function create_each_block$2(ctx) {
|
|
692
677
|
let if_block_anchor;
|
|
693
678
|
|
|
694
679
|
function select_block_type(ctx, dirty) {
|
|
@@ -732,13 +717,13 @@ function create_each_block$1(ctx) {
|
|
|
732
717
|
};
|
|
733
718
|
}
|
|
734
719
|
|
|
735
|
-
function create_fragment$
|
|
720
|
+
function create_fragment$3(ctx) {
|
|
736
721
|
let each_1_anchor;
|
|
737
722
|
let each_value = /*buttons*/ ctx[0];
|
|
738
723
|
let each_blocks = [];
|
|
739
724
|
|
|
740
725
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
741
|
-
each_blocks[i] = create_each_block$
|
|
726
|
+
each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
|
|
742
727
|
}
|
|
743
728
|
|
|
744
729
|
return {
|
|
@@ -762,12 +747,12 @@ function create_fragment$2(ctx) {
|
|
|
762
747
|
let i;
|
|
763
748
|
|
|
764
749
|
for (i = 0; i < each_value.length; i += 1) {
|
|
765
|
-
const child_ctx = get_each_context$
|
|
750
|
+
const child_ctx = get_each_context$2(ctx, each_value, i);
|
|
766
751
|
|
|
767
752
|
if (each_blocks[i]) {
|
|
768
753
|
each_blocks[i].p(child_ctx, dirty);
|
|
769
754
|
} else {
|
|
770
|
-
each_blocks[i] = create_each_block$
|
|
755
|
+
each_blocks[i] = create_each_block$2(child_ctx);
|
|
771
756
|
each_blocks[i].c();
|
|
772
757
|
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
|
|
773
758
|
}
|
|
@@ -789,7 +774,7 @@ function create_fragment$2(ctx) {
|
|
|
789
774
|
};
|
|
790
775
|
}
|
|
791
776
|
|
|
792
|
-
function instance$
|
|
777
|
+
function instance$3($$self, $$props, $$invalidate) {
|
|
793
778
|
let $duration;
|
|
794
779
|
let $date;
|
|
795
780
|
let $hiddenDays;
|
|
@@ -867,13 +852,13 @@ function instance$2($$self, $$props, $$invalidate) {
|
|
|
867
852
|
class Buttons extends SvelteComponent {
|
|
868
853
|
constructor(options) {
|
|
869
854
|
super();
|
|
870
|
-
init(this, options, instance$
|
|
855
|
+
init(this, options, instance$3, create_fragment$3, safe_not_equal, { buttons: 0 });
|
|
871
856
|
}
|
|
872
857
|
}
|
|
873
858
|
|
|
874
859
|
/* packages/core/src/Toolbar.svelte generated by Svelte v3.55.1 */
|
|
875
860
|
|
|
876
|
-
function get_each_context(ctx, list, i) {
|
|
861
|
+
function get_each_context$1(ctx, list, i) {
|
|
877
862
|
const child_ctx = ctx.slice();
|
|
878
863
|
child_ctx[5] = list[i];
|
|
879
864
|
return child_ctx;
|
|
@@ -1034,7 +1019,7 @@ function create_each_block_1(ctx) {
|
|
|
1034
1019
|
}
|
|
1035
1020
|
|
|
1036
1021
|
// (21:4) {#each Object.keys(sections) as key}
|
|
1037
|
-
function create_each_block(ctx) {
|
|
1022
|
+
function create_each_block$1(ctx) {
|
|
1038
1023
|
let div;
|
|
1039
1024
|
let t;
|
|
1040
1025
|
let current;
|
|
@@ -1122,7 +1107,7 @@ function create_each_block(ctx) {
|
|
|
1122
1107
|
};
|
|
1123
1108
|
}
|
|
1124
1109
|
|
|
1125
|
-
function create_fragment$
|
|
1110
|
+
function create_fragment$2(ctx) {
|
|
1126
1111
|
let div;
|
|
1127
1112
|
let div_class_value;
|
|
1128
1113
|
let current;
|
|
@@ -1130,7 +1115,7 @@ function create_fragment$1(ctx) {
|
|
|
1130
1115
|
let each_blocks = [];
|
|
1131
1116
|
|
|
1132
1117
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
1133
|
-
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
|
1118
|
+
each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
|
|
1134
1119
|
}
|
|
1135
1120
|
|
|
1136
1121
|
const out = i => transition_out(each_blocks[i], 1, 1, () => {
|
|
@@ -1162,13 +1147,13 @@ function create_fragment$1(ctx) {
|
|
|
1162
1147
|
let i;
|
|
1163
1148
|
|
|
1164
1149
|
for (i = 0; i < each_value.length; i += 1) {
|
|
1165
|
-
const child_ctx = get_each_context(ctx, each_value, i);
|
|
1150
|
+
const child_ctx = get_each_context$1(ctx, each_value, i);
|
|
1166
1151
|
|
|
1167
1152
|
if (each_blocks[i]) {
|
|
1168
1153
|
each_blocks[i].p(child_ctx, dirty);
|
|
1169
1154
|
transition_in(each_blocks[i], 1);
|
|
1170
1155
|
} else {
|
|
1171
|
-
each_blocks[i] = create_each_block(child_ctx);
|
|
1156
|
+
each_blocks[i] = create_each_block$1(child_ctx);
|
|
1172
1157
|
each_blocks[i].c();
|
|
1173
1158
|
transition_in(each_blocks[i], 1);
|
|
1174
1159
|
each_blocks[i].m(div, null);
|
|
@@ -1213,7 +1198,7 @@ function create_fragment$1(ctx) {
|
|
|
1213
1198
|
};
|
|
1214
1199
|
}
|
|
1215
1200
|
|
|
1216
|
-
function instance$
|
|
1201
|
+
function instance$2($$self, $$props, $$invalidate) {
|
|
1217
1202
|
let $headerToolbar;
|
|
1218
1203
|
let $theme;
|
|
1219
1204
|
let { headerToolbar, theme } = getContext('state');
|
|
@@ -1235,6 +1220,206 @@ function instance$1($$self, $$props, $$invalidate) {
|
|
|
1235
1220
|
}
|
|
1236
1221
|
|
|
1237
1222
|
class Toolbar extends SvelteComponent {
|
|
1223
|
+
constructor(options) {
|
|
1224
|
+
super();
|
|
1225
|
+
init(this, options, instance$2, create_fragment$2, safe_not_equal, {});
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
/* packages/core/src/Auxiliary.svelte generated by Svelte v3.55.1 */
|
|
1230
|
+
|
|
1231
|
+
function get_each_context(ctx, list, i) {
|
|
1232
|
+
const child_ctx = ctx.slice();
|
|
1233
|
+
child_ctx[11] = list[i];
|
|
1234
|
+
return child_ctx;
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
// (25:0) {#each $_auxiliary as component}
|
|
1238
|
+
function create_each_block(ctx) {
|
|
1239
|
+
let switch_instance;
|
|
1240
|
+
let switch_instance_anchor;
|
|
1241
|
+
let current;
|
|
1242
|
+
var switch_value = /*component*/ ctx[11];
|
|
1243
|
+
|
|
1244
|
+
function switch_props(ctx) {
|
|
1245
|
+
return {};
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
if (switch_value) {
|
|
1249
|
+
switch_instance = construct_svelte_component(switch_value, switch_props());
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
return {
|
|
1253
|
+
c() {
|
|
1254
|
+
if (switch_instance) create_component(switch_instance.$$.fragment);
|
|
1255
|
+
switch_instance_anchor = empty();
|
|
1256
|
+
},
|
|
1257
|
+
m(target, anchor) {
|
|
1258
|
+
if (switch_instance) mount_component(switch_instance, target, anchor);
|
|
1259
|
+
insert(target, switch_instance_anchor, anchor);
|
|
1260
|
+
current = true;
|
|
1261
|
+
},
|
|
1262
|
+
p(ctx, dirty) {
|
|
1263
|
+
if (switch_value !== (switch_value = /*component*/ ctx[11])) {
|
|
1264
|
+
if (switch_instance) {
|
|
1265
|
+
group_outros();
|
|
1266
|
+
const old_component = switch_instance;
|
|
1267
|
+
|
|
1268
|
+
transition_out(old_component.$$.fragment, 1, 0, () => {
|
|
1269
|
+
destroy_component(old_component, 1);
|
|
1270
|
+
});
|
|
1271
|
+
|
|
1272
|
+
check_outros();
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
if (switch_value) {
|
|
1276
|
+
switch_instance = construct_svelte_component(switch_value, switch_props());
|
|
1277
|
+
create_component(switch_instance.$$.fragment);
|
|
1278
|
+
transition_in(switch_instance.$$.fragment, 1);
|
|
1279
|
+
mount_component(switch_instance, switch_instance_anchor.parentNode, switch_instance_anchor);
|
|
1280
|
+
} else {
|
|
1281
|
+
switch_instance = null;
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
},
|
|
1285
|
+
i(local) {
|
|
1286
|
+
if (current) return;
|
|
1287
|
+
if (switch_instance) transition_in(switch_instance.$$.fragment, local);
|
|
1288
|
+
current = true;
|
|
1289
|
+
},
|
|
1290
|
+
o(local) {
|
|
1291
|
+
if (switch_instance) transition_out(switch_instance.$$.fragment, local);
|
|
1292
|
+
current = false;
|
|
1293
|
+
},
|
|
1294
|
+
d(detaching) {
|
|
1295
|
+
if (detaching) detach(switch_instance_anchor);
|
|
1296
|
+
if (switch_instance) destroy_component(switch_instance, detaching);
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
function create_fragment$1(ctx) {
|
|
1302
|
+
let each_1_anchor;
|
|
1303
|
+
let current;
|
|
1304
|
+
let each_value = /*$_auxiliary*/ ctx[0];
|
|
1305
|
+
let each_blocks = [];
|
|
1306
|
+
|
|
1307
|
+
for (let i = 0; i < each_value.length; i += 1) {
|
|
1308
|
+
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
const out = i => transition_out(each_blocks[i], 1, 1, () => {
|
|
1312
|
+
each_blocks[i] = null;
|
|
1313
|
+
});
|
|
1314
|
+
|
|
1315
|
+
return {
|
|
1316
|
+
c() {
|
|
1317
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
1318
|
+
each_blocks[i].c();
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
each_1_anchor = empty();
|
|
1322
|
+
},
|
|
1323
|
+
m(target, anchor) {
|
|
1324
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
1325
|
+
each_blocks[i].m(target, anchor);
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
insert(target, each_1_anchor, anchor);
|
|
1329
|
+
current = true;
|
|
1330
|
+
},
|
|
1331
|
+
p(ctx, [dirty]) {
|
|
1332
|
+
if (dirty & /*$_auxiliary*/ 1) {
|
|
1333
|
+
each_value = /*$_auxiliary*/ ctx[0];
|
|
1334
|
+
let i;
|
|
1335
|
+
|
|
1336
|
+
for (i = 0; i < each_value.length; i += 1) {
|
|
1337
|
+
const child_ctx = get_each_context(ctx, each_value, i);
|
|
1338
|
+
|
|
1339
|
+
if (each_blocks[i]) {
|
|
1340
|
+
each_blocks[i].p(child_ctx, dirty);
|
|
1341
|
+
transition_in(each_blocks[i], 1);
|
|
1342
|
+
} else {
|
|
1343
|
+
each_blocks[i] = create_each_block(child_ctx);
|
|
1344
|
+
each_blocks[i].c();
|
|
1345
|
+
transition_in(each_blocks[i], 1);
|
|
1346
|
+
each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
group_outros();
|
|
1351
|
+
|
|
1352
|
+
for (i = each_value.length; i < each_blocks.length; i += 1) {
|
|
1353
|
+
out(i);
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
check_outros();
|
|
1357
|
+
}
|
|
1358
|
+
},
|
|
1359
|
+
i(local) {
|
|
1360
|
+
if (current) return;
|
|
1361
|
+
|
|
1362
|
+
for (let i = 0; i < each_value.length; i += 1) {
|
|
1363
|
+
transition_in(each_blocks[i]);
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
current = true;
|
|
1367
|
+
},
|
|
1368
|
+
o(local) {
|
|
1369
|
+
each_blocks = each_blocks.filter(Boolean);
|
|
1370
|
+
|
|
1371
|
+
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
1372
|
+
transition_out(each_blocks[i]);
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
current = false;
|
|
1376
|
+
},
|
|
1377
|
+
d(detaching) {
|
|
1378
|
+
destroy_each(each_blocks, detaching);
|
|
1379
|
+
if (detaching) detach(each_1_anchor);
|
|
1380
|
+
}
|
|
1381
|
+
};
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
function instance$1($$self, $$props, $$invalidate) {
|
|
1385
|
+
let $_view;
|
|
1386
|
+
let $datesSet;
|
|
1387
|
+
let $_activeRange;
|
|
1388
|
+
let $_auxiliary;
|
|
1389
|
+
let { datesSet, _auxiliary, _activeRange, _queue, _view } = getContext('state');
|
|
1390
|
+
component_subscribe($$self, datesSet, value => $$invalidate(7, $datesSet = value));
|
|
1391
|
+
component_subscribe($$self, _auxiliary, value => $$invalidate(0, $_auxiliary = value));
|
|
1392
|
+
component_subscribe($$self, _activeRange, value => $$invalidate(5, $_activeRange = value));
|
|
1393
|
+
component_subscribe($$self, _view, value => $$invalidate(6, $_view = value));
|
|
1394
|
+
let debounceHandle = {};
|
|
1395
|
+
|
|
1396
|
+
function runDatesSet(_activeRange) {
|
|
1397
|
+
if (is_function($datesSet)) {
|
|
1398
|
+
debounce(
|
|
1399
|
+
() => $datesSet({
|
|
1400
|
+
start: toLocalDate(_activeRange.start),
|
|
1401
|
+
end: toLocalDate(_activeRange.end),
|
|
1402
|
+
startStr: toISOString(_activeRange.start),
|
|
1403
|
+
endStr: toISOString(_activeRange.end),
|
|
1404
|
+
view: toViewWithLocalDates($_view)
|
|
1405
|
+
}),
|
|
1406
|
+
debounceHandle,
|
|
1407
|
+
_queue
|
|
1408
|
+
);
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
$$self.$$.update = () => {
|
|
1413
|
+
if ($$self.$$.dirty & /*$_activeRange*/ 32) {
|
|
1414
|
+
// Set up datesSet callback
|
|
1415
|
+
runDatesSet($_activeRange);
|
|
1416
|
+
}
|
|
1417
|
+
};
|
|
1418
|
+
|
|
1419
|
+
return [$_auxiliary, datesSet, _auxiliary, _activeRange, _view, $_activeRange];
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
class Auxiliary extends SvelteComponent {
|
|
1238
1423
|
constructor(options) {
|
|
1239
1424
|
super();
|
|
1240
1425
|
init(this, options, instance$1, create_fragment$1, safe_not_equal, {});
|
|
@@ -1247,70 +1432,62 @@ function create_fragment(ctx) {
|
|
|
1247
1432
|
let div;
|
|
1248
1433
|
let toolbar;
|
|
1249
1434
|
let t0;
|
|
1250
|
-
let
|
|
1251
|
-
let t1;
|
|
1252
|
-
let switch_instance1;
|
|
1435
|
+
let switch_instance;
|
|
1253
1436
|
let div_class_value;
|
|
1437
|
+
let t1;
|
|
1438
|
+
let auxiliary;
|
|
1254
1439
|
let current;
|
|
1255
1440
|
let mounted;
|
|
1256
1441
|
let dispose;
|
|
1257
1442
|
toolbar = new Toolbar({});
|
|
1258
|
-
var switch_value = /*$_viewComponent*/ ctx[
|
|
1443
|
+
var switch_value = /*$_viewComponent*/ ctx[4];
|
|
1259
1444
|
|
|
1260
1445
|
function switch_props(ctx) {
|
|
1261
1446
|
return {};
|
|
1262
1447
|
}
|
|
1263
1448
|
|
|
1264
1449
|
if (switch_value) {
|
|
1265
|
-
|
|
1450
|
+
switch_instance = construct_svelte_component(switch_value, switch_props());
|
|
1266
1451
|
}
|
|
1267
1452
|
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
function switch_props_1(ctx) {
|
|
1271
|
-
return {};
|
|
1272
|
-
}
|
|
1273
|
-
|
|
1274
|
-
if (switch_value_1) {
|
|
1275
|
-
switch_instance1 = construct_svelte_component(switch_value_1, switch_props_1());
|
|
1276
|
-
}
|
|
1453
|
+
auxiliary = new Auxiliary({});
|
|
1277
1454
|
|
|
1278
1455
|
return {
|
|
1279
1456
|
c() {
|
|
1280
1457
|
div = element("div");
|
|
1281
1458
|
create_component(toolbar.$$.fragment);
|
|
1282
1459
|
t0 = space();
|
|
1283
|
-
if (
|
|
1460
|
+
if (switch_instance) create_component(switch_instance.$$.fragment);
|
|
1284
1461
|
t1 = space();
|
|
1285
|
-
|
|
1462
|
+
create_component(auxiliary.$$.fragment);
|
|
1286
1463
|
|
|
1287
|
-
attr(div, "class", div_class_value = "" + (/*$theme*/ ctx[
|
|
1288
|
-
? ' ' + /*$theme*/ ctx[
|
|
1289
|
-
: '') + (/*$_iClass*/ ctx[
|
|
1290
|
-
? ' ' + /*$theme*/ ctx[
|
|
1464
|
+
attr(div, "class", div_class_value = "" + (/*$theme*/ ctx[0].calendar + (/*$_viewClass*/ ctx[1]
|
|
1465
|
+
? ' ' + /*$theme*/ ctx[0][/*$_viewClass*/ ctx[1]]
|
|
1466
|
+
: '') + (/*$_iClass*/ ctx[2]
|
|
1467
|
+
? ' ' + /*$theme*/ ctx[0][/*$_iClass*/ ctx[2]]
|
|
1291
1468
|
: '')));
|
|
1292
1469
|
|
|
1293
|
-
set_style(div, "height", /*$height*/ ctx[
|
|
1470
|
+
set_style(div, "height", /*$height*/ ctx[3]);
|
|
1294
1471
|
},
|
|
1295
1472
|
m(target, anchor) {
|
|
1296
1473
|
insert(target, div, anchor);
|
|
1297
1474
|
mount_component(toolbar, div, null);
|
|
1298
1475
|
append(div, t0);
|
|
1299
|
-
if (
|
|
1300
|
-
|
|
1301
|
-
|
|
1476
|
+
if (switch_instance) mount_component(switch_instance, div, null);
|
|
1477
|
+
insert(target, t1, anchor);
|
|
1478
|
+
mount_component(auxiliary, target, anchor);
|
|
1302
1479
|
current = true;
|
|
1303
1480
|
|
|
1304
1481
|
if (!mounted) {
|
|
1305
|
-
dispose = listen(window, "click", /*handleClick*/ ctx[
|
|
1482
|
+
dispose = listen(window, "click", /*handleClick*/ ctx[16], true);
|
|
1306
1483
|
mounted = true;
|
|
1307
1484
|
}
|
|
1308
1485
|
},
|
|
1309
1486
|
p(ctx, dirty) {
|
|
1310
|
-
if (switch_value !== (switch_value = /*$_viewComponent*/ ctx[
|
|
1311
|
-
if (
|
|
1487
|
+
if (switch_value !== (switch_value = /*$_viewComponent*/ ctx[4])) {
|
|
1488
|
+
if (switch_instance) {
|
|
1312
1489
|
group_outros();
|
|
1313
|
-
const old_component =
|
|
1490
|
+
const old_component = switch_instance;
|
|
1314
1491
|
|
|
1315
1492
|
transition_out(old_component.$$.fragment, 1, 0, () => {
|
|
1316
1493
|
destroy_component(old_component, 1);
|
|
@@ -1320,67 +1497,46 @@ function create_fragment(ctx) {
|
|
|
1320
1497
|
}
|
|
1321
1498
|
|
|
1322
1499
|
if (switch_value) {
|
|
1323
|
-
|
|
1324
|
-
create_component(
|
|
1325
|
-
transition_in(
|
|
1326
|
-
mount_component(
|
|
1500
|
+
switch_instance = construct_svelte_component(switch_value, switch_props());
|
|
1501
|
+
create_component(switch_instance.$$.fragment);
|
|
1502
|
+
transition_in(switch_instance.$$.fragment, 1);
|
|
1503
|
+
mount_component(switch_instance, div, null);
|
|
1327
1504
|
} else {
|
|
1328
|
-
|
|
1505
|
+
switch_instance = null;
|
|
1329
1506
|
}
|
|
1330
1507
|
}
|
|
1331
1508
|
|
|
1332
|
-
if (
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
transition_out(old_component.$$.fragment, 1, 0, () => {
|
|
1338
|
-
destroy_component(old_component, 1);
|
|
1339
|
-
});
|
|
1340
|
-
|
|
1341
|
-
check_outros();
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
if (switch_value_1) {
|
|
1345
|
-
switch_instance1 = construct_svelte_component(switch_value_1, switch_props_1());
|
|
1346
|
-
create_component(switch_instance1.$$.fragment);
|
|
1347
|
-
transition_in(switch_instance1.$$.fragment, 1);
|
|
1348
|
-
mount_component(switch_instance1, div, null);
|
|
1349
|
-
} else {
|
|
1350
|
-
switch_instance1 = null;
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
if (!current || dirty[0] & /*$theme, $_viewClass, $_iClass*/ 14 && div_class_value !== (div_class_value = "" + (/*$theme*/ ctx[1].calendar + (/*$_viewClass*/ ctx[2]
|
|
1355
|
-
? ' ' + /*$theme*/ ctx[1][/*$_viewClass*/ ctx[2]]
|
|
1356
|
-
: '') + (/*$_iClass*/ ctx[3]
|
|
1357
|
-
? ' ' + /*$theme*/ ctx[1][/*$_iClass*/ ctx[3]]
|
|
1509
|
+
if (!current || dirty[0] & /*$theme, $_viewClass, $_iClass*/ 7 && div_class_value !== (div_class_value = "" + (/*$theme*/ ctx[0].calendar + (/*$_viewClass*/ ctx[1]
|
|
1510
|
+
? ' ' + /*$theme*/ ctx[0][/*$_viewClass*/ ctx[1]]
|
|
1511
|
+
: '') + (/*$_iClass*/ ctx[2]
|
|
1512
|
+
? ' ' + /*$theme*/ ctx[0][/*$_iClass*/ ctx[2]]
|
|
1358
1513
|
: '')))) {
|
|
1359
1514
|
attr(div, "class", div_class_value);
|
|
1360
1515
|
}
|
|
1361
1516
|
|
|
1362
|
-
if (!current || dirty[0] & /*$height*/
|
|
1363
|
-
set_style(div, "height", /*$height*/ ctx[
|
|
1517
|
+
if (!current || dirty[0] & /*$height*/ 8) {
|
|
1518
|
+
set_style(div, "height", /*$height*/ ctx[3]);
|
|
1364
1519
|
}
|
|
1365
1520
|
},
|
|
1366
1521
|
i(local) {
|
|
1367
1522
|
if (current) return;
|
|
1368
1523
|
transition_in(toolbar.$$.fragment, local);
|
|
1369
|
-
if (
|
|
1370
|
-
|
|
1524
|
+
if (switch_instance) transition_in(switch_instance.$$.fragment, local);
|
|
1525
|
+
transition_in(auxiliary.$$.fragment, local);
|
|
1371
1526
|
current = true;
|
|
1372
1527
|
},
|
|
1373
1528
|
o(local) {
|
|
1374
1529
|
transition_out(toolbar.$$.fragment, local);
|
|
1375
|
-
if (
|
|
1376
|
-
|
|
1530
|
+
if (switch_instance) transition_out(switch_instance.$$.fragment, local);
|
|
1531
|
+
transition_out(auxiliary.$$.fragment, local);
|
|
1377
1532
|
current = false;
|
|
1378
1533
|
},
|
|
1379
1534
|
d(detaching) {
|
|
1380
1535
|
if (detaching) detach(div);
|
|
1381
1536
|
destroy_component(toolbar);
|
|
1382
|
-
if (
|
|
1383
|
-
if (
|
|
1537
|
+
if (switch_instance) destroy_component(switch_instance);
|
|
1538
|
+
if (detaching) detach(t1);
|
|
1539
|
+
destroy_component(auxiliary, detaching);
|
|
1384
1540
|
mounted = false;
|
|
1385
1541
|
dispose();
|
|
1386
1542
|
}
|
|
@@ -1405,17 +1561,17 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
1405
1561
|
let state = new State(plugins, options);
|
|
1406
1562
|
setContext('state', state);
|
|
1407
1563
|
let { _viewComponent, _viewClass, _ignoreClick, _interaction, _iClass, _events, _queue, events, eventSources, height, theme } = state;
|
|
1408
|
-
component_subscribe($$self, _viewComponent, value => $$invalidate(
|
|
1409
|
-
component_subscribe($$self, _viewClass, value => $$invalidate(
|
|
1410
|
-
component_subscribe($$self, _ignoreClick, value => $$invalidate(
|
|
1411
|
-
component_subscribe($$self, _interaction, value => $$invalidate(
|
|
1412
|
-
component_subscribe($$self, _iClass, value => $$invalidate(
|
|
1413
|
-
component_subscribe($$self, _events, value => $$invalidate(
|
|
1414
|
-
component_subscribe($$self, _queue, value => $$invalidate(
|
|
1415
|
-
component_subscribe($$self, events, value => $$invalidate(
|
|
1416
|
-
component_subscribe($$self, eventSources, value => $$invalidate(
|
|
1417
|
-
component_subscribe($$self, height, value => $$invalidate(
|
|
1418
|
-
component_subscribe($$self, theme, value => $$invalidate(
|
|
1564
|
+
component_subscribe($$self, _viewComponent, value => $$invalidate(4, $_viewComponent = value));
|
|
1565
|
+
component_subscribe($$self, _viewClass, value => $$invalidate(1, $_viewClass = value));
|
|
1566
|
+
component_subscribe($$self, _ignoreClick, value => $$invalidate(32, $_ignoreClick = value));
|
|
1567
|
+
component_subscribe($$self, _interaction, value => $$invalidate(36, $_interaction = value));
|
|
1568
|
+
component_subscribe($$self, _iClass, value => $$invalidate(2, $_iClass = value));
|
|
1569
|
+
component_subscribe($$self, _events, value => $$invalidate(34, $_events = value));
|
|
1570
|
+
component_subscribe($$self, _queue, value => $$invalidate(31, $_queue = value));
|
|
1571
|
+
component_subscribe($$self, events, value => $$invalidate(33, $events = value));
|
|
1572
|
+
component_subscribe($$self, eventSources, value => $$invalidate(35, $eventSources = value));
|
|
1573
|
+
component_subscribe($$self, height, value => $$invalidate(3, $height = value));
|
|
1574
|
+
component_subscribe($$self, theme, value => $$invalidate(0, $theme = value));
|
|
1419
1575
|
|
|
1420
1576
|
function setOption(name, value) {
|
|
1421
1577
|
if (state.hasOwnProperty(name)) {
|
|
@@ -1528,12 +1684,12 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
1528
1684
|
});
|
|
1529
1685
|
|
|
1530
1686
|
$$self.$$set = $$props => {
|
|
1531
|
-
if ('plugins' in $$props) $$invalidate(
|
|
1532
|
-
if ('options' in $$props) $$invalidate(
|
|
1687
|
+
if ('plugins' in $$props) $$invalidate(17, plugins = $$props.plugins);
|
|
1688
|
+
if ('options' in $$props) $$invalidate(18, options = $$props.options);
|
|
1533
1689
|
};
|
|
1534
1690
|
|
|
1535
1691
|
$$self.$$.update = () => {
|
|
1536
|
-
if ($$self.$$.dirty[0] & /*options*/
|
|
1692
|
+
if ($$self.$$.dirty[0] & /*options*/ 262144) {
|
|
1537
1693
|
// Reactively update options that did change
|
|
1538
1694
|
for (let [name, value] of diff(options)) {
|
|
1539
1695
|
setOption(name, value);
|
|
@@ -1542,7 +1698,6 @@ function instance($$self, $$props, $$invalidate) {
|
|
|
1542
1698
|
};
|
|
1543
1699
|
|
|
1544
1700
|
return [
|
|
1545
|
-
$_interaction,
|
|
1546
1701
|
$theme,
|
|
1547
1702
|
$_viewClass,
|
|
1548
1703
|
$_iClass,
|
|
@@ -1588,20 +1743,20 @@ class Calendar extends SvelteComponent {
|
|
|
1588
1743
|
create_fragment,
|
|
1589
1744
|
safe_not_equal,
|
|
1590
1745
|
{
|
|
1591
|
-
plugins:
|
|
1592
|
-
options:
|
|
1593
|
-
setOption:
|
|
1594
|
-
getOption:
|
|
1595
|
-
refetchEvents:
|
|
1596
|
-
getEvents:
|
|
1597
|
-
getEventById:
|
|
1598
|
-
addEvent:
|
|
1599
|
-
updateEvent:
|
|
1600
|
-
removeEventById:
|
|
1601
|
-
getView:
|
|
1602
|
-
unselect:
|
|
1603
|
-
dateFromPoint:
|
|
1604
|
-
destroy:
|
|
1746
|
+
plugins: 17,
|
|
1747
|
+
options: 18,
|
|
1748
|
+
setOption: 19,
|
|
1749
|
+
getOption: 20,
|
|
1750
|
+
refetchEvents: 21,
|
|
1751
|
+
getEvents: 22,
|
|
1752
|
+
getEventById: 23,
|
|
1753
|
+
addEvent: 24,
|
|
1754
|
+
updateEvent: 25,
|
|
1755
|
+
removeEventById: 26,
|
|
1756
|
+
getView: 27,
|
|
1757
|
+
unselect: 28,
|
|
1758
|
+
dateFromPoint: 29,
|
|
1759
|
+
destroy: 30
|
|
1605
1760
|
},
|
|
1606
1761
|
null,
|
|
1607
1762
|
[-1, -1]
|
|
@@ -1609,51 +1764,51 @@ class Calendar extends SvelteComponent {
|
|
|
1609
1764
|
}
|
|
1610
1765
|
|
|
1611
1766
|
get setOption() {
|
|
1612
|
-
return this.$$.ctx[
|
|
1767
|
+
return this.$$.ctx[19];
|
|
1613
1768
|
}
|
|
1614
1769
|
|
|
1615
1770
|
get getOption() {
|
|
1616
|
-
return this.$$.ctx[
|
|
1771
|
+
return this.$$.ctx[20];
|
|
1617
1772
|
}
|
|
1618
1773
|
|
|
1619
1774
|
get refetchEvents() {
|
|
1620
|
-
return this.$$.ctx[
|
|
1775
|
+
return this.$$.ctx[21];
|
|
1621
1776
|
}
|
|
1622
1777
|
|
|
1623
1778
|
get getEvents() {
|
|
1624
|
-
return this.$$.ctx[
|
|
1779
|
+
return this.$$.ctx[22];
|
|
1625
1780
|
}
|
|
1626
1781
|
|
|
1627
1782
|
get getEventById() {
|
|
1628
|
-
return this.$$.ctx[
|
|
1783
|
+
return this.$$.ctx[23];
|
|
1629
1784
|
}
|
|
1630
1785
|
|
|
1631
1786
|
get addEvent() {
|
|
1632
|
-
return this.$$.ctx[
|
|
1787
|
+
return this.$$.ctx[24];
|
|
1633
1788
|
}
|
|
1634
1789
|
|
|
1635
1790
|
get updateEvent() {
|
|
1636
|
-
return this.$$.ctx[
|
|
1791
|
+
return this.$$.ctx[25];
|
|
1637
1792
|
}
|
|
1638
1793
|
|
|
1639
1794
|
get removeEventById() {
|
|
1640
|
-
return this.$$.ctx[
|
|
1795
|
+
return this.$$.ctx[26];
|
|
1641
1796
|
}
|
|
1642
1797
|
|
|
1643
1798
|
get getView() {
|
|
1644
|
-
return this.$$.ctx[
|
|
1799
|
+
return this.$$.ctx[27];
|
|
1645
1800
|
}
|
|
1646
1801
|
|
|
1647
1802
|
get unselect() {
|
|
1648
|
-
return this.$$.ctx[
|
|
1803
|
+
return this.$$.ctx[28];
|
|
1649
1804
|
}
|
|
1650
1805
|
|
|
1651
1806
|
get dateFromPoint() {
|
|
1652
|
-
return this.$$.ctx[
|
|
1807
|
+
return this.$$.ctx[29];
|
|
1653
1808
|
}
|
|
1654
1809
|
|
|
1655
1810
|
get destroy() {
|
|
1656
|
-
return this.$$.ctx[
|
|
1811
|
+
return this.$$.ctx[30];
|
|
1657
1812
|
}
|
|
1658
1813
|
}
|
|
1659
1814
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@event-calendar/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"title": "Event Calendar Core package",
|
|
5
5
|
"description": "Full-sized drag & drop event calendar with resource view",
|
|
6
6
|
"keywords": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@event-calendar/common": "~0.
|
|
40
|
+
"@event-calendar/common": "~0.18.0",
|
|
41
41
|
"svelte": "^3.55.1"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import {getContext} from 'svelte';
|
|
3
|
+
import {is_function} from 'svelte/internal';
|
|
4
|
+
import {debounce, toISOString, toLocalDate, toViewWithLocalDates} from '@event-calendar/common';
|
|
5
|
+
|
|
6
|
+
let {datesSet, _auxiliary, _activeRange, _queue, _view} = getContext('state');
|
|
7
|
+
|
|
8
|
+
// Set up datesSet callback
|
|
9
|
+
$: runDatesSet($_activeRange);
|
|
10
|
+
|
|
11
|
+
let debounceHandle = {};
|
|
12
|
+
function runDatesSet(_activeRange) {
|
|
13
|
+
if (is_function($datesSet)) {
|
|
14
|
+
debounce(() => $datesSet({
|
|
15
|
+
start: toLocalDate(_activeRange.start),
|
|
16
|
+
end: toLocalDate(_activeRange.end),
|
|
17
|
+
startStr: toISOString(_activeRange.start),
|
|
18
|
+
endStr: toISOString(_activeRange.end),
|
|
19
|
+
view: toViewWithLocalDates($_view)
|
|
20
|
+
}), debounceHandle, _queue);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
{#each $_auxiliary as component}
|
|
26
|
+
<svelte:component this={component} />
|
|
27
|
+
{/each}
|
package/src/Calendar.svelte
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import {diff} from './storage/options';
|
|
7
7
|
import State from './storage/state';
|
|
8
8
|
import Toolbar from './Toolbar.svelte';
|
|
9
|
+
import Auxiliary from './Auxiliary.svelte';
|
|
9
10
|
import {
|
|
10
11
|
assign,
|
|
11
12
|
toEventWithLocalDates,
|
|
@@ -140,6 +141,6 @@
|
|
|
140
141
|
>
|
|
141
142
|
<Toolbar/>
|
|
142
143
|
<svelte:component this={$_viewComponent}/>
|
|
143
|
-
<svelte:component this={$_interaction.component}/>
|
|
144
144
|
</div>
|
|
145
145
|
<svelte:window on:click|capture={handleClick}/>
|
|
146
|
+
<Auxiliary/>
|
package/src/index.scss
CHANGED
package/src/storage/state.js
CHANGED
|
@@ -29,6 +29,7 @@ export default class {
|
|
|
29
29
|
|
|
30
30
|
// Private stores
|
|
31
31
|
this._queue = writable(new Map()); // debounce queue
|
|
32
|
+
this._auxiliary = writable([]); // auxiliary components
|
|
32
33
|
this._currentRange = currentRange(this);
|
|
33
34
|
this._activeRange = activeRange(this);
|
|
34
35
|
this._fetchedRange = writable({start: undefined, end: undefined});
|
|
@@ -46,6 +47,8 @@ export default class {
|
|
|
46
47
|
this._view = view2(this);
|
|
47
48
|
this._viewComponent = writable(undefined);
|
|
48
49
|
this._viewClass = writable(undefined);
|
|
50
|
+
// Resources
|
|
51
|
+
this._resBgColor = writable(noop);
|
|
49
52
|
// Interaction
|
|
50
53
|
this._interaction = writable({});
|
|
51
54
|
this._iEvents = writable([null, null]); // interaction events: [drag/resize, pointer]
|
|
@@ -121,4 +124,4 @@ function parseOpts(opts, state) {
|
|
|
121
124
|
}
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
|
-
}
|
|
127
|
+
}
|
package/src/storage/stores.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {derived, writable, readable} from 'svelte/store';
|
|
2
|
-
import {is_function
|
|
2
|
+
import {is_function} from 'svelte/internal';
|
|
3
3
|
import {
|
|
4
4
|
DAY_IN_SECONDS,
|
|
5
5
|
cloneDate,
|
|
@@ -20,7 +20,7 @@ import {createView} from '@event-calendar/common';
|
|
|
20
20
|
import {assign} from '@event-calendar/common';
|
|
21
21
|
|
|
22
22
|
export function activeRange(state) {
|
|
23
|
-
|
|
23
|
+
return derived(
|
|
24
24
|
[state._currentRange, state.firstDay, state.monthMode, state.slotMinTime, state.slotMaxTime],
|
|
25
25
|
([$_currentRange, $firstDay, $monthMode, $slotMinTime, $slotMaxTime]) => {
|
|
26
26
|
let start = cloneDate($_currentRange.start);
|
|
@@ -41,24 +41,6 @@ export function activeRange(state) {
|
|
|
41
41
|
return {start, end};
|
|
42
42
|
}
|
|
43
43
|
);
|
|
44
|
-
|
|
45
|
-
let debounceHandle = {};
|
|
46
|
-
derived([_activeRange, state.datesSet], values => {
|
|
47
|
-
let [, $datesSet] = values;
|
|
48
|
-
if ($datesSet) {
|
|
49
|
-
debounce(() => {
|
|
50
|
-
let [$_activeRange, $datesSet] = values;
|
|
51
|
-
$datesSet({
|
|
52
|
-
start: toLocalDate($_activeRange.start),
|
|
53
|
-
end: toLocalDate($_activeRange.end),
|
|
54
|
-
startStr: toISOString($_activeRange.start),
|
|
55
|
-
endStr: toISOString($_activeRange.end)
|
|
56
|
-
});
|
|
57
|
-
}, debounceHandle, state._queue);
|
|
58
|
-
}
|
|
59
|
-
}).subscribe(noop);
|
|
60
|
-
|
|
61
|
-
return _activeRange;
|
|
62
44
|
}
|
|
63
45
|
|
|
64
46
|
export function currentRange(state) {
|