@redneckz/wildless-cms-uni-blocks 0.8.18 → 0.8.20

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 (154) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +24 -20
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
  5. package/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  6. package/bundle/components/ApplicationForm/renderSubmitButton.d.ts +2 -2
  7. package/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +0 -2
  8. package/bundle/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +2 -7
  9. package/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  10. package/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +12 -3
  11. package/bundle/ui-kit/SwipeListControl/getContainerHeight.d.ts +4 -0
  12. package/dist/api/CorporateLeadAPI.js +1 -1
  13. package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
  14. package/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  15. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
  16. package/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  17. package/dist/components/ApplicationForm/renderBankOffices.js +1 -1
  18. package/dist/components/ApplicationForm/renderBankOffices.js.map +1 -1
  19. package/dist/components/ApplicationForm/renderSelects.js +2 -2
  20. package/dist/components/ApplicationForm/renderSelects.js.map +1 -1
  21. package/dist/components/ApplicationForm/renderSubmitButton.d.ts +2 -2
  22. package/dist/components/ApplicationForm/renderSubmitButton.js.map +1 -1
  23. package/dist/components/CarouselLinks/CarouselLinks.js +1 -1
  24. package/dist/ui-kit/LinkButton/LinkButton.js +4 -4
  25. package/dist/ui-kit/LinkButton/LinkButton.js.map +1 -1
  26. package/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +0 -2
  27. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +4 -8
  28. package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  29. package/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
  30. package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  31. package/dist/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +2 -7
  32. package/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  33. package/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +12 -3
  34. package/dist/ui-kit/SwipeListControl/getContainerHeight.d.ts +4 -0
  35. package/dist/ui-kit/SwipeListControl/getContainerHeight.js +13 -0
  36. package/dist/ui-kit/SwipeListControl/getContainerHeight.js.map +1 -0
  37. package/lib/api/CorporateLeadAPI.js +1 -1
  38. package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
  39. package/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  40. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
  41. package/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  42. package/lib/components/ApplicationForm/renderBankOffices.js +1 -1
  43. package/lib/components/ApplicationForm/renderBankOffices.js.map +1 -1
  44. package/lib/components/ApplicationForm/renderSelects.js +2 -2
  45. package/lib/components/ApplicationForm/renderSelects.js.map +1 -1
  46. package/lib/components/ApplicationForm/renderSubmitButton.d.ts +2 -2
  47. package/lib/components/ApplicationForm/renderSubmitButton.js.map +1 -1
  48. package/lib/components/CarouselLinks/CarouselLinks.js +1 -1
  49. package/lib/ui-kit/LinkButton/LinkButton.js +4 -4
  50. package/lib/ui-kit/LinkButton/LinkButton.js.map +1 -1
  51. package/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +0 -2
  52. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +4 -8
  53. package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  54. package/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
  55. package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  56. package/lib/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +2 -7
  57. package/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  58. package/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +12 -3
  59. package/lib/ui-kit/SwipeListControl/getContainerHeight.d.ts +4 -0
  60. package/lib/ui-kit/SwipeListControl/getContainerHeight.js +10 -0
  61. package/lib/ui-kit/SwipeListControl/getContainerHeight.js.map +1 -0
  62. package/mobile/bundle/bundle.umd.js +16 -11
  63. package/mobile/bundle/bundle.umd.min.js +1 -1
  64. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
  65. package/mobile/bundle/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  66. package/mobile/bundle/components/ApplicationForm/renderSubmitButton.d.ts +2 -2
  67. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListContainer.d.ts +0 -2
  68. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +2 -7
  69. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  70. package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +12 -3
  71. package/mobile/bundle/ui-kit/SwipeListControl/getContainerHeight.d.ts +4 -0
  72. package/mobile/dist/api/CorporateLeadAPI.js +1 -1
  73. package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
  74. package/mobile/dist/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  75. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
  76. package/mobile/dist/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  77. package/mobile/dist/components/ApplicationForm/renderBankOffices.js +1 -1
  78. package/mobile/dist/components/ApplicationForm/renderBankOffices.js.map +1 -1
  79. package/mobile/dist/components/ApplicationForm/renderSelects.js +2 -2
  80. package/mobile/dist/components/ApplicationForm/renderSelects.js.map +1 -1
  81. package/mobile/dist/components/ApplicationForm/renderSubmitButton.d.ts +2 -2
  82. package/mobile/dist/components/ApplicationForm/renderSubmitButton.js.map +1 -1
  83. package/mobile/dist/components/CarouselLinks/CarouselLinks.js +1 -1
  84. package/mobile/dist/ui-kit/LinkButton/LinkButton.js +4 -4
  85. package/mobile/dist/ui-kit/LinkButton/LinkButton.js.map +1 -1
  86. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.d.ts +0 -2
  87. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +4 -8
  88. package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  89. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
  90. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  91. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +2 -7
  92. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  93. package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +12 -3
  94. package/mobile/dist/ui-kit/SwipeListControl/getContainerHeight.d.ts +4 -0
  95. package/mobile/dist/ui-kit/SwipeListControl/getContainerHeight.js +13 -0
  96. package/mobile/dist/ui-kit/SwipeListControl/getContainerHeight.js.map +1 -0
  97. package/mobile/lib/api/CorporateLeadAPI.js +1 -1
  98. package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js +2 -2
  99. package/mobile/lib/components/ApplicationForm/ApplicationFormBusinessCard.js.map +1 -1
  100. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -2
  101. package/mobile/lib/components/ApplicationForm/ApplicationFormsProps.d.ts +2 -2
  102. package/mobile/lib/components/ApplicationForm/renderBankOffices.js +1 -1
  103. package/mobile/lib/components/ApplicationForm/renderBankOffices.js.map +1 -1
  104. package/mobile/lib/components/ApplicationForm/renderSelects.js +2 -2
  105. package/mobile/lib/components/ApplicationForm/renderSelects.js.map +1 -1
  106. package/mobile/lib/components/ApplicationForm/renderSubmitButton.d.ts +2 -2
  107. package/mobile/lib/components/ApplicationForm/renderSubmitButton.js.map +1 -1
  108. package/mobile/lib/components/CarouselLinks/CarouselLinks.js +1 -1
  109. package/mobile/lib/ui-kit/LinkButton/LinkButton.js +4 -4
  110. package/mobile/lib/ui-kit/LinkButton/LinkButton.js.map +1 -1
  111. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.d.ts +0 -2
  112. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +4 -8
  113. package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
  114. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -2
  115. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
  116. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlContent.d.ts +2 -7
  117. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -1
  118. package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +12 -3
  119. package/mobile/lib/ui-kit/SwipeListControl/getContainerHeight.d.ts +4 -0
  120. package/mobile/lib/ui-kit/SwipeListControl/getContainerHeight.js +10 -0
  121. package/mobile/lib/ui-kit/SwipeListControl/getContainerHeight.js.map +1 -0
  122. package/mobile/src/api/CorporateLeadAPI.ts +1 -1
  123. package/mobile/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +2 -2
  124. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +2 -2
  125. package/mobile/src/components/ApplicationForm/ApplicationFormsProps.ts +2 -2
  126. package/mobile/src/components/ApplicationForm/renderBankOffices.tsx +2 -2
  127. package/mobile/src/components/ApplicationForm/renderSelects.tsx +3 -3
  128. package/mobile/src/components/ApplicationForm/renderSubmitButton.tsx +2 -2
  129. package/mobile/src/components/CarouselLinks/CarouselLinks.tsx +1 -1
  130. package/mobile/src/components/CarouselLinks/CarouselLinks.ui.json +8 -0
  131. package/mobile/src/ui-kit/LinkButton/LinkButton.tsx +7 -7
  132. package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +4 -10
  133. package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +2 -0
  134. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlContent.ts +2 -8
  135. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
  136. package/mobile/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +14 -3
  137. package/mobile/src/ui-kit/SwipeListControl/getContainerHeight.ts +10 -0
  138. package/package.json +1 -1
  139. package/src/api/CorporateLeadAPI.ts +1 -1
  140. package/src/components/ApplicationForm/ApplicationFormBusinessCard.tsx +2 -2
  141. package/src/components/ApplicationForm/ApplicationFormContent.ts +2 -2
  142. package/src/components/ApplicationForm/ApplicationFormsProps.ts +2 -2
  143. package/src/components/ApplicationForm/renderBankOffices.tsx +2 -2
  144. package/src/components/ApplicationForm/renderSelects.tsx +3 -3
  145. package/src/components/ApplicationForm/renderSubmitButton.tsx +2 -2
  146. package/src/components/CarouselLinks/CarouselLinks.tsx +1 -1
  147. package/src/components/CarouselLinks/CarouselLinks.ui.json +8 -0
  148. package/src/ui-kit/LinkButton/LinkButton.tsx +7 -7
  149. package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +4 -10
  150. package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +2 -0
  151. package/src/ui-kit/SwipeListControl/SwipeListControlContent.ts +2 -8
  152. package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +1 -1
  153. package/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +14 -3
  154. package/src/ui-kit/SwipeListControl/getContainerHeight.ts +10 -0
