@svgrid/grid 1.0.2 → 1.1.1

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 (216) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +137 -39
  3. package/dist/GridFooter.svelte +164 -0
  4. package/dist/GridFooter.svelte.d.ts +29 -0
  5. package/dist/GridMenus.svelte +648 -0
  6. package/dist/GridMenus.svelte.d.ts +31 -0
  7. package/dist/SvGrid.controller.svelte.d.ts +472 -0
  8. package/dist/SvGrid.controller.svelte.js +1917 -0
  9. package/dist/SvGrid.css +2012 -0
  10. package/dist/SvGrid.helpers.d.ts +35 -0
  11. package/dist/SvGrid.helpers.js +160 -0
  12. package/dist/SvGrid.helpers.test.d.ts +1 -0
  13. package/dist/SvGrid.helpers.test.js +298 -0
  14. package/dist/SvGrid.svelte +2346 -8742
  15. package/dist/SvGrid.svelte.d.ts +4 -357
  16. package/dist/SvGrid.types.d.ts +523 -0
  17. package/dist/SvGrid.types.js +1 -0
  18. package/dist/SvGridChart.svelte +1060 -23
  19. package/dist/SvGridChart.svelte.d.ts +17 -0
  20. package/dist/aligned-grids.d.ts +6 -0
  21. package/dist/aligned-grids.js +84 -0
  22. package/dist/aligned-grids.test.d.ts +1 -0
  23. package/dist/aligned-grids.test.js +75 -0
  24. package/dist/build-api.coverage.test.d.ts +20 -0
  25. package/dist/build-api.coverage.test.js +505 -0
  26. package/dist/build-api.d.ts +5 -0
  27. package/dist/build-api.js +557 -0
  28. package/dist/cell-render.d.ts +15 -0
  29. package/dist/cell-render.js +246 -0
  30. package/dist/cell-render.test.d.ts +1 -0
  31. package/dist/cell-render.test.js +338 -0
  32. package/dist/cell-values.d.ts +28 -0
  33. package/dist/cell-values.js +89 -0
  34. package/dist/chart-export.test.d.ts +1 -0
  35. package/dist/chart-export.test.js +302 -0
  36. package/dist/chart.coverage.test.d.ts +1 -0
  37. package/dist/chart.coverage.test.js +748 -0
  38. package/dist/chart.d.ts +370 -3
  39. package/dist/chart.js +1135 -42
  40. package/dist/clipboard.d.ts +15 -0
  41. package/dist/clipboard.js +420 -0
  42. package/dist/clipboard.test.d.ts +1 -0
  43. package/dist/clipboard.test.js +700 -0
  44. package/dist/collaboration.coverage.test.d.ts +1 -0
  45. package/dist/collaboration.coverage.test.js +200 -0
  46. package/dist/column-groups.d.ts +19 -0
  47. package/dist/column-groups.js +62 -0
  48. package/dist/column-groups.test.d.ts +1 -0
  49. package/dist/column-groups.test.js +56 -0
  50. package/dist/column-types.d.ts +10 -0
  51. package/dist/column-types.js +63 -0
  52. package/dist/column-types.test.d.ts +1 -0
  53. package/dist/column-types.test.js +62 -0
  54. package/dist/columns.d.ts +30 -0
  55. package/dist/columns.js +277 -0
  56. package/dist/columns.test.d.ts +1 -0
  57. package/dist/columns.test.js +625 -0
  58. package/dist/core.d.ts +86 -1
  59. package/dist/css.d.ts +3 -0
  60. package/dist/editing.d.ts +31 -0
  61. package/dist/editing.js +529 -0
  62. package/dist/editing.test.d.ts +1 -0
  63. package/dist/editing.test.js +732 -0
  64. package/dist/editors/cell-editors.coverage.test.d.ts +1 -0
  65. package/dist/editors/cell-editors.coverage.test.js +139 -0
  66. package/dist/editors/cell-editors.d.ts +1 -1
  67. package/dist/facet-buckets.d.ts +13 -0
  68. package/dist/facet-buckets.js +54 -0
  69. package/dist/facet-buckets.test.d.ts +1 -0
  70. package/dist/facet-buckets.test.js +296 -0
  71. package/dist/features.d.ts +5 -0
  72. package/dist/features.js +30 -0
  73. package/dist/filter-operators.d.ts +16 -0
  74. package/dist/filter-operators.js +69 -0
  75. package/dist/filter-operators.test.d.ts +1 -0
  76. package/dist/filter-operators.test.js +135 -0
  77. package/dist/hyperformula-adapter.d.ts +82 -0
  78. package/dist/hyperformula-adapter.js +73 -0
  79. package/dist/hyperformula-adapter.test.d.ts +1 -0
  80. package/dist/hyperformula-adapter.test.js +205 -0
  81. package/dist/index.d.ts +9 -3
  82. package/dist/index.js +8 -2
  83. package/dist/keyboard-handlers.coverage.test.d.ts +1 -0
  84. package/dist/keyboard-handlers.coverage.test.js +495 -0
  85. package/dist/keyboard-handlers.d.ts +7 -0
  86. package/dist/keyboard-handlers.js +202 -0
  87. package/dist/menus.d.ts +40 -0
  88. package/dist/menus.js +390 -0
  89. package/dist/menus.test.d.ts +1 -0
  90. package/dist/menus.test.js +560 -0
  91. package/dist/named-views.coverage.test.d.ts +1 -0
  92. package/dist/named-views.coverage.test.js +180 -0
  93. package/dist/named-views.d.ts +27 -0
  94. package/dist/named-views.js +39 -0
  95. package/dist/row-drag.d.ts +49 -0
  96. package/dist/row-drag.js +221 -0
  97. package/dist/row-drag.test.d.ts +1 -0
  98. package/dist/row-drag.test.js +142 -0
  99. package/dist/row-resize.d.ts +43 -0
  100. package/dist/row-resize.js +158 -0
  101. package/dist/row-resize.test.d.ts +1 -0
  102. package/dist/row-resize.test.js +329 -0
  103. package/dist/scroll-sync.d.ts +9 -0
  104. package/dist/scroll-sync.js +89 -0
  105. package/dist/scroll-sync.test.d.ts +1 -0
  106. package/dist/scroll-sync.test.js +290 -0
  107. package/dist/selection.d.ts +32 -0
  108. package/dist/selection.js +427 -0
  109. package/dist/selection.multi-range.test.d.ts +1 -0
  110. package/dist/selection.multi-range.test.js +55 -0
  111. package/dist/selection.test.d.ts +1 -0
  112. package/dist/selection.test.js +647 -0
  113. package/dist/server-data-source.coverage.test.d.ts +1 -0
  114. package/dist/server-data-source.coverage.test.js +154 -0
  115. package/dist/spreadsheet.d.ts +110 -0
  116. package/dist/spreadsheet.js +242 -0
  117. package/dist/spreadsheet.test.d.ts +1 -0
  118. package/dist/spreadsheet.test.js +446 -0
  119. package/dist/summaries.d.ts +12 -0
  120. package/dist/summaries.js +65 -0
  121. package/dist/sv-grid-scrollbar.js +13 -1
  122. package/dist/svgrid-wrapper.types.d.ts +31 -1
  123. package/dist/svgrid.behavior.test.js +20 -0
  124. package/dist/svgrid.comments-autocomplete.test.d.ts +1 -0
  125. package/dist/svgrid.comments-autocomplete.test.js +96 -0
  126. package/dist/svgrid.context-menu.test.d.ts +1 -0
  127. package/dist/svgrid.context-menu.test.js +102 -0
  128. package/dist/svgrid.interaction.test.js +31 -0
  129. package/dist/svgrid.new-features.wrapper.test.js +64 -6
  130. package/dist/svgrid.wrapper.test.js +27 -1
  131. package/dist/test-setup.js +9 -3
  132. package/dist/virtualization/column-virtualizer.d.ts +2 -0
  133. package/dist/virtualization/scroll-scaling.d.ts +45 -0
  134. package/dist/virtualization/scroll-scaling.js +99 -0
  135. package/dist/virtualization/scroll-scaling.test.d.ts +1 -0
  136. package/dist/virtualization/scroll-scaling.test.js +127 -0
  137. package/dist/virtualization/svelte-virtualizer.svelte.d.ts +2 -0
  138. package/dist/virtualization/svelte-virtualizer.svelte.js +2 -0
  139. package/dist/virtualization/virtualizer.d.ts +7 -0
  140. package/dist/virtualization/virtualizer.js +30 -0
  141. package/package.json +2 -1
  142. package/src/GridFooter.svelte +164 -0
  143. package/src/GridMenus.svelte +648 -0
  144. package/src/SvGrid.controller.svelte.ts +2352 -0
  145. package/src/SvGrid.css +2012 -0
  146. package/src/SvGrid.helpers.test.ts +415 -0
  147. package/src/SvGrid.helpers.ts +185 -0
  148. package/src/SvGrid.svelte +2346 -8742
  149. package/src/SvGrid.types.ts +537 -0
  150. package/src/SvGridChart.svelte +1060 -23
  151. package/src/aligned-grids.test.ts +80 -0
  152. package/src/aligned-grids.ts +87 -0
  153. package/src/build-api.coverage.test.ts +532 -0
  154. package/src/build-api.ts +683 -0
  155. package/src/cell-render.test.ts +451 -0
  156. package/src/cell-render.ts +426 -0
  157. package/src/cell-values.ts +114 -0
  158. package/src/chart-export.test.ts +370 -0
  159. package/src/chart.coverage.test.ts +814 -0
  160. package/src/chart.ts +1352 -47
  161. package/src/clipboard.test.ts +780 -0
  162. package/src/clipboard.ts +552 -0
  163. package/src/collaboration.coverage.test.ts +220 -0
  164. package/src/column-groups.test.ts +59 -0
  165. package/src/column-groups.ts +80 -0
  166. package/src/column-types.test.ts +68 -0
  167. package/src/column-types.ts +82 -0
  168. package/src/columns.test.ts +702 -0
  169. package/src/columns.ts +419 -0
  170. package/src/core.ts +86 -0
  171. package/src/css.d.ts +3 -0
  172. package/src/editing.test.ts +837 -0
  173. package/src/editing.ts +669 -0
  174. package/src/editors/cell-editors.coverage.test.ts +156 -0
  175. package/src/editors/cell-editors.ts +1 -0
  176. package/src/facet-buckets.test.ts +353 -0
  177. package/src/facet-buckets.ts +67 -0
  178. package/src/features.ts +128 -0
  179. package/src/filter-operators.test.ts +174 -0
  180. package/src/filter-operators.ts +87 -0
  181. package/src/hyperformula-adapter.test.ts +256 -0
  182. package/src/hyperformula-adapter.ts +124 -0
  183. package/src/index.ts +49 -0
  184. package/src/keyboard-handlers.coverage.test.ts +560 -0
  185. package/src/keyboard-handlers.ts +353 -0
  186. package/src/keyboard.ts +97 -97
  187. package/src/menus.test.ts +620 -0
  188. package/src/menus.ts +555 -0
  189. package/src/named-views.coverage.test.ts +210 -0
  190. package/src/named-views.ts +48 -0
  191. package/src/row-drag.test.ts +168 -0
  192. package/src/row-drag.ts +255 -0
  193. package/src/row-resize.test.ts +369 -0
  194. package/src/row-resize.ts +171 -0
  195. package/src/scroll-sync.test.ts +330 -0
  196. package/src/scroll-sync.ts +218 -0
  197. package/src/selection.multi-range.test.ts +61 -0
  198. package/src/selection.test.ts +722 -0
  199. package/src/selection.ts +579 -0
  200. package/src/server-data-source.coverage.test.ts +180 -0
  201. package/src/spreadsheet.test.ts +489 -0
  202. package/src/spreadsheet.ts +304 -0
  203. package/src/summaries.ts +204 -0
  204. package/src/sv-grid-scrollbar.ts +13 -1
  205. package/src/svgrid-wrapper.types.ts +31 -1
  206. package/src/svgrid.behavior.test.ts +22 -0
  207. package/src/svgrid.comments-autocomplete.test.ts +112 -0
  208. package/src/svgrid.context-menu.test.ts +126 -0
  209. package/src/svgrid.interaction.test.ts +30 -0
  210. package/src/svgrid.new-features.wrapper.test.ts +67 -6
  211. package/src/svgrid.wrapper.test.ts +27 -1
  212. package/src/test-setup.ts +9 -6
  213. package/src/virtualization/scroll-scaling.test.ts +148 -0
  214. package/src/virtualization/scroll-scaling.ts +121 -0
  215. package/src/virtualization/svelte-virtualizer.svelte.ts +2 -0
  216. package/src/virtualization/virtualizer.ts +26 -0
