@gridkitjs/dom v0.1.0
Minor Changes#
- da4fbda:
bodyCellFrom,groupRowFromandbodyRowFromturn a delegated body event's target into the data cell, group-header row or body row it addresses, by the grid'sdata-gridkit-*attributes. - da4fbda:
startColumnResizeGesture(handle, press, session, { onMove, onEnd, onCancel })drags a column's edge with the pointer captured, reporting each width,onEnd(null)for a click that resized nothing, andonCancelon Escape. Only the main button of the primary pointer starts it.measureColumnContent(table, columnId)measures the width a column's widest rendered cell needs. - da4fbda:
startDragReorder(id, grabElement, press, { resolveTarget, onState, onDrop })runs a reorder drag: a 4-pixel threshold before it opens, the ghost'stransform, and the drop target on every move, reported throughonStateand reset toNO_DRAGwhen it ends. Only the main button of the primary pointer starts one.resolveColumnDropTargetandresolveGroupByDropTargethit-test the grid's headers and group-by bar. - da4fbda:
observeElementWidth(element, onWidth)reports an element'sclientWidthat once and on every change, and returns the function that disconnects it. - da4fbda:
createGridFocus({ rowCount, columnCount, isSkippableRow, virtualRange })keeps a grid's single tab stop:getFocus,subscribe,focusCell,handleKey(key, modifiers, pageSize)for the navigation keys,attachto the rendered rows, andfocusDrawnCellto move the browser's focus once a move is drawn — scrolling a virtualized row into range first.findBodyRowandmeasurePageSizeread the grid's markup. - da4fbda:
attachInfiniteScroll(root, { sentinel, hasMore, onLoadMore, isLoadingMore, rootMargin })callsonLoadMoreas the sentinel nears the bottom ofroot, once per approach until a load in flight finishes, and returnsupdateanddetach. - da4fbda:
createLiveAnnouncer(container?)adds a visually hidden, polite live region (role="status", classgridkit-sr-only) and returnsannounce(text)anddestroy(). Announcing the same text twice in a row reads it out twice. - da4fbda:
attachOverlay(anchor, panel, { placement, gap, onDismiss, returnFocusTo })positions a panel beside an element or a point — flipping to the other side or edge when it would run off screen — moves focus into it, and reportsonDismisson Escape, a pointer down outside it, a scroll, a resize or focus leaving it. Detaching returns focus.placeOverlayis the placement arithmetic on its own. - da4fbda: New package:
@gridkitjs/dom, the browser behaviours a GridKit renderer attaches to its own markup — pointer gestures, focus movement, observers, row virtualization, overlays and a live-region announcer — as framework-free TypeScript. You only need it to write a renderer;@gridkitjs/reactdepends on it already. - da4fbda:
createRowVirtualizer(scrollElement, { estimatedRowHeight, overscan, onRange })windows rows of any height down to those near the scroll position, measuring each mounted row, and reports the window throughonRangeonly when it moves. It hassetRowCount,resetHeights,measureRow(index)ref callbacks,scrollToIndex(which corrects itself once an unmounted target mounts) anddestroy.
Patch Changes#
- Updated dependencies [78e10e5]
- Updated dependencies [6af35c6]
- Updated dependencies [6af35c6]
- Updated dependencies [bad8ea3]
- Updated dependencies [bad8ea3]
- Updated dependencies [78e10e5]
- Updated dependencies [44759b4]
- Updated dependencies [bad8ea3]
- Updated dependencies [8d411eb]
- Updated dependencies [bad8ea3]
- Updated dependencies [78e10e5]
- Updated dependencies [44759b4]
- Updated dependencies [bad8ea3]
- Updated dependencies [8d411eb]
- @gridkitjs/core@0.11.0