Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
7 changed files
with
557 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package table | ||
|
||
// renderHint has hints for the Render*() logic | ||
type renderHint struct { | ||
isAutoIndexColumn bool // auto-index column? | ||
isAutoIndexRow bool // auto-index row? | ||
isBorderBottom bool // bottom-border? | ||
isBorderTop bool // top-border? | ||
isFirstRow bool // first-row of header/footer/regular-rows? | ||
isFooterRow bool // footer row? | ||
isHeaderRow bool // header row? | ||
isLastLineOfRow bool // last-line of the current row? | ||
isLastRow bool // last-row of header/footer/regular-rows? | ||
isSeparatorRow bool // separator row? | ||
rowLineNumber int // the line number for a multi-line row | ||
rowNumber int // the row number/index | ||
} | ||
|
||
func (h *renderHint) isRegularRow() bool { | ||
return !h.isHeaderRow && !h.isFooterRow | ||
} | ||
|
||
func (h *renderHint) isRegularNonSeparatorRow() bool { | ||
return !h.isHeaderRow && !h.isFooterRow && !h.isSeparatorRow | ||
} | ||
|
||
func (h *renderHint) isHeaderOrFooterSeparator() bool { | ||
return h.isSeparatorRow && !h.isBorderBottom && !h.isBorderTop && | ||
((h.isHeaderRow && !h.isLastRow) || (h.isFooterRow && (!h.isFirstRow || h.rowNumber > 0))) | ||
} | ||
|
||
func (h *renderHint) isLastLineOfLastRow() bool { | ||
return h.isLastLineOfRow && h.isLastRow | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.