@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
115 lines (113 loc) • 5.06 kB
JavaScript
/**
* CodeAnalizerComment: Updated 1 imports on 2024-09-22 14:49:52
* Update:: import { IThisFPSWebPartClass } to '@mikezimm/fps-core-v7/lib/banner/FPSWebPartClass/IThisFPSWebPartClass1152;'
*/
/**
* CodeAnalizerComment: Updated 1 imports on 2024-09-21 23:07:24
* Update:: import { IThisFPSWebPartClass } to '@mikezimm/fps-core-v7/lib/banner/FPSWebPartClass/IThisFPSWebPartClass1152;'
*/
import {
// IPropertyPaneDropdownOption,
PropertyPaneToggle, PropertyPaneSlider, PropertyPaneLabel } from '@microsoft/sp-property-pane';
/**
* This is the second version which is more simple (toggles and sliders)
* @param showSearch
* @param pageStyle
* @param quickLaunchHide
* @param containerMaxWidth
*/
//thisWPClass: IThisFPSWebPartClass
// export function FPSOptionsGroupBasic(showSearch: boolean, quickLaunchHide: boolean, pageHeaderHide: boolean, allSectWidth: IFPSBasicToggleSetting,
// allSectionMaxWidthEnable: any, allSectMargin: IFPSBasicToggleSetting, allSectionMarginEnable: any, toolBarHide: IFPSBasicToggleSetting) {
export function FPSOptionsGroupBasic(thisWPClass) {
let fields = [];
// Added this check for https://github.com/mikezimm/fps-library-v2/issues/7
if (thisWPClass._isSPA === true) {
fields.push(PropertyPaneLabel('nothing', {
text: 'This set of options is NOT available in SPA Format'
}));
}
else {
// https://github.com/mikezimm/pivottiles7/issues/454
fields.push(PropertyPaneLabel('abc1', {
text: 'Settings Warning:',
}));
// https://github.com/mikezimm/pivottiles7/issues/454
fields.push(PropertyPaneLabel('abc2', {
text: 'MSFT may make a change at any time which could impact these setting. Use at your own risk.',
}));
// https://github.com/mikezimm/pivottiles7/issues/454
if (thisWPClass._allowAllSectWidth !== false) {
fields.push(PropertyPaneToggle('allSectionMaxWidthEnable', {
label: 'All Sections Max Width',
offText: 'Off',
onText: 'On',
}));
fields.push(PropertyPaneSlider('allSectionMaxWidth', {
label: 'Max width of all sections',
disabled: thisWPClass.properties.allSectionMaxWidthEnable === true ? false : true,
min: 1200,
max: 3200,
step: 100,
}));
}
// https://github.com/mikezimm/pivottiles7/issues/454
if (thisWPClass.properties.propsEasyMode !== true) {
if (thisWPClass._allowShowSearch === true) {
fields.push(PropertyPaneToggle('searchShow', {
label: 'Show search bar by default', offText: 'Hide', onText: 'Show',
}));
}
if (thisWPClass._allowQuickLaunchHide === true) {
fields.push(PropertyPaneToggle('quickLaunchHide', {
label: 'Hide quick launch - may be seen briefly', offText: 'Ignore', onText: 'Hidden',
}));
}
// https://github.com/mikezimm/pivottiles7/issues/392
// if (thisWPClass._allowPageHeaderHide === true) {
// fields.push(
// PropertyPaneToggle('pageHeaderHide', {
// label: 'Hide Page Header - may be seen briefly',
// offText: 'Ignore',
// onText: 'Hidden',
// })
// );
// }
if (thisWPClass._allowSocialBarHide === true) {
fields.push(PropertyPaneToggle('socialBarHide', {
label: 'Hide Social Bar - !!!when no Lazy Loading.',
offText: 'Ignore',
onText: 'Hidden',
}));
}
if (thisWPClass._allowAllSectWidth !== false) {
fields.push(PropertyPaneToggle('allSectionMarginEnable', {
label: 'All Sections Margin',
offText: 'Off',
onText: 'On',
}));
fields.push(PropertyPaneSlider('allSectionMargin', {
label: 'Top and Bottom Margin',
disabled: thisWPClass.properties.allSectionMarginEnable === true ? false : true,
min: 0,
max: 100,
step: 2,
}));
}
if (thisWPClass._allowToolBarHide === true) {
fields.push(PropertyPaneToggle('toolBarHide', {
label: 'Hide Toolbar - while viewing',
offText: 'Ignore',
onText: 'Hidden',
}));
}
}
}
const optionsGroup = {
groupName: 'FPS Page Layout - Basic',
isCollapsed: true,
groupFields: fields
};
return optionsGroup;
}
//# sourceMappingURL=FPSOptionsGroupBasic.js.map