@flipdish/ui-library 0.52.0 → 0.53.1
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/atoms/CloseButton/index.cjs +1 -0
- package/dist/components/atoms/CloseButton/index.cjs.map +1 -1
- package/dist/components/atoms/CloseButton/index.d.ts.map +1 -1
- package/dist/components/atoms/CloseButton/index.js +1 -0
- package/dist/components/atoms/CloseButton/index.js.map +1 -1
- package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.cjs +93 -0
- package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.cjs.map +1 -0
- package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.d.ts +54 -0
- package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.d.ts.map +1 -0
- package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.js +91 -0
- package/dist/components/forms/Form/hooks/useSaveForm/useSaveForm.js.map +1 -0
- package/dist/components/forms/Form/index.cjs +26 -6
- package/dist/components/forms/Form/index.cjs.map +1 -1
- package/dist/components/forms/Form/index.d.ts +9 -2
- package/dist/components/forms/Form/index.d.ts.map +1 -1
- package/dist/components/forms/Form/index.js +27 -8
- package/dist/components/forms/Form/index.js.map +1 -1
- package/dist/components/forms/FormFooter/index.cjs +1 -1
- package/dist/components/forms/FormFooter/index.cjs.map +1 -1
- package/dist/components/forms/FormFooter/index.d.ts +4 -0
- package/dist/components/forms/FormFooter/index.d.ts.map +1 -1
- package/dist/components/forms/FormFooter/index.js +1 -1
- package/dist/components/forms/FormFooter/index.js.map +1 -1
- package/dist/components/forms/FormSaveErrorAlert/index.cjs +28 -0
- package/dist/components/forms/FormSaveErrorAlert/index.cjs.map +1 -0
- package/dist/components/forms/FormSaveErrorAlert/index.d.ts +18 -0
- package/dist/components/forms/FormSaveErrorAlert/index.d.ts.map +1 -0
- package/dist/components/forms/FormSaveErrorAlert/index.js +26 -0
- package/dist/components/forms/FormSaveErrorAlert/index.js.map +1 -0
- package/dist/components/forms/FormUnsavedChangesModal/index.cjs +24 -0
- package/dist/components/forms/FormUnsavedChangesModal/index.cjs.map +1 -0
- package/dist/components/forms/FormUnsavedChangesModal/index.d.ts +14 -0
- package/dist/components/forms/FormUnsavedChangesModal/index.d.ts.map +1 -0
- package/dist/components/forms/FormUnsavedChangesModal/index.js +22 -0
- package/dist/components/forms/FormUnsavedChangesModal/index.js.map +1 -0
- package/dist/components/forms/__internal__/formField/hooks/useFormField.cjs +8 -3
- package/dist/components/forms/__internal__/formField/hooks/useFormField.cjs.map +1 -1
- package/dist/components/forms/__internal__/formField/hooks/useFormField.d.ts +1 -1
- package/dist/components/forms/__internal__/formField/hooks/useFormField.d.ts.map +1 -1
- package/dist/components/forms/__internal__/formField/hooks/useFormField.js +8 -3
- package/dist/components/forms/__internal__/formField/hooks/useFormField.js.map +1 -1
- package/dist/components/forms/__internal__/formField/utilities/fieldDependents.utils.cjs +47 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldDependents.utils.cjs.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldDependents.utils.d.ts +26 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldDependents.utils.d.ts.map +1 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldDependents.utils.js +43 -0
- package/dist/components/forms/__internal__/formField/utilities/fieldDependents.utils.js.map +1 -0
- package/dist/components/forms/__internal__/formSubmit/providers/FormSubmit.context.cjs +12 -0
- package/dist/components/forms/__internal__/formSubmit/providers/FormSubmit.context.cjs.map +1 -0
- package/dist/components/forms/__internal__/formSubmit/providers/FormSubmit.context.d.ts +6 -0
- package/dist/components/forms/__internal__/formSubmit/providers/FormSubmit.context.d.ts.map +1 -0
- package/dist/components/forms/__internal__/formSubmit/providers/FormSubmit.context.js +10 -0
- package/dist/components/forms/__internal__/formSubmit/providers/FormSubmit.context.js.map +1 -0
- package/dist/components/forms/fields/FormCheckbox/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormCheckbox/index.d.ts +4 -1
- package/dist/components/forms/fields/FormCheckbox/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormCheckbox/index.js.map +1 -1
- package/dist/components/forms/fields/FormCheckboxGroup/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormCheckboxGroup/index.d.ts +4 -1
- package/dist/components/forms/fields/FormCheckboxGroup/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormCheckboxGroup/index.js.map +1 -1
- package/dist/components/forms/fields/FormColorPicker/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormColorPicker/index.d.ts +4 -1
- package/dist/components/forms/fields/FormColorPicker/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormColorPicker/index.js.map +1 -1
- package/dist/components/forms/fields/FormDatePicker/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormDatePicker/index.d.ts +4 -1
- package/dist/components/forms/fields/FormDatePicker/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormDatePicker/index.js.map +1 -1
- package/dist/components/forms/fields/FormInput/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormInput/index.d.ts +4 -1
- package/dist/components/forms/fields/FormInput/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormInput/index.js.map +1 -1
- package/dist/components/forms/fields/FormMultiSelect/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormMultiSelect/index.d.ts +4 -1
- package/dist/components/forms/fields/FormMultiSelect/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormMultiSelect/index.js.map +1 -1
- package/dist/components/forms/fields/FormRadioCardGroup/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormRadioCardGroup/index.d.ts +4 -1
- package/dist/components/forms/fields/FormRadioCardGroup/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormRadioCardGroup/index.js.map +1 -1
- package/dist/components/forms/fields/FormRadioGroup/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormRadioGroup/index.d.ts +4 -1
- package/dist/components/forms/fields/FormRadioGroup/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormRadioGroup/index.js.map +1 -1
- package/dist/components/forms/fields/FormSelect/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormSelect/index.d.ts +4 -1
- package/dist/components/forms/fields/FormSelect/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormSelect/index.js.map +1 -1
- package/dist/components/forms/fields/FormSlider/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormSlider/index.d.ts +4 -1
- package/dist/components/forms/fields/FormSlider/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormSlider/index.js.map +1 -1
- package/dist/components/forms/fields/FormTextArea/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormTextArea/index.d.ts +4 -1
- package/dist/components/forms/fields/FormTextArea/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormTextArea/index.js.map +1 -1
- package/dist/components/forms/fields/FormToggle/index.cjs.map +1 -1
- package/dist/components/forms/fields/FormToggle/index.d.ts +4 -1
- package/dist/components/forms/fields/FormToggle/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormToggle/index.js.map +1 -1
- package/dist/components/forms/validation/hooks/useSchemaResolver.cjs +7 -2
- package/dist/components/forms/validation/hooks/useSchemaResolver.cjs.map +1 -1
- package/dist/components/forms/validation/hooks/useSchemaResolver.d.ts +2 -1
- package/dist/components/forms/validation/hooks/useSchemaResolver.d.ts.map +1 -1
- package/dist/components/forms/validation/hooks/useSchemaResolver.js +8 -3
- package/dist/components/forms/validation/hooks/useSchemaResolver.js.map +1 -1
- package/dist/components/forms/validation/index.cjs +112 -8
- package/dist/components/forms/validation/index.cjs.map +1 -1
- package/dist/components/forms/validation/index.d.ts +71 -7
- package/dist/components/forms/validation/index.d.ts.map +1 -1
- package/dist/components/forms/validation/index.js +110 -9
- package/dist/components/forms/validation/index.js.map +1 -1
- package/dist/components/forms/validation/utilities/validation.utils.cjs +30 -0
- package/dist/components/forms/validation/utilities/validation.utils.cjs.map +1 -1
- package/dist/components/forms/validation/utilities/validation.utils.d.ts +18 -0
- package/dist/components/forms/validation/utilities/validation.utils.d.ts.map +1 -1
- package/dist/components/forms/validation/utilities/validation.utils.js +29 -1
- package/dist/components/forms/validation/utilities/validation.utils.js.map +1 -1
- package/dist/components/molecules/Dropdown/components/DropdownSelectionIndicator.cjs +29 -0
- package/dist/components/molecules/Dropdown/components/DropdownSelectionIndicator.cjs.map +1 -0
- package/dist/components/molecules/Dropdown/components/DropdownSelectionIndicator.d.ts +9 -0
- package/dist/components/molecules/Dropdown/components/DropdownSelectionIndicator.d.ts.map +1 -0
- package/dist/components/molecules/Dropdown/components/DropdownSelectionIndicator.js +27 -0
- package/dist/components/molecules/Dropdown/components/DropdownSelectionIndicator.js.map +1 -0
- package/dist/components/molecules/Dropdown/index.cjs +4 -30
- package/dist/components/molecules/Dropdown/index.cjs.map +1 -1
- package/dist/components/molecules/Dropdown/index.d.ts +1 -1
- package/dist/components/molecules/Dropdown/index.d.ts.map +1 -1
- package/dist/components/molecules/Dropdown/index.js +6 -32
- package/dist/components/molecules/Dropdown/index.js.map +1 -1
- package/dist/components/molecules/Dropdown/utilities/dropdown.utils.cjs +24 -0
- package/dist/components/molecules/Dropdown/utilities/dropdown.utils.cjs.map +1 -0
- package/dist/components/molecules/Dropdown/utilities/dropdown.utils.d.ts +10 -0
- package/dist/components/molecules/Dropdown/utilities/dropdown.utils.d.ts.map +1 -0
- package/dist/components/molecules/Dropdown/utilities/dropdown.utils.js +22 -0
- package/dist/components/molecules/Dropdown/utilities/dropdown.utils.js.map +1 -0
- package/dist/hooks/useFocusAfterRetry/index.cjs +7 -3
- package/dist/hooks/useFocusAfterRetry/index.cjs.map +1 -1
- package/dist/hooks/useFocusAfterRetry/index.d.ts +8 -2
- package/dist/hooks/useFocusAfterRetry/index.d.ts.map +1 -1
- package/dist/hooks/useFocusAfterRetry/index.js +7 -3
- package/dist/hooks/useFocusAfterRetry/index.js.map +1 -1
- package/dist/localization/en.json.cjs +19 -0
- package/dist/localization/en.json.cjs.map +1 -1
- package/dist/localization/en.json.js +18 -1
- package/dist/localization/en.json.js.map +1 -1
- package/dist/native/components/forms/FormSaveErrorAlert/index.d.ts +12 -0
- package/dist/native/components/forms/FormUnsavedChangesModal/index.d.ts +12 -0
- package/dist/native/utilities/colorUtils/index.d.ts +12 -0
- package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.d.ts +1 -1
- package/dist/utilities/__internal__/builtInTextUtils/builtInText.utils.d.ts.map +1 -1
- package/dist/utilities/colorUtils/index.cjs +24 -0
- package/dist/utilities/colorUtils/index.cjs.map +1 -0
- package/dist/utilities/colorUtils/index.d.ts +8 -0
- package/dist/utilities/colorUtils/index.d.ts.map +1 -0
- package/dist/utilities/colorUtils/index.js +22 -0
- package/dist/utilities/colorUtils/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormColorPicker/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormColorPicker/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;AA2BA;;;;;AAKG;MACU,eAAe,GAAG,CAA4C,EACzE,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,aAAa,EAAE,UAAU,EACzB,GAAG,UAAU,EACiB,KAAI;IAClC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,YAAY,CAC5G,IAAI,EACJ,WAAW,CACZ;AACD,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC;;IAEzH,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC;IAC9C,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC;;AAEpD,IAAA,MAAM,KAAK,GAAG,CAAC,IAAmB,KAAK,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AACnE,IAAA,MAAM,MAAM,GAAG,CAAC,IAAmB,KAAK,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AAEpE,IAAA,QACEA,GAAA,CAAC,WAAW,CAAC,KAAK,EAAA,EAAA,GACZ,UAAU,EACd,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,KAAK;;AAEZ,QAAA,QAAQ,EAAE,KAAK,EACf,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,YAAY,IAAI,IAAI;;AAE1B,QAAA,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,UAAU,IAAI,QAAQ,EAAA,aAAA,EAC9C,UAAU,EAAA,CACvB;AAEN;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormDatePicker/index.tsx"],"sourcesContent":[null],"names":["useFormField","useMemo","toCalendarDate","useFocusTarget","_jsx","DatePicker"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormDatePicker/index.tsx"],"sourcesContent":[null],"names":["useFormField","useMemo","toCalendarDate","useFocusTarget","_jsx","DatePicker"],"mappings":";;;;;;;;;AAqBA;;;;;;AAMG;AACI,MAAM,cAAc,GAAG,CAA4C,EACxE,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,GAAG,eAAe,EACW,KAAI;IACjC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAGA,yBAAY,CAAyB,IAAI,EAAE,WAAW,CAAC;;AAE/I,IAAA,MAAM,IAAI,GAAGC,aAAO,CAAC,MAAMC,mCAAc,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;;IAE1D,MAAM,YAAY,GAAG,CAAC,IAAsB,KAAK,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC;;IAGxF,MAAM,QAAQ,GAAGC,6BAAc,CAAC,GAAG,EAAE,QAAQ,CAAC;IAE9C,QACEC,eAACC;;;;AAEC,QAAA,kBAAkB,EAAC,MAAM,EAAA,GACrB,eAAe,EACnB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,YAAY,IAAI,IAAI;;QAE1B,UAAU,EAAE,eAAe,CAAC,UAAU,IAAI,UAAU,IAAI,QAAQ,EAAA,CAChE;AAEN;;"}
|
|
@@ -3,7 +3,10 @@ import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
|
3
3
|
export interface FormDatePickerProps<TValues extends FieldValues = FieldValues> extends Omit<DatePickerProps, 'name' | 'value' | 'defaultValue' | 'onChange' | 'onBlur' | 'isInvalid' | 'ref'> {
|
|
4
4
|
/** The field's path in the form values, such as `deliveryDate` or `promotion.endDate`. */
|
|
5
5
|
name: FieldPath<TValues>;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Other fields to re-validate when this changes. A `crossFieldRules` rule validated through `useSchemaResolver` names them
|
|
8
|
+
* itself, so pass this only for a rule written another way, such as a zod `superRefine` in the same schema, or for a nested field.
|
|
9
|
+
*/
|
|
7
10
|
revalidates?: FieldPath<TValues> | FieldPath<TValues>[];
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormDatePicker/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,sDAAsD,CAAC;AAGxG,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9D,MAAM,WAAW,mBAAmB,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CAC5E,SAAQ,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;IAC9G,0FAA0F;IAC1F,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormDatePicker/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,sDAAsD,CAAC;AAGxG,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9D,MAAM,WAAW,mBAAmB,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CAC5E,SAAQ,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;IAC9G,0FAA0F;IAC1F,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CACzD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,SAAS,WAAW,GAAG,WAAW,EAAE,iDAKvE,mBAAmB,CAAC,OAAO,CAAC,gCA0B9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormDatePicker/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormDatePicker/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;AAqBA;;;;;;AAMG;AACI,MAAM,cAAc,GAAG,CAA4C,EACxE,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,GAAG,eAAe,EACW,KAAI;IACjC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAyB,IAAI,EAAE,WAAW,CAAC;;AAE/I,IAAA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;;IAE1D,MAAM,YAAY,GAAG,CAAC,IAAsB,KAAK,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC;;IAGxF,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,EAAE,QAAQ,CAAC;IAE9C,QACEA,IAAC;;;;AAEC,QAAA,kBAAkB,EAAC,MAAM,EAAA,GACrB,eAAe,EACnB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,YAAY,IAAI,IAAI;;QAE1B,UAAU,EAAE,eAAe,CAAC,UAAU,IAAI,UAAU,IAAI,QAAQ,EAAA,CAChE;AAEN;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormInput/index.tsx"],"sourcesContent":[null],"names":["useFormField","_jsx","Input"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormInput/index.tsx"],"sourcesContent":[null],"names":["useFormField","_jsx","Input"],"mappings":";;;;;;AAiBA;;;;;AAKG;AACI,MAAM,SAAS,GAAG,CAA4C,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,UAAU,EAA2B,KAAI;IAC1I,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAGA,yBAAY,CAAkB,IAAI,EAAE,WAAW,CAAC;IAExI,QACEC,eAACC;;;;AAEC,QAAA,kBAAkB,EAAC,MAAM,EAAA,GACrB,UAAU,EACd,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM;;QAEd,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,YAAY,IAAI,IAAI,EAC1B,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,UAAU;;QAE/C,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,QAAQ,EAAA,CAC7C;AAEN;;"}
|
|
@@ -3,7 +3,10 @@ import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
|
3
3
|
export interface FormInputProps<TValues extends FieldValues = FieldValues> extends Omit<InputProps, 'name' | 'value' | 'defaultValue' | 'onChange' | 'onBlur' | 'isInvalid' | 'ref'> {
|
|
4
4
|
/** The field's path in the form values, such as `email` or `address.city`. */
|
|
5
5
|
name: FieldPath<TValues>;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Other fields to re-validate when this changes. A `crossFieldRules` rule validated through `useSchemaResolver` names them
|
|
8
|
+
* itself, so pass this only for a rule written another way, such as a zod `superRefine` in the same schema, or for a nested field.
|
|
9
|
+
*/
|
|
7
10
|
revalidates?: FieldPath<TValues> | FieldPath<TValues>[];
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormInput/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9D,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CACvE,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;IACzG,8EAA8E;IAC9E,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormInput/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9D,MAAM,WAAW,cAAc,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CACvE,SAAQ,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;IACzG,8EAA8E;IAC9E,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CACzD;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,OAAO,SAAS,WAAW,GAAG,WAAW,EAAE,4CAA4C,cAAc,CAAC,OAAO,CAAC,gCAqBvI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormInput/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormInput/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;AAiBA;;;;;AAKG;AACI,MAAM,SAAS,GAAG,CAA4C,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,UAAU,EAA2B,KAAI;IAC1I,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAkB,IAAI,EAAE,WAAW,CAAC;IAExI,QACEA,IAAC;;;;AAEC,QAAA,kBAAkB,EAAC,MAAM,EAAA,GACrB,UAAU,EACd,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM;;QAEd,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,YAAY,IAAI,IAAI,EAC1B,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,UAAU;;QAE/C,UAAU,EAAE,UAAU,CAAC,UAAU,IAAI,QAAQ,EAAA,CAC7C;AAEN;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormMultiSelect/index.tsx"],"sourcesContent":[null],"names":["useFormField","useMemo","collectSelectableKeys","useFocusTarget","_jsx","MultiSelect"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormMultiSelect/index.tsx"],"sourcesContent":[null],"names":["useFormField","useMemo","collectSelectableKeys","useFocusTarget","_jsx","MultiSelect"],"mappings":";;;;;;;;;AAqBA;;;;;;AAMG;AACI,MAAM,eAAe,GAAG,CAA4C,EACzE,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAW,EACX,GAAG,gBAAgB,EACW,KAAI;IAClC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAGA,yBAAY,CAAiB,IAAI,EAAE,WAAW,CAAC;;AAE/H,IAAA,MAAM,YAAY,GAAGC,aAAO,CAAC,MAAM,IAAI,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;;AAEjE,IAAA,MAAM,OAAO,GAAG,MAAM;AACpB,QAAA,GAAGC,uCAAqB,CACtB,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC,EAC7B,QAAQ,CACT;KACF;;IAGD,MAAM,qBAAqB,GAAG,CAAC,IAAe,KAAK,QAAQ,CAAC,IAAI,KAAK,KAAK,GAAG,OAAO,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;;IAEnG,MAAM,WAAW,GAAG,MAAK;QACvB,QAAQ,CAAC,EAAE,CAAC;QACZ,OAAO,IAAI;AACb,IAAA,CAAC;IACD,MAAM,eAAe,GAAG,MAAK;AAC3B,QAAA,QAAQ,CAAC,OAAO,EAAE,CAAC;QACnB,WAAW,IAAI;AACjB,IAAA,CAAC;;IAGD,MAAM,QAAQ,GAAGC,6BAAc,CAAC,GAAG,EAAE,iBAAiB,CAAC;AAEvD,IAAA,QACEC,cAAA,CAACC,kBAAW,EAAA,EAAA,GACN,gBAAgB,EACpB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,qBAAqB,EACxC,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,eAAe,EAC5B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,YAAY,IAAI,IAAI;;AAE1B,QAAA,UAAU,EAAE,gBAAgB,CAAC,UAAU,IAAI,UAAU,IAAI,QAAQ,EAAA,QAAA,EAEhE,QAAQ,EAAA,CACG;AAElB;;"}
|
|
@@ -3,7 +3,10 @@ import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
|
3
3
|
export interface FormMultiSelectProps<TValues extends FieldValues = FieldValues> extends Omit<MultiSelectProps, 'selectedKeys' | 'defaultSelectedKeys' | 'onSelectionChange' | 'isInvalid' | 'ref'> {
|
|
4
4
|
/** The field's path in the form values, such as `cuisines` or `menu.tags`. */
|
|
5
5
|
name: FieldPath<TValues>;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Other fields to re-validate when this changes. A `crossFieldRules` rule validated through `useSchemaResolver` names them
|
|
8
|
+
* itself, so pass this only for a rule written another way, such as a zod `superRefine` in the same schema, or for a nested field.
|
|
9
|
+
*/
|
|
7
10
|
revalidates?: FieldPath<TValues> | FieldPath<TValues>[];
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormMultiSelect/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAGtG,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9D,MAAM,WAAW,oBAAoB,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CAC7E,SAAQ,IAAI,CAAC,gBAAgB,EAAE,cAAc,GAAG,qBAAqB,GAAG,mBAAmB,GAAG,WAAW,GAAG,KAAK,CAAC;IAClH,8EAA8E;IAC9E,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormMultiSelect/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAGtG,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9D,MAAM,WAAW,oBAAoB,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CAC7E,SAAQ,IAAI,CAAC,gBAAgB,EAAE,cAAc,GAAG,qBAAqB,GAAG,mBAAmB,GAAG,WAAW,GAAG,KAAK,CAAC;IAClH,8EAA8E;IAC9E,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CACzD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,SAAS,WAAW,GAAG,WAAW,EAAE,yFASxE,oBAAoB,CAAC,OAAO,CAAC,gCA4C/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormMultiSelect/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormMultiSelect/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;;;AAqBA;;;;;;AAMG;AACI,MAAM,eAAe,GAAG,CAA4C,EACzE,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,OAAO,EACP,WAAW,EACX,GAAG,gBAAgB,EACW,KAAI;IAClC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAiB,IAAI,EAAE,WAAW,CAAC;;AAE/H,IAAA,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,IAAI,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;;AAEjE,IAAA,MAAM,OAAO,GAAG,MAAM;AACpB,QAAA,GAAG,qBAAqB,CACtB,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,CAAC,EAC7B,QAAQ,CACT;KACF;;IAGD,MAAM,qBAAqB,GAAG,CAAC,IAAe,KAAK,QAAQ,CAAC,IAAI,KAAK,KAAK,GAAG,OAAO,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;;IAEnG,MAAM,WAAW,GAAG,MAAK;QACvB,QAAQ,CAAC,EAAE,CAAC;QACZ,OAAO,IAAI;AACb,IAAA,CAAC;IACD,MAAM,eAAe,GAAG,MAAK;AAC3B,QAAA,QAAQ,CAAC,OAAO,EAAE,CAAC;QACnB,WAAW,IAAI;AACjB,IAAA,CAAC;;IAGD,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,EAAE,iBAAiB,CAAC;AAEvD,IAAA,QACEA,GAAA,CAAC,WAAW,EAAA,EAAA,GACN,gBAAgB,EACpB,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,qBAAqB,EACxC,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,eAAe,EAC5B,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,YAAY,IAAI,IAAI;;AAE1B,QAAA,UAAU,EAAE,gBAAgB,CAAC,UAAU,IAAI,UAAU,IAAI,QAAQ,EAAA,QAAA,EAEhE,QAAQ,EAAA,CACG;AAElB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormRadioCardGroup/index.tsx"],"sourcesContent":[null],"names":["useFormField","useFocusTarget","useId","_jsxs","_jsx","RadioButton","joinIds","HintText"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormRadioCardGroup/index.tsx"],"sourcesContent":[null],"names":["useFormField","useFocusTarget","useId","_jsxs","_jsx","RadioButton","joinIds","HintText"],"mappings":";;;;;;;;;;AA6BA;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,CAA4C,EAC5E,IAAI,EACJ,WAAW,EACX,KAAK,EACL,IAAI,EACJ,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,eAAe,EACnC,GAAG,eAAe,EACe,KAAI;IACrC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAGA,yBAAY,CAAkB,IAAI,EAAE,WAAW,CAAC;;IAExI,MAAM,QAAQ,GAAGC,6BAAc,CAAC,GAAG,EAAE,8BAA8B,EAAE,sBAAsB,CAAC;AAC5F,IAAA,MAAM,OAAO,GAAGC,WAAK,EAAE;AACvB,IAAA,MAAM,SAAS,GAAGA,WAAK,EAAE;AACzB,IAAA,MAAM,OAAO,GAAG,YAAY,IAAI,IAAI;AAEpC,IAAA,QACEC,eAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,8BAA8B,EAAA,QAAA,EAAA,CACzD,KAAK,KACJA,eAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,8DAA8D,EAAA,QAAA,EAAA,CACxF,KAAK,EACL,eAAe,CAAC,UAAU,KACzBC,cAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAkB,MAAM,EAAC,SAAS,EAAC,qBAAqB,EAAA,QAAA,EAAA,GAAA,EAAA,CAEjD,CACR,IACI,CACR,EACDA,eAACC;;;;AAEC,gBAAA,kBAAkB,EAAC,MAAM,EAAA,GACrB,eAAe,EACnB,IAAI,EAAE,IAAI;;gBAEV,KAAK,EAAE,KAAK,IAAI,IAAI,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,CAAC,UAAU,IAAI,UAAU;;gBAEpD,UAAU,EAAE,eAAe,CAAC,UAAU,IAAI,QAAQ,EAAA,iBAAA,EACjCC,qBAAO,CAAC,cAAc,EAAE,KAAK,IAAI,OAAO,CAAC,EAAA,kBAAA,EAExCA,qBAAO,CAAC,eAAe,EAAE,OAAO,IAAI,SAAS,CAAC,GAChE,EACD,OAAO,KACNF,cAAA,CAACG,cAAQ,EAAA,EAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,EAAA,QAAA,EACtD,OAAO,EAAA,CACC,CACZ,CAAA,EAAA,CACG;AAEV;;"}
|
|
@@ -4,7 +4,10 @@ import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
|
4
4
|
interface FormRadioCardGroupBaseProps<TValues extends FieldValues = FieldValues> extends Omit<ComponentProps<typeof RadioButton>, 'name' | 'value' | 'defaultValue' | 'onChange' | 'onBlur' | 'isInvalid'> {
|
|
5
5
|
/** The field's path in the form values, such as `template` or `delivery.method`. */
|
|
6
6
|
name: FieldPath<TValues>;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Other fields to re-validate when this changes. A `crossFieldRules` rule validated through `useSchemaResolver` names them
|
|
9
|
+
* itself, so pass this only for a rule written another way, such as a zod `superRefine` in the same schema, or for a nested field.
|
|
10
|
+
*/
|
|
8
11
|
revalidates?: FieldPath<TValues> | FieldPath<TValues>[];
|
|
9
12
|
/** Name of the group, shown above the cards; the types ask for this, `aria-label` or `aria-labelledby`. */
|
|
10
13
|
label?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormRadioCardGroup/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAC;AACnF,OAAO,EAAE,KAAK,cAAc,EAAS,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9D,UAAU,2BAA2B,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CAC7E,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC;IACzH,oFAAoF;IACpF,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormRadioCardGroup/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,sDAAsD,CAAC;AACnF,OAAO,EAAE,KAAK,cAAc,EAAS,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9D,UAAU,2BAA2B,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CAC7E,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC;IACzH,oFAAoF;IACpF,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;IACxD,2GAA2G;IAC3G,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,MAAM,uBAAuB,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,IAAI,2BAA2B,CAAC,OAAO,CAAC,GACnH,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,iBAAiB,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEjF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,SAAS,WAAW,GAAG,WAAW,EAAE,gIAQ3E,uBAAuB,CAAC,OAAO,CAAC,gCA4ClC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormRadioCardGroup/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormRadioCardGroup/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AA6BA;;;;;AAKG;AACI,MAAM,kBAAkB,GAAG,CAA4C,EAC5E,IAAI,EACJ,WAAW,EACX,KAAK,EACL,IAAI,EACJ,iBAAiB,EAAE,cAAc,EACjC,kBAAkB,EAAE,eAAe,EACnC,GAAG,eAAe,EACe,KAAI;IACrC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAkB,IAAI,EAAE,WAAW,CAAC;;IAExI,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,EAAE,8BAA8B,EAAE,sBAAsB,CAAC;AAC5F,IAAA,MAAM,OAAO,GAAG,KAAK,EAAE;AACvB,IAAA,MAAM,SAAS,GAAG,KAAK,EAAE;AACzB,IAAA,MAAM,OAAO,GAAG,YAAY,IAAI,IAAI;AAEpC,IAAA,QACEA,IAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,8BAA8B,EAAA,QAAA,EAAA,CACzD,KAAK,KACJA,IAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,8DAA8D,EAAA,QAAA,EAAA,CACxF,KAAK,EACL,eAAe,CAAC,UAAU,KACzBC,GAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAkB,MAAM,EAAC,SAAS,EAAC,qBAAqB,EAAA,QAAA,EAAA,GAAA,EAAA,CAEjD,CACR,IACI,CACR,EACDA,IAAC;;;;AAEC,gBAAA,kBAAkB,EAAC,MAAM,EAAA,GACrB,eAAe,EACnB,IAAI,EAAE,IAAI;;gBAEV,KAAK,EAAE,KAAK,IAAI,IAAI,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,CAAC,UAAU,IAAI,UAAU;;gBAEpD,UAAU,EAAE,eAAe,CAAC,UAAU,IAAI,QAAQ,EAAA,iBAAA,EACjC,OAAO,CAAC,cAAc,EAAE,KAAK,IAAI,OAAO,CAAC,EAAA,kBAAA,EAExC,OAAO,CAAC,eAAe,EAAE,OAAO,IAAI,SAAS,CAAC,GAChE,EACD,OAAO,KACNA,GAAA,CAAC,QAAQ,EAAA,EAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,EAAA,QAAA,EACtD,OAAO,EAAA,CACC,CACZ,CAAA,EAAA,CACG;AAEV;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormRadioGroup/index.tsx"],"sourcesContent":[null],"names":["useFormField","useFocusTarget","_jsx","_jsxs","RadioGroup","HintText"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormRadioGroup/index.tsx"],"sourcesContent":[null],"names":["useFormField","useFocusTarget","_jsx","_jsxs","RadioGroup","HintText"],"mappings":";;;;;;;;AAoBA;;;;;AAKG;AACI,MAAM,cAAc,GAAG,CAA4C,EACxE,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,GAAG,eAAe,EACW,KAAI;IACjC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAGA,yBAAY,CAAkB,IAAI,EAAE,WAAW,CAAC;;IAExI,MAAM,QAAQ,GAAGC,6BAAc,CAAC,GAAG,EAAE,8BAA8B,EAAE,sBAAsB,CAAC;IAE5F,QACEC,cAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,UAAU,EAAA,QAAA,EACtCC,eAAA,CAACC;;;;AAEC,YAAA,kBAAkB,EAAC,MAAM,EAAA,GACrB,eAAe,EACnB,IAAI,EAAE,IAAI;;YAEV,KAAK,EAAE,KAAK,IAAI,IAAI,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,CAAC,UAAU,IAAI,UAAU;;AAEpD,YAAA,UAAU,EAAE,eAAe,CAAC,UAAU,IAAI,QAAQ,EAAA,QAAA,EAAA,CAEjD,QAAQ,EAER,SAAS,IAAI,YAAY,KACxBF,cAAA,CAACG,cAAQ,EAAA,EAAC,SAAS,EAAA,IAAA,EAAC,IAAI,EAAC,OAAO,EAAA,QAAA,EAC7B,YAAY,EAAA,CACJ,CACZ,CAAA,EAAA,CACU,EAAA,CACT;AAEV;;"}
|
|
@@ -4,7 +4,10 @@ import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
|
4
4
|
export interface FormRadioGroupProps<TValues extends FieldValues = FieldValues> extends Omit<ComponentProps<typeof RadioGroup>, 'name' | 'value' | 'defaultValue' | 'onChange' | 'onBlur' | 'isInvalid' | 'ref'> {
|
|
5
5
|
/** The field's path in the form values, such as `plan` or `delivery.method`. */
|
|
6
6
|
name: FieldPath<TValues>;
|
|
7
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Other fields to re-validate when this changes. A `crossFieldRules` rule validated through `useSchemaResolver` names them
|
|
9
|
+
* itself, so pass this only for a rule written another way, such as a zod `superRefine` in the same schema, or for a nested field.
|
|
10
|
+
*/
|
|
8
11
|
revalidates?: FieldPath<TValues> | FieldPath<TValues>[];
|
|
9
12
|
}
|
|
10
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormRadioGroup/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,mDAAmD,CAAC;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9D,MAAM,WAAW,mBAAmB,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CAC5E,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;IAChI,gFAAgF;IAChF,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormRadioGroup/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,mDAAmD,CAAC;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9D,MAAM,WAAW,mBAAmB,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CAC5E,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;IAChI,gFAAgF;IAChF,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CACzD;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,SAAS,WAAW,GAAG,WAAW,EAAE,qDAKvE,mBAAmB,CAAC,OAAO,CAAC,gCA+B9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormRadioGroup/index.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormRadioGroup/index.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs"],"mappings":";;;;;;AAoBA;;;;;AAKG;AACI,MAAM,cAAc,GAAG,CAA4C,EACxE,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,GAAG,eAAe,EACW,KAAI;IACjC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAkB,IAAI,EAAE,WAAW,CAAC;;IAExI,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,EAAE,8BAA8B,EAAE,sBAAsB,CAAC;IAE5F,QACEA,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,UAAU,EAAA,QAAA,EACtCC,IAAA,CAAC;;;;AAEC,YAAA,kBAAkB,EAAC,MAAM,EAAA,GACrB,eAAe,EACnB,IAAI,EAAE,IAAI;;YAEV,KAAK,EAAE,KAAK,IAAI,IAAI,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,CAAC,UAAU,IAAI,UAAU;;AAEpD,YAAA,UAAU,EAAE,eAAe,CAAC,UAAU,IAAI,QAAQ,EAAA,QAAA,EAAA,CAEjD,QAAQ,EAER,SAAS,IAAI,YAAY,KACxBD,GAAA,CAAC,QAAQ,EAAA,EAAC,SAAS,EAAA,IAAA,EAAC,IAAI,EAAC,OAAO,EAAA,QAAA,EAC7B,YAAY,EAAA,CACJ,CACZ,CAAA,EAAA,CACU,EAAA,CACT;AAEV;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormSelect/index.tsx"],"sourcesContent":[null],"names":["useFormField","useFocusTarget","_jsx","Select"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormSelect/index.tsx"],"sourcesContent":[null],"names":["useFormField","useFocusTarget","_jsx","Select"],"mappings":";;;;;;;AAsBA;;;;;AAKG;AACI,MAAM,UAAU,GAAG,CAA4C,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,WAAW,EAA4B,KAAI;IAC7I,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAGA,yBAAY,CAAsB,IAAI,EAAE,WAAW,CAAC;;IAG5I,MAAM,QAAQ,GAAGC,6BAAc,CAAC,GAAG,EAAE,iBAAiB,CAAC;IAEvD,QACEC,eAACC;;;;QAEC,kBAAkB,EAAC,MAAM,EAAA,GACrB,WAAW,EACf,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,IAAI;;QAEV,KAAK,EAAE,KAAK,IAAI,IAAI,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,YAAY,IAAI,IAAI;;QAE1B,UAAU,EAAE,WAAW,CAAC,UAAU,IAAI,UAAU,IAAI,QAAQ,EAAA,CAC5D;AAEN;;"}
|
|
@@ -3,7 +3,10 @@ import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
|
3
3
|
export interface FormSelectProps<TValues extends FieldValues = FieldValues> extends Omit<SelectProps, 'name' | 'value' | 'defaultValue' | 'onChange' | 'selectedKey' | 'defaultSelectedKey' | 'onSelectionChange' | 'onBlur' | 'isInvalid' | 'ref'> {
|
|
4
4
|
/** The field's path in the form values, such as `country` or `address.country`. */
|
|
5
5
|
name: FieldPath<TValues>;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Other fields to re-validate when this changes. A `crossFieldRules` rule validated through `useSchemaResolver` names them
|
|
8
|
+
* itself, so pass this only for a rule written another way, such as a zod `superRefine` in the same schema, or for a nested field.
|
|
9
|
+
*/
|
|
7
10
|
revalidates?: FieldPath<TValues> | FieldPath<TValues>[];
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormSelect/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAE5F,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9D,MAAM,WAAW,eAAe,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CACxE,SAAQ,IAAI,CACV,WAAW,EACX,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,aAAa,GAAG,oBAAoB,GAAG,mBAAmB,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,CAC7I;IACD,mFAAmF;IACnF,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormSelect/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAE5F,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9D,MAAM,WAAW,eAAe,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CACxE,SAAQ,IAAI,CACV,WAAW,EACX,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,aAAa,GAAG,oBAAoB,GAAG,mBAAmB,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,CAC7I;IACD,mFAAmF;IACnF,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CACzD;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,SAAS,WAAW,GAAG,WAAW,EAAE,6CAA6C,eAAe,CAAC,OAAO,CAAC,gCAuB1I,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormSelect/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormSelect/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;AAsBA;;;;;AAKG;AACI,MAAM,UAAU,GAAG,CAA4C,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,WAAW,EAA4B,KAAI;IAC7I,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAsB,IAAI,EAAE,WAAW,CAAC;;IAG5I,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,EAAE,iBAAiB,CAAC;IAEvD,QACEA,IAAC;;;;QAEC,kBAAkB,EAAC,MAAM,EAAA,GACrB,WAAW,EACf,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,IAAI;;QAEV,KAAK,EAAE,KAAK,IAAI,IAAI,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,YAAY,IAAI,IAAI;;QAE1B,UAAU,EAAE,WAAW,CAAC,UAAU,IAAI,UAAU,IAAI,QAAQ,EAAA,CAC5D;AAEN;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormSlider/index.tsx"],"sourcesContent":[null],"names":["useFormField","useFocusTarget","useId","joinIds","_jsxs","_jsx","Slider","HintText"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormSlider/index.tsx"],"sourcesContent":[null],"names":["useFormField","useFocusTarget","useId","joinIds","_jsxs","_jsx","Slider","HintText"],"mappings":";;;;;;;;;;AAqBA;;;;;;AAMG;MACU,UAAU,GAAG,CAA4C,EACpE,IAAI,EACJ,WAAW,EACX,QAAQ,GAAG,CAAC,EACZ,IAAI,EACJ,GAAG,WAAW,EACW,KAAI;IAC7B,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAGA,yBAAY,CAAkB,IAAI,EAAE,WAAW,CAAC;;IAEjJ,MAAM,QAAQ,GAAGC,6BAAc,CAAC,GAAG,EAAE,OAAO,CAAC;AAC7C,IAAA,MAAM,OAAO,GAAGC,WAAK,EAAE;AACvB,IAAA,MAAM,WAAW,GAAGC,qBAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,EAAE,YAAY,IAAI,OAAO,CAAC;;IAErF,MAAM,QAAQ,GAAG,CAAC,IAAuB,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;;AAEpF,IAAA,MAAM,IAAI,GAAG,CAAC,KAAiC,KAAI;QACjD,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC;AAAE,YAAA,MAAM,EAAE;AAClE,IAAA,CAAC;IAED;;AAEE,IAAAC,eAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAC,8BAA8B,EAAA,QAAA,EAAA,CACxEC,eAACC,aAAM,EAAA,EAAA,GACD,WAAW,EACf,QAAQ,EAAE,QAAQ;;gBAElB,IAAI,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI;;AAErC,gBAAA,KAAK,EAAE,KAAK,IAAI,QAAQ,EACxB,QAAQ,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAC3C,WAAW,EAAE,CAAC,IAAI,KAAK,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAA,kBAAA,EAC7B,WAAW,EAC7B,SAAS,EAAE,SAAS;;gBAEpB,UAAU,EAAE,WAAW,CAAC,UAAU,IAAI,UAAU,IAAI,QAAQ,EAAA,CAC5D,EACD,YAAY,KACXD,cAAA,CAACE,cAAQ,EAAA,EAAC,SAAS,EAAA,IAAA,EAAC,EAAE,EAAE,OAAO,EAAA,QAAA,EAC5B,YAAY,EAAA,CACJ,CACZ,CAAA,EAAA,CACG;AAEV;;"}
|
|
@@ -3,7 +3,10 @@ import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
|
3
3
|
export interface FormSliderProps<TValues extends FieldValues = FieldValues> extends Omit<SliderProps, 'name' | 'value' | 'defaultValue' | 'onChange' | 'onChangeEnd' | 'isInvalid'> {
|
|
4
4
|
/** The field's path in the form values, such as `discount` or `tip.percent`. */
|
|
5
5
|
name: FieldPath<TValues>;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Other fields to re-validate when this changes. A `crossFieldRules` rule validated through `useSchemaResolver` names them
|
|
8
|
+
* itself, so pass this only for a rule written another way, such as a zod `superRefine` in the same schema, or for a nested field.
|
|
9
|
+
*/
|
|
7
10
|
revalidates?: FieldPath<TValues> | FieldPath<TValues>[];
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormSlider/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAExF,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9D,MAAM,WAAW,eAAe,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CACxE,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,aAAa,GAAG,WAAW,CAAC;IACvG,gFAAgF;IAChF,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormSlider/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,8CAA8C,CAAC;AAExF,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAK9D,MAAM,WAAW,eAAe,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CACxE,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,aAAa,GAAG,WAAW,CAAC;IACvG,gFAAgF;IAChF,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CACzD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,SAAS,WAAW,GAAG,WAAW,EAAE,uDAMnE,eAAe,CAAC,OAAO,CAAC,gCAqC1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormSlider/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormSlider/index.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AAqBA;;;;;;AAMG;MACU,UAAU,GAAG,CAA4C,EACpE,IAAI,EACJ,WAAW,EACX,QAAQ,GAAG,CAAC,EACZ,IAAI,EACJ,GAAG,WAAW,EACW,KAAI;IAC7B,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAkB,IAAI,EAAE,WAAW,CAAC;;IAEjJ,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC;AAC7C,IAAA,MAAM,OAAO,GAAG,KAAK,EAAE;AACvB,IAAA,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,EAAE,YAAY,IAAI,OAAO,CAAC;;IAErF,MAAM,QAAQ,GAAG,CAAC,IAAuB,MAAM,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;;AAEpF,IAAA,MAAM,IAAI,GAAG,CAAC,KAAiC,KAAI;QACjD,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC;AAAE,YAAA,MAAM,EAAE;AAClE,IAAA,CAAC;IAED;;AAEE,IAAAA,IAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAC,8BAA8B,EAAA,QAAA,EAAA,CACxEC,IAAC,MAAM,EAAA,EAAA,GACD,WAAW,EACf,QAAQ,EAAE,QAAQ;;gBAElB,IAAI,EAAE,YAAY,GAAG,SAAS,GAAG,IAAI;;AAErC,gBAAA,KAAK,EAAE,KAAK,IAAI,QAAQ,EACxB,QAAQ,EAAE,CAAC,IAAI,KAAK,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAC3C,WAAW,EAAE,CAAC,IAAI,KAAK,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAA,kBAAA,EAC7B,WAAW,EAC7B,SAAS,EAAE,SAAS;;gBAEpB,UAAU,EAAE,WAAW,CAAC,UAAU,IAAI,UAAU,IAAI,QAAQ,EAAA,CAC5D,EACD,YAAY,KACXA,GAAA,CAAC,QAAQ,EAAA,EAAC,SAAS,EAAA,IAAA,EAAC,EAAE,EAAE,OAAO,EAAA,QAAA,EAC5B,YAAY,EAAA,CACJ,CACZ,CAAA,EAAA,CACG;AAEV;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormTextArea/index.tsx"],"sourcesContent":[null],"names":["useFormField","_jsx","TextArea"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormTextArea/index.tsx"],"sourcesContent":[null],"names":["useFormField","_jsx","TextArea"],"mappings":";;;;;;AAiBA;;;;;AAKG;AACI,MAAM,YAAY,GAAG,CAA4C,EACtE,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,GAAG,aAAa,EACW,KAAI;IAC/B,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAGA,yBAAY,CAAkB,IAAI,EAAE,WAAW,CAAC;IAExI,QACEC,eAACC;;;;AAEC,QAAA,kBAAkB,EAAC,MAAM,EAAA,GACrB,aAAa,EACjB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,GAAG,EAChB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM;;QAEd,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,YAAY,IAAI,IAAI,EAC1B,UAAU,EAAE,aAAa,CAAC,UAAU,IAAI,UAAU;;QAElD,UAAU,EAAE,aAAa,CAAC,UAAU,IAAI,QAAQ,EAAA,CAChD;AAEN;;"}
|
|
@@ -3,7 +3,10 @@ import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
|
3
3
|
export interface FormTextAreaProps<TValues extends FieldValues = FieldValues> extends Omit<TextFieldProps, 'name' | 'value' | 'defaultValue' | 'onChange' | 'onBlur' | 'isInvalid' | 'ref' | 'textAreaRef'> {
|
|
4
4
|
/** The field's path in the form values, such as `notes` or `address.line2`. */
|
|
5
5
|
name: FieldPath<TValues>;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Other fields to re-validate when this changes. A `crossFieldRules` rule validated through `useSchemaResolver` names them
|
|
8
|
+
* itself, so pass this only for a rule written another way, such as a zod `superRefine` in the same schema, or for a nested field.
|
|
9
|
+
*/
|
|
7
10
|
revalidates?: FieldPath<TValues> | FieldPath<TValues>[];
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormTextArea/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9D,MAAM,WAAW,iBAAiB,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CAC1E,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,GAAG,aAAa,CAAC;IAC7H,+EAA+E;IAC/E,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormTextArea/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,oDAAoD,CAAC;AACnG,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9D,MAAM,WAAW,iBAAiB,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CAC1E,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,GAAG,aAAa,CAAC;IAC7H,+EAA+E;IAC/E,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CACzD;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,SAAS,WAAW,GAAG,WAAW,EAAE,+CAKrE,iBAAiB,CAAC,OAAO,CAAC,gCAqB5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormTextArea/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormTextArea/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;AAiBA;;;;;AAKG;AACI,MAAM,YAAY,GAAG,CAA4C,EACtE,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,GAAG,aAAa,EACW,KAAI;IAC/B,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAkB,IAAI,EAAE,WAAW,CAAC;IAExI,QACEA,IAAC;;;;AAEC,QAAA,kBAAkB,EAAC,MAAM,EAAA,GACrB,aAAa,EACjB,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,GAAG,EAChB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM;;QAEd,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,YAAY,IAAI,IAAI,EAC1B,UAAU,EAAE,aAAa,CAAC,UAAU,IAAI,UAAU;;QAElD,UAAU,EAAE,aAAa,CAAC,UAAU,IAAI,QAAQ,EAAA,CAChD;AAEN;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormToggle/index.tsx"],"sourcesContent":[null],"names":["useFormField","useFocusTarget","_jsx","Toggle"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../src/components/forms/fields/FormToggle/index.tsx"],"sourcesContent":[null],"names":["useFormField","useFocusTarget","_jsx","Toggle"],"mappings":";;;;;;;AAkBA;;;;;AAKG;AACI,MAAM,UAAU,GAAG,CAA4C,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,WAAW,EAA4B,KAAI;IAC7I,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAGA,yBAAY,CAAmB,IAAI,EAAE,WAAW,CAAC;;AAEzI,IAAA,MAAM,YAAY,GAAG,EAAE,SAAS,EAA0B;;IAE1D,MAAM,QAAQ,GAAGC,6BAAc,CAAC,GAAG,EAAE,OAAO,CAAC;AAE7C,IAAA,QACEC,cAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,UAAU,YACtCA,cAAA,CAACC,aAAM,OACD,WAAW,EAAA,GACX,YAAY,EAChB,IAAI,EAAE,IAAI;;AAEV,YAAA,UAAU,EAAE,KAAK,IAAI,KAAK,EAC1B,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,WAAW,CAAC,UAAU,IAAI,UAAU;;AAEhD,YAAA,UAAU,EAAE,WAAW,CAAC,UAAU,IAAI,QAAQ;;AAE9C,YAAA,IAAI,EACF,YAAY;;YAEVD,cAAA,CAAA,MAAA,EAAA,EAAM,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,oBAAoB,YAC9C,YAAY,EAAA,CACR,KAEP,IAAI,CACL,EAAA,CAEH,EAAA,CACE;AAEV;;"}
|
|
@@ -3,7 +3,10 @@ import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
|
3
3
|
export interface FormToggleProps<TValues extends FieldValues = FieldValues> extends Omit<ToggleProps, 'name' | 'isSelected' | 'defaultSelected' | 'onChange' | 'onBlur' | 'ref'> {
|
|
4
4
|
/** The field's path in the form values, such as `isPublished` or `notifications.email`. */
|
|
5
5
|
name: FieldPath<TValues>;
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Other fields to re-validate when this changes. A `crossFieldRules` rule validated through `useSchemaResolver` names them
|
|
8
|
+
* itself, so pass this only for a rule written another way, such as a zod `superRefine` in the same schema, or for a nested field.
|
|
9
|
+
*/
|
|
7
10
|
revalidates?: FieldPath<TValues> | FieldPath<TValues>[];
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormToggle/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9D,MAAM,WAAW,eAAe,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CACxE,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,GAAG,iBAAiB,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;IACpG,2FAA2F;IAC3F,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormToggle/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9D,MAAM,WAAW,eAAe,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CACxE,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,GAAG,iBAAiB,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;IACpG,2FAA2F;IAC3F,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CACzD;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO,SAAS,WAAW,GAAG,WAAW,EAAE,6CAA6C,eAAe,CAAC,OAAO,CAAC,gCAkC1I,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormToggle/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../src/components/forms/fields/FormToggle/index.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;AAkBA;;;;;AAKG;AACI,MAAM,UAAU,GAAG,CAA4C,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,WAAW,EAA4B,KAAI;IAC7I,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAmB,IAAI,EAAE,WAAW,CAAC;;AAEzI,IAAA,MAAM,YAAY,GAAG,EAAE,SAAS,EAA0B;;IAE1D,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC;AAE7C,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,UAAU,YACtCA,GAAA,CAAC,MAAM,OACD,WAAW,EAAA,GACX,YAAY,EAChB,IAAI,EAAE,IAAI;;AAEV,YAAA,UAAU,EAAE,KAAK,IAAI,KAAK,EAC1B,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,WAAW,CAAC,UAAU,IAAI,UAAU;;AAEhD,YAAA,UAAU,EAAE,WAAW,CAAC,UAAU,IAAI,QAAQ;;AAE9C,YAAA,IAAI,EACF,YAAY;;YAEVA,GAAA,CAAA,MAAA,EAAA,EAAM,IAAI,EAAC,OAAO,EAAC,SAAS,EAAC,oBAAoB,YAC9C,YAAY,EAAA,CACR,KAEP,IAAI,CACL,EAAA,CAEH,EAAA,CACE;AAEV;;"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var resolvers = require('@hookform/resolvers');
|
|
4
4
|
var React = require('react');
|
|
5
|
+
var fieldDependents_utils = require('../../__internal__/formField/utilities/fieldDependents.utils.cjs');
|
|
5
6
|
var validation_utils = require('../utilities/validation.utils.cjs');
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -12,12 +13,13 @@ var validation_utils = require('../utilities/validation.utils.cjs');
|
|
|
12
13
|
* @param schema The form's zod schema.
|
|
13
14
|
* @param translate The app's translation function, called with a message and the values for its placeholders. Without
|
|
14
15
|
* one a message is shown as written, with its `{name}` placeholders filled.
|
|
15
|
-
* @returns The `resolver` for `useForm`. A field shows the message of the first rule it breaks
|
|
16
|
+
* @returns The `resolver` for `useForm`. A field shows the message of the first rule it breaks, and the `Form*` fields
|
|
17
|
+
* read from it which fields the schema's `crossFieldRules` tie together.
|
|
16
18
|
*/
|
|
17
19
|
const useSchemaResolver = (schema, translate) => React.useMemo(() => {
|
|
18
20
|
// An app's `translate` often takes only its own keys; a message it does not know comes back as written.
|
|
19
21
|
const toText = validation_utils.messageText(translate);
|
|
20
|
-
|
|
22
|
+
const resolver = async (values, _context, options) => {
|
|
21
23
|
const result = await schema.safeParseAsync(values);
|
|
22
24
|
if (result.success) {
|
|
23
25
|
// Clears the message a failed parse left on each input, or the browser goes on calling a corrected field invalid.
|
|
@@ -33,6 +35,9 @@ const useSchemaResolver = (schema, translate) => React.useMemo(() => {
|
|
|
33
35
|
}
|
|
34
36
|
return { values: {}, errors: resolvers.toNestErrors(errors, options) };
|
|
35
37
|
};
|
|
38
|
+
// The form holds this resolver and never the schema, so the fields read which of them a rule ties together from here.
|
|
39
|
+
fieldDependents_utils.recordDependents(resolver, validation_utils.crossFieldDependentsOf(schema));
|
|
40
|
+
return resolver;
|
|
36
41
|
}, [schema, translate]);
|
|
37
42
|
|
|
38
43
|
exports.useSchemaResolver = useSchemaResolver;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSchemaResolver.cjs","sources":["../../../../../src/components/forms/validation/hooks/useSchemaResolver.ts"],"sourcesContent":[null],"names":["useMemo","messageText","validateFieldsNatively","valuesOf","toNestErrors"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSchemaResolver.cjs","sources":["../../../../../src/components/forms/validation/hooks/useSchemaResolver.ts"],"sourcesContent":[null],"names":["useMemo","messageText","validateFieldsNatively","valuesOf","toNestErrors","recordDependents","crossFieldDependentsOf"],"mappings":";;;;;;;AAQA;;;;;;;;;;AAUG;AACI,MAAM,iBAAiB,GAAG,CAC/B,MAAe,EACf,SAAyD,KAEzDA,aAAO,CAAC,MAAK;;AAEX,IAAA,MAAM,MAAM,GAAGC,4BAAW,CAAC,SAAkC,CAAC;IAE9D,MAAM,QAAQ,GAA2D,OAAO,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAI;QAC3G,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC;AAClD,QAAA,IAAI,MAAM,CAAC,OAAO,EAAE;;YAElB,IAAI,OAAO,CAAC,yBAAyB;AAAE,gBAAAC,gCAAsB,CAAC,EAAE,EAAE,OAAO,CAAC;YAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5C;;QAGA,MAAM,MAAM,GAA+B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;QAC9D,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE;YACvC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AACjC,YAAA,MAAM,CAAC,IAAI,CAAA,KAAX,MAAM,CAAC,IAAI,CAAA,GAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAEC,yBAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAA;QACxF;AACA,QAAA,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAEC,sBAAY,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;AAC9D,IAAA,CAAC;;IAEDC,sCAAgB,CAAC,QAAQ,EAAEC,uCAAsB,CAAC,MAAM,CAAC,CAAC;AAC1D,IAAA,OAAO,QAAQ;AACjB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;;"}
|
|
@@ -9,7 +9,8 @@ import type { MessageValues } from '../validation.types';
|
|
|
9
9
|
* @param schema The form's zod schema.
|
|
10
10
|
* @param translate The app's translation function, called with a message and the values for its placeholders. Without
|
|
11
11
|
* one a message is shown as written, with its `{name}` placeholders filled.
|
|
12
|
-
* @returns The `resolver` for `useForm`. A field shows the message of the first rule it breaks
|
|
12
|
+
* @returns The `resolver` for `useForm`. A field shows the message of the first rule it breaks, and the `Form*` fields
|
|
13
|
+
* read from it which fields the schema's `crossFieldRules` tie together.
|
|
13
14
|
*/
|
|
14
15
|
export declare const useSchemaResolver: <TSchema extends z.ZodType<FieldValues, FieldValues>, TKey extends string = string>(schema: TSchema, translate?: (key: TKey, values?: MessageValues) => string) => Resolver<z.input<TSchema>, unknown, z.output<TSchema>>;
|
|
15
16
|
//# sourceMappingURL=useSchemaResolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSchemaResolver.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/validation/hooks/useSchemaResolver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAc,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"useSchemaResolver.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/validation/hooks/useSchemaResolver.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAc,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,qBAAqB,CAAC;AAEpE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,SAAS,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,IAAI,SAAS,MAAM,GAAG,MAAM,EACjH,QAAQ,OAAO,EACf,YAAY,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,aAAa,KAAK,MAAM,KACxD,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAwB/B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { validateFieldsNatively, toNestErrors } from '@hookform/resolvers';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { recordDependents } from '../../__internal__/formField/utilities/fieldDependents.utils.js';
|
|
4
|
+
import { crossFieldDependentsOf, valuesOf, messageText } from '../utilities/validation.utils.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Validates a form with its zod schema and shows each rule's message as text: the message goes through the app's
|
|
@@ -10,12 +11,13 @@ import { valuesOf, messageText } from '../utilities/validation.utils.js';
|
|
|
10
11
|
* @param schema The form's zod schema.
|
|
11
12
|
* @param translate The app's translation function, called with a message and the values for its placeholders. Without
|
|
12
13
|
* one a message is shown as written, with its `{name}` placeholders filled.
|
|
13
|
-
* @returns The `resolver` for `useForm`. A field shows the message of the first rule it breaks
|
|
14
|
+
* @returns The `resolver` for `useForm`. A field shows the message of the first rule it breaks, and the `Form*` fields
|
|
15
|
+
* read from it which fields the schema's `crossFieldRules` tie together.
|
|
14
16
|
*/
|
|
15
17
|
const useSchemaResolver = (schema, translate) => useMemo(() => {
|
|
16
18
|
// An app's `translate` often takes only its own keys; a message it does not know comes back as written.
|
|
17
19
|
const toText = messageText(translate);
|
|
18
|
-
|
|
20
|
+
const resolver = async (values, _context, options) => {
|
|
19
21
|
const result = await schema.safeParseAsync(values);
|
|
20
22
|
if (result.success) {
|
|
21
23
|
// Clears the message a failed parse left on each input, or the browser goes on calling a corrected field invalid.
|
|
@@ -31,6 +33,9 @@ const useSchemaResolver = (schema, translate) => useMemo(() => {
|
|
|
31
33
|
}
|
|
32
34
|
return { values: {}, errors: toNestErrors(errors, options) };
|
|
33
35
|
};
|
|
36
|
+
// The form holds this resolver and never the schema, so the fields read which of them a rule ties together from here.
|
|
37
|
+
recordDependents(resolver, crossFieldDependentsOf(schema));
|
|
38
|
+
return resolver;
|
|
34
39
|
}, [schema, translate]);
|
|
35
40
|
|
|
36
41
|
export { useSchemaResolver };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSchemaResolver.js","sources":["../../../../../src/components/forms/validation/hooks/useSchemaResolver.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSchemaResolver.js","sources":["../../../../../src/components/forms/validation/hooks/useSchemaResolver.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAQA;;;;;;;;;;AAUG;AACI,MAAM,iBAAiB,GAAG,CAC/B,MAAe,EACf,SAAyD,KAEzD,OAAO,CAAC,MAAK;;AAEX,IAAA,MAAM,MAAM,GAAG,WAAW,CAAC,SAAkC,CAAC;IAE9D,MAAM,QAAQ,GAA2D,OAAO,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAI;QAC3G,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC;AAClD,QAAA,IAAI,MAAM,CAAC,OAAO,EAAE;;YAElB,IAAI,OAAO,CAAC,yBAAyB;AAAE,gBAAA,sBAAsB,CAAC,EAAE,EAAE,OAAO,CAAC;YAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5C;;QAGA,MAAM,MAAM,GAA+B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;QAC9D,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE;YACvC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AACjC,YAAA,MAAM,CAAC,IAAI,CAAA,KAAX,MAAM,CAAC,IAAI,CAAA,GAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAA;QACxF;AACA,QAAA,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;AAC9D,IAAA,CAAC;;IAED,gBAAgB,CAAC,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAC1D,IAAA,OAAO,QAAQ;AACjB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC;;"}
|