@visns-studio/visns-components 4.1.5 → 4.1.7
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.
|
@@ -4,7 +4,13 @@ import SelectList from './SelectList';
|
|
|
4
4
|
import AsyncSelect from 'react-select/async';
|
|
5
5
|
import { debounce } from 'lodash';
|
|
6
6
|
|
|
7
|
-
function VisnsAsyncSelect({
|
|
7
|
+
function VisnsAsyncSelect({
|
|
8
|
+
fields = [],
|
|
9
|
+
inputValue,
|
|
10
|
+
onChange,
|
|
11
|
+
placeholder,
|
|
12
|
+
settings,
|
|
13
|
+
}) {
|
|
8
14
|
const loadSuggestedOptions = useCallback(
|
|
9
15
|
debounce((inputValue, callback) => {
|
|
10
16
|
if (inputValue !== '') {
|
|
@@ -19,17 +25,23 @@ function VisnsAsyncSelect({ inputValue, onChange, placeholder, settings }) {
|
|
|
19
25
|
return new Promise((resolve, reject) => {
|
|
20
26
|
let data = [];
|
|
21
27
|
|
|
28
|
+
let payload = {
|
|
29
|
+
where: [
|
|
30
|
+
{
|
|
31
|
+
id: 'async',
|
|
32
|
+
value: inputValue,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
if (fields.length > 0) {
|
|
38
|
+
payload.fields = fields;
|
|
39
|
+
}
|
|
40
|
+
|
|
22
41
|
CustomFetch(
|
|
23
42
|
settings.url,
|
|
24
43
|
'POST',
|
|
25
|
-
|
|
26
|
-
where: [
|
|
27
|
-
{
|
|
28
|
-
id: 'async',
|
|
29
|
-
value: inputValue,
|
|
30
|
-
},
|
|
31
|
-
],
|
|
32
|
-
},
|
|
44
|
+
payload,
|
|
33
45
|
function (result) {
|
|
34
46
|
result.data.forEach((a) => {
|
|
35
47
|
let _optionItem = {
|
|
@@ -36,7 +36,7 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
|
|
|
36
36
|
type: '',
|
|
37
37
|
options: [],
|
|
38
38
|
rows: [],
|
|
39
|
-
size: '
|
|
39
|
+
size: 'half',
|
|
40
40
|
required: 'no',
|
|
41
41
|
});
|
|
42
42
|
const [dataOption, setDataOption] = useState({
|
|
@@ -176,7 +176,7 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
|
|
|
176
176
|
label: '',
|
|
177
177
|
type: '',
|
|
178
178
|
options: [],
|
|
179
|
-
size: '
|
|
179
|
+
size: 'half',
|
|
180
180
|
required: 'no',
|
|
181
181
|
}));
|
|
182
182
|
setModalType(() => ({
|
|
@@ -1005,6 +1005,7 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
|
|
|
1005
1005
|
</label>
|
|
1006
1006
|
</div>
|
|
1007
1007
|
)}
|
|
1008
|
+
|
|
1008
1009
|
<div className={styles.formItem}>
|
|
1009
1010
|
<label className={styles.fi__label}>
|
|
1010
1011
|
<select
|
|
@@ -1048,6 +1049,34 @@ function GenericFormBuilder({ setting, urlParam, userProfile }) {
|
|
|
1048
1049
|
</span>
|
|
1049
1050
|
</label>
|
|
1050
1051
|
</div>
|
|
1052
|
+
|
|
1053
|
+
{dataField.type === 'image' && (
|
|
1054
|
+
<div className={styles.formItem}>
|
|
1055
|
+
<label className={styles.fi__label}>
|
|
1056
|
+
<select
|
|
1057
|
+
name="image_qty"
|
|
1058
|
+
value={dataField.image_qty}
|
|
1059
|
+
onChange={handleChangeForm}
|
|
1060
|
+
>
|
|
1061
|
+
<option>
|
|
1062
|
+
Please Select an Option
|
|
1063
|
+
</option>
|
|
1064
|
+
<option value="single">
|
|
1065
|
+
Single
|
|
1066
|
+
</option>
|
|
1067
|
+
<option value="bulk">
|
|
1068
|
+
Bulk
|
|
1069
|
+
</option>
|
|
1070
|
+
</select>
|
|
1071
|
+
<span
|
|
1072
|
+
className={styles.fi__span}
|
|
1073
|
+
>
|
|
1074
|
+
Single or Bulk Image?
|
|
1075
|
+
</span>
|
|
1076
|
+
</label>
|
|
1077
|
+
</div>
|
|
1078
|
+
)}
|
|
1079
|
+
|
|
1051
1080
|
{dataField.type === 'plaintext' && (
|
|
1052
1081
|
<div
|
|
1053
1082
|
className={`${styles.formItem} ${styles.fwItem}`}
|
package/package.json
CHANGED