@redneckz/wildless-cms-uni-blocks 0.14.559 → 0.14.561

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 (105) hide show
  1. package/bundle/bundle.umd.js +40 -29
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationForm/MiddleNameField.d.ts +2 -0
  4. package/bundle/components/ApplicationForm/NameField.d.ts +2 -0
  5. package/bundle/components/ApplicationForm/PhoneField.d.ts +2 -0
  6. package/bundle/components/ApplicationForm/SurnameField.d.ts +2 -0
  7. package/bundle/ui-kit/Checkbox/CheckboxGroup.d.ts +2 -0
  8. package/bundle/ui-kit/Checkbox/CheckboxProps.d.ts +6 -0
  9. package/dist/components/ApplicationForm/MiddleNameField.d.ts +2 -0
  10. package/dist/components/ApplicationForm/MiddleNameField.js +7 -0
  11. package/dist/components/ApplicationForm/MiddleNameField.js.map +1 -0
  12. package/dist/components/ApplicationForm/NameField.d.ts +2 -0
  13. package/dist/components/ApplicationForm/NameField.js +12 -0
  14. package/dist/components/ApplicationForm/NameField.js.map +1 -0
  15. package/dist/components/ApplicationForm/PhoneField.d.ts +2 -0
  16. package/dist/components/ApplicationForm/PhoneField.js +9 -0
  17. package/dist/components/ApplicationForm/PhoneField.js.map +1 -0
  18. package/dist/components/ApplicationForm/SurnameField.d.ts +2 -0
  19. package/dist/components/ApplicationForm/SurnameField.js +9 -0
  20. package/dist/components/ApplicationForm/SurnameField.js.map +1 -0
  21. package/dist/components/ApplicationForm/getField.js +8 -5
  22. package/dist/components/ApplicationForm/getField.js.map +1 -1
  23. package/dist/ui-kit/Checkbox/CheckboxGroup.d.ts +2 -0
  24. package/dist/ui-kit/Checkbox/CheckboxGroup.js +20 -0
  25. package/dist/ui-kit/Checkbox/CheckboxGroup.js.map +1 -0
  26. package/dist/ui-kit/Checkbox/CheckboxProps.d.ts +6 -0
  27. package/lib/common.css +1 -1
  28. package/lib/components/ApplicationForm/MiddleNameField.d.ts +2 -0
  29. package/lib/components/ApplicationForm/MiddleNameField.js +5 -0
  30. package/lib/components/ApplicationForm/MiddleNameField.js.map +1 -0
  31. package/lib/components/ApplicationForm/NameField.d.ts +2 -0
  32. package/lib/components/ApplicationForm/NameField.js +10 -0
  33. package/lib/components/ApplicationForm/NameField.js.map +1 -0
  34. package/lib/components/ApplicationForm/PhoneField.d.ts +2 -0
  35. package/lib/components/ApplicationForm/PhoneField.js +7 -0
  36. package/lib/components/ApplicationForm/PhoneField.js.map +1 -0
  37. package/lib/components/ApplicationForm/SurnameField.d.ts +2 -0
  38. package/lib/components/ApplicationForm/SurnameField.js +7 -0
  39. package/lib/components/ApplicationForm/SurnameField.js.map +1 -0
  40. package/lib/components/ApplicationForm/getField.js +8 -5
  41. package/lib/components/ApplicationForm/getField.js.map +1 -1
  42. package/lib/ui-kit/Checkbox/CheckboxGroup.d.ts +2 -0
  43. package/lib/ui-kit/Checkbox/CheckboxGroup.js +18 -0
  44. package/lib/ui-kit/Checkbox/CheckboxGroup.js.map +1 -0
  45. package/lib/ui-kit/Checkbox/CheckboxProps.d.ts +6 -0
  46. package/mobile/bundle/bundle.umd.js +40 -29
  47. package/mobile/bundle/bundle.umd.min.js +1 -1
  48. package/mobile/bundle/components/ApplicationForm/MiddleNameField.d.ts +2 -0
  49. package/mobile/bundle/components/ApplicationForm/NameField.d.ts +2 -0
  50. package/mobile/bundle/components/ApplicationForm/PhoneField.d.ts +2 -0
  51. package/mobile/bundle/components/ApplicationForm/SurnameField.d.ts +2 -0
  52. package/mobile/bundle/ui-kit/Checkbox/CheckboxGroup.d.ts +2 -0
  53. package/mobile/bundle/ui-kit/Checkbox/CheckboxProps.d.ts +6 -0
  54. package/mobile/dist/components/ApplicationForm/MiddleNameField.d.ts +2 -0
  55. package/mobile/dist/components/ApplicationForm/MiddleNameField.js +7 -0
  56. package/mobile/dist/components/ApplicationForm/MiddleNameField.js.map +1 -0
  57. package/mobile/dist/components/ApplicationForm/NameField.d.ts +2 -0
  58. package/mobile/dist/components/ApplicationForm/NameField.js +12 -0
  59. package/mobile/dist/components/ApplicationForm/NameField.js.map +1 -0
  60. package/mobile/dist/components/ApplicationForm/PhoneField.d.ts +2 -0
  61. package/mobile/dist/components/ApplicationForm/PhoneField.js +9 -0
  62. package/mobile/dist/components/ApplicationForm/PhoneField.js.map +1 -0
  63. package/mobile/dist/components/ApplicationForm/SurnameField.d.ts +2 -0
  64. package/mobile/dist/components/ApplicationForm/SurnameField.js +9 -0
  65. package/mobile/dist/components/ApplicationForm/SurnameField.js.map +1 -0
  66. package/mobile/dist/components/ApplicationForm/getField.js +8 -5
  67. package/mobile/dist/components/ApplicationForm/getField.js.map +1 -1
  68. package/mobile/dist/ui-kit/Checkbox/CheckboxGroup.d.ts +2 -0
  69. package/mobile/dist/ui-kit/Checkbox/CheckboxGroup.js +20 -0
  70. package/mobile/dist/ui-kit/Checkbox/CheckboxGroup.js.map +1 -0
  71. package/mobile/dist/ui-kit/Checkbox/CheckboxProps.d.ts +6 -0
  72. package/mobile/lib/common.css +1 -1
  73. package/mobile/lib/components/ApplicationForm/MiddleNameField.d.ts +2 -0
  74. package/mobile/lib/components/ApplicationForm/MiddleNameField.js +5 -0
  75. package/mobile/lib/components/ApplicationForm/MiddleNameField.js.map +1 -0
  76. package/mobile/lib/components/ApplicationForm/NameField.d.ts +2 -0
  77. package/mobile/lib/components/ApplicationForm/NameField.js +10 -0
  78. package/mobile/lib/components/ApplicationForm/NameField.js.map +1 -0
  79. package/mobile/lib/components/ApplicationForm/PhoneField.d.ts +2 -0
  80. package/mobile/lib/components/ApplicationForm/PhoneField.js +7 -0
  81. package/mobile/lib/components/ApplicationForm/PhoneField.js.map +1 -0
  82. package/mobile/lib/components/ApplicationForm/SurnameField.d.ts +2 -0
  83. package/mobile/lib/components/ApplicationForm/SurnameField.js +7 -0
  84. package/mobile/lib/components/ApplicationForm/SurnameField.js.map +1 -0
  85. package/mobile/lib/components/ApplicationForm/getField.js +8 -5
  86. package/mobile/lib/components/ApplicationForm/getField.js.map +1 -1
  87. package/mobile/lib/ui-kit/Checkbox/CheckboxGroup.d.ts +2 -0
  88. package/mobile/lib/ui-kit/Checkbox/CheckboxGroup.js +18 -0
  89. package/mobile/lib/ui-kit/Checkbox/CheckboxGroup.js.map +1 -0
  90. package/mobile/lib/ui-kit/Checkbox/CheckboxProps.d.ts +6 -0
  91. package/mobile/src/components/ApplicationForm/MiddleNameField.tsx +7 -0
  92. package/mobile/src/components/ApplicationForm/NameField.tsx +18 -0
  93. package/mobile/src/components/ApplicationForm/PhoneField.tsx +12 -0
  94. package/mobile/src/components/ApplicationForm/SurnameField.tsx +12 -0
  95. package/mobile/src/components/ApplicationForm/getField.tsx +8 -23
  96. package/mobile/src/ui-kit/Checkbox/CheckboxGroup.tsx +52 -0
  97. package/mobile/src/ui-kit/Checkbox/CheckboxProps.ts +7 -0
  98. package/package.json +1 -1
  99. package/src/components/ApplicationForm/MiddleNameField.tsx +7 -0
  100. package/src/components/ApplicationForm/NameField.tsx +18 -0
  101. package/src/components/ApplicationForm/PhoneField.tsx +12 -0
  102. package/src/components/ApplicationForm/SurnameField.tsx +12 -0
  103. package/src/components/ApplicationForm/getField.tsx +8 -23
  104. package/src/ui-kit/Checkbox/CheckboxGroup.tsx +52 -0
  105. package/src/ui-kit/Checkbox/CheckboxProps.ts +7 -0