@@ -1,14 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
3
  import { Img } from '../Img/Img.js';
4
+ import { useLink } from '../../hooks/useLink.js';
4
5
  const LINK_CLASS_NAME = `absolute border border-primary-main ml-3 px-6 py-5
5
6
  text-l-light bg-white text-primary-text flex w-[316px]
6
7
  justify-between items-center group-hover/link:text-primary-main z-10`;
7
8
  const LINK_BORDER_CLASS_NAME = 'bg-transparent border-white border h-[70px] absolute w-[316px] top-0';
8
9
  export const LinkButton = JSX(({ text, href = '', target = '', className = '' }) => {
9
- if (!text) {
10
- return null;
11
- }
12
- return (_jsxs("div", { className: `relative group/link cursor-pointer w-[328px] h-[82px] ${className}`, children: [_jsxs("a", { className: LINK_CLASS_NAME, role: "link", href: href, target: target, children: [_jsx("div", { className: "p-0.5", children: text }), _jsx("div", { className: "w-6 h-6", children: _jsx(Img, { className: "w-4 h-4 min-w-4 min-h-4 rounded-full box-border brightness-0 group-hover/link:brightness-100", image: { icon: 'ArrowRightIcon', iconVersion: 'black' }, imageClassName: "group-hover/link:text-primary-main", width: "24", height: "24", asSVG: true }) })] }), _jsx("div", { className: `${LINK_BORDER_CLASS_NAME} mx-1.5 mt-1.5` }), _jsx("div", { className: `${LINK_BORDER_CLASS_NAME} mt-3 mr-3` })] }));
10
+ const link = useLink();
11
+ const adjustedProps = link({ href, target });
12
+ return text ? (_jsxs("div", { className: `relative group/link cursor-pointer w-[328px] h-[82px] ${className}`, children: [_jsxs("a", { className: LINK_CLASS_NAME, role: "link", ...adjustedProps, children: [_jsx("div", { className: "p-0.5", children: text }), _jsx("div", { className: "w-6 h-6", children: _jsx(Img, { className: "w-4 h-4 min-w-4 min-h-4 rounded-full box-border brightness-0 group-hover/link:brightness-100", image: { icon: 'ArrowRightIcon', iconVersion: 'black' }, imageClassName: "group-hover/link:text-primary-main", width: "24", height: "24", asSVG: true }) })] }), _jsx("div", { className: `${LINK_BORDER_CLASS_NAME} mx-1.5 mt-1.5` }), _jsx("div", { className: `${LINK_BORDER_CLASS_NAME} mt-3 mr-3` })] })) : null;
13
13
  });
