@inandu-solutions/grid-vue 0.0.0-stage → 0.2.0

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.
Files changed (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +196 -3
  3. package/dist/components/DataRow.vue.d.ts +34 -0
  4. package/dist/components/EditCell.vue.d.ts +16 -0
  5. package/dist/components/FilterControl.vue.d.ts +16 -0
  6. package/dist/components/InanduGrid.vue.d.ts +231 -0
  7. package/dist/components/internal.d.ts +60 -0
  8. package/dist/components/types.d.ts +6 -0
  9. package/dist/composables/useInanduGrid.d.ts +260 -0
  10. package/dist/composables/useInanduGridServer.d.ts +53 -0
  11. package/dist/core/aggregate.d.ts +5 -0
  12. package/dist/core/columns.d.ts +11 -0
  13. package/dist/core/constants.d.ts +14 -0
  14. package/dist/core/dom.d.ts +8 -0
  15. package/dist/core/export/csv.d.ts +2 -0
  16. package/dist/core/export/download.d.ts +2 -0
  17. package/dist/core/export/markup.d.ts +2 -0
  18. package/dist/core/export/pdf.d.ts +3 -0
  19. package/dist/core/filter.d.ts +26 -0
  20. package/dist/core/format.d.ts +24 -0
  21. package/dist/core/i18n/en.d.ts +46 -0
  22. package/dist/core/i18n/es.d.ts +46 -0
  23. package/dist/core/i18n/fr.d.ts +46 -0
  24. package/dist/core/i18n/index.d.ts +8 -0
  25. package/dist/core/i18n/it.d.ts +46 -0
  26. package/dist/core/i18n/zh.d.ts +46 -0
  27. package/dist/core/index.d.ts +17 -0
  28. package/dist/core/parse.d.ts +14 -0
  29. package/dist/core/sort.d.ts +1 -0
  30. package/dist/core/tree.d.ts +28 -0
  31. package/dist/core/types.d.ts +46 -0
  32. package/dist/inandu-grid-vue.cjs +3 -0
  33. package/dist/inandu-grid-vue.js +1973 -0
  34. package/dist/index.d.ts +13 -0
  35. package/dist/style.css +358 -0
  36. package/dist/utils/exporters.d.ts +29 -0
  37. package/dist/utils/measureColumn.d.ts +15 -0
  38. package/dist/utils/translate.d.ts +10 -0
  39. package/package.json +92 -6
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Inandu SAS (https://inandu.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,196 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # inandu-grid-vue
2
+
3
+ **A lightweight Vue 3 data grid with the essentials other grids gate behind a paid enterprise
4
+ licence — row grouping, aggregates, inline editing and Excel-compatible export — fully MIT.** The
5
+ Vue port of [`@inandu-solutions/grid-angular`](https://github.com/inandusolutions/inandu-grid),
6
+ kept in sync feature-for-feature by hand (and with its React sibling,
7
+ [`@inandu-solutions/grid-react`](https://github.com/inandusolutions/inandu-grid-react)).
8
+
9
+ [![npm](https://img.shields.io/npm/v/@inandu-solutions/grid-vue.svg)](https://www.npmjs.com/package/@inandu-solutions/grid-vue)
10
+ [![CI](https://github.com/inandusolutions/inandu-grid-vue/actions/workflows/ci.yml/badge.svg)](https://github.com/inandusolutions/inandu-grid-vue/actions/workflows/ci.yml)
11
+ [![license](https://img.shields.io/npm/l/@inandu-solutions/grid-vue.svg)](LICENSE)
12
+ ![Vue](https://img.shields.io/badge/Vue-3.4%2B-42b883)
13
+ [![live demo](https://img.shields.io/badge/demo-live-1a8fae)](https://inandusolutions.github.io/inandu-grid-vue/)
14
+ [![Open in StackBlitz](https://img.shields.io/badge/StackBlitz-open%20example-1389FD?logo=stackblitz&logoColor=white)](https://stackblitz.com/github/inandusolutions/inandu-grid-vue/tree/main/examples/stackblitz)
15
+
16
+ ## Try it in 30 seconds
17
+
18
+ ```bash
19
+ npm install @inandu-solutions/grid-vue
20
+ ```
21
+
22
+ ```vue
23
+ <script setup lang="ts">
24
+ import { InanduGrid, type InanduGridColumn } from '@inandu-solutions/grid-vue';
25
+ import '@inandu-solutions/grid-vue/style.css';
26
+
27
+ const rows = [{ name: 'Ada', age: 36 }, { name: 'Alan', age: 41 }];
28
+ const columns: InanduGridColumn[] = [{ field: 'name', headerText: 'Name' }, { field: 'age', headerText: 'Age', type: 'number' }];
29
+ </script>
30
+
31
+ <template>
32
+ <!-- sorting + filtering are on by default -->
33
+ <InanduGrid :rows="rows" :columns="columns" :page-size="25" />
34
+ </template>
35
+ ```
36
+
37
+ - **▶️ [Live demo](https://inandusolutions.github.io/inandu-grid-vue/)** — try every feature in the browser.
38
+ - **⚡ [Edit in StackBlitz](https://stackblitz.com/github/inandusolutions/inandu-grid-vue/tree/main/examples/stackblitz)** —
39
+ installs `@inandu-solutions/grid-vue` from npm; edit `src/App.vue` and it updates live ([source](examples/stackblitz)).
40
+ - **📦 [`@inandu-solutions/grid-vue` on npm](https://www.npmjs.com/package/@inandu-solutions/grid-vue)**
41
+ (MIT) — `0.x` while the API settles; expect breaking changes between minors until `1.0.0`.
42
+
43
+ ## Who is this for?
44
+
45
+ - **CRUD / business apps** that need sortable, filterable, editable tables without pulling in a
46
+ full enterprise grid framework.
47
+ - **Admin dashboards** that need grouping, aggregates and CSV/Excel/PDF export out of the box.
48
+ - **Data-heavy Vue apps** that need virtual scroll, or server-side sort / filter / paging against a
49
+ backend (see [Server-side data](#server-side-data)), without the bundle size of a kitchen-sink grid.
50
+
51
+ **When not to use it:** if you need pivot tables or integrated charting built into the grid itself,
52
+ this isn't that — see [Not included](#not-included) below.
53
+
54
+ ## Angular and React versions
55
+
56
+ [`inandu-grid`](https://github.com/inandusolutions/inandu-grid) is the original, feature-complete,
57
+ MIT-licensed Angular grid this repo is ported from, and
58
+ [`inandu-grid-react`](https://github.com/inandusolutions/inandu-grid-react) is its React port — same
59
+ feature set, same core logic, adapted for Vue's composition API (`computed`/`shallowRef`, SFCs,
60
+ scoped slots, emitted events) instead of Angular signals or React hooks.
61
+
62
+ ## Not included
63
+
64
+ Deliberately *not* a kitchen sink: no pivoting and no integrated charts — those stay out of scope
65
+ so the core stays small and auditable. Everything else on this page (grouping, aggregates, editing,
66
+ export, virtual scroll, paged server-side mode) is included, free, no enterprise tier.
67
+
68
+ ## Commercial add-ons
69
+
70
+ `@inandu-solutions/grid-pro-vue` *(private, paid, not released yet)* — the Vue port of
71
+ `@inandu-solutions/grid-pro`, depends on this package the same way grid-pro depends on grid-angular.
72
+
73
+ ## Features
74
+
75
+ **Feature-complete with grid-angular and grid-react.** The framework-agnostic core (sorting,
76
+ filtering, aggregation, export, i18n) is ported from grid-angular's
77
+ [`core/`](https://github.com/inandusolutions/inandu-grid/tree/main/projects/inandu-grid/src/lib/core)
78
+ folder and kept in sync by hand across the three repos. The Vue-specific layer — the
79
+ [`<InanduGrid>`](#api-shape) component and the [`useInanduGrid()`](#api-shape) headless
80
+ composable — covers:
81
+
82
+ - Sorting — single-column, or multi-column via shift-click
83
+ - Free-text search and per-column filtering, plus an `extra-row-filter` escape hatch for your own predicates
84
+ - Pagination, single-column grouping with aggregates, row selection
85
+ - CSV / Excel (`.xls`) / PDF export, and print
86
+ - i18n — 5 built-in languages via a `lang` prop
87
+ - Inline row editing, creation and deletion, with validation (required / min / max / pattern / custom / async)
88
+ - Excel-style Ctrl+C / Ctrl+V clipboard copy/paste
89
+ - Runtime column show/hide, sticky (pinned left/right) columns, drag-reorder
90
+ - Column resize (drag a header's handle) and autosize (double-click it to fit content)
91
+ - Row drag-reorder
92
+ - Tree data (`tree-children-key`) — display and expand only, no inline editing/drag/clipboard on
93
+ tree rows, same restriction as grid-angular
94
+ - Master-detail — a `#detail="{ row }"` slot (or a `renderDetail` render-function prop)
95
+ - Custom cell / header / edit-control rendering per column — `#cell-<field>`, `#header-<field>` and
96
+ `#editor-<field>` scoped slots, or `renderCell` / `renderHeader` / `renderEditor` render functions
97
+ on the column definition — without losing sorting, resizing, or validation
98
+ - Excel-style cell range selection (`cell-range-selection`, `multi-range`) — click-and-drag or
99
+ shift-click across cells to select a rectangular block; `Ctrl+C` copies the whole range as TSV
100
+ when `clipboard` is also on
101
+ - Row virtualization (`virtual-scroll`) for large datasets
102
+ - Server-side sort / search / filter / paging (`server-side` + `useInanduGridServer`) — paged only;
103
+ grid-angular's server-side infinite scroll isn't ported. See [Server-side data](#server-side-data)
104
+
105
+ Two things work slightly differently from grid-angular because they need a real browser layout
106
+ engine that a unit-test environment can't provide: virtual scroll's row height isn't
107
+ auto-measured — pass `virtual-row-height` explicitly — and autosize's content measurement itself is
108
+ trusted (ported verbatim, same DOM APIs) rather than end-to-end tested; see
109
+ [`measureColumn.ts`](src/utils/measureColumn.ts)'s doc comment for exactly what its test suite does
110
+ and doesn't cover.
111
+
112
+ ## API shape
113
+
114
+ ```vue
115
+ <script setup lang="ts">
116
+ import { useTemplateRef } from 'vue';
117
+ import { InanduGrid, useInanduGrid, type InanduGridRowSave } from '@inandu-solutions/grid-vue';
118
+ import '@inandu-solutions/grid-vue/style.css'; // optional default styling — skip it and bring your own
119
+
120
+ // Component: batteries-included table. The grid never mutates `rows` — events hand you the change.
121
+ function onRowSave({ row, values }: InanduGridRowSave) {
122
+ rows.value = rows.value.map(r => (r === row ? { ...r, ...values } : r));
123
+ }
124
+
125
+ // Its headless engine is exposed on a template ref, for programmatic control.
126
+ const gridRef = useTemplateRef('grid');
127
+ const sortByName = () => gridRef.value?.grid.toggleSort('name');
128
+
129
+ // Composable: headless — bring your own markup. Pass a getter to follow reactive data; every
130
+ // piece of state is a reactive getter (`headless.visibleRows`, no `.value`).
131
+ const headless = useInanduGrid(() => ({ rows: rows.value, columns, pageSize: 25 }));
132
+ </script>
133
+
134
+ <template>
135
+ <InanduGrid ref="grid" :rows="rows" :columns="columns" selectable @row-save="onRowSave" @selection-change="selected = $event">
136
+ <template #cell-status="{ value }"><StatusBadge :status="value" /></template>
137
+ <template #detail="{ row }"><OrderLines :order="row" /></template>
138
+ </InanduGrid>
139
+ </template>
140
+ ```
141
+
142
+ Events: `selection-change`, `row-save`, `row-create`, `row-delete`, `rows-delete`, `cells-paste`,
143
+ `row-order-change`, `cell-range-change`, `cell-ranges-change`.
144
+
145
+ ## Server-side data
146
+
147
+ For tables too big to load whole, let the backend sort, filter and page, and keep the grid's UI
148
+ unchanged:
149
+
150
+ ```vue
151
+ <script setup lang="ts">
152
+ import { InanduGrid, useInanduGridServer } from '@inandu-solutions/grid-vue';
153
+
154
+ const server = useInanduGridServer({ url: '/api/products' });
155
+ </script>
156
+
157
+ <template>
158
+ <InanduGrid
159
+ :rows="server.rows.value"
160
+ :columns="columns"
161
+ :page-size="25"
162
+ :server-side="{ totalItems: server.total.value }"
163
+ @query-change="server.setQuery"
164
+ />
165
+ </template>
166
+ ```
167
+
168
+ `useInanduGridServer` turns the grid's page / sort / search / column filters into a query string
169
+ (`?page=2&pageSize=25&sort=-price&q=cable&price_gte=20`), aborts superseded requests, debounces typing,
170
+ and keeps the previous page on screen while the next loads. It expects `{ data: [...], total: n }`.
171
+ That is exactly what [`Inandu.Grid.Extensions`](https://github.com/inandusolutions/inandu-grid-extensions)
172
+ (.NET / EF Core) returns from one `ToInanduGrid()` call — [request contract](https://github.com/inandusolutions/inandu-grid-extensions/blob/main/docs/request-contract.md) —
173
+ but any backend that speaks the same params works. Runnable example: [`examples/server-side`](examples/server-side).
174
+
175
+ In `serverSide` mode grouping, tree data, virtual scroll, `extraRowFilter` and column aggregate
176
+ totals are off (they would only ever see one page), and a column's Excel-style value checklist lists
177
+ the values on the current page. Use `buildInanduGridQuery(query)` if you'd rather do the fetching
178
+ yourself, and `fetcher` / `init` on the composable for auth headers or a custom client.
179
+
180
+ ## Development
181
+
182
+ ```bash
183
+ npm install
184
+ npm test # Vitest + Vue Testing Library
185
+ npm run typecheck # vue-tsc --noEmit
186
+ npm run build # library build (dist/)
187
+ ```
188
+
189
+ ## Contributing
190
+
191
+ Issues and PRs welcome. Please read [`CONTRIBUTING.md`](CONTRIBUTING.md) first, and note the
192
+ [Code of Conduct](.github/CODE_OF_CONDUCT.md). Security reports: [`.github/SECURITY.md`](.github/SECURITY.md).
193
+
194
+ ## License
195
+
196
+ MIT © [Inandu SAS](https://www.inandu.com/)
@@ -0,0 +1,34 @@
1
+ import { InanduGridRow } from '../core';
2
+ import { RowContext } from './internal';
3
+ /** One data row — its own read-only cells, or (while it's the row being edited) `editableColumns` as controls bound to the shared draft, plus a trailing Edit/Save/Cancel/Delete actions cell when `hasRowActions`. */
4
+ type __VLS_Props = {
5
+ ctx: RowContext;
6
+ row: InanduGridRow;
7
+ rowIndex: number;
8
+ /** Adds a leading drag-handle `<td>` and wires the whole row for drag-and-drop reordering — only in the flat, non-grouped render path, same restriction grid-angular's `rowReorder` has. */
9
+ hasRowDragHandle?: boolean;
10
+ isDragOverRow?: boolean;
11
+ /** Adds a leading expand/collapse toggle `<td>` and (while expanded) a full-width detail row right below — only in the flat, non-grouped render path, same restriction grid-angular's `hasMasterDetail` has. */
12
+ hasMasterDetail?: boolean;
13
+ isRowExpanded?: boolean;
14
+ };
15
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
+ rowDragStart: () => any;
17
+ rowDragOver: () => any;
18
+ rowDragLeave: () => any;
19
+ rowDrop: () => any;
20
+ toggleExpanded: () => any;
21
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ onRowDragStart?: (() => any) | undefined;
23
+ onRowDragOver?: (() => any) | undefined;
24
+ onRowDragLeave?: (() => any) | undefined;
25
+ onRowDrop?: (() => any) | undefined;
26
+ onToggleExpanded?: (() => any) | undefined;
27
+ }>, {
28
+ hasRowDragHandle: boolean;
29
+ isDragOverRow: boolean;
30
+ hasMasterDetail: boolean;
31
+ isRowExpanded: boolean;
32
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
33
+ declare const _default: typeof __VLS_export;
34
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { InanduGridColumn } from '../composables/useInanduGrid';
2
+ import { Translator } from './internal';
3
+ /** One editable cell's control, bound to the shared row draft in the same *raw control* shape `parseDraftValue()` expects (a string for text/number/date, a boolean for the checkbox) — plus its inline validation message, if any. */
4
+ type __VLS_Props = {
5
+ column: InanduGridColumn;
6
+ value: unknown;
7
+ error: string | undefined;
8
+ t: Translator;
9
+ };
10
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ change: (value: unknown) => any;
12
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onChange?: ((value: unknown) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { InanduGridColumnFilterValue } from '../core';
2
+ import { InanduGridColumn } from '../composables/useInanduGrid';
3
+ import { Translator } from './internal';
4
+ /** One filter control per column type, all working off the same `InanduGridColumnFilterValue` shape the core understands. */
5
+ type __VLS_Props = {
6
+ column: InanduGridColumn;
7
+ value: InanduGridColumnFilterValue | undefined;
8
+ t: Translator;
9
+ };
10
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ change: (patch: Partial<InanduGridColumnFilterValue>) => any;
12
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onChange?: ((patch: Partial<InanduGridColumnFilterValue>) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
@@ -0,0 +1,231 @@
1
+ import { VNodeChild } from 'vue';
2
+ import { InanduGridColumnFilterValue, InanduGridRow } from '../core';
3
+ import { InanduCellRenderContext, InanduEditRenderContext, InanduGridCellPaste, InanduGridColumn, InanduGridRowSave, InanduGridServerQuery, InanduHeaderRenderContext } from '../composables/useInanduGrid';
4
+ import { InanduGridCellRangeSelection } from './types';
5
+ type __VLS_Props = {
6
+ rows: InanduGridRow[];
7
+ columns: InanduGridColumn[];
8
+ /** Drives number/date formatting (`Intl`-based). Default: 'en'. */
9
+ locale?: string;
10
+ /** Drives built-in UI string translation (one of `INANDU_GRID_TRANSLATIONS`'s keys). Default: `locale`'s primary subtag. */
11
+ lang?: string;
12
+ /** 0 (default) disables pagination — every filtered/sorted row renders. Ignored while grouped. */
13
+ pageSize?: number;
14
+ /** Adds a checkbox column with row + select-all selection. Default: false. */
15
+ selectable?: boolean;
16
+ /** Adds a CSV/Excel/PDF export toolbar above the table. Default: false. */
17
+ exportable?: boolean;
18
+ /** Base filename (without extension) for exports. Default: 'inandu-grid'. */
19
+ exportFilenameBase?: string;
20
+ /** Adds a per-row "Delete" button. Default: false. */
21
+ deletable?: boolean;
22
+ /** `window.confirm()`-gates a single row's delete. Unset: deletes immediately. */
23
+ deleteConfirmMessage?: string;
24
+ /** `window.confirm()`-gates the "Delete selected" bulk action (shown when `selectable && deletable` with at least one row selected). Unset: deletes immediately. */
25
+ bulkDeleteConfirmMessage?: string;
26
+ /** Adds an "Add row" trigger with a blank draft row. Default: false. Has no effect unless at least one column is `editable`. */
27
+ creatable?: boolean;
28
+ /** Opts into `Ctrl+C`/`Ctrl+V` cell copy/paste (Excel-style TSV). Default: false. */
29
+ clipboard?: boolean;
30
+ /**
31
+ * Opt-in Excel-style range selection — click-and-drag (or shift-click, without dragging) across
32
+ * cells in the flat, non-grouped, non-tree, non-virtualized render path (same restriction
33
+ * `rowReorder`/`clipboard` already document) selects a rectangular block of cells, highlighted via
34
+ * `.inandu-cell-range-selected`. Off by default. When `clipboard` is *also* on, `Ctrl+C` copies
35
+ * the *entire* selected range as TSV instead of just the focused cell — otherwise this is purely a
36
+ * selection/highlight feature with no built-in side effect; the `cell-range-change`/
37
+ * `cell-ranges-change` events are how a consumer observes what's currently selected.
38
+ */
39
+ cellRangeSelection?: boolean;
40
+ /**
41
+ * Lets a Ctrl/Cmd-drag (or Ctrl/Cmd-click) *add* another rectangle to the selection instead of
42
+ * replacing it, the same convention spreadsheets use. A plain click still resets to one
43
+ * rectangle. Only meaningful with `cellRangeSelection` on. `cell-range-change` keeps reporting
44
+ * the *active* (last) rectangle; `cell-ranges-change` reports the whole list. `Ctrl+C` copies
45
+ * only the active rectangle. Default: false.
46
+ */
47
+ multiRange?: boolean;
48
+ /** Adds a "Columns" toolbar button + popup letting the user show/hide individual columns at runtime. Default: false. */
49
+ columnToggle?: boolean;
50
+ /** Adds a per-row drag handle to reorder rows. Default: false. Auto-disabled while grouped, same as grid-angular. */
51
+ rowReorder?: boolean;
52
+ /**
53
+ * Turns on tree mode: the field on each row holding its child rows (a nested array of the same
54
+ * shape). `rows` is then the root rows. Auto-disabled while grouped. Tree rows are display +
55
+ * expand only — inline editing, drag-reorder and clipboard don't apply to them, same as
56
+ * grid-angular.
57
+ */
58
+ treeChildrenKey?: string;
59
+ /** Initial expand state for tree mode. Default: `'none'`. */
60
+ treeDefaultExpanded?: 'none' | 'all' | number;
61
+ /**
62
+ * Enables master-detail as a render function: renders a leading expand/collapse toggle per row,
63
+ * and (while expanded) a full-width detail row right below it, with whatever this returns. The
64
+ * `#detail="{ row }"` slot does the same template-side (and wins when both are set). Auto-disabled
65
+ * while grouped, same as grid-angular's `detailTemplate`/`hasMasterDetail`. Unset (default): off.
66
+ */
67
+ renderDetail?: (row: InanduGridRow) => VNodeChild;
68
+ /** Collapses any other expanded row first, accordion-style, when a new one expands. Off (any number of rows can be expanded at once) by default. */
69
+ singleDetailExpand?: boolean;
70
+ /** An extra per-row predicate ANDed onto the free-text + column filters — same as grid-angular's `extraRowFilter`. Lets a caller layer its own filtering (e.g. an advanced-filter query) on top of the grid's own. Unset: no extra filtering. */
71
+ extraRowFilter?: (row: InanduGridRow) => boolean;
72
+ /** Server-side mode: `rows` is the current page as sorted/filtered/paged by the server and `totalItems` is the full match count. See `useInanduGridServer`. Needs `pageSize` > 0. */
73
+ serverSide?: {
74
+ totalItems: number;
75
+ };
76
+ /**
77
+ * Opt-in row virtualization for large datasets — only rows scrolled into view (plus a small
78
+ * overscan runway) are actually mounted. Bypasses pagination entirely, same as grouping.
79
+ * Auto-disabled while grouped (this port doesn't interleave group headers into the virtualized
80
+ * window the way grid-angular does); also disables master-detail, row drag-reorder, tree data,
81
+ * and the totals `<tfoot>`, same restrictions grid-angular's `virtualScroll` has. Default: false.
82
+ */
83
+ virtualScroll?: boolean;
84
+ /**
85
+ * Fixed row height (px) the virtualization math uses to compute scroll position and how many
86
+ * rows to render. Unlike grid-angular, this port doesn't auto-measure a rendered row's real
87
+ * height — pass the actual rendered row height for correct scrolling. Default: 40.
88
+ */
89
+ virtualRowHeight?: number;
90
+ /** The scrollable viewport's own height (px) — only used while `virtualScroll`. Default: 400. */
91
+ height?: number;
92
+ /** Extra rows rendered above/below the visible window, so a fast scroll doesn't flash empty space before the next render catches up. Default: 4. */
93
+ overscan?: number;
94
+ /**
95
+ * Double-click a column's resize handle to fit its width to its widest currently-rendered value
96
+ * (header included). Measures real rendered text width via the DOM (`measureColumnContentWidth`)
97
+ * — like grid-angular's own autosize, this only measures what's actually mounted (one page, or
98
+ * the virtual window), not the full dataset. Default: false.
99
+ */
100
+ autosize?: boolean;
101
+ };
102
+ type __VLS_Slots = {
103
+ /** Custom cell content for column `<field>`: `#cell-name="{ value, row, field }"`. */
104
+ [key: `cell-${string}`]: (ctx: InanduCellRenderContext) => VNodeChild;
105
+ /** Custom header label for column `<field>`: `#header-name="{ title, field }"`. */
106
+ [key: `header-${string}`]: (ctx: InanduHeaderRenderContext) => VNodeChild;
107
+ /** Custom editor for editable column `<field>`: `#editor-name="{ value, setValue, error, row, field }"`. */
108
+ [key: `editor-${string}`]: (ctx: InanduEditRenderContext) => VNodeChild;
109
+ /** Master-detail content for an expanded row — its presence turns master-detail on. */
110
+ detail?: (ctx: {
111
+ row: InanduGridRow;
112
+ }) => VNodeChild;
113
+ };
114
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
115
+ grid: {
116
+ readonly visibleColumns: InanduGridColumn[];
117
+ readonly allColumns: InanduGridColumn[];
118
+ stickyOffset: (field: string) => number;
119
+ stickyOffsetRight: (field: string) => number;
120
+ columnPinnedSide: (field: string) => import('..').InanduColumnStickySide | undefined;
121
+ setColumnPinned: (field: string, side: import('..').InanduColumnStickySide | undefined) => void;
122
+ readonly hideableColumns: InanduGridColumn[];
123
+ isColumnHidden: (field: string) => boolean;
124
+ toggleColumnVisibility: (field: string) => void;
125
+ setColumnOrder: (fields: readonly string[]) => void;
126
+ readonly draggingField: string | undefined;
127
+ onColumnDragStart: (field: string) => void;
128
+ onColumnDrop: (targetField: string) => void;
129
+ effectiveWidth: (field: string) => number;
130
+ isColumnResized: (field: string) => boolean;
131
+ setColumnWidth: (field: string, width: number) => void;
132
+ readonly draggingRow: InanduGridRow | undefined;
133
+ onRowDragStart: (row: InanduGridRow) => void;
134
+ onRowDrop: (targetRow: InanduGridRow) => void;
135
+ readonly hasTreeData: boolean;
136
+ readonly treeRows: import('..').TreeVisibleRow<InanduGridRow>[];
137
+ isTreeRowExpanded: (row: InanduGridRow) => boolean;
138
+ toggleTreeRow: (row: InanduGridRow) => void;
139
+ setAllTreeRowsExpanded: (expanded: boolean) => void;
140
+ isRowExpanded: (row: InanduGridRow) => boolean;
141
+ toggleRowExpanded: (row: InanduGridRow) => void;
142
+ readonly hasVirtualScroll: boolean;
143
+ readonly visibleRows: InanduGridRow[];
144
+ readonly exportRows: InanduGridRow[];
145
+ readonly sortedRows: InanduGridRow[];
146
+ readonly filteredRowCount: number;
147
+ readonly locale: string;
148
+ readonly sortCriteria: import('..').InanduGridSort[];
149
+ setSort: (criteria: import('..').InanduGridSort[]) => void;
150
+ toggleSort: (field: string, additive?: boolean) => void;
151
+ sortDirectionFor: (field: string) => "asc" | "desc" | undefined;
152
+ sortPriorityFor: (field: string) => number | undefined;
153
+ readonly filterValues: Record<string, InanduGridColumnFilterValue>;
154
+ setFilterValue: (field: string, value: InanduGridColumnFilterValue) => void;
155
+ clearAllFilters: () => void;
156
+ readonly filterQuery: string;
157
+ setFilterQuery: (query: string) => void;
158
+ readonly page: number;
159
+ setPage: (next: number) => void;
160
+ readonly pageCount: number;
161
+ readonly groupByField: string | undefined;
162
+ setGroupByField: (field: string | undefined) => void;
163
+ readonly groups: import('..').InanduGridGroup[] | null;
164
+ readonly totals: Record<string, number>;
165
+ readonly selectedRows: Set<InanduGridRow>;
166
+ isRowSelected: (row: InanduGridRow) => boolean;
167
+ toggleRowSelection: (row: InanduGridRow) => void;
168
+ readonly allSelected: boolean;
169
+ readonly someSelected: boolean;
170
+ toggleSelectAll: () => void;
171
+ clearSelection: () => void;
172
+ readonly editableColumns: InanduGridColumn[];
173
+ readonly editingRow: InanduGridRow | undefined;
174
+ readonly isAddingRow: boolean;
175
+ readonly rowDraft: Record<string, unknown>;
176
+ readonly fieldErrors: Record<string, string>;
177
+ readonly isValidating: boolean;
178
+ isEditingRow: (row: InanduGridRow) => boolean;
179
+ isAnotherRowEditing: (row: InanduGridRow) => boolean;
180
+ startEditingRow: (row: InanduGridRow) => void;
181
+ cancelRowEdit: () => void;
182
+ setRowDraftValue: (field: string, value: unknown) => void;
183
+ saveRow: (row: InanduGridRow) => Promise<void>;
184
+ deleteRow: (row: InanduGridRow) => void;
185
+ deleteSelectedRows: () => void;
186
+ startAddingRow: () => void;
187
+ cancelAddRow: () => void;
188
+ saveNewRow: () => Promise<void>;
189
+ validateCell: (column: InanduGridColumn, value: unknown, row?: Record<string, unknown>) => string | null;
190
+ copyCellText: (rowIndex: number, field: string) => string;
191
+ pasteAt: (anchorRowIndex: number, anchorField: string, text: string) => void;
192
+ };
193
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
194
+ queryChange: (query: InanduGridServerQuery) => any;
195
+ selectionChange: (selectedRows: InanduGridRow[]) => any;
196
+ rowSave: (event: InanduGridRowSave) => any;
197
+ rowCreate: (values: Record<string, unknown>) => any;
198
+ rowDelete: (row: InanduGridRow) => any;
199
+ rowsDelete: (rows: InanduGridRow[]) => any;
200
+ cellsPaste: (updates: InanduGridCellPaste[]) => any;
201
+ cellRangeChange: (selection: InanduGridCellRangeSelection | undefined) => any;
202
+ cellRangesChange: (selections: InanduGridCellRangeSelection[]) => any;
203
+ rowOrderChange: (rows: InanduGridRow[]) => any;
204
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
205
+ onQueryChange?: ((query: InanduGridServerQuery) => any) | undefined;
206
+ onSelectionChange?: ((selectedRows: InanduGridRow[]) => any) | undefined;
207
+ onRowSave?: ((event: InanduGridRowSave) => any) | undefined;
208
+ onRowCreate?: ((values: Record<string, unknown>) => any) | undefined;
209
+ onRowDelete?: ((row: InanduGridRow) => any) | undefined;
210
+ onRowsDelete?: ((rows: InanduGridRow[]) => any) | undefined;
211
+ onCellsPaste?: ((updates: InanduGridCellPaste[]) => any) | undefined;
212
+ onCellRangeChange?: ((selection: InanduGridCellRangeSelection | undefined) => any) | undefined;
213
+ onCellRangesChange?: ((selections: InanduGridCellRangeSelection[]) => any) | undefined;
214
+ onRowOrderChange?: ((rows: InanduGridRow[]) => any) | undefined;
215
+ }>, {
216
+ locale: string;
217
+ pageSize: number;
218
+ treeDefaultExpanded: number | "none" | "all";
219
+ exportFilenameBase: string;
220
+ virtualRowHeight: number;
221
+ height: number;
222
+ overscan: number;
223
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
224
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
225
+ declare const _default: typeof __VLS_export;
226
+ export default _default;
227
+ type __VLS_WithSlots<T, S> = T & {
228
+ new (): {
229
+ $slots: S;
230
+ };
231
+ };
@@ -0,0 +1,60 @@
1
+ import { CSSProperties, PropType, VNodeChild } from 'vue';
2
+ import { InanduGridRow } from '../core';
3
+ import { InanduGridColumn } from '../composables/useInanduGrid';
4
+ import { InanduGridMessageKey } from '../utils/translate';
5
+ export type Translator = (key: InanduGridMessageKey, params?: Record<string, string | number>) => string;
6
+ /** Renders whatever VNode children it's handed — how a slot or a column's `renderCell`/`renderHeader`/`renderEditor` result is mounted from inside a template. */
7
+ export declare const RenderNodes: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
8
+ nodes: {
9
+ type: PropType<VNodeChild>;
10
+ default: null;
11
+ };
12
+ }>, () => never, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
13
+ nodes: {
14
+ type: PropType<VNodeChild>;
15
+ default: null;
16
+ };
17
+ }>> & Readonly<{}>, {
18
+ nodes: VNodeChild;
19
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
20
+ /**
21
+ * Everything a `<DataRow>` needs from the grid, bundled into one prop rather than ~30 — the Vue
22
+ * counterpart of the React port's spread `rowProps`. Built once per render by `<InanduGrid>`.
23
+ */
24
+ export interface RowContext {
25
+ columns: InanduGridColumn[];
26
+ t: Translator;
27
+ selectable: boolean;
28
+ selectColumnStyle: CSSProperties | undefined;
29
+ columnStyle: (column: InanduGridColumn) => CSSProperties;
30
+ isRowSelected: (row: InanduGridRow) => boolean;
31
+ toggleRowSelection: (row: InanduGridRow) => void;
32
+ hasRowActions: boolean;
33
+ editableColumnCount: number;
34
+ isEditingRow: (row: InanduGridRow) => boolean;
35
+ isAnotherRowEditing: (row: InanduGridRow) => boolean;
36
+ startEditingRow: (row: InanduGridRow) => void;
37
+ cancelRowEdit: () => void;
38
+ saveRow: (row: InanduGridRow) => void;
39
+ deleteRow: (row: InanduGridRow) => void;
40
+ deletable: boolean;
41
+ rowDraft: Record<string, unknown>;
42
+ fieldErrors: Record<string, string>;
43
+ isValidating: boolean;
44
+ setRowDraftValue: (field: string, value: unknown) => void;
45
+ /** A cell's display content: the `#cell-<field>` slot, else the column's `renderCell`, else the formatted value. */
46
+ cellContent: (column: InanduGridColumn, row: InanduGridRow) => VNodeChild;
47
+ /** A custom editor (`#editor-<field>` slot or `renderEditor`), or `undefined` to fall back to the built-in `<EditCell>`. */
48
+ editorContent: (column: InanduGridColumn, row: InanduGridRow) => VNodeChild | undefined;
49
+ /** Master-detail content for an expanded row (`#detail` slot or `renderDetail`). */
50
+ detailContent: (row: InanduGridRow) => VNodeChild;
51
+ /** Adds the `tabindex` `onTableKeyDown` resolves a Ctrl+C/Ctrl+V onto — `data-row-index`/`data-field` are always present (flat, non-grouped render path only), same as grid-angular. */
52
+ clipboard: boolean;
53
+ /** Marks cells `.inandu-cell-range-selected` and wires the drag/shift-click gesture — only in the flat, non-grouped, non-tree, non-virtualized render path, same restriction grid-angular's `cellRangeSelection` has. */
54
+ cellRangeSelection: boolean;
55
+ isCellInRange: (rowIndex: number, colIndex: number) => boolean;
56
+ onCellRangeMouseDown: (event: MouseEvent, rowIndex: number, colIndex: number) => void;
57
+ onCellRangeMouseEnter: (rowIndex: number, colIndex: number) => void;
58
+ /** Column count a full-width row (`colspan`) must span: `columns.length` plus every leading/trailing extra column. */
59
+ extraColumnCount: number;
60
+ }
@@ -0,0 +1,6 @@
1
+ import { InanduGridRow } from '../core';
2
+ /** The currently selected cell range — see `<InanduGrid cell-range-selection>` and its `cell-range-change` event. `rows`/`fields` are the full row objects and field names spanning the selected rectangle, in `visibleRows`/`visibleColumns` order. */
3
+ export interface InanduGridCellRangeSelection {
4
+ rows: InanduGridRow[];
5
+ fields: string[];
6
+ }