Select
Container properties
All component configurations support Container properties at the first level.
Component properties
| Name | Type | Default | Supports Variable Pattern | Description |
|---|---|---|---|---|
| className | string | ✔️ | The className of the component | |
| style | object | The 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. | |
| useOriginValue | bool | false | Given 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' }], | |
| stringEqual | bool | true | When 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 | ||
| dataUrl | ConditionalListOrSinglePropertyPropType(string) | Get data via dataUrl. | ||
| dataFilters | ConditionalListPropertyPropType(DataFilters) | ✔️ | Fixed filter conditions hidden by requesting data source cannot be changed through the interface | |
| sortModel | Array<SortModel> | How to sort data | ||
| dataResponseKeyPath | string | 'results' | Take a certain subdata in response data as the result. | |
| transformDataResponse | string | Convert the retrieved data, use the eval expression, this points to the retrieved data. | ||
| translateDataResponse | bool | true | Is the translation request result required | |
| debounceTime | number | 200 | The debounce time of requesting data will trigger leadership. | |
| defaultValue | object | The 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. | |
| selectColId | Array<string> | Loaded data fields, all fields will be loaded without configuration. | ||
| needCount | bool | false | Is 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) | |
| dataExclusion | Array<string> | ✔️ | Exclude some data from the data returned by the API | |
| showSearch | bool | false | Whether to turn on the search function | |
| searchTextColIds | Array<string> | Specify the drop-down box to blur the search field, and if not, search for mapping.label | ||
| lazyLoading | bool | false | Whether to enable lazy loading | |
| cacheBlockSize | number | 30 | Lazy loading the amount of data each requested | |
| itemField | object | The 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
| Name | Type | Default | Description |
|---|---|---|---|
| colId | string | Sort 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:
| Name | Type | Description |
|---|---|---|
| node | HTML Element | The root DOM element of the component |
| getOptions | () => array | Get all options for Select |