@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,102 @@
1
+ import type { ColumnFilterModel, ResolvedFilter } from '../../filter/model';
2
+ import { type ValuesOptions } from '../../filter/values';
3
+ import type { Locale } from '../../i18n/texts';
4
+ import type { FilterValues } from '../../source';
5
+ import type { ColumnDef, ColumnInfo } from '../../types';
6
+ import type { GroupFilterView, UiHost } from '../controller';
7
+ import type { PopupLayer } from '../popup';
8
+ /**
9
+ * Why the values a set list shows may be out of date: the source's rows changed ('rows'; a remote source's block loads
10
+ * do not count), the rows source was replaced ('source', `setRows`), or another filter changed — another column's, or
11
+ * inside a multi filter a sibling's ('filters').
12
+ */
13
+ export type ValuesCause = 'rows' | 'source' | 'filters';
14
+ /** A column's filter UI: one element, shown in the popup or the filters panel. */
15
+ export interface FilterUi {
16
+ readonly el: HTMLElement;
17
+ /** The applied model changed (any source). */
18
+ setApplied(model: ColumnFilterModel | null): void;
19
+ /** Shown in its place (the popup opened, or its panel section expanded): a set list asks for its values. */
20
+ attach?(): void;
21
+ /** Leaving its place: flush the debounce, then drop unapplied edits. */
22
+ detach(): void;
23
+ /** The values a set list shows may be out of date: a shown list asks again, a hidden one on its next showing. */
24
+ valuesStale?(cause: ValuesCause): void;
25
+ focus(): void;
26
+ localeChanged(): void;
27
+ destroy(): void;
28
+ }
29
+ /** What a filter UI reads and calls. */
30
+ export interface FilterUiDeps {
31
+ column(): ColumnInfo;
32
+ /** `format` for set labels. */
33
+ columnDef(): ColumnDef;
34
+ filter: ResolvedFilter;
35
+ locale(): Locale;
36
+ applied(): ColumnFilterModel | null;
37
+ /** Source 'ui'. */
38
+ apply(model: ColumnFilterModel | null): void;
39
+ /** Closes the popup; no-op in the filters panel. */
40
+ close(): void;
41
+ /** The grid's overlay host. */
42
+ overlayHost(): HTMLElement;
43
+ values(options?: ValuesOptions): Promise<FilterValues>;
44
+ remote(): boolean;
45
+ inPanel(): boolean;
46
+ /** Reports a throwing callback once per key. */
47
+ report(key: string, error: unknown): void;
48
+ /** A definition problem, printed once per key and column (a developer hint). */
49
+ warn(key: string, message: string): void;
50
+ /** Its content changed size (values arrived): the popup places itself again; nothing in the filters panel. */
51
+ resized(): void;
52
+ /** A set list's labels as it computed them: the summaries show them in place of the default labels. */
53
+ labels(entries: readonly {
54
+ readonly key: string | null;
55
+ readonly label: string;
56
+ }[]): void;
57
+ }
58
+ /** The UI of a column's filter, by kind; a multi filter's children are made by this function too. */
59
+ export declare function createFilterUi(deps: FilterUiDeps): FilterUi;
60
+ /** The filter popups as the UI controller drives them. */
61
+ export interface FilterHost {
62
+ /** A filter button was clicked: its column's popup opens below it, or closes when it is open. */
63
+ toggle(id: string, anchor: HTMLElement): void;
64
+ /**
65
+ * `Grid.showFilter`: the column scrolls into view, then its popup opens (an open one keeps open). `item` opens the
66
+ * group popup on that picker item — an entry's id, or `ig:group` for the group column's own filter.
67
+ */
68
+ show(id: string, item?: string): void;
69
+ /**
70
+ * Mod+Enter on a focused header cell: the popup opens below the column's filter button (else its cell),
71
+ * and a keyboard close hands focus back to `opener`, the header cell; false without a filter.
72
+ */
73
+ openFrom(id: string, opener: HTMLElement): boolean;
74
+ filtersChanged(ids: readonly string[]): void;
75
+ /**
76
+ * UIs of removed columns or changed filter definitions go (their popup closes); a hidden column's popup closes. The
77
+ * group popup follows its own rules.
78
+ */
79
+ columnsChanged(): void;
80
+ /** The source's rows changed, or `setRows` replaced it: set lists follow. */
81
+ sourceChanged(): void;
82
+ localeChanged(): void;
83
+ /**
84
+ * The filters panel shows the column's UI in a section: the column's popup closes first (the UI
85
+ * leaves it), then the element moves into `into` and is attached. `taken` runs when the UI leaves the section other
86
+ * than by `giveBack`: the popup took it ('popup'), or it went — its definition changed, its column was removed
87
+ * ('gone'). False when the column has no filter.
88
+ */
89
+ lend(id: string, into: HTMLElement, taken: (why: TakenReason) => void): boolean;
90
+ /** The section closed, or the panel went: the UI leaves it (flushed, unapplied edits dropped). */
91
+ giveBack(id: string): void;
92
+ /** Destroys every UI; the popup itself is closed (silently) by the layer's own destroy. */
93
+ destroy(): void;
94
+ }
95
+ /** How a UI lent to a panel section left it other than by `giveBack`. */
96
+ export type TakenReason = 'popup' | 'gone';
97
+ /**
98
+ * Call inside the controller's effect scope. `floatingButton` finds a column's floating-filter button, the
99
+ * second place a filter opens from; `labelsChanged` hears that a column's set labels changed (its summaries);
100
+ * `group` is the group column's view of the grouped columns' filters.
101
+ */
102
+ export declare function createFilterHost(host: UiHost, popups: () => PopupLayer, floatingButton: (id: string) => HTMLElement | null, labelsChanged: (id: string) => void, group: GroupFilterView, overlayHost: () => HTMLElement): FilterHost;
@@ -0,0 +1,6 @@
1
+ import type { FilterUi, FilterUiDeps } from './host';
2
+ /**
3
+ * A multi filter UI; call inside the host's effect scope. `make` builds a child's UI (the host's `createFilterUi`,
4
+ * passed in so this module does not import the host).
5
+ */
6
+ export declare function createMultiFilterUi(deps: FilterUiDeps, make: (deps: FilterUiDeps) => FilterUi): FilterUi;
@@ -0,0 +1,15 @@
1
+ import type { GroupSizeFilterDef, NumberFilterDef } from '../../filter/model';
2
+ import type { Locale } from '../../i18n/texts';
3
+ import type { SimpleKindIo } from './simple';
4
+ /**
5
+ * The default `parse`: the trimmed text as a finite number. An optional sign (U+2212 too), digits with one decimal
6
+ * mark (`.` only under `'.'`; `.` or `,` under `','`), an optional exponent; '', '-', grouping or anything else → null.
7
+ */
8
+ export declare function parseNumberInput(text: string, decimal: '.' | ','): number | null;
9
+ /**
10
+ * The number inputs of `kind`: the number filter's, or the group-size filter's (the number popup and box on
11
+ * a group's row count, its conditions written with `filterType: 'groupSize'`). A count is read and written by the
12
+ * defaults only: the grid-wide `filterDefaults.parse` / `formatInput` are merged into the groupSize def too, but are
13
+ * not used for counts.
14
+ */
15
+ export declare function numberIo(def: NumberFilterDef | GroupSizeFilterDef, locale: () => Locale, kind?: 'number' | 'groupSize'): SimpleKindIo<number>;
@@ -0,0 +1,15 @@
1
+ export interface NumberMask {
2
+ /** One character an insertion may bring in. */
3
+ admits(char: string): boolean;
4
+ /** A ',' inserted becomes '.' (the style reads only '.', no app format). */
5
+ readonly commaToPoint: boolean;
6
+ }
7
+ /** The default set: digits, the marks `decimal` reads, + - −, e E, space; `shorthand` adds < > = ! and '.'. */
8
+ export declare function defaultNumberMask(decimal: '.' | ',', shorthand: boolean): NumberMask;
9
+ /**
10
+ * An app's `allowedCharPattern` (a character class, or the characters inside one), plus the box's operators, '.' and
11
+ * space when `shorthand`; null (reported once per `owner`) when it is no valid regular expression.
12
+ */
13
+ export declare function patternMask(pattern: string, shorthand: boolean, owner: object): NumberMask | null;
14
+ /** Holds `input` to `mask()` (read per insertion: the style can change live) on `beforeinput`. */
15
+ export declare function attachNumberMask(input: HTMLInputElement, mask: () => NumberMask | null): void;
@@ -0,0 +1,3 @@
1
+ import type { FilterUi, FilterUiDeps } from './host';
2
+ /** A set filter UI; call inside the host's effect scope. */
3
+ export declare function createSetFilterUi(deps: FilterUiDeps): FilterUi;
@@ -0,0 +1,52 @@
1
+ import { type SimpleFilterOptions, type SimpleKind } from '../../filter/model';
2
+ import type { GridTexts } from '../../i18n/texts';
3
+ import type { FilterUi, FilterUiDeps } from './host';
4
+ import { type NumberMask } from './numberMask';
5
+ /** Where an input sits: alone, or as a range's From / To. */
6
+ export type InputSlot = 'single' | 'from' | 'to';
7
+ /** What a kind contributes: its inputs, how their text reads and writes, its condition shape and order. */
8
+ export interface SimpleKindIo<V extends string | number> {
9
+ readonly kind: SimpleKind;
10
+ /** Prepares a new input: type, inputmode, min / max. */
11
+ setup(input: HTMLInputElement): void;
12
+ /** The default placeholder of an input in `slot`; null = none (native date inputs draw their format). */
13
+ placeholder(texts: GridTexts, slot: InputSlot): string | null;
14
+ /** An input's text as a model value; null = incomplete. */
15
+ read(text: string): V | null;
16
+ /** A model value as an input's text. */
17
+ write(value: unknown): string;
18
+ /** A condition of the kind (normaliseModel checks it; a null value makes it incomplete). */
19
+ condition(type: string, from: V | null, to: V | null): object;
20
+ /** A model condition's two values. */
21
+ values(condition: Record<string, unknown>): [unknown, unknown];
22
+ /** The kind's order, for ranges. */
23
+ compare(a: V, b: V): number;
24
+ /** Number kinds: what an input's insertions are held to (null = nothing), live; `shorthand`: the box's operators too. */
25
+ mask?(shorthand: boolean): NumberMask | null;
26
+ /** Number kinds: the text is neither empty, nor unfinished, nor readable (the red frame). */
27
+ unreadable?(text: string): boolean;
28
+ }
29
+ /**
30
+ * A kind's input, for the popup and the floating cells: its type and keyboard from the kind, spelling
31
+ * and autofill helpers off (macOS WebKit would otherwise correct filter text).
32
+ */
33
+ export declare function filterInput<V extends string | number>(io: SimpleKindIo<V>, className: string, shorthand?: boolean): HTMLInputElement;
34
+ /**
35
+ * A native select in the operator select's look: the grid's chevron at its end, in place of the platform's arrow
36
+ * (CSS: appearance none). The conditions' operator selects; the group popup's picker too.
37
+ */
38
+ export declare function operatorSelect(className: string): {
39
+ box: HTMLDivElement;
40
+ select: HTMLSelectElement;
41
+ };
42
+ /**
43
+ * The offered operators: `operators` restricts and orders the kind's list, an operator the kind does not know is
44
+ * reported once and left out (an empty result offers them all); the initial one is `defaultOperator` when it is offered
45
+ * and takes an input, else the first offered one that takes one (reported when `defaultOperator` was given).
46
+ */
47
+ export declare function resolveOperators(kind: SimpleKind, def: SimpleFilterOptions, warn: (key: string, message: string) => void): {
48
+ offered: string[];
49
+ initial: string;
50
+ };
51
+ /** A text, number or date filter UI; call inside the host's effect scope. */
52
+ export declare function createSimpleFilterUi<V extends string | number>(deps: FilterUiDeps, io: SimpleKindIo<V>): FilterUi;
@@ -0,0 +1,5 @@
1
+ import type { TextFilterDef } from '../../filter/model';
2
+ import type { SimpleKindIo } from './simple';
3
+ /** Trims the text, unless it is whitespace only: that is kept as typed (as in Excel). */
4
+ export declare function trimForFilter(text: string): string;
5
+ export declare function textIo(def: TextFilterDef): SimpleKindIo<string>;
@@ -0,0 +1,18 @@
1
+ import type { FiltersPanelOptions } from '../types';
2
+ import type { UiHost } from './controller';
3
+ import type { FilterHost } from './filters/host';
4
+ export interface FiltersPanel {
5
+ readonly el: HTMLElement;
6
+ /**
7
+ * Its tool panel opened (true) or closed: closed, the open sections' UIs leave their place (flushed, unapplied edits
8
+ * dropped); opened again, they come back as they scroll into view.
9
+ */
10
+ setShown(shown: boolean): void;
11
+ /** Definitions or column state changed (or the locale): sections, names and order follow. */
12
+ refresh(): void;
13
+ /** These columns' filter models (or a set filter's labels) changed: their markers and summaries follow. */
14
+ filtersChanged(ids: readonly string[]): void;
15
+ destroy(): void;
16
+ }
17
+ /** Call inside the controller's effect scope; its own scope stops with `destroy`. */
18
+ export declare function createFiltersPanel(host: UiHost, options: FiltersPanelOptions, filters: () => FilterHost): FiltersPanel;
@@ -0,0 +1,66 @@
1
+ import type { ColumnDef, FilterChange } from '../types';
2
+ import type { GroupFilterView, UiHost } from './controller';
3
+ /**
4
+ * The one way a column's filter popup opens from the grid's own controls: the floating cell's filter
5
+ * button when the column has a floating filter that shows one, else the header filter button unless `filterButton:
6
+ * false`, else the column menu's "Filter…" item; null without a filter. The header's decor, the floating cells and the
7
+ * column menu all read it, so a column always has exactly one of them.
8
+ */
9
+ export declare function filterRoute(def: ColumnDef, hasEntries?: boolean): 'floating' | 'header' | 'menu' | null;
10
+ /** The floating row's cells as the UI controller drives them. */
11
+ export interface FloatingCells {
12
+ /** The header hands a qualifying column's cell over; its editor is built once the header's update is done. */
13
+ mount(id: string, host: HTMLElement): void;
14
+ /** The cell is no longer the column's floating filter: its editor goes and the cell is left empty. */
15
+ unmount(id: string): void;
16
+ /** The column's floating filter button while it shows (where its popup opens when the header has no button). */
17
+ button(id: string): HTMLElement | null;
18
+ /**
19
+ * Enter on the focused floating cell, or the grid's Tab between editors: focus moves into the column's
20
+ * editor — built now when a stand-in waits, its text selected — or an app renderer's first focusable control;
21
+ * in the group cell into its main box, else its aside; `at: 'last'` — Shift+Tab into the cell from the
22
+ * next column — into the aside when there is one. False when the cell has nothing that takes focus
23
+ * (no floating filter, a read-only summary).
24
+ */
25
+ enter(id: string, at?: 'first' | 'last'): boolean;
26
+ /**
27
+ * The grid's Tab / Shift+Tab inside the group cell: focus moves from the box holding `from` to
28
+ * the aside (forward) or the main box (back) and this returns true; false when the move would leave the cell — from
29
+ * the aside forward, from the main box back, or in a cell with one box.
30
+ */
31
+ step(id: string, from: Element, back: boolean): boolean;
32
+ /** `headerFocus` changed: the stand-ins and inputs take the tab order it calls for. */
33
+ tabOrderChanged(): void;
34
+ /**
35
+ * Applied models changed (any source): editors and buttons follow, an editor's own change excepted (no echo); an
36
+ * entry's change reaches the group cell too.
37
+ */
38
+ modelChanged(ids: readonly string[], source: FilterChange['source']): void;
39
+ /**
40
+ * Definitions changed: an editor whose filter definition changed is built again — the group cell's also when its
41
+ * shown entry, that entry's visibility or the group column's own filter changed; buttons and names
42
+ * follow; a column without a filter now (removed, its filter dropped, the group column when grouping ends) loses its
43
+ * kept box text.
44
+ */
45
+ columnsChanged(): void;
46
+ /** The set UI computed the column's labels: its summary is written again, also in the group cell. */
47
+ labelsChanged(id: string): void;
48
+ localeChanged(): void;
49
+ /** `setIcons`: every cell's funnel is decorated again. */
50
+ iconsChanged(): void;
51
+ destroy(): void;
52
+ }
53
+ /** The popup openers of the UI controller. */
54
+ export interface FloatingDeps {
55
+ /** The filter button was clicked: the column's filter popup opens below it, or closes. */
56
+ toggleFilter(id: string, anchor: HTMLElement): void;
57
+ /**
58
+ * A floating renderer's `openFilter()`, as `Grid.showFilter`; `item`: the group popup opens on that picker item (the
59
+ * group cell's boxes).
60
+ */
61
+ showFilter(id: string, item?: string): void;
62
+ /** The grid's overlay host. */
63
+ overlayHost(): HTMLElement;
64
+ }
65
+ /** Call inside the controller's effect scope. */
66
+ export declare function createFloatingCells(host: UiHost, deps: FloatingDeps, group: GroupFilterView): FloatingCells;
@@ -0,0 +1,20 @@
1
+ import type { GridTexts } from '../i18n/texts';
2
+ import { type SimpleKindIo } from './filters/simple';
3
+ import type { Editor, EditorDeps, RestOf } from './floatingTypes';
4
+ /** What differs between the shorthand boxes: the number filter's and the group-size filter's. */
5
+ export interface ShorthandOptions {
6
+ /** The lowest value ↑ / ↓ step to (group sizes: 0); default none. */
7
+ readonly min?: number;
8
+ /** The empty box's placeholder, unless the definition has its own `placeholder`. */
9
+ readonly hint: (t: GridTexts) => string;
10
+ /** The forms the box accepts: its description (`aria-describedby`). */
11
+ readonly help: (t: GridTexts) => string;
12
+ }
13
+ /** The number filter's box. */
14
+ export declare const NUMBER_SHORTHAND: ShorthandOptions;
15
+ /** The group-size filter's box: a count, so ↑ / ↓ never go below 0. */
16
+ export declare const GROUP_SIZE_SHORTHAND: ShorthandOptions;
17
+ /** What the box shows at rest (its stand-in). */
18
+ export declare function shorthandRest(deps: EditorDeps, io: SimpleKindIo<number>, options: ShorthandOptions): RestOf;
19
+ /** The shorthand box: its input and, hidden, the description it points to. */
20
+ export declare function shorthandEditor(deps: EditorDeps, io: SimpleKindIo<number>, options: ShorthandOptions): Editor;
@@ -0,0 +1,82 @@
1
+ import type { ColumnFilterModel, ResolvedFilter } from '../filter/model';
2
+ import type { SetLabel } from '../filter/summary';
3
+ import type { Locale } from '../i18n/texts';
4
+ import type { ColumnInfo } from '../types';
5
+ /** A column's (or a multi filter child's) floating editor: the element in the cell's area and how it follows. */
6
+ export interface Editor {
7
+ readonly el: HTMLElement;
8
+ /** An app's floating renderer draws it with its own controls: the cell shows no clear button. */
9
+ readonly app: boolean;
10
+ /** The applied model (of its slot) changed; `foreign`: not this cell's change, shown even while it applies. */
11
+ setApplied(model: ColumnFilterModel | null, foreign: boolean): void;
12
+ /** The locale, the column's name or its set labels changed. */
13
+ retext(): void;
14
+ /**
15
+ * Focuses its input, when it has an enabled one; `select`: where the selection goes (a stand-in's first use: the
16
+ * caret at the end after a press, all the text after a focus, as the browser does for an input it focuses).
17
+ */
18
+ focus(select?: 'end' | 'all'): void;
19
+ /** A stand-in's: its cell's first use builds the editor, which takes its place and the focus. */
20
+ touch?(how: Touch): void;
21
+ destroy(): void;
22
+ }
23
+ /** How a stand-in's cell was first used: a press on it, or the focus reaching it (Tab, an assistive technology). */
24
+ export type Touch = 'press' | 'focus';
25
+ /**
26
+ * What a grid-built editor shows at rest: its input's text, its placeholder, whether the input is enabled,
27
+ * whether its text is invalid (`aria-invalid`, the red frame: the shorthand box's kept text), and its
28
+ * description (`aria-describedby`: the shorthand box's accepted forms).
29
+ */
30
+ export interface Rest {
31
+ readonly text: string;
32
+ readonly placeholder: string | null;
33
+ readonly editable: boolean;
34
+ readonly invalid?: boolean;
35
+ readonly help?: string;
36
+ }
37
+ /**
38
+ * A shorthand box's kept text and the slot's applied model it was typed against: once the slot holds another
39
+ * model (the filter changed elsewhere, also while the box was away or rebuilt), it ends and the box shows the model.
40
+ */
41
+ export interface Draft {
42
+ readonly text: string;
43
+ readonly model: ColumnFilterModel | null;
44
+ }
45
+ /** What an editor shows for its slot's applied model; null: nothing (a custom kind without renderer and summary). */
46
+ export type RestOf = (model: ColumnFilterModel | null) => Rest | null;
47
+ export interface EditorDeps {
48
+ readonly filter: ResolvedFilter;
49
+ /** Where its last used operator is remembered: the column id, plus a multi filter child's index. */
50
+ readonly key: string;
51
+ /** Last used operators by key (the operator is the last one used, else the default); kept per grid. */
52
+ readonly operators: Map<string, string>;
53
+ /** Per-column box text that applies nothing, by `key`; kept while the grid lives. */
54
+ readonly drafts: Map<string, Draft>;
55
+ locale(): Locale;
56
+ /** The column's header name, for accessible names. */
57
+ name(): string;
58
+ column(): ColumnInfo;
59
+ /** The applied model of its slot. */
60
+ applied(): ColumnFilterModel | null;
61
+ /** Applies its slot's model, source 'floating'. */
62
+ apply(model: ColumnFilterModel | null): void;
63
+ /** A model problem, printed once per column and problem as the API's (an app renderer's `setModel`). */
64
+ problem(problem: string): void;
65
+ showFilter(): void;
66
+ /** The grid's overlay host, for an app renderer's overlays. */
67
+ overlayHost(): HTMLElement;
68
+ /** A set key's label as the set UI computed it; undefined: the default label. */
69
+ label: SetLabel;
70
+ /** A definition problem, printed once (the popup's UI uses the same keys, so it is printed once in all). */
71
+ warn(key: string, message: string): void;
72
+ /** The editors' `tabIndex`: −1 while header focus is on (the grid's keys reach them), else 0. */
73
+ tabIndex(): number;
74
+ /**
75
+ * The group-size box beside a grouped column's: its input's and its stand-in's accessible name and
76
+ * `title` instead of `floatingInput(name)`. Undefined elsewhere. The `label` above is
77
+ * a set key's, hence the longer name.
78
+ */
79
+ inputLabel?(): string;
80
+ /** The same box's class besides `.ig-floating-input` (`.ig-group-size-input`), on its input and its stand-in. */
81
+ readonly inputClass?: string;
82
+ }
@@ -0,0 +1,25 @@
1
+ import type { HeaderIconName, HeaderIcons } from '../types';
2
+ export type IconName = 'menu' | 'filter' | 'filterActive' | 'sortAscending' | 'sortDescending' | 'columnGroupClosed' | 'columnGroupOpened' | 'check' | 'chevronRight' | 'chevronDown' | 'pin' | 'columns' | 'filters' | 'search' | 'close' | 'grip' | 'chevronLeft' | 'sort' | 'group' | 'groupSize' | 'eyeOff' | 'moved';
3
+ export declare const ICONS: Readonly<Record<IconName, string>>;
4
+ /** A decorative icon (`aria-hidden`): the control that holds it carries the accessible name. */
5
+ export declare function icon(name: IconName, className: string): SVGSVGElement;
6
+ /** A small icon button (a bar field's ×, the find box's ‹ ›) of class `className`, drawing `name`; its owner names it. */
7
+ export declare function iconButton(name: IconName, className: string): HTMLButtonElement;
8
+ /**
9
+ * An app's icon (a menu item's, a top bar button's): SVG path data in a 16 × 16 view box, or the element a function
10
+ * makes. Null for none ('' too), for a function making no element and for one that throws (handed to `report`).
11
+ */
12
+ export declare function appIcon(given: unknown, className: string, report: (owner: () => unknown, error: unknown) => void): Element | null;
13
+ /**
14
+ * The sort indicator (`.ig-sort`, with `className`'s classes): the direction's arrow, its path written once sorted
15
+ * (`writePath`), and the priority's text. Hidden, and `aria-hidden`: the owner's accessible name carries the state. The
16
+ * header cells' and the Columns panel rows'.
17
+ */
18
+ export declare function sortIndicator(className?: string): {
19
+ el: HTMLElement;
20
+ index: Text;
21
+ };
22
+ /** The path of a header icon: the column's, else the grid's, else `builtIn` (default: the name's own); '' counts as not set. */
23
+ export declare function headerIcon(name: HeaderIconName, column: HeaderIcons | undefined, grid: HeaderIcons | undefined, builtIn?: string): string;
24
+ /** Writes an icon's path into the first svg path under `el` when it differs from `last`; returns what is now written. */
25
+ export declare function writePath(el: Element, last: string, path: string): string;
@@ -0,0 +1,45 @@
1
+ import type { MenuActionContext, MenuItem } from '../types';
2
+ import type { CloseReason, PopupAnchor, PopupHandle, PopupLayer } from './popup';
3
+ import type { TooltipLayer } from './tooltip';
4
+ export interface MenuOpenOptions {
5
+ kind: 'columnMenu' | 'contextMenu' | 'toolbarMenu';
6
+ column: string | null;
7
+ anchor: PopupAnchor;
8
+ /** Below a button (the header's menu button, the top bar's), or at a point (a right-click). */
9
+ place: 'below' | 'point';
10
+ /** The menu's accessible name. */
11
+ label: string;
12
+ /** What every item's action receives. */
13
+ context: MenuActionContext;
14
+ /** Where a keyboard close returns focus (re-found by column id); default the grid. */
15
+ opener?: () => HTMLElement | null;
16
+ /**
17
+ * Reports a throwing app callback once per callback and kind: `owner` is the callback (an item's
18
+ * `action` or `icon` function), `key` the kind (`'menuAction'`, `'menuIcon'`).
19
+ */
20
+ report(owner: object, key: string, error: unknown): void;
21
+ /**
22
+ * The grid's styled tooltip: an item's `tooltip` shows there under a resting mouse or pen, and is the
23
+ * item's permanent hidden description. Absent (browser tooltips, or a menu opened without a grid): the item's
24
+ * `title`.
25
+ */
26
+ tooltips?: TooltipLayer;
27
+ /** The menu closed (its sub-menus with it), after the layer's own close work. */
28
+ onClose?(how: CloseReason): void;
29
+ /**
30
+ * Runs after a chosen item's action (also when it threw). The menu closed before the action (unless `keepOpen`),
31
+ * so focus went back to the opener, which the action may have removed (the column menu then focuses the grid).
32
+ */
33
+ afterAction?(): void;
34
+ }
35
+ /**
36
+ * Drops leading, trailing and doubled separators, so a builder that removes items leaves no stray lines. Items
37
+ * or built-in tokens (a column menu's defaults).
38
+ */
39
+ export declare function normaliseSeparators<T>(entries: readonly (T | 'separator')[]): (T | 'separator')[];
40
+ /**
41
+ * Opens a menu of resolved entries through the popup layer; null (and nothing opens) when no item is left after the
42
+ * separators are normalised. The returned handle is the top-level menu's: closing it closes its sub-menus. An item's
43
+ * action runs after the menu closed (unless `keepOpen`), with `options.context`; a throw is reported, never rethrown.
44
+ */
45
+ export declare function openMenu(layer: PopupLayer, entries: readonly (MenuItem | 'separator')[], options: MenuOpenOptions): PopupHandle | null;
@@ -0,0 +1,7 @@
1
+ export interface OverlayHost {
2
+ readonly el: HTMLElement;
3
+ /** Moves it to the end of `parent` (the topmost open popup), or of the root with null. */
4
+ place(parent: HTMLElement | null): void;
5
+ }
6
+ /** Call inside the grid UI's effect scope: its scroll listener stops with it. */
7
+ export declare function createOverlayHost(root: HTMLElement): OverlayHost;
@@ -0,0 +1,37 @@
1
+ /** A popup or tooltip keeps this distance from the viewport's edges. */
2
+ export declare const EDGE = 8;
3
+ /**
4
+ * The layout viewport less scrollbars, read once per placement; useWindowSize would add a resize listener per layer.
5
+ */
6
+ export declare function viewportSize(): {
7
+ width: number;
8
+ height: number;
9
+ };
10
+ /**
11
+ * Where a box of `w` × `h` goes at the point (`x`, `y`): right of it, else left of it (its right edge at the point);
12
+ * `below` px under it, else above it (its bottom edge at the point) — each side only when it ends `EDGE` px inside the
13
+ * viewport (`vw` × `vh`). With `below = 0` the context menu's rule.
14
+ */
15
+ export declare function nearPoint(x: number, y: number, w: number, h: number, vw: number, vh: number, below?: number): {
16
+ x: number;
17
+ y: number;
18
+ };
19
+ /**
20
+ * `at` shifted so a box of `w` × `h` stays `edge` px (`EDGE`) inside the viewport (its top-left corner wins when it
21
+ * cannot).
22
+ */
23
+ export declare function intoViewport(at: {
24
+ x: number;
25
+ y: number;
26
+ }, w: number, h: number, vw: number, vh: number, edge?: number): {
27
+ x: number;
28
+ y: number;
29
+ };
30
+ /** `at` shifted so a box of `w` × `h` stays inside `box` (its top-left corner wins when it cannot). */
31
+ export declare function intoBox(at: {
32
+ x: number;
33
+ y: number;
34
+ }, w: number, h: number, box: DOMRectReadOnly): {
35
+ x: number;
36
+ y: number;
37
+ };
@@ -0,0 +1,97 @@
1
+ import type { PopupChange } from '../types';
2
+ import type { OverlayHost } from './overlayHost';
3
+ export type PopupKind = 'filter' | 'columnMenu' | 'contextMenu' | 'chooser' | 'toolbarMenu' | 'subMenu'
4
+ /** A cell editor's popup (`edit/popupHost.ts`): a popup editor's box, an editor's list. */
5
+ | 'editor';
6
+ export type PopupAnchor = {
7
+ element: HTMLElement;
8
+ } | {
9
+ point: {
10
+ x: number;
11
+ y: number;
12
+ };
13
+ }
14
+ /**
15
+ * A box read at every placement (the column chooser's: its header as the grid shows it); unlike an element,
16
+ * nothing of it counts as inside for dismissal, so a click on the header closes the chooser. Null: the anchor
17
+ * is gone (its column hidden), and the popup stays where it is.
18
+ */
19
+ | {
20
+ box: () => DOMRectReadOnly | null;
21
+ };
22
+ /** How a popup closed: Escape (or an item chosen by key), a pointer-down outside, the API or the grid, another popup. */
23
+ export type CloseReason = 'keyboard' | 'pointer' | 'api' | 'replaced';
24
+ export interface PopupOpenOptions {
25
+ kind: PopupKind;
26
+ column: string | null;
27
+ anchor: PopupAnchor;
28
+ /**
29
+ * Below a button, at a point (context menu), beside a menu item (sub-menu), over its anchor (a popup editor: its
30
+ * top-left on the cell's).
31
+ */
32
+ place: 'below' | 'point' | 'beside' | 'over';
33
+ /** True: follows its anchor on scroll and resize; false: closes when something outside it scrolls. */
34
+ follow: boolean;
35
+ /** Tab and Shift+Tab cycle inside. */
36
+ trapFocus: boolean;
37
+ /** `'presentation'`: its content names itself (an editor's list, a listbox). */
38
+ role: 'dialog' | 'menu' | 'presentation';
39
+ /** The accessible name (none for `'presentation'`). */
40
+ label: string;
41
+ /**
42
+ * False: a press outside it leaves it open, its owner deciding what a press does (a popup editor: a
43
+ * press outside the grid keeps it, one on the grid commits it). Default true.
44
+ */
45
+ outsideCloses?: boolean;
46
+ /**
47
+ * A box it is kept inside, read at every placement (a popup editor's: the grid's root, so one whose cell scrolled far
48
+ * out of sight waits at the root's edge); placed below its anchor, it flips above when below
49
+ * doesn't fit in it. The viewport's edges still win.
50
+ */
51
+ within?: () => DOMRectReadOnly | null;
52
+ /** False: opening it moves no focus (its owner focuses its content, or keeps focus where it is). Default true. */
53
+ focus?: boolean;
54
+ /** Resizable; a size the user chose is kept per key while the grid lives. */
55
+ resizableKey?: string;
56
+ /** Where a keyboard close returns focus (re-found by column id); default the parent popup or the grid. */
57
+ opener?: () => HTMLElement | null;
58
+ /** Sub-menus nest in their parent; any other popup replaces the open top-level popup. */
59
+ parent?: PopupHandle;
60
+ onClose?: (how: CloseReason) => void;
61
+ }
62
+ export interface PopupHandle {
63
+ readonly el: HTMLElement;
64
+ readonly isOpen: boolean;
65
+ close(how?: CloseReason): void;
66
+ /**
67
+ * Places it again now, choosing its side again: its owner knows its content changed size (a set list's first
68
+ * values). A size change the owner does not announce (a condition added while typing) is placed by the layer
69
+ * itself, on the side it kept. A popup whose anchor went keeps its place (only shifted into the viewport).
70
+ */
71
+ place(): void;
72
+ }
73
+ export interface PopupLayer {
74
+ open(content: HTMLElement, options: PopupOpenOptions): PopupHandle;
75
+ closeAll(how?: CloseReason): void;
76
+ anyOpen(): boolean;
77
+ /**
78
+ * The grid's columns changed (moved, resized, pinned through the API): an open top-level popup that follows its
79
+ * anchor is placed again in the next frame, with its sub-menus, each on the side it kept.
80
+ */
81
+ requestPlace(): void;
82
+ /** Inside an open popup, or inside an element marked `data-ig-popup-owner`. */
83
+ contains(node: Node | null): boolean;
84
+ /** The topmost open popup's element (where the overlay host goes); null while none is open. */
85
+ top(): HTMLElement | null;
86
+ /** Top-level popups only (sub-menus are not reported). */
87
+ onChange(listener: (event: PopupChange) => void): () => void;
88
+ destroy(): void;
89
+ }
90
+ /**
91
+ * The grid's popup layer: one top-level popup at a time, sub-menus nested in it (a stack, outermost first). While any
92
+ * popup is open, one pointer-down listener (capture) on the document dismisses, one scroll listener (capture, passive)
93
+ * and one resize listener on the window re-place (coalesced per frame) or close; `destroy` closes everything and
94
+ * removes every listener. `report` receives a throwing `onClose` or `opener` (our own UI modules). `overlay`: the
95
+ * grid's overlay host once made, kept as the topmost open popup's last child.
96
+ */
97
+ export declare function createPopupLayer(root: HTMLElement, report: (key: string, error: unknown) => void, refocus?: (opener: HTMLElement | null) => boolean, overlay?: () => OverlayHost | null): PopupLayer;
@@ -0,0 +1,26 @@
1
+ import type { SideBarZones } from '../interact/header';
2
+ import type { GridOptions } from '../types';
3
+ import type { UiHost } from './controller';
4
+ import type { FilterHost } from './filters/host';
5
+ import type { PopupLayer } from './popup';
6
+ export interface SideBar {
7
+ /** Replaces the side bar's options (`setSideBar`); a falsy value removes it. Widths the user chose stay. */
8
+ set(options: GridOptions['sideBar']): void;
9
+ /** Opens a panel by id (the open one closes); an unknown id changes nothing. */
10
+ open(id: string): void;
11
+ close(): void;
12
+ openId(): string | null;
13
+ /** The shown side bar and the drop zones of its open columns panel (`HeaderHost.sideBarZones`). */
14
+ zones(): SideBarZones | null;
15
+ columnsChanged(): void;
16
+ filtersChanged(ids: readonly string[]): void;
17
+ sourceChanged(): void;
18
+ localeChanged(): void;
19
+ destroy(): void;
20
+ }
21
+ export interface SideBarDeps {
22
+ popups(): PopupLayer;
23
+ filters(): FilterHost;
24
+ }
25
+ /** Call inside the controller's effect scope. */
26
+ export declare function createSideBar(host: UiHost, deps: SideBarDeps): SideBar;