Skip to content

Commit

Permalink
#6717 top padding (matrix in the panel + no column headers)
Browse files Browse the repository at this point in the history
Fixes #6717
  • Loading branch information
novikov82 committed Aug 16, 2023
1 parent 85fa674 commit f30fa59
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@
}

.sd-panel__content {
padding-top: var(--sd-base-vertical-padding);
padding-top: calc(1.2 * var(--sd-base-vertical-padding));
}
31 changes: 31 additions & 0 deletions src/defaultV2-theme/blocks/sd-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,37 @@
.sd-table--no-header {
padding-top: calcSize(3)
}

.sd-panel__content {
.sd-table--no-header {
padding-top: 0;
}

.sd-question--table {
.sd-question__content {
padding-top: calcSize(0);
}

&>.sd-question__header {
&+.sd-question__content {
padding-top: calcSize(2);

.sd-table--no-header {
padding-top: calcSize(3);
}
}
}
}

.sd-question--table {
&:not(.sd-element--with-frame) {
padding-top: calcSize(0.25);
margin-top: calcSize(-0.25);
padding-bottom: calcSize(0.25);
margin-bottom: calcSize(-0.25);
}
}
}
.sd-table--alternate-rows {
margin-left: calcSize(1);
margin-right: calcSize(1);
Expand Down
121 changes: 121 additions & 0 deletions visualRegressionTests/tests/defaultV2/matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,127 @@ frameworks.forEach(framework => {
});
});

// test("Matrix single-select in panel", async (t) => {
// await wrapVisualTest(t, async (t, comparer) => {
// await t.resizeWindow(1200, 1200);
// await initSurvey(framework, {
// "pages": [
// {
// "name": "page1",
// "elements": [
// {
// "type": "panel",
// "name": "panel1",
// "elements": [
// {
// "type": "matrix",
// "name": "q1",
// "title": "Question",
// "alternateRows": true,
// "columns": [
// {
// "value": "Column 1",
// "text": "Title"
// },
// {
// "value": "Column 2",
// "text": "Title"
// },
// {
// "value": "Column 3",
// "text": "Title"
// },
// {
// "value": "Column 4",
// "text": "Title"
// },
// {
// "value": "Column 5",
// "text": "Title"
// }
// ],
// "rows": [
// {
// "value": "Row 1",
// "text": "Title"
// },
// {
// "value": "Row 2",
// "text": "Title"
// },
// {
// "value": "Row 3",
// "text": "Title"
// }
// ]
// },
// {
// "type": "matrix",
// "name": "q2",
// "title": "Question",
// "alternateRows": true,
// "columns": [
// {
// "value": "Column 1",
// "text": "Title"
// },
// {
// "value": "Column 2",
// "text": "Title"
// },
// {
// "value": "Column 3",
// "text": "Title"
// },
// {
// "value": "Column 4",
// "text": "Title"
// },
// {
// "value": "Column 5",
// "text": "Title"
// }
// ],
// "rows": [
// {
// "value": "Row 1",
// "text": "Title"
// },
// {
// "value": "Row 2",
// "text": "Title"
// },
// {
// "value": "Row 3",
// "text": "Title"
// }
// ]
// }
// ],
// "title": "Question"
// }
// ]
// }
// ],
// "showQuestionNumbers": "off",
// "widthMode": "static",
// "width": "1136"
// });

// const questionRoot = Selector(".sd-row");
// await takeElementScreenshot("question-matrix-single-select-in-panel.png", questionRoot, t, comparer);

// await ClientFunction(() => { window["survey"].getAllQuestions().map(q => q.showHeader = false); })();
// await takeElementScreenshot("question-matrix-single-select-in-panel-no-header.png", questionRoot, t, comparer);

// await ClientFunction(() => { window["survey"].getAllQuestions().map(q => q.titleLocation = "hidden"); })();
// await takeElementScreenshot("question-matrix-single-select-in-panel-no-header-no-title.png", questionRoot, t, comparer);

// await ClientFunction(() => { window["survey"]..getAllQuestions().map(q => q.showHeader = true); })();
// await takeElementScreenshot("question-matrix-single-select-in-panel-no-title.png", questionRoot, t, comparer);
// });
// });

test("Matrix multi-select", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1200, 1200);
Expand Down

0 comments on commit f30fa59

Please sign in to comment.