mbdlyb_ui.base ============== .. py:module:: mbdlyb_ui.base .. autoapi-nested-parse:: Copyright (c) 2026 TNO-ESI All rights reserved. Classes ------- .. autoapisummary:: mbdlyb_ui.base.Button mbdlyb_ui.base.ConditionalButton mbdlyb_ui.base.Page mbdlyb_ui.base.Table mbdlyb_ui.base.TableColumn mbdlyb_ui.base.TableMultiColumn Module Contents --------------- .. py:class:: Button Hold presentation and action options for a model-aware UI button. .. py:method:: show(obj: Optional[mbdlyb.gdb.GMBDElement] = None, hide_label=False, btn_props: Optional[str] = None, tooltip_classes: Optional[str] = None) -> nicegui.ui.button Render a button with evaluated labels, colors, and click handler. :param obj: Element used to evaluate dynamic button options. :param hide_label: Whether to display only the icon. :param btn_props: Additional NiceGUI button properties. :param tooltip_classes: CSS classes for the tooltip. :returns: The created NiceGUI button. .. py:method:: show_icon(obj: mbdlyb.gdb.GMBDElement = None, btn_props: str = None, tooltip_classes: str = None) Render this action as a clickable icon. :param obj: Element used to evaluate dynamic icon options. :param btn_props: Additional NiceGUI icon properties. :param tooltip_classes: CSS classes for the tooltip. .. py:attribute:: color :type: Optional[str | Callable[[mbdlyb.gdb.GMBDElement], str]] :value: None .. py:attribute:: enabled_from :type: Optional[tuple[Any, str, Any]] :value: None .. py:attribute:: handler :type: Optional[str | Callable[[], Any] | Callable[[mbdlyb.gdb.GMBDElement], Any]] :value: None .. py:attribute:: icon :type: Optional[str | Callable[[mbdlyb.gdb.GMBDElement], str]] :value: None .. py:attribute:: label :type: Optional[str | Callable[[mbdlyb.gdb.GMBDElement], str]] :value: None .. py:attribute:: tooltip :type: Optional[str | Callable[[mbdlyb.gdb.GMBDElement], str]] :value: None .. py:class:: ConditionalButton Bases: :py:obj:`Button` Display a button only when its condition accepts the current element. .. py:method:: show(obj: mbdlyb.gdb.GMBDElement = None, hide_label=False, btn_props: str = None, tooltip_classes: str = None) Render the button when its condition passes. :param obj: Element tested against the condition. :param hide_label: Whether to omit button text. :param btn_props: Additional NiceGUI button properties. :param tooltip_classes: CSS classes for the tooltip. .. py:method:: show_icon(obj: mbdlyb.gdb.GMBDElement = None, btn_props: str = None, tooltip_classes: str = None) Render the clickable icon when its condition passes. :param obj: Element tested against the condition. :param btn_props: Additional NiceGUI icon properties. :param tooltip_classes: CSS classes for the tooltip. .. py:attribute:: condition :type: Optional[Callable[[mbdlyb.gdb.GMBDElement], bool]] :value: None .. py:class:: Page(title: Optional[str] = None, element: Optional[mbdlyb.gdb.GMBDElement] = None, buttons: Optional[list[Button]] = None, header_text: str = '', hide_breadcrumbs: bool = False, hide_menu_tree: bool = False, settings: Optional[Callable[[nicegui.ui.dialog], None]] = None, status: Optional[mbdlyb_ui.utils.Status] = None) Render a model-backed page with shared navigation, controls, and layout. .. py:method:: get_mode() -> str :staticmethod: Return the mode currently stored in NiceGUI's general storage. :returns: The selected application mode. :raises KeyError: If no mode has been stored. .. py:method:: show() Render the shared page layout and subclass-specific content. .. py:property:: element :type: Optional[mbdlyb.gdb.GMBDElement] Return the model element associated with this page. :returns: The selected element, or None if the page has no element. .. py:property:: has_modes :type: bool Report whether the app offers more than one mode. :returns: True when the mode selector is needed. .. py:class:: Table Render a titled table of model elements with optional actions. .. py:method:: show() Render table headings, rows, and configured action buttons. .. py:attribute:: columns :type: list[TableColumn] .. py:attribute:: obj :type: Optional[object] :value: None .. py:attribute:: row_actions :type: Optional[list[Button]] :value: None .. py:attribute:: rows :type: Iterable .. py:attribute:: table_actions :type: Optional[list[Button]] :value: None .. py:attribute:: title :type: str .. py:class:: TableColumn Describe a table column backed by an element attribute or callable. .. py:method:: show(obj: mbdlyb.gdb.GMBDElement, classes: Optional[str] = None, tooltip_classes: Optional[str] = None) Render a cell for an element, optionally with a link and tooltip. :param obj: Element providing the cell value. :param classes: CSS classes applied to the cell row. :param tooltip_classes: CSS classes applied to its tooltip. .. py:attribute:: header :type: str .. py:attribute:: tooltip :type: Optional[str | Callable[[mbdlyb.gdb.GMBDElement], str]] :value: None .. py:attribute:: url :type: Optional[Callable[[mbdlyb.gdb.GMBDElement], str]] :value: None .. py:attribute:: value :type: str | Callable[[mbdlyb.gdb.GMBDElement], str] .. py:class:: TableMultiColumn Bases: :py:obj:`TableColumn` Render a collection-valued field as multiple cells in one column. .. py:method:: show(obj: mbdlyb.gdb.GMBDElement, classes: Optional[str] = None, tooltip_classes: Optional[str] = None) Render each related element, optionally sorted, with separators. :param obj: Element providing the related collection. :param classes: CSS classes applied to the row. :param tooltip_classes: CSS classes passed to the child column renderer. .. py:attribute:: list_attribute :type: str :value: None .. py:attribute:: order_by :type: Optional[str] :value: None .. py:attribute:: separator :type: str :value: '\t|'