@@ -1492,30 +1492,6 @@
1492
1492
 
1493
1493
  const InputControl = JSX(({ className, label, value = '', placeholder, error, onChange, onBlur, isTextarea, type, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(Input, { type: type || 'text', "aria-label": label, label: label && rest?.errors ? `${label}*` : label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, isTextarea: isTextarea, placeholder: rest?.errors && !label ? `${placeholder}*` : placeholder }), renderErrorText(error)] })));
1494
1494
 
1495
- const isPlaceholder = (_) => _ === '_';
1496
- const isDigit = (_) => /\d/.test(_);
1497
- const isWildcard = (_) => isPlaceholder(_) || isDigit(_);
1498
- const phonePattern = [...'+7 (___) ___-__-__'];
1499
- const firstPlaceholderIndex = phonePattern.findIndex(isPlaceholder);
1500
- const phoneWildcardIndicies = phonePattern.map((_, i) => isWildcard(_) ? phonePattern.slice(0, i).filter(isWildcard).length : -1);
1501
- function normalizePhone(phone) {
1502
- const phoneNumbers = phone.replace(/\D/g, '');
1503
- const applyPlaceholder = (_, i) => isDigit(_) ? _ : phoneNumbers.charAt(phoneWildcardIndicies[i]) || _;
1504
- const result = phonePattern.map(applyPlaceholder);
1505
- const resultLength = phoneWildcardIndicies.indexOf(phoneNumbers.length - 1) + 1;
1506
- return (resultLength ? result.slice(0, Math.max(firstPlaceholderIndex, resultLength)) : result).join('');
1507
- }
1508
-
1509
- const PhoneInput = JSX(({ children, onChange, ...inputProps }) => {
1510
- const handleChange = useCallback((v) => onChange && onChange(normalizePhone(v)), [onChange]);
1511
- const handleBlur = useCallback((v) => {
1512
- v === '+7 (' ? onChange && onChange('') : null;
1513
- }, []);
1514
- return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (ev) => handleChange(ev?.target?.value || ''), onBlur: (ev) => handleBlur(ev?.target?.value || ''), children: children }));
1515
- });
1516
-
1517
- const InputPhoneControl = JSX(({ className, label, value, error, onChange, onBlur, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(PhoneInput, { "aria-label": label, label: rest?.errors ? `${label}*` : label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, placeholder: "+7 (___) ___-__-__" }), renderErrorText(error)] })));
1518
-
1519
1495
  const SelectControl = JSX(({ className = '', label, error, ...rest }) => (jsxs("div", { className: className, children: [jsx(Select, { ...rest, valid: !error, label: rest?.errors ? `${label}*` : label }), renderErrorText(error)] })));
