Skip to content

Home > @liquidrazor/list-display

list-display package

Functions

Function

Description

applyFilters(rows, ctx)

Applies filters to a list of rows and returns the filtered array.

applyPagination(rows, pagination)

Slices the rows according to the pagination state.

applyPatch(rows, patch, idKey)

Applies a single data patch to the current list of rows.

applyPatches(rows, patches, idKey)

Applies a list of patches in order.

applySorting(rows, ctx)

Applies sorting to a list of rows.

buildFilterPredicate(ctx)

Builds a predicate that evaluates whether a row passes all active filters.

buildSnapshot(state)

Builds an immutable snapshot of the current list state.

clearActiveAction(prev)

clearSelection(selection)

closeModal(prev)

createInitialUiState()

createQuerySource(options)

Creates a query-based data source (single-shot load + optional refresh).

createSelectionState(mode)

Initializes a selection state.

createStaticSource(options)

Creates a simple, static data source that just returns an initial snapshot of rows and does not stream patches.

createStreamSource(options)

Creates a streaming data source (e.g. SSE, WebSocket, RTSK, NDJSON).

getRowId(row, idKey)

Extracts the id from a row based on the configured idKey.

isRowSelected(row, selection, ctx)

ListHeader({ fields, hasRowActions, })

openModalForAction(prev, actionId, type, rowId)

selectAllVisible(visibleRows, selection, ctx)

toggleRowSelection(row, selection, ctx)

updatePaginationMeta(pagination, totalItems)

Recomputes pagination metadata based on the current rows.

useListCore(config)

Core hook that encapsulates the data-management logic for ListDisplay. It wires a DataSource, schema metadata, and optional actions into a cohesive state machine that can be consumed by UI components.

Interfaces

Interface

Description

ActionContextBase

ActiveActionState

Tracks which action is currently active in the UI, optionally tied to a row.

CellRenderContext

ConfirmModalConfig

Configuration for the built-in confirmation modal used by actions that need a simple yes/no flow.

ConfirmModalProps

CustomModalConfig

Configuration for a user-supplied modal renderer, allowing bespoke flows while still participating in the ListDisplay action lifecycle.

CustomModalRenderContext

Context provided to a custom modal renderer. Extends general context and optionally carries row info.

DataSource

Generic, technology-agnostic data source contract. Wraps parent-provided data, streams, queries etc.

DataSourceInitResult

DataSourceMeta

FieldFilterConfig

Per-field filter configuration.

FieldSchema

Column/field definition for the list.

FilterContext

FilterOption

Option used by select-based filters.

FiltersPanelProps

Props for the filters panel slot. This component is expected to surface controls for adjusting the active filter set.

GeneralAction

GeneralActionContext

ListActionBase

ListBodyProps

ListCellProps

ListComponents

Mapping of overridable UI components ("slots"). Relaxed typing here since you control any overrides.

ListConfig

Public configuration accepted by ListDisplay.

ListContainerProps

ListHeaderProps

ListRowProps

ListSnapshot

Exported snapshot of the list, meant to be consumed by the parent only on demand (not continuously controlled).

ListState

Full internal state of the list.

ListUiState

UI-specific state (separate from data state).

ModalOutletProps

Props forwarded to the modal outlet slot which orchestrates confirmation or custom modals associated with actions.

ModalState

State for the modal experience tied to actions.

PaginationProps

Props for the pagination controls slot.

PaginationState

Pagination metadata describing both the current paging parameters and the total counts when known.

QueryResult

QuerySourceOptions

RowAction

RowActionContext

SelectionContext

SelectionState

Tracks the current selection configuration and the ids that are selected.

SortBarProps

Props for the sort bar slot. This surface exposes the fields that can be sorted alongside a handler to update the current sort descriptor.

SortDescriptor

Describes the active sort configuration for the list.

SortingContext

StatusStateProps

Minimal props shared by the various status state components such as loading, empty, or error states.

StreamBootstrapResult

StreamSourceOptions

TableProps

Props for the table slot responsible for rendering the visible rows.

ToolbarProps

Props passed to the toolbar slot component. This surface focuses on triggering list-level actions and therefore exposes the current list state and the available general actions.

UseListCoreResult

Contract returned by useListCore(). It aggregates the current list state as well as callbacks to mutate filters, sorting, pagination, and selection. Action-oriented handlers are also exposed to keep the UI layer thin and declarative.

Variables

Variable

Description

ConfirmModal

Very small, unstyled confirm modal. Styling is left to consumer via CSS classes.

ListBody

ListCell

ListContainer

Basic container for the list layout.

ListDisplay

High-level component that renders the entire ListDisplay experience using the core hook for state management and a set of slot-based components for the UI. Consumers can override any slot via the ListConfig.components map while still benefiting from the built-in behaviours.

ListEmptyState

ListErrorState

ListFiltersPanel

Minimal filters panel (placeholder).

ListLoadingState

ListModalOutlet

Default modal outlet implementation.

Supports: - Confirm modal (ModalConfig.type === "confirm")

For custom modals (ModalConfig.type === "custom"), consumers are expected to override this component via the "ModalOutlet" slot and handle rendering themselves.

ListPagination

Basic pagination controls.

ListRow

ListSortBar

Minimal sort bar: renders a dropdown of sortable fields.

ListTable

Default table layout for the list.

ListToolbar

Default toolbar: renders general actions as buttons.

Type Aliases

Type Alias

Description

ActionKind

ActiveFilterState

Active filters at list level. Keyed by field id (or custom logical id).

DataPatch

DataPatchListener

DataSourceKind

FieldAlign

FilterOperator

Operators supported by the filtering engine.

FilterType

Logical filter types used to match operators and value shapes.

ListComponentsProps

Optional props bag for slot components keyed by the slot name. This allows consumers to feed ad-hoc properties into overridden components while keeping the core library agnostic of their shape.

ListDisplayProps

Props forwarded to ListDisplay. They mirror ListConfig and therefore describe the full data, schema, and action configuration for the list.

ListStatus

Status values representing the lifecycle of the list data layer.

ModalConfig

Union describing the supported modal configurations for actions.

QueryLoadFn

RowId

Identifier type accepted by selection helpers.

SelectionMode_2

Available selection modes for the list component.

SortDirection

Direction used when sorting rows.

StreamSubscribeFn

Unsubscribe