ecodev-front 0.0.43__tar.gz → 0.0.45__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {ecodev_front-0.0.43 → ecodev_front-0.0.45}/PKG-INFO +1 -1
  2. ecodev_front-0.0.45/ecodev_front/__init__.py +73 -0
  3. {ecodev_front-0.0.43/ecodev_front/layouts → ecodev_front-0.0.45/ecodev_front}/app_layout.py +21 -20
  4. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/card.py +10 -12
  5. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/data_table.py +5 -8
  6. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/display_utils.py +1 -3
  7. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/divider.py +4 -3
  8. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/footer.py +9 -12
  9. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/group.py +2 -2
  10. {ecodev_front-0.0.43 → ecodev_front-0.0.45}/ecodev_front/ids.py +4 -0
  11. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/navlink.py +4 -3
  12. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/pie_chart.py +6 -10
  13. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/report_value.py +6 -6
  14. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/search_bar.py +1 -4
  15. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/segment_control.py +4 -7
  16. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/select.py +8 -11
  17. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/stack.py +2 -3
  18. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/tabs.py +1 -3
  19. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/text.py +3 -0
  20. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/upload_box.py +1 -4
  21. {ecodev_front-0.0.43 → ecodev_front-0.0.45}/pyproject.toml +1 -1
  22. ecodev_front-0.0.43/ecodev_front/__init__.py +0 -32
  23. ecodev_front-0.0.43/ecodev_front/components/__init__.py +0 -47
  24. ecodev_front-0.0.43/ecodev_front/layouts/__init__.py +0 -12
  25. {ecodev_front-0.0.43 → ecodev_front-0.0.45}/LICENSE.md +0 -0
  26. {ecodev_front-0.0.43 → ecodev_front-0.0.45}/README.md +0 -0
  27. {ecodev_front-0.0.43 → ecodev_front-0.0.45}/ecodev_front/constants.py +0 -0
  28. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/div.py +0 -0
  29. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/graph.py +0 -0
  30. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/login.py +0 -0
  31. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/nav_header.py +0 -0
  32. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/nav_items.py +0 -0
  33. {ecodev_front-0.0.43/ecodev_front/components → ecodev_front-0.0.45/ecodev_front}/stepper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ecodev-front
3
- Version: 0.0.43
3
+ Version: 0.0.45
4
4
  Summary: Dash component helpers
5
5
  License: MIT
6
6
  Author: Amaury Salles
