oolib 2.207.1 → 2.208.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/DateRangePicker/index.js +2 -2
- package/dist/components/GroupQuestionsInputSingle/index.js +2 -2
- package/dist/components/IFrameInput/index.js +1 -1
- package/dist/components/ImageInput/comps/Placeholder/index.js +1 -1
- package/dist/components/SimpleTable/index.js +2 -2
- package/dist/components/VideoInput/comps/EmbedLinkModal.js +1 -1
- package/dist/components/cards/ListProfile/index.js +1 -1
- package/dist/index.d.ts +8 -9
- package/dist/index.js +25 -33
- package/dist/stories/Oolib/components/Modal.stories.js +2 -2
- package/dist/stories/Oolib/components/TagsInput.stories.js +1 -1
- package/dist/stories/v2/components/visualization/HeatMapGrid.stories.d.ts +1 -0
- package/dist/stories/v2/components/visualization/HeatMapGrid.stories.js +83 -1
- package/dist/v2/components/DateRangePicker/index.js +1 -2
- package/dist/v2/components/TabBar/index.js +3 -3
- package/dist/v2/components/TextInputs/index.js +0 -7
- package/dist/v2/components/TextInputs/index.styled.js +1 -1
- package/dist/v2/components/dataviz/HeatMapGrid/index.js +23 -28
- package/dist/v2/components/dataviz/HeatMapGrid/utils/usePrepareHeatMapData.d.ts +33 -0
- package/dist/v2/components/dataviz/HeatMapGrid/utils/usePrepareHeatMapData.js +117 -0
- package/package.json +1 -1
- package/dist/components/BlockLabel/index.d.ts +0 -2
- package/dist/components/BlockLabel/index.js +0 -75
- package/dist/components/BlockLabel/index.styled.d.ts +0 -2
- package/dist/components/BlockLabel/index.styled.js +0 -14
- package/dist/components/Dropdowns/DropdownMulti/index.d.ts +0 -38
- package/dist/components/Dropdowns/DropdownMulti/index.js +0 -179
- package/dist/components/Dropdowns/DropdownSingle/index.d.ts +0 -40
- package/dist/components/Dropdowns/DropdownSingle/index.js +0 -163
- package/dist/components/Dropdowns/comps/Caret/index.d.ts +0 -6
- package/dist/components/Dropdowns/comps/Caret/index.js +0 -19
- package/dist/components/Dropdowns/comps/Caret/styled.d.ts +0 -2
- package/dist/components/Dropdowns/comps/Caret/styled.js +0 -14
- package/dist/components/Dropdowns/comps/DisplayCompSingle/index.d.ts +0 -7
- package/dist/components/Dropdowns/comps/DisplayCompSingle/index.js +0 -39
- package/dist/components/Dropdowns/comps/NoOptionResultsComp/index.d.ts +0 -4
- package/dist/components/Dropdowns/comps/NoOptionResultsComp/index.js +0 -15
- package/dist/components/Dropdowns/comps/OptionContent/index.d.ts +0 -8
- package/dist/components/Dropdowns/comps/OptionContent/index.js +0 -34
- package/dist/components/Dropdowns/comps/OptionsMulti/index.d.ts +0 -28
- package/dist/components/Dropdowns/comps/OptionsMulti/index.js +0 -159
- package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.d.ts +0 -14
- package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/index.js +0 -81
- package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/styled.d.ts +0 -2
- package/dist/components/Dropdowns/comps/OptionsShell/comps/OptionsAnimateWrapper/styled.js +0 -25
- package/dist/components/Dropdowns/comps/OptionsShell/index.d.ts +0 -2
- package/dist/components/Dropdowns/comps/OptionsShell/index.js +0 -101
- package/dist/components/Dropdowns/comps/OptionsShell/styled.d.ts +0 -5
- package/dist/components/Dropdowns/comps/OptionsShell/styled.js +0 -45
- package/dist/components/Dropdowns/comps/OptionsSingle/index.d.ts +0 -28
- package/dist/components/Dropdowns/comps/OptionsSingle/index.js +0 -105
- package/dist/components/Dropdowns/comps/OptionsSingle/styled.d.ts +0 -1
- package/dist/components/Dropdowns/comps/OptionsSingle/styled.js +0 -61
- package/dist/components/Dropdowns/comps/SelectDropdown/index.d.ts +0 -13
- package/dist/components/Dropdowns/comps/SelectDropdown/index.js +0 -54
- package/dist/components/Dropdowns/comps/SelectDropdown/styled.d.ts +0 -1
- package/dist/components/Dropdowns/comps/SelectDropdown/styled.js +0 -71
- package/dist/components/Dropdowns/comps/SelectTagsInput/index.d.ts +0 -18
- package/dist/components/Dropdowns/comps/SelectTagsInput/index.js +0 -124
- package/dist/components/Dropdowns/comps/SelectTagsInput/styled.d.ts +0 -2
- package/dist/components/Dropdowns/comps/SelectTagsInput/styled.js +0 -54
- package/dist/components/Dropdowns/handlers/index.d.ts +0 -14
- package/dist/components/Dropdowns/handlers/index.js +0 -52
- package/dist/components/Dropdowns/styled.d.ts +0 -2
- package/dist/components/Dropdowns/styled.js +0 -49
- package/dist/components/Dropdowns/utils/genColor.d.ts +0 -4
- package/dist/components/Dropdowns/utils/genColor.js +0 -15
- package/dist/components/Dropdowns/utils/genIcon.d.ts +0 -6
- package/dist/components/Dropdowns/utils/genIcon.js +0 -18
- package/dist/components/Dropdowns/utils/genLinkOrText.d.ts +0 -1
- package/dist/components/Dropdowns/utils/genLinkOrText.js +0 -48
- package/dist/components/Dropdowns/utils/genProfileImg.d.ts +0 -6
- package/dist/components/Dropdowns/utils/genProfileImg.js +0 -14
- package/dist/components/Dropdowns/utils/genTagComp.d.ts +0 -2
- package/dist/components/Dropdowns/utils/genTagComp.js +0 -27
- package/dist/components/Dropdowns/utils/generateOptions.d.ts +0 -5
- package/dist/components/Dropdowns/utils/generateOptions.js +0 -20
- package/dist/components/Dropdowns/utils/getAllOptionsFns/genMonthsArray.d.ts +0 -1
- package/dist/components/Dropdowns/utils/getAllOptionsFns/genMonthsArray.js +0 -40
- package/dist/components/Dropdowns/utils/getAllOptionsFns/genYearsArray.d.ts +0 -4
- package/dist/components/Dropdowns/utils/getAllOptionsFns/genYearsArray.js +0 -11
- package/dist/components/Dropdowns/utils/getAllOptionsFns/getLanguagesArray.d.ts +0 -4
- package/dist/components/Dropdowns/utils/getAllOptionsFns/getLanguagesArray.js +0 -62
- package/dist/components/Dropdowns/utils/getAllOptionsFns/index.d.ts +0 -1
- package/dist/components/Dropdowns/utils/getAllOptionsFns/index.js +0 -19
- package/dist/components/Dropdowns/utils/getValue.d.ts +0 -14
- package/dist/components/Dropdowns/utils/getValue.js +0 -32
- package/dist/components/Dropdowns/utils/isDynamicOtherOption.d.ts +0 -0
- package/dist/components/Dropdowns/utils/isDynamicOtherOption.js +0 -0
- package/dist/components/Dropdowns/utils/keywordSearchOptions.d.ts +0 -6
- package/dist/components/Dropdowns/utils/keywordSearchOptions.js +0 -18
- package/dist/components/Dropdowns/utils/setDropdownSelectText.d.ts +0 -12
- package/dist/components/Dropdowns/utils/setDropdownSelectText.js +0 -19
- package/dist/components/Dropdowns/utils/useCreateDropdownRefs.d.ts +0 -5
- package/dist/components/Dropdowns/utils/useCreateDropdownRefs.js +0 -15
- package/dist/components/Dropdowns/utils/useHideShowOptions.d.ts +0 -5
- package/dist/components/Dropdowns/utils/useHideShowOptions.js +0 -20
- package/dist/components/Dropdowns/utils/useKeyboardControl.d.ts +0 -12
- package/dist/components/Dropdowns/utils/useKeyboardControl.js +0 -73
- package/dist/components/Dropdowns/utils/useSearchString.d.ts +0 -4
- package/dist/components/Dropdowns/utils/useSearchString.js +0 -20
- package/dist/components/Dropdowns/utils/useSetYOrientation.d.ts +0 -9
- package/dist/components/Dropdowns/utils/useSetYOrientation.js +0 -46
- package/dist/components/Hints/contextApi.d.ts +0 -6
- package/dist/components/Hints/contextApi.js +0 -48
- package/dist/components/Hints/index.d.ts +0 -9
- package/dist/components/Hints/index.js +0 -127
- package/dist/components/Hints/styled.d.ts +0 -6
- package/dist/components/Hints/styled.js +0 -54
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.d.ts +0 -11
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/index.js +0 -30
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/styled.d.ts +0 -1
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/styled.js +0 -70
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.d.ts +0 -11
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxInput/index.js +0 -50
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.d.ts +0 -20
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/index.js +0 -124
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/styled.d.ts +0 -2
- package/dist/components/RadioAndCheckbox/comps/CheckboxList/styled.js +0 -17
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.d.ts +0 -18
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index.js +0 -53
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/styled.d.ts +0 -2
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/styled.js +0 -84
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/index.d.ts +0 -1
- package/dist/components/RadioAndCheckbox/comps/RadioList/comps/index.js +0 -6
- package/dist/components/RadioAndCheckbox/comps/RadioList/index.d.ts +0 -17
- package/dist/components/RadioAndCheckbox/comps/RadioList/index.js +0 -109
- package/dist/components/RadioAndCheckbox/index.d.ts +0 -5
- package/dist/components/RadioAndCheckbox/index.js +0 -14
- package/dist/components/RadioAndCheckbox/styled.d.ts +0 -5
- package/dist/components/RadioAndCheckbox/styled.js +0 -84
- package/dist/components/RadioAndCheckbox/utils.d.ts +0 -22
- package/dist/components/RadioAndCheckbox/utils.js +0 -49
- package/dist/components/Switches/index.d.ts +0 -21
- package/dist/components/Switches/index.js +0 -102
- package/dist/components/Switches/styled.d.ts +0 -5
- package/dist/components/Switches/styled.js +0 -63
- package/dist/components/TextInputs/index.d.ts +0 -24
- package/dist/components/TextInputs/index.js +0 -367
- package/dist/components/TextInputs/index.styled.d.ts +0 -3
- package/dist/components/TextInputs/index.styled.js +0 -77
- package/dist/components/cards/CardContent/index.d.ts +0 -11
- package/dist/components/cards/CardContent/index.js +0 -76
- package/dist/components/cards/CardContent/styled.d.ts +0 -7
- package/dist/components/cards/CardContent/styled.js +0 -63
- package/dist/components/cards/ListContent/index.d.ts +0 -12
- package/dist/components/cards/ListContent/index.js +0 -87
- package/dist/components/cards/ListContent/styled.d.ts +0 -7
- package/dist/components/cards/ListContent/styled.js +0 -26
- package/dist/stories/Oolib/components/BlockLabel.stories.d.ts +0 -71
- package/dist/stories/Oolib/components/BlockLabel.stories.js +0 -106
- package/dist/stories/Oolib/components/Checkbox.stories.d.ts +0 -248
- package/dist/stories/Oolib/components/Checkbox.stories.js +0 -249
- package/dist/stories/Oolib/components/Dropdowns.stories.d.ts +0 -127
- package/dist/stories/Oolib/components/Dropdowns.stories.js +0 -298
- package/dist/stories/Oolib/components/RadioButton.stories.d.ts +0 -260
- package/dist/stories/Oolib/components/RadioButton.stories.js +0 -264
- package/dist/stories/Oolib/components/Switches.stories.d.ts +0 -106
- package/dist/stories/Oolib/components/Switches.stories.js +0 -146
- package/dist/stories/Oolib/components/TextInputs.stories.d.ts +0 -124
- package/dist/stories/Oolib/components/TextInputs.stories.js +0 -188
|
@@ -1,30 +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.CheckboxButton = void 0;
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var icons_1 = require("../../../../../../icons");
|
|
9
|
-
var themes_1 = require("../../../../../../themes");
|
|
10
|
-
var styled_1 = require("./styled");
|
|
11
|
-
var Check = icons_1.icons.Check;
|
|
12
|
-
var white = themes_1.colors.white, greyColor100 = themes_1.colors.greyColor100;
|
|
13
|
-
/**
|
|
14
|
-
* value and onChange are being passed as props so
|
|
15
|
-
* that it can be generated dynamically via our
|
|
16
|
-
* block generators.
|
|
17
|
-
*/
|
|
18
|
-
var CheckboxButton = function (_a) {
|
|
19
|
-
var _b;
|
|
20
|
-
var id = _a.id, className = _a.className, _isSelected = _a.isSelected, value = _a.value, //can be used interchangibly
|
|
21
|
-
onChange = _a.onChange, disabled = _a.disabled, invert = _a.invert, S = _a.S;
|
|
22
|
-
var isSelected = (_b = _isSelected !== null && _isSelected !== void 0 ? _isSelected : value) !== null && _b !== void 0 ? _b : false;
|
|
23
|
-
return (react_1.default.createElement(styled_1.StyledCheckbox, { onClick: function (e) {
|
|
24
|
-
// e.preventDefault();
|
|
25
|
-
// e.stopPropagation(); //this disables the checkbox in checkboxlist which we dont want. so commented. tho we might need this later in table usecase in which case we will have to make stopPropagration a prop
|
|
26
|
-
onChange && onChange(id, !isSelected);
|
|
27
|
-
}, className: className, isSelected: isSelected, disabled: disabled, invert: invert, S: S }, isSelected &&
|
|
28
|
-
react_1.default.createElement(Check, { weight: "bold", color: invert ? greyColor100 : white, size: 16, style: { flexShrink: 0 } })));
|
|
29
|
-
};
|
|
30
|
-
exports.CheckboxButton = CheckboxButton;
|
package/dist/components/RadioAndCheckbox/comps/CheckboxList/comps/CheckboxButton/styled.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const StyledCheckbox: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
@@ -1,70 +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 () {
|
|
23
|
-
var ownKeys = function(o) {
|
|
24
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
-
var ar = [];
|
|
26
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
return ownKeys(o);
|
|
30
|
-
};
|
|
31
|
-
return function (mod) {
|
|
32
|
-
if (mod && mod.__esModule) return mod;
|
|
33
|
-
var result = {};
|
|
34
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
-
__setModuleDefault(result, mod);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
})();
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.StyledCheckbox = void 0;
|
|
41
|
-
var styled_components_1 = __importStar(require("styled-components"));
|
|
42
|
-
var utilsOolib_1 = require("../../../../../../utilsOolib");
|
|
43
|
-
var themes_1 = require("../../../../../../themes");
|
|
44
|
-
var mixins_1 = require("../../../../../../themes/mixins");
|
|
45
|
-
var none = themes_1.colors.none, greyColor40 = themes_1.colors.greyColor40, greyColor80 = themes_1.colors.greyColor80;
|
|
46
|
-
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) {
|
|
47
|
-
var S = _a.S;
|
|
48
|
-
return S ? '1.7rem' : '2rem';
|
|
49
|
-
}, function (_a) {
|
|
50
|
-
var S = _a.S;
|
|
51
|
-
return S ? '1.7rem' : '2rem';
|
|
52
|
-
}, function (_a) {
|
|
53
|
-
var colors = _a.theme.colors, disabled = _a.disabled, invert = _a.invert;
|
|
54
|
-
return disabled ?
|
|
55
|
-
greyColor40 : invert ? (0, utilsOolib_1.getPrimaryColor40)(colors) : (0, utilsOolib_1.getPrimaryColor100)(colors);
|
|
56
|
-
}, none, function (_a) {
|
|
57
|
-
var disabled = _a.disabled;
|
|
58
|
-
return disabled ? 'not-allowed' : 'pointer';
|
|
59
|
-
}, (0, mixins_1.transition)('background-color 0.2s'), function (_a) {
|
|
60
|
-
var isSelected = _a.isSelected, disabled = _a.disabled, invert = _a.invert, colors = _a.theme.colors;
|
|
61
|
-
return isSelected && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n "], ["\n background-color: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n "])), disabled ? greyColor40 : invert ? (0, utilsOolib_1.getPrimaryColor40)(colors) : (0, utilsOolib_1.getPrimaryColor100)(colors));
|
|
62
|
-
}, function (_a) {
|
|
63
|
-
var isSelected = _a.isSelected, disabled = _a.disabled, theme = _a.theme, invert = _a.invert;
|
|
64
|
-
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));
|
|
65
|
-
}, function (_a) {
|
|
66
|
-
var colors = _a.theme.colors, disabled = _a.disabled, invert = _a.invert;
|
|
67
|
-
return disabled ?
|
|
68
|
-
greyColor40 : invert ? (0, utilsOolib_1.getPrimaryColor40)(colors) : (0, utilsOolib_1.getPrimaryColor100)(colors);
|
|
69
|
-
});
|
|
70
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function CheckboxInput({ option, onClick, S, inputStyle, value, invert, disabled, rightWrongResult, }: {
|
|
2
|
-
option: any;
|
|
3
|
-
onClick: any;
|
|
4
|
-
S: any;
|
|
5
|
-
inputStyle: any;
|
|
6
|
-
value?: any[];
|
|
7
|
-
invert: any;
|
|
8
|
-
disabled: any;
|
|
9
|
-
rightWrongResult: any;
|
|
10
|
-
}): React.JSX.Element;
|
|
11
|
-
import React from 'react';
|
|
@@ -1,50 +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.CheckboxInput = void 0;
|
|
7
|
-
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var icons_1 = require("../../../../../../icons");
|
|
9
|
-
var themes_1 = require("../../../../../../themes");
|
|
10
|
-
var Tags_1 = require("../../../../../Tags");
|
|
11
|
-
var Typo_1 = require("../../../../../Typo");
|
|
12
|
-
var styled_1 = require("../../../../styled");
|
|
13
|
-
var utils_1 = require("../../../../utils");
|
|
14
|
-
var CheckboxButton_1 = require("../CheckboxButton");
|
|
15
|
-
var TextLoader_1 = require("../../../../../LoadersAndProgress/TextLoader");
|
|
16
|
-
var CheckSquare = icons_1.icons.CheckSquare, XSquare = icons_1.icons.XSquare;
|
|
17
|
-
var red = themes_1.colors.red, greyColor40 = themes_1.colors.greyColor40, invertGreen = themes_1.colors.invertGreen, green = themes_1.colors.green, invertRed = themes_1.colors.invertRed;
|
|
18
|
-
var CheckboxInput = function (_a) {
|
|
19
|
-
var option = _a.option, onClick = _a.onClick, S = _a.S, inputStyle = _a.inputStyle, _b = _a.value, value = _b === void 0 ? [] : _b, invert = _a.invert, disabled = _a.disabled, rightWrongResult = _a.rightWrongResult;
|
|
20
|
-
var isSelected = !!value.find(function (selOp) { return selOp.value === option.value; });
|
|
21
|
-
var markingCommand = (0, utils_1.getMarkingCommand)({ option: option, isSelected: isSelected }); // returns undefined if option isn't labeled as 'correct' nor selected
|
|
22
|
-
var SuitableTypo = S ? Typo_1.SANS_2 : Typo_1.SANS_3;
|
|
23
|
-
var genCheckboxButton = function (options) {
|
|
24
|
-
if (options === void 0) { options = {}; }
|
|
25
|
-
return (react_1.default.createElement(CheckboxButton_1.CheckboxButton, { isSelected: isSelected, disabled: disabled, invert: invert, S: S, className: 'btn',
|
|
26
|
-
disabled: options.disabled || disabled }));
|
|
27
|
-
};
|
|
28
|
-
var genCheckSquare = function () { return (react_1.default.createElement("div", { style: { flexShrink: 0 } },
|
|
29
|
-
react_1.default.createElement(CheckSquare, { size: S ? 22.5 : 26, color: invert ? invertGreen : green, style: {
|
|
30
|
-
margin: '-7px -2.8px -7px -3.2px',
|
|
31
|
-
flexShrink: 0
|
|
32
|
-
} }))); };
|
|
33
|
-
var genXSquare = function () { return (react_1.default.createElement(XSquare, { size: S ? 21.5 : 26, color: invert ? invertRed : red, style: {
|
|
34
|
-
margin: '-7px -2.8px -7px -3.2px',
|
|
35
|
-
flexShrink: 0
|
|
36
|
-
} })); };
|
|
37
|
-
return option.loading
|
|
38
|
-
? react_1.default.createElement(TextLoader_1.TextLoader, { style: { width: "8rem", height: "1.5rem" } })
|
|
39
|
-
: inputStyle === 'tagSelect' ? (react_1.default.createElement(Tags_1.TagSelect, { isSelected: isSelected, invert: invert, disabled: disabled, onClick: function () { return !disabled && onClick(isSelected, option); }, display: option.display, value: option.value, style: { alignSelf: 'flex-start' } })) : (react_1.default.createElement(styled_1.StyledOption, { rightWrongResult: rightWrongResult, isSelected: isSelected, disabled: disabled, invert: invert, S: S, onClick: function () { return !rightWrongResult && !disabled && onClick && onClick(isSelected, option); } },
|
|
40
|
-
react_1.default.createElement("div", { style: { flexShrink: 0 } }, rightWrongResult
|
|
41
|
-
? ["markCorrect", "revealCorrect"].includes(markingCommand)
|
|
42
|
-
? genCheckSquare()
|
|
43
|
-
: markingCommand === 'markWrong'
|
|
44
|
-
? genXSquare()
|
|
45
|
-
: genCheckboxButton({ disabled: true }) //else rightWrongResult has come in, but this doesnt have to be marked right or wrong
|
|
46
|
-
: genCheckboxButton() // rightWrongResult has not come in. so gen normal radio button
|
|
47
|
-
),
|
|
48
|
-
react_1.default.createElement(SuitableTypo, { bold: rightWrongResult && isSelected, color: disabled && greyColor40, invert: invert }, option.display)));
|
|
49
|
-
};
|
|
50
|
-
exports.CheckboxInput = CheckboxInput;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export function CheckboxList({ id, injectOtherOption, value: valueProp, onChange, commonIsCorrectDesc, options, saveValueAsString, inputStyle, rightWrongResult, listType, invert, optionsLimit, style, disabled, className, S, readOnly }: {
|
|
2
|
-
id: any;
|
|
3
|
-
injectOtherOption?: boolean;
|
|
4
|
-
value?: any[];
|
|
5
|
-
onChange: any;
|
|
6
|
-
commonIsCorrectDesc: any;
|
|
7
|
-
options?: any[];
|
|
8
|
-
saveValueAsString: any;
|
|
9
|
-
inputStyle?: string;
|
|
10
|
-
rightWrongResult: any;
|
|
11
|
-
listType?: string;
|
|
12
|
-
invert: any;
|
|
13
|
-
optionsLimit?: number;
|
|
14
|
-
style: any;
|
|
15
|
-
disabled: any;
|
|
16
|
-
className: any;
|
|
17
|
-
S: any;
|
|
18
|
-
readOnly: any;
|
|
19
|
-
}, ...args: any[]): React.JSX.Element;
|
|
20
|
-
import React from "react";
|
|
@@ -1,124 +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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
-
var ownKeys = function(o) {
|
|
31
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
-
var ar = [];
|
|
33
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
-
return ar;
|
|
35
|
-
};
|
|
36
|
-
return ownKeys(o);
|
|
37
|
-
};
|
|
38
|
-
return function (mod) {
|
|
39
|
-
if (mod && mod.__esModule) return mod;
|
|
40
|
-
var result = {};
|
|
41
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
-
__setModuleDefault(result, mod);
|
|
43
|
-
return result;
|
|
44
|
-
};
|
|
45
|
-
})();
|
|
46
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
-
exports.CheckboxList = CheckboxList;
|
|
48
|
-
var react_1 = __importStar(require("react"));
|
|
49
|
-
var BlockLabel_1 = require("../../../../v2/components/BlockLabel");
|
|
50
|
-
var Tags_1 = require("../../../Tags");
|
|
51
|
-
var TextInputs_1 = require("../../../TextInputs");
|
|
52
|
-
var Buttons_1 = require("../../../Buttons");
|
|
53
|
-
var _EXPORTS_1 = require("../../../../utils/_EXPORTS");
|
|
54
|
-
var utils_1 = require("../../utils");
|
|
55
|
-
var styled_1 = require("../../styled");
|
|
56
|
-
var CheckboxInput_1 = require("./comps/CheckboxInput");
|
|
57
|
-
var styled_2 = require("./styled");
|
|
58
|
-
var Typo_1 = require("../../../Typo");
|
|
59
|
-
var OKELink_1 = require("../../../OKELink");
|
|
60
|
-
var optionsContainers = {
|
|
61
|
-
checkbox: styled_1.StyledOptionsContainer,
|
|
62
|
-
tagSelect: styled_2.StyledTagOptionsContainer,
|
|
63
|
-
};
|
|
64
|
-
var convToString = function (value) { return value.map(function (v) { var _a; return (_a = v.display_desc) !== null && _a !== void 0 ? _a : v.value; }); };
|
|
65
|
-
function CheckboxList(_a) {
|
|
66
|
-
var id = _a.id, _b = _a.injectOtherOption, injectOtherOption = _b === void 0 ? false : _b, _c = _a.value, valueProp = _c === void 0 ? [] : _c, onChange = _a.onChange, commonIsCorrectDesc = _a.commonIsCorrectDesc, _d = _a.options, options = _d === void 0 ? [] : _d, saveValueAsString = _a.saveValueAsString, _e = _a.inputStyle, inputStyle = _e === void 0 ? 'checkbox' : _e, rightWrongResult = _a.rightWrongResult, _f = _a.listType, listType = _f === void 0 ? 'horizontal' : _f, invert = _a.invert, _g = _a.optionsLimit, optionsLimit = _g === void 0 ? Infinity : _g, style = _a.style, disabled = _a.disabled, className = _a.className, S = _a.S, readOnly = _a.readOnly;
|
|
67
|
-
var props = arguments[0];
|
|
68
|
-
var shouldHideSomeOptions = options.length > optionsLimit;
|
|
69
|
-
var _h = (0, react_1.useState)(false), seeMore = _h[0], setSeeMore = _h[1];
|
|
70
|
-
var _j = (0, utils_1.genDisplayedOptions)({ injectOtherOption: injectOtherOption, options: options, valueProp: valueProp, saveValueAsString: saveValueAsString }), typicalOptions = _j.typicalOptions, injectedOtherOption = _j.injectedOtherOption;
|
|
71
|
-
var value = saveValueAsString ?
|
|
72
|
-
typicalOptions
|
|
73
|
-
.concat(injectedOtherOption || [])
|
|
74
|
-
.filter(function (op) { var _a; return valueProp.includes((_a = op.display_desc) !== null && _a !== void 0 ? _a : op.value); })
|
|
75
|
-
: valueProp;
|
|
76
|
-
var handleTextInputChange = function (text) {
|
|
77
|
-
var newValue = value.map(function (selectedOp) { return (selectedOp.value === 'other' ? (0, utils_1.genOtherValueObject)(text) : selectedOp); });
|
|
78
|
-
if (saveValueAsString)
|
|
79
|
-
newValue = convToString(newValue);
|
|
80
|
-
onChange && onChange(id, newValue);
|
|
81
|
-
};
|
|
82
|
-
var handleCheckboxClick = function (isSelected, option) {
|
|
83
|
-
var newValue = isSelected
|
|
84
|
-
? value.filter(function (selOp) { return selOp.value !== option.value; })
|
|
85
|
-
: value.concat(option);
|
|
86
|
-
if (saveValueAsString)
|
|
87
|
-
newValue = convToString(newValue);
|
|
88
|
-
onChange(id, newValue);
|
|
89
|
-
};
|
|
90
|
-
var otherOpInSelectees = value.find(function (selectedOp) { return selectedOp.value === 'other'; });
|
|
91
|
-
var InputCommonProps = {
|
|
92
|
-
invert: invert,
|
|
93
|
-
value: value,
|
|
94
|
-
S: S,
|
|
95
|
-
disabled: disabled,
|
|
96
|
-
inputStyle: inputStyle,
|
|
97
|
-
rightWrongResult: rightWrongResult,
|
|
98
|
-
onClick: handleCheckboxClick,
|
|
99
|
-
};
|
|
100
|
-
var OptionsContainer = optionsContainers[inputStyle];
|
|
101
|
-
return (react_1.default.createElement("div", { className: className, id: id },
|
|
102
|
-
react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, (0, _EXPORTS_1.getBlockLabelProps)(props))),
|
|
103
|
-
readOnly ? (react_1.default.createElement(styled_2.StyledDisplayTagsContainer, null, value === null || value === void 0 ? void 0 : value.map(function (selOp) { return react_1.default.createElement(Tags_1.TagDisplay, { key: selOp.value, invert: invert, display: selOp.display_desc || selOp.display }); }))) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
104
|
-
react_1.default.createElement(OptionsContainer, { style: style, listType: listType, S: S }, typicalOptions === null || typicalOptions === void 0 ? void 0 :
|
|
105
|
-
typicalOptions.map(function (option, idx) { return idx < optionsLimit && (react_1.default.createElement(CheckboxInput_1.CheckboxInput, __assign({}, InputCommonProps, { option: option, key: option.value }))); }),
|
|
106
|
-
shouldHideSomeOptions && // if we have the case of off limit options
|
|
107
|
-
(seeMore || rightWrongResult) && //and decided to show them
|
|
108
|
-
typicalOptions.slice(optionsLimit).map(function (option) {
|
|
109
|
-
return react_1.default.createElement(CheckboxInput_1.CheckboxInput, __assign({}, InputCommonProps, { option: option, key: option.value }));
|
|
110
|
-
}),
|
|
111
|
-
injectOtherOption && injectedOtherOption && ( //so other box and its textInput act as one entity in the flexbox
|
|
112
|
-
react_1.default.createElement(styled_1.StyledOtherOptionContainer, { listType: listType },
|
|
113
|
-
react_1.default.createElement(CheckboxInput_1.CheckboxInput, __assign({}, InputCommonProps, { option: injectedOtherOption })),
|
|
114
|
-
otherOpInSelectees && (react_1.default.createElement(styled_1.StyledOtherTextInputWrapper, { listType: listType, rightWrongResult: rightWrongResult },
|
|
115
|
-
react_1.default.createElement(TextInputs_1.TextInput, { placeholder: "Please Specify Here", value: otherOpInSelectees.display_desc, onChange: function (k, v) { return handleTextInputChange(v); }, disabled: disabled, invert: invert, S: S })))))),
|
|
116
|
-
shouldHideSomeOptions && !rightWrongResult && (react_1.default.createElement(Typo_1.SANS_3, { style: { marginTop: '1rem' } },
|
|
117
|
-
react_1.default.createElement(OKELink_1.OKELink, { onClick: function () { return setSeeMore(!seeMore); }, children: !seeMore ? 'See More' : 'See Less' }))), /*
|
|
118
|
-
the minute the results have come in, irrespective of user's answers
|
|
119
|
-
being right or wrong, we show an explanation
|
|
120
|
-
below the options. provided that an explanation is provided.
|
|
121
|
-
*/
|
|
122
|
-
rightWrongResult && commonIsCorrectDesc &&
|
|
123
|
-
react_1.default.createElement(styled_1.StyledCorrectMessage, { invert: invert }, commonIsCorrectDesc)))));
|
|
124
|
-
}
|
|
@@ -1,17 +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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.StyledTagOptionsContainer = exports.StyledDisplayTagsContainer = void 0;
|
|
11
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
-
exports.StyledDisplayTagsContainer = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n gap: 1rem;\n"], ["\n display: flex;\n flex-wrap: wrap;\n gap: 1rem;\n"])));
|
|
13
|
-
exports.StyledTagOptionsContainer = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-wrap: wrap;\n flex-direction: ", ";\n gap: 1rem;\n"], ["\n display: flex;\n flex-wrap: wrap;\n flex-direction: ", ";\n gap: 1rem;\n"])), function (_a) {
|
|
14
|
-
var listType = _a.listType;
|
|
15
|
-
return listType === 'vertical' ? 'column' : 'row';
|
|
16
|
-
});
|
|
17
|
-
var templateObject_1, templateObject_2;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export function RadioButton({ isSelected, onClick, disabled, invert, S, readOnly }: {
|
|
2
|
-
isSelected: any;
|
|
3
|
-
onClick: any;
|
|
4
|
-
disabled: any;
|
|
5
|
-
invert: any;
|
|
6
|
-
S: any;
|
|
7
|
-
readOnly: any;
|
|
8
|
-
}): React.JSX.Element;
|
|
9
|
-
export function RadioInput({ option, onClick, disabled, invert, value, S, rightWrongResult, }: {
|
|
10
|
-
option: any;
|
|
11
|
-
onClick: any;
|
|
12
|
-
disabled: any;
|
|
13
|
-
invert: any;
|
|
14
|
-
value: any;
|
|
15
|
-
S: any;
|
|
16
|
-
rightWrongResult: any;
|
|
17
|
-
}): React.JSX.Element;
|
|
18
|
-
import React from "react";
|
|
@@ -1,53 +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.RadioInput = exports.RadioButton = 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_1 = require("../../../../utils");
|
|
12
|
-
var styled_1 = require("../../../../styled");
|
|
13
|
-
var styled_2 = require("./styled");
|
|
14
|
-
var invertGreen = themes_1.colors.invertGreen, red = themes_1.colors.red, greyColor40 = themes_1.colors.greyColor40, green = themes_1.colors.green, invertRed = themes_1.colors.invertRed;
|
|
15
|
-
var XCircle = icons_1.icons.XCircle, CheckCircle = icons_1.icons.CheckCircle;
|
|
16
|
-
var RadioButton = function (_a) {
|
|
17
|
-
var isSelected = _a.isSelected, onClick = _a.onClick, disabled = _a.disabled, invert = _a.invert, S = _a.S, readOnly = _a.readOnly;
|
|
18
|
-
return (react_1.default.createElement(styled_2.StyledRadioInput, { onClick: function (ev) { return onClick && onClick(ev); }, isSelected: isSelected, disabled: disabled, invert: invert, S: S, readOnly: readOnly }, isSelected && react_1.default.createElement(styled_2.StyledRadioInputFill, { invert: invert, S: S })));
|
|
19
|
-
};
|
|
20
|
-
exports.RadioButton = RadioButton;
|
|
21
|
-
var RadioInput = function (_a) {
|
|
22
|
-
var option = _a.option, onClick = _a.onClick, disabled = _a.disabled, invert = _a.invert, value = _a.value, S = _a.S, rightWrongResult = _a.rightWrongResult;
|
|
23
|
-
var isSelected = option.value === (value === null || value === void 0 ? void 0 : value.value);
|
|
24
|
-
var markingCommand = (0, utils_1.getMarkingCommand)({ option: option, isSelected: isSelected }); // returns undefined if option isn't labeled as 'correct' nor selected
|
|
25
|
-
var TYPO_COMP = S
|
|
26
|
-
? Typo_1.SANS_2
|
|
27
|
-
: Typo_1.SANS_3;
|
|
28
|
-
var genRadioButton = function (options) {
|
|
29
|
-
if (options === void 0) { options = {}; }
|
|
30
|
-
return (react_1.default.createElement(exports.RadioButton, { isSelected: isSelected, invert: invert, S: S, className: 'btn',
|
|
31
|
-
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
|
|
32
|
-
}));
|
|
33
|
-
};
|
|
34
|
-
var genCheckCircle = function () { return (react_1.default.createElement(CheckCircle, { size: S ? 21 : 24.5, color: invert ? invertGreen : green, style: {
|
|
35
|
-
margin: '-5px -1.5px -5px -3px',
|
|
36
|
-
flexShrink: 0
|
|
37
|
-
} })); };
|
|
38
|
-
var genXCircle = function () { return (react_1.default.createElement(XCircle, { size: S ? 21 : 24.5, color: invert ? invertRed : red, style: {
|
|
39
|
-
margin: '-5px -1.5px -5px -3px',
|
|
40
|
-
flexShrink: 0
|
|
41
|
-
} })); };
|
|
42
|
-
return (react_1.default.createElement(styled_1.StyledOption, { disabled: disabled, rightWrongResult: rightWrongResult, isSelected: isSelected, invert: invert, S: S, onClick: function () { return !rightWrongResult && !disabled && onClick(option); } },
|
|
43
|
-
rightWrongResult
|
|
44
|
-
? ["markCorrect", "revealCorrect"].includes(markingCommand)
|
|
45
|
-
? genCheckCircle()
|
|
46
|
-
: markingCommand === 'markWrong'
|
|
47
|
-
? genXCircle()
|
|
48
|
-
: genRadioButton({ disabled: true }) //else rightWrongResult has come in, but this doesnt have to be marked right or wrong
|
|
49
|
-
: genRadioButton() // rightWrongResult as not come in. so gen normal radio button
|
|
50
|
-
,
|
|
51
|
-
react_1.default.createElement(TYPO_COMP, { bold: rightWrongResult && isSelected, color: disabled && greyColor40, invert: invert }, option.display)));
|
|
52
|
-
};
|
|
53
|
-
exports.RadioInput = RadioInput;
|
|
@@ -1,84 +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 () {
|
|
23
|
-
var ownKeys = function(o) {
|
|
24
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
-
var ar = [];
|
|
26
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
return ownKeys(o);
|
|
30
|
-
};
|
|
31
|
-
return function (mod) {
|
|
32
|
-
if (mod && mod.__esModule) return mod;
|
|
33
|
-
var result = {};
|
|
34
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
-
__setModuleDefault(result, mod);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
})();
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.StyledRadioInputFill = exports.StyledRadioInput = void 0;
|
|
41
|
-
var styled_components_1 = __importStar(require("styled-components"));
|
|
42
|
-
var themes_1 = require("../../../../../../themes");
|
|
43
|
-
var mixins_1 = require("../../../../../../themes/mixins");
|
|
44
|
-
var utilsOolib_1 = require("../../../../../../utilsOolib");
|
|
45
|
-
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;
|
|
46
|
-
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) {
|
|
47
|
-
var S = _a.S;
|
|
48
|
-
return S ? '1.7rem' : '2rem';
|
|
49
|
-
}, function (_a) {
|
|
50
|
-
var S = _a.S;
|
|
51
|
-
return S ? '1.7rem' : '2rem';
|
|
52
|
-
}, function (_a) {
|
|
53
|
-
var colors = _a.theme.colors, disabled = _a.disabled, invert = _a.invert;
|
|
54
|
-
return disabled ? greyColor40 :
|
|
55
|
-
invert ? (0, utilsOolib_1.getPrimaryColor40)(colors) : (0, utilsOolib_1.getPrimaryColor100)(colors);
|
|
56
|
-
}, none, function (_a) {
|
|
57
|
-
var disabled = _a.disabled, readOnly = _a.readOnly;
|
|
58
|
-
return disabled ? 'not-allowed' : readOnly ? 'default' : 'pointer';
|
|
59
|
-
}, (0, mixins_1.transition)('background-color 0.2s'), function (_a) {
|
|
60
|
-
var isSelected = _a.isSelected;
|
|
61
|
-
return isSelected && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color:", ";\n display: flex;\n align-items: center;\n justify-content: center;\n "], ["\n background-color:", ";\n display: flex;\n align-items: center;\n justify-content: center;\n "])), function (_a) {
|
|
62
|
-
var colors = _a.theme.colors, disabled = _a.disabled, invert = _a.invert;
|
|
63
|
-
return disabled ? greyColor40 :
|
|
64
|
-
invert ? (0, utilsOolib_1.getPrimaryColor40)(colors) : (0, utilsOolib_1.getPrimaryColor100)(colors);
|
|
65
|
-
});
|
|
66
|
-
}, function (_a) {
|
|
67
|
-
var isSelected = _a.isSelected, disabled = _a.disabled, theme = _a.theme, invert = _a.invert, readOnly = _a.readOnly;
|
|
68
|
-
return !isSelected && !disabled && !readOnly && (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), invert ? greyColor80 : (0, utilsOolib_1.getPrimaryColor10)(theme.colors));
|
|
69
|
-
}, function (_a) {
|
|
70
|
-
var colors = _a.theme.colors, disabled = _a.disabled, invert = _a.invert;
|
|
71
|
-
return disabled ? greyColor40 :
|
|
72
|
-
invert ? (0, utilsOolib_1.getPrimaryColor40)(colors) : (0, utilsOolib_1.getPrimaryColor100)(colors);
|
|
73
|
-
});
|
|
74
|
-
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) {
|
|
75
|
-
var S = _a.S;
|
|
76
|
-
return S ? '0.7rem' : '0.8rem';
|
|
77
|
-
}, function (_a) {
|
|
78
|
-
var S = _a.S;
|
|
79
|
-
return S ? '0.7rem' : '0.8rem';
|
|
80
|
-
}, function (_a) {
|
|
81
|
-
var invert = _a.invert;
|
|
82
|
-
return invert ? greyColor100 : white;
|
|
83
|
-
});
|
|
84
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RadioInput, RadioButton } from "./RadioInput";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RadioButton = exports.RadioInput = void 0;
|
|
4
|
-
var RadioInput_1 = require("./RadioInput");
|
|
5
|
-
Object.defineProperty(exports, "RadioInput", { enumerable: true, get: function () { return RadioInput_1.RadioInput; } });
|
|
6
|
-
Object.defineProperty(exports, "RadioButton", { enumerable: true, get: function () { return RadioInput_1.RadioButton; } });
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export function RadioList({ id, injectOtherOption, value: valueProp, onChange, saveValueAsString, options, commonIsCorrectDesc, rightWrongResult, optionsLimit, listType, disabled, invert, readOnly, S }: {
|
|
2
|
-
id: any;
|
|
3
|
-
injectOtherOption?: boolean;
|
|
4
|
-
value: any;
|
|
5
|
-
onChange: any;
|
|
6
|
-
saveValueAsString: any;
|
|
7
|
-
options?: any[];
|
|
8
|
-
commonIsCorrectDesc: any;
|
|
9
|
-
rightWrongResult: any;
|
|
10
|
-
optionsLimit?: number;
|
|
11
|
-
listType?: string;
|
|
12
|
-
disabled: any;
|
|
13
|
-
invert: any;
|
|
14
|
-
readOnly: any;
|
|
15
|
-
S: any;
|
|
16
|
-
}, ...args: any[]): React.JSX.Element;
|
|
17
|
-
import React from "react";
|