@aloudata/aloudata-design 0.4.7 → 0.4.8-beta.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.
@@ -135,7 +135,10 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
135
135
  });
136
136
  }
137
137
 
138
- setSelectedOptions(newOptions);
138
+ if (typeof value === 'undefined') {
139
+ setSelectedOptions(newOptions);
140
+ }
141
+
139
142
  onChange === null || onChange === void 0 ? void 0 : onChange(newOptions.map(function (item) {
140
143
  return item.value;
141
144
  }), newOptions);
@@ -154,9 +157,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
154
157
  option: option,
155
158
  disabled: option.disabled,
156
159
  onChange: function onChange(selected) {
157
- if (typeof value === 'undefined') {
158
- onMultipleOptionChange(option, selected);
159
- }
160
+ onMultipleOptionChange(option, selected);
160
161
  }
161
162
  });
162
163
  }));
@@ -165,7 +166,10 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
165
166
  var onSingleOptionChange = function onSingleOptionChange(option) {
166
167
  var _props$onSelect2;
167
168
 
168
- setSelectedOptions([option]);
169
+ if (typeof value === 'undefined') {
170
+ setSelectedOptions([option]);
171
+ }
172
+
169
173
  onChange === null || onChange === void 0 ? void 0 : onChange(option.value, option);
170
174
  (_props$onSelect2 = props.onSelect) === null || _props$onSelect2 === void 0 ? void 0 : _props$onSelect2.call(props, option.value, option);
171
175
  setIsOpen(false);
@@ -184,9 +188,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
184
188
  option: option,
185
189
  disabled: option.disabled,
186
190
  onChange: function onChange() {
187
- if (typeof value === 'undefined') {
188
- onSingleOptionChange(option);
189
- }
191
+ onSingleOptionChange(option);
190
192
  }
191
193
  });
192
194
  }));
@@ -243,7 +245,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
243
245
  };
244
246
 
245
247
  useEffect(function () {
246
- getSelectedOptionsFromValue(isMultiple, options, value);
248
+ setSelectedOptions(getSelectedOptionsFromValue(isMultiple, options, value));
247
249
  }, [value]);
248
250
  return /*#__PURE__*/React.createElement("div", {
249
251
  className: classNames('ald-select', className, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloudata/aloudata-design",
3
- "version": "0.4.7",
3
+ "version": "0.4.8-beta.1",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",
@@ -50,8 +50,8 @@
50
50
  ]
51
51
  },
52
52
  "dependencies": {
53
- "@aloudata/icons-react": "^0.1.3",
54
- "@aloudata/icons-svg": "^0.1.3",
53
+ "@aloudata/icons-react": "0.1.5",
54
+ "@aloudata/icons-svg": "0.1.5",
55
55
  "antd": "5.2.0",
56
56
  "memoize-one": "^6.0.0",
57
57
  "rc-menu": "^9.8.0",