@pocketprep/ui-kit 3.4.76 → 3.4.78

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.
@@ -28,6 +28,8 @@ defineProps<{
28
28
  .uikit-radio-btn {
29
29
  width: 18px;
30
30
  height: 18px;
31
+ min-height: 18px;
32
+ min-width: 18px;
31
33
  border: 1px solid $steel;
32
34
  background: $white;
33
35
  border-radius: 18px;
@@ -119,7 +119,7 @@
119
119
  ? 'Correct Answer, '
120
120
  : 'Incorrect Answer, '
121
121
  : ''
122
- }${ stripText(choice.text) }`"
122
+ }${ stripHtmlTags(choice.text) }`"
123
123
  v-html="choice.text"
124
124
  />
125
125
  <PocketButton
@@ -334,11 +334,15 @@ export default class ChoicesContainer extends Vue {
334
334
  } }) breakpoints!: TBreakPointsObject
335
335
  @Prop({ default: [] }) keywordDefinitions!: { keyword: string; definition: string }[]
336
336
 
337
- stripText (string?: string) {
338
- return string?.replace(/<[^\s>]+[^>]*>/gi, ' ').trim()
337
+ stripHtmlTags (string?: string) {
338
+ if (string) {
339
+ const div = document.createElement('div')
340
+ div.innerHTML = string
341
+ return div.textContent || ''
342
+ }
343
+ return ''
339
344
  }
340
345
 
341
-
342
346
  @Emit('emitChoiceFocusIn')
343
347
  emitChoiceFocusIn (choiceKey: TChoiceKey) {
344
348
  return choiceKey
@@ -48,7 +48,7 @@
48
48
  class="uikit-question-mobile-matrix-choices-container__row-label"
49
49
  v-dark="isDarkMode"
50
50
  >
51
- {{ stripText(rowLabel) }}
51
+ {{ stripHtmlTags(rowLabel) }}
52
52
  <Icon
53
53
  class="uikit-question-mobile-matrix-choices-container__toggle-row-icon"
54
54
  :class="{
@@ -78,8 +78,8 @@
78
78
  >
79
79
  {{ selectedColumnHeaders[rowIndex][colHeaderIndex] ===
80
80
  selectedColumnHeaders[rowIndex][selectedColumnHeaders[rowIndex].length - 1] ?
81
- stripText(selectedColumnHeaders[rowIndex][colHeaderIndex]) :
82
- `${stripText(selectedColumnHeaders[rowIndex][colHeaderIndex])},`
81
+ stripHtmlTags(selectedColumnHeaders[rowIndex][colHeaderIndex]) :
82
+ `${stripHtmlTags(selectedColumnHeaders[rowIndex][colHeaderIndex])},`
83
83
  }}
84
84
  </div>
85
85
  </template>
@@ -127,7 +127,7 @@
127
127
  matrixChoiceLayout[rowIndex][columnIndex]?.startsWith('d'),
128
128
  }"
129
129
  >
130
- {{ stripText(column) }}
130
+ {{ stripHtmlTags(column) }}
131
131
  </div>
132
132
  </div>
133
133
  </div>
@@ -204,8 +204,13 @@ export default class MobileMatrixChoicesContainer extends Vue {
204
204
  selectedColumnHeaders: string[][] = []
205
205
  brandColors = BrandColors
206
206
 
207
- stripText (string?: string) {
208
- return string?.replace(/<[^\s>]+[^>]*>/gi, ' ').trim()
207
+ stripHtmlTags (string?: string) {
208
+ if (string) {
209
+ const div = document.createElement('div')
210
+ div.innerHTML = string
211
+ return div.textContent || ''
212
+ }
213
+ return ''
209
214
  }
210
215
 
211
216
  get defaultCheckboxGrid () {
@@ -40,8 +40,13 @@ const radioButtonColor = (choice: string) => {
40
40
  return 'blue'
41
41
  }
42
42
 
43
- const stripText = (string?: string) => {
44
- return string?.replace(/<[^\s>]+[^>]*>/gi, ' ').trim()
43
+ const stripHtmlTags = (string?: string) => {
44
+ if (string) {
45
+ const div = document.createElement('div')
46
+ div.innerHTML = string
47
+ return div.textContent || ''
48
+ }
49
+ return ''
45
50
  }
46
51
  </script>
47
52
 
@@ -78,7 +83,7 @@ const stripText = (string?: string) => {
78
83
  }"
79
84
  @click="!disabled && !showAnswers && selectChoice(choice)"
80
85
  >
81
- {{ stripText(labels[index]) }}
86
+ {{ stripHtmlTags(labels[index]) }}
82
87
  </div>
83
88
  </li>
84
89
  </ul>
@@ -102,9 +107,9 @@ const stripText = (string?: string) => {
102
107
 
103
108
  &__option {
104
109
  display: flex;
105
- align-items: center;
106
- padding-left: 15px;
107
- min-height: 47px;
110
+ align-items: flex-start;
111
+ align-self: stretch;
112
+ padding: 11px 15px 12px 15px;
108
113
  max-width: 325px;
109
114
  border: 0.5px solid rgba($pewter, 0.85);
110
115
  border-top: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pocketprep/ui-kit",
3
- "version": "3.4.76",
3
+ "version": "3.4.78",
4
4
  "description": "Pocket Prep UI Kit",
5
5
  "author": "pocketprep",
6
6
  "scripts": {