UNPKG

fullcalendar

Version:

FullCalendar Vanilla JS package for rendering a calendar

102 lines (96 loc) 5.3 kB
export { DateEnv, addDays, addMs, asCleanDays, asRoughMinutes, asRoughMs, asRoughSeconds, createDuration, diffDayAndTime, diffWholeDays, diffWholeWeeks, formatDayString, greatestDurationDenominator, intersectRanges, isInt, isValidDate, multiplyDuration, padStart, parseMarker, rangeContainsMarker, rangesEqual, rangesIntersect, startOfDay, wholeDivideDurations } from '@full-ui/headless-calendar'; import 'preact'; export { u as EventImpl, ah as buildEventRangeKey, af as combineEventUis, ai as compareByFieldSpecs, J as computeViewBorderless, T as computeVisibleDayRange, c as createEventUi, e as createFormatter, f as filterHash, aj as flexibleCompare, aa as getEventKey, ab as getEventRangeMeta, g as guid, i as identity, H as isArraysEqual, I as isPropsEqualShallow, n as mapHash, Y as mergeEventStores, ak as parseFieldSpecs, Q as refineClassName, al as refineClassNameGenerator, r as refineProps, am as removeExact, a9 as sortEventSegs, w as warn } from './chunks/2add5508.js'; export { C as CalendarApiImpl, d as CalendarDataManager, b as CalendarInner, a as CalendarMediaRoot, c as computeRootClassName, p as parseBusinessHours } from './chunks/29a5fccb.js'; export { B as BaseComponent, C as ContentContainer, e as DateComponent, D as DelayedRunner, d as NowTimer, R as RenderId, S as Scroller, j as StandardEvent, f as ViewContainer, o as afterSize, n as buildNavLinkAttrs, g as generateClassName, h as getDateMeta, x as getFooterScrollbarSticky, c as getIsHeightAuto, v as getTableHeaderSticky, m as memoize, a as memoizeObjArg, s as setRef, w as watchHeight, t as watchSize, p as watchWidth } from './chunks/66c53e04.js'; export { h as computeEdges, e as computeInnerRect, g as getRectCenter } from './chunks/1da0ed53.js'; export { j as joinFuncishClassNames, m as mergeCalendarOptions, c as mergeContentInjectors, d as mergeLifecycleCallbacks, a as mergeViewOptionsMap } from './chunks/f0fa24ec.js'; export { E as Emitter, a as applyStyleProp, c as computeElIsRtl } from './chunks/56f74c4a.js'; export { A as AllDaySplitter, D as DayTimeColsSlicer, N as NowIndicatorDot, c as NowIndicatorHeaderContainer, d as NowIndicatorLineContainer, S as Splitter, T as TimeGridLayout, a as buildDayRanges, b as buildTimeColsModel, o as organizeSegsByCol, s as splitInteractionByCol } from './chunks/b657da56.js'; export { e as requestJson, u as unpromisify } from './chunks/23b3908a.js'; export { D as DateProfileGenerator, c as computeMajorUnit, i as isMajorUnit } from './chunks/ad0c00be.js'; export { B as BgEvent, l as DayTableModel, D as DayTableSlicer, M as MoreLinkContainer, e as RefMap, R as Ruler, p as SegHierarchy, S as Slicer, u as buildDateDataConfigs, v as buildDateRenderConfig, d as buildDateRowConfig, b as buildDayTableModel, c as createDayHeaderFormatter, q as groupIntersectingSegs, r as renderFill } from './chunks/515d1f26.js'; export { E as ElementDragging, c as config, b as isPropsValid } from './chunks/e2d9e59e.js'; export { D as DayGridLayout, F as FooterScrollbar } from './chunks/e48b8fd8.js'; function debounce(fn, ms) { let timeoutStarted; let timeoutAdded; let timeoutId; // thruthiness indicates whether active timeout function runWithTimeout(timeout) { timeoutStarted = Date.now(); timeoutAdded = 0; timeoutId = setTimeout(() => { if (timeoutAdded) { runWithTimeout(timeoutAdded); } else { timeoutId = undefined; fn(); } }, timeout); } function request() { if (timeoutId) { timeoutAdded = Date.now() - timeoutStarted; } else { runWithTimeout(ms); } } function cancel() { if (timeoutId) { clearTimeout(timeoutId); timeoutId = undefined; } } return [request, cancel]; } class Store { constructor() { this.handlers = []; } set(value) { this.currentValue = value; for (let handler of this.handlers) { handler(value); } } subscribe(handler) { this.handlers.push(handler); if (this.currentValue !== undefined) { handler(this.currentValue); } } } /* Subscribers will get a LIST of CustomRenderings */ class CustomRenderingStore extends Store { constructor() { super(...arguments); this.map = new Map(); } // for consistent order handle(customRendering) { const { map } = this; let updated = false; if (customRendering.isActive) { map.set(customRendering.id, customRendering); updated = true; } else if (map.has(customRendering.id)) { map.delete(customRendering.id); updated = true; } if (updated) { this.set(map); } } } // StrictMode always OFF const strictModeFactor = 1; // Sometime between Preact 10.23.1 -> 10.29.0, updating an option that affects events (like timeZone) // results in unnecessary component render() calls. Seems like the options (context) is committed // to the VDOM at a different phase than the events (props) const vdomExtraRenders = 2; export { CustomRenderingStore, debounce, strictModeFactor, vdomExtraRenders };