@@ -0,0 +1,73 @@
1
+ from ecodev_front.app_layout import dash_base_layout
2
+ from ecodev_front.card import background_card
3
+ from ecodev_front.card import card_section
4
+ from ecodev_front.card import card_title
5
+ from ecodev_front.card import kpi
6
+ from ecodev_front.card import macro_info
7
+ from ecodev_front.constants import CHILDREN
8
+ from ecodev_front.constants import DATA
9
+ from ecodev_front.constants import DISABLED
10
+ from ecodev_front.constants import N_CLICKS
11
+ from ecodev_front.constants import PATHNAME
12
+ from ecodev_front.constants import STYLE
13
+ from ecodev_front.constants import VALUE
14
+ from ecodev_front.data_table import data_table
15
+ from ecodev_front.display_utils import get_magnitude
16
+ from ecodev_front.display_utils import number_formatting
17
+ from ecodev_front.div import centered_div
18
+ from ecodev_front.divider import divider
19
+ from ecodev_front.footer import app_footer
20
+ from ecodev_front.footer import footer_style
21
+ from ecodev_front.graph import graph_box
22
+ from ecodev_front.group import group
23
+ from ecodev_front.ids import APPSHELL
24
+ from ecodev_front.ids import ASIDE
25
+ from ecodev_front.ids import FOOTER_ID
26
+ from ecodev_front.ids import LEFT_ASIDE_ID
27
+ from ecodev_front.ids import LOGIN_BTN_ID
28
+ from ecodev_front.ids import LOGIN_PASSWORD_INPUT_ID
29
+ from ecodev_front.ids import LOGIN_USERNAME_INPUT_ID
30
+ from ecodev_front.ids import LOGOUT_BTN_ID
31
+ from ecodev_front.ids import MAIN_CONTENT_ID
32
+ from ecodev_front.ids import NAVBAR
33
+ from ecodev_front.ids import NAVBAR_ID
34
+ from ecodev_front.ids import PAGE
35
+ from ecodev_front.ids import RIGHT_ASIDE_ID
36
+ from ecodev_front.ids import TOKEN
37
+ from ecodev_front.ids import URL
38
+ from ecodev_front.login import login
39
+ from ecodev_front.nav_header import app_header
40
+ from ecodev_front.nav_header import app_logo
41
+ from ecodev_front.nav_header import app_title
42
+ from ecodev_front.nav_header import header_divider
43
+ from ecodev_front.nav_items import action_item
44
+ from ecodev_front.nav_items import menu
45
+ from ecodev_front.nav_items import menu_item
46
+ from ecodev_front.navlink import navlink
47
+ from ecodev_front.pie_chart import pie_chart
48
+ from ecodev_front.report_value import report_value
49
+ from ecodev_front.search_bar import search_bar
50
+ from ecodev_front.segment_control import segmented_control
51
+ from ecodev_front.segment_control import segmented_control_label
52
+ from ecodev_front.select import select
53
+ from ecodev_front.select import select_label
54
+ from ecodev_front.stack import stack
55
+ from ecodev_front.stepper import stepper_step
56
+ from ecodev_front.stepper import vertical_stepper
57
+ from ecodev_front.text import sub_text
58
+ from ecodev_front.text import text_header
59
+ from ecodev_front.upload_box import upload_box
60
+
61
+ __all__ = [
62
+ 'CHILDREN', 'DATA', 'PATHNAME', 'N_CLICKS', 'VALUE', 'URL', 'TOKEN',
63
+ 'NAVBAR_ID', 'LOGIN_USERNAME_INPUT_ID', 'LOGIN_PASSWORD_INPUT_ID', 'LOGOUT_BTN_ID',
64
+ 'LOGIN_BTN_ID', 'FOOTER_ID', 'MAIN_CONTENT_ID', 'LEFT_ASIDE_ID', 'RIGHT_ASIDE_ID',
65
+ 'DISABLED', 'STYLE', 'PAGE', 'APPSHELL', 'ASIDE', 'NAVBAR', 'dash_base_layout',
66
+ 'app_logo', 'app_title', 'app_header', 'menu', 'data_table', 'header_divider',
67
+ 'action_item', 'login', 'menu_item', 'upload_box', 'card_section',
68
+ 'card_title', 'macro_info', 'number_formatting', 'background_card', 'search_bar',
69
+ 'graph_box', 'footer_style', 'report_value', 'centered_div', 'pie_chart',
70
+ 'app_footer', 'vertical_stepper', 'stepper_step', 'group', 'segmented_control',
71
+ 'select', 'stack', 'text_header', 'sub_text', 'divider', 'kpi',
72
+ 'segmented_control_label', 'select_label', 'navlink', 'get_magnitude'
73
+ ]
@@ -3,12 +3,13 @@ Base app component, utilising dmc.AppShell.
3
3
  """
4
4
  import dash
5
5
  import dash_mantine_components as dmc
6
- from dash import html, dcc
6
+ from dash import dcc
7
+ from dash import html
7
8
 
8
9
  from ecodev_front.ids import APPSHELL
9
- from ecodev_front.ids import MAIN_CONTENT_ID
10
10
  from ecodev_front.ids import FOOTER_ID
11
11
  from ecodev_front.ids import LEFT_ASIDE_ID
12
+ from ecodev_front.ids import MAIN_CONTENT_ID
12
13
  from ecodev_front.ids import NAVBAR_ID
13
14
  from ecodev_front.ids import RIGHT_ASIDE_ID
14
15
  from ecodev_front.ids import TOKEN
@@ -31,20 +32,20 @@ def dash_base_layout(stores: list[tuple[str, str]],
31
32
  dcc.Store(id=TOKEN, data={TOKEN: None}, storage_type='local'),
32
33
  *[dcc.Store(id=store_id, storage_type=storage_type)
33
34
  for store_id, storage_type in stores],
34
- dmc.AppShellHeader(id=NAVBAR_ID,
35
- style={'background-color': main_color},
36
- zIndex=100,
37
- children=[]
38
- ),
35
+ dmc.AppShellHeader(id=NAVBAR_ID,
36
+ style={'background-color': main_color},
37
+ zIndex=100,
38
+ children=[]
39
+ ),
39
40
 
40
41
  dmc.AppShellMain([html.Div(
41
- id=MAIN_CONTENT_ID,
42
- style={'width': '100%'},
43
- children=dash.page_container
44
- )],
45
- style={'margin-top': '2%',
46
- 'justifyContent': 'center',
47
- 'display': 'flex'},
42
+ id=MAIN_CONTENT_ID,
43
+ style={'width': '100%'},
44
+ children=dash.page_container
45
+ )],
46
+ style={'margin-top': '2%',
47
+ 'justifyContent': 'center',
48
+ 'display': 'flex'},
48
49
  ),
49
50
 
50
51
  dmc.AppShellFooter(id=FOOTER_ID, zIndex=100, children=[],
@@ -54,21 +55,21 @@ def dash_base_layout(stores: list[tuple[str, str]],
54
55
  'textAlign': 'center',
55
56
  'alignContent': 'center',
56
57
  'justifyContent': 'center'}
57
- ),
58
+ ),
58
59
 
59
60
  dmc.AppShellNavbar(
60
61
  id=LEFT_ASIDE_ID,
61
62
  children=[],
62
63
  zIndex=90,
63
- withBorder=True,
64
+ withBorder=True,
64
65
  visibleFrom='md'
65
66
  ),
66
-
67
+
67
68
  dmc.AppShellAside(
68
69
  id=RIGHT_ASIDE_ID,
69
70
  children=[],
70
71
  zIndex=90,
71
- withBorder=True,
72
+ withBorder=True,
72
73
  visibleFrom='md'
73
74
  )],
74
75
 
@@ -79,10 +80,10 @@ def dash_base_layout(stores: list[tuple[str, str]],
79
80
  navbar={
80
81
  'breakpoint': 'xl',
81
82
  'collapsed': {'desktop': False, 'mobile': True},
82
- },
83
+ },
83
84
  aside={
84
85
  'breakpoint': 'xl',
85
86
  'collapsed': {'desktop': False, 'mobile': True},
86
- },
87
+ },
87
88
  )
88
89
  )
@@ -1,10 +1,7 @@
1
1
  """
