@olvnck/ingrid 0.0.0-stage → 0.15.20

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 +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +5533 -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,76 @@
1
+ import { type ColumnModel } from '../columns/model';
2
+ import { type FieldFilter } from '../source';
3
+ import { type ColumnFilterModel, type FilterDefaults, type FilterModel, type ResolvedFilter } from './model';
4
+ /** A column that has a filter: its id, the field its entries name (the group column's: `groupField`), the filter. */
5
+ export interface FilterColumn {
6
+ id: string;
7
+ field: string;
8
+ filter: ResolvedFilter;
9
+ }
10
+ /**
11
+ * The columns that have a filter, in definition order (a user move changes neither the entries nor the query): every
12
+ * data leaf with a `filter` (hidden ones too: they keep their models) and the group column while it is present
13
+ * with a `filter` option, under the field `ig:group` or, in a tree, its label field (`groupField`). `defaults`
14
+ * are merged under the built-in kinds.
15
+ * The group-size kind on a data leaf or as a multi child is left out and `report`ed (the grid warns once per column),
16
+ * as is the group column's in tree mode (its definition has no filter then, `ColumnModel.groupSizeIgnored`).
17
+ */
18
+ export declare function filterColumns(model: ColumnModel, defaults: FilterDefaults | undefined, report?: (id: string, problem: string) => void): FilterColumn[];
19
+ /**
20
+ * Applied filter models by column id (grid state, not column state). Models are stored normalised, as
21
+ * copies and deep-frozen, so neither the caller's object nor a returned or queried one can change them. `version`
22
+ * moves on every applied change and whenever the entries of an active filter change, so the grid derives its query
23
+ * again.
24
+ */
25
+ export declare class FilterState {
26
+ version: number;
27
+ private list;
28
+ private byId;
29
+ private models;
30
+ /**
31
+ * Per column, the set labels the set UI computed that differ from the default label (a `format`, or a text key
32
+ * that only reads like a boolean), so summaries show them; one entry per distinct value at most.
33
+ */
34
+ private labels;
35
+ /**
36
+ * Takes the current filter columns (`filterColumns`). A column that is gone, lost its filter or whose filter kind
37
+ * changed loses its model; a redefined filter of the same kind keeps its model re-normalised under the new
38
+ * definition: cut when it no longer fits, dropped when it no longer validates (`report` gets the problems). Returns
39
+ * the ids whose model changed. An unchanged definition keeps its `FilterColumn` object.
40
+ */
41
+ configure(columns: readonly FilterColumn[], report?: (id: string, problem: string) => void): string[];
42
+ /** A set key's label as the set UI computed it; undefined drops it (the default label applies again). */
43
+ setLabel(id: string, key: string, label: string | undefined): void;
44
+ /** The label the set UI computed for a key of the column, if it differs from the default. */
45
+ labelOf(id: string, key: string | null): string | undefined;
46
+ /** The filter columns, in definition order. */
47
+ columns(): readonly FilterColumn[];
48
+ column(id: string): FilterColumn | null;
49
+ filterOf(id: string): ResolvedFilter | null;
50
+ /** The stored model (not a copy; frozen); null = none. */
51
+ get(id: string): ColumnFilterModel | null;
52
+ /** Every applied model, in column order (a copy). */
53
+ all(): FilterModel;
54
+ /**
55
+ * Applies one column's model, normalised (`report` gets its problems); null clears it. Returns true when the stored
56
+ * model changed; an equal model, a column without a filter or an unknown id is no change.
57
+ */
58
+ set(id: string, model: unknown, report: (problem: string) => void): boolean;
59
+ /**
60
+ * Replaces every model: columns `model` does not list are cleared; ids without a filter column are skipped (the
61
+ * caller hints). Returns the changed ids in column order.
62
+ */
63
+ replace(model: FilterModel | null, report: (id: string, problem: string) => void): string[];
64
+ /** One column has a model, or (no id) any column has. */
65
+ active(id?: string): boolean;
66
+ /** `RowQuery.filter`: one entry per active filter, in column order. */
67
+ entries(): FieldFilter[];
68
+ /**
69
+ * `ValuesRequest.filter`: the entries without column `id`'s; with `child` (a multi filter's set child)
70
+ * the column's multi entry stays with that child's slot null in both `children` and `model.filterModels`, and is
71
+ * left out when no other child is active.
72
+ */
73
+ entriesExcept(id: string, child?: number): FieldFilter[];
74
+ /** Stores `model` normalised (a copy) or clears the column; true when the stored model changed. */
75
+ private apply;
76
+ }
@@ -0,0 +1,16 @@
1
+ import type { GridTexts, Locale } from '../i18n/texts';
2
+ import type { ColumnFilterModel, ResolvedFilter } from './model';
3
+ /**
4
+ * A set key's default label: "(Blanks)" for null, the True / False texts for the keys of booleans, else the
5
+ * key. A label from a `format` needs the value; the set UI computes it and the summary's `label` hook supplies it.
6
+ */
7
+ export declare function defaultSetLabel(key: string | null, texts: GridTexts): string;
8
+ /** A set key's label as known to the caller (the set UI's, e.g. from a `format`); undefined: the default label. */
9
+ export type SetLabel = (key: string | null) => string | undefined;
10
+ /**
11
+ * A column's model as text, '' for no model: conditions as the operator's short word or symbol and its
12
+ * value(s), joined by the localised AND / OR; a set as its count and first labels (`label` maps a key, else
13
+ * `defaultSetLabel`); a multi filter as its active children joined by AND; a custom filter by its `summary` (a throw is
14
+ * reported once and gives '').
15
+ */
16
+ export declare function summarise(filter: ResolvedFilter, model: ColumnFilterModel | null, locale: Locale, label?: SetLabel): string;
@@ -0,0 +1,40 @@
1
+ import type { FilterValues, RowQuery, ValuesRequest, ViewportSource } from '../source';
2
+ import type { SetFilterDef } from './model';
3
+ import type { FilterColumn, FilterState } from './state';
4
+ /**
5
+ * The `limit` hint of a set filter's value request: a server may cut its list there (`complete: false`); the
6
+ * client source lists every value. The count request behind a fixed `values` list sends none.
7
+ */
8
+ export declare const SET_VALUES_LIMIT = 10000;
9
+ /** What a value request reads from the grid. */
10
+ export interface ValuesContext {
11
+ source: ViewportSource;
12
+ filters: FilterState;
13
+ /** The query the source has; a pending change (e.g. of the quick filter) is handed over first. */
14
+ query(): RowQuery;
15
+ /** A console hint, printed at most once per key and grid. */
16
+ warn(key: string, message: string): void;
17
+ }
18
+ /** The value-request options of `Grid.filterValues` and the filter UIs. */
19
+ export interface ValuesOptions {
20
+ search?: string;
21
+ signal?: AbortSignal;
22
+ /** A multi filter's child (default its first set child). */
23
+ child?: number;
24
+ }
25
+ /** The source's `status()`, isolated: a throw is reported once and counts as no status. */
26
+ export declare function sourceRemote(source: ViewportSource): boolean;
27
+ /** `source.filterValues`, a synchronous throw turned into a rejection; no method: an empty list and one hint. */
28
+ export declare function askValues(ctx: ValuesContext, request: ValuesRequest): Promise<FilterValues>;
29
+ /**
30
+ * A set filter's values — `Grid.filterValues` plus the filter UIs' options: `child` names a multi
31
+ * filter's child (default its first set child), `signal` aborts the request. The source is asked for the column's
32
+ * field among the rows passing the other filters (inside a multi filter: its other children) and the quick
33
+ * filter, with counts when the set filter shows them; a fixed `values` list is returned as given.
34
+ */
35
+ export declare function valuesFor(ctx: ValuesContext, id: string, options?: ValuesOptions): Promise<FilterValues>;
36
+ /**
37
+ * A fixed `values` list: exactly those values; with `counts`, each value's count is looked up by key in the
38
+ * source's answer when the source is not remote (case variants together unless `caseSensitive`), else none.
39
+ */
40
+ export declare function fixedValues(ctx: ValuesContext, query: RowQuery, col: FilterColumn, set: SetFilterDef, child: number | undefined, signal: AbortSignal | undefined): Promise<FilterValues>;
@@ -0,0 +1,94 @@
1
+ import type { DisplayLayout, ResolvedColumn } from '../columns/layout';
2
+ import type { GridTexts } from '../i18n/texts';
3
+ import type { SectionSide, SectionSource } from '../render/pinnedRows';
4
+ import { type ViewportSource } from '../source';
5
+ import type { GridOptions } from '../types';
6
+ /** What the index reads of the grid (a `TableHost` has the first three). */
7
+ export interface FindIndexHost {
8
+ source(): ViewportSource;
9
+ /** The applied display layout. */
10
+ layout(): DisplayLayout;
11
+ texts(): GridTexts;
12
+ /**
13
+ * The pinned section source of `side` (`grid.ts`'s, empty while no rows are pinned there).
14
+ * Absent: the walk has the body's rows only.
15
+ */
16
+ section?(side: SectionSide): SectionSource;
17
+ /**
18
+ * `GridOptions.keepGroupValues` — an open group's row keeps its sums while its total row shows, so
19
+ * they are searched there as they draw. Absent: off.
20
+ */
21
+ keepGroupValues?(): boolean;
22
+ }
23
+ /** One occurrence (the public `FindMatch` plus the node behind its row). */
24
+ export interface IndexedMatch {
25
+ /**
26
+ * The display row now: −1 while it is inside a closed group (or the source ran since the index was built). A pinned
27
+ * row's: its index in its section.
28
+ */
29
+ row: number;
30
+ /** A pinned row's section; absent for a body row. */
31
+ pinned?: SectionSide;
32
+ column: string;
33
+ /** 1-based, within its cell. */
34
+ numInMatch: number;
35
+ /** 1-based, in walk order. */
36
+ numOverall: number;
37
+ /**
38
+ * The client node of its row (a group row's or a filler's included; a group total's number, the grand
39
+ * total's top node): what reveals it and gives its identity. −1 for a pinned row (`sectionKey` gives its identity;
40
+ * nothing reveals it).
41
+ */
42
+ node: number;
43
+ }
44
+ /**
45
+ * The identity of row `row` of a pinned section (the active match for a pinned row): the app's object, as
46
+ * a body row without an id is known by its object; null out of range.
47
+ */
48
+ export declare function sectionKey(section: SectionSource | undefined, row: number): unknown;
49
+ export interface FindIndex {
50
+ readonly term: string;
51
+ readonly caseSensitive: boolean;
52
+ /** Occurrences in all. */
53
+ readonly total: number;
54
+ /** The searched columns it walked, in display order (`searchedColumns`); empty for an index of nothing. */
55
+ readonly columns: readonly ResolvedColumn[];
56
+ /** Occurrence `n` (1-based, walk order); null out of range. */
57
+ match(n: number): IndexedMatch | null;
58
+ /**
59
+ * The occurrences in the cell of display row `row` (a pinned row's index in section `pinned`) and column `column`;
60
+ * 0 for a cell not searched.
61
+ */
62
+ numMatches(row: number, column: string, pinned?: SectionSide): number;
63
+ /**
64
+ * Occurrence `numInMatch` of the first cell (walk order) in column `column` whose row `same` accepts — by its
65
+ * client node (−1 for a pinned row), its section (undefined for a body row) and its display row; null when no such
66
+ * cell has that many. Asks `same` only about the matched cells of that column (the active match found
67
+ * again by its row's identity after a rebuild).
68
+ */
69
+ locate(column: string, numInMatch: number, same: (node: number, pinned: SectionSide | undefined, row: number) => boolean): IndexedMatch | null;
70
+ }
71
+ /** The displayed leaf columns in display order (left, centre, right; the group column included), no grid-owned one. */
72
+ export declare function searchedColumns(layout: DisplayLayout): ResolvedColumn[];
73
+ /**
74
+ * A build of the index, begun (`startFindIndex`): the searched columns it walks, taken when it began, and its steps —
75
+ * each scans about `SLICE_CELLS` cells, the last returns the index. The find model runs them in slices between frames
76
+ * (a full build at 100,000 rows × 20 columns misses the 100 ms keystroke target) or at once
77
+ * (`buildFindIndex`).
78
+ */
79
+ export interface FindIndexBuild {
80
+ readonly columns: readonly ResolvedColumn[];
81
+ readonly steps: Generator<void, FindIndex>;
82
+ }
83
+ /**
84
+ * The index of `term` on `host`'s client source (empty for `''` or another source), built whole. `prev`: the current
85
+ * index, given only while nothing it was built over changed since (no source run, layout or locale change — the find
86
+ * model's dirty flag): when the new term narrows it ("ab" → "abc"), only the cells that matched are scanned again,
87
+ * over the same rows and columns.
88
+ */
89
+ export declare function buildFindIndex(host: FindIndexHost, term: string, options?: GridOptions['findOptions'], prev?: FindIndex | null): FindIndex;
90
+ /**
91
+ * `buildFindIndex` begun: the rows, the columns, the locale and `prev`'s cells are taken now; the cells are scanned in
92
+ * the build's steps. Whoever runs the steps stops them when any of these changes (the find model's dirty flag).
93
+ */
94
+ export declare function startFindIndex(host: FindIndexHost, term: string, options?: GridOptions['findOptions'], prev?: FindIndex | null): FindIndexBuild;
@@ -0,0 +1,38 @@
1
+ import type { ResolvedColumn } from '../columns/layout';
2
+ import type { Locale } from '../i18n/texts';
3
+ import { type EmptyGroupRows } from '../render/cells';
4
+ import type { SectionSide } from '../render/pinnedRows';
5
+ import type { RowInfo } from '../source';
6
+ import type { GridOptions } from '../types';
7
+ /**
8
+ * The matcher of a term: the whole term as one substring (escaped), with the flags `g` and `u`, plus `i` unless
9
+ * `caseSensitive` — matched on the original text, so the offsets are the text's own (lower-casing first can change a
10
+ * string's length: "İ"). The term is used as typed (not trimmed, no diacritic folding). Null for `''`: find is off.
11
+ * Stateful (`lastIndex`): the functions below reset it on entry.
12
+ */
13
+ export declare function findMatcher(term: string, options?: GridOptions['findOptions']): RegExp | null;
14
+ /** The occurrences of `re` in `text`: non-overlapping, left to right ("aa" in "aaa" once). Builds no match array. */
15
+ export declare function countMatches(re: RegExp, text: string): number;
16
+ /**
17
+ * The occurrences of `re` in `text` as flat `[start, end, start, end, …]` (UTF-16 offsets into `text`, `end`
18
+ * exclusive), left to right, non-overlapping.
19
+ */
20
+ export declare function matchRanges(re: RegExp, text: string): number[];
21
+ /**
22
+ * The text find searches in one cell, from its raw value: null where the cell is out of the search — a
23
+ * grid-owned column (row numbers, selection, row drag, detail toggle) or a cell that draws nothing (empty group
24
+ * cells, `drawsNothing`; no `format` or `findText` runs there) — else `searchedTextOf` over the shown text
25
+ * (`formatCellText`). `row` is the display row (−1 inside a closed group); `info` reaches `findText` as given, so a
26
+ * caller whose info is refilled per row passes a copy. `pinned`: a pinned row's side, `row` its index in
27
+ * the section — `format` and `findText` get it as the section's drawn cells give it.
28
+ */
29
+ export declare function searchedText(col: ResolvedColumn, value: unknown, row: number, info: RowInfo | null, locale: Pick<Locale, 'texts'>, empty: EmptyGroupRows | null, pinned?: SectionSide): string | null;
30
+ /**
31
+ * The text find searches in one cell given its shown `text` (`formatCellText`'s, which a drawn cell already
32
+ * holds; the caller has checked `drawsNothing`): the column's `findText` decides first — a string replaces the text,
33
+ * `null` takes the cell out, `undefined` keeps it (a throw is reported once and keeps it). Without a string from it, a
34
+ * cell that draws a checkbox (a checkbox column's value with a box) is out: it shows no text. Decided per cell, so
35
+ * a checkbox column's group row showing a count's text is searched. A grid-owned column is out. `pinned`: a
36
+ * pinned row's side, which `findText`'s context carries (absent for a body row).
37
+ */
38
+ export declare function searchedTextOf(col: ResolvedColumn, value: unknown, text: string, row: number, info: RowInfo | null, pinned?: SectionSide): string | null;
@@ -0,0 +1,115 @@
1
+ import type { SectionSide } from '../render/pinnedRows';
2
+ import type { FindDraw } from '../render/strategy';
3
+ import type { CellAddress, FindChange, FindMatch, FindPart, GridOptions } from '../types';
4
+ import { type FindIndexHost } from './index';
5
+ /**
6
+ * The budget of one slice of a sliced build, ms per frame at most (copy and export keep `SLICE_MS`): drawn
7
+ * cells mark themselves from the matcher, so only the count waits, and frames during a build stay short. A slice takes
8
+ * only what the frame has left after the grid's pass, at least 2 ms (the slicer's `frameAware` runs).
9
+ */
10
+ export declare const FIND_SLICE_MS = 10;
11
+ /** What the model reads of the grid. */
12
+ export interface FindHost extends FindIndexHost {
13
+ /** Runs `task` after the next pass (the frame scheduler's deferred tasks). */
14
+ defer(task: () => void): void;
15
+ /** A developer hint, once per key. */
16
+ warn(key: string, message: string): void;
17
+ /** Runs `run` in the grid's one event queue: at once, or after the event being delivered. */
18
+ deliver(run: () => void): void;
19
+ /**
20
+ * Runs `steps` in slices between frames (`table/slicer.ts`) until they end; returns a stop that takes them out
21
+ * of the slicer, left where they are (a read finishes them). Absent: every build runs whole.
22
+ */
23
+ slice?(steps: Generator<void, void>): () => void;
24
+ /**
25
+ * The marks the drawn cells show changed — the term, the options or the active match: the grid draws again.
26
+ * Absent: nothing is drawn.
27
+ */
28
+ redraw?(): void;
29
+ /**
30
+ * Group total rows are asked (`GridOptions.groupTotalRow`). Opening a group then moves its sums to
31
+ * its total row and adds its label, closing it moves them back, so an expansion change marks the index dirty.
32
+ * Absent or false: an expansion changes nothing the walk counts (rows inside closed groups count as they would
33
+ * show), and marks nothing.
34
+ */
35
+ groupTotalRows?(): boolean;
36
+ }
37
+ /** What find's last change event said (`FindModel.reported`). */
38
+ export interface FindReport {
39
+ readonly find: string;
40
+ readonly total: number;
41
+ /** The active match's `numOverall`; 0: none. */
42
+ readonly active: number;
43
+ }
44
+ export interface FindModel {
45
+ /** The term; `''`: find is off. */
46
+ readonly term: string;
47
+ /**
48
+ * What the last change event said — its term, count and active match; `''`, 0, 0 before the first. A read of what
49
+ * was reported, never a build: the top bar's find box counts from it where a count read
50
+ * (`total()`) would build the whole index on the spot — for an initial term, inside `createGrid`.
51
+ */
52
+ reported(): FindReport;
53
+ /**
54
+ * `GridOptions.find` / `setFind`: a new term leaves no match active (refining too); the term it already has
55
+ * changes nothing.
56
+ */
57
+ setTerm(term: string | undefined): void;
58
+ /** `GridOptions.findOptions` / `setFindOptions`: the active match stays while its occurrence exists. */
59
+ setOptions(options: GridOptions['findOptions']): void;
60
+ /**
61
+ * What the index was built over changed — a client source run, a definition or locale change, a grid write,
62
+ * `findRefresh()`, a total-row option: rebuilt after the pass, or at the next read. An expansion
63
+ * change while group total rows are asked comes in by itself (`FindHost.groupTotalRows`), as a run does.
64
+ */
65
+ refresh(): void;
66
+ /** A layout was applied: the index is dirty when the searched columns changed (a width never changes them). */
67
+ layoutChanged(): void;
68
+ /** The grid's rows source was replaced. */
69
+ sourceReplaced(): void;
70
+ /**
71
+ * Navigation: the match made active (its closed groups opened, `row` the display row after that) — the one
72
+ * to scroll to; null when nothing was gone to.
73
+ */
74
+ next(): FindMatch | null;
75
+ previous(): FindMatch | null;
76
+ goTo(n: number, force?: boolean): FindMatch | null;
77
+ clearActive(): void;
78
+ total(): number;
79
+ active(): FindMatch | null;
80
+ numMatches(cell: CellAddress): number;
81
+ /**
82
+ * `text` split by the term, the cell's active occurrence flagged (`findGetParts`). A drawing read: the matcher
83
+ * and the held active match, never a build or the end of one — renderers ask it during a pass.
84
+ */
85
+ parts(params: {
86
+ row: number;
87
+ column: string;
88
+ pinned?: SectionSide;
89
+ text: string;
90
+ precedingNumMatches?: number;
91
+ }): FindPart[];
92
+ /**
93
+ * The active occurrence in the cell of display row `row` (a pinned row's index in section `pinned`) and column
94
+ * `column` (its `numInMatch`); 0 when the cell holds none. By the row's identity, without a rebuild: drawn cells
95
+ * ask it during a pass.
96
+ */
97
+ activeIn(row: number, column: string, pinned?: SectionSide): number;
98
+ /**
99
+ * What the drawn cells of the body (`pinned` undefined) or of a pinned section mark themselves with: the
100
+ * matcher, the active occurrence in that side's rows and a version that moves on a term, option or active-match
101
+ * change. Undefined while off or on a source other than a client source, so the strategy context's member is absent
102
+ * then. One object per side for the model's life.
103
+ */
104
+ draw(pinned?: SectionSide): FindDraw | undefined;
105
+ onChange(listener: (event: FindChange) => void): () => void;
106
+ dispose(): void;
107
+ }
108
+ /**
109
+ * `text` split by `re` into `FindPart`s: plain pieces and occurrences; the occurrence numbered `active` in
110
+ * its cell is flagged, the text's first occurrence being number `preceding + 1` (a renderer's piece after others). No
111
+ * matcher or no occurrence: one plain part; `''`: none.
112
+ */
113
+ export declare function splitParts(re: RegExp | null, text: string, active: number, preceding: number): FindPart[];
114
+ /** The find model of one grid; `term` and `options`: the grid's initial `find` and `findOptions`. */
115
+ export declare function createFindModel(host: FindHost, term?: string, options?: GridOptions['findOptions']): FindModel;
@@ -0,0 +1,42 @@
1
+ import { type Operations } from './edit/operations';
2
+ import type { Editing } from './edit/types';
3
+ import type { InteractHost } from './interact/host';
4
+ import { type StrategyFactory } from './render/strategy';
5
+ import type { Grid, GridOptions } from './types';
6
+ import { type GridUi } from './ui/controller';
7
+ /** Scrolling counts as stopped this long after the last user scroll event. Exported for tests. */
8
+ export declare const IDLE_MS = 150;
9
+ export declare function createGrid(host: HTMLElement, options: GridOptions): Grid;
10
+ /**
11
+ * A grid's natural height: its header rows, its rows' total height (computed and measured heights
12
+ * included), the room a classic horizontal scrollbar takes and the chrome around its body (group panel, status bar,
13
+ * frame) — what it would take to show every row without scrolling inside. `listener` hears it whenever it changes, after
14
+ * a pass or a height correction; nothing is computed for a grid without a listener. Internal: a master sizes its
15
+ * built-in detail grids by it (`'auto'`). Returns the remover.
16
+ */
17
+ export declare function onNaturalHeight(grid: Grid, listener: (h: number) => void): () => void;
18
+ /**
19
+ * The checkbox columns the grid applied (`checkboxColumns`). Internal (tests): not exported from the package.
20
+ */
21
+ export declare function checkboxColumnsOf(grid: Grid): ReadonlySet<string>;
22
+ /**
23
+ * The grid's editing module: null while no column may be edited, `enterMoves` is not `'always'` and cell
24
+ * selection has no fill. Internal (tests): not exported from the package.
25
+ */
26
+ export declare function editingOf(grid: Grid): Editing | null;
27
+ /** The edit operations of a grid; null while its editing module doesn't exist; internal, for tests. */
28
+ export declare function operationsOf(grid: Grid): Operations | null;
29
+ /** A column's version in the applied layout (it grows when its cells must re-bind); internal, for tests. */
30
+ export declare function columnVersionOf(grid: Grid, id: string): number | undefined;
31
+ /**
32
+ * The grid's UI controller, created on first need; null once the grid is destroyed. Internal (tests and the
33
+ * grid's own UI entry points): not exported from the package.
34
+ */
35
+ export declare function gridUi(grid: Grid): GridUi | null;
36
+ /**
37
+ * The grid as its interaction modules read it; null once the grid is destroyed. Internal (tests drive the
38
+ * modules' host calls through it): not exported from the package.
39
+ */
40
+ export declare function interactHostOf(grid: Grid): InteractHost | null;
41
+ /** createGrid with a pluggable rendering strategy. */
42
+ export declare function createGridInternal(host: HTMLElement, options: GridOptions, strategyFactory: StrategyFactory): Grid;
@@ -0,0 +1,34 @@
1
+ /** 'plain': no grouping, '.' (the default). 'locale': the grid's `lang`. Any other string: a BCP 47 tag. */
2
+ export type NumberStyle = 'plain' | 'locale' | (string & {});
3
+ /** The style per place; a place left out takes `all`, and `all` left out is 'plain'. */
4
+ export interface NumberStyles {
5
+ /** Every place not named below; default 'plain'. */
6
+ all?: NumberStyle;
7
+ /** The (N) on group rows. */
8
+ groupCounts?: NumberStyle;
9
+ /** Status bar counts and aggregates. */
10
+ statusBar?: NumberStyle;
11
+ /** Number filter inputs: the decimal mark read and written; filter summaries. */
12
+ filterInput?: NumberStyle;
13
+ }
14
+ export type NumberPlace = keyof NumberStyles;
15
+ export interface NumberFormat {
16
+ /** A count: the integer's digits; a locale style groups them. */
17
+ count(n: number): string;
18
+ /** A computed value (status bar aggregates): Intl's default fraction digits (at most 3); 'plain' never groups. */
19
+ value(n: number | bigint): string;
20
+ /**
21
+ * A number as an input's text: never grouped, never an exponent, every fraction digit, Latin digits, `decimal`; ''
22
+ * for a non-finite number (no input reads `∞` or `NaN` back).
23
+ */
24
+ input(n: number): string;
25
+ /** The decimal mark inputs write; ',' also means inputs read ',' beside '.'. */
26
+ readonly decimal: '.' | ',';
27
+ }
28
+ export type ResolvedNumbers = Readonly<Record<NumberPlace, NumberFormat>>;
29
+ /**
30
+ * A named place's style, else `all`, else 'plain'; 'locale' = `lang` (English when Intl rejects or does not
31
+ * support `lang`); a tag Intl rejects or does not support → 'plain', reported once per `owner` and style. The
32
+ * default owner is this function: without one, a style is reported once per process.
33
+ */
34
+ export declare function resolveNumbers(option: NumberStyle | NumberStyles | undefined, lang: string, owner?: object): ResolvedNumbers;