@daltonr/pathwrite-svelte 0.6.1 → 0.6.3
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/dist/PathShell.svelte
CHANGED
|
@@ -27,6 +27,13 @@
|
|
|
27
27
|
* - "form": Cancel on left, Submit alone on right. Back button never shown.
|
|
28
28
|
*/
|
|
29
29
|
footerLayout?: "wizard" | "form" | "auto";
|
|
30
|
+
/**
|
|
31
|
+
* Controls whether the shell renders its auto-generated field-error summary box.
|
|
32
|
+
* - `"summary"` (default): Shell renders the labeled error list below the step body.
|
|
33
|
+
* - `"inline"`: Suppress the summary — handle errors inside the step template instead.
|
|
34
|
+
* - `"both"`: Render the shell summary AND whatever the step template renders.
|
|
35
|
+
*/
|
|
36
|
+
validationDisplay?: "summary" | "inline" | "both";
|
|
30
37
|
// Callback props replace event dispatching in Svelte 5
|
|
31
38
|
oncomplete?: (data: PathData) => void;
|
|
32
39
|
oncancel?: (data: PathData) => void;
|
|
@@ -50,6 +57,7 @@
|
|
|
50
57
|
hideCancel = false,
|
|
51
58
|
hideProgress = false,
|
|
52
59
|
footerLayout = 'auto',
|
|
60
|
+
validationDisplay = 'inline',
|
|
53
61
|
oncomplete,
|
|
54
62
|
oncancel,
|
|
55
63
|
onevent,
|
|
@@ -68,7 +76,7 @@
|
|
|
68
76
|
}
|
|
69
77
|
});
|
|
70
78
|
|
|
71
|
-
const { start, next, previous, cancel, goToStep, goToStepChecked, setData, restart } = pathReturn;
|
|
79
|
+
const { start, next, previous, cancel, goToStep, goToStepChecked, setData, restart: restartFn } = pathReturn;
|
|
72
80
|
|
|
73
81
|
// Provide context for child step components
|
|
74
82
|
setPathContext({
|
|
@@ -79,7 +87,7 @@
|
|
|
79
87
|
goToStep,
|
|
80
88
|
goToStepChecked,
|
|
81
89
|
setData,
|
|
82
|
-
restart: () =>
|
|
90
|
+
restart: () => restartFn(path, initialData)
|
|
83
91
|
});
|
|
84
92
|
|
|
85
93
|
// Auto-start the path when no external engine is provided
|
|
@@ -92,7 +100,7 @@
|
|
|
92
100
|
});
|
|
93
101
|
|
|
94
102
|
let snap = $derived(pathReturn.snapshot);
|
|
95
|
-
let actions = $derived({ next, previous, cancel, goToStep, goToStepChecked, setData, restart: () =>
|
|
103
|
+
let actions = $derived({ next, previous, cancel, goToStep, goToStepChecked, setData, restart: () => restartFn(path, initialData) });
|
|
96
104
|
|
|
97
105
|
// Auto-detect footer layout: single-step top-level paths use "form", everything else uses "wizard"
|
|
98
106
|
let resolvedFooterLayout = $derived(
|
|
@@ -158,8 +166,8 @@
|
|
|
158
166
|
{/if}
|
|
159
167
|
</div>
|
|
160
168
|
|
|
161
|
-
<!-- Validation messages —
|
|
162
|
-
{#if snap.hasAttemptedNext && Object.keys(snap.fieldMessages).length > 0}
|
|
169
|
+
<!-- Validation messages — suppressed when validationDisplay="inline" -->
|
|
170
|
+
{#if validationDisplay !== 'inline' && snap.hasAttemptedNext && Object.keys(snap.fieldMessages).length > 0}
|
|
163
171
|
<ul class="pw-shell__validation">
|
|
164
172
|
{#each Object.entries(snap.fieldMessages) as [key, msg]}
|
|
165
173
|
<li class="pw-shell__validation-item">
|
|
@@ -18,6 +18,13 @@ interface Props {
|
|
|
18
18
|
* - "form": Cancel on left, Submit alone on right. Back button never shown.
|
|
19
19
|
*/
|
|
20
20
|
footerLayout?: "wizard" | "form" | "auto";
|
|
21
|
+
/**
|
|
22
|
+
* Controls whether the shell renders its auto-generated field-error summary box.
|
|
23
|
+
* - `"summary"` (default): Shell renders the labeled error list below the step body.
|
|
24
|
+
* - `"inline"`: Suppress the summary — handle errors inside the step template instead.
|
|
25
|
+
* - `"both"`: Render the shell summary AND whatever the step template renders.
|
|
26
|
+
*/
|
|
27
|
+
validationDisplay?: "summary" | "inline" | "both";
|
|
21
28
|
oncomplete?: (data: PathData) => void;
|
|
22
29
|
oncancel?: (data: PathData) => void;
|
|
23
30
|
onevent?: (event: any) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PathShell.svelte.d.ts","sourceRoot":"","sources":["../src/PathShell.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGpC,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"PathShell.svelte.d.ts","sourceRoot":"","sources":["../src/PathShell.svelte.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGpC,UAAU,KAAK;IACb,IAAI,CAAC,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,WAAW,CAAC,EAAE,QAAQ,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IAC1C;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;IAElD,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACtC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAE/B,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;IAE9C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,GAAG,CAAC;CAC9B;AAwLH,QAAA,MAAM,SAAS;mBAlGQ,OAAO,CAAC,IAAI,CAAC;MAkGmB,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daltonr/pathwrite-svelte",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Svelte 5 adapter for @daltonr/pathwrite-core — runes-based reactive bindings and optional PathShell component.",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"svelte": ">=5.0.0"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@daltonr/pathwrite-core": "^0.6.
|
|
55
|
+
"@daltonr/pathwrite-core": "^0.6.3"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@sveltejs/package": "^2.5.7",
|
package/src/PathShell.svelte
CHANGED
|
@@ -27,6 +27,13 @@
|
|
|
27
27
|
* - "form": Cancel on left, Submit alone on right. Back button never shown.
|
|
28
28
|
*/
|
|
29
29
|
footerLayout?: "wizard" | "form" | "auto";
|
|
30
|
+
/**
|
|
31
|
+
* Controls whether the shell renders its auto-generated field-error summary box.
|
|
32
|
+
* - `"summary"` (default): Shell renders the labeled error list below the step body.
|
|
33
|
+
* - `"inline"`: Suppress the summary — handle errors inside the step template instead.
|
|
34
|
+
* - `"both"`: Render the shell summary AND whatever the step template renders.
|
|
35
|
+
*/
|
|
36
|
+
validationDisplay?: "summary" | "inline" | "both";
|
|
30
37
|
// Callback props replace event dispatching in Svelte 5
|
|
31
38
|
oncomplete?: (data: PathData) => void;
|
|
32
39
|
oncancel?: (data: PathData) => void;
|
|
@@ -50,6 +57,7 @@
|
|
|
50
57
|
hideCancel = false,
|
|
51
58
|
hideProgress = false,
|
|
52
59
|
footerLayout = 'auto',
|
|
60
|
+
validationDisplay = 'inline',
|
|
53
61
|
oncomplete,
|
|
54
62
|
oncancel,
|
|
55
63
|
onevent,
|
|
@@ -68,7 +76,7 @@
|
|
|
68
76
|
}
|
|
69
77
|
});
|
|
70
78
|
|
|
71
|
-
const { start, next, previous, cancel, goToStep, goToStepChecked, setData, restart } = pathReturn;
|
|
79
|
+
const { start, next, previous, cancel, goToStep, goToStepChecked, setData, restart: restartFn } = pathReturn;
|
|
72
80
|
|
|
73
81
|
// Provide context for child step components
|
|
74
82
|
setPathContext({
|
|
@@ -79,7 +87,7 @@
|
|
|
79
87
|
goToStep,
|
|
80
88
|
goToStepChecked,
|
|
81
89
|
setData,
|
|
82
|
-
restart: () =>
|
|
90
|
+
restart: () => restartFn(path, initialData)
|
|
83
91
|
});
|
|
84
92
|
|
|
85
93
|
// Auto-start the path when no external engine is provided
|
|
@@ -92,7 +100,7 @@
|
|
|
92
100
|
});
|
|
93
101
|
|
|
94
102
|
let snap = $derived(pathReturn.snapshot);
|
|
95
|
-
let actions = $derived({ next, previous, cancel, goToStep, goToStepChecked, setData, restart: () =>
|
|
103
|
+
let actions = $derived({ next, previous, cancel, goToStep, goToStepChecked, setData, restart: () => restartFn(path, initialData) });
|
|
96
104
|
|
|
97
105
|
// Auto-detect footer layout: single-step top-level paths use "form", everything else uses "wizard"
|
|
98
106
|
let resolvedFooterLayout = $derived(
|
|
@@ -158,8 +166,8 @@
|
|
|
158
166
|
{/if}
|
|
159
167
|
</div>
|
|
160
168
|
|
|
161
|
-
<!-- Validation messages —
|
|
162
|
-
{#if snap.hasAttemptedNext && Object.keys(snap.fieldMessages).length > 0}
|
|
169
|
+
<!-- Validation messages — suppressed when validationDisplay="inline" -->
|
|
170
|
+
{#if validationDisplay !== 'inline' && snap.hasAttemptedNext && Object.keys(snap.fieldMessages).length > 0}
|
|
163
171
|
<ul class="pw-shell__validation">
|
|
164
172
|
{#each Object.entries(snap.fieldMessages) as [key, msg]}
|
|
165
173
|
<li class="pw-shell__validation-item">
|