Repository navigation
v0.159.0
Minor Changes
-
#1305
74630ba1Thanks @tenphi! - DataTable: column reordering.isColumnReorderablelets a user drag a header
sideways or move the focused column withAlt+←/→; clicking still sorts
and the resize handle still resizes.columnOrder/defaultColumnOrder/
onColumnOrderChangework with or without dragging, so a column manager
elsewhere in the page can drive the order on its own, andstorageKeynow
persists the order alongside the widths.Structural and pinned columns stay put —
pinis already the ordering authority
for a pinned column — and a single column opts out withisReorderable: false.
A stale order is safe: unknown keys are ignored, and a column missing from the
list lands after the neighbour it had incolumnsrather than at the end. -
#1305
74630ba1Thanks @tenphi! - DataTable:rowSizesets the row height to a named step —small28px,
medium32px,large40px. It moves the rows only: the header keeps answering
tosize, so a denser body no longer means reaching forsizeand dragging the
header down with it.Unset, the height comes from
sizeexactly as before, so nothing changes for
existing tables.rowHeightstill wins when an exact pixel value is needed. -
#1305
74630ba1Thanks @tenphi! - DataTable, ItemTable: add a built-in column menu. A column exposes one
throughheader.menu, opened from a⋮trigger in the header, by right-click,
or with Shift+F10 —columnContextMenupicks which of those surfaces are live.
The pressed key comes back throughheader.onMenuActionand then
onColumnMenuAction(action, columnKey), as written and without React's `.# @cube-dev/ui-kit
prefix, so the menu's contents stay entirely the consumer's.Sorting is the one thing the table knows how to do itself, so the reserved keys
sort-asc,sort-descandclear-sortare labelled, disabled when they would
do nothing, and applied before the consumer hears about them.columnSortMenu()
returns those items ready to drop intoheader.menu.Also fixes
isMenuEmptyso an empty fragment counts as an empty menu, which is
the shape a conditionally-assembledrowMenuorheader.menuproduces — such a
menu now renders no trigger instead of one that opens nothing. -
#1305
74630ba1Thanks @tenphi! - DataTable, ItemTable: per-column adaptive colors.column.colortakes a
palette theme name ('success'), any CSS color, a{ hue, saturation }seed, or
a{ fill, text }pair for full manual control. Everything but the last is
derived: only the hue and saturation are kept, and the tone ramp plus an
AA/AAAtext floor are re-solved per color scheme — so a tinted column stays
readable in light, dark and high contrast without the caller checking.
column.colorScopenarrows it to any ofheader/body/totals.Row banding survives inside a tinted column: the tint carries its own band one
tone step away, so the stripe still reads down the column instead of being
painted over.New:
useColorTheme(config)/getColorTheme(config)build an adaptive
mini-theme from a hue at runtime and name it by a hash of its config, so every
component asking for the same color shares one global token injection. Also
exportscolorThemeSeed(color)for the hue/saturation of a color. -
#1305
74630ba1Thanks @tenphi! - DataTable, ItemTable: the sort indicator is now Tabler's narrow arrow rather
than a chevron —ArrowNarrowUpIconfor ascending,ArrowNarrowDownIconfor
descending. Both are also exported for use elsewhere.The descending state renders the real down arrow instead of flipping the up one
with a transform, so the glyph is always the one Tabler drew.
Patch Changes
-
#1305
74630ba1Thanks @tenphi! - DataTable, ItemTable: a sortable header now previews its sort arrow. Hovering
or keyboard-focusing a sortable column fades the arrow in at 40%, pointing the
way a press would sort it; pressing it makes the arrow solid, and it stays solid
once the pointer leaves. Previously a sortable column looked identical to a
non-sortable one until it was already sorted.The arrow keeps its slot throughout, so nothing shifts, and a non-sortable column
still has no arrow. -
#1305
74630ba1Thanks @tenphi! - ItemTable, DataTable: stories no longer turn sorting on behind your back.Both shared story fixtures marked every column
isSortable: true, so all 15
DataTablestories and everyItemTablestory rendered clickable headers with
hover affordances — includingDefault, which is where people go to learn what
the component does without configuration. Sorting is opt in per column, so those
stories were showing the opposite of the default.The fixtures are now plain, and the stories that are actually about sorting use
an explicitSORTABLE_COLUMNS. -
#1305
74630ba1Thanks @tenphi! - ItemTable, DataTable: correct theisSortabledocumentation. It read
@default true, which was never what the code did —TableViewrequires
isSortable === truebefore a header becomes a control at all, so sorting is
opt in per column and a table with no sortable column has inert headers.Adds the pattern most lists actually want, which had no story: a fixed order the
user cannot change, viasortMode="client"with asortand no sortable
column.sortModehas to be explicit there — left to default it resolves to
'off'when nothing is sortable, and asortprop alone sorts nothing.Also documents
ItemTable's column-menu props, and adds aDataTablestory for
the query-results layout: pagination off, footer slots in its place, and a
tighter.5xfooter. -
#1305
74630ba1Thanks @tenphi! - DataTable, ItemTable: resizing a column no longer moves its neighbours.A column with no explicit width is
flex: 1and shares the leftover space.
Resizing made only the dragged column fixed, leaving every other one in the flex
pool to re-split a leftover that had just changed — so dragging one divider
resized all of them, including columns to the left of the handle. Dragging a
column by +8px measurably took 3px off each of the other three.Every column is now frozen at its current width when a drag starts, so the drag
changes exactly one. Columns after it are pushed along and the table grows or
shrinks, rather than the neighbours absorbing the difference. -
#1308
82306d62Thanks @tenphi! -Item,Button: show the tooltip while the element is disabled, and stop putting the native
disabledattribute on elements that cannot carry it.A tooltip on a disabled control is usually where the reason for being unavailable is written, but
browsers do not dispatch mouse events on elements carrying the nativedisabledattribute, so the
hover that opens the tooltip never arrived. What a disabledButtondid instead was rely on a
quirk: Chromium still delivers pointer events to a natively disabled control, so the tooltip
opened there and nowhere else — not on a fallback to mouse events, and not under test.Itemhad
it worse, since it also set the attribute on whatever it rendered — adivor anliin most
cases, where it is invalid markup that only got in the way. When such an element has a tooltip that
can open, the disabled state now reaches the DOM as
aria-disabled="true"instead, and the element is kept inert by hand: activation handlers are
dropped and clicks (including the ones Enter and Space produce) do nothing, soonPress/onClick
stay silent and asubmitbutton no longer submits its form. Such an element stays in the tab
order, so keyboard users can focus it and read the tooltip too.Nothing changes for a disabled element without a tooltip: a
Button,ItemButton, orItem
rendered as a form control keeps the native attribute. A disabledItemthat is not a form control
does become inert, though — until now the attribute it carried did nothing there, so handlers passed
to it still ran.Three related fixes come with it: a
Buttonrendered as a link (to) is now announced as disabled
througharia-disabled— it previously had no accessible disabled state at all, only an invalid
disabledattribute on the anchor;Itemnow treats adisabledprop as an alias ofisDisabled
rather than letting it overwrite what the component decided; andItemTable'sdisabledTooltipfor
a bulk action reaches the user, which it could not while the button was natively disabled.