implementations module

class TabImplementation

Bases: object

A mixin class to implement a module inside a tab.

This class should be used as a mixin in a module class. If necessary, you can override the get_module_layout method to further customize the layout inside the tab.

label

The label for the tab.

module_name

The name of the module, used for generating unique IDs.

module_layout

The layout to display inside the tab.

get_module_layout()

Get the layout of the module.

Works as is, but can be overridden if needed.

Return type:

Div

label: str
layout()

Generate the layout for the module as a tab.

Return type:

Tab

Returns:

The layout containing the module layout.

module_layout: Div
module_name: str
class TabModule(*args, **kwargs)

Bases: Protocol

A protocol that defines the expected interface for a module to be used in a tab.

label

The label for the tab.

module_name

The name of the module, used for generating unique IDs.

module_layout

The layout to display inside the tab.

label: str
layout()

This method should return the layout of the module inside a tab.

Return type:

Tab

module_layout: Div
module_name: str
class WindowImplementation

Bases: object

A mixin class to implement a module inside a modal.

label

The label for the modal and sidebar button.

module_name

The name of the module, used for generating unique IDs.

module_layout

The layout to display inside the modal.

Note

  • This class should be used as a mixin in a module class.

  • If necessary, you can override the get_module_layout method to further customize the layout inside the modal.

get_module_layout()

Get the layout of the module.

Works as is, but can be overridden if needed.

Return type:

Div

label: str
layout()

Generate the layout for the modal window.

This method creates a modal window with a header and a body containing the module layout. It also creates a sidebar button to toggle the modal.

Return type:

Div

Returns:

The layout containing the modal and the sidebar button.

module_layout: Div
module_name: str
window_callbacks()

Define the callbacks for the module window.

This includes a callback to toggle the visibility of the modal window.

Return type:

None

class WindowModule(*args, **kwargs)

Bases: Protocol

A protocol that defines the expected interface for a module to be used in a window.

label

The label for the window.

module_name

The name of the module, used for generating unique IDs.

module_layout

The layout to display inside the window.

label: str
layout()

This method should return the layout of the module inside a window.

Return type:

Div

module_layout: Div
module_name: str