@ids-group-ltd/ids-design-system 0.12.0 → 0.12.2
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 +568 -52
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +4 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +10 -13
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +10 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +13 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +12 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +6 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +10 -13
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +15 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +21 -8
- package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +10 -13
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +15 -8
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +15 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +428 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +186 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs +227 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +304 -437
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +12 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +9 -7
- package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +27 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +12 -4
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +2 -38
- package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +3 -0
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.10.0.json +1 -1
- package/migrations/0.10.1.json +1 -1
- package/migrations/0.10.2.json +1 -30
- package/migrations/0.11.1.json +0 -23
- package/migrations/0.11.3.json +1 -1
- package/migrations/0.11.4.json +27 -7
- package/migrations/0.12.0.json +30 -2
- package/migrations/0.12.1.json +341 -0
- package/migrations/0.12.2.json +291 -0
- package/migrations/0.5.0.json +0 -54
- package/migrations/0.5.1.json +3 -1
- package/migrations/0.7.0.json +0 -11
- package/migrations/0.9.0.json +22 -3
- package/migrations/0.9.1.json +1 -1
- package/package.json +25 -1
- package/styles/_check-box.scss +91 -0
- package/styles/_check-mark.scss +59 -0
- package/styles/_clear-button.scss +28 -0
- package/styles/_dropdown-overlay.scss +12 -2
- package/styles/_field-group-segment.scss +4 -1
- package/styles/_focus.scss +103 -50
- package/styles/_link.scss +4 -2
- package/styles/_table-controls.scss +66 -0
- package/styles/_tokens.scss +20 -0
- package/styles/_typography.scss +6 -0
- package/themes/_semantic.scss +7 -8
- package/types/ids-group-ltd-ids-design-system-components-auth-layout.d.ts +2 -2
- package/types/ids-group-ltd-ids-design-system-components-menu.d.ts +3 -0
- package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +8 -4
- package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +9 -2
- package/types/ids-group-ltd-ids-design-system-components-split-button.d.ts +3 -2
- package/types/ids-group-ltd-ids-design-system-components-table-columns.d.ts +43 -0
- package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +48 -0
- package/types/ids-group-ltd-ids-design-system-components-table-resize.d.ts +79 -0
- package/types/ids-group-ltd-ids-design-system-components-table.d.ts +196 -155
- package/types/ids-group-ltd-ids-design-system-components.d.ts +26 -1
- package/types/ids-group-ltd-ids-design-system-core.d.ts +17 -4
- package/types/ids-group-ltd-ids-design-system.d.ts +3 -0
|
@@ -12,6 +12,7 @@ interface SplitButtonItem {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
declare class SplitButtonComponent {
|
|
15
|
+
constructor();
|
|
15
16
|
/** Label text on the main button. */
|
|
16
17
|
readonly label: _angular_core.InputSignal<string>;
|
|
17
18
|
/** Visual style — primary (solid) or outline. */
|
|
@@ -20,13 +21,13 @@ declare class SplitButtonComponent {
|
|
|
20
21
|
readonly icon: _angular_core.InputSignal<IconName | null>;
|
|
21
22
|
/** Disables both the main button and the dropdown trigger. */
|
|
22
23
|
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
23
|
-
/** Items listed in the dropdown menu. */
|
|
24
|
+
/** Items listed in the dropdown menu. Empty disables the chevron. */
|
|
24
25
|
readonly menuItems: _angular_core.InputSignal<readonly SplitButtonItem[]>;
|
|
25
26
|
/** Accessible name for the dropdown trigger. */
|
|
26
27
|
readonly menuLabel: _angular_core.InputSignal<string>;
|
|
27
28
|
/** Fires when the main button (not the dropdown trigger) is clicked. */
|
|
28
29
|
readonly pressed: _angular_core.OutputEmitterRef<MouseEvent>;
|
|
29
|
-
/**
|
|
30
|
+
/** The menu half only — a press on the main button is `pressed`, never this. */
|
|
30
31
|
readonly itemSelected: _angular_core.OutputEmitterRef<SplitButtonItem>;
|
|
31
32
|
protected onItemSelect(item: SplitButtonItem): void;
|
|
32
33
|
protected onTriggerKeydown(event: KeyboardEvent, popover: PopoverComponent, trigger: HTMLElement): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Showing, hiding and reordering columns for `<ds-table>`, as a directive so a table that does
|
|
5
|
+
* none of it never carries the panel — nor `@angular/cdk/drag-drop`, which comes with the drag
|
|
6
|
+
* handle:
|
|
7
|
+
*
|
|
8
|
+
* ```html
|
|
9
|
+
* <ds-table dsTableColumns [reorderableColumns]="true" [columns]="cols" [data]="rows" />
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Hiding needs no input: a column marked `hideable` becomes hideable the moment this directive is
|
|
13
|
+
* present. `[(hiddenKeys)]` and `[(columnOrder)]` are two-way, so the layout can be driven from
|
|
14
|
+
* the host, and both round-trip through `persistLayout` on the table.
|
|
15
|
+
*/
|
|
16
|
+
declare class DsTableColumns<T extends object> {
|
|
17
|
+
private readonly layout;
|
|
18
|
+
/** Adds the drag handle and the move buttons. Hiding works without it. */
|
|
19
|
+
readonly reorderableColumns: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
20
|
+
/** Keys the reader has hidden. Unset falls back to the columns' own `hidden` flags. */
|
|
21
|
+
readonly hiddenKeys: _angular_core.ModelSignal<Set<string> | null>;
|
|
22
|
+
/** Column keys in the reader's order. Unset keeps the declaration order. */
|
|
23
|
+
readonly columnOrder: _angular_core.ModelSignal<string[] | null>;
|
|
24
|
+
private readonly coarsePointerState;
|
|
25
|
+
private readonly coarsePointer;
|
|
26
|
+
private readonly effectiveHiddenKeys;
|
|
27
|
+
private readonly declaredColumns;
|
|
28
|
+
private hiddenByDeclaration;
|
|
29
|
+
/** Declaration order with the reader's order applied first, then anything they never moved. */
|
|
30
|
+
private readonly ordered;
|
|
31
|
+
private readonly visible;
|
|
32
|
+
constructor();
|
|
33
|
+
private isVisible;
|
|
34
|
+
/** The last visible column cannot be hidden — an all-hidden grid is useless. */
|
|
35
|
+
private isLocked;
|
|
36
|
+
private toggleColumn;
|
|
37
|
+
private moveColumn;
|
|
38
|
+
private onDrop;
|
|
39
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DsTableColumns<any>, never>;
|
|
40
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DsTableColumns<any>, "[dsTableColumns]", never, { "reorderableColumns": { "alias": "reorderableColumns"; "required": false; "isSignal": true; }; "hiddenKeys": { "alias": "hiddenKeys"; "required": false; "isSignal": true; }; "columnOrder": { "alias": "columnOrder"; "required": false; "isSignal": true; }; }, { "hiddenKeys": "hiddenKeysChange"; "columnOrder": "columnOrderChange"; }, never, never, true, never>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { DsTableColumns };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* CSV export for `<ds-table>`, as a directive so a table that does not export never carries the
|
|
5
|
+
* code. Put it on the table and the toolbar grows the button:
|
|
6
|
+
*
|
|
7
|
+
* ```html
|
|
8
|
+
* <ds-table dsTableExport [columns]="cols" [data]="rows" />
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* On a server-paged table the table holds one page, so give it the whole set:
|
|
12
|
+
*
|
|
13
|
+
* ```html
|
|
14
|
+
* <ds-table dsTableExport [exportFetcher]="fetchAll" (exportFailed)="report($event)" />
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* `table.runExport()` and `table.exporting()` keep working — they delegate to whichever export
|
|
18
|
+
* directive is present, so a button of your own in `[toolbar]` or a page header still drives it.
|
|
19
|
+
* Pass `[dsTableExport]="false"` to keep the code and drop the built-in button.
|
|
20
|
+
*/
|
|
21
|
+
declare class DsTableExport<T extends object> {
|
|
22
|
+
private readonly layout;
|
|
23
|
+
/** Renders the built-in toolbar button. `false` keeps the feature and hides the control, for a
|
|
24
|
+
* table whose export is driven from somewhere else on the page. */
|
|
25
|
+
readonly dsTableExport: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
26
|
+
readonly exportFilename: _angular_core.InputSignal<string>;
|
|
27
|
+
/** Fetches the rows to export. Without it the export serialises what the table holds, which on
|
|
28
|
+
* a server-paged table is one page. */
|
|
29
|
+
readonly exportFetcher: _angular_core.InputSignal<(() => Promise<readonly T[] | Blob | string>) | null>;
|
|
30
|
+
/** Without it a rejected `exportFetcher` is silent. */
|
|
31
|
+
readonly exportFailed: _angular_core.OutputEmitterRef<unknown>;
|
|
32
|
+
private readonly busy;
|
|
33
|
+
readonly exporting: _angular_core.Signal<boolean>;
|
|
34
|
+
private readonly announcement;
|
|
35
|
+
constructor();
|
|
36
|
+
/** Without `exportFetcher` this serialises only what the table holds, which on a server-paged
|
|
37
|
+
* table is one page. */
|
|
38
|
+
runExport(): Promise<void>;
|
|
39
|
+
/** Serialises the table's visible columns as a CSV download. Pass `rows` to serialise a set you
|
|
40
|
+
* fetched yourself. */
|
|
41
|
+
exportCsv(filename?: string, rows?: readonly T[]): void;
|
|
42
|
+
/** Only a Blob gets its object URL revoked — a URL the caller supplied is theirs to manage. */
|
|
43
|
+
private downloadFile;
|
|
44
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DsTableExport<any>, never>;
|
|
45
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<DsTableExport<any>, "[dsTableExport]", never, { "dsTableExport": { "alias": "dsTableExport"; "required": false; "isSignal": true; }; "exportFilename": { "alias": "exportFilename"; "required": false; "isSignal": true; }; "exportFetcher": { "alias": "exportFetcher"; "required": false; "isSignal": true; }; }, { "exportFailed": "exportFailed"; }, never, never, true, never>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { DsTableExport };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Column resizing for `<ds-table>`, as a directive so a table with fixed columns never carries
|
|
5
|
+
* the drag, the keyboard range widget or the width buttons in the column panel:
|
|
6
|
+
*
|
|
7
|
+
* ```html
|
|
8
|
+
* <ds-table dsTableResize [columns]="cols" [data]="rows" />
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* The bare attribute is the whole switch: there is no input to bind, so resizing cannot be toggled
|
|
12
|
+
* by an expression. Seed a width through the column's own `width`, read the live ones through
|
|
13
|
+
* `viewChild(DsTableResize)`, and let `persistLayout` on the table carry them across a reload.
|
|
14
|
+
*
|
|
15
|
+
* The handle's MARKUP stays in the table's header, gated on this directive being present, and so
|
|
16
|
+
* does the width template the column panel renders. Two reasons: a per-column
|
|
17
|
+
* `ViewContainerRef` would cost every header cell of every table a container to save seventeen
|
|
18
|
+
* lines of template, and a directive has no view of its own to declare an `ng-template` in. The
|
|
19
|
+
* bytes here are in the logic, and the logic is all here.
|
|
20
|
+
*/
|
|
21
|
+
declare class DsTableResize<T extends object> {
|
|
22
|
+
private readonly layout;
|
|
23
|
+
/** Per-column pixel widths, keyed by column key. Seeded from `column.width` where unset. */
|
|
24
|
+
readonly columnWidths: i0.WritableSignal<Map<string, number>>;
|
|
25
|
+
private resizeState;
|
|
26
|
+
private readonly resizeFocus;
|
|
27
|
+
constructor();
|
|
28
|
+
/** `'content'` is not a pixel value — it is carried by a class instead, see `fitsContent`. */
|
|
29
|
+
private columnWidth;
|
|
30
|
+
private viewport;
|
|
31
|
+
/**
|
|
32
|
+
* The widest a single column may be dragged: the scroll viewport.
|
|
33
|
+
*
|
|
34
|
+
* A column wider than the viewport can never be seen whole, and long text has its own
|
|
35
|
+
* affordance here — `truncate` clips it and the clip popover shows the rest — so nothing is lost
|
|
36
|
+
* by stopping at the edge. The ceiling exists at all because `aria-valuemax` has to be TRUE: a
|
|
37
|
+
* focusable `role="separator"` is a range widget, and announcing a bound that neither resize
|
|
38
|
+
* path applies is worse than announcing none.
|
|
39
|
+
*/
|
|
40
|
+
private columnWidthCeiling;
|
|
41
|
+
private clampColumnWidth;
|
|
42
|
+
private onResizeStart;
|
|
43
|
+
/**
|
|
44
|
+
* Freeze the columns at what they currently measure, once, before the first drag moves
|
|
45
|
+
* anything.
|
|
46
|
+
*
|
|
47
|
+
* Without it only the dragged column has a width and the rest are still auto-sized, so the
|
|
48
|
+
* browser redistributes the remainder across them and columns the reader never touched visibly
|
|
49
|
+
* jump. Measuring first means the drag changes one column and leaves the others where they
|
|
50
|
+
* were. Reads the header row that is actually on screen rather than assuming a column order.
|
|
51
|
+
*/
|
|
52
|
+
private lockMeasuredWidths;
|
|
53
|
+
private onResizeMove;
|
|
54
|
+
private onResizeEnd;
|
|
55
|
+
private onResizeFocus;
|
|
56
|
+
/**
|
|
57
|
+
* The separator's range, and only while it holds focus — that is when a range widget is
|
|
58
|
+
* announced, and an auto-sized column has no width to report until something measures one.
|
|
59
|
+
* Measuring on every change detection to fill an attribute nothing is reading would force
|
|
60
|
+
* layout once per resizable column.
|
|
61
|
+
*
|
|
62
|
+
* `now` prefers the known width, which the first arrow key makes known and keeps live; the
|
|
63
|
+
* focus measurement only covers the moment before that.
|
|
64
|
+
*/
|
|
65
|
+
private resizeRange;
|
|
66
|
+
private resolvedColumnWidth;
|
|
67
|
+
private onResizeKey;
|
|
68
|
+
/**
|
|
69
|
+
* The header cell is passed when the caller has it — the column panel does not, so it is looked
|
|
70
|
+
* up by `data-col-key`, and the measurement matters: stepping an auto-sized column has to start
|
|
71
|
+
* from what it currently RENDERS, not from the minimum.
|
|
72
|
+
*/
|
|
73
|
+
private stepColumnWidth;
|
|
74
|
+
private headerCellFor;
|
|
75
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DsTableResize<any>, never>;
|
|
76
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DsTableResize<any>, "[dsTableResize]", never, {}, {}, never, never, true, never>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { DsTableResize };
|