orc-shared 5.8.0-dev.21 → 5.8.0-dev.23
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/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +3 -1
- package/dist/components/MaterialUI/Inputs/Radio.js +2 -1
- package/package.json +1 -1
- package/src/components/MaterialUI/DataDisplay/PredefinedElements/StepperModal.js +7 -1
- package/src/components/MaterialUI/Inputs/Radio.js +1 -1
- package/src/components/MaterialUI/Inputs/Radio.test.js +35 -1
|
@@ -195,7 +195,9 @@ var StepperModal = function StepperModal(_ref) {
|
|
|
195
195
|
variant: "contained",
|
|
196
196
|
color: "primary",
|
|
197
197
|
disabled: nextDisabled,
|
|
198
|
-
onClick:
|
|
198
|
+
onClick: function onClick() {
|
|
199
|
+
return nextClick();
|
|
200
|
+
},
|
|
199
201
|
disableElevation: true
|
|
200
202
|
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _sharedMessages.default.next))), currentStep === steps.length - 1 && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
201
203
|
variant: "contained",
|
|
@@ -154,6 +154,7 @@ var Radio = function Radio(_ref) {
|
|
|
154
154
|
value: value,
|
|
155
155
|
onChange: handleChange
|
|
156
156
|
}, radios.map(function (radio) {
|
|
157
|
+
var _radio$disabled;
|
|
157
158
|
var handleClick = radio.clickEvent ? function (event) {
|
|
158
159
|
return radio.clickEvent(event.target.value);
|
|
159
160
|
} : null;
|
|
@@ -161,7 +162,7 @@ var Radio = function Radio(_ref) {
|
|
|
161
162
|
key: "radiobutton_".concat(radio.value),
|
|
162
163
|
value: radio.value,
|
|
163
164
|
label: radio.label,
|
|
164
|
-
disabled: disabled,
|
|
165
|
+
disabled: disabled ? true : (_radio$disabled = radio.disabled) != null ? _radio$disabled : false,
|
|
165
166
|
control: /*#__PURE__*/_react.default.createElement(_Radio.default, {
|
|
166
167
|
color: "primary",
|
|
167
168
|
checkedIcon: /*#__PURE__*/_react.default.createElement("span", {
|
package/package.json
CHANGED
|
@@ -180,7 +180,13 @@ const StepperModal = ({
|
|
|
180
180
|
</Button>
|
|
181
181
|
))
|
|
182
182
|
) : (
|
|
183
|
-
<Button
|
|
183
|
+
<Button
|
|
184
|
+
variant="contained"
|
|
185
|
+
color="primary"
|
|
186
|
+
disabled={nextDisabled}
|
|
187
|
+
onClick={() => nextClick()}
|
|
188
|
+
disableElevation
|
|
189
|
+
>
|
|
184
190
|
<FormattedMessage {...sharedMessages.next} />
|
|
185
191
|
</Button>
|
|
186
192
|
))}
|
|
@@ -49,6 +49,7 @@ const ExpectComponentToBeRenderedProperly = radioProps => {
|
|
|
49
49
|
expect(radioElements.length, "to equal", radios.length);
|
|
50
50
|
|
|
51
51
|
radios.forEach(radio => {
|
|
52
|
+
const disabledOption = disabled ? true : radio.disabled ?? false;
|
|
52
53
|
let option =
|
|
53
54
|
radioElements.find(
|
|
54
55
|
x =>
|
|
@@ -57,7 +58,7 @@ const ExpectComponentToBeRenderedProperly = radioProps => {
|
|
|
57
58
|
x.props.control.type.options.name === "MuiRadio" &&
|
|
58
59
|
x.props.value === radio.value &&
|
|
59
60
|
x.props.label === radio.label &&
|
|
60
|
-
x.props.disabled ===
|
|
61
|
+
x.props.disabled === disabledOption,
|
|
61
62
|
) || null;
|
|
62
63
|
expect(option, "not to be", null);
|
|
63
64
|
});
|
|
@@ -226,4 +227,37 @@ describe("Radio Component", () => {
|
|
|
226
227
|
|
|
227
228
|
ExpectEventToBeFiredWithOptionValue(radioProps, clickEvent, "option2");
|
|
228
229
|
});
|
|
230
|
+
|
|
231
|
+
it("Renders Radio component properly with options all disbaled", () => {
|
|
232
|
+
radios.forEach(radio => {
|
|
233
|
+
radio.disabled = true;
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
radioProps.set(RadioProps.propNames.label, "aRadioLabel");
|
|
237
|
+
radioProps.set(RadioProps.propNames.defaultVal, "option1");
|
|
238
|
+
radioProps.set(RadioProps.propNames.value, "option1");
|
|
239
|
+
radioProps.set(RadioProps.propNames.radios, radios);
|
|
240
|
+
radioProps.set(RadioProps.propNames.row, true);
|
|
241
|
+
radioProps.set(RadioProps.propNames.disabled, false);
|
|
242
|
+
radioProps.set(RadioProps.propNames.error, null);
|
|
243
|
+
radioProps.set(RadioProps.propNames.allowSingleRadio, true);
|
|
244
|
+
|
|
245
|
+
ExpectComponentToBeRenderedProperly(radioProps);
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
it("Renders Radio component properly with half options disbaled", () => {
|
|
249
|
+
radios[0].disabled = true;
|
|
250
|
+
radios[1].disabled = true;
|
|
251
|
+
|
|
252
|
+
radioProps.set(RadioProps.propNames.label, "aRadioLabel");
|
|
253
|
+
radioProps.set(RadioProps.propNames.defaultVal, "option1");
|
|
254
|
+
radioProps.set(RadioProps.propNames.value, "option1");
|
|
255
|
+
radioProps.set(RadioProps.propNames.radios, radios);
|
|
256
|
+
radioProps.set(RadioProps.propNames.row, true);
|
|
257
|
+
radioProps.set(RadioProps.propNames.disabled, false);
|
|
258
|
+
radioProps.set(RadioProps.propNames.error, null);
|
|
259
|
+
radioProps.set(RadioProps.propNames.allowSingleRadio, true);
|
|
260
|
+
|
|
261
|
+
ExpectComponentToBeRenderedProperly(radioProps);
|
|
262
|
+
});
|
|
229
263
|
});
|