@zambon-dev/ui 1.7.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 +44 -1
- package/fesm2022/zambon-dev-ui-framework.mjs +23 -5
- package/fesm2022/zambon-dev-ui-framework.mjs.map +1 -1
- package/fesm2022/zambon-dev-ui-library.mjs +3068 -2558
- 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/styles/components/input.scss +13 -0
- package/types/zambon-dev-ui-framework.d.ts +11 -1
- package/types/zambon-dev-ui-library.d.ts +330 -6
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",
|
|
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 }}",
|
|
59
|
+
"Grid-SelectAll": "Select all rows",
|
|
60
|
+
"Grid-SelectRow": "Select row",
|
|
56
61
|
"Grid-TotalRow": "{{ count }} record",
|
|
57
62
|
"Grid-TotalRows": "{{ count }} records",
|
|
58
63
|
"Grid-Yes": "Yes",
|
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",
|
|
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 }}",
|
|
59
|
+
"Grid-SelectAll": "Selecionar todas as linhas",
|
|
60
|
+
"Grid-SelectRow": "Selecionar linha",
|
|
56
61
|
"Grid-TotalRow": "{{ count }} registro",
|
|
57
62
|
"Grid-TotalRows": "{{ count }} registros",
|
|
58
63
|
"Grid-Yes": "Sim",
|
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",
|
|
@@ -73,6 +73,19 @@ input[type='checkbox'].form-input {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
/* Some, not all: a "select all" box over a partial selection. Without this rule the box showed
|
|
77
|
+
empty, because the forms plugin's white dash sat on the white fill. */
|
|
78
|
+
&:indeterminate {
|
|
79
|
+
@apply bg-none;
|
|
80
|
+
background-color: var(--color-accent);
|
|
81
|
+
border-color: var(--color-accent);
|
|
82
|
+
|
|
83
|
+
&:before {
|
|
84
|
+
@apply content-['\f068'];
|
|
85
|
+
color: var(--color-content-on-accent);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
76
89
|
&:disabled {
|
|
77
90
|
~ label {
|
|
78
91
|
@apply opacity-50;
|
|
@@ -790,7 +790,8 @@ declare namespace button_open_record_component_d_exports$1 {
|
|
|
790
790
|
}
|
|
791
791
|
/**
|
|
792
792
|
* Ribbon button that opens the record selected in the surrounding data grid in the current tab.
|
|
793
|
-
* Enabled only when exactly one row is selected.
|
|
793
|
+
* Enabled only when exactly one row is selected. It also opens a row the grid reports through
|
|
794
|
+
* `rowActivated`, a double click or Enter, unless the grid's configs set `openOnDoubleClick` to `false`.
|
|
794
795
|
*/
|
|
795
796
|
export declare class ButtonOpenRecordComponent extends BaseButton implements OnInit {
|
|
796
797
|
/** Segment added between `rootPath` and the record's ID. Unset by default. */
|
|
@@ -802,8 +803,17 @@ export declare class ButtonOpenRecordComponent extends BaseButton implements OnI
|
|
|
802
803
|
private readonly selectionCount;
|
|
803
804
|
private tabService;
|
|
804
805
|
protected get isSelectedOneRecord(): boolean;
|
|
806
|
+
/** Whether the button may open a record: enabled, allowed and shown. */
|
|
807
|
+
private get canOpen();
|
|
805
808
|
ngOnInit(): void;
|
|
806
809
|
protected onButtonClicked(): void;
|
|
810
|
+
/**
|
|
811
|
+
* Opens the activated row, whatever the selection holds: the double click that activated it has
|
|
812
|
+
* already toggled the selection twice. Does nothing when the grid's configs set
|
|
813
|
+
* `openOnDoubleClick` to `false`, or when the button could not open a record itself.
|
|
814
|
+
*/
|
|
815
|
+
protected onRowActivated(rowData: any): void;
|
|
816
|
+
private openRecord;
|
|
807
817
|
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonOpenRecordComponent, never>;
|
|
808
818
|
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonOpenRecordComponent, "framework-button-open-record", never, {
|
|
809
819
|
"elementPath": {
|
|
@@ -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
|
/**
|
|
@@ -274,7 +279,22 @@ export type DataGridConfigs = GridConfigs & {
|
|
|
274
279
|
* leaves the checkbox no room at all.
|
|
275
280
|
*/
|
|
276
281
|
multiSelectSize?: string;
|
|
282
|
+
/**
|
|
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`.
|
|
285
|
+
*/
|
|
286
|
+
openOnDoubleClick?: boolean;
|
|
287
|
+
/**
|
|
288
|
+
* The accessible name of the header checkbox that selects every loaded row, as a translation key
|
|
289
|
+
* or plain text. Defaults to `Select all rows`.
|
|
290
|
+
*/
|
|
291
|
+
selectAllText?: string;
|
|
277
292
|
selectOnClick?: boolean;
|
|
293
|
+
/**
|
|
294
|
+
* The accessible name of each row's selection checkbox, as a translation key or plain text.
|
|
295
|
+
* Defaults to `Select row`.
|
|
296
|
+
*/
|
|
297
|
+
selectRowText?: string;
|
|
278
298
|
showMessageOnEmpty?: boolean;
|
|
279
299
|
/**
|
|
280
300
|
* Shows a footer under the rows with the total number of records, when `getData` returns
|
|
@@ -295,6 +315,37 @@ export type DataGridConfigs = GridConfigs & {
|
|
|
295
315
|
booleanTrueText?: string;
|
|
296
316
|
/** The same for a false value, when the column sets no `falseText`. Defaults to `No`. */
|
|
297
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;
|
|
298
349
|
};
|
|
299
350
|
export interface IListParameters extends ISummaryParameters {
|
|
300
351
|
endRow: number;
|
|
@@ -309,9 +360,29 @@ export interface ISummaryParameters {
|
|
|
309
360
|
};
|
|
310
361
|
}
|
|
311
362
|
/** How a grid column formats its values. See {@link IGridColumn.type}. */
|
|
312
|
-
export type GridColumnType = 'text' | 'number' | 'currency' | 'percent' | 'date' | 'datetime' | 'boolean' | 'enum' | 'badge';
|
|
363
|
+
export type GridColumnType = 'text' | 'number' | 'currency' | 'percent' | 'date' | 'datetime' | 'boolean' | 'enum' | 'badge' | 'actions';
|
|
313
364
|
/** Where a grid column places its cells and header. */
|
|
314
365
|
export type GridColumnAlign = 'start' | 'center' | 'end';
|
|
366
|
+
/**
|
|
367
|
+
* One button of an `actions` column. See {@link IGridColumn.actions}.
|
|
368
|
+
*
|
|
369
|
+
* The grid renders it as a compact icon-only button in each row. A click runs `handler` with the
|
|
370
|
+
* row's data. It does not focus, select or open the row.
|
|
371
|
+
*/
|
|
372
|
+
export interface IGridRowAction<TRowData = any> {
|
|
373
|
+
/** Font Awesome classes of the icon, such as `fa-solid fa-pen`. */
|
|
374
|
+
icon: string;
|
|
375
|
+
/** The button's accessible name and its tooltip, as a translation key or plain text. */
|
|
376
|
+
label: string;
|
|
377
|
+
/** Runs when the button is clicked, with the data of the button's row. */
|
|
378
|
+
handler: (rowData: TRowData) => void;
|
|
379
|
+
/** `danger` colours the icon for a destructive action, such as delete. Defaults to `default`. */
|
|
380
|
+
intent?: 'default' | 'danger';
|
|
381
|
+
/** Whether the button shows in a row. Defaults to always. */
|
|
382
|
+
visible?: (rowData: TRowData) => boolean;
|
|
383
|
+
/** Whether the button is disabled in a row. Defaults to never. A disabled grid disables it too. */
|
|
384
|
+
disabled?: (rowData: TRowData) => boolean;
|
|
385
|
+
}
|
|
315
386
|
/** One column of `lib-data-grid`, declared in the dataset's `columns`. */
|
|
316
387
|
export interface IGridColumn {
|
|
317
388
|
/** CSS classes added to every cell of the column. */
|
|
@@ -338,6 +409,7 @@ export interface IGridColumn {
|
|
|
338
409
|
* - `boolean`: a check icon for true, nothing for false. See `trueText` and `falseText`.
|
|
339
410
|
* - `enum`: the translated `enumValues` entry for the value.
|
|
340
411
|
* - `badge`: the same text as `enum`, in a `lib-badge` coloured by `badgeIntents`.
|
|
412
|
+
* - `actions`: a button per entry of `actions` instead of a value. `field` may be `''`.
|
|
341
413
|
*
|
|
342
414
|
* Empty values show an empty cell. A value the type cannot read shows as it is.
|
|
343
415
|
*/
|
|
@@ -365,10 +437,35 @@ export interface IGridColumn {
|
|
|
365
437
|
/** For `boolean`: text read out to screen readers for a false value. See `trueText`. */
|
|
366
438
|
falseText?: string;
|
|
367
439
|
/**
|
|
368
|
-
*
|
|
369
|
-
* `
|
|
440
|
+
* For `actions`: the buttons each row shows, in order. The column's `size` defaults to
|
|
441
|
+
* `min-content` rather than `minmax(0,1fr)`.
|
|
442
|
+
*/
|
|
443
|
+
actions?: IGridRowAction[];
|
|
444
|
+
/**
|
|
445
|
+
* Where the cells and the header sit. Defaults to `end` for `number`, `currency`, `percent` and
|
|
446
|
+
* `actions`, `center` for `boolean`, and `start` otherwise.
|
|
370
447
|
*/
|
|
371
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>;
|
|
372
469
|
}
|
|
373
470
|
export interface IListResult<T> {
|
|
374
471
|
items: T[];
|
|
@@ -923,7 +1020,15 @@ export declare abstract class GridDataset extends BaseDataset {
|
|
|
923
1020
|
static ɵfac: i0.ɵɵFactoryDeclaration<GridDataset, never>;
|
|
924
1021
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
925
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;
|
|
926
1025
|
export declare abstract class DataGridDataset extends GridDataset {
|
|
1026
|
+
/**
|
|
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
|
|
1029
|
+
* `openOnDoubleClick` to `false`.
|
|
1030
|
+
*/
|
|
1031
|
+
rowActivated: EventEmitter<any>;
|
|
927
1032
|
selectedRowsChanged: EventEmitter<{
|
|
928
1033
|
[id: string]: {
|
|
929
1034
|
rowData: any;
|
|
@@ -933,12 +1038,59 @@ export declare abstract class DataGridDataset extends GridDataset {
|
|
|
933
1038
|
configs: DataGridConfigs;
|
|
934
1039
|
columns: IGridColumn[];
|
|
935
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;
|
|
936
1048
|
get selectedRowKeys(): string[];
|
|
937
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
|
+
*/
|
|
938
1054
|
get columnsSize(): string;
|
|
1055
|
+
/** The columns the grid shows: `columns` without the hidden ones. */
|
|
1056
|
+
get visibleColumns(): IGridColumn[];
|
|
939
1057
|
get hasSelectedRows(): boolean;
|
|
940
1058
|
constructor();
|
|
941
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;
|
|
942
1094
|
export(_format: string, _parameters: IListParameters): Observable<HttpResponse<Blob>>;
|
|
943
1095
|
deselectRow(key: string): void;
|
|
944
1096
|
deselectRowID(id: any): void;
|
|
@@ -949,7 +1101,17 @@ export declare abstract class DataGridDataset extends GridDataset {
|
|
|
949
1101
|
selectRow(key: string): void;
|
|
950
1102
|
selectRowID(id: any): void;
|
|
951
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;
|
|
952
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;
|
|
953
1115
|
protected removeSelectedRow(key: string): void;
|
|
954
1116
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataGridDataset, never>;
|
|
955
1117
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
@@ -1126,6 +1288,8 @@ declare namespace data_grid_component_d_exports {
|
|
|
1126
1288
|
export declare class DataGridComponent extends BaseComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
1127
1289
|
private readonly bodyElement;
|
|
1128
1290
|
private readonly viewport;
|
|
1291
|
+
private readonly columnChooserButton;
|
|
1292
|
+
private readonly columnChooserTemplate;
|
|
1129
1293
|
/** Disables the rows, so they cannot be focused or selected. Defaults to `false`. */
|
|
1130
1294
|
readonly disabled: InputSignal<boolean>;
|
|
1131
1295
|
/**
|
|
@@ -1143,8 +1307,25 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1143
1307
|
protected readonly headerRightMargin: WritableSignal<number>;
|
|
1144
1308
|
protected readonly headerScrollLeft: WritableSignal<number>;
|
|
1145
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;
|
|
1146
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;
|
|
1147
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;
|
|
1148
1329
|
private gridRoute;
|
|
1149
1330
|
private isGridCurrentUrl;
|
|
1150
1331
|
private lastPosition;
|
|
@@ -1153,7 +1334,22 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1153
1334
|
private router;
|
|
1154
1335
|
private selectionColRealSize?;
|
|
1155
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. */
|
|
1156
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;
|
|
1157
1353
|
protected get configs(): DataGridConfigs;
|
|
1158
1354
|
protected get gridColumns(): string;
|
|
1159
1355
|
protected get hasBeenLoaded(): boolean;
|
|
@@ -1164,6 +1360,11 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1164
1360
|
protected get messageToDisplayWhenEmpty(): string;
|
|
1165
1361
|
protected get messageToDisplayWhenLazyLoad(): string;
|
|
1166
1362
|
protected get messageToDisplayWhenFailed(): string;
|
|
1363
|
+
/** Whether every loaded row is selected. False while no row is loaded. */
|
|
1364
|
+
protected get allRowsSelected(): boolean;
|
|
1365
|
+
/** Whether some, but not all, loaded rows are selected: the select-all checkbox is indeterminate. */
|
|
1366
|
+
protected get someRowsSelected(): boolean;
|
|
1367
|
+
protected get selectAllText(): string;
|
|
1167
1368
|
protected get selectionColWidth(): string;
|
|
1168
1369
|
/**
|
|
1169
1370
|
* Whether the total-rows footer shows: the configs ask for it and the last load returned
|
|
@@ -1175,6 +1376,21 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1175
1376
|
/** The footer text, singular for a total of exactly 1. */
|
|
1176
1377
|
protected get totalRowsText(): string;
|
|
1177
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();
|
|
1178
1394
|
/**
|
|
1179
1395
|
* Whether the grid is in the document, which it is not while the route-reuse strategy holds its
|
|
1180
1396
|
* view detached -- the list a tab keeps in its history while the user is on a record.
|
|
@@ -1192,6 +1408,35 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1192
1408
|
ngOnInit(): void;
|
|
1193
1409
|
ngAfterViewInit(): void;
|
|
1194
1410
|
ngOnDestroy(): void;
|
|
1411
|
+
/**
|
|
1412
|
+
* Selects every loaded row, or clears the selection when all of them are already selected.
|
|
1413
|
+
* Goes through the dataset, so `selectedRowsChanged` announces the change as for any other.
|
|
1414
|
+
*/
|
|
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;
|
|
1195
1440
|
protected onSelectionResized(newSize: number): void;
|
|
1196
1441
|
protected alignOf(column: IGridColumn): GridColumnAlign;
|
|
1197
1442
|
/**
|
|
@@ -1199,7 +1444,55 @@ export declare class DataGridComponent extends BaseComponent implements OnInit,
|
|
|
1199
1444
|
* key, but returns plain text such as the library default untouched, placeholder and all.
|
|
1200
1445
|
*/
|
|
1201
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;
|
|
1202
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;
|
|
1203
1496
|
private syncHeaderScroll;
|
|
1204
1497
|
protected trackByFn(index: number, item: any): number;
|
|
1205
1498
|
static ɵfac: i0.ɵɵFactoryDeclaration<DataGridComponent, never>;
|
|
@@ -1276,13 +1569,27 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
|
|
|
1276
1569
|
* the DOM swapped on every row whenever that window moved by an odd number of rows.
|
|
1277
1570
|
*/
|
|
1278
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>;
|
|
1279
1578
|
/** Emits the width in pixels of the selection checkbox cell whenever it changes. */
|
|
1280
1579
|
selectionResized: EventEmitter<number>;
|
|
1281
1580
|
/**
|
|
1282
1581
|
* Makes this row the dataset's focused row. In a multi-select grid that selects on click, it
|
|
1283
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.
|
|
1586
|
+
*/
|
|
1587
|
+
setFocus(event?: MouseEvent): void;
|
|
1588
|
+
/**
|
|
1589
|
+
* Announces the row as activated through the dataset's `rowActivated`. Runs on a double click on
|
|
1590
|
+
* the row; does nothing while disabled. The host is `select-none`, so no text gets selected.
|
|
1284
1591
|
*/
|
|
1285
|
-
|
|
1592
|
+
activate(): void;
|
|
1286
1593
|
protected dataGridDataset: DataGridDataset;
|
|
1287
1594
|
protected readonly selected: WritableSignal<boolean>;
|
|
1288
1595
|
private _rowData;
|
|
@@ -1290,21 +1597,33 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
|
|
|
1290
1597
|
private readonly localeService;
|
|
1291
1598
|
/** The record this row shows. */
|
|
1292
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. */
|
|
1293
1603
|
protected get columns(): IGridColumn[];
|
|
1294
1604
|
private get isLaidOut();
|
|
1295
1605
|
private get isRowDataSelected();
|
|
1296
1606
|
protected get rowKey(): string;
|
|
1607
|
+
protected get selectRowText(): string;
|
|
1297
1608
|
constructor();
|
|
1298
1609
|
ngOnInit(): void;
|
|
1299
|
-
|
|
1610
|
+
/**
|
|
1611
|
+
* Runs the action's handler with this row's data. The click stops here, so the row is neither
|
|
1612
|
+
* focused nor selected.
|
|
1613
|
+
*/
|
|
1614
|
+
protected onActionClicked(event: Event, action: IGridRowAction): void;
|
|
1615
|
+
protected onResize(column: IGridColumn, event: ResizeObserverEntry): void;
|
|
1300
1616
|
protected onResizeSelection(event: ResizeObserverEntry): void;
|
|
1301
|
-
protected onToggleSelection(): void;
|
|
1617
|
+
protected onToggleSelection(event: MouseEvent): void;
|
|
1302
1618
|
protected alignOf(column: IGridColumn): GridColumnAlign;
|
|
1303
1619
|
/**
|
|
1304
1620
|
* The cell of a column without a template, formatted by the column's type. Reads the locale
|
|
1305
1621
|
* signal, so the row renders again when the application language changes.
|
|
1306
1622
|
*/
|
|
1307
1623
|
protected formatCell(column: IGridColumn): GridCellDisplay;
|
|
1624
|
+
protected isActionDisabled(action: IGridRowAction): boolean;
|
|
1625
|
+
/** The actions of an `actions` column that show in this row. */
|
|
1626
|
+
protected visibleActions(column: IGridColumn): IGridRowAction[];
|
|
1308
1627
|
protected isNumeric(column: IGridColumn): boolean;
|
|
1309
1628
|
protected getValue(field: string): any;
|
|
1310
1629
|
private refreshSelection;
|
|
@@ -1327,6 +1646,11 @@ export declare class DataGridRowComponent extends BaseComponent implements OnIni
|
|
|
1327
1646
|
"required": false;
|
|
1328
1647
|
"isSignal": true;
|
|
1329
1648
|
};
|
|
1649
|
+
"tabbable": {
|
|
1650
|
+
"alias": "tabbable";
|
|
1651
|
+
"required": false;
|
|
1652
|
+
"isSignal": true;
|
|
1653
|
+
};
|
|
1330
1654
|
}, {
|
|
1331
1655
|
"selectionResized": "selectionResized";
|
|
1332
1656
|
}, never, never, true, never>;
|