@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
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
iconWrapper: {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
height: '100%',
|
|
6
|
+
minHeight: '47px',
|
|
7
|
+
width: '46px',
|
|
8
|
+
justifyContent: 'center',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
'svg': {
|
|
11
|
+
fill: 'white'
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
collapsingTable: {
|
|
15
|
+
minWidth: '500px',
|
|
16
|
+
'table': {
|
|
17
|
+
borderCollapse: 'separate',
|
|
18
|
+
borderSpacing: '0 12px'
|
|
19
|
+
},
|
|
20
|
+
'thead th': {
|
|
21
|
+
borderWidth: '0 0 1px 0',
|
|
22
|
+
borderStyle: 'solid',
|
|
23
|
+
borderColor: componentTheme.colorHeaderBottomBorder
|
|
24
|
+
},
|
|
25
|
+
'table tbody tr td': {
|
|
26
|
+
width: '33.33%',
|
|
27
|
+
borderStyle: 'solid',
|
|
28
|
+
borderWidth: '2px 0 2px 0'
|
|
29
|
+
},
|
|
30
|
+
'table tbody tr th:first-of-type': {
|
|
31
|
+
borderStyle: 'solid',
|
|
32
|
+
borderRadius: '4px 0 0 4px',
|
|
33
|
+
borderWidth: '2px 0 2px 2px',
|
|
34
|
+
fontWeight: '400'
|
|
35
|
+
},
|
|
36
|
+
'table tbody tr td:last-child': {
|
|
37
|
+
borderStyle: 'solid',
|
|
38
|
+
borderWidth: '2px 2px 2px 0',
|
|
39
|
+
borderRadius: '0 4px 4px 0'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
onlyNoanswer: {
|
|
43
|
+
'tbody tr:nth-of-type(1) td': {
|
|
44
|
+
borderColor: componentTheme.colorGrey
|
|
45
|
+
},
|
|
46
|
+
'table tbody tr:nth-of-type(1) th': {
|
|
47
|
+
borderColor: componentTheme.colorGrey
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
correctIncorrect: {
|
|
51
|
+
'table tbody tr:nth-of-type(1) td': {
|
|
52
|
+
borderColor: componentTheme.colorGreen
|
|
53
|
+
},
|
|
54
|
+
'table tbody tr:nth-of-type(1) th': {
|
|
55
|
+
borderColor: componentTheme.colorGreen
|
|
56
|
+
},
|
|
57
|
+
'table tbody tr:nth-of-type(2) td': {
|
|
58
|
+
borderColor: componentTheme.colorRed
|
|
59
|
+
},
|
|
60
|
+
'table tbody tr:nth-of-type(2) th': {
|
|
61
|
+
borderColor: componentTheme.colorRed
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
correctIncorrectNoanswer: {
|
|
65
|
+
'table tbody tr:nth-of-type(1) td': {
|
|
66
|
+
borderColor: componentTheme.colorGreen
|
|
67
|
+
},
|
|
68
|
+
'table tbody tr:nth-of-type(1) th': {
|
|
69
|
+
borderColor: componentTheme.colorGreen
|
|
70
|
+
},
|
|
71
|
+
'table tbody tr:nth-of-type(2) td': {
|
|
72
|
+
borderColor: componentTheme.colorRed
|
|
73
|
+
},
|
|
74
|
+
'table tbody tr:nth-of-type(2) th': {
|
|
75
|
+
borderColor: componentTheme.colorRed
|
|
76
|
+
},
|
|
77
|
+
'table tbody tr:nth-of-type(3) td': {
|
|
78
|
+
borderColor: componentTheme.colorGrey
|
|
79
|
+
},
|
|
80
|
+
'table tbody tr:nth-of-type(3) th': {
|
|
81
|
+
borderColor: componentTheme.colorGrey
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
correctIncorrectNoanswerGraded: {
|
|
85
|
+
'table tbody tr:nth-of-type(1) td': {
|
|
86
|
+
borderColor: componentTheme.colorGreen
|
|
87
|
+
},
|
|
88
|
+
'table tbody tr:nth-of-type(1) th': {
|
|
89
|
+
borderColor: componentTheme.colorGreen
|
|
90
|
+
},
|
|
91
|
+
'table tbody tr:nth-of-type(2) td': {
|
|
92
|
+
borderColor: componentTheme.colorBlue
|
|
93
|
+
},
|
|
94
|
+
'table tbody tr:nth-of-type(2) th': {
|
|
95
|
+
borderColor: componentTheme.colorBlue
|
|
96
|
+
},
|
|
97
|
+
'table tbody tr:nth-of-type(3) td': {
|
|
98
|
+
borderColor: componentTheme.colorRed
|
|
99
|
+
},
|
|
100
|
+
'table tbody tr:nth-of-type(3) th': {
|
|
101
|
+
borderColor: componentTheme.colorRed
|
|
102
|
+
},
|
|
103
|
+
'table tbody tr:nth-of-type(4) td': {
|
|
104
|
+
borderColor: componentTheme.colorGrey
|
|
105
|
+
},
|
|
106
|
+
'table tbody tr:nth-of-type(4) th': {
|
|
107
|
+
borderColor: componentTheme.colorGrey
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
correctBackground: {
|
|
111
|
+
backgroundColor: componentTheme.colorGreen
|
|
112
|
+
},
|
|
113
|
+
incorrectBackground: {
|
|
114
|
+
backgroundColor: componentTheme.colorRed
|
|
115
|
+
},
|
|
116
|
+
gradedBackground: {
|
|
117
|
+
backgroundColor: componentTheme.colorBlue
|
|
118
|
+
},
|
|
119
|
+
noAnswerBackground: {
|
|
120
|
+
backgroundColor: componentTheme.colorGrey
|
|
121
|
+
},
|
|
122
|
+
labelWrapper: {
|
|
123
|
+
padding: '12px 0 12px 10px'
|
|
124
|
+
},
|
|
125
|
+
firstHeaderCell: {
|
|
126
|
+
paddingLeft: '45px'
|
|
127
|
+
},
|
|
128
|
+
iconWhite: {
|
|
129
|
+
'svg': {
|
|
130
|
+
fill: 'white'
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
headerCell: {
|
|
134
|
+
borderWidth: '0 0 1px 0',
|
|
135
|
+
borderStyle: 'solid',
|
|
136
|
+
borderColor: componentTheme.colorHeaderBottomBorder
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export default generateStyle;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
|
+
var colors = _ref.colors;
|
|
2
3
|
return {
|
|
3
|
-
colorGreen:
|
|
4
|
-
colorBlue:
|
|
5
|
-
colorRed:
|
|
6
|
-
colorGrey:
|
|
7
|
-
colorHeaderBottomBorder:
|
|
4
|
+
colorGreen: colors.shamrock,
|
|
5
|
+
colorBlue: colors.brand,
|
|
6
|
+
colorRed: colors.crimson,
|
|
7
|
+
colorGrey: colors.ash,
|
|
8
|
+
colorHeaderBottomBorder: colors.tiara,
|
|
8
9
|
cellPadding: '13.5px 13.5px;'
|
|
9
10
|
};
|
|
10
|
-
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default generateComponentTheme;
|
|
@@ -1,54 +1,40 @@
|
|
|
1
1
|
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
4
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
5
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _dec, _class, _class2, _temp;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
import { Component } from 'react';
|
|
10
11
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
11
12
|
import { Table } from '@instructure/ui-table';
|
|
12
|
-
import {
|
|
13
|
+
import { withStyle, jsx, css } from '@instructure/emotion';
|
|
13
14
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
14
15
|
import PropTypes from 'prop-types';
|
|
15
16
|
import { choiceTypeObject } from "../../../propTypes.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
template: function template(theme) {
|
|
19
|
-
return "\n\n.cYrxJ_rMrG{display:flex;flex-basis:100%;flex-direction:column;padding-bottom:".concat(theme.tableBottomPadding || 'inherit', "}\n\n.cYrxJ_fgIl{max-width:100%;width:calc(25% + 350px)}\n\n.cYrxJ_SVtU table{border-collapse:separate;border-spacing:0 1px}\n\n.cYrxJ_eviJ table thead tr td,.cYrxJ_eviJ table thead tr th{border-bottom:solid 0.0625rem ").concat(theme.colorGray || 'inherit', "}\n\n.cYrxJ_SVtU table tbody tr th{font-weight:400;width:33.33%}\n\n.cYrxJ_SVtU table tbody tr td{width:33.33%}\n\n.cYrxJ_cvRx{align-items:center;display:flex;height:100%;justify-content:center;min-height:47px;width:46px}\n\n.cYrxJ_EKAb{background-color:").concat(theme.colorGreen || 'inherit', "}\n\n.cYrxJ_EKAb svg{fill:#fff}\n\n.cYrxJ_cCmC{align-items:center;display:flex;height:calc(100% - 4px);justify-content:center}\n\n.cYrxJ_dJVn{padding:").concat(theme.cellPadding || 'inherit', "}\n\n.cYrxJ_eEOp td,.cYrxJ_eEOp th{border-bottom:solid 0.0625rem ").concat(theme.colorGray || 'inherit', "}\n\n.cYrxJ_UAZE td{border-width:2px 0 2px 0}\n\n.cYrxJ_UAZE td,.cYrxJ_UAZE th:first-child{border-color:").concat(theme.colorGreen || 'inherit', ";border-style:solid}\n\n.cYrxJ_UAZE th:first-child{border-radius:4px 0 0 4px;border-width:2px 0 2px 2px}\n\n.cYrxJ_UAZE td:last-child{border-color:").concat(theme.colorGreen || 'inherit', ";border-radius:0 4px 4px 0;border-style:solid;border-width:2px 2px 2px 0}");
|
|
20
|
-
},
|
|
21
|
-
'tableWrapper': 'cYrxJ_rMrG',
|
|
22
|
-
'tableWidthMax': 'cYrxJ_fgIl',
|
|
23
|
-
'tableContainer': 'cYrxJ_SVtU',
|
|
24
|
-
'headerGrayBottomBorder': 'cYrxJ_eviJ',
|
|
25
|
-
'iconWrapper': 'cYrxJ_cvRx',
|
|
26
|
-
'iconCorrect': 'cYrxJ_EKAb',
|
|
27
|
-
'textContainer': 'cYrxJ_cCmC',
|
|
28
|
-
'firstTextContainer': 'cYrxJ_dJVn',
|
|
29
|
-
'incorrectRow': 'cYrxJ_eEOp',
|
|
30
|
-
'correctRow': 'cYrxJ_UAZE'
|
|
31
|
-
};
|
|
32
|
-
import theme from "./theme.js";
|
|
33
|
-
import classNames from 'classnames';
|
|
17
|
+
import generateStyle from "./styles.js";
|
|
18
|
+
import generateComponentTheme from "./theme.js";
|
|
34
19
|
import { IconCheckSolid, IconXSolid } from '@instructure/ui-icons';
|
|
35
20
|
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
36
21
|
import { Flex } from '@instructure/ui-flex';
|
|
37
22
|
import { Text } from '@instructure/ui-text';
|
|
38
23
|
var correctAttribute = 'correct';
|
|
39
24
|
var incorrectAttribute = 'incorrect';
|
|
40
|
-
var rowStyleMap = (_rowStyleMap = {}, _defineProperty(_rowStyleMap, correctAttribute, styles.correctRow), _defineProperty(_rowStyleMap, incorrectAttribute, styles.incorrectRow), _rowStyleMap);
|
|
41
25
|
|
|
42
|
-
var _ref =
|
|
26
|
+
var _ref = jsx(IconCheckSolid, null);
|
|
43
27
|
|
|
44
|
-
var _ref2 =
|
|
28
|
+
var _ref2 = jsx(IconXSolid, null);
|
|
45
29
|
|
|
46
|
-
export var ChoiceTypeTable = (_dec =
|
|
30
|
+
export var ChoiceTypeTable = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
47
31
|
_inherits(ChoiceTypeTable, _Component);
|
|
48
32
|
|
|
49
33
|
var _super = _createSuper(ChoiceTypeTable);
|
|
50
34
|
|
|
51
35
|
function ChoiceTypeTable() {
|
|
36
|
+
var _this$rowStyleMap;
|
|
37
|
+
|
|
52
38
|
var _this;
|
|
53
39
|
|
|
54
40
|
_classCallCheck(this, ChoiceTypeTable);
|
|
@@ -58,25 +44,24 @@ export var ChoiceTypeTable = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
58
44
|
}
|
|
59
45
|
|
|
60
46
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
47
|
+
_this.rowStyleMap = (_this$rowStyleMap = {}, _defineProperty(_this$rowStyleMap, correctAttribute, _this.props.styles.correctRow), _defineProperty(_this$rowStyleMap, incorrectAttribute, _this.props.styles.incorrectRow), _this$rowStyleMap);
|
|
61
48
|
|
|
62
49
|
_this.renderIcon = function (correct) {
|
|
63
|
-
var
|
|
64
|
-
return
|
|
65
|
-
|
|
50
|
+
var iconStyles = [_this.props.styles.iconWrapper, correct ? _this.props.styles.iconCorrect : {}];
|
|
51
|
+
return jsx("div", {
|
|
52
|
+
css: iconStyles
|
|
66
53
|
}, correct ? _ref : _ref2);
|
|
67
54
|
};
|
|
68
55
|
|
|
69
56
|
_this.renderFirstCell = function (content) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
className: className
|
|
57
|
+
return jsx("div", {
|
|
58
|
+
css: _this.props.styles.firstTextContainer
|
|
73
59
|
}, content);
|
|
74
60
|
};
|
|
75
61
|
|
|
76
62
|
_this.renderCell = function (content) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
className: className
|
|
63
|
+
return jsx("div", {
|
|
64
|
+
css: _this.props.styles.textContainer
|
|
80
65
|
}, content);
|
|
81
66
|
};
|
|
82
67
|
|
|
@@ -113,30 +98,30 @@ export var ChoiceTypeTable = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
113
98
|
var extractedBody = _this.extractChoiceText(body, correct);
|
|
114
99
|
|
|
115
100
|
var screenReaderContent = "".concat(_this.answerLabel(correct), ": ").concat(extractedBody);
|
|
116
|
-
return
|
|
101
|
+
return jsx(Table.Row, {
|
|
117
102
|
key: choiceIndex
|
|
118
|
-
},
|
|
103
|
+
}, jsx(Table.RowHeader, {
|
|
119
104
|
themeOverride: {
|
|
120
105
|
padding: '0'
|
|
121
106
|
}
|
|
122
|
-
},
|
|
107
|
+
}, jsx(ScreenReaderContent, null, screenReaderContent), jsx(Flex, {
|
|
123
108
|
direction: "row",
|
|
124
109
|
alignItems: "center"
|
|
125
|
-
},
|
|
110
|
+
}, jsx(Flex.Item, {
|
|
126
111
|
width: "46px",
|
|
127
112
|
textAlign: "center",
|
|
128
113
|
align: "stretch"
|
|
129
|
-
},
|
|
114
|
+
}, jsx("div", {
|
|
130
115
|
"data-icon": _this.getDataIconAttribute(correct, choiceIndex),
|
|
131
|
-
|
|
132
|
-
}, _this.renderIcon(correct))),
|
|
116
|
+
css: _this.props.styles.iconWrapper
|
|
117
|
+
}, _this.renderIcon(correct))), jsx(Flex.Item, {
|
|
133
118
|
shouldShrink: true,
|
|
134
119
|
shouldGrow: true
|
|
135
|
-
},
|
|
120
|
+
}, jsx(Text, null, _this.renderFirstCell(extractedBody))))), jsx(Table.Cell, {
|
|
136
121
|
themeOverride: {
|
|
137
122
|
padding: '0'
|
|
138
123
|
}
|
|
139
|
-
}, _this.renderCell(choice.count)),
|
|
124
|
+
}, _this.renderCell(choice.count)), jsx(Table.Cell, {
|
|
140
125
|
themeOverride: {
|
|
141
126
|
padding: '0'
|
|
142
127
|
},
|
|
@@ -145,17 +130,48 @@ export var ChoiceTypeTable = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
145
130
|
};
|
|
146
131
|
|
|
147
132
|
_this.componentDidMount = function () {
|
|
133
|
+
_this.applyStylesToTable();
|
|
134
|
+
|
|
135
|
+
_this.props.makeStyles();
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
_this.componentDidUpdate = function () {
|
|
139
|
+
_this.props.makeStyles();
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
_this.applyStylesToTable = function () {
|
|
148
143
|
if (_this.tableRef) {
|
|
149
144
|
var _iterator = _createForOfIteratorHelper(_this.tableRef.rows),
|
|
150
145
|
_step;
|
|
151
146
|
|
|
152
147
|
try {
|
|
153
|
-
|
|
148
|
+
var _loop = function _loop() {
|
|
154
149
|
var _row$querySelector, _row$querySelector$da;
|
|
155
150
|
|
|
156
151
|
var row = _step.value;
|
|
157
152
|
var icon = (_row$querySelector = row.querySelector('tr th:first-child [data-icon]')) === null || _row$querySelector === void 0 ? void 0 : (_row$querySelector$da = _row$querySelector.dataset) === null || _row$querySelector$da === void 0 ? void 0 : _row$querySelector$da.icon;
|
|
158
|
-
row.
|
|
153
|
+
var td = row.querySelectorAll('td');
|
|
154
|
+
var th = row.querySelectorAll('th');
|
|
155
|
+
|
|
156
|
+
if (icon) {
|
|
157
|
+
td.forEach(function (cell) {
|
|
158
|
+
cell.setAttribute('style', css(_this.rowStyleMap[icon].td).styles);
|
|
159
|
+
});
|
|
160
|
+
th.forEach(function (cell) {
|
|
161
|
+
cell.setAttribute('style', css(_this.rowStyleMap[icon].th).styles);
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
if (icon === correctAttribute) {
|
|
165
|
+
row.querySelector('th:first-child').setAttribute('style', css(_this.props.styles.correctRow.thFirstChild).styles);
|
|
166
|
+
row.querySelector('td:last-child').setAttribute('style', css(_this.props.styles.correctRow.tdLastChild).styles);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
row.setAttribute('style', css(_this.rowStyleMap[icon]).styles);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
174
|
+
_loop();
|
|
159
175
|
}
|
|
160
176
|
} catch (err) {
|
|
161
177
|
_iterator.e(err);
|
|
@@ -172,32 +188,31 @@ export var ChoiceTypeTable = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
172
188
|
_this.render = function () {
|
|
173
189
|
var _this$props = _this.props,
|
|
174
190
|
choices = _this$props.choices,
|
|
175
|
-
itemId = _this$props.itemId
|
|
176
|
-
tableContainerSizeClass = _this$props.tableContainerSizeClass;
|
|
191
|
+
itemId = _this$props.itemId;
|
|
177
192
|
var answerHeaderId = "answer-frequency-summary-answer-".concat(itemId);
|
|
178
193
|
var respondentsHeaderId = "answer-frequency-summary-respondents-".concat(itemId);
|
|
179
194
|
var percentageHeaderId = "answer-frequency-summary-percentage-".concat(itemId);
|
|
180
|
-
var
|
|
181
|
-
return
|
|
182
|
-
|
|
183
|
-
},
|
|
195
|
+
var containerStyles = [_this.props.styles.tableContainer, !_this.nextChoiceIsCorrect(choices, 0) ? _this.props.styles.headerGrayBottomBorder : {}];
|
|
196
|
+
return jsx("div", {
|
|
197
|
+
css: containerStyles
|
|
198
|
+
}, jsx(Table, {
|
|
184
199
|
caption: t('Answer Frequency Summary'),
|
|
185
200
|
elementRef: _this.setTableRef
|
|
186
|
-
},
|
|
201
|
+
}, jsx(Table.Head, null, jsx(Table.Row, null, jsx(Table.ColHeader, {
|
|
187
202
|
id: answerHeaderId,
|
|
188
203
|
height: "47px",
|
|
189
204
|
themeOverride: {
|
|
190
205
|
padding: '0 0 0 57px'
|
|
191
206
|
}
|
|
192
|
-
}, t('Answer')),
|
|
207
|
+
}, t('Answer')), jsx(Table.ColHeader, {
|
|
193
208
|
id: respondentsHeaderId,
|
|
194
209
|
height: "47px",
|
|
195
210
|
textAlign: "center"
|
|
196
|
-
}, t('Respondents')),
|
|
211
|
+
}, t('Respondents')), jsx(Table.ColHeader, {
|
|
197
212
|
id: percentageHeaderId,
|
|
198
213
|
height: "47px",
|
|
199
214
|
textAlign: "center"
|
|
200
|
-
}, t('Percentage')))),
|
|
215
|
+
}, t('Percentage')))), jsx(Table.Body, null, choices.map(_this.renderRow))));
|
|
201
216
|
};
|
|
202
217
|
|
|
203
218
|
return _this;
|
|
@@ -205,9 +220,13 @@ export var ChoiceTypeTable = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
205
220
|
|
|
206
221
|
return ChoiceTypeTable;
|
|
207
222
|
}(Component), _class2.propTypes = {
|
|
208
|
-
itemId: PropTypes.number,
|
|
209
|
-
choices: PropTypes.arrayOf(choiceTypeObject),
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
223
|
+
itemId: PropTypes.number.isRequired,
|
|
224
|
+
choices: PropTypes.arrayOf(choiceTypeObject).isRequired,
|
|
225
|
+
|
|
226
|
+
/* eslint-disable-next-line react/no-unused-prop-types */
|
|
227
|
+
tableContainerStyles: PropTypes.object,
|
|
228
|
+
styles: PropTypes.object,
|
|
229
|
+
makeStyles: PropTypes.func
|
|
230
|
+
}, _class2.defaultProps = {
|
|
231
|
+
tableContainerStyles: void 0
|
|
213
232
|
}, _temp)) || _class);
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme, props) {
|
|
4
|
+
var tableContainerStyles = props.tableContainerStyles || {
|
|
5
|
+
width: 'calc(25% + 350px)',
|
|
6
|
+
maxWidth: '100%'
|
|
7
|
+
};
|
|
8
|
+
return {
|
|
9
|
+
tableWrapper: {
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexBasis: '100%',
|
|
12
|
+
flexDirection: 'column',
|
|
13
|
+
paddingBottom: componentTheme.tableBottomPadding
|
|
14
|
+
},
|
|
15
|
+
tableWidthMax: {},
|
|
16
|
+
tableContainer: _objectSpread(_objectSpread({}, tableContainerStyles), {}, {
|
|
17
|
+
'table': {
|
|
18
|
+
borderCollapse: 'separate',
|
|
19
|
+
borderSpacing: '0 1px'
|
|
20
|
+
},
|
|
21
|
+
'table tbody tr td:': {
|
|
22
|
+
width: '33.33%'
|
|
23
|
+
},
|
|
24
|
+
'table tbody tr th': {
|
|
25
|
+
fontWeight: '400',
|
|
26
|
+
width: '33.33%'
|
|
27
|
+
}
|
|
28
|
+
}),
|
|
29
|
+
headerGrayBottomBorder: {
|
|
30
|
+
'table thead tr th': {
|
|
31
|
+
borderBottom: "solid 0.0625rem ".concat(componentTheme.colorGray)
|
|
32
|
+
},
|
|
33
|
+
'table thead tr td': {
|
|
34
|
+
borderBottom: "solid 0.0625rem ".concat(componentTheme.colorGray)
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
iconWrapper: {
|
|
38
|
+
display: 'flex',
|
|
39
|
+
height: '100%',
|
|
40
|
+
minHeight: '47px',
|
|
41
|
+
width: '46px',
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
alignItems: 'center'
|
|
44
|
+
},
|
|
45
|
+
iconCorrect: {
|
|
46
|
+
backgroundColor: componentTheme.colorGreen,
|
|
47
|
+
'svg': {
|
|
48
|
+
fill: 'white'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
textContainer: {
|
|
52
|
+
height: 'calc(100% - 4px)',
|
|
53
|
+
display: 'flex',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
justifyContent: 'center'
|
|
56
|
+
},
|
|
57
|
+
firstTextContainer: {
|
|
58
|
+
padding: componentTheme.cellPadding
|
|
59
|
+
},
|
|
60
|
+
incorrectRow: {
|
|
61
|
+
td: {
|
|
62
|
+
borderBottom: "solid 0.0625rem ".concat(componentTheme.colorGray)
|
|
63
|
+
},
|
|
64
|
+
th: {
|
|
65
|
+
borderBottom: "solid 0.0625rem ".concat(componentTheme.colorGray)
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
correctRow: {
|
|
69
|
+
td: {
|
|
70
|
+
borderStyle: 'solid',
|
|
71
|
+
borderWidth: '2px 0 2px 0',
|
|
72
|
+
borderColor: componentTheme.colorGreen
|
|
73
|
+
},
|
|
74
|
+
th: {
|
|
75
|
+
border: 0
|
|
76
|
+
},
|
|
77
|
+
thFirstChild: {
|
|
78
|
+
borderStyle: 'solid',
|
|
79
|
+
borderRadius: '4px 0 0 4px',
|
|
80
|
+
borderWidth: '2px 0 2px 2px',
|
|
81
|
+
borderColor: componentTheme.colorGreen
|
|
82
|
+
},
|
|
83
|
+
tdLastChild: {
|
|
84
|
+
borderStyle: 'solid',
|
|
85
|
+
borderWidth: '2px 2px 2px 0',
|
|
86
|
+
borderRadius: '0 4px 4px 0',
|
|
87
|
+
borderColor: componentTheme.colorGreen
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export default generateStyle;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
var spacing = _ref.spacing
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
|
+
var spacing = _ref.spacing,
|
|
3
|
+
colors = _ref.colors;
|
|
3
4
|
return {
|
|
4
5
|
tableBottomPadding: spacing.medium,
|
|
5
|
-
colorGreen:
|
|
6
|
-
colorGray:
|
|
6
|
+
colorGreen: colors.shamrock,
|
|
7
|
+
colorGray: colors.tiara,
|
|
7
8
|
cellPadding: '0.75rem 0.75rem'
|
|
8
9
|
};
|
|
9
|
-
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default generateComponentTheme;
|
|
@@ -5,7 +5,8 @@ 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 { View } from '@instructure/ui-view';
|
|
10
11
|
import { CloseButton, IconButton } from '@instructure/ui-buttons';
|
|
11
12
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
@@ -13,23 +14,16 @@ import { IconInfoLine } from '@instructure/ui-icons';
|
|
|
13
14
|
import { Text } from '@instructure/ui-text';
|
|
14
15
|
import { Popover } from '@instructure/ui-popover';
|
|
15
16
|
import { Heading } from '@instructure/ui-heading';
|
|
16
|
-
import {
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
componentId: 'fSfiS',
|
|
20
|
-
template: function template(theme) {
|
|
21
|
-
return "\n\n.fSfiS_CkEK{padding-bottom:".concat(theme.headerPaddingBottom || 'inherit', "}\n\n.fSfiS_fSpJ{display:flex;justify-content:flex-end;margin-right:-10px;margin-top:-10px}");
|
|
22
|
-
},
|
|
23
|
-
'headerContainer': 'fSfiS_CkEK',
|
|
24
|
-
'closeIconContainer': 'fSfiS_fSpJ'
|
|
25
|
-
};
|
|
17
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
18
|
+
import generateComponentTheme from "./theme.js";
|
|
19
|
+
import generateStyle from "./styles.js";
|
|
26
20
|
import PropTypes from 'prop-types';
|
|
27
21
|
|
|
28
|
-
var _ref =
|
|
22
|
+
var _ref = jsx(IconInfoLine, {
|
|
29
23
|
size: "x-small"
|
|
30
24
|
});
|
|
31
25
|
|
|
32
|
-
export var MetricPopover = (_dec =
|
|
26
|
+
export var MetricPopover = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
33
27
|
_inherits(MetricPopover, _Component);
|
|
34
28
|
|
|
35
29
|
var _super = _createSuper(MetricPopover);
|
|
@@ -61,7 +55,7 @@ export var MetricPopover = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
61
55
|
};
|
|
62
56
|
|
|
63
57
|
_this.render = function () {
|
|
64
|
-
return
|
|
58
|
+
return jsx(Popover, {
|
|
65
59
|
renderTrigger: _this.renderPopoverTrigger(),
|
|
66
60
|
on: "click",
|
|
67
61
|
screenReaderLabel: _this.props.screenReaderLabel,
|
|
@@ -70,27 +64,26 @@ export var MetricPopover = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
70
64
|
onShowContent: _this.showPopover,
|
|
71
65
|
onHideContent: _this.hidePopover,
|
|
72
66
|
isShowingContent: _this.state.isContentVisible
|
|
73
|
-
},
|
|
67
|
+
}, jsx(View, {
|
|
74
68
|
padding: "medium",
|
|
75
69
|
as: "div",
|
|
76
70
|
display: "block",
|
|
77
71
|
width: "248px"
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
},
|
|
72
|
+
}, jsx("div", {
|
|
73
|
+
css: _this.props.styles.closeIconContainer
|
|
74
|
+
}, jsx(CloseButton, {
|
|
81
75
|
onClick: _this.hidePopover,
|
|
82
76
|
screenReaderLabel: t('Close popover')
|
|
83
|
-
})),
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
className: styles.popoverTitle,
|
|
77
|
+
})), jsx("div", {
|
|
78
|
+
css: _this.props.styles.headerContainer
|
|
79
|
+
}, jsx(Heading, {
|
|
87
80
|
level: "h3"
|
|
88
|
-
}, _this.props.title)),
|
|
81
|
+
}, _this.props.title)), jsx("div", null, _this.props.subtitle && jsx(Heading, {
|
|
89
82
|
themeOverride: {
|
|
90
83
|
h5FontWeight: 700
|
|
91
84
|
},
|
|
92
85
|
level: "h5"
|
|
93
|
-
}, _this.props.subtitle),
|
|
86
|
+
}, _this.props.subtitle), jsx(Text, {
|
|
94
87
|
size: "small"
|
|
95
88
|
}, _this.props.body))));
|
|
96
89
|
};
|
|
@@ -99,9 +92,19 @@ export var MetricPopover = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
99
92
|
}
|
|
100
93
|
|
|
101
94
|
_createClass(MetricPopover, [{
|
|
95
|
+
key: "componentDidMount",
|
|
96
|
+
value: function componentDidMount() {
|
|
97
|
+
this.props.makeStyles();
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
key: "componentDidUpdate",
|
|
101
|
+
value: function componentDidUpdate() {
|
|
102
|
+
this.props.makeStyles();
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
102
105
|
key: "renderPopoverTrigger",
|
|
103
106
|
value: function renderPopoverTrigger() {
|
|
104
|
-
return
|
|
107
|
+
return jsx(IconButton, {
|
|
105
108
|
size: "small",
|
|
106
109
|
themeOverride: {
|
|
107
110
|
smallHeight: '18px',
|
|
@@ -120,7 +123,9 @@ export var MetricPopover = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
120
123
|
screenReaderLabel: PropTypes.string.isRequired,
|
|
121
124
|
title: PropTypes.string.isRequired,
|
|
122
125
|
subtitle: PropTypes.string,
|
|
123
|
-
body: PropTypes.string.isRequired
|
|
126
|
+
body: PropTypes.string.isRequired,
|
|
127
|
+
styles: PropTypes.object,
|
|
128
|
+
makeStyles: PropTypes.func
|
|
124
129
|
}, _class2.defaultProps = {
|
|
125
130
|
subtitle: ''
|
|
126
131
|
}, _temp)) || _class);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
headerContainer: {
|
|
4
|
+
paddingBottom: componentTheme.headerPaddingBottom
|
|
5
|
+
},
|
|
6
|
+
closeIconContainer: {
|
|
7
|
+
display: 'flex',
|
|
8
|
+
justifyContent: 'flex-end',
|
|
9
|
+
marginRight: '-10px',
|
|
10
|
+
marginTop: '-10px'
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default generateStyle;
|