@olvnck/ingrid 0.0.0-stage → 0.15.21

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 (220) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +5535 -2
  4. package/THIRD_PARTY_NOTICES.md +10 -0
  5. package/dist/engine/clipboard/copy.d.ts +40 -0
  6. package/dist/engine/clipboard/options.d.ts +16 -0
  7. package/dist/engine/clipboard/text.d.ts +32 -0
  8. package/dist/engine/columns/autosize.d.ts +43 -0
  9. package/dist/engine/columns/dataType.d.ts +30 -0
  10. package/dist/engine/columns/fold.d.ts +48 -0
  11. package/dist/engine/columns/layout.d.ts +150 -0
  12. package/dist/engine/columns/model.d.ts +369 -0
  13. package/dist/engine/columns/query.d.ts +16 -0
  14. package/dist/engine/columns/tooltips.d.ts +27 -0
  15. package/dist/engine/data/client/clientSource.d.ts +151 -0
  16. package/dist/engine/data/client/columnFilters.d.ts +106 -0
  17. package/dist/engine/data/client/descendants.d.ts +35 -0
  18. package/dist/engine/data/client/diff.d.ts +23 -0
  19. package/dist/engine/data/client/fields.d.ts +70 -0
  20. package/dist/engine/data/client/filter.d.ts +95 -0
  21. package/dist/engine/data/client/flatten.d.ts +141 -0
  22. package/dist/engine/data/client/groupSize.d.ts +14 -0
  23. package/dist/engine/data/client/hierarchy.d.ts +85 -0
  24. package/dist/engine/data/client/order.d.ts +32 -0
  25. package/dist/engine/data/client/pipeline.d.ts +277 -0
  26. package/dist/engine/data/client/remap.d.ts +33 -0
  27. package/dist/engine/data/client/trees.d.ts +41 -0
  28. package/dist/engine/data/client/types.d.ts +173 -0
  29. package/dist/engine/data/memory/generate.d.ts +36 -0
  30. package/dist/engine/data/memory/memoryDatasource.d.ts +46 -0
  31. package/dist/engine/data/rowKey.d.ts +15 -0
  32. package/dist/engine/data/server/contract.d.ts +64 -0
  33. package/dist/engine/data/server/expansion.d.ts +35 -0
  34. package/dist/engine/data/server/levelStore.d.ts +99 -0
  35. package/dist/engine/data/server/loader.d.ts +128 -0
  36. package/dist/engine/data/server/reader.d.ts +88 -0
  37. package/dist/engine/data/server/response.d.ts +31 -0
  38. package/dist/engine/data/server/serverSource.d.ts +130 -0
  39. package/dist/engine/data/shared/aggregate.d.ts +12 -0
  40. package/dist/engine/data/shared/columnFilter.d.ts +19 -0
  41. package/dist/engine/data/shared/compare.d.ts +12 -0
  42. package/dist/engine/data/shared/dateParts.d.ts +19 -0
  43. package/dist/engine/data/shared/distinct.d.ts +30 -0
  44. package/dist/engine/data/shared/filterRecord.d.ts +7 -0
  45. package/dist/engine/data/shared/keys.d.ts +17 -0
  46. package/dist/engine/data/shared/quickFilter.d.ts +17 -0
  47. package/dist/engine/data/shared/sourceUtils.d.ts +11 -0
  48. package/dist/engine/data/shared/splice.d.ts +9 -0
  49. package/dist/engine/detail/builds.d.ts +26 -0
  50. package/dist/engine/detail/content.d.ts +24 -0
  51. package/dist/engine/detail/controller.d.ts +176 -0
  52. package/dist/engine/detail/events.d.ts +11 -0
  53. package/dist/engine/detail/follow.d.ts +56 -0
  54. package/dist/engine/detail/layer.d.ts +119 -0
  55. package/dist/engine/detail/live.d.ts +96 -0
  56. package/dist/engine/detail/options.d.ts +53 -0
  57. package/dist/engine/detail/state.d.ts +140 -0
  58. package/dist/engine/edit/clear.d.ts +20 -0
  59. package/dist/engine/edit/editing.d.ts +4 -0
  60. package/dist/engine/edit/editors/date.d.ts +3 -0
  61. package/dist/engine/edit/editors/index.d.ts +23 -0
  62. package/dist/engine/edit/editors/internals.d.ts +25 -0
  63. package/dist/engine/edit/editors/largeText.d.ts +2 -0
  64. package/dist/engine/edit/editors/number.d.ts +4 -0
  65. package/dist/engine/edit/editors/select.d.ts +2 -0
  66. package/dist/engine/edit/editors/text.d.ts +15 -0
  67. package/dist/engine/edit/fill.d.ts +47 -0
  68. package/dist/engine/edit/fillHandle.d.ts +66 -0
  69. package/dist/engine/edit/fillValues.d.ts +15 -0
  70. package/dist/engine/edit/operations.d.ts +68 -0
  71. package/dist/engine/edit/paste.d.ts +23 -0
  72. package/dist/engine/edit/pastePlan.d.ts +17 -0
  73. package/dist/engine/edit/popupHost.d.ts +63 -0
  74. package/dist/engine/edit/session.d.ts +52 -0
  75. package/dist/engine/edit/types.d.ts +234 -0
  76. package/dist/engine/edit/undo.d.ts +38 -0
  77. package/dist/engine/edit/validation.d.ts +10 -0
  78. package/dist/engine/edit/values.d.ts +38 -0
  79. package/dist/engine/export/columns.d.ts +19 -0
  80. package/dist/engine/export/deliver.d.ts +47 -0
  81. package/dist/engine/export/dsv.d.ts +2 -0
  82. package/dist/engine/export/expanded.d.ts +69 -0
  83. package/dist/engine/export/export.d.ts +25 -0
  84. package/dist/engine/export/headers.d.ts +15 -0
  85. package/dist/engine/export/options.d.ts +19 -0
  86. package/dist/engine/export/plan.d.ts +43 -0
  87. package/dist/engine/export/values.d.ts +33 -0
  88. package/dist/engine/export/walk.d.ts +31 -0
  89. package/dist/engine/export/writer.d.ts +62 -0
  90. package/dist/engine/export/xlsx/cells.d.ts +31 -0
  91. package/dist/engine/export/xlsx/index.d.ts +12 -0
  92. package/dist/engine/export/xlsx/parts.d.ts +36 -0
  93. package/dist/engine/export/xlsx/sheet.d.ts +30 -0
  94. package/dist/engine/export/xlsx/styles.d.ts +15 -0
  95. package/dist/engine/export/xlsx/table.d.ts +8 -0
  96. package/dist/engine/export/xlsx/zip.d.ts +24 -0
  97. package/dist/engine/filter/groupFilter.d.ts +28 -0
  98. package/dist/engine/filter/model.d.ts +235 -0
  99. package/dist/engine/filter/shorthand.d.ts +36 -0
  100. package/dist/engine/filter/state.d.ts +76 -0
  101. package/dist/engine/filter/summary.d.ts +16 -0
  102. package/dist/engine/filter/values.d.ts +40 -0
  103. package/dist/engine/find/index.d.ts +94 -0
  104. package/dist/engine/find/match.d.ts +38 -0
  105. package/dist/engine/find/model.d.ts +115 -0
  106. package/dist/engine/grid.d.ts +42 -0
  107. package/dist/engine/i18n/numbers.d.ts +34 -0
  108. package/dist/engine/i18n/texts.d.ts +306 -0
  109. package/dist/engine/interact/autoScroll.d.ts +11 -0
  110. package/dist/engine/interact/body.d.ts +41 -0
  111. package/dist/engine/interact/focus.d.ts +158 -0
  112. package/dist/engine/interact/header.d.ts +216 -0
  113. package/dist/engine/interact/host.d.ts +400 -0
  114. package/dist/engine/interact/keyboard.d.ts +20 -0
  115. package/dist/engine/interact/menuKey.d.ts +7 -0
  116. package/dist/engine/interact/own.d.ts +2 -0
  117. package/dist/engine/interact/ranges.d.ts +68 -0
  118. package/dist/engine/interact/rowSelection.d.ts +53 -0
  119. package/dist/engine/interact/shortcut.d.ts +21 -0
  120. package/dist/engine/interact/tooltips.d.ts +63 -0
  121. package/dist/engine/measure.d.ts +30 -0
  122. package/dist/engine/render/cells.d.ts +322 -0
  123. package/dist/engine/render/columns.d.ts +28 -0
  124. package/dist/engine/render/dom.d.ts +24 -0
  125. package/dist/engine/render/flash.d.ts +74 -0
  126. package/dist/engine/render/groupCell.d.ts +50 -0
  127. package/dist/engine/render/groupPanel.d.ts +21 -0
  128. package/dist/engine/render/header.d.ts +162 -0
  129. package/dist/engine/render/overlay.d.ts +15 -0
  130. package/dist/engine/render/pinnedRows.d.ts +106 -0
  131. package/dist/engine/render/rowPool.d.ts +3 -0
  132. package/dist/engine/render/scrollbars.d.ts +77 -0
  133. package/dist/engine/render/strategy.d.ts +397 -0
  134. package/dist/engine/reportError.d.ts +7 -0
  135. package/dist/engine/rowdrag/controller.d.ts +80 -0
  136. package/dist/engine/rowdrag/events.d.ts +17 -0
  137. package/dist/engine/rowdrag/gesture.d.ts +33 -0
  138. package/dist/engine/rowdrag/keys.d.ts +21 -0
  139. package/dist/engine/rowdrag/model.d.ts +67 -0
  140. package/dist/engine/rowdrag/options.d.ts +34 -0
  141. package/dist/engine/rowdrag/rows.d.ts +61 -0
  142. package/dist/engine/rowdrag/target.d.ts +59 -0
  143. package/dist/engine/rowdrag/zones.d.ts +79 -0
  144. package/dist/engine/schedule.d.ts +29 -0
  145. package/dist/engine/selection/aggregate.d.ts +30 -0
  146. package/dist/engine/selection/options.d.ts +7 -0
  147. package/dist/engine/selection/rangeRows.d.ts +19 -0
  148. package/dist/engine/selection/ranges.d.ts +114 -0
  149. package/dist/engine/selection/rows.d.ts +207 -0
  150. package/dist/engine/source.d.ts +225 -0
  151. package/dist/engine/synthetic.d.ts +28 -0
  152. package/dist/engine/table/cells.d.ts +52 -0
  153. package/dist/engine/table/headers.d.ts +20 -0
  154. package/dist/engine/table/host.d.ts +65 -0
  155. package/dist/engine/table/job.d.ts +21 -0
  156. package/dist/engine/table/rows.d.ts +99 -0
  157. package/dist/engine/table/slicer.d.ts +54 -0
  158. package/dist/engine/table/takes.d.ts +145 -0
  159. package/dist/engine/types.d.ts +2950 -0
  160. package/dist/engine/ui/announce.d.ts +7 -0
  161. package/dist/engine/ui/chooser.d.ts +19 -0
  162. package/dist/engine/ui/columnList.d.ts +41 -0
  163. package/dist/engine/ui/columnMenu.d.ts +96 -0
  164. package/dist/engine/ui/columnsPanel.d.ts +16 -0
  165. package/dist/engine/ui/contextMenu.d.ts +48 -0
  166. package/dist/engine/ui/controller.d.ts +295 -0
  167. package/dist/engine/ui/filters/apply.d.ts +53 -0
  168. package/dist/engine/ui/filters/custom.d.ts +3 -0
  169. package/dist/engine/ui/filters/date.d.ts +12 -0
  170. package/dist/engine/ui/filters/host.d.ts +102 -0
  171. package/dist/engine/ui/filters/multi.d.ts +6 -0
  172. package/dist/engine/ui/filters/number.d.ts +15 -0
  173. package/dist/engine/ui/filters/numberMask.d.ts +15 -0
  174. package/dist/engine/ui/filters/set.d.ts +3 -0
  175. package/dist/engine/ui/filters/simple.d.ts +52 -0
  176. package/dist/engine/ui/filters/text.d.ts +5 -0
  177. package/dist/engine/ui/filtersPanel.d.ts +18 -0
  178. package/dist/engine/ui/floating.d.ts +66 -0
  179. package/dist/engine/ui/floatingShorthand.d.ts +20 -0
  180. package/dist/engine/ui/floatingTypes.d.ts +82 -0
  181. package/dist/engine/ui/icons.d.ts +25 -0
  182. package/dist/engine/ui/menu.d.ts +45 -0
  183. package/dist/engine/ui/overlayHost.d.ts +7 -0
  184. package/dist/engine/ui/place.d.ts +37 -0
  185. package/dist/engine/ui/popup.d.ts +97 -0
  186. package/dist/engine/ui/sideBar.d.ts +26 -0
  187. package/dist/engine/ui/statusBar.d.ts +29 -0
  188. package/dist/engine/ui/toolbar/buttons.d.ts +21 -0
  189. package/dist/engine/ui/toolbar/chipState.d.ts +52 -0
  190. package/dist/engine/ui/toolbar/chips.d.ts +23 -0
  191. package/dist/engine/ui/toolbar/findBox.d.ts +10 -0
  192. package/dist/engine/ui/toolbar/quickFilterBox.d.ts +12 -0
  193. package/dist/engine/ui/toolbar/registry.d.ts +5 -0
  194. package/dist/engine/ui/toolbar/toolbar.d.ts +31 -0
  195. package/dist/engine/ui/toolbar/types.d.ts +23 -0
  196. package/dist/engine/ui/tooltip.d.ts +34 -0
  197. package/dist/engine/ui/virtualList.d.ts +35 -0
  198. package/dist/engine/viewport/heightView.d.ts +62 -0
  199. package/dist/engine/viewport/heights.d.ts +39 -0
  200. package/dist/engine/viewport/intervals.d.ts +19 -0
  201. package/dist/engine/viewport/range.d.ts +51 -0
  202. package/dist/engine/viewport/scroll.d.ts +45 -0
  203. package/dist/engine/viewport/stack.d.ts +160 -0
  204. package/dist/grid-C34VEap6.js +32310 -0
  205. package/dist/index.d.ts +19 -0
  206. package/dist/index.js +1273 -0
  207. package/dist/ingrid.css +1 -0
  208. package/dist/internal.d.ts +13 -0
  209. package/dist/internal.js +1 -0
  210. package/dist/locale/de.d.ts +4 -0
  211. package/dist/locale/de.js +222 -0
  212. package/dist/themes/primevue.css +63 -0
  213. package/dist/themes/tailwind.css +68 -0
  214. package/dist/vue/InGrid.vue.d.ts +263 -0
  215. package/dist/vue/stableOptions.d.ts +8 -0
  216. package/dist/vue/useClientSource.d.ts +28 -0
  217. package/dist/vue/useServerSource.d.ts +8 -0
  218. package/dist/vue/vueRenderer.d.ts +164 -0
  219. package/dist/xlsx-59umS_n_.js +325 -0
  220. package/package.json +78 -5
