oolib 2.208.0 → 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/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/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,127 +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
|
-
var styled_1 = require("./styled");
|
|
48
|
-
var Typo_1 = require("../Typo");
|
|
49
|
-
var react_1 = __importStar(require("react"));
|
|
50
|
-
var contextApi_1 = require("../Hints/contextApi");
|
|
51
|
-
var colors_1 = require("../../themes/colors");
|
|
52
|
-
var DisplayIcon_1 = require("../../utils/comps/DisplayIcon");
|
|
53
|
-
var Buttons_1 = require("../Buttons");
|
|
54
|
-
var Modal_1 = require("../Modals/Modal");
|
|
55
|
-
var mixins_1 = require("../../themes/mixins");
|
|
56
|
-
var useScreenWidth_1 = require("../../utils/customHooks/useScreenWidth");
|
|
57
|
-
var styled_2 = require("../Modals/Modal/styled");
|
|
58
|
-
var OKELink_1 = require("../OKELink");
|
|
59
|
-
var greyColor80 = colors_1.colors.greyColor80, greyColor15 = colors_1.colors.greyColor15, greyColor100 = colors_1.colors.greyColor100;
|
|
60
|
-
var TriangleIconComp = function (props) { return (react_1.default.createElement("svg", __assign({ width: 20, height: 13, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
|
|
61
|
-
react_1.default.createElement("path", { d: "m8.894 1.206-7.59 8.28C.422 10.448 1.104 12 2.41 12h15.18c1.305 0 1.988-1.552 1.106-2.514l-7.59-8.28a1.5 1.5 0 0 0-2.212 0Z", fill: "#fff", stroke: greyColor15 }))); };
|
|
62
|
-
var getPositionStyles = function (position) {
|
|
63
|
-
var styles = {
|
|
64
|
-
left: {
|
|
65
|
-
lightBox: { top: "-2rem", left: "-31.5rem" },
|
|
66
|
-
arrow: { top: ".7rem", left: "-2rem", transform: "rotate(45deg)" },
|
|
67
|
-
},
|
|
68
|
-
bottom: {
|
|
69
|
-
lightBox: { top: "4.5rem", left: "-2rem" },
|
|
70
|
-
arrow: { top: "3.9rem", left: "6rem", transform: "rotate(-45deg)" },
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
return styles[position];
|
|
74
|
-
};
|
|
75
|
-
var BulletIcon = function () { return (
|
|
76
|
-
// line height of SANS_3 is 21px. Dot is 8px tall. so below css (21/2 - 8/2) makes the circle perfectly aligned with the first line
|
|
77
|
-
react_1.default.createElement("div", { style: { fontSize: 0, marginTop: '6.5px', lineHeight: 0 } },
|
|
78
|
-
react_1.default.createElement(DisplayIcon_1.DisplayIcon, { color: greyColor100, weight: "fill", icon: "Circle", size: 8 }))); };
|
|
79
|
-
var Hints = function (_a) {
|
|
80
|
-
var id = _a.id, hints = _a.hints, _b = _a.title, title = _b === void 0 ? "Hints" : _b, _c = _a.btnlabel, btnlabel = _c === void 0 ? "Hints" : _c, subtitle = _a.subtitle;
|
|
81
|
-
//get the context state
|
|
82
|
-
var _d = (0, contextApi_1.useHintsContext)(), active = _d.active, setActive = _d.setActive;
|
|
83
|
-
var screenWidth = (0, useScreenWidth_1.useScreenWidth)();
|
|
84
|
-
var lightBoxRef = (0, react_1.useRef)();
|
|
85
|
-
var _e = (0, react_1.useState)(getPositionStyles("left")), styles = _e[0], setStyles = _e[1];
|
|
86
|
-
//isStorybook is temporary hack to get correct with on storybook, since a story is getting renderend within an iframe, screen.width gives the incorrect width
|
|
87
|
-
var isDesktop = screenWidth > (0, mixins_1.getBreakPoint)("md");
|
|
88
|
-
(0, react_1.useEffect)(function () {
|
|
89
|
-
if (!lightBoxRef.current)
|
|
90
|
-
return;
|
|
91
|
-
var lightBoxRect = lightBoxRef.current.getBoundingClientRect();
|
|
92
|
-
// by default open on leftside, if the below condition is true than open at the bottom of hints
|
|
93
|
-
//note for future: arrow comp is fixed and lightbox will move to place itself within the visible area
|
|
94
|
-
if (lightBoxRect.left < 0) {
|
|
95
|
-
setStyles(getPositionStyles("bottom"));
|
|
96
|
-
// setStyles({
|
|
97
|
-
// lightBox: { top: "4rem", right: "0" },
|
|
98
|
-
// arrow: { top: `none`, right: "3.5rem", transform: "none" },
|
|
99
|
-
// });
|
|
100
|
-
}
|
|
101
|
-
}, [active]);
|
|
102
|
-
return (react_1.default.createElement("div", null,
|
|
103
|
-
" ",
|
|
104
|
-
react_1.default.createElement(styled_1.StyledHints, { onClick: function () { return setActive(id); } },
|
|
105
|
-
react_1.default.createElement(Typo_1.SANS_3, { semibold: true },
|
|
106
|
-
react_1.default.createElement(OKELink_1.OKELink, { icon: "LightbulbFilament", linkType: "action", onClick: function () { return setActive(id); }, iconSize: 16, invertUnderline: true }, btnlabel))),
|
|
107
|
-
active === id ? (isDesktop ? (react_1.default.createElement("div", null,
|
|
108
|
-
react_1.default.createElement(styled_1.StyledTriangle, { style: styles.arrow, id: id }),
|
|
109
|
-
react_1.default.createElement(styled_1.StyledLightbox, { style: styles.lightBox, ref: lightBoxRef, id: id },
|
|
110
|
-
react_1.default.createElement(styled_2.StyledModalHeaderStyle2Container, null,
|
|
111
|
-
react_1.default.createElement("div", { style: { position: "absolute", top: "-2.5rem", fontSize: 0 } },
|
|
112
|
-
react_1.default.createElement(DisplayIcon_1.DisplayIcon, { icon: "ModalBulbIcon" })),
|
|
113
|
-
react_1.default.createElement(styled_2.StyledModalHeaderStyle2Title, null,
|
|
114
|
-
react_1.default.createElement(Typo_1.SANS_3, { semibold: true, capitalize: true }, title),
|
|
115
|
-
subtitle ? (react_1.default.createElement(Typo_1.SANS_3_4, { capitalize: true, semibold: true, style: { flexGrow: "1" }, color: greyColor80 }, subtitle)) : null,
|
|
116
|
-
react_1.default.createElement(Buttons_1.ButtonGhost, { onClick: function () { return setActive(""); }, icon: "X" }))),
|
|
117
|
-
react_1.default.createElement(styled_1.StyledLightBoxContent, null,
|
|
118
|
-
react_1.default.createElement(styled_1.StyledLightBoxList, null, hints.map(function (d) { return (react_1.default.createElement("li", null,
|
|
119
|
-
react_1.default.createElement(BulletIcon, null),
|
|
120
|
-
react_1.default.createElement(Typo_1.SANS_3, null, d))); })))))) : (react_1.default.createElement(Modal_1.Modal, { isStorybook: true, headerStyle: "style2", id: "modal", title: title, onClose: function () { return setActive(""); } },
|
|
121
|
-
react_1.default.createElement("div", { style: { padding: ".5rem 2rem" } },
|
|
122
|
-
react_1.default.createElement(styled_1.StyledLightBoxList, null, hints.map(function (d) { return (react_1.default.createElement("li", null,
|
|
123
|
-
react_1.default.createElement("div", { style: { marginTop: ".5rem", lineHeight: 0 } },
|
|
124
|
-
react_1.default.createElement(DisplayIcon_1.DisplayIcon, { color: greyColor100, weight: "fill", icon: "Circle", size: 8 })),
|
|
125
|
-
react_1.default.createElement(Typo_1.SANS_3, null, d))); })))))) : null));
|
|
126
|
-
};
|
|
127
|
-
exports.default = Hints;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export const StyledHints: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export const StyledLightbox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
3
|
-
export const StyledLightBoxHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
-
export const StyledLightBoxContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
-
export const StyledLightBoxList: import("styled-components").StyledComponent<"ul", any, {}, never>;
|
|
6
|
-
export const StyledTriangle: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -1,54 +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.StyledTriangle = exports.StyledLightBoxList = exports.StyledLightBoxContent = exports.StyledLightBoxHeader = exports.StyledLightbox = exports.StyledHints = void 0;
|
|
11
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
-
var themes_1 = require("../../themes");
|
|
13
|
-
var globalVariables_1 = require("../../globalStyles/globalVariables");
|
|
14
|
-
var white = themes_1.colors.white, greyColor15 = themes_1.colors.greyColor15, greyColor100 = themes_1.colors.greyColor100;
|
|
15
|
-
exports.StyledHints = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject([""], [""])));
|
|
16
|
-
exports.StyledLightbox = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n z-index: 1000;\n background: ", ";\n position: absolute;\n width: 30rem;\n height: 35rem;\n ", "\n /* top: ", "; */\n /* right: ", "; */\n\n top: ", ";\n left: ", ";\n bottom: ", ";\n right: ", ";\n\n display: flex;\n flex-direction: column;\n"], ["\n z-index: 1000;\n background: ", ";\n position: absolute;\n width: 30rem;\n height: 35rem;\n ", "\n /* top: ", "; */\n /* right: ", "; */\n\n top: ", ";\n left: ", ";\n bottom: ", ";\n right: ", ";\n\n display: flex;\n flex-direction: column;\n"])), white, globalVariables_1.globalLightboxStyle, function (_a) {
|
|
17
|
-
var style = _a.style;
|
|
18
|
-
return ((style === null || style === void 0 ? void 0 : style.top) ? style.top : "-1rem");
|
|
19
|
-
}, function (_a) {
|
|
20
|
-
var style = _a.style;
|
|
21
|
-
return ((style === null || style === void 0 ? void 0 : style.right) ? style.right : "-31.5rem");
|
|
22
|
-
}, function (_a) {
|
|
23
|
-
var top = _a.style.top;
|
|
24
|
-
return top;
|
|
25
|
-
}, function (_a) {
|
|
26
|
-
var left = _a.style.left;
|
|
27
|
-
return left;
|
|
28
|
-
}, function (_a) {
|
|
29
|
-
var bottom = _a.style.bottom;
|
|
30
|
-
return bottom;
|
|
31
|
-
}, function (_a) {
|
|
32
|
-
var right = _a.style.right;
|
|
33
|
-
return right;
|
|
34
|
-
});
|
|
35
|
-
exports.StyledLightBoxHeader = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 4rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: 2px;\n gap: 1rem;\n\n padding: 1rem 1.5rem;\n"], ["\n height: 4rem;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: 2px;\n gap: 1rem;\n\n padding: 1rem 1.5rem;\n"])));
|
|
36
|
-
exports.StyledLightBoxContent = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: 0.5rem 2rem 2rem 1.5rem;\n overflow-y: auto;\n"], ["\n padding: 0.5rem 2rem 2rem 1.5rem;\n overflow-y: auto;\n"])));
|
|
37
|
-
exports.StyledLightBoxList = styled_components_1.default.ul(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n padding: 0;\n li {\n list-style-type: none;\n padding: 0.5rem 0;\n display: flex;\n gap: 1rem;\n /* align-items: center; */\n /* ::before {\n content: \"\";\n margin-top: 0.5rem;\n flex: 0 0 .5rem;\n width: .5rem;\n padding: 0%.5r;\n height: .5rem;\n background-color: ", ";\n border-radius: 50%;\n flex-shrink: 0;\n } */\n }\n"], ["\n padding: 0;\n li {\n list-style-type: none;\n padding: 0.5rem 0;\n display: flex;\n gap: 1rem;\n /* align-items: center; */\n /* ::before {\n content: \"\";\n margin-top: 0.5rem;\n flex: 0 0 .5rem;\n width: .5rem;\n padding: 0%.5r;\n height: .5rem;\n background-color: ", ";\n border-radius: 50%;\n flex-shrink: 0;\n } */\n }\n"])), greyColor100);
|
|
38
|
-
exports.StyledTriangle = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: absolute;\n\n width: 10px;\n height: 10px;\n border-style: solid;\n\n border-width: 1px;\n border-color: ", " ", " transparent transparent;\n /* transform:rotate(-45deg); */\n z-index: 10001;\n background-color: white;\n\n top: ", ";\n left: ", ";\n bottom: ", ";\n right: ", ";\n transform: ", ";\n\n /* position:absolute; */\n /* top:.7rem; */\n /* left:-2rem; */\n /* transform :rotate(90deg); */\n"], ["\n position: absolute;\n\n width: 10px;\n height: 10px;\n border-style: solid;\n\n border-width: 1px;\n border-color: ", " ", " transparent transparent;\n /* transform:rotate(-45deg); */\n z-index: 10001;\n background-color: white;\n\n top: ", ";\n left: ", ";\n bottom: ", ";\n right: ", ";\n transform: ", ";\n\n /* position:absolute; */\n /* top:.7rem; */\n /* left:-2rem; */\n /* transform :rotate(90deg); */\n"])), greyColor15, greyColor15, function (_a) {
|
|
39
|
-
var top = _a.style.top;
|
|
40
|
-
return top;
|
|
41
|
-
}, function (_a) {
|
|
42
|
-
var left = _a.style.left;
|
|
43
|
-
return left;
|
|
44
|
-
}, function (_a) {
|
|
45
|
-
var bottom = _a.style.bottom;
|
|
46
|
-
return bottom;
|
|
47
|
-
}, function (_a) {
|
|
48
|
-
var right = _a.style.right;
|
|
49
|
-
return right;
|
|
50
|
-
}, function (_a) {
|
|
51
|
-
var transform = _a.style.transform;
|
|
52
|
-
return transform;
|
|
53
|
-
});
|
|
54
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function CheckboxButton({ id, className, isSelected: _isSelected, value, onChange, disabled, invert, S }: {
|
|
2
|
-
id: any;
|
|
3
|
-
className: any;
|
|
4
|
-
isSelected: any;
|
|
5
|
-
value: any;
|
|
6
|
-
onChange: any;
|
|
7
|
-
disabled: any;
|
|
8
|
-
invert: any;
|
|
9
|
-
S: any;
|
|
10
|
-
}): React.JSX.Element;
|
|
11
|
-
import React from 'react';
|
|
@@ -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;
|