@redneckz/wildless-cms-uni-blocks 0.14.231 → 0.14.233

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 (107) hide show
  1. package/bundle/EventBus/defaultEventBus.d.ts +2 -2
  2. package/bundle/bundle.umd.js +18 -8
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  5. package/bundle/hooks/useLocation.d.ts +2 -7
  6. package/bundle/hooks/useRegions.d.ts +1 -0
  7. package/bundle/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  8. package/bundle/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  9. package/dist/EventBus/defaultEventBus.d.ts +2 -2
  10. package/dist/components/Calculator/CreditCalculatorForm.js +12 -0
  11. package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  12. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  13. package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
  14. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  15. package/dist/hooks/useLocation.d.ts +2 -7
  16. package/dist/hooks/useLocation.js.map +1 -1
  17. package/dist/hooks/useRegions.d.ts +1 -0
  18. package/dist/hooks/useRegions.js.map +1 -1
  19. package/dist/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  20. package/dist/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
  21. package/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  22. package/dist/ui-kit/LocationDialog/LocationDialog.js +4 -3
  23. package/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  24. package/dist/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  25. package/dist/ui-kit/LocationDialog/renderRegion.js +4 -3
  26. package/dist/ui-kit/LocationDialog/renderRegion.js.map +1 -1
  27. package/lib/EventBus/defaultEventBus.d.ts +2 -2
  28. package/lib/components/Calculator/CreditCalculatorForm.js +12 -0
  29. package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  30. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  31. package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
  32. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  33. package/lib/hooks/useLocation.d.ts +2 -7
  34. package/lib/hooks/useLocation.js.map +1 -1
  35. package/lib/hooks/useRegions.d.ts +1 -0
  36. package/lib/hooks/useRegions.js.map +1 -1
  37. package/lib/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  38. package/lib/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
  39. package/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  40. package/lib/ui-kit/LocationDialog/LocationDialog.js +4 -3
  41. package/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  42. package/lib/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  43. package/lib/ui-kit/LocationDialog/renderRegion.js +4 -3
  44. package/lib/ui-kit/LocationDialog/renderRegion.js.map +1 -1
  45. package/mobile/bundle/EventBus/defaultEventBus.d.ts +2 -2
  46. package/mobile/bundle/bundle.umd.js +18 -8
  47. package/mobile/bundle/bundle.umd.min.js +1 -1
  48. package/mobile/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  49. package/mobile/bundle/hooks/useLocation.d.ts +2 -7
  50. package/mobile/bundle/hooks/useRegions.d.ts +1 -0
  51. package/mobile/bundle/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  52. package/mobile/bundle/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  53. package/mobile/dist/EventBus/defaultEventBus.d.ts +2 -2
  54. package/mobile/dist/components/Calculator/CreditCalculatorForm.js +12 -0
  55. package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
  56. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  57. package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
  58. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  59. package/mobile/dist/hooks/useLocation.d.ts +2 -7
  60. package/mobile/dist/hooks/useLocation.js.map +1 -1
  61. package/mobile/dist/hooks/useRegions.d.ts +1 -0
  62. package/mobile/dist/hooks/useRegions.js.map +1 -1
  63. package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  64. package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
  65. package/mobile/dist/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  66. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js +4 -3
  67. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  68. package/mobile/dist/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  69. package/mobile/dist/ui-kit/LocationDialog/renderRegion.js +4 -3
  70. package/mobile/dist/ui-kit/LocationDialog/renderRegion.js.map +1 -1
  71. package/mobile/lib/EventBus/defaultEventBus.d.ts +2 -2
  72. package/mobile/lib/components/Calculator/CreditCalculatorForm.js +12 -0
  73. package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
  74. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +2 -2
  75. package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -1
  76. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  77. package/mobile/lib/hooks/useLocation.d.ts +2 -7
  78. package/mobile/lib/hooks/useLocation.js.map +1 -1
  79. package/mobile/lib/hooks/useRegions.d.ts +1 -0
  80. package/mobile/lib/hooks/useRegions.js.map +1 -1
  81. package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.d.ts +1 -0
  82. package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.js +2 -2
  83. package/mobile/lib/ui-kit/LinkWrapper/LinkWrapper.js.map +1 -1
  84. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js +4 -3
  85. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  86. package/mobile/lib/ui-kit/LocationDialog/renderRegion.d.ts +1 -1
  87. package/mobile/lib/ui-kit/LocationDialog/renderRegion.js +4 -3
  88. package/mobile/lib/ui-kit/LocationDialog/renderRegion.js.map +1 -1
  89. package/mobile/src/EventBus/defaultEventBus.ts +2 -2
  90. package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +23 -0
  91. package/mobile/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +2 -2
  92. package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +3 -2
  93. package/mobile/src/hooks/useLocation.ts +6 -13
  94. package/mobile/src/hooks/useRegions.ts +1 -0
  95. package/mobile/src/ui-kit/LinkWrapper/LinkWrapper.tsx +3 -2
  96. package/mobile/src/ui-kit/LocationDialog/LocationDialog.tsx +9 -8
  97. package/mobile/src/ui-kit/LocationDialog/renderRegion.tsx +16 -15
  98. package/package.json +1 -1
  99. package/src/EventBus/defaultEventBus.ts +2 -2
  100. package/src/components/Calculator/CreditCalculatorForm.tsx +23 -0
  101. package/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +2 -2
  102. package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +3 -2
  103. package/src/hooks/useLocation.ts +6 -13
  104. package/src/hooks/useRegions.ts +1 -0
  105. package/src/ui-kit/LinkWrapper/LinkWrapper.tsx +3 -2
  106. package/src/ui-kit/LocationDialog/LocationDialog.tsx +9 -8
  107. package/src/ui-kit/LocationDialog/renderRegion.tsx +16 -15
