@sealcode/sealgen 0.19.23 → 0.19.25-hotfix1

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 (240) hide show
  1. package/@types/forms/controls/array.d.ts +3 -1
  2. package/@types/forms/controls/controls.d.ts +0 -1
  3. package/@types/forms/controls/dropdown.d.ts +6 -6
  4. package/@types/forms/controls/single-reference.d.ts +8 -6
  5. package/@types/forms/fields/CollectionField.d.ts +1 -0
  6. package/@types/forms/fields/boolean.d.ts +1 -2
  7. package/@types/forms/fields/collection-field.d.ts +12 -5
  8. package/@types/forms/fields/coordinates.d.ts +2 -2
  9. package/@types/forms/fields/date.d.ts +1 -2
  10. package/@types/forms/fields/datetime.d.ts +1 -2
  11. package/@types/forms/fields/deep-reverse-single-reference-list.d.ts +1 -1
  12. package/@types/forms/fields/deep-reverse-single-reference-table.d.ts +1 -2
  13. package/@types/forms/fields/enum-multiple-sealious.d.ts +1 -2
  14. package/@types/forms/fields/field.d.ts +8 -4
  15. package/@types/forms/fields/fields.d.ts +1 -0
  16. package/@types/forms/fields/file.d.ts +4 -3
  17. package/@types/forms/fields/int.d.ts +1 -2
  18. package/@types/forms/fields/json.d.ts +1 -2
  19. package/@types/forms/fields/phone-number-with-country-code.d.ts +1 -2
  20. package/@types/forms/fields/pick-from-list.d.ts +2 -2
  21. package/@types/forms/fields/regexp.d.ts +1 -2
  22. package/@types/forms/fields/simple-form-field.d.ts +3 -4
  23. package/@types/forms/fields/single-reference.d.ts +2 -3
  24. package/@types/forms/fields/structured-array.d.ts +1 -2
  25. package/@types/forms/fields/structured.d.ts +19 -0
  26. package/@types/forms/fields/text.d.ts +1 -2
  27. package/@types/forms/fields/url.d.ts +1 -2
  28. package/@types/forms/multiform.d.ts +4 -3
  29. package/@types/index.d.ts +29 -18
  30. package/@types/page/stateful-page.d.ts +3 -2
  31. package/@types/src/add-collection.d.ts +1 -0
  32. package/@types/src/add-crud.d.ts +3 -0
  33. package/@types/src/add-crud.test.d.ts +1 -0
  34. package/@types/src/add-jdd-component.d.ts +1 -0
  35. package/@types/src/add-list-route.test.d.ts +1 -0
  36. package/@types/src/add-route.d.ts +3 -0
  37. package/@types/src/add-route.test.d.ts +1 -0
  38. package/@types/src/build.d.ts +3 -0
  39. package/@types/src/builders/backend-ts-builder.d.ts +7 -0
  40. package/@types/src/builders/builder.d.ts +11 -0
  41. package/@types/src/builders/colors-builder.d.ts +10 -0
  42. package/@types/src/builders/css-builder.d.ts +19 -0
  43. package/@types/src/builders/fonts-builder.d.ts +7 -0
  44. package/@types/src/builders/frontend-ts-builder.d.ts +11 -0
  45. package/@types/src/cli.d.ts +2 -0
  46. package/@types/src/components/components.d.ts +2 -0
  47. package/@types/src/components/tabs.d.ts +2 -0
  48. package/@types/src/components/toggle-modal.d.ts +6 -0
  49. package/@types/src/controllers/password-generate-button.stimulus.d.ts +5 -0
  50. package/@types/src/controllers/sealgen-table.stimulus.d.ts +13 -0
  51. package/@types/src/embeddable-file-extensions.d.ts +1 -0
  52. package/@types/src/esbuild-plugins/load-assets.d.ts +5 -0
  53. package/@types/src/esbuild-plugins/rewrite-asset-imports.d.ts +5 -0
  54. package/@types/src/example.test.d.ts +1 -0
  55. package/@types/src/forms/controls/array.d.ts +33 -0
  56. package/@types/src/forms/controls/autocomplete.d.ts +22 -0
  57. package/@types/src/forms/controls/big-radio-group.d.ts +14 -0
  58. package/@types/src/forms/controls/checkbox-group.d.ts +21 -0
  59. package/@types/src/forms/controls/checkbox.d.ts +17 -0
  60. package/@types/src/forms/controls/checkboxed-list-input.d.ts +21 -0
  61. package/@types/src/forms/controls/checkboxed-list-input.test.d.ts +1 -0
  62. package/@types/src/forms/controls/collapsible-checkbox-group.d.ts +11 -0
  63. package/@types/src/forms/controls/collapsible-field-group.d.ts +21 -0
  64. package/@types/src/forms/controls/controls.d.ts +32 -0
  65. package/@types/src/forms/controls/derived-frame.d.ts +19 -0
  66. package/@types/src/forms/controls/derived.d.ts +13 -0
  67. package/@types/src/forms/controls/dropdown.d.ts +30 -0
  68. package/@types/src/forms/controls/editable-collection-subset.d.ts +20 -0
  69. package/@types/src/forms/controls/field-group.d.ts +23 -0
  70. package/@types/src/forms/controls/file.d.ts +12 -0
  71. package/@types/src/forms/controls/file.test.d.ts +1 -0
  72. package/@types/src/forms/controls/form-control.d.ts +23 -0
  73. package/@types/src/forms/controls/form-field-control.d.ts +13 -0
  74. package/@types/src/forms/controls/form-header.d.ts +8 -0
  75. package/@types/src/forms/controls/form-paragraph.d.ts +7 -0
  76. package/@types/src/forms/controls/frame.d.ts +17 -0
  77. package/@types/src/forms/controls/hidden-input.d.ts +9 -0
  78. package/@types/src/forms/controls/html.d.ts +11 -0
  79. package/@types/src/forms/controls/hybrid.d.ts +10 -0
  80. package/@types/src/forms/controls/image.d.ts +19 -0
  81. package/@types/src/forms/controls/image.test.d.ts +1 -0
  82. package/@types/src/forms/controls/multiple-files.d.ts +42 -0
  83. package/@types/src/forms/controls/multiple-images.d.ts +19 -0
  84. package/@types/src/forms/controls/number.d.ts +13 -0
  85. package/@types/src/forms/controls/password-with-generator.d.ts +6 -0
  86. package/@types/src/forms/controls/radio.d.ts +16 -0
  87. package/@types/src/forms/controls/simple-input.d.ts +35 -0
  88. package/@types/src/forms/controls/single-reference.d.ts +14 -0
  89. package/@types/src/forms/controls/single-reference.test.d.ts +1 -0
  90. package/@types/{forms/controls/table.d.sync-conflict-20260502-145940-GP5D735.ts → src/forms/controls/table.d.ts} +2 -0
  91. package/@types/src/forms/controls/textarea.d.ts +25 -0
  92. package/@types/src/forms/controls/tickable.d.ts +25 -0
  93. package/@types/src/forms/fields/boolean.d.ts +22 -0
  94. package/@types/src/forms/fields/boolean.test.d.ts +1 -0
  95. package/@types/src/forms/fields/checkboxed-list.d.ts +23 -0
  96. package/@types/src/forms/fields/collection-field.d.ts +22 -0
  97. package/@types/src/forms/fields/color.d.ts +4 -0
  98. package/@types/src/forms/fields/coordinates.d.ts +14 -0
  99. package/@types/src/forms/fields/date.d.ts +13 -0
  100. package/@types/src/forms/fields/datetime.d.ts +14 -0
  101. package/@types/src/forms/fields/deep-reverse-single-reference-list.d.ts +20 -0
  102. package/@types/src/forms/fields/deep-reverse-single-reference-table.d.ts +16 -0
  103. package/@types/src/forms/fields/email.d.ts +10 -0
  104. package/@types/src/forms/fields/email.test.d.ts +1 -0
  105. package/@types/src/forms/fields/enum-multiple-sealious.d.ts +16 -0
  106. package/@types/src/forms/fields/existing-sealious-value.d.ts +6 -0
  107. package/@types/src/forms/fields/field.d.ts +85 -0
  108. package/@types/src/forms/fields/field.test.d.ts +1 -0
  109. package/@types/src/forms/fields/fields.d.ts +34 -0
  110. package/@types/src/forms/fields/file.d.ts +25 -0
  111. package/@types/src/forms/fields/file.test.d.ts +1 -0
  112. package/@types/src/forms/fields/float.d.ts +4 -0
  113. package/@types/src/forms/fields/get-field-for-sealious.d.ts +33 -0
  114. package/@types/src/forms/fields/html.d.ts +6 -0
  115. package/@types/src/forms/fields/hybrid.d.ts +11 -0
  116. package/@types/src/forms/fields/image.d.ts +5 -0
  117. package/@types/src/forms/fields/int.d.ts +6 -0
  118. package/@types/src/forms/fields/item-draft.d.ts +20 -0
  119. package/@types/src/forms/fields/json.d.ts +13 -0
  120. package/@types/src/forms/fields/markdown.d.ts +6 -0
  121. package/@types/src/forms/fields/multiple-files.d.ts +16 -0
  122. package/@types/src/forms/fields/number.d.ts +25 -0
  123. package/@types/src/forms/fields/number.test.d.ts +1 -0
  124. package/@types/src/forms/fields/password.d.ts +10 -0
  125. package/@types/src/forms/fields/phone-number-with-country-code.d.ts +13 -0
  126. package/@types/src/forms/fields/phone-number.d.ts +17 -0
  127. package/@types/src/forms/fields/pick-from-list-sealious.d.ts +11 -0
  128. package/@types/src/forms/fields/pick-from-list.d.ts +15 -0
  129. package/@types/src/forms/fields/pick-from-list.test.d.ts +1 -0
  130. package/@types/src/forms/fields/proxy-field.d.ts +15 -0
  131. package/@types/src/forms/fields/regexp.d.ts +21 -0
  132. package/@types/src/forms/fields/regexp.test.d.ts +1 -0
  133. package/@types/src/forms/fields/simple-form-field.d.ts +31 -0
  134. package/@types/src/forms/fields/single-reference.d.ts +19 -0
  135. package/@types/src/forms/fields/structured-array.d.ts +23 -0
  136. package/@types/src/forms/fields/table.d.ts +16 -0
  137. package/@types/src/forms/fields/text.d.ts +6 -0
  138. package/@types/src/forms/fields/url.d.ts +6 -0
  139. package/@types/src/forms/form-types.d.ts +28 -0
  140. package/@types/src/forms/form.d.ts +34 -0
  141. package/@types/src/forms/form.test.d.ts +6 -0
  142. package/@types/src/forms/multiform.d.ts +23 -0
  143. package/@types/src/forms/multiform.test.d.ts +1 -0
  144. package/@types/src/generate-collections.d.ts +2 -0
  145. package/@types/src/generate-components.d.ts +1 -0
  146. package/@types/src/generate-routes.d.ts +5 -0
  147. package/@types/src/generate-routes.test.d.ts +1 -0
  148. package/@types/src/generate-stimulus.d.ts +1 -0
  149. package/@types/src/get-fonts.d.ts +2 -0
  150. package/@types/{index.d.sync-conflict-20260502-145557-GP5D735.ts → src/index.d.ts} +1 -0
  151. package/@types/src/make-env.d.ts +1 -0
  152. package/@types/src/make-hidden-inputs.d.ts +5 -0
  153. package/@types/src/mount.d.ts +6 -0
  154. package/@types/src/notifier.d.ts +2 -0
  155. package/@types/src/page/access-control.d.ts +6 -0
  156. package/@types/src/page/default-list-filters.d.ts +18 -0
  157. package/@types/src/page/list.d.ts +49 -0
  158. package/@types/src/page/mountable-with-fields.d.ts +49 -0
  159. package/@types/src/page/mountable-with-fields.test.d.ts +1 -0
  160. package/@types/src/page/mountable.d.ts +10 -0
  161. package/@types/src/page/page.d.ts +18 -0
  162. package/@types/src/page/props-parser.d.ts +15 -0
  163. package/@types/src/page/sealious-list.d.ts +20 -0
  164. package/@types/src/page/sealious-list.test.d.ts +1 -0
  165. package/@types/src/page/stateful-page.d.ts +63 -0
  166. package/@types/src/page/stateful-page.test.d.ts +1 -0
  167. package/@types/src/register-external.d.ts +2 -0
  168. package/@types/src/register-external.test.d.ts +1 -0
  169. package/@types/src/run.d.ts +1 -0
  170. package/@types/src/sanitize.d.ts +1 -0
  171. package/@types/src/target-locreq.d.ts +4 -0
  172. package/@types/src/templates/collection.d.ts +1 -0
  173. package/@types/src/templates/form.d.ts +14 -0
  174. package/@types/src/templates/form.test.d.ts +1 -0
  175. package/@types/src/templates/jdd-component.d.ts +1 -0
  176. package/@types/src/templates/jdd-editor.d.ts +1 -0
  177. package/@types/src/templates/list.d.ts +1 -0
  178. package/@types/src/templates/long-running-process.d.ts +1 -0
  179. package/@types/src/templates/multiform.d.ts +1 -0
  180. package/@types/src/templates/page.d.ts +1 -0
  181. package/@types/src/templates/post.d.ts +1 -0
  182. package/@types/src/templates/redirect.d.ts +1 -0
  183. package/@types/src/templates/route-test.d.ts +1 -0
  184. package/@types/src/templates/shared/collection-create-form.d.ts +1 -0
  185. package/@types/src/templates/shared/collection-edit-form.d.ts +1 -0
  186. package/@types/src/templates/shared/collection-list.d.ts +16 -0
  187. package/@types/src/templates/shared/item-delete.d.ts +1 -0
  188. package/@types/src/templates/shared/shared-crud-form-fields.d.ts +1 -0
  189. package/@types/src/templates/stateful-page.d.ts +1 -0
  190. package/@types/src/templates/stimulus-controller.d.ts +1 -0
  191. package/@types/src/templates/templates.d.ts +1 -0
  192. package/@types/src/test_utils/exec_async.d.ts +1 -0
  193. package/@types/src/test_utils/locator_is_visible.d.ts +2 -0
  194. package/@types/src/test_utils/test-on-real-app.d.ts +26 -0
  195. package/@types/src/utils/assert-throws.d.ts +1 -0
  196. package/@types/src/utils/base64.d.ts +2 -0
  197. package/@types/src/utils/browser-creator.d.ts +1 -0
  198. package/@types/src/utils/escape-url-params.d.ts +2 -0
  199. package/@types/src/utils/exec.d.ts +5 -0
  200. package/@types/src/utils/extract-fields-from-collection.d.ts +14 -0
  201. package/@types/src/utils/format-external-url.d.ts +1 -0
  202. package/@types/src/utils/import-path.d.ts +2 -0
  203. package/@types/src/utils/input-wrapper.d.ts +5 -0
  204. package/@types/src/utils/list-collections.d.ts +1 -0
  205. package/@types/src/utils/make-slug.d.ts +1 -0
  206. package/@types/src/utils/module-dirname.d.ts +1 -0
  207. package/@types/src/utils/natural-numbers.d.ts +1 -0
  208. package/@types/src/utils/prettier.d.ts +3 -0
  209. package/@types/src/utils/question.d.ts +1 -0
  210. package/@types/src/utils/render-attributes.d.ts +1 -0
  211. package/@types/src/utils/sleep.d.ts +1 -0
  212. package/@types/src/utils/translate.d.ts +4 -0
  213. package/@types/src/utils/url-with-new-params.d.ts +2 -0
  214. package/@types/src/utils/utils.d.ts +17 -0
  215. package/@types/src/utils/walk.d.ts +1 -0
  216. package/@types/src/utils/with-fallback.d.ts +2 -0
  217. package/@types/src/utils/wrap-attributes.d.ts +3 -0
  218. package/@types/src/utils/write-file.d.ts +1 -0
  219. package/@types/templates/long-running-process.d.ts +1 -1
  220. package/@types/templates/multiform.d.ts +1 -1
  221. package/@types/templates/route-test.d.ts +1 -1
  222. package/@types/templates/shared/item-delete.d.ts +1 -1
  223. package/@types/templates/stateful-page.d.ts +1 -1
  224. package/lib/add-crud.js +2 -8
  225. package/lib/builders/backend-ts-builder.js +1 -1
  226. package/lib/forms/controls/textarea.js +2 -1
  227. package/lib/templates/long-running-process.js +2 -4
  228. package/lib/templates/multiform.js +2 -4
  229. package/lib/templates/route-test.js +4 -8
  230. package/lib/templates/shared/item-delete.js +3 -7
  231. package/lib/templates/stateful-page.js +2 -4
  232. package/package.json +1 -1
  233. package/src/add-crud.ts +2 -8
  234. package/src/builders/backend-ts-builder.ts +1 -0
  235. package/src/forms/controls/textarea.ts +5 -4
  236. package/src/templates/long-running-process.ts +2 -5
  237. package/src/templates/multiform.ts +2 -8
  238. package/src/templates/route-test.ts +4 -11
  239. package/src/templates/shared/item-delete.ts +3 -8
  240. package/src/templates/stateful-page.ts +2 -5
