@zambon-dev/ui 1.8.0 → 1.10.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 +43 -1
- package/fesm2022/zambon-dev-ui-framework.mjs +6 -1
- package/fesm2022/zambon-dev-ui-framework.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui-library.mjs +648 -64
- package/fesm2022/zambon-dev-ui-library.mjs.map +1 -1
- package/i18n/framework/en.json +5 -0
- package/i18n/framework/pt.json +5 -0
- package/package.json +1 -1
- package/types/zambon-dev-ui-framework.d.ts +1 -1
- package/types/zambon-dev-ui-library.d.ts +356 -8
package/i18n/framework/en.json
CHANGED
|
@@ -48,11 +48,16 @@
|
|
|
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",
|
|
52
|
+
"Grid-Copied": "Copied {{ count }} rows",
|
|
53
|
+
"Grid-CopiedRow": "Copied 1 row",
|
|
51
54
|
"Grid-Loading": "Loading...",
|
|
52
55
|
"Grid-Message-Empty": "No records found.",
|
|
53
56
|
"Grid-Message-Failed": "An error occurred while loading the records. Please try again later.",
|
|
54
57
|
"Grid-Message-LazyLoad": "Click the refresh button to load entries.",
|
|
55
58
|
"Grid-No": "No",
|
|
59
|
+
"Grid-ResetColumns": "Reset columns",
|
|
60
|
+
"Grid-ResizeColumn": "Resize {{ column }}",
|
|
56
61
|
"Grid-SelectAll": "Select all rows",
|
|
57
62
|
"Grid-SelectRow": "Select row",
|
|
58
63
|
"Grid-TotalRow": "{{ count }} record",
|
package/i18n/framework/pt.json
CHANGED
|
@@ -48,11 +48,16 @@
|
|
|
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",
|
|
52
|
+
"Grid-Copied": "{{ count }} linhas copiadas",
|
|
53
|
+
"Grid-CopiedRow": "1 linha copiada",
|
|
51
54
|
"Grid-Loading": "Carregando...",
|
|
52
55
|
"Grid-Message-Empty": "Nenhum registro encontrado.",
|
|
53
56
|
"Grid-Message-Failed": "Ocorreu um erro ao carregar os registros. Por favor, tente novamente mais tarde.",
|
|
54
57
|
"Grid-Message-LazyLoad": "Clique no botão atualizar para carregar os registros.",
|
|
55
58
|
"Grid-No": "Não",
|
|
59
|
+
"Grid-ResetColumns": "Restaurar colunas",
|
|
60
|
+
"Grid-ResizeColumn": "Redimensionar {{ column }}",
|
|
56
61
|
"Grid-SelectAll": "Selecionar todas as linhas",
|
|
57
62
|
"Grid-SelectRow": "Selecionar linha",
|
|
58
63
|
"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.10.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. */
|
|
@@ -253,6 +253,10 @@ export interface AngularAssetPattern {
|
|
|
253
253
|
input: string;
|
|
254
254
|
output: string;
|
|
255
255
|
}
|
|
256
|
+
/** The row height, in pixels, that `GridConfigsProvider` gives every grid. */
|
|
257
|
+
export declare const DEFAULT_GRID_ROW_HEIGHT = 41.6;
|
|
258
|
+
/** The row height, in pixels, of a `compact` data grid whose `rowHeight` is the default. */
|
|
259
|
+
export declare const COMPACT_GRID_ROW_HEIGHT = 32;
|
|
256
260
|
export type GridConfigs = {
|
|
257
261
|
loadingDisplayText?: string;
|
|
258
262
|
messageOnEmpty?: string;
|
|
@@ -262,9 +266,34 @@ export type GridConfigs = {
|
|
|
262
266
|
rowHeight: number;
|
|
263
267
|
rowsToDisplay: number;
|
|
264
268
|
};
|
|
269
|
+
/** How tightly a data grid sets its rows. See `DataGridConfigs.density`. */
|
|
270
|
+
export type DataGridDensity = 'comfortable' | 'compact';
|
|
265
271
|
export type DataGridConfigs = GridConfigs & {
|
|
272
|
+
/**
|
|
273
|
+
* How tightly the grid sets its rows. `compact` uses 32px rows and tighter cell padding, for
|
|
274
|
+
* dense screens. A `rowHeight` other than the default 41.6px still wins, in either density.
|
|
275
|
+
* Defaults to `comfortable`.
|
|
276
|
+
*/
|
|
277
|
+
density?: DataGridDensity;
|
|
278
|
+
/**
|
|
279
|
+
* Keeps the first visible data column in place while the grid scrolls sideways. The selection
|
|
280
|
+
* column of a multi-select grid stays with it. Defaults to `false`.
|
|
281
|
+
*/
|
|
282
|
+
pinFirstColumn?: boolean;
|
|
283
|
+
/**
|
|
284
|
+
* What screen readers hear after Ctrl+C or Cmd+C copies rows, as a translation key or plain text.
|
|
285
|
+
* `{{ count }}` is replaced by the number of rows copied. Defaults to `Copied {{ count }} rows`.
|
|
286
|
+
*/
|
|
287
|
+
copiedText?: string;
|
|
288
|
+
/** The same text when exactly one row was copied. Defaults to `Copied 1 row`. */
|
|
289
|
+
copiedRowText?: string;
|
|
266
290
|
/** Drops the grid's outline and rounded corner, for a grid that sits inside a card of its own. */
|
|
267
291
|
hideBorders?: boolean;
|
|
292
|
+
/**
|
|
293
|
+
* The grid's accessible name, as a translation key or plain text, such as `Customers`. Screen
|
|
294
|
+
* readers announce it when focus enters the grid. No default: a grid without it has no name.
|
|
295
|
+
*/
|
|
296
|
+
gridLabel?: string;
|
|
268
297
|
hideColumnHeaders?: boolean;
|
|
269
298
|
multiSelect?: boolean;
|
|
270
299
|
/**
|
|
@@ -275,8 +304,8 @@ export type DataGridConfigs = GridConfigs & {
|
|
|
275
304
|
*/
|
|
276
305
|
multiSelectSize?: string;
|
|
277
306
|
/**
|
|
278
|
-
* Whether a double click on a row opens its record, in the
|
|
279
|
-
* emits `rowActivated` either way. Defaults to `true`.
|
|
307
|
+
* Whether a double click on a row, or Enter on the focused row, opens its record, in the
|
|
308
|
+
* framework's list views. The grid emits `rowActivated` either way. Defaults to `true`.
|
|
280
309
|
*/
|
|
281
310
|
openOnDoubleClick?: boolean;
|
|
282
311
|
/**
|
|
@@ -310,6 +339,37 @@ export type DataGridConfigs = GridConfigs & {
|
|
|
310
339
|
booleanTrueText?: string;
|
|
311
340
|
/** The same for a false value, when the column sets no `falseText`. Defaults to `No`. */
|
|
312
341
|
booleanFalseText?: string;
|
|
342
|
+
/**
|
|
343
|
+
* Shows a button at the end of the header that opens the column chooser, where the user hides
|
|
344
|
+
* and shows columns. See `IGridColumn.hideable`. Defaults to `false`.
|
|
345
|
+
*/
|
|
346
|
+
columnChooser?: boolean;
|
|
347
|
+
/**
|
|
348
|
+
* The column chooser button's accessible name and tooltip, and the chooser's name, as a
|
|
349
|
+
* translation key or plain text. Defaults to `Choose columns`.
|
|
350
|
+
*/
|
|
351
|
+
columnChooserText?: string;
|
|
352
|
+
/**
|
|
353
|
+
* The text of the chooser's button that shows every column and clears every width again, as a
|
|
354
|
+
* translation key or plain text. Defaults to `Reset columns`.
|
|
355
|
+
*/
|
|
356
|
+
resetColumnsText?: string;
|
|
357
|
+
/**
|
|
358
|
+
* Gives each header cell a handle at its end edge that resizes the column, by dragging or with
|
|
359
|
+
* the arrow keys. The selection and `actions` columns have none. Defaults to `false`.
|
|
360
|
+
*/
|
|
361
|
+
resizableColumns?: boolean;
|
|
362
|
+
/**
|
|
363
|
+
* The resize handle's accessible name, as a translation key or plain text. `{{ column }}` is
|
|
364
|
+
* replaced by the column's translated header. Defaults to `Resize {{ column }}`.
|
|
365
|
+
*/
|
|
366
|
+
resizeColumnText?: string;
|
|
367
|
+
/**
|
|
368
|
+
* Saves the hidden columns and the column widths in `localStorage` under
|
|
369
|
+
* `zambon-dev.grid.{columnsStateKey}`, and restores them when the grid starts. Use a key unique
|
|
370
|
+
* to the grid. No default: without it nothing is saved.
|
|
371
|
+
*/
|
|
372
|
+
columnsStateKey?: string;
|
|
313
373
|
};
|
|
314
374
|
export interface IListParameters extends ISummaryParameters {
|
|
315
375
|
endRow: number;
|
|
@@ -410,6 +470,26 @@ export interface IGridColumn {
|
|
|
410
470
|
* `actions`, `center` for `boolean`, and `start` otherwise.
|
|
411
471
|
*/
|
|
412
472
|
align?: GridColumnAlign;
|
|
473
|
+
/**
|
|
474
|
+
* Starts the column hidden. The user can show it again from the column chooser, when the grid
|
|
475
|
+
* has one. Ignored when `hideable` is `false`. Defaults to `false`.
|
|
476
|
+
*/
|
|
477
|
+
hidden?: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* Whether the user can hide the column from the column chooser. Set `false` for a column the user
|
|
480
|
+
* must always see, such as the record's name. Defaults to `true`, and to `false` for `actions`.
|
|
481
|
+
*/
|
|
482
|
+
hideable?: boolean;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* What a grid with `columnsStateKey` keeps in `localStorage`: the fields of the hidden columns and
|
|
486
|
+
* the width in pixels of each resized column, by field.
|
|
487
|
+
*/
|
|
488
|
+
export interface IGridColumnsState {
|
|
489
|
+
/** The `field` of each column the user hid. */
|
|
490
|
+
hidden: string[];
|
|
491
|
+
/** The width in pixels of each column the user resized, keyed by `field`. */
|
|
492
|
+
widths: Record<string, number>;
|
|
413
493
|
}
|
|
414
494
|
export interface IListResult<T> {
|
|
415
495
|
items: T[];
|
|
@@ -964,10 +1044,12 @@ export declare abstract class GridDataset extends BaseDataset {
|
|
|
964
1044
|
static ɵfac: i0.ɵɵFactoryDeclaration<GridDataset, never>;
|
|
965
1045
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
966
1046
|
}
|
|
1047
|
+
/** The smallest width, in pixels, a user can give a grid column: 3rem at the default font size. */
|
|
1048
|
+
export declare const MIN_GRID_COLUMN_WIDTH = 48;
|
|
967
1049
|
export declare abstract class DataGridDataset extends GridDataset {
|
|
968
1050
|
/**
|
|
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
|
|
1051
|
+
* Emits the row's data when the user activates a row: a double click, or Enter on the focused
|
|
1052
|
+
* row. A disabled grid emits nothing. The framework's Open button opens the record on it, unless the configs set
|
|
971
1053
|
* `openOnDoubleClick` to `false`.
|
|
972
1054
|
*/
|
|
973
1055
|
rowActivated: EventEmitter<any>;
|
|
@@ -980,12 +1062,65 @@ export declare abstract class DataGridDataset extends GridDataset {
|
|
|
980
1062
|
configs: DataGridConfigs;
|
|
981
1063
|
columns: IGridColumn[];
|
|
982
1064
|
private _selectedRowKeys;
|
|
1065
|
+
/**
|
|
1066
|
+
* The fields of the hidden columns, once the user or a stored state changed them. `null` means
|
|
1067
|
+
* each column's own `hidden` decides.
|
|
1068
|
+
*/
|
|
1069
|
+
private readonly hiddenFields;
|
|
1070
|
+
/** The width in pixels of each column the user resized, keyed by `field`. */
|
|
1071
|
+
private readonly columnWidths;
|
|
983
1072
|
get selectedRowKeys(): string[];
|
|
984
1073
|
set selectedRowKeys(value: string[]);
|
|
1074
|
+
/**
|
|
1075
|
+
* The CSS grid template of the rows: the selection column, then each visible column. A column the
|
|
1076
|
+
* user resized is a fixed track of its width in pixels; any other uses its `size`.
|
|
1077
|
+
*/
|
|
985
1078
|
get columnsSize(): string;
|
|
1079
|
+
/** The columns the grid shows: `columns` without the hidden ones. */
|
|
1080
|
+
get visibleColumns(): IGridColumn[];
|
|
1081
|
+
/**
|
|
1082
|
+
* The height in pixels the grid gives each row. A `compact` grid uses 32px while `rowHeight` is the
|
|
1083
|
+
* default 41.6px. Any other `rowHeight`, set on the dataset or by the configs provider, wins in
|
|
1084
|
+
* either density.
|
|
1085
|
+
*/
|
|
1086
|
+
get effectiveRowHeight(): number;
|
|
986
1087
|
get hasSelectedRows(): boolean;
|
|
987
1088
|
constructor();
|
|
988
1089
|
clearSelection(): void;
|
|
1090
|
+
/**
|
|
1091
|
+
* Whether the user may hide the column: its `hideable`, which defaults to `true`, and to `false`
|
|
1092
|
+
* for an `actions` column.
|
|
1093
|
+
*/
|
|
1094
|
+
isColumnHideable(column: IGridColumn): boolean;
|
|
1095
|
+
/** Whether the column is hidden, by the user, a stored state or its own `hidden`. */
|
|
1096
|
+
isColumnHidden(column: IGridColumn): boolean;
|
|
1097
|
+
/**
|
|
1098
|
+
* Whether the column may be hidden now. It must be hideable and visible, and another column
|
|
1099
|
+
* other than an `actions` column must stay visible: the grid never shows no data at all.
|
|
1100
|
+
*/
|
|
1101
|
+
canHideColumn(column: IGridColumn): boolean;
|
|
1102
|
+
/**
|
|
1103
|
+
* Hides or shows the column with this `field`. Does nothing for a column that is not hideable, or
|
|
1104
|
+
* when hiding it would leave no column to show. Saves the state when `columnsStateKey` is set.
|
|
1105
|
+
*/
|
|
1106
|
+
setColumnHidden(field: string, hidden: boolean): void;
|
|
1107
|
+
/** The width in pixels the user gave the column with this `field`, or `undefined` when it has its `size`. */
|
|
1108
|
+
getColumnWidth(field: string): number | undefined;
|
|
1109
|
+
/**
|
|
1110
|
+
* Gives the column with this `field` a fixed width in pixels, at least `MIN_GRID_COLUMN_WIDTH`.
|
|
1111
|
+
* `null` gives it back its `size`. An `actions` column keeps its size. Saves the state when
|
|
1112
|
+
* `columnsStateKey` is set, unless `save` is `false`, as it is while a drag is still going on.
|
|
1113
|
+
*/
|
|
1114
|
+
setColumnWidth(field: string, width: number | null, save?: boolean): void;
|
|
1115
|
+
/** Shows the columns as declared and drops every width, and clears the saved state. */
|
|
1116
|
+
resetColumns(): void;
|
|
1117
|
+
/**
|
|
1118
|
+
* Restores the hidden columns and widths saved under `columnsStateKey`. The grid calls it when it
|
|
1119
|
+
* starts. A state that does not parse is ignored, and so are fields no column has any more.
|
|
1120
|
+
*/
|
|
1121
|
+
restoreColumnsState(): void;
|
|
1122
|
+
/** Saves the hidden columns and widths under `columnsStateKey`. Does nothing without one. */
|
|
1123
|
+
saveColumnsState(): void;
|
|
989
1124
|
export(_format: string, _parameters: IListParameters): Observable<HttpResponse<Blob>>;
|
|
990
1125
|
deselectRow(key: string): void;
|
|
991
1126
|
deselectRowID(id: any): void;
|
|
@@ -996,7 +1131,17 @@ export declare abstract class DataGridDataset extends GridDataset {
|
|
|
996
1131
|
selectRow(key: string): void;
|
|
997
1132
|
selectRowID(id: any): void;
|
|
998
1133
|
selectRows(keys: string[]): void;
|
|
1134
|
+
/**
|
|
1135
|
+
* Makes a row the focused one the way the grid's arrow keys do. A single-select grid selects it,
|
|
1136
|
+
* as a click does. A multi-select grid only moves the focus and leaves the selection alone, so
|
|
1137
|
+
* walking through the rows does not tick each one; Space toggles the focused row instead.
|
|
1138
|
+
*/
|
|
1139
|
+
moveFocusedRow(key: string): void;
|
|
999
1140
|
setFocusedRow(key: any): void;
|
|
1141
|
+
/** The `localStorage` key of the columns state, or `null` when the configs set no `columnsStateKey`. */
|
|
1142
|
+
private get columnsStorageKey();
|
|
1143
|
+
/** The fields of the columns hidden now. */
|
|
1144
|
+
private hiddenColumnFields;
|
|
1000
1145
|
protected removeSelectedRow(key: string): void;
|
|
1001
1146
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataGridDataset, never>;
|
|
1002
1147
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
@@ -1173,6 +1318,8 @@ declare namespace data_grid_component_d_exports {
|
|
|
1173
1318
|
export declare class DataGridComponent extends BaseComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
1174
1319
|
private readonly bodyElement;
|
|
1175
1320
|
private readonly viewport;
|
|
1321
|
+
private readonly columnChooserButton;
|
|
1322
|
+
private readonly columnChooserTemplate;
|
|
1176
1323
|
/** Disables the rows, so they cannot be focused or selected. Defaults to `false`. */
|
|
1177
1324
|
readonly disabled: InputSignal<boolean>;
|
|
1178
1325
|
/**
|
|
@@ -1189,18 +1336,71 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1189
1336
|
protected readonly hasFailed: WritableSignal<boolean>;
|
|
1190
1337
|
protected readonly headerRightMargin: WritableSignal<number>;
|
|
1191
1338
|
protected readonly headerScrollLeft: WritableSignal<number>;
|
|
1339
|
+
/**
|
|
1340
|
+
* The height in pixels of the body's horizontal scrollbar while the columns are wider than the
|
|
1341
|
+
* grid, else 0. The body grows by it, so the scrollbar does not cover the last row.
|
|
1342
|
+
*/
|
|
1343
|
+
protected readonly horizontalScrollbarHeight: WritableSignal<number>;
|
|
1344
|
+
/** How many rows the last copy put on the clipboard, while the status region announces it. */
|
|
1345
|
+
protected readonly copiedCount: WritableSignal<number | null>;
|
|
1192
1346
|
protected readonly loading: WritableSignal<boolean>;
|
|
1347
|
+
/** Whether the column chooser popover is open. */
|
|
1348
|
+
protected readonly columnChooserOpen: WritableSignal<boolean>;
|
|
1349
|
+
protected readonly columnChooserId: string;
|
|
1350
|
+
protected readonly minColumnWidth: number;
|
|
1193
1351
|
private bodyResized$;
|
|
1352
|
+
private copiedTimer?;
|
|
1353
|
+
/**
|
|
1354
|
+
* The key of a row the keyboard moved to that was not rendered yet. It gets the DOM focus after
|
|
1355
|
+
* the virtual scroll renders it; see focusPendingRow.
|
|
1356
|
+
*/
|
|
1357
|
+
private pendingFocusKey;
|
|
1194
1358
|
private bodyResizeObserver?;
|
|
1359
|
+
private contentResizeObserver?;
|
|
1360
|
+
private columnChooserRef?;
|
|
1361
|
+
private readonly document;
|
|
1362
|
+
private readonly injector;
|
|
1363
|
+
private readonly overlay;
|
|
1364
|
+
private readonly platformId;
|
|
1365
|
+
/** Ends the column drag in progress, if any: removes its listeners and saves the width. */
|
|
1366
|
+
private stopColumnResize?;
|
|
1367
|
+
private readonly viewContainerRef;
|
|
1195
1368
|
private gridRoute;
|
|
1196
1369
|
private isGridCurrentUrl;
|
|
1197
1370
|
private lastPosition;
|
|
1198
1371
|
private readonly localeService;
|
|
1199
1372
|
private ngZone;
|
|
1200
1373
|
private router;
|
|
1374
|
+
private readonly translateService;
|
|
1201
1375
|
private selectionColRealSize?;
|
|
1202
1376
|
protected get bodyMinHeight(): number;
|
|
1377
|
+
/** The height in pixels of each row: `rowHeight`, or 32px in a `compact` grid at the default. */
|
|
1378
|
+
protected get rowHeight(): number;
|
|
1379
|
+
/** Whether the first data column, and the selection column, stay in place sideways. */
|
|
1380
|
+
protected get pinFirstColumn(): boolean;
|
|
1381
|
+
/** The first column the header and the rows show, which `pinFirstColumn` pins. */
|
|
1382
|
+
protected get firstColumn(): IGridColumn | undefined;
|
|
1383
|
+
/**
|
|
1384
|
+
* Where the pinned data column sticks after a pinned selection column: the selection cell's full
|
|
1385
|
+
* width, its reach over the row's padding included. `null` until the selection cell is measured.
|
|
1386
|
+
*/
|
|
1387
|
+
protected get pinOffset(): string | null;
|
|
1388
|
+
/**
|
|
1389
|
+
* The grid's `aria-rowcount`, header row included. The dataset's `totalRows` when the last load
|
|
1390
|
+
* returned one; the loaded rows once the last block is in; otherwise -1, which tells assistive
|
|
1391
|
+
* technology the total is unknown.
|
|
1392
|
+
*/
|
|
1393
|
+
protected get ariaRowCount(): number;
|
|
1394
|
+
/** The columns the header shows: the dataset's columns without the hidden ones. */
|
|
1203
1395
|
protected get columns(): IGridColumn[];
|
|
1396
|
+
/** The columns the chooser lists: every column the user may hide, hidden or not. */
|
|
1397
|
+
protected get hideableColumns(): IGridColumn[];
|
|
1398
|
+
protected get showColumnChooser(): boolean;
|
|
1399
|
+
protected get columnChooserText(): string;
|
|
1400
|
+
protected get resetColumnsText(): string;
|
|
1401
|
+
protected get resizeColumnText(): string;
|
|
1402
|
+
/** The grid's accessible name, a translation key or plain text, or none. */
|
|
1403
|
+
protected get gridLabel(): string | null;
|
|
1204
1404
|
protected get configs(): DataGridConfigs;
|
|
1205
1405
|
protected get gridColumns(): string;
|
|
1206
1406
|
protected get hasBeenLoaded(): boolean;
|
|
@@ -1227,6 +1427,21 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1227
1427
|
/** The footer text, singular for a total of exactly 1. */
|
|
1228
1428
|
protected get totalRowsText(): string;
|
|
1229
1429
|
protected get shouldDisplayMessageWhenEmpty(): boolean;
|
|
1430
|
+
/**
|
|
1431
|
+
* The text of the status region screen readers hear: the same loading, lazy-load, empty or
|
|
1432
|
+
* failure message the grid shows inside its body, or nothing. The visible copies are hidden from
|
|
1433
|
+
* assistive technology, because a message is not a row and has no place in the grid's role tree.
|
|
1434
|
+
*/
|
|
1435
|
+
protected get statusText(): string;
|
|
1436
|
+
/**
|
|
1437
|
+
* The key of the grid's one Tab stop: the focused row, while it is loaded and rendered.
|
|
1438
|
+
* Otherwise the first rendered row, which is the first row until the user scrolls. Falling back
|
|
1439
|
+
* to a rendered row keeps the grid reachable with Tab when the focused row scrolled out of the
|
|
1440
|
+
* virtual scroll's window, and after a refresh dropped it.
|
|
1441
|
+
*/
|
|
1442
|
+
protected get tabbableRowKey(): string | undefined;
|
|
1443
|
+
/** How many rows a PageDown or PageUp moves: the rows that fit in the viewport, at least one. */
|
|
1444
|
+
private get pageSize();
|
|
1230
1445
|
/**
|
|
1231
1446
|
* Whether the grid is in the document, which it is not while the route-reuse strategy holds its
|
|
1232
1447
|
* view detached -- the list a tab keeps in its history while the user is on a record.
|
|
@@ -1249,6 +1464,36 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1249
1464
|
* Goes through the dataset, so `selectedRowsChanged` announces the change as for any other.
|
|
1250
1465
|
*/
|
|
1251
1466
|
protected onToggleSelectAll(): void;
|
|
1467
|
+
/**
|
|
1468
|
+
* The keyboard on a focused row: arrows, Home, End, PageUp and PageDown move the focus, Space
|
|
1469
|
+
* toggles the row in a multi-select grid and Enter activates it. Only a key pressed on a row
|
|
1470
|
+
* itself counts, so a control inside a cell keeps its own keys. A disabled grid ignores them all.
|
|
1471
|
+
*/
|
|
1472
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
1473
|
+
/**
|
|
1474
|
+
* Ctrl+C or Cmd+C on a focused row copies rows as tab-separated text, one line per row: the
|
|
1475
|
+
* selected rows of a multi-select grid that has a selection, else the focused row. Text the user
|
|
1476
|
+
* selected is left to the browser's own copy. Without the Clipboard API nothing happens.
|
|
1477
|
+
*/
|
|
1478
|
+
protected onCopyKeydown(event: KeyboardEvent): void;
|
|
1479
|
+
/** The column chooser button: opens the chooser, or closes it when it is open. */
|
|
1480
|
+
protected onToggleColumnChooser(): void;
|
|
1481
|
+
/** A key inside the chooser. Escape closes it and gives the focus back to the button. */
|
|
1482
|
+
protected onColumnChooserKeydown(event: KeyboardEvent): void;
|
|
1483
|
+
/** A chooser checkbox: a ticked box shows its column, a cleared one hides it. */
|
|
1484
|
+
protected onToggleColumn(column: IGridColumn, event: Event): void;
|
|
1485
|
+
/** The chooser's reset button: every column as declared, every width dropped, nothing saved. */
|
|
1486
|
+
protected onResetColumns(): void;
|
|
1487
|
+
/**
|
|
1488
|
+
* A pointer pressed on a resize handle starts a drag. The moves are heard outside Angular, since
|
|
1489
|
+
* they fire for every frame, and write the width to the dataset's signal. Releasing the pointer
|
|
1490
|
+
* saves the width.
|
|
1491
|
+
*/
|
|
1492
|
+
protected onResizeStart(event: PointerEvent, column: IGridColumn): void;
|
|
1493
|
+
/** ArrowRight widens the column by 16 pixels and ArrowLeft narrows it, down to the minimum. */
|
|
1494
|
+
protected onResizeKeydown(event: KeyboardEvent, column: IGridColumn): void;
|
|
1495
|
+
/** A double click on a resize handle gives the column back its declared size. */
|
|
1496
|
+
protected onResizeReset(event: MouseEvent, column: IGridColumn): void;
|
|
1252
1497
|
protected onSelectionResized(newSize: number): void;
|
|
1253
1498
|
protected alignOf(column: IGridColumn): GridColumnAlign;
|
|
1254
1499
|
/**
|
|
@@ -1256,7 +1501,80 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1256
1501
|
* key, but returns plain text such as the library default untouched, placeholder and all.
|
|
1257
1502
|
*/
|
|
1258
1503
|
protected fillCount(text: string): string;
|
|
1504
|
+
/** The number of rows the last copy took, in the application's language, for the status region. */
|
|
1505
|
+
protected get formattedCopiedCount(): string;
|
|
1506
|
+
/** Puts the copied rows' count into the status text, when it is plain text the pipe left alone. */
|
|
1507
|
+
protected fillCopiedCount(text: string): string;
|
|
1508
|
+
/** The translateX a pinned heading takes to stay in place while the header row moves sideways. */
|
|
1509
|
+
protected pinnedHeaderTransform(): string | null;
|
|
1510
|
+
/**
|
|
1511
|
+
* The width of a header cell, in pixels: the width of the column's cell measured in the first
|
|
1512
|
+
* row, or before that the width the user gave the column. `null` until either is known.
|
|
1513
|
+
*
|
|
1514
|
+
* A resized column's cell is narrower than its track: the rows are subgrids with a gap of their
|
|
1515
|
+
* own, and a subgrid takes its gap out of its cells. So the header copies the measured cell, as
|
|
1516
|
+
* it does for every column, rather than the track's width.
|
|
1517
|
+
*/
|
|
1518
|
+
protected headerWidth(column: IGridColumn): number | null;
|
|
1519
|
+
/** Whether the column's header cell has a resize handle. */
|
|
1520
|
+
protected isResizable(column: IGridColumn): boolean;
|
|
1521
|
+
/** The resize handle's `aria-valuenow`: the column's track width in whole pixels. */
|
|
1522
|
+
protected resizeValue(column: IGridColumn): number;
|
|
1523
|
+
/**
|
|
1524
|
+
* Puts the column's name into the resize handle's name. The translate pipe fills `{{ column }}`
|
|
1525
|
+
* for a known key, but returns plain text such as the library default untouched.
|
|
1526
|
+
*/
|
|
1527
|
+
protected fillColumn(text: string, columnName: string): string;
|
|
1259
1528
|
protected isFirstVisibleRow(rowIndex: number): boolean;
|
|
1529
|
+
/**
|
|
1530
|
+
* Says through the status region how many rows were copied, for a while. The same text twice in
|
|
1531
|
+
* a row would not be announced again, so the region is emptied first and filled a moment later.
|
|
1532
|
+
*/
|
|
1533
|
+
private announceCopied;
|
|
1534
|
+
/** The text a copy takes from a cell: what the cell shows, translated, on one line. */
|
|
1535
|
+
private cellText;
|
|
1536
|
+
/** Whether the document has a non-empty text selection, which the browser's own copy takes. */
|
|
1537
|
+
private hasTextSelection;
|
|
1538
|
+
/** Whether the key is Ctrl+C, or Cmd+C on a Mac. */
|
|
1539
|
+
private isCopyShortcut;
|
|
1540
|
+
/**
|
|
1541
|
+
* Measures the body's horizontal scrollbar: the viewport's height less its client height, while
|
|
1542
|
+
* its content is wider than it. Writes the signal only on a change. Skipped while detached; see
|
|
1543
|
+
* isBodyAttached.
|
|
1544
|
+
*/
|
|
1545
|
+
private measureHorizontalScrollbar;
|
|
1546
|
+
/** The rows as tab-separated text, one line per row, of the visible columns but `actions` ones. */
|
|
1547
|
+
private rowsAsText;
|
|
1548
|
+
/**
|
|
1549
|
+
* Opens the column chooser in a CDK overlay under its button. The focus moves to its first
|
|
1550
|
+
* control and stays inside until Escape or a click outside closes it.
|
|
1551
|
+
*/
|
|
1552
|
+
private openColumnChooser;
|
|
1553
|
+
/** Closes the column chooser. With `returnFocus`, the focus goes back to its button. */
|
|
1554
|
+
private closeColumnChooser;
|
|
1555
|
+
/**
|
|
1556
|
+
* The track width a resize starts from: the user's width when there is one. Otherwise the cell's
|
|
1557
|
+
* measured width, or the header cell's, plus the gap the row's subgrid takes out of a cell. That
|
|
1558
|
+
* is exact for a column between two others and 8px short for the first or last one. Never below
|
|
1559
|
+
* the minimum.
|
|
1560
|
+
*/
|
|
1561
|
+
private currentColumnWidth;
|
|
1562
|
+
/**
|
|
1563
|
+
* Gives the DOM focus to the row the keyboard moved to, once it is rendered. Returns whether it
|
|
1564
|
+
* did. Drops the request when the row is no longer loaded, such as after a refresh.
|
|
1565
|
+
*/
|
|
1566
|
+
private focusPendingRow;
|
|
1567
|
+
/** Loads the next block when the grid is not loading one and has not reached the end. */
|
|
1568
|
+
private loadNextBlock;
|
|
1569
|
+
/**
|
|
1570
|
+
* Moves the focus to the row at `index`: the dataset's focused row first, then the DOM focus.
|
|
1571
|
+
* A row outside the virtual scroll's rendered window is not in the page yet, so the viewport
|
|
1572
|
+
* scrolls to it and the focus follows after it renders. Landing within a page of the last loaded
|
|
1573
|
+
* row loads the next block, as scrolling there does.
|
|
1574
|
+
*/
|
|
1575
|
+
private moveFocusTo;
|
|
1576
|
+
/** Space in a multi-select grid: ticks or clears the row, as its checkbox does. */
|
|
1577
|
+
private toggleRowSelection;
|
|
1260
1578
|
private syncHeaderScroll;
|
|
1261
1579
|
protected trackByFn(index: number, item: any): number;
|
|
1262
1580
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataGridComponent, never>;
|
|
@@ -1333,16 +1651,34 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
|
|
|
1333
1651
|
* the DOM swapped on every row whenever that window moved by an odd number of rows.
|
|
1334
1652
|
*/
|
|
1335
1653
|
readonly rowIndex: InputSignal<number>;
|
|
1654
|
+
/**
|
|
1655
|
+
* Whether this row is the grid's one Tab stop (`tabindex="0"`). The grid sets it on the focused
|
|
1656
|
+
* row, or on the first row when none is focused; every other row is `tabindex="-1"`.
|
|
1657
|
+
* Defaults to `false`.
|
|
1658
|
+
*/
|
|
1659
|
+
readonly tabbable: InputSignal<boolean>;
|
|
1336
1660
|
/** Emits the width in pixels of the selection checkbox cell whenever it changes. */
|
|
1337
1661
|
selectionResized: EventEmitter<number>;
|
|
1338
1662
|
/**
|
|
1339
1663
|
* Makes this row the dataset's focused row. In a multi-select grid that selects on click, it
|
|
1340
1664
|
* also syncs the checkbox. Runs on a click on the row; does nothing while disabled.
|
|
1665
|
+
*
|
|
1666
|
+
* A click on the label around the selection checkbox is skipped: the browser forwards it to the
|
|
1667
|
+
* checkbox, and that second click reaches the row too. Handling both toggled the row twice.
|
|
1668
|
+
*
|
|
1669
|
+
* A click that ends with text selected inside the grid is skipped too: it was a drag to select
|
|
1670
|
+
* that text, so the user can copy it without selecting or focusing the row.
|
|
1341
1671
|
*/
|
|
1342
|
-
setFocus(): void;
|
|
1672
|
+
setFocus(event?: MouseEvent): void;
|
|
1673
|
+
/**
|
|
1674
|
+
* Keeps a double or triple click from selecting a word or the cell's text: the double click opens
|
|
1675
|
+
* the record, and a selection left behind would make its second click count as a text selection.
|
|
1676
|
+
* Dragging still selects text. A control in a cell keeps its own behaviour.
|
|
1677
|
+
*/
|
|
1678
|
+
preventMultiClickSelection(event: MouseEvent): void;
|
|
1343
1679
|
/**
|
|
1344
1680
|
* Announces the row as activated through the dataset's `rowActivated`. Runs on a double click on
|
|
1345
|
-
* the row; does nothing while disabled.
|
|
1681
|
+
* the row; does nothing while disabled.
|
|
1346
1682
|
*/
|
|
1347
1683
|
activate(): void;
|
|
1348
1684
|
protected dataGridDataset: DataGridDataset;
|
|
@@ -1352,10 +1688,15 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
|
|
|
1352
1688
|
private readonly localeService;
|
|
1353
1689
|
/** The record this row shows. */
|
|
1354
1690
|
get rowData(): any;
|
|
1691
|
+
/** The row's 1-based `aria-rowindex`. The header row is 1, so the first data row is 2. */
|
|
1692
|
+
protected get ariaRowIndex(): number;
|
|
1693
|
+
/** The columns the row shows: the dataset's columns without the hidden ones. */
|
|
1355
1694
|
protected get columns(): IGridColumn[];
|
|
1356
1695
|
private get isLaidOut();
|
|
1357
1696
|
private get isRowDataSelected();
|
|
1358
1697
|
protected get rowKey(): string;
|
|
1698
|
+
/** Whether the grid keeps its first data column, and its selection column, in place sideways. */
|
|
1699
|
+
protected get pinFirstColumn(): boolean;
|
|
1359
1700
|
protected get selectRowText(): string;
|
|
1360
1701
|
constructor();
|
|
1361
1702
|
ngOnInit(): void;
|
|
@@ -1364,9 +1705,9 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
|
|
|
1364
1705
|
* focused nor selected.
|
|
1365
1706
|
*/
|
|
1366
1707
|
protected onActionClicked(event: Event, action: IGridRowAction): void;
|
|
1367
|
-
protected onResize(
|
|
1708
|
+
protected onResize(column: IGridColumn, event: ResizeObserverEntry): void;
|
|
1368
1709
|
protected onResizeSelection(event: ResizeObserverEntry): void;
|
|
1369
|
-
protected onToggleSelection(): void;
|
|
1710
|
+
protected onToggleSelection(event: MouseEvent): void;
|
|
1370
1711
|
protected alignOf(column: IGridColumn): GridColumnAlign;
|
|
1371
1712
|
/**
|
|
1372
1713
|
* The cell of a column without a template, formatted by the column's type. Reads the locale
|
|
@@ -1378,6 +1719,8 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
|
|
|
1378
1719
|
protected visibleActions(column: IGridColumn): IGridRowAction[];
|
|
1379
1720
|
protected isNumeric(column: IGridColumn): boolean;
|
|
1380
1721
|
protected getValue(field: string): any;
|
|
1722
|
+
/** Whether the document has a non-empty text selection that starts or ends inside this row's grid. */
|
|
1723
|
+
private hasTextSelectionInGrid;
|
|
1381
1724
|
private refreshSelection;
|
|
1382
1725
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataGridRowComponent, never>;
|
|
1383
1726
|
static ɵcmp: i0.ɵɵComponentDeclaration<DataGridRowComponent, "lib-data-grid-row", never, {
|
|
@@ -1398,6 +1741,11 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
|
|
|
1398
1741
|
"required": false;
|
|
1399
1742
|
"isSignal": true;
|
|
1400
1743
|
};
|
|
1744
|
+
"tabbable": {
|
|
1745
|
+
"alias": "tabbable";
|
|
1746
|
+
"required": false;
|
|
1747
|
+
"isSignal": true;
|
|
1748
|
+
};
|
|
1401
1749
|
}, {
|
|
1402
1750
|
"selectionResized": "selectionResized";
|
|
1403
1751
|
}, never, never, true, never>;
|