@event-calendar/core 4.6.0 → 4.7.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@event-calendar/core",
3
- "version": "4.6.0",
3
+ "version": "4.7.0",
4
4
  "title": "Event Calendar Core package",
5
5
  "description": "Full-sized drag & drop event calendar with resource & timeline views",
6
6
  "keywords": [
@@ -2,6 +2,9 @@ import {
2
2
  createDate, createDuration, createEvents, createEventSources, createResources, createDateRange, keys, setMidnight
3
3
  } from '#lib';
4
4
 
5
+ // Options where initial value is passed to the function
6
+ export const specialOptions = ['buttonText', 'customButtons', 'theme'];
7
+
5
8
  export function createOptions(plugins) {
6
9
  let options = {
7
10
  allDayContent: undefined,
@@ -1,6 +1,6 @@
1
1
  import {get, writable} from 'svelte/store';
2
2
  import {tick} from 'svelte';
3
- import {createOptions, createParsers} from './options.js';
3
+ import {createOptions, createParsers, specialOptions} from './options.js';
4
4
  import {activeRange, currentRange, dayGrid, events, now, today, view as view2, viewDates, viewTitle, filteredEvents} from './stores.js';
5
5
  import {identity, intl, intlRange, isFunction, keys, toViewWithLocalDates} from '#lib';
6
6
 
@@ -86,7 +86,7 @@ export default class {
86
86
 
87
87
  this[key] = {
88
88
  // Set value in all views
89
- set: ['buttonText', 'theme'].includes(key)
89
+ set: specialOptions.includes(key)
90
90
  ? value => {
91
91
  if (isFunction(value)) {
92
92
  let result = value(defOpts[key]);
@@ -145,7 +145,7 @@ function mergeOpts(...args) {
145
145
  let result = {};
146
146
  for (let opts of args) {
147
147
  let override = {};
148
- for (let key of ['buttonText', 'theme']) {
148
+ for (let key of specialOptions) {
149
149
  if (isFunction(opts[key])) {
150
150
  override[key] = opts[key](result[key]);
151
151
  }