@apexcura/ui-components 0.0.12-Beta35 → 0.0.12-Beta36
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 +4 -1
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
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,12 +196,13 @@ 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
|
}
|
|
201
203
|
};
|
|
202
204
|
const getButtonStyle = (option) => {
|
|
203
|
-
return selectedValue === option.value ? option.selectedClassName : option.
|
|
205
|
+
return selectedValue === option.value ? option.selectedClassName : option.selectedClassName;
|
|
204
206
|
};
|
|
205
207
|
return /* @__PURE__ */ import_react6.default.createElement("div", null, /* @__PURE__ */ import_react6.default.createElement("h1", null, "hsjas"), /* @__PURE__ */ import_react6.default.createElement(
|
|
206
208
|
import_antd6.Radio.Group,
|
|
@@ -215,6 +217,7 @@ var RadioElement = (props) => {
|
|
|
215
217
|
{
|
|
216
218
|
key: option.value,
|
|
217
219
|
value: option.value,
|
|
220
|
+
disabled: isDisabled && selectedValue !== option.value,
|
|
218
221
|
className: getButtonStyle(option)
|
|
219
222
|
},
|
|
220
223
|
option.label
|
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,12 +149,13 @@ 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
|
}
|
|
154
156
|
};
|
|
155
157
|
const getButtonStyle = (option) => {
|
|
156
|
-
return selectedValue === option.value ? option.selectedClassName : option.
|
|
158
|
+
return selectedValue === option.value ? option.selectedClassName : option.selectedClassName;
|
|
157
159
|
};
|
|
158
160
|
return /* @__PURE__ */ React6.createElement("div", null, /* @__PURE__ */ React6.createElement("h1", null, "hsjas"), /* @__PURE__ */ React6.createElement(
|
|
159
161
|
Radio.Group,
|
|
@@ -168,6 +170,7 @@ var RadioElement = (props) => {
|
|
|
168
170
|
{
|
|
169
171
|
key: option.value,
|
|
170
172
|
value: option.value,
|
|
173
|
+
disabled: isDisabled && selectedValue !== option.value,
|
|
171
174
|
className: getButtonStyle(option)
|
|
172
175
|
},
|
|
173
176
|
option.label
|