2
2
  Components to create standardised card across apps.
3
3
  """
4
- from typing import Dict
5
- from typing import List
6
- from typing import Optional
7
- from typing import Union
4
+ from typing import Any
8
5
 
9
6
  import dash_mantine_components as dmc
10
7
  from dash import html
@@ -15,9 +12,10 @@ DEFAULT_STYLE = {
15
12
  'justifyContent': 'center'}
16
13
 
17
14
 
18
- def background_card(children: List[Union[dmc.CardSection, html.Div]],
19
- style: Optional[Dict[str, str]] = None,
20
- className: str = '', card_id: Optional[str] = ''
15
+ def background_card(children: list[dmc.CardSection | html.Div],
16
+ style: dict[str, str] | None = None,
17
+ className: str = '',
18
+ card_id: str = ''
21
19
  ) -> dmc.Card:
22
20
  """
23
21
  Returns a formatted dmc.Card
@@ -28,7 +26,7 @@ def background_card(children: List[Union[dmc.CardSection, html.Div]],
28
26
 
29
27
  def card_title(title: str,
30
28
  size: int = 16,
31
- title_id: Optional[str] = '',
29
+ title_id: str = '',
32
30
  color: str = 'white',
33
31
  font: str = 'Averta',
34
32
  align: str = 'left',
@@ -41,7 +39,7 @@ def card_title(title: str,
41
39
  bg=background_color, p=10))
42
40
 
43
41
 
44
- def card_section(children: Union[html.Div, dmc.Text], graph: bool = False) -> dmc.CardSection:
42
+ def card_section(children: Any, graph: bool = False) -> dmc.CardSection:
45
43
  """
46
44
  Returns a formatted dmc.CardSection from passed dmc.Text
47
45
  """
@@ -50,8 +48,8 @@ def card_section(children: Union[html.Div, dmc.Text], graph: bool = False) -> dm
50
48
  style={'height': '100%', 'width': '100%'} if graph else {})
