@asaleh37/ui-base 25.12.16 → 25.12.122
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/__ODockerfile +14 -14
- package/dist/index.d.ts +0 -2
- package/dist/index.js +107 -107
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +112 -112
- package/dist/index.mjs.map +1 -1
- package/package-lock.json/342/200/216 +9039 -9039
- package/package.json +122 -122
- package/src/components/administration/admin/OrganizationMemberGrid.tsx +49 -63
- package/src/components/administration/admin/PersonGrid.tsx +344 -10
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormElementField.tsx +238 -238
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/TemplateForm.tsx +427 -427
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/DataGridColumnsUtil.tsx +198 -198
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid.tsx +1047 -1047
- package/src/components/templates/report/ExcelReportViewer.tsx +72 -72
- package/src/components/templates/report/ReportViewer.tsx +272 -272
- package/src/hooks/UseWindow.tsx +111 -111
- package/src/hooks/index.ts +22 -22
- package/src/hooks/useCommonStore.tsx +29 -29
- package/src/hooks/useParameterPanel.tsx +159 -159
- package/src/layout/NavigationTree.tsx +1 -8
- package/src/layout/TopBar.tsx +55 -72
- package/src/main.tsx +1 -2
- package/src/navigationItems/Administration/adminNavigationItems.tsx +1 -1
- package/src/redux/features/common/AppInfoSlice.ts +0 -4
- package/src/components/administration/admin/CustomPersonGrid.tsx +0 -361
- package/src/components/administration/admin/OrgProvidedPersonGrid.tsx +0 -347
|
@@ -1,238 +1,238 @@
|
|
|
1
|
-
import { Grid2 } from "@mui/material";
|
|
2
|
-
import TemplateTextField from "./FormFields/TemplateTextField";
|
|
3
|
-
import Datefield from "./FormFields/Datefield";
|
|
4
|
-
import DatetimeField from "./FormFields/DatetimeField";
|
|
5
|
-
import ComboBox from "./FormFields/ComboBox";
|
|
6
|
-
import CheckBox from "./FormFields/CheckBox";
|
|
7
|
-
import { DATE_FORMAT, DATE_TIME_FORMAT } from "../../../../util/constants";
|
|
8
|
-
import { isNumeric } from "../../../../util/AppUtils";
|
|
9
|
-
import { FormElementFieldProps } from "../DataEntryTypes";
|
|
10
|
-
import SystemLookupCombobox from "./FormFields/SystemLookupCombobox";
|
|
11
|
-
|
|
12
|
-
const FormElementField: React.FC<FormElementFieldProps> = (
|
|
13
|
-
element: FormElementFieldProps
|
|
14
|
-
) => {
|
|
15
|
-
if (element?.fieldInfo) {
|
|
16
|
-
const props = element.fieldInfo;
|
|
17
|
-
const formManager = element?.formManager || null;
|
|
18
|
-
const formActions = element?.formActions || null;
|
|
19
|
-
const formValues = element?.formValues || null;
|
|
20
|
-
const fieldName: any = element?.fieldInfo?.fieldName || null;
|
|
21
|
-
const fieldType = element?.fieldInfo?.fieldType || null;
|
|
22
|
-
if (!(props && formManager && formValues && fieldName && fieldType)) {
|
|
23
|
-
return <></>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const getFieldLabel = () => {
|
|
27
|
-
if (element?.fieldInfo?.formProps?.fieldLabelFn) {
|
|
28
|
-
return element.fieldInfo.formProps.fieldLabelFn(formValues);
|
|
29
|
-
} else if (element?.fieldInfo?.fieldLabel) {
|
|
30
|
-
return element?.fieldInfo?.fieldLabel;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
return !element.hiddenFields.includes(fieldName) ? (
|
|
34
|
-
<Grid2
|
|
35
|
-
size={
|
|
36
|
-
props?.formProps?.fieldSize || {
|
|
37
|
-
lg: 12,
|
|
38
|
-
md: 12,
|
|
39
|
-
sm: 12,
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
sx={{
|
|
43
|
-
padding: 1,
|
|
44
|
-
width: "100%",
|
|
45
|
-
}}
|
|
46
|
-
>
|
|
47
|
-
{fieldType === "text" || fieldType === "number" ? (
|
|
48
|
-
<TemplateTextField
|
|
49
|
-
{...props.muiTextFieldProps}
|
|
50
|
-
fullWidth
|
|
51
|
-
type={fieldType}
|
|
52
|
-
disabled={element.disabledFields.includes(fieldName)}
|
|
53
|
-
label={getFieldLabel()}
|
|
54
|
-
value={formValues[fieldName]}
|
|
55
|
-
onChange={(event) => {
|
|
56
|
-
let newValue = null;
|
|
57
|
-
if (event.target.value != "") {
|
|
58
|
-
if (fieldType === "number" && isNumeric(event.target.value)) {
|
|
59
|
-
newValue = Number(event.target.value);
|
|
60
|
-
} else {
|
|
61
|
-
newValue = event.target.value;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
formManager.setValue(fieldName, newValue);
|
|
65
|
-
if (element?.formValuesChangeCallBk) {
|
|
66
|
-
element?.formValuesChangeCallBk(
|
|
67
|
-
formValues,
|
|
68
|
-
formActions,
|
|
69
|
-
formManager,
|
|
70
|
-
fieldName,
|
|
71
|
-
newValue
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
}}
|
|
75
|
-
sx={{
|
|
76
|
-
"& .MuiInputBase-root": {
|
|
77
|
-
height: `${props?.formProps?.fieldHeight}px` || undefined,
|
|
78
|
-
},
|
|
79
|
-
"& .MuiInputBase-input": {
|
|
80
|
-
height: "100% !important", // forces full height usage
|
|
81
|
-
},
|
|
82
|
-
...props?.formProps?.style,
|
|
83
|
-
display: element.hiddenFields.includes(fieldName)
|
|
84
|
-
? "none"
|
|
85
|
-
: undefined,
|
|
86
|
-
}}
|
|
87
|
-
error={formManager.formState.errors[fieldName] != undefined}
|
|
88
|
-
helperText={formManager?.formState?.errors[
|
|
89
|
-
fieldName
|
|
90
|
-
]?.message?.toString()}
|
|
91
|
-
/>
|
|
92
|
-
) : props?.fieldType === "date" ? (
|
|
93
|
-
<Datefield
|
|
94
|
-
format={props?.dateFormat || DATE_FORMAT}
|
|
95
|
-
sx={props?.formProps?.style || { width: "100%" }}
|
|
96
|
-
disabled={element.disabledFields.includes(fieldName)}
|
|
97
|
-
hidden={element.hiddenFields.includes(fieldName)}
|
|
98
|
-
label={getFieldLabel()}
|
|
99
|
-
onChangeCallBack={(v: any) => {
|
|
100
|
-
formManager.setValue(fieldName, v);
|
|
101
|
-
if (element?.formValuesChangeCallBk) {
|
|
102
|
-
element?.formValuesChangeCallBk(
|
|
103
|
-
formValues,
|
|
104
|
-
formActions,
|
|
105
|
-
formManager,
|
|
106
|
-
fieldName,
|
|
107
|
-
v
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
}}
|
|
111
|
-
value={formValues[fieldName]}
|
|
112
|
-
error={formManager.formState.errors[fieldName] != undefined}
|
|
113
|
-
errorMessage={formManager?.formState?.errors[
|
|
114
|
-
fieldName
|
|
115
|
-
]?.message?.toString()}
|
|
116
|
-
/>
|
|
117
|
-
) : props?.fieldType === "datetime" ? (
|
|
118
|
-
<DatetimeField
|
|
119
|
-
format={props?.dateFormat || DATE_TIME_FORMAT}
|
|
120
|
-
sx={props?.formProps?.style || { width: "100%" }}
|
|
121
|
-
disabled={element.disabledFields.includes(fieldName)}
|
|
122
|
-
hidden={element.hiddenFields.includes(fieldName)}
|
|
123
|
-
label={getFieldLabel()}
|
|
124
|
-
onChangeCallBack={(v: any) => {
|
|
125
|
-
formManager.setValue(fieldName, v);
|
|
126
|
-
if (element?.formValuesChangeCallBk) {
|
|
127
|
-
element?.formValuesChangeCallBk(
|
|
128
|
-
formValues,
|
|
129
|
-
formActions,
|
|
130
|
-
formManager,
|
|
131
|
-
fieldName,
|
|
132
|
-
v
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
}}
|
|
136
|
-
value={formValues[fieldName]}
|
|
137
|
-
error={formManager.formState.errors[fieldName] != undefined}
|
|
138
|
-
errorMessage={formManager?.formState?.errors[
|
|
139
|
-
fieldName
|
|
140
|
-
]?.message?.toString()}
|
|
141
|
-
/>
|
|
142
|
-
) : props?.fieldType === "checkbox" ? (
|
|
143
|
-
<CheckBox
|
|
144
|
-
label={getFieldLabel()}
|
|
145
|
-
onChangeCallBack={(v: any) => {
|
|
146
|
-
formManager.setValue(fieldName, v);
|
|
147
|
-
if (element?.formValuesChangeCallBk) {
|
|
148
|
-
element?.formValuesChangeCallBk(
|
|
149
|
-
formValues,
|
|
150
|
-
formActions,
|
|
151
|
-
formManager,
|
|
152
|
-
fieldName,
|
|
153
|
-
v
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
}}
|
|
157
|
-
value={formValues[fieldName]}
|
|
158
|
-
checkedValue={props?.checkedValue || true}
|
|
159
|
-
unCheckedValue={props?.unCheckedValue || false}
|
|
160
|
-
disabled={element.disabledFields.includes(fieldName)}
|
|
161
|
-
hidden={element.hiddenFields.includes(fieldName)}
|
|
162
|
-
sx={props?.formProps?.style}
|
|
163
|
-
/>
|
|
164
|
-
) : props?.fieldType === "combobox" ? (
|
|
165
|
-
<ComboBox
|
|
166
|
-
sx={props?.formProps?.style || { width: "100%" }}
|
|
167
|
-
label={getFieldLabel()}
|
|
168
|
-
commonStoreKey={props?.commonStoreKey}
|
|
169
|
-
dataQueryId={props?.dataQueryId}
|
|
170
|
-
storeUrl={props?.storeUrl}
|
|
171
|
-
storeLoadParam={props?.storeLoadParam}
|
|
172
|
-
disabled={element.disabledFields.includes(fieldName)}
|
|
173
|
-
hidden={element.hiddenFields.includes(fieldName)}
|
|
174
|
-
onChangeCallBack={(v: any, selectedRecord: any) => {
|
|
175
|
-
let newValue = null;
|
|
176
|
-
if (v) {
|
|
177
|
-
newValue = v;
|
|
178
|
-
}
|
|
179
|
-
formManager.setValue(fieldName, newValue);
|
|
180
|
-
if (element?.formValuesChangeCallBk) {
|
|
181
|
-
element?.formValuesChangeCallBk(
|
|
182
|
-
formValues,
|
|
183
|
-
formActions,
|
|
184
|
-
formManager,
|
|
185
|
-
fieldName,
|
|
186
|
-
v,
|
|
187
|
-
selectedRecord
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
}}
|
|
191
|
-
options={props?.options || []}
|
|
192
|
-
displayField={props?.optionDisplayField || ""}
|
|
193
|
-
valueField={props?.optionValueField || ""}
|
|
194
|
-
value={formValues[fieldName]}
|
|
195
|
-
errorMessage={formManager?.formState?.errors[
|
|
196
|
-
fieldName
|
|
197
|
-
]?.message?.toString()}
|
|
198
|
-
/>
|
|
199
|
-
) : props?.fieldType === "lookup" ? (
|
|
200
|
-
<SystemLookupCombobox
|
|
201
|
-
sx={props?.formProps?.style || { width: "100%" }}
|
|
202
|
-
label={getFieldLabel()}
|
|
203
|
-
disabled={element.disabledFields.includes(fieldName)}
|
|
204
|
-
hidden={element.hiddenFields.includes(fieldName)}
|
|
205
|
-
onChangeCallBack={(v: any, selectedRecord: any) => {
|
|
206
|
-
let newValue = null;
|
|
207
|
-
if (v) {
|
|
208
|
-
newValue = v;
|
|
209
|
-
}
|
|
210
|
-
formManager.setValue(fieldName, newValue);
|
|
211
|
-
if (element?.formValuesChangeCallBk) {
|
|
212
|
-
element?.formValuesChangeCallBk(
|
|
213
|
-
formValues,
|
|
214
|
-
formActions,
|
|
215
|
-
formManager,
|
|
216
|
-
fieldName,
|
|
217
|
-
v,
|
|
218
|
-
selectedRecord
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
}}
|
|
222
|
-
lookupType={props.lookupType}
|
|
223
|
-
value={formValues[fieldName]}
|
|
224
|
-
errorMessage={formManager?.formState?.errors[
|
|
225
|
-
fieldName
|
|
226
|
-
]?.message?.toString()}
|
|
227
|
-
/>
|
|
228
|
-
) : null}
|
|
229
|
-
</Grid2>
|
|
230
|
-
) : (
|
|
231
|
-
<></>
|
|
232
|
-
);
|
|
233
|
-
} else {
|
|
234
|
-
return <></>;
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
export default FormElementField;
|
|
1
|
+
import { Grid2 } from "@mui/material";
|
|
2
|
+
import TemplateTextField from "./FormFields/TemplateTextField";
|
|
3
|
+
import Datefield from "./FormFields/Datefield";
|
|
4
|
+
import DatetimeField from "./FormFields/DatetimeField";
|
|
5
|
+
import ComboBox from "./FormFields/ComboBox";
|
|
6
|
+
import CheckBox from "./FormFields/CheckBox";
|
|
7
|
+
import { DATE_FORMAT, DATE_TIME_FORMAT } from "../../../../util/constants";
|
|
8
|
+
import { isNumeric } from "../../../../util/AppUtils";
|
|
9
|
+
import { FormElementFieldProps } from "../DataEntryTypes";
|
|
10
|
+
import SystemLookupCombobox from "./FormFields/SystemLookupCombobox";
|
|
11
|
+
|
|
12
|
+
const FormElementField: React.FC<FormElementFieldProps> = (
|
|
13
|
+
element: FormElementFieldProps
|
|
14
|
+
) => {
|
|
15
|
+
if (element?.fieldInfo) {
|
|
16
|
+
const props = element.fieldInfo;
|
|
17
|
+
const formManager = element?.formManager || null;
|
|
18
|
+
const formActions = element?.formActions || null;
|
|
19
|
+
const formValues = element?.formValues || null;
|
|
20
|
+
const fieldName: any = element?.fieldInfo?.fieldName || null;
|
|
21
|
+
const fieldType = element?.fieldInfo?.fieldType || null;
|
|
22
|
+
if (!(props && formManager && formValues && fieldName && fieldType)) {
|
|
23
|
+
return <></>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const getFieldLabel = () => {
|
|
27
|
+
if (element?.fieldInfo?.formProps?.fieldLabelFn) {
|
|
28
|
+
return element.fieldInfo.formProps.fieldLabelFn(formValues);
|
|
29
|
+
} else if (element?.fieldInfo?.fieldLabel) {
|
|
30
|
+
return element?.fieldInfo?.fieldLabel;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return !element.hiddenFields.includes(fieldName) ? (
|
|
34
|
+
<Grid2
|
|
35
|
+
size={
|
|
36
|
+
props?.formProps?.fieldSize || {
|
|
37
|
+
lg: 12,
|
|
38
|
+
md: 12,
|
|
39
|
+
sm: 12,
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
sx={{
|
|
43
|
+
padding: 1,
|
|
44
|
+
width: "100%",
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
{fieldType === "text" || fieldType === "number" ? (
|
|
48
|
+
<TemplateTextField
|
|
49
|
+
{...props.muiTextFieldProps}
|
|
50
|
+
fullWidth
|
|
51
|
+
type={fieldType}
|
|
52
|
+
disabled={element.disabledFields.includes(fieldName)}
|
|
53
|
+
label={getFieldLabel()}
|
|
54
|
+
value={formValues[fieldName]}
|
|
55
|
+
onChange={(event) => {
|
|
56
|
+
let newValue = null;
|
|
57
|
+
if (event.target.value != "") {
|
|
58
|
+
if (fieldType === "number" && isNumeric(event.target.value)) {
|
|
59
|
+
newValue = Number(event.target.value);
|
|
60
|
+
} else {
|
|
61
|
+
newValue = event.target.value;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
formManager.setValue(fieldName, newValue);
|
|
65
|
+
if (element?.formValuesChangeCallBk) {
|
|
66
|
+
element?.formValuesChangeCallBk(
|
|
67
|
+
formValues,
|
|
68
|
+
formActions,
|
|
69
|
+
formManager,
|
|
70
|
+
fieldName,
|
|
71
|
+
newValue
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}}
|
|
75
|
+
sx={{
|
|
76
|
+
"& .MuiInputBase-root": {
|
|
77
|
+
height: `${props?.formProps?.fieldHeight}px` || undefined,
|
|
78
|
+
},
|
|
79
|
+
"& .MuiInputBase-input": {
|
|
80
|
+
height: "100% !important", // forces full height usage
|
|
81
|
+
},
|
|
82
|
+
...props?.formProps?.style,
|
|
83
|
+
display: element.hiddenFields.includes(fieldName)
|
|
84
|
+
? "none"
|
|
85
|
+
: undefined,
|
|
86
|
+
}}
|
|
87
|
+
error={formManager.formState.errors[fieldName] != undefined}
|
|
88
|
+
helperText={formManager?.formState?.errors[
|
|
89
|
+
fieldName
|
|
90
|
+
]?.message?.toString()}
|
|
91
|
+
/>
|
|
92
|
+
) : props?.fieldType === "date" ? (
|
|
93
|
+
<Datefield
|
|
94
|
+
format={props?.dateFormat || DATE_FORMAT}
|
|
95
|
+
sx={props?.formProps?.style || { width: "100%" }}
|
|
96
|
+
disabled={element.disabledFields.includes(fieldName)}
|
|
97
|
+
hidden={element.hiddenFields.includes(fieldName)}
|
|
98
|
+
label={getFieldLabel()}
|
|
99
|
+
onChangeCallBack={(v: any) => {
|
|
100
|
+
formManager.setValue(fieldName, v);
|
|
101
|
+
if (element?.formValuesChangeCallBk) {
|
|
102
|
+
element?.formValuesChangeCallBk(
|
|
103
|
+
formValues,
|
|
104
|
+
formActions,
|
|
105
|
+
formManager,
|
|
106
|
+
fieldName,
|
|
107
|
+
v
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
}}
|
|
111
|
+
value={formValues[fieldName]}
|
|
112
|
+
error={formManager.formState.errors[fieldName] != undefined}
|
|
113
|
+
errorMessage={formManager?.formState?.errors[
|
|
114
|
+
fieldName
|
|
115
|
+
]?.message?.toString()}
|
|
116
|
+
/>
|
|
117
|
+
) : props?.fieldType === "datetime" ? (
|
|
118
|
+
<DatetimeField
|
|
119
|
+
format={props?.dateFormat || DATE_TIME_FORMAT}
|
|
120
|
+
sx={props?.formProps?.style || { width: "100%" }}
|
|
121
|
+
disabled={element.disabledFields.includes(fieldName)}
|
|
122
|
+
hidden={element.hiddenFields.includes(fieldName)}
|
|
123
|
+
label={getFieldLabel()}
|
|
124
|
+
onChangeCallBack={(v: any) => {
|
|
125
|
+
formManager.setValue(fieldName, v);
|
|
126
|
+
if (element?.formValuesChangeCallBk) {
|
|
127
|
+
element?.formValuesChangeCallBk(
|
|
128
|
+
formValues,
|
|
129
|
+
formActions,
|
|
130
|
+
formManager,
|
|
131
|
+
fieldName,
|
|
132
|
+
v
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
}}
|
|
136
|
+
value={formValues[fieldName]}
|
|
137
|
+
error={formManager.formState.errors[fieldName] != undefined}
|
|
138
|
+
errorMessage={formManager?.formState?.errors[
|
|
139
|
+
fieldName
|
|
140
|
+
]?.message?.toString()}
|
|
141
|
+
/>
|
|
142
|
+
) : props?.fieldType === "checkbox" ? (
|
|
143
|
+
<CheckBox
|
|
144
|
+
label={getFieldLabel()}
|
|
145
|
+
onChangeCallBack={(v: any) => {
|
|
146
|
+
formManager.setValue(fieldName, v);
|
|
147
|
+
if (element?.formValuesChangeCallBk) {
|
|
148
|
+
element?.formValuesChangeCallBk(
|
|
149
|
+
formValues,
|
|
150
|
+
formActions,
|
|
151
|
+
formManager,
|
|
152
|
+
fieldName,
|
|
153
|
+
v
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
}}
|
|
157
|
+
value={formValues[fieldName]}
|
|
158
|
+
checkedValue={props?.checkedValue || true}
|
|
159
|
+
unCheckedValue={props?.unCheckedValue || false}
|
|
160
|
+
disabled={element.disabledFields.includes(fieldName)}
|
|
161
|
+
hidden={element.hiddenFields.includes(fieldName)}
|
|
162
|
+
sx={props?.formProps?.style}
|
|
163
|
+
/>
|
|
164
|
+
) : props?.fieldType === "combobox" ? (
|
|
165
|
+
<ComboBox
|
|
166
|
+
sx={props?.formProps?.style || { width: "100%" }}
|
|
167
|
+
label={getFieldLabel()}
|
|
168
|
+
commonStoreKey={props?.commonStoreKey}
|
|
169
|
+
dataQueryId={props?.dataQueryId}
|
|
170
|
+
storeUrl={props?.storeUrl}
|
|
171
|
+
storeLoadParam={props?.storeLoadParam}
|
|
172
|
+
disabled={element.disabledFields.includes(fieldName)}
|
|
173
|
+
hidden={element.hiddenFields.includes(fieldName)}
|
|
174
|
+
onChangeCallBack={(v: any, selectedRecord: any) => {
|
|
175
|
+
let newValue = null;
|
|
176
|
+
if (v) {
|
|
177
|
+
newValue = v;
|
|
178
|
+
}
|
|
179
|
+
formManager.setValue(fieldName, newValue);
|
|
180
|
+
if (element?.formValuesChangeCallBk) {
|
|
181
|
+
element?.formValuesChangeCallBk(
|
|
182
|
+
formValues,
|
|
183
|
+
formActions,
|
|
184
|
+
formManager,
|
|
185
|
+
fieldName,
|
|
186
|
+
v,
|
|
187
|
+
selectedRecord
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
}}
|
|
191
|
+
options={props?.options || []}
|
|
192
|
+
displayField={props?.optionDisplayField || ""}
|
|
193
|
+
valueField={props?.optionValueField || ""}
|
|
194
|
+
value={formValues[fieldName]}
|
|
195
|
+
errorMessage={formManager?.formState?.errors[
|
|
196
|
+
fieldName
|
|
197
|
+
]?.message?.toString()}
|
|
198
|
+
/>
|
|
199
|
+
) : props?.fieldType === "lookup" ? (
|
|
200
|
+
<SystemLookupCombobox
|
|
201
|
+
sx={props?.formProps?.style || { width: "100%" }}
|
|
202
|
+
label={getFieldLabel()}
|
|
203
|
+
disabled={element.disabledFields.includes(fieldName)}
|
|
204
|
+
hidden={element.hiddenFields.includes(fieldName)}
|
|
205
|
+
onChangeCallBack={(v: any, selectedRecord: any) => {
|
|
206
|
+
let newValue = null;
|
|
207
|
+
if (v) {
|
|
208
|
+
newValue = v;
|
|
209
|
+
}
|
|
210
|
+
formManager.setValue(fieldName, newValue);
|
|
211
|
+
if (element?.formValuesChangeCallBk) {
|
|
212
|
+
element?.formValuesChangeCallBk(
|
|
213
|
+
formValues,
|
|
214
|
+
formActions,
|
|
215
|
+
formManager,
|
|
216
|
+
fieldName,
|
|
217
|
+
v,
|
|
218
|
+
selectedRecord
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
}}
|
|
222
|
+
lookupType={props.lookupType}
|
|
223
|
+
value={formValues[fieldName]}
|
|
224
|
+
errorMessage={formManager?.formState?.errors[
|
|
225
|
+
fieldName
|
|
226
|
+
]?.message?.toString()}
|
|
227
|
+
/>
|
|
228
|
+
) : null}
|
|
229
|
+
</Grid2>
|
|
230
|
+
) : (
|
|
231
|
+
<></>
|
|
232
|
+
);
|
|
233
|
+
} else {
|
|
234
|
+
return <></>;
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export default FormElementField;
|