@redneckz/wildless-cms-uni-blocks 0.14.190 → 0.14.192

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 (106) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +38 -33
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +13 -0
  5. package/bundle/components/ExchangeRateTile/CurrencyProps.d.ts +2 -1
  6. package/bundle/icons/IconName.d.ts +4 -2
  7. package/cosmos-static/icons/ChineseYuanRenminbiIcon.svg +1 -0
  8. package/cosmos-static/icons/sprites.svg +1 -0
  9. package/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +13 -0
  10. package/dist/components/ApplicationForm/ApplicationFormFeedback.js +35 -3
  11. package/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  12. package/dist/components/ExchangeRateTile/CurrencyProps.d.ts +2 -1
  13. package/dist/components/ExchangeRateTile/CurrencyProps.js +1 -0
  14. package/dist/components/ExchangeRateTile/CurrencyProps.js.map +1 -1
  15. package/dist/components/ExchangeRateTile/CurrencyTable.js +1 -0
  16. package/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
  17. package/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  18. package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  19. package/dist/components/ExchangeRateTile/callbackCurrencySelect.js +4 -0
  20. package/dist/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -1
  21. package/dist/icons/IconName.d.ts +4 -2
  22. package/dist/icons/IconName.js +2 -0
  23. package/dist/icons/IconName.js.map +1 -1
  24. package/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +13 -0
  25. package/lib/components/ApplicationForm/ApplicationFormFeedback.js +33 -2
  26. package/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  27. package/lib/components/ExchangeRateTile/CurrencyProps.d.ts +2 -1
  28. package/lib/components/ExchangeRateTile/CurrencyProps.js +1 -0
  29. package/lib/components/ExchangeRateTile/CurrencyProps.js.map +1 -1
  30. package/lib/components/ExchangeRateTile/CurrencyTable.js +1 -0
  31. package/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
  32. package/lib/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  33. package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  34. package/lib/components/ExchangeRateTile/callbackCurrencySelect.js +4 -0
  35. package/lib/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -1
  36. package/lib/icons/IconName.d.ts +4 -2
  37. package/lib/icons/IconName.js +2 -0
  38. package/lib/icons/IconName.js.map +1 -1
  39. package/mobile/bundle/bundle.umd.js +38 -33
  40. package/mobile/bundle/bundle.umd.min.js +1 -1
  41. package/mobile/bundle/components/ApplicationForm/ApplicationFormFeedback.d.ts +13 -0
  42. package/mobile/bundle/components/ExchangeRateTile/CurrencyProps.d.ts +2 -1
  43. package/mobile/bundle/icons/IconName.d.ts +4 -2
  44. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.d.ts +13 -0
  45. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js +35 -3
  46. package/mobile/dist/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  47. package/mobile/dist/components/ExchangeRateTile/CurrencyProps.d.ts +2 -1
  48. package/mobile/dist/components/ExchangeRateTile/CurrencyProps.js +1 -0
  49. package/mobile/dist/components/ExchangeRateTile/CurrencyProps.js.map +1 -1
  50. package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js +1 -0
  51. package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
  52. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  53. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  54. package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.js +4 -0
  55. package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -1
  56. package/mobile/dist/icons/IconName.d.ts +4 -2
  57. package/mobile/dist/icons/IconName.js +2 -0
  58. package/mobile/dist/icons/IconName.js.map +1 -1
  59. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.d.ts +13 -0
  60. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js +33 -2
  61. package/mobile/lib/components/ApplicationForm/ApplicationFormFeedback.js.map +1 -1
  62. package/mobile/lib/components/ExchangeRateTile/CurrencyProps.d.ts +2 -1
  63. package/mobile/lib/components/ExchangeRateTile/CurrencyProps.js +1 -0
  64. package/mobile/lib/components/ExchangeRateTile/CurrencyProps.js.map +1 -1
  65. package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js +1 -0
  66. package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -1
  67. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  68. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  69. package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.js +4 -0
  70. package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -1
  71. package/mobile/lib/icons/IconName.d.ts +4 -2
  72. package/mobile/lib/icons/IconName.js +2 -0
  73. package/mobile/lib/icons/IconName.js.map +1 -1
  74. package/mobile/src/components/ApplicationForm/ApplicationFormFeedback.tsx +52 -2
  75. package/mobile/src/components/ExchangeRateTile/CurrencyProps.ts +1 -0
  76. package/mobile/src/components/ExchangeRateTile/CurrencyTable.tsx +1 -0
  77. package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +1 -1
  78. package/mobile/src/components/ExchangeRateTile/callbackCurrencySelect.ts +4 -0
  79. package/mobile/src/icons/ChineseYuanRenminbiIcon.svg +11 -0
  80. package/mobile/src/icons/IconName.ts +4 -4
  81. package/package.json +1 -1
  82. package/src/components/ApplicationForm/ApplicationFormFeedback.tsx +52 -2
  83. package/src/components/ExchangeRateTile/CurrencyProps.ts +1 -0
  84. package/src/components/ExchangeRateTile/CurrencyTable.tsx +1 -0
  85. package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.tsx +2 -0
  86. package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +1 -1
  87. package/src/components/ExchangeRateTile/callbackCurrencySelect.ts +4 -0
  88. package/src/icons/ChineseYuanRenminbiIcon.svg +11 -0
  89. package/src/icons/IconName.ts +4 -1
  90. package/src/ui-kit/Select/Select.fixture.tsx +2 -1
  91. package/bundle/components/ApplicationForm/handleSubmitFeedback.d.ts +0 -15
  92. package/dist/components/ApplicationForm/handleSubmitFeedback.d.ts +0 -15
  93. package/dist/components/ApplicationForm/handleSubmitFeedback.js +0 -38
  94. package/dist/components/ApplicationForm/handleSubmitFeedback.js.map +0 -1
  95. package/lib/components/ApplicationForm/handleSubmitFeedback.d.ts +0 -15
  96. package/lib/components/ApplicationForm/handleSubmitFeedback.js +0 -35
  97. package/lib/components/ApplicationForm/handleSubmitFeedback.js.map +0 -1
  98. package/mobile/bundle/components/ApplicationForm/handleSubmitFeedback.d.ts +0 -15
  99. package/mobile/dist/components/ApplicationForm/handleSubmitFeedback.d.ts +0 -15
  100. package/mobile/dist/components/ApplicationForm/handleSubmitFeedback.js +0 -38
  101. package/mobile/dist/components/ApplicationForm/handleSubmitFeedback.js.map +0 -1
  102. package/mobile/lib/components/ApplicationForm/handleSubmitFeedback.d.ts +0 -15
  103. package/mobile/lib/components/ApplicationForm/handleSubmitFeedback.js +0 -35
  104. package/mobile/lib/components/ApplicationForm/handleSubmitFeedback.js.map +0 -1
  105. package/mobile/src/components/ApplicationForm/handleSubmitFeedback.tsx +0 -54
  106. package/src/components/ApplicationForm/handleSubmitFeedback.tsx +0 -54
