@instructure/quiz-core 20.11.3-rc.2 → 20.11.3-rc.21
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/banks/components/Bank/presenter.js +12 -6
- package/es/banks/components/HeaderMenu/presenter.js +40 -1
- package/es/banks/components/HeaderMenu/styles.js +3 -0
- package/es/banks/components/NavWrapper/presenter.js +6 -1
- package/es/banks/components/SharingModal/presenter.js +1 -1
- package/es/building/components/resources/quizEntry/QuizEntry/index.js +2 -1
- package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +23 -29
- package/es/building/components/resources/quizEntry/QuizEntry/quizEntryPresenterWrapper.js +39 -0
- package/es/building/components/resources/quizEntry/QuizEntry/styles.js +23 -0
- package/es/building/components/resources/quizEntry/QuizEntry/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +35 -43
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/styles.js +30 -0
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +25 -31
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/styles.js +19 -0
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +27 -33
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/styles.js +28 -0
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +32 -37
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +49 -0
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +23 -23
- package/es/building/components/resources/quizEntry/QuizEntryEdit/styles.js +21 -0
- package/es/building/components/resources/quizEntry/QuizEntryEdit/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryShow/presenter.js +36 -50
- package/es/building/components/resources/quizEntry/QuizEntryShow/styles.js +84 -0
- package/es/building/components/resources/quizEntry/QuizEntryShow/theme.js +4 -2
- package/es/common/components/layout/navbar/SecondaryNavBarButton/index.js +1 -1
- package/es/common/components/layout/navbar/index.js +135 -38
- package/es/common/components/layout/navbar/styles.js +8 -0
- package/es/common/components/layout/navbar/theme.js +10 -0
- package/es/common/components/resources/stimulus/Stimulus/presenter.js +40 -50
- package/es/common/components/resources/stimulus/Stimulus/styles.js +58 -0
- package/es/common/components/resources/stimulus/Stimulus/theme.js +4 -2
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +37 -46
- package/es/common/components/resources/stimulus/StimulusEdit/styles.js +46 -0
- package/es/common/components/resources/stimulus/StimulusEdit/theme.js +4 -2
- package/es/common/components/shared/overlayEmotion/index.js +1 -1
- package/es/common/components/shared/return_button/ReturnButton.js +4 -1
- package/es/moderating/components/resources/ModerateTable/presenter.js +44 -46
- package/es/moderating/components/resources/ModerateTable/styles.js +23 -0
- package/es/moderating/components/resources/ModerateTable/theme.js +4 -2
- package/es/moderating/components/resources/ModerateTableRow/presenter.js +63 -68
- package/es/moderating/components/resources/ModerateTableRow/styles.js +25 -0
- package/es/moderating/components/resources/ModerateTableRow/theme.js +4 -2
- package/es/reporting/components/quizAnalysis/QuizAnalysisOverview.js +34 -41
- package/es/reporting/components/quizAnalysis/styles.js +27 -0
- package/es/reporting/components/quizAnalysis/theme.js +4 -2
- 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/LegacyChoiceType/presenter.js +20 -26
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/styles.js +19 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +45 -47
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +52 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +32 -26
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +14 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/theme.js +4 -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/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +80 -61
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/styles.js +93 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/theme.js +8 -5
- 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/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +80 -79
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +75 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +47 -49
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/styles.js +14 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/theme.js +4 -2
- package/lib/banks/components/Bank/presenter.js +10 -5
- package/lib/banks/components/HeaderMenu/presenter.js +42 -1
- package/lib/banks/components/HeaderMenu/styles.js +3 -0
- package/lib/banks/components/NavWrapper/presenter.js +6 -1
- package/lib/banks/components/SharingModal/presenter.js +1 -1
- package/lib/building/components/resources/quizEntry/QuizEntry/index.js +3 -1
- package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +22 -30
- package/lib/building/components/resources/quizEntry/QuizEntry/quizEntryPresenterWrapper.js +51 -0
- package/lib/building/components/resources/quizEntry/QuizEntry/styles.js +33 -0
- package/lib/building/components/resources/quizEntry/QuizEntry/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +34 -45
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/styles.js +38 -0
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +24 -33
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/styles.js +27 -0
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +26 -35
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/styles.js +38 -0
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +30 -38
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +57 -0
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +20 -22
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/styles.js +29 -0
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryShow/presenter.js +36 -53
- package/lib/building/components/resources/quizEntry/QuizEntryShow/styles.js +95 -0
- package/lib/building/components/resources/quizEntry/QuizEntryShow/theme.js +6 -3
- package/lib/common/components/layout/navbar/SecondaryNavBarButton/index.js +1 -1
- package/lib/common/components/layout/navbar/index.js +130 -39
- package/lib/common/components/layout/navbar/styles.js +16 -0
- package/lib/common/components/layout/navbar/theme.js +18 -0
- package/lib/common/components/resources/stimulus/Stimulus/presenter.js +38 -52
- package/lib/common/components/resources/stimulus/Stimulus/styles.js +70 -0
- package/lib/common/components/resources/stimulus/Stimulus/theme.js +6 -3
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +36 -47
- package/lib/common/components/resources/stimulus/StimulusEdit/styles.js +54 -0
- package/lib/common/components/resources/stimulus/StimulusEdit/theme.js +6 -3
- package/lib/common/components/shared/overlayEmotion/index.js +1 -1
- package/lib/common/components/shared/return_button/ReturnButton.js +4 -1
- package/lib/moderating/components/resources/ModerateTable/presenter.js +43 -50
- package/lib/moderating/components/resources/ModerateTable/styles.js +33 -0
- package/lib/moderating/components/resources/ModerateTable/theme.js +6 -3
- package/lib/moderating/components/resources/ModerateTableRow/presenter.js +61 -70
- package/lib/moderating/components/resources/ModerateTableRow/styles.js +33 -0
- package/lib/moderating/components/resources/ModerateTableRow/theme.js +6 -3
- package/lib/reporting/components/quizAnalysis/QuizAnalysisOverview.js +33 -43
- package/lib/reporting/components/quizAnalysis/styles.js +37 -0
- package/lib/reporting/components/quizAnalysis/theme.js +6 -3
- 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/LegacyChoiceType/presenter.js +19 -28
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/styles.js +27 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +45 -52
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +62 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +28 -26
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +24 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/theme.js +6 -3
- 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/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +81 -65
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/styles.js +103 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/theme.js +10 -6
- 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/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +82 -84
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +85 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +43 -48
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/styles.js +22 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/theme.js +6 -3
- package/package.json +9 -9
- package/es/common/components/layout/navbar/presenter.js +0 -114
- package/lib/common/components/layout/navbar/presenter.js +0 -136
|
@@ -55,28 +55,22 @@ var _exportFormats = require("./exportFormats.js");
|
|
|
55
55
|
|
|
56
56
|
var _index4 = require("./ExportButton/index.js");
|
|
57
57
|
|
|
58
|
-
var
|
|
58
|
+
var _emotion = require("@instructure/emotion");
|
|
59
|
+
|
|
60
|
+
var _styles = _interopRequireDefault(require("./styles.js"));
|
|
59
61
|
|
|
60
62
|
var _theme = _interopRequireDefault(require("./theme.js"));
|
|
61
63
|
|
|
62
64
|
var _dec, _class, _class2, _temp;
|
|
63
65
|
|
|
64
|
-
var
|
|
65
|
-
componentId: 'edRct',
|
|
66
|
-
template: function template(theme) {
|
|
67
|
-
return "\n\n.edRct_bJHk{align-items:flex-end;display:flex;flex-direction:row;flex-wrap:wrap;gap:".concat(theme.headerButtonsGap || 'inherit', ";justify-content:flex-end}");
|
|
68
|
-
},
|
|
69
|
-
'headerButtonsContainer': 'edRct_bJHk'
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
var _ref = /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
|
|
66
|
+
var _ref = (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
73
67
|
align: "center"
|
|
74
|
-
},
|
|
68
|
+
}, (0, _emotion.jsx)(_uiA11yContent.PresentationContent, null, (0, _emotion.jsx)(_uiImg.Img, {
|
|
75
69
|
src: _downForRepair.default,
|
|
76
70
|
alt: ""
|
|
77
71
|
})));
|
|
78
72
|
|
|
79
|
-
var NewQuizAndItemAnalysisPresenter = (_dec = (0,
|
|
73
|
+
var NewQuizAndItemAnalysisPresenter = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
80
74
|
(0, _inherits2.default)(NewQuizAndItemAnalysisPresenter, _Component);
|
|
81
75
|
|
|
82
76
|
var _super = (0, _createSuper2.default)(NewQuizAndItemAnalysisPresenter);
|
|
@@ -94,14 +88,14 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
94
88
|
|
|
95
89
|
_this.renderItemAnalyses = function () {
|
|
96
90
|
var itemAnalyses = _this.props.itemAnalyses || [];
|
|
97
|
-
return
|
|
91
|
+
return (0, _emotion.jsx)(_react.default.Fragment, null, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
98
92
|
level: "h2",
|
|
99
93
|
themeOverride: {
|
|
100
94
|
h2FontWeight: 700
|
|
101
95
|
},
|
|
102
96
|
color: "primary"
|
|
103
|
-
}, (0, _formatMessage.default)('Item Analysis')),
|
|
104
|
-
return
|
|
97
|
+
}, (0, _formatMessage.default)('Item Analysis')), (0, _emotion.jsx)("div", null, itemAnalyses.map(function (itemAnalysis) {
|
|
98
|
+
return (0, _emotion.jsx)(_index.default, {
|
|
105
99
|
key: itemAnalysis.metadata.item_id,
|
|
106
100
|
itemAnalysis: itemAnalysis
|
|
107
101
|
});
|
|
@@ -109,29 +103,29 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
109
103
|
};
|
|
110
104
|
|
|
111
105
|
_this.renderSpinner = function () {
|
|
112
|
-
return
|
|
106
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
113
107
|
padding: "medium",
|
|
114
108
|
justifyItems: "center",
|
|
115
109
|
alignItems: "center"
|
|
116
|
-
},
|
|
110
|
+
}, (0, _emotion.jsx)(_uiSpinner.Spinner, {
|
|
117
111
|
renderTitle: (0, _formatMessage.default)('Loading item analyses data')
|
|
118
112
|
}));
|
|
119
113
|
};
|
|
120
114
|
|
|
121
115
|
_this.renderBodyOnFailedFetch = function () {
|
|
122
|
-
return
|
|
116
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
123
117
|
alignItems: "end",
|
|
124
118
|
width: "82.5rem",
|
|
125
119
|
margin: "auto",
|
|
126
120
|
direction: "column"
|
|
127
|
-
}, _ref,
|
|
121
|
+
}, _ref, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
128
122
|
align: "center"
|
|
129
|
-
},
|
|
123
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
130
124
|
size: "x-large",
|
|
131
125
|
color: "primary"
|
|
132
|
-
}, (0, _formatMessage.default)('Error'))),
|
|
126
|
+
}, (0, _formatMessage.default)('Error'))), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
133
127
|
align: "center"
|
|
134
|
-
},
|
|
128
|
+
}, (0, _emotion.jsx)(_uiA11yContent.ScreenReaderContent, null, (0, _errorMessages.getFailedToFetchReports)()), (0, _emotion.jsx)(_uiText.Text, {
|
|
135
129
|
size: "x-small",
|
|
136
130
|
color: "primary"
|
|
137
131
|
}, (0, _errorMessages.getFailedToFetchReports)())));
|
|
@@ -141,14 +135,14 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
141
135
|
var _quizAnalysis$metadat;
|
|
142
136
|
|
|
143
137
|
var quizAnalysis = _this.props.quizAnalysis;
|
|
144
|
-
return
|
|
138
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
145
139
|
alignItems: "center",
|
|
146
140
|
width: "auto",
|
|
147
141
|
margin: "small auto",
|
|
148
142
|
direction: "column"
|
|
149
|
-
},
|
|
143
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
150
144
|
overflowY: "hidden"
|
|
151
|
-
},
|
|
145
|
+
}, (0, _emotion.jsx)(_uiHeading.Heading, {
|
|
152
146
|
level: "h2",
|
|
153
147
|
themeOverride: {
|
|
154
148
|
h2FontWeight: 700
|
|
@@ -165,14 +159,14 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
165
159
|
quizAnalysis = _this$props.quizAnalysis;
|
|
166
160
|
var shouldShowError = analysisError && !generationInProgress;
|
|
167
161
|
var timeStamp = quizAnalysis === null || quizAnalysis === void 0 ? void 0 : quizAnalysis.created_timestamp;
|
|
168
|
-
return
|
|
162
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
169
163
|
alignItems: "end",
|
|
170
164
|
width: "auto",
|
|
171
165
|
margin: "small auto",
|
|
172
166
|
direction: "column"
|
|
173
|
-
},
|
|
167
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, null, timeStamp && (0, _emotion.jsx)(_index3.AnalysisUpdateDate, {
|
|
174
168
|
date: timeStamp
|
|
175
|
-
})),
|
|
169
|
+
})), (0, _emotion.jsx)(_uiFlex.Flex.Item, null, shouldShowError && (0, _emotion.jsx)(_uiText.Text, {
|
|
176
170
|
size: "x-small",
|
|
177
171
|
weight: "medium",
|
|
178
172
|
color: "danger"
|
|
@@ -181,20 +175,20 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
181
175
|
|
|
182
176
|
_this.renderRightSide = function () {
|
|
183
177
|
var exportEnabled = _this.props.exportEnabled;
|
|
184
|
-
return
|
|
178
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
185
179
|
alignItems: "center",
|
|
186
180
|
justifyItems: "end",
|
|
187
181
|
width: "auto",
|
|
188
182
|
direction: "row",
|
|
189
183
|
wrap: "wrap-reverse"
|
|
190
|
-
},
|
|
184
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
191
185
|
padding: "0 small 0 0",
|
|
192
186
|
margin: "0 0 0 auto"
|
|
193
|
-
}, _this.renderUpdateDateWithError()),
|
|
194
|
-
|
|
195
|
-
}, exportEnabled &&
|
|
187
|
+
}, _this.renderUpdateDateWithError()), (0, _emotion.jsx)(_uiFlex.Flex.Item, null, (0, _emotion.jsx)("div", {
|
|
188
|
+
css: _this.props.styles.headerButtonsContainer
|
|
189
|
+
}, exportEnabled && (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
196
190
|
margin: "0 0 0 auto"
|
|
197
|
-
}, _this.renderExport()),
|
|
191
|
+
}, _this.renderExport()), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
198
192
|
margin: "0 0 0 auto"
|
|
199
193
|
}, _this.renderGenerationButton()))));
|
|
200
194
|
};
|
|
@@ -203,7 +197,7 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
203
197
|
var _this$props2 = _this.props,
|
|
204
198
|
quizAnalysis = _this$props2.quizAnalysis,
|
|
205
199
|
generationInProgress = _this$props2.generationInProgress;
|
|
206
|
-
return
|
|
200
|
+
return (0, _emotion.jsx)(_index4.ExportButton, {
|
|
207
201
|
quizAnalysis: quizAnalysis,
|
|
208
202
|
generationInProgress: generationInProgress,
|
|
209
203
|
handleExport: _this.handleExport
|
|
@@ -220,14 +214,14 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
220
214
|
};
|
|
221
215
|
|
|
222
216
|
_this.renderTop = function () {
|
|
223
|
-
return
|
|
217
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
224
218
|
justifyItems: "space-between",
|
|
225
219
|
alignItems: "center",
|
|
226
220
|
wrap: "wrap",
|
|
227
221
|
width: "auto",
|
|
228
222
|
margin: "0 auto small 0",
|
|
229
223
|
direction: "row"
|
|
230
|
-
},
|
|
224
|
+
}, (0, _emotion.jsx)(_uiFlex.Flex.Item, null, _this.renderHeader()), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
231
225
|
margin: "0 0 0 auto"
|
|
232
226
|
}, _this.renderRightSide()));
|
|
233
227
|
};
|
|
@@ -238,25 +232,25 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
238
232
|
|
|
239
233
|
_this.renderTopOnFailedFetch = function () {
|
|
240
234
|
var exportEnabled = _this.props.exportEnabled;
|
|
241
|
-
return
|
|
235
|
+
return (0, _emotion.jsx)(_uiFlex.Flex, {
|
|
242
236
|
direction: "row",
|
|
243
237
|
justifyItems: "end",
|
|
244
238
|
wrap: "wrap",
|
|
245
239
|
width: "auto",
|
|
246
240
|
margin: "auto"
|
|
247
|
-
}, exportEnabled &&
|
|
241
|
+
}, exportEnabled && (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
248
242
|
overflowY: "visible"
|
|
249
|
-
}, _this.renderExport()),
|
|
243
|
+
}, _this.renderExport()), (0, _emotion.jsx)(_uiFlex.Flex.Item, {
|
|
250
244
|
overflowY: "visible"
|
|
251
245
|
}, _this.renderGenerationButton()));
|
|
252
246
|
};
|
|
253
247
|
|
|
254
248
|
_this.renderOngoingGenerationButton = function () {
|
|
255
|
-
return
|
|
249
|
+
return (0, _emotion.jsx)(_uiButtons.Button, {
|
|
256
250
|
color: "primary-inverse",
|
|
257
251
|
interaction: "disabled",
|
|
258
252
|
margin: "auto"
|
|
259
|
-
},
|
|
253
|
+
}, (0, _emotion.jsx)(_Spinner.QuizzesSpinner, {
|
|
260
254
|
size: "x-small",
|
|
261
255
|
color: "brand",
|
|
262
256
|
minHeight: "0",
|
|
@@ -266,14 +260,14 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
266
260
|
};
|
|
267
261
|
|
|
268
262
|
_this.renderStartGenerationButton = function () {
|
|
269
|
-
return
|
|
263
|
+
return (0, _emotion.jsx)(_uiButtons.Button, {
|
|
270
264
|
color: "secondary",
|
|
271
265
|
margin: "auto",
|
|
272
266
|
onClick: _this.handleGeneration,
|
|
273
267
|
themeOverride: {
|
|
274
268
|
lineHeight: '24px'
|
|
275
269
|
}
|
|
276
|
-
},
|
|
270
|
+
}, (0, _emotion.jsx)(_uiText.Text, {
|
|
277
271
|
size: "medium"
|
|
278
272
|
}, (0, _formatMessage.default)('Generate Report')));
|
|
279
273
|
};
|
|
@@ -281,7 +275,7 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
281
275
|
_this.renderGenerationButton = function () {
|
|
282
276
|
var generationInProgress = _this.props.generationInProgress;
|
|
283
277
|
var buttonVariant = generationInProgress ? _this.renderOngoingGenerationButton() : _this.renderStartGenerationButton();
|
|
284
|
-
return
|
|
278
|
+
return (0, _emotion.jsx)(_react.default.Fragment, null, buttonVariant);
|
|
285
279
|
};
|
|
286
280
|
|
|
287
281
|
_this.renderBody = function () {
|
|
@@ -289,7 +283,7 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
289
283
|
fetchInProgress = _this$props4.fetchInProgress,
|
|
290
284
|
quizAnalysis = _this$props4.quizAnalysis; // TODO need to refactor the NewQuizAnalysis to move out spinner logic
|
|
291
285
|
|
|
292
|
-
return
|
|
286
|
+
return (0, _emotion.jsx)(_react.default.Fragment, null, (fetchInProgress || quizAnalysis) && (0, _emotion.jsx)(_index2.default, {
|
|
293
287
|
quizAnalysis: quizAnalysis,
|
|
294
288
|
fetchInProgress: fetchInProgress
|
|
295
289
|
}), fetchInProgress ? _this.renderSpinner() : _this.renderItemAnalyses());
|
|
@@ -321,7 +315,7 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
321
315
|
var _this$props5 = this.props,
|
|
322
316
|
analysisFetchError = _this$props5.analysisFetchError,
|
|
323
317
|
fetchInProgress = _this$props5.fetchInProgress;
|
|
324
|
-
return
|
|
318
|
+
return (0, _emotion.jsx)("div", {
|
|
325
319
|
className: "fs-mask"
|
|
326
320
|
}, !fetchInProgress && (analysisFetchError ? this.renderTopOnFailedFetch() : this.renderTopOnSuccessfulFetch()), analysisFetchError ? this.renderBodyOnFailedFetch() : this.renderBodyOnSuccessfulFetch());
|
|
327
321
|
}
|
|
@@ -337,7 +331,8 @@ var NewQuizAndItemAnalysisPresenter = (_dec = (0, _uiThemeable.themeable)(_theme
|
|
|
337
331
|
analysisError: _propTypes2.default.string,
|
|
338
332
|
generateReports: _propTypes2.default.func.isRequired,
|
|
339
333
|
exportReports: _propTypes2.default.func.isRequired,
|
|
340
|
-
exportEnabled: _propTypes2.default.bool.isRequired
|
|
334
|
+
exportEnabled: _propTypes2.default.bool.isRequired,
|
|
335
|
+
styles: _propTypes2.default.object
|
|
341
336
|
}, _class2.defaultProps = {
|
|
342
337
|
analysisError: void 0,
|
|
343
338
|
quizAnalysis: void 0,
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
headerButtonsContainer: {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'row',
|
|
13
|
+
alignItems: 'flex-end',
|
|
14
|
+
justifyContent: 'flex-end',
|
|
15
|
+
flexWrap: 'wrap',
|
|
16
|
+
gap: componentTheme.headerButtonsGap
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var _default = generateStyle;
|
|
22
|
+
exports.default = _default;
|
|
@@ -3,11 +3,14 @@
|
|
|
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
|
headerButtonsGap: spacing.small
|
|
12
12
|
};
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var _default = generateComponentTheme;
|
|
16
|
+
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.11.3-rc.
|
|
3
|
+
"version": "20.11.3-rc.21+e2d9c71bc",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@instructure/emotion": "^8.51.0",
|
|
45
45
|
"@instructure/grading-utils": "^1.0.0",
|
|
46
46
|
"@instructure/outcomes-ui": "^3.2.0",
|
|
47
|
-
"@instructure/quiz-common": "20.11.3-rc.
|
|
48
|
-
"@instructure/quiz-i18n": "20.11.3-rc.
|
|
49
|
-
"@instructure/quiz-interactions": "20.11.3-rc.
|
|
50
|
-
"@instructure/quiz-number-input": "20.11.3-rc.
|
|
51
|
-
"@instructure/quiz-rce": "20.11.3-rc.
|
|
47
|
+
"@instructure/quiz-common": "20.11.3-rc.21+e2d9c71bc",
|
|
48
|
+
"@instructure/quiz-i18n": "20.11.3-rc.21+e2d9c71bc",
|
|
49
|
+
"@instructure/quiz-interactions": "20.11.3-rc.21+e2d9c71bc",
|
|
50
|
+
"@instructure/quiz-number-input": "20.11.3-rc.21+e2d9c71bc",
|
|
51
|
+
"@instructure/quiz-rce": "20.11.3-rc.21+e2d9c71bc",
|
|
52
52
|
"@instructure/ui-a11y-content": "^8.51.0",
|
|
53
53
|
"@instructure/ui-alerts": "^8.51.0",
|
|
54
54
|
"@instructure/ui-avatar": "^8.51.0",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"file-saver": "~2.0.5",
|
|
113
113
|
"humps": "^2.0.0",
|
|
114
114
|
"immutable": "^3.8.1",
|
|
115
|
-
"instructure-validations": "20.11.3-rc.
|
|
115
|
+
"instructure-validations": "20.11.3-rc.21+e2d9c71bc",
|
|
116
116
|
"ipaddr.js": "^1.5.4",
|
|
117
117
|
"isomorphic-fetch": "^2.2.0",
|
|
118
118
|
"isuuid": "^0.1.0",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"intl": "^1.2.4",
|
|
164
164
|
"jquery": "^2.2.3",
|
|
165
165
|
"most-subject": "^5.3.0",
|
|
166
|
-
"quiz-presets": "20.11.3-rc.
|
|
166
|
+
"quiz-presets": "20.11.3-rc.21+e2d9c71bc",
|
|
167
167
|
"react": "^16.8.6",
|
|
168
168
|
"react-addons-test-utils": "^15.6.2",
|
|
169
169
|
"react-dom": "^16.8.6",
|
|
@@ -179,5 +179,5 @@
|
|
|
179
179
|
"publishConfig": {
|
|
180
180
|
"access": "public"
|
|
181
181
|
},
|
|
182
|
-
"gitHead": "
|
|
182
|
+
"gitHead": "e2d9c71bc54bd5aa8656a14294046fc8daad81c8"
|
|
183
183
|
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
5
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
6
|
-
import React, { Component } from 'react';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
|
-
import { TopNavBar } from '@instructure/ui-top-nav-bar';
|
|
9
|
-
import { IconQuizLine } from '@instructure/ui-icons';
|
|
10
|
-
import t from '@instructure/quiz-i18n/es/format-message';
|
|
11
|
-
|
|
12
|
-
var _ref = /*#__PURE__*/React.createElement(IconQuizLine, {
|
|
13
|
-
color: "primary",
|
|
14
|
-
size: "small"
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export var NavBar = /*#__PURE__*/function (_Component) {
|
|
18
|
-
_inherits(NavBar, _Component);
|
|
19
|
-
|
|
20
|
-
var _super = _createSuper(NavBar);
|
|
21
|
-
|
|
22
|
-
function NavBar() {
|
|
23
|
-
var _this;
|
|
24
|
-
|
|
25
|
-
_classCallCheck(this, NavBar);
|
|
26
|
-
|
|
27
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
|
-
args[_key] = arguments[_key];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
32
|
-
|
|
33
|
-
_this.hiddenActionItemsMenuTriggerLabel = function (hiddenChildrenCount) {
|
|
34
|
-
return t('{hiddenChildrenCount} more actions', {
|
|
35
|
-
hiddenChildrenCount: hiddenChildrenCount
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
_this.hiddenMenuItemsMenuTriggerLabel = function (hiddenChildrenCount) {
|
|
40
|
-
return t('{hiddenChildrenCount} More', {
|
|
41
|
-
hiddenChildrenCount: hiddenChildrenCount
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return _this;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
_createClass(NavBar, [{
|
|
49
|
-
key: "render",
|
|
50
|
-
value: function render() {
|
|
51
|
-
var _this2 = this;
|
|
52
|
-
|
|
53
|
-
return /*#__PURE__*/React.createElement(TopNavBar, {
|
|
54
|
-
breakpoint: "48em",
|
|
55
|
-
mediaQueryMatch: "element",
|
|
56
|
-
inverseColor: true
|
|
57
|
-
}, function () {
|
|
58
|
-
return /*#__PURE__*/React.createElement(TopNavBar.Layout, {
|
|
59
|
-
themeOverride: {
|
|
60
|
-
desktopBackgroundInverse: '#f5f5f5',
|
|
61
|
-
smallViewportBackgroundInverse: '#f5f5f5'
|
|
62
|
-
},
|
|
63
|
-
navLabel: t('Quizzes navigation bar'),
|
|
64
|
-
desktopConfig: {
|
|
65
|
-
hideActionsUserSeparator: true
|
|
66
|
-
},
|
|
67
|
-
smallViewportConfig: {
|
|
68
|
-
dropdownMenuToggleButtonLabel: t('Toggle Menu'),
|
|
69
|
-
dropdownMenuLabel: t('Main Menu')
|
|
70
|
-
},
|
|
71
|
-
renderBrand: /*#__PURE__*/React.createElement(TopNavBar.Brand, {
|
|
72
|
-
screenReaderLabel: t('Quizzes'),
|
|
73
|
-
renderIcon: _ref
|
|
74
|
-
}),
|
|
75
|
-
renderMenuItems: /*#__PURE__*/React.createElement(TopNavBar.MenuItems, {
|
|
76
|
-
listLabel: t('Page navigation'),
|
|
77
|
-
currentPageId: window.location.pathname,
|
|
78
|
-
renderHiddenItemsMenuTriggerLabel: _this2.hiddenMenuItemsMenuTriggerLabel
|
|
79
|
-
}, _this2.props.menuItems.map(function (menuItem) {
|
|
80
|
-
return /*#__PURE__*/React.createElement(TopNavBar.Item, {
|
|
81
|
-
id: menuItem.path,
|
|
82
|
-
key: menuItem.path,
|
|
83
|
-
onClick: function onClick() {
|
|
84
|
-
return _this2.props.handleMenuItemChange(menuItem.path);
|
|
85
|
-
} // eslint-disable-line react/jsx-no-bind
|
|
86
|
-
|
|
87
|
-
}, menuItem.text);
|
|
88
|
-
})),
|
|
89
|
-
renderActionItems: /*#__PURE__*/React.createElement(TopNavBar.ActionItems, {
|
|
90
|
-
listLabel: t('Actions'),
|
|
91
|
-
renderHiddenItemsMenuTriggerLabel: _this2.hiddenActionItemsMenuTriggerLabel
|
|
92
|
-
}, _toConsumableArray(_this2.props.actionItems))
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}]);
|
|
97
|
-
|
|
98
|
-
NavBar.displayName = "NavBar";
|
|
99
|
-
return NavBar;
|
|
100
|
-
}(Component);
|
|
101
|
-
NavBar.propTypes = {
|
|
102
|
-
menuItems: PropTypes.arrayOf(PropTypes.shape({
|
|
103
|
-
path: PropTypes.string.isRequired,
|
|
104
|
-
text: PropTypes.string.isRequired
|
|
105
|
-
})),
|
|
106
|
-
handleMenuItemChange: PropTypes.func,
|
|
107
|
-
actionItems: PropTypes.arrayOf(PropTypes.node)
|
|
108
|
-
};
|
|
109
|
-
NavBar.defaultProps = {
|
|
110
|
-
menuItems: [],
|
|
111
|
-
handleMenuItemChange: function handleMenuItemChange() {},
|
|
112
|
-
actionItems: []
|
|
113
|
-
};
|
|
114
|
-
export default NavBar;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.default = exports.NavBar = void 0;
|
|
11
|
-
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
15
|
-
|
|
16
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
21
|
-
|
|
22
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
23
|
-
|
|
24
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
25
|
-
|
|
26
|
-
var _uiTopNavBar = require("@instructure/ui-top-nav-bar");
|
|
27
|
-
|
|
28
|
-
var _uiIcons = require("@instructure/ui-icons");
|
|
29
|
-
|
|
30
|
-
var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
|
|
31
|
-
|
|
32
|
-
var _ref = /*#__PURE__*/_react.default.createElement(_uiIcons.IconQuizLine, {
|
|
33
|
-
color: "primary",
|
|
34
|
-
size: "small"
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
var NavBar = /*#__PURE__*/function (_Component) {
|
|
38
|
-
(0, _inherits2.default)(NavBar, _Component);
|
|
39
|
-
|
|
40
|
-
var _super = (0, _createSuper2.default)(NavBar);
|
|
41
|
-
|
|
42
|
-
function NavBar() {
|
|
43
|
-
var _this;
|
|
44
|
-
|
|
45
|
-
(0, _classCallCheck2.default)(this, NavBar);
|
|
46
|
-
|
|
47
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
48
|
-
args[_key] = arguments[_key];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
52
|
-
|
|
53
|
-
_this.hiddenActionItemsMenuTriggerLabel = function (hiddenChildrenCount) {
|
|
54
|
-
return (0, _formatMessage.default)('{hiddenChildrenCount} more actions', {
|
|
55
|
-
hiddenChildrenCount: hiddenChildrenCount
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
_this.hiddenMenuItemsMenuTriggerLabel = function (hiddenChildrenCount) {
|
|
60
|
-
return (0, _formatMessage.default)('{hiddenChildrenCount} More', {
|
|
61
|
-
hiddenChildrenCount: hiddenChildrenCount
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
return _this;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
(0, _createClass2.default)(NavBar, [{
|
|
69
|
-
key: "render",
|
|
70
|
-
value: function render() {
|
|
71
|
-
var _this2 = this;
|
|
72
|
-
|
|
73
|
-
return /*#__PURE__*/_react.default.createElement(_uiTopNavBar.TopNavBar, {
|
|
74
|
-
breakpoint: "48em",
|
|
75
|
-
mediaQueryMatch: "element",
|
|
76
|
-
inverseColor: true
|
|
77
|
-
}, function () {
|
|
78
|
-
return /*#__PURE__*/_react.default.createElement(_uiTopNavBar.TopNavBar.Layout, {
|
|
79
|
-
themeOverride: {
|
|
80
|
-
desktopBackgroundInverse: '#f5f5f5',
|
|
81
|
-
smallViewportBackgroundInverse: '#f5f5f5'
|
|
82
|
-
},
|
|
83
|
-
navLabel: (0, _formatMessage.default)('Quizzes navigation bar'),
|
|
84
|
-
desktopConfig: {
|
|
85
|
-
hideActionsUserSeparator: true
|
|
86
|
-
},
|
|
87
|
-
smallViewportConfig: {
|
|
88
|
-
dropdownMenuToggleButtonLabel: (0, _formatMessage.default)('Toggle Menu'),
|
|
89
|
-
dropdownMenuLabel: (0, _formatMessage.default)('Main Menu')
|
|
90
|
-
},
|
|
91
|
-
renderBrand: /*#__PURE__*/_react.default.createElement(_uiTopNavBar.TopNavBar.Brand, {
|
|
92
|
-
screenReaderLabel: (0, _formatMessage.default)('Quizzes'),
|
|
93
|
-
renderIcon: _ref
|
|
94
|
-
}),
|
|
95
|
-
renderMenuItems: /*#__PURE__*/_react.default.createElement(_uiTopNavBar.TopNavBar.MenuItems, {
|
|
96
|
-
listLabel: (0, _formatMessage.default)('Page navigation'),
|
|
97
|
-
currentPageId: window.location.pathname,
|
|
98
|
-
renderHiddenItemsMenuTriggerLabel: _this2.hiddenMenuItemsMenuTriggerLabel
|
|
99
|
-
}, _this2.props.menuItems.map(function (menuItem) {
|
|
100
|
-
return /*#__PURE__*/_react.default.createElement(_uiTopNavBar.TopNavBar.Item, {
|
|
101
|
-
id: menuItem.path,
|
|
102
|
-
key: menuItem.path,
|
|
103
|
-
onClick: function onClick() {
|
|
104
|
-
return _this2.props.handleMenuItemChange(menuItem.path);
|
|
105
|
-
} // eslint-disable-line react/jsx-no-bind
|
|
106
|
-
|
|
107
|
-
}, menuItem.text);
|
|
108
|
-
})),
|
|
109
|
-
renderActionItems: /*#__PURE__*/_react.default.createElement(_uiTopNavBar.TopNavBar.ActionItems, {
|
|
110
|
-
listLabel: (0, _formatMessage.default)('Actions'),
|
|
111
|
-
renderHiddenItemsMenuTriggerLabel: _this2.hiddenActionItemsMenuTriggerLabel
|
|
112
|
-
}, (0, _toConsumableArray2.default)(_this2.props.actionItems))
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
}]);
|
|
117
|
-
NavBar.displayName = "NavBar";
|
|
118
|
-
return NavBar;
|
|
119
|
-
}(_react.Component);
|
|
120
|
-
|
|
121
|
-
exports.NavBar = NavBar;
|
|
122
|
-
NavBar.propTypes = {
|
|
123
|
-
menuItems: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
124
|
-
path: _propTypes.default.string.isRequired,
|
|
125
|
-
text: _propTypes.default.string.isRequired
|
|
126
|
-
})),
|
|
127
|
-
handleMenuItemChange: _propTypes.default.func,
|
|
128
|
-
actionItems: _propTypes.default.arrayOf(_propTypes.default.node)
|
|
129
|
-
};
|
|
130
|
-
NavBar.defaultProps = {
|
|
131
|
-
menuItems: [],
|
|
132
|
-
handleMenuItemChange: function handleMenuItemChange() {},
|
|
133
|
-
actionItems: []
|
|
134
|
-
};
|
|
135
|
-
var _default = NavBar;
|
|
136
|
-
exports.default = _default;
|