UNPKG

@mikezimm/fps-library-v2

Version:

Library of reusable typescript/javascript functions, interfaces and constants

60 lines (59 loc) 2.75 kB
/** * CodeAnalizerComment: Updated 2 imports on 2024-09-22 14:49:52 * Update:: import { IPropertyPaneGroup } to '@mikezimm/fps-core-v7/lib/types/@msft/1.15.2/sp-property-pane;' * Update:: import { IPropertyPaneField } to '@mikezimm/fps-core-v7/lib/types/@msft/1.15.2/sp-property-pane;' */ import { PropertyPaneTextField, PropertyPaneToggle, } from '@microsoft/sp-property-pane'; // import { getHelpfullErrorV2 } from '../Logging/ErrorHandler'; // import { JSON_Edit_Link } from './zReusablePropPane'; // import * as strings from 'FpsPageInfoWebPartStrings'; export function buildRelatedItemsPropsGroup(wpProps, name) { var groupFields = []; groupFields.push(PropertyPaneToggle(`${name}showItems`, { label: "Add Related Items", onText: "On", offText: "Off", // disabled: true, })); groupFields.push(PropertyPaneTextField(`${name}heading`, { label: 'Heading - accordion', disabled: wpProps[`${name}showItems`] === false ? true : false, })); groupFields.push(PropertyPaneTextField(`${name}web`, { label: 'Url to site - starting with /sites/...', disabled: wpProps[`${name}showItems`] === false ? true : false, })); groupFields.push(PropertyPaneTextField(`${name}listTitle`, { label: 'Title of the list or library which has related items', disabled: wpProps[`${name}showItems`] === false ? true : false, })); groupFields.push(PropertyPaneTextField(`${name}restFilter`, { label: 'Rest filter - click bright yellow icon for examples', disabled: wpProps[`${name}showItems`] === false ? true : false, })); groupFields.push(PropertyPaneTextField(`${name}displayProp`, { label: 'Static field name of Related item Label', disabled: wpProps[`${name}showItems`] === false ? true : false, })); groupFields.push(PropertyPaneTextField(`${name}linkProp`, { label: 'Static field name of Related item Link', disabled: wpProps[`${name}showItems`] === false ? true : false, })); groupFields.push(PropertyPaneToggle(`${name}isExpanded`, { label: "Expand by default", onText: "On", offText: "Off", disabled: wpProps[`${name}showItems`] === false ? true : false, })); groupFields.push(PropertyPaneTextField(`relatedStyle`, { label: 'React.CSS Item Styles', disabled: wpProps[`${name}showItems`] === false ? true : false, })); const RelatedGroup = { groupName: `Related Props ${name.replace(/\D/g, '')}`, isCollapsed: true, groupFields: groupFields }; return RelatedGroup; } //# sourceMappingURL=RelatedItemsPropGroup.js.map