@fuf-stack/uniform 1.30.0 → 2.0.0-next.3
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/README.md +0 -6
- package/dist/Checkboxes/index.d.mts +178 -274
- package/dist/Checkboxes/index.d.mts.map +1 -1
- package/dist/Checkboxes/index.mjs +294 -94
- package/dist/Checkboxes/index.mjs.map +1 -1
- package/dist/DatePicker/index.d.mts +1963 -148
- package/dist/DatePicker/index.d.mts.map +1 -1
- package/dist/DatePicker/index.mjs +401 -82
- package/dist/DatePicker/index.mjs.map +1 -1
- package/dist/FieldArray/index.d.mts +102 -97
- package/dist/FieldArray/index.d.mts.map +1 -1
- package/dist/FieldArray/index.mjs +340 -195
- package/dist/FieldArray/index.mjs.map +1 -1
- package/dist/FieldCard/index.d.mts +34 -34
- package/dist/FieldCard/index.d.mts.map +1 -1
- package/dist/FieldCard/index.mjs +181 -127
- package/dist/FieldCard/index.mjs.map +1 -1
- package/dist/{FieldCopyTestIdButton-Y9SfvaM9.mjs → FieldCopyTestIdButton-D3_jZYJ1.mjs} +4 -2
- package/dist/FieldCopyTestIdButton-D3_jZYJ1.mjs.map +1 -0
- package/dist/FieldDescription-X_0s1Lhu.mjs +35 -0
- package/dist/FieldDescription-X_0s1Lhu.mjs.map +1 -0
- package/dist/FieldLabel-DrNWJIVh.mjs +128 -0
- package/dist/FieldLabel-DrNWJIVh.mjs.map +1 -0
- package/dist/FieldLayout-DcvQU0zN.mjs +45 -0
- package/dist/FieldLayout-DcvQU0zN.mjs.map +1 -0
- package/dist/FieldReset/index.d.mts +17 -12
- package/dist/FieldReset/index.d.mts.map +1 -1
- package/dist/FieldReset/index.mjs +50 -33
- package/dist/FieldReset/index.mjs.map +1 -1
- package/dist/FieldValidationError-iAayfTEw.mjs +75 -0
- package/dist/FieldValidationError-iAayfTEw.mjs.map +1 -0
- package/dist/Form/index.d.mts +2 -2
- package/dist/Form/index.d.mts.map +1 -1
- package/dist/Form/index.mjs +9 -7
- package/dist/Form/index.mjs.map +1 -1
- package/dist/{FormContext-Dvt3MiKq.d.mts → FormContext-BnNJYZOo.d.mts} +3 -3
- package/dist/{FormContext-Dvt3MiKq.d.mts.map → FormContext-BnNJYZOo.d.mts.map} +1 -1
- package/dist/{FormContext-B8G_Xxd6.mjs → FormContext-PXkVlBdU.mjs} +6 -2
- package/dist/FormContext-PXkVlBdU.mjs.map +1 -0
- package/dist/Grid/index.mjs +1 -1
- package/dist/{Grid-Us2JFczS.mjs → Grid-DBL29Kwb.mjs} +4 -2
- package/dist/Grid-DBL29Kwb.mjs.map +1 -0
- package/dist/Input/index.d.mts +734 -47
- package/dist/Input/index.d.mts.map +1 -1
- package/dist/Input/index.mjs +411 -168
- package/dist/Input/index.mjs.map +1 -1
- package/dist/RadioBoxes/index.d.mts +300 -98
- package/dist/RadioBoxes/index.d.mts.map +1 -1
- package/dist/RadioBoxes/index.mjs +156 -119
- package/dist/RadioBoxes/index.mjs.map +1 -1
- package/dist/RadioTabs/index.d.mts +302 -76
- package/dist/RadioTabs/index.d.mts.map +1 -1
- package/dist/RadioTabs/index.mjs +274 -87
- package/dist/RadioTabs/index.mjs.map +1 -1
- package/dist/Radios/index.d.mts +314 -78
- package/dist/Radios/index.d.mts.map +1 -1
- package/dist/Radios/index.mjs +90 -44
- package/dist/Radios/index.mjs.map +1 -1
- package/dist/Select/index.d.mts +410 -142
- package/dist/Select/index.d.mts.map +1 -1
- package/dist/Select/index.mjs +284 -157
- package/dist/Select/index.mjs.map +1 -1
- package/dist/Slider/index.d.mts +382 -63
- package/dist/Slider/index.d.mts.map +1 -1
- package/dist/Slider/index.mjs +269 -90
- package/dist/Slider/index.mjs.map +1 -1
- package/dist/SubmitButton/index.d.mts.map +1 -1
- package/dist/SubmitButton/index.mjs +4 -1
- package/dist/SubmitButton/index.mjs.map +1 -1
- package/dist/Switch/index.d.mts +2 -427
- package/dist/Switch/index.mjs +167 -72
- package/dist/Switch/index.mjs.map +1 -1
- package/dist/Switch-Db2dpGz7.d.mts +648 -0
- package/dist/Switch-Db2dpGz7.d.mts.map +1 -0
- package/dist/SwitchBox/index.d.mts +191 -91
- package/dist/SwitchBox/index.d.mts.map +1 -1
- package/dist/SwitchBox/index.mjs +142 -88
- package/dist/SwitchBox/index.mjs.map +1 -1
- package/dist/TextArea/index.d.mts +347 -29
- package/dist/TextArea/index.d.mts.map +1 -1
- package/dist/TextArea/index.mjs +195 -47
- package/dist/TextArea/index.mjs.map +1 -1
- package/dist/Time/index.d.mts +1373 -139
- package/dist/Time/index.d.mts.map +1 -1
- package/dist/Time/index.mjs +160 -77
- package/dist/Time/index.mjs.map +1 -1
- package/dist/helpers/index.d.mts +1 -1
- package/dist/helpers/index.mjs +1 -1
- package/dist/helpers/index.mjs.map +1 -1
- package/dist/hooks/useClientValidation/index.mjs +1 -1
- package/dist/hooks/useController/index.d.mts +29 -2
- package/dist/hooks/useController/index.d.mts.map +1 -0
- package/dist/hooks/useController/index.mjs +1 -1
- package/dist/hooks/useFormContext/index.d.mts +44 -2
- package/dist/hooks/useFormContext/index.d.mts.map +1 -0
- package/dist/hooks/useFormContext/index.mjs +1 -1
- package/dist/hooks/useInputValueDebounce/index.d.mts +9 -3
- package/dist/hooks/useInputValueDebounce/index.d.mts.map +1 -1
- package/dist/hooks/useInputValueDebounce/index.mjs +27 -5
- package/dist/hooks/useInputValueDebounce/index.mjs.map +1 -1
- package/dist/hooks/useInputValueTransform/index.d.mts +1 -2
- package/dist/hooks/useInputValueTransform/index.mjs +1 -1
- package/dist/hooks/useWatchFormReset/index.mjs +1 -1
- package/dist/hooks/useWatchUserChange/index.mjs +1 -1
- package/dist/{useInputValueTransform-cevZBrIN.d.mts → index-cevZBrIN.d.mts} +1 -1
- package/dist/index-cevZBrIN.d.mts.map +1 -0
- package/dist/partials/FieldCopyTestIdButton/index.mjs +1 -1
- package/dist/partials/FieldValidationError/index.d.mts +637 -3
- package/dist/partials/FieldValidationError/index.d.mts.map +1 -1
- package/dist/partials/FieldValidationError/index.mjs +1 -1
- package/dist/radioControlVariants-BYRfaD6y.mjs +187 -0
- package/dist/radioControlVariants-BYRfaD6y.mjs.map +1 -0
- package/dist/switchVariants-D16b2VaT.mjs +67 -0
- package/dist/switchVariants-D16b2VaT.mjs.map +1 -0
- package/dist/timeVariants-CtXyNKmW.mjs +58 -0
- package/dist/timeVariants-CtXyNKmW.mjs.map +1 -0
- package/dist/{useController-CJjMqXU5.mjs → useController-JtIeurpw.mjs} +2 -2
- package/dist/{useController-CJjMqXU5.mjs.map → useController-JtIeurpw.mjs.map} +1 -1
- package/dist/{useFormContext-BEjPBdzb.mjs → useFormContext-piqnN2L-.mjs} +2 -2
- package/dist/{useFormContext-BEjPBdzb.mjs.map → useFormContext-piqnN2L-.mjs.map} +1 -1
- package/dist/{useInputValueTransform-D44BLp1Z.mjs → useInputValueTransform-CXWWFhy_.mjs} +2 -2
- package/dist/{useInputValueTransform-D44BLp1Z.mjs.map → useInputValueTransform-CXWWFhy_.mjs.map} +1 -1
- package/package.json +13 -25
- package/dist/FieldCopyTestIdButton-Y9SfvaM9.mjs.map +0 -1
- package/dist/FieldValidationError-BcUV0r1I.mjs +0 -48
- package/dist/FieldValidationError-BcUV0r1I.mjs.map +0 -1
- package/dist/FormContext-B8G_Xxd6.mjs.map +0 -1
- package/dist/Grid-Us2JFczS.mjs.map +0 -1
- package/dist/Switch/index.d.mts.map +0 -1
- package/dist/hooks/useInput/index.d.mts +0 -2
- package/dist/hooks/useInput/index.mjs +0 -5
- package/dist/hooks/useInput/index.mjs.map +0 -1
- package/dist/hooks/useUniformField/index.d.mts +0 -2
- package/dist/hooks/useUniformField/index.mjs +0 -141
- package/dist/hooks/useUniformField/index.mjs.map +0 -1
- package/dist/hooks/useUniformFieldArray/index.d.mts +0 -47
- package/dist/hooks/useUniformFieldArray/index.d.mts.map +0 -1
- package/dist/hooks/useUniformFieldArray/index.mjs +0 -99
- package/dist/hooks/useUniformFieldArray/index.mjs.map +0 -1
- package/dist/index-CaxrMD1A.d.mts +0 -1
- package/dist/index-DsB0_365.d.mts +0 -106
- package/dist/index-DsB0_365.d.mts.map +0 -1
- package/dist/useController-CdFEp-Wa.d.mts +0 -30
- package/dist/useController-CdFEp-Wa.d.mts.map +0 -1
- package/dist/useFormContext-BSSUZ0Md.d.mts +0 -45
- package/dist/useFormContext-BSSUZ0Md.d.mts.map +0 -1
- package/dist/useInput-ClpHDPdr.d.mts +0 -2
- package/dist/useInput-NPbS4w_n.mjs +0 -1
- package/dist/useInputValueTransform-cevZBrIN.d.mts.map +0 -1
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { t as InputValueTransform } from "./useInputValueTransform-cevZBrIN.mjs";
|
|
2
|
-
import { r as useController$1 } from "./useController-CdFEp-Wa.mjs";
|
|
3
|
-
import { i as useFormContext$1 } from "./useFormContext-BSSUZ0Md.mjs";
|
|
4
|
-
import { t as useInput } from "./useInput-ClpHDPdr.mjs";
|
|
5
|
-
import { ReactNode } from "react";
|
|
6
|
-
import { FieldError, FieldValues, Path } from "react-hook-form";
|
|
7
|
-
interface UseUniformFieldParams<TFieldValues extends FieldValues = FieldValues, TDisplay = unknown> {
|
|
8
|
-
/** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */
|
|
9
|
-
ariaLabel?: string;
|
|
10
|
-
/** Disables the field and omits its value from validation data and submission */
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
/** Normalize nested RHF errors into a flat array for array-like fields */
|
|
13
|
-
isArrayValue?: boolean;
|
|
14
|
-
/** Optional label content */
|
|
15
|
-
label?: ReactNode;
|
|
16
|
-
/** Form field name */
|
|
17
|
-
name: Path<TFieldValues> & string;
|
|
18
|
-
/** Makes the field read-only: users can focus and copy it but not change it; its value is still validated and submitted */
|
|
19
|
-
readOnly?: boolean;
|
|
20
|
-
/** Redacts the field value from Uniform debug output */
|
|
21
|
-
sensitive?: boolean;
|
|
22
|
-
/** Optional explicit test id used to build stable test ids */
|
|
23
|
-
testId?: string;
|
|
24
|
-
/** Optional value transformation between form and display values */
|
|
25
|
-
transform?: InputValueTransform<TDisplay>;
|
|
26
|
-
/** Input type for special number handling */
|
|
27
|
-
type?: 'text' | 'number' | 'password';
|
|
28
|
-
}
|
|
29
|
-
interface UseUniformFieldReturn<TFieldValues extends FieldValues = FieldValues> {
|
|
30
|
-
/** Computed aria-label fallback (field name) when no visible label exists. Components can override based on their accessibility needs (e.g., if placeholder provides sufficient context) */
|
|
31
|
-
ariaLabel: string | undefined;
|
|
32
|
-
/** react-hook-form control instance for advanced integrations */
|
|
33
|
-
control: ReturnType<typeof useFormContext$1<TFieldValues>>['control'];
|
|
34
|
-
/** Debug mode from Uniform provider */
|
|
35
|
-
debugMode: ReturnType<typeof useFormContext$1<TFieldValues>>['debugMode'];
|
|
36
|
-
/** Current value used to initialize uncontrolled components */
|
|
37
|
-
defaultValue: unknown;
|
|
38
|
-
/** Whether the field is currently disabled (from RHF) */
|
|
39
|
-
disabled: boolean | undefined;
|
|
40
|
-
/** Validation errors from form state; flattened only when `isArrayValue` is enabled */
|
|
41
|
-
error: FieldError[] | undefined;
|
|
42
|
-
/** Pre-built errorMessage node to plug into components */
|
|
43
|
-
errorMessage: ReactNode | null;
|
|
44
|
-
/** RHF controller field with transformed value/onChange (use this for simple components) */
|
|
45
|
-
field: ReturnType<typeof useController$1<TFieldValues>>['field'];
|
|
46
|
-
/** Helper to spread standardized error message props to underlying components */
|
|
47
|
-
getErrorMessageProps: ReturnType<typeof useInput>['getErrorMessageProps'];
|
|
48
|
-
/** Helper to spread standardized helper wrapper props (for spacing/animation) */
|
|
49
|
-
getHelperWrapperProps: ReturnType<typeof useInput>['getHelperWrapperProps'];
|
|
50
|
-
/** Helper to spread standardized label props to underlying components */
|
|
51
|
-
getLabelProps: ReturnType<typeof useInput>['getLabelProps'];
|
|
52
|
-
/** Access current form values (converted to validation-friendly format) */
|
|
53
|
-
getValues: ReturnType<typeof useFormContext$1<TFieldValues>>['getValues'];
|
|
54
|
-
/** Whether the field should show invalid state (debounced for smooth animations). True when field is invalid AND (dirty OR touched OR submitted) */
|
|
55
|
-
invalid: boolean;
|
|
56
|
-
/** Computed label node including optional test id copy button */
|
|
57
|
-
label: ReactNode | null;
|
|
58
|
-
/** onBlur handler from controller */
|
|
59
|
-
onBlur: ReturnType<typeof useController$1<TFieldValues>>['field']['onBlur'];
|
|
60
|
-
/** onChange handler from controller (with transform applied) */
|
|
61
|
-
onChange: ReturnType<typeof useController$1<TFieldValues>>['field']['onChange'];
|
|
62
|
-
/** Whether the field is read-only; its value stays registered, validated and submitted */
|
|
63
|
-
readOnly: boolean;
|
|
64
|
-
/** Ref to forward to underlying control */
|
|
65
|
-
ref: ReturnType<typeof useController$1<TFieldValues>>['field']['ref'];
|
|
66
|
-
/** Whether the field is required according to validation schema */
|
|
67
|
-
required: boolean;
|
|
68
|
-
/** Reset a specific field in the form */
|
|
69
|
-
resetField: ReturnType<typeof useFormContext$1<TFieldValues>>['resetField'];
|
|
70
|
-
/** Generated HTML data-testid for the field */
|
|
71
|
-
testId: string;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Combines frequently used form field logic into a single hook.
|
|
75
|
-
*
|
|
76
|
-
* Provides:
|
|
77
|
-
* - Enhanced form context (validation-aware state, `testId`, value transforms)
|
|
78
|
-
* - Controller field with nullish conversion handling
|
|
79
|
-
* - Value transformation via `transform` prop:
|
|
80
|
-
* • Allows disentangled display and form values (e.g., string ↔ object, boolean ↔ array)
|
|
81
|
-
* • Automatically applies `toDisplayValue` to field value for components
|
|
82
|
-
* • Automatically applies `toFormValue` to display value when onChange is called
|
|
83
|
-
* • Works with `type` prop for automatic number/string conversion
|
|
84
|
-
* • Examples: storing objects while displaying strings, storing booleans as arrays, enriching values with metadata
|
|
85
|
-
* - Debounced `invalid` state with smart timing:
|
|
86
|
-
* • `true` (field becomes invalid): applies immediately so errors show right away
|
|
87
|
-
* • `false` (field becomes valid): delayed 200ms to allow smooth exit animations
|
|
88
|
-
* • Respects `prefers-reduced-motion` by skipping delays when user prefers reduced motion
|
|
89
|
-
* - Smart `invalid` visibility (via `showInvalid`):
|
|
90
|
-
* • Shows errors when field is dirty OR touched OR form has been submitted
|
|
91
|
-
* • Prevents showing errors on pristine/untouched fields for better UX
|
|
92
|
-
* • Works well for all field types (text inputs, checkboxes, radios, arrays)
|
|
93
|
-
* - Prebuilt `errorMessage` React node (with optional array-error normalization via `isArrayValue`)
|
|
94
|
-
* - Read-only support: `readOnly` is returned for components to render a
|
|
95
|
-
* focusable, non-editable control; the field stays enabled in RHF, so its
|
|
96
|
-
* value is validated and submitted
|
|
97
|
-
* - Computed `label` node which appends a `FieldCopyTestIdButton` in
|
|
98
|
-
* `debug-testids` mode
|
|
99
|
-
* - `defaultValue` for uncontrolled defaults and all usual field handlers
|
|
100
|
-
* - Access to form utilities: `control`, `getValues`, `resetField`
|
|
101
|
-
* - Presentation helpers: `getLabelProps`, `getErrorMessageProps`,
|
|
102
|
-
* `getHelperWrapperProps` for consistent wiring to underlying UI components
|
|
103
|
-
*/
|
|
104
|
-
declare const useUniformField: <TFieldValues extends FieldValues = FieldValues, TDisplay = unknown>(params: UseUniformFieldParams<TFieldValues, TDisplay>) => UseUniformFieldReturn<TFieldValues>;
|
|
105
|
-
export { UseUniformFieldReturn as n, useUniformField as r, UseUniformFieldParams as t };
|
|
106
|
-
//# sourceMappingURL=index-DsB0_365.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-DsB0_365.d.mts","names":["useFormContext","useController"],"sources":["../src/hooks/useUniformField/useUniformField.tsx"],"mappings":";;;;;;UAiBiB,sBACf,qBAAqB,cAAc,aACnC;;EAGA;;EAEA;;EAEA;;EAEA,QAAQ;;EAER,MAAM,KAAK;;EAEX;;EAEA;;EAEA;;EAEA,YAAY,oBAAoB;;EAEhC;;UAGe,sBACf,qBAAqB,cAAc;;EAGnC;;EAEA,SAAS,kBAAkBA,iBAAe;;EAE1C,WAAW,kBAAkBA,iBAAe;;EAE5C;;EAEA;;EAEA,OAAO;;EAEP,cAAc;;EAEd,OAAO,kBAAkBC,gBAAc;;EAEvC,sBAAsB,kBAAkB;;EAExC,uBAAuB,kBAAkB;;EAEzC,eAAe,kBAAkB;;EAEjC,WAAW,kBAAkBD,iBAAe;;EAE5C;;EAEA,OAAO;;EAEP,QAAQ,kBAAkBC,gBAAc;;EAExC,UAAU,kBAAkBA,gBAAc;;EAE1C;;EAEA,KAAK,kBAAkBA,gBAAc;;EAErC;;EAEA,YAAY,kBAAkBD,iBAAe;;EAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkCW,kBACX,qBAAqB,cAAc,aACnC,oBAEA,QAAQ,sBAAsB,cAAc,cAC3C,sBAAsB"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ControllerFieldState, ControllerRenderProps, UseControllerProps, UseFormStateReturn } from "react-hook-form";
|
|
2
|
-
type UseControllerProps$1<TFieldValues extends object = object> = UseControllerProps<TFieldValues>;
|
|
3
|
-
interface UseControllerReturn<TFieldValues extends object = object> {
|
|
4
|
-
field: Omit<ControllerRenderProps<TFieldValues>, 'onChange' | 'value'> & {
|
|
5
|
-
onChange: (...event: any[]) => void;
|
|
6
|
-
value: string;
|
|
7
|
-
};
|
|
8
|
-
fieldState: ControllerFieldState;
|
|
9
|
-
formState: UseFormStateReturn<TFieldValues>;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* A wrapper around react-hook-form's useController that transparently handles nullish string conversions.
|
|
13
|
-
*
|
|
14
|
-
* Key features:
|
|
15
|
-
* 1. Empty strings ('') in the UI are stored as null in form state
|
|
16
|
-
* 2. Null/undefined values in form state are displayed as empty strings in the UI
|
|
17
|
-
* 3. Handles both direct value changes and React synthetic events
|
|
18
|
-
* 4. Maintains the same API as react-hook-form's useController
|
|
19
|
-
* 5. Notifies UniformContext's userChange listeners on field changes (enables useWatchUserChange hook)
|
|
20
|
-
* 6. No-op when value unchanged: onChange is ignored if the new value equals the current value
|
|
21
|
-
* (prevents unnecessary re-renders and spurious useWatchUserChange triggers)
|
|
22
|
-
*
|
|
23
|
-
* This enables consistent handling of empty/null values while keeping a clean API
|
|
24
|
-
* for form inputs that expect string values.
|
|
25
|
-
*
|
|
26
|
-
* @see https://react-hook-form.com/docs/usecontroller
|
|
27
|
-
*/
|
|
28
|
-
declare const useController$1: <TFieldValues extends object = object>(props: UseControllerProps$1<TFieldValues>) => UseControllerReturn<TFieldValues>;
|
|
29
|
-
export { UseControllerReturn as n, useController$1 as r, UseControllerProps$1 as t };
|
|
30
|
-
//# sourceMappingURL=useController-CdFEp-Wa.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useController-CdFEp-Wa.d.mts","names":["UseControllerProps","RHFUseControllerProps","useController"],"sources":["../src/hooks/useController/useController.ts"],"mappings":";KAaYA,qBAAmB,wCAC7BC,mBAAsB;UAEP,oBAAoB;EACnC,OAAO,KAAK,sBAAsB;IAGhC,cAAc;IACd;;EAEF,YAAY;EACZ,WAAW,mBAAmB;;;;;;;;;;;;;;;;;;;cAoBnBC,kBAAiB,sCAC5B,OAAOF,qBAAmB,kBACzB,oBAAoB"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { n as UniformContext } from "./FormContext-Dvt3MiKq.mjs";
|
|
2
|
-
import { ContextType } from "react";
|
|
3
|
-
import { FieldError, FieldValues, Path, UseFormReturn } from "react-hook-form";
|
|
4
|
-
import { VetoInstance } from "@fuf-stack/veto";
|
|
5
|
-
/** Schema check whether a field is required or optional */
|
|
6
|
-
declare const checkFieldIsRequired: (validation: VetoInstance, path: string[]) => boolean;
|
|
7
|
-
/** Field state returned by the enhanced `getFieldState` */
|
|
8
|
-
interface UniformFieldState {
|
|
9
|
-
/** Validation errors for the field from the Uniform validation schema */
|
|
10
|
-
error: FieldError[] | undefined;
|
|
11
|
-
/** Whether the field has validation errors */
|
|
12
|
-
invalid: boolean;
|
|
13
|
-
/** Whether the field value differs from its default value */
|
|
14
|
-
isDirty: boolean;
|
|
15
|
-
/** Whether the field has been touched */
|
|
16
|
-
isTouched: boolean;
|
|
17
|
-
/** Whether the field is currently being validated */
|
|
18
|
-
isValidating: boolean;
|
|
19
|
-
/** Whether the validation schema requires the field */
|
|
20
|
-
required: boolean;
|
|
21
|
-
/** Generated HTML data-testid for the field */
|
|
22
|
-
testId: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Return type of `useFormContext`.
|
|
26
|
-
*
|
|
27
|
-
* Declared explicitly so the published declarations only reference types that
|
|
28
|
-
* react-hook-form exports from its package root.
|
|
29
|
-
*/
|
|
30
|
-
type UseFormContextReturn<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues = TFieldValues> = Omit<UseFormReturn<TFieldValues, TContext, TTransformedValues>, 'getFieldState'> & ContextType<typeof UniformContext> & {
|
|
31
|
-
getFieldState: (name: Path<TFieldValues>, testId?: string) => UniformFieldState;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Custom hook that extends react-hook-form's useFormContext to add validation and state management.
|
|
35
|
-
*
|
|
36
|
-
* Key features:
|
|
37
|
-
* - Enhanced `getFieldState` that includes validation schema-based "required" status and testId generation
|
|
38
|
-
* - Automatic conversion of form values via `getValues`, `watch`, and `subscribe`:
|
|
39
|
-
* - Unwraps flat array wrappers (`{ __FLAT__: value }` → `value`)
|
|
40
|
-
* - Converts nullish string markers (`__NULL__` → `null`, `__FALSE__` → `false`, `__ZERO__` → `0`)
|
|
41
|
-
* - Filters out empty/null values
|
|
42
|
-
*/
|
|
43
|
-
declare const useFormContext$1: <TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues = TFieldValues>() => UseFormContextReturn<TFieldValues, TContext, TTransformedValues>;
|
|
44
|
-
export { useFormContext$1 as i, UseFormContextReturn as n, checkFieldIsRequired as r, UniformFieldState as t };
|
|
45
|
-
//# sourceMappingURL=useFormContext-BSSUZ0Md.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFormContext-BSSUZ0Md.d.mts","names":["useFormContext"],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"mappings":";;;;;cAkBa,uBACX,YAAY,cACZ;;UA0De;;EAEf,OAAO;;EAEP;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;KASU,qBACV,qBAAqB,cAAc,aACnC,gBACA,qBAAqB,gBACnB,KACF,cAAc,cAAc,UAAU,wCAGtC,mBAAmB;EACjB,gBACE,MAAM,KAAK,eACX,oBACG;;;;;;;;;;;;cAaIA,mBACX,qBAAqB,cAAc,aACnC,gBACA,qBAAqB,mBAClB,qBAAqB,cAAc,UAAU"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useInput as t } from "@heroui/input";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useInputValueTransform-cevZBrIN.d.mts","names":[],"sources":["../src/hooks/useInputValueTransform/useInputValueTransform.ts"],"mappings":"A,UAEiB,oBAAoB;;EAEnC,iBAAiB,mBAAmB;;EAEpC,cAAc,OAAO;;UAGN,8BAA8B;;EAE7C,YAAY,oBAAoB;;EAEhC;;UAGe,6BAA6B;;EAE5C,iBAAiB,uBAAuB;;EAExC,cAAc,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqFjB,yBAA0B,sBAAoB,MAAA,aAGxD,8BAA8B,cAAY,6BAA6B"}
|