@atscript/vue-wf 0.1.167 → 0.1.169
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/{as-wf-form-ah0D5Nn1.mjs → as-wf-form-Cb-iyrR8.mjs} +15 -3
- package/dist/as-wf-form.d.mts +1 -1
- package/dist/as-wf-form.mjs +1 -1
- package/dist/{as-wf-form.vue-C1mPDpdy.d.mts → as-wf-form.vue-DCCb9M60.d.mts} +24 -20
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +9 -9
|
@@ -344,10 +344,20 @@ var as_wf_form_default = /* @__PURE__ */ defineComponent({
|
|
|
344
344
|
emit("submit", raw);
|
|
345
345
|
wf.submit(raw);
|
|
346
346
|
}
|
|
347
|
-
|
|
347
|
+
const asForm = ref(null);
|
|
348
|
+
/** The form's `action` / `unsupported-action`: it always carries the form's data. */
|
|
349
|
+
function onFormAction(name, data) {
|
|
348
350
|
if (withDataActions.value.has(name)) wf.actionWithData(name, toRaw(data));
|
|
349
351
|
else wf.action(name);
|
|
350
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* Fired by the host (`ref`, slot): a `withData` action without data is fired
|
|
355
|
+
* by the form with its current data — what its own button sends, normalized.
|
|
356
|
+
*/
|
|
357
|
+
function onAction(name, data) {
|
|
358
|
+
if (data === void 0 && asForm.value && withDataActions.value.has(name)) asForm.value.action(name);
|
|
359
|
+
else onFormAction(name, data);
|
|
360
|
+
}
|
|
351
361
|
/** Whether the current step's form declares this action id (host gating). */
|
|
352
362
|
function supportsAction(name) {
|
|
353
363
|
return formActions.value.some((a) => a.id === name);
|
|
@@ -421,6 +431,8 @@ var as_wf_form_default = /* @__PURE__ */ defineComponent({
|
|
|
421
431
|
error: unref(wf).error.value,
|
|
422
432
|
retry: unref(wf).retry
|
|
423
433
|
}, () => [createElementVNode("div", _hoisted_5, toDisplayString(unref(wf).error.value?.message ?? unref(t)("UI_ERROR")), 1)]) : createCommentVNode("v-if", true), (openBlock(), createBlock(unref(AsForm), {
|
|
434
|
+
ref_key: "asForm",
|
|
435
|
+
ref: asForm,
|
|
424
436
|
key: unref(wf).formKey.value,
|
|
425
437
|
def: unref(wf).formDef.value,
|
|
426
438
|
"form-data": unref(wf).formData.value,
|
|
@@ -434,8 +446,8 @@ var as_wf_form_default = /* @__PURE__ */ defineComponent({
|
|
|
434
446
|
"hide-submit": __props.hideSubmit,
|
|
435
447
|
loading: unref(wf).loading.value,
|
|
436
448
|
onSubmit,
|
|
437
|
-
onAction,
|
|
438
|
-
onUnsupportedAction:
|
|
449
|
+
onAction: onFormAction,
|
|
450
|
+
onUnsupportedAction: onFormAction
|
|
439
451
|
}, createSlots({ _: 2 }, [
|
|
440
452
|
_ctx.$slots["form.header"] ? {
|
|
441
453
|
name: "form.header",
|
package/dist/as-wf-form.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as _default } from "./as-wf-form.vue-
|
|
1
|
+
import { t as _default } from "./as-wf-form.vue-DCCb9M60.mjs";
|
|
2
2
|
export { _default as default };
|
package/dist/as-wf-form.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_wf_form_default } from "./as-wf-form-
|
|
1
|
+
import { t as as_wf_form_default } from "./as-wf-form-Cb-iyrR8.mjs";
|
|
2
2
|
export { as_wf_form_default as default };
|
|
@@ -106,6 +106,10 @@ interface AsWfFormProps extends UseWfFormOptions {
|
|
|
106
106
|
navigate?: (url: string) => void | Promise<void>;
|
|
107
107
|
}
|
|
108
108
|
declare function onSubmit(data: unknown): void;
|
|
109
|
+
/**
|
|
110
|
+
* Fired by the host (`ref`, slot): a `withData` action without data is fired
|
|
111
|
+
* by the form with its current data — what its own button sends, normalized.
|
|
112
|
+
*/
|
|
109
113
|
declare function onAction(name: string, data?: unknown): void;
|
|
110
114
|
/** Whether the current step's form declares this action id (host gating). */
|
|
111
115
|
declare function supportsAction(name: string): boolean;
|
|
@@ -157,7 +161,7 @@ declare var __VLS_1: {
|
|
|
157
161
|
}, __VLS_33: {
|
|
158
162
|
error: {};
|
|
159
163
|
retry: () => Promise<void>;
|
|
160
|
-
},
|
|
164
|
+
}, __VLS_48: {
|
|
161
165
|
title: string | undefined;
|
|
162
166
|
description: string | undefined;
|
|
163
167
|
data: Record<string, unknown>;
|
|
@@ -178,7 +182,7 @@ declare var __VLS_1: {
|
|
|
178
182
|
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
179
183
|
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
180
184
|
isDirtyPath: (path: string) => boolean;
|
|
181
|
-
},
|
|
185
|
+
}, __VLS_51: {
|
|
182
186
|
title: string | undefined;
|
|
183
187
|
description: string | undefined;
|
|
184
188
|
data: Record<string, unknown>;
|
|
@@ -199,7 +203,7 @@ declare var __VLS_1: {
|
|
|
199
203
|
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
200
204
|
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
201
205
|
isDirtyPath: (path: string) => boolean;
|
|
202
|
-
},
|
|
206
|
+
}, __VLS_54: {
|
|
203
207
|
title: string | undefined;
|
|
204
208
|
description: string | undefined;
|
|
205
209
|
data: Record<string, unknown>;
|
|
@@ -220,7 +224,7 @@ declare var __VLS_1: {
|
|
|
220
224
|
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
221
225
|
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
222
226
|
isDirtyPath: (path: string) => boolean;
|
|
223
|
-
},
|
|
227
|
+
}, __VLS_57: {
|
|
224
228
|
message: string;
|
|
225
229
|
dismiss: () => void;
|
|
226
230
|
title: string | undefined;
|
|
@@ -243,7 +247,7 @@ declare var __VLS_1: {
|
|
|
243
247
|
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
244
248
|
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
245
249
|
isDirtyPath: (path: string) => boolean;
|
|
246
|
-
},
|
|
250
|
+
}, __VLS_60: {
|
|
247
251
|
text: string;
|
|
248
252
|
title: string | undefined;
|
|
249
253
|
description: string | undefined;
|
|
@@ -265,7 +269,7 @@ declare var __VLS_1: {
|
|
|
265
269
|
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
266
270
|
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
267
271
|
isDirtyPath: (path: string) => boolean;
|
|
268
|
-
},
|
|
272
|
+
}, __VLS_63: {
|
|
269
273
|
title: string | undefined;
|
|
270
274
|
description: string | undefined;
|
|
271
275
|
data: Record<string, unknown>;
|
|
@@ -286,7 +290,7 @@ declare var __VLS_1: {
|
|
|
286
290
|
getPatch: (opts?: _atscript_ui0.FormDiffOptions) => Record<string, unknown>;
|
|
287
291
|
getChanges: () => _atscript_ui0.FormFieldChange[];
|
|
288
292
|
isDirtyPath: (path: string) => boolean;
|
|
289
|
-
},
|
|
293
|
+
}, __VLS_66: {
|
|
290
294
|
title: string | undefined;
|
|
291
295
|
description: string | undefined;
|
|
292
296
|
data: Record<string, unknown>;
|
|
@@ -329,38 +333,38 @@ type __VLS_Slots = {} & {
|
|
|
329
333
|
} & {
|
|
330
334
|
'wf.error'?: (props: typeof __VLS_33) => any;
|
|
331
335
|
} & {
|
|
332
|
-
'form.header'?: (props: typeof
|
|
336
|
+
'form.header'?: (props: typeof __VLS_48) => any;
|
|
333
337
|
} & {
|
|
334
|
-
'form.before'?: (props: typeof
|
|
338
|
+
'form.before'?: (props: typeof __VLS_51) => any;
|
|
335
339
|
} & {
|
|
336
|
-
'form.after'?: (props: typeof
|
|
340
|
+
'form.after'?: (props: typeof __VLS_54) => any;
|
|
337
341
|
} & {
|
|
338
|
-
'form.error'?: (props: typeof
|
|
342
|
+
'form.error'?: (props: typeof __VLS_57) => any;
|
|
339
343
|
} & {
|
|
340
|
-
'form.submit'?: (props: typeof
|
|
344
|
+
'form.submit'?: (props: typeof __VLS_60) => any;
|
|
341
345
|
} & {
|
|
342
|
-
'form.footer'?: (props: typeof
|
|
346
|
+
'form.footer'?: (props: typeof __VLS_63) => any;
|
|
343
347
|
} & {
|
|
344
|
-
'form.loading'?: (props: typeof
|
|
348
|
+
'form.loading'?: (props: typeof __VLS_66) => any;
|
|
345
349
|
};
|
|
346
350
|
declare const __VLS_base: vue.DefineComponent<AsWfFormProps, {
|
|
347
351
|
action: typeof onAction;
|
|
348
352
|
supportsAction: typeof supportsAction;
|
|
349
353
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
350
|
-
dismiss: () => any;
|
|
351
|
-
action: (action: WfActionRequest) => any;
|
|
352
|
-
error: (error: WfFormError) => any;
|
|
353
354
|
finished: (response: unknown) => any;
|
|
355
|
+
error: (error: WfFormError) => any;
|
|
354
356
|
submit: (data: unknown) => any;
|
|
355
357
|
loading: (isLoading: boolean) => any;
|
|
358
|
+
dismiss: () => any;
|
|
359
|
+
action: (action: WfActionRequest) => any;
|
|
356
360
|
form: (def: FormDef, context?: Record<string, unknown> | undefined) => any;
|
|
357
361
|
}, string, vue.PublicProps, Readonly<AsWfFormProps> & Readonly<{
|
|
358
|
-
onDismiss?: (() => any) | undefined;
|
|
359
|
-
onAction?: ((action: WfActionRequest) => any) | undefined;
|
|
360
|
-
onError?: ((error: WfFormError) => any) | undefined;
|
|
361
362
|
onFinished?: ((response: unknown) => any) | undefined;
|
|
363
|
+
onError?: ((error: WfFormError) => any) | undefined;
|
|
362
364
|
onSubmit?: ((data: unknown) => any) | undefined;
|
|
363
365
|
onLoading?: ((isLoading: boolean) => any) | undefined;
|
|
366
|
+
onDismiss?: (() => any) | undefined;
|
|
367
|
+
onAction?: ((action: WfActionRequest) => any) | undefined;
|
|
364
368
|
onForm?: ((def: FormDef, context?: Record<string, unknown> | undefined) => any) | undefined;
|
|
365
369
|
}>, {
|
|
366
370
|
tokenTransport: "body" | "cookie" | "query";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as WfNext, i as WfMessage, n as WfButton, r as WfFinished, t as WfActionRequest } from "./index-C5MmoWFB.mjs";
|
|
2
|
-
import { a as useWfForm, i as WfFormError, n as UseWfFormOptions, r as UseWfFormReturn, t as _default$1 } from "./as-wf-form.vue-
|
|
2
|
+
import { a as useWfForm, i as WfFormError, n as UseWfFormOptions, r as UseWfFormReturn, t as _default$1 } from "./as-wf-form.vue-DCCb9M60.mjs";
|
|
3
3
|
import { t as _default } from "./as-wf-finish.vue-BhXMooP3.mjs";
|
|
4
4
|
export { _default as AsWfFinish, _default$1 as AsWfForm, type UseWfFormOptions, type UseWfFormReturn, type WfActionRequest, type WfButton, type WfFinished, type WfFormError, type WfMessage, type WfNext, useWfForm };
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as useWfForm, t as as_wf_form_default } from "./as-wf-form-
|
|
1
|
+
import { n as useWfForm, t as as_wf_form_default } from "./as-wf-form-Cb-iyrR8.mjs";
|
|
2
2
|
import { t as as_wf_finish_default } from "./as-wf-finish-DSlzLuDT.mjs";
|
|
3
3
|
export { as_wf_finish_default as AsWfFinish, as_wf_form_default as AsWfForm, useWfForm };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/vue-wf",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.169",
|
|
4
4
|
"description": "Workflow form integration for Vue 3 — HTTP round-trip loop driven by atscript type metadata",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -51,25 +51,25 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@atscript/ui": "^0.1.
|
|
54
|
+
"@atscript/ui": "^0.1.169"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@atscript/core": "^0.2.
|
|
58
|
-
"@atscript/typescript": "^0.2.
|
|
57
|
+
"@atscript/core": "^0.2.9",
|
|
58
|
+
"@atscript/typescript": "^0.2.9",
|
|
59
59
|
"@vitejs/plugin-vue": "^6",
|
|
60
60
|
"@vue/test-utils": "^2",
|
|
61
61
|
"happy-dom": "^18",
|
|
62
|
-
"unplugin-atscript": "^0.2.
|
|
62
|
+
"unplugin-atscript": "^0.2.9",
|
|
63
63
|
"vitest": "npm:@voidzero-dev/vite-plus-test@0.1.14",
|
|
64
64
|
"vue": "^3",
|
|
65
65
|
"vue-tsc": "~3.2.9",
|
|
66
|
-
"@atscript/moost-wf": "^0.1.
|
|
67
|
-
"@atscript/vue-form": "^0.1.
|
|
66
|
+
"@atscript/moost-wf": "^0.1.169",
|
|
67
|
+
"@atscript/vue-form": "^0.1.169"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@atscript/typescript": "^0.2.
|
|
70
|
+
"@atscript/typescript": "^0.2.9",
|
|
71
71
|
"vue": "^3",
|
|
72
|
-
"@atscript/vue-form": "^0.1.
|
|
72
|
+
"@atscript/vue-form": "^0.1.169"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build": "node ../../scripts/gen-exports.mjs && vp pack",
|