ecodev-front 0.0.87__tar.gz → 0.0.89__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 (67) hide show
  1. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/PKG-INFO +3 -2
  2. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/__init__.py +2 -0
  3. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/app_logo.py +2 -1
  4. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/card.py +5 -5
  5. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/constants.py +1 -1
  6. ecodev_front-0.0.89/ecodev_front/further_info.py +38 -0
  7. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/ids.py +6 -1
  8. ecodev_front-0.0.89/ecodev_front/login.py +88 -0
  9. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/pyproject.toml +1 -1
  10. ecodev_front-0.0.87/ecodev_front/further_info.py +0 -23
  11. ecodev_front-0.0.87/ecodev_front/login.py +0 -39
  12. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/LICENSE.md +0 -0
  13. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/README.md +0 -0
  14. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/accordion.py +0 -0
  15. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/alert.py +0 -0
  16. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/app_header.py +0 -0
  17. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/app_layout.py +0 -0
  18. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/app_name.py +0 -0
  19. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/app_title.py +0 -0
  20. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/aside_buttons.py +0 -0
  21. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/button.py +0 -0
  22. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/container.py +0 -0
  23. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/display_utils.py +0 -0
  24. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/div.py +0 -0
  25. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/divider.py +0 -0
  26. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/download_button.py +0 -0
  27. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/drawer.py +0 -0
  28. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/footer.py +0 -0
  29. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/graphs/__init__.py +0 -0
  30. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/graphs/bar_chart.py +0 -0
  31. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/graphs/fig_helpers.py +0 -0
  32. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/graphs/fig_layout.py +0 -0
  33. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/graphs/graph.py +0 -0
  34. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/graphs/legend_position.py +0 -0
  35. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/graphs/pie_chart.py +0 -0
  36. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/graphs/plotly_tools.py +0 -0
  37. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/graphs/scatter.py +0 -0
  38. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/graphs/subplots.py +0 -0
  39. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/graphs/sunburst.py +0 -0
  40. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/group.py +0 -0
  41. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/icon.py +0 -0
  42. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/loading_overlay.py +0 -0
  43. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/modal.py +0 -0
  44. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/module.py +0 -0
  45. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/monitoring.py +0 -0
  46. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/nav_items.py +0 -0
  47. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/navbar.py +0 -0
  48. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/navbar_page_icon.py +0 -0
  49. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/navlink.py +0 -0
  50. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/notifications.py +0 -0
  51. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/page.py +0 -0
  52. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/page_header.py +0 -0
  53. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/page_layout.py +0 -0
  54. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/report_value.py +0 -0
  55. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/search_bar.py +0 -0
  56. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/segment_control.py +0 -0
  57. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/select.py +0 -0
  58. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/shadow_box.py +0 -0
  59. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/shadow_button.py +0 -0
  60. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/stack.py +0 -0
  61. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/stepper.py +0 -0
  62. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/tables/__init__.py +0 -0
  63. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/tables/column_def.py +0 -0
  64. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/tables/data_table.py +0 -0
  65. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/tabs.py +0 -0
  66. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/text.py +0 -0
  67. {ecodev_front-0.0.87 → ecodev_front-0.0.89}/ecodev_front/upload_box.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: ecodev-front
3
- Version: 0.0.87
3
+ Version: 0.0.89
4
4
  Summary: Dash component helpers
5
5
  License: MIT
6
6
  Author: Amaury Salles
@@ -19,6 +19,7 @@ Classifier: Programming Language :: Python
19
19
  Classifier: Programming Language :: Python :: 3
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
22
23
  Classifier: Programming Language :: Python :: 3 :: Only
23
24
  Classifier: Topic :: Internet
24
25
  Classifier: Topic :: Internet :: WWW/HTTP
@@ -89,6 +89,7 @@ from ecodev_front.ids import TOKEN
89
89
  from ecodev_front.ids import URL
90
90
  from ecodev_front.loading_overlay import loading_overlay
91
91
  from ecodev_front.login import login
