pysepal.sepalwidgets.app.DrawerItem#

class pysepal.sepalwidgets.app.DrawerItem(*args, **kwargs)[source]#

Custom DrawerItem using the user input.

If a card is set the drawerItem will trigger the display of all the Tiles in the app that have the same mount_id. If an href is set, the drawer will open the link in a new tab.

Parameters:
  • title (str) – the title of the drawer item

  • icon (str) – the full name of a mdi/fa icon

  • card (str) – the mount_id of tiles in the app

  • href (str) – the absolute link to an external web page

  • model (Model | None) – sepalwidget model where is defined the bin_var trait

  • bind_var (str) – required when model is selected. Trait to link with ‘alert’ self trait parameter

  • kwargs (optional) – any parameter from a v.ListItem. If set, ‘_metadata’, ‘target’, ‘link’ and ‘children’ will be overwritten.

Attributes

add_notif

alert

Trait to control visibility of an alert in the drawer item

alert_badge

red circle to display in the drawer

children

An instance of a Python list.

href

A trait type representing a Union type.

input_value

A trait which allows any value.

link

A boolean (True, False) trait.

resize

An int trait.

target

A trait for unicode strings.

template_file

A trait for unicode strings.

tiles

the cards of the application

Methods

__init__

Custom DrawerItem using the user input.

display_tile

Display the appropriate tiles when the item is clicked.

remove_notif

Remove notification alert.

vue_on_click_python

Display the appropriate tiles when the item is clicked.

DrawerItem.__init__(title, icon='', card='', href='', model=None, bind_var='', **kwargs)[source]#

Custom DrawerItem using the user input.

If a card is set the drawerItem will trigger the display of all the Tiles in the app that have the same mount_id. If an href is set, the drawer will open the link in a new tab.

Parameters:
  • title (str) – the title of the drawer item

  • icon (str) – the full name of a mdi/fa icon

  • card (str) – the mount_id of tiles in the app

  • href (str) – the absolute link to an external web page

  • model (Model | None) – sepalwidget model where is defined the bin_var trait

  • bind_var (str) – required when model is selected. Trait to link with ‘alert’ self trait parameter

  • kwargs (optional) – any parameter from a v.ListItem. If set, ‘_metadata’, ‘target’, ‘link’ and ‘children’ will be overwritten.

Return type:

None

DrawerItem.display_tile(tiles)[source]#

Display the appropriate tiles when the item is clicked.

The tile to display will be all tile in the list with the mount_id as the current object.

Parameters:

tiles (List[Card]) – the list of all the available tiles in the app

Return type:

Self

DrawerItem.remove_notif()[source]#

Remove notification alert.

Return type:

None

DrawerItem.vue_on_click_python(data=None)[source]#

Display the appropriate tiles when the item is clicked.

Return type:

Self