51
49
 
52
50
 
53
- def macro_info(text: Union[str, float], color: str = '#A0AEC0', size: int = 32,
54
- text_id: Optional[str] = '') -> dmc.Text:
51
+ def macro_info(text: str | float, color: str = '#A0AEC0', size: int = 32,
52
+ text_id: str = '') -> dmc.Text:
55
53
  """
56
54
  Returns a formatted dmc.Text element from a string
57
55
  """
@@ -59,7 +57,7 @@ def macro_info(text: Union[str, float], color: str = '#A0AEC0', size: int = 32,
59
57
 
60
58
 
61
59
  def kpi(icon: str, text: str,
62
- tooltip: Optional[str] = None,
60
+ tooltip: str | None = None,
63
61
  c: str = '#A0AEC0', fz: int = 24,
64
62
  fw: int = 700) -> dmc.Card:
65
63
  """
@@ -2,9 +2,6 @@
2
2
  Module implementing a generic Dash AG Grid table
3
3
  """
4
4
  from typing import Any
5
- from typing import Dict
6
- from typing import List
7
- from typing import Union
8
5
 
9
6
  import dash_ag_grid as dag
10
7
  from pydantic_settings import BaseSettings
@@ -34,12 +31,12 @@ DAG_ENTERPRISE_AUTH = DashAgGridEnterprise()
34
31
 
35
32
  def data_table(id: str,
36
33
  df,
37
- column_defs: Union[List[Dict[Any, Any]], None] = None,
38
- default_col_def: Union[Dict, None] = None,
39
- style: Union[Dict, None] = None,
34
+ column_defs: list[dict[Any, Any]] | None = None,
35
+ default_col_def: dict | None = None,
36
+ style: dict | None = None,
40
37
  row_alternating_color='#f5f5f5',
41
- row_style: Union[Dict, None] = None,
42
- dash_grid_options: Union[Dict, None] = None
38
+ row_style: dict | None = None,
39
+ dash_grid_options: dict | None = None
43
40
  ) -> dag.AgGrid:
44
41
  """
45
42
  Generic Dash AG Grid table
@@ -3,8 +3,6 @@ Component helpers to ease display of data to be presented.
3
3
  """
4
4
  from math import floor
5
5
  from math import log
6
- from typing import Tuple
7
- from typing import Union
8
6
 
9
7
  from ecodev_front.constants import BILLION
10
8
  from ecodev_front.constants import MILLION
@@ -22,7 +20,7 @@ def number_formatting(number: float, decimals: int = 0) -> str:
22
20
  return f'%.{decimals}f %s' % (number / k ** magnitude, units[magnitude])
23
21
 
24
22
 
25
- def get_magnitude(number: Union[int, float]) -> Tuple[object, str]:
23
+ def get_magnitude(number: int | float) -> tuple[object, str]:
26
24
  """
27
25
  Returns the metric to divide by and the unit
28
26
  """
@@ -1,11 +1,12 @@
1
- from typing import Union
2
-
1
+ """
2
+ File containing a page divider
3
+ """
3
4
  import dash_mantine_components as dmc
4
5
 
5
6
 
6
7
  def divider(orientation: str = 'horizontal',
7
8
  margin: int = 10,
8
- w: Union[str, int] = '') -> dmc.Divider:
9
+ w: str | int = '') -> dmc.Divider:
9
10
  """
10
11
  Renders a divider
11
12
  """
