@apexcura/ui-components 0.0.13-Beta0 → 0.0.13-Beta1

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/dist/index.js CHANGED
@@ -196,15 +196,12 @@ var RadioElement = (props) => {
196
196
  const [isDisabled, setIsDisabled] = (0, import_react6.useState)(props.disabled);
197
197
  const [selectedValue, setSelectedValue] = (0, import_react6.useState)(props.value);
198
198
  const optionType = props.optionType === "button" ? "button" : void 0;
199
- const handleChange = (e) => {
200
- console.log(e);
201
- const selectedVal = e.target.value;
202
- const selectedLabel = props.options ? props.options.find((f) => f.value === selectedVal)?.label : "";
203
- const selectedOptions = { label: selectedLabel, value: selectedVal };
204
- setSelectedValue(selectedVal);
199
+ const handleChange = (option) => {
200
+ console.log(option);
201
+ setSelectedValue(option);
205
202
  setIsDisabled(true);
206
203
  if (props.onChange) {
207
- props.onChange(selectedOptions);
204
+ props.onChange(option);
208
205
  }
209
206
  };
210
207
  const getButtonStyle = (option) => {
@@ -213,7 +210,6 @@ var RadioElement = (props) => {
213
210
  return /* @__PURE__ */ import_react6.default.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ import_react6.default.createElement("p", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react6.default.createElement(
214
211
  import_antd6.Radio.Group,
215
212
  {
216
- onChange: handleChange,
217
213
  optionType,
218
214
  className: props.radioGroupClassName,
219
215
  value: selectedValue
@@ -221,6 +217,9 @@ var RadioElement = (props) => {
221
217
  props.options && props.options.map((option) => /* @__PURE__ */ import_react6.default.createElement(
222
218
  import_antd6.Radio,
223
219
  {
220
+ onChange: () => {
221
+ handleChange(option);
222
+ },
224
223
  key: option.value,
225
224
  value: option.value,
226
225
  disabled: isDisabled && selectedValue !== option.value,
package/dist/index.mjs CHANGED
@@ -144,15 +144,12 @@ var RadioElement = (props) => {
144
144
  const [isDisabled, setIsDisabled] = useState2(props.disabled);
145
145
  const [selectedValue, setSelectedValue] = useState2(props.value);
146
146
  const optionType = props.optionType === "button" ? "button" : void 0;
147
- const handleChange = (e) => {
148
- console.log(e);
149
- const selectedVal = e.target.value;
150
- const selectedLabel = props.options ? props.options.find((f) => f.value === selectedVal)?.label : "";
151
- const selectedOptions = { label: selectedLabel, value: selectedVal };
152
- setSelectedValue(selectedVal);
147
+ const handleChange = (option) => {
148
+ console.log(option);
149
+ setSelectedValue(option);
153
150
  setIsDisabled(true);
154
151
  if (props.onChange) {
155
- props.onChange(selectedOptions);
152
+ props.onChange(option);
156
153
  }
157
154
  };
158
155
  const getButtonStyle = (option) => {
@@ -161,7 +158,6 @@ var RadioElement = (props) => {
161
158
  return /* @__PURE__ */ React6.createElement("div", { className: props.containerClassName }, props.label && /* @__PURE__ */ React6.createElement("p", { className: props.labelClassName }, props.label), /* @__PURE__ */ React6.createElement(
162
159
  Radio.Group,
163
160
  {
164
- onChange: handleChange,
165
161
  optionType,
166
162
  className: props.radioGroupClassName,
167
163
  value: selectedValue
@@ -169,6 +165,9 @@ var RadioElement = (props) => {
169
165
  props.options && props.options.map((option) => /* @__PURE__ */ React6.createElement(
170
166
  Radio,
171
167
  {
168
+ onChange: () => {
169
+ handleChange(option);
170
+ },
172
171
  key: option.value,
173
172
  value: option.value,
174
173
  disabled: isDisabled && selectedValue !== option.value,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.13-Beta0",
3
+ "version": "0.0.13-Beta1",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",