dara-components 1.21.11__py3-none-any.whl → 1.21.13__py3-none-any.whl

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.
@@ -17,6 +17,8 @@ limitations under the License.
17
17
 
18
18
  from typing import List, Optional, Union
19
19
 
20
+ from typing_extensions import deprecated
21
+
20
22
  from dara.components.common.base_component import (
21
23
  ContentComponent,
22
24
  LayoutError,
@@ -27,6 +29,7 @@ from dara.core.definitions import discover
27
29
  from dara.core.interactivity import AnyVariable, DerivedVariable, Variable
28
30
 
29
31
 
32
+ @deprecated('Use `dara.core.Link` instead')
30
33
  @discover
31
34
  class Anchor(ModifierComponent):
32
35
  """
@@ -110,6 +110,10 @@ class Button(LayoutComponent):
110
110
  ```
111
111
 
112
112
  :param disabled: A variable, condition, or bool to disabled the button when true
113
+ :param loading: A variable, condition, or bool to set the button to a loading state, showing a spinner.
114
+ By default, the button will automatically be set to loading=True while the onclick action is running,
115
+ equivalent to `Button(..., onclick=my_action, loading=my_action.loading)`. You can opt out of this behaviour by
116
+ simply setting `loading=False`.
113
117
  :param onclick: An Action that is triggered by clicking the button
114
118
  :param icon: An optional icon to display, see dara.core.css.get_icon for details
115
119
  :param styling: A style of the button, can be 'primary', 'secondary', 'error', 'plain' or 'ghost'
@@ -120,6 +124,7 @@ class Button(LayoutComponent):
120
124
  """
121
125
 
122
126
  disabled: Optional[Union[Condition, ClientVariable, bool]] = None
127
+ loading: Optional[Union[Condition, ClientVariable, bool]] = None
123
128
  onclick: Optional[Action] = None
124
129
  icon: Optional[str] = None
125
130
  styling: Optional[ButtonStyle] = None
@@ -51941,11 +51941,13 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
51941
51941
  const StyledButton$1 = core$1.injectCss(G(Button$4)`
51942
51942
  flex: ${(props) => props.isSimpleButton ? void 0 : "1 1 100%"};
51943
51943
  `);
51944
- function Button({ children: children2, className, disabled: disabled2, icon, onclick, outline, styling, ...props }, ref) {
51944
+ function Button({ children: children2, className, disabled: disabled2, icon, onclick, outline, styling, loading, ...props }, ref) {
51945
51945
  const [style2, css2] = core$1.useComponentStyles(props);
51946
51946
  const onClick = core$1.useAction(onclick);
51947
- const loading = core$1.useActionIsLoading(onclick);
51947
+ const actionLoading = core$1.useActionIsLoading(onclick);
51948
51948
  const disabledValue = core$1.useConditionOrVariable(disabled2);
51949
+ const propLoading = core$1.useConditionOrVariable(loading);
51950
+ const loadingValue = loading === null || loading === void 0 ? actionLoading : propLoading;
51949
51951
  const Icon2 = icon ? core$1.getIcon(icon) : null;
51950
51952
  const iconColor = Array.isArray(children2) ? children2?.[0]?.props?.color || "inherit" : "inherit";
51951
51953
  return /* @__PURE__ */ React__namespace.createElement(
@@ -51956,7 +51958,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
51956
51958
  className,
51957
51959
  disabled: disabledValue,
51958
51960
  isSimpleButton: typeof children2 === "string" || children2[0]?.name === "Text",
51959
- loading,
51961
+ loading: loadingValue,
51960
51962
  onClick: (e3) => {
51961
51963
  if (props.stop_click_propagation !== false) {
51962
51964
  e3.stopPropagation();
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dara-components
3
- Version: 1.21.11
3
+ Version: 1.21.13
4
4
  Summary: Components for the Dara Framework
5
5
  Home-page: https://dara.causalens.com/
6
6
  License: Apache-2.0
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.12
16
16
  Requires-Dist: bokeh (>=3.1.0,<3.2.0)
17
17
  Requires-Dist: cai-causal-graph (>=0.3.6)
18
18
  Requires-Dist: certifi (>=2024.7.4)
19
- Requires-Dist: dara-core (==1.21.11)
19
+ Requires-Dist: dara-core (==1.21.13)
20
20
  Requires-Dist: dill (>=0.3.0,<0.4.0)
21
21
  Requires-Dist: matplotlib (>=2.0.0)
22
22
  Requires-Dist: pandas (>=1.1.0,<3.0.0)
@@ -28,7 +28,7 @@ Description-Content-Type: text/markdown
28
28
 
29
29
  # Dara Components
30
30
 
31
- <img src="https://github.com/causalens/dara/blob/v1.21.11/img/dara_light.svg?raw=true">
31
+ <img src="https://github.com/causalens/dara/blob/v1.21.13/img/dara_light.svg?raw=true">
32
32
 
33
33
  ![Master tests](https://github.com/causalens/dara/actions/workflows/tests.yml/badge.svg?branch=master)
34
34
  [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
@@ -1,10 +1,10 @@
1
1
  dara/components/__init__.py,sha256=JjN7EAGU-tM7I7YHyKRAuZlcbpJFcVcFaGit5StehDs,1372
2
2
  dara/components/common/__init__.py,sha256=amZWLKVUsq987chihQxzNj40WyspcbBEtEqR0mTZ_pA,4076
3
3
  dara/components/common/accordion.py,sha256=_JQGdhtC97YlV3_MUydeXTN7rKJFsWHy2JQzq_c0CXU,9498
4
- dara/components/common/anchor.py,sha256=pcQNFG7xnf12jQnGROgyLlvwmvlsVGo8olxQVu3fXMI,2791
4
+ dara/components/common/anchor.py,sha256=ceN-6Vc0ekWz9VrFkFChO_Hm-FGMI1nMc9DJBAv9hnc,2877
5
5
  dara/components/common/base_component.py,sha256=rUFmLbe8DHL8S_ey5h93zuIP62cK26zknWwUF5eqp9I,4619
6
6
  dara/components/common/bullet_list.py,sha256=yk4lFAn6Bzx9UByp27P7ioVidAfsTPl5d4hIkG7MRkQ,1433
7
- dara/components/common/button.py,sha256=MIiQ6KSyO6z13kHd7lHAoxQeAGVYguYELLStw3JwBz0,4907
7
+ dara/components/common/button.py,sha256=DhB-qgh46_vmoEVbxItYI5onMum_60hatyAUmOSoHWk,5351
8
8
  dara/components/common/button_bar.py,sha256=3_q6ccopXP0Gx_wdsGnejU6oN8D98lsOyQKBNhx-AQA,3802
9
9
  dara/components/common/card.py,sha256=-_14Um86g_VQVLcCXDv-PpfkiH_pN68J4ZIcZ4lp3kY,2102
10
10
  dara/components/common/carousel.py,sha256=T-d4w2pF9wB5sNsXe2i3rEfiZoRZJd5D4jVD9ctw-Qk,5344
@@ -79,9 +79,9 @@ dara/components/smart/data_slicer/utils/core.py,sha256=4M_HA8oBzAkHklHgmaJ-qiKA3
79
79
  dara/components/smart/data_slicer/utils/data_preview.py,sha256=OAphjMrm3F76XmJ09X7sZSeOeKqGJFwN5ooo3qcyrG4,1722
80
80
  dara/components/smart/data_slicer/utils/plotting.py,sha256=TB00576kbA6y1eRuZBe09UAcZmluY4iJsKmYnXZ3hWQ,3389
81
81
  dara/components/smart/hierarchy.py,sha256=3RtHj68gA8H_X9FxQdaeSJloTqe8ciH52ku6f7zy33M,2902
82
- dara/components/umd/dara.components.umd.js,sha256=dnoqtLQt21gIW8c1B7_ZYF4Q049SnzgH42r0QvoruJc,6855502
82
+ dara/components/umd/dara.components.umd.js,sha256=RciXoiTSMp5321RlwRKkD5L4rgc8C3y6X1hmknnnMKw,6855690
83
83
  dara/components/umd/style.css,sha256=Qm0_kcxXBDoXvvPTc7YCttkl1zMFifdcp-KufTunPNY,162729
84
- dara_components-1.21.11.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
85
- dara_components-1.21.11.dist-info/METADATA,sha256=sh6ukwxVxqylEilHUSvKJIGqwgZbe4TH2Xw1WZWt1sA,2746
86
- dara_components-1.21.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
87
- dara_components-1.21.11.dist-info/RECORD,,
84
+ dara_components-1.21.13.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
85
+ dara_components-1.21.13.dist-info/METADATA,sha256=4Xgvikq7DiLthXzKTdA_26BsGXUWFLh8hi-sQQqMGvI,2746
86
+ dara_components-1.21.13.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
87
+ dara_components-1.21.13.dist-info/RECORD,,