@acuteinfo/common-base 1.2.83 → 1.2.84
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/textField/textField.d.ts +3 -3
- package/dist/components/custom-hooks/useDebouncedValue.d.ts +9 -0
- package/dist/components/dataTable/styledComponents/slider.d.ts +1 -1
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/packages/form/index.d.ts +0 -1
- package/dist/packages/form/src/atoms.d.ts +49 -16
- package/dist/packages/form/src/field.d.ts +2 -1
- package/dist/packages/form/src/types.d.ts +6 -0
- package/package.json +3 -2
- package/rollup.config.mjs +3 -3
- package/dist/components/dataTable/atoms/index.d.ts +0 -11
- package/dist/components/layoutReport/hooks/useDebouncedValue.d.ts +0 -12
- package/dist/packages/form/src/observer.d.ts +0 -1
|
@@ -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,5 +1,5 @@
|
|
|
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, isCurrencyField, showTooltip, }: 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;
|
|
@@ -35,6 +35,7 @@ export declare const useField: ({ fieldKey, name, dependentFields, validate, val
|
|
|
35
35
|
ignoreInSubmit?: boolean | undefined;
|
|
36
36
|
componentType?: string | undefined;
|
|
37
37
|
prevValue?: any;
|
|
38
|
+
dynamicCurrency?: string | undefined;
|
|
38
39
|
filteredOptions?: Record<string, any>[] | undefined;
|
|
39
40
|
tooltip?: any;
|
|
40
41
|
};
|
|
@@ -3,6 +3,7 @@ import { AnyObjectSchema } from "yup";
|
|
|
3
3
|
export interface TemplateFieldRowType {
|
|
4
4
|
fieldIndexKey: string;
|
|
5
5
|
cells: TemplateFieldCellsObjectType;
|
|
6
|
+
isDeleted?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export interface TemplateFieldCellsObjectType {
|
|
8
9
|
[key: string]: TemplateFieldCellType;
|
|
@@ -21,6 +22,9 @@ export interface FormContextType {
|
|
|
21
22
|
validationSchema?: AnyObjectSchema;
|
|
22
23
|
formState: any;
|
|
23
24
|
defaultArrayFieldValues?: InitialValuesType;
|
|
25
|
+
lastValidationValue?: any;
|
|
26
|
+
flagRef?: any;
|
|
27
|
+
setCurrentStepIndexFnRef?: Function | null;
|
|
24
28
|
}
|
|
25
29
|
export type FormFieldRegistryAtomType = string[];
|
|
26
30
|
export interface FormFieldRegisterSelectorAttributes {
|
|
@@ -57,6 +61,7 @@ export interface FormFieldAtomType {
|
|
|
57
61
|
ignoreInSubmit?: boolean;
|
|
58
62
|
componentType?: string;
|
|
59
63
|
prevValue?: any;
|
|
64
|
+
dynamicCurrency?: string;
|
|
60
65
|
filteredOptions?: Record<string, any>[];
|
|
61
66
|
tooltip?: any;
|
|
62
67
|
}
|
|
@@ -99,6 +104,7 @@ export interface UseFieldHookProps {
|
|
|
99
104
|
AlwaysRunPostValidationSetCrossFieldValues?: AlwaysRunPostValidationSetCrossFieldValuesType | ((dependentFields: any) => AlwaysRunPostValidationSetCrossFieldValuesType);
|
|
100
105
|
componentType?: string;
|
|
101
106
|
runPostValidationForInitValue?: boolean;
|
|
107
|
+
dependentFieldDebounceDelay?: number;
|
|
102
108
|
isCurrencyField?: boolean;
|
|
103
109
|
showTooltip?: typeof showTooltipFnType;
|
|
104
110
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acuteinfo/common-base",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.84",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
"dayjs": "^1.11.9",
|
|
33
33
|
"history": "^5.0.0",
|
|
34
34
|
"i18next": "^23.12.2",
|
|
35
|
+
"jotai": "^2.17.1",
|
|
36
|
+
"jotai-family": "^1.0.1",
|
|
35
37
|
"js2xmlparser": "^5.0.0",
|
|
36
38
|
"json-rules-engine": "^5.0.4",
|
|
37
39
|
"jspdf": "^2.5.1",
|
|
@@ -56,7 +58,6 @@
|
|
|
56
58
|
"react-to-print": "^2.14.7",
|
|
57
59
|
"react-virtuoso": "^4.13.0",
|
|
58
60
|
"react-window": "^1.8.6",
|
|
59
|
-
"recoil": "^0.7.7",
|
|
60
61
|
"regenerator-runtime": "^0.14.1",
|
|
61
62
|
"typeface-roboto": "^0.0.75",
|
|
62
63
|
"typescript": "^4.2.2",
|
package/rollup.config.mjs
CHANGED
|
@@ -37,7 +37,6 @@ export default defineConfig({
|
|
|
37
37
|
"json-rules-engine",
|
|
38
38
|
"pako",
|
|
39
39
|
"xlsx",
|
|
40
|
-
"recoil",
|
|
41
40
|
"react-query",
|
|
42
41
|
"react-number-format",
|
|
43
42
|
"react-imask",
|
|
@@ -52,8 +51,9 @@ export default defineConfig({
|
|
|
52
51
|
"match-sorter",
|
|
53
52
|
"axios",
|
|
54
53
|
"@koale/useworker",
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
/^ag-grid-community/,
|
|
55
|
+
/^ag-grid-react/,
|
|
56
|
+
/^jotai/,
|
|
57
57
|
],
|
|
58
58
|
plugins: [
|
|
59
59
|
resolve(),
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface QueryType {
|
|
2
|
-
accessor: string;
|
|
3
|
-
condition: string;
|
|
4
|
-
value: any[] | any;
|
|
5
|
-
}
|
|
6
|
-
export interface SubscriptionType {
|
|
7
|
-
[key: string]: string[] | string | undefined;
|
|
8
|
-
}
|
|
9
|
-
export declare const filterAtom: (param: string) => import("recoil").RecoilState<QueryType | null>;
|
|
10
|
-
export declare const filtersAtom: (param: string) => import("recoil").RecoilState<QueryType[] | null>;
|
|
11
|
-
export declare const subscribeToFilterChange: (param: SubscriptionType) => import("recoil").RecoilValueReadOnly<QueryType[]>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A custom hook that returns a debounced version of the input value.
|
|
3
|
-
* The debounced value updates after a specified delay, which is useful
|
|
4
|
-
* for scenarios like search inputs where you want to limit the number
|
|
5
|
-
* of updates or API calls while the user is typing.
|
|
6
|
-
*
|
|
7
|
-
* @param {string} value - The input value that you want to debounce.
|
|
8
|
-
* @param {number} [delay=500] - The amount of time (in milliseconds) to wait
|
|
9
|
-
* before updating the debounced value. Defaults to 500 milliseconds.
|
|
10
|
-
* @returns {string} The debounced value that updates after the specified delay.
|
|
11
|
-
*/
|
|
12
|
-
export declare const useDebouncedValue: (value: string, delay?: number) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const TimeTravelObserver: () => import("react/jsx-runtime").JSX.Element;
|