@contember/bindx-react
Advanced tools
+1
-1
| { | ||
| "name": "@contember/bindx-react", | ||
| "version": "0.1.0", | ||
| "version": "0.1.2", | ||
| "description": "Type-safe React data binding framework", | ||
@@ -5,0 +5,0 @@ "type": "module", |
| /** | ||
| * DataGrid column components. | ||
| * | ||
| * These are "metadata" components --- they are not rendered directly. | ||
| * Instead, the DataGrid parent analyzes them to extract column definitions, | ||
| * selection metadata, and filter/sort configuration. | ||
| */ | ||
| import React from 'react'; | ||
| import type { FieldRefBase, HasOneRef, HasManyRef } from '../jsx/types.js'; | ||
| import type { FilterHandler, FilterArtifact } from '@contember/bindx'; | ||
| export declare const COLUMN_META: unique symbol; | ||
| /** | ||
| * Column metadata extracted during collection phase. | ||
| */ | ||
| export interface ColumnMeta { | ||
| readonly type: 'text' | 'number' | 'date' | 'dateTime' | 'boolean' | 'enum' | 'enumList' | 'uuid' | 'isDefined' | 'hasOne' | 'hasMany' | 'action' | 'custom'; | ||
| /** Field name on entity (null for action column) */ | ||
| readonly fieldName: string | null; | ||
| /** Column header text */ | ||
| readonly header: React.ReactNode; | ||
| /** Whether column supports sorting */ | ||
| readonly sortable: boolean; | ||
| /** Whether column has filtering enabled */ | ||
| readonly filterable: boolean; | ||
| /** Filter handler for this column */ | ||
| readonly filterHandler?: FilterHandler<FilterArtifact>; | ||
| /** Render function for relation content (hasOne/hasMany children callback) */ | ||
| readonly relationRenderer?: (ref: unknown) => React.ReactNode; | ||
| /** Enum options (for enum/enumList columns) */ | ||
| readonly enumOptions?: readonly string[]; | ||
| /** Custom cell renderer */ | ||
| readonly cellRenderer?: (value: unknown) => React.ReactNode; | ||
| } | ||
| export interface ColumnElementProps { | ||
| [COLUMN_META]: ColumnMeta; | ||
| } | ||
| interface DataGridScalarColumnPropsBase<T> { | ||
| field: FieldRefBase<T>; | ||
| header?: React.ReactNode; | ||
| sortable?: boolean; | ||
| filter?: boolean; | ||
| children?: (value: T | null) => React.ReactNode; | ||
| } | ||
| export interface DataGridTextColumnProps<T> extends DataGridScalarColumnPropsBase<T> { | ||
| } | ||
| export interface DataGridNumberColumnProps<T> extends DataGridScalarColumnPropsBase<T> { | ||
| } | ||
| export interface DataGridDateColumnProps<T> extends DataGridScalarColumnPropsBase<T> { | ||
| } | ||
| export interface DataGridDateTimeColumnProps<T> extends DataGridScalarColumnPropsBase<T> { | ||
| } | ||
| export interface DataGridBooleanColumnProps<T> extends DataGridScalarColumnPropsBase<T> { | ||
| } | ||
| export interface DataGridUuidColumnProps<T> extends DataGridScalarColumnPropsBase<T> { | ||
| } | ||
| export interface DataGridIsDefinedColumnProps<T> extends DataGridScalarColumnPropsBase<T> { | ||
| } | ||
| export interface DataGridEnumColumnProps<T> extends DataGridScalarColumnPropsBase<T> { | ||
| options: readonly string[]; | ||
| } | ||
| export interface DataGridEnumListColumnProps<T> extends DataGridScalarColumnPropsBase<T> { | ||
| options: readonly string[]; | ||
| } | ||
| export declare function DataGridTextColumn<T>(_props: DataGridTextColumnProps<T>): React.ReactElement | null; | ||
| export declare function DataGridNumberColumn<T>(_props: DataGridNumberColumnProps<T>): React.ReactElement | null; | ||
| export declare function DataGridDateColumn<T>(_props: DataGridDateColumnProps<T>): React.ReactElement | null; | ||
| export declare function DataGridDateTimeColumn<T>(_props: DataGridDateTimeColumnProps<T>): React.ReactElement | null; | ||
| export declare function DataGridBooleanColumn<T>(_props: DataGridBooleanColumnProps<T>): React.ReactElement | null; | ||
| export declare function DataGridEnumColumn<T>(_props: DataGridEnumColumnProps<T>): React.ReactElement | null; | ||
| export declare function DataGridEnumListColumn<T>(_props: DataGridEnumListColumnProps<T>): React.ReactElement | null; | ||
| export declare function DataGridUuidColumn<T>(_props: DataGridUuidColumnProps<T>): React.ReactElement | null; | ||
| export declare function DataGridIsDefinedColumn<T>(_props: DataGridIsDefinedColumnProps<T>): React.ReactElement | null; | ||
| export interface DataGridHasOneColumnProps<TEntity, TSelected> { | ||
| field: HasOneRef<TEntity, TSelected> | FieldRefBase<unknown>; | ||
| header?: React.ReactNode; | ||
| children: (entity: unknown) => React.ReactNode; | ||
| } | ||
| export declare function DataGridHasOneColumn<TEntity, TSelected>(_props: DataGridHasOneColumnProps<TEntity, TSelected>): React.ReactElement | null; | ||
| export interface DataGridHasManyColumnProps<TEntity, TSelected> { | ||
| field: HasManyRef<TEntity, TSelected> | FieldRefBase<unknown>; | ||
| header?: React.ReactNode; | ||
| children: (entity: unknown) => React.ReactNode; | ||
| } | ||
| export declare function DataGridHasManyColumn<TEntity, TSelected>(_props: DataGridHasManyColumnProps<TEntity, TSelected>): React.ReactElement | null; | ||
| export interface DataGridActionColumnProps { | ||
| children: React.ReactNode | ((entity: unknown) => React.ReactNode); | ||
| header?: React.ReactNode; | ||
| } | ||
| export declare function DataGridActionColumn(_props: DataGridActionColumnProps): React.ReactElement | null; | ||
| export interface DataGridColumnProps<T> { | ||
| field?: FieldRefBase<T>; | ||
| header?: React.ReactNode; | ||
| sortable?: boolean; | ||
| filter?: boolean; | ||
| filterHandler?: FilterHandler<FilterArtifact>; | ||
| children?: (value: T | null) => React.ReactNode; | ||
| } | ||
| export declare function DataGridColumn<T>(_props: DataGridColumnProps<T>): React.ReactElement | null; | ||
| /** | ||
| * Extract field name from a field ref (works in both collector and runtime proxies) | ||
| */ | ||
| export declare function extractFieldName(ref: unknown): string | null; | ||
| /** | ||
| * Extract column metadata from a JSX element tree. | ||
| * | ||
| * Walks the children returned by the DataGrid render callback | ||
| * and collects column definitions, including filter handlers | ||
| * when `filter` prop is enabled on a column. | ||
| * | ||
| * When a collector proxy is provided, relation renderers are called | ||
| * during collection to capture nested field accesses for the selection. | ||
| */ | ||
| export declare function extractColumns(elements: React.ReactNode, collectorProxy?: unknown): ColumnMeta[]; | ||
| export {}; | ||
| //# sourceMappingURL=columns.d.ts.map |
| {"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../../src/dataview/columns.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,K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AG,KAAK,CAAC,YAAY,GAAG,IAAI,CAE3F;AAMD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAM5D;AAsED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,OAAO,GAAG,UAAU,EAAE,CAyFhG"} |
| /** | ||
| * Fine-grained context hooks matching Contember's react-dataview API. | ||
| * | ||
| * These hooks provide convenient access to specific parts of the DataView context, | ||
| * matching Contember's pattern of separate state/methods hooks per concern. | ||
| */ | ||
| import type { FilteringState } from './useDataViewState.js'; | ||
| import type { SortingState, SortingDirectionAction, PagingState, PagingInfo, OrderDirection, FilterHandler, FilterArtifact, DataViewLayout } from '@contember/bindx'; | ||
| export interface DataViewSortingMethods { | ||
| setOrderBy(field: string, action: SortingDirectionAction, append?: boolean): void; | ||
| } | ||
| export declare function useDataViewSortingState(): SortingState; | ||
| export declare function useDataViewSortingMethods(): DataViewSortingMethods; | ||
| export declare function useDataViewSortingDirection(field: string): OrderDirection | null; | ||
| export interface DataViewPagingMethods { | ||
| goToPage(page: number | 'first' | 'next' | 'previous' | 'last'): void; | ||
| setItemsPerPage(count: number | null): void; | ||
| refreshTotalCount(): void; | ||
| } | ||
| export declare function useDataViewPagingState(): PagingState; | ||
| export declare function useDataViewPagingInfo(): PagingInfo; | ||
| export declare function useDataViewPagingMethods(): DataViewPagingMethods; | ||
| export interface DataViewFilteringMethods { | ||
| setFilter(name: string, artifact: FilterArtifact): void; | ||
| } | ||
| export declare function useDataViewFilteringState(): FilteringState; | ||
| export declare function useDataViewFilteringMethods(): DataViewFilteringMethods; | ||
| export declare function useDataViewFilterHandlerRegistry(): ReadonlyMap<string, { | ||
| handler: FilterHandler<FilterArtifact>; | ||
| }>; | ||
| export interface DataViewSelectionState { | ||
| readonly layout: string | undefined; | ||
| readonly visibility: Record<string, boolean | undefined>; | ||
| readonly layouts: readonly DataViewLayout[]; | ||
| } | ||
| export interface DataViewSelectionMethods { | ||
| setLayout(layout: string | undefined): void; | ||
| setVisibility(name: string, visible: boolean): void; | ||
| } | ||
| export declare function useDataViewSelectionState(): DataViewSelectionState; | ||
| export declare function useDataViewSelectionMethods(): DataViewSelectionMethods; | ||
| export interface DataViewElementData { | ||
| readonly name: string; | ||
| readonly label?: React.ReactNode; | ||
| readonly fallback?: boolean; | ||
| } | ||
| export declare function useDataViewElements(): readonly DataViewElementData[]; | ||
| //# sourceMappingURL=contextHooks.d.ts.map |
| {"version":3,"file":"contextHooks.d.ts","sourceRoot":"","sources":["../../src/dataview/contextHooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,cAAc,EAA+D,MAAM,uBAAuB,CAAA;AACxH,OAAO,KAAK,EACX,YAAY,EACZ,sBAAsB,EACtB,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EACb,cAAc,EACd,cAAc,EACd,MAAM,kBAAkB,CAAA;AAMzB,MAAM,WAAW,sBAAsB;IACtC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CACjF;AAED,wBAAgB,uBAAuB,IAAI,YAAY,CAEtD;AAED,wBAAgB,yBAAyB,IAAI,sBAAsB,CAGlE;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAEhF;AAMD,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,CAAA;IACrE,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IAC3C,iBAAiB,IAAI,IAAI,CAAA;CACzB;AAED,wBAAgB,sBAAsB,IAAI,WAAW,CAEpD;AAED,wBAAgB,qBAAqB,IAAI,UAAU,CAElD;AAED,wBAAgB,wBAAwB,IAAI,qBAAqB,CAahE;AAMD,MAAM,WAAW,wBAAwB;IACxC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAA;CACvD;AAED,wBAAgB,yBAAyB,IAAI,cAAc,CAE1D;AAED,wBAAgB,2BAA2B,IAAI,wBAAwB,CAGtE;AAED,wBAAgB,gCAAgC,IAAI,WAAW,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;CAAE,CAAC,CAElH;AAMD,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC,CAAA;IACxD,QAAQ,CAAC,OAAO,EAAE,SAAS,cAAc,EAAE,CAAA;CAC3C;AAED,MAAM,WAAW,wBAAwB;IACxC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAA;IAC3C,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;CACnD;AAED,wBAAgB,yBAAyB,IAAI,sBAAsB,CAOlE;AAED,wBAAgB,2BAA2B,IAAI,wBAAwB,CAMtE;AAMD,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,wBAAgB,mBAAmB,IAAI,SAAS,mBAAmB,EAAE,CAYpE"} |
| /** | ||
| * Converts a boolean to a data attribute value. | ||
| * Returns '' (present) for true, undefined (absent) for false. | ||
| */ | ||
| export declare function dataAttribute(value: boolean): '' | undefined; | ||
| //# sourceMappingURL=dataAttribute.d.ts.map |
| {"version":3,"file":"dataAttribute.d.ts","sourceRoot":"","sources":["../../src/dataview/dataAttribute.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,EAAE,GAAG,SAAS,CAE5D"} |
| /** | ||
| * DataGrid component — headless data grid context provider with two-pass rendering, | ||
| * integrated filtering, sorting, and pagination state management. | ||
| * | ||
| * The DataGrid extracts column metadata from the `columns` render callback, | ||
| * manages all state (filtering, sorting, paging, selection), loads data, | ||
| * and provides everything via DataViewContext. It does NOT render any UI — | ||
| * use composable components or the bindx-ui package for rendering. | ||
| */ | ||
| import React, { type ReactElement } from 'react'; | ||
| import type { EntityWhere, OrderDirection, DataViewLayout, SelectionValues } from '@contember/bindx'; | ||
| import type { StateStorageOrName } from './stateStorage.js'; | ||
| import type { EntityAccessor } from '../jsx/types.js'; | ||
| /** Well-known filter name for the universal query filter */ | ||
| export declare const QUERY_FILTER_NAME = "__query"; | ||
| export interface DataGridProps<TSchema, K extends keyof TSchema> { | ||
| /** Entity type name */ | ||
| entity: K; | ||
| /** Column definitions: receives entity proxy `it`, returns column components */ | ||
| columns: (it: EntityAccessor<TSchema[K]>) => React.ReactNode; | ||
| /** Rendered content within the DataViewProvider context */ | ||
| children?: React.ReactNode; | ||
| /** Initial sorting (supports multi-column: { title: 'asc', date: 'desc' }) */ | ||
| initialSorting?: Partial<Record<string, OrderDirection>>; | ||
| /** Items per page. null = show all. Default: 50 */ | ||
| itemsPerPage?: number | null; | ||
| /** Static filter (combined with dynamic filters) */ | ||
| filter?: EntityWhere<TSchema[K]>; | ||
| /** Available layouts */ | ||
| layouts?: readonly DataViewLayout[]; | ||
| /** Initial selection (layout + visibility) */ | ||
| initialSelection?: SelectionValues; | ||
| /** State storage for filter/sorting/selection state */ | ||
| stateStorage?: StateStorageOrName; | ||
| /** State storage for current page */ | ||
| currentPageStateStorage?: StateStorageOrName; | ||
| /** State storage for page size preference */ | ||
| pagingSettingsStorage?: StateStorageOrName; | ||
| /** Storage key prefix for isolation */ | ||
| storageKey?: string; | ||
| } | ||
| declare function DataGridImpl<TSchema, K extends keyof TSchema>({ entity, columns: columnDefiner, children, initialSorting, itemsPerPage, filter: staticFilter, layouts, initialSelection, stateStorage, currentPageStateStorage, pagingSettingsStorage, storageKey, }: DataGridProps<TSchema, K>): ReactElement | null; | ||
| export declare const DataGrid: typeof DataGridImpl; | ||
| export {}; | ||
| //# sourceMappingURL=DataGrid.d.ts.map |
| {"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../src/dataview/DataGrid.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,EAAQ,KAAK,YAAY,EAAqD,MAAM,OAAO,CAAA;AACzG,OAAO,KAAK,EACX,WAAW,EACX,cAAc,EAId,cAAc,EACd,eAAe,EACf,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAO3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAKrD,4DAA4D;AAC5D,eAAO,MAAM,iBAAiB,YAAY,CAAA;AAM1C,MAAM,WAAW,aAAa,CAAC,OAAO,EAAE,CAAC,SAAS,MAAM,OAAO;IAC9D,uBAAuB;IACvB,MAAM,EAAE,CAAC,CAAA;IACT,gFAAgF;IAChF,OAAO,EAAE,CAAC,EAAE,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAA;IAC5D,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,8EAA8E;IAC9E,cAAc,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAA;IACxD,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,oDAAoD;IACpD,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;IAChC,wBAAwB;IACxB,OAAO,CAAC,EAAE,SAAS,cAAc,EAAE,CAAA;IACnC,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,eAAe,CAAA;IAClC,uDAAuD;IACvD,YAAY,CAAC,EAAE,kBAAkB,CAAA;IACjC,qCAAqC;IACrC,uBAAuB,CAAC,EAAE,kBAAkB,CAAA;IAC5C,6CAA6C;IAC7C,qBAAqB,CAAC,EAAE,kBAAkB,CAAA;IAC1C,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAMD,iBAAS,YAAY,CAAC,OAAO,EAAE,CAAC,SAAS,MAAM,OAAO,EAAE,EACvD,MAAM,EACN,OAAO,EAAE,aAAa,EACtB,QAAQ,EACR,cAAc,EACd,YAAiB,EACjB,MAAM,EAAE,YAAY,EACpB,OAAO,EACP,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,qBAAqB,EACrB,UAAU,GACV,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,YAAY,GAAG,IAAI,CAyJjD;AAMD,eAAO,MAAM,QAAQ,EAAoC,OAAO,YAAY,CAAA"} |
| /** | ||
| * DataGrid pagination component. | ||
| * | ||
| * Renders page navigation controls using the DataView context's paging state. | ||
| * Must be used within a DataGrid (which provides DataViewContext). | ||
| * | ||
| * Usage: | ||
| * ```tsx | ||
| * <DataGrid entity="Article" itemsPerPage={20}> | ||
| * {it => (...)} | ||
| * </DataGrid> | ||
| * // or as a standalone within the DataView context: | ||
| * <DataGridPagination /> | ||
| * ``` | ||
| */ | ||
| import { type ReactElement } from 'react'; | ||
| export interface DataGridPaginationProps { | ||
| /** Available page sizes */ | ||
| pageSizes?: readonly number[]; | ||
| /** Enable sticky positioning */ | ||
| sticky?: boolean; | ||
| } | ||
| export declare function DataGridPagination({ pageSizes, sticky, }?: DataGridPaginationProps): ReactElement; | ||
| //# sourceMappingURL=DataGridPagination.d.ts.map |
| {"version":3,"file":"DataGridPagination.d.ts","sourceRoot":"","sources":["../../src/dataview/DataGridPagination.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAc,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAGhD,MAAM,WAAW,uBAAuB;IACvC,2BAA2B;IAC3B,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC7B,gCAAgC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,wBAAgB,kBAAkB,CAAC,EAClC,SAA6B,EAC7B,MAAM,GACN,GAAE,uBAA4B,GAAG,YAAY,CAgE7C"} |
| /** | ||
| * DataGrid toolbar component. | ||
| * | ||
| * Renders filter controls, query filter, settings (visibility/layout/pageSize), | ||
| * reload and export buttons. Supports sticky positioning. | ||
| */ | ||
| import React, { type ReactElement } from 'react'; | ||
| export interface DataGridToolbarProps { | ||
| children?: React.ReactNode; | ||
| /** Enable sticky positioning */ | ||
| sticky?: boolean; | ||
| /** Page size options for settings (default: [10, 20, 50, 100]) */ | ||
| pageSizes?: readonly number[]; | ||
| } | ||
| export declare function DataGridToolbar({ children, sticky, pageSizes }: DataGridToolbarProps): ReactElement; | ||
| //# sourceMappingURL=DataGridToolbar.d.ts.map |
| {"version":3,"file":"DataGridToolbar.d.ts","sourceRoot":"","sources":["../../src/dataview/DataGridToolbar.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,KAAK,YAAY,EAA4C,MAAM,OAAO,CAAA;AAc1F,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,gCAAgC;IAChC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,kEAAkE;IAClE,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC7B;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,SAA6B,EAAE,EAAE,oBAAoB,GAAG,YAAY,CAwKvH"} |
| /** | ||
| * DataView context — provides filtering, sorting, paging, selection state, | ||
| * and utility methods to descendant components. | ||
| */ | ||
| import React from 'react'; | ||
| import type { FilteringState, SortingStateResult, PagingStateResult, SelectionStateResult } from './useDataViewState.js'; | ||
| import type { ColumnMeta } from './columns.js'; | ||
| import type { SelectionMeta } from '@contember/bindx'; | ||
| export type DataViewLoaderState = 'initial' | 'loaded' | 'refreshing' | 'failed'; | ||
| export interface DataViewItem { | ||
| readonly id: string; | ||
| readonly data: Record<string, unknown>; | ||
| } | ||
| export interface DataViewContextValue { | ||
| readonly filtering: FilteringState; | ||
| readonly sorting: SortingStateResult; | ||
| readonly paging: PagingStateResult; | ||
| readonly selection: SelectionStateResult; | ||
| readonly columns: readonly ColumnMeta[]; | ||
| readonly entityType: string; | ||
| readonly items: readonly DataViewItem[]; | ||
| readonly itemCount: number; | ||
| readonly loaderState: DataViewLoaderState; | ||
| readonly reload: () => void; | ||
| readonly highlightIndex: number | null; | ||
| readonly setHighlightIndex: (index: number | null) => void; | ||
| readonly selectionMeta: SelectionMeta; | ||
| } | ||
| export declare function useDataViewContext(): DataViewContextValue; | ||
| export declare function useOptionalDataViewContext(): DataViewContextValue | null; | ||
| export declare const DataViewProvider: React.Provider<DataViewContextValue | null>; | ||
| //# sourceMappingURL=DataViewContext.d.ts.map |
| {"version":3,"file":"DataViewContext.d.ts","sourceRoot":"","sources":["../../src/dataview/DataViewContext.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAoC,MAAM,OAAO,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AACxH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,GAAG,QAAQ,CAAA;AAEhF,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACtC;AAED,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAA;IAClC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAA;IACpC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAA;IACxC,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAA;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAA;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAA;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IACtC,QAAQ,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC1D,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAA;CACrC;AAID,wBAAgB,kBAAkB,IAAI,oBAAoB,CAMzD;AAED,wBAAgB,0BAA0B,IAAI,oBAAoB,GAAG,IAAI,CAExE;AAED,eAAO,MAAM,gBAAgB,6CAA2B,CAAA"} |
| /** | ||
| * DataView export functionality. | ||
| * | ||
| * Provides CSV export and a trigger component that downloads all matching data. | ||
| * | ||
| * Usage: | ||
| * ```tsx | ||
| * <DataViewExportTrigger baseName="articles"> | ||
| * <button>Export CSV</button> | ||
| * </DataViewExportTrigger> | ||
| * ``` | ||
| */ | ||
| import React from 'react'; | ||
| export interface ExportResult { | ||
| readonly blob: Blob; | ||
| readonly extension: string; | ||
| } | ||
| export interface ExportFactoryArgs { | ||
| readonly data: readonly Record<string, unknown>[]; | ||
| readonly columns: readonly { | ||
| name: string; | ||
| fieldName: string | null; | ||
| }[]; | ||
| } | ||
| export interface ExportFactory { | ||
| create(args: ExportFactoryArgs): ExportResult; | ||
| } | ||
| export declare class CsvExportFactory implements ExportFactory { | ||
| create({ data, columns }: ExportFactoryArgs): ExportResult; | ||
| } | ||
| export interface DataViewExportTriggerProps { | ||
| /** Button element */ | ||
| children: React.ReactElement; | ||
| /** Base file name. Default: entityType-date */ | ||
| baseName?: string; | ||
| /** Export factory. Default: CSV */ | ||
| exportFactory?: ExportFactory; | ||
| /** Only export visible columns (respects selection state). Default: false */ | ||
| onlyVisible?: boolean; | ||
| } | ||
| export declare const DataViewExportTrigger: React.ForwardRefExoticComponent<DataViewExportTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface FetchAllDataResult { | ||
| data: readonly Record<string, unknown>[]; | ||
| } | ||
| export declare function useDataViewFetchAllData(): () => Promise<FetchAllDataResult | null>; | ||
| //# sourceMappingURL=export.d.ts.map |
| {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/dataview/export.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAA+D,MAAM,OAAO,CAAA;AAWnF,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAA;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACjD,QAAQ,CAAC,OAAO,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,CAAA;CACvE;AAED,MAAM,WAAW,aAAa;IAC7B,MAAM,CAAC,IAAI,EAAE,iBAAiB,GAAG,YAAY,CAAA;CAC7C;AAMD,qBAAa,gBAAiB,YAAW,aAAa;IACrD,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,iBAAiB,GAAG,YAAY;CAqB1D;AAyCD,MAAM,WAAW,0BAA0B;IAC1C,qBAAqB;IACrB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAA;IAC5B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,mCAAmC;IACnC,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,6EAA6E;IAC7E,WAAW,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,eAAO,MAAM,qBAAqB,sGAyEjC,CAAA;AAOD,MAAM,WAAW,kBAAkB;IAClC,IAAI,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACxC;AAED,wBAAgB,uBAAuB,IAAI,MAAM,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CA0BlF"} |
| /** | ||
| * Composable filter UI components using Radix Slot pattern. | ||
| * | ||
| * All trigger components use `@radix-ui/react-slot` for proper prop merging | ||
| * and `forwardRef` for ref forwarding. Filter names can be inferred from | ||
| * context (via DataViewTextFilter, DataViewFilterScope, etc.) or passed explicitly. | ||
| * | ||
| * Usage: | ||
| * ```tsx | ||
| * // With explicit name | ||
| * <DataViewTextFilterInput name="title"> | ||
| * <input placeholder="Search..." /> | ||
| * </DataViewTextFilterInput> | ||
| * | ||
| * // With context-inferred name | ||
| * <DataViewTextFilter field="title"> | ||
| * <DataViewTextFilterInput> | ||
| * <input placeholder="Search..." /> | ||
| * </DataViewTextFilterInput> | ||
| * <DataViewTextFilterMatchModeTrigger mode="contains"> | ||
| * <button>Contains</button> | ||
| * </DataViewTextFilterMatchModeTrigger> | ||
| * </DataViewTextFilter> | ||
| * ``` | ||
| */ | ||
| import React, { type ReactElement, type ReactNode } from 'react'; | ||
| import { type DataViewSetBooleanFilterAction, type DataViewSetEnumFilterAction, type DataViewSetRelationFilterAction, type DataViewSetNullFilterAction } from './filterHooks.js'; | ||
| import type { TextFilterArtifact } from '@contember/bindx'; | ||
| export { useDataViewFilter, } from './filterHooks.js'; | ||
| export type { UseDataViewFilterResult as DataViewFilterState } from './filterHooks.js'; | ||
| export interface DataViewTextFilterInputProps { | ||
| name?: string; | ||
| debounceMs?: number; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewTextFilterInput: React.ForwardRefExoticComponent<DataViewTextFilterInputProps & React.RefAttributes<HTMLInputElement>>; | ||
| export interface DataViewTextFilterMatchModeTriggerProps { | ||
| name?: string; | ||
| mode: TextFilterArtifact['mode']; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewTextFilterMatchModeTrigger: React.ForwardRefExoticComponent<DataViewTextFilterMatchModeTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewTextFilterMatchModeLabelProps { | ||
| name?: string; | ||
| } | ||
| export declare function DataViewTextFilterMatchModeLabel({ name, }: DataViewTextFilterMatchModeLabelProps): ReactElement; | ||
| export interface DataViewTextFilterResetTriggerProps { | ||
| name?: string; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewTextFilterResetTrigger: React.ForwardRefExoticComponent<DataViewTextFilterResetTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewNumberFilterInputProps { | ||
| name?: string; | ||
| type: 'from' | 'to'; | ||
| allowFloat?: boolean; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewNumberFilterInput: React.ForwardRefExoticComponent<DataViewNumberFilterInputProps & React.RefAttributes<HTMLInputElement>>; | ||
| export interface DataViewDateFilterInputProps { | ||
| name?: string; | ||
| type: 'start' | 'end'; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewDateFilterInput: React.ForwardRefExoticComponent<DataViewDateFilterInputProps & React.RefAttributes<HTMLInputElement>>; | ||
| export interface DataViewBooleanFilterTriggerProps { | ||
| name?: string; | ||
| value: boolean; | ||
| action?: DataViewSetBooleanFilterAction; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewBooleanFilterTrigger: React.ForwardRefExoticComponent<DataViewBooleanFilterTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewEnumFilterTriggerProps { | ||
| name?: string; | ||
| value: string; | ||
| action?: DataViewSetEnumFilterAction; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewEnumFilterTrigger: React.ForwardRefExoticComponent<DataViewEnumFilterTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewEnumFilterStateProps { | ||
| name?: string; | ||
| value: string; | ||
| children: (state: { | ||
| isIncluded: boolean; | ||
| isExcluded: boolean; | ||
| }) => ReactNode; | ||
| } | ||
| export declare function DataViewEnumFilterState({ name, value, children, }: DataViewEnumFilterStateProps): ReactElement; | ||
| export interface DataViewRelationFilterTriggerProps { | ||
| name?: string; | ||
| id: string; | ||
| action?: DataViewSetRelationFilterAction; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewRelationFilterTrigger: React.ForwardRefExoticComponent<DataViewRelationFilterTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewRelationFilterStateProps { | ||
| name?: string; | ||
| id: string; | ||
| children: (state: { | ||
| isIncluded: boolean; | ||
| isExcluded: boolean; | ||
| }) => ReactNode; | ||
| } | ||
| export declare function DataViewRelationFilterState({ name, id, children, }: DataViewRelationFilterStateProps): ReactElement; | ||
| export interface DataViewNullFilterTriggerProps { | ||
| name?: string; | ||
| action: DataViewSetNullFilterAction; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewNullFilterTrigger: React.ForwardRefExoticComponent<DataViewNullFilterTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewFilterResetTriggerProps { | ||
| name?: string; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewFilterResetTrigger: React.ForwardRefExoticComponent<DataViewFilterResetTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewDateFilterResetTriggerProps { | ||
| name?: string; | ||
| /** Which part to reset: 'start', 'end', or undefined (both) */ | ||
| type?: 'start' | 'end'; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewDateFilterResetTrigger: React.ForwardRefExoticComponent<DataViewDateFilterResetTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewNumberFilterResetTriggerProps { | ||
| name?: string; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewNumberFilterResetTrigger: React.ForwardRefExoticComponent<DataViewNumberFilterResetTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| //# sourceMappingURL=filterComponents.d.ts.map |
| {"version":3,"file":"filterComponents.d.ts","sourceRoot":"","sources":["../../src/dataview/filterComponents.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,YAAY,EAAE,KAAK,SAAS,EAAe,MAAM,OAAO,CAAA;AAKzF,OAAO,EASN,KAAK,8BAA8B,EAEnC,KAAK,2BAA2B,EAEhC,KAAK,+BAA+B,EAEpC,KAAK,2BAA2B,EAEhC,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAEX,kBAAkB,EAIlB,MAAM,kBAAkB,CAAA;AAIzB,OAAO,EACN,iBAAiB,GACjB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EAAE,uBAAuB,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAkBtF,MAAM,WAAW,4BAA4B;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,uBAAuB,uGAWnC,CAAA;AAOD,M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WAAW,mCAAmC;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,IAAI,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IACtB,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,8BAA8B,+GAgC1C,CAAA;AAOD,MAAM,WAAW,qCAAqC;IACrD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,gCAAgC,iHAsB5C,CAAA"} |
| /** | ||
| * Filter name context — provides the current filter name to descendant components. | ||
| * | ||
| * Used by DataViewTextFilter, DataViewBooleanFilter, etc. to scope | ||
| * trigger components so they don't need an explicit `name` prop. | ||
| */ | ||
| export declare function useDataViewFilterName(): string; | ||
| export declare function useOptionalDataViewFilterName(): string | null; | ||
| export declare const DataViewFilterNameProvider: import("react").Provider<string | null>; | ||
| //# sourceMappingURL=filterContext.d.ts.map |
| {"version":3,"file":"filterContext.d.ts","sourceRoot":"","sources":["../../src/dataview/filterContext.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,wBAAgB,qBAAqB,IAAI,MAAM,CAS9C;AAED,wBAAgB,6BAA6B,IAAI,MAAM,GAAG,IAAI,CAE7D;AAED,eAAO,MAAM,0BAA0B,yCAAqC,CAAA"} |
| /** | ||
| * Filter hooks — typed state access and action hooks for filter components. | ||
| * | ||
| * These hooks match the Contember react-dataview API: | ||
| * - useDataViewFilter: generic [state, setFilter, meta] tuple | ||
| * - useDataViewBooleanFilter: [current, set] with action types | ||
| * - useDataViewEnumFilter: [current, set] with include/exclude/toggle actions | ||
| * - useDataViewRelationFilter: [current, set] with include/exclude/toggle actions | ||
| * - useDataViewTextFilterInput: { value, onChange } with debounce | ||
| * - useDataViewTextFilterMatchMode: [isCurrent, set] | ||
| * - useDataViewNullFilter: [state, set] with include/exclude/toggle actions | ||
| */ | ||
| import { type ChangeEvent, type SetStateAction } from 'react'; | ||
| import type { FilterArtifact, TextFilterArtifact } from '@contember/bindx'; | ||
| export type UseDataViewFilterResult<T extends FilterArtifact> = [ | ||
| state: T | undefined, | ||
| setFilter: (filter: SetStateAction<T | undefined>) => void, | ||
| meta: { | ||
| isEmpty?: boolean; | ||
| } | ||
| ]; | ||
| export declare function useDataViewFilter<T extends FilterArtifact>(key: string): UseDataViewFilterResult<T>; | ||
| export type DataViewSetBooleanFilterAction = 'include' | 'unset' | 'toggle'; | ||
| export type DataViewBooleanFilterCurrent = 'include' | 'none'; | ||
| export type UseDataViewBooleanFilterResult = [ | ||
| current: DataViewBooleanFilterCurrent, | ||
| set: (action: DataViewSetBooleanFilterAction) => void | ||
| ]; | ||
| export declare function useDataViewBooleanFilter(name: string, value: boolean): UseDataViewBooleanFilterResult; | ||
| export declare function useDataViewBooleanFilterFactory(name: string): (value: boolean) => UseDataViewBooleanFilterResult; | ||
| export type DataViewSetEnumFilterAction = 'include' | 'exclude' | 'unset' | 'toggleInclude' | 'toggleExclude'; | ||
| export type DataViewEnumFilterCurrent = 'include' | 'exclude' | 'none'; | ||
| export type UseDataViewEnumFilterResult = [ | ||
| current: DataViewEnumFilterCurrent, | ||
| set: (action: DataViewSetEnumFilterAction) => void | ||
| ]; | ||
| export declare function useDataViewEnumFilter(name: string, value: string): UseDataViewEnumFilterResult; | ||
| export declare function useDataViewEnumFilterFactory(name: string): (value: string) => UseDataViewEnumFilterResult; | ||
| export type DataViewSetRelationFilterAction = 'include' | 'exclude' | 'unset' | 'toggleInclude' | 'toggleExclude'; | ||
| export type DataViewRelationFilterCurrent = 'include' | 'exclude' | 'none'; | ||
| export type UseDataViewRelationFilterResult = [ | ||
| current: DataViewRelationFilterCurrent, | ||
| set: (action: DataViewSetRelationFilterAction) => void | ||
| ]; | ||
| export declare function useDataViewRelationFilter(name: string, entityId: string): UseDataViewRelationFilterResult; | ||
| export declare function useDataViewRelationFilterFactory(name: string): (id: string) => UseDataViewRelationFilterResult; | ||
| export interface UseDataViewTextFilterInputResult { | ||
| value: string; | ||
| onChange: (e: ChangeEvent<HTMLInputElement>) => void; | ||
| } | ||
| export declare function useDataViewTextFilterInput({ name, debounceMs }: { | ||
| name: string; | ||
| debounceMs?: number; | ||
| }): UseDataViewTextFilterInputResult; | ||
| export type UseDataViewTextFilterMatchModeResult = [isCurrent: boolean, set: () => void]; | ||
| export declare function useDataViewTextFilterMatchMode(name: string, mode: TextFilterArtifact['mode']): UseDataViewTextFilterMatchModeResult; | ||
| export interface UseDataViewNumberFilterInputResult { | ||
| value: string; | ||
| onChange: (e: ChangeEvent<HTMLInputElement>) => void; | ||
| } | ||
| export interface UseDataViewNumberFilterInputProps { | ||
| name: string; | ||
| type: 'from' | 'to'; | ||
| allowFloat?: boolean; | ||
| } | ||
| export declare function useDataViewNumberFilterInput({ name, type, allowFloat }: UseDataViewNumberFilterInputProps): UseDataViewNumberFilterInputResult; | ||
| export type DataViewSetNullFilterAction = 'include' | 'exclude' | 'unset' | 'toggleInclude' | 'toggleExclude'; | ||
| export type DataViewNullFilterState = 'include' | 'exclude' | 'none'; | ||
| export type UseDataViewNullFilterResult = [ | ||
| state: DataViewNullFilterState, | ||
| set: (action: DataViewSetNullFilterAction) => void | ||
| ]; | ||
| export declare function useDataViewNullFilter(name: string): UseDataViewNullFilterResult; | ||
| //# sourceMappingURL=filterHooks.d.ts.map |
| {"version":3,"file":"filterHooks.d.ts","sourceRoot":"","sources":["../../src/dataview/filterHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAqD,MAAM,OAAO,CAAA;AAEhH,OAAO,KAAK,EACX,cAAc,EACd,kBAAkB,EAKlB,MAAM,kBAAkB,CAAA;AAMzB,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,cAAc,IAAI;IAC/D,KAAK,EAAE,CAAC,GAAG,SAAS;IACpB,SAAS,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,GAAG,SAAS,CA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AAE,UAAU,EAAE,EAAE,iCAAiC,GAAG,kCAAkC,CAiB9I;AAMD,MAAM,MAAM,2BAA2B,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,eAAe,GAAG,eAAe,CAAA;AAC7G,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;AACpE,MAAM,MAAM,2BAA2B,GAAG;IACzC,KAAK,EAAE,uBAAuB;IAC9B,GAAG,EAAE,CAAC,MAAM,EAAE,2BAA2B,KAAK,IAAI;CAClD,CAAA;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,2BAA2B,CA8B/E"} |
| /** | ||
| * Filter scope components — declarative filter registration and name scoping. | ||
| * | ||
| * Usage: | ||
| * ```tsx | ||
| * <DataViewFilterScope name="title"> | ||
| * <DataViewTextFilterInput /> | ||
| * </DataViewFilterScope> | ||
| * | ||
| * <DataViewFilter name="title" filterHandler={createTextFilterHandler('title')}> | ||
| * <DataViewTextFilterInput /> | ||
| * </DataViewFilter> | ||
| * | ||
| * <DataViewTextFilter field="title"> | ||
| * <DataViewTextFilterInput /> | ||
| * </DataViewTextFilter> | ||
| * | ||
| * <DataViewHasFilterType name="title"> | ||
| * <span>Title filter is available</span> | ||
| * </DataViewHasFilterType> | ||
| * ``` | ||
| */ | ||
| import React, { type ReactElement } from 'react'; | ||
| import type { FilterHandler, FilterArtifact } from '@contember/bindx'; | ||
| export interface DataViewFilterScopeProps { | ||
| name: string; | ||
| children: React.ReactNode; | ||
| } | ||
| /** | ||
| * Sets the filter name context for all children. | ||
| * Child filter triggers will infer their filter name from this scope. | ||
| */ | ||
| export declare function DataViewFilterScope({ name, children }: DataViewFilterScopeProps): ReactElement; | ||
| export interface DataViewFilterProps { | ||
| name: string; | ||
| filterHandler: FilterHandler<FilterArtifact>; | ||
| children?: React.ReactNode; | ||
| } | ||
| /** | ||
| * Registers a filter handler and sets the filter name context. | ||
| * | ||
| * Note: When used inside a DataGrid, filters are already registered | ||
| * from column definitions. This component then just provides the name scope. | ||
| */ | ||
| export declare function DataViewFilter({ name, children }: DataViewFilterProps): ReactElement; | ||
| export interface DataViewHasFilterTypeProps { | ||
| name: string; | ||
| children: React.ReactNode; | ||
| } | ||
| /** | ||
| * Renders children only if a filter with the given name is registered. | ||
| */ | ||
| export declare function DataViewHasFilterType({ name, children }: DataViewHasFilterTypeProps): ReactElement | null; | ||
| //# sourceMappingURL=filterScope.d.ts.map |
| {"version":3,"file":"filterScope.d.ts","sourceRoot":"","sources":["../../src/dataview/filterScope.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAGhD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAMrE,MAAM,WAAW,wBAAwB;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,wBAAwB,GAAG,YAAY,CAM9F;AAMD,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAC5C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,mBAAmB,GAAG,YAAY,CAMpF;AAMD,MAAM,WAAW,0BAA0B;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,0BAA0B,GAAG,YAAY,GAAG,IAAI,CAGzG"} |
| /** | ||
| * Typed filter wrapper components — provide filter name scope for specific filter types. | ||
| * | ||
| * Each wrapper sets the filter name context so child trigger components | ||
| * can infer their filter name automatically. | ||
| * | ||
| * Usage: | ||
| * ```tsx | ||
| * <DataViewTextFilter field="title"> | ||
| * <DataViewTextFilterInput /> | ||
| * <DataViewTextFilterMatchModeTrigger mode="contains"> | ||
| * <button>Contains</button> | ||
| * </DataViewTextFilterMatchModeTrigger> | ||
| * </DataViewTextFilter> | ||
| * | ||
| * <DataViewBooleanFilter field="published"> | ||
| * <DataViewBooleanFilterTrigger value={true} action="toggle"> | ||
| * <button>Published</button> | ||
| * </DataViewBooleanFilterTrigger> | ||
| * </DataViewBooleanFilter> | ||
| * ``` | ||
| */ | ||
| import React, { type ReactElement } from 'react'; | ||
| interface FilterWrapperProps { | ||
| field: string; | ||
| name?: string; | ||
| children: React.ReactNode; | ||
| } | ||
| export interface DataViewTextFilterProps extends FilterWrapperProps { | ||
| } | ||
| export declare function DataViewTextFilter({ field, name, children }: DataViewTextFilterProps): ReactElement; | ||
| export interface DataViewBooleanFilterProps extends FilterWrapperProps { | ||
| } | ||
| export declare function DataViewBooleanFilter({ field, name, children }: DataViewBooleanFilterProps): ReactElement; | ||
| export interface DataViewNumberFilterProps extends FilterWrapperProps { | ||
| } | ||
| export declare function DataViewNumberFilter({ field, name, children }: DataViewNumberFilterProps): ReactElement; | ||
| export interface DataViewDateFilterProps extends FilterWrapperProps { | ||
| } | ||
| export declare function DataViewDateFilter({ field, name, children }: DataViewDateFilterProps): ReactElement; | ||
| export interface DataViewEnumFilterProps extends FilterWrapperProps { | ||
| } | ||
| export declare function DataViewEnumFilter({ field, name, children }: DataViewEnumFilterProps): ReactElement; | ||
| export interface DataViewEnumListFilterProps extends FilterWrapperProps { | ||
| } | ||
| export declare function DataViewEnumListFilter({ field, name, children }: DataViewEnumListFilterProps): ReactElement; | ||
| export interface DataViewHasOneFilterProps extends FilterWrapperProps { | ||
| } | ||
| export declare function DataViewHasOneFilter({ field, name, children }: DataViewHasOneFilterProps): ReactElement; | ||
| export interface DataViewHasManyFilterProps extends FilterWrapperProps { | ||
| } | ||
| export declare function DataViewHasManyFilter({ field, name, children }: DataViewHasManyFilterProps): ReactElement; | ||
| export interface DataViewIsDefinedFilterProps extends FilterWrapperProps { | ||
| } | ||
| export declare function DataViewIsDefinedFilter({ field, name, children }: DataViewIsDefinedFilterProps): ReactElement; | ||
| export interface DataViewUnionTextFilterProps { | ||
| /** Single field or array of fields to search across */ | ||
| fields: string | string[]; | ||
| /** Required unique filter name */ | ||
| name: string; | ||
| children: React.ReactNode; | ||
| } | ||
| export declare function DataViewUnionTextFilter({ name, children }: DataViewUnionTextFilterProps): ReactElement; | ||
| export {}; | ||
| //# sourceMappingURL=filterWrappers.d.ts.map |
| {"version":3,"file":"filterWrappers.d.ts","sourceRoot":"","sources":["../../src/dataview/filterWrappers.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAOhD,UAAU,kBAAkB;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAUD,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;CAAG;AAEtE,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,uBAAuB,GAAG,YAAY,CAMnG;AAMD,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;CAAG;AAEzE,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,0BAA0B,GAAG,YAAY,CAMzG;AAMD,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;CAAG;AAExE,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,IAAI,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4BAA4B,GAAG,YAAY,CAMtG"} |
| export { DataGrid, type DataGridProps, QUERY_FILTER_NAME } from './DataGrid.js'; | ||
| export { renderCellValue } from './renderCellValue.js'; | ||
| export { DataGridTextColumn, DataGridNumberColumn, DataGridDateColumn, DataGridDateTimeColumn, DataGridBooleanColumn, DataGridEnumColumn, DataGridEnumListColumn, DataGridUuidColumn, DataGridIsDefinedColumn, DataGridHasOneColumn, DataGridHasManyColumn, DataGridActionColumn, DataGridColumn, type DataGridTextColumnProps, type DataGridNumberColumnProps, type DataGridDateColumnProps, type DataGridDateTimeColumnProps, type DataGridBooleanColumnProps, type DataGridEnumColumnProps, type DataGridEnumListColumnProps, type DataGridUuidColumnProps, type DataGridIsDefinedColumnProps, type DataGridHasOneColumnProps, type DataGridHasManyColumnProps, type DataGridActionColumnProps, type DataGridColumnProps, type ColumnMeta, extractColumns, extractFieldName, COLUMN_META, } from './columns.js'; | ||
| export { useFilteringState, useSortingState, usePagingState, useSelectionState, type FilteringState, type RegisteredFilter, type UseFilteringOptions, type UseSortingOptions, type SortingStateResult, type UsePagingOptions, type PagingStateResult, type UseSelectionOptions, type SelectionStateResult, } from './useDataViewState.js'; | ||
| export { useDataViewContext, useOptionalDataViewContext, DataViewProvider, type DataViewContextValue, type DataViewItem, type DataViewLoaderState as DataViewLoaderStateType, } from './DataViewContext.js'; | ||
| export { useDataView, type UseDataViewOptions, type DataViewResult } from './useDataView.js'; | ||
| export { dataAttribute } from './dataAttribute.js'; | ||
| export { useDataViewFilterName, useOptionalDataViewFilterName, DataViewFilterNameProvider, } from './filterContext.js'; | ||
| export { DataViewFilterScope, type DataViewFilterScopeProps, DataViewFilter, type DataViewFilterProps, DataViewHasFilterType, type DataViewHasFilterTypeProps, } from './filterScope.js'; | ||
| export { DataViewTextFilter, type DataViewTextFilterProps, DataViewBooleanFilter, type DataViewBooleanFilterProps, DataViewNumberFilter, type DataViewNumberFilterProps, DataViewDateFilter, type DataViewDateFilterProps, DataViewEnumFilter, type DataViewEnumFilterProps, DataViewEnumListFilter, type DataViewEnumListFilterProps, DataViewHasOneFilter, type DataViewHasOneFilterProps, DataViewHasManyFilter, type DataViewHasManyFilterProps, DataViewIsDefinedFilter, type DataViewIsDefinedFilterProps, DataViewUnionTextFilter, type DataViewUnionTextFilterProps, } from './filterWrappers.js'; | ||
| export { useDataViewFilter, type UseDataViewFilterResult, useDataViewBooleanFilter, useDataViewBooleanFilterFactory, type DataViewSetBooleanFilterAction, type DataViewBooleanFilterCurrent, type UseDataViewBooleanFilterResult, useDataViewEnumFilter, useDataViewEnumFilterFactory, type DataViewSetEnumFilterAction, type DataViewEnumFilterCurrent, type UseDataViewEnumFilterResult, useDataViewRelationFilter, useDataViewRelationFilterFactory, type DataViewSetRelationFilterAction, type DataViewRelationFilterCurrent, type UseDataViewRelationFilterResult, useDataViewTextFilterInput, type UseDataViewTextFilterInputResult, useDataViewTextFilterMatchMode, type UseDataViewTextFilterMatchModeResult, useDataViewNumberFilterInput, type UseDataViewNumberFilterInputResult, type UseDataViewNumberFilterInputProps, useDataViewNullFilter, type DataViewSetNullFilterAction, type DataViewNullFilterState, type UseDataViewNullFilterResult, } from './filterHooks.js'; | ||
| export { type DataViewFilterState, DataViewTextFilterInput, type DataViewTextFilterInputProps, DataViewTextFilterMatchModeTrigger, type DataViewTextFilterMatchModeTriggerProps, DataViewTextFilterMatchModeLabel, type DataViewTextFilterMatchModeLabelProps, DataViewTextFilterResetTrigger, type DataViewTextFilterResetTriggerProps, DataViewNumberFilterInput, type DataViewNumberFilterInputProps, DataViewDateFilterInput, type DataViewDateFilterInputProps, DataViewBooleanFilterTrigger, type DataViewBooleanFilterTriggerProps, DataViewEnumFilterTrigger, type DataViewEnumFilterTriggerProps, DataViewEnumFilterState, type DataViewEnumFilterStateProps, DataViewRelationFilterTrigger, type DataViewRelationFilterTriggerProps, DataViewRelationFilterState, type DataViewRelationFilterStateProps, DataViewNullFilterTrigger, type DataViewNullFilterTriggerProps, DataViewFilterResetTrigger, type DataViewFilterResetTriggerProps, DataViewDateFilterResetTrigger, type DataViewDateFilterResetTriggerProps, DataViewNumberFilterResetTrigger, type DataViewNumberFilterResetTriggerProps, } from './filterComponents.js'; | ||
| export { DataViewSortingTrigger, type DataViewSortingTriggerProps, DataViewSortingSwitch, type DataViewSortingSwitchProps, } from './sortingComponents.js'; | ||
| export { DataViewChangePageTrigger, type DataViewChangePageTriggerProps, DataViewSetItemsPerPageTrigger, type DataViewSetItemsPerPageTriggerProps, DataViewPagingStateView, type DataViewPagingStateViewProps, DataViewPagingInfo, type DataViewPagingInfoProps, } from './pagingComponents.js'; | ||
| export { DataViewVisibilityTrigger, type DataViewVisibilityTriggerProps, DataViewElement, DataViewIsVisible, type DataViewElementProps, DataViewLayout, type DataViewLayoutProps, DataViewLayoutTrigger, type DataViewLayoutTriggerProps, } from './selectionComponents.js'; | ||
| export { DataViewExportTrigger, type DataViewExportTriggerProps, CsvExportFactory, type ExportFactory, type ExportResult, type ExportFactoryArgs, useDataViewFetchAllData, type FetchAllDataResult, } from './export.js'; | ||
| export { DataViewInfiniteLoadProvider, type DataViewInfiniteLoadProviderProps, DataViewInfiniteLoadTrigger, type DataViewInfiniteLoadTriggerProps, DataViewInfiniteLoadScrollObserver, type DataViewInfiniteLoadScrollObserverProps, useDataViewInfiniteLoadTrigger, } from './infiniteLoad.js'; | ||
| export { DataViewReloadTrigger, type DataViewReloadTriggerProps, DataViewLoaderState, type DataViewLoaderStateProps, DataViewLoaderStateSwitch, type DataViewLoaderStateSwitchProps, useDataViewLoaderState, useDataViewReload, useDataViewHighlightIndex, DataViewEmpty, type DataViewEmptyProps, DataViewNonEmpty, type DataViewNonEmptyProps, DataViewEachRow, type DataViewEachRowProps, DataViewHighlightRow, type DataViewHighlightRowProps, DataViewKeyboardEventHandler, type DataViewKeyboardEventHandlerProps, } from './loaderComponents.js'; | ||
| export { useDataViewSortingState, useDataViewSortingMethods, useDataViewSortingDirection, type DataViewSortingMethods, useDataViewPagingState, useDataViewPagingInfo, useDataViewPagingMethods, type DataViewPagingMethods, useDataViewFilteringState, useDataViewFilteringMethods, useDataViewFilterHandlerRegistry, type DataViewFilteringMethods, useDataViewSelectionState, useDataViewSelectionMethods, type DataViewSelectionState, type DataViewSelectionMethods, useDataViewElements, type DataViewElementData, } from './contextHooks.js'; | ||
| export { type StateStorage, type StateStorageOrName, useStoredState, buildDataViewKey, } from './stateStorage.js'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dataview/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAG/E,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAGtD,OAAO,EACN,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,cAAc,EACd,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,cAAc,EACd,gBAAgB,EAChB,WAAW,GACX,MAAM,cAAc,CAAA;AAGrB,OAAO,EACN,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB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AK,kBAAkB,EACvB,cAAc,EACd,gBAAgB,GAChB,MAAM,mBAAmB,CAAA"} |
| /** | ||
| * Infinite scroll / load-more components using Radix Slot. | ||
| * | ||
| * Usage: | ||
| * ```tsx | ||
| * <DataViewInfiniteLoadProvider> | ||
| * <DataViewEachRow> | ||
| * {(item) => <div>{item.title}</div>} | ||
| * </DataViewEachRow> | ||
| * <DataViewInfiniteLoadTrigger> | ||
| * <button>Load More</button> | ||
| * </DataViewInfiniteLoadTrigger> | ||
| * <DataViewInfiniteLoadScrollObserver /> | ||
| * </DataViewInfiniteLoadProvider> | ||
| * ``` | ||
| */ | ||
| import React, { type ReactElement } from 'react'; | ||
| export interface DataViewInfiniteLoadProviderProps { | ||
| children: React.ReactNode; | ||
| } | ||
| export declare function DataViewInfiniteLoadProvider({ children, }: DataViewInfiniteLoadProviderProps): ReactElement; | ||
| export interface DataViewInfiniteLoadTriggerProps { | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewInfiniteLoadTrigger: React.ForwardRefExoticComponent<DataViewInfiniteLoadTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewInfiniteLoadScrollObserverProps { | ||
| /** Root margin for IntersectionObserver. Default: '200px' */ | ||
| rootMargin?: string; | ||
| } | ||
| export declare function DataViewInfiniteLoadScrollObserver({ rootMargin, }?: DataViewInfiniteLoadScrollObserverProps): ReactElement; | ||
| export declare function useDataViewInfiniteLoadTrigger(): (() => void) | undefined; | ||
| //# sourceMappingURL=infiniteLoad.d.ts.map |
| {"version":3,"file":"infiniteLoad.d.ts","sourceRoot":"","sources":["../../src/dataview/infiniteLoad.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAA4F,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAiC1I,MAAM,WAAW,iCAAiC;IACjD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,wBAAgB,4BAA4B,CAAC,EAC5C,QAAQ,GACR,EAAE,iCAAiC,GAAG,YAAY,CA2DlD;AAMD,MAAM,WAAW,gCAAgC;IAChD,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,2BAA2B,4GAkBvC,CAAA;AAOD,MAAM,WAAW,uCAAuC;IACvD,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,kCAAkC,CAAC,EAClD,UAAoB,GACpB,GAAE,uCAA4C,GAAG,YAAY,CAsB7D;AAMD,wBAAgB,8BAA8B,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAEzE"} |
| /** | ||
| * Loader state, reload trigger, and conditional rendering components using Radix Slot. | ||
| * | ||
| * Usage: | ||
| * ```tsx | ||
| * <DataViewReloadTrigger> | ||
| * <button>Refresh</button> | ||
| * </DataViewReloadTrigger> | ||
| * | ||
| * <DataViewLoaderState loaded={<Table />} refreshing={<Table />} initial={<Loading />} failed={<Error />} /> | ||
| * | ||
| * <DataViewEmpty>No results found</DataViewEmpty> | ||
| * <DataViewNonEmpty><Table /></DataViewNonEmpty> | ||
| * | ||
| * <DataViewKeyboardEventHandler> | ||
| * <div tabIndex={0}>...</div> | ||
| * </DataViewKeyboardEventHandler> | ||
| * ``` | ||
| */ | ||
| import React, { type ReactElement } from 'react'; | ||
| import type { DataViewLoaderState as DataViewLoaderStateType } from './DataViewContext.js'; | ||
| export interface DataViewReloadTriggerProps { | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewReloadTrigger: React.ForwardRefExoticComponent<DataViewReloadTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewLoaderStateProps { | ||
| children: React.ReactNode; | ||
| /** Render children when data is loaded */ | ||
| loaded?: boolean; | ||
| /** Render children when refreshing (after initial load) */ | ||
| refreshing?: boolean; | ||
| /** Render children during initial load */ | ||
| initial?: boolean; | ||
| /** Render children on failure */ | ||
| failed?: boolean; | ||
| } | ||
| export declare function DataViewLoaderState({ children, ...props }: DataViewLoaderStateProps): ReactElement | null; | ||
| export interface DataViewLoaderStateSwitchProps { | ||
| /** Render when data is loaded */ | ||
| loaded?: React.ReactNode; | ||
| /** Render when refreshing (after initial load) */ | ||
| refreshing?: React.ReactNode; | ||
| /** Render during initial load */ | ||
| initial?: React.ReactNode; | ||
| /** Render on failure */ | ||
| failed?: React.ReactNode; | ||
| } | ||
| export declare function DataViewLoaderStateSwitch({ loaded, refreshing, initial, failed, }: DataViewLoaderStateSwitchProps): ReactElement; | ||
| export declare function useDataViewLoaderState(): DataViewLoaderStateType; | ||
| export declare function useDataViewReload(): () => void; | ||
| export declare function useDataViewHighlightIndex(): number | null; | ||
| export interface DataViewEmptyProps { | ||
| children: React.ReactNode; | ||
| } | ||
| export declare function DataViewEmpty({ children }: DataViewEmptyProps): ReactElement; | ||
| export interface DataViewNonEmptyProps { | ||
| children: React.ReactNode; | ||
| } | ||
| export declare function DataViewNonEmpty({ children }: DataViewNonEmptyProps): ReactElement; | ||
| export interface DataViewEachRowProps { | ||
| children: (item: { | ||
| id: string; | ||
| data: Record<string, unknown>; | ||
| }, index: number) => React.ReactNode; | ||
| } | ||
| export declare function DataViewEachRow({ children }: DataViewEachRowProps): ReactElement; | ||
| export interface DataViewHighlightRowProps { | ||
| index: number; | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewHighlightRow: React.ForwardRefExoticComponent<DataViewHighlightRowProps & React.RefAttributes<HTMLElement>>; | ||
| export interface DataViewKeyboardEventHandlerProps { | ||
| children: ReactElement; | ||
| onSelectHighlighted?: (item: { | ||
| id: string; | ||
| data: Record<string, unknown>; | ||
| }) => void; | ||
| } | ||
| export declare const DataViewKeyboardEventHandler: React.ForwardRefExoticComponent<DataViewKeyboardEventHandlerProps & React.RefAttributes<HTMLElement>>; | ||
| //# sourceMappingURL=loaderComponents.d.ts.map |
| {"version":3,"file":"loaderComponents.d.ts","sourceRoot":"","sources":["../../src/dataview/loaderComponents.tsx"],"names":[],"mappings":"AAA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;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE,kBAAkB,GAAG,YAAY,CAI5E;AAED,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,GAAG,YAAY,CAIlF;AAMD,MAAM,WAAW,oBAAoB;IACpC,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAA;CACjG;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE,oBAAoB,GAAG,YAAY,CAGhF;AAMD,MAAM,WAAW,yBAAyB;IACzC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,oBAAoB,+FAoBhC,CAAA;AAOD,MAAM,WAAW,iCAAiC;IACjD,QAAQ,EAAE,YAAY,CAAA;IACtB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,KAAK,IAAI,CAAA;CACnF;AAED,eAAO,MAAM,4BAA4B,uGA+BxC,CAAA"} |
| /** | ||
| * Composable paging UI components using Radix Slot pattern. | ||
| * | ||
| * Usage: | ||
| * ```tsx | ||
| * <DataViewChangePageTrigger page="previous"> | ||
| * <button>Previous</button> | ||
| * </DataViewChangePageTrigger> | ||
| * | ||
| * <DataViewChangePageTrigger page="next"> | ||
| * <button>Next</button> | ||
| * </DataViewChangePageTrigger> | ||
| * | ||
| * <DataViewSetItemsPerPageTrigger value={25}> | ||
| * <button>25 per page</button> | ||
| * </DataViewSetItemsPerPageTrigger> | ||
| * | ||
| * <DataViewPagingStateView> | ||
| * {({ pageIndex, totalPages }) => <span>Page {pageIndex + 1} of {totalPages}</span>} | ||
| * </DataViewPagingStateView> | ||
| * ``` | ||
| */ | ||
| import React, { type ReactElement, type ReactNode } from 'react'; | ||
| export interface DataViewChangePageTriggerProps { | ||
| /** Target page: named shortcut or zero-based page index */ | ||
| page: 'first' | 'last' | 'next' | 'previous' | number; | ||
| /** Button element */ | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewChangePageTrigger: React.ForwardRefExoticComponent<DataViewChangePageTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewSetItemsPerPageTriggerProps { | ||
| /** Items per page to set. null = show all. */ | ||
| value: number | null; | ||
| /** Button element */ | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewSetItemsPerPageTrigger: React.ForwardRefExoticComponent<DataViewSetItemsPerPageTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewPagingInfoProps { | ||
| children: (info: { | ||
| pageIndex: number; | ||
| totalPages: number | null; | ||
| totalCount: number | null; | ||
| itemsPerPage: number; | ||
| }) => ReactNode; | ||
| } | ||
| export declare function DataViewPagingStateView({ children, }: DataViewPagingInfoProps): ReactElement; | ||
| /** Alias for DataViewPagingStateView */ | ||
| export declare const DataViewPagingInfo: typeof DataViewPagingStateView; | ||
| export type DataViewPagingStateViewProps = DataViewPagingInfoProps; | ||
| //# sourceMappingURL=pagingComponents.d.ts.map |
| {"version":3,"file":"pagingComponents.d.ts","sourceRoot":"","sources":["../../src/dataview/pagingComponents.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,YAAY,EAAE,KAAK,SAAS,EAAe,MAAM,OAAO,CAAA;AAUzF,MAAM,WAAW,8BAA8B;IAC9C,2DAA2D;IAC3D,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAA;IACrD,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,yBAAyB,0GA4BrC,CAAA;AAoBD,MAAM,WAAW,mCAAmC;IACnD,8CAA8C;IAC9C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,8BAA8B,+GAqB1C,CAAA;AAOD,MAAM,WAAW,uBAAuB;IACvC,QAAQ,EAAE,CAAC,IAAI,EAAE;QAChB,SAAS,EAAE,MAAM,CAAA;QACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;QACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;QACzB,YAAY,EAAE,MAAM,CAAA;KACpB,KAAK,SAAS,CAAA;CACf;AAED,wBAAgB,uBAAuB,CAAC,EACvC,QAAQ,GACR,EAAE,uBAAuB,GAAG,YAAY,CASxC;AAED,wCAAwC;AACxC,eAAO,MAAM,kBAAkB,gCAA0B,CAAA;AAEzD,MAAM,MAAM,4BAA4B,GAAG,uBAAuB,CAAA"} |
| /** | ||
| * Utility for rendering cell values from column metadata and entity accessor. | ||
| * Extracted from DataGrid to be usable by any table rendering component. | ||
| */ | ||
| import React from 'react'; | ||
| import type { ColumnMeta } from './columns.js'; | ||
| import type { EntityAccessor } from '../jsx/types.js'; | ||
| export declare function renderCellValue(col: ColumnMeta, accessor: EntityAccessor<unknown>): React.ReactNode; | ||
| //# sourceMappingURL=renderCellValue.d.ts.map |
| {"version":3,"file":"renderCellValue.d.ts","sourceRoot":"","sources":["../../src/dataview/renderCellValue.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,wBAAgB,eAAe,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,SAAS,CAqEnG"} |
| /** | ||
| * Selection components — column visibility + layout switching using Radix Slot. | ||
| * | ||
| * Usage: | ||
| * ```tsx | ||
| * <DataViewVisibilityTrigger name="description"> | ||
| * <button>Toggle Description</button> | ||
| * </DataViewVisibilityTrigger> | ||
| * | ||
| * <DataViewElement name="description"> | ||
| * <DescriptionColumn /> | ||
| * </DataViewElement> | ||
| * | ||
| * <DataViewLayout name="table"> | ||
| * <TableView /> | ||
| * </DataViewLayout> | ||
| * | ||
| * <DataViewLayoutTrigger name="table"> | ||
| * <button>Table View</button> | ||
| * </DataViewLayoutTrigger> | ||
| * ``` | ||
| */ | ||
| import React, { type ReactElement } from 'react'; | ||
| export interface DataViewVisibilityTriggerProps { | ||
| /** Element name to toggle */ | ||
| name: string; | ||
| /** Value to set. Can be boolean or function. Default: toggle */ | ||
| value?: boolean | ((current: boolean) => boolean); | ||
| /** Fallback visibility when not explicitly set. Default: true */ | ||
| fallbackValue?: boolean; | ||
| /** Button element */ | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewVisibilityTrigger: React.ForwardRefExoticComponent<DataViewVisibilityTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewElementProps { | ||
| /** Element name (used for visibility toggle) */ | ||
| name: string; | ||
| /** Label for the element (for UI display) */ | ||
| label?: React.ReactNode; | ||
| /** Default visibility when not explicitly set. Default: true */ | ||
| fallback?: boolean; | ||
| children: React.ReactNode; | ||
| } | ||
| export declare function DataViewElement({ name, fallback, children, }: DataViewElementProps): ReactElement | null; | ||
| /** @deprecated Use DataViewElement instead */ | ||
| export declare const DataViewIsVisible: typeof DataViewElement; | ||
| export interface DataViewLayoutProps { | ||
| /** Layout name */ | ||
| name: string; | ||
| /** Label for the layout */ | ||
| label?: React.ReactNode; | ||
| children: React.ReactNode; | ||
| } | ||
| export declare function DataViewLayout({ name, children, }: DataViewLayoutProps): ReactElement | null; | ||
| export interface DataViewLayoutTriggerProps { | ||
| /** Layout name to switch to */ | ||
| name: string; | ||
| /** Button element */ | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewLayoutTrigger: React.ForwardRefExoticComponent<DataViewLayoutTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| //# sourceMappingURL=selectionComponents.d.ts.map |
| {"version":3,"file":"selectionComponents.d.ts","sourceRoot":"","sources":["../../src/dataview/selectionComponents.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,YAAY,EAAe,MAAM,OAAO,CAAA;AAUzE,MAAM,WAAW,8BAA8B;IAC9C,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,CAAA;IACjD,iEAAiE;IACjE,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,yBAAyB,0GA2BrC,CAAA;AAOD,MAAM,WAAW,oBAAoB;IACpC,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,6CAA6C;IAC7C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,wBAAgB,eAAe,CAAC,EAC/B,IAAI,EACJ,QAAe,EACf,QAAQ,GACR,EAAE,oBAAoB,GAAG,YAAY,GAAG,IAAI,CAM5C;AAED,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,wBAAkB,CAAA;AAMhD,MAAM,WAAW,mBAAmB;IACnC,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,2BAA2B;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,wBAAgB,cAAc,CAAC,EAC9B,IAAI,EACJ,QAAQ,GACR,EAAE,mBAAmB,GAAG,YAAY,GAAG,IAAI,CAQ3C;AAED,MAAM,WAAW,0BAA0B;IAC1C,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,qBAAqB,sGAuBjC,CAAA"} |
| /** | ||
| * Composable sorting UI components using Radix Slot pattern. | ||
| * | ||
| * Usage: | ||
| * ```tsx | ||
| * <DataViewSortingTrigger field="title"> | ||
| * <button>Sort by Title</button> | ||
| * </DataViewSortingTrigger> | ||
| * | ||
| * <DataViewSortingSwitch field="title" | ||
| * asc={<span>↑</span>} | ||
| * desc={<span>↓</span>} | ||
| * none={<span>↕</span>} | ||
| * /> | ||
| * ``` | ||
| */ | ||
| import React, { type ReactElement } from 'react'; | ||
| import type { SortingDirectionAction } from '@contember/bindx'; | ||
| export interface DataViewSortingTriggerProps { | ||
| /** Field name to sort by */ | ||
| field: string; | ||
| /** Sorting action. Default: 'next' (cycles asc → desc → none) */ | ||
| action?: SortingDirectionAction; | ||
| /** Button element to render */ | ||
| children: ReactElement; | ||
| } | ||
| export declare const DataViewSortingTrigger: React.ForwardRefExoticComponent<DataViewSortingTriggerProps & React.RefAttributes<HTMLButtonElement>>; | ||
| export interface DataViewSortingSwitchProps { | ||
| /** Field name */ | ||
| field: string; | ||
| /** Render when sorted ascending */ | ||
| asc?: React.ReactNode; | ||
| /** Render when sorted descending */ | ||
| desc?: React.ReactNode; | ||
| /** Render when not sorted */ | ||
| none?: React.ReactNode; | ||
| } | ||
| export declare function DataViewSortingSwitch({ field, asc, desc, none, }: DataViewSortingSwitchProps): ReactElement; | ||
| //# sourceMappingURL=sortingComponents.d.ts.map |
| {"version":3,"file":"sortingComponents.d.ts","sourceRoot":"","sources":["../../src/dataview/sortingComponents.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,YAAY,EAAe,MAAM,OAAO,CAAA;AAKzE,OAAO,KAAK,EAAE,sBAAsB,EAAkB,MAAM,kBAAkB,CAAA;AAM9E,MAAM,WAAW,2BAA2B;IAC3C,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,iEAAiE;IACjE,MAAM,CAAC,EAAE,sBAAsB,CAAA;IAC/B,+BAA+B;IAC/B,QAAQ,EAAE,YAAY,CAAA;CACtB;AASD,eAAO,MAAM,sBAAsB,uGA6BlC,CAAA;AAOD,MAAM,WAAW,0BAA0B;IAC1C,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,mCAAmC;IACnC,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,oCAAoC;IACpC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACtB;AAED,wBAAgB,qBAAqB,CAAC,EACrC,KAAK,EACL,GAAG,EACH,IAAI,EACJ,IAAI,GACJ,EAAE,0BAA0B,GAAG,YAAY,CAO3C"} |
| /** | ||
| * State storage abstraction for DataView state persistence. | ||
| * | ||
| * Supports URL params, sessionStorage, localStorage, or custom backends. | ||
| * | ||
| * Usage: | ||
| * ```tsx | ||
| * const [value, setValue] = useStoredState('url', ['myGrid', 'sorting'], initialValue) | ||
| * ``` | ||
| */ | ||
| export interface StateStorage { | ||
| get<T>(key: string): T | undefined; | ||
| set<T>(key: string, value: T): void; | ||
| remove(key: string): void; | ||
| } | ||
| export type StateStorageOrName = 'url' | 'session' | 'local' | 'null' | StateStorage; | ||
| export declare function useStoredState<T>(storageOrName: StateStorageOrName, key: readonly string[], initializer: (storedValue: T | undefined) => T): [T, (value: T) => void]; | ||
| export declare function buildDataViewKey(parts: readonly string[]): string; | ||
| //# sourceMappingURL=stateStorage.d.ts.map |
| {"version":3,"file":"stateStorage.d.ts","sourceRoot":"","sources":["../../src/dataview/stateStorage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,MAAM,WAAW,YAAY;IAC5B,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAA;IAClC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAA;IACnC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,CAAA;AAuGpF,wBAAgB,cAAc,CAAC,CAAC,EAC/B,aAAa,EAAE,kBAAkB,EACjC,GAAG,EAAE,SAAS,MAAM,EAAE,EACtB,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC,GAAG,SAAS,KAAK,CAAC,GAC5C,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAezB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAEjE"} |
| /** | ||
| * useDataView — low-level hook for building custom data views. | ||
| * | ||
| * Manages filtering, sorting, paging, and selection state, and loads data | ||
| * from the backend adapter. This is the hook API that DataGrid | ||
| * uses internally, exposed for building custom grid/list UIs. | ||
| */ | ||
| import type { FilterHandler, FilterArtifact, SelectionMeta, FieldError, SortingDirections, DataViewLayout, SelectionValues } from '@contember/bindx'; | ||
| import { type EntityListCoreItem } from '../hooks/useEntityListCore.js'; | ||
| import { type FilteringState, type SortingStateResult, type PagingStateResult, type SelectionStateResult } from './useDataViewState.js'; | ||
| import type { StateStorageOrName } from './stateStorage.js'; | ||
| export interface UseDataViewOptions { | ||
| /** Filter definitions: name → { handler, initialArtifact? } */ | ||
| filters?: ReadonlyMap<string, { | ||
| handler: FilterHandler<FilterArtifact>; | ||
| initialArtifact?: FilterArtifact; | ||
| }>; | ||
| /** Fields that can be sorted */ | ||
| sortableFields?: ReadonlySet<string>; | ||
| /** Initial sorting directions (supports multi-column) */ | ||
| initialSorting?: SortingDirections; | ||
| /** Items per page. null = show all. Default: 50 */ | ||
| itemsPerPage?: number | null; | ||
| /** Static filter (always applied) */ | ||
| filter?: Record<string, unknown>; | ||
| /** Selection metadata for building the query */ | ||
| selection: SelectionMeta; | ||
| /** Available layouts */ | ||
| layouts?: readonly DataViewLayout[]; | ||
| /** Initial selection (layout + visibility) */ | ||
| initialSelection?: SelectionValues; | ||
| /** State storage for filter/sorting/selection state */ | ||
| stateStorage?: StateStorageOrName; | ||
| /** State storage for current page (typically 'url') */ | ||
| currentPageStateStorage?: StateStorageOrName; | ||
| /** State storage for page size preference (typically 'session' or 'local') */ | ||
| pagingSettingsStorage?: StateStorageOrName; | ||
| /** Storage key prefix for isolation */ | ||
| storageKey?: string; | ||
| } | ||
| export interface DataViewResult { | ||
| /** Current load status */ | ||
| readonly status: 'loading' | 'error' | 'ready'; | ||
| /** Error if status is 'error' */ | ||
| readonly error?: FieldError; | ||
| /** Loaded items */ | ||
| readonly items: readonly EntityListCoreItem[]; | ||
| /** Filtering state and controls */ | ||
| readonly filtering: FilteringState; | ||
| /** Sorting state and controls */ | ||
| readonly sorting: SortingStateResult; | ||
| /** Paging state and controls */ | ||
| readonly paging: PagingStateResult; | ||
| /** Selection state (visibility + layout) */ | ||
| readonly selection: SelectionStateResult; | ||
| } | ||
| export declare function useDataView(entityType: string, options: UseDataViewOptions): DataViewResult; | ||
| //# sourceMappingURL=useDataView.d.ts.map |
| {"version":3,"file":"useDataView.d.ts","sourceRoot":"","sources":["../../src/dataview/useDataView.ts"],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A;CACnB;AAED,MAAM,WAAW,cAAc;IAC9B,0BAA0B;IAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;IAC9C,iCAAiC;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAA;IAC3B,mBAAmB;IACnB,QAAQ,CAAC,KAAK,EAAE,SAAS,kBAAkB,EAAE,CAAA;IAC7C,mCAAmC;IACnC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAA;IAClC,iCAAiC;IACjC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAA;IACpC,gCAAgC;IAChC,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAA;IAClC,4CAA4C;IAC5C,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAA;CACxC;AASD,wBAAgB,WAAW,CAC1B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,kBAAkB,GACzB,cAAc,CA8DhB"} |
| /** | ||
| * State management hooks for DataView filtering, sorting, paging, and selection. | ||
| * | ||
| * All hooks support optional state storage (URL, session, local, custom) | ||
| * for persisting state across navigations. | ||
| */ | ||
| import type { FilterHandler, FilterArtifact, SortingState, SortingDirections, SortingDirectionAction, PagingState, PagingInfo, OrderDirection, DataViewLayout, SelectionValues, SelectionState } from '@contember/bindx'; | ||
| import { type StateStorageOrName } from './stateStorage.js'; | ||
| export interface RegisteredFilter { | ||
| readonly name: string; | ||
| readonly handler: FilterHandler<FilterArtifact>; | ||
| artifact: FilterArtifact; | ||
| } | ||
| export interface FilteringState { | ||
| readonly filters: ReadonlyMap<string, RegisteredFilter>; | ||
| getArtifact(name: string): FilterArtifact | undefined; | ||
| setArtifact(name: string, artifact: FilterArtifact): void; | ||
| resetFilter(name: string): void; | ||
| resetAll(): void; | ||
| readonly hasActiveFilters: boolean; | ||
| readonly resolvedWhere: Record<string, unknown> | undefined; | ||
| } | ||
| export interface UseFilteringOptions { | ||
| filters: ReadonlyMap<string, { | ||
| handler: FilterHandler<FilterArtifact>; | ||
| initialArtifact?: FilterArtifact; | ||
| }>; | ||
| /** State storage backend. Default: 'null' (no persistence) */ | ||
| stateStorage?: StateStorageOrName; | ||
| /** Storage key prefix */ | ||
| storageKey?: string; | ||
| } | ||
| export declare function useFilteringState(options: UseFilteringOptions): FilteringState; | ||
| export interface UseSortingOptions { | ||
| sortableFields: ReadonlySet<string>; | ||
| initialSorting?: SortingDirections; | ||
| stateStorage?: StateStorageOrName; | ||
| storageKey?: string; | ||
| } | ||
| export interface SortingStateResult { | ||
| readonly state: SortingState; | ||
| setOrderBy(field: string, action: SortingDirectionAction, append?: boolean): void; | ||
| clear(): void; | ||
| directionOf(field: string): OrderDirection | null; | ||
| readonly resolvedOrderBy: readonly Record<string, unknown>[] | undefined; | ||
| } | ||
| export declare function useSortingState(options: UseSortingOptions): SortingStateResult; | ||
| export interface UsePagingOptions { | ||
| /** Initial items per page. null = show all. Default: 50 */ | ||
| initialItemsPerPage?: number | null; | ||
| /** State storage for current page */ | ||
| currentPageStateStorage?: StateStorageOrName; | ||
| /** State storage for page size preference */ | ||
| pagingSettingsStorage?: StateStorageOrName; | ||
| /** Storage key prefix */ | ||
| storageKey?: string; | ||
| } | ||
| export interface PagingStateResult { | ||
| readonly state: PagingState; | ||
| readonly info: PagingInfo; | ||
| readonly hasPrevious: boolean; | ||
| readonly hasNext: boolean; | ||
| goTo(page: number): void; | ||
| next(): void; | ||
| previous(): void; | ||
| first(): void; | ||
| last(): void; | ||
| setItemsPerPage(count: number | null): void; | ||
| setTotalCount(count: number): void; | ||
| refreshTotalCount(): void; | ||
| readonly queryLimit: number | undefined; | ||
| readonly queryOffset: number | undefined; | ||
| } | ||
| export declare function usePagingState(options?: UsePagingOptions): PagingStateResult; | ||
| export interface UseSelectionOptions { | ||
| layouts?: readonly DataViewLayout[]; | ||
| initialSelection?: SelectionValues; | ||
| stateStorage?: StateStorageOrName; | ||
| storageKey?: string; | ||
| } | ||
| export interface SelectionStateResult { | ||
| readonly state: SelectionState; | ||
| setLayout(layout: string | undefined): void; | ||
| setVisibility(name: string, visible: boolean | undefined): void; | ||
| isVisible(name: string, fallback?: boolean): boolean; | ||
| readonly currentLayout: string | undefined; | ||
| } | ||
| export declare function useSelectionState(options?: UseSelectionOptions): SelectionStateResult; | ||
| //# sourceMappingURL=useDataViewState.d.ts.map |
| {"version":3,"file":"useDataViewState.d.ts","sourceRoot":"","sources":["../../src/dataview/useDataViewState.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EACX,UAAU,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,cAAc,EACd,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAM3E,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAC/C,QAAQ,EAAE,cAAc,CAAA;CACxB;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;IACvD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAA;IACrD,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAA;IACzD,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,QAAQ,IAAI,IAAI,CAAA;IAChB,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAA;IAClC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;CAC3D;AAED,MAAM,WAAW,mBAAmB;IACnC,OAAO,EAAE,WAAW,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AM,GAAG,SAAS,CAAA;CAC1C;AAID,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,mBAAwB,GAAG,oBAAoB,CA8BzF"} |
| import { type ReactElement } from 'react'; | ||
| import { type SchemaDefinition, SchemaRegistry, type SelectionInput } from '@contember/bindx'; | ||
| import { type UseEntityOptions, type EntityAccessorResult } from './useEntityImpl.js'; | ||
| import { type UseEntityListOptions, type EntityListAccessorResult } from './useEntityListImpl.js'; | ||
| import type { ComponentBuilder, ComponentBuilderState, CreateComponentOptions } from '../jsx/componentBuilder.types.js'; | ||
| import { type EntityProps } from '../jsx/components/Entity.js'; | ||
| import { type EntityListProps } from '../jsx/components/EntityList.js'; | ||
| export { COMPONENT_MARKER, COMPONENT_SELECTIONS, type SelectionPropMeta } from '../jsx/componentBuilder.js'; | ||
| export type { EntityFields } from '@contember/bindx'; | ||
| export type { UseEntityOptions, EntityAccessorResult, LoadingEntityAccessor, ErrorEntityAccessor, NotFoundEntityAccessor, ReadyEntityAccessor } from './useEntityImpl.js'; | ||
| export type { UseEntityListOptions, EntityListAccessorResult, LoadingEntityListAccessor, ErrorEntityListAccessor, ReadyEntityListAccessor } from './useEntityListImpl.js'; | ||
| /** | ||
| * Creates type-safe bindx hooks and components for a specific schema. | ||
| * | ||
| * @example | ||
| * ```ts | ||
| * const schema = defineSchema<{ | ||
| * Article: Article | ||
| * Author: Author | ||
| * }>({...}) | ||
| * | ||
| * export const { useEntity, useEntityList, Entity, createComponent } = createBindx(schema) | ||
| * ``` | ||
| */ | ||
| export declare function createBindx<TModels extends { | ||
| [K in keyof TModels]: object; | ||
| }>(schemaDefinition: SchemaDefinition<TModels>): { | ||
| useEntity: <TEntityName extends keyof TModels & string, TResult extends object>(entityType: TEntityName, options: UseEntityOptions, definer: SelectionInput<TModels[TEntityName], TResult>) => EntityAccessorResult<TModels[TEntityName], TResult>; | ||
| useEntityList: <TEntityName extends keyof TModels & string, TResult extends object>(entityType: TEntityName, options: UseEntityListOptions, definer: SelectionInput<TModels[TEntityName], TResult>) => EntityListAccessorResult<TResult>; | ||
| Entity: <K extends keyof TModels & string>(props: EntityProps<TModels, K>) => ReactElement | null; | ||
| EntityList: <K extends keyof TModels & string>(props: EntityListProps<TModels, K>) => ReactElement | null; | ||
| createComponent: { | ||
| (): ComponentBuilder<TModels, ComponentBuilderState<TModels, {}, object, readonly string[]>>; | ||
| <TRoles extends readonly string[]>(options: CreateComponentOptions<TRoles>): ComponentBuilder<TModels, ComponentBuilderState<TModels, {}, object, TRoles>>; | ||
| }; | ||
| schemaRegistry: SchemaRegistry<TModels>; | ||
| schema: SchemaRegistry<TModels>; | ||
| }; | ||
| //# sourceMappingURL=createBindx.d.ts.map |
| {"version":3,"file":"createBindx.d.ts","sourceRoot":"","sources":["../../src/hooks/createBindx.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,EACN,KAAK,gBAAgB,EACrB,cAAc,EACd,KAAK,cAAc,EAGnB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAiB,KAAK,gBAAgB,EAAE,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AACpG,OAAO,EAAqB,KAAK,oBAAoB,EAAE,KAAK,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AAQpH,OAAO,KAAK,EACX,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACtB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAA;AAGlF,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAG3G,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACpD,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,sBAAsB,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BhF"} |
| import type { SelectionMeta, EntityUniqueWhere, FieldError } from '@contember/bindx'; | ||
| import type { EntitySnapshot, LoadStatus } from '@contember/bindx'; | ||
| /** | ||
| * Options for useEntityCore hook. | ||
| */ | ||
| export interface UseEntityCoreOptions { | ||
| /** Entity type name */ | ||
| entityType: string; | ||
| /** Unique field(s) to identify the entity (e.g., { id: '...' } or { slug: '...' }) */ | ||
| by: EntityUniqueWhere; | ||
| /** Pre-resolved selection metadata */ | ||
| selectionMeta: SelectionMeta; | ||
| /** Optional query key for cache invalidation (used by JSX pattern) */ | ||
| queryKey?: string; | ||
| /** Whether to use cached data if available */ | ||
| cache?: boolean; | ||
| } | ||
| /** | ||
| * Load state from store | ||
| */ | ||
| interface LoadState { | ||
| status: LoadStatus; | ||
| error?: FieldError; | ||
| } | ||
| /** | ||
| * Result from useEntityCore hook. | ||
| */ | ||
| export interface EntityCoreResult { | ||
| /** Current load status */ | ||
| status: 'loading' | 'error' | 'not_found' | 'ready'; | ||
| /** Error if status is 'error' */ | ||
| error?: FieldError; | ||
| /** Entity snapshot when ready */ | ||
| snapshot: EntitySnapshot | undefined; | ||
| /** Load state from store */ | ||
| loadState: LoadState | undefined; | ||
| /** Whether entity is being persisted */ | ||
| isPersisting: boolean; | ||
| } | ||
| /** | ||
| * Core hook for entity data loading. | ||
| * Handles store subscription, data fetching, and state management. | ||
| * | ||
| * This hook accepts pre-resolved SelectionMeta, allowing it to be used by: | ||
| * - useEntity (which resolves fluent builder to SelectionMeta) | ||
| * - Entity component (which collects JSX selection to SelectionMeta) | ||
| * | ||
| * @internal This hook is for internal use only. | ||
| */ | ||
| export declare function useEntityCore(options: UseEntityCoreOptions): EntityCoreResult; | ||
| export {}; | ||
| //# sourceMappingURL=useEntityCore.d.ts.map |
| {"version":3,"file":"useEntityCore.d.ts","sourceRoot":"","sources":["../../src/hooks/useEntityCore.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,sFAAsF;IACtF,EAAE,EAAE,iBAAiB,CAAA;IACrB,sCAAsC;IACtC,aAAa,EAAE,aAAa,CAAA;IAC5B,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAA;CACf;AAED;;GAEG;AACH,UAAU,SAAS;IAClB,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,CAAC,EAAE,UAAU,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,0BAA0B;IAC1B,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAA;IACnD,iCAAiC;IACjC,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,iCAAiC;IACjC,QAAQ,EAAE,cAAc,GAAG,SAAS,CAAA;IACpC,4BAA4B;IAC5B,SAAS,EAAE,SAAS,GAAG,SAAS,CAAA;IAChC,wCAAwC;IACxC,YAAY,EAAE,OAAO,CAAA;CACrB;AAWD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,gBAAgB,CA0L7E"} |
| import type { SchemaRegistry, EntityUniqueWhere, FieldError } from '@contember/bindx'; | ||
| import type { SelectionMeta } from '@contember/bindx'; | ||
| import type { SelectedEntityFields } from '@contember/bindx'; | ||
| /** | ||
| * Options for useEntity hook | ||
| */ | ||
| export interface UseEntityOptions { | ||
| /** Unique field(s) to identify the entity (e.g., { id: '...' } or { slug: '...' }) */ | ||
| by: EntityUniqueWhere; | ||
| /** If true, use cached data from store if available (default: false) */ | ||
| cache?: boolean; | ||
| } | ||
| /** | ||
| * Loading state for entity accessor | ||
| */ | ||
| export interface LoadingEntityAccessor { | ||
| readonly status: 'loading'; | ||
| readonly isLoading: true; | ||
| readonly isError: false; | ||
| readonly isNotFound: false; | ||
| readonly isPersisting: false; | ||
| readonly isDirty: false; | ||
| readonly id: string; | ||
| readonly fields: never; | ||
| readonly data: never; | ||
| persist(): Promise<void>; | ||
| reset(): void; | ||
| } | ||
| /** | ||
| * Error state for entity accessor | ||
| */ | ||
| export interface ErrorEntityAccessor { | ||
| readonly status: 'error'; | ||
| readonly isLoading: false; | ||
| readonly isError: true; | ||
| readonly isNotFound: false; | ||
| readonly error: FieldError; | ||
| readonly isPersisting: false; | ||
| readonly isDirty: false; | ||
| readonly id: string; | ||
| readonly fields: never; | ||
| readonly data: never; | ||
| persist(): Promise<void>; | ||
| reset(): void; | ||
| } | ||
| /** | ||
| * Not found state for entity accessor | ||
| */ | ||
| export interface NotFoundEntityAccessor { | ||
| readonly status: 'not_found'; | ||
| readonly isLoading: false; | ||
| readonly isError: false; | ||
| readonly isNotFound: true; | ||
| readonly isPersisting: false; | ||
| readonly isDirty: false; | ||
| readonly id: string; | ||
| readonly fields: never; | ||
| readonly data: never; | ||
| persist(): Promise<void>; | ||
| reset(): void; | ||
| } | ||
| /** | ||
| * Ready state base interface for entity accessor | ||
| * | ||
| * @typeParam TEntity - The full entity type | ||
| * @typeParam TSelected - The selected subset of fields (defaults to TEntity for backwards compatibility) | ||
| */ | ||
| export interface ReadyEntityAccessorBase<TEntity extends object, TSelected extends object = TEntity> { | ||
| readonly status: 'ready'; | ||
| readonly isLoading: false; | ||
| readonly isError: false; | ||
| readonly isNotFound: false; | ||
| readonly isPersisting: boolean; | ||
| readonly isDirty: boolean; | ||
| readonly id: string; | ||
| readonly fields: SelectedEntityFields<TEntity, TSelected>; | ||
| readonly data: TSelected; | ||
| persist(): Promise<void>; | ||
| reset(): void; | ||
| } | ||
| /** | ||
| * Ready state for entity accessor with direct field access via Proxy. | ||
| * Access fields directly: `entity.fieldName` instead of `entity.fields.fieldName`. | ||
| * | ||
| * @typeParam TEntity - The full entity type | ||
| * @typeParam TSelected - The selected subset of fields (defaults to TEntity for backwards compatibility) | ||
| */ | ||
| export type ReadyEntityAccessor<TEntity extends object, TSelected extends object = TEntity> = ReadyEntityAccessorBase<TEntity, TSelected> & SelectedEntityFields<TEntity, TSelected>; | ||
| /** | ||
| * Union of all entity accessor states | ||
| * | ||
| * @typeParam TEntity - The full entity type | ||
| * @typeParam TSelected - The selected subset of fields (defaults to TEntity for backwards compatibility) | ||
| */ | ||
| export type EntityAccessorResult<TEntity extends object, TSelected extends object = TEntity> = LoadingEntityAccessor | ErrorEntityAccessor | NotFoundEntityAccessor | ReadyEntityAccessor<TEntity, TSelected>; | ||
| /** | ||
| * Generic implementation of useEntity hook. | ||
| * Used by createBindx to create typed versions. | ||
| * | ||
| * @typeParam TEntity - The full entity type | ||
| * @typeParam TSelected - The selected subset of fields | ||
| * @internal | ||
| */ | ||
| export declare function useEntityImpl<TEntity extends object, TSelected extends object>(entityType: string, options: UseEntityOptions, selectionMeta: SelectionMeta, schema: SchemaRegistry<Record<string, object>>): EntityAccessorResult<TEntity, TSelected>; | ||
| //# sourceMappingURL=useEntityImpl.d.ts.map |
| {"version":3,"file":"useEntityImpl.d.ts","sourceRoot":"","sources":["../../src/hooks/useEntityImpl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAKrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAgB,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE1E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,sFAAsF;IACtF,EAAE,EAAE,iBAAiB,CAAA;IACrB,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,MAAM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B,sBAAsB,GACtB,mBAAmB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;AAoF1C;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,SAAS,MAAM,EAAE,SAAS,SAAS,MAAM,EAC7E,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,gBAAgB,EACzB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC5C,oBAAoB,CAAC,OAAO,EAAE,SAAS,CAAC,CA+F1C"} |
| import type { SelectionMeta, FieldError } from '@contember/bindx'; | ||
| /** | ||
| * Options for useEntityListCore hook. | ||
| */ | ||
| export interface UseEntityListCoreOptions { | ||
| /** Entity type name */ | ||
| entityType: string; | ||
| /** Optional filter criteria */ | ||
| filter?: Record<string, unknown>; | ||
| /** Optional ordering */ | ||
| orderBy?: readonly Record<string, unknown>[]; | ||
| /** Optional limit */ | ||
| limit?: number; | ||
| /** Optional offset */ | ||
| offset?: number; | ||
| /** Pre-resolved selection metadata */ | ||
| selectionMeta: SelectionMeta; | ||
| /** Optional query key for cache invalidation */ | ||
| queryKey?: string; | ||
| } | ||
| /** | ||
| * Item in the entity list result | ||
| */ | ||
| export interface EntityListCoreItem { | ||
| id: string; | ||
| data: Record<string, unknown>; | ||
| } | ||
| /** | ||
| * Result from useEntityListCore hook. | ||
| */ | ||
| export interface EntityListCoreResult { | ||
| /** Current load status */ | ||
| status: 'loading' | 'error' | 'ready'; | ||
| /** Error if status is 'error' */ | ||
| error?: FieldError; | ||
| /** List items when ready */ | ||
| items: EntityListCoreItem[]; | ||
| } | ||
| /** | ||
| * Core hook for entity list data loading. | ||
| * Handles store subscription, data fetching, and state management. | ||
| * | ||
| * This hook accepts pre-resolved SelectionMeta, allowing it to be used by: | ||
| * - EntityList component (which collects JSX selection to SelectionMeta) | ||
| * | ||
| * @internal This hook is for internal use only. | ||
| */ | ||
| export declare function useEntityListCore(options: UseEntityListCoreOptions): EntityListCoreResult; | ||
| //# sourceMappingURL=useEntityListCore.d.ts.map |
| {"version":3,"file":"useEntityListCore.d.ts","sourceRoot":"","sources":["../../src/hooks/useEntityListCore.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEjE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,wBAAwB;IACxB,OAAO,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC5C,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,sCAAsC;IACtC,aAAa,EAAE,aAAa,CAAA;IAC5B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,0BAA0B;IAC1B,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;IACrC,iCAAiC;IACjC,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,4BAA4B;IAC5B,KAAK,EAAE,kBAAkB,EAAE,CAAA;CAC3B;AAWD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,oBAAoB,CAkKzF"} |
| import type { SchemaRegistry, EntityAccessor } from '@contember/bindx'; | ||
| import type { SelectionMeta, FieldError } from '@contember/bindx'; | ||
| /** | ||
| * Options for useEntityList hook | ||
| */ | ||
| export interface UseEntityListOptions { | ||
| /** Optional filter criteria */ | ||
| filter?: Record<string, unknown>; | ||
| /** Optional ordering */ | ||
| orderBy?: readonly Record<string, unknown>[]; | ||
| /** Optional limit */ | ||
| limit?: number; | ||
| /** Optional offset */ | ||
| offset?: number; | ||
| } | ||
| /** | ||
| * Loading state for entity list accessor | ||
| */ | ||
| export interface LoadingEntityListAccessor { | ||
| readonly status: 'loading'; | ||
| readonly isLoading: true; | ||
| readonly isError: false; | ||
| readonly isDirty: false; | ||
| readonly items: never; | ||
| readonly length: 0; | ||
| add(data?: unknown): string; | ||
| remove(key: string): void; | ||
| move(fromIndex: number, toIndex: number): void; | ||
| } | ||
| /** | ||
| * Error state for entity list accessor | ||
| */ | ||
| export interface ErrorEntityListAccessor { | ||
| readonly status: 'error'; | ||
| readonly isLoading: false; | ||
| readonly isError: true; | ||
| readonly error: FieldError; | ||
| readonly isDirty: false; | ||
| readonly items: never; | ||
| readonly length: 0; | ||
| add(data?: unknown): string; | ||
| remove(key: string): void; | ||
| move(fromIndex: number, toIndex: number): void; | ||
| } | ||
| /** | ||
| * Ready state for entity list accessor | ||
| */ | ||
| export interface ReadyEntityListAccessor<T extends object> { | ||
| readonly status: 'ready'; | ||
| readonly isLoading: false; | ||
| readonly isError: false; | ||
| readonly isDirty: boolean; | ||
| readonly items: Array<EntityAccessor<T>>; | ||
| readonly length: number; | ||
| add(data?: Partial<T>): string; | ||
| remove(key: string): void; | ||
| move(fromIndex: number, toIndex: number): void; | ||
| } | ||
| /** | ||
| * Union of all entity list accessor states | ||
| */ | ||
| export type EntityListAccessorResult<T extends object> = LoadingEntityListAccessor | ErrorEntityListAccessor | ReadyEntityListAccessor<T>; | ||
| /** | ||
| * Generic implementation of useEntityList hook. | ||
| * Used by createBindx to create typed versions. | ||
| * | ||
| * @internal | ||
| */ | ||
| export declare function useEntityListImpl<TResult extends object>(entityType: string, options: UseEntityListOptions, selectionMeta: SelectionMeta, schema: SchemaRegistry<Record<string, object>>): EntityListAccessorResult<TResult>; | ||
| //# sourceMappingURL=useEntityListImpl.d.ts.map |
| {"version":3,"file":"useEntityListImpl.d.ts","sourceRoot":"","sources":["../../src/hooks/useEntityListImpl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAMtE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEjE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,wBAAwB;IACxB,OAAO,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC5C,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAA;IACvB,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;IACrB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IAClB,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC3B,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAA;IACzB,QAAQ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7B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAC5C,wBAAwB,CAAC,OAAO,CAAC,CA+OnC"} |
| import { type ReactNode } from 'react'; | ||
| import type { SelectionMeta } from '@contember/bindx'; | ||
| import type { EntityAccessor } from '../jsx/types.js'; | ||
| /** | ||
| * Options for useSelectionCollectionForList hook. | ||
| */ | ||
| export interface UseSelectionCollectionForListOptions<T> { | ||
| /** Entity type name (for debugging) */ | ||
| entityType: string; | ||
| /** Optional filter (for dependency tracking) */ | ||
| filter?: Record<string, unknown>; | ||
| /** Optional ordering (for dependency tracking) */ | ||
| orderBy?: readonly Record<string, unknown>[]; | ||
| /** Optional limit (for dependency tracking) */ | ||
| limit?: number; | ||
| /** Optional offset (for dependency tracking) */ | ||
| offset?: number; | ||
| /** Children render function - receives entity and index */ | ||
| children: (entity: EntityAccessor<T>, index: number) => ReactNode; | ||
| } | ||
| /** | ||
| * Result from useSelectionCollectionForList hook. | ||
| */ | ||
| export interface SelectionCollectionForListResult { | ||
| /** Selection metadata for query building */ | ||
| selection: SelectionMeta; | ||
| /** Stable query key for dependency tracking */ | ||
| queryKey: string; | ||
| } | ||
| /** | ||
| * Hook for collecting field selection from JSX children for entity lists. | ||
| * Similar to useSelectionCollection but for list rendering. | ||
| * | ||
| * Calls children once with a collector proxy and index 0 to gather | ||
| * the template selection that will be applied to all items. | ||
| * | ||
| * @internal This hook is for internal use only. | ||
| */ | ||
| export declare function useSelectionCollectionForList<T>(options: UseSelectionCollectionForListOptions<T>): SelectionCollectionForListResult; | ||
| //# sourceMappingURL=useSelectionCollectionForList.d.ts.map |
| {"version":3,"file":"useSelectionCollectionForList.d.ts","sourceRoot":"","sources":["../../src/hooks/useSelectionCollectionForList.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAKnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGrD;;GAEG;AACH,MAAM,WAAW,oCAAoC,CAAC,CAAC;IACtD,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAA;IAClB,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,kDAAkD;IAClD,OAAO,CAAC,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC5C,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gDAAgD;IAChD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,2DAA2D;IAC3D,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,SAAS,CAAA;CACjE;AAED;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD,4CAA4C;IAC5C,SAAS,EAAE,aAAa,CAAA;IACxB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAA;CAChB;AAUD;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAC9C,OAAO,EAAE,oCAAoC,CAAC,CAAC,CAAC,GAC9C,gCAAgC,CA6DlC"} |
| import { type SelectionInput, type SelectionMeta } from '@contember/bindx'; | ||
| /** | ||
| * Resolves a SelectionInput to SelectionMeta with referential stability. | ||
| * | ||
| * Always resolves the latest definer on every render, but returns a stable | ||
| * object reference when the resulting query structure hasn't changed. | ||
| * This fixes the memoization bug where changing the definer had no effect, | ||
| * while avoiding unnecessary re-fetches from inline function references. | ||
| */ | ||
| export declare function useStableSelectionMeta<TModel, TResult extends object>(definer: SelectionInput<TModel, TResult>): SelectionMeta; | ||
| //# sourceMappingURL=useStableSelectionMeta.d.ts.map |
| {"version":3,"file":"useStableSelectionMeta.d.ts","sourceRoot":"","sources":["../../src/hooks/useStableSelectionMeta.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,MAAM,kBAAkB,CAAA;AAEzB;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,SAAS,MAAM,EACpE,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,GACtC,aAAa,CAUf"} |
| import type { SnapshotStore, SelectionMeta } from '@contember/bindx'; | ||
| import { type EntityAccessor, type EntityFields } from './types.js'; | ||
| import { type NotifyChange } from './proxyShared.js'; | ||
| /** | ||
| * Creates a fields proxy that reads directly from inline data. | ||
| * Used for nested relations to avoid store modifications during render. | ||
| */ | ||
| export declare function createInlineFieldsProxy(data: Record<string, unknown>, basePath: string[], store: SnapshotStore, notifyChange: NotifyChange, selection?: SelectionMeta): EntityFields<unknown>; | ||
| /** | ||
| * Creates an accessor that reads directly from inline data. | ||
| * Used for nested relations to avoid store modifications during render. | ||
| */ | ||
| export declare function createInlineAccessor(data: Record<string, unknown>, basePath: string[], store: SnapshotStore, notifyChange: NotifyChange, selection?: SelectionMeta): EntityAccessor<unknown>; | ||
| //# sourceMappingURL=inlineProxy.d.ts.map |
| {"version":3,"file":"inlineProxy.d.ts","sourceRoot":"","sources":["../../src/jsx/inlineProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAc,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhF,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,YAAY,EAKjB,MAAM,YAAY,CAAA;AACnB,OAAO,EACN,KAAK,YAAY,EAMjB,MAAM,kBAAkB,CAAA;AAEzB;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,YAAY,EAC1B,SAAS,CAAC,EAAE,aAAa,GACvB,YAAY,CAAC,OAAO,CAAC,CAOvB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,YAAY,EAC1B,SAAS,CAAC,EAAE,aAAa,GACvB,cAAc,CAAC,OAAO,CAAC,CA6BzB"} |
| import type { SnapshotStore, SelectionMeta } from '@contember/bindx'; | ||
| import { type EntityAccessor } from './types.js'; | ||
| import { type NotifyChange } from './proxyShared.js'; | ||
| /** | ||
| * Creates a runtime accessor with real data from SnapshotStore. | ||
| * Supports direct field access: `entity.fieldName` is equivalent to `entity.$fields.fieldName`. | ||
| * | ||
| * @param selection - Optional selection metadata. When provided, accessing fields not in the selection will throw UnfetchedFieldError. | ||
| */ | ||
| export declare function createRuntimeAccessor<T>(entityType: string, entityId: string, store: SnapshotStore, notifyChange: NotifyChange, path?: string[], selection?: SelectionMeta): EntityAccessor<T>; | ||
| //# sourceMappingURL=runtimeProxy.d.ts.map |
| {"version":3,"file":"runtimeProxy.d.ts","sourceRoot":"","sources":["../../src/jsx/runtimeProxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAc,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhF,OAAO,EAEN,KAAK,cAAc,EAMnB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACN,KAAK,YAAY,EAOjB,MAAM,kBAAkB,CAAA;AAGzB;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACtC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,aAAa,EACpB,YAAY,EAAE,YAAY,EAC1B,IAAI,GAAE,MAAM,EAAO,EACnB,SAAS,CAAC,EAAE,aAAa,GACvB,cAAc,CAAC,CAAC,CAAC,CAqEnB"} |
353638
-24.93%130
-32.99%8430
-15.08%