@bigbinary/neeto-molecules 3.15.50 → 3.15.51
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/PhoneNumber.js +30 -5
- package/dist/PhoneNumber.js.map +1 -1
- package/dist/SessionEnvironment.js +3 -3
- package/dist/cjs/PhoneNumber.js +29 -4
- package/dist/cjs/PhoneNumber.js.map +1 -1
- package/dist/cjs/SessionEnvironment.js +3 -3
- package/dist/cjs/{phone-number-BN-c0rfv.js → phone-number-DcpFFYZS.js} +2 -2
- package/dist/cjs/{phone-number-BN-c0rfv.js.map → phone-number-DcpFFYZS.js.map} +1 -1
- package/dist/{phone-number-CXCBroLh.js → phone-number-BxJMWmEj.js} +2 -2
- package/dist/{phone-number-CXCBroLh.js.map → phone-number-BxJMWmEj.js.map} +1 -1
- package/package.json +4 -4
- package/types/PhoneNumber.d.ts +3 -0
package/dist/PhoneNumber.js
CHANGED
|
@@ -2,13 +2,15 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
4
|
import { useField } from 'formik';
|
|
5
|
-
import { P as PhoneNumberInput, g as getPhoneData, S as SingleValue } from './phone-number-
|
|
6
|
-
export { i as isPhoneNumberValid, v as validation } from './phone-number-
|
|
5
|
+
import { P as PhoneNumberInput, g as getPhoneData, S as SingleValue } from './phone-number-BxJMWmEj.js';
|
|
6
|
+
export { i as isPhoneNumberValid, v as validation } from './phone-number-BxJMWmEj.js';
|
|
7
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
import { memo } from 'react';
|
|
9
9
|
import classnames from 'classnames';
|
|
10
10
|
import { isNotPresent } from '@bigbinary/neeto-cist';
|
|
11
11
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
12
|
+
import Button from '@bigbinary/neetoui/Button';
|
|
13
|
+
import CopyToClipboardButton from './CopyToClipboardButton.js';
|
|
12
14
|
import '@tanstack/react-query';
|
|
13
15
|
import 'libphonenumber-js/min';
|
|
14
16
|
import '@bigbinary/neetoui/Input';
|
|
@@ -23,6 +25,10 @@ import '@bigbinary/neeto-commons-frontend/utils';
|
|
|
23
25
|
import 'yup';
|
|
24
26
|
import 'axios';
|
|
25
27
|
import './inject-css-DmrvuTKK.js';
|
|
28
|
+
import '@bigbinary/neeto-commons-frontend/utils/general';
|
|
29
|
+
import '@bigbinary/neeto-icons/Copy';
|
|
30
|
+
import '@bigbinary/neeto-icons/Check';
|
|
31
|
+
import 'react-i18next';
|
|
26
32
|
|
|
27
33
|
var _excluded$1 = ["name"];
|
|
28
34
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -41,7 +47,7 @@ var FormikPhoneNumberInput = function FormikPhoneNumberInput(_ref) {
|
|
|
41
47
|
}, props));
|
|
42
48
|
};
|
|
43
49
|
|
|
44
|
-
var _excluded = ["className", "defaultCountry", "value", "showEmoji", "children"];
|
|
50
|
+
var _excluded = ["className", "defaultCountry", "value", "showEmoji", "children", "linkable", "linkPrefix", "showCopyButton"];
|
|
45
51
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
46
52
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
47
53
|
var PhoneNumber = function PhoneNumber(_ref) {
|
|
@@ -52,11 +58,18 @@ var PhoneNumber = function PhoneNumber(_ref) {
|
|
|
52
58
|
_ref$showEmoji = _ref.showEmoji,
|
|
53
59
|
showEmoji = _ref$showEmoji === void 0 ? false : _ref$showEmoji,
|
|
54
60
|
children = _ref.children,
|
|
61
|
+
_ref$linkable = _ref.linkable,
|
|
62
|
+
linkable = _ref$linkable === void 0 ? false : _ref$linkable,
|
|
63
|
+
_ref$linkPrefix = _ref.linkPrefix,
|
|
64
|
+
linkPrefix = _ref$linkPrefix === void 0 ? "tel:" : _ref$linkPrefix,
|
|
65
|
+
_ref$showCopyButton = _ref.showCopyButton,
|
|
66
|
+
showCopyButton = _ref$showCopyButton === void 0 ? false : _ref$showCopyButton,
|
|
55
67
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
56
68
|
if (isNotPresent(value) && isNotPresent(children)) return null;
|
|
57
69
|
var _getPhoneData = getPhoneData(value || children, defaultCountry),
|
|
58
70
|
international = _getPhoneData.international,
|
|
59
71
|
countryCode = _getPhoneData.countryCode;
|
|
72
|
+
var link = linkable ? "".concat(linkPrefix).concat(value) : undefined;
|
|
60
73
|
return /*#__PURE__*/jsxs("div", {
|
|
61
74
|
className: classnames(["flex items-center space-x-2", className]),
|
|
62
75
|
children: [/*#__PURE__*/jsx(SingleValue, _objectSpread({}, _objectSpread({
|
|
@@ -65,8 +78,20 @@ var PhoneNumber = function PhoneNumber(_ref) {
|
|
|
65
78
|
}, otherProps))), /*#__PURE__*/jsx(Typography, _objectSpread(_objectSpread({
|
|
66
79
|
style: "body2"
|
|
67
80
|
}, otherProps), {}, {
|
|
68
|
-
children:
|
|
69
|
-
|
|
81
|
+
children: linkable ? /*#__PURE__*/jsx(Button, {
|
|
82
|
+
className: "neeto-molecules-phone-number truncate",
|
|
83
|
+
"data-cy": "phone-number-link",
|
|
84
|
+
"data-testid": "phone-number-link",
|
|
85
|
+
href: link,
|
|
86
|
+
style: "link",
|
|
87
|
+
children: international
|
|
88
|
+
}) : international
|
|
89
|
+
})), showCopyButton && /*#__PURE__*/jsx(CopyToClipboardButton, {
|
|
90
|
+
className: "flex-shrink-0",
|
|
91
|
+
size: "small",
|
|
92
|
+
style: "text",
|
|
93
|
+
value: international
|
|
94
|
+
})]
|
|
70
95
|
});
|
|
71
96
|
};
|
|
72
97
|
var PhoneNumber$1 = /*#__PURE__*/memo(PhoneNumber);
|
package/dist/PhoneNumber.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneNumber.js","sources":["../src/components/PhoneNumber/FormikPhoneNumberInput.jsx","../src/components/PhoneNumber/PhoneNumber.jsx"],"sourcesContent":["import { useField } from \"formik\";\n\nimport PhoneNumberInput from \"./PhoneNumberInput\";\n\nconst FormikPhoneNumberInput = ({ name, ...props }) => {\n const [field, meta, { setValue }] = useField(name);\n\n return (\n <PhoneNumberInput\n {...field}\n error={meta.touched ? meta.error : \"\"}\n onChange={setValue}\n {...props}\n />\n );\n};\n\nexport default FormikPhoneNumberInput;\n","import { memo } from \"react\";\n\nimport classnames from \"classnames\";\nimport { isNotPresent } from \"neetocist\";\nimport { Typography } from \"neetoui\";\n\nimport SingleValue from \"./CountryPicker/SingleValue\";\nimport { getPhoneData } from \"./utils\";\n\nconst PhoneNumber = ({\n className,\n defaultCountry = \"IN\",\n value,\n showEmoji = false,\n children,\n ...otherProps\n}) => {\n if (isNotPresent(value) && isNotPresent(children)) return null;\n\n const { international, countryCode } = getPhoneData(\n value || children,\n defaultCountry\n );\n\n return (\n <div className={classnames([\"flex items-center space-x-2\", className])}>\n <SingleValue {...{ countryCode, showEmoji, ...otherProps }} />\n <Typography style=\"body2\" {...otherProps}>\n {international}\n </Typography>\n </div>\n );\n};\nexport default memo(PhoneNumber);\n"],"names":["FormikPhoneNumberInput","_ref","name","props","_objectWithoutProperties","_excluded","_useField","useField","_useField2","_slicedToArray","field","meta","setValue","_jsx","PhoneNumberInput","_objectSpread","error","touched","onChange","PhoneNumber","className","_ref$defaultCountry","defaultCountry","value","_ref$showEmoji","showEmoji","children","otherProps","isNotPresent","_getPhoneData","getPhoneData","international","countryCode","_jsxs","classnames","SingleValue","Typography","style","memo"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PhoneNumber.js","sources":["../src/components/PhoneNumber/FormikPhoneNumberInput.jsx","../src/components/PhoneNumber/PhoneNumber.jsx"],"sourcesContent":["import { useField } from \"formik\";\n\nimport PhoneNumberInput from \"./PhoneNumberInput\";\n\nconst FormikPhoneNumberInput = ({ name, ...props }) => {\n const [field, meta, { setValue }] = useField(name);\n\n return (\n <PhoneNumberInput\n {...field}\n error={meta.touched ? meta.error : \"\"}\n onChange={setValue}\n {...props}\n />\n );\n};\n\nexport default FormikPhoneNumberInput;\n","import { memo } from \"react\";\n\nimport classnames from \"classnames\";\nimport { isNotPresent } from \"neetocist\";\nimport { Typography, Button } from \"neetoui\";\n\nimport CopyToClipboardButton from \"components/CopyToClipboardButton\";\n\nimport SingleValue from \"./CountryPicker/SingleValue\";\nimport { getPhoneData } from \"./utils\";\n\nconst PhoneNumber = ({\n className,\n defaultCountry = \"IN\",\n value,\n showEmoji = false,\n children,\n linkable = false,\n linkPrefix = \"tel:\",\n showCopyButton = false,\n ...otherProps\n}) => {\n if (isNotPresent(value) && isNotPresent(children)) return null;\n\n const { international, countryCode } = getPhoneData(\n value || children,\n defaultCountry\n );\n const link = linkable ? `${linkPrefix}${value}` : undefined;\n\n return (\n <div className={classnames([\"flex items-center space-x-2\", className])}>\n <SingleValue {...{ countryCode, showEmoji, ...otherProps }} />\n <Typography style=\"body2\" {...otherProps}>\n {linkable ? (\n <Button\n className=\"neeto-molecules-phone-number truncate\"\n data-cy=\"phone-number-link\"\n data-testid=\"phone-number-link\"\n href={link}\n style=\"link\"\n >\n {international}\n </Button>\n ) : (\n international\n )}\n </Typography>\n {showCopyButton && (\n <CopyToClipboardButton\n className=\"flex-shrink-0\"\n size=\"small\"\n style=\"text\"\n value={international}\n />\n )}\n </div>\n );\n};\nexport default memo(PhoneNumber);\n"],"names":["FormikPhoneNumberInput","_ref","name","props","_objectWithoutProperties","_excluded","_useField","useField","_useField2","_slicedToArray","field","meta","setValue","_jsx","PhoneNumberInput","_objectSpread","error","touched","onChange","PhoneNumber","className","_ref$defaultCountry","defaultCountry","value","_ref$showEmoji","showEmoji","children","_ref$linkable","linkable","_ref$linkPrefix","linkPrefix","_ref$showCopyButton","showCopyButton","otherProps","isNotPresent","_getPhoneData","getPhoneData","international","countryCode","link","concat","undefined","_jsxs","classnames","SingleValue","Typography","style","Button","href","CopyToClipboardButton","size","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAAC,IAAA,EAA2B;AAAA,EAAA,IAArBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;AAAKC,IAAAA,KAAK,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,WAAA,CAAA,CAAA;AAC9C,EAAA,IAAAC,SAAA,GAAoCC,QAAQ,CAACL,IAAI,CAAC;IAAAM,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAA3CI,IAAAA,KAAK,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,IAAI,GAAAH,UAAA,CAAA,CAAA,CAAA;IAAII,QAAQ,GAAAJ,UAAA,CAAA,CAAA,CAAA,CAARI,QAAQ,CAAA;EAE9B,oBACEC,GAAA,CAACC,gBAAgB,EAAAC,eAAA,CAAAA,eAAA,KACXL,KAAK,CAAA,EAAA,EAAA,EAAA;IACTM,KAAK,EAAEL,IAAI,CAACM,OAAO,GAAGN,IAAI,CAACK,KAAK,GAAG,EAAG;AACtCE,IAAAA,QAAQ,EAAEN,QAAAA;GACNT,EAAAA,KAAK,CACV,CAAC,CAAA;AAEN;;;;;ACJ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pers/objectWithoutProperties';
|
|
36
36
|
import 'formik';
|
|
37
|
-
import { P as PhoneNumberInput } from './phone-number-
|
|
37
|
+
import { P as PhoneNumberInput } from './phone-number-BxJMWmEj.js';
|
|
38
38
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
39
|
+
import '@bigbinary/neeto-commons-frontend/utils/general';
|
|
40
|
+
import '@bigbinary/neeto-icons/Copy';
|
|
39
41
|
import '@babel/runtime/helpers/asyncToGenerator';
|
|
40
42
|
import '@babel/runtime/regenerator';
|
|
41
43
|
import 'i18next';
|
|
@@ -46,8 +48,6 @@ import 'axios';
|
|
|
46
48
|
import { n } from './inject-css-DmrvuTKK.js';
|
|
47
49
|
import '@bigbinary/neeto-icons/Help';
|
|
48
50
|
import '@bigbinary/neetoui/Popover';
|
|
49
|
-
import '@bigbinary/neeto-commons-frontend/utils/general';
|
|
50
|
-
import '@bigbinary/neeto-icons/Copy';
|
|
51
51
|
import './DateFormat.js';
|
|
52
52
|
import '@bigbinary/neeto-commons-frontend/react-utils/useTimer';
|
|
53
53
|
import '@bigbinary/neeto-commons-frontend/utils/datetime';
|
package/dist/cjs/PhoneNumber.js
CHANGED
|
@@ -4,12 +4,14 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
4
4
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
5
5
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
6
|
var formik = require('formik');
|
|
7
|
-
var phoneNumber = require('./phone-number-
|
|
7
|
+
var phoneNumber = require('./phone-number-DcpFFYZS.js');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
var React = require('react');
|
|
10
10
|
var classnames = require('classnames');
|
|
11
11
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
12
12
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
13
|
+
var Button = require('@bigbinary/neetoui/Button');
|
|
14
|
+
var CopyToClipboardButton = require('./CopyToClipboardButton.js');
|
|
13
15
|
require('@tanstack/react-query');
|
|
14
16
|
require('libphonenumber-js/min');
|
|
15
17
|
require('@bigbinary/neetoui/Input');
|
|
@@ -24,6 +26,10 @@ require('@bigbinary/neeto-commons-frontend/utils');
|
|
|
24
26
|
require('yup');
|
|
25
27
|
require('axios');
|
|
26
28
|
require('./inject-css-vQvjPR2x.js');
|
|
29
|
+
require('@bigbinary/neeto-commons-frontend/utils/general');
|
|
30
|
+
require('@bigbinary/neeto-icons/Copy');
|
|
31
|
+
require('@bigbinary/neeto-icons/Check');
|
|
32
|
+
require('react-i18next');
|
|
27
33
|
|
|
28
34
|
var _excluded$1 = ["name"];
|
|
29
35
|
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -42,7 +48,7 @@ var FormikPhoneNumberInput = function FormikPhoneNumberInput(_ref) {
|
|
|
42
48
|
}, props));
|
|
43
49
|
};
|
|
44
50
|
|
|
45
|
-
var _excluded = ["className", "defaultCountry", "value", "showEmoji", "children"];
|
|
51
|
+
var _excluded = ["className", "defaultCountry", "value", "showEmoji", "children", "linkable", "linkPrefix", "showCopyButton"];
|
|
46
52
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
47
53
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
48
54
|
var PhoneNumber = function PhoneNumber(_ref) {
|
|
@@ -53,11 +59,18 @@ var PhoneNumber = function PhoneNumber(_ref) {
|
|
|
53
59
|
_ref$showEmoji = _ref.showEmoji,
|
|
54
60
|
showEmoji = _ref$showEmoji === void 0 ? false : _ref$showEmoji,
|
|
55
61
|
children = _ref.children,
|
|
62
|
+
_ref$linkable = _ref.linkable,
|
|
63
|
+
linkable = _ref$linkable === void 0 ? false : _ref$linkable,
|
|
64
|
+
_ref$linkPrefix = _ref.linkPrefix,
|
|
65
|
+
linkPrefix = _ref$linkPrefix === void 0 ? "tel:" : _ref$linkPrefix,
|
|
66
|
+
_ref$showCopyButton = _ref.showCopyButton,
|
|
67
|
+
showCopyButton = _ref$showCopyButton === void 0 ? false : _ref$showCopyButton,
|
|
56
68
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
57
69
|
if (neetoCist.isNotPresent(value) && neetoCist.isNotPresent(children)) return null;
|
|
58
70
|
var _getPhoneData = phoneNumber.getPhoneData(value || children, defaultCountry),
|
|
59
71
|
international = _getPhoneData.international,
|
|
60
72
|
countryCode = _getPhoneData.countryCode;
|
|
73
|
+
var link = linkable ? "".concat(linkPrefix).concat(value) : undefined;
|
|
61
74
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
62
75
|
className: classnames(["flex items-center space-x-2", className]),
|
|
63
76
|
children: [/*#__PURE__*/jsxRuntime.jsx(phoneNumber.SingleValue, _objectSpread({}, _objectSpread({
|
|
@@ -66,8 +79,20 @@ var PhoneNumber = function PhoneNumber(_ref) {
|
|
|
66
79
|
}, otherProps))), /*#__PURE__*/jsxRuntime.jsx(Typography, _objectSpread(_objectSpread({
|
|
67
80
|
style: "body2"
|
|
68
81
|
}, otherProps), {}, {
|
|
69
|
-
children:
|
|
70
|
-
|
|
82
|
+
children: linkable ? /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
83
|
+
className: "neeto-molecules-phone-number truncate",
|
|
84
|
+
"data-cy": "phone-number-link",
|
|
85
|
+
"data-testid": "phone-number-link",
|
|
86
|
+
href: link,
|
|
87
|
+
style: "link",
|
|
88
|
+
children: international
|
|
89
|
+
}) : international
|
|
90
|
+
})), showCopyButton && /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton, {
|
|
91
|
+
className: "flex-shrink-0",
|
|
92
|
+
size: "small",
|
|
93
|
+
style: "text",
|
|
94
|
+
value: international
|
|
95
|
+
})]
|
|
71
96
|
});
|
|
72
97
|
};
|
|
73
98
|
var PhoneNumber$1 = /*#__PURE__*/React.memo(PhoneNumber);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneNumber.js","sources":["../../src/components/PhoneNumber/FormikPhoneNumberInput.jsx","../../src/components/PhoneNumber/PhoneNumber.jsx"],"sourcesContent":["import { useField } from \"formik\";\n\nimport PhoneNumberInput from \"./PhoneNumberInput\";\n\nconst FormikPhoneNumberInput = ({ name, ...props }) => {\n const [field, meta, { setValue }] = useField(name);\n\n return (\n <PhoneNumberInput\n {...field}\n error={meta.touched ? meta.error : \"\"}\n onChange={setValue}\n {...props}\n />\n );\n};\n\nexport default FormikPhoneNumberInput;\n","import { memo } from \"react\";\n\nimport classnames from \"classnames\";\nimport { isNotPresent } from \"neetocist\";\nimport { Typography } from \"neetoui\";\n\nimport SingleValue from \"./CountryPicker/SingleValue\";\nimport { getPhoneData } from \"./utils\";\n\nconst PhoneNumber = ({\n className,\n defaultCountry = \"IN\",\n value,\n showEmoji = false,\n children,\n ...otherProps\n}) => {\n if (isNotPresent(value) && isNotPresent(children)) return null;\n\n const { international, countryCode } = getPhoneData(\n value || children,\n defaultCountry\n );\n\n return (\n <div className={classnames([\"flex items-center space-x-2\", className])}>\n <SingleValue {...{ countryCode, showEmoji, ...otherProps }} />\n <Typography style=\"body2\" {...otherProps}>\n {international}\n </Typography>\n </div>\n );\n};\nexport default memo(PhoneNumber);\n"],"names":["FormikPhoneNumberInput","_ref","name","props","_objectWithoutProperties","_excluded","_useField","useField","_useField2","_slicedToArray","field","meta","setValue","_jsx","PhoneNumberInput","_objectSpread","error","touched","onChange","PhoneNumber","className","_ref$defaultCountry","defaultCountry","value","_ref$showEmoji","showEmoji","children","otherProps","isNotPresent","_getPhoneData","getPhoneData","international","countryCode","_jsxs","classnames","SingleValue","Typography","style","memo"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PhoneNumber.js","sources":["../../src/components/PhoneNumber/FormikPhoneNumberInput.jsx","../../src/components/PhoneNumber/PhoneNumber.jsx"],"sourcesContent":["import { useField } from \"formik\";\n\nimport PhoneNumberInput from \"./PhoneNumberInput\";\n\nconst FormikPhoneNumberInput = ({ name, ...props }) => {\n const [field, meta, { setValue }] = useField(name);\n\n return (\n <PhoneNumberInput\n {...field}\n error={meta.touched ? meta.error : \"\"}\n onChange={setValue}\n {...props}\n />\n );\n};\n\nexport default FormikPhoneNumberInput;\n","import { memo } from \"react\";\n\nimport classnames from \"classnames\";\nimport { isNotPresent } from \"neetocist\";\nimport { Typography, Button } from \"neetoui\";\n\nimport CopyToClipboardButton from \"components/CopyToClipboardButton\";\n\nimport SingleValue from \"./CountryPicker/SingleValue\";\nimport { getPhoneData } from \"./utils\";\n\nconst PhoneNumber = ({\n className,\n defaultCountry = \"IN\",\n value,\n showEmoji = false,\n children,\n linkable = false,\n linkPrefix = \"tel:\",\n showCopyButton = false,\n ...otherProps\n}) => {\n if (isNotPresent(value) && isNotPresent(children)) return null;\n\n const { international, countryCode } = getPhoneData(\n value || children,\n defaultCountry\n );\n const link = linkable ? `${linkPrefix}${value}` : undefined;\n\n return (\n <div className={classnames([\"flex items-center space-x-2\", className])}>\n <SingleValue {...{ countryCode, showEmoji, ...otherProps }} />\n <Typography style=\"body2\" {...otherProps}>\n {linkable ? (\n <Button\n className=\"neeto-molecules-phone-number truncate\"\n data-cy=\"phone-number-link\"\n data-testid=\"phone-number-link\"\n href={link}\n style=\"link\"\n >\n {international}\n </Button>\n ) : (\n international\n )}\n </Typography>\n {showCopyButton && (\n <CopyToClipboardButton\n className=\"flex-shrink-0\"\n size=\"small\"\n style=\"text\"\n value={international}\n />\n )}\n </div>\n );\n};\nexport default memo(PhoneNumber);\n"],"names":["FormikPhoneNumberInput","_ref","name","props","_objectWithoutProperties","_excluded","_useField","useField","_useField2","_slicedToArray","field","meta","setValue","_jsx","PhoneNumberInput","_objectSpread","error","touched","onChange","PhoneNumber","className","_ref$defaultCountry","defaultCountry","value","_ref$showEmoji","showEmoji","children","_ref$linkable","linkable","_ref$linkPrefix","linkPrefix","_ref$showCopyButton","showCopyButton","otherProps","isNotPresent","_getPhoneData","getPhoneData","international","countryCode","link","concat","undefined","_jsxs","classnames","SingleValue","Typography","style","Button","href","CopyToClipboardButton","size","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAMA,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAAC,IAAA,EAA2B;AAAA,EAAA,IAArBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;AAAKC,IAAAA,KAAK,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,WAAA,CAAA,CAAA;AAC9C,EAAA,IAAAC,SAAA,GAAoCC,eAAQ,CAACL,IAAI,CAAC;IAAAM,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAA3CI,IAAAA,KAAK,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,IAAI,GAAAH,UAAA,CAAA,CAAA,CAAA;IAAII,QAAQ,GAAAJ,UAAA,CAAA,CAAA,CAAA,CAARI,QAAQ,CAAA;EAE9B,oBACEC,cAAA,CAACC,4BAAgB,EAAAC,eAAA,CAAAA,eAAA,KACXL,KAAK,CAAA,EAAA,EAAA,EAAA;IACTM,KAAK,EAAEL,IAAI,CAACM,OAAO,GAAGN,IAAI,CAACK,KAAK,GAAG,EAAG;AACtCE,IAAAA,QAAQ,EAAEN,QAAAA;GACNT,EAAAA,KAAK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@bigbinary/neetoui/Input');
|
|
37
37
|
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
38
38
|
require('formik');
|
|
39
|
-
var phoneNumber = require('./phone-number-
|
|
39
|
+
var phoneNumber = require('./phone-number-DcpFFYZS.js');
|
|
40
40
|
var jsxRuntime = require('react/jsx-runtime');
|
|
41
|
+
require('@bigbinary/neeto-commons-frontend/utils/general');
|
|
42
|
+
require('@bigbinary/neeto-icons/Copy');
|
|
41
43
|
require('@babel/runtime/helpers/asyncToGenerator');
|
|
42
44
|
require('@babel/runtime/regenerator');
|
|
43
45
|
require('i18next');
|
|
@@ -48,8 +50,6 @@ require('axios');
|
|
|
48
50
|
var injectCss = require('./inject-css-vQvjPR2x.js');
|
|
49
51
|
require('@bigbinary/neeto-icons/Help');
|
|
50
52
|
require('@bigbinary/neetoui/Popover');
|
|
51
|
-
require('@bigbinary/neeto-commons-frontend/utils/general');
|
|
52
|
-
require('@bigbinary/neeto-icons/Copy');
|
|
53
53
|
require('./DateFormat.js');
|
|
54
54
|
require('@bigbinary/neeto-commons-frontend/react-utils/useTimer');
|
|
55
55
|
require('@bigbinary/neeto-commons-frontend/utils/datetime');
|
|
@@ -309,7 +309,7 @@ var PhoneNumberInput = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
309
309
|
});
|
|
310
310
|
PhoneNumberInput.displayName = "PhoneNumberInput";
|
|
311
311
|
|
|
312
|
-
var css = "@import url(\"https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap\");.neeto-molecules-phone-number-input__flag{font-family:Noto Color Emoji,-apple-system,BlinkMacSystemFont,Inter,Arial,Segoe UI,Roboto,Oxygen,Ubuntu,Fira Sans,Droid Sans,Helvetica Neue,sans-serif!important;font-style:normal;font-weight:400}";
|
|
312
|
+
var css = "@import url(\"https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap\");.neeto-molecules-phone-number-input__flag{font-family:Noto Color Emoji,-apple-system,BlinkMacSystemFont,Inter,Arial,Segoe UI,Roboto,Oxygen,Ubuntu,Fira Sans,Droid Sans,Helvetica Neue,sans-serif!important;font-style:normal;font-weight:400}.neeto-molecules-phone-number{display:block!important}";
|
|
313
313
|
injectCss.n(css,{});
|
|
314
314
|
|
|
315
315
|
exports.PhoneNumberInput = PhoneNumberInput;
|
|
@@ -317,4 +317,4 @@ exports.SingleValue = SingleValue$1;
|
|
|
317
317
|
exports.getPhoneData = getPhoneData;
|
|
318
318
|
exports.isPhoneNumberValid = isPhoneNumberValid;
|
|
319
319
|
exports.validation = validation;
|
|
320
|
-
//# sourceMappingURL=phone-number-
|
|
320
|
+
//# sourceMappingURL=phone-number-DcpFFYZS.js.map
|