@alfalab/core-components-international-phone-input 1.3.3 → 1.4.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.
Files changed (31) hide show
  1. package/components/base-international-phone-input/Component.js +6 -8
  2. package/components/base-international-phone-input/index.css +2 -2
  3. package/components/country-select/Component.js +1 -1
  4. package/components/country-select/index.css +8 -8
  5. package/components/flag-icon/component.js +1 -1
  6. package/components/flag-icon/index.css +3 -3
  7. package/components/select-field/component.js +1 -1
  8. package/components/select-field/index.css +9 -9
  9. package/cssm/components/base-international-phone-input/Component.js +5 -7
  10. package/cssm/typings-c29389e5.d.ts +1 -1
  11. package/esm/components/base-international-phone-input/Component.js +6 -8
  12. package/esm/components/base-international-phone-input/index.css +2 -2
  13. package/esm/components/country-select/Component.js +1 -1
  14. package/esm/components/country-select/index.css +8 -8
  15. package/esm/components/flag-icon/component.js +1 -1
  16. package/esm/components/flag-icon/index.css +3 -3
  17. package/esm/components/select-field/component.js +1 -1
  18. package/esm/components/select-field/index.css +9 -9
  19. package/esm/typings-c29389e5.d.ts +1 -1
  20. package/modern/components/base-international-phone-input/Component.js +5 -8
  21. package/modern/components/base-international-phone-input/index.css +2 -2
  22. package/modern/components/country-select/Component.js +1 -1
  23. package/modern/components/country-select/index.css +8 -8
  24. package/modern/components/flag-icon/component.js +1 -1
  25. package/modern/components/flag-icon/index.css +3 -3
  26. package/modern/components/select-field/component.js +1 -1
  27. package/modern/components/select-field/index.css +9 -9
  28. package/modern/typings-c29389e5.d.ts +1 -1
  29. package/package.json +3 -3
  30. package/src/components/base-international-phone-input/Component.tsx +15 -7
  31. package/typings-c29389e5.d.ts +1 -1
@@ -16,7 +16,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
16
16
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
17
17
  var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
18
18
 
19
- var styles = {"component":"international-phone-input__component_1ql2c","addons":"international-phone-input__addons_1ql2c"};
19
+ var styles = {"component":"international-phone-input__component_pnml1","addons":"international-phone-input__addons_pnml1"};
20
20
  require('./index.css')
21
21
 
