@sealcode/sealgen 0.19.16 → 0.19.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/@types/app-config/get-app-port.d.ts +1 -0
  2. package/@types/app-config/load-app-config.d.ts +4 -0
  3. package/@types/app-config/resolve-app-config-path.d.ts +1 -0
  4. package/@types/forms/fields/structured-array.d.ts +2 -2
  5. package/@types/utils/translate.d.ts +2 -1
  6. package/lib/forms/controls/tickable.js +1 -3
  7. package/lib/forms/fields/collection-field.js +2 -1
  8. package/lib/generate-routes.js +23 -1
  9. package/lib/utils/translate.js +4 -4
  10. package/package.json +2 -2
  11. package/src/forms/fields/collection-field.ts +2 -1
  12. package/src/forms/fields/structured-array.ts +2 -11
  13. package/src/generate-routes.ts +38 -9
  14. package/.xunit +0 -75
  15. package/@types/add-verbose-crud.d.ts +0 -3
  16. package/@types/builders/colors-builder.d.sync-conflict-20250918-184323-TFDLWFG.ts +0 -10
  17. package/@types/builders/fonts-builder.d.sync-conflict-20250918-184322-TFDLWFG.ts +0 -7
  18. package/@types/controllers/table-add-button.d.ts +0 -6
  19. package/@types/crud-field-snippets.d.ts +0 -1
  20. package/@types/find-css-includes.d.ts +0 -1
  21. package/@types/forms/controls/array.d.sync-conflict-20250918-184306-TFDLWFG.ts +0 -33
  22. package/@types/forms/controls/array.sync-conflict-20250918-222045-TFDLWFG.d.ts +0 -33
  23. package/@types/forms/controls/autocomplete.d.sync-conflict-20250918-222042-TFDLWFG.ts +0 -22
  24. package/@types/forms/controls/checkbox-group.d.sync-conflict-20250918-184319-TFDLWFG.ts +0 -21
  25. package/@types/forms/controls/checkboxed-list-input.d.sync-conflict-20250918-184323-TFDLWFG.ts +0 -21
  26. package/@types/forms/controls/derived-frame.d.sync-conflict-20250918-184314-TFDLWFG.ts +0 -19
  27. package/@types/forms/controls/dropdown.d.sync-conflict-20250918-222044-TFDLWFG.ts +0 -30
  28. package/@types/forms/controls/file.d.sync-conflict-20250918-222045-TFDLWFG.ts +0 -13
  29. package/@types/forms/controls/form-control.d.sync-conflict-20250918-184322-TFDLWFG.ts +0 -19
  30. package/@types/forms/controls/form-control.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -19
  31. package/@types/forms/controls/multiple-files.d.sync-conflict-20250918-184318-TFDLWFG.ts +0 -42
  32. package/@types/forms/controls/multiple-photos.d.ts +0 -19
  33. package/@types/forms/controls/number.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -13
  34. package/@types/forms/controls/photo.d.sync-conflict-20250918-184321-TFDLWFG.ts +0 -19
  35. package/@types/forms/controls/photo.d.ts +0 -19
  36. package/@types/forms/controls/photo.test.d.ts +0 -1
  37. package/@types/forms/controls/reverse-single-reference.d.ts +0 -1
  38. package/@types/forms/controls/simple-input.d.sync-conflict-20250918-184310-TFDLWFG.ts +0 -33
  39. package/@types/forms/controls/simple-input.d.sync-conflict-20250918-222042-TFDLWFG.ts +0 -33
  40. package/@types/forms/controls/simple-input.sync-conflict-20250918-222045-TFDLWFG.d.ts +0 -33
  41. package/@types/forms/controls/table.d.sync-conflict-20250918-184302-TFDLWFG.ts +0 -39
  42. package/@types/forms/controls/table.sync-conflict-20250918-222042-TFDLWFG.d.ts +0 -39
  43. package/@types/forms/controls/textarea.d.sync-conflict-20250918-222045-TFDLWFG.ts +0 -25
  44. package/@types/forms/fields/boolean.d.sync-conflict-20250918-184325-TFDLWFG.ts +0 -22
  45. package/@types/forms/fields/boolean.sync-conflict-20250918-222042-TFDLWFG.d.ts +0 -22
  46. package/@types/forms/fields/checkboxed-list.d.sync-conflict-20250918-184325-TFDLWFG.ts +0 -23
  47. package/@types/forms/fields/collection-field.d.sync-conflict-20250918-184319-TFDLWFG.ts +0 -22
  48. package/@types/forms/fields/collection-field.d.sync-conflict-20250918-222047-TFDLWFG.ts +0 -22
  49. package/@types/forms/fields/coordinates.d.sync-conflict-20250918-222044-TFDLWFG.ts +0 -14
  50. package/@types/forms/fields/datetime.d.sync-conflict-20250918-222050-TFDLWFG.ts +0 -4
  51. package/@types/forms/fields/email.d.sync-conflict-20250918-184303-TFDLWFG.ts +0 -8
  52. package/@types/forms/fields/enum-multiple-sealious.sync-conflict-20250918-222047-TFDLWFG.d.ts +0 -16
  53. package/@types/forms/fields/enum-multiple.d.ts +0 -18
  54. package/@types/forms/fields/enum-multiple.test.d.ts +0 -1
  55. package/@types/forms/fields/enum.d.ts +0 -18
  56. package/@types/forms/fields/enum.test.d.ts +0 -1
  57. package/@types/forms/fields/field.d.sync-conflict-20250918-184306-TFDLWFG.ts +0 -70
  58. package/@types/forms/fields/fields.d.sync-conflict-20250918-184314-TFDLWFG.ts +0 -29
  59. package/@types/forms/fields/file.d.sync-conflict-20250918-184310-TFDLWFG.ts +0 -23
  60. package/@types/forms/fields/file.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -23
  61. package/@types/forms/fields/file.sync-conflict-20250918-222049-TFDLWFG.d.ts +0 -23
  62. package/@types/forms/fields/get-field-for-sealious.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -29
  63. package/@types/forms/fields/get-field-for-sealious.sync-conflict-20250918-222042-TFDLWFG.d.ts +0 -29
  64. package/@types/forms/fields/image.d.sync-conflict-20250918-222042-TFDLWFG.ts +0 -5
  65. package/@types/forms/fields/multiple-files.d.sync-conflict-20250918-184304-TFDLWFG.ts +0 -16
  66. package/@types/forms/fields/number.d.sync-conflict-20250918-184317-TFDLWFG.ts +0 -25
  67. package/@types/forms/fields/number.d.sync-conflict-20250918-222047-TFDLWFG.ts +0 -25
  68. package/@types/forms/fields/pick-from-list.d.sync-conflict-20250918-184322-TFDLWFG.ts +0 -15
  69. package/@types/forms/fields/proxy-field.d.sync-conflict-20250918-184307-TFDLWFG.ts +0 -15
  70. package/@types/forms/fields/regexp.d.sync-conflict-20250918-184305-TFDLWFG.ts +0 -21
  71. package/@types/forms/fields/regexp.d.sync-conflict-20250918-222045-TFDLWFG.ts +0 -21
  72. package/@types/forms/fields/regexp.sync-conflict-20250918-222047-TFDLWFG.d.ts +0 -21
  73. package/@types/forms/fields/reverse-single-reference.d.ts +0 -13
  74. package/@types/forms/fields/simple-form-field.d.sync-conflict-20250918-184309-TFDLWFG.ts +0 -29
  75. package/@types/forms/fields/simple-form-field.d.sync-conflict-20250918-222044-TFDLWFG.ts +0 -29
  76. package/@types/forms/fields/simple-form-field.sync-conflict-20250918-222049-TFDLWFG.d.ts +0 -29
  77. package/@types/forms/fields/single-reference.sync-conflict-20250918-222043-TFDLWFG.d.ts +0 -10
  78. package/@types/forms/fields/structured-array.d.sync-conflict-20250918-184302-TFDLWFG.ts +0 -27
  79. package/@types/forms/fields/structured-array.d.sync-conflict-20250918-222049-TFDLWFG.ts +0 -27
  80. package/@types/forms/fields/structured-array.sync-conflict-20250918-222047-TFDLWFG.d.ts +0 -27
  81. package/@types/forms/fields/table.d.sync-conflict-20250918-184303-TFDLWFG.ts +0 -16
  82. package/@types/forms/form-types.d.sync-conflict-20250918-222045-TFDLWFG.ts +0 -26
  83. package/@types/forms/form.d.sync-conflict-20250918-184315-TFDLWFG.ts +0 -32
  84. package/@types/forms/form.d.sync-conflict-20250918-222049-TFDLWFG.ts +0 -32
  85. package/@types/forms/form.sync-conflict-20250918-222049-TFDLWFG.d.ts +0 -33
  86. package/@types/forms/form.test.d.sync-conflict-20250918-184318-TFDLWFG.ts +0 -6
  87. package/@types/forms/form.test.d.sync-conflict-20250918-222047-TFDLWFG.ts +0 -6
  88. package/@types/forms/multiform.d.sync-conflict-20250918-184308-TFDLWFG.ts +0 -23
  89. package/@types/forms/multiform.sync-conflict-20250918-222044-TFDLWFG.d.ts +0 -23
  90. package/@types/index.d.sync-conflict-20250918-184316-TFDLWFG.ts +0 -46
  91. package/@types/mount.d.sync-conflict-20250918-184320-TFDLWFG.ts +0 -6
  92. package/@types/page/list.d.sync-conflict-20250918-184318-TFDLWFG.ts +0 -48
  93. package/@types/page/list.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -48
  94. package/@types/page/list.sync-conflict-20250918-222048-TFDLWFG.d.ts +0 -48
  95. package/@types/page/mountable-with-fields.d.sync-conflict-20250918-184321-TFDLWFG.ts +0 -42
  96. package/@types/page/mountable-with-fields.d.sync-conflict-20250918-222046-TFDLWFG.ts +0 -42
  97. package/@types/page/mountable-with-fields.sync-conflict-20250918-222044-TFDLWFG.d.ts +0 -42
  98. package/@types/page/mountable.d.sync-conflict-20250918-184306-TFDLWFG.ts +0 -10
  99. package/@types/page/page.d.sync-conflict-20250918-184320-TFDLWFG.ts +0 -18
  100. package/@types/page/props-parser.d.sync-conflict-20250918-184305-TFDLWFG.ts +0 -15
  101. package/@types/page/stateful-page.d.sync-conflict-20250918-184326-TFDLWFG.ts +0 -62
  102. package/@types/templates/shared/handlers/boolean.d.ts +0 -2
  103. package/@types/templates/shared/handlers/date.d.ts +0 -2
  104. package/@types/templates/shared/handlers/deep-reverse-single-reference.d.ts +0 -2
  105. package/@types/templates/shared/handlers/default.d.ts +0 -2
  106. package/@types/templates/shared/handlers/enum.d.ts +0 -2
  107. package/@types/templates/shared/handlers/file.d.ts +0 -2
  108. package/@types/templates/shared/handlers/image.d.ts +0 -2
  109. package/@types/templates/shared/handlers/int.d.ts +0 -2
  110. package/@types/templates/shared/handlers/jdd.d.ts +0 -2
  111. package/@types/templates/shared/handlers/single-reference.d.ts +0 -2
  112. package/@types/templates/shared/handlers/structured-array.d.ts +0 -2
  113. package/@types/templates/shared/shared-crud-form-fields.d.sync-conflict-20250918-184306-TFDLWFG.ts +0 -1
  114. package/@types/test_utils/test-on-real-app.d.sync-conflict-20250918-184320-TFDLWFG.ts +0 -26
  115. package/@types/utils/extract-fields-from-collection.d.sync-conflict-20250918-184312-TFDLWFG.ts +0 -18
  116. package/@types/utils/extract-fields-from-collection.sync-conflict-20250918-222045-TFDLWFG.d.ts +0 -18
  117. /package/@types/{add-crud.d.sync-conflict-20250918-184311-TFDLWFG.ts → app-config/get-app-port.test.d.ts} +0 -0
  118. /package/@types/{crud-field-snippets.d.sync-conflict-20250918-184323-TFDLWFG.ts → app-config/load-app-config.test.d.ts} +0 -0
