Skip to content

v2.1.0 — New MWeekGrid

Choose a tag to compare

@Banzamel Banzamel released this 30 Jun 20:05
· 28 commits to main since this release

Minor release. One new component lands in the data group: MWeekGrid. Designed for the recurring "show a week × hour heatmap of availability / attendance / bookings / opening hours" use case that consumer projects kept reimplementing by hand. Now it ships in the framework, in both Basic and Pro.

What's new

  • MWeekGrid — rows are days, columns are slots (hours of day by default). Cells colour-shade across four discrete density bands derived from value / max. Tooltip per cell with the day / slot / value triple; click handler optional; both renderCell and renderTooltip accept custom replacements for richer content (badges, icons, multi-line tooltips).
  • Accepts data as either a 2D matrix indexed [day][slot] or a sparse list of {day, slot, value} cells — pick whichever shape the source data already has.
  • Optional header slots above the grid (title, description, hint, peakLabel); optional legend below (None / Few / Some / Many with overrideable labels and unit).
  • days and slots default to 7 and 24 but accept any positive integer — same component for attendance grids, shift planners, opening-hours density, page-view heatmaps.
  • color follows the shared MColor axis. weekStart (0 = Sunday first, 1 = Monday first) only reorders visual rows — data is always indexed by calendar day matching Date.getDay().

Action required for consumers

  • None. This is purely additive. Pull 2.1.0 and the new component is available immediately. No existing API changed.

Where to look

  • Live docs + playground: /docs/week-grid
  • Source: mineralui/src/components/data/MWeekGrid/
  • Re-exported from @banzamel/mineralui/data (Basic) and @banzamel/mineralui-pro/data (Pro).