Interface: ArrayProperty<T, ArrayT>
Type parameters​
Name | Type |
---|---|
T | extends ArrayT [] = any [] |
ArrayT | extends CMSType = CMSType |
Hierarchy​
BaseProperty
<T
>↳
ArrayProperty
Properties​
Field​
• Optional
Field: ComponentType
<FieldProps
<T
, any
, any
>>
If you need to render a custom field, you can create a component that
takes FieldProps
as props. You receive the value, a function to
update the value and additional utility props such as if there is an error.
You can customize it by passing custom props that are received
in the component.
Inherited from​
Defined in​
lib/src/types/properties.ts:136
Preview​
• Optional
Preview: ComponentType
<PropertyPreviewProps
<T
, any
, Record
<string
, any
>>>
Configure how a property is displayed as a preview, e.g. in the collection view. You can customize it by passing custom props that are received in the component.
Inherited from​
Defined in​
lib/src/types/properties.ts:143
columnWidth​
• Optional
columnWidth: number
Width in pixels of this column in the collection view. If not set the width is inferred based on the other configurations
Inherited from​
Defined in​
lib/src/types/properties.ts:102
customProps​
• Optional
customProps: any
Additional props that are passed to the components defined in field
or in preview
.
Inherited from​
Defined in​
lib/src/types/properties.ts:149
dataType​
• dataType: "array"
Datatype of the property
Overrides​
Defined in​
lib/src/types/properties.ts:406
defaultValue​
• Optional
defaultValue: T
This value will be set by default for new entities.
Inherited from​
Defined in​
lib/src/types/properties.ts:154
description​
• Optional
description: string
Property description, always displayed under the field
Inherited from​
Defined in​
lib/src/types/properties.ts:83
disabled​
• Optional
disabled: boolean
| PropertyDisabledConfig
Is this field disabled. When set to true, it gets rendered as a disabled field. You can also specify a configuration for defining the behaviour of disabled properties (including custom messages, clear value on disabled or hide the field completely)
Inherited from​
Defined in​
lib/src/types/properties.ts:122
expanded​
• Optional
expanded: boolean
Should the field be initially expanded. Defaults to true
Defined in​
lib/src/types/properties.ts:466
fieldConfig​
• Optional
fieldConfig: string
You can use this prop to reuse a property that has been defined
in the top level of the CMS in the prop fields
.
All the configuration will be taken from the inherited config, and
overwritten by the current property config.
Inherited from​
Defined in​
lib/src/types/properties.ts:91
hideFromCollection​
• Optional
hideFromCollection: boolean
Do not show this property in the collection view
Inherited from​
BaseProperty.hideFromCollection
Defined in​
lib/src/types/properties.ts:107
longDescription​
• Optional
longDescription: string
Longer description of a field, displayed under a popover
Inherited from​
Defined in​
lib/src/types/properties.ts:96
name​
• Optional
name: string
Property name (e.g. Product)
Inherited from​
Defined in​
lib/src/types/properties.ts:78
of​
• Optional
of: PropertyOrBuilder
<ArrayT
, Record
<string
, any
>> | Property
<ArrayT
>[]
The property of this array.
You can specify any property (except another Array property)
You can leave this field empty only if you are providing a custom field,
or using the oneOf
prop, otherwise an error will be thrown.
Defined in​
lib/src/types/properties.ts:414
oneOf​
• Optional
oneOf: Object
Use this field if you would like to have an array of typed objects. It is useful if you need to have values of different types in the same array. Each entry of the array is an object with the shape:
{ type: "YOUR_TYPE", value: "YOUR_VALUE"}
Note that you can use any property so value
can take any value (strings,
numbers, array, objects...)
You can customise the type
and value
fields to suit your needs.
An example use case for this feature may be a blog entry, where you have images and text blocks using markdown.
Type declaration​
Name | Type | Description |
---|---|---|
properties | Properties <any > | Record of properties, where the key is the type and the value is the corresponding property |
propertiesOrder? | Extract <keyof T , string >[] | Order in which the properties are displayed. If you are specifying your collection as code, the order is the same as the one you define in properties , and you don't need to specify this prop. |
typeField? | string | Name of the field to use as the discriminator for type Defaults to type |
valueField? | string | Name of the field to use as the value Defaults to value |
Defined in​
lib/src/types/properties.ts:431
readOnly​
• Optional
readOnly: boolean
Is this a read only property. When set to true, it gets rendered as a preview.
Inherited from​
Defined in​
lib/src/types/properties.ts:113
validation​
• Optional
validation: ArrayPropertyValidationSchema
Rules for validating this property