@coolon/angular-ui-powerups 16.1.0-alpha.267 → 16.1.0-alpha.269

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.
@@ -55,29 +55,32 @@ import * as i53 from "./forms/search-input/search-input.component";
55
55
  import * as i54 from "./tables/renderer/table-footer-row/table-footer-row.component";
56
56
  import * as i55 from "./file/file-download/file-download.component";
57
57
  import * as i56 from "./commands/button-renderer/button-renderer.component";
58
- import * as i57 from "@angular/common";
59
- import * as i58 from "@angular/platform-browser/animations";
60
- import * as i59 from "@angular/forms";
61
- import * as i60 from "@angular/material/input";
62
- import * as i61 from "@angular/material/form-field";
63
- import * as i62 from "@angular/material/select";
64
- import * as i63 from "@angular/material/tabs";
65
- import * as i64 from "../directives/directives.module";
66
- import * as i65 from "@angular/material/icon";
67
- import * as i66 from "@angular/material/button";
68
- import * as i67 from "@angular/material/checkbox";
69
- import * as i68 from "@angular/material/table";
70
- import * as i69 from "@angular/cdk/portal";
71
- import * as i70 from "@angular/cdk/scrolling";
72
- import * as i71 from "@angular/material/tooltip";
73
- import * as i72 from "@angular/material/autocomplete";
74
- import * as i73 from "@angular/material/menu";
75
- import * as i74 from "@angular/material/divider";
76
- import * as i75 from "@angular/material/progress-spinner";
77
- import * as i76 from "@angular/material/progress-bar";
78
- import * as i77 from "ng-table-virtual-scroll";
58
+ import * as i57 from "./forms/sub-form-list/sub-form-list.component";
59
+ import * as i58 from "./forms/sub-form-list/sub-form-row.directive";
60
+ import * as i59 from "@angular/common";
61
+ import * as i60 from "@angular/platform-browser/animations";
62
+ import * as i61 from "@angular/forms";
63
+ import * as i62 from "@angular/material/input";
64
+ import * as i63 from "@angular/material/form-field";
65
+ import * as i64 from "@angular/material/select";
66
+ import * as i65 from "@angular/material/tabs";
67
+ import * as i66 from "../directives/directives.module";
68
+ import * as i67 from "@angular/material/icon";
69
+ import * as i68 from "@angular/material/button";
70
+ import * as i69 from "@angular/material/checkbox";
71
+ import * as i70 from "@angular/material/table";
72
+ import * as i71 from "@angular/cdk/portal";
73
+ import * as i72 from "@angular/cdk/scrolling";
74
+ import * as i73 from "@angular/material/tooltip";
75
+ import * as i74 from "@angular/material/autocomplete";
76
+ import * as i75 from "@angular/material/menu";
77
+ import * as i76 from "@angular/material/divider";
78
+ import * as i77 from "@angular/material/progress-spinner";
79
+ import * as i78 from "@angular/material/progress-bar";
80
+ import * as i79 from "ng-table-virtual-scroll";
81
+ import * as i80 from "@angular/cdk/drag-drop";
79
82
  export declare class ComponentsModule {
80
83
  static ɵfac: i0.ɵɵFactoryDeclaration<ComponentsModule, never>;
81
- 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.CommonModule, typeof i58.BrowserAnimationsModule, typeof i59.FormsModule, typeof i60.MatInputModule, typeof i61.MatFormFieldModule, typeof i62.MatSelectModule, typeof i63.MatTabsModule, typeof i64.DirectivesModule, typeof i65.MatIconModule, typeof i66.MatButtonModule, typeof i67.MatCheckboxModule, typeof i68.MatTableModule, typeof i69.PortalModule, typeof i70.CdkScrollableModule, typeof i71.MatTooltipModule, typeof i72.MatAutocompleteModule, typeof i73.MatMenuModule, typeof i74.MatDividerModule, typeof i75.MatProgressSpinnerModule, typeof i76.MatProgressBarModule, typeof i70.ScrollingModule, typeof i77.TableVirtualScrollModule], [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]>;
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]>;
82
85
  static ɵinj: i0.ɵɵInjectorDeclaration<ComponentsModule>;
