@zambon-dev/ui 1.8.0 → 1.9.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/CHANGELOG.md +26 -1
- package/fesm2022/zambon-dev-ui-framework.mjs +4 -1
- package/fesm2022/zambon-dev-ui-framework.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui-library.mjs +512 -61
- package/fesm2022/zambon-dev-ui-library.mjs.map +1 -1
- package/i18n/framework/en.json +3 -0
- package/i18n/framework/pt.json +3 -0
- package/package.json +1 -1
- package/types/zambon-dev-ui-framework.d.ts +1 -1
- package/types/zambon-dev-ui-library.d.ts +260 -7
package/i18n/framework/en.json
CHANGED
|
@@ -48,11 +48,14 @@
|
|
|
48
48
|
"Format-Date": "MM/dd/yyyy",
|
|
49
49
|
"Format-DateTime": "MM/dd/yyyy hh:mm a",
|
|
50
50
|
"Format-Number": "1.0",
|
|
51
|
+
"Grid-Columns": "Choose columns",
|
|
51
52
|
"Grid-Loading": "Loading...",
|
|
52
53
|
"Grid-Message-Empty": "No records found.",
|
|
53
54
|
"Grid-Message-Failed": "An error occurred while loading the records. Please try again later.",
|
|
54
55
|
"Grid-Message-LazyLoad": "Click the refresh button to load entries.",
|
|
55
56
|
"Grid-No": "No",
|
|
57
|
+
"Grid-ResetColumns": "Reset columns",
|
|
58
|
+
"Grid-ResizeColumn": "Resize {{ column }}",
|
|
56
59
|
"Grid-SelectAll": "Select all rows",
|
|
57
60
|
"Grid-SelectRow": "Select row",
|
|
58
61
|
"Grid-TotalRow": "{{ count }} record",
|
package/i18n/framework/pt.json
CHANGED
|
@@ -48,11 +48,14 @@
|
|
|
48
48
|
"Format-Date": "dd/MM/yyyy",
|
|
49
49
|
"Format-DateTime": "dd/MM/yyyy HH:mm",
|
|
50
50
|
"Format-Number": "1.0",
|
|
51
|
+
"Grid-Columns": "Colunas",
|
|
51
52
|
"Grid-Loading": "Carregando...",
|
|
52
53
|
"Grid-Message-Empty": "Nenhum registro encontrado.",
|
|
53
54
|
"Grid-Message-Failed": "Ocorreu um erro ao carregar os registros. Por favor, tente novamente mais tarde.",
|
|
54
55
|
"Grid-Message-LazyLoad": "Clique no botão atualizar para carregar os registros.",
|
|
55
56
|
"Grid-No": "Não",
|
|
57
|
+
"Grid-ResetColumns": "Restaurar colunas",
|
|
58
|
+
"Grid-ResizeColumn": "Redimensionar {{ column }}",
|
|
56
59
|
"Grid-SelectAll": "Selecionar todas as linhas",
|
|
57
60
|
"Grid-SelectRow": "Selecionar linha",
|
|
58
61
|
"Grid-TotalRow": "{{ count }} registro",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zambon-dev/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Angular 22 component library and application shell: form controls, a virtual-scroll data grid, modals, ribbon, sidebar, tabbed navigation, view base classes and authentication layouts, themed with Tailwind CSS 4 tokens.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -791,7 +791,7 @@ declare namespace button_open_record_component_d_exports$1 {
|
|
|
791
791
|
/**
|
|
792
792
|
* Ribbon button that opens the record selected in the surrounding data grid in the current tab.
|
|
793
793
|
* Enabled only when exactly one row is selected. It also opens a row the grid reports through
|
|
794
|
-
* `rowActivated`, a double click, unless the grid's configs set `openOnDoubleClick` to `false`.
|
|
794
|
+
* `rowActivated`, a double click or Enter, unless the grid's configs set `openOnDoubleClick` to `false`.
|
|
795
795
|
*/
|
|
796
796
|
export declare class ButtonOpenRecordComponent extends BaseButton implements OnInit {
|
|
797
797
|
/** Segment added between `rootPath` and the record's ID. Unset by default. */
|
|
@@ -265,6 +265,11 @@ export type GridConfigs = {
|
|
|
265
265
|
export type DataGridConfigs = GridConfigs & {
|
|
266
266
|
/** Drops the grid's outline and rounded corner, for a grid that sits inside a card of its own. */
|
|
267
267
|
hideBorders?: boolean;
|
|
268
|
+
/**
|
|
269
|
+
* The grid's accessible name, as a translation key or plain text, such as `Customers`. Screen
|
|
270
|
+
* readers announce it when focus enters the grid. No default: a grid without it has no name.
|
|
271
|
+
*/
|
|
272
|
+
gridLabel?: string;
|
|
268
273
|
hideColumnHeaders?: boolean;
|
|
269
274
|
multiSelect?: boolean;
|
|
270
275
|
/**
|
|
@@ -275,8 +280,8 @@ export type DataGridConfigs = GridConfigs & {
|
|
|
275
280
|
*/
|
|
276
281
|
multiSelectSize?: string;
|
|
277
282
|
/**
|
|
278
|
-
* Whether a double click on a row opens its record, in the
|
|
279
|
-
* emits `rowActivated` either way. Defaults to `true`.
|
|
283
|
+
* Whether a double click on a row, or Enter on the focused row, opens its record, in the
|
|
284
|
+
* framework's list views. The grid emits `rowActivated` either way. Defaults to `true`.
|
|
280
285
|
*/
|
|
281
286
|
openOnDoubleClick?: boolean;
|
|
282
287
|
/**
|
|
@@ -310,6 +315,37 @@ export type DataGridConfigs = GridConfigs & {
|
|
|
310
315
|
booleanTrueText?: string;
|
|
311
316
|
/** The same for a false value, when the column sets no `falseText`. Defaults to `No`. */
|
|
312
317
|
booleanFalseText?: string;
|
|
318
|
+
/**
|
|
319
|
+
* Shows a button at the end of the header that opens the column chooser, where the user hides
|
|
320
|
+
* and shows columns. See `IGridColumn.hideable`. Defaults to `false`.
|
|
321
|
+
*/
|
|
322
|
+
columnChooser?: boolean;
|
|
323
|
+
/**
|
|
324
|
+
* The column chooser button's accessible name and tooltip, and the chooser's name, as a
|
|
325
|
+
* translation key or plain text. Defaults to `Choose columns`.
|
|
326
|
+
*/
|
|
327
|
+
columnChooserText?: string;
|
|
328
|
+
/**
|
|
329
|
+
* The text of the chooser's button that shows every column and clears every width again, as a
|
|
330
|
+
* translation key or plain text. Defaults to `Reset columns`.
|
|
331
|
+
*/
|
|
332
|
+
resetColumnsText?: string;
|
|
333
|
+
/**
|
|
334
|
+
* Gives each header cell a handle at its end edge that resizes the column, by dragging or with
|
|
335
|
+
* the arrow keys. The selection and `actions` columns have none. Defaults to `false`.
|
|
336
|
+
*/
|
|
337
|
+
resizableColumns?: boolean;
|
|
338
|
+
/**
|
|
339
|
+
* The resize handle's accessible name, as a translation key or plain text. `{{ column }}` is
|
|
340
|
+
* replaced by the column's translated header. Defaults to `Resize {{ column }}`.
|
|
341
|
+
*/
|
|
342
|
+
resizeColumnText?: string;
|
|
343
|
+
/**
|
|
344
|
+
* Saves the hidden columns and the column widths in `localStorage` under
|
|
345
|
+
* `zambon-dev.grid.{columnsStateKey}`, and restores them when the grid starts. Use a key unique
|
|
346
|
+
* to the grid. No default: without it nothing is saved.
|
|
347
|
+
*/
|
|
348
|
+
columnsStateKey?: string;
|
|
313
349
|
};
|
|
314
350
|
export interface IListParameters extends ISummaryParameters {
|
|
315
351
|
endRow: number;
|
|
@@ -410,6 +446,26 @@ export interface IGridColumn {
|
|
|
410
446
|
* `actions`, `center` for `boolean`, and `start` otherwise.
|
|
411
447
|
*/
|
|
412
448
|
align?: GridColumnAlign;
|
|
449
|
+
/**
|
|
450
|
+
* Starts the column hidden. The user can show it again from the column chooser, when the grid
|
|
451
|
+
* has one. Ignored when `hideable` is `false`. Defaults to `false`.
|
|
452
|
+
*/
|
|
453
|
+
hidden?: boolean;
|
|
454
|
+
/**
|
|
455
|
+
* Whether the user can hide the column from the column chooser. Set `false` for a column the user
|
|
456
|
+
* must always see, such as the record's name. Defaults to `true`, and to `false` for `actions`.
|
|
457
|
+
*/
|
|
458
|
+
hideable?: boolean;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* What a grid with `columnsStateKey` keeps in `localStorage`: the fields of the hidden columns and
|
|
462
|
+
* the width in pixels of each resized column, by field.
|
|
463
|
+
*/
|
|
464
|
+
export interface IGridColumnsState {
|
|
465
|
+
/** The `field` of each column the user hid. */
|
|
466
|
+
hidden: string[];
|
|
467
|
+
/** The width in pixels of each column the user resized, keyed by `field`. */
|
|
468
|
+
widths: Record<string, number>;
|
|
413
469
|
}
|
|
414
470
|
export interface IListResult<T> {
|
|
415
471
|
items: T[];
|
|
@@ -964,10 +1020,12 @@ export declare abstract class GridDataset extends BaseDataset {
|
|
|
964
1020
|
static ɵfac: i0.ɵɵFactoryDeclaration<GridDataset, never>;
|
|
965
1021
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
966
1022
|
}
|
|
1023
|
+
/** The smallest width, in pixels, a user can give a grid column: 3rem at the default font size. */
|
|
1024
|
+
export declare const MIN_GRID_COLUMN_WIDTH = 48;
|
|
967
1025
|
export declare abstract class DataGridDataset extends GridDataset {
|
|
968
1026
|
/**
|
|
969
|
-
* Emits the row's data when the user activates a row,
|
|
970
|
-
* grid emits nothing. The framework's Open button opens the record on it, unless the configs set
|
|
1027
|
+
* Emits the row's data when the user activates a row: a double click, or Enter on the focused
|
|
1028
|
+
* row. A disabled grid emits nothing. The framework's Open button opens the record on it, unless the configs set
|
|
971
1029
|
* `openOnDoubleClick` to `false`.
|
|
972
1030
|
*/
|
|
973
1031
|
rowActivated: EventEmitter<any>;
|
|
@@ -980,12 +1038,59 @@ export declare abstract class DataGridDataset extends GridDataset {
|
|
|
980
1038
|
configs: DataGridConfigs;
|
|
981
1039
|
columns: IGridColumn[];
|
|
982
1040
|
private _selectedRowKeys;
|
|
1041
|
+
/**
|
|
1042
|
+
* The fields of the hidden columns, once the user or a stored state changed them. `null` means
|
|
1043
|
+
* each column's own `hidden` decides.
|
|
1044
|
+
*/
|
|
1045
|
+
private readonly hiddenFields;
|
|
1046
|
+
/** The width in pixels of each column the user resized, keyed by `field`. */
|
|
1047
|
+
private readonly columnWidths;
|
|
983
1048
|
get selectedRowKeys(): string[];
|
|
984
1049
|
set selectedRowKeys(value: string[]);
|
|
1050
|
+
/**
|
|
1051
|
+
* The CSS grid template of the rows: the selection column, then each visible column. A column the
|
|
1052
|
+
* user resized is a fixed track of its width in pixels; any other uses its `size`.
|
|
1053
|
+
*/
|
|
985
1054
|
get columnsSize(): string;
|
|
1055
|
+
/** The columns the grid shows: `columns` without the hidden ones. */
|
|
1056
|
+
get visibleColumns(): IGridColumn[];
|
|
986
1057
|
get hasSelectedRows(): boolean;
|
|
987
1058
|
constructor();
|
|
988
1059
|
clearSelection(): void;
|
|
1060
|
+
/**
|
|
1061
|
+
* Whether the user may hide the column: its `hideable`, which defaults to `true`, and to `false`
|
|
1062
|
+
* for an `actions` column.
|
|
1063
|
+
*/
|
|
1064
|
+
isColumnHideable(column: IGridColumn): boolean;
|
|
1065
|
+
/** Whether the column is hidden, by the user, a stored state or its own `hidden`. */
|
|
1066
|
+
isColumnHidden(column: IGridColumn): boolean;
|
|
1067
|
+
/**
|
|
1068
|
+
* Whether the column may be hidden now. It must be hideable and visible, and another column
|
|
1069
|
+
* other than an `actions` column must stay visible: the grid never shows no data at all.
|
|
1070
|
+
*/
|
|
1071
|
+
canHideColumn(column: IGridColumn): boolean;
|
|
1072
|
+
/**
|
|
1073
|
+
* Hides or shows the column with this `field`. Does nothing for a column that is not hideable, or
|
|
1074
|
+
* when hiding it would leave no column to show. Saves the state when `columnsStateKey` is set.
|
|
1075
|
+
*/
|
|
1076
|
+
setColumnHidden(field: string, hidden: boolean): void;
|
|
1077
|
+
/** The width in pixels the user gave the column with this `field`, or `undefined` when it has its `size`. */
|
|
1078
|
+
getColumnWidth(field: string): number | undefined;
|
|
1079
|
+
/**
|
|
1080
|
+
* Gives the column with this `field` a fixed width in pixels, at least `MIN_GRID_COLUMN_WIDTH`.
|
|
1081
|
+
* `null` gives it back its `size`. An `actions` column keeps its size. Saves the state when
|
|
1082
|
+
* `columnsStateKey` is set, unless `save` is `false`, as it is while a drag is still going on.
|
|
1083
|
+
*/
|
|
1084
|
+
setColumnWidth(field: string, width: number | null, save?: boolean): void;
|
|
1085
|
+
/** Shows the columns as declared and drops every width, and clears the saved state. */
|
|
1086
|
+
resetColumns(): void;
|
|
1087
|
+
/**
|
|
1088
|
+
* Restores the hidden columns and widths saved under `columnsStateKey`. The grid calls it when it
|
|
1089
|
+
* starts. A state that does not parse is ignored, and so are fields no column has any more.
|
|
1090
|
+
*/
|
|
1091
|
+
restoreColumnsState(): void;
|
|
1092
|
+
/** Saves the hidden columns and widths under `columnsStateKey`. Does nothing without one. */
|
|
1093
|
+
saveColumnsState(): void;
|
|
989
1094
|
export(_format: string, _parameters: IListParameters): Observable<HttpResponse<Blob>>;
|
|
990
1095
|
deselectRow(key: string): void;
|
|
991
1096
|
deselectRowID(id: any): void;
|
|
@@ -996,7 +1101,17 @@ export declare abstract class DataGridDataset extends GridDataset {
|
|
|
996
1101
|
selectRow(key: string): void;
|
|
997
1102
|
selectRowID(id: any): void;
|
|
998
1103
|
selectRows(keys: string[]): void;
|
|
1104
|
+
/**
|
|
1105
|
+
* Makes a row the focused one the way the grid's arrow keys do. A single-select grid selects it,
|
|
1106
|
+
* as a click does. A multi-select grid only moves the focus and leaves the selection alone, so
|
|
1107
|
+
* walking through the rows does not tick each one; Space toggles the focused row instead.
|
|
1108
|
+
*/
|
|
1109
|
+
moveFocusedRow(key: string): void;
|
|
999
1110
|
setFocusedRow(key: any): void;
|
|
1111
|
+
/** The `localStorage` key of the columns state, or `null` when the configs set no `columnsStateKey`. */
|
|
1112
|
+
private get columnsStorageKey();
|
|
1113
|
+
/** The fields of the columns hidden now. */
|
|
1114
|
+
private hiddenColumnFields;
|
|
1000
1115
|
protected removeSelectedRow(key: string): void;
|
|
1001
1116
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataGridDataset, never>;
|
|
1002
1117
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
@@ -1173,6 +1288,8 @@ declare namespace data_grid_component_d_exports {
|
|
|
1173
1288
|
export declare class DataGridComponent extends BaseComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
1174
1289
|
private readonly bodyElement;
|
|
1175
1290
|
private readonly viewport;
|
|
1291
|
+
private readonly columnChooserButton;
|
|
1292
|
+
private readonly columnChooserTemplate;
|
|
1176
1293
|
/** Disables the rows, so they cannot be focused or selected. Defaults to `false`. */
|
|
1177
1294
|
readonly disabled: InputSignal<boolean>;
|
|
1178
1295
|
/**
|
|
@@ -1190,8 +1307,25 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1190
1307
|
protected readonly headerRightMargin: WritableSignal<number>;
|
|
1191
1308
|
protected readonly headerScrollLeft: WritableSignal<number>;
|
|
1192
1309
|
protected readonly loading: WritableSignal<boolean>;
|
|
1310
|
+
/** Whether the column chooser popover is open. */
|
|
1311
|
+
protected readonly columnChooserOpen: WritableSignal<boolean>;
|
|
1312
|
+
protected readonly columnChooserId: string;
|
|
1313
|
+
protected readonly minColumnWidth: number;
|
|
1193
1314
|
private bodyResized$;
|
|
1315
|
+
/**
|
|
1316
|
+
* The key of a row the keyboard moved to that was not rendered yet. It gets the DOM focus after
|
|
1317
|
+
* the virtual scroll renders it; see focusPendingRow.
|
|
1318
|
+
*/
|
|
1319
|
+
private pendingFocusKey;
|
|
1194
1320
|
private bodyResizeObserver?;
|
|
1321
|
+
private columnChooserRef?;
|
|
1322
|
+
private readonly document;
|
|
1323
|
+
private readonly injector;
|
|
1324
|
+
private readonly overlay;
|
|
1325
|
+
private readonly platformId;
|
|
1326
|
+
/** Ends the column drag in progress, if any: removes its listeners and saves the width. */
|
|
1327
|
+
private stopColumnResize?;
|
|
1328
|
+
private readonly viewContainerRef;
|
|
1195
1329
|
private gridRoute;
|
|
1196
1330
|
private isGridCurrentUrl;
|
|
1197
1331
|
private lastPosition;
|
|
@@ -1200,7 +1334,22 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1200
1334
|
private router;
|
|
1201
1335
|
private selectionColRealSize?;
|
|
1202
1336
|
protected get bodyMinHeight(): number;
|
|
1337
|
+
/**
|
|
1338
|
+
* The grid's `aria-rowcount`, header row included. The dataset's `totalRows` when the last load
|
|
1339
|
+
* returned one; the loaded rows once the last block is in; otherwise -1, which tells assistive
|
|
1340
|
+
* technology the total is unknown.
|
|
1341
|
+
*/
|
|
1342
|
+
protected get ariaRowCount(): number;
|
|
1343
|
+
/** The columns the header shows: the dataset's columns without the hidden ones. */
|
|
1203
1344
|
protected get columns(): IGridColumn[];
|
|
1345
|
+
/** The columns the chooser lists: every column the user may hide, hidden or not. */
|
|
1346
|
+
protected get hideableColumns(): IGridColumn[];
|
|
1347
|
+
protected get showColumnChooser(): boolean;
|
|
1348
|
+
protected get columnChooserText(): string;
|
|
1349
|
+
protected get resetColumnsText(): string;
|
|
1350
|
+
protected get resizeColumnText(): string;
|
|
1351
|
+
/** The grid's accessible name, a translation key or plain text, or none. */
|
|
1352
|
+
protected get gridLabel(): string | null;
|
|
1204
1353
|
protected get configs(): DataGridConfigs;
|
|
1205
1354
|
protected get gridColumns(): string;
|
|
1206
1355
|
protected get hasBeenLoaded(): boolean;
|
|
@@ -1227,6 +1376,21 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1227
1376
|
/** The footer text, singular for a total of exactly 1. */
|
|
1228
1377
|
protected get totalRowsText(): string;
|
|
1229
1378
|
protected get shouldDisplayMessageWhenEmpty(): boolean;
|
|
1379
|
+
/**
|
|
1380
|
+
* The text of the status region screen readers hear: the same loading, lazy-load, empty or
|
|
1381
|
+
* failure message the grid shows inside its body, or nothing. The visible copies are hidden from
|
|
1382
|
+
* assistive technology, because a message is not a row and has no place in the grid's role tree.
|
|
1383
|
+
*/
|
|
1384
|
+
protected get statusText(): string;
|
|
1385
|
+
/**
|
|
1386
|
+
* The key of the grid's one Tab stop: the focused row, while it is loaded and rendered.
|
|
1387
|
+
* Otherwise the first rendered row, which is the first row until the user scrolls. Falling back
|
|
1388
|
+
* to a rendered row keeps the grid reachable with Tab when the focused row scrolled out of the
|
|
1389
|
+
* virtual scroll's window, and after a refresh dropped it.
|
|
1390
|
+
*/
|
|
1391
|
+
protected get tabbableRowKey(): string | undefined;
|
|
1392
|
+
/** How many rows a PageDown or PageUp moves: the rows that fit in the viewport, at least one. */
|
|
1393
|
+
private get pageSize();
|
|
1230
1394
|
/**
|
|
1231
1395
|
* Whether the grid is in the document, which it is not while the route-reuse strategy holds its
|
|
1232
1396
|
* view detached -- the list a tab keeps in its history while the user is on a record.
|
|
@@ -1249,6 +1413,30 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1249
1413
|
* Goes through the dataset, so `selectedRowsChanged` announces the change as for any other.
|
|
1250
1414
|
*/
|
|
1251
1415
|
protected onToggleSelectAll(): void;
|
|
1416
|
+
/**
|
|
1417
|
+
* The keyboard on a focused row: arrows, Home, End, PageUp and PageDown move the focus, Space
|
|
1418
|
+
* toggles the row in a multi-select grid and Enter activates it. Only a key pressed on a row
|
|
1419
|
+
* itself counts, so a control inside a cell keeps its own keys. A disabled grid ignores them all.
|
|
1420
|
+
*/
|
|
1421
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
1422
|
+
/** The column chooser button: opens the chooser, or closes it when it is open. */
|
|
1423
|
+
protected onToggleColumnChooser(): void;
|
|
1424
|
+
/** A key inside the chooser. Escape closes it and gives the focus back to the button. */
|
|
1425
|
+
protected onColumnChooserKeydown(event: KeyboardEvent): void;
|
|
1426
|
+
/** A chooser checkbox: a ticked box shows its column, a cleared one hides it. */
|
|
1427
|
+
protected onToggleColumn(column: IGridColumn, event: Event): void;
|
|
1428
|
+
/** The chooser's reset button: every column as declared, every width dropped, nothing saved. */
|
|
1429
|
+
protected onResetColumns(): void;
|
|
1430
|
+
/**
|
|
1431
|
+
* A pointer pressed on a resize handle starts a drag. The moves are heard outside Angular, since
|
|
1432
|
+
* they fire for every frame, and write the width to the dataset's signal. Releasing the pointer
|
|
1433
|
+
* saves the width.
|
|
1434
|
+
*/
|
|
1435
|
+
protected onResizeStart(event: PointerEvent, column: IGridColumn): void;
|
|
1436
|
+
/** ArrowRight widens the column by 16 pixels and ArrowLeft narrows it, down to the minimum. */
|
|
1437
|
+
protected onResizeKeydown(event: KeyboardEvent, column: IGridColumn): void;
|
|
1438
|
+
/** A double click on a resize handle gives the column back its declared size. */
|
|
1439
|
+
protected onResizeReset(event: MouseEvent, column: IGridColumn): void;
|
|
1252
1440
|
protected onSelectionResized(newSize: number): void;
|
|
1253
1441
|
protected alignOf(column: IGridColumn): GridColumnAlign;
|
|
1254
1442
|
/**
|
|
@@ -1256,7 +1444,55 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1256
1444
|
* key, but returns plain text such as the library default untouched, placeholder and all.
|
|
1257
1445
|
*/
|
|
1258
1446
|
protected fillCount(text: string): string;
|
|
1447
|
+
/**
|
|
1448
|
+
* The width of a header cell, in pixels: the width of the column's cell measured in the first
|
|
1449
|
+
* row, or before that the width the user gave the column. `null` until either is known.
|
|
1450
|
+
*
|
|
1451
|
+
* A resized column's cell is narrower than its track: the rows are subgrids with a gap of their
|
|
1452
|
+
* own, and a subgrid takes its gap out of its cells. So the header copies the measured cell, as
|
|
1453
|
+
* it does for every column, rather than the track's width.
|
|
1454
|
+
*/
|
|
1455
|
+
protected headerWidth(column: IGridColumn): number | null;
|
|
1456
|
+
/** Whether the column's header cell has a resize handle. */
|
|
1457
|
+
protected isResizable(column: IGridColumn): boolean;
|
|
1458
|
+
/** The resize handle's `aria-valuenow`: the column's track width in whole pixels. */
|
|
1459
|
+
protected resizeValue(column: IGridColumn): number;
|
|
1460
|
+
/**
|
|
1461
|
+
* Puts the column's name into the resize handle's name. The translate pipe fills `{{ column }}`
|
|
1462
|
+
* for a known key, but returns plain text such as the library default untouched.
|
|
1463
|
+
*/
|
|
1464
|
+
protected fillColumn(text: string, columnName: string): string;
|
|
1259
1465
|
protected isFirstVisibleRow(rowIndex: number): boolean;
|
|
1466
|
+
/**
|
|
1467
|
+
* Opens the column chooser in a CDK overlay under its button. The focus moves to its first
|
|
1468
|
+
* control and stays inside until Escape or a click outside closes it.
|
|
1469
|
+
*/
|
|
1470
|
+
private openColumnChooser;
|
|
1471
|
+
/** Closes the column chooser. With `returnFocus`, the focus goes back to its button. */
|
|
1472
|
+
private closeColumnChooser;
|
|
1473
|
+
/**
|
|
1474
|
+
* The track width a resize starts from: the user's width when there is one. Otherwise the cell's
|
|
1475
|
+
* measured width, or the header cell's, plus the gap the row's subgrid takes out of a cell. That
|
|
1476
|
+
* is exact for a column between two others and 8px short for the first or last one. Never below
|
|
1477
|
+
* the minimum.
|
|
1478
|
+
*/
|
|
1479
|
+
private currentColumnWidth;
|
|
1480
|
+
/**
|
|
1481
|
+
* Gives the DOM focus to the row the keyboard moved to, once it is rendered. Returns whether it
|
|
1482
|
+
* did. Drops the request when the row is no longer loaded, such as after a refresh.
|
|
1483
|
+
*/
|
|
1484
|
+
private focusPendingRow;
|
|
1485
|
+
/** Loads the next block when the grid is not loading one and has not reached the end. */
|
|
1486
|
+
private loadNextBlock;
|
|
1487
|
+
/**
|
|
1488
|
+
* Moves the focus to the row at `index`: the dataset's focused row first, then the DOM focus.
|
|
1489
|
+
* A row outside the virtual scroll's rendered window is not in the page yet, so the viewport
|
|
1490
|
+
* scrolls to it and the focus follows after it renders. Landing within a page of the last loaded
|
|
1491
|
+
* row loads the next block, as scrolling there does.
|
|
1492
|
+
*/
|
|
1493
|
+
private moveFocusTo;
|
|
1494
|
+
/** Space in a multi-select grid: ticks or clears the row, as its checkbox does. */
|
|
1495
|
+
private toggleRowSelection;
|
|
1260
1496
|
private syncHeaderScroll;
|
|
1261
1497
|
protected trackByFn(index: number, item: any): number;
|
|
1262
1498
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataGridComponent, never>;
|
|
@@ -1333,13 +1569,22 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
|
|
|
1333
1569
|
* the DOM swapped on every row whenever that window moved by an odd number of rows.
|
|
1334
1570
|
*/
|
|
1335
1571
|
readonly rowIndex: InputSignal<number>;
|
|
1572
|
+
/**
|
|
1573
|
+
* Whether this row is the grid's one Tab stop (`tabindex="0"`). The grid sets it on the focused
|
|
1574
|
+
* row, or on the first row when none is focused; every other row is `tabindex="-1"`.
|
|
1575
|
+
* Defaults to `false`.
|
|
1576
|
+
*/
|
|
1577
|
+
readonly tabbable: InputSignal<boolean>;
|
|
1336
1578
|
/** Emits the width in pixels of the selection checkbox cell whenever it changes. */
|
|
1337
1579
|
selectionResized: EventEmitter<number>;
|
|
1338
1580
|
/**
|
|
1339
1581
|
* Makes this row the dataset's focused row. In a multi-select grid that selects on click, it
|
|
1340
1582
|
* also syncs the checkbox. Runs on a click on the row; does nothing while disabled.
|
|
1583
|
+
*
|
|
1584
|
+
* A click on the label around the selection checkbox is skipped: the browser forwards it to the
|
|
1585
|
+
* checkbox, and that second click reaches the row too. Handling both toggled the row twice.
|
|
1341
1586
|
*/
|
|
1342
|
-
setFocus(): void;
|
|
1587
|
+
setFocus(event?: MouseEvent): void;
|
|
1343
1588
|
/**
|
|
1344
1589
|
* Announces the row as activated through the dataset's `rowActivated`. Runs on a double click on
|
|
1345
1590
|
* the row; does nothing while disabled. The host is `select-none`, so no text gets selected.
|
|
@@ -1352,6 +1597,9 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
|
|
|
1352
1597
|
private readonly localeService;
|
|
1353
1598
|
/** The record this row shows. */
|
|
1354
1599
|
get rowData(): any;
|
|
1600
|
+
/** The row's 1-based `aria-rowindex`. The header row is 1, so the first data row is 2. */
|
|
1601
|
+
protected get ariaRowIndex(): number;
|
|
1602
|
+
/** The columns the row shows: the dataset's columns without the hidden ones. */
|
|
1355
1603
|
protected get columns(): IGridColumn[];
|
|
1356
1604
|
private get isLaidOut();
|
|
1357
1605
|
private get isRowDataSelected();
|
|
@@ -1364,9 +1612,9 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
|
|
|
1364
1612
|
* focused nor selected.
|
|
1365
1613
|
*/
|
|
1366
1614
|
protected onActionClicked(event: Event, action: IGridRowAction): void;
|
|
1367
|
-
protected onResize(
|
|
1615
|
+
protected onResize(column: IGridColumn, event: ResizeObserverEntry): void;
|
|
1368
1616
|
protected onResizeSelection(event: ResizeObserverEntry): void;
|
|
1369
|
-
protected onToggleSelection(): void;
|
|
1617
|
+
protected onToggleSelection(event: MouseEvent): void;
|
|
1370
1618
|
protected alignOf(column: IGridColumn): GridColumnAlign;
|
|
1371
1619
|
/**
|
|
1372
1620
|
* The cell of a column without a template, formatted by the column's type. Reads the locale
|
|
@@ -1398,6 +1646,11 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
|
|
|
1398
1646
|
"required": false;
|
|
1399
1647
|
"isSignal": true;
|
|
1400
1648
|
};
|
|
1649
|
+
"tabbable": {
|
|
1650
|
+
"alias": "tabbable";
|
|
1651
|
+
"required": false;
|
|
1652
|
+
"isSignal": true;
|
|
1653
|
+
};
|
|
1401
1654
|
}, {
|
|
1402
1655
|
"selectionResized": "selectionResized";
|
|
1403
1656
|
}, never, never, true, never>;
|