@fullcalendar/timeline 7.0.0-beta.1 → 7.0.0-beta.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.cjs +1 -1
- package/index.global.js +143 -258
- package/index.global.min.js +2 -2
- package/index.js +1 -1
- package/internal.cjs +141 -256
- package/internal.d.ts +32 -58
- package/internal.js +143 -256
- package/package.json +4 -4
package/internal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { config, createFormatter, greatestDurationDenominator, asCleanDays, createDuration, wholeDivideDurations, asRoughMs, addDays, startOfDay, asRoughSeconds, asRoughMinutes, diffWholeDays, isInt, computeVisibleDayRange, padStart, BaseComponent, getDateMeta, ContentContainer,
|
|
1
|
+
import { config, createFormatter, greatestDurationDenominator, asCleanDays, createDuration, wholeDivideDurations, asRoughMs, addDays, startOfDay, asRoughSeconds, asRoughMinutes, diffWholeDays, isInt, computeVisibleDayRange, padStart, BaseComponent, getDateMeta, ContentContainer, joinClassNames, getDayClassName, getSlotClassName, watchWidth, setRef, RefMap, afterSize, getEventKey, SegHierarchy, groupIntersectingSegs, buildEventRangeKey, BgEvent, getEventRangeMeta, renderFill, Slicer, intersectRanges, addMs, StandardEvent, MoreLinkContainer, watchHeight, memoize, sortEventSegs, memoizeObjArg, buildNavLinkAttrs, watchSize, NowIndicatorContainer, DateComponent, getIsHeightAuto, getStickyHeaderDates, getStickyFooterScrollbar, NowTimer, rangeContainsMarker, ViewContainer, Scroller, multiplyDuration, injectStyles } from '@fullcalendar/core/internal.js';
|
|
2
2
|
import { createRef, createElement, Fragment, Component } from '@fullcalendar/core/preact.js';
|
|
3
3
|
import { ScrollerSyncer } from '@fullcalendar/scrollgrid/internal.js';
|
|
4
4
|
|
|
@@ -448,42 +448,33 @@ class TimelineSlatCell extends BaseComponent {
|
|
|
448
448
|
}
|
|
449
449
|
render() {
|
|
450
450
|
let { props, context } = this;
|
|
451
|
-
let { dateEnv, options
|
|
451
|
+
let { dateEnv, options } = context;
|
|
452
452
|
let { date, tDateProfile, isEm } = props;
|
|
453
453
|
let dateMeta = getDateMeta(props.date, props.todayRange, props.nowDate, props.dateProfile);
|
|
454
454
|
let renderProps = Object.assign(Object.assign({ date: dateEnv.toDate(props.date) }, dateMeta), { view: context.viewApi });
|
|
455
|
-
return (createElement(ContentContainer, {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
'fc-timeline-slot-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
'fc-timeline-slot-major' :
|
|
465
|
-
'fc-timeline-slot-minor') : '',
|
|
466
|
-
...(props.isDay ?
|
|
467
|
-
getDayClassNames(dateMeta, theme) :
|
|
468
|
-
getSlotClassNames(dateMeta, theme)),
|
|
469
|
-
], elAttrs: {
|
|
470
|
-
'data-date': dateEnv.formatIso(date, {
|
|
455
|
+
return (createElement(ContentContainer, { tag: "div",
|
|
456
|
+
// fc-align-start shrinks width of InnerContent
|
|
457
|
+
// TODO: document this semantic className fc-timeline-slot-em
|
|
458
|
+
className: joinClassNames('fc-timeline-slot', isEm && 'fc-timeline-slot-em', tDateProfile.isTimeScale && (isInt(dateEnv.countDurationsBetween(// best to do this here?
|
|
459
|
+
tDateProfile.normalizedRange.start, props.date, tDateProfile.labelInterval)) ?
|
|
460
|
+
'fc-timeline-slot-major' :
|
|
461
|
+
'fc-timeline-slot-minor'), 'fc-timeline-slot-lane fc-cell fc-flex-col fc-align-start', props.borderStart && 'fc-border-s', props.isDay ?
|
|
462
|
+
getDayClassName(dateMeta) :
|
|
463
|
+
getSlotClassName(dateMeta)), attrs: Object.assign({ 'data-date': dateEnv.formatIso(date, {
|
|
471
464
|
omitTimeZoneOffset: true,
|
|
472
465
|
omitTime: !tDateProfile.isTimeScale,
|
|
473
|
-
}),
|
|
474
|
-
}, elStyle: {
|
|
466
|
+
}) }, (dateMeta.isToday ? { 'aria-current': 'date' } : {})), style: {
|
|
475
467
|
width: props.width,
|
|
476
|
-
}, renderProps: renderProps, generatorName: "slotLaneContent", customGenerator: options.slotLaneContent, classNameGenerator: options.slotLaneClassNames, didMount: options.slotLaneDidMount, willUnmount: options.slotLaneWillUnmount }, (InnerContent) => (createElement(
|
|
477
|
-
createElement(InnerContent, { elTag: "div", elClasses: ['fc-cell-inner'] })))));
|
|
468
|
+
}, renderProps: renderProps, generatorName: "slotLaneContent", customGenerator: options.slotLaneContent, classNameGenerator: options.slotLaneClassNames, didMount: options.slotLaneDidMount, willUnmount: options.slotLaneWillUnmount }, (InnerContent) => (createElement(InnerContent, { tag: "div", className: 'fc-cell-inner', elRef: this.innerElRef }))));
|
|
478
469
|
}
|
|
479
470
|
componentDidMount() {
|
|
480
471
|
const innerEl = this.innerElRef.current;
|
|
481
|
-
this.
|
|
472
|
+
this.disconnectInnerWidth = watchWidth(innerEl, (width) => {
|
|
482
473
|
setRef(this.props.innerWidthRef, width);
|
|
483
474
|
});
|
|
484
475
|
}
|
|
485
476
|
componentWillUnmount() {
|
|
486
|
-
this.
|
|
477
|
+
this.disconnectInnerWidth();
|
|
487
478
|
setRef(this.props.innerWidthRef, null);
|
|
488
479
|
}
|
|
489
480
|
}
|
|
@@ -509,9 +500,9 @@ class TimelineSlats extends BaseComponent {
|
|
|
509
500
|
let { tDateProfile, slotWidth } = props;
|
|
510
501
|
let { slotDates, isWeekStarts } = tDateProfile;
|
|
511
502
|
let isDay = !tDateProfile.isTimeScale && !tDateProfile.largeUnit;
|
|
512
|
-
return (createElement("div", { className: "fc-timeline-slots fc-fill fc-flex-row" }, slotDates.map((slotDate, i) => {
|
|
503
|
+
return (createElement("div", { "aria-hidden": true, className: "fc-timeline-slots fc-fill fc-flex-row", style: { height: props.height } }, slotDates.map((slotDate, i) => {
|
|
513
504
|
let key = slotDate.toISOString();
|
|
514
|
-
return (createElement(TimelineSlatCell, { key: key, date: slotDate, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: props.nowDate, todayRange: props.todayRange, isEm: isWeekStarts[i], isDay: isDay,
|
|
505
|
+
return (createElement(TimelineSlatCell, { key: key, date: slotDate, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: props.nowDate, todayRange: props.todayRange, isEm: isWeekStarts[i], isDay: isDay, borderStart: Boolean(i),
|
|
515
506
|
// ref
|
|
516
507
|
innerWidthRef: innerWidthRefMap.createRef(key),
|
|
517
508
|
// dimensions
|
|
@@ -545,30 +536,6 @@ function computeDateSnapCoverage$1(date, tDateProfile, dateEnv) {
|
|
|
545
536
|
return snapCoverage;
|
|
546
537
|
}
|
|
547
538
|
/*
|
|
548
|
-
TODO: audit!!!
|
|
549
|
-
*/
|
|
550
|
-
function coordToCss(hcoord, isRtl) {
|
|
551
|
-
if (hcoord === null) {
|
|
552
|
-
return { left: '', right: '' };
|
|
553
|
-
}
|
|
554
|
-
if (isRtl) {
|
|
555
|
-
return { right: hcoord, left: '' };
|
|
556
|
-
}
|
|
557
|
-
return { left: hcoord, right: '' };
|
|
558
|
-
}
|
|
559
|
-
/*
|
|
560
|
-
TODO: audit!!!
|
|
561
|
-
*/
|
|
562
|
-
function coordsToCss(hcoords, isRtl) {
|
|
563
|
-
if (!hcoords) {
|
|
564
|
-
return { left: '', right: '' };
|
|
565
|
-
}
|
|
566
|
-
if (isRtl) {
|
|
567
|
-
return { right: hcoords.start, left: -hcoords.end };
|
|
568
|
-
}
|
|
569
|
-
return { left: hcoords.start, right: -hcoords.end };
|
|
570
|
-
}
|
|
571
|
-
/*
|
|
572
539
|
TODO: DRY up with elsewhere?
|
|
573
540
|
*/
|
|
574
541
|
function horizontalsToCss(hcoord, isRtl) {
|
|
@@ -599,7 +566,8 @@ function createVerticalStyle(props) {
|
|
|
599
566
|
};
|
|
600
567
|
}
|
|
601
568
|
}
|
|
602
|
-
function createHorizontalStyle(
|
|
569
|
+
function createHorizontalStyle(// TODO: DRY up?
|
|
570
|
+
props, isRtl) {
|
|
603
571
|
if (props) {
|
|
604
572
|
return {
|
|
605
573
|
[isRtl ? 'right' : 'left']: props.start,
|
|
@@ -672,13 +640,13 @@ function computeDateSnapCoverage(date, tDateProfile, dateEnv) {
|
|
|
672
640
|
function computeManySegHorizontals(segs, segMinWidth, dateEnv, tDateProfile, slotWidth) {
|
|
673
641
|
const res = {};
|
|
674
642
|
for (const seg of segs) {
|
|
675
|
-
res[seg
|
|
643
|
+
res[getEventKey(seg)] = computeSegHorizontals(seg, segMinWidth, dateEnv, tDateProfile, slotWidth);
|
|
676
644
|
}
|
|
677
645
|
return res;
|
|
678
646
|
}
|
|
679
647
|
function computeSegHorizontals(seg, segMinWidth, dateEnv, tDateProfile, slotWidth) {
|
|
680
|
-
const startCoord = dateToCoord(seg.
|
|
681
|
-
const endCoord = dateToCoord(seg.
|
|
648
|
+
const startCoord = dateToCoord(seg.startDate, dateEnv, tDateProfile, slotWidth);
|
|
649
|
+
const endCoord = dateToCoord(seg.endDate, dateEnv, tDateProfile, slotWidth);
|
|
682
650
|
let size = endCoord - startCoord;
|
|
683
651
|
if (segMinWidth) {
|
|
684
652
|
size = Math.max(size, segMinWidth);
|
|
@@ -686,95 +654,58 @@ function computeSegHorizontals(seg, segMinWidth, dateEnv, tDateProfile, slotWidt
|
|
|
686
654
|
return { start: startCoord, size };
|
|
687
655
|
}
|
|
688
656
|
function computeFgSegPlacements(// mostly horizontals
|
|
689
|
-
segs, segHorizontals,
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
segEntries.push({
|
|
699
|
-
index: i,
|
|
700
|
-
seg,
|
|
701
|
-
span: {
|
|
702
|
-
start: hcoords.start,
|
|
703
|
-
end: hcoords.start + hcoords.size,
|
|
704
|
-
},
|
|
705
|
-
thickness: height,
|
|
706
|
-
});
|
|
657
|
+
segs, segHorizontals, // TODO: use Map
|
|
658
|
+
segHeights, // keyed by instanceId
|
|
659
|
+
hiddenGroupHeights, strictOrder, maxDepth) {
|
|
660
|
+
const segRanges = [];
|
|
661
|
+
// isn't it true that there will either be ALL hcoords or NONE? can optimize
|
|
662
|
+
for (const seg of segs) {
|
|
663
|
+
const hcoords = segHorizontals[getEventKey(seg)];
|
|
664
|
+
if (hcoords) {
|
|
665
|
+
segRanges.push(Object.assign(Object.assign({}, seg), { start: hcoords.start, end: hcoords.start + hcoords.size }));
|
|
707
666
|
}
|
|
708
667
|
}
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
}
|
|
716
|
-
let
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
hierarchy.maxStackCnt = -1;
|
|
726
|
-
hierarchy.addSegs(hiddenGroupEntries);
|
|
727
|
-
let visibleRects = hierarchy.toRects();
|
|
728
|
-
let segTops = {};
|
|
729
|
-
let hiddenGroupTops = {};
|
|
730
|
-
for (let rect of visibleRects) {
|
|
731
|
-
const { seg, segGroup } = rect;
|
|
732
|
-
if (seg) { // regular seg
|
|
733
|
-
segTops[seg.eventRange.instance.instanceId] = rect.levelCoord;
|
|
734
|
-
}
|
|
735
|
-
else { // hiddenGroup
|
|
736
|
-
hiddenGroupTops[segGroup.key] = rect.levelCoord;
|
|
668
|
+
const hierarchy = new SegHierarchy(segRanges, (seg) => segHeights.get(getEventKey(seg)), strictOrder, undefined, // maxCoord
|
|
669
|
+
maxDepth);
|
|
670
|
+
const segTops = new Map();
|
|
671
|
+
hierarchy.traverseSegs((seg, segTop) => {
|
|
672
|
+
segTops.set(getEventKey(seg), segTop);
|
|
673
|
+
});
|
|
674
|
+
const { hiddenSegs } = hierarchy;
|
|
675
|
+
let totalHeight = 0;
|
|
676
|
+
for (const segRange of segRanges) {
|
|
677
|
+
const segKey = getEventKey(segRange);
|
|
678
|
+
const segHeight = segHeights.get(segKey);
|
|
679
|
+
const segTop = segTops.get(segKey);
|
|
680
|
+
if (segHeight != null) {
|
|
681
|
+
if (segTop != null) {
|
|
682
|
+
totalHeight = Math.max(totalHeight, segTop + segHeight);
|
|
683
|
+
}
|
|
737
684
|
}
|
|
738
685
|
}
|
|
686
|
+
const hiddenGroups = groupIntersectingSegs(hiddenSegs);
|
|
687
|
+
const hiddenGroupTops = new Map();
|
|
688
|
+
// HACK for hiddenGroup findInsertion() call
|
|
689
|
+
hierarchy.strictOrder = true;
|
|
690
|
+
for (const hiddenGroup of hiddenGroups) {
|
|
691
|
+
const { levelCoord: top } = hierarchy.findInsertion(hiddenGroup, 0);
|
|
692
|
+
const hiddenGroupHeight = hiddenGroupHeights.get(hiddenGroup.key) || 0;
|
|
693
|
+
hiddenGroupTops.set(hiddenGroup.key, top);
|
|
694
|
+
totalHeight = Math.max(totalHeight, top + hiddenGroupHeight);
|
|
695
|
+
}
|
|
739
696
|
return [
|
|
740
697
|
segTops,
|
|
741
|
-
computeMaxBottom(segs, segTops, segHeights),
|
|
742
698
|
hiddenGroups,
|
|
743
699
|
hiddenGroupTops,
|
|
700
|
+
totalHeight,
|
|
744
701
|
];
|
|
745
702
|
}
|
|
746
|
-
function computeMaxBottom(segs, segTops, segHeights) {
|
|
747
|
-
let max = 0;
|
|
748
|
-
for (const seg of segs) {
|
|
749
|
-
const { instanceId } = seg.eventRange.instance;
|
|
750
|
-
const top = segTops[instanceId];
|
|
751
|
-
const height = segHeights.get(instanceId);
|
|
752
|
-
if (top != null && height != null) {
|
|
753
|
-
max = Math.max(max, top + height);
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
return max;
|
|
757
|
-
}
|
|
758
|
-
/*
|
|
759
|
-
TODO: converge with computeMaxBottom, but keys are different
|
|
760
|
-
*/
|
|
761
|
-
function computeMoreLinkMaxBottom(hiddenGroups, hiddenGroupTops, hiddenGroupHeights) {
|
|
762
|
-
let max = 0;
|
|
763
|
-
for (const hiddenGroup of hiddenGroups) {
|
|
764
|
-
const top = hiddenGroupTops[hiddenGroup.key];
|
|
765
|
-
const height = hiddenGroupHeights.get(hiddenGroup.key);
|
|
766
|
-
if (top != null && height != null) {
|
|
767
|
-
max = Math.max(max, top + height);
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
return max;
|
|
771
|
-
}
|
|
772
703
|
|
|
773
704
|
class TimelineLaneBg extends BaseComponent {
|
|
774
705
|
render() {
|
|
775
706
|
let { props } = this;
|
|
776
707
|
let highlightSeg = [].concat(props.eventResizeSegs, props.dateSelectionSegs);
|
|
777
|
-
return (createElement(
|
|
708
|
+
return (createElement(Fragment, null,
|
|
778
709
|
this.renderSegs(props.businessHourSegs || [], 'non-business'),
|
|
779
710
|
this.renderSegs(props.bgEventSegs || [], 'bg-event'),
|
|
780
711
|
this.renderSegs(highlightSeg, 'highlight')));
|
|
@@ -788,7 +719,7 @@ class TimelineLaneBg extends BaseComponent {
|
|
|
788
719
|
let segHorizontal = computeSegHorizontals(seg, undefined, dateEnv, tDateProfile, slotWidth);
|
|
789
720
|
hStyle = horizontalsToCss(segHorizontal, isRtl);
|
|
790
721
|
}
|
|
791
|
-
return (createElement("div", { key: buildEventRangeKey(seg.eventRange), className: "fc-
|
|
722
|
+
return (createElement("div", { key: buildEventRangeKey(seg.eventRange), className: "fc-fill-y", style: hStyle }, fillType === 'bg-event' ?
|
|
792
723
|
createElement(BgEvent, Object.assign({ eventRange: seg.eventRange, isStart: seg.isStart, isEnd: seg.isEnd }, getEventRangeMeta(seg.eventRange, todayRange, nowDate))) : (renderFill(fillType))));
|
|
793
724
|
})));
|
|
794
725
|
}
|
|
@@ -805,8 +736,8 @@ class TimelineLaneSlicer extends Slicer {
|
|
|
805
736
|
let slicedRange = intersectRanges(normalRange, tDateProfile.normalizedRange);
|
|
806
737
|
if (slicedRange) {
|
|
807
738
|
segs.push({
|
|
808
|
-
|
|
809
|
-
|
|
739
|
+
startDate: slicedRange.start,
|
|
740
|
+
endDate: slicedRange.end,
|
|
810
741
|
isStart: slicedRange.start.valueOf() === normalRange.start.valueOf()
|
|
811
742
|
&& isValidDate(slicedRange.start, tDateProfile, dateProfile, dateProfileGenerator),
|
|
812
743
|
isEnd: slicedRange.end.valueOf() === normalRange.end.valueOf()
|
|
@@ -828,13 +759,8 @@ class TimelineEvent extends BaseComponent {
|
|
|
828
759
|
render() {
|
|
829
760
|
let { props, context } = this;
|
|
830
761
|
let { options } = context;
|
|
831
|
-
return (createElement(StandardEvent, Object.assign({}, props, {
|
|
832
|
-
'fc-timeline-event',
|
|
833
|
-
'fc-h-event',
|
|
834
|
-
options.eventOverlap === false // TODO: fix bad default
|
|
835
|
-
? 'fc-timeline-event-spacious'
|
|
836
|
-
: ''
|
|
837
|
-
], defaultTimeFormat: DEFAULT_TIME_FORMAT, defaultDisplayEventTime: !props.isTimeScale })));
|
|
762
|
+
return (createElement(StandardEvent, Object.assign({}, props, { className: joinClassNames('fc-timeline-event', options.eventOverlap === false // TODO: fix bad default
|
|
763
|
+
&& 'fc-timeline-event-spacious', 'fc-h-event'), defaultTimeFormat: DEFAULT_TIME_FORMAT, defaultDisplayEventTime: !props.isTimeScale })));
|
|
838
764
|
}
|
|
839
765
|
}
|
|
840
766
|
|
|
@@ -842,13 +768,13 @@ class TimelineLaneMoreLink extends BaseComponent {
|
|
|
842
768
|
render() {
|
|
843
769
|
let { props } = this;
|
|
844
770
|
let { hiddenSegs, resourceId, forcedInvisibleMap } = props;
|
|
845
|
-
let
|
|
846
|
-
return (createElement(MoreLinkContainer, {
|
|
771
|
+
let dateSpanProps = resourceId ? { resourceId } : {};
|
|
772
|
+
return (createElement(MoreLinkContainer, { className: 'fc-timeline-more-link', allDayDate: null, segs: hiddenSegs, hiddenSegs: hiddenSegs, dateProfile: props.dateProfile, todayRange: props.todayRange, dateSpanProps: dateSpanProps, popoverContent: () => (createElement(Fragment, null, hiddenSegs.map((seg) => {
|
|
847
773
|
let { eventRange } = seg;
|
|
848
774
|
let instanceId = eventRange.instance.instanceId;
|
|
849
775
|
return (createElement("div", { key: instanceId, style: { visibility: forcedInvisibleMap[instanceId] ? 'hidden' : '' } },
|
|
850
776
|
createElement(TimelineEvent, Object.assign({ isTimeScale: props.isTimeScale, eventRange: eventRange, isStart: seg.isStart, isEnd: seg.isEnd, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === props.eventSelection }, getEventRangeMeta(eventRange, props.todayRange, props.nowDate)))));
|
|
851
|
-
}))) }, (InnerContent) => (createElement(InnerContent, {
|
|
777
|
+
}))) }, (InnerContent) => (createElement(InnerContent, { tag: "div", className: 'fc-timeline-more-link-inner fc-sticky-s' }))));
|
|
852
778
|
}
|
|
853
779
|
}
|
|
854
780
|
|
|
@@ -867,12 +793,12 @@ class TimelineEventHarness extends Component {
|
|
|
867
793
|
}
|
|
868
794
|
componentDidMount() {
|
|
869
795
|
const rootEl = this.rootElRef.current; // TODO: make dynamic with useEffect
|
|
870
|
-
this.
|
|
796
|
+
this.disconnectHeight = watchHeight(rootEl, (height) => {
|
|
871
797
|
setRef(this.props.heightRef, height);
|
|
872
798
|
});
|
|
873
799
|
}
|
|
874
800
|
componentWillUnmount() {
|
|
875
|
-
this.
|
|
801
|
+
this.disconnectHeight();
|
|
876
802
|
setRef(this.props.heightRef, null);
|
|
877
803
|
}
|
|
878
804
|
}
|
|
@@ -905,7 +831,7 @@ class TimelineLane extends BaseComponent {
|
|
|
905
831
|
TODO: lots of memoization needed here!
|
|
906
832
|
*/
|
|
907
833
|
render() {
|
|
908
|
-
let { props, context, segHeightRefMap } = this;
|
|
834
|
+
let { props, context, segHeightRefMap, moreLinkHeightRefMap } = this;
|
|
909
835
|
let { options } = context;
|
|
910
836
|
let { dateProfile, tDateProfile } = props;
|
|
911
837
|
let slicedProps = this.slicer.sliceProps(props, dateProfile, tDateProfile.isTimeScale ? null : props.nextDayThreshold, context, // wish we didn't have to pass in the rest of the args...
|
|
@@ -917,10 +843,7 @@ class TimelineLane extends BaseComponent {
|
|
|
917
843
|
let fgSegHorizontals = props.slotWidth != null
|
|
918
844
|
? computeManySegHorizontals(fgSegs, options.eventMinWidth, context.dateEnv, tDateProfile, props.slotWidth)
|
|
919
845
|
: {};
|
|
920
|
-
let [fgSegTops,
|
|
921
|
-
fgSegs, fgSegHorizontals, segHeightRefMap.current, options.eventOrderStrict, options.eventMaxStack);
|
|
922
|
-
let moreLinksBottom = computeMoreLinkMaxBottom(hiddenGroups, hiddenGroupTops, this.moreLinkHeightRefMap.current);
|
|
923
|
-
let innerHeight = Math.max(moreLinksBottom, fgSegsBottom);
|
|
846
|
+
let [fgSegTops, hiddenGroups, hiddenGroupTops, totalHeight] = computeFgSegPlacements(fgSegs, fgSegHorizontals, segHeightRefMap.current, moreLinkHeightRefMap.current, options.eventOrderStrict, options.eventMaxStack);
|
|
924
847
|
let forcedInvisibleMap = // TODO: more convenient/DRY
|
|
925
848
|
(slicedProps.eventDrag ? slicedProps.eventDrag.affectedInstances : null) ||
|
|
926
849
|
(slicedProps.eventResize ? slicedProps.eventResize.affectedInstances : null) ||
|
|
@@ -931,20 +854,18 @@ class TimelineLane extends BaseComponent {
|
|
|
931
854
|
bgEventSegs: slicedProps.bgEventSegs, businessHourSegs: slicedProps.businessHourSegs, dateSelectionSegs: slicedProps.dateSelectionSegs, eventResizeSegs: slicedProps.eventResize ? slicedProps.eventResize.segs : [] /* bad new empty array? */,
|
|
932
855
|
// dimensions
|
|
933
856
|
slotWidth: props.slotWidth }),
|
|
934
|
-
createElement("div", { className:
|
|
935
|
-
'fc-timeline-events'
|
|
936
|
-
'fc-content-box',
|
|
937
|
-
options.eventOverlap === false // TODO: fix bad default
|
|
938
|
-
? 'fc-timeline-events-overlap-disabled'
|
|
939
|
-
: 'fc-timeline-events-overlap-enabled'
|
|
940
|
-
].join(' '), style: { height: innerHeight } },
|
|
857
|
+
createElement("div", { className: joinClassNames('fc-timeline-events', options.eventOverlap === false // TODO: fix bad default
|
|
858
|
+
? 'fc-timeline-events-overlap-disabled'
|
|
859
|
+
: 'fc-timeline-events-overlap-enabled', 'fc-content-box'), style: { height: totalHeight } },
|
|
941
860
|
this.renderFgSegs(fgSegs, fgSegHorizontals, fgSegTops, forcedInvisibleMap, hiddenGroups, hiddenGroupTops, false, // isDragging
|
|
942
861
|
false, // isResizing
|
|
943
862
|
false),
|
|
944
863
|
this.renderFgSegs(mirrorSegs, props.slotWidth // TODO: memoize
|
|
945
864
|
? computeManySegHorizontals(mirrorSegs, options.eventMinWidth, context.dateEnv, tDateProfile, props.slotWidth)
|
|
946
865
|
: {}, fgSegTops, {}, // forcedInvisibleMap
|
|
947
|
-
[],
|
|
866
|
+
[], // hiddenGroups
|
|
867
|
+
new Map(), // hiddenGroupTops
|
|
868
|
+
Boolean(slicedProps.eventDrag), Boolean(slicedProps.eventResize), false))));
|
|
948
869
|
}
|
|
949
870
|
renderFgSegs(segs, segHorizontals, segTops, forcedInvisibleMap, hiddenGroups, hiddenGroupTops, isDragging, isResizing, isDateSelecting) {
|
|
950
871
|
let { props, context, segHeightRefMap, moreLinkHeightRefMap } = this;
|
|
@@ -953,18 +874,18 @@ class TimelineLane extends BaseComponent {
|
|
|
953
874
|
segs.map((seg) => {
|
|
954
875
|
const { eventRange } = seg;
|
|
955
876
|
const { instanceId } = eventRange.instance;
|
|
956
|
-
const segTop = segTops
|
|
877
|
+
const segTop = segTops.get(instanceId);
|
|
957
878
|
const segHorizontal = segHorizontals[instanceId];
|
|
958
879
|
const isVisible = isMirror ||
|
|
959
880
|
(segHorizontal && segTop != null && !forcedInvisibleMap[instanceId]);
|
|
960
881
|
return (createElement(TimelineEventHarness, { key: instanceId, style: Object.assign({ visibility: isVisible ? '' : 'hidden', top: segTop || 0 }, horizontalsToCss(segHorizontal, context.isRtl)), heightRef: isMirror ? undefined : segHeightRefMap.createRef(instanceId) },
|
|
961
882
|
createElement(TimelineEvent, Object.assign({ isTimeScale: props.tDateProfile.isTimeScale, eventRange: eventRange, isStart: seg.isStart, isEnd: seg.isEnd, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === props.eventSelection /* TODO: bad for mirror? */ }, getEventRangeMeta(eventRange, props.todayRange, props.nowDate)))));
|
|
962
883
|
}),
|
|
963
|
-
hiddenGroups.map((hiddenGroup) => (createElement(TimelineEventHarness, { key: hiddenGroup.key, style: Object.assign({ top: hiddenGroupTops
|
|
964
|
-
start: hiddenGroup.
|
|
965
|
-
size: hiddenGroup.
|
|
884
|
+
hiddenGroups.map((hiddenGroup) => (createElement(TimelineEventHarness, { key: hiddenGroup.key, style: Object.assign({ top: hiddenGroupTops.get(hiddenGroup.key) || 0 }, horizontalsToCss({
|
|
885
|
+
start: hiddenGroup.start,
|
|
886
|
+
size: hiddenGroup.end - hiddenGroup.start
|
|
966
887
|
}, context.isRtl)), heightRef: moreLinkHeightRefMap.createRef(hiddenGroup.key) },
|
|
967
|
-
createElement(TimelineLaneMoreLink, { hiddenSegs: hiddenGroup.segs
|
|
888
|
+
createElement(TimelineLaneMoreLink, { hiddenSegs: hiddenGroup.segs, dateProfile: props.dateProfile, nowDate: props.nowDate, todayRange: props.todayRange, isTimeScale: props.tDateProfile.isTimeScale, eventSelection: props.eventSelection, resourceId: props.resourceId, forcedInvisibleMap: forcedInvisibleMap }))))));
|
|
968
889
|
}
|
|
969
890
|
}
|
|
970
891
|
|
|
@@ -973,7 +894,6 @@ class TimelineHeaderCell extends BaseComponent {
|
|
|
973
894
|
super(...arguments);
|
|
974
895
|
// memo
|
|
975
896
|
this.refineRenderProps = memoizeObjArg(refineRenderProps);
|
|
976
|
-
this.buildCellNavLinkAttrs = memoize(buildCellNavLinkAttrs);
|
|
977
897
|
// ref
|
|
978
898
|
this.innerElRef = createRef();
|
|
979
899
|
}
|
|
@@ -992,36 +912,24 @@ class TimelineHeaderCell extends BaseComponent {
|
|
|
992
912
|
dateEnv: context.dateEnv,
|
|
993
913
|
viewApi: context.viewApi,
|
|
994
914
|
});
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
'
|
|
1002
|
-
'fc-justify-center',
|
|
1003
|
-
props.isCentered ? 'fc-align-center' : 'fc-align-start',
|
|
1004
|
-
...( // TODO: so slot classnames for week/month/bigger. see note above about rowUnit
|
|
1005
|
-
cell.rowUnit === 'time' ?
|
|
1006
|
-
getSlotClassNames(dateMeta, context.theme) :
|
|
1007
|
-
getDayClassNames(dateMeta, context.theme)),
|
|
1008
|
-
], elAttrs: {
|
|
1009
|
-
'data-date': dateEnv.formatIso(cell.date, {
|
|
915
|
+
let isNavLink = !dateMeta.isDisabled && (cell.rowUnit && cell.rowUnit !== 'time');
|
|
916
|
+
return (createElement(ContentContainer, { tag: "div", className: joinClassNames('fc-timeline-slot-label fc-timeline-slot', cell.isWeekStart && 'fc-timeline-slot-em', // TODO: document this semantic className
|
|
917
|
+
'fc-header-cell fc-cell fc-flex-col fc-justify-center', props.borderStart && 'fc-border-s', props.isCentered ? 'fc-align-center' : 'fc-align-start',
|
|
918
|
+
// TODO: so slot classnames for week/month/bigger. see note above about rowUnit
|
|
919
|
+
cell.rowUnit === 'time' ?
|
|
920
|
+
getSlotClassName(dateMeta) :
|
|
921
|
+
getDayClassName(dateMeta)), attrs: Object.assign({ 'data-date': dateEnv.formatIso(cell.date, {
|
|
1010
922
|
omitTime: !tDateProfile.isTimeScale,
|
|
1011
923
|
omitTimeZoneOffset: true,
|
|
1012
|
-
}),
|
|
1013
|
-
}, elStyle: {
|
|
924
|
+
}) }, (dateMeta.isToday ? { 'aria-current': 'date' } : {})), style: {
|
|
1014
925
|
width: props.slotWidth != null
|
|
1015
926
|
? props.slotWidth * cell.colspan
|
|
1016
927
|
: undefined,
|
|
1017
|
-
}, renderProps: renderProps, generatorName: "slotLabelContent", customGenerator: options.slotLabelContent, defaultGenerator: renderInnerContent, classNameGenerator: options.slotLabelClassNames, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, (InnerContent) => (createElement(
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
'fc-cell-inner',
|
|
1023
|
-
'fc-padding-md',
|
|
1024
|
-
], elAttrs: this.buildCellNavLinkAttrs(context, cell.date, cell.rowUnit) })))));
|
|
928
|
+
}, renderProps: renderProps, generatorName: "slotLabelContent", customGenerator: options.slotLabelContent, defaultGenerator: renderInnerContent, classNameGenerator: options.slotLabelClassNames, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, (InnerContent) => (createElement(InnerContent, { tag: 'div', attrs: isNavLink
|
|
929
|
+
// not tabbable because parent is aria-hidden
|
|
930
|
+
? buildNavLinkAttrs(context, cell.date, cell.rowUnit, undefined, /* isTabbable = */ false)
|
|
931
|
+
: {} // don't bother with aria-hidden because parent already hidden
|
|
932
|
+
, className: joinClassNames('fc-cell-inner fc-padding-md', props.isSticky && 'fc-sticky-s'), elRef: this.innerElRef }))));
|
|
1025
933
|
}
|
|
1026
934
|
componentDidMount() {
|
|
1027
935
|
const { props } = this;
|
|
@@ -1045,11 +953,6 @@ class TimelineHeaderCell extends BaseComponent {
|
|
|
1045
953
|
}
|
|
1046
954
|
// Utils
|
|
1047
955
|
// -------------------------------------------------------------------------------------------------
|
|
1048
|
-
function buildCellNavLinkAttrs(context, cellDate, rowUnit) {
|
|
1049
|
-
return (rowUnit && rowUnit !== 'time')
|
|
1050
|
-
? buildNavLinkAttrs(context, cellDate, rowUnit)
|
|
1051
|
-
: {};
|
|
1052
|
-
}
|
|
1053
956
|
function renderInnerContent(renderProps) {
|
|
1054
957
|
return renderProps.text;
|
|
1055
958
|
}
|
|
@@ -1095,13 +998,14 @@ class TimelineHeaderRow extends BaseComponent {
|
|
|
1095
998
|
const { props, innerWidthRefMap, innerHeightRefMap } = this;
|
|
1096
999
|
const isCentered = !(props.tDateProfile.isTimeScale && props.isLastRow);
|
|
1097
1000
|
const isSticky = !props.isLastRow;
|
|
1098
|
-
return (createElement("div", { className: 'fc-row',
|
|
1001
|
+
return (createElement("div", { className: joinClassNames('fc-flex-row fc-grow', // TODO: move fc-grow to parent?
|
|
1002
|
+
!props.isLastRow && 'fc-border-b') }, props.cells.map((cell, cellI) => {
|
|
1099
1003
|
// TODO: make this part of the cell obj?
|
|
1100
1004
|
// TODO: rowUnit seems wrong sometimes. says 'month' when it should be day
|
|
1101
1005
|
// TODO: rowUnit is relevant to whole row. put it on a row object, not the cells
|
|
1102
1006
|
// TODO: use rowUnit to key the Row itself?
|
|
1103
1007
|
const key = cell.rowUnit + ':' + cell.date.toISOString();
|
|
1104
|
-
return (createElement(TimelineHeaderCell, { key: key, cell: cell, rowLevel: props.rowLevel, dateProfile: props.dateProfile, tDateProfile: props.tDateProfile, todayRange: props.todayRange, nowDate: props.nowDate, isCentered: isCentered, isSticky: isSticky,
|
|
1008
|
+
return (createElement(TimelineHeaderCell, { key: key, cell: cell, rowLevel: props.rowLevel, dateProfile: props.dateProfile, tDateProfile: props.tDateProfile, todayRange: props.todayRange, nowDate: props.nowDate, isCentered: isCentered, isSticky: isSticky, borderStart: Boolean(cellI),
|
|
1105
1009
|
// refs
|
|
1106
1010
|
innerWidthRef: innerWidthRefMap.createRef(key), innerHeightRef: innerHeightRefMap.createRef(key),
|
|
1107
1011
|
// dimensions
|
|
@@ -1119,7 +1023,7 @@ class TimelineNowIndicatorLine extends BaseComponent {
|
|
|
1119
1023
|
const { props, context } = this;
|
|
1120
1024
|
return (createElement("div", { className: "fc-timeline-now-indicator-container" },
|
|
1121
1025
|
createElement(NowIndicatorContainer // TODO: make separate component?
|
|
1122
|
-
, {
|
|
1026
|
+
, { className: 'fc-timeline-now-indicator-line', style: props.slotWidth != null
|
|
1123
1027
|
? horizontalCoordToCss(dateToCoord(props.nowDate, context.dateEnv, props.tDateProfile, props.slotWidth), context.isRtl)
|
|
1124
1028
|
: {}, isAxis: false, date: props.nowDate })));
|
|
1125
1029
|
}
|
|
@@ -1129,7 +1033,7 @@ class TimelineNowIndicatorArrow extends BaseComponent {
|
|
|
1129
1033
|
render() {
|
|
1130
1034
|
const { props, context } = this;
|
|
1131
1035
|
return (createElement("div", { className: "fc-timeline-now-indicator-container" },
|
|
1132
|
-
createElement(NowIndicatorContainer, {
|
|
1036
|
+
createElement(NowIndicatorContainer, { className: 'fc-timeline-now-indicator-arrow', style: props.slotWidth != null
|
|
1133
1037
|
? horizontalCoordToCss(dateToCoord(props.nowDate, context.dateEnv, props.tDateProfile, props.slotWidth), context.isRtl)
|
|
1134
1038
|
: {}, isAxis: true, date: props.nowDate })));
|
|
1135
1039
|
}
|
|
@@ -1162,38 +1066,25 @@ class TimelineView extends DateComponent {
|
|
|
1162
1066
|
this.setState({ slotInnerWidth });
|
|
1163
1067
|
}
|
|
1164
1068
|
};
|
|
1165
|
-
this.
|
|
1166
|
-
this.setState({
|
|
1167
|
-
scrollerWidth,
|
|
1168
|
-
});
|
|
1169
|
-
};
|
|
1170
|
-
this.handleLeftScrollbarWidth = (leftScrollbarWidth) => {
|
|
1069
|
+
this.handleClientWidth = (clientWidth) => {
|
|
1171
1070
|
this.setState({
|
|
1172
|
-
|
|
1071
|
+
clientWidth,
|
|
1173
1072
|
});
|
|
1174
1073
|
};
|
|
1175
|
-
this.
|
|
1074
|
+
this.handleEndScrollbarWidth = (endScrollbarWidth) => {
|
|
1176
1075
|
this.setState({
|
|
1177
|
-
|
|
1076
|
+
endScrollbarWidth
|
|
1178
1077
|
});
|
|
1179
1078
|
};
|
|
1180
|
-
this.
|
|
1079
|
+
this.handleTimeScrollRequest = (scrollTime) => {
|
|
1181
1080
|
this.scrollTime = scrollTime;
|
|
1182
|
-
this.
|
|
1081
|
+
this.applyTimeScroll();
|
|
1183
1082
|
};
|
|
1184
|
-
this.
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
let x = timeToCoord(scrollTime, context.dateEnv, props.dateProfile, tDateProfile, slotWidth);
|
|
1188
|
-
if (x) {
|
|
1189
|
-
x += context.isRtl ? -1 : 1; // overcome border. TODO: DRY this up
|
|
1190
|
-
}
|
|
1191
|
-
this.syncedScroller.scrollTo({ x });
|
|
1083
|
+
this.handleTimeScrollEnd = ({ isUser }) => {
|
|
1084
|
+
if (isUser) {
|
|
1085
|
+
this.scrollTime = null;
|
|
1192
1086
|
}
|
|
1193
1087
|
};
|
|
1194
|
-
this.clearScroll = () => {
|
|
1195
|
-
this.scrollTime = null;
|
|
1196
|
-
};
|
|
1197
1088
|
// Hit System
|
|
1198
1089
|
// -----------------------------------------------------------------------------------------------
|
|
1199
1090
|
this.handeBodyEl = (el) => {
|
|
@@ -1219,44 +1110,30 @@ class TimelineView extends DateComponent {
|
|
|
1219
1110
|
const stickyFooterScrollbar = !props.forPrint && getStickyFooterScrollbar(options);
|
|
1220
1111
|
/* table positions */
|
|
1221
1112
|
const [canvasWidth, slotWidth] = this.computeSlotWidth(tDateProfile.slotCnt, tDateProfile.slotsPerLabel, options.slotMinWidth, state.slotInnerWidth, // is ACTUALLY the label width. rename?
|
|
1222
|
-
state.
|
|
1113
|
+
state.clientWidth);
|
|
1223
1114
|
this.slotWidth = slotWidth;
|
|
1224
1115
|
return (createElement(NowTimer, { unit: timerUnit }, (nowDate, todayRange) => {
|
|
1225
1116
|
const enableNowIndicator = // TODO: DRY
|
|
1226
1117
|
options.nowIndicator &&
|
|
1227
1118
|
slotWidth != null &&
|
|
1228
1119
|
rangeContainsMarker(props.dateProfile.currentRange, nowDate);
|
|
1229
|
-
return (createElement(ViewContainer, { viewSpec: context.viewSpec,
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
'fc-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
createElement("div", { className: 'fc-rel fc-content-box' // origin for now-indicator
|
|
1240
|
-
, style: {
|
|
1241
|
-
width: canvasWidth,
|
|
1242
|
-
paddingLeft: state.leftScrollbarWidth,
|
|
1243
|
-
paddingRight: state.rightScrollbarWidth,
|
|
1244
|
-
} },
|
|
1245
|
-
createElement("div", null, cellRows.map((cells, rowLevel) => {
|
|
1120
|
+
return (createElement(ViewContainer, { viewSpec: context.viewSpec, className: joinClassNames('fc-timeline fc-border',
|
|
1121
|
+
// HACK for Safari print-mode, where fc-scroller-no-bars won't take effect for
|
|
1122
|
+
// the below Scrollers if they have liquid flex height
|
|
1123
|
+
!props.forPrint && 'fc-flex-col') },
|
|
1124
|
+
createElement(Scroller, { horizontal: true, hideScrollbars: true, className: joinClassNames('fc-timeline-header fc-flex-row fc-border-b', stickyHeaderDates && 'fc-table-header-sticky'), ref: this.headerScrollerRef },
|
|
1125
|
+
createElement("div", {
|
|
1126
|
+
// TODO: DRY
|
|
1127
|
+
className: joinClassNames('fc-rel', // origin for now-indicator
|
|
1128
|
+
canvasWidth == null && 'fc-liquid'), style: { width: canvasWidth } },
|
|
1129
|
+
cellRows.map((cells, rowLevel) => {
|
|
1246
1130
|
const isLast = rowLevel === cellRows.length - 1;
|
|
1247
1131
|
return (createElement(TimelineHeaderRow, { key: rowLevel, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange, rowLevel: rowLevel, isLastRow: isLast, cells: cells, slotWidth: slotWidth, innerWidthRef: this.headerRowInnerWidthMap.createRef(rowLevel) }));
|
|
1248
|
-
})
|
|
1249
|
-
enableNowIndicator && (
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
'fc-timeline-body',
|
|
1254
|
-
'fc-rowgroup',
|
|
1255
|
-
verticalScrolling ? 'fc-liquid' : '',
|
|
1256
|
-
], ref: this.bodyScrollerRef, widthRef: this.handleScrollerWidth, leftScrollbarWidthRef: this.handleLeftScrollbarWidth, rightScrollbarWidthRef: this.handleRightScrollbarWidth },
|
|
1257
|
-
createElement("div", { className: "fc-rel fc-grow", style: {
|
|
1258
|
-
width: canvasWidth,
|
|
1259
|
-
}, ref: this.handeBodyEl },
|
|
1132
|
+
}),
|
|
1133
|
+
enableNowIndicator && (createElement(TimelineNowIndicatorArrow, { tDateProfile: tDateProfile, nowDate: nowDate, slotWidth: slotWidth }))),
|
|
1134
|
+
Boolean(state.endScrollbarWidth) && (createElement("div", { className: 'fc-border-s fc-filler', style: { minWidth: state.endScrollbarWidth } }))),
|
|
1135
|
+
createElement(Scroller, { vertical: verticalScrolling, horizontal: true, hideScrollbars: props.forPrint, className: joinClassNames('fc-timeline-body fc-flex-col', verticalScrolling && 'fc-liquid'), ref: this.bodyScrollerRef, clientWidthRef: this.handleClientWidth, endScrollbarWidthRef: this.handleEndScrollbarWidth },
|
|
1136
|
+
createElement("div", { "aria-label": options.eventsHint, className: "fc-rel fc-grow", style: { width: canvasWidth }, ref: this.handeBodyEl },
|
|
1260
1137
|
createElement(TimelineSlats, { dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange,
|
|
1261
1138
|
// ref
|
|
1262
1139
|
innerWidthRef: this.handleBodySlotInnerWidth,
|
|
@@ -1274,8 +1151,8 @@ class TimelineView extends DateComponent {
|
|
|
1274
1151
|
this.syncedScroller = new ScrollerSyncer(true); // horizontal=true
|
|
1275
1152
|
this.updateSyncedScroller();
|
|
1276
1153
|
this.resetScroll();
|
|
1277
|
-
this.context.emitter.on('_timeScrollRequest', this.
|
|
1278
|
-
this.syncedScroller.addScrollEndListener(this.
|
|
1154
|
+
this.context.emitter.on('_timeScrollRequest', this.handleTimeScrollRequest);
|
|
1155
|
+
this.syncedScroller.addScrollEndListener(this.handleTimeScrollEnd);
|
|
1279
1156
|
}
|
|
1280
1157
|
componentDidUpdate(prevProps) {
|
|
1281
1158
|
this.updateSyncedScroller();
|
|
@@ -1284,13 +1161,13 @@ class TimelineView extends DateComponent {
|
|
|
1284
1161
|
}
|
|
1285
1162
|
else {
|
|
1286
1163
|
// TODO: inefficient to update so often
|
|
1287
|
-
this.
|
|
1164
|
+
this.applyTimeScroll();
|
|
1288
1165
|
}
|
|
1289
1166
|
}
|
|
1290
1167
|
componentWillUnmount() {
|
|
1291
1168
|
this.syncedScroller.destroy();
|
|
1292
|
-
this.context.emitter.off('_timeScrollRequest', this.
|
|
1293
|
-
this.syncedScroller.removeScrollEndListener(this.
|
|
1169
|
+
this.context.emitter.off('_timeScrollRequest', this.handleTimeScrollRequest);
|
|
1170
|
+
this.syncedScroller.removeScrollEndListener(this.handleTimeScrollEnd);
|
|
1294
1171
|
}
|
|
1295
1172
|
// Scrolling
|
|
1296
1173
|
// -----------------------------------------------------------------------------------------------
|
|
@@ -1302,7 +1179,17 @@ class TimelineView extends DateComponent {
|
|
|
1302
1179
|
]);
|
|
1303
1180
|
}
|
|
1304
1181
|
resetScroll() {
|
|
1305
|
-
this.
|
|
1182
|
+
this.handleTimeScrollRequest(this.context.options.scrollTime);
|
|
1183
|
+
}
|
|
1184
|
+
applyTimeScroll() {
|
|
1185
|
+
const { props, context, tDateProfile, scrollTime, slotWidth } = this;
|
|
1186
|
+
if (scrollTime != null && slotWidth != null) {
|
|
1187
|
+
let x = timeToCoord(scrollTime, context.dateEnv, props.dateProfile, tDateProfile, slotWidth);
|
|
1188
|
+
if (x) {
|
|
1189
|
+
x += 1; // overcome border. TODO: DRY this up
|
|
1190
|
+
}
|
|
1191
|
+
this.syncedScroller.scrollTo({ x });
|
|
1192
|
+
}
|
|
1306
1193
|
}
|
|
1307
1194
|
queryHit(positionLeft, positionTop, elWidth, elHeight) {
|
|
1308
1195
|
const { props, context, tDateProfile, slotWidth } = this;
|
|
@@ -1349,7 +1236,7 @@ class TimelineView extends DateComponent {
|
|
|
1349
1236
|
}
|
|
1350
1237
|
}
|
|
1351
1238
|
|
|
1352
|
-
var css_248z = ".fc-timeline-slots{z-index:1}.fc-timeline-
|
|
1239
|
+
var css_248z = ".fc-timeline-slots{z-index:1}.fc-timeline-events{position:relative;z-index:2}.fc-timeline-slot-minor{border-style:dotted}.fc-timeline-events-overlap-enabled{padding-bottom:10px}.fc-timeline-event{border-radius:0;font-size:var(--fc-small-font-size);margin-bottom:1px}.fc-direction-ltr .fc-timeline-event.fc-event-end{margin-right:1px}.fc-direction-rtl .fc-timeline-event.fc-event-end{margin-left:1px}.fc-timeline-event .fc-event-inner{align-items:center;display:flex;flex-direction:row;padding:2px 1px}.fc-timeline-event-spacious .fc-event-inner{padding-bottom:5px;padding-top:5px}.fc-timeline-event .fc-event-time{font-weight:700}.fc-timeline-event .fc-event-time,.fc-timeline-event .fc-event-title{padding:0 2px}.fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-color:transparent #000;border-style:solid;border-width:5px;content:\"\";flex-grow:0;flex-shrink:0;height:0;margin:0 1px;opacity:.5;width:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before,.fc-direction-rtl .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after{border-left:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-direction-rtl .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-right:0}.fc-timeline-more-link{align-items:flex-start;background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;display:flex;flex-direction:column;font-size:var(--fc-small-font-size);padding:1px}.fc-direction-ltr .fc-timeline-more-link{margin-right:1px}.fc-direction-rtl .fc-timeline-more-link{margin-left:1px}.fc-timeline-more-link-inner{padding:2px}.fc-timeline-now-indicator-container{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;z-index:4}.fc-timeline-now-indicator-arrow{border-bottom-style:solid;border-bottom-width:0;border-color:var(--fc-now-indicator-color);border-left:5px solid transparent;border-right:5px solid transparent;border-top-style:solid;border-top-width:6px;height:0;margin:0 -5px;position:absolute;top:0;width:0}.fc-timeline-now-indicator-line{border-left:1px solid var(--fc-now-indicator-color);bottom:0;position:absolute;top:0}";
|
|
1353
1240
|
injectStyles(css_248z);
|
|
1354
1241
|
|
|
1355
|
-
export { TimelineHeaderRow, TimelineLane, TimelineLaneBg, TimelineLaneSlicer, TimelineNowIndicatorArrow, TimelineNowIndicatorLine, TimelineSlats, TimelineView, buildTimelineDateProfile, computeSlotWidth,
|
|
1242
|
+
export { TimelineHeaderRow, TimelineLane, TimelineLaneBg, TimelineLaneSlicer, TimelineNowIndicatorArrow, TimelineNowIndicatorLine, TimelineSlats, TimelineView, buildTimelineDateProfile, computeSlotWidth, createHorizontalStyle, createVerticalStyle, timeToCoord };
|