@fullcalendar/core 6.1.15 → 7.0.0-beta.1
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.cjs +48 -110
- package/index.d.ts +2 -1
- package/index.global.js +1558 -1794
- package/index.global.min.js +2 -2
- package/index.js +51 -113
- package/internal-common.cjs +1919 -2093
- package/internal-common.d.ts +176 -288
- package/internal-common.js +1905 -2073
- package/internal.cjs +16 -22
- package/internal.d.ts +2 -1
- package/internal.js +1 -1
- package/locales/af.global.js +1 -1
- package/locales/af.global.min.js +1 -1
- package/locales/ar-dz.global.js +1 -1
- package/locales/ar-dz.global.min.js +1 -1
- package/locales/ar-kw.global.js +1 -1
- package/locales/ar-kw.global.min.js +1 -1
- package/locales/ar-ly.global.js +1 -1
- package/locales/ar-ly.global.min.js +1 -1
- package/locales/ar-ma.global.js +1 -1
- package/locales/ar-ma.global.min.js +1 -1
- package/locales/ar-sa.global.js +1 -1
- package/locales/ar-sa.global.min.js +1 -1
- package/locales/ar-tn.global.js +1 -1
- package/locales/ar-tn.global.min.js +1 -1
- package/locales/ar.global.js +1 -1
- package/locales/ar.global.min.js +1 -1
- package/locales/az.global.js +1 -1
- package/locales/az.global.min.js +1 -1
- package/locales/bg.global.js +1 -1
- package/locales/bg.global.min.js +1 -1
- package/locales/bn.global.js +1 -1
- package/locales/bn.global.min.js +1 -1
- package/locales/bs.global.js +1 -1
- package/locales/bs.global.min.js +1 -1
- package/locales/ca.global.js +1 -1
- package/locales/ca.global.min.js +1 -1
- package/locales/cs.global.js +1 -1
- package/locales/cs.global.min.js +1 -1
- package/locales/cy.global.js +1 -1
- package/locales/cy.global.min.js +1 -1
- package/locales/da.global.js +1 -1
- package/locales/da.global.min.js +1 -1
- package/locales/de-at.global.js +1 -1
- package/locales/de-at.global.min.js +1 -1
- package/locales/de.global.js +1 -1
- package/locales/de.global.min.js +1 -1
- package/locales/el.global.js +1 -1
- package/locales/el.global.min.js +1 -1
- package/locales/en-au.global.js +1 -1
- package/locales/en-au.global.min.js +1 -1
- package/locales/en-gb.global.js +1 -1
- package/locales/en-gb.global.min.js +1 -1
- package/locales/en-nz.global.js +1 -1
- package/locales/en-nz.global.min.js +1 -1
- package/locales/eo.global.js +1 -1
- package/locales/eo.global.min.js +1 -1
- package/locales/es-us.global.js +1 -1
- package/locales/es-us.global.min.js +1 -1
- package/locales/es.global.js +1 -1
- package/locales/es.global.min.js +1 -1
- package/locales/et.global.js +1 -1
- package/locales/et.global.min.js +1 -1
- package/locales/eu.global.js +1 -1
- package/locales/eu.global.min.js +1 -1
- package/locales/fa.global.js +1 -1
- package/locales/fa.global.min.js +1 -1
- package/locales/fi.global.js +1 -1
- package/locales/fi.global.min.js +1 -1
- package/locales/fr-ca.global.js +1 -1
- package/locales/fr-ca.global.min.js +1 -1
- package/locales/fr-ch.global.js +1 -1
- package/locales/fr-ch.global.min.js +1 -1
- package/locales/fr.global.js +1 -1
- package/locales/fr.global.min.js +1 -1
- package/locales/gl.global.js +1 -1
- package/locales/gl.global.min.js +1 -1
- package/locales/he.global.js +1 -1
- package/locales/he.global.min.js +1 -1
- package/locales/hi.global.js +1 -1
- package/locales/hi.global.min.js +1 -1
- package/locales/hr.global.js +1 -1
- package/locales/hr.global.min.js +1 -1
- package/locales/hu.global.js +1 -1
- package/locales/hu.global.min.js +1 -1
- package/locales/hy-am.global.js +1 -1
- package/locales/hy-am.global.min.js +1 -1
- package/locales/id.global.js +1 -1
- package/locales/id.global.min.js +1 -1
- package/locales/is.global.js +1 -1
- package/locales/is.global.min.js +1 -1
- package/locales/it.global.js +1 -1
- package/locales/it.global.min.js +1 -1
- package/locales/ja.global.js +1 -1
- package/locales/ja.global.min.js +1 -1
- package/locales/ka.global.js +1 -1
- package/locales/ka.global.min.js +1 -1
- package/locales/kk.global.js +1 -1
- package/locales/kk.global.min.js +1 -1
- package/locales/km.global.js +1 -1
- package/locales/km.global.min.js +1 -1
- package/locales/ko.global.js +1 -1
- package/locales/ko.global.min.js +1 -1
- package/locales/ku.global.js +1 -1
- package/locales/ku.global.min.js +1 -1
- package/locales/lb.global.js +1 -1
- package/locales/lb.global.min.js +1 -1
- package/locales/lt.global.js +1 -1
- package/locales/lt.global.min.js +1 -1
- package/locales/lv.global.js +1 -1
- package/locales/lv.global.min.js +1 -1
- package/locales/mk.global.js +1 -1
- package/locales/mk.global.min.js +1 -1
- package/locales/ms.global.js +1 -1
- package/locales/ms.global.min.js +1 -1
- package/locales/nb.global.js +1 -1
- package/locales/nb.global.min.js +1 -1
- package/locales/ne.global.js +1 -1
- package/locales/ne.global.min.js +1 -1
- package/locales/nl.global.js +1 -1
- package/locales/nl.global.min.js +1 -1
- package/locales/nn.global.js +1 -1
- package/locales/nn.global.min.js +1 -1
- package/locales/pl.global.js +1 -1
- package/locales/pl.global.min.js +1 -1
- package/locales/pt-br.global.js +1 -1
- package/locales/pt-br.global.min.js +1 -1
- package/locales/pt.global.js +1 -1
- package/locales/pt.global.min.js +1 -1
- package/locales/ro.global.js +1 -1
- package/locales/ro.global.min.js +1 -1
- package/locales/ru.global.js +1 -1
- package/locales/ru.global.min.js +1 -1
- package/locales/si-lk.global.js +1 -1
- package/locales/si-lk.global.min.js +1 -1
- package/locales/sk.global.js +1 -1
- package/locales/sk.global.min.js +1 -1
- package/locales/sl.global.js +1 -1
- package/locales/sl.global.min.js +1 -1
- package/locales/sm.global.js +1 -1
- package/locales/sm.global.min.js +1 -1
- package/locales/sq.global.js +1 -1
- package/locales/sq.global.min.js +1 -1
- package/locales/sr-cyrl.global.js +1 -1
- package/locales/sr-cyrl.global.min.js +1 -1
- package/locales/sr.global.js +1 -1
- package/locales/sr.global.min.js +1 -1
- package/locales/sv.global.js +1 -1
- package/locales/sv.global.min.js +1 -1
- package/locales/ta-in.global.js +1 -1
- package/locales/ta-in.global.min.js +1 -1
- package/locales/th.global.js +1 -1
- package/locales/th.global.min.js +1 -1
- package/locales/tr.global.js +1 -1
- package/locales/tr.global.min.js +1 -1
- package/locales/ug.global.js +1 -1
- package/locales/ug.global.min.js +1 -1
- package/locales/uk.global.js +1 -1
- package/locales/uk.global.min.js +1 -1
- package/locales/uz-cy.global.js +1 -1
- package/locales/uz-cy.global.min.js +1 -1
- package/locales/uz.global.js +1 -1
- package/locales/uz.global.min.js +1 -1
- package/locales/vi.global.js +1 -1
- package/locales/vi.global.min.js +1 -1
- package/locales/zh-cn.global.js +1 -1
- package/locales/zh-cn.global.min.js +1 -1
- package/locales/zh-tw.global.js +1 -1
- package/locales/zh-tw.global.min.js +1 -1
- package/locales-all.global.js +1 -1
- package/locales-all.global.min.js +1 -1
- package/package.json +2 -2
- package/preact.d.ts +6 -0
- package/preact.js +1 -1
package/index.cjs
CHANGED
|
@@ -136,7 +136,7 @@ function createPlugin(input) {
|
|
|
136
136
|
initialView: input.initialView || '',
|
|
137
137
|
elementDraggingImpl: input.elementDraggingImpl,
|
|
138
138
|
optionChangeHandlers: input.optionChangeHandlers || {},
|
|
139
|
-
|
|
139
|
+
scrollerSyncerClass: input.scrollerSyncerClass || null,
|
|
140
140
|
listenerRefiners: input.listenerRefiners || {},
|
|
141
141
|
optionRefiners: input.optionRefiners || {},
|
|
142
142
|
propSetHandlers: input.propSetHandlers || {},
|
|
@@ -174,7 +174,7 @@ function buildPluginHooks(pluginDefs, globalDefs) {
|
|
|
174
174
|
initialView: '',
|
|
175
175
|
elementDraggingImpl: null,
|
|
176
176
|
optionChangeHandlers: {},
|
|
177
|
-
|
|
177
|
+
scrollerSyncerClass: null,
|
|
178
178
|
listenerRefiners: {},
|
|
179
179
|
optionRefiners: {},
|
|
180
180
|
propSetHandlers: {},
|
|
@@ -244,7 +244,7 @@ function combineHooks(hooks0, hooks1) {
|
|
|
244
244
|
initialView: hooks0.initialView || hooks1.initialView,
|
|
245
245
|
elementDraggingImpl: hooks0.elementDraggingImpl || hooks1.elementDraggingImpl,
|
|
246
246
|
optionChangeHandlers: Object.assign(Object.assign({}, hooks0.optionChangeHandlers), hooks1.optionChangeHandlers),
|
|
247
|
-
|
|
247
|
+
scrollerSyncerClass: hooks0.scrollerSyncerClass || hooks1.scrollerSyncerClass,
|
|
248
248
|
listenerRefiners: Object.assign(Object.assign({}, hooks0.listenerRefiners), hooks1.listenerRefiners),
|
|
249
249
|
optionRefiners: Object.assign(Object.assign({}, hooks0.optionRefiners), hooks1.optionRefiners),
|
|
250
250
|
propSetHandlers: Object.assign(Object.assign({}, hooks0.propSetHandlers), hooks1.propSetHandlers),
|
|
@@ -264,7 +264,6 @@ class StandardTheme extends internalCommon.Theme {
|
|
|
264
264
|
}
|
|
265
265
|
StandardTheme.prototype.classes = {
|
|
266
266
|
root: 'fc-theme-standard',
|
|
267
|
-
tableCellShaded: 'fc-cell-shaded',
|
|
268
267
|
buttonGroup: 'fc-button-group',
|
|
269
268
|
button: 'fc-button fc-button-primary',
|
|
270
269
|
buttonActive: 'fc-button-active',
|
|
@@ -1627,7 +1626,9 @@ function warnUnknownOptions(options, viewName) {
|
|
|
1627
1626
|
class ToolbarSection extends internalCommon.BaseComponent {
|
|
1628
1627
|
render() {
|
|
1629
1628
|
let children = this.props.widgetGroups.map((widgetGroup) => this.renderWidgetGroup(widgetGroup));
|
|
1630
|
-
return preact.createElement('div', {
|
|
1629
|
+
return preact.createElement('div', {
|
|
1630
|
+
className: 'fc-toolbar-chunk fc-toolbar-' + this.props.name
|
|
1631
|
+
}, ...children);
|
|
1631
1632
|
}
|
|
1632
1633
|
renderWidgetGroup(widgetGroup) {
|
|
1633
1634
|
let { props } = this;
|
|
@@ -1638,7 +1639,7 @@ class ToolbarSection extends internalCommon.BaseComponent {
|
|
|
1638
1639
|
let { buttonName, buttonClick, buttonText, buttonIcon, buttonHint } = widget;
|
|
1639
1640
|
if (buttonName === 'title') {
|
|
1640
1641
|
isOnlyButtons = false;
|
|
1641
|
-
children.push(preact.createElement("h2", { className: "fc-toolbar-title"
|
|
1642
|
+
children.push(preact.createElement("h2", { className: "fc-toolbar-title" }, props.title));
|
|
1642
1643
|
}
|
|
1643
1644
|
else {
|
|
1644
1645
|
let isPressed = buttonName === props.activeButton;
|
|
@@ -1694,65 +1695,7 @@ class Toolbar extends internalCommon.BaseComponent {
|
|
|
1694
1695
|
}
|
|
1695
1696
|
renderSection(key, widgetGroups) {
|
|
1696
1697
|
let { props } = this;
|
|
1697
|
-
return (preact.createElement(ToolbarSection, { key: key, widgetGroups: widgetGroups, title: props.title, navUnit: props.navUnit, activeButton: props.activeButton, isTodayEnabled: props.isTodayEnabled, isPrevEnabled: props.isPrevEnabled, isNextEnabled: props.isNextEnabled
|
|
1698
|
-
}
|
|
1699
|
-
}
|
|
1700
|
-
|
|
1701
|
-
class ViewHarness extends internalCommon.BaseComponent {
|
|
1702
|
-
constructor() {
|
|
1703
|
-
super(...arguments);
|
|
1704
|
-
this.state = {
|
|
1705
|
-
availableWidth: null,
|
|
1706
|
-
};
|
|
1707
|
-
this.handleEl = (el) => {
|
|
1708
|
-
this.el = el;
|
|
1709
|
-
internalCommon.setRef(this.props.elRef, el);
|
|
1710
|
-
this.updateAvailableWidth();
|
|
1711
|
-
};
|
|
1712
|
-
this.handleResize = () => {
|
|
1713
|
-
this.updateAvailableWidth();
|
|
1714
|
-
};
|
|
1715
|
-
}
|
|
1716
|
-
render() {
|
|
1717
|
-
let { props, state } = this;
|
|
1718
|
-
let { aspectRatio } = props;
|
|
1719
|
-
let classNames = [
|
|
1720
|
-
'fc-view-harness',
|
|
1721
|
-
(aspectRatio || props.liquid || props.height)
|
|
1722
|
-
? 'fc-view-harness-active' // harness controls the height
|
|
1723
|
-
: 'fc-view-harness-passive', // let the view do the height
|
|
1724
|
-
];
|
|
1725
|
-
let height = '';
|
|
1726
|
-
let paddingBottom = '';
|
|
1727
|
-
if (aspectRatio) {
|
|
1728
|
-
if (state.availableWidth !== null) {
|
|
1729
|
-
height = state.availableWidth / aspectRatio;
|
|
1730
|
-
}
|
|
1731
|
-
else {
|
|
1732
|
-
// while waiting to know availableWidth, we can't set height to *zero*
|
|
1733
|
-
// because will cause lots of unnecessary scrollbars within scrollgrid.
|
|
1734
|
-
// BETTER: don't start rendering ANYTHING yet until we know container width
|
|
1735
|
-
// NOTE: why not always use paddingBottom? Causes height oscillation (issue 5606)
|
|
1736
|
-
paddingBottom = `${(1 / aspectRatio) * 100}%`;
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
else {
|
|
1740
|
-
height = props.height || '';
|
|
1741
|
-
}
|
|
1742
|
-
return (preact.createElement("div", { "aria-labelledby": props.labeledById, ref: this.handleEl, className: classNames.join(' '), style: { height, paddingBottom } }, props.children));
|
|
1743
|
-
}
|
|
1744
|
-
componentDidMount() {
|
|
1745
|
-
this.context.addResizeHandler(this.handleResize);
|
|
1746
|
-
}
|
|
1747
|
-
componentWillUnmount() {
|
|
1748
|
-
this.context.removeResizeHandler(this.handleResize);
|
|
1749
|
-
}
|
|
1750
|
-
updateAvailableWidth() {
|
|
1751
|
-
if (this.el && // needed. but why?
|
|
1752
|
-
this.props.aspectRatio // aspectRatio is the only height setting that needs availableWidth
|
|
1753
|
-
) {
|
|
1754
|
-
this.setState({ availableWidth: this.el.offsetWidth });
|
|
1755
|
-
}
|
|
1698
|
+
return (preact.createElement(ToolbarSection, { key: key, name: key, widgetGroups: widgetGroups, title: props.title, navUnit: props.navUnit, activeButton: props.activeButton, isTodayEnabled: props.isTodayEnabled, isPrevEnabled: props.isPrevEnabled, isNextEnabled: props.isNextEnabled }));
|
|
1756
1699
|
}
|
|
1757
1700
|
}
|
|
1758
1701
|
|
|
@@ -1765,8 +1708,8 @@ class EventClicking extends internalCommon.Interaction {
|
|
|
1765
1708
|
this.handleSegClick = (ev, segEl) => {
|
|
1766
1709
|
let { component } = this;
|
|
1767
1710
|
let { context } = component;
|
|
1768
|
-
let
|
|
1769
|
-
if (
|
|
1711
|
+
let eventRange = internalCommon.getElEventRange(segEl);
|
|
1712
|
+
if (eventRange && // might be the <div> surrounding the more link
|
|
1770
1713
|
component.isValidSegDownEl(ev.target)) {
|
|
1771
1714
|
// our way to simulate a link click for elements that can't be <a> tags
|
|
1772
1715
|
// grab before trigger fired in case trigger trashes DOM thru rerendering
|
|
@@ -1774,7 +1717,7 @@ class EventClicking extends internalCommon.Interaction {
|
|
|
1774
1717
|
let url = hasUrlContainer ? hasUrlContainer.querySelector('a[href]').href : '';
|
|
1775
1718
|
context.emitter.trigger('eventClick', {
|
|
1776
1719
|
el: segEl,
|
|
1777
|
-
event: new internalCommon.EventImpl(component.context,
|
|
1720
|
+
event: new internalCommon.EventImpl(component.context, eventRange.def, eventRange.instance),
|
|
1778
1721
|
jsEvent: ev,
|
|
1779
1722
|
view: context.viewApi,
|
|
1780
1723
|
});
|
|
@@ -1802,7 +1745,7 @@ class EventHovering extends internalCommon.Interaction {
|
|
|
1802
1745
|
}
|
|
1803
1746
|
};
|
|
1804
1747
|
this.handleSegEnter = (ev, segEl) => {
|
|
1805
|
-
if (internalCommon.
|
|
1748
|
+
if (internalCommon.getElEventRange(segEl)) { // TODO: better way to make sure not hovering over more+ link or its wrapper
|
|
1806
1749
|
this.currentSegEl = segEl;
|
|
1807
1750
|
this.triggerEvent('eventMouseEnter', ev, segEl);
|
|
1808
1751
|
}
|
|
@@ -1822,11 +1765,11 @@ class EventHovering extends internalCommon.Interaction {
|
|
|
1822
1765
|
triggerEvent(publicEvName, ev, segEl) {
|
|
1823
1766
|
let { component } = this;
|
|
1824
1767
|
let { context } = component;
|
|
1825
|
-
let
|
|
1768
|
+
let eventRange = internalCommon.getElEventRange(segEl);
|
|
1826
1769
|
if (!ev || component.isValidSegDownEl(ev.target)) {
|
|
1827
1770
|
context.emitter.trigger(publicEvName, {
|
|
1828
1771
|
el: segEl,
|
|
1829
|
-
event: new internalCommon.EventImpl(context,
|
|
1772
|
+
event: new internalCommon.EventImpl(context, eventRange.def, eventRange.instance),
|
|
1830
1773
|
jsEvent: ev,
|
|
1831
1774
|
view: context.viewApi,
|
|
1832
1775
|
});
|
|
@@ -1834,19 +1777,34 @@ class EventHovering extends internalCommon.Interaction {
|
|
|
1834
1777
|
}
|
|
1835
1778
|
}
|
|
1836
1779
|
|
|
1780
|
+
class ViewHarness extends preact.Component {
|
|
1781
|
+
render() {
|
|
1782
|
+
const { props } = this;
|
|
1783
|
+
return (preact.createElement("div", { className: [
|
|
1784
|
+
'fc-view-harness',
|
|
1785
|
+
props.height != null
|
|
1786
|
+
? 'fc-view-harness-fixedheight'
|
|
1787
|
+
: props.heightLiquid
|
|
1788
|
+
? 'fc-view-harness-liquid'
|
|
1789
|
+
: props.aspectRatio != null
|
|
1790
|
+
? 'fc-view-harness-aspectratio'
|
|
1791
|
+
: ''
|
|
1792
|
+
].join(' '), style: {
|
|
1793
|
+
height: props.height,
|
|
1794
|
+
paddingBottom: props.aspectRatio != null
|
|
1795
|
+
? `${(1 / props.aspectRatio) * 100}%`
|
|
1796
|
+
: undefined
|
|
1797
|
+
} }, props.children));
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1837
1801
|
class CalendarContent extends internalCommon.PureComponent {
|
|
1838
1802
|
constructor() {
|
|
1839
1803
|
super(...arguments);
|
|
1840
1804
|
this.buildViewContext = internalCommon.memoize(internalCommon.buildViewContext);
|
|
1841
1805
|
this.buildViewPropTransformers = internalCommon.memoize(buildViewPropTransformers);
|
|
1842
1806
|
this.buildToolbarProps = internalCommon.memoize(buildToolbarProps);
|
|
1843
|
-
this.headerRef = preact.createRef();
|
|
1844
|
-
this.footerRef = preact.createRef();
|
|
1845
1807
|
this.interactionsStore = {};
|
|
1846
|
-
// eslint-disable-next-line
|
|
1847
|
-
this.state = {
|
|
1848
|
-
viewLabelId: internalCommon.getUniqueDomId(),
|
|
1849
|
-
};
|
|
1850
1808
|
// Component Registration
|
|
1851
1809
|
// -----------------------------------------------------------------------------------------------------------------
|
|
1852
1810
|
this.registerInteractiveComponent = (component, settingsInput) => {
|
|
@@ -1870,20 +1828,6 @@ class CalendarContent extends internalCommon.PureComponent {
|
|
|
1870
1828
|
}
|
|
1871
1829
|
delete internalCommon.interactionSettingsStore[component.uid];
|
|
1872
1830
|
};
|
|
1873
|
-
// Resizing
|
|
1874
|
-
// -----------------------------------------------------------------------------------------------------------------
|
|
1875
|
-
this.resizeRunner = new internalCommon.DelayedRunner(() => {
|
|
1876
|
-
this.props.emitter.trigger('_resize', true); // should window resizes be considered "forced" ?
|
|
1877
|
-
this.props.emitter.trigger('windowResize', { view: this.props.viewApi });
|
|
1878
|
-
});
|
|
1879
|
-
this.handleWindowResize = (ev) => {
|
|
1880
|
-
let { options } = this.props;
|
|
1881
|
-
if (options.handleWindowResize &&
|
|
1882
|
-
ev.target === window // avoid jqui events
|
|
1883
|
-
) {
|
|
1884
|
-
this.resizeRunner.request(options.windowResizeDelay);
|
|
1885
|
-
}
|
|
1886
|
-
};
|
|
1887
1831
|
}
|
|
1888
1832
|
/*
|
|
1889
1833
|
renders INSIDE of an outer div
|
|
@@ -1893,14 +1837,12 @@ class CalendarContent extends internalCommon.PureComponent {
|
|
|
1893
1837
|
let { toolbarConfig, options } = props;
|
|
1894
1838
|
let toolbarProps = this.buildToolbarProps(props.viewSpec, props.dateProfile, props.dateProfileGenerator, props.currentDate, internalCommon.getNow(props.options.now, props.dateEnv), // TODO: use NowTimer????
|
|
1895
1839
|
props.viewTitle);
|
|
1896
|
-
let
|
|
1897
|
-
let
|
|
1840
|
+
let viewHeight;
|
|
1841
|
+
let viewHeightLiquid = false;
|
|
1898
1842
|
let viewAspectRatio;
|
|
1899
|
-
if (props.
|
|
1900
|
-
viewHeight = '';
|
|
1901
|
-
}
|
|
1843
|
+
if (props.forPrint || internalCommon.getIsHeightAuto(options)) ;
|
|
1902
1844
|
else if (options.height != null) {
|
|
1903
|
-
|
|
1845
|
+
viewHeightLiquid = true;
|
|
1904
1846
|
}
|
|
1905
1847
|
else if (options.contentHeight != null) {
|
|
1906
1848
|
viewHeight = options.contentHeight;
|
|
@@ -1909,21 +1851,17 @@ class CalendarContent extends internalCommon.PureComponent {
|
|
|
1909
1851
|
viewAspectRatio = Math.max(options.aspectRatio, 0.5); // prevent from getting too tall
|
|
1910
1852
|
}
|
|
1911
1853
|
let viewContext = this.buildViewContext(props.viewSpec, props.viewApi, props.options, props.dateProfileGenerator, props.dateEnv, props.theme, props.pluginHooks, props.dispatch, props.getCurrentData, props.emitter, props.calendarApi, this.registerInteractiveComponent, this.unregisterInteractiveComponent);
|
|
1912
|
-
let viewLabelId = (toolbarConfig.header && toolbarConfig.header.hasTitle)
|
|
1913
|
-
? this.state.viewLabelId
|
|
1914
|
-
: undefined;
|
|
1915
1854
|
return (preact.createElement(internalCommon.ViewContextType.Provider, { value: viewContext },
|
|
1916
|
-
toolbarConfig.header && (preact.createElement(Toolbar, Object.assign({
|
|
1917
|
-
preact.createElement(ViewHarness, {
|
|
1855
|
+
toolbarConfig.header && (preact.createElement(Toolbar, Object.assign({ extraClassName: "fc-header-toolbar", model: toolbarConfig.header }, toolbarProps))),
|
|
1856
|
+
preact.createElement(ViewHarness, { height: viewHeight, heightLiquid: viewHeightLiquid, aspectRatio: viewAspectRatio },
|
|
1918
1857
|
this.renderView(props),
|
|
1919
1858
|
this.buildAppendContent()),
|
|
1920
|
-
toolbarConfig.footer && (preact.createElement(Toolbar, Object.assign({
|
|
1859
|
+
toolbarConfig.footer && (preact.createElement(Toolbar, Object.assign({ extraClassName: "fc-footer-toolbar", model: toolbarConfig.footer }, toolbarProps)))));
|
|
1921
1860
|
}
|
|
1922
1861
|
componentDidMount() {
|
|
1923
1862
|
let { props } = this;
|
|
1924
1863
|
this.calendarInteractions = props.pluginHooks.calendarInteractions
|
|
1925
1864
|
.map((CalendarInteractionClass) => new CalendarInteractionClass(props));
|
|
1926
|
-
window.addEventListener('resize', this.handleWindowResize);
|
|
1927
1865
|
let { propSetHandlers } = props.pluginHooks;
|
|
1928
1866
|
for (let propName in propSetHandlers) {
|
|
1929
1867
|
propSetHandlers[propName](props[propName], props);
|
|
@@ -1939,8 +1877,6 @@ class CalendarContent extends internalCommon.PureComponent {
|
|
|
1939
1877
|
}
|
|
1940
1878
|
}
|
|
1941
1879
|
componentWillUnmount() {
|
|
1942
|
-
window.removeEventListener('resize', this.handleWindowResize);
|
|
1943
|
-
this.resizeRunner.clear();
|
|
1944
1880
|
for (let interaction of this.calendarInteractions) {
|
|
1945
1881
|
interaction.destroy();
|
|
1946
1882
|
}
|
|
@@ -1963,7 +1899,6 @@ class CalendarContent extends internalCommon.PureComponent {
|
|
|
1963
1899
|
eventSelection: props.eventSelection,
|
|
1964
1900
|
eventDrag: props.eventDrag,
|
|
1965
1901
|
eventResize: props.eventResize,
|
|
1966
|
-
isHeightAuto: props.isHeightAuto,
|
|
1967
1902
|
forPrint: props.forPrint,
|
|
1968
1903
|
};
|
|
1969
1904
|
let transformers = this.buildViewPropTransformers(pluginHooks.viewPropsTransformers);
|
|
@@ -1994,6 +1929,9 @@ function buildViewPropTransformers(theClasses) {
|
|
|
1994
1929
|
return theClasses.map((TheClass) => new TheClass());
|
|
1995
1930
|
}
|
|
1996
1931
|
|
|
1932
|
+
/*
|
|
1933
|
+
Vanilla JS API
|
|
1934
|
+
*/
|
|
1997
1935
|
class Calendar extends internalCommon.CalendarImpl {
|
|
1998
1936
|
constructor(el, optionOverrides = {}) {
|
|
1999
1937
|
super();
|
|
@@ -2018,11 +1956,11 @@ class Calendar extends internalCommon.CalendarImpl {
|
|
|
2018
1956
|
this.isRendered = true;
|
|
2019
1957
|
let { currentData } = this;
|
|
2020
1958
|
internalCommon.flushSync(() => {
|
|
2021
|
-
preact.render(preact.createElement(internalCommon.CalendarRoot, { options: currentData.calendarOptions, theme: currentData.theme, emitter: currentData.emitter }, (classNames, height,
|
|
1959
|
+
preact.render(preact.createElement(internalCommon.CalendarRoot, { options: currentData.calendarOptions, theme: currentData.theme, emitter: currentData.emitter }, (classNames, height, forPrint) => {
|
|
2022
1960
|
this.setClassNames(classNames);
|
|
2023
1961
|
this.setHeight(height);
|
|
2024
1962
|
return (preact.createElement(internalCommon.RenderId.Provider, { value: this.customContentRenderId },
|
|
2025
|
-
preact.createElement(CalendarContent, Object.assign({
|
|
1963
|
+
preact.createElement(CalendarContent, Object.assign({ forPrint: forPrint }, currentData))));
|
|
2026
1964
|
}), this.el);
|
|
2027
1965
|
});
|
|
2028
1966
|
}
|
|
@@ -2139,7 +2077,7 @@ function sliceEvents(props, allDay) {
|
|
|
2139
2077
|
return internalCommon.sliceEventStore(props.eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? props.nextDayThreshold : null).fg;
|
|
2140
2078
|
}
|
|
2141
2079
|
|
|
2142
|
-
const version = '
|
|
2080
|
+
const version = '7.0.0-beta.1';
|
|
2143
2081
|
|
|
2144
2082
|
exports.JsonRequestError = internalCommon.JsonRequestError;
|
|
2145
2083
|
exports.Calendar = Calendar;
|
package/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { C as CalendarImpl, a as CalendarOptions, N as NativeFormatterOptions, D as DateInput, P as PluginDefInput, b as PluginDef, L as LocaleInput } from './internal-common.js';
|
|
2
|
-
export {
|
|
2
|
+
export { U as AllDayContentArg, X as AllDayMountArg, A as AllowFunc, B as BusinessHoursInput, ai as ButtonHintCompoundInput, a9 as ButtonIconsInput, aa as ButtonTextCompoundInput, c as CalendarApi, f as CalendarListeners, a as CalendarOptions, v as ClassNamesGenerator, r as ConstraintInput, p as CssDimValue, a8 as CustomButtonInput, w as CustomContentGenerator, aj as CustomRenderingHandler, ak as CustomRenderingStore, D as DateInput, am as DatePointApi, j as DateRangeInput, a4 as DateSelectArg, an as DateSelectionApi, al as DateSpanApi, i as DateSpanInput, a5 as DateUnselectArg, ad as DatesSetArg, _ as DayCellContentArg, $ as DayCellMountArg, Y as DayHeaderContentArg, Z as DayHeaderMountArg, x as DidMountHandler, ao as Duration, h as DurationInput, ae as EventAddArg, d as EventApi, af as EventChangeArg, a2 as EventClickArg, ab as EventContentArg, ag as EventDropArg, a3 as EventHoveringArg, n as EventInput, o as EventInputTransformer, ac as EventMountArg, ah as EventRemoveArg, e as EventRenderRange, ap as EventSegment, E as EventSourceApi, l as EventSourceFunc, m as EventSourceFuncArg, k as EventSourceInput, F as FormatterInput, J as JsonRequestError, L as LocaleInput, q as LocaleSingularArg, aq as MoreLinkAction, as as MoreLinkArg, M as MoreLinkContentArg, at as MoreLinkHandler, I as MoreLinkMountArg, ar as MoreLinkSimpleAction, y as NowIndicatorContentArg, z as NowIndicatorMountArg, O as OverlapFunc, b as PluginDef, P as PluginDefInput, R as SlotLabelContentArg, T as SlotLabelMountArg, K as SlotLaneContentArg, Q as SlotLaneMountArg, S as SpecificViewContentArg, u as SpecificViewMountArg, a7 as ToolbarInput, V as ViewApi, t as ViewComponentType, a0 as ViewContentArg, a1 as ViewMountArg, g as ViewOptions, a6 as WeekNumberCalculation, G as WeekNumberContentArg, H as WeekNumberMountArg, W as WillUnmountHandler, s as sliceEvents } from './internal-common.js';
|
|
3
3
|
import 'preact';
|
|
4
4
|
import './preact.js';
|
|
5
5
|
import './index.js';
|
|
6
|
+
import './internal.js';
|
|
6
7
|
|
|
7
8
|
declare class Calendar extends CalendarImpl {
|
|
8
9
|
el: HTMLElement;
|