@@ -1,29 +1,26 @@
1
1
  """
2
2
  Module containing the app footer component style
3
3
  """
4
- from typing import Dict
5
- from typing import Union
6
-
7
4
  from dash import html
8
5
 
9
6
  from ecodev_front.ids import FOOTER_ID
10
7
 
11
8
 
12
- def app_footer(
13
- children: html.Div,
14
- color: str = '#0066A1',
15
- height: str = '4vh',
16
- display: str = 'flex',
17
- ) -> html.Div:
9
+ def app_footer(children: html.Div,
10
+ color: str = '#0066A1',
11
+ height: str = '4vh',
12
+ display: str = 'flex',
13
+ ) -> html.Div:
18
14
  """
19
15
  Main app footer
20
16
  """
21
17
  return html.Div(children, id=FOOTER_ID, style=footer_style(color, height, display))
22
18
 
23
19
 
24
- def footer_style(
25
- color: str = '#0066A1', height: str = '5vh', display: str = 'flex'
26
- ) -> Dict[str, Union[str, int]]:
20
+ def footer_style(color: str = '#0066A1',
21
+ height: str = '5vh',
22
+ display: str = 'flex'
23
+ ) -> dict[str, str | int]:
27
24
  """
28
25
  Main app footer style
29
26
  """
@@ -1,12 +1,12 @@
1
1
  """
2
2
  Module to render dmc.Group elements
3
3
  """
4
- from typing import List
4
+ from typing import Any
5
5
 
6
6
  import dash_mantine_components as dmc
7
7
 
8
8
 
9
- def group(children: List,
9
+ def group(children: list[Any],
10
10
  grow: bool = True,
11
11
  id: str = '',
12
12
  justify: str = 'space-around') -> dmc.Group:
@@ -1,3 +1,7 @@
1
+ """
2
+ File containing component IDs, to use in callbacks
3
+ """
4
+
1
5
  URL = 'url'
2
6
  TOKEN = 'token'
3
7
  NAVBAR_ID = 'navbar-id'
@@ -1,12 +1,13 @@
1
- from typing import Optional
2
-
1
+ """
2
+ File containg a navigation link component
3
+ """
3
4
  import dash_mantine_components as dmc
4
5
  from dash_iconify import DashIconify
5
6
 
6
7
 
7
8
  def navlink(label: str,
8
9
  href: str,
9
- icon: Optional[str] = None) -> dmc.NavLink:
10
+ icon: str | None = None) -> dmc.NavLink:
10
11
  """
11
12
  A simple navigation link component.
12
13
  """
@@ -1,17 +1,13 @@
1
- from typing import List
2
- from typing import Optional
3
- from typing import Union
4
-
5
1
  import plotly.graph_objects as go
6
2
 
7
3
 
