@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asaleh37/ui-base",
3
- "version": "25.8.23-3",
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: {
@@ -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
- hidden: true,
360
- },
359
+ // hidden: true,
360
+ // gridProps: {
361
+ // hidden: true,
362
+ // },
361
363
  required: false,
362
364
  fieldType: "combobox",
363
365
  options: SystemDataQueries,
@@ -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 } ;
@@ -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
- 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%",