Update workbench customizer web part to support full-width

This commit is contained in:
Joel Rodrigues 2020-06-03 23:43:27 +01:00
parent e0fa5f1b25
commit ebdc458c83
7 changed files with 7319 additions and 6100 deletions

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@
"properties": {
"requiresPageRefresh": false,
"customWorkbenchStyles": true,
"customWorkbenchStylesFullWidth": false,
"previewMode": true
}
}]

View File

@ -8,6 +8,7 @@ import * as strings from 'WorkbenchCustomizerWebPartStrings';
export interface IWorkbenchCustomizerWebPartProps {
requiresPageRefresh: boolean;
customWorkbenchStyles: boolean;
customWorkbenchStylesFullWidth: boolean;
previewMode: boolean;
}
@ -26,6 +27,10 @@ export default class WorkbenchCustomizerWebPart extends BaseClientSideWebPart<IW
await import('./styles/customWorkbenchStyles.module.scss');
}
if (this.properties.customWorkbenchStyles && this.properties.customWorkbenchStylesFullWidth) {
await import('./styles/customWorkbenchStylesFullWidth.module.scss');
}
if (this.properties.previewMode) {
const previewBtn = document.getElementsByName("Preview")[0];
previewBtn.click();
@ -68,6 +73,10 @@ export default class WorkbenchCustomizerWebPart extends BaseClientSideWebPart<IW
PropertyPaneToggle('customWorkbenchStyles', {
label: strings.CustomWorkbenchStylesFieldLabel
}),
PropertyPaneToggle('customWorkbenchStylesFullWidth', {
label: strings.customWorkbenchStylesFullWidthFieldLabel,
disabled: !this.properties.customWorkbenchStyles
}),
PropertyPaneToggle('previewMode', {
label: strings.PreviewModeFieldLabel
})

View File

@ -3,6 +3,7 @@ define([], function() {
"PropertyPaneDescription": "Description",
"BasicGroupName": "Configuration",
"CustomWorkbenchStylesFieldLabel": "Enable custom styles for Workbench",
"customWorkbenchStylesFullWidthFieldLabel": "Enable custom styles for full-width",
"PreviewModeFieldLabel": "Enable Preview mode by default",
}
});

View File

@ -2,6 +2,7 @@ declare interface IWorkbenchCustomizerWebPartStrings {
PropertyPaneDescription: string;
BasicGroupName: string;
CustomWorkbenchStylesFieldLabel: string;
customWorkbenchStylesFullWidthFieldLabel: string;
PreviewModeFieldLabel: string;
}

View File

@ -1,5 +1,4 @@
:global #workbenchPageContent {
// max-width: 1316px;
max-width: 100%;
left: 0;
right: 0;

View File

@ -0,0 +1,24 @@
:global #workbenchPageContent {
& > div {
& > div {
& > div {
.CanvasComponent {
.CanvasZone {
max-width: 100%;
padding-left: 0;
padding-right: 0;
.CanvasSection {
padding-left: 0;
padding-right: 0;
.ControlZone {
padding: 0;
}
}
}
}
}
}
}
}