oolib 2.21.0 → 2.21.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.
|
@@ -56,7 +56,16 @@ exports.SwitchDouble = SwitchDouble;
|
|
|
56
56
|
function SwitchSingle(_a) {
|
|
57
57
|
var id = _a.id, value = _a.value, option = _a.option, onChange = _a.onChange, _b = _a.disabled, disabled = _b === void 0 ? false : _b, invert = _a.invert, saveValueAsString = _a.saveValueAsString;
|
|
58
58
|
var props = arguments[0];
|
|
59
|
-
|
|
59
|
+
/**
|
|
60
|
+
* very important that we check this way,
|
|
61
|
+
* as opposed to checking as 'value === undefined'
|
|
62
|
+
*
|
|
63
|
+
* because in some cases in the TCI, the initial value
|
|
64
|
+
* is not equal to undefined. it is equal to 'false' or something else
|
|
65
|
+
*/
|
|
66
|
+
var isInactive = saveValueAsString
|
|
67
|
+
? value !== option.value
|
|
68
|
+
: (value === null || value === void 0 ? void 0 : value.value) !== option.value;
|
|
60
69
|
var handleClick = function (v) {
|
|
61
70
|
!disabled &&
|
|
62
71
|
onChange &&
|