@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asaleh37/ui-base",
3
- "version": "25.8.23-4",
3
+ "version": "25.8.23-5",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Ahmed Saleh Mohamed",
@@ -116,6 +116,7 @@ const EntityParameterGrid: React.FC = () => {
116
116
  required: true,
117
117
  fieldType: "combobox",
118
118
  options: SystemParameterTypes,
119
+ comboboxValueDataType: "string",
119
120
  optionDisplayField: "value",
120
121
  optionValueField: "value",
121
122
  formProps: {
@@ -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
- 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
- };
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
- width: columnWidths[col.field] || col.width,
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);
@@ -27,7 +27,8 @@ const getGridColumnsFromRecord = (data: Array<any>) => {
27
27
  },
28
28
  };
29
29
  formElements.push(formElement);
30
- }
30
+ }
31
+ debugger;
31
32
  return formElements;
32
33
  };
33
34
 
@@ -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%",