@apexcura/ui-components 0.0.12-Beta35 → 0.0.12-Beta37

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
@@ -186,6 +186,7 @@ var SelectElement = (props) => {
186
186
  var import_react6 = __toESM(require("react"));
187
187
  var import_antd6 = require("antd");
188
188
  var RadioElement = (props) => {
189
+ const [isDisabled, setIsDisabled] = (0, import_react6.useState)(props.disabled);
189
190
  const [selectedValue, setSelectedValue] = (0, import_react6.useState)(props.value);
190
191
  let optionType;
191
192
  if (props.optionType === "button") {
@@ -195,6 +196,7 @@ var RadioElement = (props) => {
195
196
  const selectedVal = e.target.value;
196
197
  const selectedOptions = [{ id: selectedVal, value: selectedVal }];
197
198
  setSelectedValue(selectedVal);
199
+ setIsDisabled(true);
198
200
  if (props.onChange) {
199
201
  props.onChange(selectedOptions);
200
202
  }
@@ -215,7 +217,9 @@ var RadioElement = (props) => {
215
217
  {
216
218
  key: option.value,
217
219
  value: option.value,
218
- className: getButtonStyle(option)
220
+ disabled: isDisabled && selectedValue !== option.value,
221
+ className: getButtonStyle(option),
222
+ style: { pointerEvents: isDisabled && selectedValue !== option.value ? "none" : "auto" }
219
223
  },
220
224
  option.label
221
225
  ))
package/dist/index.mjs CHANGED
@@ -139,6 +139,7 @@ var SelectElement = (props) => {
139
139
  import React6, { useState as useState2 } from "react";
140
140
  import { Radio } from "antd";
141
141
  var RadioElement = (props) => {
142
+ const [isDisabled, setIsDisabled] = useState2(props.disabled);
142
143
  const [selectedValue, setSelectedValue] = useState2(props.value);
143
144
  let optionType;
144
145
  if (props.optionType === "button") {
@@ -148,6 +149,7 @@ var RadioElement = (props) => {
148
149
  const selectedVal = e.target.value;
149
150
  const selectedOptions = [{ id: selectedVal, value: selectedVal }];
150
151
  setSelectedValue(selectedVal);
152
+ setIsDisabled(true);
151
153
  if (props.onChange) {
152
154
  props.onChange(selectedOptions);
153
155
  }
@@ -168,7 +170,9 @@ var RadioElement = (props) => {
168
170
  {
169
171
  key: option.value,
170
172
  value: option.value,
171
- className: getButtonStyle(option)
173
+ disabled: isDisabled && selectedValue !== option.value,
174
+ className: getButtonStyle(option),
175
+ style: { pointerEvents: isDisabled && selectedValue !== option.value ? "none" : "auto" }
172
176
  },
173
177
  option.label
174
178
  ))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.12-Beta35",
3
+ "version": "0.0.12-Beta37",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",