dash_mantine_components 0.12.0 → 0.12.1
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.
package/README.md
CHANGED
|
@@ -36,23 +36,38 @@ pip install dash-mantine-components
|
|
|
36
36
|
## Quickstart
|
|
37
37
|
|
|
38
38
|
```python
|
|
39
|
+
from datetime import date
|
|
40
|
+
|
|
41
|
+
from dash import Dash, Input, Output, callback, html
|
|
42
|
+
from dash.exceptions import PreventUpdate
|
|
43
|
+
|
|
39
44
|
import dash_mantine_components as dmc
|
|
40
|
-
from dash import Dash, Input, Output
|
|
41
45
|
|
|
42
46
|
app = Dash(__name__)
|
|
43
47
|
|
|
44
48
|
app.layout = html.Div(
|
|
45
49
|
[
|
|
46
|
-
dmc.DatePicker(
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
dmc.DatePicker(
|
|
51
|
+
id="date-picker",
|
|
52
|
+
label="Start Date",
|
|
53
|
+
description="You can also provide a description",
|
|
54
|
+
minDate=date(2020, 8, 5),
|
|
55
|
+
value=None,
|
|
56
|
+
style={"width": 200},
|
|
57
|
+
),
|
|
58
|
+
dmc.Space(h=10),
|
|
59
|
+
dmc.Text(id="selected-date"),
|
|
49
60
|
]
|
|
50
61
|
)
|
|
51
62
|
|
|
52
63
|
|
|
53
|
-
@
|
|
54
|
-
def
|
|
55
|
-
|
|
64
|
+
@callback(Output("selected-date", "children"), Input("date-picker", "value"))
|
|
65
|
+
def update_output(d):
|
|
66
|
+
prefix = "You have selected: "
|
|
67
|
+
if d:
|
|
68
|
+
return prefix + d
|
|
69
|
+
else:
|
|
70
|
+
raise PreventUpdate
|
|
56
71
|
|
|
57
72
|
|
|
58
73
|
if __name__ == "__main__":
|
|
@@ -66,6 +81,7 @@ Thanks to the following people for supporting my efforts on dash-mantine-compone
|
|
|
66
81
|
1. [ASCEND.IO](https://www.ascend.io)
|
|
67
82
|
2. [Ann Marie Ward](https://github.com/AnnMarieW)
|
|
68
83
|
3. [Rick Ahlf](https://www.linkedin.com/in/rickahlf/)
|
|
84
|
+
4. [josca42](https://github.com/josca42)
|
|
69
85
|
|
|
70
86
|
## Contributing
|
|
71
87
|
|