-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
70 lines (63 loc) · 1.91 KB
/
utils.py
File metadata and controls
70 lines (63 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from random import choices
from string import ascii_letters
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash_table import DataTable
def random_string():
return ''.join(choices(ascii_letters, k=10))
def mk_card(title, obj, hint=''):
obj_id = random_string()
return dbc.Card(
dbc.CardBody([
html.H4(title, id=obj_id),
dbc.Tooltip(hint, target=obj_id),
html.Div([obj])
])
)
def mk_empty_datatable(table_id):
return DataTable(
id=table_id,
style_as_list_view=True,
editable=False,
filter_action="native",
sort_action="native",
sort_mode="multi",
page_action="native",
page_current=0,
page_size=10,
style_header={
'font-family': 'Rubik, sans-serif;',
'font-style': 'normal',
'font-weight': 'bold',
'font-size': '16px;',
'line-height': '22px;',
'display': 'flex;',
'align-items': 'center;',
'letter-spacing': '0.15px;',
'margin': '1px 9px;',
'backgroundColor': 'white',
'fontWeight': 'bold',
'textAlign': 'left'
},
style_cell={
'font-family': 'Roboto Mono, sans-serif;',
'font-style': 'normal',
'font-weight': 'normal',
'font-size': '14px;',
'line-height': '22px;',
'display': 'flex;',
'align-items': 'center;',
'letter-spacing': '0.15px;',
'backgroundColor': '#262421;',
'margin': '1px 9px;',
'flex': 'none;',
'order': '0;',
'textAlign': 'center'
},
style_cell_conditional=[
{
'if': {'column_id': c},
'textAlign': 'left'
} for c in ['ESPECIALIDADE_INTERNACAO']
]
)