Renders the value of a property found in the configured currentItem
attribute. The property that will be rendered is determined by the propertyToRender
attribute which should be defined in "dot-notation" format (e.g. "node.properties.cm:title"). This widget accepts a number
of different configuration options that control how the property is ultimately displayed.
- Copyright:
- Copyright (C) 2005-2020 Alfresco Software Limited
- License:
- GNU Lesser General Public License, see: Open Source Licensing
- Source:
Extends
Mixes In
- module:alfresco/renderers/_JsNodeMixin
- module:alfresco/renderers/_ItemLinkMixin
- module:alfresco/core/ValueDisplayMapMixin
- module:alfresco/core/UrlUtilsMixin
- module:alfresco/core/TemporalUtils
Members
-
<protected> _tooltipPositions :string[]
-
The positions where a tooltip can appear over a truncated value
Type:
- string[]
- Source:
-
cssRequirements :object[]
-
An array of the CSS files to use with this widget.
Type:
- object[]
- Default Value:
- [{cssFile:"./css/Property.css"}]
- Source:
-
currentItem :object
-
This is the object that the property to be rendered will be retrieved from.
Type:
- object
- Default Value:
- null
- Source:
-
deemphasized :boolean
-
Indicates whether or not the property should be de-emphasized. This will result in a lighter colour being used.
Type:
- boolean
- Default Value:
- false
- Source:
-
highlightPostfix :string
-
The postfix string that indicates the start of text to highlight.
Type:
- string
- Since:
- 1.0.92
- Default Value:
- null
- Source:
-
highlightPrefix :string
-
The prefix string that indicates the start of text to highlight.
Type:
- string
- Since:
- 1.0.92
- Default Value:
- null
- Source:
-
highlightProperty :string
-
This is the property within the currentItem that should be used to identify the content with in the renderedValue to highlight.
Type:
- string
- Since:
- 1.0.87
- Default Value:
- null
- Source:
-
highlightValue :string
-
This is a specific value to highlight. It will be not be used if highlightProperty is configured.
Type:
- string
- Since:
- 1.0.87
- Default Value:
- null
- Source:
-
i18nRequirements :object[]
-
An array of the i18n files to use with this widget.
Type:
- object[]
- Default Value:
- [{i18nFile: "./i18n/Property.properties"}]
- Source:
-
label :string
-
The label for the property. Won't be shown if left as null.
Type:
- string
- Default Value:
- null
- Source:
-
maxWidth :string
-
Specifies a maximum width for the content of the renderer, and will overflow with an ellipsis if necessary
Type:
- string
- Default Value:
- null
- Source:
-
onlyShowOnHover :boolean
-
Indicates that this should only be displayed when the item (note: NOT the renderer) is hovered over.
Type:
- boolean
- Default Value:
- false
- Source:
-
propertyToRender :string
-
This should be set to the name of the property to render (e.g. "cm:name"). The property is expected to be in the properties map for the item being rendered.
Type:
- string
- Default Value:
- null
- Source:
-
renderedValue :string
-
This will be set with the rendered value.
Type:
- string
- Default Value:
- null
- Source:
-
renderedValueClass :string
-
This can be set to apply a CSS class to the rendered property value
Type:
- string
- Default Value:
- "alfresco-renderers-Property"
- Source:
-
renderedValuePrefix :string
-
A label to go before the rendered value
Type:
- string
- Source:
-
renderedValueSuffix :string
-
A label to go after the rendered value
Type:
- string
- Source:
-
renderOnNewLine :boolean
-
Indicates whether or not the property will be rendered on a new line.
Type:
- boolean
- Default Value:
- false
- Source:
-
renderPropertyNotFound :boolean
-
This indicates whether or not the requestes property can be found for the current item
Type:
- boolean
- Default Value:
- true
- Source:
-
renderSize :string
-
This can be either small, medium or large.
Type:
- string
- Default Value:
- "medium"
- Source:
-
title :string
-
A title attribute to apply to the property to set an HTML title attribute on the outer element of the widget. The value will be displayed in a tooltip when hovered over.
Type:
- string
- Since:
- 1.0.102
- Default Value:
- null
- Source:
-
trimValue :boolean
-
Indicates whether or not string values should be trimmed.
Type:
- boolean
- Since:
- 1.0.99
- Default Value:
- false
- Source:
-
warnIfNotAvailable :boolean
-
Indicates whether or not a message should be displayed in place of the propertyToRender when it is not available. This defaults to false but if configured to be true then the warnIfNotAvailableMessage will be displayed.
Type:
- boolean
- Default Value:
- false
- Source:
-
warnIfNotAvailableMessage :string
-
This is the message that will be displayed in place of the property value if that value does not exist. The message will only be displayed if warnIfNotAvailable is not configured to be true. If this is left as the default value then an attempt will be made to set an appropriate message but will ultimately fallback to referencing the configured propertyToRender value.
Type:
- string
- Default Value:
- null
- Source:
-
warningDisplayed :boolean
-
Indicates whether or not a warning should (or is) being displayed. This is for internal use only and should not be configured or programmatically set.
Type:
- boolean
- Since:
- 1.0.35
- Default Value:
- false
- Source:
Methods
-
addHighlightMarks(value, highlight) → {string}
-
Updates the supplied value to include HTML mark elements around all instances of the supplied highlight value.
Parameters:
Name Type Description value
string The value to update with highlight marks highlight
string The text to highlight - Since:
- 1.0.87
- Source:
Returns:
The highlighted value- Type
- string
-
createWidgetDom()
-
Overrides the inherited function to construct the DOM for the widget using native browser capabilities.
- Since:
- 1.0.100
- Source:
-
generateRendering(value) → {string}
-
Generates the rendering of the property value. This will include any prefix and/or suffix as well as any configured warning to be displayed when the property does not exist.
Parameters:
Name Type Description value
string The value to be rendered - Since:
- 1.0.35
- Source:
Returns:
Returns the rendered value- Type
- string
-
getNotAvailableMessage() → {string}
-
Get the message to display if the property isn't available. Note that this does not check the warnIfNotAvailable property because it could then not be easily used by subclasses.
- Since:
- 1.0.57
- Source:
Returns:
The warning message- Type
- string
-
getRenderedProperty(property)
-
Parameters:
Name Type Description property
string The name of the property to render - Source:
-
postCreate()
-
Determines whether or not the property should only be displayed when the item is hovered over.
- Source:
-
postMixInProperties()
-
Set up the attributes to be used when rendering the template.
- Source:
-
renderDate()
-
Renders a date property.
- Source:
-
startup()
-
Called on widget startup
- Source:
-
updateCssClasses()
-
Updates CSS classes based on the current state of the renderer. Currently this only addressed warning message states.
- Since:
- 1.0.35
- Source:
-
updateRenderedValueClass()
-
Updates the renderedValueClass attribute based on the current configuration. This is abstracted to a function so that it can be easily called by extending renderers.
- Source: