@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
116 lines (114 loc) • 5.98 kB
JavaScript
/**
* CodeAnalizerComment: Updated 5 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 { PrincipalTypeSPFxPeopleGroup } to '@mikezimm/fps-core-v7/lib/types/spfxPropControls/@3.11.0/IPropertyFieldGroupOrPerson;'
* Update:: import { IThisFPSWebPartClass } to '@mikezimm/fps-core-v7/lib/banner/FPSWebPartClass/IThisFPSWebPartClass1152;'
* Update:: import { IMinCustomHelpProps } to '@mikezimm/fps-core-v7/lib/banner/components/VisitorPanel/Interfaces;'
* Update:: import { EveryoneAudienceChoices } to '@mikezimm/fps-core-v7/lib/types/fps-common/AudienceInterfaces;'
*/
/**
* CodeAnalizerComment: Updated 6 imports on 2024-09-21 23:07:24
* Update:: import { IPropertyPaneDropdownOption } to '@mikezimm/fps-core-v7/lib/types/@msft/1.15.2/sp-property-pane;'
* Update:: import { IPropertyPaneDropdownProps } to '@mikezimm/fps-core-v7/lib/types/@msft/1.15.2/sp-property-pane;'
* Update:: import { PrincipalType } to '@mikezimm/fps-core-v7/lib/types/@pnp/@2.14.0/sp/types;'
* Update:: import { IThisFPSWebPartClass } to '@mikezimm/fps-core-v7/lib/banner/FPSWebPartClass/IThisFPSWebPartClass1152;'
* Update:: import { IMinCustomHelpProps } to '@mikezimm/fps-core-v7/lib/banner/components/VisitorPanel/Interfaces;'
* Update:: import { EveryoneAudienceChoices } to '@mikezimm/fps-core-v7/lib/types/fps-class/prop-pane/AudienceInterfaces;'
*/
import { PropertyPaneTextField, PropertyPaneToggle, PropertyPaneDropdown } from '@microsoft/sp-property-pane';
import { EveryoneAudienceChoices } from '@mikezimm/fps-core-v7/lib/types/fps-common/AudienceInterfaces';
import { PropertyPaneFpsPeoplePicker } from '../../../components/atoms/Inputs/PeoplePicker/fps-PropPanePeoplePicker';
/**
* FPSBanner3VisHelpGroup - Builds FPS Banner Visitor Help Group:
* fullPanelAudience, panelMessageDescription1, panelMessageSupport,
* panelMessageDocumentation, documentationLinkUrl, supportContacts, documentationLinkDesc,
* panelMessageIfYouStill, supportContacts
*
*/
// export function FPSBanner3VisHelpGroup( wpContext: any, onPropertyPaneFieldChanged: any, wpProperties: any ) {
export function FPSBanner3VisHelpGroup(thisWPClass) {
let fields = BannerPropVisHelp(thisWPClass, thisWPClass.properties);
let bannerGroup = { groupName: 'Visitor Help Info (required)',
isCollapsed: true,
groupFields: fields
};
return bannerGroup;
}
/**
* Generates prop pane FIELDS for: bannerStyleChoice, bannerStyle, bannerCmdStyle, bannerHoverEffect
*/
export function BannerPropVisHelp(thisWPClass, wpProperties) {
let fields = [];
let disabled = wpProperties.showCustomHelp === false ? true : false;
fields.push(PropertyPaneToggle('showCustomHelp', {
label: 'Enable custom help panel', offText: 'Disable', onText: 'Enable',
}));
fields.push(PropertyPaneDropdown('fullPanelAudience', {
label: 'Full Help Panel Audience',
options: EveryoneAudienceChoices,
disabled: disabled,
}));
fields.push(PropertyPaneTextField('panelMessageDescription1', {
label: 'Panel Description',
description: 'Optional message displayed at the top of the panel for the end user to see.',
disabled: disabled,
}));
fields.push(PropertyPaneTextField('panelMessageSupport', {
label: 'Support Message',
description: 'Optional message to the user when looking for support',
disabled: disabled,
}));
fields.push(PropertyPaneTextField('panelMessageDocumentation', {
label: 'Documentation message',
description: 'Optional message to the user shown directly above the Documentation link',
disabled: disabled,
}));
fields.push(PropertyPaneTextField('documentationLinkUrl', {
label: 'PASTE a Documentation Link',
description: 'REQUIRED: A valid link to documentation - DO NOT TYPE in or webpart will lage',
disabled: disabled,
}));
fields.push(PropertyPaneTextField('documentationLinkDesc', {
label: 'Documentation Description',
description: 'Optional: Text user sees as the clickable documentation link',
disabled: disabled,
}));
fields.push(PropertyPaneTextField('panelMessageIfYouStill', {
label: 'If you still have... message',
description: 'If you have more than one contact, explain who to call for what',
disabled: disabled,
}));
// fields.push( PropertyFieldPeoplePicker('supportContacts', {
// label: 'Support Contacts',
// initialData: wpProperties.supportContacts,
// allowDuplicate: false,
// principalType: [ PrincipalType.Users, ],
// onPropertyChange: onPropertyPaneFieldChanged,
// //Had to cast to get it to work
// //https://github.com/pnp/sp-dev-fx-controls-react/issues/851#issuecomment-978990638
// context: wpContext as any,
// properties: wpProperties,
// onGetErrorMessage: undefined, // 2022-12-12: Changed from null to undefined to resolve linting error
// deferredValidationTime: 0,
// key: 'peopleFieldId',
// disabled: disabled,
// }) );
fields.push(PropertyPaneFpsPeoplePicker({
targetProperty: 'supportContacts',
key: 'supportContacts',
preFilter: 'UserWithEmail',
fpsSpService: thisWPClass._fpsSpService,
label: 'Support Contacts',
initialData: wpProperties.supportContacts,
onPropertyChange: (newUsers) => {
wpProperties.supportContacts = newUsers;
thisWPClass.context.propertyPane.refresh();
},
multiSelect: true,
typeToShow: true,
size: 'M',
disabled: disabled,
}));
return fields;
}
//# sourceMappingURL=FPSOptionsGroupVisHelp.js.map