83
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.component";
45
+ export * from "./forms/sub-form-list/sub-form-row.directive";
44
46
  export * from "./forms/text-input/text-input.component";
45
47
  export * from "./icon/icon.component";
46
48
  export * from "./labelled-value/labelled-value.component";
@@ -0,0 +1,192 @@
1
+ import { CdkDragDrop } from '@angular/cdk/drag-drop';
2
+ import { AfterContentInit } from '@angular/core';
3
+ import { Command, CommandFace, SubFormList, ValueModel } from '@coolon/pectin';
4
+ import { Enum } from 'typescript-string-enums';
5
+ import { DisposableComponent } from '../../disposable-component';
6
+ import { SubFormListEmptyDirective, SubFormRowActionsDirective, SubFormRowContext, SubFormRowDirective } from './sub-form-row.directive';
7
+ import * as i0 from "@angular/core";
8
+ /**
9
+ * Renders a pectin {@link SubFormList} as a stack of rows, each carrying its own remove and — when
10
+ * the list is user-ordered — reordering affordances.
11
+ *
12
+ * The list already owns the behaviour: one sub-form per array element, per-row `removeItemCommand`
13
+ * / `moveUpCommand` / `moveDownCommand` gated at the ends, and `move(subForm, toIndex)`. What this
14
+ * component removes is the boilerplate that was otherwise copied into every consumer — the
15
+ * `*ngFor` over `subForms$.value`, three hand-wired `aup-command`s per row with hand-held
16
+ * {@link CommandFace} constants, and the empty state.
17
+ *
18
+ * @example
19
+ * ```html
20
+ * <aup-sub-form-list [list]="levels" [addCommand]="addLevelCommand" emptyText="No levels">
21
+ * <ng-template aupSubFormRow let-row>
22
+ * <aup-string-input label="Name" [dense]="true" [value$]="row.name$"></aup-string-input>
23
+ * </ng-template>
24
+ * </aup-sub-form-list>
25
+ * ```
26
+ *
27
+ * Bind `list` once. Re-binding it after init leaves the change-detection wiring pointed at the
28
+ * previous list, which is not a scenario a form has — the list is built in the component's
29
+ * constructor and lives as long as the form does.
30
+ */
31
+ export declare class SubFormListComponent<T extends object = any, B extends SubFormList.Fields = SubFormList.Fields> extends DisposableComponent implements AfterContentInit {
32
+ list: SubFormList<T, B>;
33
+ /**
34
+ * Which reordering affordances to offer. `AUTO` — the default — resolves to {@link Reorder.BOTH}
35
+ * for a user-ordered list and {@link Reorder.NONE} otherwise.
36
+ *
37
+ * Every mode is additionally gated on `list.reorderable`: asking for drag or buttons on a list
38
+ * whose order is *derived* (`orderBy`) is refused with a console warning, because the next load
39
+ * would re-derive the order and silently undo the move.
40
+ */
41
+ reorder: SubFormListComponent.Reorder;
42
+ accessor removable$: ValueModel<boolean>;
43
+ /** Whether rows can be removed — the seam for permission-gating removal via `removable$`. */
44
+ accessor removable: boolean;
45
+ /**
46
+ * Faces for the default action cluster. They ship icon-only with a tooltip, which is what makes
47
+ * `aup-command` render them as `mat-icon-button`s; supply text as well to get labelled buttons.
48
+ * The defaults are English — aup has no i18n, so a localised app overrides them here.
49
+ */
50
+ removeFace: CommandFace;
51
+ moveUpFace: CommandFace;
52
+ moveDownFace: CommandFace;
53
+ dragHandleIcon: string;
54
+ /** Rendered in the footer below the rows. Optional — callers who site their own add button omit it. */
55
+ accessor addCommand: Command;
56
+ /** Shown when the list is empty. Omit both this and an `aupSubFormListEmpty` template for no empty state. */
57
+ emptyText: string;
58
+ dense: boolean;
59
+ /**
60
+ * Gives the row's content the remaining width instead of sizing it to its fields. Off by
61
+ * default, so a row of dense inputs hugs them rather than stranding the action cluster at the
62
+ * far edge of the list; turn it on for a row whose single field should span the width.
63
+ */
64
+ fill: boolean;
65
+ /**
66
+ * How the library lays the row's cells out. {@link RowLayout.INLINE} — the default — is one line
67
+ * of `handle · content · up · down · actions`.
68
+ *
69
+ * Each value is a named preset over the row's public CSS variables
70
+ * (`--aup-sub-form-row-areas` / `-columns` / `-rows`), which a consumer can set from its own
71
+ * stylesheet to override any of them — the variable wins over the preset, deliberately.
72
+ *
73
+ * Bind this once. It selects a class on each row, and {@link RowLayout.CUSTOM} additionally
74
+ * changes what the row renders, so flipping it at runtime rebuilds the very bindings the row
75
+ * context memoisation exists to keep stable.
76
+ */
77
+ rowLayout: SubFormListComponent.RowLayout;
78
+ rowTemplate: SubFormRowDirective;
79
+ actionsTemplate: SubFormRowActionsDirective;
80
+ emptyTemplate: SubFormListEmptyDirective;
81
+ /** The array `rows` was last built from — see the comment there. */
82
+ private renderedSource;
83
+ private renderedRows;
84
+ constructor();
85
+ /**
86
+ * The row contexts, rebuilt only when the list's shape changes.
87
+ *
88
+ * `subForms$` publishes a fresh array on every membership/order change and never otherwise, so
89
+ * array identity is an exact shape-change signal. Memoising on it keeps the context objects
90
+ * stable across the change-detection passes a keystroke causes, which stops `ngTemplateOutlet`
91
+ * from churning the row's bindings while the user is typing in it.
92
+ */
93
+ get rows(): SubFormRowContext<SubFormList.ItemSubForm<T, B>>[];
94
+ get listErrors(): ReadonlyArray<string>;
95
+ get empty(): boolean;
96
+ get hasAddCommand(): boolean;
97
+ /** `AUTO` resolved against the list; every other mode passes through for the gates below. */
98
+ private get resolvedReorder();
99
+ /**
100
+ * True for every mode that reorders at all, {@link Reorder.DRAG} included — see
101
+ * {@link dragEnabled} for why drag never stands alone. `DRAG` only changes how prominent the
102
+ * buttons are, via {@link buttonsOnDemand}.
103
+ */
104
+ get moveButtonsVisible(): boolean;
105
+ /**
106
+ * Drag stays off unless the order is the data. It is also *never* the only reordering affordance
107
+ * offered by the default cluster: CDK drag is pointer-only, so removing the move buttons in
108
+ * {@link Reorder.DRAG} mode would leave keyboard and screen-reader users unable to reorder at
109
+ * all. `DRAG` hides the buttons until the row is hovered or holds focus; it does not delete them.
110
+ */
111
+ get dragEnabled(): boolean;
112
+ get buttonsOnDemand(): boolean;
113
+ /** A hook for consumer stylesheets and e2e selectors; the layout rules key off the row's class. */
114
+ get rowLayoutAttribute(): string;
115
+ get inlineLayout(): boolean;
116
+ get railLayout(): boolean;
117
+ get customLayout(): boolean;
118
+ /**
119
+ * The three standard buttons, as flat grid items. Excludes the case where a template replaces
120
+ * them, so the two branches are siblings rather than an `if/else` — which is what lets the
121
+ * default cluster be flat while the replacing one keeps a wrapper to be placed by.
122
+ */
123
+ get defaultActionsVisible(): boolean;
124
+ get customActionsVisible(): boolean;
125
+ /** Whether anything trails the content — drives the content cell's trailing spacing. */
126
+ get hasActions(): boolean;
127
+ /**
128
+ * Not folded into the `onInit` callback above: a non-static `@ContentChild` is not resolved until
129
+ * `ngAfterContentInit`, so {@link actionsTemplate} is still undefined during `ngOnInit`.
130
+ */
131
+ ngAfterContentInit(): void;
132
+ trackByRow(index: number, context: SubFormRowContext): unknown;
133
+ /**
134
+ * CDK reports `currentIndex` after the dragged row has been taken out of the list, which is the
135
+ * same convention {@link SubFormList#move} splices with — so the index passes straight through,
136
+ * with no local array to keep in step. The list republishes `subForms$` itself; the explicit
137
+ * `markForCheck` is what gets that repaint scheduled before CDK's drop animation settles, so the
138
+ * row does not visibly snap back to where it started.
139
+ */
140
+ onDropped(event: CdkDragDrop<unknown>): void;
141
+ /**
142
+ * `CUSTOM` hands the row to the caller, which silently ignores two inputs that would otherwise
143
+ * have rendered something. The reorder warning fires only for an *explicit* `BUTTONS`/`BOTH` —
144
+ * `reorder` defaults to `AUTO`, and a plain custom row is very likely rendering the commands
145
+ * itself, which the component cannot detect.
146
+ */
147
+ private warnAboutIgnoredCustomLayoutInputs;
148
+ private warnAboutUnsupportedReordering;
149
+ static ɵfac: i0.ɵɵFactoryDeclaration<SubFormListComponent<any, any>, never>;
150
+ 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>;
151
+ }
152
+ export declare namespace SubFormListComponent {
153
+ const Reorder: {
154
+ /** Buttons and drag when the list is user-ordered; nothing when it isn't. */
155
+ AUTO: "auto";
156
+ NONE: "none";
157
+ BUTTONS: "buttons";
158
+ /** Drag handles, with the move buttons revealed on hover/focus as the keyboard path. */
159
+ DRAG: "drag";
160
+ BOTH: "both";
161
+ };
162
+ type Reorder = Enum<typeof Reorder>;
163
+ const RowLayout: {
164
+ /** One line: `handle · content · up · down · actions`. The default. */
165
+ INLINE: "inline";
166
+ /** `up` / `handle` / `down` stacked in a leading rail, content beside it, actions trailing. */
167
+ RAIL: "rail";
168
+ /**
169
+ * The caller lays the row out. No preset area map, no library-rendered buttons, and the content
170
+ * wrapper is given `display: contents` so the row template's own top-level elements become the
171
+ * grid items it writes `grid-area` on.
172
+ *
173
+ * The drag handle is still rendered whenever `reorder` enables drag — it has to be, since a
174
+ * `cdkDragHandle` in a caller's template silently fails to attach — so drag survives a custom
175
+ * layout. Two obligations come with that: include a `handle` area in the map (an unknown named
176
+ * line falls back to auto-placement), and render the move commands yourself, because they are
177
+ * the only keyboard path to reordering and the library no longer provides them.
178
+ *
179
+ * One known limitation: CDK appends the drag preview to `<body>`, so a map set on or above this
180
+ * component's host does not reach it and the preview auto-places instead. The caller's own
181
+ * `grid-area` rules *do* survive, being compound selectors on cloned elements — only the track
182
+ * definition is lost. Hoisting the map to `:root` fixes the preview but sets the public variable
183
+ * for every list on the page, overriding their layouts too, so it is only an option when the
184
+ * page has one list.
185
+ */
186
+ CUSTOM: "custom";
187
+ };
188
+ type RowLayout = Enum<typeof RowLayout>;
189
+ const DEFAULT_REMOVE_FACE: CommandFace;
190
+ const DEFAULT_MOVE_UP_FACE: CommandFace;
191
+ const DEFAULT_MOVE_DOWN_FACE: CommandFace;
192
+ }
@@ -0,0 +1,66 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * The context handed to every `aup-sub-form-list` row template.
5
+ *
6
+ * `index`/`first`/`last`/`count` describe the row's place in the list *as rendered*, which under an
7
+ * ordering mode is also its place in the data. These are recomputed only when the list's shape
8
+ * changes, so the context object handed to a given row is stable between shape changes — bindings
9
+ * inside the row template are not torn down by an unrelated keystroke elsewhere in the list.
10
+ */
11
+ export interface SubFormRowContext<R = any> {
12
+ /** The row's sub-form — `let-row` in the template. */
13
+ $implicit: R;
14
+ /** The same sub-form, for templates that prefer `let-row="row"`. */
15
+ row: R;
16
+ index: number;
17
+ first: boolean;
18
+ last: boolean;
19
+ count: number;
20
+ }
21
+ /**
22
+ * Marks the template rendered as the body of each sub-form row.
23
+ *
24
+ * @example
25
+ * ```html
26
+ * <aup-sub-form-list [list]="levels">
27
+ * <ng-template aupSubFormRow let-row>
28
+ * <aup-string-input label="Name" [dense]="true" [value$]="row.name$"></aup-string-input>
29
+ * </ng-template>
30
+ * </aup-sub-form-list>
31
+ * ```
32
+ */
33
+ export declare class SubFormRowDirective {
34
+ readonly templateRef: TemplateRef<SubFormRowContext>;
35
+ constructor(templateRef: TemplateRef<SubFormRowContext>);
36
+ static ɵfac: i0.ɵɵFactoryDeclaration<SubFormRowDirective, never>;
37
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SubFormRowDirective, "[aupSubFormRow]", never, {}, {}, never, never, false, never>;
38
+ }
39
+ /**
40
+ * Replaces the whole per-row action cluster (move up / move down / remove).
41
+ *
42
+ * Reach for this only when the default cluster's *composition* is wrong — an extra per-row command,
43
+ * or a menu instead of buttons. To change how the standard three look, bind `removeFace`,
44
+ * `moveUpFace` and `moveDownFace` instead and keep the layout, gating and drag interop.
45
+ *
46
+ * The commands are on the row sub-form itself (`removeItemCommand`, `moveUpCommand`,
47
+ * `moveDownCommand`), so the context is the same one the row template gets.
48
+ *
49
+ * It renders as a single grid item in the row's `actions` cell — unlike the default cluster, whose
50
+ * three buttons are placed separately so a layout can split them. Ignored, with a warning, under
51
+ * `rowLayout="custom"`: that layout hands the whole row to the `aupSubFormRow` template, which
52
+ * reaches the very same commands.
53
+ */
54
+ export declare class SubFormRowActionsDirective {
55
+ readonly templateRef: TemplateRef<SubFormRowContext>;
56
+ constructor(templateRef: TemplateRef<SubFormRowContext>);
57
+ static ɵfac: i0.ɵɵFactoryDeclaration<SubFormRowActionsDirective, never>;
58
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SubFormRowActionsDirective, "[aupSubFormRowActions]", never, {}, {}, never, never, false, never>;
59
+ }
60
+ /** Replaces the default empty state, shown while the list has no rows. */
61
+ export declare class SubFormListEmptyDirective {
62
+ readonly templateRef: TemplateRef<void>;
63
+ constructor(templateRef: TemplateRef<void>);
64
+ static ɵfac: i0.ɵɵFactoryDeclaration<SubFormListEmptyDirective, never>;
65
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SubFormListEmptyDirective, "[aupSubFormListEmpty]", never, {}, {}, never, never, false, never>;
66
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "16.1.0-alpha.267",
3
+ "version": "16.1.0-alpha.269",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.9",
6
6
  "@angular/common": "^16.2.9",
@@ -12,7 +12,7 @@
12
12
  "@angular/platform-browser-dynamic": "^16.2.9",
13
13
  "@angular/material-moment-adapter": "^16.2.10",
14
14
  "@angular/router": "^16.2.9",
15
- "@coolon/pectin": "^5.0.0-alpha.136",
15
+ "@coolon/pectin": "^5.0.0-alpha.137",
16
16
  "fast-typescript-memoize": "^1.1.1",
17
17
  "lodash-es": "^4.17.21",
18
18
  "marked": "4.0.10",