@@ -2563,6 +2563,16 @@
2563
2563
  orientation: 'vertical',
2564
2564
  ...field('isAnnuity'),
2565
2565
  });
2566
+ const { onChange: setMoneyValue } = field('moneyValue');
2567
+ const { onChange: setMonthsValue } = field('monthsValue');
2568
+ useEffect(() => {
2569
+ setMoneyValue &&
2570
+ setMoneyValue(clamp(userInputParams.moneyValue, calculatorParams.minSum, calculatorParams.maxSum));
2571
+ }, [calculatorParams.minSum, calculatorParams.maxSum]);
2572
+ useEffect(() => {
2573
+ setMonthsValue &&
2574
+ setMonthsValue(clamp(userInputParams.monthsValue, calculatorParams.minMonths, calculatorParams.maxMonths));
2575
+ }, [calculatorParams.minMonths, calculatorParams.maxMonths]);
2566
2576
  return (jsx(CalculatorFormLayout, { className: className, inputChildren: jsxs("div", { children: [renderWantedSumInput({
2567
2577
  title: 'Сумма кредита, ₽',
2568
2578
  step: 500,
@@ -3072,9 +3082,9 @@
3072
3082
  .map((link, index) => (jsx(CarouselLinkButton, { ...link }, String(index)))) }, String(groupIndex)))) }));
3073
3083
  };
3074
3084
 
3075
- const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, children }) => {
3085
+ const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, onClick, children }) => {
3076
3086
  const link = useLink({ isRemote });
3077
- const linkProps = link({ href, target });
3087
+ const linkProps = link({ href, target, onClick });
3078
3088
  const Tag = href ? 'a' : 'div';
3079
3089
  return (jsx(Tag, { className: style('block', className), ...(href ? linkProps : {}), role: href ? 'link' : 'none', children: children }));
3080
3090
  });
@@ -4847,9 +4857,9 @@
4847
4857
  return (jsxs("div", { className: "flex gap-s items-center", children: [icon ? jsx(Img, { pathPrefix: "/wcms-resources/", image: icon }) : null, text ? (jsx("a", { className: "hover:text-primary-hover", href: href, target: target, onClick: onClick, children: jsx(Text, { size: "text-l", font: "font-light", color: "text-primary-text", children: text }) })) : null] }));
