@sealcode/sealgen 0.19.25 → 0.19.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.
- package/@types/forms/controls/dropdown.d.ts +6 -6
- package/@types/forms/controls/single-reference.d.ts +9 -6
- package/@types/forms/fields/field.d.ts +2 -2
- package/@types/forms/fields/pick-from-list.d.ts +2 -2
- package/@types/forms/fields/simple-form-field.d.ts +1 -1
- package/@types/forms/multiform.d.ts +4 -3
- package/@types/page/stateful-page.d.ts +1 -1
- package/@types/src/add-collection.d.ts +1 -0
- package/@types/src/add-crud.d.ts +3 -0
- package/@types/src/add-crud.test.d.ts +1 -0
- package/@types/src/add-jdd-component.d.ts +1 -0
- package/@types/src/add-list-route.test.d.ts +1 -0
- package/@types/src/add-route.d.ts +3 -0
- package/@types/src/add-route.test.d.ts +1 -0
- package/@types/src/build.d.ts +3 -0
- package/@types/src/builders/backend-ts-builder.d.ts +7 -0
- package/@types/src/builders/builder.d.ts +11 -0
- package/@types/src/builders/colors-builder.d.ts +10 -0
- package/@types/src/builders/css-builder.d.ts +19 -0
- package/@types/src/builders/fonts-builder.d.ts +7 -0
- package/@types/src/builders/frontend-ts-builder.d.ts +11 -0
- package/@types/src/cli.d.ts +2 -0
- package/@types/src/components/components.d.ts +2 -0
- package/@types/src/components/tabs.d.ts +2 -0
- package/@types/src/components/toggle-modal.d.ts +6 -0
- package/@types/src/controllers/password-generate-button.stimulus.d.ts +5 -0
- package/@types/src/controllers/sealgen-table.stimulus.d.ts +13 -0
- package/@types/src/embeddable-file-extensions.d.ts +1 -0
- package/@types/src/esbuild-plugins/load-assets.d.ts +5 -0
- package/@types/src/esbuild-plugins/rewrite-asset-imports.d.ts +5 -0
- package/@types/src/example.test.d.ts +1 -0
- package/@types/src/forms/controls/array.d.ts +33 -0
- package/@types/src/forms/controls/autocomplete.d.ts +22 -0
- package/@types/src/forms/controls/big-radio-group.d.ts +14 -0
- package/@types/src/forms/controls/checkbox-group.d.ts +21 -0
- package/@types/src/forms/controls/checkbox.d.ts +17 -0
- package/@types/src/forms/controls/checkboxed-list-input.d.ts +21 -0
- package/@types/src/forms/controls/checkboxed-list-input.test.d.ts +1 -0
- package/@types/src/forms/controls/collapsible-checkbox-group.d.ts +11 -0
- package/@types/src/forms/controls/collapsible-field-group.d.ts +21 -0
- package/@types/src/forms/controls/controls.d.ts +32 -0
- package/@types/src/forms/controls/derived-frame.d.ts +19 -0
- package/@types/src/forms/controls/derived.d.ts +13 -0
- package/@types/src/forms/controls/dropdown.d.ts +30 -0
- package/@types/src/forms/controls/editable-collection-subset.d.ts +20 -0
- package/@types/src/forms/controls/field-group.d.ts +23 -0
- package/@types/src/forms/controls/file.d.ts +12 -0
- package/@types/src/forms/controls/file.test.d.ts +1 -0
- package/@types/src/forms/controls/form-control.d.ts +23 -0
- package/@types/src/forms/controls/form-field-control.d.ts +13 -0
- package/@types/src/forms/controls/form-header.d.ts +8 -0
- package/@types/src/forms/controls/form-paragraph.d.ts +7 -0
- package/@types/src/forms/controls/frame.d.ts +17 -0
- package/@types/src/forms/controls/hidden-input.d.ts +9 -0
- package/@types/src/forms/controls/html.d.ts +11 -0
- package/@types/src/forms/controls/hybrid.d.ts +10 -0
- package/@types/src/forms/controls/image.d.ts +19 -0
- package/@types/src/forms/controls/image.test.d.ts +1 -0
- package/@types/src/forms/controls/multiple-files.d.ts +42 -0
- package/@types/src/forms/controls/multiple-images.d.ts +19 -0
- package/@types/src/forms/controls/number.d.ts +13 -0
- package/@types/src/forms/controls/password-with-generator.d.ts +6 -0
- package/@types/src/forms/controls/radio.d.ts +16 -0
- package/@types/src/forms/controls/simple-input.d.ts +35 -0
- package/@types/src/forms/controls/single-reference.d.ts +14 -0
- package/@types/src/forms/controls/single-reference.test.d.ts +1 -0
- package/@types/{forms/controls/table.d.sync-conflict-20260502-145940-GP5D735.ts → src/forms/controls/table.d.ts} +2 -0
- package/@types/src/forms/controls/textarea.d.ts +25 -0
- package/@types/src/forms/controls/tickable.d.ts +25 -0
- package/@types/src/forms/fields/boolean.d.ts +22 -0
- package/@types/src/forms/fields/boolean.test.d.ts +1 -0
- package/@types/src/forms/fields/checkboxed-list.d.ts +23 -0
- package/@types/src/forms/fields/collection-field.d.ts +22 -0
- package/@types/src/forms/fields/color.d.ts +4 -0
- package/@types/src/forms/fields/coordinates.d.ts +14 -0
- package/@types/src/forms/fields/date.d.ts +13 -0
- package/@types/src/forms/fields/datetime.d.ts +14 -0
- package/@types/src/forms/fields/deep-reverse-single-reference-list.d.ts +20 -0
- package/@types/src/forms/fields/deep-reverse-single-reference-table.d.ts +16 -0
- package/@types/src/forms/fields/email.d.ts +10 -0
- package/@types/src/forms/fields/email.test.d.ts +1 -0
- package/@types/src/forms/fields/enum-multiple-sealious.d.ts +16 -0
- package/@types/src/forms/fields/existing-sealious-value.d.ts +6 -0
- package/@types/src/forms/fields/field.d.ts +85 -0
- package/@types/src/forms/fields/field.test.d.ts +1 -0
- package/@types/src/forms/fields/fields.d.ts +34 -0
- package/@types/src/forms/fields/file.d.ts +25 -0
- package/@types/src/forms/fields/file.test.d.ts +1 -0
- package/@types/src/forms/fields/float.d.ts +4 -0
- package/@types/src/forms/fields/get-field-for-sealious.d.ts +33 -0
- package/@types/src/forms/fields/html.d.ts +6 -0
- package/@types/src/forms/fields/hybrid.d.ts +11 -0
- package/@types/src/forms/fields/image.d.ts +5 -0
- package/@types/src/forms/fields/int.d.ts +6 -0
- package/@types/src/forms/fields/item-draft.d.ts +20 -0
- package/@types/src/forms/fields/json.d.ts +13 -0
- package/@types/src/forms/fields/markdown.d.ts +6 -0
- package/@types/src/forms/fields/multiple-files.d.ts +16 -0
- package/@types/src/forms/fields/number.d.ts +25 -0
- package/@types/src/forms/fields/number.test.d.ts +1 -0
- package/@types/src/forms/fields/password.d.ts +10 -0
- package/@types/src/forms/fields/phone-number-with-country-code.d.ts +13 -0
- package/@types/src/forms/fields/phone-number.d.ts +17 -0
- package/@types/src/forms/fields/pick-from-list-sealious.d.ts +11 -0
- package/@types/src/forms/fields/pick-from-list.d.ts +15 -0
- package/@types/src/forms/fields/pick-from-list.test.d.ts +1 -0
- package/@types/src/forms/fields/proxy-field.d.ts +15 -0
- package/@types/src/forms/fields/regexp.d.ts +21 -0
- package/@types/src/forms/fields/regexp.test.d.ts +1 -0
- package/@types/src/forms/fields/simple-form-field.d.ts +31 -0
- package/@types/src/forms/fields/single-reference.d.ts +19 -0
- package/@types/src/forms/fields/structured-array.d.ts +23 -0
- package/@types/src/forms/fields/table.d.ts +16 -0
- package/@types/src/forms/fields/text.d.ts +6 -0
- package/@types/src/forms/fields/url.d.ts +6 -0
- package/@types/src/forms/form-types.d.ts +28 -0
- package/@types/src/forms/form.d.ts +34 -0
- package/@types/src/forms/form.test.d.ts +6 -0
- package/@types/src/forms/multiform.d.ts +23 -0
- package/@types/src/forms/multiform.test.d.ts +1 -0
- package/@types/src/generate-collections.d.ts +2 -0
- package/@types/src/generate-components.d.ts +1 -0
- package/@types/src/generate-routes.d.ts +5 -0
- package/@types/src/generate-routes.test.d.ts +1 -0
- package/@types/src/generate-stimulus.d.ts +1 -0
- package/@types/src/get-fonts.d.ts +2 -0
- package/@types/{index.d.sync-conflict-20260502-145557-GP5D735.ts → src/index.d.ts} +1 -0
- package/@types/src/make-env.d.ts +1 -0
- package/@types/src/make-hidden-inputs.d.ts +5 -0
- package/@types/src/mount.d.ts +6 -0
- package/@types/src/notifier.d.ts +2 -0
- package/@types/src/page/access-control.d.ts +6 -0
- package/@types/src/page/default-list-filters.d.ts +18 -0
- package/@types/src/page/list.d.ts +49 -0
- package/@types/src/page/mountable-with-fields.d.ts +49 -0
- package/@types/src/page/mountable-with-fields.test.d.ts +1 -0
- package/@types/src/page/mountable.d.ts +10 -0
- package/@types/src/page/page.d.ts +18 -0
- package/@types/src/page/props-parser.d.ts +15 -0
- package/@types/src/page/sealious-list.d.ts +20 -0
- package/@types/src/page/sealious-list.test.d.ts +1 -0
- package/@types/src/page/stateful-page.d.ts +63 -0
- package/@types/src/page/stateful-page.test.d.ts +1 -0
- package/@types/src/register-external.d.ts +2 -0
- package/@types/src/register-external.test.d.ts +1 -0
- package/@types/src/run.d.ts +1 -0
- package/@types/src/sanitize.d.ts +1 -0
- package/@types/src/target-locreq.d.ts +4 -0
- package/@types/src/templates/collection.d.ts +1 -0
- package/@types/src/templates/form.d.ts +14 -0
- package/@types/src/templates/form.test.d.ts +1 -0
- package/@types/src/templates/jdd-component.d.ts +1 -0
- package/@types/src/templates/jdd-editor.d.ts +1 -0
- package/@types/src/templates/list.d.ts +1 -0
- package/@types/src/templates/long-running-process.d.ts +1 -0
- package/@types/src/templates/multiform.d.ts +1 -0
- package/@types/src/templates/page.d.ts +1 -0
- package/@types/src/templates/post.d.ts +1 -0
- package/@types/src/templates/redirect.d.ts +1 -0
- package/@types/src/templates/route-test.d.ts +1 -0
- package/@types/src/templates/shared/collection-create-form.d.ts +1 -0
- package/@types/src/templates/shared/collection-edit-form.d.ts +1 -0
- package/@types/src/templates/shared/collection-list.d.ts +16 -0
- package/@types/src/templates/shared/item-delete.d.ts +1 -0
- package/@types/src/templates/shared/shared-crud-form-fields.d.ts +1 -0
- package/@types/src/templates/stateful-page.d.ts +1 -0
- package/@types/src/templates/stimulus-controller.d.ts +1 -0
- package/@types/src/templates/templates.d.ts +1 -0
- package/@types/src/test_utils/exec_async.d.ts +1 -0
- package/@types/src/test_utils/locator_is_visible.d.ts +2 -0
- package/@types/src/test_utils/test-on-real-app.d.ts +26 -0
- package/@types/src/utils/assert-throws.d.ts +1 -0
- package/@types/src/utils/base64.d.ts +2 -0
- package/@types/src/utils/browser-creator.d.ts +1 -0
- package/@types/src/utils/escape-url-params.d.ts +2 -0
- package/@types/src/utils/exec.d.ts +5 -0
- package/@types/src/utils/extract-fields-from-collection.d.ts +14 -0
- package/@types/src/utils/format-external-url.d.ts +1 -0
- package/@types/src/utils/import-path.d.ts +2 -0
- package/@types/src/utils/input-wrapper.d.ts +5 -0
- package/@types/src/utils/list-collections.d.ts +1 -0
- package/@types/src/utils/make-slug.d.ts +1 -0
- package/@types/src/utils/module-dirname.d.ts +1 -0
- package/@types/src/utils/natural-numbers.d.ts +1 -0
- package/@types/src/utils/prettier.d.ts +3 -0
- package/@types/src/utils/question.d.ts +1 -0
- package/@types/src/utils/render-attributes.d.ts +1 -0
- package/@types/src/utils/sleep.d.ts +1 -0
- package/@types/src/utils/translate.d.ts +4 -0
- package/@types/src/utils/url-with-new-params.d.ts +2 -0
- package/@types/src/utils/utils.d.ts +17 -0
- package/@types/src/utils/walk.d.ts +1 -0
- package/@types/src/utils/with-fallback.d.ts +2 -0
- package/@types/src/utils/wrap-attributes.d.ts +3 -0
- package/@types/src/utils/write-file.d.ts +1 -0
- package/lib/add-crud.test.js +1 -1
- package/lib/add-route.js +1 -3
- package/lib/builders/backend-ts-builder.js +1 -1
- package/lib/builders/colors-builder.js +4 -5
- package/lib/forms/controls/file.js +1 -1
- package/lib/forms/controls/multiple-files.js +6 -5
- package/lib/forms/controls/single-reference.js +4 -1
- package/lib/forms/fields/file.js +5 -5
- package/lib/forms/fields/image.js +1 -3
- package/lib/forms/fields/phone-number-with-country-code.js +0 -1
- package/lib/forms/fields/simple-form-field.js +1 -1
- package/lib/forms/fields/structured-array.js +1 -2
- package/lib/get-fonts.js +5 -1
- package/lib/page/mountable-with-fields.js +1 -2
- package/lib/page/mountable-with-fields.test.js +1 -1
- package/lib/page/sealious-list.js +3 -1
- package/package.json +3 -3
- package/src/add-route.ts +6 -8
- package/src/build.ts +1 -2
- package/src/builders/colors-builder.ts +11 -12
- package/src/cli.ts +4 -5
- package/src/controllers/sealgen-table.stimulus.ts +3 -3
- package/src/forms/controls/dropdown.ts +15 -13
- package/src/forms/controls/file.ts +1 -1
- package/src/forms/controls/multiple-files.ts +9 -12
- package/src/forms/controls/number.ts +8 -8
- package/src/forms/controls/single-reference.ts +25 -12
- package/src/forms/controls/table.ts +2 -2
- package/src/forms/controls/textarea.ts +4 -3
- package/src/forms/controls/tickable.ts +2 -2
- package/src/forms/fields/deep-reverse-single-reference-list.ts +2 -5
- package/src/forms/fields/deep-reverse-single-reference-table.ts +16 -14
- package/src/forms/fields/field.ts +4 -4
- package/src/forms/fields/file.ts +27 -21
- package/src/forms/fields/image.ts +1 -5
- package/src/forms/fields/phone-number-with-country-code.ts +1 -2
- package/src/forms/fields/pick-from-list.ts +2 -2
- package/src/forms/fields/simple-form-field.ts +3 -3
- package/src/forms/fields/structured-array.ts +2 -3
- package/src/forms/fields/table.ts +4 -7
- package/src/forms/multiform.ts +9 -6
- package/src/generate-routes.ts +3 -3
- package/src/get-fonts.ts +7 -3
- package/src/notifier.ts +1 -2
- package/src/page/list.ts +4 -4
- package/src/page/mountable-with-fields.test.ts +1 -1
- package/src/page/mountable-with-fields.ts +4 -4
- package/src/page/sealious-list.ts +17 -8
- package/src/page/stateful-page.ts +3 -3
- package/src/templates/jdd-editor.ts +1 -1
- package/src/test_utils/test-on-real-app.ts +5 -5
- package/tsconfig.json +3 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Router from "@koa/router";
|
|
2
|
+
import { Context } from "koa";
|
|
3
|
+
import { FlatTemplatable } from "tempstream";
|
|
4
|
+
import { FormMessage, FormData } from "../form-types.js";
|
|
5
|
+
import type { Form } from "../form.js";
|
|
6
|
+
export type FieldMessages<Fieldnames extends string = string> = Record<Fieldnames, {
|
|
7
|
+
type: "error" | "info";
|
|
8
|
+
message: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare class FormControlContext {
|
|
11
|
+
ctx: Context;
|
|
12
|
+
data: FormData;
|
|
13
|
+
messages: FormMessage[];
|
|
14
|
+
field_name_prefix: string;
|
|
15
|
+
form_id: string;
|
|
16
|
+
validate: boolean;
|
|
17
|
+
constructor(ctx: Context, data: FormData, messages: FormMessage[], field_name_prefix: string, form_id: string, validate: boolean);
|
|
18
|
+
}
|
|
19
|
+
export declare abstract class FormControl {
|
|
20
|
+
abstract render(fctx: FormControlContext): FlatTemplatable | Promise<FlatTemplatable>;
|
|
21
|
+
abstract role: "input" | "decoration" | "messages" | "submit";
|
|
22
|
+
mount(_router: Router, _form: Form<any, any>): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FlatTemplatable } from "tempstream";
|
|
2
|
+
import { FormField } from "../fields/field.js";
|
|
3
|
+
import { FieldValueType } from "../form-types.js";
|
|
4
|
+
import { FormControl, FormControlContext } from "./form-control.js";
|
|
5
|
+
export type FormFieldsToTypes<FormFields extends readonly FormField[]> = {
|
|
6
|
+
[Index in keyof FormFields]: FormFields[Index] extends FormField ? FieldValueType<FormFields[Index]> : never;
|
|
7
|
+
};
|
|
8
|
+
export declare abstract class FormFieldControl extends FormControl {
|
|
9
|
+
fields: FormField[];
|
|
10
|
+
role: "input";
|
|
11
|
+
constructor(fields: FormField[]);
|
|
12
|
+
abstract render(fctx: FormControlContext): FlatTemplatable | Promise<FlatTemplatable>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormControl, FormControlContext } from "./form-control.js";
|
|
2
|
+
export declare class FormHeader extends FormControl {
|
|
3
|
+
text: string;
|
|
4
|
+
isVisible: (fctx: FormControlContext) => Promise<boolean>;
|
|
5
|
+
role: "decoration";
|
|
6
|
+
constructor(text: string, isVisible?: (fctx: FormControlContext) => Promise<boolean>);
|
|
7
|
+
render(fctx: FormControlContext): Promise<string>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FlatTemplatable } from "tempstream";
|
|
2
|
+
import { FormControl } from "./form-control.js";
|
|
3
|
+
/**
|
|
4
|
+
* This class will render `turbo-frame` tag so that u can
|
|
5
|
+
* embed other route inside your form. This will require
|
|
6
|
+
* to add value to `data: FormData` (inside your master form
|
|
7
|
+
* render function) with key `Frame.FRAME_PATH_KEY`. Value
|
|
8
|
+
* needs to be url to route that you want to embed. If you
|
|
9
|
+
* this value wont be provided frame will redner empty string.
|
|
10
|
+
* See `src/back/routes/profile/[id].form.ts` for an example.
|
|
11
|
+
*/
|
|
12
|
+
export declare class Frame extends FormControl {
|
|
13
|
+
src: string;
|
|
14
|
+
constructor(src: string);
|
|
15
|
+
render(): FlatTemplatable | Promise<FlatTemplatable>;
|
|
16
|
+
role: "decoration";
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FlatTemplatable } from "tempstream";
|
|
2
|
+
import { FormField } from "../fields/field.js";
|
|
3
|
+
import { FormControlContext } from "./form-control.js";
|
|
4
|
+
import { FormFieldControl } from "./form-field-control.js";
|
|
5
|
+
export declare class HiddenInput extends FormFieldControl {
|
|
6
|
+
field: FormField;
|
|
7
|
+
constructor(field: FormField);
|
|
8
|
+
render(fctx: FormControlContext): Promise<FlatTemplatable>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FlatTemplatable } from "tempstream";
|
|
2
|
+
import { FormControl, FormControlContext } from "./form-control.js";
|
|
3
|
+
type Renderer = ((fctx: FormControlContext) => FlatTemplatable) | FlatTemplatable;
|
|
4
|
+
export declare class HTML extends FormControl {
|
|
5
|
+
role: "decoration" | "submit";
|
|
6
|
+
renderer: Renderer;
|
|
7
|
+
constructor(role: "decoration" | "submit", renderer: Renderer);
|
|
8
|
+
constructor(renderer: Renderer);
|
|
9
|
+
render(fctx: FormControlContext): Promise<FlatTemplatable>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FlatTemplatable } from "tempstream";
|
|
2
|
+
import { FormControlContext } from "./form-control.js";
|
|
3
|
+
import { FormFieldControl } from "./form-field-control.js";
|
|
4
|
+
import { FormField } from "../fields/field.js";
|
|
5
|
+
export declare class Hybrid extends FormFieldControl {
|
|
6
|
+
main_field: FormField;
|
|
7
|
+
subfields: Record<string, FormField>;
|
|
8
|
+
constructor(main_field: FormField, subfields: Record<string, FormField>);
|
|
9
|
+
render(fctx: FormControlContext): Promise<FlatTemplatable>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { FlatTemplatable } from "tempstream";
|
|
3
|
+
import { File } from "./file.js";
|
|
4
|
+
import { FormField } from "../fields/field.js";
|
|
5
|
+
import { SimpleInputOptions } from "./simple-input.js";
|
|
6
|
+
import { FormControlContext } from "./form-control.js";
|
|
7
|
+
import { FileContainer } from "../fields/file.js";
|
|
8
|
+
import { FilePointer } from "@sealcode/file-manager";
|
|
9
|
+
export declare class Image extends File {
|
|
10
|
+
field: FormField<boolean, FileContainer>;
|
|
11
|
+
constructor(field: FormField<boolean, FileContainer>, options?: SimpleInputOptions);
|
|
12
|
+
getImgStyle(): Promise<string>;
|
|
13
|
+
renderFilePreview(ctx: Context, file: FilePointer | null): Promise<FlatTemplatable>;
|
|
14
|
+
getWrapperModifiers(): string[];
|
|
15
|
+
getInputAttributes(fctx: FormControlContext): Promise<{
|
|
16
|
+
accept: string;
|
|
17
|
+
onchange: string;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import Router from "@koa/router";
|
|
2
|
+
import { Collection, CollectionItem, Field as SealiousField } from "sealious";
|
|
3
|
+
import { Context } from "koa";
|
|
4
|
+
import { FlatTemplatable } from "tempstream";
|
|
5
|
+
import { MultipleFiles as MultipleFilesField } from "../fields/multiple-files.js";
|
|
6
|
+
import { FormFieldControl } from "./form-field-control.js";
|
|
7
|
+
import { FormControlContext } from "./form-control.js";
|
|
8
|
+
import { FilePointer } from "@sealcode/file-manager";
|
|
9
|
+
export type MultipleFilesOptions = {
|
|
10
|
+
label?: string;
|
|
11
|
+
uploadLabel?: string;
|
|
12
|
+
getAdditionalFields: (ctx: Context, file: FilePointer) => Promise<Record<string, unknown>>;
|
|
13
|
+
};
|
|
14
|
+
export declare class MultipleFiles extends FormFieldControl {
|
|
15
|
+
field: MultipleFilesField;
|
|
16
|
+
options: MultipleFilesOptions;
|
|
17
|
+
constructor(field: MultipleFilesField, options?: Partial<MultipleFilesOptions>);
|
|
18
|
+
getClassModifiers(): string[];
|
|
19
|
+
mount(router: Router): void;
|
|
20
|
+
deleteFileAssociation(ctx: Context, file_item_id: string): Promise<void>;
|
|
21
|
+
addFileAssociation(ctx: Context, file: FilePointer): Promise<void>;
|
|
22
|
+
getFrameRelativeURL(): string;
|
|
23
|
+
getFrameID(): string;
|
|
24
|
+
renderFrame(_ctx: Context, content?: FlatTemplatable): string | Promise<string>;
|
|
25
|
+
render(fctx: FormControlContext): FlatTemplatable | Promise<FlatTemplatable>;
|
|
26
|
+
getReferencingCollection(): Collection | undefined;
|
|
27
|
+
getFileField(): SealiousField<any> | null;
|
|
28
|
+
extractFileFromItem(item: CollectionItem<Collection>): Promise<FilePointer | null>;
|
|
29
|
+
renderFileItemPreview(_fileItem: CollectionItem, file: FilePointer): Promise<FlatTemplatable>;
|
|
30
|
+
renderFileItem(fileItem: CollectionItem, file: FilePointer): Promise<FlatTemplatable>;
|
|
31
|
+
renderFileRemoveButton(fileItem: CollectionItem): FlatTemplatable;
|
|
32
|
+
getFileItems(ctx: Context): Promise<CollectionItem<any>[]>;
|
|
33
|
+
getInputAttributes(): {
|
|
34
|
+
type: string;
|
|
35
|
+
name: string;
|
|
36
|
+
multiple: boolean;
|
|
37
|
+
};
|
|
38
|
+
renderFrameContent(ctx: Context): Promise<FlatTemplatable>;
|
|
39
|
+
setLabel(label: string): void;
|
|
40
|
+
setUploadLabel(label: string): void;
|
|
41
|
+
setAdditionalFieldsGetter(fn: (ctx: Context, file: FilePointer) => Promise<Record<string, unknown>>): void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CollectionItem } from "sealious";
|
|
2
|
+
import { FilePointer } from "@sealcode/file-manager";
|
|
3
|
+
import { FlatTemplatable } from "tempstream";
|
|
4
|
+
import { MultipleFiles, MultipleFilesOptions } from "./multiple-files.js";
|
|
5
|
+
import { MultipleFiles as MultipleFilesField } from "../fields/multiple-files.js";
|
|
6
|
+
import { KoaResponsiveImageRouter } from "koa-responsive-image-router";
|
|
7
|
+
export declare class MultipleImages extends MultipleFiles {
|
|
8
|
+
field: MultipleFilesField;
|
|
9
|
+
imageRouter: KoaResponsiveImageRouter;
|
|
10
|
+
constructor(field: MultipleFilesField, imageRouter: KoaResponsiveImageRouter, options?: Partial<MultipleFilesOptions>);
|
|
11
|
+
getClassModifiers(): string[];
|
|
12
|
+
getInputAttributes(): {
|
|
13
|
+
accept: string;
|
|
14
|
+
type: string;
|
|
15
|
+
name: string;
|
|
16
|
+
multiple: boolean;
|
|
17
|
+
};
|
|
18
|
+
renderFileItem(fileItem: CollectionItem, file: FilePointer): Promise<FlatTemplatable>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { NumberField } from "../fields/number.js";
|
|
2
|
+
import { FormControlContext } from "./form-control.js";
|
|
3
|
+
import { SimpleInput, SimpleInputOptions } from "./simple-input.js";
|
|
4
|
+
export type NumberOptions = SimpleInputOptions & Partial<{
|
|
5
|
+
step: number;
|
|
6
|
+
}>;
|
|
7
|
+
export declare class Number extends SimpleInput {
|
|
8
|
+
field: NumberField;
|
|
9
|
+
options: NumberOptions;
|
|
10
|
+
constructor(field: NumberField, options: NumberOptions);
|
|
11
|
+
getType(): string;
|
|
12
|
+
getInputAttributes(fctx: FormControlContext): Promise<Record<string, string | boolean>>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { FormField } from "../fields/field.js";
|
|
3
|
+
import { FormDataValue } from "../form-types.js";
|
|
4
|
+
import { Tickable } from "./tickable.js";
|
|
5
|
+
export declare class Radio extends Tickable<string> {
|
|
6
|
+
field: FormField<boolean, string>;
|
|
7
|
+
value: string;
|
|
8
|
+
type: "radio";
|
|
9
|
+
constructor(field: FormField<boolean, string>, value: string, options: {
|
|
10
|
+
label?: string;
|
|
11
|
+
});
|
|
12
|
+
makeInputID(): string;
|
|
13
|
+
getValueAttribute(): string;
|
|
14
|
+
getWrapperClasses(ctx: Context, data: Record<string, FormDataValue>, value: string): string[];
|
|
15
|
+
isChecked(_ctx: Context, _data: Record<string, FormDataValue>, value: string): boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { FlatTemplatable } from "tempstream";
|
|
3
|
+
import { FormField } from "../fields/field.js";
|
|
4
|
+
import { FormDataValue } from "../form-types.js";
|
|
5
|
+
import { FormControlContext } from "./form-control.js";
|
|
6
|
+
import { FormFieldControl } from "./form-field-control.js";
|
|
7
|
+
export type SimpleInputOptions = {
|
|
8
|
+
id?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
autocomplete?: boolean;
|
|
11
|
+
hide_errors?: boolean;
|
|
12
|
+
type?: string;
|
|
13
|
+
value?: string;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
readonly?: boolean;
|
|
16
|
+
step?: number;
|
|
17
|
+
suffix?: string;
|
|
18
|
+
pattern?: string;
|
|
19
|
+
inputmode?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare class SimpleInput<Options extends SimpleInputOptions = SimpleInputOptions> extends FormFieldControl {
|
|
22
|
+
field: FormField<boolean, any>;
|
|
23
|
+
options: SimpleInputOptions;
|
|
24
|
+
constructor(field: FormField<boolean, any>, options?: Options);
|
|
25
|
+
preInput(_ctx: FormControlContext, _data: Record<string, FormDataValue>): Promise<FlatTemplatable>;
|
|
26
|
+
getType(): string;
|
|
27
|
+
getLabel(): string;
|
|
28
|
+
getID(): string;
|
|
29
|
+
getPlaceholder(): string;
|
|
30
|
+
getInputAttributes(fctx: FormControlContext): Promise<Record<string, string | boolean>>;
|
|
31
|
+
postInput(_: Context): Promise<FlatTemplatable>;
|
|
32
|
+
renderInput(_ctx: Context, attributes_str: string, _data: Record<string, FormDataValue>): Promise<FlatTemplatable>;
|
|
33
|
+
getWrapperModifiers(): string[];
|
|
34
|
+
render(fctx: FormControlContext): Promise<FlatTemplatable>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FieldTypes as SealiousFieldTypes } from "sealious";
|
|
2
|
+
import { CollectionField } from "../fields/collection-field.js";
|
|
3
|
+
import { DropdownOptions, FreeformDropdown } from "./dropdown.js";
|
|
4
|
+
import { Collection, CollectionItem } from "sealious";
|
|
5
|
+
export declare class SingleReferenceDropdown<TargetCollection extends Collection, F extends SealiousFieldTypes.SingleReference, Required extends boolean> extends FreeformDropdown {
|
|
6
|
+
field: CollectionField<F, Required>;
|
|
7
|
+
options: DropdownOptions & {
|
|
8
|
+
getLabel?: (item: CollectionItem<Collection>) => string;
|
|
9
|
+
};
|
|
10
|
+
constructor(field: CollectionField<F, Required>, options?: DropdownOptions & {
|
|
11
|
+
getLabel?: (item: CollectionItem<Collection>) => string;
|
|
12
|
+
});
|
|
13
|
+
setOptionLabelGetter(getter: (item: CollectionItem<TargetCollection>) => string): this;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,6 +10,7 @@ export type TableControlOptions<F extends Record<string, FormField>> = {
|
|
|
10
10
|
[field_name in keyof F]: FormControl;
|
|
11
11
|
};
|
|
12
12
|
allow_removing?: boolean;
|
|
13
|
+
allow_reordering?: boolean;
|
|
13
14
|
label_add?: string;
|
|
14
15
|
label: string;
|
|
15
16
|
label_remove?: string;
|
|
@@ -36,4 +37,5 @@ export declare class Table<F extends Record<string, FormField>> extends FormCont
|
|
|
36
37
|
setLabel(value: string): this;
|
|
37
38
|
setRemoveLabel(value: string): this;
|
|
38
39
|
setAddLabel(value: string): this;
|
|
40
|
+
setAllowReordering(value: boolean): this;
|
|
39
41
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { FormField } from "../fields/field.js";
|
|
3
|
+
import { FormDataValue } from "../form-types.js";
|
|
4
|
+
import { FormControlContext } from "./form-control.js";
|
|
5
|
+
import { SimpleInput, SimpleInputOptions } from "./simple-input.js";
|
|
6
|
+
export declare class Textarea extends SimpleInput {
|
|
7
|
+
field: FormField<boolean>;
|
|
8
|
+
options: SimpleInputOptions & {
|
|
9
|
+
label?: string;
|
|
10
|
+
rows?: number;
|
|
11
|
+
cols?: number;
|
|
12
|
+
description?: string;
|
|
13
|
+
autogrow?: boolean;
|
|
14
|
+
};
|
|
15
|
+
constructor(field: FormField<boolean>, options?: SimpleInputOptions & {
|
|
16
|
+
label?: string;
|
|
17
|
+
rows?: number;
|
|
18
|
+
cols?: number;
|
|
19
|
+
description?: string;
|
|
20
|
+
autogrow?: boolean;
|
|
21
|
+
});
|
|
22
|
+
renderDescription(): string;
|
|
23
|
+
getInputAttributes(fctx: FormControlContext): Promise<Record<string, string | boolean>>;
|
|
24
|
+
renderInput(ctx: Context, attributes: string, data: Record<string, FormDataValue>): Promise<string>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { FlatTemplatable } from "tempstream";
|
|
3
|
+
import { FormField } from "../fields/field.js";
|
|
4
|
+
import { FormDataValue } from "../form-types.js";
|
|
5
|
+
import { FormControlContext } from "./form-control.js";
|
|
6
|
+
import { FormFieldControl } from "./form-field-control.js";
|
|
7
|
+
export type TickableOptions<T> = {
|
|
8
|
+
id?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
hide_errors?: boolean;
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
default_value: T;
|
|
14
|
+
};
|
|
15
|
+
export declare abstract class Tickable<T> extends FormFieldControl {
|
|
16
|
+
field: FormField<boolean, T>;
|
|
17
|
+
options: TickableOptions<T>;
|
|
18
|
+
constructor(field: FormField<boolean, T>, options: TickableOptions<T>);
|
|
19
|
+
type: "checkbox" | "radio";
|
|
20
|
+
abstract getValueAttribute(ctx: Context, data: Record<string, FormDataValue>, value: T): string;
|
|
21
|
+
abstract isChecked(ctx: Context, data: Record<string, FormDataValue>, value: T): boolean;
|
|
22
|
+
makeInputID(ctx: Context, data: Record<string, FormDataValue>, value: T): string;
|
|
23
|
+
getWrapperClasses(ctx: Context, data: Record<string, FormDataValue>, value: T): string[];
|
|
24
|
+
render(fctx: FormControlContext): Promise<FlatTemplatable>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { Checkbox } from "../controls/checkbox.js";
|
|
3
|
+
import { FormDataValue } from "../form-types.js";
|
|
4
|
+
import { FieldParseResult, FormField } from "./field.js";
|
|
5
|
+
import { FormControlContext } from "../controls/form-control.js";
|
|
6
|
+
export declare class Boolean<Required extends boolean> extends FormField<Required, boolean, Checkbox> {
|
|
7
|
+
error_message: string;
|
|
8
|
+
predicate: (v: unknown, w: unknown) => {
|
|
9
|
+
readonly match: boolean;
|
|
10
|
+
readonly wildcard: boolean;
|
|
11
|
+
};
|
|
12
|
+
constructor(required: Required, error_message?: string);
|
|
13
|
+
isValueValid(_: Context, value: boolean): Promise<{
|
|
14
|
+
valid: boolean;
|
|
15
|
+
message: string;
|
|
16
|
+
}>;
|
|
17
|
+
parse(_: Context, value: FormDataValue): Promise<FieldParseResult<boolean>>;
|
|
18
|
+
getEmptyValue(): boolean;
|
|
19
|
+
getControl(): Checkbox;
|
|
20
|
+
getSealiousCreateValue(fctx: FormControlContext): Promise<boolean>;
|
|
21
|
+
sealiousValueToForm(_: Context, value: boolean | null): Promise<FormDataValue>;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { CheckboxedListInput } from "../controls/checkboxed-list-input.js";
|
|
3
|
+
import { FormDataValue } from "../form-types.js";
|
|
4
|
+
import { FieldParseResult, FormField, FormFieldValidationResponse } from "./field.js";
|
|
5
|
+
export type CheckboxedListItem = {
|
|
6
|
+
value: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
group?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare class CheckboxedListField<Required extends boolean, Values extends string> extends FormField<Required, Record<Values, "on">, CheckboxedListInput<Values>> {
|
|
11
|
+
required: Required;
|
|
12
|
+
generateOptions: (ctx: Context) => Promise<CheckboxedListItem[]>;
|
|
13
|
+
isVisible: (ctx: Context) => Promise<boolean>;
|
|
14
|
+
constructor(required: Required, generateOptions: (ctx: Context) => Promise<CheckboxedListItem[]>, isVisible?: (ctx: Context) => Promise<boolean>);
|
|
15
|
+
predicate: (v: unknown, w: unknown) => {
|
|
16
|
+
readonly match: boolean;
|
|
17
|
+
readonly wildcard: string[];
|
|
18
|
+
};
|
|
19
|
+
isValueValid(_: Context, value: unknown): Promise<FormFieldValidationResponse>;
|
|
20
|
+
parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<Record<string, "on">>>;
|
|
21
|
+
getEmptyValue(): Record<string, "on">;
|
|
22
|
+
getControl(): CheckboxedListInput<Values>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { ExtractFieldDecoded, Field } from "sealious";
|
|
3
|
+
import { SimpleInput } from "../controls/controls.js";
|
|
4
|
+
import { FormDataValue } from "../form-types.js";
|
|
5
|
+
import { FieldParseResult, FormField, FormFieldValidationResponse } from "./field.js";
|
|
6
|
+
import { ExtractedFieldInfo } from "../../utils/extract-fields-from-collection.js";
|
|
7
|
+
export declare class CollectionField<F extends Field<any>, Required extends boolean> extends FormField<Required, ExtractFieldDecoded<F> | null, SimpleInput> {
|
|
8
|
+
sealiousField: F;
|
|
9
|
+
constructor(required: Required, sealiousField: F);
|
|
10
|
+
predicate: (v: unknown, w: unknown) => {
|
|
11
|
+
readonly match: true;
|
|
12
|
+
readonly wildcard: unknown;
|
|
13
|
+
};
|
|
14
|
+
parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<ExtractFieldDecoded<F> | null>>;
|
|
15
|
+
isValueValid(ctx: Context, value: ExtractFieldDecoded<F>): Promise<FormFieldValidationResponse>;
|
|
16
|
+
getEmptyValue(): ExtractFieldDecoded<F>;
|
|
17
|
+
getControl(): SimpleInput;
|
|
18
|
+
generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
|
|
19
|
+
form_field_types: string;
|
|
20
|
+
sealious_field: string;
|
|
21
|
+
}): string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { FormControl, FormControlContext } from "../controls/form-control.js";
|
|
3
|
+
import { SimpleInput } from "../controls/simple-input.js";
|
|
4
|
+
import { FormDataValue } from "../form-types.js";
|
|
5
|
+
import { FieldParseResult } from "./field.js";
|
|
6
|
+
import { SimpleFormField } from "./simple-form-field.js";
|
|
7
|
+
export declare class Coordinates<Required extends boolean, DefaultControl extends FormControl = SimpleInput> extends SimpleFormField<Required, DefaultControl, [number, number]> {
|
|
8
|
+
parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<[number, number]>>;
|
|
9
|
+
getSealiousCreateValue(fctx: FormControlContext): Promise<[number, number] | undefined>;
|
|
10
|
+
postSealiousCreate(): Promise<void>;
|
|
11
|
+
postSealiousEdit(): Promise<void>;
|
|
12
|
+
getControl(): DefaultControl;
|
|
13
|
+
getEmptyValue(): [number, number];
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { FormControlContext } from "../controls/form-control.js";
|
|
3
|
+
import { SimpleInput, SimpleInputOptions } from "../controls/simple-input.js";
|
|
4
|
+
import { FormDataValue } from "../form-types.js";
|
|
5
|
+
import { FieldParseResult } from "./field.js";
|
|
6
|
+
import { SimpleFormField } from "./simple-form-field.js";
|
|
7
|
+
export declare class DateField<Required extends boolean> extends SimpleFormField<Required, SimpleInput, Date> {
|
|
8
|
+
constructor(required: Required);
|
|
9
|
+
getEmptyValue(): Date;
|
|
10
|
+
parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<Date>>;
|
|
11
|
+
getControl(): SimpleInput<SimpleInputOptions>;
|
|
12
|
+
getSealiousCreateValue(fctx: FormControlContext): Promise<string | null>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { SimpleInput } from "../controls/controls.js";
|
|
3
|
+
import { FormControlContext } from "../controls/form-control.js";
|
|
4
|
+
import { FormDataValue } from "../form-types.js";
|
|
5
|
+
import { FieldParseResult } from "./field.js";
|
|
6
|
+
import { SimpleFormField } from "./simple-form-field.js";
|
|
7
|
+
export declare class DateTime<Required extends boolean> extends SimpleFormField<Required, SimpleInput, Date | null> {
|
|
8
|
+
constructor(required: Required);
|
|
9
|
+
getEmptyValue(): Date | null;
|
|
10
|
+
parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<Date | null>>;
|
|
11
|
+
getSealiousCreateValue(fctx: FormControlContext): Promise<number | null>;
|
|
12
|
+
getControl(): SimpleInput;
|
|
13
|
+
sealiousValueToForm(ctx: Context, value: number | null): Promise<FormDataValue>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { CollectionItem, FieldTypes as SealiousFieldTypes } from "sealious";
|
|
3
|
+
import { FormDataValue, FormData } from "../form-types.js";
|
|
4
|
+
import { CheckboxedListField } from "./checkboxed-list.js";
|
|
5
|
+
import { ExtractedFieldInfo } from "../../utils/extract-fields-from-collection.js";
|
|
6
|
+
export declare class DeepReverseSingleReferenceList extends CheckboxedListField<false, string> {
|
|
7
|
+
sealious_field: SealiousFieldTypes.DeepReverseSingleReference;
|
|
8
|
+
item_label_getter: (item: CollectionItem<any>) => string;
|
|
9
|
+
constructor(sealious_field: SealiousFieldTypes.DeepReverseSingleReference);
|
|
10
|
+
setItemLabelGetter(getter: (item: CollectionItem<any>) => string): void;
|
|
11
|
+
getSealiousCreateValue(): never;
|
|
12
|
+
postSealiousCreate(ctx: Context, created_item: CollectionItem<any>, form_data: FormData): Promise<void>;
|
|
13
|
+
postSealiousEdit(ctx: Context, edited_item: CollectionItem<any>, value: FormData): Promise<void>;
|
|
14
|
+
sealiousValueToForm(_ctx: Context, value: string[] | null): Promise<FormDataValue>;
|
|
15
|
+
generateFieldDeclaration(_field_info: ExtractedFieldInfo, vars: {
|
|
16
|
+
form_field_types: string;
|
|
17
|
+
sealious_field: string;
|
|
18
|
+
}): string;
|
|
19
|
+
generateCreateValueGetter(field_info: ExtractedFieldInfo): string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FieldTypes as SealiousFieldTypes, CollectionItem } from "sealious";
|
|
2
|
+
import { Table } from "./table.js";
|
|
3
|
+
import { Table as TableControl } from "../controls/table.js";
|
|
4
|
+
import { Context } from "koa";
|
|
5
|
+
import { FormDataValue, FormData } from "../form-types.js";
|
|
6
|
+
import { FormControlContext } from "../controls/form-control.js";
|
|
7
|
+
import { FormField } from "./field.js";
|
|
8
|
+
export declare class DeepReverseSingleReferenceTable extends Table<Record<string, FormField>> {
|
|
9
|
+
sealious_field: SealiousFieldTypes.DeepReverseSingleReference;
|
|
10
|
+
constructor(sealious_field: SealiousFieldTypes.DeepReverseSingleReference);
|
|
11
|
+
getControl(): TableControl<any>;
|
|
12
|
+
getSealiousCreateValue(_fctx: FormControlContext): Promise<unknown>;
|
|
13
|
+
postSealiousCreate(ctx: Context, created_item: CollectionItem<any>, form_data: FormData): Promise<void>;
|
|
14
|
+
postSealiousEdit(ctx: Context, edited_item: CollectionItem<any>, form_data: FormData): Promise<void>;
|
|
15
|
+
sealiousValueToForm(ctx: Context, _value: string[], item: CollectionItem<any>): Promise<FormDataValue>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RegExpField } from "./regexp.js";
|
|
2
|
+
import { SimpleInput } from "../controls/controls.js";
|
|
3
|
+
export declare class EmailField<Required extends boolean> extends RegExpField<Required> {
|
|
4
|
+
error_message: string;
|
|
5
|
+
default_value: string;
|
|
6
|
+
predicate: import("@sealcode/ts-predicates").Predicate<string>;
|
|
7
|
+
constructor(required: Required, error_message?: string, default_value?: string);
|
|
8
|
+
setErrorMessage(message: string): void;
|
|
9
|
+
getControl(): SimpleInput;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FieldTypes as SealiousFieldTypes } from "sealious";
|
|
2
|
+
import { Context } from "koa";
|
|
3
|
+
import { ExtractedFieldInfo } from "../../utils/extract-fields-from-collection.js";
|
|
4
|
+
import { CheckboxedListField } from "./checkboxed-list.js";
|
|
5
|
+
import { FormControlContext } from "../controls/form-control.js";
|
|
6
|
+
import { FormDataValue } from "../form-types.js";
|
|
7
|
+
export declare class EnumMultipleSealious<Values extends string> extends CheckboxedListField<boolean, Values> {
|
|
8
|
+
sealious_field: SealiousFieldTypes.EnumMultiple<Values>;
|
|
9
|
+
constructor(sealious_field: SealiousFieldTypes.EnumMultiple<Values>);
|
|
10
|
+
generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
|
|
11
|
+
form_field_types: string;
|
|
12
|
+
sealious_field: string;
|
|
13
|
+
}): string;
|
|
14
|
+
getSealiousCreateValue(fctx: FormControlContext): Promise<Values[]>;
|
|
15
|
+
sealiousValueToForm(ctx: Context, sealious_value: Values[] | null): Promise<FormDataValue>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Field } from "sealious";
|
|
2
|
+
import { PickFromListField } from "./pick-from-list.js";
|
|
3
|
+
export declare class ExistingSealiousValue<Required extends boolean> extends PickFromListField<Required> {
|
|
4
|
+
constructor(required: Required, field: Field<unknown>);
|
|
5
|
+
getEmptyValue(): string;
|
|
6
|
+
}
|