@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
83 lines (81 loc) • 4.25 kB
JavaScript
/**
* CodeAnalizerComment: Updated 2 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;'
*/
/**
* 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 { bannerThemeChoices } to '@mikezimm/fps-core-v7/lib/common/commandStyles/defaults;'
* Update:: import { bannerThemeChoicesWSiteTheme } to '@mikezimm/fps-core-v7/lib/common/commandStyles/ISiteThemeChoices;'
* Update:: import { IThisFPSWebPartClass } to '@mikezimm/fps-core-v7/lib/banner/FPSWebPartClass/IThisFPSWebPartClass1152;'
*/
import { PropertyPaneTextField, PropertyPaneDropdown, PropertyPaneToggle, } from '@microsoft/sp-property-pane';
import { bannerThemeChoices } from '@mikezimm/fps-core-v7/lib/common/commandStyles/defaults';
import { bannerThemeChoicesWSiteTheme } from "@mikezimm/fps-core-v7/lib/common/commandStyles/ISiteThemeChoices";
/**
* FPSBanner3ThemeGroup - Builds FPS Banner Theme Group: bannerStyleChoice, bannerStyle, bannerCmdStyle, bannerHoverEffect
* @param modifyBannerStyle
* @param showBanner
* @param lockStyles
* @returns
*/
// export function FPSBanner3ThemeGroup(modifyBannerStyle: boolean, showBanner: boolean, lockStyles: boolean, includeSiteTheme: boolean) {
export function FPSBanner3ThemeGroup(thisWPClass) {
let fields = BannerPropButtonThemes(thisWPClass);
let bannerGroup = {
groupName: 'FPS Banner - Theme',
isCollapsed: true,
groupFields: fields
};
return bannerGroup;
}
/**
* Generates prop pane FIELDS for: bannerStyleChoice, bannerStyle, bannerCmdStyle, bannerHoverEffect
* @param modifyBannerStyle
* @param showBanner
* @param lockStyles
* @returns
*/
// export function BannerPropButtonThemes( modifyBannerStyle: boolean, showBanner: boolean, lockStyles: boolean, includeSiteTheme: boolean ){
export function BannerPropButtonThemes(thisWPClass) {
let fields = [];
const { showBanner, lockStyles, propsEasyMode } = thisWPClass.properties;
let themeChoices = thisWPClass._allowSiteThemeChoice === true ? bannerThemeChoicesWSiteTheme : bannerThemeChoices;
if (propsEasyMode === true)
themeChoices = themeChoices.filter(theme => theme.key !== 'custom');
fields.push(PropertyPaneDropdown('bannerStyleChoice', {
label: 'Banner Theme',
options: themeChoices,
disabled: thisWPClass._modifyBannerStyle !== true || showBanner !== true ? true : false,
}));
if (propsEasyMode !== true) {
// if ( lockStyles !== true ) {
fields.push(PropertyPaneTextField('bannerStyle', {
label: 'Style options',
description: 'React.CSSProperties format like: "fontSize":"larger","color":"red"',
disabled: thisWPClass._modifyBannerStyle !== true || showBanner !== true || lockStyles === true ? true : false,
multiline: true,
}));
// }
// if ( lockStyles !== true ) {
fields.push(PropertyPaneTextField('bannerCmdStyle', {
label: 'Button Style options',
description: 'React.CSSProperties format like: "fontSize":"larger","color":"red"',
disabled: thisWPClass._modifyBannerStyle !== true || showBanner !== true || lockStyles === true ? true : false,
multiline: true,
}));
// }
fields.push(PropertyPaneToggle('bannerHoverEffect', {
label: 'Banner Hover Effect',
disabled: thisWPClass._modifyBannerStyle !== true || showBanner !== true ? true : false,
}));
// https://github.com/mikezimm/fps-library-v2/issues/53
fields.push(PropertyPaneToggle('bannerPillShape', {
label: 'Banner Pill Corners',
disabled: thisWPClass._modifyBannerStyle !== true || showBanner !== true ? true : false,
}));
}
return fields;
}
//# sourceMappingURL=FPSBanner3ThemeGroup.js.map