Repository navigation
kerusiweb 2.3.0
Added
-
Custom seat content (#26). React takes a
renderSeatprop and Angular an
<ng-template kerusiSeat let-seat>placed inside<kerusi-seatmap>; either
draws the inside of every seat in place of the stock glyph. The library keeps
each seat's<g>(role, ARIA state, tab stop, rotation, event handlers), so
keyboard navigation, selection and announcements are unchanged whatever is
drawn. The template receives the seat, whether it is selected, the stock
glyph's resolved paths and paints, and the stock drawing itself
(defaultContent) to keep or add to. Angular templates must prefix their
elements withsvg:. -
A focus outline for custom seats. While a seat template is in use, the
library draws.kerusi-seat__focus, an outline of the seat's body, over the
custom content, visible only on:focus-visibleand coloured like the stock
ring. Custom content may have no.kerusi-seat__boxfor the stock ring to
stroke, so this keeps keyboard focus visible (WCAG 2.4.7). Without a seat
template it is not rendered and the markup is unchanged. -
resolveSeatGlyph()in@kerusiweb/corereturns every path, paint and
position of the stock seat (SeatGlyph), plusseatClassName()and the
KerusiSeatContexttype both bindings' template contexts extend. Both
section components now bind this one object instead of calling the paint and
shape functions one by one, and each binding's copy of the selected seat's
mark-box rule is gone. The rendered SVG is unchanged. -
Both demos gain a "Custom seat template" toggle that draws round seats from
the glyph's paints, keeping the stock status marks. -
Per-seat CSS hooks (#26). Every seat's
<g>now carriesdata-seat-type,
data-seat-status,data-section-idand, when the document gives them,
data-seat-rowanddata-seat-attributes(space-separated, for
[data-seat-attributes~="aisle"]). Two per-seat tokens,--kerusi-seat-fill
and--kerusi-seat-label, set on a seat selector, replace that seat's own
colour without!important. They never reach a selected or blocked seat, and
held and booked seats keep their wash and occupant figure, so status still
reads. Legend type items carry the samedata-seat-typeand their swatches
read the same token, so one rule recolours the seats and the key together. -
seatStyleandseatTypeStyles(#26), on both bindings. A
KerusiSeatStylesets a seat'sfill,labelColorand extraclassName
from code: per type throughseatTypeStyles(which the legend shows too), per
seat through aseatStyle(seat, { selected })function laid over it field by
field. A style takes the same slot asSeatType.color, below a stylesheet's
--kerusi-seat-fill, and never reaches a selected or blocked seat. A hex
fillgets a readable black or white label unlesslabelColorsays
otherwise. Core addsresolveSeatStyle(),isHexColor(), and an optional
trailingstyleargument onseatFill,seatTextFill,resolveSeatGlyph
and the legend swatch helpers. Both demos gain "Aisle seats via CSS" and
"Gold premium seats" toggles. -
Seat shapes (#26).
KerusiSeatStyle.shapetakes'seat'(the default
tapered outline),'square','rounded','circle', or a function returning
a pathdfor a box. The wash, the selected frame and core, and a seat
template's focus outline follow it; the occupant figure and wheelchair marker
stay inside every preset (the marker moves in on a circle). A type styled with
a shape is keyed with it in the legend. Core addsseatShapePath(),
seatMarkerAnchor(),legendSwatchPath()and theKerusiSeatShapeand
SeatBoxtypes. Both demos gain a "Circle seat shape" toggle.
Changed
SeatType.colorcan now be overridden per seat. It still has no theme
token, but--kerusi-seat-fillset on a seat selector replaces it for the
seats that selector matches.- Seat markup. An unselected, unblocked seat's fill is now emitted as
var(--kerusi-seat-fill, <its colour>)and its label as
var(--kerusi-seat-label, <its colour>), alongside the newdata-*
attributes. Nothing looks different, but a test that snapshots the SVG will
see the change.legendSwatchFill()andlegendSwatchText()in core now
compute the legend's type swatches for both bindings.