diff --git a/py/h2o_wave/types.py b/py/h2o_wave/types.py index ff8c0cc952..1cead7f1b8 100644 --- a/py/h2o_wave/types.py +++ b/py/h2o_wave/types.py @@ -8242,12 +8242,14 @@ def __init__( title: str, path: Optional[str] = None, content: Optional[str] = None, + compact: Optional[bool] = None, commands: Optional[List[Command]] = None, ): _guard_scalar('FrameCard.box', box, (str,), False, False, False) _guard_scalar('FrameCard.title', title, (str,), False, False, False) _guard_scalar('FrameCard.path', path, (str,), False, True, False) _guard_scalar('FrameCard.content', content, (str,), False, True, False) + _guard_scalar('FrameCard.compact', compact, (bool,), False, True, False) _guard_vector('FrameCard.commands', commands, (Command,), False, True, False) self.box = box """A string indicating how to place this component on the page.""" @@ -8257,6 +8259,8 @@ def __init__( """The path or URL of the web page, e.g. `/foo.html` or `http://example.com/foo.html`.""" self.content = content """The HTML content of the page. A string containing `...`.""" + self.compact = compact + """True if title and padding should be removed. Defaults to False.""" self.commands = commands """Contextual menu commands for this component.""" @@ -8266,6 +8270,7 @@ def dump(self) -> Dict: _guard_scalar('FrameCard.title', self.title, (str,), False, False, False) _guard_scalar('FrameCard.path', self.path, (str,), False, True, False) _guard_scalar('FrameCard.content', self.content, (str,), False, True, False) + _guard_scalar('FrameCard.compact', self.compact, (bool,), False, True, False) _guard_vector('FrameCard.commands', self.commands, (Command,), False, True, False) return _dump( view='frame', @@ -8273,6 +8278,7 @@ def dump(self) -> Dict: title=self.title, path=self.path, content=self.content, + compact=self.compact, commands=None if self.commands is None else [__e.dump() for __e in self.commands], ) @@ -8287,18 +8293,22 @@ def load(__d: Dict) -> 'FrameCard': _guard_scalar('FrameCard.path', __d_path, (str,), False, True, False) __d_content: Any = __d.get('content') _guard_scalar('FrameCard.content', __d_content, (str,), False, True, False) + __d_compact: Any = __d.get('compact') + _guard_scalar('FrameCard.compact', __d_compact, (bool,), False, True, False) __d_commands: Any = __d.get('commands') _guard_vector('FrameCard.commands', __d_commands, (dict,), False, True, False) box: str = __d_box title: str = __d_title path: Optional[str] = __d_path content: Optional[str] = __d_content + compact: Optional[bool] = __d_compact commands: Optional[List[Command]] = None if __d_commands is None else [Command.load(__e) for __e in __d_commands] return FrameCard( box, title, path, content, + compact, commands, ) diff --git a/py/h2o_wave/ui.py b/py/h2o_wave/ui.py index 1d52970192..2b4be8bcf0 100644 --- a/py/h2o_wave/ui.py +++ b/py/h2o_wave/ui.py @@ -2889,6 +2889,7 @@ def frame_card( title: str, path: Optional[str] = None, content: Optional[str] = None, + compact: Optional[bool] = None, commands: Optional[List[Command]] = None, ) -> FrameCard: """Render a card containing a HTML page inside an inline frame (an `iframe`). @@ -2900,6 +2901,7 @@ def frame_card( title: The title for this card. path: The path or URL of the web page, e.g. `/foo.html` or `http://example.com/foo.html`. content: The HTML content of the page. A string containing `...`. + compact: True if title and padding should be removed. Defaults to False. commands: Contextual menu commands for this component. Returns: A `h2o_wave.types.FrameCard` instance. @@ -2909,6 +2911,7 @@ def frame_card( title, path, content, + compact, commands, ) diff --git a/r/R/ui.R b/r/R/ui.R index c608f42f5d..81696c94f6 100644 --- a/r/R/ui.R +++ b/r/R/ui.R @@ -3350,6 +3350,7 @@ ui_form_card <- function( #' @param title The title for this card. #' @param path The path or URL of the web page, e.g. `/foo.html` or `http://example.com/foo.html`. #' @param content The HTML content of the page. A string containing `...`. +#' @param compact True if title and padding should be removed. Defaults to False. #' @param commands Contextual menu commands for this component. #' @return A FrameCard instance. #' @export @@ -3358,17 +3359,20 @@ ui_frame_card <- function( title, path = NULL, content = NULL, + compact = NULL, commands = NULL) { .guard_scalar("box", "character", box) .guard_scalar("title", "character", title) .guard_scalar("path", "character", path) .guard_scalar("content", "character", content) + .guard_scalar("compact", "logical", compact) .guard_vector("commands", "WaveCommand", commands) .o <- list( box=box, title=title, path=path, content=content, + compact=compact, commands=commands, view='frame') class(.o) <- append(class(.o), c(.wave_obj, "WaveFrameCard")) diff --git a/tools/intellij-plugin/src/main/resources/templates/wave-components.xml b/tools/intellij-plugin/src/main/resources/templates/wave-components.xml index 92ad7def36..eca2f03805 100644 --- a/tools/intellij-plugin/src/main/resources/templates/wave-components.xml +++ b/tools/intellij-plugin/src/main/resources/templates/wave-components.xml @@ -1331,11 +1331,12 @@