@sealcode/sealgen 0.15.26 → 0.15.28
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.
|
@@ -23,7 +23,7 @@ export declare abstract class Form<F extends Fields, SubmitResult> extends Mount
|
|
|
23
23
|
onValuesInvalid(ctx: Context, form_messages: FormMessage[], _field_errors: Partial<Record<keyof Fields, string>>): Promise<FormReaction>;
|
|
24
24
|
onError(ctx: Context, data: FormData, error: unknown): Promise<FormReaction>;
|
|
25
25
|
abstract onSubmit(ctx: Context, data: FormData): SubmitResult | Promise<SubmitResult>;
|
|
26
|
-
onSuccess(ctx: Context,
|
|
26
|
+
onSuccess(ctx: Context, _data: FormData, _submitResult: SubmitResult): Promise<FormReaction>;
|
|
27
27
|
getRawValuesOnSuccess(ctx: Context): Promise<Record<string, FormDataValue>>;
|
|
28
28
|
handlePost(ctx: Context): Promise<FormReaction>;
|
|
29
29
|
mount(router: Router, path: string): void;
|
|
@@ -17,8 +17,9 @@ class Photo extends File {
|
|
|
17
17
|
}
|
|
18
18
|
return tempstream`<div class="${class_name}">
|
|
19
19
|
${this.imageRouter.image(await file.getPath(), {
|
|
20
|
-
resolutions: [100],
|
|
20
|
+
resolutions: [100, 200],
|
|
21
21
|
sizesAttr: "100px",
|
|
22
|
+
container: { width: 100, height: 100, objectFit: "cover" },
|
|
22
23
|
imgStyle: await this.getImgStyle(),
|
|
23
24
|
alt: "Image preview"
|
|
24
25
|
})}
|
package/lib/forms/form.js
CHANGED
|
@@ -92,7 +92,7 @@ class Form extends MountableWithFields {
|
|
|
92
92
|
)
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
async onSuccess(ctx,
|
|
95
|
+
async onSuccess(ctx, _data, _submitResult) {
|
|
96
96
|
const messages = [
|
|
97
97
|
{ type: "success", text: this.defaultSuccessMessage }
|
|
98
98
|
];
|
|
@@ -101,7 +101,7 @@ class Form extends MountableWithFields {
|
|
|
101
101
|
content: await this.render(
|
|
102
102
|
ctx,
|
|
103
103
|
{
|
|
104
|
-
raw_values:
|
|
104
|
+
raw_values: await this.getInitialValues(ctx),
|
|
105
105
|
messages
|
|
106
106
|
},
|
|
107
107
|
false
|
package/package.json
CHANGED
|
@@ -32,8 +32,9 @@ export class Photo extends File {
|
|
|
32
32
|
}
|
|
33
33
|
return tempstream/* HTML */ `<div class="${class_name}">
|
|
34
34
|
${this.imageRouter.image(await file.getPath(), {
|
|
35
|
-
resolutions: [100],
|
|
35
|
+
resolutions: [100, 200],
|
|
36
36
|
sizesAttr: "100px",
|
|
37
|
+
container: { width: 100, height: 100, objectFit: "cover" },
|
|
37
38
|
imgStyle: await this.getImgStyle(),
|
|
38
39
|
alt: "Image preview",
|
|
39
40
|
})}
|
package/src/forms/form.ts
CHANGED
|
@@ -150,7 +150,7 @@ export abstract class Form<
|
|
|
150
150
|
|
|
151
151
|
public async onSuccess(
|
|
152
152
|
ctx: Context,
|
|
153
|
-
|
|
153
|
+
_data: FormData,
|
|
154
154
|
_submitResult: SubmitResult
|
|
155
155
|
): Promise<FormReaction> {
|
|
156
156
|
const messages = [
|
|
@@ -161,7 +161,7 @@ export abstract class Form<
|
|
|
161
161
|
content: await this.render(
|
|
162
162
|
ctx,
|
|
163
163
|
{
|
|
164
|
-
raw_values:
|
|
164
|
+
raw_values: await this.getInitialValues(ctx),
|
|
165
165
|
messages,
|
|
166
166
|
},
|
|
167
167
|
"show_field_errors" && false
|