oolib 2.25.3 → 2.25.5
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.d.ts +2 -1
- package/dist/components/ActionMenu/index.js +6 -3
- package/dist/components/Buttons/index.js +3 -2
- package/dist/components/Buttons/index.styled.js +67 -54
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.js +27 -13
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/styled.js +5 -1
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.d.ts +1 -2
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.js +39 -18
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/styled.js +5 -1
- package/dist/components/RadioAndCheckbox/comps/RadioList/index.d.ts +1 -3
- package/dist/components/RadioAndCheckbox/comps/RadioList/index.js +3 -3
- package/dist/utils/_EXPORTS/index.d.ts +1 -0
- package/dist/utils/_EXPORTS/index.js +3 -1
- package/dist/utils/formatCamelCaseToSentenceCase.d.ts +1 -0
- package/dist/utils/formatCamelCaseToSentenceCase.js +11 -0
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export function ActionMenu({ icon, invert, actions, align, iconSize, ButtonComp: _ButtonComp, setShowActions: setShowActionsInParent, popOutOfOverflowHiddenParent, storybookPreview }: {
|
|
1
|
+
export function ActionMenu({ icon, invert, actions, align, iconSize, M, ButtonComp: _ButtonComp, setShowActions: setShowActionsInParent, popOutOfOverflowHiddenParent, storybookPreview }: {
|
|
2
2
|
icon?: string;
|
|
3
3
|
invert: any;
|
|
4
4
|
actions: any;
|
|
5
5
|
align?: string;
|
|
6
6
|
iconSize?: string;
|
|
7
|
+
M: any;
|
|
7
8
|
ButtonComp?: string;
|
|
8
9
|
setShowActions: any;
|
|
9
10
|
popOutOfOverflowHiddenParent?: boolean;
|
|
@@ -46,7 +46,7 @@ var styled_1 = require("./styled");
|
|
|
46
46
|
var ActionMenu = function (_a) {
|
|
47
47
|
var _b, _c;
|
|
48
48
|
var _d = _a.icon, icon = _d === void 0 ? 'DotsThree' : _d, //most likely will never change
|
|
49
|
-
invert = _a.invert, actions = _a.actions, _e = _a.align, align = _e === void 0 ? 'right' : _e, _f = _a.iconSize, iconSize = _f === void 0 ? 'S' : _f, _g = _a.ButtonComp, _ButtonComp = _g === void 0 ? 'ButtonGhost' : _g, setShowActionsInParent = _a.setShowActions, _h = _a.popOutOfOverflowHiddenParent, popOutOfOverflowHiddenParent = _h === void 0 ? false : _h, storybookPreview = _a.storybookPreview //for storybook purposes
|
|
49
|
+
invert = _a.invert, actions = _a.actions, _e = _a.align, align = _e === void 0 ? 'right' : _e, _f = _a.iconSize, iconSize = _f === void 0 ? 'S' : _f, M = _a.M, _g = _a.ButtonComp, _ButtonComp = _g === void 0 ? 'ButtonGhost' : _g, setShowActionsInParent = _a.setShowActions, _h = _a.popOutOfOverflowHiddenParent, popOutOfOverflowHiddenParent = _h === void 0 ? false : _h, storybookPreview = _a.storybookPreview //for storybook purposes
|
|
50
50
|
;
|
|
51
51
|
var actionMenuRef = (0, react_1.useRef)(null);
|
|
52
52
|
var optionsWrapperRef = (0, react_1.useRef)(null);
|
|
@@ -56,6 +56,9 @@ var ActionMenu = function (_a) {
|
|
|
56
56
|
return null;
|
|
57
57
|
var getOpsRect = function () { var _a; return (_a = optionsWrapperRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(); };
|
|
58
58
|
var ButtonComp = ButtonComps[_ButtonComp];
|
|
59
|
+
//basically action menu defaults to 'S' button size (cuz its an icon only button)
|
|
60
|
+
//so passing 'M' will override this default and make it a Medium sized button
|
|
61
|
+
var buttonSize = M ? { M: true } : {};
|
|
59
62
|
var genOptionIcon = function (iconName) {
|
|
60
63
|
var IconComp = icons_1.icons[iconName];
|
|
61
64
|
return react_1.default.createElement(IconComp, { size: 16 });
|
|
@@ -75,9 +78,9 @@ var ActionMenu = function (_a) {
|
|
|
75
78
|
}, []);
|
|
76
79
|
var _k = (0, usePopOutOfOverflowHiddenParent_1.usePopOutOfOverflowHiddenParent)(popOutOfOverflowHiddenParent), fixPos = _k.fixPos, applyFixedPos = _k.applyFixedPos, removeFixedPos = _k.removeFixedPos, trackerRef = _k.trackerRef;
|
|
77
80
|
return (react_1.default.createElement(styled_1.StyledActionMenu, { ref: actionMenuRef },
|
|
78
|
-
react_1.default.createElement(ButtonComp, { icon: icon, iconSize: iconSize, invert: invert, stopPropagation: true, onClick: function (e) {
|
|
81
|
+
react_1.default.createElement(ButtonComp, __assign({}, buttonSize, { icon: icon, iconSize: iconSize, invert: invert, stopPropagation: true, onClick: function (e) {
|
|
79
82
|
setShowActions(!showActions);
|
|
80
|
-
}, active: showActions }),
|
|
83
|
+
}, active: showActions })),
|
|
81
84
|
popOutOfOverflowHiddenParent &&
|
|
82
85
|
react_1.default.createElement(styled_1.StyledActionMenuTracker, { storybookPreview: storybookPreview, align: align, ref: trackerRef }),
|
|
83
86
|
react_1.default.createElement(styled_1.StyledActionsDropMenu, __assign({}, {
|
|
@@ -49,7 +49,8 @@ var DisplayIcon = function (_a) {
|
|
|
49
49
|
};
|
|
50
50
|
var ButtonStyledWrapper = function (_a) {
|
|
51
51
|
var props = _a.props, variant = _a.variant;
|
|
52
|
-
var id = props.id, link = props.link, children = props.children, value = props.value, submit = props.submit, icon = props.icon, iconAfter = props.iconAfter, onClick = props.onClick, onMouseDown = props.onMouseDown, active = props.active, disabled = props.disabled, invert = props.invert, theme = props.theme, width = props.width, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, color = props.color, style = props.style, className = props.className, S = props.S, M = props.M, iconSize = props.iconSize, _iconColor = props.iconColor, stopPropagation = props.stopPropagation
|
|
52
|
+
var id = props.id, link = props.link, children = props.children, value = props.value, submit = props.submit, icon = props.icon, iconAfter = props.iconAfter, onClick = props.onClick, onMouseDown = props.onMouseDown, active = props.active, disabled = props.disabled, invert = props.invert, theme = props.theme, width = props.width, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave, color = props.color, style = props.style, className = props.className, S = props.S, M = props.M, iconSize = props.iconSize, _iconColor = props.iconColor, stopPropagation = props.stopPropagation, forceHover = props.forceHover //used by multi-option button
|
|
53
|
+
;
|
|
53
54
|
/**
|
|
54
55
|
* WHY WE ARE HAVING TO DO STOP PROPAGATION IN THIS TWISTED WAY:
|
|
55
56
|
*
|
|
@@ -97,7 +98,7 @@ var ButtonStyledWrapper = function (_a) {
|
|
|
97
98
|
}, onMouseDown: function (e) {
|
|
98
99
|
stopPropagation && e.stopPropagation();
|
|
99
100
|
debouncedMouseDown && debouncedMouseDown(e);
|
|
100
|
-
}, composition: composition, width: width, color: color },
|
|
101
|
+
}, composition: composition, width: width, color: color, forceHover: forceHover },
|
|
101
102
|
icon && react_1.default.createElement(DisplayIcon, { icon: icon, color: iconColor, size: calcIconSize() }),
|
|
102
103
|
displayText && react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, displayText),
|
|
103
104
|
iconAfter && react_1.default.createElement(DisplayIcon, { icon: iconAfter, color: iconColor, size: calcIconSize() })));
|
|
@@ -38,7 +38,40 @@ var SIZES = {
|
|
|
38
38
|
S: "3rem",
|
|
39
39
|
M: "4rem",
|
|
40
40
|
};
|
|
41
|
-
var
|
|
41
|
+
var hoverStylingPrimary = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\ncolor: ", ";\n"], ["\n background-color: ", ";\ncolor: ", ";\n"])), function (_a) {
|
|
42
|
+
var invert = _a.invert, colors = _a.theme.colors;
|
|
43
|
+
return invert
|
|
44
|
+
? (0, utilsOolib_1.getPrimaryColor10)(colors)
|
|
45
|
+
: (0, utilsOolib_1.getPrimaryColor40)(colors);
|
|
46
|
+
}, function (_a) {
|
|
47
|
+
var invert = _a.invert, colors = _a.theme.colors;
|
|
48
|
+
return invert
|
|
49
|
+
? greyColor100
|
|
50
|
+
: (0, utilsOolib_1.getPrimaryColorText)(colors);
|
|
51
|
+
});
|
|
52
|
+
var hoverStylingSecondary = (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), function (_a) {
|
|
53
|
+
var invert = _a.invert, active = _a.active, colors = _a.theme.colors;
|
|
54
|
+
return active
|
|
55
|
+
? ""
|
|
56
|
+
: invert
|
|
57
|
+
? greyColor80
|
|
58
|
+
: (0, utilsOolib_1.getPrimaryColor40)(colors);
|
|
59
|
+
});
|
|
60
|
+
var hoverStylingCustom = (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), function (_a) {
|
|
61
|
+
var invert = _a.invert, colors = _a.theme.colors;
|
|
62
|
+
return invert
|
|
63
|
+
? greyColor80
|
|
64
|
+
: (0, utilsOolib_1.getPrimaryColor40)(colors);
|
|
65
|
+
});
|
|
66
|
+
var hoverStylingGhost = (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n"], ["\n background-color: ", ";\n"])), function (_a) {
|
|
67
|
+
var invert = _a.invert, active = _a.active, colors = _a.theme.colors;
|
|
68
|
+
return active
|
|
69
|
+
? ""
|
|
70
|
+
: invert
|
|
71
|
+
? greyColor80
|
|
72
|
+
: (0, utilsOolib_1.getPrimaryColor10)(colors);
|
|
73
|
+
});
|
|
74
|
+
var ButtonPrimary = (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n border: none; // $none;\n background-color: ", ";\n color: ", ";\n ", "\n ", "\n\n ", " \n \n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n"], ["\n border: none; // $none;\n background-color: ", ";\n color: ", ";\n ", "\n ", "\n\n ", " \n \n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n"])), function (_a) {
|
|
42
75
|
var invert = _a.invert, colors = _a.theme.colors;
|
|
43
76
|
return invert
|
|
44
77
|
? (0, utilsOolib_1.getPrimaryColor40)(colors)
|
|
@@ -48,25 +81,18 @@ var ButtonPrimary = (0, styled_components_1.css)(templateObject_3 || (templateOb
|
|
|
48
81
|
return invert ? greyColor100 : white;
|
|
49
82
|
}, function (_a) {
|
|
50
83
|
var color = _a.color;
|
|
51
|
-
return color && (0, styled_components_1.css)(
|
|
84
|
+
return color && (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), color);
|
|
52
85
|
}, function (_a) {
|
|
53
86
|
var disabled = _a.disabled;
|
|
54
|
-
return disabled && (0, styled_components_1.css)(
|
|
87
|
+
return disabled && (0, styled_components_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n pointer-events: none;\n "], ["\n background-color: ", ";\n color: ", ";\n pointer-events: none;\n "])), function (_a) {
|
|
55
88
|
var invert = _a.invert;
|
|
56
89
|
return invert ? greyColor70 : greyColor15;
|
|
57
90
|
}, greyColor40);
|
|
58
91
|
}, function (_a) {
|
|
59
|
-
var
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, function (_a) {
|
|
64
|
-
var invert = _a.invert, colors = _a.theme.colors;
|
|
65
|
-
return invert
|
|
66
|
-
? greyColor100
|
|
67
|
-
: (0, utilsOolib_1.getPrimaryColorText)(colors);
|
|
68
|
-
});
|
|
69
|
-
var ButtonSecondary = (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n border: 2px solid\n ", ";\n background-color: ", ";\n\n color: ", "; \n ", "\n ", "\n ", "\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n /* color: ", "; */\n }\n }\n"], ["\n border: 2px solid\n ", ";\n background-color: ", ";\n\n color: ", "; \n ", "\n ", "\n ", "\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n /* color: ", "; */\n }\n }\n"])), function (_a) {
|
|
92
|
+
var forceHover = _a.forceHover;
|
|
93
|
+
return forceHover && hoverStylingPrimary;
|
|
94
|
+
}, hoverStylingPrimary);
|
|
95
|
+
var ButtonSecondary = (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n border: 2px solid\n ", ";\n background-color: ", ";\n\n color: ", "; \n ", "\n ", "\n ", "\n\n ", " \n\n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n"], ["\n border: 2px solid\n ", ";\n background-color: ", ";\n\n color: ", "; \n ", "\n ", "\n ", "\n\n ", " \n\n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n"])), function (_a) {
|
|
70
96
|
var invert = _a.invert, colors = _a.theme.colors;
|
|
71
97
|
return invert
|
|
72
98
|
? (0, utilsOolib_1.getPrimaryColor40)(colors)
|
|
@@ -81,10 +107,10 @@ var ButtonSecondary = (0, styled_components_1.css)(templateObject_7 || (template
|
|
|
81
107
|
: (0, utilsOolib_1.getPrimaryColorText)(colors);
|
|
82
108
|
}, function (_a) {
|
|
83
109
|
var color = _a.color;
|
|
84
|
-
return color && (0, styled_components_1.css)(
|
|
110
|
+
return color && (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), color);
|
|
85
111
|
}, function (_a) {
|
|
86
112
|
var active = _a.active;
|
|
87
|
-
return active && (0, styled_components_1.css)(
|
|
113
|
+
return active && (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), function (_a) {
|
|
88
114
|
var invert = _a.invert, colors = _a.theme.colors;
|
|
89
115
|
return invert ?
|
|
90
116
|
(0, utilsOolib_1.getPrimaryColor40)(colors)
|
|
@@ -96,22 +122,15 @@ var ButtonSecondary = (0, styled_components_1.css)(templateObject_7 || (template
|
|
|
96
122
|
});
|
|
97
123
|
}, function (_a) {
|
|
98
124
|
var disabled = _a.disabled;
|
|
99
|
-
return disabled && (0, styled_components_1.css)(
|
|
125
|
+
return disabled && (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n background-color: ", ";\n border: 2px solid ", ";\n color: ", "; \n pointer-events: none;\n "], ["\n background-color: ", ";\n border: 2px solid ", ";\n color: ", "; \n pointer-events: none;\n "])), function (_a) {
|
|
100
126
|
var invert = _a.invert;
|
|
101
127
|
return invert ? greyColor80 : white;
|
|
102
128
|
}, greyColor15, greyColor40);
|
|
103
129
|
}, function (_a) {
|
|
104
|
-
var
|
|
105
|
-
return
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
? greyColor80
|
|
109
|
-
: (0, utilsOolib_1.getPrimaryColor40)(colors);
|
|
110
|
-
}, function (_a) {
|
|
111
|
-
var colors = _a.theme.colors;
|
|
112
|
-
return (0, utilsOolib_1.getPrimaryColorText)(colors);
|
|
113
|
-
});
|
|
114
|
-
var ButtonCustom = (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n border: 2px solid\n ", ";\n box-shadow: -4px 4px 1px\n ", ";\n \n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n ", "\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n }\n }\n"], ["\n border: 2px solid\n ", ";\n box-shadow: -4px 4px 1px\n ", ";\n \n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n ", "\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n }\n }\n"])), function (_a) {
|
|
130
|
+
var forceHover = _a.forceHover;
|
|
131
|
+
return forceHover && hoverStylingSecondary;
|
|
132
|
+
}, hoverStylingSecondary);
|
|
133
|
+
var ButtonCustom = (0, styled_components_1.css)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n border: 2px solid\n ", ";\n box-shadow: -4px 4px 1px\n ", ";\n \n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n ", "\n\n ", " \n\n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n"], ["\n border: 2px solid\n ", ";\n box-shadow: -4px 4px 1px\n ", ";\n \n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n ", "\n\n ", " \n\n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n"])), function (_a) {
|
|
115
134
|
var invert = _a.invert, colors = _a.theme.colors;
|
|
116
135
|
return invert
|
|
117
136
|
? (0, utilsOolib_1.getPrimaryColor40)(colors)
|
|
@@ -131,10 +150,10 @@ var ButtonCustom = (0, styled_components_1.css)(templateObject_10 || (templateOb
|
|
|
131
150
|
: (0, utilsOolib_1.getPrimaryColorText)(colors);
|
|
132
151
|
}, function (_a) {
|
|
133
152
|
var color = _a.color;
|
|
134
|
-
return color && (0, styled_components_1.css)(
|
|
153
|
+
return color && (0, styled_components_1.css)(templateObject_12 || (templateObject_12 = __makeTemplateObject(["color: ", ";"], ["color: ", ";"])), color);
|
|
135
154
|
}, function (_a) {
|
|
136
155
|
var disabled = _a.disabled;
|
|
137
|
-
return disabled && (0, styled_components_1.css)(
|
|
156
|
+
return disabled && (0, styled_components_1.css)(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n color: ", ";\n border: 2px solid ", "; // $darkShadowColor : $greyColor15;\n box-shadow: -4px 4px 1px ", ";\n pointer-events: none;\n background-color: ", "; \n "], ["\n color: ", ";\n border: 2px solid ", "; // $darkShadowColor : $greyColor15;\n box-shadow: -4px 4px 1px ", ";\n pointer-events: none;\n background-color: ", "; \n "])), greyColor40, function (_a) {
|
|
138
157
|
var invert = _a.invert;
|
|
139
158
|
return (invert ? greyColor40 : greyColor15);
|
|
140
159
|
}, greyColor40, function (_a) {
|
|
@@ -142,12 +161,10 @@ var ButtonCustom = (0, styled_components_1.css)(templateObject_10 || (templateOb
|
|
|
142
161
|
return invert ? greyColor80 : white;
|
|
143
162
|
});
|
|
144
163
|
}, function (_a) {
|
|
145
|
-
var
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
});
|
|
150
|
-
var ButtonGhost = (0, styled_components_1.css)(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n ", "\n ", "\n\n ", "\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n }\n }\n"], ["\n background-color: ", ";\n color: ", ";\n ", "\n ", "\n\n ", "\n @media (hover: hover) {\n &:hover {\n background-color: ", ";\n }\n }\n"])), function (_a) {
|
|
164
|
+
var forceHover = _a.forceHover;
|
|
165
|
+
return forceHover && hoverStylingCustom;
|
|
166
|
+
}, hoverStylingCustom);
|
|
167
|
+
var ButtonGhost = (0, styled_components_1.css)(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n ", "\n ", "\n\n ", "\n \n ", " \n \n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n"], ["\n background-color: ", ";\n color: ", ";\n ", "\n ", "\n\n ", "\n \n ", " \n \n @media (hover: hover) {\n &:hover {\n ", "\n }\n }\n"])), function (_a) {
|
|
151
168
|
var active = _a.active, colors = _a.theme.colors;
|
|
152
169
|
return active ? (0, utilsOolib_1.getPrimaryColor40)(colors) : none;
|
|
153
170
|
}, function (_a) {
|
|
@@ -159,27 +176,23 @@ var ButtonGhost = (0, styled_components_1.css)(templateObject_14 || (templateObj
|
|
|
159
176
|
: (0, utilsOolib_1.getPrimaryColorText)(colors);
|
|
160
177
|
}, function (_a) {
|
|
161
178
|
var color = _a.color;
|
|
162
|
-
return color && (0, styled_components_1.css)(
|
|
179
|
+
return color && (0, styled_components_1.css)(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), color);
|
|
163
180
|
}, function (_a) {
|
|
164
181
|
var invert = _a.invert;
|
|
165
|
-
return invert && (0, styled_components_1.css)(
|
|
182
|
+
return invert && (0, styled_components_1.css)(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n background-color: ", ";\n "], ["\n background-color: ", ";\n "])), function (_a) {
|
|
166
183
|
var active = _a.active;
|
|
167
184
|
return active ? greyColor80 : greyColor100;
|
|
168
185
|
});
|
|
169
186
|
}, function (_a) {
|
|
170
187
|
var disabled = _a.disabled;
|
|
171
|
-
return disabled && (0, styled_components_1.css)(
|
|
188
|
+
return disabled && (0, styled_components_1.css)(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n color: ", "; //$greyColor40;\n pointer-events: none;\n "], ["\n color: ", "; //$greyColor40;\n pointer-events: none;\n "])), greyColor40);
|
|
172
189
|
}, function (_a) {
|
|
173
|
-
var
|
|
174
|
-
return
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
? greyColor80
|
|
178
|
-
: (0, utilsOolib_1.getPrimaryColor10)(colors);
|
|
179
|
-
});
|
|
180
|
-
var GoogleButton = (0, styled_components_1.css)(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n color: #4285f4;\n border: 2px solid #4285f4;\n background-color: ", ";\n ", "\n"], ["\n color: #4285f4;\n border: 2px solid #4285f4;\n background-color: ", ";\n ", "\n"])), white, function (_a) {
|
|
190
|
+
var forceHover = _a.forceHover;
|
|
191
|
+
return forceHover && hoverStylingGhost;
|
|
192
|
+
}, hoverStylingGhost);
|
|
193
|
+
var GoogleButton = (0, styled_components_1.css)(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n color: #4285f4;\n border: 2px solid #4285f4;\n background-color: ", ";\n ", "\n"], ["\n color: #4285f4;\n border: 2px solid #4285f4;\n background-color: ", ";\n ", "\n"])), white, function (_a) {
|
|
181
194
|
var disabled = _a.disabled;
|
|
182
|
-
return disabled && (0, styled_components_1.css)(
|
|
195
|
+
return disabled && (0, styled_components_1.css)(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n pointer-events: none;\n "], ["\n pointer-events: none;\n "])));
|
|
183
196
|
});
|
|
184
197
|
var buttonVariantSetting = {
|
|
185
198
|
primary: ButtonPrimary,
|
|
@@ -188,21 +201,21 @@ var buttonVariantSetting = {
|
|
|
188
201
|
custom: ButtonCustom,
|
|
189
202
|
googleAuth: GoogleButton,
|
|
190
203
|
};
|
|
191
|
-
exports.ButtonStyled = styled_components_1.default.button(
|
|
204
|
+
exports.ButtonStyled = styled_components_1.default.button(templateObject_25 || (templateObject_25 = __makeTemplateObject(["\n ", "\n\n ", "\n\n white-space: nowrap;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 1rem;\n cursor: pointer;\n border: none;\n border-radius: 2px;\n\n &:disabled{\n cursor: not-allowed;\n }\n\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n\n white-space: nowrap;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 1rem;\n cursor: pointer;\n border: none;\n border-radius: 2px;\n\n &:disabled{\n cursor: not-allowed;\n }\n\n ", "\n\n ", "\n"])), function (_a) {
|
|
192
205
|
var composition = _a.composition, size = _a.size;
|
|
193
206
|
switch (composition) {
|
|
194
207
|
case "iconOnly":
|
|
195
|
-
return (0, styled_components_1.css)(
|
|
208
|
+
return (0, styled_components_1.css)(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n padding: 0;\n height: ", ";\n width: ", ";\n flex-shrink: 0; // if button is a flex item then by default it's width shrinks when the viewport width shrinks\n "], ["\n padding: 0;\n height: ", ";\n width: ", ";\n flex-shrink: 0; // if button is a flex item then by default it's width shrinks when the viewport width shrinks\n "])), SIZES[size], SIZES[size]);
|
|
196
209
|
case "icon+text":
|
|
197
|
-
return (0, styled_components_1.css)(
|
|
210
|
+
return (0, styled_components_1.css)(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n padding: 0 2rem 0 1.5rem;\n height: ", ";\n "], ["\n padding: 0 2rem 0 1.5rem;\n height: ", ";\n "])), SIZES[size]);
|
|
198
211
|
default:
|
|
199
|
-
return (0, styled_components_1.css)(
|
|
212
|
+
return (0, styled_components_1.css)(templateObject_23 || (templateObject_23 = __makeTemplateObject(["\n padding: 0 2rem;\n height: ", ";\n "], ["\n padding: 0 2rem;\n height: ", ";\n "])), SIZES[size]);
|
|
200
213
|
}
|
|
201
214
|
}, function (_a) {
|
|
202
215
|
var width = _a.width;
|
|
203
|
-
return width && (0, styled_components_1.css)(
|
|
216
|
+
return width && (0, styled_components_1.css)(templateObject_24 || (templateObject_24 = __makeTemplateObject(["\n width: ", ";\n "], ["\n width: ", ";\n "])), width);
|
|
204
217
|
}, (0, mixins_1.transition)("background-color"), function (_a) {
|
|
205
218
|
var variant = _a.variant;
|
|
206
219
|
return buttonVariantSetting[variant];
|
|
207
220
|
});
|
|
208
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21;
|
|
221
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22, templateObject_23, templateObject_24, templateObject_25;
|
|
@@ -36,20 +36,34 @@ var CheckboxInput = function (_a) {
|
|
|
36
36
|
var isSelected = !!value.find(function (selOp) { return selOp.value === option.value; });
|
|
37
37
|
var markingCommand = (0, utils_1.getMarkingCommand)({ option: option, isSelected: isSelected }); // returns undefined if option isn't labeled as 'correct' nor selected
|
|
38
38
|
var SuitableTypo = S ? Typo_1.SANS_2 : Typo_1.SANS_3;
|
|
39
|
+
var genCheckboxButton = function (options) {
|
|
40
|
+
if (options === void 0) { options = {}; }
|
|
41
|
+
return (react_1.default.createElement(exports.CheckboxButton, __assign({}, {
|
|
42
|
+
isSelected: isSelected,
|
|
43
|
+
disabled: disabled,
|
|
44
|
+
invert: invert,
|
|
45
|
+
S: S,
|
|
46
|
+
className: 'btn',
|
|
47
|
+
disabled: options.disabled || disabled
|
|
48
|
+
})));
|
|
49
|
+
};
|
|
50
|
+
var genCheckSquare = function () { return (react_1.default.createElement(CheckSquare, { size: S ? 22.5 : 26, color: green, style: {
|
|
51
|
+
margin: '-7px -2.8px -7px -3.2px',
|
|
52
|
+
flexShrink: 0
|
|
53
|
+
} })); };
|
|
54
|
+
var genXSquare = function () { return (react_1.default.createElement(XSquare, { size: S ? 21.5 : 26, color: red, style: {
|
|
55
|
+
margin: '-7px -2.8px -7px -3.2px',
|
|
56
|
+
flexShrink: 0
|
|
57
|
+
} })); };
|
|
39
58
|
return inputStyle === 'tagSelect' ? (react_1.default.createElement(Tags_1.TagSelect, __assign({}, { isSelected: isSelected, invert: invert, disabled: disabled }, { onClick: function () { return !disabled && onClick(option, isSelected); }, display: option.display, value: option.value, style: { alignSelf: 'flex-start' } }))) : (react_1.default.createElement(styled_1.StyledOption, __assign({}, { rightWrongResult: rightWrongResult, isSelected: isSelected, disabled: disabled, invert: invert, S: S }, { onClick: function () { return !rightWrongResult && !disabled && onClick && onClick(isSelected, option); } }),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
: // then wrong
|
|
49
|
-
react_1.default.createElement(XSquare, { size: S ? 21.5 : 26, color: red, style: {
|
|
50
|
-
margin: '-7px -2.8px -7px -3.2px',
|
|
51
|
-
flexShrink: 0
|
|
52
|
-
} }),
|
|
59
|
+
rightWrongResult
|
|
60
|
+
? ["markCorrect", "revealCorrect"].includes(markingCommand)
|
|
61
|
+
? genCheckSquare()
|
|
62
|
+
: markingCommand === 'markWrong'
|
|
63
|
+
? genXSquare()
|
|
64
|
+
: genCheckboxButton({ disabled: true }) //else rightWrongResult has come in, but this doesnt have to be marked right or wrong
|
|
65
|
+
: genCheckboxButton() // rightWrongResult has not come in. so gen normal radio button
|
|
66
|
+
,
|
|
53
67
|
react_1.default.createElement(SuitableTypo, { bold: rightWrongResult && isSelected, color: disabled && greyColor40, invert: invert }, option.display)));
|
|
54
68
|
};
|
|
55
69
|
exports.CheckboxInput = CheckboxInput;
|
|
@@ -33,7 +33,7 @@ var utilsOolib_1 = require("../../../../../../utilsOolib");
|
|
|
33
33
|
var themes_1 = require("../../../../../../themes");
|
|
34
34
|
var mixins_1 = require("../../../../../../themes/mixins");
|
|
35
35
|
var none = themes_1.colors.none, greyColor40 = themes_1.colors.greyColor40, greyColor80 = themes_1.colors.greyColor80;
|
|
36
|
-
exports.StyledCheckbox = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n \n width: ", ";\n height: ", ";\n border: none;\n box-shadow: inset 0 0 0 2px ", ";\n border-radius: 2px;\n background-color: ", ";\n cursor: ", ";\n\n ", "\n\n\n ", "\n\n &:hover {\n ", "\n }\n\n &:focus{\n border: none;\n box-shadow:
|
|
36
|
+
exports.StyledCheckbox = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n \n width: ", ";\n height: ", ";\n border: none;\n box-shadow: inset 0 0 0 2px ", ";\n border-radius: 2px;\n background-color: ", ";\n cursor: ", ";\n\n ", "\n\n\n ", "\n\n &:hover {\n ", "\n }\n\n &:focus{\n border: none;\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n"], ["\n \n width: ", ";\n height: ", ";\n border: none;\n box-shadow: inset 0 0 0 2px ", ";\n border-radius: 2px;\n background-color: ", ";\n cursor: ", ";\n\n ", "\n\n\n ", "\n\n &:hover {\n ", "\n }\n\n &:focus{\n border: none;\n box-shadow: inset 0 0 0 2px ", ";\n }\n\n"])), function (_a) {
|
|
37
37
|
var S = _a.S;
|
|
38
38
|
return S ? '1.7rem' : '2rem';
|
|
39
39
|
}, function (_a) {
|
|
@@ -52,5 +52,9 @@ exports.StyledCheckbox = styled_components_1.default.button(templateObject_3 ||
|
|
|
52
52
|
}, function (_a) {
|
|
53
53
|
var isSelected = _a.isSelected, disabled = _a.disabled, theme = _a.theme, invert = _a.invert;
|
|
54
54
|
return !isSelected && !disabled && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), invert ? greyColor80 : (0, utilsOolib_1.getPrimaryColor10)(theme.colors));
|
|
55
|
+
}, function (_a) {
|
|
56
|
+
var colors = _a.theme.colors, disabled = _a.disabled, invert = _a.invert;
|
|
57
|
+
return disabled ?
|
|
58
|
+
greyColor40 : invert ? (0, utilsOolib_1.getPrimaryColor40)(colors) : (0, utilsOolib_1.getPrimaryColor100)(colors);
|
|
55
59
|
});
|
|
56
60
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -25,29 +25,50 @@ var styled_2 = require("./styled");
|
|
|
25
25
|
var green = themes_1.colors.green, red = themes_1.colors.red, greyColor40 = themes_1.colors.greyColor40;
|
|
26
26
|
var XCircle = icons_1.icons.XCircle, CheckCircle = icons_1.icons.CheckCircle;
|
|
27
27
|
var RadioButton = function (_a) {
|
|
28
|
-
var
|
|
29
|
-
return (react_1.default.createElement(styled_2.StyledRadioInput, __assign({ onClick: function (ev) { return onClick && onClick(ev); } }, {
|
|
28
|
+
var isSelected = _a.isSelected, onClick = _a.onClick, disabled = _a.disabled, invert = _a.invert, S = _a.S;
|
|
29
|
+
return (react_1.default.createElement(styled_2.StyledRadioInput, __assign({ onClick: function (ev) { return onClick && onClick(ev); } }, { isSelected: isSelected, disabled: disabled, invert: invert, S: S }), isSelected && react_1.default.createElement(styled_2.StyledRadioInputFill, { invert: invert, S: S })));
|
|
30
30
|
};
|
|
31
31
|
exports.RadioButton = RadioButton;
|
|
32
32
|
var RadioInput = function (_a) {
|
|
33
33
|
var option = _a.option, onClick = _a.onClick, disabled = _a.disabled, invert = _a.invert, value = _a.value, S = _a.S, rightWrongResult = _a.rightWrongResult;
|
|
34
34
|
var isSelected = option.value === (value === null || value === void 0 ? void 0 : value.value);
|
|
35
35
|
var markingCommand = (0, utils_1.getMarkingCommand)({ option: option, isSelected: isSelected }); // returns undefined if option isn't labeled as 'correct' nor selected
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
var TYPO_COMP = S
|
|
37
|
+
? Typo_1.SANS_2
|
|
38
|
+
: Typo_1.SANS_3;
|
|
39
|
+
var genRadioButton = function (options) {
|
|
40
|
+
if (options === void 0) { options = {}; }
|
|
41
|
+
return (react_1.default.createElement(exports.RadioButton, __assign({}, {
|
|
42
|
+
isSelected: isSelected,
|
|
43
|
+
invert: invert,
|
|
44
|
+
S: S,
|
|
45
|
+
className: 'btn',
|
|
46
|
+
disabled: options.disabled || disabled //because we force disabled if rightWrongResult exists & no markingCommand exists against this option i.e, it neither has to be marked right nor wrong
|
|
47
|
+
})));
|
|
48
|
+
};
|
|
49
|
+
var genCheckCircle = function () { return (react_1.default.createElement(CheckCircle, { size: S ? 21 : 24.5, color: green, style: {
|
|
50
|
+
margin: '-5px -1.5px -5px -3px',
|
|
51
|
+
flexShrink: 0
|
|
52
|
+
} })); };
|
|
53
|
+
var genXCircle = function () { return (react_1.default.createElement(XCircle, { size: S ? 21 : 24.5, color: red, style: {
|
|
54
|
+
margin: '-5px -1.5px -5px -3px',
|
|
55
|
+
flexShrink: 0
|
|
56
|
+
} })); };
|
|
57
|
+
return (react_1.default.createElement(styled_1.StyledOption, __assign({}, {
|
|
58
|
+
disabled: disabled,
|
|
59
|
+
rightWrongResult: rightWrongResult,
|
|
60
|
+
isSelected: isSelected,
|
|
61
|
+
invert: invert,
|
|
62
|
+
S: S
|
|
63
|
+
}, { onClick: function () { return !rightWrongResult && !disabled && onClick(option); } }),
|
|
64
|
+
rightWrongResult
|
|
65
|
+
? ["markCorrect", "revealCorrect"].includes(markingCommand)
|
|
66
|
+
? genCheckCircle()
|
|
67
|
+
: markingCommand === 'markWrong'
|
|
68
|
+
? genXCircle()
|
|
69
|
+
: genRadioButton({ disabled: true }) //else rightWrongResult has come in, but this doesnt have to be marked right or wrong
|
|
70
|
+
: genRadioButton() // rightWrongResult as not come in. so gen normal radio button
|
|
71
|
+
,
|
|
72
|
+
react_1.default.createElement(TYPO_COMP, { bold: rightWrongResult && isSelected, color: disabled && greyColor40, invert: invert }, option.display)));
|
|
52
73
|
};
|
|
53
74
|
exports.RadioInput = RadioInput;
|
|
@@ -33,7 +33,7 @@ var themes_1 = require("../../../../../../themes");
|
|
|
33
33
|
var mixins_1 = require("../../../../../../themes/mixins");
|
|
34
34
|
var utilsOolib_1 = require("../../../../../../utilsOolib");
|
|
35
35
|
var none = themes_1.colors.none, white = themes_1.colors.white, greyColor40 = themes_1.colors.greyColor40, greyColor100 = themes_1.colors.greyColor100, greyColor80 = themes_1.colors.greyColor80;
|
|
36
|
-
exports.StyledRadioInput = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: 50%;\n width: ", ";\n height: ", ";\n border: 2px solid ", ";\n background-color: ", ";\n flex: 0 0 auto;\n cursor: ", ";\n ", "\n\n ", "\n\n &:hover {\n ", "\n }\n\n &:focus {\n border:
|
|
36
|
+
exports.StyledRadioInput = styled_components_1.default.button(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border-radius: 50%;\n width: ", ";\n height: ", ";\n border: 2px solid ", ";\n background-color: ", ";\n flex: 0 0 auto;\n cursor: ", ";\n ", "\n\n ", "\n\n &:hover {\n ", "\n }\n\n &:focus {\n border: 2px solid ", ";\n box-shadow: none;\n }\n\n"], ["\n border-radius: 50%;\n width: ", ";\n height: ", ";\n border: 2px solid ", ";\n background-color: ", ";\n flex: 0 0 auto;\n cursor: ", ";\n ", "\n\n ", "\n\n &:hover {\n ", "\n }\n\n &:focus {\n border: 2px solid ", ";\n box-shadow: none;\n }\n\n"])), function (_a) {
|
|
37
37
|
var S = _a.S;
|
|
38
38
|
return S ? '1.7rem' : '2rem';
|
|
39
39
|
}, function (_a) {
|
|
@@ -56,6 +56,10 @@ exports.StyledRadioInput = styled_components_1.default.button(templateObject_3 |
|
|
|
56
56
|
}, function (_a) {
|
|
57
57
|
var isSelected = _a.isSelected, disabled = _a.disabled, theme = _a.theme, invert = _a.invert;
|
|
58
58
|
return !isSelected && !disabled && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), invert ? greyColor80 : (0, utilsOolib_1.getPrimaryColor10)(theme.colors));
|
|
59
|
+
}, function (_a) {
|
|
60
|
+
var colors = _a.theme.colors, disabled = _a.disabled, invert = _a.invert;
|
|
61
|
+
return disabled ? greyColor40 :
|
|
62
|
+
invert ? (0, utilsOolib_1.getPrimaryColor40)(colors) : (0, utilsOolib_1.getPrimaryColor100)(colors);
|
|
59
63
|
});
|
|
60
64
|
exports.StyledRadioInputFill = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width:", ";\n height:", ";\n flex-shrink: 0;\n border-radius: 50%;\n background-color: ", ";\n"], ["\n width:", ";\n height:", ";\n flex-shrink: 0;\n border-radius: 50%;\n background-color: ", ";\n"])), function (_a) {
|
|
61
65
|
var S = _a.S;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function RadioList({ id, injectOtherOption, value: valueProp, onChange, saveValueAsString, options, commonIsCorrectDesc, rightWrongResult, optionsLimit, listType, disabled, invert,
|
|
1
|
+
export function RadioList({ id, injectOtherOption, value: valueProp, onChange, saveValueAsString, options, commonIsCorrectDesc, rightWrongResult, optionsLimit, listType, disabled, invert, readOnly, S }: {
|
|
2
2
|
id: any;
|
|
3
3
|
injectOtherOption?: boolean;
|
|
4
4
|
value: any;
|
|
@@ -11,8 +11,6 @@ export function RadioList({ id, injectOtherOption, value: valueProp, onChange, s
|
|
|
11
11
|
listType: any;
|
|
12
12
|
disabled: any;
|
|
13
13
|
invert: any;
|
|
14
|
-
style: any;
|
|
15
|
-
className: any;
|
|
16
14
|
readOnly: any;
|
|
17
15
|
S: any;
|
|
18
16
|
}, ...args: any[]): any;
|
|
@@ -45,7 +45,7 @@ var styled_1 = require("../../styled");
|
|
|
45
45
|
var utils_1 = require("../../utils");
|
|
46
46
|
var comps_1 = require("./comps");
|
|
47
47
|
function RadioList(_a) {
|
|
48
|
-
var id = _a.id, _b = _a.injectOtherOption, injectOtherOption = _b === void 0 ? false : _b, valueProp = _a.value, onChange = _a.onChange, saveValueAsString = _a.saveValueAsString, options = _a.options, commonIsCorrectDesc = _a.commonIsCorrectDesc, rightWrongResult = _a.rightWrongResult, _c = _a.optionsLimit, optionsLimit = _c === void 0 ? Infinity : _c, listType = _a.listType, disabled = _a.disabled, invert = _a.invert,
|
|
48
|
+
var id = _a.id, _b = _a.injectOtherOption, injectOtherOption = _b === void 0 ? false : _b, valueProp = _a.value, onChange = _a.onChange, saveValueAsString = _a.saveValueAsString, options = _a.options, commonIsCorrectDesc = _a.commonIsCorrectDesc, rightWrongResult = _a.rightWrongResult, _c = _a.optionsLimit, optionsLimit = _c === void 0 ? Infinity : _c, listType = _a.listType, disabled = _a.disabled, invert = _a.invert, readOnly = _a.readOnly, S = _a.S;
|
|
49
49
|
var props = arguments[0];
|
|
50
50
|
var shouldHideSomeOptions = options.length > optionsLimit;
|
|
51
51
|
var _d = (0, react_1.useState)(false), seeMore = _d[0], setSeeMore = _d[1];
|
|
@@ -72,11 +72,11 @@ function RadioList(_a) {
|
|
|
72
72
|
rightWrongResult: rightWrongResult,
|
|
73
73
|
onClick: handleInputClick,
|
|
74
74
|
};
|
|
75
|
-
return (react_1.default.createElement("div", {
|
|
75
|
+
return (react_1.default.createElement("div", { id: id },
|
|
76
76
|
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
|
|
77
77
|
readOnly ? ((value === null || value === void 0 ? void 0 : value.display) && react_1.default.createElement(Tags_1.TagDisplay, { display: value.display_desc || value.display, invert: invert }) //prioritzing display_desc since display of 'other' option is === other
|
|
78
78
|
) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
79
|
-
react_1.default.createElement(styled_1.StyledOptionsContainer, __assign({}, { listType: listType,
|
|
79
|
+
react_1.default.createElement(styled_1.StyledOptionsContainer, __assign({}, { listType: listType, S: S }), typicalOptions === null || typicalOptions === void 0 ? void 0 :
|
|
80
80
|
typicalOptions.map(function (option, idx) { return idx < optionsLimit && (react_1.default.createElement(comps_1.RadioInput, __assign({}, __assign(__assign({}, InputCommonProps), { option: option, key: option.value })))); }),
|
|
81
81
|
shouldHideSomeOptions && // if we have the case of off limit options
|
|
82
82
|
(seeMore || rightWrongResult) && //and decided to show them
|
|
@@ -4,5 +4,6 @@ export { deleteVal } from "../getterSetterDeleter/deleteVal";
|
|
|
4
4
|
export { getBlockLabelProps } from "../getBlockLabelProps";
|
|
5
5
|
export { injectHttps } from "../injectHttps";
|
|
6
6
|
export { formatTextToCamelCase } from "../formatTextToCamelCase";
|
|
7
|
+
export { formatCamelCaseToSentenceCase } from "../formatCamelCaseToSentenceCase";
|
|
7
8
|
export { toArray } from "../toArray";
|
|
8
9
|
export { useScroll } from "../customHooks/useScroll";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useScroll = exports.toArray = exports.formatTextToCamelCase = exports.injectHttps = exports.getBlockLabelProps = exports.deleteVal = exports.setVal = exports.getVal = void 0;
|
|
3
|
+
exports.useScroll = exports.toArray = exports.formatCamelCaseToSentenceCase = exports.formatTextToCamelCase = 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; } });
|
|
@@ -15,6 +15,8 @@ var injectHttps_1 = require("../injectHttps");
|
|
|
15
15
|
Object.defineProperty(exports, "injectHttps", { enumerable: true, get: function () { return injectHttps_1.injectHttps; } });
|
|
16
16
|
var formatTextToCamelCase_1 = require("../formatTextToCamelCase");
|
|
17
17
|
Object.defineProperty(exports, "formatTextToCamelCase", { enumerable: true, get: function () { return formatTextToCamelCase_1.formatTextToCamelCase; } });
|
|
18
|
+
var formatCamelCaseToSentenceCase_1 = require("../formatCamelCaseToSentenceCase");
|
|
19
|
+
Object.defineProperty(exports, "formatCamelCaseToSentenceCase", { enumerable: true, get: function () { return formatCamelCaseToSentenceCase_1.formatCamelCaseToSentenceCase; } });
|
|
18
20
|
var toArray_1 = require("../toArray");
|
|
19
21
|
Object.defineProperty(exports, "toArray", { enumerable: true, get: function () { return toArray_1.toArray; } });
|
|
20
22
|
//custom hooks
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function formatCamelCaseToSentenceCase(text: any): any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatCamelCaseToSentenceCase = void 0;
|
|
4
|
+
//e.g CamelCase --> Sentence Case
|
|
5
|
+
var formatCamelCaseToSentenceCase = function (text) {
|
|
6
|
+
var toReturn = text.replace(/([a-z0-9])([A-Z])/g, '$1 $2');
|
|
7
|
+
//picked up from here: https://stackoverflow.com/questions/18379254/regex-to-split-camel-case
|
|
8
|
+
//explanation of $1 $2: https://stackoverflow.com/questions/16702924/how-to-explain-1-2-in-javascript-when-using-regular-expression
|
|
9
|
+
return toReturn[0].toUpperCase() + toReturn.slice(1);
|
|
10
|
+
};
|
|
11
|
+
exports.formatCamelCaseToSentenceCase = formatCamelCaseToSentenceCase;
|