@instructure/quiz-core 20.11.3-rc.18 → 20.11.3-rc.19
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/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +43 -43
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/styles.js +41 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/theme.js +6 -3
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +38 -53
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/styles.js +141 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/theme.js +10 -7
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +31 -26
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/styles.js +15 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/theme.js +4 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +42 -47
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/styles.js +51 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/theme.js +8 -4
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +37 -55
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/styles.js +149 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/theme.js +12 -8
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +30 -28
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/styles.js +23 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/theme.js +6 -3
- package/package.json +9 -9
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import { Table } from '@instructure/ui-table';
|
|
10
11
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
componentId: 'cInnW',
|
|
15
|
-
template: function template(theme) {
|
|
16
|
-
return "\n\n.cInnW_cvRx{align-items:center;display:flex;height:48px;justify-content:center;width:46px}\n\n.cInnW_EKAb{background-color:".concat(theme.colorGreen || 'inherit', ";border-radius:4px 0 0 4px}\n\n.cInnW_EKAb svg{fill:#fff}\n\n.cInnW_tnta{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid;border-width:2px 0;padding:").concat(theme.cellPadding || 'inherit', "}\n\n.cInnW_fvqY{border-radius:0 4px 4px 0;border-width:2px 2px 2px 0}");
|
|
17
|
-
},
|
|
18
|
-
'iconWrapper': 'cInnW_cvRx',
|
|
19
|
-
'iconCorrect': 'cInnW_EKAb',
|
|
20
|
-
'correctRowBorder': 'cInnW_tnta',
|
|
21
|
-
'correctRowBorderRadius': 'cInnW_fvqY'
|
|
22
|
-
};
|
|
12
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
13
|
+
import generateComponentTheme from "./theme.js";
|
|
14
|
+
import generateStyle from "./styles.js";
|
|
23
15
|
import PropTypes from 'prop-types';
|
|
24
16
|
import { IconXSolid, IconCheckSolid } from '@instructure/ui-icons';
|
|
25
|
-
import classNames from 'classnames';
|
|
26
17
|
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
27
18
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
28
19
|
|
|
29
|
-
var _ref =
|
|
20
|
+
var _ref = jsx(IconCheckSolid, null);
|
|
30
21
|
|
|
31
|
-
var _ref2 =
|
|
22
|
+
var _ref2 = jsx(IconXSolid, null);
|
|
32
23
|
|
|
33
|
-
export var ChoiceTypeTableRow = (_dec =
|
|
24
|
+
export var ChoiceTypeTableRow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
34
25
|
_inherits(ChoiceTypeTableRow, _Component);
|
|
35
26
|
|
|
36
27
|
var _super = _createSuper(ChoiceTypeTableRow);
|
|
@@ -46,26 +37,21 @@ export var ChoiceTypeTableRow = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
46
37
|
|
|
47
38
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
48
39
|
|
|
49
|
-
_this.renderIcon = function (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, correct ? _ref : _ref2);
|
|
40
|
+
_this.renderIcon = function () {
|
|
41
|
+
return jsx("div", {
|
|
42
|
+
css: _this.props.styles.iconWrapper
|
|
43
|
+
}, _this.props.choice.correct ? _ref : _ref2);
|
|
54
44
|
};
|
|
55
45
|
|
|
56
|
-
_this.renderMiddleCell = function (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
className: className
|
|
46
|
+
_this.renderMiddleCell = function (content) {
|
|
47
|
+
return jsx("div", {
|
|
48
|
+
css: _this.props.styles.correctRowBorder
|
|
60
49
|
}, content);
|
|
61
50
|
};
|
|
62
51
|
|
|
63
|
-
_this.renderLastCell = function (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var className = classNames((_classNames3 = {}, _defineProperty(_classNames3, styles.correctRowBorder, correct), _defineProperty(_classNames3, styles.correctRowBorderRadius, correct), _classNames3));
|
|
67
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className: className
|
|
52
|
+
_this.renderLastCell = function (content) {
|
|
53
|
+
return jsx("div", {
|
|
54
|
+
css: _this.props.styles.lastRowBorder
|
|
69
55
|
}, content);
|
|
70
56
|
};
|
|
71
57
|
|
|
@@ -82,32 +68,44 @@ export var ChoiceTypeTableRow = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
82
68
|
_this.render = function () {
|
|
83
69
|
var correct = _this.props.choice.correct;
|
|
84
70
|
var choiceBody = _this.props.choice.body;
|
|
85
|
-
var cellPadding = correct ? '0' : _this.
|
|
86
|
-
return
|
|
71
|
+
var cellPadding = correct ? '0' : _this.props.styles.cellPadding;
|
|
72
|
+
return jsx(Table.Row, {
|
|
87
73
|
key: _this.props.choiceIndex
|
|
88
|
-
},
|
|
74
|
+
}, jsx(Table.Cell, {
|
|
89
75
|
themeOverride: {
|
|
90
76
|
padding: '0px'
|
|
91
77
|
}
|
|
92
|
-
},
|
|
78
|
+
}, jsx(ScreenReaderContent, null, _this.answerLabel(correct)), _this.renderIcon()), jsx(Table.RowHeader, {
|
|
93
79
|
themeOverride: {
|
|
94
80
|
padding: cellPadding
|
|
95
81
|
}
|
|
96
|
-
}, _this.renderMiddleCell(
|
|
82
|
+
}, _this.renderMiddleCell(_this.extractChoiceText(choiceBody, correct))), jsx(Table.Cell, {
|
|
97
83
|
themeOverride: {
|
|
98
84
|
padding: cellPadding
|
|
99
85
|
}
|
|
100
|
-
}, _this.renderMiddleCell(
|
|
86
|
+
}, _this.renderMiddleCell(_this.props.choice.count)), jsx(Table.Cell, {
|
|
101
87
|
themeOverride: {
|
|
102
88
|
padding: cellPadding
|
|
103
89
|
},
|
|
104
90
|
textAlign: "center"
|
|
105
|
-
}, _this.renderLastCell(
|
|
91
|
+
}, _this.renderLastCell("".concat(_this.props.choice.percentage, "%"))));
|
|
106
92
|
};
|
|
107
93
|
|
|
108
94
|
return _this;
|
|
109
95
|
}
|
|
110
96
|
|
|
97
|
+
_createClass(ChoiceTypeTableRow, [{
|
|
98
|
+
key: "componentDidMount",
|
|
99
|
+
value: function componentDidMount() {
|
|
100
|
+
this.props.makeStyles();
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
key: "componentDidUpdate",
|
|
104
|
+
value: function componentDidUpdate() {
|
|
105
|
+
this.props.makeStyles();
|
|
106
|
+
}
|
|
107
|
+
}]);
|
|
108
|
+
|
|
111
109
|
return ChoiceTypeTableRow;
|
|
112
110
|
}(Component), _class2.displayName = 'Row', _class2.propTypes = {
|
|
113
111
|
choice: PropTypes.shape({
|
|
@@ -115,6 +113,8 @@ export var ChoiceTypeTableRow = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
115
113
|
correct: PropTypes.bool,
|
|
116
114
|
count: PropTypes.number,
|
|
117
115
|
percentage: PropTypes.number
|
|
118
|
-
}),
|
|
119
|
-
choiceIndex: PropTypes.number
|
|
120
|
-
|
|
116
|
+
}).isRequired,
|
|
117
|
+
choiceIndex: PropTypes.number.isRequired,
|
|
118
|
+
styles: PropTypes.object,
|
|
119
|
+
makeStyles: PropTypes.func
|
|
120
|
+
}, _temp)) || _class);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
4
|
+
var correctRowBorderStyles = {
|
|
5
|
+
borderColor: componentTheme.colorGreen,
|
|
6
|
+
borderWidth: '2px 0',
|
|
7
|
+
borderStyle: 'solid',
|
|
8
|
+
padding: componentTheme.cellPadding
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
iconWrapper: _objectSpread({
|
|
12
|
+
display: 'flex',
|
|
13
|
+
height: '48px',
|
|
14
|
+
width: '46px',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
alignItems: 'center'
|
|
17
|
+
}, props.choice.correct && {
|
|
18
|
+
backgroundColor: componentTheme.colorGreen,
|
|
19
|
+
borderRadius: '4px 0 0 4px',
|
|
20
|
+
'svg': {
|
|
21
|
+
fill: 'white'
|
|
22
|
+
}
|
|
23
|
+
}),
|
|
24
|
+
correctRowBorder: _objectSpread({
|
|
25
|
+
borderWidth: '0'
|
|
26
|
+
}, props.choice.correct && correctRowBorderStyles),
|
|
27
|
+
correctRowBorderRadius: {
|
|
28
|
+
borderWidth: '2px 2px 2px 0',
|
|
29
|
+
borderRadius: '0 4px 4px 0'
|
|
30
|
+
},
|
|
31
|
+
lastRowBorder: _objectSpread({
|
|
32
|
+
borderWidth: '0'
|
|
33
|
+
}, props.choice.correct && _objectSpread(_objectSpread({}, correctRowBorderStyles), {}, {
|
|
34
|
+
borderWidth: '2px 2px 2px 0',
|
|
35
|
+
borderRadius: '0 4px 4px 0'
|
|
36
|
+
})),
|
|
37
|
+
cellPadding: componentTheme.cellPadding
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default generateStyle;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
|
+
var colors = _ref.colors;
|
|
2
3
|
return {
|
|
3
|
-
colorGreen:
|
|
4
|
+
colorGreen: colors.shamrock,
|
|
4
5
|
cellPadding: '0.75rem 0.75rem'
|
|
5
6
|
};
|
|
6
|
-
}
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default generateComponentTheme;
|
|
@@ -31,7 +31,7 @@ var generateStyle = function generateStyle(componentTheme, props) {
|
|
|
31
31
|
correctAnswerRow: {
|
|
32
32
|
borderColor: componentTheme.colorGreen,
|
|
33
33
|
borderStyle: 'solid',
|
|
34
|
-
'> span > span:nth-
|
|
34
|
+
'> span > span:nth-of-type(2)': {
|
|
35
35
|
minWidth: '46px',
|
|
36
36
|
padding: '12px 12px 12px 12px'
|
|
37
37
|
},
|
|
@@ -64,8 +64,8 @@ export var AfsPartsContainer = (_dec = withStyle(generateStyle, generateComponen
|
|
|
64
64
|
|
|
65
65
|
return AfsPartsContainer;
|
|
66
66
|
}(Component), _class2.propTypes = {
|
|
67
|
-
afsTable: PropTypes.node
|
|
68
|
-
aggregationTable: PropTypes.node
|
|
67
|
+
afsTable: PropTypes.node,
|
|
68
|
+
aggregationTable: PropTypes.node,
|
|
69
69
|
styles: PropTypes.object,
|
|
70
70
|
makeStyles: PropTypes.func
|
|
71
71
|
}, _class2.defaultProps = {
|
|
@@ -4,51 +4,32 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
4
4
|
|
|
5
5
|
var _dec, _class, _class2, _temp;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/** @jsx jsx */
|
|
8
|
+
import { Component } from 'react';
|
|
8
9
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
9
10
|
import { Table } from '@instructure/ui-table';
|
|
10
11
|
import { onlyAggregatePropType } from "../../../propTypes.js";
|
|
11
12
|
import PropTypes from 'prop-types';
|
|
12
13
|
import { IconCheckSolid, IconXSolid, IconNoSolid, IconGradebookSolid } from '@instructure/ui-icons';
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
componentId: 'fMmrG',
|
|
17
|
-
template: function template(theme) {
|
|
18
|
-
return "\n\n.fMmrG_cvRx{align-items:center;display:flex;height:100%;justify-content:center;min-height:47px;width:46px}\n\n.fMmrG_fPIL{min-width:500px}\n\n.fMmrG_fPIL table{border-collapse:separate;border-spacing:0 12px}\n\n.fMmrG_fPIL thead th{border-color:".concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}\n\n.fMmrG_fPIL table tbody tr td{border-style:solid;border-width:2px 0 2px 0;width:33.33%}\n\n.fMmrG_fPIL table tbody tr th:first-child{border-radius:4px 0 0 4px;border-style:solid;border-width:2px 0 2px 2px;font-weight:400}\n\n.fMmrG_fPIL table tbody tr td:last-child{border-radius:0 4px 4px 0;border-style:solid;border-width:2px 2px 2px 0}\n\n.fMmrG_dzqP table tbody tr:first-child td,.fMmrG_dzqP table tbody tr:first-child th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fMmrG_fZpZ table tbody tr:first-child td,.fMmrG_fZpZ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fMmrG_fZpZ table tbody tr:nth-child(2) td,.fMmrG_fZpZ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fMmrG_dgTJ table tbody tr:first-child td,.fMmrG_dgTJ table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fMmrG_dgTJ table tbody tr:nth-child(2) td,.fMmrG_dgTJ table tbody tr:nth-child(2) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fMmrG_dgTJ table tbody tr:nth-child(3) td,.fMmrG_dgTJ table tbody tr:nth-child(3) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fMmrG_bYLj table tbody tr:first-child td,.fMmrG_bYLj table tbody tr:first-child th{border-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fMmrG_bYLj table tbody tr:nth-child(2) td,.fMmrG_bYLj table tbody tr:nth-child(2) th{border-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fMmrG_bYLj table tbody tr:nth-child(3) td,.fMmrG_bYLj table tbody tr:nth-child(3) th{border-color:").concat(theme.colorRed || 'inherit', "}\n\n.fMmrG_bYLj table tbody tr:nth-child(4) td,.fMmrG_bYLj table tbody tr:nth-child(4) th{border-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fMmrG_bvau{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.fMmrG_cxOH{background-color:").concat(theme.colorRed || 'inherit', "}\n\n.fMmrG_dsqS{background-color:").concat(theme.colorBlue || 'inherit', "}\n\n.fMmrG_eKcq{background-color:").concat(theme.colorGrey || 'inherit', "}\n\n.fMmrG_euQM{padding:12px 0 12px 10px}\n\n.fMmrG_fuuc{padding-left:45px}\n\n.fMmrG_vDgC svg{fill:#fff}\n\n.fMmrG_fHMm{border-color:").concat(theme.colorHeaderBottomBorder || 'inherit', ";border-style:solid;border-width:0 0 1px 0}");
|
|
19
|
-
},
|
|
20
|
-
'iconWrapper': 'fMmrG_cvRx',
|
|
21
|
-
'collapsingTable': 'fMmrG_fPIL',
|
|
22
|
-
'onlyNoanswer': 'fMmrG_dzqP',
|
|
23
|
-
'correctIncorrect': 'fMmrG_fZpZ',
|
|
24
|
-
'correctIncorrectNoanswer': 'fMmrG_dgTJ',
|
|
25
|
-
'correctIncorrectNoanswerGraded': 'fMmrG_bYLj',
|
|
26
|
-
'correctBackground': 'fMmrG_bvau',
|
|
27
|
-
'incorrectBackground': 'fMmrG_cxOH',
|
|
28
|
-
'gradedBackground': 'fMmrG_dsqS',
|
|
29
|
-
'noAnswerBackground': 'fMmrG_eKcq',
|
|
30
|
-
'labelWrapper': 'fMmrG_euQM',
|
|
31
|
-
'firstHeaderCell': 'fMmrG_fuuc',
|
|
32
|
-
'iconWhite': 'fMmrG_vDgC',
|
|
33
|
-
'headerCell': 'fMmrG_fHMm'
|
|
34
|
-
};
|
|
14
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
15
|
+
import generateComponentTheme from "./theme.js";
|
|
16
|
+
import generateStyle from "./styles.js";
|
|
35
17
|
import { Flex } from '@instructure/ui-flex';
|
|
36
|
-
import classNames from 'classnames';
|
|
37
18
|
import { Text } from '@instructure/ui-text';
|
|
38
19
|
var noAnswerKey = 'noAnswer';
|
|
39
20
|
var incorrectKey = 'incorrect';
|
|
40
21
|
var correctKey = 'correct';
|
|
41
22
|
var gradedKey = 'graded';
|
|
42
23
|
|
|
43
|
-
var _ref =
|
|
24
|
+
var _ref = jsx(IconCheckSolid, null);
|
|
44
25
|
|
|
45
|
-
var _ref2 =
|
|
26
|
+
var _ref2 = jsx(IconGradebookSolid, null);
|
|
46
27
|
|
|
47
|
-
var _ref3 =
|
|
28
|
+
var _ref3 = jsx(IconXSolid, null);
|
|
48
29
|
|
|
49
|
-
var _ref4 =
|
|
30
|
+
var _ref4 = jsx(IconNoSolid, null);
|
|
50
31
|
|
|
51
|
-
export var AggregationTable = (_dec =
|
|
32
|
+
export var AggregationTable = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
52
33
|
_inherits(AggregationTable, _Component);
|
|
53
34
|
|
|
54
35
|
var _super = _createSuper(AggregationTable);
|
|
@@ -70,52 +51,54 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
70
51
|
var answerHeaderId = "answer-frequency-summary-aggregate-answer-".concat(itemId);
|
|
71
52
|
var respondentsHeaderId = "answer-frequency-summary-aggregate-respondents-".concat(itemId);
|
|
72
53
|
var percentageHeaderId = "answer-frequency-summary-aggregate-percentage-".concat(itemId);
|
|
73
|
-
return
|
|
54
|
+
return jsx(Table.Head, null, jsx(Table.Row, null, jsx(Table.ColHeader, {
|
|
74
55
|
id: answerHeaderId
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
}, t('Result'))),
|
|
56
|
+
}, jsx("span", {
|
|
57
|
+
css: _this.props.styles.firstHeaderCell
|
|
58
|
+
}, t('Result'))), jsx(Table.ColHeader, {
|
|
78
59
|
id: respondentsHeaderId,
|
|
79
60
|
textAlign: "center"
|
|
80
|
-
}, t('Respondents')),
|
|
61
|
+
}, t('Respondents')), jsx(Table.ColHeader, {
|
|
81
62
|
id: percentageHeaderId,
|
|
82
63
|
textAlign: "center"
|
|
83
64
|
}, t('Percentage'))));
|
|
84
65
|
};
|
|
85
66
|
|
|
86
67
|
_this.renderRow = function (key, icon, label, count, percentage) {
|
|
87
|
-
var backgroundColor = styles["".concat(key, "Background")];
|
|
68
|
+
var backgroundColor = _this.props.styles["".concat(key, "Background")];
|
|
69
|
+
|
|
88
70
|
var concatenatedPercentage = "".concat(percentage, "%");
|
|
89
|
-
return
|
|
71
|
+
return jsx(Table.Row, {
|
|
90
72
|
key: key
|
|
91
|
-
},
|
|
73
|
+
}, jsx(Table.RowHeader, {
|
|
92
74
|
themeOverride: {
|
|
93
75
|
padding: '0px'
|
|
94
76
|
}
|
|
95
|
-
},
|
|
77
|
+
}, jsx(Flex, {
|
|
96
78
|
direction: "row",
|
|
97
79
|
alignItems: "center"
|
|
98
|
-
},
|
|
80
|
+
}, jsx(Flex.Item, {
|
|
99
81
|
width: "46px",
|
|
100
82
|
textAlign: "center",
|
|
101
83
|
align: "stretch"
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
}, icon)),
|
|
84
|
+
}, jsx("div", {
|
|
85
|
+
css: [_this.props.styles.iconWrapper, backgroundColor]
|
|
86
|
+
}, icon)), jsx(Flex.Item, {
|
|
105
87
|
shouldShrink: true
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
|
|
88
|
+
}, jsx("div", {
|
|
89
|
+
"data-testid": "label-wrapper",
|
|
90
|
+
css: _this.props.styles.labelWrapper
|
|
91
|
+
}, jsx(Text, null, label))))), jsx(Table.Cell, {
|
|
109
92
|
themeOverride: {
|
|
110
93
|
padding: '0px'
|
|
111
94
|
},
|
|
112
95
|
textAlign: "center"
|
|
113
|
-
},
|
|
96
|
+
}, jsx(Text, null, count)), jsx(Table.Cell, {
|
|
114
97
|
themeOverride: {
|
|
115
98
|
padding: '0px'
|
|
116
99
|
},
|
|
117
100
|
textAlign: "center"
|
|
118
|
-
},
|
|
101
|
+
}, jsx(Text, null, concatenatedPercentage)));
|
|
119
102
|
};
|
|
120
103
|
|
|
121
104
|
_this.gradedExist = function () {
|
|
@@ -192,11 +175,12 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
192
175
|
|
|
193
176
|
_this.render = function () {
|
|
194
177
|
var popover = !_this.noAnswerExist();
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
178
|
+
var tableStyles = [_this.props.styles.collapsingTable, _this.props.styles[_this.getColorProfile()]];
|
|
179
|
+
return jsx("div", {
|
|
180
|
+
css: tableStyles
|
|
181
|
+
}, jsx(Table, {
|
|
198
182
|
caption: t('Answer Frequency Summary Aggregates')
|
|
199
|
-
}, _this.renderHeaderRow(popover),
|
|
183
|
+
}, _this.renderHeaderRow(popover), jsx(Table.Body, null, _this.correctExist() && _this.renderCorrect(), _this.gradedExist() && _this.renderGraded(), _this.incorrectExist() && _this.renderIncorrect(), _this.noAnswerExist() && _this.renderNoAnswer())));
|
|
200
184
|
};
|
|
201
185
|
|
|
202
186
|
return _this;
|
|
@@ -205,5 +189,6 @@ export var AggregationTable = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
205
189
|
return AggregationTable;
|
|
206
190
|
}(Component), _class2.propTypes = {
|
|
207
191
|
itemId: PropTypes.number.isRequired,
|
|
208
|
-
answerSummary: onlyAggregatePropType
|
|
209
|
-
|
|
192
|
+
answerSummary: onlyAggregatePropType.isRequired,
|
|
193
|
+
styles: PropTypes.object
|
|
194
|
+
}, _temp)) || _class);
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
iconWrapper: {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
height: '100%',
|
|
6
|
+
minHeight: '47px',
|
|
7
|
+
width: '46px',
|
|
8
|
+
justifyContent: 'center',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
'svg': {
|
|
11
|
+
fill: 'white'
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
collapsingTable: {
|
|
15
|
+
minWidth: '500px',
|
|
16
|
+
'table': {
|
|
17
|
+
borderCollapse: 'separate',
|
|
18
|
+
borderSpacing: '0 12px'
|
|
19
|
+
},
|
|
20
|
+
'thead th': {
|
|
21
|
+
borderWidth: '0 0 1px 0',
|
|
22
|
+
borderStyle: 'solid',
|
|
23
|
+
borderColor: componentTheme.colorHeaderBottomBorder
|
|
24
|
+
},
|
|
25
|
+
'table tbody tr td': {
|
|
26
|
+
width: '33.33%',
|
|
27
|
+
borderStyle: 'solid',
|
|
28
|
+
borderWidth: '2px 0 2px 0'
|
|
29
|
+
},
|
|
30
|
+
'table tbody tr th:first-of-type': {
|
|
31
|
+
borderStyle: 'solid',
|
|
32
|
+
borderRadius: '4px 0 0 4px',
|
|
33
|
+
borderWidth: '2px 0 2px 2px',
|
|
34
|
+
fontWeight: '400'
|
|
35
|
+
},
|
|
36
|
+
'table tbody tr td:last-child': {
|
|
37
|
+
borderStyle: 'solid',
|
|
38
|
+
borderWidth: '2px 2px 2px 0',
|
|
39
|
+
borderRadius: '0 4px 4px 0'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
onlyNoanswer: {
|
|
43
|
+
'tbody tr:nth-of-type(1) td': {
|
|
44
|
+
borderColor: componentTheme.colorGrey
|
|
45
|
+
},
|
|
46
|
+
'table tbody tr:nth-of-type(1) th': {
|
|
47
|
+
borderColor: componentTheme.colorGrey
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
correctIncorrect: {
|
|
51
|
+
'table tbody tr:nth-of-type(1) td': {
|
|
52
|
+
borderColor: componentTheme.colorGreen
|
|
53
|
+
},
|
|
54
|
+
'table tbody tr:nth-of-type(1) th': {
|
|
55
|
+
borderColor: componentTheme.colorGreen
|
|
56
|
+
},
|
|
57
|
+
'table tbody tr:nth-of-type(2) td': {
|
|
58
|
+
borderColor: componentTheme.colorRed
|
|
59
|
+
},
|
|
60
|
+
'table tbody tr:nth-of-type(2) th': {
|
|
61
|
+
borderColor: componentTheme.colorRed
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
correctIncorrectNoanswer: {
|
|
65
|
+
'table tbody tr:nth-of-type(1) td': {
|
|
66
|
+
borderColor: componentTheme.colorGreen
|
|
67
|
+
},
|
|
68
|
+
'table tbody tr:nth-of-type(1) th': {
|
|
69
|
+
borderColor: componentTheme.colorGreen
|
|
70
|
+
},
|
|
71
|
+
'table tbody tr:nth-of-type(2) td': {
|
|
72
|
+
borderColor: componentTheme.colorRed
|
|
73
|
+
},
|
|
74
|
+
'table tbody tr:nth-of-type(2) th': {
|
|
75
|
+
borderColor: componentTheme.colorRed
|
|
76
|
+
},
|
|
77
|
+
'table tbody tr:nth-of-type(3) td': {
|
|
78
|
+
borderColor: componentTheme.colorGrey
|
|
79
|
+
},
|
|
80
|
+
'table tbody tr:nth-of-type(3) th': {
|
|
81
|
+
borderColor: componentTheme.colorGrey
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
correctIncorrectNoanswerGraded: {
|
|
85
|
+
'table tbody tr:nth-of-type(1) td': {
|
|
86
|
+
borderColor: componentTheme.colorGreen
|
|
87
|
+
},
|
|
88
|
+
'table tbody tr:nth-of-type(1) th': {
|
|
89
|
+
borderColor: componentTheme.colorGreen
|
|
90
|
+
},
|
|
91
|
+
'table tbody tr:nth-of-type(2) td': {
|
|
92
|
+
borderColor: componentTheme.colorBlue
|
|
93
|
+
},
|
|
94
|
+
'table tbody tr:nth-of-type(2) th': {
|
|
95
|
+
borderColor: componentTheme.colorBlue
|
|
96
|
+
},
|
|
97
|
+
'table tbody tr:nth-of-type(3) td': {
|
|
98
|
+
borderColor: componentTheme.colorRed
|
|
99
|
+
},
|
|
100
|
+
'table tbody tr:nth-of-type(3) th': {
|
|
101
|
+
borderColor: componentTheme.colorRed
|
|
102
|
+
},
|
|
103
|
+
'table tbody tr:nth-of-type(4) td': {
|
|
104
|
+
borderColor: componentTheme.colorGrey
|
|
105
|
+
},
|
|
106
|
+
'table tbody tr:nth-of-type(4) th': {
|
|
107
|
+
borderColor: componentTheme.colorGrey
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
correctBackground: {
|
|
111
|
+
backgroundColor: componentTheme.colorGreen
|
|
112
|
+
},
|
|
113
|
+
incorrectBackground: {
|
|
114
|
+
backgroundColor: componentTheme.colorRed
|
|
115
|
+
},
|
|
116
|
+
gradedBackground: {
|
|
117
|
+
backgroundColor: componentTheme.colorBlue
|
|
118
|
+
},
|
|
119
|
+
noAnswerBackground: {
|
|
120
|
+
backgroundColor: componentTheme.colorGrey
|
|
121
|
+
},
|
|
122
|
+
labelWrapper: {
|
|
123
|
+
padding: '12px 0 12px 10px'
|
|
124
|
+
},
|
|
125
|
+
firstHeaderCell: {
|
|
126
|
+
paddingLeft: '45px'
|
|
127
|
+
},
|
|
128
|
+
iconWhite: {
|
|
129
|
+
'svg': {
|
|
130
|
+
fill: 'white'
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
headerCell: {
|
|
134
|
+
borderWidth: '0 0 1px 0',
|
|
135
|
+
borderStyle: 'solid',
|
|
136
|
+
borderColor: componentTheme.colorHeaderBottomBorder
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export default generateStyle;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
|
+
var colors = _ref.colors;
|
|
2
3
|
return {
|
|
3
|
-
colorGreen:
|
|
4
|
-
colorBlue:
|
|
5
|
-
colorRed:
|
|
6
|
-
colorGrey:
|
|
7
|
-
colorHeaderBottomBorder:
|
|
4
|
+
colorGreen: colors.shamrock,
|
|
5
|
+
colorBlue: colors.brand,
|
|
6
|
+
colorRed: colors.crimson,
|
|
7
|
+
colorGrey: colors.ash,
|
|
8
|
+
colorHeaderBottomBorder: colors.tiara,
|
|
8
9
|
cellPadding: '13.5px 13.5px;'
|
|
9
10
|
};
|
|
10
|
-
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default generateComponentTheme;
|