oolib 2.150.2 → 2.150.3
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.
|
@@ -7,7 +7,7 @@ export function SwitchDouble({ id, value: valueProp, options, onChange, invert,
|
|
|
7
7
|
saveValueAsString: any;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
}, ...args: any[]): React.JSX.Element;
|
|
10
|
-
export function SwitchSingle({ id, value, option, onChange, disabled, invert, saveValueAsString, layoutStyle, infoTooltip, }: {
|
|
10
|
+
export function SwitchSingle({ id, value, option, onChange, disabled, invert, saveValueAsString, layoutStyle, infoTooltip, inactiveValue }: {
|
|
11
11
|
id: any;
|
|
12
12
|
value: any;
|
|
13
13
|
option: any;
|
|
@@ -17,5 +17,6 @@ export function SwitchSingle({ id, value, option, onChange, disabled, invert, sa
|
|
|
17
17
|
saveValueAsString: any;
|
|
18
18
|
layoutStyle?: string;
|
|
19
19
|
infoTooltip: any;
|
|
20
|
+
inactiveValue?: any;
|
|
20
21
|
}, ...args: any[]): React.JSX.Element;
|
|
21
22
|
import React from "react";
|
|
@@ -51,7 +51,7 @@ function SwitchDouble(_a) {
|
|
|
51
51
|
}
|
|
52
52
|
exports.SwitchDouble = SwitchDouble;
|
|
53
53
|
function SwitchSingle(_a) {
|
|
54
|
-
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, _c = _a.layoutStyle, layoutStyle = _c === void 0 ? "style1" : _c, infoTooltip = _a.infoTooltip;
|
|
54
|
+
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, _c = _a.layoutStyle, layoutStyle = _c === void 0 ? "style1" : _c, infoTooltip = _a.infoTooltip, _d = _a.inactiveValue, inactiveValue = _d === void 0 ? undefined : _d;
|
|
55
55
|
var props = arguments[0];
|
|
56
56
|
var localize = (0, utilsOolib_1.useLocale)();
|
|
57
57
|
/**
|
|
@@ -67,7 +67,7 @@ function SwitchSingle(_a) {
|
|
|
67
67
|
var handleClick = function (v) {
|
|
68
68
|
!disabled &&
|
|
69
69
|
onChange &&
|
|
70
|
-
onChange(id, isInactive ? (saveValueAsString ? option.value : option) :
|
|
70
|
+
onChange(id, isInactive ? (saveValueAsString ? option.value : option) : inactiveValue);
|
|
71
71
|
};
|
|
72
72
|
var genSwitch = function () { return (react_1.default.createElement(styled_1.StyledButtonSlider, { inactive: isInactive, disabled: disabled, invert: invert, onClick: handleClick },
|
|
73
73
|
react_1.default.createElement(styled_1.StyledSwitch, { className: "StyledSwitch" //read in styled.js why we are using an okf-anti-pattern
|