@invoicebox/ui 0.1.0-alpha.193 → 0.1.0-alpha.195
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/form/Autocomplete/components/Autocomplete/index.d.ts +2 -2
- package/dist/components/form/Autocomplete/components/Autocomplete/index.js +4 -2
- package/dist/components/form/PhoneInput/index.d.ts +1 -1
- package/dist/components/form/PhoneInput/index.js +8 -4
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ type TOption = {
|
|
|
4
4
|
value: string;
|
|
5
5
|
entity?: any;
|
|
6
6
|
};
|
|
7
|
-
type TFieldProps = Pick<InputHTMLAttributes<HTMLInputElement>, 'name' | 'onBlur' | 'onFocus'> & {
|
|
7
|
+
type TFieldProps = Pick<InputHTMLAttributes<HTMLInputElement>, 'name' | 'onBlur' | 'onFocus' | 'autoFocus'> & {
|
|
8
8
|
value: string;
|
|
9
9
|
onChange: (value: string, option?: TOption) => void;
|
|
10
10
|
};
|
|
@@ -25,7 +25,7 @@ type TControlProps = {
|
|
|
25
25
|
size?: TSizes;
|
|
26
26
|
};
|
|
27
27
|
export type TProps = TFieldProps & TControlProps;
|
|
28
|
-
export declare const Autocomplete: React.ForwardRefExoticComponent<Pick<React.InputHTMLAttributes<HTMLInputElement>, "name" | "onFocus" | "onBlur"> & {
|
|
28
|
+
export declare const Autocomplete: React.ForwardRefExoticComponent<Pick<React.InputHTMLAttributes<HTMLInputElement>, "name" | "autoFocus" | "onFocus" | "onBlur"> & {
|
|
29
29
|
value: string;
|
|
30
30
|
onChange: (value: string, option?: TOption) => void;
|
|
31
31
|
} & TControlProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -53,7 +53,8 @@ var Autocomplete = exports.Autocomplete = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
53
53
|
_ref$isInputOnlyNumbe = _ref.isInputOnlyNumbers,
|
|
54
54
|
isInputOnlyNumbers = _ref$isInputOnlyNumbe === void 0 ? false : _ref$isInputOnlyNumbe,
|
|
55
55
|
_ref$size = _ref.size,
|
|
56
|
-
size = _ref$size === void 0 ? 'M' : _ref$size
|
|
56
|
+
size = _ref$size === void 0 ? 'M' : _ref$size,
|
|
57
|
+
autoFocus = _ref.autoFocus;
|
|
57
58
|
var isMobile = (0, _useMedia.useMobile)();
|
|
58
59
|
var _useState = (0, _react.useState)(false),
|
|
59
60
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -105,7 +106,8 @@ var Autocomplete = exports.Autocomplete = /*#__PURE__*/(0, _react.forwardRef)(fu
|
|
|
105
106
|
disabled: disabled,
|
|
106
107
|
paddingLeft: inputPaddingLeft,
|
|
107
108
|
maxLength: inputMaxLength,
|
|
108
|
-
isOnlyNumbers: isInputOnlyNumbers
|
|
109
|
+
isOnlyNumbers: isInputOnlyNumbers,
|
|
110
|
+
autoFocus: autoFocus
|
|
109
111
|
}, _constants.SIZE_PARAMS_MAP[size])))), /*#__PURE__*/_react["default"].createElement(_Dropdown.Dropdown, {
|
|
110
112
|
isOpen: isOpen && (!!options.length || !!isLoading),
|
|
111
113
|
isAutoPosition: true,
|
|
@@ -8,7 +8,7 @@ type TFieldProps = Pick<TPureInputProps, 'name' | 'onBlur' | 'onFocus'> & {
|
|
|
8
8
|
onChange: (value: string) => void;
|
|
9
9
|
hasError?: boolean;
|
|
10
10
|
};
|
|
11
|
-
type TControlProps = Pick<TPureInputProps, 'disabled' | 'id'> & {
|
|
11
|
+
type TControlProps = Pick<TPureInputProps, 'disabled' | 'id' | 'autoFocus'> & {
|
|
12
12
|
label: string;
|
|
13
13
|
countrySelectProps?: Pick<TCountrySelectProps, 'selectedLabel' | 'placeholder'>;
|
|
14
14
|
onCountryChange?: (countryCode: string) => void;
|
|
@@ -42,7 +42,8 @@ var PhoneInput = exports.PhoneInput = function PhoneInput(_ref) {
|
|
|
42
42
|
onCountryChange = _ref.onCountryChange,
|
|
43
43
|
pureInputProps = _ref.pureInputProps,
|
|
44
44
|
_ref$size = _ref.size,
|
|
45
|
-
size = _ref$size === void 0 ? 'M' : _ref$size
|
|
45
|
+
size = _ref$size === void 0 ? 'M' : _ref$size,
|
|
46
|
+
autoFocus = _ref.autoFocus;
|
|
46
47
|
var inputRef = (0, _react.useRef)();
|
|
47
48
|
var isMobile = (0, _useMedia.useMobile)();
|
|
48
49
|
var countrySelectOptions = (0, _react.useMemo)(function () {
|
|
@@ -176,8 +177,11 @@ var PhoneInput = exports.PhoneInput = function PhoneInput(_ref) {
|
|
|
176
177
|
hasError: hasError || (isFirstBlur ? false : isHaveInputError),
|
|
177
178
|
inFocus: inFocus,
|
|
178
179
|
name: name,
|
|
179
|
-
paddingLeft: isHaveSelectCountries ? 75 : 18
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
paddingLeft: isHaveSelectCountries ? 75 : 18
|
|
181
|
+
// for disable autocomplete
|
|
182
|
+
,
|
|
183
|
+
autoComplete: 'new-password',
|
|
184
|
+
inputMode: "numeric",
|
|
185
|
+
autoFocus: autoFocus
|
|
182
186
|
}, _constants.SIZE_PARAMS_MAP[size], pureInputProps)))));
|
|
183
187
|
};
|