@sealcode/sealgen 0.18.7 → 0.18.8
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/array.d.ts +0 -1
- package/@types/forms/controls/derived-frame.d.ts +0 -1
- package/@types/forms/controls/form-control.d.ts +0 -1
- package/@types/forms/controls/multiple-files.d.ts +0 -1
- package/@types/forms/controls/table.d.ts +0 -1
- package/@types/forms/form.d.ts +0 -1
- package/@types/forms/multiform.d.ts +0 -1
- package/@types/mount.d.ts +0 -1
- package/@types/page/mountable.d.ts +0 -1
- package/@types/page/page.d.ts +0 -1
- package/@types/page/stateful-page.d.ts +0 -1
- package/package.json +1 -1
- package/.xunit +0 -70
- package/@types/remove-named-imports.d.ts +0 -5
- package/@types/src/CSSBuilder.d.ts +0 -19
- package/@types/src/add-collection.d.ts +0 -1
- package/@types/src/add-crud.d.ts +0 -3
- package/@types/src/add-jdd-component.d.ts +0 -1
- package/@types/src/add-list-route.test.d.ts +0 -1
- package/@types/src/add-route.d.ts +0 -3
- package/@types/src/add-route.test.d.ts +0 -1
- package/@types/src/add-verbose-crud.d.ts +0 -3
- package/@types/src/build.d.ts +0 -3
- package/@types/src/builder.d.ts +0 -35
- package/@types/src/builders/backend-ts-builder.d.ts +0 -7
- package/@types/src/builders/builder.d.ts +0 -11
- package/@types/src/builders/colors-builder.d.ts +0 -10
- package/@types/src/builders/css-builder.d.ts +0 -19
- package/@types/src/builders/fonts-builder.d.ts +0 -7
- package/@types/src/builders/frontend-ts-builder.d.ts +0 -11
- package/@types/src/cli.d.ts +0 -2
- package/@types/src/components/components.d.ts +0 -2
- package/@types/src/components/tabs.d.ts +0 -2
- package/@types/src/components/toggle-modal.d.ts +0 -6
- package/@types/src/crud-field-snippets.d.ts +0 -3
- package/@types/src/embeddable-file-extensions.d.ts +0 -1
- package/@types/src/esbuild-plugins/load-assets.d.ts +0 -5
- package/@types/src/esbuild-plugins/rewrite-asset-imports.d.ts +0 -5
- package/@types/src/example.test.d.ts +0 -1
- package/@types/src/find-css-includes.d.ts +0 -1
- package/@types/src/forms/controls/array.d.ts +0 -35
- package/@types/src/forms/controls/autocomplete.d.ts +0 -22
- package/@types/src/forms/controls/big-radio-group.d.ts +0 -14
- package/@types/src/forms/controls/checkbox-group.d.ts +0 -21
- package/@types/src/forms/controls/checkbox.d.ts +0 -17
- package/@types/src/forms/controls/checkboxed-list-input.d.ts +0 -21
- package/@types/src/forms/controls/checkboxed-list-input.test.d.ts +0 -1
- package/@types/src/forms/controls/collapsible-checkbox-group.d.ts +0 -11
- package/@types/src/forms/controls/collapsible-field-group.d.ts +0 -21
- package/@types/src/forms/controls/controls.d.ts +0 -31
- package/@types/src/forms/controls/derived-frame.d.ts +0 -21
- package/@types/src/forms/controls/derived.d.ts +0 -13
- package/@types/src/forms/controls/dropdown.d.ts +0 -30
- package/@types/src/forms/controls/editable-collection-subset.d.ts +0 -20
- package/@types/src/forms/controls/field-group.d.ts +0 -23
- package/@types/src/forms/controls/file.d.ts +0 -13
- package/@types/src/forms/controls/file.test.d.ts +0 -1
- package/@types/src/forms/controls/form-control.d.ts +0 -20
- package/@types/src/forms/controls/form-field-control.d.ts +0 -13
- package/@types/src/forms/controls/form-header.d.ts +0 -8
- package/@types/src/forms/controls/form-paragraph.d.ts +0 -7
- package/@types/src/forms/controls/frame.d.ts +0 -17
- package/@types/src/forms/controls/hidden-input.d.ts +0 -9
- package/@types/src/forms/controls/html.d.ts +0 -11
- package/@types/src/forms/controls/multiple-files.d.ts +0 -40
- package/@types/src/forms/controls/multiple-photos.d.ts +0 -19
- package/@types/src/forms/controls/number.d.ts +0 -13
- package/@types/src/forms/controls/photo.d.ts +0 -21
- package/@types/src/forms/controls/photo.test.d.ts +0 -1
- package/@types/src/forms/controls/radio.d.ts +0 -16
- package/@types/src/forms/controls/reverse-single-reference.d.ts +0 -1
- package/@types/src/forms/controls/simple-input.d.ts +0 -33
- package/@types/src/forms/controls/single-reference.d.ts +0 -13
- package/@types/src/forms/controls/single-reference.test.d.ts +0 -1
- package/@types/src/forms/controls/table.d.ts +0 -34
- package/@types/src/forms/controls/textarea.d.ts +0 -25
- package/@types/src/forms/controls/tickable.d.ts +0 -25
- package/@types/src/forms/fields/boolean.d.ts +0 -17
- package/@types/src/forms/fields/boolean.test.d.ts +0 -1
- package/@types/src/forms/fields/checkboxed-list.d.ts +0 -21
- package/@types/src/forms/fields/collection-field.d.ts +0 -15
- package/@types/src/forms/fields/email.d.ts +0 -7
- package/@types/src/forms/fields/email.test.d.ts +0 -1
- package/@types/src/forms/fields/enum-multiple.d.ts +0 -18
- package/@types/src/forms/fields/enum-multiple.test.d.ts +0 -1
- package/@types/src/forms/fields/enum.d.ts +0 -18
- package/@types/src/forms/fields/enum.test.d.ts +0 -1
- package/@types/src/forms/fields/existing-sealious-value.d.ts +0 -6
- package/@types/src/forms/fields/field.d.ts +0 -48
- package/@types/src/forms/fields/field.test.d.ts +0 -1
- package/@types/src/forms/fields/fields.d.ts +0 -16
- package/@types/src/forms/fields/file.d.ts +0 -19
- package/@types/src/forms/fields/file.test.d.ts +0 -1
- package/@types/src/forms/fields/multiple-files.d.ts +0 -14
- package/@types/src/forms/fields/number.d.ts +0 -23
- package/@types/src/forms/fields/number.test.d.ts +0 -1
- package/@types/src/forms/fields/pick-from-list.d.ts +0 -14
- package/@types/src/forms/fields/pick-from-list.test.d.ts +0 -1
- package/@types/src/forms/fields/proxy-field.d.ts +0 -13
- package/@types/src/forms/fields/regexp.d.ts +0 -16
- package/@types/src/forms/fields/regexp.test.d.ts +0 -1
- package/@types/src/forms/fields/reverse-single-reference.d.ts +0 -13
- package/@types/src/forms/fields/simple-form-field.d.ts +0 -9
- package/@types/src/forms/fields/structured-array.d.ts +0 -14
- package/@types/src/forms/fields/table.d.ts +0 -13
- package/@types/src/forms/form-types.d.ts +0 -26
- package/@types/src/forms/form.d.ts +0 -31
- package/@types/src/forms/form.test.d.ts +0 -6
- package/@types/src/forms/multiform.d.ts +0 -24
- package/@types/src/forms/multiform.test.d.ts +0 -1
- package/@types/src/generate-collections.d.ts +0 -2
- package/@types/src/generate-components.d.ts +0 -1
- package/@types/src/generate-routes.d.ts +0 -5
- package/@types/src/generate-routes.test.d.ts +0 -1
- package/@types/src/generate-stimulus.d.ts +0 -1
- package/@types/src/get-fonts.d.ts +0 -2
- package/@types/src/index.d.ts +0 -46
- package/@types/src/make-env.d.ts +0 -1
- package/@types/src/make-hidden-inputs.d.ts +0 -5
- package/@types/src/mount.d.ts +0 -7
- package/@types/src/notifier.d.ts +0 -2
- package/@types/src/page/access-control.d.ts +0 -6
- package/@types/src/page/default-list-filters.d.ts +0 -18
- package/@types/src/page/list.d.ts +0 -48
- package/@types/src/page/mountable-with-fields.d.ts +0 -42
- package/@types/src/page/mountable-with-fields.test.d.ts +0 -1
- package/@types/src/page/mountable.d.ts +0 -11
- package/@types/src/page/page.d.ts +0 -19
- package/@types/src/page/props-parser.d.ts +0 -16
- package/@types/src/page/sealious-list.d.ts +0 -20
- package/@types/src/page/sealious-list.test.d.ts +0 -1
- package/@types/src/page/stateful-page.d.ts +0 -63
- package/@types/src/page/stateful-page.test.d.ts +0 -1
- package/@types/src/register-external.d.ts +0 -2
- package/@types/src/register-external.test.d.ts +0 -1
- package/@types/src/run.d.ts +0 -1
- package/@types/src/sanitize.d.ts +0 -1
- package/@types/src/target-locreq.d.ts +0 -4
- package/@types/src/templates/collection.d.ts +0 -1
- package/@types/src/templates/form.d.ts +0 -16
- package/@types/src/templates/jdd-component.d.ts +0 -1
- package/@types/src/templates/jdd-editor.d.ts +0 -1
- package/@types/src/templates/list.d.ts +0 -1
- package/@types/src/templates/long-running-process.d.ts +0 -1
- package/@types/src/templates/multiform.d.ts +0 -1
- package/@types/src/templates/page.d.ts +0 -1
- package/@types/src/templates/post.d.ts +0 -1
- package/@types/src/templates/redirect.d.ts +0 -1
- package/@types/src/templates/route-test.d.ts +0 -1
- package/@types/src/templates/shared/collection-create-form.d.ts +0 -1
- package/@types/src/templates/shared/collection-edit-form.d.ts +0 -1
- package/@types/src/templates/shared/collection-list.d.ts +0 -16
- package/@types/src/templates/shared/confirm-item-delete.d.ts +0 -1
- package/@types/src/templates/shared/handlers/boolean.d.ts +0 -2
- package/@types/src/templates/shared/handlers/date.d.ts +0 -2
- package/@types/src/templates/shared/handlers/deep-reverse-single-reference.d.ts +0 -2
- package/@types/src/templates/shared/handlers/default.d.ts +0 -2
- package/@types/src/templates/shared/handlers/enum.d.ts +0 -2
- package/@types/src/templates/shared/handlers/file.d.ts +0 -2
- package/@types/src/templates/shared/handlers/image.d.ts +0 -2
- package/@types/src/templates/shared/handlers/int.d.ts +0 -2
- package/@types/src/templates/shared/handlers/jdd.d.ts +0 -2
- package/@types/src/templates/shared/handlers/settable-by.d.ts +0 -2
- package/@types/src/templates/shared/handlers/single-reference.d.ts +0 -2
- package/@types/src/templates/shared/handlers/structured-array.d.ts +0 -2
- package/@types/src/templates/shared/item-delete.d.ts +0 -1
- package/@types/src/templates/shared/shared-crud-form-fields.d.ts +0 -68
- package/@types/src/templates/stateful-page.d.ts +0 -1
- package/@types/src/templates/stimulus-controller.d.ts +0 -1
- package/@types/src/templates/templates.d.ts +0 -21
- package/@types/src/test_utils/exec_async.d.ts +0 -1
- package/@types/src/test_utils/locator_is_visible.d.ts +0 -2
- package/@types/src/test_utils/test-on-real-app.d.ts +0 -27
- package/@types/src/utils/assert-throws.d.ts +0 -1
- package/@types/src/utils/base64.d.ts +0 -2
- package/@types/src/utils/browser-creator.d.ts +0 -1
- package/@types/src/utils/escape-url-params.d.ts +0 -2
- package/@types/src/utils/exec.d.ts +0 -5
- package/@types/src/utils/extract-fields-from-collection.d.ts +0 -14
- package/@types/src/utils/format-external-url.d.ts +0 -1
- package/@types/src/utils/import-path.d.ts +0 -2
- package/@types/src/utils/input-wrapper.d.ts +0 -3
- package/@types/src/utils/list-collections.d.ts +0 -1
- package/@types/src/utils/make-slug.d.ts +0 -1
- package/@types/src/utils/module-dirname.d.ts +0 -1
- package/@types/src/utils/natural-numbers.d.ts +0 -1
- package/@types/src/utils/prettier.d.ts +0 -3
- package/@types/src/utils/question.d.ts +0 -1
- package/@types/src/utils/render-attributes.d.ts +0 -1
- package/@types/src/utils/sleep.d.ts +0 -1
- package/@types/src/utils/translate.d.ts +0 -3
- package/@types/src/utils/url-with-new-params.d.ts +0 -2
- package/@types/src/utils/utils.d.ts +0 -17
- package/@types/src/utils/walk.d.ts +0 -1
- package/@types/src/utils/with-fallback.d.ts +0 -2
- package/@types/src/utils/write-file.d.ts +0 -1
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="koa__router" resolution-mode="require"/>
|
|
3
|
-
import Router from "@koa/router";
|
|
4
|
-
import { Context } from "koa";
|
|
5
|
-
import { ParsedUrlQuery } from "querystring";
|
|
6
|
-
import { FlatTemplatable } from "tempstream";
|
|
7
|
-
import { FormField } from "../fields/field.js";
|
|
8
|
-
import { Derived } from "./derived.js";
|
|
9
|
-
import { FormControlContext } from "./form-control.js";
|
|
10
|
-
export declare class DerivedFrame extends Derived<{
|
|
11
|
-
frame_id: string;
|
|
12
|
-
form_id: string;
|
|
13
|
-
field_name_prefix: string;
|
|
14
|
-
}> {
|
|
15
|
-
frame_name: string;
|
|
16
|
-
generateFrameContent: (ctx: FormControlContext, args: ParsedUrlQuery) => Promise<FlatTemplatable>;
|
|
17
|
-
frame_id: string;
|
|
18
|
-
constructor(frame_name: string, fields: FormField[], generateFrameContent: (ctx: FormControlContext, args: ParsedUrlQuery) => Promise<FlatTemplatable>, frame_id?: string);
|
|
19
|
-
renderBackendResponseFrame(_ctx: Context, content: FlatTemplatable): string | Promise<string>;
|
|
20
|
-
mount(router: Router): void;
|
|
21
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FlatTemplatable } from "tempstream";
|
|
2
|
-
import { FormField } from "../fields/field.js";
|
|
3
|
-
import { FormDataValue } from "../form-types.js";
|
|
4
|
-
import { FormControl, FormControlContext } from "./form-control.js";
|
|
5
|
-
export declare class Derived<Consts extends Record<string, unknown | undefined>> extends FormControl {
|
|
6
|
-
fields: FormField[];
|
|
7
|
-
_render: (values: Record<string, string>, consts: Consts) => Promise<FlatTemplatable>;
|
|
8
|
-
getConsts: (fctx: FormControlContext) => Promise<Consts>;
|
|
9
|
-
role: "decoration";
|
|
10
|
-
constructor(fields: FormField[], _render: (values: Record<string, string>, consts: Consts) => Promise<FlatTemplatable>, getConsts?: (fctx: FormControlContext) => Promise<Consts>);
|
|
11
|
-
getBackendValues(fctx: FormControlContext): Promise<Record<string, FormDataValue>>;
|
|
12
|
-
render(fctx: FormControlContext): Promise<FlatTemplatable>;
|
|
13
|
-
}
|
|
@@ -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,20 +0,0 @@
|
|
|
1
|
-
import { FlatTemplatable } from "tempstream";
|
|
2
|
-
import { PickFromListField } from "../fields/pick-from-list.js";
|
|
3
|
-
import { FormControlContext } from "./form-control.js";
|
|
4
|
-
import { FormFieldControl } from "./form-field-control.js";
|
|
5
|
-
/**
|
|
6
|
-
* This control has own forms in it so if you want to use it you
|
|
7
|
-
* probably shouldn't use `await super.render(ctx, data, path)` in
|
|
8
|
-
* render method of you from implementation and you should write
|
|
9
|
-
* your own implementation of this method. See forms that uses
|
|
10
|
-
* this control for reference.
|
|
11
|
-
*/
|
|
12
|
-
export declare class EditableCollectionSubset extends FormFieldControl {
|
|
13
|
-
field: PickFromListField<false>;
|
|
14
|
-
actionname: string;
|
|
15
|
-
listLabel?: string | undefined;
|
|
16
|
-
selectLabel?: string | undefined;
|
|
17
|
-
constructor(field: PickFromListField<false>, actionname: string, listLabel?: string | undefined, selectLabel?: string | undefined);
|
|
18
|
-
render(fctx: FormControlContext): Promise<FlatTemplatable>;
|
|
19
|
-
role: "input";
|
|
20
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { FlatTemplatable } from "tempstream";
|
|
2
|
-
import { FormControl, FormControlContext } from "./form-control.js";
|
|
3
|
-
import { FormFieldControl } from "./form-field-control.js";
|
|
4
|
-
export declare class FieldGroup extends FormFieldControl {
|
|
5
|
-
controls: FormControl[];
|
|
6
|
-
options: {
|
|
7
|
-
label?: string;
|
|
8
|
-
classes?: string[];
|
|
9
|
-
containerID?: string;
|
|
10
|
-
};
|
|
11
|
-
constructor(controls: FormControl[], options?: {
|
|
12
|
-
label?: string;
|
|
13
|
-
classes?: string[];
|
|
14
|
-
containerID?: string;
|
|
15
|
-
});
|
|
16
|
-
preLabel(): FlatTemplatable;
|
|
17
|
-
preLabelContainer(): FlatTemplatable;
|
|
18
|
-
postLabel(): FlatTemplatable;
|
|
19
|
-
preFields(): FlatTemplatable;
|
|
20
|
-
postFields(): FlatTemplatable;
|
|
21
|
-
getGroupLabelProps(): FlatTemplatable;
|
|
22
|
-
render(fctx: FormControlContext): Promise<FlatTemplatable>;
|
|
23
|
-
}
|
|
@@ -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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference types="koa__router" resolution-mode="require"/>
|
|
2
|
-
import Router from "@koa/router";
|
|
3
|
-
import { Context } from "koa";
|
|
4
|
-
import { FlatTemplatable } from "tempstream";
|
|
5
|
-
import { FormDataValue, FormMessage } from "../form-types.js";
|
|
6
|
-
import type { Form } from "../form.js";
|
|
7
|
-
export declare class FormControlContext {
|
|
8
|
-
ctx: Context;
|
|
9
|
-
data: Record<string, FormDataValue>;
|
|
10
|
-
messages: FormMessage[];
|
|
11
|
-
field_name_prefix: string;
|
|
12
|
-
form_id: string;
|
|
13
|
-
validate: boolean;
|
|
14
|
-
constructor(ctx: Context, data: Record<string, FormDataValue>, messages: FormMessage[], field_name_prefix: string, form_id: string, validate: boolean);
|
|
15
|
-
}
|
|
16
|
-
export declare abstract class FormControl {
|
|
17
|
-
abstract render(fctx: FormControlContext): FlatTemplatable | Promise<FlatTemplatable>;
|
|
18
|
-
abstract role: "input" | "decoration" | "messages" | "submit";
|
|
19
|
-
mount(_router: Router, _form: Form<any, any>): void;
|
|
20
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/// <reference types="koa__router" resolution-mode="require"/>
|
|
2
|
-
import Router from "@koa/router";
|
|
3
|
-
import { Collection, CollectionItem, Field as SealiousField } from "sealious";
|
|
4
|
-
import { Context } from "koa";
|
|
5
|
-
import { FlatTemplatable } from "tempstream";
|
|
6
|
-
import { MultipleFiles as MultipleFilesField } from "../fields/multiple-files.js";
|
|
7
|
-
import { FormFieldControl } from "./form-field-control.js";
|
|
8
|
-
import { FormControlContext } from "./form-control.js";
|
|
9
|
-
import { FilePointer } from "@sealcode/file-manager";
|
|
10
|
-
export type MultipleFilesOptions = {
|
|
11
|
-
label?: string;
|
|
12
|
-
uploadLabel?: string;
|
|
13
|
-
getAdditionalFields: (ctx: Context, file: FilePointer) => Promise<Record<string, unknown>>;
|
|
14
|
-
};
|
|
15
|
-
export declare class MultipleFiles extends FormFieldControl {
|
|
16
|
-
field: MultipleFilesField;
|
|
17
|
-
options: MultipleFilesOptions;
|
|
18
|
-
constructor(field: MultipleFilesField, options?: Partial<MultipleFilesOptions>);
|
|
19
|
-
getClassModifiers(): string[];
|
|
20
|
-
mount(router: Router): void;
|
|
21
|
-
deleteFileAssociation(ctx: Context, file_item_id: string): Promise<void>;
|
|
22
|
-
addFileAssociation(ctx: Context, file: FilePointer): Promise<void>;
|
|
23
|
-
getFrameRelativeURL(): string;
|
|
24
|
-
getFrameID(): string;
|
|
25
|
-
renderFrame(_ctx: Context, content?: FlatTemplatable): string | Promise<string>;
|
|
26
|
-
render(fctx: FormControlContext): FlatTemplatable | Promise<FlatTemplatable>;
|
|
27
|
-
getReferencingCollection(): Collection;
|
|
28
|
-
getFileField(): SealiousField<any> | null;
|
|
29
|
-
extractFileFromItem(item: CollectionItem<Collection>): Promise<FilePointer | null>;
|
|
30
|
-
renderFileItemPreview(_fileItem: CollectionItem, file: FilePointer): Promise<FlatTemplatable>;
|
|
31
|
-
renderFileItem(fileItem: CollectionItem, file: FilePointer): Promise<FlatTemplatable>;
|
|
32
|
-
renderFileRemoveButton(fileItem: CollectionItem): FlatTemplatable;
|
|
33
|
-
getFileItems(ctx: Context): Promise<CollectionItem<any>[]>;
|
|
34
|
-
getInputAttributes(): {
|
|
35
|
-
type: string;
|
|
36
|
-
name: string;
|
|
37
|
-
multiple: boolean;
|
|
38
|
-
};
|
|
39
|
-
renderFrameContent(ctx: Context): Promise<FlatTemplatable>;
|
|
40
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
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 MultiplePhotos 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
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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<number | null> {
|
|
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
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
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 { KoaResponsiveImageRouter } from "koa-responsive-image-router";
|
|
9
|
-
import { FilePointer } from "@sealcode/file-manager";
|
|
10
|
-
export declare class Photo extends File {
|
|
11
|
-
field: FormField<boolean, FileContainer>;
|
|
12
|
-
imageRouter: KoaResponsiveImageRouter;
|
|
13
|
-
constructor(field: FormField<boolean, FileContainer>, imageRouter: KoaResponsiveImageRouter, options?: SimpleInputOptions);
|
|
14
|
-
getImgStyle(): Promise<string>;
|
|
15
|
-
renderFilePreview(_ctx: Context, file: FilePointer | null): Promise<FlatTemplatable>;
|
|
16
|
-
getWrapperModifiers(): string[];
|
|
17
|
-
getInputAttributes(fctx: FormControlContext): Promise<{
|
|
18
|
-
accept: string;
|
|
19
|
-
onchange: string;
|
|
20
|
-
}>;
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,33 +0,0 @@
|
|
|
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?: "color" | "date" | "email" | "file" | "month" | "number" | "password" | "search" | "tel" | "text" | "time" | "url" | "week";
|
|
13
|
-
value?: string;
|
|
14
|
-
placeholder?: string;
|
|
15
|
-
readonly?: boolean;
|
|
16
|
-
step?: number;
|
|
17
|
-
suffix?: string;
|
|
18
|
-
};
|
|
19
|
-
export declare class SimpleInput<ParsedValue, Options extends SimpleInputOptions = SimpleInputOptions> extends FormFieldControl {
|
|
20
|
-
field: FormField<boolean, ParsedValue>;
|
|
21
|
-
options: SimpleInputOptions;
|
|
22
|
-
constructor(field: FormField<boolean, ParsedValue>, options?: Options);
|
|
23
|
-
preInput(_ctx: FormControlContext, _data: Record<string, FormDataValue>): Promise<FlatTemplatable>;
|
|
24
|
-
getType(): string;
|
|
25
|
-
getLabel(): string;
|
|
26
|
-
getID(): string;
|
|
27
|
-
getPlaceholder(): string;
|
|
28
|
-
getInputAttributes(fctx: FormControlContext): Promise<Record<string, string | boolean>>;
|
|
29
|
-
postInput(_: Context): Promise<FlatTemplatable>;
|
|
30
|
-
renderInput(_ctx: Context, attributes_str: string, _data: Record<string, FormDataValue>): Promise<FlatTemplatable>;
|
|
31
|
-
getWrapperModifiers(): string[];
|
|
32
|
-
render(fctx: FormControlContext): Promise<FlatTemplatable>;
|
|
33
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import SealiousSingleReference from "sealious/@types/src/app/base-chips/field-types/single-reference.js";
|
|
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<F extends SealiousSingleReference, 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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/// <reference types="koa__router" resolution-mode="require"/>
|
|
2
|
-
import Router from "@koa/router";
|
|
3
|
-
import { Context } from "koa";
|
|
4
|
-
import { FlatTemplatable } from "tempstream";
|
|
5
|
-
import { FormField } from "../fields/field.js";
|
|
6
|
-
import { Table as TableField } from "../fields/table.js";
|
|
7
|
-
import { Form } from "../form.js";
|
|
8
|
-
import { FormControl, FormControlContext } from "./form-control.js";
|
|
9
|
-
export type TableControlOptions<F extends Record<string, FormField>> = {
|
|
10
|
-
render_fields: {
|
|
11
|
-
[field_name in keyof F]: (fctx: FormControlContext, name: string, value: string) => FlatTemplatable | Promise<FlatTemplatable>;
|
|
12
|
-
};
|
|
13
|
-
allow_removing?: boolean;
|
|
14
|
-
label_add?: string;
|
|
15
|
-
label: string;
|
|
16
|
-
label_remove?: string;
|
|
17
|
-
} & ({
|
|
18
|
-
allow_adding: false;
|
|
19
|
-
} | {
|
|
20
|
-
allow_adding: true;
|
|
21
|
-
make_new_row: (ctx: Context) => Promise<{
|
|
22
|
-
[field_name in keyof F]: unknown;
|
|
23
|
-
}>;
|
|
24
|
-
});
|
|
25
|
-
export declare class Table<F extends Record<string, FormField>> extends FormControl {
|
|
26
|
-
table_field: TableField<F>;
|
|
27
|
-
options: TableControlOptions<F>;
|
|
28
|
-
role: "input";
|
|
29
|
-
constructor(table_field: TableField<F>, options: TableControlOptions<F>);
|
|
30
|
-
render(fctx: FormControlContext): Promise<FlatTemplatable>;
|
|
31
|
-
getFrameID(): string;
|
|
32
|
-
getActionURL(field_name: string, action: Record<string, unknown>): string;
|
|
33
|
-
mount(router: Router, form: Form<any, any>): void;
|
|
34
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
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<string | null> {
|
|
7
|
-
field: FormField<boolean, string | null>;
|
|
8
|
-
options: SimpleInputOptions & {
|
|
9
|
-
label?: string;
|
|
10
|
-
rows?: number;
|
|
11
|
-
cols?: number;
|
|
12
|
-
description?: string;
|
|
13
|
-
autogrow?: boolean;
|
|
14
|
-
};
|
|
15
|
-
constructor(field: FormField<boolean, string | null>, 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
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Context } from "koa";
|
|
2
|
-
import { FormDataValue } from "../form-types.js";
|
|
3
|
-
import { FieldParseResult, FormField } from "./field.js";
|
|
4
|
-
export declare class Boolean<Required extends boolean> extends FormField<Required, boolean> {
|
|
5
|
-
error_message: string;
|
|
6
|
-
predicate: (v: unknown, w: unknown) => {
|
|
7
|
-
readonly match: boolean;
|
|
8
|
-
readonly wildcard: boolean;
|
|
9
|
-
};
|
|
10
|
-
constructor(required: Required, error_message?: string);
|
|
11
|
-
isValueValid(_: Context, value: boolean): Promise<{
|
|
12
|
-
valid: boolean;
|
|
13
|
-
message: string;
|
|
14
|
-
}>;
|
|
15
|
-
parse(_: Context, value: FormDataValue): Promise<FieldParseResult<boolean>>;
|
|
16
|
-
getEmptyValue(): boolean;
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Context } from "koa";
|
|
2
|
-
import { FormDataValue } from "../form-types.js";
|
|
3
|
-
import { FieldParseResult, FormField, FormFieldValidationResponse } from "./field.js";
|
|
4
|
-
export type CheckboxedListItem = {
|
|
5
|
-
value: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
group?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare class CheckboxedListField<Required extends boolean> extends FormField<Required, Record<string, "on">> {
|
|
10
|
-
required: Required;
|
|
11
|
-
generateOptions: (ctx: Context) => Promise<CheckboxedListItem[]>;
|
|
12
|
-
isVisible: (ctx: Context) => Promise<boolean>;
|
|
13
|
-
constructor(required: Required, generateOptions: (ctx: Context) => Promise<CheckboxedListItem[]>, isVisible?: (ctx: Context) => Promise<boolean>);
|
|
14
|
-
predicate: (v: unknown, w: unknown) => {
|
|
15
|
-
readonly match: boolean;
|
|
16
|
-
readonly wildcard: string[];
|
|
17
|
-
};
|
|
18
|
-
isValueValid(_: Context, value: unknown): Promise<FormFieldValidationResponse>;
|
|
19
|
-
parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<Record<string, "on">>>;
|
|
20
|
-
getEmptyValue(): Record<string, "on">;
|
|
21
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Context } from "koa";
|
|
2
|
-
import { ExtractFieldDecoded, Field } from "sealious";
|
|
3
|
-
import { FormDataValue } from "../form-types.js";
|
|
4
|
-
import { FieldParseResult, FormField, FormFieldValidationResponse } from "./field.js";
|
|
5
|
-
export declare class CollectionField<F extends Field<any>, Required extends boolean> extends FormField<Required, ExtractFieldDecoded<F> | null> {
|
|
6
|
-
sealiousField: F;
|
|
7
|
-
constructor(required: Required, sealiousField: F);
|
|
8
|
-
predicate: (v: unknown, w: unknown) => {
|
|
9
|
-
readonly match: true;
|
|
10
|
-
readonly wildcard: unknown;
|
|
11
|
-
};
|
|
12
|
-
parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<ExtractFieldDecoded<F> | null>>;
|
|
13
|
-
isValueValid(ctx: Context, value: ExtractFieldDecoded<F>): Promise<FormFieldValidationResponse>;
|
|
14
|
-
getEmptyValue(): ExtractFieldDecoded<F>;
|
|
15
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { RegExpField } from "./regexp.js";
|
|
2
|
-
export declare class EmailField<Required extends boolean> extends RegExpField<Required> {
|
|
3
|
-
error_message: string;
|
|
4
|
-
default_value: string;
|
|
5
|
-
predicate: import("@sealcode/ts-predicates").Predicate<string>;
|
|
6
|
-
constructor(required: Required, error_message?: string, default_value?: string);
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Context } from "koa";
|
|
2
|
-
import { FormDataValue } from "../form-types.js";
|
|
3
|
-
import { FieldParseResult, FormField } from "./field.js";
|
|
4
|
-
export declare class EnumMultipleField<Options extends readonly string[], Required extends boolean> extends FormField<Required, string[]> {
|
|
5
|
-
options: Options;
|
|
6
|
-
error_message: (options: Options) => string;
|
|
7
|
-
constructor(required: Required, options: Options, error_message?: (options: Options) => string);
|
|
8
|
-
predicate: (v: unknown, w: unknown) => {
|
|
9
|
-
readonly match: boolean;
|
|
10
|
-
readonly wildcard: Options[number];
|
|
11
|
-
};
|
|
12
|
-
isValueValid(_: Context, values: string[]): Promise<{
|
|
13
|
-
valid: boolean;
|
|
14
|
-
message: string;
|
|
15
|
-
}>;
|
|
16
|
-
parse(_: Context, value: FormDataValue): Promise<FieldParseResult<string[]>>;
|
|
17
|
-
getEmptyValue(): string[];
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Context } from "koa";
|
|
2
|
-
import { FormDataValue } from "../form-types.js";
|
|
3
|
-
import { FieldParseResult, FormField } from "./field.js";
|
|
4
|
-
export declare class EnumField<Options extends readonly string[], Required extends boolean> extends FormField<Required, string> {
|
|
5
|
-
options: Options;
|
|
6
|
-
error_message: (options: Options) => string;
|
|
7
|
-
constructor(required: Required, options: Options, error_message?: (options: Options) => string);
|
|
8
|
-
predicate: (v: unknown, w: unknown) => {
|
|
9
|
-
readonly match: boolean;
|
|
10
|
-
readonly wildcard: Options[number];
|
|
11
|
-
};
|
|
12
|
-
isValueValid(_: Context, value: unknown): Promise<{
|
|
13
|
-
valid: boolean;
|
|
14
|
-
message: string;
|
|
15
|
-
}>;
|
|
16
|
-
parse(_: Context, value: FormDataValue): Promise<FieldParseResult<string>>;
|
|
17
|
-
getEmptyValue(): string;
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
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
|
-
}
|