Skip to main content

Select

Container properties

All component configurations support Container properties at the first level.

Component properties

NameTypeDefaultSupports Variable PatternDescription
classNamestring✔️The className of the component
styleobjectThe style of the component
mode'single' | 'multiple' | 'tags''single'Selector mode
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 value is { value, label } by default. 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' }],
stringEqualbooltrueWhen comparing options, whether to convert to string for comparison
options{ value: string | number | number, label: string }Optional
dataSource{ token: string, pbcToken: string, listUrl: string }data source
dataUrlConditionalListOrSinglePropertyPropType(string)Get data via dataUrl.
dataFiltersConditionalListPropertyPropType(DataFilters)✔️Fixed filter conditions hidden by requesting data source cannot be changed through the interface
sortModelArray<SortModel>How to sort data
dataResponseKeyPathstring'results'Take a certain subdata in response data as the result.
transformDataResponsestringConvert the retrieved data, use the eval expression, this points to the retrieved data.
translateDataResponsebooltrueIs the translation request result required
debounceTimenumber200The debounce time of requesting data will trigger leadership.
defaultValueobjectThe default data of the data source will be merged with the data requested by the API. If the api request returns an array, merge each item of the array. If the API request returns an object, merge with this object.
httpMethod'get' | 'post''get'http method for data request.
selectColIdArray<string>Loaded data fields, all fields will be loaded without configuration.
needCountboolfalseIs it necessary to query the total number (When it is false, the form list interface will still return count, but the count at this time is always equal to the length of the returned data)
dataExclusionArray<string>✔️Exclude some data from the data returned by the API
showSearchboolfalseWhether to turn on the search function
searchTextColIdsArray<string>Specify the drop-down box to blur the search field, and if not, search for mapping.label
lazyLoadingboolfalseWhether to enable lazy loading
cacheBlockSizenumber30Lazy loading the amount of data each requested
itemFieldobjectThe formatting function of option is implemented by specifying the json schema of each element, supporting the use of all form elements

All the remaining componentsProps will be passed to the component root element (Select).

SortModel

NameTypeDefaultDescription
colIdstringSort field id
sort'asc' | 'desc''asc'sort in order or descending order
sortType'text' | 'number' | 'date''text'What type do values ​​sort by

JS API

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

NameTypeDescription
nodeHTML ElementThe root DOM element of the component
getOptions() => arrayGet all options for Select