oolib 2.20.2 → 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.
- package/dist/components/ActionMenu/index.js +2 -1
- package/dist/components/{LoadersAndProgressBars → LoadersAndProgress}/CircleLoader/index.d.ts +0 -0
- package/dist/components/{LoadersAndProgressBars → LoadersAndProgress}/CircleLoader/index.js +0 -0
- package/dist/components/{LoadersAndProgressBars → LoadersAndProgress}/ProgressBar/index.d.ts +0 -0
- package/dist/components/{LoadersAndProgressBars → LoadersAndProgress}/ProgressBar/index.js +0 -0
- package/dist/components/{LoadersAndProgressBars → LoadersAndProgress}/index.d.ts +0 -0
- package/dist/components/{LoadersAndProgressBars → LoadersAndProgress}/index.js +0 -0
- package/dist/components/{LoadersAndProgressBars → LoadersAndProgress}/styled.d.ts +0 -0
- package/dist/components/{LoadersAndProgressBars → LoadersAndProgress}/styled.js +0 -0
- package/dist/components/{LoadersAndProgressBars → LoadersAndProgress}/utils/index.d.ts +0 -0
- package/dist/components/{LoadersAndProgressBars → LoadersAndProgress}/utils/index.js +0 -0
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.d.ts +10 -0
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.js +55 -0
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/styled.d.ts +1 -0
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/styled.js +44 -0
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/index.d.ts +1 -0
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/index.js +5 -0
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.d.ts +17 -0
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.js +63 -0
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/styled.d.ts +1 -0
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/styled.js +13 -0
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.d.ts +10 -0
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.js +48 -0
- package/dist/components/{RadioInput/comps/RadioOption → RadioAndCheckbox/comps/RadioList/comps/RadioInput}/styled.d.ts +0 -2
- package/dist/components/{RadioInput/comps/RadioOption → RadioAndCheckbox/comps/RadioList/comps/RadioInput}/styled.js +18 -22
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/index.d.ts +1 -0
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/index.js +5 -0
- package/dist/components/RadioAndCheckbox/comps/RadioList/index.d.ts +15 -0
- package/dist/components/RadioAndCheckbox/comps/RadioList/index.js +61 -0
- package/dist/components/RadioAndCheckbox/index.d.ts +4 -0
- package/dist/components/RadioAndCheckbox/index.js +11 -0
- package/dist/components/RadioAndCheckbox/styled.d.ts +4 -0
- package/dist/components/RadioAndCheckbox/styled.js +55 -0
- package/dist/components/{RadioInput/comps/RadioOption → RadioAndCheckbox}/utils.d.ts +6 -0
- package/dist/components/RadioAndCheckbox/utils.js +25 -0
- package/dist/components/{ToggleButton → Switches}/index.d.ts +3 -3
- package/dist/components/{ToggleButton → Switches}/index.js +22 -11
- package/dist/components/Switches/styled.d.ts +4 -0
- package/dist/components/{ToggleButton → Switches}/styled.js +10 -4
- package/dist/components/TabBar/index.styled.js +1 -1
- package/dist/components/TextInputs/index.js +2 -2
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.js +1 -0
- package/dist/index.d.ts +3 -4
- package/dist/index.js +8 -11
- package/dist/utils/_EXPORTS/index.d.ts +1 -0
- package/dist/utils/_EXPORTS/index.js +3 -1
- package/dist/utils/genValueFromDisplay.d.ts +1 -0
- package/dist/utils/genValueFromDisplay.js +15 -0
- package/package.json +2 -2
- package/dist/components/CheckInput/index.d.ts +0 -1
- package/dist/components/CheckInput/index.js +0 -27
- package/dist/components/RadioInput/comps/RadioOption/index.d.ts +0 -7
- package/dist/components/RadioInput/comps/RadioOption/index.js +0 -40
- package/dist/components/RadioInput/comps/RadioOption/utils.js +0 -14
- package/dist/components/RadioInput/comps/index.d.ts +0 -1
- package/dist/components/RadioInput/comps/index.js +0 -5
- package/dist/components/RadioInput/index.d.ts +0 -12
- package/dist/components/RadioInput/index.js +0 -51
- package/dist/components/RadioInput/styled.d.ts +0 -1
- package/dist/components/RadioInput/styled.js +0 -37
- package/dist/components/RadioInput/utils.d.ts +0 -6
- package/dist/components/RadioInput/utils.js +0 -20
- package/dist/components/ToggleButton/styled.d.ts +0 -4
|
@@ -14,14 +14,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.SwitchSingle = exports.SwitchDouble = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
19
|
var BlockLabel_1 = require("../BlockLabel");
|
|
20
20
|
var _EXPORTS_1 = require("../../utils/_EXPORTS");
|
|
21
21
|
var themes_1 = require("../../themes");
|
|
22
22
|
var styled_1 = require("./styled");
|
|
23
23
|
var greyColor40 = themes_1.colors.greyColor40, greyColor100 = themes_1.colors.greyColor100, white = themes_1.colors.white;
|
|
24
|
-
function
|
|
24
|
+
function SwitchDouble(_a) {
|
|
25
25
|
var id = _a.id, valueProp = _a.value, options = _a.options, onChange = _a.onChange, invert = _a.invert, saveValueAsString = _a.saveValueAsString, _b = _a.disabled, disabled = _b === void 0 ? false : _b;
|
|
26
26
|
var value = saveValueAsString
|
|
27
27
|
? options.find(function (d) { return d.value === valueProp; })
|
|
@@ -45,17 +45,27 @@ function ToggleButton(_a) {
|
|
|
45
45
|
}
|
|
46
46
|
return (react_1.default.createElement("div", null,
|
|
47
47
|
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
|
|
48
|
-
react_1.default.createElement(styled_1.
|
|
48
|
+
react_1.default.createElement(styled_1.StyledSwitchWrapper, null,
|
|
49
49
|
react_1.default.createElement(styled_1.STYLED_LABEL, __assign({}, { lineHeight: 1, color: leftOptionColor, invert: invert }), options[0].display),
|
|
50
50
|
react_1.default.createElement(styled_1.StyledButtonSlider, { invert: invert, disabled: disabled, onClick: handleClick },
|
|
51
|
-
react_1.default.createElement(styled_1.
|
|
51
|
+
react_1.default.createElement(styled_1.StyledSwitch, { className: 'StyledSwitch' //read in styled.js why we are using an okf-anti-pattern
|
|
52
|
+
, invert: invert, disabled: disabled, direction: isLeftOptionActive ? "left" : "right" })),
|
|
52
53
|
react_1.default.createElement(styled_1.STYLED_LABEL, __assign({}, { invert: invert, color: rightOptionColor, lineHeight: 1 }), options[1].display))));
|
|
53
54
|
}
|
|
54
|
-
exports.
|
|
55
|
-
function
|
|
56
|
-
var id = _a.id, value = _a.value, option = _a.option, onChange = _a.onChange,
|
|
55
|
+
exports.SwitchDouble = SwitchDouble;
|
|
56
|
+
function SwitchSingle(_a) {
|
|
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;
|
|
57
58
|
var props = arguments[0];
|
|
58
|
-
|
|
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;
|
|
59
69
|
var handleClick = function (v) {
|
|
60
70
|
!disabled &&
|
|
61
71
|
onChange &&
|
|
@@ -66,9 +76,10 @@ function SingleToggleButton(_a) {
|
|
|
66
76
|
labelColor = isInactive ? greyColor40 : white;
|
|
67
77
|
return (react_1.default.createElement("div", null,
|
|
68
78
|
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
|
|
69
|
-
react_1.default.createElement(styled_1.
|
|
79
|
+
react_1.default.createElement(styled_1.StyledSwitchWrapper, null,
|
|
70
80
|
react_1.default.createElement(styled_1.StyledButtonSlider, { inactive: isInactive, disabled: disabled, invert: invert, onClick: handleClick },
|
|
71
|
-
react_1.default.createElement(styled_1.
|
|
81
|
+
react_1.default.createElement(styled_1.StyledSwitch, { className: 'StyledSwitch' //read in styled.js why we are using an okf-anti-pattern
|
|
82
|
+
, direction: isInactive ? "left" : "right", inactive: isInactive, disabled: disabled, invert: invert })),
|
|
72
83
|
react_1.default.createElement(styled_1.STYLED_LABEL, __assign({}, { invert: invert, color: labelColor, lineHeight: 1 }), option.display))));
|
|
73
84
|
}
|
|
74
|
-
exports.
|
|
85
|
+
exports.SwitchSingle = SwitchSingle;
|
|
@@ -7,15 +7,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.STYLED_LABEL = exports.
|
|
10
|
+
exports.STYLED_LABEL = exports.StyledSwitch = exports.StyledButtonSlider = exports.StyledSwitchWrapper = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
12
|
var mixins_1 = require("../../themes/mixins");
|
|
13
13
|
var utilsOolib_1 = require("../../utilsOolib");
|
|
14
14
|
var themes_1 = require("../../themes");
|
|
15
15
|
var Typo_1 = require("../Typo");
|
|
16
16
|
var white = themes_1.colors.white, greyColor10 = themes_1.colors.greyColor10, greyColor80 = themes_1.colors.greyColor80, greyColor70 = themes_1.colors.greyColor70, greyColor100 = themes_1.colors.greyColor100, greyColor40 = themes_1.colors.greyColor40;
|
|
17
|
-
exports.
|
|
18
|
-
exports.StyledButtonSlider = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 4rem;\n height: 2rem;\n user-select: none;\n position: relative;\n \n border-radius: 1rem;\n cursor: ", ";\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n ", "\n"], ["\n width: 4rem;\n height: 2rem;\n user-select: none;\n position: relative;\n \n border-radius: 1rem;\n cursor: ", ";\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n ", "\n"])), function (_a) {
|
|
17
|
+
exports.StyledSwitchWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n /* justify-content: center; */\n align-items: center;\n gap: 1rem;\n"], ["\n display: flex;\n /* justify-content: center; */\n align-items: center;\n gap: 1rem;\n"])));
|
|
18
|
+
exports.StyledButtonSlider = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 4rem;\n height: 2rem;\n user-select: none;\n position: relative;\n \n border-radius: 1rem;\n cursor: ", ";\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n\n & > .StyledSwitch {\n border-color: ", "; \n }\n }\n\n \n\n ", "\n"], ["\n width: 4rem;\n height: 2rem;\n user-select: none;\n position: relative;\n \n border-radius: 1rem;\n cursor: ", ";\n background-color: ", ";\n\n &:hover {\n background-color: ", ";\n\n & > .StyledSwitch {\n border-color: ", "; \n }\n }\n\n \n\n ", "\n"])), function (_a) {
|
|
19
19
|
var disabled = _a.disabled;
|
|
20
20
|
return disabled ? 'not-allowed' : 'pointer';
|
|
21
21
|
}, function (_a) {
|
|
@@ -28,8 +28,11 @@ exports.StyledButtonSlider = styled_components_1.default.div(templateObject_2 ||
|
|
|
28
28
|
}, function (_a) {
|
|
29
29
|
var colors = _a.theme.colors, inactive = _a.inactive, disabled = _a.disabled;
|
|
30
30
|
return !disabled && (inactive ? greyColor40 : (0, utilsOolib_1.getPrimaryColorText)(colors));
|
|
31
|
+
}, function (_a) {
|
|
32
|
+
var colors = _a.theme.colors, inactive = _a.inactive, disabled = _a.disabled;
|
|
33
|
+
return !disabled && (inactive ? greyColor40 : (0, utilsOolib_1.getPrimaryColorText)(colors));
|
|
31
34
|
}, (0, mixins_1.transition)('background-color'));
|
|
32
|
-
exports.
|
|
35
|
+
exports.StyledSwitch = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 2rem;\n height: 2rem;\n background-color: ", ";\n outline: none;\n ", ";\n border-radius: 50%;\n cursor: ", ";\n border: 2px solid; \n border-color: ", ";\n position: absolute;\n top: 0;\n left: ", ";\n\n /**\n this is the styled comps way of dealing with child hover.\n But it is a buggy functionality. Probably an issue at\n the styled-components package level. Should report on their github\n\n Instead we use the oldschool class approach for child hover (line 40)\n */\n /* ", ":hover & {\n border-color: ", "; \n } */\n \n"], ["\n width: 2rem;\n height: 2rem;\n background-color: ", ";\n outline: none;\n ", ";\n border-radius: 50%;\n cursor: ", ";\n border: 2px solid; \n border-color: ", ";\n position: absolute;\n top: 0;\n left: ", ";\n\n /**\n this is the styled comps way of dealing with child hover.\n But it is a buggy functionality. Probably an issue at\n the styled-components package level. Should report on their github\n\n Instead we use the oldschool class approach for child hover (line 40)\n */\n /* ", ":hover & {\n border-color: ", "; \n } */\n \n"])), function (_a) {
|
|
33
36
|
var invert = _a.invert;
|
|
34
37
|
return invert ? greyColor100 : white;
|
|
35
38
|
}, (0, mixins_1.transition)('border-color', 'left 0.2s'), function (_a) {
|
|
@@ -45,6 +48,9 @@ exports.StyledToggleButton = styled_components_1.default.button(templateObject_3
|
|
|
45
48
|
}, function (_a) {
|
|
46
49
|
var direction = _a.direction;
|
|
47
50
|
return direction === 'left' ? '0' : 'calc(100% - 2rem)';
|
|
51
|
+
}, exports.StyledButtonSlider, function (_a) {
|
|
52
|
+
var colors = _a.theme.colors, inactive = _a.inactive, disabled = _a.disabled;
|
|
53
|
+
return !disabled && (inactive ? greyColor40 : (0, utilsOolib_1.getPrimaryColorText)(colors));
|
|
48
54
|
});
|
|
49
55
|
exports.STYLED_LABEL = (0, styled_components_1.default)(Typo_1.LABEL)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\ncolor: ", ";\nline-height: ", ";\n", "\n"], ["\ncolor: ", ";\nline-height: ", ";\n", "\n"])), function (_a) {
|
|
50
56
|
var color = _a.color;
|
|
@@ -85,7 +85,7 @@ exports.TabBarTabWrapper = styled_components_1.default.div(templateObject_14 ||
|
|
|
85
85
|
? tabBarWrapperStyle1
|
|
86
86
|
: tabBarStyle === "2" && tabBarWrapperStyle2;
|
|
87
87
|
});
|
|
88
|
-
exports.TabBarTabStyled = styled_components_1.default.button(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n padding: 0 2rem;\n cursor: pointer;\n color: ", ";\n background-color: ", ";\n\n border: 0;\n :hover {\n background-color: ", ";\n }\n\n ", "\n"], ["\n padding: 0 2rem;\n cursor: pointer;\n color: ", ";\n background-color: ", ";\n\n border: 0;\n :hover {\n background-color: ", ";\n }\n\n ", "\n"])), greyColor100, none, none, function (_a) {
|
|
88
|
+
exports.TabBarTabStyled = styled_components_1.default.button(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n padding: 0 2rem;\n height: 100%;\n cursor: pointer;\n color: ", ";\n background-color: ", ";\n\n border: 0;\n :hover {\n background-color: ", ";\n }\n\n ", "\n"], ["\n padding: 0 2rem;\n height: 100%;\n cursor: pointer;\n color: ", ";\n background-color: ", ";\n\n border: 0;\n :hover {\n background-color: ", ";\n }\n\n ", "\n"])), greyColor100, none, none, function (_a) {
|
|
89
89
|
var tabBarStyle = _a.tabBarStyle;
|
|
90
90
|
return tabBarStyle === "1"
|
|
91
91
|
? tabBarTabStyle1
|
|
@@ -74,7 +74,7 @@ exports.NumberInput = exports.URLInput = exports.PhoneInput = exports.EmailInput
|
|
|
74
74
|
var react_1 = __importStar(require("react"));
|
|
75
75
|
var index_styled_1 = require("./index.styled");
|
|
76
76
|
var icons_1 = require("../../icons");
|
|
77
|
-
var
|
|
77
|
+
var LoadersAndProgress_1 = require("../LoadersAndProgress");
|
|
78
78
|
var BlockLabel_1 = require("../BlockLabel");
|
|
79
79
|
var Typo_1 = require("../Typo");
|
|
80
80
|
var Buttons_1 = require("../Buttons");
|
|
@@ -126,7 +126,7 @@ var TextInput = function (props) {
|
|
|
126
126
|
icon && (react_1.default.createElement(DisplayIcon, { icon: icon, size: S ? 15 : 20, onClick: iconOnClick || null })),
|
|
127
127
|
react_1.default.createElement(index_styled_1.InputStyled, { className: size === 'S' ? 'SANS_2' : 'SANS_3', id: id, type: type, name: type, placeholder: placeholder, value: value, onChange: handleOnChange, maxLength: maxNumLimiter, onBlur: handleValidateOnBlur, onFocus: onFocus, size: size, autoComplete: 'off' }),
|
|
128
128
|
inputStatus === 'loading' && (react_1.default.createElement("div", { style: { padding: '1rem 0' } },
|
|
129
|
-
react_1.default.createElement(
|
|
129
|
+
react_1.default.createElement(LoadersAndProgress_1.Loader, { invert: invert, inline: true }))),
|
|
130
130
|
actionBtn && (react_1.default.createElement(Buttons_1.ButtonPrimary, { value: actionBtn.text, invert: actionBtn.invert, onClick: actionBtnEnabaled && actionBtn.onClick, disabled: !actionBtnEnabaled, style: { marginRight: '-2rem' } }))),
|
|
131
131
|
(inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.msg) && (react_1.default.createElement(index_styled_1.MsgContainer, { invert: invert, status: inputStatus === null || inputStatus === void 0 ? void 0 : inputStatus.type },
|
|
132
132
|
react_1.default.createElement(Typo_1.SANS_3, null, inputStatus.msg))))))));
|
package/dist/icons/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export namespace icons {
|
|
|
7
7
|
export { CaretLeft };
|
|
8
8
|
export { CaretRight };
|
|
9
9
|
export { XCircle };
|
|
10
|
+
export { XSquare };
|
|
10
11
|
export { DownloadSimple };
|
|
11
12
|
export { ArrowLineUpRight };
|
|
12
13
|
export { User };
|
|
@@ -98,6 +99,7 @@ import { UploadSimple } from "phosphor-react";
|
|
|
98
99
|
import { CaretLeft } from "phosphor-react";
|
|
99
100
|
import { CaretRight } from "phosphor-react";
|
|
100
101
|
import { XCircle } from "phosphor-react";
|
|
102
|
+
import { XSquare } from "phosphor-react";
|
|
101
103
|
import { DownloadSimple } from "phosphor-react";
|
|
102
104
|
import { ArrowLineUpRight } from "phosphor-react";
|
|
103
105
|
import { User } from "phosphor-react";
|
package/dist/icons/index.js
CHANGED
|
@@ -12,6 +12,7 @@ exports.icons = {
|
|
|
12
12
|
CaretLeft: phosphor_react_1.CaretLeft,
|
|
13
13
|
CaretRight: phosphor_react_1.CaretRight,
|
|
14
14
|
XCircle: phosphor_react_1.XCircle,
|
|
15
|
+
XSquare: phosphor_react_1.XSquare,
|
|
15
16
|
DownloadSimple: phosphor_react_1.DownloadSimple,
|
|
16
17
|
ArrowLineUpRight: phosphor_react_1.ArrowLineUpRight,
|
|
17
18
|
User: phosphor_react_1.User,
|
package/dist/index.d.ts
CHANGED
|
@@ -9,9 +9,10 @@ export * from "./components/InlineAlert";
|
|
|
9
9
|
export * from "./components/TextInputs";
|
|
10
10
|
export * from "./components/Container";
|
|
11
11
|
export * from "./components/Wrappers";
|
|
12
|
-
export * from "./components/
|
|
12
|
+
export * from "./components/Switches";
|
|
13
13
|
export * from "./components/TabBar";
|
|
14
14
|
export * from "./components/Banners";
|
|
15
|
+
export * from "./components/RadioAndCheckbox";
|
|
15
16
|
export * from "./utils/_EXPORTS";
|
|
16
17
|
export { colors } from "./themes";
|
|
17
18
|
export { icons } from "./icons";
|
|
@@ -20,8 +21,6 @@ export { UserRoleBadge } from "./components/UserRoleBadge";
|
|
|
20
21
|
export { OKELink } from "./components/OKELink";
|
|
21
22
|
export { Tooltip } from "./components/Tooltip";
|
|
22
23
|
export { ActionMenu } from "./components/ActionMenu";
|
|
23
|
-
export { RadioInput } from "./components/RadioInput";
|
|
24
|
-
export { CheckInput } from "./components/CheckInput";
|
|
25
24
|
export { PercentCompletedPie } from "./components/PercentCompletedPie";
|
|
26
25
|
export { Divider } from "./components/Divider";
|
|
27
|
-
export { CircleLoader, ProgressBar, CircleLoader as Loader } from "./components/
|
|
26
|
+
export { CircleLoader, ProgressBar, CircleLoader as Loader } from "./components/LoadersAndProgress";
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Divider = exports.PercentCompletedPie = exports.
|
|
17
|
+
exports.Divider = exports.PercentCompletedPie = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.Loader = exports.ProgressBar = exports.CircleLoader = exports.icons = exports.colors = exports.GlobalStyles = void 0;
|
|
18
18
|
//css and styling related ( styled-components )
|
|
19
19
|
var globalStyles_1 = require("./globalStyles");
|
|
20
20
|
Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return globalStyles_1.GlobalStyles; } });
|
|
@@ -26,11 +26,11 @@ var icons_1 = require("./icons");
|
|
|
26
26
|
Object.defineProperty(exports, "icons", { enumerable: true, get: function () { return icons_1.icons; } });
|
|
27
27
|
__exportStar(require("./components/Typo"), exports);
|
|
28
28
|
//components
|
|
29
|
-
var
|
|
30
|
-
Object.defineProperty(exports, "CircleLoader", { enumerable: true, get: function () { return
|
|
31
|
-
Object.defineProperty(exports, "ProgressBar", { enumerable: true, get: function () { return
|
|
32
|
-
var
|
|
33
|
-
Object.defineProperty(exports, "Loader", { enumerable: true, get: function () { return
|
|
29
|
+
var LoadersAndProgress_1 = require("./components/LoadersAndProgress");
|
|
30
|
+
Object.defineProperty(exports, "CircleLoader", { enumerable: true, get: function () { return LoadersAndProgress_1.CircleLoader; } });
|
|
31
|
+
Object.defineProperty(exports, "ProgressBar", { enumerable: true, get: function () { return LoadersAndProgress_1.ProgressBar; } });
|
|
32
|
+
var LoadersAndProgress_2 = require("./components/LoadersAndProgress"); //backwards compat till shen verifies
|
|
33
|
+
Object.defineProperty(exports, "Loader", { enumerable: true, get: function () { return LoadersAndProgress_2.CircleLoader; } });
|
|
34
34
|
__exportStar(require("./components/Buttons"), exports);
|
|
35
35
|
__exportStar(require("./components/Tags"), exports);
|
|
36
36
|
__exportStar(require("./components/Breadcrumbs"), exports);
|
|
@@ -39,9 +39,10 @@ __exportStar(require("./components/InlineAlert"), exports);
|
|
|
39
39
|
__exportStar(require("./components/TextInputs"), exports);
|
|
40
40
|
__exportStar(require("./components/Container"), exports);
|
|
41
41
|
__exportStar(require("./components/Wrappers"), exports);
|
|
42
|
-
__exportStar(require("./components/
|
|
42
|
+
__exportStar(require("./components/Switches"), exports);
|
|
43
43
|
__exportStar(require("./components/TabBar"), exports);
|
|
44
44
|
__exportStar(require("./components/Banners"), exports);
|
|
45
|
+
__exportStar(require("./components/RadioAndCheckbox"), exports);
|
|
45
46
|
var Section_1 = require("./components/Section");
|
|
46
47
|
Object.defineProperty(exports, "Section", { enumerable: true, get: function () { return Section_1.Section; } });
|
|
47
48
|
var UserRoleBadge_1 = require("./components/UserRoleBadge");
|
|
@@ -52,10 +53,6 @@ var Tooltip_1 = require("./components/Tooltip");
|
|
|
52
53
|
Object.defineProperty(exports, "Tooltip", { enumerable: true, get: function () { return Tooltip_1.Tooltip; } });
|
|
53
54
|
var ActionMenu_1 = require("./components/ActionMenu");
|
|
54
55
|
Object.defineProperty(exports, "ActionMenu", { enumerable: true, get: function () { return ActionMenu_1.ActionMenu; } });
|
|
55
|
-
var RadioInput_1 = require("./components/RadioInput");
|
|
56
|
-
Object.defineProperty(exports, "RadioInput", { enumerable: true, get: function () { return RadioInput_1.RadioInput; } });
|
|
57
|
-
var CheckInput_1 = require("./components/CheckInput");
|
|
58
|
-
Object.defineProperty(exports, "CheckInput", { enumerable: true, get: function () { return CheckInput_1.CheckInput; } });
|
|
59
56
|
var PercentCompletedPie_1 = require("./components/PercentCompletedPie");
|
|
60
57
|
Object.defineProperty(exports, "PercentCompletedPie", { enumerable: true, get: function () { return PercentCompletedPie_1.PercentCompletedPie; } });
|
|
61
58
|
var Divider_1 = require("./components/Divider");
|
|
@@ -3,3 +3,4 @@ export { setVal } from "../getterSetterDeleter/setVal";
|
|
|
3
3
|
export { deleteVal } from "../getterSetterDeleter/deleteVal";
|
|
4
4
|
export { getBlockLabelProps } from "../getBlockLabelProps";
|
|
5
5
|
export { injectHttps } from "../injectHttps";
|
|
6
|
+
export { genValueFromDisplay } from "../genValueFromDisplay";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.injectHttps = exports.getBlockLabelProps = exports.deleteVal = exports.setVal = exports.getVal = void 0;
|
|
3
|
+
exports.genValueFromDisplay = exports.injectHttps = exports.getBlockLabelProps = exports.deleteVal = exports.setVal = exports.getVal = void 0;
|
|
4
4
|
//the holy setter, getter & deleter
|
|
5
5
|
var getVal_1 = require("../getterSetterDeleter/getVal");
|
|
6
6
|
Object.defineProperty(exports, "getVal", { enumerable: true, get: function () { return getVal_1.getVal; } });
|
|
@@ -13,3 +13,5 @@ var getBlockLabelProps_1 = require("../getBlockLabelProps");
|
|
|
13
13
|
Object.defineProperty(exports, "getBlockLabelProps", { enumerable: true, get: function () { return getBlockLabelProps_1.getBlockLabelProps; } });
|
|
14
14
|
var injectHttps_1 = require("../injectHttps");
|
|
15
15
|
Object.defineProperty(exports, "injectHttps", { enumerable: true, get: function () { return injectHttps_1.injectHttps; } });
|
|
16
|
+
var genValueFromDisplay_1 = require("../genValueFromDisplay");
|
|
17
|
+
Object.defineProperty(exports, "genValueFromDisplay", { enumerable: true, get: function () { return genValueFromDisplay_1.genValueFromDisplay; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function genValueFromDisplay(text: any): any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genValueFromDisplay = void 0;
|
|
4
|
+
var genValueFromDisplay = function (text) {
|
|
5
|
+
var value_desc = ( // genrating a value text abiding js conventions (camelCased)
|
|
6
|
+
text
|
|
7
|
+
.trim()
|
|
8
|
+
.replace(/[,\/]/g, '') // removing comas and forward slashes
|
|
9
|
+
.split(' ')
|
|
10
|
+
.filter(Boolean)
|
|
11
|
+
.map(function (word, idx) { return word[0]["to".concat(idx === 0 ? 'Lower' : 'Upper', "Case")]() + word.slice(1); })
|
|
12
|
+
.join(""));
|
|
13
|
+
return value_desc;
|
|
14
|
+
};
|
|
15
|
+
exports.genValueFromDisplay = genValueFromDisplay;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oolib",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.1",
|
|
4
4
|
"description": " OKE Component Library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"react-json-view": "^1.21.3",
|
|
48
48
|
"react-router-dom": "^5.1.2",
|
|
49
49
|
"semantic-release": "^18.0.0",
|
|
50
|
-
"styled-components": "^5.3.
|
|
50
|
+
"styled-components": "^5.3.6"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react": "^17.0.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export function CheckInput(props: any): JSX.Element;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.CheckInput = void 0;
|
|
18
|
-
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var BlockLabel_1 = require("../BlockLabel");
|
|
20
|
-
var _EXPORTS_1 = require("../../utils/_EXPORTS");
|
|
21
|
-
var CheckInput = function (props) {
|
|
22
|
-
var id = props.id, injectOtherOption = props.injectOtherOption, value = props.value, onChange = props.onChange, commonIsCorrectDesc = props.commonIsCorrectDesc, options = props.options, optionGroups = props.optionGroups, optionStyle = props.optionStyle, rightWrongResult = props.rightWrongResult, passChangeHandlerOps = props.passChangeHandlerOps, listType = props.listType, style = props.style, className = props.className, readOnly = props.readOnly;
|
|
23
|
-
return (react_1.default.createElement("div", { className: className, id: id },
|
|
24
|
-
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
|
|
25
|
-
react_1.default.createElement("input", { type: "checkbox" })));
|
|
26
|
-
};
|
|
27
|
-
exports.CheckInput = CheckInput;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.RadioOption = void 0;
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var themes_1 = require("../../../../themes");
|
|
9
|
-
var icons_1 = require("../../../../icons");
|
|
10
|
-
var Typo_1 = require("../../../Typo");
|
|
11
|
-
var utils_js_1 = require("./utils.js");
|
|
12
|
-
var styled_1 = require("./styled");
|
|
13
|
-
var green = themes_1.colors.green, red = themes_1.colors.red;
|
|
14
|
-
var XCircle = icons_1.icons.XCircle, CheckCircle = icons_1.icons.CheckCircle;
|
|
15
|
-
var RadioOption = function (_a) {
|
|
16
|
-
var id = _a.id, option = _a.option, onChange = _a.onChange, value = _a.value, rightWrongResult = _a.rightWrongResult;
|
|
17
|
-
var isSelected = option.value === (value === null || value === void 0 ? void 0 : value.value);
|
|
18
|
-
var markingCommand = (0, utils_js_1.getMarkingCommand)({ option: option, isSelected: isSelected });
|
|
19
|
-
return (react_1.default.createElement("div", null,
|
|
20
|
-
react_1.default.createElement(styled_1.StyledOption, { rightWrongResult: rightWrongResult, isSelected: isSelected, onClick: function () { return !rightWrongResult && onChange && onChange(id, option); } },
|
|
21
|
-
!rightWrongResult || markingCommand === undefined ?
|
|
22
|
-
react_1.default.createElement(styled_1.StyledRadioInput, { isSelected: isSelected, className: 'radioBtn' }, isSelected && react_1.default.createElement(styled_1.StyledRadioInputFill, null))
|
|
23
|
-
:
|
|
24
|
-
["markCorrect", "revealCorrect"].includes(markingCommand) ?
|
|
25
|
-
react_1.default.createElement(CheckCircle, { size: 22.5, color: green, style: { marginLeft: '-2.25px' } })
|
|
26
|
-
: // then wrong
|
|
27
|
-
react_1.default.createElement(XCircle, { size: 22.5, color: red, style: { marginLeft: '-2.25px' } }),
|
|
28
|
-
react_1.default.createElement(Typo_1.SANS_3, { bold: rightWrongResult && isSelected },
|
|
29
|
-
" ",
|
|
30
|
-
option.display,
|
|
31
|
-
" ")),
|
|
32
|
-
/*
|
|
33
|
-
the minute the results have come in, irrespective of user's answer
|
|
34
|
-
being right or wrong, we always show an explanation
|
|
35
|
-
against the right answer. provided an explanation is provided.
|
|
36
|
-
*/
|
|
37
|
-
option.isCorrect && rightWrongResult && option.isCorrectDesc &&
|
|
38
|
-
react_1.default.createElement(styled_1.StyledCorrectMessage, null, option.isCorrectDesc)));
|
|
39
|
-
};
|
|
40
|
-
exports.RadioOption = RadioOption;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getMarkingCommand = void 0;
|
|
4
|
-
var getMarkingCommand = function (_a) {
|
|
5
|
-
var option = _a.option, isSelected = _a.isSelected;
|
|
6
|
-
if (isSelected) {
|
|
7
|
-
return option.isCorrect ? 'markCorrect' : 'markWrong';
|
|
8
|
-
}
|
|
9
|
-
else { //not selected
|
|
10
|
-
if (option.isCorrect)
|
|
11
|
-
return "revealCorrect";
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
exports.getMarkingCommand = getMarkingCommand;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RadioOption } from "./RadioOption";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RadioOption = void 0;
|
|
4
|
-
var RadioOption_1 = require("./RadioOption");
|
|
5
|
-
Object.defineProperty(exports, "RadioOption", { enumerable: true, get: function () { return RadioOption_1.RadioOption; } });
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export function RadioInput({ id, injectOtherOption, value, onChange, options, rightWrongResult, listType, style, className, readOnly }: {
|
|
2
|
-
id: any;
|
|
3
|
-
injectOtherOption: any;
|
|
4
|
-
value: any;
|
|
5
|
-
onChange: any;
|
|
6
|
-
options: any;
|
|
7
|
-
rightWrongResult: any;
|
|
8
|
-
listType: any;
|
|
9
|
-
style: any;
|
|
10
|
-
className: any;
|
|
11
|
-
readOnly: any;
|
|
12
|
-
}, ...args: any[]): JSX.Element;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.RadioInput = void 0;
|
|
18
|
-
var react_1 = __importDefault(require("react"));
|
|
19
|
-
var BlockLabel_1 = require("../BlockLabel");
|
|
20
|
-
var Tags_1 = require("../Tags");
|
|
21
|
-
var TextInputs_1 = require("../TextInputs");
|
|
22
|
-
var _EXPORTS_1 = require("../../utils/_EXPORTS");
|
|
23
|
-
var utils_js_1 = require("./utils.js");
|
|
24
|
-
var styled_1 = require("./styled");
|
|
25
|
-
var comps_1 = require("./comps");
|
|
26
|
-
function RadioInput(_a) {
|
|
27
|
-
var id = _a.id, injectOtherOption = _a.injectOtherOption, value = _a.value, onChange = _a.onChange, options = _a.options, rightWrongResult = _a.rightWrongResult, listType = _a.listType, style = _a.style, className = _a.className, readOnly = _a.readOnly;
|
|
28
|
-
var props = arguments[0];
|
|
29
|
-
var displayedOptions;
|
|
30
|
-
if (options) {
|
|
31
|
-
if (injectOtherOption && !options.includes(function (op) { return op.value === "other"; })) {
|
|
32
|
-
displayedOptions = options.concat({ value: "other", display: "Other" });
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
displayedOptions = options;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return (react_1.default.createElement("div", { className: className, id: id },
|
|
39
|
-
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
|
|
40
|
-
readOnly ? ((value === null || value === void 0 ? void 0 : value.display) && react_1.default.createElement(Tags_1.TagDisplay, { display: value.display })) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
41
|
-
react_1.default.createElement(styled_1.StyledOptionsContainer, { listType: listType, style: style }, displayedOptions === null || displayedOptions === void 0 ? void 0 : displayedOptions.map(function (option) { return react_1.default.createElement(comps_1.RadioOption, __assign({}, {
|
|
42
|
-
option: option,
|
|
43
|
-
id: id,
|
|
44
|
-
onChange: onChange,
|
|
45
|
-
value: value,
|
|
46
|
-
rightWrongResult: rightWrongResult,
|
|
47
|
-
key: option.value
|
|
48
|
-
})); })),
|
|
49
|
-
injectOtherOption && (value === null || value === void 0 ? void 0 : value.value) === "other" && (react_1.default.createElement(TextInputs_1.TextInput, { placeholder: "Please Specify Here", value: value.display_desc, onChange: function (k, v) { return onChange && onChange(id, (0, utils_js_1.createNewValue)(v)); } }))))));
|
|
50
|
-
}
|
|
51
|
-
exports.RadioInput = RadioInput;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const StyledOptionsContainer: any;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
-
if (mod && mod.__esModule) return mod;
|
|
24
|
-
var result = {};
|
|
25
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
-
__setModuleDefault(result, mod);
|
|
27
|
-
return result;
|
|
28
|
-
};
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.StyledOptionsContainer = void 0;
|
|
31
|
-
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
|
-
exports.StyledOptionsContainer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n gap: 2rem;\n\n ", "\n"], ["\n display: flex;\n flex-wrap: wrap;\n gap: 2rem;\n\n ", "\n"])), function (_a) {
|
|
33
|
-
var listType = _a.listType;
|
|
34
|
-
return listType === 'vertical' ? (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: column;\n gap: 1.5rem;\n "], ["\n flex-direction: column;\n gap: 1.5rem;\n "]))) :
|
|
35
|
-
'';
|
|
36
|
-
});
|
|
37
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createNewValue = void 0;
|
|
4
|
-
var createNewValue = function (val) {
|
|
5
|
-
var value_desc = ( // discuss if we should add the method textToCamelcase to general utils or JS String Class
|
|
6
|
-
val
|
|
7
|
-
.trim()
|
|
8
|
-
.replace(/[,\/]/gi, '')
|
|
9
|
-
.split(' ')
|
|
10
|
-
.filter(Boolean)
|
|
11
|
-
.map(function (word, idx) { return idx === 0 ? word : word[0].toUpperCase() + word.slice(1); })
|
|
12
|
-
.join(""));
|
|
13
|
-
return {
|
|
14
|
-
value: "other",
|
|
15
|
-
display_desc: val,
|
|
16
|
-
value_desc: value_desc,
|
|
17
|
-
display: "Other",
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
exports.createNewValue = createNewValue;
|