@atscript/vue-form 0.1.65 → 0.1.66
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-form-CWwgyvfw.mjs → as-form-DQM3KBU0.mjs} +2 -1
- package/dist/{as-form-DAIkyt7H.cjs → as-form-vgf6YbaG.cjs} +2 -1
- package/dist/as-form.cjs +1 -1
- package/dist/as-form.d.cts +1 -1
- package/dist/as-form.d.mts +1 -1
- package/dist/as-form.mjs +1 -1
- package/dist/{as-form.vue-BmDsOgLK.d.mts → as-form.vue-DkCr2SVN.d.mts} +1 -1
- package/dist/{as-form.vue-B6iBidP7.d.cts → as-form.vue-DlDumufM.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
|
@@ -205,7 +205,7 @@ function useAsForm(options) {
|
|
|
205
205
|
entry: void 0
|
|
206
206
|
}));
|
|
207
207
|
const submitText = computed(() => resolveFormProp(options.def().type, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_SUBMIT_TEXT, ctx.value) ?? "Submit");
|
|
208
|
-
const submitDisabled = computed(() => resolveFormProp(options.def().type, UI_FORM_FN_SUBMIT_DISABLED, void 0, ctx.value) ?? false);
|
|
208
|
+
const submitDisabled = computed(() => options.loading?.() === true || (resolveFormProp(options.def().type, UI_FORM_FN_SUBMIT_DISABLED, void 0, ctx.value) ?? false));
|
|
209
209
|
function supportsAction(def, actionId) {
|
|
210
210
|
return def.fields.some((f) => {
|
|
211
211
|
if (getFieldMeta(f.prop, UI_FORM_ACTION)?.id === actionId) return true;
|
|
@@ -349,6 +349,7 @@ var as_form_default = /* @__PURE__ */ defineComponent({
|
|
|
349
349
|
errors: () => props.errors,
|
|
350
350
|
clientFactory: () => props.clientFactory,
|
|
351
351
|
hideRootTitle: () => props.hideRootTitle,
|
|
352
|
+
loading: () => props.loading,
|
|
352
353
|
emits: {
|
|
353
354
|
submit: (data) => emit("submit", data),
|
|
354
355
|
error: (errors) => emit("error", errors),
|
|
@@ -205,7 +205,7 @@ function useAsForm(options) {
|
|
|
205
205
|
entry: void 0
|
|
206
206
|
}));
|
|
207
207
|
const submitText = (0, vue.computed)(() => (0, _atscript_ui.resolveFormProp)(options.def().type, _atscript_ui.UI_FORM_FN_SUBMIT_TEXT, _atscript_ui.UI_FORM_SUBMIT_TEXT, ctx.value) ?? "Submit");
|
|
208
|
-
const submitDisabled = (0, vue.computed)(() => (0, _atscript_ui.resolveFormProp)(options.def().type, _atscript_ui.UI_FORM_FN_SUBMIT_DISABLED, void 0, ctx.value) ?? false);
|
|
208
|
+
const submitDisabled = (0, vue.computed)(() => options.loading?.() === true || ((0, _atscript_ui.resolveFormProp)(options.def().type, _atscript_ui.UI_FORM_FN_SUBMIT_DISABLED, void 0, ctx.value) ?? false));
|
|
209
209
|
function supportsAction(def, actionId) {
|
|
210
210
|
return def.fields.some((f) => {
|
|
211
211
|
if ((0, _atscript_ui.getFieldMeta)(f.prop, _atscript_ui.UI_FORM_ACTION)?.id === actionId) return true;
|
|
@@ -349,6 +349,7 @@ var as_form_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
349
349
|
errors: () => props.errors,
|
|
350
350
|
clientFactory: () => props.clientFactory,
|
|
351
351
|
hideRootTitle: () => props.hideRootTitle,
|
|
352
|
+
loading: () => props.loading,
|
|
352
353
|
emits: {
|
|
353
354
|
submit: (data) => emit("submit", data),
|
|
354
355
|
error: (errors) => emit("error", errors),
|
package/dist/as-form.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require("./use-form-context-Dwr8Ai1v.cjs");
|
|
2
2
|
require("./use-as-nested-sections-store-jdMRxjBE.cjs");
|
|
3
3
|
require("./use-as-value-help-uANI3zWa.cjs");
|
|
4
|
-
const require_as_form = require("./as-form-
|
|
4
|
+
const require_as_form = require("./as-form-vgf6YbaG.cjs");
|
|
5
5
|
require("./as-field-wLYoaZnT.cjs");
|
|
6
6
|
require("./use-as-locale-C4z5stwD.cjs");
|
|
7
7
|
module.exports = require_as_form.as_form_default;
|
package/dist/as-form.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _default, t as Props } from "./as-form.vue-
|
|
1
|
+
import { n as _default, t as Props } from "./as-form.vue-DlDumufM.cjs";
|
|
2
2
|
export { Props, _default as default };
|
package/dist/as-form.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as _default, t as Props } from "./as-form.vue-
|
|
1
|
+
import { n as _default, t as Props } from "./as-form.vue-DkCr2SVN.mjs";
|
|
2
2
|
export { Props, _default as default };
|
package/dist/as-form.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./use-form-context-bAj7UoSe.mjs";
|
|
2
2
|
import "./use-as-nested-sections-store-lhi0z5z1.mjs";
|
|
3
3
|
import "./use-as-value-help-CBykDEjZ.mjs";
|
|
4
|
-
import { t as as_form_default } from "./as-form-
|
|
4
|
+
import { t as as_form_default } from "./as-form-DQM3KBU0.mjs";
|
|
5
5
|
import "./as-field-CXVjrEPQ.mjs";
|
|
6
6
|
import "./use-as-locale-BrFdAgnU.mjs";
|
|
7
7
|
export { as_form_default as default };
|
|
@@ -77,12 +77,12 @@ interface Props<TF, TC> {
|
|
|
77
77
|
}
|
|
78
78
|
declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
79
79
|
props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
|
|
80
|
+
onSubmit?: ((data: TFormData) => any) | undefined;
|
|
80
81
|
onError?: ((errors: {
|
|
81
82
|
path: string;
|
|
82
83
|
message: string;
|
|
83
84
|
}[]) => any) | undefined;
|
|
84
85
|
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
85
|
-
onSubmit?: ((data: TFormData) => any) | undefined;
|
|
86
86
|
"onUnsupported-action"?: ((name: string, data: TFormData) => any) | undefined;
|
|
87
87
|
onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TFormData) => any) | undefined;
|
|
88
88
|
}> & (typeof globalThis extends {
|
|
@@ -77,12 +77,12 @@ interface Props<TF, TC> {
|
|
|
77
77
|
}
|
|
78
78
|
declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
79
79
|
props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
|
|
80
|
+
onSubmit?: ((data: TFormData) => any) | undefined;
|
|
80
81
|
onError?: ((errors: {
|
|
81
82
|
path: string;
|
|
82
83
|
message: string;
|
|
83
84
|
}[]) => any) | undefined;
|
|
84
85
|
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
85
|
-
onSubmit?: ((data: TFormData) => any) | undefined;
|
|
86
86
|
"onUnsupported-action"?: ((name: string, data: TFormData) => any) | undefined;
|
|
87
87
|
onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TFormData) => any) | undefined;
|
|
88
88
|
}> & (typeof globalThis extends {
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_use_form_context = require("./use-form-context-Dwr8Ai1v.cjs");
|
|
3
3
|
const require_use_as_nested_sections_store = require("./use-as-nested-sections-store-jdMRxjBE.cjs");
|
|
4
4
|
const require_use_as_value_help = require("./use-as-value-help-uANI3zWa.cjs");
|
|
5
|
-
const require_as_form = require("./as-form-
|
|
5
|
+
const require_as_form = require("./as-form-vgf6YbaG.cjs");
|
|
6
6
|
const require_as_field = require("./as-field-wLYoaZnT.cjs");
|
|
7
7
|
const require_use_as_locale = require("./use-as-locale-C4z5stwD.cjs");
|
|
8
8
|
const require_as_iterator = require("./as-iterator-BYMNe6UJ.cjs");
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _default$6 from "./as-field.cjs";
|
|
2
|
-
import { a as TFormRule, i as TFormFieldRegistration, n as _default$8, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-
|
|
2
|
+
import { a as TFormRule, i as TFormFieldRegistration, n as _default$8, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-DlDumufM.cjs";
|
|
3
3
|
import { a as TAsTypeComponents, i as TAsComponentProps, n as TAsChangeType, o as TAsUnionContext, r as TAsComponentEmits, t as TAsBaseComponentProps } from "./types-CzMUE5Dk.cjs";
|
|
4
4
|
import _default$10 from "./as-iterator.cjs";
|
|
5
5
|
import { t as _default } from "./as-action.vue-BOLmcRHb.cjs";
|
|
@@ -330,6 +330,12 @@ interface UseAsFormOptions<TFormData = unknown, TFormContext = unknown> {
|
|
|
330
330
|
clientFactory?: () => ClientFactory$1 | undefined;
|
|
331
331
|
/** Suppress the root field's title (use when the chrome already shows the form's label). */
|
|
332
332
|
hideRootTitle?: () => boolean | undefined;
|
|
333
|
+
/**
|
|
334
|
+
* Busy-state flag. When `true`, the form is locked (inert + overlay) and the
|
|
335
|
+
* default submit button is disabled. `<AsWfForm>` wires this to its
|
|
336
|
+
* server round-trip so consumers can drop their own submit overrides.
|
|
337
|
+
*/
|
|
338
|
+
loading?: () => boolean | undefined;
|
|
333
339
|
/**
|
|
334
340
|
* Outbound callbacks. Customer form roots typically wire these to
|
|
335
341
|
* `defineEmits`; advanced uses can pass plain functions.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _default$6 from "./as-field.mjs";
|
|
2
|
-
import { a as TFormRule, i as TFormFieldRegistration, n as _default$8, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-
|
|
2
|
+
import { a as TFormRule, i as TFormFieldRegistration, n as _default$8, o as TFormState, r as TFormFieldCallbacks } from "./as-form.vue-DkCr2SVN.mjs";
|
|
3
3
|
import { a as TAsTypeComponents, i as TAsComponentProps, n as TAsChangeType, o as TAsUnionContext, r as TAsComponentEmits, t as TAsBaseComponentProps } from "./types-D0xtsrz8.mjs";
|
|
4
4
|
import _default$10 from "./as-iterator.mjs";
|
|
5
5
|
import { t as _default } from "./as-action.vue-ReXXWCRt.mjs";
|
|
@@ -330,6 +330,12 @@ interface UseAsFormOptions<TFormData = unknown, TFormContext = unknown> {
|
|
|
330
330
|
clientFactory?: () => ClientFactory$1 | undefined;
|
|
331
331
|
/** Suppress the root field's title (use when the chrome already shows the form's label). */
|
|
332
332
|
hideRootTitle?: () => boolean | undefined;
|
|
333
|
+
/**
|
|
334
|
+
* Busy-state flag. When `true`, the form is locked (inert + overlay) and the
|
|
335
|
+
* default submit button is disabled. `<AsWfForm>` wires this to its
|
|
336
|
+
* server round-trip so consumers can drop their own submit overrides.
|
|
337
|
+
*/
|
|
338
|
+
loading?: () => boolean | undefined;
|
|
333
339
|
/**
|
|
334
340
|
* Outbound callbacks. Customer form roots typically wire these to
|
|
335
341
|
* `defineEmits`; advanced uses can pass plain functions.
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as PATH_PREFIX_KEY, n as useAsUnionVariant, s as DISMISS_EXTERNAL_AT_KEY, t as formatIndexedLabelParts } from "./use-form-context-bAj7UoSe.mjs";
|
|
2
2
|
import { n as provideAsNestedSectionsStore, r as useAsNestedSectionsStore } from "./use-as-nested-sections-store-lhi0z5z1.mjs";
|
|
3
3
|
import { n as useAsValueHelp } from "./use-as-value-help-CBykDEjZ.mjs";
|
|
4
|
-
import { i as useAsExternalErrors, n as useAsForm, r as useAsState, t as as_form_default } from "./as-form-
|
|
4
|
+
import { i as useAsExternalErrors, n as useAsForm, r as useAsState, t as as_form_default } from "./as-form-DQM3KBU0.mjs";
|
|
5
5
|
import { n as useAsData, r as useAsField, t as as_field_default } from "./as-field-CXVjrEPQ.mjs";
|
|
6
6
|
import { n as useAsLocale, t as provideAsLocale } from "./use-as-locale-BrFdAgnU.mjs";
|
|
7
7
|
import { t as as_iterator_default } from "./as-iterator-CT5y1jyn.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/vue-form",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.66",
|
|
4
4
|
"description": "Type-driven form rendering for Atscript with Vue 3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"access": "public"
|
|
153
153
|
},
|
|
154
154
|
"dependencies": {
|
|
155
|
-
"@atscript/ui": "^0.1.
|
|
155
|
+
"@atscript/ui": "^0.1.66"
|
|
156
156
|
},
|
|
157
157
|
"devDependencies": {
|
|
158
158
|
"@atscript/core": "^0.1.56",
|
|
@@ -168,13 +168,13 @@
|
|
|
168
168
|
"vue": "^3",
|
|
169
169
|
"vue-tsc": "^3.2.6",
|
|
170
170
|
"vunor": "^0.2",
|
|
171
|
-
"@atscript/ui-fns": "^0.1.
|
|
171
|
+
"@atscript/ui-fns": "^0.1.66"
|
|
172
172
|
},
|
|
173
173
|
"peerDependencies": {
|
|
174
174
|
"@atscript/db-client": "^0.1.80",
|
|
175
175
|
"reka-ui": "^2.9.2",
|
|
176
176
|
"vue": "^3",
|
|
177
|
-
"@atscript/ui-fns": "^0.1.
|
|
177
|
+
"@atscript/ui-fns": "^0.1.66"
|
|
178
178
|
},
|
|
179
179
|
"scripts": {
|
|
180
180
|
"build": "node ../../scripts/gen-exports.mjs && vp pack",
|