UNPKG

@mikezimm/npmfunctions

Version:
77 lines 3.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FPSOptionsExpando = void 0; var sp_property_pane_1 = require("@microsoft/sp-property-pane"); var zReusablePropPane_1 = require("../../PropPane/zReusablePropPane"); var Audiences_1 = require("../../../Services/PropPane/Audiences"); // //This will be in npmFunctions > Services/PropPane/FPSOptionsExpando in next release. // export type IEveryoneItemPageAudience = 'Site Admins' | 'Site Owners' | 'Page Editors' | 'Item Editors' | 'Everyone'; // // Replace expandAudiences with IEveryoneItemPageAudience // // export type expandAudiences = 'Site Admins' | 'Site Owners' | 'Page Editors' | 'Everyone'; // //'Everyone' | 'Site Admins' | 'Site Owners' | 'Page Editors' ; // export const EveryoneItemPageAudienceChoices: IPropertyPaneDropdownOption[] = <IPropertyPaneDropdownOption[]>[ // { index: 0, key: 'Site Admins', text: "Site Admins" }, // { index: 1, key: 'Site Owners', text: "Site Owners" }, // { index: 2, key: 'Page Editors', text: "Page Editors" }, // { index: 3, key: 'Item Editors', text: "Item Editors" }, // { index: 4, key: 'Everyone', text: "Everyone" }, // ]; /** * This is the second version which is more simple (toggles and sliders) * @param showSearch * @param pageStyle * @param quickLaunchHide * @param containerMaxWidth */ /** * Model for IFPSBasicToggleSetting properties * For if ( allSectWidth !== 'skip' ) { */ function FPSOptionsExpando(enableExpandoramic, expandoEnabled, expandoDefault, expandoAudience) { var fields = []; if (enableExpandoramic !== 'skip') { fields.push((0, sp_property_pane_1.PropertyPaneLabel)('expandoText1', { text: 'NOTE: This feature MAY BE deprecated by MSFT at any time without notice. Please contact your SharePoint team if this happens.', })); fields.push((0, sp_property_pane_1.PropertyPaneToggle)('enableExpandoramic', { label: 'Enable Expandoramic Mode', offText: 'Off', onText: 'On', })); fields.push((0, sp_property_pane_1.PropertyPaneLabel)('expandoText2', { text: 'If you expand by default, some users may still see the full page briefly depending on their connection.', })); fields.push((0, sp_property_pane_1.PropertyPaneToggle)('expandoDefault', { label: 'Page load default', offText: 'Normal', onText: 'Expanded', disabled: enableExpandoramic === true ? false : true, })); fields.push((0, sp_property_pane_1.PropertyPaneDropdown)('expandoAudience', { disabled: enableExpandoramic === true ? false : true, label: 'Expandoramic Audience', options: Audiences_1.EveryoneAudienceChoices, })); fields.push((0, sp_property_pane_1.PropertyPaneTextField)('expandoStyle', { disabled: enableExpandoramic === true ? false : true, label: 'Expandoramic Styling', description: 'React.CSSProperties format like: "fontSize":"larger","color":"red"', multiline: true, })); fields.push((0, sp_property_pane_1.PropertyPaneSlider)('expandoPadding', { label: 'Expanded padding', disabled: enableExpandoramic === true ? false : true, min: 0, max: 100, step: 10, })); fields.push(zReusablePropPane_1.JSON_Edit_Link); } var optionsGroup = { groupName: 'FPS Banner - Expandoramic', isCollapsed: true, groupFields: fields }; return optionsGroup; } exports.FPSOptionsExpando = FPSOptionsExpando; //# sourceMappingURL=FPSOptionsExpando.js.map