92
+ from ecodev_front.login import login_card
92
93
  from ecodev_front.modal import modal
93
94
  from ecodev_front.module import Module
94
95
  from ecodev_front.nav_items import action_item
@@ -272,4 +273,5 @@ __all__ = [
272
273
  'text_title',
273
274
  'label_text',
274
275
  'upload_box',
276
+ 'login_card'
275
277
  ]
@@ -13,4 +13,5 @@ def app_logo(logo_path: str = '/assets/logo.png',
13
13
  Application logo component.
14
14
  """
15
15
  style = style or {'margin-left': '10px', 'width': width}
16
- return dmc.AspectRatio(dmc.Image(src=logo_path), ratio=ratio, style=style)
16
+ return dmc.AspectRatio(dmc.Image(src=logo_path), ratio=ratio, style=style,
17
+ display='center')
@@ -5,7 +5,6 @@ from typing import Any
5
5
  from typing import Optional
6
6
 
7
7
  import dash_mantine_components as dmc
8
- from dash import html
9
8
 
10
9
  from ecodev_front.icon import dash_icon
11
10
 
@@ -14,16 +13,17 @@ DEFAULT_STYLE = {
14
13
  'justifyContent': 'center'}
15
14
 
16
15
 
17
- def background_card(children: list[dmc.CardSection | html.Div],
16
+ def background_card(children: list,
18
17
  style: dict[str, str | int | float] | None = None,
19
18
  className: str = '',
20
- card_id: str = ''
19
+ card_id: str = '',
20
+ **kwargs
21
21
  ) -> dmc.Card:
22
22
  """
23
23
  Returns a formatted dmc.Card
24
24
  """
25
25
  return dmc.Card(children, radius='md', shadow='sm', style=style or DEFAULT_STYLE,
26
- className=className, id=card_id)
26
+ className=className, id=card_id, **kwargs)
27
27
 
28
28
 
29
29
  def card_title(title: str,
@@ -94,5 +94,5 @@ def kpi(icon: str,
94
94
  ], gap='xs'
95
95
  ),
96
96
  ], bg='#f7f8f9', w=250)])
97
- ], label=tooltip, position='top', offset=3,
97
+ ], label=tooltip, position='top', offset=3,
98
98
  withArrow=True, closeDelay=300, color=c)
@@ -33,7 +33,7 @@ STEPS = 'steps'
33
33
  LABEL = 'label'
34
34
  OPTIONS = 'options'
35
35
  REQUIRED = 'required'
36
-
36
+ DISPLAY = 'display'
37
37
 
38
38
  """
39
39
  Table constants
@@ -0,0 +1,38 @@
1
+ import dash_mantine_components as dmc
2
+ from dash_iconify import DashIconify
3
+
4
+
5
+ def further_info(
6
+ info: str | list[dmc.Text],
7
+ large: bool = False,
8
+ position: str = "top-right",
9
+ multiline: bool= True,
10
+ offset: int=3,
11
+ radius: str= "md",
12
+ closeDelay: int = 300,
13
+ color: str = "white",
14
+ style: dict = {"max-width": 500, "border": "1px solid #dcdcdc"},
15
+ **kwargs
16
+ ) -> dmc.Tooltip:
17
+ """
18
+ Renders a gray info icon which opens the further info tooltip.
19
+ """
20
+
21
+ return dmc.Tooltip(
22
+ label=dmc.Text(info, c='black') if isinstance(info, str) else info,
23
+ children=[
24
+ DashIconify(
25
+ icon="material-symbols:info-outline-rounded",
26
+ color="gray",
27
+ width=28 if large else 22,
28
+ )
29
+ ],
30
+ position=position,
31
+ multiline=multiline,
32
+ offset=offset,
33
+ radius=radius,
34
+ closeDelay=closeDelay,
35
+ color=color,
36
+ style=style,
37
+ **kwargs
38
+ )
@@ -5,6 +5,10 @@ File containing component IDs, to use in callbacks
5
5
  URL = 'url'
6
6
  TOKEN = 'token'
7
7
  HEADER_ID = 'navbar-id'
8
+ LOGIN = 'login'
9
+ USERNAME = 'username'
10
+ PASSWORD = 'password'
11
+ BUTTON = 'button'
8
12
  LOGIN_USERNAME_INPUT_ID = 'login-username-id'
9
13
  LOGIN_PASSWORD_INPUT_ID = 'login-password-id'
10
14
  LOGIN_BTN_ID = 'login-button-id'
@@ -21,4 +25,5 @@ MODULE_BUTTON = 'module-button'
21
25
 
22
26
  __all__ = ['URL', 'TOKEN', 'HEADER_ID', 'LOGIN_USERNAME_INPUT_ID', 'LOGIN_PASSWORD_INPUT_ID',
23
27
  'LOGIN_BTN_ID', 'LOGOUT_BTN_ID', 'FOOTER_ID', 'MAIN_CONTENT_ID', 'NAVBAR',
24
- 'ASIDE', 'PAGE', 'APPSHELL', 'HOME_BUTTON', 'MODULE_BUTTON']
28
+ 'ASIDE', 'PAGE', 'APPSHELL', 'HOME_BUTTON', 'MODULE_BUTTON', 'LOGIN', 'USERNAME',
29
+ 'PASSWORD', 'BUTTON']
@@ -0,0 +1,88 @@
1
+ """
2
+ Module implementing the navbar login / logout components
3
+ """
4
+ import dash_mantine_components as dmc
5
+ from dash_iconify import DashIconify
6
+
7
+ from ecodev_front import INDEX
8
+ from ecodev_front import TYPE
9
+ from ecodev_front.ids import BUTTON
10
+ from ecodev_front.ids import LOGIN
11
+ from ecodev_front.ids import LOGIN_BTN_ID
12
+ from ecodev_front.ids import LOGIN_PASSWORD_INPUT_ID
13
+ from ecodev_front.ids import LOGIN_USERNAME_INPUT_ID
14
+ from ecodev_front.ids import PASSWORD
15
+ from ecodev_front.ids import USERNAME
16
+
17
+
18
+ def login(username_placeholder: str = 'Username',
19
+ password_placeholder: str = 'Password',
20
+ button_label: str = 'Login',
21
+ button_color: str = 'white'
22
+ ) -> dmc.Group:
23
+ """
24
+ Login bar component, shown when no user-tokens have been set.
25
+ """
26
+ return dmc.Group([
27
+ dmc.TextInput(id=LOGIN_USERNAME_INPUT_ID,
28
+ placeholder=username_placeholder,
29
+ radius='xl',
30
+ style={'width': '15vw'},
31
+ leftSection=DashIconify(icon='material-symbols:supervised-user-circle')),
32
+ dmc.PasswordInput(id=LOGIN_PASSWORD_INPUT_ID,
33
+ placeholder=password_placeholder,
34
+ radius='xl',
35
+ style={'width': '15vw'},
36
+ leftSection=DashIconify(icon='bi:shield-lock')),
37
+ dmc.Button(button_label,
38
+ id=LOGIN_BTN_ID,
39
+ radius='xl',
40
+ variant=button_color,
41
+ style={'margin': '5px', 'width': '5vw', 'color': 'gray'})
42
+ ], style={'display': 'flex',
43
+ 'justifyContent': 'center',
44
+ 'alignItems': 'center',
45
+ 'textAlign': 'center'})
46
+
47
+
48
+ def login_card(username_placeholder: str = 'Username',
49
+ password_placeholder: str = 'Password',
50
+ button_label: str = 'Login',
51
+ ) -> dmc.Stack:
52
+ """
53
+ Login card component, shown when no user-tokens have been set.
54
+ """
55
+ return dmc.Stack([
56
+ username_input(username_placeholder),
57
+ password_input(password_placeholder),
58
+ login_button(button_label)
59
+ ], align='center', w='15vw')
60
+
61
+
62
+ def username_input(username_placeholder: str) -> dmc.TextInput:
63
+ """
64
+ Renders the username input component
65
+ """
66
+ return dmc.TextInput(id={TYPE: LOGIN, INDEX: USERNAME},
67
+ placeholder=username_placeholder,
68
+ radius='xl',
69
+ w='100%',
70
+ leftSection=DashIconify(icon='material-symbols:supervised-user-circle'))
71
+
72
+
73
+ def password_input(password_placeholder: str) -> dmc.PasswordInput:
74
+ """
75
+ Renders the password input component
76
+ """
77
+ return dmc.PasswordInput(id={TYPE: LOGIN, INDEX: PASSWORD},
78
+ placeholder=password_placeholder,
79
+ radius='xl',
80
+ w='100%',
81
+ leftSection=DashIconify(icon='bi:shield-lock'))
82
+
83
+
84
+ def login_button(button_label: str) -> dmc.Button:
85
+ """
86
+ Renders the login button
87
+ """
88
+ return dmc.Button(button_label, id={TYPE: LOGIN, INDEX: BUTTON}, fullWidth=True)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "ecodev-front"
3
- version = "0.0.87"
3
+ version = "0.0.89"
4
4
  description = "Dash component helpers"
