wave
wave copied to clipboard
feat: Add required prop to ui.file_upload
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:

Compact (with label):

Compact (without label):

Closes #1503