@sealcode/sealgen 0.15.14 → 0.15.16
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FilePointer } from "@sealcode/file-manager";
|
|
2
2
|
import type { FlatTemplatable } from "tempstream";
|
|
3
3
|
import type { FormField } from "./fields/field.js";
|
|
4
|
-
export type FormDataPrimitive = string | string[] | number | undefined;
|
|
5
|
-
export type FormDataValue = FormDataPrimitive | Record<string, FormDataPrimitive
|
|
4
|
+
export type FormDataPrimitive = string | string[] | number | undefined | FilePointer;
|
|
5
|
+
export type FormDataValue = FormDataPrimitive | Record<string, FormDataPrimitive>;
|
|
6
6
|
export type FieldValueType<F extends FormField> = F extends FormField<infer R> ? R : never;
|
|
7
7
|
export type FormFieldsToValues<F extends Record<string, FormField<boolean, keyof F>>> = {
|
|
8
8
|
[Property in keyof F]: FieldValueType<F[Property]>;
|
|
@@ -128,7 +128,7 @@ class StatefulPage extends Mountable {
|
|
|
128
128
|
state_overrides
|
|
129
129
|
);
|
|
130
130
|
let modified_state = deepmerge(original_state, state_overrides, {
|
|
131
|
-
isMergeableObject: isPlainObject,
|
|
131
|
+
isMergeableObject: (v) => isPlainObject(v) || Array.isArray(v),
|
|
132
132
|
arrayMerge: (target, source, options) => {
|
|
133
133
|
const destination = target.slice();
|
|
134
134
|
source.forEach((item, index) => {
|
package/package.json
CHANGED
package/src/forms/form-types.ts
CHANGED
|
@@ -2,11 +2,16 @@ import { FilePointer } from "@sealcode/file-manager";
|
|
|
2
2
|
import type { FlatTemplatable } from "tempstream";
|
|
3
3
|
import type { FormField } from "./fields/field.js";
|
|
4
4
|
|
|
5
|
-
export type FormDataPrimitive =
|
|
5
|
+
export type FormDataPrimitive =
|
|
6
|
+
| string
|
|
7
|
+
| string[]
|
|
8
|
+
| number
|
|
9
|
+
| undefined
|
|
10
|
+
| FilePointer;
|
|
11
|
+
|
|
6
12
|
export type FormDataValue =
|
|
7
13
|
| FormDataPrimitive
|
|
8
|
-
| Record<string, FormDataPrimitive
|
|
9
|
-
| FilePointer;
|
|
14
|
+
| Record<string, FormDataPrimitive>;
|
|
10
15
|
|
|
11
16
|
export type FieldValueType<F extends FormField> = F extends FormField<infer R>
|
|
12
17
|
? R
|
|
@@ -236,7 +236,7 @@ export abstract class StatefulPage<
|
|
|
236
236
|
state_overrides
|
|
237
237
|
);
|
|
238
238
|
let modified_state = deepmerge(original_state, state_overrides, {
|
|
239
|
-
isMergeableObject: isPlainObject,
|
|
239
|
+
isMergeableObject: (v) => isPlainObject(v) || Array.isArray(v),
|
|
240
240
|
arrayMerge: (
|
|
241
241
|
target: any[],
|
|
242
242
|
source: any[],
|