UNPKG

@mikezimm/fps-library-v2

Version:

Library of reusable typescript/javascript functions, interfaces and constants

470 lines (468 loc) 29.6 kB
/** * CodeAnalizerComment: Updated 6 imports on 2024-09-22 14:49:52 * Update:: import { IBannerPages } to '@mikezimm/fps-core-v7/lib/banner/mainReact/IWebpartBannerProps;' * Update:: import { IWebpartBannerProps } to '@mikezimm/fps-core-v7/lib/banner/mainReact/IWebpartBannerProps;' * Update:: import { ISpecialMessage } to '@mikezimm/fps-core-v7/lib/banner/components/SpecialBanner/interface;' * Update:: import { IFPSCorePinMeReactComponentState } to '@mikezimm/fps-core-v7/lib/banner/mainReact/ReactComponentState;' * Update:: import { PanelType } to '@mikezimm/fps-core-v7/lib/types/@fluentUI/@7.199.1/Panel;' * Update:: import { checkCert } to '@mikezimm/fps-core-v7/lib/banner/bannerX/checkCert;' */ /** * CodeAnalizerComment: Updated 8 imports on 2024-09-21 23:07:24 * Update:: import { DisplayMode } to '@mikezimm/fps-core-v7/lib/types/@msft/1.15.2/displayMode;' * Update:: import { IPinMeState } to '@mikezimm/fps-core-v7/lib/banner/features/PinMe/Interfaces;' * Update:: import { IPinStatus } to '@mikezimm/fps-core-v7/lib/banner/features/PinMe/Interfaces;' * Update:: import { ILoadPerformance } to '@mikezimm/fps-core-v7/lib/components/molecules/Performance/IPerformance;' * Update:: import { IMinPandoramicProps } to '@mikezimm/fps-core-v7/lib/banner/features/Expando/Interfaces;' * Update:: import { ISiteThemes } to '@mikezimm/fps-core-v7/lib/common/commandStyles/ISiteThemeChoices;' * Update:: import { check4This } to '@mikezimm/fps-core-v7/lib/logic/Links/CheckSearch;' * Update:: import { FullPageBGParams } to '@mikezimm/fps-core-v7/lib/components/molecules/FullPageBackGround/interfaces/FullPageBGParams;' */ import * as React from 'react'; import { Icon, } from '@fluentui/react/lib/Icon'; import { DisplayMode } from '@mikezimm/fps-core-v7/lib/types/@msft/1.15.2/displayMode'; import { FPSMinMeOverRide, FPSPinMe, getDefaultFPSPinState, } from '../features/PinMe/FPSPinMenu'; import { updateFarElementsPinMe } from './PinFunctions'; import { getWebPartHelpElementX } from '../../common/PropPaneHelp/PropPaneHelp'; import { createSpecialElement } from '../components/SpecialBanner/component'; import { PanelType } from '@fluentui/react/lib/Panel'; import { Panel } from '@fluentui/react/lib/Panel'; import { getMinPanel } from './MinPanel'; import { getFullPanel, pivotHeadingX } from './FullPanel'; import { mainBannerContent } from './BannerContent'; import { getForceNarrow } from './Near/CheckNarrow'; import { updateNearElements } from './Near/updateNearElements'; import { setExpandoRamicMode } from '../features/Expando/functions'; import EasyPagesHook from '../components/EasyPages/components/componentSources'; // import { check4Gulp } from '@mikezimm/fps-pnp2/lib/services/sp/CheckGulping'; import { check4This, Check4 } from '@mikezimm/fps-core-v7/lib/logic/Links/CheckSearch'; import { updateFarElementsWhiteRefresh } from './WhiteRefreshElements'; import { paramLinks } from '../../components/atoms/Links/CallBackLinks'; import { FullPageBGParams } from '@mikezimm/fps-core-v7/lib/logic/Links/CheckSearch'; import { getCertElement } from './getCertElement'; import { checkCert } from '@mikezimm/fps-core-v7/lib/banner/bannerX/checkCert'; import { getMsg } from './getMsg'; import { FullPageBGImageElement } from '../../components/molecules/FullPageBackGround/FullPageBGImageElement'; // import { IMinWPFieldPanelProps } from '../../components/molecules/FieldPanel/IMinWPFieldPanelProps'; require('@mikezimm/fps-styles/dist/banner.css'); /*** * db .d88b. .o88b. .d8b. db * 88 .8P Y8. d8P Y8 d8' `8b 88 * 88 88 88 8P 88ooo88 88 * 88 88 88 8b 88~~~88 88 * 88booo. `8b d8' Y8b d8 88 88 88booo. * Y88888P `Y88P' `Y88P' YP YP Y88888P * * */ //Use this to add more console.logs for this component const consoleFunctions = true; export default class FetchBanner extends React.Component { makeLargerCmdStyles() { const smaller = JSON.parse(JSON.stringify(this.props.bannerProps.bannerCmdReactCSS)); smaller.fontSize = 'larger'; smaller.marginRight = ''; return smaller; } buildNearBannerElements() { const elements = this.props.nearBannerElementsArray ? this.props.nearBannerElementsArray : []; return elements; } buildPropsFarBannerElements() { const farElements = []; if (this.props.farBannerElementsArray && this.props.farBannerElementsArray.length > 0) { this.props.farBannerElementsArray.map(ele => farElements.push(ele)); } if (this.props.bannerProps.showTricks === true) { farElements.push(null); } return farElements; } /*** * .o88b. .d88b. d8b db .d8888. d888888b d8888b. db db .o88b. d888888b .d88b. d8888b. * d8P Y8 .8P Y8. 888o 88 88' YP `~~88~~' 88 `8D 88 88 d8P Y8 `~~88~~' .8P Y8. 88 `8D * 8P 88 88 88V8o 88 `8bo. 88 88oobY' 88 88 8P 88 88 88 88oobY' * 8b 88 88 88 V8o88 `Y8b. 88 88`8b 88 88 8b 88 88 88 88`8b * Y8b d8 `8b d8' 88 V888 db 8D 88 88 `88. 88b d88 Y8b d8 88 `8b d8' 88 `88. * `Y88P' `Y88P' VP V8P `8888Y' YP 88 YD ~Y8888P' `Y88P' YP `Y88P' 88 YD * * */ constructor(props) { super(props); this._webPartHelpElement = getWebPartHelpElementX(this.props.WebPartHelpPivots, this.props.bannerProps); this.pimMeCmdStyles = null; /*** * d8b db d88888b .d8b. d8888b. d88888b .d8b. d8888b. d88888b db d88888b * 888o 88 88' d8' `8b 88 `8D 88' d8' `8b 88 `8D 88' 88 88' * 88V8o 88 88ooooo 88ooo88 88oobY' 88ooo 88ooo88 88oobY' 88ooooo 88 88ooooo * 88 V8o88 88~~~~~ 88~~~88 88`8b 88~~~ 88~~~88 88`8b 88~~~~~ 88 88~~~~~ * 88 V888 88. 88 88 88 `88. 88 88 88 88 `88. 88. 88booo. 88. * VP V8P Y88888P YP YP 88 YD YP YP YP 88 YD Y88888P Y88888P Y88888P * * */ this.nearBannerElements = this.buildNearBannerElements(); this._selectedIndex = (item) => { //This sends back the correct pivot category which matches the category on the tile. let e = event; let itemKey = item.props.itemKey; this.setState({ selectedKey: itemKey }); }; // https://github.com/mikezimm/fps-library-v2/issues/39 // if ( check4Gulp() === true ) console.log('FetchBannerElement ~ constructor'); const expandoProps = this.props.bannerProps.expandoProps; /** * Establish local variables for managing pin state depending on what is passed in. * This is because there is an option for the main webpart to manage pinMeState by passing in it's own update function and value. * By default, it is managed all by FPS Banner based on the settings from the property pane. */ const _pinMeState = this.props.pinState ? this.props.pinState : this.props.bannerProps.fpsPinMenu.defPinState; this._updatePinState = this.props.updatePinState ? this.props.updatePinState : this._updatePinStateHere.bind(this); this._pinMeState = _pinMeState; this.pimMeCmdStyles = this.makeLargerCmdStyles(); this.state = { showPanel: false, // keySiteProps: keySiteProps, // selectedKey: this.props.replacePanelHTML ? pivotHeadingX : pivotHeading0, //2022-01-31: Added Pivot Tiles selectedKey: pivotHeadingX, panelType: PanelType.medium, showSettings: false, showBeakerBanner: false, expandoramicMode: expandoProps.enableExpandoramic === true && expandoProps.expandoDefault === true ? true : false, // renderCount: 0, showPropsHelp: false, showEasyPages: false, pinState: _pinMeState, }; } componentDidMount() { // if ( check4Gulp() === true ) console.log('FetchBannerElement ~ componentDidMount'); this.pimMeCmdStyles = this.makeLargerCmdStyles(); //Copied from FPSPageInfo.tsx componentDidMount const { displayMode, fpsPinMenu } = this.props.bannerProps; // https://github.com/mikezimm/PageInfo/issues/116 const pinMeSearch = this._pinMeState === 'disabled' ? 'disabled' : window.location.search.toLowerCase().indexOf(`defpinstate=pinmini`) > -1 ? 'pinMini' : window.location.search.toLowerCase().indexOf(`defpinstate=pinfull`) > -1 ? 'pinFull' : window.location.search.toLowerCase().indexOf(`defpinstate=normal`) > -1 ? 'normal' : this._pinMeState; const tempPinState = displayMode === DisplayMode.Edit ? 'normal' : pinMeSearch; FPSPinMe(fpsPinMenu.domElement, tempPinState, null, false, true, null, fpsPinMenu.pageLayout, displayMode); } // /*** * d8888b. d888888b d8888b. db db d8888b. d8888b. .d8b. d888888b d88888b * 88 `8D `88' 88 `8D 88 88 88 `8D 88 `8D d8' `8b `~~88~~' 88' * 88 88 88 88 88 88 88 88oodD' 88 88 88ooo88 88 88ooooo * 88 88 88 88 88 88 88 88~~~ 88 88 88~~~88 88 88~~~~~ * 88 .8D .88. 88 .8D 88b d88 88 88 .8D 88 88 88 88. * Y8888D' Y888888P Y8888D' ~Y8888P' 88 Y8888D' YP YP YP Y88888P * * */ componentDidUpdate(prevProps) { if (check4This(Check4.fetchBannerX_Eq_true) === true) console.log('FetchBannerElement ~ componentDidUpdate: Props and State', this.props, this.state); const { displayMode, fpsPinMenu, refreshId } = this.props.bannerProps; const pinStatus = getDefaultFPSPinState(prevProps.bannerProps.fpsPinMenu, fpsPinMenu, displayMode); this.pimMeCmdStyles = this.makeLargerCmdStyles(); let refresh = false; if (pinStatus.refresh === true) { FPSPinMe(fpsPinMenu.domElement, pinStatus.defPinState, null, false, true, null, fpsPinMenu.pageLayout, displayMode); } if (this.props.refreshId !== prevProps.refreshId) { refresh = true; // } else if ( this.props.parentState.refreshId !== prevProps.parentState.refreshId ) { // refresh = true; } else if (this.props.bannerProps.refreshId !== prevProps.bannerProps.refreshId) { refresh = true; } else if (JSON.stringify(prevProps.panelPerformance) !== JSON.stringify(this.props.panelPerformance)) { refresh = true; } else if (prevProps.bonusHTML1 !== this.props.bonusHTML1) { refresh = true; } else if (prevProps.bonusHTML2 !== this.props.bonusHTML2) { refresh = true; } else if (typeof prevProps.appendTitle !== typeof this.props.appendTitle) { refresh = true; } else if (typeof prevProps.appendTitle === 'string' && typeof this.props.appendTitle === 'string' && prevProps.appendTitle && this.props.appendTitle) { refresh = true; } if (refresh === true) this._webPartHelpElement = getWebPartHelpElementX(this.props.WebPartHelpPivots, this.props.bannerProps); return refresh; } /*** * d8888b. d88888b d8b db d8888b. d88888b d8888b. * 88 `8D 88' 888o 88 88 `8D 88' 88 `8D * 88oobY' 88ooooo 88V8o 88 88 88 88ooooo 88oobY' * 88`8b 88~~~~~ 88 V8o88 88 88 88~~~~~ 88`8b * 88 `88. 88. 88 V888 88 .8D 88. 88 `88. * 88 YD Y88888P VP V8P Y8888D' Y88888P 88 YD * * */ render() { // if ( check4Gulp() === true ) console.log('FetchBannerElement ~ render' ); if (this.props.bannerProps.showBanner !== true) { return (React.createElement("div", null)); } else { const { bannerProps, } = this.props; const { displayMode, fpsPinMenu, fpsPageBGWPProps, easyPagesExtraProps, pageLayout } = bannerProps; // const { showBanner, showTricks, showRepoLinks } = bannerProps; const { showPanel, showSettings, showEasyPages, showPropsHelp, expandoramicMode } = this.state; const forceNarrowStyles = getForceNarrow(this._pinMeState, this._updatePinState); let farBannerElementsArray = this.buildPropsFarBannerElements(); // Add PintMe before WhiteRefresh because when it's needed, it should be right there farBannerElementsArray = updateFarElementsPinMe({ farBannerElementsArray: farBannerElementsArray, displayMode: displayMode, fpsPinMenu: fpsPinMenu, pinState: this._pinMeState, updatePinState: this._updatePinState, pimMeCmdStyles: this.pimMeCmdStyles }); farBannerElementsArray = updateFarElementsWhiteRefresh({ _showBeakerBanner: this._showBeakerBanner.bind(this), bannerProps: bannerProps, farBannerElementsArray: farBannerElementsArray }); const nearBannerElementsArray = updateNearElements(this.nearBannerElements, bannerProps, this.showSettings.bind(this), this._toggleExpando.bind(this), this._toggleEasyLinks.bind(this)); if (bannerProps.fpsCert.expirationMsg) nearBannerElementsArray.push(getCertElement(bannerProps, 'Bar', this.state.pinState, { padding: null })); /*** * d8888b. .d8b. d8b db d8b db d88888b d8888b. d88888b db d88888b .88b d88. d88888b d8b db d888888b * 88 `8D d8' `8b 888o 88 888o 88 88' 88 `8D 88' 88 88' 88'YbdP`88 88' 888o 88 `~~88~~' * 88oooY' 88ooo88 88V8o 88 88V8o 88 88ooooo 88oobY' 88ooooo 88 88ooooo 88 88 88 88ooooo 88V8o 88 88 * 88~~~b. 88~~~88 88 V8o88 88 V8o88 88~~~~~ 88`8b 88~~~~~ 88 88~~~~~ 88 88 88 88~~~~~ 88 V8o88 88 * 88 8D 88 88 88 V888 88 V888 88. 88 `88. 88. 88booo. 88. 88 88 88 88. 88 V888 88 * Y8888P' YP YP VP V8P VP V8P Y88888P 88 YD Y88888P Y88888P Y88888P YP YP YP Y88888P VP V8P YP * * */ // use passed in site themes if available or else use defaults from the main class const siteThemes = this.props.siteThemes ? this.props.siteThemes : bannerProps.siteThemes; const bannerContent = mainBannerContent({ ...bannerProps, ...{ appendTitle: this.props.appendTitle } }, forceNarrowStyles, siteThemes, nearBannerElementsArray, farBannerElementsArray, showSettings, showPropsHelp, this._openPanel.bind(this), this._togglePropsHelp.bind(this)); /*** * d888b d88888b d888888b .88b d88. d888888b d8b db d8888b. .d8b. d8b db d88888b db * 88' Y8b 88' `~~88~~' 88'YbdP`88 `88' 888o 88 88 `8D d8' `8b 888o 88 88' 88 * 88 88ooooo 88 88 88 88 88 88V8o 88 88oodD' 88ooo88 88V8o 88 88ooooo 88 * 88 ooo 88~~~~~ 88 88 88 88 88 88 V8o88 88~~~ 88~~~88 88 V8o88 88~~~~~ 88 * 88. ~8~ 88. 88 88 88 88 .88. 88 V888 88 88 88 88 V888 88. 88booo. * Y888P Y88888P YP YP YP YP Y888888P VP V8P 88 YP YP VP V8P Y88888P Y88888P * * */ let panelContent = null; if (showPanel === true && this.props.bannerProps.showFullPanel !== true) { panelContent = getMinPanel(this.props.bannerProps); /*** * d888b d88888b d888888b d88888b db db db db d8888b. .d8b. d8b db d88888b db * 88' Y8b 88' `~~88~~' 88' 88 88 88 88 88 `8D d8' `8b 888o 88 88' 88 * 88 88ooooo 88 88ooo 88 88 88 88 88oodD' 88ooo88 88V8o 88 88ooooo 88 * 88 ooo 88~~~~~ 88 88~~~ 88 88 88 88 88~~~ 88~~~88 88 V8o88 88~~~~~ 88 * 88. ~8~ 88. 88 88 88b d88 88booo. 88booo. 88 88 88 88 V888 88. 88booo. * Y888P Y88888P YP YP ~Y8888P' Y88888P Y88888P 88 YP YP VP V8P Y88888P Y88888P * * */ } else if (showPanel === true) { // Added contentPages to params for https://github.com/mikezimm/fps-library-v2/issues/9 panelContent = getFullPanel(this.props.bannerProps, this.state.selectedKey, this.state.panelType, this._selectedIndex.bind(this), this._panelWidth.bind(this), this.props.contentPages); } /*** * .o88b. .d88b. d8b db .d8888. d888888b d8888b. .d8b. d8b db d88888b db * d8P Y8 .8P Y8. 888o 88 88' YP `~~88~~' 88 `8D d8' `8b 888o 88 88' 88 * 8P 88 88 88V8o 88 `8bo. 88 88oodD' 88ooo88 88V8o 88 88ooooo 88 * 8b 88 88 88 V8o88 `Y8b. 88 88~~~ 88~~~88 88 V8o88 88~~~~~ 88 * Y8b d8 `8b d8' 88 V888 db 8D 88 88 88 88 88 V888 88. 88booo. * `Y88P' `Y88P' VP V8P `8888Y' YP 88 YP YP VP V8P Y88888P Y88888P * * */ const bannerPanel = React.createElement("div", null, React.createElement(Panel, { isOpen: showPanel, // this prop makes the panel non-modal isBlocking: true, onDismiss: this._closePanel.bind(this), closeButtonAriaLabel: "Close", type: this.state.panelType, isLightDismiss: true }, panelContent)); /*** * .d8888. d8888b. d88888b .o88b. d888888b .d8b. db * 88' YP 88 `8D 88' d8P Y8 `88' d8' `8b 88 * `8bo. 88oodD' 88ooooo 8P 88 88ooo88 88 * `Y8b. 88~~~ 88~~~~~ 8b 88 88~~~88 88 * db 8D 88 88. Y8b d8 .88. 88 88 88booo. * `8888Y' 88 Y88888P `Y88P' Y888888P YP YP Y88888P * * */ let SpecialElement = this.props.SpecialMessage ? createSpecialElement(this.props.SpecialMessage) : undefined; /*** * d8888b. d8888b. .d88b. d8888b. .d8888. db db d88888b db d8888b. * 88 `8D 88 `8D .8P Y8. 88 `8D 88' YP 88 88 88' 88 88 `8D * 88oodD' 88oobY' 88 88 88oodD' `8bo. 88ooo88 88ooooo 88 88oodD' * 88~~~ 88`8b 88 88 88~~~ `Y8b. 88~~~88 88~~~~~ 88 88~~~ * 88 88 `88. `8b d8' 88 db 8D 88 88 88. 88booo. 88 * 88 88 YD `Y88P' 88 `8888Y' YP YP Y88888P Y88888P 88 * * */ let propsHelp = null; if (this._webPartHelpElement) { propsHelp = React.createElement("div", { className: showPropsHelp !== true ? 'fps-pph-hide' : 'fps-pph-show' }, this._webPartHelpElement ? this._webPartHelpElement : null); } // Migrated in from SlickSections const ShowParmaLinks = fpsPageBGWPProps._allowFullPageBG === false ? [] : [...FullPageBGParams]; const BeakerBannerElement = this.state.showBeakerBanner !== true ? undefined : React.createElement("div", { style: { padding: '1em', background: 'hsl(0deg 0% 100% / 76%)', color: 'black' } }, ShowParmaLinks.length > 0 ? paramLinks(ShowParmaLinks, bannerProps.addParamToUrl) : undefined, this.props.beakerBannerContent ? this.props.beakerBannerContent : undefined); const EasyPagesElement = React.createElement(EasyPagesHook, { easyPagesExtraProps: { ...easyPagesExtraProps, ...{ easyPagesExpanded: showEasyPages, easyPagesToggleExpanded: this._toggleEasyLinks.bind(this) } }, easyPagesSourceProps: bannerProps.easyPagesSourceProps, EasyIconsObject: bannerProps.EasyIconsObject, forceSPAStyle: expandoramicMode === true ? true : false, easyAnalyticsProps: bannerProps.easyAnalyticsProps }); /*** * d8888b. d88888b d888888b db db d8888b. d8b db * 88 `8D 88' `~~88~~' 88 88 88 `8D 888o 88 * 88oobY' 88ooooo 88 88 88 88oobY' 88V8o 88 * 88`8b 88~~~~~ 88 88 88 88`8b 88 V8o88 * 88 `88. 88. 88 88b d88 88 `88. 88 V888 * 88 YD Y88888P YP ~Y8888P' 88 YD VP V8P * * */ const bannerClasses = ['banner-component']; if (easyPagesExtraProps.bannerPillShape === true) bannerClasses.push('bannerPillShapeSideMargin'); bannerClasses.push(displayMode === DisplayMode.Edit ? 'fps-display-edit' : 'fps-display-view'); const PropPanelHelpMessage = displayMode === DisplayMode.Edit ? React.createElement("div", { className: `fps-pph-look-here ${showPropsHelp !== true ? '' : 'hideLookHere'}` }, React.createElement("span", { className: 'fps-gen-text-ellipse' }, "Click yellow button to see Help on this web part."), React.createElement(Icon, { iconName: 'TouchPointer' })) : undefined; const hard = bannerProps.hardExp === true && checkCert(bannerProps) === false ? getMsg(bannerProps) : undefined; return (React.createElement("div", { className: bannerClasses.join(' ') }, pageLayout === 'SingleWebPartAppPageLayout' || expandoramicMode === true ? FullPageBGImageElement(bannerProps.fpsPageBGWPProps) : undefined, SpecialElement, bannerContent, PropPanelHelpMessage, EasyPagesElement, BeakerBannerElement, propsHelp, bannerPanel, hard) // //If refreshId={ this.props.parentState.refreshId } -- causes React minified error #85 // refreshId={ this.props.refreshId ? this.props.refreshId : '' } // displayMode={ bannerProps.displayMode } // WebPartHelpElement={ this.props.bannerProps.WebPartHelpElement } // SpecialMessage={ this.props.SpecialMessage } // forceNarrowStyles= { forceNarrowStyles } // contentPages= { this.props.contentPages } // feedbackEmail= { bannerProps.feedbackEmail } // FPSUser={ bannerProps.FPSUser } // exportProps={ bannerProps.exportProps } // showBanner={ bannerProps.showBanner } // // Adding this to adjust expected width for when prop pane could be opened // bannerWidth={ ( bannerProps.bannerWidth ) } // pageContext={ bannerProps.pageContext } // pageLayout={ bannerProps.pageLayout } // title ={ bannerTitle } // appendTitle ={ this.props.appendTitle } // panelTitle = { bannerProps.panelTitle } // infoElement = { bannerProps.infoElement } // bannerReactCSS={ bannerProps.bannerReactCSS } // bannerCmdReactCSS={ bannerProps.bannerCmdReactCSS } // showTricks={ bannerProps.showTricks } // showGoToParent={ bannerProps.showGoToParent } // showGoToHome={ bannerProps.showGoToHome } // onHomePage={ bannerProps.onHomePage } // webpartHistory={ bannerProps.webpartHistory } // showBannerGear={ bannerProps.showBannerGear } // showFullPanel={ bannerProps.showFullPanel } // replacePanelHTML={ this.props.replacePanelHTML ? this.props.replacePanelHTML : bannerProps.replacePanelHTML } // bonusHTML1={ this.props.bonusHTML1 ? this.props.bonusHTML1 : null } // panelPerformance={ this.props.panelPerformance ? this.props.panelPerformance : null as any } // bonusHTML2={ this.props.bonusHTML2 ? this.props.bonusHTML2 : null } // replacePanelWarning={ bannerProps.replacePanelWarning } // hoverEffect={ bannerProps.hoverEffect } // gitHubRepo={ bannerProps.gitHubRepo } // earyAccess={ bannerProps.earyAccess } // wideToggle={ bannerProps.wideToggle } // nearElements = { this.nearBannerElements } // farElements = { farBannerElementsArray } // showRepoLinks={ bannerProps.showRepoLinks } // showExport={ bannerProps.showExport } // //2022-02-17: Added these for expandoramic mode // domElement = { bannerProps.domElement } // enableExpandoramic = { bannerProps.enableExpandoramic } // expandoDefault = { bannerProps.expandoDefault } // expandoStyle = { bannerProps.expandoStyle} // expandAlert = { bannerProps.expandAlert } // expandConsole = { bannerProps.expandConsole } // expandoPadding = { bannerProps.expandoPadding } // beAUser = { bannerProps.beAUser } // showBeAUserIcon = { bannerProps.showBeAUserIcon } // beAUserFunction={ bannerProps.beAUserFunction } ); } } _toggleEasyLinks() { const newSetting = !this.state.showEasyPages; this._heightOverRide(newSetting, this.state.showSettings, newSetting === true ? 'pinFull' : this.state.pinState); // show as full if new setting is true so it always expands this.setState({ showEasyPages: newSetting, // https://github.com/mikezimm/fps-library-v2/issues/32 showSettings: newSetting === true ? false : this.state.showSettings, }); } _heightOverRide(showEasyPages, showSettings, pinState) { let overRide = showEasyPages === true || showSettings === true ? true : false; if (pinState === 'pinMini') { overRide = false; } // Always collapse if you are making it smaller else if (pinState === 'disabled' || this.state.pinState === 'disabled') overRide = false; // Removes vertical scroll bar if pinMe is disabled FPSMinMeOverRide(this.props.bannerProps.fpsPinMenu.domElement, overRide, 'pinMeOverRideMxHt100P'); } _toggleExpando() { const { domElement, pageLayout } = this.props.bannerProps; const { expandoStyle, expandAlert, expandConsole, expandoPadding } = this.props.bannerProps.expandoProps; const newMode = this.state.expandoramicMode === true ? false : true; setExpandoRamicMode(this.props.bannerProps.fpsPageBGWPProps.fullPageImage, domElement, newMode, expandoStyle, expandAlert, expandConsole, expandoPadding, pageLayout); // if ( this.state.expandoramicMode === true ) { this.setState({ expandoramicMode: newMode, }); // } else { // this.setState({ showPanel: true,}); // } } _updatePinStateHere(newValue) { this._pinMeState = newValue; this._heightOverRide(this.state.showEasyPages, this.state.showSettings, newValue); this.setState({ pinState: newValue, }); } showSettings() { const newSetting = !this.state.showSettings; this._heightOverRide(this.state.showEasyPages, newSetting, newSetting === true ? 'pinFull' : this.state.pinState); // show as full if new setting is true so it always expands this.setState({ showSettings: newSetting, // https://github.com/mikezimm/fps-library-v2/issues/32 showEasyPages: newSetting === true ? false : this.state.showEasyPages, }); // showEasyPages: newSetting === true ? false : this.state.showSettings, }); } _showBeakerBanner() { this.setState({ showBeakerBanner: this.state.showBeakerBanner === true ? false : true }); } _closePanel() { this.setState({ showPanel: false, }); } _openPanel(event) { let textCallback = event.currentTarget.dataset.callback; if (textCallback && textCallback.length > 0) { //Do Nothing } else { this.setState({ showPanel: true, }); } } _panelWidth() { let newPanelType = this.state.panelType !== PanelType.medium ? PanelType.medium : PanelType.large; this.setState({ panelType: newPanelType, }); } _togglePropsHelp() { let newState = this.state.showPropsHelp === true ? false : true; this.setState({ showPropsHelp: newState }); } } //# sourceMappingURL=FetchBannerY.js.map