@acuteinfo/common-base 1.2.36 → 1.2.38-beta.0

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,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, }: UseFieldHookProps) => {
2
+ export declare const useField: ({ fieldKey, name, dependentFields, validate, validationRun, shouldExclude, isReadOnly, postValidationSetCrossFieldValues, runPostValidationHookAlways, runValidationOnDependentFieldsChange, skipValueUpdateFromCrossFieldWhenReadOnly, runExternalFunction, onFormDataChange, txtTransform, AlwaysRunPostValidationSetCrossFieldValues, componentType, runPostValidationForInitValue, dependentFieldDebounceDelay, }: 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
  };
40
41
  export declare const transformDependentFieldsState: (dependentValues: DependentValuesType) => {};
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import { UseFieldArrayHookProps, RenderFn } from "./types";
3
+ export declare const useFieldArray: ({ arrayFieldName, template, shouldExclude, dependentFields, getFixedRowsCount, }: UseFieldArrayHookProps) => {
4
+ fieldRows: import("./types").FormArrayFieldRowsAtomType;
5
+ templateFieldNames: string[];
6
+ clearFieldArray: () => void;
7
+ getAllRowsValues: () => any;
8
+ unshift: () => void;
9
+ push: () => void;
10
+ insert: (index: number) => void;
11
+ pop: () => void;
12
+ remove: (index: number) => void;
13
+ renderRows: (renderFn: RenderFn) => JSX.Element[];
14
+ excluded: boolean;
15
+ isSubmitting: boolean;
16
+ formState: any;
17
+ formName: string;
18
+ isPending: boolean;
19
+ };
@@ -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,8 @@ export interface FormContextType {
21
22
  validationSchema?: AnyObjectSchema;
22
23
  formState: any;
23
24
  defaultArrayFieldValues?: InitialValuesType;
25
+ lastValidationValue?: any;
26
+ flagRef?: any;
24
27
  }
25
28
  export type FormFieldRegistryAtomType = string[];
26
29
  export interface FormFieldRegisterSelectorAttributes {
@@ -56,6 +59,7 @@ export interface FormFieldAtomType {
56
59
  ignoreInSubmit?: boolean;
57
60
  componentType?: string;
58
61
  prevValue?: any;
62
+ dynamicCurrency?: string;
59
63
  filteredOptions?: Record<string, any>[];
60
64
  }
61
65
  export interface DependentValuesType {
@@ -97,6 +101,7 @@ export interface UseFieldHookProps {
97
101
  AlwaysRunPostValidationSetCrossFieldValues?: AlwaysRunPostValidationSetCrossFieldValuesType | ((dependentFields: any) => AlwaysRunPostValidationSetCrossFieldValuesType);
98
102
  componentType?: string;
99
103
  runPostValidationForInitValue?: boolean;
104
+ dependentFieldDebounceDelay?: number;
100
105
  }
101
106
  export interface UseFieldArrayHookProps {
102
107
  arrayFieldName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acuteinfo/common-base",
3
- "version": "1.2.36",
3
+ "version": "1.2.38-beta.0",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "react",
@@ -132,4 +132,4 @@
132
132
  "react": "^18.2.0",
133
133
  "react-dom": "^18.2.0"
134
134
  }
135
- }
135
+ }
@@ -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;