diff --git a/py/examples/form.py b/py/examples/form.py index eeabb695de..cebac51b38 100644 --- a/py/examples/form.py +++ b/py/examples/form.py @@ -85,7 +85,7 @@ async def serve(q: Q): ]), ui.file_upload(name='file_upload', label='File upload'), ui.table(name='table', columns=[ - ui.table_column(name='col1', label='Column 1'), + ui.table_column(name='col1', label='Column 1', tooltip="This is a tooltip"), ui.table_column(name='col2', label='Column 2'), ], rows=[ ui.table_row(name='row1', cells=['Text A', 'Text B']), diff --git a/py/h2o_lightwave/h2o_lightwave/types.py b/py/h2o_lightwave/h2o_lightwave/types.py index 75725e0c3b..4a781d43ca 100644 --- a/py/h2o_lightwave/h2o_lightwave/types.py +++ b/py/h2o_lightwave/h2o_lightwave/types.py @@ -3562,6 +3562,7 @@ def __init__( cell_overflow: Optional[str] = None, filters: Optional[List[str]] = None, align: Optional[str] = None, + tooltip: Optional[str] = None, ): _guard_scalar('TableColumn.name', name, (str,), True, False, False) _guard_scalar('TableColumn.label', label, (str,), False, False, False) @@ -3576,6 +3577,7 @@ def __init__( _guard_enum('TableColumn.cell_overflow', cell_overflow, _TableColumnCellOverflow, True) _guard_vector('TableColumn.filters', filters, (str,), False, True, False) _guard_enum('TableColumn.align', align, _TableColumnAlign, True) + _guard_scalar('TableColumn.tooltip', tooltip, (str,), False, True, False) self.name = name """An identifying name for this column.""" self.label = label @@ -3602,6 +3604,8 @@ def __init__( """Explicit list of values to allow filtering by, needed when pagination is set or custom order is needed. Only applicable to filterable columns.""" self.align = align """Defines how to align values in a column. One of 'left', 'center', 'right'. See enum h2o_wave.ui.TableColumnAlign.""" + self.tooltip = tooltip + """Tooltip text.""" def dump(self) -> Dict: """Returns the contents of this object as a dict.""" @@ -3618,6 +3622,7 @@ def dump(self) -> Dict: _guard_enum('TableColumn.cell_overflow', self.cell_overflow, _TableColumnCellOverflow, True) _guard_vector('TableColumn.filters', self.filters, (str,), False, True, False) _guard_enum('TableColumn.align', self.align, _TableColumnAlign, True) + _guard_scalar('TableColumn.tooltip', self.tooltip, (str,), False, True, False) return _dump( name=self.name, label=self.label, @@ -3632,6 +3637,7 @@ def dump(self) -> Dict: cell_overflow=self.cell_overflow, filters=self.filters, align=self.align, + tooltip=self.tooltip, ) @staticmethod @@ -3663,6 +3669,8 @@ def load(__d: Dict) -> 'TableColumn': _guard_vector('TableColumn.filters', __d_filters, (str,), False, True, False) __d_align: Any = __d.get('align') _guard_enum('TableColumn.align', __d_align, _TableColumnAlign, True) + __d_tooltip: Any = __d.get('tooltip') + _guard_scalar('TableColumn.tooltip', __d_tooltip, (str,), False, True, False) name: str = __d_name label: str = __d_label min_width: Optional[str] = __d_min_width @@ -3676,6 +3684,7 @@ def load(__d: Dict) -> 'TableColumn': cell_overflow: Optional[str] = __d_cell_overflow filters: Optional[List[str]] = __d_filters align: Optional[str] = __d_align + tooltip: Optional[str] = __d_tooltip return TableColumn( name, label, @@ -3690,6 +3699,7 @@ def load(__d: Dict) -> 'TableColumn': cell_overflow, filters, align, + tooltip, ) diff --git a/py/h2o_lightwave/h2o_lightwave/ui.py b/py/h2o_lightwave/h2o_lightwave/ui.py index c301fdd3a5..940da96ddc 100644 --- a/py/h2o_lightwave/h2o_lightwave/ui.py +++ b/py/h2o_lightwave/h2o_lightwave/ui.py @@ -1326,6 +1326,7 @@ def table_column( cell_overflow: Optional[str] = None, filters: Optional[List[str]] = None, align: Optional[str] = None, + tooltip: Optional[str] = None, ) -> TableColumn: """Create a table column. @@ -1343,6 +1344,7 @@ def table_column( cell_overflow: Defines what to do with a cell's contents in case it does not fit inside the cell. One of 'tooltip', 'wrap'. See enum h2o_wave.ui.TableColumnCellOverflow. filters: Explicit list of values to allow filtering by, needed when pagination is set or custom order is needed. Only applicable to filterable columns. align: Defines how to align values in a column. One of 'left', 'center', 'right'. See enum h2o_wave.ui.TableColumnAlign. + tooltip: Tooltip text. Returns: A `h2o_wave.types.TableColumn` instance. """ @@ -1360,6 +1362,7 @@ def table_column( cell_overflow, filters, align, + tooltip, ) diff --git a/py/h2o_wave/h2o_wave/types.py b/py/h2o_wave/h2o_wave/types.py index 75725e0c3b..4a781d43ca 100644 --- a/py/h2o_wave/h2o_wave/types.py +++ b/py/h2o_wave/h2o_wave/types.py @@ -3562,6 +3562,7 @@ def __init__( cell_overflow: Optional[str] = None, filters: Optional[List[str]] = None, align: Optional[str] = None, + tooltip: Optional[str] = None, ): _guard_scalar('TableColumn.name', name, (str,), True, False, False) _guard_scalar('TableColumn.label', label, (str,), False, False, False) @@ -3576,6 +3577,7 @@ def __init__( _guard_enum('TableColumn.cell_overflow', cell_overflow, _TableColumnCellOverflow, True) _guard_vector('TableColumn.filters', filters, (str,), False, True, False) _guard_enum('TableColumn.align', align, _TableColumnAlign, True) + _guard_scalar('TableColumn.tooltip', tooltip, (str,), False, True, False) self.name = name """An identifying name for this column.""" self.label = label @@ -3602,6 +3604,8 @@ def __init__( """Explicit list of values to allow filtering by, needed when pagination is set or custom order is needed. Only applicable to filterable columns.""" self.align = align """Defines how to align values in a column. One of 'left', 'center', 'right'. See enum h2o_wave.ui.TableColumnAlign.""" + self.tooltip = tooltip + """Tooltip text.""" def dump(self) -> Dict: """Returns the contents of this object as a dict.""" @@ -3618,6 +3622,7 @@ def dump(self) -> Dict: _guard_enum('TableColumn.cell_overflow', self.cell_overflow, _TableColumnCellOverflow, True) _guard_vector('TableColumn.filters', self.filters, (str,), False, True, False) _guard_enum('TableColumn.align', self.align, _TableColumnAlign, True) + _guard_scalar('TableColumn.tooltip', self.tooltip, (str,), False, True, False) return _dump( name=self.name, label=self.label, @@ -3632,6 +3637,7 @@ def dump(self) -> Dict: cell_overflow=self.cell_overflow, filters=self.filters, align=self.align, + tooltip=self.tooltip, ) @staticmethod @@ -3663,6 +3669,8 @@ def load(__d: Dict) -> 'TableColumn': _guard_vector('TableColumn.filters', __d_filters, (str,), False, True, False) __d_align: Any = __d.get('align') _guard_enum('TableColumn.align', __d_align, _TableColumnAlign, True) + __d_tooltip: Any = __d.get('tooltip') + _guard_scalar('TableColumn.tooltip', __d_tooltip, (str,), False, True, False) name: str = __d_name label: str = __d_label min_width: Optional[str] = __d_min_width @@ -3676,6 +3684,7 @@ def load(__d: Dict) -> 'TableColumn': cell_overflow: Optional[str] = __d_cell_overflow filters: Optional[List[str]] = __d_filters align: Optional[str] = __d_align + tooltip: Optional[str] = __d_tooltip return TableColumn( name, label, @@ -3690,6 +3699,7 @@ def load(__d: Dict) -> 'TableColumn': cell_overflow, filters, align, + tooltip, ) diff --git a/py/h2o_wave/h2o_wave/ui.py b/py/h2o_wave/h2o_wave/ui.py index c301fdd3a5..940da96ddc 100644 --- a/py/h2o_wave/h2o_wave/ui.py +++ b/py/h2o_wave/h2o_wave/ui.py @@ -1326,6 +1326,7 @@ def table_column( cell_overflow: Optional[str] = None, filters: Optional[List[str]] = None, align: Optional[str] = None, + tooltip: Optional[str] = None, ) -> TableColumn: """Create a table column. @@ -1343,6 +1344,7 @@ def table_column( cell_overflow: Defines what to do with a cell's contents in case it does not fit inside the cell. One of 'tooltip', 'wrap'. See enum h2o_wave.ui.TableColumnCellOverflow. filters: Explicit list of values to allow filtering by, needed when pagination is set or custom order is needed. Only applicable to filterable columns. align: Defines how to align values in a column. One of 'left', 'center', 'right'. See enum h2o_wave.ui.TableColumnAlign. + tooltip: Tooltip text. Returns: A `h2o_wave.types.TableColumn` instance. """ @@ -1360,6 +1362,7 @@ def table_column( cell_overflow, filters, align, + tooltip, ) diff --git a/r/R/ui.R b/r/R/ui.R index 34d9c72c5d..fb8d42dfdf 100644 --- a/r/R/ui.R +++ b/r/R/ui.R @@ -1560,6 +1560,7 @@ ui_markdown_table_cell_type <- function( #' @param filters Explicit list of values to allow filtering by, needed when pagination is set or custom order is needed. Only applicable to filterable columns. #' @param align Defines how to align values in a column. #' One of 'left', 'center', 'right'. See enum h2o_wave.ui.TableColumnAlign. +#' @param tooltip Tooltip text. #' @return A TableColumn instance. #' @export ui_table_column <- function( @@ -1575,7 +1576,8 @@ ui_table_column <- function( cell_type = NULL, cell_overflow = NULL, filters = NULL, - align = NULL) { + align = NULL, + tooltip = NULL) { .guard_scalar("name", "character", name) .guard_scalar("label", "character", label) .guard_scalar("min_width", "character", min_width) @@ -1589,6 +1591,7 @@ ui_table_column <- function( # TODO Validate cell_overflow .guard_vector("filters", "character", filters) # TODO Validate align + .guard_scalar("tooltip", "character", tooltip) .o <- list( name=name, label=label, @@ -1602,7 +1605,8 @@ ui_table_column <- function( cell_type=cell_type, cell_overflow=cell_overflow, filters=filters, - align=align) + align=align, + tooltip=tooltip) class(.o) <- append(class(.o), c(.wave_obj, "WaveTableColumn")) return(.o) } 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 67a5ba7b55..76032a73e1 100644 --- a/tools/intellij-plugin/src/main/resources/templates/wave-components.xml +++ b/tools/intellij-plugin/src/main/resources/templates/wave-components.xml @@ -2376,7 +2376,7 @@