1520
1496
 
1521
1497
  const getNamesFromInput = (inputs) => Object.values(inputs.filter((_) => _))?.map((_) => _.name);
@@ -1836,6 +1812,13 @@
1836
1812
  return (jsx(SelectControl, { label: "\u041D\u0430\u0441\u0435\u043B\u0435\u043D\u043D\u044B\u0439 \u043F\u0443\u043D\u043A\u0442", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043E\u0442\u0434\u0435\u043B\u0435\u043D\u0438\u0435", options: localities, ...getValidation(field('localities'), validatorObj.localities, input?.required), isSearch: true }));
1837
1813
  });
1838
1814
 
1815
+ const MiddleNameField = JSX(({ field }) => (jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", ...field('middleName') })));
1816
+
1817
+ const NameField = JSX(({ field, input }) => {
1818
+ const { required, ...rest } = input;
1819
+ return (jsx(InputControl, { label: "\u0418\u043C\u044F", ...getValidation(field('name'), validatorObj.name, required), ...rest }));
1820
+ });
1821
+
1839
1822
  const SlideCheckbox = JSX(({ value = false, text, type = 'checkbox', onChange }) => (jsxs("div", { role: type, "aria-checked": value, className: "flex justify-start items-center w-full cursor-pointer mb-s", onClick: () => onChange && onChange(!value), children: [jsx("div", { className: style('relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl', value ? 'bg-primary-main' : 'bg-main-divider'), children: jsx("div", { className: style('absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full', value ? 'left-1/2' : 'left-[5%]') }) }), text ? (jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text })) : null] })));
1840
1823
 
1841
1824
  const OnlineCheckoutField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 \u043E\u043D\u043B\u0430\u0439\u043D-\u043A\u0430\u0441\u0441\u0443", ...field('onlineCheckout') })) : null);
@@ -1845,6 +1828,32 @@
1845
1828
  return (jsx(InputControl, { ...getValidation(field('partnerComments'), validatorObj.partnerComments, required), placeholder: "\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u043D\u0442\u0435\u0440\u0435\u0441\u0443\u044E\u0449\u0438\u0439 \u0432\u0430\u0441 \u0432\u043E\u043F\u0440\u043E\u0441", isTextarea: true, ...rest }));
1846
1829
  });