5
5
  authors = ["Amaury Salles <amaury.salles@gmail.com>",
6
6
  "Yoann Diep <yoann.diep@hotmail.fr>",
@@ -1,23 +0,0 @@
1
- import dash_mantine_components as dmc
2
- from dash_iconify import DashIconify
3
-
4
-
5
- def further_info(info: str | list[dmc.Text], large: bool = False) -> dmc.Tooltip:
6
- """
7
- Renders a gray info icon which opens the further info tooltip.
8
- """
9
- return dmc.Tooltip(
10
- label=info,
11
- position='top-right',
12
- multiline=True,
13
- offset=3,
14
- radius='md',
15
- color='white',
16
- style={'max-width': 500, 'border': '1px solid #dcdcdc'},
17
- closeDelay=300,
18
- children=[
19
- DashIconify(icon='material-symbols:info-outline-rounded',
20
- color='gray',
21
- width=28 if large else 22)
22
- ]
23
- )
@@ -1,39 +0,0 @@
1
- """
2
- Module implementing the navbar login / logout components
3
- """
4
- import dash_mantine_components as dmc
5
- from dash_iconify import DashIconify
6
-
7
- from ecodev_front.ids import LOGIN_BTN_ID
8
- from ecodev_front.ids import LOGIN_PASSWORD_INPUT_ID
9
- from ecodev_front.ids import LOGIN_USERNAME_INPUT_ID
10
-
11
-
12
- def login(username_placeholder: str = 'Username',
13
- password_placeholder: str = 'Password',
14
- button_label: str = 'Login',
15
- button_color: str = 'white'
16
- ) -> dmc.Group:
17
- """
18
- Login bar component, shown when no user-tokens have been set.
19
- """
20
- return dmc.Group([
21
- dmc.TextInput(id=LOGIN_USERNAME_INPUT_ID,
22
- placeholder=username_placeholder,
23
- radius='xl',
24
- style={'width': '15vw'},
25
- leftSection=DashIconify(icon='material-symbols:supervised-user-circle')),
26
- dmc.PasswordInput(id=LOGIN_PASSWORD_INPUT_ID,
27
- placeholder=password_placeholder,
28
- radius='xl',
29
- style={'width': '15vw'},
30
- leftSection=DashIconify(icon='bi:shield-lock')),
31
- dmc.Button(button_label,
32
- id=LOGIN_BTN_ID,
33
- radius='xl',
34
- variant=button_color,
35
- style={'margin': '5px', 'width': '5vw', 'color': 'gray'})
36
- ], style={'display': 'flex',
37
- 'justifyContent': 'center',
38
- 'alignItems': 'center',
39
- 'textAlign': 'center'})
File without changes
File without changes