dara-components 1.21.8__py3-none-any.whl → 1.21.10__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.
@@ -61015,7 +61015,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
61015
61015
  const isNil = /* @__PURE__ */ getDefaultExportFromCjs$1(isNilExports);
61016
61016
  var isObjectExports = requireIsObject();
61017
61017
  const isObject = /* @__PURE__ */ getDefaultExportFromCjs$1(isObjectExports);
61018
- const isPrimitive = (val) => isNil(val) || !isObject(val);
61018
+ const isPrimitive = (val) => !isNil(val) && !isObject(val);
61019
61019
  function getMultiselectItems(values2, items) {
61020
61020
  if (!values2) {
61021
61021
  return [];
@@ -61063,21 +61063,24 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
61063
61063
  }
61064
61064
  return items;
61065
61065
  }, [items]);
61066
- const toItem = (val) => {
61067
- const matchingItem = formattedItems.find((item) => {
61068
- if (isItem(item)) {
61069
- if (isPrimitive(item.value) && isPrimitive(val)) {
61070
- return String(item.value) === String(val);
61066
+ const toItem = React$1.useCallback(
61067
+ (val) => {
61068
+ const matchingItem = formattedItems.find((item) => {
61069
+ if (isItem(item)) {
61070
+ if (isPrimitive(item.value) && isPrimitive(val)) {
61071
+ return String(item.value) === String(val);
61072
+ }
61073
+ return isEqual$4(item.value, val);
61071
61074
  }
61072
- return isEqual$4(item.value, val);
61075
+ return false;
61076
+ });
61077
+ if (matchingItem) {
61078
+ return matchingItem;
61073
61079
  }
61074
- return false;
61075
- });
61076
- if (matchingItem) {
61077
- return matchingItem;
61078
- }
61079
- return isPrimitive(val) ? { label: String(val), value: val } : val;
61080
- };
61080
+ return isPrimitive(val) ? { label: String(val), value: val } : val;
61081
+ },
61082
+ [formattedItems]
61083
+ );
61081
61084
  const onChangeAction = core$1.useAction(props.onchange);
61082
61085
  const itemHasListSection = React$1.useRef(null);
61083
61086
  if (itemHasListSection.current === null) {
@@ -61097,7 +61100,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
61097
61100
  },
61098
61101
  [setValue]
61099
61102
  );
61100
- const selectedItem2 = React$1.useMemo(() => toItem(value), [value]);
61103
+ const selectedItem2 = React$1.useMemo(() => toItem(value), [value, toItem]);
61101
61104
  return /* @__PURE__ */ React.createElement(
61102
61105
  StyledSectionedList,
61103
61106
  {
@@ -61122,13 +61125,13 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
61122
61125
  formCtx2.updateForm(currentSelection);
61123
61126
  }
61124
61127
  },
61125
- [setValue]
61128
+ [formCtx2, onChangeAction, setValue]
61126
61129
  );
61127
61130
  const selectedItems = React$1.useMemo(() => {
61128
61131
  const found = getMultiselectItems(value, itemArray);
61129
61132
  const explicitValues = Array.isArray(value) ? value.map(toItem) : value;
61130
61133
  return isEmpty(found) ? explicitValues ?? null : found;
61131
- }, [formattedItems, value]);
61134
+ }, [itemArray, toItem, value]);
61132
61135
  return /* @__PURE__ */ React.createElement(
61133
61136
  StyledMultiSelect,
61134
61137
  {
@@ -61146,7 +61149,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
61146
61149
  }
61147
61150
  const selectedItem = React$1.useMemo(
61148
61151
  () => itemArray.find((item) => String(item.value) === String(value)) ?? toItem(value) ?? null,
61149
- [value]
61152
+ [itemArray, toItem, value]
61150
61153
  );
61151
61154
  const onSelect = React$1.useCallback(
61152
61155
  (item) => {
@@ -61156,7 +61159,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
61156
61159
  formCtx2.updateForm(item.value);
61157
61160
  }
61158
61161
  },
61159
- [setValue, onChangeAction]
61162
+ [setValue, onChangeAction, formCtx2]
61160
61163
  );
61161
61164
  if (props.searchable) {
61162
61165
  return /* @__PURE__ */ React.createElement(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dara-components
3
- Version: 1.21.8
3
+ Version: 1.21.10
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.8)
19
+ Requires-Dist: dara-core (==1.21.10)
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.8/img/dara_light.svg?raw=true">
31
+ <img src="https://github.com/causalens/dara/blob/v1.21.10/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)
@@ -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=MygfcWawlUkpfxGVqu31Tc82uUNG8Vszep1_2DxtTSA,6855350
82
+ dara/components/umd/dara.components.umd.js,sha256=dnoqtLQt21gIW8c1B7_ZYF4Q049SnzgH42r0QvoruJc,6855502
83
83
  dara/components/umd/style.css,sha256=Qm0_kcxXBDoXvvPTc7YCttkl1zMFifdcp-KufTunPNY,162729
84
- dara_components-1.21.8.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
85
- dara_components-1.21.8.dist-info/METADATA,sha256=r9R1Cuz6gKEwHkq6FWvDwsgc__Hppa6m9hZ7MJdQXA8,2743
86
- dara_components-1.21.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
87
- dara_components-1.21.8.dist-info/RECORD,,
84
+ dara_components-1.21.10.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
85
+ dara_components-1.21.10.dist-info/METADATA,sha256=u9nDDsB1PS2zKp_kVYhO_yl-mcFmfTcet-9IbpAd5bo,2746
86
+ dara_components-1.21.10.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
87
+ dara_components-1.21.10.dist-info/RECORD,,