@strictly/react-form 0.0.17 → 0.0.18
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/form_model.d.ts +1 -1
- package/.out/core/props.d.ts +0 -2
- package/.out/tsconfig.tsbuildinfo +1 -1
- package/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-check-types.log +1 -1
- package/.turbo/turbo-release$colon$exports.log +1 -1
- package/core/mobx/form_model.ts +2 -1
- package/core/props.ts +0 -4
- package/dist/index.d.cts +13 -14
- package/dist/index.d.ts +13 -14
- package/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -7,12 +7,12 @@ $ tsup
|
|
|
7
7
|
[34mCLI[39m Target: es6
|
|
8
8
|
[34mCJS[39m Build start
|
|
9
9
|
[34mESM[39m Build start
|
|
10
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m62.28 KB[39m
|
|
11
|
-
[32mCJS[39m ⚡️ Build success in 117ms
|
|
12
10
|
[32mESM[39m [1mdist/index.js [22m[32m58.27 KB[39m
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 136ms
|
|
12
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m62.28 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 137ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[32m38.
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m38.
|
|
18
|
-
Done in
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 10098ms
|
|
16
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m38.06 KB[39m
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m38.06 KB[39m
|
|
18
|
+
Done in 11.26s.
|
package/core/mobx/form_model.ts
CHANGED
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
type ValueOfType,
|
|
27
27
|
valuePathToTypePath,
|
|
28
28
|
} from '@strictly/define'
|
|
29
|
-
import { type FormMode } from 'core/props'
|
|
30
29
|
import {
|
|
31
30
|
computed,
|
|
32
31
|
observable,
|
|
@@ -119,6 +118,8 @@ export type ContextOf<TypePathsToAdapters extends Partial<Readonly<Record<string
|
|
|
119
118
|
| {}
|
|
120
119
|
>
|
|
121
120
|
|
|
121
|
+
export type FormMode = 'edit' | 'create'
|
|
122
|
+
|
|
122
123
|
export abstract class FormModel<
|
|
123
124
|
T extends Type,
|
|
124
125
|
ValueToTypePaths extends Readonly<Record<string, string>>,
|
package/core/props.ts
CHANGED
|
@@ -14,12 +14,8 @@ export type FieldsViewProps<F extends Fields> = {
|
|
|
14
14
|
onFieldSubmit?(this: void, key: keyof F): boolean | void,
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export type FormMode = 'edit' | 'create'
|
|
18
|
-
|
|
19
17
|
export type FormProps<O> = {
|
|
20
18
|
value: O,
|
|
21
19
|
|
|
22
20
|
onValueChange: (value: O) => void,
|
|
23
|
-
|
|
24
|
-
mode: FormMode,
|
|
25
21
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -97,20 +97,6 @@ type FormFieldsOfFieldAdapters<ValuePathsToTypePaths extends Readonly<Record<str
|
|
|
97
97
|
};
|
|
98
98
|
type FormFieldOfFieldAdapter<F extends FieldAdapter | undefined> = F extends FieldAdapter<infer _From, infer To, infer E> ? Field<To, E> : never;
|
|
99
99
|
|
|
100
|
-
type FieldsViewProps<F extends Fields> = {
|
|
101
|
-
fields: F;
|
|
102
|
-
onFieldValueChange<K extends keyof F>(this: void, key: K, value: F[K]['value']): void;
|
|
103
|
-
onFieldFocus?(this: void, key: keyof F): void;
|
|
104
|
-
onFieldBlur?(this: void, key: keyof F): void;
|
|
105
|
-
onFieldSubmit?(this: void, key: keyof F): boolean | void;
|
|
106
|
-
};
|
|
107
|
-
type FormMode = 'edit' | 'create';
|
|
108
|
-
type FormProps<O> = {
|
|
109
|
-
value: O;
|
|
110
|
-
onValueChange: (value: O) => void;
|
|
111
|
-
mode: FormMode;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
100
|
type FlattenedListTypesOfType<T extends Type> = FlattenedListTypesOfTypes<SimplifyDeep<FlattenedTypesOfType<T, null>>>;
|
|
115
101
|
type FlattenedListTypesOfTypes<T extends Readonly<Record<string, Type>>> = {
|
|
116
102
|
[K in keyof T as T[K]['definition'] extends ListTypeDef ? K : never]: T[K];
|
|
@@ -135,6 +121,7 @@ type ValuePathsToAdaptersOf<TypePathsToAdapters extends Partial<Readonly<Record<
|
|
|
135
121
|
type ContextOf<TypePathsToAdapters extends Partial<Readonly<Record<string, FieldAdapter>>>> = UnionToIntersection<{
|
|
136
122
|
readonly [K in keyof TypePathsToAdapters]: TypePathsToAdapters[K] extends undefined ? undefined : unknown extends ContextOfFieldAdapter<NonNullable<TypePathsToAdapters[K]>> ? never : ContextOfFieldAdapter<NonNullable<TypePathsToAdapters[K]>>;
|
|
137
123
|
}[keyof TypePathsToAdapters] | {}>;
|
|
124
|
+
type FormMode = 'edit' | 'create';
|
|
138
125
|
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>> {
|
|
139
126
|
readonly type: T;
|
|
140
127
|
private readonly originalValue;
|
|
@@ -224,6 +211,18 @@ type SubFormFieldAdapters<SubAdapters extends Record<string, FieldAdapter>, Type
|
|
|
224
211
|
};
|
|
225
212
|
declare function subFormFieldAdapters<SubAdapters extends Record<string, FieldAdapter>, TypePath extends string, TypePathsToValuePaths extends Record<TypePath, string>>(subAdapters: SubAdapters, parentTypePath: TypePath): SubFormFieldAdapters<SubAdapters, TypePath, TypePathsToValuePaths[TypePath]>;
|
|
226
213
|
|
|
214
|
+
type FieldsViewProps<F extends Fields> = {
|
|
215
|
+
fields: F;
|
|
216
|
+
onFieldValueChange<K extends keyof F>(this: void, key: K, value: F[K]['value']): void;
|
|
217
|
+
onFieldFocus?(this: void, key: keyof F): void;
|
|
218
|
+
onFieldBlur?(this: void, key: keyof F): void;
|
|
219
|
+
onFieldSubmit?(this: void, key: keyof F): boolean | void;
|
|
220
|
+
};
|
|
221
|
+
type FormProps<O> = {
|
|
222
|
+
value: O;
|
|
223
|
+
onValueChange: (value: O) => void;
|
|
224
|
+
};
|
|
225
|
+
|
|
227
226
|
declare class IntegerToStringConverter<E, ValuePath extends string, Context> implements TwoWayFieldConverter<number, string, E, ValuePath, Context> {
|
|
228
227
|
private readonly isNanError;
|
|
229
228
|
private readonly base;
|
package/dist/index.d.ts
CHANGED
|
@@ -97,20 +97,6 @@ type FormFieldsOfFieldAdapters<ValuePathsToTypePaths extends Readonly<Record<str
|
|
|
97
97
|
};
|
|
98
98
|
type FormFieldOfFieldAdapter<F extends FieldAdapter | undefined> = F extends FieldAdapter<infer _From, infer To, infer E> ? Field<To, E> : never;
|
|
99
99
|
|
|
100
|
-
type FieldsViewProps<F extends Fields> = {
|
|
101
|
-
fields: F;
|
|
102
|
-
onFieldValueChange<K extends keyof F>(this: void, key: K, value: F[K]['value']): void;
|
|
103
|
-
onFieldFocus?(this: void, key: keyof F): void;
|
|
104
|
-
onFieldBlur?(this: void, key: keyof F): void;
|
|
105
|
-
onFieldSubmit?(this: void, key: keyof F): boolean | void;
|
|
106
|
-
};
|
|
107
|
-
type FormMode = 'edit' | 'create';
|
|
108
|
-
type FormProps<O> = {
|
|
109
|
-
value: O;
|
|
110
|
-
onValueChange: (value: O) => void;
|
|
111
|
-
mode: FormMode;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
100
|
type FlattenedListTypesOfType<T extends Type> = FlattenedListTypesOfTypes<SimplifyDeep<FlattenedTypesOfType<T, null>>>;
|
|
115
101
|
type FlattenedListTypesOfTypes<T extends Readonly<Record<string, Type>>> = {
|
|
116
102
|
[K in keyof T as T[K]['definition'] extends ListTypeDef ? K : never]: T[K];
|
|
@@ -135,6 +121,7 @@ type ValuePathsToAdaptersOf<TypePathsToAdapters extends Partial<Readonly<Record<
|
|
|
135
121
|
type ContextOf<TypePathsToAdapters extends Partial<Readonly<Record<string, FieldAdapter>>>> = UnionToIntersection<{
|
|
136
122
|
readonly [K in keyof TypePathsToAdapters]: TypePathsToAdapters[K] extends undefined ? undefined : unknown extends ContextOfFieldAdapter<NonNullable<TypePathsToAdapters[K]>> ? never : ContextOfFieldAdapter<NonNullable<TypePathsToAdapters[K]>>;
|
|
137
123
|
}[keyof TypePathsToAdapters] | {}>;
|
|
124
|
+
type FormMode = 'edit' | 'create';
|
|
138
125
|
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>> {
|
|
139
126
|
readonly type: T;
|
|
140
127
|
private readonly originalValue;
|
|
@@ -224,6 +211,18 @@ type SubFormFieldAdapters<SubAdapters extends Record<string, FieldAdapter>, Type
|
|
|
224
211
|
};
|
|
225
212
|
declare function subFormFieldAdapters<SubAdapters extends Record<string, FieldAdapter>, TypePath extends string, TypePathsToValuePaths extends Record<TypePath, string>>(subAdapters: SubAdapters, parentTypePath: TypePath): SubFormFieldAdapters<SubAdapters, TypePath, TypePathsToValuePaths[TypePath]>;
|
|
226
213
|
|
|
214
|
+
type FieldsViewProps<F extends Fields> = {
|
|
215
|
+
fields: F;
|
|
216
|
+
onFieldValueChange<K extends keyof F>(this: void, key: K, value: F[K]['value']): void;
|
|
217
|
+
onFieldFocus?(this: void, key: keyof F): void;
|
|
218
|
+
onFieldBlur?(this: void, key: keyof F): void;
|
|
219
|
+
onFieldSubmit?(this: void, key: keyof F): boolean | void;
|
|
220
|
+
};
|
|
221
|
+
type FormProps<O> = {
|
|
222
|
+
value: O;
|
|
223
|
+
onValueChange: (value: O) => void;
|
|
224
|
+
};
|
|
225
|
+
|
|
227
226
|
declare class IntegerToStringConverter<E, ValuePath extends string, Context> implements TwoWayFieldConverter<number, string, E, ValuePath, Context> {
|
|
228
227
|
private readonly isNanError;
|
|
229
228
|
private readonly base;
|