|
@@ -1,6 +1,5 @@
|
|
|
import { rangeContainsMarker, DateRange } from '../datelib/date-range'
|
|
import { rangeContainsMarker, DateRange } from '../datelib/date-range'
|
|
|
import { getDayClassNames, getDayMeta } from '../component/date-rendering'
|
|
import { getDayClassNames, getDayMeta } from '../component/date-rendering'
|
|
|
-import GotoAnchor from './GotoAnchor'
|
|
|
|
|
import { DateMarker } from '../datelib/marker'
|
|
import { DateMarker } from '../datelib/marker'
|
|
|
import { DateProfile } from '../DateProfileGenerator'
|
|
import { DateProfile } from '../DateProfileGenerator'
|
|
|
import ComponentContext from '../component/ComponentContext'
|
|
import ComponentContext from '../component/ComponentContext'
|
|
@@ -9,6 +8,7 @@ import { __assign } from 'tslib'
|
|
|
import { DateFormatter, formatDayString } from '../datelib/formatting'
|
|
import { DateFormatter, formatDayString } from '../datelib/formatting'
|
|
|
import { BaseComponent } from '../vdom-util'
|
|
import { BaseComponent } from '../vdom-util'
|
|
|
import { RenderHook } from './render-hook'
|
|
import { RenderHook } from './render-hook'
|
|
|
|
|
+import { buildNavLinkData } from './nav-link'
|
|
|
|
|
|
|
|
|
|
|
|
|
export interface TableDateCellProps {
|
|
export interface TableDateCellProps {
|
|
@@ -69,16 +69,18 @@ export default class TableDateCell extends BaseComponent<TableDateCellProps> { /
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// if colCnt is 1, we are already in a day-view and don't need a navlink
|
|
// if colCnt is 1, we are already in a day-view and don't need a navlink
|
|
|
|
|
+ let navLinkData = (options.navLinks && isDateValid && isDateDistinct && props.colCnt > 1)
|
|
|
|
|
+ ? buildNavLinkData(date)
|
|
|
|
|
+ : null
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<RenderHook name='dateHeader' mountProps={mountProps} dynamicProps={dynamicProps}>
|
|
<RenderHook name='dateHeader' mountProps={mountProps} dynamicProps={dynamicProps}>
|
|
|
{(rootElRef, customClassNames, innerElRef, innerContent) => (
|
|
{(rootElRef, customClassNames, innerElRef, innerContent) => (
|
|
|
<th class={classNames.concat(customClassNames).join(' ')} {...attrs} ref={rootElRef}>
|
|
<th class={classNames.concat(customClassNames).join(' ')} {...attrs} ref={rootElRef}>
|
|
|
{isDateValid &&
|
|
{isDateValid &&
|
|
|
- <GotoAnchor
|
|
|
|
|
- navLinks={options.navLinks}
|
|
|
|
|
- gotoOptions={{ date, forceOff: isDateValid && (!isDateDistinct || props.colCnt === 1) }}
|
|
|
|
|
- >{innerText}</GotoAnchor>
|
|
|
|
|
|
|
+ <a data-navlink={navLinkData}>
|
|
|
|
|
+ {innerText}
|
|
|
|
|
+ </a>
|
|
|
}
|
|
}
|
|
|
{innerContent &&
|
|
{innerContent &&
|
|
|
<div class='date-header-misc' ref={innerElRef}>{innerContent}</div>
|
|
<div class='date-header-misc' ref={innerElRef}>{innerContent}</div>
|