4848
4858
  });
4849
4859
 
4850
- const renderRegion = (onChangeLocation) => (region) => (jsx("div", { className: "mb-xs sm:mb-2xs", children: jsx("button", { className: "cursor-pointer hover:text-primary-hover", onClick: () => {
4851
- onChangeLocation && onChangeLocation(region);
4852
- }, type: "button", children: jsx(Text, { size: "text-l", font: "font-light", children: region.name || '' }) }) }, region.id));
4860
+ const renderRegion = (onChangeLocation) => (region) => region.name ? (jsx(LinkWrapper, { isRemote: true, href: `/branches/${region.slug}`, className: "mb-xs sm:mb-2xs hover:text-primary-hover", onClick: () => {
4861
+ onChangeLocation && onChangeLocation(region);
4862
+ }, children: jsx(Text, { size: "text-l", font: "font-light", children: region.name }) }, String(region.id))) : null;
4853
4863
 
4854
4864
  const renderRegionGroup = (onChangeLocation) => ([letter, regions]) => (jsxs("div", { className: "break-inside-avoid mb-2xl w-56", children: [jsx("div", { className: "mb-s", children: jsx(Text, { size: "text-h6", children: letter }) }), regions.map(renderRegion(onChangeLocation))] }, letter));
4855
4865
 
@@ -4861,7 +4871,7 @@
4861
4871
  const SEARCH_TERM_MIN_LENGTH = 3;
4862
4872
  const LocationDialog = JSX(({ foreignOffices, defaultLocation }) => {
4863
4873
  const [currentLocation, selectCurrentLocation] = useLocation(defaultLocation);
4864
- const link = useLink({ isRemote: true, basePath: '/' });
4874
+ const link = useLink({ isRemote: true });
4865
4875
  const { href } = link({ href: `/branches/${currentLocation.slug}` });
4866
4876
  const [query, setQuery] = useState('');
4867
4877
  const regions = cleanUpRegions(useRegions()).sort((a, b) => a.name.localeCompare(b.name));
@@ -4871,7 +4881,7 @@
4871
4881
  selectCurrentLocation(region);
4872
4882
  close();
4873
4883
  }, []);
4874
- return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }), currentLocation ? (jsxs("div", { className: "mb-s", children: [jsx(Text, { size: "text-l", font: "font-light", children: "\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:\u00A0" }), jsx(LinkButton, { href: href, onClick: () => selectCurrentLocation(currentLocation), children: jsx(Text, { color: "text-primary-main", children: currentLocation.name }) })] })) : null, jsx(SearchBar$1, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
4884
+ return (jsxs(Dialog, { className: "pb-20", head: jsxs("div", { children: [jsx(Text, { size: "text-h4", color: "text-primary-text", children: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0438\u043B\u0438\u0430\u043B" }), currentLocation ? (jsx("div", { className: "mb-s", children: jsxs(Paragraph, { size: "text-l", color: "text-primary-text", children: ["\u0421\u0435\u0439\u0447\u0430\u0441 \u0432\u044B\u0431\u0440\u0430\u043D:", jsx(LinkWrapper, { isRemote: true, href: href, className: "inline mx-2xs text-primary-main", children: currentLocation.name })] }) })) : null, jsx(SearchBar$1, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
4875
4885
  .filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
4876
4886
  .map(renderRegion(handleChangeLocation)) })) : (jsx("div", { className: "columns-1 sm:columns-5", children: Array.from(regionsGroupByLetter.entries()).map(renderRegionGroup(handleChangeLocation)) })), renderForeignOffices(foreignOffices)] }));
4877
4887
  });
@@ -5631,7 +5641,7 @@
5631
5641
 
5632
5642
  const joinList = (sep) => (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: `sep-${i}` }, el) : [el]), []);
5633
5643
 
5634
- const packageVersion = "0.14.230";
5644
+ const packageVersion = "0.14.232";
5635
5645
 
5636
5646
  exports.Blocks = Blocks;
5637
5647
  exports.ContentPage = ContentPage;