@strictly/react-form 0.0.36 → 0.0.37
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/.out/core/mobx/FormModel.d.ts +3 -3
- package/.out/core/mobx/hooks.d.ts +1 -1
- package/.out/tsconfig.tsbuildinfo +1 -1
- package/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-check-types.log +1 -1
- package/.turbo/turbo-release$colon$exports.log +1 -1
- package/core/mobx/FormModel.ts +4 -5
- package/core/mobx/hooks.tsx +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -8,11 +8,11 @@ $ tsup
|
|
|
8
8
|
[34mCJS[39m Build start
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[32mCJS[39m [1mdist/index.cjs [22m[32m64.40 KB[39m
|
|
11
|
-
[32mCJS[39m ⚡️ Build success in
|
|
11
|
+
[32mCJS[39m ⚡️ Build success in 127ms
|
|
12
12
|
[32mESM[39m [1mdist/index.js [22m[32m60.22 KB[39m
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 128ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[32m39.
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m39.
|
|
18
|
-
Done in 6.
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 5539ms
|
|
16
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m39.05 KB[39m
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m39.05 KB[39m
|
|
18
|
+
Done in 6.93s.
|
package/core/mobx/FormModel.ts
CHANGED
|
@@ -146,6 +146,9 @@ export abstract class FormModel<
|
|
|
146
146
|
ContextType
|
|
147
147
|
>,
|
|
148
148
|
ContextType = ContextOf<TypePathsToAdapters>,
|
|
149
|
+
ContextSource extends FormModelContextSource<ContextType, ValueOfType<ReadonlyTypeOfType<T>>,
|
|
150
|
+
keyof ValuePathsToAdapters> = FormModelContextSource<ContextType, ValueOfType<ReadonlyTypeOfType<T>>,
|
|
151
|
+
string | number | symbol>,
|
|
149
152
|
ValuePathsToAdapters extends ValuePathsToAdaptersOf<TypePathsToAdapters, ValueToTypePaths> = ValuePathsToAdaptersOf<
|
|
150
153
|
TypePathsToAdapters,
|
|
151
154
|
ValueToTypePaths
|
|
@@ -173,11 +176,7 @@ export abstract class FormModel<
|
|
|
173
176
|
readonly type: T,
|
|
174
177
|
private readonly originalValue: ValueOfType<ReadonlyTypeOfType<T>>,
|
|
175
178
|
protected readonly adapters: TypePathsToAdapters,
|
|
176
|
-
protected readonly contextSource:
|
|
177
|
-
ContextType,
|
|
178
|
-
ValueOfType<ReadonlyTypeOfType<T>>,
|
|
179
|
-
keyof ValuePathsToAdapters
|
|
180
|
-
>,
|
|
179
|
+
protected readonly contextSource: ContextSource,
|
|
181
180
|
protected readonly mode: FormMode,
|
|
182
181
|
) {
|
|
183
182
|
this.originalValues = flattenValuesOfType<ReadonlyTypeOfType<T>>(type, originalValue, this.listIndicesToKeys)
|
package/core/mobx/hooks.tsx
CHANGED
|
@@ -16,7 +16,7 @@ import { peek } from './peek'
|
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
17
|
type FormModelInterface<T extends Type = any> = Pick<
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
-
FormModel<T, any, any, any, any>,
|
|
19
|
+
FormModel<T, any, any, any, any, any>,
|
|
20
20
|
| 'fields'
|
|
21
21
|
| 'value'
|
|
22
22
|
| 'getValidation'
|
package/dist/index.d.cts
CHANGED
|
@@ -135,11 +135,11 @@ type FormMode = 'edit' | 'create';
|
|
|
135
135
|
type FormModelContextSource<ContextType, V, ValuePath extends string | number | symbol> = {
|
|
136
136
|
forPath(value: V, valuePath: ValuePath): ContextType;
|
|
137
137
|
};
|
|
138
|
-
declare abstract class FormModel<T extends Type, ValueToTypePaths extends Readonly<Record<string, string>>, TypePathsToAdapters extends FlattenedTypePathsToAdaptersOf<FlattenedValuesOfType<T, '*'>, ContextType>, ContextType = ContextOf<TypePathsToAdapters>, ValuePathsToAdapters extends ValuePathsToAdaptersOf<TypePathsToAdapters, ValueToTypePaths> = ValuePathsToAdaptersOf<TypePathsToAdapters, ValueToTypePaths>> {
|
|
138
|
+
declare abstract class FormModel<T extends Type, ValueToTypePaths extends Readonly<Record<string, string>>, TypePathsToAdapters extends FlattenedTypePathsToAdaptersOf<FlattenedValuesOfType<T, '*'>, ContextType>, ContextType = ContextOf<TypePathsToAdapters>, ContextSource extends FormModelContextSource<ContextType, ValueOfType<ReadonlyTypeOfType<T>>, keyof ValuePathsToAdapters> = FormModelContextSource<ContextType, ValueOfType<ReadonlyTypeOfType<T>>, string | number | symbol>, ValuePathsToAdapters extends ValuePathsToAdaptersOf<TypePathsToAdapters, ValueToTypePaths> = ValuePathsToAdaptersOf<TypePathsToAdapters, ValueToTypePaths>> {
|
|
139
139
|
readonly type: T;
|
|
140
140
|
private readonly originalValue;
|
|
141
141
|
protected readonly adapters: TypePathsToAdapters;
|
|
142
|
-
protected readonly contextSource:
|
|
142
|
+
protected readonly contextSource: ContextSource;
|
|
143
143
|
protected readonly mode: FormMode;
|
|
144
144
|
private accessor observableValue;
|
|
145
145
|
accessor fieldOverrides: FlattenedFieldOverrides<ValuePathsToAdapters>;
|
|
@@ -148,7 +148,7 @@ declare abstract class FormModel<T extends Type, ValueToTypePaths extends Readon
|
|
|
148
148
|
private readonly flattenedTypeDefs;
|
|
149
149
|
private readonly originalValues;
|
|
150
150
|
private readonly listIndicesToKeys;
|
|
151
|
-
constructor(type: T, originalValue: ValueOfType<ReadonlyTypeOfType<T>>, adapters: TypePathsToAdapters, contextSource:
|
|
151
|
+
constructor(type: T, originalValue: ValueOfType<ReadonlyTypeOfType<T>>, adapters: TypePathsToAdapters, contextSource: ContextSource, mode: FormMode);
|
|
152
152
|
get forceMutableFields(): boolean;
|
|
153
153
|
get value(): ValueOfType<ReadonlyTypeOfType<T>>;
|
|
154
154
|
get fields(): SimplifyDeep<FlattenedConvertedFieldsOf<ValuePathsToAdapters>>;
|
|
@@ -184,7 +184,7 @@ declare abstract class FormModel<T extends Type, ValueToTypePaths extends Readon
|
|
|
184
184
|
validateSubmit(): boolean;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
type FormModelInterface<T extends Type = any> = Pick<FormModel<T, any, any, any, any>, 'fields' | 'value' | 'getValidation' | 'validateField' | 'setFieldValue' | 'validateSubmit' | 'isFieldDirty' | 'isValuePathActive'>;
|
|
187
|
+
type FormModelInterface<T extends Type = any> = Pick<FormModel<T, any, any, any, any, any>, 'fields' | 'value' | 'getValidation' | 'validateField' | 'setFieldValue' | 'validateSubmit' | 'isFieldDirty' | 'isValuePathActive'>;
|
|
188
188
|
type ValueOfModel<M extends FormModelInterface> = M extends FormModelInterface<infer T> ? ValueOfType<ReadonlyTypeOfType<T>> : never;
|
|
189
189
|
declare function useDefaultMobxFormHooks<M extends FormModelInterface, F extends M['fields'] = M['fields']>(model: M, { onValidFieldSubmit, onValidFormSubmit, }?: {
|
|
190
190
|
onValidFieldSubmit?: <Path extends keyof F>(valuePath: Path) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -135,11 +135,11 @@ type FormMode = 'edit' | 'create';
|
|
|
135
135
|
type FormModelContextSource<ContextType, V, ValuePath extends string | number | symbol> = {
|
|
136
136
|
forPath(value: V, valuePath: ValuePath): ContextType;
|
|
137
137
|
};
|
|
138
|
-
declare abstract class FormModel<T extends Type, ValueToTypePaths extends Readonly<Record<string, string>>, TypePathsToAdapters extends FlattenedTypePathsToAdaptersOf<FlattenedValuesOfType<T, '*'>, ContextType>, ContextType = ContextOf<TypePathsToAdapters>, ValuePathsToAdapters extends ValuePathsToAdaptersOf<TypePathsToAdapters, ValueToTypePaths> = ValuePathsToAdaptersOf<TypePathsToAdapters, ValueToTypePaths>> {
|
|
138
|
+
declare abstract class FormModel<T extends Type, ValueToTypePaths extends Readonly<Record<string, string>>, TypePathsToAdapters extends FlattenedTypePathsToAdaptersOf<FlattenedValuesOfType<T, '*'>, ContextType>, ContextType = ContextOf<TypePathsToAdapters>, ContextSource extends FormModelContextSource<ContextType, ValueOfType<ReadonlyTypeOfType<T>>, keyof ValuePathsToAdapters> = FormModelContextSource<ContextType, ValueOfType<ReadonlyTypeOfType<T>>, string | number | symbol>, ValuePathsToAdapters extends ValuePathsToAdaptersOf<TypePathsToAdapters, ValueToTypePaths> = ValuePathsToAdaptersOf<TypePathsToAdapters, ValueToTypePaths>> {
|
|
139
139
|
readonly type: T;
|
|
140
140
|
private readonly originalValue;
|
|
141
141
|
protected readonly adapters: TypePathsToAdapters;
|
|
142
|
-
protected readonly contextSource:
|
|
142
|
+
protected readonly contextSource: ContextSource;
|
|
143
143
|
protected readonly mode: FormMode;
|
|
144
144
|
private accessor observableValue;
|
|
145
145
|
accessor fieldOverrides: FlattenedFieldOverrides<ValuePathsToAdapters>;
|
|
@@ -148,7 +148,7 @@ declare abstract class FormModel<T extends Type, ValueToTypePaths extends Readon
|
|
|
148
148
|
private readonly flattenedTypeDefs;
|
|
149
149
|
private readonly originalValues;
|
|
150
150
|
private readonly listIndicesToKeys;
|
|
151
|
-
constructor(type: T, originalValue: ValueOfType<ReadonlyTypeOfType<T>>, adapters: TypePathsToAdapters, contextSource:
|
|
151
|
+
constructor(type: T, originalValue: ValueOfType<ReadonlyTypeOfType<T>>, adapters: TypePathsToAdapters, contextSource: ContextSource, mode: FormMode);
|
|
152
152
|
get forceMutableFields(): boolean;
|
|
153
153
|
get value(): ValueOfType<ReadonlyTypeOfType<T>>;
|
|
154
154
|
get fields(): SimplifyDeep<FlattenedConvertedFieldsOf<ValuePathsToAdapters>>;
|
|
@@ -184,7 +184,7 @@ declare abstract class FormModel<T extends Type, ValueToTypePaths extends Readon
|
|
|
184
184
|
validateSubmit(): boolean;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
type FormModelInterface<T extends Type = any> = Pick<FormModel<T, any, any, any, any>, 'fields' | 'value' | 'getValidation' | 'validateField' | 'setFieldValue' | 'validateSubmit' | 'isFieldDirty' | 'isValuePathActive'>;
|
|
187
|
+
type FormModelInterface<T extends Type = any> = Pick<FormModel<T, any, any, any, any, any>, 'fields' | 'value' | 'getValidation' | 'validateField' | 'setFieldValue' | 'validateSubmit' | 'isFieldDirty' | 'isValuePathActive'>;
|
|
188
188
|
type ValueOfModel<M extends FormModelInterface> = M extends FormModelInterface<infer T> ? ValueOfType<ReadonlyTypeOfType<T>> : never;
|
|
189
189
|
declare function useDefaultMobxFormHooks<M extends FormModelInterface, F extends M['fields'] = M['fields']>(model: M, { onValidFieldSubmit, onValidFormSubmit, }?: {
|
|
190
190
|
onValidFieldSubmit?: <Path extends keyof F>(valuePath: Path) => void;
|