ListSelect
Container Properties
The first layer of all component configurations supports Container Properties.
Component Properties (componentsProps)
| Name | Type | Default | 是否支持 Variable Pattern | Description |
|---|---|---|---|---|
| className | string | ✔️ | The className of the component. | |
| style | object | The 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. | |
| 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 | Whether 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. | ||
| dataUrl | ConditionalListOrSinglePropertyPropType(string) | Fetch data via dataUrl. | ||
| dataFilters | ConditionalListPropertyPropType(DataFilters) | ✔️ | Fixed hidden filter conditions for the data source request, which cannot be changed through the interface. | |
| sortModel | Array<SortModel> | Sorting method for the data. | ||
| dataResponseKeyPath | string | 'results' | Take a specific sub-data from the response data as the result. | |
| transformDataResponse | string | Transform the fetched data using an eval expression, where this points to the fetched data. | ||
| translateDataResponse | bool | true | Whether to translate the request results. | |
| debounceTime | number | 200 | Debounce time for data requests, will trigger leading. | |
| defaultValue | object | Default 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. | |
| selectColId | Array<string> | Data fields to load; if not configured, all fields will be loaded. | ||
| needCount | bool | false | Whether 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). | |
| dataExclusion | Array<string> | ✔️ | Exclude certain data from the API response. | |
| itemProps | object | Attributes passed to the top-level div of each child element. | ||
| selectedItemProps | object | Attributes passed to the top-level div of the selected child element. | ||
| showCheckMark | bool | false | Whether 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
| Name | Type | Default | Description |
|---|---|---|---|
| colId | string | Sort 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:
| Name | Type | Description |
|---|---|---|
| node | HTML Element | Root DOM element of the component. |
| getOptions | () => array | Get all available options of the Select. |
| refresh | () => void | Refresh data. |