@coolon/angular-ui-powerups 16.1.0-alpha.276 → 16.1.0-alpha.278
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/esm2022/lib/components/components.module.mjs +12 -4
- package/esm2022/lib/components/exports.mjs +3 -1
- package/esm2022/lib/components/forms/sub-form-list/sub-form-list-column.mjs +87 -0
- package/esm2022/lib/components/forms/sub-form-list/sub-form-list-columns.mjs +87 -0
- package/esm2022/lib/components/forms/sub-form-list/sub-form-list.component.mjs +169 -5
- package/esm2022/lib/components/forms/sub-form-list/sub-form-row.directive.mjs +83 -1
- package/fesm2022/coolon-angular-ui-powerups.mjs +429 -5
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/components.module.d.ts +1 -1
- package/lib/components/exports.d.ts +2 -0
- package/lib/components/forms/sub-form-list/sub-form-list-column.d.ts +63 -0
- package/lib/components/forms/sub-form-list/sub-form-list-columns.d.ts +70 -0
- package/lib/components/forms/sub-form-list/sub-form-list.component.d.ts +107 -4
- package/lib/components/forms/sub-form-list/sub-form-row.directive.d.ts +70 -0
- package/package.json +1 -1
|
@@ -81,6 +81,6 @@ import * as i79 from "ng-table-virtual-scroll";
|
|
|
81
81
|
import * as i80 from "@angular/cdk/drag-drop";
|
|
82
82
|
export declare class ComponentsModule {
|
|
83
83
|
static ɵfac: i0.ɵɵFactoryDeclaration<ComponentsModule, never>;
|
|
84
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<ComponentsModule, [typeof i1.AbstractInputComponent, typeof i2.AbstractValueInputComponent, typeof i3.AbstractListInputComponent, typeof i4.NumberInputComponent, typeof i5.StringInputComponent, typeof i6.TextInputComponent, typeof i7.PasswordInputComponent, typeof i8.SelectInputComponent, typeof i9.MultipleSelectInputComponent, typeof i10.AutocompleteInputComponent, typeof i11.CheckboxInputComponent, typeof i12.ScrollContainerComponent, typeof i13.NoopComponent, typeof i14.SwitchCaseComponent, typeof i14.SwitchCaseWhenDirective, typeof i14.SwitchCaseDefaultDirective, typeof i15.FocusContainerComponent, typeof i16.VerticalFocusContainerComponent, typeof i17.FocusableComponent, typeof i18.CardContainerComponent, typeof i19.TableComponent, typeof i20.TableRowAttributesDirective, typeof i21.ColumnTemplateDirective, typeof i22.DefaultCellRendererComponent, typeof i23.TableCellComponent, typeof i24.SelectionCellComponent, typeof i25.SelectionHeaderCellComponent, typeof i26.DefaultHeaderCellRendererComponent, typeof i27.TableHeaderCellComponent, typeof i28.IconComponent, typeof i29.SectionHeaderComponent, typeof i30.TableActionColumnComponent, typeof i31.ToolBarComponent, typeof i32.CommandComponent, typeof i33.PopupMenuComponent, typeof i34.CommandFaceComponent, typeof i35.MoreMenuComponent, typeof i36.SeparatorComponent, typeof i37.FlexComponent, typeof i38.AbstractPopupMenuComponent, typeof i39.PopupMenuRendererComponent, typeof i40.TreeTableComponent, typeof i41.TreeInheritanceIconComponent, typeof i42.TreeLabelCellRendererComponent, typeof i43.BusyOverlayComponent, typeof i44.EmptyStateComponent, typeof i45.PaginatorComponent, typeof i46.AbstractTableComponent, typeof i47.AbstractCardContainerComponent, typeof i48.LabelledValueComponent, typeof i49.LoadingContainerComponent, typeof i50.MarkdownComponent, typeof i20.TableBodyComponent, typeof i51.TableCustomMoreMenuComponent, typeof i52.TableCustomMoreMenuPopupComponent, typeof i53.SearchInputComponent, typeof i54.TableFooterRow, typeof i55.FileDownloadComponent, typeof i56.ButtonRendererComponent, typeof i57.SubFormListComponent, typeof i58.SubFormRowDirective, typeof i58.SubFormRowActionsDirective, typeof i58.SubFormListEmptyDirective], [typeof i59.CommonModule, typeof i60.BrowserAnimationsModule, typeof i61.FormsModule, typeof i62.MatInputModule, typeof i63.MatFormFieldModule, typeof i64.MatSelectModule, typeof i65.MatTabsModule, typeof i66.DirectivesModule, typeof i67.MatIconModule, typeof i68.MatButtonModule, typeof i69.MatCheckboxModule, typeof i70.MatTableModule, typeof i71.PortalModule, typeof i72.CdkScrollableModule, typeof i73.MatTooltipModule, typeof i74.MatAutocompleteModule, typeof i75.MatMenuModule, typeof i76.MatDividerModule, typeof i77.MatProgressSpinnerModule, typeof i78.MatProgressBarModule, typeof i72.ScrollingModule, typeof i79.TableVirtualScrollModule, typeof i80.DragDropModule], [typeof i56.ButtonRendererComponent, typeof i55.FileDownloadComponent, typeof i54.TableFooterRow, typeof i4.NumberInputComponent, typeof i5.StringInputComponent, typeof i6.TextInputComponent, typeof i7.PasswordInputComponent, typeof i11.CheckboxInputComponent, typeof i8.SelectInputComponent, typeof i9.MultipleSelectInputComponent, typeof i10.AutocompleteInputComponent, typeof i12.ScrollContainerComponent, typeof i13.NoopComponent, typeof i14.SwitchCaseComponent, typeof i14.SwitchCaseWhenDirective, typeof i14.SwitchCaseDefaultDirective, typeof i15.FocusContainerComponent, typeof i16.VerticalFocusContainerComponent, typeof i17.FocusableComponent, typeof i18.CardContainerComponent, typeof i19.TableComponent, typeof i21.ColumnTemplateDirective, typeof i28.IconComponent, typeof i29.SectionHeaderComponent, typeof i30.TableActionColumnComponent, typeof i31.ToolBarComponent, typeof i32.CommandComponent, typeof i33.PopupMenuComponent, typeof i34.CommandFaceComponent, typeof i35.MoreMenuComponent, typeof i36.SeparatorComponent, typeof i37.FlexComponent, typeof i40.TreeTableComponent, typeof i43.BusyOverlayComponent, typeof i44.EmptyStateComponent, typeof i45.PaginatorComponent, typeof i48.LabelledValueComponent, typeof i49.LoadingContainerComponent, typeof i50.MarkdownComponent, typeof i51.TableCustomMoreMenuComponent, typeof i52.TableCustomMoreMenuPopupComponent, typeof i53.SearchInputComponent, typeof i56.ButtonRendererComponent, typeof i57.SubFormListComponent, typeof i58.SubFormRowDirective, typeof i58.SubFormRowActionsDirective, typeof i58.SubFormListEmptyDirective]>;
|
|
84
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<ComponentsModule, [typeof i1.AbstractInputComponent, typeof i2.AbstractValueInputComponent, typeof i3.AbstractListInputComponent, typeof i4.NumberInputComponent, typeof i5.StringInputComponent, typeof i6.TextInputComponent, typeof i7.PasswordInputComponent, typeof i8.SelectInputComponent, typeof i9.MultipleSelectInputComponent, typeof i10.AutocompleteInputComponent, typeof i11.CheckboxInputComponent, typeof i12.ScrollContainerComponent, typeof i13.NoopComponent, typeof i14.SwitchCaseComponent, typeof i14.SwitchCaseWhenDirective, typeof i14.SwitchCaseDefaultDirective, typeof i15.FocusContainerComponent, typeof i16.VerticalFocusContainerComponent, typeof i17.FocusableComponent, typeof i18.CardContainerComponent, typeof i19.TableComponent, typeof i20.TableRowAttributesDirective, typeof i21.ColumnTemplateDirective, typeof i22.DefaultCellRendererComponent, typeof i23.TableCellComponent, typeof i24.SelectionCellComponent, typeof i25.SelectionHeaderCellComponent, typeof i26.DefaultHeaderCellRendererComponent, typeof i27.TableHeaderCellComponent, typeof i28.IconComponent, typeof i29.SectionHeaderComponent, typeof i30.TableActionColumnComponent, typeof i31.ToolBarComponent, typeof i32.CommandComponent, typeof i33.PopupMenuComponent, typeof i34.CommandFaceComponent, typeof i35.MoreMenuComponent, typeof i36.SeparatorComponent, typeof i37.FlexComponent, typeof i38.AbstractPopupMenuComponent, typeof i39.PopupMenuRendererComponent, typeof i40.TreeTableComponent, typeof i41.TreeInheritanceIconComponent, typeof i42.TreeLabelCellRendererComponent, typeof i43.BusyOverlayComponent, typeof i44.EmptyStateComponent, typeof i45.PaginatorComponent, typeof i46.AbstractTableComponent, typeof i47.AbstractCardContainerComponent, typeof i48.LabelledValueComponent, typeof i49.LoadingContainerComponent, typeof i50.MarkdownComponent, typeof i20.TableBodyComponent, typeof i51.TableCustomMoreMenuComponent, typeof i52.TableCustomMoreMenuPopupComponent, typeof i53.SearchInputComponent, typeof i54.TableFooterRow, typeof i55.FileDownloadComponent, typeof i56.ButtonRendererComponent, typeof i57.SubFormListComponent, typeof i58.SubFormRowDirective, typeof i58.SubFormRowActionsDirective, typeof i58.SubFormListEmptyDirective, typeof i58.SubFormListFooterDirective, typeof i58.SubFormListHeaderDirective], [typeof i59.CommonModule, typeof i60.BrowserAnimationsModule, typeof i61.FormsModule, typeof i62.MatInputModule, typeof i63.MatFormFieldModule, typeof i64.MatSelectModule, typeof i65.MatTabsModule, typeof i66.DirectivesModule, typeof i67.MatIconModule, typeof i68.MatButtonModule, typeof i69.MatCheckboxModule, typeof i70.MatTableModule, typeof i71.PortalModule, typeof i72.CdkScrollableModule, typeof i73.MatTooltipModule, typeof i74.MatAutocompleteModule, typeof i75.MatMenuModule, typeof i76.MatDividerModule, typeof i77.MatProgressSpinnerModule, typeof i78.MatProgressBarModule, typeof i72.ScrollingModule, typeof i79.TableVirtualScrollModule, typeof i80.DragDropModule], [typeof i56.ButtonRendererComponent, typeof i55.FileDownloadComponent, typeof i54.TableFooterRow, typeof i4.NumberInputComponent, typeof i5.StringInputComponent, typeof i6.TextInputComponent, typeof i7.PasswordInputComponent, typeof i11.CheckboxInputComponent, typeof i8.SelectInputComponent, typeof i9.MultipleSelectInputComponent, typeof i10.AutocompleteInputComponent, typeof i12.ScrollContainerComponent, typeof i13.NoopComponent, typeof i14.SwitchCaseComponent, typeof i14.SwitchCaseWhenDirective, typeof i14.SwitchCaseDefaultDirective, typeof i15.FocusContainerComponent, typeof i16.VerticalFocusContainerComponent, typeof i17.FocusableComponent, typeof i18.CardContainerComponent, typeof i19.TableComponent, typeof i21.ColumnTemplateDirective, typeof i28.IconComponent, typeof i29.SectionHeaderComponent, typeof i30.TableActionColumnComponent, typeof i31.ToolBarComponent, typeof i32.CommandComponent, typeof i33.PopupMenuComponent, typeof i34.CommandFaceComponent, typeof i35.MoreMenuComponent, typeof i36.SeparatorComponent, typeof i37.FlexComponent, typeof i40.TreeTableComponent, typeof i43.BusyOverlayComponent, typeof i44.EmptyStateComponent, typeof i45.PaginatorComponent, typeof i48.LabelledValueComponent, typeof i49.LoadingContainerComponent, typeof i50.MarkdownComponent, typeof i51.TableCustomMoreMenuComponent, typeof i52.TableCustomMoreMenuPopupComponent, typeof i53.SearchInputComponent, typeof i56.ButtonRendererComponent, typeof i57.SubFormListComponent, typeof i58.SubFormRowDirective, typeof i58.SubFormRowActionsDirective, typeof i58.SubFormListEmptyDirective, typeof i58.SubFormListFooterDirective, typeof i58.SubFormListHeaderDirective]>;
|
|
85
85
|
static ɵinj: i0.ɵɵInjectorDeclaration<ComponentsModule>;
|
|
86
86
|
}
|
|
@@ -41,6 +41,8 @@ export * from "./forms/password-input/password-input.component";
|
|
|
41
41
|
export * from "./forms/search-input/search-input.component";
|
|
42
42
|
export * from "./forms/select-input/select-input.component";
|
|
43
43
|
export * from "./forms/string-input/string-input.component";
|
|
44
|
+
export * from "./forms/sub-form-list/sub-form-list-column";
|
|
45
|
+
export * from "./forms/sub-form-list/sub-form-list-columns";
|
|
44
46
|
export * from "./forms/sub-form-list/sub-form-list.component";
|
|
45
47
|
export * from "./forms/sub-form-list/sub-form-row.directive";
|
|
46
48
|
export * from "./forms/text-input/text-input.component";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ColumnTextProperties } from "../../tables/column/column-text-properties";
|
|
2
|
+
/**
|
|
3
|
+
* One column of an `aup-sub-form-list` — the same `columnId` + {@link ColumnTextProperties} idiom a
|
|
4
|
+
* table column carries, minus everything a table column carries *because* it renders its own cell.
|
|
5
|
+
*
|
|
6
|
+
* A sub-form-list cell is whatever element the row template put in this position, so this declares
|
|
7
|
+
* only what the list itself can know: the column's identity, the grid track it occupies, and the
|
|
8
|
+
* text that titles it. There is no cell renderer, no visibility chain and no text-search formatter,
|
|
9
|
+
* because none of them have anything to act on here.
|
|
10
|
+
*
|
|
11
|
+
* Built by {@link SubFormListColumns#addColumn} rather than directly.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SubFormListColumn {
|
|
14
|
+
readonly columnId: string;
|
|
15
|
+
private readonly textPropertiesProvider;
|
|
16
|
+
private _columnTextProperties;
|
|
17
|
+
private _track;
|
|
18
|
+
constructor(columnId: string, textPropertiesProvider: SubFormListColumn.TextPropertiesProvider);
|
|
19
|
+
/**
|
|
20
|
+
* Titles this column on its own, winning over the bulk map passed to
|
|
21
|
+
* {@link SubFormListColumns#columnTextProperties} — the same precedence `ColumnModel` gives it.
|
|
22
|
+
*/
|
|
23
|
+
columnTextProperties(columnTextProperties: ColumnTextProperties): this;
|
|
24
|
+
/** Memoised as `ColumnModel`'s is, so the bulk map is looked up once rather than per pass. */
|
|
25
|
+
getColumnTextProperties(): ColumnTextProperties | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Deliberately *not* memoised, unlike `ColumnModel#getHeaderText`: a table renders its header once
|
|
28
|
+
* into a portal, whereas this is a template expression re-evaluated every pass, so caching the
|
|
29
|
+
* string would pin the locale for the life of the list.
|
|
30
|
+
*
|
|
31
|
+
* Also guards `headerText` itself. It is optional on {@link ColumnTextProperties}, and
|
|
32
|
+
* `ColumnModel#getHeaderText` throws on a properties object that omits it.
|
|
33
|
+
*/
|
|
34
|
+
getHeaderText(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Empty, where `ColumnModel`'s is the column id.
|
|
37
|
+
*
|
|
38
|
+
* A table always draws a header band, so falling back to the id there is a harmless "you forgot
|
|
39
|
+
* the yml" tell. This band is optional, and an id fallback would conjure a header reading
|
|
40
|
+
* `priority color description` out of a `[columns]` binding the consumer supplied only to size
|
|
41
|
+
* the tracks. {@link SubFormListColumns#hasDeclaredHeader} decides whether a band is drawn at
|
|
42
|
+
* all, so an untitled column inside a titled list still renders its (empty) cell.
|
|
43
|
+
*/
|
|
44
|
+
protected getDefaultHeaderText(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Gives this column the leftover width — a `1fr` track. Named for `ColumnModel#flex`, and means
|
|
47
|
+
* the same thing.
|
|
48
|
+
*/
|
|
49
|
+
flex(flex?: boolean): this;
|
|
50
|
+
/**
|
|
51
|
+
* Any `grid-template-columns` track value — `var(--indicator-width)`, `minmax(0, 20ch)`, `120px`.
|
|
52
|
+
*
|
|
53
|
+
* Not part of {@link ColumnTextProperties} deliberately: a track width is not translatable, so it
|
|
54
|
+
* has no business in a locale bundle. It is declared here, beside the title it belongs to, which
|
|
55
|
+
* is the point — a column cannot gain a header without gaining a track.
|
|
56
|
+
*/
|
|
57
|
+
width(track: string): this;
|
|
58
|
+
getTrack(): string;
|
|
59
|
+
}
|
|
60
|
+
export declare namespace SubFormListColumn {
|
|
61
|
+
/** Resolves the bulk map entry for this column, if the list was given one. */
|
|
62
|
+
type TextPropertiesProvider = () => ColumnTextProperties | undefined;
|
|
63
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ColumnTextProperties } from "../../tables/column/column-text-properties";
|
|
2
|
+
import { SubFormListColumn } from "./sub-form-list-column";
|
|
3
|
+
/**
|
|
4
|
+
* The columns of an `aup-sub-form-list` under `rowLayout="subgrid"`: their order, their grid tracks,
|
|
5
|
+
* and — through {@link columnTextProperties} — their titles.
|
|
6
|
+
*
|
|
7
|
+
* It exists because a subgrid column was otherwise declared in three places that nothing tied
|
|
8
|
+
* together: a cell in the `aupSubFormListHeader` template, a track in the consumer's
|
|
9
|
+
* `--aup-sub-form-list-columns`, and a cell position in the row template. Cells are auto-placed in
|
|
10
|
+
* source order, so the three drift silently — adding a cell without a track walks every later cell
|
|
11
|
+
* one column left, and nothing complains.
|
|
12
|
+
*
|
|
13
|
+
* The builder is the one `TableModel` takes, and the last line of it is the same line, against a
|
|
14
|
+
* `columns(ColumnTextProperties[])` i18n block of the same shape:
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* readonly levelColumns = new SubFormListColumns(c => {
|
|
19
|
+
* c.addColumn('priority');
|
|
20
|
+
* c.addColumn('color').width('var(--indicator-width)');
|
|
21
|
+
* c.addColumn('description').flex();
|
|
22
|
+
* c.addColumn('edit'); // untitled: a heading over a button names a
|
|
23
|
+
* // control, not a column
|
|
24
|
+
* c.columnTextProperties(this.i18n.columns); // titles every column, from one yml block
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* Not a `GarbageCollector`, unlike `AbstractTableModel`: this holds no pectin models and subscribes
|
|
29
|
+
* to nothing, so it carries no disposal obligation. It also does not own the rows — a
|
|
30
|
+
* sub-form-list's data is the `SubFormList` bound to `[list]`.
|
|
31
|
+
*/
|
|
32
|
+
export declare class SubFormListColumns {
|
|
33
|
+
private readonly _columns;
|
|
34
|
+
private bulkTextProperties;
|
|
35
|
+
constructor(builder?: (columns: SubFormListColumns) => void);
|
|
36
|
+
/**
|
|
37
|
+
* Declares a column. Declaration order is column order, matching the order the row template's
|
|
38
|
+
* top-level cells are written in.
|
|
39
|
+
*
|
|
40
|
+
* The analogue of `AbstractTableModel#addTemplateColumn`: the cell is the caller's, so this names
|
|
41
|
+
* the column it lands in and nothing more.
|
|
42
|
+
*/
|
|
43
|
+
addColumn(columnId: string): SubFormListColumn;
|
|
44
|
+
/**
|
|
45
|
+
* Titles every declared column from one map keyed by column id — identical in shape and effect to
|
|
46
|
+
* `AbstractTableModel#columnTextProperties`, so a generated `columns(ColumnTextProperties[])`
|
|
47
|
+
* block passes straight through.
|
|
48
|
+
*
|
|
49
|
+
* A column with no entry stays untitled; a per-column {@link SubFormListColumn#columnTextProperties}
|
|
50
|
+
* wins over this.
|
|
51
|
+
*/
|
|
52
|
+
columnTextProperties(columnTextProperties: {
|
|
53
|
+
[columnId: string]: ColumnTextProperties;
|
|
54
|
+
}): this;
|
|
55
|
+
getColumnTextProperties(columnId: string): ColumnTextProperties | undefined;
|
|
56
|
+
get columns(): readonly SubFormListColumn[];
|
|
57
|
+
/**
|
|
58
|
+
* The content track list for `--aup-sub-form-list-columns`, in declaration order. Undefined while
|
|
59
|
+
* no column is declared, so the component knows to leave the variable alone entirely.
|
|
60
|
+
*/
|
|
61
|
+
get tracks(): string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Whether any column resolved text properties — what decides if a header band is drawn at all.
|
|
64
|
+
*
|
|
65
|
+
* Keyed on the properties resolving rather than on the text being non-empty, so a table's
|
|
66
|
+
* `headerText: ''` blank-column convention still counts as "this list has a header", while a
|
|
67
|
+
* declaration made purely to size the tracks draws nothing.
|
|
68
|
+
*/
|
|
69
|
+
get hasDeclaredHeader(): boolean;
|
|
70
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
|
2
|
-
import { AfterContentInit } from '@angular/core';
|
|
2
|
+
import { AfterContentInit, AfterViewChecked, QueryList } from '@angular/core';
|
|
3
3
|
import { Command, CommandFace, SubFormList, ValueModel } from '@coolon/pectin';
|
|
4
4
|
import { Enum } from 'typescript-string-enums';
|
|
5
5
|
import { DisposableComponent } from '../../disposable-component';
|
|
6
|
-
import {
|
|
6
|
+
import { SubFormListColumn } from './sub-form-list-column';
|
|
7
|
+
import { SubFormListColumns } from './sub-form-list-columns';
|
|
8
|
+
import { SubFormListEmptyDirective, SubFormListFooterDirective, SubFormListHeaderDirective, SubFormRowActionsDirective, SubFormRowContext, SubFormRowDirective } from './sub-form-row.directive';
|
|
7
9
|
import * as i0 from "@angular/core";
|
|
8
10
|
/**
|
|
9
11
|
* Renders a pectin {@link SubFormList} as a stack of rows, each carrying its own remove and — when
|
|
@@ -28,7 +30,7 @@ import * as i0 from "@angular/core";
|
|
|
28
30
|
* previous list, which is not a scenario a form has — the list is built in the component's
|
|
29
31
|
* constructor and lives as long as the form does.
|
|
30
32
|
*/
|
|
31
|
-
export declare class SubFormListComponent<T extends object = any, B extends SubFormList.Fields = SubFormList.Fields> extends DisposableComponent implements AfterContentInit {
|
|
33
|
+
export declare class SubFormListComponent<T extends object = any, B extends SubFormList.Fields = SubFormList.Fields> extends DisposableComponent implements AfterContentInit, AfterViewChecked {
|
|
32
34
|
list: SubFormList<T, B>;
|
|
33
35
|
/**
|
|
34
36
|
* Which reordering affordances to offer. `AUTO` — the default — resolves to {@link Reorder.BOTH}
|
|
@@ -77,12 +79,52 @@ export declare class SubFormListComponent<T extends object = any, B extends SubF
|
|
|
77
79
|
* context memoisation exists to keep stable.
|
|
78
80
|
*/
|
|
79
81
|
rowLayout: SubFormListComponent.RowLayout;
|
|
82
|
+
/**
|
|
83
|
+
* Declares the list's columns — their order, their grid tracks, and their titles — as an
|
|
84
|
+
* alternative to naming them in an `aupSubFormListHeader` template and sizing them in a
|
|
85
|
+
* stylesheet. See {@link SubFormListColumns} for why the two-places-plus-an-implicit-third
|
|
86
|
+
* arrangement is worth replacing.
|
|
87
|
+
*
|
|
88
|
+
* `rowLayout="subgrid"` only, for the same reason the header template is: every other layout lays
|
|
89
|
+
* a row out within itself, so there are no shared columns to declare.
|
|
90
|
+
*
|
|
91
|
+
* Opt-in, and the older template slot outranks it: supplying both leaves the rendered header
|
|
92
|
+
* exactly as it was and warns, so adding this input to a list that already has a header template
|
|
93
|
+
* can never silently rewrite it. The declared *tracks* still apply in that case — declaring
|
|
94
|
+
* columns purely to size them is a legitimate reason to bind both.
|
|
95
|
+
*
|
|
96
|
+
* Bind a stable object, built once in the consumer's constructor or as a field initialiser.
|
|
97
|
+
*/
|
|
98
|
+
columns: SubFormListColumns;
|
|
99
|
+
/**
|
|
100
|
+
* Whether the list wears the library's table chrome: a bordered, rounded box around the rows with
|
|
101
|
+
* each row ruled off from the next rather than floated apart, and — under `subgrid`, the only
|
|
102
|
+
* layout with a header — a shaded band over the column titles.
|
|
103
|
+
*
|
|
104
|
+
* {@link Appearance.PLAIN} is the default and leaves the list exactly as it has always looked.
|
|
105
|
+
*
|
|
106
|
+
* It exists because the alternative was every consumer reaching through `::ng-deep` for `.rows`,
|
|
107
|
+
* `.row + .row` and `.header-row` — and losing a specificity fight with the library's own
|
|
108
|
+
* `.rows.layout-subgrid` row-gap on the way. Retune it with the `--aup-sub-form-list-border`,
|
|
109
|
+
* `-radius`, `-cell-padding`, `-header-background` and `-header-color` variables rather than by
|
|
110
|
+
* overriding the rules.
|
|
111
|
+
*/
|
|
112
|
+
appearance: SubFormListComponent.Appearance;
|
|
80
113
|
rowTemplate: SubFormRowDirective;
|
|
81
114
|
actionsTemplate: SubFormRowActionsDirective;
|
|
82
115
|
emptyTemplate: SubFormListEmptyDirective;
|
|
116
|
+
/** Single, unlike the footer: a list has one set of columns, so it has one row that names them. */
|
|
117
|
+
headerTemplate: SubFormListHeaderDirective;
|
|
118
|
+
/** One row per template, in template order — see the directive for why it repeats. */
|
|
119
|
+
footerTemplates: QueryList<SubFormListFooterDirective>;
|
|
120
|
+
/** The rows' content wrappers, whose element children are the caller's cells — see {@link verifyRowCellCount}. */
|
|
121
|
+
private rowContents;
|
|
122
|
+
private readonly elementRef;
|
|
83
123
|
/** The array `rows` was last built from — see the comment there. */
|
|
84
124
|
private renderedSource;
|
|
85
125
|
private renderedRows;
|
|
126
|
+
/** The shape {@link verifyRowCellCount} last ran against, so it costs one compare per pass. */
|
|
127
|
+
private cellCountCheckedFor;
|
|
86
128
|
constructor();
|
|
87
129
|
/**
|
|
88
130
|
* The row contexts, rebuilt only when the list's shape changes.
|
|
@@ -129,6 +171,17 @@ export declare class SubFormListComponent<T extends object = any, B extends SubF
|
|
|
129
171
|
*/
|
|
130
172
|
get defaultActionsVisible(): boolean;
|
|
131
173
|
get customActionsVisible(): boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Only under `subgrid`. Every other layout lays a row out within itself, so there are no shared
|
|
176
|
+
* tracks for a header to sit above and its cells would line up with nothing.
|
|
177
|
+
*
|
|
178
|
+
* Either source will draw the band: an `aupSubFormListHeader` template, or a {@link columns}
|
|
179
|
+
* declaration in which at least one column resolved text properties. A declaration made only to
|
|
180
|
+
* size the tracks draws nothing — see {@link SubFormListColumns#hasDeclaredHeader}.
|
|
181
|
+
*/
|
|
182
|
+
get headerVisible(): boolean;
|
|
183
|
+
/** The declared columns, or empty when none were bound. Empty is the "nothing changes" path. */
|
|
184
|
+
get headerColumns(): readonly SubFormListColumn[];
|
|
132
185
|
/** Whether anything trails the content — drives the content cell's trailing spacing. */
|
|
133
186
|
get hasActions(): boolean;
|
|
134
187
|
/**
|
|
@@ -136,7 +189,31 @@ export declare class SubFormListComponent<T extends object = any, B extends SubF
|
|
|
136
189
|
* `ngAfterContentInit`, so {@link actionsTemplate} is still undefined during `ngOnInit`.
|
|
137
190
|
*/
|
|
138
191
|
ngAfterContentInit(): void;
|
|
192
|
+
ngAfterViewChecked(): void;
|
|
139
193
|
trackByRow(index: number, context: SubFormRowContext): unknown;
|
|
194
|
+
/**
|
|
195
|
+
* Writes the declared tracks to the *private* half of the pair the stylesheet reads, so a
|
|
196
|
+
* consumer's own `--aup-sub-form-list-columns` still wins — the escape hatch survives, and a
|
|
197
|
+
* stylesheet that has not been migrated keeps working. Same two-tier idiom the row already uses
|
|
198
|
+
* for `--aup-sub-form-row-areas`.
|
|
199
|
+
*
|
|
200
|
+
* Set imperatively rather than through a host binding: it is a bind-once value, and one
|
|
201
|
+
* `setProperty` on init is cheaper and more predictable than a getter evaluated every pass.
|
|
202
|
+
*/
|
|
203
|
+
private applyColumnTracks;
|
|
204
|
+
/**
|
|
205
|
+
* Warns when the row template's cell count disagrees with the declared column count.
|
|
206
|
+
*
|
|
207
|
+
* The subgrid layout already requires one top-level element per track — cells are auto-placed, so
|
|
208
|
+
* a missing one silently walks every later cell a column left. This asserts that invariant rather
|
|
209
|
+
* than adding one; declaring the columns is simply the first time the component knows what the
|
|
210
|
+
* count should be.
|
|
211
|
+
*
|
|
212
|
+
* Two things it cannot see, both pre-existing hazards of auto-placement rather than new ones: a
|
|
213
|
+
* *reordering* (the count still matches), and a top-level cell behind an `*ngIf` (absent when the
|
|
214
|
+
* condition is false, which reads here as a miscount). Hence a warning rather than an assert.
|
|
215
|
+
*/
|
|
216
|
+
private verifyRowCellCount;
|
|
140
217
|
/**
|
|
141
218
|
* CDK reports `currentIndex` after the dragged row has been taken out of the list, which is the
|
|
142
219
|
* same convention {@link SubFormList#move} splices with — so the index passes straight through,
|
|
@@ -159,9 +236,17 @@ export declare class SubFormListComponent<T extends object = any, B extends SubF
|
|
|
159
236
|
* layout the caller asked `fill` to change.
|
|
160
237
|
*/
|
|
161
238
|
private warnAboutIgnoredSubgridInputs;
|
|
239
|
+
private warnAboutIgnoredHeader;
|
|
240
|
+
/**
|
|
241
|
+
* The template slot wins over `[columns]` deliberately: it is the older contract, so a list that
|
|
242
|
+
* has both is a migration half-done, and leaving the rendered header untouched is the debuggable
|
|
243
|
+
* outcome. Only the *titles* are dropped — the declared tracks still apply, since sizing the
|
|
244
|
+
* columns while a template names them is a legitimate pairing.
|
|
245
|
+
*/
|
|
246
|
+
private warnAboutIgnoredColumns;
|
|
162
247
|
private warnAboutUnsupportedReordering;
|
|
163
248
|
static ɵfac: i0.ɵɵFactoryDeclaration<SubFormListComponent<any, any>, never>;
|
|
164
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SubFormListComponent<any, any>, "aup-sub-form-list", never, { "list": { "alias": "list"; "required": false; }; "reorder": { "alias": "reorder"; "required": false; }; "removable$": { "alias": "removable$"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "removeFace": { "alias": "removeFace"; "required": false; }; "moveUpFace": { "alias": "moveUpFace"; "required": false; }; "moveDownFace": { "alias": "moveDownFace"; "required": false; }; "dragHandleIcon": { "alias": "dragHandleIcon"; "required": false; }; "addCommand": { "alias": "addCommand"; "required": false; }; "emptyText": { "alias": "emptyText"; "required": false; }; "dense": { "alias": "dense"; "required": false; }; "fill": { "alias": "fill"; "required": false; }; "rowLayout": { "alias": "rowLayout"; "required": false; }; }, {}, ["rowTemplate", "actionsTemplate", "emptyTemplate"], never, false, never>;
|
|
249
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SubFormListComponent<any, any>, "aup-sub-form-list", never, { "list": { "alias": "list"; "required": false; }; "reorder": { "alias": "reorder"; "required": false; }; "removable$": { "alias": "removable$"; "required": false; }; "removable": { "alias": "removable"; "required": false; }; "removeFace": { "alias": "removeFace"; "required": false; }; "moveUpFace": { "alias": "moveUpFace"; "required": false; }; "moveDownFace": { "alias": "moveDownFace"; "required": false; }; "dragHandleIcon": { "alias": "dragHandleIcon"; "required": false; }; "addCommand": { "alias": "addCommand"; "required": false; }; "emptyText": { "alias": "emptyText"; "required": false; }; "dense": { "alias": "dense"; "required": false; }; "fill": { "alias": "fill"; "required": false; }; "rowLayout": { "alias": "rowLayout"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; }, {}, ["rowTemplate", "actionsTemplate", "emptyTemplate", "headerTemplate", "footerTemplates"], never, false, never>;
|
|
165
250
|
}
|
|
166
251
|
export declare namespace SubFormListComponent {
|
|
167
252
|
const Reorder: {
|
|
@@ -174,6 +259,24 @@ export declare namespace SubFormListComponent {
|
|
|
174
259
|
BOTH: "both";
|
|
175
260
|
};
|
|
176
261
|
type Reorder = Enum<typeof Reorder>;
|
|
262
|
+
const Appearance: {
|
|
263
|
+
/** No chrome of the library's own — rows float apart on the row gap. The default. */
|
|
264
|
+
PLAIN: "plain";
|
|
265
|
+
/**
|
|
266
|
+
* One bordered, rounded box holding every row, rows ruled off from one another rather than
|
|
267
|
+
* separated, and the header band shaded and ruled so it reads as a table head rather than as a
|
|
268
|
+
* first row.
|
|
269
|
+
*
|
|
270
|
+
* Reach for it when the rows are read *against each other* — ranked, compared, or titled by
|
|
271
|
+
* columns — which is also when a titled column means anything: a heading only holds if the box
|
|
272
|
+
* it heads holds every row.
|
|
273
|
+
*
|
|
274
|
+
* The header band needs {@link RowLayout.SUBGRID}, since that is the only layout with a header
|
|
275
|
+
* at all; the box and the rules apply in any layout.
|
|
276
|
+
*/
|
|
277
|
+
TABLE: "table";
|
|
278
|
+
};
|
|
279
|
+
type Appearance = Enum<typeof Appearance>;
|
|
177
280
|
const RowLayout: {
|
|
178
281
|
/** One line: `handle · content · up · down · actions`. The default. */
|
|
179
282
|
INLINE: "inline";
|
|
@@ -64,3 +64,73 @@ export declare class SubFormListEmptyDirective {
|
|
|
64
64
|
static ɵfac: i0.ɵɵFactoryDeclaration<SubFormListEmptyDirective, never>;
|
|
65
65
|
static ɵdir: i0.ɵɵDirectiveDeclaration<SubFormListEmptyDirective, "[aupSubFormListEmpty]", never, {}, {}, never, never, false, never>;
|
|
66
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* The row that names the list's columns, drawn above the items.
|
|
69
|
+
*
|
|
70
|
+
* Rendered inside the rows container for the same reason the footer is: only a child of the grid
|
|
71
|
+
* can adopt its tracks, so the titles size against — and line up with — the very cells they name.
|
|
72
|
+
* A caller drawing this above the list instead would have to restate
|
|
73
|
+
* `--aup-sub-form-list-columns`, and would still miss the handle and action tracks the list sizes
|
|
74
|
+
* from its own content.
|
|
75
|
+
*
|
|
76
|
+
* Single, unlike the footer: a list has one set of columns, so it has one row that names them.
|
|
77
|
+
*
|
|
78
|
+
* `rowLayout="subgrid"` only — every other layout lays each row out within itself, so there are no
|
|
79
|
+
* shared columns for a header to title and its cells would align with nothing. Supplying one under
|
|
80
|
+
* another layout is ignored, with a warning.
|
|
81
|
+
*
|
|
82
|
+
* Hidden from assistive tech, and not a listitem: it labels the columns rather than standing for an
|
|
83
|
+
* item, and a screen reader walking the list should not have to step over it. Give the cells inside
|
|
84
|
+
* it the same order the row template gives its own.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```html
|
|
88
|
+
* <aup-sub-form-list [list]="levels" rowLayout="subgrid">
|
|
89
|
+
* <ng-template aupSubFormListHeader>
|
|
90
|
+
* <span>Priority</span>
|
|
91
|
+
* <span>Colour</span>
|
|
92
|
+
* <span>Description</span>
|
|
93
|
+
* </ng-template>
|
|
94
|
+
* <ng-template aupSubFormRow let-row>…</ng-template>
|
|
95
|
+
* </aup-sub-form-list>
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare class SubFormListHeaderDirective {
|
|
99
|
+
readonly templateRef: TemplateRef<void>;
|
|
100
|
+
constructor(templateRef: TemplateRef<void>);
|
|
101
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SubFormListHeaderDirective, never>;
|
|
102
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SubFormListHeaderDirective, "[aupSubFormListHeader]", never, {}, {}, never, never, false, never>;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* A trailing row that belongs to the list rather than to the data — the states a list of items
|
|
106
|
+
* cannot express, read in the same columns as the items above them.
|
|
107
|
+
*
|
|
108
|
+
* Rendered inside the rows container, so under `rowLayout="subgrid"` its top-level elements land in
|
|
109
|
+
* the very tracks the row cells do. That is the whole point of it: aligning such a thing from
|
|
110
|
+
* *outside* the list means restating `--aup-sub-form-list-columns` in the caller's stylesheet, which
|
|
111
|
+
* then drifts the moment the list's columns change.
|
|
112
|
+
*
|
|
113
|
+
* Not a row of the list: it carries no sub-form, no reordering and no remove, and the list's own
|
|
114
|
+
* `addCommand` footer still sits below it.
|
|
115
|
+
*
|
|
116
|
+
* Repeatable — supply one per trailing state, and each renders as its own row, in template order.
|
|
117
|
+
* That is what lets several of them line up with each other as well as with the rows: two states
|
|
118
|
+
* crammed side by side into one footer row could not both sit under the same column.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```html
|
|
122
|
+
* <aup-sub-form-list [list]="levels" rowLayout="subgrid">
|
|
123
|
+
* <ng-template aupSubFormRow let-row>…</ng-template>
|
|
124
|
+
* <ng-template aupSubFormListFooter>
|
|
125
|
+
* <span>When nothing matches</span>
|
|
126
|
+
* <aup-command [command]="editFallbackCommand"></aup-command>
|
|
127
|
+
* </ng-template>
|
|
128
|
+
* </aup-sub-form-list>
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export declare class SubFormListFooterDirective {
|
|
132
|
+
readonly templateRef: TemplateRef<void>;
|
|
133
|
+
constructor(templateRef: TemplateRef<void>);
|
|
134
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SubFormListFooterDirective, never>;
|
|
135
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SubFormListFooterDirective, "[aupSubFormListFooter]", never, {}, {}, never, never, false, never>;
|
|
136
|
+
}
|