@event-calendar/core
Advanced tools
Comparing version 3.5.0 to 3.6.0
{ | ||
"name": "@event-calendar/core", | ||
"version": "3.5.0", | ||
"version": "3.6.0", | ||
"title": "Event Calendar Core package", | ||
@@ -5,0 +5,0 @@ "description": "Full-sized drag & drop event calendar with resource & timeline views", |
@@ -1,2 +0,2 @@ | ||
import {run_all} from 'svelte/internal'; | ||
import {runAll} from './utils.js'; | ||
@@ -8,3 +8,3 @@ export function debounce(fn, handle, queueStore) { | ||
export function flushDebounce(queue) { | ||
run_all(queue); | ||
runAll(queue); | ||
queue.clear(); | ||
@@ -11,0 +11,0 @@ } |
@@ -66,1 +66,6 @@ import {symbol} from './utils.js'; | ||
} | ||
export function listen(node, event, handler, options) { | ||
node.addEventListener(event, handler, options); | ||
return () => node.removeEventListener(event, handler, options); | ||
} |
import {addDay, datesEqual, createDate, cloneDate, setMidnight, toLocalDate, toISOString, noTimePart, copyTime} from './date'; | ||
import {createElement} from './dom'; | ||
import {assign, isArray} from './utils'; | ||
import {assign, isArray, isFunction} from './utils'; | ||
import {toViewWithLocalDates} from './view'; | ||
import {is_function} from 'svelte/internal'; | ||
@@ -82,3 +81,3 @@ let eventId = 1; | ||
if (eventContent) { | ||
content = is_function(eventContent) | ||
content = isFunction(eventContent) | ||
? eventContent({ | ||
@@ -125,3 +124,3 @@ event: toEventWithLocalDates(chunk.event), | ||
if (eventClassNames) { | ||
if (is_function(eventClassNames)) { | ||
if (isFunction(eventClassNames)) { | ||
eventClassNames = eventClassNames({ | ||
@@ -128,0 +127,0 @@ event: toEventWithLocalDates(event), |
import {derived} from 'svelte/store'; | ||
import {is_function} from 'svelte/internal'; | ||
import {isFunction} from './utils.js'; | ||
import {toLocalDate} from './date'; | ||
@@ -8,3 +8,3 @@ import {createResources} from './resources.js'; | ||
return derived([locale, format], ([$locale, $format]) => { | ||
let intl = is_function($format) | ||
let intl = isFunction($format) | ||
? {format: $format} | ||
@@ -21,3 +21,3 @@ : new Intl.DateTimeFormat($locale, $format); | ||
let formatRange; | ||
if (is_function($format)) { | ||
if (isFunction($format)) { | ||
formatRange = $format; | ||
@@ -24,0 +24,0 @@ } else { |
@@ -1,4 +0,3 @@ | ||
import {is_function} from 'svelte/internal'; | ||
import {addDuration, cloneDate, createDuration, DAY_IN_SECONDS, toISOString, toSeconds} from './date.js'; | ||
import {max as maxFn, min as minFn} from './utils.js'; | ||
import {max as maxFn, min as minFn, isFunction} from './utils.js'; | ||
import {bgEvent} from './events.js'; | ||
@@ -35,3 +34,3 @@ | ||
let maxMax = createDuration(maxFn(toSeconds(max), toSeconds(minMin) + DAY_IN_SECONDS)); | ||
let filter = is_function($flexibleSlotTimeLimits?.eventFilter) | ||
let filter = isFunction($flexibleSlotTimeLimits?.eventFilter) | ||
? $flexibleSlotTimeLimits.eventFilter | ||
@@ -38,0 +37,0 @@ : event => !bgEvent(event.display); |
@@ -32,1 +32,17 @@ export function assign(...args) { | ||
} | ||
export function isFunction(value) { | ||
return typeof value === 'function'; | ||
} | ||
export function run(fn) { | ||
return fn(); | ||
} | ||
export function runAll(fns) { | ||
fns.forEach(run); | ||
} | ||
export function noop() {} | ||
export const identity = (x) => x; |
import {get, writable} from 'svelte/store'; | ||
import {is_function, tick, noop, identity} from 'svelte/internal'; | ||
import {tick} from 'svelte'; | ||
import {createOptions, createParsers} from './options'; | ||
@@ -15,3 +15,3 @@ import { | ||
} from './stores'; | ||
import {keys, intl, intlRange} from '../lib.js'; | ||
import {keys, intl, intlRange, isFunction, identity} from '../lib.js'; | ||
@@ -101,3 +101,3 @@ export default class { | ||
? value => { | ||
if (is_function(value)) { | ||
if (isFunction(value)) { | ||
let result = value(defOpts[key]); | ||
@@ -124,3 +124,3 @@ opts[key] = result; | ||
this._viewComponent.set(component); | ||
if (is_function(opts.viewDidMount)) { | ||
if (isFunction(opts.viewDidMount)) { | ||
tick().then(() => opts.viewDidMount(get(this._view))); | ||
@@ -159,3 +159,3 @@ } | ||
for (let key of ['buttonText', 'theme']) { | ||
if (is_function(opts[key])) { | ||
if (isFunction(opts[key])) { | ||
override[key] = opts[key](result[key]); | ||
@@ -162,0 +162,0 @@ } |
import {derived, writable, readable, get} from 'svelte/store'; | ||
import {is_function} from 'svelte/internal'; | ||
import {isFunction} from '../lib/utils.js'; | ||
import { | ||
@@ -130,7 +130,7 @@ DAY_IN_SECONDS, | ||
// Call loading hook | ||
if (is_function($loading) && !fetching) { | ||
if (isFunction($loading) && !fetching) { | ||
$loading(true); | ||
} | ||
let stopLoading = () => { | ||
if (--fetching === 0 && is_function($loading)) { | ||
if (--fetching === 0 && isFunction($loading)) { | ||
$loading(false); | ||
@@ -152,3 +152,3 @@ } | ||
for (let source of $eventSources) { | ||
if (is_function(source.events)) { | ||
if (isFunction(source.events)) { | ||
// Events as a function | ||
@@ -167,3 +167,3 @@ let result = source.events({ | ||
// Prepare params | ||
let params = is_function(source.extraParams) ? source.extraParams() : assign({}, source.extraParams); | ||
let params = isFunction(source.extraParams) ? source.extraParams() : assign({}, source.extraParams); | ||
params.start = startStr; | ||
@@ -170,0 +170,0 @@ params.end = endStr; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
232141
4509
2965