@universal-material/data-grid 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +172 -2
- package/custom-elements.json +4652 -0
- package/dist/attribute-converters.d.ts +53 -0
- package/dist/attribute-converters.js +98 -0
- package/dist/attribute-converters.js.map +1 -0
- package/dist/change-source.d.ts +3 -0
- package/dist/change-source.js +2 -0
- package/dist/change-source.js.map +1 -0
- package/dist/data/data-source.d.ts +164 -0
- package/dist/data/data-source.js +75 -0
- package/dist/data/data-source.js.map +1 -0
- package/dist/data/local-source.d.ts +20 -0
- package/dist/data/local-source.js +94 -0
- package/dist/data/local-source.js.map +1 -0
- package/dist/data/remote-loader.d.ts +190 -0
- package/dist/data/remote-loader.js +608 -0
- package/dist/data/remote-loader.js.map +1 -0
- package/dist/export/csv.d.ts +28 -0
- package/dist/export/csv.js +61 -0
- package/dist/export/csv.js.map +1 -0
- package/dist/export/download.d.ts +7 -0
- package/dist/export/download.js +17 -0
- package/dist/export/download.js.map +1 -0
- package/dist/export/rows.d.ts +75 -0
- package/dist/export/rows.js +134 -0
- package/dist/export/rows.js.map +1 -0
- package/dist/export/slice.d.ts +15 -0
- package/dist/export/slice.js +35 -0
- package/dist/export/slice.js.map +1 -0
- package/dist/export/types.d.ts +155 -0
- package/dist/export/types.js +2 -0
- package/dist/export/types.js.map +1 -0
- package/dist/export/write.d.ts +38 -0
- package/dist/export/write.js +178 -0
- package/dist/export/write.js.map +1 -0
- package/dist/export-pdf/client.d.ts +75 -0
- package/dist/export-pdf/client.js +155 -0
- package/dist/export-pdf/client.js.map +1 -0
- package/dist/export-pdf/engine.d.ts +73 -0
- package/dist/export-pdf/engine.js +131 -0
- package/dist/export-pdf/engine.js.map +1 -0
- package/dist/export-pdf/grid-pdf.wasm +0 -0
- package/dist/export-pdf/index.d.ts +27 -0
- package/dist/export-pdf/index.js +566 -0
- package/dist/export-pdf/index.js.map +1 -0
- package/dist/export-pdf/serialize.d.ts +23 -0
- package/dist/export-pdf/serialize.js +127 -0
- package/dist/export-pdf/serialize.js.map +1 -0
- package/dist/export-pdf/types.d.ts +150 -0
- package/dist/export-pdf/types.js +2 -0
- package/dist/export-pdf/types.js.map +1 -0
- package/dist/export-pdf/worker.d.ts +2 -0
- package/dist/export-pdf/worker.js +81 -0
- package/dist/export-pdf/worker.js.map +1 -0
- package/dist/export-xlsx/formats.d.ts +14 -0
- package/dist/export-xlsx/formats.js +40 -0
- package/dist/export-xlsx/formats.js.map +1 -0
- package/dist/export-xlsx/index.d.ts +74 -0
- package/dist/export-xlsx/index.js +137 -0
- package/dist/export-xlsx/index.js.map +1 -0
- package/dist/features/adaptive.d.ts +25 -0
- package/dist/features/adaptive.js +47 -0
- package/dist/features/adaptive.js.map +1 -0
- package/dist/features/cell-content-focus.d.ts +29 -0
- package/dist/features/cell-content-focus.js +95 -0
- package/dist/features/cell-content-focus.js.map +1 -0
- package/dist/features/cell-range.d.ts +97 -0
- package/dist/features/cell-range.js +75 -0
- package/dist/features/cell-range.js.map +1 -0
- package/dist/features/clipboard.d.ts +28 -0
- package/dist/features/clipboard.js +48 -0
- package/dist/features/clipboard.js.map +1 -0
- package/dist/features/column-chooser.d.ts +91 -0
- package/dist/features/column-chooser.js +451 -0
- package/dist/features/column-chooser.js.map +1 -0
- package/dist/features/column-dnd.d.ts +10 -0
- package/dist/features/column-dnd.js +126 -0
- package/dist/features/column-dnd.js.map +1 -0
- package/dist/features/context-menu.d.ts +122 -0
- package/dist/features/context-menu.js +153 -0
- package/dist/features/context-menu.js.map +1 -0
- package/dist/features/drag-helper.d.ts +39 -0
- package/dist/features/drag-helper.js +108 -0
- package/dist/features/drag-helper.js.map +1 -0
- package/dist/features/drop-position.d.ts +15 -0
- package/dist/features/drop-position.js +24 -0
- package/dist/features/drop-position.js.map +1 -0
- package/dist/features/editing.d.ts +111 -0
- package/dist/features/editing.js +244 -0
- package/dist/features/editing.js.map +1 -0
- package/dist/features/filter-row.d.ts +80 -0
- package/dist/features/filter-row.js +538 -0
- package/dist/features/filter-row.js.map +1 -0
- package/dist/features/filtering.d.ts +55 -0
- package/dist/features/filtering.js +209 -0
- package/dist/features/filtering.js.map +1 -0
- package/dist/features/group-dnd.d.ts +11 -0
- package/dist/features/group-dnd.js +119 -0
- package/dist/features/group-dnd.js.map +1 -0
- package/dist/features/header-filter.d.ts +100 -0
- package/dist/features/header-filter.js +588 -0
- package/dist/features/header-filter.js.map +1 -0
- package/dist/features/host-label.d.ts +36 -0
- package/dist/features/host-label.js +184 -0
- package/dist/features/host-label.js.map +1 -0
- package/dist/features/keyboard.d.ts +59 -0
- package/dist/features/keyboard.js +127 -0
- package/dist/features/keyboard.js.map +1 -0
- package/dist/features/menu.d.ts +113 -0
- package/dist/features/menu.js +491 -0
- package/dist/features/menu.js.map +1 -0
- package/dist/features/resize.d.ts +82 -0
- package/dist/features/resize.js +214 -0
- package/dist/features/resize.js.map +1 -0
- package/dist/features/scroll-port.d.ts +51 -0
- package/dist/features/scroll-port.js +329 -0
- package/dist/features/scroll-port.js.map +1 -0
- package/dist/features/search.d.ts +45 -0
- package/dist/features/search.js +123 -0
- package/dist/features/search.js.map +1 -0
- package/dist/features/selection.d.ts +37 -0
- package/dist/features/selection.js +103 -0
- package/dist/features/selection.js.map +1 -0
- package/dist/features/sorting.d.ts +39 -0
- package/dist/features/sorting.js +53 -0
- package/dist/features/sorting.js.map +1 -0
- package/dist/features/toolbar.d.ts +125 -0
- package/dist/features/toolbar.js +135 -0
- package/dist/features/toolbar.js.map +1 -0
- package/dist/features/tree.d.ts +53 -0
- package/dist/features/tree.js +94 -0
- package/dist/features/tree.js.map +1 -0
- package/dist/features/validation.d.ts +48 -0
- package/dist/features/validation.js +172 -0
- package/dist/features/validation.js.map +1 -0
- package/dist/grid-column-def.d.ts +521 -0
- package/dist/grid-column-def.js +32 -0
- package/dist/grid-column-def.js.map +1 -0
- package/dist/grid-column.d.ts +173 -0
- package/dist/grid-column.js +382 -0
- package/dist/grid-column.js.map +1 -0
- package/dist/grid-i18n.d.ts +469 -0
- package/dist/grid-i18n.js +3222 -0
- package/dist/grid-i18n.js.map +1 -0
- package/dist/grid.d.ts +1510 -0
- package/dist/grid.js +15972 -0
- package/dist/grid.js.map +1 -0
- package/dist/grid.min.js +3966 -0
- package/dist/grid.styles.d.ts +2 -0
- package/dist/grid.styles.js +2849 -0
- package/dist/grid.styles.js.map +1 -0
- package/dist/render/cell.d.ts +16 -0
- package/dist/render/cell.js +78 -0
- package/dist/render/cell.js.map +1 -0
- package/dist/render/column-window.d.ts +18 -0
- package/dist/render/column-window.js +50 -0
- package/dist/render/column-window.js.map +1 -0
- package/dist/render/content.d.ts +45 -0
- package/dist/render/content.js +140 -0
- package/dist/render/content.js.map +1 -0
- package/dist/render/editors.d.ts +28 -0
- package/dist/render/editors.js +41 -0
- package/dist/render/editors.js.map +1 -0
- package/dist/render/footer.d.ts +61 -0
- package/dist/render/footer.js +61 -0
- package/dist/render/footer.js.map +1 -0
- package/dist/render/group-row.d.ts +35 -0
- package/dist/render/group-row.js +60 -0
- package/dist/render/group-row.js.map +1 -0
- package/dist/render/header.d.ts +108 -0
- package/dist/render/header.js +124 -0
- package/dist/render/header.js.map +1 -0
- package/dist/render/keyed-rows.d.ts +25 -0
- package/dist/render/keyed-rows.js +98 -0
- package/dist/render/keyed-rows.js.map +1 -0
- package/dist/render/virtualizer.d.ts +158 -0
- package/dist/render/virtualizer.js +721 -0
- package/dist/render/virtualizer.js.map +1 -0
- package/dist/row-model/added-rows.d.ts +32 -0
- package/dist/row-model/added-rows.js +95 -0
- package/dist/row-model/added-rows.js.map +1 -0
- package/dist/row-model/cell-range.d.ts +71 -0
- package/dist/row-model/cell-range.js +187 -0
- package/dist/row-model/cell-range.js.map +1 -0
- package/dist/row-model/columns.d.ts +102 -0
- package/dist/row-model/columns.js +222 -0
- package/dist/row-model/columns.js.map +1 -0
- package/dist/row-model/compare.d.ts +40 -0
- package/dist/row-model/compare.js +590 -0
- package/dist/row-model/compare.js.map +1 -0
- package/dist/row-model/distinct.d.ts +39 -0
- package/dist/row-model/distinct.js +105 -0
- package/dist/row-model/distinct.js.map +1 -0
- package/dist/row-model/filter.d.ts +80 -0
- package/dist/row-model/filter.js +582 -0
- package/dist/row-model/filter.js.map +1 -0
- package/dist/row-model/flatten.d.ts +129 -0
- package/dist/row-model/flatten.js +511 -0
- package/dist/row-model/flatten.js.map +1 -0
- package/dist/row-model/fold.d.ts +25 -0
- package/dist/row-model/fold.js +104 -0
- package/dist/row-model/fold.js.map +1 -0
- package/dist/row-model/format.d.ts +58 -0
- package/dist/row-model/format.js +239 -0
- package/dist/row-model/format.js.map +1 -0
- package/dist/row-model/group.d.ts +30 -0
- package/dist/row-model/group.js +173 -0
- package/dist/row-model/group.js.map +1 -0
- package/dist/row-model/lru.d.ts +19 -0
- package/dist/row-model/lru.js +48 -0
- package/dist/row-model/lru.js.map +1 -0
- package/dist/row-model/sort.d.ts +30 -0
- package/dist/row-model/sort.js +107 -0
- package/dist/row-model/sort.js.map +1 -0
- package/dist/row-model/summary.d.ts +64 -0
- package/dist/row-model/summary.js +213 -0
- package/dist/row-model/summary.js.map +1 -0
- package/dist/row-model/tree.d.ts +116 -0
- package/dist/row-model/tree.js +478 -0
- package/dist/row-model/tree.js.map +1 -0
- package/dist/row-model/types.d.ts +109 -0
- package/dist/row-model/types.js +5 -0
- package/dist/row-model/types.js.map +1 -0
- package/dist/row-model/value.d.ts +20 -0
- package/dist/row-model/value.js +57 -0
- package/dist/row-model/value.js.map +1 -0
- package/dist/state/grid-state.d.ts +147 -0
- package/dist/state/grid-state.js +295 -0
- package/dist/state/grid-state.js.map +1 -0
- package/dist/state/storage.d.ts +33 -0
- package/dist/state/storage.js +62 -0
- package/dist/state/storage.js.map +1 -0
- package/dist/state/versioned.d.ts +18 -0
- package/dist/state/versioned.js +56 -0
- package/dist/state/versioned.js.map +1 -0
- package/package.json +145 -6
package/dist/grid.d.ts
ADDED
|
@@ -0,0 +1,1510 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
2
|
+
import type { GridChangeSource } from './change-source.js';
|
|
3
|
+
import { type GridDataChanges, type GridDataSource, type GridKeyExpr, type GridRowKey, type GridLoadOptions, type GridLoadResult, type GridRemoteOperations, type GridScrollMode } from './data/data-source.js';
|
|
4
|
+
import type { GridCsvDownloadOptions, GridCsvOptions, GridExportData, GridExporter, GridExportErrorEventDetail, GridExportEventDetail, GridExportFormat, GridExportingEventDetail, GridExportOptions } from './export/types.js';
|
|
5
|
+
import { type GridCellRange, type GridCellRangeChangeEventDetail, type GridCellRangeInit, type GridCellRangeSummary, type GridCellSelectionMode, type GridPasteEventDetail } from './features/cell-range.js';
|
|
6
|
+
import { type GridClipboardMode } from './features/clipboard.js';
|
|
7
|
+
import { type GridContextMenuOpeningEventDetail } from './features/context-menu.js';
|
|
8
|
+
import { type GridEditChange, type GridEditMode, type GridEditTrigger, type GridValidationError } from './features/editing.js';
|
|
9
|
+
import { type GridColumnResizeEventDetail, type GridResizeMode } from './features/resize.js';
|
|
10
|
+
import { type GridSelectionMode } from './features/selection.js';
|
|
11
|
+
import { type GridSortMode } from './features/sorting.js';
|
|
12
|
+
import { type GridToolbarItem, type GridToolbarItemName } from './features/toolbar.js';
|
|
13
|
+
import { type GridChildrenExpr, type GridHasChildrenExpr, type GridParentKeyExpr, type GridTreeFilterMode, type GridTreeMode } from './features/tree.js';
|
|
14
|
+
import { type GridColumnDef, type GridColumnFixed, type GridColumnRenderingMode, type GridDetailRenderer, type GridNoDataRenderer, type GridRowFixed, type GridRowRenderer, type GridColumnRef, type GridGroupPath, type GridSort, type GridSortOrder, type GridSummary, type GridSummaryValue, type GridFilterExpression } from './grid-column-def.js';
|
|
15
|
+
import { type DataGridColumn } from './grid-column.js';
|
|
16
|
+
import { type GridState, type GridStateChangeEventDetail, type GridStateStorage } from './state/grid-state.js';
|
|
17
|
+
import './grid-column.js';
|
|
18
|
+
export type { GridCellRenderContext, GridCellRenderer, GridDetailRenderContext, GridDetailRenderer, GridGroupRenderContext, GridGroupRenderer, GridHeaderRenderContext, GridHeaderRenderer, GridNoDataRenderContext, GridNoDataRenderer, GridRenderContextBase, GridRenderResult, GridRowFixed, GridRowRenderContext, GridRowRenderer, GridRowRenderResult, GridColumnAlignment, GridColumnBooleanDisplay, GridColumnComparator, GridColumnDataType, GridColumnDef, GridColumnFixed, GridColumnRenderingMode, GridColumnFormat, GridColumnFormatter, GridColumnRef, GridGroupPath, GridGroupSummaryItem, GridNodeSummaryItem, GridFilterCondition, GridFilterExpression, GridFilterOperation, GridSort, GridSortOrder, GridSummary, GridSummaryAggregator, GridSummaryFormat, GridSummaryItem, GridSummaryType, GridSummaryValue, GridCustomRule, GridEditorRenderContext, GridEditorRenderer, GridEmailRule, GridPatternRule, GridRangeRule, GridRequiredRule, GridStringLengthRule, GridValidationContext, GridValidationRule, GridValidationRuleBase, GridValueSetter, } from './grid-column-def.js';
|
|
19
|
+
export type { GridEditChange, GridEditMode, GridEditTrigger, GridValidationError } from './features/editing.js';
|
|
20
|
+
export type { GridSortMode, GridSortingMode } from './features/sorting.js';
|
|
21
|
+
export type { GridSelectionMode } from './features/selection.js';
|
|
22
|
+
export type { GridDataChanges, GridDataSource, GridKeyExpr, GridLoadGroup, GridLoadGroupResult, GridLoadOptions, GridLoadResult, GridLoadSort, GridLoadSummary, GridRemoteOperations, GridRowKey, GridScrollMode, GridLoadTree, } from './data/data-source.js';
|
|
23
|
+
export type { GridChildrenExpr, GridHasChildrenExpr, GridParentKeyExpr, GridTreeFilterMode, GridTreeMode } from './features/tree.js';
|
|
24
|
+
export type { GridClipboardMode } from './features/clipboard.js';
|
|
25
|
+
export type { GridCellRange, GridCellRangeChangeEventDetail, GridCellRangeInit, GridCellRangeSummary, GridCellSelectionMode, GridPasteEventDetail, } from './features/cell-range.js';
|
|
26
|
+
export type { GridCsvDownloadOptions, GridCsvOptions, GridExportColumn, GridExportData, GridExportDataRow, GridExportGroupRow, GridExportOptions, GridExportRow, GridExportSummaryRow, GridExportFormat, GridExporter, GridExportingEventDetail, GridExportEventDetail, GridExportErrorEventDetail, GridExportProgress, } from './export/types.js';
|
|
27
|
+
export type { GridContextMenuContext, GridContextMenuItem, GridContextMenuItemActionContext, GridContextMenuItemName, GridContextMenuOpeningEventDetail, GridContextMenuTarget, } from './features/context-menu.js';
|
|
28
|
+
/** The automatic toolbar (`toolbarItems = null`), in order. Spread it to add your own items without losing future built-ins. */
|
|
29
|
+
export declare const GRID_DEFAULT_TOOLBAR_ITEMS: readonly GridToolbarItemName[];
|
|
30
|
+
export type { GridBuiltInToolbarItem, GridHostToolbarItem, GridToolbarButtonItem, GridToolbarContentItem, GridToolbarItem, GridToolbarItemActionContext, GridToolbarItemName, GridToolbarItemOptions, GridToolbarItemRenderContext, GridToolbarItemRenderer, } from './features/toolbar.js';
|
|
31
|
+
export type { GridColumnState, GridGroupExpansionState, GridRowExpansionState, GridNodeExpansionState, GridState, GridStateChangeEventDetail, GridStateChangeSource, GridStateGroupPath, GridStateStorage, } from './state/grid-state.js';
|
|
32
|
+
export { DataGridColumn } from './grid-column.js';
|
|
33
|
+
/** @deprecated Use `DataGridColumn`. */
|
|
34
|
+
export type UmDataGridColumn = DataGridColumn;
|
|
35
|
+
export type { GridChangeSource } from './change-source.js';
|
|
36
|
+
/** `detail` of `u-grid-sorting` and `u-grid-sort-change`. */
|
|
37
|
+
export interface GridSortEventDetail {
|
|
38
|
+
/** New sorting (a copy). */
|
|
39
|
+
sorting: GridSort[];
|
|
40
|
+
/** Previous sorting (a copy). */
|
|
41
|
+
previous: GridSort[];
|
|
42
|
+
/** `user` (header or group chip) or `api` (`sortColumn`, `clearSorting`). */
|
|
43
|
+
source: GridChangeSource;
|
|
44
|
+
}
|
|
45
|
+
/** `detail` of `u-grid-group-change`. */
|
|
46
|
+
export interface GridGroupEventDetail {
|
|
47
|
+
/** Grouped columns after the change, outermost first (a copy). */
|
|
48
|
+
grouping: GridColumnDef[];
|
|
49
|
+
/** Grouped columns before the change (a copy). */
|
|
50
|
+
previous: GridColumnDef[];
|
|
51
|
+
/** `user` (drag and drop) or `api` (`groupColumn`, `ungroupColumn`, `moveColumn`). */
|
|
52
|
+
source: GridChangeSource;
|
|
53
|
+
}
|
|
54
|
+
/** `detail` of `u-grid-group-expansion-change`. */
|
|
55
|
+
export interface GridGroupExpansionChangeEventDetail {
|
|
56
|
+
/** Values of the group from the outermost level; `null` when several groups changed (`expandAllGroups`/`collapseAllGroups`). */
|
|
57
|
+
groupPath: GridGroupPath | null;
|
|
58
|
+
/** Grouping level (0-based); `null` = every level. */
|
|
59
|
+
groupIndex: number | null;
|
|
60
|
+
/** New state. */
|
|
61
|
+
expanded: boolean;
|
|
62
|
+
/** `user` (toggle button, group panel menu) or `api`. */
|
|
63
|
+
source: GridChangeSource;
|
|
64
|
+
}
|
|
65
|
+
/** `detail` of `u-grid-row-expansion-change`. */
|
|
66
|
+
export interface GridRowExpansionChangeEventDetail {
|
|
67
|
+
/** Key of the master row (without `keyExpr`, the item itself). */
|
|
68
|
+
rowKey: unknown;
|
|
69
|
+
/** New state. */
|
|
70
|
+
expanded: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* `user` (toggle button, keyboard, a row edit that opened or closed the
|
|
73
|
+
* details) or `api` (`expandRow`/`collapseRow`, `focusCell`/`editCell` on a
|
|
74
|
+
* column hidden by `autoHideColumns`).
|
|
75
|
+
*/
|
|
76
|
+
source: GridChangeSource;
|
|
77
|
+
}
|
|
78
|
+
/** `detail` of `u-grid-adaptive-columns-change`. */
|
|
79
|
+
export interface GridAdaptiveColumnsChangeEventDetail {
|
|
80
|
+
/** Columns hidden now for lack of space (`autoHideColumns`), in column order (frozen). */
|
|
81
|
+
columns: readonly GridColumnDef[];
|
|
82
|
+
/** The columns hidden before the change (frozen). */
|
|
83
|
+
previous: readonly GridColumnDef[];
|
|
84
|
+
}
|
|
85
|
+
/** `detail` of `u-grid-node-expansion-change`. */
|
|
86
|
+
export interface GridNodeExpansionChangeEventDetail {
|
|
87
|
+
/** Key of the tree node (without `keyExpr`, the item itself); `null` when every node changed (`expandAllNodes`/`collapseAllNodes`). */
|
|
88
|
+
rowKey: unknown;
|
|
89
|
+
/** New state. */
|
|
90
|
+
expanded: boolean;
|
|
91
|
+
/** `user` (expand button, keyboard) or `api` (`expandNode`, `collapseNode`…; also a failed child load). */
|
|
92
|
+
source: GridChangeSource;
|
|
93
|
+
}
|
|
94
|
+
/** Options of `addRow`. */
|
|
95
|
+
export interface GridAddRowOptions {
|
|
96
|
+
/** Tree data: key of the parent node — the new row is its first child (the node expands). */
|
|
97
|
+
parentKey?: unknown;
|
|
98
|
+
}
|
|
99
|
+
/** `detail` of `u-grid-filter-change`. */
|
|
100
|
+
export interface GridFilterEventDetail {
|
|
101
|
+
/** Column filter after the change (read-only copy). */
|
|
102
|
+
filterValue: GridFilterExpression | null;
|
|
103
|
+
/** Column filter before the change. */
|
|
104
|
+
previousFilterValue: GridFilterExpression | null;
|
|
105
|
+
/** Search text after the change. */
|
|
106
|
+
searchText: string;
|
|
107
|
+
/** Search text before the change. */
|
|
108
|
+
previousSearchText: string;
|
|
109
|
+
/** `user` (filter row, header filter, search panel) or `api` (`clearFilter`). */
|
|
110
|
+
source: GridChangeSource;
|
|
111
|
+
}
|
|
112
|
+
/** `detail` of `u-grid-selection-change`. */
|
|
113
|
+
export interface GridSelectionChangeEventDetail {
|
|
114
|
+
/** Selected keys after the change (the frozen array also returned by `selectedKeys`). */
|
|
115
|
+
selectedKeys: readonly unknown[];
|
|
116
|
+
/** Selected keys before the change (frozen). */
|
|
117
|
+
previous: readonly unknown[];
|
|
118
|
+
/** Keys that entered the selection. */
|
|
119
|
+
added: readonly unknown[];
|
|
120
|
+
/** Keys that left the selection. */
|
|
121
|
+
removed: readonly unknown[];
|
|
122
|
+
/** `user` (click, checkbox, keyboard) or `api` (selection methods, `selectionMode` switched from `multiple` to `single`). */
|
|
123
|
+
source: GridChangeSource;
|
|
124
|
+
}
|
|
125
|
+
/** `detail` of `u-grid-copying`. */
|
|
126
|
+
export interface GridCopyEventDetail<TItem = any> {
|
|
127
|
+
/**
|
|
128
|
+
* Copied rows: with cell ranges, the distinct rows of the ranges in the
|
|
129
|
+
* displayed order; else the selected rows in the current order, or the row
|
|
130
|
+
* of the focused cell.
|
|
131
|
+
*/
|
|
132
|
+
readonly items: readonly TItem[];
|
|
133
|
+
/**
|
|
134
|
+
* Copied columns: with cell ranges, the union of their columns in the
|
|
135
|
+
* displayed order; else the visible exportable columns, or the focused column.
|
|
136
|
+
*/
|
|
137
|
+
readonly columns: readonly GridColumnDef<TItem>[];
|
|
138
|
+
/**
|
|
139
|
+
* The copied cell ranges (frozen), stacked vertically in creation order in
|
|
140
|
+
* `text`/`html`; empty when the selected rows or the focused cell are copied.
|
|
141
|
+
*/
|
|
142
|
+
readonly ranges: readonly GridCellRange<TItem>[];
|
|
143
|
+
/** Tab separated text the grid writes as `text/plain` (read only: cancel to write your own). */
|
|
144
|
+
readonly text: string;
|
|
145
|
+
/**
|
|
146
|
+
* Escaped `<table>` the grid writes as `text/html` (empty above 10,000
|
|
147
|
+
* rows). It carries `lang` (the grid's effective `language`) and, in a
|
|
148
|
+
* right-to-left grid, `dir="rtl"`. Cells protected against formulas keep
|
|
149
|
+
* the `'` prefix and get `style='mso-number-format:"\@"'`.
|
|
150
|
+
*/
|
|
151
|
+
readonly html: string;
|
|
152
|
+
/**
|
|
153
|
+
* The clipboard of the native `copy` event. After `preventDefault()` the
|
|
154
|
+
* grid writes nothing and lets the native copy go on: call `setData` here
|
|
155
|
+
* to write your own content (synchronously, in the listener). From
|
|
156
|
+
* `copySelection()` and the row menu "Copy" items it is a `DataTransfer` of
|
|
157
|
+
* the grid: canceled, the grid writes what the listener set on it (through
|
|
158
|
+
* the asynchronous Clipboard API), like the native copy does.
|
|
159
|
+
*/
|
|
160
|
+
readonly clipboardData: DataTransfer;
|
|
161
|
+
/** `user` (Ctrl/Cmd+C, the Edit menu, the row menu) or `api` (`copySelection()`). */
|
|
162
|
+
readonly source: GridChangeSource;
|
|
163
|
+
}
|
|
164
|
+
/** `detail` of `u-grid-loading` (cancelable: `preventDefault()` skips the call and keeps the rows shown). */
|
|
165
|
+
export interface GridLoadingEventDetail {
|
|
166
|
+
/** What the grid is about to ask the data source (frozen). */
|
|
167
|
+
options: GridLoadOptions;
|
|
168
|
+
}
|
|
169
|
+
/** `detail` of `u-grid-load`. */
|
|
170
|
+
export interface GridLoadEventDetail {
|
|
171
|
+
/** What the grid asked (frozen). */
|
|
172
|
+
options: GridLoadOptions;
|
|
173
|
+
/** What the data source returned. */
|
|
174
|
+
result: GridLoadResult;
|
|
175
|
+
}
|
|
176
|
+
/** `detail` of `u-grid-load-error`. */
|
|
177
|
+
export interface GridLoadErrorEventDetail {
|
|
178
|
+
/** What the grid asked (frozen). */
|
|
179
|
+
options: GridLoadOptions;
|
|
180
|
+
/** What the data source rejected with. */
|
|
181
|
+
error: unknown;
|
|
182
|
+
}
|
|
183
|
+
/** `detail` of `u-grid-page-change`. */
|
|
184
|
+
export interface GridPageChangeEventDetail {
|
|
185
|
+
/** Page after the change (0-based). */
|
|
186
|
+
pageIndex: number;
|
|
187
|
+
/** Page before the change. */
|
|
188
|
+
previousPageIndex: number;
|
|
189
|
+
/** Rows per page after the change. */
|
|
190
|
+
pageSize: number;
|
|
191
|
+
/** Rows per page before the change. */
|
|
192
|
+
previousPageSize: number;
|
|
193
|
+
/** `user` (pager, PageUp/PageDown, or a filter gesture that moved the page) or `api`. */
|
|
194
|
+
source: GridChangeSource;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Kind of the active cell: column header, data cell, selection checkbox
|
|
198
|
+
* cell, group row, summary row (group footer, totals), detail toggle cell or
|
|
199
|
+
* detail row (master-detail and the values of the columns hidden by
|
|
200
|
+
* `autoHideColumns`), row buttons column (editing), the cell of a
|
|
201
|
+
* full-width row (`rowRenderer`). May gain members in minor versions.
|
|
202
|
+
*/
|
|
203
|
+
export type GridCellType = 'header' | 'data' | 'selection' | 'group' | 'summary' | 'detail-toggle' | 'detail' | 'command' | 'full-width';
|
|
204
|
+
/** `detail` of `u-grid-focus-change`. */
|
|
205
|
+
export interface GridFocusChangeEventDetail {
|
|
206
|
+
/**
|
|
207
|
+
* Key of the data row of the active cell (the item without `keyExpr`; in a
|
|
208
|
+
* detail row, the key of its master row); `null` in headers, group and
|
|
209
|
+
* summary rows.
|
|
210
|
+
*/
|
|
211
|
+
rowKey: unknown;
|
|
212
|
+
/**
|
|
213
|
+
* Column of the active cell (in a band header, the band, with `cellType: 'header'`);
|
|
214
|
+
* `null` in the selection, detail toggle and row buttons (`cellType: 'command'`)
|
|
215
|
+
* columns, in detail rows, in group rows and in full-width cells. In a
|
|
216
|
+
* detail row with the values of the columns hidden by `autoHideColumns`,
|
|
217
|
+
* the column of the focused value (`cellType: 'detail'`; `null` on the
|
|
218
|
+
* detail cell itself).
|
|
219
|
+
*/
|
|
220
|
+
column: GridColumnDef | null;
|
|
221
|
+
/** Kind of the active cell. */
|
|
222
|
+
cellType: GridCellType;
|
|
223
|
+
/** `rowKey` before the change. */
|
|
224
|
+
previousRowKey: unknown;
|
|
225
|
+
/** `column` before the change. */
|
|
226
|
+
previousColumn: GridColumnDef | null;
|
|
227
|
+
/**
|
|
228
|
+
* `'top'`/`'bottom'` when the active cell is in a fixed row
|
|
229
|
+
* (`fixedTopItems`/`fixedBottomItems`; the same key may also be in the
|
|
230
|
+
* body), `null` otherwise.
|
|
231
|
+
*/
|
|
232
|
+
rowFixed: GridRowFixed;
|
|
233
|
+
/** `rowFixed` before the change. */
|
|
234
|
+
previousRowFixed: GridRowFixed;
|
|
235
|
+
/** `user` (keyboard, click) or `api` (`focusCell`, or the active column hidden by `autoHideColumns`). */
|
|
236
|
+
source: GridChangeSource;
|
|
237
|
+
}
|
|
238
|
+
/** `detail` of `u-grid-edit-starting` (cancelable: `preventDefault()` keeps the cell or row closed). */
|
|
239
|
+
export interface GridEditStartingEventDetail<TItem = any> {
|
|
240
|
+
/** Row key (a new row has an opaque provisional key). */
|
|
241
|
+
readonly rowKey: unknown;
|
|
242
|
+
/** The original row item (empty object for a new row). */
|
|
243
|
+
readonly item: TItem;
|
|
244
|
+
/** Column of the editor; `null` when a whole row opens without a column (`editRow`). */
|
|
245
|
+
readonly column: GridColumnDef<TItem> | null;
|
|
246
|
+
/** `user` (click, Enter/F2, Tab, Edit button) or `api` (`editCell`, `editRow`, `addRow`). */
|
|
247
|
+
readonly source: GridChangeSource;
|
|
248
|
+
}
|
|
249
|
+
/** `detail` of `u-grid-row-adding` (cancelable: no row is added). */
|
|
250
|
+
export interface GridRowAddingEventDetail<TItem = any> {
|
|
251
|
+
/** The new row (owned by the grid, already with the `addRow` argument): set its initial values here. Reassigning `detail.data` is ignored. */
|
|
252
|
+
readonly data: Partial<TItem>;
|
|
253
|
+
/** Tree data: key of the parent node of the new row (`undefined` = a root node, or not a tree). */
|
|
254
|
+
readonly parentKey: unknown;
|
|
255
|
+
/** `user` (Add row button) or `api` (`addRow`). */
|
|
256
|
+
readonly source: GridChangeSource;
|
|
257
|
+
}
|
|
258
|
+
/** `detail` of `u-grid-row-removing` (cancelable: the row stays; fired before the confirmation dialog). */
|
|
259
|
+
export interface GridRowRemovingEventDetail<TItem = any> {
|
|
260
|
+
/** Row key. */
|
|
261
|
+
readonly rowKey: unknown;
|
|
262
|
+
/** The row item. */
|
|
263
|
+
readonly item: TItem;
|
|
264
|
+
/** `user` (Delete button) or `api` (`removeRow`). */
|
|
265
|
+
readonly source: GridChangeSource;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* `detail` of `u-grid-row-validating`, fired for each added or edited row
|
|
269
|
+
* before saving. Cancelable: `preventDefault()` (or `setError`) keeps the
|
|
270
|
+
* row unsaved and marked invalid.
|
|
271
|
+
*/
|
|
272
|
+
export interface GridRowValidatingEventDetail<TItem = any> {
|
|
273
|
+
/** Row key. */
|
|
274
|
+
readonly rowKey: unknown;
|
|
275
|
+
/** The original row item (empty object for a new row). */
|
|
276
|
+
readonly item: TItem;
|
|
277
|
+
/** The pending change of the row (a copy). */
|
|
278
|
+
readonly change: GridEditChange<TItem>;
|
|
279
|
+
/** Rules broken by the values of the row (empty when the rules passed). */
|
|
280
|
+
readonly errors: readonly GridValidationError<TItem>[];
|
|
281
|
+
/** Marks the row invalid with a message, on a column (its cell) or on the row. Implies `preventDefault()`; may be called several times. */
|
|
282
|
+
setError(message: string, column?: GridColumnDef<TItem>): void;
|
|
283
|
+
/** `user` (Enter, Save buttons) or `api` (`saveChanges`). */
|
|
284
|
+
readonly source: GridChangeSource;
|
|
285
|
+
}
|
|
286
|
+
/** `detail` of `u-grid-saving` (cancelable: nothing is saved and the changes stay pending). */
|
|
287
|
+
export interface GridSavingEventDetail<TItem = any> {
|
|
288
|
+
/** The changes to save (copies). */
|
|
289
|
+
readonly changes: readonly GridEditChange<TItem>[];
|
|
290
|
+
/**
|
|
291
|
+
* Makes the grid wait for `promise` (save on the server here). Rejected:
|
|
292
|
+
* the changes stay pending and `u-grid-save-error` fires. Resolved with
|
|
293
|
+
* `GridDataChanges` (e.g. new rows with the keys the server created): the
|
|
294
|
+
* grid applies those instead of the ones it computed. Only during the
|
|
295
|
+
* event dispatch (`InvalidStateError` afterwards); several calls wait for
|
|
296
|
+
* all, and the first promise that resolves with an object wins.
|
|
297
|
+
*/
|
|
298
|
+
waitUntil(promise: Promise<void | GridDataChanges<TItem>>): void;
|
|
299
|
+
/** `user` or `api`. */
|
|
300
|
+
readonly source: GridChangeSource;
|
|
301
|
+
}
|
|
302
|
+
/** `detail` of `u-grid-save`. */
|
|
303
|
+
export interface GridSaveEventDetail<TItem = any> {
|
|
304
|
+
/** The saved changes. */
|
|
305
|
+
readonly changes: readonly GridEditChange<TItem>[];
|
|
306
|
+
/** With `items`: the new array the grid now shows (also returned by `grid.items`) — keep it in your state. `null` with `dataSource`. */
|
|
307
|
+
readonly items: TItem[] | null;
|
|
308
|
+
/** `user` or `api`. */
|
|
309
|
+
readonly source: GridChangeSource;
|
|
310
|
+
}
|
|
311
|
+
/** `detail` of `u-grid-save-error`. */
|
|
312
|
+
export interface GridSaveErrorEventDetail<TItem = any> {
|
|
313
|
+
/** The changes that were not saved (still pending). */
|
|
314
|
+
readonly changes: readonly GridEditChange<TItem>[];
|
|
315
|
+
/** What the `waitUntil` promise rejected with. */
|
|
316
|
+
readonly error: unknown;
|
|
317
|
+
/** `user` or `api`. */
|
|
318
|
+
readonly source: GridChangeSource;
|
|
319
|
+
}
|
|
320
|
+
/** `detail` of `u-grid-edit-cancel`. */
|
|
321
|
+
export interface GridEditCancelEventDetail<TItem = any> {
|
|
322
|
+
/** The discarded changes. */
|
|
323
|
+
readonly changes: readonly GridEditChange<TItem>[];
|
|
324
|
+
/** `user` (Esc, Cancel, Discard changes) or `api` (`discardChanges`, `items` replaced without the rows). */
|
|
325
|
+
readonly source: GridChangeSource;
|
|
326
|
+
}
|
|
327
|
+
export type { GridColumnResizeEventDetail, GridResizeMode } from './features/resize.js';
|
|
328
|
+
export { setGridLanguage, setGridTranslation, gridLanguageContext, type GridI18n, type GridI18nInput } from './grid-i18n.js';
|
|
329
|
+
/**
|
|
330
|
+
* `detail` of `u-grid-column-visibility-change`: one event per column whose
|
|
331
|
+
* own visibility changed (a band first, then each column it shows). A band
|
|
332
|
+
* that disappears because none of its columns is visible fires nothing.
|
|
333
|
+
*/
|
|
334
|
+
export interface GridColumnVisibilityChangeEventDetail {
|
|
335
|
+
/** The column (or band) shown or hidden. */
|
|
336
|
+
column: GridColumnDef;
|
|
337
|
+
/** New visibility. */
|
|
338
|
+
visible: boolean;
|
|
339
|
+
}
|
|
340
|
+
/** `detail` of `u-grid-column-fixed-change`. */
|
|
341
|
+
export interface GridColumnFixedChangeEventDetail {
|
|
342
|
+
/** The column fixed or unfixed. */
|
|
343
|
+
column: GridColumnDef;
|
|
344
|
+
/** New side (`null` = not fixed). */
|
|
345
|
+
fixed: GridColumnFixed;
|
|
346
|
+
/** Side before the change. */
|
|
347
|
+
previousFixed: GridColumnFixed;
|
|
348
|
+
}
|
|
349
|
+
/** `detail` of `u-grid-column-reorder`. Positions among the column's siblings (same `band`, or the top level) that are not grouped; hidden ones count. */
|
|
350
|
+
export interface GridColumnReorderEventDetail {
|
|
351
|
+
/** The moved column (a leaf column or a band). */
|
|
352
|
+
column: GridColumnDef;
|
|
353
|
+
/** Band that contains the column; `null` at the top level. */
|
|
354
|
+
band: GridColumnDef | null;
|
|
355
|
+
/** New position among the column's siblings (same band, or top level) that are not grouped; hidden ones count. */
|
|
356
|
+
index: number;
|
|
357
|
+
/** Position before the move, among the same siblings. */
|
|
358
|
+
previousIndex: number;
|
|
359
|
+
/** @deprecated Use `previousIndex`. */
|
|
360
|
+
fromIndex: number;
|
|
361
|
+
/** @deprecated Use `index`. */
|
|
362
|
+
toIndex: number;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Data grid with row virtualization, grouping, sorting, filtering (filter
|
|
366
|
+
* row, header filter, search panel), column resizing, fixing, hiding and
|
|
367
|
+
* reordering, i18n and SSR.
|
|
368
|
+
*
|
|
369
|
+
* Name the grid with `aria-label` or `aria-labelledby` on `<u-grid>`: they
|
|
370
|
+
* name the inner `role="grid"`/`"treegrid"` table. `aria-labelledby` ids are
|
|
371
|
+
* resolved in the grid's root (document or enclosing shadow root); their
|
|
372
|
+
* text is copied and kept in sync.
|
|
373
|
+
*
|
|
374
|
+
* @summary Data grid web component.
|
|
375
|
+
*
|
|
376
|
+
* @slot - `<u-grid-column>` elements (declarative columns).
|
|
377
|
+
*
|
|
378
|
+
* @fires {CustomEvent<GridSortEventDetail>} u-grid-sorting - Before the sorting changes (user or API). Cancelable.
|
|
379
|
+
* @fires {CustomEvent<GridSortEventDetail>} u-grid-sort-change - After the sorting changed (user or API).
|
|
380
|
+
* @fires {CustomEvent<GridGroupEventDetail>} u-grid-group-change - After the grouping changed (user — drag, Ctrl+G, group panel or column header menu — or API).
|
|
381
|
+
* @fires {CustomEvent<GridGroupExpansionChangeEventDetail>} u-grid-group-expansion-change - After groups were expanded or collapsed (user or API).
|
|
382
|
+
* @fires {CustomEvent<GridFilterEventDetail>} u-grid-filter-change - After the user filtered (filter row, header filter, search panel) or `clearFilter()` ran.
|
|
383
|
+
* Setting `filterValue`/`searchText` does not fire it.
|
|
384
|
+
* @fires {CustomEvent<GridColumnResizeEventDetail>} u-grid-column-resize - The user finished resizing a column (pointer release, keyboard, double-click auto-size or the column header menu).
|
|
385
|
+
* @fires {CustomEvent<GridColumnVisibilityChangeEventDetail>} u-grid-column-visibility-change - The user showed or hid a column (or a band) in the column chooser (one event per own change).
|
|
386
|
+
* @fires {CustomEvent<GridColumnFixedChangeEventDetail>} u-grid-column-fixed-change - The user fixed or unfixed a column (or a top-level band) from the column header menu ("Pin column").
|
|
387
|
+
* @fires {CustomEvent<GridColumnReorderEventDetail>} u-grid-column-reorder - The user moved a column or a band (drag and drop on the header or in the column chooser,
|
|
388
|
+
* Alt+Shift+←/→ on the header, Alt+Shift+↑/↓ in the column chooser, or the column header menu).
|
|
389
|
+
* @fires {CustomEvent<GridSelectionChangeEventDetail>} u-grid-selection-change - The selection changed: user gesture, selection method, `multiple` → `single` (not the `selectedKeys` setter).
|
|
390
|
+
* @fires {CustomEvent<GridLoadingEventDetail>} u-grid-loading - Before each call to `dataSource.load` (`dataSource` only). Cancelable: the call is skipped and the rows shown stay.
|
|
391
|
+
* @fires {CustomEvent<GridLoadEventDetail>} u-grid-load - A `dataSource.load` call resolved (not fired for aborted calls).
|
|
392
|
+
* @fires {CustomEvent<GridLoadErrorEventDetail>} u-grid-load-error - A `dataSource.load` call rejected (not fired for aborted calls); the grid shows the error bar with "Retry".
|
|
393
|
+
* @fires {CustomEvent<GridPageChangeEventDetail>} u-grid-page-change - The page or page size changed: pager, PageUp/PageDown, a filter gesture (back to the first page)
|
|
394
|
+
* or a clamp after the rows shrank (`source` of the change that caused it). Not the `pageIndex`/`pageSize` setters.
|
|
395
|
+
* @fires {CustomEvent<GridCopyEventDetail>} u-grid-copying - Before Ctrl/Cmd+C, the menu Copy items or `copySelection()` write the cell ranges, the selected rows (or the focused cell)
|
|
396
|
+
* to the clipboard (`source: 'user' | 'api'`). Cancelable.
|
|
397
|
+
* @fires {CustomEvent<GridCellRangeChangeEventDetail>} u-grid-cell-range-change - The cell ranges changed: user gesture (once, on release, for a drag), `selectCellRange`/`clearCellRanges`,
|
|
398
|
+
* or the grid cleared them because rows or columns changed (`source` of the cause: a gesture, or `api` for methods and setters such as `items`, `columns`, `cellSelectionMode`).
|
|
399
|
+
* @fires {CustomEvent<GridPasteEventDetail>} u-grid-pasting - Before Ctrl/Cmd+V or the cell menu "Paste" pastes into editable cells (`clipboard-mode="copy-paste"`; user only).
|
|
400
|
+
* Cancelable: nothing changes (on Ctrl/Cmd+V the native paste goes on).
|
|
401
|
+
* @fires {CustomEvent<GridNodeExpansionChangeEventDetail>} u-grid-node-expansion-change - A tree node was expanded or collapsed (button, keys, methods); fired when asked, before remote children load.
|
|
402
|
+
* @fires {CustomEvent<GridRowExpansionChangeEventDetail>} u-grid-row-expansion-change - A detail row was expanded or collapsed (toggle, keyboard, `expandRow`/`collapseRow`,
|
|
403
|
+
* a row edit or `focusCell`/`editCell` that opened the details of a column hidden by `autoHideColumns`; not `autoExpandRows`).
|
|
404
|
+
* @fires {CustomEvent<GridAdaptiveColumnsChangeEventDetail>} u-grid-adaptive-columns-change - The columns hidden for lack of space changed (`autoHideColumns`: the grid
|
|
405
|
+
* width, the columns, their widths or the property itself), after the render. Layout only: no `source`, not cancelable.
|
|
406
|
+
* @fires {CustomEvent<GridStateChangeEventDetail>} u-grid-state-change - `state-change-delay` ms after the last change of the user state (`getState`): user gesture,
|
|
407
|
+
* method, property or `setState` — once per burst, only if the state really changed — and after a restore from `stateStorage` (`sources: ['storage']`, not saved back).
|
|
408
|
+
* "Reset columns" (column header menu, `sources: ['user']`) and `resetColumns()` fire only this one, no column event.
|
|
409
|
+
* @fires {CustomEvent<GridFocusChangeEventDetail>} u-grid-focus-change - The active cell changed: keyboard, click, `focusCell`, `selectCellRange` (not the `focusedRowKey` setter;
|
|
410
|
+
* a relocation fires only when the active column hides or comes back with `autoHideColumns`, `source: 'api'`).
|
|
411
|
+
* @fires {CustomEvent<GridEditStartingEventDetail>} u-grid-edit-starting - Before a cell editor (or a row, `editMode="row"`) opens (user or API). Cancelable.
|
|
412
|
+
* @fires {CustomEvent<GridRowAddingEventDetail>} u-grid-row-adding - Before a new row is added (Add row button or `addRow`): set its initial values in `detail.data`. Cancelable.
|
|
413
|
+
* @fires {CustomEvent<GridRowRemovingEventDetail>} u-grid-row-removing - Before a row is deleted or marked for removal (Delete button, before the confirmation, or `removeRow`). Cancelable.
|
|
414
|
+
* @fires {CustomEvent<GridRowValidatingEventDetail>} u-grid-row-validating - Before saving, for each added or edited row. Cancelable: `preventDefault()`/`setError` marks the row invalid.
|
|
415
|
+
* @fires {CustomEvent<GridSavingEventDetail>} u-grid-saving - Before saving the pending changes: save on the server with `waitUntil(promise)`. Cancelable: the changes stay pending.
|
|
416
|
+
* @fires {CustomEvent<GridSaveEventDetail>} u-grid-save - The changes were saved and applied (`items` copy or `dataSource.applyChanges`).
|
|
417
|
+
* @fires {CustomEvent<GridSaveErrorEventDetail>} u-grid-save-error - The `waitUntil` promise rejected; the changes stay pending.
|
|
418
|
+
* @fires {CustomEvent<GridEditCancelEventDetail>} u-grid-edit-cancel - Pending changes were discarded (Esc, Cancel, Discard changes, `discardChanges`).
|
|
419
|
+
* @fires {CustomEvent<GridContextMenuOpeningEventDetail>} u-grid-context-menu-opening - Before a context menu opens (header, group panel, row, group row: right-click,
|
|
420
|
+
* long press, Shift+F10, the context menu key, the header "⋮" button, `openContextMenu`): change `detail.menuItems` in place. Cancelable; canceled or empty, the browser menu stays.
|
|
421
|
+
* @fires {CustomEvent<GridExportingEventDetail>} u-grid-exporting - Before an export started from the UI (toolbar, "More actions", row menu). Cancelable: export your own way (e.g. another format).
|
|
422
|
+
* @fires {CustomEvent<GridExportEventDetail>} u-grid-export - An export started from the UI finished.
|
|
423
|
+
* @fires {CustomEvent<GridExportErrorEventDetail>} u-grid-export-error - An export started from the UI failed (`detail.error`). Not fired when the export is canceled
|
|
424
|
+
* (`cancelExport()`, "Cancel export", an exporter rejecting with an `AbortError`).
|
|
425
|
+
*
|
|
426
|
+
* @cssprop --u-grid-background-color - Grid background.
|
|
427
|
+
* @cssprop --u-grid-color - Text color of the grid. Default: on-surface token (`rgb(29, 27, 32)`).
|
|
428
|
+
* @cssprop --u-grid-striped-background-color - Background of even rows when `striped`.
|
|
429
|
+
* @cssprop --u-grid-header-background-color - Header and sticky cells background.
|
|
430
|
+
* @cssprop --u-grid-toolbar-height - Minimum height of the bar above the table (group panel, search, chooser button); it grows when its content wraps. Default `56px`.
|
|
431
|
+
* @cssprop --u-grid-toolbar-padding - Padding of the bar. Default `8px 16px`.
|
|
432
|
+
* @cssprop --u-grid-toolbar-block-padding - Block padding of the bar. Default `8px`.
|
|
433
|
+
* @cssprop --u-grid-toolbar-inline-padding - Inline padding of the bar. Default: the cell inline padding.
|
|
434
|
+
* @cssprop --u-grid-header-cell-height - Height of the column header cells. Default `46px`.
|
|
435
|
+
* @cssprop --u-grid-header-cell-padding - Header cell padding.
|
|
436
|
+
* @cssprop --u-grid-header-cell-font-size - Header cell font size. Default `0.8125rem`.
|
|
437
|
+
* @cssprop --u-grid-header-cell-font-weight - Header cell font weight.
|
|
438
|
+
* @cssprop --u-grid-cell-padding - Data cell padding (shorthand; wins over the longhands). Default `13px 16px`.
|
|
439
|
+
* @cssprop --u-grid-cell-block-padding - Block padding of data and header cells; wins over the old `--u-table-cell-padding` and `--u-grid-data-cell-padding`. Default `13px`.
|
|
440
|
+
* @cssprop --u-grid-cell-inline-padding - Inline padding of data and header cells; wins over the old `--u-table-cell-padding` and `--u-grid-data-cell-padding`. Default `16px`.
|
|
441
|
+
* @cssprop --u-grid-cell-font-size - Data cell font size. Default `0.875rem`.
|
|
442
|
+
* @cssprop --u-grid-cell-font-weight - Data cell font weight.
|
|
443
|
+
* @cssprop --u-grid-row-hover-opacity - Intensity of the row and header hover tint (`0%` disables it). Default: state-layer hover token or `8%`.
|
|
444
|
+
* @cssprop --u-grid-line-opacity - Opacity of the row/column lines (derived from the text color). Default `20%`.
|
|
445
|
+
* @cssprop --u-grid-line-width - Base line thickness. Default `1px`.
|
|
446
|
+
* @cssprop --u-grid-row-line-width - Row separator thickness.
|
|
447
|
+
* @cssprop --u-grid-column-line-width - Column separator thickness.
|
|
448
|
+
* @cssprop --u-grid-group-toggle-color - Group expand/collapse chevron (and chooser button) color.
|
|
449
|
+
* @cssprop --u-grid-group-toggle-shape - Corner radius of the chevron button. Default `50%`.
|
|
450
|
+
* @cssprop --u-grid-group-row-emphasis - Emphasis of the group row text. Default `80%`.
|
|
451
|
+
* @cssprop --u-grid-group-chip-height - Group chip height. Default `32px`.
|
|
452
|
+
* @cssprop --u-grid-group-chip-padding - Group chip inline padding. Default `16px`.
|
|
453
|
+
* @cssprop --u-grid-group-chip-shape - Group chip corner radius. Default `8px`.
|
|
454
|
+
* @cssprop --u-grid-group-chip-outline-color - Group chip border color.
|
|
455
|
+
* @cssprop --u-grid-group-chip-outline-width - Group chip border width. Default `1px`.
|
|
456
|
+
* @cssprop --u-grid-group-chip-font-size - Group chip font size.
|
|
457
|
+
* @cssprop --u-grid-group-chip-font-weight - Group chip font weight.
|
|
458
|
+
* @cssprop --u-grid-group-chip-line-height - Group chip line height.
|
|
459
|
+
* @cssprop --u-grid-group-chip-letter-spacing - Group chip letter spacing.
|
|
460
|
+
* @cssprop --u-grid-focus-ring-color - Keyboard focus ring color.
|
|
461
|
+
* @cssprop --u-grid-focus-ring-width - Keyboard focus ring width. Default `2px`.
|
|
462
|
+
* @cssprop --u-grid-selected-row-background-color - Background of selected rows. Default: primary color at 12%.
|
|
463
|
+
* @cssprop --u-grid-selected-row-indicator-color - Bar at the start of selected rows (selection is not shown by color alone). Default: primary color.
|
|
464
|
+
* @cssprop --u-grid-selected-row-indicator-width - Thickness of that bar; `0` hides it. Default `3px`.
|
|
465
|
+
* @cssprop --u-grid-sorted-header-color - Text color of sorted column headers.
|
|
466
|
+
* @cssprop --u-grid-sort-indicator-size - Size of the sort arrow. Default `1.125em`.
|
|
467
|
+
* @cssprop --u-grid-drop-indicator-color - Drag-and-drop drop indicator color.
|
|
468
|
+
* @cssprop --u-grid-drop-indicator-width - Drop indicator thickness. Default `3px`.
|
|
469
|
+
* @cssprop --u-grid-resize-handle-width - Invisible resize hit area at the end of each header cell (over the end padding, capped to it; the cursor changes on hover). Default `8px`.
|
|
470
|
+
* @cssprop --u-grid-column-header-menu-button-size - Size of the "⋮" column header menu button and of the header filter button. Default `24px` (WCAG 2.5.8).
|
|
471
|
+
* @cssprop --u-grid-resize-handle-color - Color of the separator shown at the column edge while dragging to resize. Default: `--u-grid-drop-indicator-color`.
|
|
472
|
+
* @cssprop --u-grid-fixed-shadow-color - Shadow at the edge of fixed columns while scrolling.
|
|
473
|
+
* @cssprop --u-grid-column-chooser-background-color - Column chooser background.
|
|
474
|
+
* @cssprop --u-grid-column-chooser-shape - Column chooser corner radius. Default `12px`.
|
|
475
|
+
* @cssprop --u-grid-summary-background-color - Background of the totals footer and group footers. Default: the header background.
|
|
476
|
+
* @cssprop --u-grid-fixed-row-background-color - Background of the fixed rows (opaque). Default: the header background.
|
|
477
|
+
* @cssprop --u-grid-fixed-row-shadow-color - Line between the fixed rows and the body. Default: the line color.
|
|
478
|
+
* @cssprop --u-grid-summary-cell-font-weight - Font weight of summary cells. Default `500`.
|
|
479
|
+
* @cssprop --u-grid-filter-row-height - Height of the filter row. Default: `--u-grid-header-cell-height` (`46px`).
|
|
480
|
+
* @cssprop --u-grid-search-highlight-background-color - Background of the search matches in cells.
|
|
481
|
+
* @cssprop --u-grid-search-highlight-color - Text color of the search matches in cells.
|
|
482
|
+
* @cssprop --u-grid-header-filter-button-active-color - Color of the header filter button of a filtered column.
|
|
483
|
+
* @cssprop --u-grid-header-filter-background-color - Header filter popover background.
|
|
484
|
+
* @cssprop --u-grid-header-filter-shape - Header filter popover corner radius. Default `12px`.
|
|
485
|
+
* @cssprop --u-grid-load-panel-background-color - Background of the load panel.
|
|
486
|
+
* @cssprop --u-grid-skeleton-row-color - Color of the placeholders in rows still loading.
|
|
487
|
+
* @cssprop --u-grid-pager-height - Minimum height of the pager. Default `56px`.
|
|
488
|
+
* @cssprop --u-grid-modified-cell-background-color - Background of edited, unsaved cells (`editMode="batch"`). Default: primary color at 10%.
|
|
489
|
+
* @cssprop --u-grid-modified-cell-indicator-color - Corner mark of edited, unsaved cells (not shown by color alone). Default: primary color.
|
|
490
|
+
* @cssprop --u-grid-invalid-cell-color - Border and message accent of cells with a validation error. Default: error token (`rgb(179, 38, 30)`).
|
|
491
|
+
* @cssprop --u-grid-added-row-background-color - Background of new, unsaved rows. Default: primary color at 6%.
|
|
492
|
+
* @cssprop --u-grid-menu-background-color - Background of the menus (context menus, "More actions", export). Default: surface-container token.
|
|
493
|
+
* @cssprop --u-grid-menu-shape - Corner radius of the menus. Default `4px`.
|
|
494
|
+
* @cssprop --u-grid-removed-row-opacity - Opacity of rows marked for removal (their text is also struck through). Default `0.7`.
|
|
495
|
+
* @cssprop --u-grid-selected-cell-background-color - Background of cells in a cell range. Default: primary color at 14%.
|
|
496
|
+
* @cssprop --u-grid-cell-range-border-color - Outline around each cell range (not shown by color alone). Default: primary color (`Highlight` in forced colors).
|
|
497
|
+
* @cssprop --u-grid-cell-range-border-width - Thickness of that outline. Default `2px`.
|
|
498
|
+
* @cssprop --u-grid-tree-indent - Indent of each tree level (`treeMode`). Default `24px`.
|
|
499
|
+
* @cssprop --u-grid-tree-toggle-color - Color of the tree expand button. Default: `--u-grid-group-toggle-color`.
|
|
500
|
+
*
|
|
501
|
+
* @csspart row - Every body row (`<tr>`; not the header nor the totals footer), fixed rows included.
|
|
502
|
+
* @csspart group-row - Group header rows.
|
|
503
|
+
* @csspart odd - Data rows in odd positions (the first data row is `odd`).
|
|
504
|
+
* @csspart even - Data rows in even positions.
|
|
505
|
+
* @csspart selected - Selected data rows (with `row`) and data cells in a cell range (with `cell`): use `row selected` or `cell selected`.
|
|
506
|
+
* @csspart cell - Data cells (`<td>`).
|
|
507
|
+
* @csspart selection-cell - Cells and header of the selection checkbox column.
|
|
508
|
+
* @csspart selection-checkbox - The selection checkboxes (rows and "select all").
|
|
509
|
+
* @csspart no-data - The cell rendered in the empty state.
|
|
510
|
+
* @csspart header-cell - Column header cells (`<th>`), bands included.
|
|
511
|
+
* @csspart band-header-cell - Band header cells (multi-level headers); they also match `header-cell`.
|
|
512
|
+
* @csspart sort-indicator - The sort arrow (and priority number) in headers and group chips.
|
|
513
|
+
* @csspart group-chip - Group chips in the group panel.
|
|
514
|
+
* @csspart column-chooser - The column chooser popover.
|
|
515
|
+
* @csspart summary-row - Rows with summaries: the totals footer and group footers.
|
|
516
|
+
* @csspart total-row - The totals footer row.
|
|
517
|
+
* @csspart group-footer-row - Group footer rows (summaries with `display: 'footer'`; with `row`, `summary-row` and `footer-row`).
|
|
518
|
+
* @csspart summary-cell - Cells with summaries (footers and `display: 'column'` in group rows).
|
|
519
|
+
* @csspart group-count - Count and inline summaries in a group row (`"(3, Sum of Population: 1,234)"`).
|
|
520
|
+
* @csspart toolbar - The bar above the table (group panel, buttons, search).
|
|
521
|
+
* @csspart toolbar-button - Toolbar buttons (built-in and host), with `add-row-button`, `save-button`, `discard-button`, `export-button` or `column-chooser-button`.
|
|
522
|
+
* @csspart toolbar-more-button - The "More actions" button that lists the toolbar items that do not fit.
|
|
523
|
+
* @csspart export-button - The toolbar export button (`exportFormats`).
|
|
524
|
+
* @csspart column-chooser-button - The toolbar column chooser button.
|
|
525
|
+
* @csspart menu - Every menu of the grid (with `column-header-menu`, `group-panel-menu`, `row-menu` or `toolbar-menu`).
|
|
526
|
+
* @csspart menu-item - Menu items.
|
|
527
|
+
* @csspart menu-separator - Menu separators.
|
|
528
|
+
* @csspart row-menu - The context menu of data and group rows.
|
|
529
|
+
* @csspart toolbar-menu - The "More actions" and export menus.
|
|
530
|
+
* @csspart group-panel-menu - The group panel context menu.
|
|
531
|
+
* @csspart column-header-menu - The column header context menu (and its "Pin column" submenu).
|
|
532
|
+
* @csspart column-header-menu-button - The "⋮" button that opens the column header menu in leaf headers (`show-column-header-menu-button`).
|
|
533
|
+
* @csspart filter-row - The filter row (`<tr>`) below the column headers.
|
|
534
|
+
* @csspart filter-cell - Cells of the filter row.
|
|
535
|
+
* @csspart filter-editor - Editors of the filter row (inputs, and the value menu button of boolean columns).
|
|
536
|
+
* @csspart filter-operation-button - The operation button of a filter row cell.
|
|
537
|
+
* @csspart search-input - The search panel input.
|
|
538
|
+
* @csspart header-filter-button - The funnel button in a column header (`header-filter`).
|
|
539
|
+
* @csspart header-filter - The header filter popover.
|
|
540
|
+
* @csspart detail-toggle-cell - Cells and header of the row details toggle column (master-detail and `autoHideColumns`).
|
|
541
|
+
* @csspart detail-toggle-button - The expand/collapse button of a master row.
|
|
542
|
+
* @csspart detail-row - Detail rows (with `row`).
|
|
543
|
+
* @csspart detail-cell - The full-width cell of a detail row.
|
|
544
|
+
* @csspart adaptive-fields - The list (`<dl>`) of the values of the columns hidden by `autoHideColumns`, in the detail cell.
|
|
545
|
+
* @csspart adaptive-field - A label + value pair of `adaptive-fields`.
|
|
546
|
+
* @csspart adaptive-label - The label (`<dt>`) of a hidden column: band path, column label, sort and filter marks.
|
|
547
|
+
* @csspart adaptive-value - The value (`<dd>`) of a hidden column (with `modified`/`invalid` like the cell).
|
|
548
|
+
* @csspart fixed-row - Fixed rows (`fixedTopItems`/`fixedBottomItems`; with `row`, `odd`/`even`, never `selected`).
|
|
549
|
+
* @csspart fixed-top-row - Rows fixed at the top (with `fixed-row`).
|
|
550
|
+
* @csspart fixed-bottom-row - Rows fixed at the bottom (with `fixed-row`).
|
|
551
|
+
* @csspart fixed-top-row-group - The row group (`<tbody>`) of the rows fixed at the top.
|
|
552
|
+
* @csspart fixed-bottom-row-group - The row group (`<tbody>`) of the rows fixed at the bottom.
|
|
553
|
+
* @csspart full-width-row - Rows rendered by `rowRenderer` (with `row`, `odd`/`even`, `selected`, `expanded`).
|
|
554
|
+
* @csspart full-width-cell - The cell that holds the `rowRenderer` content.
|
|
555
|
+
* @csspart expanded - Master rows whose detail is expanded, and expanded tree nodes (with `row`).
|
|
556
|
+
* @csspart tree-cell - The cell of the tree column (with `cell`): indent, expand button and content.
|
|
557
|
+
* @csspart tree-toggle-button - The expand/collapse button of a tree node.
|
|
558
|
+
* @csspart node-footer-row - Footer rows of `summary.node` items with `display: 'footer'` (with `row`, `summary-row` and `footer-row`).
|
|
559
|
+
* @csspart footer-row - Group and tree node footer rows (with `group-footer-row` / `node-footer-row`; the totals footer is `total-row`).
|
|
560
|
+
* @csspart node-summary - `summary.node` values with `display: 'inline'`, after the tree cell text (a `column` value makes its cell a `summary-cell`).
|
|
561
|
+
* @csspart pager - The pager (`<nav>`) below the table (`paging`).
|
|
562
|
+
* @csspart pager-button - Pager buttons (first, previous, page numbers, next, last).
|
|
563
|
+
* @csspart page-size-select - The page size `<select>` of the pager.
|
|
564
|
+
* @csspart page-info - The "Page x of y (n items)" text of the pager.
|
|
565
|
+
* @csspart load-panel - The load panel shown while a data source loads.
|
|
566
|
+
* @csspart skeleton-row - Rows of a remote source not loaded yet (with `row`).
|
|
567
|
+
* @csspart error-row - The bar shown when the data source failed.
|
|
568
|
+
* @csspart retry-button - The "Retry" button of the error bar.
|
|
569
|
+
* @csspart search-highlight - Search matches (`<mark>`) in native cells (not in `renderer` cells).
|
|
570
|
+
* @csspart modified - Edited, unsaved data cells (with `cell` or `adaptive-value`).
|
|
571
|
+
* @csspart invalid - Data cells with a validation error (with `cell` or `adaptive-value`).
|
|
572
|
+
* @csspart added - New, unsaved rows (with `row`).
|
|
573
|
+
* @csspart removed - Rows marked for removal (with `row`, `editMode="batch"`).
|
|
574
|
+
* @csspart cell-editor - The built-in cell editors (`<input>`).
|
|
575
|
+
* @csspart validation-message - The validation error shown below an invalid cell or row details value.
|
|
576
|
+
* @csspart cell-range-summary - The bar below the grid with the count, sum and average of the selected cells (`show-cell-range-summary`) and the "Adding to selection" text (Shift+F8).
|
|
577
|
+
* @csspart command-cell - Cells and header of the row buttons column (edit, delete).
|
|
578
|
+
* @csspart command-button - The row buttons (edit, save, cancel, delete, restore).
|
|
579
|
+
* @csspart add-row-button - The toolbar "Add row" button.
|
|
580
|
+
* @csspart save-button - The toolbar "Save changes" button (`editMode="batch"`).
|
|
581
|
+
* @csspart discard-button - The toolbar "Discard changes" button (`editMode="batch"`).
|
|
582
|
+
* @csspart remove-dialog - The delete confirmation dialog.
|
|
583
|
+
*/
|
|
584
|
+
export declare class DataGrid extends LitElement {
|
|
585
|
+
#private;
|
|
586
|
+
static styles: import("lit").CSSResult[];
|
|
587
|
+
static get observedAttributes(): string[];
|
|
588
|
+
/**
|
|
589
|
+
* Groups start expanded. INITIAL default: afterwards expansion is grid
|
|
590
|
+
* state (`expandGroup`, `expandAllGroups`…); changing it resets that state.
|
|
591
|
+
*/
|
|
592
|
+
autoExpandGroups: boolean;
|
|
593
|
+
/**
|
|
594
|
+
* Totals (footer fixed at the bottom) and group summaries (property only).
|
|
595
|
+
* Recomputed when the data, the grouping or the summary changes.
|
|
596
|
+
*/
|
|
597
|
+
get summary(): GridSummary | null;
|
|
598
|
+
set summary(value: GridSummary | null | undefined);
|
|
599
|
+
/**
|
|
600
|
+
* Builds the empty state (property only) shown when there are no rows to
|
|
601
|
+
* show; `ctx.filtered` tells a filter/search hid every item. Without it,
|
|
602
|
+
* the translated "No data" text.
|
|
603
|
+
*/
|
|
604
|
+
noDataRenderer: GridNoDataRenderer | null;
|
|
605
|
+
/**
|
|
606
|
+
* Builds the detail of a row (master-detail; property only). With it, a
|
|
607
|
+
* toggle column appears at the start and each expanded row is followed by
|
|
608
|
+
* a full-width detail row (variable height). Returning `null` renders an
|
|
609
|
+
* empty detail row. With `autoHideColumns`, the values of the hidden
|
|
610
|
+
* columns come first in the detail row.
|
|
611
|
+
*/
|
|
612
|
+
detailRenderer: GridDetailRenderer | null;
|
|
613
|
+
/**
|
|
614
|
+
* Detail rows start expanded (also the row details of `autoHideColumns`).
|
|
615
|
+
* INITIAL default: afterwards expansion is grid state (`expandRow`,
|
|
616
|
+
* `collapseRow`); changing it resets that state (no event).
|
|
617
|
+
*/
|
|
618
|
+
autoExpandRows: boolean;
|
|
619
|
+
/**
|
|
620
|
+
* Hides columns automatically when the grid itself is too narrow for them
|
|
621
|
+
* (its own width, not the window's), by `hidingPriority` (or from the last
|
|
622
|
+
* column); fixed columns never hide and at least one column stays. The
|
|
623
|
+
* values of the hidden ("adaptive") columns move to the row details: the
|
|
624
|
+
* toggle column appears and `expandRow`/`collapseRow` work even without
|
|
625
|
+
* `detailRenderer`. Layout only: hidden columns stay visible in the column
|
|
626
|
+
* chooser, `getState()`, exports, row copies, the search and the filters.
|
|
627
|
+
* See `getAdaptiveColumns()` and `u-grid-adaptive-columns-change`.
|
|
628
|
+
*/
|
|
629
|
+
autoHideColumns: boolean;
|
|
630
|
+
/**
|
|
631
|
+
* Rows fixed ("pinned") right below the column headers (property only):
|
|
632
|
+
* the host's own items, rendered with the grid columns (formatting, cell
|
|
633
|
+
* `renderer`, `rowRenderer`). They stay out of sorting, filtering, the
|
|
634
|
+
* search, grouping, paging (shown on every page), `getTotalCount()` and
|
|
635
|
+
* the summaries; they are not selectable nor editable. They expand like
|
|
636
|
+
* body rows (`detailRenderer`, columns hidden by `autoHideColumns`), by
|
|
637
|
+
* row key: a key also in the body expands in both places. The
|
|
638
|
+
* same object may also be in `items` (it shows in both places).
|
|
639
|
+
* @default []
|
|
640
|
+
*/
|
|
641
|
+
get fixedTopItems(): readonly any[];
|
|
642
|
+
set fixedTopItems(items: readonly any[] | null | undefined);
|
|
643
|
+
/**
|
|
644
|
+
* Like `fixedTopItems`, fixed right above the totals footer (property only).
|
|
645
|
+
* @default []
|
|
646
|
+
*/
|
|
647
|
+
get fixedBottomItems(): readonly any[];
|
|
648
|
+
set fixedBottomItems(items: readonly any[] | null | undefined);
|
|
649
|
+
/**
|
|
650
|
+
* Full-width rows (property only): builds the content of ONE cell spanning
|
|
651
|
+
* the data columns of a data or fixed row (group indents, detail toggle
|
|
652
|
+
* and selection checkbox stay). Return `false` to keep that row's columns
|
|
653
|
+
* — `null`/`nothing`/`''` give an EMPTY full-width row. See
|
|
654
|
+
* `GridRowRenderer` for when it runs.
|
|
655
|
+
*/
|
|
656
|
+
rowRenderer: GridRowRenderer | null;
|
|
657
|
+
/**
|
|
658
|
+
* Row key: a property `path` (dots allowed, attribute `key-expr`) or a
|
|
659
|
+
* function returning the key of an item. Selection (`selectedKeys`), focus
|
|
660
|
+
* (`focusedRowKey`, `focusCell`) and events use it; without it the key is
|
|
661
|
+
* the item object itself. With a key, replacing `items` with new objects
|
|
662
|
+
* keeps the selection, the focus and the group expansion. Changing it
|
|
663
|
+
* converts the selection to the new keys (keys whose row is gone are
|
|
664
|
+
* dropped, firing `u-grid-selection-change` with `source: 'api'`).
|
|
665
|
+
* @default null
|
|
666
|
+
*/
|
|
667
|
+
get keyExpr(): GridKeyExpr | null;
|
|
668
|
+
set keyExpr(value: GridKeyExpr | null | undefined);
|
|
669
|
+
/**
|
|
670
|
+
* Data source (property only): the grid calls `load(options, signal)` and
|
|
671
|
+
* shows what it returns — with `remoteOperations`, the server filters,
|
|
672
|
+
* sorts, groups, summarizes and pages. The grid never builds URLs or
|
|
673
|
+
* queries: validate the options on the server. Alternative to `items`.
|
|
674
|
+
* @default null
|
|
675
|
+
*/
|
|
676
|
+
get dataSource(): GridDataSource | null;
|
|
677
|
+
set dataSource(value: GridDataSource | null | undefined);
|
|
678
|
+
/**
|
|
679
|
+
* What the server does with `dataSource` (attribute `remote-operations`:
|
|
680
|
+
* all or nothing). `false` (default): one call loads every row and the
|
|
681
|
+
* grid filters, sorts, groups, summarizes and pages. `true`: everything on
|
|
682
|
+
* the server. An object picks operations; remote `paging` or `grouping`
|
|
683
|
+
* also turn on remote `filtering`, `sorting` and `summary` (paging also
|
|
684
|
+
* grouping), with a console warning. Remote operations use the column
|
|
685
|
+
* `path` (not `valueGetter`, `comparator` nor `groupValueGetter`).
|
|
686
|
+
*/
|
|
687
|
+
remoteOperations: boolean | GridRemoteOperations;
|
|
688
|
+
/**
|
|
689
|
+
* Makes `applyChanges()` re-apply filtering, sorting, grouping and
|
|
690
|
+
* summaries (attribute `reshape-on-changes`): updated rows move to their
|
|
691
|
+
* sorted place, rows that stop matching the filter leave and added rows go
|
|
692
|
+
* to their sorted place instead of the end. Several calls in one frame are
|
|
693
|
+
* reshaped once. While keyboard focus is in the grid body or an editor is
|
|
694
|
+
* open, values still update in place and the rows only move after focus
|
|
695
|
+
* leaves the body or the edit ends. With remote paging or grouping it
|
|
696
|
+
* reloads the rows in view from the server (one reload at a time). Only
|
|
697
|
+
* `applyChanges()`: saved edits keep their position. `false` (default):
|
|
698
|
+
* changes are applied in place.
|
|
699
|
+
*/
|
|
700
|
+
reshapeOnChanges: boolean;
|
|
701
|
+
/**
|
|
702
|
+
* Tree data: `none` (default) shows `items` as a list; `nested` reads the
|
|
703
|
+
* children of each item by `childrenExpr` (`items` are the roots); `flat`
|
|
704
|
+
* builds the tree from `keyExpr` + `parentKeyExpr` (both needed). Grouping,
|
|
705
|
+
* master-detail and `rowRenderer` are ignored in a tree (console warning).
|
|
706
|
+
* With `dataSource`, only `flat` (children load on demand with
|
|
707
|
+
* `hasChildrenExpr`).
|
|
708
|
+
*/
|
|
709
|
+
treeMode: GridTreeMode;
|
|
710
|
+
/** Children of an item with `treeMode="nested"`: a property `path` (attribute `children-expr`) or a function. */
|
|
711
|
+
childrenExpr: GridChildrenExpr | null;
|
|
712
|
+
/**
|
|
713
|
+
* Key of the parent of an item with `treeMode="flat"`: a property `path`
|
|
714
|
+
* (attribute `parent-key-expr`) or a function. `rootParentKey`, `null`,
|
|
715
|
+
* `undefined` or a key with no item = a root node.
|
|
716
|
+
* @default null
|
|
717
|
+
*/
|
|
718
|
+
parentKeyExpr: GridParentKeyExpr | null;
|
|
719
|
+
/**
|
|
720
|
+
* Parent key of the root nodes with `treeMode="flat"` (also asked to a
|
|
721
|
+
* `dataSource` as the first `parentKeys`). Compared by its text (the
|
|
722
|
+
* attribute is text): `"0"` matches `0`.
|
|
723
|
+
* @default null
|
|
724
|
+
*/
|
|
725
|
+
rootParentKey: GridRowKey | null;
|
|
726
|
+
/**
|
|
727
|
+
* With `dataSource`: whether a node has children not loaded yet (a
|
|
728
|
+
* property `path`, attribute `has-children-expr`, or a function); its
|
|
729
|
+
* children load when it expands.
|
|
730
|
+
* @default null
|
|
731
|
+
*/
|
|
732
|
+
hasChildrenExpr: GridHasChildrenExpr | null;
|
|
733
|
+
/**
|
|
734
|
+
* Column with the indent and the expand button (`name` or `path`, or the
|
|
735
|
+
* column object). Default: the first visible data column.
|
|
736
|
+
* @default null
|
|
737
|
+
*/
|
|
738
|
+
treeColumn: GridColumnRef | null;
|
|
739
|
+
/**
|
|
740
|
+
* What filtering and the search show in a tree: `with-ancestors` (default)
|
|
741
|
+
* the matching nodes and their ancestors; `full-branch` also all their
|
|
742
|
+
* descendants; `match-only` only the matching nodes (each under its
|
|
743
|
+
* nearest shown ancestor).
|
|
744
|
+
*/
|
|
745
|
+
treeFilterMode: GridTreeFilterMode;
|
|
746
|
+
/**
|
|
747
|
+
* Tree nodes start expanded. INITIAL default: afterwards expansion is grid
|
|
748
|
+
* state (`expandNode`, `expandAllNodes`…); changing it resets that state.
|
|
749
|
+
* With `dataSource` it only reaches loaded nodes (no cascade of loads).
|
|
750
|
+
*/
|
|
751
|
+
autoExpandNodes: boolean;
|
|
752
|
+
/**
|
|
753
|
+
* Checking a node checks its descendants; a parent is checked when all its
|
|
754
|
+
* children are, and mixed when some are. Needs `selectionMode="multiple"`
|
|
755
|
+
* and `showCheckboxes` (else ignored, with a console warning). Setting
|
|
756
|
+
* `selectedKeys` or `setState` applies the keys as given.
|
|
757
|
+
*/
|
|
758
|
+
recursiveSelection: boolean;
|
|
759
|
+
/** Splits the rows into pages (group rows count) and shows the pager below the table. */
|
|
760
|
+
paging: boolean;
|
|
761
|
+
/** Rows per page; also the block size asked to a remote source in virtual and infinite scrolling. Default `20`. */
|
|
762
|
+
pageSize: number;
|
|
763
|
+
/**
|
|
764
|
+
* Current page (0-based; with `paging`). The pager writes it; out-of-range
|
|
765
|
+
* values are clamped. Setting it does not fire `u-grid-page-change`.
|
|
766
|
+
* @default 0
|
|
767
|
+
*/
|
|
768
|
+
get pageIndex(): number;
|
|
769
|
+
set pageIndex(value: number);
|
|
770
|
+
/**
|
|
771
|
+
* Page sizes offered by the pager (attribute: a list, `"10, 20, 50"`);
|
|
772
|
+
* empty hides the selector. Default `[10, 20, 50, 100]`.
|
|
773
|
+
*/
|
|
774
|
+
pageSizeOptions: readonly number[];
|
|
775
|
+
/**
|
|
776
|
+
* `virtual` (default): every row is in the scroll range and a remote
|
|
777
|
+
* source loads the visible blocks. `infinite`: the next block loads when
|
|
778
|
+
* the end is reached (remote paging only; with `paging` the pager wins).
|
|
779
|
+
*/
|
|
780
|
+
scrollMode: GridScrollMode;
|
|
781
|
+
/**
|
|
782
|
+
* Scrolls the grid with an outer container instead of its own scrollbar:
|
|
783
|
+
* the id of an ANCESTOR of the grid (the first ancestor with this id,
|
|
784
|
+
* crossing shadow boundaries, unlike IDREF attributes), or `window` for
|
|
785
|
+
* the page (wins over an element with `id="window"`). The grid grows to
|
|
786
|
+
* its content (do not give it a height), the container scrolls in both
|
|
787
|
+
* directions, and rows and columns are still virtualized by the visible
|
|
788
|
+
* part of the container; toolbar, headers, totals, fixed rows and columns
|
|
789
|
+
* stick to it. The container's `scroll-padding-top`/`-bottom` offsets
|
|
790
|
+
* what the page sticks there (an app bar). `<html>` (or the
|
|
791
|
+
* `document.scrollingElement`) means the window; `<body>` only when it is
|
|
792
|
+
* the scrolling element. Not found, not an ancestor or empty: a console
|
|
793
|
+
* warning and the grid's own scrolling. An element between the grid and
|
|
794
|
+
* the container that clips or scrolls (`overflow` other than
|
|
795
|
+
* `visible`/`clip`) also warns: sticky headers would stick to it. Resolved when
|
|
796
|
+
* the grid connects and when this changes (changing the ancestor's id
|
|
797
|
+
* later does not re-resolve). The attribute alone renders the outer mode
|
|
798
|
+
* on the server.
|
|
799
|
+
*/
|
|
800
|
+
scrollContainer: string | null;
|
|
801
|
+
/**
|
|
802
|
+
* The outer scroll container by reference (wins over `scrollContainer`):
|
|
803
|
+
* an ancestor element, or `window`. `document.documentElement` (or the
|
|
804
|
+
* `document.scrollingElement`) means the window. See `scrollContainer`.
|
|
805
|
+
*/
|
|
806
|
+
scrollContainerElement: HTMLElement | Window | null;
|
|
807
|
+
/**
|
|
808
|
+
* Row items (property only). The grid never mutates this array or its
|
|
809
|
+
* items. Use either `items` or `dataSource` (both = console error, the
|
|
810
|
+
* data source wins).
|
|
811
|
+
*/
|
|
812
|
+
get items(): any[];
|
|
813
|
+
set items(items: readonly any[] | null | undefined);
|
|
814
|
+
/**
|
|
815
|
+
* Column definitions (property only). When set they take precedence over
|
|
816
|
+
* the `<u-grid-column>` children. The grid never mutates the array or the
|
|
817
|
+
* objects.
|
|
818
|
+
*/
|
|
819
|
+
get columns(): GridColumnDef[];
|
|
820
|
+
set columns(value: GridColumnDef[] | null | undefined);
|
|
821
|
+
/**
|
|
822
|
+
* How the user sorts by clicking the column headers: `single` (default)
|
|
823
|
+
* keeps one sorted column, `multiple` adds columns with Shift+click and
|
|
824
|
+
* `none` disables header sorting (the API still works).
|
|
825
|
+
*/
|
|
826
|
+
sortMode: GridSortMode;
|
|
827
|
+
/** @deprecated Use `sortMode` (attribute `sort-mode`). */
|
|
828
|
+
get sorting(): GridSortMode;
|
|
829
|
+
set sorting(value: GridSortMode);
|
|
830
|
+
/** Row height in px, padding included (rows with `wrap` columns or taller content grow; the virtualizer measures them). */
|
|
831
|
+
rowHeight: number;
|
|
832
|
+
/** Tints even rows. */
|
|
833
|
+
striped: boolean;
|
|
834
|
+
/** Shows the group panel (drop a header there to group). Default `true`; `show-group-panel="false"` hides it. */
|
|
835
|
+
showGroupPanel: boolean;
|
|
836
|
+
/** Shows the column headers. Default `true`; `show-column-headers="false"` hides them. */
|
|
837
|
+
showColumnHeaders: boolean;
|
|
838
|
+
/** Horizontal row separators. Default `true`; `show-row-lines="false"` hides them. */
|
|
839
|
+
showRowLines: boolean;
|
|
840
|
+
/** Vertical column separators. */
|
|
841
|
+
showColumnLines: boolean;
|
|
842
|
+
/** Shows the number of rows in group rows (`"Country: Brazil (3)"`). Default `true`; `show-group-count="false"` hides it. */
|
|
843
|
+
showGroupCount: boolean;
|
|
844
|
+
/**
|
|
845
|
+
* Built-in items of the group panel context menu (right-click, long press,
|
|
846
|
+
* Shift+F10 or the context menu key on a group chip): ungroup, move the
|
|
847
|
+
* chip left/right (grouping level), ungroup all, expand/collapse all
|
|
848
|
+
* groups. Default `true`; with `group-panel-menu="false"` the host may
|
|
849
|
+
* still add items through `u-grid-context-menu-opening`.
|
|
850
|
+
*/
|
|
851
|
+
groupPanelMenu: boolean;
|
|
852
|
+
/**
|
|
853
|
+
* Built-in items of the column header menu (the "⋮" button, right-click,
|
|
854
|
+
* long press, Shift+F10 or the context menu key on a header): sort, pin
|
|
855
|
+
* (a "Pin column" submenu), auto-size this or all columns, widen/narrow,
|
|
856
|
+
* move left/right, group by the column, open the column chooser and reset
|
|
857
|
+
* the columns. It is the single-pointer alternative to dragging (WCAG
|
|
858
|
+
* 2.5.7): with `column-header-menu="false"` the host must provide one
|
|
859
|
+
* (it may add items through `u-grid-context-menu-opening`). Only actions
|
|
860
|
+
* that apply to the column are listed; without any, the browser menu is
|
|
861
|
+
* kept. Default `true`.
|
|
862
|
+
*/
|
|
863
|
+
columnHeaderMenu: boolean;
|
|
864
|
+
/**
|
|
865
|
+
* Shows the "⋮" button that opens the column header menu in every leaf
|
|
866
|
+
* header with menu items (`column-header-menu`; band menus open by
|
|
867
|
+
* right-click, long press, Shift+F10 or the context menu key). It is always visible and takes
|
|
868
|
+
* width in the header. Default `true`; `show-column-header-menu-button="false"`
|
|
869
|
+
* hides it (the menu still opens by right-click, long press, Shift+F10 and
|
|
870
|
+
* the context menu key).
|
|
871
|
+
*/
|
|
872
|
+
showColumnHeaderMenuButton: boolean;
|
|
873
|
+
/**
|
|
874
|
+
* Lets the user pin columns to the start or the end ("Pin column" in the
|
|
875
|
+
* column header menu). Default `true`; `column-fixing="false"` removes the
|
|
876
|
+
* pin items. Columns pinned by `fixed` stay pinned.
|
|
877
|
+
*/
|
|
878
|
+
columnFixing: boolean;
|
|
879
|
+
/**
|
|
880
|
+
* Built-in items of the row context menu (right-click, long press,
|
|
881
|
+
* Shift+F10 or the context menu key on a cell): copy the cell or the
|
|
882
|
+
* selected rows, export the selected rows, edit, delete/restore, show/hide
|
|
883
|
+
* the detail; on group rows, expand/collapse and ungroup. On a full-width
|
|
884
|
+
* row (`rowRenderer`) Copy copies the row and there is no Edit; fixed rows
|
|
885
|
+
* have no context menu (nor `u-grid-context-menu-opening`). Default `false`
|
|
886
|
+
* (unlike `columnHeaderMenu`/`groupPanelMenu`), so the browser menu of the
|
|
887
|
+
* cells stays; the host may still add items through
|
|
888
|
+
* `u-grid-context-menu-opening`. With `cell-selection-mode` the cell menu
|
|
889
|
+
* opens anyway with its cell range items (the single-pointer alternative to
|
|
890
|
+
* dragging); remove them in `u-grid-context-menu-opening` to keep the
|
|
891
|
+
* browser menu (empty = browser menu). The browser menu is always kept with
|
|
892
|
+
* selected text, on editable fields and with Ctrl+right-click.
|
|
893
|
+
*/
|
|
894
|
+
rowMenu: boolean;
|
|
895
|
+
/**
|
|
896
|
+
* Items of the toolbar above the table (property only), in order:
|
|
897
|
+
* built-in names (`'searchPanel'`) or objects — `{ name, location,
|
|
898
|
+
* locateInMenu, showText, disabled, text }` configures a built-in, `{ text,
|
|
899
|
+
* icon, action }` is a host button and `{ renderer }` host content. A
|
|
900
|
+
* built-in shows only with its feature on (`showGroupPanel`,
|
|
901
|
+
* `showSearchPanel`, `columnChooser`, `exportFormats`, `allowAdding`,
|
|
902
|
+
* `editMode="batch"`). `null` (default) = `GRID_DEFAULT_TOOLBAR_ITEMS`;
|
|
903
|
+
* `[]` hides the bar (the editing status text still shows). Replace the
|
|
904
|
+
* array instead of mutating it; the getter returns a frozen copy.
|
|
905
|
+
*/
|
|
906
|
+
get toolbarItems(): readonly (GridToolbarItemName | GridToolbarItem)[] | null;
|
|
907
|
+
set toolbarItems(value: readonly (GridToolbarItemName | GridToolbarItem)[] | null | undefined);
|
|
908
|
+
/**
|
|
909
|
+
* Formats of the export UI: the toolbar export button and the "Export
|
|
910
|
+
* selected rows" items of the row menu. Attribute: words separated by
|
|
911
|
+
* spaces or commas (`export-formats="csv xlsx pdf"`). `xlsx` needs
|
|
912
|
+
* `xlsxExporter` and `pdf` needs `pdfExporter`. Default `[]` (no export
|
|
913
|
+
* UI; the export methods always work).
|
|
914
|
+
*/
|
|
915
|
+
get exportFormats(): readonly GridExportFormat[];
|
|
916
|
+
set exportFormats(value: readonly GridExportFormat[] | null | undefined);
|
|
917
|
+
/**
|
|
918
|
+
* Builds and downloads the Excel file of the export UI (property only):
|
|
919
|
+
* `createXlsxExporter(ExcelJS, options)` from
|
|
920
|
+
* `@universal-material/data-grid/export-xlsx`. Without it the `xlsx`
|
|
921
|
+
* entries are not shown.
|
|
922
|
+
*/
|
|
923
|
+
xlsxExporter: GridExporter | null;
|
|
924
|
+
/**
|
|
925
|
+
* Builds and downloads the PDF file of the export UI (property only):
|
|
926
|
+
* `createPdfExporter({ fonts })` from
|
|
927
|
+
* `@universal-material/data-grid/export-pdf`. Without it the `pdf`
|
|
928
|
+
* entries are not shown.
|
|
929
|
+
*/
|
|
930
|
+
pdfExporter: GridExporter | null;
|
|
931
|
+
/** Options of the CSV file of the export UI (property only): `fileName`, `separator`, `includeGroups`… */
|
|
932
|
+
csvExportOptions: Omit<GridCsvDownloadOptions, 'selectedOnly' | 'signal'> | null;
|
|
933
|
+
/** Shows the filter row below the column headers (an editor and an operation menu per filterable column). */
|
|
934
|
+
showFilterRow: boolean;
|
|
935
|
+
/** Shows the search box in the bar above the table (searches the displayed text of the visible filterable columns). */
|
|
936
|
+
showSearchPanel: boolean;
|
|
937
|
+
/** Shows a filter button in the headers of filterable columns: a popover with the distinct values. */
|
|
938
|
+
headerFilter: boolean;
|
|
939
|
+
/**
|
|
940
|
+
* Column filter (property only): a serializable expression such as
|
|
941
|
+
* `[['age', '>', 30], 'and', ['name', 'contains', 'an']]`. The filter row
|
|
942
|
+
* and the header filter read and write it, so it always holds the current
|
|
943
|
+
* filter. The grid keeps a frozen copy (never the host array). Setting it
|
|
944
|
+
* does not fire `u-grid-filter-change`.
|
|
945
|
+
*/
|
|
946
|
+
get filterValue(): GridFilterExpression | null;
|
|
947
|
+
set filterValue(value: GridFilterExpression | null | undefined);
|
|
948
|
+
/** Text of the search panel (case and accent insensitive). Setting it does not fire `u-grid-filter-change`. */
|
|
949
|
+
get searchText(): string;
|
|
950
|
+
set searchText(value: string | null | undefined);
|
|
951
|
+
/** Lets the user resize columns from the header edge (pointer and keyboard). */
|
|
952
|
+
columnResizing: boolean;
|
|
953
|
+
/**
|
|
954
|
+
* `widget`: only the column changes and the total width follows.
|
|
955
|
+
* `next-column`: the next column gives or takes the same amount (the
|
|
956
|
+
* total width is kept).
|
|
957
|
+
*/
|
|
958
|
+
resizeMode: GridResizeMode;
|
|
959
|
+
/**
|
|
960
|
+
* Shows the column chooser button in the bar above the table (and "Choose
|
|
961
|
+
* columns" in the column header menu). The chooser shows/hides columns,
|
|
962
|
+
* filters them by a search box and reorders them by dragging or
|
|
963
|
+
* Alt+Shift+↑/↓. Pin a column from its header menu.
|
|
964
|
+
*/
|
|
965
|
+
columnChooser: boolean;
|
|
966
|
+
/** Columns without `width` take the width of their content (header and rendered rows). */
|
|
967
|
+
columnAutoWidth: boolean;
|
|
968
|
+
/**
|
|
969
|
+
* How columns are rendered: `virtual` keeps only the columns in view (plus
|
|
970
|
+
* the fixed columns and the focused one) in the DOM, for very wide grids;
|
|
971
|
+
* `standard` renders all; `auto` (default) is `virtual` with more than 50
|
|
972
|
+
* leaf columns defined (visible, hidden or grouped). Under `virtual` a
|
|
973
|
+
* column without `width` takes its auto-size width or `max(minWidth, 150)` px.
|
|
974
|
+
*/
|
|
975
|
+
columnRenderingMode: GridColumnRenderingMode;
|
|
976
|
+
/**
|
|
977
|
+
* Row selection: `none` (default; the selection methods do nothing),
|
|
978
|
+
* `single` or `multiple`. Click selects, Ctrl+click toggles, Shift+click
|
|
979
|
+
* extends; Space, Shift+Space, Shift+↑/↓ and Ctrl+A on the keyboard.
|
|
980
|
+
*/
|
|
981
|
+
selectionMode: GridSelectionMode;
|
|
982
|
+
/**
|
|
983
|
+
* Shows a checkbox column (fixed at the start) with "select all" in the
|
|
984
|
+
* header. Only with `selection-mode="multiple"`; then a click on a row only
|
|
985
|
+
* moves the focus and the checkbox (or Space) selects.
|
|
986
|
+
*/
|
|
987
|
+
showCheckboxes: boolean;
|
|
988
|
+
/**
|
|
989
|
+
* Ctrl/Cmd+C on a cell of the grid: `copy` (default) copies the cell
|
|
990
|
+
* ranges, else the selected rows, else the focused cell, as tab separated
|
|
991
|
+
* text and an HTML table; `copy-paste` also lets Ctrl/Cmd+V paste tab
|
|
992
|
+
* separated text into editable cells (with `allowEditing`; fires
|
|
993
|
+
* `u-grid-pasting`); `none` leaves the clipboard alone. Text selected with
|
|
994
|
+
* the mouse is copied natively.
|
|
995
|
+
*/
|
|
996
|
+
clipboardMode: GridClipboardMode;
|
|
997
|
+
/**
|
|
998
|
+
* Cell range selection, like a spreadsheet: `none` (default), `single`
|
|
999
|
+
* (one rectangular range — not one cell) or `multiple` (Ctrl/Cmd+click,
|
|
1000
|
+
* Ctrl/Cmd+drag and Shift+F8 add ranges). Drag, Shift+click, Shift+arrows,
|
|
1001
|
+
* Shift+Home/End/PageUp/PageDown and Ctrl+A select data cells; with row
|
|
1002
|
+
* selection on too, rows are selected with the checkbox column and Space.
|
|
1003
|
+
* Ranges are cleared when rows or columns change (sorting, filtering,
|
|
1004
|
+
* grouping, paging…). The cell context menu then opens (even without
|
|
1005
|
+
* `row-menu`) with "Copy selected cells", "Paste" (`copy-paste`), "Extend
|
|
1006
|
+
* selection to this cell" and "Add cell to selection".
|
|
1007
|
+
*/
|
|
1008
|
+
cellSelectionMode: GridCellSelectionMode;
|
|
1009
|
+
/**
|
|
1010
|
+
* Shows a bar below the grid with the count, sum and average of the
|
|
1011
|
+
* selected cells (two or more). Numbers are summed by value, not by text.
|
|
1012
|
+
*/
|
|
1013
|
+
showCellRangeSummary: boolean;
|
|
1014
|
+
/**
|
|
1015
|
+
* How rows are edited: `cell` (default; a committed cell is saved at once),
|
|
1016
|
+
* `row` (Edit/Save/Cancel buttons per row) or `batch` (changes stay pending
|
|
1017
|
+
* until "Save changes" or `saveChanges()`).
|
|
1018
|
+
*/
|
|
1019
|
+
editMode: GridEditMode;
|
|
1020
|
+
/**
|
|
1021
|
+
* Lets the user edit cells (columns with `editable`, by default those with
|
|
1022
|
+
* `path`). A function (property only) decides per row. The grid never
|
|
1023
|
+
* mutates the items: changes are delivered in `u-grid-saving`. With
|
|
1024
|
+
* `dataSource`, editing needs `keyExpr`.
|
|
1025
|
+
* @default false
|
|
1026
|
+
*/
|
|
1027
|
+
allowEditing: boolean | ((item: any) => boolean);
|
|
1028
|
+
/** Shows the "Add row" button and allows `addRow()`. */
|
|
1029
|
+
allowAdding: boolean;
|
|
1030
|
+
/**
|
|
1031
|
+
* Shows the Delete button of each row and allows `removeRow()`. A function
|
|
1032
|
+
* (property only) decides per row.
|
|
1033
|
+
* @default false
|
|
1034
|
+
*/
|
|
1035
|
+
allowRemoving: boolean | ((item: any) => boolean);
|
|
1036
|
+
/** Pointer gesture that opens a cell editor: `click` (default) or `dblclick`. Enter and F2 always open it. */
|
|
1037
|
+
editTrigger: GridEditTrigger;
|
|
1038
|
+
/** Asks before deleting a row with the Delete button (not in `batch` mode, where removal is pending, nor with `removeRow()`). */
|
|
1039
|
+
confirmRemove: boolean;
|
|
1040
|
+
/**
|
|
1041
|
+
* Selected row keys (property only). Without `keyExpr` the key is the item
|
|
1042
|
+
* object itself, so replacing `items` with new objects loses the selection.
|
|
1043
|
+
* Keys missing from `items` are kept (and retained) until deselected. The
|
|
1044
|
+
* getter returns a frozen array — the same instance until the selection
|
|
1045
|
+
* changes. Setting it does not fire `u-grid-selection-change`.
|
|
1046
|
+
*/
|
|
1047
|
+
get selectedKeys(): readonly unknown[];
|
|
1048
|
+
set selectedKeys(keys: readonly unknown[] | null | undefined);
|
|
1049
|
+
/**
|
|
1050
|
+
* Key of the data row of the active cell (the cell keyboard navigation
|
|
1051
|
+
* starts from); `null` when it is a header, group or fixed row (the
|
|
1052
|
+
* setter only finds body rows). Setting it moves
|
|
1053
|
+
* the active cell to that row (scrolling to it) without taking the DOM
|
|
1054
|
+
* focus and without firing `u-grid-focus-change`; a key not in the rows is
|
|
1055
|
+
* ignored and `null` moves it to the first header (ignored when
|
|
1056
|
+
* `show-column-headers` is `false`).
|
|
1057
|
+
*/
|
|
1058
|
+
get focusedRowKey(): unknown;
|
|
1059
|
+
set focusedRowKey(key: unknown);
|
|
1060
|
+
/** @deprecated Use `striped`. */
|
|
1061
|
+
get stripped(): boolean;
|
|
1062
|
+
set stripped(value: boolean);
|
|
1063
|
+
/** @deprecated Use `showGroupPanel` (attribute `show-group-panel`). */
|
|
1064
|
+
get showHeader(): boolean;
|
|
1065
|
+
set showHeader(value: boolean);
|
|
1066
|
+
attributeChangedCallback(name: string, old: string | null, value: string | null): void;
|
|
1067
|
+
/**
|
|
1068
|
+
* Language used to resolve the built-in translations. When not set on the
|
|
1069
|
+
* component it is resolved, in order, from the Lit context, the document
|
|
1070
|
+
* (`<html lang>` / content-language meta) and finally the browser.
|
|
1071
|
+
*/
|
|
1072
|
+
get language(): string;
|
|
1073
|
+
set language(value: string | null | undefined);
|
|
1074
|
+
/**
|
|
1075
|
+
* Saves and restores the user state (see `getState`): `local` / `session`
|
|
1076
|
+
* (`localStorage` / `sessionStorage`, attribute `state-storage`, needs
|
|
1077
|
+
* `state-storage-key`) or an object with `load()` and `save()` (property
|
|
1078
|
+
* only). Read when the grid connects (and again when this or the key
|
|
1079
|
+
* changes), before the first render of data; while an asynchronous `load()`
|
|
1080
|
+
* runs the grid shows the load panel and no rows. Saved
|
|
1081
|
+
* `state-change-delay` ms after each change, and on disconnect or
|
|
1082
|
+
* `pagehide` when a save is pending. A `setState()` before connecting skips
|
|
1083
|
+
* the read. Unreadable or invalid saved states are ignored with a console
|
|
1084
|
+
* warning.
|
|
1085
|
+
* @default null
|
|
1086
|
+
*/
|
|
1087
|
+
get stateStorage(): 'local' | 'session' | GridStateStorage | null;
|
|
1088
|
+
set stateStorage(value: 'local' | 'session' | GridStateStorage | null | undefined);
|
|
1089
|
+
/**
|
|
1090
|
+
* Key of the state in `localStorage` / `sessionStorage` (required by `state-storage="local|session"`).
|
|
1091
|
+
* @default ''
|
|
1092
|
+
*/
|
|
1093
|
+
get stateStorageKey(): string;
|
|
1094
|
+
set stateStorageKey(value: string | null | undefined);
|
|
1095
|
+
/** Delay (ms) after the last change of the state before `u-grid-state-change` fires and the state is saved. Default `500`. */
|
|
1096
|
+
stateChangeDelay: number;
|
|
1097
|
+
/**
|
|
1098
|
+
* The user state (a new object, JSON serializable): column order, width,
|
|
1099
|
+
* visibility, fixing, grouping and sorting, the filter and the search text,
|
|
1100
|
+
* group expansion, the page, and — with `keyExpr` and string/number keys —
|
|
1101
|
+
* the selection and the expanded detail rows. Never row data. Columns are
|
|
1102
|
+
* identified by `name` (or `path`); columns without either are left out.
|
|
1103
|
+
*/
|
|
1104
|
+
getState(): GridState;
|
|
1105
|
+
/**
|
|
1106
|
+
* Applies a state (from `getState`, your storage or built by hand). It is
|
|
1107
|
+
* validated first: an invalid state is ignored with a console warning; an
|
|
1108
|
+
* older version is migrated, an unknown one ignored. Without `partial`,
|
|
1109
|
+
* every top-level key missing from `state` goes back to the initial value
|
|
1110
|
+
* (the column definitions and the properties the host set before the grid
|
|
1111
|
+
* connected); with `partial: true` only the keys present change. A
|
|
1112
|
+
* `columns` list sets the whole layout: columns missing from it go back to
|
|
1113
|
+
* their definition, at the end in definition order; unknown names are
|
|
1114
|
+
* ignored. Fires none of the per-feature events (like the setters), only
|
|
1115
|
+
* `u-grid-state-change`. Never moves the focus nor announces anything: when
|
|
1116
|
+
* a user gesture triggers it, announce the result yourself.
|
|
1117
|
+
* @param state The state to apply.
|
|
1118
|
+
* @param options `partial: true` changes only the keys present in `state`.
|
|
1119
|
+
*/
|
|
1120
|
+
setState(state: GridState, options?: {
|
|
1121
|
+
partial?: boolean;
|
|
1122
|
+
} | null): void;
|
|
1123
|
+
/** Puts the state back to the initial one (`setState` with an empty state, without `partial`). */
|
|
1124
|
+
resetState(): void;
|
|
1125
|
+
/** Os eventos de mudança dizem a origem (`source`) da rajada do estado. */
|
|
1126
|
+
dispatchEvent(event: Event): boolean;
|
|
1127
|
+
connectedCallback(): void;
|
|
1128
|
+
disconnectedCallback(): void;
|
|
1129
|
+
willUpdate(changed: PropertyValues<this>): void;
|
|
1130
|
+
firstUpdated(): void;
|
|
1131
|
+
updated(changed: PropertyValues<this>): void;
|
|
1132
|
+
/**
|
|
1133
|
+
* Sorts by `column` in `order` (`null` removes the column from the
|
|
1134
|
+
* sorting). Without `append` the column replaces the current sorting; with
|
|
1135
|
+
* it, the column is added (or keeps its priority if already sorted). For a
|
|
1136
|
+
* grouped column it sets the direction of its groups. A band does nothing.
|
|
1137
|
+
*/
|
|
1138
|
+
sortColumn(column: GridColumnDef, order: GridSortOrder | null, options?: {
|
|
1139
|
+
append?: boolean;
|
|
1140
|
+
}): void;
|
|
1141
|
+
/** @deprecated Use `sortColumn()`. */
|
|
1142
|
+
sortBy(column: GridColumnDef, order: GridSortOrder | null, options?: {
|
|
1143
|
+
append?: boolean;
|
|
1144
|
+
}): void;
|
|
1145
|
+
/** Removes the sorting of every column (grouped columns go back to ascending groups). */
|
|
1146
|
+
clearSorting(): void;
|
|
1147
|
+
/** Current sorting, in priority order (a copy). */
|
|
1148
|
+
getSorting(): GridSort[];
|
|
1149
|
+
/**
|
|
1150
|
+
* Groups by `column` at grouping level `targetIndex` (default: the
|
|
1151
|
+
* innermost level). An already grouped column moves to that level. Only
|
|
1152
|
+
* leaf columns group (a band does nothing); a grouped column leaves its
|
|
1153
|
+
* band in the header and returns to the end of it when ungrouped.
|
|
1154
|
+
*/
|
|
1155
|
+
groupColumn(column: GridColumnDef, targetIndex?: number): void;
|
|
1156
|
+
/** Removes `column` from the grouping; it goes back to the end of its band (or of the regular columns at the top level). */
|
|
1157
|
+
ungroupColumn(column: GridColumnDef): void;
|
|
1158
|
+
/** Grouped columns, outermost first (a copy). */
|
|
1159
|
+
getGrouping(): GridColumnDef[];
|
|
1160
|
+
/**
|
|
1161
|
+
* Expands every group of grouping level `groupIndex` (0-based), or of
|
|
1162
|
+
* every level without it. Also applies to groups that appear later
|
|
1163
|
+
* (new data, filter), until the next `expandAllGroups`/`collapseAllGroups`
|
|
1164
|
+
* call or a change of `autoExpandGroups` (which fires no event).
|
|
1165
|
+
*/
|
|
1166
|
+
expandAllGroups(groupIndex?: number): void;
|
|
1167
|
+
/** Collapses every group of level `groupIndex`, or of every level without it. See `expandAllGroups`. */
|
|
1168
|
+
collapseAllGroups(groupIndex?: number): void;
|
|
1169
|
+
/**
|
|
1170
|
+
* Expands one group (not its parents). `groupPath` = the group values from
|
|
1171
|
+
* the outermost level, e.g. `['Brazil', 'SP']`, compared as when grouping.
|
|
1172
|
+
* Needs the grouping set (at least `groupPath.length` grouped columns),
|
|
1173
|
+
* otherwise it is ignored; a group that has no rows yet keeps the state
|
|
1174
|
+
* (and the event fires) for when it appears.
|
|
1175
|
+
*/
|
|
1176
|
+
expandGroup(groupPath: GridGroupPath): void;
|
|
1177
|
+
/** Collapses one group (`groupPath` as in `expandGroup`). */
|
|
1178
|
+
collapseGroup(groupPath: GridGroupPath): void;
|
|
1179
|
+
/** Whether the group of `groupPath` is (or would be) expanded. */
|
|
1180
|
+
isGroupExpanded(groupPath: GridGroupPath): boolean;
|
|
1181
|
+
/**
|
|
1182
|
+
* Expands the detail of the row `rowKey` (master-detail, and the values of
|
|
1183
|
+
* the columns hidden by `autoHideColumns`; with neither `detailRenderer`
|
|
1184
|
+
* nor `autoHideColumns` it does nothing; with `autoHideColumns` the state is
|
|
1185
|
+
* kept even while no column is hidden). A key not in the rows (filtered out,
|
|
1186
|
+
* in a collapsed group, not in `items`) keeps the state — and the key —
|
|
1187
|
+
* until collapsed; parent groups are not expanded.
|
|
1188
|
+
*/
|
|
1189
|
+
expandRow(rowKey: unknown): void;
|
|
1190
|
+
/** Collapses the detail of the row `rowKey` (see `expandRow`). */
|
|
1191
|
+
collapseRow(rowKey: unknown): void;
|
|
1192
|
+
/**
|
|
1193
|
+
* Whether the detail of the row `rowKey` is (or would be) expanded; `false`
|
|
1194
|
+
* with neither `detailRenderer` nor `autoHideColumns`.
|
|
1195
|
+
*/
|
|
1196
|
+
isRowExpanded(rowKey: unknown): boolean;
|
|
1197
|
+
/**
|
|
1198
|
+
* Expands the tree node `rowKey` (`treeMode`). Never rejects: resolves
|
|
1199
|
+
* `true` when the node is expanded with its children ready (a `dataSource`
|
|
1200
|
+
* loads them first), `false` on a failed or aborted load, a leaf or a key
|
|
1201
|
+
* not in the tree.
|
|
1202
|
+
*/
|
|
1203
|
+
expandNode(rowKey: unknown): Promise<boolean>;
|
|
1204
|
+
/** Collapses the tree node `rowKey`; the active cell inside it moves to the node. */
|
|
1205
|
+
collapseNode(rowKey: unknown): void;
|
|
1206
|
+
/**
|
|
1207
|
+
* Whether the tree node `rowKey` is SHOWN expanded: `false` for a leaf (also
|
|
1208
|
+
* a node whose children are all filtered out), a key not in the tree, and
|
|
1209
|
+
* a remote node whose children are not loaded nor loading — even if the
|
|
1210
|
+
* expansion state (`getState().nodeExpansion`) says expanded.
|
|
1211
|
+
*/
|
|
1212
|
+
isNodeExpanded(rowKey: unknown): boolean;
|
|
1213
|
+
/** Expands every tree node (with `dataSource`: only the loaded ones; no loads). */
|
|
1214
|
+
expandAllNodes(): void;
|
|
1215
|
+
/** Collapses every tree node; the active cell moves to its root node. */
|
|
1216
|
+
collapseAllNodes(): void;
|
|
1217
|
+
/** Values of `summary.node` for the tree node `rowKey` (over its visible descendants); empty for a leaf or a key not shown. */
|
|
1218
|
+
getNodeSummaryValues(rowKey: unknown): GridSummaryValue[];
|
|
1219
|
+
/**
|
|
1220
|
+
* Computed summaries: the totals (`summary.total`) or, with `groupPath`,
|
|
1221
|
+
* the summaries of that group (`summary.group`; empty if the group does
|
|
1222
|
+
* not exist).
|
|
1223
|
+
*/
|
|
1224
|
+
getSummaryValues(groupPath?: GridGroupPath): GridSummaryValue[];
|
|
1225
|
+
/**
|
|
1226
|
+
* Moves a column (or a band, with all its columns) to `targetIndex` among
|
|
1227
|
+
* its siblings — the columns of the same band, or the top level — that are
|
|
1228
|
+
* not grouped (hidden ones count). Without bands that is the index among
|
|
1229
|
+
* the regular columns. The column stays in its band and in its block: fixed
|
|
1230
|
+
* at the start, free, or fixed at the end. A grouped column is ungrouped.
|
|
1231
|
+
*/
|
|
1232
|
+
moveColumn(column: GridColumnDef, targetIndex: number): void;
|
|
1233
|
+
/** Sets the width (px) of a column, within its `minWidth`/`maxWidth`. A band does nothing. */
|
|
1234
|
+
setColumnWidth(column: GridColumnDef, width: number): void;
|
|
1235
|
+
/** Fits the width of a column to its header and rendered cells; for a band, each of its visible columns. */
|
|
1236
|
+
autoSizeColumn(column: GridColumnDef): void;
|
|
1237
|
+
/**
|
|
1238
|
+
* Fits the width of every visible column to its header and rendered cells
|
|
1239
|
+
* (like `autoSizeColumn` on each one).
|
|
1240
|
+
*/
|
|
1241
|
+
autoSizeAllColumns(): void;
|
|
1242
|
+
/**
|
|
1243
|
+
* Puts the column layout back to the column definitions: order, width,
|
|
1244
|
+
* visibility and pinning (a partial `setState` of the columns). Sorting,
|
|
1245
|
+
* filtering and grouping are kept. Like `resetState`, it fires only
|
|
1246
|
+
* `u-grid-state-change` (no column event — also for "Reset columns" in
|
|
1247
|
+
* the column header menu, then with `sources: ['user']`), never moves the
|
|
1248
|
+
* focus nor announces anything.
|
|
1249
|
+
*/
|
|
1250
|
+
resetColumns(): void;
|
|
1251
|
+
/**
|
|
1252
|
+
* Reloads the data: with `dataSource`, discards the loaded blocks and asks
|
|
1253
|
+
* again (the rows shown stay until the answer); with `items`, recomputes
|
|
1254
|
+
* sorting, filtering, grouping and summaries. Resolves when done (also on
|
|
1255
|
+
* error — see `u-grid-load-error`).
|
|
1256
|
+
*/
|
|
1257
|
+
refresh(): Promise<void>;
|
|
1258
|
+
/**
|
|
1259
|
+
* Applies changes to the loaded rows of `dataSource` without reloading
|
|
1260
|
+
* everything: `update` replaces items by key in place (no re-sorting nor
|
|
1261
|
+
* re-filtering, as the reference `push`, unless `reshapeOnChanges`),
|
|
1262
|
+
* `remove` takes rows out, `add` appends at the end (with
|
|
1263
|
+
* `reshapeOnChanges`, at its sorted place). With remote paging or grouping, `update` patches the
|
|
1264
|
+
* loaded blocks and `add`/`remove` reload the shown rows. Selection, focus
|
|
1265
|
+
* and group expansion are kept. `update`/`remove` need `keyExpr`. With
|
|
1266
|
+
* `items` it does nothing (warning): set a new `items` array instead —
|
|
1267
|
+
* rows keep their state by key.
|
|
1268
|
+
*/
|
|
1269
|
+
applyChanges<TItem = any>(changes: GridDataChanges<TItem>): void;
|
|
1270
|
+
/**
|
|
1271
|
+
* Number of data rows: with `items` or a single-load `dataSource`, the
|
|
1272
|
+
* rows that pass the filter; with remote paging or grouping, the server
|
|
1273
|
+
* total (`-1` while unknown, e.g. infinite scrolling).
|
|
1274
|
+
*/
|
|
1275
|
+
getTotalCount(): number;
|
|
1276
|
+
/** Removes every filter: `filterValue` and `searchText`. Fires `u-grid-filter-change` (`source: 'api'`) when something changed. */
|
|
1277
|
+
clearFilter(): void;
|
|
1278
|
+
/**
|
|
1279
|
+
* The effective filter: `filterValue` `and` the search, as an expression
|
|
1280
|
+
* (copy). The search becomes `[path, 'contains', text]` joined by `or`
|
|
1281
|
+
* over the visible filterable columns (number and date columns included:
|
|
1282
|
+
* `contains` matches their displayed text). `null` without filter.
|
|
1283
|
+
*/
|
|
1284
|
+
getCombinedFilter(): GridFilterExpression | null;
|
|
1285
|
+
/** Opens the column chooser (also without the `column-chooser` button). */
|
|
1286
|
+
openColumnChooser(): void;
|
|
1287
|
+
/** Closes the column chooser. */
|
|
1288
|
+
closeColumnChooser(): void;
|
|
1289
|
+
/** @deprecated Use `openColumnChooser()`. */
|
|
1290
|
+
showColumnChooser(): void;
|
|
1291
|
+
/**
|
|
1292
|
+
* Selects the rows of `keys`. Without `append` they replace the selection;
|
|
1293
|
+
* with it they are added. In `single` mode only the last key is kept; in
|
|
1294
|
+
* `none` it does nothing.
|
|
1295
|
+
*/
|
|
1296
|
+
selectRows(keys: readonly unknown[], options?: {
|
|
1297
|
+
append?: boolean;
|
|
1298
|
+
}): void;
|
|
1299
|
+
/** Removes the rows of `keys` from the selection (nothing in `none` mode). */
|
|
1300
|
+
deselectRows(keys: readonly unknown[]): void;
|
|
1301
|
+
/** Selects every row that passes the filter, including rows of collapsed groups (`multiple` mode only). */
|
|
1302
|
+
selectAll(): void;
|
|
1303
|
+
/** Deselects every row that passes the filter (`multiple` mode only); other keys stay selected. */
|
|
1304
|
+
deselectAll(): void;
|
|
1305
|
+
/** Removes every key from the selection (also keys not in `items`). */
|
|
1306
|
+
clearSelection(): void;
|
|
1307
|
+
/** Whether the row of `key` is selected. */
|
|
1308
|
+
isRowSelected(key: unknown): boolean;
|
|
1309
|
+
/** Items of the selected keys that are loaded (all of `items`; with a remote source, the loaded blocks), in selection order. */
|
|
1310
|
+
getSelectedItems(): any[];
|
|
1311
|
+
/**
|
|
1312
|
+
* Scrolls to the cell of the row `rowKey` and `column` (default: the first
|
|
1313
|
+
* visible column) and moves the DOM focus to it. Returns `false` when the
|
|
1314
|
+
* row is not in the grid (filtered out or in a collapsed group — groups are
|
|
1315
|
+
* not expanded) or `column` is not a shown (user-visible), ungrouped
|
|
1316
|
+
* column (a band returns `false`). A column hidden by `autoHideColumns`
|
|
1317
|
+
* opens the row details (`u-grid-row-expansion-change`, `source: 'api'`)
|
|
1318
|
+
* and focuses its value. Before the
|
|
1319
|
+
* first render it only sets the active cell (the focus moves when it is
|
|
1320
|
+
* rendered) and fires no event. `options.rowFixed` looks for the row among
|
|
1321
|
+
* the fixed rows of that side (`fixedTopItems`/`fixedBottomItems`) instead
|
|
1322
|
+
* of the body (`false` when the key is not among them). In a full-width
|
|
1323
|
+
* row (`rowRenderer`) the focus goes to its single cell for any `column`.
|
|
1324
|
+
*/
|
|
1325
|
+
focusCell(rowKey: unknown, column?: GridColumnRef | null, options?: {
|
|
1326
|
+
rowFixed?: GridRowFixed;
|
|
1327
|
+
} | null): boolean;
|
|
1328
|
+
/**
|
|
1329
|
+
* Opens the editor of a cell (focus goes to it). In `row` mode it opens the
|
|
1330
|
+
* whole row with the focus on that cell. A column hidden by
|
|
1331
|
+
* `autoHideColumns` opens the row details (`u-grid-row-expansion-change`,
|
|
1332
|
+
* `source: 'api'`) and edits its value there. Returns `false` when the row is
|
|
1333
|
+
* not in the grid, the cell is not editable, a save is running or
|
|
1334
|
+
* `u-grid-edit-starting` was canceled.
|
|
1335
|
+
*/
|
|
1336
|
+
editCell(rowKey: unknown, column: GridColumnRef): boolean;
|
|
1337
|
+
/** Opens a whole row for editing (`editMode="row"` only; `false` otherwise or as `editCell`). */
|
|
1338
|
+
editRow(rowKey: unknown): boolean;
|
|
1339
|
+
/**
|
|
1340
|
+
* Adds a new row at the top of the visible rows (of the current page with
|
|
1341
|
+
* `paging`) and opens its first editable cell. `data` gives initial values
|
|
1342
|
+
* (also editable in `u-grid-row-adding`). Returns the opaque provisional key
|
|
1343
|
+
* of the row (focus and selection move to the real key when it is saved),
|
|
1344
|
+
* or `null` without `allowAdding`, during a save or when canceled. Tree
|
|
1345
|
+
* data: with `options.parentKey` the row is the first child of that node,
|
|
1346
|
+
* which expands with its ancestors (`u-grid-node-expansion-change`); a key
|
|
1347
|
+
* that is not a node adds nothing (`null`, console warning).
|
|
1348
|
+
*/
|
|
1349
|
+
addRow<TItem = any>(data?: Partial<TItem>, options?: GridAddRowOptions | null): unknown;
|
|
1350
|
+
/**
|
|
1351
|
+
* Deletes a row: in `cell` and `row` modes it is saved at once
|
|
1352
|
+
* (`u-grid-saving`); in `batch` mode it is marked for removal. Never asks
|
|
1353
|
+
* for confirmation. Resolves `false` when nothing was removed (row not
|
|
1354
|
+
* found, `u-grid-row-removing` or `u-grid-saving` canceled, save failed).
|
|
1355
|
+
*/
|
|
1356
|
+
removeRow(rowKey: unknown): Promise<boolean>;
|
|
1357
|
+
/** Restores a row marked for removal (`editMode="batch"`). */
|
|
1358
|
+
restoreRow(rowKey: unknown): void;
|
|
1359
|
+
/**
|
|
1360
|
+
* Commits the open editor, validates and saves every pending change
|
|
1361
|
+
* (`u-grid-row-validating`, `u-grid-saving`, `u-grid-save`). Resolves
|
|
1362
|
+
* `true` when saved (or nothing was pending).
|
|
1363
|
+
*/
|
|
1364
|
+
saveChanges(): Promise<boolean>;
|
|
1365
|
+
/** Closes the editor and discards every pending change (`u-grid-edit-cancel` when there was any). */
|
|
1366
|
+
discardChanges(): void;
|
|
1367
|
+
/** Whether there are pending changes (or an editor with a changed value). */
|
|
1368
|
+
hasChanges(): boolean;
|
|
1369
|
+
/** The pending changes, in the order they started (copies). The value of an open editor is not included until committed. */
|
|
1370
|
+
getChanges(): GridEditChange[];
|
|
1371
|
+
/**
|
|
1372
|
+
* The columns and rows the user sees, ready to build any file (Excel, PDF):
|
|
1373
|
+
* visible exportable columns in the current order, filter, sorting, groups
|
|
1374
|
+
* (collapsed ones included) and summaries. The state is read when called;
|
|
1375
|
+
* rows are built in time slices, so a million rows do not freeze the page.
|
|
1376
|
+
* With a `dataSource` whose server pages or groups, only the rows already
|
|
1377
|
+
* loaded are exported (in screen order, without group rows; totals from the
|
|
1378
|
+
* server): ask the server for the full file instead.
|
|
1379
|
+
*/
|
|
1380
|
+
getExportData(options?: GridExportOptions): Promise<GridExportData>;
|
|
1381
|
+
/**
|
|
1382
|
+
* CSV (RFC 4180) of what the user sees (see `getExportData`): formatted
|
|
1383
|
+
* texts, UTF-8 with BOM, `;` as separator in languages with a decimal
|
|
1384
|
+
* comma, cells that a spreadsheet would run as formulas prefixed with `'`.
|
|
1385
|
+
*/
|
|
1386
|
+
exportCsv(options?: GridCsvOptions): Promise<Blob>;
|
|
1387
|
+
/** Builds the CSV (`exportCsv`) and downloads it as `fileName` (default `export.csv`). */
|
|
1388
|
+
downloadCsv(options?: GridCsvDownloadOptions): Promise<void>;
|
|
1389
|
+
/** Ranges of selected cells, in creation order (the last one is the active range). A copy. */
|
|
1390
|
+
getCellRanges(): GridCellRange[];
|
|
1391
|
+
/**
|
|
1392
|
+
* Selects a range of data cells (`startRowIndex`/`endRowIndex` as in
|
|
1393
|
+
* `getRowIndex`; columns by definition, `name` or `path`). With `append`
|
|
1394
|
+
* (`cell-selection-mode="multiple"`) it is added to the current ranges;
|
|
1395
|
+
* otherwise it replaces them. The active cell moves to the `end` corner
|
|
1396
|
+
* (`u-grid-focus-change` with `source: 'api'`) without moving the DOM focus.
|
|
1397
|
+
* Returns `false` (nothing changes) when the mode is `none`, a column is
|
|
1398
|
+
* not a visible data column, a row is not a data row of the displayed body,
|
|
1399
|
+
* or the range is a single cell without `append`.
|
|
1400
|
+
*/
|
|
1401
|
+
selectCellRange(range: GridCellRangeInit, options?: {
|
|
1402
|
+
append?: boolean;
|
|
1403
|
+
}): boolean;
|
|
1404
|
+
/** Clears the cell ranges (fires `u-grid-cell-range-change` if there were any). */
|
|
1405
|
+
clearCellRanges(): void;
|
|
1406
|
+
/**
|
|
1407
|
+
* Count, sum and average of the selected cells (each cell once), computed
|
|
1408
|
+
* in slices so that millions of cells do not block the page. It reads the
|
|
1409
|
+
* ranges at the call; rejects only through `signal`, with its `reason`
|
|
1410
|
+
* (an `AbortError` by default).
|
|
1411
|
+
* Rows not loaded yet (remote data source) are left out (`complete: false`).
|
|
1412
|
+
*/
|
|
1413
|
+
getCellRangeSummary(options?: {
|
|
1414
|
+
signal?: AbortSignal;
|
|
1415
|
+
}): Promise<GridCellRangeSummary>;
|
|
1416
|
+
/**
|
|
1417
|
+
* Position of the data row `rowKey` in the displayed body (the index used
|
|
1418
|
+
* by `GridCellRange`; the current page with `paging`); `-1` when the row is
|
|
1419
|
+
* not displayed (filtered out, collapsed group, other page, not loaded).
|
|
1420
|
+
*/
|
|
1421
|
+
getRowIndex(rowKey: unknown): number;
|
|
1422
|
+
/** Key of the data row at `rowIndex` (see `getRowIndex`); `undefined` for group, detail and footer rows and rows not loaded. */
|
|
1423
|
+
getRowKey(rowIndex: number): unknown;
|
|
1424
|
+
/** Moves the focus to the active cell of the grid (the one keyboard navigation starts from). */
|
|
1425
|
+
focus(options?: FocusOptions): void;
|
|
1426
|
+
/**
|
|
1427
|
+
* Columns hidden now because the grid is too narrow (`autoHideColumns`),
|
|
1428
|
+
* in column order: their values are in the row details. A copy; `[]` when
|
|
1429
|
+
* `autoHideColumns` is off, before the first layout and on the server.
|
|
1430
|
+
*/
|
|
1431
|
+
getAdaptiveColumns(): GridColumnDef[];
|
|
1432
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
1433
|
+
/**
|
|
1434
|
+
* Cancels the export started from the export UI (toolbar, row menu), if
|
|
1435
|
+
* any: the exporter gets an aborted `signal`; no `u-grid-export-error`; the
|
|
1436
|
+
* grid announces "Export canceled".
|
|
1437
|
+
*/
|
|
1438
|
+
cancelExport(): void;
|
|
1439
|
+
/**
|
|
1440
|
+
* Copies like Ctrl/Cmd+C: the cell ranges, else the selected rows (current
|
|
1441
|
+
* order and filter), else the active cell — TSV and an HTML table through the
|
|
1442
|
+
* asynchronous Clipboard API. Fires `u-grid-copying` (`source: 'api'`).
|
|
1443
|
+
* Resolves `false` when there is nothing to copy, `clipboardMode` is
|
|
1444
|
+
* `none`, the listener canceled without setting data, the browser
|
|
1445
|
+
* denied the write, or the cell ranges exceed the cell limit (announced). Browsers need a user activation: call it inside the
|
|
1446
|
+
* user's gesture (click or key handler).
|
|
1447
|
+
*/
|
|
1448
|
+
copySelection(): Promise<boolean>;
|
|
1449
|
+
/**
|
|
1450
|
+
* Opens the context menu (built-in items and `u-grid-context-menu-opening`)
|
|
1451
|
+
* of a data row (`{ rowKey, column? }`), a column header (`{ column }`) or
|
|
1452
|
+
* a group row (`{ groupPath }`) — e.g. from a "⋯" button in a cell
|
|
1453
|
+
* `renderer`. Under `anchor` (or the cell); the focus goes back to `anchor`
|
|
1454
|
+
* (or the cell). Returns `false` when canceled, empty, the row or column is
|
|
1455
|
+
* not shown, or before the first render. `rowKey`: body rows only; on a
|
|
1456
|
+
* full-width row `column` is ignored.
|
|
1457
|
+
*/
|
|
1458
|
+
openContextMenu(target: {
|
|
1459
|
+
rowKey: unknown;
|
|
1460
|
+
column?: GridColumnDef;
|
|
1461
|
+
} | {
|
|
1462
|
+
column: GridColumnDef;
|
|
1463
|
+
} | {
|
|
1464
|
+
groupPath: GridGroupPath;
|
|
1465
|
+
}, anchor?: HTMLElement | null): boolean;
|
|
1466
|
+
/** Closes the context menu (no focus change). */
|
|
1467
|
+
closeContextMenu(): void;
|
|
1468
|
+
}
|
|
1469
|
+
declare global {
|
|
1470
|
+
interface HTMLElementTagNameMap {
|
|
1471
|
+
'u-grid': DataGrid;
|
|
1472
|
+
}
|
|
1473
|
+
interface HTMLElementEventMap {
|
|
1474
|
+
'u-grid-state-change': CustomEvent<GridStateChangeEventDetail>;
|
|
1475
|
+
'u-grid-sorting': CustomEvent<GridSortEventDetail>;
|
|
1476
|
+
'u-grid-sort-change': CustomEvent<GridSortEventDetail>;
|
|
1477
|
+
'u-grid-column-resize': CustomEvent<GridColumnResizeEventDetail>;
|
|
1478
|
+
'u-grid-column-visibility-change': CustomEvent<GridColumnVisibilityChangeEventDetail>;
|
|
1479
|
+
'u-grid-column-reorder': CustomEvent<GridColumnReorderEventDetail>;
|
|
1480
|
+
'u-grid-column-fixed-change': CustomEvent<GridColumnFixedChangeEventDetail>;
|
|
1481
|
+
'u-grid-group-change': CustomEvent<GridGroupEventDetail>;
|
|
1482
|
+
'u-grid-group-expansion-change': CustomEvent<GridGroupExpansionChangeEventDetail>;
|
|
1483
|
+
'u-grid-filter-change': CustomEvent<GridFilterEventDetail>;
|
|
1484
|
+
'u-grid-selection-change': CustomEvent<GridSelectionChangeEventDetail>;
|
|
1485
|
+
'u-grid-focus-change': CustomEvent<GridFocusChangeEventDetail>;
|
|
1486
|
+
'u-grid-copying': CustomEvent<GridCopyEventDetail>;
|
|
1487
|
+
'u-grid-cell-range-change': CustomEvent<GridCellRangeChangeEventDetail>;
|
|
1488
|
+
'u-grid-pasting': CustomEvent<GridPasteEventDetail>;
|
|
1489
|
+
'u-grid-loading': CustomEvent<GridLoadingEventDetail>;
|
|
1490
|
+
'u-grid-load': CustomEvent<GridLoadEventDetail>;
|
|
1491
|
+
'u-grid-load-error': CustomEvent<GridLoadErrorEventDetail>;
|
|
1492
|
+
'u-grid-page-change': CustomEvent<GridPageChangeEventDetail>;
|
|
1493
|
+
'u-grid-row-expansion-change': CustomEvent<GridRowExpansionChangeEventDetail>;
|
|
1494
|
+
'u-grid-adaptive-columns-change': CustomEvent<GridAdaptiveColumnsChangeEventDetail>;
|
|
1495
|
+
'u-grid-node-expansion-change': CustomEvent<GridNodeExpansionChangeEventDetail>;
|
|
1496
|
+
'u-grid-edit-starting': CustomEvent<GridEditStartingEventDetail>;
|
|
1497
|
+
'u-grid-row-adding': CustomEvent<GridRowAddingEventDetail>;
|
|
1498
|
+
'u-grid-row-removing': CustomEvent<GridRowRemovingEventDetail>;
|
|
1499
|
+
'u-grid-row-validating': CustomEvent<GridRowValidatingEventDetail>;
|
|
1500
|
+
'u-grid-saving': CustomEvent<GridSavingEventDetail>;
|
|
1501
|
+
'u-grid-save': CustomEvent<GridSaveEventDetail>;
|
|
1502
|
+
'u-grid-save-error': CustomEvent<GridSaveErrorEventDetail>;
|
|
1503
|
+
'u-grid-edit-cancel': CustomEvent<GridEditCancelEventDetail>;
|
|
1504
|
+
'u-grid-context-menu-opening': CustomEvent<GridContextMenuOpeningEventDetail>;
|
|
1505
|
+
'u-grid-exporting': CustomEvent<GridExportingEventDetail>;
|
|
1506
|
+
'u-grid-export': CustomEvent<GridExportEventDetail>;
|
|
1507
|
+
'u-grid-export-error': CustomEvent<GridExportErrorEventDetail>;
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
//# sourceMappingURL=grid.d.ts.map
|