@asaleh37/ui-base 25.8.23-3 → 25.8.23-5
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 +2 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/administration/dev/EntityParameterGrid.tsx +1 -0
- package/src/components/administration/dev/ReportGrid.tsx +7 -5
- package/src/components/index.ts +2 -0
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/DataGridColumnsUtil.tsx +2 -2
- package/src/components/templates/DataEntryTemplates/TemplateDataGrid/TemplateGrid.tsx +16 -15
- package/src/components/templates/report/ExcelReportViewer.tsx +2 -1
- package/src/hooks/UseWindow.tsx +5 -1
package/package.json
CHANGED
|
@@ -61,7 +61,7 @@ const adjustFormAccordingToReportType = (
|
|
|
61
61
|
value: any,
|
|
62
62
|
formActions: FormActionProps,
|
|
63
63
|
formManager: UseFormReturn
|
|
64
|
-
) => {
|
|
64
|
+
) => {
|
|
65
65
|
if (value && validationObject[value]) {
|
|
66
66
|
const validationObjects: ReportValidationOptions = validationObject[value];
|
|
67
67
|
const fields = Object.keys(validationObjects);
|
|
@@ -208,6 +208,7 @@ const ReportGrid: React.FC = () => {
|
|
|
208
208
|
optionValueField: "value",
|
|
209
209
|
required: true,
|
|
210
210
|
fieldType: "combobox",
|
|
211
|
+
comboboxValueDataType: "string",
|
|
211
212
|
formProps: {
|
|
212
213
|
onValueChangeCallBack(
|
|
213
214
|
value,
|
|
@@ -247,6 +248,7 @@ const ReportGrid: React.FC = () => {
|
|
|
247
248
|
fieldLabel: "ATTACHMENT_CONFIG_STORAGE_TYPE",
|
|
248
249
|
fieldName: "storageType",
|
|
249
250
|
required: true,
|
|
251
|
+
comboboxValueDataType: "string",
|
|
250
252
|
fieldType: "combobox",
|
|
251
253
|
options: storageTypes,
|
|
252
254
|
optionDisplayField: "value",
|
|
@@ -354,10 +356,10 @@ const ReportGrid: React.FC = () => {
|
|
|
354
356
|
props: {
|
|
355
357
|
fieldLabel: "REPORT_REPORT_EXCEL_DATA_QUERY_ID",
|
|
356
358
|
fieldName: "reportExcelDataQueryId",
|
|
357
|
-
hidden: true,
|
|
358
|
-
gridProps: {
|
|
359
|
-
|
|
360
|
-
},
|
|
359
|
+
// hidden: true,
|
|
360
|
+
// gridProps: {
|
|
361
|
+
// hidden: true,
|
|
362
|
+
// },
|
|
361
363
|
required: false,
|
|
362
364
|
fieldType: "combobox",
|
|
363
365
|
options: SystemDataQueries,
|
package/src/components/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataGridPremium } from "@mui/x-data-grid-premium";
|
|
1
2
|
export * from "./BaseApp";
|
|
2
3
|
export * from "@mui/material";
|
|
3
4
|
export * from "@mui/lab";
|
|
@@ -6,3 +7,4 @@ export { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
|
6
7
|
export type { FontAwesomeIconProps } from "@fortawesome/react-fontawesome";
|
|
7
8
|
export * from "./templates";
|
|
8
9
|
export * from "@mui/x-tree-view/models";
|
|
10
|
+
export { DataGridPremium } ;
|
package/src/components/templates/DataEntryTemplates/TemplateDataGrid/DataGridColumnsUtil.tsx
CHANGED
|
@@ -89,7 +89,7 @@ export const generateComboColumn: (
|
|
|
89
89
|
type: "custom",
|
|
90
90
|
valueGetter: (value) => {
|
|
91
91
|
if (value) {
|
|
92
|
-
return value
|
|
92
|
+
return value;
|
|
93
93
|
}
|
|
94
94
|
return value;
|
|
95
95
|
},
|
|
@@ -128,7 +128,7 @@ export const generateComboColumn: (
|
|
|
128
128
|
params.api.setEditCellValue({
|
|
129
129
|
id: params.id,
|
|
130
130
|
field: params.field,
|
|
131
|
-
value: v
|
|
131
|
+
value: v,
|
|
132
132
|
});
|
|
133
133
|
}}
|
|
134
134
|
/>
|
|
@@ -744,23 +744,24 @@ const TemplateGrid: React.FC<TemplateGridProps> = (props) => {
|
|
|
744
744
|
}
|
|
745
745
|
};
|
|
746
746
|
|
|
747
|
-
const handleColumnWidthChange: GridEventListener<"columnWidthChange"> = (
|
|
748
|
-
|
|
749
|
-
) => {
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
};
|
|
747
|
+
// const handleColumnWidthChange: GridEventListener<"columnWidthChange"> = (
|
|
748
|
+
// params: GridColumnResizeParams
|
|
749
|
+
// ) => {
|
|
750
|
+
// const updatedWidths = {
|
|
751
|
+
// ...columnWidths,
|
|
752
|
+
// [params.colDef.field]: params.width,
|
|
753
|
+
// };
|
|
754
|
+
// setColumnWidths(updatedWidths);
|
|
755
|
+
// if (props?.gridStateKey) {
|
|
756
|
+
// saveGridState(props.gridStateKey, { columnWidths: updatedWidths });
|
|
757
|
+
// }
|
|
758
|
+
// };
|
|
759
759
|
|
|
760
760
|
const adjustedColumns: Array<TemplateGridColDef> = React.useMemo(() => {
|
|
761
761
|
const baseCols = structuredColumns.map((col) => ({
|
|
762
762
|
...col,
|
|
763
|
-
|
|
763
|
+
minWidth: col?.width || 200,
|
|
764
|
+
flex: 1,
|
|
764
765
|
}));
|
|
765
766
|
|
|
766
767
|
// Reorder based on saved columnOrder
|
|
@@ -768,9 +769,9 @@ const TemplateGrid: React.FC<TemplateGridProps> = (props) => {
|
|
|
768
769
|
const fieldToCol = new Map(baseCols.map((col) => [col.field, col]));
|
|
769
770
|
return columnOrder.map((field) => fieldToCol.get(field)!).filter(Boolean);
|
|
770
771
|
}
|
|
771
|
-
|
|
772
772
|
return baseCols;
|
|
773
773
|
}, [columnOrder, columnWidths, structuredColumns]);
|
|
774
|
+
|
|
774
775
|
return (
|
|
775
776
|
<>
|
|
776
777
|
<ConfirmationWindow />
|
|
@@ -984,7 +985,7 @@ const TemplateGrid: React.FC<TemplateGridProps> = (props) => {
|
|
|
984
985
|
columnVisibilityModel={columnVisibilityModel}
|
|
985
986
|
onColumnVisibilityModelChange={handleColumnVisibilityChange}
|
|
986
987
|
onColumnOrderChange={handleColumnOrderChange}
|
|
987
|
-
onColumnWidthChange={handleColumnWidthChange}
|
|
988
|
+
// onColumnWidthChange={handleColumnWidthChange}
|
|
988
989
|
rowGroupingModel={gridRowGroupingModel}
|
|
989
990
|
onRowGroupingModelChange={(model: GridRowGroupingModel) => {
|
|
990
991
|
handleRowGroupChange(model);
|
package/src/hooks/UseWindow.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
} from "@mui/material";
|
|
11
11
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
12
12
|
import { IconProp } from "@fortawesome/fontawesome-svg-core";
|
|
13
|
+
import { useSelector } from "react-redux";
|
|
13
14
|
|
|
14
15
|
export interface TemplateWindowProp {
|
|
15
16
|
height?: any;
|
|
@@ -27,7 +28,9 @@ interface WindowProps {
|
|
|
27
28
|
|
|
28
29
|
export const useWindow = (props: TemplateWindowProp) => {
|
|
29
30
|
const [windowState, setWindowState] = useState(false);
|
|
30
|
-
|
|
31
|
+
const appDirection = useSelector(
|
|
32
|
+
(state: any) => state.AppLayout.appDirection
|
|
33
|
+
);
|
|
31
34
|
const Window: React.FC<WindowProps> = (windowProps: WindowProps) => {
|
|
32
35
|
return (
|
|
33
36
|
<Modal
|
|
@@ -40,6 +43,7 @@ export const useWindow = (props: TemplateWindowProp) => {
|
|
|
40
43
|
}}
|
|
41
44
|
>
|
|
42
45
|
<Box
|
|
46
|
+
dir={appDirection}
|
|
43
47
|
sx={{
|
|
44
48
|
position: "absolute",
|
|
45
49
|
top: "50%",
|