@@ -1453,37 +1453,6 @@
1453
1453
  { key: 'Юридическое лицо / ИП' },
1454
1454
  ];
1455
1455
 
1456
- const feedbackValidatorDefaultObject = {
1457
- typeForm: defaultValidator,
1458
- region: defaultValidator,
1459
- surname: defaultValidator,
1460
- name: nameValidator,
1461
- feedbackMethod: defaultValidator,
1462
- phone: phoneValidator,
1463
- email: defaultValidator,
1464
- comment: defaultValidator,
1465
- consentDataProcessing: checkboxValidator,
1466
- };
1467
- const handleSubmitFeedback = (formState, onSubmit) => {
1468
- const isLegal = getLegalEntity(formState?.typeForm.key, formState?.serviceDirection?.key);
1469
- const feedbackValidator = objectValidator({
1470
- ...feedbackValidatorDefaultObject,
1471
- ...getFeedbackValidationObject(formState, isLegal),
1472
- });
1473
- isValidationSuccess(feedbackValidator(formState)) && onSubmit(formState, !isLegal);
1474
- };
1475
- const getFeedbackValidationObject = (formState, isLegal) => {
1476
- if (isLegal) {
1477
- return { addressBranch: defaultValidator, inn: innValidator };
1478
- }
1479
- else if (formState.typeForm.key === 'FEEDBACK') {
1480
- return { birthday: defaultValidator };
1481
- }
1482
- else {
1483
- return { addressBranch: defaultValidator };
1484
- }
1485
- };
1486
-
1487
1456
  const SVG = JSX(({ className, viewBox, fill = 'none', width, height, paths, ...commonOptions }) => {
1488
1457
  return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: className, viewBox: viewBox, fill: fill, width: width, height: height, children: paths.map(({ d, fill: pathFill, ...options }, i) => {
1489
1458
  const resultOptions = { ...commonOptions, ...options };
@@ -1689,6 +1658,17 @@
1689
1658
  comment: '',
1690
1659
  consentDataProcessing: false,
1691
1660
  };
1661
+ const feedbackValidatorDefaultObject = {
1662
+ typeForm: defaultValidator,
1663
+ region: defaultValidator,
1664
+ surname: defaultValidator,
1665
+ name: nameValidator,
1666
+ feedbackMethod: defaultValidator,
1667
+ phone: phoneValidator,
1668
+ email: defaultValidator,
1669
+ comment: defaultValidator,
1670
+ consentDataProcessing: checkboxValidator,
1671
+ };
1692
1672
  const ApplicationFormFeedback = JSX(({ button, link, onSubmit }) => {
1693
1673
  const handleSubmit = useCallback((feedbackFormState) => {
1694
1674
  handleSubmitFeedback(feedbackFormState, onSubmit);
@@ -1702,6 +1682,25 @@
1702
1682
  ? field('secondaryPhone')
1703
1683
  : withValidator(field('secondaryPhone'), phoneValidator)) }), jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('email'), defaultValidator) }), jsx(InputControl, { label: "\u0424\u0418\u041E \u0438\u043B\u0438 \u0434\u043E\u043B\u0436\u043D\u043E\u0441\u0442\u044C \u043E\u0431\u0441\u043B\u0443\u0436\u0438\u0432\u0430\u0432\u0448\u0435\u0433\u043E \u0412\u0430\u0441 \u0441\u043E\u0442\u0440\u0443\u0434\u043D\u0438\u043A\u0430 \u0411\u0430\u043D\u043A\u0430", ...field('bankEmpolee') }), jsx(InputControl, { label: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u044F \u0432 \u0411\u0430\u043D\u043A", ...field('applicationDate') })] })) : (jsx(InputControl, { label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('email'), defaultValidator) })), jsx(InputControl, { ...withValidator(field('comment'), defaultValidator), placeholder: "\u0412\u0430\u0448\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435", isTextarea: true }), renderAgreementSubmit(field('consentDataProcessing'), link, button)] }) }) }));
1704
1684
  });
1685
+ const handleSubmitFeedback = (formState, onSubmit) => {
1686
+ const isLegal = getLegalEntity(formState?.typeForm.key, formState?.serviceDirection?.key);
1687
+ const feedbackValidator = objectValidator({
1688
+ ...feedbackValidatorDefaultObject,
1689
+ ...getFeedbackValidationObject(formState, isLegal),
1690
+ });
1691
+ isValidationSuccess(feedbackValidator(formState)) && onSubmit(formState, !isLegal);
1692
+ };
1693
+ const getFeedbackValidationObject = (formState, isLegal) => {
1694
+ if (isLegal) {
1695
+ return { addressBranch: defaultValidator, inn: innValidator };
1696
+ }
1697
+ else if (formState.typeForm.key === 'FEEDBACK') {
1698
+ return { birthday: defaultValidator };
1699
+ }
1700
+ else {
1701
+ return { addressBranch: defaultValidator };
1702
+ }
1703
+ };
1705
1704
  const getLegalEntity = (typeFormKey = '', serviceDirectionKey = '') => typeFormKey === 'FEEDBACK_QS' && serviceDirectionKey === 'Юридическое лицо / ИП';
1706
1705
 
1707
1706
  const ApplicationFormGrantSupport = JSX((props) => {
@@ -3740,6 +3739,7 @@
3740
3739
  Currency["RUB"] = "RUB";
3741
3740
  Currency["EUR"] = "EUR";
3742
3741
  Currency["USD"] = "USD";
3742
+ Currency["CNY"] = "CNY";
3743
3743
  })(Currency || (Currency = {}));
3744
3744
 
3745
3745
  const currencyNumberFormat = new Intl.NumberFormat('ru', {
@@ -3753,6 +3753,7 @@
3753
3753
  const CURRENCY_ICONS_MAP = {
3754
3754
  USD: 'DollarIcon',
3755
3755
  EUR: 'EuroIcon',
3756
+ CNY: 'ChineseYuanRenminbiIcon',
3756
3757
  };
3757
3758
  const CurrencyTable = JSX(({ className, exchangeCurrencyItems }) => (jsxs("table", { className: `h-fit w-fit ${className}`, children: [jsx("thead", { children: jsxs("tr", { children: [jsx("th", { className: TABLE_HEAD_STYLE, children: jsx(Text, { size: "text-m", children: "\u0412\u0430\u043B\u044E\u0442\u0430" }) }), jsx("th", { className: TABLE_HEAD_STYLE_WITH_PADDING, children: jsx(Text, { size: "text-m", children: "\u041A\u0443\u043F\u0438\u0442\u044C" }) }), jsx("th", { className: TABLE_HEAD_STYLE_WITH_PADDING, children: jsx(Text, { size: "text-m", children: "\u041F\u0440\u043E\u0434\u0430\u0442\u044C" }) })] }) }), jsx("tbody", { children: exchangeCurrencyItems.map(renderCurrencyRow) })] })));
3758
3759
  const renderCurrencyRow = (exchangeCurrencyItem) => {
@@ -3788,6 +3789,10 @@
3788
3789
  (_) => _.value === Currency.RUB && _.oppositeValue === Currency.RUB,
3789
3790
  () => props.handleConvert(props.value, Currency.USD),
3790
3791
  ],
3792
+ [
3793
+ (_) => _.value === Currency.RUB && _.oppositeValue === Currency.RUB,
3794
+ () => props.handleConvert(props.value, Currency.CNY),
3795
+ ],
3791
3796
  [() => true, () => props.handleConvert(props.value)],
3792
3797
  ])(props)?.();
3793
3798
 
@@ -3882,7 +3887,7 @@
3882
3887
  return (jsx(BlockWrapper, { className: style('box-border min-h-80', className), ...rest, children: jsx(BaseTile, { className: "h-full", title: jsx(Heading, { headingType: "h4", title: title, className: "whitespace-pre-wrap" }), children: jsxs("div", { className: "flex gap-6xl flex-wrap", children: [jsxs("div", { children: [currencyRates ? (jsx(CurrencyTable, { className: "mb-xl", exchangeCurrencyItems: currencyRates })) : null, jsx(CurrentLocation, { address: exchangeRates?.address })] }), currencyRates.length && currencyRatesBuy.length && currencyRatesSell.length ? (jsx(ExchangeCurrencyCalculator, { className: "grow", currencyRatesBuy: currencyRatesBuy, currencyRatesSell: currencyRatesSell, button: button })) : null] }) }) }));
3883
3888
  });
3884
3889
  const getCurrencyRates = (currencies) => {
3885
- return currencies?.filter((_) => _?.currency?.id === 1 || _?.currency?.id === 2) || [];
3890
+ return currencies?.filter((_) => [1, 2, 3].includes(_?.currency?.id)) || [];
3886
3891
  };
3887
3892
 
3888
3893
  const ICON_SIZE = { width: '40', height: '45' };
@@ -6028,7 +6033,7 @@
6028
6033
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6029
6034
  });
6030
6035
 
6031
- const packageVersion = "0.14.189";
6036
+ const packageVersion = "0.14.191";
6032
6037
 
6033
6038
  exports.Blocks = Blocks;
6034
6039
  exports.ContentPage = ContentPage;