@pocketprep/ui-kit 3.4.69 → 3.4.71

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.
@@ -16,7 +16,7 @@
16
16
  :class="{
17
17
  'uikit-question-matrix-choices-container__column-row-header--two-columns':
18
18
  numberOfMatrixColumnLabels === 2,
19
- 'uikit-question-matrix-choices-container__column-row-header--radio-btn--three-columns':
19
+ 'uikit-question-matrix-choices-container__column-row-header--radio-btn-three-columns':
20
20
  question.type === 'Matrix Radio Button' && numberOfMatrixColumnLabels === 3
21
21
  }"
22
22
  v-html="matrixColumnLabelsForRows"
@@ -26,7 +26,7 @@
26
26
  :class="{
27
27
  'uikit-question-matrix-choices-container__column-header--two-columns':
28
28
  numberOfMatrixColumnLabels === 2,
29
- 'uikit-question-matrix-choices-container__column-header--radio-btn--three-columns':
29
+ 'uikit-question-matrix-choices-container__column-header--radio-btn-three-columns':
30
30
  question.type === 'Matrix Radio Button' && numberOfMatrixColumnLabels === 3
31
31
  }"
32
32
  lang="de"
@@ -56,7 +56,7 @@
56
56
  'uikit-question-matrix-choices-container__choices--checkbox':
57
57
  question.type === 'Matrix Checkbox',
58
58
  'uikit-question-matrix-choices-container__choices--two-columns':
59
- numberOfMatrixColumnLabels === 2
59
+ numberOfMatrixColumnLabels === 2,
60
60
  }"
61
61
  v-dark="isDarkMode"
62
62
  v-breakpoint:questionEl="breakpoints"
@@ -69,7 +69,9 @@
69
69
  'uikit-question-matrix-choices-container__choice-text--checkbox':
70
70
  question.type === 'Matrix Checkbox',
71
71
  'uikit-question-matrix-choices-container__choice-text--two-columns':
72
- 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,
73
75
  }"
74
76
  v-dark="isDarkMode"
75
77
  v-breakpoint:questionEl="breakpoints"
@@ -137,7 +139,7 @@
137
139
  matrixRadioGrid[rowIndex]"
138
140
  >
139
141
  <MatrixRadioGroup
140
- :modelValue="getRadioRowSelection(rowIndex)"
142
+ :model-value="getRadioRowSelection(rowIndex)"
141
143
  :review-mode="reviewMode"
142
144
  :show-answers="showMatrixAnswers"
143
145
  class="uikit-question-matrix-choices-container__radio-btns"
@@ -154,13 +156,13 @@
154
156
  v-if="optionIcon.isCorrect"
155
157
  v-dark="isDarkMode"
156
158
  type="correct"
157
- class="uikit-question-matrix-choices-container__correct-answer-icon"
159
+ class="uikit-question-matrix-choices-container__radio-btn-correct-answer-icon"
158
160
  />
159
161
  <Icon
160
162
  v-else
161
163
  v-dark="isDarkMode"
162
164
  type="incorrect"
163
- class="uikit-question-matrix-choices-container__incorrect-answer-icon"
165
+ class="uikit-question-matrix-choices-container__radio-btn-incorrect-answer-icon"
164
166
  />
165
167
  </template>
166
168
  </template>
@@ -230,7 +232,7 @@ export default class MatrixChoicesContainer extends Vue {
230
232
  return this.matrixChoiceLayout?.map(row => {
231
233
  return {
232
234
  choices: row as TMatrixChoiceKey[],
233
- value: null,
235
+ value: null as TMatrixChoiceKey | null,
234
236
  }
235
237
  })
236
238
  }
