diff --git a/docs/documentation/docs/controls/FieldCollectionData.md b/docs/documentation/docs/controls/FieldCollectionData.md index 68657d81e..68e17be94 100644 --- a/docs/documentation/docs/controls/FieldCollectionData.md +++ b/docs/documentation/docs/controls/FieldCollectionData.md @@ -105,6 +105,7 @@ The `FieldCollectionData` control can be configured with the following propertie | tableClassName | string | no | Allows you to specify a custom CSS class name for the collection data table inside the panel. | | | itemsPerPage | number | no | Allows you to specify the amount of items displayed per page. Paging control is added automatically. | | | executeFiltering | (searchFilter: string, item: any) => boolean | no | Allows you to show Search Box and specify own filtering logic. | | +| panelProps | IPanelProps | no | Allows you to pass in props of the panel such as type and customWidth to control the underlying panel. | | Interface `ICustomCollectionField` diff --git a/src/controls/fieldCollectionData/FieldCollectionData.tsx b/src/controls/fieldCollectionData/FieldCollectionData.tsx index 23b208aac..67892564e 100644 --- a/src/controls/fieldCollectionData/FieldCollectionData.tsx +++ b/src/controls/fieldCollectionData/FieldCollectionData.tsx @@ -66,7 +66,8 @@ export class FieldCollectionData extends React.Component{ /* no-op; */}} - className={`FieldCollectionData__panel ${this.props.panelClassName || ""}`}> + className={`FieldCollectionData__panel ${this.props.panelClassName || ""}`} + { ...this.props.panelProps ?? {}} > { this.props.panelDescription && (

{this.props.panelDescription}

diff --git a/src/controls/fieldCollectionData/IFieldCollectionData.ts b/src/controls/fieldCollectionData/IFieldCollectionData.ts index 0926306ba..0298a6b59 100644 --- a/src/controls/fieldCollectionData/IFieldCollectionData.ts +++ b/src/controls/fieldCollectionData/IFieldCollectionData.ts @@ -1,4 +1,5 @@ import { ICustomCollectionField } from "./ICustomCollectionField"; +import { IPanelProps } from "office-ui-fabric-react"; export interface IFieldCollectionDataProps { /** @@ -70,8 +71,12 @@ export interface IFieldCollectionDataProps { */ itemsPerPage?: number; /** - * Allows you to show Search Box and specify own filtering logic. + * Allow overriding panel props such as size, type, layerProps, etc. */ + panelProps?: IPanelProps; + /** + * Allows you to show Search Box and specify own filtering logic. + */ executeFiltering?: (searchFilter: string, item: any) => boolean; // eslint-disable-line @typescript-eslint/no-explicit-any onChanged: (value: any[]) => void; // eslint-disable-line @typescript-eslint/no-explicit-any diff --git a/src/webparts/controlsTest/components/ControlsTest.tsx b/src/webparts/controlsTest/components/ControlsTest.tsx index d23d5184a..a38338e6b 100644 --- a/src/webparts/controlsTest/components/ControlsTest.tsx +++ b/src/webparts/controlsTest/components/ControlsTest.tsx @@ -1833,7 +1833,7 @@ export default class ControlsTest extends React.Component { console.log(value); }} panelHeader={"Manage values"} enableSorting={true} - + panelProps={{ type: PanelType.custom, customWidth: "98vw" }} fields={[ { id: "Field1", title: "String field", type: CustomCollectionFieldType.string, required: true }, { id: "Field2", title: "Number field", type: CustomCollectionFieldType.number },