Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}
}

.sd-element--collapsed {
.sd-element--collapsed:not(.sd-panel) {
&>.sd-element__header {
padding: calcSize(0) var(--sd-base-padding);
box-sizing: border-box;
Expand Down
6 changes: 5 additions & 1 deletion packages/survey-core/src/default-theme/blocks/sd-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@
width: initial;
}
.sd-panel__content {
padding-top: var(--sd-base-padding);
display: flex;
padding: var(--sd-base-padding);
flex-direction: column;
align-items: flex-start;
align-self: stretch;
}

.sd-panel.sd-element--nested {
Expand Down
54 changes: 26 additions & 28 deletions packages/survey-core/src/default-theme/blocks/sd-paneldynamic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
}

& .sd-paneldynamic__panel-wrapper > .sd-panel > .sd-panel__header {
padding-top: var(--sd-base-vertical-padding);
padding-bottom: 0;
border-bottom: 1px solid var(--_lbr-panel-border-color-nested, #DCDCDC);
display: flex;
padding: calc(2 * #{$base-unit}) var(--sd-base-padding);
align-items: flex-start;
align-self: stretch;

&:after {
display: none;
Expand All @@ -27,6 +30,10 @@
color: $foreground-light;
}
}

& .sd-paneldynamic__panel-wrapper > .sd-element--collapsed > .sd-panel__header {
border-bottom: none;
}
}

.sd-question--readonly,
Expand All @@ -40,7 +47,11 @@
}
.sd-paneldynamic__panel-wrapper {
box-sizing: border-box;
padding-bottom: calc(1 * var(--sd-base-padding));
display: flex;
flex-direction: column;
align-items: flex-start;
align-self: stretch;
border: 1px solid var(--_lbr-panel-border-color-nested, #DCDCDC);
}

.sd-paneldynamic__panel-wrapper:after {
Expand All @@ -50,18 +61,7 @@
}

.sd-paneldynamic__footer .sd-paneldynamic__separator,
.sd-paneldynamic__panel-wrapper--list ~ .sd-paneldynamic__panel-wrapper--list:before {
content: " ";
display: block;
position: absolute;
left: 0;
right: 0;
margin: 0;
border-color: $border-light;
background: $border-light;
height: 1px;
border: none;
}

.sd-paneldynamic__separator:only-child {
display: none;
}
Expand Down Expand Up @@ -172,18 +172,15 @@
}

.sd-paneldynamic__panel-footer {
border-top: none;
position: relative;
top: calc(0.5 * var(--sd-base-vertical-padding));
margin-right: calcSize(-3);
display: flex;
padding: calcSize(2);
justify-content: flex-end;
align-items: flex-start;
align-self: stretch;
border-top: 1px solid #DCDCDC;
}

.sd-paneldynamic__panel-footer {
.sv-action:not(.sv-action--hidden) {
margin-bottom: calcSize(-1);
}
}
.sd-paneldynamic__tabs-container {
padding-top: var(--sd-base-padding);
.sd-tabs-toolbar {
Expand Down Expand Up @@ -320,12 +317,13 @@
}

.sd-paneldynamic__panels-container {
position: relative;
overflow: hidden;
margin-left: calc(-1 * var(--sd-base-padding));
padding-left: var(--sd-base-padding);
margin-right: calc(-1 * var(--sd-base-padding));
padding-right: var(--sd-base-padding);
display: flex;
padding: calc(4 * #{$base-unit}) 0;
flex-direction: column;
align-items: flex-start;
align-self: stretch;
gap: calc(2 * #{$base-unit});
}
.sd-paneldynamic__panel-wrapper {
box-sizing: border-box;
Expand Down
24 changes: 15 additions & 9 deletions packages/survey-react-ui/src/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,24 @@ export class SurveyPanel extends SurveyPanelBase {
}
return wrapper ?? element;
}
protected renderFooterInContent(): boolean {
return true;
}
protected renderContent(style: any, rows: React.JSX.Element[], className: string): React.JSX.Element {
const bottom: React.JSX.Element | null = this.renderBottom();
return (
<div
style={style} className={className}
id={this.panel.contentId}
role={this.panel.ariaRole}
aria-labelledby={this.panel.ariaLabelledBy}
aria-label={this.panel.ariaLabel}>
{rows}
{bottom}
</div>
<>
<div
style={style} className={className}
id={this.panel.contentId}
role={this.panel.ariaRole}
aria-labelledby={this.panel.ariaLabelledBy}
aria-label={this.panel.ariaLabel}>
{rows}
{this.renderFooterInContent() ? bottom : null}
</div>
{this.renderFooterInContent() ? null : bottom}
</>
);
}
protected renderTitle(): React.JSX.Element | null {
Expand Down
3 changes: 3 additions & 0 deletions packages/survey-react-ui/src/reactquestion_paneldynamic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ export class SurveyQuestionPanelDynamicItem extends SurveyPanel {
const survey = this.getSurvey();
return !!survey ? survey.getCss() : {};
}
protected renderFooterInContent(): boolean {
return false;
}
public render() {
const panel = super.render();
const removeButton = this.renderButton();
Expand Down
Loading