UNPKG

@microsoft/sp-webpart-base

Version:

SharePoint Framework support for building web parts

468 lines 20.7 kB
import { PropertyPaneCustomField as SPPropertyPane_PropertyPaneCustomField } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneCustomField/PropertyPaneCustomField'; import { PropertyPaneButton as SPPropertyPane_PropertyPaneButton } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneButton/PropertyPaneButton'; import { PropertyPaneCheckbox as SPPropertyPane_PropertyPaneCheckbox } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneCheckBox/PropertyPaneCheckbox'; import { PropertyPaneChoiceGroup as SPPropertyPane_PropertyPaneChoiceGroup } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneChoiceGroup/PropertyPaneChoiceGroup'; import { PropertyPaneDropdown as SPPropertyPane_PropertyPaneDropdown } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneDropdown/PropertyPaneDropdown'; import { PropertyPaneDynamicField as SPPropertyPane_PropertyPaneDynamicField } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneDynamicField/PropertyPaneDynamicField'; import { PropertyPaneDynamicFieldSet as SPPropertyPane_PropertyPaneDynamicFieldSet } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneDynamicFieldSet/PropertyPaneDynamicFieldSet'; import { PropertyPaneHorizontalRule as SPPropertyPane_PropertyPaneHorizontalRule } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneHorizontalRule/PropertyPaneHorizontalRule'; import { PropertyPaneLabel as SPPropertyPane_PropertyPaneLabel } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneLabel/PropertyPaneLabel'; import { PropertyPaneToggle as SPPropertyPane_PropertyPaneToggle } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneToggle/PropertyPaneToggle'; import { PropertyPaneDynamicTextField as SPPropertyPane_PropertyPaneDynamicTextField } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneDynamicTextField/PropertyPaneDynamicTextField'; import { PropertyPaneTextField as SPPropertyPane_PropertyPaneTextField } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneTextField/PropertyPaneTextField'; import { PropertyPaneLink as SPPropertyPane_PropertyPaneLink } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneLink/PropertyPaneLink'; import { PropertyPaneSlider as SPPropertyPane_PropertyPaneSlider } from '@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneSlider/PropertyPaneSlider'; // ******************** Functions ******************** /** * Helper method to create a custom field on the PropertyPane. * * @remarks * The purpose of the custom field is to help the web part developer to add a custom control to * the PropertyPane. The PropertyPane supports a host of inbuilt field types. While * this list meets the demands of most web parts, but there are exceptional cases * when web parts have special needs and need a special control. The custom field * helps fill that gap. * * @param properties - Strongly typed Custom field properties. * * @beta * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneCustomField(properties) { return SPPropertyPane_PropertyPaneCustomField(properties); } /** * Helper method to create a Button on the PropertyPane. * @param targetProperty - Target property the Button is associated to. * @param properties - Strongly typed Button properties. * * @public * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneButton(targetProperty, properties) { return SPPropertyPane_PropertyPaneButton(targetProperty, properties); } /** * Helper method to create a Checkbox on the PropertyPane. * @param targetProperty - Target property the checkbox is associated to. * @param properties - Strongly typed Checkbox properties. * * @public * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneCheckbox(targetProperty, properties) { return SPPropertyPane_PropertyPaneCheckbox(targetProperty, properties); } /** * Helper method to create a Choice Group on the PropertyPane. * @param targetProperty - Target property the choice group is associated to. * @param properties - Strongly typed Choice Group properties. * * @public * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneChoiceGroup(targetProperty, properties) { return SPPropertyPane_PropertyPaneChoiceGroup(targetProperty, properties); } /** * Helper method to create a Dropdown on the PropertyPane. * @param targetProperty - Target property the dropdown is associated to. * @param properties - Strongly typed Dropdown properties. * * @public * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneDropdown(targetProperty, properties) { return SPPropertyPane_PropertyPaneDropdown(targetProperty, properties); } /** * Helper method to create a Dynamic Data widget on the PropertyPane for a dynamic field. * * @param targetProperty - Target property the Dynamic Data widget is associated to. * * @public * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneDynamicField(targetProperty, properties) { return SPPropertyPane_PropertyPaneDynamicField(targetProperty, properties); } /** * Helper method to create a Dynamic Data widget on the Property Pane for a set * of dynamic fields with a common data source. * * These fields can possibly share the same property based on the associated filters. * @param properties - Contains entries and options, described as below: * entries - A set of entries to be configured by the widget. Each entry includes the target * property and, optionally, the label to show. * options - Options enabling customized values for callback, filters etc., * for the given set of dynamic fields. * @public * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneDynamicFieldSet(properties) { return SPPropertyPane_PropertyPaneDynamicFieldSet(properties); } /** * Helper method to create a Horizontal Rule on the PropertyPane. * * @public * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneHorizontalRule() { return SPPropertyPane_PropertyPaneHorizontalRule(); } /** * Helper method to create a Label on the PropertyPane. * @param targetProperty - Target property the label is associated to. * @param properties - Strongly typed Label properties. * * @public * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneLabel(targetProperty, properties) { return SPPropertyPane_PropertyPaneLabel(targetProperty, properties); } /** * Helper method to create a Link on the PropertyPane. * @param targetProperty - Target property the Link is associated to. * @param properties - Strongly typed Link properties. * * @public * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneLink(targetProperty, properties) { return SPPropertyPane_PropertyPaneLink(targetProperty, properties); } /** * Helper method to create a Slider on the PropertyPane. * @param targetProperty - Target property the slider is associated to. * @param properties - Strongly typed Slider properties. * * @public * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneSlider(targetProperty, properties) { return SPPropertyPane_PropertyPaneSlider(targetProperty, properties); } /** * Helper method to create a TextField on the PropertyPane. * @param targetProperty - Target property the textfield is associated to. * @param properties - Strongly typed TextField properties. * * @public * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneTextField(targetProperty, properties) { return SPPropertyPane_PropertyPaneTextField(targetProperty, properties); } /** * Helper method to create a Toggle on the PropertyPane. * @param targetProperty - Target property the toggle is associated to. * @param properties - Strongly typed Toggle properties. * * @public * @deprecated This is obsolete now. This function has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneToggle(targetProperty, properties) { return SPPropertyPane_PropertyPaneToggle(targetProperty, properties); } /** * Helper method to create a Dynamic TextField on the PropertyPane. * @param targetProperty - Target property the dynamic textfield is associated to. * @param properties - Properties of the PropertyPaneDynamicTextField. * * @beta * @deprecated This has been replaced by PropertyPaneDynamicField and moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export function PropertyPaneDynamicTextField(targetProperty, properties) { return SPPropertyPane_PropertyPaneDynamicTextField(targetProperty, properties); } // ******************** Enums ******************** /** * Describes different kinds of possible property pane actions. * * @internal * @deprecated This is obsolete now. This enum has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ // eslint-disable-next-line @typescript-eslint/typedef export var _PropertyPaneAction = { /** * Ask the property pane to open */ Open: 1, /** * Ask the property pane to close */ Close: 2, /** * Ask the property pane to toggle */ Toggle: 3, /** * Default action * * Ask the property pane to open if it is already open, with the newly selected * component's configuration else ask to close it. */ Default: 4, /** * Ask the property pane to refresh the contents. * * Property pane refreshes its contents only if the asking component is same as the * one which is being configured currently. In any other case the call is ignored. */ Refresh: 5 }; /** * Enum for all the supported PropertyPane field types. * * Names should be consistent with those in office-ui-fabric-react, be careful to get letter casing correct. * * @public * @deprecated This is obsolete now. This enum has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export var PropertyPaneFieldType; (function (PropertyPaneFieldType) { /** * Custom field. */ PropertyPaneFieldType[PropertyPaneFieldType["Custom"] = 1] = "Custom"; /** * Checkbox field. */ PropertyPaneFieldType[PropertyPaneFieldType["CheckBox"] = 2] = "CheckBox"; /** * TextField field. */ PropertyPaneFieldType[PropertyPaneFieldType["TextField"] = 3] = "TextField"; /** * Toggle field. */ PropertyPaneFieldType[PropertyPaneFieldType["Toggle"] = 5] = "Toggle"; /** * Dropdown field. */ PropertyPaneFieldType[PropertyPaneFieldType["Dropdown"] = 6] = "Dropdown"; /** * Label field. */ PropertyPaneFieldType[PropertyPaneFieldType["Label"] = 7] = "Label"; /** * Slider field. */ PropertyPaneFieldType[PropertyPaneFieldType["Slider"] = 8] = "Slider"; /** * Heading field. */ PropertyPaneFieldType[PropertyPaneFieldType["Heading"] = 9] = "Heading"; /** * Choice Group field. */ PropertyPaneFieldType[PropertyPaneFieldType["ChoiceGroup"] = 10] = "ChoiceGroup"; /** * Button field. */ PropertyPaneFieldType[PropertyPaneFieldType["Button"] = 11] = "Button"; /** * Horizontal Rule field. */ PropertyPaneFieldType[PropertyPaneFieldType["HorizontalRule"] = 12] = "HorizontalRule"; /** * Link field. */ PropertyPaneFieldType[PropertyPaneFieldType["Link"] = 13] = "Link"; /** * Dynamic data field. * @public */ PropertyPaneFieldType[PropertyPaneFieldType["DynamicField"] = 14] = "DynamicField"; /** * Dynamic Text Field * * @beta * @deprecated - Please use DynamicField */ PropertyPaneFieldType[PropertyPaneFieldType["DynamicTextField"] = 15] = "DynamicTextField"; /** * A set of dynamic fields. * @public */ PropertyPaneFieldType[PropertyPaneFieldType["DynamicFieldSet"] = 16] = "DynamicFieldSet"; /** * Spin button * * @alpha */ PropertyPaneFieldType[PropertyPaneFieldType["SpinButton"] = 17] = "SpinButton"; /** * Thumbnail picker field. * * @beta */ PropertyPaneFieldType[PropertyPaneFieldType["ThumbnailPicker"] = 18] = "ThumbnailPicker"; /** * Icon picker field. * * @beta */ PropertyPaneFieldType[PropertyPaneFieldType["IconPicker"] = 19] = "IconPicker"; /** * Alternative Text toggle and text field. * * @beta */ PropertyPaneFieldType[PropertyPaneFieldType["AlternativeText"] = 20] = "AlternativeText"; /** * Webpart Title Heading toggle and dropdown * @internal */ PropertyPaneFieldType[PropertyPaneFieldType["WebPartTitleHeading"] = 21] = "WebPartTitleHeading"; /** * Sortable Accordion field * @internal */ PropertyPaneFieldType[PropertyPaneFieldType["SortableAccordion"] = 22] = "SortableAccordion"; })(PropertyPaneFieldType || (PropertyPaneFieldType = {})); /** * Enum for all the supported button types. * * @public * @deprecated This is obsolete now. This enum has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export var PropertyPaneButtonType; (function (PropertyPaneButtonType) { /** * Optional completion action. * * @remarks * Typically used at the end of a form or task when paired with the Primary button OR * as a standalone button to undo an action. * Examples: "Done" button which closes a container but doesn't make a server call or * an "Undo" button when a user is uploading a file in OneDrive. */ PropertyPaneButtonType[PropertyPaneButtonType["Normal"] = 0] = "Normal"; /** * Preferred completion action when paired with a Standard button. * * @remarks * Typically used at the end of a task or form. * Examples: "Create", "Save", "Send" which makes a server call. */ PropertyPaneButtonType[PropertyPaneButtonType["Primary"] = 1] = "Primary"; /** * Hero button. */ PropertyPaneButtonType[PropertyPaneButtonType["Hero"] = 2] = "Hero"; /** * Always used as a set with both Standard and Primary compound buttons. * * @remarks * Typically used in a confirmation dialog. * Examples: A confirmation dialog when a user discards a form or task with a possible * significant time investment such as an email or a complex form */ PropertyPaneButtonType[PropertyPaneButtonType["Compound"] = 3] = "Compound"; /** * Optional actions. * * @remarks * Typically used in a command bar at the top of a view, panel and inside an inline command bar. * Examples: Command bar at the top of OneDrive, Outlook, SharePoint. Inline command bar on the * top of SharePoint web parts. */ PropertyPaneButtonType[PropertyPaneButtonType["Command"] = 4] = "Command"; /** * Same usage as Command button, when real estate does not allow for icons + labels or as secondary * actions within the command bar. * * @remarks * Typically used in Command bar in small and medium responsive web breakpoints. Also used on objects. * Examples: OneDrive small and medium responsive web breakpoint Command Bars and view icons within the * Command Bar. In SharePoint and OneDrive, Cards with social actions and images which allow users to * access the image picker. In SharePoint, formatting experiences such as formatting a story within the * Authoring experience. In Calendar, in the bottom of an event creation Callout when clicking inside * an empty time range. */ PropertyPaneButtonType[PropertyPaneButtonType["Icon"] = 5] = "Icon"; })(PropertyPaneButtonType || (PropertyPaneButtonType = {})); /** * Specifies the type of option in a dropdown menu rendered by {@link PropertyPaneDropdown}. * * @public * @deprecated This is obsolete now. This enum has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export var PropertyPaneDropdownOptionType; (function (PropertyPaneDropdownOptionType) { /** * Render normal menu item. */ PropertyPaneDropdownOptionType[PropertyPaneDropdownOptionType["Normal"] = 0] = "Normal"; /** * Render a divider. */ PropertyPaneDropdownOptionType[PropertyPaneDropdownOptionType["Divider"] = 1] = "Divider"; /** * Render menu item as a header. */ PropertyPaneDropdownOptionType[PropertyPaneDropdownOptionType["Header"] = 2] = "Header"; })(PropertyPaneDropdownOptionType || (PropertyPaneDropdownOptionType = {})); /** * Enum for the possible values of shared depth of the dynamic data reference. * * @public * @deprecated This is obsolete now. This enum has been moved to `@microsoft/sp-property-pane`. * Please consume it from there. * @remarks We have left the original implementation here to avoid breaking the public API contract. */ export var DynamicDataSharedDepth; (function (DynamicDataSharedDepth) { /** * Indicates that nothing is shared. */ DynamicDataSharedDepth[DynamicDataSharedDepth["None"] = 0] = "None"; /** * Indicates that the dynamic data source is shared. */ DynamicDataSharedDepth[DynamicDataSharedDepth["Source"] = 1] = "Source"; /** * Indicates that both the dynamic data source and the property are shared. */ DynamicDataSharedDepth[DynamicDataSharedDepth["Property"] = 2] = "Property"; })(DynamicDataSharedDepth || (DynamicDataSharedDepth = {})); //# sourceMappingURL=SPPropertyPane.js.map