IComponentPropertyMetadata interface
This is the structure used for map values for component properties metadata.
Properties
is |
Indicates whether the property should be serialized as HTML. |
is |
Indicates if the property contains a link. This allows SharePoint server to treat the value as such and perform services like link fix-up, search indexing, loading from CDN, etc. |
is |
Indicates if the property contains a link. This allows SharePoint server to treat the value as such and perform services like search indexing, link fix-up, loading from CDN, etc. |
is |
Indicates if the property contains plain text that should be search-indexed by SharePoint. |
should |
Indicates if the framework should persist the property on the server. |
Property Details
isHtmlString
Indicates whether the property should be serialized as HTML.
isHtmlString?: boolean;
Property Value
boolean
Remarks
This flag instructs framework to store the value as HTML, so that SharePoint can perform the following services on it:
normalizing HTML encodings
stripping unsafe HTML tags (i.e. for usage with Element.innerHTML)
search indexing
SharePoint link fix-up
Only enable this flag for HTML content where these modifications are acceptable. If non-HTML content is provided, SharePoint framework might make modifications to convert it to HTML valid. For plain text content that simply needs to be exposed to the search index (without any rewriting), use the isSearchablePlainText
flag instead.
isImageSource
Indicates if the property contains a link. This allows SharePoint server to treat the value as such and perform services like link fix-up, search indexing, loading from CDN, etc.
isImageSource?: boolean;
Property Value
boolean
isLink
Indicates if the property contains a link. This allows SharePoint server to treat the value as such and perform services like search indexing, link fix-up, loading from CDN, etc.
isLink?: boolean;
Property Value
boolean
isSearchablePlainText
Indicates if the property contains plain text that should be search-indexed by SharePoint.
isSearchablePlainText?: boolean;
Property Value
boolean
Remarks
This flag instructs the framework to store the property in a representation that supports search indexing. The content will be treated as plain text; SharePoint will not modify the string in any way, and special HTML characters may be stored encoded and appear in search results. If your string contains HTML markup, use the isHtmlString setting instead.
Security note: For security reasons, never assign a plain text string to Element.innerHTML
.
shouldNotPersist
Indicates if the framework should persist the property on the server.
shouldNotPersist?: boolean;
Property Value
boolean
Remarks
Use this for properties that are only important in run-time, and do not need to persist on the server. This can reduce the size of the serialized data of the component and optimize the component load time. The property value will be removed from the serialized data sent to the server, but this has no effect on the run-time property bag. The property value will still be available in the onBeforeSerialize()
method, and the value will not be cleared from the run-time property bag. The initial render of your component should not depend on the value of the property. Setting a default value for the property can be done in onInit()
method.
Note that if the property path refers to a property that has a complex object as the value, the whole object will be removed from the persisted data.