h2oai / wave

Realtime Web Apps and Dashboards for Python and R
https://wave.h2o.ai
Apache License 2.0
3.9k stars 323 forks source link

feat: Make ui.command to support path and download props #2224 #2262

Closed marek-mihok closed 4 months ago

marek-mihok commented 4 months ago

The PR fulfills these requirements: (check all the apply)


Adds path and download attributes to ui.command to support the same behavior as ui.link():

export interface Command {
  /** An identifying name for this component. If the name is prefixed with a '#', the command sets the location hash to the name when executed. */
  name: Id
  /** The text displayed for this command. */
  label?: S
  /** The caption for this command (typically a tooltip). */
  caption?: S
  /** The icon to be displayed for this command. */
  icon?: S
  /** Sub-commands, if any */
  items?: Command[]
  /** Data associated with this command, if any. */
  value?: S
  /** The path or URL to link to. The 'items' and 'value' props are ignored when specified. */
  path?: S
  /** True if the link should prompt the user to save the linked URL instead of navigating to it. */
  download?: B
}

Closes #2224