@daltonr/pathwrite-angular 0.6.2 → 0.7.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/LICENSE +1 -1
- package/README.md +54 -2
- package/dist/index.css +69 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/shell.d.ts +17 -2
- package/dist/shell.js +62 -9
- package/dist/shell.js.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +2 -0
- package/src/shell.ts +39 -5
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -158,6 +158,53 @@ path.setData("foo", 123); // ❌ Type error: "foo" not in ContactData
|
|
|
158
158
|
path.snapshot()?.data.name; // ✅ Typed as string
|
|
159
159
|
```
|
|
160
160
|
|
|
161
|
+
#### Typing `setData` key parameters
|
|
162
|
+
|
|
163
|
+
`setData` is typed as `setData<K extends string & keyof TData>(key: K, value: TData[K])`.
|
|
164
|
+
The `string &` intersection is necessary because `keyof T` includes `number` and `symbol`
|
|
165
|
+
(all valid JavaScript property key types), but `setData` only accepts string keys.
|
|
166
|
+
|
|
167
|
+
When writing a reusable update method that receives a field name as a parameter, use
|
|
168
|
+
`string & keyof TData` — not just `keyof TData` — to match the constraint:
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
// ❌ Type error: keyof ContactData is string | number | symbol
|
|
172
|
+
protected update(field: keyof ContactData, value: string): void {
|
|
173
|
+
this.path.setData(field, value);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// ✅ Correct: string & keyof ensures the type matches setData's signature
|
|
177
|
+
protected update(field: string & keyof ContactData, value: string): void {
|
|
178
|
+
this.path.setData(field, value);
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Inline string literals are always fine — this pattern only matters when passing a key as a variable.
|
|
183
|
+
|
|
184
|
+
#### Reading step data without local state
|
|
185
|
+
|
|
186
|
+
Rather than mirroring engine data into local component state, use a typed getter that reads
|
|
187
|
+
directly from the snapshot signal. Angular tracks the signal read during template evaluation,
|
|
188
|
+
so any engine update (including back-navigation) triggers a re-render automatically:
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
export class PersonalInfoStepComponent {
|
|
192
|
+
protected readonly path = injectPath<OnboardingData>();
|
|
193
|
+
|
|
194
|
+
// No local state, no ngOnInit, no dual-update event handlers.
|
|
195
|
+
protected get data(): OnboardingData {
|
|
196
|
+
return (this.path.snapshot()?.data ?? {}) as OnboardingData;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Template reads from `data`; writes go directly to the engine:
|
|
202
|
+
|
|
203
|
+
```html
|
|
204
|
+
<input [value]="data.firstName ?? ''"
|
|
205
|
+
(input)="path.setData('firstName', $any($event.target).value.trim())" />
|
|
206
|
+
```
|
|
207
|
+
|
|
161
208
|
### Requirements
|
|
162
209
|
|
|
163
210
|
- **Angular 16+** (signals required)
|
|
@@ -751,8 +798,8 @@ onSubPathComplete(subPathId, subPathData, ctx, meta) {
|
|
|
751
798
|
}
|
|
752
799
|
```
|
|
753
800
|
|
|
754
|
-
**3.
|
|
755
|
-
When `snapshot.nestingLevel > 0`, you're in a sub-path. The
|
|
801
|
+
**3. Root progress bar persists during sub-paths**
|
|
802
|
+
When `snapshot.nestingLevel > 0`, you're in a sub-path. The shell automatically renders a compact, muted **root progress bar** above the sub-path's own progress bar so users always see their place in the main flow. The `steps` array in the snapshot contains the sub-path's steps. Use `snapshot.rootProgress` (type `RootProgress`) in a custom `pwShellHeader` template to render your own persistent top-level indicator.
|
|
756
803
|
|
|
757
804
|
**4. Accessing parent path data from sub-path components**
|
|
758
805
|
There is currently no way to inject a "parent facade" in sub-path step components. If a sub-path step needs parent data (e.g., the document title), pass it via `initialData` when calling `startSubPath`:
|
|
@@ -958,3 +1005,8 @@ Override any `--pw-*` variable to customise the appearance:
|
|
|
958
1005
|
- `--pw-btn-padding` — Button padding (default: `8px 16px`)
|
|
959
1006
|
- `--pw-btn-radius` — Button border radius (default: `6px`)
|
|
960
1007
|
|
|
1008
|
+
|
|
1009
|
+
---
|
|
1010
|
+
|
|
1011
|
+
© 2026 Devjoy Ltd. MIT License.
|
|
1012
|
+
|
package/dist/index.css
CHANGED
|
@@ -77,6 +77,75 @@
|
|
|
77
77
|
font-size: 14px;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/* ------------------------------------------------------------------ */
|
|
81
|
+
/* Root progress — persistent top-level bar visible during sub-paths */
|
|
82
|
+
/* ------------------------------------------------------------------ */
|
|
83
|
+
.pw-shell__root-progress {
|
|
84
|
+
background: var(--pw-color-bg);
|
|
85
|
+
border: 1px solid var(--pw-color-border);
|
|
86
|
+
border-radius: var(--pw-shell-radius);
|
|
87
|
+
padding: 20px 24px 16px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.pw-shell__root-progress .pw-shell__steps {
|
|
91
|
+
display: flex;
|
|
92
|
+
justify-content: space-between;
|
|
93
|
+
margin-bottom: 12px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.pw-shell__root-progress .pw-shell__step {
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
align-items: center;
|
|
100
|
+
gap: 6px;
|
|
101
|
+
flex: 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/* Merge root progress + sub-path header into a single card */
|
|
105
|
+
.pw-shell__root-progress + .pw-shell__header {
|
|
106
|
+
margin-top: calc(-1 * var(--pw-shell-gap));
|
|
107
|
+
border-top: 1px solid var(--pw-color-border);
|
|
108
|
+
border-top-left-radius: 0;
|
|
109
|
+
border-top-right-radius: 0;
|
|
110
|
+
padding: 12px 24px 12px;
|
|
111
|
+
opacity: 0.6;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.pw-shell__root-progress:has(+ .pw-shell__header) {
|
|
115
|
+
border-bottom-left-radius: 0;
|
|
116
|
+
border-bottom-right-radius: 0;
|
|
117
|
+
padding-bottom: 12px;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.pw-shell__root-progress + .pw-shell__header .pw-shell__steps {
|
|
121
|
+
margin-bottom: 6px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.pw-shell__root-progress + .pw-shell__header .pw-shell__step-dot {
|
|
125
|
+
width: 22px;
|
|
126
|
+
height: 22px;
|
|
127
|
+
font-size: 10px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.pw-shell__root-progress + .pw-shell__header .pw-shell__step-label {
|
|
131
|
+
font-size: 10px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.pw-shell__root-progress + .pw-shell__header .pw-shell__track {
|
|
135
|
+
height: 3px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* Split layout — disable the merged-card effect */
|
|
139
|
+
.pw-shell--progress-split .pw-shell__root-progress + .pw-shell__header {
|
|
140
|
+
margin-top: 0;
|
|
141
|
+
border-top: 1px solid var(--pw-color-border);
|
|
142
|
+
border-radius: var(--pw-shell-radius);
|
|
143
|
+
}
|
|
144
|
+
.pw-shell--progress-split .pw-shell__root-progress:has(+ .pw-shell__header) {
|
|
145
|
+
border-radius: var(--pw-shell-radius);
|
|
146
|
+
padding-bottom: 16px;
|
|
147
|
+
}
|
|
148
|
+
|
|
80
149
|
/* ------------------------------------------------------------------ */
|
|
81
150
|
/* Header — progress indicator */
|
|
82
151
|
/* ------------------------------------------------------------------ */
|
package/dist/index.d.ts
CHANGED
|
@@ -173,5 +173,5 @@ export interface FormGroupLike {
|
|
|
173
173
|
* ```
|
|
174
174
|
*/
|
|
175
175
|
export declare function syncFormGroup<TData extends PathData = PathData>(facade: PathFacade<TData>, formGroup: FormGroupLike, destroyRef?: DestroyRef): () => void;
|
|
176
|
-
export type { PathData, FieldErrors, PathDefinition, PathEvent, PathSnapshot, PathStep, PathStepContext, SerializedPathState } from "@daltonr/pathwrite-core";
|
|
176
|
+
export type { PathData, FieldErrors, PathDefinition, PathEvent, PathSnapshot, PathStep, PathStepContext, ProgressLayout, RootProgress, SerializedPathState } from "@daltonr/pathwrite-core";
|
|
177
177
|
export { PathEngine } from "@daltonr/pathwrite-core";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAc,OAAO,EAAE,MAAM,MAAM,CAAC;AAC5D,OAAO,EAGL,UAAU,EAGX,MAAM,yBAAyB,CAAC;;AAEjC;;;;;;;;;;;;;GAaG;AAEH,MAAM,OAAO,UAAU;IAYrB;QAXQ,YAAO,GAAG,IAAI,UAAU,EAAE,CAAC;QAClB,YAAO,GAAG,IAAI,eAAe,CAA6B,IAAI,CAAC,CAAC;QAChE,aAAQ,GAAG,IAAI,OAAO,EAAa,CAAC;QAC7C,2BAAsB,GAAe,GAAG,EAAE,GAAE,CAAC,CAAC;QACrC,iBAAY,GAAG,MAAM,CAA6B,IAAI,CAAC,CAAC;QAEzD,WAAM,GAA2C,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAC7E,YAAO,GAA0B,IAAI,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC;QAC9E,0FAA0F;QAC1E,gBAAW,GAAuC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;QAG/F,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,WAAW,CAAC,MAAkB;QACnC,+DAA+D;QAC/D,IAAI,CAAC,sBAAsB,EAAE,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;IAEO,aAAa,CAA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C;KACvE,CAAC;AACJ,CAAC;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,aAAa,CAC3B,MAAyB,EACzB,SAAwB,EACxB,UAAuB;IAEvB,MAAM,UAAU,GAAG,MAA8B,CAAC;IAElD,SAAS,WAAW;QAClB,IAAI,UAAU,CAAC,QAAQ,EAAE,KAAK,IAAI;YAAE,OAAO,CAAC,mCAAmC;QAC/E,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;YACnE,KAAK,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,yEAAyE;IACzE,WAAW,EAAE,CAAC;IAEd,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAE3E,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IACjD,UAAU,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC/B,OAAO,OAAO,CAAC;AACjB,CAAC;AAgBD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/shell.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TemplateRef, EventEmitter, QueryList, OnInit, OnDestroy, Injector } from "@angular/core";
|
|
2
|
-
import { PathData, PathDefinition, PathEvent, PathSnapshot } from "@daltonr/pathwrite-core";
|
|
2
|
+
import { PathData, PathDefinition, PathEvent, PathSnapshot, ProgressLayout } from "@daltonr/pathwrite-core";
|
|
3
3
|
import { PathFacade } from "./index";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
@@ -122,6 +122,21 @@ export declare class PathShellComponent implements OnInit, OnDestroy {
|
|
|
122
122
|
* - "form": Cancel on left, Submit alone on right. Back button never shown.
|
|
123
123
|
*/
|
|
124
124
|
footerLayout: "wizard" | "form" | "auto";
|
|
125
|
+
/**
|
|
126
|
+
* Controls whether the shell renders its auto-generated field-error summary box.
|
|
127
|
+
* - `"summary"` (default): Shell renders the labeled error list below the step body.
|
|
128
|
+
* - `"inline"`: Suppress the summary — handle errors inside the step template instead.
|
|
129
|
+
* - `"both"`: Render the shell summary AND whatever the step template renders.
|
|
130
|
+
*/
|
|
131
|
+
validationDisplay: "summary" | "inline" | "both";
|
|
132
|
+
/**
|
|
133
|
+
* Controls how progress bars are arranged when a sub-path is active.
|
|
134
|
+
* - "merged" (default): Root and sub-path bars in one card.
|
|
135
|
+
* - "split": Root and sub-path bars as separate cards.
|
|
136
|
+
* - "rootOnly": Only the root bar — sub-path bar hidden.
|
|
137
|
+
* - "activeOnly": Only the active (sub-path) bar — root bar hidden.
|
|
138
|
+
*/
|
|
139
|
+
progressLayout: ProgressLayout;
|
|
125
140
|
completed: EventEmitter<PathData>;
|
|
126
141
|
cancelled: EventEmitter<PathData>;
|
|
127
142
|
pathEvent: EventEmitter<PathEvent>;
|
|
@@ -157,5 +172,5 @@ export declare class PathShellComponent implements OnInit, OnDestroy {
|
|
|
157
172
|
* e.g. "firstName" → "First Name", "email" → "Email" */
|
|
158
173
|
protected formatFieldKey(key: string): string;
|
|
159
174
|
static ɵfac: i0.ɵɵFactoryDeclaration<PathShellComponent, never>;
|
|
160
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<PathShellComponent, "pw-shell", never, { "path": { "alias": "path"; "required": true; }; "initialData": { "alias": "initialData"; "required": false; }; "autoStart": { "alias": "autoStart"; "required": false; }; "backLabel": { "alias": "backLabel"; "required": false; }; "nextLabel": { "alias": "nextLabel"; "required": false; }; "completeLabel": { "alias": "completeLabel"; "required": false; }; "cancelLabel": { "alias": "cancelLabel"; "required": false; }; "hideCancel": { "alias": "hideCancel"; "required": false; }; "hideProgress": { "alias": "hideProgress"; "required": false; }; "footerLayout": { "alias": "footerLayout"; "required": false; }; }, { "completed": "completed"; "cancelled": "cancelled"; "pathEvent": "pathEvent"; }, ["customHeader", "customFooter", "stepDirectives"], never, true, never>;
|
|
175
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<PathShellComponent, "pw-shell", never, { "path": { "alias": "path"; "required": true; }; "initialData": { "alias": "initialData"; "required": false; }; "autoStart": { "alias": "autoStart"; "required": false; }; "backLabel": { "alias": "backLabel"; "required": false; }; "nextLabel": { "alias": "nextLabel"; "required": false; }; "completeLabel": { "alias": "completeLabel"; "required": false; }; "cancelLabel": { "alias": "cancelLabel"; "required": false; }; "hideCancel": { "alias": "hideCancel"; "required": false; }; "hideProgress": { "alias": "hideProgress"; "required": false; }; "footerLayout": { "alias": "footerLayout"; "required": false; }; "validationDisplay": { "alias": "validationDisplay"; "required": false; }; "progressLayout": { "alias": "progressLayout"; "required": false; }; }, { "completed": "completed"; "cancelled": "cancelled"; "pathEvent": "pathEvent"; }, ["customHeader", "customFooter", "stepDirectives"], never, true, never>;
|
|
161
176
|
}
|
package/dist/shell.js
CHANGED
|
@@ -128,6 +128,21 @@ export class PathShellComponent {
|
|
|
128
128
|
* - "form": Cancel on left, Submit alone on right. Back button never shown.
|
|
129
129
|
*/
|
|
130
130
|
this.footerLayout = "auto";
|
|
131
|
+
/**
|
|
132
|
+
* Controls whether the shell renders its auto-generated field-error summary box.
|
|
133
|
+
* - `"summary"` (default): Shell renders the labeled error list below the step body.
|
|
134
|
+
* - `"inline"`: Suppress the summary — handle errors inside the step template instead.
|
|
135
|
+
* - `"both"`: Render the shell summary AND whatever the step template renders.
|
|
136
|
+
*/
|
|
137
|
+
this.validationDisplay = "inline";
|
|
138
|
+
/**
|
|
139
|
+
* Controls how progress bars are arranged when a sub-path is active.
|
|
140
|
+
* - "merged" (default): Root and sub-path bars in one card.
|
|
141
|
+
* - "split": Root and sub-path bars as separate cards.
|
|
142
|
+
* - "rootOnly": Only the root bar — sub-path bar hidden.
|
|
143
|
+
* - "activeOnly": Only the active (sub-path) bar — root bar hidden.
|
|
144
|
+
*/
|
|
145
|
+
this.progressLayout = "merged";
|
|
131
146
|
this.completed = new EventEmitter();
|
|
132
147
|
this.cancelled = new EventEmitter();
|
|
133
148
|
this.pathEvent = new EventEmitter();
|
|
@@ -196,7 +211,7 @@ export class PathShellComponent {
|
|
|
196
211
|
return key.replace(/([A-Z])/g, " $1").replace(/^./, c => c.toUpperCase()).trim();
|
|
197
212
|
}
|
|
198
213
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: PathShellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
199
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: PathShellComponent, isStandalone: true, selector: "pw-shell", inputs: { path: "path", initialData: "initialData", autoStart: "autoStart", backLabel: "backLabel", nextLabel: "nextLabel", completeLabel: "completeLabel", cancelLabel: "cancelLabel", hideCancel: "hideCancel", hideProgress: "hideProgress", footerLayout: "footerLayout" }, outputs: { completed: "completed", cancelled: "cancelled", pathEvent: "pathEvent" }, providers: [PathFacade], queries: [{ propertyName: "customHeader", first: true, predicate: PathShellHeaderDirective, descendants: true }, { propertyName: "customFooter", first: true, predicate: PathShellFooterDirective, descendants: true }, { propertyName: "stepDirectives", predicate: PathStepDirective }], ngImport: i0, template: `
|
|
214
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: PathShellComponent, isStandalone: true, selector: "pw-shell", inputs: { path: "path", initialData: "initialData", autoStart: "autoStart", backLabel: "backLabel", nextLabel: "nextLabel", completeLabel: "completeLabel", cancelLabel: "cancelLabel", hideCancel: "hideCancel", hideProgress: "hideProgress", footerLayout: "footerLayout", validationDisplay: "validationDisplay", progressLayout: "progressLayout" }, outputs: { completed: "completed", cancelled: "cancelled", pathEvent: "pathEvent" }, providers: [PathFacade], queries: [{ propertyName: "customHeader", first: true, predicate: PathShellHeaderDirective, descendants: true }, { propertyName: "customFooter", first: true, predicate: PathShellFooterDirective, descendants: true }, { propertyName: "stepDirectives", predicate: PathStepDirective }], ngImport: i0, template: `
|
|
200
215
|
<!-- Empty state -->
|
|
201
216
|
<div class="pw-shell" *ngIf="!(facade.state$ | async)">
|
|
202
217
|
<div class="pw-shell__empty" *ngIf="!started">
|
|
@@ -206,13 +221,30 @@ export class PathShellComponent {
|
|
|
206
221
|
</div>
|
|
207
222
|
|
|
208
223
|
<!-- Active path -->
|
|
209
|
-
<div class="pw-shell" *ngIf="facade.state$ | async as s">
|
|
224
|
+
<div class="pw-shell" [ngClass]="progressLayout !== 'merged' ? 'pw-shell--progress-' + progressLayout : ''" *ngIf="facade.state$ | async as s">
|
|
225
|
+
<!-- Root progress — persistent top-level bar visible during sub-paths -->
|
|
226
|
+
<div class="pw-shell__root-progress" *ngIf="!hideProgress && s.rootProgress && progressLayout !== 'activeOnly'">
|
|
227
|
+
<div class="pw-shell__steps">
|
|
228
|
+
<div
|
|
229
|
+
*ngFor="let step of s.rootProgress!.steps; let i = index"
|
|
230
|
+
class="pw-shell__step"
|
|
231
|
+
[ngClass]="'pw-shell__step--' + step.status"
|
|
232
|
+
>
|
|
233
|
+
<span class="pw-shell__step-dot">{{ step.status === 'completed' ? '✓' : (i + 1) }}</span>
|
|
234
|
+
<span class="pw-shell__step-label">{{ step.title ?? step.id }}</span>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
<div class="pw-shell__track">
|
|
238
|
+
<div class="pw-shell__track-fill" [style.width.%]="s.rootProgress!.progress * 100"></div>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
210
242
|
<!-- Header — custom or default progress indicator -->
|
|
211
243
|
<ng-container *ngIf="customHeader; else defaultHeader">
|
|
212
244
|
<ng-container *ngTemplateOutlet="customHeader.templateRef; context: { $implicit: s }"></ng-container>
|
|
213
245
|
</ng-container>
|
|
214
246
|
<ng-template #defaultHeader>
|
|
215
|
-
<div class="pw-shell__header" *ngIf="!hideProgress && (s.stepCount > 1 || s.nestingLevel > 0)">
|
|
247
|
+
<div class="pw-shell__header" *ngIf="!hideProgress && (s.stepCount > 1 || s.nestingLevel > 0) && progressLayout !== 'rootOnly'">
|
|
216
248
|
<div class="pw-shell__steps">
|
|
217
249
|
<div
|
|
218
250
|
*ngFor="let step of s.steps; let i = index"
|
|
@@ -238,8 +270,8 @@ export class PathShellComponent {
|
|
|
238
270
|
</ng-container>
|
|
239
271
|
</div>
|
|
240
272
|
|
|
241
|
-
<!-- Validation messages —
|
|
242
|
-
<ul class="pw-shell__validation" *ngIf="s.hasAttemptedNext && fieldEntries(s).length > 0">
|
|
273
|
+
<!-- Validation messages — suppressed when validationDisplay="inline" -->
|
|
274
|
+
<ul class="pw-shell__validation" *ngIf="validationDisplay !== 'inline' && s.hasAttemptedNext && fieldEntries(s).length > 0">
|
|
243
275
|
<li *ngFor="let entry of fieldEntries(s)" class="pw-shell__validation-item">
|
|
244
276
|
<span *ngIf="entry[0] !== '_'" class="pw-shell__validation-label">{{ formatFieldKey(entry[0]) }}</span>{{ entry[1] }}
|
|
245
277
|
</li>
|
|
@@ -309,13 +341,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
309
341
|
</div>
|
|
310
342
|
|
|
311
343
|
<!-- Active path -->
|
|
312
|
-
<div class="pw-shell" *ngIf="facade.state$ | async as s">
|
|
344
|
+
<div class="pw-shell" [ngClass]="progressLayout !== 'merged' ? 'pw-shell--progress-' + progressLayout : ''" *ngIf="facade.state$ | async as s">
|
|
345
|
+
<!-- Root progress — persistent top-level bar visible during sub-paths -->
|
|
346
|
+
<div class="pw-shell__root-progress" *ngIf="!hideProgress && s.rootProgress && progressLayout !== 'activeOnly'">
|
|
347
|
+
<div class="pw-shell__steps">
|
|
348
|
+
<div
|
|
349
|
+
*ngFor="let step of s.rootProgress!.steps; let i = index"
|
|
350
|
+
class="pw-shell__step"
|
|
351
|
+
[ngClass]="'pw-shell__step--' + step.status"
|
|
352
|
+
>
|
|
353
|
+
<span class="pw-shell__step-dot">{{ step.status === 'completed' ? '✓' : (i + 1) }}</span>
|
|
354
|
+
<span class="pw-shell__step-label">{{ step.title ?? step.id }}</span>
|
|
355
|
+
</div>
|
|
356
|
+
</div>
|
|
357
|
+
<div class="pw-shell__track">
|
|
358
|
+
<div class="pw-shell__track-fill" [style.width.%]="s.rootProgress!.progress * 100"></div>
|
|
359
|
+
</div>
|
|
360
|
+
</div>
|
|
361
|
+
|
|
313
362
|
<!-- Header — custom or default progress indicator -->
|
|
314
363
|
<ng-container *ngIf="customHeader; else defaultHeader">
|
|
315
364
|
<ng-container *ngTemplateOutlet="customHeader.templateRef; context: { $implicit: s }"></ng-container>
|
|
316
365
|
</ng-container>
|
|
317
366
|
<ng-template #defaultHeader>
|
|
318
|
-
<div class="pw-shell__header" *ngIf="!hideProgress && (s.stepCount > 1 || s.nestingLevel > 0)">
|
|
367
|
+
<div class="pw-shell__header" *ngIf="!hideProgress && (s.stepCount > 1 || s.nestingLevel > 0) && progressLayout !== 'rootOnly'">
|
|
319
368
|
<div class="pw-shell__steps">
|
|
320
369
|
<div
|
|
321
370
|
*ngFor="let step of s.steps; let i = index"
|
|
@@ -341,8 +390,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
341
390
|
</ng-container>
|
|
342
391
|
</div>
|
|
343
392
|
|
|
344
|
-
<!-- Validation messages —
|
|
345
|
-
<ul class="pw-shell__validation" *ngIf="s.hasAttemptedNext && fieldEntries(s).length > 0">
|
|
393
|
+
<!-- Validation messages — suppressed when validationDisplay="inline" -->
|
|
394
|
+
<ul class="pw-shell__validation" *ngIf="validationDisplay !== 'inline' && s.hasAttemptedNext && fieldEntries(s).length > 0">
|
|
346
395
|
<li *ngFor="let entry of fieldEntries(s)" class="pw-shell__validation-item">
|
|
347
396
|
<span *ngIf="entry[0] !== '_'" class="pw-shell__validation-label">{{ formatFieldKey(entry[0]) }}</span>{{ entry[1] }}
|
|
348
397
|
</li>
|
|
@@ -415,6 +464,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
415
464
|
type: Input
|
|
416
465
|
}], footerLayout: [{
|
|
417
466
|
type: Input
|
|
467
|
+
}], validationDisplay: [{
|
|
468
|
+
type: Input
|
|
469
|
+
}], progressLayout: [{
|
|
470
|
+
type: Input
|
|
418
471
|
}], completed: [{
|
|
419
472
|
type: Output
|
|
420
473
|
}], cancelled: [{
|
package/dist/shell.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../src/shell.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EAET,KAAK,EACL,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,eAAe,EAIf,MAAM,EACN,QAAQ,EACR,uBAAuB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../src/shell.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EAET,KAAK,EACL,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,eAAe,EAIf,MAAM,EACN,QAAQ,EACR,uBAAuB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAS3C,OAAO,EAAE,UAAU,EAAE,MAAM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AI;sBAA9B,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAEhB,WAAW;sBAAnB,KAAK;gBAEG,SAAS;sBAAjB,KAAK;gBAEG,SAAS;sBAAjB,KAAK;gBAEG,SAAS;sBAAjB,KAAK;gBAEG,aAAa;sBAArB,KAAK;gBAEG,WAAW;sBAAnB,KAAK;gBAEG,UAAU;sBAAlB,KAAK;gBAEG,YAAY;sBAApB,KAAK;gBAOG,YAAY;sBAApB,KAAK;gBAOG,iBAAiB;sBAAzB,KAAK;gBAQG,cAAc;sBAAtB,KAAK;gBAEI,SAAS;sBAAlB,MAAM;gBACG,SAAS;sBAAlB,MAAM;gBACG,SAAS;sBAAlB,MAAM;gBAE6B,cAAc;sBAAjD,eAAe;uBAAC,iBAAiB;gBACM,YAAY;sBAAnD,YAAY;uBAAC,wBAAwB;gBACE,YAAY;sBAAnD,YAAY;uBAAC,wBAAwB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daltonr/pathwrite-angular",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Angular adapter for @daltonr/pathwrite-core — RxJS observables, signal-friendly, with optional <pw-shell> default UI.",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"prepublishOnly": "test -d dist && echo 'dist already built, skipping' || (npm run clean && npm run build)"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@angular/
|
|
50
|
-
"@angular/
|
|
51
|
-
"@angular/forms": ">=
|
|
49
|
+
"@angular/common": ">=17.0.0",
|
|
50
|
+
"@angular/core": ">=17.0.0",
|
|
51
|
+
"@angular/forms": ">=17.0.0",
|
|
52
52
|
"rxjs": "^7.0.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@angular/compiler": "^17.
|
|
61
|
-
"@angular/compiler-cli": "^17.
|
|
60
|
+
"@angular/compiler": "^17.3.12",
|
|
61
|
+
"@angular/compiler-cli": "^17.3.12"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@daltonr/pathwrite-core": "^0.
|
|
64
|
+
"@daltonr/pathwrite-core": "^0.7.0"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
package/src/index.ts
CHANGED
package/src/shell.ts
CHANGED
|
@@ -21,7 +21,9 @@ import {
|
|
|
21
21
|
PathData,
|
|
22
22
|
PathDefinition,
|
|
23
23
|
PathEvent,
|
|
24
|
-
PathSnapshot
|
|
24
|
+
PathSnapshot,
|
|
25
|
+
ProgressLayout,
|
|
26
|
+
RootProgress
|
|
25
27
|
} from "@daltonr/pathwrite-core";
|
|
26
28
|
import { PathFacade } from "./index";
|
|
27
29
|
|
|
@@ -147,13 +149,30 @@ export class PathShellFooterDirective {
|
|
|
147
149
|
</div>
|
|
148
150
|
|
|
149
151
|
<!-- Active path -->
|
|
150
|
-
<div class="pw-shell" *ngIf="facade.state$ | async as s">
|
|
152
|
+
<div class="pw-shell" [ngClass]="progressLayout !== 'merged' ? 'pw-shell--progress-' + progressLayout : ''" *ngIf="facade.state$ | async as s">
|
|
153
|
+
<!-- Root progress — persistent top-level bar visible during sub-paths -->
|
|
154
|
+
<div class="pw-shell__root-progress" *ngIf="!hideProgress && s.rootProgress && progressLayout !== 'activeOnly'">
|
|
155
|
+
<div class="pw-shell__steps">
|
|
156
|
+
<div
|
|
157
|
+
*ngFor="let step of s.rootProgress!.steps; let i = index"
|
|
158
|
+
class="pw-shell__step"
|
|
159
|
+
[ngClass]="'pw-shell__step--' + step.status"
|
|
160
|
+
>
|
|
161
|
+
<span class="pw-shell__step-dot">{{ step.status === 'completed' ? '✓' : (i + 1) }}</span>
|
|
162
|
+
<span class="pw-shell__step-label">{{ step.title ?? step.id }}</span>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
<div class="pw-shell__track">
|
|
166
|
+
<div class="pw-shell__track-fill" [style.width.%]="s.rootProgress!.progress * 100"></div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
|
|
151
170
|
<!-- Header — custom or default progress indicator -->
|
|
152
171
|
<ng-container *ngIf="customHeader; else defaultHeader">
|
|
153
172
|
<ng-container *ngTemplateOutlet="customHeader.templateRef; context: { $implicit: s }"></ng-container>
|
|
154
173
|
</ng-container>
|
|
155
174
|
<ng-template #defaultHeader>
|
|
156
|
-
<div class="pw-shell__header" *ngIf="!hideProgress && (s.stepCount > 1 || s.nestingLevel > 0)">
|
|
175
|
+
<div class="pw-shell__header" *ngIf="!hideProgress && (s.stepCount > 1 || s.nestingLevel > 0) && progressLayout !== 'rootOnly'">
|
|
157
176
|
<div class="pw-shell__steps">
|
|
158
177
|
<div
|
|
159
178
|
*ngFor="let step of s.steps; let i = index"
|
|
@@ -179,8 +198,8 @@ export class PathShellFooterDirective {
|
|
|
179
198
|
</ng-container>
|
|
180
199
|
</div>
|
|
181
200
|
|
|
182
|
-
<!-- Validation messages —
|
|
183
|
-
<ul class="pw-shell__validation" *ngIf="s.hasAttemptedNext && fieldEntries(s).length > 0">
|
|
201
|
+
<!-- Validation messages — suppressed when validationDisplay="inline" -->
|
|
202
|
+
<ul class="pw-shell__validation" *ngIf="validationDisplay !== 'inline' && s.hasAttemptedNext && fieldEntries(s).length > 0">
|
|
184
203
|
<li *ngFor="let entry of fieldEntries(s)" class="pw-shell__validation-item">
|
|
185
204
|
<span *ngIf="entry[0] !== '_'" class="pw-shell__validation-label">{{ formatFieldKey(entry[0]) }}</span>{{ entry[1] }}
|
|
186
205
|
</li>
|
|
@@ -258,6 +277,21 @@ export class PathShellComponent implements OnInit, OnDestroy {
|
|
|
258
277
|
* - "form": Cancel on left, Submit alone on right. Back button never shown.
|
|
259
278
|
*/
|
|
260
279
|
@Input() footerLayout: "wizard" | "form" | "auto" = "auto";
|
|
280
|
+
/**
|
|
281
|
+
* Controls whether the shell renders its auto-generated field-error summary box.
|
|
282
|
+
* - `"summary"` (default): Shell renders the labeled error list below the step body.
|
|
283
|
+
* - `"inline"`: Suppress the summary — handle errors inside the step template instead.
|
|
284
|
+
* - `"both"`: Render the shell summary AND whatever the step template renders.
|
|
285
|
+
*/
|
|
286
|
+
@Input() validationDisplay: "summary" | "inline" | "both" = "inline";
|
|
287
|
+
/**
|
|
288
|
+
* Controls how progress bars are arranged when a sub-path is active.
|
|
289
|
+
* - "merged" (default): Root and sub-path bars in one card.
|
|
290
|
+
* - "split": Root and sub-path bars as separate cards.
|
|
291
|
+
* - "rootOnly": Only the root bar — sub-path bar hidden.
|
|
292
|
+
* - "activeOnly": Only the active (sub-path) bar — root bar hidden.
|
|
293
|
+
*/
|
|
294
|
+
@Input() progressLayout: ProgressLayout = "merged";
|
|
261
295
|
|
|
262
296
|
@Output() completed = new EventEmitter<PathData>();
|
|
263
297
|
@Output() cancelled = new EventEmitter<PathData>();
|