@acuteinfo/common-base 1.0.15 → 1.0.16

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.
@@ -1,6 +1,7 @@
1
1
  import { FC, PropsWithChildren } from "react";
2
2
  import { currencySymbol } from "../../custom/getCurrencySymbol";
3
- interface CustomProperties {
3
+ import { ExtendedFieldMetaDataTypeOptional } from "../../dynamicForm";
4
+ export interface CustomProperties {
4
5
  /**
5
6
  * display _accountNumber field as single field or separated
6
7
  * @default "separated"
@@ -48,6 +49,10 @@ interface CustomProperties {
48
49
  * @default "single"
49
50
  */
50
51
  denoTableType?: "single" | "dual";
52
+ /**
53
+ * Accepts Field MetaData object for additional form fields
54
+ */
55
+ customExtendedTypes?: ExtendedFieldMetaDataTypeOptional;
51
56
  }
52
57
  interface ContextProps {
53
58
  config?: CustomProperties;
@@ -1,5 +1,8 @@
1
- export declare const ColumnVisibility: ({ visibleColumns, defaultHiddenColumns, classes, }: {
1
+ export declare const ColumnVisibility: ({ visibleColumns, defaultHiddenColumns, classes, IconButtonStyle, }: {
2
2
  visibleColumns: any;
3
3
  defaultHiddenColumns: any;
4
4
  classes: any;
5
+ IconButtonStyle?: {
6
+ variant: null;
7
+ } | undefined;
5
8
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,13 @@
1
1
  import { CellComponentType } from "components/tableCellComponents";
2
2
  import { CSSProperties, ReactNode } from "react";
3
+ import * as Icons from "@mui/icons-material";
3
4
  export interface GridColumnType {
4
5
  columnName: string;
5
6
  accessor: string;
6
7
  sequence: number;
7
8
  componentType: CellComponentType;
8
9
  Cell?: any;
9
- alignment?: string;
10
+ alignment?: "left" | "right" | "center";
10
11
  TableCellProps?: any;
11
12
  disableSortBy?: boolean;
12
13
  width?: number;
@@ -73,7 +74,33 @@ export interface ActionTypes {
73
74
  alwaysAvailable?: boolean;
74
75
  shouldExclude?: any;
75
76
  isNodataThenShow?: boolean;
77
+ /**
78
+ * Action to be triggered on press Enter.
79
+ * @default false
80
+ */
76
81
  onEnterSubmit?: boolean;
82
+ /**
83
+ * Accepts Mui's Icon name to show icon at the start of the button
84
+ */
85
+ startsIcon?: keyof typeof Icons;
86
+ /**
87
+ * Accepts Mui's Icon name to show icon at the end of the button
88
+ */
89
+ endsIcon?: keyof typeof Icons;
90
+ /**
91
+ * Accepts css transform value
92
+ *
93
+ * E.g. rotate(45deg), scale(1.5)
94
+ */
95
+ rotateIcon?: string;
96
+ /**
97
+ * Sets button text color.
98
+ */
99
+ actionTextColor?: string;
100
+ /**
101
+ * Sets button background color.
102
+ */
103
+ actionBackground?: string;
77
104
  }
78
105
  export interface RenderActionType {
79
106
  actions: ActionTypes[];
@@ -1,5 +1,5 @@
1
1
  import { GridColumnType } from "../types";
2
- export declare const attachAlignmentProps: (columns: GridColumnType[]) => {
2
+ export declare const attachAlignmentProps: (columns: GridColumnType[]) => ({
3
3
  columnName: string;
4
4
  accessor: string;
5
5
  sequence: number;
@@ -14,4 +14,22 @@ export declare const attachAlignmentProps: (columns: GridColumnType[]) => {
14
14
  sortDescFirst?: boolean | undefined;
15
15
  dateFormat?: string | undefined;
16
16
  actions?: string | string[] | undefined;
17
- }[];
17
+ } | {
18
+ cellHeaderAlignment: string;
19
+ TableCellProps: {
20
+ align: string;
21
+ };
22
+ columnName: string;
23
+ accessor: string;
24
+ sequence: number;
25
+ componentType: import("../../tableCellComponents").CellComponentType;
26
+ Cell?: any;
27
+ disableSortBy?: boolean | undefined;
28
+ width?: number | undefined;
29
+ maxWidth?: number | undefined;
30
+ minWidth?: number | undefined;
31
+ isVisible?: boolean | undefined;
32
+ sortDescFirst?: boolean | undefined;
33
+ dateFormat?: string | undefined;
34
+ actions?: string | string[] | undefined;
35
+ })[];
@@ -4,7 +4,7 @@ export declare const attachCellComponentsToMetaData: (columns: GridColumnType[])
4
4
  columnName: string;
5
5
  accessor: string;
6
6
  sequence: number;
7
- alignment?: string | undefined;
7
+ alignment?: "left" | "right" | "center" | undefined;
8
8
  TableCellProps?: any;
9
9
  disableSortBy?: boolean | undefined;
10
10
  width?: number | undefined;
@@ -4,7 +4,7 @@ export declare const sortColumnsBySequence: (columns: GridColumnType[]) => {
4
4
  accessor: string;
5
5
  componentType: import("../../tableCellComponents").CellComponentType;
6
6
  Cell?: any;
7
- alignment?: string | undefined;
7
+ alignment?: "left" | "right" | "center" | undefined;
8
8
  TableCellProps?: any;
9
9
  disableSortBy?: boolean | undefined;
10
10
  width?: number | undefined;
@@ -1,4 +1,4 @@
1
- export declare const DataGrid: ({ label, dense, columns, data, loading, getRowId, defaultColumn, allowColumnReordering, disableSorting, defaultHiddenColumns, defaultSortOrder, defaultGroupBy, multipleActions, singleActions, doubleClickAction, alwaysAvailableAction, setGridAction, updateGridData, hideFooter, hideHeader, disableGlobalFilter, disableGroupBy, disableLoader, containerHeight, gridProps, pageSizes, defaultPageSize, enablePagination, allowRowSelection, hideNoDataFound, refetchData, hiddenFlag, autoRefreshInterval, allowFilter, filterMeta, allowColumnHiding, defaultFilter, isCusrsorFocused, onButtonActionHandel, authState, controlsAtBottom, actionContextAtBottom, headerToolbarStyle, disableMultipleRowSelect, columnHeaderStyle, variant, defaultSelectedRowId, footerNote, paginationText, searchPlaceholder, enableExport }: {
1
+ export declare const DataGrid: ({ label, dense, columns, data, loading, getRowId, defaultColumn, allowColumnReordering, disableSorting, defaultHiddenColumns, defaultSortOrder, defaultGroupBy, multipleActions, singleActions, doubleClickAction, alwaysAvailableAction, setGridAction, updateGridData, hideFooter, hideHeader, disableGlobalFilter, disableGroupBy, disableLoader, containerHeight, gridProps, pageSizes, defaultPageSize, enablePagination, allowRowSelection, hideNoDataFound, refetchData, hiddenFlag, autoRefreshInterval, allowFilter, filterMeta, allowColumnHiding, defaultFilter, isCusrsorFocused, onButtonActionHandel, authState, controlsAtBottom, actionContextAtBottom, headerToolbarStyle, disableMultipleRowSelect, columnHeaderStyle, variant, defaultSelectedRowId, footerNote, paginationText, searchPlaceholder, enableExport, }: {
2
2
  label: any;
3
3
  dense: any;
4
4
  columns: any;
@@ -8,7 +8,11 @@ export interface GridColumnType {
8
8
  sequence: number;
9
9
  componentType: CellComponentType;
10
10
  Cell?: any;
11
- alignment?: string;
11
+ /**
12
+ * Specify the alignment of grid column header and cell
13
+ * @default "left"
14
+ */
15
+ alignment?: "left" | "right" | "center";
12
16
  TableCellProps?: any;
13
17
  width?: number;
14
18
  maxWidth?: number;
@@ -56,6 +60,8 @@ export interface GridColumnType {
56
60
  setValueFUNC?: Function;
57
61
  isAutoFocus?: boolean;
58
62
  isVisibleInNew?: boolean;
63
+ currencyRefColumn?: string;
64
+ isCurrencyCode?: boolean;
59
65
  /**
60
66
  * Accepts boolean value to hide dropdown and cross icons from autocomplete
61
67
  * @default false
@@ -67,7 +73,7 @@ export interface GridColumnType {
67
73
  * @param original current grid row data
68
74
  * @returns string
69
75
  */
70
- setButtonName?: (value: string | undefined, original: any) => string;
76
+ setButtonName?: (value: string | undefined, original: any) => string | undefined;
71
77
  /**
72
78
  * Function to exclude component conditionally
73
79
  * @param value value of component if exists
@@ -7,7 +7,7 @@ export declare const attachcombinedValidationFns: (columns: GridColumnType[]) =>
7
7
  sequence: number;
8
8
  componentType: import("../../tableCellComponents").CellComponentType;
9
9
  Cell?: any;
10
- alignment?: string | undefined;
10
+ alignment?: "left" | "right" | "center" | undefined;
11
11
  TableCellProps?: any;
12
12
  width?: number | undefined;
13
13
  maxWidth?: number | undefined;
@@ -53,8 +53,10 @@ export declare const attachcombinedValidationFns: (columns: GridColumnType[]) =>
53
53
  setValueFUNC?: Function | undefined;
54
54
  isAutoFocus?: boolean | undefined;
55
55
  isVisibleInNew?: boolean | undefined;
56
+ currencyRefColumn?: string | undefined;
57
+ isCurrencyCode?: boolean | undefined;
56
58
  disableAdornment?: boolean | undefined;
57
- setButtonName?: ((value: string | undefined, original: any) => string) | undefined;
59
+ setButtonName?: ((value: string | undefined, original: any) => string | undefined) | undefined;
58
60
  shouldExclude?: ((value: string | undefined, original: any) => boolean) | undefined;
59
61
  currencySymbolPosition?: "end" | "start" | undefined;
60
62
  }[];
@@ -6,7 +6,7 @@ export declare const attachYupSchemaValidator: (columns: GridColumnType[]) => {
6
6
  sequence: number;
7
7
  componentType: import("../../tableCellComponents").CellComponentType;
8
8
  Cell?: any;
9
- alignment?: string | undefined;
9
+ alignment?: "left" | "right" | "center" | undefined;
10
10
  TableCellProps?: any;
11
11
  width?: number | undefined;
12
12
  maxWidth?: number | undefined;
@@ -53,8 +53,10 @@ export declare const attachYupSchemaValidator: (columns: GridColumnType[]) => {
53
53
  setValueFUNC?: Function | undefined;
54
54
  isAutoFocus?: boolean | undefined;
55
55
  isVisibleInNew?: boolean | undefined;
56
+ currencyRefColumn?: string | undefined;
57
+ isCurrencyCode?: boolean | undefined;
56
58
  disableAdornment?: boolean | undefined;
57
- setButtonName?: ((value: string | undefined, original: any) => string) | undefined;
59
+ setButtonName?: ((value: string | undefined, original: any) => string | undefined) | undefined;
58
60
  shouldExclude?: ((value: string | undefined, original: any) => boolean) | undefined;
59
61
  currencySymbolPosition?: "end" | "start" | undefined;
60
62
  }[];
@@ -1,3 +1,2 @@
1
1
  /// <reference types="react" />
2
- import { FormWrapperProps } from "./types";
3
- export declare const FormWrapper: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<FormWrapperProps>>;
2
+ export declare const FormWrapper: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<any>>;
@@ -1,7 +1,7 @@
1
1
  import { FC } from "react";
2
2
  import { FormProps } from "./types";
3
3
  export declare const SimpleForm: FC<FormProps>;
4
- export declare const SimpleFormWrapper: ({ fields, formRenderConfig, formName, formStyle, hidden, formDisplayLabel, displayMode, hideDisplayModeInTitle, wrapperChild, serverSentError, serverSentErrorDetail, isSubmitting, classes, handleSubmit, controlsAtBottom, hideHeader, containerstyle, }: {
4
+ export declare const SimpleFormWrapper: ({ fields, formRenderConfig, formName, formStyle, hidden, formDisplayLabel, displayMode, hideDisplayModeInTitle, wrapperChild, serverSentError, serverSentErrorDetail, isSubmitting, classes, handleSubmit, controlsAtBottom, hideHeader, containerstyle, subHeaderLabel, subHeaderLabelStyle }: {
5
5
  fields: any;
6
6
  formRenderConfig: any;
7
7
  formName: any;
@@ -19,6 +19,8 @@ export declare const SimpleFormWrapper: ({ fields, formRenderConfig, formName, f
19
19
  controlsAtBottom: any;
20
20
  hideHeader: any;
21
21
  containerstyle?: {} | undefined;
22
+ subHeaderLabel: any;
23
+ subHeaderLabelStyle: any;
22
24
  }) => import("react/jsx-runtime").JSX.Element;
23
25
  export declare const BottomControl: ({ wrapperChild, isSubmitting, handleSubmit, classes, }: {
24
26
  wrapperChild: any;
@@ -26,7 +28,7 @@ export declare const BottomControl: ({ wrapperChild, isSubmitting, handleSubmit,
26
28
  handleSubmit: any;
27
29
  classes: any;
28
30
  }) => import("react/jsx-runtime").JSX.Element;
29
- export declare const SimpleFormTitle: ({ formDisplayLabel, displayMode, hideDisplayModeInTitle, wrapperChild, serverSentError, serverSentErrorDetail, isSubmitting, classes, handleSubmit, controlsAtBottom, }: {
31
+ export declare const SimpleFormTitle: ({ formDisplayLabel, displayMode, hideDisplayModeInTitle, wrapperChild, serverSentError, serverSentErrorDetail, isSubmitting, classes, handleSubmit, controlsAtBottom, subHeaderLabel, subHeaderLabelStyle }: {
30
32
  formDisplayLabel: any;
31
33
  displayMode: any;
32
34
  hideDisplayModeInTitle: any;
@@ -37,4 +39,6 @@ export declare const SimpleFormTitle: ({ formDisplayLabel, displayMode, hideDisp
37
39
  classes: any;
38
40
  handleSubmit: any;
39
41
  controlsAtBottom: any;
42
+ subHeaderLabel: any;
43
+ subHeaderLabelStyle: any;
40
44
  }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare const ColorlibStepIconRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
3
+ ownerState: {
4
+ completed?: boolean;
5
+ active?: boolean;
6
+ };
7
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
8
+ export declare const ColorlibConnector: import("@emotion/styled").StyledComponent<import("@mui/material").StepConnectorProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,9 +1,9 @@
1
1
  import { GridSize, GridSpacing, GridDirection } from "@mui/material/Grid";
2
- import { AllTextFieldProps, AllSelectFieldProps, AllCheckboxGroupProps, AllCheckboxProps, AllDatePickerProps, AllDateTimePickerProps, AllTimePickerProps, AllRadioProps, AllRatingProps, AllSliderProps, AllSwitchGroupProps, AllSwitchProps, AllNumberFormatProps, AllPasswordFieldProps, AllSpacerProps, AllToggleButtonGroupProps, AllInputMaskProps, AllAutocompleteProps, ArrayFieldProps, AllTextareaAutosizeFieldProps, AllHiddenFieldProps, AllTypographyFieldProps, AllTransferListProps, AllSearchFieldProps, AllVisaversaFieldProps, AllDataTableProps, AllFormButtonProps, AllAccountNumberProps, AllLoginIDProps, DividerPropsOptional, AllDividerProps } from "./typesFields";
2
+ import { AllTextFieldProps, AllSelectFieldProps, AllCheckboxGroupProps, AllCheckboxProps, AllDatePickerProps, AllDateTimePickerProps, AllTimePickerProps, AllRadioProps, AllRatingProps, AllSliderProps, AllSwitchGroupProps, AllSwitchProps, AllNumberFormatProps, AllPasswordFieldProps, AllSpacerProps, AllToggleButtonGroupProps, AllInputMaskProps, AllAutocompleteProps, ArrayFieldProps, AllTextareaAutosizeFieldProps, AllHiddenFieldProps, AllTypographyFieldProps, AllTransferListProps, AllSearchFieldProps, AllVisaversaFieldProps, AllDataTableProps, AllFormButtonProps, AllAccountNumberProps, AllLoginIDProps, DividerPropsOptional, AllDividerProps, CustomAccountProps, CustomReportAccTypeProps } from "./typesFields";
3
3
  import { TextFieldPropsOptional, SelectPropsOptional, CheckboxGroupPropsOptional, CheckboxPropsOptional, DatePickerPropsOptional, DateTimePickerPropsOptional, TimePickerPropsOptional, RadioPropsOptional, RatingPropsOptional, SliderPropsOptional, SwitchPropsOptional, SwitchGroupPropsOptional, NumberFormatPropsOptional, PasswordFieldPropsOptional, ToggleButtonGroupPropsOptional, InputMaskPropsOptional, AutocompletePropsOptional, TextareaAutosizeFieldPropsOptional, SearchFieldPropsOptional, VisaversaFieldPropsOptional, DataTablePropsOptional } from "./typesFields";
4
4
  import { Merge } from "../../components/common/types";
5
5
  import { InitialValuesType, SubmitFnType } from "../../packages/form";
6
- import { ReactNode } from "react";
6
+ import { CSSProperties, ReactNode } from "react";
7
7
  export interface FormRenderConfigType {
8
8
  ordering: "auto" | "sequence";
9
9
  renderType: "simple" | "tabs" | "stepper" | "accordian";
@@ -47,6 +47,7 @@ export interface FormMetaDataType {
47
47
  name: string;
48
48
  label: string;
49
49
  };
50
+ formStyle?: CSSProperties;
50
51
  }
51
52
  export interface ComponentTypeProps {
52
53
  textField?: TextFieldPropsOptional;
@@ -76,7 +77,7 @@ export interface MetaDataType {
76
77
  form: FormMetaDataType;
77
78
  fields: FieldMetaDataType[];
78
79
  }
79
- export type FieldMetaDataTypeX = AllTextFieldProps | AllDividerProps | AllSelectFieldProps | AllCheckboxGroupProps | AllCheckboxProps | AllDatePickerProps | AllDateTimePickerProps | AllTimePickerProps | AllRadioProps | AllRatingProps | AllSliderProps | AllSwitchGroupProps | AllSwitchProps | AllNumberFormatProps | AllPasswordFieldProps | AllToggleButtonGroupProps | AllSpacerProps | AllInputMaskProps | AllAutocompleteProps | AllTextareaAutosizeFieldProps | AllTypographyFieldProps | AllHiddenFieldProps | AllTransferListProps | AllSearchFieldProps | AllVisaversaFieldProps | ArrayFieldProps | AllDataTableProps | AllFormButtonProps | AllAccountNumberProps | AllLoginIDProps;
80
+ export type FieldMetaDataTypeX = AllTextFieldProps | AllDividerProps | AllSelectFieldProps | AllCheckboxGroupProps | AllCheckboxProps | AllDatePickerProps | AllDateTimePickerProps | AllTimePickerProps | AllRadioProps | AllRatingProps | AllSliderProps | AllSwitchGroupProps | AllSwitchProps | AllNumberFormatProps | AllPasswordFieldProps | AllToggleButtonGroupProps | AllSpacerProps | AllInputMaskProps | AllAutocompleteProps | AllTextareaAutosizeFieldProps | AllTypographyFieldProps | AllHiddenFieldProps | AllTransferListProps | AllSearchFieldProps | AllVisaversaFieldProps | ArrayFieldProps | AllDataTableProps | AllFormButtonProps | AllAccountNumberProps | AllLoginIDProps | CustomAccountProps | CustomReportAccTypeProps;
80
81
  export type FieldMetaDataType = Merge<FieldMetaDataTypeX, {
81
82
  template?: FieldMetaDataType[];
82
83
  }>;
@@ -121,6 +122,9 @@ export interface FormWrapperProps {
121
122
  formState?: any;
122
123
  hideHeader?: boolean;
123
124
  onFormDataChange?: any;
125
+ subHeaderLabel?: string;
126
+ subHeaderLabelStyle?: CSSProperties;
127
+ setDataOnFieldChange?: (action: string, payload: any) => void;
124
128
  }
125
129
  export interface FormProps {
126
130
  fields: GroupWiseRenderedFieldsType;
@@ -26,6 +26,7 @@ import { VisaversaProps } from "../../components/common/visaversa";
26
26
  import { DataTableProps } from "../../components/common/dataTable";
27
27
  import { FormButtonProps } from "../../components/common/formbutton";
28
28
  import { DividerProps } from "../../components/common/divider";
29
+ import { currencySymbol } from "components/custom/getCurrencySymbol";
29
30
  export interface FieldRenderProps<T> {
30
31
  componentType: T;
31
32
  group?: number;
@@ -39,6 +40,11 @@ export interface FieldMetaData<T> {
39
40
  shouldExclude?: typeof shouldExcludeFnType | CustomRuleType | Boolean | string;
40
41
  isReadOnly?: typeof shouldExcludeFnType | CustomRuleType | Boolean | string;
41
42
  onFormButtonClickHandel?: any;
43
+ FormatProps?: any;
44
+ StartAdornment?: keyof typeof currencySymbol | (string & Record<never, never>);
45
+ isCurrencyCode?: boolean;
46
+ isCurrencyField?: boolean;
47
+ postValidationSetCrossFieldValues?: any;
42
48
  }
43
49
  export type Omitted<T> = Omit<T, "fieldKey" | "enableGrid">;
44
50
  export type AllAutocompleteProps = Merge<Omitted<AutocompleteProps>, FieldMetaData<"autocomplete">>;
@@ -93,3 +99,5 @@ export type AllLoginIDProps = Merge<Omitted<TextFieldProps>, FieldMetaData<"logi
93
99
  export type DataTablePropsOptional = Optional<AllDataTableProps>;
94
100
  export type AllDividerProps = Merge<Omitted<DividerProps>, FieldMetaData<"divider">>;
95
101
  export type DividerPropsOptional = Optional<AllDividerProps>;
102
+ export type CustomAccountProps = Merge<Omitted<TextFieldProps>, FieldMetaData<"_accountNumber">>;
103
+ export type CustomReportAccTypeProps = Merge<Omitted<SelectProps>, FieldMetaData<"reportAccType">>;
@@ -1,2 +1,3 @@
1
+ import { CustomProperties } from "components/context/propertiesConfig/customProperties";
1
2
  import { MetaDataType, ExtendedFieldMetaDataTypeOptional } from "../types";
2
- export declare const extendFieldTypes: (metaData: MetaDataType, extendedTypes: ExtendedFieldMetaDataTypeOptional, lanTranslate?: any, authState?: any) => MetaDataType;
3
+ export declare const extendFieldTypes: (metaData: MetaDataType, extendedTypes: ExtendedFieldMetaDataTypeOptional, lanTranslate?: any, authState?: any, customParameters?: CustomProperties) => MetaDataType;
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from "./components/utils";
8
8
  export { useAutoRefresh, AutoRefreshProvider, } from "./components/utils/autoRefresh";
9
9
  export * from "./components/dynamicForm/formWrapper";
10
10
  export * from "./components/dynamicForm/types";
11
+ export * from "./components/dynamicForm/stepperForm/style";
11
12
  export * from "./packages/form";
12
13
  export type { ActionTypes, FilterColumnType, HeaderFilterType, RenderActionType, TableActionType, GridColumnType as DataTableGridColumnType, GridConfigType as DataTableGridConfigType, GridContextType as DataTableGridContextType, GridMetaDataType as DataTableGridMetaDataType, } from "./components/dataTable/types";
13
14
  export { GridWrapper as DataTableGridWrapper } from "./components/dataTable/gridWrapper";