8
- def pie_chart(labels: List[str],
9
- values: List[Union[int, float]],
10
- customdata: Optional[List[str]] = None,
11
- hovertemplate: Optional[str] = None,
12
- colors: Optional[List[str]] = None,
4
+ def pie_chart(labels: list[str],
5
+ values: list[int | float],
6
+ customdata: list[str] | None = None,
7
+ hovertemplate: str | None = None,
8
+ colors: list[str] | None = None,
13
9
  text_threshold: float = 0.1,
14
- annotation_text: Optional[str] = None
10
+ annotation_text: str | None = None
15
11
  ):
16
12
  """
17
13
  Function to render a pie chart
@@ -1,17 +1,17 @@
1
1
  """
2
- BLA
2
+ File containing a report value component
3
3
  """
4
- from typing import Optional
5
-
6
4
  import dash_mantine_components as dmc
7
5
  from dash import html
8
6
 
9
- from ecodev_front.components.display_utils import number_formatting
7
+ from ecodev_front.display_utils import number_formatting
10
8
 
11
9
 
12
- def report_value(title: str, value: str | int, unit: Optional[str] = None) -> html.Div:
10
+ def report_value(title: str,
11
+ value: str | int,
12
+ unit: str | None = None) -> html.Div:
13
13
  """
14
- BLA
14
+ Renders a human readable (reportable) value
15
15
  """
16
16
  if isinstance(value, (int, float)):
17
17
  value = number_formatting(value)
@@ -3,9 +3,6 @@ Component to search something in databases.
3
3
 
4
4
  Note: Typically only used as the main search bar on a page.
5
5
  """
6
- from typing import Dict
7
- from typing import Union
8
-
9
6
  import dash_mantine_components as dmc
10
7
  from dash import html
11
8
  from dash_iconify import DashIconify
@@ -15,7 +12,7 @@ def search_bar(id: str,
15
12
  label: str,
16
13
  helper: str,
17
14
  helper_text_color: str = 'gray',
18
- style: Union[Dict[str, str], None] = None,
15
+ style: dict[str, str] | None = None,
19
16
  icon: str = 'quill:search',
20
17
  debounce: int = 750) -> html.Div:
21
18
  """
@@ -1,16 +1,13 @@
1
1
  """
2
2
  Module implementing segmented control
3
3
  """
4
- from typing import List
5
- from typing import Optional
6
-
7
4
  import dash_mantine_components as dmc
8
5
 
9
6
 
10
7
  def segmented_control(id: str,
11
8
  label: str,
12
- value: Optional[str] = None,
13
- data: Optional[List[str]] = []) -> dmc.SegmentedControl:
9
+ value: str | None = None,
10
+ data: list[str] | None = []) -> dmc.SegmentedControl:
14
11
  """
15
12
  Renders a dmc.SegmentedControl that allows to toggle between different values
16
13
  """
@@ -24,8 +21,8 @@ def segmented_control(id: str,
24
21
 
25
22
  def segmented_control_label(id: str,
26
23
  label: str,
27
- value: Optional[str] = None,
28
- data: Optional[List[str]] = [],
24
+ value: str | None = None,
25
+ data: list[str] | None = [],
29
26
  size: str = 'md',
30
27
  c: str = '#A0AEC0') -> dmc.Stack:
31
28
  """
@@ -2,26 +2,23 @@
2
2
  Module implementing select
3
3
  """
4
4
  from typing import Any
5
- from typing import List
6
- from typing import Optional
7
- from typing import Union
8
5
 
9
6
  import dash_mantine_components as dmc
10
7
 
11
8
 
12
- def select(select_id: str,
9
+ def select(id: str,
13
10
  label: str,
14
- value: Optional[Any] = None,
11
+ value: Any | None = None,
15
12
  persistence: bool = True,
16
13
  searchable: bool = True,
17
- w: Union[str, int] = '100%',
14
+ w: str | int = '100%',
18
15
  ) -> dmc.Select:
19
16
  """
20
17
  Renders a formatted html.Div with content at the center
21
18
  Useful to center plotly graphs
22
19
  """
23
20
  return dmc.Select(
24
- id=select_id,
21
+ id=id,
25
22
  label=label,
26
23
  value=value,
27
24
  data=[],
@@ -33,15 +30,15 @@ def select(select_id: str,
33
30
 
34
31
  def select_label(id: str,
35
32
  label: str,
36
- value: Optional[str] = None,
37
- data: Optional[List[str]] = None,
33
+ value: str | None = None,
34
+ data: list[str] | None = None,
38
35
  persistence: bool = True,
39
36
  searchable: bool = True,
40
37
  allow_deselect: bool = True,
41
38
  disabled: bool = False,
42
39
  c: str = '#A0AEC0',
43
- label_id: Optional[str] = '',
44
- stack_id: Optional[str] = '',
40
+ label_id: str | None = '',
41
+ stack_id: str | None = '',
45
42
  ) -> dmc.Stack:
46
43
  """
47
44
  Renders a select with a stylized label
@@ -2,17 +2,16 @@
2
2
  Module to render a dmc.Stack (main element of a page)
3
3
  """
4
4
  from typing import Any
5
- from typing import Optional
6
5
 
7
6
  import dash_mantine_components as dmc
8
7
 
9
8
 
10
9
  def stack(children: Any,
11
- stack_id: Optional[str] = '',
10
+ id: str | None = None,
12
11
  gap: str = 'md',
13
12
  align: str = 'stretch') -> dmc.Stack:
14
13
  """
15
14
  Renders a dmc.Stack component that encapsulates a page
16
15
  """
17
16
  return dmc.Stack(children=children, align=align, justify='flex-end', gap=gap,
18
- id=stack_id)
17
+ id=id)
@@ -1,12 +1,10 @@
1
1
  """
2
2
  Module to render the tabs element (composed of different individual dmc.Tab element)
3
3
  """
4
- from typing import List
5
-
6
4
  import dash_mantine_components as dmc
7
5
 
8
6
 
9
- def tabs(tabs_list: List[dmc.Tab], tabs_id: str, value: str) -> dmc.Tabs:
7
+ def tabs(tabs_list: list[dmc.Tab], tabs_id: str, value: str) -> dmc.Tabs:
10
8
  """
11
9
  Renders a dmc.Tabs components
12
10
  """
@@ -1,3 +1,6 @@
1
+ """
2
+ File containing formatted text components
3
+ """
1
4
  import dash_mantine_components as dmc
2
5
 
3
6
 
@@ -1,9 +1,6 @@
1
1
  """
2
2
  Component which allows document upload.
3
3
  """
4
- from typing import Dict
5
- from typing import Union
6
-
7
4
  from dash import dcc
8
5
  from dash import html
9
6
 
@@ -21,7 +18,7 @@ DEFAULT_STYLE = {'height': '30vh',
21
18
  def upload_box(id: str,
22
19
  label: str,
23
20
  multiple: bool,
24
- style: Union[Dict[str, str], None] = None
21
+ style: dict[str, str] | None = None
25
22
  ) -> dcc.Upload:
26
23
  """
27
24
  Returns an upload box
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ecodev-front"
3
- version = "0.0.43"
3
+ version = "0.0.45"
4
4
  description = "Dash component helpers"
5
5
  authors = ["Amaury Salles <amaury.salles@gmail.com>",
6
6
  "Yoann Diep <yoann.diep@hotmail.fr>",
@@ -1,32 +0,0 @@
1
- from ecodev_front.constants import CHILDREN
2
- from ecodev_front.constants import DATA
3
- from ecodev_front.constants import DISABLED
4
- from ecodev_front.constants import N_CLICKS
5
- from ecodev_front.constants import PATHNAME
6
- from ecodev_front.constants import STYLE
7
- from ecodev_front.constants import VALUE
8
- from ecodev_front.ids import APPSHELL
9
- from ecodev_front.ids import ASIDE
10
- from ecodev_front.ids import FOOTER_ID
11
- from ecodev_front.ids import LEFT_ASIDE_ID
12
- from ecodev_front.ids import LOGIN_BTN_ID
13
- from ecodev_front.ids import LOGIN_PASSWORD_INPUT_ID
14
- from ecodev_front.ids import LOGIN_USERNAME_INPUT_ID
15
- from ecodev_front.ids import LOGOUT_BTN_ID
16
- from ecodev_front.ids import MAIN_CONTENT_ID
17
- from ecodev_front.ids import NAVBAR
18
- from ecodev_front.ids import NAVBAR_ID
19
- from ecodev_front.ids import PAGE
20
- from ecodev_front.ids import RIGHT_ASIDE_ID
21
- from ecodev_front.ids import TOKEN
22
- from ecodev_front.ids import URL
23
- from ecodev_front.layouts import dash_base_layout
24
-
25
-
26
- __all__ = [
27
- 'dash_base_layout',
28
- 'CHILDREN', 'DATA', 'PATHNAME', 'N_CLICKS', 'VALUE', 'URL', 'TOKEN',
29
- 'NAVBAR_ID', 'LOGIN_USERNAME_INPUT_ID', 'LOGIN_PASSWORD_INPUT_ID', 'LOGOUT_BTN_ID',
30
- 'LOGIN_BTN_ID', 'FOOTER_ID', 'MAIN_CONTENT_ID', 'LEFT_ASIDE_ID', 'RIGHT_ASIDE_ID',
31
- 'DISABLED', 'STYLE', 'PAGE', 'APPSHELL', 'ASIDE', 'NAVBAR'
32
- ]
@@ -1,47 +0,0 @@
1
- """
2
- Module containing off-the-shelf components to be used throughout the app
3
- """
4
- from ecodev_front.components.card import background_card
5
- from ecodev_front.components.card import card_section
6
- from ecodev_front.components.card import card_title
7
- from ecodev_front.components.card import kpi
8
- from ecodev_front.components.card import macro_info
9
- from ecodev_front.components.data_table import data_table
10
- from ecodev_front.components.display_utils import get_magnitude
11
- from ecodev_front.components.display_utils import number_formatting
12
- from ecodev_front.components.div import centered_div
13
- from ecodev_front.components.divider import divider
14
- from ecodev_front.components.footer import app_footer
15
- from ecodev_front.components.footer import footer_style
16
- from ecodev_front.components.graph import graph_box
17
- from ecodev_front.components.group import group
18
- from ecodev_front.components.login import login
19
- from ecodev_front.components.nav_header import app_header
20
- from ecodev_front.components.nav_header import app_logo
21
- from ecodev_front.components.nav_header import app_title
22
- from ecodev_front.components.nav_header import header_divider
23
- from ecodev_front.components.nav_items import action_item
24
- from ecodev_front.components.nav_items import menu
25
- from ecodev_front.components.nav_items import menu_item
26
- from ecodev_front.components.navlink import navlink
27
- from ecodev_front.components.pie_chart import pie_chart
28
- from ecodev_front.components.report_value import report_value
29
- from ecodev_front.components.search_bar import search_bar
30
- from ecodev_front.components.segment_control import segmented_control
31
- from ecodev_front.components.segment_control import segmented_control_label
32
- from ecodev_front.components.select import select
33
- from ecodev_front.components.select import select_label
34
- from ecodev_front.components.stack import stack
35
- from ecodev_front.components.stepper import stepper_step
36
- from ecodev_front.components.stepper import vertical_stepper
37
- from ecodev_front.components.text import sub_text
38
- from ecodev_front.components.text import text_header
39
- from ecodev_front.components.upload_box import upload_box
40
-
41
- __all__ = ['app_logo', 'app_title', 'app_header', 'menu', 'data_table', 'header_divider',
42
- 'action_item', 'login', 'menu_item', 'upload_box', 'card_section',
43
- 'card_title', 'macro_info', 'number_formatting', 'background_card', 'search_bar',
44
- 'graph_box', 'footer_style', 'report_value', 'centered_div', 'pie_chart',
45
- 'app_footer', 'vertical_stepper', 'stepper_step', 'group', 'segmented_control',
46
- 'select', 'stack', 'text_header', 'sub_text', 'divider', 'kpi',
47
- 'segmented_control_label', 'select_label', 'navlink', 'get_magnitude']
@@ -1,12 +0,0 @@
1
- """
2
- Module containing all base (app) and page layouts
3
- """
4
- from ecodev_front.layouts.app_layout import dash_base_layout
5
- from ecodev_front.layouts.page_layouts import page_left_aside
6
- from ecodev_front.layouts.page_layouts import page_left_right_asides
7
- from ecodev_front.layouts.page_layouts import page_right_aside
8
- from ecodev_front.layouts.page_layouts import simple_layout
9
-
10
-
11
- __all__ = ['dash_base_layout', 'simple_layout',
12
- 'page_left_aside', 'page_right_aside', 'page_left_right_asides']
File without changes
File without changes