@fullcalendar/core 5.10.0 → 5.11.2

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/locales-all.js CHANGED
@@ -355,6 +355,11 @@ var l15 = {
355
355
  noEventsText: 'Ingen arrangementer at vise',
356
356
  };
357
357
 
358
+ function affix$1(buttonText) {
359
+ return (buttonText === 'Tag' || buttonText === 'Monat') ? 'r' :
360
+ buttonText === 'Jahr' ? 's' : ''
361
+ }
362
+
358
363
  var l16 = {
359
364
  code: 'de-at',
360
365
  week: {
@@ -372,13 +377,48 @@ var l16 = {
372
377
  list: 'Terminübersicht',
373
378
  },
374
379
  weekText: 'KW',
380
+ weekTextLong: 'Woche',
375
381
  allDayText: 'Ganztägig',
376
382
  moreLinkText: function(n) {
377
383
  return '+ weitere ' + n
378
384
  },
379
385
  noEventsText: 'Keine Ereignisse anzuzeigen',
386
+ buttonHints: {
387
+ prev(buttonText) {
388
+ return `Vorherige${affix$1(buttonText)} ${buttonText}`
389
+ },
390
+ next(buttonText) {
391
+ return `Nächste${affix$1(buttonText)} ${buttonText}`
392
+ },
393
+ today(buttonText) {
394
+ // → Heute, Diese Woche, Dieser Monat, Dieses Jahr
395
+ if (buttonText === 'Tag') {
396
+ return 'Heute'
397
+ }
398
+ return `Diese${affix$1(buttonText)} ${buttonText}`
399
+ },
400
+ },
401
+ viewHint(buttonText) {
402
+ // → Tagesansicht, Wochenansicht, Monatsansicht, Jahresansicht
403
+ const glue = buttonText === 'Woche' ? 'n' : buttonText === 'Monat' ? 's' : 'es';
404
+ return buttonText + glue + 'ansicht'
405
+ },
406
+ navLinkHint: 'Gehe zu $0',
407
+ moreLinkHint(eventCnt) {
408
+ return 'Zeige ' + (eventCnt === 1 ?
409
+ 'ein weiteres Ereignis' :
410
+ eventCnt + ' weitere Ereignisse')
411
+ },
412
+ closeHint: 'Schließen',
413
+ timeHint: 'Uhrzeit',
414
+ eventHint: 'Ereignis',
380
415
  };
381
416
 
417
+ function affix(buttonText) {
418
+ return (buttonText === 'Tag' || buttonText === 'Monat') ? 'r' :
419
+ buttonText === 'Jahr' ? 's' : ''
420
+ }
421
+
382
422
  var l17 = {
383
423
  code: 'de',
384
424
  week: {
@@ -396,11 +436,41 @@ var l17 = {
396
436
  list: 'Terminübersicht',
397
437
  },
398
438
  weekText: 'KW',
439
+ weekTextLong: 'Woche',
399
440
  allDayText: 'Ganztägig',
400
441
  moreLinkText: function(n) {
401
442
  return '+ weitere ' + n
402
443
  },
403
444
  noEventsText: 'Keine Ereignisse anzuzeigen',
445
+ buttonHints: {
446
+ prev(buttonText) {
447
+ return `Vorherige${affix(buttonText)} ${buttonText}`
448
+ },
449
+ next(buttonText) {
450
+ return `Nächste${affix(buttonText)} ${buttonText}`
451
+ },
452
+ today(buttonText) {
453
+ // → Heute, Diese Woche, Dieser Monat, Dieses Jahr
454
+ if (buttonText === 'Tag') {
455
+ return 'Heute'
456
+ }
457
+ return `Diese${affix(buttonText)} ${buttonText}`
458
+ },
459
+ },
460
+ viewHint(buttonText) {
461
+ // → Tagesansicht, Wochenansicht, Monatsansicht, Jahresansicht
462
+ const glue = buttonText === 'Woche' ? 'n' : buttonText === 'Monat' ? 's' : 'es';
463
+ return buttonText + glue + 'ansicht'
464
+ },
465
+ navLinkHint: 'Gehe zu $0',
466
+ moreLinkHint(eventCnt) {
467
+ return 'Zeige ' + (eventCnt === 1 ?
468
+ 'ein weiteres Ereignis' :
469
+ eventCnt + ' weitere Ereignisse')
470
+ },
471
+ closeHint: 'Schließen',
472
+ timeHint: 'Uhrzeit',
473
+ eventHint: 'Ereignis',
404
474
  };
405
475
 
406
476
  var l18 = {
@@ -1154,9 +1224,20 @@ var l52 = {
1154
1224
  list: 'Agenda',
1155
1225
  },
1156
1226
  weekText: 'Uke',
1227
+ weekTextLong: 'Uke',
1157
1228
  allDayText: 'Hele dagen',
1158
1229
  moreLinkText: 'til',
1159
1230
  noEventsText: 'Ingen hendelser å vise',
1231
+ buttonHints: {
1232
+ prev: 'Forrige $0',
1233
+ next: 'Neste $0',
1234
+ today: 'Nåværende $0',
1235
+ },
1236
+ viewHint: '$0 visning',
1237
+ navLinkHint: 'Gå til $0',
1238
+ moreLinkHint(eventCnt) {
1239
+ return `Vis ${eventCnt} flere hendelse${eventCnt === 1 ? '' : 'r'}`
1240
+ },
1160
1241
  };
1161
1242
 
1162
1243
  var l53 = {
@@ -1495,10 +1576,30 @@ var l68 = {
1495
1576
  day: 'Dag',
1496
1577
  list: 'Program',
1497
1578
  },
1579
+ buttonHints: {
1580
+ prev(buttonText) {
1581
+ return `Föregående ${buttonText.toLocaleLowerCase()}`
1582
+ },
1583
+ next(buttonText) {
1584
+ return `Nästa ${buttonText.toLocaleLowerCase()}`
1585
+ },
1586
+ today(buttonText) {
1587
+ return (buttonText === 'Program' ? 'Detta' : 'Denna') + ' ' + buttonText.toLocaleLowerCase()
1588
+ },
1589
+ },
1590
+ viewHint: '$0 vy',
1591
+ navLinkHint: 'Gå till $0',
1592
+ moreLinkHint(eventCnt) {
1593
+ return `Visa ytterligare ${eventCnt} händelse${eventCnt === 1 ? '' : 'r'}`
1594
+ },
1498
1595
  weekText: 'v.',
1596
+ weekTextLong: 'Vecka',
1499
1597
  allDayText: 'Heldag',
1500
1598
  moreLinkText: 'till',
1501
1599
  noEventsText: 'Inga händelser att visa',
1600
+ closeHint: 'Stäng',
1601
+ timeHint: 'Klockan',
1602
+ eventHint: 'Händelse',
1502
1603
  };
1503
1604
 
1504
1605
  var l69 = {
package/main.cjs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
- FullCalendar v5.10.0
2
+ FullCalendar v5.11.2
3
3
  Docs & License: https://fullcalendar.io/
4
- (c) 2021 Adam Shaw
4
+ (c) 2022 Adam Shaw
5
5
  */
6
6
  'use strict';
7
7
 
@@ -36,12 +36,14 @@ var Calendar = /** @class */ (function (_super) {
36
36
  if (_this.isRendering) {
37
37
  _this.isRendered = true;
38
38
  var currentData_1 = _this.currentData;
39
- common.render(common.createElement(common.CalendarRoot, { options: currentData_1.calendarOptions, theme: currentData_1.theme, emitter: currentData_1.emitter }, function (classNames, height, isHeightAuto, forPrint) {
40
- _this.setClassNames(classNames);
41
- _this.setHeight(height);
42
- return (common.createElement(common.CustomContentRenderContext.Provider, { value: _this.customContentRenderId },
43
- common.createElement(common.CalendarContent, tslib.__assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData_1))));
44
- }), _this.el);
39
+ common.flushSync(function () {
40
+ common.render(common.createElement(common.CalendarRoot, { options: currentData_1.calendarOptions, theme: currentData_1.theme, emitter: currentData_1.emitter }, function (classNames, height, isHeightAuto, forPrint) {
41
+ _this.setClassNames(classNames);
42
+ _this.setHeight(height);
43
+ return (common.createElement(common.CustomContentRenderContext.Provider, { value: _this.customContentRenderId },
44
+ common.createElement(common.CalendarContent, tslib.__assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData_1))));
45
+ }), _this.el);
46
+ });
45
47
  }
46
48
  else if (_this.isRendered) {
47
49
  _this.isRendered = false;
@@ -49,7 +51,6 @@ var Calendar = /** @class */ (function (_super) {
49
51
  _this.setClassNames([]);
50
52
  _this.setHeight('');
51
53
  }
52
- common.flushToDom();
53
54
  };
54
55
  _this.el = el;
55
56
  _this.renderRunner = new common.DelayedRunner(_this.handleRenderRequest);
@@ -87,8 +88,10 @@ var Calendar = /** @class */ (function (_super) {
87
88
  }
88
89
  };
89
90
  Calendar.prototype.updateSize = function () {
90
- _super.prototype.updateSize.call(this);
91
- common.flushToDom();
91
+ var _this = this;
92
+ common.flushSync(function () {
93
+ _super.prototype.updateSize.call(_this);
94
+ });
92
95
  };
93
96
  Calendar.prototype.batchRendering = function (func) {
94
97
  this.renderRunner.pause('batchRendering');
package/main.global.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*!
2
- FullCalendar v5.10.0
2
+ FullCalendar v5.11.2
3
3
  Docs & License: https://fullcalendar.io/
4
- (c) 2021 Adam Shaw
4
+ (c) 2022 Adam Shaw
5
5
  */
6
6
  var FullCalendar = (function (exports) {
7
7
  'use strict';
@@ -77,14 +77,15 @@ var FullCalendar = (function (exports) {
77
77
  Fragment: y,
78
78
  createContext: createContext$1,
79
79
  createPortal: I,
80
- flushToDom: flushToDom$1,
80
+ flushSync: flushSync$1,
81
81
  unmountComponentAtNode: unmountComponentAtNode$1,
82
82
  };
83
83
  }
84
84
  // HACKS...
85
85
  // TODO: lock version
86
86
  // TODO: link gh issues
87
- function flushToDom$1() {
87
+ function flushSync$1(runBeforeFlush) {
88
+ runBeforeFlush();
88
89
  var oldDebounceRendering = n.debounceRendering; // orig
89
90
  var callbackQ = [];
90
91
  function execCallbackSync(callback) {
@@ -1206,8 +1207,7 @@ var FullCalendar = (function (exports) {
1206
1207
  return currentResults;
1207
1208
  };
1208
1209
  }
1209
- function memoizeHashlike(// used?
1210
- workerFunc, resEquality, teardownFunc) {
1210
+ function memoizeHashlike(workerFunc, resEquality, teardownFunc) {
1211
1211
  var _this = this;
1212
1212
  var currentArgHash = {};
1213
1213
  var currentResHash = {};
@@ -1841,13 +1841,14 @@ var FullCalendar = (function (exports) {
1841
1841
  eventSources: identity,
1842
1842
  };
1843
1843
  var COMPLEX_OPTION_COMPARATORS = {
1844
- headerToolbar: isBoolComplexEqual,
1845
- footerToolbar: isBoolComplexEqual,
1846
- buttonText: isBoolComplexEqual,
1847
- buttonHints: isBoolComplexEqual,
1848
- buttonIcons: isBoolComplexEqual,
1844
+ headerToolbar: isMaybeObjectsEqual,
1845
+ footerToolbar: isMaybeObjectsEqual,
1846
+ buttonText: isMaybeObjectsEqual,
1847
+ buttonHints: isMaybeObjectsEqual,
1848
+ buttonIcons: isMaybeObjectsEqual,
1849
+ dateIncrement: isMaybeObjectsEqual,
1849
1850
  };
1850
- function isBoolComplexEqual(a, b) {
1851
+ function isMaybeObjectsEqual(a, b) {
1851
1852
  if (typeof a === 'object' && typeof b === 'object' && a && b) { // both non-null objects
1852
1853
  return isPropsEqual(a, b);
1853
1854
  }
@@ -5120,7 +5121,7 @@ var FullCalendar = (function (exports) {
5120
5121
  var Fragment = FullCalendarVDom.Fragment;
5121
5122
  var createContext = FullCalendarVDom.createContext;
5122
5123
  var createPortal = FullCalendarVDom.createPortal;
5123
- var flushToDom = FullCalendarVDom.flushToDom;
5124
+ var flushSync = FullCalendarVDom.flushSync;
5124
5125
  var unmountComponentAtNode = FullCalendarVDom.unmountComponentAtNode;
5125
5126
  /* eslint-enable */
5126
5127
 
@@ -5205,6 +5206,12 @@ var FullCalendar = (function (exports) {
5205
5206
  return !compareObjs(this.props, nextProps, this.propEquality) ||
5206
5207
  !compareObjs(this.state, nextState, this.stateEquality);
5207
5208
  };
5209
+ // HACK for freakin' React StrictMode
5210
+ PureComponent.prototype.safeSetState = function (newState) {
5211
+ if (!compareObjs(this.state, __assign(__assign({}, this.state), newState), this.stateEquality)) {
5212
+ this.setState(newState);
5213
+ }
5214
+ };
5208
5215
  PureComponent.addPropsEquality = addPropsEquality;
5209
5216
  PureComponent.addStateEquality = addStateEquality;
5210
5217
  PureComponent.contextType = ViewContextType;
@@ -7395,11 +7402,15 @@ var FullCalendar = (function (exports) {
7395
7402
  var anyChanges = false;
7396
7403
  var extra = {};
7397
7404
  for (var optionName in raw) {
7398
- if (raw[optionName] === currentRaw[optionName]) {
7405
+ if (raw[optionName] === currentRaw[optionName] ||
7406
+ (COMPLEX_OPTION_COMPARATORS[optionName] &&
7407
+ COMPLEX_OPTION_COMPARATORS[optionName](raw[optionName], currentRaw[optionName]))) {
7399
7408
  refined[optionName] = currentRefined[optionName];
7400
7409
  }
7401
7410
  else {
7402
- if (raw[optionName] === this.currentCalendarOptionsInput[optionName]) {
7411
+ if (raw[optionName] === this.currentCalendarOptionsInput[optionName] ||
7412
+ (COMPLEX_OPTION_COMPARATORS[optionName] &&
7413
+ COMPLEX_OPTION_COMPARATORS[optionName](raw[optionName], this.currentCalendarOptionsInput[optionName]))) {
7403
7414
  if (optionName in this.currentCalendarOptionsRefined) { // might be an "extra" prop
7404
7415
  refined[optionName] = this.currentCalendarOptionsRefined[optionName];
7405
7416
  }
@@ -8135,11 +8146,14 @@ var FullCalendar = (function (exports) {
8135
8146
  interactionSettingsStore[component.uid] = settings;
8136
8147
  };
8137
8148
  _this.unregisterInteractiveComponent = function (component) {
8138
- for (var _i = 0, _a = _this.interactionsStore[component.uid]; _i < _a.length; _i++) {
8139
- var listener = _a[_i];
8140
- listener.destroy();
8149
+ var listeners = _this.interactionsStore[component.uid];
8150
+ if (listeners) {
8151
+ for (var _i = 0, listeners_1 = listeners; _i < listeners_1.length; _i++) {
8152
+ var listener = listeners_1[_i];
8153
+ listener.destroy();
8154
+ }
8155
+ delete _this.interactionsStore[component.uid];
8141
8156
  }
8142
- delete _this.interactionsStore[component.uid];
8143
8157
  delete interactionSettingsStore[component.uid];
8144
8158
  };
8145
8159
  // Resizing
@@ -9229,7 +9243,7 @@ var FullCalendar = (function (exports) {
9229
9243
  };
9230
9244
  // TODO: can do a really simple print-view. dont need to join rows
9231
9245
  _this.handleSizing = function () {
9232
- _this.setState(__assign({ shrinkWidth: _this.computeShrinkWidth() }, _this.computeScrollerDims()));
9246
+ _this.safeSetState(__assign({ shrinkWidth: _this.computeShrinkWidth() }, _this.computeScrollerDims()));
9233
9247
  };
9234
9248
  return _this;
9235
9249
  }
@@ -9798,7 +9812,7 @@ var FullCalendar = (function (exports) {
9798
9812
 
9799
9813
  // exports
9800
9814
  // --------------------------------------------------------------------------------------------------
9801
- var version = '5.10.0'; // important to type it, so .d.ts has generic string
9815
+ var version = '5.11.2'; // important to type it, so .d.ts has generic string
9802
9816
 
9803
9817
  var Calendar = /** @class */ (function (_super) {
9804
9818
  __extends(Calendar, _super);
@@ -9825,12 +9839,14 @@ var FullCalendar = (function (exports) {
9825
9839
  if (_this.isRendering) {
9826
9840
  _this.isRendered = true;
9827
9841
  var currentData_1 = _this.currentData;
9828
- render(createElement(CalendarRoot, { options: currentData_1.calendarOptions, theme: currentData_1.theme, emitter: currentData_1.emitter }, function (classNames, height, isHeightAuto, forPrint) {
9829
- _this.setClassNames(classNames);
9830
- _this.setHeight(height);
9831
- return (createElement(CustomContentRenderContext.Provider, { value: _this.customContentRenderId },
9832
- createElement(CalendarContent, __assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData_1))));
9833
- }), _this.el);
9842
+ flushSync(function () {
9843
+ render(createElement(CalendarRoot, { options: currentData_1.calendarOptions, theme: currentData_1.theme, emitter: currentData_1.emitter }, function (classNames, height, isHeightAuto, forPrint) {
9844
+ _this.setClassNames(classNames);
9845
+ _this.setHeight(height);
9846
+ return (createElement(CustomContentRenderContext.Provider, { value: _this.customContentRenderId },
9847
+ createElement(CalendarContent, __assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData_1))));
9848
+ }), _this.el);
9849
+ });
9834
9850
  }
9835
9851
  else if (_this.isRendered) {
9836
9852
  _this.isRendered = false;
@@ -9838,7 +9854,6 @@ var FullCalendar = (function (exports) {
9838
9854
  _this.setClassNames([]);
9839
9855
  _this.setHeight('');
9840
9856
  }
9841
- flushToDom();
9842
9857
  };
9843
9858
  _this.el = el;
9844
9859
  _this.renderRunner = new DelayedRunner(_this.handleRenderRequest);
@@ -9876,8 +9891,10 @@ var FullCalendar = (function (exports) {
9876
9891
  }
9877
9892
  };
9878
9893
  Calendar.prototype.updateSize = function () {
9879
- _super.prototype.updateSize.call(this);
9880
- flushToDom();
9894
+ var _this = this;
9895
+ flushSync(function () {
9896
+ _super.prototype.updateSize.call(_this);
9897
+ });
9881
9898
  };
9882
9899
  Calendar.prototype.batchRendering = function (func) {
9883
9900
  this.renderRunner.pause('batchRendering');
@@ -10038,7 +10055,7 @@ var FullCalendar = (function (exports) {
10038
10055
  exports.findDirectChildren = findDirectChildren;
10039
10056
  exports.findElements = findElements;
10040
10057
  exports.flexibleCompare = flexibleCompare;
10041
- exports.flushToDom = flushToDom;
10058
+ exports.flushSync = flushSync;
10042
10059
  exports.formatDate = formatDate;
10043
10060
  exports.formatDayString = formatDayString;
10044
10061
  exports.formatIsoTimeString = formatIsoTimeString;