22
22
  var BaseInternationalPhoneInput = React.forwardRef(function (_a, ref) {
@@ -62,13 +62,11 @@ var BaseInternationalPhoneInput = React.forwardRef(function (_a, ref) {
62
62
  var handleInput = function (e) {
63
63
  updatePhoneData(e.target.value, e);
64
64
  };
65
- var handleClear = function () {
66
- if (clearableCountryCode) {
67
- changeNumber(null, '');
68
- }
69
- else {
70
- changeNumber(null, "+".concat(country === null || country === void 0 ? void 0 : country.countryCode) || '');
71
- }
65
+ var handleClear = function (event) {
66
+ var _a, _b;
67
+ (_b = (_a = restProps.inputProps) === null || _a === void 0 ? void 0 : _a.onClear) === null || _b === void 0 ? void 0 : _b.call(_a, event);
68
+ var countryCode = (country === null || country === void 0 ? void 0 : country.countryCode) || '';
69
+ changeNumber(null, clearableCountryCode ? '' : "+".concat(countryCode));
72
70
  };
73
71
  React.useEffect(function () {
74
72
  if (value) {
@@ -1,5 +1,5 @@
1
- /* hash: qky8l */
1
+ /* hash: 1nmzk */
2
2
 
3
- .international-phone-input__component_1ql2c .international-phone-input__addons_1ql2c {
3
+ .international-phone-input__component_pnml1 .international-phone-input__addons_pnml1 {
4
4
  padding-left: 0;
5
5
  }
@@ -14,7 +14,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
14
14
 
15
15
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
16
16
 
17
- var styles = {"component":"international-phone-input__component_1oi9d","option":"international-phone-input__option_1oi9d","flag":"international-phone-input__flag_1oi9d","countryName":"international-phone-input__countryName_1oi9d","dialCode":"international-phone-input__dialCode_1oi9d","flagIconWrapper":"international-phone-input__flagIconWrapper_1oi9d","emptyCountryIcon":"international-phone-input__emptyCountryIcon_1oi9d"};
17
+ var styles = {"component":"international-phone-input__component_1u0p1","option":"international-phone-input__option_1u0p1","flag":"international-phone-input__flag_1u0p1","countryName":"international-phone-input__countryName_1u0p1","dialCode":"international-phone-input__dialCode_1u0p1","flagIconWrapper":"international-phone-input__flagIconWrapper_1u0p1","emptyCountryIcon":"international-phone-input__emptyCountryIcon_1u0p1"};
18
18
  require('./index.css')
19
19
 
20
20
  var CountrySelect = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 12p5y */
1
+ /* hash: 1t4ag */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-700: rgba(4, 4, 21, 0.47);
@@ -18,29 +18,29 @@
18
18
  --gap-s: 12px;
19
19
  } :root {
20
20
  } :root {
21
- } .international-phone-input__component_1oi9d {
21
+ } .international-phone-input__component_1u0p1 {
22
22
  position: static;
23
23
  display: flex;
24
24
  min-width: initial;
25
25
  height: 100%;
26
- } .international-phone-input__option_1oi9d {
26
+ } .international-phone-input__option_1u0p1 {
27
27
  display: flex;
28
28
  align-items: flex-start;
29
29
  padding: var(--gap-s);
30
- } .international-phone-input__flag_1oi9d {
30
+ } .international-phone-input__flag_1u0p1 {
31
31
  flex-shrink: 0;
32
32
  margin-right: var(--gap-xs);
33
- } .international-phone-input__countryName_1oi9d {
33
+ } .international-phone-input__countryName_1u0p1 {
34
34
  margin-right: var(--gap-xs);
35
- } .international-phone-input__dialCode_1oi9d {
35
+ } .international-phone-input__dialCode_1u0p1 {
36
36
  color: var(--color-light-text-secondary);
37
- } .international-phone-input__flagIconWrapper_1oi9d {
37
+ } .international-phone-input__flagIconWrapper_1u0p1 {
38
38
  display: flex;
39
39
  justify-content: center;
40
40
  align-items: center;
41
41
  width: 24px;
42
42
  height: 24px;
43
43
  margin-left: var(--gap-s);
44
- } .international-phone-input__emptyCountryIcon_1oi9d {
44
+ } .international-phone-input__emptyCountryIcon_1u0p1 {
45
45
  color: var(--color-light-neutral-translucent-700);
46
46
  }
@@ -11,7 +11,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
11
11
  var React__default = /*#__PURE__*/_interopDefaultCompat(React);
12
12
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
13
13
 
14
- var styles = {"flagIcon":"international-phone-input__flagIcon_137ee","flagPlaceholder":"international-phone-input__flagPlaceholder_137ee"};
14
+ var styles = {"flagIcon":"international-phone-input__flagIcon_b3x27","flagPlaceholder":"international-phone-input__flagPlaceholder_b3x27"};
15
15
  require('./index.css')
16
16
 
17
17
  /**
@@ -1,4 +1,4 @@
1
- /* hash: 1ywvz */
1
+ /* hash: 18hrh */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-100: rgba(38, 55, 88, 0.06); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -17,10 +17,10 @@
17
17
  --gap-3xs: 2px;
18
18
  } :root {
19
19
  } :root {
20
- } .international-phone-input__flagIcon_137ee {
20
+ } .international-phone-input__flagIcon_b3x27 {
21
21
  max-width: 24px;
22
22
  max-height: 24px;
23
- } .international-phone-input__flagPlaceholder_137ee {
23
+ } .international-phone-input__flagPlaceholder_b3x27 {
24
24
  width: 24px;
25
25
  height: 16px;
26
26
  max-height: 16px;
@@ -16,7 +16,7 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
16
16
  var mergeRefs__default = /*#__PURE__*/_interopDefaultCompat(mergeRefs);
17
17
  var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
18
18
 
19
- var styles = {"component":"international-phone-input__component_1z0vf","flagIconContainer":"international-phone-input__flagIconContainer_1z0vf","emptyCountryIcon":"international-phone-input__emptyCountryIcon_1z0vf","disabled":"international-phone-input__disabled_1z0vf","inner":"international-phone-input__inner_1z0vf","l":"international-phone-input__l_1z0vf","xl":"international-phone-input__xl_1z0vf","focusVisible":"international-phone-input__focusVisible_1z0vf"};
19
+ var styles = {"component":"international-phone-input__component_in79c","flagIconContainer":"international-phone-input__flagIconContainer_in79c","emptyCountryIcon":"international-phone-input__emptyCountryIcon_in79c","disabled":"international-phone-input__disabled_in79c","inner":"international-phone-input__inner_in79c","l":"international-phone-input__l_in79c","xl":"international-phone-input__xl_in79c","focusVisible":"international-phone-input__focusVisible_in79c"};
20
20
  require('./index.css')
21
21
 
22
22
  var EMPTY_COUNTRY_SELECT_FIELD = {
@@ -1,4 +1,4 @@
1
- /* hash: 12xdp */
1
+ /* hash: kydnd */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-link: #2288fa;
@@ -21,33 +21,33 @@
21
21
  } :root {
22
22
  --focus-color: var(--color-light-border-link);
23
23
  --disabled-cursor: not-allowed;
24
- } .international-phone-input__component_1z0vf {
24
+ } .international-phone-input__component_in79c {
25
25
  height: 100%;
26
26
  cursor: pointer;
27
27
  outline: none;
28
28
  position: relative;
29
- } .international-phone-input__flagIconContainer_1z0vf {
29
+ } .international-phone-input__flagIconContainer_in79c {
30
30
  display: flex;
31
31
  justify-content: center;
32
32
  align-items: center;
33
33
  width: 24px;
34
34
  height: 24px;
35
35
  margin-right: var(--gap-2xs);
36
- } .international-phone-input__emptyCountryIcon_1z0vf {
36
+ } .international-phone-input__emptyCountryIcon_in79c {
37
37
  color: var(--color-light-neutral-translucent-700);
38
- } .international-phone-input__disabled_1z0vf {
38
+ } .international-phone-input__disabled_in79c {
39
39
  cursor: var(--disabled-cursor);
40
- } .international-phone-input__inner_1z0vf {
40
+ } .international-phone-input__inner_in79c {
41
41
  position: relative;
42
42
  display: flex;
43
43
  align-items: center;
44
44
  height: 100%;
45
45
  padding-left: var(--gap-s);
46
46
  outline: none;
47
- } .international-phone-input__l_1z0vf .international-phone-input__inner_1z0vf,
48
- .international-phone-input__xl_1z0vf .international-phone-input__inner_1z0vf {
47
+ } .international-phone-input__l_in79c .international-phone-input__inner_in79c,
48
+ .international-phone-input__xl_in79c .international-phone-input__inner_in79c {
49
49
  padding-left: var(--gap-m);
50
- } .international-phone-input__focusVisible_1z0vf {
50
+ } .international-phone-input__focusVisible_in79c {
51
51
  outline: 2px solid var(--focus-color);
52
52
  outline-offset: 2px;
53
53
  }
@@ -61,13 +61,11 @@ var BaseInternationalPhoneInput = React.forwardRef(function (_a, ref) {
61
61
  var handleInput = function (e) {
62
62
  updatePhoneData(e.target.value, e);
63
63
  };
64
- var handleClear = function () {
65
- if (clearableCountryCode) {
66
- changeNumber(null, '');
67
- }
68
- else {
69
- changeNumber(null, "+".concat(country === null || country === void 0 ? void 0 : country.countryCode) || '');
70
- }
64
+ var handleClear = function (event) {
65
+ var _a, _b;
66
+ (_b = (_a = restProps.inputProps) === null || _a === void 0 ? void 0 : _a.onClear) === null || _b === void 0 ? void 0 : _b.call(_a, event);
67
+ var countryCode = (country === null || country === void 0 ? void 0 : country.countryCode) || '';
68
+ changeNumber(null, clearableCountryCode ? '' : "+".concat(countryCode));
71
69
  };
72
70
  React.useEffect(function () {
73
71
  if (value) {
@@ -18,7 +18,7 @@ interface BackArrowAddonProps extends React.HTMLAttributes<HTMLButtonElement> {
18
18
  /**
19
19
  * Текст после иконки
20
20
  */
21
- text?: string;
21
+ text?: string | null;
22
22
  /**
23
23
  * Дополнительный класс
24
24
  */
@@ -7,7 +7,7 @@ import { BaseOption } from '@alfalab/core-components-select/esm/shared';
7
7
  import { initCountries, findCountry, filterPhones, createMaskOptions, getClear, getPhoneData } from '../../utils/index.js';
8
8
  import { CountrySelect } from '../country-select/Component.js';
9
9
 
10
- var styles = {"component":"international-phone-input__component_1ql2c","addons":"international-phone-input__addons_1ql2c"};
10
+ var styles = {"component":"international-phone-input__component_pnml1","addons":"international-phone-input__addons_pnml1"};
11
11
  require('./index.css')
12
12
 
13
13
  var BaseInternationalPhoneInput = forwardRef(function (_a, ref) {
@@ -53,13 +53,11 @@ var BaseInternationalPhoneInput = forwardRef(function (_a, ref) {
53
53
  var handleInput = function (e) {
54
54
  updatePhoneData(e.target.value, e);
55
55
  };
56
- var handleClear = function () {
57
- if (clearableCountryCode) {
58
- changeNumber(null, '');
59
- }
60
- else {
61
- changeNumber(null, "+".concat(country === null || country === void 0 ? void 0 : country.countryCode) || '');
62
- }
56
+ var handleClear = function (event) {
57
+ var _a, _b;
58
+ (_b = (_a = restProps.inputProps) === null || _a === void 0 ? void 0 : _a.onClear) === null || _b === void 0 ? void 0 : _b.call(_a, event);
59
+ var countryCode = (country === null || country === void 0 ? void 0 : country.countryCode) || '';
60
+ changeNumber(null, clearableCountryCode ? '' : "+".concat(countryCode));
63
61
  };
64
62
  useEffect(function () {
65
63
  if (value) {
@@ -1,5 +1,5 @@
1
- /* hash: qky8l */
1
+ /* hash: 1nmzk */
2
2
 
3
- .international-phone-input__component_1ql2c .international-phone-input__addons_1ql2c {
3
+ .international-phone-input__component_pnml1 .international-phone-input__addons_pnml1 {
4
4
  padding-left: 0;
5
5
  }
@@ -6,7 +6,7 @@ import { WorldMagnifierMIcon } from '@alfalab/icons-glyph/WorldMagnifierMIcon';
6
6
  import { FlagIcon } from '../flag-icon/component.js';
7
7
  import { EMPTY_COUNTRY_SELECT_FIELD, SelectField } from '../select-field/component.js';
8
8
 
9
- var styles = {"component":"international-phone-input__component_1oi9d","option":"international-phone-input__option_1oi9d","flag":"international-phone-input__flag_1oi9d","countryName":"international-phone-input__countryName_1oi9d","dialCode":"international-phone-input__dialCode_1oi9d","flagIconWrapper":"international-phone-input__flagIconWrapper_1oi9d","emptyCountryIcon":"international-phone-input__emptyCountryIcon_1oi9d"};
9
+ var styles = {"component":"international-phone-input__component_1u0p1","option":"international-phone-input__option_1u0p1","flag":"international-phone-input__flag_1u0p1","countryName":"international-phone-input__countryName_1u0p1","dialCode":"international-phone-input__dialCode_1u0p1","flagIconWrapper":"international-phone-input__flagIconWrapper_1u0p1","emptyCountryIcon":"international-phone-input__emptyCountryIcon_1u0p1"};
10
10
  require('./index.css')
11
11
 
12
12
  var CountrySelect = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 12p5y */
1
+ /* hash: 1t4ag */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-700: rgba(4, 4, 21, 0.47);
@@ -18,29 +18,29 @@
18
18
  --gap-s: 12px;
19
19
  } :root {
20
20
  } :root {
21
- } .international-phone-input__component_1oi9d {
21
+ } .international-phone-input__component_1u0p1 {
22
22
  position: static;
23
23
  display: flex;
24
24
  min-width: initial;
25
25
  height: 100%;
26
- } .international-phone-input__option_1oi9d {
26
+ } .international-phone-input__option_1u0p1 {
27
27
  display: flex;
28
28
  align-items: flex-start;
29
29
  padding: var(--gap-s);
30
- } .international-phone-input__flag_1oi9d {
30
+ } .international-phone-input__flag_1u0p1 {
31
31
  flex-shrink: 0;
32
32
  margin-right: var(--gap-xs);
33
- } .international-phone-input__countryName_1oi9d {
33
+ } .international-phone-input__countryName_1u0p1 {
34
34
  margin-right: var(--gap-xs);
35
- } .international-phone-input__dialCode_1oi9d {
35
+ } .international-phone-input__dialCode_1u0p1 {
36
36
  color: var(--color-light-text-secondary);
37
- } .international-phone-input__flagIconWrapper_1oi9d {
37
+ } .international-phone-input__flagIconWrapper_1u0p1 {
38
38
  display: flex;
39
39
  justify-content: center;
40
40
  align-items: center;
41
41
  width: 24px;
42
42
  height: 24px;
43
43
  margin-left: var(--gap-s);
44
- } .international-phone-input__emptyCountryIcon_1oi9d {
44
+ } .international-phone-input__emptyCountryIcon_1u0p1 {
45
45
  color: var(--color-light-neutral-translucent-700);
46
46
  }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { flagSprite } from './flagSprite.js';
4
4
 
5
- var styles = {"flagIcon":"international-phone-input__flagIcon_137ee","flagPlaceholder":"international-phone-input__flagPlaceholder_137ee"};
5
+ var styles = {"flagIcon":"international-phone-input__flagIcon_b3x27","flagPlaceholder":"international-phone-input__flagPlaceholder_b3x27"};
6
6
  require('./index.css')
7
7
 
8
8
  /**
@@ -1,4 +1,4 @@
1
- /* hash: 1ywvz */
1
+ /* hash: 18hrh */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-100: rgba(38, 55, 88, 0.06); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -17,10 +17,10 @@
17
17
  --gap-3xs: 2px;
18
18
  } :root {
19
19
  } :root {
20
- } .international-phone-input__flagIcon_137ee {
20
+ } .international-phone-input__flagIcon_b3x27 {
21
21
  max-width: 24px;
22
22
  max-height: 24px;
23
- } .international-phone-input__flagPlaceholder_137ee {
23
+ } .international-phone-input__flagPlaceholder_b3x27 {
24
24
  width: 24px;
25
25
  height: 16px;
26
26
  max-height: 16px;
@@ -6,7 +6,7 @@ import { useFocus } from '@alfalab/hooks';
6
6
  import { WorldMagnifierMIcon } from '@alfalab/icons-glyph/WorldMagnifierMIcon';
7
7
  import { FlagIcon } from '../flag-icon/component.js';
8
8
 
9
- var styles = {"component":"international-phone-input__component_1z0vf","flagIconContainer":"international-phone-input__flagIconContainer_1z0vf","emptyCountryIcon":"international-phone-input__emptyCountryIcon_1z0vf","disabled":"international-phone-input__disabled_1z0vf","inner":"international-phone-input__inner_1z0vf","l":"international-phone-input__l_1z0vf","xl":"international-phone-input__xl_1z0vf","focusVisible":"international-phone-input__focusVisible_1z0vf"};
9
+ var styles = {"component":"international-phone-input__component_in79c","flagIconContainer":"international-phone-input__flagIconContainer_in79c","emptyCountryIcon":"international-phone-input__emptyCountryIcon_in79c","disabled":"international-phone-input__disabled_in79c","inner":"international-phone-input__inner_in79c","l":"international-phone-input__l_in79c","xl":"international-phone-input__xl_in79c","focusVisible":"international-phone-input__focusVisible_in79c"};
10
10
  require('./index.css')
11
11
 
12
12
  var EMPTY_COUNTRY_SELECT_FIELD = {
@@ -1,4 +1,4 @@
1
- /* hash: 12xdp */
1
+ /* hash: kydnd */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-link: #2288fa;
@@ -21,33 +21,33 @@
21
21
  } :root {
22
22
  --focus-color: var(--color-light-border-link);
23
23
  --disabled-cursor: not-allowed;
24
- } .international-phone-input__component_1z0vf {
24
+ } .international-phone-input__component_in79c {
25
25
  height: 100%;
26
26
  cursor: pointer;
27
27
  outline: none;
28
28
  position: relative;
29
- } .international-phone-input__flagIconContainer_1z0vf {
29
+ } .international-phone-input__flagIconContainer_in79c {
30
30
  display: flex;
31
31
  justify-content: center;
32
32
  align-items: center;
33
33
  width: 24px;
34
34
  height: 24px;
35
35
  margin-right: var(--gap-2xs);
36
- } .international-phone-input__emptyCountryIcon_1z0vf {
36
+ } .international-phone-input__emptyCountryIcon_in79c {
37
37
  color: var(--color-light-neutral-translucent-700);
38
- } .international-phone-input__disabled_1z0vf {
38
+ } .international-phone-input__disabled_in79c {
39
39
  cursor: var(--disabled-cursor);
40
- } .international-phone-input__inner_1z0vf {
40
+ } .international-phone-input__inner_in79c {
41
41
  position: relative;
42
42
  display: flex;
43
43
  align-items: center;
44
44
  height: 100%;
45
45
  padding-left: var(--gap-s);
46
46
  outline: none;
47
- } .international-phone-input__l_1z0vf .international-phone-input__inner_1z0vf,
48
- .international-phone-input__xl_1z0vf .international-phone-input__inner_1z0vf {
47
+ } .international-phone-input__l_in79c .international-phone-input__inner_in79c,
48
+ .international-phone-input__xl_in79c .international-phone-input__inner_in79c {
49
49
  padding-left: var(--gap-m);
50
- } .international-phone-input__focusVisible_1z0vf {
50
+ } .international-phone-input__focusVisible_in79c {
51
51
  outline: 2px solid var(--focus-color);
52
52
  outline-offset: 2px;
53
53
  }
@@ -18,7 +18,7 @@ interface BackArrowAddonProps extends React.HTMLAttributes<HTMLButtonElement> {
18
18
  /**
19
19
  * Текст после иконки
20
20
  */
21
- text?: string;
21
+ text?: string | null;
22
22
  /**
23
23
  * Дополнительный класс
24
24
  */
@@ -6,7 +6,7 @@ import { BaseOption } from '@alfalab/core-components-select/modern/shared';
6
6
  import { initCountries, findCountry, filterPhones, createMaskOptions, getClear, getPhoneData } from '../../utils/index.js';
7
7
  import { CountrySelect } from '../country-select/Component.js';
8
8
 
9
- const styles = {"component":"international-phone-input__component_1ql2c","addons":"international-phone-input__addons_1ql2c"};
9
+ const styles = {"component":"international-phone-input__component_pnml1","addons":"international-phone-input__addons_pnml1"};
10
10
  require('./index.css')
11
11
 
12
12
  const BaseInternationalPhoneInput = forwardRef(({ clearableCountryCode, value, country: countryProp, filterFn, onChange, onCountryChange, countrySelectProps, countries, defaultIso2, disabled, options, size = 'm', Input, InputAutocomplete, SelectComponent, view, clear: clearProp, ...restProps }, ref) => {
@@ -47,13 +47,10 @@ const BaseInternationalPhoneInput = forwardRef(({ clearableCountryCode, value, c
47
47
  const handleInput = (e) => {
48
48
  updatePhoneData(e.target.value, e);
49
49
  };
50
- const handleClear = () => {
51
- if (clearableCountryCode) {
52
- changeNumber(null, '');
53
- }
54
- else {
55
- changeNumber(null, `+${country?.countryCode}` || '');
56
- }
50
+ const handleClear = (event) => {
51
+ restProps.inputProps?.onClear?.(event);
52
+ const countryCode = country?.countryCode || '';
53
+ changeNumber(null, clearableCountryCode ? '' : `+${countryCode}`);
57
54
  };
58
55
  useEffect(() => {
59
56
  if (value) {
@@ -1,5 +1,5 @@
1
- /* hash: qky8l */
1
+ /* hash: 1nmzk */
2
2
 
3
- .international-phone-input__component_1ql2c .international-phone-input__addons_1ql2c {
3
+ .international-phone-input__component_pnml1 .international-phone-input__addons_pnml1 {
4
4
  padding-left: 0;
5
5
  }
@@ -5,7 +5,7 @@ import { WorldMagnifierMIcon } from '@alfalab/icons-glyph/WorldMagnifierMIcon';
5
5
  import { FlagIcon } from '../flag-icon/component.js';
6
6
  import { EMPTY_COUNTRY_SELECT_FIELD, SelectField } from '../select-field/component.js';
7
7
 
8
- const styles = {"component":"international-phone-input__component_1oi9d","option":"international-phone-input__option_1oi9d","flag":"international-phone-input__flag_1oi9d","countryName":"international-phone-input__countryName_1oi9d","dialCode":"international-phone-input__dialCode_1oi9d","flagIconWrapper":"international-phone-input__flagIconWrapper_1oi9d","emptyCountryIcon":"international-phone-input__emptyCountryIcon_1oi9d"};
8
+ const styles = {"component":"international-phone-input__component_1u0p1","option":"international-phone-input__option_1u0p1","flag":"international-phone-input__flag_1u0p1","countryName":"international-phone-input__countryName_1u0p1","dialCode":"international-phone-input__dialCode_1u0p1","flagIconWrapper":"international-phone-input__flagIconWrapper_1u0p1","emptyCountryIcon":"international-phone-input__emptyCountryIcon_1u0p1"};
9
9
  require('./index.css')
10
10
 
11
11
  const CountrySelect = ({ hideCountrySelect, countries, country, dataTestId, fieldWidth, onChange, view = 'desktop', SelectComponent, ...restProps }) => {
@@ -1,4 +1,4 @@
1
- /* hash: 12p5y */
1
+ /* hash: 1t4ag */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-700: rgba(4, 4, 21, 0.47);
@@ -18,29 +18,29 @@
18
18
  --gap-s: 12px;
19
19
  } :root {
20
20
  } :root {
21
- } .international-phone-input__component_1oi9d {
21
+ } .international-phone-input__component_1u0p1 {
22
22
  position: static;
23
23
  display: flex;
24
24
  min-width: initial;
25
25
  height: 100%;
26
- } .international-phone-input__option_1oi9d {
26
+ } .international-phone-input__option_1u0p1 {
27
27
  display: flex;
28
28
  align-items: flex-start;
29
29
  padding: var(--gap-s);
30
- } .international-phone-input__flag_1oi9d {
30
+ } .international-phone-input__flag_1u0p1 {
31
31
  flex-shrink: 0;
32
32
  margin-right: var(--gap-xs);
33
- } .international-phone-input__countryName_1oi9d {
33
+ } .international-phone-input__countryName_1u0p1 {
34
34
  margin-right: var(--gap-xs);
35
- } .international-phone-input__dialCode_1oi9d {
35
+ } .international-phone-input__dialCode_1u0p1 {
36
36
  color: var(--color-light-text-secondary);
37
- } .international-phone-input__flagIconWrapper_1oi9d {
37
+ } .international-phone-input__flagIconWrapper_1u0p1 {
38
38
  display: flex;
39
39
  justify-content: center;
40
40
  align-items: center;
41
41
  width: 24px;
42
42
  height: 24px;
43
43
  margin-left: var(--gap-s);
44
- } .international-phone-input__emptyCountryIcon_1oi9d {
44
+ } .international-phone-input__emptyCountryIcon_1u0p1 {
45
45
  color: var(--color-light-neutral-translucent-700);
46
46
  }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { flagSprite } from './flagSprite.js';
4
4
 
5
- const styles = {"flagIcon":"international-phone-input__flagIcon_137ee","flagPlaceholder":"international-phone-input__flagPlaceholder_137ee"};
5
+ const styles = {"flagIcon":"international-phone-input__flagIcon_b3x27","flagPlaceholder":"international-phone-input__flagPlaceholder_b3x27"};
6
6
  require('./index.css')
7
7
 
8
8
  /**
@@ -1,4 +1,4 @@
1
- /* hash: 1ywvz */
1
+ /* hash: 18hrh */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-neutral-translucent-100: rgba(38, 55, 88, 0.06); /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -17,10 +17,10 @@
17
17
  --gap-3xs: 2px;
18
18
  } :root {
19
19
  } :root {
20
- } .international-phone-input__flagIcon_137ee {
20
+ } .international-phone-input__flagIcon_b3x27 {
21
21
  max-width: 24px;
22
22
  max-height: 24px;
23
- } .international-phone-input__flagPlaceholder_137ee {
23
+ } .international-phone-input__flagPlaceholder_b3x27 {
24
24
  width: 24px;
25
25
  height: 16px;
26
26
  max-height: 16px;
@@ -5,7 +5,7 @@ import { useFocus } from '@alfalab/hooks';
5
5
  import { WorldMagnifierMIcon } from '@alfalab/icons-glyph/WorldMagnifierMIcon';
6
6
  import { FlagIcon } from '../flag-icon/component.js';
7
7
 
8
- const styles = {"component":"international-phone-input__component_1z0vf","flagIconContainer":"international-phone-input__flagIconContainer_1z0vf","emptyCountryIcon":"international-phone-input__emptyCountryIcon_1z0vf","disabled":"international-phone-input__disabled_1z0vf","inner":"international-phone-input__inner_1z0vf","l":"international-phone-input__l_1z0vf","xl":"international-phone-input__xl_1z0vf","focusVisible":"international-phone-input__focusVisible_1z0vf"};
8
+ const styles = {"component":"international-phone-input__component_in79c","flagIconContainer":"international-phone-input__flagIconContainer_in79c","emptyCountryIcon":"international-phone-input__emptyCountryIcon_in79c","disabled":"international-phone-input__disabled_in79c","inner":"international-phone-input__inner_in79c","l":"international-phone-input__l_in79c","xl":"international-phone-input__xl_in79c","focusVisible":"international-phone-input__focusVisible_in79c"};
9
9
  require('./index.css')
10
10
 
11
11
  const EMPTY_COUNTRY_SELECT_FIELD = {
@@ -1,4 +1,4 @@
1
- /* hash: 12xdp */
1
+ /* hash: kydnd */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-border-link: #2288fa;
@@ -21,33 +21,33 @@
21
21
  } :root {
22
22
  --focus-color: var(--color-light-border-link);
23
23
  --disabled-cursor: not-allowed;
24
- } .international-phone-input__component_1z0vf {
24
+ } .international-phone-input__component_in79c {
25
25
  height: 100%;
26
26
  cursor: pointer;
27
27
  outline: none;
28
28
  position: relative;
29
- } .international-phone-input__flagIconContainer_1z0vf {
29
+ } .international-phone-input__flagIconContainer_in79c {
30
30
  display: flex;
31
31
  justify-content: center;
32
32
  align-items: center;
33
33
  width: 24px;
34
34
  height: 24px;
35
35
  margin-right: var(--gap-2xs);
36
- } .international-phone-input__emptyCountryIcon_1z0vf {
36
+ } .international-phone-input__emptyCountryIcon_in79c {
37
37
  color: var(--color-light-neutral-translucent-700);
38
- } .international-phone-input__disabled_1z0vf {
38
+ } .international-phone-input__disabled_in79c {
39
39
  cursor: var(--disabled-cursor);
40
- } .international-phone-input__inner_1z0vf {
40
+ } .international-phone-input__inner_in79c {
41
41
  position: relative;
42
42
  display: flex;
43
43
  align-items: center;
44
44
  height: 100%;
45
45
  padding-left: var(--gap-s);
46
46
  outline: none;
47
- } .international-phone-input__l_1z0vf .international-phone-input__inner_1z0vf,
48
- .international-phone-input__xl_1z0vf .international-phone-input__inner_1z0vf {
47
+ } .international-phone-input__l_in79c .international-phone-input__inner_in79c,
48
+ .international-phone-input__xl_in79c .international-phone-input__inner_in79c {
49
49
  padding-left: var(--gap-m);
50
- } .international-phone-input__focusVisible_1z0vf {
50
+ } .international-phone-input__focusVisible_in79c {
51
51
  outline: 2px solid var(--focus-color);
52
52
  outline-offset: 2px;
53
53
  }
@@ -18,7 +18,7 @@ interface BackArrowAddonProps extends React.HTMLAttributes<HTMLButtonElement> {
18
18
  /**
19
19
  * Текст после иконки
20
20
  */
21
- text?: string;
21
+ text?: string | null;
22
22
  /**
23
23
  * Дополнительный класс
24
24
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-international-phone-input",
3
- "version": "1.3.3",
3
+ "version": "1.4.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -14,9 +14,9 @@
14
14
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@alfalab/core-components-input-autocomplete": "11.4.0",
17
+ "@alfalab/core-components-input-autocomplete": "11.4.1",
18
18
  "@alfalab/core-components-input": "^14.2.0",
19
- "@alfalab/core-components-select": "^17.2.0",
19
+ "@alfalab/core-components-select": "^17.2.1",
20
20
  "@alfalab/core-components-shared": "^0.9.1",
21
21
  "@alfalab/core-components-mq": "^4.2.0",
22
22
  "@alfalab/hooks": "^1.13.0",
@@ -1,4 +1,12 @@
1
- import React, { ChangeEvent, forwardRef, useEffect, useMemo, useRef, useState } from 'react';
1
+ import React, {
2
+ ChangeEvent,
3
+ forwardRef,
4
+ MouseEvent,
5
+ useEffect,
6
+ useMemo,
7
+ useRef,
8
+ useState,
9
+ } from 'react';
2
10
  import mergeRefs from 'react-merge-refs';
3
11
  import { maskitoTransform } from '@maskito/core';
4
12
  import { useMaskito } from '@maskito/react';
@@ -108,12 +116,12 @@ export const BaseInternationalPhoneInput = forwardRef<
108
116
  updatePhoneData(e.target.value, e);
109
117
  };
110
118
 
111
- const handleClear = () => {
112
- if (clearableCountryCode) {
113
- changeNumber(null, '');
114
- } else {
115
- changeNumber(null, `+${country?.countryCode}` || '');
116
- }
119
+ const handleClear = (event: MouseEvent<HTMLButtonElement>) => {
120
+ restProps.inputProps?.onClear?.(event);
121
+
122
+ const countryCode = country?.countryCode || '';
123
+
124
+ changeNumber(null, clearableCountryCode ? '' : `+${countryCode}`);
117
125
  };
118
126
 
119
127
  useEffect(() => {
@@ -18,7 +18,7 @@ interface BackArrowAddonProps extends React.HTMLAttributes<HTMLButtonElement> {
18
18
  /**
19
19
  * Текст после иконки
20
20
  */
21
- text?: string;
21
+ text?: string | null;
22
22
  /**
23
23
  * Дополнительный класс
24
24
  */