Composable selectors for addressing table cells independently of rendering.
Types
CellAddress = object section*: TableSection rowIndex*: int columnIndex*: int
- Stable model address returned by matchingCells.
CellContext = object section*: TableSection rowIndex*: int columnIndex*: int cell*: Cell
- Read-only information supplied to predicate selectors.
CellModifier = proc (cell: var Cell) {.closure.}
CellPredicate = proc (context: CellContext): bool {.closure.}
Selector = object
- A reusable predicate over header, body, and footer cells.
TableSection = enum sectionHeader, sectionBody, sectionFooter
- A selectable fixed-grid section.
Procs
proc allCellsSelector(): Selector {....raises: [ValueError], tags: [], forbids: [].}
- Selects header, body, and footer cells.
proc apply(table: var Table; selector: Selector; modifier: CellModifier) {. ...raises: [ValueError, Exception], tags: [RootEffect], forbids: [].}
- Applies modifier once to every selected cell.
proc cellSelector(rowIndex, columnIndex: Natural): Selector {. ...raises: [ValueError], tags: [], forbids: [].}
- Selects one body cell.
proc columnSelector(columnIndex: Natural): Selector {....raises: [ValueError], tags: [], forbids: [].}
- Selects one column in the header, body, and footer.
proc headerSelector(): Selector {....raises: [ValueError], tags: [], forbids: [].}
- Selects every header cell.
proc matchingCells(table: Table; selector: Selector): seq[CellAddress] {. ...raises: [ValueError, Exception], tags: [RootEffect], forbids: [].}
- Returns matching model addresses in header/body/footer order.
proc predicateSelector(predicate: CellPredicate): Selector {. ...raises: [ValueError], tags: [], forbids: [].}
- Selects every cell for which predicate returns true.
proc rowSelector(rowIndex: Natural): Selector {....raises: [ValueError], tags: [], forbids: [].}
- Selects one zero-based body row.
proc segmentSelector(firstRow, firstColumn, lastRow, lastColumn: Natural): Selector {. ...raises: [ValueError], tags: [], forbids: [].}
- Selects an inclusive rectangular body segment.
Exports
-
addRow, roundedTheme, setFooter, cell, initTableMargin, addRow, initTable, OverflowMode, initCellPadding, row, setSpan, cell, initTable, setAlignment, setTitle, psqlTheme, contentWidth, setVerticalAlignment, clearFooter, markdownTheme, TableTheme, headerCell, Column, Table, columnCount, PanelPosition, CellPadding, maximumWidth, addPanel, Panel, panel, setVerticalAlignment, fixedWidth, setHeader, setPadding, Cell, VerticalAlignment, column, WidthKind, clearTitle, percentageWidth, customTheme, row, initRow, initColumn, setWidthPriority, Shadow, initCell, initShadow, setVerticalAlignment, footerCell, setAlignment, modernTheme, WidthConstraint, Row, minimumWidth, setAlignment, setPadding, TableMargin, column, borderlessTheme, setPadding, asciiTheme, clearHeader, BorderSet, clearSpan