ExtensionFieldConfiguration

type ExtensionFieldConfiguration: object;

Type declaration

customFieldDisplaySettings?

optional customFieldDisplaySettings: CustomFieldDisplaySettings;

Optional properties to configure how fields are displayed

defaultSearchCallback?

optional defaultSearchCallback: string;

Optional callback that's used when a field name may not map to any field defined in fieldValueSearchCallbacks.
Useful for when you don't know the field name ahead of time (e.g. a dynamically generated field name).

fieldTypeToItemsCallback?

optional fieldTypeToItemsCallback: Map<string, string>;

Specify callbacks that should be called before a field type has a new value set by the user.

For example, some fields do not contain all of their possible options stored in the collection on the document
(i.e, you have a fieldValueSearchCallback or fieldTypeValueSearchCallback defined for a field). When a user edits
those fields, you might want to add that item to the collection before it actually gets set on the field. If so,
specifiy a callback for that field type here and have it return the items that should be added to the field's
collection

fieldTypeValueSearchCallbacks?

optional fieldTypeValueSearchCallbacks: Map<string, string>;

Specify callbacks for searching for legal values for the given field type. It is similar to fieldValueSearchCallbacks.

Register a search callback using LucidCardIntegrationRegistry.registerFieldSearchCallback, then set
the returned string as a value in this Map. The inputSoFar parameter passed to the callback will
be all the current field values on the item being edited.

fieldValueSearchCallbacks?

optional fieldValueSearchCallbacks: Map<string, string>;

Specify callbacks for searching for legal values for the given fields.

For example, a Task collection may have an Assignee field that references a User collection,
but you don't import all the users in the entire source data set. Here, you can provide a way
to search for legal values for the Assignee field, similar to the ExtensionCardFieldDefinition.search
functionality.

Register a search callback using LucidCardIntegrationRegistry.registerFieldSearchCallback, then set
the returned string as a value in this Map. The inputSoFar parameter passed to the callback will
be all the current field values on the item being edited.

getAllFields()

getAllFields: (dataSource) => Promise<string[] | FieldDescriptor[]>;

Callback to provide a list of all supported field names for the card integration.

Parameters

ParameterType
dataSourceDataSourceProxy

Returns

Promise<string[] | FieldDescriptor[]>

getFieldsToEdit()?

Experimental

optional getFieldsToEdit: (fieldId) => Promise<ExtensionCardFieldsGroup[]>;

Callback to determine which fields should be shown and editable when a user clicks on a field element in certain
areas of a card's UI. For example, clicking on a badge showing a cumulative score could open a panel with
inputs to edit the fields that contribute to that score.

Parameters

ParameterTypeDescription
fieldIdstringThe field that was clicked (depending on the field, this could be human-readable or a UUID)

Returns

Promise<ExtensionCardFieldsGroup[]>

getListItemsForField()?

Experimental

optional getListItemsForField: (dataSource, item, fieldId) => Promise<ExtensionDataPanelListItem[]>;

Callback to determine what supplemental information should be shown when a user clicks on a field element in certain
areas of the cards UI. For example, clicking on a badge showing a count could open a panel showing items that
contribute to that count.

Parameters

ParameterType
dataSourceDataSourceProxy
itemDataItemProxy
fieldIdstring

Returns

Promise<ExtensionDataPanelListItem[]>

nonCustomizableFields?

optional nonCustomizableFields: string[];

List of field names that will not be displayed in the settings panel or edit panel, so its badge position cannot be changed by user
Order matters here, as the order of the fields in this list will be used to determine the order of the badges in the card

onSelectedFieldsChange()?

optional onSelectedFieldsChange: (dataSource, selectedFields) => Promise<void>;

Callback that handled changes in the fields the user wants to be displayed in the card integration.
If this callback is not provided then the user will not be shown the modal to configure fields.

Parameters

ParameterType
dataSourceDataSourceProxy
selectedFieldsstring[]

Returns

Promise<void>