14
14
  //# sourceMappingURL=LinkButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkButton.js","sourceRoot":"","sources":["../../../src/ui-kit/LinkButton/LinkButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,MAAM,eAAe,GAAG;;uEAE+C,CAAC;AAExE,MAAM,sBAAsB,GAC1B,sEAAsE,CAAC;AAMzE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAC3B,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,EAAE,EAAE;IACnD,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,eAAK,SAAS,EAAE,yDAAyD,SAAS,EAAE,aAClF,aAAG,SAAS,EAAE,eAAe,EAAE,IAAI,EAAC,MAAM,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,aACnE,cAAK,SAAS,EAAC,OAAO,YAAE,IAAI,GAAO,EACnC,cAAK,SAAS,EAAC,SAAS,YACtB,KAAC,GAAG,IACF,SAAS,EAAC,8FAA8F,EACxG,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,OAAO,EAAE,EACvD,cAAc,EAAC,oCAAoC,EACnD,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,KAAK,SACL,GACE,IACJ,EACJ,cAAK,SAAS,EAAE,GAAG,sBAAsB,gBAAgB,GAAI,EAC7D,cAAK,SAAS,EAAE,GAAG,sBAAsB,YAAY,GAAI,IACrD,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
1
+ {"version":3,"file":"LinkButton.js","sourceRoot":"","sources":["../../../src/ui-kit/LinkButton/LinkButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG9C,MAAM,eAAe,GAAG;;uEAE+C,CAAC;AAExE,MAAM,sBAAsB,GAC1B,sEAAsE,CAAC;AAMzE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAC3B,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,SAAS,GAAG,EAAE,EAAE,EAAE,EAAE;IACnD,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,aAAa,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAE7C,OAAO,IAAI,CAAC,CAAC,CAAC,CACZ,eAAK,SAAS,EAAE,yDAAyD,SAAS,EAAE,aAClF,aAAG,SAAS,EAAE,eAAe,EAAE,IAAI,EAAC,MAAM,KAAK,aAAa,aAC1D,cAAK,SAAS,EAAC,OAAO,YAAE,IAAI,GAAO,EACnC,cAAK,SAAS,EAAC,SAAS,YACtB,KAAC,GAAG,IACF,SAAS,EAAC,8FAA8F,EACxG,KAAK,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,OAAO,EAAE,EACvD,cAAc,EAAC,oCAAoC,EACnD,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,KAAK,SACL,GACE,IACJ,EACJ,cAAK,SAAS,EAAE,GAAG,sBAAsB,gBAAgB,GAAI,EAC7D,cAAK,SAAS,EAAE,GAAG,sBAAsB,YAAY,GAAI,IACrD,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC"}
@@ -1,4 +1,3 @@
1
- import type { SwipeListControlType } from './SwipeListControlContent';
2
1
  import type { SwipeContainerProps } from './SwipeListControlProps';
3
2
  declare type ItemsVisibilityList = Array<IntersectionObserverEntry | undefined>;
4
3
  declare type SwipeListItemWidthAuto = 0;
@@ -15,7 +14,6 @@ interface SwipeListContainerProps extends SwipeContainerProps {
15
14
  snapAlign?: 'snap-start' | 'snap-center' | 'snap-end';
16
15
  onVisibleItemsChange?: (itemsVisibilityList: ItemsVisibilityList) => void;
17
16
  onVisibleIndicesChange?: (indices: number[]) => void;
18
- listType?: SwipeListControlType;
19
17
  }
20
18
  export declare const SwipeListContainer: import("@redneckz/uni-jsx").UNIComponent<SwipeListContainerProps, any, any>;
21
19
  export {};
@@ -3,10 +3,10 @@ import { JSX } from '@redneckz/uni-jsx';
3
3
  import { useCallback, useRef } from '@redneckz/uni-jsx/lib/hooks';
4
4
  import { mapChildren } from '../../utils/mapChildren.js';
5
5
  import { style } from '../../utils/style.js';
6
+ import { getContainerHeight } from './getContainerHeight.js';
6
7
  import { SwipeListItem } from './SwipeListItem.js';
7
8
  const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
8
- const DEFAULT_HEIGHT = '866px';
9
- export const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
9
+ export const SwipeListContainer = JSX(({ className = '', containerRef, activeIndex, visibleItemCount = 0, gap = 0, padding = 0, listType = 'horizontal-list', snapAlign = 'snap-center', minHeight, children, onVisibleItemsChange, onVisibleIndicesChange, }) => {
10
10
  const observerOptions = {
11
11
  sensitivity: 1,
12
12
  rootRef: containerRef,
@@ -24,14 +24,10 @@ export const SwipeListContainer = JSX(({ className = '', containerRef, activeInd
24
24
  const isHorizontalList = listType === 'horizontal-list';
25
25
  const containerStyle = {
26
26
  ...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
27
- ...(isVerticalList ? { height: DEFAULT_HEIGHT } : {}),
27
+ ...(isVerticalList ? getContainerHeight(minHeight) : {}),
28
28
  gap: `${gap}px`,
29
29
  };
30
- const itemContainerStyle = {
31
- ...(isHorizontalList ? getContainerOffset(padding / 4) : {}),
32
- maxHeight: DEFAULT_HEIGHT,
33
- };
34
- return (_jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, role: "list", ref: containerRef, children: mapChildren((child, idx) => (_jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', isVerticalList ? 'h-full' : ''), style: itemContainerStyle, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
30
+ return (_jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, role: "list", ref: containerRef, children: mapChildren((child, idx) => (_jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : '', isVerticalList ? 'h-full' : ''), style: isHorizontalList ? getContainerOffset(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
35
31
  });
36
32
  // Styles used to compensate outer container padding to get rid of clipping effect
37
33
  const getContainerOffset = (padding, additionalPadding = 0) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"SwipeListContainer.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListContainer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAoBhD,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,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AAC;KACtE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,iBAAiB,IAAI,GAAG,CAAC;KAChD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC"}
@@ -11,13 +11,13 @@ const DEFAULT_GAP = 14;
11
11
  and get rid of a clipping effect caused by overflow: hidden.
12
12
  */
13
13
  const DEFAULT_PADDING = 16;
14
- export const SwipeListControl = JSX(({ className = '', gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, children, onVisibleIndicesChange, listType = 'horizontal-list', }) => {
14
+ export const SwipeListControl = JSX(({ className = '', gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, minHeight, children, onVisibleIndicesChange, listType = 'horizontal-list', }) => {
15
15
  const itemCount = Array.isArray(children) ? children.length : 0;
16
16
  const [containerRef, scroll] = useSwipeListScroll({
17
17
  itemCount,
18
18
  onVisibleIndicesChange,
19
19
  });
20
20
  const [activeIndex] = scroll.visibleIndicesRange;
21
- return (_jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [_jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, children: children }), showDots ? (_jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType })) : null] }));
21
+ return (_jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [_jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, minHeight: minHeight, children: children }), showDots ? (_jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType })) : null] }));
22
22
  });
