@event-calendar/interaction
Advanced tools
Comparing version 0.17.1 to 0.18.0
222
index.js
@@ -1,2 +0,2 @@ | ||
import { SvelteComponent, init, safe_not_equal, noop, listen, is_function, run_all, component_subscribe, globals, set_store_value, bubble, subscribe, create_component, space, empty, mount_component, insert, transition_in, group_outros, transition_out, check_outros, destroy_component, detach, binding_callbacks, element, attr } from 'svelte/internal'; | ||
import { SvelteComponent, init, safe_not_equal, noop, listen, is_function, run_all, component_subscribe, globals, set_store_value, bubble, subscribe, empty, insert, detach, element, attr, create_component, space, mount_component, transition_in, group_outros, transition_out, check_outros, destroy_component, binding_callbacks } from 'svelte/internal'; | ||
import { getContext } from 'svelte'; | ||
@@ -934,5 +934,104 @@ import { ancestor, addDuration, cloneDate, addDay, rect, createDuration, toEventWithLocalDates, toISOString, toViewWithLocalDates, cloneEvent, assign } from '@event-calendar/common'; | ||
/* packages/interaction/src/Interaction.svelte generated by Svelte v3.55.1 */ | ||
/* packages/interaction/src/Resizer.svelte generated by Svelte v3.55.1 */ | ||
function create_if_block$1(ctx) { | ||
let div; | ||
let div_class_value; | ||
let mounted; | ||
let dispose; | ||
return { | ||
c() { | ||
div = element("div"); | ||
attr(div, "class", div_class_value = /*$theme*/ ctx[2].resizer); | ||
}, | ||
m(target, anchor) { | ||
insert(target, div, anchor); | ||
if (!mounted) { | ||
dispose = listen(div, "pointerdown", /*pointerdown_handler*/ ctx[5]); | ||
mounted = true; | ||
} | ||
}, | ||
p(ctx, dirty) { | ||
if (dirty & /*$theme*/ 4 && div_class_value !== (div_class_value = /*$theme*/ ctx[2].resizer)) { | ||
attr(div, "class", div_class_value); | ||
} | ||
}, | ||
d(detaching) { | ||
if (detaching) detach(div); | ||
mounted = false; | ||
dispose(); | ||
} | ||
}; | ||
} | ||
function create_fragment$1(ctx) { | ||
let show_if = /*event*/ ctx[0].display === 'auto' && /*$_resizable*/ ctx[1](/*event*/ ctx[0]); | ||
let if_block_anchor; | ||
let if_block = show_if && create_if_block$1(ctx); | ||
return { | ||
c() { | ||
if (if_block) if_block.c(); | ||
if_block_anchor = empty(); | ||
}, | ||
m(target, anchor) { | ||
if (if_block) if_block.m(target, anchor); | ||
insert(target, if_block_anchor, anchor); | ||
}, | ||
p(ctx, [dirty]) { | ||
if (dirty & /*event, $_resizable*/ 3) show_if = /*event*/ ctx[0].display === 'auto' && /*$_resizable*/ ctx[1](/*event*/ ctx[0]); | ||
if (show_if) { | ||
if (if_block) { | ||
if_block.p(ctx, dirty); | ||
} else { | ||
if_block = create_if_block$1(ctx); | ||
if_block.c(); | ||
if_block.m(if_block_anchor.parentNode, if_block_anchor); | ||
} | ||
} else if (if_block) { | ||
if_block.d(1); | ||
if_block = null; | ||
} | ||
}, | ||
i: noop, | ||
o: noop, | ||
d(detaching) { | ||
if (if_block) if_block.d(detaching); | ||
if (detaching) detach(if_block_anchor); | ||
} | ||
}; | ||
} | ||
function instance$1($$self, $$props, $$invalidate) { | ||
let $_resizable; | ||
let $theme; | ||
let { event } = $$props; | ||
let { theme, _resizable } = getContext('state'); | ||
component_subscribe($$self, theme, value => $$invalidate(2, $theme = value)); | ||
component_subscribe($$self, _resizable, value => $$invalidate(1, $_resizable = value)); | ||
function pointerdown_handler(event) { | ||
bubble.call(this, $$self, event); | ||
} | ||
$$self.$$set = $$props => { | ||
if ('event' in $$props) $$invalidate(0, event = $$props.event); | ||
}; | ||
return [event, $_resizable, $theme, theme, _resizable, pointerdown_handler]; | ||
} | ||
class Resizer extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance$1, create_fragment$1, safe_not_equal, { event: 0 }); | ||
} | ||
} | ||
/* packages/interaction/src/Auxiliary.svelte generated by Svelte v3.55.1 */ | ||
function create_if_block(ctx) { | ||
let pointer_1; | ||
@@ -972,3 +1071,3 @@ let current; | ||
function create_fragment$1(ctx) { | ||
function create_fragment(ctx) { | ||
let action; | ||
@@ -981,3 +1080,3 @@ let t; | ||
/*action_binding*/ ctx[17](action); | ||
let if_block = /*$pointer*/ ctx[1] && create_if_block$1(ctx); | ||
let if_block = /*$pointer*/ ctx[1] && create_if_block(ctx); | ||
@@ -1010,3 +1109,3 @@ return { | ||
} else { | ||
if_block = create_if_block$1(ctx); | ||
if_block = create_if_block(ctx); | ||
if_block.c(); | ||
@@ -1047,3 +1146,3 @@ transition_in(if_block, 1); | ||
function instance$1($$self, $$props, $$invalidate) { | ||
function instance($$self, $$props, $$invalidate) { | ||
let $_interaction; | ||
@@ -1070,2 +1169,3 @@ let $_scroll; | ||
component_subscribe($$self, _scroll, value => $$invalidate(19, $_scroll = value)); | ||
set_store_value(_interaction, $_interaction.resizer = Resizer, $_interaction); | ||
@@ -1076,3 +1176,3 @@ set_store_value( | ||
for (let component of Object.values($_interaction)) { | ||
component && component.handleScroll && component.handleScroll(); | ||
component?.handleScroll(); | ||
} | ||
@@ -1151,108 +1251,9 @@ }, | ||
class Interaction extends SvelteComponent { | ||
class Auxiliary extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance$1, create_fragment$1, safe_not_equal, {}); | ||
init(this, options, instance, create_fragment, safe_not_equal, {}); | ||
} | ||
} | ||
/* packages/interaction/src/Resizer.svelte generated by Svelte v3.55.1 */ | ||
function create_if_block(ctx) { | ||
let div; | ||
let div_class_value; | ||
let mounted; | ||
let dispose; | ||
return { | ||
c() { | ||
div = element("div"); | ||
attr(div, "class", div_class_value = /*$theme*/ ctx[2].resizer); | ||
}, | ||
m(target, anchor) { | ||
insert(target, div, anchor); | ||
if (!mounted) { | ||
dispose = listen(div, "pointerdown", /*pointerdown_handler*/ ctx[5]); | ||
mounted = true; | ||
} | ||
}, | ||
p(ctx, dirty) { | ||
if (dirty & /*$theme*/ 4 && div_class_value !== (div_class_value = /*$theme*/ ctx[2].resizer)) { | ||
attr(div, "class", div_class_value); | ||
} | ||
}, | ||
d(detaching) { | ||
if (detaching) detach(div); | ||
mounted = false; | ||
dispose(); | ||
} | ||
}; | ||
} | ||
function create_fragment(ctx) { | ||
let show_if = /*event*/ ctx[0].display === 'auto' && /*$_resizable*/ ctx[1](/*event*/ ctx[0]); | ||
let if_block_anchor; | ||
let if_block = show_if && create_if_block(ctx); | ||
return { | ||
c() { | ||
if (if_block) if_block.c(); | ||
if_block_anchor = empty(); | ||
}, | ||
m(target, anchor) { | ||
if (if_block) if_block.m(target, anchor); | ||
insert(target, if_block_anchor, anchor); | ||
}, | ||
p(ctx, [dirty]) { | ||
if (dirty & /*event, $_resizable*/ 3) show_if = /*event*/ ctx[0].display === 'auto' && /*$_resizable*/ ctx[1](/*event*/ ctx[0]); | ||
if (show_if) { | ||
if (if_block) { | ||
if_block.p(ctx, dirty); | ||
} else { | ||
if_block = create_if_block(ctx); | ||
if_block.c(); | ||
if_block.m(if_block_anchor.parentNode, if_block_anchor); | ||
} | ||
} else if (if_block) { | ||
if_block.d(1); | ||
if_block = null; | ||
} | ||
}, | ||
i: noop, | ||
o: noop, | ||
d(detaching) { | ||
if (if_block) if_block.d(detaching); | ||
if (detaching) detach(if_block_anchor); | ||
} | ||
}; | ||
} | ||
function instance($$self, $$props, $$invalidate) { | ||
let $_resizable; | ||
let $theme; | ||
let { event } = $$props; | ||
let { theme, _resizable } = getContext('state'); | ||
component_subscribe($$self, theme, value => $$invalidate(2, $theme = value)); | ||
component_subscribe($$self, _resizable, value => $$invalidate(1, $_resizable = value)); | ||
function pointerdown_handler(event) { | ||
bubble.call(this, $$self, event); | ||
} | ||
$$self.$$set = $$props => { | ||
if ('event' in $$props) $$invalidate(0, event = $$props.event); | ||
}; | ||
return [event, $_resizable, $theme, theme, _resizable, pointerdown_handler]; | ||
} | ||
class Resizer extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance, create_fragment, safe_not_equal, { event: 0 }); | ||
} | ||
} | ||
var index = { | ||
@@ -1293,6 +1294,3 @@ createOptions(options) { | ||
createStores(state) { | ||
state._interaction.set({ | ||
component: Interaction, | ||
resizer: Resizer | ||
}); | ||
state._auxiliary.update($_auxiliary => [...$_auxiliary, Auxiliary]); | ||
} | ||
@@ -1299,0 +1297,0 @@ }; |
{ | ||
"name": "@event-calendar/interaction", | ||
"version": "0.17.1", | ||
"version": "0.18.0", | ||
"title": "Event Calendar Interaction plugin", | ||
@@ -39,5 +39,5 @@ "description": "Full-sized drag & drop event calendar with resource view", | ||
"dependencies": { | ||
"@event-calendar/common": "~0.17.1", | ||
"@event-calendar/common": "~0.18.0", | ||
"svelte": "^3.55.1" | ||
} | ||
} |
@@ -7,3 +7,3 @@ # Event Calendar [](https://www.jsdelivr.com/package/npm/@event-calendar/build) [](https://www.npmjs.com/package/@event-calendar/core) | ||
* Lightweight (37kb [br](https://en.wikipedia.org/wiki/Brotli) compressed) | ||
* Lightweight (38kb [br](https://en.wikipedia.org/wiki/Brotli) compressed) | ||
* Zero-dependency (pre-built bundle) | ||
@@ -196,4 +196,4 @@ * Used on over 60,000 websites with [Bookly](https://wordpress.org/plugins/bookly-responsive-appointment-booking-tool/) | ||
```html | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.17.1/event-calendar.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.17.1/event-calendar.min.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.18.0/event-calendar.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@0.18.0/event-calendar.min.js"></script> | ||
``` | ||
@@ -2205,3 +2205,3 @@ | ||
`boolean` Determines if the event is shown in the all-day slot. Default `false` | ||
`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 | ||
</td> | ||
@@ -2387,2 +2387,9 @@ </tr> | ||
</tr> | ||
<tr> | ||
<td> | ||
`eventBackgroundColor` | ||
</td> | ||
<td>Default background color for this resource's events</td> | ||
</tr> | ||
</table> | ||
@@ -2425,2 +2432,12 @@ | ||
</tr> | ||
<tr> | ||
<td> | ||
`eventBackgroundColor` | ||
</td> | ||
<td> | ||
`string` Sets the default background color for this resource's events just like the calendar-wide [eventBackgroundColor](#eventbackgroundcolor) option. Default `undefined` | ||
</td> | ||
</tr> | ||
</table> | ||
@@ -2427,0 +2444,0 @@ |
@@ -1,3 +0,2 @@ | ||
import Interaction from './Interaction.svelte'; | ||
import Resizer from './Resizer.svelte'; | ||
import Auxiliary from './Auxiliary.svelte'; | ||
@@ -39,7 +38,4 @@ export default { | ||
createStores(state) { | ||
state._interaction.set({ | ||
component: Interaction, | ||
resizer: Resizer | ||
}); | ||
state._auxiliary.update($_auxiliary => [...$_auxiliary, Auxiliary]); | ||
} | ||
} |
117167
2493
1220
+ Added@event-calendar/common@0.18.1(transitive)
- Removed@event-calendar/common@0.17.1(transitive)