@@ -1,70 +0,0 @@
1
- import { Predicate, predicates } from "@sealcode/ts-predicates";
2
- import { Context } from "koa";
3
- import { CollectionItem } from "sealious";
4
- import { FormControl, FormControlContext } from "../controls/form-control.js";
5
- import { FormDataValue, FormData } from "../form-types.js";
6
- import { ExtractedFieldInfo } from "../../utils/extract-fields-from-collection.js";
7
- export type FormFieldValidationResponse = {
8
- valid: boolean;
9
- message: string;
10
- };
11
- export type FormFieldValidationFn<ValueType> = (ctx: Context, value: ValueType, field: FormField<boolean, ValueType>) => Promise<FormFieldValidationResponse>;
12
- export type FieldParsedValue<T> = T extends FormField<infer R> ? R : never;
13
- export type GetPredicate<F extends FormField> = F extends FormField<true> ? F["predicate"] : F["predicate"] | typeof predicates.undefined;
14
- export type FieldsToShape<T extends Record<string, FormField>> = {
15
- [property in keyof T]: GetPredicate<T[property]>;
16
- };
17
- export declare function fieldsToShape<Fields extends Record<string, FormField>>(obj: Fields): FieldsToShape<Fields>;
18
- export type FieldParseResult<T> = {
19
- parsable: true;
20
- error: null;
21
- parsed_value: T;
22
- } | {
23
- parsable: false;
24
- error: string;
25
- parsed_value: null;
26
- };
27
- export declare abstract class FormField<Required extends boolean = boolean, ParsedValue = unknown, DefaultFormControl extends FormControl = FormControl, SealiousValue = any> {
28
- readonly required: Required;
29
- name: string;
30
- constructor(required: Required);
31
- predicate: Predicate;
32
- mapToFilter: (parsed: ParsedValue) => unknown;
33
- init(): Promise<void>;
34
- setName(name: string): void;
35
- _validate(ctx: Context, value: ParsedValue): Promise<FormFieldValidationResponse>;
36
- abstract getEmptyValue(): ParsedValue;
37
- isValueValid(_ctx: Context, _value: ParsedValue): Promise<FormFieldValidationResponse>;
38
- abstract parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<ParsedValue>>;
39
- getParsedValue(ctx: Context, all_form_values: Record<string, FormDataValue>, validate: true): Promise<{
40
- valid: boolean;
41
- message: string;
42
- parsed: ParsedValue | null;
43
- raw: FormDataValue;
44
- }>;
45
- getParsedValue(ctx: Context, all_form_values: Record<string, FormDataValue>, validate?: false): Promise<{
46
- message: string;
47
- parsed: ParsedValue | null;
48
- raw: FormDataValue;
49
- }>;
50
- setMapToFilter(fn: (parsed: ParsedValue) => unknown): this;
51
- getDatabaseValue(ctx: Context, data: Record<string, FormDataValue>): Promise<unknown>;
52
- abstract getControl(): DefaultFormControl;
53
- getSealiousCreateValue(fctx: FormControlContext): Promise<SealiousValue>;
54
- sealiousValueToForm(ctx: Context, sealiousValue: SealiousValue | null, item: CollectionItem<any>): Promise<FormDataValue>;
55
- postSealiousCreate(ctx: Context, created_item: CollectionItem<any>, form_data: FormData): Promise<void>;
56
- postSealiousEdit(ctx: Context, edited_item: CollectionItem<any>, form_data: FormData): Promise<void>;
57
- generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
58
- form_field_types: string;
59
- sealious_field: string;
60
- }): string;
61
- generateCreateValueGetter(field_info: ExtractedFieldInfo, vars: {
62
- form_field_types: string;
63
- sealious_field: string;
64
- form_fields: string;
65
- }): string;
66
- generateInitialValue(field_info: ExtractedFieldInfo, vars: {
67
- form_field_types: string;
68
- form_fields: string;
69
- }): string;
70
- }
@@ -1,29 +0,0 @@
1
- export * from "./boolean.js";
2
- export * from "./checkboxed-list.js";
3
- export * from "./collection-field.js";
4
- export * from "./color.js";
5
- export * from "./coordinates.js";
6
- export * from "./date.js";
7
- export * from "./datetime.js";
8
- export * from "./enum-multiple-sealious.js";
9
- export * from "./deep-reverse-single-reference-table.js";
10
- export * from "./deep-reverse-single-reference-list.js";
11
- export * from "./email.js";
12
- export * from "./existing-sealious-value.js";
13
- export * from "./file.js";
14
- export * from "./float.js";
15
- export * from "./html.js";
16
- export * from "./int.js";
17
- export * from "./json.js";
18
- export * from "./markdown.js";
19
- export * from "./multiple-files.js";
20
- export * from "./number.js";
21
- export * from "./password.js";
22
- export * from "./pick-from-list.js";
23
- export * from "./pick-from-list-sealious.js";
24
- export * from "./regexp.js";
25
- export * from "./simple-form-field.js";
26
- export * from "./single-reference.js";
27
- export * from "./structured-array.js";
28
- export * from "./table.js";
29
- export * from "./text.js";
@@ -1,23 +0,0 @@
1
- import { Context } from "koa";
2
- import { FilePointer } from "@sealcode/file-manager";
3
- import { FormDataValue } from "../form-types.js";
4
- import { FieldParseResult, FormField } from "./field.js";
5
- import { File as FileControl } from "../controls/file.js";
6
- import { FormControl, FormControlContext } from "../controls/form-control.js";
7
- export type FileContainer = {
8
- old: FilePointer | null;
9
- new: FilePointer | null;
10
- };
11
- export declare class File<Required extends boolean, DefaultControl extends FormControl = FileControl> extends FormField<Required, FileContainer, FormControl> {
12
- readonly required: Required;
13
- constructor(required: Required);
14
- parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<FileContainer>>;
15
- getDatabaseValue(ctx: Context, data: Record<string, FormDataValue>): Promise<FilePointer | undefined>;
16
- getEmptyValue(): {
17
- old: null;
18
- new: null;
19
- };
20
- getControl(...args: any[]): FileControl;
21
- getSealiousCreateValue(fctx: FormControlContext): Promise<FilePointer | undefined>;
22
- sealiousValueToForm(ctx: Context, sealiousValue: FilePointer | string | null): Promise<Record<string, string | undefined>>;
23
- }
@@ -1,23 +0,0 @@
1
- import { Context } from "koa";
2
- import { FilePointer } from "@sealcode/file-manager";
3
- import { FormDataValue } from "../form-types.js";
4
- import { FieldParseResult, FormField } from "./field.js";
5
- import { File as FileControl } from "../controls/file.js";
6
- import { FormControl, FormControlContext } from "../controls/form-control.js";
7
- export type FileContainer = {
8
- old: FilePointer | null;
9
- new: FilePointer | null;
10
- };
11
- export declare class File<Required extends boolean, DefaultControl extends FormControl = FileControl> extends FormField<Required, FileContainer, FormControl> {
12
- readonly required: Required;
13
- constructor(required: Required);
14
- parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<FileContainer>>;
15
- getDatabaseValue(ctx: Context, data: Record<string, FormDataValue>): Promise<FilePointer | undefined>;
16
- getEmptyValue(): {
17
- old: null;
18
- new: null;
19
- };
20
- getControl(...args: any[]): FileControl;
21
- getSealiousCreateValue(fctx: FormControlContext): Promise<FilePointer | undefined>;
22
- sealiousValueToForm(ctx: Context, sealiousValue: FilePointer | string | null): Promise<Record<string, string | undefined>>;
23
- }
@@ -1,23 +0,0 @@
1
- import { Context } from "koa";
2
- import { FilePointer } from "@sealcode/file-manager";
3
- import { FormDataValue } from "../form-types.js";
4
- import { FieldParseResult, FormField } from "./field.js";
5
- import { File as FileControl } from "../controls/file.js";
6
- import { FormControl, FormControlContext } from "../controls/form-control.js";
7
- export type FileContainer = {
8
- old: FilePointer | null;
9
- new: FilePointer | null;
10
- };
11
- export declare class File<Required extends boolean, DefaultControl extends FormControl = FileControl> extends FormField<Required, FileContainer, FormControl> {
12
- readonly required: Required;
13
- constructor(required: Required);
14
- parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<FileContainer>>;
15
- getDatabaseValue(ctx: Context, data: Record<string, FormDataValue>): Promise<FilePointer | undefined>;
16
- getEmptyValue(): {
17
- old: null;
18
- new: null;
19
- };
20
- getControl(...args: any[]): FileControl;
21
- getSealiousCreateValue(fctx: FormControlContext): Promise<FilePointer | undefined>;
22
- sealiousValueToForm(ctx: Context, sealiousValue: FilePointer | string | null): Promise<Record<string, string | undefined>>;
23
- }
@@ -1,29 +0,0 @@
1
- import { Field as SealiousField, FieldTypes as SealiousFieldTypes, RequiredField as SealiousRequiredField } from "sealious";
2
- import { Boolean as BooleanField } from "./boolean.js";
3
- import { SimpleFormField, TextBasedSimpleField } from "./simple-form-field.js";
4
- import { File } from "./file.js";
5
- import { CollectionField } from "./collection-field.js";
6
- import { StructuredArray as StructuredArrayField } from "./structured-array.js";
7
- import { Color } from "./color.js";
8
- import { DateField } from "./date.js";
9
- import { DateTime } from "./datetime.js";
10
- import { EmailField } from "./email.js";
11
- import { Float } from "./float.js";
12
- import { HTML } from "./html.js";
13
- import { Int } from "./int.js";
14
- import { JSONField } from "./json.js";
15
- import { Password } from "./password.js";
16
- import { Text } from "./text.js";
17
- import { Markdown } from "./markdown.js";
18
- import { DeepReverseSingleReferenceTable } from "./deep-reverse-single-reference-table.js";
19
- import { DeepReverseSingleReferenceList } from "./deep-reverse-single-reference-list.js";
20
- import { Coordinates } from "./coordinates.js";
21
- import { SimpleInput } from "../controls/simple-input.js";
22
- import { FormField } from "./field.js";
23
- import { PickFromListSealious } from "./pick-from-list-sealious.js";
24
- import { SingleReference } from "./single-reference.js";
25
- import { ExtractedFieldInfo } from "../../utils/extract-fields-from-collection.js";
26
- import { EnumMultipleSealious } from "./enum-multiple-sealious.js";
27
- export type SealiousToFormField<T> = T extends SealiousFieldTypes.Boolean ? BooleanField<false> : T extends SealiousFieldTypes.Color ? Color<false> : T extends SealiousFieldTypes.ControlAccess<infer R> ? SealiousToFormField<R> : T extends SealiousFieldTypes.Date ? DateField<false> : T extends SealiousFieldTypes.DateTime ? DateTime<false> : T extends SealiousFieldTypes.DeepReverseSingleReference ? DeepReverseSingleReferenceList | DeepReverseSingleReferenceTable : T extends SealiousFieldTypes.DisallowUpdate<any, any, any, infer R> ? SealiousToFormField<R> : T extends SealiousFieldTypes.Email ? EmailField<false> : T extends SealiousFieldTypes.Enum<any> ? PickFromListSealious<false> : T extends SealiousFieldTypes.EnumMultiple<infer R> ? R extends string[] ? EnumMultipleSealious<R> : TextBasedSimpleField<false> : T extends SealiousFieldTypes.File ? File<false> : T extends SealiousFieldTypes.Float ? Float<false> : T extends SealiousFieldTypes.HTML ? HTML<false> : T extends SealiousFieldTypes.Image ? File<false> : T extends SealiousFieldTypes.Int ? Int<false> : T extends SealiousFieldTypes.JsonObject ? JSONField<false> : T extends SealiousFieldTypes.JDD ? TextBasedSimpleField<false, SimpleInput<string>> : T extends SealiousFieldTypes.Password ? Password<false> : T extends SealiousFieldTypes.ReverseSingleReference ? TextBasedSimpleField<false, SimpleInput<string>> : T extends SealiousFieldTypes.SecretToken ? TextBasedSimpleField<false, SimpleInput<string>> : T extends SealiousFieldTypes.SettableBy<infer R> ? SealiousToFormField<R> : T extends SealiousFieldTypes.SingleReference ? SingleReference<boolean, T> : T extends SealiousFieldTypes.Text ? Text<false> : T extends SealiousFieldTypes.Username ? CollectionField<SealiousFieldTypes.Username, false> : T extends SealiousFieldTypes.ValueExistingInCollection ? SimpleFormField<false> : T extends SealiousFieldTypes.ValueNotExistingInCollection ? SimpleFormField<false> : T extends SealiousRequiredField<any, any, any> ? SimpleFormField<false> : T extends SealiousFieldTypes.Url ? SimpleFormField<false> : T extends SealiousFieldTypes.Money ? SimpleFormField<false> : T extends SealiousFieldTypes.Markdown ? Markdown<false> : T extends SealiousFieldTypes.Coordinates ? Coordinates<false> : T extends SealiousFieldTypes.StructuredArray<infer R> ? StructuredArrayField<R> : TextBasedSimpleField<any>;
28
- export declare function sealiousToFormField<SF extends SealiousField<any>>(sealious_field: SF): SealiousToFormField<SF>;
29
- export declare function sealiousFieldInfoToFormField(field_info: ExtractedFieldInfo): Promise<FormField>;
@@ -1,29 +0,0 @@
1
- import { Field as SealiousField, FieldTypes as SealiousFieldTypes, RequiredField as SealiousRequiredField } from "sealious";
2
- import { Boolean as BooleanField } from "./boolean.js";
3
- import { SimpleFormField, TextBasedSimpleField } from "./simple-form-field.js";
4
- import { File } from "./file.js";
5
- import { CollectionField } from "./collection-field.js";
6
- import { StructuredArray as StructuredArrayField } from "./structured-array.js";
7
- import { Color } from "./color.js";
8
- import { DateField } from "./date.js";
9
- import { DateTime } from "./datetime.js";
10
- import { EmailField } from "./email.js";
11
- import { Float } from "./float.js";
12
- import { HTML } from "./html.js";
13
- import { Int } from "./int.js";
14
- import { JSONField } from "./json.js";
15
- import { Password } from "./password.js";
16
- import { Text } from "./text.js";
17
- import { Markdown } from "./markdown.js";
18
- import { DeepReverseSingleReferenceTable } from "./deep-reverse-single-reference-table.js";
19
- import { DeepReverseSingleReferenceList } from "./deep-reverse-single-reference-list.js";
20
- import { Coordinates } from "./coordinates.js";
21
- import { SimpleInput } from "../controls/simple-input.js";
22
- import { FormField } from "./field.js";
23
- import { PickFromListSealious } from "./pick-from-list-sealious.js";
24
- import { SingleReference } from "./single-reference.js";
25
- import { ExtractedFieldInfo } from "../../utils/extract-fields-from-collection.js";
26
- import { EnumMultipleSealious } from "./enum-multiple-sealious.js";
27
- export type SealiousToFormField<T> = T extends SealiousFieldTypes.Boolean ? BooleanField<false> : T extends SealiousFieldTypes.Color ? Color<false> : T extends SealiousFieldTypes.ControlAccess<infer R> ? SealiousToFormField<R> : T extends SealiousFieldTypes.Date ? DateField<false> : T extends SealiousFieldTypes.DateTime ? DateTime<false> : T extends SealiousFieldTypes.DeepReverseSingleReference ? DeepReverseSingleReferenceList | DeepReverseSingleReferenceTable : T extends SealiousFieldTypes.DisallowUpdate<any, any, any, infer R> ? SealiousToFormField<R> : T extends SealiousFieldTypes.Email ? EmailField<false> : T extends SealiousFieldTypes.Enum<any> ? PickFromListSealious<false> : T extends SealiousFieldTypes.EnumMultiple<infer R> ? R extends string[] ? EnumMultipleSealious<R> : TextBasedSimpleField<false> : T extends SealiousFieldTypes.File ? File<false> : T extends SealiousFieldTypes.Float ? Float<false> : T extends SealiousFieldTypes.HTML ? HTML<false> : T extends SealiousFieldTypes.Image ? File<false> : T extends SealiousFieldTypes.Int ? Int<false> : T extends SealiousFieldTypes.JsonObject ? JSONField<false> : T extends SealiousFieldTypes.JDD ? TextBasedSimpleField<false, SimpleInput<string>> : T extends SealiousFieldTypes.Password ? Password<false> : T extends SealiousFieldTypes.ReverseSingleReference ? TextBasedSimpleField<false, SimpleInput<string>> : T extends SealiousFieldTypes.SecretToken ? TextBasedSimpleField<false, SimpleInput<string>> : T extends SealiousFieldTypes.SettableBy<infer R> ? SealiousToFormField<R> : T extends SealiousFieldTypes.SingleReference ? SingleReference<boolean, T> : T extends SealiousFieldTypes.Text ? Text<false> : T extends SealiousFieldTypes.Username ? CollectionField<SealiousFieldTypes.Username, false> : T extends SealiousFieldTypes.ValueExistingInCollection ? SimpleFormField<false> : T extends SealiousFieldTypes.ValueNotExistingInCollection ? SimpleFormField<false> : T extends SealiousRequiredField<any, any, any> ? SimpleFormField<false> : T extends SealiousFieldTypes.Url ? SimpleFormField<false> : T extends SealiousFieldTypes.Money ? SimpleFormField<false> : T extends SealiousFieldTypes.Markdown ? Markdown<false> : T extends SealiousFieldTypes.Coordinates ? Coordinates<false> : T extends SealiousFieldTypes.StructuredArray<infer R> ? StructuredArrayField<R> : TextBasedSimpleField<any>;
28
- export declare function sealiousToFormField<SF extends SealiousField<any>>(sealious_field: SF): SealiousToFormField<SF>;
29
- export declare function sealiousFieldInfoToFormField(field_info: ExtractedFieldInfo): Promise<FormField>;
@@ -1,5 +0,0 @@
1
- import { Photo } from "../controls/photo.js";
2
- import { File as FileField } from "./file.js";
3
- export declare class Image<Required extends boolean> extends FileField<Required, Photo> {
4
- getControl(): Photo;
5
- }
@@ -1,16 +0,0 @@
1
- import { Context } from "koa";
2
- import { FieldTypes as SealiousFieldTypes } from "sealious";
3
- import { FormField } from "./field.js";
4
- import { MultipleFiles as MultipleFilesControl } from "../controls/multiple-files.js";
5
- export declare class MultipleFiles extends FormField<false, undefined, MultipleFilesControl> {
6
- collection_field: SealiousFieldTypes.ReverseSingleReference;
7
- getItemId: (ctx: Context) => Promise<string> | string;
8
- constructor(collection_field: SealiousFieldTypes.ReverseSingleReference, getItemId: (ctx: Context) => Promise<string> | string);
9
- getEmptyValue(): undefined;
10
- parse(): Promise<{
11
- readonly parsed_value: undefined;
12
- readonly parsable: true;
13
- readonly error: null;
14
- }>;
15
- getControl(): MultipleFilesControl;
16
- }
@@ -1,25 +0,0 @@
1
- import { Context } from "koa";
2
- import { SimpleInput } from "../controls/simple-input.js";
3
- import { FormDataValue } from "../form-types.js";
4
- import { FieldParseResult, FormField } from "./field.js";
5
- export declare class NumberField<DefaultValue extends number | null = number, Required extends boolean = boolean> extends FormField<Required, number | DefaultValue, SimpleInput<number>> {
6
- default_value: DefaultValue;
7
- options: Partial<{
8
- max: number;
9
- min: number;
10
- decimalDigits: number;
11
- }>;
12
- constructor(required: Required, default_value: DefaultValue, options?: Partial<{
13
- max: number;
14
- min: number;
15
- decimalDigits: number;
16
- }>);
17
- predicate: import("@sealcode/ts-predicates").Predicate<number>;
18
- isValueValid(_: Context, value: unknown): Promise<{
19
- valid: boolean;
20
- message: string;
21
- }>;
22
- parse(_: Context, value: FormDataValue): Promise<FieldParseResult<number>>;
23
- getEmptyValue(): DefaultValue;
24
- getControl(): SimpleInput<number>;
25
- }
@@ -1,25 +0,0 @@
1
- import { Context } from "koa";
2
- import { SimpleInput } from "../controls/simple-input.js";
3
- import { FormDataValue } from "../form-types.js";
4
- import { FieldParseResult, FormField } from "./field.js";
5
- export declare class NumberField<DefaultValue extends number | null = number, Required extends boolean = boolean> extends FormField<Required, number | DefaultValue, SimpleInput<number>> {
6
- default_value: DefaultValue;
7
- options: Partial<{
8
- max: number;
9
- min: number;
10
- decimalDigits: number;
11
- }>;
12
- constructor(required: Required, default_value: DefaultValue, options?: Partial<{
13
- max: number;
14
- min: number;
15
- decimalDigits: number;
16
- }>);
17
- predicate: import("@sealcode/ts-predicates").Predicate<number>;
18
- isValueValid(_: Context, value: unknown): Promise<{
19
- valid: boolean;
20
- message: string;
21
- }>;
22
- parse(_: Context, value: FormDataValue): Promise<FieldParseResult<number>>;
23
- getEmptyValue(): DefaultValue;
24
- getControl(): SimpleInput<number>;
25
- }
@@ -1,15 +0,0 @@
1
- import { Context } from "koa";
2
- import { Dropdown, DropdownOption } from "../controls/dropdown.js";
3
- import { FormFieldValidationResponse } from "./field.js";
4
- import { TextBasedSimpleField } from "./simple-form-field.js";
5
- export declare class PickFromListField<Required extends boolean> extends TextBasedSimpleField<Required, Dropdown> {
6
- required: Required;
7
- generateOptions: (ctx: Context) => Promise<DropdownOption[]>;
8
- customValidation: (ctx: Context, value: unknown, instance: PickFromListField<Required>) => Promise<FormFieldValidationResponse>;
9
- constructor(required: Required, generateOptions: (ctx: Context) => Promise<DropdownOption[]>, customValidation?: (ctx: Context, value: unknown, instance: PickFromListField<Required>) => Promise<FormFieldValidationResponse>);
10
- predicate: import("@sealcode/ts-predicates").Predicate<string>;
11
- isValueValid(ctx: Context, value: string): Promise<FormFieldValidationResponse>;
12
- valueInList(ctx: Context, value: unknown): Promise<FormFieldValidationResponse>;
13
- getEmptyValue(): string;
14
- getControl(): Dropdown;
15
- }
@@ -1,15 +0,0 @@
1
- import { FormControl } from "../controls/form-control.js";
2
- import { FormField } from "./field.js";
3
- export declare class ProxyFormField<T> extends FormField<boolean, T, any> {
4
- name: string;
5
- empty_value: T;
6
- parsed_value: T;
7
- constructor(required: boolean, name: string, empty_value: T, parsed_value: T);
8
- getEmptyValue(): T;
9
- parse(): Promise<{
10
- readonly parsable: true;
11
- readonly error: null;
12
- readonly parsed_value: T;
13
- }>;
14
- getControl(): FormControl;
15
- }
@@ -1,21 +0,0 @@
1
- import { Context } from "koa";
2
- import { SimpleInput } from "../controls/simple-input.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 RegExpField<Required extends boolean> extends FormField<Required, string, SimpleInput<string>, string> {
7
- regexp: RegExp;
8
- error_message: string;
9
- default_value: string;
10
- constructor(required: Required, regexp: RegExp, error_message: string, default_value?: string);
11
- predicate: import("@sealcode/ts-predicates").Predicate<string>;
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
- getControl(): SimpleInput<string>;
19
- getSealiousCreateValue(fctx: FormControlContext): Promise<string>;
20
- sealiousValueToForm(ctx: Context, sealious_value: string | null): Promise<FormDataValue>;
21
- }
@@ -1,21 +0,0 @@
1
- import { Context } from "koa";
2
- import { SimpleInput } from "../controls/simple-input.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 RegExpField<Required extends boolean> extends FormField<Required, string, SimpleInput<string>, string> {
7
- regexp: RegExp;
8
- error_message: string;
9
- default_value: string;
10
- constructor(required: Required, regexp: RegExp, error_message: string, default_value?: string);
11
- predicate: import("@sealcode/ts-predicates").Predicate<string>;
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
- getControl(): SimpleInput<string>;
19
- getSealiousCreateValue(fctx: FormControlContext): Promise<string>;
20
- sealiousValueToForm(ctx: Context, sealious_value: string | null): Promise<FormDataValue>;
21
- }
@@ -1,21 +0,0 @@
1
- import { Context } from "koa";
2
- import { SimpleInput } from "../controls/simple-input.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 RegExpField<Required extends boolean> extends FormField<Required, string, SimpleInput<string>, string> {
7
- regexp: RegExp;
8
- error_message: string;
9
- default_value: string;
10
- constructor(required: Required, regexp: RegExp, error_message: string, default_value?: string);
11
- predicate: import("@sealcode/ts-predicates").Predicate<string>;
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
- getControl(): SimpleInput<string>;
19
- getSealiousCreateValue(fctx: FormControlContext): Promise<string>;
20
- sealiousValueToForm(ctx: Context, sealious_value: string | null): Promise<FormDataValue>;
21
- }
@@ -1,13 +0,0 @@
1
- import { FormField } from "./field.js";
2
- import { FieldTypes as SealiousFields } from "sealious";
3
- import { Context } from "koa";
4
- export declare class ReverseSingleReference extends FormField {
5
- sealious_field: SealiousFields.ReverseSingleReference;
6
- constructor(required: boolean, sealious_field: SealiousFields.ReverseSingleReference);
7
- parse(ctx: Context, raw_value: unknown): Promise<{
8
- parsable: true;
9
- error: null;
10
- parsed_value: unknown;
11
- }>;
12
- getEmptyValue(): never[];
13
- }
@@ -1,29 +0,0 @@
1
- import { FormDataValue } from "../form-types.js";
2
- import { Context } from "koa";
3
- import { FieldParseResult, FormField } from "./field.js";
4
- import { SimpleInput } from "../controls/simple-input.js";
5
- import { FormControl } from "../controls/controls.js";
6
- import { CollectionItem } from "sealious";
7
- import { FormControlContext } from "../controls/form-control.js";
8
- export declare abstract class SimpleFormField<Required extends boolean, DefaultControl extends FormControl = SimpleInput<string | null>, Parsed = string> extends FormField<Required, Parsed, DefaultControl> {
9
- type: string;
10
- predicate: import("@sealcode/ts-predicates").Predicate<string>;
11
- constructor(required: Required, type?: string);
12
- sealiousValueToForm(ctx: Context, value: unknown): Promise<FormDataValue>;
13
- }
14
- export declare class TextBasedSimpleField<Required extends boolean, DefaultControl extends FormControl = SimpleInput<string | null>> extends SimpleFormField<Required, DefaultControl, string> {
15
- parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<string>>;
16
- getSealiousCreateValue(fctx: FormControlContext): Promise<string>;
17
- postSealiousCreate(ctx: Context, created_item: CollectionItem<any>): Promise<void>;
18
- postSealiousEdit(ctx: Context, edited_item: CollectionItem<any>): Promise<void>;
19
- getControl(): DefaultControl;
20
- getEmptyValue(): string;
21
- }
22
- export declare class NumberBasedSimpleField<Required extends boolean, DefaultControl extends FormControl = SimpleInput<number | null>> extends SimpleFormField<Required, DefaultControl, number> {
23
- parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<number>>;
24
- getSealiousCreateValue(fctx: FormControlContext): Promise<number | undefined>;
25
- postSealiousCreate(): Promise<void>;
26
- postSealiousEdit(): Promise<void>;
27
- getControl(): DefaultControl;
28
- getEmptyValue(): number;
29
- }
@@ -1,29 +0,0 @@
1
- import { FormDataValue } from "../form-types.js";
2
- import { Context } from "koa";
3
- import { FieldParseResult, FormField } from "./field.js";
4
- import { SimpleInput } from "../controls/simple-input.js";
5
- import { FormControl } from "../controls/controls.js";
6
- import { CollectionItem } from "sealious";
7
- import { FormControlContext } from "../controls/form-control.js";
8
- export declare abstract class SimpleFormField<Required extends boolean, DefaultControl extends FormControl = SimpleInput<string | null>, Parsed = string> extends FormField<Required, Parsed, DefaultControl> {
9
- type: string;
10
- predicate: import("@sealcode/ts-predicates").Predicate<string>;
11
- constructor(required: Required, type?: string);
12
- sealiousValueToForm(ctx: Context, value: unknown): Promise<FormDataValue>;
13
- }
14
- export declare class TextBasedSimpleField<Required extends boolean, DefaultControl extends FormControl = SimpleInput<string | null>> extends SimpleFormField<Required, DefaultControl, string> {
15
- parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<string>>;
16
- getSealiousCreateValue(fctx: FormControlContext): Promise<string>;
17
- postSealiousCreate(ctx: Context, created_item: CollectionItem<any>): Promise<void>;
18
- postSealiousEdit(ctx: Context, edited_item: CollectionItem<any>): Promise<void>;
19
- getControl(): DefaultControl;
20
- getEmptyValue(): string;
21
- }
22
- export declare class NumberBasedSimpleField<Required extends boolean, DefaultControl extends FormControl = SimpleInput<number | null>> extends SimpleFormField<Required, DefaultControl, number> {
23
- parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<number>>;
24
- getSealiousCreateValue(fctx: FormControlContext): Promise<number | undefined>;
25
- postSealiousCreate(): Promise<void>;
26
- postSealiousEdit(): Promise<void>;
27
- getControl(): DefaultControl;
28
- getEmptyValue(): number;
29
- }
@@ -1,29 +0,0 @@
1
- import { FormDataValue } from "../form-types.js";
2
- import { Context } from "koa";
3
- import { FieldParseResult, FormField } from "./field.js";
4
- import { SimpleInput } from "../controls/simple-input.js";
5
- import { FormControl } from "../controls/controls.js";
6
- import { CollectionItem } from "sealious";
7
- import { FormControlContext } from "../controls/form-control.js";
8
- export declare abstract class SimpleFormField<Required extends boolean, DefaultControl extends FormControl = SimpleInput<string | null>, Parsed = string> extends FormField<Required, Parsed, DefaultControl> {
9
- type: string;
10
- predicate: import("@sealcode/ts-predicates").Predicate<string>;
11
- constructor(required: Required, type?: string);
12
- sealiousValueToForm(ctx: Context, value: unknown): Promise<FormDataValue>;
13
- }
14
- export declare class TextBasedSimpleField<Required extends boolean, DefaultControl extends FormControl = SimpleInput<string | null>> extends SimpleFormField<Required, DefaultControl, string> {
15
- parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<string>>;
16
- getSealiousCreateValue(fctx: FormControlContext): Promise<string>;
17
- postSealiousCreate(ctx: Context, created_item: CollectionItem<any>): Promise<void>;
18
- postSealiousEdit(ctx: Context, edited_item: CollectionItem<any>): Promise<void>;
19
- getControl(): DefaultControl;
20
- getEmptyValue(): string;
21
- }
22
- export declare class NumberBasedSimpleField<Required extends boolean, DefaultControl extends FormControl = SimpleInput<number | null>> extends SimpleFormField<Required, DefaultControl, number> {
23
- parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<number>>;
24
- getSealiousCreateValue(fctx: FormControlContext): Promise<number | undefined>;
25
- postSealiousCreate(): Promise<void>;
26
- postSealiousEdit(): Promise<void>;
27
- getControl(): DefaultControl;
28
- getEmptyValue(): number;
29
- }
@@ -1,10 +0,0 @@
1
- import { FieldTypes as SealiousFieldTypes } from "sealious";
2
- import { CollectionField } from "./collection-field.js";
3
- import { SingleReferenceDropdown } from "../controls/single-reference.js";
4
- import { FormControlContext } from "../controls/form-control.js";
5
- import { Context } from "koa";
6
- export declare class SingleReference<Required extends boolean, F extends SealiousFieldTypes.SingleReference> extends CollectionField<F, Required> {
7
- getControl(): SingleReferenceDropdown<F, Required>;
8
- getSealiousCreateValue(fctx: FormControlContext): Promise<string | undefined>;
9
- sealiousValueToForm(ctx: Context, value: string | null): Promise<string | undefined>;
10
- }
@@ -1,27 +0,0 @@
1
- import { Context } from "koa";
2
- import { Field as SealiousField, FieldsetOutput, FieldTypes as SealiousFieldTypes, FieldsetInput } from "sealious";
3
- import { FormDataValue } from "../form-types.js";
4
- import { FormField } from "./field.js";
5
- import { Table as TableControl } from "../controls/table.js";
6
- import { SealiousToFormField } from "./get-field-for-sealious.js";
7
- import { FormControlContext } from "../controls/form-control.js";
8
- import { ExtractedFieldInfo } from "../../utils/extract-fields-from-collection.js";
9
- export declare class StructuredArray<SealiousFields extends Record<string, SealiousField<unknown>>, FormFields extends Record<string, FormField> = {
10
- [name in keyof SealiousFields]: SealiousToFormField<SealiousFields[name]>;
11
- }> extends FormField<true, SealiousFieldTypes.ArrayStorageInput<FieldsetOutput<SealiousFields>>, TableControl<any>> {
12
- sealious_field: SealiousFieldTypes.StructuredArray<SealiousFields>;
13
- constructor(sealious_field: SealiousFieldTypes.StructuredArray<SealiousFields>);
14
- parse(_context: Context, value: FormDataValue): Promise<{
15
- parsable: true;
16
- error: null;
17
- parsed_value: FieldsetOutput<SealiousFields>;
18
- }>;
19
- getEmptyValue(): SealiousFieldTypes.ArrayStorageInput<FieldsetOutput<SealiousFields>>;
20
- getControl(): TableControl<FormFields>;
21
- generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
22
- form_field_types: string;
23
- sealious_field: string;
24
- }): string;
25
- getSealiousCreateValue(fctx: FormControlContext): Promise<SealiousFieldTypes.ArrayStorageInput<FieldsetInput<SealiousFields>>>;
26
- sealiousValueToForm(ctx: Context, sealiousValue: Record<string, FormDataValue>[] | null): Promise<FormDataValue>;
27
- }
@@ -1,27 +0,0 @@
1
- import { Context } from "koa";
2
- import { Field as SealiousField, FieldsetOutput, FieldTypes as SealiousFieldTypes, FieldsetInput } from "sealious";
3
- import { FormDataValue } from "../form-types.js";
4
- import { FormField } from "./field.js";
5
- import { Table as TableControl } from "../controls/table.js";
6
- import { SealiousToFormField } from "./get-field-for-sealious.js";
7
- import { FormControlContext } from "../controls/form-control.js";
8
- import { ExtractedFieldInfo } from "../../utils/extract-fields-from-collection.js";
9
- export declare class StructuredArray<SealiousFields extends Record<string, SealiousField<unknown>>, FormFields extends Record<string, FormField> = {
10
- [name in keyof SealiousFields]: SealiousToFormField<SealiousFields[name]>;
11
- }> extends FormField<true, SealiousFieldTypes.ArrayStorageInput<FieldsetOutput<SealiousFields>>, TableControl<any>> {
12
- sealious_field: SealiousFieldTypes.StructuredArray<SealiousFields>;
13
- constructor(sealious_field: SealiousFieldTypes.StructuredArray<SealiousFields>);
14
- parse(_context: Context, value: FormDataValue): Promise<{
15
- parsable: true;
16
- error: null;
17
- parsed_value: FieldsetOutput<SealiousFields>;
18
- }>;
19
- getEmptyValue(): SealiousFieldTypes.ArrayStorageInput<FieldsetOutput<SealiousFields>>;
20
- getControl(): TableControl<FormFields>;
21
- generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
22
- form_field_types: string;
23
- sealious_field: string;
24
- }): string;
25
- getSealiousCreateValue(fctx: FormControlContext): Promise<SealiousFieldTypes.ArrayStorageInput<FieldsetInput<SealiousFields>>>;
26
- sealiousValueToForm(ctx: Context, sealiousValue: Record<string, FormDataValue>[] | null): Promise<FormDataValue>;
27
- }
@@ -1,27 +0,0 @@
1
- import { Context } from "koa";
2
- import { Field as SealiousField, FieldTypes as SealiousFieldTypes, FieldsetInput } from "sealious";
3
- import { FormDataValue } from "../form-types.js";
4
- import { Table as TableControl } from "../controls/table.js";
5
- import { SealiousToFormField } from "./get-field-for-sealious.js";
6
- import { FormControlContext } from "../controls/form-control.js";
7
- import { ExtractedFieldInfo } from "../../utils/extract-fields-from-collection.js";
8
- import { Table } from "./table.js";
9
- export declare class StructuredArray<SealiousFields extends Record<string, SealiousField<unknown>>, FormFields extends {
10
- [name in keyof SealiousFields]: SealiousToFormField<SealiousFields[name]>;
11
- } = {
12
- [name in keyof SealiousFields]: SealiousToFormField<SealiousFields[name]>;
13
- }> extends Table<{
14
- [name in keyof SealiousFields]: SealiousToFormField<SealiousFields[name]>;
15
- }> {
16
- sealious_field: SealiousFieldTypes.StructuredArray<SealiousFields>;
17
- constructor(sealious_field: SealiousFieldTypes.StructuredArray<SealiousFields>);
18
- getControl(): TableControl<{
19
- [name in keyof SealiousFields]: SealiousToFormField<SealiousFields[name]>;
20
- }>;
21
- generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
22
- form_field_types: string;
23
- sealious_field: string;
24
- }): string;
25
- getSealiousCreateValue(fctx: FormControlContext): Promise<SealiousFieldTypes.ArrayStorageInput<FieldsetInput<SealiousFields>>>;
26
- sealiousValueToForm(ctx: Context, sealiousValue: Record<string, FormDataValue>[] | null): Promise<FormDataValue>;
27
- }