@instructure/quiz-core 20.3.0 → 20.3.1-rc.0
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/common/components/shared/CardEmotion/CardContent/index.js +3 -3
- package/es/common/components/shared/CardEmotion/CardWrapper/index.js +3 -3
- package/es/common/components/shared/CardEmotion/index.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +55 -56
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/styles.js +53 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/theme.js +4 -2
- package/es/reporting/components/resources/ReportCard/index.js +18 -23
- package/es/reporting/components/resources/ReportCard/styles.js +24 -0
- package/es/reporting/components/resources/ReportCard/theme.js +4 -2
- package/es/reporting/components/resources/ReportList/index.js +15 -21
- package/es/reporting/components/resources/ReportList/styles.js +19 -0
- package/es/reporting/components/resources/ReportList/theme.js +4 -2
- package/lib/common/components/shared/CardEmotion/CardContent/index.js +3 -3
- package/lib/common/components/shared/CardEmotion/CardWrapper/index.js +3 -3
- package/lib/common/components/shared/CardEmotion/index.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +54 -59
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/styles.js +64 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/theme.js +6 -3
- package/lib/reporting/components/resources/ReportCard/index.js +17 -24
- package/lib/reporting/components/resources/ReportCard/styles.js +34 -0
- package/lib/reporting/components/resources/ReportCard/theme.js +6 -3
- package/lib/reporting/components/resources/ReportList/index.js +14 -22
- package/lib/reporting/components/resources/ReportList/styles.js +27 -0
- package/lib/reporting/components/resources/ReportList/theme.js +6 -3
- package/package.json +10 -10
|
@@ -31,7 +31,7 @@ export var CardContent = (_dec = withStyle(generateStyle, generateComponentTheme
|
|
|
31
31
|
return jsx(View, {
|
|
32
32
|
as: "div"
|
|
33
33
|
}, jsx("div", Object.assign({
|
|
34
|
-
css: _objectSpread(_objectSpread({}, this.props.styles.content), this.props.
|
|
34
|
+
css: _objectSpread(_objectSpread({}, this.props.styles.content), this.props.customStyles)
|
|
35
35
|
}, omit(this.props, Object.keys(CardContent.propTypes))), this.props.children));
|
|
36
36
|
}
|
|
37
37
|
}]);
|
|
@@ -40,9 +40,9 @@ export var CardContent = (_dec = withStyle(generateStyle, generateComponentTheme
|
|
|
40
40
|
return CardContent;
|
|
41
41
|
}(Component), _class2.propTypes = {
|
|
42
42
|
children: PropTypes.node.isRequired,
|
|
43
|
-
|
|
43
|
+
customStyles: PropTypes.object,
|
|
44
44
|
styles: PropTypes.object
|
|
45
45
|
}, _class2.defaultProps = {
|
|
46
|
-
|
|
46
|
+
customStyles: {}
|
|
47
47
|
}, _temp)) || _class);
|
|
48
48
|
export default CardContent;
|
|
@@ -31,7 +31,7 @@ export var CardWrapper = (_dec = withStyle(generateStyle, generateComponentTheme
|
|
|
31
31
|
as: "div",
|
|
32
32
|
height: "100%"
|
|
33
33
|
}, jsx("div", {
|
|
34
|
-
css: _objectSpread(_objectSpread({}, this.props.styles.wrapper), this.props.
|
|
34
|
+
css: _objectSpread(_objectSpread({}, this.props.styles.wrapper), this.props.customStyles)
|
|
35
35
|
}, this.props.children));
|
|
36
36
|
}
|
|
37
37
|
}]);
|
|
@@ -40,9 +40,9 @@ export var CardWrapper = (_dec = withStyle(generateStyle, generateComponentTheme
|
|
|
40
40
|
return CardWrapper;
|
|
41
41
|
}(Component), _class2.propTypes = {
|
|
42
42
|
children: PropTypes.node.isRequired,
|
|
43
|
-
|
|
43
|
+
customStyles: PropTypes.object,
|
|
44
44
|
styles: PropTypes.object
|
|
45
45
|
}, _class2.defaultProps = {
|
|
46
|
-
|
|
46
|
+
customStyles: {}
|
|
47
47
|
}, _temp)) || _class);
|
|
48
48
|
export default CardWrapper;
|
|
@@ -16,13 +16,13 @@ export function Card(_ref) {
|
|
|
16
16
|
}
|
|
17
17
|
Card.propTypes = {
|
|
18
18
|
children: PropTypes.node.isRequired,
|
|
19
|
-
|
|
19
|
+
customStyles: PropTypes.object,
|
|
20
20
|
wrapperClassName: PropTypes.object,
|
|
21
21
|
wrapped: PropTypes.bool
|
|
22
22
|
};
|
|
23
23
|
Card.defaultProps = {
|
|
24
24
|
wrapped: false,
|
|
25
|
-
|
|
25
|
+
customStyles: null,
|
|
26
26
|
wrapperClassName: null
|
|
27
27
|
};
|
|
28
28
|
export default Card;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
2
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
@@ -6,37 +5,25 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
6
5
|
|
|
7
6
|
var _dec, _class, _class2, _temp;
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
12
12
|
import { Text } from '@instructure/ui-text';
|
|
13
13
|
import { Link } from '@instructure/ui-link';
|
|
14
14
|
import { Flex } from '@instructure/ui-flex';
|
|
15
15
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
16
|
-
import {
|
|
17
|
-
import Card from "../../../../../common/components/shared/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
template: function template(theme) {
|
|
21
|
-
return "\n\n.ebhXI_bqdH{column-gap:26px;display:flex;justify-content:flex-start;padding-bottom:".concat(theme.metricsPadding || 'inherit', ";row-gap:8px}\n\n.ebhXI_PFlN{display:inline-flex;flex-direction:column;margin:").concat(theme.cardMargin || 'inherit', ";padding:").concat(theme.cardPadding || 'inherit', ";width:").concat(theme.cardWidth || 'inherit', "}\n\n.ebhXI_dJIh{height:").concat(theme.cardHeight || 'inherit', "}\n\n.ebhXI_eWEX{align-items:flex-end;align-self:flex-end;display:flex;height:100%;justify-content:flex-end}\n\n.ebhXI_blRb{max-width:160px;padding-right:10px}\n\n.ebhXI_bxzy{border-bottom:1px solid ").concat(theme.quizSummaryBorderBottomColor || 'inherit', ";margin-bottom:15px;padding-bottom:15px}\n\n.ebhXI_dKIc{padding-bottom:15px}\n\n@media only screen and (max-width:25rem){.ebhXI_dJIh{height:auto}.ebhXI_PFlN{max-width:").concat(theme.cardWidth || 'inherit', ";width:auto}.ebhXI_bqdH{flex-wrap:wrap}}");
|
|
22
|
-
},
|
|
23
|
-
'metricsContainer': 'ebhXI_bqdH',
|
|
24
|
-
'reportCard': 'ebhXI_PFlN',
|
|
25
|
-
'emptyReportCard': 'ebhXI_dJIh',
|
|
26
|
-
'emptyCardBodyContainer': 'ebhXI_eWEX',
|
|
27
|
-
'dateContainer': 'ebhXI_blRb',
|
|
28
|
-
'quizAnalysisSummary': 'ebhXI_bxzy',
|
|
29
|
-
'titleContainer': 'ebhXI_dKIc'
|
|
30
|
-
};
|
|
31
|
-
import theme from "./theme.js";
|
|
32
|
-
import classnames from 'classnames';
|
|
16
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
17
|
+
import Card from "../../../../../common/components/shared/CardEmotion/index.js";
|
|
18
|
+
import generateStyle from "./styles.js";
|
|
19
|
+
import generateComponentTheme from "./theme.js";
|
|
33
20
|
import AnalysisMetric from "../AnalysisMetric/index.js";
|
|
34
21
|
import Spinner from "../../../../../common/components/shared/spinner/Spinner.js";
|
|
35
22
|
import { AnalysisUpdateDate } from "../AnalysisUpdateDate/index.js";
|
|
36
23
|
import { itemAnalysisPropType, quizAnalysisPropType } from "../propTypes.js";
|
|
37
24
|
import { csvFormat } from "../exportFormats.js";
|
|
38
25
|
import { ExportButton } from "../ExportButton/index.js";
|
|
39
|
-
export var NewQuizAndItemAnalysisReportCardPresenter = (_dec =
|
|
26
|
+
export var NewQuizAndItemAnalysisReportCardPresenter = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
40
27
|
_inherits(NewQuizAndItemAnalysisReportCardPresenter, _Component);
|
|
41
28
|
|
|
42
29
|
var _super = _createSuper(NewQuizAndItemAnalysisReportCardPresenter);
|
|
@@ -69,19 +56,19 @@ export var NewQuizAndItemAnalysisReportCardPresenter = (_dec = themeable(theme,
|
|
|
69
56
|
var _quizAnalysis$scores, _quizAnalysis$scores2, _quizAnalysis$scores3;
|
|
70
57
|
|
|
71
58
|
var quizAnalysis = _this.props.quizAnalysis;
|
|
72
|
-
return
|
|
73
|
-
|
|
74
|
-
},
|
|
59
|
+
return jsx("div", {
|
|
60
|
+
css: _this.props.styles.metricsContainer
|
|
61
|
+
}, jsx(AnalysisMetric, {
|
|
75
62
|
metricKey: "highscore",
|
|
76
63
|
label: t('High Score'),
|
|
77
64
|
value: (_quizAnalysis$scores = quizAnalysis.scores) === null || _quizAnalysis$scores === void 0 ? void 0 : _quizAnalysis$scores.max_percentage,
|
|
78
65
|
suffix: "%"
|
|
79
|
-
}),
|
|
66
|
+
}), jsx(AnalysisMetric, {
|
|
80
67
|
metricKey: "lowscore",
|
|
81
68
|
label: t('Low Score'),
|
|
82
69
|
value: (_quizAnalysis$scores2 = quizAnalysis.scores) === null || _quizAnalysis$scores2 === void 0 ? void 0 : _quizAnalysis$scores2.min_percentage,
|
|
83
70
|
suffix: "%"
|
|
84
|
-
}),
|
|
71
|
+
}), jsx(AnalysisMetric, {
|
|
85
72
|
metricKey: "meanscore",
|
|
86
73
|
label: t('Mean Score'),
|
|
87
74
|
value: (_quizAnalysis$scores3 = quizAnalysis.scores) === null || _quizAnalysis$scores3 === void 0 ? void 0 : _quizAnalysis$scores3.mean_percentage,
|
|
@@ -94,31 +81,31 @@ export var NewQuizAndItemAnalysisReportCardPresenter = (_dec = themeable(theme,
|
|
|
94
81
|
quizAnalysis = _this$props.quizAnalysis,
|
|
95
82
|
itemAnalyses = _this$props.itemAnalyses,
|
|
96
83
|
href = _this$props.href;
|
|
97
|
-
return
|
|
98
|
-
|
|
99
|
-
}, _this.renderMetrics(),
|
|
84
|
+
return jsx("div", {
|
|
85
|
+
css: _this.props.styles.quizAnalysisSummary
|
|
86
|
+
}, _this.renderMetrics(), jsx(Flex, {
|
|
100
87
|
direction: "row",
|
|
101
88
|
justifyItems: "space-between"
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
},
|
|
89
|
+
}, jsx("div", {
|
|
90
|
+
css: _this.props.styles.dateContainer
|
|
91
|
+
}, jsx(AnalysisUpdateDate, {
|
|
105
92
|
date: quizAnalysis.created_timestamp,
|
|
106
93
|
multiline: true
|
|
107
|
-
})), quizAnalysis && itemAnalyses &&
|
|
94
|
+
})), quizAnalysis && itemAnalyses && jsx(Link, {
|
|
108
95
|
href: href,
|
|
109
96
|
"data-automation": "sdk-new-ia-report-card-view-report-button"
|
|
110
|
-
},
|
|
97
|
+
}, jsx(ScreenReaderContent, null, t('View Quiz and Item Analysis Report')), jsx(Text, {
|
|
111
98
|
size: "small",
|
|
112
99
|
"aria-hidden": "true"
|
|
113
100
|
}, t('View Report')))));
|
|
114
101
|
};
|
|
115
102
|
|
|
116
103
|
_this.renderSpinner = function (mainText) {
|
|
117
|
-
return
|
|
118
|
-
|
|
119
|
-
},
|
|
104
|
+
return jsx("div", {
|
|
105
|
+
css: _this.props.styles.emptyCardBodyContainer
|
|
106
|
+
}, jsx(Flex, {
|
|
120
107
|
direction: "row"
|
|
121
|
-
},
|
|
108
|
+
}, jsx(Flex.Item, null, jsx(Spinner, {
|
|
122
109
|
size: "x-small",
|
|
123
110
|
color: "brand",
|
|
124
111
|
minHeight: "0",
|
|
@@ -129,11 +116,11 @@ export var NewQuizAndItemAnalysisReportCardPresenter = (_dec = themeable(theme,
|
|
|
129
116
|
};
|
|
130
117
|
|
|
131
118
|
_this.renderGenerateReportButton = function () {
|
|
132
|
-
return
|
|
119
|
+
return jsx(Link, {
|
|
133
120
|
onClick: _this.handleGeneration,
|
|
134
121
|
role: "button",
|
|
135
122
|
"data-automation": "sdk-new-ia-report-card-generate-report-button"
|
|
136
|
-
},
|
|
123
|
+
}, jsx(ScreenReaderContent, null, t('Generate Quiz and Item Analysis Report')), jsx(Text, {
|
|
137
124
|
size: "small",
|
|
138
125
|
"aria-hidden": "true"
|
|
139
126
|
}, t('Generate Report')));
|
|
@@ -143,19 +130,19 @@ export var NewQuizAndItemAnalysisReportCardPresenter = (_dec = themeable(theme,
|
|
|
143
130
|
var _this$props2 = _this.props,
|
|
144
131
|
generationInProgress = _this$props2.generationInProgress,
|
|
145
132
|
analysisError = _this$props2.analysisError;
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
},
|
|
133
|
+
return jsx("div", {
|
|
134
|
+
css: _this.props.styles.emptyCardBodyContainer
|
|
135
|
+
}, jsx(Flex, {
|
|
149
136
|
direction: "row",
|
|
150
137
|
justifyItems: "space-between"
|
|
151
|
-
},
|
|
138
|
+
}, jsx(Flex.Item, {
|
|
152
139
|
shouldShrink: true,
|
|
153
140
|
size: analysisError && !generationInProgress ? '40%' : null
|
|
154
|
-
}, analysisError && !generationInProgress &&
|
|
141
|
+
}, analysisError && !generationInProgress && jsx(Text, {
|
|
155
142
|
size: "x-small",
|
|
156
143
|
weight: "bold",
|
|
157
144
|
color: "danger"
|
|
158
|
-
}, analysisError)),
|
|
145
|
+
}, analysisError)), jsx(Flex.Item, {
|
|
159
146
|
shouldShrink: analysisError && !generationInProgress
|
|
160
147
|
}, generationInProgress ? _this.renderSpinner(t('Generation In Progress')) : _this.renderGenerateReportButton())));
|
|
161
148
|
};
|
|
@@ -164,7 +151,7 @@ export var NewQuizAndItemAnalysisReportCardPresenter = (_dec = themeable(theme,
|
|
|
164
151
|
var _this$props3 = _this.props,
|
|
165
152
|
quizAnalysis = _this$props3.quizAnalysis,
|
|
166
153
|
generationInProgress = _this$props3.generationInProgress;
|
|
167
|
-
return
|
|
154
|
+
return jsx(ExportButton, {
|
|
168
155
|
quizAnalysis: quizAnalysis,
|
|
169
156
|
generationInProgress: generationInProgress,
|
|
170
157
|
handleExport: _this.handleExport
|
|
@@ -176,31 +163,41 @@ export var NewQuizAndItemAnalysisReportCardPresenter = (_dec = themeable(theme,
|
|
|
176
163
|
name = _this$props4.name,
|
|
177
164
|
exportEnabled = _this$props4.exportEnabled,
|
|
178
165
|
fetchInProgress = _this$props4.fetchInProgress;
|
|
179
|
-
return
|
|
180
|
-
|
|
181
|
-
},
|
|
166
|
+
return jsx("div", {
|
|
167
|
+
css: _this.props.styles.titleContainer
|
|
168
|
+
}, jsx(Flex, {
|
|
182
169
|
direction: "row",
|
|
183
170
|
wrap: "wrap",
|
|
184
171
|
justifyItems: "space-between"
|
|
185
|
-
},
|
|
172
|
+
}, jsx(Flex.Item, null, jsx(Text, {
|
|
186
173
|
size: "medium",
|
|
187
174
|
weight: "bold"
|
|
188
|
-
}, name)), exportEnabled && !fetchInProgress &&
|
|
175
|
+
}, name)), exportEnabled && !fetchInProgress && jsx(Flex.Item, null, _this.renderExport())));
|
|
189
176
|
};
|
|
190
177
|
|
|
191
178
|
return _this;
|
|
192
179
|
}
|
|
193
180
|
|
|
194
181
|
_createClass(NewQuizAndItemAnalysisReportCardPresenter, [{
|
|
182
|
+
key: "componentDidMount",
|
|
183
|
+
value: function componentDidMount() {
|
|
184
|
+
this.props.makeStyles();
|
|
185
|
+
}
|
|
186
|
+
}, {
|
|
187
|
+
key: "componentDidUpdate",
|
|
188
|
+
value: function componentDidUpdate() {
|
|
189
|
+
this.props.makeStyles();
|
|
190
|
+
}
|
|
191
|
+
}, {
|
|
195
192
|
key: "render",
|
|
196
193
|
value: function render() {
|
|
197
194
|
var _this$props5 = this.props,
|
|
198
195
|
fetchInProgress = _this$props5.fetchInProgress,
|
|
199
196
|
quizAnalysis = _this$props5.quizAnalysis,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
197
|
+
styles = _this$props5.styles;
|
|
198
|
+
return jsx(Card, {
|
|
199
|
+
css: styles.reportCard,
|
|
200
|
+
customStyles: styles.reportCard
|
|
204
201
|
}, this.renderReportCardHeader(), !fetchInProgress && quizAnalysis && this.renderQuizAnalysisSummary(), fetchInProgress && this.renderSpinner(), !fetchInProgress && this.renderReportCardFooter());
|
|
205
202
|
}
|
|
206
203
|
}]);
|
|
@@ -217,7 +214,9 @@ export var NewQuizAndItemAnalysisReportCardPresenter = (_dec = themeable(theme,
|
|
|
217
214
|
analysisError: PropTypes.string,
|
|
218
215
|
generateReports: PropTypes.func.isRequired,
|
|
219
216
|
exportReports: PropTypes.func.isRequired,
|
|
220
|
-
exportEnabled: PropTypes.bool.isRequired
|
|
217
|
+
exportEnabled: PropTypes.bool.isRequired,
|
|
218
|
+
styles: PropTypes.object,
|
|
219
|
+
makeStyles: PropTypes.func
|
|
221
220
|
}, _class2.defaultProps = {
|
|
222
221
|
name: void 0,
|
|
223
222
|
href: void 0,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
|
+
|
|
4
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
5
|
+
var msMaxWidth = 'max-width: 25rem';
|
|
6
|
+
var mq = "@media only screen and (".concat(msMaxWidth, ")");
|
|
7
|
+
return {
|
|
8
|
+
metricsContainer: _defineProperty({
|
|
9
|
+
paddingBottom: componentTheme.metricsPadding,
|
|
10
|
+
display: 'flex',
|
|
11
|
+
justifyContent: 'flex-start',
|
|
12
|
+
columnGap: '26px',
|
|
13
|
+
rowGap: '8px'
|
|
14
|
+
}, mq, {
|
|
15
|
+
flexWrap: 'wrap'
|
|
16
|
+
}),
|
|
17
|
+
reportCard: _objectSpread(_defineProperty({
|
|
18
|
+
width: componentTheme.cardWidth,
|
|
19
|
+
padding: componentTheme.cardPadding,
|
|
20
|
+
margin: componentTheme.cardMargin,
|
|
21
|
+
display: 'inline-flex',
|
|
22
|
+
flexDirection: 'column'
|
|
23
|
+
}, mq, {
|
|
24
|
+
width: 'initial',
|
|
25
|
+
maxWidth: componentTheme.cardWidth
|
|
26
|
+
}), !props.quizAnalysis && !props.analysisError && _defineProperty({
|
|
27
|
+
height: componentTheme.cardHeight
|
|
28
|
+
}, mq, {
|
|
29
|
+
height: 'initial'
|
|
30
|
+
})),
|
|
31
|
+
emptyCardBodyContainer: {
|
|
32
|
+
display: 'flex',
|
|
33
|
+
justifyContent: 'flex-end',
|
|
34
|
+
alignItems: 'flex-end',
|
|
35
|
+
alignSelf: 'flex-end',
|
|
36
|
+
height: '100%'
|
|
37
|
+
},
|
|
38
|
+
dateContainer: {
|
|
39
|
+
maxWidth: '160px',
|
|
40
|
+
paddingRight: '10px'
|
|
41
|
+
},
|
|
42
|
+
quizAnalysisSummary: {
|
|
43
|
+
borderBottom: "1px solid ".concat(componentTheme.quizSummaryBorderBottomColor),
|
|
44
|
+
paddingBottom: '15px',
|
|
45
|
+
marginBottom: '15px'
|
|
46
|
+
},
|
|
47
|
+
titleContainer: {
|
|
48
|
+
paddingBottom: '15px'
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
colors = _ref.colors;
|
|
4
4
|
return {
|
|
@@ -9,4 +9,6 @@ export default function generator(_ref) {
|
|
|
9
9
|
cardMargin: spacing.xSmall,
|
|
10
10
|
quizSummaryBorderBottomColor: colors.tiara
|
|
11
11
|
};
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default generateComponentTheme;
|
|
@@ -5,24 +5,18 @@ 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 PropTypes from 'prop-types';
|
|
10
11
|
import { Text } from '@instructure/ui-text';
|
|
11
12
|
import { Link } from '@instructure/ui-link';
|
|
12
|
-
import {
|
|
13
|
-
import Card from "../../../../common/components/shared/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
template: function template(theme) {
|
|
17
|
-
return "\n\n.fnaXq_fbIL{display:inline-flex;flex-direction:column;height:".concat(theme.cardHeight || 'inherit', ";margin:").concat(theme.cardMargin || 'inherit', ";padding:").concat(theme.cardPadding || 'inherit', ";width:").concat(theme.cardWidth || 'inherit', "}\n\n.fnaXq_ebWM{padding-top:").concat(theme.detailPadding || 'inherit', "}\n\n@media only screen and (max-width:25rem){.fnaXq_fbIL{max-width:").concat(theme.cardWidth || 'inherit', ";width:auto}}");
|
|
18
|
-
},
|
|
19
|
-
'card': 'fnaXq_fbIL',
|
|
20
|
-
'details': 'fnaXq_ebWM'
|
|
21
|
-
};
|
|
22
|
-
import theme from "./theme.js";
|
|
13
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
14
|
+
import Card from "../../../../common/components/shared/CardEmotion/index.js";
|
|
15
|
+
import generateStyle from "./styles.js";
|
|
16
|
+
import generateComponentTheme from "./theme.js";
|
|
23
17
|
import { Flex } from '@instructure/ui-flex';
|
|
24
18
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
25
|
-
export var ReportCard = (_dec =
|
|
19
|
+
export var ReportCard = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
26
20
|
_inherits(ReportCard, _Component);
|
|
27
21
|
|
|
28
22
|
var _super = _createSuper(ReportCard);
|
|
@@ -40,24 +34,24 @@ export var ReportCard = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
40
34
|
name = _this$props.name,
|
|
41
35
|
details = _this$props.details,
|
|
42
36
|
href = _this$props.href;
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
},
|
|
37
|
+
return jsx(Card, {
|
|
38
|
+
customStyles: this.props.styles.card
|
|
39
|
+
}, jsx(Text, {
|
|
46
40
|
size: "medium",
|
|
47
41
|
weight: "bold"
|
|
48
|
-
}, name),
|
|
49
|
-
|
|
50
|
-
},
|
|
42
|
+
}, name), jsx("div", {
|
|
43
|
+
css: this.props.styles.details
|
|
44
|
+
}, jsx(Text, {
|
|
51
45
|
size: "small",
|
|
52
46
|
color: "secondary"
|
|
53
|
-
}, details)),
|
|
47
|
+
}, details)), jsx(Flex, {
|
|
54
48
|
direction: "row",
|
|
55
49
|
justifyItems: "end",
|
|
56
50
|
alignItems: "end",
|
|
57
51
|
height: "100%"
|
|
58
|
-
},
|
|
52
|
+
}, jsx(Link, {
|
|
59
53
|
href: href
|
|
60
|
-
},
|
|
54
|
+
}, jsx(Text, {
|
|
61
55
|
size: "small",
|
|
62
56
|
"data-automation": name
|
|
63
57
|
}, t('View Report')))));
|
|
@@ -69,7 +63,8 @@ export var ReportCard = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
69
63
|
}(Component), _class2.propTypes = {
|
|
70
64
|
name: PropTypes.node,
|
|
71
65
|
details: PropTypes.node,
|
|
72
|
-
href: PropTypes.string
|
|
66
|
+
href: PropTypes.string,
|
|
67
|
+
styles: PropTypes.object
|
|
73
68
|
}, _class2.defaultProps = {
|
|
74
69
|
name: void 0,
|
|
75
70
|
details: void 0,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
4
|
+
var msMaxWidth = 'max-width: 25rem';
|
|
5
|
+
var mq = "@media screen and (".concat(msMaxWidth, ")");
|
|
6
|
+
return {
|
|
7
|
+
card: _defineProperty({
|
|
8
|
+
height: componentTheme.cardHeight,
|
|
9
|
+
width: componentTheme.cardWidth,
|
|
10
|
+
padding: componentTheme.cardPadding,
|
|
11
|
+
margin: componentTheme.cardMargin,
|
|
12
|
+
display: 'inline-flex',
|
|
13
|
+
flexDirection: 'column'
|
|
14
|
+
}, mq, {
|
|
15
|
+
width: 'initial',
|
|
16
|
+
maxWidth: componentTheme.cardWidth
|
|
17
|
+
}),
|
|
18
|
+
details: {
|
|
19
|
+
paddingTop: componentTheme.detailPadding
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
borders = _ref.borders;
|
|
4
4
|
return {
|
|
@@ -8,4 +8,6 @@ export default function generator(_ref) {
|
|
|
8
8
|
cardMargin: spacing.xSmall,
|
|
9
9
|
detailPadding: borders.xxSmall
|
|
10
10
|
};
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default generateComponentTheme;
|
|
@@ -5,22 +5,15 @@ 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 PropTypes from 'prop-types';
|
|
10
11
|
import { Heading } from '@instructure/ui-heading';
|
|
11
|
-
import {
|
|
12
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
12
13
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return "\n\n.dedqg_xNcP{box-sizing:border-box;height:100%;padding:".concat(theme.pagePadding || 'inherit', "}\n\n.dedqg_biBD{display:flex;flex-wrap:wrap;margin:").concat(theme.childrenMargin || 'inherit', "}\n\n.dedqg_nvdO{margin-bottom:").concat(theme.titleMarginBottom || 'inherit', "}");
|
|
17
|
-
},
|
|
18
|
-
'page': 'dedqg_xNcP',
|
|
19
|
-
'children': 'dedqg_biBD',
|
|
20
|
-
'title': 'dedqg_nvdO'
|
|
21
|
-
};
|
|
22
|
-
import theme from "./theme.js";
|
|
23
|
-
export var ReportList = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
14
|
+
import generateStyle from "./styles.js";
|
|
15
|
+
import generateComponentTheme from "./theme.js";
|
|
16
|
+
export var ReportList = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
24
17
|
_inherits(ReportList, _Component);
|
|
25
18
|
|
|
26
19
|
var _super = _createSuper(ReportList);
|
|
@@ -38,15 +31,15 @@ export var ReportList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
38
31
|
children = _this$props.children,
|
|
39
32
|
headingLevel = _this$props.headingLevel,
|
|
40
33
|
headingAs = _this$props.headingAs;
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
},
|
|
34
|
+
return jsx("div", {
|
|
35
|
+
css: this.props.styles.page
|
|
36
|
+
}, jsx("span", {
|
|
37
|
+
css: this.props.styles.title
|
|
38
|
+
}, jsx(Heading, {
|
|
46
39
|
level: headingLevel,
|
|
47
40
|
as: headingAs
|
|
48
|
-
}, t('Reports'))),
|
|
49
|
-
|
|
41
|
+
}, t('Reports'))), jsx("div", {
|
|
42
|
+
css: this.props.styles.children
|
|
50
43
|
}, children));
|
|
51
44
|
}
|
|
52
45
|
}]);
|
|
@@ -56,7 +49,8 @@ export var ReportList = (_dec = themeable(theme, styles), _dec(_class = (_temp =
|
|
|
56
49
|
}(Component), _class2.propTypes = {
|
|
57
50
|
children: PropTypes.node.isRequired,
|
|
58
51
|
headingLevel: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'reset']),
|
|
59
|
-
headingAs: PropTypes.elementType
|
|
52
|
+
headingAs: PropTypes.elementType,
|
|
53
|
+
styles: PropTypes.object
|
|
60
54
|
}, _class2.defaultProps = {
|
|
61
55
|
headingLevel: 'h2',
|
|
62
56
|
headingAs: 'h1'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
page: {
|
|
4
|
+
boxSizing: 'border-box',
|
|
5
|
+
padding: componentTheme.pagePadding,
|
|
6
|
+
height: '100%'
|
|
7
|
+
},
|
|
8
|
+
children: {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flexWrap: 'wrap',
|
|
11
|
+
margin: componentTheme.childrenMargin
|
|
12
|
+
},
|
|
13
|
+
title: {
|
|
14
|
+
marginBottom: componentTheme.titleMarginBottom
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default generateStyle;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing;
|
|
3
3
|
return {
|
|
4
4
|
pagePadding: spacing.large,
|
|
5
5
|
childrenMargin: spacing.xSmall,
|
|
6
6
|
titleMarginBottom: spacing.xSmall
|
|
7
7
|
};
|
|
8
|
-
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default generateComponentTheme;
|
|
@@ -49,7 +49,7 @@ var CardContent = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
49
49
|
return (0, _emotion.jsx)(_uiView.View, {
|
|
50
50
|
as: "div"
|
|
51
51
|
}, (0, _emotion.jsx)("div", Object.assign({
|
|
52
|
-
css: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.props.styles.content), this.props.
|
|
52
|
+
css: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.props.styles.content), this.props.customStyles)
|
|
53
53
|
}, (0, _omit.default)(this.props, Object.keys(CardContent.propTypes))), this.props.children));
|
|
54
54
|
}
|
|
55
55
|
}]);
|
|
@@ -57,10 +57,10 @@ var CardContent = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
57
57
|
return CardContent;
|
|
58
58
|
}(_react.Component), _class2.propTypes = {
|
|
59
59
|
children: _propTypes.default.node.isRequired,
|
|
60
|
-
|
|
60
|
+
customStyles: _propTypes.default.object,
|
|
61
61
|
styles: _propTypes.default.object
|
|
62
62
|
}, _class2.defaultProps = {
|
|
63
|
-
|
|
63
|
+
customStyles: {}
|
|
64
64
|
}, _temp)) || _class);
|
|
65
65
|
exports.CardContent = CardContent;
|
|
66
66
|
var _default = CardContent;
|
|
@@ -48,7 +48,7 @@ var CardWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
48
48
|
as: "div",
|
|
49
49
|
height: "100%"
|
|
50
50
|
}, (0, _emotion.jsx)("div", {
|
|
51
|
-
css: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.props.styles.wrapper), this.props.
|
|
51
|
+
css: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, this.props.styles.wrapper), this.props.customStyles)
|
|
52
52
|
}, this.props.children));
|
|
53
53
|
}
|
|
54
54
|
}]);
|
|
@@ -56,10 +56,10 @@ var CardWrapper = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
56
56
|
return CardWrapper;
|
|
57
57
|
}(_react.Component), _class2.propTypes = {
|
|
58
58
|
children: _propTypes.default.node.isRequired,
|
|
59
|
-
|
|
59
|
+
customStyles: _propTypes.default.object,
|
|
60
60
|
styles: _propTypes.default.object
|
|
61
61
|
}, _class2.defaultProps = {
|
|
62
|
-
|
|
62
|
+
customStyles: {}
|
|
63
63
|
}, _temp)) || _class);
|
|
64
64
|
exports.CardWrapper = CardWrapper;
|
|
65
65
|
var _default = CardWrapper;
|
|
@@ -33,13 +33,13 @@ function Card(_ref) {
|
|
|
33
33
|
|
|
34
34
|
Card.propTypes = {
|
|
35
35
|
children: _propTypes.default.node.isRequired,
|
|
36
|
-
|
|
36
|
+
customStyles: _propTypes.default.object,
|
|
37
37
|
wrapperClassName: _propTypes.default.object,
|
|
38
38
|
wrapped: _propTypes.default.bool
|
|
39
39
|
};
|
|
40
40
|
Card.defaultProps = {
|
|
41
41
|
wrapped: false,
|
|
42
|
-
|
|
42
|
+
customStyles: null,
|
|
43
43
|
wrapperClassName: null
|
|
44
44
|
};
|
|
45
45
|
var _default = Card;
|