@sealcode/sealgen 0.19.26 → 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/src/forms/controls/table.d.ts +41 -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/src/index.d.ts +48 -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-route.js +1 -3
- 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 +2 -2
- package/src/build.ts +1 -2
- package/src/cli.ts +4 -5
- 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 +1 -1
- package/src/templates/jdd-editor.ts +1 -1
- package/src/test_utils/test-on-real-app.ts +5 -5
- package/tsconfig.json +2 -0
|
@@ -14,17 +14,17 @@ export type DropdownOption = {
|
|
|
14
14
|
value: string;
|
|
15
15
|
label: string;
|
|
16
16
|
};
|
|
17
|
-
export declare class FreeformDropdown extends SimpleInput {
|
|
18
|
-
field: FormField<boolean,
|
|
17
|
+
export declare class FreeformDropdown<ParsedValue> extends SimpleInput {
|
|
18
|
+
field: FormField<boolean, ParsedValue | null>;
|
|
19
19
|
_generateOptions: (ctx: Context) => Promise<DropdownOption[]>;
|
|
20
20
|
options: DropdownOptions;
|
|
21
|
-
constructor(field: FormField<boolean,
|
|
21
|
+
constructor(field: FormField<boolean, ParsedValue | null>, _generateOptions: (ctx: Context) => Promise<DropdownOption[]>, options?: DropdownOptions);
|
|
22
22
|
generateOptions(ctx: Context): Promise<DropdownOption[]>;
|
|
23
23
|
getInputAttributes(fctx: FormControlContext): Promise<Record<string, string | boolean>>;
|
|
24
24
|
renderInput(ctx: Context, attributes_str: string, data: Record<string, FormDataValue>): Promise<FlatTemplatable>;
|
|
25
25
|
}
|
|
26
|
-
export declare class Dropdown extends FreeformDropdown {
|
|
27
|
-
field: PickFromListField<
|
|
26
|
+
export declare class Dropdown<Required extends boolean> extends FreeformDropdown<string> {
|
|
27
|
+
field: PickFromListField<Required>;
|
|
28
28
|
options: DropdownOptions;
|
|
29
|
-
constructor(field: PickFromListField<
|
|
29
|
+
constructor(field: PickFromListField<Required>, options?: DropdownOptions);
|
|
30
30
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { Field as SealiousField, FieldTypes as SealiousFieldTypes } from "sealious";
|
|
2
3
|
import { CollectionField } from "../fields/collection-field.js";
|
|
3
4
|
import { DropdownOptions, FreeformDropdown } from "./dropdown.js";
|
|
4
5
|
import { Collection, CollectionItem } from "sealious";
|
|
5
|
-
export
|
|
6
|
-
|
|
6
|
+
export type ExtractFieldDecoded<F extends SealiousField<any, any, any>> = F extends SealiousField<infer T, unknown, unknown> ? T : never;
|
|
7
|
+
export declare class SingleReferenceDropdown<TargetCollection extends Collection, SealiousField extends SealiousFieldTypes.SingleReference, Required extends boolean> extends FreeformDropdown<ExtractFieldDecoded<SealiousField>> {
|
|
8
|
+
field: CollectionField<SealiousField, Required>;
|
|
7
9
|
options: DropdownOptions & {
|
|
8
|
-
getLabel?: (item: CollectionItem<
|
|
10
|
+
getLabel?: (item: CollectionItem<TargetCollection>) => string;
|
|
9
11
|
};
|
|
10
|
-
constructor(field: CollectionField<
|
|
11
|
-
getLabel?: (item: CollectionItem<
|
|
12
|
+
constructor(field: CollectionField<SealiousField, Required>, options?: DropdownOptions & {
|
|
13
|
+
getLabel?: (item: CollectionItem<TargetCollection>) => string;
|
|
12
14
|
});
|
|
15
|
+
getCollection(ctx: Context): TargetCollection;
|
|
13
16
|
setOptionLabelGetter(getter: (item: CollectionItem<TargetCollection>) => string): this;
|
|
14
17
|
}
|
|
@@ -29,13 +29,13 @@ export type FieldParseResult<T> = {
|
|
|
29
29
|
error: string;
|
|
30
30
|
parsed_value: null;
|
|
31
31
|
};
|
|
32
|
-
export declare abstract class FormField<Required extends boolean = boolean, ParsedValue =
|
|
32
|
+
export declare abstract class FormField<Required extends boolean = boolean, ParsedValue = any, DefaultFormControl extends FormControl = FormControl, SealiousValue = any> {
|
|
33
33
|
readonly required: Required;
|
|
34
34
|
name: string;
|
|
35
35
|
label: string;
|
|
36
36
|
constructor(required: Required);
|
|
37
37
|
predicate: Predicate;
|
|
38
|
-
mapToFilter: (parsed: ParsedValue) =>
|
|
38
|
+
mapToFilter: (parsed: ParsedValue) => any;
|
|
39
39
|
disabled: boolean;
|
|
40
40
|
init(): Promise<void>;
|
|
41
41
|
setName(name: string): this;
|
|
@@ -2,7 +2,7 @@ import { Context } from "koa";
|
|
|
2
2
|
import { Dropdown, DropdownOption } from "../controls/dropdown.js";
|
|
3
3
|
import { FormFieldValidationResponse } from "./field.js";
|
|
4
4
|
import { TextBasedSimpleField } from "./simple-form-field.js";
|
|
5
|
-
export declare class PickFromListField<Required extends boolean> extends TextBasedSimpleField<Required, Dropdown
|
|
5
|
+
export declare class PickFromListField<Required extends boolean> extends TextBasedSimpleField<Required, Dropdown<Required>> {
|
|
6
6
|
required: Required;
|
|
7
7
|
generateOptions: (ctx: Context) => Promise<DropdownOption[]>;
|
|
8
8
|
customValidation: (ctx: Context, value: unknown, instance: PickFromListField<Required>) => Promise<FormFieldValidationResponse>;
|
|
@@ -11,5 +11,5 @@ export declare class PickFromListField<Required extends boolean> extends TextBas
|
|
|
11
11
|
isValueValid(ctx: Context, value: string): Promise<FormFieldValidationResponse>;
|
|
12
12
|
valueInList(ctx: Context, value: unknown): Promise<FormFieldValidationResponse>;
|
|
13
13
|
getEmptyValue(): string;
|
|
14
|
-
getControl(): Dropdown
|
|
14
|
+
getControl(): Dropdown<Required>;
|
|
15
15
|
}
|
|
@@ -17,7 +17,7 @@ export declare class TextBasedSimpleField<Required extends boolean, DefaultContr
|
|
|
17
17
|
parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<string>>;
|
|
18
18
|
getSealiousCreateValue(fctx: FormControlContext): Promise<string | null>;
|
|
19
19
|
postSealiousCreate(_ctx: Context, _created_item: CollectionItem<any>, _formData: FormData): Promise<void>;
|
|
20
|
-
postSealiousEdit(
|
|
20
|
+
postSealiousEdit(_ctx: Context, _edited_item: CollectionItem<any>, _formData: FormData): Promise<void>;
|
|
21
21
|
getControl(): DefaultControl;
|
|
22
22
|
getEmptyValue(): string;
|
|
23
23
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import Router from "@koa/router";
|
|
2
2
|
import { Context } from "koa";
|
|
3
3
|
import { FlatTemplatable } from "tempstream";
|
|
4
|
-
import {
|
|
4
|
+
import { MountableWithFields } from "../page/mountable-with-fields.js";
|
|
5
5
|
import type { FormDataValue, FormMessage } from "./form-types.js";
|
|
6
6
|
import { Form } from "./form.js";
|
|
7
|
-
|
|
7
|
+
import { FormField } from "./fields/field.js";
|
|
8
|
+
export declare class Multiform<Forms extends Record<string, Form<Record<string, FormField>, any>> = any> extends MountableWithFields {
|
|
8
9
|
getControls: () => never[];
|
|
9
10
|
name: string;
|
|
10
|
-
forms:
|
|
11
|
+
forms: Forms;
|
|
11
12
|
init(path: string, router: Router): void;
|
|
12
13
|
extractRawValues(ctx: Context): Promise<Record<string, FormDataValue>>;
|
|
13
14
|
canAccess(): Promise<{
|
|
@@ -29,7 +29,7 @@ export type StatefulPageActionArgument<State extends Record<string, unknown>, Ar
|
|
|
29
29
|
};
|
|
30
30
|
export type StatefulPageAction<State extends Record<string, unknown>, Args extends unknown[] = unknown[]> = (obj: StatefulPageActionArgument<State, Args>) => State | Promise<State>;
|
|
31
31
|
export type ExtractStatefulPageActionArgs<X> = X extends StatefulPageAction<any, infer Args> ? Args : never;
|
|
32
|
-
export declare abstract class StatefulPage<State extends Record<string, unknown>, Actions extends Record<string, StatefulPageAction<State>>> extends Mountable {
|
|
32
|
+
export declare abstract class StatefulPage<State extends Record<string, unknown>, Actions extends Record<string, StatefulPageAction<State, any>>> extends Mountable {
|
|
33
33
|
form_id?: string | undefined;
|
|
34
34
|
abstract actions: Actions;
|
|
35
35
|
abstract getInitialState(ctx: Context): State | Promise<State>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addCollection(params?: Record<string, string | boolean>): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addJDDComponent(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare abstract class Builder {
|
|
2
|
+
project_dir: string;
|
|
3
|
+
style_dirs: string[];
|
|
4
|
+
abstract ownsFile(file_path: string): boolean;
|
|
5
|
+
abstract getName(): string;
|
|
6
|
+
abstract _build(): Promise<void>;
|
|
7
|
+
abstract dispose(): Promise<void>;
|
|
8
|
+
constructor(project_dir: string, style_dirs: string[]);
|
|
9
|
+
ongoing_build: Promise<void> | null;
|
|
10
|
+
build(notifier?: (message: string) => void): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Builder } from "./builder.js";
|
|
2
|
+
export declare class CSSClump {
|
|
3
|
+
project_dir: string;
|
|
4
|
+
name: string;
|
|
5
|
+
files: string[];
|
|
6
|
+
constructor(project_dir: string, name: string);
|
|
7
|
+
addFile(full_path: string): void;
|
|
8
|
+
build(): Promise<void>;
|
|
9
|
+
getEntrypointPath(): string;
|
|
10
|
+
makeEntrypoint(): Promise<void>;
|
|
11
|
+
static assignFileToClumps(file_path: string): string[];
|
|
12
|
+
static findCSSClumps(project_dir: string, style_dirs: string[]): Promise<CSSClump[]>;
|
|
13
|
+
}
|
|
14
|
+
export declare class CSSBuilder extends Builder {
|
|
15
|
+
getName(): string;
|
|
16
|
+
ownsFile(file_path: string): boolean;
|
|
17
|
+
dispose(): Promise<void>;
|
|
18
|
+
_build(): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Builder } from "./builder.js";
|
|
2
|
+
export declare class FrontendTSBuilder extends Builder {
|
|
3
|
+
project_dir: string;
|
|
4
|
+
style_dirs: string[];
|
|
5
|
+
controller_dirs: string[];
|
|
6
|
+
constructor(project_dir: string, style_dirs: string[], controller_dirs: string[]);
|
|
7
|
+
getName(): string;
|
|
8
|
+
ownsFile(file_path: string): boolean;
|
|
9
|
+
dispose(): Promise<void>;
|
|
10
|
+
_build(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FlatTemplatable } from "tempstream";
|
|
2
|
+
export declare function toggleModal(options: {
|
|
3
|
+
name: string;
|
|
4
|
+
contentWrapped: (id: string) => FlatTemplatable | Promise<FlatTemplatable>;
|
|
5
|
+
contentUnwrapped: (id: string) => FlatTemplatable | Promise<FlatTemplatable>;
|
|
6
|
+
}): string | Promise<string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Controller } from "stimulus";
|
|
2
|
+
export default class TableController extends Controller {
|
|
3
|
+
static targets: string[];
|
|
4
|
+
tableTarget: HTMLTableElement;
|
|
5
|
+
templateTarget: HTMLTemplateElement;
|
|
6
|
+
getTbody(): HTMLTableSectionElement;
|
|
7
|
+
getRowIndex(tr: HTMLTableRowElement): number;
|
|
8
|
+
addRow(): void;
|
|
9
|
+
swapRows(index_a: number, index_b: number): void;
|
|
10
|
+
moveUp(e: MouseEvent): void;
|
|
11
|
+
moveDown(e: MouseEvent): void;
|
|
12
|
+
reindex(): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const embeddable_file_extensions: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 {
|
|
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
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
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 BigRadioGroup extends FormFieldControl {
|
|
6
|
+
field: FormField;
|
|
7
|
+
options: Record<string, {
|
|
8
|
+
description: FlatTemplatable | ((fctx: FormControlContext) => FlatTemplatable);
|
|
9
|
+
}>;
|
|
10
|
+
constructor(field: FormField, options: Record<string, {
|
|
11
|
+
description: FlatTemplatable | ((fctx: FormControlContext) => FlatTemplatable);
|
|
12
|
+
}>);
|
|
13
|
+
render(fctx: FormControlContext): Promise<FlatTemplatable>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { FormDataValue } from "../form-types.js";
|
|
3
|
+
import { Tickable, TickableOptions } from "./tickable.js";
|
|
4
|
+
import { FormField } from "../fields/field.js";
|
|
5
|
+
export declare class Checkbox extends Tickable<boolean> {
|
|
6
|
+
field: FormField<boolean, boolean>;
|
|
7
|
+
type: "checkbox";
|
|
8
|
+
constructor(field: FormField<boolean, boolean>, options?: Partial<TickableOptions<boolean>>);
|
|
9
|
+
isChecked(_ctx: Context, _data: Record<string, FormDataValue>, value: boolean): boolean;
|
|
10
|
+
getValueAttribute(): string;
|
|
11
|
+
}
|
|
12
|
+
export declare class CheckboxWithValue extends Checkbox {
|
|
13
|
+
field: FormField<boolean, boolean>;
|
|
14
|
+
value: string;
|
|
15
|
+
constructor(field: FormField<boolean, boolean>, options: TickableOptions<boolean>, value: string);
|
|
16
|
+
getValueAttribute(): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FlatTemplatable } from "tempstream";
|
|
2
|
+
import { CheckboxWithValue } from "./checkbox.js";
|
|
3
|
+
import { CheckboxGroup, DefaultCheckboxOptions } from "./checkbox-group.js";
|
|
4
|
+
import { FormControlContext } from "./form-control.js";
|
|
5
|
+
export declare class CollapsibleCheckboxGroup extends CheckboxGroup<DefaultCheckboxOptions & {
|
|
6
|
+
textWhenOpen?: string;
|
|
7
|
+
textWhenClosed?: string;
|
|
8
|
+
groupID?: string;
|
|
9
|
+
}> {
|
|
10
|
+
wrapGroup(fctx: FormControlContext, checkboxes: CheckboxWithValue[]): Promise<FlatTemplatable>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FlatTemplatable } from "tempstream";
|
|
2
|
+
import { FieldGroup } from "./field-group.js";
|
|
3
|
+
import { FormControl } from "./form-control.js";
|
|
4
|
+
type CollapsibleFieldGroupOptions = {
|
|
5
|
+
label?: string;
|
|
6
|
+
classes?: string[];
|
|
7
|
+
openOnStart?: boolean;
|
|
8
|
+
textWhenOpen?: string;
|
|
9
|
+
textWhenClosed?: string;
|
|
10
|
+
groupID?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare class CollapsibleFieldGroup extends FieldGroup {
|
|
13
|
+
controls: FormControl[];
|
|
14
|
+
options: CollapsibleFieldGroupOptions;
|
|
15
|
+
collapseID: string;
|
|
16
|
+
constructor(controls: FormControl[], options?: CollapsibleFieldGroupOptions);
|
|
17
|
+
getGroupLabelProps(): string | Promise<string>;
|
|
18
|
+
preLabelContainer(): FlatTemplatable;
|
|
19
|
+
postLabel(): FlatTemplatable;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export * from "./autocomplete.js";
|
|
2
|
+
export * from "./big-radio-group.js";
|
|
3
|
+
export * from "./checkbox-group.js";
|
|
4
|
+
export * from "./checkbox.js";
|
|
5
|
+
export { CheckboxedListInput } from "./checkboxed-list-input.js";
|
|
6
|
+
export * from "./collapsible-checkbox-group.js";
|
|
7
|
+
export * from "./collapsible-field-group.js";
|
|
8
|
+
export * from "./derived-frame.js";
|
|
9
|
+
export * from "./derived.js";
|
|
10
|
+
export * from "./dropdown.js";
|
|
11
|
+
export { EditableCollectionSubset } from "./editable-collection-subset.js";
|
|
12
|
+
export { FieldGroup } from "./field-group.js";
|
|
13
|
+
export * from "./file.js";
|
|
14
|
+
export { FormControl } from "./form-control.js";
|
|
15
|
+
export { FormFieldControl } from "./form-field-control.js";
|
|
16
|
+
export { FormHeader } from "./form-header.js";
|
|
17
|
+
export { FormParagraph } from "./form-paragraph.js";
|
|
18
|
+
export { Frame } from "./frame.js";
|
|
19
|
+
export { HiddenInput } from "./hidden-input.js";
|
|
20
|
+
export { HTML } from "./html.js";
|
|
21
|
+
export * from "./image.js";
|
|
22
|
+
export * from "./multiple-files.js";
|
|
23
|
+
export * from "./multiple-images.js";
|
|
24
|
+
export * from "./number.js";
|
|
25
|
+
export * from "./password-with-generator.js";
|
|
26
|
+
export * from "./radio.js";
|
|
27
|
+
export { SimpleInput } from "./simple-input.js";
|
|
28
|
+
export * from "./single-reference.js";
|
|
29
|
+
export { Textarea } from "./textarea.js";
|
|
30
|
+
export * from "./tickable.js";
|
|
31
|
+
export * from "./array.js";
|
|
32
|
+
export * from "./table.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 {
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { FilePointer } from "@sealcode/file-manager";
|
|
3
|
+
import { FlatTemplatable } from "tempstream";
|
|
4
|
+
import { FormDataValue } from "../form-types.js";
|
|
5
|
+
import { FormControlContext } from "./form-control.js";
|
|
6
|
+
import { SimpleInput } from "./simple-input.js";
|
|
7
|
+
export declare class File extends SimpleInput {
|
|
8
|
+
getType(): string;
|
|
9
|
+
renderFilePreview(_ctx: Context, file: FilePointer | null): Promise<FlatTemplatable>;
|
|
10
|
+
preInput(fctx: FormControlContext, data: Record<string, FormDataValue>): Promise<string>;
|
|
11
|
+
getInputAttributes(fctx: FormControlContext): Promise<Record<string, string | boolean>>;
|
|
12
|
+
}
|