@asaleh37/ui-base 25.8.26 → 25.8.31-1
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.d.ts +22 -6
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/administration/dev/AttachmentConfigGrid.tsx +1 -0
- package/src/components/administration/dev/DataQueryGrid.tsx +26 -16
- package/src/components/administration/dev/DatasourceConnectionGrid.tsx +1 -0
- package/src/components/administration/dev/EntityParameterGrid.tsx +94 -67
- package/src/components/administration/dev/MailSenderConfigGrid.tsx +1 -0
- package/src/components/administration/dev/MailTemplateGrid.tsx +1 -0
- package/src/components/administration/dev/NotificationGrid.tsx +5 -2
- package/src/components/administration/dev/ReportGrid.tsx +102 -111
- package/src/components/administration/dev/WidgetGrid.tsx +96 -147
- package/src/components/administration/dev/WorkflowDocumentGrid.tsx +2 -23
- package/src/components/templates/DataEntryTemplates/DataEntryTypes.ts +41 -16
- package/src/components/templates/DataEntryTemplates/DataEntryUtil.ts +20 -10
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormElementField.tsx +80 -60
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/Datefield.tsx +1 -1
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/FormFields/DatetimeField.tsx +1 -1
- package/src/components/templates/DataEntryTemplates/TemplateDataForm/TemplateForm.tsx +83 -65
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid.tsx +8 -5
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGridTopBar.tsx +3 -1
- package/src/components/templates/report/ReportViewer.tsx +24 -138
- package/src/components/templates/visuals/DashboardViewer.tsx +49 -5
- package/src/components/templates/visuals/WidgetViewer.tsx +24 -14
- package/src/examples/ExampleGrid.tsx +134 -0
- package/src/hooks/useParameterPanel.tsx +168 -0
- package/src/layout/MainContent.tsx +47 -50
- package/src/locales/arabic/devLocalsAr.json +2 -2
- package/src/locales/english/devLocalsEn.json +2 -2
- package/src/navigationItems/index.tsx +1 -1
- package/src/routes/index.ts +1 -1
- package/src/util/AppUtils.ts +2 -0
|
@@ -3,17 +3,13 @@ import TemplateGrid from "../../templates/DataEntryTemplates/TemplateDataGrid/Te
|
|
|
3
3
|
import {
|
|
4
4
|
FormActionProps,
|
|
5
5
|
FormElementProps,
|
|
6
|
+
FormValueChangeCallBk,
|
|
6
7
|
} from "../../templates/DataEntryTemplates/DataEntryTypes";
|
|
7
8
|
import { useTranslation } from "react-i18next";
|
|
8
9
|
import { useApiActions } from "../../../hooks";
|
|
9
10
|
import { useSelector } from "react-redux";
|
|
10
11
|
import { UseFormReturn } from "react-hook-form";
|
|
11
12
|
|
|
12
|
-
type ValidationCritria = {
|
|
13
|
-
isVisible: boolean;
|
|
14
|
-
isMandatory: boolean;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
13
|
export type WidgetType =
|
|
18
14
|
| "LineChart"
|
|
19
15
|
| "ColumnChart"
|
|
@@ -22,109 +18,81 @@ export type WidgetType =
|
|
|
22
18
|
| "CircularProgress"
|
|
23
19
|
| "LinearProgress";
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
verticalAxisField: ValidationCritria;
|
|
32
|
-
verticalAxisLabel: ValidationCritria;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
type validationObjectType = {
|
|
36
|
-
[key in WidgetType]: WidgetValidationOptions;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const validationObject: validationObjectType = {
|
|
40
|
-
LineChart: {
|
|
41
|
-
height: { isMandatory: true, isVisible: true },
|
|
42
|
-
width: { isMandatory: true, isVisible: true },
|
|
43
|
-
horizontalAxisField: { isMandatory: true, isVisible: true },
|
|
44
|
-
horizontalAxisLabel: { isMandatory: true, isVisible: true },
|
|
45
|
-
seriesKeys: { isMandatory: false, isVisible: false },
|
|
46
|
-
verticalAxisField: { isMandatory: true, isVisible: true },
|
|
47
|
-
verticalAxisLabel: { isMandatory: true, isVisible: true },
|
|
48
|
-
},
|
|
49
|
-
ColumnChart: {
|
|
50
|
-
height: { isMandatory: true, isVisible: true },
|
|
51
|
-
width: { isMandatory: true, isVisible: true },
|
|
52
|
-
horizontalAxisField: { isMandatory: true, isVisible: true },
|
|
53
|
-
horizontalAxisLabel: { isMandatory: true, isVisible: true },
|
|
54
|
-
seriesKeys: { isMandatory: false, isVisible: false },
|
|
55
|
-
verticalAxisField: { isMandatory: true, isVisible: true },
|
|
56
|
-
verticalAxisLabel: { isMandatory: true, isVisible: true },
|
|
57
|
-
},
|
|
58
|
-
PieChart: {
|
|
59
|
-
height: { isMandatory: true, isVisible: true },
|
|
60
|
-
width: { isMandatory: true, isVisible: true },
|
|
61
|
-
horizontalAxisField: { isMandatory: true, isVisible: true },
|
|
62
|
-
horizontalAxisLabel: { isMandatory: false, isVisible: false },
|
|
63
|
-
seriesKeys: { isMandatory: false, isVisible: false },
|
|
64
|
-
verticalAxisField: { isMandatory: true, isVisible: true },
|
|
65
|
-
verticalAxisLabel: { isMandatory: false, isVisible: false },
|
|
66
|
-
},
|
|
67
|
-
Card: {
|
|
68
|
-
height: { isMandatory: true, isVisible: true },
|
|
69
|
-
width: { isMandatory: true, isVisible: true },
|
|
70
|
-
horizontalAxisField: { isMandatory: true, isVisible: true },
|
|
71
|
-
horizontalAxisLabel: { isMandatory: false, isVisible: false },
|
|
72
|
-
seriesKeys: { isMandatory: false, isVisible: false },
|
|
73
|
-
verticalAxisField: { isMandatory: true, isVisible: true },
|
|
74
|
-
verticalAxisLabel: { isMandatory: false, isVisible: false },
|
|
75
|
-
},
|
|
76
|
-
CircularProgress: {
|
|
77
|
-
height: { isMandatory: false, isVisible: false },
|
|
78
|
-
width: { isMandatory: false, isVisible: false },
|
|
79
|
-
horizontalAxisField: { isMandatory: false, isVisible: false },
|
|
80
|
-
horizontalAxisLabel: { isMandatory: false, isVisible: false },
|
|
81
|
-
seriesKeys: { isMandatory: false, isVisible: false },
|
|
82
|
-
verticalAxisField: { isMandatory: false, isVisible: false },
|
|
83
|
-
verticalAxisLabel: { isMandatory: false, isVisible: false },
|
|
84
|
-
},
|
|
85
|
-
LinearProgress: {
|
|
86
|
-
height: { isMandatory: false, isVisible: false },
|
|
87
|
-
width: { isMandatory: false, isVisible: false },
|
|
88
|
-
horizontalAxisField: { isMandatory: false, isVisible: false },
|
|
89
|
-
horizontalAxisLabel: { isMandatory: false, isVisible: false },
|
|
90
|
-
seriesKeys: { isMandatory: false, isVisible: false },
|
|
91
|
-
verticalAxisField: { isMandatory: false, isVisible: false },
|
|
92
|
-
verticalAxisLabel: { isMandatory: false, isVisible: false },
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const adjustFormAccordingToWidgetType = (
|
|
97
|
-
value: any,
|
|
98
|
-
formActions: FormActionProps,
|
|
99
|
-
formManager: UseFormReturn
|
|
21
|
+
const adjustFormAfterValueChange: FormValueChangeCallBk = (
|
|
22
|
+
formValues,
|
|
23
|
+
formActions,
|
|
24
|
+
formManager,
|
|
25
|
+
fieldName,
|
|
26
|
+
newValue
|
|
100
27
|
) => {
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
formActions.showField(
|
|
28
|
+
if (fieldName) {
|
|
29
|
+
if (fieldName === "widgetType") {
|
|
30
|
+
if (newValue === "LineChart") {
|
|
31
|
+
formActions.showField("height");
|
|
32
|
+
formActions.showField("width");
|
|
33
|
+
formActions.showField("horizontalAxisField");
|
|
34
|
+
formActions.showField("horizontalAxisLabel");
|
|
35
|
+
formActions.showField("seriesKeys");
|
|
36
|
+
formActions.showField("verticalAxisField");
|
|
37
|
+
formActions.showField("verticalAxisLabel");
|
|
38
|
+
} else if (newValue === "ColumnChart") {
|
|
39
|
+
formActions.showField("height");
|
|
40
|
+
formActions.showField("width");
|
|
41
|
+
formActions.showField("horizontalAxisField");
|
|
42
|
+
formActions.showField("horizontalAxisLabel");
|
|
43
|
+
formActions.hideField("seriesKeys");
|
|
44
|
+
formActions.showField("verticalAxisField");
|
|
45
|
+
formActions.showField("verticalAxisLabel");
|
|
46
|
+
} else if (newValue === "PieChart") {
|
|
47
|
+
formActions.showField("height");
|
|
48
|
+
formActions.showField("width");
|
|
49
|
+
formActions.showField("horizontalAxisField");
|
|
50
|
+
formActions.hideField("horizontalAxisLabel");
|
|
51
|
+
formActions.hideField("seriesKeys");
|
|
52
|
+
formActions.showField("verticalAxisField");
|
|
53
|
+
formActions.hideField("verticalAxisLabel");
|
|
54
|
+
} else if (newValue === "Card") {
|
|
55
|
+
formActions.showField("height");
|
|
56
|
+
formActions.showField("width");
|
|
57
|
+
formActions.showField("horizontalAxisField");
|
|
58
|
+
formActions.hideField("horizontalAxisLabel");
|
|
59
|
+
formActions.hideField("seriesKeys");
|
|
60
|
+
formActions.showField("verticalAxisField");
|
|
61
|
+
formActions.hideField("verticalAxisLabel");
|
|
62
|
+
} else if (newValue === "CircularProgress") {
|
|
63
|
+
formActions.hideField("height");
|
|
64
|
+
formActions.hideField("width");
|
|
65
|
+
formActions.hideField("horizontalAxisField");
|
|
66
|
+
formActions.hideField("horizontalAxisLabel");
|
|
67
|
+
formActions.hideField("seriesKeys");
|
|
68
|
+
formActions.hideField("verticalAxisField");
|
|
69
|
+
formActions.hideField("verticalAxisLabel");
|
|
70
|
+
} else if (newValue === "LinearProgress") {
|
|
71
|
+
formActions.hideField("height");
|
|
72
|
+
formActions.hideField("width");
|
|
73
|
+
formActions.hideField("horizontalAxisField");
|
|
74
|
+
formActions.hideField("horizontalAxisLabel");
|
|
75
|
+
formActions.hideField("seriesKeys");
|
|
76
|
+
formActions.hideField("verticalAxisField");
|
|
77
|
+
formActions.hideField("verticalAxisLabel");
|
|
108
78
|
} else {
|
|
109
|
-
formActions.hideField(
|
|
110
|
-
formManager.setValue(
|
|
79
|
+
formActions.hideField("height");
|
|
80
|
+
formManager.setValue("height", null);
|
|
81
|
+
formActions.hideField("width");
|
|
82
|
+
formManager.setValue("width", null);
|
|
83
|
+
formActions.hideField("horizontalAxisField");
|
|
84
|
+
formManager.setValue("horizontalAxisField", null);
|
|
85
|
+
formActions.hideField("horizontalAxisLabel");
|
|
86
|
+
formManager.setValue("horizontalAxisLabel", null);
|
|
87
|
+
formActions.hideField("seriesKeys");
|
|
88
|
+
formManager.setValue("seriesKeys", null);
|
|
89
|
+
formActions.hideField("verticalAxisField");
|
|
90
|
+
formManager.setValue("verticalAxisField", null);
|
|
91
|
+
formActions.hideField("verticalAxisLabel");
|
|
92
|
+
formManager.setValue("verticalAxisLabel", null);
|
|
111
93
|
}
|
|
112
94
|
}
|
|
113
95
|
} else {
|
|
114
|
-
formActions.hideField("height");
|
|
115
|
-
formManager.setValue("height", null);
|
|
116
|
-
formActions.hideField("width");
|
|
117
|
-
formManager.setValue("width", null);
|
|
118
|
-
formActions.hideField("horizontalAxisField");
|
|
119
|
-
formManager.setValue("horizontalAxisField", null);
|
|
120
|
-
formActions.hideField("horizontalAxisLabel");
|
|
121
|
-
formManager.setValue("horizontalAxisLabel", null);
|
|
122
|
-
formActions.hideField("seriesKeys");
|
|
123
|
-
formManager.setValue("seriesKeys", null);
|
|
124
|
-
formActions.hideField("verticalAxisField");
|
|
125
|
-
formManager.setValue("verticalAxisField", null);
|
|
126
|
-
formActions.hideField("verticalAxisLabel");
|
|
127
|
-
formManager.setValue("verticalAxisLabel", null);
|
|
128
96
|
}
|
|
129
97
|
};
|
|
130
98
|
|
|
@@ -219,19 +187,10 @@ const WidgetGrid: React.FC = () => {
|
|
|
219
187
|
fieldName: "widgetType",
|
|
220
188
|
required: true,
|
|
221
189
|
fieldType: "combobox",
|
|
190
|
+
comboboxValueDataType: "string",
|
|
222
191
|
options: SystemWidgetTypes,
|
|
223
192
|
optionDisplayField: "name",
|
|
224
193
|
optionValueField: "name",
|
|
225
|
-
formProps: {
|
|
226
|
-
onValueChangeCallBack(
|
|
227
|
-
value,
|
|
228
|
-
formManager,
|
|
229
|
-
formActions,
|
|
230
|
-
selectedRecord
|
|
231
|
-
) {
|
|
232
|
-
adjustFormAccordingToWidgetType(value, formActions, formManager);
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
194
|
},
|
|
236
195
|
},
|
|
237
196
|
{
|
|
@@ -347,7 +306,7 @@ const WidgetGrid: React.FC = () => {
|
|
|
347
306
|
props: {
|
|
348
307
|
fieldLabel: "WIDGET_HORIZONTAL_AXIS_FIELD",
|
|
349
308
|
fieldName: "horizontalAxisField",
|
|
350
|
-
required:
|
|
309
|
+
required: true,
|
|
351
310
|
fieldType: "text",
|
|
352
311
|
},
|
|
353
312
|
},
|
|
@@ -357,21 +316,21 @@ const WidgetGrid: React.FC = () => {
|
|
|
357
316
|
props: {
|
|
358
317
|
fieldLabel: "WIDGET_HORIZONTAL_AXIS_LABEL",
|
|
359
318
|
fieldName: "horizontalAxisLabel",
|
|
360
|
-
required:
|
|
319
|
+
required: true,
|
|
361
320
|
fieldType: "text",
|
|
362
321
|
},
|
|
363
322
|
},
|
|
364
323
|
|
|
365
|
-
{
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
},
|
|
324
|
+
// {
|
|
325
|
+
// type: "field",
|
|
326
|
+
// mode: "props",
|
|
327
|
+
// props: {
|
|
328
|
+
// fieldLabel: "WIDGET_SERIES_KEYS",
|
|
329
|
+
// fieldName: "seriesKeys",
|
|
330
|
+
// required: false,
|
|
331
|
+
// fieldType: "text",
|
|
332
|
+
// },
|
|
333
|
+
// },
|
|
375
334
|
|
|
376
335
|
{
|
|
377
336
|
type: "field",
|
|
@@ -379,20 +338,20 @@ const WidgetGrid: React.FC = () => {
|
|
|
379
338
|
props: {
|
|
380
339
|
fieldLabel: "WIDGET_VERTICAL_AXIS_FIELD",
|
|
381
340
|
fieldName: "verticalAxisField",
|
|
382
|
-
required:
|
|
383
|
-
fieldType: "text",
|
|
384
|
-
},
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
type: "field",
|
|
388
|
-
mode: "props",
|
|
389
|
-
props: {
|
|
390
|
-
fieldLabel: "WIDGET_VERTICAL_AXIS_LABEL",
|
|
391
|
-
fieldName: "verticalAxisLabel",
|
|
392
|
-
required: false,
|
|
341
|
+
required: true,
|
|
393
342
|
fieldType: "text",
|
|
394
343
|
},
|
|
395
344
|
},
|
|
345
|
+
// {
|
|
346
|
+
// type: "field",
|
|
347
|
+
// mode: "props",
|
|
348
|
+
// props: {
|
|
349
|
+
// fieldLabel: "WIDGET_VERTICAL_AXIS_LABEL",
|
|
350
|
+
// fieldName: "verticalAxisLabel",
|
|
351
|
+
// required: false,
|
|
352
|
+
// fieldType: "text",
|
|
353
|
+
// },
|
|
354
|
+
// },
|
|
396
355
|
],
|
|
397
356
|
},
|
|
398
357
|
},
|
|
@@ -413,17 +372,7 @@ const WidgetGrid: React.FC = () => {
|
|
|
413
372
|
girdIcon="chart-pie"
|
|
414
373
|
editAction={{ isEnabled: true, authority: "WIDGET_EDIT" }}
|
|
415
374
|
deleteAction={{ isEnabled: true, authority: "WIDGET_DELETE" }}
|
|
416
|
-
|
|
417
|
-
formActions: FormActionProps,
|
|
418
|
-
formManager: UseFormReturn,
|
|
419
|
-
record: any
|
|
420
|
-
) => {
|
|
421
|
-
adjustFormAccordingToWidgetType(
|
|
422
|
-
record.widgetType,
|
|
423
|
-
formActions,
|
|
424
|
-
formManager
|
|
425
|
-
);
|
|
426
|
-
}}
|
|
375
|
+
// formProps={{ formValuesChangeCallBk: adjustFormAfterValueChange }}
|
|
427
376
|
/>
|
|
428
377
|
);
|
|
429
378
|
};
|
|
@@ -155,7 +155,8 @@ const WorkflowDocumentGrid: React.FC = () => {
|
|
|
155
155
|
type: "field",
|
|
156
156
|
mode: "props",
|
|
157
157
|
props: {
|
|
158
|
-
fieldLabel:
|
|
158
|
+
fieldLabel:
|
|
159
|
+
"Report To be Attached For The Document ( will be passed a parameter called doc_id)",
|
|
159
160
|
fieldName: "documentReportId",
|
|
160
161
|
required: false,
|
|
161
162
|
fieldType: "combobox",
|
|
@@ -231,21 +232,6 @@ const WorkflowDocumentGrid: React.FC = () => {
|
|
|
231
232
|
fieldName: "useSystemCon",
|
|
232
233
|
required: false,
|
|
233
234
|
fieldType: "checkbox",
|
|
234
|
-
formProps: {
|
|
235
|
-
onValueChangeCallBack(
|
|
236
|
-
value,
|
|
237
|
-
formManager,
|
|
238
|
-
formActions,
|
|
239
|
-
selectedRecord
|
|
240
|
-
) {
|
|
241
|
-
if (value) {
|
|
242
|
-
formActions.hideField("documentConId");
|
|
243
|
-
formManager.setValue("documentConId", null);
|
|
244
|
-
} else {
|
|
245
|
-
formActions.showField("documentConId");
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
235
|
},
|
|
250
236
|
},
|
|
251
237
|
{
|
|
@@ -326,13 +312,6 @@ const WorkflowDocumentGrid: React.FC = () => {
|
|
|
326
312
|
</WorkflowActionWindow>
|
|
327
313
|
<TemplateGrid
|
|
328
314
|
apiActions={apiActions}
|
|
329
|
-
formLoadCallBk={(formActions, formManager, record) => {
|
|
330
|
-
if (record.useSystemCon === true) {
|
|
331
|
-
formActions.hideField("documentConId");
|
|
332
|
-
} else {
|
|
333
|
-
formActions.showField("documentConId");
|
|
334
|
-
}
|
|
335
|
-
}}
|
|
336
315
|
data={data}
|
|
337
316
|
setData={setData}
|
|
338
317
|
rowActions={[
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import { UseFormReturn } from "react-hook-form";
|
|
11
11
|
import { SxProps, TextFieldProps } from "@mui/material";
|
|
12
12
|
import { ApiActions } from "../../../hooks/useApiActions";
|
|
13
|
+
import { z } from "zod";
|
|
13
14
|
export type MakeOptional<T, K extends keyof T> = Omit<T, K> &
|
|
14
15
|
Partial<Pick<T, K>>;
|
|
15
16
|
|
|
@@ -18,6 +19,7 @@ export type RecordAction = {
|
|
|
18
19
|
label?: string;
|
|
19
20
|
icon: IconProp;
|
|
20
21
|
isConfirmationRequired?: boolean;
|
|
22
|
+
isIdRequired?: Boolean;
|
|
21
23
|
confirmationMessage?: string;
|
|
22
24
|
authority?: string;
|
|
23
25
|
getActionIconStyleForRecord?: (record: any) => object;
|
|
@@ -131,11 +133,20 @@ export type TemplateGridProps = {
|
|
|
131
133
|
setRowSelectionModel?: any;
|
|
132
134
|
setSelectedRecord?: any;
|
|
133
135
|
setSelectedRecordIds?: any;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
formProps?: {
|
|
137
|
+
formValuesChangeCallBk?: FormValueChangeCallBk;
|
|
138
|
+
};
|
|
139
|
+
validationSchema?: z.ZodObject<
|
|
140
|
+
any,
|
|
141
|
+
"strip",
|
|
142
|
+
z.ZodTypeAny,
|
|
143
|
+
{
|
|
144
|
+
[x: string]: any;
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
[x: string]: any;
|
|
148
|
+
}
|
|
149
|
+
>;
|
|
139
150
|
editMode:
|
|
140
151
|
| { editMode: "none" }
|
|
141
152
|
| {
|
|
@@ -160,6 +171,7 @@ export type TemplateGridProps = {
|
|
|
160
171
|
formRoute: string;
|
|
161
172
|
};
|
|
162
173
|
};
|
|
174
|
+
|
|
163
175
|
muiProps?: MakeOptional<DataGridPremiumProps, "rows" | "columns">;
|
|
164
176
|
};
|
|
165
177
|
|
|
@@ -204,14 +216,9 @@ export type RecordFieldProps = {
|
|
|
204
216
|
gridProps?: TemplateGridColumnProps;
|
|
205
217
|
formProps?: {
|
|
206
218
|
fieldSize?: FormElementSize;
|
|
219
|
+
fieldLabelFn?: (record: any) => string;
|
|
207
220
|
fieldHeight?: number;
|
|
208
221
|
style?: SxProps;
|
|
209
|
-
onValueChangeCallBack?: (
|
|
210
|
-
value: any,
|
|
211
|
-
formManager: UseFormReturn,
|
|
212
|
-
formActions?: FormActionProps,
|
|
213
|
-
selectedRecord?: any
|
|
214
|
-
) => void;
|
|
215
222
|
};
|
|
216
223
|
};
|
|
217
224
|
|
|
@@ -228,6 +235,15 @@ export type FormElementGroupProps = {
|
|
|
228
235
|
disabledFields?: string[];
|
|
229
236
|
};
|
|
230
237
|
|
|
238
|
+
export type FormValueChangeCallBk = (
|
|
239
|
+
formValues: any,
|
|
240
|
+
formActions: FormActionProps,
|
|
241
|
+
formManager: UseFormReturn,
|
|
242
|
+
fieldName?: string,
|
|
243
|
+
newValue?: any,
|
|
244
|
+
selectedRecord?: any
|
|
245
|
+
) => void;
|
|
246
|
+
|
|
231
247
|
export type FormElementFieldProps = {
|
|
232
248
|
fieldInfo: RecordFieldProps;
|
|
233
249
|
formManager?: UseFormReturn;
|
|
@@ -235,6 +251,8 @@ export type FormElementFieldProps = {
|
|
|
235
251
|
formActions?: any;
|
|
236
252
|
hiddenFields?: string[];
|
|
237
253
|
disabledFields?: string[];
|
|
254
|
+
formValuesChangeCallBk?: FormValueChangeCallBk;
|
|
255
|
+
|
|
238
256
|
};
|
|
239
257
|
|
|
240
258
|
export type FormElementNodeProps = {
|
|
@@ -281,11 +299,7 @@ export type TemplateFormProps = {
|
|
|
281
299
|
apiActions: ApiActions;
|
|
282
300
|
preSaveValidation?: (record: any) => boolean | Promise<boolean>;
|
|
283
301
|
formSavedSuccessfullyCallBk?: (response: any) => void;
|
|
284
|
-
|
|
285
|
-
formActions: FormActionProps,
|
|
286
|
-
formManager: UseFormReturn,
|
|
287
|
-
record: any
|
|
288
|
-
) => void;
|
|
302
|
+
formValuesChangeCallBk?: FormValueChangeCallBk;
|
|
289
303
|
formCloseCallBk?: () => void;
|
|
290
304
|
saveButtonSpecs?: {
|
|
291
305
|
label?: string;
|
|
@@ -315,6 +329,17 @@ export type TemplateFormProps = {
|
|
|
315
329
|
| "info"
|
|
316
330
|
| "warning";
|
|
317
331
|
};
|
|
332
|
+
validationSchema?: z.ZodObject<
|
|
333
|
+
any,
|
|
334
|
+
"strip",
|
|
335
|
+
z.ZodTypeAny,
|
|
336
|
+
{
|
|
337
|
+
[x: string]: any;
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
[x: string]: any;
|
|
341
|
+
}
|
|
342
|
+
>;
|
|
318
343
|
};
|
|
319
344
|
|
|
320
345
|
export type TemplateGridTopBarProps = GridToolbarProps &
|
|
@@ -66,8 +66,10 @@ export const constructGridColumnsFromFields: (
|
|
|
66
66
|
align: "center",
|
|
67
67
|
hidden: tableField?.hidden,
|
|
68
68
|
searchable: tableField?.gridProps?.searchable,
|
|
69
|
-
flex: tableField?.gridProps?.muiProps?.
|
|
70
|
-
minWidth:
|
|
69
|
+
flex: tableField?.gridProps?.muiProps?.flex || 1,
|
|
70
|
+
minWidth: tableField?.gridProps?.muiProps?.width
|
|
71
|
+
? tableField?.gridProps?.muiProps?.width
|
|
72
|
+
: 200,
|
|
71
73
|
};
|
|
72
74
|
|
|
73
75
|
columns.push(column);
|
|
@@ -84,8 +86,10 @@ export const constructGridColumnsFromFields: (
|
|
|
84
86
|
align: "center",
|
|
85
87
|
hidden: tableField?.hidden,
|
|
86
88
|
searchable: tableField?.gridProps?.searchable,
|
|
87
|
-
flex: tableField?.gridProps?.muiProps?.
|
|
88
|
-
minWidth:
|
|
89
|
+
flex: tableField?.gridProps?.muiProps?.flex || 1,
|
|
90
|
+
minWidth: tableField?.gridProps?.muiProps?.width
|
|
91
|
+
? tableField?.gridProps?.muiProps?.width
|
|
92
|
+
: 200,
|
|
89
93
|
});
|
|
90
94
|
columns.push(column);
|
|
91
95
|
} else if (tableField?.fieldType === "datetime") {
|
|
@@ -101,8 +105,10 @@ export const constructGridColumnsFromFields: (
|
|
|
101
105
|
align: "center",
|
|
102
106
|
hidden: tableField?.hidden,
|
|
103
107
|
searchable: tableField?.gridProps?.searchable,
|
|
104
|
-
flex: tableField?.gridProps?.muiProps?.
|
|
105
|
-
minWidth:
|
|
108
|
+
flex: tableField?.gridProps?.muiProps?.flex || 1,
|
|
109
|
+
minWidth: tableField?.gridProps?.muiProps?.width
|
|
110
|
+
? tableField?.gridProps?.muiProps?.width
|
|
111
|
+
: 200,
|
|
106
112
|
});
|
|
107
113
|
columns.push(column);
|
|
108
114
|
} else if (tableField?.fieldType === "checkbox") {
|
|
@@ -139,8 +145,10 @@ export const constructGridColumnsFromFields: (
|
|
|
139
145
|
valueField: tableField?.optionValueField || "value",
|
|
140
146
|
displayField: tableField?.optionDisplayField || "display",
|
|
141
147
|
options: tableField?.options || [],
|
|
142
|
-
flex: tableField?.gridProps?.muiProps?.
|
|
143
|
-
minWidth:
|
|
148
|
+
flex: tableField?.gridProps?.muiProps?.flex || 1,
|
|
149
|
+
minWidth: tableField?.gridProps?.muiProps?.width
|
|
150
|
+
? tableField?.gridProps?.muiProps?.width
|
|
151
|
+
: 200,
|
|
144
152
|
});
|
|
145
153
|
columns.push(column);
|
|
146
154
|
} else if (tableField?.fieldType === "lookup") {
|
|
@@ -160,8 +168,10 @@ export const constructGridColumnsFromFields: (
|
|
|
160
168
|
valueField: tableField?.optionValueField || "value",
|
|
161
169
|
displayField: tableField?.optionDisplayField || "display",
|
|
162
170
|
options: tableField?.options || [],
|
|
163
|
-
flex: tableField?.gridProps?.muiProps?.
|
|
164
|
-
minWidth:
|
|
171
|
+
flex: tableField?.gridProps?.muiProps?.flex || 1,
|
|
172
|
+
minWidth: tableField?.gridProps?.muiProps?.width
|
|
173
|
+
? tableField?.gridProps?.muiProps?.width
|
|
174
|
+
: 200,
|
|
165
175
|
});
|
|
166
176
|
columns.push(column);
|
|
167
177
|
} else {
|