1847
1830
 
1831
+ const isPlaceholder = (_) => _ === '_';
1832
+ const isDigit = (_) => /\d/.test(_);
1833
+ const isWildcard = (_) => isPlaceholder(_) || isDigit(_);
1834
+ const phonePattern = [...'+7 (___) ___-__-__'];
1835
+ const firstPlaceholderIndex = phonePattern.findIndex(isPlaceholder);
1836
+ const phoneWildcardIndicies = phonePattern.map((_, i) => isWildcard(_) ? phonePattern.slice(0, i).filter(isWildcard).length : -1);
1837
+ function normalizePhone(phone) {
1838
+ const phoneNumbers = phone.replace(/\D/g, '');
1839
+ const applyPlaceholder = (_, i) => isDigit(_) ? _ : phoneNumbers.charAt(phoneWildcardIndicies[i]) || _;
1840
+ const result = phonePattern.map(applyPlaceholder);
1841
+ const resultLength = phoneWildcardIndicies.indexOf(phoneNumbers.length - 1) + 1;
1842
+ return (resultLength ? result.slice(0, Math.max(firstPlaceholderIndex, resultLength)) : result).join('');
1843
+ }
1844
+
1845
+ const PhoneInput = JSX(({ children, onChange, ...inputProps }) => {
1846
+ const handleChange = useCallback((v) => onChange && onChange(normalizePhone(v)), [onChange]);
1847
+ const handleBlur = useCallback((v) => {
1848
+ v === '+7 (' ? onChange && onChange('') : null;
1849
+ }, []);
1850
+ return (jsx(Input, { ...inputProps, onChange: handleChange, onFocus: (ev) => handleChange(ev?.target?.value || ''), onBlur: (ev) => handleBlur(ev?.target?.value || ''), children: children }));
1851
+ });
1852
+
1853
+ const InputPhoneControl = JSX(({ className, label, value, error, onChange, onBlur, ...rest }) => (jsxs("div", { className: style('shrink-0 w-full', className), children: [jsx(PhoneInput, { "aria-label": label, label: rest?.errors ? `${label}*` : label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, placeholder: "+7 (___) ___-__-__" }), renderErrorText(error)] })));
1854
+
1855
+ const PhoneField = JSX(({ field, input }) => (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...getValidation(field('phone'), validatorObj.phone, input?.required) })));
1856
+
1848
1857
  const PosTerminalField = JSX(({ field }) => isAcquiringTrade(field('acquiringType')?.value?.key) ? (jsx(SlideCheckbox, { type: "radio", text: "\u0425\u043E\u0447\u0443 POS-\u0442\u0435\u0440\u043C\u0438\u043D\u0430\u043B", ...field('posTerminal') })) : null);