@@ -0,0 +1,19 @@
1
+ import { CollectionItem } from "sealious";
2
+ import { FilePointer } from "@sealcode/file-manager";
3
+ import { FlatTemplatable } from "tempstream";
4
+ import { MultipleFiles, MultipleFilesOptions } from "./multiple-files.js";
5
+ import { MultipleFiles as MultipleFilesField } from "../fields/multiple-files.js";
6
+ import { KoaResponsiveImageRouter } from "koa-responsive-image-router";
7
+ export declare class MultipleImages extends MultipleFiles {
8
+ field: MultipleFilesField;
9
+ imageRouter: KoaResponsiveImageRouter;
10
+ constructor(field: MultipleFilesField, imageRouter: KoaResponsiveImageRouter, options?: Partial<MultipleFilesOptions>);
11
+ getClassModifiers(): string[];
12
+ getInputAttributes(): {
13
+ accept: string;
14
+ type: string;
15
+ name: string;
16
+ multiple: boolean;
17
+ };
18
+ renderFileItem(fileItem: CollectionItem, file: FilePointer): Promise<FlatTemplatable>;
19
+ }
@@ -0,0 +1,13 @@
1
+ import { NumberField } from "../fields/number.js";
2
+ import { FormControlContext } from "./form-control.js";
3
+ import { SimpleInput, SimpleInputOptions } from "./simple-input.js";
4
+ export type NumberOptions = SimpleInputOptions & Partial<{
5
+ step: number;
6
+ }>;
7
+ export declare class Number extends SimpleInput {
8
+ field: NumberField;
9
+ options: NumberOptions;
10
+ constructor(field: NumberField, options: NumberOptions);
11
+ getType(): string;
12
+ getInputAttributes(fctx: FormControlContext): Promise<Record<string, string | boolean>>;
13
+ }
@@ -0,0 +1,6 @@
1
+ import { FormField } from "../../index.js";
2
+ import { SimpleInput } from "./simple-input.js";
3
+ export declare class PasswordWithGenerator extends SimpleInput {
4
+ constructor(field: FormField);
5
+ preInput(): Promise<string>;
6
+ }
@@ -0,0 +1,16 @@
1
+ import { Context } from "koa";
2
+ import { FormField } from "../fields/field.js";
3
+ import { FormDataValue } from "../form-types.js";
4
+ import { Tickable } from "./tickable.js";
5
+ export declare class Radio extends Tickable<string> {
6
+ field: FormField<boolean, string>;
7
+ value: string;
8
+ type: "radio";
9
+ constructor(field: FormField<boolean, string>, value: string, options: {
10
+ label?: string;
11
+ });
12
+ makeInputID(): string;
13
+ getValueAttribute(): string;
14
+ getWrapperClasses(ctx: Context, data: Record<string, FormDataValue>, value: string): string[];
15
+ isChecked(_ctx: Context, _data: Record<string, FormDataValue>, value: string): boolean;
16
+ }
@@ -0,0 +1,35 @@
1
+ import { Context } from "koa";
2
+ import { FlatTemplatable } from "tempstream";
3
+ import { FormField } from "../fields/field.js";
4
+ import { FormDataValue } from "../form-types.js";
5
+ import { FormControlContext } from "./form-control.js";
6
+ import { FormFieldControl } from "./form-field-control.js";
7
+ export type SimpleInputOptions = {
8
+ id?: string;
9
+ label?: string;
10
+ autocomplete?: boolean;
11
+ hide_errors?: boolean;
12
+ type?: string;
13
+ value?: string;
14
+ placeholder?: string;
15
+ readonly?: boolean;
16
+ step?: number;
17
+ suffix?: string;
18
+ pattern?: string;
19
+ inputmode?: string;
20
+ };
21
+ export declare class SimpleInput<Options extends SimpleInputOptions = SimpleInputOptions> extends FormFieldControl {
22
+ field: FormField<boolean, any>;
23
+ options: SimpleInputOptions;
24
+ constructor(field: FormField<boolean, any>, options?: Options);
25
+ preInput(_ctx: FormControlContext, _data: Record<string, FormDataValue>): Promise<FlatTemplatable>;
26
+ getType(): string;
27
+ getLabel(): string;
28
+ getID(): string;
29
+ getPlaceholder(): string;
30
+ getInputAttributes(fctx: FormControlContext): Promise<Record<string, string | boolean>>;
31
+ postInput(_: Context): Promise<FlatTemplatable>;
32
+ renderInput(_ctx: Context, attributes_str: string, _data: Record<string, FormDataValue>): Promise<FlatTemplatable>;
33
+ getWrapperModifiers(): string[];
34
+ render(fctx: FormControlContext): Promise<FlatTemplatable>;
35
+ }
@@ -0,0 +1,14 @@
1
+ import { FieldTypes as SealiousFieldTypes } from "sealious";
2
+ import { CollectionField } from "../fields/collection-field.js";
3
+ import { DropdownOptions, FreeformDropdown } from "./dropdown.js";
4
+ import { Collection, CollectionItem } from "sealious";
5
+ export declare class SingleReferenceDropdown<TargetCollection extends Collection, F extends SealiousFieldTypes.SingleReference, Required extends boolean> extends FreeformDropdown {
6
+ field: CollectionField<F, Required>;
7
+ options: DropdownOptions & {
8
+ getLabel?: (item: CollectionItem<Collection>) => string;
9
+ };
10
+ constructor(field: CollectionField<F, Required>, options?: DropdownOptions & {
11
+ getLabel?: (item: CollectionItem<Collection>) => string;
12
+ });
13
+ setOptionLabelGetter(getter: (item: CollectionItem<TargetCollection>) => string): this;
14
+ }
@@ -10,6 +10,7 @@ export type TableControlOptions<F extends Record<string, FormField>> = {
10
10
  [field_name in keyof F]: FormControl;
11
11
  };