@@ -1,362 +1,9 @@
1
- import { type ColumnDef, type RowData, type SvGridApi, type TableFeatures } from "./index";
1
+ import { type RowData, type TableFeatures } from "./index";
2
2
  import "./sv-grid-scrollbar";
3
- import type { Snippet } from "svelte";
4
- import { type ConditionalFormat } from "./conditional-formatting";
3
+ import "./SvGrid.css";
4
+ import type { Props } from "./SvGrid.types";
5
5
  declare function $$render<TFeatures extends TableFeatures = TableFeatures, TData extends RowData = RowData>(): {
6
- props: {
7
- data: ReadonlyArray<TData>;
8
- columns: Array<ColumnDef<TFeatures, TData>>;
9
- /**
10
- * The feature set built with `tableFeatures({ ... })`. Optional - the
11
- * `sortable` / `filterable` / `groupable` shortcuts below inject the
12
- * matching feature for you, so a grid can be configured entirely from
13
- * the boolean shortcuts without importing the feature constants.
14
- */
15
- features?: TFeatures;
16
- /**
17
- * Convenience shortcuts to switch a whole capability on without wiring
18
- * `features` or the finer-grained props by hand. Every capability is OFF
19
- * by default - a bare grid is a plain read-only table - so set the
20
- * shortcut `true` to opt in. (`false` / omitted both leave it off; the
21
- * shortcut is mainly there to turn things ON.)
22
- *
23
- * `sortable` - column sorting (injects `rowSortingFeature`)
24
- * `filterable` - column filtering (injects `columnFilteringFeature`)
25
- * `editable` - inline cell editing (alias of `enableInlineEditing`)
26
- * `groupable` - row grouping controls(alias of `showGroupingControls`,
27
- * also injects `columnGroupingFeature`)
28
- * `pageable` - pagination footer (alias of `showPagination`)
29
- *
30
- * Fine-grained props (`enableInlineEditing`, `showPagination`, ...) still
31
- * work; the shortcut wins only when it is explicitly set.
32
- */
33
- sortable?: boolean;
34
- filterable?: boolean;
35
- editable?: boolean;
36
- groupable?: boolean;
37
- pageable?: boolean;
38
- loading?: boolean;
39
- /**
40
- * Render `loading` as a non-blocking overlay instead of replacing the
41
- * whole grid: the current rows stay visible (dimmed, with a top progress
42
- * bar) during a refetch, and the first load shows shimmer skeleton rows.
43
- * Ideal for server-paged grids so paging/sorting doesn't flash. Defaults
44
- * to `false` (the classic full "Loading..." replacement).
45
- */
46
- loadingOverlay?: boolean;
47
- /** Skeleton placeholder rows to show on first load. Defaults to 8. */
48
- loadingSkeletonRows?: number;
49
- error?: string | null;
50
- emptyMessage?: string;
51
- showGlobalFilter?: boolean;
52
- showColumnFilters?: boolean;
53
- /**
54
- * Quick way to pick a single filtering UI. When set it controls which of
55
- * the three filter surfaces appears (and is overridden per-surface by the
56
- * `showGlobalFilter` / `showColumnFilters` / `showFilterRow` props).
57
- * Defaults to `'menu'` (only the column menu's filter section is shown).
58
- */
59
- filterMode?: "row" | "menu" | "global" | "none";
60
- showGroupingControls?: boolean;
61
- showRowSelection?: boolean;
62
- showPagination?: boolean;
63
- /** Initial page size when pagination is enabled. Defaults to 10. */
64
- pageSize?: number;
65
- virtualization?: boolean;
66
- rowHeight?: number;
67
- overscan?: number;
68
- /**
69
- * Height of the grid's scrollable shell. A number is treated as pixels;
70
- * a string is used as-is, so callers can pass `'100%'` or `'auto'` to
71
- * make the grid fill its parent. Defaults to 520 px.
72
- */
73
- containerHeight?: number | string;
74
- columnVirtualization?: boolean;
75
- columnOverscan?: number;
76
- columnWidth?: number;
77
- /**
78
- * Columns pinned to the left/right edge on mount. Each entry is a
79
- * column id (matches `ColumnDef.field` when no explicit id is set).
80
- * The internal pinning state is seeded once at mount; user-driven
81
- * pinning via the column menu still works and overrides this default.
82
- * Requires `columnVirtualization={false}` to be visible in the menu
83
- * UI (sticky positioning can't co-exist with column virtualization
84
- * since the virtualizer recycles DOM nodes).
85
- */
86
- initialColumnPinning?: {
87
- left?: ReadonlyArray<string>;
88
- right?: ReadonlyArray<string>;
89
- };
90
- /**
91
- * When `true`, columns are scaled proportionally so their total width
92
- * fills the viewport (no empty space on the right). Disabled by
93
- * default - explicit `width` values are used as-is. User resizes still
94
- * win once they happen.
95
- */
96
- fitColumns?: boolean;
97
- showFilterMenu?: boolean;
98
- showFilterRow?: boolean;
99
- enableCellSelection?: boolean;
100
- enableInlineEditing?: boolean;
101
- enableRowSummaries?: boolean;
102
- /**
103
- * Excel-style status bar under the grid showing live aggregates of the
104
- * selected cell range (count, numeric count, sum, average, min, max).
105
- * `true` shows the default set; pass `{ aggregates: [...] }` to choose
106
- * which. Requires `enableCellSelection`.
107
- */
108
- statusBar?: boolean | {
109
- aggregates?: ReadonlyArray<"count" | "numericCount" | "sum" | "avg" | "min" | "max">;
110
- };
111
- /**
112
- * Show a docked Columns tool panel - the enterprise sidebar for toggling
113
- * column visibility, reordering, and grouping without a right-click. A
114
- * toggle button appears at the grid's top-right; the panel itself docks
115
- * on the right edge.
116
- */
117
- toolPanel?: boolean;
118
- /**
119
- * Quick way to pick which selection surfaces are active. `'row'` shows the
120
- * selection checkbox column only, `'cell'` allows rectangle/range cell
121
- * selection only, `'both'` (default) enables both, `'none'` disables both.
122
- * Overridden per-surface by `showRowSelection` / `enableCellSelection`.
123
- */
124
- selectionMode?: "row" | "cell" | "both" | "none";
125
- /**
126
- * Render a leading row-number column (1-based) before any selection
127
- * column. Useful as a permanent anchor when scrolling wide grids.
128
- */
129
- showRowNumbers?: boolean;
130
- /**
131
- * Width (px) of the row-number column. Defaults to 56, which fits up
132
- * to "99,999"; bump this when the dataset crosses six digits so the
133
- * largest row number stays fully visible at the bottom of a scroll.
134
- */
135
- rowNumberWidth?: number;
136
- /** Receives the imperative grid API once the component has mounted. */
137
- onApiReady?: (api: SvGridApi<TFeatures, TData>) => void;
138
- /**
139
- * Fires whenever the row-selection state changes. The first argument
140
- * is the new selection record `{ [rowId]: true }`; the second is the
141
- * array of selected `TData` rows.
142
- */
143
- onRowSelectionChange?: (selection: Record<string, boolean>, rows: TData[]) => void;
144
- /**
145
- * Fires whenever the cell-selection rectangle changes (mouse, keyboard,
146
- * or `api.selectCells()`). `ranges` matches `api.getSelected()` -
147
- * `[rowStart, colStart, rowEnd, colEnd]` rectangles in grid coords.
148
- * Empty array when the user clears the selection.
149
- */
150
- onCellSelectionChange?: (ranges: Array<[number, number, number, number]>) => void;
151
- /**
152
- * When `true`, the grid records sort state (and renders sort indicators
153
- * + cycling on headers) but does NOT actually re-order the rows. The
154
- * consumer is expected to sort `data` themselves - typically via
155
- * `onSortingChange`. Use this for tree/hierarchical data, where a flat
156
- * global sort would break parent-child adjacency. Defaults to `false`.
157
- */
158
- externalSort?: boolean;
159
- /**
160
- * Fires whenever the sort clauses change. Receives the new array of
161
- * `{ id, desc }` entries. Pair with `externalSort={true}` when the
162
- * consumer wants to own the row ordering.
163
- */
164
- onSortingChange?: (sorting: Array<{
165
- id: string;
166
- desc: boolean;
167
- }>) => void;
168
- /**
169
- * When `true`, the grid still records column-filter / global-filter /
170
- * facet state (so the menu UI works and indicators light up) but does
171
- * NOT actually filter the rows. The consumer is expected to fetch / sort
172
- * / filter the data themselves - typically via `onFiltersChange`. Used
173
- * by server-side data sources. Defaults to `false`.
174
- */
175
- externalFilter?: boolean;
176
- /**
177
- * Fires whenever any of the in-grid filter state changes - global
178
- * search, per-column operator filters, or facet (value-checklist)
179
- * filters. Pair with `externalFilter={true}` when the consumer wants to
180
- * push the query to the server.
181
- */
182
- onFiltersChange?: (filters: {
183
- global: string;
184
- columns: Array<{
185
- id: string;
186
- operator: "equals" | "startsWith" | "contains" | "greaterThan" | "lessThan" | "between" | "isBlank";
187
- value: string;
188
- /**
189
- * Upper bound for the `between` operator. Only set when
190
- * `operator === 'between'` AND the user has typed both values.
191
- */
192
- valueTo?: string;
193
- selectedValues?: Array<string>;
194
- }>;
195
- }) => void;
196
- /**
197
- * Fires when an inline edit is committed (Enter / Tab / blur). Useful
198
- * for cascade-recompute pipelines: a parent listens, then refreshes
199
- * derived columns or aggregates. The wrapper has already written the
200
- * parsed value back into the row by the time this fires.
201
- */
202
- /**
203
- * Resolve a stable id per row. Drives selection, expansion, edit,
204
- * and active-cell state. When omitted, the row's array index is
205
- * used - fine for read-only views but the wrong choice if `data`
206
- * gets reordered or filtered outside the grid (selection would
207
- * follow positions, not actual rows). Use a database PK, a UUID,
208
- * or any stable string.
209
- */
210
- getRowId?: (row: TData, index: number) => string;
211
- /**
212
- * Conditional class(es) added to every `<tr>` body row. Receives
213
- * the row's `original` data + its data-array index. Return a
214
- * string, an array of strings, or an object mapping class names to
215
- * booleans. Useful for "highlight overdue rows", "tint cancelled
216
- * orders", and similar row-level state mappings.
217
- */
218
- rowClass?: (ctx: {
219
- row: TData;
220
- rowIndex: number;
221
- }) => string | ReadonlyArray<string> | Record<string, boolean> | undefined | null;
222
- /**
223
- * Per-cell notes - longer free-form comments shown as a corner
224
- * indicator + tooltip on hover. Keyed by row id then column id;
225
- * empty / missing entries mean "no note". The grid owns rendering;
226
- * you own storage (write your own callbacks to add / edit notes).
227
- */
228
- notes?: Record<string, Record<string, string>>;
229
- /**
230
- * Excel-style conditional formatting. A list of value-driven rules that
231
- * color cells: `colorScale` (gradient across the column range),
232
- * `dataBar` (in-cell proportional bar), `iconSet` (arrows / traffic /
233
- * triangles by threshold), and `rule` (apply a style when a predicate
234
- * matches). Scope a format to specific columns with `columns: [...]`,
235
- * or omit it to apply to every column. Later entries win on conflict.
236
- */
237
- conditionalFormats?: ReadonlyArray<ConditionalFormat<TData>>;
238
- onCellValueChange?: (event: {
239
- rowIndex: number;
240
- columnId: string;
241
- oldValue: unknown;
242
- newValue: unknown;
243
- row: TData;
244
- }) => void;
245
- /**
246
- * Fires whenever the active cell changes - click, keyboard move,
247
- * tab, page-up/down, etc. Consumers (toolbars, ribbon UIs) use this
248
- * to stay synced with the grid's selection without polling the DOM.
249
- */
250
- onActiveCellChange?: (cell: {
251
- rowIndex: number;
252
- colIndex: number;
253
- columnId: string;
254
- }) => void;
255
- /**
256
- * Fires when a data cell (and therefore a row) is single-clicked.
257
- * Group-header rows are excluded. `value` is the displayed cell value.
258
- */
259
- onCellClick?: (event: {
260
- rowIndex: number;
261
- colIndex: number;
262
- columnId: string;
263
- value: unknown;
264
- row: TData;
265
- }) => void;
266
- /** Fires when a data row is single-clicked (any cell). Group rows excluded. */
267
- onRowClick?: (event: {
268
- rowIndex: number;
269
- columnId: string;
270
- row: TData;
271
- }) => void;
272
- /**
273
- * Fires when a data cell is double-clicked - independent of whether the
274
- * cell is editable, so it fires even on read-only grids. Group rows excluded.
275
- */
276
- onCellDoubleClick?: (event: {
277
- rowIndex: number;
278
- colIndex: number;
279
- columnId: string;
280
- value: unknown;
281
- row: TData;
282
- }) => void;
283
- /** Fires when a data row is double-clicked (any cell). Group rows excluded. */
284
- onRowDoubleClick?: (event: {
285
- rowIndex: number;
286
- columnId: string;
287
- row: TData;
288
- }) => void;
289
- /**
290
- * Fires once each time the body is scrolled to (within ~32px of) the
291
- * bottom. Re-arms after the user scrolls back up. The canonical hook for
292
- * infinite / lazy loading - append more rows to `data` when it fires.
293
- */
294
- onScrollBottomReached?: (event: {
295
- scrollTop: number;
296
- scrollHeight: number;
297
- clientHeight: number;
298
- }) => void;
299
- /**
300
- * Marks a row as an expandable "detail row". When this returns true the
301
- * grid renders that row as a SINGLE full-width cell (colspan across every
302
- * column) using `renderDetailRow`, instead of the normal per-column cells
303
- * - the canonical Stripe / GitHub "expand a rich panel beneath the row"
304
- * pattern. Insert the detail rows into `data` yourself (typically right
305
- * after the row they belong to) and toggle them with your own expanded
306
- * state. Pair with `virtualization={false}` so the variable-height detail
307
- * isn't clipped by the fixed-row-height virtualizer.
308
- */
309
- isDetailRow?: (row: TData, rowIndex: number) => boolean;
310
- /**
311
- * Snippet rendered inside the full-width detail cell for rows where
312
- * `isDetailRow` is true. Receives the row's data and its index.
313
- */
314
- renderDetailRow?: Snippet<[{
315
- row: TData;
316
- rowIndex: number;
317
- }]>;
318
- /**
319
- * Rows to pin to the TOP of the grid - rendered above the regular
320
- * rows and sticky-positioned so they stay visible while the user
321
- * scrolls. Typical use: a "totals" or "headline" row that should
322
- * always be in view. Rows are read-only (no inline editing, no
323
- * row-selection checkbox). They share the column schema with the
324
- * main grid; field/format/cell/cellClass all apply.
325
- */
326
- pinnedTopRows?: ReadonlyArray<TData>;
327
- /**
328
- * Rows to pin to the BOTTOM of the grid - rendered below the regular
329
- * rows and sticky-positioned (sticks to the bottom of the viewport
330
- * while the user scrolls). Typical use: a "page totals" or "grand
331
- * total" row computed from `getDisplayedRows()`.
332
- */
333
- pinnedBottomRows?: ReadonlyArray<TData>;
334
- /**
335
- * Enables drag-to-reorder on the grid's column headers. When `true`,
336
- * every header gets `draggable=true` and a drop indicator paints
337
- * between headers during a drag. On drop the grid mutates its
338
- * internal column order and fires `onColumnOrderChange` with the
339
- * new order. Defaults to `false`.
340
- */
341
- enableColumnReorder?: boolean;
342
- /**
343
- * Initial column order, by `id` (falls back to `field`). When the
344
- * user reorders columns, this is the starting state. After mount,
345
- * the grid owns the order internally and emits `onColumnOrderChange`
346
- * on every change - persist that to `localStorage` to restore.
347
- */
348
- columnOrder?: ReadonlyArray<string>;
349
- /** Fires every time the column order changes (drag or `api.setColumnOrder`). */
350
- onColumnOrderChange?: (order: ReadonlyArray<string>) => void;
351
- /**
352
- * BCP-47 locale tag (or array of fallbacks) used for accent- and
353
- * case-insensitive text filtering / sorting / search. Powered by
354
- * `Intl.Collator` with `sensitivity: 'base'`, so "cafe", "Café"
355
- * and "CAFÉ" all match "cafe" without strain. Defaults to the
356
- * browser's locale.
357
- */
358
- filterLocale?: string | ReadonlyArray<string>;
359
- };
6
+ props: Props<TFeatures, TData>;
360
7
  exports: {};
361
8
  bindings: "";
362
9
  slots: {};