UNPKG

@mikezimm/fps-library-v2

Version:

Library of reusable typescript/javascript functions, interfaces and constants

95 lines (93 loc) 4.56 kB
/** * CodeAnalizerComment: Updated 3 imports on 2024-09-22 14:49:52 * Update:: import { IPropertyPaneDropdownProps } to '@mikezimm/fps-core-v7/lib/types/@msft/1.15.2/sp-property-pane;' * Update:: import { IThisFPSWebPartClass } to '@mikezimm/fps-core-v7/lib/banner/FPSWebPartClass/IThisFPSWebPartClass1152;' * Update:: import { PageEditorAudienceChoices } to '@mikezimm/fps-core-v7/lib/types/fps-common/AudienceInterfaces;' */ /** * CodeAnalizerComment: Updated 4 imports on 2024-09-21 23:07:24 * Update:: import { IPropertyPaneDropdownProps } to '@mikezimm/fps-core-v7/lib/types/@msft/1.15.2/sp-property-pane;' * Update:: import { bannerInfoEleChoices } to '@mikezimm/fps-core-v7/lib/common/commandStyles/defaults;' * Update:: import { IThisFPSWebPartClass } to '@mikezimm/fps-core-v7/lib/banner/FPSWebPartClass/IThisFPSWebPartClass1152;' * Update:: import { PageEditorAudienceChoices } to '@mikezimm/fps-core-v7/lib/types/fps-class/prop-pane/AudienceInterfaces;' */ import { PropertyPaneTextField, PropertyPaneDropdown, PropertyPaneToggle } from '@microsoft/sp-property-pane'; import { bannerInfoEleChoices } from '@mikezimm/fps-core-v7/lib/common/commandStyles/defaults'; import { PageEditorAudienceChoices } from '@mikezimm/fps-core-v7/lib/types/fps-common/AudienceInterfaces'; // import { PageEditorAudienceChoices } from './Audiences/Interfaces'; /** * FPSBanner3BasicGroup builds FPS Banner Basics Prop Pane Group: showBanner, bannerTitle, infoElementChoice, infoElementText, * @param forceBanner * @param modifyBannerTitle * @param showBanner * @param infoElementText * @returns */ // export function FPSBanner4BasicGroup(forceBanner: boolean, modifyBannerTitle: boolean, showBanner: boolean, infoElementText: boolean, // feedback: boolean, enableBeAUser: boolean) { export function FPSBanner4BasicGroup(thisWPClass) { let fields = BannerPropPaneButtonBasics(thisWPClass); let bannerGroup = { groupName: 'FPS Banner - Basics', isCollapsed: true, groupFields: fields }; return bannerGroup; } /** * BannerPropPaneButtonBasics - Builds Basic FIELDS for Banner * @param forceBanner * @param modifyBannerTitle * @param showBanner * @param infoElementText * @returns */ // export function BannerPropPaneButtonBasics( forceBanner: boolean, modifyBannerTitle: boolean, showBanner: boolean, // infoElementText: boolean, feedback: boolean, enableBeAUser: boolean ) { export function BannerPropPaneButtonBasics(thisWPClass) { let fields = []; const { showBanner, infoElementChoice } = thisWPClass.properties; // Added this back for PivotTiles // fields.push( // PropertyPaneToggle('searchShow', { // label: 'Show Banner', // disabled: thisWPClass._forceBanner !== false ? true : false , // }) // ); fields.push(PropertyPaneToggle('showBanner', { label: 'Show Banner', disabled: thisWPClass._forceBanner !== false ? true : false, })); fields.push(PropertyPaneTextField('bannerTitle', { label: 'Webpart Title', description: '', disabled: thisWPClass._modifyBannerTitle !== true || showBanner !== true ? true : false, })); if (thisWPClass.properties.propsEasyMode !== true) { fields.push(PropertyPaneDropdown('infoElementChoice', { label: 'More Info text-button', options: bannerInfoEleChoices, disabled: showBanner !== true ? true : false, })); fields.push(PropertyPaneTextField('infoElementText', { label: 'More Information text on right of banner', description: 'Keep simple to one word if possible.', disabled: infoElementChoice !== 'Text' || showBanner !== true ? true : false, })); //feedbackEmail: string; fields.push(PropertyPaneTextField('feedbackEmail', { label: 'Feedback email', description: 'Adds Feedback icon in the banner.', disabled: thisWPClass._allowFeedback !== true || showBanner !== true ? true : false, })); if (thisWPClass._allowBeAUser === true) { fields.push(PropertyPaneDropdown('beAUserAudience', { label: 'Audience for Be A User mode', options: PageEditorAudienceChoices, disabled: showBanner !== true ? true : false, })); } } return fields; } //# sourceMappingURL=FPSBanner4BasicGroup.js.map