12
12
  allow_removing?: boolean;
13
+ allow_reordering?: boolean;
13
14
  label_add?: string;
14
15
  label: string;
15
16
  label_remove?: string;
@@ -36,4 +37,5 @@ export declare class Table<F extends Record<string, FormField>> extends FormCont
36
37
  setLabel(value: string): this;
37
38
  setRemoveLabel(value: string): this;
38
39
  setAddLabel(value: string): this;
40
+ setAllowReordering(value: boolean): this;
39
41
  }
@@ -0,0 +1,25 @@
1
+ import { Context } from "koa";
2
+ import { FormField } from "../fields/field.js";
3
+ import { FormDataValue } from "../form-types.js";
4
+ import { FormControlContext } from "./form-control.js";
5
+ import { SimpleInput, SimpleInputOptions } from "./simple-input.js";
6
+ export declare class Textarea extends SimpleInput {
7
+ field: FormField<boolean>;
8
+ options: SimpleInputOptions & {
9
+ label?: string;
10
+ rows?: number;
11
+ cols?: number;
12
+ description?: string;
13
+ autogrow?: boolean;
14
+ };
15
+ constructor(field: FormField<boolean>, options?: SimpleInputOptions & {
16
+ label?: string;
17
+ rows?: number;
18
+ cols?: number;
19
+ description?: string;
20
+ autogrow?: boolean;
21
+ });
22
+ renderDescription(): string;
23
+ getInputAttributes(fctx: FormControlContext): Promise<Record<string, string | boolean>>;
24
+ renderInput(ctx: Context, attributes: string, data: Record<string, FormDataValue>): Promise<string>;
25
+ }
@@ -0,0 +1,25 @@
1
+ import { Context } from "koa";
2
+ import { FlatTemplatable } from "tempstream";
3
+ import { FormField } from "../fields/field.js";
4
+ import { FormDataValue } from "../form-types.js";
5
+ import { FormControlContext } from "./form-control.js";
6
+ import { FormFieldControl } from "./form-field-control.js";
7
+ export type TickableOptions<T> = {
8
+ id?: string;
9
+ name?: string;
10
+ label?: string;
11
+ hide_errors?: boolean;
12
+ readonly?: boolean;
13
+ default_value: T;
14
+ };
15
+ export declare abstract class Tickable<T> extends FormFieldControl {
16
+ field: FormField<boolean, T>;
17
+ options: TickableOptions<T>;
18
+ constructor(field: FormField<boolean, T>, options: TickableOptions<T>);
19
+ type: "checkbox" | "radio";
20
+ abstract getValueAttribute(ctx: Context, data: Record<string, FormDataValue>, value: T): string;
21
+ abstract isChecked(ctx: Context, data: Record<string, FormDataValue>, value: T): boolean;
22
+ makeInputID(ctx: Context, data: Record<string, FormDataValue>, value: T): string;
23
+ getWrapperClasses(ctx: Context, data: Record<string, FormDataValue>, value: T): string[];
24
+ render(fctx: FormControlContext): Promise<FlatTemplatable>;
25
+ }
@@ -0,0 +1,22 @@
1
+ import { Context } from "koa";
2
+ import { Checkbox } from "../controls/checkbox.js";
3
+ import { FormDataValue } from "../form-types.js";
4
+ import { FieldParseResult, FormField } from "./field.js";
5
+ import { FormControlContext } from "../controls/form-control.js";
6
+ export declare class Boolean<Required extends boolean> extends FormField<Required, boolean, Checkbox> {
7
+ error_message: string;
8
+ predicate: (v: unknown, w: unknown) => {
9
+ readonly match: boolean;
10
+ readonly wildcard: boolean;
11
+ };
12
+ constructor(required: Required, error_message?: string);
13
+ isValueValid(_: Context, value: boolean): Promise<{
14
+ valid: boolean;
15
+ message: string;
16
+ }>;
17
+ parse(_: Context, value: FormDataValue): Promise<FieldParseResult<boolean>>;
18
+ getEmptyValue(): boolean;
19
+ getControl(): Checkbox;
20
+ getSealiousCreateValue(fctx: FormControlContext): Promise<boolean>;
21
+ sealiousValueToForm(_: Context, value: boolean | null): Promise<FormDataValue>;
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,23 @@
1
+ import { Context } from "koa";
2
+ import { CheckboxedListInput } from "../controls/checkboxed-list-input.js";
3
+ import { FormDataValue } from "../form-types.js";
4
+ import { FieldParseResult, FormField, FormFieldValidationResponse } from "./field.js";
5
+ export type CheckboxedListItem = {
6
+ value: string;
7
+ label?: string;
8
+ group?: string;
9
+ };
10
+ export declare class CheckboxedListField<Required extends boolean, Values extends string> extends FormField<Required, Record<Values, "on">, CheckboxedListInput<Values>> {
11
+ required: Required;
12
+ generateOptions: (ctx: Context) => Promise<CheckboxedListItem[]>;
13
+ isVisible: (ctx: Context) => Promise<boolean>;
14
+ constructor(required: Required, generateOptions: (ctx: Context) => Promise<CheckboxedListItem[]>, isVisible?: (ctx: Context) => Promise<boolean>);
15
+ predicate: (v: unknown, w: unknown) => {
16
+ readonly match: boolean;
17
+ readonly wildcard: string[];
18
+ };
19
+ isValueValid(_: Context, value: unknown): Promise<FormFieldValidationResponse>;
20
+ parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<Record<string, "on">>>;
21
+ getEmptyValue(): Record<string, "on">;
22
+ getControl(): CheckboxedListInput<Values>;
23
+ }
@@ -0,0 +1,22 @@
1
+ import { Context } from "koa";
2
+ import { ExtractFieldDecoded, Field } from "sealious";
3
+ import { SimpleInput } from "../controls/controls.js";
4
+ import { FormDataValue } from "../form-types.js";
5
+ import { FieldParseResult, FormField, FormFieldValidationResponse } from "./field.js";
6
+ import { ExtractedFieldInfo } from "../../utils/extract-fields-from-collection.js";
7
+ export declare class CollectionField<F extends Field<any>, Required extends boolean> extends FormField<Required, ExtractFieldDecoded<F> | null, SimpleInput> {
8
+ sealiousField: F;
9
+ constructor(required: Required, sealiousField: F);
10
+ predicate: (v: unknown, w: unknown) => {
11
+ readonly match: true;
12
+ readonly wildcard: unknown;
13
+ };
14
+ parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<ExtractFieldDecoded<F> | null>>;
15
+ isValueValid(ctx: Context, value: ExtractFieldDecoded<F>): Promise<FormFieldValidationResponse>;
16
+ getEmptyValue(): ExtractFieldDecoded<F>;
17
+ getControl(): SimpleInput;
18
+ generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
19
+ form_field_types: string;
20
+ sealious_field: string;
21
+ }): string;
22
+ }
@@ -0,0 +1,4 @@
1
+ import { TextBasedSimpleField } from "./simple-form-field.js";
2
+ export declare class Color<Required extends boolean> extends TextBasedSimpleField<Required> {
3
+ constructor(required: Required);
4
+ }
@@ -0,0 +1,14 @@
1
+ import { Context } from "koa";
2
+ import { FormControl, FormControlContext } from "../controls/form-control.js";
3
+ import { SimpleInput } from "../controls/simple-input.js";
4
+ import { FormDataValue } from "../form-types.js";
5
+ import { FieldParseResult } from "./field.js";
6
+ import { SimpleFormField } from "./simple-form-field.js";
7
+ export declare class Coordinates<Required extends boolean, DefaultControl extends FormControl = SimpleInput> extends SimpleFormField<Required, DefaultControl, [number, number]> {
8
+ parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<[number, number]>>;
9
+ getSealiousCreateValue(fctx: FormControlContext): Promise<[number, number] | undefined>;
10
+ postSealiousCreate(): Promise<void>;
11
+ postSealiousEdit(): Promise<void>;
12
+ getControl(): DefaultControl;
13
+ getEmptyValue(): [number, number];
14
+ }
@@ -0,0 +1,13 @@
1
+ import { Context } from "koa";
2
+ import { FormControlContext } from "../controls/form-control.js";
3
+ import { SimpleInput, SimpleInputOptions } from "../controls/simple-input.js";
4
+ import { FormDataValue } from "../form-types.js";
5
+ import { FieldParseResult } from "./field.js";
6
+ import { SimpleFormField } from "./simple-form-field.js";
7
+ export declare class DateField<Required extends boolean> extends SimpleFormField<Required, SimpleInput, Date> {
8
+ constructor(required: Required);
9
+ getEmptyValue(): Date;
10
+ parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<Date>>;
11
+ getControl(): SimpleInput<SimpleInputOptions>;
12
+ getSealiousCreateValue(fctx: FormControlContext): Promise<string | null>;
13
+ }
@@ -0,0 +1,14 @@
1
+ import { Context } from "koa";
2
+ import { SimpleInput } from "../controls/controls.js";
3
+ import { FormControlContext } from "../controls/form-control.js";
4
+ import { FormDataValue } from "../form-types.js";
5
+ import { FieldParseResult } from "./field.js";
6
+ import { SimpleFormField } from "./simple-form-field.js";
7
+ export declare class DateTime<Required extends boolean> extends SimpleFormField<Required, SimpleInput, Date | null> {
8
+ constructor(required: Required);
9
+ getEmptyValue(): Date | null;
10
+ parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<Date | null>>;
11
+ getSealiousCreateValue(fctx: FormControlContext): Promise<number | null>;
12
+ getControl(): SimpleInput;
13
+ sealiousValueToForm(ctx: Context, value: number | null): Promise<FormDataValue>;
14
+ }
@@ -0,0 +1,20 @@
1
+ import { Context } from "koa";
2
+ import { CollectionItem, FieldTypes as SealiousFieldTypes } from "sealious";
3
+ import { FormDataValue, FormData } from "../form-types.js";
4
+ import { CheckboxedListField } from "./checkboxed-list.js";
5
+ import { ExtractedFieldInfo } from "../../utils/extract-fields-from-collection.js";
6
+ export declare class DeepReverseSingleReferenceList extends CheckboxedListField<false, string> {
7
+ sealious_field: SealiousFieldTypes.DeepReverseSingleReference;
8
+ item_label_getter: (item: CollectionItem<any>) => string;
9
+ constructor(sealious_field: SealiousFieldTypes.DeepReverseSingleReference);
10
+ setItemLabelGetter(getter: (item: CollectionItem<any>) => string): void;
11
+ getSealiousCreateValue(): never;
12
+ postSealiousCreate(ctx: Context, created_item: CollectionItem<any>, form_data: FormData): Promise<void>;
13
+ postSealiousEdit(ctx: Context, edited_item: CollectionItem<any>, value: FormData): Promise<void>;
14
+ sealiousValueToForm(_ctx: Context, value: string[] | null): Promise<FormDataValue>;
15
+ generateFieldDeclaration(_field_info: ExtractedFieldInfo, vars: {
16
+ form_field_types: string;
17
+ sealious_field: string;
18
+ }): string;
19
+ generateCreateValueGetter(field_info: ExtractedFieldInfo): string;
20
+ }
@@ -0,0 +1,16 @@
1
+ import { FieldTypes as SealiousFieldTypes, CollectionItem } from "sealious";
2
+ import { Table } from "./table.js";
3
+ import { Table as TableControl } from "../controls/table.js";
4
+ import { Context } from "koa";
5
+ import { FormDataValue, FormData } from "../form-types.js";
6
+ import { FormControlContext } from "../controls/form-control.js";
7
+ import { FormField } from "./field.js";
8
+ export declare class DeepReverseSingleReferenceTable extends Table<Record<string, FormField>> {
9
+ sealious_field: SealiousFieldTypes.DeepReverseSingleReference;
10
+ constructor(sealious_field: SealiousFieldTypes.DeepReverseSingleReference);
11
+ getControl(): TableControl<any>;
12
+ getSealiousCreateValue(_fctx: FormControlContext): Promise<unknown>;
13
+ postSealiousCreate(ctx: Context, created_item: CollectionItem<any>, form_data: FormData): Promise<void>;
14
+ postSealiousEdit(ctx: Context, edited_item: CollectionItem<any>, form_data: FormData): Promise<void>;
15
+ sealiousValueToForm(ctx: Context, _value: string[], item: CollectionItem<any>): Promise<FormDataValue>;
16
+ }
@@ -0,0 +1,10 @@
1
+ import { RegExpField } from "./regexp.js";
2
+ import { SimpleInput } from "../controls/controls.js";
3
+ export declare class EmailField<Required extends boolean> extends RegExpField<Required> {
4
+ error_message: string;
5
+ default_value: string;
6
+ predicate: import("@sealcode/ts-predicates").Predicate<string>;
7
+ constructor(required: Required, error_message?: string, default_value?: string);
8
+ setErrorMessage(message: string): void;
9
+ getControl(): SimpleInput;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { FieldTypes as SealiousFieldTypes } from "sealious";
2
+ import { Context } from "koa";
3
+ import { ExtractedFieldInfo } from "../../utils/extract-fields-from-collection.js";
4
+ import { CheckboxedListField } from "./checkboxed-list.js";
5
+ import { FormControlContext } from "../controls/form-control.js";
6
+ import { FormDataValue } from "../form-types.js";
7
+ export declare class EnumMultipleSealious<Values extends string> extends CheckboxedListField<boolean, Values> {
8
+ sealious_field: SealiousFieldTypes.EnumMultiple<Values>;
9
+ constructor(sealious_field: SealiousFieldTypes.EnumMultiple<Values>);
10
+ generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
11
+ form_field_types: string;
12
+ sealious_field: string;
13
+ }): string;
14
+ getSealiousCreateValue(fctx: FormControlContext): Promise<Values[]>;
15
+ sealiousValueToForm(ctx: Context, sealious_value: Values[] | null): Promise<FormDataValue>;
16
+ }
@@ -0,0 +1,6 @@
1
+ import { Field } from "sealious";
2
+ import { PickFromListField } from "./pick-from-list.js";
3
+ export declare class ExistingSealiousValue<Required extends boolean> extends PickFromListField<Required> {
4
+ constructor(required: Required, field: Field<unknown>);
5
+ getEmptyValue(): string;
6
+ }
@@ -0,0 +1,85 @@
1
+ import { Predicate, predicates } from "@sealcode/ts-predicates";
2
+ import { Context } from "koa";
3
+ import { Collection, 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 FormDisplayInfo<C extends Collection> = {
12
+ field: keyof C["fields"];
13
+ label: string;
14
+ format?: (value: unknown, item: CollectionItem<C>) => JSX.Element;
15
+ };
16
+ export type FormFieldValidationFn<ValueType> = (ctx: Context, value: ValueType, field: FormField<boolean, ValueType>) => Promise<FormFieldValidationResponse>;
17
+ export type FieldParsedValue<T> = T extends FormField<infer R> ? R : never;
18
+ export type GetPredicate<F extends FormField> = F extends FormField<true> ? F["predicate"] : F["predicate"] | typeof predicates.undefined;
19
+ export type FieldsToShape<T extends Record<string, FormField>> = {
20
+ [property in keyof T]: GetPredicate<T[property]>;
21
+ };
22
+ export declare function fieldsToShape<Fields extends Record<string, FormField>>(obj: Fields): FieldsToShape<Fields>;
23
+ export type FieldParseResult<T> = {
24
+ parsable: true;
25
+ error: null;
26
+ parsed_value: T;
27
+ } | {
28
+ parsable: false;
29
+ error: string;
30
+ parsed_value: null;
31
+ };
32
+ export declare abstract class FormField<Required extends boolean = boolean, ParsedValue = unknown, DefaultFormControl extends FormControl = FormControl, SealiousValue = any> {
33
+ readonly required: Required;
34
+ name: string;
35
+ label: string;
36
+ constructor(required: Required);
37
+ predicate: Predicate;
38
+ mapToFilter: (parsed: ParsedValue) => any;
39
+ disabled: boolean;
40
+ init(): Promise<void>;
41
+ setName(name: string): this;
42
+ setDisabled(status: boolean): this;
43
+ setLabel(label: string): this;
44
+ _validate(ctx: Context, value: ParsedValue): Promise<FormFieldValidationResponse>;
45
+ abstract getEmptyValue(): ParsedValue;
46
+ isValueValid(_ctx: Context, _value: ParsedValue): Promise<FormFieldValidationResponse>;
47
+ abstract parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<ParsedValue>>;
48
+ getParsedValue(ctx: Context, all_form_values: Record<string, FormDataValue>, validate: true): Promise<{
49
+ valid: boolean;
50
+ message: string;
51
+ parsed: ParsedValue | null;
52
+ raw: FormDataValue;
53
+ }>;
54
+ getParsedValue(ctx: Context, all_form_values: Record<string, FormDataValue>, validate?: false): Promise<{
55
+ message: string;
56
+ parsed: ParsedValue | null;
57
+ raw: FormDataValue;
58
+ }>;
59
+ setMapToFilter(fn: (parsed: ParsedValue) => unknown): this;
60
+ getDatabaseValue(ctx: Context, data: Record<string, FormDataValue>): Promise<unknown>;
61
+ abstract getControl(): DefaultFormControl;
62
+ getSealiousCreateValue(fctx: FormControlContext): Promise<SealiousValue>;
63
+ sealiousValueToForm(ctx: Context, sealiousValue: SealiousValue | null, item: CollectionItem<any>): Promise<FormDataValue>;
64
+ postSealiousCreate(ctx: Context, created_item: CollectionItem<any>, form_data: FormData): Promise<void>;
65
+ postSealiousEdit(ctx: Context, edited_item: CollectionItem<any>, form_data: FormData): Promise<void>;
66
+ generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
67
+ form_field_types: string;
68
+ sealious_field: string;
69
+ }): string;
70
+ generateCreateValueGetter(field_info: ExtractedFieldInfo, vars: {
71
+ form_field_types: string;
72
+ sealious_field: string;
73
+ form_fields: string;
74
+ }): string;
75
+ generateInitialValue(field_info: ExtractedFieldInfo, vars: {
76
+ form_field_types: string;
77
+ form_fields: string;
78
+ }): string;
79
+ generateImportsForFieldList(field_info: ExtractedFieldInfo): {
80
+ what: string;
81
+ from: string;
82
+ as?: string;
83
+ type?: boolean;
84
+ }[];
85
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
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 "./deep-reverse-single-reference-list.js";
9
+ export * from "./deep-reverse-single-reference-table.js";
10
+ export * from "./email.js";
11
+ export * from "./enum-multiple-sealious.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 "./image.js";
17
+ export * from "./int.js";
18
+ export * from "./item-draft.js";
19
+ export * from "./json.js";
20
+ export * from "./markdown.js";
21
+ export * from "./multiple-files.js";
22
+ export * from "./number.js";
23
+ export * from "./password.js";
24
+ export * from "./phone-number-with-country-code.js";
25
+ export * from "./phone-number.js";
26
+ export * from "./pick-from-list-sealious.js";
27
+ export * from "./pick-from-list.js";
28
+ export * from "./regexp.js";
29
+ export * from "./simple-form-field.js";
30
+ export * from "./single-reference.js";
31
+ export * from "./structured-array.js";
32
+ export * from "./table.js";
33
+ export * from "./text.js";
34
+ export * from "./url.js";
@@ -0,0 +1,25 @@
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> 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(): FileControl;
21
+ getSealiousCreateValue(fctx: FormControlContext): Promise<FilePointer | undefined>;
22
+ sealiousValueToForm(ctx: Context, sealiousValue: FilePointer | string | null): Promise<{
23
+ old: FilePointer | undefined;
24
+ } | Record<string, never>>;
25
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import { NumberBasedSimpleField } from "./simple-form-field.js";
2
+ export declare class Float<Required extends boolean> extends NumberBasedSimpleField<Required> {
3
+ constructor(required: Required);
4
+ }
@@ -0,0 +1,33 @@
1
+ import { Collection, 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
+ import { URLField } from "./url.js";
28
+ import { Image } from "./image.js";
29
+ import { PhoneNumberWithCountryCode } from "./phone-number-with-country-code.js";
30
+ import { ItemDraft } from "./item-draft.js";
31
+ 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 ? Image<false> : T extends SealiousFieldTypes.Int ? Int<false> : T extends SealiousFieldTypes.ItemDraft<infer C extends Collection> ? ItemDraft<C> : T extends SealiousFieldTypes.JsonObject ? JSONField<false> : T extends SealiousFieldTypes.JDD ? TextBasedSimpleField<false, SimpleInput> : T extends SealiousFieldTypes.Password ? Password<false> : T extends SealiousFieldTypes.PhoneNumber ? PhoneNumberWithCountryCode<false> : T extends SealiousFieldTypes.ReverseSingleReference ? TextBasedSimpleField<false, SimpleInput> : T extends SealiousFieldTypes.SecretToken ? TextBasedSimpleField<false, SimpleInput> : T extends SealiousFieldTypes.SettableBy<infer R> ? SealiousToFormField<R> : T extends SealiousFieldTypes.SingleReference ? SingleReference<Collection, 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 ? URLField<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>;
32
+ export declare function sealiousToFormField<SF extends SealiousField<any>>(sealious_field: SF): SealiousToFormField<SF>;
33
+ export declare function sealiousFieldInfoToFormField(field_info: ExtractedFieldInfo): Promise<FormField>;
@@ -0,0 +1,6 @@
1
+ import { Textarea } from "../controls/textarea.js";
2
+ import { TextBasedSimpleField } from "./simple-form-field.js";
3
+ export declare class HTML<Required extends boolean> extends TextBasedSimpleField<Required, Textarea> {
4
+ constructor(required: Required);
5
+ getControl(): Textarea;
6
+ }
@@ -0,0 +1,11 @@
1
+ import { Context } from "koa";
2
+ import { Hybrid as HybridControl } from "../controls/hybrid.js";
3
+ import { FormDataValue } from "../form-types.js";
4
+ import { FieldParseResult, FormField } from "./field.js";
5
+ export declare class Hybrid<Fields extends Record<string, FormField>> extends FormField<true, Record<string, unknown>> {
6
+ subfields: Fields;
7
+ constructor(subfields: Fields);
8
+ getEmptyValue(): Record<string, unknown>;
9
+ parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<Record<string, unknown>>>;
10
+ getControl(): HybridControl;
11
+ }
@@ -0,0 +1,5 @@
1
+ import { Image as ImageControl } from "../controls/image.js";
2
+ import { File as FileField } from "./file.js";
3
+ export declare class Image<Required extends boolean> extends FileField<Required> {
4
+ getControl(): ImageControl;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { FormControlContext } from "../controls/form-control.js";
2
+ import { NumberBasedSimpleField } from "./simple-form-field.js";
3
+ export declare class Int<Required extends boolean> extends NumberBasedSimpleField<Required> {
4
+ constructor(required: Required);
5
+ getSealiousCreateValue(fctx: FormControlContext): Promise<number | undefined>;
6
+ }