@pocketprep/ui-kit 3.4.68 → 3.4.70

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.
@@ -15,7 +15,9 @@
15
15
  class="uikit-question-matrix-choices-container__column-row-header"
16
16
  :class="{
17
17
  'uikit-question-matrix-choices-container__column-row-header--two-columns':
18
- numberOfMatrixColumnLabels === 2
18
+ numberOfMatrixColumnLabels === 2,
19
+ 'uikit-question-matrix-choices-container__column-row-header--radio-btn-three-columns':
20
+ question.type === 'Matrix Radio Button' && numberOfMatrixColumnLabels === 3
19
21
  }"
20
22
  v-html="matrixColumnLabelsForRows"
21
23
  />
@@ -23,7 +25,9 @@
23
25
  class="uikit-question-matrix-choices-container__column-header"
24
26
  :class="{
25
27
  'uikit-question-matrix-choices-container__column-header--two-columns':
26
- numberOfMatrixColumnLabels === 2
28
+ numberOfMatrixColumnLabels === 2,
29
+ 'uikit-question-matrix-choices-container__column-header--radio-btn-three-columns':
30
+ question.type === 'Matrix Radio Button' && numberOfMatrixColumnLabels === 3
27
31
  }"
28
32
  lang="de"
29
33
  v-for="(columnLabel, index) in matrixColumnLabels"
@@ -52,7 +56,7 @@
52
56
  'uikit-question-matrix-choices-container__choices--checkbox':
53
57
  question.type === 'Matrix Checkbox',
54
58
  'uikit-question-matrix-choices-container__choices--two-columns':
55
- numberOfMatrixColumnLabels === 2
59
+ numberOfMatrixColumnLabels === 2,
56
60
  }"
57
61
  v-dark="isDarkMode"
58
62
  v-breakpoint:questionEl="breakpoints"
@@ -65,7 +69,9 @@
65
69
  'uikit-question-matrix-choices-container__choice-text--checkbox':
66
70
  question.type === 'Matrix Checkbox',
67
71
  'uikit-question-matrix-choices-container__choice-text--two-columns':
68
- numberOfMatrixColumnLabels === 2
72
+ numberOfMatrixColumnLabels === 2,
73
+ 'uikit-question-matrix-choices-container__choice-text--radio-btn-two-columns':
74
+ question.type === 'Matrix Radio Button' && numberOfMatrixColumnLabels === 2,
69
75
  }"
70
76
  v-dark="isDarkMode"
71
77
  v-breakpoint:questionEl="breakpoints"
@@ -133,7 +139,7 @@
133
139
  matrixRadioGrid[rowIndex]"
134
140
  >
135
141
  <MatrixRadioGroup
136
- :modelValue="getRadioRowSelection(rowIndex)"
142
+ :model-value="getRadioRowSelection(rowIndex)"
137
143
  :review-mode="reviewMode"
138
144
  :show-answers="showMatrixAnswers"
139
145
  class="uikit-question-matrix-choices-container__radio-btns"
@@ -150,13 +156,13 @@
150
156
  v-if="optionIcon.isCorrect"
151
157
  v-dark="isDarkMode"
152
158
  type="correct"
153
- class="uikit-question-matrix-choices-container__correct-answer-icon"
159
+ class="uikit-question-matrix-choices-container__radio-btn-correct-answer-icon"
154
160
  />
155
161
  <Icon
156
162
  v-else
157
163
  v-dark="isDarkMode"
158
164
  type="incorrect"
159
- class="uikit-question-matrix-choices-container__incorrect-answer-icon"
165
+ class="uikit-question-matrix-choices-container__radio-btn-incorrect-answer-icon"
160
166
  />
161
167
  </template>
162
168
  </template>
@@ -226,7 +232,7 @@ export default class MatrixChoicesContainer extends Vue {
226
232
  return this.matrixChoiceLayout?.map(row => {
227
233
  return {
228
234
  choices: row as TMatrixChoiceKey[],
229
- value: null,
235
+ value: null as TMatrixChoiceKey | null,
230
236
  }
231
237
  })
232
238
  }
