瀏覽代碼

fix week numbers showing up when they shouldnt

Adam Shaw 5 年之前
父節點
當前提交
4d043cd188

+ 2 - 0
packages/daygrid/src/DayTable.tsx

@@ -36,6 +36,7 @@ export interface DayTableProps {
   dayMaxEvents: boolean | number
   dayMaxEvents: boolean | number
   dayMaxEventRows: boolean | number
   dayMaxEventRows: boolean | number
   expandRows: boolean
   expandRows: boolean
+  showWeekNumbers: boolean
   headerAlignElRef?: RefObject<HTMLElement> // for more popover alignment
   headerAlignElRef?: RefObject<HTMLElement> // for more popover alignment
   clientWidth: number | null
   clientWidth: number | null
   clientHeight: number | null
   clientHeight: number | null
@@ -62,6 +63,7 @@ export default class DayTable extends DateComponent<DayTableProps, ComponentCont
         renderRowIntro={props.renderRowIntro}
         renderRowIntro={props.renderRowIntro}
         dayMaxEvents={props.dayMaxEvents}
         dayMaxEvents={props.dayMaxEvents}
         dayMaxEventRows={props.dayMaxEventRows}
         dayMaxEventRows={props.dayMaxEventRows}
+        showWeekNumbers={props.showWeekNumbers}
         expandRows={props.expandRows}
         expandRows={props.expandRows}
         headerAlignElRef={props.headerAlignElRef}
         headerAlignElRef={props.headerAlignElRef}
         clientWidth={props.clientWidth}
         clientWidth={props.clientWidth}

+ 1 - 0
packages/daygrid/src/DayTableView.tsx

@@ -51,6 +51,7 @@ export default class DayTableView extends TableView {
         tableMinWidth={contentArg.tableMinWidth}
         tableMinWidth={contentArg.tableMinWidth}
         dayMaxEvents={options.dayMaxEvents}
         dayMaxEvents={options.dayMaxEvents}
         dayMaxEventRows={options.dayMaxEventRows}
         dayMaxEventRows={options.dayMaxEventRows}
+        showWeekNumbers={options.weekNumbers}
         expandRows={!props.isHeightAuto}
         expandRows={!props.isHeightAuto}
         headerAlignElRef={this.headerElRef}
         headerAlignElRef={this.headerElRef}
         clientWidth={contentArg.clientWidth}
         clientWidth={contentArg.clientWidth}

+ 2 - 0
packages/daygrid/src/Table.tsx

@@ -32,6 +32,7 @@ export interface TableProps {
   colGroupNode: VNode
   colGroupNode: VNode
   tableMinWidth: CssDimValue
   tableMinWidth: CssDimValue
   expandRows: boolean
   expandRows: boolean
+  showWeekNumbers: boolean
   clientWidth: number | null
   clientWidth: number | null
   clientHeight: number | null
   clientHeight: number | null
   businessHourSegs: TableSeg[]
   businessHourSegs: TableSeg[]
@@ -114,6 +115,7 @@ export default class Table extends DateComponent<TableProps, TableState> {
                       : row // in case there are no cells (like when resource view is loading)
                       : row // in case there are no cells (like when resource view is loading)
                   }
                   }
                   showDayNumbers={rowCnt > 1}
                   showDayNumbers={rowCnt > 1}
+                  showWeekNumbers={props.showWeekNumbers}
                   todayRange={todayRange}
                   todayRange={todayRange}
                   dateProfile={props.dateProfile}
                   dateProfile={props.dateProfile}
                   cells={cells}
                   cells={cells}

+ 2 - 1
packages/daygrid/src/TableRow.tsx

@@ -42,6 +42,7 @@ export interface TableRowProps {
   dateProfile: DateProfile
   dateProfile: DateProfile
   todayRange: DateRange
   todayRange: DateRange
   showDayNumbers: boolean
   showDayNumbers: boolean
+  showWeekNumbers: boolean
   buildMoreLinkText: (num: number) => string
   buildMoreLinkText: (num: number) => string
   innerHeight?: number
   innerHeight?: number
 }
 }
@@ -110,7 +111,7 @@ export default class TableRow extends DateComponent<TableRowProps, TableRowState
             false // date-selecting (because mirror is never drawn for date selection)
             false // date-selecting (because mirror is never drawn for date selection)
           )
           )
 
 
-          let showWeekNumber = context.options.weekNumbers && col === 0
+          let showWeekNumber = props.showWeekNumbers && col === 0
 
 
           return (
           return (
             <TableCell
             <TableCell

+ 1 - 0
packages/timegrid/src/DayTimeColsView.tsx

@@ -49,6 +49,7 @@ export default class DayTimeColsView extends TimeColsView {
         tableMinWidth={contentArg.tableMinWidth}
         tableMinWidth={contentArg.tableMinWidth}
         colGroupNode={contentArg.tableColGroupNode}
         colGroupNode={contentArg.tableColGroupNode}
         renderRowIntro={dayMinWidth ? null : this.renderTableRowAxis}
         renderRowIntro={dayMinWidth ? null : this.renderTableRowAxis}
+        showWeekNumbers={false}
         expandRows={false}
         expandRows={false}
         headerAlignElRef={this.headerElRef}
         headerAlignElRef={this.headerElRef}
         clientWidth={contentArg.clientWidth}
         clientWidth={contentArg.clientWidth}