@fullcalendar/core 6.1.17 → 6.1.19

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.
Files changed (168) hide show
  1. package/index.cjs +12 -1
  2. package/index.global.js +77 -22
  3. package/index.global.min.js +2 -2
  4. package/index.js +12 -1
  5. package/internal-common.cjs +64 -20
  6. package/internal-common.d.ts +4 -1
  7. package/internal-common.js +64 -20
  8. package/locales/af.global.js +1 -1
  9. package/locales/af.global.min.js +1 -1
  10. package/locales/ar-dz.global.js +1 -1
  11. package/locales/ar-dz.global.min.js +1 -1
  12. package/locales/ar-kw.global.js +1 -1
  13. package/locales/ar-kw.global.min.js +1 -1
  14. package/locales/ar-ly.global.js +1 -1
  15. package/locales/ar-ly.global.min.js +1 -1
  16. package/locales/ar-ma.global.js +1 -1
  17. package/locales/ar-ma.global.min.js +1 -1
  18. package/locales/ar-sa.global.js +1 -1
  19. package/locales/ar-sa.global.min.js +1 -1
  20. package/locales/ar-tn.global.js +1 -1
  21. package/locales/ar-tn.global.min.js +1 -1
  22. package/locales/ar.global.js +1 -1
  23. package/locales/ar.global.min.js +1 -1
  24. package/locales/az.global.js +1 -1
  25. package/locales/az.global.min.js +1 -1
  26. package/locales/bg.global.js +1 -1
  27. package/locales/bg.global.min.js +1 -1
  28. package/locales/bn.global.js +1 -1
  29. package/locales/bn.global.min.js +1 -1
  30. package/locales/bs.global.js +1 -1
  31. package/locales/bs.global.min.js +1 -1
  32. package/locales/ca.global.js +1 -1
  33. package/locales/ca.global.min.js +1 -1
  34. package/locales/cs.global.js +1 -1
  35. package/locales/cs.global.min.js +1 -1
  36. package/locales/cy.global.js +1 -1
  37. package/locales/cy.global.min.js +1 -1
  38. package/locales/da.global.js +1 -1
  39. package/locales/da.global.min.js +1 -1
  40. package/locales/de-at.global.js +1 -1
  41. package/locales/de-at.global.min.js +1 -1
  42. package/locales/de.global.js +1 -1
  43. package/locales/de.global.min.js +1 -1
  44. package/locales/el.global.js +1 -1
  45. package/locales/el.global.min.js +1 -1
  46. package/locales/en-au.global.js +1 -1
  47. package/locales/en-au.global.min.js +1 -1
  48. package/locales/en-gb.global.js +1 -1
  49. package/locales/en-gb.global.min.js +1 -1
  50. package/locales/en-nz.global.js +1 -1
  51. package/locales/en-nz.global.min.js +1 -1
  52. package/locales/eo.global.js +1 -1
  53. package/locales/eo.global.min.js +1 -1
  54. package/locales/es-us.global.js +1 -1
  55. package/locales/es-us.global.min.js +1 -1
  56. package/locales/es.global.js +1 -1
  57. package/locales/es.global.min.js +1 -1
  58. package/locales/et.global.js +1 -1
  59. package/locales/et.global.min.js +1 -1
  60. package/locales/eu.global.js +1 -1
  61. package/locales/eu.global.min.js +1 -1
  62. package/locales/fa.global.js +1 -1
  63. package/locales/fa.global.min.js +1 -1
  64. package/locales/fi.global.js +1 -1
  65. package/locales/fi.global.min.js +1 -1
  66. package/locales/fr-ca.global.js +1 -1
  67. package/locales/fr-ca.global.min.js +1 -1
  68. package/locales/fr-ch.global.js +1 -1
  69. package/locales/fr-ch.global.min.js +1 -1
  70. package/locales/fr.global.js +1 -1
  71. package/locales/fr.global.min.js +1 -1
  72. package/locales/gl.global.js +1 -1
  73. package/locales/gl.global.min.js +1 -1
  74. package/locales/he.global.js +1 -1
  75. package/locales/he.global.min.js +1 -1
  76. package/locales/hi.global.js +1 -1
  77. package/locales/hi.global.min.js +1 -1
  78. package/locales/hr.global.js +1 -1
  79. package/locales/hr.global.min.js +1 -1
  80. package/locales/hu.global.js +1 -1
  81. package/locales/hu.global.min.js +1 -1
  82. package/locales/hy-am.global.js +1 -1
  83. package/locales/hy-am.global.min.js +1 -1
  84. package/locales/id.global.js +1 -1
  85. package/locales/id.global.min.js +1 -1
  86. package/locales/is.global.js +1 -1
  87. package/locales/is.global.min.js +1 -1
  88. package/locales/it.global.js +1 -1
  89. package/locales/it.global.min.js +1 -1
  90. package/locales/ja.global.js +1 -1
  91. package/locales/ja.global.min.js +1 -1
  92. package/locales/ka.global.js +1 -1
  93. package/locales/ka.global.min.js +1 -1
  94. package/locales/kk.global.js +1 -1
  95. package/locales/kk.global.min.js +1 -1
  96. package/locales/km.global.js +1 -1
  97. package/locales/km.global.min.js +1 -1
  98. package/locales/ko.global.js +1 -1
  99. package/locales/ko.global.min.js +1 -1
  100. package/locales/ku.global.js +1 -1
  101. package/locales/ku.global.min.js +1 -1
  102. package/locales/lb.global.js +1 -1
  103. package/locales/lb.global.min.js +1 -1
  104. package/locales/lt.global.js +1 -1
  105. package/locales/lt.global.min.js +1 -1
  106. package/locales/lv.global.js +1 -1
  107. package/locales/lv.global.min.js +1 -1
  108. package/locales/mk.global.js +1 -1
  109. package/locales/mk.global.min.js +1 -1
  110. package/locales/ms.global.js +1 -1
  111. package/locales/ms.global.min.js +1 -1
  112. package/locales/nb.global.js +1 -1
  113. package/locales/nb.global.min.js +1 -1
  114. package/locales/ne.global.js +1 -1
  115. package/locales/ne.global.min.js +1 -1
  116. package/locales/nl.global.js +1 -1
  117. package/locales/nl.global.min.js +1 -1
  118. package/locales/nn.global.js +1 -1
  119. package/locales/nn.global.min.js +1 -1
  120. package/locales/pl.global.js +1 -1
  121. package/locales/pl.global.min.js +1 -1
  122. package/locales/pt-br.global.js +1 -1
  123. package/locales/pt-br.global.min.js +1 -1
  124. package/locales/pt.global.js +1 -1
  125. package/locales/pt.global.min.js +1 -1
  126. package/locales/ro.global.js +1 -1
  127. package/locales/ro.global.min.js +1 -1
  128. package/locales/ru.global.js +1 -1
  129. package/locales/ru.global.min.js +1 -1
  130. package/locales/si-lk.global.js +1 -1
  131. package/locales/si-lk.global.min.js +1 -1
  132. package/locales/sk.global.js +1 -1
  133. package/locales/sk.global.min.js +1 -1
  134. package/locales/sl.global.js +1 -1
  135. package/locales/sl.global.min.js +1 -1
  136. package/locales/sm.global.js +1 -1
  137. package/locales/sm.global.min.js +1 -1
  138. package/locales/sq.global.js +1 -1
  139. package/locales/sq.global.min.js +1 -1
  140. package/locales/sr-cyrl.global.js +1 -1
  141. package/locales/sr-cyrl.global.min.js +1 -1
  142. package/locales/sr.global.js +1 -1
  143. package/locales/sr.global.min.js +1 -1
  144. package/locales/sv.global.js +1 -1
  145. package/locales/sv.global.min.js +1 -1
  146. package/locales/ta-in.global.js +1 -1
  147. package/locales/ta-in.global.min.js +1 -1
  148. package/locales/th.global.js +1 -1
  149. package/locales/th.global.min.js +1 -1
  150. package/locales/tr.global.js +1 -1
  151. package/locales/tr.global.min.js +1 -1
  152. package/locales/ug.global.js +1 -1
  153. package/locales/ug.global.min.js +1 -1
  154. package/locales/uk.global.js +1 -1
  155. package/locales/uk.global.min.js +1 -1
  156. package/locales/uz-cy.global.js +1 -1
  157. package/locales/uz-cy.global.min.js +1 -1
  158. package/locales/uz.global.js +1 -1
  159. package/locales/uz.global.min.js +1 -1
  160. package/locales/vi.global.js +1 -1
  161. package/locales/vi.global.min.js +1 -1
  162. package/locales/zh-cn.global.js +1 -1
  163. package/locales/zh-cn.global.min.js +1 -1
  164. package/locales/zh-tw.global.js +1 -1
  165. package/locales/zh-tw.global.min.js +1 -1
  166. package/locales-all.global.js +1 -1
  167. package/locales-all.global.min.js +1 -1
  168. package/package.json +1 -1
