Crate nova_forms

Source

Macros§

Structs§

Enums§

  • The error type for the Accept datatype. This error is returned when the input is not accepted and can be used to display an error message by providing a custom translation.
  • The error type for the DateTime datatype. This error is returned when the input is not a valid date and time and can be used to display an error message by providing a custom translation.
  • The kind of dialog to display. There are four kinds of dialogs: success, info, warn, and error.
  • The error type for the Email datatype. This error is returned when the input is not a valid email address and can be used to display an error message by providing a custom translation.
  • The error type for the NonEmptyString datatype. This error is returned when the input is an empty string and can be used to display an error message by providing a custom translation.
  • Possible errors that can occur when submitting a form.
  • The current state of the form submission.
  • The error type for the Telephone datatype. This error is returned when the input is not a valid telephone number and can be used to display an error message by providing a custom translation.
  • Can be used to provide custom translations. If not provided, the default english translations will be used.

Traits§

  • A trait for defining custom datatypes. Implemented on all types that can be used as a form input.

Functions§

  • A button that only contains an icon.
  • A button that only contains an icon.
  • A component that renders a checkbox.
  • A component renders multiple columns.
  • A component creates a colspan over multiple columns.
  • A dialog component.
  • A component that allows users to upload files. The files are automatically uploaded to the server and stored in the FileStore.
  • A component that binds all of its contents to a part of the form data.
  • Required Props
  • A component that renders an input field. It takes a datatype as a type parameter and automatically handles parsing and validation.
  • A modal dialog.
  • Creates a new nova form. The form will automatically handle validation, serialization, and submission. This implicitly creates a HTML form tag that contains your entire form. It also provides a toolbar with a page select, locale select, preview button, and submit button.
  • A container for a form. Adds a header with a logo, title, and subtitle, as well as a footer with the title.
  • Creates a new page in the form.
  • Creates a new page in the form.
  • Required Props
  • Only renders the children when printing to PDF.
  • A component that renders radio buttons from an enum.
  • Creates a repeatable group of items.
  • Only renders the children when printing to PDF.
  • A component that renders a select field from an enum.
  • Required Props
  • Required Props
  • Required Props
  • Adds custom translations to a type T. This is useful for adding custom error messages to error enums or other elements.
  • Provides a service to get the city for a given swiss zip code. This uses the swiss postal service address checker API (https://service.post.ch/zopa/app/api/addresschecker/v1/zips). Returns a tuple that contains a function which takes an input event, and a signal that contains the city name. The function taking an input event can be added to a input field and triggers the service call when the input field changes. The response of the service call is stored in the signal.