@pocketprep/ui-kit 3.4.2 → 3.4.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/dist/@pocketprep/ui-kit.js +7326 -7226
- package/dist/@pocketprep/ui-kit.js.map +1 -1
- package/dist/@pocketprep/ui-kit.umd.cjs +8 -8
- package/dist/@pocketprep/ui-kit.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/lib/components/Quiz/Question/PassageAndImageDropdown.vue +351 -0
- package/lib/components/Quiz/Question.vue +24 -276
- package/lib/components/Quiz/question.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="question.passage || passageImageUrl"
|
|
4
|
+
ref="uikit-question-passage-and-image-dropdown"
|
|
5
|
+
v-breakpoint:questionEl="breakpoints"
|
|
6
|
+
v-dark="isDarkMode"
|
|
7
|
+
class="uikit-question-passage-and-image-dropdown"
|
|
8
|
+
:class="{ 'uikit-question-passage-and-image-dropdown__passage-and-image-dropdown--review-mode': reviewMode }"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
v-dark="isDarkMode"
|
|
12
|
+
class="uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-btn"
|
|
13
|
+
tabindex="0"
|
|
14
|
+
role="button"
|
|
15
|
+
:aria-expanded="showPassageImageDropdown ? 'true' : 'false'"
|
|
16
|
+
@click.stop="showPassageImageDropdown = !showPassageImageDropdown"
|
|
17
|
+
@keydown.enter.stop="showPassageImageDropdown = !showPassageImageDropdown"
|
|
18
|
+
@mousedown.prevent
|
|
19
|
+
>
|
|
20
|
+
<Icon
|
|
21
|
+
v-if="question.passage"
|
|
22
|
+
class="uikit-question-passage-and-image-dropdown__passage-dropdown-icon"
|
|
23
|
+
type="passage"
|
|
24
|
+
/>
|
|
25
|
+
<Icon
|
|
26
|
+
v-else
|
|
27
|
+
class="uikit-question-passage-and-image-dropdown__image-dropdown-icon"
|
|
28
|
+
type="image"
|
|
29
|
+
/>
|
|
30
|
+
<span
|
|
31
|
+
v-dark="isDarkMode"
|
|
32
|
+
class="uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-text"
|
|
33
|
+
>
|
|
34
|
+
{{ showPassageImageDropdown ? 'Hide' : 'Show' }}
|
|
35
|
+
{{ passageAndImageTitle }}
|
|
36
|
+
</span>
|
|
37
|
+
<Icon
|
|
38
|
+
v-dark="isDarkMode"
|
|
39
|
+
class="uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-arrow"
|
|
40
|
+
:class="{
|
|
41
|
+
'uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-arrow--up':
|
|
42
|
+
showPassageImageDropdown,
|
|
43
|
+
}"
|
|
44
|
+
type="accordionArrow"
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
<div
|
|
48
|
+
v-if="showPassageImageDropdown"
|
|
49
|
+
v-breakpoint:questionEl="breakpoints"
|
|
50
|
+
class="uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-container"
|
|
51
|
+
>
|
|
52
|
+
<div
|
|
53
|
+
v-if="question.passage"
|
|
54
|
+
v-breakpoint:questionEl="breakpoints"
|
|
55
|
+
class="uikit-question-passage-and-image-dropdown__passage-dropdown-passage"
|
|
56
|
+
:class="{
|
|
57
|
+
'uikit-question-passage-and-image-dropdown__passage-dropdown-passage--with-image': passageImageUrl,
|
|
58
|
+
}"
|
|
59
|
+
v-html="question.passage"
|
|
60
|
+
/>
|
|
61
|
+
<img
|
|
62
|
+
v-if="passageImageUrl"
|
|
63
|
+
v-dark="isDarkMode"
|
|
64
|
+
class="uikit-question-passage-and-image-dropdown__image-dropdown-image"
|
|
65
|
+
:class="{
|
|
66
|
+
'uikit-question-passage-and-image-dropdown__image-dropdown-image--with-passage': question.passage,
|
|
67
|
+
}"
|
|
68
|
+
:src="passageImageUrl"
|
|
69
|
+
:alt="`${passageImageAlt}. Extended image description below.`"
|
|
70
|
+
>
|
|
71
|
+
<PocketButton
|
|
72
|
+
v-if="passageImageLongAlt"
|
|
73
|
+
v-breakpoint:questionEl="breakpoints"
|
|
74
|
+
type="tertiary-small"
|
|
75
|
+
class="uikit-question-passage-and-image-dropdown__toggle-img-dropdown-img-description"
|
|
76
|
+
:class="{
|
|
77
|
+
'uikit-question-passage-and-image-dropdown__toggle-img-dropdown-img-description--open':
|
|
78
|
+
showPassageImageLongAlt,
|
|
79
|
+
}"
|
|
80
|
+
:is-dark-mode="isDarkMode"
|
|
81
|
+
:aria-expanded="showPassageImageLongAlt ? 'true' : 'false'"
|
|
82
|
+
@click="emitTogglePassageImageLongAlt"
|
|
83
|
+
@mousedown.prevent
|
|
84
|
+
>
|
|
85
|
+
<span
|
|
86
|
+
class="uikit-question-passage-and-image-dropdown__toggle-img-dropdown-img-description-text"
|
|
87
|
+
>
|
|
88
|
+
Image Description
|
|
89
|
+
</span>
|
|
90
|
+
<Icon
|
|
91
|
+
class="uikit-question-passage-and-image-dropdown__toggle-img-dropdown-img-description-icon"
|
|
92
|
+
:class="{
|
|
93
|
+
'uikit-question-passage-and-image-dropdown__toggle-img-dropdown-img-description-icon--up':
|
|
94
|
+
showPassageImageLongAlt,
|
|
95
|
+
}"
|
|
96
|
+
type="accordionArrow"
|
|
97
|
+
/>
|
|
98
|
+
</PocketButton>
|
|
99
|
+
<div
|
|
100
|
+
v-if="showPassageImageLongAlt"
|
|
101
|
+
ref="uikit-question-passage-and-image-dropdown__img-dropdown-img-description"
|
|
102
|
+
v-breakpoint:questionEl="breakpoints"
|
|
103
|
+
v-dark="isDarkMode"
|
|
104
|
+
class="uikit-question-passage-and-image-dropdown__img-dropdown-img-description"
|
|
105
|
+
tabindex="-1"
|
|
106
|
+
v-html="passageImageLongAlt"
|
|
107
|
+
/>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</template>
|
|
111
|
+
|
|
112
|
+
<script lang="ts">
|
|
113
|
+
import { Component, Emit, Prop, Vue } from 'vue-facing-decorator'
|
|
114
|
+
import type { Study } from '@pocketprep/types'
|
|
115
|
+
import Icon from '../../Icons/Icon.vue'
|
|
116
|
+
import PocketButton from '../../Buttons/Button.vue'
|
|
117
|
+
import { breakpoint, dark } from '../../../directives'
|
|
118
|
+
import type { TQuestionPassageAndImageTitle, TBreakPointsObject } from './../question'
|
|
119
|
+
|
|
120
|
+
@Component({
|
|
121
|
+
components: {
|
|
122
|
+
Icon,
|
|
123
|
+
PocketButton,
|
|
124
|
+
},
|
|
125
|
+
directives: {
|
|
126
|
+
dark,
|
|
127
|
+
breakpoint,
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
export default class PassageAndImageDropdown extends Vue {
|
|
131
|
+
@Prop({ default: false }) isDarkMode!: boolean
|
|
132
|
+
@Prop() question!: Study.Class.QuestionJSON
|
|
133
|
+
@Prop({ default: false }) reviewMode!: boolean
|
|
134
|
+
@Prop({ default: '' }) imageUrlPrefix!: string
|
|
135
|
+
@Prop({ default: null }) passageImageUrl!: string | null
|
|
136
|
+
@Prop({ default: '' }) passageImageLongAlt!: string | undefined
|
|
137
|
+
@Prop({ default: '' }) passageImageAlt!: string | undefined
|
|
138
|
+
@Prop({ default: 'Passage' }) passageAndImageTitle!: TQuestionPassageAndImageTitle
|
|
139
|
+
@Prop({ default: null }) questionEl!: Element | null
|
|
140
|
+
@Prop({ default: {
|
|
141
|
+
'mobile': 767,
|
|
142
|
+
'tablet-portrait': 1023,
|
|
143
|
+
'tablet-landscape': 1439,
|
|
144
|
+
} }) breakpoints!: TBreakPointsObject
|
|
145
|
+
|
|
146
|
+
showPassageImageDropdown = false
|
|
147
|
+
showPassageImageLongAlt = false
|
|
148
|
+
|
|
149
|
+
@Emit('emitTogglePassageImageLongAlt')
|
|
150
|
+
emitTogglePassageImageLongAlt () {
|
|
151
|
+
this.showPassageImageLongAlt = !this.showPassageImageLongAlt
|
|
152
|
+
return this.showPassageImageLongAlt
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
</script>
|
|
156
|
+
|
|
157
|
+
<style lang="scss">
|
|
158
|
+
@import '../../../styles/colors';
|
|
159
|
+
@import '../../../styles/breakpoints';
|
|
160
|
+
|
|
161
|
+
.uikit-question-passage-and-image-dropdown {
|
|
162
|
+
&__passage-and-image-dropdown-btn {
|
|
163
|
+
position: relative;
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
border: 1px solid rgba($pewter, 0.85);
|
|
167
|
+
border-radius: 5px;
|
|
168
|
+
box-shadow: 0 1px 4px 0 rgba($ash, 0.3);
|
|
169
|
+
box-sizing: border-box;
|
|
170
|
+
height: 50px;
|
|
171
|
+
padding: 15px 57px 16px 48px;
|
|
172
|
+
margin: -1px;
|
|
173
|
+
cursor: pointer;
|
|
174
|
+
outline: none;
|
|
175
|
+
|
|
176
|
+
&:hover {
|
|
177
|
+
.uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-text {
|
|
178
|
+
color: mix($brand-blue, black, 90%);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-arrow {
|
|
182
|
+
color: mix($brand-blue, black, 90%);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&::before {
|
|
186
|
+
content: '';
|
|
187
|
+
left: -2px;
|
|
188
|
+
top: -2px;
|
|
189
|
+
width: 100%;
|
|
190
|
+
height: 100%;
|
|
191
|
+
border: 2px solid $slate;
|
|
192
|
+
position: absolute;
|
|
193
|
+
border-radius: 5px;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&:focus::before {
|
|
198
|
+
content: '';
|
|
199
|
+
left: -3px;
|
|
200
|
+
top: -3px;
|
|
201
|
+
width: calc(100% + 4px);
|
|
202
|
+
height: calc(100% + 4px);
|
|
203
|
+
border: 1px solid $brand-blue;
|
|
204
|
+
position: absolute;
|
|
205
|
+
border-radius: 8px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
&--dark {
|
|
209
|
+
box-shadow: 0 1px 4px 0 rgba($jet, 0.3);
|
|
210
|
+
border-color: $slate;
|
|
211
|
+
|
|
212
|
+
&:hover {
|
|
213
|
+
.uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-text {
|
|
214
|
+
color: $butterscotch;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.uikit-question-passage-and-image-dropdown__passage-and-image-dropdown-arrow {
|
|
218
|
+
color: $butterscotch;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
&::before {
|
|
222
|
+
border-color: rgba($white, 0.6);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&:focus::before {
|
|
227
|
+
border-color: $banana-bread;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&__passage-dropdown-icon,
|
|
233
|
+
&__image-dropdown-icon {
|
|
234
|
+
position: absolute;
|
|
235
|
+
left: 17px;
|
|
236
|
+
width: 19px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
&__passage-and-image-dropdown-text {
|
|
240
|
+
font-size: 16px;
|
|
241
|
+
line-height: 24px;
|
|
242
|
+
font-weight: 600;
|
|
243
|
+
color: $brand-blue;
|
|
244
|
+
|
|
245
|
+
&--dark {
|
|
246
|
+
color: $banana-bread;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
&__passage-and-image-dropdown-arrow {
|
|
251
|
+
position: absolute;
|
|
252
|
+
right: 20px;
|
|
253
|
+
color: $brand-blue;
|
|
254
|
+
|
|
255
|
+
&--dark {
|
|
256
|
+
color: $banana-bread;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
&--up {
|
|
260
|
+
transform: rotate(180deg);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
&__passage-and-image-dropdown-container {
|
|
265
|
+
padding: 14px 15px 16px 16px;
|
|
266
|
+
|
|
267
|
+
&--mobile {
|
|
268
|
+
padding: 12px 15px 16px 15px;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
&__passage-dropdown-passage {
|
|
273
|
+
box-sizing: border-box;
|
|
274
|
+
margin: 14px 20px 24px 17px;
|
|
275
|
+
line-height: 24px;
|
|
276
|
+
font-size: 16px;
|
|
277
|
+
font-weight: 400;
|
|
278
|
+
letter-spacing: -0.1;
|
|
279
|
+
|
|
280
|
+
&--mobile {
|
|
281
|
+
line-height: 24px;
|
|
282
|
+
font-size: 16px;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&--with-image {
|
|
286
|
+
margin-bottom: 16px;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
&__image-dropdown-image {
|
|
291
|
+
display: block;
|
|
292
|
+
box-sizing: border-box;
|
|
293
|
+
width: 100%;
|
|
294
|
+
border: 1px solid $fog;
|
|
295
|
+
|
|
296
|
+
&--with-passage {
|
|
297
|
+
padding-top: 0;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
&--dark {
|
|
301
|
+
border: 1px solid $jet;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
&__toggle-img-dropdown-img-description {
|
|
306
|
+
margin-top: 16px;
|
|
307
|
+
|
|
308
|
+
&--open {
|
|
309
|
+
margin-bottom: 8px;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
&__toggle-img-dropdown-img-description-text {
|
|
314
|
+
outline: none;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
&__toggle-img-dropdown-img-description-icon {
|
|
319
|
+
margin-left: 8px;
|
|
320
|
+
|
|
321
|
+
&--up {
|
|
322
|
+
transform: rotate(180deg);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
&__img-dropdown-img-description {
|
|
327
|
+
outline: none;
|
|
328
|
+
color: $ash;
|
|
329
|
+
font-size: 15px;
|
|
330
|
+
line-height: 22px;
|
|
331
|
+
font-weight: 500;
|
|
332
|
+
letter-spacing: -0.2;
|
|
333
|
+
|
|
334
|
+
&--dark {
|
|
335
|
+
color: $fog;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
&--tablet-landscape {
|
|
339
|
+
margin-bottom: 4px;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
&--tablet-portrait {
|
|
343
|
+
margin-bottom: 0;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
p {
|
|
347
|
+
margin: 0;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
</style>
|
|
@@ -74,103 +74,22 @@
|
|
|
74
74
|
>
|
|
75
75
|
Skip to Passage
|
|
76
76
|
</PocketButton>
|
|
77
|
-
<
|
|
77
|
+
<PassageAndImageDropdown
|
|
78
78
|
v-if="question.passage || passageImageUrl"
|
|
79
|
-
|
|
80
|
-
v-dark="isDarkMode"
|
|
79
|
+
ref="uikit-question__passage-and-image-dropdown"
|
|
81
80
|
class="uikit-question__passage-and-image-dropdown"
|
|
82
|
-
:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
<Icon
|
|
95
|
-
v-if="question.passage"
|
|
96
|
-
class="uikit-question__passage-dropdown-icon"
|
|
97
|
-
type="passage"
|
|
98
|
-
/>
|
|
99
|
-
<Icon
|
|
100
|
-
v-else
|
|
101
|
-
class="uikit-question__image-dropdown-icon"
|
|
102
|
-
type="image"
|
|
103
|
-
/>
|
|
104
|
-
<span v-dark="isDarkMode" class="uikit-question__passage-and-image-dropdown-text">
|
|
105
|
-
{{ showPassageImageDropdown ? 'Hide' : 'Show' }}
|
|
106
|
-
{{ passageAndImageTitle }}
|
|
107
|
-
</span>
|
|
108
|
-
<Icon
|
|
109
|
-
v-dark="isDarkMode"
|
|
110
|
-
class="uikit-question__passage-and-image-dropdown-arrow"
|
|
111
|
-
:class="{
|
|
112
|
-
'uikit-question__passage-and-image-dropdown-arrow--up': showPassageImageDropdown,
|
|
113
|
-
}"
|
|
114
|
-
type="accordionArrow"
|
|
115
|
-
/>
|
|
116
|
-
</div>
|
|
117
|
-
<div
|
|
118
|
-
v-if="showPassageImageDropdown"
|
|
119
|
-
v-breakpoint:questionEl="breakpoints"
|
|
120
|
-
class="uikit-question__passage-and-image-dropdown-container"
|
|
121
|
-
>
|
|
122
|
-
<div
|
|
123
|
-
v-if="question.passage"
|
|
124
|
-
v-breakpoint:questionEl="breakpoints"
|
|
125
|
-
class="uikit-question__passage-dropdown-passage"
|
|
126
|
-
:class="{
|
|
127
|
-
'uikit-question__passage-dropdown-passage--with-image': passageImageUrl,
|
|
128
|
-
}"
|
|
129
|
-
v-html="question.passage"
|
|
130
|
-
/>
|
|
131
|
-
<img
|
|
132
|
-
v-if="passageImageUrl"
|
|
133
|
-
v-dark="isDarkMode"
|
|
134
|
-
class="uikit-question__image-dropdown-image"
|
|
135
|
-
:class="{
|
|
136
|
-
'uikit-question__image-dropdown-image--with-passage': question.passage,
|
|
137
|
-
}"
|
|
138
|
-
:src="passageImageUrl"
|
|
139
|
-
:alt="`${passageImageAlt}. Extended image description below.`"
|
|
140
|
-
>
|
|
141
|
-
<PocketButton
|
|
142
|
-
v-if="passageImageLongAlt"
|
|
143
|
-
v-breakpoint:questionEl="breakpoints"
|
|
144
|
-
type="tertiary-small"
|
|
145
|
-
class="uikit-question__toggle-img-dropdown-img-description"
|
|
146
|
-
:class="{
|
|
147
|
-
'uikit-question__toggle-img-dropdown-img-description--open': showPassageImageLongAlt,
|
|
148
|
-
}"
|
|
149
|
-
:is-dark-mode="isDarkMode"
|
|
150
|
-
:aria-expanded="showPassageImageLongAlt ? 'true' : 'false'"
|
|
151
|
-
@click.stop="togglePassageImageLongAlt"
|
|
152
|
-
@mousedown.prevent
|
|
153
|
-
>
|
|
154
|
-
<span class="uikit-question__toggle-img-dropdown-img-description-text">Image Description</span>
|
|
155
|
-
<Icon
|
|
156
|
-
class="uikit-question__toggle-img-dropdown-img-description-icon"
|
|
157
|
-
:class="{
|
|
158
|
-
'uikit-question__toggle-img-dropdown-img-description-icon--up': showPassageImageLongAlt,
|
|
159
|
-
}"
|
|
160
|
-
type="accordionArrow"
|
|
161
|
-
/>
|
|
162
|
-
</PocketButton>
|
|
163
|
-
<div
|
|
164
|
-
v-if="showPassageImageLongAlt"
|
|
165
|
-
ref="uikit-question__img-dropdown-img-description"
|
|
166
|
-
v-breakpoint:questionEl="breakpoints"
|
|
167
|
-
v-dark="isDarkMode"
|
|
168
|
-
class="uikit-question__img-dropdown-img-description"
|
|
169
|
-
tabindex="-1"
|
|
170
|
-
v-html="passageImageLongAlt"
|
|
171
|
-
/>
|
|
172
|
-
</div>
|
|
173
|
-
</div>
|
|
81
|
+
:question="question"
|
|
82
|
+
:question-el="questionEl"
|
|
83
|
+
:breakpoints="breakpoints"
|
|
84
|
+
:is-dark-mode="isDarkMode"
|
|
85
|
+
:review-mode="reviewMode"
|
|
86
|
+
:image-url-prefix="imageUrlPrefix"
|
|
87
|
+
:passage-image-url="passageImageUrl"
|
|
88
|
+
:passage-image-long-alt="passageImageLongAlt"
|
|
89
|
+
:passage-image-alt="passageImageAlt"
|
|
90
|
+
:passage-and-image-title="passageAndImageTitle"
|
|
91
|
+
@emitTogglePassageImageLongAlt="togglePassageImageLongAlt"
|
|
92
|
+
/>
|
|
174
93
|
<div
|
|
175
94
|
v-if="showPaywall"
|
|
176
95
|
class="uikit-question__paywall-container"
|
|
@@ -920,6 +839,7 @@ import type { ITableColumn, ITableSortSettings } from '../Tables/table'
|
|
|
920
839
|
import Table from '../Tables/Table.vue'
|
|
921
840
|
import OverflowTooltip from '../Tooltips/OverflowTooltip.vue'
|
|
922
841
|
import QuestionContext from '../Quiz/Question/QuestionContext.vue'
|
|
842
|
+
import PassageAndImageDropdown from '../Quiz/Question/PassageAndImageDropdown.vue'
|
|
923
843
|
import type { Study } from '@pocketprep/types'
|
|
924
844
|
import { breakpoint, dark } from '../../directives'
|
|
925
845
|
import { studyModes } from '../../utils'
|
|
@@ -934,6 +854,7 @@ import type { Ref, TQuizMode, TChoiceKey, TChoice, TChoiceScores, TNamesRow, TVi
|
|
|
934
854
|
Table,
|
|
935
855
|
OverflowTooltip,
|
|
936
856
|
QuestionContext,
|
|
857
|
+
PassageAndImageDropdown,
|
|
937
858
|
},
|
|
938
859
|
directives: {
|
|
939
860
|
breakpoint,
|
|
@@ -1441,12 +1362,17 @@ export default class Question extends Vue {
|
|
|
1441
1362
|
|
|
1442
1363
|
if (this.showPassageImageLongAlt) {
|
|
1443
1364
|
setTimeout(() => {
|
|
1444
|
-
const
|
|
1365
|
+
const mobileLongAltComp =
|
|
1366
|
+
this.$refs['uikit-question__passage-and-image-dropdown'] as ComponentPublicInstance | undefined
|
|
1367
|
+
const mobileImgDropdownImgDescription =
|
|
1368
|
+
// eslint-disable-next-line max-len
|
|
1369
|
+
mobileLongAltComp?.$refs['uikit-question-passage-and-image-dropdown__img-dropdown-img-description'] as HTMLElement | undefined
|
|
1370
|
+
|
|
1445
1371
|
const longAlt = this.$refs['uikit-question__passage-image-description'] as Ref
|
|
1446
1372
|
|
|
1447
1373
|
// Checking offsetParent tells us which element is visible
|
|
1448
|
-
if (
|
|
1449
|
-
|
|
1374
|
+
if (mobileImgDropdownImgDescription?.offsetParent) {
|
|
1375
|
+
mobileImgDropdownImgDescription.focus()
|
|
1450
1376
|
} else if (longAlt?.offsetParent) {
|
|
1451
1377
|
longAlt.focus()
|
|
1452
1378
|
}
|
|
@@ -1806,7 +1732,6 @@ export default class Question extends Vue {
|
|
|
1806
1732
|
|
|
1807
1733
|
&__toggle-passage-image-description-text,
|
|
1808
1734
|
&__toggle-explanation-img-description-text,
|
|
1809
|
-
&__toggle-img-dropdown-img-description-text,
|
|
1810
1735
|
&__toggle-dropdown-explanation-img-description-text,
|
|
1811
1736
|
&__toggle-summary-dropdown-explanation-img-description-text {
|
|
1812
1737
|
outline: none;
|
|
@@ -1814,7 +1739,6 @@ export default class Question extends Vue {
|
|
|
1814
1739
|
|
|
1815
1740
|
&__toggle-passage-image-description-icon,
|
|
1816
1741
|
&__toggle-explanation-img-description-icon,
|
|
1817
|
-
&__toggle-img-dropdown-img-description-icon,
|
|
1818
1742
|
&__toggle-dropdown-explanation-img-description-icon,
|
|
1819
1743
|
&__toggle-summary-dropdown-explanation-img-description-icon {
|
|
1820
1744
|
margin-left: 8px;
|
|
@@ -2137,182 +2061,6 @@ export default class Question extends Vue {
|
|
|
2137
2061
|
}
|
|
2138
2062
|
}
|
|
2139
2063
|
|
|
2140
|
-
&__passage-and-image-dropdown-btn {
|
|
2141
|
-
position: relative;
|
|
2142
|
-
display: flex;
|
|
2143
|
-
align-items: center;
|
|
2144
|
-
border: 1px solid rgba($pewter, 0.85);
|
|
2145
|
-
border-radius: 5px;
|
|
2146
|
-
box-shadow: 0 1px 4px 0 rgba($ash, 0.3);
|
|
2147
|
-
box-sizing: border-box;
|
|
2148
|
-
height: 50px;
|
|
2149
|
-
padding: 15px 57px 16px 48px;
|
|
2150
|
-
margin: -1px;
|
|
2151
|
-
cursor: pointer;
|
|
2152
|
-
outline: none;
|
|
2153
|
-
|
|
2154
|
-
&:hover {
|
|
2155
|
-
.uikit-question__passage-and-image-dropdown-text {
|
|
2156
|
-
color: mix($brand-blue, black, 90%);
|
|
2157
|
-
}
|
|
2158
|
-
|
|
2159
|
-
.uikit-question__passage-and-image-dropdown-arrow {
|
|
2160
|
-
color: mix($brand-blue, black, 90%);
|
|
2161
|
-
}
|
|
2162
|
-
|
|
2163
|
-
&::before {
|
|
2164
|
-
content: '';
|
|
2165
|
-
left: -2px;
|
|
2166
|
-
top: -2px;
|
|
2167
|
-
width: 100%;
|
|
2168
|
-
height: 100%;
|
|
2169
|
-
border: 2px solid $slate;
|
|
2170
|
-
position: absolute;
|
|
2171
|
-
border-radius: 5px;
|
|
2172
|
-
}
|
|
2173
|
-
}
|
|
2174
|
-
|
|
2175
|
-
&:focus::before {
|
|
2176
|
-
content: '';
|
|
2177
|
-
left: -3px;
|
|
2178
|
-
top: -3px;
|
|
2179
|
-
width: calc(100% + 4px);
|
|
2180
|
-
height: calc(100% + 4px);
|
|
2181
|
-
border: 1px solid $brand-blue;
|
|
2182
|
-
position: absolute;
|
|
2183
|
-
border-radius: 8px;
|
|
2184
|
-
}
|
|
2185
|
-
|
|
2186
|
-
&--dark {
|
|
2187
|
-
box-shadow: 0 1px 4px 0 rgba($jet, 0.3);
|
|
2188
|
-
border-color: $slate;
|
|
2189
|
-
|
|
2190
|
-
&:hover {
|
|
2191
|
-
.uikit-question__passage-and-image-dropdown-text {
|
|
2192
|
-
color: $butterscotch;
|
|
2193
|
-
}
|
|
2194
|
-
|
|
2195
|
-
.uikit-question__passage-and-image-dropdown-arrow {
|
|
2196
|
-
color: $butterscotch;
|
|
2197
|
-
}
|
|
2198
|
-
|
|
2199
|
-
&::before {
|
|
2200
|
-
border-color: rgba($white, 0.6);
|
|
2201
|
-
}
|
|
2202
|
-
}
|
|
2203
|
-
|
|
2204
|
-
&:focus::before {
|
|
2205
|
-
border-color: $banana-bread;
|
|
2206
|
-
}
|
|
2207
|
-
}
|
|
2208
|
-
}
|
|
2209
|
-
|
|
2210
|
-
&__passage-and-image-dropdown-text {
|
|
2211
|
-
font-size: 16px;
|
|
2212
|
-
line-height: 24px;
|
|
2213
|
-
font-weight: 600;
|
|
2214
|
-
color: $brand-blue;
|
|
2215
|
-
|
|
2216
|
-
&--dark {
|
|
2217
|
-
color: $banana-bread;
|
|
2218
|
-
}
|
|
2219
|
-
}
|
|
2220
|
-
|
|
2221
|
-
&__passage-dropdown-icon,
|
|
2222
|
-
&__image-dropdown-icon {
|
|
2223
|
-
position: absolute;
|
|
2224
|
-
left: 17px;
|
|
2225
|
-
width: 19px;
|
|
2226
|
-
}
|
|
2227
|
-
|
|
2228
|
-
&__passage-and-image-dropdown-arrow {
|
|
2229
|
-
position: absolute;
|
|
2230
|
-
right: 20px;
|
|
2231
|
-
color: $brand-blue;
|
|
2232
|
-
|
|
2233
|
-
&--dark {
|
|
2234
|
-
color: $banana-bread;
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2237
|
-
&--up {
|
|
2238
|
-
transform: rotate(180deg);
|
|
2239
|
-
}
|
|
2240
|
-
}
|
|
2241
|
-
|
|
2242
|
-
&__passage-and-image-dropdown-container {
|
|
2243
|
-
padding: 14px 15px 16px 16px;
|
|
2244
|
-
|
|
2245
|
-
&--mobile {
|
|
2246
|
-
padding: 12px 15px 16px 15px;
|
|
2247
|
-
}
|
|
2248
|
-
}
|
|
2249
|
-
|
|
2250
|
-
&__passage-dropdown-passage {
|
|
2251
|
-
box-sizing: border-box;
|
|
2252
|
-
margin: 14px 20px 24px 17px;
|
|
2253
|
-
line-height: 24px;
|
|
2254
|
-
font-size: 16px;
|
|
2255
|
-
font-weight: 400;
|
|
2256
|
-
letter-spacing: -0.1;
|
|
2257
|
-
|
|
2258
|
-
&--mobile {
|
|
2259
|
-
line-height: 24px;
|
|
2260
|
-
font-size: 16px;
|
|
2261
|
-
}
|
|
2262
|
-
|
|
2263
|
-
&--with-image {
|
|
2264
|
-
margin-bottom: 16px;
|
|
2265
|
-
}
|
|
2266
|
-
}
|
|
2267
|
-
|
|
2268
|
-
&__image-dropdown-image {
|
|
2269
|
-
display: block;
|
|
2270
|
-
box-sizing: border-box;
|
|
2271
|
-
width: 100%;
|
|
2272
|
-
border: 1px solid $fog;
|
|
2273
|
-
|
|
2274
|
-
&--with-passage {
|
|
2275
|
-
padding-top: 0;
|
|
2276
|
-
}
|
|
2277
|
-
|
|
2278
|
-
&--dark {
|
|
2279
|
-
border: 1px solid $jet;
|
|
2280
|
-
}
|
|
2281
|
-
}
|
|
2282
|
-
|
|
2283
|
-
&__toggle-img-dropdown-img-description {
|
|
2284
|
-
margin-top: 16px;
|
|
2285
|
-
|
|
2286
|
-
&--open {
|
|
2287
|
-
margin-bottom: 8px;
|
|
2288
|
-
}
|
|
2289
|
-
}
|
|
2290
|
-
|
|
2291
|
-
&__img-dropdown-img-description {
|
|
2292
|
-
outline: none;
|
|
2293
|
-
color: $ash;
|
|
2294
|
-
font-size: 15px;
|
|
2295
|
-
line-height: 22px;
|
|
2296
|
-
font-weight: 500;
|
|
2297
|
-
letter-spacing: -0.2;
|
|
2298
|
-
|
|
2299
|
-
&--dark {
|
|
2300
|
-
color: $fog;
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
&--tablet-landscape {
|
|
2304
|
-
margin-bottom: 4px;
|
|
2305
|
-
}
|
|
2306
|
-
|
|
2307
|
-
&--tablet-portrait {
|
|
2308
|
-
margin-bottom: 0;
|
|
2309
|
-
}
|
|
2310
|
-
|
|
2311
|
-
p {
|
|
2312
|
-
margin: 0;
|
|
2313
|
-
}
|
|
2314
|
-
}
|
|
2315
|
-
|
|
2316
2064
|
&__unanswered-teach-review-label {
|
|
2317
2065
|
margin-bottom: 12px;
|
|
2318
2066
|
display: flex;
|