fullcalendar 6.1.1 → 6.1.4

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/index.global.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Standard Bundle v6.1.1
2
+ FullCalendar Standard Bundle v6.1.4
3
3
  Docs & License: https://fullcalendar.io/docs/initialize-globals
4
4
  (c) 2023 Adam Shaw
5
5
  */
@@ -1909,6 +1909,9 @@ var FullCalendar = (function (exports) {
1909
1909
  getMonth(marker) {
1910
1910
  return this.calendarSystem.getMarkerMonth(marker);
1911
1911
  }
1912
+ getDay(marker) {
1913
+ return this.calendarSystem.getMarkerDay(marker);
1914
+ }
1912
1915
  // Adding / Subtracting
1913
1916
  add(marker, dur) {
1914
1917
  let a = this.calendarSystem.markerToArray(marker);
@@ -2392,20 +2395,20 @@ var FullCalendar = (function (exports) {
2392
2395
  useDefault = true;
2393
2396
  }
2394
2397
  else {
2395
- if (options.handleCustomRendering) { // non-Preact (likely React)
2396
- currentGeneratorMeta = customGeneratorRes;
2398
+ const isObject = customGeneratorRes && typeof customGeneratorRes === 'object'; // non-null
2399
+ if (isObject && ('html' in customGeneratorRes)) {
2400
+ attrs.dangerouslySetInnerHTML = { __html: customGeneratorRes.html };
2397
2401
  }
2398
- else { // preact or { html, domNodes }
2399
- const isObject = typeof customGeneratorRes === 'object';
2400
- if (isObject && ('html' in customGeneratorRes)) {
2401
- attrs.dangerouslySetInnerHTML = { __html: customGeneratorRes.html };
2402
- }
2403
- else if (isObject && ('domNodes' in customGeneratorRes)) {
2404
- queuedDomNodes = Array.prototype.slice.call(customGeneratorRes.domNodes);
2405
- }
2406
- else {
2407
- innerContent = customGeneratorRes;
2408
- }
2402
+ else if (isObject && ('domNodes' in customGeneratorRes)) {
2403
+ queuedDomNodes = Array.prototype.slice.call(customGeneratorRes.domNodes);
2404
+ }
2405
+ else if (!isObject && typeof customGeneratorRes !== 'function') {
2406
+ // primitive value (like string or number)
2407
+ innerContent = customGeneratorRes;
2408
+ }
2409
+ else {
2410
+ // an exotic object for handleCustomRendering
2411
+ currentGeneratorMeta = customGeneratorRes;
2409
2412
  }
2410
2413
  }
2411
2414
  }
@@ -2437,8 +2440,8 @@ var FullCalendar = (function (exports) {
2437
2440
  if (handleCustomRendering) {
2438
2441
  const generatorMeta = (_a = this.currentGeneratorMeta) !== null && _a !== void 0 ? _a : customRenderingMetaMap === null || customRenderingMetaMap === void 0 ? void 0 : customRenderingMetaMap[props.generatorName];
2439
2442
  if (generatorMeta) {
2440
- handleCustomRendering(Object.assign({ id: this.id, isActive, containerEl: this.base, reportNewContainerEl: this.handleEl, // for customRenderingReplacesEl
2441
- generatorMeta }, props));
2443
+ handleCustomRendering(Object.assign(Object.assign({ id: this.id, isActive, containerEl: this.base, reportNewContainerEl: this.handleEl, // for customRenderingReplacesEl
2444
+ generatorMeta }, props), { elClasses: props.elClasses.filter(isTruthy) }));
2442
2445
  }
2443
2446
  }
2444
2447
  }
@@ -2484,6 +2487,9 @@ var FullCalendar = (function (exports) {
2484
2487
  }
2485
2488
  return attrs;
2486
2489
  }
2490
+ function isTruthy(val) {
2491
+ return Boolean(val);
2492
+ }
2487
2493
 
2488
2494
  const RenderId = createContext(0);
2489
2495
 
@@ -8676,6 +8682,7 @@ var FullCalendar = (function (exports) {
8676
8682
  sourceId: unfoundSources[0].sourceId,
8677
8683
  rawEvents: inputs[0],
8678
8684
  });
8685
+ return;
8679
8686
  }
8680
8687
  let newInputs = [];
8681
8688
  for (let input of inputs) {
@@ -9768,7 +9775,7 @@ var FullCalendar = (function (exports) {
9768
9775
  return sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;
9769
9776
  }
9770
9777
 
9771
- const version = '6.1.1';
9778
+ const version = '6.1.4';
9772
9779
 
9773
9780
  config.touchMouseIgnoreWait = 500;
9774
9781
  let ignoreMouseDepth = 0;
@@ -11865,87 +11872,6 @@ var FullCalendar = (function (exports) {
11865
11872
  listenerRefiners: LISTENER_REFINERS,
11866
11873
  });
11867
11874
 
11868
- /* An abstract class for the daygrid views, as well as month view. Renders one or more rows of day cells.
11869
- ----------------------------------------------------------------------------------------------------------------------*/
11870
- // It is a manager for a Table subcomponent, which does most of the heavy lifting.
11871
- // It is responsible for managing width/height.
11872
- class TableView extends DateComponent {
11873
- constructor() {
11874
- super(...arguments);
11875
- this.headerElRef = y();
11876
- }
11877
- renderSimpleLayout(headerRowContent, bodyContent) {
11878
- let { props, context } = this;
11879
- let sections = [];
11880
- let stickyHeaderDates = getStickyHeaderDates(context.options);
11881
- if (headerRowContent) {
11882
- sections.push({
11883
- type: 'header',
11884
- key: 'header',
11885
- isSticky: stickyHeaderDates,
11886
- chunk: {
11887
- elRef: this.headerElRef,
11888
- tableClassName: 'fc-col-header',
11889
- rowContent: headerRowContent,
11890
- },
11891
- });
11892
- }
11893
- sections.push({
11894
- type: 'body',
11895
- key: 'body',
11896
- liquid: true,
11897
- chunk: { content: bodyContent },
11898
- });
11899
- return (h(ViewContainer, { elClasses: ['fc-daygrid'], viewSpec: context.viewSpec },
11900
- h(SimpleScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, cols: [] /* TODO: make optional? */, sections: sections })));
11901
- }
11902
- renderHScrollLayout(headerRowContent, bodyContent, colCnt, dayMinWidth) {
11903
- let ScrollGrid = this.context.pluginHooks.scrollGridImpl;
11904
- if (!ScrollGrid) {
11905
- throw new Error('No ScrollGrid implementation');
11906
- }
11907
- let { props, context } = this;
11908
- let stickyHeaderDates = !props.forPrint && getStickyHeaderDates(context.options);
11909
- let stickyFooterScrollbar = !props.forPrint && getStickyFooterScrollbar(context.options);
11910
- let sections = [];
11911
- if (headerRowContent) {
11912
- sections.push({
11913
- type: 'header',
11914
- key: 'header',
11915
- isSticky: stickyHeaderDates,
11916
- chunks: [{
11917
- key: 'main',
11918
- elRef: this.headerElRef,
11919
- tableClassName: 'fc-col-header',
11920
- rowContent: headerRowContent,
11921
- }],
11922
- });
11923
- }
11924
- sections.push({
11925
- type: 'body',
11926
- key: 'body',
11927
- liquid: true,
11928
- chunks: [{
11929
- key: 'main',
11930
- content: bodyContent,
11931
- }],
11932
- });
11933
- if (stickyFooterScrollbar) {
11934
- sections.push({
11935
- type: 'footer',
11936
- key: 'footer',
11937
- isSticky: true,
11938
- chunks: [{
11939
- key: 'main',
11940
- content: renderScrollShim,
11941
- }],
11942
- });
11943
- }
11944
- return (h(ViewContainer, { elClasses: ['fc-daygrid'], viewSpec: context.viewSpec },
11945
- h(ScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, colGroups: [{ cols: [{ span: colCnt, minWidth: dayMinWidth }] }], sections: sections })));
11946
- }
11947
- }
11948
-
11949
11875
  function splitSegsByRow(segs, rowCnt) {
11950
11876
  let byRow = [];
11951
11877
  for (let i = 0; i < rowCnt; i += 1) {
@@ -12076,12 +12002,11 @@ var FullCalendar = (function (exports) {
12076
12002
  }
12077
12003
  render() {
12078
12004
  let { context, props, state, rootElRef } = this;
12079
- let { options } = context;
12005
+ let { options, dateEnv } = context;
12080
12006
  let { date, dateProfile } = props;
12081
12007
  // TODO: memoize this?
12082
- let isMonthStart = props.showDayNumber &&
12083
- dateProfile.currentRangeUnit !== 'month' && (dateProfile.currentRange.start.valueOf() === date.valueOf() ||
12084
- date.getUTCDate() === 1);
12008
+ const isMonthStart = props.showDayNumber &&
12009
+ shouldDisplayMonthStart(date, dateProfile.currentRange, dateEnv);
12085
12010
  return (h(DayCellContainer, { elTag: "td", elRef: this.handleRootEl, elClasses: [
12086
12011
  'fc-daygrid-day',
12087
12012
  ...(props.extraClassNames || []),
@@ -12106,6 +12031,21 @@ var FullCalendar = (function (exports) {
12106
12031
  function renderTopInner(props) {
12107
12032
  return props.dayNumberText || h(p, null, "\u00A0");
12108
12033
  }
12034
+ function shouldDisplayMonthStart(date, currentRange, dateEnv) {
12035
+ const { start: currentStart, end: currentEnd } = currentRange;
12036
+ const currentEndIncl = addMs(currentEnd, -1);
12037
+ const currentFirstYear = dateEnv.getYear(currentStart);
12038
+ const currentFirstMonth = dateEnv.getMonth(currentStart);
12039
+ const currentLastYear = dateEnv.getYear(currentEndIncl);
12040
+ const currentLastMonth = dateEnv.getMonth(currentEndIncl);
12041
+ // spans more than one month?
12042
+ return !(currentFirstYear === currentLastYear && currentFirstMonth === currentLastMonth) &&
12043
+ Boolean(
12044
+ // first date in current view?
12045
+ date.valueOf() === currentStart.valueOf() ||
12046
+ // a month-start that's within the current range?
12047
+ (dateEnv.getDay(date) === 1 && date.valueOf() < currentEnd.valueOf()));
12048
+ }
12109
12049
 
12110
12050
  function computeFgSegPlacement(segs, // assumed already sorted
12111
12051
  dayMaxEvents, dayMaxEventRows, strictOrder, eventInstanceHeights, maxContentHeight, cells) {
@@ -12742,30 +12682,6 @@ var FullCalendar = (function (exports) {
12742
12682
  }
12743
12683
  }
12744
12684
 
12745
- class DayTableView extends TableView {
12746
- constructor() {
12747
- super(...arguments);
12748
- this.buildDayTableModel = memoize(buildDayTableModel);
12749
- this.headerRef = y();
12750
- this.tableRef = y();
12751
- // can't override any lifecycle methods from parent
12752
- }
12753
- render() {
12754
- let { options, dateProfileGenerator } = this.context;
12755
- let { props } = this;
12756
- let dayTableModel = this.buildDayTableModel(props.dateProfile, dateProfileGenerator);
12757
- let headerContent = options.dayHeaders && (h(DayHeader, { ref: this.headerRef, dateProfile: props.dateProfile, dates: dayTableModel.headerDates, datesRepDistinctDays: dayTableModel.rowCnt === 1 }));
12758
- let bodyContent = (contentArg) => (h(DayTable, { ref: this.tableRef, dateProfile: props.dateProfile, dayTableModel: dayTableModel, businessHours: props.businessHours, dateSelection: props.dateSelection, eventStore: props.eventStore, eventUiBases: props.eventUiBases, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, nextDayThreshold: options.nextDayThreshold, colGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, dayMaxEvents: options.dayMaxEvents, dayMaxEventRows: options.dayMaxEventRows, showWeekNumbers: options.weekNumbers, expandRows: !props.isHeightAuto, headerAlignElRef: this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint }));
12759
- return options.dayMinWidth
12760
- ? this.renderHScrollLayout(headerContent, bodyContent, dayTableModel.colCnt, options.dayMinWidth)
12761
- : this.renderSimpleLayout(headerContent, bodyContent);
12762
- }
12763
- }
12764
- function buildDayTableModel(dateProfile, dateProfileGenerator) {
12765
- let daySeries = new DaySeriesModel(dateProfile.renderRange, dateProfileGenerator);
12766
- return new DayTableModel(daySeries, /year|month|week/.test(dateProfile.currentRangeUnit));
12767
- }
12768
-
12769
12685
  class TableDateProfileGenerator extends DateProfileGenerator {
12770
12686
  // Computes the date range that will be rendered
12771
12687
  buildRenderRange(currentRange, currentRangeUnit, isRangeAllDay) {
@@ -12804,6 +12720,111 @@ var FullCalendar = (function (exports) {
12804
12720
  return { start, end };
12805
12721
  }
12806
12722
 
12723
+ /* An abstract class for the daygrid views, as well as month view. Renders one or more rows of day cells.
12724
+ ----------------------------------------------------------------------------------------------------------------------*/
12725
+ // It is a manager for a Table subcomponent, which does most of the heavy lifting.
12726
+ // It is responsible for managing width/height.
12727
+ class TableView extends DateComponent {
12728
+ constructor() {
12729
+ super(...arguments);
12730
+ this.headerElRef = y();
12731
+ }
12732
+ renderSimpleLayout(headerRowContent, bodyContent) {
12733
+ let { props, context } = this;
12734
+ let sections = [];
12735
+ let stickyHeaderDates = getStickyHeaderDates(context.options);
12736
+ if (headerRowContent) {
12737
+ sections.push({
12738
+ type: 'header',
12739
+ key: 'header',
12740
+ isSticky: stickyHeaderDates,
12741
+ chunk: {
12742
+ elRef: this.headerElRef,
12743
+ tableClassName: 'fc-col-header',
12744
+ rowContent: headerRowContent,
12745
+ },
12746
+ });
12747
+ }
12748
+ sections.push({
12749
+ type: 'body',
12750
+ key: 'body',
12751
+ liquid: true,
12752
+ chunk: { content: bodyContent },
12753
+ });
12754
+ return (h(ViewContainer, { elClasses: ['fc-daygrid'], viewSpec: context.viewSpec },
12755
+ h(SimpleScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, cols: [] /* TODO: make optional? */, sections: sections })));
12756
+ }
12757
+ renderHScrollLayout(headerRowContent, bodyContent, colCnt, dayMinWidth) {
12758
+ let ScrollGrid = this.context.pluginHooks.scrollGridImpl;
12759
+ if (!ScrollGrid) {
12760
+ throw new Error('No ScrollGrid implementation');
12761
+ }
12762
+ let { props, context } = this;
12763
+ let stickyHeaderDates = !props.forPrint && getStickyHeaderDates(context.options);
12764
+ let stickyFooterScrollbar = !props.forPrint && getStickyFooterScrollbar(context.options);
12765
+ let sections = [];
12766
+ if (headerRowContent) {
12767
+ sections.push({
12768
+ type: 'header',
12769
+ key: 'header',
12770
+ isSticky: stickyHeaderDates,
12771
+ chunks: [{
12772
+ key: 'main',
12773
+ elRef: this.headerElRef,
12774
+ tableClassName: 'fc-col-header',
12775
+ rowContent: headerRowContent,
12776
+ }],
12777
+ });
12778
+ }
12779
+ sections.push({
12780
+ type: 'body',
12781
+ key: 'body',
12782
+ liquid: true,
12783
+ chunks: [{
12784
+ key: 'main',
12785
+ content: bodyContent,
12786
+ }],
12787
+ });
12788
+ if (stickyFooterScrollbar) {
12789
+ sections.push({
12790
+ type: 'footer',
12791
+ key: 'footer',
12792
+ isSticky: true,
12793
+ chunks: [{
12794
+ key: 'main',
12795
+ content: renderScrollShim,
12796
+ }],
12797
+ });
12798
+ }
12799
+ return (h(ViewContainer, { elClasses: ['fc-daygrid'], viewSpec: context.viewSpec },
12800
+ h(ScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, colGroups: [{ cols: [{ span: colCnt, minWidth: dayMinWidth }] }], sections: sections })));
12801
+ }
12802
+ }
12803
+
12804
+ class DayTableView extends TableView {
12805
+ constructor() {
12806
+ super(...arguments);
12807
+ this.buildDayTableModel = memoize(buildDayTableModel);
12808
+ this.headerRef = y();
12809
+ this.tableRef = y();
12810
+ // can't override any lifecycle methods from parent
12811
+ }
12812
+ render() {
12813
+ let { options, dateProfileGenerator } = this.context;
12814
+ let { props } = this;
12815
+ let dayTableModel = this.buildDayTableModel(props.dateProfile, dateProfileGenerator);
12816
+ let headerContent = options.dayHeaders && (h(DayHeader, { ref: this.headerRef, dateProfile: props.dateProfile, dates: dayTableModel.headerDates, datesRepDistinctDays: dayTableModel.rowCnt === 1 }));
12817
+ let bodyContent = (contentArg) => (h(DayTable, { ref: this.tableRef, dateProfile: props.dateProfile, dayTableModel: dayTableModel, businessHours: props.businessHours, dateSelection: props.dateSelection, eventStore: props.eventStore, eventUiBases: props.eventUiBases, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, nextDayThreshold: options.nextDayThreshold, colGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, dayMaxEvents: options.dayMaxEvents, dayMaxEventRows: options.dayMaxEventRows, showWeekNumbers: options.weekNumbers, expandRows: !props.isHeightAuto, headerAlignElRef: this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint }));
12818
+ return options.dayMinWidth
12819
+ ? this.renderHScrollLayout(headerContent, bodyContent, dayTableModel.colCnt, options.dayMinWidth)
12820
+ : this.renderSimpleLayout(headerContent, bodyContent);
12821
+ }
12822
+ }
12823
+ function buildDayTableModel(dateProfile, dateProfileGenerator) {
12824
+ let daySeries = new DaySeriesModel(dateProfile.renderRange, dateProfileGenerator);
12825
+ return new DayTableModel(daySeries, /year|month|week/.test(dateProfile.currentRangeUnit));
12826
+ }
12827
+
12807
12828
  var css_248z$3 = ":root{--fc-daygrid-event-dot-width:8px}.fc-daygrid-day-events:after,.fc-daygrid-day-events:before,.fc-daygrid-day-frame:after,.fc-daygrid-day-frame:before,.fc-daygrid-event-harness:after,.fc-daygrid-event-harness:before{clear:both;content:\"\";display:table}.fc .fc-daygrid-body{position:relative;z-index:1}.fc .fc-daygrid-day.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-daygrid-day-frame{min-height:100%;position:relative}.fc .fc-daygrid-day-top{display:flex;flex-direction:row-reverse}.fc .fc-day-other .fc-daygrid-day-top{opacity:.3}.fc .fc-daygrid-day-number{padding:4px;position:relative;z-index:4}.fc .fc-daygrid-month-start{font-size:1.1em;font-weight:700}.fc .fc-daygrid-day-events{margin-top:1px}.fc .fc-daygrid-body-balanced .fc-daygrid-day-events{left:0;position:absolute;right:0}.fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events{min-height:2em;position:relative}.fc .fc-daygrid-body-natural .fc-daygrid-day-events{margin-bottom:1em}.fc .fc-daygrid-event-harness{position:relative}.fc .fc-daygrid-event-harness-abs{left:0;position:absolute;right:0;top:0}.fc .fc-daygrid-bg-harness{bottom:0;position:absolute;top:0}.fc .fc-daygrid-day-bg .fc-non-business{z-index:1}.fc .fc-daygrid-day-bg .fc-bg-event{z-index:2}.fc .fc-daygrid-day-bg .fc-highlight{z-index:3}.fc .fc-daygrid-event{margin-top:1px;z-index:6}.fc .fc-daygrid-event.fc-event-mirror{z-index:7}.fc .fc-daygrid-day-bottom{font-size:.85em;margin:0 2px}.fc .fc-daygrid-day-bottom:after,.fc .fc-daygrid-day-bottom:before{clear:both;content:\"\";display:table}.fc .fc-daygrid-more-link{border-radius:3px;cursor:pointer;line-height:1;margin-top:1px;max-width:100%;overflow:hidden;padding:2px;position:relative;white-space:nowrap;z-index:4}.fc .fc-daygrid-more-link:hover{background-color:rgba(0,0,0,.1)}.fc .fc-daygrid-week-number{background-color:var(--fc-neutral-bg-color);color:var(--fc-neutral-text-color);min-width:1.5em;padding:2px;position:absolute;text-align:center;top:0;z-index:5}.fc .fc-more-popover .fc-popover-body{min-width:220px;padding:10px}.fc-direction-ltr .fc-daygrid-event.fc-event-start,.fc-direction-rtl .fc-daygrid-event.fc-event-end{margin-left:2px}.fc-direction-ltr .fc-daygrid-event.fc-event-end,.fc-direction-rtl .fc-daygrid-event.fc-event-start{margin-right:2px}.fc-direction-ltr .fc-daygrid-more-link{float:left}.fc-direction-ltr .fc-daygrid-week-number{border-radius:0 0 3px 0;left:0}.fc-direction-rtl .fc-daygrid-more-link{float:right}.fc-direction-rtl .fc-daygrid-week-number{border-radius:0 0 0 3px;right:0}.fc-liquid-hack .fc-daygrid-day-frame{position:static}.fc-daygrid-event{border-radius:3px;font-size:var(--fc-small-font-size);position:relative;white-space:nowrap}.fc-daygrid-block-event .fc-event-time{font-weight:700}.fc-daygrid-block-event .fc-event-time,.fc-daygrid-block-event .fc-event-title{padding:1px}.fc-daygrid-dot-event{align-items:center;display:flex;padding:2px 0}.fc-daygrid-dot-event .fc-event-title{flex-grow:1;flex-shrink:1;font-weight:700;min-width:0;overflow:hidden}.fc-daygrid-dot-event.fc-event-mirror,.fc-daygrid-dot-event:hover{background:rgba(0,0,0,.1)}.fc-daygrid-dot-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-daygrid-event-dot{border:calc(var(--fc-daygrid-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-daygrid-event-dot-width)/2);box-sizing:content-box;height:0;margin:0 4px;width:0}.fc-direction-ltr .fc-daygrid-event .fc-event-time{margin-right:3px}.fc-direction-rtl .fc-daygrid-event .fc-event-time{margin-left:3px}";
12808
12829
  injectStyles(css_248z$3);
12809
12830