@pocketprep/ui-kit 3.4.5 → 3.4.7
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 +7756 -7559
- 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/DropdownExplanation.vue +5 -8
- package/lib/components/Quiz/Question/PassageAndImageDropdown.vue +6 -7
- package/lib/components/Quiz/Question/Summary.vue +375 -0
- package/lib/components/Quiz/Question.vue +76 -317
- package/lib/components/Tables/Table.vue +99 -1
- package/lib/components/Tables/table.d.ts +9 -0
- package/package.json +1 -1
|
@@ -84,11 +84,12 @@
|
|
|
84
84
|
:is-dark-mode="isDarkMode"
|
|
85
85
|
:review-mode="reviewMode"
|
|
86
86
|
:image-url-prefix="imageUrlPrefix"
|
|
87
|
+
:show-passage-image-long-alt="showPassageImageLongAlt"
|
|
87
88
|
:passage-image-url="passageImageUrl"
|
|
88
89
|
:passage-image-long-alt="passageImageLongAlt"
|
|
89
90
|
:passage-image-alt="passageImageAlt"
|
|
90
91
|
:passage-and-image-title="passageAndImageTitle"
|
|
91
|
-
@
|
|
92
|
+
@togglePassageImageLongAltDropdown="togglePassageImageLongAlt"
|
|
92
93
|
/>
|
|
93
94
|
<Paywall
|
|
94
95
|
v-if="showPaywall"
|
|
@@ -300,7 +301,6 @@
|
|
|
300
301
|
:global-metrics="globalMetrics"
|
|
301
302
|
:show-answers="showAnswers"
|
|
302
303
|
:is-MCR="isMCR"
|
|
303
|
-
:show-explanation="showExplanation"
|
|
304
304
|
:show-explanation-image-long-alt="showExplanationImageLongAlt"
|
|
305
305
|
:explanation-image-url="explanationImageUrl"
|
|
306
306
|
:explanation-image-alt="explanationImageAlt"
|
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
:is-dark-mode="isDarkMode"
|
|
311
311
|
:question-el="questionEl"
|
|
312
312
|
:breakpoints="breakpoints"
|
|
313
|
-
@
|
|
313
|
+
@toggleDropdownExplanationImageLongAlt="toggleExplanationImageLongAlt"
|
|
314
314
|
/>
|
|
315
315
|
</div>
|
|
316
316
|
<template v-if="!globalMetrics">
|
|
@@ -416,115 +416,27 @@
|
|
|
416
416
|
</div>
|
|
417
417
|
<slot name="unansweredFlaggedNamesTable" />
|
|
418
418
|
</div>
|
|
419
|
-
<
|
|
419
|
+
<Summary
|
|
420
420
|
v-if="isMCR && showAnswers && !showPaywall"
|
|
421
|
-
|
|
422
|
-
v-breakpoint:questionEl="breakpoints"
|
|
421
|
+
ref="uikit-question__summary"
|
|
423
422
|
class="uikit-question__summary"
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
tabindex="-1"
|
|
442
|
-
>{{ showExplanation ? 'Hide' : 'Show' }} Explanation</span>
|
|
443
|
-
<Icon
|
|
444
|
-
v-breakpoint:questionEl="breakpoints"
|
|
445
|
-
type="accordionArrow"
|
|
446
|
-
class="uikit-question__summary-toggle-explanation-icon"
|
|
447
|
-
:class="{
|
|
448
|
-
'uikit-question__summary-toggle-explanation-icon--up': showExplanation,
|
|
449
|
-
}"
|
|
450
|
-
/>
|
|
451
|
-
</PocketButton>
|
|
452
|
-
<div
|
|
453
|
-
v-if="showExplanation"
|
|
454
|
-
v-breakpoint:questionEl="breakpoints"
|
|
455
|
-
class="uikit-question__summary-dropdown-explanation"
|
|
456
|
-
>
|
|
457
|
-
<div
|
|
458
|
-
v-dark="isDarkMode"
|
|
459
|
-
class="uikit-question__summary-dropdown-explanation-text"
|
|
460
|
-
v-html="question.explanation"
|
|
461
|
-
/>
|
|
462
|
-
<img
|
|
463
|
-
v-if="explanationImageUrl"
|
|
464
|
-
v-dark="isDarkMode"
|
|
465
|
-
class="uikit-question__summary-dropdown-explanation-image"
|
|
466
|
-
:src="explanationImageUrl"
|
|
467
|
-
:alt="`${explanationImageAlt}. Extended image description below.`"
|
|
468
|
-
>
|
|
469
|
-
<PocketButton
|
|
470
|
-
v-if="explanationImageLongAlt"
|
|
471
|
-
v-breakpoint:questionEl="breakpoints"
|
|
472
|
-
type="tertiary-small"
|
|
473
|
-
class="uikit-question__toggle-summary-dropdown-explanation-img-description"
|
|
474
|
-
:class="{
|
|
475
|
-
'uikit-question__toggle-summary-dropdown-explanation-img-description--open':
|
|
476
|
-
showExplanationImageLongAlt,
|
|
477
|
-
'uikit-question__toggle-summary-dropdown-explanation-img-description--no-reference':
|
|
478
|
-
!reference || hideReferences,
|
|
479
|
-
}"
|
|
480
|
-
:is-dark-mode="isDarkMode"
|
|
481
|
-
:aria-expanded="showExplanationImageLongAlt ? 'true' : 'false'"
|
|
482
|
-
@click.stop="toggleExplanationImageLongAlt"
|
|
483
|
-
@mousedown.prevent
|
|
484
|
-
>
|
|
485
|
-
<span class="uikit-question__toggle-summary-dropdown-explanation-img-description-text">
|
|
486
|
-
Image Description
|
|
487
|
-
</span>
|
|
488
|
-
<Icon
|
|
489
|
-
class="uikit-question__toggle-summary-dropdown-explanation-img-description-icon"
|
|
490
|
-
:class="{
|
|
491
|
-
'uikit-question__toggle-summary-dropdown-explanation-img-description-icon--up':
|
|
492
|
-
showExplanationImageLongAlt,
|
|
493
|
-
}"
|
|
494
|
-
type="accordionArrow"
|
|
495
|
-
/>
|
|
496
|
-
</PocketButton>
|
|
497
|
-
<div
|
|
498
|
-
v-if="showExplanationImageLongAlt"
|
|
499
|
-
ref="uikit-question__summary-dropdown-explanation-img-description"
|
|
500
|
-
v-dark="isDarkMode"
|
|
501
|
-
v-breakpoint:questionEl="breakpoints"
|
|
502
|
-
class="uikit-question__summary-dropdown-explanation-img-description"
|
|
503
|
-
tabindex="-1"
|
|
504
|
-
v-html="explanationImageLongAlt"
|
|
505
|
-
/>
|
|
506
|
-
<div
|
|
507
|
-
v-if="reference && !hideReferences"
|
|
508
|
-
v-dark="isDarkMode"
|
|
509
|
-
class="uikit-question__summary-dropdown-reference"
|
|
510
|
-
>
|
|
511
|
-
<span class="uikit-question__summary-dropdown-reference-label">Reference: </span>
|
|
512
|
-
<div v-html="reference" />
|
|
513
|
-
</div>
|
|
514
|
-
</div>
|
|
515
|
-
<Icon
|
|
516
|
-
v-if="isCorrect"
|
|
517
|
-
v-dark="isDarkMode"
|
|
518
|
-
type="correct"
|
|
519
|
-
class="uikit-question__summary-correct-icon"
|
|
520
|
-
/>
|
|
521
|
-
<Icon
|
|
522
|
-
v-else
|
|
523
|
-
v-dark="isDarkMode"
|
|
524
|
-
type="incorrect"
|
|
525
|
-
class="uikit-question__summary-incorrect-icon"
|
|
526
|
-
/>
|
|
527
|
-
</div>
|
|
423
|
+
:question="question"
|
|
424
|
+
:show-explanation="showExplanation"
|
|
425
|
+
:show-explanation-image-long-alt="showExplanationImageLongAlt"
|
|
426
|
+
:explanation-image-url="explanationImageUrl"
|
|
427
|
+
:explanation-image-alt="explanationImageAlt"
|
|
428
|
+
:explanation-image-long-alt="explanationImageLongAlt"
|
|
429
|
+
:reference="reference"
|
|
430
|
+
:hide-references="hideReferences"
|
|
431
|
+
:is-correct="isCorrect"
|
|
432
|
+
:is-unanswered="isUnanswered"
|
|
433
|
+
:review-mode="reviewMode"
|
|
434
|
+
:is-dark-mode="isDarkMode"
|
|
435
|
+
:question-el="questionEl"
|
|
436
|
+
:breakpoints="breakpoints"
|
|
437
|
+
@toggleSummaryExplanation="toggleExplanation"
|
|
438
|
+
@toggleSummaryExplanationImageLongAlt="toggleExplanationImageLongAlt"
|
|
439
|
+
/>
|
|
528
440
|
<slot name="metricsTiles">
|
|
529
441
|
<div
|
|
530
442
|
v-if="globalMetrics"
|
|
@@ -775,6 +687,7 @@ import QuestionContext from '../Quiz/Question/QuestionContext.vue'
|
|
|
775
687
|
import PassageAndImageDropdown from '../Quiz/Question/PassageAndImageDropdown.vue'
|
|
776
688
|
import DropdownExplanation from '../Quiz/Question/DropdownExplanation.vue'
|
|
777
689
|
import Paywall from '../Quiz/Question/Paywall.vue'
|
|
690
|
+
import Summary from '../Quiz/Question/Summary.vue'
|
|
778
691
|
import type { Study } from '@pocketprep/types'
|
|
779
692
|
import { breakpoint, dark } from '../../directives'
|
|
780
693
|
import { studyModes } from '../../utils'
|
|
@@ -790,6 +703,7 @@ import type { Ref, TQuizMode, TChoiceKey, TChoice, TChoiceScores, TNamesRow, TVi
|
|
|
790
703
|
PassageAndImageDropdown,
|
|
791
704
|
Paywall,
|
|
792
705
|
DropdownExplanation,
|
|
706
|
+
Summary,
|
|
793
707
|
},
|
|
794
708
|
directives: {
|
|
795
709
|
breakpoint,
|
|
@@ -827,7 +741,6 @@ export default class Question extends Vue {
|
|
|
827
741
|
selectedChoices: TChoiceKey[] = []
|
|
828
742
|
showAnswers = false
|
|
829
743
|
showExplanation = false
|
|
830
|
-
showPassageImageDropdown = false
|
|
831
744
|
showPassageImageLongAlt = false
|
|
832
745
|
showExplanationImageDropdown = false
|
|
833
746
|
showExplanationImageLongAlt = false
|
|
@@ -1309,26 +1222,33 @@ export default class Question extends Vue {
|
|
|
1309
1222
|
|
|
1310
1223
|
toggleExplanationImageLongAlt () {
|
|
1311
1224
|
this.showExplanationImageLongAlt = !this.showExplanationImageLongAlt
|
|
1312
|
-
|
|
1313
1225
|
if (this.showExplanationImageLongAlt) {
|
|
1314
1226
|
setTimeout(() => {
|
|
1315
|
-
|
|
1227
|
+
// checks for mobile / tablet portrait uikit-question-summary
|
|
1228
|
+
const mcrLongAltComp = this.$refs['uikit-question__summary'] as ComponentPublicInstance | undefined
|
|
1229
|
+
const mcrLongAlt =
|
|
1230
|
+
// eslint-disable-next-line max-len
|
|
1231
|
+
mcrLongAltComp?.$refs['uikit-question-summary__summary-dropdown-explanation-img-description'] as HTMLElement | undefined
|
|
1316
1232
|
|
|
1317
1233
|
const mobileDropdownExplanation =
|
|
1318
1234
|
this.$refs['uikit-question__dropdown-explanation'] as Ref[]
|
|
1319
|
-
|
|
1235
|
+
if (mobileDropdownExplanation) {
|
|
1236
|
+
const mobileDropdownExplanationComp =
|
|
1320
1237
|
mobileDropdownExplanation[0] as ComponentPublicInstance | undefined
|
|
1321
|
-
|
|
1238
|
+
const mobileImgDropdownImgDescription =
|
|
1322
1239
|
// eslint-disable-next-line max-len
|
|
1323
1240
|
mobileDropdownExplanationComp?.$refs['uikit-question-dropdown-explanation__dropdown-explanation-img-description'] as HTMLElement | undefined
|
|
1324
1241
|
|
|
1242
|
+
if (mobileImgDropdownImgDescription?.offsetParent) {
|
|
1243
|
+
mobileImgDropdownImgDescription.focus()
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1325
1247
|
const longAlt = this.$refs['uikit-question__explanation-img-description'] as Ref
|
|
1326
1248
|
|
|
1327
1249
|
// Checking offsetParent tells us which element is visible
|
|
1328
1250
|
if (mcrLongAlt?.offsetParent) {
|
|
1329
1251
|
mcrLongAlt.focus()
|
|
1330
|
-
} else if (mobileImgDropdownImgDescription?.offsetParent) {
|
|
1331
|
-
mobileImgDropdownImgDescription.focus()
|
|
1332
1252
|
} else if (longAlt?.offsetParent) {
|
|
1333
1253
|
longAlt.focus()
|
|
1334
1254
|
}
|
|
@@ -1340,16 +1260,26 @@ export default class Question extends Vue {
|
|
|
1340
1260
|
this.showExplanation = !this.showExplanation
|
|
1341
1261
|
if (!this.showExplanation) {
|
|
1342
1262
|
setTimeout(() => {
|
|
1263
|
+
const summaryMCRComp =
|
|
1264
|
+
this.$refs['uikit-question__summary'] as ComponentPublicInstance | undefined
|
|
1265
|
+
const summaryMCRExplanation =
|
|
1266
|
+
// eslint-disable-next-line max-len
|
|
1267
|
+
summaryMCRComp?.$refs['uikit-question-summary__summary-toggle-explanation-text'] as HTMLElement | undefined
|
|
1268
|
+
|
|
1343
1269
|
const showExplanationRef = (
|
|
1344
1270
|
this.$refs['uikit-question__toggle-explanation-text']
|
|
1345
|
-
|| this.$refs['uikit-question__summary-toggle-explanation-text']
|
|
1346
1271
|
) as Element[] | Element | undefined
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1272
|
+
|
|
1273
|
+
if (summaryMCRExplanation) {
|
|
1274
|
+
summaryMCRExplanation?.focus()
|
|
1275
|
+
} else {
|
|
1276
|
+
const showExplanationEl = (
|
|
1277
|
+
showExplanationRef instanceof Array
|
|
1278
|
+
? showExplanationRef[0]
|
|
1279
|
+
: showExplanationRef
|
|
1280
|
+
) as HTMLElement | undefined
|
|
1281
|
+
showExplanationEl?.focus()
|
|
1282
|
+
}
|
|
1353
1283
|
}, 0)
|
|
1354
1284
|
} else {
|
|
1355
1285
|
setTimeout(() => {
|
|
@@ -1368,16 +1298,26 @@ export default class Question extends Vue {
|
|
|
1368
1298
|
questionSerial: this.question.serial,
|
|
1369
1299
|
})
|
|
1370
1300
|
setTimeout(() => {
|
|
1301
|
+
const summaryMCRComp =
|
|
1302
|
+
this.$refs['uikit-question__summary'] as ComponentPublicInstance | undefined
|
|
1303
|
+
const summaryMCRExplanation =
|
|
1304
|
+
// eslint-disable-next-line max-len
|
|
1305
|
+
summaryMCRComp?.$refs['uikit-question-summary__summary-toggle-explanation-text'] as HTMLElement | undefined
|
|
1306
|
+
|
|
1371
1307
|
const showExplanationRef = (
|
|
1372
1308
|
this.$refs['uikit-question__toggle-explanation-text']
|
|
1373
|
-
|| this.$refs['uikit-question__summary-toggle-explanation-text']
|
|
1374
1309
|
) as Element[] | Element | undefined
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1310
|
+
|
|
1311
|
+
if (summaryMCRExplanation) {
|
|
1312
|
+
summaryMCRExplanation?.focus()
|
|
1313
|
+
} else {
|
|
1314
|
+
const showExplanationEl = (
|
|
1315
|
+
showExplanationRef instanceof Array
|
|
1316
|
+
? showExplanationRef[0]
|
|
1317
|
+
: showExplanationRef
|
|
1318
|
+
) as HTMLElement | undefined
|
|
1319
|
+
showExplanationEl?.focus()
|
|
1320
|
+
}
|
|
1381
1321
|
}, 500)
|
|
1382
1322
|
}
|
|
1383
1323
|
}
|
|
@@ -1666,15 +1606,12 @@ export default class Question extends Vue {
|
|
|
1666
1606
|
}
|
|
1667
1607
|
|
|
1668
1608
|
&__toggle-passage-image-description-text,
|
|
1669
|
-
&__toggle-explanation-img-description-text
|
|
1670
|
-
&__toggle-summary-dropdown-explanation-img-description-text {
|
|
1609
|
+
&__toggle-explanation-img-description-text {
|
|
1671
1610
|
outline: none;
|
|
1672
1611
|
}
|
|
1673
1612
|
|
|
1674
1613
|
&__toggle-passage-image-description-icon,
|
|
1675
|
-
&__toggle-explanation-img-description-icon
|
|
1676
|
-
|
|
1677
|
-
&__toggle-summary-dropdown-explanation-img-description-icon {
|
|
1614
|
+
&__toggle-explanation-img-description-icon {
|
|
1678
1615
|
margin-left: 8px;
|
|
1679
1616
|
|
|
1680
1617
|
&--up {
|
|
@@ -1884,8 +1821,7 @@ export default class Question extends Vue {
|
|
|
1884
1821
|
}
|
|
1885
1822
|
}
|
|
1886
1823
|
|
|
1887
|
-
&__reference-label
|
|
1888
|
-
&__summary-dropdown-reference-label {
|
|
1824
|
+
&__reference-label {
|
|
1889
1825
|
font-weight: 600;
|
|
1890
1826
|
}
|
|
1891
1827
|
|
|
@@ -2441,13 +2377,11 @@ export default class Question extends Vue {
|
|
|
2441
2377
|
}
|
|
2442
2378
|
}
|
|
2443
2379
|
|
|
2444
|
-
&__toggle-explanation-text
|
|
2445
|
-
&__summary-toggle-explanation-text {
|
|
2380
|
+
&__toggle-explanation-text {
|
|
2446
2381
|
outline: none;
|
|
2447
2382
|
}
|
|
2448
2383
|
|
|
2449
|
-
&__toggle-explanation-icon
|
|
2450
|
-
&__summary-toggle-explanation-icon {
|
|
2384
|
+
&__toggle-explanation-icon {
|
|
2451
2385
|
margin-left: 5px;
|
|
2452
2386
|
display: none;
|
|
2453
2387
|
|
|
@@ -2460,113 +2394,6 @@ export default class Question extends Vue {
|
|
|
2460
2394
|
}
|
|
2461
2395
|
}
|
|
2462
2396
|
|
|
2463
|
-
&__summary-dropdown-explanation {
|
|
2464
|
-
display: none;
|
|
2465
|
-
|
|
2466
|
-
&--tablet-portrait {
|
|
2467
|
-
display: block;
|
|
2468
|
-
}
|
|
2469
|
-
}
|
|
2470
|
-
|
|
2471
|
-
&__summary-dropdown-explanation-text {
|
|
2472
|
-
font-size: 16px;
|
|
2473
|
-
letter-spacing: -0.1px;
|
|
2474
|
-
line-height: 24px;
|
|
2475
|
-
font-weight: 400;
|
|
2476
|
-
padding-bottom: 6px;
|
|
2477
|
-
|
|
2478
|
-
p {
|
|
2479
|
-
margin: 10px 0;
|
|
2480
|
-
|
|
2481
|
-
&:first-child {
|
|
2482
|
-
margin: 0;
|
|
2483
|
-
}
|
|
2484
|
-
}
|
|
2485
|
-
}
|
|
2486
|
-
|
|
2487
|
-
&__summary-dropdown-explanation-image {
|
|
2488
|
-
display: block;
|
|
2489
|
-
box-sizing: border-box;
|
|
2490
|
-
width: 100%;
|
|
2491
|
-
border: 1px solid $fog;
|
|
2492
|
-
|
|
2493
|
-
&--dark {
|
|
2494
|
-
border: 1px solid $jet;
|
|
2495
|
-
}
|
|
2496
|
-
}
|
|
2497
|
-
|
|
2498
|
-
&__toggle-summary-dropdown-explanation-img-description {
|
|
2499
|
-
margin-top: 12px;
|
|
2500
|
-
margin-bottom: 20px;
|
|
2501
|
-
|
|
2502
|
-
&--open {
|
|
2503
|
-
margin-bottom: 6px;
|
|
2504
|
-
}
|
|
2505
|
-
|
|
2506
|
-
&--tablet-portrait {
|
|
2507
|
-
&.uikit-question__toggle-summary-dropdown-explanation-img-description--no-reference {
|
|
2508
|
-
margin-bottom: 4px;
|
|
2509
|
-
}
|
|
2510
|
-
|
|
2511
|
-
&.uikit-question__toggle-summary-dropdown-explanation-img-description--open {
|
|
2512
|
-
margin-bottom: 6px;
|
|
2513
|
-
}
|
|
2514
|
-
}
|
|
2515
|
-
|
|
2516
|
-
&--mobile {
|
|
2517
|
-
margin-top: 16px;
|
|
2518
|
-
margin-bottom: 16px;
|
|
2519
|
-
|
|
2520
|
-
&.uikit-question__toggle-summary-dropdown-explanation-img-description--no-reference {
|
|
2521
|
-
margin-bottom: 7px;
|
|
2522
|
-
}
|
|
2523
|
-
|
|
2524
|
-
&.uikit-question__toggle-summary-dropdown-explanation-img-description--open {
|
|
2525
|
-
margin-bottom: 4px;
|
|
2526
|
-
}
|
|
2527
|
-
}
|
|
2528
|
-
}
|
|
2529
|
-
|
|
2530
|
-
&__summary-dropdown-explanation-img-description {
|
|
2531
|
-
outline: none;
|
|
2532
|
-
color: $ash;
|
|
2533
|
-
font-size: 15px;
|
|
2534
|
-
line-height: 22px;
|
|
2535
|
-
margin-bottom: 20px;
|
|
2536
|
-
|
|
2537
|
-
&--dark {
|
|
2538
|
-
color: $fog;
|
|
2539
|
-
}
|
|
2540
|
-
|
|
2541
|
-
&--mobile {
|
|
2542
|
-
margin-bottom: 16px;
|
|
2543
|
-
}
|
|
2544
|
-
|
|
2545
|
-
p {
|
|
2546
|
-
margin: 0;
|
|
2547
|
-
}
|
|
2548
|
-
}
|
|
2549
|
-
|
|
2550
|
-
&__summary-dropdown-reference {
|
|
2551
|
-
padding-top: 24px;
|
|
2552
|
-
border-top: 1px solid $fog;
|
|
2553
|
-
font-size: 15px;
|
|
2554
|
-
letter-spacing: -0.1px;
|
|
2555
|
-
line-height: 22px;
|
|
2556
|
-
font-weight: 400;
|
|
2557
|
-
word-break: break-word;
|
|
2558
|
-
margin-bottom: -7px;
|
|
2559
|
-
|
|
2560
|
-
&--dark {
|
|
2561
|
-
color: $white;
|
|
2562
|
-
border-top-color: rgba($fog, 0.28);
|
|
2563
|
-
}
|
|
2564
|
-
|
|
2565
|
-
p {
|
|
2566
|
-
margin: 6px 0 8pt 0;
|
|
2567
|
-
}
|
|
2568
|
-
}
|
|
2569
|
-
|
|
2570
2397
|
&__strikethrough {
|
|
2571
2398
|
display: flex;
|
|
2572
2399
|
align-items: center;
|
|
@@ -2806,74 +2633,6 @@ export default class Question extends Vue {
|
|
|
2806
2633
|
}
|
|
2807
2634
|
}
|
|
2808
2635
|
|
|
2809
|
-
&__summary {
|
|
2810
|
-
position: relative;
|
|
2811
|
-
background-color: $white;
|
|
2812
|
-
width: 100%;
|
|
2813
|
-
max-width: 492px;
|
|
2814
|
-
margin-top: 24px;
|
|
2815
|
-
padding: 11px 46px 11px 15px;
|
|
2816
|
-
box-sizing: border-box;
|
|
2817
|
-
border-radius: 5px;
|
|
2818
|
-
box-shadow: 0 1px 6px 0 rgba($fog, 0.6);
|
|
2819
|
-
|
|
2820
|
-
&--dark {
|
|
2821
|
-
background: $brand-black;
|
|
2822
|
-
border: 1px solid $slate;
|
|
2823
|
-
box-shadow: 0 1px 4px 0 rgba($jet, 0.3);
|
|
2824
|
-
}
|
|
2825
|
-
|
|
2826
|
-
&--tablet-portrait {
|
|
2827
|
-
display: inline-block;
|
|
2828
|
-
}
|
|
2829
|
-
}
|
|
2830
|
-
|
|
2831
|
-
&__summary-title {
|
|
2832
|
-
font-weight: 600;
|
|
2833
|
-
font-size: 15.5px;
|
|
2834
|
-
line-height: 22px;
|
|
2835
|
-
}
|
|
2836
|
-
|
|
2837
|
-
&__summary-toggle-explanation {
|
|
2838
|
-
margin-top: 8px;
|
|
2839
|
-
margin-bottom: 8px;
|
|
2840
|
-
padding: 0;
|
|
2841
|
-
|
|
2842
|
-
&--review-mode {
|
|
2843
|
-
display: none;
|
|
2844
|
-
|
|
2845
|
-
&.uikit-question__summary-toggle-explanation--tablet-portrait {
|
|
2846
|
-
display: block;
|
|
2847
|
-
}
|
|
2848
|
-
}
|
|
2849
|
-
}
|
|
2850
|
-
|
|
2851
|
-
&__summary-correct-icon {
|
|
2852
|
-
position: absolute;
|
|
2853
|
-
top: 12px;
|
|
2854
|
-
right: 10px;
|
|
2855
|
-
width: 22px;
|
|
2856
|
-
height: 22px;
|
|
2857
|
-
color: $cadaverous;
|
|
2858
|
-
|
|
2859
|
-
&--dark {
|
|
2860
|
-
color: $jungle-green;
|
|
2861
|
-
}
|
|
2862
|
-
}
|
|
2863
|
-
|
|
2864
|
-
&__summary-incorrect-icon {
|
|
2865
|
-
position: absolute;
|
|
2866
|
-
top: 12px;
|
|
2867
|
-
right: 10px;
|
|
2868
|
-
width: 22px;
|
|
2869
|
-
height: 22px;
|
|
2870
|
-
color: $pepper;
|
|
2871
|
-
|
|
2872
|
-
&--dark {
|
|
2873
|
-
color: $rosa;
|
|
2874
|
-
}
|
|
2875
|
-
}
|
|
2876
|
-
|
|
2877
2636
|
&__stats-summary {
|
|
2878
2637
|
margin-top: 24px;
|
|
2879
2638
|
display: flex;
|
|
@@ -173,6 +173,59 @@
|
|
|
173
173
|
</slot>
|
|
174
174
|
</template>
|
|
175
175
|
</tr>
|
|
176
|
+
<template v-for="subrow in row.subrows">
|
|
177
|
+
<slot name="tableSubrow" :subrow="subrow">
|
|
178
|
+
<tr
|
|
179
|
+
:key="`subrow--${subrow.id}`"
|
|
180
|
+
v-dark="isDarkMode"
|
|
181
|
+
role="subrow"
|
|
182
|
+
:tabIndex="row.tabIndex === 0 ? 0 : -1"
|
|
183
|
+
:class="{
|
|
184
|
+
'uikit-table__subrow--hover-focus': row.tabIndex === 0
|
|
185
|
+
}"
|
|
186
|
+
class="uikit-table__subrow"
|
|
187
|
+
:style="{
|
|
188
|
+
...gridStyles,
|
|
189
|
+
...tableSubrowsStyles,
|
|
190
|
+
...subrow.styles,
|
|
191
|
+
}"
|
|
192
|
+
v-show="row.displaySubrows"
|
|
193
|
+
@click="emitRowClicked(subrow)"
|
|
194
|
+
@keydown.enter="emitRowClicked(subrow)"
|
|
195
|
+
@mouseenter="emitRowEnter(subrow)"
|
|
196
|
+
@mouseleave="emitRowLeave(subrow)"
|
|
197
|
+
>
|
|
198
|
+
<template v-for="column in columns">
|
|
199
|
+
<slot name="subrowCell"
|
|
200
|
+
:subrow="subrow"
|
|
201
|
+
:column="column"
|
|
202
|
+
:table-cell-styles="tableCellStyles"
|
|
203
|
+
>
|
|
204
|
+
<td
|
|
205
|
+
:key="`subrow-${subrow.id}--column-${column.propName}`"
|
|
206
|
+
role="cell"
|
|
207
|
+
class="uikit-table__cell"
|
|
208
|
+
:style="{
|
|
209
|
+
...tableCellStyles,
|
|
210
|
+
...column.styles,
|
|
211
|
+
}"
|
|
212
|
+
@click="emitCellClicked(subrow, column)"
|
|
213
|
+
>
|
|
214
|
+
<slot
|
|
215
|
+
name="tableSubrowCellValue"
|
|
216
|
+
:subrow="subrow"
|
|
217
|
+
:column="column"
|
|
218
|
+
>
|
|
219
|
+
<OverflowTooltip>
|
|
220
|
+
{{ subrow[column.propName] }}
|
|
221
|
+
</OverflowTooltip>
|
|
222
|
+
</slot>
|
|
223
|
+
</td>
|
|
224
|
+
</slot>
|
|
225
|
+
</template>
|
|
226
|
+
</tr>
|
|
227
|
+
</slot>
|
|
228
|
+
</template>
|
|
176
229
|
</slot>
|
|
177
230
|
</template>
|
|
178
231
|
</tbody>
|
|
@@ -236,6 +289,8 @@ export default class Table extends Vue {
|
|
|
236
289
|
@Prop() tableRowStyles!: Record<string, string>
|
|
237
290
|
// .table__cell
|
|
238
291
|
@Prop() tableCellStyles!: Record<string, string>
|
|
292
|
+
// .table__subrow
|
|
293
|
+
@Prop() tableSubrowsStyles!: Record<string, string>
|
|
239
294
|
|
|
240
295
|
gridStyles: Record<string, string> = {}
|
|
241
296
|
currentSort: ITableSortSettings = {
|
|
@@ -255,7 +310,6 @@ export default class Table extends Vue {
|
|
|
255
310
|
} else {
|
|
256
311
|
const numColumns = this.columns.length
|
|
257
312
|
this.gridStyles = {
|
|
258
|
-
'display': 'inline-grid',
|
|
259
313
|
'grid-template-columns': `repeat(${numColumns}, 1fr)`,
|
|
260
314
|
}
|
|
261
315
|
}
|
|
@@ -356,6 +410,7 @@ export default class Table extends Vue {
|
|
|
356
410
|
}
|
|
357
411
|
|
|
358
412
|
&__column-labels {
|
|
413
|
+
display: inline-grid;
|
|
359
414
|
min-width: 100%;
|
|
360
415
|
padding: 5px 22px 5px 11px;
|
|
361
416
|
font-size: 11px;
|
|
@@ -454,6 +509,7 @@ export default class Table extends Vue {
|
|
|
454
509
|
}
|
|
455
510
|
|
|
456
511
|
&__row {
|
|
512
|
+
display: inline-grid;
|
|
457
513
|
position: relative;
|
|
458
514
|
max-width: 100%;
|
|
459
515
|
min-width: 100%;
|
|
@@ -487,6 +543,48 @@ export default class Table extends Vue {
|
|
|
487
543
|
}
|
|
488
544
|
}
|
|
489
545
|
|
|
546
|
+
&__subrow {
|
|
547
|
+
display: inline-grid;
|
|
548
|
+
position: relative;
|
|
549
|
+
max-width: 100%;
|
|
550
|
+
min-width: 100%;
|
|
551
|
+
padding: 10px 22px 10px 11px;
|
|
552
|
+
font-size: 15px;
|
|
553
|
+
line-height: 19px;
|
|
554
|
+
border-bottom: 1px solid $gray-divider;
|
|
555
|
+
outline: none;
|
|
556
|
+
|
|
557
|
+
td:first-child {
|
|
558
|
+
position: relative;
|
|
559
|
+
font-size: 14px;
|
|
560
|
+
left: 15px;
|
|
561
|
+
width: calc(100% - 15px);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
&--dark {
|
|
565
|
+
border-bottom-color: $ash;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
&--hover-focus {
|
|
569
|
+
&:hover {
|
|
570
|
+
background-color: mix($barely-background, $brand-black, 96%);
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
&:focus {
|
|
574
|
+
&::before {
|
|
575
|
+
content: '';
|
|
576
|
+
position: absolute;
|
|
577
|
+
top: 0;
|
|
578
|
+
bottom: 0;
|
|
579
|
+
left: 0;
|
|
580
|
+
right: 0;
|
|
581
|
+
border: 1px solid $brand-blue;
|
|
582
|
+
border-radius: 6px;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
|
|
490
588
|
&__cell {
|
|
491
589
|
white-space: nowrap;
|
|
492
590
|
text-overflow: ellipsis;
|
|
@@ -24,9 +24,18 @@ export interface ITableColumn {
|
|
|
24
24
|
isLabelHidden?: boolean
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
export type TTableSubrow = {
|
|
28
|
+
id: string | number
|
|
29
|
+
styles?: Record<string, string>
|
|
30
|
+
} & {
|
|
31
|
+
[key: string]: unknown
|
|
32
|
+
}
|
|
33
|
+
|
|
27
34
|
export type TTableRow = {
|
|
28
35
|
id: string | number
|
|
29
36
|
styles?: Record<string, string>
|
|
37
|
+
displaySubrows?: boolean
|
|
38
|
+
subrows?: TTableSubrow[]
|
|
30
39
|
} & {
|
|
31
40
|
[key: string]: unknown
|
|
32
41
|
}
|