Repository navigation
Releases: Bosun18/tui-datatable
Release list
v0.2.1
No code changed. The only difference is the symfony/tui constraint,
which is now ~8.1.5 instead of ^8.1.
The floor moved because of a bug in the component rather than one here.
Up to 8.1.4 truncateToWidth() measured a tab as one column while the
rest of the component drew it as three, so a cell holding a tab came
back wider than the column it had been cut for and pushed everything to
its right out of line. 8.1.5 fixes it, and the regression test added
here only passes from that version on.
The ceiling is the half the README has claimed since 0.1.0 while the
constraint never enforced it. The component is experimental, so 8.2 can
change the API with no deprecation cycle, and a composer update is not
how you want to find that out. When 8.2 lands I will run the package
against it and tag a release.
Upgrading from 0.2.0 needs nothing, unless you are on symfony/tui below
8.1.5 — Composer will simply keep you on 0.2.0 until you move up.
v0.2.0
The table used to ignore the height it was given. It returned maxVisible rows plus a header and an indicator whatever the terminal was, so at stty rows 10 a table built for 15 rows produced 17 lines and pushed its own header off the screen. The layout engine pads short output but never trims long output, so staying inside the height is the widget's job. That is fixed, and expandVertically(true) goes further: the table takes the height the layout gives it and shares the screen with a status line or a hint. It is off by default. While expansion is on, maxVisible is ignored rather than acting as a ceiling — a table quietly showing ten rows after you asked it to fill the screen is the worse surprise.
setEmptyText() and setNoMatchText() replace the two hardcoded English lines, so a table in a Russian interface stops saying "No rows". getColumns() and getVisibleRowCount() hand back state the widget already had: without them a caller rebuilds its own map of keys to headers, and catches the row count from FilterChangeEvent to keep it in a variable.
setMaxVisible() changes the fixed window after construction. Paging now moves by the window that was last drawn, not by maxVisible, which only matters once the height comes from the layout.
Upgrading from 0.1.x needs no changes: everything here is additive, and the height cap only removes lines that were overflowing the terminal anyway.
v0.1.1
Documentation only, no code changed.
The links to examples/ pointed at files that are not in the Composer archive, so they are absolute GitHub links now. onInput() was missing entirely even though it is the only way to bind your own key or hand typing over to an InputWidget. The Keybindings snippet showed that an entry replaces an action without saying so. Sorting warned about '10kb' and dates but not about anything outside ASCII, where <=> compares bytes and Cyrillic sorts after Latin.
examples/artisan-command.php sketches the framework side: one query, raw values in the cells with formatting on the way out, and where control returns to the command after Tui::run().
Everything here came from actually using the package in an application rather than from reading the code again.
v0.1.0
First release. A TableWidget for symfony/tui: a header, a scroll window that keeps the selected row centred, and a (current/total) indicator once rows go off screen.
Columns pin a width or take what is left, align left, right or centre, and can format a cell before it is drawn. Sorting is stable, cycles ascending, descending and off on the column under the cursor, and takes a custom comparator when <=> gets it wrong. Filtering takes a string, matched against the text a column displays, or a predicate over the raw row; both run on top of the original array, which is never mutated.
Navigation, selection, sorting and filtering each dispatch an event, and the keybindings can be swapped through the constructor.
Requires PHP 8.4.1 and symfony/tui ^8.1. The upstream component is experimental, so treat the pin seriously. Mouse support waits for mouse events to land in the core.