Skip to content

Commit

Permalink
Work for #7723: implement styles for totals on mobile (#7740)
Browse files Browse the repository at this point in the history
* Work for #7723: implement styles for totals on mobile

* Update etalon
  • Loading branch information
dk981234 authored Feb 2, 2024
1 parent 17c8d5a commit 5370861
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 12 deletions.
37 changes: 25 additions & 12 deletions src/defaultV2-theme/blocks/sd-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@
.sd-table__cell--actions:not(.sd-table__cell--vertical),
.sd-table__cell--empty,
.sd-table__cell--row-text,
.sd-table__cell--footer-total,
.sd-matrix__cell:first-of-type,
.sd-matrix tr>td:first-of-type {
position: sticky;
Expand Down Expand Up @@ -519,18 +520,28 @@
padding-bottom: calcSize(0);
}

tr:not(.sd-table__row--expanded) {
&::after {
z-index: 12;
content: " ";
display: block;
position: relative;
height: 1px;
background-color: $border-light;
left: calcSize(-2);
bottom: calcSize(0);
width: calc(100% + 4 * #{$base-unit});
z-index: 12;
tfoot tr::before,
tr:not(.sd-table__row--expanded)::after {
z-index: 12;
content: " ";
display: block;
position: relative;
height: 1px;
background-color: $border-light;
left: calcSize(-2);
width: calc(100% + 4 * #{$base-unit});
z-index: 12;
}

tr:not(.sd-table__row--expanded)::after {
bottom: 0;
}

tfoot tr {
padding-top: calcSize(5);

&::before {
top: calcSize(-2);
}
}
}
Expand Down Expand Up @@ -598,6 +609,7 @@
.sd-matrix__cell,
.sd-table__cell--actions,
.sd-table__cell--row-text,
.sd-table__cell--footer-total,
.sd-table__cell--error {
&::before {
content: none;
Expand Down Expand Up @@ -649,6 +661,7 @@
margin-bottom: calcSize(-2);
}

.sd-table__cell--footer-total:not(.sd-matrix__cell),
.sd-table__cell--row-text:not(.sd-matrix__cell) {
color: $foreground-light;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions visualRegressionTests/tests/defaultV2/responsiveness.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,4 +734,52 @@ frameworks.forEach(framework => {
await takeElementScreenshot("responsiveness-matrixdropdown-text-fields.png", Selector(".sd-question"), t, comparer);
});
});

test("check matrixdropdown with totals in mobile mode", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(600, 1920);
await initSurvey(framework,
{
"pages": [
{
"name": "page1",
"elements": [
{
"type": "matrixdropdown",
"name": "question1",
"columns": [
{
"name": "Column 1",
"totalType": "sum"
},
{
"name": "Column 2",
"totalType": "count"
},
{
"name": "Column 3",
"totalType": "max"
}
],
"choices": [
1,
2,
3,
4,
5
],
"rows": [
"Row 1",
"Row 2"
],
"totalText": "Total:"
}
]
}
]
}
);
await takeElementScreenshot("responsiveness-matrixdropdown-totals.png", Selector(".sd-question"), t, comparer);
});
});
});

0 comments on commit 5370861

Please sign in to comment.