@acuteinfo/common-base 1.0.79 → 1.0.80

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.
Files changed (25) hide show
  1. package/dist/components/agGridTable/index.d.ts +33 -0
  2. package/dist/components/agGridTable/types.d.ts +24 -0
  3. package/dist/components/agGridTable/useGridTable.d.ts +25 -0
  4. package/dist/components/agGridTable/useTableContext.d.ts +2 -0
  5. package/dist/components/agGridTable/utils/attachYupschema.d.ts +10 -0
  6. package/dist/components/agGridTable/utils/helper.d.ts +22 -0
  7. package/dist/components/agGridTable/utils/transformAgGridMetadata.d.ts +4 -0
  8. package/dist/components/agGridTable/widgets/AutoCompleteCell.d.ts +3 -0
  9. package/dist/components/agGridTable/widgets/CommonComponents.d.ts +13 -0
  10. package/dist/components/agGridTable/widgets/CustomButtonCell.d.ts +3 -0
  11. package/dist/components/agGridTable/widgets/CustomCurrencyEditor.d.ts +2 -0
  12. package/dist/components/agGridTable/widgets/DatePickerCell.d.ts +3 -0
  13. package/dist/components/agGridTable/widgets/DisplayCell.d.ts +2 -0
  14. package/dist/components/agGridTable/widgets/DisplayCurrencyCell.d.ts +2 -0
  15. package/dist/components/agGridTable/widgets/DisplayDateCell.d.ts +2 -0
  16. package/dist/components/agGridTable/widgets/DisplaySelectCell.d.ts +2 -0
  17. package/dist/components/agGridTable/widgets/ErrorComponent.d.ts +4 -0
  18. package/dist/components/agGridTable/widgets/HeaderButtonGroup.d.ts +4 -0
  19. package/dist/components/agGridTable/widgets/NumberFormat.d.ts +3 -0
  20. package/dist/components/detailPopupGridData/GridDetailsWithHeader/detailsGridWithHeader.d.ts +1 -1
  21. package/dist/index.d.ts +2 -0
  22. package/dist/index.js +1 -1
  23. package/dist/index.js.map +1 -1
  24. package/package.json +4 -2
  25. package/rollup.config.mjs +2 -0
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+ import { CellKeyDownEvent, Column } from "ag-grid-community";
3
+ import "./style.css";
4
+ type AgGridTableWrapperProps = {
5
+ autoSelectFirst?: boolean;
6
+ getGridApi: any;
7
+ components?: Record<string, any>;
8
+ gridConfig: any;
9
+ subLabel?: string;
10
+ onClickOnAdd?: () => void;
11
+ onCellValueChanged?: any;
12
+ context?: any;
13
+ onCellKeyDown?: any;
14
+ defaultColDef?: any;
15
+ stopEditingWhenCellsLoseFocus?: any;
16
+ suppressCellSelection?: any;
17
+ defaultView?: any;
18
+ loading?: boolean;
19
+ agGridProps: any;
20
+ hideHeader?: boolean;
21
+ updatePinnedBottomRow?: any;
22
+ handleCustomCellKeyDown?: (params: CellKeyDownEvent, lastColumn: Column) => Promise<void> | void;
23
+ gridContext?: any;
24
+ buttons?: any;
25
+ handleAddNewRow?: () => Promise<void> | void;
26
+ height?: any;
27
+ };
28
+ export declare const GridDataContext: React.Context<{
29
+ gridData: never[];
30
+ setGridData: (data: any) => void;
31
+ }>;
32
+ declare const AgGridTableWrapper: React.FC<AgGridTableWrapperProps>;
33
+ export { AgGridTableWrapper };
@@ -0,0 +1,24 @@
1
+ import { ColDef, ICellEditorParams } from "ag-grid-community";
2
+ export interface CustomColumnMeta extends Partial<ColDef> {
3
+ accessor: string;
4
+ columnName: string;
5
+ componentType?: ColDef["cellEditor"];
6
+ displayComponentType?: ColDef["cellRenderer"];
7
+ FormatProps?: ICellEditorParams;
8
+ className?: string;
9
+ headerTooltip?: string;
10
+ shouldExclude?: (params: any) => boolean;
11
+ postValidationSetCrossAccessorValues?: any;
12
+ isVisible?: boolean;
13
+ isReadOnly?: boolean | ((params: any) => boolean);
14
+ options?: any;
15
+ __EDIT__?: {
16
+ isReadOnly?: boolean;
17
+ };
18
+ __VIEW__?: {
19
+ isReadOnly?: boolean;
20
+ };
21
+ __NEW__?: {
22
+ isReadOnly?: boolean;
23
+ };
24
+ }
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ declare const useGridTable: (props: any) => {
3
+ gridApi: React.MutableRefObject<any>;
4
+ tableId: any;
5
+ allColumns: import("ag-grid-community").ColDef<any, any>[];
6
+ gridContext: any;
7
+ onGridReady: (parameters: any) => void;
8
+ onFirstDataRendered: (parameters: any) => void;
9
+ onCellKeyDown: (params: any) => Promise<void>;
10
+ onAddClick: () => void;
11
+ components: {
12
+ autocomplete: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
13
+ CustomButtonCellEditor: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
14
+ amountField: (props: any) => import("react/jsx-runtime").JSX.Element | null;
15
+ NumberFormat: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
16
+ DatePickerCell: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
17
+ DisplayCurrencyCell: (params: any) => any;
18
+ DisplayDateCell: (params: any) => any;
19
+ DisplaySelectCell: (params: any) => any;
20
+ DisplayCell: (params: any) => any;
21
+ };
22
+ onCellEditingStopped: (params: any) => Promise<void>;
23
+ noDataComponent: () => import("react/jsx-runtime").JSX.Element;
24
+ };
25
+ export default useGridTable;
@@ -0,0 +1,2 @@
1
+ declare const useTableContext: (props: any) => any;
2
+ export default useTableContext;
@@ -0,0 +1,10 @@
1
+ interface GridYupSchemaMetaDataType {
2
+ type: "string" | "number" | "boolean" | "date";
3
+ rules?: YupRulesType[];
4
+ }
5
+ interface YupRulesType {
6
+ name: string;
7
+ params: any[];
8
+ }
9
+ export declare const parseYupSchemaAndAttachMethod: (schemaValidation?: GridYupSchemaMetaDataType, node?: any, field?: string) => ((value: number | string | boolean | Date, node: any, field: any) => Promise<any>) | undefined;
10
+ export {};
@@ -0,0 +1,22 @@
1
+ declare const getAgGridSRNo: ({ rowIndex, agGridReact, data, node, ...rest }: {
2
+ [x: string]: any;
3
+ rowIndex: any;
4
+ agGridReact: any;
5
+ data: any;
6
+ node: any;
7
+ }) => any;
8
+ declare const customCellAggFunc: (params: any) => number;
9
+ declare const parseDate: (dateValue: any) => Date | null;
10
+ declare const findLastDisplayColumn: (gridApi: any, params: any) => any;
11
+ declare const findFirstDisplayColumn: (gridApi: any, params: any) => any;
12
+ declare const getGridRowData: (gridApi: any) => any[];
13
+ declare const removeExistingRowData: (gridApi: any) => Promise<void>;
14
+ declare const dynamicRowHeight: (errors: any, params: any) => void;
15
+ declare const displayNumber: (num: any) => string | 0;
16
+ declare const lessThanDate: (factValue: any, jsonValue: any, options?: {
17
+ ignoreTime: boolean;
18
+ }) => boolean;
19
+ declare const setErrorMessage: (node: any, field: any, message?: string) => void;
20
+ declare const validateChequeDate: (params: any) => string | undefined;
21
+ declare const handleDeleteButtonClick: (params: any) => Promise<void>;
22
+ export { getAgGridSRNo, customCellAggFunc, parseDate, findLastDisplayColumn, findFirstDisplayColumn, getGridRowData, removeExistingRowData, dynamicRowHeight, displayNumber, lessThanDate, setErrorMessage, validateChequeDate, handleDeleteButtonClick, };
@@ -0,0 +1,4 @@
1
+ import { ColDef } from "ag-grid-community";
2
+ import { CustomColumnMeta } from "../types";
3
+ declare function transformToAgGridColumn(metaData: (CustomColumnMeta | ColDef)[], i18n: any): ColDef[];
4
+ export default transformToAgGridColumn;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const AutoCompleteCellEditor: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
3
+ export default AutoCompleteCellEditor;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ declare const commonComponents: {
3
+ autocomplete: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<unknown>>;
4
+ CustomButtonCellEditor: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<unknown>>;
5
+ amountField: (props: any) => import("react/jsx-runtime").JSX.Element | null;
6
+ NumberFormat: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<unknown>>;
7
+ DatePickerCell: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<unknown>>;
8
+ DisplayCurrencyCell: (params: any) => any;
9
+ DisplayDateCell: (params: any) => any;
10
+ DisplaySelectCell: (params: any) => any;
11
+ DisplayCell: (params: any) => any;
12
+ };
13
+ export { commonComponents };
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const CustomButtonCellEditor: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
3
+ export default CustomButtonCellEditor;
@@ -0,0 +1,2 @@
1
+ declare const CustomCurrencyEditor: (props: any) => import("react/jsx-runtime").JSX.Element | null;
2
+ export default CustomCurrencyEditor;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const CustomDatePickerEditor: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
3
+ export default CustomDatePickerEditor;
@@ -0,0 +1,2 @@
1
+ declare const DisplayCell: (params: any) => any;
2
+ export default DisplayCell;
@@ -0,0 +1,2 @@
1
+ declare const DisplayCurrencyCell: (params: any) => any;
2
+ export default DisplayCurrencyCell;
@@ -0,0 +1,2 @@
1
+ declare const DisplayDateCell: (params: any) => any;
2
+ export default DisplayDateCell;
@@ -0,0 +1,2 @@
1
+ declare const DisplaySelectCell: (params: any) => any;
2
+ export default DisplaySelectCell;
@@ -0,0 +1,4 @@
1
+ declare const ErrorComponent: ({ fieldError }: {
2
+ fieldError: any;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export default ErrorComponent;
@@ -0,0 +1,4 @@
1
+ declare const HeaderButtonGroup: ({ buttons }: {
2
+ buttons: any[];
3
+ }) => import("react/jsx-runtime").JSX.Element | null;
4
+ export default HeaderButtonGroup;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const NumberFormat: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
3
+ export default NumberFormat;
@@ -1,3 +1,3 @@
1
1
  import { DetailsGridWithHeaderArguType } from "./type";
2
2
  export declare const useDialogStyles: (props?: any) => import("@mui/styles").ClassNameMap<"title" | "topScrollPaper" | "topPaperScrollBody">;
3
- export declare const DetailsGridWithHeader: ({ metadata, ClosedEventCall, data, HeaderMetaData, HeaderData, ClickEventManage, children, isLoading, isError, ErrorMessage, actions, setData, setCurrentAction, mode, isEditableForm, refID, onSubmit, submitSecondAction, submitSecondButtonName, submitSecondButtonHide, submitSecondLoading, onFieldAction, formComponentPropStyles, dialogProps }: DetailsGridWithHeaderArguType) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const DetailsGridWithHeader: ({ metadata, ClosedEventCall, data, HeaderMetaData, HeaderData, ClickEventManage, children, isLoading, isError, ErrorMessage, actions, setData, setCurrentAction, mode, isEditableForm, refID, onSubmit, submitSecondAction, submitSecondButtonName, submitSecondButtonHide, submitSecondLoading, onFieldAction, formComponentPropStyles, dialogProps, }: DetailsGridWithHeaderArguType) => import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -58,3 +58,5 @@ export * from "./components/customNotistack";
58
58
  export * from "./components/report/types";
59
59
  export * from "./components/context/propertiesConfig/customProperties";
60
60
  export { AuthContextProvider } from "./components/context/authContext/authContext";
61
+ export { AgGridTableWrapper } from "./components/agGridTable";
62
+ export { getAgGridSRNo, customCellAggFunc, parseDate, findLastDisplayColumn, findFirstDisplayColumn, getGridRowData, removeExistingRowData, dynamicRowHeight, displayNumber, lessThanDate, setErrorMessage, validateChequeDate, handleDeleteButtonClick, } from "./components/agGridTable/utils/helper";