@asaleh37/ui-base 25.8.23-4 → 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 +4 -4
- 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/index.ts +2 -0
- 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
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 } ;
|
|
@@ -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%",
|