oolib 2.127.0 → 2.127.2

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,6 +1,7 @@
1
1
  export default RadioListMultiQuestion;
2
- declare function RadioListMultiQuestion({ label, options, subQuestionLabels, onChange, value: _value, readOnly }: {
2
+ declare function RadioListMultiQuestion({ label, sublabel, options, subQuestionLabels, onChange, value: _value, readOnly }: {
3
3
  label: any;
4
+ sublabel: any;
4
5
  options: any;
5
6
  subQuestionLabels: any;
6
7
  onChange: any;
@@ -42,7 +42,7 @@ var BlockLabel_1 = require("../BlockLabel");
42
42
  var themes_1 = require("../../themes");
43
43
  var greyColor10 = themes_1.colors.greyColor10;
44
44
  var RadioListMultiQuestion = function (_a) {
45
- var label = _a.label, options = _a.options, subQuestionLabels = _a.subQuestionLabels, onChange = _a.onChange, _value = _a.value, readOnly = _a.readOnly;
45
+ var label = _a.label, sublabel = _a.sublabel, options = _a.options, subQuestionLabels = _a.subQuestionLabels, onChange = _a.onChange, _value = _a.value, readOnly = _a.readOnly;
46
46
  var _b = (0, react_1.useState)(_value), value = _b[0], setValue = _b[1];
47
47
  var handleChange = function (subQuestionValue, option) {
48
48
  // const key = `${label.trim().replaceAll(' ','').toLowerCase()}.${subQuestionValue}`
@@ -54,24 +54,24 @@ var RadioListMultiQuestion = function (_a) {
54
54
  onChange(value);
55
55
  };
56
56
  return (react_1.default.createElement("div", null,
57
- react_1.default.createElement(BlockLabel_1.BlockLabel, { label: label }),
57
+ react_1.default.createElement(BlockLabel_1.BlockLabel, { label: label, sublabel: sublabel }),
58
58
  react_1.default.createElement(styled_1.StyledTable, null,
59
59
  react_1.default.createElement("thead", null,
60
60
  react_1.default.createElement("tr", null,
61
61
  react_1.default.createElement("th", { style: { borderBottom: "1px solid ".concat(greyColor10) } }),
62
- " ",
63
- options.map(function (option) { return (react_1.default.createElement(styled_1.StyledTableTh, { key: option.value },
62
+ " ", options === null || options === void 0 ? void 0 :
63
+ options.map(function (option) { return (react_1.default.createElement(styled_1.StyledTableTh, { key: option === null || option === void 0 ? void 0 : option.value },
64
64
  react_1.default.createElement(styled_1.StyledElem, null,
65
- react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, option.display)))); }))),
66
- react_1.default.createElement("tbody", null, subQuestionLabels.map(function (subQuestion, i) { return (react_1.default.createElement(styled_1.StyledTableRow, { key: subQuestion.value, index: i },
65
+ react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, option === null || option === void 0 ? void 0 : option.display)))); }))),
66
+ react_1.default.createElement("tbody", null, subQuestionLabels === null || subQuestionLabels === void 0 ? void 0 : subQuestionLabels.map(function (subQuestion, i) { return (react_1.default.createElement(styled_1.StyledTableRow, { key: subQuestion === null || subQuestion === void 0 ? void 0 : subQuestion.value, index: i },
67
67
  react_1.default.createElement("td", null,
68
68
  react_1.default.createElement("div", { style: { padding: "1rem" } },
69
- react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, subQuestion.display))),
69
+ react_1.default.createElement(Typo_1.SANS_3, { semibold: true }, subQuestion === null || subQuestion === void 0 ? void 0 : subQuestion.display))), options === null || options === void 0 ? void 0 :
70
70
  options.map(function (option, i) {
71
71
  var _a;
72
- return (react_1.default.createElement("td", { key: option.value, style: { borderLeft: "1px solid ".concat(greyColor10) } },
72
+ return (react_1.default.createElement("td", { key: option === null || option === void 0 ? void 0 : option.value, style: { borderLeft: "1px solid ".concat(greyColor10) } },
73
73
  react_1.default.createElement(styled_1.StyledElem, null,
74
- react_1.default.createElement(RadioAndCheckbox_1.RadioButton, { isSelected: ((_a = value[subQuestion === null || subQuestion === void 0 ? void 0 : subQuestion.value]) === null || _a === void 0 ? void 0 : _a.value) === option.value, onClick: function () { return !readOnly && handleChange(subQuestion.value, option); } }))));
74
+ react_1.default.createElement(RadioAndCheckbox_1.RadioButton, { isSelected: ((_a = value[subQuestion === null || subQuestion === void 0 ? void 0 : subQuestion.value]) === null || _a === void 0 ? void 0 : _a.value) === (option === null || option === void 0 ? void 0 : option.value), onClick: function () { return !readOnly && handleChange(subQuestion === null || subQuestion === void 0 ? void 0 : subQuestion.value, option); } }))));
75
75
  }))); })))));
76
76
  };
77
77
  exports.default = RadioListMultiQuestion;
@@ -33,6 +33,6 @@ var _RadioListMultiQuestion = function (args) {
33
33
  { display: 'Sometimes', value: 'sometimes' },
34
34
  { display: 'Often', value: 'often' },
35
35
  { display: 'Always', value: 'always' },
36
- ], value: value, onChange: function (d) { return setValue(d); }, readOnly: args.readOnly })));
36
+ ], sublabel: "Select all that apply", value: value, onChange: function (d) { return setValue(d); }, readOnly: args.readOnly })));
37
37
  };
38
38
  exports._RadioListMultiQuestion = _RadioListMultiQuestion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.127.0",
3
+ "version": "2.127.2",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",