@jobber/components 6.104.0 → 6.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Autocomplete/Autocomplete.types.d.ts +9 -51
- package/dist/Autocomplete/index.cjs +10 -20
- package/dist/Autocomplete/index.mjs +10 -20
- package/dist/Autocomplete/tests/Autocomplete.setup.d.ts +1 -1
- package/dist/Autocomplete/useAutocomplete.d.ts +2 -2
- package/dist/Checkbox/Checkbox.rebuilt.d.ts +2 -2
- package/dist/Checkbox/Checkbox.types.d.ts +24 -18
- package/dist/Checkbox/index.cjs +9 -2
- package/dist/Checkbox/index.mjs +9 -2
- package/dist/Chips/InternalChipDismissible/hooks/index.cjs +2 -2
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +2 -2
- package/dist/Chips/InternalChipDismissible/index.cjs +2 -2
- package/dist/Chips/InternalChipDismissible/index.mjs +2 -2
- package/dist/Chips/index.cjs +2 -2
- package/dist/Chips/index.mjs +2 -2
- package/dist/DataList/components/DataListHeader/index.cjs +1 -0
- package/dist/DataList/components/DataListHeader/index.mjs +1 -0
- package/dist/DataList/components/DataListItem/index.cjs +1 -0
- package/dist/DataList/components/DataListItem/index.mjs +1 -0
- package/dist/DataList/components/DataListItems/index.cjs +1 -0
- package/dist/DataList/components/DataListItems/index.mjs +1 -0
- package/dist/DataList/components/DataListLayout/index.cjs +1 -0
- package/dist/DataList/components/DataListLayout/index.mjs +1 -0
- package/dist/DataList/components/DataListSearch/index.cjs +2 -12
- package/dist/DataList/components/DataListSearch/index.mjs +2 -12
- package/dist/DataList/index.cjs +1 -8
- package/dist/DataList/index.mjs +1 -8
- package/dist/DataTable/index.cjs +3 -2
- package/dist/DataTable/index.mjs +3 -2
- package/dist/DatePicker/index.cjs +2 -2
- package/dist/DatePicker/index.mjs +2 -2
- package/dist/FormField/FormFieldTypes.d.ts +0 -2
- package/dist/FormField/hooks/useFormFieldWrapperStyles.d.ts +7 -2
- package/dist/FormField-cjs.js +0 -1
- package/dist/FormField-es.js +1 -1
- package/dist/InputDate/InputDate.types.d.ts +12 -7
- package/dist/InputDate/index.cjs +6 -9
- package/dist/InputDate/index.mjs +6 -9
- package/dist/InputDate/useInputDateActivatorActions.d.ts +4 -8
- package/dist/InputEmail/InputEmail.types.d.ts +10 -20
- package/dist/InputEmail/hooks/useInputEmailActions.d.ts +10 -4
- package/dist/InputEmail/index.cjs +43 -49
- package/dist/InputEmail/index.mjs +43 -49
- package/dist/InputNumber/InputNumber.rebuilt.types.d.ts +7 -15
- package/dist/InputNumber/index.cjs +6 -4
- package/dist/InputNumber/index.mjs +6 -4
- package/dist/InputPhoneNumber/InputPhoneNumber.types.d.ts +12 -28
- package/dist/InputPhoneNumber/hooks/useInputPhoneActions.d.ts +9 -4
- package/dist/InputPhoneNumber/index.cjs +48 -36
- package/dist/InputPhoneNumber/index.mjs +48 -36
- package/dist/InputText/InputText.types.d.ts +31 -25
- package/dist/InputText/index.cjs +66 -62
- package/dist/InputText/index.mjs +67 -63
- package/dist/InputText/useInputTextActions.d.ts +10 -4
- package/dist/InputTime/InputTime.rebuilt.d.ts +1 -1
- package/dist/InputTime/InputTime.types.d.ts +13 -4
- package/dist/InputTime/hooks/useInputTimeActions.d.ts +21 -0
- package/dist/InputTime/index.cjs +91 -30
- package/dist/InputTime/index.mjs +94 -33
- package/dist/List/index.cjs +2 -2
- package/dist/List/index.mjs +2 -2
- package/dist/MultiSelect/index.cjs +1 -0
- package/dist/MultiSelect/index.mjs +1 -0
- package/dist/RecurringSelect/index.cjs +3 -2
- package/dist/RecurringSelect/index.mjs +3 -2
- package/dist/Select/Select.types.d.ts +7 -3
- package/dist/Select/hooks/useSelectActions.d.ts +5 -5
- package/dist/Select/index.cjs +27 -41
- package/dist/Select/index.mjs +29 -43
- package/dist/Tabs-es.js +1 -1
- package/dist/_baseEach-cjs.js +12 -12
- package/dist/_baseEach-es.js +1 -1
- package/dist/_baseFlatten-cjs.js +2 -2
- package/dist/_baseFlatten-es.js +1 -1
- package/dist/{_baseGet-cjs.js → _getAllKeys-cjs.js} +181 -181
- package/dist/{_baseGet-es.js → _getAllKeys-es.js} +182 -182
- package/dist/debounce-es.js +1 -1
- package/dist/filterDataAttributes-cjs.js +26 -0
- package/dist/filterDataAttributes-es.js +24 -0
- package/dist/index.cjs +3 -2
- package/dist/index.mjs +3 -2
- package/dist/omit-cjs.js +14 -14
- package/dist/omit-es.js +1 -1
- package/dist/sharedHelpers/filterDataAttributes.d.ts +17 -0
- package/dist/sharedHelpers/types.d.ts +231 -0
- package/dist/useScrollToActive-cjs.js +3 -3
- package/dist/useScrollToActive-es.js +2 -2
- package/package.json +2 -2
- package/dist/InputEmail/hooks/useInputEmailFormField.d.ts +0 -32
- package/dist/InputPhoneNumber/hooks/useInputPhoneFormField.d.ts +0 -71
- package/dist/InputText/useInputTextFormField.d.ts +0 -366
- package/dist/Select/hooks/useSelectFormField.d.ts +0 -34
|
@@ -18,20 +18,10 @@ require('../../../useFormFieldFocus-cjs.js');
|
|
|
18
18
|
require('../../../InputValidation-cjs.js');
|
|
19
19
|
require('../../../Spinner-cjs.js');
|
|
20
20
|
require('react-hook-form');
|
|
21
|
-
require('../../../
|
|
22
|
-
require('../../../_commonjsHelpers-cjs.js');
|
|
23
|
-
require('../../../_baseGet-cjs.js');
|
|
24
|
-
require('../../../isTypedArray-cjs.js');
|
|
25
|
-
require('../../../isObjectLike-cjs.js');
|
|
26
|
-
require('../../../identity-cjs.js');
|
|
27
|
-
require('../../../_getTag-cjs.js');
|
|
28
|
-
require('../../../isSymbol-cjs.js');
|
|
29
|
-
require('../../../keysIn-cjs.js');
|
|
30
|
-
require('../../../_baseAssignValue-cjs.js');
|
|
31
|
-
require('../../../_baseFlatten-cjs.js');
|
|
32
|
-
require('../../../_setToString-cjs.js');
|
|
21
|
+
require('../../../filterDataAttributes-cjs.js');
|
|
33
22
|
require('../../../DataListContext-cjs.js');
|
|
34
23
|
require('../../../noop-cjs.js');
|
|
24
|
+
require('../../../_commonjsHelpers-cjs.js');
|
|
35
25
|
require('../../../DataList.const-cjs.js');
|
|
36
26
|
require('../../../AnimatedSwitcher-cjs.js');
|
|
37
27
|
|
|
@@ -16,19 +16,9 @@ import '../../../useFormFieldFocus-es.js';
|
|
|
16
16
|
import '../../../InputValidation-es.js';
|
|
17
17
|
import '../../../Spinner-es.js';
|
|
18
18
|
import 'react-hook-form';
|
|
19
|
-
import '../../../
|
|
20
|
-
import '../../../_commonjsHelpers-es.js';
|
|
21
|
-
import '../../../_baseGet-es.js';
|
|
22
|
-
import '../../../isTypedArray-es.js';
|
|
23
|
-
import '../../../isObjectLike-es.js';
|
|
24
|
-
import '../../../identity-es.js';
|
|
25
|
-
import '../../../_getTag-es.js';
|
|
26
|
-
import '../../../isSymbol-es.js';
|
|
27
|
-
import '../../../keysIn-es.js';
|
|
28
|
-
import '../../../_baseAssignValue-es.js';
|
|
29
|
-
import '../../../_baseFlatten-es.js';
|
|
30
|
-
import '../../../_setToString-es.js';
|
|
19
|
+
import '../../../filterDataAttributes-es.js';
|
|
31
20
|
import '../../../DataListContext-es.js';
|
|
32
21
|
import '../../../noop-es.js';
|
|
22
|
+
import '../../../_commonjsHelpers-es.js';
|
|
33
23
|
import '../../../DataList.const-es.js';
|
|
34
24
|
import '../../../AnimatedSwitcher-es.js';
|
package/dist/DataList/index.cjs
CHANGED
|
@@ -48,6 +48,7 @@ require('../DataListItemActionsOverflow-cjs.js');
|
|
|
48
48
|
require('../DataListActionsMenu-cjs.js');
|
|
49
49
|
require('../Checkbox/index.cjs');
|
|
50
50
|
require('react-hook-form');
|
|
51
|
+
require('../filterDataAttributes-cjs.js');
|
|
51
52
|
require('../useBatchSelect-cjs.js');
|
|
52
53
|
require('../DataListItemClickable-cjs.js');
|
|
53
54
|
require('../DataListHeader-cjs.js');
|
|
@@ -81,14 +82,6 @@ require('../InputText/index.cjs');
|
|
|
81
82
|
require('../FormField-cjs.js');
|
|
82
83
|
require('../useFormFieldFocus-cjs.js');
|
|
83
84
|
require('../InputValidation-cjs.js');
|
|
84
|
-
require('../omit-cjs.js');
|
|
85
|
-
require('../_baseGet-cjs.js');
|
|
86
|
-
require('../identity-cjs.js');
|
|
87
|
-
require('../isSymbol-cjs.js');
|
|
88
|
-
require('../keysIn-cjs.js');
|
|
89
|
-
require('../_baseAssignValue-cjs.js');
|
|
90
|
-
require('../_baseFlatten-cjs.js');
|
|
91
|
-
require('../_setToString-cjs.js');
|
|
92
85
|
require('../DataListEmptyState-cjs.js');
|
|
93
86
|
require('../DataListLoadMore-cjs.js');
|
|
94
87
|
require('../DataListAction-cjs.js');
|
package/dist/DataList/index.mjs
CHANGED
|
@@ -46,6 +46,7 @@ import '../DataListItemActionsOverflow-es.js';
|
|
|
46
46
|
import '../DataListActionsMenu-es.js';
|
|
47
47
|
import '../Checkbox/index.mjs';
|
|
48
48
|
import 'react-hook-form';
|
|
49
|
+
import '../filterDataAttributes-es.js';
|
|
49
50
|
import '../useBatchSelect-es.js';
|
|
50
51
|
import '../DataListItemClickable-es.js';
|
|
51
52
|
import '../DataListHeader-es.js';
|
|
@@ -79,14 +80,6 @@ import '../InputText/index.mjs';
|
|
|
79
80
|
import '../FormField-es.js';
|
|
80
81
|
import '../useFormFieldFocus-es.js';
|
|
81
82
|
import '../InputValidation-es.js';
|
|
82
|
-
import '../omit-es.js';
|
|
83
|
-
import '../_baseGet-es.js';
|
|
84
|
-
import '../identity-es.js';
|
|
85
|
-
import '../isSymbol-es.js';
|
|
86
|
-
import '../keysIn-es.js';
|
|
87
|
-
import '../_baseAssignValue-es.js';
|
|
88
|
-
import '../_baseFlatten-es.js';
|
|
89
|
-
import '../_setToString-es.js';
|
|
90
83
|
import '../DataListEmptyState-es.js';
|
|
91
84
|
import '../DataListLoadMore-es.js';
|
|
92
85
|
import '../DataListAction-es.js';
|
package/dist/DataTable/index.cjs
CHANGED
|
@@ -13,12 +13,12 @@ require('../Content-cjs.js');
|
|
|
13
13
|
require('../Select/index.cjs');
|
|
14
14
|
require('../omit-cjs.js');
|
|
15
15
|
require('../_commonjsHelpers-cjs.js');
|
|
16
|
-
require('../
|
|
16
|
+
require('../_getAllKeys-cjs.js');
|
|
17
17
|
require('../isTypedArray-cjs.js');
|
|
18
18
|
require('../isObjectLike-cjs.js');
|
|
19
|
+
require('../isSymbol-cjs.js');
|
|
19
20
|
require('../identity-cjs.js');
|
|
20
21
|
require('../_getTag-cjs.js');
|
|
21
|
-
require('../isSymbol-cjs.js');
|
|
22
22
|
require('../keysIn-cjs.js');
|
|
23
23
|
require('../_baseAssignValue-cjs.js');
|
|
24
24
|
require('../_baseFlatten-cjs.js');
|
|
@@ -35,6 +35,7 @@ require('../useFormFieldFocus-cjs.js');
|
|
|
35
35
|
require('../InputValidation-cjs.js');
|
|
36
36
|
require('../Spinner-cjs.js');
|
|
37
37
|
require('react-hook-form');
|
|
38
|
+
require('../filterDataAttributes-cjs.js');
|
|
38
39
|
|
|
39
40
|
|
|
40
41
|
|
package/dist/DataTable/index.mjs
CHANGED
|
@@ -11,12 +11,12 @@ import '../Content-es.js';
|
|
|
11
11
|
import '../Select/index.mjs';
|
|
12
12
|
import '../omit-es.js';
|
|
13
13
|
import '../_commonjsHelpers-es.js';
|
|
14
|
-
import '../
|
|
14
|
+
import '../_getAllKeys-es.js';
|
|
15
15
|
import '../isTypedArray-es.js';
|
|
16
16
|
import '../isObjectLike-es.js';
|
|
17
|
+
import '../isSymbol-es.js';
|
|
17
18
|
import '../identity-es.js';
|
|
18
19
|
import '../_getTag-es.js';
|
|
19
|
-
import '../isSymbol-es.js';
|
|
20
20
|
import '../keysIn-es.js';
|
|
21
21
|
import '../_baseAssignValue-es.js';
|
|
22
22
|
import '../_baseFlatten-es.js';
|
|
@@ -33,3 +33,4 @@ import '../useFormFieldFocus-es.js';
|
|
|
33
33
|
import '../InputValidation-es.js';
|
|
34
34
|
import '../Spinner-es.js';
|
|
35
35
|
import 'react-hook-form';
|
|
36
|
+
import '../filterDataAttributes-es.js';
|
|
@@ -16,12 +16,12 @@ require('../Icon-cjs.js');
|
|
|
16
16
|
require('@jobber/design');
|
|
17
17
|
require('../omit-cjs.js');
|
|
18
18
|
require('../_commonjsHelpers-cjs.js');
|
|
19
|
-
require('../
|
|
19
|
+
require('../_getAllKeys-cjs.js');
|
|
20
20
|
require('../isTypedArray-cjs.js');
|
|
21
21
|
require('../isObjectLike-cjs.js');
|
|
22
|
+
require('../isSymbol-cjs.js');
|
|
22
23
|
require('../identity-cjs.js');
|
|
23
24
|
require('../_getTag-cjs.js');
|
|
24
|
-
require('../isSymbol-cjs.js');
|
|
25
25
|
require('../keysIn-cjs.js');
|
|
26
26
|
require('../_baseAssignValue-cjs.js');
|
|
27
27
|
require('../_baseFlatten-cjs.js');
|
|
@@ -14,12 +14,12 @@ import '../Icon-es.js';
|
|
|
14
14
|
import '@jobber/design';
|
|
15
15
|
import '../omit-es.js';
|
|
16
16
|
import '../_commonjsHelpers-es.js';
|
|
17
|
-
import '../
|
|
17
|
+
import '../_getAllKeys-es.js';
|
|
18
18
|
import '../isTypedArray-es.js';
|
|
19
19
|
import '../isObjectLike-es.js';
|
|
20
|
+
import '../isSymbol-es.js';
|
|
20
21
|
import '../identity-es.js';
|
|
21
22
|
import '../_getTag-es.js';
|
|
22
|
-
import '../isSymbol-es.js';
|
|
23
23
|
import '../keysIn-es.js';
|
|
24
24
|
import '../_baseAssignValue-es.js';
|
|
25
25
|
import '../_baseFlatten-es.js';
|
|
@@ -158,8 +158,6 @@ export interface FormFieldProps extends CommonFormFieldProps {
|
|
|
158
158
|
*/
|
|
159
159
|
readonly suffix?: XOR<Affix, Suffix>;
|
|
160
160
|
/**
|
|
161
|
-
* Simplified onChange handler that only provides the new value.
|
|
162
|
-
* @param newValue
|
|
163
161
|
* Specifies the minimum numerical or date value that a user can type
|
|
164
162
|
*/
|
|
165
163
|
readonly min?: number;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { RefObject } from "react";
|
|
2
2
|
import type { FormFieldProps } from "../FormFieldTypes";
|
|
3
|
-
export interface useFormFieldWrapperStylesProps extends Pick<FormFieldProps, "size" | "align" | "placeholder" | "value" | "invalid" | "
|
|
3
|
+
export interface useFormFieldWrapperStylesProps extends Pick<FormFieldProps, "size" | "align" | "placeholder" | "value" | "invalid" | "maxLength" | "type" | "disabled" | "inline"> {
|
|
4
4
|
readonly error?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Maximum numerical or date value
|
|
7
|
+
* In v2 components, this is typically undefined.
|
|
8
|
+
*/
|
|
9
|
+
readonly max?: number | string;
|
|
5
10
|
suffixRef?: RefObject<HTMLDivElement | null>;
|
|
6
11
|
prefixRef?: RefObject<HTMLDivElement | null>;
|
|
7
12
|
showMiniLabel?: boolean;
|
|
@@ -18,7 +23,7 @@ export declare function useFormFieldWrapperStyles({ size, align, placeholder, va
|
|
|
18
23
|
wrapperClasses: string;
|
|
19
24
|
containerClasses: string;
|
|
20
25
|
wrapperInlineStyle: {
|
|
21
|
-
[x: string]: number | undefined;
|
|
26
|
+
[x: string]: string | number | undefined;
|
|
22
27
|
};
|
|
23
28
|
labelStyle: LabelPadding;
|
|
24
29
|
setLabelStyle: import("react").Dispatch<import("react").SetStateAction<LabelPadding>>;
|
package/dist/FormField-cjs.js
CHANGED
|
@@ -471,7 +471,6 @@ exports.FormFieldWrapper = FormFieldWrapper;
|
|
|
471
471
|
exports.FormFieldWrapperMain = FormFieldWrapperMain;
|
|
472
472
|
exports.FormFieldWrapperToolbar = FormFieldWrapperToolbar;
|
|
473
473
|
exports.mergeRefs = mergeRefs;
|
|
474
|
-
exports.styles = styles$1;
|
|
475
474
|
exports.useAtlantisFormField = useAtlantisFormField;
|
|
476
475
|
exports.useAtlantisFormFieldActions = useAtlantisFormFieldActions;
|
|
477
476
|
exports.useAtlantisFormFieldName = useAtlantisFormFieldName;
|
package/dist/FormField-es.js
CHANGED
|
@@ -458,4 +458,4 @@ function setAutocomplete(autocompleteSetting) {
|
|
|
458
458
|
return autocompleteSetting;
|
|
459
459
|
}
|
|
460
460
|
|
|
461
|
-
export { AffixIcon as A, FormFieldInputHorizontalWrapper as F, useAtlantisFormFieldActions as a, useAtlantisFormFieldName as b, useAtlantisReactHookForm as c, FormFieldInputWrapperStyles as d, FormFieldLabel as e, FormFieldWrapper as f, FormFieldWrapperMain as g, FormFieldWrapperToolbar as h, AffixLabel as i, useFormFieldWrapperStyles as j, FormField as k, FormFieldPostFix as l, mergeRefs as m,
|
|
461
|
+
export { AffixIcon as A, FormFieldInputHorizontalWrapper as F, useAtlantisFormFieldActions as a, useAtlantisFormFieldName as b, useAtlantisReactHookForm as c, FormFieldInputWrapperStyles as d, FormFieldLabel as e, FormFieldWrapper as f, FormFieldWrapperMain as g, FormFieldWrapperToolbar as h, AffixLabel as i, useFormFieldWrapperStyles as j, FormField as k, FormFieldPostFix as l, mergeRefs as m, useAtlantisFormField as u };
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import type { CommonFormFieldProps, FormFieldProps } from "../FormField";
|
|
2
|
-
import type {
|
|
3
|
-
export interface InputDateRebuiltProps extends
|
|
2
|
+
import type { FocusEvents, HTMLInputBaseProps, KeyboardEvents, RebuiltInputCommonProps } from "../sharedHelpers/types";
|
|
3
|
+
export interface InputDateRebuiltProps extends HTMLInputBaseProps, FocusEvents<HTMLInputElement | HTMLTextAreaElement>, KeyboardEvents<HTMLInputElement | HTMLTextAreaElement>, Omit<RebuiltInputCommonProps, "clearable" | "prefix" | "suffix"> {
|
|
4
4
|
/**
|
|
5
5
|
* A Date object value
|
|
6
6
|
* (e.g., `new Date("11/11/2011")`)
|
|
7
7
|
* */
|
|
8
8
|
readonly value?: Date;
|
|
9
|
+
/**
|
|
10
|
+
* Callback for value changes.
|
|
11
|
+
* @param newValue - The new Date value
|
|
12
|
+
* @param event - Optional change event
|
|
13
|
+
*/
|
|
14
|
+
readonly onChange: (newValue: Date, event?: React.ChangeEvent<HTMLInputElement>) => void;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use `onKeyDown` or `onKeyUp` instead.
|
|
17
|
+
*/
|
|
18
|
+
readonly onEnter?: FormFieldProps["onEnter"];
|
|
9
19
|
/**
|
|
10
20
|
* The maximum selectable date.
|
|
11
21
|
*/
|
|
@@ -23,11 +33,6 @@ export interface InputDateRebuiltProps extends Omit<InputTextRebuiltProps, "clea
|
|
|
23
33
|
* Text to display instead of a date value
|
|
24
34
|
*/
|
|
25
35
|
readonly emptyValueLabel?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Version 2 is highly experimental, avoid using it unless you have talked with Atlantis first.
|
|
28
|
-
*/
|
|
29
|
-
readonly version: 2;
|
|
30
|
-
readonly onChange: (newValue: Date, event?: React.ChangeEvent<HTMLInputElement>) => void;
|
|
31
36
|
}
|
|
32
37
|
export interface InputDateProps extends Omit<CommonFormFieldProps, "clearable">, Pick<FormFieldProps, "readonly" | "disabled" | "onEnter" | "onFocus" | "inputRef" | "validations" | "placeholder" | "onChange" | "onBlur"> {
|
|
33
38
|
/**
|
package/dist/InputDate/index.cjs
CHANGED
|
@@ -13,12 +13,12 @@ require('../Button-cjs.js');
|
|
|
13
13
|
var DatePicker = require('../DatePicker-cjs.js');
|
|
14
14
|
var InputText_index = require('../InputText/index.cjs');
|
|
15
15
|
require('../_commonjsHelpers-cjs.js');
|
|
16
|
-
require('../
|
|
16
|
+
require('../_getAllKeys-cjs.js');
|
|
17
17
|
require('../isTypedArray-cjs.js');
|
|
18
18
|
require('../isObjectLike-cjs.js');
|
|
19
|
+
require('../isSymbol-cjs.js');
|
|
19
20
|
require('../identity-cjs.js');
|
|
20
21
|
require('../_getTag-cjs.js');
|
|
21
|
-
require('../isSymbol-cjs.js');
|
|
22
22
|
require('../keysIn-cjs.js');
|
|
23
23
|
require('../_baseAssignValue-cjs.js');
|
|
24
24
|
require('../_baseFlatten-cjs.js');
|
|
@@ -35,6 +35,7 @@ require('../floating-ui.react-cjs.js');
|
|
|
35
35
|
require('react/jsx-runtime');
|
|
36
36
|
require('react-dom');
|
|
37
37
|
require('../AtlantisContext-cjs.js');
|
|
38
|
+
require('../filterDataAttributes-cjs.js');
|
|
38
39
|
|
|
39
40
|
function InputDate$1(inputProps) {
|
|
40
41
|
const formFieldActionsRef = React.useRef(null);
|
|
@@ -79,13 +80,9 @@ function InputDate$1(inputProps) {
|
|
|
79
80
|
} }));
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
/**
|
|
83
|
-
* Combines the actions on the InputDate such as onChange, onFocus, onBlur to forward event handler passed to the InputDate component to the DatePicker component.
|
|
84
|
-
* DO not repeat this pattern. We are doing this as a proof of concept relating to the refactoring of Form inputs to see what can be removed.
|
|
85
|
-
*/
|
|
86
83
|
function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
|
|
87
84
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
88
|
-
function handleChange(
|
|
85
|
+
function handleChange(_newValue, event) {
|
|
89
86
|
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
90
87
|
}
|
|
91
88
|
function handleFocus(event) {
|
|
@@ -93,8 +90,8 @@ function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
|
|
|
93
90
|
setIsFocused(true);
|
|
94
91
|
}
|
|
95
92
|
function handleBlur(event) {
|
|
96
|
-
setIsFocused(false);
|
|
97
93
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
94
|
+
setIsFocused(false);
|
|
98
95
|
}
|
|
99
96
|
return {
|
|
100
97
|
handleBlur,
|
|
@@ -135,7 +132,7 @@ const InputDateRebuilt = React.forwardRef((props, forwardedRef) => {
|
|
|
135
132
|
return (
|
|
136
133
|
// We prevent the picker from opening on focus for keyboard navigation, so to maintain a good UX for mouse users we want to open the picker on click
|
|
137
134
|
React.createElement("div", { onClick: onClick },
|
|
138
|
-
React.createElement(InputText_index.InputText, { "aria-describedby": activatorProps.ariaDescribedBy, "aria-
|
|
135
|
+
React.createElement(InputText_index.InputText, { "aria-describedby": activatorProps.ariaDescribedBy, "aria-labelledby": activatorProps.ariaLabelledBy, "aria-required": activatorProps.ariaRequired === "true" ? true : false, autoFocus: props.autoFocus, id: activatorProps.id, disabled: props.disabled, error: props.error, readOnly: props.readOnly, placeholder: props.placeholder, size: props.size, inline: props.inline, align: props.align, description: props.description, invalid: props.invalid, name: props.name, version: 2, value: showEmptyValueLabel ? props.emptyValueLabel || "" : value || "", ref: forwardedRef, suffix: suffix, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: event => {
|
|
139
136
|
var _a, _b;
|
|
140
137
|
if (props.showIcon === false && event.key === "ArrowDown") {
|
|
141
138
|
(_a = activatorProps.onClick) === null || _a === void 0 ? void 0 : _a.call(activatorProps);
|
package/dist/InputDate/index.mjs
CHANGED
|
@@ -11,12 +11,12 @@ import '../Button-es.js';
|
|
|
11
11
|
import { D as DatePicker } from '../DatePicker-es.js';
|
|
12
12
|
import { InputText } from '../InputText/index.mjs';
|
|
13
13
|
import '../_commonjsHelpers-es.js';
|
|
14
|
-
import '../
|
|
14
|
+
import '../_getAllKeys-es.js';
|
|
15
15
|
import '../isTypedArray-es.js';
|
|
16
16
|
import '../isObjectLike-es.js';
|
|
17
|
+
import '../isSymbol-es.js';
|
|
17
18
|
import '../identity-es.js';
|
|
18
19
|
import '../_getTag-es.js';
|
|
19
|
-
import '../isSymbol-es.js';
|
|
20
20
|
import '../keysIn-es.js';
|
|
21
21
|
import '../_baseAssignValue-es.js';
|
|
22
22
|
import '../_baseFlatten-es.js';
|
|
@@ -33,6 +33,7 @@ import '../floating-ui.react-es.js';
|
|
|
33
33
|
import 'react/jsx-runtime';
|
|
34
34
|
import 'react-dom';
|
|
35
35
|
import '../AtlantisContext-es.js';
|
|
36
|
+
import '../filterDataAttributes-es.js';
|
|
36
37
|
|
|
37
38
|
function InputDate$1(inputProps) {
|
|
38
39
|
const formFieldActionsRef = useRef(null);
|
|
@@ -77,13 +78,9 @@ function InputDate$1(inputProps) {
|
|
|
77
78
|
} }));
|
|
78
79
|
}
|
|
79
80
|
|
|
80
|
-
/**
|
|
81
|
-
* Combines the actions on the InputDate such as onChange, onFocus, onBlur to forward event handler passed to the InputDate component to the DatePicker component.
|
|
82
|
-
* DO not repeat this pattern. We are doing this as a proof of concept relating to the refactoring of Form inputs to see what can be removed.
|
|
83
|
-
*/
|
|
84
81
|
function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
|
|
85
82
|
const [isFocused, setIsFocused] = useState(false);
|
|
86
|
-
function handleChange(
|
|
83
|
+
function handleChange(_newValue, event) {
|
|
87
84
|
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
88
85
|
}
|
|
89
86
|
function handleFocus(event) {
|
|
@@ -91,8 +88,8 @@ function useInputDateActivatorActions({ onChange, onBlur, onFocus, }) {
|
|
|
91
88
|
setIsFocused(true);
|
|
92
89
|
}
|
|
93
90
|
function handleBlur(event) {
|
|
94
|
-
setIsFocused(false);
|
|
95
91
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
92
|
+
setIsFocused(false);
|
|
96
93
|
}
|
|
97
94
|
return {
|
|
98
95
|
handleBlur,
|
|
@@ -133,7 +130,7 @@ const InputDateRebuilt = forwardRef((props, forwardedRef) => {
|
|
|
133
130
|
return (
|
|
134
131
|
// We prevent the picker from opening on focus for keyboard navigation, so to maintain a good UX for mouse users we want to open the picker on click
|
|
135
132
|
React__default.createElement("div", { onClick: onClick },
|
|
136
|
-
React__default.createElement(InputText, { "aria-describedby": activatorProps.ariaDescribedBy, "aria-
|
|
133
|
+
React__default.createElement(InputText, { "aria-describedby": activatorProps.ariaDescribedBy, "aria-labelledby": activatorProps.ariaLabelledBy, "aria-required": activatorProps.ariaRequired === "true" ? true : false, autoFocus: props.autoFocus, id: activatorProps.id, disabled: props.disabled, error: props.error, readOnly: props.readOnly, placeholder: props.placeholder, size: props.size, inline: props.inline, align: props.align, description: props.description, invalid: props.invalid, name: props.name, version: 2, value: showEmptyValueLabel ? props.emptyValueLabel || "" : value || "", ref: forwardedRef, suffix: suffix, onFocus: handleFocus, onBlur: handleBlur, onKeyDown: event => {
|
|
137
134
|
var _a, _b;
|
|
138
135
|
if (props.showIcon === false && event.key === "ArrowDown") {
|
|
139
136
|
(_a = activatorProps.onClick) === null || _a === void 0 ? void 0 : _a.call(activatorProps);
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import type { ChangeEvent
|
|
1
|
+
import type { ChangeEvent } from "react";
|
|
2
2
|
import type { InputDateRebuiltProps } from "./InputDate.types";
|
|
3
3
|
import type { DatePickerActivatorProps } from "../DatePicker/DatePickerActivator";
|
|
4
4
|
export interface useInputDateActivatorActionsProps extends Pick<InputDateRebuiltProps, "onFocus" | "onBlur"> {
|
|
5
5
|
onChange: DatePickerActivatorProps["onChange"];
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
8
|
-
* Combines the actions on the InputDate such as onChange, onFocus, onBlur to forward event handler passed to the InputDate component to the DatePicker component.
|
|
9
|
-
* DO not repeat this pattern. We are doing this as a proof of concept relating to the refactoring of Form inputs to see what can be removed.
|
|
10
|
-
*/
|
|
11
7
|
export declare function useInputDateActivatorActions({ onChange, onBlur, onFocus, }: useInputDateActivatorActionsProps): {
|
|
12
|
-
handleBlur: (event: FocusEvent<HTMLInputElement>) => void;
|
|
13
|
-
handleChange: (
|
|
14
|
-
handleFocus: (event: FocusEvent<HTMLInputElement>) => void;
|
|
8
|
+
handleBlur: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
9
|
+
handleChange: (_newValue: string, event?: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
10
|
+
handleFocus: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
15
11
|
isFocused: boolean;
|
|
16
12
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Clearable } from "@jobber/hooks";
|
|
2
1
|
import type { CommonFormFieldProps, FormFieldProps } from "../FormField";
|
|
2
|
+
import type { FocusEvents, HTMLInputBaseProps, KeyboardEvents, MouseEvents, RebuiltInputCommonProps } from "../sharedHelpers/types";
|
|
3
3
|
export type InputEmailLegacyProps = CommonFormFieldProps & Pick<FormFieldProps, "maxLength" | "readonly" | "validations" | "defaultValue">;
|
|
4
4
|
export declare const validationMessage = "Please enter a valid email";
|
|
5
5
|
export type InputEmailVersion = 1 | 2 | undefined;
|
|
@@ -7,27 +7,17 @@ export type InputEmailVersion = 1 | 2 | undefined;
|
|
|
7
7
|
* Experimental version 2 of the InputEmail component.
|
|
8
8
|
* Do not use unless you have talked with Atlantis first.
|
|
9
9
|
*/
|
|
10
|
-
export interface InputEmailRebuiltProps extends
|
|
11
|
-
readonly error?: string;
|
|
12
|
-
readonly invalid?: boolean;
|
|
13
|
-
readonly identifier?: string;
|
|
14
|
-
readonly autocomplete?: boolean | string;
|
|
15
|
-
readonly loading?: boolean;
|
|
16
|
-
readonly onKeyUp?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
17
|
-
readonly children?: React.ReactNode;
|
|
18
|
-
readonly clearable?: Clearable;
|
|
10
|
+
export interface InputEmailRebuiltProps extends HTMLInputBaseProps, FocusEvents<HTMLInputElement>, KeyboardEvents<HTMLInputElement>, MouseEvents<HTMLInputElement>, RebuiltInputCommonProps {
|
|
19
11
|
/**
|
|
20
|
-
*
|
|
12
|
+
* The current value of the input.
|
|
13
|
+
*/
|
|
14
|
+
readonly value?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Custom onChange handler that provides the new value as the first argument.
|
|
21
17
|
*/
|
|
22
|
-
readonly version: 2;
|
|
23
18
|
readonly onChange?: (newValue: string, event?: React.ChangeEvent<HTMLInputElement>) => void;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use `onKeyDown` or `onKeyUp` instead.
|
|
21
|
+
*/
|
|
24
22
|
readonly onEnter?: FormFieldProps["onEnter"];
|
|
25
|
-
readonly onBlur?: FormFieldProps["onBlur"];
|
|
26
|
-
readonly value?: string;
|
|
27
|
-
readonly size?: FormFieldProps["size"];
|
|
28
|
-
readonly inline?: FormFieldProps["inline"];
|
|
29
|
-
readonly align?: FormFieldProps["align"];
|
|
30
|
-
readonly prefix?: FormFieldProps["prefix"];
|
|
31
|
-
readonly suffix?: FormFieldProps["suffix"];
|
|
32
|
-
readonly description?: FormFieldProps["description"];
|
|
33
23
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import type { ChangeEvent, FocusEvent, KeyboardEvent } from "react";
|
|
1
|
+
import type { ChangeEvent, FocusEvent, KeyboardEvent, MouseEvent, PointerEvent } from "react";
|
|
2
2
|
import type { InputEmailRebuiltProps } from "../InputEmail.types";
|
|
3
|
-
export interface UseInputEmailActionsProps extends Pick<InputEmailRebuiltProps, "onChange" | "onEnter" | "onFocus" | "onBlur" | "onKeyDown"> {
|
|
3
|
+
export interface UseInputEmailActionsProps extends Pick<InputEmailRebuiltProps, "onChange" | "onEnter" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "onClick" | "onMouseDown" | "onMouseUp" | "onPointerDown" | "onPointerUp"> {
|
|
4
4
|
inputRef?: React.RefObject<HTMLInputElement>;
|
|
5
5
|
}
|
|
6
|
-
export declare function useInputEmailActions({ onChange, inputRef, onEnter, onFocus, onBlur, onKeyDown, }: UseInputEmailActionsProps): {
|
|
6
|
+
export declare function useInputEmailActions({ onChange, inputRef, onEnter, onFocus, onBlur, onKeyDown, onKeyUp, onClick, onMouseDown, onMouseUp, onPointerDown, onPointerUp, }: UseInputEmailActionsProps): {
|
|
7
7
|
handleClear: () => void;
|
|
8
8
|
handleChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
9
9
|
handleKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
10
|
+
handleKeyUp: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
10
11
|
handleFocus: (event: FocusEvent<HTMLInputElement>) => void;
|
|
11
|
-
handleBlur: (event
|
|
12
|
+
handleBlur: (event: FocusEvent<HTMLInputElement>) => void;
|
|
13
|
+
handleClick: (event: MouseEvent<HTMLInputElement>) => void;
|
|
14
|
+
handleMouseDown: (event: MouseEvent<HTMLInputElement>) => void;
|
|
15
|
+
handleMouseUp: (event: MouseEvent<HTMLInputElement>) => void;
|
|
16
|
+
handlePointerDown: (event: PointerEvent<HTMLInputElement>) => void;
|
|
17
|
+
handlePointerUp: (event: PointerEvent<HTMLInputElement>) => void;
|
|
12
18
|
};
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var FormField = require('../FormField-cjs.js');
|
|
5
5
|
require('classnames');
|
|
6
|
-
|
|
6
|
+
require('../tslib.es6-cjs.js');
|
|
7
7
|
require('react-hook-form');
|
|
8
8
|
require('@jobber/hooks');
|
|
9
9
|
require('framer-motion');
|
|
10
10
|
require('@jobber/design');
|
|
11
11
|
require('../Button-cjs.js');
|
|
12
|
-
var
|
|
12
|
+
var filterDataAttributes = require('../filterDataAttributes-cjs.js');
|
|
13
13
|
require('../Icon-cjs.js');
|
|
14
14
|
require('../Text-cjs.js');
|
|
15
15
|
require('../Typography-cjs.js');
|
|
@@ -17,17 +17,6 @@ require('../useFormFieldFocus-cjs.js');
|
|
|
17
17
|
require('../InputValidation-cjs.js');
|
|
18
18
|
require('../Spinner-cjs.js');
|
|
19
19
|
require('react-router-dom');
|
|
20
|
-
require('../_commonjsHelpers-cjs.js');
|
|
21
|
-
require('../_baseGet-cjs.js');
|
|
22
|
-
require('../isTypedArray-cjs.js');
|
|
23
|
-
require('../isObjectLike-cjs.js');
|
|
24
|
-
require('../identity-cjs.js');
|
|
25
|
-
require('../_getTag-cjs.js');
|
|
26
|
-
require('../isSymbol-cjs.js');
|
|
27
|
-
require('../keysIn-cjs.js');
|
|
28
|
-
require('../_baseAssignValue-cjs.js');
|
|
29
|
-
require('../_baseFlatten-cjs.js');
|
|
30
|
-
require('../_setToString-cjs.js');
|
|
31
20
|
|
|
32
21
|
const validationMessage = "Please enter a valid email";
|
|
33
22
|
|
|
@@ -46,10 +35,9 @@ function InputEmail$1(props) {
|
|
|
46
35
|
}
|
|
47
36
|
}
|
|
48
37
|
|
|
49
|
-
function useInputEmailActions({ onChange, inputRef, onEnter, onFocus, onBlur, onKeyDown, }) {
|
|
38
|
+
function useInputEmailActions({ onChange, inputRef, onEnter, onFocus, onBlur, onKeyDown, onKeyUp, onClick, onMouseDown, onMouseUp, onPointerDown, onPointerUp, }) {
|
|
50
39
|
function handleClear() {
|
|
51
40
|
var _a;
|
|
52
|
-
handleBlur();
|
|
53
41
|
onChange === null || onChange === void 0 ? void 0 : onChange("");
|
|
54
42
|
(_a = inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
55
43
|
}
|
|
@@ -74,28 +62,43 @@ function useInputEmailActions({ onChange, inputRef, onEnter, onFocus, onBlur, on
|
|
|
74
62
|
function handleBlur(event) {
|
|
75
63
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
76
64
|
}
|
|
65
|
+
function handleKeyUp(event) {
|
|
66
|
+
onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp(event);
|
|
67
|
+
}
|
|
68
|
+
function handleClick(event) {
|
|
69
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
70
|
+
}
|
|
71
|
+
function handleMouseDown(event) {
|
|
72
|
+
onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(event);
|
|
73
|
+
}
|
|
74
|
+
function handleMouseUp(event) {
|
|
75
|
+
onMouseUp === null || onMouseUp === void 0 ? void 0 : onMouseUp(event);
|
|
76
|
+
}
|
|
77
|
+
function handlePointerDown(event) {
|
|
78
|
+
onPointerDown === null || onPointerDown === void 0 ? void 0 : onPointerDown(event);
|
|
79
|
+
}
|
|
80
|
+
function handlePointerUp(event) {
|
|
81
|
+
onPointerUp === null || onPointerUp === void 0 ? void 0 : onPointerUp(event);
|
|
82
|
+
}
|
|
77
83
|
return {
|
|
78
84
|
handleClear,
|
|
79
85
|
handleChange,
|
|
80
86
|
handleKeyDown,
|
|
87
|
+
handleKeyUp,
|
|
81
88
|
handleFocus,
|
|
82
89
|
handleBlur,
|
|
90
|
+
handleClick,
|
|
91
|
+
handleMouseDown,
|
|
92
|
+
handleMouseUp,
|
|
93
|
+
handlePointerDown,
|
|
94
|
+
handlePointerUp,
|
|
83
95
|
};
|
|
84
96
|
}
|
|
85
97
|
|
|
86
|
-
function useInputEmailFormField(_a) {
|
|
87
|
-
var { id, name, disabled, autofocus, description, inline, value, handleChange, handleBlur, handleFocus, handleKeyDown, error } = _a, rest = tslib_es6.__rest(_a, ["id", "name", "disabled", "autofocus", "description", "inline", "value", "handleChange", "handleBlur", "handleFocus", "handleKeyDown", "error"]);
|
|
88
|
-
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
89
|
-
const fieldProps = Object.assign(Object.assign(Object.assign({}, rest), { id,
|
|
90
|
-
name,
|
|
91
|
-
disabled, autoFocus: autofocus, onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown, value, invalid: error || rest.invalid ? "true" : undefined }), (description &&
|
|
92
|
-
!inline && { "aria-describedby": descriptionIdentifier }));
|
|
93
|
-
return { fieldProps, descriptionIdentifier };
|
|
94
|
-
}
|
|
95
|
-
|
|
96
98
|
const InputEmailRebuilt = React.forwardRef(function InputEmailInternal(props, ref) {
|
|
97
99
|
var _a, _b, _c;
|
|
98
|
-
const
|
|
100
|
+
const generatedId = React.useId();
|
|
101
|
+
const id = props.id || generatedId;
|
|
99
102
|
const inputRef = (_a = ref) !== null && _a !== void 0 ? _a : React.useRef(null);
|
|
100
103
|
const wrapperRef = React.useRef(null);
|
|
101
104
|
const { inputStyle } = FormField.useFormFieldWrapperStyles({
|
|
@@ -106,7 +109,6 @@ const InputEmailRebuilt = React.forwardRef(function InputEmailInternal(props, re
|
|
|
106
109
|
value: props.value,
|
|
107
110
|
invalid: props.invalid,
|
|
108
111
|
error: props.error,
|
|
109
|
-
maxLength: props.maxLength,
|
|
110
112
|
disabled: props.disabled,
|
|
111
113
|
placeholder: props.placeholder,
|
|
112
114
|
});
|
|
@@ -114,35 +116,27 @@ const InputEmailRebuilt = React.forwardRef(function InputEmailInternal(props, re
|
|
|
114
116
|
nameProp: props.name,
|
|
115
117
|
id,
|
|
116
118
|
});
|
|
117
|
-
const { handleChange, handleBlur, handleFocus, handleKeyDown, handleClear } = useInputEmailActions({
|
|
119
|
+
const { handleChange, handleBlur, handleFocus, handleKeyDown, handleKeyUp, handleClear, handleClick, handleMouseDown, handleMouseUp, handlePointerDown, handlePointerUp, } = useInputEmailActions({
|
|
118
120
|
onChange: props.onChange,
|
|
119
121
|
onBlur: props.onBlur,
|
|
120
122
|
onFocus: props.onFocus,
|
|
121
123
|
onKeyDown: props.onKeyDown,
|
|
124
|
+
onKeyUp: props.onKeyUp,
|
|
122
125
|
onEnter: props.onEnter,
|
|
126
|
+
onClick: props.onClick,
|
|
127
|
+
onMouseDown: props.onMouseDown,
|
|
128
|
+
onMouseUp: props.onMouseUp,
|
|
129
|
+
onPointerDown: props.onPointerDown,
|
|
130
|
+
onPointerUp: props.onPointerUp,
|
|
123
131
|
inputRef,
|
|
124
132
|
});
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"
|
|
131
|
-
"
|
|
132
|
-
"prefix",
|
|
133
|
-
"suffix",
|
|
134
|
-
"version",
|
|
135
|
-
]);
|
|
136
|
-
const { fieldProps, descriptionIdentifier } = useInputEmailFormField(Object.assign(Object.assign({}, inputProps), { id,
|
|
137
|
-
name,
|
|
138
|
-
handleChange,
|
|
139
|
-
handleBlur,
|
|
140
|
-
handleFocus,
|
|
141
|
-
handleKeyDown }));
|
|
142
|
-
return (React.createElement(FormField.FormFieldWrapper, { error: props.error || "", invalid: props.invalid, identifier: props.identifier || id, descriptionIdentifier: descriptionIdentifier, size: props.size, inline: props.inline, align: props.align, prefix: props.prefix, suffix: props.suffix, description: props.description, clearable: (_b = props.clearable) !== null && _b !== void 0 ? _b : "never", onClear: handleClear, wrapperRef: wrapperRef, maxLength: props.maxLength, disabled: props.disabled, type: "email", value: props.value, placeholder: props.placeholder, autofocus: props.autoFocus, name: name },
|
|
143
|
-
React.createElement("input", Object.assign({}, fieldProps, { ref: inputRef, type: "email", className: inputStyle, value: props.value, "data-testid": "ATL-InputEmail-input" })),
|
|
144
|
-
React.createElement(FormField.FormFieldPostFix, { variation: "spinner", visible: (_c = props.loading) !== null && _c !== void 0 ? _c : false }),
|
|
145
|
-
props.children));
|
|
133
|
+
const descriptionIdentifier = `descriptionUUID--${id}`;
|
|
134
|
+
const descriptionVisible = props.description && !props.inline;
|
|
135
|
+
const isInvalid = Boolean(props.error || props.invalid);
|
|
136
|
+
const dataAttrs = filterDataAttributes.filterDataAttributes(props);
|
|
137
|
+
return (React.createElement(FormField.FormFieldWrapper, { error: props.error || "", invalid: props.invalid, identifier: id, descriptionIdentifier: descriptionIdentifier, size: props.size, inline: props.inline, align: props.align, prefix: props.prefix, suffix: props.suffix, description: props.description, clearable: (_b = props.clearable) !== null && _b !== void 0 ? _b : "never", onClear: handleClear, wrapperRef: wrapperRef, disabled: props.disabled, type: "email", value: props.value, placeholder: props.placeholder, name: name },
|
|
138
|
+
React.createElement("input", Object.assign({ id: id, name: name, type: "email", ref: inputRef, className: inputStyle, value: props.value, disabled: props.disabled, readOnly: props.readOnly, autoFocus: props.autoFocus, autoComplete: props.autoComplete, pattern: props.pattern, inputMode: props.inputMode, tabIndex: props.tabIndex, role: props.role, "aria-label": props["aria-label"], "aria-describedby": descriptionVisible ? descriptionIdentifier : props["aria-describedby"], "aria-invalid": isInvalid ? true : undefined, "aria-controls": props["aria-controls"], "aria-expanded": props["aria-expanded"], "aria-activedescendant": props["aria-activedescendant"], "aria-autocomplete": props["aria-autocomplete"], "aria-required": props["aria-required"], onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onClick: handleClick, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, "data-testid": "ATL-InputEmail-input" }, dataAttrs)),
|
|
139
|
+
React.createElement(FormField.FormFieldPostFix, { variation: "spinner", visible: (_c = props.loading) !== null && _c !== void 0 ? _c : false })));
|
|
146
140
|
});
|
|
147
141
|
|
|
148
142
|
function isNewInputEmailProps(props) {
|