wave icon indicating copy to clipboard operation
wave copied to clipboard

feat: Add required prop to ui.file_upload

Open marek-mihok opened this issue 3 years ago • 0 comments

Adds required prop to ui.file_upload component. Updated API:

export interface FileUpload {
  /** An identifying name for this component. */
  name: Id
  /** Text to be displayed in the bottom button or as a component title when the component is displayed compactly. Defaults to "Upload". */
  label?: S
  /** True if the component should allow multiple files to be uploaded. */
  multiple?: B
  /** List of allowed file extensions, e.g. `pdf`, `docx`, etc. */
  file_extensions?: S[]
  /** Maximum allowed size (Mb) per file. No limit by default. */
  max_file_size?: F
  /** Maximum allowed size (Mb) for all files combined. No limit by default. */
  max_size?: F
  /** The height of the file upload, e.g. '400px', '50%', etc. Defaults to 300px. */
  height?: S
  /** The width of the file upload, e.g. '100px'. Defaults to '100%'. */
  width?: S
  /** True if the component should be displayed compactly (without drag-and-drop capabilities). Defaults to False. */
  compact?: B
  /** True if the component should be visible. Defaults to True. */
  visible?: B
  /** An optional tooltip message displayed when a user clicks the help icon to the right of the component. */
  tooltip?: S
  /** True if this is a required field. Defaults to False. */
  required?: B
}

Full-sized: image

Compact (with label): image

Compact (without label): image

Closes #1503

marek-mihok avatar Sep 21 '22 08:09 marek-mihok