@gridstorm/vue 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types.ts","../src/composables.ts","../src/GridStorm.ts"],"names":["inject","ref","watch","onUnmounted","computed","defineComponent","shallowRef","provide","createGrid","DomRenderer","onMounted","onBeforeUnmount","h"],"mappings":";;;;;;;;;AA4EO,IAAM,iBAAA,GAAoB;AAAA,EAC/B,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,KAAA;AAAA,IACN,OAAA,EAAS,MAAM;AAAC,GAClB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAA,EAAM,QAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,YAAA,EAAc;AAAA,IACZ,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,OAAA,EAAS;AAAA,IACP,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,aAAA,EAAe;AAAA,IACb,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,kBAAA,EAAoB;AAAA,IAClB,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,UAAA,EAAY;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN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AClB,CAAA;AAGD,IAAA,OAAO,MAAM;AACX,MAAA,MAAM,WAAA,GACJ,OAAO,KAAA,CAAM,MAAA,KAAW,WAAW,CAAA,EAAG,KAAA,CAAM,MAAM,CAAA,EAAA,CAAA,GAAO,KAAA,CAAM,MAAA;AACjE,MAAA,MAAM,UAAA,GACJ,OAAO,KAAA,CAAM,KAAA,KAAU,WAAW,CAAA,EAAG,KAAA,CAAM,KAAK,CAAA,EAAA,CAAA,GAAO,KAAA,CAAM,KAAA;AAE/D,MAAA,OAAOU,MAAE,KAAA,EAAO;AAAA,QACd,GAAA,EAAK,YAAA;AAAA,QACL,KAAA,EAAO,CAAC,mBAAA,EAAqB,KAAA,CAAM,cAAc,EAAE,MAAA,CAAO,OAAO,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AAAA,QAC3E,cAAc,KAAA,CAAM,KAAA;AAAA,QACpB,gBAAgB,KAAA,CAAM,OAAA;AAAA,QACtB,KAAA,EAAO;AAAA,UACL,KAAA,EAAO,UAAA;AAAA,UACP,MAAA,EAAQ;AAAA;AACV,OACD,CAAA;AAAA,IACH,CAAA;AAAA,EACF;AACF,CAAC","file":"index.cjs","sourcesContent":["// ─── Vue Adapter Types ───\n// Central type definitions for all Vue-specific interfaces.\n\nimport type {\n ColumnDef,\n GridApi,\n GridConfig,\n GridEngine,\n GridEventMap,\n GridPlugin,\n SortModelItem,\n FilterModel,\n RowNode,\n} from '@gridstorm/core';\nimport type { PropType } from 'vue';\n\n// ── Grid Context ──\n\n/**\n * Context value provided to child composables via Vue provide/inject.\n */\nexport interface GridContextValue<TData = any> {\n /** The grid engine instance. */\n engine: GridEngine<TData>;\n /** The public grid API. */\n api: GridApi<TData>;\n}\n\n// ── Component Props ──\n\n/**\n * Props interface for the GridStorm Vue component.\n *\n * @typeParam TData - The type of each row data object.\n */\nexport interface GridStormProps<TData = any> {\n /** Column definitions. */\n columns: ColumnDef<TData>[];\n /** Row data array. */\n rowData: TData[];\n /** Plugins to install. */\n plugins?: GridPlugin<TData>[];\n /** Row ID getter function. */\n getRowId?: GridConfig<TData>['getRowId'];\n /** Row height in pixels. */\n rowHeight?: number;\n /** Header height in pixels. */\n headerHeight?: number;\n /** Theme identifier (e.g., 'light', 'dark'). */\n theme?: string;\n /** Density mode (e.g., 'compact', 'normal', 'comfortable'). */\n density?: string;\n /** Default column definition applied to all columns. */\n defaultColDef?: Partial<ColumnDef<TData>>;\n /** Number of rows per page when pagination is enabled. */\n paginationPageSize?: number;\n /** Enable client-side pagination. */\n pagination?: boolean;\n /** Row selection mode. */\n rowSelection?: 'single' | 'multiple' | false;\n /** Edit type mode. */\n editType?: 'cell' | 'fullRow';\n /** ARIA label for the grid root element. */\n ariaLabel?: string;\n /** Container height. Default: '100%'. */\n height?: number | string;\n /** Container width. Default: '100%'. */\n width?: number | string;\n /** Additional CSS class for the container. */\n containerClass?: string;\n}\n\n/**\n * Vue prop definitions for the GridStorm component.\n * Used with defineComponent's props option.\n */\nexport const gridStormPropDefs = {\n columns: {\n type: Array as PropType<ColumnDef[]>,\n required: true as const,\n },\n rowData: {\n type: Array as PropType<any[]>,\n required: true as const,\n },\n plugins: {\n type: Array as PropType<GridPlugin[]>,\n default: () => [],\n },\n getRowId: {\n type: Function as PropType<GridConfig['getRowId']>,\n default: undefined,\n },\n rowHeight: {\n type: Number,\n default: 40,\n },\n headerHeight: {\n type: Number,\n default: undefined,\n },\n theme: {\n type: String,\n default: 'light',\n },\n density: {\n type: String,\n default: 'normal',\n },\n defaultColDef: {\n type: Object as PropType<Partial<ColumnDef>>,\n default: undefined,\n },\n paginationPageSize: {\n type: Number,\n default: undefined,\n },\n pagination: {\n type: Boolean,\n default: undefined,\n },\n rowSelection: {\n type: [String, Boolean] as PropType<'single' | 'multiple' | false>,\n default: undefined,\n },\n editType: {\n type: String as PropType<'cell' | 'fullRow'>,\n default: undefined,\n },\n ariaLabel: {\n type: String,\n default: undefined,\n },\n height: {\n type: [Number, String] as PropType<number | string>,\n default: '100%',\n },\n width: {\n type: [Number, String] as PropType<number | string>,\n default: '100%',\n },\n containerClass: {\n type: String,\n default: undefined,\n },\n} as const;\n\n// ── Event Types ──\n\n/**\n * All events emitted by the GridStorm Vue component.\n */\nexport interface GridStormEmits<TData = any> {\n /** Fired when the grid engine is ready and the API is available. */\n gridReady: [api: GridApi<TData>];\n /** Fired when row data changes. */\n rowDataChanged: [event: GridEventMap<TData>['rowData:changed']];\n /** Fired when the selection changes. */\n selectionChanged: [event: GridEventMap<TData>['selection:changed']];\n /** Fired when the sort model changes. */\n sortChanged: [event: GridEventMap<TData>['column:sort:changed']];\n /** Fired when the filter model changes. */\n filterChanged: [event: GridEventMap<TData>['filter:changed']];\n /** Fired when a cell value is changed via editing. */\n cellValueChanged: [event: GridEventMap<TData>['cell:valueChanged']];\n /** Fired when a cell is clicked. */\n cellClicked: [event: GridEventMap<TData>['cell:clicked']];\n /** Fired when a cell is double-clicked. */\n cellDoubleClicked: [event: GridEventMap<TData>['cell:doubleClicked']];\n /** Fired when a row is clicked. */\n rowClicked: [event: GridEventMap<TData>['row:clicked']];\n /** Fired when pagination state changes. */\n paginationChanged: [event: GridEventMap<TData>['pagination:changed']];\n /** Fired when a column is resized. */\n columnResized: [event: GridEventMap<TData>['column:resized']];\n}\n\n// ── Exposed API ──\n\n/**\n * Public methods exposed by the GridStorm component via template refs.\n *\n * @typeParam TData - The type of each row data object.\n */\nexport interface GridStormExposed<TData = any> {\n /** Get the GridApi instance. */\n getApi(): GridApi<TData> | undefined;\n /** Get the GridEngine instance. */\n getEngine(): GridEngine<TData> | undefined;\n}\n\n// ── Composable Return Types ──\n\n/**\n * Return type for the useGridSort composable.\n */\nexport interface GridSortResult {\n /** Current sort model (reactive). */\n sortModel: SortModelItem[];\n /** Whether any sort is active (reactive). */\n isSorted: boolean;\n /** Set the sort model directly. */\n setSortModel: (model: SortModelItem[]) => void;\n /** Toggle sort on a column. */\n toggleSort: (colId: string, multiSort?: boolean) => void;\n /** Clear all sorting. */\n clearSort: () => void;\n}\n\n/**\n * Return type for the useGridFilter composable.\n */\nexport interface GridFilterResult {\n /** Current filter model keyed by column ID (reactive). */\n filterModel: Record<string, FilterModel>;\n /** Current quick filter text (reactive). */\n quickFilterText: string;\n /** Whether any filter is active (reactive). */\n isFiltered: boolean;\n /** Set the filter model. */\n setFilterModel: (model: Record<string, FilterModel>) => void;\n /** Set quick filter text. */\n setQuickFilter: (text: string) => void;\n /** Clear all filters. */\n clearFilters: () => void;\n}\n\n/**\n * Return type for the useGridSelection composable.\n */\nexport interface GridSelectionResult<TData = any> {\n /** Set of selected row IDs (reactive). */\n selectedRowIds: Set<string>;\n /** Number of selected rows (reactive). */\n selectedCount: number;\n /** Get selected row data objects. */\n getSelectedRows: () => TData[];\n /** Get selected RowNode objects. */\n getSelectedNodes: () => RowNode<TData>[];\n /** Check if a specific row is selected. */\n isRowSelected: (rowId: string) => boolean;\n /** Select all visible rows. */\n selectAll: () => void;\n /** Deselect all rows. */\n deselectAll: () => void;\n}\n\n/**\n * Return type for the useGridPagination composable.\n */\nexport interface GridPaginationResult {\n /** Current page (0-indexed, reactive). */\n currentPage: number;\n /** Total number of pages (reactive). */\n totalPages: number;\n /** Rows per page (reactive). */\n pageSize: number;\n /** Total row count after filtering (reactive). */\n totalRows: number;\n /** Whether there is a next page (reactive). */\n hasNextPage: boolean;\n /** Whether there is a previous page (reactive). */\n hasPreviousPage: boolean;\n /** Go to a specific page. */\n goToPage: (page: number) => void;\n /** Go to next page. */\n nextPage: () => void;\n /** Go to previous page. */\n previousPage: () => void;\n /** Go to first page. */\n firstPage: () => void;\n /** Go to last page. */\n lastPage: () => void;\n}\n","// ─── Vue 3 Composables for GridStorm ───\n// Provide/inject-based composables that mirror the React hooks API.\n// All composables must be called inside a component that is a child of <GridStorm>.\n\nimport {\n inject,\n ref,\n onUnmounted,\n computed,\n watch,\n type InjectionKey,\n type Ref,\n type ShallowRef,\n} from 'vue';\nimport type { GridApi, GridEngine, SortModelItem, FilterModel, RowNode } from '@gridstorm/core';\nimport type { GridContextValue } from './types';\n\n// ── Context Key ──\n\n/**\n * Injection key used internally to provide/inject the grid context.\n * Uses ShallowRef to avoid deep reactive unwrapping of GridEngine internals\n * (the Store class has private fields incompatible with Vue's deep proxy typing).\n */\nexport const GRID_CONTEXT_KEY: InjectionKey<ShallowRef<GridContextValue | null>> =\n Symbol('gridstorm-context');\n\n// ── Internal helper ──\n\n/**\n * Internal helper to get the grid context with validation.\n * Throws if called outside a <GridStorm> component hierarchy.\n */\nfunction useGridContext<TData = any>(): ShallowRef<GridContextValue<TData> | null> {\n const context = inject(GRID_CONTEXT_KEY, null);\n if (!context) {\n throw new Error(\n '[GridStorm] Composable must be used within a <GridStorm> component.',\n );\n }\n return context as ShallowRef<GridContextValue<TData> | null>;\n}\n\n/**\n * Subscribe to the grid store and keep a reactive ref in sync.\n * Returns the reactive ref and automatically unsubscribes on unmount.\n */\nfunction useStoreRef<T>(\n context: ShallowRef<GridContextValue | null>,\n selector: (engine: GridEngine) => T,\n): Ref<T | undefined> {\n const value = ref<T | undefined>() as Ref<T | undefined>;\n let unsubscribe: (() => void) | null = null;\n\n function subscribe(ctx: GridContextValue | null) {\n // Clean up previous subscription\n if (unsubscribe) {\n unsubscribe();\n unsubscribe = null;\n }\n\n if (!ctx) {\n value.value = undefined;\n return;\n }\n\n // Set initial value\n value.value = selector(ctx.engine);\n\n // Subscribe to store changes\n unsubscribe = ctx.engine.store.subscribe(() => {\n value.value = selector(ctx.engine);\n });\n }\n\n // Watch for context changes (grid initialization/destruction)\n watch(context, (newCtx) => subscribe(newCtx), { immediate: true });\n\n onUnmounted(() => {\n if (unsubscribe) {\n unsubscribe();\n unsubscribe = null;\n }\n });\n\n return value;\n}\n\n// ── Public Composables ──\n\n/**\n * Access the GridApi instance from a parent GridStorm component.\n *\n * Returns a computed ref that resolves to the GridApi once the grid is initialized.\n * The ref will be undefined until the grid has mounted.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useGridApi } from '@gridstorm/vue';\n *\n * const api = useGridApi();\n *\n * function exportData() {\n * const rows = api.value?.getSelectedRows() ?? [];\n * console.log('Selected:', rows);\n * }\n * </script>\n * ```\n */\nexport function useGridApi<TData = any>(): Ref<GridApi<TData> | undefined> {\n const context = useGridContext<TData>();\n return computed(() => context.value?.api);\n}\n\n/**\n * Access the GridEngine instance from a parent GridStorm component.\n *\n * Primarily useful for advanced use cases that need direct access to\n * the store, event bus, or command bus.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useGridEngine } from '@gridstorm/vue';\n *\n * const engine = useGridEngine();\n * </script>\n * ```\n */\nexport function useGridEngine<TData = any>(): Ref<GridEngine<TData> | undefined> {\n const context = useGridContext<TData>();\n return computed(() => context.value?.engine);\n}\n\n/**\n * Reactive sort model state and sort actions.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useGridSort } from '@gridstorm/vue';\n *\n * const { sortModel, isSorted, toggleSort, clearSort } = useGridSort();\n * </script>\n *\n * <template>\n * <button @click=\"toggleSort('name')\">Sort by Name</button>\n * <button v-if=\"isSorted\" @click=\"clearSort()\">Clear Sort</button>\n * <pre>{{ sortModel }}</pre>\n * </template>\n * ```\n */\nexport function useGridSort(): {\n sortModel: Ref<SortModelItem[]>;\n isSorted: Ref<boolean>;\n setSortModel: (model: SortModelItem[]) => void;\n toggleSort: (colId: string, multiSort?: boolean) => void;\n clearSort: () => void;\n} {\n const context = useGridContext();\n\n const sortModel = useStoreRef(context, (engine) =>\n engine.store.getState().sortModel,\n );\n\n const isSorted = computed(() => (sortModel.value?.length ?? 0) > 0);\n\n function setSortModel(model: SortModelItem[]): void {\n context.value?.api.setSortModel(model);\n }\n\n function toggleSort(colId: string, multiSort = false): void {\n context.value?.engine.commandBus.dispatch('sort:toggle', {\n colId,\n multiSort,\n });\n }\n\n function clearSort(): void {\n context.value?.api.setSortModel([]);\n }\n\n return {\n sortModel: sortModel as Ref<SortModelItem[]>,\n isSorted,\n setSortModel,\n toggleSort,\n clearSort,\n };\n}\n\n/**\n * Reactive filter model state and filter actions.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useGridFilter } from '@gridstorm/vue';\n *\n * const { isFiltered, setQuickFilter, clearFilters } = useGridFilter();\n * </script>\n *\n * <template>\n * <input @input=\"(e) => setQuickFilter((e.target as HTMLInputElement).value)\" />\n * <button v-if=\"isFiltered\" @click=\"clearFilters()\">Clear Filters</button>\n * </template>\n * ```\n */\nexport function useGridFilter(): {\n filterModel: Ref<Record<string, FilterModel>>;\n quickFilterText: Ref<string>;\n isFiltered: Ref<boolean>;\n setFilterModel: (model: Record<string, FilterModel>) => void;\n setQuickFilter: (text: string) => void;\n clearFilters: () => void;\n} {\n const context = useGridContext();\n\n const filterModel = useStoreRef(context, (engine) =>\n engine.store.getState().filterModel,\n );\n\n const quickFilterText = useStoreRef(context, (engine) =>\n engine.store.getState().quickFilterText,\n );\n\n const isFiltered = computed(() => {\n const hasColumnFilters = Object.keys(filterModel.value ?? {}).length > 0;\n const hasQuickFilter = (quickFilterText.value ?? '').length > 0;\n return hasColumnFilters || hasQuickFilter;\n });\n\n function setFilterModel(model: Record<string, FilterModel>): void {\n context.value?.api.setFilterModel(model);\n }\n\n function setQuickFilter(text: string): void {\n context.value?.api.setQuickFilter(text);\n }\n\n function clearFilters(): void {\n context.value?.api.setFilterModel({});\n context.value?.api.setQuickFilter('');\n }\n\n return {\n filterModel: filterModel as Ref<Record<string, FilterModel>>,\n quickFilterText: quickFilterText as Ref<string>,\n isFiltered,\n setFilterModel,\n setQuickFilter,\n clearFilters,\n };\n}\n\n/**\n * Reactive selection state and selection actions.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useGridSelection } from '@gridstorm/vue';\n *\n * const { selectedCount, selectAll, deselectAll, isRowSelected } = useGridSelection();\n * </script>\n *\n * <template>\n * <p>{{ selectedCount }} rows selected</p>\n * <button @click=\"selectAll()\">Select All</button>\n * <button @click=\"deselectAll()\">Deselect All</button>\n * </template>\n * ```\n */\nexport function useGridSelection<TData = any>(): {\n selectedRowIds: Ref<Set<string>>;\n selectedCount: Ref<number>;\n getSelectedRows: () => TData[];\n getSelectedNodes: () => RowNode<TData>[];\n isRowSelected: (rowId: string) => boolean;\n selectAll: () => void;\n deselectAll: () => void;\n} {\n const context = useGridContext<TData>();\n\n const selectedRowIds = useStoreRef(context, (engine) =>\n engine.store.getState().selection.selectedRowIds,\n );\n\n const selectedCount = computed(() => selectedRowIds.value?.size ?? 0);\n\n function getSelectedRows(): TData[] {\n return context.value?.api.getSelectedRows() ?? [];\n }\n\n function getSelectedNodes(): RowNode<TData>[] {\n return context.value?.api.getSelectedNodes() ?? [];\n }\n\n function isRowSelected(rowId: string): boolean {\n return selectedRowIds.value?.has(rowId) ?? false;\n }\n\n function selectAll(): void {\n context.value?.api.selectAll();\n }\n\n function deselectAll(): void {\n context.value?.api.deselectAll();\n }\n\n return {\n selectedRowIds: selectedRowIds as Ref<Set<string>>,\n selectedCount,\n getSelectedRows,\n getSelectedNodes,\n isRowSelected,\n selectAll,\n deselectAll,\n };\n}\n\n/**\n * Reactive pagination state and navigation actions.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useGridPagination } from '@gridstorm/vue';\n *\n * const {\n * currentPage,\n * totalPages,\n * hasNextPage,\n * hasPreviousPage,\n * nextPage,\n * previousPage,\n * } = useGridPagination();\n * </script>\n *\n * <template>\n * <div class=\"pagination\">\n * <button :disabled=\"!hasPreviousPage\" @click=\"previousPage()\">Prev</button>\n * <span>Page {{ currentPage + 1 }} of {{ totalPages }}</span>\n * <button :disabled=\"!hasNextPage\" @click=\"nextPage()\">Next</button>\n * </div>\n * </template>\n * ```\n */\nexport function useGridPagination(): {\n currentPage: Ref<number>;\n totalPages: Ref<number>;\n pageSize: Ref<number>;\n totalRows: Ref<number>;\n hasNextPage: Ref<boolean>;\n hasPreviousPage: Ref<boolean>;\n goToPage: (page: number) => void;\n nextPage: () => void;\n previousPage: () => void;\n firstPage: () => void;\n lastPage: () => void;\n} {\n const context = useGridContext();\n\n const paginationState = useStoreRef(context, (engine) =>\n engine.store.getState().pagination,\n );\n\n const currentPage = computed(() => paginationState.value?.currentPage ?? 0);\n const pageSize = computed(() => paginationState.value?.pageSize ?? 100);\n const totalRows = computed(() => paginationState.value?.totalRows ?? 0);\n const totalPages = computed(() =>\n Math.max(1, Math.ceil(totalRows.value / pageSize.value)),\n );\n const hasNextPage = computed(() => currentPage.value < totalPages.value - 1);\n const hasPreviousPage = computed(() => currentPage.value > 0);\n\n function goToPage(page: number): void {\n context.value?.api.paginationGoToPage(page);\n }\n\n function nextPage(): void {\n if (hasNextPage.value) {\n context.value?.api.paginationGoToPage(currentPage.value + 1);\n }\n }\n\n function previousPage(): void {\n if (hasPreviousPage.value) {\n context.value?.api.paginationGoToPage(currentPage.value - 1);\n }\n }\n\n function firstPage(): void {\n context.value?.api.paginationGoToPage(0);\n }\n\n function lastPage(): void {\n context.value?.api.paginationGoToPage(totalPages.value - 1);\n }\n\n return {\n currentPage,\n totalPages,\n pageSize,\n totalRows,\n hasNextPage,\n hasPreviousPage,\n goToPage,\n nextPage,\n previousPage,\n firstPage,\n lastPage,\n };\n}\n\n/**\n * Listen to a specific grid event with automatic cleanup on unmount.\n *\n * @param event - The event name from GridEventMap.\n * @param handler - Callback function invoked when the event fires.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { useGridEvent } from '@gridstorm/vue';\n *\n * useGridEvent('selection:changed', (e) => {\n * console.log('Selection changed:', e.selectedNodes);\n * });\n * </script>\n * ```\n */\nexport function useGridEvent<TData = any>(\n event: string,\n handler: (payload: any) => void,\n): void {\n const context = useGridContext<TData>();\n let unsubscribe: (() => void) | null = null;\n\n watch(\n context,\n (ctx) => {\n // Clean up previous listener\n if (unsubscribe) {\n unsubscribe();\n unsubscribe = null;\n }\n\n if (ctx) {\n unsubscribe = ctx.engine.eventBus.on(event as any, handler);\n }\n },\n { immediate: true },\n );\n\n onUnmounted(() => {\n if (unsubscribe) {\n unsubscribe();\n unsubscribe = null;\n }\n });\n}\n","// ─── GridStorm Vue 3 Component ───\n// Production-grade Vue wrapper around the headless core engine.\n// Uses defineComponent with a render function (no .vue SFC) for tsup compatibility.\n// Supports event emission, reactive prop watching, and composable injection.\n\nimport {\n defineComponent,\n ref,\n shallowRef,\n onMounted,\n onBeforeUnmount,\n watch,\n provide,\n h,\n} from 'vue';\nimport type { GridEngine } from '@gridstorm/core';\nimport { createGrid } from '@gridstorm/core';\nimport { DomRenderer } from '@gridstorm/dom-renderer';\nimport { gridStormPropDefs } from './types';\nimport type { GridContextValue } from './types';\nimport { GRID_CONTEXT_KEY } from './composables';\n\n/**\n * GridStorm Vue 3 component.\n *\n * Wraps the headless GridStorm core engine and DOM renderer into a Vue component\n * with reactive prop watching, event emission, and provide/inject context for\n * child composables.\n *\n * @example\n * ```vue\n * <script setup lang=\"ts\">\n * import { GridStorm } from '@gridstorm/vue';\n * import { sortingPlugin } from '@gridstorm/plugin-sorting';\n *\n * const columns = [\n * { field: 'name', headerName: 'Name', sortable: true },\n * { field: 'age', headerName: 'Age', width: 100 },\n * ];\n * const rowData = [\n * { name: 'Alice', age: 30 },\n * { name: 'Bob', age: 25 },\n * ];\n * </script>\n *\n * <template>\n * <GridStorm\n * :columns=\"columns\"\n * :row-data=\"rowData\"\n * :plugins=\"[sortingPlugin()]\"\n * @grid-ready=\"(api) => console.log('Grid ready!', api)\"\n * />\n * </template>\n * ```\n */\nexport const GridStorm = defineComponent({\n name: 'GridStorm',\n\n props: gridStormPropDefs,\n\n emits: [\n 'gridReady',\n 'rowDataChanged',\n 'selectionChanged',\n 'sortChanged',\n 'filterChanged',\n 'cellValueChanged',\n 'cellClicked',\n 'cellDoubleClicked',\n 'rowClicked',\n 'paginationChanged',\n 'columnResized',\n ],\n\n setup(props, { emit, expose }) {\n const containerRef = ref<HTMLElement | null>(null);\n let engine: GridEngine | null = null;\n let renderer: DomRenderer | null = null;\n const eventUnsubscribers: Array<() => void> = [];\n\n // ── Build GridConfig from props ──\n function buildConfig() {\n return {\n columns: props.columns as any,\n rowData: props.rowData as any,\n plugins: props.plugins as any,\n getRowId: props.getRowId as any,\n rowHeight: props.rowHeight,\n headerHeight: props.headerHeight,\n defaultColDef: props.defaultColDef as any,\n paginationPageSize: props.paginationPageSize,\n pagination: props.pagination,\n rowSelection: props.rowSelection as any,\n editType: props.editType as any,\n ariaLabel: props.ariaLabel,\n };\n }\n\n // ── Subscribe to engine events and bridge to Vue emits ──\n function subscribeToEvents() {\n if (!engine) return;\n\n const eb = engine.eventBus;\n\n eventUnsubscribers.push(\n eb.on('rowData:changed', (e) => emit('rowDataChanged', e)),\n );\n eventUnsubscribers.push(\n eb.on('selection:changed', (e) => emit('selectionChanged', e)),\n );\n eventUnsubscribers.push(\n eb.on('column:sort:changed', (e) => emit('sortChanged', e)),\n );\n eventUnsubscribers.push(\n eb.on('filter:changed', (e) => emit('filterChanged', e)),\n );\n eventUnsubscribers.push(\n eb.on('cell:valueChanged', (e) => emit('cellValueChanged', e)),\n );\n eventUnsubscribers.push(\n eb.on('cell:clicked', (e) => emit('cellClicked', e)),\n );\n eventUnsubscribers.push(\n eb.on('cell:doubleClicked', (e) => emit('cellDoubleClicked', e)),\n );\n eventUnsubscribers.push(\n eb.on('row:clicked', (e) => emit('rowClicked', e)),\n );\n eventUnsubscribers.push(\n eb.on('pagination:changed', (e) => emit('paginationChanged', e)),\n );\n eventUnsubscribers.push(\n eb.on('column:resized', (e) => emit('columnResized', e)),\n );\n }\n\n // ── Provide context for composables ──\n // Use shallowRef to avoid deep unwrapping of GridEngine internals\n // (Store class has private fields that break Vue's deep reactive proxy typing)\n const gridContext = shallowRef<GridContextValue | null>(null);\n\n provide(GRID_CONTEXT_KEY, gridContext);\n\n // ── Initialize grid engine and renderer ──\n function initGrid() {\n if (!containerRef.value) return;\n\n const config = buildConfig();\n engine = createGrid(config);\n\n // Update context for composables\n gridContext.value = {\n engine,\n api: engine.api,\n };\n\n // Mount DOM renderer\n renderer = new DomRenderer({\n container: containerRef.value,\n engine,\n });\n renderer.mount();\n\n // Subscribe to events\n subscribeToEvents();\n\n // Emit gridReady\n emit('gridReady', engine.api);\n }\n\n // ── Teardown ──\n function destroyGrid() {\n // Unsubscribe from all events\n for (const unsub of eventUnsubscribers) {\n unsub();\n }\n eventUnsubscribers.length = 0;\n\n renderer?.destroy();\n renderer = null;\n\n engine?.destroy();\n engine = null;\n\n gridContext.value = null;\n }\n\n // ── Lifecycle ──\n onMounted(() => {\n initGrid();\n });\n\n onBeforeUnmount(() => {\n destroyGrid();\n });\n\n // ── Watch for rowData changes ──\n watch(\n () => props.rowData,\n (newData) => {\n if (engine && newData) {\n engine.api.setRowData(newData as any);\n }\n },\n { deep: false },\n );\n\n // ── Watch for column changes ──\n watch(\n () => props.columns,\n (newCols) => {\n if (engine && newCols) {\n engine.api.setColumnDefs(newCols as any);\n }\n },\n { deep: false },\n );\n\n // ── Watch for theme changes ──\n watch(\n () => props.theme,\n (newTheme) => {\n if (containerRef.value && newTheme) {\n containerRef.value.setAttribute('data-theme', newTheme);\n }\n },\n );\n\n // ── Watch for density changes ──\n watch(\n () => props.density,\n (newDensity) => {\n if (containerRef.value && newDensity) {\n containerRef.value.setAttribute('data-density', newDensity);\n }\n },\n );\n\n // ── Expose public API via template refs ──\n expose({\n /**\n * Get the GridApi instance.\n * Returns undefined if the grid has not been initialized yet.\n */\n getApi: () => engine?.api,\n\n /**\n * Get the GridEngine instance.\n * Returns undefined if the grid has not been initialized yet.\n */\n getEngine: () => engine,\n });\n\n // ── Render function ──\n return () => {\n const heightStyle =\n typeof props.height === 'number' ? `${props.height}px` : props.height;\n const widthStyle =\n typeof props.width === 'number' ? `${props.width}px` : props.width;\n\n return h('div', {\n ref: containerRef,\n class: ['gridstorm-wrapper', props.containerClass].filter(Boolean).join(' '),\n 'data-theme': props.theme,\n 'data-density': props.density,\n style: {\n width: widthStyle,\n height: heightStyle,\n },\n });\n };\n },\n});\n"]}
@@ -0,0 +1,556 @@
1
+ import * as vue from 'vue';
2
+ import { InjectionKey, ShallowRef, Ref } from 'vue';
3
+ import * as _gridstorm_core from '@gridstorm/core';
4
+ import { GridEngine, GridApi, FilterModel, RowNode, SortModelItem, GridEventMap, ColumnDef, GridPlugin, GridConfig } from '@gridstorm/core';
5
+ export { CellEditorDef, CellPosition, ColumnDef, ColumnState, EditingState, FilterModel, GridApi, GridConfig, GridEventMap, GridPlugin, GridState, PinnedPosition, RowNode, SelectionState, SortDirection, SortModelItem } from '@gridstorm/core';
6
+
7
+ /**
8
+ * GridStorm Vue 3 component.
9
+ *
10
+ * Wraps the headless GridStorm core engine and DOM renderer into a Vue component
11
+ * with reactive prop watching, event emission, and provide/inject context for
12
+ * child composables.
13
+ *
14
+ * @example
15
+ * ```vue
16
+ * <script setup lang="ts">
17
+ * import { GridStorm } from '@gridstorm/vue';
18
+ * import { sortingPlugin } from '@gridstorm/plugin-sorting';
19
+ *
20
+ * const columns = [
21
+ * { field: 'name', headerName: 'Name', sortable: true },
22
+ * { field: 'age', headerName: 'Age', width: 100 },
23
+ * ];
24
+ * const rowData = [
25
+ * { name: 'Alice', age: 30 },
26
+ * { name: 'Bob', age: 25 },
27
+ * ];
28
+ * </script>
29
+ *
30
+ * <template>
31
+ * <GridStorm
32
+ * :columns="columns"
33
+ * :row-data="rowData"
34
+ * :plugins="[sortingPlugin()]"
35
+ * @grid-ready="(api) => console.log('Grid ready!', api)"
36
+ * />
37
+ * </template>
38
+ * ```
39
+ */
40
+ declare const GridStorm: vue.DefineComponent<vue.ExtractPropTypes<{
41
+ readonly columns: {
42
+ readonly type: vue.PropType<_gridstorm_core.ColumnDef[]>;
43
+ readonly required: true;
44
+ };
45
+ readonly rowData: {
46
+ readonly type: vue.PropType<any[]>;
47
+ readonly required: true;
48
+ };
49
+ readonly plugins: {
50
+ readonly type: vue.PropType<_gridstorm_core.GridPlugin[]>;
51
+ readonly default: () => never[];
52
+ };
53
+ readonly getRowId: {
54
+ readonly type: vue.PropType<_gridstorm_core.GridConfig["getRowId"]>;
55
+ readonly default: undefined;
56
+ };
57
+ readonly rowHeight: {
58
+ readonly type: NumberConstructor;
59
+ readonly default: 40;
60
+ };
61
+ readonly headerHeight: {
62
+ readonly type: NumberConstructor;
63
+ readonly default: undefined;
64
+ };
65
+ readonly theme: {
66
+ readonly type: StringConstructor;
67
+ readonly default: "light";
68
+ };
69
+ readonly density: {
70
+ readonly type: StringConstructor;
71
+ readonly default: "normal";
72
+ };
73
+ readonly defaultColDef: {
74
+ readonly type: vue.PropType<Partial<_gridstorm_core.ColumnDef>>;
75
+ readonly default: undefined;
76
+ };
77
+ readonly paginationPageSize: {
78
+ readonly type: NumberConstructor;
79
+ readonly default: undefined;
80
+ };
81
+ readonly pagination: {
82
+ readonly type: BooleanConstructor;
83
+ readonly default: undefined;
84
+ };
85
+ readonly rowSelection: {
86
+ readonly type: vue.PropType<"single" | "multiple" | false>;
87
+ readonly default: undefined;
88
+ };
89
+ readonly editType: {
90
+ readonly type: vue.PropType<"cell" | "fullRow">;
91
+ readonly default: undefined;
92
+ };
93
+ readonly ariaLabel: {
94
+ readonly type: StringConstructor;
95
+ readonly default: undefined;
96
+ };
97
+ readonly height: {
98
+ readonly type: vue.PropType<number | string>;
99
+ readonly default: "100%";
100
+ };
101
+ readonly width: {
102
+ readonly type: vue.PropType<number | string>;
103
+ readonly default: "100%";
104
+ };
105
+ readonly containerClass: {
106
+ readonly type: StringConstructor;
107
+ readonly default: undefined;
108
+ };
109
+ }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
110
+ [key: string]: any;
111
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("gridReady" | "rowDataChanged" | "selectionChanged" | "sortChanged" | "filterChanged" | "cellValueChanged" | "cellClicked" | "cellDoubleClicked" | "rowClicked" | "paginationChanged" | "columnResized")[], "gridReady" | "rowDataChanged" | "selectionChanged" | "sortChanged" | "filterChanged" | "cellValueChanged" | "cellClicked" | "cellDoubleClicked" | "rowClicked" | "paginationChanged" | "columnResized", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
112
+ readonly columns: {
113
+ readonly type: vue.PropType<_gridstorm_core.ColumnDef[]>;
114
+ readonly required: true;
115
+ };
116
+ readonly rowData: {
117
+ readonly type: vue.PropType<any[]>;
118
+ readonly required: true;
119
+ };
120
+ readonly plugins: {
121
+ readonly type: vue.PropType<_gridstorm_core.GridPlugin[]>;
122
+ readonly default: () => never[];
123
+ };
124
+ readonly getRowId: {
125
+ readonly type: vue.PropType<_gridstorm_core.GridConfig["getRowId"]>;
126
+ readonly default: undefined;
127
+ };
128
+ readonly rowHeight: {
129
+ readonly type: NumberConstructor;
130
+ readonly default: 40;
131
+ };
132
+ readonly headerHeight: {
133
+ readonly type: NumberConstructor;
134
+ readonly default: undefined;
135
+ };
136
+ readonly theme: {
137
+ readonly type: StringConstructor;
138
+ readonly default: "light";
139
+ };
140
+ readonly density: {
141
+ readonly type: StringConstructor;
142
+ readonly default: "normal";
143
+ };
144
+ readonly defaultColDef: {
145
+ readonly type: vue.PropType<Partial<_gridstorm_core.ColumnDef>>;
146
+ readonly default: undefined;
147
+ };
148
+ readonly paginationPageSize: {
149
+ readonly type: NumberConstructor;
150
+ readonly default: undefined;
151
+ };
152
+ readonly pagination: {
153
+ readonly type: BooleanConstructor;
154
+ readonly default: undefined;
155
+ };
156
+ readonly rowSelection: {
157
+ readonly type: vue.PropType<"single" | "multiple" | false>;
158
+ readonly default: undefined;
159
+ };
160
+ readonly editType: {
161
+ readonly type: vue.PropType<"cell" | "fullRow">;
162
+ readonly default: undefined;
163
+ };
164
+ readonly ariaLabel: {
165
+ readonly type: StringConstructor;
166
+ readonly default: undefined;
167
+ };
168
+ readonly height: {
169
+ readonly type: vue.PropType<number | string>;
170
+ readonly default: "100%";
171
+ };
172
+ readonly width: {
173
+ readonly type: vue.PropType<number | string>;
174
+ readonly default: "100%";
175
+ };
176
+ readonly containerClass: {
177
+ readonly type: StringConstructor;
178
+ readonly default: undefined;
179
+ };
180
+ }>> & Readonly<{
181
+ onGridReady?: ((...args: any[]) => any) | undefined;
182
+ onRowDataChanged?: ((...args: any[]) => any) | undefined;
183
+ onSelectionChanged?: ((...args: any[]) => any) | undefined;
184
+ onSortChanged?: ((...args: any[]) => any) | undefined;
185
+ onFilterChanged?: ((...args: any[]) => any) | undefined;
186
+ onCellValueChanged?: ((...args: any[]) => any) | undefined;
187
+ onCellClicked?: ((...args: any[]) => any) | undefined;
188
+ onCellDoubleClicked?: ((...args: any[]) => any) | undefined;
189
+ onRowClicked?: ((...args: any[]) => any) | undefined;
190
+ onPaginationChanged?: ((...args: any[]) => any) | undefined;
191
+ onColumnResized?: ((...args: any[]) => any) | undefined;
192
+ }>, {
193
+ readonly getRowId: ((params: _gridstorm_core.GetRowIdParams<any>) => string) | undefined;
194
+ readonly width: string | number;
195
+ readonly plugins: _gridstorm_core.GridPlugin<any>[];
196
+ readonly rowHeight: number;
197
+ readonly headerHeight: number;
198
+ readonly theme: string;
199
+ readonly density: string;
200
+ readonly defaultColDef: Partial<_gridstorm_core.ColumnDef<any, any>>;
201
+ readonly paginationPageSize: number;
202
+ readonly pagination: boolean;
203
+ readonly rowSelection: false | "single" | "multiple";
204
+ readonly editType: "cell" | "fullRow";
205
+ readonly ariaLabel: string;
206
+ readonly height: string | number;
207
+ readonly containerClass: string;
208
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
209
+
210
+ /**
211
+ * Context value provided to child composables via Vue provide/inject.
212
+ */
213
+ interface GridContextValue<TData = any> {
214
+ /** The grid engine instance. */
215
+ engine: GridEngine<TData>;
216
+ /** The public grid API. */
217
+ api: GridApi<TData>;
218
+ }
219
+ /**
220
+ * Props interface for the GridStorm Vue component.
221
+ *
222
+ * @typeParam TData - The type of each row data object.
223
+ */
224
+ interface GridStormProps<TData = any> {
225
+ /** Column definitions. */
226
+ columns: ColumnDef<TData>[];
227
+ /** Row data array. */
228
+ rowData: TData[];
229
+ /** Plugins to install. */
230
+ plugins?: GridPlugin<TData>[];
231
+ /** Row ID getter function. */
232
+ getRowId?: GridConfig<TData>['getRowId'];
233
+ /** Row height in pixels. */
234
+ rowHeight?: number;
235
+ /** Header height in pixels. */
236
+ headerHeight?: number;
237
+ /** Theme identifier (e.g., 'light', 'dark'). */
238
+ theme?: string;
239
+ /** Density mode (e.g., 'compact', 'normal', 'comfortable'). */
240
+ density?: string;
241
+ /** Default column definition applied to all columns. */
242
+ defaultColDef?: Partial<ColumnDef<TData>>;
243
+ /** Number of rows per page when pagination is enabled. */
244
+ paginationPageSize?: number;
245
+ /** Enable client-side pagination. */
246
+ pagination?: boolean;
247
+ /** Row selection mode. */
248
+ rowSelection?: 'single' | 'multiple' | false;
249
+ /** Edit type mode. */
250
+ editType?: 'cell' | 'fullRow';
251
+ /** ARIA label for the grid root element. */
252
+ ariaLabel?: string;
253
+ /** Container height. Default: '100%'. */
254
+ height?: number | string;
255
+ /** Container width. Default: '100%'. */
256
+ width?: number | string;
257
+ /** Additional CSS class for the container. */
258
+ containerClass?: string;
259
+ }
260
+ /**
261
+ * All events emitted by the GridStorm Vue component.
262
+ */
263
+ interface GridStormEmits<TData = any> {
264
+ /** Fired when the grid engine is ready and the API is available. */
265
+ gridReady: [api: GridApi<TData>];
266
+ /** Fired when row data changes. */
267
+ rowDataChanged: [event: GridEventMap<TData>['rowData:changed']];
268
+ /** Fired when the selection changes. */
269
+ selectionChanged: [event: GridEventMap<TData>['selection:changed']];
270
+ /** Fired when the sort model changes. */
271
+ sortChanged: [event: GridEventMap<TData>['column:sort:changed']];
272
+ /** Fired when the filter model changes. */
273
+ filterChanged: [event: GridEventMap<TData>['filter:changed']];
274
+ /** Fired when a cell value is changed via editing. */
275
+ cellValueChanged: [event: GridEventMap<TData>['cell:valueChanged']];
276
+ /** Fired when a cell is clicked. */
277
+ cellClicked: [event: GridEventMap<TData>['cell:clicked']];
278
+ /** Fired when a cell is double-clicked. */
279
+ cellDoubleClicked: [event: GridEventMap<TData>['cell:doubleClicked']];
280
+ /** Fired when a row is clicked. */
281
+ rowClicked: [event: GridEventMap<TData>['row:clicked']];
282
+ /** Fired when pagination state changes. */
283
+ paginationChanged: [event: GridEventMap<TData>['pagination:changed']];
284
+ /** Fired when a column is resized. */
285
+ columnResized: [event: GridEventMap<TData>['column:resized']];
286
+ }
287
+ /**
288
+ * Public methods exposed by the GridStorm component via template refs.
289
+ *
290
+ * @typeParam TData - The type of each row data object.
291
+ */
292
+ interface GridStormExposed<TData = any> {
293
+ /** Get the GridApi instance. */
294
+ getApi(): GridApi<TData> | undefined;
295
+ /** Get the GridEngine instance. */
296
+ getEngine(): GridEngine<TData> | undefined;
297
+ }
298
+ /**
299
+ * Return type for the useGridSort composable.
300
+ */
301
+ interface GridSortResult {
302
+ /** Current sort model (reactive). */
303
+ sortModel: SortModelItem[];
304
+ /** Whether any sort is active (reactive). */
305
+ isSorted: boolean;
306
+ /** Set the sort model directly. */
307
+ setSortModel: (model: SortModelItem[]) => void;
308
+ /** Toggle sort on a column. */
309
+ toggleSort: (colId: string, multiSort?: boolean) => void;
310
+ /** Clear all sorting. */
311
+ clearSort: () => void;
312
+ }
313
+ /**
314
+ * Return type for the useGridFilter composable.
315
+ */
316
+ interface GridFilterResult {
317
+ /** Current filter model keyed by column ID (reactive). */
318
+ filterModel: Record<string, FilterModel>;
319
+ /** Current quick filter text (reactive). */
320
+ quickFilterText: string;
321
+ /** Whether any filter is active (reactive). */
322
+ isFiltered: boolean;
323
+ /** Set the filter model. */
324
+ setFilterModel: (model: Record<string, FilterModel>) => void;
325
+ /** Set quick filter text. */
326
+ setQuickFilter: (text: string) => void;
327
+ /** Clear all filters. */
328
+ clearFilters: () => void;
329
+ }
330
+ /**
331
+ * Return type for the useGridSelection composable.
332
+ */
333
+ interface GridSelectionResult<TData = any> {
334
+ /** Set of selected row IDs (reactive). */
335
+ selectedRowIds: Set<string>;
336
+ /** Number of selected rows (reactive). */
337
+ selectedCount: number;
338
+ /** Get selected row data objects. */
339
+ getSelectedRows: () => TData[];
340
+ /** Get selected RowNode objects. */
341
+ getSelectedNodes: () => RowNode<TData>[];
342
+ /** Check if a specific row is selected. */
343
+ isRowSelected: (rowId: string) => boolean;
344
+ /** Select all visible rows. */
345
+ selectAll: () => void;
346
+ /** Deselect all rows. */
347
+ deselectAll: () => void;
348
+ }
349
+ /**
350
+ * Return type for the useGridPagination composable.
351
+ */
352
+ interface GridPaginationResult {
353
+ /** Current page (0-indexed, reactive). */
354
+ currentPage: number;
355
+ /** Total number of pages (reactive). */
356
+ totalPages: number;
357
+ /** Rows per page (reactive). */
358
+ pageSize: number;
359
+ /** Total row count after filtering (reactive). */
360
+ totalRows: number;
361
+ /** Whether there is a next page (reactive). */
362
+ hasNextPage: boolean;
363
+ /** Whether there is a previous page (reactive). */
364
+ hasPreviousPage: boolean;
365
+ /** Go to a specific page. */
366
+ goToPage: (page: number) => void;
367
+ /** Go to next page. */
368
+ nextPage: () => void;
369
+ /** Go to previous page. */
370
+ previousPage: () => void;
371
+ /** Go to first page. */
372
+ firstPage: () => void;
373
+ /** Go to last page. */
374
+ lastPage: () => void;
375
+ }
376
+
377
+ /**
378
+ * Injection key used internally to provide/inject the grid context.
379
+ * Uses ShallowRef to avoid deep reactive unwrapping of GridEngine internals
380
+ * (the Store class has private fields incompatible with Vue's deep proxy typing).
381
+ */
382
+ declare const GRID_CONTEXT_KEY: InjectionKey<ShallowRef<GridContextValue | null>>;
383
+ /**
384
+ * Access the GridApi instance from a parent GridStorm component.
385
+ *
386
+ * Returns a computed ref that resolves to the GridApi once the grid is initialized.
387
+ * The ref will be undefined until the grid has mounted.
388
+ *
389
+ * @example
390
+ * ```vue
391
+ * <script setup lang="ts">
392
+ * import { useGridApi } from '@gridstorm/vue';
393
+ *
394
+ * const api = useGridApi();
395
+ *
396
+ * function exportData() {
397
+ * const rows = api.value?.getSelectedRows() ?? [];
398
+ * console.log('Selected:', rows);
399
+ * }
400
+ * </script>
401
+ * ```
402
+ */
403
+ declare function useGridApi<TData = any>(): Ref<GridApi<TData> | undefined>;
404
+ /**
405
+ * Access the GridEngine instance from a parent GridStorm component.
406
+ *
407
+ * Primarily useful for advanced use cases that need direct access to
408
+ * the store, event bus, or command bus.
409
+ *
410
+ * @example
411
+ * ```vue
412
+ * <script setup lang="ts">
413
+ * import { useGridEngine } from '@gridstorm/vue';
414
+ *
415
+ * const engine = useGridEngine();
416
+ * </script>
417
+ * ```
418
+ */
419
+ declare function useGridEngine<TData = any>(): Ref<GridEngine<TData> | undefined>;
420
+ /**
421
+ * Reactive sort model state and sort actions.
422
+ *
423
+ * @example
424
+ * ```vue
425
+ * <script setup lang="ts">
426
+ * import { useGridSort } from '@gridstorm/vue';
427
+ *
428
+ * const { sortModel, isSorted, toggleSort, clearSort } = useGridSort();
429
+ * </script>
430
+ *
431
+ * <template>
432
+ * <button @click="toggleSort('name')">Sort by Name</button>
433
+ * <button v-if="isSorted" @click="clearSort()">Clear Sort</button>
434
+ * <pre>{{ sortModel }}</pre>
435
+ * </template>
436
+ * ```
437
+ */
438
+ declare function useGridSort(): {
439
+ sortModel: Ref<SortModelItem[]>;
440
+ isSorted: Ref<boolean>;
441
+ setSortModel: (model: SortModelItem[]) => void;
442
+ toggleSort: (colId: string, multiSort?: boolean) => void;
443
+ clearSort: () => void;
444
+ };
445
+ /**
446
+ * Reactive filter model state and filter actions.
447
+ *
448
+ * @example
449
+ * ```vue
450
+ * <script setup lang="ts">
451
+ * import { useGridFilter } from '@gridstorm/vue';
452
+ *
453
+ * const { isFiltered, setQuickFilter, clearFilters } = useGridFilter();
454
+ * </script>
455
+ *
456
+ * <template>
457
+ * <input @input="(e) => setQuickFilter((e.target as HTMLInputElement).value)" />
458
+ * <button v-if="isFiltered" @click="clearFilters()">Clear Filters</button>
459
+ * </template>
460
+ * ```
461
+ */
462
+ declare function useGridFilter(): {
463
+ filterModel: Ref<Record<string, FilterModel>>;
464
+ quickFilterText: Ref<string>;
465
+ isFiltered: Ref<boolean>;
466
+ setFilterModel: (model: Record<string, FilterModel>) => void;
467
+ setQuickFilter: (text: string) => void;
468
+ clearFilters: () => void;
469
+ };
470
+ /**
471
+ * Reactive selection state and selection actions.
472
+ *
473
+ * @example
474
+ * ```vue
475
+ * <script setup lang="ts">
476
+ * import { useGridSelection } from '@gridstorm/vue';
477
+ *
478
+ * const { selectedCount, selectAll, deselectAll, isRowSelected } = useGridSelection();
479
+ * </script>
480
+ *
481
+ * <template>
482
+ * <p>{{ selectedCount }} rows selected</p>
483
+ * <button @click="selectAll()">Select All</button>
484
+ * <button @click="deselectAll()">Deselect All</button>
485
+ * </template>
486
+ * ```
487
+ */
488
+ declare function useGridSelection<TData = any>(): {
489
+ selectedRowIds: Ref<Set<string>>;
490
+ selectedCount: Ref<number>;
491
+ getSelectedRows: () => TData[];
492
+ getSelectedNodes: () => RowNode<TData>[];
493
+ isRowSelected: (rowId: string) => boolean;
494
+ selectAll: () => void;
495
+ deselectAll: () => void;
496
+ };
497
+ /**
498
+ * Reactive pagination state and navigation actions.
499
+ *
500
+ * @example
501
+ * ```vue
502
+ * <script setup lang="ts">
503
+ * import { useGridPagination } from '@gridstorm/vue';
504
+ *
505
+ * const {
506
+ * currentPage,
507
+ * totalPages,
508
+ * hasNextPage,
509
+ * hasPreviousPage,
510
+ * nextPage,
511
+ * previousPage,
512
+ * } = useGridPagination();
513
+ * </script>
514
+ *
515
+ * <template>
516
+ * <div class="pagination">
517
+ * <button :disabled="!hasPreviousPage" @click="previousPage()">Prev</button>
518
+ * <span>Page {{ currentPage + 1 }} of {{ totalPages }}</span>
519
+ * <button :disabled="!hasNextPage" @click="nextPage()">Next</button>
520
+ * </div>
521
+ * </template>
522
+ * ```
523
+ */
524
+ declare function useGridPagination(): {
525
+ currentPage: Ref<number>;
526
+ totalPages: Ref<number>;
527
+ pageSize: Ref<number>;
528
+ totalRows: Ref<number>;
529
+ hasNextPage: Ref<boolean>;
530
+ hasPreviousPage: Ref<boolean>;
531
+ goToPage: (page: number) => void;
532
+ nextPage: () => void;
533
+ previousPage: () => void;
534
+ firstPage: () => void;
535
+ lastPage: () => void;
536
+ };
537
+ /**
538
+ * Listen to a specific grid event with automatic cleanup on unmount.
539
+ *
540
+ * @param event - The event name from GridEventMap.
541
+ * @param handler - Callback function invoked when the event fires.
542
+ *
543
+ * @example
544
+ * ```vue
545
+ * <script setup lang="ts">
546
+ * import { useGridEvent } from '@gridstorm/vue';
547
+ *
548
+ * useGridEvent('selection:changed', (e) => {
549
+ * console.log('Selection changed:', e.selectedNodes);
550
+ * });
551
+ * </script>
552
+ * ```
553
+ */
554
+ declare function useGridEvent<TData = any>(event: string, handler: (payload: any) => void): void;
555
+
556
+ export { GRID_CONTEXT_KEY, type GridContextValue, type GridFilterResult, type GridPaginationResult, type GridSelectionResult, type GridSortResult, GridStorm, type GridStormEmits, type GridStormExposed, type GridStormProps, useGridApi, useGridEngine, useGridEvent, useGridFilter, useGridPagination, useGridSelection, useGridSort };