@dzgrid/core
v1.3.0
Published
Data grid model, from scratch: typed row identities, calendar days kept apart from instants, sorting and filtering. No DOM, no framework, no Date, no dependency.
Maintainers
Readme
@dzgrid/core
The model of DzGrid, a data grid written from scratch: typed row
identities, calendar days kept apart from instants, sorting, filtering, quick search, selection, paging, server
rows. No DOM, no framework, no Date, no dependency: the same results in Node and in the browser.
Most applications install it beside @dzgrid/dom, which draws the
grid; the core alone serves a server, a test or another renderer.
Install
npm install @dzgrid/coreA first use
import { parseDay, zoneDayBounds } from '@dzgrid/core';
const day = parseDay('2026-03-05'); // a calendar day, never a Date
if (day) {
const { from, to } = zoneDayBounds(day, 'Africa/Algiers'); // that day in that zone, half-open, in ms
console.log(from, to);
}Rows from a server, with a request gate that shows only the answer to the last request:
import { sourceRows } from '@dzgrid/core/server';
const source = sourceRows({ fetch: (req) => api.patients(req) }); // req: filters, sort, page, abort signalDocumentation
- The project's README: what DzGrid is, every entry and its size.
- Behaviour sheets: one per behaviour, with its tests.
- Changelog.
MIT licence.