@@ -253,11 +255,11 @@ export default class MatrixChoicesContainer extends Vue {
253
255
 
254
256
  mounted () {
255
257
  if (this.question.type === 'Matrix Checkbox') {
256
- this.matrixCheckboxGrid = this.defaultCheckboxGrid
258
+ this.matrixCheckboxGrid = this.convertSelectedMatrixChoiceToCheckboxGrid()
257
259
  }
258
260
 
259
261
  if (this.question.type === 'Matrix Radio Button') {
260
- this.matrixRadioGrid = this.defaultRadioButtonGrid
262
+ this.matrixRadioGrid = this.convertSelectedMatrixChoiceToRadioBtnGrid()
261
263
  }
262
264
  }
263
265
 
@@ -274,7 +276,7 @@ export default class MatrixChoicesContainer extends Vue {
274
276
  }
275
277
 
276
278
  convertSelectedMatrixChoiceToRadioBtnGrid () {
277
- const radioBtnGrid = this.matrixRadioGrid
279
+ const radioBtnGrid = this.defaultRadioButtonGrid
278
280
  this.selectedMatrixChoices.forEach(choice => {
279
281
  const rowIndex = Number(choice.substring(1, choice.indexOf('_'))) - 1
280
282
  if (radioBtnGrid && radioBtnGrid[rowIndex]) {
@@ -486,7 +488,7 @@ export default class MatrixChoicesContainer extends Vue {
486
488
  }
487
489
 
488
490
  &__column-row-header {
489
- width: 284px;
491
+ width: 286px;
490
492
 
491
493
  &--tablet-landscape {
492
494
  width: 285px;
@@ -500,8 +502,8 @@ export default class MatrixChoicesContainer extends Vue {
500
502
  width: 303px;
501
503
  }
502
504
 
503
- &--radio-btn--three-columns {
504
- width: 265px;
505
+ &--radio-btn-three-columns {
506
+ width: 276px;
505
507
  }
506
508
  }
507
509
 
@@ -531,7 +533,7 @@ export default class MatrixChoicesContainer extends Vue {
531
533
  }
532
534
  }
533
535
 
534
- &--radio-btn--three-columns {
536
+ &--radio-btn-three-columns {
535
537
  &:not(:last-child) {
536
538
  margin-right: 15px;
537
539
  }
@@ -598,7 +600,7 @@ export default class MatrixChoicesContainer extends Vue {
598
600
  background: $white;
599
601
  box-shadow: 0px 1px 4px 0px rgba(71, 89, 103, 0.30);
600
602
  display: flex;
601
- padding: 12px 10px 12px 14px;
603
+ padding: 12px 10px 0 14px;
602
604
  position: relative;
603
605
  transition: 0.1s padding ease;
604
606
  align-items: flex-start;
@@ -617,10 +619,6 @@ export default class MatrixChoicesContainer extends Vue {
617
619
  &--mobile {
618
620
  display: none;
619
621
  }
620
-
621
- &--checkbox {
622
- padding-bottom: 0;
623
- }
624
622
  }
625
623
 
626
624
  &__choice-text {
@@ -631,12 +629,18 @@ export default class MatrixChoicesContainer extends Vue {
631
629
  font-weight: 500;
632
630
  line-height: 23px;
633
631
  letter-spacing: -0.1px;
632
+ margin-bottom: 12px;
634
633
 
635
634
  &--two-columns {
636
635
  width: 279px;
637
636
  margin-right: 24px;
638
637
  }
639
638
 
639
+ &--radio-btn-two-columns {
640
+ width: 279px;
641
+ margin-right: 12px;
642
+ }
643
+
640
644
  &--dark {
641
645
  color: $barely-background;
642
646
  }
@@ -653,10 +657,6 @@ export default class MatrixChoicesContainer extends Vue {
653
657
  p {
654
658
  margin: 0;
655
659
  }
656
-
657
- &--checkbox {
658
- margin-bottom: 12px;
659
- }
660
660
  }
661
661
 
662
662
  &__mobile-choices {
@@ -717,5 +717,27 @@ export default class MatrixChoicesContainer extends Vue {
717
717
  color: $rosa;
718
718
  }
719
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
+ }
720
742
  }
721
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,18 @@ export default class MobileMatrixChoicesContainer extends Vue {
424
423
  }
425
424
 
426
425
  convertSelectedMatrixChoiceToRadioBtnGrid () {
427
- const radioBtnGrid = this.matrixRadioGrid
426
+ const radioBtnGrid = this.defaultRadioButtonGrid
427
+
428
+ const columnMatrixLabels = this.question.matrixLabels?.rows
429
+ const defaultSelectedColumnLabels: string[][] = []
430
+ if (columnMatrixLabels) {
431
+ columnMatrixLabels.forEach(() => {
432
+ defaultSelectedColumnLabels.push([])
433
+ })
434
+
435
+ this.selectedColumnHeaders = defaultSelectedColumnLabels
436
+ }
437
+
428
438
  this.selectedMatrixChoices.forEach(choice => {
429
439
  const rowIndex = Number(choice.substring(1, choice.indexOf('_'))) - 1
430
440
  const columnIndex = Number(choice.split('_').pop()) - 1
@@ -683,7 +693,6 @@ export default class MobileMatrixChoicesContainer extends Vue {
683
693
  color: $ash;
684
694
  font-size: 14px;
685
695
  font-weight: 500;
686
- height: 19px;
687
696
  margin-right: 4px;
688
697
 
689
698
  &--dark {
@@ -716,6 +725,10 @@ export default class MobileMatrixChoicesContainer extends Vue {
716
725
  color: $barely-background;
717
726
  }
718
727
 
728
+ .uikit-checkbox {
729
+ min-width: 18px;
730
+ }
731
+
719
732
  .uikit-checkbox--disabled {
720
733
  background: transparent;
721
734
  }
@@ -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"
@@ -163,7 +163,8 @@ export default class Summary extends Vue {
163
163
  @Prop({ default: [] }) keywordDefinitions!: { keyword: string; definition: string }[]
164
164
 
165
165
  get isQuestionCorrect () {
166
- return (!this.isMatrixQuestion && this.isCorrect) || (this.isMatrixQuestion && this.isMatrixQuestionCorrect)
166
+ return (!this.isMatrixQuestion && this.isCorrect) ||
167
+ (this.isMatrixQuestion && this.isMatrixQuestionCorrect && !this.isUnanswered)
167
168
  }
168
169
 
169
170
  get summary () {
@@ -229,11 +230,7 @@ export default class Summary extends Vue {
229
230
  padding: 0;
230
231
 
231
232
  &--review-mode {
232
- display: none;
233
-
234
- &.uikit-question-summary__summary-toggle-explanation--tablet-portrait {
235
- display: block;
236
- }
233
+ display: block;
237
234
  }
238
235
  }
239
236
 
@@ -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
  >
@@ -831,7 +831,7 @@ export default class Question extends Vue {
831
831
  if (!this.isMatrixQuestion) {
832
832
  return this.selectedChoices.length === 0
833
833
  }
834
- return this.selectedMatrixChoices.length === 0
834
+ return (this.selectedMatrixChoices.length === 0 || !this.allMatrixRowsAreAnswered)
835
835
  }
836
836
 
837
837
  get prompt () {
@@ -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.69",
3
+ "version": "3.4.71",
4
4
  "description": "Pocket Prep UI Kit",
5
5
  "author": "pocketprep",
6
6
  "scripts": {