infinity-forge 4.9.0 → 4.9.2
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/sites/components/default-pages/blog/components/styles.js +1 -1
- package/dist/sites/components/default-pages/blog/components/styles.js.map +1 -1
- package/dist/system/presentation/components/data/menu/modes/opened/index.js +2 -3
- package/dist/system/presentation/components/data/menu/modes/opened/index.js.map +1 -1
- package/dist/ui/utils/format/remove-digits.js +1 -1
- package/dist/ui/utils/format/remove-digits.js.map +1 -1
- package/dist/ui/utils/phone/index.d.ts +15 -0
- package/dist/ui/utils/phone/index.js +31 -0
- package/dist/ui/utils/phone/index.js.map +1 -0
- package/package.json +1 -1
|
@@ -9,6 +9,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.Box = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
-
exports.Box = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: 20px;\n padding: 20px;\n\n background-color: #ffffff;\n border: 1px solid #00000029;\n border-radius: 10px;\n\n h3 {\n margin-bottom: 15px;\n }\n\n .link {\n display: flex;\n border-bottom: 1px solid #00000029;\n padding-bottom: 5px;\n margin-bottom: 8px;\n color: #000;\n }\n\n .input_control {\n margin-bottom: 0;\n }\n\n h4,\n p {\n text-align: center;\n margin: 0;\n }\n\n h4 {\n margin-bottom: 30px;\n }\n\n p + * {\n margin-top: 30px !important;\n }\n\n &.newsletter {\n display: flex;\n flex-direction: column;\n gap: 30px;\n\n h4 {\n margin-bottom: 0;\n }\n\n form {\n padding: 0;\n margin: 0 !important;\n height: fit-content;\n\n #form-error-focus {\n display: none;\n }\n }\n\n input,\n button {\n height: 2.76vw !important;\n min-height: 36px !important;\n border-radius: 5px;\n text-align: center;\n }\n\n input {\n border: 1px solid rgba(0, 0, 0, 0.3);\n margin-bottom: 10px;\n }\n\n input::placeholder {\n opacity: 0.6;\n }\n\n button {\n padding: 0;\n border: none;\n color: #fff;\n min-width: 100%;\n height: 2.76vw !important;\n background-color: #df0035;\n }\n\n .captcha {\n width: fit-content;\n margin: 0 auto 10px;\n }\n }\n\n &.sideBoxCategories {\n .categories-box {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n\n a {\n color: #000;\n border: 1px solid #df0035;\n padding: 0 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 5px;\n\n &:hover {\n background-color: #df0035;\n color: #fff;\n }\n }\n }\n }\n\n &.featuredBlogList {\n .detachs-box {\n display: flex;\n flex-direction: column;\n gap: 20px;\n }\n }\n\n &.search {\n form div {\n position: relative;\n }\n\n .button-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .form-button {\n position: absolute;\n top: 50%;\n right: 6px;\n transform: translateY(-50%);\n padding: 2px !important;\n }\n\n .button-search {\n padding: 1px 6px !important;\n border-radius: 10px;\n }\n\n button {\n height: 34px !important;\n }\n\n svg {\n width: 20px !important;\n fill: #fff;\n }\n }\n\n @media only screen and (max-width: 1600px) {\n h4 {\n margin-bottom: 28px;\n }\n\n p + * {\n margin-top: 26px !important;\n }\n\n &.sideBoxCategories {\n .categories-box {\n a {\n padding: 0 13px;\n }\n }\n }\n\n &.featuredBlogList {\n .detachs-box {\n gap: 18px;\n }\n }\n }\n\n @media only screen and (max-width: 1400px) {\n p + * {\n margin-top: 22px !important;\n }\n\n &.sideBoxCategories {\n .categories-box {\n a {\n padding: 0 12px;\n }\n }\n }\n\n &.featuredBlogList {\n .detachs-box {\n gap: 15px;\n }\n }\n }\n\n @media only screen and (max-width: 1200px) {\n border-radius: 15px;\n\n p + * {\n margin-top: 20px !important;\n }\n }\n\n @media only screen and (max-width: 1024px) {\n border-radius: 10px;\n\n &.newsletter {\n gap: 20px;\n }\n }\n\n @media only screen and (max-width: 768px) {\n padding: 15px;\n }\n"], ["\n border-radius: 20px;\n padding: 20px;\n\n background-color: #ffffff;\n border: 1px solid #00000029;\n border-radius: 10px;\n\n h3 {\n margin-bottom: 15px;\n }\n\n .link {\n display: flex;\n border-bottom: 1px solid #00000029;\n padding-bottom: 5px;\n margin-bottom: 8px;\n color: #000;\n }\n\n .input_control {\n margin-bottom: 0;\n }\n\n h4,\n p {\n text-align: center;\n margin: 0;\n }\n\n h4 {\n margin-bottom: 30px;\n }\n\n p + * {\n margin-top: 30px !important;\n }\n\n &.newsletter {\n display: flex;\n flex-direction: column;\n gap: 30px;\n\n h4 {\n margin-bottom: 0;\n }\n\n form {\n padding: 0;\n margin: 0 !important;\n height: fit-content;\n\n #form-error-focus {\n display: none;\n }\n }\n\n input,\n button {\n height: 2.76vw !important;\n min-height: 36px !important;\n border-radius: 5px;\n text-align: center;\n }\n\n input {\n border: 1px solid rgba(0, 0, 0, 0.3);\n margin-bottom: 10px;\n }\n\n input::placeholder {\n opacity: 0.6;\n }\n\n button {\n padding: 0;\n border: none;\n color: #fff;\n min-width: 100%;\n height: 2.76vw !important;\n background-color: #df0035;\n }\n\n .captcha {\n width: fit-content;\n margin: 0 auto 10px;\n }\n }\n\n &.sideBoxCategories {\n .categories-box {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n\n a {\n color: #000;\n border: 1px solid #df0035;\n padding: 0 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 5px;\n\n &:hover {\n background-color: #df0035;\n color: #fff;\n }\n }\n }\n }\n\n &.featuredBlogList {\n .detachs-box {\n display: flex;\n flex-direction: column;\n gap: 20px;\n }\n }\n\n &.search {\n form div {\n position: relative;\n }\n\n .button-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .form-button {\n position: absolute;\n top: 50%;\n right: 6px;\n transform: translateY(-50%);\n padding: 2px !important;\n }\n\n .button-search {\n padding: 1px 6px !important;\n border-radius: 10px;\n }\n\n button {\n height: 34px !important;\n }\n\n svg {\n width: 20px !important;\n fill: #fff;\n }\n }\n\n @media only screen and (max-width: 1600px) {\n h4 {\n margin-bottom: 28px;\n }\n\n p + * {\n margin-top: 26px !important;\n }\n\n &.sideBoxCategories {\n .categories-box {\n a {\n padding: 0 13px;\n }\n }\n }\n\n &.featuredBlogList {\n .detachs-box {\n gap: 18px;\n }\n }\n }\n\n @media only screen and (max-width: 1400px) {\n p + * {\n margin-top: 22px !important;\n }\n\n &.sideBoxCategories {\n .categories-box {\n a {\n padding: 0 12px;\n }\n }\n }\n\n &.featuredBlogList {\n .detachs-box {\n gap: 15px;\n }\n }\n }\n\n @media only screen and (max-width: 1200px) {\n border-radius: 15px;\n\n p + * {\n margin-top: 20px !important;\n }\n }\n\n @media only screen and (max-width: 1024px) {\n border-radius: 10px;\n\n &.newsletter {\n gap: 20px;\n }\n }\n\n @media only screen and (max-width: 768px) {\n padding: 15px;\n }\n"])));
|
|
12
|
+
exports.Box = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: 20px;\n padding: 20px;\n\n background-color: #ffffff;\n border: 1px solid #00000029;\n border-radius: 10px;\n\n h3 {\n margin-bottom: 15px;\n }\n\n .link {\n display: flex;\n border-bottom: 1px solid #00000029;\n padding-bottom: 5px;\n margin-bottom: 8px;\n color: #000;\n }\n\n .input_control {\n margin-bottom: 0;\n }\n\n h4,\n p {\n text-align: center;\n margin: 0;\n }\n\n h4 {\n margin-bottom: 30px;\n }\n\n p + * {\n margin-top: 30px !important;\n }\n\n input {\n width: 100%;\n }\n\n &.newsletter {\n display: flex;\n flex-direction: column;\n gap: 30px;\n\n h4 {\n margin-bottom: 0;\n }\n\n form {\n padding: 0;\n margin: 0 !important;\n height: fit-content;\n\n #form-error-focus {\n display: none;\n }\n }\n\n input,\n button {\n height: 2.76vw !important;\n min-height: 36px !important;\n border-radius: 5px;\n text-align: center;\n }\n\n input {\n border: 1px solid rgba(0, 0, 0, 0.3);\n margin-bottom: 10px;\n }\n\n input::placeholder {\n opacity: 0.6;\n }\n\n button {\n gap: 0 !important;\n padding: 0;\n border: none;\n color: #fff;\n min-width: 100%;\n height: 2.76vw !important;\n background-color: #df0035;\n }\n\n .captcha {\n width: fit-content;\n margin: 0 auto 10px;\n }\n }\n\n &.sideBoxCategories {\n .categories-box {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n\n a {\n color: #000;\n border: 1px solid #df0035;\n padding: 0 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 5px;\n\n &:hover {\n background-color: #df0035;\n color: #fff;\n }\n }\n }\n }\n\n &.featuredBlogList {\n .detachs-box {\n display: flex;\n flex-direction: column;\n gap: 20px;\n }\n }\n\n &.search {\n form div {\n position: relative;\n }\n\n .button-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .form-button {\n position: absolute;\n top: 50%;\n right: 6px;\n transform: translateY(-50%);\n padding: 2px !important;\n }\n\n .button-search {\n padding: 1px 6px !important;\n border-radius: 10px;\n }\n\n button {\n height: 34px !important;\n }\n\n svg {\n width: 20px !important;\n fill: #fff;\n }\n }\n\n @media only screen and (max-width: 1600px) {\n h4 {\n margin-bottom: 28px;\n }\n\n p + * {\n margin-top: 26px !important;\n }\n\n &.sideBoxCategories {\n .categories-box {\n a {\n padding: 0 13px;\n }\n }\n }\n\n &.featuredBlogList {\n .detachs-box {\n gap: 18px;\n }\n }\n }\n\n @media only screen and (max-width: 1400px) {\n p + * {\n margin-top: 22px !important;\n }\n\n &.sideBoxCategories {\n .categories-box {\n a {\n padding: 0 12px;\n }\n }\n }\n\n &.featuredBlogList {\n .detachs-box {\n gap: 15px;\n }\n }\n }\n\n @media only screen and (max-width: 1200px) {\n border-radius: 15px;\n\n p + * {\n margin-top: 20px !important;\n }\n }\n\n @media only screen and (max-width: 1024px) {\n border-radius: 10px;\n\n &.newsletter {\n gap: 20px;\n }\n }\n\n @media only screen and (max-width: 768px) {\n padding: 15px;\n }\n"], ["\n border-radius: 20px;\n padding: 20px;\n\n background-color: #ffffff;\n border: 1px solid #00000029;\n border-radius: 10px;\n\n h3 {\n margin-bottom: 15px;\n }\n\n .link {\n display: flex;\n border-bottom: 1px solid #00000029;\n padding-bottom: 5px;\n margin-bottom: 8px;\n color: #000;\n }\n\n .input_control {\n margin-bottom: 0;\n }\n\n h4,\n p {\n text-align: center;\n margin: 0;\n }\n\n h4 {\n margin-bottom: 30px;\n }\n\n p + * {\n margin-top: 30px !important;\n }\n\n input {\n width: 100%;\n }\n\n &.newsletter {\n display: flex;\n flex-direction: column;\n gap: 30px;\n\n h4 {\n margin-bottom: 0;\n }\n\n form {\n padding: 0;\n margin: 0 !important;\n height: fit-content;\n\n #form-error-focus {\n display: none;\n }\n }\n\n input,\n button {\n height: 2.76vw !important;\n min-height: 36px !important;\n border-radius: 5px;\n text-align: center;\n }\n\n input {\n border: 1px solid rgba(0, 0, 0, 0.3);\n margin-bottom: 10px;\n }\n\n input::placeholder {\n opacity: 0.6;\n }\n\n button {\n gap: 0 !important;\n padding: 0;\n border: none;\n color: #fff;\n min-width: 100%;\n height: 2.76vw !important;\n background-color: #df0035;\n }\n\n .captcha {\n width: fit-content;\n margin: 0 auto 10px;\n }\n }\n\n &.sideBoxCategories {\n .categories-box {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n\n a {\n color: #000;\n border: 1px solid #df0035;\n padding: 0 14px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 5px;\n\n &:hover {\n background-color: #df0035;\n color: #fff;\n }\n }\n }\n }\n\n &.featuredBlogList {\n .detachs-box {\n display: flex;\n flex-direction: column;\n gap: 20px;\n }\n }\n\n &.search {\n form div {\n position: relative;\n }\n\n .button-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .form-button {\n position: absolute;\n top: 50%;\n right: 6px;\n transform: translateY(-50%);\n padding: 2px !important;\n }\n\n .button-search {\n padding: 1px 6px !important;\n border-radius: 10px;\n }\n\n button {\n height: 34px !important;\n }\n\n svg {\n width: 20px !important;\n fill: #fff;\n }\n }\n\n @media only screen and (max-width: 1600px) {\n h4 {\n margin-bottom: 28px;\n }\n\n p + * {\n margin-top: 26px !important;\n }\n\n &.sideBoxCategories {\n .categories-box {\n a {\n padding: 0 13px;\n }\n }\n }\n\n &.featuredBlogList {\n .detachs-box {\n gap: 18px;\n }\n }\n }\n\n @media only screen and (max-width: 1400px) {\n p + * {\n margin-top: 22px !important;\n }\n\n &.sideBoxCategories {\n .categories-box {\n a {\n padding: 0 12px;\n }\n }\n }\n\n &.featuredBlogList {\n .detachs-box {\n gap: 15px;\n }\n }\n }\n\n @media only screen and (max-width: 1200px) {\n border-radius: 15px;\n\n p + * {\n margin-top: 20px !important;\n }\n }\n\n @media only screen and (max-width: 1024px) {\n border-radius: 10px;\n\n &.newsletter {\n gap: 20px;\n }\n }\n\n @media only screen and (max-width: 768px) {\n padding: 15px;\n }\n"])));
|
|
13
13
|
var templateObject_1;
|
|
14
14
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../src/sites/components/default-pages/blog/components/styles.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,wEAAsC;AAEzB,QAAA,GAAG,GAAG,2BAAM,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../../../../src/sites/components/default-pages/blog/components/styles.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,wEAAsC;AAEzB,QAAA,GAAG,GAAG,2BAAM,CAAC,GAAG,2lHAAA,whHA8N5B,KAAA"}
|
|
@@ -38,13 +38,12 @@ var system_1 = require("../../../../../../../system/index.js");
|
|
|
38
38
|
var S = __importStar(require("./styles.js"));
|
|
39
39
|
function OpenedMenu() {
|
|
40
40
|
var _a;
|
|
41
|
+
var window = (0, ui_1.useWindow)();
|
|
41
42
|
var data = (0, system_1.useLoadMenu)().data;
|
|
42
43
|
var header = (0, ui_1.useElementId)({ id: 'header' });
|
|
43
|
-
var window = (0, ui_1.useWindow)();
|
|
44
44
|
var _b = (0, system_1.useMenu)(), openMenu = _b.openMenu, setOpenMenu = _b.setOpenMenu;
|
|
45
|
-
var roleUser = (0, system_1.useAuthAdmin)().roleUser;
|
|
46
45
|
var isMobile = (window === null || window === void 0 ? void 0 : window.innerWidth) <= 1024;
|
|
47
|
-
return ((0, jsx_runtime_1.jsxs)(ui_1.Error, { name: 'OpenedMenu', children: [openMenu && isMobile && (0, jsx_runtime_1.jsx)(exports.Overlay, { onClick: function () { return setOpenMenu(false); } }), (0, jsx_runtime_1.jsx)(S.OpenedMenu, { className: isMobile && openMenu ? 'open' : '', style: { height: "calc(100dvh - ".concat((header === null || header === void 0 ? void 0 : header.offsetHeight) + 30, "px)") }, children: (_a = data === null || data === void 0 ? void 0 : data.items) === null || _a === void 0 ? void 0 : _a.map(function (item, index) { return ((0, jsx_runtime_1.jsx)("ul", { children:
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)(ui_1.Error, { name: 'OpenedMenu', children: [openMenu && isMobile && (0, jsx_runtime_1.jsx)(exports.Overlay, { onClick: function () { return setOpenMenu(false); } }), (0, jsx_runtime_1.jsx)(S.OpenedMenu, { className: isMobile && openMenu ? 'open' : '', style: { height: "calc(100dvh - ".concat((header === null || header === void 0 ? void 0 : header.offsetHeight) + 30, "px)") }, children: (_a = data === null || data === void 0 ? void 0 : data.items) === null || _a === void 0 ? void 0 : _a.map(function (item, index) { return ((0, jsx_runtime_1.jsx)("ul", { children: (0, jsx_runtime_1.jsx)(system_1.MenuItem, { item: item, index: index }, 'menu-item' + index + item.title) }, item.id + index)); }) })] }));
|
|
48
47
|
}
|
|
49
48
|
exports.OpenedMenu = OpenedMenu;
|
|
50
49
|
exports.Overlay = (0, styled_components_1.default)('div')(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100dvh;\n background: rgba(0, 0, 0, 0.4);\n z-index: 7;\n"], ["\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100dvh;\n background: rgba(0, 0, 0, 0.4);\n z-index: 7;\n"])));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../src/system/presentation/components/data/menu/modes/opened/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wEAAsC;AAEtC,2BAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../src/system/presentation/components/data/menu/modes/opened/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wEAAsC;AAEtC,2BAAqD;AACrD,mCAAyD;AAEzD,0CAA6B;AAE7B,SAAgB,UAAU;;IACxB,IAAM,MAAM,GAAG,IAAA,cAAS,GAAE,CAAA;IAClB,IAAA,IAAI,GAAK,IAAA,oBAAW,GAAE,KAAlB,CAAkB;IAC9B,IAAM,MAAM,GAAG,IAAA,iBAAY,EAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAA;IACvC,IAAA,KAA4B,IAAA,gBAAO,GAAE,EAAnC,QAAQ,cAAA,EAAE,WAAW,iBAAc,CAAA;IAE3C,IAAM,QAAQ,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,KAAI,IAAI,CAAA;IAE3C,OAAO,CACL,wBAAC,UAAK,IAAC,IAAI,EAAC,YAAY,aACrB,QAAQ,IAAI,QAAQ,IAAI,uBAAC,eAAO,IAAC,OAAO,EAAE,cAAM,OAAA,WAAW,CAAC,KAAK,CAAC,EAAlB,CAAkB,GAAI,EAEvE,uBAAC,CAAC,CAAC,UAAU,IACX,SAAS,EAAE,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAC7C,KAAK,EAAE,EAAE,MAAM,EAAE,wBAAiB,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,YAAY,IAAG,EAAE,QAAK,EAAE,YAEjE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,0CAAE,GAAG,CAAC,UAAC,IAAI,EAAE,KAAK,IAAK,OAAA,CACjC,yCACI,uBAAC,iBAAQ,IAAwC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,IAA1D,WAAW,GAAG,KAAK,GAAG,IAAI,CAAC,KAAK,CAA8B,IADxE,IAAI,CAAC,EAAE,GAAG,KAAK,CAEnB,CACN,EAJkC,CAIlC,CAAC,GACW,IACT,CACT,CAAA;AACH,CAAC;AAxBD,gCAwBC;AAEY,QAAA,OAAO,GAAG,IAAA,2BAAM,EAAC,KAAK,CAAC,uMAAA,oIAQnC,KAAA"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.removeDigits = void 0;
|
|
4
4
|
function removeDigits(word) {
|
|
5
5
|
var _a;
|
|
6
|
-
return (_a = String(word)) === null || _a === void 0 ? void 0 : _a.replace(/[^0-9]/g,
|
|
6
|
+
return (_a = String(word)) === null || _a === void 0 ? void 0 : _a.replace(/[^0-9]/g, '');
|
|
7
7
|
}
|
|
8
8
|
exports.removeDigits = removeDigits;
|
|
9
9
|
//# sourceMappingURL=remove-digits.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove-digits.js","sourceRoot":"","sources":["../../../../src/ui/utils/format/remove-digits.ts"],"names":[],"mappings":";;;AAAA,SAAgB,YAAY,CAAC,IAAY;;IACvC,OAAO,MAAA,MAAM,CAAC,IAAI,CAAC,0CAAE,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"remove-digits.js","sourceRoot":"","sources":["../../../../src/ui/utils/format/remove-digits.ts"],"names":[],"mappings":";;;AAAA,SAAgB,YAAY,CAAC,IAAY;;IACvC,OAAO,MAAA,MAAM,CAAC,IAAI,CAAC,0CAAE,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;AAC7C,CAAC;AAFD,oCAEC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type Phone = {
|
|
2
|
+
phoneNumber: string;
|
|
3
|
+
countryCode?: string;
|
|
4
|
+
};
|
|
5
|
+
declare function generateWhatsappUrl({ countryCode, message, phoneNumber, }: {
|
|
6
|
+
message?: string;
|
|
7
|
+
} & Phone): string;
|
|
8
|
+
declare function generatePhoneUrl({ countryCode, phoneNumber }: Phone): string;
|
|
9
|
+
declare const phone: {
|
|
10
|
+
generatePhoneUrl: typeof generatePhoneUrl;
|
|
11
|
+
whatsapp: {
|
|
12
|
+
generateWhatsappUrl: typeof generateWhatsappUrl;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export { phone, generatePhoneUrl, generateWhatsappUrl };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateWhatsappUrl = exports.generatePhoneUrl = exports.phone = void 0;
|
|
4
|
+
var ui_1 = require("../../../ui/index.js");
|
|
5
|
+
function formatPhoneNumber(_a) {
|
|
6
|
+
var phoneNumber = _a.phoneNumber, _b = _a.countryCode, countryCode = _b === void 0 ? '55' : _b;
|
|
7
|
+
if (!phoneNumber)
|
|
8
|
+
return 'Número não informado';
|
|
9
|
+
var formattedNumber = phoneNumber === null || phoneNumber === void 0 ? void 0 : phoneNumber.replaceAll(/\D/g, '');
|
|
10
|
+
if (!(0, ui_1.validatePhone)(formattedNumber))
|
|
11
|
+
return 'Numero inválido';
|
|
12
|
+
return "".concat(countryCode).concat(formattedNumber);
|
|
13
|
+
}
|
|
14
|
+
function generateWhatsappUrl(_a) {
|
|
15
|
+
var countryCode = _a.countryCode, message = _a.message, phoneNumber = _a.phoneNumber;
|
|
16
|
+
var phoneNumberFormatted = formatPhoneNumber({ phoneNumber: phoneNumber, countryCode: countryCode });
|
|
17
|
+
return "https://wa.me/".concat(phoneNumberFormatted, "?text=").concat(encodeURIComponent(message || ''));
|
|
18
|
+
}
|
|
19
|
+
exports.generateWhatsappUrl = generateWhatsappUrl;
|
|
20
|
+
function generatePhoneUrl(_a) {
|
|
21
|
+
var countryCode = _a.countryCode, phoneNumber = _a.phoneNumber;
|
|
22
|
+
var phoneNumberFormatted = formatPhoneNumber({ phoneNumber: phoneNumber, countryCode: countryCode });
|
|
23
|
+
return "tel:+".concat(phoneNumberFormatted);
|
|
24
|
+
}
|
|
25
|
+
exports.generatePhoneUrl = generatePhoneUrl;
|
|
26
|
+
var phone = {
|
|
27
|
+
generatePhoneUrl: generatePhoneUrl,
|
|
28
|
+
whatsapp: { generateWhatsappUrl: generateWhatsappUrl },
|
|
29
|
+
};
|
|
30
|
+
exports.phone = phone;
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/utils/phone/index.ts"],"names":[],"mappings":";;;AAAA,2BAAoC;AAIpC,SAAS,iBAAiB,CAAC,EAA0C;QAAxC,WAAW,iBAAA,EAAE,mBAAkB,EAAlB,WAAW,mBAAG,IAAI,KAAA;IAC1D,IAAI,CAAC,WAAW;QAAE,OAAO,sBAAsB,CAAA;IAE/C,IAAM,eAAe,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAE1D,IAAI,CAAC,IAAA,kBAAa,EAAC,eAAe,CAAC;QAAE,OAAO,kBAAkB,CAAA;IAE9D,OAAO,UAAG,WAAW,SAAG,eAAe,CAAE,CAAA;AAC3C,CAAC;AAED,SAAS,mBAAmB,CAAC,EAMpB;QALP,WAAW,iBAAA,EACX,OAAO,aAAA,EACP,WAAW,iBAAA;IAIX,IAAM,oBAAoB,GAAG,iBAAiB,CAAC,EAAE,WAAW,aAAA,EAAE,WAAW,aAAA,EAAE,CAAC,CAAA;IAE5E,OAAO,wBAAiB,oBAAoB,mBAAS,kBAAkB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAE,CAAA;AAC1F,CAAC;AAaiC,kDAAmB;AAXrD,SAAS,gBAAgB,CAAC,EAAmC;QAAjC,WAAW,iBAAA,EAAE,WAAW,iBAAA;IAClD,IAAM,oBAAoB,GAAG,iBAAiB,CAAC,EAAE,WAAW,aAAA,EAAE,WAAW,aAAA,EAAE,CAAC,CAAA;IAE5E,OAAO,eAAQ,oBAAoB,CAAE,CAAA;AACvC,CAAC;AAOe,4CAAgB;AALhC,IAAM,KAAK,GAAG;IACZ,gBAAgB,kBAAA;IAChB,QAAQ,EAAE,EAAE,mBAAmB,qBAAA,EAAE;CAClC,CAAA;AAEQ,sBAAK"}
|