package/index.js CHANGED
@@ -1022,6 +1022,17 @@ function expandRanges(daysOfWeek, startTime, eventDateEnv, calendarDateEnv, fram
1022
1022
  let dayMarker = startOfDay(framingRange.start);
1023
1023
  let endMarker = framingRange.end;
1024
1024
  let instanceStarts = [];
1025
+ // https://github.com/fullcalendar/fullcalendar/issues/7934
1026
+ if (startTime) {
1027
+ if (startTime.milliseconds < 0) {
1028
+ // possible for next-day to have negative business hours that go into current day
1029
+ endMarker = addDays(endMarker, 1);
1030
+ }
1031
+ else if (startTime.milliseconds >= 1000 * 60 * 60 * 24) {
1032
+ // possible for prev-day to have >24hr business hours that go into current day
1033
+ dayMarker = addDays(dayMarker, -1);
1034
+ }
1035
+ }
1025
1036
  while (dayMarker < endMarker) {
1026
1037
  let instanceStart;
1027
1038
  // if everyday, or this particular day-of-week
@@ -2206,6 +2217,6 @@ function sliceEvents(props, allDay) {
2206
2217
  return sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;
2207
2218
  }
2208
2219
 
2209
- const version = '6.1.17';
2220
+ const version = '6.1.19';
2210
2221
 
2211
2222
  export { Calendar, createPlugin, formatDate, formatRange, globalLocales, globalPlugins, sliceEvents, version };
@@ -1374,6 +1374,7 @@ const BASE_OPTION_REFINERS = {
1374
1374
  viewDidMount: identity,
1375
1375
  viewWillUnmount: identity,
1376
1376
  nowIndicator: Boolean,
1377
+ nowIndicatorSnap: identity,
1377
1378
  nowIndicatorClassNames: identity,
1378
1379
  nowIndicatorContent: identity,
1379
1380
  nowIndicatorDidMount: identity,
@@ -1556,6 +1557,7 @@ const BASE_OPTION_DEFAULTS = {
1556
1557
  eventMinWidth: 30,
1557
1558
  eventShortHeight: 30,
1558
1559
  monthStartFormat: { month: 'long', day: 'numeric' },
1560
+ nowIndicatorSnap: 'auto',
1559
1561
  };
1560
1562
  // calendar listeners
1561
1563
  // ------------------
@@ -1776,6 +1778,25 @@ function compareObjs(oldProps, newProps, equalityFuncs = {}) {
1776
1778
  if (oldProps === newProps) {
1777
1779
  return true;
1778
1780
  }
1781
+ // if (debug) {
1782
+ // for (let key in newProps) {
1783
+ // if (key in oldProps && isObjValsEqual(oldProps[key], newProps[key], equalityFuncs[key])) {
1784
+ // // equal
1785
+ // } else {
1786
+ // if (debug) {
1787
+ // console.log('prop difference', key, oldProps[key], newProps[key])
1788
+ // }
1789
+ // }
1790
+ // }
1791
+ // // check for props that were omitted in the new
1792
+ // for (let key in oldProps) {
1793
+ // if (!(key in newProps)) {
1794
+ // if (debug) {
1795
+ // console.log('prop absent', key)
1796
+ // }
1797
+ // }
1798
+ // }
1799
+ // }
1779
1800
  for (let key in newProps) {
1780
1801
  if (key in oldProps && isObjValsEqual(oldProps[key], newProps[key], equalityFuncs[key])) ;
1781
1802
  else {
@@ -2366,13 +2387,14 @@ function buildViewContext(viewSpec, viewApi, viewOptions, dateProfileGenerator,
2366
2387
 
2367
2388
  /* eslint max-classes-per-file: off */
2368
2389
  class PureComponent extends preact.Component {
2390
+ // debug: boolean
2369
2391
  shouldComponentUpdate(nextProps, nextState) {
2370
- if (this.debug) {
2371
- // eslint-disable-next-line no-console
2372
- console.log(getUnequalProps(nextProps, this.props), getUnequalProps(nextState, this.state));
2373
- }
2374
- return !compareObjs(this.props, nextProps, this.propEquality) ||
2375
- !compareObjs(this.state, nextState, this.stateEquality);
2392
+ const shouldUpdate = !compareObjs(this.props, nextProps, this.propEquality /*, this.debug */) ||
2393
+ !compareObjs(this.state, nextState, this.stateEquality /*, this.debug */);
2394
+ // if (this.debug && shouldUpdate) {
2395
+ // console.log('shouldUpdate!')
2396
+ // }
2397
+ return shouldUpdate;
2376
2398
  }
2377
2399
  // HACK for freakin' React StrictMode
2378
2400
  safeSetState(newState) {
@@ -2612,10 +2634,10 @@ class ViewContainer extends BaseComponent {
2612
2634
  let { props, context } = this;
2613
2635
  let { options } = context;
2614
2636
  let renderProps = { view: context.viewApi };
2615
- return (preact.createElement(ContentContainer, Object.assign({}, props, { elTag: props.elTag || 'div', elClasses: [
2637
+ return (preact.createElement(ContentContainer, { elRef: props.elRef, elTag: props.elTag || 'div', elAttrs: props.elAttrs, elClasses: [
2616
2638
  ...buildViewClassNames(props.viewSpec),
2617
2639
  ...(props.elClasses || []),
2618
- ], renderProps: renderProps, classNameGenerator: options.viewClassNames, generatorName: undefined, didMount: options.viewDidMount, willUnmount: options.viewWillUnmount }), () => props.children));
2640
+ ], elStyle: props.elStyle, renderProps: renderProps, classNameGenerator: options.viewClassNames, generatorName: undefined, didMount: options.viewDidMount, willUnmount: options.viewWillUnmount }, () => props.children));
2619
2641
  }
2620
2642
  }
2621
2643
  function buildViewClassNames(viewSpec) {
@@ -4792,14 +4814,30 @@ class NowTimer extends preact.Component {
4792
4814
  computeTiming() {
4793
4815
  let { props, context } = this;
4794
4816
  let unroundedNow = context.nowManager.getDateMarker();
4795
- let currentUnitStart = context.dateEnv.startOf(unroundedNow, props.unit);
4796
- let nextUnitStart = context.dateEnv.add(currentUnitStart, createDuration(1, props.unit));
4797
- let waitMs = nextUnitStart.valueOf() - unroundedNow.valueOf();
4817
+ let { nowIndicatorSnap } = context.options;
4818
+ if (nowIndicatorSnap === 'auto') {
4819
+ nowIndicatorSnap =
4820
+ // large unit?
4821
+ /year|month|week|day/.test(props.unit) ||
4822
+ // if slotDuration 30 mins for example, would NOT appear to snap (legacy behavior)
4823
+ (props.unitValue || 1) === 1;
4824
+ }
4825
+ let nowDate;
4826
+ let waitMs;
4827
+ if (nowIndicatorSnap) {
4828
+ nowDate = context.dateEnv.startOf(unroundedNow, props.unit); // aka currentUnitStart
4829
+ let nextUnitStart = context.dateEnv.add(nowDate, createDuration(1, props.unit));
4830
+ waitMs = nextUnitStart.valueOf() - unroundedNow.valueOf();
4831
+ }
4832
+ else {
4833
+ nowDate = unroundedNow;
4834
+ waitMs = 1000 * 60; // 1 minute
4835
+ }
4798
4836
  // there is a max setTimeout ms value (https://stackoverflow.com/a/3468650/96342)
4799
4837
  // ensure no longer than a day
4800
4838
  waitMs = Math.min(1000 * 60 * 60 * 24, waitMs);
4801
4839
  return {
4802
- state: { nowDate: currentUnitStart, todayRange: buildDayRange(currentUnitStart) },
4840
+ state: { nowDate, todayRange: buildDayRange(nowDate) },
4803
4841
  waitMs,
4804
4842
  };
4805
4843
  }
@@ -7070,8 +7108,11 @@ function getSectionByKey(sections, key) {
7070
7108
  class EventContainer extends BaseComponent {
7071
7109
  constructor() {
7072
7110
  super(...arguments);
7111
+ // memo
7112
+ this.buildPublicEvent = memoize((context, eventDef, eventInstance) => new EventImpl(context, eventDef, eventInstance));
7073
7113
  this.handleEl = (el) => {
7074
7114
  this.el = el;
7115
+ setRef(this.props.elRef, el);
7075
7116
  if (el) {
7076
7117
  setElSeg(el, this.props.seg);
7077
7118
  }
@@ -7084,7 +7125,7 @@ class EventContainer extends BaseComponent {
7084
7125
  const { eventRange } = seg;
7085
7126
  const { ui } = eventRange;
7086
7127
  const renderProps = {
7087
- event: new EventImpl(context, eventRange.def, eventRange.instance),
7128
+ event: this.buildPublicEvent(context, eventRange.def, eventRange.instance),
7088
7129
  view: context.viewApi,
7089
7130
  timeText: props.timeText,
7090
7131
  textColor: ui.textColor,
@@ -7103,11 +7144,11 @@ class EventContainer extends BaseComponent {
7103
7144
  isDragging: Boolean(props.isDragging),
7104
7145
  isResizing: Boolean(props.isResizing),
7105
7146
  };
7106
- return (preact.createElement(ContentContainer, Object.assign({}, props /* contains children */, { elRef: this.handleEl, elClasses: [
7147
+ return (preact.createElement(ContentContainer, { elRef: this.handleEl, elTag: props.elTag, elAttrs: props.elAttrs, elClasses: [
7107
7148
  ...getEventClassNames(renderProps),
7108
7149
  ...seg.eventRange.ui.classNames,
7109
7150
  ...(props.elClasses || []),
7110
- ], renderProps: renderProps, generatorName: "eventContent", customGenerator: options.eventContent, defaultGenerator: props.defaultGenerator, classNameGenerator: options.eventClassNames, didMount: options.eventDidMount, willUnmount: options.eventWillUnmount })));
7151
+ ], elStyle: props.elStyle, renderProps: renderProps, generatorName: "eventContent", customGenerator: options.eventContent, defaultGenerator: props.defaultGenerator, classNameGenerator: options.eventClassNames, didMount: options.eventDidMount, willUnmount: options.eventWillUnmount }, props.children));
7111
7152
  }
7112
7153
  componentDidUpdate(prevProps) {
7113
7154
  if (this.el && this.props.seg !== prevProps.seg) {
@@ -7134,6 +7175,9 @@ class StandardEvent extends BaseComponent {
7134
7175
  Boolean(eventContentArg.isEndResizable) && (preact.createElement("div", { className: "fc-event-resizer fc-event-resizer-end" }))))));
7135
7176
  }
7136
7177
  }
7178
+ StandardEvent.addPropsEquality({
7179
+ seg: isPropsEqual,
7180
+ });
7137
7181
  function renderInnerContent$1(innerProps) {
7138
7182
  return (preact.createElement("div", { className: "fc-event-main-frame" },
7139
7183
  innerProps.timeText && (preact.createElement("div", { className: "fc-event-time" }, innerProps.timeText)),
@@ -7148,7 +7192,7 @@ const NowIndicatorContainer = (props) => (preact.createElement(ViewContextType.C
7148
7192
  date: context.dateEnv.toDate(props.date),
7149
7193
  view: context.viewApi,
7150
7194
  };
7151
- return (preact.createElement(ContentContainer, Object.assign({}, props /* includes children */, { elTag: props.elTag || 'div', renderProps: renderProps, generatorName: "nowIndicatorContent", customGenerator: options.nowIndicatorContent, classNameGenerator: options.nowIndicatorClassNames, didMount: options.nowIndicatorDidMount, willUnmount: options.nowIndicatorWillUnmount })));
7195
+ return (preact.createElement(ContentContainer, { elRef: props.elRef, elTag: props.elTag || 'div', elAttrs: props.elAttrs, elClasses: props.elClasses, elStyle: props.elStyle, renderProps: renderProps, generatorName: "nowIndicatorContent", customGenerator: options.nowIndicatorContent, classNameGenerator: options.nowIndicatorClassNames, didMount: options.nowIndicatorDidMount, willUnmount: options.nowIndicatorWillUnmount }, props.children));
7152
7196
  }));
7153
7197
 
7154
7198
  const DAY_NUM_FORMAT = createFormatter({ day: 'numeric' });
@@ -7171,12 +7215,12 @@ class DayCellContainer extends BaseComponent {
7171
7215
  dateEnv: context.dateEnv,
7172
7216
  monthStartFormat: options.monthStartFormat,
7173
7217
  });
7174
- return (preact.createElement(ContentContainer, Object.assign({}, props /* includes children */, { elClasses: [
7218
+ return (preact.createElement(ContentContainer, { elRef: props.elRef, elTag: props.elTag, elAttrs: Object.assign(Object.assign({}, props.elAttrs), (renderProps.isDisabled ? {} : { 'data-date': formatDayString(props.date) })), elClasses: [
7175
7219
  ...getDayClassNames(renderProps, context.theme),
7176
7220
  ...(props.elClasses || []),
7177
- ], elAttrs: Object.assign(Object.assign({}, props.elAttrs), (renderProps.isDisabled ? {} : { 'data-date': formatDayString(props.date) })), renderProps: renderProps, generatorName: "dayCellContent", customGenerator: options.dayCellContent, defaultGenerator: props.defaultGenerator, classNameGenerator:
7221
+ ], elStyle: props.elStyle, renderProps: renderProps, generatorName: "dayCellContent", customGenerator: options.dayCellContent, defaultGenerator: props.defaultGenerator, classNameGenerator:
7178
7222
  // don't use custom classNames if disabled
7179
- renderProps.isDisabled ? undefined : options.dayCellClassNames, didMount: options.dayCellDidMount, willUnmount: options.dayCellWillUnmount })));
7223
+ renderProps.isDisabled ? undefined : options.dayCellClassNames, didMount: options.dayCellDidMount, willUnmount: options.dayCellWillUnmount }, props.children));
7180
7224
  }
7181
7225
  }
7182
7226
  function hasCustomDayCellContent(options) {
@@ -7213,7 +7257,7 @@ const WeekNumberContainer = (props) => (preact.createElement(ViewContextType.Con
7213
7257
  let text = dateEnv.format(date, format);
7214
7258
  let renderProps = { num, text, date };
7215
7259
  return (preact.createElement(ContentContainer // why isn't WeekNumberContentArg being auto-detected?
7216
- , Object.assign({}, props /* includes children */, { renderProps: renderProps, generatorName: "weekNumberContent", customGenerator: options.weekNumberContent, defaultGenerator: renderInner, classNameGenerator: options.weekNumberClassNames, didMount: options.weekNumberDidMount, willUnmount: options.weekNumberWillUnmount })));
7260
+ , { elRef: props.elRef, elTag: props.elTag, elAttrs: props.elAttrs, elClasses: props.elClasses, elStyle: props.elStyle, renderProps: renderProps, generatorName: "weekNumberContent", customGenerator: options.weekNumberContent, defaultGenerator: renderInner, classNameGenerator: options.weekNumberClassNames, didMount: options.weekNumberDidMount, willUnmount: options.weekNumberWillUnmount }, props.children));
7217
7261
  }));
7218
7262
  function renderInner(innerProps) {
7219
7263
  return innerProps.text;
@@ -943,7 +943,6 @@ declare abstract class PureComponent<Props = Dictionary, State = Dictionary> ext
943
943
  context: ViewContext;
944
944
  propEquality: EqualityFuncs<Props>;
945
945
  stateEquality: EqualityFuncs<State>;
946
- debug: boolean;
947
946
  shouldComponentUpdate(nextProps: Props, nextState: State): boolean;
948
947
  safeSetState(newState: Partial<State>): void;
949
948
  }
@@ -2036,6 +2035,7 @@ declare const BASE_OPTION_REFINERS: {
2036
2035
  viewDidMount: Identity<DidMountHandler<ViewMountArg>>;
2037
2036
  viewWillUnmount: Identity<WillUnmountHandler<ViewMountArg>>;
2038
2037
  nowIndicator: BooleanConstructor;
2038
+ nowIndicatorSnap: Identity<boolean | "auto">;
2039
2039
  nowIndicatorClassNames: Identity<ClassNamesGenerator<NowIndicatorContentArg>>;
2040
2040
  nowIndicatorContent: Identity<CustomContentGenerator<NowIndicatorContentArg>>;
2041
2041
  nowIndicatorDidMount: Identity<DidMountHandler<NowIndicatorMountArg>>;
@@ -2229,6 +2229,7 @@ declare const BASE_OPTION_DEFAULTS: {
2229
2229
  month: string;
2230
2230
  day: string;
2231
2231
  };
2232
+ nowIndicatorSnap: string;
2232
2233
  };
2233
2234
  type BaseOptionsRefined = DefaultedRefinedOptions<RefinedOptionsFromRefiners<Required<BaseOptionRefiners>>, // Required is a hack for "Index signature is missing"
2234
2235
  keyof typeof BASE_OPTION_DEFAULTS>;
@@ -2746,6 +2747,7 @@ declare function getIsRtlScrollbarOnLeft(): boolean;
2746
2747
 
2747
2748
  interface NowTimerProps {
2748
2749
  unit: string;
2750
+ unitValue?: number;
2749
2751
  children: (now: DateMarker, todayRange: DateRange) => ComponentChildren;
2750
2752
  }
2751
2753
  interface NowTimerState {
@@ -2807,6 +2809,7 @@ type EventContainerProps = ElProps & MinimalEventProps & {
2807
2809
  children?: InnerContainerFunc<EventContentArg>;
2808
2810
  };
2809
2811
  declare class EventContainer extends BaseComponent<EventContainerProps> {
2812
+ private buildPublicEvent;
2810
2813
  el: HTMLElement;
2811
2814
  render(): createElement.JSX.Element;
2812
2815
  handleEl: (el: HTMLElement | null) => void;
@@ -1353,6 +1353,7 @@ const BASE_OPTION_REFINERS = {
1353
1353
  viewDidMount: identity,
1354
1354
  viewWillUnmount: identity,
1355
1355
  nowIndicator: Boolean,
1356
+ nowIndicatorSnap: identity,
1356
1357
  nowIndicatorClassNames: identity,
1357
1358
  nowIndicatorContent: identity,
1358
1359
  nowIndicatorDidMount: identity,
@@ -1535,6 +1536,7 @@ const BASE_OPTION_DEFAULTS = {
1535
1536
  eventMinWidth: 30,
1536
1537
  eventShortHeight: 30,
1537
1538
  monthStartFormat: { month: 'long', day: 'numeric' },
1539
+ nowIndicatorSnap: 'auto',
1538
1540
  };
1539
1541
  // calendar listeners
1540
1542
  // ------------------
@@ -1755,6 +1757,25 @@ function compareObjs(oldProps, newProps, equalityFuncs = {}) {
1755
1757
  if (oldProps === newProps) {
1756
1758
  return true;
1757
1759
  }
1760
+ // if (debug) {
1761
+ // for (let key in newProps) {
1762
+ // if (key in oldProps && isObjValsEqual(oldProps[key], newProps[key], equalityFuncs[key])) {
1763
+ // // equal
1764
+ // } else {
1765
+ // if (debug) {
1766
+ // console.log('prop difference', key, oldProps[key], newProps[key])
1767
+ // }
1768
+ // }
1769
+ // }
1770
+ // // check for props that were omitted in the new
1771
+ // for (let key in oldProps) {
1772
+ // if (!(key in newProps)) {
1773
+ // if (debug) {
1774
+ // console.log('prop absent', key)
1775
+ // }
1776
+ // }
1777
+ // }
1778
+ // }
1758
1779
  for (let key in newProps) {
1759
1780
  if (key in oldProps && isObjValsEqual(oldProps[key], newProps[key], equalityFuncs[key])) ;
1760
1781
  else {
@@ -2345,13 +2366,14 @@ function buildViewContext(viewSpec, viewApi, viewOptions, dateProfileGenerator,
2345
2366
 
2346
2367
  /* eslint max-classes-per-file: off */
2347
2368
  class PureComponent extends Component {
2369
+ // debug: boolean
2348
2370
  shouldComponentUpdate(nextProps, nextState) {
2349
- if (this.debug) {
2350
- // eslint-disable-next-line no-console
2351
- console.log(getUnequalProps(nextProps, this.props), getUnequalProps(nextState, this.state));
2352
- }
2353
- return !compareObjs(this.props, nextProps, this.propEquality) ||
2354
- !compareObjs(this.state, nextState, this.stateEquality);
2371
+ const shouldUpdate = !compareObjs(this.props, nextProps, this.propEquality /*, this.debug */) ||
2372
+ !compareObjs(this.state, nextState, this.stateEquality /*, this.debug */);
2373
+ // if (this.debug && shouldUpdate) {
2374
+ // console.log('shouldUpdate!')
2375
+ // }
2376
+ return shouldUpdate;
2355
2377
  }
2356
2378
  // HACK for freakin' React StrictMode
2357
2379
  safeSetState(newState) {
@@ -2591,10 +2613,10 @@ class ViewContainer extends BaseComponent {
2591
2613
  let { props, context } = this;
2592
2614
  let { options } = context;
2593
2615
  let renderProps = { view: context.viewApi };
2594
- return (createElement(ContentContainer, Object.assign({}, props, { elTag: props.elTag || 'div', elClasses: [
2616
+ return (createElement(ContentContainer, { elRef: props.elRef, elTag: props.elTag || 'div', elAttrs: props.elAttrs, elClasses: [
2595
2617
  ...buildViewClassNames(props.viewSpec),
2596
2618
  ...(props.elClasses || []),
2597
- ], renderProps: renderProps, classNameGenerator: options.viewClassNames, generatorName: undefined, didMount: options.viewDidMount, willUnmount: options.viewWillUnmount }), () => props.children));
2619
+ ], elStyle: props.elStyle, renderProps: renderProps, classNameGenerator: options.viewClassNames, generatorName: undefined, didMount: options.viewDidMount, willUnmount: options.viewWillUnmount }, () => props.children));
2598
2620
  }
2599
2621
  }
2600
2622
  function buildViewClassNames(viewSpec) {
@@ -4771,14 +4793,30 @@ class NowTimer extends Component {
4771
4793
  computeTiming() {
4772
4794
  let { props, context } = this;
4773
4795
  let unroundedNow = context.nowManager.getDateMarker();
4774
- let currentUnitStart = context.dateEnv.startOf(unroundedNow, props.unit);
4775
- let nextUnitStart = context.dateEnv.add(currentUnitStart, createDuration(1, props.unit));
4776
- let waitMs = nextUnitStart.valueOf() - unroundedNow.valueOf();
4796
+ let { nowIndicatorSnap } = context.options;
4797
+ if (nowIndicatorSnap === 'auto') {
4798
+ nowIndicatorSnap =
4799
+ // large unit?
4800
+ /year|month|week|day/.test(props.unit) ||
4801
+ // if slotDuration 30 mins for example, would NOT appear to snap (legacy behavior)
4802
+ (props.unitValue || 1) === 1;
4803
+ }
4804
+ let nowDate;
4805
+ let waitMs;
4806
+ if (nowIndicatorSnap) {
4807
+ nowDate = context.dateEnv.startOf(unroundedNow, props.unit); // aka currentUnitStart
4808
+ let nextUnitStart = context.dateEnv.add(nowDate, createDuration(1, props.unit));
4809
+ waitMs = nextUnitStart.valueOf() - unroundedNow.valueOf();
4810
+ }
4811
+ else {
4812
+ nowDate = unroundedNow;
4813
+ waitMs = 1000 * 60; // 1 minute
4814
+ }
4777
4815
  // there is a max setTimeout ms value (https://stackoverflow.com/a/3468650/96342)
4778
4816
  // ensure no longer than a day
4779
4817
  waitMs = Math.min(1000 * 60 * 60 * 24, waitMs);
4780
4818
  return {
4781
- state: { nowDate: currentUnitStart, todayRange: buildDayRange(currentUnitStart) },
4819
+ state: { nowDate, todayRange: buildDayRange(nowDate) },
4782
4820
  waitMs,
4783
4821
  };
4784
4822
  }
@@ -7049,8 +7087,11 @@ function getSectionByKey(sections, key) {
7049
7087
  class EventContainer extends BaseComponent {
7050
7088
  constructor() {
7051
7089
  super(...arguments);
7090
+ // memo
7091
+ this.buildPublicEvent = memoize((context, eventDef, eventInstance) => new EventImpl(context, eventDef, eventInstance));
7052
7092
  this.handleEl = (el) => {
7053
7093
  this.el = el;
7094
+ setRef(this.props.elRef, el);
7054
7095
  if (el) {
7055
7096
  setElSeg(el, this.props.seg);
7056
7097
  }
@@ -7063,7 +7104,7 @@ class EventContainer extends BaseComponent {
7063
7104
  const { eventRange } = seg;
7064
7105
  const { ui } = eventRange;
7065
7106
  const renderProps = {
7066
- event: new EventImpl(context, eventRange.def, eventRange.instance),
7107
+ event: this.buildPublicEvent(context, eventRange.def, eventRange.instance),
7067
7108
  view: context.viewApi,
7068
7109
  timeText: props.timeText,
7069
7110
  textColor: ui.textColor,
@@ -7082,11 +7123,11 @@ class EventContainer extends BaseComponent {
7082
7123
  isDragging: Boolean(props.isDragging),
7083
7124
  isResizing: Boolean(props.isResizing),
7084
7125
  };
7085
- return (createElement(ContentContainer, Object.assign({}, props /* contains children */, { elRef: this.handleEl, elClasses: [
7126
+ return (createElement(ContentContainer, { elRef: this.handleEl, elTag: props.elTag, elAttrs: props.elAttrs, elClasses: [
7086
7127
  ...getEventClassNames(renderProps),
7087
7128
  ...seg.eventRange.ui.classNames,
7088
7129
  ...(props.elClasses || []),
7089
- ], renderProps: renderProps, generatorName: "eventContent", customGenerator: options.eventContent, defaultGenerator: props.defaultGenerator, classNameGenerator: options.eventClassNames, didMount: options.eventDidMount, willUnmount: options.eventWillUnmount })));
7130
+ ], elStyle: props.elStyle, renderProps: renderProps, generatorName: "eventContent", customGenerator: options.eventContent, defaultGenerator: props.defaultGenerator, classNameGenerator: options.eventClassNames, didMount: options.eventDidMount, willUnmount: options.eventWillUnmount }, props.children));
7090
7131
  }
7091
7132
  componentDidUpdate(prevProps) {
7092
7133
  if (this.el && this.props.seg !== prevProps.seg) {
@@ -7113,6 +7154,9 @@ class StandardEvent extends BaseComponent {
7113
7154
  Boolean(eventContentArg.isEndResizable) && (createElement("div", { className: "fc-event-resizer fc-event-resizer-end" }))))));
7114
7155
  }
7115
7156
  }
7157
+ StandardEvent.addPropsEquality({
7158
+ seg: isPropsEqual,
7159
+ });
7116
7160
  function renderInnerContent$1(innerProps) {
7117
7161
  return (createElement("div", { className: "fc-event-main-frame" },
7118
7162
  innerProps.timeText && (createElement("div", { className: "fc-event-time" }, innerProps.timeText)),
@@ -7127,7 +7171,7 @@ const NowIndicatorContainer = (props) => (createElement(ViewContextType.Consumer
7127
7171
  date: context.dateEnv.toDate(props.date),
7128
7172
  view: context.viewApi,
7129
7173
  };
7130
- return (createElement(ContentContainer, Object.assign({}, props /* includes children */, { elTag: props.elTag || 'div', renderProps: renderProps, generatorName: "nowIndicatorContent", customGenerator: options.nowIndicatorContent, classNameGenerator: options.nowIndicatorClassNames, didMount: options.nowIndicatorDidMount, willUnmount: options.nowIndicatorWillUnmount })));
7174
+ return (createElement(ContentContainer, { elRef: props.elRef, elTag: props.elTag || 'div', elAttrs: props.elAttrs, elClasses: props.elClasses, elStyle: props.elStyle, renderProps: renderProps, generatorName: "nowIndicatorContent", customGenerator: options.nowIndicatorContent, classNameGenerator: options.nowIndicatorClassNames, didMount: options.nowIndicatorDidMount, willUnmount: options.nowIndicatorWillUnmount }, props.children));
7131
7175
  }));
7132
7176
 
7133
7177
  const DAY_NUM_FORMAT = createFormatter({ day: 'numeric' });
@@ -7150,12 +7194,12 @@ class DayCellContainer extends BaseComponent {
7150
7194
  dateEnv: context.dateEnv,
7151
7195
  monthStartFormat: options.monthStartFormat,
7152
7196
  });
7153
- return (createElement(ContentContainer, Object.assign({}, props /* includes children */, { elClasses: [
7197
+ return (createElement(ContentContainer, { elRef: props.elRef, elTag: props.elTag, elAttrs: Object.assign(Object.assign({}, props.elAttrs), (renderProps.isDisabled ? {} : { 'data-date': formatDayString(props.date) })), elClasses: [
7154
7198
  ...getDayClassNames(renderProps, context.theme),
7155
7199
  ...(props.elClasses || []),
7156
- ], elAttrs: Object.assign(Object.assign({}, props.elAttrs), (renderProps.isDisabled ? {} : { 'data-date': formatDayString(props.date) })), renderProps: renderProps, generatorName: "dayCellContent", customGenerator: options.dayCellContent, defaultGenerator: props.defaultGenerator, classNameGenerator:
7200
+ ], elStyle: props.elStyle, renderProps: renderProps, generatorName: "dayCellContent", customGenerator: options.dayCellContent, defaultGenerator: props.defaultGenerator, classNameGenerator:
7157
7201
  // don't use custom classNames if disabled
7158
- renderProps.isDisabled ? undefined : options.dayCellClassNames, didMount: options.dayCellDidMount, willUnmount: options.dayCellWillUnmount })));
7202
+ renderProps.isDisabled ? undefined : options.dayCellClassNames, didMount: options.dayCellDidMount, willUnmount: options.dayCellWillUnmount }, props.children));
7159
7203
  }
7160
7204
  }
7161
7205
  function hasCustomDayCellContent(options) {
@@ -7192,7 +7236,7 @@ const WeekNumberContainer = (props) => (createElement(ViewContextType.Consumer,
7192
7236
  let text = dateEnv.format(date, format);
7193
7237
  let renderProps = { num, text, date };
7194
7238
  return (createElement(ContentContainer // why isn't WeekNumberContentArg being auto-detected?
7195
- , Object.assign({}, props /* includes children */, { renderProps: renderProps, generatorName: "weekNumberContent", customGenerator: options.weekNumberContent, defaultGenerator: renderInner, classNameGenerator: options.weekNumberClassNames, didMount: options.weekNumberDidMount, willUnmount: options.weekNumberWillUnmount })));
7239
+ , { elRef: props.elRef, elTag: props.elTag, elAttrs: props.elAttrs, elClasses: props.elClasses, elStyle: props.elStyle, renderProps: renderProps, generatorName: "weekNumberContent", customGenerator: options.weekNumberContent, defaultGenerator: renderInner, classNameGenerator: options.weekNumberClassNames, didMount: options.weekNumberDidMount, willUnmount: options.weekNumberWillUnmount }, props.children));
7196
7240
  }));
7197
7241
  function renderInner(innerProps) {
7198
7242
  return innerProps.text;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Core v6.1.17
2
+ FullCalendar Core v6.1.19
3
3
  Docs & License: https://fullcalendar.io
4
4
  (c) 2024 Adam Shaw
5
5
  */