@coolon/angular-ui-powerups 16.1.0-alpha.270 → 16.1.0-alpha.272
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/forms/sub-form-list/sub-form-list.component.mjs +53 -3
- package/esm2022/lib/place/guards/place.guard.mjs +16 -2
- package/esm2022/lib/place/navigation/session/navigation-session.mjs +4 -4
- package/esm2022/lib/place/place-router.mjs +35 -26
- package/esm2022/lib/place/url-snapshot.mjs +27 -4
- package/fesm2022/coolon-angular-ui-powerups.mjs +129 -34
- package/fesm2022/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/forms/sub-form-list/sub-form-list.component.d.ts +43 -0
- package/lib/place/guards/place.guard.d.ts +10 -0
- package/lib/place/navigation/session/navigation-session.d.ts +3 -3
- package/lib/place/place-router.d.ts +16 -8
- package/package.json +2 -2
|
@@ -3487,6 +3487,8 @@ class SubFormListComponent extends DisposableComponent {
|
|
|
3487
3487
|
* Each value is a named preset over the row's public CSS variables
|
|
3488
3488
|
* (`--aup-sub-form-row-areas` / `-columns` / `-rows`), which a consumer can set from its own
|
|
3489
3489
|
* stylesheet to override any of them — the variable wins over the preset, deliberately.
|
|
3490
|
+
* {@link RowLayout.SUBGRID} is the exception that reaches wider than the row: it makes the rows
|
|
3491
|
+
* container the grid, and takes the content tracks from `--aup-sub-form-list-columns`.
|
|
3490
3492
|
*
|
|
3491
3493
|
* Bind this once. It selects a class on each row, and {@link RowLayout.CUSTOM} additionally
|
|
3492
3494
|
* changes what the row renders, so flipping it at runtime rebuilds the very bindings the row
|
|
@@ -3584,6 +3586,13 @@ class SubFormListComponent extends DisposableComponent {
|
|
|
3584
3586
|
get customLayout() {
|
|
3585
3587
|
return this.rowLayout === SubFormListComponent.RowLayout.CUSTOM;
|
|
3586
3588
|
}
|
|
3589
|
+
/**
|
|
3590
|
+
* Also drives a class on the rows container, which is the grid the rows subgrid — the only layout
|
|
3591
|
+
* that needs one, since the others are laid out entirely within a row.
|
|
3592
|
+
*/
|
|
3593
|
+
get subgridLayout() {
|
|
3594
|
+
return this.rowLayout === SubFormListComponent.RowLayout.SUBGRID;
|
|
3595
|
+
}
|
|
3587
3596
|
/**
|
|
3588
3597
|
* The three standard buttons, as flat grid items. Excludes the case where a template replaces
|
|
3589
3598
|
* them, so the two branches are siblings rather than an `if/else` — which is what lets the
|
|
@@ -3605,6 +3614,7 @@ class SubFormListComponent extends DisposableComponent {
|
|
|
3605
3614
|
*/
|
|
3606
3615
|
ngAfterContentInit() {
|
|
3607
3616
|
this.warnAboutIgnoredCustomLayoutInputs();
|
|
3617
|
+
this.warnAboutIgnoredSubgridInputs();
|
|
3608
3618
|
}
|
|
3609
3619
|
trackByRow(index, context) {
|
|
3610
3620
|
return context.row;
|
|
@@ -3642,6 +3652,17 @@ class SubFormListComponent extends DisposableComponent {
|
|
|
3642
3652
|
console.warn(`aup-sub-form-list: reorder="${asked}" renders no move buttons under rowLayout="custom". Render row.moveUpCommand and row.moveDownCommand in the aupSubFormRow template — CDK drag is pointer-only, so without them there is no keyboard path for reordering.`);
|
|
3643
3653
|
}
|
|
3644
3654
|
}
|
|
3655
|
+
/**
|
|
3656
|
+
* `fill` is the one input `subgrid` silently drops: the content's width is the sum of the tracks
|
|
3657
|
+
* the list was given, so there is no remaining width left to hand it. Worth a warning rather than
|
|
3658
|
+
* a doc line, because the two read as complementary and the result of setting both is simply the
|
|
3659
|
+
* layout the caller asked `fill` to change.
|
|
3660
|
+
*/
|
|
3661
|
+
warnAboutIgnoredSubgridInputs() {
|
|
3662
|
+
if (this.subgridLayout && this.fill) {
|
|
3663
|
+
console.warn(`aup-sub-form-list: [fill] does nothing under rowLayout="subgrid" — the row's width is the track list in --aup-sub-form-list-columns. End that list with a 1fr track to push the action cluster to the far edge.`);
|
|
3664
|
+
}
|
|
3665
|
+
}
|
|
3645
3666
|
warnAboutUnsupportedReordering() {
|
|
3646
3667
|
const asked = this.reorder;
|
|
3647
3668
|
if (asked !== SubFormListComponent.Reorder.AUTO
|
|
@@ -3651,7 +3672,7 @@ class SubFormListComponent extends DisposableComponent {
|
|
|
3651
3672
|
}
|
|
3652
3673
|
}
|
|
3653
3674
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: SubFormListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3654
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: SubFormListComponent, selector: "aup-sub-form-list", inputs: { list: "list", reorder: "reorder", removable$: "removable$", removable: "removable", removeFace: "removeFace", moveUpFace: "moveUpFace", moveDownFace: "moveDownFace", dragHandleIcon: "dragHandleIcon", addCommand: "addCommand", emptyText: "emptyText", dense: "dense", fill: "fill", rowLayout: "rowLayout" }, host: { properties: { "class.dense": "this.dense", "class.fill": "this.fill", "class.buttons-on-demand": "this.buttonsOnDemand", "attr.data-row-layout": "this.rowLayoutAttribute" } }, queries: [{ propertyName: "rowTemplate", first: true, predicate: SubFormRowDirective, descendants: true }, { propertyName: "actionsTemplate", first: true, predicate: SubFormRowActionsDirective, descendants: true }, { propertyName: "emptyTemplate", first: true, predicate: SubFormListEmptyDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"rows\"\n role=\"list\"\n cdkDropList\n [cdkDropListDisabled]=\"!dragEnabled\"\n (cdkDropListDropped)=\"onDropped($event)\"\n data-cy=\"sub-form-rows\">\n\n <!-- The layout classes go on .row, not the host: CDK's drag preview is a deep clone of .row\n appended to <body>, and a rule anchored on the host cannot reach it. Written as discrete\n [class.x] bindings rather than one [ngClass] object literal, which would allocate a fresh\n object on every change-detection pass. -->\n <div class=\"row\"\n role=\"listitem\"\n *ngFor=\"let context of rows; trackBy: trackByRow\"\n [class.layout-inline]=\"inlineLayout\"\n [class.layout-rail]=\"railLayout\"\n [class.layout-custom]=\"customLayout\"\n [class.fill]=\"fill\"\n [class.buttons-on-demand]=\"buttonsOnDemand\"\n [class.has-actions]=\"hasActions\"\n cdkDrag\n [cdkDragDisabled]=\"!dragEnabled\"\n data-cy=\"sub-form-row\">\n\n <!-- Deliberately not focusable and hidden from assistive tech: CDK drag is pointer-only, so a\n focusable handle would take a tab stop and then do nothing. The move buttons are the\n keyboard path, which is why they survive even in reorder=\"drag\" \u2014 and why rowLayout=\"custom\",\n which renders none of them, makes that path the caller's to provide.\n\n It stays library-rendered in every layout because it has to: CdkDragHandle finds its drag\n through the node injector and CdkDrag collects handles with a content query, both scoped to\n the template cdkDrag is written in. A cdkDragHandle in a caller's row template resolves no\n parent and, because that injection is optional, silently does nothing. -->\n <span class=\"drag-handle\" *ngIf=\"dragEnabled\" cdkDragHandle aria-hidden=\"true\"\n data-cy=\"sub-form-drag-handle\">\n <aup-icon [icon]=\"dragHandleIcon\"></aup-icon>\n </span>\n\n <!-- Given `display: contents` under rowLayout=\"custom\", so the projected template's own\n top-level elements become the row's grid items. Never *ngIf'd away for that: recreating it\n would tear down and rebuild the caller's row bindings, which is exactly what the row\n context memoisation exists to prevent. -->\n <div class=\"content\">\n <ng-container *ngIf=\"rowTemplate\"\n [ngTemplateOutlet]=\"rowTemplate.templateRef\"\n [ngTemplateOutletContext]=\"context\"></ng-container>\n </div>\n\n <!-- The default cluster is three flat grid items, one per named cell, so a layout can place\n them independently \u2014 the rail stacks the moves away from remove. -->\n <ng-container *ngIf=\"defaultActionsVisible\">\n <aup-command *ngIf=\"moveButtonsVisible\" class=\"move-command move-up\"\n [command]=\"context.row.moveUpCommand\"\n [face]=\"moveUpFace\" data-cy=\"sub-form-move-up\"></aup-command>\n <aup-command *ngIf=\"moveButtonsVisible\" class=\"move-command move-down\"\n [command]=\"context.row.moveDownCommand\"\n [face]=\"moveDownFace\" data-cy=\"sub-form-move-down\"></aup-command>\n <aup-command *ngIf=\"removable\" class=\"remove\" [command]=\"context.row.removeItemCommand\"\n [face]=\"removeFace\" data-cy=\"sub-form-remove\"></aup-command>\n </ng-container>\n\n <!-- The replacing cluster keeps its wrapper: it is one grid item in the `actions` cell, and an\n ng-container outlet generates no element to place. -->\n <div class=\"actions\" *ngIf=\"customActionsVisible\">\n <ng-container [ngTemplateOutlet]=\"actionsTemplate.templateRef\"\n [ngTemplateOutletContext]=\"context\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-container *ngIf=\"empty\">\n <ng-container *ngIf=\"emptyTemplate; else defaultEmpty\"\n [ngTemplateOutlet]=\"emptyTemplate.templateRef\"></ng-container>\n <ng-template #defaultEmpty>\n <aup-empty-state *ngIf=\"emptyText\" data-cy=\"sub-form-list-empty\">{{emptyText}}</aup-empty-state>\n </ng-template>\n</ng-container>\n\n<ul class=\"list-errors\" *ngIf=\"listErrors.length\" data-cy=\"sub-form-list-errors\">\n <li *ngFor=\"let error of listErrors\">{{error}}</li>\n</ul>\n\n<div class=\"footer\" *ngIf=\"hasAddCommand\">\n <aup-command [command]=\"addCommand\" data-cy=\"sub-form-list-add\"></aup-command>\n</div>\n", styles: [":host{display:block}.rows{display:flex;flex-direction:column;gap:var(--aup-sub-form-row-gap, 8px)}.row{display:grid;grid-template-areas:var(--aup-sub-form-row-areas, var(--resolved-sub-form-row-areas, \"handle content up down actions\"));grid-template-columns:var(--aup-sub-form-row-columns, var(--resolved-sub-form-row-columns, auto auto auto auto auto));grid-template-rows:var(--aup-sub-form-row-rows, var(--resolved-sub-form-row-rows, auto));justify-content:start;align-items:center;gap:0;background:var(--aup-sub-form-row-background, transparent)}.drag-handle{grid-area:handle}.content{grid-area:content}.move-up{grid-area:up}.move-down{grid-area:down}.remove,.actions{grid-area:actions}.drag-handle,.row.has-actions .content{margin-inline-end:var(--aup-sub-form-row-gap, 8px)}.drag-handle{display:flex;align-items:center;cursor:grab;color:#00000061}.drag-handle:active{cursor:grabbing}.content{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--aup-sub-form-row-gap, 8px);min-width:0}.move-up,.move-down,.remove{white-space:nowrap}.actions{display:flex;align-items:center;gap:0;white-space:nowrap}.row.layout-rail{--resolved-sub-form-row-areas: \"up content actions\" \"handle content actions\" \"down content actions\";--resolved-sub-form-row-columns: auto auto auto;--resolved-sub-form-row-rows: auto auto auto}.row.layout-rail .move-up{align-self:start}.row.layout-rail .move-down{align-self:end}.row.layout-rail .drag-handle,.row.layout-rail .move-up,.row.layout-rail .move-down{justify-self:center}.row.layout-rail .move-up,.row.layout-rail .move-down{margin-inline-end:var(--aup-sub-form-row-gap, 8px)}.row.layout-custom{--resolved-sub-form-row-areas: none;--resolved-sub-form-row-columns: none;--resolved-sub-form-row-rows: none}.row.layout-custom .content{display:contents}.row.layout-inline.fill{--resolved-sub-form-row-columns: auto 1fr auto auto auto}.row.layout-rail.fill{--resolved-sub-form-row-columns: auto 1fr auto}.row.buttons-on-demand .move-command{opacity:0;transition:opacity .15s ease-in-out}.row.buttons-on-demand:hover .move-command,.row.buttons-on-demand:focus-within .move-command{opacity:1}.list-errors{margin:var(--aup-sub-form-row-gap, 8px) 0 0;padding-left:1.2em;color:var(--aup-error-color, #f44336);font-size:12px}.footer{display:flex;margin-top:var(--aup-sub-form-row-gap, 8px)}.row.cdk-drag-preview{box-sizing:border-box;border-radius:4px;background:var(--aup-sub-form-row-background, #fff);box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.row.cdk-drag-placeholder{opacity:.4}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.rows.cdk-drop-list-dragging .row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$7.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$7.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$7.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: IconComponent, selector: "aup-icon", inputs: ["icon"] }, { kind: "component", type: CommandComponent, selector: "aup-command", inputs: ["command", "face$", "face", "busyFace$", "busyFace", "alignFace"] }, { kind: "component", type: EmptyStateComponent, selector: "aup-empty-state" }] });
|
|
3675
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: SubFormListComponent, selector: "aup-sub-form-list", inputs: { list: "list", reorder: "reorder", removable$: "removable$", removable: "removable", removeFace: "removeFace", moveUpFace: "moveUpFace", moveDownFace: "moveDownFace", dragHandleIcon: "dragHandleIcon", addCommand: "addCommand", emptyText: "emptyText", dense: "dense", fill: "fill", rowLayout: "rowLayout" }, host: { properties: { "class.dense": "this.dense", "class.fill": "this.fill", "class.buttons-on-demand": "this.buttonsOnDemand", "attr.data-row-layout": "this.rowLayoutAttribute" } }, queries: [{ propertyName: "rowTemplate", first: true, predicate: SubFormRowDirective, descendants: true }, { propertyName: "actionsTemplate", first: true, predicate: SubFormRowActionsDirective, descendants: true }, { propertyName: "emptyTemplate", first: true, predicate: SubFormListEmptyDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<!-- The rows container carries a layout class only for `subgrid`, the one layout that is not laid\n out entirely within a row: this element is the grid whose tracks the rows subgrid. It is safe\n to anchor rules here \u2014 unlike .row, this element is never cloned. -->\n<div class=\"rows\"\n role=\"list\"\n [class.layout-subgrid]=\"subgridLayout\"\n cdkDropList\n [cdkDropListDisabled]=\"!dragEnabled\"\n (cdkDropListDropped)=\"onDropped($event)\"\n data-cy=\"sub-form-rows\">\n\n <!-- The layout classes go on .row, not the host: CDK's drag preview is a deep clone of .row\n appended to <body>, and a rule anchored on the host cannot reach it. Written as discrete\n [class.x] bindings rather than one [ngClass] object literal, which would allocate a fresh\n object on every change-detection pass. -->\n <div class=\"row\"\n role=\"listitem\"\n *ngFor=\"let context of rows; trackBy: trackByRow\"\n [class.layout-inline]=\"inlineLayout\"\n [class.layout-rail]=\"railLayout\"\n [class.layout-custom]=\"customLayout\"\n [class.layout-subgrid]=\"subgridLayout\"\n [class.fill]=\"fill\"\n [class.buttons-on-demand]=\"buttonsOnDemand\"\n [class.has-actions]=\"hasActions\"\n cdkDrag\n [cdkDragDisabled]=\"!dragEnabled\"\n data-cy=\"sub-form-row\">\n\n <!-- Deliberately not focusable and hidden from assistive tech: CDK drag is pointer-only, so a\n focusable handle would take a tab stop and then do nothing. The move buttons are the\n keyboard path, which is why they survive even in reorder=\"drag\" \u2014 and why rowLayout=\"custom\",\n which renders none of them, makes that path the caller's to provide.\n\n It stays library-rendered in every layout because it has to: CdkDragHandle finds its drag\n through the node injector and CdkDrag collects handles with a content query, both scoped to\n the template cdkDrag is written in. A cdkDragHandle in a caller's row template resolves no\n parent and, because that injection is optional, silently does nothing. -->\n <span class=\"drag-handle\" *ngIf=\"dragEnabled\" cdkDragHandle aria-hidden=\"true\"\n data-cy=\"sub-form-drag-handle\">\n <aup-icon [icon]=\"dragHandleIcon\"></aup-icon>\n </span>\n\n <!-- Given `display: contents` under rowLayout=\"custom\", so the projected template's own\n top-level elements become the row's grid items. Never *ngIf'd away for that: recreating it\n would tear down and rebuild the caller's row bindings, which is exactly what the row\n context memoisation exists to prevent. -->\n <div class=\"content\">\n <ng-container *ngIf=\"rowTemplate\"\n [ngTemplateOutlet]=\"rowTemplate.templateRef\"\n [ngTemplateOutletContext]=\"context\"></ng-container>\n </div>\n\n <!-- The default cluster is three flat grid items, one per named cell, so a layout can place\n them independently \u2014 the rail stacks the moves away from remove. -->\n <ng-container *ngIf=\"defaultActionsVisible\">\n <aup-command *ngIf=\"moveButtonsVisible\" class=\"move-command move-up\"\n [command]=\"context.row.moveUpCommand\"\n [face]=\"moveUpFace\" data-cy=\"sub-form-move-up\"></aup-command>\n <aup-command *ngIf=\"moveButtonsVisible\" class=\"move-command move-down\"\n [command]=\"context.row.moveDownCommand\"\n [face]=\"moveDownFace\" data-cy=\"sub-form-move-down\"></aup-command>\n <aup-command *ngIf=\"removable\" class=\"remove\" [command]=\"context.row.removeItemCommand\"\n [face]=\"removeFace\" data-cy=\"sub-form-remove\"></aup-command>\n </ng-container>\n\n <!-- The replacing cluster keeps its wrapper: it is one grid item in the `actions` cell, and an\n ng-container outlet generates no element to place. -->\n <div class=\"actions\" *ngIf=\"customActionsVisible\">\n <ng-container [ngTemplateOutlet]=\"actionsTemplate.templateRef\"\n [ngTemplateOutletContext]=\"context\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-container *ngIf=\"empty\">\n <ng-container *ngIf=\"emptyTemplate; else defaultEmpty\"\n [ngTemplateOutlet]=\"emptyTemplate.templateRef\"></ng-container>\n <ng-template #defaultEmpty>\n <aup-empty-state *ngIf=\"emptyText\" data-cy=\"sub-form-list-empty\">{{emptyText}}</aup-empty-state>\n </ng-template>\n</ng-container>\n\n<ul class=\"list-errors\" *ngIf=\"listErrors.length\" data-cy=\"sub-form-list-errors\">\n <li *ngFor=\"let error of listErrors\">{{error}}</li>\n</ul>\n\n<div class=\"footer\" *ngIf=\"hasAddCommand\">\n <aup-command [command]=\"addCommand\" data-cy=\"sub-form-list-add\"></aup-command>\n</div>\n", styles: [":host{display:block}.rows{display:flex;flex-direction:column;gap:var(--aup-sub-form-row-gap, 8px)}.row{display:grid;grid-template-areas:var(--aup-sub-form-row-areas, var(--resolved-sub-form-row-areas, \"handle content up down actions\"));grid-template-columns:var(--aup-sub-form-row-columns, var(--resolved-sub-form-row-columns, auto auto auto auto auto));grid-template-rows:var(--aup-sub-form-row-rows, var(--resolved-sub-form-row-rows, auto));justify-content:start;align-items:center;gap:0;background:var(--aup-sub-form-row-background, transparent)}.drag-handle{grid-area:handle}.content{grid-area:content}.move-up{grid-area:up}.move-down{grid-area:down}.remove,.actions{grid-area:actions}.drag-handle,.row.has-actions .content{margin-inline-end:var(--aup-sub-form-row-gap, 8px)}.drag-handle{display:flex;align-items:center;cursor:grab;color:#00000061}.drag-handle:active{cursor:grabbing}.content{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--aup-sub-form-row-gap, 8px);min-width:0}.move-up,.move-down,.remove{white-space:nowrap}.actions{display:flex;align-items:center;gap:0;white-space:nowrap}.row.layout-rail{--resolved-sub-form-row-areas: \"up content actions\" \"handle content actions\" \"down content actions\";--resolved-sub-form-row-columns: auto auto auto;--resolved-sub-form-row-rows: auto auto auto}.row.layout-rail .move-up{align-self:start}.row.layout-rail .move-down{align-self:end}.row.layout-rail .drag-handle,.row.layout-rail .move-up,.row.layout-rail .move-down{justify-self:center}.row.layout-rail .move-up,.row.layout-rail .move-down{margin-inline-end:var(--aup-sub-form-row-gap, 8px)}.row.layout-custom{--resolved-sub-form-row-areas: none;--resolved-sub-form-row-columns: none;--resolved-sub-form-row-rows: none}.row.layout-custom .content{display:contents}.rows.layout-subgrid{display:grid;grid-template-columns:[handle-start] auto [handle-end content-start] var(--aup-sub-form-list-columns, 1fr) [content-end up-start] auto [up-end down-start] auto [down-end actions-start] auto [actions-end];row-gap:var(--aup-sub-form-row-gap, 8px);column-gap:var(--aup-sub-form-list-column-gap, var(--aup-sub-form-row-gap, 8px));justify-content:start}.row.layout-subgrid{--resolved-sub-form-row-areas: none;--resolved-sub-form-row-columns: subgrid;--resolved-sub-form-row-rows: none;grid-column:1/-1}.row.layout-subgrid .drag-handle{grid-column:handle-start/handle-end;margin-inline-end:0}.row.layout-subgrid .content{grid-column:content-start/content-end;display:grid;grid-template-columns:subgrid;align-items:center;column-gap:var(--aup-sub-form-list-column-gap, var(--aup-sub-form-row-gap, 8px))}.row.layout-subgrid.has-actions .content{margin-inline-end:0}.row.layout-subgrid .move-up{grid-column:up-start/up-end}.row.layout-subgrid .move-down{grid-column:down-start/down-end}.row.layout-subgrid .remove,.row.layout-subgrid .actions{grid-column:actions-start/actions-end}@supports not (grid-template-columns: subgrid){.rows.layout-subgrid{display:flex;flex-direction:column;gap:var(--aup-sub-form-row-gap, 8px)}.row.layout-subgrid{--resolved-sub-form-row-areas: \"handle content up down actions\";--resolved-sub-form-row-columns: auto auto auto auto auto}.row.layout-subgrid .drag-handle{margin-inline-end:var(--aup-sub-form-row-gap, 8px)}.row.layout-subgrid .content{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--aup-sub-form-row-gap, 8px)}.row.layout-subgrid.has-actions .content{margin-inline-end:var(--aup-sub-form-row-gap, 8px)}}.row.layout-inline.fill{--resolved-sub-form-row-columns: auto 1fr auto auto auto}.row.layout-rail.fill{--resolved-sub-form-row-columns: auto 1fr auto}.row.buttons-on-demand .move-command{opacity:0;transition:opacity .15s ease-in-out}.row.buttons-on-demand:hover .move-command,.row.buttons-on-demand:focus-within .move-command{opacity:1}.list-errors{margin:var(--aup-sub-form-row-gap, 8px) 0 0;padding-left:1.2em;color:var(--aup-error-color, #f44336);font-size:12px}.footer{display:flex;margin-top:var(--aup-sub-form-row-gap, 8px)}.row.cdk-drag-preview{box-sizing:border-box;border-radius:4px;background:var(--aup-sub-form-row-background, #fff);box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.row.cdk-drag-preview.layout-subgrid{grid-template-columns:none;grid-auto-flow:column;justify-content:start;column-gap:var(--aup-sub-form-row-gap, 8px)}.row.cdk-drag-preview.layout-subgrid .drag-handle,.row.cdk-drag-preview.layout-subgrid .content,.row.cdk-drag-preview.layout-subgrid .move-up,.row.cdk-drag-preview.layout-subgrid .move-down,.row.cdk-drag-preview.layout-subgrid .remove,.row.cdk-drag-preview.layout-subgrid .actions{grid-area:auto}.row.cdk-drag-preview.layout-subgrid .content{grid-template-columns:none;grid-auto-flow:column;column-gap:var(--aup-sub-form-row-gap, 8px)}.row.cdk-drag-placeholder{opacity:.4}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.rows.cdk-drop-list-dragging .row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"], dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$7.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i2$7.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i2$7.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "component", type: IconComponent, selector: "aup-icon", inputs: ["icon"] }, { kind: "component", type: CommandComponent, selector: "aup-command", inputs: ["command", "face$", "face", "busyFace$", "busyFace", "alignFace"] }, { kind: "component", type: EmptyStateComponent, selector: "aup-empty-state" }] });
|
|
3655
3676
|
}
|
|
3656
3677
|
__decorate([
|
|
3657
3678
|
Proxify(),
|
|
@@ -3667,7 +3688,7 @@ __decorate([
|
|
|
3667
3688
|
], SubFormListComponent.prototype, "addCommand", null);
|
|
3668
3689
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: SubFormListComponent, decorators: [{
|
|
3669
3690
|
type: Component,
|
|
3670
|
-
args: [{ selector: 'aup-sub-form-list', template: "<div class=\"rows\"\n role=\"list\"\n cdkDropList\n [cdkDropListDisabled]=\"!dragEnabled\"\n (cdkDropListDropped)=\"onDropped($event)\"\n data-cy=\"sub-form-rows\">\n\n <!-- The layout classes go on .row, not the host: CDK's drag preview is a deep clone of .row\n appended to <body>, and a rule anchored on the host cannot reach it. Written as discrete\n [class.x] bindings rather than one [ngClass] object literal, which would allocate a fresh\n object on every change-detection pass. -->\n <div class=\"row\"\n role=\"listitem\"\n *ngFor=\"let context of rows; trackBy: trackByRow\"\n [class.layout-inline]=\"inlineLayout\"\n [class.layout-rail]=\"railLayout\"\n [class.layout-custom]=\"customLayout\"\n [class.fill]=\"fill\"\n [class.buttons-on-demand]=\"buttonsOnDemand\"\n [class.has-actions]=\"hasActions\"\n cdkDrag\n [cdkDragDisabled]=\"!dragEnabled\"\n data-cy=\"sub-form-row\">\n\n <!-- Deliberately not focusable and hidden from assistive tech: CDK drag is pointer-only, so a\n focusable handle would take a tab stop and then do nothing. The move buttons are the\n keyboard path, which is why they survive even in reorder=\"drag\" \u2014 and why rowLayout=\"custom\",\n which renders none of them, makes that path the caller's to provide.\n\n It stays library-rendered in every layout because it has to: CdkDragHandle finds its drag\n through the node injector and CdkDrag collects handles with a content query, both scoped to\n the template cdkDrag is written in. A cdkDragHandle in a caller's row template resolves no\n parent and, because that injection is optional, silently does nothing. -->\n <span class=\"drag-handle\" *ngIf=\"dragEnabled\" cdkDragHandle aria-hidden=\"true\"\n data-cy=\"sub-form-drag-handle\">\n <aup-icon [icon]=\"dragHandleIcon\"></aup-icon>\n </span>\n\n <!-- Given `display: contents` under rowLayout=\"custom\", so the projected template's own\n top-level elements become the row's grid items. Never *ngIf'd away for that: recreating it\n would tear down and rebuild the caller's row bindings, which is exactly what the row\n context memoisation exists to prevent. -->\n <div class=\"content\">\n <ng-container *ngIf=\"rowTemplate\"\n [ngTemplateOutlet]=\"rowTemplate.templateRef\"\n [ngTemplateOutletContext]=\"context\"></ng-container>\n </div>\n\n <!-- The default cluster is three flat grid items, one per named cell, so a layout can place\n them independently \u2014 the rail stacks the moves away from remove. -->\n <ng-container *ngIf=\"defaultActionsVisible\">\n <aup-command *ngIf=\"moveButtonsVisible\" class=\"move-command move-up\"\n [command]=\"context.row.moveUpCommand\"\n [face]=\"moveUpFace\" data-cy=\"sub-form-move-up\"></aup-command>\n <aup-command *ngIf=\"moveButtonsVisible\" class=\"move-command move-down\"\n [command]=\"context.row.moveDownCommand\"\n [face]=\"moveDownFace\" data-cy=\"sub-form-move-down\"></aup-command>\n <aup-command *ngIf=\"removable\" class=\"remove\" [command]=\"context.row.removeItemCommand\"\n [face]=\"removeFace\" data-cy=\"sub-form-remove\"></aup-command>\n </ng-container>\n\n <!-- The replacing cluster keeps its wrapper: it is one grid item in the `actions` cell, and an\n ng-container outlet generates no element to place. -->\n <div class=\"actions\" *ngIf=\"customActionsVisible\">\n <ng-container [ngTemplateOutlet]=\"actionsTemplate.templateRef\"\n [ngTemplateOutletContext]=\"context\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-container *ngIf=\"empty\">\n <ng-container *ngIf=\"emptyTemplate; else defaultEmpty\"\n [ngTemplateOutlet]=\"emptyTemplate.templateRef\"></ng-container>\n <ng-template #defaultEmpty>\n <aup-empty-state *ngIf=\"emptyText\" data-cy=\"sub-form-list-empty\">{{emptyText}}</aup-empty-state>\n </ng-template>\n</ng-container>\n\n<ul class=\"list-errors\" *ngIf=\"listErrors.length\" data-cy=\"sub-form-list-errors\">\n <li *ngFor=\"let error of listErrors\">{{error}}</li>\n</ul>\n\n<div class=\"footer\" *ngIf=\"hasAddCommand\">\n <aup-command [command]=\"addCommand\" data-cy=\"sub-form-list-add\"></aup-command>\n</div>\n", styles: [":host{display:block}.rows{display:flex;flex-direction:column;gap:var(--aup-sub-form-row-gap, 8px)}.row{display:grid;grid-template-areas:var(--aup-sub-form-row-areas, var(--resolved-sub-form-row-areas, \"handle content up down actions\"));grid-template-columns:var(--aup-sub-form-row-columns, var(--resolved-sub-form-row-columns, auto auto auto auto auto));grid-template-rows:var(--aup-sub-form-row-rows, var(--resolved-sub-form-row-rows, auto));justify-content:start;align-items:center;gap:0;background:var(--aup-sub-form-row-background, transparent)}.drag-handle{grid-area:handle}.content{grid-area:content}.move-up{grid-area:up}.move-down{grid-area:down}.remove,.actions{grid-area:actions}.drag-handle,.row.has-actions .content{margin-inline-end:var(--aup-sub-form-row-gap, 8px)}.drag-handle{display:flex;align-items:center;cursor:grab;color:#00000061}.drag-handle:active{cursor:grabbing}.content{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--aup-sub-form-row-gap, 8px);min-width:0}.move-up,.move-down,.remove{white-space:nowrap}.actions{display:flex;align-items:center;gap:0;white-space:nowrap}.row.layout-rail{--resolved-sub-form-row-areas: \"up content actions\" \"handle content actions\" \"down content actions\";--resolved-sub-form-row-columns: auto auto auto;--resolved-sub-form-row-rows: auto auto auto}.row.layout-rail .move-up{align-self:start}.row.layout-rail .move-down{align-self:end}.row.layout-rail .drag-handle,.row.layout-rail .move-up,.row.layout-rail .move-down{justify-self:center}.row.layout-rail .move-up,.row.layout-rail .move-down{margin-inline-end:var(--aup-sub-form-row-gap, 8px)}.row.layout-custom{--resolved-sub-form-row-areas: none;--resolved-sub-form-row-columns: none;--resolved-sub-form-row-rows: none}.row.layout-custom .content{display:contents}.row.layout-inline.fill{--resolved-sub-form-row-columns: auto 1fr auto auto auto}.row.layout-rail.fill{--resolved-sub-form-row-columns: auto 1fr auto}.row.buttons-on-demand .move-command{opacity:0;transition:opacity .15s ease-in-out}.row.buttons-on-demand:hover .move-command,.row.buttons-on-demand:focus-within .move-command{opacity:1}.list-errors{margin:var(--aup-sub-form-row-gap, 8px) 0 0;padding-left:1.2em;color:var(--aup-error-color, #f44336);font-size:12px}.footer{display:flex;margin-top:var(--aup-sub-form-row-gap, 8px)}.row.cdk-drag-preview{box-sizing:border-box;border-radius:4px;background:var(--aup-sub-form-row-background, #fff);box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.row.cdk-drag-placeholder{opacity:.4}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.rows.cdk-drop-list-dragging .row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
3691
|
+
args: [{ selector: 'aup-sub-form-list', template: "<!-- The rows container carries a layout class only for `subgrid`, the one layout that is not laid\n out entirely within a row: this element is the grid whose tracks the rows subgrid. It is safe\n to anchor rules here \u2014 unlike .row, this element is never cloned. -->\n<div class=\"rows\"\n role=\"list\"\n [class.layout-subgrid]=\"subgridLayout\"\n cdkDropList\n [cdkDropListDisabled]=\"!dragEnabled\"\n (cdkDropListDropped)=\"onDropped($event)\"\n data-cy=\"sub-form-rows\">\n\n <!-- The layout classes go on .row, not the host: CDK's drag preview is a deep clone of .row\n appended to <body>, and a rule anchored on the host cannot reach it. Written as discrete\n [class.x] bindings rather than one [ngClass] object literal, which would allocate a fresh\n object on every change-detection pass. -->\n <div class=\"row\"\n role=\"listitem\"\n *ngFor=\"let context of rows; trackBy: trackByRow\"\n [class.layout-inline]=\"inlineLayout\"\n [class.layout-rail]=\"railLayout\"\n [class.layout-custom]=\"customLayout\"\n [class.layout-subgrid]=\"subgridLayout\"\n [class.fill]=\"fill\"\n [class.buttons-on-demand]=\"buttonsOnDemand\"\n [class.has-actions]=\"hasActions\"\n cdkDrag\n [cdkDragDisabled]=\"!dragEnabled\"\n data-cy=\"sub-form-row\">\n\n <!-- Deliberately not focusable and hidden from assistive tech: CDK drag is pointer-only, so a\n focusable handle would take a tab stop and then do nothing. The move buttons are the\n keyboard path, which is why they survive even in reorder=\"drag\" \u2014 and why rowLayout=\"custom\",\n which renders none of them, makes that path the caller's to provide.\n\n It stays library-rendered in every layout because it has to: CdkDragHandle finds its drag\n through the node injector and CdkDrag collects handles with a content query, both scoped to\n the template cdkDrag is written in. A cdkDragHandle in a caller's row template resolves no\n parent and, because that injection is optional, silently does nothing. -->\n <span class=\"drag-handle\" *ngIf=\"dragEnabled\" cdkDragHandle aria-hidden=\"true\"\n data-cy=\"sub-form-drag-handle\">\n <aup-icon [icon]=\"dragHandleIcon\"></aup-icon>\n </span>\n\n <!-- Given `display: contents` under rowLayout=\"custom\", so the projected template's own\n top-level elements become the row's grid items. Never *ngIf'd away for that: recreating it\n would tear down and rebuild the caller's row bindings, which is exactly what the row\n context memoisation exists to prevent. -->\n <div class=\"content\">\n <ng-container *ngIf=\"rowTemplate\"\n [ngTemplateOutlet]=\"rowTemplate.templateRef\"\n [ngTemplateOutletContext]=\"context\"></ng-container>\n </div>\n\n <!-- The default cluster is three flat grid items, one per named cell, so a layout can place\n them independently \u2014 the rail stacks the moves away from remove. -->\n <ng-container *ngIf=\"defaultActionsVisible\">\n <aup-command *ngIf=\"moveButtonsVisible\" class=\"move-command move-up\"\n [command]=\"context.row.moveUpCommand\"\n [face]=\"moveUpFace\" data-cy=\"sub-form-move-up\"></aup-command>\n <aup-command *ngIf=\"moveButtonsVisible\" class=\"move-command move-down\"\n [command]=\"context.row.moveDownCommand\"\n [face]=\"moveDownFace\" data-cy=\"sub-form-move-down\"></aup-command>\n <aup-command *ngIf=\"removable\" class=\"remove\" [command]=\"context.row.removeItemCommand\"\n [face]=\"removeFace\" data-cy=\"sub-form-remove\"></aup-command>\n </ng-container>\n\n <!-- The replacing cluster keeps its wrapper: it is one grid item in the `actions` cell, and an\n ng-container outlet generates no element to place. -->\n <div class=\"actions\" *ngIf=\"customActionsVisible\">\n <ng-container [ngTemplateOutlet]=\"actionsTemplate.templateRef\"\n [ngTemplateOutletContext]=\"context\"></ng-container>\n </div>\n </div>\n</div>\n\n<ng-container *ngIf=\"empty\">\n <ng-container *ngIf=\"emptyTemplate; else defaultEmpty\"\n [ngTemplateOutlet]=\"emptyTemplate.templateRef\"></ng-container>\n <ng-template #defaultEmpty>\n <aup-empty-state *ngIf=\"emptyText\" data-cy=\"sub-form-list-empty\">{{emptyText}}</aup-empty-state>\n </ng-template>\n</ng-container>\n\n<ul class=\"list-errors\" *ngIf=\"listErrors.length\" data-cy=\"sub-form-list-errors\">\n <li *ngFor=\"let error of listErrors\">{{error}}</li>\n</ul>\n\n<div class=\"footer\" *ngIf=\"hasAddCommand\">\n <aup-command [command]=\"addCommand\" data-cy=\"sub-form-list-add\"></aup-command>\n</div>\n", styles: [":host{display:block}.rows{display:flex;flex-direction:column;gap:var(--aup-sub-form-row-gap, 8px)}.row{display:grid;grid-template-areas:var(--aup-sub-form-row-areas, var(--resolved-sub-form-row-areas, \"handle content up down actions\"));grid-template-columns:var(--aup-sub-form-row-columns, var(--resolved-sub-form-row-columns, auto auto auto auto auto));grid-template-rows:var(--aup-sub-form-row-rows, var(--resolved-sub-form-row-rows, auto));justify-content:start;align-items:center;gap:0;background:var(--aup-sub-form-row-background, transparent)}.drag-handle{grid-area:handle}.content{grid-area:content}.move-up{grid-area:up}.move-down{grid-area:down}.remove,.actions{grid-area:actions}.drag-handle,.row.has-actions .content{margin-inline-end:var(--aup-sub-form-row-gap, 8px)}.drag-handle{display:flex;align-items:center;cursor:grab;color:#00000061}.drag-handle:active{cursor:grabbing}.content{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--aup-sub-form-row-gap, 8px);min-width:0}.move-up,.move-down,.remove{white-space:nowrap}.actions{display:flex;align-items:center;gap:0;white-space:nowrap}.row.layout-rail{--resolved-sub-form-row-areas: \"up content actions\" \"handle content actions\" \"down content actions\";--resolved-sub-form-row-columns: auto auto auto;--resolved-sub-form-row-rows: auto auto auto}.row.layout-rail .move-up{align-self:start}.row.layout-rail .move-down{align-self:end}.row.layout-rail .drag-handle,.row.layout-rail .move-up,.row.layout-rail .move-down{justify-self:center}.row.layout-rail .move-up,.row.layout-rail .move-down{margin-inline-end:var(--aup-sub-form-row-gap, 8px)}.row.layout-custom{--resolved-sub-form-row-areas: none;--resolved-sub-form-row-columns: none;--resolved-sub-form-row-rows: none}.row.layout-custom .content{display:contents}.rows.layout-subgrid{display:grid;grid-template-columns:[handle-start] auto [handle-end content-start] var(--aup-sub-form-list-columns, 1fr) [content-end up-start] auto [up-end down-start] auto [down-end actions-start] auto [actions-end];row-gap:var(--aup-sub-form-row-gap, 8px);column-gap:var(--aup-sub-form-list-column-gap, var(--aup-sub-form-row-gap, 8px));justify-content:start}.row.layout-subgrid{--resolved-sub-form-row-areas: none;--resolved-sub-form-row-columns: subgrid;--resolved-sub-form-row-rows: none;grid-column:1/-1}.row.layout-subgrid .drag-handle{grid-column:handle-start/handle-end;margin-inline-end:0}.row.layout-subgrid .content{grid-column:content-start/content-end;display:grid;grid-template-columns:subgrid;align-items:center;column-gap:var(--aup-sub-form-list-column-gap, var(--aup-sub-form-row-gap, 8px))}.row.layout-subgrid.has-actions .content{margin-inline-end:0}.row.layout-subgrid .move-up{grid-column:up-start/up-end}.row.layout-subgrid .move-down{grid-column:down-start/down-end}.row.layout-subgrid .remove,.row.layout-subgrid .actions{grid-column:actions-start/actions-end}@supports not (grid-template-columns: subgrid){.rows.layout-subgrid{display:flex;flex-direction:column;gap:var(--aup-sub-form-row-gap, 8px)}.row.layout-subgrid{--resolved-sub-form-row-areas: \"handle content up down actions\";--resolved-sub-form-row-columns: auto auto auto auto auto}.row.layout-subgrid .drag-handle{margin-inline-end:var(--aup-sub-form-row-gap, 8px)}.row.layout-subgrid .content{display:flex;flex-wrap:wrap;align-items:flex-start;gap:var(--aup-sub-form-row-gap, 8px)}.row.layout-subgrid.has-actions .content{margin-inline-end:var(--aup-sub-form-row-gap, 8px)}}.row.layout-inline.fill{--resolved-sub-form-row-columns: auto 1fr auto auto auto}.row.layout-rail.fill{--resolved-sub-form-row-columns: auto 1fr auto}.row.buttons-on-demand .move-command{opacity:0;transition:opacity .15s ease-in-out}.row.buttons-on-demand:hover .move-command,.row.buttons-on-demand:focus-within .move-command{opacity:1}.list-errors{margin:var(--aup-sub-form-row-gap, 8px) 0 0;padding-left:1.2em;color:var(--aup-error-color, #f44336);font-size:12px}.footer{display:flex;margin-top:var(--aup-sub-form-row-gap, 8px)}.row.cdk-drag-preview{box-sizing:border-box;border-radius:4px;background:var(--aup-sub-form-row-background, #fff);box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.row.cdk-drag-preview.layout-subgrid{grid-template-columns:none;grid-auto-flow:column;justify-content:start;column-gap:var(--aup-sub-form-row-gap, 8px)}.row.cdk-drag-preview.layout-subgrid .drag-handle,.row.cdk-drag-preview.layout-subgrid .content,.row.cdk-drag-preview.layout-subgrid .move-up,.row.cdk-drag-preview.layout-subgrid .move-down,.row.cdk-drag-preview.layout-subgrid .remove,.row.cdk-drag-preview.layout-subgrid .actions{grid-area:auto}.row.cdk-drag-preview.layout-subgrid .content{grid-template-columns:none;grid-auto-flow:column;column-gap:var(--aup-sub-form-row-gap, 8px)}.row.cdk-drag-placeholder{opacity:.4}.cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)}.rows.cdk-drop-list-dragging .row:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}\n"] }]
|
|
3671
3692
|
}], ctorParameters: function () { return []; }, propDecorators: { list: [{
|
|
3672
3693
|
type: Input
|
|
3673
3694
|
}], reorder: [{
|
|
@@ -3731,11 +3752,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImpor
|
|
|
3731
3752
|
INLINE: 'inline',
|
|
3732
3753
|
/** `up` / `handle` / `down` stacked in a leading rail, content beside it, actions trailing. */
|
|
3733
3754
|
RAIL: 'rail',
|
|
3755
|
+
/**
|
|
3756
|
+
* One line like {@link INLINE}, but the whole list is a single grid and every row subgrids it,
|
|
3757
|
+
* so a column is sized against its own content in *every* row rather than against the widest
|
|
3758
|
+
* cell in each row independently. Cells hug and still line up, which no per-row layout can do:
|
|
3759
|
+
* separate grids can only be aligned by giving each the same tracks, and equal tracks are as
|
|
3760
|
+
* wide as the widest cell in the row.
|
|
3761
|
+
*
|
|
3762
|
+
* The consumer supplies the content tracks as `--aup-sub-form-list-columns` — one per top-level
|
|
3763
|
+
* element of the row template, in source order, since the cells are auto-placed. The library
|
|
3764
|
+
* composes its own tracks around them and places the handle and the action cluster into those,
|
|
3765
|
+
* so this layout renders everything {@link INLINE} does: the move buttons, remove, an
|
|
3766
|
+
* `aupSubFormRowActions` template, and their faces. Nothing becomes the caller's obligation.
|
|
3767
|
+
*
|
|
3768
|
+
* Two things differ from the row layouts:
|
|
3769
|
+
*
|
|
3770
|
+
* - The gutter between cells is `--aup-sub-form-list-column-gap`, on the list, because the
|
|
3771
|
+
* tracks are the list's — and because the two ways a browser can read a subgrid's own gap
|
|
3772
|
+
* disagree (the spec says the parent's is used, Chrome honours the subgrid's), so one variable
|
|
3773
|
+
* feeding both is the only value that means the same thing either way. `fill` does nothing here
|
|
3774
|
+
* — the track list decides the widths, and a trailing `1fr` track in it is how a row pins its
|
|
3775
|
+
* action cluster to the far edge instead of letting it sit against the content.
|
|
3776
|
+
* - The drag preview cannot subgrid: CDK clones the row into `<body>`, where there is no parent
|
|
3777
|
+
* grid, so `subgrid` computes to `none`. The preview falls back to flowing its cells in one
|
|
3778
|
+
* line sized to themselves — it reads as the row being dragged, but its columns do not line
|
|
3779
|
+
* up with the list underneath it.
|
|
3780
|
+
*/
|
|
3781
|
+
SUBGRID: 'subgrid',
|
|
3734
3782
|
/**
|
|
3735
3783
|
* The caller lays the row out. No preset area map, no library-rendered buttons, and the content
|
|
3736
3784
|
* wrapper is given `display: contents` so the row template's own top-level elements become the
|
|
3737
3785
|
* grid items it writes `grid-area` on.
|
|
3738
3786
|
*
|
|
3787
|
+
* For columns that line up across rows, reach for {@link SUBGRID} first — it keeps the buttons.
|
|
3788
|
+
*
|
|
3739
3789
|
* The drag handle is still rendered whenever `reorder` enables drag — it has to be, since a
|
|
3740
3790
|
* `cdkDragHandle` in a caller's template silently fails to attach — so drag survives a custom
|
|
3741
3791
|
* layout. Two obligations come with that: include a `handle` area in the map (an unknown named
|
|
@@ -9157,9 +9207,9 @@ class NavigationSession extends GarbageCollector {
|
|
|
9157
9207
|
}
|
|
9158
9208
|
/**
|
|
9159
9209
|
* Interruptible sessions are internal housekeeping navigations (e.g. interaction-id
|
|
9160
|
-
* synchronisation)
|
|
9161
|
-
*
|
|
9162
|
-
*
|
|
9210
|
+
* synchronisation). Historically only these queued an overlapping navigation while real
|
|
9211
|
+
* navigations dropped it; ALL overlapping navigations now queue (see
|
|
9212
|
+
* PlaceRouter.handleOverlappingNavigation), so this flag is diagnostic only.
|
|
9163
9213
|
*/
|
|
9164
9214
|
get isInterruptible() {
|
|
9165
9215
|
return this.isInteractionSync;
|
|
@@ -10257,14 +10307,29 @@ class UrlSnapshot {
|
|
|
10257
10307
|
const segments = [...extractPrimaryUrlSegments(newUrlTree)];
|
|
10258
10308
|
const urlSegments = this.getUrlSegmentsForVisitSegment(visitSegment);
|
|
10259
10309
|
const replaceAt = segments.findIndex(segment => segment.path === urlSegments[0].path);
|
|
10310
|
+
if (replaceAt < 0) {
|
|
10311
|
+
// findIndex's -1 would silently splice from the END, replacing unrelated segments.
|
|
10312
|
+
lang.illegalState(`updateVisitSegment: place '${visitSegment.placeDefinition.path}' is not in the url '${this.url}'`);
|
|
10313
|
+
}
|
|
10260
10314
|
// do not use the return value, it's the items that were removed!
|
|
10261
10315
|
segments.splice(replaceAt, urlSegments.length, ...urlSegments);
|
|
10262
10316
|
newUrlTree.root.children.primary.segments = segments;
|
|
10263
10317
|
return new UrlSnapshot(this.urlSerializer, newUrlTree.toString());
|
|
10264
10318
|
}
|
|
10265
10319
|
appendSegment(visitSegment) {
|
|
10266
|
-
//
|
|
10267
|
-
|
|
10320
|
+
// Tree-based, not string concatenation: concatenating onto the raw url appended after any
|
|
10321
|
+
// query string, and an empty route-id segment followed by a child serialises as `//`, which
|
|
10322
|
+
// Angular's parser silently truncates at — losing the child.
|
|
10323
|
+
const newUrlTree = this.urlSerializer.parse(this.url);
|
|
10324
|
+
const segments = [...extractPrimaryUrlSegments(newUrlTree)];
|
|
10325
|
+
if (last(segments)?.path === '') {
|
|
10326
|
+
// An empty trailing segment is an unresolved route id; a child appended after it is
|
|
10327
|
+
// unrepresentable in the URL (see above). Callers must resolve the id first.
|
|
10328
|
+
lang.illegalState(`appendSegment: can't append '${visitSegment.placeDefinition.path}' after an unresolved route id in '${this.url}'`);
|
|
10329
|
+
}
|
|
10330
|
+
segments.push(...this.getUrlSegmentsForVisitSegment(visitSegment));
|
|
10331
|
+
newUrlTree.root.children.primary.segments = segments;
|
|
10332
|
+
return new UrlSnapshot(this.urlSerializer, newUrlTree.toString());
|
|
10268
10333
|
}
|
|
10269
10334
|
getPrimaryUrlSegments() {
|
|
10270
10335
|
return extractPrimaryUrlSegments(this.urlTree);
|
|
@@ -10291,7 +10356,14 @@ class UrlSnapshot {
|
|
|
10291
10356
|
return this.getPrimaryUrlSegments().find(s => s.path === placeDef.path);
|
|
10292
10357
|
}
|
|
10293
10358
|
isLastPlaceInUrl(placeDef) {
|
|
10294
|
-
|
|
10359
|
+
const segments = this.getPrimaryUrlSegments();
|
|
10360
|
+
if (placeDef.hasRouteId()) {
|
|
10361
|
+
// A route-id place occupies TWO segments: its path plus the id slot (which is the empty
|
|
10362
|
+
// string when the id is unset — see getFormattedRouteId). The url terminates at the place
|
|
10363
|
+
// when its path is the second-to-last segment.
|
|
10364
|
+
return segments.length >= 2 && segments[segments.length - 2].path === placeDef.path;
|
|
10365
|
+
}
|
|
10366
|
+
return last(segments)?.path === placeDef.path;
|
|
10295
10367
|
}
|
|
10296
10368
|
createVisitSegmentFor(placeDef) {
|
|
10297
10369
|
return new VisitSegment(placeDef, new ConsolidatedParameterMap(this.getPrimaryUrlSegments()));
|
|
@@ -10648,15 +10720,18 @@ class PlaceRouter extends GarbageCollector {
|
|
|
10648
10720
|
}
|
|
10649
10721
|
}
|
|
10650
10722
|
/**
|
|
10651
|
-
* Handles a navigation triggered while another is already in flight
|
|
10723
|
+
* Handles a navigation triggered while another is already in flight: queue it (coalescing to the
|
|
10724
|
+
* latest) and run it once the in-flight session finishes.
|
|
10652
10725
|
*
|
|
10653
|
-
*
|
|
10654
|
-
* triggering action
|
|
10655
|
-
*
|
|
10656
|
-
*
|
|
10657
|
-
*
|
|
10658
|
-
*
|
|
10659
|
-
*
|
|
10726
|
+
* History: this used to throw `illegalState('Navigation already in progress')` (killed the
|
|
10727
|
+
* triggering action), then dropped real-vs-real collisions as an interim policy pending
|
|
10728
|
+
* production evidence. The evidence arrived: a `navigate()` issued from `onPlaceReady` or a
|
|
10729
|
+
* route-parameter subscription can land while the activating navigation's session is still
|
|
10730
|
+
* settling — dropping it leaves a place that never finishes navigating (e.g. a
|
|
10731
|
+
* redirectToFirstChild-style child that never appears), and the caller can't tell because the
|
|
10732
|
+
* dropped promise resolved normally. Popstate never enters doNavigation (it arrives via router
|
|
10733
|
+
* events -> onPopState), so queueing programmatic navigations behind an in-flight session
|
|
10734
|
+
* preserves user-intent ordering.
|
|
10660
10735
|
*/
|
|
10661
10736
|
handleOverlappingNavigation(visit, runNavigationCommands) {
|
|
10662
10737
|
const current = this.navigationSession;
|
|
@@ -10672,19 +10747,9 @@ class PlaceRouter extends GarbageCollector {
|
|
|
10672
10747
|
incoming: visit?.toDebugString(),
|
|
10673
10748
|
currentUrl: this.urlService.getCurrentRouterUrl(),
|
|
10674
10749
|
};
|
|
10675
|
-
|
|
10676
|
-
|
|
10677
|
-
|
|
10678
|
-
return this.queueNavigation(visit, runNavigationCommands);
|
|
10679
|
-
}
|
|
10680
|
-
// NOTE (interim policy): when a *real* navigation is already in progress we keep the first and
|
|
10681
|
-
// drop the incoming one, logging full context so we can see what actually collides in
|
|
10682
|
-
// production. We deliberately do NOT queue+coalesce here yet - once production logs show which
|
|
10683
|
-
// real-vs-real collisions occur we can decide whether "latest wins (queued)" is the better
|
|
10684
|
-
// behaviour. See the implementation plan for the queue+coalesce alternative.
|
|
10685
|
-
Logger.get(this).warn(`Navigation already in progress ('${current?.name}'); ignoring the incoming navigation. ` +
|
|
10686
|
-
`Review this if it occurs in production - it may need to be queued instead.`, debug);
|
|
10687
|
-
return Promise.resolve();
|
|
10750
|
+
Logger.get(this).warn(`Navigation triggered while session '${current?.name}' is in progress; ` +
|
|
10751
|
+
`queueing the incoming navigation to run once it finishes.`, debug);
|
|
10752
|
+
return this.queueNavigation(visit, runNavigationCommands);
|
|
10688
10753
|
}
|
|
10689
10754
|
queueNavigation(visit, runNavigationCommands) {
|
|
10690
10755
|
const flushAlreadyScheduled = !!this.pendingNavigation;
|
|
@@ -10785,11 +10850,20 @@ class PlaceRouter extends GarbageCollector {
|
|
|
10785
10850
|
session.dispose();
|
|
10786
10851
|
this.navigationSession$.value = null;
|
|
10787
10852
|
// console.log(`### Router Session Finished (was ${session.toString()})`);
|
|
10788
|
-
|
|
10853
|
+
// Snapshot-and-swap: jobs registered DURING the drain (e.g. the interaction-id sync's nested
|
|
10854
|
+
// completion job, or a queued navigation re-queueing) belong to the NEXT session finish. The
|
|
10855
|
+
// old forEach-then-reassign both skipped them (forEach doesn't visit appended items) and then
|
|
10856
|
+
// discarded them.
|
|
10857
|
+
const jobs = this.sessionFinishedJobs;
|
|
10789
10858
|
this.sessionFinishedJobs = [];
|
|
10859
|
+
jobs.forEach((job) => job());
|
|
10790
10860
|
}
|
|
10861
|
+
/**
|
|
10862
|
+
* Runs `func` when the NEXT navigation session finishes — which may be a session that hasn't
|
|
10863
|
+
* started yet (the interaction-id sync registers its completion job before starting the sync
|
|
10864
|
+
* session, and jobs registered while a drain is running belong to the following session).
|
|
10865
|
+
*/
|
|
10791
10866
|
runAfterRoutingSessionFinishes(func) {
|
|
10792
|
-
assert.isTruthy(this.navigationInProgress$);
|
|
10793
10867
|
this.sessionFinishedJobs.push(func);
|
|
10794
10868
|
}
|
|
10795
10869
|
/**
|
|
@@ -10805,14 +10879,21 @@ class PlaceRouter extends GarbageCollector {
|
|
|
10805
10879
|
// console.log(`Navigation active -> ${this.navigationSession.toString()}, sync delayed until finished.`);
|
|
10806
10880
|
// const session = this.navigationSession;
|
|
10807
10881
|
return new Promise((resolve) => {
|
|
10808
|
-
|
|
10882
|
+
const startSyncWhenIdle = () => {
|
|
10883
|
+
if (this.navigationSession) {
|
|
10884
|
+
// A job drained before us (e.g. a queued navigation) already started a new session;
|
|
10885
|
+
// transitioning now would dispose it mid-flight. Re-defer until that one finishes.
|
|
10886
|
+
this.runAfterRoutingSessionFinishes(startSyncWhenIdle);
|
|
10887
|
+
return;
|
|
10888
|
+
}
|
|
10809
10889
|
this.runAfterRoutingSessionFinishes(() => {
|
|
10810
10890
|
onSyncComplete();
|
|
10811
10891
|
resolve();
|
|
10812
10892
|
});
|
|
10813
10893
|
const syncSession = new SynchroniseInteractionContextIdsWithRoute(this.navigationContext, this.urlService.getCurrentRouterUrl(), false);
|
|
10814
10894
|
this.transitionTo(syncSession);
|
|
10815
|
-
}
|
|
10895
|
+
};
|
|
10896
|
+
this.runAfterRoutingSessionFinishes(startSyncWhenIdle);
|
|
10816
10897
|
});
|
|
10817
10898
|
}
|
|
10818
10899
|
else {
|
|
@@ -14263,7 +14344,7 @@ class PlaceGuard {
|
|
|
14263
14344
|
}
|
|
14264
14345
|
else {
|
|
14265
14346
|
// Our visit parameters are all sorted, now check if we should redirect to our child.
|
|
14266
|
-
if (
|
|
14347
|
+
if (this.shouldRedirectToChild(placeDefinition, destUrlSnapshot, sanitisedVisit)) {
|
|
14267
14348
|
if (placeDefinition.children.length < 1) {
|
|
14268
14349
|
lang.illegalState(`redirectToFirstChild set to true, but there were no children `);
|
|
14269
14350
|
}
|
|
@@ -14283,6 +14364,20 @@ class PlaceGuard {
|
|
|
14283
14364
|
return lang.illegalState(`expected component to be an instance of PlaceComponent, got ${activatedRoute.component}`);
|
|
14284
14365
|
}
|
|
14285
14366
|
}
|
|
14367
|
+
/**
|
|
14368
|
+
* Whether this guard pass should append a child segment to the url.
|
|
14369
|
+
*
|
|
14370
|
+
* For a route-id place the redirect must wait until the id is RESOLVED: an empty id followed by
|
|
14371
|
+
* a child is unrepresentable in the url (it serialises as `//`, which Angular's parser silently
|
|
14372
|
+
* truncates at). The check reads the SANITISED visit — the post-remember/default/sanitiser
|
|
14373
|
+
* truth — so a sanitiser-supplied id redirects on the corrected-url pass, and an id supplied
|
|
14374
|
+
* later (e.g. a selection model's auto-selection) redirects on that navigation's guard run.
|
|
14375
|
+
*/
|
|
14376
|
+
shouldRedirectToChild(placeDefinition, destUrlSnapshot, sanitisedVisit) {
|
|
14377
|
+
return placeDefinition.redirectToFirstChild
|
|
14378
|
+
&& destUrlSnapshot.isLastPlaceInUrl(placeDefinition)
|
|
14379
|
+
&& (!placeDefinition.hasRouteId() || sanitisedVisit.hasRouteId());
|
|
14380
|
+
}
|
|
14286
14381
|
/**
|
|
14287
14382
|
* Chooses the child to redirect to when {@link PlaceDefinition.redirectToFirstChild} is set. When
|
|
14288
14383
|
* `rememberLastChild` is enabled (the default) and we have a record of the last active child that is
|