@olvnck/ingrid 0.0.0-stage → 0.15.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +5535 -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,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The live region of `root`'s grid, created on first use as the root's last child. Screen readers pick up a region
|
|
3
|
+
* that exists before its text changes, so a UI that will announce calls this when it is built.
|
|
4
|
+
*/
|
|
5
|
+
export declare function liveRegion(root: HTMLElement): HTMLElement;
|
|
6
|
+
/** Says `text` politely; a new text node each time, so the same text twice is announced twice. */
|
|
7
|
+
export declare function announce(root: HTMLElement, text: string): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { UiHost } from './controller';
|
|
2
|
+
import type { PopupLayer } from './popup';
|
|
3
|
+
export interface Chooser {
|
|
4
|
+
/**
|
|
5
|
+
* Opens the chooser below the element `anchor` finds — asked again at every placement, so a rebuilt header cell is
|
|
6
|
+
* found again; once it finds none (the chooser hid its column) the chooser stays where it is — or below the
|
|
7
|
+
* header's start when it finds none at open (the API). A keyboard close returns focus to `opener` (default: the
|
|
8
|
+
* grid). An open chooser is replaced.
|
|
9
|
+
*/
|
|
10
|
+
show(anchor: (() => HTMLElement | null) | null, opener?: () => HTMLElement | null): void;
|
|
11
|
+
/** Definitions or column state changed: the open list follows. */
|
|
12
|
+
columnsChanged(): void;
|
|
13
|
+
/** An open chooser re-renders in the new locale. */
|
|
14
|
+
localeChanged(): void;
|
|
15
|
+
/** The open chooser itself is closed (silently) by the layer's own destroy. */
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
18
|
+
/** Call inside the controller's effect scope. */
|
|
19
|
+
export declare function createChooser(host: UiHost, popups: () => PopupLayer): Chooser;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { DropTarget, DropZone } from '../interact/header';
|
|
2
|
+
import type { UiHost } from './controller';
|
|
3
|
+
export interface ColumnListOptions {
|
|
4
|
+
/** A search box over the names. */
|
|
5
|
+
search: boolean;
|
|
6
|
+
/** A tri-state checkbox over the listed columns the UI may hide. */
|
|
7
|
+
selectAll: boolean;
|
|
8
|
+
/** A button that expands or collapses every group. */
|
|
9
|
+
expandAll: boolean;
|
|
10
|
+
/** Rows drag (and Alt+Up / Alt+Down move) their columns. */
|
|
11
|
+
reorder: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Drop places beside the list (the columns panel's Row Groups and Values sections): a dragged
|
|
14
|
+
* column row over one of them drops there instead of moving within the list.
|
|
15
|
+
*/
|
|
16
|
+
outside?: OutsideDrops;
|
|
17
|
+
/**
|
|
18
|
+
* Sort markers (the columns panel's `sort`): a sorted column's row shows the header's glyph, its
|
|
19
|
+
* priority while two or more columns are sorted (hidden ones included) and an ×; a click on the marker flips the
|
|
20
|
+
* direction in place, × removes that sort; a closed group holding a sorted column shows a dot. The column
|
|
21
|
+
* chooser never sets it.
|
|
22
|
+
*/
|
|
23
|
+
sort?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** Drop zones outside the list a dragged row may drop on, and what such a drop does. */
|
|
26
|
+
export interface OutsideDrops {
|
|
27
|
+
/** The zones, asked at every pointer move of a drag (before the list's own rows). */
|
|
28
|
+
zones(): readonly DropZone[];
|
|
29
|
+
/** A column row dropped on a zone, with the target the zone aimed. */
|
|
30
|
+
drop(id: string, target: DropTarget): void;
|
|
31
|
+
}
|
|
32
|
+
export interface ColumnList {
|
|
33
|
+
readonly el: HTMLElement;
|
|
34
|
+
/** The rows again from the column model (definitions, order, visibility), and the texts of the current locale. */
|
|
35
|
+
refresh(): void;
|
|
36
|
+
/** Focuses the search box, or the tree without one. */
|
|
37
|
+
focus(): void;
|
|
38
|
+
destroy(): void;
|
|
39
|
+
}
|
|
40
|
+
/** A column list over `host`'s columns; its own effect scope, stopped by `destroy`. */
|
|
41
|
+
export declare function createColumnList(host: UiHost, options: ColumnListOptions): ColumnList;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { GridTexts } from '../i18n/texts';
|
|
2
|
+
import type { SourceStatus } from '../source';
|
|
3
|
+
import type { ColumnGroupInfo, ColumnInfo, ColumnMenuContext, MenuEntry, MenuItem, MenuItems } from '../types';
|
|
4
|
+
import type { UiHost } from './controller';
|
|
5
|
+
import type { PopupLayer } from './popup';
|
|
6
|
+
type Entry = MenuItem | 'separator';
|
|
7
|
+
/** What built-in items are resolved for: the menu's column (null on a group header or the empty area) and the grid. */
|
|
8
|
+
export interface MenuScope {
|
|
9
|
+
column: ColumnInfo | null;
|
|
10
|
+
host: UiHost;
|
|
11
|
+
/** False once the UI is destroyed (an `onPopupChange` listener may destroy the grid as the menu closes). */
|
|
12
|
+
live?: () => boolean;
|
|
13
|
+
/** Opens the column chooser below the menu's header; without it, below the header's start (the API's). */
|
|
14
|
+
chooser?: () => void;
|
|
15
|
+
/** The context menu's row (null over the empty area; a column menu has none): Export selection's. */
|
|
16
|
+
row?: number | null;
|
|
17
|
+
}
|
|
18
|
+
/** The source's status, isolated: a throwing `status` is reported once and counts as none. */
|
|
19
|
+
export declare function statusOf(host: UiHost): SourceStatus | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Expands or collapses every row: the menu's "Expand all" / "Collapse all" and `groupKeys`. False — nothing
|
|
22
|
+
* done — while `expandable` is not met.
|
|
23
|
+
*/
|
|
24
|
+
export declare function expandEverything(host: Pick<UiHost, 'model' | 'source'>, expanded: boolean): boolean;
|
|
25
|
+
/** A built-in aggregate's label; custom names as they are. */
|
|
26
|
+
export declare function aggregateLabel(fn: string, t: GridTexts): string;
|
|
27
|
+
/**
|
|
28
|
+
* The column menu's defaults as built-in names and separators (what a builder receives): the built-in items that apply
|
|
29
|
+
* to the column now, in the default order; `chooseColumns` and `resetColumns` without a column.
|
|
30
|
+
*/
|
|
31
|
+
export declare function defaultMenuTokens(scope: MenuScope): MenuEntry[];
|
|
32
|
+
/**
|
|
33
|
+
* Maps entries to what `openMenu` draws: built-in names become their items for the scope's column — inside
|
|
34
|
+
* app items' sub-menus too —, a name that does not apply now is left out (when it applies is part of its contract),
|
|
35
|
+
* an unknown name or a non-entry is left out with one console hint. App items pass through (copied when their
|
|
36
|
+
* sub-menu resolves).
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveMenuEntries(entries: readonly MenuEntry[], scope: MenuScope): Entry[];
|
|
39
|
+
/** The column menu's default items, resolved: what the menu shows when the app gives no entries. */
|
|
40
|
+
export declare function columnMenuEntries(ctx: ColumnMenuContext & {
|
|
41
|
+
host: UiHost;
|
|
42
|
+
}): Entry[];
|
|
43
|
+
/**
|
|
44
|
+
* A menu's entries: `items` as given, or a builder's result — called with the menu's context and the defaults as
|
|
45
|
+
* names —, else the defaults. A throwing builder is reported once per builder and the defaults are used;
|
|
46
|
+
* one that returns no array gets a console hint and the defaults.
|
|
47
|
+
*/
|
|
48
|
+
export declare function buildMenuEntries<C extends object>(items: MenuItems<C> | undefined, ctx: C, defaults: MenuEntry[], host: UiHost): readonly MenuEntry[];
|
|
49
|
+
/** Gives the grid focus: its focused cell or header cell, else its viewport. */
|
|
50
|
+
export declare function focusGrid(host: Pick<UiHost, 'refocus' | 'viewport'>): void;
|
|
51
|
+
/**
|
|
52
|
+
* A menu's `afterAction`: an action may remove the element focus went back to (hiding or removing the button's column,
|
|
53
|
+
* the top bar's button): the grid takes focus then, so the keyboard user is not left on the page body.
|
|
54
|
+
*/
|
|
55
|
+
export declare function keepFocus(host: Pick<UiHost, 'refocus' | 'viewport'>): void;
|
|
56
|
+
/** The column menus as the UI controller drives them. */
|
|
57
|
+
export interface ColumnMenus {
|
|
58
|
+
/** A header menu button was clicked: its column's menu opens below it, or closes when it is open. */
|
|
59
|
+
toggle(id: string, button: HTMLElement): void;
|
|
60
|
+
/** `Grid.showColumnMenu`: the column scrolls into view, then its menu opens below its menu button. */
|
|
61
|
+
show(id: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* A key on a focused header cell: the column's menu below its menu button (else the cell), or a group's
|
|
64
|
+
* below the cell; a keyboard close hands focus back to `cell`. False when there was nothing to show.
|
|
65
|
+
*/
|
|
66
|
+
openFrom(target: {
|
|
67
|
+
column: string;
|
|
68
|
+
} | {
|
|
69
|
+
group: ColumnGroupInfo;
|
|
70
|
+
}, cell: HTMLElement): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* A right-click on the header: the column's menu, a group's, or the one without a column, at the pointer. True when
|
|
73
|
+
* a menu opened; false when there was nothing to show (the browser's menu then stays).
|
|
74
|
+
*/
|
|
75
|
+
at(target: {
|
|
76
|
+
column: string;
|
|
77
|
+
} | {
|
|
78
|
+
group: ColumnGroupInfo;
|
|
79
|
+
} | null, point: {
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
|
+
}): boolean;
|
|
83
|
+
/** Drops a `show` still waiting for its scroll (another popup was asked for, or all were hidden). */
|
|
84
|
+
cancel(): void;
|
|
85
|
+
/** A removed or hidden column's open menu closes. */
|
|
86
|
+
columnsChanged(): void;
|
|
87
|
+
/** An open menu closes: menus are transient and their entries may come from app builders. */
|
|
88
|
+
localeChanged(): void;
|
|
89
|
+
/** The open menu itself is closed (silently) by the layer's own destroy. */
|
|
90
|
+
destroy(): void;
|
|
91
|
+
}
|
|
92
|
+
/** Call inside the controller's effect scope. */
|
|
93
|
+
export declare function createColumnMenus(host: UiHost, popups: () => PopupLayer,
|
|
94
|
+
/** Opens the column chooser below what `anchor` finds, focus returning to `opener` on a keyboard close. */
|
|
95
|
+
chooser: (anchor: () => HTMLElement | null, opener?: () => HTMLElement | null) => void): ColumnMenus;
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { DropZone } from '../interact/header';
|
|
2
|
+
import type { ColumnsPanelOptions } from '../types';
|
|
3
|
+
import type { UiHost } from './controller';
|
|
4
|
+
import type { PopupLayer } from './popup';
|
|
5
|
+
export interface ColumnsPanel {
|
|
6
|
+
readonly el: HTMLElement;
|
|
7
|
+
/** The drop zones of the shown sections (Row Groups, Values), for a header drag (`HeaderHost.sideBarZones`). */
|
|
8
|
+
zones(): readonly DropZone[];
|
|
9
|
+
/** Definitions, column state or the locale changed: the list and the sections follow. */
|
|
10
|
+
refresh(): void;
|
|
11
|
+
/** The source changed: the Row Groups section follows whether it can group (`status().canGroup`, `setRows`). */
|
|
12
|
+
sourceChanged(): void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
}
|
|
15
|
+
/** Call inside the controller's effect scope; its own scope stops with `destroy`. */
|
|
16
|
+
export declare function createColumnsPanel(host: UiHost, options: ColumnsPanelOptions, popups: () => PopupLayer): ColumnsPanel;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { SourceChange } from '../source';
|
|
2
|
+
import type { CellAddress, Grid } from '../types';
|
|
3
|
+
import type { UiHost } from './controller';
|
|
4
|
+
import type { PopupLayer } from './popup';
|
|
5
|
+
/** What `Grid.showContextMenu` gets: a cell, a row, a column or nothing, and an optional point (client coordinates). */
|
|
6
|
+
export type ContextMenuAt = Parameters<Grid['showContextMenu']>[0];
|
|
7
|
+
/** The context menus as the UI controller drives them. */
|
|
8
|
+
export interface ContextMenus {
|
|
9
|
+
/**
|
|
10
|
+
* A `contextmenu` over the body (the header's goes to the column menu): the menu of the cell under the event's
|
|
11
|
+
* target, or of the empty area, at the pointer; with `focused` (no pointer-down came first) the focused
|
|
12
|
+
* cell's, anchored to it. True when a menu opened (the grid then prevents the browser's); false when the browser's
|
|
13
|
+
* menu stays: no entries, `contextMenu: false`, Ctrl held without `withControlKey`, an editable target or
|
|
14
|
+
* interactive content in a cell.
|
|
15
|
+
*/
|
|
16
|
+
fromEvent(event: MouseEvent, focused: CellAddress | null): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The ContextMenu key or Shift+F10 on a focused cell (a pinned one's too): its menu anchored to
|
|
19
|
+
* it — a cell out of view is scrolled into view first and its menu opens once that scroll is through. False when
|
|
20
|
+
* there is nothing to show.
|
|
21
|
+
*/
|
|
22
|
+
atCell(cell: CellAddress): boolean;
|
|
23
|
+
/** Drops a keyboard opening still waiting for its cell's scroll (another popup was asked for). */
|
|
24
|
+
cancel(): void;
|
|
25
|
+
/** `Grid.showContextMenu`. */
|
|
26
|
+
show(at: ContextMenuAt): void;
|
|
27
|
+
/**
|
|
28
|
+
* The source's rows changed: an open menu of a row closes when that row may now be another record —
|
|
29
|
+
* a reset (a new source too), a splice that moves or replaces it, a count that no longer holds it — so its actions
|
|
30
|
+
* never act on a row the user did not pick. A `rows` change (a block arriving for a loading row, a live update) keeps
|
|
31
|
+
* it, so a Copy menu over a server grid survives its row loading. A menu without a row stays, and so does a pinned
|
|
32
|
+
* row's: body changes do not move it.
|
|
33
|
+
*/
|
|
34
|
+
sourceChanged(change: SourceChange): void;
|
|
35
|
+
/**
|
|
36
|
+
* Pinned section `side`'s rows were set: an open menu of a row there closes, as for a reset — the
|
|
37
|
+
* set replaces the section's rows, so its index may be another object now.
|
|
38
|
+
*/
|
|
39
|
+
pinnedRowsChanged(side: 'top' | 'bottom'): void;
|
|
40
|
+
/** Its column hidden or removed: an open menu closes, as the column menu's does. */
|
|
41
|
+
columnsChanged(): void;
|
|
42
|
+
/** An open menu closes: menus are transient and their entries may come from app builders. */
|
|
43
|
+
localeChanged(): void;
|
|
44
|
+
/** The open menu itself is closed (silently) by the layer's own destroy. */
|
|
45
|
+
destroy(): void;
|
|
46
|
+
}
|
|
47
|
+
/** Call inside the controller's effect scope. */
|
|
48
|
+
export declare function createContextMenus(host: UiHost, popups: () => PopupLayer): ContextMenus;
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import type { CopyKeys } from '../clipboard/options';
|
|
2
|
+
import { type ColumnModel } from '../columns/model';
|
|
3
|
+
import type { ColumnFilterModel } from '../filter/model';
|
|
4
|
+
import type { FilterState } from '../filter/state';
|
|
5
|
+
import { type ValuesOptions } from '../filter/values';
|
|
6
|
+
import type { FindReport } from '../find/model';
|
|
7
|
+
import type { Locale } from '../i18n/texts';
|
|
8
|
+
import type { SideBarZones } from '../interact/header';
|
|
9
|
+
import type { FloatingHooks } from '../render/header';
|
|
10
|
+
import type { RangeColumns, RangeModel } from '../selection/ranges';
|
|
11
|
+
import type { FilterValues, RowQuery, SourceChange, ViewportSource } from '../source';
|
|
12
|
+
import type { CellAddress, ColumnGroupInfo, ColumnInfo, ExportFormat, FilterChange, Grid, GridOptions, GroupColumnOptions, HeaderIcons, PopupChange, RangeChange, StateSource } from '../types';
|
|
13
|
+
import { type ContextMenuAt } from './contextMenu';
|
|
14
|
+
import { type PopupLayer } from './popup';
|
|
15
|
+
import type { TooltipLayer } from './tooltip';
|
|
16
|
+
/** What the UI reads from the grid and the few grid functions it calls. */
|
|
17
|
+
export interface UiHost {
|
|
18
|
+
root: HTMLElement;
|
|
19
|
+
/** The row of side bar and body. */
|
|
20
|
+
main: HTMLElement;
|
|
21
|
+
body: HTMLElement;
|
|
22
|
+
header: HTMLElement;
|
|
23
|
+
viewport: HTMLElement;
|
|
24
|
+
rowsEl: HTMLElement;
|
|
25
|
+
/**
|
|
26
|
+
* The public API, for app callbacks' contexts (a menu item's `grid`) and actions that are API calls by nature
|
|
27
|
+
* (auto-size, reset columns). A UI action that changes column state goes through `model` and `commit` instead, so
|
|
28
|
+
* its state event names the gesture.
|
|
29
|
+
*/
|
|
30
|
+
api: Grid;
|
|
31
|
+
model: ColumnModel;
|
|
32
|
+
filters: FilterState;
|
|
33
|
+
locale(): Locale;
|
|
34
|
+
source(): ViewportSource;
|
|
35
|
+
/** The query the source has (a pending change is handed over first). */
|
|
36
|
+
query(): RowQuery;
|
|
37
|
+
/** A defined column as `getColumns` reports it, a pending relayout applied first; null when unknown. */
|
|
38
|
+
columnInfo(id: string): ColumnInfo | null;
|
|
39
|
+
headerCell(id: string): HTMLElement | null;
|
|
40
|
+
/** The grouped columns taking part in the group column's filter, outermost first. */
|
|
41
|
+
groupEntries(): readonly string[];
|
|
42
|
+
/** Displayed column ids in display order, lanes left → right. */
|
|
43
|
+
displayedIds(): readonly string[];
|
|
44
|
+
/**
|
|
45
|
+
* The row a body row element shows (strategy.rowOf); -1 when none. With `pinned` the index of a row
|
|
46
|
+
* element of that pinned section.
|
|
47
|
+
*/
|
|
48
|
+
rowOf(rowEl: Element, pinned?: 'top' | 'bottom'): number;
|
|
49
|
+
/** The pinned section an element lies in, undefined outside both (`InteractHost.sectionAt`). */
|
|
50
|
+
sectionAt(el: Element): 'top' | 'bottom' | undefined;
|
|
51
|
+
/** The element of pinned section `side` (`.ig-pinned-top` / `.ig-pinned-bottom`). */
|
|
52
|
+
sectionEl(side: 'top' | 'bottom'): HTMLElement;
|
|
53
|
+
/**
|
|
54
|
+
* A body cell's raw value as its renderer gets it (`CellContext.value`): the source's value of the column's field,
|
|
55
|
+
* the group column's key or label; undefined while the row is not loaded, or when reading it throws (reported once).
|
|
56
|
+
* With `pinned` a pinned row's, from its section.
|
|
57
|
+
*/
|
|
58
|
+
cellValue(row: number, id: string, pinned?: 'top' | 'bottom'): unknown;
|
|
59
|
+
/** The one path of every column filter change: the source gets the query, then the event goes out. */
|
|
60
|
+
applyFilter(id: string, model: ColumnFilterModel | null, source: 'ui' | 'floating'): void;
|
|
61
|
+
/**
|
|
62
|
+
* The top bar's filters chip: these column filters cleared as one change from the UI (`'ui'`: one query
|
|
63
|
+
* hand-over, one event). The group column's entries keep theirs: that sweep is the API's.
|
|
64
|
+
*/
|
|
65
|
+
clearFilters(ids: readonly string[]): void;
|
|
66
|
+
/**
|
|
67
|
+
* A filter model problem, printed once per column and problem as `setColumnFilter`'s (`InGrid filter model:
|
|
68
|
+
* …`): a model an app's floating renderer gave before it applies.
|
|
69
|
+
*/
|
|
70
|
+
filterProblem(id: string, problem: string): void;
|
|
71
|
+
/** A set filter's values. */
|
|
72
|
+
valuesFor(id: string, options?: ValuesOptions): Promise<FilterValues>;
|
|
73
|
+
/** A model change made here: the new layout, then one state event with `source`. */
|
|
74
|
+
commit(changed: boolean, source: StateSource): void;
|
|
75
|
+
/**
|
|
76
|
+
* Groups by gesture, as a header dropped on the group panel: at `index` (default last), the column
|
|
77
|
+
* hidden unless `hideable: false`; state event `'group'`.
|
|
78
|
+
*/
|
|
79
|
+
groupByGesture(id: string, index?: number): void;
|
|
80
|
+
/**
|
|
81
|
+
* Ungroups by gesture, as a chip's removal or (several ids) the top bar's groups chip: the columns are shown again;
|
|
82
|
+
* one state event `'group'`.
|
|
83
|
+
*/
|
|
84
|
+
ungroupByGesture(ids: string | readonly string[]): void;
|
|
85
|
+
/** The group column's options (`GridOptions.groupColumn`). */
|
|
86
|
+
groupDef(): GroupColumnOptions | undefined;
|
|
87
|
+
/** `GridOptions.columnMenu` as last set (`setColumnMenu`): the grid-wide menu entries. */
|
|
88
|
+
columnMenu(): GridOptions['columnMenu'];
|
|
89
|
+
/** `GridOptions.icons` as last set (`setIcons`); `{}` = none. */
|
|
90
|
+
icons(): HeaderIcons;
|
|
91
|
+
/**
|
|
92
|
+
* The styled tooltip layer for menu items, made on demand; null under `tooltips.browser` (their `title`
|
|
93
|
+
* then).
|
|
94
|
+
*/
|
|
95
|
+
tooltips(): TooltipLayer | null;
|
|
96
|
+
/** `GridOptions.contextMenu` as last set (`setContextMenu`). */
|
|
97
|
+
contextMenu(): GridOptions['contextMenu'];
|
|
98
|
+
/** Copying is on (`GridOptions.clipboard` not false): the menus offer the copy items. */
|
|
99
|
+
clipboardOn(): boolean;
|
|
100
|
+
/** The displayed columns have column groups (group header rows): the menus offer "Copy with group headers". */
|
|
101
|
+
columnGroups(): boolean;
|
|
102
|
+
/** `clipboard.keys` parsed: a copy item shows its bound key as its shortcut; null while copying is off. */
|
|
103
|
+
copyKeys(): CopyKeys | null;
|
|
104
|
+
/**
|
|
105
|
+
* A copy item chosen: `Grid.copy` with `headers` (undefined: the option's), the `write` hook's info saying
|
|
106
|
+
* `source: 'menu'`. A failed write is reported by the copy itself.
|
|
107
|
+
*/
|
|
108
|
+
copy(headers: boolean | 'groups' | undefined): void;
|
|
109
|
+
/**
|
|
110
|
+
* Whether Cut and Paste act — copying is on, its `cut` / `paste` too, and a displayed column may be
|
|
111
|
+
* editable. The default context menu offers only those that act; an app's own item that doesn't shows greyed.
|
|
112
|
+
*/
|
|
113
|
+
clipboardEdits(): {
|
|
114
|
+
cut: boolean;
|
|
115
|
+
paste: boolean;
|
|
116
|
+
};
|
|
117
|
+
/** The menu's Cut: `Grid.cut()`, the `write` hook's info saying `source: 'menu'`. */
|
|
118
|
+
cut(): void;
|
|
119
|
+
/** The menu's Paste: the clipboard read through `clipboard.read`, else `readText`; the operation's source `'menu'`. */
|
|
120
|
+
paste(): void;
|
|
121
|
+
/** Export is on (`GridOptions.export` not false): the menus offer Export. */
|
|
122
|
+
exportOn(): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* An export item chosen: every row in `format`, over the grid's other export options; with `row` (the
|
|
125
|
+
* context menu's Export selection) `rows: 'selection'`, that row its last fallback.
|
|
126
|
+
*/
|
|
127
|
+
export(format: ExportFormat, row?: number): void;
|
|
128
|
+
/**
|
|
129
|
+
* Scrolls the focused cell `cell` into view in the next pass (a pinned one's column only); resolves once a pass
|
|
130
|
+
* drew it (its row loaded): true while it is still the focused cell. A keyboard-opened
|
|
131
|
+
* context menu waits for it.
|
|
132
|
+
*/
|
|
133
|
+
revealCell(cell: CellAddress): Promise<boolean>;
|
|
134
|
+
/**
|
|
135
|
+
* The body's "no rows" placeholder is about to show, and its own live region will say it: it is on, a data
|
|
136
|
+
* column is displayed, and it does not show that text yet. A row count of 0 is then not announced here.
|
|
137
|
+
*/
|
|
138
|
+
placeholderAnnounces(): boolean;
|
|
139
|
+
/** The cell range model (`InteractHost.ranges`); null while cell selection is off. */
|
|
140
|
+
ranges(): RangeModel | null;
|
|
141
|
+
/** The range columns in display order (`InteractHost.rangeColumns`). */
|
|
142
|
+
rangeColumns(): RangeColumns;
|
|
143
|
+
/** The display row count the range model keeps (`InteractHost.rowCount`). */
|
|
144
|
+
rowCount(): number;
|
|
145
|
+
/** Reports a throwing app callback once per key. */
|
|
146
|
+
report(key: string, error: unknown): void;
|
|
147
|
+
/** Prints a developer hint once per key (a definition problem, e.g. an unknown filter operator). */
|
|
148
|
+
warn(key: string, message: string): void;
|
|
149
|
+
/**
|
|
150
|
+
* Stores the quick filter's text as `Grid.setQuickFilter` does, its change event naming `source`: the
|
|
151
|
+
* top bar's box writes through here with `'toolbar'`.
|
|
152
|
+
*/
|
|
153
|
+
setQuickFilter(text: string, source: 'toolbar' | 'api'): void;
|
|
154
|
+
/** Find's term (`''`: off) — the top bar's find box shows it; the Grid has no getter for it. */
|
|
155
|
+
findTerm(): string;
|
|
156
|
+
/** What find's last change event said (`FindModel.reported`): the find box's count without an index build. */
|
|
157
|
+
findReported(): FindReport;
|
|
158
|
+
/** Header cells take focus (`headerFocus`): the floating editors leave the page's tab order then. */
|
|
159
|
+
headerFocus(): boolean;
|
|
160
|
+
/**
|
|
161
|
+
* A popup closed by keyboard hands focus back: an opener inside the grid gives it to its header cell or
|
|
162
|
+
* body cell, a missing one to the grid's focused position. False: the caller places focus itself (an opener outside
|
|
163
|
+
* the body — the top bar's menu button or one outside the grid —, or cell and header focus off).
|
|
164
|
+
*/
|
|
165
|
+
refocus(opener: HTMLElement | null): boolean;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* The group column's filter over the grouped columns as the group popup and the group's floating cell read
|
|
169
|
+
* it: one shown entry both follow, kept here so it holds with `floatingFilter: false` too.
|
|
170
|
+
*/
|
|
171
|
+
export interface GroupFilterView {
|
|
172
|
+
entries(): readonly string[];
|
|
173
|
+
/** The group column has its own filter (`groupColumn.filter`). */
|
|
174
|
+
own(): boolean;
|
|
175
|
+
/** The shown entry, null without entries. */
|
|
176
|
+
shown(): string | null;
|
|
177
|
+
/** The picker chose an entry: it becomes the shown one; the group's floating cell follows. */
|
|
178
|
+
pick(id: string): void;
|
|
179
|
+
/** Called by the controller when the shown entry may have changed (pick, columns, filters). */
|
|
180
|
+
onShownChange(listener: () => void): () => void;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* The UI as the grid sees it. Later tasks add their parts here (filter popups, menus, the chooser, the side bar, the
|
|
184
|
+
* status bar, the floating row).
|
|
185
|
+
*/
|
|
186
|
+
export interface GridUi {
|
|
187
|
+
/** The popup layer, created on first use; the UI modules open their popups through it. */
|
|
188
|
+
readonly popups: PopupLayer;
|
|
189
|
+
/** `Grid.getOverlayHost`: the element app overlays attach to, created on first use. */
|
|
190
|
+
overlayHost(): HTMLElement;
|
|
191
|
+
/**
|
|
192
|
+
* `Grid.showColumnChooser`: the column chooser below the header's start, or below `anchor`; an
|
|
193
|
+
* open one is replaced.
|
|
194
|
+
*/
|
|
195
|
+
showColumnChooser(anchor?: HTMLElement): void;
|
|
196
|
+
/** A header filter button was clicked: opens the column's filter popup below it, or closes it. */
|
|
197
|
+
toggleFilter(id: string, anchor: HTMLElement): void;
|
|
198
|
+
/**
|
|
199
|
+
* `Grid.showFilter`: scrolls the column into view, then opens its filter popup; `item` opens the group
|
|
200
|
+
* popup on that picker item (an app floating renderer's `openFilter()`).
|
|
201
|
+
*/
|
|
202
|
+
showFilter(id: string, item?: string): void;
|
|
203
|
+
/** A header menu button was clicked: opens the column menu below it, or closes it. */
|
|
204
|
+
toggleColumnMenu(id: string, anchor: HTMLElement): void;
|
|
205
|
+
/** `Grid.showColumnMenu`: scrolls the column into view, then opens its menu. */
|
|
206
|
+
showColumnMenu(id: string): void;
|
|
207
|
+
/**
|
|
208
|
+
* A key on a focused header cell: `filter` opens the column's filter popup, `menu` the column's or the
|
|
209
|
+
* group's menu, from `cell`, to which a keyboard close returns focus. False when nothing opened (no filter, nothing
|
|
210
|
+
* to show).
|
|
211
|
+
*/
|
|
212
|
+
headerPopup(target: {
|
|
213
|
+
column: string;
|
|
214
|
+
} | {
|
|
215
|
+
group: ColumnGroupInfo;
|
|
216
|
+
}, which: 'filter' | 'menu', cell: HTMLElement): boolean;
|
|
217
|
+
/**
|
|
218
|
+
* A right-click on the header the grid took: the column's menu, a group's, or (`null`) the one without a
|
|
219
|
+
* column, at the pointer. True when a menu opened; false when there are no entries, so the browser's menu
|
|
220
|
+
* stays.
|
|
221
|
+
*/
|
|
222
|
+
headerMenu(target: {
|
|
223
|
+
column: string;
|
|
224
|
+
} | {
|
|
225
|
+
group: ColumnGroupInfo;
|
|
226
|
+
} | null, at: {
|
|
227
|
+
x: number;
|
|
228
|
+
y: number;
|
|
229
|
+
}): boolean;
|
|
230
|
+
/**
|
|
231
|
+
* A `contextmenu` over the body (the header's goes to `headerMenu`): the menu of the cell under the
|
|
232
|
+
* event's target, or of the empty area, at the pointer — or, given `focused` (no pointer-down came first: the menu
|
|
233
|
+
* key, assistive technology), the focused cell's, anchored to it. True when a menu opened (the grid then
|
|
234
|
+
* prevents the browser's); false when the browser's menu stays (editable targets).
|
|
235
|
+
*/
|
|
236
|
+
contextMenu(event: MouseEvent, focused: CellAddress | null): boolean;
|
|
237
|
+
/**
|
|
238
|
+
* The ContextMenu key or Shift+F10 on a focused cell (a pinned one's too): its menu anchored to
|
|
239
|
+
* it; false when none opened.
|
|
240
|
+
*/
|
|
241
|
+
cellContextMenu(cell: CellAddress): boolean;
|
|
242
|
+
/** `Grid.showContextMenu`: at a point, else at the cell (or row) when drawn, else the viewport's corner. */
|
|
243
|
+
showContextMenu(at: ContextMenuAt): void;
|
|
244
|
+
hidePopups(): void;
|
|
245
|
+
anyPopupOpen(): boolean;
|
|
246
|
+
onPopupChange(listener: (event: PopupChange) => void): () => void;
|
|
247
|
+
/** Where the floating-filter row's cells go: the floating filters fill them. */
|
|
248
|
+
floatingHooks(): FloatingHooks;
|
|
249
|
+
/** Focus into a column's floating editor (`FloatingCells.enter`); false when it has none. */
|
|
250
|
+
enterFloating(id: string, at?: 'first' | 'last'): boolean;
|
|
251
|
+
/** Tab between the group cell's boxes (`FloatingCells.step`); false when the move leaves the cell. */
|
|
252
|
+
floatingStep(id: string, from: Element, back: boolean): boolean;
|
|
253
|
+
/** `setHeaderFocus`: the floating editors' tab order follows. */
|
|
254
|
+
headerFocusChanged(): void;
|
|
255
|
+
/** `Grid.setSideBar`: the side bar is created on first need; a falsy value removes it. */
|
|
256
|
+
setSideBar(options: GridOptions['sideBar']): void;
|
|
257
|
+
/** `Grid.openToolPanel`: an unknown id or no side bar changes nothing. */
|
|
258
|
+
openToolPanel(id: string): void;
|
|
259
|
+
closeToolPanel(): void;
|
|
260
|
+
/** `Grid.getOpenToolPanel`. */
|
|
261
|
+
openToolPanelId(): string | null;
|
|
262
|
+
/** The shown side bar and its drop zones, for a header drag (`HeaderHost.sideBarZones`); null without one. */
|
|
263
|
+
sideBarZones(): SideBarZones | null;
|
|
264
|
+
/** Definitions or column state changed: lists, panels and UIs follow. */
|
|
265
|
+
columnsChanged(): void;
|
|
266
|
+
filtersChanged(ids: readonly string[], source: FilterChange['source']): void;
|
|
267
|
+
/** Rows or counts changed (the source's notification): the status bar, open set filters, a pending announcement. */
|
|
268
|
+
sourceChanged(change: SourceChange): void;
|
|
269
|
+
/** Pinned section `side`'s rows were set: an open context menu of a row there closes. */
|
|
270
|
+
pinnedRowsChanged(side: 'top' | 'bottom'): void;
|
|
271
|
+
/** `Grid.setStatusBar`: the bar is created on the first options that are not off. */
|
|
272
|
+
setStatusBar(options: GridOptions['statusBar']): void;
|
|
273
|
+
/** `Grid.setToolbar`: the top bar is created on the first options that are not off. */
|
|
274
|
+
setToolbar(options: GridOptions['toolbar']): void;
|
|
275
|
+
/** The top bar while it shows, for a header drag (`HeaderHost.toolbar`); null without one or while hidden. */
|
|
276
|
+
shownToolbar(): HTMLElement | null;
|
|
277
|
+
/**
|
|
278
|
+
* The quick filter's text changed, or (`fromApp`) the app wrote it — `setQuickFilter`, the prop, the same text
|
|
279
|
+
* included: the top bar's boxes hear an app write at once (a pending text gives way), and the bar follows.
|
|
280
|
+
*/
|
|
281
|
+
quickFilterChanged(fromApp: boolean): void;
|
|
282
|
+
/**
|
|
283
|
+
* The row selection or (`range`) the cell ranges changed: the selection panels follow once per frame; the
|
|
284
|
+
* aggregation waits for a finished range step.
|
|
285
|
+
*/
|
|
286
|
+
selectionChanged(range?: Pick<RangeChange, 'finished' | 'source'>): void;
|
|
287
|
+
/** Says `text` in the grid's polite live region. */
|
|
288
|
+
announce(text: string): void;
|
|
289
|
+
localeChanged(): void;
|
|
290
|
+
/** `setIcons`: the floating cells' funnels follow. */
|
|
291
|
+
iconsChanged(): void;
|
|
292
|
+
destroy(): void;
|
|
293
|
+
}
|
|
294
|
+
/** Called by the grid inside its effect scope: the controller's scope is a child of the grid's. */
|
|
295
|
+
export declare function createGridUi(host: UiHost): GridUi;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ColumnFilterModel, FilterButtons } from '../../filter/model';
|
|
2
|
+
import type { GridTexts } from '../../i18n/texts';
|
|
3
|
+
export type FilterButton = 'apply' | 'clear' | 'reset' | 'cancel';
|
|
4
|
+
export interface ApplyRulesDeps {
|
|
5
|
+
/** Applies a model (source 'ui'); null clears the column's filter. */
|
|
6
|
+
apply(model: ColumnFilterModel | null): void;
|
|
7
|
+
/** Closes the popup; a no-op in the filters panel. */
|
|
8
|
+
close(): void;
|
|
9
|
+
/** The column's applied model. */
|
|
10
|
+
applied(): ColumnFilterModel | null;
|
|
11
|
+
/** The UI shows `model`: empty (null) after Clear and Reset, the applied model after Cancel and `discard`. */
|
|
12
|
+
show(model: ColumnFilterModel | null): void;
|
|
13
|
+
}
|
|
14
|
+
export interface ApplyRules {
|
|
15
|
+
/** The buttons to draw, in the definition's order (unknown and repeated entries dropped). */
|
|
16
|
+
readonly buttons: readonly FilterButton[];
|
|
17
|
+
/** The UI's model changed by an edit; `valid: false` (an invalid range) applies nothing. */
|
|
18
|
+
staged(model: ColumnFilterModel | null, valid?: boolean): void;
|
|
19
|
+
/** A button was pressed. */
|
|
20
|
+
button(which: FilterButton): void;
|
|
21
|
+
/** Enter in an input: applies when there is an Apply button. */
|
|
22
|
+
enter(): void;
|
|
23
|
+
/** Runs a pending live apply now. */
|
|
24
|
+
flush(): void;
|
|
25
|
+
/** Leaving its place: a pending live apply runs, then the UI shows the applied model (unapplied edits dropped). */
|
|
26
|
+
discard(): void;
|
|
27
|
+
/**
|
|
28
|
+
* The applied model changed: an echo of this UI's own apply is ignored (its edits stay as typed); any other change
|
|
29
|
+
* drops a pending live apply and the UI shows the new model. `foreign`: the change is known to come from another
|
|
30
|
+
* place (e.g. a filter listener's nested change while this UI applies), so it is shown even then.
|
|
31
|
+
*/
|
|
32
|
+
setApplied(model: ColumnFilterModel | null, foreign?: boolean): void;
|
|
33
|
+
/** Drops a pending live apply (the UI goes away). */
|
|
34
|
+
cancel(): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The live debounce in ms: `debounceMs`, else the kind's default (a date with `picker: false` waits like text); 0
|
|
38
|
+
* with an Apply button.
|
|
39
|
+
*/
|
|
40
|
+
export declare function debounceOf(def: FilterButtons & {
|
|
41
|
+
picker?: boolean;
|
|
42
|
+
}, kind: string): number;
|
|
43
|
+
/** Call inside the UI's effect scope. */
|
|
44
|
+
export declare function createApplyRules(def: FilterButtons, kind: string, deps: ApplyRulesDeps): ApplyRules;
|
|
45
|
+
/** The buttons row: one native button per entry, Apply the primary one. */
|
|
46
|
+
export interface ButtonBar {
|
|
47
|
+
readonly el: HTMLElement;
|
|
48
|
+
/** Apply is disabled while the UI is invalid. */
|
|
49
|
+
setApplyEnabled(enabled: boolean): void;
|
|
50
|
+
retext(texts: GridTexts): void;
|
|
51
|
+
}
|
|
52
|
+
/** Call inside the UI's effect scope (the buttons' listeners stop with it). */
|
|
53
|
+
export declare function createButtonBar(buttons: readonly FilterButton[], texts: GridTexts, press: (which: FilterButton) => void): ButtonBar;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type DateFilterDef } from '../../filter/model';
|
|
2
|
+
import type { SimpleKindIo } from './simple';
|
|
3
|
+
/** The default `minDate`. */
|
|
4
|
+
export declare const MIN_DATE = "1000-01-01";
|
|
5
|
+
/**
|
|
6
|
+
* An input's text as a model date string ('YYYY-MM-DD hh:mm:ss', time 00:00:00 without `includeTime`); null when it is
|
|
7
|
+
* not a date or its day lies outside [min, max].
|
|
8
|
+
*/
|
|
9
|
+
export declare function readDateInput(text: string, includeTime: boolean, min?: string, max?: string): string | null;
|
|
10
|
+
/** A model date string as an input's text: the native inputs' value format, or ISO text with a space. */
|
|
11
|
+
export declare function writeDateInput(value: string, includeTime: boolean, picker: boolean): string;
|
|
12
|
+
export declare function dateIo(def: DateFilterDef): SimpleKindIo<string>;
|