@event-calendar/resource-time-grid
Advanced tools
Comparing version 1.4.1 to 1.5.0
134
index.js
@@ -0,5 +1,5 @@ | ||
import TimeGrid, { Section, Body, Week, Day } from '@event-calendar/time-grid'; | ||
import { derived } from 'svelte/store'; | ||
import { SvelteComponent, init, safe_not_equal, element, attr, insert, action_destroyer, is_function, noop, detach, component_subscribe, binding_callbacks, create_component, space, mount_component, append, transition_in, group_outros, transition_out, check_outros, destroy_component, set_store_value, empty, destroy_each, text, set_data } from 'svelte/internal'; | ||
import { getContext, onMount, setContext } from 'svelte'; | ||
import { State as State$1, Section, Body, Week, Day } from '@event-calendar/time-grid'; | ||
import { derived } from 'svelte/store'; | ||
import { getContext, onMount } from 'svelte'; | ||
import { setContent, toLocalDate } from '@event-calendar/core'; | ||
@@ -38,10 +38,2 @@ | ||
class State extends State$1 { | ||
constructor(state) { | ||
super(state); | ||
this._viewResources = viewResources(state); | ||
} | ||
} | ||
/* packages/resource-time-grid/src/Label.svelte generated by Svelte v3.59.1 */ | ||
@@ -166,3 +158,3 @@ | ||
const child_ctx = ctx.slice(); | ||
child_ctx[17] = list[i]; | ||
child_ctx[15] = list[i]; | ||
return child_ctx; | ||
@@ -173,3 +165,3 @@ } | ||
const child_ctx = ctx.slice(); | ||
child_ctx[20] = list[i]; | ||
child_ctx[18] = list[i]; | ||
return child_ctx; | ||
@@ -180,3 +172,3 @@ } | ||
const child_ctx = ctx.slice(); | ||
child_ctx[26] = list[i]; | ||
child_ctx[24] = list[i]; | ||
return child_ctx; | ||
@@ -187,3 +179,3 @@ } | ||
const child_ctx = ctx.slice(); | ||
child_ctx[23] = list[i]; | ||
child_ctx[21] = list[i]; | ||
return child_ctx; | ||
@@ -194,3 +186,3 @@ } | ||
const child_ctx = ctx.slice(); | ||
child_ctx[26] = list[i]; | ||
child_ctx[24] = list[i]; | ||
return child_ctx; | ||
@@ -201,3 +193,3 @@ } | ||
const child_ctx = ctx.slice(); | ||
child_ctx[17] = list[i]; | ||
child_ctx[15] = list[i]; | ||
return child_ctx; | ||
@@ -208,11 +200,11 @@ } | ||
const child_ctx = ctx.slice(); | ||
child_ctx[20] = list[i]; | ||
child_ctx[18] = list[i]; | ||
return child_ctx; | ||
} | ||
// (27:16) {:else} | ||
// (20:16) {:else} | ||
function create_else_block_2(ctx) { | ||
let label; | ||
let current; | ||
label = new Label({ props: { resource: /*item0*/ ctx[17] } }); | ||
label = new Label({ props: { resource: /*item0*/ ctx[15] } }); | ||
@@ -229,3 +221,3 @@ return { | ||
const label_changes = {}; | ||
if (dirty[0] & /*loops*/ 8) label_changes.resource = /*item0*/ ctx[17]; | ||
if (dirty[0] & /*loops*/ 8) label_changes.resource = /*item0*/ ctx[15]; | ||
label.$set(label_changes); | ||
@@ -248,6 +240,6 @@ }, | ||
// (25:16) {#if $datesAboveResources} | ||
// (18:16) {#if $datesAboveResources} | ||
function create_if_block_4(ctx) { | ||
let div; | ||
let t_value = /*$_intlDayHeader*/ ctx[5].format(/*item0*/ ctx[17]) + ""; | ||
let t_value = /*$_intlDayHeader*/ ctx[5].format(/*item0*/ ctx[15]) + ""; | ||
let t; | ||
@@ -267,3 +259,3 @@ let div_class_value; | ||
p(ctx, dirty) { | ||
if (dirty[0] & /*$_intlDayHeader, loops*/ 40 && t_value !== (t_value = /*$_intlDayHeader*/ ctx[5].format(/*item0*/ ctx[17]) + "")) set_data(t, t_value); | ||
if (dirty[0] & /*$_intlDayHeader, loops*/ 40 && t_value !== (t_value = /*$_intlDayHeader*/ ctx[5].format(/*item0*/ ctx[15]) + "")) set_data(t, t_value); | ||
@@ -282,3 +274,3 @@ if (dirty[0] & /*$theme*/ 16 && div_class_value !== (div_class_value = /*$theme*/ ctx[4].day)) { | ||
// (30:16) {#if loops[1].length > 1} | ||
// (23:16) {#if loops[1].length > 1} | ||
function create_if_block_2(ctx) { | ||
@@ -377,6 +369,6 @@ let div; | ||
// (35:28) {:else} | ||
// (28:28) {:else} | ||
function create_else_block_1(ctx) { | ||
let div; | ||
let t_value = /*$_intlDayHeader*/ ctx[5].format(/*item1*/ ctx[20]) + ""; | ||
let t_value = /*$_intlDayHeader*/ ctx[5].format(/*item1*/ ctx[18]) + ""; | ||
let t; | ||
@@ -396,3 +388,3 @@ let div_class_value; | ||
p(ctx, dirty) { | ||
if (dirty[0] & /*$_intlDayHeader, loops*/ 40 && t_value !== (t_value = /*$_intlDayHeader*/ ctx[5].format(/*item1*/ ctx[20]) + "")) set_data(t, t_value); | ||
if (dirty[0] & /*$_intlDayHeader, loops*/ 40 && t_value !== (t_value = /*$_intlDayHeader*/ ctx[5].format(/*item1*/ ctx[18]) + "")) set_data(t, t_value); | ||
@@ -411,3 +403,3 @@ if (dirty[0] & /*$theme*/ 16 && div_class_value !== (div_class_value = /*$theme*/ ctx[4].day)) { | ||
// (33:28) {#if $datesAboveResources} | ||
// (26:28) {#if $datesAboveResources} | ||
function create_if_block_3(ctx) { | ||
@@ -419,4 +411,4 @@ let label; | ||
props: { | ||
resource: /*item1*/ ctx[20], | ||
date: /*item0*/ ctx[17] | ||
resource: /*item1*/ ctx[18], | ||
date: /*item0*/ ctx[15] | ||
} | ||
@@ -435,4 +427,4 @@ }); | ||
const label_changes = {}; | ||
if (dirty[0] & /*loops*/ 8) label_changes.resource = /*item1*/ ctx[20]; | ||
if (dirty[0] & /*loops*/ 8) label_changes.date = /*item0*/ ctx[17]; | ||
if (dirty[0] & /*loops*/ 8) label_changes.resource = /*item1*/ ctx[18]; | ||
if (dirty[0] & /*loops*/ 8) label_changes.date = /*item0*/ ctx[15]; | ||
label.$set(label_changes); | ||
@@ -455,3 +447,3 @@ }, | ||
// (32:24) {#each loops[1] as item1} | ||
// (25:24) {#each loops[1] as item1} | ||
function create_each_block_6(ctx) { | ||
@@ -526,3 +518,3 @@ let current_block_type_index; | ||
// (23:8) {#each loops[0] as item0} | ||
// (16:8) {#each loops[0] as item0} | ||
function create_each_block_5(ctx) { | ||
@@ -638,3 +630,3 @@ let div; | ||
// (22:4) <Section> | ||
// (15:4) <Section> | ||
function create_default_slot_2(ctx) { | ||
@@ -725,3 +717,3 @@ let each_1_anchor; | ||
// (46:0) {#if $allDaySlot} | ||
// (39:0) {#if $allDaySlot} | ||
function create_if_block(ctx) { | ||
@@ -767,3 +759,3 @@ let div2; | ||
if (dirty[0] & /*$_viewDates, $theme, $_viewResources, $datesAboveResources*/ 23 | dirty[1] & /*$$scope*/ 16) { | ||
if (dirty[0] & /*$_viewDates, $theme, $_viewResources, $datesAboveResources*/ 23 | dirty[1] & /*$$scope*/ 4) { | ||
section_changes.$$scope = { dirty, ctx }; | ||
@@ -802,3 +794,3 @@ } | ||
// (58:16) {:else} | ||
// (51:16) {:else} | ||
function create_else_block(ctx) { | ||
@@ -889,3 +881,3 @@ let each_1_anchor; | ||
// (50:16) {#if $datesAboveResources} | ||
// (43:16) {#if $datesAboveResources} | ||
function create_if_block_1(ctx) { | ||
@@ -976,3 +968,3 @@ let each_1_anchor; | ||
// (59:20) {#each $_viewResources as resource} | ||
// (52:20) {#each $_viewResources as resource} | ||
function create_each_block_4(ctx) { | ||
@@ -988,3 +980,3 @@ let div; | ||
dates: /*$_viewDates*/ ctx[0], | ||
resource: /*resource*/ ctx[26] | ||
resource: /*resource*/ ctx[24] | ||
} | ||
@@ -1009,3 +1001,3 @@ }); | ||
if (dirty[0] & /*$_viewDates*/ 1) week_changes.dates = /*$_viewDates*/ ctx[0]; | ||
if (dirty[0] & /*$_viewResources*/ 2) week_changes.resource = /*resource*/ ctx[26]; | ||
if (dirty[0] & /*$_viewResources*/ 2) week_changes.resource = /*resource*/ ctx[24]; | ||
week.$set(week_changes); | ||
@@ -1033,3 +1025,3 @@ | ||
// (53:28) {#each $_viewResources as resource} | ||
// (46:28) {#each $_viewResources as resource} | ||
function create_each_block_3(ctx) { | ||
@@ -1041,4 +1033,4 @@ let week; | ||
props: { | ||
dates: [/*date*/ ctx[23]], | ||
resource: /*resource*/ ctx[26] | ||
dates: [/*date*/ ctx[21]], | ||
resource: /*resource*/ ctx[24] | ||
} | ||
@@ -1057,4 +1049,4 @@ }); | ||
const week_changes = {}; | ||
if (dirty[0] & /*$_viewDates*/ 1) week_changes.dates = [/*date*/ ctx[23]]; | ||
if (dirty[0] & /*$_viewResources*/ 2) week_changes.resource = /*resource*/ ctx[26]; | ||
if (dirty[0] & /*$_viewDates*/ 1) week_changes.dates = [/*date*/ ctx[21]]; | ||
if (dirty[0] & /*$_viewResources*/ 2) week_changes.resource = /*resource*/ ctx[24]; | ||
week.$set(week_changes); | ||
@@ -1077,3 +1069,3 @@ }, | ||
// (51:20) {#each $_viewDates as date} | ||
// (44:20) {#each $_viewDates as date} | ||
function create_each_block_2(ctx) { | ||
@@ -1175,3 +1167,3 @@ let div; | ||
// (49:12) <Section> | ||
// (42:12) <Section> | ||
function create_default_slot_1(ctx) { | ||
@@ -1246,3 +1238,3 @@ let current_block_type_index; | ||
// (73:8) {#each loops[1] as item1} | ||
// (66:8) {#each loops[1] as item1} | ||
function create_each_block_1(ctx) { | ||
@@ -1255,7 +1247,7 @@ let day; | ||
date: /*$datesAboveResources*/ ctx[2] | ||
? /*item0*/ ctx[17] | ||
: /*item1*/ ctx[20], | ||
? /*item0*/ ctx[15] | ||
: /*item1*/ ctx[18], | ||
resource: /*$datesAboveResources*/ ctx[2] | ||
? /*item1*/ ctx[20] | ||
: /*item0*/ ctx[17] | ||
? /*item1*/ ctx[18] | ||
: /*item0*/ ctx[15] | ||
} | ||
@@ -1276,8 +1268,8 @@ }); | ||
if (dirty[0] & /*$datesAboveResources, loops*/ 12) day_changes.date = /*$datesAboveResources*/ ctx[2] | ||
? /*item0*/ ctx[17] | ||
: /*item1*/ ctx[20]; | ||
? /*item0*/ ctx[15] | ||
: /*item1*/ ctx[18]; | ||
if (dirty[0] & /*$datesAboveResources, loops*/ 12) day_changes.resource = /*$datesAboveResources*/ ctx[2] | ||
? /*item1*/ ctx[20] | ||
: /*item0*/ ctx[17]; | ||
? /*item1*/ ctx[18] | ||
: /*item0*/ ctx[15]; | ||
@@ -1301,3 +1293,3 @@ day.$set(day_changes); | ||
// (71:0) {#each loops[0] as item0} | ||
// (64:0) {#each loops[0] as item0} | ||
function create_each_block(ctx) { | ||
@@ -1399,3 +1391,3 @@ let div; | ||
// (70:0) <Body> | ||
// (63:0) <Body> | ||
function create_default_slot(ctx) { | ||
@@ -1541,3 +1533,3 @@ let each_1_anchor; | ||
if (dirty[0] & /*loops, $theme, $datesAboveResources, $_intlDayHeader*/ 60 | dirty[1] & /*$$scope*/ 16) { | ||
if (dirty[0] & /*loops, $theme, $datesAboveResources, $_intlDayHeader*/ 60 | dirty[1] & /*$$scope*/ 4) { | ||
section_changes.$$scope = { dirty, ctx }; | ||
@@ -1581,3 +1573,3 @@ } | ||
if (dirty[0] & /*loops, $theme, $datesAboveResources*/ 28 | dirty[1] & /*$$scope*/ 16) { | ||
if (dirty[0] & /*loops, $theme, $datesAboveResources*/ 28 | dirty[1] & /*$$scope*/ 4) { | ||
body_changes.$$scope = { dirty, ctx }; | ||
@@ -1620,6 +1612,6 @@ } | ||
let $allDaySlot; | ||
let state = getContext('state'); | ||
let { datesAboveResources, _viewDates, _intlDayHeader, _viewClass, allDaySlot, theme } = state; | ||
let { datesAboveResources, _viewDates, _viewResources, _intlDayHeader, _viewClass, allDaySlot, theme } = getContext('state'); | ||
component_subscribe($$self, datesAboveResources, value => $$invalidate(2, $datesAboveResources = value)); | ||
component_subscribe($$self, _viewDates, value => $$invalidate(0, $_viewDates = value)); | ||
component_subscribe($$self, _viewResources, value => $$invalidate(1, $_viewResources = value)); | ||
component_subscribe($$self, _intlDayHeader, value => $$invalidate(5, $_intlDayHeader = value)); | ||
@@ -1629,6 +1621,2 @@ component_subscribe($$self, _viewClass, value => $$invalidate(14, $_viewClass = value)); | ||
component_subscribe($$self, theme, value => $$invalidate(4, $theme = value)); | ||
let viewState = new State(state); | ||
setContext('view-state', viewState); | ||
let { _viewResources } = viewState; | ||
component_subscribe($$self, _viewResources, value => $$invalidate(1, $_viewResources = value)); | ||
set_store_value(_viewClass, $_viewClass = 'week', $_viewClass); | ||
@@ -1655,7 +1643,7 @@ let loops; | ||
_viewDates, | ||
_viewResources, | ||
_intlDayHeader, | ||
_viewClass, | ||
allDaySlot, | ||
theme, | ||
_viewResources | ||
theme | ||
]; | ||
@@ -1738,3 +1726,7 @@ } | ||
createStores(state) { | ||
if (!('_times' in state)) { | ||
TimeGrid.createStores(state); | ||
} | ||
state._auxiliary.update($_auxiliary => [...$_auxiliary, Auxiliary]); | ||
state._viewResources = viewResources(state); | ||
} | ||
@@ -1741,0 +1733,0 @@ }; |
{ | ||
"name": "@event-calendar/resource-time-grid", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"title": "Event Calendar ResourceTimeGrid plugin", | ||
@@ -29,6 +29,6 @@ "description": "Full-sized drag & drop event calendar with resource view", | ||
"dependencies": { | ||
"@event-calendar/core": "~1.4.1", | ||
"@event-calendar/time-grid": "~1.4.1", | ||
"@event-calendar/core": "~1.5.0", | ||
"@event-calendar/time-grid": "~1.5.0", | ||
"svelte": "^3.59.1" | ||
} | ||
} |
@@ -38,2 +38,3 @@ # Event Calendar [![](https://data.jsdelivr.com/v1/package/npm/@event-calendar/build/badge)](https://www.jsdelivr.com/package/npm/@event-calendar/build) [![npm](https://img.shields.io/npm/dm/@event-calendar/core?color=red&label=npm&style=flat-square)](https://www.npmjs.com/package/@event-calendar/core) | ||
- [eventBackgroundColor](#eventbackgroundcolor) | ||
- [eventClassNames](#eventclassnames) | ||
- [eventClick](#eventclick) | ||
@@ -197,4 +198,4 @@ - [eventColor](#eventcolor) | ||
```html | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.4.1/event-calendar.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.4.1/event-calendar.min.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.5.0/event-calendar.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/@event-calendar/build@1.5.0/event-calendar.min.js"></script> | ||
``` | ||
@@ -547,2 +548,39 @@ | ||
### eventClassNames | ||
- Type `string`, `array` or `function` | ||
- Default `undefined` | ||
Sets additional CSS classes for events. | ||
This value can be either a string containing class names `'class-1 class-2 ...'`, an array of strings `['class-1', 'class-2', ...]` or a function that returns any of the above formats: | ||
```js | ||
function (info) { | ||
// return string or array | ||
} | ||
``` | ||
`info` is an object with the following properties: | ||
<table> | ||
<tr> | ||
<td> | ||
`event` | ||
</td> | ||
<td> | ||
The associated [Event](#event-object) object | ||
</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
`view` | ||
</td> | ||
<td> | ||
The current [View](#view-object) object | ||
</td> | ||
</tr> | ||
</table> | ||
### eventClick | ||
@@ -602,3 +640,3 @@ - Type `function` | ||
### eventContent | ||
- Type `string`, `object`or `function` | ||
- Type `string`, `object` or `function` | ||
- Default `undefined` | ||
@@ -605,0 +643,0 @@ |
@@ -0,1 +1,3 @@ | ||
import TimeGrid from '@event-calendar/time-grid'; | ||
import {viewResources} from './stores.js'; | ||
import View from './View.svelte'; | ||
@@ -32,3 +34,7 @@ import Auxiliary from './Auxiliary.svelte'; | ||
createStores(state) { | ||
if (!('_times' in state)) { | ||
TimeGrid.createStores(state); | ||
} | ||
state._auxiliary.update($_auxiliary => [...$_auxiliary, Auxiliary]); | ||
state._viewResources = viewResources(state); | ||
} | ||
@@ -35,0 +41,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108625
2670
8
1543
+ Added@ampproject/remapping@2.3.0(transitive)
+ Added@event-calendar/core@1.5.1(transitive)
+ Added@event-calendar/time-grid@1.5.1(transitive)
+ Added@jridgewell/gen-mapping@0.3.8(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Added@types/estree@1.0.6(transitive)
+ Addedacorn@8.14.0(transitive)
+ Addedaria-query@5.3.2(transitive)
+ Addedaxobject-query@4.1.0(transitive)
+ Addedcode-red@1.0.4(transitive)
+ Addedcss-tree@2.3.1(transitive)
+ Addedestree-walker@3.0.3(transitive)
+ Addedis-reference@3.0.3(transitive)
+ Addedlocate-character@3.0.0(transitive)
+ Addedmagic-string@0.30.17(transitive)
+ Addedmdn-data@2.0.30(transitive)
+ Addedperiscopic@3.1.0(transitive)
+ Addedsource-map-js@1.2.1(transitive)
+ Addedsvelte@4.2.19(transitive)
- Removed@event-calendar/core@1.4.1(transitive)
- Removed@event-calendar/time-grid@1.4.1(transitive)
Updated@event-calendar/core@~1.5.0