@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.
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +5533 -2
- package/THIRD_PARTY_NOTICES.md +10 -0
- package/dist/engine/clipboard/copy.d.ts +40 -0
- package/dist/engine/clipboard/options.d.ts +16 -0
- package/dist/engine/clipboard/text.d.ts +32 -0
- package/dist/engine/columns/autosize.d.ts +43 -0
- package/dist/engine/columns/dataType.d.ts +30 -0
- package/dist/engine/columns/fold.d.ts +48 -0
- package/dist/engine/columns/layout.d.ts +150 -0
- package/dist/engine/columns/model.d.ts +369 -0
- package/dist/engine/columns/query.d.ts +16 -0
- package/dist/engine/columns/tooltips.d.ts +27 -0
- package/dist/engine/data/client/clientSource.d.ts +151 -0
- package/dist/engine/data/client/columnFilters.d.ts +106 -0
- package/dist/engine/data/client/descendants.d.ts +35 -0
- package/dist/engine/data/client/diff.d.ts +23 -0
- package/dist/engine/data/client/fields.d.ts +70 -0
- package/dist/engine/data/client/filter.d.ts +95 -0
- package/dist/engine/data/client/flatten.d.ts +141 -0
- package/dist/engine/data/client/groupSize.d.ts +14 -0
- package/dist/engine/data/client/hierarchy.d.ts +85 -0
- package/dist/engine/data/client/order.d.ts +32 -0
- package/dist/engine/data/client/pipeline.d.ts +277 -0
- package/dist/engine/data/client/remap.d.ts +33 -0
- package/dist/engine/data/client/trees.d.ts +41 -0
- package/dist/engine/data/client/types.d.ts +173 -0
- package/dist/engine/data/memory/generate.d.ts +36 -0
- package/dist/engine/data/memory/memoryDatasource.d.ts +46 -0
- package/dist/engine/data/rowKey.d.ts +15 -0
- package/dist/engine/data/server/contract.d.ts +64 -0
- package/dist/engine/data/server/expansion.d.ts +35 -0
- package/dist/engine/data/server/levelStore.d.ts +99 -0
- package/dist/engine/data/server/loader.d.ts +128 -0
- package/dist/engine/data/server/reader.d.ts +88 -0
- package/dist/engine/data/server/response.d.ts +31 -0
- package/dist/engine/data/server/serverSource.d.ts +130 -0
- package/dist/engine/data/shared/aggregate.d.ts +12 -0
- package/dist/engine/data/shared/columnFilter.d.ts +19 -0
- package/dist/engine/data/shared/compare.d.ts +12 -0
- package/dist/engine/data/shared/dateParts.d.ts +19 -0
- package/dist/engine/data/shared/distinct.d.ts +30 -0
- package/dist/engine/data/shared/filterRecord.d.ts +7 -0
- package/dist/engine/data/shared/keys.d.ts +17 -0
- package/dist/engine/data/shared/quickFilter.d.ts +17 -0
- package/dist/engine/data/shared/sourceUtils.d.ts +11 -0
- package/dist/engine/data/shared/splice.d.ts +9 -0
- package/dist/engine/detail/builds.d.ts +26 -0
- package/dist/engine/detail/content.d.ts +24 -0
- package/dist/engine/detail/controller.d.ts +176 -0
- package/dist/engine/detail/events.d.ts +11 -0
- package/dist/engine/detail/follow.d.ts +56 -0
- package/dist/engine/detail/layer.d.ts +119 -0
- package/dist/engine/detail/live.d.ts +96 -0
- package/dist/engine/detail/options.d.ts +53 -0
- package/dist/engine/detail/state.d.ts +140 -0
- package/dist/engine/edit/clear.d.ts +20 -0
- package/dist/engine/edit/editing.d.ts +4 -0
- package/dist/engine/edit/editors/date.d.ts +3 -0
- package/dist/engine/edit/editors/index.d.ts +23 -0
- package/dist/engine/edit/editors/internals.d.ts +25 -0
- package/dist/engine/edit/editors/largeText.d.ts +2 -0
- package/dist/engine/edit/editors/number.d.ts +4 -0
- package/dist/engine/edit/editors/select.d.ts +2 -0
- package/dist/engine/edit/editors/text.d.ts +15 -0
- package/dist/engine/edit/fill.d.ts +47 -0
- package/dist/engine/edit/fillHandle.d.ts +66 -0
- package/dist/engine/edit/fillValues.d.ts +15 -0
- package/dist/engine/edit/operations.d.ts +68 -0
- package/dist/engine/edit/paste.d.ts +23 -0
- package/dist/engine/edit/pastePlan.d.ts +17 -0
- package/dist/engine/edit/popupHost.d.ts +63 -0
- package/dist/engine/edit/session.d.ts +52 -0
- package/dist/engine/edit/types.d.ts +234 -0
- package/dist/engine/edit/undo.d.ts +38 -0
- package/dist/engine/edit/validation.d.ts +10 -0
- package/dist/engine/edit/values.d.ts +38 -0
- package/dist/engine/export/columns.d.ts +19 -0
- package/dist/engine/export/deliver.d.ts +47 -0
- package/dist/engine/export/dsv.d.ts +2 -0
- package/dist/engine/export/expanded.d.ts +69 -0
- package/dist/engine/export/export.d.ts +25 -0
- package/dist/engine/export/headers.d.ts +15 -0
- package/dist/engine/export/options.d.ts +19 -0
- package/dist/engine/export/plan.d.ts +43 -0
- package/dist/engine/export/values.d.ts +33 -0
- package/dist/engine/export/walk.d.ts +31 -0
- package/dist/engine/export/writer.d.ts +62 -0
- package/dist/engine/export/xlsx/cells.d.ts +31 -0
- package/dist/engine/export/xlsx/index.d.ts +12 -0
- package/dist/engine/export/xlsx/parts.d.ts +36 -0
- package/dist/engine/export/xlsx/sheet.d.ts +30 -0
- package/dist/engine/export/xlsx/styles.d.ts +15 -0
- package/dist/engine/export/xlsx/table.d.ts +8 -0
- package/dist/engine/export/xlsx/zip.d.ts +24 -0
- package/dist/engine/filter/groupFilter.d.ts +28 -0
- package/dist/engine/filter/model.d.ts +235 -0
- package/dist/engine/filter/shorthand.d.ts +36 -0
- package/dist/engine/filter/state.d.ts +76 -0
- package/dist/engine/filter/summary.d.ts +16 -0
- package/dist/engine/filter/values.d.ts +40 -0
- package/dist/engine/find/index.d.ts +94 -0
- package/dist/engine/find/match.d.ts +38 -0
- package/dist/engine/find/model.d.ts +115 -0
- package/dist/engine/grid.d.ts +42 -0
- package/dist/engine/i18n/numbers.d.ts +34 -0
- package/dist/engine/i18n/texts.d.ts +306 -0
- package/dist/engine/interact/autoScroll.d.ts +11 -0
- package/dist/engine/interact/body.d.ts +41 -0
- package/dist/engine/interact/focus.d.ts +158 -0
- package/dist/engine/interact/header.d.ts +216 -0
- package/dist/engine/interact/host.d.ts +400 -0
- package/dist/engine/interact/keyboard.d.ts +20 -0
- package/dist/engine/interact/menuKey.d.ts +7 -0
- package/dist/engine/interact/own.d.ts +2 -0
- package/dist/engine/interact/ranges.d.ts +68 -0
- package/dist/engine/interact/rowSelection.d.ts +53 -0
- package/dist/engine/interact/shortcut.d.ts +21 -0
- package/dist/engine/interact/tooltips.d.ts +63 -0
- package/dist/engine/measure.d.ts +30 -0
- package/dist/engine/render/cells.d.ts +322 -0
- package/dist/engine/render/columns.d.ts +28 -0
- package/dist/engine/render/dom.d.ts +24 -0
- package/dist/engine/render/flash.d.ts +74 -0
- package/dist/engine/render/groupCell.d.ts +50 -0
- package/dist/engine/render/groupPanel.d.ts +21 -0
- package/dist/engine/render/header.d.ts +162 -0
- package/dist/engine/render/overlay.d.ts +15 -0
- package/dist/engine/render/pinnedRows.d.ts +106 -0
- package/dist/engine/render/rowPool.d.ts +3 -0
- package/dist/engine/render/scrollbars.d.ts +77 -0
- package/dist/engine/render/strategy.d.ts +397 -0
- package/dist/engine/reportError.d.ts +7 -0
- package/dist/engine/rowdrag/controller.d.ts +80 -0
- package/dist/engine/rowdrag/events.d.ts +17 -0
- package/dist/engine/rowdrag/gesture.d.ts +33 -0
- package/dist/engine/rowdrag/keys.d.ts +21 -0
- package/dist/engine/rowdrag/model.d.ts +67 -0
- package/dist/engine/rowdrag/options.d.ts +34 -0
- package/dist/engine/rowdrag/rows.d.ts +61 -0
- package/dist/engine/rowdrag/target.d.ts +59 -0
- package/dist/engine/rowdrag/zones.d.ts +79 -0
- package/dist/engine/schedule.d.ts +29 -0
- package/dist/engine/selection/aggregate.d.ts +30 -0
- package/dist/engine/selection/options.d.ts +7 -0
- package/dist/engine/selection/rangeRows.d.ts +19 -0
- package/dist/engine/selection/ranges.d.ts +114 -0
- package/dist/engine/selection/rows.d.ts +207 -0
- package/dist/engine/source.d.ts +225 -0
- package/dist/engine/synthetic.d.ts +28 -0
- package/dist/engine/table/cells.d.ts +52 -0
- package/dist/engine/table/headers.d.ts +20 -0
- package/dist/engine/table/host.d.ts +65 -0
- package/dist/engine/table/job.d.ts +21 -0
- package/dist/engine/table/rows.d.ts +99 -0
- package/dist/engine/table/slicer.d.ts +54 -0
- package/dist/engine/table/takes.d.ts +145 -0
- package/dist/engine/types.d.ts +2950 -0
- package/dist/engine/ui/announce.d.ts +7 -0
- package/dist/engine/ui/chooser.d.ts +19 -0
- package/dist/engine/ui/columnList.d.ts +41 -0
- package/dist/engine/ui/columnMenu.d.ts +96 -0
- package/dist/engine/ui/columnsPanel.d.ts +16 -0
- package/dist/engine/ui/contextMenu.d.ts +48 -0
- package/dist/engine/ui/controller.d.ts +295 -0
- package/dist/engine/ui/filters/apply.d.ts +53 -0
- package/dist/engine/ui/filters/custom.d.ts +3 -0
- package/dist/engine/ui/filters/date.d.ts +12 -0
- package/dist/engine/ui/filters/host.d.ts +102 -0
- package/dist/engine/ui/filters/multi.d.ts +6 -0
- package/dist/engine/ui/filters/number.d.ts +15 -0
- package/dist/engine/ui/filters/numberMask.d.ts +15 -0
- package/dist/engine/ui/filters/set.d.ts +3 -0
- package/dist/engine/ui/filters/simple.d.ts +52 -0
- package/dist/engine/ui/filters/text.d.ts +5 -0
- package/dist/engine/ui/filtersPanel.d.ts +18 -0
- package/dist/engine/ui/floating.d.ts +66 -0
- package/dist/engine/ui/floatingShorthand.d.ts +20 -0
- package/dist/engine/ui/floatingTypes.d.ts +82 -0
- package/dist/engine/ui/icons.d.ts +25 -0
- package/dist/engine/ui/menu.d.ts +45 -0
- package/dist/engine/ui/overlayHost.d.ts +7 -0
- package/dist/engine/ui/place.d.ts +37 -0
- package/dist/engine/ui/popup.d.ts +97 -0
- package/dist/engine/ui/sideBar.d.ts +26 -0
- package/dist/engine/ui/statusBar.d.ts +29 -0
- package/dist/engine/ui/toolbar/buttons.d.ts +21 -0
- package/dist/engine/ui/toolbar/chipState.d.ts +52 -0
- package/dist/engine/ui/toolbar/chips.d.ts +23 -0
- package/dist/engine/ui/toolbar/findBox.d.ts +10 -0
- package/dist/engine/ui/toolbar/quickFilterBox.d.ts +12 -0
- package/dist/engine/ui/toolbar/registry.d.ts +5 -0
- package/dist/engine/ui/toolbar/toolbar.d.ts +31 -0
- package/dist/engine/ui/toolbar/types.d.ts +23 -0
- package/dist/engine/ui/tooltip.d.ts +34 -0
- package/dist/engine/ui/virtualList.d.ts +35 -0
- package/dist/engine/viewport/heightView.d.ts +62 -0
- package/dist/engine/viewport/heights.d.ts +39 -0
- package/dist/engine/viewport/intervals.d.ts +19 -0
- package/dist/engine/viewport/range.d.ts +51 -0
- package/dist/engine/viewport/scroll.d.ts +45 -0
- package/dist/engine/viewport/stack.d.ts +160 -0
- package/dist/grid-C34VEap6.js +32310 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1273 -0
- package/dist/ingrid.css +1 -0
- package/dist/internal.d.ts +13 -0
- package/dist/internal.js +1 -0
- package/dist/locale/de.d.ts +4 -0
- package/dist/locale/de.js +222 -0
- package/dist/themes/primevue.css +63 -0
- package/dist/themes/tailwind.css +68 -0
- package/dist/vue/InGrid.vue.d.ts +263 -0
- package/dist/vue/stableOptions.d.ts +8 -0
- package/dist/vue/useClientSource.d.ts +28 -0
- package/dist/vue/useServerSource.d.ts +8 -0
- package/dist/vue/vueRenderer.d.ts +164 -0
- package/dist/xlsx-59umS_n_.js +325 -0
- package/package.json +78 -5
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { type GridTexts } from '../i18n/texts';
|
|
2
|
+
import { type ViewportSource } from '../source';
|
|
3
|
+
import type { ApplyColumnStateOptions, ColumnDef, ColumnDefaults, ColumnGroupDef, ColumnGroupState, ColumnNode, ColumnState, GroupColumnOptions, PinnedSide, RowNumbersOptions, SortDirection, SortModelItem } from '../types';
|
|
4
|
+
/** Reserved id of the grid-owned row-number column. */
|
|
5
|
+
export declare const ROW_NUMBER_ID = "ig:row-number";
|
|
6
|
+
/** Reserved id of the grid-owned selection column. */
|
|
7
|
+
export declare const SELECTION_ID = "ig:selection";
|
|
8
|
+
/** Reserved id of the grid-owned row-drag handle column. */
|
|
9
|
+
export declare const ROW_DRAG_ID = "ig:row-drag";
|
|
10
|
+
/** Reserved id of the grid-owned detail toggle column. */
|
|
11
|
+
export declare const DETAIL_ID = "ig:detail";
|
|
12
|
+
/** Reserved id of the grid-owned group column. */
|
|
13
|
+
export declare const GROUP_ID = "ig:group";
|
|
14
|
+
export declare const DEFAULT_WIDTH = 200;
|
|
15
|
+
export declare const DEFAULT_MIN_WIDTH = 40;
|
|
16
|
+
export interface GroupRef {
|
|
17
|
+
id: string;
|
|
18
|
+
headerName: string;
|
|
19
|
+
headerClass?: string;
|
|
20
|
+
/** `ColumnGroupDef.chooser: false`: the group and its columns are not listed by the column list. */
|
|
21
|
+
chooser?: false;
|
|
22
|
+
/** `ColumnGroupDef.stickyLabel: false`: the label keeps its place while the cell scrolls out. */
|
|
23
|
+
stickyLabel?: false;
|
|
24
|
+
/** `ColumnGroupDef.columnGroupShow`: when the group shows inside its parent group. */
|
|
25
|
+
show?: 'open' | 'closed';
|
|
26
|
+
/** `ColumnGroupDef.headerTooltip`. */
|
|
27
|
+
headerTooltip?: ColumnGroupDef['headerTooltip'];
|
|
28
|
+
}
|
|
29
|
+
/** A column group of the current definitions, in definition order. */
|
|
30
|
+
interface GroupNode {
|
|
31
|
+
id: string;
|
|
32
|
+
/** `ColumnGroupDef.openByDefault === true`. */
|
|
33
|
+
openByDefault: boolean;
|
|
34
|
+
}
|
|
35
|
+
export type ColumnKind = 'data' | 'rowNumber' | 'group' | 'selection' | 'rowDrag' | 'detail';
|
|
36
|
+
/**
|
|
37
|
+
* The row-number, row-drag handle, detail toggle and selection column: grid-owned, no user column (no sort, move, pin,
|
|
38
|
+
* hide, filter, menu; never in ranges, copies or exports).
|
|
39
|
+
*/
|
|
40
|
+
export declare function isGridOwnedKind(kind: ColumnKind): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Ids of the grid-owned columns that always lead the order (row numbers, the handle column, the toggle column, the
|
|
43
|
+
* selection column).
|
|
44
|
+
*/
|
|
45
|
+
export declare function isLeading(id: string): boolean;
|
|
46
|
+
/** What the group column's cells draw. */
|
|
47
|
+
export interface GroupColumnSpec {
|
|
48
|
+
/** Grouped fields, outermost first (empty in tree mode). */
|
|
49
|
+
fields: readonly string[];
|
|
50
|
+
/** The grouped columns' `format`, by level. */
|
|
51
|
+
formats: readonly (ColumnDef['format'] | undefined)[];
|
|
52
|
+
/** Tree mode: the label field (`groupColumn.field`), else null. */
|
|
53
|
+
treeField: string | null;
|
|
54
|
+
showCount: boolean;
|
|
55
|
+
}
|
|
56
|
+
/** The row-number column's cell value: `rowNumbers.value`, `defaultRowNumber` or `sourceRowNumber`. */
|
|
57
|
+
export type RowNumberValue = (row: number, source: ViewportSource) => string | number;
|
|
58
|
+
/** A leaf column of the current definitions. */
|
|
59
|
+
export interface Leaf {
|
|
60
|
+
id: string;
|
|
61
|
+
kind: ColumnKind;
|
|
62
|
+
/** The definition merged over `defaultColumn` (data columns) or synthesised (row numbers, group column). */
|
|
63
|
+
def: ColumnDef;
|
|
64
|
+
/** Ancestor groups, outermost first. */
|
|
65
|
+
groups: GroupRef[];
|
|
66
|
+
/** Cell value of the row-number column. */
|
|
67
|
+
value?: RowNumberValue;
|
|
68
|
+
/** The group column's spec. */
|
|
69
|
+
group?: GroupColumnSpec;
|
|
70
|
+
}
|
|
71
|
+
export interface LeafState {
|
|
72
|
+
width: number;
|
|
73
|
+
flex: number | null;
|
|
74
|
+
hidden: boolean;
|
|
75
|
+
pinned: PinnedSide | null;
|
|
76
|
+
sort: SortDirection | null;
|
|
77
|
+
sortIndex: number | null;
|
|
78
|
+
rowGroup: number | null;
|
|
79
|
+
aggregate: string | null;
|
|
80
|
+
}
|
|
81
|
+
/** The state-seeding values of a definition, kept per id to detect changed definitions. */
|
|
82
|
+
interface Initial {
|
|
83
|
+
width: number;
|
|
84
|
+
flex: number | null;
|
|
85
|
+
pinned: PinnedSide | null;
|
|
86
|
+
hidden: boolean;
|
|
87
|
+
sort: SortDirection | null;
|
|
88
|
+
rowGroup: number | null;
|
|
89
|
+
aggregate: string | null;
|
|
90
|
+
}
|
|
91
|
+
export declare function isGroup(node: ColumnNode): node is ColumnGroupDef;
|
|
92
|
+
/**
|
|
93
|
+
* `rowNumbers.value: 'source'`: a client row's place in the rows array, from 1 (`sourceIndexOf + 1`); a
|
|
94
|
+
* group row or filler its place among its siblings, from 1, so opening or closing a group renumbers nothing.
|
|
95
|
+
* Module-level like `defaultRowNumber`; the export knows it by identity, as rows inside closed groups have no
|
|
96
|
+
* display row to ask about.
|
|
97
|
+
*/
|
|
98
|
+
export declare function sourceRowNumber(row: number, source: ViewportSource): string | number;
|
|
99
|
+
/**
|
|
100
|
+
* The row-number column is shown and acts as the row headers of cell selection — `selects` is not false.
|
|
101
|
+
* Cell selection itself is the caller's to check.
|
|
102
|
+
*/
|
|
103
|
+
export declare function rowNumbersSelect(rowNumbers: boolean | RowNumbersOptions | null | undefined): boolean;
|
|
104
|
+
/** What the model needs to know of the row selection's column (`resolveRowSelection`, decided by the grid). */
|
|
105
|
+
export interface SelectionColumnSpec {
|
|
106
|
+
width: number;
|
|
107
|
+
/** The row boxes sit in the group column while there is one: the selection column is absent then. */
|
|
108
|
+
hideWithGroup: boolean;
|
|
109
|
+
}
|
|
110
|
+
/** What the model needs to know of the row-drag handle column (`RowDragController.columnSpec`). */
|
|
111
|
+
export interface RowDragColumnSpec {
|
|
112
|
+
width: number;
|
|
113
|
+
}
|
|
114
|
+
/** What the model needs to know of the detail toggle column (`DetailController.columnSpec`). */
|
|
115
|
+
export interface DetailColumnSpec {
|
|
116
|
+
width: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Applies the keys present in `entry`: only `width` applies to the row-number column, nothing to the
|
|
120
|
+
* selection column; the group column takes no `hidden`, `rowGroup` or `aggregate`.
|
|
121
|
+
*/
|
|
122
|
+
export declare function patchState(state: LeafState, entry: Omit<ColumnState, 'id'>, kind: ColumnKind): void;
|
|
123
|
+
export interface ConfigureResult {
|
|
124
|
+
/** `getState()` differs from before. */
|
|
125
|
+
stateChanged: boolean;
|
|
126
|
+
/** Leaf ids defined more than once (the later definitions are ignored). */
|
|
127
|
+
duplicates: string[];
|
|
128
|
+
/** What is wrong with the `{ id: 'ig:group' }` marker: other keys on it, or inside a column group. */
|
|
129
|
+
markerIssues: ('keys' | 'nested')[];
|
|
130
|
+
/** `groupHierarchy` entries that name no date part (skipped). */
|
|
131
|
+
unknownParts: string[];
|
|
132
|
+
}
|
|
133
|
+
/** What a date part column's header and month names are made of — the grid's texts and language. */
|
|
134
|
+
export interface DateNames {
|
|
135
|
+
texts: GridTexts;
|
|
136
|
+
lang: string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Column definitions plus user state: pure data, no DOM. Mutators return whether the state changed;
|
|
140
|
+
* `version` moves on every change, widths included; no engine reader today (`queryVersion` is what `syncQuery()` reads).
|
|
141
|
+
*/
|
|
142
|
+
export declare class ColumnModel {
|
|
143
|
+
version: number;
|
|
144
|
+
/**
|
|
145
|
+
* Moves with `version` on every change except a width-only one (`setWidth`: live resize, auto-size), so the grid
|
|
146
|
+
* derives the row query only when it may have changed; widths are not part of the query (`deriveQuery`).
|
|
147
|
+
*/
|
|
148
|
+
queryVersion: number;
|
|
149
|
+
protected leaves: Map<string, Leaf>;
|
|
150
|
+
/** Present ids in definition order (row numbers, then the group column, first). */
|
|
151
|
+
protected defOrder: string[];
|
|
152
|
+
/** The data leaves before the `{ id: 'ig:group' }` marker; null without one. */
|
|
153
|
+
protected groupSlot: number | null;
|
|
154
|
+
/** Each column with date parts → its part columns' ids, in `groupHierarchy` order. */
|
|
155
|
+
protected datePartIds: Map<string, readonly string[]>;
|
|
156
|
+
/** Present ids in the user's full order (row numbers first). */
|
|
157
|
+
protected order: string[];
|
|
158
|
+
/** State of every id ever seen; removed ids keep theirs. */
|
|
159
|
+
protected states: Map<string, LeafState>;
|
|
160
|
+
/** Seeding values from the previous definitions, per id ever seen. */
|
|
161
|
+
protected initials: Map<string, Initial>;
|
|
162
|
+
/** applyColumnState entries for ids not seen yet; applied when the id appears. */
|
|
163
|
+
protected pending: Map<string, Omit<ColumnState, "id">>;
|
|
164
|
+
/** The group column's options (`GridOptions.groupColumn`). */
|
|
165
|
+
protected groupOptions: GroupColumnOptions;
|
|
166
|
+
/** The `defaultColumn` of the last `configure`: the group column's fallbacks (`GROUP_FROM_DEFAULTS`). */
|
|
167
|
+
protected columnDefaults: ColumnDefaults | undefined;
|
|
168
|
+
/** The selection column wanted by the row selection options; null: none. */
|
|
169
|
+
protected selectionSpec: SelectionColumnSpec | null;
|
|
170
|
+
protected rowDragSpec: RowDragColumnSpec | null;
|
|
171
|
+
/** The toggle column wanted by the detail options (`toggle: 'column'`); null: none. */
|
|
172
|
+
protected detailSpec: DetailColumnSpec | null;
|
|
173
|
+
/** The group column's header text when `groupColumn.headerName` is not set (the grid's locale). */
|
|
174
|
+
protected groupHeader: string;
|
|
175
|
+
/** Backs `folding`. */
|
|
176
|
+
private anyGroupShow;
|
|
177
|
+
/** Backs `hasTooltips`. */
|
|
178
|
+
private anyTooltip;
|
|
179
|
+
/** Backs `hasCellTooltips`. */
|
|
180
|
+
private anyCellTooltip;
|
|
181
|
+
/** The column groups of the current definitions, in definition order, each id once. */
|
|
182
|
+
protected groupNodes: GroupNode[];
|
|
183
|
+
/** Open state of every group id ever seen; ids of earlier definitions keep theirs (as `states`). */
|
|
184
|
+
protected groupStates: Map<string, boolean>;
|
|
185
|
+
/** The last definitions' derived group ids (no `groupId`) by their place `at`: a renamed group keeps its state. */
|
|
186
|
+
protected derivedAt: Map<string, string>;
|
|
187
|
+
/** The current groups stored open; rebuilt only when a state or the definitions change. */
|
|
188
|
+
protected openSet: ReadonlySet<string>;
|
|
189
|
+
/**
|
|
190
|
+
* Some grouped column or child group of the definitions has a `columnGroupShow`. Only then does the layout
|
|
191
|
+
* run the fold step (no work for grids that do not fold).
|
|
192
|
+
*/
|
|
193
|
+
get folding(): boolean;
|
|
194
|
+
/**
|
|
195
|
+
* A column of the current definitions (hidden ones too), a column group or the group column's options
|
|
196
|
+
* (over `defaultColumn`) have a tooltip or a header tooltip. Only then does the grid listen for hovers (a
|
|
197
|
+
* grid without tooltips gets no tooltip listener).
|
|
198
|
+
*/
|
|
199
|
+
hasTooltips(): boolean;
|
|
200
|
+
/**
|
|
201
|
+
* As `hasTooltips`, cell tooltips only (`tooltip`, not `headerTooltip`). Only then do browser tooltips give
|
|
202
|
+
* the body cells a `title`, so a grid with header tooltips alone binds its cells as without any.
|
|
203
|
+
*/
|
|
204
|
+
hasCellTooltips(): boolean;
|
|
205
|
+
/** Tree mode: `groupColumn.field` is set. */
|
|
206
|
+
get treeMode(): boolean;
|
|
207
|
+
/** The group column hosts the grouped columns' filters; never in tree mode. */
|
|
208
|
+
get groupedFilters(): boolean;
|
|
209
|
+
/** `groupedFilters` is set but tree mode ignores it (the grid hints once). */
|
|
210
|
+
get groupedFiltersIgnored(): boolean;
|
|
211
|
+
/** `groupColumn.filter` is the group-size kind but tree mode ignores it: no filter (`filterColumns` reports it). */
|
|
212
|
+
get groupSizeIgnored(): boolean;
|
|
213
|
+
/** The column is hidden (a defined column; false for an unknown id). */
|
|
214
|
+
isHidden(id: string): boolean;
|
|
215
|
+
/** The group is stored open (false for an unknown id). */
|
|
216
|
+
isGroupOpen(id: string): boolean;
|
|
217
|
+
/** The current groups stored open, also those that cannot fold now. */
|
|
218
|
+
openGroups(): ReadonlySet<string>;
|
|
219
|
+
/** Every group of the current definitions with its stored state, in definition order. */
|
|
220
|
+
groupState(): ColumnGroupState[];
|
|
221
|
+
/**
|
|
222
|
+
* Stores the listed groups' states: ids not in the current definitions are ignored, the first entry of an id wins.
|
|
223
|
+
* Returns the groups whose state changed, in definition order. A fold is a layout change: `version` moves, never
|
|
224
|
+
* `queryVersion` (the query does not depend on it, and the quick filter searches what is not hidden).
|
|
225
|
+
*/
|
|
226
|
+
setGroupOpen(entries: readonly ColumnGroupState[]): ColumnGroupState[];
|
|
227
|
+
/** Every current group back to its `openByDefault`; returns what changed, as `setGroupOpen`. */
|
|
228
|
+
resetGroupState(): ColumnGroupState[];
|
|
229
|
+
configure(nodes: readonly ColumnNode[], defaults: ColumnDefaults | undefined, rowNumbers: boolean | RowNumbersOptions | undefined, groupColumn?: GroupColumnOptions, groupHeader?: string, selectionColumn?: SelectionColumnSpec | null, rowDragColumn?: RowDragColumnSpec | null, detailColumn?: DetailColumnSpec | null, dateNames?: DateNames): ConfigureResult;
|
|
230
|
+
/** Present leaves with their state, in the user's full order. */
|
|
231
|
+
entries(): {
|
|
232
|
+
leaf: Leaf;
|
|
233
|
+
state: Readonly<LeafState>;
|
|
234
|
+
}[];
|
|
235
|
+
leaf(id: string): Leaf | undefined;
|
|
236
|
+
/** Present leaves in definition order (row numbers, then the group column, first); user moves do not change it. */
|
|
237
|
+
definedLeaves(): Leaf[];
|
|
238
|
+
has(id: string): boolean;
|
|
239
|
+
/** The selection, handle and toggle columns have no state of their own: they are left out. */
|
|
240
|
+
getState(): ColumnState[];
|
|
241
|
+
/** Fixed width (clears flex); used by resizing and auto-size. Moves `version` only, not `queryVersion`. */
|
|
242
|
+
setWidth(id: string, width: number): boolean;
|
|
243
|
+
/** Partial entries, `order`, `defaults`; unknown ids are remembered without their order. */
|
|
244
|
+
apply(entries: readonly ColumnState[], options?: ApplyColumnStateOptions): boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Back to the definitions' initial values and definition order; removed columns get their definition's sort,
|
|
247
|
+
* grouping and aggregation back (their width, pinning and hiding stay remembered). Entries kept for never-seen
|
|
248
|
+
* ids lose their sort, grouping and aggregation, so the definitions decide when the id appears.
|
|
249
|
+
*/
|
|
250
|
+
reset(): boolean;
|
|
251
|
+
/** Columns with a sort, by sort index. */
|
|
252
|
+
sortModel(): SortModelItem[];
|
|
253
|
+
/**
|
|
254
|
+
* Replaces the sort model; unlisted columns lose their sort, removed and never-seen ones too. The first
|
|
255
|
+
* entry of an id wins.
|
|
256
|
+
*/
|
|
257
|
+
setSortModel(model: readonly SortModelItem[]): boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Header click: asc → desc → none; `multi` (Shift) keeps the other sorted columns; a sorted one that
|
|
260
|
+
* stays sorted moves to the end.
|
|
261
|
+
*/
|
|
262
|
+
cycleSort(id: string, multi: boolean): boolean;
|
|
263
|
+
/** The grouped data columns, outermost first (none in tree mode). */
|
|
264
|
+
rowGroups(): string[];
|
|
265
|
+
/** A present data column that may be grouped (not `groupable: false`, not in tree mode). */
|
|
266
|
+
groupable(id: string): boolean;
|
|
267
|
+
/**
|
|
268
|
+
* Replaces the grouping; ids that cannot group are skipped, the first entry of an id wins; removed
|
|
269
|
+
* and never-seen ids lose theirs. A no-op returning false in tree mode.
|
|
270
|
+
*/
|
|
271
|
+
setRowGroups(ids: readonly string[]): boolean;
|
|
272
|
+
/**
|
|
273
|
+
* Group panel drop: groups `id` at `index` of the grouping, or moves it there. A gesture, not a replacement:
|
|
274
|
+
* removed and never-seen ids keep their remembered grouping.
|
|
275
|
+
*/
|
|
276
|
+
groupAt(id: string, index: number): boolean;
|
|
277
|
+
/** Chip removal: takes `id` out of the grouping; other ids keep theirs, removed ones included. */
|
|
278
|
+
ungroup(id: string): boolean;
|
|
279
|
+
/** Remove-then-insert of user ids at `toIndex` of the remaining order without the row numbers. */
|
|
280
|
+
move(ids: readonly string[], toIndex: number): boolean;
|
|
281
|
+
/** Drag and drop: moves user ids next to an anchor (or to the end) and pins them, in one change. */
|
|
282
|
+
place(ids: readonly string[], anchor: {
|
|
283
|
+
before: string;
|
|
284
|
+
} | {
|
|
285
|
+
after: string;
|
|
286
|
+
} | null, pinned: PinnedSide | null): boolean;
|
|
287
|
+
setPinned(ids: readonly string[], side: PinnedSide | null): boolean;
|
|
288
|
+
setHidden(ids: readonly string[], hidden: boolean): boolean;
|
|
289
|
+
/** The sort model is replaced: every column loses its sort, removed and never-seen ones included. */
|
|
290
|
+
private clearSorts;
|
|
291
|
+
/** The present data columns are grouped as `ids` lists them (first entry wins); nothing else changes. */
|
|
292
|
+
/** The present leaf `state` belongs to; null for a remembered state of a removed leaf. */
|
|
293
|
+
private idOfState;
|
|
294
|
+
/** Each grouped column's `appeared` parts, in their order, moved right before it. */
|
|
295
|
+
private placeParts;
|
|
296
|
+
private regroup;
|
|
297
|
+
/** Present data ids, deduplicated, in the given order. */
|
|
298
|
+
private dataIds;
|
|
299
|
+
/** Present ids the user may move and pin (data columns and the group column), deduplicated. */
|
|
300
|
+
private movableIds;
|
|
301
|
+
/** Replaces the order; true (and version moved) when it differs. */
|
|
302
|
+
private setOrder;
|
|
303
|
+
/** Every change but a width-only one: the layout and the row query may both depend on it. */
|
|
304
|
+
private bump;
|
|
305
|
+
private finish;
|
|
306
|
+
/**
|
|
307
|
+
* From `configure`: the new definitions' groups. A derived id (no `groupId`; the id holds the header name)
|
|
308
|
+
* that was not in the previous definitions takes the state of their derived id at the same place, even over a state
|
|
309
|
+
* it kept from earlier ones: a renamed group keeps its state, and a language switch and back keeps a toggle made in
|
|
310
|
+
* between. Any other id without a stored state starts at its `openByDefault`; a
|
|
311
|
+
* `groupId` matches by id only.
|
|
312
|
+
*/
|
|
313
|
+
private configureGroups;
|
|
314
|
+
/** Stores the states `next` gives the current groups (`undefined`: unchanged); returns what changed. */
|
|
315
|
+
private changeGroups;
|
|
316
|
+
private collectOpen;
|
|
317
|
+
/**
|
|
318
|
+
* The group column is present while a present data column is grouped (not in tree mode) or in tree mode. Adds it
|
|
319
|
+
* to `leaves` and `defOrder` (state seeded from the options, also for a changed width or pinning, a pending entry
|
|
320
|
+
* applied), or removes it from `leaves`, `defOrder` and `order`; `configure` rebuilds it
|
|
321
|
+
* from the current options. Returns its sort when it appears (was not in `order`) with one, for the caller to rank:
|
|
322
|
+
* the remembered index, or a pending entry's explicit one.
|
|
323
|
+
*/
|
|
324
|
+
private syncGroupLeaf;
|
|
325
|
+
/**
|
|
326
|
+
* `order` with the group column added at its definition place: after the column that precedes it in
|
|
327
|
+
* `defOrder` (the nearest one present), first when none does (what no marker gives).
|
|
328
|
+
*/
|
|
329
|
+
private withGroupPlaced;
|
|
330
|
+
/**
|
|
331
|
+
* `syncGroupLeaf` outside `configure`: a new group column also goes into the order, right after the row numbers.
|
|
332
|
+
* A sort it appears with ranks after the current keys, unless `explicit` (the caller's entry gave its index).
|
|
333
|
+
*/
|
|
334
|
+
private syncPresence;
|
|
335
|
+
/**
|
|
336
|
+
* The selection column is present while `selectionSpec` wants it, and — with `hideWithGroup` (row boxes in the
|
|
337
|
+
* group column) — while the group column is not. It is never one of the app's definitions, so `configure`
|
|
338
|
+
* starts without it and this adds it again (leaf and state rebuilt from the spec, so a width option applies).
|
|
339
|
+
*/
|
|
340
|
+
private syncSelectionLeaf;
|
|
341
|
+
/** The handle column is present while `rowDragSpec` wants it; leaf and state rebuilt from the spec. */
|
|
342
|
+
private syncRowDragLeaf;
|
|
343
|
+
/**
|
|
344
|
+
* The toggle column is present while `detailSpec` wants it, between the handle column and the selection
|
|
345
|
+
* column; leaf and state rebuilt from the spec, as the handle column's.
|
|
346
|
+
*/
|
|
347
|
+
private syncDetailLeaf;
|
|
348
|
+
/** The group column's spec follows the grouping and the options. */
|
|
349
|
+
private refreshGroupSpec;
|
|
350
|
+
protected state(id: string): LeafState;
|
|
351
|
+
protected snapshot(): string;
|
|
352
|
+
/**
|
|
353
|
+
* Present ids that are already placed keep their order; the others go after their preceding leaf in the
|
|
354
|
+
* definitions (by its current position), or before the following one, or to the end. The group
|
|
355
|
+
* column is not one of the app's definitions, so it is never a neighbour here; a placed one keeps its position, one
|
|
356
|
+
* that appears is put first by `configure`.
|
|
357
|
+
*/
|
|
358
|
+
private mergeOrder;
|
|
359
|
+
/**
|
|
360
|
+
* The row-number column first, then the handle column, the toggle column and the selection column; the others
|
|
361
|
+
* keep their order.
|
|
362
|
+
*/
|
|
363
|
+
protected withRowNumbersFirst(order: string[]): string[];
|
|
364
|
+
/** Sort indices become 0…k−1: by index (unset last), ties in full order. */
|
|
365
|
+
protected normaliseSort(): void;
|
|
366
|
+
/** RowGroup becomes 0…k−1 over the present data columns, ties in full order (as `normaliseSort`). */
|
|
367
|
+
protected normaliseGroups(): void;
|
|
368
|
+
}
|
|
369
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FieldFilter, RowQuery } from '../source';
|
|
2
|
+
import { type ColumnModel } from './model';
|
|
3
|
+
/**
|
|
4
|
+
* The query's `groupBy` (`deriveQuery`): the grouped columns' fields in `rowGroup` order. The grid compares it with the
|
|
5
|
+
* `groupBy` it last handed over, to hand a grouping change over at once without deriving the whole query.
|
|
6
|
+
*/
|
|
7
|
+
export declare function groupByOf(model: ColumnModel): string[];
|
|
8
|
+
/**
|
|
9
|
+
* The query the column state asks of the source: the grouped columns' fields in
|
|
10
|
+
* `rowGroup` order (none in tree mode), every column with an `aggregate` (hidden ones too), and the sort model mapped to
|
|
11
|
+
* fields — a sort on the group column becomes one entry per grouped field (or the tree's label field), skipping fields
|
|
12
|
+
* that carry a sort of their own; plus the quick filter over `quickFilter`, the grid's text (grid state, not column
|
|
13
|
+
* state), and in tree mode the tree's label field; plus the column filters' entries, which the grid's
|
|
14
|
+
* filter state gives (grid state too).
|
|
15
|
+
*/
|
|
16
|
+
export declare function deriveQuery(model: ColumnModel, quickFilter?: string, filter?: readonly FieldFilter[]): RowQuery;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RowInfo } from '../source';
|
|
2
|
+
import type { ColumnDef, TooltipOptions } from '../types';
|
|
3
|
+
import type { DisplayLayout, ResolvedColumn } from './layout';
|
|
4
|
+
export type ResolvedTooltips = Required<TooltipOptions>;
|
|
5
|
+
/** The defaults. */
|
|
6
|
+
export declare const TOOLTIP_DEFAULTS: Readonly<ResolvedTooltips>;
|
|
7
|
+
/** `GridOptions.tooltips` with every key set: a missing or not finite delay is the default, a smaller one the floor. */
|
|
8
|
+
export declare function resolveTooltips(o?: TooltipOptions): ResolvedTooltips;
|
|
9
|
+
/** A spec that can give a tooltip: `true`, a non-empty text or a function (`false`, `''` and none give none). */
|
|
10
|
+
export declare function isTip(spec: unknown): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The text a tooltip spec gives for `ctx`: `true` the shown text, a string itself, a function its result; null for
|
|
13
|
+
* none or an empty result. A throwing function gives none and goes to `report` with itself as the owner.
|
|
14
|
+
*/
|
|
15
|
+
export declare function tooltipText<C extends {
|
|
16
|
+
text: string;
|
|
17
|
+
}>(spec: boolean | string | ((ctx: C) => string | null | undefined) | undefined, ctx: C, report: (owner: object, error: unknown) => void): string | null;
|
|
18
|
+
/**
|
|
19
|
+
* The tooltip spec of a body cell and the column it belongs to: a data column's own (merged over
|
|
20
|
+
* `defaultColumn`), on group rows too; the group column's (`groupColumn.tooltip`, else `defaultColumn`'s) on leaf rows
|
|
21
|
+
* and in tree mode, on a group row the grouped column of its level (hidden or not); the row
|
|
22
|
+
* numbers' own (`rowNumbers.tooltip`); none for the other grid-owned columns. Null when the spec gives none.
|
|
23
|
+
*/
|
|
24
|
+
export declare function cellTooltipOf(col: ResolvedColumn, info: RowInfo | null, layout: DisplayLayout, grouped: readonly string[]): {
|
|
25
|
+
spec: ColumnDef['tooltip'];
|
|
26
|
+
column: ColumnDef;
|
|
27
|
+
} | null;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import type { ClientSelectionView } from '../../selection/rows';
|
|
2
|
+
import { type RowInfo, type ViewportSource } from '../../source';
|
|
3
|
+
import type { ClientSource, ClientSourceOptions } from './types';
|
|
4
|
+
/** The client source's selection view, with `has(key)` and `computed(field)`. */
|
|
5
|
+
export interface ClientInternals extends ClientSelectionView {
|
|
6
|
+
/**
|
|
7
|
+
* Moves at each `setData` / `refresh()` whose rows keep their identity: with the `id` option, or the same
|
|
8
|
+
* array again. Not at a managed row move, `refresh({ appended })`, a diff reset by clashing ids, or a write.
|
|
9
|
+
*/
|
|
10
|
+
valuePasses(): number;
|
|
11
|
+
/**
|
|
12
|
+
* The group aggregates and the grand total follow the values written since the last run, with
|
|
13
|
+
* no sort, grouping or filter run (`Pipeline.refreshAggregates`): the shown rows are announced as a `rows` change.
|
|
14
|
+
* True when they were computed again.
|
|
15
|
+
*/
|
|
16
|
+
refreshAggregates(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The identity of display row `row` as the `shown()` diff makes it (data nodes: id or row object; group rows and
|
|
19
|
+
* fillers: `'\u0000'` + their path); `undefined` out of range.
|
|
20
|
+
*/
|
|
21
|
+
identityOf(row: number): unknown;
|
|
22
|
+
/** A data node holds `key` (an id, else a row object): `nodeOfKey(key) >= 0`. */
|
|
23
|
+
has(key: unknown): boolean;
|
|
24
|
+
/** The field has a `FieldDef.value` getter: a plain write of `row[field]` cannot change it. */
|
|
25
|
+
computed(field: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The array the last `setData(rows, { hold: true })` gave and the entries the source read from it,
|
|
28
|
+
* while the source still holds exactly that (no load, refresh, append or move since); null otherwise.
|
|
29
|
+
* `useClientSource` skips the watch run that only echoes it: a `setData` with the array the source holds would be a
|
|
30
|
+
* refresh, and the held rows would be filtered and sorted after all.
|
|
31
|
+
*/
|
|
32
|
+
heldGiven(): {
|
|
33
|
+
array: readonly unknown[];
|
|
34
|
+
read: number;
|
|
35
|
+
} | null;
|
|
36
|
+
/**
|
|
37
|
+
* The value of `field` in `row`, an object the source need not hold (a pinned row): through the
|
|
38
|
+
* field's `FieldDef.value` getter, else `row[field]` — as the source reads its own rows (date-part fields included);
|
|
39
|
+
* a throwing getter or property read is reported once and reads as undefined.
|
|
40
|
+
*/
|
|
41
|
+
fieldValue(row: object, field: string): unknown;
|
|
42
|
+
/**
|
|
43
|
+
* The view shows the rows in the order of the array the source holds: flat (no grouping, no
|
|
44
|
+
* tree), no sort, no column or quick filter, no `setFilter` predicate — where a managed row move can apply.
|
|
45
|
+
*/
|
|
46
|
+
arrayOrder(): boolean;
|
|
47
|
+
/** Runs `listener` after a run that changed `arrayOrder()`'s answer (a query, `setFilter`); returns the remover. */
|
|
48
|
+
onArrayOrder(listener: () => void): () => void;
|
|
49
|
+
/**
|
|
50
|
+
* The managed row move: while the view is in array order, the displayed rows `rows` (ascending
|
|
51
|
+
* display indexes) go into the gap `gap` (0 … rowCount, counted before the move), keeping their order. The new array —
|
|
52
|
+
* the one the source holds with those rows taken out and put into the gap — is applied through the `setData` path
|
|
53
|
+
* (the identity diff: splices, one reset past 256 runs), so ids, selection and expansion follow the rows. The source
|
|
54
|
+
* then holds it (a move's array, until a `setData` with another array), and the `onMoved` listeners hear it before
|
|
55
|
+
* this returns. The app's array is never changed. Null, changing nothing, when the view is not in array order.
|
|
56
|
+
*/
|
|
57
|
+
moveRows(rows: readonly number[], gap: number): readonly unknown[] | null;
|
|
58
|
+
/** Runs `listener(order)` after each `moveRows` applied its array, each isolated; returns the remover. */
|
|
59
|
+
onMoved(listener: (order: readonly unknown[]) => void): () => void;
|
|
60
|
+
/**
|
|
61
|
+
* The view as if every group were open: a grouped or tree view's rows depth-first in display order,
|
|
62
|
+
* closed groups' rows included — what an export of every row walks. Null for flat rows (every row is shown). With
|
|
63
|
+
* total rows asked, every group's total row at its place (closed groups' too) and the grand total
|
|
64
|
+
* first or last, as `rowInfo` and `getValue` give them on display rows.
|
|
65
|
+
*/
|
|
66
|
+
expanded(): ExpandedOrder | null;
|
|
67
|
+
/**
|
|
68
|
+
* The pinned grand total — asked with `setTotalRows({ grand: 'pinned' })`, which keeps it out
|
|
69
|
+
* of the display order — as its values by field: the top node's aggregates over every row the filters pass (no
|
|
70
|
+
* entry for a field without one). Null while no grand total is asked pinned or no row passes (the pinned section
|
|
71
|
+
* then shows none, as the body shows no grand total then). The current run's: read again after each run.
|
|
72
|
+
*/
|
|
73
|
+
grandTotal(): ReadonlyMap<string, unknown> | null;
|
|
74
|
+
/**
|
|
75
|
+
* The node of display row `row` as `ExpandedOrder.node` numbers rows — a data node, a group row's or a
|
|
76
|
+
* filler's, a group total's number, the grand total's the top node —: what `identityOfNode` and
|
|
77
|
+
* `revealNode` take for a row of a flat view too. −1 out of range.
|
|
78
|
+
*/
|
|
79
|
+
nodeAt(row: number): number;
|
|
80
|
+
/**
|
|
81
|
+
* The identity of node `node` of the current run (`ExpandedOrder.node`'s, a group row's or a filler's included; a
|
|
82
|
+
* group total's number and the grand total's top node too), displayed or not: what `identityOf` gives for
|
|
83
|
+
* its row while it is displayed (find's active match keeps it inside closed groups; a total row's
|
|
84
|
+
* its group's path marked as a total, the grand total a constant). `undefined` out of range.
|
|
85
|
+
*/
|
|
86
|
+
identityOfNode(node: number): unknown;
|
|
87
|
+
/**
|
|
88
|
+
* Opens the closed groups above node `node` of the current run — `reveal`'s ancestor walk for any node, a group row
|
|
89
|
+
* or a filler too (going to a find match); a group total's number opens its group as well, where
|
|
90
|
+
* its total row shows — with one `'api'` expansion event when it opened any; returns the node's display row (past a
|
|
91
|
+
* first grand total; the grand total's while it shows), −1 when the filters drop it, it has no total row or it
|
|
92
|
+
* is out of range.
|
|
93
|
+
*/
|
|
94
|
+
revealNode(node: number): number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* A grouped or tree view's rows as if every group were open, read by position: `depthFirst` of the pipeline
|
|
98
|
+
* run it was taken from (one `Int32Array`, built once per run), so a row's position does not change when groups open
|
|
99
|
+
* or close. Values and row info are that run's; `display` follows the expansion state as it is now.
|
|
100
|
+
*
|
|
101
|
+
* With total rows asked, a group's total row is at its place whether the group is open or closed
|
|
102
|
+
* (right after its row, or after its descendants), and the grand total (not `'pinned'`) is the first or last position.
|
|
103
|
+
*/
|
|
104
|
+
export interface ExpandedOrder {
|
|
105
|
+
/** Rows (positions `0 … size − 1`). */
|
|
106
|
+
readonly size: number;
|
|
107
|
+
/**
|
|
108
|
+
* The source ran its pipeline into another hierarchy or order since, or its total rows changed: positions no
|
|
109
|
+
* longer hold these rows.
|
|
110
|
+
*/
|
|
111
|
+
stale(): boolean;
|
|
112
|
+
/** The position of display row `row`; −1 out of range (or stale). */
|
|
113
|
+
positionOf(row: number): number;
|
|
114
|
+
/** The display row of position `p`; −1 while it is inside a closed group (or stale). */
|
|
115
|
+
display(p: number): number;
|
|
116
|
+
/**
|
|
117
|
+
* The position right after `p`'s descendants (`p + 1` for a row without children); a group's bottom total is one
|
|
118
|
+
* of them.
|
|
119
|
+
*/
|
|
120
|
+
end(p: number): number;
|
|
121
|
+
/** The position of `p`'s parent row (a total row's: its group's); −1 at the top level and for the grand total. */
|
|
122
|
+
up(p: number): number;
|
|
123
|
+
/**
|
|
124
|
+
* The node at `p` (a group row's or a filler's included; a total row's its number, the grand total's the top node).
|
|
125
|
+
*/
|
|
126
|
+
node(p: number): number;
|
|
127
|
+
/** The data node at `p` (a row selection's node); −1 for a group row, a filler or a total row. */
|
|
128
|
+
dataNode(p: number): number;
|
|
129
|
+
/** Group rows, fillers and tree parents with visible children (never a total row). */
|
|
130
|
+
hasChildren(p: number): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Row `p`'s info, as `rowInfo` gives a displayed row's (`expanded` as the expansion state is now); both total
|
|
133
|
+
* fields written on every call.
|
|
134
|
+
*/
|
|
135
|
+
rowInfo(p: number, into: RowInfo): RowInfo;
|
|
136
|
+
/** Row `p`'s value of `field`, as `getValue` gives a displayed row's. */
|
|
137
|
+
getValue(p: number, field: string): unknown;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The selection internals of a `clientSource`: data nodes, keys, scopes, descendants, the data generation and
|
|
141
|
+
* the remap. Null for any other source. Internal, like `cachedBlocks` for server sources: kept off the source object.
|
|
142
|
+
*/
|
|
143
|
+
export declare function clientInternals(source: ViewportSource): ClientInternals | null;
|
|
144
|
+
/**
|
|
145
|
+
* Client-side rows: a synchronous `ViewportSource` over the app's row objects with sorting, the quick
|
|
146
|
+
* filter, column filters and an app predicate, grouping with aggregates and trees in three shapes. The
|
|
147
|
+
* pipeline (pipeline.ts) computes; this module flattens with `Expansion`, announces changes as `splice`s
|
|
148
|
+
* (diffed by identity on data and filter changes) and serves lookups and listeners. Plain closures and `Set`s: no Vue,
|
|
149
|
+
* no DOM (worker-safe).
|
|
150
|
+
*/
|
|
151
|
+
export declare function clientSource<T extends object>(rows: readonly T[], options?: ClientSourceOptions<T>): ClientSource<T>;
|