Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work for #7723: implement styles for totals on mobile #7740

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 26 additions & 12 deletions src/defaultV2-theme/blocks/sd-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
.sd-table__row:first-of-type>.sd-table__cell {
border-top: calcSize(1) solid transparent;
}

.sd-table__row:last-of-type>.sd-table__cell {
border-bottom: calcSize(1) solid transparent;
}
Expand Down Expand Up @@ -331,6 +332,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 @@ -513,18 +515,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 @@ -592,6 +604,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 @@ -643,6 +656,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);
});
});
});
Loading