@sealcode/sealgen 0.18.10 → 0.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.xunit +74 -69
- package/@types/add-crud.d.sync-conflict-20250918-184311-TFDLWFG.ts +1 -0
- package/@types/builders/colors-builder.d.sync-conflict-20250918-184323-TFDLWFG.ts +10 -0
- package/@types/builders/colors-builder.d.ts +1 -1
- package/@types/builders/fonts-builder.d.sync-conflict-20250918-184322-TFDLWFG.ts +7 -0
- package/@types/builders/fonts-builder.d.ts +1 -1
- package/@types/controllers/table-add-button.d.ts +6 -0
- package/@types/controllers/table-add-button.stimulus.d.ts +6 -0
- package/@types/crud-field-snippets.d.sync-conflict-20250918-184323-TFDLWFG.ts +1 -0
- package/@types/crud-field-snippets.d.ts +1 -3
- package/@types/forms/controls/array.d.sync-conflict-20250918-184306-TFDLWFG.ts +33 -0
- package/@types/forms/controls/array.d.ts +1 -3
- package/@types/forms/controls/array.sync-conflict-20250918-222045-TFDLWFG.d.ts +33 -0
- package/@types/forms/controls/autocomplete.d.sync-conflict-20250918-222042-TFDLWFG.ts +22 -0
- package/@types/forms/controls/autocomplete.d.ts +1 -1
- package/@types/forms/controls/checkbox-group.d.sync-conflict-20250918-184319-TFDLWFG.ts +21 -0
- package/@types/forms/controls/checkbox-group.d.ts +3 -3
- package/@types/forms/controls/checkboxed-list-input.d.sync-conflict-20250918-184323-TFDLWFG.ts +21 -0
- package/@types/forms/controls/checkboxed-list-input.d.ts +3 -3
- package/@types/forms/controls/controls.d.ts +2 -2
- package/@types/forms/controls/derived-frame.d.sync-conflict-20250918-184314-TFDLWFG.ts +19 -0
- package/@types/forms/controls/derived-frame.d.ts +0 -2
- package/@types/forms/controls/dropdown.d.sync-conflict-20250918-222044-TFDLWFG.ts +30 -0
- package/@types/forms/controls/dropdown.d.ts +1 -1
- package/@types/forms/controls/file.d.sync-conflict-20250918-222045-TFDLWFG.ts +13 -0
- package/@types/forms/controls/file.d.ts +1 -2
- package/@types/forms/controls/form-control.d.sync-conflict-20250918-184322-TFDLWFG.ts +19 -0
- package/@types/forms/controls/form-control.d.sync-conflict-20250918-222046-TFDLWFG.ts +19 -0
- package/@types/forms/controls/form-control.d.ts +7 -4
- package/@types/forms/controls/image.d.ts +19 -0
- package/@types/forms/controls/image.test.d.ts +1 -0
- package/@types/forms/controls/multiple-files.d.sync-conflict-20250918-184318-TFDLWFG.ts +42 -0
- package/@types/forms/controls/multiple-files.d.ts +3 -1
- package/@types/forms/controls/multiple-images.d.ts +19 -0
- package/@types/forms/controls/number.d.sync-conflict-20250918-222046-TFDLWFG.ts +13 -0
- package/@types/forms/controls/number.d.ts +1 -1
- package/@types/forms/controls/photo.d.sync-conflict-20250918-184321-TFDLWFG.ts +19 -0
- package/@types/forms/controls/photo.d.ts +3 -5
- package/@types/forms/controls/simple-input.d.sync-conflict-20250918-184310-TFDLWFG.ts +33 -0
- package/@types/forms/controls/simple-input.d.sync-conflict-20250918-222042-TFDLWFG.ts +33 -0
- package/@types/forms/controls/simple-input.d.ts +5 -4
- package/@types/forms/controls/simple-input.sync-conflict-20250918-222045-TFDLWFG.d.ts +33 -0
- package/@types/forms/controls/single-reference.d.ts +3 -2
- package/@types/forms/controls/table.d.sync-conflict-20250918-184302-TFDLWFG.ts +39 -0
- package/@types/forms/controls/table.d.ts +8 -3
- package/@types/forms/controls/table.sync-conflict-20250918-222042-TFDLWFG.d.ts +39 -0
- package/@types/forms/controls/textarea.d.sync-conflict-20250918-222045-TFDLWFG.ts +25 -0
- package/@types/forms/controls/textarea.d.ts +3 -3
- package/@types/forms/fields/boolean.d.sync-conflict-20250918-184325-TFDLWFG.ts +22 -0
- package/@types/forms/fields/boolean.d.ts +6 -1
- package/@types/forms/fields/boolean.sync-conflict-20250918-222042-TFDLWFG.d.ts +22 -0
- package/@types/forms/fields/checkboxed-list.d.sync-conflict-20250918-184325-TFDLWFG.ts +23 -0
- package/@types/forms/fields/checkboxed-list.d.ts +3 -1
- package/@types/forms/fields/collection-field.d.sync-conflict-20250918-184319-TFDLWFG.ts +22 -0
- package/@types/forms/fields/collection-field.d.sync-conflict-20250918-222047-TFDLWFG.ts +22 -0
- package/@types/forms/fields/collection-field.d.ts +8 -1
- package/@types/forms/fields/color.d.ts +4 -0
- package/@types/forms/fields/coordinates.d.sync-conflict-20250918-222044-TFDLWFG.ts +14 -0
- package/@types/forms/fields/coordinates.d.ts +14 -0
- package/@types/forms/fields/date.d.ts +13 -0
- package/@types/forms/fields/datetime.d.sync-conflict-20250918-222050-TFDLWFG.ts +4 -0
- package/@types/forms/fields/datetime.d.ts +14 -0
- package/@types/forms/fields/deep-reverse-single-reference-list.d.ts +20 -0
- package/@types/forms/fields/deep-reverse-single-reference-table.d.ts +16 -0
- package/@types/forms/fields/email.d.sync-conflict-20250918-184303-TFDLWFG.ts +8 -0
- package/@types/forms/fields/email.d.ts +3 -0
- package/@types/forms/fields/enum-multiple-sealious.d.ts +16 -0
- package/@types/forms/fields/enum-multiple-sealious.sync-conflict-20250918-222047-TFDLWFG.d.ts +16 -0
- package/@types/forms/fields/field.d.sync-conflict-20250918-184306-TFDLWFG.ts +70 -0
- package/@types/forms/fields/field.d.ts +37 -5
- package/@types/forms/fields/fields.d.sync-conflict-20250918-184314-TFDLWFG.ts +29 -0
- package/@types/forms/fields/fields.d.ts +23 -8
- package/@types/forms/fields/file.d.sync-conflict-20250918-184310-TFDLWFG.ts +23 -0
- package/@types/forms/fields/file.d.sync-conflict-20250918-222046-TFDLWFG.ts +23 -0
- package/@types/forms/fields/file.d.ts +11 -5
- package/@types/forms/fields/file.sync-conflict-20250918-222049-TFDLWFG.d.ts +23 -0
- package/@types/forms/fields/float.d.ts +4 -0
- package/@types/forms/fields/get-field-for-sealious.d.sync-conflict-20250918-222046-TFDLWFG.ts +29 -0
- package/@types/forms/fields/get-field-for-sealious.d.ts +31 -0
- package/@types/forms/fields/get-field-for-sealious.sync-conflict-20250918-222042-TFDLWFG.d.ts +29 -0
- package/@types/forms/fields/html.d.ts +6 -0
- package/@types/forms/fields/image.d.sync-conflict-20250918-222042-TFDLWFG.ts +5 -0
- package/@types/forms/fields/image.d.ts +5 -0
- package/@types/forms/fields/int.d.ts +6 -0
- package/@types/forms/fields/json.d.ts +13 -0
- package/@types/forms/fields/markdown.d.ts +6 -0
- package/@types/forms/fields/multiple-files.d.sync-conflict-20250918-184304-TFDLWFG.ts +16 -0
- package/@types/forms/fields/multiple-files.d.ts +3 -1
- package/@types/forms/fields/number.d.sync-conflict-20250918-184317-TFDLWFG.ts +25 -0
- package/@types/forms/fields/number.d.sync-conflict-20250918-222047-TFDLWFG.ts +25 -0
- package/@types/forms/fields/number.d.ts +3 -1
- package/@types/forms/fields/password.d.ts +5 -0
- package/@types/forms/fields/pick-from-list-sealious.d.ts +11 -0
- package/@types/forms/fields/pick-from-list.d.sync-conflict-20250918-184322-TFDLWFG.ts +15 -0
- package/@types/forms/fields/pick-from-list.d.ts +4 -3
- package/@types/forms/fields/proxy-field.d.sync-conflict-20250918-184307-TFDLWFG.ts +15 -0
- package/@types/forms/fields/proxy-field.d.ts +3 -1
- package/@types/forms/fields/regexp.d.sync-conflict-20250918-184305-TFDLWFG.ts +21 -0
- package/@types/forms/fields/regexp.d.sync-conflict-20250918-222045-TFDLWFG.ts +21 -0
- package/@types/forms/fields/regexp.d.ts +6 -1
- package/@types/forms/fields/regexp.sync-conflict-20250918-222047-TFDLWFG.d.ts +21 -0
- package/@types/forms/fields/simple-form-field.d.sync-conflict-20250918-184309-TFDLWFG.ts +29 -0
- package/@types/forms/fields/simple-form-field.d.sync-conflict-20250918-222044-TFDLWFG.ts +29 -0
- package/@types/forms/fields/simple-form-field.d.ts +23 -3
- package/@types/forms/fields/simple-form-field.sync-conflict-20250918-222049-TFDLWFG.d.ts +29 -0
- package/@types/forms/fields/single-reference.d.ts +19 -0
- package/@types/forms/fields/single-reference.sync-conflict-20250918-222043-TFDLWFG.d.ts +10 -0
- package/@types/forms/fields/structured-array.d.sync-conflict-20250918-184302-TFDLWFG.ts +27 -0
- package/@types/forms/fields/structured-array.d.sync-conflict-20250918-222049-TFDLWFG.ts +27 -0
- package/@types/forms/fields/structured-array.d.ts +19 -10
- package/@types/forms/fields/structured-array.sync-conflict-20250918-222047-TFDLWFG.d.ts +27 -0
- package/@types/forms/fields/table.d.sync-conflict-20250918-184303-TFDLWFG.ts +16 -0
- package/@types/forms/fields/table.d.ts +3 -0
- package/@types/forms/fields/text.d.ts +6 -0
- package/@types/forms/fields/url.d.ts +6 -0
- package/@types/forms/form-types.d.sync-conflict-20250918-222045-TFDLWFG.ts +26 -0
- package/@types/forms/form-types.d.ts +2 -0
- package/@types/forms/form.d.sync-conflict-20250918-184315-TFDLWFG.ts +32 -0
- package/@types/forms/form.d.sync-conflict-20250918-222049-TFDLWFG.ts +32 -0
- package/@types/forms/form.d.ts +10 -8
- package/@types/forms/form.sync-conflict-20250918-222049-TFDLWFG.d.ts +33 -0
- package/@types/forms/form.test.d.sync-conflict-20250918-184318-TFDLWFG.ts +6 -0
- package/@types/forms/form.test.d.sync-conflict-20250918-222047-TFDLWFG.ts +6 -0
- package/@types/forms/form.test.d.ts +2 -2
- package/@types/forms/multiform.d.sync-conflict-20250918-184308-TFDLWFG.ts +23 -0
- package/@types/forms/multiform.d.ts +1 -2
- package/@types/forms/multiform.sync-conflict-20250918-222044-TFDLWFG.d.ts +23 -0
- package/@types/index.d.sync-conflict-20250918-184316-TFDLWFG.ts +46 -0
- package/@types/index.d.ts +2 -2
- package/@types/mount.d.sync-conflict-20250918-184320-TFDLWFG.ts +6 -0
- package/@types/mount.d.ts +0 -1
- package/@types/page/list.d.sync-conflict-20250918-184318-TFDLWFG.ts +48 -0
- package/@types/page/list.d.sync-conflict-20250918-222046-TFDLWFG.ts +48 -0
- package/@types/page/list.d.ts +2 -2
- package/@types/page/list.sync-conflict-20250918-222048-TFDLWFG.d.ts +48 -0
- package/@types/page/mountable-with-fields.d.sync-conflict-20250918-184321-TFDLWFG.ts +42 -0
- package/@types/page/mountable-with-fields.d.sync-conflict-20250918-222046-TFDLWFG.ts +42 -0
- package/@types/page/mountable-with-fields.d.ts +3 -3
- package/@types/page/mountable-with-fields.sync-conflict-20250918-222044-TFDLWFG.d.ts +42 -0
- package/@types/page/mountable.d.sync-conflict-20250918-184306-TFDLWFG.ts +10 -0
- package/@types/page/mountable.d.ts +0 -1
- package/@types/page/page.d.sync-conflict-20250918-184320-TFDLWFG.ts +18 -0
- package/@types/page/page.d.ts +0 -1
- package/@types/page/props-parser.d.sync-conflict-20250918-184305-TFDLWFG.ts +15 -0
- package/@types/page/props-parser.d.ts +0 -1
- package/@types/page/stateful-page.d.sync-conflict-20250918-184326-TFDLWFG.ts +62 -0
- package/@types/page/stateful-page.d.ts +0 -1
- package/@types/register-external.d.ts +2 -2
- package/@types/templates/form.d.ts +1 -3
- package/@types/templates/jdd-component.d.ts +1 -1
- package/@types/templates/page.d.ts +1 -1
- package/@types/templates/shared/shared-crud-form-fields.d.sync-conflict-20250918-184306-TFDLWFG.ts +1 -0
- package/@types/templates/shared/shared-crud-form-fields.d.ts +1 -68
- package/@types/templates/templates.d.ts +1 -21
- package/@types/test_utils/test-on-real-app.d.sync-conflict-20250918-184320-TFDLWFG.ts +26 -0
- package/@types/test_utils/test-on-real-app.d.ts +0 -1
- package/@types/utils/extract-fields-from-collection.d.sync-conflict-20250918-184312-TFDLWFG.ts +18 -0
- package/@types/utils/extract-fields-from-collection.d.ts +5 -1
- package/@types/utils/extract-fields-from-collection.sync-conflict-20250918-222045-TFDLWFG.d.ts +18 -0
- package/@types/utils/wrap-attributes.d.ts +3 -0
- package/README.md +5 -0
- package/assets/file-icon.svg +5 -0
- package/eslint.config.mjs +56 -0
- package/lib/add-crud.js +77 -89
- package/lib/add-jdd-component.js +3 -3
- package/lib/add-list-route.test.js +1 -1
- package/lib/add-route.js +2 -9
- package/lib/build.js +6 -4
- package/lib/builders/backend-ts-builder.js +0 -1
- package/lib/builders/colors-builder.js +11 -8
- package/lib/builders/fonts-builder.js +0 -1
- package/lib/builders/frontend-ts-builder.js +0 -1
- package/lib/cli.js +4 -7
- package/lib/components/tabs.js +36 -36
- package/lib/controllers/table-add-button.stimulus.js +35 -0
- package/lib/esbuild-plugins/rewrite-asset-imports.js +7 -10
- package/lib/forms/controls/array.js +25 -22
- package/lib/forms/controls/big-radio-group.js +2 -2
- package/lib/forms/controls/checkbox-group.js +7 -7
- package/lib/forms/controls/checkboxed-list-input.js +7 -1
- package/lib/forms/controls/checkboxed-list-input.test.js +6 -6
- package/lib/forms/controls/controls.js +2 -2
- package/lib/forms/controls/derived-frame.js +8 -4
- package/lib/forms/controls/derived.js +1 -1
- package/lib/forms/controls/dropdown.js +5 -3
- package/lib/forms/controls/editable-collection-subset.js +2 -2
- package/lib/forms/controls/file.js +26 -2
- package/lib/forms/controls/file.test.js +2 -2
- package/lib/forms/controls/form-control.js +1 -1
- package/lib/forms/controls/hidden-input.js +4 -1
- package/lib/forms/controls/{photo.js → image.js} +6 -7
- package/lib/forms/controls/{photo.test.js → image.test.js} +8 -23
- package/lib/forms/controls/multiple-files.js +10 -1
- package/lib/forms/controls/{multiple-photos.js → multiple-images.js} +3 -3
- package/lib/forms/controls/simple-input.js +13 -12
- package/lib/forms/controls/single-reference.js +4 -0
- package/lib/forms/controls/single-reference.test.js +1 -1
- package/lib/forms/controls/table.js +62 -25
- package/lib/forms/controls/textarea.js +5 -3
- package/lib/forms/controls/tickable.js +13 -5
- package/lib/forms/fields/boolean.js +14 -0
- package/lib/forms/fields/checkboxed-list.js +4 -0
- package/lib/forms/fields/collection-field.js +9 -0
- package/lib/forms/fields/color.js +10 -0
- package/lib/forms/fields/coordinates.js +49 -0
- package/lib/forms/fields/date.js +34 -0
- package/lib/forms/fields/datetime.js +46 -0
- package/lib/forms/fields/deep-reverse-single-reference-list.js +81 -0
- package/lib/forms/fields/deep-reverse-single-reference-table.js +122 -0
- package/lib/forms/fields/email.js +7 -0
- package/lib/forms/fields/enum-multiple-sealious.js +32 -0
- package/lib/forms/fields/field.js +32 -4
- package/lib/forms/fields/field.test.js +8 -8
- package/lib/forms/fields/fields.js +23 -8
- package/lib/forms/fields/file.js +33 -9
- package/lib/forms/fields/file.test.js +5 -17
- package/lib/forms/fields/float.js +10 -0
- package/lib/forms/fields/get-field-for-sealious.js +213 -0
- package/lib/forms/fields/html.js +14 -0
- package/lib/forms/fields/image.js +13 -0
- package/lib/forms/fields/int.js +23 -0
- package/lib/forms/fields/json.js +31 -0
- package/lib/forms/fields/markdown.js +14 -0
- package/lib/forms/fields/multiple-files.js +4 -0
- package/lib/forms/fields/number.js +6 -0
- package/lib/forms/fields/password.js +13 -0
- package/lib/forms/fields/pick-from-list-sealious.js +17 -0
- package/lib/forms/fields/pick-from-list.js +6 -2
- package/lib/forms/fields/proxy-field.js +3 -0
- package/lib/forms/fields/regexp.js +14 -0
- package/lib/forms/fields/simple-form-field.js +61 -2
- package/lib/forms/fields/single-reference.js +44 -0
- package/lib/forms/fields/structured-array.js +61 -12
- package/lib/forms/fields/table.js +29 -2
- package/lib/forms/fields/text.js +17 -0
- package/lib/forms/fields/url.js +17 -0
- package/lib/forms/form.js +30 -14
- package/lib/forms/form.test.js +5 -7
- package/lib/forms/multiform.js +10 -9
- package/lib/forms/multiform.test.js +5 -5
- package/lib/generate-collections.js +2 -3
- package/lib/generate-components.js +2 -3
- package/lib/generate-routes.js +3 -5
- package/lib/generate-routes.test.js +7 -16
- package/lib/generate-stimulus.js +4 -4
- package/lib/get-fonts.js +29 -27
- package/lib/index.js +1 -0
- package/lib/make-env.js +1 -1
- package/lib/make-hidden-inputs.js +4 -4
- package/lib/mount.js +11 -1
- package/lib/notifier.js +3 -4
- package/lib/page/list.js +20 -15
- package/lib/page/mountable-with-fields.js +14 -6
- package/lib/page/mountable-with-fields.test.js +1 -1
- package/lib/page/mountable.js +0 -1
- package/lib/page/page.js +0 -1
- package/lib/register-external.js +4 -4
- package/lib/templates/form.js +9 -10
- package/lib/templates/jdd-component.js +1 -1
- package/lib/templates/jdd-editor.js +1 -1
- package/lib/templates/multiform.js +4 -4
- package/lib/templates/page.js +1 -3
- package/lib/templates/shared/collection-create-form.js +31 -44
- package/lib/templates/shared/collection-edit-form.js +43 -81
- package/lib/templates/shared/collection-list.js +13 -21
- package/lib/templates/shared/shared-crud-form-fields.js +28 -98
- package/lib/test_utils/exec_async.js +3 -3
- package/lib/test_utils/test-on-real-app.js +12 -14
- package/lib/utils/extract-fields-from-collection.js +60 -20
- package/lib/utils/make-slug.js +1 -1
- package/lib/utils/wrap-attributes.js +20 -0
- package/lib/utils/write-file.js +1 -1
- package/package.json +11 -9
- package/src/add-collection.ts +1 -3
- package/src/add-crud.ts +84 -100
- package/src/add-jdd-component.ts +4 -5
- package/src/add-list-route.test.ts +1 -1
- package/src/add-route.ts +3 -13
- package/src/build.ts +6 -4
- package/src/builders/backend-ts-builder.ts +0 -1
- package/src/builders/builder.ts +4 -1
- package/src/builders/colors-builder.ts +11 -9
- package/src/builders/css-builder.ts +4 -1
- package/src/builders/fonts-builder.ts +0 -1
- package/src/builders/frontend-ts-builder.ts +0 -1
- package/src/cli.ts +5 -7
- package/src/components/tabs.ts +38 -37
- package/src/components/toggle-modal.ts +1 -1
- package/src/controllers/table-add-button.stimulus.ts +35 -0
- package/src/esbuild-plugins/rewrite-asset-imports.ts +7 -10
- package/src/forms/controls/array.ts +35 -36
- package/src/forms/controls/autocomplete.ts +2 -2
- package/src/forms/controls/big-radio-group.ts +4 -4
- package/src/forms/controls/checkbox-group.ts +10 -10
- package/src/forms/controls/checkboxed-list-input.test.ts +6 -6
- package/src/forms/controls/checkboxed-list-input.ts +16 -8
- package/src/forms/controls/controls.ts +2 -2
- package/src/forms/controls/derived-frame.ts +16 -11
- package/src/forms/controls/derived.ts +7 -6
- package/src/forms/controls/dropdown.ts +13 -13
- package/src/forms/controls/editable-collection-subset.ts +4 -3
- package/src/forms/controls/field-group.ts +1 -1
- package/src/forms/controls/file.test.ts +4 -2
- package/src/forms/controls/file.ts +30 -7
- package/src/forms/controls/form-control.ts +8 -3
- package/src/forms/controls/hidden-input.ts +5 -1
- package/src/forms/controls/html.ts +1 -0
- package/src/forms/controls/{photo.test.ts → image.test.ts} +7 -24
- package/src/forms/controls/{photo.ts → image.ts} +4 -6
- package/src/forms/controls/multiple-files.ts +23 -8
- package/src/forms/controls/{multiple-photos.ts → multiple-images.ts} +2 -2
- package/src/forms/controls/number.ts +1 -1
- package/src/forms/controls/simple-input.ts +21 -33
- package/src/forms/controls/single-reference.test.ts +1 -1
- package/src/forms/controls/single-reference.ts +11 -3
- package/src/forms/controls/table.ts +87 -33
- package/src/forms/controls/textarea.ts +7 -5
- package/src/forms/controls/tickable.ts +13 -7
- package/src/forms/fields/boolean.ts +27 -2
- package/src/forms/fields/checkboxed-list.ts +11 -2
- package/src/forms/fields/collection-field.ts +21 -3
- package/src/forms/fields/color.ts +9 -0
- package/src/forms/fields/coordinates.ts +66 -0
- package/src/forms/fields/date.ts +50 -0
- package/src/forms/fields/datetime.ts +66 -0
- package/src/forms/fields/deep-reverse-single-reference-list.ts +130 -0
- package/src/forms/fields/deep-reverse-single-reference-table.ts +213 -0
- package/src/forms/fields/email.ts +10 -1
- package/src/forms/fields/enum-multiple-sealious.ts +48 -0
- package/src/forms/fields/existing-sealious-value.ts +1 -1
- package/src/forms/fields/field.test.ts +8 -8
- package/src/forms/fields/field.ts +98 -11
- package/src/forms/fields/fields.ts +23 -8
- package/src/forms/fields/file.test.ts +5 -17
- package/src/forms/fields/file.ts +44 -16
- package/src/forms/fields/float.ts +9 -0
- package/src/forms/fields/get-field-for-sealious.ts +337 -0
- package/src/forms/fields/html.ts +15 -0
- package/src/forms/fields/image.ts +12 -0
- package/src/forms/fields/int.ts +25 -0
- package/src/forms/fields/json.ts +48 -0
- package/src/forms/fields/markdown.ts +15 -0
- package/src/forms/fields/multiple-files.ts +10 -1
- package/src/forms/fields/number.ts +10 -3
- package/src/forms/fields/password.ts +13 -0
- package/src/forms/fields/pick-from-list-sealious.ts +22 -0
- package/src/forms/fields/pick-from-list.ts +8 -4
- package/src/forms/fields/proxy-field.ts +7 -1
- package/src/forms/fields/regexp.ts +27 -1
- package/src/forms/fields/simple-form-field.ts +103 -7
- package/src/forms/fields/single-reference.ts +62 -0
- package/src/forms/fields/structured-array.ts +111 -18
- package/src/forms/fields/table.ts +39 -16
- package/src/forms/fields/text.ts +18 -0
- package/src/forms/fields/url.ts +20 -0
- package/src/forms/form-types.ts +5 -4
- package/src/forms/form.test.ts +5 -7
- package/src/forms/form.ts +42 -23
- package/src/forms/forms.css +0 -85
- package/src/forms/multiform.test.ts +9 -9
- package/src/forms/multiform.ts +12 -10
- package/src/generate-collections.ts +2 -3
- package/src/generate-components.ts +2 -3
- package/src/generate-routes.test.ts +7 -16
- package/src/generate-routes.ts +6 -10
- package/src/generate-stimulus.ts +4 -5
- package/src/get-fonts.ts +32 -30
- package/src/index.ts +2 -1
- package/src/make-env.ts +1 -1
- package/src/make-hidden-inputs.ts +8 -7
- package/src/mount.ts +16 -7
- package/src/notifier.ts +4 -7
- package/src/page/default-list-filters.ts +1 -0
- package/src/page/list.ts +33 -28
- package/src/page/mountable-with-fields.test.ts +1 -1
- package/src/page/mountable-with-fields.ts +21 -12
- package/src/page/mountable.ts +0 -1
- package/src/page/page.ts +2 -3
- package/src/page/props-parser.ts +1 -1
- package/src/page/sealious-list.ts +1 -1
- package/src/page/stateful-page.ts +6 -10
- package/src/register-external.ts +5 -5
- package/src/templates/form.ts +9 -11
- package/src/templates/jdd-component.ts +1 -1
- package/src/templates/jdd-editor.ts +2 -4
- package/src/templates/list.ts +0 -1
- package/src/templates/multiform.ts +4 -4
- package/src/templates/page.ts +1 -6
- package/src/templates/shared/collection-create-form.ts +34 -71
- package/src/templates/shared/collection-edit-form.ts +46 -108
- package/src/templates/shared/collection-list.ts +13 -21
- package/src/templates/shared/item-delete.ts +0 -1
- package/src/templates/shared/shared-crud-form-fields.ts +38 -177
- package/src/templates/templates.ts +5 -1
- package/src/test_utils/exec_async.ts +3 -4
- package/src/test_utils/test-on-real-app.ts +13 -14
- package/src/utils/browser-creator.js +0 -1
- package/src/utils/exec.ts +0 -1
- package/src/utils/extract-fields-from-collection.ts +76 -25
- package/src/utils/input-wrapper.ts +1 -1
- package/src/utils/make-slug.ts +1 -1
- package/src/utils/wrap-attributes.ts +17 -0
- package/src/utils/write-file.ts +1 -1
- package/.eslintrc.cjs +0 -39
- package/lib/add-verbose-crud.js +0 -119
- package/lib/crud-field-snippets.js +0 -52
- package/lib/find-css-includes.js +0 -3
- package/lib/forms/controls/reverse-single-reference.js +0 -1
- package/lib/forms/fields/enum-multiple.js +0 -47
- package/lib/forms/fields/enum-multiple.test.js +0 -27
- package/lib/forms/fields/enum.js +0 -41
- package/lib/forms/fields/enum.test.js +0 -21
- package/lib/forms/fields/reverse-single-reference.js +0 -17
- package/lib/templates/shared/handlers/boolean.js +0 -14
- package/lib/templates/shared/handlers/date.js +0 -8
- package/lib/templates/shared/handlers/deep-reverse-single-reference.js +0 -209
- package/lib/templates/shared/handlers/default.js +0 -49
- package/lib/templates/shared/handlers/enum.js +0 -19
- package/lib/templates/shared/handlers/file.js +0 -23
- package/lib/templates/shared/handlers/image.js +0 -32
- package/lib/templates/shared/handlers/int.js +0 -11
- package/lib/templates/shared/handlers/jdd.js +0 -10
- package/lib/templates/shared/handlers/single-reference.js +0 -12
- package/lib/templates/shared/handlers/structured-array.js +0 -33
- package/src/add-verbose-crud.ts +0 -138
- package/src/crud-field-snippets.ts +0 -57
- package/src/find-css-includes.ts +0 -3
- package/src/forms/controls/reverse-single-reference.ts +0 -50
- package/src/forms/fields/enum-multiple.test.ts +0 -31
- package/src/forms/fields/enum-multiple.ts +0 -62
- package/src/forms/fields/enum.test.ts +0 -25
- package/src/forms/fields/enum.ts +0 -56
- package/src/forms/fields/reverse-single-reference.ts +0 -20
- package/src/templates/shared/handlers/boolean.ts +0 -18
- package/src/templates/shared/handlers/date.ts +0 -12
- package/src/templates/shared/handlers/deep-reverse-single-reference.ts +0 -244
- package/src/templates/shared/handlers/default.ts +0 -64
- package/src/templates/shared/handlers/enum.ts +0 -23
- package/src/templates/shared/handlers/file.ts +0 -27
- package/src/templates/shared/handlers/image.ts +0 -45
- package/src/templates/shared/handlers/int.ts +0 -15
- package/src/templates/shared/handlers/jdd.ts +0 -14
- package/src/templates/shared/handlers/single-reference.ts +0 -16
- package/src/templates/shared/handlers/structured-array.ts +0 -42
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Context } from "koa";
|
|
2
|
+
import { CheckboxedListInput } from "../controls/checkboxed-list-input.js";
|
|
2
3
|
import { FormDataValue } from "../form-types.js";
|
|
3
4
|
import { FieldParseResult, FormField, FormFieldValidationResponse } from "./field.js";
|
|
4
5
|
export type CheckboxedListItem = {
|
|
@@ -6,7 +7,7 @@ export type CheckboxedListItem = {
|
|
|
6
7
|
label?: string;
|
|
7
8
|
group?: string;
|
|
8
9
|
};
|
|
9
|
-
export declare class CheckboxedListField<Required extends boolean> extends FormField<Required, Record<
|
|
10
|
+
export declare class CheckboxedListField<Required extends boolean, Values extends string> extends FormField<Required, Record<Values, "on">, CheckboxedListInput<Values>> {
|
|
10
11
|
required: Required;
|
|
11
12
|
generateOptions: (ctx: Context) => Promise<CheckboxedListItem[]>;
|
|
12
13
|
isVisible: (ctx: Context) => Promise<boolean>;
|
|
@@ -18,4 +19,5 @@ export declare class CheckboxedListField<Required extends boolean> extends FormF
|
|
|
18
19
|
isValueValid(_: Context, value: unknown): Promise<FormFieldValidationResponse>;
|
|
19
20
|
parse(_: Context, raw_value: FormDataValue): Promise<FieldParseResult<Record<string, "on">>>;
|
|
20
21
|
getEmptyValue(): Record<string, "on">;
|
|
22
|
+
getControl(): CheckboxedListInput<Values>;
|
|
21
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<unknown>> {
|
|
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<unknown>;
|
|
18
|
+
generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
|
|
19
|
+
form_field_types: string;
|
|
20
|
+
sealious_field: string;
|
|
21
|
+
}): string;
|
|
22
|
+
}
|
|
@@ -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<unknown>> {
|
|
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<unknown>;
|
|
18
|
+
generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
|
|
19
|
+
form_field_types: string;
|
|
20
|
+
sealious_field: string;
|
|
21
|
+
}): string;
|
|
22
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Context } from "koa";
|
|
2
2
|
import { ExtractFieldDecoded, Field } from "sealious";
|
|
3
|
+
import { SimpleInput } from "../controls/controls.js";
|
|
3
4
|
import { FormDataValue } from "../form-types.js";
|
|
4
5
|
import { FieldParseResult, FormField, FormFieldValidationResponse } from "./field.js";
|
|
5
|
-
|
|
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> {
|
|
6
8
|
sealiousField: F;
|
|
7
9
|
constructor(required: Required, sealiousField: F);
|
|
8
10
|
predicate: (v: unknown, w: unknown) => {
|
|
@@ -12,4 +14,9 @@ export declare class CollectionField<F extends Field<any>, Required extends bool
|
|
|
12
14
|
parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<ExtractFieldDecoded<F> | null>>;
|
|
13
15
|
isValueValid(ctx: Context, value: ExtractFieldDecoded<F>): Promise<FormFieldValidationResponse>;
|
|
14
16
|
getEmptyValue(): ExtractFieldDecoded<F>;
|
|
17
|
+
getControl(): SimpleInput;
|
|
18
|
+
generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
|
|
19
|
+
form_field_types: string;
|
|
20
|
+
sealious_field: string;
|
|
21
|
+
}): string;
|
|
15
22
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context } from "koa";
|
|
2
|
+
import { FormControl, FormControlContext } from "../controls/form-control.js";
|
|
3
|
+
import { SimpleInput } from "../controls/simple-input.js";
|
|
4
|
+
import { FormDataValue } from "../form-types.js";
|
|
5
|
+
import { FieldParseResult } from "./field.js";
|
|
6
|
+
import { SimpleFormField } from "./simple-form-field.js";
|
|
7
|
+
export declare class Coordinates<Required extends boolean, DefaultControl extends FormControl = SimpleInput<[number, number] | null>> 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,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,8 @@
|
|
|
1
|
+
import { RegExpField } from "./regexp.js";
|
|
2
|
+
export declare class EmailField<Required extends boolean> extends RegExpField<Required> {
|
|
3
|
+
error_message: string;
|
|
4
|
+
default_value: string;
|
|
5
|
+
predicate: import("@sealcode/ts-predicates").Predicate<string>;
|
|
6
|
+
constructor(required: Required, error_message?: string, default_value?: string);
|
|
7
|
+
setErrorMessage(message: string): void;
|
|
8
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { RegExpField } from "./regexp.js";
|
|
2
|
+
import { SimpleInput } from "../controls/controls.js";
|
|
2
3
|
export declare class EmailField<Required extends boolean> extends RegExpField<Required> {
|
|
3
4
|
error_message: string;
|
|
4
5
|
default_value: string;
|
|
5
6
|
predicate: import("@sealcode/ts-predicates").Predicate<string>;
|
|
6
7
|
constructor(required: Required, error_message?: string, default_value?: string);
|
|
8
|
+
setErrorMessage(message: string): void;
|
|
9
|
+
getControl(): SimpleInput;
|
|
7
10
|
}
|
|
@@ -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,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,70 @@
|
|
|
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,10 +1,18 @@
|
|
|
1
1
|
import { Predicate, predicates } from "@sealcode/ts-predicates";
|
|
2
2
|
import { Context } from "koa";
|
|
3
|
-
import {
|
|
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";
|
|
4
7
|
export type FormFieldValidationResponse = {
|
|
5
8
|
valid: boolean;
|
|
6
9
|
message: string;
|
|
7
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
|
+
};
|
|
8
16
|
export type FormFieldValidationFn<ValueType> = (ctx: Context, value: ValueType, field: FormField<boolean, ValueType>) => Promise<FormFieldValidationResponse>;
|
|
9
17
|
export type FieldParsedValue<T> = T extends FormField<infer R> ? R : never;
|
|
10
18
|
export type GetPredicate<F extends FormField> = F extends FormField<true> ? F["predicate"] : F["predicate"] | typeof predicates.undefined;
|
|
@@ -21,28 +29,52 @@ export type FieldParseResult<T> = {
|
|
|
21
29
|
error: string;
|
|
22
30
|
parsed_value: null;
|
|
23
31
|
};
|
|
24
|
-
export declare abstract class FormField<Required extends boolean = boolean, ParsedValue = unknown> {
|
|
32
|
+
export declare abstract class FormField<Required extends boolean = boolean, ParsedValue = unknown, DefaultFormControl extends FormControl = FormControl, SealiousValue = any> {
|
|
25
33
|
readonly required: Required;
|
|
26
34
|
name: string;
|
|
27
35
|
constructor(required: Required);
|
|
28
36
|
predicate: Predicate;
|
|
29
37
|
mapToFilter: (parsed: ParsedValue) => unknown;
|
|
30
|
-
init(
|
|
38
|
+
init(): Promise<void>;
|
|
39
|
+
setName(name: string): this;
|
|
31
40
|
_validate(ctx: Context, value: ParsedValue): Promise<FormFieldValidationResponse>;
|
|
32
41
|
abstract getEmptyValue(): ParsedValue;
|
|
33
42
|
isValueValid(_ctx: Context, _value: ParsedValue): Promise<FormFieldValidationResponse>;
|
|
34
43
|
abstract parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<ParsedValue>>;
|
|
35
|
-
|
|
44
|
+
getParsedValue(ctx: Context, all_form_values: Record<string, FormDataValue>, validate: true): Promise<{
|
|
36
45
|
valid: boolean;
|
|
37
46
|
message: string;
|
|
38
47
|
parsed: ParsedValue | null;
|
|
39
48
|
raw: FormDataValue;
|
|
40
49
|
}>;
|
|
41
|
-
|
|
50
|
+
getParsedValue(ctx: Context, all_form_values: Record<string, FormDataValue>, validate?: false): Promise<{
|
|
42
51
|
message: string;
|
|
43
52
|
parsed: ParsedValue | null;
|
|
44
53
|
raw: FormDataValue;
|
|
45
54
|
}>;
|
|
46
55
|
setMapToFilter(fn: (parsed: ParsedValue) => unknown): this;
|
|
47
56
|
getDatabaseValue(ctx: Context, data: Record<string, FormDataValue>): Promise<unknown>;
|
|
57
|
+
abstract getControl(): DefaultFormControl;
|
|
58
|
+
getSealiousCreateValue(fctx: FormControlContext): Promise<SealiousValue>;
|
|
59
|
+
sealiousValueToForm(ctx: Context, sealiousValue: SealiousValue | null, item: CollectionItem<any>): Promise<FormDataValue>;
|
|
60
|
+
postSealiousCreate(ctx: Context, created_item: CollectionItem<any>, form_data: FormData): Promise<void>;
|
|
61
|
+
postSealiousEdit(ctx: Context, edited_item: CollectionItem<any>, form_data: FormData): Promise<void>;
|
|
62
|
+
generateFieldDeclaration(field_info: ExtractedFieldInfo, vars: {
|
|
63
|
+
form_field_types: string;
|
|
64
|
+
sealious_field: string;
|
|
65
|
+
}): string;
|
|
66
|
+
generateCreateValueGetter(field_info: ExtractedFieldInfo, vars: {
|
|
67
|
+
form_field_types: string;
|
|
68
|
+
sealious_field: string;
|
|
69
|
+
form_fields: string;
|
|
70
|
+
}): string;
|
|
71
|
+
generateInitialValue(field_info: ExtractedFieldInfo, vars: {
|
|
72
|
+
form_field_types: string;
|
|
73
|
+
form_fields: string;
|
|
74
|
+
}): string;
|
|
75
|
+
generateImportsForFieldList(field_info: ExtractedFieldInfo): {
|
|
76
|
+
what: string;
|
|
77
|
+
from: string;
|
|
78
|
+
as?: string;
|
|
79
|
+
}[];
|
|
48
80
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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,16 +1,31 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./boolean.js";
|
|
2
2
|
export * from "./checkboxed-list.js";
|
|
3
3
|
export * from "./collection-field.js";
|
|
4
|
-
export * from "./
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./
|
|
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";
|
|
7
10
|
export * from "./email.js";
|
|
8
|
-
export * from "./enum.js";
|
|
9
|
-
export * from "./boolean.js";
|
|
10
|
-
export * from "./enum-multiple.js";
|
|
11
|
+
export * from "./enum-multiple-sealious.js";
|
|
11
12
|
export * from "./existing-sealious-value.js";
|
|
12
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 "./json.js";
|
|
19
|
+
export * from "./markdown.js";
|
|
13
20
|
export * from "./multiple-files.js";
|
|
14
|
-
export * from "./
|
|
21
|
+
export * from "./number.js";
|
|
22
|
+
export * from "./password.js";
|
|
23
|
+
export * from "./pick-from-list-sealious.js";
|
|
24
|
+
export * from "./pick-from-list.js";
|
|
25
|
+
export * from "./regexp.js";
|
|
26
|
+
export * from "./simple-form-field.js";
|
|
27
|
+
export * from "./single-reference.js";
|
|
15
28
|
export * from "./structured-array.js";
|
|
16
29
|
export * from "./table.js";
|
|
30
|
+
export * from "./text.js";
|
|
31
|
+
export * from "./url.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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,19 +1,25 @@
|
|
|
1
1
|
import { Context } from "koa";
|
|
2
|
-
import {
|
|
2
|
+
import { FilePointer } from "@sealcode/file-manager";
|
|
3
3
|
import { FormDataValue } from "../form-types.js";
|
|
4
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";
|
|
5
7
|
export type FileContainer = {
|
|
6
8
|
old: FilePointer | null;
|
|
7
9
|
new: FilePointer | null;
|
|
8
10
|
};
|
|
9
|
-
export declare class File<Required extends boolean> extends FormField<Required, FileContainer> {
|
|
11
|
+
export declare class File<Required extends boolean> extends FormField<Required, FileContainer, FormControl> {
|
|
10
12
|
readonly required: Required;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
parse(_ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<FileContainer>>;
|
|
13
|
+
constructor(required: Required);
|
|
14
|
+
parse(ctx: Context, raw_value: FormDataValue): Promise<FieldParseResult<FileContainer>>;
|
|
14
15
|
getDatabaseValue(ctx: Context, data: Record<string, FormDataValue>): Promise<FilePointer | undefined>;
|
|
15
16
|
getEmptyValue(): {
|
|
16
17
|
old: null;
|
|
17
18
|
new: null;
|
|
18
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>>;
|
|
19
25
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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>;
|