@regle/schemas 1.20.3 → 1.21.0-beta.1
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/regle-schemas.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @regle/schemas v1.
|
|
2
|
+
* @regle/schemas v1.21.0-beta.1
|
|
3
3
|
* (c) 2026 Victor Garcia
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ArrayElement, CreateScopedUseRegleOptions, DeepMaybeRef, DeepPartial, DeepReactiveState, GlobalConfigOverrides, HasNamedKeys, HaveAnyRequiredProps, JoinDiscriminatedUnions, LocalRegleBehaviourOptions, Maybe, MaybeOutput, MergedScopedRegles, NoInferLegacy, PrimitiveTypes, RegleBehaviourOptions, RegleCollectionErrors, RegleCommonStatus, RegleErrorTree, RegleFieldIssue, RegleIssuesTree, RegleRuleStatus, RegleShortcutDefinition, RegleStaticImpl, TupleToPlainObj, UseScopedRegleOptions, useCollectScopeFn } from "@regle/core";
|
|
7
|
+
import { ArrayElement, CreateScopedUseRegleOptions, DeepMaybeRef, DeepPartial, DeepReactiveState, GlobalConfigOverrides, HasNamedKeys, HaveAnyRequiredProps, JoinDiscriminatedUnions, LocalRegleBehaviourOptions, Maybe, MaybeOutput, MergedScopedRegles, NoInferLegacy, PrimitiveTypes, RegleBehaviourOptions, RegleCollectionErrors, RegleCommonStatus, RegleErrorTree, RegleExternalCollectionErrors, RegleExternalSchemaErrorTree, RegleFieldIssue, RegleIssuesTree, RegleRuleStatus, RegleShortcutDefinition, RegleStaticImpl, TupleToPlainObj, UseScopedRegleOptions, useCollectScopeFn } from "@regle/core";
|
|
8
8
|
import { MaybeRef, MaybeRefOrGetter, Raw, UnwrapNestedRefs } from "vue";
|
|
9
9
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
10
10
|
import { EmptyObject, IsAny, IsUnion, IsUnknown, UnionToTuple } from "type-fest";
|
|
@@ -55,7 +55,8 @@ type RegleSchemaStatus<TState extends Record<string, any> | undefined = Record<s
|
|
|
55
55
|
*
|
|
56
56
|
* Only contains errors from properties where $dirty equals true. */
|
|
57
57
|
readonly $errors: RegleErrorTree<TState, false, true>; /** Collection of all the error messages, collected for all children properties. */
|
|
58
|
-
readonly $silentErrors: RegleErrorTree<TState, false, true>; /**
|
|
58
|
+
readonly $silentErrors: RegleErrorTree<TState, false, true>; /** Sets the external errors for the field. */
|
|
59
|
+
$setExternalErrors(errors: RegleExternalSchemaErrorTree<TState>): void; /** Will return a copy of your state with only the fields that are dirty. By default it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
|
|
59
60
|
$extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TState>;
|
|
60
61
|
} & ProcessNestedFields<JoinDiscriminatedUnions<TState>, TShortcuts> & (IsRoot extends true ? {
|
|
61
62
|
/** Sets all properties as dirty, triggering all rules. It returns a promise that will either resolve to false or a type safe copy of your form state. Values that had the required rule will be transformed into a non-nullable value (type only). */$validate: (forceValues?: TState extends EmptyObject ? (HasNamedKeys<TState> extends true ? TState : any) : TState) => Promise<RegleSchemaResult<StandardSchemaV1.InferOutput<TSchema>>>;
|
|
@@ -96,7 +97,8 @@ type RegleSchemaFieldStatus<TState = any, TShortcuts extends RegleShortcutDefini
|
|
|
96
97
|
readonly $inactive: boolean; /** This is reactive tree containing all the declared rules of your field. To know more about the rule properties check the rules properties section */
|
|
97
98
|
readonly $rules: {
|
|
98
99
|
[`~validator`]: RegleRuleStatus<TState, []>;
|
|
99
|
-
}; /**
|
|
100
|
+
}; /** Sets the external errors for the field. */
|
|
101
|
+
$setExternalErrors(errors: string[]): void; /** Will return a copy of your state with only the fields that are dirty. By default it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
|
|
100
102
|
$extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TState>;
|
|
101
103
|
} & ([TShortcuts['fields']] extends [never] ? {} : { [K in keyof TShortcuts['fields']]: ReturnType<NonNullable<TShortcuts['fields']>[K]> });
|
|
102
104
|
/**
|
|
@@ -115,7 +117,10 @@ type RegleSchemaCollectionStatus<TState extends any[], TShortcuts extends RegleS
|
|
|
115
117
|
*
|
|
116
118
|
* Only contains errors from properties where $dirty equals true. */
|
|
117
119
|
readonly $errors: RegleCollectionErrors<TState>; /** Collection of all the error messages, collected for all children properties and nested forms. */
|
|
118
|
-
readonly $silentErrors: RegleCollectionErrors<TState>;
|
|
120
|
+
readonly $silentErrors: RegleCollectionErrors<TState>;
|
|
121
|
+
/** Will return a copy of your state with only the fields that are dirty. By default, it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
|
|
122
|
+
/** Sets the external errors for the field. */
|
|
123
|
+
$setExternalErrors(errors: RegleExternalCollectionErrors<TState>): void; /** Will return a copy of your state with only the fields that are dirty. By default, it will filter out nullish values or objects, but you can override it with the first parameter $extractDirtyFields(false). */
|
|
119
124
|
$extractDirtyFields: (filterNullishValues?: boolean) => DeepPartial<TState>;
|
|
120
125
|
} & ([TShortcuts['collections']] extends [never] ? {} : { [K in keyof TShortcuts['collections']]: ReturnType<NonNullable<TShortcuts['collections']>[K]> });
|
|
121
126
|
type RegleSchemaBehaviourOptions = {
|
package/dist/regle-schemas.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regle/schemas",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0-beta.1",
|
|
4
4
|
"description": "Schemas adapter for Regle",
|
|
5
5
|
"homepage": "https://reglejs.dev/",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@standard-schema/spec": "1.1.0",
|
|
39
39
|
"type-fest": "5.4.4",
|
|
40
|
-
"@regle/core": "1.
|
|
41
|
-
"@regle/rules": "1.
|
|
40
|
+
"@regle/core": "1.21.0-beta.1",
|
|
41
|
+
"@regle/rules": "1.21.0-beta.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@total-typescript/ts-reset": "0.6.1",
|
|
45
45
|
"@types/node": "24.12.0",
|
|
46
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
46
|
+
"@typescript/native-preview": "7.0.0-dev.20260317.1",
|
|
47
47
|
"@vue/test-utils": "2.4.6",
|
|
48
48
|
"tsdown": "0.20.3",
|
|
49
49
|
"type-fest": "5.4.4",
|
|
50
50
|
"typescript": "5.9.3",
|
|
51
51
|
"valibot": "1.2.0",
|
|
52
|
-
"vitest": "4.0
|
|
52
|
+
"vitest": "4.1.0",
|
|
53
53
|
"vue": "3.5.30",
|
|
54
54
|
"vue-tsc": "3.2.5",
|
|
55
55
|
"zod": "4.3.6"
|