23
23
  //# sourceMappingURL=SwipeListControl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SwipeListControl.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListControl.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB;;;;GAIG;AACH,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CACjC,CAAC,EACC,SAAS,GAAG,EAAE,EACd,GAAG,GAAG,WAAW,EACjB,OAAO,GAAG,eAAe,EACzB,QAAQ,GAAG,IAAI,EACf,QAAQ,EACR,sBAAsB,EACtB,QAAQ,GAAG,iBAAiB,GAC7B,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,kBAAkB,CAAiB;QAChE,SAAS;QACT,sBAAsB;KACvB,CAAC,CAAC;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,mBAAmB,CAAC;IAEjD,OAAO,CACL,eAAK,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,QAAQ,KAAK,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,aACrF,KAAC,kBAAkB,IACjB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,CA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kB,CAAiB;QAChE,SAAS;QACT,sBAAsB;KACvB,CAAC,CAAC;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,mBAAmB,CAAC;IAEjD,OAAO,CACL,eAAK,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,QAAQ,KAAK,eAAe,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC,aACrF,KAAC,kBAAkB,IACjB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,CAAC,EACnB,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,EAChB,sBAAsB,EAAE,MAAM,CAAC,0BAA0B,EACzD,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,YAEnB,QAAQ,GACU,EACpB,QAAQ,CAAC,CAAC,CAAC,CACV,KAAC,oBAAoB,IACnB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,SAAS,EACnB,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -1,15 +1,10 @@
1
1
  import type { BlockVersion } from '../../model/BlockVersion';
2
- /**
3
- * @title Вид
4
- * @enumNames ["Горизонтальный", "Вертикальный"]
5
- */
6
- export declare type SwipeListControlType = 'horizontal-list' | 'vertical-list';
2
+ import type { SwipeContainerProps } from './SwipeListControlProps';
7
3
  /**
8
4
  * @title Swipe-контроллер
9
5
  */
