@acuteinfo/common-base 1.2.38-beta.1 → 1.2.38-beta.10
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/components/common/arrayField/arrayField-stepper.d.ts +1 -1
- package/dist/components/common/arrayField/arrayField2.d.ts +2 -0
- package/dist/components/common/autocomplete/autocomplete.d.ts +3 -0
- package/dist/components/common/datetime/datePicker.d.ts +2 -0
- package/dist/components/common/datetime/datetimePicker.d.ts +2 -0
- package/dist/components/common/datetime/timePicker.d.ts +1 -0
- package/dist/components/common/divider/divider.d.ts +1 -0
- package/dist/components/common/formbutton/formbutton.d.ts +1 -0
- package/dist/components/common/hidden/hidden.d.ts +1 -0
- package/dist/components/common/printButton/printButton.d.ts +8 -1
- package/dist/components/common/select/select.d.ts +2 -0
- package/dist/components/common/textField/textField.d.ts +3 -1
- package/dist/components/common/types.d.ts +2 -0
- package/dist/components/common/typograhpy/typography.d.ts +1 -0
- package/dist/components/common/utils/optionsFetcher.d.ts +2 -0
- package/dist/components/context/propertiesConfig/customProperties.d.ts +5 -0
- package/dist/components/custom/Remarks.d.ts +19 -17
- package/dist/components/dataTable/atoms/index.d.ts +1 -11
- package/dist/components/dataTable/components/useCheckbox.d.ts +1 -1
- package/dist/components/dataTable/gridWrapper.d.ts +5 -0
- package/dist/components/dataTable/headerCellWrapper.d.ts +5 -0
- package/dist/components/dataTable/styledComponents/slider.d.ts +1 -1
- package/dist/components/dataTable/types.d.ts +6 -0
- package/dist/components/dataTable/utils/attachAlignmentProps.d.ts +2 -0
- package/dist/components/dataTable/utils/attachCellComponentsToMetaData.d.ts +1 -0
- package/dist/components/dataTable/utils/sortColumnBySequence.d.ts +1 -0
- package/dist/components/dataTableStatic/types.d.ts +18 -0
- package/dist/components/dataTableStatic/utils/attachCombineValidationFns.d.ts +4 -0
- package/dist/components/dataTableStatic/utils/attachYupSchema.d.ts +4 -0
- package/dist/components/dynamicForm/simpleForm.d.ts +6 -3
- package/dist/components/dynamicForm/types.d.ts +8 -1
- package/dist/components/dynamicForm/typesFields.d.ts +2 -1
- package/dist/components/dynamicForm/utils/constructINITValues.d.ts +1 -1
- package/dist/components/dynamicForm/utils/extendedFieldTypes.d.ts +1 -1
- package/dist/components/dynamicForm/utils/groupWiserenderer.d.ts +2 -2
- package/dist/components/formcomponent/masterDetails/masterDetailsForm.d.ts +4 -0
- package/dist/components/report/components/dateCell.d.ts +1 -1
- package/dist/components/report/components/footerCell.d.ts +3 -1
- package/dist/components/report/filterComponent/filterComponent.d.ts +2 -1
- package/dist/components/report/gridTable.d.ts +14 -1
- package/dist/components/report/serverReport/ReportWrapper.d.ts +8 -0
- package/dist/components/report/serverReport/serverGridTable.d.ts +13 -0
- package/dist/components/report/types.d.ts +18 -1
- package/dist/components/styledComponent/button/button.d.ts +7 -0
- package/dist/components/utils/utilFunctions/function.d.ts +16 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/packages/form/src/atoms.d.ts +49 -16
- package/dist/packages/form/src/field.d.ts +5 -3
- package/dist/packages/form/src/fieldArrayStepper.d.ts +0 -1
- package/dist/packages/form/src/form.d.ts +3 -1
- package/dist/packages/form/src/observer.d.ts +1 -1
- package/dist/packages/form/src/types.d.ts +5 -0
- package/dist/pages_audit/common/serverGrid/serverGrid.d.ts +5 -0
- package/package.json +5 -4
- package/rollup.config.mjs +3 -2
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { RESET } from "jotai/utils";
|
|
1
2
|
import { FormAtomType, FormFieldAtomType, FormArrayFieldRowsAtomType, FormFieldRegisterSelectorAttributes, FormFieldRegistryAtomType, DependentValuesType, SubscritionFieldsType } from "./types";
|
|
3
|
+
type FieldWithResetType = string | typeof RESET;
|
|
2
4
|
export declare const atomKeys: {
|
|
3
5
|
formAtom: string;
|
|
4
6
|
formFieldAtom: string;
|
|
@@ -18,19 +20,50 @@ export declare const atomKeys: {
|
|
|
18
20
|
formFieldsErrorWatcherAddSelector: string;
|
|
19
21
|
formFieldsErrorWatcherRemoveSelector: string;
|
|
20
22
|
};
|
|
21
|
-
export declare const formAtom: (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export declare const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export declare const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export declare const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export declare const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export declare const
|
|
23
|
+
export declare const formAtom: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<FormAtomType, [FormAtomType | typeof RESET | ((prev: FormAtomType) => FormAtomType | typeof RESET)], void> & {
|
|
24
|
+
init: FormAtomType;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const formFieldAtom: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<FormFieldAtomType, [FormFieldAtomType | typeof RESET | ((prev: FormFieldAtomType) => FormFieldAtomType | typeof RESET)], void> & {
|
|
27
|
+
init: FormFieldAtomType;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const formFieldsErrorWatcherAtom: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<string[], [string[] | typeof RESET | ((prev: string[]) => string[] | typeof RESET)], void> & {
|
|
30
|
+
init: string[];
|
|
31
|
+
}>;
|
|
32
|
+
export declare const formFieldsErrorWatcherAddSelector: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<null, [FieldWithResetType], void> & {
|
|
33
|
+
init: null;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const formFieldsErrorWatcherRemoveSelector: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<null, [FieldWithResetType], void> & {
|
|
36
|
+
init: null;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const formFieldsExcludedAtom: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<string[], [string[] | typeof RESET | ((prev: string[]) => string[] | typeof RESET)], void> & {
|
|
39
|
+
init: string[];
|
|
40
|
+
}>;
|
|
41
|
+
export declare const formFieldExcludeAddSelector: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<null, [FieldWithResetType], void> & {
|
|
42
|
+
init: null;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const formFieldExcludeRemoveSelector: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<null, [FieldWithResetType], void> & {
|
|
45
|
+
init: null;
|
|
46
|
+
}>;
|
|
47
|
+
export declare const formFieldRegistryAtom: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<FormFieldRegistryAtomType, [typeof RESET | FormFieldRegistryAtomType | ((prev: FormFieldRegistryAtomType) => typeof RESET | FormFieldRegistryAtomType)], void> & {
|
|
48
|
+
init: FormFieldRegistryAtomType;
|
|
49
|
+
}>;
|
|
50
|
+
export declare const formFieldRegisterSelector: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<null, [FormFieldRegisterSelectorAttributes | typeof RESET], void> & {
|
|
51
|
+
init: null;
|
|
52
|
+
}>;
|
|
53
|
+
export declare const formFieldUnregisterSelector: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<null, [FieldWithResetType], void> & {
|
|
54
|
+
init: null;
|
|
55
|
+
}>;
|
|
56
|
+
export declare const formArrayFieldRowsAtom: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<FormArrayFieldRowsAtomType, [FormArrayFieldRowsAtomType | typeof RESET | ((prev: FormArrayFieldRowsAtomType) => FormArrayFieldRowsAtomType | typeof RESET)], void> & {
|
|
57
|
+
init: FormArrayFieldRowsAtomType;
|
|
58
|
+
}>;
|
|
59
|
+
export declare const formArrayFieldRegistryAtom: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<string[], [string[] | typeof RESET | ((prev: string[]) => string[] | typeof RESET)], void> & {
|
|
60
|
+
init: string[];
|
|
61
|
+
}>;
|
|
62
|
+
export declare const formArrayFieldRegisterSelector: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<null, [FieldWithResetType], void> & {
|
|
63
|
+
init: null;
|
|
64
|
+
}>;
|
|
65
|
+
export declare const formArrayFieldUnregisterSelector: import("jotai-family").AtomFamily<string, import("jotai/vanilla").WritableAtom<null, [FieldWithResetType], void> & {
|
|
66
|
+
init: null;
|
|
67
|
+
}>;
|
|
68
|
+
export declare const subscribeToFormFieldsSelector: import("jotai-family").AtomFamily<SubscritionFieldsType, import("jotai/vanilla").Atom<DependentValuesType>>;
|
|
69
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { UseFieldHookProps, InitialValuesType, ValidateFnType, DependentValuesType } from "./types";
|
|
2
|
-
export declare const useField: ({ fieldKey, name, dependentFields, validate, validationRun, shouldExclude, isReadOnly, postValidationSetCrossFieldValues, runPostValidationHookAlways, runValidationOnDependentFieldsChange, skipValueUpdateFromCrossFieldWhenReadOnly, runExternalFunction, onFormDataChange, txtTransform, AlwaysRunPostValidationSetCrossFieldValues, componentType, runPostValidationForInitValue, dependentFieldDebounceDelay, }: UseFieldHookProps) => {
|
|
2
|
+
export declare const useField: ({ fieldKey, name, dependentFields, validate, validationRun, shouldExclude, isReadOnly, postValidationSetCrossFieldValues, runPostValidationHookAlways, runValidationOnDependentFieldsChange, skipValueUpdateFromCrossFieldWhenReadOnly, runExternalFunction, onFormDataChange, txtTransform, AlwaysRunPostValidationSetCrossFieldValues, componentType, runPostValidationForInitValue, dependentFieldDebounceDelay, isCurrencyField, showTooltip, }: UseFieldHookProps) => {
|
|
3
3
|
formState: any;
|
|
4
4
|
whenToRunValidation: ("onChange" | "onBlur" | "all") | undefined;
|
|
5
5
|
isSubmitting: boolean;
|
|
6
|
-
handleChange: (eventOrTextValue: React.ChangeEvent<any> | Date | string | number | boolean | any[], displayValue?: Date | string | number | boolean | any[], isTransformedValue?: boolean, toMerge?: {}) => void;
|
|
6
|
+
handleChange: (eventOrTextValue: React.ChangeEvent<any> | Date | string | number | boolean | any[], displayValue?: Date | string | number | boolean | any[], isTransformedValue?: boolean, toMerge?: {}, ignoreUpdate?: boolean) => void;
|
|
7
7
|
handleBlur: (_?: {}, toMerge?: {}) => Promise<void>;
|
|
8
8
|
setTouched: () => void;
|
|
9
|
-
setValue: (val: any, displayValue: any, alwaysRun?: boolean) => void;
|
|
9
|
+
setValue: (val: any, displayValue: any, alwaysRun?: boolean, mergeObj?: Record<string, string>) => void;
|
|
10
10
|
setValueAsCB: (val: any) => void;
|
|
11
11
|
setErrorAsCB: (val: any) => void;
|
|
12
12
|
setIncomingMessage: (value: any) => void;
|
|
@@ -37,5 +37,7 @@ export declare const useField: ({ fieldKey, name, dependentFields, validate, val
|
|
|
37
37
|
prevValue?: any;
|
|
38
38
|
dynamicCurrency?: string | undefined;
|
|
39
39
|
filteredOptions?: Record<string, any>[] | undefined;
|
|
40
|
+
tooltip?: any;
|
|
40
41
|
};
|
|
41
42
|
export declare const transformDependentFieldsState: (dependentValues: DependentValuesType) => {};
|
|
43
|
+
export declare const extractDependentFields: (input: any) => any[];
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { UseFormHookProps } from "./types";
|
|
2
|
+
import { FieldsErrorObjType, UseFormHookProps } from "./types";
|
|
3
3
|
export declare const useForm: ({ onSubmit, readOnly }: UseFormHookProps) => {
|
|
4
4
|
submitAttempt: number;
|
|
5
5
|
isSubmitting: boolean;
|
|
6
6
|
submitSuccessful: boolean;
|
|
7
7
|
serverSentError: string;
|
|
8
8
|
serverSentErrorDetail: string;
|
|
9
|
+
validationRunning?: boolean | undefined;
|
|
9
10
|
handleSubmit: (e: import("react").FormEvent<any>, actionFlag?: String | undefined, isValidate?: boolean | undefined, optionalData?: any) => Promise<any>;
|
|
10
11
|
handleSubmitPartial: (fields: string[]) => Promise<boolean>;
|
|
11
12
|
handleReset: (e: React.FormEvent<any>) => void;
|
|
@@ -13,4 +14,5 @@ export declare const useForm: ({ onSubmit, readOnly }: UseFormHookProps) => {
|
|
|
13
14
|
handleClear: (e: any) => void;
|
|
14
15
|
handleClearPartial: (fields: string[]) => void;
|
|
15
16
|
getFieldData: () => Promise<{}>;
|
|
17
|
+
setFieldData: (fieldsValueObj?: FieldsErrorObjType | undefined) => void;
|
|
16
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -40,6 +40,7 @@ export interface FormAtomType {
|
|
|
40
40
|
submitSuccessful: boolean;
|
|
41
41
|
serverSentError: string;
|
|
42
42
|
serverSentErrorDetail: string;
|
|
43
|
+
validationRunning?: boolean;
|
|
43
44
|
}
|
|
44
45
|
export interface FormFieldAtomType {
|
|
45
46
|
fieldKey: string;
|
|
@@ -62,6 +63,7 @@ export interface FormFieldAtomType {
|
|
|
62
63
|
prevValue?: any;
|
|
63
64
|
dynamicCurrency?: string;
|
|
64
65
|
filteredOptions?: Record<string, any>[];
|
|
66
|
+
tooltip?: any;
|
|
65
67
|
}
|
|
66
68
|
export interface DependentValuesType {
|
|
67
69
|
[key: string]: FormFieldAtomType;
|
|
@@ -103,6 +105,8 @@ export interface UseFieldHookProps {
|
|
|
103
105
|
componentType?: string;
|
|
104
106
|
runPostValidationForInitValue?: boolean;
|
|
105
107
|
dependentFieldDebounceDelay?: number;
|
|
108
|
+
isCurrencyField?: boolean;
|
|
109
|
+
showTooltip?: typeof showTooltipFnType;
|
|
106
110
|
}
|
|
107
111
|
export interface UseFieldArrayHookProps {
|
|
108
112
|
arrayFieldName: string;
|
|
@@ -116,6 +120,7 @@ export interface SubscritionFieldsType {
|
|
|
116
120
|
}
|
|
117
121
|
export declare function getFixedRowsCountFnType(fieldData: FormArrayFieldRowsAtomType, dependentFieldsValues: DependentValuesType, formState: any): number;
|
|
118
122
|
export declare function shouldExcludeFnType(fieldData: FormFieldAtomType, dependentFieldsValues: DependentValuesType, formState: any): Promise<boolean> | boolean;
|
|
123
|
+
export declare function showTooltipFnType(fieldData: FormFieldAtomType, dependentFieldsValues: DependentValuesType, formState: any): Promise<any> | any;
|
|
119
124
|
export declare function SchemaValidateFnType(fieldData: FormFieldAtomType, formState: any): Promise<any> | any;
|
|
120
125
|
export declare function ValidateFnType(fieldData: FormFieldAtomType, dependentFieldsValues: DependentValuesType, formState: any): Promise<any> | any;
|
|
121
126
|
export declare function PostValidationSetCrossFieldValuesFnType(fieldData: FormFieldAtomType, formState: any, authState: any, dependentFieldsState: any): Promise<InitialValuesType | undefined | null> | InitialValuesType | undefined | null;
|
|
@@ -19,6 +19,11 @@ interface ServerGridType {
|
|
|
19
19
|
headerToolbarStyle?: SxProps;
|
|
20
20
|
enableEnterToFocus?: boolean;
|
|
21
21
|
focusScopeId?: string;
|
|
22
|
+
onClickActionEvent?: any;
|
|
23
|
+
handleClickAction?: (event: any, data: any) => void;
|
|
24
|
+
onDataChange?: (data: any[]) => void;
|
|
25
|
+
defaultSelectedRowId?: string | ((gridData: any) => string | null);
|
|
26
|
+
disableMultipleRowSelect?: boolean;
|
|
22
27
|
}
|
|
23
28
|
export declare const ServerGrid: import("react").ForwardRefExoticComponent<ServerGridType & import("react").RefAttributes<any>>;
|
|
24
29
|
export declare const ServerGridWrapper: import("react").ForwardRefExoticComponent<ServerGridType & import("react").RefAttributes<any>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acuteinfo/common-base",
|
|
3
|
-
"version": "1.2.38-beta.
|
|
3
|
+
"version": "1.2.38-beta.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -31,8 +31,9 @@
|
|
|
31
31
|
"date-fns": "^2.30.0",
|
|
32
32
|
"dayjs": "^1.11.9",
|
|
33
33
|
"history": "^5.0.0",
|
|
34
|
-
"husky": "^4.3.0",
|
|
35
34
|
"i18next": "^23.12.2",
|
|
35
|
+
"jotai": "^2.17.1",
|
|
36
|
+
"jotai-family": "^1.0.1",
|
|
36
37
|
"js2xmlparser": "^5.0.0",
|
|
37
38
|
"json-rules-engine": "^5.0.4",
|
|
38
39
|
"jspdf": "^2.5.1",
|
|
@@ -57,7 +58,6 @@
|
|
|
57
58
|
"react-to-print": "^2.14.7",
|
|
58
59
|
"react-virtuoso": "^4.13.0",
|
|
59
60
|
"react-window": "^1.8.6",
|
|
60
|
-
"recoil": "^0.7.7",
|
|
61
61
|
"regenerator-runtime": "^0.14.1",
|
|
62
62
|
"typeface-roboto": "^0.0.75",
|
|
63
63
|
"typescript": "^4.2.2",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"@types/react": "^18.2.74",
|
|
117
117
|
"@types/react-i18next": "^8.1.0",
|
|
118
118
|
"@types/yup": "^0.29.6",
|
|
119
|
+
"husky": "^4.3.8",
|
|
119
120
|
"postcss": "^8.4.38",
|
|
120
121
|
"postcss-nested": "^6.0.1",
|
|
121
122
|
"postcss-simple-vars": "^7.0.1",
|
|
@@ -132,4 +133,4 @@
|
|
|
132
133
|
"react": "^18.2.0",
|
|
133
134
|
"react-dom": "^18.2.0"
|
|
134
135
|
}
|
|
135
|
-
}
|
|
136
|
+
}
|
package/rollup.config.mjs
CHANGED