@eherve/angular-material-entity-wizard 22.0.0 → 22.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -18,3 +18,17 @@ wizard.open(options);
18
18
  Each wizard owns one shared `EntityFormSession`; changing a step does not replace the form. Its scoped save policy projects only current-step and always-in-upsert fields, preserves other-step drafts during server hydration, blocks navigation during saves or pending validation and accumulates created/updated results. Component-managed steps use the supplied `markUpdated` callback. The independent modal wrapper retains top-dialog keyboard and focused-input key ownership behavior.
19
19
 
20
20
  Include `@eherve/angular-material-forms/styles.css` once. Public `EntityWizardComponent` supports page or modal display, and `CreateEntityWizardService` opens its own `EntityWizardDialog`. Version `22.0.0` requires `@eherve/angular-material-forms@^22.0.0` and has no dependency on edit-dialog.
21
+
22
+ ### Restoring navigation
23
+
24
+ `CreateEntityWizardOptions` accepts the shared `navigation` options. Each step's stable
25
+ `id` is its `navigation.tab`; child section navigation uses the existing adapters.
26
+ Initial selection applies after record hydration and visible-step computation. Existing
27
+ persisted records can select an allowed visible step; a record without an id retains
28
+ the first-step restriction. Restoration never calls create, update or Continue.
29
+ `stateChanges` and lifecycle-handle navigation update the actual wizard selection,
30
+ respecting pending validation/updating restrictions. User step changes publish `onChange`.
31
+ The forms connection lifecycle (`ready`, `presentationChanged`, `failed`, `beforeClose`)
32
+ also applies to wizard sessions.
33
+
34
+ The optional lifecycle connection `opened(handle)` receives a close-only `requestClose(): Promise<boolean>` handle before asynchronous loading. It supports cancelling loading or failed content through the existing close guards; it does not signal readiness. `ready` remains the rendered-content barrier. Handles from previous openings return `false`.
@@ -79,6 +79,7 @@ var EntityWizardComponent = class EntityWizardComponent {
79
79
  saved: (record, value) => this.hydrateWizard(record, value),
80
80
  hydrate: (record) => this.wizardState.hydrate(this.session.formGroup, record, []),
81
81
  refresh: () => this.refreshWizardState(),
82
+ navigate: () => this.restoreWizardNavigation(),
82
83
  reset: () => {
83
84
  this.wizardIndex.set(0);
84
85
  this.wizardCompleted.set(this.options.wizard.steps.map(() => false));
@@ -143,6 +144,7 @@ var EntityWizardComponent = class EntityWizardComponent {
143
144
  const next = this.wizardVisibleIndices()[this.wizardVisualIndex() + 1];
144
145
  if (next !== void 0) {
145
146
  this.wizardIndex.set(next);
147
+ this.publishWizardNavigation();
146
148
  this.refreshWizardNavigation();
147
149
  }
148
150
  }
@@ -186,6 +188,7 @@ var EntityWizardComponent = class EntityWizardComponent {
186
188
  if (this.session.updating || this.wizardPending || !this.options.wizard || index < 0 || index >= this.options.wizard.steps.length || !this.wizardVisibleIndices().includes(index)) return;
187
189
  if (index > 0 && !this.options.record?._id) return;
188
190
  this.wizardIndex.set(index);
191
+ this.publishWizardNavigation();
189
192
  this.refreshWizardNavigation();
190
193
  }
191
194
  skipWizardStep() {
@@ -244,9 +247,19 @@ var EntityWizardComponent = class EntityWizardComponent {
244
247
  this.session.refreshAllowedActions();
245
248
  this.session.refreshRuntimeState();
246
249
  }
250
+ publishWizardNavigation() {
251
+ this.session.navigationController.selectTab(this.wizardVisualIndex());
252
+ }
253
+ restoreWizardNavigation() {
254
+ const index = this.wizardVisibleIndices()[this.session.navigationController.selectedIndex];
255
+ if (index !== void 0 && !this.session.updating && !this.wizardPending && (index === 0 || !!this.options.record?._id)) this.wizardIndex.set(index);
256
+ this.publishWizardNavigation();
257
+ this.refreshWizardNavigation();
258
+ }
247
259
  refreshWizardState() {
248
260
  const visible = (this.session.renderState().tabs ?? []).flatMap((tab, index) => tab.isVisible ? [index] : []);
249
261
  this.wizardVisibleIndices.set(visible);
262
+ this.restoreWizardNavigation();
250
263
  if (!visible.includes(this.wizardIndex()) && visible.length) this.wizardIndex.set(visible[0]);
251
264
  this.wizardDrafts.set(this.options.wizard.steps.map((_, index) => Object.keys(this.wizardState.project(this.session.formGroup, this.wizardPaths(index), true)).length > 0));
252
265
  this.refreshWizardNavigation();
@@ -1 +1 @@
1
- {"version":3,"file":"eherve-angular-material-entity-wizard.mjs","names":["i1"],"sources":["../../../projects/entity-wizard/src/lib/create-entity-wizard-state.ts","../../../projects/entity-wizard/src/lib/entity-wizard.component.ts","../../../projects/entity-wizard/src/lib/entity-wizard.component.html","../../../projects/entity-wizard/src/lib/entity-wizard-dialog.component.ts","../../../projects/entity-wizard/src/lib/entity-wizard-dialog.component.html","../../../projects/entity-wizard/src/lib/create-entity-wizard.service.ts","../../../projects/entity-wizard/src/lib/create-entity-wizard.types.ts"],"sourcesContent":["import { AbstractControl, FormGroup } from \"@angular/forms\";\nimport {\n EditEntityFormGroup,\n isNonEditable,\n} from \"@eherve/angular-material-forms/core\";\nimport { cloneDeep, get, has, isEqual, set } from \"lodash-es\";\n\n/** Scoped persistence shared by the wizard engine; no host-specific model assumptions. */\nexport class CreateEntityWizardState {\n valid(form: EditEntityFormGroup, paths: string[]): boolean {\n return paths.every((path) => {\n const control = form.getControl(path);\n return (\n !control || control.disabled || (!control.pending && control.valid)\n );\n });\n }\n\n project(\n form: EditEntityFormGroup,\n paths: string[],\n changedOnly: boolean,\n always: string[] = [],\n ): Record<string, unknown> {\n const value: Record<string, unknown> = {};\n for (const path of new Set([...paths, ...always])) {\n const control = form.getControl(path);\n if (!control || isNonEditable(control)) continue;\n const current = control.getRawValue();\n const initial = this.read(form.initialValue, path);\n if (!changedOnly || always.includes(path) || !isEqual(current, initial))\n set(value, path, cloneDeep(current));\n }\n return value;\n }\n\n hydrate(\n form: EditEntityFormGroup,\n record: object,\n submitted: string[],\n ): void {\n const baseline = cloneDeep(form.initialValue);\n const visit = (control: AbstractControl, path: string): void => {\n if (control instanceof FormGroup) {\n for (const [key, child] of Object.entries(control.controls))\n visit(child, path ? `${path}.${key}` : key);\n return;\n }\n const saved = submitted.some(\n (name) => path === name || path.startsWith(`${name}.`),\n );\n const current = control.getRawValue();\n const draft = !isEqual(current, this.read(baseline, path));\n if (saved || !draft) {\n if (has(record, path))\n control.patchValue(cloneDeep(get(record, path)), {\n emitEvent: false,\n });\n if (Object.prototype.hasOwnProperty.call(form.controls, path))\n baseline[path] = cloneDeep(control.getRawValue());\n else set(baseline, path, cloneDeep(control.getRawValue()));\n control.markAsPristine();\n control.markAsUntouched();\n }\n };\n visit(form, \"\");\n form.setInitialValue(baseline);\n }\n\n private read(value: Record<string, unknown>, path: string): unknown {\n return Object.prototype.hasOwnProperty.call(value, path)\n ? value[path]\n : get(value, path);\n }\n}\n","import { CdkStepper } from \"@angular/cdk/stepper\";\nimport { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n signal,\n SimpleChanges,\n ViewChild,\n} from \"@angular/core\";\nimport { FormControl, ReactiveFormsModule, Validators } from \"@angular/forms\";\nimport { MatButtonModule } from \"@angular/material/button\";\nimport { MatIconModule } from \"@angular/material/icon\";\nimport { MatProgressSpinnerModule } from \"@angular/material/progress-spinner\";\nimport { MatStepper, MatStepperModule } from \"@angular/material/stepper\";\nimport { MatTooltipModule } from \"@angular/material/tooltip\";\nimport {\n EditEntityConditionalStateService,\n EditEntityFormBuilderService,\n EditEntityRecord,\n EditEntityRenderService,\n EditEntitySubmitValueService,\n} from \"@eherve/angular-material-forms/core\";\nimport { EntityFormSession } from \"@eherve/angular-material-forms/editor\";\nimport { FormContentComponent } from \"@eherve/angular-material-forms/layout\";\nimport { cloneDeep, get, has, set } from \"lodash-es\";\nimport { CreateEntityWizardState } from \"./create-entity-wizard-state\";\nimport {\n CreateEntityWizardComponentOptions,\n CreateEntityWizardStep,\n} from \"./create-entity-wizard.types\";\n@Component({\n selector: \"ame-entity-wizard\",\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatButtonModule,\n MatIconModule,\n MatProgressSpinnerModule,\n MatTooltipModule,\n FormContentComponent,\n MatStepperModule,\n ],\n providers: [\n EntityFormSession,\n EditEntityConditionalStateService,\n EditEntityFormBuilderService,\n EditEntityRenderService,\n EditEntitySubmitValueService,\n ],\n templateUrl: \"./entity-wizard.component.html\",\n styleUrl: \"./entity-wizard.component.scss\",\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EntityWizardComponent<\n TRecord extends EditEntityRecord = EditEntityRecord,\n >\n implements OnInit, OnChanges, OnDestroy\n{\n @Input({ required: true })\n options!: CreateEntityWizardComponentOptions<TRecord>;\n @Input() displayMode: \"page\" | \"dialog\" = \"page\";\n readonly session = inject<EntityFormSession<TRecord>>(EntityFormSession);\n @Output() readonly result = this.session.result;\n @Output() readonly closeRequest = this.session.closeRequest;\n ngOnInit(): void {\n this.session.options = this.options;\n this.session.displayMode = this.displayMode;\n this.session.policy = {\n valid: () => this.wizardValid,\n value: (create) => this.wizardValue(create),\n patch: (record, value) => this.patchWizardRecord(record, value),\n saved: (record, value) => this.hydrateWizard(record, value),\n hydrate: (record) =>\n this.wizardState.hydrate(this.session.formGroup, record, []),\n refresh: () => this.refreshWizardState(),\n reset: () => {\n this.wizardIndex.set(0);\n this.wizardCompleted.set(this.options.wizard.steps.map(() => false));\n this.wizardVisibleIndices.set([]);\n this.wizardNavigationControls = [];\n },\n componentUpdated: () => this.completeWizardStep(),\n beforeClose: () =>\n this.session.formGroup.setInitialValue(\n this.session.formGroup.initialValue,\n ),\n stickyResult: true,\n };\n void this.session.initialize();\n }\n ngOnChanges(changes: SimpleChanges): void {\n if (changes[\"options\"] && !changes[\"options\"].firstChange) {\n this.session.options = this.options;\n void this.session.initialize();\n }\n }\n ngOnDestroy(): void {\n this.session.destroy();\n }\n requestClose(): Promise<void> {\n return this.session.requestClose();\n }\n refreshPresentation(): void {\n this.session.refreshPresentation();\n }\n submitFromKeyboard(): boolean {\n if (\n !this.options.validateOnEnter ||\n this.session.loading ||\n this.session.updating\n )\n return false;\n void this.wizardNext();\n return true;\n }\n readonly wizardIndex = signal(0);\n readonly wizardDrafts = signal<boolean[]>([]);\n readonly wizardCompleted = signal<boolean[]>([]);\n readonly wizardVisibleIndices = signal<number[]>([]);\n readonly wizardVisualIndex = computed(() =>\n Math.max(0, this.wizardVisibleIndices().indexOf(this.wizardIndex())),\n );\n readonly wizardNavigationBlocked = signal(false);\n readonly wizardLinear = signal(true);\n wizardNavigationControls: FormControl<boolean>[] = [];\n @ViewChild(MatStepper) wizardStepper?: CdkStepper;\n private readonly wizardState = new CreateEntityWizardState();\n get wizardStep(): CreateEntityWizardStep<TRecord> | undefined {\n return this.options?.wizard?.steps[this.wizardIndex()];\n }\n\n get wizardLast(): boolean {\n return this.wizardIndex() === this.wizardVisibleIndices().at(-1);\n }\n\n get wizardPrimaryLabel(): string {\n const wizard = this.options.wizard;\n if (!this.options.record?._id)\n return (\n wizard?.createNextLabel ?? this.session.intl.messages.wizardCreateNext\n );\n return this.wizardLast\n ? (wizard?.finishLabel ?? this.session.intl.messages.wizardFinish)\n : (wizard?.nextLabel ?? this.session.intl.messages.wizardNext);\n }\n\n get wizardExitLabel(): string {\n return this.options.record?._id\n ? (this.options.wizard?.finishLaterLabel ??\n this.session.intl.messages.wizardFinishLater)\n : this.session.cancelLabel;\n }\n\n selectWizardVisualStep(position: number): void {\n const index = this.wizardVisibleIndices()[position];\n if (index !== undefined) this.selectWizardStep(index);\n }\n\n private advanceWizard(): void {\n const next = this.wizardVisibleIndices()[this.wizardVisualIndex() + 1];\n if (next !== undefined) {\n this.wizardIndex.set(next);\n this.refreshWizardNavigation();\n }\n }\n\n private completeWizardStep(): void {\n const completed = [...this.wizardCompleted()];\n completed[this.wizardIndex()] = true;\n this.wizardCompleted.set(completed);\n this.refreshWizardNavigation();\n }\n\n private refreshWizardNavigation(): void {\n if (!this.options?.wizard) return;\n const blocked = this.session.updating || this.wizardPending;\n this.wizardNavigationBlocked.set(blocked);\n const linear = !this.options.record?._id || blocked;\n this.wizardLinear.set(linear);\n if (this.wizardStepper) this.wizardStepper.linear = linear;\n const count = this.options.wizard.steps.length;\n if (this.wizardNavigationControls.length !== count) {\n this.wizardNavigationControls = Array.from(\n { length: count },\n () =>\n new FormControl(false, {\n nonNullable: true,\n validators: Validators.requiredTrue,\n }),\n );\n }\n for (const [index, control] of this.wizardNavigationControls.entries()) {\n control.setValue(\n !blocked && (index !== 0 || !!this.options.record?._id),\n { emitEvent: false },\n );\n }\n // CDK checks these public step properties synchronously when a header is selected.\n // Synchronize immediately, including before Angular's next rendering pass.\n this.wizardStepper?.steps.forEach((step, position) => {\n const index = this.wizardVisibleIndices()[position];\n step.optional = false;\n step.interacted = true;\n step.completed = !blocked && !!this.wizardCompleted()[index];\n step.editable = !blocked && (index === 0 || !!this.options.record?._id);\n });\n }\n\n get wizardValid(): boolean {\n return this.wizardState.valid(this.session.formGroup, [\n ...this.wizardPaths(),\n ...this.wizardAlwaysPaths(),\n ]);\n }\n\n get wizardPending(): boolean {\n return [...this.wizardPaths(), ...this.wizardAlwaysPaths()].some(\n (path) => this.session.formGroup.getControl(path)?.pending,\n );\n }\n\n get wizardUnsaved(): boolean {\n return (\n Object.keys(\n this.wizardState.project(\n this.session.formGroup,\n this.wizardPaths(),\n true,\n ),\n ).length > 0\n );\n }\n\n selectWizardStep(index: number): void {\n if (\n this.session.updating ||\n this.wizardPending ||\n !this.options.wizard ||\n index < 0 ||\n index >= this.options.wizard.steps.length ||\n !this.wizardVisibleIndices().includes(index)\n )\n return;\n if (index > 0 && !this.options.record?._id) return;\n this.wizardIndex.set(index);\n this.refreshWizardNavigation();\n }\n\n skipWizardStep(): void {\n if (\n this.session.updating ||\n this.wizardPending ||\n !this.wizardStep?.optional ||\n !this.options.record?._id\n )\n return;\n if (this.wizardLast) void this.requestClose();\n else this.advanceWizard();\n }\n\n async wizardNext(): Promise<void> {\n if (this.session.updating || !this.options.wizard) return;\n const isCurrent = this.session.captureCurrentOperation();\n if (!this.wizardStep?.componentManaged) {\n for (const path of this.wizardPaths())\n this.session.formGroup.getControl(path)?.markAllAsTouched();\n if (!this.wizardValid) return;\n const previous = this.session.savedResult;\n if (!this.options.record?._id) await this.session.create();\n else if (this.wizardUnsaved) await this.session.update();\n else {\n this.completeWizardStep();\n if (this.wizardLast) await this.requestClose();\n else this.advanceWizard();\n return;\n }\n if (!isCurrent() || previous === this.session.savedResult) return;\n }\n if (this.wizardLast) await this.requestClose();\n else this.advanceWizard();\n }\n\n private wizardPaths(index = this.wizardIndex()): string[] {\n const display = this.options?.displayOptions;\n const tab = display && \"tabs\" in display ? display.tabs[index] : undefined;\n const names = tab\n ? this.session.renderService\n .collectFields(tab.displayOptions)\n .flatMap((field) =>\n field.kind === \"separator\" ||\n field.kind === \"metadata\" ||\n field.kind === \"display\"\n ? []\n : [field.name],\n )\n : [];\n return [\n ...new Set([\n ...names,\n ...(this.options.wizard?.steps[index]?.fields ?? []),\n ]),\n ];\n }\n\n private wizardAlwaysPaths(): string[] {\n return this.session.fields.flatMap((field) =>\n field.kind !== \"separator\" &&\n field.kind !== \"metadata\" &&\n field.kind !== \"display\" &&\n field.alwaysInUpsert\n ? [field.name]\n : [],\n );\n }\n\n private wizardValue(create: boolean): Record<string, unknown> {\n const paths = this.wizardPaths();\n const always = this.wizardAlwaysPaths();\n const value = this.wizardState.project(\n this.session.formGroup,\n paths,\n !create,\n always,\n );\n if (create)\n for (const path of [...paths, ...always]) {\n if (\n !this.session.formGroup.getControl(path) &&\n has(this.options.defaultValues, path)\n )\n set(value, path, cloneDeep(get(this.options.defaultValues, path)));\n }\n return value;\n }\n\n private patchWizardRecord(\n record: TRecord,\n value: Record<string, unknown>,\n ): TRecord {\n const updated = cloneDeep(record);\n for (const path of [...this.wizardPaths(), ...this.wizardAlwaysPaths()]) {\n if (has(value, path)) set(updated, path, cloneDeep(get(value, path)));\n }\n return updated;\n }\n\n private async hydrateWizard(\n record: TRecord,\n value: Record<string, unknown>,\n ): Promise<void> {\n const paths = [...this.wizardPaths(), ...this.wizardAlwaysPaths()].filter(\n (path) => has(value, path),\n );\n this.wizardState.hydrate(this.session.formGroup, record, paths);\n this.completeWizardStep();\n this.session.updated = this.session.formGroup.isUpdated;\n this.session.refreshAllowedActions();\n this.session.refreshRuntimeState();\n }\n\n private refreshWizardState(): void {\n const visible = (this.session.renderState().tabs ?? []).flatMap(\n (tab, index) => (tab.isVisible ? [index] : []),\n );\n this.wizardVisibleIndices.set(visible);\n if (!visible.includes(this.wizardIndex()) && visible.length)\n this.wizardIndex.set(visible[0]);\n this.wizardDrafts.set(\n this.options.wizard.steps.map(\n (_, index) =>\n Object.keys(\n this.wizardState.project(\n this.session.formGroup,\n this.wizardPaths(index),\n true,\n ),\n ).length > 0,\n ),\n );\n this.refreshWizardNavigation();\n }\n}\n","<!-- @format -->\n\n@if (session.loading) {\n <div class=\"edit-entity-loading\">\n <mat-spinner [diameter]=\"72\" />\n <span>{{ session.loadingLabel }}</span>\n </div>\n} @else if (session.errorLabel) {\n <div class=\"edit-entity-empty-state\">\n <mat-icon>info</mat-icon>\n <span>{{ session.errorLabel }}</span>\n\n @if (displayMode === \"dialog\") {\n <button mat-stroked-button type=\"button\" (click)=\"requestClose()\">\n {{ session.closeLabel }}\n </button>\n }\n </div>\n} @else {\n @if (\n session.title ||\n session.subtitle ||\n displayMode === \"dialog\" ||\n session.getActions(\"top\").length\n ) {\n <header\n class=\"edit-entity-title-bar\"\n [class.edit-entity-wizard-header]=\"options.wizard\"\n >\n @if (options.wizard?.icon) {\n <mat-icon>{{ options.wizard?.icon }}</mat-icon>\n }\n <div class=\"edit-entity-title-content\">\n @if (session.title) {\n <h2 [innerHTML]=\"session.title\"></h2>\n }\n @if (session.subtitle) {\n <p [innerHTML]=\"session.subtitle\"></p>\n }\n </div>\n\n <div class=\"edit-entity-title-actions\">\n @for (\n action of session.getActions(\"top\");\n track session.trackRuntimeAction($index, action)\n ) {\n <ng-container\n *ngTemplateOutlet=\"actionTemplate; context: { action }\"\n ></ng-container>\n }\n\n @if (options.showJsonDataButton === true) {\n <button\n mat-icon-button\n type=\"button\"\n [matTooltip]=\"session.intl.messages.showJson\"\n [attr.aria-label]=\"session.intl.messages.showJson\"\n (click)=\"session.openJsonDataDialog()\"\n >\n <mat-icon>file_json</mat-icon>\n </button>\n }\n\n @if (displayMode === \"dialog\") {\n <button\n mat-icon-button\n type=\"button\"\n [attr.aria-label]=\"session.closeLabel\"\n (click)=\"requestClose()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </div>\n </header>\n }\n\n <form class=\"edit-entity-form\" [formGroup]=\"session.formGroup\">\n <main class=\"edit-entity-content\">\n @if (options.wizard; as wizard) {\n <mat-stepper\n class=\"edit-entity-wizard\"\n orientation=\"horizontal\"\n labelPosition=\"end\"\n [linear]=\"wizardLinear()\"\n [selectedIndex]=\"wizardVisualIndex()\"\n (selectionChange)=\"selectWizardVisualStep($event.selectedIndex)\"\n >\n <!-- Material icon context.active also includes completed steps; selection follows the wizard index. -->\n <ng-template matStepperIcon=\"number\" let-index=\"index\">\n <ng-container\n *ngTemplateOutlet=\"\n wizardStateIcon;\n context: { index, active: index === wizardVisualIndex() }\n \"\n ></ng-container>\n </ng-template>\n <ng-template matStepperIcon=\"edit\" let-index=\"index\">\n <ng-container\n *ngTemplateOutlet=\"\n wizardStateIcon;\n context: { index, active: index === wizardVisualIndex() }\n \"\n ></ng-container>\n </ng-template>\n <ng-template matStepperIcon=\"done\" let-index=\"index\">\n <ng-container\n *ngTemplateOutlet=\"\n wizardStateIcon;\n context: { index, active: index === wizardVisualIndex() }\n \"\n ></ng-container>\n </ng-template>\n <ng-template #wizardStateIcon let-index=\"index\" let-active=\"active\">\n <span\n class=\"edit-entity-wizard-state-icon\"\n [class.edit-entity-wizard-state-icon--selected]=\"active\"\n [class.edit-entity-wizard-state-icon--completed]=\"\n !active && wizardCompleted()[wizardVisibleIndices()[index]]\n \"\n >\n @if (\n !active && wizardCompleted()[wizardVisibleIndices()[index]]\n ) {\n <mat-icon>check</mat-icon>\n } @else {\n {{ index + 1 }}\n }\n </span>\n </ng-template>\n @for (index of wizardVisibleIndices(); track index) {\n @let step = wizard.steps[index];\n <mat-step\n [optional]=\"false\"\n [stepControl]=\"wizardNavigationControls[index]\"\n [completed]=\"\n !wizardNavigationBlocked() && wizardCompleted()[index]\n \"\n [editable]=\"\n !wizardNavigationBlocked() &&\n (index === 0 || !!options.record?._id)\n \"\n >\n <ng-template matStepLabel>\n <div\n class=\"edit-entity-wizard-step-label\"\n [class.edit-entity-wizard-step-label--selected]=\"\n index === wizardIndex()\n \"\n >\n <span class=\"edit-entity-wizard-step-name\">{{\n step.label\n }}</span>\n @if (wizardDrafts()[index]) {\n <span\n class=\"edit-entity-wizard-unsaved\"\n [title]=\"\n wizard.unsavedLabel ||\n session.intl.messages.wizardUnsaved\n \"\n >{{\n wizard.unsavedLabel ||\n session.intl.messages.wizardUnsaved\n }}</span\n >\n }\n </div>\n </ng-template>\n <ng-template matStepContent>\n @if (index === wizardIndex()) {\n <header class=\"edit-entity-wizard-content-heading\">\n <div>\n <h3>{{ step.label }}</h3>\n @if (step.description) {\n <p>{{ step.description }}</p>\n }\n </div>\n @if (step.optional && index > 0) {\n <span class=\"edit-entity-wizard-optional\">{{\n wizard.optionalLabel ||\n session.intl.messages.wizardOptional\n }}</span>\n }\n </header>\n <ame-form-content\n [state]=\"\n session.renderState().tabs?.[index]?.renderState || {\n kind: 'empty',\n }\n \"\n [formGroup]=\"session.formGroup\"\n [options]=\"options\"\n [context]=\"session\"\n />\n }\n </ng-template>\n </mat-step>\n }\n </mat-stepper>\n }\n </main>\n </form>\n\n <footer\n class=\"edit-entity-actions\"\n [class.edit-entity-wizard-actions]=\"options.wizard\"\n >\n <div class=\"edit-entity-actions-left\">\n @for (\n action of session.getActions(\"bottom\");\n track session.trackRuntimeAction($index, action)\n ) {\n <ng-container\n *ngTemplateOutlet=\"actionTemplate; context: { action }\"\n ></ng-container>\n }\n </div>\n\n <div class=\"edit-entity-actions-right\">\n @for (\n action of session.getActions(\"bottom-end\");\n track session.trackRuntimeAction($index, action)\n ) {\n <ng-container\n *ngTemplateOutlet=\"actionTemplate; context: { action }\"\n ></ng-container>\n }\n\n @if (options.wizard; as wizard) {\n <button\n mat-stroked-button\n type=\"button\"\n [disabled]=\"session.updating\"\n (click)=\"requestClose()\"\n >\n {{ wizardExitLabel }}\n </button>\n @if (wizardStep?.optional && options.record?._id) {\n <button\n mat-raised-button\n class=\"edit-entity-wizard-skip\"\n type=\"button\"\n [disabled]=\"wizardNavigationBlocked()\"\n (click)=\"skipWizardStep()\"\n >\n {{ wizard.skipLabel || session.intl.messages.wizardSkip }}\n </button>\n }\n <button\n mat-raised-button\n color=\"secondary\"\n type=\"button\"\n [disabled]=\"\n session.updating || (!wizardStep?.componentManaged && !wizardValid)\n \"\n (click)=\"wizardNext()\"\n >\n {{ wizardPrimaryLabel }}\n </button>\n }\n </div>\n </footer>\n\n @if (session.updating) {\n <div class=\"edit-entity-updating\">\n <mat-spinner [diameter]=\"72\" />\n </div>\n }\n}\n\n<ng-template #actionTemplate let-action=\"action\">\n @if (session.isRuntimeButtonAction(action)) {\n @if (action.buttonType === \"raised\") {\n <button\n class=\"action-btn\"\n mat-raised-button\n type=\"button\"\n [style.--action-color]=\"action.contrastColor\"\n [style.--action-background-color]=\"action.color\"\n [disabled]=\"session.updating || action.isDisabled\"\n [matTooltip]=\"action.tooltip || ''\"\n (click)=\"session.handleAction(action)\"\n >\n @if (action.icon) {\n <mat-icon>{{ action.icon }}</mat-icon>\n }\n <span [innerHTML]=\"action.label\"></span>\n </button>\n } @else {\n <button\n class=\"action-btn\"\n mat-button\n type=\"button\"\n [style.--action-color]=\"action.color\"\n [disabled]=\"session.updating || action.isDisabled\"\n [matTooltip]=\"action.tooltip || ''\"\n (click)=\"session.handleAction(action)\"\n >\n @if (action.icon) {\n <mat-icon>{{ action.icon }}</mat-icon>\n }\n <span [innerHTML]=\"action.label\"></span>\n </button>\n }\n } @else if (session.isRuntimeComponentAction(action)) {\n <ng-container\n *ngComponentOutlet=\"action.component; inputs: action.componentInputs\"\n ></ng-container>\n }\n</ng-template>\n","import {\n ChangeDetectionStrategy,\n Component,\n Inject,\n ViewChild,\n} from \"@angular/core\";\nimport {\n MAT_DIALOG_DATA,\n MatDialog,\n MatDialogRef,\n} from \"@angular/material/dialog\";\nimport {\n EditEntityRecord,\n EditEntityDialogResult,\n} from \"@eherve/angular-material-forms/core\";\nimport { EntityDialogKeyboardHost } from \"@eherve/angular-material-forms/editor\";\nimport { EntityWizardComponent } from \"./entity-wizard.component\";\nimport { CreateEntityWizardComponentOptions } from \"./create-entity-wizard.types\";\n@Component({\n selector: \"ame-entity-wizard-dialog\",\n imports: [EntityWizardComponent],\n templateUrl: \"./entity-wizard-dialog.component.html\",\n styleUrl: \"./entity-wizard-dialog.component.scss\",\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EntityWizardDialog<\n TRecord extends EditEntityRecord = EditEntityRecord,\n> extends EntityDialogKeyboardHost<TRecord, EntityWizardDialog<TRecord>> {\n @ViewChild(EntityWizardComponent)\n protected override editEntityComponent?: EntityWizardComponent<TRecord>;\n constructor(\n @Inject(MAT_DIALOG_DATA)\n public readonly data: CreateEntityWizardComponentOptions<TRecord>,\n dialogRef: MatDialogRef<\n EntityWizardDialog<TRecord>,\n EditEntityDialogResult<TRecord>\n >,\n matDialog: MatDialog,\n ) {\n super(dialogRef, matDialog);\n }\n}\n","<ame-entity-wizard\n [options]=\"data\"\n displayMode=\"dialog\"\n (closeRequest)=\"close($event)\"\n/>\n","import { inject, Injectable } from \"@angular/core\";\nimport { MatDialogRef } from \"@angular/material/dialog\";\nimport {\n EditEntityDialogResult,\n EditEntityRecord,\n} from \"@eherve/angular-material-forms/core\";\nimport {\n EntityDialogLauncher,\n EntityDialogOpenConfig,\n} from \"@eherve/angular-material-forms/editor\";\nimport { CreateEntityWizardComponentOptions } from \"./create-entity-wizard.types\";\nimport { EntityWizardDialog } from \"./entity-wizard-dialog.component\";\nexport type CreateEntityWizardOpenConfig<TRecord extends EditEntityRecord> =\n EntityDialogOpenConfig<TRecord>;\n@Injectable({ providedIn: \"root\" })\nexport class CreateEntityWizardService {\n private readonly launcher = inject(EntityDialogLauncher);\n open<TRecord extends EditEntityRecord>(\n options: CreateEntityWizardComponentOptions<TRecord>,\n config: CreateEntityWizardOpenConfig<TRecord> = {},\n ): MatDialogRef<\n EntityWizardDialog<TRecord>,\n EditEntityDialogResult<TRecord>\n > {\n if (!options.wizard?.steps.length || !(\"tabs\" in options.displayOptions))\n throw new Error(\n \"Use createEntityWizardOptions before opening a creation wizard\",\n );\n return this.launcher.open(EntityWizardDialog<TRecord>, options, config);\n }\n}\n","import {\n EditEntityComponentOptions,\n EditEntityRecord,\n EditEntityTabDisplayOptions,\n} from \"@eherve/angular-material-forms/core\";\n\nexport interface CreateEntityWizardStep<\n TRecord extends EditEntityRecord = EditEntityRecord,\n> {\n id: string;\n label: string;\n description?: string;\n icon?: string;\n optional?: boolean;\n displayOptions: EditEntityTabDisplayOptions<TRecord>;\n /** Explicit control paths, including controls prepared by the host. Defaults to rendered fields. */\n fields?: string[];\n /** This step's components persist their own mutations; Continue never submits the form. */\n componentManaged?: boolean;\n}\n\nexport interface CreateEntityWizardConfiguration<\n TRecord extends EditEntityRecord = EditEntityRecord,\n> {\n steps: CreateEntityWizardStep<TRecord>[];\n icon?: string;\n nextLabel?: string;\n createNextLabel?: string;\n skipLabel?: string;\n finishLaterLabel?: string;\n finishLabel?: string;\n optionalLabel?: string;\n unsavedLabel?: string;\n}\n\nexport interface CreateEntityWizardComponentOptions<\n TRecord extends EditEntityRecord = EditEntityRecord,\n> extends EditEntityComponentOptions<TRecord> {\n wizard: CreateEntityWizardConfiguration<TRecord>;\n}\n\nexport type CreateEntityWizardOptions<\n TRecord extends EditEntityRecord = EditEntityRecord,\n> = Omit<\n EditEntityComponentOptions<TRecord>,\n \"displayOptions\" | \"record\" | \"wizard\" | \"navigation\"\n> &\n CreateEntityWizardConfiguration<TRecord>;\n\n/** Normalize before decorating access/fields. The opening service uses this exact options object. */\nexport function createEntityWizardOptions<TRecord extends EditEntityRecord>(\n options: CreateEntityWizardOptions<TRecord>,\n): CreateEntityWizardComponentOptions<TRecord> {\n if (!options.steps.length)\n throw new Error(\"A creation wizard requires at least one step\");\n const {\n steps,\n icon,\n nextLabel,\n createNextLabel,\n skipLabel,\n finishLaterLabel,\n finishLabel,\n optionalLabel,\n unsavedLabel,\n ...base\n } = options;\n return {\n ...base,\n service: base.service\n ? { ...base.service, closeOnUpsert: false }\n : undefined,\n wizard: {\n steps,\n icon,\n nextLabel,\n createNextLabel,\n skipLabel,\n finishLaterLabel,\n finishLabel,\n optionalLabel,\n unsavedLabel,\n },\n displayOptions: {\n tabs: steps.map((step) => ({\n id: step.id,\n label: step.label,\n icon: step.icon,\n displayOptions: step.displayOptions,\n })),\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQA,IAAa,0BAAb,MAAoC;CAClC,MAAM,MAA2B,OAAe;EAC9C,OAAO,MAAM,OAAO,SAAQ;GAC1B,MAAM,UAAU,KAAK,WAAW,IAAI;GACpC,OACE,CAAC,WAAW,QAAQ,YAAa,CAAC,QAAQ,WAAW,QAAQ;EAEjE,CAAC;CACH;CAEA,QACE,MACA,OACA,aACA,SAAmB,CAAA,GAAE;EAErB,MAAM,QAAiC,CAAA;EACvC,KAAK,MAAM,wBAAQ,IAAI,IAAI,CAAC,GAAG,OAAO,GAAG,MAAM,CAAC,GAAG;GACjD,MAAM,UAAU,KAAK,WAAW,IAAI;GACpC,IAAI,CAAC,WAAW,cAAc,OAAO,GAAG;GACxC,MAAM,UAAU,QAAQ,YAAW;GACnC,MAAM,UAAU,KAAK,KAAK,KAAK,cAAc,IAAI;GACjD,IAAI,CAAC,eAAe,OAAO,SAAS,IAAI,KAAK,CAAC,QAAQ,SAAS,OAAO,GACpE,IAAI,OAAO,MAAM,UAAU,OAAO,CAAC;EACvC;EACA,OAAO;CACT;CAEA,QACE,MACA,QACA,WAAmB;EAEnB,MAAM,WAAW,UAAU,KAAK,YAAY;EAC5C,MAAM,SAAS,SAA0B,SAAsB;GAC7D,IAAI,mBAAmB,WAAW;IAChC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAA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ources":["../../../projects/entity-wizard/src/lib/create-entity-wizard-state.ts","../../../projects/entity-wizard/src/lib/entity-wizard.component.ts","../../../projects/entity-wizard/src/lib/entity-wizard.component.html","../../../projects/entity-wizard/src/lib/entity-wizard-dialog.component.ts","../../../projects/entity-wizard/src/lib/entity-wizard-dialog.component.html","../../../projects/entity-wizard/src/lib/create-entity-wizard.service.ts","../../../projects/entity-wizard/src/lib/create-entity-wizard.types.ts"],"sourcesContent":["import { AbstractControl, FormGroup } from \"@angular/forms\";\nimport {\n EditEntityFormGroup,\n isNonEditable,\n} from \"@eherve/angular-material-forms/core\";\nimport { cloneDeep, get, has, isEqual, set } from \"lodash-es\";\n\n/** Scoped persistence shared by the wizard engine; no host-specific model assumptions. */\nexport class CreateEntityWizardState {\n valid(form: EditEntityFormGroup, paths: string[]): boolean {\n return paths.every((path) => {\n const control = form.getControl(path);\n return (\n !control || control.disabled || (!control.pending && control.valid)\n );\n });\n }\n\n project(\n form: EditEntityFormGroup,\n paths: string[],\n changedOnly: boolean,\n always: string[] = [],\n ): Record<string, unknown> {\n const value: Record<string, unknown> = {};\n for (const path of new Set([...paths, ...always])) {\n const control = form.getControl(path);\n if (!control || isNonEditable(control)) continue;\n const current = control.getRawValue();\n const initial = this.read(form.initialValue, path);\n if (!changedOnly || always.includes(path) || !isEqual(current, initial))\n set(value, path, cloneDeep(current));\n }\n return value;\n }\n\n hydrate(\n form: EditEntityFormGroup,\n record: object,\n submitted: string[],\n ): void {\n const baseline = cloneDeep(form.initialValue);\n const visit = (control: AbstractControl, path: string): void => {\n if (control instanceof FormGroup) {\n for (const [key, child] of Object.entries(control.controls))\n visit(child, path ? `${path}.${key}` : key);\n return;\n }\n const saved = submitted.some(\n (name) => path === name || path.startsWith(`${name}.`),\n );\n const current = control.getRawValue();\n const draft = !isEqual(current, this.read(baseline, path));\n if (saved || !draft) {\n if (has(record, path))\n control.patchValue(cloneDeep(get(record, path)), {\n emitEvent: false,\n });\n if (Object.prototype.hasOwnProperty.call(form.controls, path))\n baseline[path] = cloneDeep(control.getRawValue());\n else set(baseline, path, cloneDeep(control.getRawValue()));\n control.markAsPristine();\n control.markAsUntouched();\n }\n };\n visit(form, \"\");\n form.setInitialValue(baseline);\n }\n\n private read(value: Record<string, unknown>, path: string): unknown {\n return Object.prototype.hasOwnProperty.call(value, path)\n ? value[path]\n : get(value, path);\n }\n}\n","import { CdkStepper } from \"@angular/cdk/stepper\";\nimport { CommonModule } from \"@angular/common\";\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n signal,\n SimpleChanges,\n ViewChild,\n} from \"@angular/core\";\nimport { FormControl, ReactiveFormsModule, Validators } from \"@angular/forms\";\nimport { MatButtonModule } from \"@angular/material/button\";\nimport { MatIconModule } from \"@angular/material/icon\";\nimport { MatProgressSpinnerModule } from \"@angular/material/progress-spinner\";\nimport { MatStepper, MatStepperModule } from \"@angular/material/stepper\";\nimport { MatTooltipModule } from \"@angular/material/tooltip\";\nimport {\n EditEntityConditionalStateService,\n EditEntityFormBuilderService,\n EditEntityRecord,\n EditEntityRenderService,\n EditEntitySubmitValueService,\n} from \"@eherve/angular-material-forms/core\";\nimport { EntityFormSession } from \"@eherve/angular-material-forms/editor\";\nimport { FormContentComponent } from \"@eherve/angular-material-forms/layout\";\nimport { cloneDeep, get, has, set } from \"lodash-es\";\nimport { CreateEntityWizardState } from \"./create-entity-wizard-state\";\nimport {\n CreateEntityWizardComponentOptions,\n CreateEntityWizardStep,\n} from \"./create-entity-wizard.types\";\n@Component({\n selector: \"ame-entity-wizard\",\n imports: [\n CommonModule,\n ReactiveFormsModule,\n MatButtonModule,\n MatIconModule,\n MatProgressSpinnerModule,\n MatTooltipModule,\n FormContentComponent,\n MatStepperModule,\n ],\n providers: [\n EntityFormSession,\n EditEntityConditionalStateService,\n EditEntityFormBuilderService,\n EditEntityRenderService,\n EditEntitySubmitValueService,\n ],\n templateUrl: \"./entity-wizard.component.html\",\n styleUrl: \"./entity-wizard.component.scss\",\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EntityWizardComponent<\n TRecord extends EditEntityRecord = EditEntityRecord,\n >\n implements OnInit, OnChanges, OnDestroy\n{\n @Input({ required: true })\n options!: CreateEntityWizardComponentOptions<TRecord>;\n @Input() displayMode: \"page\" | \"dialog\" = \"page\";\n readonly session = inject<EntityFormSession<TRecord>>(EntityFormSession);\n @Output() readonly result = this.session.result;\n @Output() readonly closeRequest = this.session.closeRequest;\n ngOnInit(): void {\n this.session.options = this.options;\n this.session.displayMode = this.displayMode;\n this.session.policy = {\n valid: () => this.wizardValid,\n value: (create) => this.wizardValue(create),\n patch: (record, value) => this.patchWizardRecord(record, value),\n saved: (record, value) => this.hydrateWizard(record, value),\n hydrate: (record) =>\n this.wizardState.hydrate(this.session.formGroup, record, []),\n refresh: () => this.refreshWizardState(),\n navigate: () => this.restoreWizardNavigation(),\n reset: () => {\n this.wizardIndex.set(0);\n this.wizardCompleted.set(this.options.wizard.steps.map(() => false));\n this.wizardVisibleIndices.set([]);\n this.wizardNavigationControls = [];\n },\n componentUpdated: () => this.completeWizardStep(),\n beforeClose: () =>\n this.session.formGroup.setInitialValue(\n this.session.formGroup.initialValue,\n ),\n stickyResult: true,\n };\n void this.session.initialize();\n }\n ngOnChanges(changes: SimpleChanges): void {\n if (changes[\"options\"] && !changes[\"options\"].firstChange) {\n this.session.options = this.options;\n void this.session.initialize();\n }\n }\n ngOnDestroy(): void {\n this.session.destroy();\n }\n requestClose(): Promise<void> {\n return this.session.requestClose();\n }\n refreshPresentation(): void {\n this.session.refreshPresentation();\n }\n submitFromKeyboard(): boolean {\n if (\n !this.options.validateOnEnter ||\n this.session.loading ||\n this.session.updating\n )\n return false;\n void this.wizardNext();\n return true;\n }\n readonly wizardIndex = signal(0);\n readonly wizardDrafts = signal<boolean[]>([]);\n readonly wizardCompleted = signal<boolean[]>([]);\n readonly wizardVisibleIndices = signal<number[]>([]);\n readonly wizardVisualIndex = computed(() =>\n Math.max(0, this.wizardVisibleIndices().indexOf(this.wizardIndex())),\n );\n readonly wizardNavigationBlocked = signal(false);\n readonly wizardLinear = signal(true);\n wizardNavigationControls: FormControl<boolean>[] = [];\n @ViewChild(MatStepper) wizardStepper?: CdkStepper;\n private readonly wizardState = new CreateEntityWizardState();\n get wizardStep(): CreateEntityWizardStep<TRecord> | undefined {\n return this.options?.wizard?.steps[this.wizardIndex()];\n }\n\n get wizardLast(): boolean {\n return this.wizardIndex() === this.wizardVisibleIndices().at(-1);\n }\n\n get wizardPrimaryLabel(): string {\n const wizard = this.options.wizard;\n if (!this.options.record?._id)\n return (\n wizard?.createNextLabel ?? this.session.intl.messages.wizardCreateNext\n );\n return this.wizardLast\n ? (wizard?.finishLabel ?? this.session.intl.messages.wizardFinish)\n : (wizard?.nextLabel ?? this.session.intl.messages.wizardNext);\n }\n\n get wizardExitLabel(): string {\n return this.options.record?._id\n ? (this.options.wizard?.finishLaterLabel ??\n this.session.intl.messages.wizardFinishLater)\n : this.session.cancelLabel;\n }\n\n selectWizardVisualStep(position: number): void {\n const index = this.wizardVisibleIndices()[position];\n if (index !== undefined) this.selectWizardStep(index);\n }\n\n private advanceWizard(): void {\n const next = this.wizardVisibleIndices()[this.wizardVisualIndex() + 1];\n if (next !== undefined) {\n this.wizardIndex.set(next);\n this.publishWizardNavigation();\n this.refreshWizardNavigation();\n }\n }\n\n private completeWizardStep(): void {\n const completed = [...this.wizardCompleted()];\n completed[this.wizardIndex()] = true;\n this.wizardCompleted.set(completed);\n this.refreshWizardNavigation();\n }\n\n private refreshWizardNavigation(): void {\n if (!this.options?.wizard) return;\n const blocked = this.session.updating || this.wizardPending;\n this.wizardNavigationBlocked.set(blocked);\n const linear = !this.options.record?._id || blocked;\n this.wizardLinear.set(linear);\n if (this.wizardStepper) this.wizardStepper.linear = linear;\n const count = this.options.wizard.steps.length;\n if (this.wizardNavigationControls.length !== count) {\n this.wizardNavigationControls = Array.from(\n { length: count },\n () =>\n new FormControl(false, {\n nonNullable: true,\n validators: Validators.requiredTrue,\n }),\n );\n }\n for (const [index, control] of this.wizardNavigationControls.entries()) {\n control.setValue(\n !blocked && (index !== 0 || !!this.options.record?._id),\n { emitEvent: false },\n );\n }\n // CDK checks these public step properties synchronously when a header is selected.\n // Synchronize immediately, including before Angular's next rendering pass.\n this.wizardStepper?.steps.forEach((step, position) => {\n const index = this.wizardVisibleIndices()[position];\n step.optional = false;\n step.interacted = true;\n step.completed = !blocked && !!this.wizardCompleted()[index];\n step.editable = !blocked && (index === 0 || !!this.options.record?._id);\n });\n }\n\n get wizardValid(): boolean {\n return this.wizardState.valid(this.session.formGroup, [\n ...this.wizardPaths(),\n ...this.wizardAlwaysPaths(),\n ]);\n }\n\n get wizardPending(): boolean {\n return [...this.wizardPaths(), ...this.wizardAlwaysPaths()].some(\n (path) => this.session.formGroup.getControl(path)?.pending,\n );\n }\n\n get wizardUnsaved(): boolean {\n return (\n Object.keys(\n this.wizardState.project(\n this.session.formGroup,\n this.wizardPaths(),\n true,\n ),\n ).length > 0\n );\n }\n\n selectWizardStep(index: number): void {\n if (\n this.session.updating ||\n this.wizardPending ||\n !this.options.wizard ||\n index < 0 ||\n index >= this.options.wizard.steps.length ||\n !this.wizardVisibleIndices().includes(index)\n )\n return;\n if (index > 0 && !this.options.record?._id) return;\n this.wizardIndex.set(index);\n this.publishWizardNavigation();\n this.refreshWizardNavigation();\n }\n\n skipWizardStep(): void {\n if (\n this.session.updating ||\n this.wizardPending ||\n !this.wizardStep?.optional ||\n !this.options.record?._id\n )\n return;\n if (this.wizardLast) void this.requestClose();\n else this.advanceWizard();\n }\n\n async wizardNext(): Promise<void> {\n if (this.session.updating || !this.options.wizard) return;\n const isCurrent = this.session.captureCurrentOperation();\n if (!this.wizardStep?.componentManaged) {\n for (const path of this.wizardPaths())\n this.session.formGroup.getControl(path)?.markAllAsTouched();\n if (!this.wizardValid) return;\n const previous = this.session.savedResult;\n if (!this.options.record?._id) await this.session.create();\n else if (this.wizardUnsaved) await this.session.update();\n else {\n this.completeWizardStep();\n if (this.wizardLast) await this.requestClose();\n else this.advanceWizard();\n return;\n }\n if (!isCurrent() || previous === this.session.savedResult) return;\n }\n if (this.wizardLast) await this.requestClose();\n else this.advanceWizard();\n }\n\n private wizardPaths(index = this.wizardIndex()): string[] {\n const display = this.options?.displayOptions;\n const tab = display && \"tabs\" in display ? display.tabs[index] : undefined;\n const names = tab\n ? this.session.renderService\n .collectFields(tab.displayOptions)\n .flatMap((field) =>\n field.kind === \"separator\" ||\n field.kind === \"metadata\" ||\n field.kind === \"display\"\n ? []\n : [field.name],\n )\n : [];\n return [\n ...new Set([\n ...names,\n ...(this.options.wizard?.steps[index]?.fields ?? []),\n ]),\n ];\n }\n\n private wizardAlwaysPaths(): string[] {\n return this.session.fields.flatMap((field) =>\n field.kind !== \"separator\" &&\n field.kind !== \"metadata\" &&\n field.kind !== \"display\" &&\n field.alwaysInUpsert\n ? [field.name]\n : [],\n );\n }\n\n private wizardValue(create: boolean): Record<string, unknown> {\n const paths = this.wizardPaths();\n const always = this.wizardAlwaysPaths();\n const value = this.wizardState.project(\n this.session.formGroup,\n paths,\n !create,\n always,\n );\n if (create)\n for (const path of [...paths, ...always]) {\n if (\n !this.session.formGroup.getControl(path) &&\n has(this.options.defaultValues, path)\n )\n set(value, path, cloneDeep(get(this.options.defaultValues, path)));\n }\n return value;\n }\n\n private patchWizardRecord(\n record: TRecord,\n value: Record<string, unknown>,\n ): TRecord {\n const updated = cloneDeep(record);\n for (const path of [...this.wizardPaths(), ...this.wizardAlwaysPaths()]) {\n if (has(value, path)) set(updated, path, cloneDeep(get(value, path)));\n }\n return updated;\n }\n\n private async hydrateWizard(\n record: TRecord,\n value: Record<string, unknown>,\n ): Promise<void> {\n const paths = [...this.wizardPaths(), ...this.wizardAlwaysPaths()].filter(\n (path) => has(value, path),\n );\n this.wizardState.hydrate(this.session.formGroup, record, paths);\n this.completeWizardStep();\n this.session.updated = this.session.formGroup.isUpdated;\n this.session.refreshAllowedActions();\n this.session.refreshRuntimeState();\n }\n\n private publishWizardNavigation(): void {\n this.session.navigationController.selectTab(this.wizardVisualIndex());\n }\n\n private restoreWizardNavigation(): void {\n const index =\n this.wizardVisibleIndices()[\n this.session.navigationController.selectedIndex\n ];\n if (\n index !== undefined &&\n !this.session.updating &&\n !this.wizardPending &&\n (index === 0 || !!this.options.record?._id)\n )\n this.wizardIndex.set(index);\n this.publishWizardNavigation();\n this.refreshWizardNavigation();\n }\n\n private refreshWizardState(): void {\n const visible = (this.session.renderState().tabs ?? []).flatMap(\n (tab, index) => (tab.isVisible ? [index] : []),\n );\n this.wizardVisibleIndices.set(visible);\n this.restoreWizardNavigation();\n if (!visible.includes(this.wizardIndex()) && visible.length)\n this.wizardIndex.set(visible[0]);\n this.wizardDrafts.set(\n this.options.wizard.steps.map(\n (_, index) =>\n Object.keys(\n this.wizardState.project(\n this.session.formGroup,\n this.wizardPaths(index),\n true,\n ),\n ).length > 0,\n ),\n );\n this.refreshWizardNavigation();\n }\n}\n","<!-- @format -->\n\n@if (session.loading) {\n <div class=\"edit-entity-loading\">\n <mat-spinner [diameter]=\"72\" />\n <span>{{ session.loadingLabel }}</span>\n </div>\n} @else if (session.errorLabel) {\n <div class=\"edit-entity-empty-state\">\n <mat-icon>info</mat-icon>\n <span>{{ session.errorLabel }}</span>\n\n @if (displayMode === \"dialog\") {\n <button mat-stroked-button type=\"button\" (click)=\"requestClose()\">\n {{ session.closeLabel }}\n </button>\n }\n </div>\n} @else {\n @if (\n session.title ||\n session.subtitle ||\n displayMode === \"dialog\" ||\n session.getActions(\"top\").length\n ) {\n <header\n class=\"edit-entity-title-bar\"\n [class.edit-entity-wizard-header]=\"options.wizard\"\n >\n @if (options.wizard?.icon) {\n <mat-icon>{{ options.wizard?.icon }}</mat-icon>\n }\n <div class=\"edit-entity-title-content\">\n @if (session.title) {\n <h2 [innerHTML]=\"session.title\"></h2>\n }\n @if (session.subtitle) {\n <p [innerHTML]=\"session.subtitle\"></p>\n }\n </div>\n\n <div class=\"edit-entity-title-actions\">\n @for (\n action of session.getActions(\"top\");\n track session.trackRuntimeAction($index, action)\n ) {\n <ng-container\n *ngTemplateOutlet=\"actionTemplate; context: { action }\"\n ></ng-container>\n }\n\n @if (options.showJsonDataButton === true) {\n <button\n mat-icon-button\n type=\"button\"\n [matTooltip]=\"session.intl.messages.showJson\"\n [attr.aria-label]=\"session.intl.messages.showJson\"\n (click)=\"session.openJsonDataDialog()\"\n >\n <mat-icon>file_json</mat-icon>\n </button>\n }\n\n @if (displayMode === \"dialog\") {\n <button\n mat-icon-button\n type=\"button\"\n [attr.aria-label]=\"session.closeLabel\"\n (click)=\"requestClose()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n }\n </div>\n </header>\n }\n\n <form class=\"edit-entity-form\" [formGroup]=\"session.formGroup\">\n <main class=\"edit-entity-content\">\n @if (options.wizard; as wizard) {\n <mat-stepper\n class=\"edit-entity-wizard\"\n orientation=\"horizontal\"\n labelPosition=\"end\"\n [linear]=\"wizardLinear()\"\n [selectedIndex]=\"wizardVisualIndex()\"\n (selectionChange)=\"selectWizardVisualStep($event.selectedIndex)\"\n >\n <!-- Material icon context.active also includes completed steps; selection follows the wizard index. -->\n <ng-template matStepperIcon=\"number\" let-index=\"index\">\n <ng-container\n *ngTemplateOutlet=\"\n wizardStateIcon;\n context: { index, active: index === wizardVisualIndex() }\n \"\n ></ng-container>\n </ng-template>\n <ng-template matStepperIcon=\"edit\" let-index=\"index\">\n <ng-container\n *ngTemplateOutlet=\"\n wizardStateIcon;\n context: { index, active: index === wizardVisualIndex() }\n \"\n ></ng-container>\n </ng-template>\n <ng-template matStepperIcon=\"done\" let-index=\"index\">\n <ng-container\n *ngTemplateOutlet=\"\n wizardStateIcon;\n context: { index, active: index === wizardVisualIndex() }\n \"\n ></ng-container>\n </ng-template>\n <ng-template #wizardStateIcon let-index=\"index\" let-active=\"active\">\n <span\n class=\"edit-entity-wizard-state-icon\"\n [class.edit-entity-wizard-state-icon--selected]=\"active\"\n [class.edit-entity-wizard-state-icon--completed]=\"\n !active && wizardCompleted()[wizardVisibleIndices()[index]]\n \"\n >\n @if (\n !active && wizardCompleted()[wizardVisibleIndices()[index]]\n ) {\n <mat-icon>check</mat-icon>\n } @else {\n {{ index + 1 }}\n }\n </span>\n </ng-template>\n @for (index of wizardVisibleIndices(); track index) {\n @let step = wizard.steps[index];\n <mat-step\n [optional]=\"false\"\n [stepControl]=\"wizardNavigationControls[index]\"\n [completed]=\"\n !wizardNavigationBlocked() && wizardCompleted()[index]\n \"\n [editable]=\"\n !wizardNavigationBlocked() &&\n (index === 0 || !!options.record?._id)\n \"\n >\n <ng-template matStepLabel>\n <div\n class=\"edit-entity-wizard-step-label\"\n [class.edit-entity-wizard-step-label--selected]=\"\n index === wizardIndex()\n \"\n >\n <span class=\"edit-entity-wizard-step-name\">{{\n step.label\n }}</span>\n @if (wizardDrafts()[index]) {\n <span\n class=\"edit-entity-wizard-unsaved\"\n [title]=\"\n wizard.unsavedLabel ||\n session.intl.messages.wizardUnsaved\n \"\n >{{\n wizard.unsavedLabel ||\n session.intl.messages.wizardUnsaved\n }}</span\n >\n }\n </div>\n </ng-template>\n <ng-template matStepContent>\n @if (index === wizardIndex()) {\n <header class=\"edit-entity-wizard-content-heading\">\n <div>\n <h3>{{ step.label }}</h3>\n @if (step.description) {\n <p>{{ step.description }}</p>\n }\n </div>\n @if (step.optional && index > 0) {\n <span class=\"edit-entity-wizard-optional\">{{\n wizard.optionalLabel ||\n session.intl.messages.wizardOptional\n }}</span>\n }\n </header>\n <ame-form-content\n [state]=\"\n session.renderState().tabs?.[index]?.renderState || {\n kind: 'empty',\n }\n \"\n [formGroup]=\"session.formGroup\"\n [options]=\"options\"\n [context]=\"session\"\n />\n }\n </ng-template>\n </mat-step>\n }\n </mat-stepper>\n }\n </main>\n </form>\n\n <footer\n class=\"edit-entity-actions\"\n [class.edit-entity-wizard-actions]=\"options.wizard\"\n >\n <div class=\"edit-entity-actions-left\">\n @for (\n action of session.getActions(\"bottom\");\n track session.trackRuntimeAction($index, action)\n ) {\n <ng-container\n *ngTemplateOutlet=\"actionTemplate; context: { action }\"\n ></ng-container>\n }\n </div>\n\n <div class=\"edit-entity-actions-right\">\n @for (\n action of session.getActions(\"bottom-end\");\n track session.trackRuntimeAction($index, action)\n ) {\n <ng-container\n *ngTemplateOutlet=\"actionTemplate; context: { action }\"\n ></ng-container>\n }\n\n @if (options.wizard; as wizard) {\n <button\n mat-stroked-button\n type=\"button\"\n [disabled]=\"session.updating\"\n (click)=\"requestClose()\"\n >\n {{ wizardExitLabel }}\n </button>\n @if (wizardStep?.optional && options.record?._id) {\n <button\n mat-raised-button\n class=\"edit-entity-wizard-skip\"\n type=\"button\"\n [disabled]=\"wizardNavigationBlocked()\"\n (click)=\"skipWizardStep()\"\n >\n {{ wizard.skipLabel || session.intl.messages.wizardSkip }}\n </button>\n }\n <button\n mat-raised-button\n color=\"secondary\"\n type=\"button\"\n [disabled]=\"\n session.updating || (!wizardStep?.componentManaged && !wizardValid)\n \"\n (click)=\"wizardNext()\"\n >\n {{ wizardPrimaryLabel }}\n </button>\n }\n </div>\n </footer>\n\n @if (session.updating) {\n <div class=\"edit-entity-updating\">\n <mat-spinner [diameter]=\"72\" />\n </div>\n }\n}\n\n<ng-template #actionTemplate let-action=\"action\">\n @if (session.isRuntimeButtonAction(action)) {\n @if (action.buttonType === \"raised\") {\n <button\n class=\"action-btn\"\n mat-raised-button\n type=\"button\"\n [style.--action-color]=\"action.contrastColor\"\n [style.--action-background-color]=\"action.color\"\n [disabled]=\"session.updating || action.isDisabled\"\n [matTooltip]=\"action.tooltip || ''\"\n (click)=\"session.handleAction(action)\"\n >\n @if (action.icon) {\n <mat-icon>{{ action.icon }}</mat-icon>\n }\n <span [innerHTML]=\"action.label\"></span>\n </button>\n } @else {\n <button\n class=\"action-btn\"\n mat-button\n type=\"button\"\n [style.--action-color]=\"action.color\"\n [disabled]=\"session.updating || action.isDisabled\"\n [matTooltip]=\"action.tooltip || ''\"\n (click)=\"session.handleAction(action)\"\n >\n @if (action.icon) {\n <mat-icon>{{ action.icon }}</mat-icon>\n }\n <span [innerHTML]=\"action.label\"></span>\n </button>\n }\n } @else if (session.isRuntimeComponentAction(action)) {\n <ng-container\n *ngComponentOutlet=\"action.component; inputs: action.componentInputs\"\n ></ng-container>\n }\n</ng-template>\n","import {\n ChangeDetectionStrategy,\n Component,\n Inject,\n ViewChild,\n} from \"@angular/core\";\nimport {\n MAT_DIALOG_DATA,\n MatDialog,\n MatDialogRef,\n} from \"@angular/material/dialog\";\nimport {\n EditEntityRecord,\n EditEntityDialogResult,\n} from \"@eherve/angular-material-forms/core\";\nimport { EntityDialogKeyboardHost } from \"@eherve/angular-material-forms/editor\";\nimport { EntityWizardComponent } from \"./entity-wizard.component\";\nimport { CreateEntityWizardComponentOptions } from \"./create-entity-wizard.types\";\n@Component({\n selector: \"ame-entity-wizard-dialog\",\n imports: [EntityWizardComponent],\n templateUrl: \"./entity-wizard-dialog.component.html\",\n styleUrl: \"./entity-wizard-dialog.component.scss\",\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EntityWizardDialog<\n TRecord extends EditEntityRecord = EditEntityRecord,\n> extends EntityDialogKeyboardHost<TRecord, EntityWizardDialog<TRecord>> {\n @ViewChild(EntityWizardComponent)\n protected override editEntityComponent?: EntityWizardComponent<TRecord>;\n constructor(\n @Inject(MAT_DIALOG_DATA)\n public readonly data: CreateEntityWizardComponentOptions<TRecord>,\n dialogRef: MatDialogRef<\n EntityWizardDialog<TRecord>,\n EditEntityDialogResult<TRecord>\n >,\n matDialog: MatDialog,\n ) {\n super(dialogRef, matDialog);\n }\n}\n","<ame-entity-wizard\n [options]=\"data\"\n displayMode=\"dialog\"\n (closeRequest)=\"close($event)\"\n/>\n","import { inject, Injectable } from \"@angular/core\";\nimport { MatDialogRef } from \"@angular/material/dialog\";\nimport {\n EditEntityDialogResult,\n EditEntityRecord,\n} from \"@eherve/angular-material-forms/core\";\nimport {\n EntityDialogLauncher,\n EntityDialogOpenConfig,\n} from \"@eherve/angular-material-forms/editor\";\nimport { CreateEntityWizardComponentOptions } from \"./create-entity-wizard.types\";\nimport { EntityWizardDialog } from \"./entity-wizard-dialog.component\";\nexport type CreateEntityWizardOpenConfig<TRecord extends EditEntityRecord> =\n EntityDialogOpenConfig<TRecord>;\n@Injectable({ providedIn: \"root\" })\nexport class CreateEntityWizardService {\n private readonly launcher = inject(EntityDialogLauncher);\n open<TRecord extends EditEntityRecord>(\n options: CreateEntityWizardComponentOptions<TRecord>,\n config: CreateEntityWizardOpenConfig<TRecord> = {},\n ): MatDialogRef<\n EntityWizardDialog<TRecord>,\n EditEntityDialogResult<TRecord>\n > {\n if (!options.wizard?.steps.length || !(\"tabs\" in options.displayOptions))\n throw new Error(\n \"Use createEntityWizardOptions before opening a creation wizard\",\n );\n return this.launcher.open(EntityWizardDialog<TRecord>, options, config);\n }\n}\n","import {\n EditEntityComponentOptions,\n EditEntityRecord,\n EditEntityTabDisplayOptions,\n} from \"@eherve/angular-material-forms/core\";\n\nexport interface CreateEntityWizardStep<\n TRecord extends EditEntityRecord = EditEntityRecord,\n> {\n id: string;\n label: string;\n description?: string;\n icon?: string;\n optional?: boolean;\n displayOptions: EditEntityTabDisplayOptions<TRecord>;\n /** Explicit control paths, including controls prepared by the host. Defaults to rendered fields. */\n fields?: string[];\n /** This step's components persist their own mutations; Continue never submits the form. */\n componentManaged?: boolean;\n}\n\nexport interface CreateEntityWizardConfiguration<\n TRecord extends EditEntityRecord = EditEntityRecord,\n> {\n steps: CreateEntityWizardStep<TRecord>[];\n icon?: string;\n nextLabel?: string;\n createNextLabel?: string;\n skipLabel?: string;\n finishLaterLabel?: string;\n finishLabel?: string;\n optionalLabel?: string;\n unsavedLabel?: string;\n}\n\nexport interface CreateEntityWizardComponentOptions<\n TRecord extends EditEntityRecord = EditEntityRecord,\n> extends EditEntityComponentOptions<TRecord> {\n wizard: CreateEntityWizardConfiguration<TRecord>;\n}\n\nexport type CreateEntityWizardOptions<\n TRecord extends EditEntityRecord = EditEntityRecord,\n> = Omit<\n EditEntityComponentOptions<TRecord>,\n \"displayOptions\" | \"record\" | \"wizard\"\n> &\n CreateEntityWizardConfiguration<TRecord>;\n\n/** Normalize before decorating access/fields. The opening service uses this exact options object. */\nexport function createEntityWizardOptions<TRecord extends EditEntityRecord>(\n options: CreateEntityWizardOptions<TRecord>,\n): CreateEntityWizardComponentOptions<TRecord> {\n if (!options.steps.length)\n throw new Error(\"A creation wizard requires at least one step\");\n const {\n steps,\n icon,\n nextLabel,\n createNextLabel,\n skipLabel,\n finishLaterLabel,\n finishLabel,\n optionalLabel,\n unsavedLabel,\n ...base\n } = options;\n return {\n ...base,\n service: base.service\n ? { ...base.service, closeOnUpsert: false }\n : undefined,\n wizard: {\n steps,\n icon,\n nextLabel,\n createNextLabel,\n skipLabel,\n finishLaterLabel,\n finishLabel,\n optionalLabel,\n unsavedLabel,\n },\n displayOptions: {\n tabs: steps.map((step) => ({\n id: step.id,\n label: step.label,\n icon: step.icon,\n displayOptions: step.displayOptions,\n })),\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQA,IAAa,0BAAb,MAAoC;CAClC,MAAM,MAA2B,OAAe;EAC9C,OAAO,MAAM,OAAO,SAAQ;GAC1B,MAAM,UAAU,KAAK,WAAW,IAAI;GACpC,OACE,CAAC,WAAW,QAAQ,YAAa,CAAC,QAAQ,WAAW,QAAQ;EAEjE,CAAC;CACH;CAEA,QACE,MACA,OACA,aACA,SAAmB,CAAA,GAAE;EAErB,MAAM,QAAiC,CAAA;EACvC,KAAK,MAAM,wBAAQ,IAAI,IAAI,CAAC,GAAG,OAAO,GAAG,MAAM,CAAC,GAAG;GACjD,MAAM,UAAU,KAAK,WAAW,IAAI;GACpC,IAAI,CAAC,WAAW,cAAc,OAAO,GAAG;GACxC,MAAM,UAAU,QAAQ,YAAW;GACnC,MAAM,UAAU,KAAK,KAAK,KAAK,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,CAAA;CAAzB,OAAA,QAAA,GAAA,sBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAyB,YADZ;CAAM,CAAA;;AACnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAyB,YAAA,CAAA;EADrC,MAAA;EAAW,MAAA,CAAA,EAAE,YAAY,OAAM,CAAE;;;ACoClC,SAAgB,0BACd,SAA2C;CAE3C,IAAI,CAAC,QAAQ,MAAM,QACjB,MAAM,IAAI,MAAM,8CAA8C;CAChE,MAAM,EACJ,OACA,MACA,WACA,iBACA,WACA,kBACA,aACA,eACA,cACA,GAAG,SACD;CACJ,OAAO;EACL,GAAG;EACH,SAAS,KAAK,UACV;GAAE,GAAG,KAAK;GAAS,eAAe;EAAK,IACvC;EACJ,QAAQ;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD;EACD,gBAAgB,EACd,MAAM,MAAM,KAAK,UAAU;GACzB,IAAI,KAAK;GACT,OAAO,KAAK;GACZ,MAAM,KAAK;GACX,gBAAgB,KAAK;EACtB,EAAC,EACH;CACF;AACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eherve/angular-material-entity-wizard",
3
- "version": "22.0.0",
3
+ "version": "22.1.0",
4
4
  "author": "Eric Herve <eric.herve.95@gmail.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,13 +18,13 @@
18
18
  "@angular/material": "^22.0.0",
19
19
  "rxjs": "^7.8.0",
20
20
  "@angular/forms": "^22.0.0",
21
- "@eherve/angular-material-section-tabs": "^22.2.0",
21
+ "@eherve/angular-material-section-tabs": "^22.3.0",
22
22
  "moment": "^2.30.1",
23
23
  "dayjs": "^1.11.20",
24
24
  "@angular/material-moment-adapter": "^22.0.0",
25
25
  "@ng-matero/extensions": "^22.1.1",
26
26
  "@ng-matero/extensions-moment-adapter": "^22.0.0",
27
- "@eherve/angular-material-forms": "^22.0.0"
27
+ "@eherve/angular-material-forms": "^22.2.0"
28
28
  },
29
29
  "dependencies": {
30
30
  "tslib": "^2.3.0",
@@ -38,7 +38,7 @@ export interface CreateEntityWizardConfiguration<TRecord extends EditEntityRecor
38
38
  export interface CreateEntityWizardComponentOptions<TRecord extends EditEntityRecord = EditEntityRecord> extends EditEntityComponentOptions<TRecord> {
39
39
  wizard: CreateEntityWizardConfiguration<TRecord>;
40
40
  }
41
- export type CreateEntityWizardOptions<TRecord extends EditEntityRecord = EditEntityRecord> = Omit<EditEntityComponentOptions<TRecord>, "displayOptions" | "record" | "wizard" | "navigation"> & CreateEntityWizardConfiguration<TRecord>;
41
+ export type CreateEntityWizardOptions<TRecord extends EditEntityRecord = EditEntityRecord> = Omit<EditEntityComponentOptions<TRecord>, "displayOptions" | "record" | "wizard"> & CreateEntityWizardConfiguration<TRecord>;
42
42
  /** Normalize before decorating access/fields. The opening service uses this exact options object. */
43
43
  export declare function createEntityWizardOptions<TRecord extends EditEntityRecord>(options: CreateEntityWizardOptions<TRecord>): CreateEntityWizardComponentOptions<TRecord>;
44
44
  export declare class EntityWizardComponent<TRecord extends EditEntityRecord = EditEntityRecord> implements OnInit, OnChanges, OnDestroy {
@@ -82,6 +82,8 @@ export declare class EntityWizardComponent<TRecord extends EditEntityRecord = Ed
82
82
  private wizardValue;
83
83
  private patchWizardRecord;
84
84
  private hydrateWizard;
85
+ private publishWizardNavigation;
86
+ private restoreWizardNavigation;
85
87
  private refreshWizardState;
86
88
  static ɵfac: i0.ɵɵFactoryDeclaration<EntityWizardComponent<any>, never>;
87
89
  static ɵcmp: i0.ɵɵComponentDeclaration<EntityWizardComponent<any>, "ame-entity-wizard", never, {