1849
1858
 
1850
1859
  const ProductField = JSX(({ field }) => (jsx(SelectControl, { placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0440\u043E\u0434\u0443\u043A\u0442", label: "\u041F\u0440\u043E\u0434\u0443\u043A\u0442", options: PRODUCT_TYPE, ...withValidator(field('product'), validatorObj.product) })));
@@ -1872,6 +1881,8 @@
1872
1881
 
1873
1882
  const ServiceDirectionField = JSX(({ field }) => (jsx(SelectControl, { label: "\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u043D\u0438\u044F", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435", options: SERVICE_DIRECTIONS, ...withValidator(field('serviceDirection'), validatorObj.serviceDirection) })));
1874
1883
 
1884
+ const SurnameField = JSX(({ field, input }) => (jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...getValidation(field('surname'), validatorObj.surname, input?.required) })));
1885
+
1875
1886
  const MIN_CREDIT_TERM = 1;
1876
1887
  const MAX_CREDIT_TERM = 180;
1877
1888
  const ITEMS_CREDIT_TERM = ['От 1 мес', 'До 15 лет'];
@@ -1904,10 +1915,10 @@
1904
1915
  const { required, ...rest } = input;
1905
1916
  const isPremium = typeForm === 'ULTRASERVICE' || typeForm === 'PREMIUMSERVICE';
1906
1917
  const InputsMap = {
1907
- surname: (jsx(InputControl, { label: "\u0424\u0430\u043C\u0438\u043B\u0438\u044F", ...getValidation(field('surname'), validatorObj.surname, required) })),
1908
- name: (jsx(InputControl, { label: "\u0418\u043C\u044F", ...getValidation(field('name'), validatorObj.name, required), ...rest })),
1909
- middleName: (jsx(InputControl, { label: "\u041E\u0442\u0447\u0435\u0441\u0442\u0432\u043E (\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E, \u043F\u0440\u0438 \u043D\u0430\u043B\u0438\u0447\u0438\u0438)", ...field('middleName') })),
1910
- phone: (jsx(InputPhoneControl, { label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...getValidation(field('phone'), validatorObj.phone, required) })),
1918
+ surname: jsx(SurnameField, { field: field, input: input }),
1919
+ name: jsx(NameField, { field: field, input: input }),
1920
+ middleName: jsx(MiddleNameField, { field: field }),
1921
+ phone: jsx(PhoneField, { field: field, input: input }),
1911
1922
  email: (jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...getValidation(field('email'), validatorObj.email, required), ...rest })),
1912
1923
  fullName: (jsx(InputControl, { label: "\u0424\u0418\u041E", ...getValidation(field('fullName'), validatorObj.fullName, required), ...rest })),
1913
1924
  inn: (jsx(InputControl, { label: "\u0418\u041D\u041D", type: "number", ...getValidation(field('inn'), validatorObj.inn, required) })),
@@ -6554,7 +6565,7 @@
6554
6565
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6555
6566
  });
6556
6567
 
6557
- const packageVersion = "0.14.558";
6568
+ const packageVersion = "0.14.560";
6558
6569
 
6559
6570
  exports.Blocks = Blocks;
6560
6571
  exports.ContentPage = ContentPage;