Skip to main content

ListSelect

Container Properties

The first layer of all component configurations supports Container Properties.

Component Properties (componentsProps)

NameTypeDefault是否支持 Variable PatternDescription
classNamestring✔️The className of the component.
styleobjectThe style of the component.
mode'single' | 'multiple' | 'tags''single'The mode of the selector.
valueType'value' | 'item' | 'valueAlwaysArray' | 'itemAlwaysArray''itemAlwaysArray'Describes the value is a childEnum item or a childEnum item's value, describes whether the value is always an array no matter mode is single or multiple.
Given childEnum: [{ value: 1, label: 'AAA' }, { value: 'b', label: 'BBB' }]
When valueType is value, value would be 1 or 'b' in single mode, [1] or [1, 'b'] in multiple mode.
When valueType is item, value would be { value: 1, label: 'AAA' } in single mode, [{ value: 1, label: 'AAA' }, {...}] in multiple mode.
When valueType is valueAlwaysArray, value would be [1] in single mode, [1, 'b'] in multiple mode.
When valueType is itemAlwaysArray, value would be [{ value: 1, label: 'AAA' }] in single mode, [{...}, {...}] in multiple mode.
mapping{ value: string, label: string }{ value: 'value', label: 'label' }The mapping relationship of the value, default is { value, label }. If other keys are provided, they will be saved together.
useOriginValueboolfalseGiven mapping: { value: 'id', label: 'name' }, When useOriginValue is true, value would be [{ id: 'xxx',name: 'xxx' }], When useOriginValue is false, value would be [{ value: 'xxx',label: xxx' }],
stringEqualbooltrueWhether to convert to string for comparison when comparing options.
options{ value: string | number | number, label: string }Available options.
dataSource{ token: string, pbcToken: string, listUrl: string }Data source.
dataUrlConditionalListOrSinglePropertyPropType(string)Fetch data via dataUrl.
dataFiltersConditionalListPropertyPropType(DataFilters)✔️Fixed hidden filter conditions for the data source request, which cannot be changed through the interface.
sortModelArray<SortModel>Sorting method for the data.
dataResponseKeyPathstring'results'Take a specific sub-data from the response data as the result.
transformDataResponsestringTransform the fetched data using an eval expression, where this points to the fetched data.
translateDataResponsebooltrueWhether to translate the request results.
debounceTimenumber200Debounce time for data requests, will trigger leading.
defaultValueobjectDefault data for the data source, which will be merged with the data requested from the API. If the API returns an array, it merges with each item in the array. If the API returns an object, it merges with that object.
httpMethod'get' | 'post''get'HTTP method for data requests.
selectColIdArray<string>Data fields to load; if not configured, all fields will be loaded.
needCountboolfalseWhether to query the total count (when false, the form list interface still returns a count, but it will always equal the length of the returned data).
dataExclusionArray<string>✔️Exclude certain data from the API response.
itemPropsobjectAttributes passed to the top-level div of each child element.
selectedItemPropsobjectAttributes passed to the top-level div of the selected child element.
showCheckMarkboolfalseWhether to show a checkmark for selected items.
listStyle'style1' | 'style2' | 'style3' | 'style4''style1'Style of the options.
size'medium' | 'large''medium'Size of the options, where height is the minimum height.

All other componentsProps will be passed to the component's root element (div).

SortModel

NameTypeDefaultDescription
colIdstringSort field ID.
sort'asc' | 'desc''asc'Ascending or descending sort.
sortType'text' | 'number' | 'date''text'Type of value to sort by.

JS API

The interface obtained through formApi.getFieldApi() is as follows:

NameTypeDescription
nodeHTML ElementRoot DOM element of the component.
getOptions() => arrayGet all available options of the Select.
refresh() => voidRefresh data.