@microsoft/sp-webpart-base
Version:
SharePoint Framework support for building web parts
442 lines • 20.5 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DynamicDataSharedDepth = exports.PropertyPaneDropdownOptionType = exports.PropertyPaneButtonType = exports.PropertyPaneFieldType = exports.PropertyPaneDynamicTextField = exports.PropertyPaneToggle = exports.PropertyPaneTextField = exports.PropertyPaneSlider = exports.PropertyPaneLink = exports.PropertyPaneLabel = exports.PropertyPaneHorizontalRule = exports.PropertyPaneDynamicFieldSet = exports.PropertyPaneDynamicField = exports.PropertyPaneDropdown = exports.PropertyPaneChoiceGroup = exports.PropertyPaneCheckbox = exports.PropertyPaneButton = exports.PropertyPaneCustomField = void 0;
var PropertyPaneCustomField_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneCustomField/PropertyPaneCustomField");
var PropertyPaneButton_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneButton/PropertyPaneButton");
var PropertyPaneCheckbox_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneCheckBox/PropertyPaneCheckbox");
var PropertyPaneChoiceGroup_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneChoiceGroup/PropertyPaneChoiceGroup");
var PropertyPaneDropdown_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneDropdown/PropertyPaneDropdown");
var PropertyPaneDynamicField_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneDynamicField/PropertyPaneDynamicField");
var PropertyPaneDynamicFieldSet_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneDynamicFieldSet/PropertyPaneDynamicFieldSet");
var PropertyPaneHorizontalRule_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneHorizontalRule/PropertyPaneHorizontalRule");
var PropertyPaneLabel_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneLabel/PropertyPaneLabel");
var PropertyPaneToggle_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneToggle/PropertyPaneToggle");
var PropertyPaneDynamicTextField_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneDynamicTextField/PropertyPaneDynamicTextField");
var PropertyPaneTextField_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneTextField/PropertyPaneTextField");
var PropertyPaneLink_1 = require("@microsoft/sp-property-pane/lib/propertyPaneFields/propertyPaneLink/PropertyPaneLink");
var PropertyPaneSlider_1 = require("@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.
*/
function PropertyPaneCustomField(properties) {
return (0, PropertyPaneCustomField_1.PropertyPaneCustomField)(properties);
}
exports.PropertyPaneCustomField = PropertyPaneCustomField;
/**
* 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.
*/
function PropertyPaneButton(targetProperty, properties) {
return (0, PropertyPaneButton_1.PropertyPaneButton)(targetProperty, properties);
}
exports.PropertyPaneButton = PropertyPaneButton;
/**
* 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.
*/
function PropertyPaneCheckbox(targetProperty, properties) {
return (0, PropertyPaneCheckbox_1.PropertyPaneCheckbox)(targetProperty, properties);
}
exports.PropertyPaneCheckbox = PropertyPaneCheckbox;
/**
* 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.
*/
function PropertyPaneChoiceGroup(targetProperty, properties) {
return (0, PropertyPaneChoiceGroup_1.PropertyPaneChoiceGroup)(targetProperty, properties);
}
exports.PropertyPaneChoiceGroup = PropertyPaneChoiceGroup;
/**
* 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.
*/
function PropertyPaneDropdown(targetProperty, properties) {
return (0, PropertyPaneDropdown_1.PropertyPaneDropdown)(targetProperty, properties);
}
exports.PropertyPaneDropdown = PropertyPaneDropdown;
/**
* 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.
*/
function PropertyPaneDynamicField(targetProperty, properties) {
return (0, PropertyPaneDynamicField_1.PropertyPaneDynamicField)(targetProperty, properties);
}
exports.PropertyPaneDynamicField = PropertyPaneDynamicField;
/**
* 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.
*/
function PropertyPaneDynamicFieldSet(properties) {
return (0, PropertyPaneDynamicFieldSet_1.PropertyPaneDynamicFieldSet)(properties);
}
exports.PropertyPaneDynamicFieldSet = PropertyPaneDynamicFieldSet;
/**
* 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.
*/
function PropertyPaneHorizontalRule() {
return (0, PropertyPaneHorizontalRule_1.PropertyPaneHorizontalRule)();
}
exports.PropertyPaneHorizontalRule = 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.
*/
function PropertyPaneLabel(targetProperty, properties) {
return (0, PropertyPaneLabel_1.PropertyPaneLabel)(targetProperty, properties);
}
exports.PropertyPaneLabel = PropertyPaneLabel;
/**
* 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.
*/
function PropertyPaneLink(targetProperty, properties) {
return (0, PropertyPaneLink_1.PropertyPaneLink)(targetProperty, properties);
}
exports.PropertyPaneLink = PropertyPaneLink;
/**
* 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.
*/
function PropertyPaneSlider(targetProperty, properties) {
return (0, PropertyPaneSlider_1.PropertyPaneSlider)(targetProperty, properties);
}
exports.PropertyPaneSlider = PropertyPaneSlider;
/**
* 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.
*/
function PropertyPaneTextField(targetProperty, properties) {
return (0, PropertyPaneTextField_1.PropertyPaneTextField)(targetProperty, properties);
}
exports.PropertyPaneTextField = PropertyPaneTextField;
/**
* 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.
*/
function PropertyPaneToggle(targetProperty, properties) {
return (0, PropertyPaneToggle_1.PropertyPaneToggle)(targetProperty, properties);
}
exports.PropertyPaneToggle = PropertyPaneToggle;
/**
* 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.
*/
function PropertyPaneDynamicTextField(targetProperty, properties) {
return (0, PropertyPaneDynamicTextField_1.PropertyPaneDynamicTextField)(targetProperty, properties);
}
exports.PropertyPaneDynamicTextField = PropertyPaneDynamicTextField;
/**
* 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.
*/
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";
})(PropertyPaneFieldType = exports.PropertyPaneFieldType || (exports.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.
*/
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 = exports.PropertyPaneButtonType || (exports.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.
*/
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 = exports.PropertyPaneDropdownOptionType || (exports.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.
*/
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 = exports.DynamicDataSharedDepth || (exports.DynamicDataSharedDepth = {}));
//# sourceMappingURL=SPPropertyPane.js.map