oolib 2.131.0 → 2.131.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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default GroupQuestionsInputSingle;
|
|
2
|
-
declare function GroupQuestionsInputSingle({ options, subQuestionLabels, onChange, value, readOnly, id, questionColWidth, radioColsWidth, variant: _variant }: {
|
|
2
|
+
declare function GroupQuestionsInputSingle({ options, subQuestionLabels, onChange, value, readOnly, id, questionColWidth, radioColsWidth, variant: _variant, popOutOfOverflowHiddenParent, }: {
|
|
3
3
|
options: any;
|
|
4
4
|
subQuestionLabels: any;
|
|
5
5
|
onChange: any;
|
|
@@ -9,5 +9,6 @@ declare function GroupQuestionsInputSingle({ options, subQuestionLabels, onChang
|
|
|
9
9
|
questionColWidth?: number;
|
|
10
10
|
radioColsWidth?: number;
|
|
11
11
|
variant?: string;
|
|
12
|
+
popOutOfOverflowHiddenParent?: boolean;
|
|
12
13
|
}, ...args: any[]): React.JSX.Element;
|
|
13
14
|
import React from "react";
|
|
@@ -46,7 +46,7 @@ var mixins_1 = require("../../themes/mixins");
|
|
|
46
46
|
var DropdownSingle_1 = require("../Dropdowns/DropdownSingle");
|
|
47
47
|
var greyColor10 = themes_1.colors.greyColor10;
|
|
48
48
|
function GroupQuestionsInputSingle(_a) {
|
|
49
|
-
var options = _a.options, subQuestionLabels = _a.subQuestionLabels, onChange = _a.onChange, value = _a.value, readOnly = _a.readOnly, id = _a.id, _b = _a.questionColWidth, questionColWidth = _b === void 0 ? 200 : _b, _c = _a.radioColsWidth, radioColsWidth = _c === void 0 ? 120 : _c, _d = _a.variant, _variant = _d === void 0 ? 'radio' : _d;
|
|
49
|
+
var options = _a.options, subQuestionLabels = _a.subQuestionLabels, onChange = _a.onChange, value = _a.value, readOnly = _a.readOnly, id = _a.id, _b = _a.questionColWidth, questionColWidth = _b === void 0 ? 200 : _b, _c = _a.radioColsWidth, radioColsWidth = _c === void 0 ? 120 : _c, _d = _a.variant, _variant = _d === void 0 ? 'radio' : _d, _e = _a.popOutOfOverflowHiddenParent, popOutOfOverflowHiddenParent = _e === void 0 ? false : _e;
|
|
50
50
|
var screenWidth = (0, _EXPORTS_1.useScreenWidth)();
|
|
51
51
|
var variant = (screenWidth < (0, mixins_1.getBreakPoint)("sm") || _variant === 'dropdown')
|
|
52
52
|
? 'dropdown'
|
|
@@ -93,7 +93,7 @@ function GroupQuestionsInputSingle(_a) {
|
|
|
93
93
|
} }))));
|
|
94
94
|
}))); })))) : (react_1.default.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: '2rem' } }, subQuestionLabels.map(function (subQuestion) { return (react_1.default.createElement("div", null,
|
|
95
95
|
react_1.default.createElement(Typo_1.SANS_2, { semibold: true, style: { paddingBottom: "1rem" } }, subQuestion.display),
|
|
96
|
-
react_1.default.createElement(DropdownSingle_1.DropdownSingle, { options: options, value: value && value[subQuestion.value], onChange: function (k, v) {
|
|
96
|
+
react_1.default.createElement(DropdownSingle_1.DropdownSingle, { options: options, popOutOfOverflowHiddenParent: popOutOfOverflowHiddenParent, value: value && value[subQuestion.value], onChange: function (k, v) {
|
|
97
97
|
handleChange(subQuestion.value, v);
|
|
98
98
|
} }))); }))))));
|
|
99
99
|
}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
declare namespace _default {
|
|
2
2
|
let title: string;
|
|
3
3
|
namespace argTypes {
|
|
4
|
-
namespace
|
|
4
|
+
namespace variant {
|
|
5
5
|
let name: string;
|
|
6
6
|
let type: string;
|
|
7
|
+
let options: string[];
|
|
8
|
+
}
|
|
9
|
+
namespace readOnly {
|
|
10
|
+
let name_1: string;
|
|
11
|
+
export { name_1 as name };
|
|
12
|
+
let type_1: string;
|
|
13
|
+
export { type_1 as type };
|
|
7
14
|
}
|
|
8
15
|
}
|
|
9
|
-
|
|
16
|
+
namespace args {
|
|
17
|
+
let popOutOfOverflowHiddenParent: boolean;
|
|
18
|
+
}
|
|
10
19
|
}
|
|
11
20
|
export default _default;
|
|
12
21
|
export function _GroupQuestionsInputSingle(args: any): import("react").JSX.Element;
|
|
@@ -10,29 +10,39 @@ var themes_1 = require("../themes");
|
|
|
10
10
|
exports.default = {
|
|
11
11
|
title: "Components/GroupQuestionsInputSingle",
|
|
12
12
|
argTypes: {
|
|
13
|
+
variant: {
|
|
14
|
+
name: "Variant",
|
|
15
|
+
type: "select",
|
|
16
|
+
options: ["radio", 'dropdown']
|
|
17
|
+
},
|
|
13
18
|
readOnly: {
|
|
14
19
|
name: "Read Only",
|
|
15
20
|
type: "boolean"
|
|
16
21
|
},
|
|
17
22
|
},
|
|
18
|
-
args: {
|
|
23
|
+
args: {
|
|
24
|
+
popOutOfOverflowHiddenParent: false
|
|
25
|
+
}
|
|
19
26
|
};
|
|
20
27
|
var _GroupQuestionsInputSingle = function (args) {
|
|
21
28
|
var _a = (0, react_1.useState)({}), value = _a[0], setValue = _a[1];
|
|
22
29
|
console.log({ valueParent: value });
|
|
23
30
|
return (React.createElement("div", { style: { background: args.invert ? themes_1.colors.greyColor100 : '' } },
|
|
24
|
-
React.createElement(
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
React.createElement("div", { style: args.popOutOfOverflowHiddenParent
|
|
32
|
+
? { border: '2px solid lightgrey', height: '100%', width: '100%', overflow: 'scroll' }
|
|
33
|
+
: {} },
|
|
34
|
+
React.createElement(GroupQuestionsInputSingle_1.default, { label: "When shopping online, how often do you do each of the following?", variant: args.variant, popOutOfOverflowHiddenParent: args.popOutOfOverflowHiddenParent, subQuestionLabels: [
|
|
35
|
+
{ display: 'Visit multiple websites Visit multiple websites', value: 'visit_multiple_websites' },
|
|
36
|
+
{ display: 'Read customer reviews Read customer reviews ', value: 'read_customer_reviews' },
|
|
37
|
+
{ display: 'Watch a video demonstration Watch a video demonstration', value: 'watch_video_demo' },
|
|
38
|
+
{ display: 'Check the delivery date Check the delivery date', value: 'check_delivery_date' },
|
|
39
|
+
{ display: 'Check for payment options Check for payment options', value: 'check_payment_options' },
|
|
40
|
+
], options: [
|
|
41
|
+
{ display: 'Never Never Never Never ', value: 'never' },
|
|
42
|
+
{ display: 'Rarely Rarely Rarely Rarely ', value: 'rarely' },
|
|
43
|
+
{ display: 'Sometimes Sometimes Sometimes Sometimes ', value: 'sometimes' },
|
|
44
|
+
{ display: 'Often Often Often Often ', value: 'often' },
|
|
45
|
+
{ display: 'Always Always Always Always ', value: 'always' },
|
|
46
|
+
], sublabel: "Select all that apply", value: value, onChange: function (id, value) { return setValue(value); }, readOnly: args.readOnly }))));
|
|
37
47
|
};
|
|
38
48
|
exports._GroupQuestionsInputSingle = _GroupQuestionsInputSingle;
|