@cloud-ru/uikit-product-fields-predefined 0.13.3 → 0.13.5

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 (224) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/components/AIDisclaimer/AIDisclaimer.d.ts +4 -0
  3. package/dist/cjs/components/AIDisclaimer/AIDisclaimer.js +13 -0
  4. package/dist/cjs/components/AIDisclaimer/index.d.ts +1 -0
  5. package/dist/cjs/components/AIDisclaimer/index.js +17 -0
  6. package/dist/cjs/components/AIDisclaimer/styles.module.css +21 -0
  7. package/dist/cjs/components/FieldAi/FieldAi.d.ts +20 -0
  8. package/dist/cjs/components/FieldAi/FieldAi.js +66 -0
  9. package/dist/cjs/components/FieldAi/components/CheckItem/CheckItem.d.ts +8 -0
  10. package/dist/cjs/components/FieldAi/components/CheckItem/CheckItem.js +28 -0
  11. package/dist/cjs/components/FieldAi/components/CheckItem/index.d.ts +1 -0
  12. package/dist/cjs/components/FieldAi/components/CheckItem/index.js +17 -0
  13. package/dist/cjs/components/FieldAi/components/CheckItem/styles.module.css +22 -0
  14. package/dist/cjs/components/FieldAi/components/MobileFieldAi/MobileFieldAi.d.ts +5 -0
  15. package/dist/cjs/components/FieldAi/components/MobileFieldAi/MobileFieldAi.js +31 -0
  16. package/dist/cjs/components/FieldAi/components/MobileFieldAi/index.d.ts +1 -0
  17. package/dist/cjs/components/FieldAi/components/MobileFieldAi/index.js +17 -0
  18. package/dist/cjs/components/FieldAi/components/MobileFieldAi/styles.module.css +87 -0
  19. package/dist/cjs/components/FieldAi/components/PasswordValidation/PasswordValidation.d.ts +6 -0
  20. package/dist/cjs/components/FieldAi/components/PasswordValidation/PasswordValidation.js +23 -0
  21. package/dist/cjs/components/FieldAi/components/PasswordValidation/index.d.ts +1 -0
  22. package/dist/cjs/components/FieldAi/components/PasswordValidation/index.js +17 -0
  23. package/dist/cjs/components/FieldAi/components/PasswordValidation/styles.module.css +35 -0
  24. package/dist/cjs/components/FieldAi/components/TextArea/TextArea.d.ts +39 -0
  25. package/dist/cjs/components/FieldAi/components/TextArea/TextArea.js +33 -0
  26. package/dist/cjs/components/FieldAi/components/TextArea/index.d.ts +1 -0
  27. package/dist/cjs/components/FieldAi/components/TextArea/index.js +17 -0
  28. package/dist/cjs/components/FieldAi/components/TextArea/styles.module.css +32 -0
  29. package/dist/cjs/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.d.ts +9 -0
  30. package/dist/cjs/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.js +23 -0
  31. package/dist/cjs/components/FieldAi/components/WithPasswordValidation/index.d.ts +1 -0
  32. package/dist/cjs/components/FieldAi/components/WithPasswordValidation/index.js +17 -0
  33. package/dist/cjs/components/FieldAi/components/WithPasswordValidation/styles.module.css +5 -0
  34. package/dist/cjs/components/FieldAi/index.d.ts +1 -0
  35. package/dist/cjs/components/FieldAi/index.js +17 -0
  36. package/dist/cjs/components/FieldAi/styles.module.css +25 -0
  37. package/dist/cjs/components/FieldAi/utils.d.ts +9 -0
  38. package/dist/cjs/components/FieldAi/utils.js +19 -0
  39. package/dist/cjs/components/FieldChat/FieldChat.d.ts +15 -0
  40. package/dist/cjs/components/FieldChat/FieldChat.js +55 -0
  41. package/dist/cjs/components/FieldChat/components/Attachments/Attachments.d.ts +6 -0
  42. package/dist/cjs/components/FieldChat/components/Attachments/Attachments.js +20 -0
  43. package/dist/cjs/components/FieldChat/components/Attachments/index.d.ts +1 -0
  44. package/dist/cjs/components/FieldChat/components/Attachments/index.js +17 -0
  45. package/dist/cjs/components/FieldChat/components/Attachments/styles.module.css +9 -0
  46. package/dist/cjs/components/FieldChat/index.d.ts +1 -0
  47. package/dist/cjs/components/FieldChat/index.js +17 -0
  48. package/dist/cjs/components/FieldChat/styles.module.css +12 -0
  49. package/dist/cjs/components/FieldPhone/FieldPhone.d.ts +25 -0
  50. package/dist/cjs/components/FieldPhone/FieldPhone.js +131 -0
  51. package/dist/cjs/components/FieldPhone/__tests__/constants.d.ts +5 -0
  52. package/dist/cjs/components/FieldPhone/__tests__/constants.js +29 -0
  53. package/dist/cjs/components/FieldPhone/__tests__/formatPhoneNumber.spec.d.ts +1 -0
  54. package/dist/cjs/components/FieldPhone/__tests__/formatPhoneNumber.spec.js +14 -0
  55. package/dist/cjs/components/FieldPhone/__tests__/matchMedia.d.ts +1 -0
  56. package/dist/cjs/components/FieldPhone/__tests__/matchMedia.js +16 -0
  57. package/dist/cjs/components/FieldPhone/constants.d.ts +1 -0
  58. package/dist/cjs/components/FieldPhone/constants.js +4 -0
  59. package/dist/cjs/components/FieldPhone/countries.d.ts +3500 -0
  60. package/dist/cjs/components/FieldPhone/countries.js +1442 -0
  61. package/dist/cjs/components/FieldPhone/hooks/index.d.ts +2 -0
  62. package/dist/cjs/components/FieldPhone/hooks/index.js +18 -0
  63. package/dist/cjs/components/FieldPhone/hooks/useCountries.d.ts +2 -0
  64. package/dist/cjs/components/FieldPhone/hooks/useCountries.js +36 -0
  65. package/dist/cjs/components/FieldPhone/hooks/useMapCountryToOptions.d.ts +2 -0
  66. package/dist/cjs/components/FieldPhone/hooks/useMapCountryToOptions.js +19 -0
  67. package/dist/cjs/components/FieldPhone/index.d.ts +5 -0
  68. package/dist/cjs/components/FieldPhone/index.js +23 -0
  69. package/dist/cjs/components/FieldPhone/styles.module.css +3 -0
  70. package/dist/cjs/components/FieldPhone/types.d.ts +31 -0
  71. package/dist/cjs/components/FieldPhone/types.js +2 -0
  72. package/dist/cjs/components/FieldPhone/utils.d.ts +7 -0
  73. package/dist/cjs/components/FieldPhone/utils.js +57 -0
  74. package/dist/cjs/components/SelectCreate/SelectCreate.d.ts +21 -0
  75. package/dist/cjs/components/SelectCreate/SelectCreate.js +66 -0
  76. package/dist/cjs/components/SelectCreate/SelectFooter/SelectFooter.d.ts +7 -0
  77. package/dist/cjs/components/SelectCreate/SelectFooter/SelectFooter.js +16 -0
  78. package/dist/cjs/components/SelectCreate/SelectFooter/index.d.ts +1 -0
  79. package/dist/cjs/components/SelectCreate/SelectFooter/index.js +17 -0
  80. package/dist/cjs/components/SelectCreate/SelectFooter/styles.module.css +6 -0
  81. package/dist/cjs/components/SelectCreate/index.d.ts +1 -0
  82. package/dist/cjs/components/SelectCreate/index.js +17 -0
  83. package/dist/cjs/components/SelectCreate/types.d.ts +28 -0
  84. package/dist/cjs/components/SelectCreate/types.js +2 -0
  85. package/dist/cjs/components/SelectCreate/useSelectDataStates.d.ts +10 -0
  86. package/dist/cjs/components/SelectCreate/useSelectDataStates.js +26 -0
  87. package/dist/cjs/components/index.d.ts +5 -0
  88. package/dist/cjs/components/index.js +21 -0
  89. package/dist/cjs/helperComponents/FieldSubmitButton/FieldSubmitButton.d.ts +9 -0
  90. package/dist/cjs/helperComponents/FieldSubmitButton/FieldSubmitButton.js +15 -0
  91. package/dist/cjs/helperComponents/FieldSubmitButton/index.d.ts +1 -0
  92. package/dist/cjs/helperComponents/FieldSubmitButton/index.js +17 -0
  93. package/dist/cjs/helperComponents/TextAreaActionsFooter/TextAreaActionsFooter.d.ts +7 -0
  94. package/dist/cjs/helperComponents/TextAreaActionsFooter/TextAreaActionsFooter.js +12 -0
  95. package/dist/cjs/helperComponents/TextAreaActionsFooter/index.d.ts +1 -0
  96. package/dist/cjs/helperComponents/TextAreaActionsFooter/index.js +17 -0
  97. package/dist/cjs/helperComponents/TextAreaActionsFooter/styles.module.css +21 -0
  98. package/dist/cjs/helpers/capitalize.d.ts +1 -0
  99. package/dist/cjs/helpers/capitalize.js +6 -0
  100. package/dist/cjs/helpers/getSymbolsRangeFromMask.d.ts +8 -0
  101. package/dist/cjs/helpers/getSymbolsRangeFromMask.js +17 -0
  102. package/dist/cjs/helpers/index.d.ts +3 -0
  103. package/dist/cjs/helpers/index.js +19 -0
  104. package/dist/cjs/helpers/isTouchDevice.d.ts +2 -0
  105. package/dist/cjs/helpers/isTouchDevice.js +6 -0
  106. package/dist/cjs/hooks/index.d.ts +1 -0
  107. package/dist/cjs/hooks/index.js +17 -0
  108. package/dist/cjs/hooks/useOpen.d.ts +5 -0
  109. package/dist/cjs/hooks/useOpen.js +18 -0
  110. package/dist/cjs/index.d.ts +3 -0
  111. package/dist/cjs/index.js +22 -0
  112. package/dist/esm/components/AIDisclaimer/AIDisclaimer.d.ts +4 -0
  113. package/dist/esm/components/AIDisclaimer/AIDisclaimer.js +7 -0
  114. package/dist/esm/components/AIDisclaimer/index.d.ts +1 -0
  115. package/dist/esm/components/AIDisclaimer/index.js +1 -0
  116. package/dist/esm/components/AIDisclaimer/styles.module.css +21 -0
  117. package/dist/esm/components/FieldAi/FieldAi.d.ts +20 -0
  118. package/dist/esm/components/FieldAi/FieldAi.js +60 -0
  119. package/dist/esm/components/FieldAi/components/CheckItem/CheckItem.d.ts +8 -0
  120. package/dist/esm/components/FieldAi/components/CheckItem/CheckItem.js +22 -0
  121. package/dist/esm/components/FieldAi/components/CheckItem/index.d.ts +1 -0
  122. package/dist/esm/components/FieldAi/components/CheckItem/index.js +1 -0
  123. package/dist/esm/components/FieldAi/components/CheckItem/styles.module.css +22 -0
  124. package/dist/esm/components/FieldAi/components/MobileFieldAi/MobileFieldAi.d.ts +5 -0
  125. package/dist/esm/components/FieldAi/components/MobileFieldAi/MobileFieldAi.js +25 -0
  126. package/dist/esm/components/FieldAi/components/MobileFieldAi/index.d.ts +1 -0
  127. package/dist/esm/components/FieldAi/components/MobileFieldAi/index.js +1 -0
  128. package/dist/esm/components/FieldAi/components/MobileFieldAi/styles.module.css +87 -0
  129. package/dist/esm/components/FieldAi/components/PasswordValidation/PasswordValidation.d.ts +6 -0
  130. package/dist/esm/components/FieldAi/components/PasswordValidation/PasswordValidation.js +17 -0
  131. package/dist/esm/components/FieldAi/components/PasswordValidation/index.d.ts +1 -0
  132. package/dist/esm/components/FieldAi/components/PasswordValidation/index.js +1 -0
  133. package/dist/esm/components/FieldAi/components/PasswordValidation/styles.module.css +35 -0
  134. package/dist/esm/components/FieldAi/components/TextArea/TextArea.d.ts +39 -0
  135. package/dist/esm/components/FieldAi/components/TextArea/TextArea.js +27 -0
  136. package/dist/esm/components/FieldAi/components/TextArea/index.d.ts +1 -0
  137. package/dist/esm/components/FieldAi/components/TextArea/index.js +1 -0
  138. package/dist/esm/components/FieldAi/components/TextArea/styles.module.css +32 -0
  139. package/dist/esm/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.d.ts +9 -0
  140. package/dist/esm/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.js +17 -0
  141. package/dist/esm/components/FieldAi/components/WithPasswordValidation/index.d.ts +1 -0
  142. package/dist/esm/components/FieldAi/components/WithPasswordValidation/index.js +1 -0
  143. package/dist/esm/components/FieldAi/components/WithPasswordValidation/styles.module.css +5 -0
  144. package/dist/esm/components/FieldAi/index.d.ts +1 -0
  145. package/dist/esm/components/FieldAi/index.js +1 -0
  146. package/dist/esm/components/FieldAi/styles.module.css +25 -0
  147. package/dist/esm/components/FieldAi/utils.d.ts +9 -0
  148. package/dist/esm/components/FieldAi/utils.js +15 -0
  149. package/dist/esm/components/FieldChat/FieldChat.d.ts +15 -0
  150. package/dist/esm/components/FieldChat/FieldChat.js +49 -0
  151. package/dist/esm/components/FieldChat/components/Attachments/Attachments.d.ts +6 -0
  152. package/dist/esm/components/FieldChat/components/Attachments/Attachments.js +14 -0
  153. package/dist/esm/components/FieldChat/components/Attachments/index.d.ts +1 -0
  154. package/dist/esm/components/FieldChat/components/Attachments/index.js +1 -0
  155. package/dist/esm/components/FieldChat/components/Attachments/styles.module.css +9 -0
  156. package/dist/esm/components/FieldChat/index.d.ts +1 -0
  157. package/dist/esm/components/FieldChat/index.js +1 -0
  158. package/dist/esm/components/FieldChat/styles.module.css +12 -0
  159. package/dist/esm/components/FieldPhone/FieldPhone.d.ts +25 -0
  160. package/dist/esm/components/FieldPhone/FieldPhone.js +125 -0
  161. package/dist/esm/components/FieldPhone/__tests__/constants.d.ts +5 -0
  162. package/dist/esm/components/FieldPhone/__tests__/constants.js +26 -0
  163. package/dist/esm/components/FieldPhone/__tests__/formatPhoneNumber.spec.d.ts +1 -0
  164. package/dist/esm/components/FieldPhone/__tests__/formatPhoneNumber.spec.js +12 -0
  165. package/dist/esm/components/FieldPhone/__tests__/matchMedia.d.ts +1 -0
  166. package/dist/esm/components/FieldPhone/__tests__/matchMedia.js +14 -0
  167. package/dist/esm/components/FieldPhone/constants.d.ts +1 -0
  168. package/dist/esm/components/FieldPhone/constants.js +1 -0
  169. package/dist/esm/components/FieldPhone/countries.d.ts +3500 -0
  170. package/dist/esm/components/FieldPhone/countries.js +1436 -0
  171. package/dist/esm/components/FieldPhone/hooks/index.d.ts +2 -0
  172. package/dist/esm/components/FieldPhone/hooks/index.js +2 -0
  173. package/dist/esm/components/FieldPhone/hooks/useCountries.d.ts +2 -0
  174. package/dist/esm/components/FieldPhone/hooks/useCountries.js +33 -0
  175. package/dist/esm/components/FieldPhone/hooks/useMapCountryToOptions.d.ts +2 -0
  176. package/dist/esm/components/FieldPhone/hooks/useMapCountryToOptions.js +16 -0
  177. package/dist/esm/components/FieldPhone/index.d.ts +5 -0
  178. package/dist/esm/components/FieldPhone/index.js +4 -0
  179. package/dist/esm/components/FieldPhone/styles.module.css +3 -0
  180. package/dist/esm/components/FieldPhone/types.d.ts +31 -0
  181. package/dist/esm/components/FieldPhone/types.js +1 -0
  182. package/dist/esm/components/FieldPhone/utils.d.ts +7 -0
  183. package/dist/esm/components/FieldPhone/utils.js +51 -0
  184. package/dist/esm/components/SelectCreate/SelectCreate.d.ts +21 -0
  185. package/dist/esm/components/SelectCreate/SelectCreate.js +63 -0
  186. package/dist/esm/components/SelectCreate/SelectFooter/SelectFooter.d.ts +7 -0
  187. package/dist/esm/components/SelectCreate/SelectFooter/SelectFooter.js +10 -0
  188. package/dist/esm/components/SelectCreate/SelectFooter/index.d.ts +1 -0
  189. package/dist/esm/components/SelectCreate/SelectFooter/index.js +1 -0
  190. package/dist/esm/components/SelectCreate/SelectFooter/styles.module.css +6 -0
  191. package/dist/esm/components/SelectCreate/index.d.ts +1 -0
  192. package/dist/esm/components/SelectCreate/index.js +1 -0
  193. package/dist/esm/components/SelectCreate/types.d.ts +28 -0
  194. package/dist/esm/components/SelectCreate/types.js +1 -0
  195. package/dist/esm/components/SelectCreate/useSelectDataStates.d.ts +10 -0
  196. package/dist/esm/components/SelectCreate/useSelectDataStates.js +23 -0
  197. package/dist/esm/components/index.d.ts +5 -0
  198. package/dist/esm/components/index.js +5 -0
  199. package/dist/esm/helperComponents/FieldSubmitButton/FieldSubmitButton.d.ts +9 -0
  200. package/dist/esm/helperComponents/FieldSubmitButton/FieldSubmitButton.js +12 -0
  201. package/dist/esm/helperComponents/FieldSubmitButton/index.d.ts +1 -0
  202. package/dist/esm/helperComponents/FieldSubmitButton/index.js +1 -0
  203. package/dist/esm/helperComponents/TextAreaActionsFooter/TextAreaActionsFooter.d.ts +7 -0
  204. package/dist/esm/helperComponents/TextAreaActionsFooter/TextAreaActionsFooter.js +6 -0
  205. package/dist/esm/helperComponents/TextAreaActionsFooter/index.d.ts +1 -0
  206. package/dist/esm/helperComponents/TextAreaActionsFooter/index.js +1 -0
  207. package/dist/esm/helperComponents/TextAreaActionsFooter/styles.module.css +21 -0
  208. package/dist/esm/helpers/capitalize.d.ts +1 -0
  209. package/dist/esm/helpers/capitalize.js +3 -0
  210. package/dist/esm/helpers/getSymbolsRangeFromMask.d.ts +8 -0
  211. package/dist/esm/helpers/getSymbolsRangeFromMask.js +14 -0
  212. package/dist/esm/helpers/index.d.ts +3 -0
  213. package/dist/esm/helpers/index.js +3 -0
  214. package/dist/esm/helpers/isTouchDevice.d.ts +2 -0
  215. package/dist/esm/helpers/isTouchDevice.js +3 -0
  216. package/dist/esm/hooks/index.d.ts +1 -0
  217. package/dist/esm/hooks/index.js +1 -0
  218. package/dist/esm/hooks/useOpen.d.ts +5 -0
  219. package/dist/esm/hooks/useOpen.js +15 -0
  220. package/dist/esm/index.d.ts +3 -0
  221. package/dist/esm/index.js +3 -0
  222. package/dist/tsconfig.cjs.tsbuildinfo +1 -0
  223. package/dist/tsconfig.esm.tsbuildinfo +1 -0
  224. package/package.json +9 -8
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
3
+ import { ValidationPassword } from '../../utils';
4
+ export type WithPasswordTooltipProps = WithLayoutType<{
5
+ showValidation?: boolean;
6
+ children: ReactNode;
7
+ passwordValidation: ValidationPassword;
8
+ }>;
9
+ export declare function WithPasswordValidation({ showValidation, passwordValidation, layoutType, children, }: WithPasswordTooltipProps): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.WithPasswordValidation = WithPasswordValidation;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const uikit_product_mobile_tooltip_1 = require("@sbercloud/uikit-product-mobile-tooltip");
9
+ const helpers_1 = require("../../../../helpers");
10
+ const PasswordValidation_1 = require("../PasswordValidation");
11
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
12
+ function WithPasswordValidation({ showValidation, passwordValidation, layoutType, children, }) {
13
+ if ((0, helpers_1.isTouchDevice)(layoutType)) {
14
+ if (showValidation) {
15
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.validationContainer, children: [(0, jsx_runtime_1.jsx)(PasswordValidation_1.PasswordValidation, { passwordValidation: passwordValidation, layoutType: layoutType }), children] }));
16
+ }
17
+ return children;
18
+ }
19
+ if (showValidation) {
20
+ return ((0, jsx_runtime_1.jsx)(uikit_product_mobile_tooltip_1.AdaptiveTooltip, { placement: 'left-end', layoutType: layoutType, tip: (0, jsx_runtime_1.jsx)(PasswordValidation_1.PasswordValidation, { passwordValidation: passwordValidation, layoutType: layoutType }), offset: 8, children: children }));
21
+ }
22
+ return children;
23
+ }
@@ -0,0 +1 @@
1
+ export * from './WithPasswordValidation';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./WithPasswordValidation"), exports);
@@ -0,0 +1,5 @@
1
+ .validationContainer{
2
+ display:flex;
3
+ flex-direction:column;
4
+ gap:8px;
5
+ }
@@ -0,0 +1 @@
1
+ export * from './FieldAi';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./FieldAi"), exports);
@@ -0,0 +1,25 @@
1
+ .wrapper{
2
+ display:flex;
3
+ flex-direction:column;
4
+ gap:var(--dimension-050m, 4px);
5
+ }
6
+
7
+ .secured textarea{
8
+ -webkit-text-security:disc;
9
+ text-security:disc;
10
+ }
11
+
12
+ .mobileSubmitButton{
13
+ position:relative !important;
14
+ flex-shrink:0 !important;
15
+ }
16
+ .mobileSubmitButton:after{
17
+ content:"";
18
+ display:flex;
19
+ width:48px;
20
+ height:48px;
21
+ position:absolute;
22
+ top:50%;
23
+ left:50%;
24
+ transform:translate(-50%, -50%);
25
+ }
@@ -0,0 +1,9 @@
1
+ export type ValidationPassword = {
2
+ onlyLatin: boolean;
3
+ minLength: boolean;
4
+ hasLetterCases: boolean;
5
+ hasNumber: boolean;
6
+ hasSymbol: boolean;
7
+ noSpaces: boolean;
8
+ };
9
+ export declare const getValidationPassword: (password?: string) => ValidationPassword;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getValidationPassword = void 0;
4
+ const MIN_PASSWORD_LENGTH = 8;
5
+ const NUMBER_REGEX = /[0-9]/;
6
+ const CAPITAL_REGEX = /\p{Lu}/u;
7
+ const LOWER_REGEX = /\p{Ll}/u;
8
+ const SYMBOLS_REGEX = /[\p{P}\p{S}]/u;
9
+ const NO_SPACES = /^\S*$/u;
10
+ const LATIN_REGEX = /^[a-zA-Z0-9\p{P}\p{S}]+$/u;
11
+ const getValidationPassword = (password = '') => ({
12
+ onlyLatin: Boolean(password.match(LATIN_REGEX)),
13
+ minLength: password.length >= MIN_PASSWORD_LENGTH,
14
+ hasLetterCases: Boolean(password.match(CAPITAL_REGEX)) && Boolean(password.match(LOWER_REGEX)),
15
+ hasNumber: Boolean(password.match(NUMBER_REGEX)),
16
+ hasSymbol: Boolean(password.match(SYMBOLS_REGEX)),
17
+ noSpaces: Boolean(password.match(NO_SPACES)),
18
+ });
19
+ exports.getValidationPassword = getValidationPassword;
@@ -0,0 +1,15 @@
1
+ import { FieldTextAreaProps } from '@sbercloud/uikit-product-mobile-fields';
2
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
3
+ import { AttachmentSquareProps } from '@snack-uikit/attachment';
4
+ import { FileUploadProps } from '@snack-uikit/drop-zone';
5
+ export type FieldChatProps = WithLayoutType<Omit<FieldTextAreaProps, 'placeholder' | 'hint' | 'labelTooltip' | 'label' | 'required' | 'size' | 'spellCheck' | 'footer'> & {
6
+ /** Колбек действия при отправке */
7
+ handleSubmit(value: string): void;
8
+ attachment?: Pick<FileUploadProps, 'onFilesUpload' | 'accept'> & {
9
+ /** Список загруженных файлов */
10
+ files?: File[];
11
+ /** Колбек действия при удалении прикрепленного файла */
12
+ onFileDelete: AttachmentSquareProps['onDelete'];
13
+ };
14
+ }>;
15
+ export declare function FieldChat({ handleSubmit: handleSubmitProp, value, layoutType, attachment, ...props }: FieldChatProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.FieldChat = FieldChat;
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const react_1 = require("react");
20
+ const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
21
+ const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
22
+ const uikit_product_mobile_fields_1 = require("@sbercloud/uikit-product-mobile-fields");
23
+ const button_1 = require("@snack-uikit/button");
24
+ const drop_zone_1 = require("@snack-uikit/drop-zone");
25
+ const tooltip_1 = require("@snack-uikit/tooltip");
26
+ const FieldSubmitButton_1 = require("../../helperComponents/FieldSubmitButton");
27
+ const TextAreaActionsFooter_1 = require("../../helperComponents/TextAreaActionsFooter");
28
+ const Attachments_1 = require("./components/Attachments");
29
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
30
+ function FieldChat(_a) {
31
+ var { handleSubmit: handleSubmitProp, value, layoutType, attachment } = _a, props = __rest(_a, ["handleSubmit", "value", "layoutType", "attachment"]);
32
+ const { t } = (0, uikit_product_locale_1.useLocale)('FieldsPredefined');
33
+ const isMobile = layoutType === 'mobile';
34
+ const files = (0, react_1.useMemo)(() => {
35
+ var _a, _b;
36
+ return (_b = (_a = attachment === null || attachment === void 0 ? void 0 : attachment.files) === null || _a === void 0 ? void 0 : _a.map(file => ({
37
+ file,
38
+ onDelete: attachment === null || attachment === void 0 ? void 0 : attachment.onFileDelete,
39
+ }))) !== null && _b !== void 0 ? _b : [];
40
+ }, [attachment === null || attachment === void 0 ? void 0 : attachment.files, attachment === null || attachment === void 0 ? void 0 : attachment.onFileDelete]);
41
+ const isValueValid = (typeof value === 'string' && value.trim().length > 0) || files.length > 0;
42
+ const handleSubmit = () => {
43
+ if (isValueValid) {
44
+ handleSubmitProp(value !== null && value !== void 0 ? value : '');
45
+ }
46
+ };
47
+ const handleKeyDown = e => {
48
+ if (e.key === 'Enter' && !e.shiftKey) {
49
+ e.preventDefault();
50
+ handleSubmit();
51
+ return;
52
+ }
53
+ };
54
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.fieldChat, "data-layout-type": layoutType, children: [isMobile && (0, jsx_runtime_1.jsx)(Attachments_1.Attachments, { files: files, isMobile: isMobile }), (0, jsx_runtime_1.jsx)(uikit_product_mobile_fields_1.AdaptiveFieldTextArea, Object.assign({}, props, { layoutType: layoutType, size: isMobile ? 'l' : 'm', minRows: 1, maxRows: 4, placeholder: t('FieldChat.placeholder'), onKeyDown: handleKeyDown, footer: (0, jsx_runtime_1.jsx)(TextAreaActionsFooter_1.TextAreaActionsFooter, { right: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [attachment && ((0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { tip: t('FieldChat.attachFileTooltip'), hoverDelayOpen: 600, triggerClassName: styles_module_scss_1.default.uploadTooltip, children: (0, jsx_runtime_1.jsx)(drop_zone_1.FileUpload, { mode: 'multiple', onFilesUpload: attachment.onFilesUpload, accept: attachment.accept, children: (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { size: isMobile ? 's' : 'xs', icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.AttachmentSVG, {}) }) }) })), (0, jsx_runtime_1.jsx)(FieldSubmitButton_1.FieldSubmitButton, { active: isValueValid, handleClick: handleSubmit, size: isMobile ? 's' : 'xs' })] }) }) })), !isMobile && (0, jsx_runtime_1.jsx)(Attachments_1.Attachments, { files: files })] }));
55
+ }
@@ -0,0 +1,6 @@
1
+ import { AttachmentSquareProps } from '@snack-uikit/attachment';
2
+ export type AttachmentsProps = {
3
+ files: AttachmentSquareProps[];
4
+ isMobile?: boolean;
5
+ };
6
+ export declare function Attachments({ files, isMobile }: AttachmentsProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Attachments = Attachments;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const attachment_1 = require("@snack-uikit/attachment");
9
+ const scroll_1 = require("@snack-uikit/scroll");
10
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
11
+ function Attachments({ files, isMobile }) {
12
+ if (!files.length) {
13
+ return null;
14
+ }
15
+ const AttachmentComponent = isMobile ? attachment_1.Attachment : attachment_1.AttachmentSquare;
16
+ return ((0, jsx_runtime_1.jsx)(scroll_1.Scroll, { children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.attachments, children: files.map((file, index) => {
17
+ var _a;
18
+ return ((0, jsx_runtime_1.jsx)(AttachmentComponent, Object.assign({ size: 's' }, file, { className: isMobile ? styles_module_scss_1.default.attachment : undefined }), ((_a = file.file) === null || _a === void 0 ? void 0 : _a.name) || index));
19
+ }) }) }));
20
+ }
@@ -0,0 +1 @@
1
+ export * from './Attachments';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Attachments"), exports);
@@ -0,0 +1,9 @@
1
+ .attachments{
2
+ display:flex;
3
+ gap:8px;
4
+ padding:1px 0;
5
+ }
6
+
7
+ .attachment{
8
+ min-width:256px;
9
+ }
@@ -0,0 +1 @@
1
+ export * from './FieldChat';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./FieldChat"), exports);
@@ -0,0 +1,12 @@
1
+ .fieldChat{
2
+ display:flex;
3
+ flex-direction:column;
4
+ gap:11px;
5
+ }
6
+ .fieldChat[data-layout-type=mobile]{
7
+ gap:7px;
8
+ }
9
+
10
+ .uploadTooltip{
11
+ display:flex;
12
+ }
@@ -0,0 +1,25 @@
1
+ import { FieldTextProps } from '@sbercloud/uikit-product-mobile-fields';
2
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
3
+ import { CountrySettings, FieldPhoneOptionsProps } from './types';
4
+ export type FieldPhoneProps = WithLayoutType<Omit<FieldTextProps, 'prefix' | 'prefixIcon' | 'postfix' | 'placeholder' | 'autocomplete' | 'decoratorRef' | 'allowMoreThanMaxLength' | 'onKeyDown' | 'button' | 'maxLength' | 'inputMode'> & {
5
+ /** Включить скролл для основной части списка стран */
6
+ scrollList?: boolean;
7
+ onChange?(value: string): void;
8
+ searchPlaceholder?: string;
9
+ onChangeCountry?(country: FieldPhoneOptionsProps): void;
10
+ } & {
11
+ /** options — объект конфигурации для изменения стандартного списка стран */
12
+ options?: CountrySettings;
13
+ }>;
14
+ export declare const FieldPhone: import("react").ForwardRefExoticComponent<Omit<FieldTextProps, "onKeyDown" | "maxLength" | "placeholder" | "inputMode" | "prefix" | "prefixIcon" | "postfix" | "autocomplete" | "decoratorRef" | "allowMoreThanMaxLength" | "button"> & {
15
+ /** Включить скролл для основной части списка стран */
16
+ scrollList?: boolean;
17
+ onChange?(value: string): void;
18
+ searchPlaceholder?: string;
19
+ onChangeCountry?(country: FieldPhoneOptionsProps): void;
20
+ } & {
21
+ /** options — объект конфигурации для изменения стандартного списка стран */
22
+ options?: CountrySettings;
23
+ } & {
24
+ layoutType: import("@sbercloud/uikit-product-utils").LayoutType;
25
+ } & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.FieldPhone = void 0;
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const classnames_1 = __importDefault(require("classnames"));
20
+ const merge_refs_1 = __importDefault(require("merge-refs"));
21
+ const react_1 = require("react");
22
+ const react_imask_1 = require("react-imask");
23
+ const uikit_product_mobile_dropdown_1 = require("@sbercloud/uikit-product-mobile-dropdown");
24
+ const uikit_product_mobile_fields_1 = require("@sbercloud/uikit-product-mobile-fields");
25
+ const utils_1 = require("@snack-uikit/utils");
26
+ const constants_1 = require("./constants");
27
+ const hooks_1 = require("./hooks");
28
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
29
+ const utils_2 = require("./utils");
30
+ exports.FieldPhone = (0, react_1.forwardRef)((_a, ref) => {
31
+ var { value: valueProp, onChangeCountry, onChange: onChangeProp, showClearButton = true, searchPlaceholder, onPaste, className, scrollList, options: optionsProp } = _a, rest = __rest(_a, ["value", "onChangeCountry", "onChange", "showClearButton", "searchPlaceholder", "onPaste", "className", "scrollList", "options"]);
32
+ const [open, setOpen] = (0, react_1.useState)(false);
33
+ const localRef = (0, react_1.useRef)(null);
34
+ const options = (0, hooks_1.useCountries)(optionsProp);
35
+ const isOnlyOneCountryAvailable = options.length === 1;
36
+ const [country, setCountry] = (0, utils_1.useValueControl)({
37
+ defaultValue: options[0],
38
+ onChange: onChangeCountry,
39
+ });
40
+ const [dropdownSearch, setDropDownSearch] = (0, react_1.useState)('');
41
+ const items = (0, react_1.useMemo)(() => {
42
+ if (dropdownSearch.length) {
43
+ return options.filter(opt => [opt.content.option, opt.content.caption].some(val => String(val).toLowerCase().includes(dropdownSearch.toLowerCase())));
44
+ }
45
+ return options;
46
+ }, [options, dropdownSearch]);
47
+ const maskOptions = (0, react_1.useMemo)(() => ({
48
+ mask: country === null || country === void 0 ? void 0 : country.mask,
49
+ lazy: false,
50
+ placeholderChar: constants_1.PLACEHOLDER_CHAR,
51
+ definitions: {
52
+ X: /[0-9]/,
53
+ },
54
+ }), [country === null || country === void 0 ? void 0 : country.mask]);
55
+ const { ref: iMaskRef, value: iMaskValue, setValue, unmaskedValue, } = (0, react_imask_1.useIMask)(maskOptions, {
56
+ onAccept: (_, maskRef) => {
57
+ const unmasked = maskRef.unmaskedValue;
58
+ const requiredSymbols = country === null || country === void 0 ? void 0 : country.mask.replace(/[\D]/g, '');
59
+ const value = unmasked.length ? `${country === null || country === void 0 ? void 0 : country.content.caption}${requiredSymbols}${unmasked}` : '';
60
+ if (value !== valueProp) {
61
+ onChangeProp === null || onChangeProp === void 0 ? void 0 : onChangeProp(value);
62
+ }
63
+ },
64
+ });
65
+ (0, react_1.useEffect)(() => {
66
+ var _a;
67
+ const requiredSymbols = country === null || country === void 0 ? void 0 : country.mask.replace(/[\D]/g, '');
68
+ const normalizedValue = valueProp === null || valueProp === void 0 ? void 0 : valueProp.replace(((_a = country === null || country === void 0 ? void 0 : country.content.caption) !== null && _a !== void 0 ? _a : '') + requiredSymbols, '');
69
+ if (normalizedValue !== undefined && normalizedValue !== unmaskedValue) {
70
+ setValue(normalizedValue);
71
+ }
72
+ // need to trigger update only on valueProp change
73
+ // eslint-disable-next-line react-hooks/exhaustive-deps
74
+ }, [valueProp]);
75
+ const updateMaskView = (value) => {
76
+ var _a;
77
+ setValue((_a = value === null || value === void 0 ? void 0 : value.replaceAll(/\w/g, ' ')) !== null && _a !== void 0 ? _a : '');
78
+ };
79
+ const handlePaste = e => {
80
+ var _a, _b;
81
+ e.preventDefault();
82
+ const text = ((_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text')) || '';
83
+ const newCountry = (0, utils_2.detectCountryByPhone)(text, options);
84
+ const isCountryChanged = newCountry && newCountry.id !== (country === null || country === void 0 ? void 0 : country.id);
85
+ const currentCountry = isCountryChanged ? newCountry : country;
86
+ const prefixNumber = ((_b = currentCountry === null || currentCountry === void 0 ? void 0 : currentCountry.content.caption) !== null && _b !== void 0 ? _b : '').replace('+', '');
87
+ const prefixNumberWithOptionalPlus = RegExp(`^(\\+?${prefixNumber})`);
88
+ const valueWithoutPrefix = text.replace(prefixNumberWithOptionalPlus, '');
89
+ // костыль, чтобы всегда срабатывала маска
90
+ const newValue = `+${valueWithoutPrefix}`;
91
+ if (isCountryChanged) {
92
+ setCountry(newCountry);
93
+ updateMaskView(newCountry.mask);
94
+ setTimeout(() => setValue(newValue), 0);
95
+ }
96
+ else {
97
+ setValue(newValue);
98
+ }
99
+ onPaste === null || onPaste === void 0 ? void 0 : onPaste(e);
100
+ };
101
+ const handleChangeSelection = (selectedOption) => {
102
+ if (selectedOption && selectedOption !== (country === null || country === void 0 ? void 0 : country.content.option)) {
103
+ const selectedCountry = options.find(opt => opt.id === selectedOption);
104
+ updateMaskView(selectedCountry === null || selectedCountry === void 0 ? void 0 : selectedCountry.mask);
105
+ setCountry(selectedCountry);
106
+ }
107
+ setTimeout(() => { var _a; return (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, 500);
108
+ };
109
+ const handleChange = (value) => {
110
+ var _a;
111
+ // needed only to clear value by clicking on clear button
112
+ if (unmaskedValue && !value) {
113
+ updateMaskView(country === null || country === void 0 ? void 0 : country.mask);
114
+ (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus();
115
+ }
116
+ };
117
+ const showClear = showClearButton && Boolean(unmaskedValue);
118
+ return ((0, jsx_runtime_1.jsx)(uikit_product_mobile_fields_1.AdaptiveFieldText, Object.assign({}, rest, { inputMode: 'tel', "data-test-id": 'field-phone', type: 'tel', ref: (0, merge_refs_1.default)(ref, localRef, iMaskRef), className: (0, classnames_1.default)(className, styles_module_scss_1.default.fieldPhone), "data-empty": !unmaskedValue || undefined, value: iMaskValue, onChange: handleChange, onPaste: handlePaste, showClearButton: showClear, prefix: country === null || country === void 0 ? void 0 : country.content.caption, button: isOnlyOneCountryAvailable
119
+ ? undefined
120
+ : {
121
+ variant: 'before',
122
+ hasArrow: true,
123
+ arrowOpen: open,
124
+ wrapper: button => ((0, jsx_runtime_1.jsx)("div", { role: 'presentation', onClick: e => e.stopPropagation(), children: (0, jsx_runtime_1.jsx)(uikit_product_mobile_dropdown_1.AdaptiveDroplist, { onOpenChange: setOpen, closeDroplistOnItemClick: true, layoutType: rest.layoutType, items: items, selection: { mode: 'single', onChange: handleChangeSelection, value: country === null || country === void 0 ? void 0 : country.id }, scroll: scrollList, search: {
125
+ value: dropdownSearch,
126
+ onChange: setDropDownSearch,
127
+ placeholder: searchPlaceholder,
128
+ }, children: button }) })),
129
+ content: country === null || country === void 0 ? void 0 : country.beforeContent,
130
+ } })));
131
+ });
@@ -0,0 +1,5 @@
1
+ export declare const phoneFormatCases: {
2
+ country: string;
3
+ input: string;
4
+ expected: string;
5
+ }[];
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.phoneFormatCases = void 0;
4
+ exports.phoneFormatCases = [
5
+ { country: 'Russia', input: '+79878887879', expected: '+7 987 888-78-79' },
6
+ { country: 'Russia', input: '+7987****875', expected: '+7 987 ***-*8-75' },
7
+ { country: 'Belarus', input: '+375129876543', expected: '+375 12 987-65-43' },
8
+ { country: 'Kazakhstan', input: '+79878887879', expected: '+7 987 888-78-79' },
9
+ { country: 'Armenia', input: '+37412987654', expected: '+374 12 987-654' },
10
+ { country: 'Kyrgyzstan', input: '+996987888777', expected: '+996 987 888-777' },
11
+ { country: 'Georgia', input: '+995987888777', expected: '+995 987 88-87-77' },
12
+ { country: 'Brazil', input: '+5512345678901', expected: '+55 12 34567-8901' },
13
+ { country: 'India', input: '+911234567890', expected: '+91 12345-67890' },
14
+ { country: 'UnitedArabEmirates', input: '+971123456789', expected: '+971 12 345-6789' },
15
+ { country: 'SaudiArabia', input: '+966123456789', expected: '+966 1 2345-6789' },
16
+ { country: 'SouthAfrica', input: '+27123456789', expected: '+27 12 345-6789' },
17
+ { country: 'Egypt', input: '+201234567890', expected: '+20 12 3456-7890' },
18
+ { country: 'Iran', input: '+981234567890', expected: '+98 123 456-7890' },
19
+ { country: 'Ethiopia', input: '+251123456789', expected: '+251 12 345-6789' },
20
+ { country: 'Romania', input: '+40123456789', expected: '+40 12 345-6789' },
21
+ { country: 'Serbia', input: '+381123456789', expected: '+381 12 345-6789' },
22
+ { country: 'Netherlands', input: '+31123456789', expected: '+31 12 345-6789' },
23
+ { country: 'Azerbaijan', input: '+994123456789', expected: '+994 12 345-67-89' },
24
+ { country: 'Syria', input: '+963123456789', expected: '+963 12 345-6789' },
25
+ { country: 'Cyprus', input: '+35712345678', expected: '+357 12 345678' },
26
+ { country: 'Uzbekistan', input: '+998123456789', expected: '+998 12 345-67-89' },
27
+ { country: 'Tajikistan', input: '+992123456789', expected: '+992 12 345-6789' },
28
+ { country: 'Moldova', input: '+37312345678', expected: '+373 1234 5678' },
29
+ ];
@@ -0,0 +1 @@
1
+ import './matchMedia';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("./matchMedia");
4
+ const vitest_1 = require("vitest");
5
+ const countries_1 = require("../countries");
6
+ const utils_1 = require("../utils");
7
+ const constants_1 = require("./constants");
8
+ (0, vitest_1.describe)('Checking the mask overlay for each number', () => {
9
+ constants_1.phoneFormatCases.forEach(({ country, input, expected }) => {
10
+ (0, vitest_1.it)(`should format the number correctly for ${country}`, () => {
11
+ (0, vitest_1.expect)((0, utils_1.formatPhoneNumber)(input, countries_1.ALL_COUNTRY_CODES)).toBe(expected);
12
+ });
13
+ });
14
+ });
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const vitest_1 = require("vitest");
4
+ Object.defineProperty(window, 'matchMedia', {
5
+ writable: true,
6
+ value: vitest_1.vi.fn().mockImplementation(query => ({
7
+ matches: false,
8
+ media: query,
9
+ onchange: null,
10
+ addListener: vitest_1.vi.fn(),
11
+ removeListener: vitest_1.vi.fn(),
12
+ addEventListener: vitest_1.vi.fn(),
13
+ removeEventListener: vitest_1.vi.fn(),
14
+ dispatchEvent: vitest_1.vi.fn(),
15
+ })),
16
+ });
@@ -0,0 +1 @@
1
+ export declare const PLACEHOLDER_CHAR = "_";
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PLACEHOLDER_CHAR = void 0;
4
+ exports.PLACEHOLDER_CHAR = '_';