@instructure/quiz-core 20.11.3-rc.8 → 20.11.3
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/CHANGELOG.md +12 -0
- package/es/banks/components/Bank/presenter.js +15 -7
- package/es/banks/components/BankEntry/presenter.js +5 -2
- package/es/banks/components/Banks/index.js +1 -1
- package/es/banks/components/Banks/presenter.js +0 -6
- package/es/banks/components/CreateBankModal/presenter.js +3 -1
- 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/BanksTray/presenter.js +5 -2
- 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/actions/outcomes.js +7 -1
- package/es/common/components/SDKApp/index.js +8 -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/resources/item/ItemEdit/index.js +5 -2
- package/es/common/components/resources/item/ItemEdit/presenter.js +45 -8
- 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/common/reducers/outcomes.js +6 -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 +13 -6
- package/lib/banks/components/BankEntry/presenter.js +5 -2
- package/lib/banks/components/Banks/index.js +1 -1
- package/lib/banks/components/Banks/presenter.js +0 -6
- package/lib/banks/components/CreateBankModal/presenter.js +3 -1
- 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/BanksTray/presenter.js +5 -2
- 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/actions/outcomes.js +8 -0
- package/lib/common/components/SDKApp/index.js +7 -1
- 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/resources/item/ItemEdit/index.js +5 -2
- package/lib/common/components/resources/item/ItemEdit/presenter.js +46 -8
- 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/common/reducers/outcomes.js +5 -1
- 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 +11 -11
- package/es/common/components/layout/navbar/presenter.js +0 -120
- package/lib/common/components/layout/navbar/presenter.js +0 -140
|
@@ -7,14 +7,15 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
7
7
|
|
|
8
8
|
var _dec, _class, _class2, _temp;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** @jsx jsx */
|
|
11
|
+
import { Component } from 'react';
|
|
11
12
|
import PropTypes from 'prop-types';
|
|
12
13
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
13
14
|
import first from 'lodash/first';
|
|
14
15
|
import partial from 'lodash/partial';
|
|
15
16
|
import { Button } from '@instructure/ui-buttons';
|
|
16
17
|
import { ToggleDetails } from '@instructure/ui-toggle-details';
|
|
17
|
-
import {
|
|
18
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
18
19
|
import { FILE_UPLOAD_SUCCESS, SHOULD_CLONE_ITEM, DELETED_QUIZ_ENTRY } from '@instructure/quiz-common';
|
|
19
20
|
import { propsForStimulusVersioningWrapper, propsForBankEntryVersioningWrapper } from "../../../../util/warningHelpers.js";
|
|
20
21
|
import AddToBankModal from "../../../../../banks/components/AddToBankModal/index.js";
|
|
@@ -24,25 +25,12 @@ import CustomPropTypes from "../../../../../common/util/CustomPropTypes.js";
|
|
|
24
25
|
import elementsForSelectors from "../../../../../common/util/ElementsForSelectors.js";
|
|
25
26
|
import StimulusShowInfo from "../StimulusShowInfo/index.js";
|
|
26
27
|
import StimulusEditInfo from "../StimulusEditInfo/index.js";
|
|
27
|
-
import
|
|
28
|
+
import wrapWithOutsideClickEmotion from "../../../shared/functionality/componentWithOutsideClickEmotion.js";
|
|
28
29
|
import ActionButtons from "../../../../../building/components/resources/ActionButtons/index.js";
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
template: function template(theme) {
|
|
32
|
-
return "\n\n.eCUGW_dRGY{padding-bottom:".concat(theme.stimulusPadding || 'inherit', ";padding-top:").concat(theme.stimulusPadding || 'inherit', "}\n\n.eCUGW_cjWK{display:flex;justify-content:flex-end}\n\n.eCUGW_nqth{padding-left:").concat(theme.buttonWrapperPadding || 'inherit', "}\n\n.eCUGW_fsuY{align-items:center;display:flex;height:1rem;justify-content:space-between;padding-left:").concat(theme.headerPadding || 'inherit', ";padding-right:").concat(theme.headerPadding || 'inherit', "}\n\n.eCUGW_dMwa{height:100%;padding:").concat(theme.stimulusContentPadding || 'inherit', "}\n\n.eCUGW_ffXB{color:").concat(theme.stimulusLabelColor || 'inherit', ";font-size:").concat(theme.stimulusLabelFontSize || 'inherit', "}\n\n.eCUGW_fjJt{color:").concat(theme.stimulusButtonsColor || 'inherit', ";display:inline-flex;flex:0 0 auto;text-align:right;z-index:").concat(theme.stimulusButtonsZIndex || 'inherit', "}\n\n[dir=ltr] .eCUGW_fjJt,[dir=rtl] .eCUGW_fjJt{text-align:right}\n\n.eCUGW_fjJt button{background-color:transparent;background-color:initial}\n\n.eCUGW_fBJf{padding-top:").concat(theme.optionPadding || 'inherit', "}");
|
|
33
|
-
},
|
|
34
|
-
'stimulus': 'eCUGW_dRGY',
|
|
35
|
-
'footer': 'eCUGW_cjWK',
|
|
36
|
-
'buttonWrapper': 'eCUGW_nqth',
|
|
37
|
-
'header': 'eCUGW_fsuY',
|
|
38
|
-
'stimulusContent': 'eCUGW_dMwa',
|
|
39
|
-
'stimulusLabel': 'eCUGW_ffXB',
|
|
40
|
-
'stimulusButtons': 'eCUGW_fjJt',
|
|
41
|
-
'optionWrapper': 'eCUGW_fBJf'
|
|
42
|
-
};
|
|
43
|
-
import theme from "./theme.js";
|
|
30
|
+
import generateStyle from "./styles.js";
|
|
31
|
+
import generateComponentTheme from "./theme.js";
|
|
44
32
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
45
|
-
export var StimulusEdit = (_dec =
|
|
33
|
+
export var StimulusEdit = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
46
34
|
_inherits(StimulusEdit, _Component);
|
|
47
35
|
|
|
48
36
|
var _super = _createSuper(StimulusEdit);
|
|
@@ -371,7 +359,7 @@ export var StimulusEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
371
359
|
}, {
|
|
372
360
|
key: "renderAddToBankModal",
|
|
373
361
|
value: function renderAddToBankModal() {
|
|
374
|
-
return
|
|
362
|
+
return jsx(AddToBankModal, {
|
|
375
363
|
label: t('Add to an Item Bank'),
|
|
376
364
|
onAdd: this.handleAddToBank,
|
|
377
365
|
onContinue: this.handleAddToBankContinue,
|
|
@@ -384,13 +372,13 @@ export var StimulusEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
384
372
|
}, {
|
|
385
373
|
key: "renderAddToBankOptions",
|
|
386
374
|
value: function renderAddToBankOptions() {
|
|
387
|
-
return
|
|
375
|
+
return jsx("div", null, jsx(ToggleDetails, {
|
|
388
376
|
variant: "filled",
|
|
389
377
|
key: "itemBanking",
|
|
390
378
|
summary: t('Item Banking')
|
|
391
|
-
},
|
|
392
|
-
|
|
393
|
-
},
|
|
379
|
+
}, jsx("div", {
|
|
380
|
+
css: this.props.styles.optionWrapper
|
|
381
|
+
}, jsx(AddToBankOptions, {
|
|
394
382
|
displayPosition: this.props.displayPosition,
|
|
395
383
|
entryType: this.props.quizEntry.entryType,
|
|
396
384
|
guid: this.props.guid,
|
|
@@ -403,13 +391,13 @@ export var StimulusEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
403
391
|
}, {
|
|
404
392
|
key: "renderStimulusEdit",
|
|
405
393
|
value: function renderStimulusEdit() {
|
|
406
|
-
return
|
|
407
|
-
|
|
408
|
-
},
|
|
409
|
-
|
|
410
|
-
},
|
|
411
|
-
|
|
412
|
-
}, t('Stimulus')),
|
|
394
|
+
return jsx("div", null, jsx("div", {
|
|
395
|
+
css: this.props.styles.stimulus
|
|
396
|
+
}, jsx("div", {
|
|
397
|
+
css: this.props.styles.header
|
|
398
|
+
}, jsx("div", {
|
|
399
|
+
css: this.props.styles.stimulusLabel
|
|
400
|
+
}, t('Stimulus')), jsx(ActionButtons, {
|
|
413
401
|
connectDragSource: this.props.connectDragSource,
|
|
414
402
|
displayPosition: this.props.displayPosition,
|
|
415
403
|
onDelete: this.handleDeleteStimulus,
|
|
@@ -418,25 +406,27 @@ export var StimulusEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
418
406
|
shouldDisableDragHandle: true,
|
|
419
407
|
shouldRenderEdit: false,
|
|
420
408
|
shouldFocusOnMount: this.props.shouldFocusOnMount
|
|
421
|
-
})),
|
|
422
|
-
|
|
423
|
-
},
|
|
409
|
+
})), jsx("div", {
|
|
410
|
+
css: this.props.styles.stimulusContent
|
|
411
|
+
}, jsx(StimulusEditInfo, {
|
|
424
412
|
errorsShowing: this.props.errorsShowing,
|
|
425
413
|
guid: this.props.guid,
|
|
426
414
|
stimulus: this.props.stimulus,
|
|
427
415
|
isBankedContent: this.props.isBankedContent,
|
|
428
416
|
setTitleRef: this.setTitleRef
|
|
429
|
-
}), this.renderAddToBankOptions())),
|
|
430
|
-
className:
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
417
|
+
}), this.renderAddToBankOptions())), jsx("div", {
|
|
418
|
+
className: "footer",
|
|
419
|
+
css: this.props.styles.footer
|
|
420
|
+
}, jsx("div", {
|
|
421
|
+
css: this.props.styles.buttonWrapper
|
|
422
|
+
}, jsx(Button, {
|
|
434
423
|
type: "button",
|
|
435
424
|
onClick: this.onCancel,
|
|
436
425
|
"data-automation": "sdk-stimulus-discardButton"
|
|
437
|
-
}, t('Cancel'))),
|
|
438
|
-
className:
|
|
439
|
-
|
|
426
|
+
}, t('Cancel'))), jsx("div", {
|
|
427
|
+
className: "submitButtonWrapper",
|
|
428
|
+
css: this.props.styles.buttonWrapper
|
|
429
|
+
}, jsx(Button, {
|
|
440
430
|
type: "button",
|
|
441
431
|
color: "primary",
|
|
442
432
|
disabled: !this.state.canSubmit,
|
|
@@ -449,7 +439,7 @@ export var StimulusEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
449
439
|
this.stimulusEditInfoRef = null;
|
|
450
440
|
|
|
451
441
|
if (this.props.isBankedContent) {
|
|
452
|
-
return
|
|
442
|
+
return jsx(WarningWrapper, this.props.bankEntryWarningWrapperProps(), jsx(StimulusShowInfo, this.props));
|
|
453
443
|
}
|
|
454
444
|
|
|
455
445
|
var _this$props4 = this.props,
|
|
@@ -459,7 +449,7 @@ export var StimulusEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
459
449
|
var propForWrapperFunc = quizEntry.isArchivedBankEntry ? propsForBankEntryVersioningWrapper : propsForStimulusVersioningWrapper;
|
|
460
450
|
var propsForStimulusVersioning = propForWrapperFunc(needsWarning, this.props.shouldClone, partial(this.props.setUi, SHOULD_CLONE_ITEM), this.props.switchOffEditing, true, quizEntry.isArchivedBankEntry ? 'info' : 'warning');
|
|
461
451
|
var hasWarningWrapper = needsWarning && !this.props.shouldClone;
|
|
462
|
-
return
|
|
452
|
+
return jsx(WarningWrapper, propsForStimulusVersioning, hasWarningWrapper ? jsx(StimulusShowInfo, this.props) : this.renderStimulusEdit());
|
|
463
453
|
}
|
|
464
454
|
}]);
|
|
465
455
|
|
|
@@ -504,11 +494,12 @@ export var StimulusEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp
|
|
|
504
494
|
workingQuizEntry: ImmutablePropTypes.record.isRequired,
|
|
505
495
|
workingStimulus: ImmutablePropTypes.record.isRequired,
|
|
506
496
|
onEditToggle: PropTypes.func.isRequired,
|
|
507
|
-
shouldFocusOnMount: PropTypes.bool.isRequired
|
|
497
|
+
shouldFocusOnMount: PropTypes.bool.isRequired,
|
|
498
|
+
styles: PropTypes.object
|
|
508
499
|
}, _class2.defaultProps = {
|
|
509
500
|
bankEntryWarningWrapperProps: function bankEntryWarningWrapperProps() {},
|
|
510
501
|
errorsShowing: false,
|
|
511
502
|
isBankedContent: false,
|
|
512
503
|
nextQuizEntry: null
|
|
513
504
|
}, _temp)) || _class);
|
|
514
|
-
export default
|
|
505
|
+
export default wrapWithOutsideClickEmotion(StimulusEdit);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
stimulus: {
|
|
4
|
+
paddingTop: componentTheme.stimulusPadding,
|
|
5
|
+
paddingBottom: componentTheme.stimulusPadding
|
|
6
|
+
},
|
|
7
|
+
footer: {
|
|
8
|
+
display: 'flex',
|
|
9
|
+
justifyContent: 'flex-end'
|
|
10
|
+
},
|
|
11
|
+
buttonWrapper: {
|
|
12
|
+
paddingLeft: componentTheme.buttonWrapperPadding
|
|
13
|
+
},
|
|
14
|
+
header: {
|
|
15
|
+
height: '1rem',
|
|
16
|
+
paddingLeft: componentTheme.headerPadding,
|
|
17
|
+
paddingRight: componentTheme.headerPadding,
|
|
18
|
+
display: 'flex',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
justifyContent: 'space-between'
|
|
21
|
+
},
|
|
22
|
+
stimulusContent: {
|
|
23
|
+
height: '100%',
|
|
24
|
+
padding: componentTheme.stimulusContentPadding
|
|
25
|
+
},
|
|
26
|
+
stimulusLabel: {
|
|
27
|
+
color: componentTheme.stimulusLabelColor,
|
|
28
|
+
fontSize: componentTheme.stimulusLabelFontSize
|
|
29
|
+
},
|
|
30
|
+
stimulusButtons: {
|
|
31
|
+
flex: '0 0 auto',
|
|
32
|
+
display: 'inline-flex',
|
|
33
|
+
textAlign: 'right',
|
|
34
|
+
zIndex: componentTheme.stimulusButtonsZIndex,
|
|
35
|
+
color: componentTheme.stimulusButtonsColor,
|
|
36
|
+
button: {
|
|
37
|
+
backgroundColor: 'initial'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
optionWrapper: {
|
|
41
|
+
paddingTop: componentTheme.optionPadding
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
typography = _ref.typography,
|
|
4
4
|
colors = _ref.colors;
|
|
@@ -14,4 +14,6 @@ export default function generator(_ref) {
|
|
|
14
14
|
stimulusButtonsColor: colors.oxford,
|
|
15
15
|
stimulusButtonsZIndex: '3333'
|
|
16
16
|
};
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default generateComponentTheme;
|
|
@@ -42,6 +42,7 @@ var OverlayEmotion = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
42
42
|
|
|
43
43
|
return jsx("div", {
|
|
44
44
|
role: "presentation",
|
|
45
|
+
className: "overlay",
|
|
45
46
|
css: this.props.styles.overlay,
|
|
46
47
|
onClick: this.props.onClick,
|
|
47
48
|
"data-automation": "sdk-overlay"
|
|
@@ -62,7 +63,6 @@ var OverlayEmotion = (_dec = withStyle(generateStyle, generateComponentTheme), _
|
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
}), jsx("div", {
|
|
65
|
-
className: "overlay",
|
|
66
66
|
css: [this.props.styles.root, wrapperStyles],
|
|
67
67
|
"data-testid": "overlay-wrapper",
|
|
68
68
|
tabIndex: tabIndex,
|
|
@@ -27,7 +27,8 @@ export var ReturnButton = /*#__PURE__*/function (_Component) {
|
|
|
27
27
|
|
|
28
28
|
if (this.props.iceTopNavBarEnabled) {
|
|
29
29
|
return /*#__PURE__*/React.createElement(SecondaryNavBarButton, {
|
|
30
|
-
id:
|
|
30
|
+
id: this.props.id,
|
|
31
|
+
key: this.props.id,
|
|
31
32
|
variant: "button",
|
|
32
33
|
"data-automation": "sdk-return-button",
|
|
33
34
|
href: this.props.returnToUrl,
|
|
@@ -49,11 +50,13 @@ export var ReturnButton = /*#__PURE__*/function (_Component) {
|
|
|
49
50
|
ReturnButton.propTypes = {
|
|
50
51
|
returnToUrl: PropTypes.string,
|
|
51
52
|
text: PropTypes.string,
|
|
53
|
+
id: PropTypes.string,
|
|
52
54
|
iceTopNavBarEnabled: PropTypes.bool
|
|
53
55
|
};
|
|
54
56
|
ReturnButton.defaultProps = {
|
|
55
57
|
returnToUrl: void 0,
|
|
56
58
|
text: t('Return'),
|
|
59
|
+
id: 'ReturnButton',
|
|
57
60
|
iceTopNavBarEnabled: false
|
|
58
61
|
};
|
|
59
62
|
export default ReturnButton;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { fromJS } from 'immutable';
|
|
2
|
-
import { SET_CONTEXT_UUID, SET_OUTCOMES_ENDPOINT, SET_OUTCOMES_TOKEN } from '@instructure/quiz-common';
|
|
2
|
+
import { SET_CONTEXT_UUID, SET_OUTCOMES_ENDPOINT, SET_OUTCOMES_TOKEN, SET_EXTERNAL_ACCOUNT_UUID } from '@instructure/quiz-common';
|
|
3
3
|
var defaultState = fromJS({
|
|
4
4
|
contextUuid: '',
|
|
5
5
|
outcomesEndpoint: '',
|
|
6
|
-
outcomesToken: ''
|
|
6
|
+
outcomesToken: '',
|
|
7
|
+
externalAccountUuid: ''
|
|
7
8
|
});
|
|
8
9
|
export default (function () {
|
|
9
10
|
var state = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : defaultState;
|
|
@@ -19,6 +20,9 @@ export default (function () {
|
|
|
19
20
|
case SET_OUTCOMES_TOKEN:
|
|
20
21
|
return state.set('outcomesToken', action.payload);
|
|
21
22
|
|
|
23
|
+
case SET_EXTERNAL_ACCOUNT_UUID:
|
|
24
|
+
return state.set('externalAccountUuid', action.payload);
|
|
25
|
+
|
|
22
26
|
default:
|
|
23
27
|
return state;
|
|
24
28
|
}
|
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
1
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
3
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import { Table } from '@instructure/ui-table';
|
|
10
11
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
componentId: 'cInnW',
|
|
15
|
-
template: function template(theme) {
|
|
16
|
-
return "\n\n.cInnW_cvRx{align-items:center;display:flex;height:48px;justify-content:center;width:46px}\n\n.cInnW_EKAb{background-color:".concat(theme.colorGreen || 'inherit', ";border-radius:4px 0 0 4px}\n\n.cInnW_EKAb svg{fill:#fff}\n\n.cInnW_tnta{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid;border-width:2px 0;padding:").concat(theme.cellPadding || 'inherit', "}\n\n.cInnW_fvqY{border-radius:0 4px 4px 0;border-width:2px 2px 2px 0}");
|
|
17
|
-
},
|
|
18
|
-
'iconWrapper': 'cInnW_cvRx',
|
|
19
|
-
'iconCorrect': 'cInnW_EKAb',
|
|
20
|
-
'correctRowBorder': 'cInnW_tnta',
|
|
21
|
-
'correctRowBorderRadius': 'cInnW_fvqY'
|
|
22
|
-
};
|
|
12
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
13
|
+
import generateComponentTheme from "./theme.js";
|
|
14
|
+
import generateStyle from "./styles.js";
|
|
23
15
|
import PropTypes from 'prop-types';
|
|
24
16
|
import { IconXSolid, IconCheckSolid } from '@instructure/ui-icons';
|
|
25
|
-
import classNames from 'classnames';
|
|
26
17
|
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
27
18
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
28
19
|
|
|
29
|
-
var _ref =
|
|
20
|
+
var _ref = jsx(IconCheckSolid, null);
|
|
30
21
|
|
|
31
|
-
var _ref2 =
|
|
22
|
+
var _ref2 = jsx(IconXSolid, null);
|
|
32
23
|
|
|
33
|
-
export var ChoiceTypeTableRow = (_dec =
|
|
24
|
+
export var ChoiceTypeTableRow = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
34
25
|
_inherits(ChoiceTypeTableRow, _Component);
|
|
35
26
|
|
|
36
27
|
var _super = _createSuper(ChoiceTypeTableRow);
|
|
@@ -46,26 +37,21 @@ export var ChoiceTypeTableRow = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
46
37
|
|
|
47
38
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
48
39
|
|
|
49
|
-
_this.renderIcon = function (
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, correct ? _ref : _ref2);
|
|
40
|
+
_this.renderIcon = function () {
|
|
41
|
+
return jsx("div", {
|
|
42
|
+
css: _this.props.styles.iconWrapper
|
|
43
|
+
}, _this.props.choice.correct ? _ref : _ref2);
|
|
54
44
|
};
|
|
55
45
|
|
|
56
|
-
_this.renderMiddleCell = function (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
className: className
|
|
46
|
+
_this.renderMiddleCell = function (content) {
|
|
47
|
+
return jsx("div", {
|
|
48
|
+
css: _this.props.styles.correctRowBorder
|
|
60
49
|
}, content);
|
|
61
50
|
};
|
|
62
51
|
|
|
63
|
-
_this.renderLastCell = function (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var className = classNames((_classNames3 = {}, _defineProperty(_classNames3, styles.correctRowBorder, correct), _defineProperty(_classNames3, styles.correctRowBorderRadius, correct), _classNames3));
|
|
67
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className: className
|
|
52
|
+
_this.renderLastCell = function (content) {
|
|
53
|
+
return jsx("div", {
|
|
54
|
+
css: _this.props.styles.lastRowBorder
|
|
69
55
|
}, content);
|
|
70
56
|
};
|
|
71
57
|
|
|
@@ -82,32 +68,44 @@ export var ChoiceTypeTableRow = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
82
68
|
_this.render = function () {
|
|
83
69
|
var correct = _this.props.choice.correct;
|
|
84
70
|
var choiceBody = _this.props.choice.body;
|
|
85
|
-
var cellPadding = correct ? '0' : _this.
|
|
86
|
-
return
|
|
71
|
+
var cellPadding = correct ? '0' : _this.props.styles.cellPadding;
|
|
72
|
+
return jsx(Table.Row, {
|
|
87
73
|
key: _this.props.choiceIndex
|
|
88
|
-
},
|
|
74
|
+
}, jsx(Table.Cell, {
|
|
89
75
|
themeOverride: {
|
|
90
76
|
padding: '0px'
|
|
91
77
|
}
|
|
92
|
-
},
|
|
78
|
+
}, jsx(ScreenReaderContent, null, _this.answerLabel(correct)), _this.renderIcon()), jsx(Table.RowHeader, {
|
|
93
79
|
themeOverride: {
|
|
94
80
|
padding: cellPadding
|
|
95
81
|
}
|
|
96
|
-
}, _this.renderMiddleCell(
|
|
82
|
+
}, _this.renderMiddleCell(_this.extractChoiceText(choiceBody, correct))), jsx(Table.Cell, {
|
|
97
83
|
themeOverride: {
|
|
98
84
|
padding: cellPadding
|
|
99
85
|
}
|
|
100
|
-
}, _this.renderMiddleCell(
|
|
86
|
+
}, _this.renderMiddleCell(_this.props.choice.count)), jsx(Table.Cell, {
|
|
101
87
|
themeOverride: {
|
|
102
88
|
padding: cellPadding
|
|
103
89
|
},
|
|
104
90
|
textAlign: "center"
|
|
105
|
-
}, _this.renderLastCell(
|
|
91
|
+
}, _this.renderLastCell("".concat(_this.props.choice.percentage, "%"))));
|
|
106
92
|
};
|
|
107
93
|
|
|
108
94
|
return _this;
|
|
109
95
|
}
|
|
110
96
|
|
|
97
|
+
_createClass(ChoiceTypeTableRow, [{
|
|
98
|
+
key: "componentDidMount",
|
|
99
|
+
value: function componentDidMount() {
|
|
100
|
+
this.props.makeStyles();
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
key: "componentDidUpdate",
|
|
104
|
+
value: function componentDidUpdate() {
|
|
105
|
+
this.props.makeStyles();
|
|
106
|
+
}
|
|
107
|
+
}]);
|
|
108
|
+
|
|
111
109
|
return ChoiceTypeTableRow;
|
|
112
110
|
}(Component), _class2.displayName = 'Row', _class2.propTypes = {
|
|
113
111
|
choice: PropTypes.shape({
|
|
@@ -115,6 +113,8 @@ export var ChoiceTypeTableRow = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
115
113
|
correct: PropTypes.bool,
|
|
116
114
|
count: PropTypes.number,
|
|
117
115
|
percentage: PropTypes.number
|
|
118
|
-
}),
|
|
119
|
-
choiceIndex: PropTypes.number
|
|
120
|
-
|
|
116
|
+
}).isRequired,
|
|
117
|
+
choiceIndex: PropTypes.number.isRequired,
|
|
118
|
+
styles: PropTypes.object,
|
|
119
|
+
makeStyles: PropTypes.func
|
|
120
|
+
}, _temp)) || _class);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
4
|
+
var correctRowBorderStyles = {
|
|
5
|
+
borderColor: componentTheme.colorGreen,
|
|
6
|
+
borderWidth: '2px 0',
|
|
7
|
+
borderStyle: 'solid',
|
|
8
|
+
padding: componentTheme.cellPadding
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
iconWrapper: _objectSpread({
|
|
12
|
+
display: 'flex',
|
|
13
|
+
height: '48px',
|
|
14
|
+
width: '46px',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
alignItems: 'center'
|
|
17
|
+
}, props.choice.correct && {
|
|
18
|
+
backgroundColor: componentTheme.colorGreen,
|
|
19
|
+
borderRadius: '4px 0 0 4px',
|
|
20
|
+
'svg': {
|
|
21
|
+
fill: 'white'
|
|
22
|
+
}
|
|
23
|
+
}),
|
|
24
|
+
correctRowBorder: _objectSpread({
|
|
25
|
+
borderWidth: '0'
|
|
26
|
+
}, props.choice.correct && correctRowBorderStyles),
|
|
27
|
+
correctRowBorderRadius: {
|
|
28
|
+
borderWidth: '2px 2px 2px 0',
|
|
29
|
+
borderRadius: '0 4px 4px 0'
|
|
30
|
+
},
|
|
31
|
+
lastRowBorder: _objectSpread({
|
|
32
|
+
borderWidth: '0'
|
|
33
|
+
}, props.choice.correct && _objectSpread(_objectSpread({}, correctRowBorderStyles), {}, {
|
|
34
|
+
borderWidth: '2px 2px 2px 0',
|
|
35
|
+
borderRadius: '0 4px 4px 0'
|
|
36
|
+
})),
|
|
37
|
+
cellPadding: componentTheme.cellPadding
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export default generateStyle;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
|
+
var colors = _ref.colors;
|
|
2
3
|
return {
|
|
3
|
-
colorGreen:
|
|
4
|
+
colorGreen: colors.shamrock,
|
|
4
5
|
cellPadding: '0.75rem 0.75rem'
|
|
5
6
|
};
|
|
6
|
-
}
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default generateComponentTheme;
|
|
@@ -5,26 +5,19 @@ 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 t from '@instructure/quiz-i18n/es/format-message';
|
|
10
11
|
import { Table } from '@instructure/ui-table';
|
|
11
|
-
import {
|
|
12
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
12
13
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
13
14
|
import PropTypes from 'prop-types';
|
|
14
15
|
import ChoiceTypeTableRow from "./ChoiceTypeTableRow/index.js";
|
|
15
16
|
import { choiceTypeAnswerSummaryPropType } from "../../propTypes.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
template: function template(theme) {
|
|
19
|
-
return "\n\n.fxQkB_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.fxQkB_SVtU{max-width:100%;width:calc(25% + 350px)}\n\n.fxQkB_SVtU table tbody tr th{font-weight:400}");
|
|
20
|
-
},
|
|
21
|
-
'tableWrapper': 'fxQkB_rMrG',
|
|
22
|
-
'tableContainer': 'fxQkB_SVtU'
|
|
23
|
-
};
|
|
24
|
-
import theme from "./theme.js";
|
|
17
|
+
import generateStyle from "./styles.js";
|
|
18
|
+
import generateComponentTheme from "./theme.js";
|
|
25
19
|
import AfsTableWrapper from "../shared/AfsTableWrapper/index.js";
|
|
26
|
-
|
|
27
|
-
export var LegacyChoiceType = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
20
|
+
export var LegacyChoiceType = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
28
21
|
_inherits(LegacyChoiceType, _Component);
|
|
29
22
|
|
|
30
23
|
var _super = _createSuper(LegacyChoiceType);
|
|
@@ -41,7 +34,7 @@ export var LegacyChoiceType = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
41
34
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
42
35
|
|
|
43
36
|
_this.renderRow = function (choice, choiceIndex) {
|
|
44
|
-
return
|
|
37
|
+
return jsx(ChoiceTypeTableRow, {
|
|
45
38
|
key: choiceIndex,
|
|
46
39
|
choice: choice,
|
|
47
40
|
choiceIndex: choiceIndex
|
|
@@ -55,7 +48,7 @@ export var LegacyChoiceType = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
55
48
|
correct: false,
|
|
56
49
|
count: payload.count
|
|
57
50
|
};
|
|
58
|
-
return
|
|
51
|
+
return jsx(ChoiceTypeTableRow, {
|
|
59
52
|
key: choiceIndex,
|
|
60
53
|
choice: asChoice,
|
|
61
54
|
choiceIndex: choiceIndex
|
|
@@ -78,30 +71,31 @@ export var LegacyChoiceType = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
78
71
|
var answerHeaderId = "answer-frequency-summary-answer-".concat(itemId);
|
|
79
72
|
var respondentsHeaderId = "answer-frequency-summary-respondents-".concat(itemId);
|
|
80
73
|
var percentageHeaderId = "answer-frequency-summary-percentage-".concat(itemId);
|
|
81
|
-
return
|
|
82
|
-
|
|
83
|
-
},
|
|
74
|
+
return jsx(AfsTableWrapper, null, jsx("div", {
|
|
75
|
+
css: this.props.styles.tableContainer
|
|
76
|
+
}, jsx(Table, {
|
|
84
77
|
caption: t('Answer Frequency Summary')
|
|
85
|
-
},
|
|
78
|
+
}, jsx(Table.Head, null, jsx(Table.Row, null, jsx(Table.ColHeader, {
|
|
86
79
|
id: spacingHeaderId,
|
|
87
80
|
width: "46px"
|
|
88
|
-
},
|
|
81
|
+
}, jsx(ScreenReaderContent, null, t('Answer correctness'))), jsx(Table.ColHeader, {
|
|
89
82
|
id: answerHeaderId,
|
|
90
83
|
height: "47px"
|
|
91
|
-
}, t('Answer')),
|
|
84
|
+
}, t('Answer')), jsx(Table.ColHeader, {
|
|
92
85
|
id: respondentsHeaderId,
|
|
93
86
|
height: "47px"
|
|
94
|
-
}, t('Respondents')),
|
|
87
|
+
}, t('Respondents')), jsx(Table.ColHeader, {
|
|
95
88
|
id: percentageHeaderId,
|
|
96
89
|
height: "47px",
|
|
97
90
|
textAlign: "center"
|
|
98
|
-
}, t('Percentage')))),
|
|
91
|
+
}, t('Percentage')))), jsx(Table.Body, null, choices.map(this.renderRow), this.renderNoAnswer(noAnswer, numberOfChoices)))));
|
|
99
92
|
}
|
|
100
93
|
}]);
|
|
101
94
|
|
|
102
95
|
LegacyChoiceType.displayName = "LegacyChoiceType";
|
|
103
96
|
return LegacyChoiceType;
|
|
104
97
|
}(Component), _class2.propTypes = {
|
|
105
|
-
itemId: PropTypes.number,
|
|
106
|
-
answerSummary: choiceTypeAnswerSummaryPropType
|
|
107
|
-
|
|
98
|
+
itemId: PropTypes.number.isRequired,
|
|
99
|
+
answerSummary: choiceTypeAnswerSummaryPropType.isRequired,
|
|
100
|
+
styles: PropTypes.object
|
|
101
|
+
}, _temp)) || _class);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
tableWrapper: {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
flexBasis: '100%',
|
|
6
|
+
flexDirection: 'column',
|
|
7
|
+
paddingBottom: componentTheme.tableBottomPadding
|
|
8
|
+
},
|
|
9
|
+
tableContainer: {
|
|
10
|
+
width: 'calc(25% + 350px)',
|
|
11
|
+
maxWidth: '100%',
|
|
12
|
+
'table tbody tr th': {
|
|
13
|
+
fontWeight: '400'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default generateStyle;
|