targetConfigs:
Configure the component for different page types and define component properties.
For example, a component could have different properties on a record home page than on the Salesforce Home page or on an app page.
For Communities, only lightningCommunity__Default supports component properties.
Configure the component for different page types and define component properties.
For example, a component could have different properties on a record home page than on the Salesforce Home page or on an app page.
For Communities, only lightningCommunity__Default supports component properties.
Supports the targetConfig subtag:
Use a separate targetConfig for each different page type configuration. Specify one or more page types in the targets attribute, such as
<targetConfig targets="lightning__RecordPage"> or
<targetConfig targets="lightning__RecordPage,lightning__AppPage">
The targets attribute value that you specify must match one or more of the page types that you listed under <targets> for the component.
Supports the property, objects, and supportedFormFactors subtags.
property:
Specifies a public property of a component that can be set in Lightning App Builder, App Manager, Lightning Flow Builder, or Community Builder. The component author defines the property in the component’s JavaScript class using the @api decorator.
The property tag supports these attributes:
color:
Syntax: <property name="backgroundColor" type="Color" default="rgba(0, 255, 255, 1)">
REQUIRED : No
datasource:
Renders a field as a picklist, with static values. Supported only if the type attribute is String.
Syntax: <property name="Name" datasource="value1,value2,value3" />
You can also set the picklist values dynamically using an Apex class.
<property name="Name" datasource="apex://MyCustomPickList"/>
See Create Dynamic Picklists for Your Custom Components for more information.
REQUIRED : No
default:
The default value for the attribute.
REQUIRED : No
description:
Displays as an i-bubble for the attribute in the tool.
REQUIRED : No
label:
Displays as a label for the attribute in the tool.
REQUIRED : No
max:
The maximum allowed value for an attribute of type Integer. Not supported if the target is lightning__FlowScreen.
REQUIRED : No
min:
The minimum allowed value for an attribute of type Integer. Not supported if the target is lightning__FlowScreen.
REQUIRED : No
name:
Required if you’re setting properties for your component. The attribute name. This value must match the property name in the component’s JavaScript class.
REQUIRED : Yes
placeholder:
Input placeholder text for the attribute when it displays in the tool. This text is the ghost text in text fields and text areas before a user starts typing. Supported only if the type attribute is String.
REQUIRED : No
required:
Specifies whether the attribute is required. The default value is false.
REQUIRED : No
role:
Specifies whether the attribute is inputOnly or outputOnly. If you don’t specify the role attribute, the default value allows input and output. For example, if a property is restricted to outputOnly, users can’t set its value from a Lightning record page. Supported only if the target is lightning__FlowScreen.
REQUIRED : No
type:
The attribute’s data type.
To specify a list, add array notation [] to the end of any data type.
These values are valid for all targets:
Boolean
Integer
String
These values are valid only if the target is lightning__FlowScreen:
apex://namespace.Classname—An Apex class used for an Apex-defined data type.
Date—A date in ISO 8601 format.
DateTime—A datetime in ISO 8601 format.
@salesforce/schema/namespace__Objectname or @salesforce/schema/Objectname—An object.
Classname—The name of the Apex class.
namespace—The namespace of the Salesforce organization. Specify a namespace unless the organization uses the default namespace (c), in which case don’t specify it.
Objectname—The name of the object.
REQUIRED : Yes
objects
A set of one or more objects the component is supported for. This tag set works only inside a parent targetConfig that’s configured for lightning__RecordPage. Specify the objects tag set only once inside a targetConfig set. Supports the object subtag.
Defines which objects the component is supported for. Use one object tag for each supported object. You can’t use ‘*’ to denote all objects.
See the User Interface API Developer Guide for the list of supported objects.
supportedFormFactors
A set of one or more form factors or devices that the component supports. Specify the supportedFormFactors tag set once inside a targetConfig set. Supports the supportedFormFactor subtag.
Defines which form factor or device the component supports. Use one supportedFormFactor tag for each supported form factor.
The supportedFormFactor tag supports these attributes:
Device form factor on which the component displays. Valid values are:
Large—Represents the desktop form factor. Supported for all page types.
Small—Represents the phone form factor. Supported for lightning__AppPage only.
Comments
Post a Comment