@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
|
@@ -2,15 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.NewQuizAndItemAnalysisReportCardPresenter = void 0;
|
|
11
9
|
|
|
12
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
|
|
14
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
11
|
|
|
16
12
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -19,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
19
15
|
|
|
20
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
21
17
|
|
|
22
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
23
19
|
|
|
24
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
21
|
|
|
@@ -33,13 +29,13 @@ var _uiFlex = require("@instructure/ui-flex");
|
|
|
33
29
|
|
|
34
30
|
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
35
31
|
|
|
36
|
-
var
|
|
32
|
+
var _emotion = require("@instructure/emotion");
|
|
37
33
|
|
|
38
|
-
var _index = _interopRequireDefault(require("../../../../../common/components/shared/
|
|
34
|
+
var _index = _interopRequireDefault(require("../../../../../common/components/shared/CardEmotion/index.js"));
|
|
39
35
|
|
|
40
|
-
var
|
|
36
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
41
37
|
|
|
42
|
-
var
|
|
38
|
+
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
43
39
|
|
|
44
40
|
var _index2 = _interopRequireDefault(require("../AnalysisMetric/index.js"));
|
|
45
41
|
|
|
@@ -55,20 +51,7 @@ var _index4 = require("../ExportButton/index.js");
|
|
|
55
51
|
|
|
56
52
|
var _dec, _class, _class2, _temp;
|
|
57
53
|
|
|
58
|
-
var
|
|
59
|
-
componentId: 'ebhXI',
|
|
60
|
-
template: function template(theme) {
|
|
61
|
-
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}}");
|
|
62
|
-
},
|
|
63
|
-
'metricsContainer': 'ebhXI_bqdH',
|
|
64
|
-
'reportCard': 'ebhXI_PFlN',
|
|
65
|
-
'emptyReportCard': 'ebhXI_dJIh',
|
|
66
|
-
'emptyCardBodyContainer': 'ebhXI_eWEX',
|
|
67
|
-
'dateContainer': 'ebhXI_blRb',
|
|
68
|
-
'quizAnalysisSummary': 'ebhXI_bxzy',
|
|
69
|
-
'titleContainer': 'ebhXI_dKIc'
|
|
70
|
-
};
|
|
71
|
-
var NewQuizAndItemAnalysisReportCardPresenter = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
54
|
+
var NewQuizAndItemAnalysisReportCardPresenter = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
72
55
|
(0, _inherits2.default)(NewQuizAndItemAnalysisReportCardPresenter, _Component);
|
|
73
56
|
|
|
74
57
|
var _super = (0, _createSuper2.default)(NewQuizAndItemAnalysisReportCardPresenter);
|
|
@@ -101,19 +84,19 @@ var NewQuizAndItemAnalysisReportCardPresenter = (_dec = (0, _uiThemeable.themeab
|
|
|
101
84
|
var _quizAnalysis$scores, _quizAnalysis$scores2, _quizAnalysis$scores3;
|
|
102
85
|
|
|
103
86
|
var quizAnalysis = _this.props.quizAnalysis;
|
|
104
|
-
return
|
|
105
|
-
|
|
106
|
-
},
|
|
87
|
+
return (0, _emotion.jsx)("div", {
|
|
88
|
+
css: _this.props.styles.metricsContainer
|
|
89
|
+
}, (0, _emotion.jsx)(_index2.default, {
|
|
107
90
|
metricKey: "highscore",
|
|
108
91
|
label: (0, _formatMessage.default)('High Score'),
|
|
109
92
|
value: (_quizAnalysis$scores = quizAnalysis.scores) === null || _quizAnalysis$scores === void 0 ? void 0 : _quizAnalysis$scores.max_percentage,
|
|
110
93
|
suffix: "%"
|
|
111
|
-
}),
|
|
94
|
+
}), (0, _emotion.jsx)(_index2.default, {
|
|
112
95
|
metricKey: "lowscore",
|
|
113
96
|
label: (0, _formatMessage.default)('Low Score'),
|
|
114
97
|
value: (_quizAnalysis$scores2 = quizAnalysis.scores) === null || _quizAnalysis$scores2 === void 0 ? void 0 : _quizAnalysis$scores2.min_percentage,
|
|
115
98
|
suffix: "%"
|
|
116
|
-
}),
|
|
99
|
+
}), (0, _emotion.jsx)(_index2.default, {
|
|
117
100
|
metricKey: "meanscore",
|
|
118
101
|
label: (0, _formatMessage.default)('Mean Score'),
|
|
119
102
|
value: (_quizAnalysis$scores3 = quizAnalysis.scores) === null || _quizAnalysis$scores3 === void 0 ? void 0 : _quizAnalysis$scores3.mean_percentage,
|
|
@@ -126,31 +109,31 @@ var NewQuizAndItemAnalysisReportCardPresenter = (_dec = (0, _uiThemeable.themeab
|
|
|
126
109
|
quizAnalysis = _this$props.quizAnalysis,
|
|
127
110
|
itemAnalyses = _this$props.itemAnalyses,
|
|
128
111
|
href = _this$props.href;
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
}, _this.renderMetrics(),
|
|
112
|
+
return (0, _emotion.jsx)("div", {
|
|
113
|
+
css: _this.props.styles.quizAnalysisSummary
|
|
114
|
+
}, _this.renderMetrics(), (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
132
115
|
direction: "row",
|
|
133
116
|
justifyItems: "space-between"
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
},
|
|
117
|
+
}, (0, _emotion.jsx)("div", {
|
|
118
|
+
css: _this.props.styles.dateContainer
|
|
119
|
+
}, (0, _emotion.jsx)(_index3.AnalysisUpdateDate, {
|
|
137
120
|
date: quizAnalysis.created_timestamp,
|
|
138
121
|
multiline: true
|
|
139
|
-
})), quizAnalysis && itemAnalyses &&
|
|
122
|
+
})), quizAnalysis && itemAnalyses && (0, _emotion.jsx)(_uiLink.Link, {
|
|
140
123
|
href: href,
|
|
141
124
|
"data-automation": "sdk-new-ia-report-card-view-report-button"
|
|
142
|
-
},
|
|
125
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('View Quiz and Item Analysis Report')), (0, _emotion.jsx)(_uiText.Text, {
|
|
143
126
|
size: "small",
|
|
144
127
|
"aria-hidden": "true"
|
|
145
128
|
}, (0, _formatMessage.default)('View Report')))));
|
|
146
129
|
};
|
|
147
130
|
|
|
148
131
|
_this.renderSpinner = function (mainText) {
|
|
149
|
-
return
|
|
150
|
-
|
|
151
|
-
},
|
|
132
|
+
return (0, _emotion.jsx)("div", {
|
|
133
|
+
css: _this.props.styles.emptyCardBodyContainer
|
|
134
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
152
135
|
direction: "row"
|
|
153
|
-
},
|
|
136
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, null, (0, _emotion.jsx)(_Spinner.default, {
|
|
154
137
|
size: "x-small",
|
|
155
138
|
color: "brand",
|
|
156
139
|
minHeight: "0",
|
|
@@ -161,11 +144,11 @@ var NewQuizAndItemAnalysisReportCardPresenter = (_dec = (0, _uiThemeable.themeab
|
|
|
161
144
|
};
|
|
162
145
|
|
|
163
146
|
_this.renderGenerateReportButton = function () {
|
|
164
|
-
return
|
|
147
|
+
return (0, _emotion.jsx)(_uiLink.Link, {
|
|
165
148
|
onClick: _this.handleGeneration,
|
|
166
149
|
role: "button",
|
|
167
150
|
"data-automation": "sdk-new-ia-report-card-generate-report-button"
|
|
168
|
-
},
|
|
151
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _formatMessage.default)('Generate Quiz and Item Analysis Report')), (0, _emotion.jsx)(_uiText.Text, {
|
|
169
152
|
size: "small",
|
|
170
153
|
"aria-hidden": "true"
|
|
171
154
|
}, (0, _formatMessage.default)('Generate Report')));
|
|
@@ -175,19 +158,19 @@ var NewQuizAndItemAnalysisReportCardPresenter = (_dec = (0, _uiThemeable.themeab
|
|
|
175
158
|
var _this$props2 = _this.props,
|
|
176
159
|
generationInProgress = _this$props2.generationInProgress,
|
|
177
160
|
analysisError = _this$props2.analysisError;
|
|
178
|
-
return
|
|
179
|
-
|
|
180
|
-
},
|
|
161
|
+
return (0, _emotion.jsx)("div", {
|
|
162
|
+
css: _this.props.styles.emptyCardBodyContainer
|
|
163
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
181
164
|
direction: "row",
|
|
182
165
|
justifyItems: "space-between"
|
|
183
|
-
},
|
|
166
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
184
167
|
shouldShrink: true,
|
|
185
168
|
size: analysisError && !generationInProgress ? '40%' : null
|
|
186
|
-
}, analysisError && !generationInProgress &&
|
|
169
|
+
}, analysisError && !generationInProgress && (0, _emotion.jsx)(_uiText.Text, {
|
|
187
170
|
size: "x-small",
|
|
188
171
|
weight: "bold",
|
|
189
172
|
color: "danger"
|
|
190
|
-
}, analysisError)),
|
|
173
|
+
}, analysisError)), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
191
174
|
shouldShrink: analysisError && !generationInProgress
|
|
192
175
|
}, generationInProgress ? _this.renderSpinner((0, _formatMessage.default)('Generation In Progress')) : _this.renderGenerateReportButton())));
|
|
193
176
|
};
|
|
@@ -196,7 +179,7 @@ var NewQuizAndItemAnalysisReportCardPresenter = (_dec = (0, _uiThemeable.themeab
|
|
|
196
179
|
var _this$props3 = _this.props,
|
|
197
180
|
quizAnalysis = _this$props3.quizAnalysis,
|
|
198
181
|
generationInProgress = _this$props3.generationInProgress;
|
|
199
|
-
return
|
|
182
|
+
return (0, _emotion.jsx)(_index4.ExportButton, {
|
|
200
183
|
quizAnalysis: quizAnalysis,
|
|
201
184
|
generationInProgress: generationInProgress,
|
|
202
185
|
handleExport: _this.handleExport
|
|
@@ -208,31 +191,41 @@ var NewQuizAndItemAnalysisReportCardPresenter = (_dec = (0, _uiThemeable.themeab
|
|
|
208
191
|
name = _this$props4.name,
|
|
209
192
|
exportEnabled = _this$props4.exportEnabled,
|
|
210
193
|
fetchInProgress = _this$props4.fetchInProgress;
|
|
211
|
-
return
|
|
212
|
-
|
|
213
|
-
},
|
|
194
|
+
return (0, _emotion.jsx)("div", {
|
|
195
|
+
css: _this.props.styles.titleContainer
|
|
196
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
214
197
|
direction: "row",
|
|
215
198
|
wrap: "wrap",
|
|
216
199
|
justifyItems: "space-between"
|
|
217
|
-
},
|
|
200
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, null, (0, _emotion.jsx)(_uiText.Text, {
|
|
218
201
|
size: "medium",
|
|
219
202
|
weight: "bold"
|
|
220
|
-
}, name)), exportEnabled && !fetchInProgress &&
|
|
203
|
+
}, name)), exportEnabled && !fetchInProgress && (0, _emotion.jsx)(_uiFlex.Flex.Item, null, _this.renderExport())));
|
|
221
204
|
};
|
|
222
205
|
|
|
223
206
|
return _this;
|
|
224
207
|
}
|
|
225
208
|
|
|
226
209
|
(0, _createClass2.default)(NewQuizAndItemAnalysisReportCardPresenter, [{
|
|
210
|
+
key: "componentDidMount",
|
|
211
|
+
value: function componentDidMount() {
|
|
212
|
+
this.props.makeStyles();
|
|
213
|
+
}
|
|
214
|
+
}, {
|
|
215
|
+
key: "componentDidUpdate",
|
|
216
|
+
value: function componentDidUpdate() {
|
|
217
|
+
this.props.makeStyles();
|
|
218
|
+
}
|
|
219
|
+
}, {
|
|
227
220
|
key: "render",
|
|
228
221
|
value: function render() {
|
|
229
222
|
var _this$props5 = this.props,
|
|
230
223
|
fetchInProgress = _this$props5.fetchInProgress,
|
|
231
224
|
quizAnalysis = _this$props5.quizAnalysis,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
225
|
+
styles = _this$props5.styles;
|
|
226
|
+
return (0, _emotion.jsx)(_index.default, {
|
|
227
|
+
css: styles.reportCard,
|
|
228
|
+
customStyles: styles.reportCard
|
|
236
229
|
}, this.renderReportCardHeader(), !fetchInProgress && quizAnalysis && this.renderQuizAnalysisSummary(), fetchInProgress && this.renderSpinner(), !fetchInProgress && this.renderReportCardFooter());
|
|
237
230
|
}
|
|
238
231
|
}]);
|
|
@@ -248,7 +241,9 @@ var NewQuizAndItemAnalysisReportCardPresenter = (_dec = (0, _uiThemeable.themeab
|
|
|
248
241
|
analysisError: _propTypes.default.string,
|
|
249
242
|
generateReports: _propTypes.default.func.isRequired,
|
|
250
243
|
exportReports: _propTypes.default.func.isRequired,
|
|
251
|
-
exportEnabled: _propTypes.default.bool.isRequired
|
|
244
|
+
exportEnabled: _propTypes.default.bool.isRequired,
|
|
245
|
+
styles: _propTypes.default.object,
|
|
246
|
+
makeStyles: _propTypes.default.func
|
|
252
247
|
}, _class2.defaultProps = {
|
|
253
248
|
name: void 0,
|
|
254
249
|
href: void 0,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread3 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
14
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
15
|
+
var msMaxWidth = 'max-width: 25rem';
|
|
16
|
+
var mq = "@media only screen and (".concat(msMaxWidth, ")");
|
|
17
|
+
return {
|
|
18
|
+
metricsContainer: (0, _defineProperty2.default)({
|
|
19
|
+
paddingBottom: componentTheme.metricsPadding,
|
|
20
|
+
display: 'flex',
|
|
21
|
+
justifyContent: 'flex-start',
|
|
22
|
+
columnGap: '26px',
|
|
23
|
+
rowGap: '8px'
|
|
24
|
+
}, mq, {
|
|
25
|
+
flexWrap: 'wrap'
|
|
26
|
+
}),
|
|
27
|
+
reportCard: (0, _objectSpread3.default)((0, _defineProperty2.default)({
|
|
28
|
+
width: componentTheme.cardWidth,
|
|
29
|
+
padding: componentTheme.cardPadding,
|
|
30
|
+
margin: componentTheme.cardMargin,
|
|
31
|
+
display: 'inline-flex',
|
|
32
|
+
flexDirection: 'column'
|
|
33
|
+
}, mq, {
|
|
34
|
+
width: 'initial',
|
|
35
|
+
maxWidth: componentTheme.cardWidth
|
|
36
|
+
}), !props.quizAnalysis && !props.analysisError && (0, _defineProperty2.default)({
|
|
37
|
+
height: componentTheme.cardHeight
|
|
38
|
+
}, mq, {
|
|
39
|
+
height: 'initial'
|
|
40
|
+
})),
|
|
41
|
+
emptyCardBodyContainer: {
|
|
42
|
+
display: 'flex',
|
|
43
|
+
justifyContent: 'flex-end',
|
|
44
|
+
alignItems: 'flex-end',
|
|
45
|
+
alignSelf: 'flex-end',
|
|
46
|
+
height: '100%'
|
|
47
|
+
},
|
|
48
|
+
dateContainer: {
|
|
49
|
+
maxWidth: '160px',
|
|
50
|
+
paddingRight: '10px'
|
|
51
|
+
},
|
|
52
|
+
quizAnalysisSummary: {
|
|
53
|
+
borderBottom: "1px solid ".concat(componentTheme.quizSummaryBorderBottomColor),
|
|
54
|
+
paddingBottom: '15px',
|
|
55
|
+
marginBottom: '15px'
|
|
56
|
+
},
|
|
57
|
+
titleContainer: {
|
|
58
|
+
paddingBottom: '15px'
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var _default = generateStyle;
|
|
64
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var spacing = _ref.spacing,
|
|
10
10
|
colors = _ref.colors;
|
|
11
11
|
return {
|
|
@@ -16,4 +16,7 @@ function generator(_ref) {
|
|
|
16
16
|
cardMargin: spacing.xSmall,
|
|
17
17
|
quizSummaryBorderBottomColor: colors.tiara
|
|
18
18
|
};
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var _default = generateComponentTheme;
|
|
22
|
+
exports.default = _default;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -17,7 +15,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
@@ -25,9 +23,11 @@ var _uiText = require("@instructure/ui-text");
|
|
|
25
23
|
|
|
26
24
|
var _uiLink = require("@instructure/ui-link");
|
|
27
25
|
|
|
28
|
-
var
|
|
26
|
+
var _emotion = require("@instructure/emotion");
|
|
27
|
+
|
|
28
|
+
var _index = _interopRequireDefault(require("../../../../common/components/shared/CardEmotion/index.js"));
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
31
31
|
|
|
32
32
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
33
33
|
|
|
@@ -37,15 +37,7 @@ var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/f
|
|
|
37
37
|
|
|
38
38
|
var _dec, _class, _class2, _temp;
|
|
39
39
|
|
|
40
|
-
var
|
|
41
|
-
componentId: 'fnaXq',
|
|
42
|
-
template: function template(theme) {
|
|
43
|
-
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}}");
|
|
44
|
-
},
|
|
45
|
-
'card': 'fnaXq_fbIL',
|
|
46
|
-
'details': 'fnaXq_ebWM'
|
|
47
|
-
};
|
|
48
|
-
var ReportCard = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
40
|
+
var ReportCard = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
49
41
|
(0, _inherits2.default)(ReportCard, _Component);
|
|
50
42
|
|
|
51
43
|
var _super = (0, _createSuper2.default)(ReportCard);
|
|
@@ -62,24 +54,24 @@ var ReportCard = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
62
54
|
name = _this$props.name,
|
|
63
55
|
details = _this$props.details,
|
|
64
56
|
href = _this$props.href;
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
},
|
|
57
|
+
return (0, _emotion.jsx)(_index.default, {
|
|
58
|
+
customStyles: this.props.styles.card
|
|
59
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
68
60
|
size: "medium",
|
|
69
61
|
weight: "bold"
|
|
70
|
-
}, name),
|
|
71
|
-
|
|
72
|
-
},
|
|
62
|
+
}, name), (0, _emotion.jsx)("div", {
|
|
63
|
+
css: this.props.styles.details
|
|
64
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
73
65
|
size: "small",
|
|
74
66
|
color: "secondary"
|
|
75
|
-
}, details)),
|
|
67
|
+
}, details)), (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
76
68
|
direction: "row",
|
|
77
69
|
justifyItems: "end",
|
|
78
70
|
alignItems: "end",
|
|
79
71
|
height: "100%"
|
|
80
|
-
},
|
|
72
|
+
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
81
73
|
href: href
|
|
82
|
-
},
|
|
74
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
83
75
|
size: "small",
|
|
84
76
|
"data-automation": name
|
|
85
77
|
}, (0, _formatMessage.default)('View Report')))));
|
|
@@ -90,7 +82,8 @@ var ReportCard = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
90
82
|
}(_react.Component), _class2.propTypes = {
|
|
91
83
|
name: _propTypes.default.node,
|
|
92
84
|
details: _propTypes.default.node,
|
|
93
|
-
href: _propTypes.default.string
|
|
85
|
+
href: _propTypes.default.string,
|
|
86
|
+
styles: _propTypes.default.object
|
|
94
87
|
}, _class2.defaultProps = {
|
|
95
88
|
name: void 0,
|
|
96
89
|
details: void 0,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
13
|
+
var msMaxWidth = 'max-width: 25rem';
|
|
14
|
+
var mq = "@media screen and (".concat(msMaxWidth, ")");
|
|
15
|
+
return {
|
|
16
|
+
card: (0, _defineProperty2.default)({
|
|
17
|
+
height: componentTheme.cardHeight,
|
|
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
|
+
}),
|
|
27
|
+
details: {
|
|
28
|
+
paddingTop: componentTheme.detailPadding
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
var _default = generateStyle;
|
|
34
|
+
exports.default = _default;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var spacing = _ref.spacing,
|
|
10
10
|
borders = _ref.borders;
|
|
11
11
|
return {
|
|
@@ -15,4 +15,7 @@ function generator(_ref) {
|
|
|
15
15
|
cardMargin: spacing.xSmall,
|
|
16
16
|
detailPadding: borders.xxSmall
|
|
17
17
|
};
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var _default = generateComponentTheme;
|
|
21
|
+
exports.default = _default;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -17,30 +15,23 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
15
|
|
|
18
16
|
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
19
17
|
|
|
20
|
-
var _react =
|
|
18
|
+
var _react = require("react");
|
|
21
19
|
|
|
22
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
23
21
|
|
|
24
22
|
var _uiHeading = require("@instructure/ui-heading");
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _emotion = require("@instructure/emotion");
|
|
27
25
|
|
|
28
26
|
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
29
27
|
|
|
28
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
29
|
+
|
|
30
30
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
31
31
|
|
|
32
32
|
var _dec, _class, _class2, _temp;
|
|
33
33
|
|
|
34
|
-
var
|
|
35
|
-
componentId: 'dedqg',
|
|
36
|
-
template: function template(theme) {
|
|
37
|
-
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', "}");
|
|
38
|
-
},
|
|
39
|
-
'page': 'dedqg_xNcP',
|
|
40
|
-
'children': 'dedqg_biBD',
|
|
41
|
-
'title': 'dedqg_nvdO'
|
|
42
|
-
};
|
|
43
|
-
var ReportList = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
34
|
+
var ReportList = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
44
35
|
(0, _inherits2.default)(ReportList, _Component);
|
|
45
36
|
|
|
46
37
|
var _super = (0, _createSuper2.default)(ReportList);
|
|
@@ -57,15 +48,15 @@ var ReportList = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
57
48
|
children = _this$props.children,
|
|
58
49
|
headingLevel = _this$props.headingLevel,
|
|
59
50
|
headingAs = _this$props.headingAs;
|
|
60
|
-
return
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
},
|
|
51
|
+
return (0, _emotion.jsx)("div", {
|
|
52
|
+
css: this.props.styles.page
|
|
53
|
+
}, (0, _emotion.jsx)("span", {
|
|
54
|
+
css: this.props.styles.title
|
|
55
|
+
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
65
56
|
level: headingLevel,
|
|
66
57
|
as: headingAs
|
|
67
|
-
}, (0, _formatMessage.default)('Reports'))),
|
|
68
|
-
|
|
58
|
+
}, (0, _formatMessage.default)('Reports'))), (0, _emotion.jsx)("div", {
|
|
59
|
+
css: this.props.styles.children
|
|
69
60
|
}, children));
|
|
70
61
|
}
|
|
71
62
|
}]);
|
|
@@ -74,7 +65,8 @@ var ReportList = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _d
|
|
|
74
65
|
}(_react.Component), _class2.propTypes = {
|
|
75
66
|
children: _propTypes.default.node.isRequired,
|
|
76
67
|
headingLevel: _propTypes.default.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'reset']),
|
|
77
|
-
headingAs: _propTypes.default.elementType
|
|
68
|
+
headingAs: _propTypes.default.elementType,
|
|
69
|
+
styles: _propTypes.default.object
|
|
78
70
|
}, _class2.defaultProps = {
|
|
79
71
|
headingLevel: 'h2',
|
|
80
72
|
headingAs: 'h1'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
9
|
+
return {
|
|
10
|
+
page: {
|
|
11
|
+
boxSizing: 'border-box',
|
|
12
|
+
padding: componentTheme.pagePadding,
|
|
13
|
+
height: '100%'
|
|
14
|
+
},
|
|
15
|
+
children: {
|
|
16
|
+
display: 'flex',
|
|
17
|
+
flexWrap: 'wrap',
|
|
18
|
+
margin: componentTheme.childrenMargin
|
|
19
|
+
},
|
|
20
|
+
title: {
|
|
21
|
+
marginBottom: componentTheme.titleMarginBottom
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var _default = generateStyle;
|
|
27
|
+
exports.default = _default;
|
|
@@ -3,13 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
8
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
9
9
|
var spacing = _ref.spacing;
|
|
10
10
|
return {
|
|
11
11
|
pagePadding: spacing.large,
|
|
12
12
|
childrenMargin: spacing.xSmall,
|
|
13
13
|
titleMarginBottom: spacing.xSmall
|
|
14
14
|
};
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var _default = generateComponentTheme;
|
|
18
|
+
exports.default = _default;
|