@jobber/components 6.5.4-MIKEpull--7d365c4.31 → 6.5.4
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/FormField/FormFieldTypes.d.ts +4 -1
- package/dist/FormField/hooks/useAtlantisReactHookForm.d.ts +2 -2
- package/dist/FormField/index.cjs +1 -1
- package/dist/FormField/index.d.ts +1 -1
- package/dist/FormField/index.mjs +1 -1
- package/dist/FormField-cjs.js +3 -3
- package/dist/FormField-es.js +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
|
@@ -85,7 +85,10 @@ export interface CommonFormFieldProps {
|
|
|
85
85
|
*/
|
|
86
86
|
readonly clearable?: Clearable;
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* Experimental:
|
|
89
|
+
* Determine which version of the FormField to use.
|
|
90
|
+
* Right now this isn't used but it will be used in the future
|
|
91
|
+
* to allow us to release new versions of our form inputs without breaking existing functionality
|
|
89
92
|
*/
|
|
90
93
|
version?: 1;
|
|
91
94
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FormFieldProps } from "../FormFieldTypes";
|
|
2
|
-
interface
|
|
2
|
+
interface useAtlantisReactHookFormProps extends Pick<FormFieldProps, "actionsRef" | "defaultValue" | "value" | "validations" | "inputRef"> {
|
|
3
3
|
name: string;
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
6
|
* Hook used to manage the form state of a field through react-hook-form
|
|
7
7
|
*/
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function useAtlantisReactHookForm({ actionsRef, name, defaultValue, value, validations, inputRef, }: useAtlantisReactHookFormProps): {
|
|
9
9
|
inputRefs: import("react").RefCallback<any>;
|
|
10
10
|
useControllerField: {
|
|
11
11
|
value: any;
|
package/dist/FormField/index.cjs
CHANGED
|
@@ -23,5 +23,5 @@ exports.FormFieldWrapper = FormField.FormFieldWrapper;
|
|
|
23
23
|
exports.useAtlantisFormField = FormField.useAtlantisFormField;
|
|
24
24
|
exports.useAtlantisFormFieldActions = FormField.useAtlantisFormFieldActions;
|
|
25
25
|
exports.useAtlantisFormFieldName = FormField.useAtlantisFormFieldName;
|
|
26
|
-
exports.
|
|
26
|
+
exports.useAtlantisReactHookForm = FormField.useAtlantisReactHookForm;
|
|
27
27
|
exports.useFormFieldWrapperStyles = FormField.useFormFieldWrapperStyles;
|
|
@@ -3,6 +3,6 @@ export * from "./FormFieldTypes";
|
|
|
3
3
|
export { useAtlantisFormField } from "./hooks/useAtlantisFormField";
|
|
4
4
|
export { useAtlantisFormFieldActions } from "./hooks/useAtlantisFormFieldActions";
|
|
5
5
|
export { useAtlantisFormFieldName } from "./hooks/useAtlantisFormFieldName";
|
|
6
|
-
export {
|
|
6
|
+
export { useAtlantisReactHookForm } from "./hooks/useAtlantisReactHookForm";
|
|
7
7
|
export { FormFieldWrapper } from "./FormFieldWrapper";
|
|
8
8
|
export { useFormFieldWrapperStyles, useFormFieldWrapperStylesProps, } from "./hooks/useFormFieldWrapperStyles";
|
package/dist/FormField/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { e as FormField, F as FormFieldWrapper, u as useAtlantisFormField, a as useAtlantisFormFieldActions, b as useAtlantisFormFieldName, c as
|
|
1
|
+
export { e as FormField, F as FormFieldWrapper, u as useAtlantisFormField, a as useAtlantisFormFieldActions, b as useAtlantisFormFieldName, c as useAtlantisReactHookForm, d as useFormFieldWrapperStyles } from '../FormField-es.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'framer-motion';
|
|
4
4
|
import '@jobber/design';
|
package/dist/FormField-cjs.js
CHANGED
|
@@ -339,7 +339,7 @@ function mergeRefs(refs) {
|
|
|
339
339
|
/**
|
|
340
340
|
* Hook used to manage the form state of a field through react-hook-form
|
|
341
341
|
*/
|
|
342
|
-
function
|
|
342
|
+
function useAtlantisReactHookForm({ actionsRef, name, defaultValue, value, validations, inputRef, }) {
|
|
343
343
|
var _a;
|
|
344
344
|
const formContext = reactHookForm.useFormContext();
|
|
345
345
|
// If there isn't a Form Context being provided, get a form for this field.
|
|
@@ -382,7 +382,7 @@ function FormField(props) {
|
|
|
382
382
|
function FormFieldInternal(props) {
|
|
383
383
|
const { actionsRef, autocomplete = true, children, defaultValue, description, disabled, id, inputRef, inline, keyboard, max, maxLength, min, name: nameProp, readonly, rows, loading, type = "text", validations, value, onChange, onEnter, onFocus, onBlur, onValidation, onKeyUp, clearable = "never", autofocus, } = props;
|
|
384
384
|
const { name } = useAtlantisFormFieldName({ id, nameProp });
|
|
385
|
-
const { errorMessage, inputRefs, useControllerField, setValue, onControllerBlur, onControllerChange, } =
|
|
385
|
+
const { errorMessage, inputRefs, useControllerField, setValue, onControllerBlur, onControllerChange, } = useAtlantisReactHookForm({
|
|
386
386
|
actionsRef,
|
|
387
387
|
name,
|
|
388
388
|
defaultValue,
|
|
@@ -455,5 +455,5 @@ exports.FormFieldWrapper = FormFieldWrapper;
|
|
|
455
455
|
exports.useAtlantisFormField = useAtlantisFormField;
|
|
456
456
|
exports.useAtlantisFormFieldActions = useAtlantisFormFieldActions;
|
|
457
457
|
exports.useAtlantisFormFieldName = useAtlantisFormFieldName;
|
|
458
|
-
exports.
|
|
458
|
+
exports.useAtlantisReactHookForm = useAtlantisReactHookForm;
|
|
459
459
|
exports.useFormFieldWrapperStyles = useFormFieldWrapperStyles;
|
package/dist/FormField-es.js
CHANGED
|
@@ -337,7 +337,7 @@ function mergeRefs(refs) {
|
|
|
337
337
|
/**
|
|
338
338
|
* Hook used to manage the form state of a field through react-hook-form
|
|
339
339
|
*/
|
|
340
|
-
function
|
|
340
|
+
function useAtlantisReactHookForm({ actionsRef, name, defaultValue, value, validations, inputRef, }) {
|
|
341
341
|
var _a;
|
|
342
342
|
const formContext = useFormContext();
|
|
343
343
|
// If there isn't a Form Context being provided, get a form for this field.
|
|
@@ -380,7 +380,7 @@ function FormField(props) {
|
|
|
380
380
|
function FormFieldInternal(props) {
|
|
381
381
|
const { actionsRef, autocomplete = true, children, defaultValue, description, disabled, id, inputRef, inline, keyboard, max, maxLength, min, name: nameProp, readonly, rows, loading, type = "text", validations, value, onChange, onEnter, onFocus, onBlur, onValidation, onKeyUp, clearable = "never", autofocus, } = props;
|
|
382
382
|
const { name } = useAtlantisFormFieldName({ id, nameProp });
|
|
383
|
-
const { errorMessage, inputRefs, useControllerField, setValue, onControllerBlur, onControllerChange, } =
|
|
383
|
+
const { errorMessage, inputRefs, useControllerField, setValue, onControllerBlur, onControllerChange, } = useAtlantisReactHookForm({
|
|
384
384
|
actionsRef,
|
|
385
385
|
name,
|
|
386
386
|
defaultValue,
|
|
@@ -448,4 +448,4 @@ function setAutocomplete(autocompleteSetting) {
|
|
|
448
448
|
return autocompleteSetting;
|
|
449
449
|
}
|
|
450
450
|
|
|
451
|
-
export { FormFieldWrapper as F, useAtlantisFormFieldActions as a, useAtlantisFormFieldName as b,
|
|
451
|
+
export { FormFieldWrapper as F, useAtlantisFormFieldActions as a, useAtlantisFormFieldName as b, useAtlantisReactHookForm as c, useFormFieldWrapperStyles as d, FormField as e, useAtlantisFormField as u };
|
package/dist/index.cjs
CHANGED
|
@@ -226,7 +226,7 @@ exports.FormFieldWrapper = FormField.FormFieldWrapper;
|
|
|
226
226
|
exports.useAtlantisFormField = FormField.useAtlantisFormField;
|
|
227
227
|
exports.useAtlantisFormFieldActions = FormField.useAtlantisFormFieldActions;
|
|
228
228
|
exports.useAtlantisFormFieldName = FormField.useAtlantisFormFieldName;
|
|
229
|
-
exports.
|
|
229
|
+
exports.useAtlantisReactHookForm = FormField.useAtlantisReactHookForm;
|
|
230
230
|
exports.useFormFieldWrapperStyles = FormField.useFormFieldWrapperStyles;
|
|
231
231
|
exports.FormatDate = FormatDate.FormatDate;
|
|
232
232
|
exports.strFormatDate = FormatDate.strFormatDate;
|
package/dist/index.mjs
CHANGED
|
@@ -35,7 +35,7 @@ export { E as Emphasis } from './Emphasis-es.js';
|
|
|
35
35
|
export { F as FeatureSwitch } from './FeatureSwitch-es.js';
|
|
36
36
|
export { F as Flex } from './Flex-es.js';
|
|
37
37
|
export { F as Form } from './Form-es.js';
|
|
38
|
-
export { e as FormField, F as FormFieldWrapper, u as useAtlantisFormField, a as useAtlantisFormFieldActions, b as useAtlantisFormFieldName, c as
|
|
38
|
+
export { e as FormField, F as FormFieldWrapper, u as useAtlantisFormField, a as useAtlantisFormFieldActions, b as useAtlantisFormFieldName, c as useAtlantisReactHookForm, d as useFormFieldWrapperStyles } from './FormField-es.js';
|
|
39
39
|
export { F as FormatDate, s as strFormatDate } from './FormatDate-es.js';
|
|
40
40
|
export { F as FormatEmail } from './FormatEmail-es.js';
|
|
41
41
|
export { F as FormatFile } from './FormatFile-es.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.5.4
|
|
3
|
+
"version": "6.5.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -487,5 +487,5 @@
|
|
|
487
487
|
"> 1%",
|
|
488
488
|
"IE 10"
|
|
489
489
|
],
|
|
490
|
-
"gitHead": "
|
|
490
|
+
"gitHead": "d54ef0a961372b9bd79eb11feaae6850ccf1b3a0"
|
|
491
491
|
}
|