@atscript/vue-form 0.1.163 → 0.1.165
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-action.d.cts +1 -1
- package/dist/as-action.d.mts +1 -1
- package/dist/{as-action.vue-wcB6Dkpu.d.cts → as-action.vue-CYGG4gUQ.d.mts} +1 -1
- package/dist/{as-action.vue-yDKx8hC0.d.mts → as-action.vue-Cp9Q8a-6.d.cts} +1 -1
- package/dist/{as-array-CD_Z7lZV.mjs → as-array-B2axGw3v.mjs} +15 -12
- package/dist/{as-array-CX52_z_L.cjs → as-array-C97cLzdA.cjs} +16 -13
- package/dist/{as-array-clear-btn-COfRUzeb.cjs → as-array-clear-btn-BBFccQjO.cjs} +5 -3
- package/dist/{as-array-clear-btn-BY1IBwBP.mjs → as-array-clear-btn-DEH8a3_N.mjs} +6 -4
- package/dist/as-array.cjs +1 -1
- package/dist/as-array.d.cts +1 -1
- package/dist/as-array.d.mts +1 -1
- package/dist/as-array.mjs +1 -1
- package/dist/{as-array.vue-BoKbyO1a.d.cts → as-array.vue-Cgfjz2I-.d.cts} +1 -1
- package/dist/{as-array.vue-DKcxkmjP.d.mts → as-array.vue-Wj9giGdu.d.mts} +1 -1
- package/dist/{as-checkbox-DosdhEuS.mjs → as-checkbox-BO8xW0OM.mjs} +36 -12
- package/dist/{as-checkbox-QO5Oh13K.cjs → as-checkbox-Wn-PmHi-.cjs} +35 -11
- package/dist/as-checkbox.cjs +1 -1
- package/dist/as-checkbox.d.cts +1 -1
- package/dist/as-checkbox.d.mts +1 -1
- package/dist/as-checkbox.mjs +1 -1
- package/dist/{as-checkbox.vue-BXS5v6Ru.d.mts → as-checkbox.vue-CWe73b3Z.d.mts} +1 -1
- package/dist/{as-checkbox.vue-DdttMJAS.d.cts → as-checkbox.vue-CXiUHIZj.d.cts} +1 -1
- package/dist/{as-collapsible-CQyuXwj9.cjs → as-collapsible-BGeuF2Bn.cjs} +4 -2
- package/dist/{as-collapsible-DHSlSMfY.mjs → as-collapsible-Cb9SgJh9.mjs} +5 -3
- package/dist/as-collapsible.cjs +1 -1
- package/dist/as-collapsible.d.cts +1 -1
- package/dist/as-collapsible.d.mts +1 -1
- package/dist/as-collapsible.mjs +1 -1
- package/dist/{as-collapsible.vue-1JSWgRMg.d.cts → as-collapsible.vue-BXwe24OV.d.cts} +1 -1
- package/dist/{as-collapsible.vue-DowxhNde.d.mts → as-collapsible.vue-hfAqxx1w.d.mts} +1 -1
- package/dist/{as-date-DTUQP2Dc.cjs → as-date-B2dgUoau.cjs} +1 -1
- package/dist/{as-date-DyQsn7Mu.mjs → as-date-jQpwe6sr.mjs} +1 -1
- package/dist/as-date.cjs +1 -1
- package/dist/as-date.d.cts +1 -1
- package/dist/as-date.d.mts +1 -1
- package/dist/as-date.mjs +1 -1
- package/dist/{as-date.vue-BVvALvZ_.d.mts → as-date.vue-BTm9X4fW.d.mts} +1 -1
- package/dist/{as-date.vue-BiUgcOwZ.d.cts → as-date.vue-axahL_Zv.d.cts} +1 -1
- package/dist/{as-datetime-BDJtlZLz.cjs → as-datetime-CmBLyjgU.cjs} +1 -1
- package/dist/{as-datetime-CrstxtPJ.mjs → as-datetime-DYn9NndT.mjs} +1 -1
- package/dist/as-datetime.cjs +1 -1
- package/dist/as-datetime.d.cts +1 -1
- package/dist/as-datetime.d.mts +1 -1
- package/dist/as-datetime.mjs +1 -1
- package/dist/{as-datetime.vue-BVc6jcUI.d.cts → as-datetime.vue-C6ILTI-7.d.cts} +1 -1
- package/dist/{as-datetime.vue-CCQqZsKA.d.mts → as-datetime.vue-vysHc3Ug.d.mts} +1 -1
- package/dist/{as-decimal-Bimpnzo2.mjs → as-decimal-C-OJ8ygU.mjs} +4 -3
- package/dist/{as-decimal-BZWqiKXZ.cjs → as-decimal-C0Eqd9nM.cjs} +4 -3
- package/dist/as-decimal.cjs +1 -1
- package/dist/as-decimal.d.cts +1 -1
- package/dist/as-decimal.d.mts +1 -1
- package/dist/as-decimal.mjs +1 -1
- package/dist/{as-decimal.vue-BDfM2ICc.d.mts → as-decimal.vue-CAq25zbX.d.mts} +1 -1
- package/dist/{as-decimal.vue-Cc9pNTqj.d.cts → as-decimal.vue-Dgfz9UDJ.d.cts} +1 -1
- package/dist/{as-field-DqK4Yiev.mjs → as-field-BZpWLPcM.mjs} +32 -16
- package/dist/{as-field-C_DB6Lbi.cjs → as-field-D0HgywQY.cjs} +31 -15
- package/dist/{as-field-shell-Bxqa_ZsU.mjs → as-field-shell-D7XovzgJ.mjs} +14 -7
- package/dist/{as-field-shell-BrJpCzIA.cjs → as-field-shell-DSj3CqN6.cjs} +14 -7
- package/dist/as-field-shell.cjs +1 -1
- package/dist/as-field-shell.d.cts +1 -1
- package/dist/as-field-shell.d.mts +1 -1
- package/dist/as-field-shell.mjs +1 -1
- package/dist/{as-field-shell.vue-B1ep312_.d.cts → as-field-shell.vue-BU0_8-uI.d.mts} +1 -1
- package/dist/{as-field-shell.vue-DisEXQI1.d.mts → as-field-shell.vue-DAcRqi7G.d.cts} +1 -1
- package/dist/as-field.cjs +1 -1
- package/dist/as-field.mjs +1 -1
- package/dist/{as-form-DLYEF8Ez.mjs → as-form-0VCxVsGo.mjs} +20 -11
- package/dist/{as-form-DgbRGqD8.cjs → as-form-ChyW9bj2.cjs} +19 -10
- 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-BmKBCn6P.d.cts → as-form.vue-CjNW1L-x.d.cts} +55 -326
- package/dist/{as-form.vue-hHJm_Rxq.d.mts → as-form.vue-NCTvXZUy.d.mts} +55 -326
- package/dist/{as-input-UkZxRSD4.cjs → as-input-Bf94SAOY.cjs} +1 -1
- package/dist/{as-input-65rtLZt3.mjs → as-input-DlLLiAYI.mjs} +1 -1
- package/dist/as-input.cjs +1 -1
- package/dist/as-input.d.cts +1 -1
- package/dist/as-input.d.mts +1 -1
- package/dist/as-input.mjs +1 -1
- package/dist/{as-input.vue-CL-Om6Ed.d.mts → as-input.vue-CyLveDWK.d.mts} +1 -1
- package/dist/{as-input.vue-D-RM35Rp.d.cts → as-input.vue-mZ0h1Q2J.d.cts} +1 -1
- package/dist/{as-iterator-DHNJwo-R.cjs → as-iterator-Bty6f5Bq.cjs} +2 -2
- package/dist/{as-iterator-mOyaYJiN.mjs → as-iterator-Dp1OiwU7.mjs} +2 -2
- package/dist/as-iterator.cjs +1 -1
- package/dist/as-iterator.mjs +1 -1
- package/dist/{as-multi-select-AC05uVzY.mjs → as-multi-select-DT0M_1_O.mjs} +97 -26
- package/dist/{as-multi-select-BedSzod1.cjs → as-multi-select-ZGBYoI48.cjs} +95 -24
- package/dist/as-multi-select.cjs +1 -1
- package/dist/as-multi-select.d.cts +1 -1
- package/dist/as-multi-select.d.mts +1 -1
- package/dist/as-multi-select.mjs +1 -1
- package/dist/{as-multi-select.vue-5GHWrbim.d.mts → as-multi-select.vue-BS9bNhCB.d.mts} +1 -1
- package/dist/{as-multi-select.vue-D1OnCH-x.d.cts → as-multi-select.vue-DAFz9hZR.d.cts} +1 -1
- package/dist/{as-number-BMsgxGQw.cjs → as-number-DXQCnc9d.cjs} +2 -2
- package/dist/{as-number-6DTZnVfg.mjs → as-number-DkG5GuGW.mjs} +2 -2
- package/dist/as-number.cjs +1 -1
- package/dist/as-number.d.cts +1 -1
- package/dist/as-number.d.mts +1 -1
- package/dist/as-number.mjs +1 -1
- package/dist/{as-number.vue-BiZ2B2iJ.d.mts → as-number.vue-BsJdJS36.d.cts} +1 -1
- package/dist/{as-number.vue-DE33Giq3.d.cts → as-number.vue-DSP2S_xP.d.mts} +1 -1
- package/dist/{as-object-YYxV2y77.cjs → as-object-DLdKOhxb.cjs} +14 -8
- package/dist/{as-object-B_x-yycI.mjs → as-object-mpRxIKVB.mjs} +14 -8
- package/dist/as-object.cjs +1 -1
- package/dist/as-object.d.cts +1 -1
- package/dist/as-object.d.mts +1 -1
- package/dist/as-object.mjs +1 -1
- package/dist/{as-object.vue-Dg4IT2JT.d.mts → as-object.vue-CpDhlJ_D.d.mts} +1 -1
- package/dist/{as-object.vue-PUhmGqhY.d.cts → as-object.vue-DduGoHKD.d.cts} +1 -1
- package/dist/as-paragraph.d.cts +1 -1
- package/dist/as-paragraph.d.mts +1 -1
- package/dist/{as-paragraph.vue-BUfbXaiy.d.cts → as-paragraph.vue-BJSA27kd.d.cts} +1 -1
- package/dist/{as-paragraph.vue-Bp-MUDcH.d.mts → as-paragraph.vue-CMUaF6WV.d.mts} +1 -1
- package/dist/{as-radio-Dg9c4dGh.mjs → as-radio-CW9YWBnC.mjs} +3 -3
- package/dist/{as-radio-C06SIAFY.cjs → as-radio-D9sctKpc.cjs} +2 -2
- package/dist/as-radio.cjs +1 -1
- package/dist/as-radio.d.cts +1 -1
- package/dist/as-radio.d.mts +1 -1
- package/dist/as-radio.mjs +1 -1
- package/dist/{as-radio.vue-NmjJm8Pj.d.mts → as-radio.vue-BR2ThEbi.d.mts} +1 -1
- package/dist/{as-radio.vue-h4XkpaW0.d.cts → as-radio.vue-Dw1QaJoY.d.cts} +1 -1
- package/dist/{as-ref-BEhS_vo9.cjs → as-ref-CpHMAAJu.cjs} +5 -3
- package/dist/{as-ref-BWJlIf5G.mjs → as-ref-DaCGfshO.mjs} +5 -3
- package/dist/as-ref.cjs +1 -1
- package/dist/as-ref.d.cts +1 -1
- package/dist/as-ref.d.mts +1 -1
- package/dist/as-ref.mjs +1 -1
- package/dist/{as-ref.vue-ec447Bmx.d.cts → as-ref.vue-CZzOVBz1.d.mts} +1 -1
- package/dist/{as-ref.vue-vP2P1ePF.d.mts → as-ref.vue-CvY88H7p.d.cts} +1 -1
- package/dist/{as-select-CrTKlmhd.mjs → as-select-CrjlxcgR.mjs} +3 -3
- package/dist/{as-select-DzEUs8Od.cjs → as-select-DAbNosmB.cjs} +2 -2
- package/dist/as-select.cjs +1 -1
- package/dist/as-select.d.cts +1 -1
- package/dist/as-select.d.mts +1 -1
- package/dist/as-select.mjs +1 -1
- package/dist/{as-select.vue-9mQ6cjW7.d.mts → as-select.vue-7xiuC9JG.d.cts} +1 -1
- package/dist/{as-select.vue-DV0C1MsH.d.cts → as-select.vue-BPPctxZT.d.mts} +1 -1
- package/dist/{as-time-BQ6KXMyV.mjs → as-time-BmXXgfCZ.mjs} +1 -1
- package/dist/{as-time-Cu-8mKpR.cjs → as-time-NaICaSIj.cjs} +1 -1
- package/dist/as-time.cjs +1 -1
- package/dist/as-time.d.cts +1 -1
- package/dist/as-time.d.mts +1 -1
- package/dist/as-time.mjs +1 -1
- package/dist/{as-time.vue-CmvsgHJd.d.cts → as-time.vue-CQhIKAs0.d.cts} +1 -1
- package/dist/{as-time.vue-DGfZPnWK.d.mts → as-time.vue-CjzRrsFg.d.mts} +1 -1
- package/dist/{as-tuple-Dny4Ov_j.mjs → as-tuple-BBx6P6xb.mjs} +8 -6
- package/dist/{as-tuple-CfgSnsT9.cjs → as-tuple-DkI9fp4G.cjs} +8 -6
- package/dist/as-tuple.cjs +1 -1
- package/dist/as-tuple.d.cts +1 -1
- package/dist/as-tuple.d.mts +1 -1
- package/dist/as-tuple.mjs +1 -1
- package/dist/{as-tuple.vue-CInEbMRo.d.mts → as-tuple.vue-BSh2-1uv.d.cts} +1 -1
- package/dist/{as-tuple.vue-zZkuYxet.d.cts → as-tuple.vue-DvHHrn-6.d.mts} +1 -1
- package/dist/{as-union-DT8XDZSt.cjs → as-union-BjmrvD80.cjs} +8 -6
- package/dist/{as-union-Gz8gEjmn.mjs → as-union-C3QiGYlE.mjs} +7 -5
- package/dist/as-union.cjs +1 -1
- package/dist/as-union.d.cts +1 -1
- package/dist/as-union.d.mts +1 -1
- package/dist/as-union.mjs +1 -1
- package/dist/{as-union.vue-Bz3EO0Gg.d.mts → as-union.vue-BJ8xFYYb.d.mts} +1 -1
- package/dist/{as-union.vue-K9ZSRg0G.d.cts → as-union.vue-CnF4bNex.d.cts} +1 -1
- package/dist/{as-variant-picker-B3GLhKyt.mjs → as-variant-picker-BUF7Am9t.mjs} +13 -8
- package/dist/{as-variant-picker-JlEhh7YO.cjs → as-variant-picker-BcJx7Zt7.cjs} +14 -9
- package/dist/index.cjs +30 -27
- package/dist/index.d.cts +23 -22
- package/dist/index.d.mts +23 -22
- package/dist/index.mjs +29 -26
- package/dist/locale.cjs +5 -0
- package/dist/locale.d.cts +2 -0
- package/dist/locale.d.mts +2 -0
- package/dist/locale.mjs +2 -0
- package/dist/{types-BLoV3zIo.d.mts → types-BoguW89D.d.mts} +24 -19
- package/dist/{types-Crwu2D-w.d.cts → types-DoLxVJhd.d.cts} +24 -19
- package/dist/use-as-locale-1k9NBn-G.mjs +56 -0
- package/dist/use-as-locale-BVcC0l75.d.mts +35 -0
- package/dist/use-as-locale-C2tFUenv.cjs +73 -0
- package/dist/use-as-locale-CnGzoVWd.d.cts +35 -0
- package/dist/{use-as-value-help-CDmkz6A7.cjs → use-as-value-help-BE-fAZRP.cjs} +4 -2
- package/dist/{use-as-value-help-CYMlEubv.mjs → use-as-value-help-nIpEFMqD.mjs} +4 -2
- package/dist/{use-form-context-cDW2GW4-.mjs → use-form-context-C3FxL3eF.mjs} +4 -1
- package/dist/{use-form-context-B6ZnzfxG.cjs → use-form-context-CXsLnG7l.cjs} +4 -1
- package/dist/{use-as-dropdown-B2Shb7wn.mjs → variant-label-B065kts3.mjs} +13 -1
- package/dist/{use-as-dropdown-Bj9toVdw.cjs → variant-label-C-rLK7Z3.cjs} +18 -0
- package/package.json +16 -11
- package/dist/use-as-locale-BrFdAgnU.mjs +0 -23
- package/dist/use-as-locale-C4z5stwD.cjs +0 -34
|
@@ -1,306 +1,12 @@
|
|
|
1
|
-
import { c as TAsUnionContext, n as TAsChangeType, o as TAsComponentProps, s as TAsTypeComponents } from "./types-
|
|
1
|
+
import { c as TAsUnionContext, n as TAsChangeType, o as TAsComponentProps, s as TAsTypeComponents } from "./types-DoLxVJhd.cjs";
|
|
2
2
|
import * as vue from "vue";
|
|
3
3
|
import { Component, ComputedRef, MaybeRef, MaybeRefOrGetter, Ref, ShallowRef, WritableComputedRef } from "vue";
|
|
4
4
|
import * as _atscript_ui0 from "@atscript/ui";
|
|
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";
|
|
5
|
+
import { ClientFactory, ClientFactory as ClientFactory$1, CreateFormDefOptions, FormArrayFieldDef, FormDef, FormDiffOptions, FormDiffOptions as FormDiffOptions$1, FormFieldChange, FormFieldChange as FormFieldChange$1, FormFieldDef, FormRebaseOptions, FormRebaseOptions as FormRebaseOptions$1, FormTupleFieldDef, FormUnionFieldDef, FormUnionVariant, ResolvedValueHelp, TResolveOptions, TypedClientFactory, ValueHelpInfo, getDefaultClientFactory, hasFieldMeta, isFieldHidden, joinPath, resetDefaultClientFactory, setDefaultClientFactory } from "@atscript/ui";
|
|
6
|
+
import * as _atscript_typescript_utils0 from "@atscript/typescript/utils";
|
|
7
|
+
import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
|
|
6
8
|
import { TFnScope } from "@atscript/ui-fns";
|
|
7
9
|
|
|
8
|
-
//#region ../../node_modules/.pnpm/@atscript+typescript@0.2.3_@atscript+core@0.2.3_@emnapi+core@1.10.0_@emnapi+runtime@1.1_827f363eb78bb82886801a5bf792b425/node_modules/@atscript/typescript/dist/utils.d.ts
|
|
9
|
-
interface TError {
|
|
10
|
-
path: string;
|
|
11
|
-
message: string;
|
|
12
|
-
details?: TError[];
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* A plugin function that can intercept validation.
|
|
16
|
-
*
|
|
17
|
-
* Return `true` to accept the value, `false` to reject it,
|
|
18
|
-
* or `undefined` to fall through to the default validation.
|
|
19
|
-
*/
|
|
20
|
-
type TValidatorPlugin = (ctx: TValidatorPluginContext, def: TAtscriptAnnotatedType, value: any) => boolean | undefined;
|
|
21
|
-
/** Options for configuring {@link Validator} behavior. */
|
|
22
|
-
interface TValidatorOptions {
|
|
23
|
-
partial: boolean | 'deep' | ((type: TAtscriptAnnotatedType<TAtscriptTypeObject>, path: string) => boolean);
|
|
24
|
-
replace?: (type: TAtscriptAnnotatedType, path: string) => TAtscriptAnnotatedType;
|
|
25
|
-
plugins: TValidatorPlugin[];
|
|
26
|
-
unknownProps: 'strip' | 'ignore' | 'error';
|
|
27
|
-
errorLimit: number;
|
|
28
|
-
skipList?: Set<string>;
|
|
29
|
-
}
|
|
30
|
-
/** Context exposed to {@link TValidatorPlugin} functions. */
|
|
31
|
-
interface TValidatorPluginContext {
|
|
32
|
-
opts: Validator<any>['opts'];
|
|
33
|
-
/**
|
|
34
|
-
* Validates `value` against `def` at the current path (errors go to the current level). With
|
|
35
|
-
* `unknownProps: 'strip'`, a call that returns `false` strips nothing: the keys it recorded are
|
|
36
|
-
* dropped, as for a rejected union branch, so trying alternatives (`a || b`) strips what the
|
|
37
|
-
* union `a | b` would.
|
|
38
|
-
*/
|
|
39
|
-
validateAnnotatedType: Validator<any>['validateAnnotatedType'];
|
|
40
|
-
error: Validator<any>['error'];
|
|
41
|
-
path: Validator<any>['path'];
|
|
42
|
-
/**
|
|
43
|
-
* The type the validator was created for — the root of the walk, as passed to the
|
|
44
|
-
* constructor (before `replace`). The plugin's `def` argument is the node visited now.
|
|
45
|
-
*/
|
|
46
|
-
readonly root: TAtscriptAnnotatedType;
|
|
47
|
-
context: unknown;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Validates values against an {@link TAtscriptAnnotatedType} definition.
|
|
51
|
-
*
|
|
52
|
-
* `DataType` is automatically inferred from the type definition's phantom generic,
|
|
53
|
-
* enabling the {@link validate} method to act as a type guard.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```ts
|
|
57
|
-
* // From a generated interface class:
|
|
58
|
-
* const validator = new Validator(MyInterface)
|
|
59
|
-
* if (validator.validate(data, true)) {
|
|
60
|
-
* data // narrowed to MyInterface
|
|
61
|
-
* }
|
|
62
|
-
*
|
|
63
|
-
* // Or use the built-in factory:
|
|
64
|
-
* MyInterface.validator().validate(data)
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
* @typeParam T - The annotated type definition.
|
|
68
|
-
* @typeParam DataType - The TypeScript type that `validate` narrows to (auto-inferred).
|
|
69
|
-
*/
|
|
70
|
-
declare class Validator<T extends TAtscriptAnnotatedType = TAtscriptAnnotatedType, DataType = TAtscriptDataType<T>> {
|
|
71
|
-
protected readonly def: T;
|
|
72
|
-
protected opts: TValidatorOptions;
|
|
73
|
-
protected hasPlugins: boolean;
|
|
74
|
-
protected hasReplace: boolean;
|
|
75
|
-
private replaceCache?;
|
|
76
|
-
constructor(def: T, opts?: Partial<TValidatorOptions>);
|
|
77
|
-
/** Validation errors collected during the last {@link validate} call. */
|
|
78
|
-
errors: TError[];
|
|
79
|
-
protected stackErrors: Array<TError[] | null>;
|
|
80
|
-
protected pathSegments: string[];
|
|
81
|
-
protected depth: number;
|
|
82
|
-
protected limitExceeded: boolean;
|
|
83
|
-
protected context: unknown;
|
|
84
|
-
/**
|
|
85
|
-
* The unions over objects this call decided inside union branches (value → outcomes). A union
|
|
86
|
-
* nested in its own branches, many branches each, is reached again with the same value and path
|
|
87
|
-
* from every branch of every union above it — (branches)^(depth) work. The memo is made once
|
|
88
|
-
* the call has wasted {@link WASTE_BEFORE_MEMO} union branches (failed after branches of nested
|
|
89
|
-
* unions over objects failed) since the outermost union, as in the pre-check — ordinary walks
|
|
90
|
-
* never make it. It decides each such union once, with the same result and the same error object
|
|
91
|
-
* (both depend only on these, the options and the input, which the walk never changes), and
|
|
92
|
-
* records the same strips again.
|
|
93
|
-
*/
|
|
94
|
-
private unionMemo?;
|
|
95
|
-
/** Union branches being checked (`> 0`: inside a union branch). */
|
|
96
|
-
private unionDepth;
|
|
97
|
-
/** Failed branches of unions over objects inside union branches (see `unionMemo`). */
|
|
98
|
-
private nestedFailures;
|
|
99
|
-
/** Wasted union branches since the outermost union was entered (see `unionMemo`). */
|
|
100
|
-
private wasted;
|
|
101
|
-
/**
|
|
102
|
-
* `unknownProps: 'strip'`: the unknown keys of the objects that passed (`object, key, …`), in the
|
|
103
|
-
* order the objects completed, then in key order. A rejected union branch, pattern property
|
|
104
|
-
* attempt or plugin sub-validation drops what it recorded; the keys are deleted once the whole
|
|
105
|
-
* call passes (`performStrips`).
|
|
106
|
-
*/
|
|
107
|
-
private strips;
|
|
108
|
-
protected buildPath(): string;
|
|
109
|
-
protected push(name: string): void;
|
|
110
|
-
protected pop(saveErrors: boolean): TError[] | null | undefined;
|
|
111
|
-
protected clear(): void;
|
|
112
|
-
protected error(message: string, path?: string, details?: TError[]): TError;
|
|
113
|
-
/** Adds `error`, already made, to the errors of the current level (as {@link error} does). */
|
|
114
|
-
private report;
|
|
115
|
-
protected throw(): void;
|
|
116
|
-
/**
|
|
117
|
-
* Validates a value against the type definition.
|
|
118
|
-
*
|
|
119
|
-
* Acts as a TypeScript type guard — when it returns `true`, the value
|
|
120
|
-
* is narrowed to `DataType`.
|
|
121
|
-
*
|
|
122
|
-
* @param value - The value to validate.
|
|
123
|
-
* @param safe - If `true`, returns `false` on failure instead of throwing.
|
|
124
|
-
* @returns `true` if the value matches the type definition.
|
|
125
|
-
* @throws {ValidatorError} When validation fails and `safe` is not `true`.
|
|
126
|
-
*/
|
|
127
|
-
validate<TT = DataType>(value: any, safe?: boolean, context?: unknown): value is TT;
|
|
128
|
-
/**
|
|
129
|
-
* Plain `Validator` without plugins / `replace`: eligible for the allocation-free
|
|
130
|
-
* shortcuts. Subclasses may override the protected `validate*` hooks, so they
|
|
131
|
-
* always take the full walk. (A getter, not a constructor-set field: validators are
|
|
132
|
-
* often built per call, so construction stays as cheap as before.)
|
|
133
|
-
*/
|
|
134
|
-
private get shortcuts();
|
|
135
|
-
/** Validates `value` against `def` (after `replace`, `optional` and the plugins). */
|
|
136
|
-
protected validateSafe(def: TAtscriptAnnotatedType, value: any): boolean;
|
|
137
|
-
/**
|
|
138
|
-
* What {@link validateSafe} decides of `def` (replaced) before its own validation: an
|
|
139
|
-
* optional `def` passes `undefined` / `null`, a plugin may decide — `undefined` to go on.
|
|
140
|
-
*/
|
|
141
|
-
private preCheck;
|
|
142
|
-
/** The context the plugins get (see {@link pluginContext}), made on the first plugin call. */
|
|
143
|
-
private pluginCtx?;
|
|
144
|
-
/**
|
|
145
|
-
* The plugins' view of this validator: its state read live; `validateAnnotatedType` drops the
|
|
146
|
-
* strips a failed call recorded (a failed validation at any level strips nothing).
|
|
147
|
-
*/
|
|
148
|
-
private pluginContext;
|
|
149
|
-
/** `def` as the `replace` option replaces it at the current path (memoized per node). */
|
|
150
|
-
private replaced;
|
|
151
|
-
protected get path(): string;
|
|
152
|
-
/** The type this validator was created for (see {@link TValidatorPluginContext.root}). */
|
|
153
|
-
protected get root(): T;
|
|
154
|
-
protected validateAnnotatedType(def: TAtscriptAnnotatedType, value: any): boolean;
|
|
155
|
-
protected validateUnion(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
|
|
156
|
-
/** A union branch failed after branches of nested unions over objects did (see `unionMemo`). */
|
|
157
|
-
private wasteBranch;
|
|
158
|
-
/** The outcome this call recorded for union `def` over `value` at `path` (see `unionMemo`). */
|
|
159
|
-
private decided;
|
|
160
|
-
/**
|
|
161
|
-
* Records the outcome of union `def` over `value` at `path`, entered with `kept` strips (the
|
|
162
|
-
* ones after them are its own).
|
|
163
|
-
*/
|
|
164
|
-
private decide;
|
|
165
|
-
/**
|
|
166
|
-
* Constraints annotated on the union itself (`@expect.min 0` on `number | null`)
|
|
167
|
-
* apply to the non-null value that matched `branch`, on top of the branch's own.
|
|
168
|
-
* A literal branch (an enum value) is exempt: its value is fixed.
|
|
169
|
-
*/
|
|
170
|
-
protected validateUnionConstraints(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, branch: TAtscriptAnnotatedType, value: any): boolean;
|
|
171
|
-
/** Every member must pass, each on its own (JSON Schema `allOf`). */
|
|
172
|
-
protected validateIntersection(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
|
|
173
|
-
/**
|
|
174
|
-
* An unknown key (`unknownProps`): 'error' reports it, 'strip' adds it to the keys to strip
|
|
175
|
-
* (returned; recorded in `strips` once the object passed).
|
|
176
|
-
*/
|
|
177
|
-
private unknownKey;
|
|
178
|
-
/** The `skipList` keys of the object at the current path. */
|
|
179
|
-
private skipListHere;
|
|
180
|
-
protected validateTuple(def: TAtscriptAnnotatedType<TAtscriptTypeComplex>, value: any): boolean;
|
|
181
|
-
protected validateArray(def: TAtscriptAnnotatedType<TAtscriptTypeArray>, value: any): boolean;
|
|
182
|
-
/** `@expect.minLength` / `maxLength` / `array.uniqueItems` checks for an array value. */
|
|
183
|
-
protected validateArrayConstraints(meta: TMetadataMap<AtscriptMetadata>, value: any[], of?: TAtscriptAnnotatedType): boolean;
|
|
184
|
-
protected validateObject(def: TAtscriptAnnotatedType<TAtscriptTypeObject>, value: any): boolean;
|
|
185
|
-
protected validatePrimitive(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: any): boolean;
|
|
186
|
-
protected validateString(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: string): boolean;
|
|
187
|
-
/** `@meta.required` / `@expect.minLength` / `maxLength` / `pattern` checks for a string value. */
|
|
188
|
-
protected validateStringConstraints(meta: TMetadataMap<AtscriptMetadata>, value: string): boolean;
|
|
189
|
-
protected validateNumber(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: number): boolean;
|
|
190
|
-
/** `@expect.int` / `min` / `max` / `exclusiveMin` / `exclusiveMax` checks for a number value. */
|
|
191
|
-
protected validateNumberConstraints(meta: TMetadataMap<AtscriptMetadata>, value: number): boolean;
|
|
192
|
-
/** Reports a failed number bound: its custom message, else `Expected <label> <bound>, got <value>`. */
|
|
193
|
-
private numberBoundFailed;
|
|
194
|
-
protected validateBoolean(def: TAtscriptAnnotatedType<TAtscriptTypeFinal>, value: boolean): boolean;
|
|
195
|
-
/** `@meta.required` check for a boolean value (must be `true`). */
|
|
196
|
-
protected validateBooleanConstraints(meta: TMetadataMap<AtscriptMetadata>, value: boolean): boolean;
|
|
197
|
-
}
|
|
198
|
-
/** Error thrown by {@link Validator.validate} when validation fails. Contains structured error details. */
|
|
199
|
-
/** Type definition for union, intersection, or tuple types. */
|
|
200
|
-
interface TAtscriptTypeComplex<DataType = unknown> {
|
|
201
|
-
kind: 'union' | 'intersection' | 'tuple';
|
|
202
|
-
items: TAtscriptAnnotatedType[];
|
|
203
|
-
tags: Set<AtscriptPrimitiveTags>;
|
|
204
|
-
/** @internal phantom — carries the DataType at the type level, never set at runtime */
|
|
205
|
-
__dataType?: DataType;
|
|
206
|
-
}
|
|
207
|
-
/** Type definition for array types. */
|
|
208
|
-
interface TAtscriptTypeArray<DataType = unknown[]> {
|
|
209
|
-
kind: 'array';
|
|
210
|
-
of: TAtscriptAnnotatedType;
|
|
211
|
-
tags: Set<AtscriptPrimitiveTags>;
|
|
212
|
-
/** @internal phantom — carries the DataType at the type level, never set at runtime */
|
|
213
|
-
__dataType?: DataType;
|
|
214
|
-
}
|
|
215
|
-
/** Type definition for object types with named and pattern-matched properties. */
|
|
216
|
-
interface TAtscriptTypeObject<K extends string = string, DataType = Record<K, unknown>> {
|
|
217
|
-
kind: 'object';
|
|
218
|
-
props: Map<K, TAtscriptAnnotatedType>;
|
|
219
|
-
propsPatterns: Array<{
|
|
220
|
-
pattern: RegExp;
|
|
221
|
-
def: TAtscriptAnnotatedType;
|
|
222
|
-
}>;
|
|
223
|
-
tags: Set<AtscriptPrimitiveTags>;
|
|
224
|
-
/** @internal phantom — carries the DataType at the type level, never set at runtime */
|
|
225
|
-
__dataType?: DataType;
|
|
226
|
-
}
|
|
227
|
-
/** Type definition for primitive/literal types (string, number, boolean, null, etc.). */
|
|
228
|
-
interface TAtscriptTypeFinal<DataType = unknown> {
|
|
229
|
-
kind: '';
|
|
230
|
-
/**
|
|
231
|
-
* design type
|
|
232
|
-
*/
|
|
233
|
-
designType: 'string' | 'number' | 'boolean' | 'undefined' | 'null' | 'object' | 'any' | 'never' | 'phantom' | 'decimal';
|
|
234
|
-
/**
|
|
235
|
-
* value for literals
|
|
236
|
-
*/
|
|
237
|
-
value?: string | number | boolean;
|
|
238
|
-
tags: Set<AtscriptPrimitiveTags>;
|
|
239
|
-
/** @internal phantom — carries the DataType at the type level, never set at runtime */
|
|
240
|
-
__dataType?: DataType;
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Extract DataType from a type def's phantom generic
|
|
244
|
-
*/
|
|
245
|
-
type InferDataType<T> = T extends {
|
|
246
|
-
__dataType?: infer D;
|
|
247
|
-
} ? D : unknown;
|
|
248
|
-
/**
|
|
249
|
-
* Extract the DataType from a {@link TAtscriptAnnotatedType}.
|
|
250
|
-
*
|
|
251
|
-
* Resolves the phantom `__dataType` carried by the type definition.
|
|
252
|
-
* When `__dataType` is `unknown` (unset), falls back to the constructor
|
|
253
|
-
* instance type if `T` is also a class (i.e. a generated interface).
|
|
254
|
-
*
|
|
255
|
-
* @example
|
|
256
|
-
* ```ts
|
|
257
|
-
* import type { TAtscriptDataType } from '@atscript/typescript/utils'
|
|
258
|
-
* import MyInterface from './my-interface.as'
|
|
259
|
-
*
|
|
260
|
-
* type Data = TAtscriptDataType<typeof MyInterface>
|
|
261
|
-
* ```
|
|
262
|
-
*/
|
|
263
|
-
type TAtscriptDataType<T extends TAtscriptAnnotatedType = TAtscriptAnnotatedType> = T extends {
|
|
264
|
-
type: {
|
|
265
|
-
__dataType?: infer D;
|
|
266
|
-
};
|
|
267
|
-
} ? unknown extends D ? T extends (new (...args: any[]) => infer I) ? I : unknown : D : unknown;
|
|
268
|
-
/** Union of all possible type definition shapes. */
|
|
269
|
-
type TAtscriptTypeDef<DataType = unknown> = TAtscriptTypeComplex<DataType> | TAtscriptTypeFinal<DataType> | TAtscriptTypeArray<DataType> | TAtscriptTypeObject<string, DataType>;
|
|
270
|
-
/**
|
|
271
|
-
* Core annotated type — wraps a type definition with metadata and a validator factory.
|
|
272
|
-
*
|
|
273
|
-
* Generated `.as` files produce classes/namespaces that conform to this interface.
|
|
274
|
-
* The `DataType` phantom generic carries the TypeScript data shape for type-safe validation.
|
|
275
|
-
*
|
|
276
|
-
* @typeParam T - The underlying type definition (e.g. {@link TAtscriptTypeObject}).
|
|
277
|
-
* @typeParam DataType - The TypeScript type the validated data narrows to (auto-inferred from `T`).
|
|
278
|
-
*/
|
|
279
|
-
interface TAtscriptAnnotatedType<T extends TAtscriptTypeDef = TAtscriptTypeDef, DataType = InferDataType<T>> {
|
|
280
|
-
__is_atscript_annotated_type: true;
|
|
281
|
-
type: T;
|
|
282
|
-
validator(opts?: Partial<TValidatorOptions>): Validator<this, DataType>;
|
|
283
|
-
metadata: TMetadataMap<AtscriptMetadata>;
|
|
284
|
-
optional?: boolean;
|
|
285
|
-
id?: string;
|
|
286
|
-
ref?: {
|
|
287
|
-
type: () => TAtscriptAnnotatedType;
|
|
288
|
-
field: string;
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
/** An annotated type that is also a class constructor (i.e. a generated interface class). */
|
|
292
|
-
/**
|
|
293
|
-
* Atscript Metadata Map with typed setters/getters
|
|
294
|
-
*/
|
|
295
|
-
interface TMetadataMap<O extends object> extends Map<keyof O, O[keyof O]> {
|
|
296
|
-
get<K extends keyof O>(key: K): O[K] | undefined;
|
|
297
|
-
get(key: string): unknown;
|
|
298
|
-
set<K extends keyof O>(key: K, value: O[K]): this;
|
|
299
|
-
has<K extends keyof O>(key: K): boolean;
|
|
300
|
-
has(key: string): boolean;
|
|
301
|
-
}
|
|
302
|
-
/** Fluent builder handle returned by {@link defineAnnotatedType}. */
|
|
303
|
-
//#endregion
|
|
304
10
|
//#region src/composables/create-as-form-def.d.ts
|
|
305
11
|
/**
|
|
306
12
|
* Creates a reactive form definition and data object from an ATScript annotated type.
|
|
@@ -308,12 +14,14 @@ interface TMetadataMap<O extends object> extends Map<keyof O, O[keyof O]> {
|
|
|
308
14
|
* @param type - An ATScript annotated type (imported from a `.as` file).
|
|
309
15
|
* @param context - Optional context object forwarded to `ui.fn.value` resolvers during data creation.
|
|
310
16
|
* Only effective when `@atscript/ui-fns` is installed (dynamic resolver).
|
|
17
|
+
* @param opts - Options for `createFormDef`: `mode: "edit"` for a form that edits a stored row,
|
|
18
|
+
* `versionColumn`, `metaFields`.
|
|
311
19
|
* @returns `{ def, formData }` — the FormDef and a Vue reactive data object with defaults applied
|
|
312
20
|
*/
|
|
313
|
-
declare function createAsFormDef<T extends TAtscriptAnnotatedType>(type: T, context?: Record<string, unknown
|
|
21
|
+
declare function createAsFormDef<T extends TAtscriptAnnotatedType>(type: T, context?: Record<string, unknown>, opts?: CreateFormDefOptions): {
|
|
314
22
|
def: _atscript_ui0.FormDef;
|
|
315
23
|
formData: {
|
|
316
|
-
value: vue.UnwrapRef<TAtscriptDataType<T>>;
|
|
24
|
+
value: vue.UnwrapRef<_atscript_typescript_utils0.TAtscriptDataType<T>>;
|
|
317
25
|
};
|
|
318
26
|
};
|
|
319
27
|
//#endregion
|
|
@@ -598,16 +306,25 @@ interface UseAsFormOptions<TFormData = unknown, TFormContext = unknown> {
|
|
|
598
306
|
* `defineEmits`; advanced uses can pass plain functions.
|
|
599
307
|
*/
|
|
600
308
|
emits?: {
|
|
601
|
-
submit?: (data: TFormData) => void;
|
|
309
|
+
submit?: (data: TAsFormValue<TFormData>) => void;
|
|
602
310
|
error?: (errors: {
|
|
603
311
|
path: string;
|
|
604
312
|
message: string;
|
|
605
313
|
}[]) => void;
|
|
606
|
-
action?: (name: string, data: TFormData) => void;
|
|
607
|
-
unsupportedAction?: (name: string, data: TFormData) => void;
|
|
608
|
-
change?: (type: TAsChangeType, path: string, value: unknown, formData: TFormData) => void;
|
|
314
|
+
action?: (name: string, data: TAsFormValue<TFormData>) => void;
|
|
315
|
+
unsupportedAction?: (name: string, data: TAsFormValue<TFormData>) => void;
|
|
316
|
+
change?: (type: TAsChangeType, path: string, value: unknown, formData: TAsFormValue<TFormData>) => void;
|
|
609
317
|
};
|
|
610
318
|
}
|
|
319
|
+
/**
|
|
320
|
+
* The value inside a `{ value }` form-data container (`value` may be
|
|
321
|
+
* optional): what the `submit`, `action`, `unsupportedAction` and `change`
|
|
322
|
+
* callbacks (and `<AsForm>`'s events) receive. `any` for an `any` container,
|
|
323
|
+
* `unknown` when the container has no `value`.
|
|
324
|
+
*/
|
|
325
|
+
type TAsFormValue<TFormData> = 0 extends 1 & TFormData ? any : TFormData extends {
|
|
326
|
+
value?: infer V;
|
|
327
|
+
} ? V : unknown;
|
|
611
328
|
interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
|
|
612
329
|
/** Reactive form-data container `{ value: domainData }`. */
|
|
613
330
|
data: ComputedRef<TFormData>;
|
|
@@ -635,7 +352,11 @@ interface UseAsFormReturn<TFormData = unknown, TFormContext = unknown> {
|
|
|
635
352
|
clearErrors: () => void;
|
|
636
353
|
/** Imperatively set external-error messages by path. */
|
|
637
354
|
setErrors: (errors: Record<string, string>) => void;
|
|
638
|
-
/**
|
|
355
|
+
/**
|
|
356
|
+
* Trigger submit. Applies the type's `@normalize.*` (trim, case) to the data,
|
|
357
|
+
* validates the result and emits it with `submit` on success, `error` on
|
|
358
|
+
* validation failure. The form data itself is left as typed.
|
|
359
|
+
*/
|
|
639
360
|
onSubmit: () => void;
|
|
640
361
|
/** Resolved submit-button text (`@ui.form.submit.text` / fn variant). */
|
|
641
362
|
submitText: ComputedRef<string>;
|
|
@@ -1127,14 +848,6 @@ interface UseAsTriStateCheckboxReturn {
|
|
|
1127
848
|
*/
|
|
1128
849
|
declare function useAsTriStateCheckbox(options: UseAsTriStateCheckboxOptions): UseAsTriStateCheckboxReturn;
|
|
1129
850
|
//#endregion
|
|
1130
|
-
//#region src/composables/use-as-locale.d.ts
|
|
1131
|
-
declare function provideAsLocale(getter: () => string | undefined): void;
|
|
1132
|
-
interface UseAsLocaleReturn {
|
|
1133
|
-
/** Resolved locale; `undefined` when no provider is present (runtime locale). */
|
|
1134
|
-
locale: ComputedRef<string | undefined>;
|
|
1135
|
-
}
|
|
1136
|
-
declare function useAsLocale(): UseAsLocaleReturn;
|
|
1137
|
-
//#endregion
|
|
1138
851
|
//#region src/composables/use-as-decimal.d.ts
|
|
1139
852
|
interface UseAsDecimalOptions {
|
|
1140
853
|
/** Read the current value. Storage shape is preserved on commit. */
|
|
@@ -1355,10 +1068,26 @@ interface UseAsDataReturn {
|
|
|
1355
1068
|
getValueAt: (path: string) => ComputedRef<unknown>;
|
|
1356
1069
|
/** Read a sibling field's value relative to the current `useAsPath()` prefix. */
|
|
1357
1070
|
siblingValue: <T = unknown>(name: string) => ComputedRef<T | undefined>;
|
|
1071
|
+
/**
|
|
1072
|
+
* Write the value at an absolute dotted path inside the form (missing
|
|
1073
|
+
* containers are created: an array where the next segment is an index,
|
|
1074
|
+
* else an object; an empty form root too). The write is a committed edit:
|
|
1075
|
+
* change tracking sees it, the field at that path re-validates like one the
|
|
1076
|
+
* user changed, and `AsForm` emits `change` with type `"update"`. Outside a
|
|
1077
|
+
* form, a no-op.
|
|
1078
|
+
*/
|
|
1079
|
+
setValueAt: (path: string, value: unknown) => void;
|
|
1080
|
+
/**
|
|
1081
|
+
* Write a sibling field's value, relative to the current `useAsPath()`
|
|
1082
|
+
* prefix — e.g. a custom picker filling the fields next to it. Same rules
|
|
1083
|
+
* as `setValueAt`.
|
|
1084
|
+
*/
|
|
1085
|
+
setSibling: (name: string, value: unknown) => void;
|
|
1358
1086
|
}
|
|
1359
1087
|
/**
|
|
1360
|
-
* Reactive
|
|
1361
|
-
*
|
|
1088
|
+
* Reactive access to form data at any point in the `<AsForm>` tree: readers
|
|
1089
|
+
* plus `setValueAt` / `setSibling` writers. Outside a form, all readers
|
|
1090
|
+
* return `undefined` and the writers do nothing.
|
|
1362
1091
|
*
|
|
1363
1092
|
* Call sites get a `ComputedRef` so they can compose it directly with
|
|
1364
1093
|
* other reactive primitives without an extra `computed()` wrapper.
|
|
@@ -1390,8 +1119,8 @@ interface Props<TF, TC> {
|
|
|
1390
1119
|
components?: Record<string, Component<TAsComponentProps>>;
|
|
1391
1120
|
/**
|
|
1392
1121
|
* Type-to-component map for field rendering. Maps field types to Vue components.
|
|
1393
|
-
*
|
|
1394
|
-
*
|
|
1122
|
+
* Use `createDefaultTypes()` for a pre-filled map, or supply your own — it
|
|
1123
|
+
* needs entries only for the types its forms use.
|
|
1395
1124
|
*/
|
|
1396
1125
|
types: TAsTypeComponents;
|
|
1397
1126
|
errors?: Record<string, string | undefined>;
|
|
@@ -1437,14 +1166,14 @@ interface Props<TF, TC> {
|
|
|
1437
1166
|
}
|
|
1438
1167
|
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<{
|
|
1439
1168
|
props: vue.PublicProps & __VLS_PrettifyLocal<Props<TFormData, TFormContext> & {
|
|
1169
|
+
onSubmit?: ((data: TAsFormValue<TFormData>) => any) | undefined;
|
|
1440
1170
|
onError?: ((errors: {
|
|
1441
1171
|
path: string;
|
|
1442
1172
|
message: string;
|
|
1443
1173
|
}[]) => any) | undefined;
|
|
1444
|
-
onAction?: ((name: string, data: TFormData) => any) | undefined;
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TFormData) => any) | undefined;
|
|
1174
|
+
onAction?: ((name: string, data: TAsFormValue<TFormData>) => any) | undefined;
|
|
1175
|
+
"onUnsupported-action"?: ((name: string, data: TAsFormValue<TFormData>) => any) | undefined;
|
|
1176
|
+
onChange?: ((type: TAsChangeType, path: string, value: unknown, formData: TAsFormValue<TFormData>) => any) | undefined;
|
|
1448
1177
|
}> & (typeof globalThis extends {
|
|
1449
1178
|
__VLS_PROPS_FALLBACK: infer P;
|
|
1450
1179
|
} ? P : {});
|
|
@@ -1637,14 +1366,14 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
|
|
|
1637
1366
|
}) => any;
|
|
1638
1367
|
};
|
|
1639
1368
|
emit: {
|
|
1640
|
-
(e: "submit", data: TFormData): void;
|
|
1369
|
+
(e: "submit", data: TAsFormValue<TFormData>): void;
|
|
1641
1370
|
(e: "error", errors: {
|
|
1642
1371
|
path: string;
|
|
1643
1372
|
message: string;
|
|
1644
1373
|
}[]): void;
|
|
1645
|
-
(e: "action", name: string, data: TFormData): void;
|
|
1646
|
-
(e: "unsupported-action", name: string, data: TFormData): void;
|
|
1647
|
-
(e: "change", type: TAsChangeType, path: string, value: unknown, formData: TFormData): void;
|
|
1374
|
+
(e: "action", name: string, data: TAsFormValue<TFormData>): void;
|
|
1375
|
+
(e: "unsupported-action", name: string, data: TAsFormValue<TFormData>): void;
|
|
1376
|
+
(e: "change", type: TAsChangeType, path: string, value: unknown, formData: TAsFormValue<TFormData>): void;
|
|
1648
1377
|
};
|
|
1649
1378
|
}>) => vue.VNode & {
|
|
1650
1379
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
@@ -1652,4 +1381,4 @@ declare const __VLS_export: <TFormData = any, TFormContext = any>(__VLS_props: N
|
|
|
1652
1381
|
declare const _default: typeof __VLS_export;
|
|
1653
1382
|
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K] } : { [K in keyof T as K]: T[K] }) & {};
|
|
1654
1383
|
//#endregion
|
|
1655
|
-
export {
|
|
1384
|
+
export { useAsDescendantErrorCounts as $, useAsNumber as A, TFormFieldRegistration as At, focusFirstAfter as B, UseAsDateReturn as C, TFormSubmitValidator as Ct, useAsDualInput as D, UseAsFieldReturn as Dt, UseAsDualInputReturn as E, UseAsFieldOptions as Et, UseAsTriStateCheckboxReturn as F, useAsOptionalField as G, useAsFocusFirstAfter as H, useAsTriStateCheckbox as I, useAsFieldScope as J, TResolveFieldPropOptions as K, UseAsOptionalAddFlowOptions as L, UseAsDecimalReturn as M, TFormState as Mt, useAsDecimal as N, createDefaultTypes as Nt, UseAsNumberOptions as O, useAsField as Ot, UseAsTriStateCheckboxOptions as P, createAsFormDef as Pt, provideAsNestedSectionsStore as Q, UseAsOptionalAddFlowReturn as R, UseAsDateOptions as S, useAsFormPatch as St, UseAsDualInputOptions as T, useAsState as Tt, useAsVisibleFields as U, focusNewFocusableAfter as V, UseAsOptionalFieldReturn as W, useAsLevel as X, provideAsNestedLevel as Y, AsNestedSectionsStore as Z, useAsData as _, UseAsFormOptions as _t, FormFieldChange$1 as a, formatIndexedLabelParts as at, UseAsPathReturn as b, AsFormPatchHandle as bt, getDefaultClientFactory as c, useAsUnion as ct, joinPath as d, UseAsArrayReturn as dt, useAsNestedSectionsStore as et, resetDefaultClientFactory as f, useAsArray as ft, UseAsDataReturn as g, TAsFormValue as gt, useAsErrorDismiss as h, useAsExternalErrors as ht, FormDiffOptions$1 as i, useAsValueHelp as it, UseAsDecimalOptions as j, TFormRule as jt, UseAsNumberReturn as k, TFormFieldCallbacks as kt, hasFieldMeta as l, UseAsTupleReturn as lt, AsErrorDismiss as m, UseAsExternalErrorsReturn as mt, _default as n, UseAsValueHelpOptions as nt, FormRebaseOptions$1 as o, useAsUnionVariant as ot, setDefaultClientFactory as p, UseAsExternalErrorsOptions as pt, UseAsFieldScopeReturn as q, ClientFactory$1 as r, UseAsValueHelpReturn as rt, TypedClientFactory as s, UseAsUnionReturn as st, Props as t, useAsDropdown as tt, isFieldHidden as u, useAsTuple as ut, UseAsTypeMapReturn as v, UseAsFormReturn as vt, useAsDate as w, UseAsStateReturn as wt, useAsPath as x, RebaseOntoResult as xt, useAsTypeMap as y, useAsForm as yt, useAsOptionalAddFlow as z };
|