Skip to main content

MapProperty <T>

Hierarchy

Index

Properties

optionalField

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.

optionalPreview

Preview?: ComponentType<PropertyPreviewProps<T, 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.

optionalcolumnWidth

columnWidth?: number

Width in pixels of this column in the collection view. If not set the width is inferred based on the other configurations

optionalcustomProps

customProps?: any

Additional props that are passed to the components defined in field or in preview.

dataType

dataType: map

Datatype of the property

optionaldefaultValue

defaultValue?: null | T

This value will be set by default for new entities.

optionaldescription

description?: string

Property description, always displayed under the field

optionaldisabled

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)

optionaleditable

editable?: boolean

Should this property be editable. If set to true, the user will be able to modify the property and save the new config. The saved config will then become the source of truth.

optionalexpanded

expanded?: boolean

Should the field be initially expanded. Defaults to true

optionalhideFromCollection

hideFromCollection?: boolean

Do not show this property in the collection view

optionalkeyValue

keyValue?: boolean

Render this map as a key-value table that allows to use arbitrary keys. You don't need to define the properties in this case.

optionallongDescription

longDescription?: string

Longer description of a field, displayed under a popover

optionalname

name?: string

Property name (e.g. Product)

optionalpickOnlySomeKeys

pickOnlySomeKeys?: boolean

Allow the user to add only some keys in this map. By default, all properties of the map have the corresponding field in the form view. Setting this flag to true allows to pick only some. Useful for map that can have a lot of sub-properties that may not be needed

optionalpreviewProperties

previewProperties?: Partial<Extract<keyof T, string>>[]

Properties that are displayed when rendered as a preview

optionalproperties

properties?: PropertiesOrBuilders<T>

Record of properties included in this map.

optionalpropertiesOrder

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.

optionalpropertyConfig

propertyConfig?: 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.

optionalreadOnly

readOnly?: boolean

Is this a read only property. When set to true, it gets rendered as a preview.

optionalspreadChildren

spreadChildren?: boolean

Display the child properties as independent columns in the collection view

optionalvalidation

Rules for validating this property. NOTE: If you don't set required in the map property, an empty object will be considered valid, even if you set required in the properties.

Sign up to our newsletter to get the latest news and updates. No spam!