Class: RenderingBoundItemExtension
This extension exposes an action for updating an item based on changes to the rendering metadata. This is commonly needed when editing text and the user would like to operate with text growing either with the width constrained or height constrained.
It will also decorate item preview models with optimizations to prevent unnecessary changes to certain item previews, allowing for fewer requests as well as preventing rare circumstances which can cause an infinite loop of rendering requests due to minor changes in x or y positions (which should have no impact upon the render).
Remarks
The rendering metadata provided needs to correlate with this so that the request made to generate the metadata should have assumed the same constraint (height or width).
Dependencies
[DesignExtensionSystem]
Hierarchy
BaseExtension
↳
RenderingBoundItemExtension
Implements
ItemPreviewModelDecorator
<TextAreaItem
>
Constructors
constructor
• new RenderingBoundItemExtension(designState
, designExtensionSystem
, localizationProvider?
)
Parameters
Name | Type |
---|---|
designState | DesignState |
designExtensionSystem | DesignExtensionSystem |
localizationProvider? | LocalizationProvider |
Overrides
BaseExtension.constructor
Defined in
Properties
designExtensionSystem
• Private
designExtensionSystem: DesignExtensionSystem
Defined in
designState
• Protected
designState: ItemState
<TextAreaItem
>
Overrides
BaseExtension.designState
Defined in
localizationProvider
• Private
Optional
localizationProvider: LocalizationProvider
Defined in
inject
▪ Static
inject: (string
| { isOptional
: boolean
= true; token
: string
= 'localizationProvider' })[]
Overrides
BaseExtension.inject
Defined in
Accessors
placeholderText
• Private
get
placeholderText(): string
This may need to change if we decide to source placeholder text from somewhere else
Returns
string
Defined in
previewModel
• get
previewModel(): TextAreaItem
Returns the preview model for the associated item or subpanel.
Remarks
This property will generate an Item
object optimized for fetching previews based on an item's CDIF properties.
If no optimizations exist for an item (currently only TextArea items), this property is just a retrieval of the related ItemState.model
property.
Deprecated
This computed property is deprecated and will be removed in the next major version.
If you're seeing this deprecation warning, then referencing this property should now be unnecessary, as the RenderingBoundItemExtension has been changed to decorate item previews automatically as part of the ItemPreviewModelDecorator pattern.
Returns
TextAreaItem
Defined in
previewModelOverrides
• Private
get
previewModelOverrides(): Partial
<TextAreaItem
>
Generates the preview model overrides previously created by the this.previewModel getter to be consumed elsewhere
Returns
Partial
<TextAreaItem
>
Defined in
shouldMutateDimensions
• Private
get
shouldMutateDimensions(): boolean
Returns
boolean
Defined in
Methods
[decorateItemPreviewModel]
▸ [decorateItemPreviewModel](previewModel
): void
Parameters
Name | Type |
---|---|
previewModel | TextAreaItem |
Returns
void
Implementation of
ItemPreviewModelDecorator.__@decorateItemPreviewModel@41120
Defined in
updateItemWithMetadata
▸ updateItemWithMetadata(metadata
): void
Parameters
Name | Type |
---|---|
metadata | FullRenderingMetadata |
Returns
void
Defined in
supports
▸ Static
supports(state
): boolean
Parameters
Name | Type |
---|---|
state | DesignState |
Returns
boolean
Overrides
BaseExtension.supports