@@ -249,11 +255,11 @@ export default class MatrixChoicesContainer extends Vue {
249
255
 
250
256
  mounted () {
251
257
  if (this.question.type === 'Matrix Checkbox') {
252
- this.matrixCheckboxGrid = this.defaultCheckboxGrid
258
+ this.matrixCheckboxGrid = this.convertSelectedMatrixChoiceToCheckboxGrid()
253
259
  }
254
260
 
255
261
  if (this.question.type === 'Matrix Radio Button') {
256
- this.matrixRadioGrid = this.defaultRadioButtonGrid
262
+ this.matrixRadioGrid = this.convertSelectedMatrixChoiceToRadioBtnGrid()
257
263
  }
258
264
  }
259
265
 
@@ -270,7 +276,7 @@ export default class MatrixChoicesContainer extends Vue {
270
276
  }
271
277
 
272
278
  convertSelectedMatrixChoiceToRadioBtnGrid () {
273
- const radioBtnGrid = this.matrixRadioGrid
279
+ const radioBtnGrid = this.defaultRadioButtonGrid
274
280
  this.selectedMatrixChoices.forEach(choice => {
275
281
  const rowIndex = Number(choice.substring(1, choice.indexOf('_'))) - 1
276
282
  if (radioBtnGrid && radioBtnGrid[rowIndex]) {
@@ -482,7 +488,7 @@ export default class MatrixChoicesContainer extends Vue {
482
488
  }
483
489
 
484
490
  &__column-row-header {
485
- width: 284px;
491
+ width: 286px;
486
492
 
487
493
  &--tablet-landscape {
488
494
  width: 285px;
@@ -495,6 +501,10 @@ export default class MatrixChoicesContainer extends Vue {
495
501
  &--two-columns {
496
502
  width: 303px;
497
503
  }
504
+
505
+ &--radio-btn-three-columns {
506
+ width: 276px;
507
+ }
498
508
  }
499
509
 
500
510
  &__column-header {
@@ -522,6 +532,12 @@ export default class MatrixChoicesContainer extends Vue {
522
532
  margin-right: 24px;
523
533
  }
524
534
  }
535
+
536
+ &--radio-btn-three-columns {
537
+ &:not(:last-child) {
538
+ margin-right: 15px;
539
+ }
540
+ }
525
541
  }
526
542
 
527
543
  &__choices-container {
@@ -584,7 +600,7 @@ export default class MatrixChoicesContainer extends Vue {
584
600
  background: $white;
585
601
  box-shadow: 0px 1px 4px 0px rgba(71, 89, 103, 0.30);
586
602
  display: flex;
587
- padding: 12px 10px 12px 14px;
603
+ padding: 12px 10px 0 14px;
588
604
  position: relative;
589
605
  transition: 0.1s padding ease;
590
606
  align-items: flex-start;
@@ -603,10 +619,6 @@ export default class MatrixChoicesContainer extends Vue {
603
619
  &--mobile {
604
620
  display: none;
605
621
  }
606
-
607
- &--checkbox {
608
- padding-bottom: 0;
609
- }
610
622
  }
611
623
 
612
624
  &__choice-text {
@@ -617,12 +629,18 @@ export default class MatrixChoicesContainer extends Vue {
617
629
  font-weight: 500;
618
630
  line-height: 23px;
619
631
  letter-spacing: -0.1px;
632
+ margin-bottom: 12px;
620
633
 
621
634
  &--two-columns {
622
635
  width: 279px;
623
636
  margin-right: 24px;
624
637
  }
625
638
 
639
+ &--radio-btn-two-columns {
640
+ width: 279px;
641
+ margin-right: 12px;
642
+ }
643
+
626
644
  &--dark {
627
645
  color: $barely-background;
628
646
  }
@@ -639,10 +657,6 @@ export default class MatrixChoicesContainer extends Vue {
639
657
  p {
640
658
  margin: 0;
641
659
  }
642
-
643
- &--checkbox {
644
- margin-bottom: 12px;
645
- }
646
660
  }
647
661
 
648
662
  &__mobile-choices {
@@ -703,5 +717,27 @@ export default class MatrixChoicesContainer extends Vue {
703
717
  color: $rosa;
704
718
  }
705
719
  }
720
+
721
+ &__radio-btn-correct-answer-icon {
722
+ margin-top: -10px;
723
+ width: 21px;
724
+ height: 22px;
725
+ color: $cadaverous;
726
+
727
+ &--dark {
728
+ color: $jungle-green;
729
+ }
730
+ }
731
+
732
+ &__radio-btn-incorrect-answer-icon {
733
+ margin-top: -10px;
734
+ width: 21px;
735
+ height: 22px;
736
+ color: $pepper;
737
+
738
+ &--dark {
739
+ color: $rosa;
740
+ }
741
+ }
706
742
  }
707
743
  </style>
@@ -36,19 +36,24 @@ const selectChoice = (choiceKey: string) => {
36
36
  v-for="(choice) in choices"
37
37
  :key="choice"
38
38
  >
39
- <RadioButton
40
- class="uikit-matrix-radio-group__radio-btn"
41
- :selected="choice === selectedChoice"
42
- :disabled="disabled"
43
- :isDarkMode="isDarkMode"
44
- :color="showAnswers
45
- ? selectedChoice?.startsWith('a')
46
- ? 'green'
47
- : 'gray'
48
- : 'blue'
49
- "
39
+ <div
40
+ class="uikit-matrix-radio-group__radio-btn-div"
50
41
  @click="!disabled && !showAnswers && selectChoice(choice)"
51
- />
42
+ @keypress.enter="!disabled && !showAnswers && selectChoice(choice)"
43
+ >
44
+ <RadioButton
45
+ class="uikit-matrix-radio-group__radio-btn"
46
+ :selected="choice === selectedChoice"
47
+ :disabled="disabled"
48
+ :isDarkMode="isDarkMode"
49
+ :color="showAnswers
50
+ ? selectedChoice?.startsWith('a')
51
+ ? 'green'
52
+ : 'gray'
53
+ : 'blue'
54
+ "
55
+ />
56
+ </div>
52
57
  <div class="uikit-matrix-radio-group__option-icon">
53
58
  <slot
54
59
  name="optionIcon"
@@ -76,7 +81,6 @@ const selectChoice = (choiceKey: string) => {
76
81
  list-style: none;
77
82
  margin: 0;
78
83
  padding: 0;
79
- cursor: pointer;
80
84
 
81
85
  &--disabled {
82
86
  cursor: default;
@@ -100,5 +104,15 @@ const selectChoice = (choiceKey: string) => {
100
104
  display: flex;
101
105
  align-items: center;
102
106
  }
107
+
108
+ &__radio-btn-div {
109
+ width: 40px;
110
+ height: 40px;
111
+ display: flex;
112
+ align-items: center;
113
+ justify-content: center;
114
+ margin-top: -10px;
115
+ cursor: pointer;
116
+ }
103
117
  }
104
118
  </style>
@@ -63,7 +63,6 @@
63
63
  class="uikit-question-mobile-matrix-choices-container__selected-choice-labels-container"
64
64
  >
65
65
  <div
66
-
67
66
  v-dark="isDarkMode"
68
67
  v-for="(colHeader, colHeaderIndex) in selectedColumnHeaders"
69
68
  :key="colHeaderIndex"
@@ -220,7 +219,7 @@ export default class MobileMatrixChoicesContainer extends Vue {
220
219
  return this.matrixChoiceLayout?.map(row => {
221
220
  return {
222
221
  choices: row as TMatrixChoiceKey[],
223
- value: null,
222
+ value: null as TMatrixChoiceKey | null,
224
223
  }
225
224
  })
226
225
  }
@@ -235,11 +234,11 @@ export default class MobileMatrixChoicesContainer extends Vue {
235
234
 
236
235
  mounted () {
237
236
  if (this.question.type === 'Matrix Checkbox') {
238
- this.matrixCheckboxGrid = this.defaultCheckboxGrid
237
+ this.matrixCheckboxGrid = this.convertSelectedMatrixChoiceToCheckboxGrid()
239
238
  }
240
239
 
241
240
  if (this.question.type === 'Matrix Radio Button') {
242
- this.matrixRadioGrid = this.defaultRadioButtonGrid
241
+ this.matrixRadioGrid = this.convertSelectedMatrixChoiceToRadioBtnGrid()
243
242
  }
244
243
 
245
244
  this.question.matrixChoiceLayout?.forEach(() => {
@@ -424,7 +423,7 @@ export default class MobileMatrixChoicesContainer extends Vue {
424
423
  }
425
424
 
426
425
  convertSelectedMatrixChoiceToRadioBtnGrid () {
427
- const radioBtnGrid = this.matrixRadioGrid
426
+ const radioBtnGrid = this.defaultRadioButtonGrid
428
427
  this.selectedMatrixChoices.forEach(choice => {
429
428
  const rowIndex = Number(choice.substring(1, choice.indexOf('_'))) - 1
430
429
  const columnIndex = Number(choice.split('_').pop()) - 1
@@ -683,7 +682,6 @@ export default class MobileMatrixChoicesContainer extends Vue {
683
682
  color: $ash;
684
683
  font-size: 14px;
685
684
  font-weight: 500;
686
- height: 19px;
687
685
  margin-right: 4px;
688
686
 
689
687
  &--dark {
@@ -716,6 +714,10 @@ export default class MobileMatrixChoicesContainer extends Vue {
716
714
  color: $barely-background;
717
715
  }
718
716
 
717
+ .uikit-checkbox {
718
+ min-width: 18px;
719
+ }
720
+
719
721
  .uikit-checkbox--disabled {
720
722
  background: transparent;
721
723
  }
@@ -104,7 +104,7 @@ const stripText = (string?: string) => {
104
104
  display: flex;
105
105
  align-items: center;
106
106
  padding-left: 15px;
107
- height: 47px;
107
+ min-height: 47px;
108
108
  max-width: 325px;
109
109
  border: 0.5px solid rgba($pewter, 0.85);
110
110
  border-top: none;
@@ -15,7 +15,7 @@
15
15
  v-breakpoint:questionEl="breakpoints"
16
16
  type="tertiary-small"
17
17
  class="uikit-question-summary__summary-toggle-explanation"
18
- :class="{ 'uikit-question-summary__summary-toggle-explanation': reviewMode }"
18
+ :class="{ 'uikit-question-summary__summary-toggle-explanation--review-mode': reviewMode }"
19
19
  :is-dark-mode="isDarkMode"
20
20
  :aria-expanded="showExplanation ? 'true' : 'false'"
21
21
  @click="toggleSummaryExplanation"
@@ -229,11 +229,7 @@ export default class Summary extends Vue {
229
229
  padding: 0;
230
230
 
231
231
  &--review-mode {
232
- display: none;
233
-
234
- &.uikit-question-summary__summary-toggle-explanation--tablet-portrait {
235
- display: block;
236
- }
232
+ display: block;
237
233
  }
238
234
  }
239
235
 
@@ -154,7 +154,7 @@
154
154
  "
155
155
  >
156
156
  <div
157
- v-if="(showAnswers || showMatrixAnswers) && !isMCR && isUnanswered && !isCorrect && !isTeachReview"
157
+ v-if="showAnswers && !isMCR && !isMatrixQuestion && isUnanswered && !isCorrect && !isTeachReview"
158
158
  v-dark="isDarkMode"
159
159
  class="uikit-question__unanswered-label"
160
160
  >
@@ -843,11 +843,11 @@ export default class Question extends Vue {
843
843
  })
844
844
  }
845
845
 
846
- mounted () {
846
+ created () {
847
847
  if (this.reviewMode) {
848
848
  this.startReviewMode()
849
849
  }
850
-
850
+
851
851
  if (!this.isMatrixQuestion && this.previousChoices) {
852
852
  this.updateSelectedChoices(this.previousChoices)
853
853
  }
@@ -855,7 +855,9 @@ export default class Question extends Vue {
855
855
  if (this.isMatrixQuestion && this.previousMatrixChoices) {
856
856
  this.updateSelectedMatrixChoices(this.previousMatrixChoices)
857
857
  }
858
+ }
858
859
 
860
+ mounted () {
859
861
  if (this.initialShowAnswers) {
860
862
  this.showAnswers = this.initialShowAnswers
861
863
  this.showMatrixAnswers = this.initialShowAnswers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pocketprep/ui-kit",
3
- "version": "3.4.68",
3
+ "version": "3.4.70",
4
4
  "description": "Pocket Prep UI Kit",
5
5
  "author": "pocketprep",
6
6
  "scripts": {