@atscript/vue-form 0.1.157 → 0.1.159
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-DfmlwTZL.mjs → as-form-DLYEF8Ez.mjs} +17 -8
- package/dist/{as-form-DbSg_v0Z.cjs → as-form-DgbRGqD8.cjs} +16 -7
- 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-BE04_1to.d.mts → as-form.vue-B4mw0nDk.d.mts} +10 -4
- package/dist/{as-form.vue-CyvfI0Wi.d.cts → as-form.vue-B6SWHgTX.d.cts} +10 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +9 -9
|
@@ -4,7 +4,7 @@ import { t as CLIENT_FACTORY_KEY } from "./use-as-value-help-CYMlEubv.mjs";
|
|
|
4
4
|
import { t as as_field_default } from "./as-field-DqK4Yiev.mjs";
|
|
5
5
|
import { t as as_iterator_default } from "./as-iterator-mOyaYJiN.mjs";
|
|
6
6
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, inject, isProxy, isRef, mergeProps, nextTick, normalizeProps, openBlock, provide, reactive, ref, renderSlot, shallowRef, toDisplayString, toRaw, toValue, unref, watch, watchEffect, withModifiers } from "vue";
|
|
7
|
-
import { META_DESCRIPTION, META_LABEL, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_SUBMIT_TEXT, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, collectDirtyPaths, deepClone, getByPath, getDeclaredFormActions, getFormValidator, iteratePathAncestors, mergeErrorMaps, omitPaths, resolveFormProp, setByPath, unionVariantChanged } from "@atscript/ui";
|
|
7
|
+
import { FORM_ERROR_KEY, META_DESCRIPTION, META_LABEL, UI_FORM_FN_DESCRIPTION, UI_FORM_FN_SUBMIT_DISABLED, UI_FORM_FN_SUBMIT_TEXT, UI_FORM_FN_TITLE, UI_FORM_SUBMIT_TEXT, buildDescendantErrorCounts, buildFormDiff, buildFormRebase, collectDirtyPaths, deepClone, getByPath, getDeclaredFormActions, getFormValidator, iteratePathAncestors, mergeErrorMaps, omitPaths, resolveFormProp, setByPath, unionVariantChanged } from "@atscript/ui";
|
|
8
8
|
//#region src/composables/use-as-form-patch.ts
|
|
9
9
|
/**
|
|
10
10
|
* Internal factory invoked by `useAsForm` when `trackChanges` is enabled. Owns
|
|
@@ -246,10 +246,10 @@ function useAsExternalErrors(options) {
|
|
|
246
246
|
const errs = options.source();
|
|
247
247
|
if (!errs) return void 0;
|
|
248
248
|
const dismissed = dismissedPaths.value;
|
|
249
|
-
if (dismissed.size === 0 && errs
|
|
249
|
+
if (dismissed.size === 0 && errs[FORM_ERROR_KEY] === void 0) return errs;
|
|
250
250
|
const out = {};
|
|
251
251
|
for (const k in errs) {
|
|
252
|
-
if (k ===
|
|
252
|
+
if (k === FORM_ERROR_KEY) continue;
|
|
253
253
|
if (dismissed.has(k)) continue;
|
|
254
254
|
out[k] = errs[k];
|
|
255
255
|
}
|
|
@@ -257,7 +257,7 @@ function useAsExternalErrors(options) {
|
|
|
257
257
|
});
|
|
258
258
|
const formError = computed(() => {
|
|
259
259
|
if (formDismissed.value) return void 0;
|
|
260
|
-
return options.source()?.
|
|
260
|
+
return options.source()?.[FORM_ERROR_KEY];
|
|
261
261
|
});
|
|
262
262
|
const isFormDismissed = computed(() => formDismissed.value);
|
|
263
263
|
function dismissAt(path) {
|
|
@@ -422,6 +422,7 @@ function useAsForm(options) {
|
|
|
422
422
|
if (patch) provide(FORM_PATCH_KEY, patch);
|
|
423
423
|
const reset = async () => {
|
|
424
424
|
internalErrors.value = {};
|
|
425
|
+
rootErrorDismissed.value = false;
|
|
425
426
|
await resetState();
|
|
426
427
|
patch?.rebase();
|
|
427
428
|
};
|
|
@@ -441,8 +442,15 @@ function useAsForm(options) {
|
|
|
441
442
|
const allErrors = computed(() => mergeErrorMaps(ext.effective.value, orphanInternalErrors.value, liveErrors.value));
|
|
442
443
|
function clearErrors() {
|
|
443
444
|
internalErrors.value = {};
|
|
445
|
+
rootErrorDismissed.value = false;
|
|
444
446
|
clearFieldErrors();
|
|
445
447
|
}
|
|
448
|
+
const rootErrorDismissed = ref(false);
|
|
449
|
+
const formError = computed(() => (rootErrorDismissed.value ? void 0 : liveErrors.value[""]) ?? ext.formError.value);
|
|
450
|
+
function dismissFormError() {
|
|
451
|
+
rootErrorDismissed.value = true;
|
|
452
|
+
ext.dismissForm();
|
|
453
|
+
}
|
|
446
454
|
provide(DESCENDANT_ERROR_COUNTS_KEY, computed(() => buildDescendantErrorCounts(allErrors.value)));
|
|
447
455
|
watch(allErrors, (errors) => {
|
|
448
456
|
for (const errPath of Object.keys(errors)) for (const ancestor of iteratePathAncestors(errPath)) sectionsStore.setOpen(ancestor, true);
|
|
@@ -466,7 +474,7 @@ function useAsForm(options) {
|
|
|
466
474
|
description: description.value,
|
|
467
475
|
data: data.value,
|
|
468
476
|
errors: ext.effective.value,
|
|
469
|
-
formError:
|
|
477
|
+
formError: formError.value,
|
|
470
478
|
disabled: submitDisabled.value,
|
|
471
479
|
loading: options.loading?.() === true,
|
|
472
480
|
submitText: submitText.value,
|
|
@@ -475,7 +483,7 @@ function useAsForm(options) {
|
|
|
475
483
|
clearErrors,
|
|
476
484
|
setErrors,
|
|
477
485
|
dismissError: ext.dismissAt,
|
|
478
|
-
dismissFormError
|
|
486
|
+
dismissFormError,
|
|
479
487
|
formContext: formContext.value,
|
|
480
488
|
isDirty: patch?.isDirty.value ?? false,
|
|
481
489
|
changes: patch ? patch.changes.value : EMPTY_CHANGES,
|
|
@@ -503,6 +511,7 @@ function useAsForm(options) {
|
|
|
503
511
|
}
|
|
504
512
|
provide(CHANGE_HANDLER_KEY, handleChange);
|
|
505
513
|
function onSubmit() {
|
|
514
|
+
rootErrorDismissed.value = false;
|
|
506
515
|
const result = submit();
|
|
507
516
|
if (result === true) {
|
|
508
517
|
internalErrors.value = {};
|
|
@@ -517,7 +526,7 @@ function useAsForm(options) {
|
|
|
517
526
|
return {
|
|
518
527
|
data,
|
|
519
528
|
errors: ext.effective,
|
|
520
|
-
formError
|
|
529
|
+
formError,
|
|
521
530
|
internalErrors,
|
|
522
531
|
reset,
|
|
523
532
|
clearErrors,
|
|
@@ -530,7 +539,7 @@ function useAsForm(options) {
|
|
|
530
539
|
slotProps,
|
|
531
540
|
invokeAction,
|
|
532
541
|
dismissError: ext.dismissAt,
|
|
533
|
-
dismissFormError
|
|
542
|
+
dismissFormError,
|
|
534
543
|
formContext,
|
|
535
544
|
handleChange,
|
|
536
545
|
patch,
|
|
@@ -246,10 +246,10 @@ function useAsExternalErrors(options) {
|
|
|
246
246
|
const errs = options.source();
|
|
247
247
|
if (!errs) return void 0;
|
|
248
248
|
const dismissed = dismissedPaths.value;
|
|
249
|
-
if (dismissed.size === 0 && errs.
|
|
249
|
+
if (dismissed.size === 0 && errs[_atscript_ui.FORM_ERROR_KEY] === void 0) return errs;
|
|
250
250
|
const out = {};
|
|
251
251
|
for (const k in errs) {
|
|
252
|
-
if (k ===
|
|
252
|
+
if (k === _atscript_ui.FORM_ERROR_KEY) continue;
|
|
253
253
|
if (dismissed.has(k)) continue;
|
|
254
254
|
out[k] = errs[k];
|
|
255
255
|
}
|
|
@@ -257,7 +257,7 @@ function useAsExternalErrors(options) {
|
|
|
257
257
|
});
|
|
258
258
|
const formError = (0, vue.computed)(() => {
|
|
259
259
|
if (formDismissed.value) return void 0;
|
|
260
|
-
return options.source()?.
|
|
260
|
+
return options.source()?.[_atscript_ui.FORM_ERROR_KEY];
|
|
261
261
|
});
|
|
262
262
|
const isFormDismissed = (0, vue.computed)(() => formDismissed.value);
|
|
263
263
|
function dismissAt(path) {
|
|
@@ -422,6 +422,7 @@ function useAsForm(options) {
|
|
|
422
422
|
if (patch) (0, vue.provide)(require_use_form_context.FORM_PATCH_KEY, patch);
|
|
423
423
|
const reset = async () => {
|
|
424
424
|
internalErrors.value = {};
|
|
425
|
+
rootErrorDismissed.value = false;
|
|
425
426
|
await resetState();
|
|
426
427
|
patch?.rebase();
|
|
427
428
|
};
|
|
@@ -441,8 +442,15 @@ function useAsForm(options) {
|
|
|
441
442
|
const allErrors = (0, vue.computed)(() => (0, _atscript_ui.mergeErrorMaps)(ext.effective.value, orphanInternalErrors.value, liveErrors.value));
|
|
442
443
|
function clearErrors() {
|
|
443
444
|
internalErrors.value = {};
|
|
445
|
+
rootErrorDismissed.value = false;
|
|
444
446
|
clearFieldErrors();
|
|
445
447
|
}
|
|
448
|
+
const rootErrorDismissed = (0, vue.ref)(false);
|
|
449
|
+
const formError = (0, vue.computed)(() => (rootErrorDismissed.value ? void 0 : liveErrors.value[""]) ?? ext.formError.value);
|
|
450
|
+
function dismissFormError() {
|
|
451
|
+
rootErrorDismissed.value = true;
|
|
452
|
+
ext.dismissForm();
|
|
453
|
+
}
|
|
446
454
|
(0, vue.provide)(require_use_as_nested_sections_store.DESCENDANT_ERROR_COUNTS_KEY, (0, vue.computed)(() => (0, _atscript_ui.buildDescendantErrorCounts)(allErrors.value)));
|
|
447
455
|
(0, vue.watch)(allErrors, (errors) => {
|
|
448
456
|
for (const errPath of Object.keys(errors)) for (const ancestor of (0, _atscript_ui.iteratePathAncestors)(errPath)) sectionsStore.setOpen(ancestor, true);
|
|
@@ -466,7 +474,7 @@ function useAsForm(options) {
|
|
|
466
474
|
description: description.value,
|
|
467
475
|
data: data.value,
|
|
468
476
|
errors: ext.effective.value,
|
|
469
|
-
formError:
|
|
477
|
+
formError: formError.value,
|
|
470
478
|
disabled: submitDisabled.value,
|
|
471
479
|
loading: options.loading?.() === true,
|
|
472
480
|
submitText: submitText.value,
|
|
@@ -475,7 +483,7 @@ function useAsForm(options) {
|
|
|
475
483
|
clearErrors,
|
|
476
484
|
setErrors,
|
|
477
485
|
dismissError: ext.dismissAt,
|
|
478
|
-
dismissFormError
|
|
486
|
+
dismissFormError,
|
|
479
487
|
formContext: formContext.value,
|
|
480
488
|
isDirty: patch?.isDirty.value ?? false,
|
|
481
489
|
changes: patch ? patch.changes.value : EMPTY_CHANGES,
|
|
@@ -503,6 +511,7 @@ function useAsForm(options) {
|
|
|
503
511
|
}
|
|
504
512
|
(0, vue.provide)(require_use_form_context.CHANGE_HANDLER_KEY, handleChange);
|
|
505
513
|
function onSubmit() {
|
|
514
|
+
rootErrorDismissed.value = false;
|
|
506
515
|
const result = submit();
|
|
507
516
|
if (result === true) {
|
|
508
517
|
internalErrors.value = {};
|
|
@@ -517,7 +526,7 @@ function useAsForm(options) {
|
|
|
517
526
|
return {
|
|
518
527
|
data,
|
|
519
528
|
errors: ext.effective,
|
|
520
|
-
formError
|
|
529
|
+
formError,
|
|
521
530
|
internalErrors,
|
|
522
531
|
reset,
|
|
523
532
|
clearErrors,
|
|
@@ -530,7 +539,7 @@ function useAsForm(options) {
|
|
|
530
539
|
slotProps,
|
|
531
540
|
invokeAction,
|
|
532
541
|
dismissError: ext.dismissAt,
|
|
533
|
-
dismissFormError
|
|
542
|
+
dismissFormError,
|
|
534
543
|
formContext,
|
|
535
544
|
handleChange,
|
|
536
545
|
patch,
|
package/dist/as-form.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_as_form = require("./as-form-
|
|
1
|
+
const require_as_form = require("./as-form-DgbRGqD8.cjs");
|
|
2
2
|
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-B6SWHgTX.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-B4mw0nDk.mjs";
|
|
2
2
|
export { Props, _default as default };
|
package/dist/as-form.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as as_form_default } from "./as-form-
|
|
1
|
+
import { t as as_form_default } from "./as-form-DLYEF8Ez.mjs";
|
|
2
2
|
export { as_form_default as default };
|
|
@@ -5,7 +5,7 @@ import * as _atscript_ui0 from "@atscript/ui";
|
|
|
5
5
|
import { ClientFactory, ClientFactory as ClientFactory$1, FormArrayFieldDef, FormDef, FormDiffOptions, FormDiffOptions as FormDiffOptions$1, FormFieldChange, FormFieldChange as FormFieldChange$1, FormFieldDef, FormRebaseOptions, FormRebaseOptions as FormRebaseOptions$1, FormTupleFieldDef, FormUnionFieldDef, FormUnionVariant, ResolvedValueHelp, TResolveOptions, ValueHelpInfo, getDefaultClientFactory, hasFieldMeta as hasFieldMeta$1, isFieldHidden as isFieldHidden$1, joinPath as joinPath$1, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
6
6
|
import { TFnScope } from "@atscript/ui-fns";
|
|
7
7
|
|
|
8
|
-
//#region ../../node_modules/.pnpm/@atscript+typescript@0.1.
|
|
8
|
+
//#region ../../node_modules/.pnpm/@atscript+typescript@0.1.109_@atscript+core@0.1.109_@emnapi+core@1.10.0_@emnapi+runtime_2427b2fff09bdaa5263f486056fd5fba/node_modules/@atscript/typescript/dist/utils.d.ts
|
|
9
9
|
interface TError {
|
|
10
10
|
path: string;
|
|
11
11
|
message: string;
|
|
@@ -123,8 +123,10 @@ declare class Validator<T extends TAtscriptAnnotatedType = TAtscriptAnnotatedTyp
|
|
|
123
123
|
/** `@meta.required` / `@expect.minLength` / `maxLength` / `pattern` checks for a string value. */
|
|
124
124
|
protected validateStringConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: string): boolean;
|
|
125
125
|
protected validateNumber(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: number): boolean;
|
|
126
|
-
/** `@expect.int` / `min` / `max` checks for a number value. */
|
|
126
|
+
/** `@expect.int` / `min` / `max` / `exclusiveMin` / `exclusiveMax` checks for a number value. */
|
|
127
127
|
protected validateNumberConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: number): boolean;
|
|
128
|
+
/** Reports a failed number bound: its custom message, else `Expected <label> <bound>, got <value>`. */
|
|
129
|
+
private numberBoundFailed;
|
|
128
130
|
protected validateBoolean(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: boolean): boolean;
|
|
129
131
|
/** `@meta.required` check for a boolean value (must be `true`). */
|
|
130
132
|
protected validateBooleanConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: boolean): boolean;
|
|
@@ -547,7 +549,11 @@ interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
|
|
|
547
549
|
data: ComputedRef<TFormData>;
|
|
548
550
|
/** Effective external errors (post-dismissal), excluding `__form`. */
|
|
549
551
|
errors: ComputedRef<Record<string, string | undefined> | undefined>;
|
|
550
|
-
/**
|
|
552
|
+
/**
|
|
553
|
+
* Form-level error message (post banner-dismissal): the root interface's
|
|
554
|
+
* `@ui.form.validate` error (live after the first submit), else the
|
|
555
|
+
* external `__form` error.
|
|
556
|
+
*/
|
|
551
557
|
formError: ComputedRef<string | undefined>;
|
|
552
558
|
/** Errors discovered by the local validator on the most-recent submit. */
|
|
553
559
|
internalErrors: Ref<Record<string, string>>;
|
|
@@ -1367,12 +1373,12 @@ interface Props<TF, TC> {
|
|
|
1367
1373
|
}
|
|
1368
1374
|
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<{
|
|
1369
1375
|
props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
|
|
1376
|
+
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
1370
1377
|
onError?: ((errors: {
|
|
1371
1378
|
path: string;
|
|
1372
1379
|
message: string;
|
|
1373
1380
|
}[]) => any) | undefined;
|
|
1374
1381
|
onSubmit?: ((data: TFormData) => any) | undefined;
|
|
1375
|
-
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
1376
1382
|
"onUnsupported-action"?: ((name: string, data: TFormData) => any) | undefined;
|
|
1377
1383
|
onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TFormData) => any) | undefined;
|
|
1378
1384
|
}> & (typeof globalThis extends {
|
|
@@ -5,7 +5,7 @@ import * as _atscript_ui0 from "@atscript/ui";
|
|
|
5
5
|
import { ClientFactory, ClientFactory as ClientFactory$1, FormArrayFieldDef, FormDef, FormDiffOptions, FormDiffOptions as FormDiffOptions$1, FormFieldChange, FormFieldChange as FormFieldChange$1, FormFieldDef, FormRebaseOptions, FormRebaseOptions as FormRebaseOptions$1, FormTupleFieldDef, FormUnionFieldDef, FormUnionVariant, ResolvedValueHelp, TResolveOptions, ValueHelpInfo, getDefaultClientFactory, hasFieldMeta, isFieldHidden, joinPath, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
6
6
|
import { TFnScope } from "@atscript/ui-fns";
|
|
7
7
|
|
|
8
|
-
//#region ../../node_modules/.pnpm/@atscript+typescript@0.1.
|
|
8
|
+
//#region ../../node_modules/.pnpm/@atscript+typescript@0.1.109_@atscript+core@0.1.109_@emnapi+core@1.10.0_@emnapi+runtime_2427b2fff09bdaa5263f486056fd5fba/node_modules/@atscript/typescript/dist/utils.d.ts
|
|
9
9
|
interface TError {
|
|
10
10
|
path: string;
|
|
11
11
|
message: string;
|
|
@@ -123,8 +123,10 @@ declare class Validator<T extends TAtscriptAnnotatedType = TAtscriptAnnotatedTyp
|
|
|
123
123
|
/** `@meta.required` / `@expect.minLength` / `maxLength` / `pattern` checks for a string value. */
|
|
124
124
|
protected validateStringConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: string): boolean;
|
|
125
125
|
protected validateNumber(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: number): boolean;
|
|
126
|
-
/** `@expect.int` / `min` / `max` checks for a number value. */
|
|
126
|
+
/** `@expect.int` / `min` / `max` / `exclusiveMin` / `exclusiveMax` checks for a number value. */
|
|
127
127
|
protected validateNumberConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: number): boolean;
|
|
128
|
+
/** Reports a failed number bound: its custom message, else `Expected <label> <bound>, got <value>`. */
|
|
129
|
+
private numberBoundFailed;
|
|
128
130
|
protected validateBoolean(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: boolean): boolean;
|
|
129
131
|
/** `@meta.required` check for a boolean value (must be `true`). */
|
|
130
132
|
protected validateBooleanConstraints(metadata: TMetadataMap<AtscriptMetadata>, value: boolean): boolean;
|
|
@@ -547,7 +549,11 @@ interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
|
|
|
547
549
|
data: ComputedRef<TFormData>;
|
|
548
550
|
/** Effective external errors (post-dismissal), excluding `__form`. */
|
|
549
551
|
errors: ComputedRef<Record<string, string | undefined> | undefined>;
|
|
550
|
-
/**
|
|
552
|
+
/**
|
|
553
|
+
* Form-level error message (post banner-dismissal): the root interface's
|
|
554
|
+
* `@ui.form.validate` error (live after the first submit), else the
|
|
555
|
+
* external `__form` error.
|
|
556
|
+
*/
|
|
551
557
|
formError: ComputedRef<string | undefined>;
|
|
552
558
|
/** Errors discovered by the local validator on the most-recent submit. */
|
|
553
559
|
internalErrors: Ref<Record<string, string>>;
|
|
@@ -1367,12 +1373,12 @@ interface Props<TF, TC> {
|
|
|
1367
1373
|
}
|
|
1368
1374
|
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<{
|
|
1369
1375
|
props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
|
|
1376
|
+
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
1370
1377
|
onError?: ((errors: {
|
|
1371
1378
|
path: string;
|
|
1372
1379
|
message: string;
|
|
1373
1380
|
}[]) => any) | undefined;
|
|
1374
1381
|
onSubmit?: ((data: TFormData) => any) | undefined;
|
|
1375
|
-
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
1376
1382
|
"onUnsupported-action"?: ((name: string, data: TFormData) => any) | undefined;
|
|
1377
1383
|
onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TFormData) => any) | undefined;
|
|
1378
1384
|
}> & (typeof globalThis extends {
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_use_form_context = require("./use-form-context-B6ZnzfxG.cjs");
|
|
3
|
-
const require_as_form = require("./as-form-
|
|
3
|
+
const require_as_form = require("./as-form-DgbRGqD8.cjs");
|
|
4
4
|
const require_use_as_nested_sections_store = require("./use-as-nested-sections-store-u1VgBJAP.cjs");
|
|
5
5
|
const require_use_as_value_help = require("./use-as-value-help-CDmkz6A7.cjs");
|
|
6
6
|
const require_as_field = require("./as-field-C_DB6Lbi.cjs");
|
package/dist/index.d.cts
CHANGED
|
@@ -20,5 +20,5 @@ import { t as _default$13 } from "./as-number.vue-DE33Giq3.cjs";
|
|
|
20
20
|
import { t as _default$4 } from "./as-date.vue-BiUgcOwZ.cjs";
|
|
21
21
|
import { t as _default$5 } from "./as-datetime.vue-BVc6jcUI.cjs";
|
|
22
22
|
import { t as _default$19 } from "./as-time.vue-CmvsgHJd.cjs";
|
|
23
|
-
import { $ as AsNestedSectionsStore, A as UseAsDecimalOptions, At as TFormFieldCallbacks, B as UseAsOptionalAddFlowReturn, C as useAsDate, Ct as useAsFormPatch, D as UseAsNumberOptions, Dt as UseAsFieldOptions, E as useAsDualInput, Et as useAsState, F as useAsLocale, Ft as createAsFormDef, G as useAsVisibleFields, H as focusFirstAfter, I as UseAsTriStateCheckboxOptions, J as TResolveFieldPropOptions, K as UseAsOptionalFieldReturn, L as UseAsTriStateCheckboxReturn, M as useAsDecimal, Mt as TFormRule, N as UseAsLocaleReturn, Nt as TFormState, O as UseAsNumberReturn, Ot as UseAsFieldReturn, P as provideAsLocale, Pt as createDefaultTypes, Q as useAsLevel, R as useAsTriStateCheckbox, S as UseAsDateReturn, St as RebaseOntoResult, T as UseAsDualInputReturn, Tt as UseAsStateReturn, U as focusNewFocusableAfter, V as useAsOptionalAddFlow, W as useAsFocusFirstAfter, X as useAsFieldScope, Y as UseAsFieldScopeReturn, Z as provideAsNestedLevel, _ as UseAsTypeMapReturn, _t as useAsExternalErrors, a as FormFieldChange, at as UseAsValueHelpReturn, b as useAsPath, bt as useAsForm, c as hasFieldMeta, ct as useAsUnionVariant, d as resetDefaultClientFactory, dt as UseAsTupleReturn, et as provideAsNestedSectionsStore, f as setDefaultClientFactory, ft as useAsTuple, g as useAsData, gt as UseAsExternalErrorsReturn, h as UseAsDataReturn, ht as UseAsExternalErrorsOptions, i as FormDiffOptions, it as UseAsValueHelpOptions, j as UseAsDecimalReturn, jt as TFormFieldRegistration, k as useAsNumber, kt as useAsField, l as isFieldHidden, lt as UseAsUnionReturn, m as useAsErrorDismiss, mt as useAsArray, n as _default$9, nt as useAsNestedSectionsStore, o as FormRebaseOptions, ot as useAsValueHelp, p as AsErrorDismiss, pt as UseAsArrayReturn, q as useAsOptionalField, r as ClientFactory, rt as useAsDropdown, s as getDefaultClientFactory, st as formatIndexedLabelParts, tt as useAsDescendantErrorCounts, u as joinPath, ut as useAsUnion, v as useAsTypeMap, vt as UseAsFormOptions, w as UseAsDualInputOptions, wt as TFormSubmitValidator, x as UseAsDateOptions, xt as AsFormPatchHandle, y as UseAsPathReturn, yt as UseAsFormReturn, z as UseAsOptionalAddFlowOptions } from "./as-form.vue-
|
|
23
|
+
import { $ as AsNestedSectionsStore, A as UseAsDecimalOptions, At as TFormFieldCallbacks, B as UseAsOptionalAddFlowReturn, C as useAsDate, Ct as useAsFormPatch, D as UseAsNumberOptions, Dt as UseAsFieldOptions, E as useAsDualInput, Et as useAsState, F as useAsLocale, Ft as createAsFormDef, G as useAsVisibleFields, H as focusFirstAfter, I as UseAsTriStateCheckboxOptions, J as TResolveFieldPropOptions, K as UseAsOptionalFieldReturn, L as UseAsTriStateCheckboxReturn, M as useAsDecimal, Mt as TFormRule, N as UseAsLocaleReturn, Nt as TFormState, O as UseAsNumberReturn, Ot as UseAsFieldReturn, P as provideAsLocale, Pt as createDefaultTypes, Q as useAsLevel, R as useAsTriStateCheckbox, S as UseAsDateReturn, St as RebaseOntoResult, T as UseAsDualInputReturn, Tt as UseAsStateReturn, U as focusNewFocusableAfter, V as useAsOptionalAddFlow, W as useAsFocusFirstAfter, X as useAsFieldScope, Y as UseAsFieldScopeReturn, Z as provideAsNestedLevel, _ as UseAsTypeMapReturn, _t as useAsExternalErrors, a as FormFieldChange, at as UseAsValueHelpReturn, b as useAsPath, bt as useAsForm, c as hasFieldMeta, ct as useAsUnionVariant, d as resetDefaultClientFactory, dt as UseAsTupleReturn, et as provideAsNestedSectionsStore, f as setDefaultClientFactory, ft as useAsTuple, g as useAsData, gt as UseAsExternalErrorsReturn, h as UseAsDataReturn, ht as UseAsExternalErrorsOptions, i as FormDiffOptions, it as UseAsValueHelpOptions, j as UseAsDecimalReturn, jt as TFormFieldRegistration, k as useAsNumber, kt as useAsField, l as isFieldHidden, lt as UseAsUnionReturn, m as useAsErrorDismiss, mt as useAsArray, n as _default$9, nt as useAsNestedSectionsStore, o as FormRebaseOptions, ot as useAsValueHelp, p as AsErrorDismiss, pt as UseAsArrayReturn, q as useAsOptionalField, r as ClientFactory, rt as useAsDropdown, s as getDefaultClientFactory, st as formatIndexedLabelParts, tt as useAsDescendantErrorCounts, u as joinPath, ut as useAsUnion, v as useAsTypeMap, vt as UseAsFormOptions, w as UseAsDualInputOptions, wt as TFormSubmitValidator, x as UseAsDateOptions, xt as AsFormPatchHandle, y as UseAsPathReturn, yt as UseAsFormReturn, z as UseAsOptionalAddFlowOptions } from "./as-form.vue-B6SWHgTX.cjs";
|
|
24
24
|
export { _default as AsAction, _default$1 as AsArray, _default$2 as AsCheckbox, _default$3 as AsCollapsible, _default$4 as AsDate, _default$5 as AsDatetime, _default$6 as AsDecimal, AsErrorDismiss, _default$7 as AsField, _default$8 as AsFieldShell, _default$9 as AsForm, AsFormPatchHandle, _default$10 as AsInput, _default$11 as AsIterator, _default$12 as AsMultiSelect, AsNestedSectionsStore, _default$13 as AsNumber, _default$14 as AsObject, _default$15 as AsParagraph, _default$16 as AsRadio, _default$17 as AsRef, _default$18 as AsSelect, _default$19 as AsTime, _default$20 as AsTuple, _default$21 as AsUnion, ClientFactory, FormDiffOptions, FormFieldChange, FormRebaseOptions, RebaseOntoResult, TAsBaseComponentProps, TAsChangeType, TAsCollapsibleProps, TAsCollapsibleSlots, TAsComponentEmits, TAsComponentProps, TAsTypeComponents, TAsUnionContext, TFormFieldCallbacks, TFormFieldRegistration, TFormRule, TFormState, TFormSubmitValidator, TResolveFieldPropOptions, UseAsArrayReturn, UseAsDataReturn, UseAsDateOptions, UseAsDateReturn, UseAsDecimalOptions, UseAsDecimalReturn, UseAsDualInputOptions, UseAsDualInputReturn, UseAsExternalErrorsOptions, UseAsExternalErrorsReturn, UseAsFieldOptions, UseAsFieldReturn, UseAsFieldScopeReturn, UseAsFormOptions, UseAsFormReturn, UseAsLocaleReturn, UseAsNumberOptions, UseAsNumberReturn, UseAsOptionalAddFlowOptions, UseAsOptionalAddFlowReturn, UseAsOptionalFieldReturn, UseAsPathReturn, UseAsStateReturn, UseAsTriStateCheckboxOptions, UseAsTriStateCheckboxReturn, UseAsTupleReturn, UseAsTypeMapReturn, UseAsUnionReturn, UseAsValueHelpOptions, UseAsValueHelpReturn, createAsFormDef, createDefaultTypes, focusFirstAfter, focusNewFocusableAfter, formatIndexedLabelParts, getDefaultClientFactory, hasFieldMeta, isFieldHidden, joinPath, provideAsLocale, provideAsNestedLevel, provideAsNestedSectionsStore, resetDefaultClientFactory, setDefaultClientFactory, useAsArray, useAsData, useAsDate, useAsDecimal, useAsDescendantErrorCounts, useAsDropdown, useAsDualInput, useAsErrorDismiss, useAsExternalErrors, useAsField, useAsFieldScope, useAsFocusFirstAfter, useAsForm, useAsFormPatch, useAsLevel, useAsLocale, useAsNestedSectionsStore, useAsNumber, useAsOptionalAddFlow, useAsOptionalField, useAsPath, useAsState, useAsTriStateCheckbox, useAsTuple, useAsTypeMap, useAsUnion, useAsUnionVariant, useAsValueHelp, useAsVisibleFields };
|
package/dist/index.d.mts
CHANGED
|
@@ -20,5 +20,5 @@ import { t as _default$13 } from "./as-number.vue-BiZ2B2iJ.mjs";
|
|
|
20
20
|
import { t as _default$4 } from "./as-date.vue-BVvALvZ_.mjs";
|
|
21
21
|
import { t as _default$5 } from "./as-datetime.vue-CCQqZsKA.mjs";
|
|
22
22
|
import { t as _default$19 } from "./as-time.vue-DGfZPnWK.mjs";
|
|
23
|
-
import { $ as AsNestedSectionsStore, A as UseAsDecimalOptions, At as TFormFieldCallbacks, B as UseAsOptionalAddFlowReturn, C as useAsDate, Ct as useAsFormPatch, D as UseAsNumberOptions, Dt as UseAsFieldOptions, E as useAsDualInput, Et as useAsState, F as useAsLocale, Ft as createAsFormDef, G as useAsVisibleFields, H as focusFirstAfter, I as UseAsTriStateCheckboxOptions, J as TResolveFieldPropOptions, K as UseAsOptionalFieldReturn, L as UseAsTriStateCheckboxReturn, M as useAsDecimal, Mt as TFormRule, N as UseAsLocaleReturn, Nt as TFormState, O as UseAsNumberReturn, Ot as UseAsFieldReturn, P as provideAsLocale, Pt as createDefaultTypes, Q as useAsLevel, R as useAsTriStateCheckbox, S as UseAsDateReturn, St as RebaseOntoResult, T as UseAsDualInputReturn, Tt as UseAsStateReturn, U as focusNewFocusableAfter, V as useAsOptionalAddFlow, W as useAsFocusFirstAfter, X as useAsFieldScope, Y as UseAsFieldScopeReturn, Z as provideAsNestedLevel, _ as UseAsTypeMapReturn, _t as useAsExternalErrors, a as FormFieldChange, at as UseAsValueHelpReturn, b as useAsPath, bt as useAsForm, c as hasFieldMeta, ct as useAsUnionVariant, d as resetDefaultClientFactory, dt as UseAsTupleReturn, et as provideAsNestedSectionsStore, f as setDefaultClientFactory, ft as useAsTuple, g as useAsData, gt as UseAsExternalErrorsReturn, h as UseAsDataReturn, ht as UseAsExternalErrorsOptions, i as FormDiffOptions, it as UseAsValueHelpOptions, j as UseAsDecimalReturn, jt as TFormFieldRegistration, k as useAsNumber, kt as useAsField, l as isFieldHidden, lt as UseAsUnionReturn, m as useAsErrorDismiss, mt as useAsArray, n as _default$9, nt as useAsNestedSectionsStore, o as FormRebaseOptions, ot as useAsValueHelp, p as AsErrorDismiss, pt as UseAsArrayReturn, q as useAsOptionalField, r as ClientFactory, rt as useAsDropdown, s as getDefaultClientFactory, st as formatIndexedLabelParts, tt as useAsDescendantErrorCounts, u as joinPath, ut as useAsUnion, v as useAsTypeMap, vt as UseAsFormOptions, w as UseAsDualInputOptions, wt as TFormSubmitValidator, x as UseAsDateOptions, xt as AsFormPatchHandle, y as UseAsPathReturn, yt as UseAsFormReturn, z as UseAsOptionalAddFlowOptions } from "./as-form.vue-
|
|
23
|
+
import { $ as AsNestedSectionsStore, A as UseAsDecimalOptions, At as TFormFieldCallbacks, B as UseAsOptionalAddFlowReturn, C as useAsDate, Ct as useAsFormPatch, D as UseAsNumberOptions, Dt as UseAsFieldOptions, E as useAsDualInput, Et as useAsState, F as useAsLocale, Ft as createAsFormDef, G as useAsVisibleFields, H as focusFirstAfter, I as UseAsTriStateCheckboxOptions, J as TResolveFieldPropOptions, K as UseAsOptionalFieldReturn, L as UseAsTriStateCheckboxReturn, M as useAsDecimal, Mt as TFormRule, N as UseAsLocaleReturn, Nt as TFormState, O as UseAsNumberReturn, Ot as UseAsFieldReturn, P as provideAsLocale, Pt as createDefaultTypes, Q as useAsLevel, R as useAsTriStateCheckbox, S as UseAsDateReturn, St as RebaseOntoResult, T as UseAsDualInputReturn, Tt as UseAsStateReturn, U as focusNewFocusableAfter, V as useAsOptionalAddFlow, W as useAsFocusFirstAfter, X as useAsFieldScope, Y as UseAsFieldScopeReturn, Z as provideAsNestedLevel, _ as UseAsTypeMapReturn, _t as useAsExternalErrors, a as FormFieldChange, at as UseAsValueHelpReturn, b as useAsPath, bt as useAsForm, c as hasFieldMeta, ct as useAsUnionVariant, d as resetDefaultClientFactory, dt as UseAsTupleReturn, et as provideAsNestedSectionsStore, f as setDefaultClientFactory, ft as useAsTuple, g as useAsData, gt as UseAsExternalErrorsReturn, h as UseAsDataReturn, ht as UseAsExternalErrorsOptions, i as FormDiffOptions, it as UseAsValueHelpOptions, j as UseAsDecimalReturn, jt as TFormFieldRegistration, k as useAsNumber, kt as useAsField, l as isFieldHidden, lt as UseAsUnionReturn, m as useAsErrorDismiss, mt as useAsArray, n as _default$9, nt as useAsNestedSectionsStore, o as FormRebaseOptions, ot as useAsValueHelp, p as AsErrorDismiss, pt as UseAsArrayReturn, q as useAsOptionalField, r as ClientFactory, rt as useAsDropdown, s as getDefaultClientFactory, st as formatIndexedLabelParts, tt as useAsDescendantErrorCounts, u as joinPath, ut as useAsUnion, v as useAsTypeMap, vt as UseAsFormOptions, w as UseAsDualInputOptions, wt as TFormSubmitValidator, x as UseAsDateOptions, xt as AsFormPatchHandle, y as UseAsPathReturn, yt as UseAsFormReturn, z as UseAsOptionalAddFlowOptions } from "./as-form.vue-B4mw0nDk.mjs";
|
|
24
24
|
export { _default as AsAction, _default$1 as AsArray, _default$2 as AsCheckbox, _default$3 as AsCollapsible, _default$4 as AsDate, _default$5 as AsDatetime, _default$6 as AsDecimal, AsErrorDismiss, _default$7 as AsField, _default$8 as AsFieldShell, _default$9 as AsForm, AsFormPatchHandle, _default$10 as AsInput, _default$11 as AsIterator, _default$12 as AsMultiSelect, AsNestedSectionsStore, _default$13 as AsNumber, _default$14 as AsObject, _default$15 as AsParagraph, _default$16 as AsRadio, _default$17 as AsRef, _default$18 as AsSelect, _default$19 as AsTime, _default$20 as AsTuple, _default$21 as AsUnion, ClientFactory, FormDiffOptions, FormFieldChange, FormRebaseOptions, RebaseOntoResult, TAsBaseComponentProps, TAsChangeType, TAsCollapsibleProps, TAsCollapsibleSlots, TAsComponentEmits, TAsComponentProps, TAsTypeComponents, TAsUnionContext, TFormFieldCallbacks, TFormFieldRegistration, TFormRule, TFormState, TFormSubmitValidator, TResolveFieldPropOptions, UseAsArrayReturn, UseAsDataReturn, UseAsDateOptions, UseAsDateReturn, UseAsDecimalOptions, UseAsDecimalReturn, UseAsDualInputOptions, UseAsDualInputReturn, UseAsExternalErrorsOptions, UseAsExternalErrorsReturn, UseAsFieldOptions, UseAsFieldReturn, UseAsFieldScopeReturn, UseAsFormOptions, UseAsFormReturn, UseAsLocaleReturn, UseAsNumberOptions, UseAsNumberReturn, UseAsOptionalAddFlowOptions, UseAsOptionalAddFlowReturn, UseAsOptionalFieldReturn, UseAsPathReturn, UseAsStateReturn, UseAsTriStateCheckboxOptions, UseAsTriStateCheckboxReturn, UseAsTupleReturn, UseAsTypeMapReturn, UseAsUnionReturn, UseAsValueHelpOptions, UseAsValueHelpReturn, createAsFormDef, createDefaultTypes, focusFirstAfter, focusNewFocusableAfter, formatIndexedLabelParts, getDefaultClientFactory, hasFieldMeta, isFieldHidden, joinPath, provideAsLocale, provideAsNestedLevel, provideAsNestedSectionsStore, resetDefaultClientFactory, setDefaultClientFactory, useAsArray, useAsData, useAsDate, useAsDecimal, useAsDescendantErrorCounts, useAsDropdown, useAsDualInput, useAsErrorDismiss, useAsExternalErrors, useAsField, useAsFieldScope, useAsFocusFirstAfter, useAsForm, useAsFormPatch, useAsLevel, useAsLocale, useAsNestedSectionsStore, useAsNumber, useAsOptionalAddFlow, useAsOptionalField, useAsPath, useAsState, useAsTriStateCheckbox, useAsTuple, useAsTypeMap, useAsUnion, useAsUnionVariant, useAsValueHelp, useAsVisibleFields };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as PATH_PREFIX_KEY, n as useAsUnionVariant, s as DISMISS_EXTERNAL_AT_KEY, t as formatIndexedLabelParts } from "./use-form-context-cDW2GW4-.mjs";
|
|
2
|
-
import { a as useAsFormPatch, i as useAsExternalErrors, n as useAsForm, r as useAsState, t as as_form_default } from "./as-form-
|
|
2
|
+
import { a as useAsFormPatch, i as useAsExternalErrors, n as useAsForm, r as useAsState, t as as_form_default } from "./as-form-DLYEF8Ez.mjs";
|
|
3
3
|
import { i as useAsNestedSectionsStore, n as provideAsNestedSectionsStore, r as useAsDescendantErrorCounts } from "./use-as-nested-sections-store-Dfo971PK.mjs";
|
|
4
4
|
import { n as useAsValueHelp } from "./use-as-value-help-CYMlEubv.mjs";
|
|
5
5
|
import { a as useAsField, i as useAsFieldScope, n as useAsData, r as useAsOptionalField, t as as_field_default } from "./as-field-DqK4Yiev.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.159",
|
|
4
4
|
"description": "Type-driven form rendering for Atscript with Vue 3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"atscript",
|
|
@@ -160,29 +160,29 @@
|
|
|
160
160
|
"access": "public"
|
|
161
161
|
},
|
|
162
162
|
"dependencies": {
|
|
163
|
-
"@atscript/ui": "^0.1.
|
|
163
|
+
"@atscript/ui": "^0.1.159"
|
|
164
164
|
},
|
|
165
165
|
"devDependencies": {
|
|
166
|
-
"@atscript/core": "^0.1.
|
|
167
|
-
"@atscript/db-client": "^0.1.
|
|
168
|
-
"@atscript/typescript": "^0.1.
|
|
166
|
+
"@atscript/core": "^0.1.109",
|
|
167
|
+
"@atscript/db-client": "^0.1.163",
|
|
168
|
+
"@atscript/typescript": "^0.1.109",
|
|
169
169
|
"@tsdown/css": "^0.21.4",
|
|
170
170
|
"@vitejs/plugin-vue": "^6",
|
|
171
171
|
"@vue/test-utils": "^2",
|
|
172
172
|
"happy-dom": "^18",
|
|
173
173
|
"reka-ui": "^2.9.8",
|
|
174
|
-
"unplugin-atscript": "^0.1.
|
|
174
|
+
"unplugin-atscript": "^0.1.109",
|
|
175
175
|
"vitest": "npm:@voidzero-dev/vite-plus-test@0.1.14",
|
|
176
176
|
"vue": "^3",
|
|
177
177
|
"vue-tsc": "~3.2.9",
|
|
178
178
|
"vunor": "^0.3.2",
|
|
179
|
-
"@atscript/ui-fns": "^0.1.
|
|
179
|
+
"@atscript/ui-fns": "^0.1.159"
|
|
180
180
|
},
|
|
181
181
|
"peerDependencies": {
|
|
182
|
-
"@atscript/db-client": "^0.1.
|
|
182
|
+
"@atscript/db-client": "^0.1.163",
|
|
183
183
|
"reka-ui": "^2.9.8",
|
|
184
184
|
"vue": "^3",
|
|
185
|
-
"@atscript/ui-fns": "^0.1.
|
|
185
|
+
"@atscript/ui-fns": "^0.1.159"
|
|
186
186
|
},
|
|
187
187
|
"scripts": {
|
|
188
188
|
"build": "node ../../scripts/gen-exports.mjs && vp pack",
|