@sealcode/sealgen 0.19.16 → 0.19.17
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/@types/app-config/get-app-port.d.ts +1 -0
- package/@types/app-config/load-app-config.d.ts +4 -0
- package/@types/app-config/resolve-app-config-path.d.ts +1 -0
- package/@types/forms/fields/structured-array.d.ts +2 -2
- package/@types/utils/translate.d.ts +2 -1
- package/lib/forms/controls/tickable.js +1 -3
- package/lib/forms/fields/collection-field.js +2 -1
- package/lib/generate-routes.js +23 -1
- package/lib/utils/translate.js +4 -4
- package/package.json +2 -2
- package/src/forms/fields/collection-field.ts +2 -1
- package/src/forms/fields/structured-array.ts +2 -11
- package/src/generate-routes.ts +38 -9
- package/.xunit +0 -75
- package/@types/add-verbose-crud.d.ts +0 -3
- package/@types/builders/colors-builder.d.sync-conflict-20250918-184323-TFDLWFG.ts +0 -10
- package/@types/builders/fonts-builder.d.sync-conflict-20250918-184322-TFDLWFG.ts +0 -7
- package/@types/controllers/table-add-button.d.ts +0 -6
- package/@types/crud-field-snippets.d.ts +0 -1
- package/@types/find-css-includes.d.ts +0 -1
- package/@types/forms/controls/array.d.sync-conflict-20250918-184306-TFDLWFG.ts +0 -33
- package/@types/forms/controls/array.sync-conflict-20250918-222045-TFDLWFG.d.ts +0 -33
- package/@types/forms/controls/autocomplete.d.sync-conflict-20250918-222042-TFDLWFG.ts +0 -22
- package/@types/forms/controls/checkbox-group.d.sync-conflict-20250918-184319-TFDLWFG.ts +0 -21
- package/@types/forms/controls/checkboxed-list-input.d.sync-conflict-20250918-184323-TFDLWFG.ts +0 -21
- package/@types/forms/controls/derived-frame.d.sync-conflict-20250918-184314-TFDLWFG.ts +0 -19
- package/@types/forms/controls/dropdown.d.sync-conflict-20250918-222044-TFDLWFG.ts +0 -30
- package/@types/forms/controls/file.d.sync-conflict-20250918-222045-TFDLWFG.ts +0 -13
- package/@types/forms/controls/form-control.d.sync-conflict-20250918-184322-TFDLWFG.ts +0 -19
- package/@types/forms/controls/form-control.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -19
- package/@types/forms/controls/multiple-files.d.sync-conflict-20250918-184318-TFDLWFG.ts +0 -42
- package/@types/forms/controls/multiple-photos.d.ts +0 -19
- package/@types/forms/controls/number.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -13
- package/@types/forms/controls/photo.d.sync-conflict-20250918-184321-TFDLWFG.ts +0 -19
- package/@types/forms/controls/photo.d.ts +0 -19
- package/@types/forms/controls/photo.test.d.ts +0 -1
- package/@types/forms/controls/reverse-single-reference.d.ts +0 -1
- package/@types/forms/controls/simple-input.d.sync-conflict-20250918-184310-TFDLWFG.ts +0 -33
- package/@types/forms/controls/simple-input.d.sync-conflict-20250918-222042-TFDLWFG.ts +0 -33
- package/@types/forms/controls/simple-input.sync-conflict-20250918-222045-TFDLWFG.d.ts +0 -33
- package/@types/forms/controls/table.d.sync-conflict-20250918-184302-TFDLWFG.ts +0 -39
- package/@types/forms/controls/table.sync-conflict-20250918-222042-TFDLWFG.d.ts +0 -39
- package/@types/forms/controls/textarea.d.sync-conflict-20250918-222045-TFDLWFG.ts +0 -25
- package/@types/forms/fields/boolean.d.sync-conflict-20250918-184325-TFDLWFG.ts +0 -22
- package/@types/forms/fields/boolean.sync-conflict-20250918-222042-TFDLWFG.d.ts +0 -22
- package/@types/forms/fields/checkboxed-list.d.sync-conflict-20250918-184325-TFDLWFG.ts +0 -23
- package/@types/forms/fields/collection-field.d.sync-conflict-20250918-184319-TFDLWFG.ts +0 -22
- package/@types/forms/fields/collection-field.d.sync-conflict-20250918-222047-TFDLWFG.ts +0 -22
- package/@types/forms/fields/coordinates.d.sync-conflict-20250918-222044-TFDLWFG.ts +0 -14
- package/@types/forms/fields/datetime.d.sync-conflict-20250918-222050-TFDLWFG.ts +0 -4
- package/@types/forms/fields/email.d.sync-conflict-20250918-184303-TFDLWFG.ts +0 -8
- package/@types/forms/fields/enum-multiple-sealious.sync-conflict-20250918-222047-TFDLWFG.d.ts +0 -16
- package/@types/forms/fields/enum-multiple.d.ts +0 -18
- package/@types/forms/fields/enum-multiple.test.d.ts +0 -1
- package/@types/forms/fields/enum.d.ts +0 -18
- package/@types/forms/fields/enum.test.d.ts +0 -1
- package/@types/forms/fields/field.d.sync-conflict-20250918-184306-TFDLWFG.ts +0 -70
- package/@types/forms/fields/fields.d.sync-conflict-20250918-184314-TFDLWFG.ts +0 -29
- package/@types/forms/fields/file.d.sync-conflict-20250918-184310-TFDLWFG.ts +0 -23
- package/@types/forms/fields/file.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -23
- package/@types/forms/fields/file.sync-conflict-20250918-222049-TFDLWFG.d.ts +0 -23
- package/@types/forms/fields/get-field-for-sealious.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -29
- package/@types/forms/fields/get-field-for-sealious.sync-conflict-20250918-222042-TFDLWFG.d.ts +0 -29
- package/@types/forms/fields/image.d.sync-conflict-20250918-222042-TFDLWFG.ts +0 -5
- package/@types/forms/fields/multiple-files.d.sync-conflict-20250918-184304-TFDLWFG.ts +0 -16
- package/@types/forms/fields/number.d.sync-conflict-20250918-184317-TFDLWFG.ts +0 -25
- package/@types/forms/fields/number.d.sync-conflict-20250918-222047-TFDLWFG.ts +0 -25
- package/@types/forms/fields/pick-from-list.d.sync-conflict-20250918-184322-TFDLWFG.ts +0 -15
- package/@types/forms/fields/proxy-field.d.sync-conflict-20250918-184307-TFDLWFG.ts +0 -15
- package/@types/forms/fields/regexp.d.sync-conflict-20250918-184305-TFDLWFG.ts +0 -21
- package/@types/forms/fields/regexp.d.sync-conflict-20250918-222045-TFDLWFG.ts +0 -21
- package/@types/forms/fields/regexp.sync-conflict-20250918-222047-TFDLWFG.d.ts +0 -21
- package/@types/forms/fields/reverse-single-reference.d.ts +0 -13
- package/@types/forms/fields/simple-form-field.d.sync-conflict-20250918-184309-TFDLWFG.ts +0 -29
- package/@types/forms/fields/simple-form-field.d.sync-conflict-20250918-222044-TFDLWFG.ts +0 -29
- package/@types/forms/fields/simple-form-field.sync-conflict-20250918-222049-TFDLWFG.d.ts +0 -29
- package/@types/forms/fields/single-reference.sync-conflict-20250918-222043-TFDLWFG.d.ts +0 -10
- package/@types/forms/fields/structured-array.d.sync-conflict-20250918-184302-TFDLWFG.ts +0 -27
- package/@types/forms/fields/structured-array.d.sync-conflict-20250918-222049-TFDLWFG.ts +0 -27
- package/@types/forms/fields/structured-array.sync-conflict-20250918-222047-TFDLWFG.d.ts +0 -27
- package/@types/forms/fields/table.d.sync-conflict-20250918-184303-TFDLWFG.ts +0 -16
- package/@types/forms/form-types.d.sync-conflict-20250918-222045-TFDLWFG.ts +0 -26
- package/@types/forms/form.d.sync-conflict-20250918-184315-TFDLWFG.ts +0 -32
- package/@types/forms/form.d.sync-conflict-20250918-222049-TFDLWFG.ts +0 -32
- package/@types/forms/form.sync-conflict-20250918-222049-TFDLWFG.d.ts +0 -33
- package/@types/forms/form.test.d.sync-conflict-20250918-184318-TFDLWFG.ts +0 -6
- package/@types/forms/form.test.d.sync-conflict-20250918-222047-TFDLWFG.ts +0 -6
- package/@types/forms/multiform.d.sync-conflict-20250918-184308-TFDLWFG.ts +0 -23
- package/@types/forms/multiform.sync-conflict-20250918-222044-TFDLWFG.d.ts +0 -23
- package/@types/index.d.sync-conflict-20250918-184316-TFDLWFG.ts +0 -46
- package/@types/mount.d.sync-conflict-20250918-184320-TFDLWFG.ts +0 -6
- package/@types/page/list.d.sync-conflict-20250918-184318-TFDLWFG.ts +0 -48
- package/@types/page/list.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -48
- package/@types/page/list.sync-conflict-20250918-222048-TFDLWFG.d.ts +0 -48
- package/@types/page/mountable-with-fields.d.sync-conflict-20250918-184321-TFDLWFG.ts +0 -42
- package/@types/page/mountable-with-fields.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -42
- package/@types/page/mountable-with-fields.sync-conflict-20250918-222044-TFDLWFG.d.ts +0 -42
- package/@types/page/mountable.d.sync-conflict-20250918-184306-TFDLWFG.ts +0 -10
- package/@types/page/page.d.sync-conflict-20250918-184320-TFDLWFG.ts +0 -18
- package/@types/page/props-parser.d.sync-conflict-20250918-184305-TFDLWFG.ts +0 -15
- package/@types/page/stateful-page.d.sync-conflict-20250918-184326-TFDLWFG.ts +0 -62
- package/@types/templates/shared/handlers/boolean.d.ts +0 -2
- package/@types/templates/shared/handlers/date.d.ts +0 -2
- package/@types/templates/shared/handlers/deep-reverse-single-reference.d.ts +0 -2
- package/@types/templates/shared/handlers/default.d.ts +0 -2
- package/@types/templates/shared/handlers/enum.d.ts +0 -2
- package/@types/templates/shared/handlers/file.d.ts +0 -2
- package/@types/templates/shared/handlers/image.d.ts +0 -2
- package/@types/templates/shared/handlers/int.d.ts +0 -2
- package/@types/templates/shared/handlers/jdd.d.ts +0 -2
- package/@types/templates/shared/handlers/single-reference.d.ts +0 -2
- package/@types/templates/shared/handlers/structured-array.d.ts +0 -2
- package/@types/templates/shared/shared-crud-form-fields.d.sync-conflict-20250918-184306-TFDLWFG.ts +0 -1
- package/@types/test_utils/test-on-real-app.d.sync-conflict-20250918-184320-TFDLWFG.ts +0 -26
- package/@types/utils/extract-fields-from-collection.d.sync-conflict-20250918-184312-TFDLWFG.ts +0 -18
- package/@types/utils/extract-fields-from-collection.sync-conflict-20250918-222045-TFDLWFG.d.ts +0 -18
- /package/@types/{add-crud.d.sync-conflict-20250918-184311-TFDLWFG.ts → app-config/get-app-port.test.d.ts} +0 -0
- /package/@types/{crud-field-snippets.d.sync-conflict-20250918-184323-TFDLWFG.ts → app-config/load-app-config.test.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAppPort(projectDir: string): Promise<number | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveAppConfigModulePath(projectDir: string): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context } from "koa";
|
|
2
|
-
import { Field as SealiousField, FieldTypes as SealiousFieldTypes
|
|
2
|
+
import { Field as SealiousField, FieldTypes as SealiousFieldTypes } from "sealious";
|
|
3
3
|
import { FormDataValue } from "../form-types.js";
|
|
4
4
|
import { Table as TableControl } from "../controls/table.js";
|
|
5
5
|
import { SealiousToFormField } from "./get-field-for-sealious.js";
|
|
@@ -18,6 +18,6 @@ export declare class StructuredArray<SealiousFields extends Record<string, Seali
|
|
|
18
18
|
form_field_types: string;
|
|
19
19
|
sealious_field: string;
|
|
20
20
|
}): string;
|
|
21
|
-
getSealiousCreateValue(fctx: FormControlContext): Promise<
|
|
21
|
+
getSealiousCreateValue(fctx: FormControlContext): Promise<import("./table.js").TableFieldParsed<{ [name in keyof SealiousFields]: SealiousToFormField<SealiousFields[name]>; }>>;
|
|
22
22
|
sealiousValueToForm(ctx: Context, sealiousValue: Record<string, FormDataValue | null>[] | null): Promise<FormDataValue>;
|
|
23
23
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Context } from "koa";
|
|
2
2
|
import { Translation } from "sealious";
|
|
3
|
-
|
|
3
|
+
/** deprecated */
|
|
4
|
+
export declare function t(ctx: Context, key: string, _props: unknown[], _default_translation: Translation): string;
|
|
@@ -21,7 +21,6 @@ class Tickable extends FormFieldControl {
|
|
|
21
21
|
];
|
|
22
22
|
}
|
|
23
23
|
async render(fctx) {
|
|
24
|
-
console.log("!! Rendering checkbox", this.field.name);
|
|
25
24
|
const {
|
|
26
25
|
parsed: _parsed,
|
|
27
26
|
valid,
|
|
@@ -32,7 +31,6 @@ class Tickable extends FormFieldControl {
|
|
|
32
31
|
true
|
|
33
32
|
);
|
|
34
33
|
const field_message = fctx.data.field_messages[this.field.name];
|
|
35
|
-
console.log(this.field.name, fctx.data.field_messages, field_message);
|
|
36
34
|
const parsed = _parsed === null ? this.options.default_value : _parsed;
|
|
37
35
|
const value = this.getValueAttribute(
|
|
38
36
|
fctx.ctx,
|
|
@@ -75,7 +73,7 @@ class Tickable extends FormFieldControl {
|
|
|
75
73
|
})();
|
|
76
74
|
</script>
|
|
77
75
|
|
|
78
|
-
${(~valid || !!field_message) && !this.options.hide_errors && fctx.validate ? `<div class="input__error">${Array.from(new Set([message, field_message].filter((e) => !!e))).join(" \u2022 ")}</div>` : ""}
|
|
76
|
+
${(~valid || !!field_message) && !this.options.hide_errors && fctx.validate ? `<div class="input__error">${Array.from(new Set([message, field_message.message].filter((e) => !!e))).join(" \u2022 ")}</div>` : ""}
|
|
79
77
|
`
|
|
80
78
|
);
|
|
81
79
|
}
|
package/lib/generate-routes.js
CHANGED
|
@@ -70,8 +70,28 @@ async function generateRoutes() {
|
|
|
70
70
|
).replace(/\/\//g, "/")
|
|
71
71
|
}))
|
|
72
72
|
);
|
|
73
|
+
const url_tree = { children: {} };
|
|
74
|
+
sortRoutes(files).forEach(({ actionName, url }) => {
|
|
75
|
+
const elements = url.split("/").filter((e) => e != "");
|
|
76
|
+
let pointer = url_tree;
|
|
77
|
+
for (const [index, element] of elements.entries()) {
|
|
78
|
+
if (!pointer.children[element]) {
|
|
79
|
+
pointer.children[element] = { children: {} };
|
|
80
|
+
}
|
|
81
|
+
pointer = pointer.children[element];
|
|
82
|
+
if (index == elements.length - 1) {
|
|
83
|
+
pointer.actionName = actionName;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
73
87
|
const routes_content = `// DO NOT EDIT! This file is generated automaticaly with npm run generate-routes
|
|
74
88
|
|
|
89
|
+
export type URLTree = {
|
|
90
|
+
actionName?: string;
|
|
91
|
+
children: { [key: string]: URLTree };
|
|
92
|
+
};
|
|
93
|
+
export const url_tree = ${JSON.stringify(url_tree)};
|
|
94
|
+
|
|
75
95
|
import type Router from "@koa/router";
|
|
76
96
|
import { mount } from "@sealcode/sealgen";
|
|
77
97
|
import * as URLs from "./urls.js"
|
|
@@ -88,7 +108,9 @@ ${sortRoutes(files).map(
|
|
|
88
108
|
({ actionName }) => ` mount(router, URLs.${actionName}URL, ${actionName});`
|
|
89
109
|
).join("\n")}
|
|
90
110
|
}`;
|
|
91
|
-
const urls_content =
|
|
111
|
+
const urls_content = `/* DO NOT EDIT! This file is generated automaticall with npm run generate-routes. */
|
|
112
|
+
|
|
113
|
+
${sortRoutes(files).map(({ actionName, url }) => generateURL(actionName, url)).join("\n")}
|
|
92
114
|
`;
|
|
93
115
|
await fs.writeFile(
|
|
94
116
|
target_locreq.resolve("src/back/routes/routes.ts"),
|
package/lib/utils/translate.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function t(ctx, key,
|
|
1
|
+
function t(ctx, key, _props, _default_translation) {
|
|
2
2
|
return (
|
|
3
3
|
/* HTML */
|
|
4
|
-
`<span translation-key="${key.replace('"', '\\"')}"
|
|
5
|
-
|
|
6
|
-
>`
|
|
4
|
+
`<span translation-key="${key.replace('"', '\\"')}">
|
|
5
|
+
${ctx.i18n`${key}`}
|
|
6
|
+
</span>`
|
|
7
7
|
);
|
|
8
8
|
}
|
|
9
9
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sealcode/sealgen",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.17",
|
|
4
4
|
"description": "Module to automate adding routes and collections to a sealious application",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"peerDependencies": {
|
|
93
93
|
"koa": "^2.13.0",
|
|
94
94
|
"koa-responsive-image-router": "^0.2.24",
|
|
95
|
-
"sealious": "^0.21.
|
|
95
|
+
"sealious": "^0.21.36",
|
|
96
96
|
"stimulus": "^3.2.2"
|
|
97
97
|
}
|
|
98
98
|
}
|
|
@@ -7,7 +7,6 @@ import { Context } from "koa";
|
|
|
7
7
|
import {
|
|
8
8
|
Field as SealiousField,
|
|
9
9
|
FieldTypes as SealiousFieldTypes,
|
|
10
|
-
FieldsetInput,
|
|
11
10
|
} from "sealious";
|
|
12
11
|
import { FormDataValue } from "../form-types.js";
|
|
13
12
|
import { Table as TableControl } from "../controls/table.js";
|
|
@@ -74,20 +73,12 @@ export class StructuredArray<
|
|
|
74
73
|
return `new ${vars.form_field_types}.${this.constructor.name}(${vars.sealious_field})`;
|
|
75
74
|
}
|
|
76
75
|
|
|
77
|
-
async getSealiousCreateValue(
|
|
78
|
-
fctx: FormControlContext
|
|
79
|
-
): Promise<
|
|
80
|
-
SealiousFieldTypes.ArrayStorageInput<FieldsetInput<SealiousFields>>
|
|
81
|
-
> {
|
|
76
|
+
async getSealiousCreateValue(fctx: FormControlContext) {
|
|
82
77
|
const { parsed } = await this.getParsedValue(
|
|
83
78
|
fctx.ctx,
|
|
84
79
|
fctx.data.raw_values
|
|
85
80
|
);
|
|
86
|
-
return (
|
|
87
|
-
(parsed as SealiousFieldTypes.ArrayStorageInput<
|
|
88
|
-
FieldsetInput<SealiousFields>
|
|
89
|
-
>) || this.getEmptyValue()
|
|
90
|
-
);
|
|
81
|
+
return parsed || this.getEmptyValue();
|
|
91
82
|
}
|
|
92
83
|
|
|
93
84
|
async sealiousValueToForm(
|
package/src/generate-routes.ts
CHANGED
|
@@ -35,9 +35,9 @@ export function generateURL(actionName: string, url: string) {
|
|
|
35
35
|
.map((s) => s + ": string")
|
|
36
36
|
.join(", ")})=>\`${parts
|
|
37
37
|
.map((part) =>
|
|
38
|
-
part.startsWith(":")
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
part.startsWith(":") ?
|
|
39
|
+
"${" + part.slice(1) + "}"
|
|
40
|
+
: encodeURIComponent(part)
|
|
41
41
|
)
|
|
42
42
|
.join("/")}\`;
|
|
43
43
|
${actionName}URL.params = [${params
|
|
@@ -86,9 +86,9 @@ export async function generateRoutes(): Promise<void> {
|
|
|
86
86
|
target_locreq.resolve("src/back/routes"),
|
|
87
87
|
resolve(
|
|
88
88
|
fullpath,
|
|
89
|
-
basename(fullpath).startsWith("index.")
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
basename(fullpath).startsWith("index.") ?
|
|
90
|
+
"../"
|
|
91
|
+
: ""
|
|
92
92
|
)
|
|
93
93
|
).replace(/\..+/, "") +
|
|
94
94
|
"/"
|
|
@@ -96,8 +96,35 @@ export async function generateRoutes(): Promise<void> {
|
|
|
96
96
|
}))
|
|
97
97
|
);
|
|
98
98
|
|
|
99
|
+
type URLTree = {
|
|
100
|
+
actionName?: string;
|
|
101
|
+
children: { [key: string]: URLTree };
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const url_tree: URLTree = { children: {} };
|
|
105
|
+
sortRoutes(files).forEach(({ actionName, url }) => {
|
|
106
|
+
const elements = url.split("/").filter((e) => e != "");
|
|
107
|
+
let pointer: URLTree = url_tree;
|
|
108
|
+
for (const [index, element] of elements.entries()) {
|
|
109
|
+
if (!pointer.children[element]) {
|
|
110
|
+
pointer.children[element] = { children: {} };
|
|
111
|
+
}
|
|
112
|
+
pointer = pointer.children[element];
|
|
113
|
+
if (index == elements.length - 1) {
|
|
114
|
+
(pointer as unknown as { actionName: string }).actionName =
|
|
115
|
+
actionName;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
99
120
|
const routes_content = `// DO NOT EDIT! This file is generated automaticaly with npm run generate-routes
|
|
100
121
|
|
|
122
|
+
export type URLTree = {
|
|
123
|
+
actionName?: string;
|
|
124
|
+
children: { [key: string]: URLTree };
|
|
125
|
+
};
|
|
126
|
+
export const url_tree = ${JSON.stringify(url_tree)};
|
|
127
|
+
|
|
101
128
|
import type Router from "@koa/router";
|
|
102
129
|
import { mount } from "@sealcode/sealgen";
|
|
103
130
|
import * as URLs from "./urls.js"
|
|
@@ -121,9 +148,11 @@ ${sortRoutes(files)
|
|
|
121
148
|
.join("\n")}
|
|
122
149
|
}`;
|
|
123
150
|
|
|
124
|
-
const urls_content =
|
|
125
|
-
|
|
126
|
-
|
|
151
|
+
const urls_content = `/* DO NOT EDIT! This file is generated automaticall with npm run generate-routes. */
|
|
152
|
+
|
|
153
|
+
${sortRoutes(files)
|
|
154
|
+
.map(({ actionName, url }) => generateURL(actionName, url))
|
|
155
|
+
.join("\n")}
|
|
127
156
|
`;
|
|
128
157
|
|
|
129
158
|
await fs.writeFile(
|
package/.xunit
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
<testsuite name="Mocha Tests" tests="73" failures="0" errors="0" skipped="0" timestamp="Sun, 21 Sep 2025 18:00:04 GMT" time="312.378">
|
|
2
|
-
<testcase classname="single-reference" name="creates an item list page with working partial string search for text fields" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/add-list-route.test.js" time="26.145"/>
|
|
3
|
-
<testcase classname="add route test" name="creates minimal sealious app and adds a simple route that works" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/add-route.test.js" time="20.509"/>
|
|
4
|
-
<testcase classname="empty test" name="empty test" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/example.test.js" time="0"/>
|
|
5
|
-
<testcase classname="checkboxed-list basic tests" name="sends the values" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.484"/>
|
|
6
|
-
<testcase classname="checkboxed-list basic tests" name="renders the label" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.375"/>
|
|
7
|
-
<testcase classname="checkboxed-list basic tests" name="groups checkboxes based on the value of the 'group' attribute" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.57"/>
|
|
8
|
-
<testcase classname="checkboxed-list basic tests behavior with (non)required" name="allows to send a form when no value is selected and fiels is not required" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.454"/>
|
|
9
|
-
<testcase classname="checkboxed-list basic tests behavior with (non)required" name="does not allow to send a form when no value is selected and field IS required" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.559"/>
|
|
10
|
-
<testcase classname="checkboxed-list basic tests behavior with (non)required" name="allows to send a form when no value is selected and field IS required" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/controls/checkboxed-list-input.test.js" time="0.562"/>
|
|
11
|
-
<testcase classname="file-control basic tests" name="doesn't require image input if it already has old-value" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/controls/file.test.js" time="0.537"/>
|
|
12
|
-
<testcase classname="photo-control basic tests" name="sends the old photo if it wasn't changed and it has an initial value" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/controls/image.test.js" time="0.472"/>
|
|
13
|
-
<testcase classname="photo-control basic tests" name="doesn't require image input if it already has old-value" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/controls/image.test.js" time="0.515"/>
|
|
14
|
-
<testcase classname="single-reference.test" name="creates minimal sealious app and adds form using single-reference field that works" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/controls/single-reference.test.js" time="28.324"/>
|
|
15
|
-
<testcase classname="boolean field" name="validation logic" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/boolean.test.js" time="0"/>
|
|
16
|
-
<testcase classname="boolean field" name="parse function" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/boolean.test.js" time="0.001"/>
|
|
17
|
-
<testcase classname="email field" name="validation logic" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/email.test.js" time="0.001"/>
|
|
18
|
-
<testcase classname="email field" name="parse function" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/email.test.js" time="0"/>
|
|
19
|
-
<testcase classname="basic field basic tests" name="sends the values" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/field.test.js" time="0.331"/>
|
|
20
|
-
<testcase classname="basic field basic tests" name="Doesn't call `isValueValid` and `parse` if the value is empty" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/field.test.js" time="0.47"/>
|
|
21
|
-
<testcase classname="basic field basic tests" name="Accepts a form where non-required values are empty" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/field.test.js" time="0.546"/>
|
|
22
|
-
<testcase classname="file field" name="should handle as imple upload scenario" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/file.test.js" time="0.487"/>
|
|
23
|
-
<testcase classname="number field" name="validation logic" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/number.test.js" time="0.001"/>
|
|
24
|
-
<testcase classname="number field" name="parse function" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/number.test.js" time="0"/>
|
|
25
|
-
<testcase classname="pick-from-list field" name="validation logic" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/pick-from-list.test.js" time="0.001"/>
|
|
26
|
-
<testcase classname="regexp field" name="validation logic" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/regexp.test.js" time="0"/>
|
|
27
|
-
<testcase classname="regexp field" name="parse function" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/fields/regexp.test.js" time="0"/>
|
|
28
|
-
<testcase classname="form test basic tests" name="does not allow to submit an empty form when there's a required field" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.621"/>
|
|
29
|
-
<testcase classname="form test basic tests" name="allows to submit a form when all required fields have a value" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.202"/>
|
|
30
|
-
<testcase classname="form test basic tests" name="does not allow submitting an empty form by circumventing HTML-based validation" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.026"/>
|
|
31
|
-
<testcase classname="form test canAccess tests" name="allows visit when configured when canAccess returns true" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.02"/>
|
|
32
|
-
<testcase classname="form test canAccess tests" name="passes the context to canAccess (false case)" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.017"/>
|
|
33
|
-
<testcase classname="form test canAccess tests" name="passes the context to canAccess (true case)" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.019"/>
|
|
34
|
-
<testcase classname="form test canAccess tests declines access when canAccess returns false" name="prevents the form from rendering" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.014"/>
|
|
35
|
-
<testcase classname="form test canAccess tests declines access when canAccess returns false" name="does not allow submitting of the form through axios" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.004"/>
|
|
36
|
-
<testcase classname="form test validation e2e validation message" name="shows up when incorrect input is given" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.267"/>
|
|
37
|
-
<testcase classname="form test validation e2e validation message" name="doesn't show when correct input is given" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.643"/>
|
|
38
|
-
<testcase classname="form test validation e2e field specific validation message" name="shows up when incorrect input is given" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.242"/>
|
|
39
|
-
<testcase classname="form test validation e2e field specific validation message" name="doesn't show up when correct input is given" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.135"/>
|
|
40
|
-
<testcase classname="form test getInitialValues tests" name="fills the form with values from getInitialValues" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/form.test.js" time="0.058"/>
|
|
41
|
-
<testcase classname="multiform test basic tests turbolinks + js enabled" name="checking whether only one submit handler is run" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.595"/>
|
|
42
|
-
<testcase classname="multiform test basic tests turbolinks + js enabled" name="checking whether the input in the not submitted form prevails" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.007"/>
|
|
43
|
-
<testcase classname="multiform test basic tests turbolinks + js disabled" name="checking whether only one submit handler is run" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.577"/>
|
|
44
|
-
<testcase classname="multiform test basic tests turbolinks + js disabled" name="checking whether the input in the not submitted form prevails" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.008"/>
|
|
45
|
-
<testcase classname="multiform test canAccess allow access to both forms when both canAccess return true" name="check wether it renders" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="1.023"/>
|
|
46
|
-
<testcase classname="multiform test canAccess allow access to both forms when both canAccess return true" name="check wether you can submit through http (axios)" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.007"/>
|
|
47
|
-
<testcase classname="multiform test canAccess deny access to both forms" name="check wether forms didnt render" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.481"/>
|
|
48
|
-
<testcase classname="multiform test canAccess deny access to both forms" name="check wether it's possible to submit through http" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.008"/>
|
|
49
|
-
<testcase classname="multiform test canAccess allow access to one form, deny to the other" name="check wether form1 renders" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.535"/>
|
|
50
|
-
<testcase classname="multiform test canAccess allow access to one form, deny to the other" name="check wether it's possible to submit to form1 through http" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.003"/>
|
|
51
|
-
<testcase classname="multiform test canAccess allow access to one form, deny to the other" name="check wether form2 does not render" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.334"/>
|
|
52
|
-
<testcase classname="multiform test canAccess allow access to one form, deny to the other" name="check wether it's possible to submit to form2 through http" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.003"/>
|
|
53
|
-
<testcase classname="multiform test validation e2e basic tests" name="js enabled" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="1.319"/>
|
|
54
|
-
<testcase classname="multiform test validation e2e basic tests" name="js disabled" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.948"/>
|
|
55
|
-
<testcase classname="multiform test validation e2e field specific validation js enabled" name="validation message shows when incorrect input is given" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.225"/>
|
|
56
|
-
<testcase classname="multiform test validation e2e field specific validation js enabled" name="validation message doesn't show when correct input is given" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.127"/>
|
|
57
|
-
<testcase classname="multiform test validation e2e field specific validation js disabled" name="validation message shows when incorrect input is given" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.263"/>
|
|
58
|
-
<testcase classname="multiform test validation e2e field specific validation js disabled" name="validation message doesn't show when correct input is given" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/forms/multiform.test.js" time="0.134"/>
|
|
59
|
-
<testcase classname="generate routes" name="handles a url with params" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/generate-routes.test.js" time="0.01"/>
|
|
60
|
-
<testcase classname="generate routes" name="handles polish characters in the url" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/generate-routes.test.js" time="0.001"/>
|
|
61
|
-
<testcase classname="generate routes" name="handles a url with params and diacritics" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/generate-routes.test.js" time="0.005"/>
|
|
62
|
-
<testcase classname="generate routes" name="sorts routes from most specific first to least specific last, considering directory structure" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/generate-routes.test.js" time="0.001"/>
|
|
63
|
-
<testcase classname="mountable-with-fields" name="properly types the getParsedValues method and respects required status" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/page/mountable-with-fields.test.js" time="0"/>
|
|
64
|
-
<testcase classname="sealious-list test" name="creates minimal sealious app and adds a simple route that works" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/page/sealious-list.test.js" time="29.534"/>
|
|
65
|
-
<testcase classname="stateful page" name="has types that allow for extracting action argument types" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/page/stateful-page.test.js" time="0"/>
|
|
66
|
-
<testcase classname="stateful page" name="handles a basic case with action buttons" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/page/stateful-page.test.js" time="0"/>
|
|
67
|
-
<testcase classname="register-external CLI commands package.json configuration" name="registers external controllers and verifies package.json is updated" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/register-external.test.js" time="19.565"/>
|
|
68
|
-
<testcase classname="register-external CLI commands package.json configuration" name="registers external styles and verifies package.json is updated" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/register-external.test.js" time="17.792"/>
|
|
69
|
-
<testcase classname="register-external CLI commands package.json configuration" name="registers both controllers and styles in the same project" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/register-external.test.js" time="22.799"/>
|
|
70
|
-
<testcase classname="register-external CLI commands package.json configuration" name="handles duplicate registrations gracefully" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/register-external.test.js" time="22.786"/>
|
|
71
|
-
<testcase classname="register-external CLI commands package.json configuration" name="preserves existing sealgen configuration when adding new entries" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/register-external.test.js" time="21.942"/>
|
|
72
|
-
<testcase classname="register-external CLI commands build integration" name="registers external controllers and verifies they are included in build" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/register-external.test.js" time="22.953"/>
|
|
73
|
-
<testcase classname="register-external CLI commands build integration" name="registers external styles and verifies they are included in build" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/register-external.test.js" time="29.347"/>
|
|
74
|
-
<testcase classname="register-external CLI commands build integration" name="registers both external controllers and styles and verifies complete build integration" file="/home/kuba/projects/sealcode/superseal/repos/sealgen/lib-instrumented/register-external.test.js" time="29.435"/>
|
|
75
|
-
</testsuite>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Builder } from "./builder.js";
|
|
2
|
-
export declare const COLORS_TS_PATH = "src/back/colors.ts";
|
|
3
|
-
export declare const COLORS_CSS_PATH = "src/colors.css";
|
|
4
|
-
export declare const COLORS_HTML_PATH = "public/dist/colors.html";
|
|
5
|
-
export declare class ColorsBuilder extends Builder {
|
|
6
|
-
getName(): string;
|
|
7
|
-
ownsFile(file_path: string): file_path is "src/back/colors.ts";
|
|
8
|
-
dispose(): Promise<void>;
|
|
9
|
-
_build(): Promise<void>;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import Router from "@koa/router";
|
|
2
|
-
import { Context } from "koa";
|
|
3
|
-
import { Field, FieldsetOutput } from "sealious";
|
|
4
|
-
import { FormField } from "../fields/field.js";
|
|
5
|
-
import { StructuredArray as StructuredArrayField } from "../fields/structured-array.js";
|
|
6
|
-
import { FormDataValue } from "../form-types.js";
|
|
7
|
-
import { FormControl, FormControlContext } from "./form-control.js";
|
|
8
|
-
import { FormFieldControl } from "./form-field-control.js";
|
|
9
|
-
export type UnboundControlStorage<F extends {
|
|
10
|
-
new (...args: any): FormFieldControl;
|
|
11
|
-
} = {
|
|
12
|
-
new (...args: any): FormFieldControl;
|
|
13
|
-
}> = [F, string, ConstructorParameters<F>];
|
|
14
|
-
export declare function UnboundControl<F extends {
|
|
15
|
-
new (...args: any): FormFieldControl;
|
|
16
|
-
}>(controlClass: F, arbitrary_field_name: string, params: ConstructorParameters<F>["1"]): UnboundControlStorage;
|
|
17
|
-
export declare class StructuredArray<Subfields extends Record<string, Field<any>>> extends FormFieldControl {
|
|
18
|
-
field: StructuredArrayField<Subfields>;
|
|
19
|
-
item_controls: Array<FormControl | UnboundControlStorage>;
|
|
20
|
-
constructor(field: StructuredArrayField<Subfields>, item_controls: Array<FormControl | UnboundControlStorage>);
|
|
21
|
-
getFrameID(): string;
|
|
22
|
-
getInnerFormID(): string;
|
|
23
|
-
getActionURL(form_id?: string, action?: Record<string, unknown>): string;
|
|
24
|
-
getDefaultItemBody(): Promise<{}>;
|
|
25
|
-
makeSubfield(_field_name: string): FormField;
|
|
26
|
-
renderItemControl(ctx: Context, form_id: string, control: FormControl | UnboundControlStorage, item: FieldsetOutput<Subfields>, index: number): Promise<(string | number | import("stream").Readable | null) | (string | number | import("stream").Readable | null)[] | Promise<string | number | import("stream").Readable | null>[]>;
|
|
27
|
-
renderItem(ctx: Context, form_id: string, item: FieldsetOutput<Subfields>, index: number): Promise<string>;
|
|
28
|
-
getItems(ctx: Context, raw_values: Record<string, FormDataValue>): Promise<FieldsetOutput<Subfields>[]>;
|
|
29
|
-
_render(ctx: Context, form_id: string, raw_values: Record<string, FormDataValue>): Promise<string>;
|
|
30
|
-
render(fctx: FormControlContext): Promise<string>;
|
|
31
|
-
getTargetItemID(ctx: Context): Promise<string>;
|
|
32
|
-
mount(router: Router): void;
|
|
33
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import Router from "@koa/router";
|
|
2
|
-
import { Context } from "koa";
|
|
3
|
-
import { Field, FieldsetOutput } from "sealious";
|
|
4
|
-
import { FormField } from "../fields/field.js";
|
|
5
|
-
import { StructuredArray as StructuredArrayField } from "../fields/structured-array.js";
|
|
6
|
-
import { FormDataValue } from "../form-types.js";
|
|
7
|
-
import { FormControl, FormControlContext } from "./form-control.js";
|
|
8
|
-
import { FormFieldControl } from "./form-field-control.js";
|
|
9
|
-
export type UnboundControlStorage<F extends {
|
|
10
|
-
new (...args: any): FormFieldControl;
|
|
11
|
-
} = {
|
|
12
|
-
new (...args: any): FormFieldControl;
|
|
13
|
-
}> = [F, string, ConstructorParameters<F>];
|
|
14
|
-
export declare function UnboundControl<F extends {
|
|
15
|
-
new (...args: any): FormFieldControl;
|
|
16
|
-
}>(controlClass: F, arbitrary_field_name: string, params: ConstructorParameters<F>["1"]): UnboundControlStorage;
|
|
17
|
-
export declare class StructuredArray<Subfields extends Record<string, Field<any>>> extends FormFieldControl {
|
|
18
|
-
field: StructuredArrayField<Subfields>;
|
|
19
|
-
item_controls: Array<FormControl | UnboundControlStorage>;
|
|
20
|
-
constructor(field: StructuredArrayField<Subfields>, item_controls: Array<FormControl | UnboundControlStorage>);
|
|
21
|
-
getFrameID(): string;
|
|
22
|
-
getInnerFormID(): string;
|
|
23
|
-
getActionURL(form_id?: string, action?: Record<string, unknown>): string;
|
|
24
|
-
getDefaultItemBody(): Promise<{}>;
|
|
25
|
-
makeSubfield(_field_name: string): FormField;
|
|
26
|
-
renderItemControl(ctx: Context, form_id: string, control: FormControl | UnboundControlStorage, item: FieldsetOutput<Subfields>, index: number): Promise<(string | number | import("stream").Readable | null) | (string | number | import("stream").Readable | null)[] | Promise<string | number | import("stream").Readable | null>[]>;
|
|
27
|
-
renderItem(ctx: Context, form_id: string, item: FieldsetOutput<Subfields>, index: number): Promise<string>;
|
|
28
|
-
getItems(ctx: Context, raw_values: Record<string, FormDataValue>): Promise<FieldsetOutput<Subfields>[]>;
|
|
29
|
-
_render(ctx: Context, form_id: string, raw_values: Record<string, FormDataValue>): Promise<string>;
|
|
30
|
-
render(fctx: FormControlContext): Promise<string>;
|
|
31
|
-
getTargetItemID(ctx: Context): Promise<string>;
|
|
32
|
-
mount(router: Router): void;
|
|
33
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Context } from "koa";
|
|
2
|
-
import { PickFromListField } from "../fields/pick-from-list.js";
|
|
3
|
-
import { FormControlContext } from "./form-control.js";
|
|
4
|
-
import { SimpleInput } from "./simple-input.js";
|
|
5
|
-
export declare class Autocomplete extends SimpleInput<string | null> {
|
|
6
|
-
field: PickFromListField<boolean>;
|
|
7
|
-
options: {
|
|
8
|
-
id?: string;
|
|
9
|
-
label?: string;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
};
|
|
12
|
-
constructor(field: PickFromListField<boolean>, options: {
|
|
13
|
-
id?: string;
|
|
14
|
-
label?: string;
|
|
15
|
-
placeholder?: string;
|
|
16
|
-
});
|
|
17
|
-
getListID(): string;
|
|
18
|
-
getInputAttributes(fctx: FormControlContext): Promise<{
|
|
19
|
-
list: string;
|
|
20
|
-
}>;
|
|
21
|
-
postInput(ctx: Context): Promise<string>;
|
|
22
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { FlatTemplatable } from "tempstream";
|
|
2
|
-
import { CheckboxWithValue } from "./checkbox.js";
|
|
3
|
-
import { FormControlContext } from "./form-control.js";
|
|
4
|
-
import { FormFieldControl } from "./form-field-control.js";
|
|
5
|
-
import { CheckboxedListField } from "../fields/checkboxed-list.js";
|
|
6
|
-
export type DefaultCheckboxOptions = {
|
|
7
|
-
id?: string;
|
|
8
|
-
label?: string;
|
|
9
|
-
hide_errors?: boolean;
|
|
10
|
-
readonly?: boolean;
|
|
11
|
-
name?: string;
|
|
12
|
-
checkboxNameToLabel?: (name: string) => string;
|
|
13
|
-
classes?: string[];
|
|
14
|
-
};
|
|
15
|
-
export declare class CheckboxGroup<Options extends DefaultCheckboxOptions = DefaultCheckboxOptions> extends FormFieldControl {
|
|
16
|
-
field: CheckboxedListField<boolean, string>;
|
|
17
|
-
options: Options;
|
|
18
|
-
constructor(field: CheckboxedListField<boolean, string>, options?: Options);
|
|
19
|
-
wrapGroup(fctx: FormControlContext, checkboxes: CheckboxWithValue[]): Promise<FlatTemplatable>;
|
|
20
|
-
render(fctx: FormControlContext): Promise<FlatTemplatable>;
|
|
21
|
-
}
|
package/@types/forms/controls/checkboxed-list-input.d.sync-conflict-20250918-184323-TFDLWFG.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CheckboxedListField } from "../fields/checkboxed-list.js";
|
|
2
|
-
import { FormControlContext } from "./form-control.js";
|
|
3
|
-
import { FormFieldControl } from "./form-field-control.js";
|
|
4
|
-
export declare class CheckboxedListInput<Values extends string> extends FormFieldControl {
|
|
5
|
-
field: CheckboxedListField<boolean, Values>;
|
|
6
|
-
options: {
|
|
7
|
-
label: string;
|
|
8
|
-
};
|
|
9
|
-
constructor(field: CheckboxedListField<boolean, Values>, options?: {
|
|
10
|
-
label: string;
|
|
11
|
-
});
|
|
12
|
-
generateCountBasedClasses(n: number): string[];
|
|
13
|
-
render(fctx: FormControlContext): Promise<string>;
|
|
14
|
-
renderOption({ name, value, form_id, label, checked, }: {
|
|
15
|
-
name: string;
|
|
16
|
-
form_id: string;
|
|
17
|
-
value: string;
|
|
18
|
-
label?: string;
|
|
19
|
-
checked: boolean;
|
|
20
|
-
}): string | Promise<string>;
|
|
21
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import Router from "@koa/router";
|
|
2
|
-
import { Context } from "koa";
|
|
3
|
-
import { ParsedUrlQuery } from "querystring";
|
|
4
|
-
import { FlatTemplatable } from "tempstream";
|
|
5
|
-
import { FormField } from "../fields/field.js";
|
|
6
|
-
import { Derived } from "./derived.js";
|
|
7
|
-
import { FormControlContext } from "./form-control.js";
|
|
8
|
-
export declare class DerivedFrame extends Derived<{
|
|
9
|
-
frame_id: string;
|
|
10
|
-
form_id: string;
|
|
11
|
-
field_name_prefix: string;
|
|
12
|
-
}> {
|
|
13
|
-
frame_name: string;
|
|
14
|
-
generateFrameContent: (ctx: FormControlContext, args: ParsedUrlQuery) => Promise<FlatTemplatable>;
|
|
15
|
-
frame_id: string;
|
|
16
|
-
constructor(frame_name: string, fields: FormField[], generateFrameContent: (ctx: FormControlContext, args: ParsedUrlQuery) => Promise<FlatTemplatable>, frame_id?: string);
|
|
17
|
-
renderBackendResponseFrame(_ctx: Context, content: FlatTemplatable): string | Promise<string>;
|
|
18
|
-
mount(router: Router): void;
|
|
19
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Context } from "koa";
|
|
2
|
-
import { FlatTemplatable } from "tempstream";
|
|
3
|
-
import { FormField } from "../fields/field.js";
|
|
4
|
-
import { PickFromListField } from "../fields/pick-from-list.js";
|
|
5
|
-
import { FormDataValue } from "../form-types.js";
|
|
6
|
-
import { FormControlContext } from "./form-control.js";
|
|
7
|
-
import { SimpleInput } from "./simple-input.js";
|
|
8
|
-
export type DropdownOptions = {
|
|
9
|
-
label: string;
|
|
10
|
-
autosubmit?: boolean;
|
|
11
|
-
autocomplete?: boolean;
|
|
12
|
-
};
|
|
13
|
-
export type DropdownOption = {
|
|
14
|
-
value: string;
|
|
15
|
-
label: string;
|
|
16
|
-
};
|
|
17
|
-
export declare class FreeformDropdown extends SimpleInput<string | null> {
|
|
18
|
-
field: FormField<boolean, string | null>;
|
|
19
|
-
_generateOptions: (ctx: Context) => Promise<DropdownOption[]>;
|
|
20
|
-
options: DropdownOptions;
|
|
21
|
-
constructor(field: FormField<boolean, string | null>, _generateOptions: (ctx: Context) => Promise<DropdownOption[]>, options?: DropdownOptions);
|
|
22
|
-
generateOptions(ctx: Context): Promise<DropdownOption[]>;
|
|
23
|
-
getInputAttributes(fctx: FormControlContext): Promise<Record<string, string | boolean>>;
|
|
24
|
-
renderInput(ctx: Context, attributes_str: string, data: Record<string, FormDataValue>): Promise<FlatTemplatable>;
|
|
25
|
-
}
|
|
26
|
-
export declare class Dropdown extends FreeformDropdown {
|
|
27
|
-
field: PickFromListField<boolean>;
|
|
28
|
-
options: DropdownOptions;
|
|
29
|
-
constructor(field: PickFromListField<boolean>, options?: DropdownOptions);
|
|
30
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Context } from "koa";
|
|
2
|
-
import { FilePointer } from "@sealcode/file-manager";
|
|
3
|
-
import { FlatTemplatable } from "tempstream";
|
|
4
|
-
import { FileContainer } from "../fields/file.js";
|
|
5
|
-
import { FormDataValue } from "../form-types.js";
|
|
6
|
-
import { FormControlContext } from "./form-control.js";
|
|
7
|
-
import { SimpleInput } from "./simple-input.js";
|
|
8
|
-
export declare class File extends SimpleInput<FileContainer> {
|
|
9
|
-
getType(): string;
|
|
10
|
-
renderFilePreview(_ctx: Context, file: FilePointer | null): Promise<FlatTemplatable>;
|
|
11
|
-
preInput(fctx: FormControlContext, data: Record<string, FormDataValue>): Promise<string>;
|
|
12
|
-
getInputAttributes(fctx: FormControlContext): Promise<Record<string, string | boolean>>;
|
|
13
|
-
}
|