Füge vertikale Abstandsoptionen für das FullWidthSection-WebPart hinzu und aktualisiere die Version auf 1.0.1
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
## full-width-section-web-part
|
## full-width-section-web-part
|
||||||
|
|
||||||
This is where you include your WebPart documentation.
|
SPFx-1.4.1-WebPart für SharePoint Server Subscription Edition, das die umgebende moderne Canvas-Zone auf volle Breite setzt.
|
||||||
|
|
||||||
|
Im Property Pane können folgende Abstände separat in Pixeln eingestellt werden:
|
||||||
|
|
||||||
|
- horizontaler Abstand links und rechts
|
||||||
|
- vertikaler Abstand oben und unten
|
||||||
|
|
||||||
|
Bestehende WebPart-Instanzen erhalten für den vertikalen Abstand automatisch den rückwärtskompatiblen Standardwert `0`.
|
||||||
|
|
||||||
### Building the code
|
### Building the code
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"solution": {
|
"solution": {
|
||||||
"name": "full-width-section-web-part-client-side-solution",
|
"name": "full-width-section-web-part-client-side-solution",
|
||||||
"id": "c11ccbaa-162d-4b65-9421-6a5f63acd34c",
|
"id": "c11ccbaa-162d-4b65-9421-6a5f63acd34c",
|
||||||
"version": "1.0.0.0",
|
"version": "1.0.1.0",
|
||||||
"includeClientSideAssets": true,
|
"includeClientSideAssets": true,
|
||||||
"skipFeatureDeployment": true
|
"skipFeatureDeployment": true
|
||||||
},
|
},
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "full-width-section-web-part",
|
"name": "full-width-section-web-part",
|
||||||
"version": "0.0.1",
|
"version": "1.0.1",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "full-width-section-web-part",
|
"name": "full-width-section-web-part",
|
||||||
"version": "0.0.1",
|
"version": "1.0.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@@ -20,7 +20,8 @@
|
|||||||
"description": { "default": "FullWidthSectionWebPart" },
|
"description": { "default": "FullWidthSectionWebPart" },
|
||||||
"officeFabricIconFontName": "Page",
|
"officeFabricIconFontName": "Page",
|
||||||
"properties": {
|
"properties": {
|
||||||
"horizontalPadding": 20
|
"horizontalPadding": 20,
|
||||||
|
"verticalPadding": 0
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,7 @@ import { IFullWidthSectionWebPartProps } from './components/IFullWidthSectionWeb
|
|||||||
|
|
||||||
export interface IFullWidthSectionWebPartWebPartProps {
|
export interface IFullWidthSectionWebPartWebPartProps {
|
||||||
horizontalPadding: number;
|
horizontalPadding: number;
|
||||||
|
verticalPadding: number;
|
||||||
padding?: number;
|
padding?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,6 +24,9 @@ export default class FullWidthSectionWebPartWebPart extends BaseClientSideWebPar
|
|||||||
if (typeof this.properties.horizontalPadding !== 'number' && typeof this.properties.padding === 'number') {
|
if (typeof this.properties.horizontalPadding !== 'number' && typeof this.properties.padding === 'number') {
|
||||||
this.properties.horizontalPadding = this.properties.padding;
|
this.properties.horizontalPadding = this.properties.padding;
|
||||||
}
|
}
|
||||||
|
if (typeof this.properties.verticalPadding !== 'number') {
|
||||||
|
this.properties.verticalPadding = 0;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,6 +43,7 @@ export default class FullWidthSectionWebPartWebPart extends BaseClientSideWebPar
|
|||||||
FullWidthSectionWebPart,
|
FullWidthSectionWebPart,
|
||||||
{
|
{
|
||||||
horizontalPadding: horizontalPadding,
|
horizontalPadding: horizontalPadding,
|
||||||
|
verticalPadding: this.getSpacing(this.properties.verticalPadding),
|
||||||
domElement: this.domElement,
|
domElement: this.domElement,
|
||||||
displayMode: this.displayMode
|
displayMode: this.displayMode
|
||||||
}
|
}
|
||||||
@@ -72,6 +77,13 @@ export default class FullWidthSectionWebPartWebPart extends BaseClientSideWebPar
|
|||||||
max: 100,
|
max: 100,
|
||||||
step: 1,
|
step: 1,
|
||||||
showValue: true
|
showValue: true
|
||||||
|
}),
|
||||||
|
PropertyPaneSlider('verticalPadding', {
|
||||||
|
label: strings.VerticalPaddingFieldLabel,
|
||||||
|
min: 0,
|
||||||
|
max: 100,
|
||||||
|
step: 1,
|
||||||
|
showValue: true
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -80,4 +92,10 @@ export default class FullWidthSectionWebPartWebPart extends BaseClientSideWebPar
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getSpacing(value: number): number {
|
||||||
|
return typeof value === 'number' && isFinite(value)
|
||||||
|
? Math.max(0, Math.min(100, value))
|
||||||
|
: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -21,6 +21,8 @@ export default class FullWidthSectionWebPart extends React.Component<IFullWidthS
|
|||||||
if (section) {
|
if (section) {
|
||||||
section.style.paddingLeft = '';
|
section.style.paddingLeft = '';
|
||||||
section.style.paddingRight = '';
|
section.style.paddingRight = '';
|
||||||
|
section.style.paddingTop = '';
|
||||||
|
section.style.paddingBottom = '';
|
||||||
section.classList.remove('CanvasZone--fullWidth');
|
section.classList.remove('CanvasZone--fullWidth');
|
||||||
section.classList.remove('CanvasZone--fullWidth--read');
|
section.classList.remove('CanvasZone--fullWidth--read');
|
||||||
}
|
}
|
||||||
@@ -38,6 +40,8 @@ export default class FullWidthSectionWebPart extends React.Component<IFullWidthS
|
|||||||
section.classList.add('CanvasZone--fullWidth--read');
|
section.classList.add('CanvasZone--fullWidth--read');
|
||||||
section.style.paddingLeft = this.props.horizontalPadding + 'px';
|
section.style.paddingLeft = this.props.horizontalPadding + 'px';
|
||||||
section.style.paddingRight = this.props.horizontalPadding + 'px';
|
section.style.paddingRight = this.props.horizontalPadding + 'px';
|
||||||
|
section.style.paddingTop = this.props.verticalPadding + 'px';
|
||||||
|
section.style.paddingBottom = this.props.verticalPadding + 'px';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { DisplayMode } from '@microsoft/sp-core-library';
|
|||||||
|
|
||||||
export interface IFullWidthSectionWebPartProps {
|
export interface IFullWidthSectionWebPartProps {
|
||||||
horizontalPadding: number;
|
horizontalPadding: number;
|
||||||
|
verticalPadding: number;
|
||||||
domElement: HTMLElement;
|
domElement: HTMLElement;
|
||||||
displayMode: DisplayMode;
|
displayMode: DisplayMode;
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ define([], function() {
|
|||||||
return {
|
return {
|
||||||
"PropertyPaneDescription": "Layout settings",
|
"PropertyPaneDescription": "Layout settings",
|
||||||
"BasicGroupName": "Spacing",
|
"BasicGroupName": "Spacing",
|
||||||
"HorizontalPaddingFieldLabel": "Horizontal padding (left/right, px)"
|
"HorizontalPaddingFieldLabel": "Horizontal padding (left/right, px)",
|
||||||
|
"VerticalPaddingFieldLabel": "Vertical padding (top/bottom, px)"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -2,6 +2,7 @@ declare interface IFullWidthSectionWebPartWebPartStrings {
|
|||||||
PropertyPaneDescription: string;
|
PropertyPaneDescription: string;
|
||||||
BasicGroupName: string;
|
BasicGroupName: string;
|
||||||
HorizontalPaddingFieldLabel: string;
|
HorizontalPaddingFieldLabel: string;
|
||||||
|
VerticalPaddingFieldLabel: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'FullWidthSectionWebPartWebPartStrings' {
|
declare module 'FullWidthSectionWebPartWebPartStrings' {
|
||||||
|
|||||||
Reference in New Issue
Block a user