@@ -0,0 +1,29 @@
1
+ import type { ViewportSource } from '../source';
2
+ import type { GridOptions, RangeChange, StatusPanelContext } from '../types';
3
+ import type { UiHost } from './controller';
4
+ export interface StatusBar {
5
+ /** `Grid.setStatusBar`: the old panels go (their `destroy` runs), the new ones are built and filled at once. */
6
+ set(options: GridOptions['statusBar']): void;
7
+ /** Rows, counts or filters changed: the panels follow in the next frame, once however many changes came. */
8
+ changed(): void;
9
+ /**
10
+ * The row selection or (`range`) the cell ranges changed: the selection panels follow in the next frame; a step that
11
+ * is not `finished` (a drag in progress) leaves the aggregation as it is, a finished one recomputes it.
12
+ */
13
+ selectionChanged(range?: Pick<RangeChange, 'finished' | 'source'>): void;
14
+ /** Rows were loaded, changed, moved or reset: a shown aggregation is computed again (its values may differ). */
15
+ rowsChanged(): void;
16
+ /** Columns were hidden, shown, moved or redefined: the panels follow (an 'all' range's union may differ). */
17
+ columnsChanged(): void;
18
+ /** The texts or the number format changed: the panels follow at once. */
19
+ localeChanged(): void;
20
+ destroy(): void;
21
+ }
22
+ export type StatusCounts = StatusPanelContext['counts'];
23
+ /**
24
+ * The source's row counts, isolated: a throwing `status` is reported once and counts as unknown, as
25
+ * does a source without one.
26
+ */
27
+ export declare function sourceCounts(source: ViewportSource): StatusCounts;
28
+ /** Called inside the controller's effect scope; the bar's element goes in right after `host.main`. */
29
+ export declare function createStatusBar(host: UiHost): StatusBar;
@@ -0,0 +1,21 @@
1
+ import type { MenuEntry } from '../../types';
2
+ import type { PopupHandle } from '../popup';
3
+ import type { ToolbarBuiltInFactory, ToolbarHost } from './types';
4
+ /** The bar's host as the menu button needs it. */
5
+ export interface ButtonsHost extends ToolbarHost {
6
+ /**
7
+ * Opens InGrid's menu of `entries` below `button` (popup kind 'toolbarMenu'), built-in names resolved without a
8
+ * column; `label` is its accessible name. A keyboard close returns focus to the button; `onClose` runs when it
9
+ * closes. Null when nothing is left to draw.
10
+ */
11
+ openMenu(entries: readonly MenuEntry[], button: HTMLButtonElement, label: string, onClose: () => void): PopupHandle | null;
12
+ }
13
+ /**
14
+ * Why the bar leaves a button kind's def out, for its hint; null when it is fine. A plain button needs a label, an icon
15
+ * or a tooltip; a menu button needs its items, an array or a function.
16
+ */
17
+ export declare function buttonProblem(kind: 'button' | 'menu', def: object): string | null;
18
+ /** A plain button (`{ type: 'button' }`): its click runs `action` with `{ grid, key, texts }`. */
19
+ export declare const createToolbarButton: ToolbarBuiltInFactory;
20
+ /** A menu button (`{ type: 'menu' }`): its click opens InGrid's menu of `items` below it, or closes the open one. */
21
+ export declare const createToolbarMenuButton: ToolbarBuiltInFactory;
@@ -0,0 +1,52 @@
1
+ import type { GridTexts } from '../../i18n/texts';
2
+ import type { ColumnInfo, ToolbarChipKind } from '../../types';
3
+ /** The chips shown when `ToolbarChipsOptions.kinds` is absent. */
4
+ export declare const DEFAULT_CHIP_KINDS: readonly ["filters", "sorts", "groups", "hidden"];
5
+ /** What the chip counts read. */
6
+ export interface ChipInput {
7
+ columns: readonly ColumnInfo[];
8
+ /** Ids in the filter model (the group column's own filter is `'ig:group'`; never the quick filter). */
9
+ filterIds: readonly string[];
10
+ sortCount: number;
11
+ rowGroups: readonly string[];
12
+ /** The data columns' ids in definition order. */
13
+ definedOrder: readonly string[];
14
+ kinds: readonly ToolbarChipKind[];
15
+ }
16
+ /**
17
+ * The group column's own filter is the group-size kind (its `ColumnInfo.filter`): only then is the model under
18
+ * `'ig:group'` the group-size chip's. Any other kind there — a tree's column filter, a custom one — is a
19
+ * filter like the columns'.
20
+ */
21
+ export declare const hasGroupSizeFilter: (columns: readonly ColumnInfo[]) => boolean;
22
+ /**
23
+ * The filter ids the filters chip counts and clears: every column filter of the model, the group-size filter's
24
+ * (`'ig:group'` while `sizeFilter`, `hasGroupSizeFilter`) only while `groupSize` is not among the kinds (it has its own
25
+ * chip then).
26
+ */
27
+ export declare function filterChipIds(filterIds: readonly string[], kinds: readonly ToolbarChipKind[], sizeFilter: boolean): string[];
28
+ /**
29
+ * The data columns the hidden chip counts and shows again: hidden, not grouped, listed in the Columns panel and hideable
30
+ * there (not `hideable: false`, whose box the panel disables) — never a date part column (hidden helper
31
+ * columns of a `groupHierarchy`, which stay hidden, as `ungroupByGesture` keeps them).
32
+ */
33
+ export declare const hiddenChipIds: (columns: readonly ColumnInfo[]) => string[];
34
+ /** The data columns the pinned chip counts and unpins: pinned and pinnable (the column menu unpins only those). */
35
+ export declare const pinnedChipIds: (columns: readonly ColumnInfo[]) => string[];
36
+ /**
37
+ * The full column order with the data columns and the group column back in definition order (the moved chip's click):
38
+ * each place one of them holds takes the next of them in `defined`, so the other grid-owned columns (row
39
+ * numbers, selection, drag, detail) keep their places. `order` unchanged when those columns are not the same in both.
40
+ */
41
+ export declare function restoredOrder(order: readonly {
42
+ id: string;
43
+ kind: string;
44
+ }[], defined: readonly {
45
+ id: string;
46
+ kind: string;
47
+ }[]): string[];
48
+ /** Each kind's count; `moved` is 0 or 1. */
49
+ export declare function chipCounts(input: ChipInput): Record<ToolbarChipKind, number>;
50
+ /** A chip's label; `formatCount` output is used verbatim, `groupSizeSummary` is the group-size filter's summary. */
51
+ export declare function chipLabel(kind: ToolbarChipKind, count: number, texts: GridTexts, formatCount: (n: number) => string, groupSizeSummary?: string): string;
52
+ export declare function chipTooltip(kind: ToolbarChipKind, texts: GridTexts): string;
@@ -0,0 +1,23 @@
1
+ import type { ToolbarChipKind, ToolbarChipsOptions } from '../../types';
2
+ import type { ToolbarBuiltIn, ToolbarHost } from './types';
3
+ /**
4
+ * What the chips need besides the bar's host (contract 4): the bar's host has it (toolbar.ts
5
+ * `ItemHost`, controller.ts). `clear` takes the item's kinds (the filters chip clears the group-size filter only while
6
+ * `groupSize` is not one of them, as it counts it), `focusAfter` hands focus on when the last chip hid with it.
7
+ */
8
+ export interface ChipsHost extends ToolbarHost {
9
+ /** The data columns' ids in definition order: the "moved" chip's reference. */
10
+ definedOrder(): readonly string[];
11
+ /**
12
+ * Undoes `kind` through the grid's gesture path: one commit (one filter change for the filters) per click; `kinds`
13
+ * are the item's (`filterChipIds`).
14
+ */
15
+ clear(kind: ToolbarChipKind, kinds: readonly ToolbarChipKind[]): void;
16
+ /**
17
+ * Focus leaves `item` (its last shown chip hid with keyboard focus): to the bar's next focusable control after it,
18
+ * else to the grid — its focused cell or header cell, else its viewport; never the page's body.
19
+ */
20
+ focusAfter(item: HTMLElement): void;
21
+ }
22
+ /** The `chips` item (`BUILT_INS.chips`). */
23
+ export declare function createChips(host: ChipsHost, options: ToolbarChipsOptions | undefined, key: string): ToolbarBuiltIn;
@@ -0,0 +1,10 @@
1
+ import type { FindReport } from '../../find/model';
2
+ import type { ToolbarBuiltInFactory, ToolbarHost } from './types';
3
+ /** The bar's host as the find box needs it. */
4
+ export interface FindHost extends ToolbarHost {
5
+ /** Find's term; `''` while find is off (the Grid has no getter for it). */
6
+ findTerm(): string;
7
+ /** What find's last change event said: its term, count and active match — a read that builds nothing. */
8
+ findReported(): FindReport;
9
+ }
10
+ export declare const createFindBox: ToolbarBuiltInFactory;
@@ -0,0 +1,12 @@
1
+ import type { ToolbarBuiltInFactory, ToolbarHost } from './types';
2
+ /** The bar's host as the box needs it. */
3
+ export interface QuickFilterHost extends ToolbarHost {
4
+ /** Writes the grid's quick filter; its change event names the source `'toolbar'`. */
5
+ setQuickFilter(text: string): void;
6
+ /**
7
+ * Calls `listener` at once on every app write of the quick filter (`setQuickFilter`, the prop), the same text
8
+ * included; returns its removal.
9
+ */
10
+ onQuickFilterWrite(listener: () => void): () => void;
11
+ }
12
+ export declare const createQuickFilterBox: ToolbarBuiltInFactory;
@@ -0,0 +1,5 @@
1
+ import type { ToolbarItemId } from '../../types';
2
+ import type { ToolbarBuiltInFactory } from './types';
3
+ export declare const BUILT_INS: Partial<Record<Exclude<ToolbarItemId, 'separator'>, ToolbarBuiltInFactory>>;
4
+ /** The button kinds (`{ type: 'button' }`, `{ type: 'menu' }`); `options` is the bar's copy of the item's def. */
5
+ export declare const BUTTONS: Partial<Record<'button' | 'menu', ToolbarBuiltInFactory>>;
@@ -0,0 +1,31 @@
1
+ import type { GridOptions } from '../../types';
2
+ import { type ButtonsHost } from './buttons';
3
+ import type { ChipsHost } from './chips';
4
+ import type { FindHost } from './findBox';
5
+ import type { QuickFilterHost } from './quickFilterBox';
6
+ export interface Toolbar {
7
+ /** `Grid.setToolbar`: items of the same key and kind stay (their def swapped in place), the others go or come. */
8
+ set(options: GridOptions['toolbar']): void;
9
+ /** Column state, filters, the quick filter, find, rows or the source changed: the items follow in the next frame. */
10
+ changed(): void;
11
+ /** The texts or the number format changed: the bar's label and the items follow at once. */
12
+ localeChanged(): void;
13
+ /** The bar's element while it shows, else null (a header drag measures its top edge below it). */
14
+ shown(): HTMLElement | null;
15
+ destroy(): void;
16
+ }
17
+ /**
18
+ * What the controller gives the bar: the built-ins' host (the widest of theirs), the root and the grid's focus;
19
+ * `changed` and `focusAfter` are the bar's own (contract 2: "this item's visibility may have changed" — a re-check of
20
+ * what shows, never an update, so a built-in calling it cannot loop the bar; the bar knows its controls' order).
21
+ */
22
+ export type BarHost = Omit<ItemHost, 'changed' | 'focusAfter'> & {
23
+ root: HTMLElement;
24
+ /** Focuses the grid: its focused cell or header cell, else its viewport. */
25
+ focusGrid(): void;
26
+ };
27
+ /** The host every built-in gets: the widest of theirs (each narrows to its own). */
28
+ type ItemHost = QuickFilterHost & FindHost & ButtonsHost & ChipsHost;
29
+ /** Called inside the controller's effect scope; the bar's element becomes the root's first child. */
30
+ export declare function createToolbar(host: BarHost): Toolbar;
31
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { GridTexts } from '../../i18n/texts';
2
+ import type { Grid, HeaderIcons } from '../../types';
3
+ /** One built-in bar item: its element, its refresh, whether it shows anything. */
4
+ export interface ToolbarBuiltIn {
5
+ el: HTMLElement;
6
+ update(): void;
7
+ shown(): boolean;
8
+ destroy(): void;
9
+ }
10
+ /** What the bar hands its built-ins. */
11
+ export interface ToolbarHost {
12
+ api: Grid;
13
+ texts(): GridTexts;
14
+ icons(): HeaderIcons;
15
+ /** A count in the grid's number format (`locale.numbers`). */
16
+ formatCount(n: number): string;
17
+ /** True on in-memory rows (the find box shows only there). */
18
+ isClient(): boolean;
19
+ warn(message: string): void;
20
+ /** The item's visibility may have changed: the bar re-evaluates. */
21
+ changed(): void;
22
+ }
23
+ export type ToolbarBuiltInFactory = (host: ToolbarHost, options: unknown, key: string) => ToolbarBuiltIn;
@@ -0,0 +1,34 @@
1
+ import type { ResolvedTooltips } from '../columns/tooltips';
2
+ export interface TooltipTarget {
3
+ /** The same key again is the same target: nothing restarts. */
4
+ readonly key: unknown;
5
+ /** A pending target whose element left the document does not show. */
6
+ readonly el: HTMLElement;
7
+ /**
8
+ * Under `show: 'truncated'` it shows only while this element's content overflows it, in width or height, when it
9
+ * shows; null: always (renderer cells, menu items).
10
+ */
11
+ readonly measure: HTMLElement | null;
12
+ /** Read when it shows; empty shows nothing. */
13
+ text(): string | null | undefined;
14
+ }
15
+ export interface TooltipLayer {
16
+ /** A mouse or pen pointer is over `target` at (`x`, `y`) in client coordinates (null: over nothing that has one). */
17
+ over(target: TooltipTarget | null, x: number, y: number): void;
18
+ /** A touch hold: shows `target`'s tooltip at once; false without text. */
19
+ showNow(target: TooltipTarget, x: number, y: number): boolean;
20
+ /** Fades a shown tooltip out and drops a pending one; it comes back only after the pointer leaves and returns. */
21
+ hide(): void;
22
+ /** The target pending or shown; null: none. */
23
+ target(): TooltipTarget | null;
24
+ /** Writes the grid's one hidden description (for `aria-describedby`) and returns its id. */
25
+ describe(text: string): string;
26
+ destroy(): void;
27
+ }
28
+ /**
29
+ * The grid's tooltip layer. `over` makes a target pending for `showDelay` (`switchDelay` within 1 s of a shown one
30
+ * hiding); it shows below the pointer and hides after `hideDelay`, on leave, on a press or a key anywhere and on window
31
+ * blur (listeners only while a target is pending or shown), or by `hide()`. Every hide but a leave keeps the target
32
+ * away until the pointer leaves it. `options` is read at each use.
33
+ */
34
+ export declare function createTooltipLayer(root: HTMLElement, options: () => ResolvedTooltips): TooltipLayer;
@@ -0,0 +1,35 @@
1
+ export interface VirtualListOptions {
2
+ count: number;
3
+ /** A row element, built once and recycled. */
4
+ create(): HTMLElement;
5
+ /** Fills a recycled row for `index`. */
6
+ bind(el: HTMLElement, index: number): void;
7
+ role: 'listbox' | 'tree';
8
+ itemRole: 'option' | 'treeitem';
9
+ label: string;
10
+ /** Keys the list leaves to its owner; true = handled. */
11
+ onKey?(event: KeyboardEvent, index: number): boolean;
12
+ /** Space, or a click on a row. */
13
+ onActivate?(index: number, event: Event): void;
14
+ /** Rows drawn beyond the visible ones on each side; default 4. */
15
+ overscan?: number;
16
+ }
17
+ export interface VirtualList {
18
+ readonly el: HTMLElement;
19
+ setCount(n: number): void;
20
+ /** Re-binds the drawn rows. */
21
+ refresh(): void;
22
+ active(): number;
23
+ /** Moves aria-activedescendant and scrolls the row into view (`reveal: false` keeps the scroll position). */
24
+ setActive(index: number, reveal?: boolean): void;
25
+ focus(): void;
26
+ destroy(): void;
27
+ }
28
+ /**
29
+ * A fixed-row-height virtual list: the visible rows plus the overscan are drawn, row elements are recycled
30
+ * (slot = index modulo the pool size, so a scroll re-binds only rows whose index changed) and positioned by CSSOM
31
+ * (height and transform; the rest is the `.ig-vlist-row` rule).
32
+ * Keyboard focus stays on the scroller; the active row is named by aria-activedescendant. The row height is the CSS
33
+ * length --ig-list-item-height (default: the row height), read as px through a probe like measure.ts does.
34
+ */
35
+ export declare function createVirtualList(options: VirtualListOptions): VirtualList;
@@ -0,0 +1,62 @@
1
+ import type { HeightIndex } from './heights';
2
+ /**
3
+ * The detail terms of master rows: display row → the height of its open detail, default 0.
4
+ * Sparse like `HeightIndex` — sorted row / height pairs grown by doubling, a lazily rebuilt prefix — but its own class:
5
+ * `HeightIndex` needs a positive default and divides by it in `rowAt`. Its only writers are the source's splices,
6
+ * resets and count changes and the detail layer's placements; the cell heights never touch it.
7
+ */
8
+ export declare class DetailIndex {
9
+ private count;
10
+ private idx;
11
+ private hts;
12
+ private m;
13
+ /** prefix[k]: the terms of the first k entries. */
14
+ private prefix;
15
+ private dirty;
16
+ constructor(rowCount?: number);
17
+ get rowCount(): number;
18
+ /** Stored terms. */
19
+ get size(): number;
20
+ /** Row i's term; 0 when it has none. */
21
+ get(i: number): number;
22
+ /** Sets row i's term; `h <= 0` (or not a number) removes it; rows outside [0, rowCount) are ignored. */
23
+ set(i: number, h: number): void;
24
+ /** Rows [at, at + removed) become `inserted` rows without a term (as `HeightIndex.splice`). */
25
+ splice(at: number, removed: number, inserted: number): void;
26
+ /** A count change: terms of rows past the new end go. */
27
+ setRowCount(n: number): void;
28
+ /** The rows holding a term, ascending (a copy: the caller may write terms while it walks them). */
29
+ rows(): Int32Array;
30
+ /** Drops every term. */
31
+ clear(): void;
32
+ /** The terms of the rows before row i. */
33
+ before(i: number): number;
34
+ total(): number;
35
+ /** First entry p with idx[p] >= i (m if none). */
36
+ private lowerBound;
37
+ private ensurePrefix;
38
+ private ensureCapacity;
39
+ }
40
+ /**
41
+ * One view over the cell heights and the detail terms: what positions rows — the strategies,
42
+ * the model height, the anchor, the drag geometry. A master's row is its cells plus its open detail.
43
+ */
44
+ export interface HeightView {
45
+ readonly rowCount: number;
46
+ readonly defaultHeight: number;
47
+ /** The cells' top plus the terms of the rows above. */
48
+ top(i: number): number;
49
+ /** The cell height plus the detail term. */
50
+ height(i: number): number;
51
+ /** The cell part: what the row element draws and what aligning reads. */
52
+ cellHeight(i: number): number;
53
+ detailHeight(i: number): number;
54
+ /** The row whose [top, top + height) holds y (clamped to the rows); −1: no rows. */
55
+ rowAt(y: number): number;
56
+ total(): number;
57
+ }
58
+ /**
59
+ * The height view over `cells` and the grid's detail index, read at every call (`details` null until a detail first
60
+ * opens). Without a detail index or a term every call is the cell index's after one check.
61
+ */
62
+ export declare function createHeightView(cells: HeightIndex, details: () => DetailIndex | null): HeightView;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Row heights for virtualisation: a default height plus sparse overrides.
3
+ * Memory grows only with the number of rows whose height differs from the default.
4
+ */
5
+ export declare class HeightIndex {
6
+ private h0;
7
+ private count;
8
+ private idx;
9
+ private hts;
10
+ private m;
11
+ private prefix;
12
+ private dirty;
13
+ constructor(defaultHeight: number, rowCount?: number);
14
+ get rowCount(): number;
15
+ get defaultHeight(): number;
16
+ /** Number of stored overrides (memory diagnostics, tests). */
17
+ get overrideCount(): number;
18
+ setDefaultHeight(h: number): void;
19
+ setRowCount(n: number): void;
20
+ height(i: number): number;
21
+ set(i: number, h: number): void;
22
+ /** Drops all overrides. */
23
+ clear(): void;
24
+ /** Inserts `n` default-height rows before row `at` (clamped to [0, rowCount]). */
25
+ insertRange(at: number, n: number): void;
26
+ /** Removes rows [at, at + n) (clamped to existing rows). */
27
+ removeRange(at: number, n: number): void;
28
+ /** Rows [at, at + removed) become `inserted` default-height rows. */
29
+ splice(at: number, removed: number, inserted: number): void;
30
+ /** Top edge of row i; `top(rowCount)` is the total height. */
31
+ top(i: number): number;
32
+ total(): number;
33
+ /** Row containing pixel y (clamped); -1 when there are no rows. */
34
+ rowAt(y: number): number;
35
+ /** First override position p with idx[p] >= i (m if none). */
36
+ private lowerBound;
37
+ private ensurePrefix;
38
+ private ensureCapacity;
39
+ }
@@ -0,0 +1,19 @@
1
+ /** Set of integers stored as sorted, non-overlapping half-open ranges [start, end). */
2
+ export declare class IntervalSet {
3
+ private starts;
4
+ private ends;
5
+ /** Number of disjoint ranges (diagnostics and tests). */
6
+ get rangeCount(): number;
7
+ has(i: number): boolean;
8
+ /** Adds [a, b); touching or overlapping ranges are merged. */
9
+ add(a: number, b: number): void;
10
+ /** Removes [a, b). */
11
+ remove(a: number, b: number): void;
12
+ /** Drops every member >= n. */
13
+ truncate(n: number): void;
14
+ /** Members in [at, at + removed) go, later ones move by inserted − removed; [at, at + inserted) stays empty. */
15
+ splice(at: number, removed: number, inserted: number): void;
16
+ clear(): void;
17
+ /** Index of the last range whose start <= i, or -1. */
18
+ private indexBefore;
19
+ }
@@ -0,0 +1,51 @@
1
+ import type { HeightView } from './heightView';
2
+ export interface RowRange {
3
+ /** Inclusive; the range is empty when `last < first`. */
4
+ first: number;
5
+ last: number;
6
+ }
7
+ export declare const EMPTY_RANGE: Readonly<RowRange>;
8
+ /**
9
+ * Visible rows for a model position, plus the overscanned range that gets rendered. `heights`: the grid's height view
10
+ * (rows with their details) or a plain `HeightIndex`.
11
+ */
12
+ export declare function rowRanges(heights: Pick<HeightView, 'rowCount' | 'rowAt'>, modelTop: number, viewportHeight: number, overscan: number): {
13
+ visible: RowRange;
14
+ render: RowRange;
15
+ };
16
+ export type Lane = 'left' | 'center' | 'right';
17
+ export interface ColumnSlot {
18
+ /** Internal column index (position in the column definitions). */
19
+ index: number;
20
+ lane: Lane;
21
+ /** x position relative to the column's lane. */
22
+ x: number;
23
+ width: number;
24
+ /** Visual order across lanes (left, centre, right); used for aria-colindex. */
25
+ displayIndex: number;
26
+ }
27
+ export interface ColumnsLayout {
28
+ slots: ColumnSlot[];
29
+ left: number[];
30
+ center: number[];
31
+ right: number[];
32
+ leftWidth: number;
33
+ centerWidth: number;
34
+ rightWidth: number;
35
+ }
36
+ export declare function layoutColumns(cols: readonly {
37
+ width: number;
38
+ pinned?: 'left' | 'right';
39
+ }[]): ColumnsLayout;
40
+ /** Internal indices of centre columns intersecting the visible horizontal window (plus overscan). */
41
+ export declare function centerWindow(layout: ColumnsLayout, scrollLeft: number, viewportWidth: number, overscanPx: number): number[];
42
+ /**
43
+ * The centre lane's visible horizontal window plus overscan, in lane coordinates; null when the pinned lanes cover the
44
+ * whole viewport.
45
+ */
46
+ export declare function centerBand(layout: ColumnsLayout, scrollLeft: number, viewportWidth: number, overscanPx: number): {
47
+ lo: number;
48
+ hi: number;
49
+ } | null;
50
+ /** Internal indices of a lane's columns (`ids`, in display order) whose slots intersect `[lo, hi)`. */
51
+ export declare function laneWindow(ids: readonly number[], slots: readonly ColumnSlot[], lo: number, hi: number): number[];
@@ -0,0 +1,45 @@
1
+ import type { ScrollAlign } from '../types';
2
+ export type { ScrollAlign };
3
+ /** Inputs of the scroll ↔ model mapping. */
4
+ export interface ScrollGeometry {
5
+ /** Total height of all rows in model pixels. */
6
+ modelHeight: number;
7
+ /** Height of the visible rows area (viewport minus header). */
8
+ viewportHeight: number;
9
+ /** Largest rows-region height the browser renders reliably. */
10
+ cap: number;
11
+ }
12
+ export declare function isStretched(g: ScrollGeometry): boolean;
13
+ /** Height of the scrollable rows region in the DOM. */
14
+ export declare function regionHeight(g: ScrollGeometry): number;
15
+ export declare function maxScrollTop(g: ScrollGeometry): number;
16
+ export declare function maxModelTop(g: ScrollGeometry): number;
17
+ /** Scroll position → model position (without anchor offset). */
18
+ export declare function mapToModel(scrollTop: number, g: ScrollGeometry): number;
19
+ /** Model position → scroll position, clamped to the valid scroll range. */
20
+ export declare function mapToScroll(modelTop: number, g: ScrollGeometry): number;
21
+ /** Model top that shows a row with the requested alignment. */
22
+ export declare function alignedTop(rowTop: number, rowHeight: number, align: ScrollAlign, currentTop: number, viewportHeight: number): number;
23
+ /**
24
+ * Scroll ↔ model mapping with a pending anchor offset: anchor corrections shift the mapping instead of
25
+ * writing the scroll position during active scrolling; the offset is folded in when scrolling stops.
26
+ */
27
+ export declare class ScrollModel {
28
+ anchorOffset: number;
29
+ modelTop(scrollTop: number, g: ScrollGeometry): number;
30
+ /** Shifts the mapping so the current scroll position shows `desiredModelTop`. */
31
+ shiftTo(desiredModelTop: number, scrollTop: number, g: ScrollGeometry): void;
32
+ /** True when the offset must be folded now: a scroll edge is reached or the model position is out of range. */
33
+ mustFold(scrollTop: number, g: ScrollGeometry): boolean;
34
+ /** Scroll position that shows the current model position without offset. */
35
+ foldTarget(scrollTop: number, g: ScrollGeometry): {
36
+ target: number;
37
+ modelTop: number;
38
+ };
39
+ /**
40
+ * Recomputes the residual offset after the browser applied (and possibly rounded) a scroll position. At a
41
+ * scroll edge no residue is kept: the user cannot scroll any further there, so the edge must show the first
42
+ * or last row exactly.
43
+ */
44
+ settle(modelTop: number, actualScrollTop: number, g: ScrollGeometry): void;
45
+ }