lu-lowcode-package-form 0.10.2 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +82 -82
- package/dist/index.es.js +1638 -1636
- package/package.json +1 -1
- package/src/components/field/select/search-select.jsx +5 -4
- package/src/utils/formula.js +4 -1
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
|
2
2
|
|
3
3
|
import { Input, Select as OriginalSelect, Spin } from 'antd';
|
4
|
-
import React, { useEffect, useState } from 'react';
|
4
|
+
import React, { useEffect, useState,forwardRef } from 'react';
|
5
5
|
import { BaseWrapper } from "../base"
|
6
6
|
import { debounce, isEqual } from 'lodash';
|
7
7
|
|
8
8
|
|
9
|
-
const SearchSelect = ({ addWrapper = true, form, fieldName, fieldsValue, value, type, defaultValue, onChange, option_label, option_value, option_search, options, request, requestParams, callError, subRequest, sub_option_label = "label", mode = "single", sub_option_value = "id", rightIconRender, rightIcon, rightIconClick, ...props }) => {
|
9
|
+
const SearchSelect = forwardRef(({ addWrapper = true, form, fieldName, fieldsValue, value, type, defaultValue, onChange, option_label, option_value, option_search, options, request, requestParams, callError, subRequest, sub_option_label = "label", mode = "single", sub_option_value = "id", rightIconRender, rightIcon, rightIconClick, ...props },ref) => {
|
10
10
|
const [nOptions, setNOptions] = React.useState([])
|
11
11
|
const [fetching, setFetching] = useState(false);
|
12
12
|
useEffect(() => {
|
@@ -141,7 +141,7 @@ const SearchSelect = ({ addWrapper = true, form, fieldName, fieldsValue, value,
|
|
141
141
|
return addWrapper ? (
|
142
142
|
<BaseWrapper {...props}>
|
143
143
|
<OriginalSelect
|
144
|
-
|
144
|
+
ref={ref}
|
145
145
|
notFoundContent={fetching ? <Spin size="small" /> : null}
|
146
146
|
value={value}
|
147
147
|
{...props}
|
@@ -159,6 +159,7 @@ const SearchSelect = ({ addWrapper = true, form, fieldName, fieldsValue, value,
|
|
159
159
|
</BaseWrapper>
|
160
160
|
) : (<>
|
161
161
|
<OriginalSelect
|
162
|
+
ref={ref}
|
162
163
|
notFoundContent={fetching ? <Spin size="small" /> : null}
|
163
164
|
value={value}
|
164
165
|
{...props}
|
@@ -176,6 +177,6 @@ const SearchSelect = ({ addWrapper = true, form, fieldName, fieldsValue, value,
|
|
176
177
|
</>
|
177
178
|
)
|
178
179
|
|
179
|
-
}
|
180
|
+
})
|
180
181
|
|
181
182
|
export { SearchSelect }
|