@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
@@ -1,10 +1,10 @@
1
1
  import { type TabActivationEvent } from '../components/Tabs/TabActivationEvent';
2
- import { type RegionData } from '../hooks/useLocation';
2
+ import { type Region } from '../hooks/useRegions';
3
3
  import { type DialogAction } from '../ui-kit/DialogManager/DialogAction';
4
4
  import { type PopupAction } from '../ui-kit/PopupManager/PopupAction';
5
5
  import { EventBus } from './EventBus';
6
6
  interface GlobalEventMap {
7
- location: RegionData;
7
+ location: Region;
8
8
  dialog: DialogAction;
9
9
  popup: PopupAction;
10
10
  tab: TabActivationEvent;
@@ -2366,6 +2366,16 @@
2366
2366
  orientation: 'vertical',
2367
2367
  ...field('isAnnuity'),
2368
2368
  });
2369
+ const { onChange: setMoneyValue } = field('moneyValue');
2370
+ const { onChange: setMonthsValue } = field('monthsValue');
2371
+ useEffect(() => {
2372
+ setMoneyValue &&
2373
+ setMoneyValue(clamp(userInputParams.moneyValue, calculatorParams.minSum, calculatorParams.maxSum));
2374
+ }, [calculatorParams.minSum, calculatorParams.maxSum]);
2375
+ useEffect(() => {
2376
+ setMonthsValue &&
2377
+ setMonthsValue(clamp(userInputParams.monthsValue, calculatorParams.minMonths, calculatorParams.maxMonths));
2378
+ }, [calculatorParams.minMonths, calculatorParams.maxMonths]);
2369
2379
  return (jsx(CalculatorFormLayout, { className: className, inputChildren: jsxs("div", { children: [renderWantedSumInput({
2370
2380
  title: 'Сумма кредита, ₽',
2371
2381
  step: 500,
@@ -3069,9 +3079,9 @@
3069
3079
  .map((link, index) => (jsx(CarouselLinkButton, { ...link }, String(index)))) }, String(groupIndex)))) }));
3070
3080
  };
3071
3081
 
3072
- const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, children }) => {
3082
+ const LinkWrapper = JSX(({ className = '', href, target, isRemote = false, onClick, children }) => {
3073
3083
  const link = useLink({ isRemote });
3074
- const linkProps = link({ href, target });
3084
+ const linkProps = link({ href, target, onClick });
3075
3085
  const Tag = href ? 'a' : 'div';
3076
3086
  return (jsx(Tag, { className: style('block', className), ...(href ? linkProps : {}), role: href ? 'link' : 'none', children: children }));
3077
3087
  });
@@ -4106,9 +4116,9 @@
4106
4116
  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] }));
4107
4117
  });
4108
4118
 
4109
- const renderRegion = (onChangeLocation) => (region) => (jsx("div", { className: "mb-xs sm:mb-2xs", children: jsx("button", { className: "cursor-pointer hover:text-primary-hover", onClick: () => {
4110
- onChangeLocation && onChangeLocation(region);
4111
- }, type: "button", children: jsx(Text, { size: "text-l", font: "font-light", children: region.name || '' }) }) }, region.id));
4119
+ 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: () => {
4120
+ onChangeLocation && onChangeLocation(region);
4121
+ }, children: jsx(Text, { size: "text-l", font: "font-light", children: region.name }) }, String(region.id))) : null;
4112
4122
 
4113
4123
  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));
4114
4124
 
@@ -4120,7 +4130,7 @@
4120
4130
  const SEARCH_TERM_MIN_LENGTH = 3;
4121
4131
  const LocationDialog = JSX(({ foreignOffices, defaultLocation }) => {
4122
4132
  const [currentLocation, selectCurrentLocation] = useLocation(defaultLocation);
4123
- const link = useLink({ isRemote: true, basePath: '/' });
4133
+ const link = useLink({ isRemote: true });
4124
4134
  const { href } = link({ href: `/branches/${currentLocation.slug}` });
4125
4135
  const [query, setQuery] = useState('');
4126
4136
  const regions = cleanUpRegions(useRegions()).sort((a, b) => a.name.localeCompare(b.name));
@@ -4130,7 +4140,7 @@
4130
4140
  selectCurrentLocation(region);
4131
4141
  close();
4132
4142
  }, []);
4133
- 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, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
4143
+ 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, { onSearch: setQuery, searchTerm: query })] }), children: [query && query.length >= SEARCH_TERM_MIN_LENGTH ? (jsx("div", { children: regions
4134
4144
  .filter(({ name }) => name && jaroWinklerDistance(name.toLowerCase())(query.toLowerCase()) >= 0.8)
4135
4145
  .map(renderRegion(handleChangeLocation)) })) : (jsx("div", { className: "columns-1 sm:columns-5", children: Array.from(regionsGroupByLetter.entries()).map(renderRegionGroup(handleChangeLocation)) })), renderForeignOffices(foreignOffices)] }));
4136
4146
  });
@@ -6005,7 +6015,7 @@
6005
6015
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
6006
6016
  });
6007
6017
 
6008
- const packageVersion = "0.14.230";
6018
+ const packageVersion = "0.14.232";
6009
6019
 
6010
6020
  exports.Blocks = Blocks;
6011
6021
  exports.ContentPage = ContentPage;