10
- export interface SwipeListControlContent {
6
+ export interface SwipeListControlContent extends SwipeContainerProps {
11
7
  /** @title Точки-индикаторы */
12
8
  showDots?: boolean;
13
- listType?: SwipeListControlType;
14
9
  version?: BlockVersion;
15
10
  }
@@ -1,4 +1,4 @@
1
- import type { SwipeListControlType } from './SwipeListControlContent';
1
+ import type { SwipeListControlType } from './SwipeListControlProps';
2
2
  interface SwipeListControlDotsProps {
3
3
  containerRef?: {
4
4
  current: HTMLDivElement | null;
@@ -1,12 +1,21 @@
1
1
  import type { SwipeListControlContent } from './SwipeListControlContent';
2
2
  /**
3
- * @title Контейнер
3
+ * @title Вид
4
+ * @enumNames ["Горизонтальный", "Вертикальный"]
4
5
  */
6
+ export declare type SwipeListControlType = 'horizontal-list' | 'vertical-list';
7
+ /**
8
+ * @title Минимальная высота
9
+ * @enumNames ['Стандартная', 'Маленькая']
10
+ */
11
+ export declare type ContainerMinHeight = 866 | 720;
5
12
  export interface SwipeContainerProps {
6
- /** @title Расстояние между элементами */
13
+ /** @hidden */
7
14
  gap?: number;
8
- /** @title Отступы */
15
+ /** @hidden */
9
16
  padding?: number;
17
+ listType?: SwipeListControlType;
18
+ minHeight?: ContainerMinHeight;
10
19
  }
11
20
  /**
12
21
  * @title Swipe-контроллер
@@ -0,0 +1,4 @@
1
+ export declare const getContainerHeight: (minHeight?: number) => {
2
+ height: string;
3
+ minHeight: string;
4
+ };
@@ -0,0 +1,10 @@
1
+ const HEADER_HEIGHT = 170;
2
+ const FOOTER_HEIGHT = 48;
3
+ const BLOCKS_GAP = 4;
4
+ const PAGE_PADDINGS_X = 20;
5
+ const DEFAULT_HEIGHT = 866;
6
+ export const getContainerHeight = (minHeight) => ({
7
+ height: `calc(100vh - ${HEADER_HEIGHT + FOOTER_HEIGHT + BLOCKS_GAP + PAGE_PADDINGS_X}px)`,
8
+ minHeight: `${minHeight || DEFAULT_HEIGHT}px`,
9
+ });
10
+ //# sourceMappingURL=getContainerHeight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getContainerHeight.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/getContainerHeight.ts"],"names":[],"mappings":"AAAA,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,UAAU,GAAG,CAAC,CAAC;AACrB,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAkB,EAAE,EAAE,CAAC,CAAC;IACzD,MAAM,EAAE,gBAAgB,aAAa,GAAG,aAAa,GAAG,UAAU,GAAG,eAAe,KAAK;IACzF,SAAS,EAAE,GAAG,SAAS,IAAI,cAAc,IAAI;CAC9C,CAAC,CAAC"}
@@ -15,7 +15,7 @@ export interface DaDataResult {
15
15
  export function CorporateLeadAPI() {
16
16
  async function send(body: Record<string, string>) {
17
17
  try {
18
- const response = await fetch('/api/v1/sendCorporateLead', {
18
+ const response = await fetch('/api/v1/sendcorporatelead', {
19
19
  method: 'POST',
20
20
  headers: { 'Content-Type': 'application/json' },
21
21
  mode: 'cors',
@@ -6,11 +6,11 @@ import { Input } from '../../ui-kit/Input/Input';
6
6
  import { useGetRegions } from '../SafeDepositRental/useGetRegions';
7
7
  import type { ApplicationFormsProps } from './ApplicationFormsProps';
8
8
  import { Footnote } from './Footnote';
9
+ import { WrapperSelect } from './WrapperSelect';
9
10
  import type { HandleFormStateChange } from './models';
10
11
  import { normalizeSelectedRegion } from './normalizeSelectedRegion';
11
12
  import { renderSubmitButton } from './renderSubmitButton';
12
13
  import { useFormHandlers } from './useFormHandlers';
13
- import { WrapperSelect } from './WrapperSelect';
14
14
 
15
15
  export interface BusinessCardFormState {
16
16
  region: string;
@@ -135,7 +135,7 @@ const renderRegion = ({ regions, region, handleChange }: RenderRegionProps) => (
135
135
  <div className="w-full">
136
136
  <WrapperSelect
137
137
  data={regions}
138
- fieldValue="name"
138
+ fieldValue="code"
139
139
  fieldLabel="name"
140
140
  selected={region}
141
141
  setSelected={(value) => handleChange({ region: value })}
@@ -6,7 +6,7 @@ import type { ButtonAdditionalProps } from '../../ui-kit/Button/ButtonProps';
6
6
  /**
7
7
  * @title Кнопка
8
8
  */
9
- export interface ButtonProps extends ButtonAdditionalProps {
9
+ export interface SubmitButtonProps extends ButtonAdditionalProps {
10
10
  /**
11
11
  * @title Текст
12
12
  * @default "Отправить заявку"
@@ -25,7 +25,7 @@ export type ApplicationFormContent = TitleProps & {
25
25
  * @enumNames ["Бизнес-карта", "ВЭД", "Депозит", "Кредит", "Эквайринг"]
26
26
  */
27
27
  typeForm?: 'business-card' | 'wed' | 'deposit' | 'credit' | 'acquiring';
28
- button?: ButtonProps;
28
+ button?: SubmitButtonProps;
29
29
  /** @title Условия передачи данных */
30
30
  link?: LinkProps;
31
31
  };
@@ -1,8 +1,8 @@
1
1
  import type { LinkProps } from '../../model/LinkProps';
2
- import type { ButtonProps } from './ApplicationFormContent';
2
+ import type { SubmitButtonProps } from './ApplicationFormContent';
3
3
 
4
4
  export interface ApplicationFormsProps {
5
- button?: ButtonProps;
5
+ button?: SubmitButtonProps;
6
6
  link?: LinkProps;
7
7
  handleSubmit: (data: Record<string, string>) => Promise<string>;
8
8
  }
@@ -1,7 +1,7 @@
1
1
  import { Branch } from '../../hooks/useSafeBoxes';
2
2
  import type { CreditFormState } from './ApplicationFormCredit';
3
- import type { HandleFormStateChange, Select } from './models';
4
3
  import { WrapperSelect } from './WrapperSelect';
4
+ import type { HandleFormStateChange, Select } from './models';
5
5
 
6
6
  interface RenderBankOfficesProps {
7
7
  regions: Select[];
@@ -22,7 +22,7 @@ export const renderBankOffices = ({
22
22
  <div className="w-1/2">
23
23
  <WrapperSelect
24
24
  data={regions}
25
- fieldValue="name"
25
+ fieldValue="code"
26
26
  fieldLabel="name"
27
27
  selected={region}
28
28
  setSelected={(value) => handleChange({ region: value })}
@@ -1,7 +1,7 @@
1
- import { ACQUIRING_TYPES } from './acquiringTypes';
2
1
  import type { AcquiringFormState } from './ApplicationFormAcquiring';
3
- import type { HandleFormStateChange, Select } from './models';
4
2
  import { WrapperSelect } from './WrapperSelect';
3
+ import { ACQUIRING_TYPES } from './acquiringTypes';
4
+ import type { HandleFormStateChange, Select } from './models';
5
5
 
6
6
  interface SelectsProps {
7
7
  acquiringType: string;
@@ -26,7 +26,7 @@ export const renderSelects = ({ acquiringType, regions, region, handleChange }:
26
26
  <div className="w-1/2">
27
27
  <WrapperSelect
28
28
  data={regions}
29
- fieldValue="name"
29
+ fieldValue="code"
30
30
  fieldLabel="name"
31
31
  selected={region}
32
32
  setSelected={(value) => handleChange({ region: value })}
@@ -1,7 +1,7 @@
1
1
  import { getRegularButtonClasses } from '../../ui-kit/Button/getRegularButtonClasses';
2
- import type { ButtonProps } from './ApplicationFormContent';
2
+ import type { SubmitButtonProps } from './ApplicationFormContent';
3
3
 
4
- export const renderSubmitButton = (button?: ButtonProps, className?: string) => {
4
+ export const renderSubmitButton = (button?: SubmitButtonProps, className?: string) => {
5
5
  const buttonStyle = getRegularButtonClasses({
6
6
  className: 'text-white',
7
7
  version: button?.version,
@@ -10,7 +10,7 @@ import type { CarouselLinksContent } from './CarouselLinksContent';
10
10
 
11
11
  export interface CarouselLinksProps extends CarouselLinksContent, UniBlockProps {}
12
12
 
13
- const MAX_LINKS_COUNT = 12;
13
+ const MAX_LINKS_COUNT = 10;
14
14
 
15
15
  export const CarouselLinks = JSX<CarouselLinksProps>(
16
16
  ({
@@ -0,0 +1,8 @@
1
+ {
2
+ "content": {},
3
+ "style": {
4
+ "ui:options": {
5
+ "minCols": 12
6
+ }
7
+ }
8
+ }
@@ -1,6 +1,7 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import type { LinkProps } from '../../model/LinkProps';
3
2
  import { Img } from '../Img/Img';
3
+ import { useLink } from '../../hooks/useLink';
4
+ import type { LinkProps } from '../../model/LinkProps';
4
5
 
5
6
  const LINK_CLASS_NAME = `absolute border border-primary-main ml-3 px-6 py-5
6
7
  text-l-light bg-white text-primary-text flex w-[316px]
@@ -15,13 +16,12 @@ export type LinkButtonProps = LinkProps & {
15
16
 
16
17
  export const LinkButton = JSX<LinkButtonProps>(
17
18
  ({ text, href = '', target = '', className = '' }) => {
18
- if (!text) {
19
- return null;
20
- }
19
+ const link = useLink();
20
+ const adjustedProps = link({ href, target });
21
21
 
22
- return (
22
+ return text ? (
23
23
  <div className={`relative group/link cursor-pointer w-[328px] h-[82px] ${className}`}>
24
- <a className={LINK_CLASS_NAME} role="link" href={href} target={target}>
24
+ <a className={LINK_CLASS_NAME} role="link" {...adjustedProps}>
25
25
  <div className="p-0.5">{text}</div>
26
26
  <div className="w-6 h-6">
27
27
  <Img
@@ -37,6 +37,6 @@ export const LinkButton = JSX<LinkButtonProps>(
37
37
  <div className={`${LINK_BORDER_CLASS_NAME} mx-1.5 mt-1.5`} />
38
38
  <div className={`${LINK_BORDER_CLASS_NAME} mt-3 mr-3`} />
39
39
  </div>
40
- );
40
+ ) : null;
41
41
  },
42
42
  );
@@ -3,7 +3,7 @@ import { useCallback, useRef } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import type { IntersectionObserverOptions } from '../../hooks/useIntersectionObserver';
4
4
  import { mapChildren } from '../../utils/mapChildren';
5
5
  import { style } from '../../utils/style';
6
- import type { SwipeListControlType } from './SwipeListControlContent';
6
+ import { getContainerHeight } from './getContainerHeight';
7
7
  import type { SwipeContainerProps } from './SwipeListControlProps';
8
8
  import { SwipeListItem } from './SwipeListItem';
9
9
 
@@ -22,13 +22,10 @@ interface SwipeListContainerProps extends SwipeContainerProps {
22
22
  snapAlign?: 'snap-start' | 'snap-center' | 'snap-end';
23
23
  onVisibleItemsChange?: (itemsVisibilityList: ItemsVisibilityList) => void;
24
24
  onVisibleIndicesChange?: (indices: number[]) => void;
25
- listType?: SwipeListControlType;
26
25
  }
27
26
 
28
27
  const childStyleMap = ['min-w-[100%]', 'min-w-[50%]', 'min-w-[33.33%]', 'min-w-[25%]'];
29
28
 
30
- const DEFAULT_HEIGHT = '866px';
31
-
32
29
  export const SwipeListContainer = JSX<SwipeListContainerProps>(
33
30
  ({
34
31
  className = '',
@@ -39,6 +36,7 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
39
36
  padding = 0,
40
37
  listType = 'horizontal-list',
41
38
  snapAlign = 'snap-center',
39
+ minHeight,
42
40
  children,
43
41
  onVisibleItemsChange,
44
42
  onVisibleIndicesChange,
@@ -67,13 +65,9 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
67
65
  const isHorizontalList = listType === 'horizontal-list';
68
66
  const containerStyle = {
69
67
  ...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
70
- ...(isVerticalList ? { height: DEFAULT_HEIGHT } : {}),
68
+ ...(isVerticalList ? getContainerHeight(minHeight) : {}),
71
69
  gap: `${gap}px`,
72
70
  };
73
- const itemContainerStyle = {
74
- ...(isHorizontalList ? getContainerOffset(padding / 4) : {}),
75
- maxHeight: DEFAULT_HEIGHT,
76
- };
77
71
 
78
72
  return (
79
73
  <div
@@ -90,7 +84,7 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
90
84
  visibleItemCount ? childStyleMap[visibleItemCount - 1] : '',
91
85
  isVerticalList ? 'h-full' : '',
92
86
  )}
93
- style={itemContainerStyle}
87
+ style={isHorizontalList ? getContainerOffset(padding / 4) : {}}
94
88
  activeIndex={activeIndex}
95
89
  idx={idx}
96
90
  observerOptions={observerOptions}
@@ -20,6 +20,7 @@ export const SwipeListControl = JSX<SwipeListControlProps>(
20
20
  gap = DEFAULT_GAP,
21
21
  padding = DEFAULT_PADDING,
22
22
  showDots = true,
23
+ minHeight,
23
24
  children,
24
25
  onVisibleIndicesChange,
25
26
  listType = 'horizontal-list',
@@ -42,6 +43,7 @@ export const SwipeListControl = JSX<SwipeListControlProps>(
42
43
  padding={padding}
43
44
  onVisibleIndicesChange={scroll.handleVisibleIndicesChange}
44
45
  listType={listType}
46
+ minHeight={minHeight}
45
47
  >
46
48
  {children}
47
49
  </SwipeListContainer>
@@ -1,17 +1,11 @@
1
1
  import type { BlockVersion } from '../../model/BlockVersion';
2
-
3
- /**
4
- * @title Вид
5
- * @enumNames ["Горизонтальный", "Вертикальный"]
6
- */
7
- export type SwipeListControlType = 'horizontal-list' | 'vertical-list';
2
+ import type { SwipeContainerProps } from './SwipeListControlProps';
8
3
 
9
4
  /**
10
5
  * @title Swipe-контроллер
11
6
  */
12
- export interface SwipeListControlContent {
7
+ export interface SwipeListControlContent extends SwipeContainerProps {
13
8
  /** @title Точки-индикаторы */
14
9
  showDots?: boolean;
15
- listType?: SwipeListControlType;
16
10
  version?: BlockVersion;
17
11
  }
@@ -1,5 +1,5 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
- import type { SwipeListControlType } from './SwipeListControlContent';
2
+ import type { SwipeListControlType } from './SwipeListControlProps';
3
3
 
4
4
  const containerStyles: Record<SwipeListControlType, string> = {
5
5
  'horizontal-list': 'mx-auto mt-5 w-fit',
@@ -1,13 +1,24 @@
1
1
  import type { SwipeListControlContent } from './SwipeListControlContent';
2
2
 
3
3
  /**
4
- * @title Контейнер
4
+ * @title Вид
5
+ * @enumNames ["Горизонтальный", "Вертикальный"]
5
6
  */
7
+ export type SwipeListControlType = 'horizontal-list' | 'vertical-list';
8
+
9
+ /**
10
+ * @title Минимальная высота
11
+ * @enumNames ['Стандартная', 'Маленькая']
12
+ */
13
+ export type ContainerMinHeight = 866 | 720;
14
+
6
15
  export interface SwipeContainerProps {
7
- /** @title Расстояние между элементами */
16
+ /** @hidden */
8
17
  gap?: number;
9
- /** @title Отступы */
18
+ /** @hidden */
10
19
  padding?: number;
20
+ listType?: SwipeListControlType;
21
+ minHeight?: ContainerMinHeight;
11
22
  }
12
23
 
13
24
  /**
@@ -0,0 +1,10 @@
1
+ const HEADER_HEIGHT = 170;
2
+ const FOOTER_HEIGHT = 48;
3
+ const BLOCKS_GAP = 4;
4
+ const PAGE_PADDINGS_X = 20;
5
+ const DEFAULT_HEIGHT = 866;
6
+
7
+ export const getContainerHeight = (minHeight?: number) => ({
8
+ height: `calc(100vh - ${HEADER_HEIGHT + FOOTER_HEIGHT + BLOCKS_GAP + PAGE_PADDINGS_X}px)`,
9
+ minHeight: `${minHeight || DEFAULT_HEIGHT}px`,
10
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redneckz/wildless-cms-uni-blocks",
3
- "version": "0.8.18",
3
+ "version": "0.8.20",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "author": "ЦК",
@@ -15,7 +15,7 @@ export interface DaDataResult {
15
15
  export function CorporateLeadAPI() {
16
16
  async function send(body: Record<string, string>) {
17
17
  try {
18
- const response = await fetch('/api/v1/sendCorporateLead', {
18
+ const response = await fetch('/api/v1/sendcorporatelead', {
19
19
  method: 'POST',
20
20
  headers: { 'Content-Type': 'application/json' },
21
21
  mode: 'cors',
@@ -6,11 +6,11 @@ import { Input } from '../../ui-kit/Input/Input';
6
6
  import { useGetRegions } from '../SafeDepositRental/useGetRegions';
7
7
  import type { ApplicationFormsProps } from './ApplicationFormsProps';
8
8
  import { Footnote } from './Footnote';
9
+ import { WrapperSelect } from './WrapperSelect';
9
10
  import type { HandleFormStateChange } from './models';
10
11
  import { normalizeSelectedRegion } from './normalizeSelectedRegion';
11
12
  import { renderSubmitButton } from './renderSubmitButton';
12
13
  import { useFormHandlers } from './useFormHandlers';
13
- import { WrapperSelect } from './WrapperSelect';
14
14
 
15
15
  export interface BusinessCardFormState {
16
16
  region: string;
@@ -135,7 +135,7 @@ const renderRegion = ({ regions, region, handleChange }: RenderRegionProps) => (
135
135
  <div className="w-full">
136
136
  <WrapperSelect
137
137
  data={regions}
138
- fieldValue="name"
138
+ fieldValue="code"
139
139
  fieldLabel="name"
140
140
  selected={region}
141
141
  setSelected={(value) => handleChange({ region: value })}
@@ -6,7 +6,7 @@ import type { ButtonAdditionalProps } from '../../ui-kit/Button/ButtonProps';
6
6
  /**
7
7
  * @title Кнопка
8
8
  */
9
- export interface ButtonProps extends ButtonAdditionalProps {
9
+ export interface SubmitButtonProps extends ButtonAdditionalProps {
10
10
  /**
11
11
  * @title Текст
12
12
  * @default "Отправить заявку"
@@ -25,7 +25,7 @@ export type ApplicationFormContent = TitleProps & {
25
25
  * @enumNames ["Бизнес-карта", "ВЭД", "Депозит", "Кредит", "Эквайринг"]
26
26
  */
27
27
  typeForm?: 'business-card' | 'wed' | 'deposit' | 'credit' | 'acquiring';
28
- button?: ButtonProps;
28
+ button?: SubmitButtonProps;
29
29
  /** @title Условия передачи данных */
30
30
  link?: LinkProps;
31
31
  };
@@ -1,8 +1,8 @@
1
1
  import type { LinkProps } from '../../model/LinkProps';
2
- import type { ButtonProps } from './ApplicationFormContent';
2
+ import type { SubmitButtonProps } from './ApplicationFormContent';
3
3
 
4
4
  export interface ApplicationFormsProps {
5
- button?: ButtonProps;
5
+ button?: SubmitButtonProps;
6
6
  link?: LinkProps;
7
7
  handleSubmit: (data: Record<string, string>) => Promise<string>;
8
8
  }
@@ -1,7 +1,7 @@
1
1
  import { Branch } from '../../hooks/useSafeBoxes';
2
2
  import type { CreditFormState } from './ApplicationFormCredit';
3
- import type { HandleFormStateChange, Select } from './models';
4
3
  import { WrapperSelect } from './WrapperSelect';
4
+ import type { HandleFormStateChange, Select } from './models';
5
5
 
6
6
  interface RenderBankOfficesProps {
7
7
  regions: Select[];
@@ -22,7 +22,7 @@ export const renderBankOffices = ({
22
22
  <div className="w-1/2">
23
23
  <WrapperSelect
24
24
  data={regions}
25
- fieldValue="name"
25
+ fieldValue="code"
26
26
  fieldLabel="name"
27
27
  selected={region}
28
28
  setSelected={(value) => handleChange({ region: value })}
@@ -1,7 +1,7 @@
1
- import { ACQUIRING_TYPES } from './acquiringTypes';
2
1
  import type { AcquiringFormState } from './ApplicationFormAcquiring';
3
- import type { HandleFormStateChange, Select } from './models';
4
2
  import { WrapperSelect } from './WrapperSelect';
3
+ import { ACQUIRING_TYPES } from './acquiringTypes';
4
+ import type { HandleFormStateChange, Select } from './models';
5
5
 
6
6
  interface SelectsProps {
7
7
  acquiringType: string;
@@ -26,7 +26,7 @@ export const renderSelects = ({ acquiringType, regions, region, handleChange }:
26
26
  <div className="w-1/2">
27
27
  <WrapperSelect
28
28
  data={regions}
29
- fieldValue="name"
29
+ fieldValue="code"
30
30
  fieldLabel="name"
31
31
  selected={region}
32
32
  setSelected={(value) => handleChange({ region: value })}
@@ -1,7 +1,7 @@
1
1
  import { getRegularButtonClasses } from '../../ui-kit/Button/getRegularButtonClasses';
2
- import type { ButtonProps } from './ApplicationFormContent';
2
+ import type { SubmitButtonProps } from './ApplicationFormContent';
3
3
 
4
- export const renderSubmitButton = (button?: ButtonProps, className?: string) => {
4
+ export const renderSubmitButton = (button?: SubmitButtonProps, className?: string) => {
5
5
  const buttonStyle = getRegularButtonClasses({
6
6
  className: 'text-white',
7
7
  version: button?.version,