dash_mantine_components 0.11.1 → 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(id="datepicker", format="dddd, MMMM D, YYYY"),
47
- dmc.Text(id="text"),
48
- dmc.Button("Click Me!")
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
- @app.callback(Output("text", "children"), Input("datepicker", "date"))
54
- def datepicker(date):
55
- return date
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__":
@@ -63,8 +78,10 @@ if __name__ == "__main__":
63
78
 
64
79
  Thanks to the following people for supporting my efforts on dash-mantine-components.
65
80
 
66
- 1. [Ann Marie Ward](https://github.com/AnnMarieW)
67
- 2. [Rick Ahlf](https://github.com/rick643charts)
81
+ 1. [ASCEND.IO](https://www.ascend.io)
82
+ 2. [Ann Marie Ward](https://github.com/AnnMarieW)
83
+ 3. [Rick Ahlf](https://www.linkedin.com/in/rickahlf/)
84
+ 4. [josca42](https://github.com/josca42)
68
85
 
69
86
  ## Contributing
70
87