@redneckz/wildless-cms-uni-blocks 0.14.2 → 0.14.4
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.
- package/bin/migration-scripts/0.14.4.js +37 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +55 -42
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/CalculatorContent.d.ts +27 -1
- package/bundle/components/Calculator/useBonusCalculatorParams.d.ts +1 -1
- package/bundle/model/EmptyOptionType.d.ts +1 -1
- package/bundle/ui-kit/ClientOnly.d.ts +1 -0
- package/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -0
- package/bundle/ui-kit/SwipeListControl/isShowDots.d.ts +1 -0
- package/bundle/ui-kit/SwipeListControl/isShowDots.mobile.d.ts +1 -0
- package/dist/components/Calculator/BonusCalculatorForm.js +1 -1
- package/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js +2 -2
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/Calculator.js +16 -4
- package/dist/components/Calculator/Calculator.js.map +1 -1
- package/dist/components/Calculator/CalculatorContent.d.ts +27 -1
- package/dist/components/Calculator/CreditCalculatorForm.js +6 -6
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.js +8 -8
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/useBonusCalculatorParams.d.ts +1 -1
- package/dist/components/Calculator/useBonusCalculatorParams.js.map +1 -1
- package/dist/components/Carousel/Carousel.js +1 -1
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/ContentPage/ContentPage.js +1 -1
- package/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/dist/components/Footer/Contacts.js +1 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMap.js +4 -9
- package/dist/components/OfficesAtmsMap/OfficesAtmsMap.js.map +1 -1
- package/dist/components/StickyBottomMenu/RenderMenuItems.js +1 -2
- package/dist/components/StickyBottomMenu/RenderMenuItems.js.map +1 -1
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +2 -2
- package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/dist/content-page-repository/transformHTML.js +32 -2
- package/dist/content-page-repository/transformHTML.js.map +1 -1
- package/dist/model/EmptyOptionType.d.ts +1 -1
- package/dist/ui-kit/ClientOnly.d.ts +1 -0
- package/dist/ui-kit/ClientOnly.js +7 -0
- package/dist/ui-kit/ClientOnly.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +2 -2
- package/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/isShowDots.d.ts +1 -0
- package/dist/ui-kit/SwipeListControl/isShowDots.js +4 -0
- package/dist/ui-kit/SwipeListControl/isShowDots.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/isShowDots.mobile.d.ts +1 -0
- package/dist/ui-kit/SwipeListControl/isShowDots.mobile.js +4 -0
- package/dist/ui-kit/SwipeListControl/isShowDots.mobile.js.map +1 -0
- package/lib/components/Calculator/BonusCalculatorForm.js +1 -1
- package/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js +2 -2
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/Calculator.js +16 -4
- package/lib/components/Calculator/Calculator.js.map +1 -1
- package/lib/components/Calculator/CalculatorContent.d.ts +27 -1
- package/lib/components/Calculator/CreditCalculatorForm.js +6 -6
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.js +8 -8
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/useBonusCalculatorParams.d.ts +1 -1
- package/lib/components/Calculator/useBonusCalculatorParams.js.map +1 -1
- package/lib/components/Carousel/Carousel.js +1 -1
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/ContentPage/ContentPage.js +1 -1
- package/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/lib/components/Footer/Contacts.js +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMap.js +4 -9
- package/lib/components/OfficesAtmsMap/OfficesAtmsMap.js.map +1 -1
- package/lib/components/StickyBottomMenu/RenderMenuItems.js +1 -2
- package/lib/components/StickyBottomMenu/RenderMenuItems.js.map +1 -1
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +3 -3
- package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.fixture.d.ts +1 -0
- package/lib/components/SwipeListControlBlock/SwipeListControlBlock.fixture.mobile.d.ts +8 -0
- package/lib/content-page-repository/transformHTML.js +9 -2
- package/lib/content-page-repository/transformHTML.js.map +1 -1
- package/lib/model/EmptyOptionType.d.ts +1 -1
- package/lib/ui-kit/ClientOnly.d.ts +1 -0
- package/lib/ui-kit/ClientOnly.js +5 -0
- package/lib/ui-kit/ClientOnly.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +2 -2
- package/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/isShowDots.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/isShowDots.js +2 -0
- package/lib/ui-kit/SwipeListControl/isShowDots.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/isShowDots.mobile.d.ts +1 -0
- package/lib/ui-kit/SwipeListControl/isShowDots.mobile.js +2 -0
- package/lib/ui-kit/SwipeListControl/isShowDots.mobile.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +52 -50
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +27 -1
- package/mobile/bundle/components/Calculator/useBonusCalculatorParams.d.ts +1 -1
- package/mobile/bundle/model/EmptyOptionType.d.ts +1 -1
- package/mobile/bundle/ui-kit/ClientOnly.d.ts +1 -0
- package/mobile/bundle/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -0
- package/mobile/bundle/ui-kit/SwipeListControl/isShowDots.d.ts +1 -0
- package/mobile/dist/components/Calculator/BonusCalculatorForm.js +1 -1
- package/mobile/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +2 -2
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/CalculatorContent.d.ts +27 -1
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +6 -6
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +8 -8
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/useBonusCalculatorParams.d.ts +1 -1
- package/mobile/dist/components/Calculator/useBonusCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Carousel/Carousel.js +1 -1
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/ContentPage/ContentPage.js +1 -1
- package/mobile/dist/components/ContentPage/ContentPage.js.map +1 -1
- package/mobile/dist/components/Footer/Contacts.js +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMap.js +4 -9
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMap.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/RenderMenuItems.js +1 -2
- package/mobile/dist/components/StickyBottomMenu/RenderMenuItems.js.map +1 -1
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +2 -2
- package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/dist/content-page-repository/transformHTML.js +32 -2
- package/mobile/dist/content-page-repository/transformHTML.js.map +1 -1
- package/mobile/dist/model/EmptyOptionType.d.ts +1 -1
- package/mobile/dist/ui-kit/ClientOnly.d.ts +1 -0
- package/mobile/dist/ui-kit/ClientOnly.js +7 -0
- package/mobile/dist/ui-kit/ClientOnly.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +2 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js +2 -2
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/isShowDots.d.ts +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/isShowDots.js +4 -0
- package/mobile/dist/ui-kit/SwipeListControl/isShowDots.js.map +1 -0
- package/mobile/lib/components/Calculator/BonusCalculatorForm.js +1 -1
- package/mobile/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +2 -2
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/CalculatorContent.d.ts +27 -1
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +6 -6
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +8 -8
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/useBonusCalculatorParams.d.ts +1 -1
- package/mobile/lib/components/Calculator/useBonusCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Carousel/Carousel.js +1 -1
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/ContentPage/ContentPage.js +1 -1
- package/mobile/lib/components/ContentPage/ContentPage.js.map +1 -1
- package/mobile/lib/components/Footer/Contacts.js +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMap.js +4 -9
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMap.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/RenderMenuItems.js +1 -2
- package/mobile/lib/components/StickyBottomMenu/RenderMenuItems.js.map +1 -1
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +3 -3
- package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
- package/mobile/lib/content-page-repository/transformHTML.js +9 -2
- package/mobile/lib/content-page-repository/transformHTML.js.map +1 -1
- package/mobile/lib/model/EmptyOptionType.d.ts +1 -1
- package/mobile/lib/ui-kit/ClientOnly.d.ts +1 -0
- package/mobile/lib/ui-kit/ClientOnly.js +5 -0
- package/mobile/lib/ui-kit/ClientOnly.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +2 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.d.ts +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js +2 -2
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlDots.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/isShowDots.d.ts +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/isShowDots.js +2 -0
- package/mobile/lib/ui-kit/SwipeListControl/isShowDots.js.map +1 -0
- package/mobile/src/components/Calculator/BonusCalculatorForm.tsx +1 -1
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +5 -2
- package/mobile/src/components/Calculator/Calculator.example.json +1 -0
- package/mobile/src/components/Calculator/Calculator.ui.json +8 -0
- package/mobile/src/components/Calculator/CalculatorContent.ts +31 -1
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +6 -6
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +8 -8
- package/mobile/src/components/Calculator/useBonusCalculatorParams.ts +1 -1
- package/mobile/src/components/Carousel/Carousel.tsx +1 -0
- package/mobile/src/components/ContentPage/ContentPage.tsx +2 -2
- package/mobile/src/components/Footer/Contacts.tsx +1 -1
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMap.tsx +8 -14
- package/mobile/src/components/StickyBottomMenu/RenderMenuItems.tsx +5 -11
- package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +6 -4
- package/mobile/src/content-page-repository/transformHTML.ts +10 -2
- package/mobile/src/model/EmptyOptionType.ts +1 -1
- package/mobile/src/ui-kit/ClientOnly.tsx +6 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +2 -1
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +11 -2
- package/mobile/src/ui-kit/SwipeListControl/isShowDots.tsx +1 -0
- package/package.json +1 -1
- package/src/components/Calculator/BonusCalculatorForm.tsx +1 -1
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +5 -2
- package/src/components/Calculator/Calculator.example.json +1 -0
- package/src/components/Calculator/Calculator.tsx +19 -4
- package/src/components/Calculator/Calculator.ui.json +8 -0
- package/src/components/Calculator/CalculatorContent.ts +31 -1
- package/src/components/Calculator/CreditCalculatorForm.tsx +6 -6
- package/src/components/Calculator/DepositCalculatorForm.tsx +8 -8
- package/src/components/Calculator/useBonusCalculatorParams.ts +1 -1
- package/src/components/Carousel/Carousel.tsx +1 -0
- package/src/components/ContentPage/ContentPage.tsx +2 -2
- package/src/components/Footer/Contacts.tsx +1 -1
- package/src/components/OfficesAtmsMap/OfficesAtmsMap.tsx +8 -14
- package/src/components/StepsBlock/StepsBlock.fixture.mobile.tsx +1 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +1 -1
- package/src/components/StickyBottomMenu/RenderMenuItems.tsx +5 -11
- package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +6 -4
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.fixture.mobile.tsx +66 -0
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.fixture.tsx +19 -0
- package/src/content-page-repository/transformHTML.ts +10 -2
- package/src/model/EmptyOptionType.ts +1 -1
- package/src/ui-kit/Button/Button.fixture.tsx +22 -22
- package/src/ui-kit/ClientOnly.tsx +6 -0
- package/src/ui-kit/HeaderItem/HeaderItem.fixture.tsx +2 -2
- package/src/ui-kit/Logo/Logo.fixture.tsx +1 -1
- package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +2 -1
- package/src/ui-kit/SwipeListControl/SwipeListControlDots.tsx +11 -2
- package/src/ui-kit/SwipeListControl/isShowDots.mobile.tsx +1 -0
- package/src/ui-kit/SwipeListControl/isShowDots.tsx +1 -0
- package/src/ui-kit/TopItem/TopItem.fixture.tsx +2 -2
|
@@ -11,7 +11,7 @@ const activeDotStyles = {
|
|
|
11
11
|
};
|
|
12
12
|
const dotStyle = 'cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white';
|
|
13
13
|
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
14
|
-
export const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list', version }) => {
|
|
14
|
+
export const SwipeListControlDots = JSX(({ className = '', containerRef, activeIndex, dotCount = 0, listType = 'horizontal-list', version, }) => {
|
|
15
15
|
const handleClick = (idx) => {
|
|
16
16
|
if (idx !== activeIndex && containerRef?.current) {
|
|
17
17
|
containerRef.current.children[idx]?.scrollIntoView({
|
|
@@ -20,6 +20,6 @@ export const SwipeListControlDots = JSX(({ containerRef, activeIndex, dotCount =
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
return dotCount ? (_jsx("div", { className: style('flex gap-xs
|
|
23
|
+
return dotCount ? (_jsx("div", { className: style('flex gap-xs', containerStyles[listType], version ? 'group' : '', className), ...(version ? { 'data-ver': version } : {}), children: new Array(dotCount).fill(null).map((_, idx) => (_jsx("div", { className: `${dotStyle} ${idx === activeIndex ? activeDotStyles[listType] : inactiveDotStyle}`, role: "button", "aria-hidden": true, onClick: () => handleClick(idx) }, String(idx)))) })) : null;
|
|
24
24
|
});
|
|
25
25
|
//# sourceMappingURL=SwipeListControlDots.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeListControlDots.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListControlDots.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,MAAM,eAAe,GAAyC;IAC5D,iBAAiB,EAAE,qBAAqB;IACxC,eAAe,EAAE,sDAAsD;CACxE,CAAC;AAEF,MAAM,eAAe,GAAyC;IAC5D,iBAAiB,EAAE,KAAK;IACxB,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,QAAQ,GACZ,yIAAyI,CAAC;AAE5I,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SwipeListControlDots.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListControlDots.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG1C,MAAM,eAAe,GAAyC;IAC5D,iBAAiB,EAAE,qBAAqB;IACxC,eAAe,EAAE,sDAAsD;CACxE,CAAC;AAEF,MAAM,eAAe,GAAyC;IAC5D,iBAAiB,EAAE,KAAK;IACxB,eAAe,EAAE,KAAK;CACvB,CAAC;AAEF,MAAM,QAAQ,GACZ,yIAAyI,CAAC;AAE5I,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAW9C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CACrC,CAAC,EACC,SAAS,GAAG,EAAE,EACd,YAAY,EACZ,WAAW,EACX,QAAQ,GAAG,CAAC,EACZ,QAAQ,GAAG,iBAAiB,EAC5B,OAAO,GACR,EAAE,EAAE;IACH,MAAM,WAAW,GAAG,CAAC,GAAW,EAAE,EAAE;QAClC,IAAI,GAAG,KAAK,WAAW,IAAI,YAAY,EAAE,OAAO,EAAE;YAChD,YAAY,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC;gBACjD,QAAQ,EAAE,QAAQ;gBAClB,KAAK,EAAE,SAAS;aACjB,CAAC,CAAC;SACJ;IACH,CAAC,CAAC;IAEF,OAAO,QAAQ,CAAC,CAAC,CAAC,CAChB,cACE,SAAS,EAAE,KAAK,CACd,aAAa,EACb,eAAe,CAAC,QAAQ,CAAC,EACzB,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EACtB,SAAS,CACV,KACG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,YAE3C,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAW,EAAE,EAAE,CAAC,CACtD,cAEE,SAAS,EAAE,GAAG,QAAQ,IACpB,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,gBACpD,EAAE,EACF,IAAI,EAAC,QAAQ,uBAEb,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,IAN1B,MAAM,CAAC,GAAG,CAAC,CAOhB,CACH,CAAC,GACE,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isShowDots = true;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isShowDots.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/isShowDots.tsx"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC"}
|
|
@@ -15,7 +15,7 @@ export interface BonusCalculatorProps extends CommonCalculatorProps {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const BonusCalculatorForm = JSX<BonusCalculatorProps>(
|
|
18
|
-
({ className = '', sourceBookDir
|
|
18
|
+
({ className = '', sourceBookDir, buttons, footnote }) => {
|
|
19
19
|
const [userInputParams, { field }] = useForm({
|
|
20
20
|
travelExpenseValue: DEFAULT_TRAVEL_MIN_SUM,
|
|
21
21
|
restExpenseValue: DEFAULT_REST_MIN_SUM,
|
|
@@ -22,7 +22,7 @@ export interface BusinessDepositCalculatorProp extends BusinessDepositCalculator
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
25
|
-
({ className = '',
|
|
25
|
+
({ className = '', rateParams, buttons, footnote, bottomFootnote, isShowDepositeName }) => {
|
|
26
26
|
const [userInputParams, { field }] = useForm({
|
|
27
27
|
moneyValue: BUSINESS_DEFAULT_SUM,
|
|
28
28
|
daysValue: BUSINESS_DEFAULT_DAYS,
|
|
@@ -32,7 +32,10 @@ export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
|
32
32
|
isMonthlyInterestPayment: false,
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
const calculatorParams = useBusinessDepositCalculatorParams(
|
|
35
|
+
const calculatorParams = useBusinessDepositCalculatorParams(
|
|
36
|
+
userInputParams,
|
|
37
|
+
rateParams?.sourceBookDir,
|
|
38
|
+
);
|
|
36
39
|
const { income, finalSum, rate, isUnavailableByTerm, depositeName } = calculatorParams;
|
|
37
40
|
|
|
38
41
|
return (
|
|
@@ -1,9 +1,36 @@
|
|
|
1
|
+
import { Align } from '../../model/Align';
|
|
1
2
|
import type { EmptyOption } from '../../model/EmptyOptionType';
|
|
2
3
|
import type { Footnote } from '../../model/Footnote';
|
|
3
4
|
import type { HeadlineCommonProps, TitleProps } from '../../model/HeadlineType';
|
|
4
5
|
import type { IconProps } from '../../model/Picture';
|
|
5
6
|
import type { ButtonsSectionContent } from '../../ui-kit/Button/ButtonsSectionContent';
|
|
6
7
|
|
|
8
|
+
export interface RateParams {
|
|
9
|
+
/** @title Адрес справочника */
|
|
10
|
+
sourceBookDir?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @title ЮЛ
|
|
15
|
+
* @default {"rateType": "UL"}
|
|
16
|
+
*/
|
|
17
|
+
export type ULRateDef = RateParams & {
|
|
18
|
+
rateType: 'UL';
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @title ИП
|
|
23
|
+
* @default {"rateType": "IP"}
|
|
24
|
+
*/
|
|
25
|
+
export type IPRateDef = RateParams & {
|
|
26
|
+
rateType: 'IP';
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @title Назначение ставки
|
|
31
|
+
*/
|
|
32
|
+
export type RateParamsDef = EmptyOption | ULRateDef | IPRateDef;
|
|
33
|
+
|
|
7
34
|
export type CommonCalculatorProps = Footnote &
|
|
8
35
|
ButtonsSectionContent & {
|
|
9
36
|
/** @title Адрес справочника */
|
|
@@ -51,7 +78,9 @@ export interface DepositCalculatorProps extends CommonCalculatorProps {
|
|
|
51
78
|
paramsViewSettings?: DepositCalculatorParamsViewSettings;
|
|
52
79
|
}
|
|
53
80
|
|
|
54
|
-
export interface BusinessDepositCalculatorProps extends
|
|
81
|
+
export interface BusinessDepositCalculatorProps extends Footnote, ButtonsSectionContent {
|
|
82
|
+
/** @title Ставка для */
|
|
83
|
+
rateParams?: RateParamsDef;
|
|
55
84
|
/** @title Сноска снизу блока */
|
|
56
85
|
bottomFootnote?: string;
|
|
57
86
|
/** @title Показывать название депозита */
|
|
@@ -151,6 +180,7 @@ export type CalculatorTab = {
|
|
|
151
180
|
* @title Калькулятор
|
|
152
181
|
*/
|
|
153
182
|
export interface CalculatorContent {
|
|
183
|
+
tabAlign?: Align;
|
|
154
184
|
/** @title Вкладки */
|
|
155
185
|
calculatorTabs?: CalculatorTab[];
|
|
156
186
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/* eslint-disable max-lines, max-lines-per-function */
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { FormFieldRegisterer, useForm } from '../../hooks/useForm';
|
|
3
4
|
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
5
|
+
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
4
6
|
import { style } from '../../utils/style';
|
|
5
7
|
import type {
|
|
6
8
|
CreditCalculatorParamsViewSettings,
|
|
7
9
|
CreditCalculatorProps,
|
|
8
10
|
} from './CalculatorContent';
|
|
11
|
+
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
12
|
+
import { CREDIT_DEFAULT_SUM, DEFAULT_MONTHS } from './constants';
|
|
9
13
|
import { renderFootnote } from './renderFootnote';
|
|
10
|
-
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
11
14
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
12
|
-
import { FormFieldRegisterer, useForm } from '../../hooks/useForm';
|
|
13
|
-
import { CREDIT_DEFAULT_SUM, DEFAULT_MONTHS } from './constants';
|
|
14
|
-
import { CreditCalculatorParams, useCreditCalculatorParams } from './useCreditCalculatorParams';
|
|
15
15
|
import { renderPaymentType } from './renderPaymentType';
|
|
16
|
-
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
17
16
|
import { renderRate } from './renderRate';
|
|
18
|
-
import {
|
|
17
|
+
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
18
|
+
import { CreditCalculatorParams, useCreditCalculatorParams } from './useCreditCalculatorParams';
|
|
19
19
|
|
|
20
20
|
export interface CreditCalculatorProp extends CreditCalculatorProps {
|
|
21
21
|
className?: string;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import { FormFieldRegisterer, useForm } from '../../hooks/useForm';
|
|
2
4
|
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
3
5
|
import { style } from '../../utils/style';
|
|
4
6
|
import type {
|
|
5
7
|
DepositCalculatorParamsViewSettings,
|
|
6
8
|
DepositCalculatorProps,
|
|
7
9
|
} from './CalculatorContent';
|
|
8
|
-
import { renderFootnote } from './renderFootnote';
|
|
9
|
-
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
10
|
-
import { renderMonthsInput } from './renderMonthsInput';
|
|
11
|
-
import { FormFieldRegisterer, useForm } from '../../hooks/useForm';
|
|
12
|
-
import { DEPOSIT_DEFAULT_SUM } from './constants';
|
|
13
|
-
import { DepositCalculatorParams, useDepositCalculatorParams } from './useDepositCalculatorParams';
|
|
14
|
-
import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
|
|
15
10
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
11
|
+
import { DEPOSIT_DEFAULT_SUM } from './constants';
|
|
12
|
+
import { renderFootnote } from './renderFootnote';
|
|
16
13
|
import { renderInterestPayment } from './renderInterestPayment';
|
|
17
|
-
import {
|
|
14
|
+
import { renderMonthsInput } from './renderMonthsInput';
|
|
18
15
|
import { renderRate } from './renderRate';
|
|
16
|
+
import { renderRegistrationType } from './renderRegistrationType';
|
|
17
|
+
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
18
|
+
import { DepositCalculatorParams, useDepositCalculatorParams } from './useDepositCalculatorParams';
|
|
19
19
|
|
|
20
20
|
export interface DepositCalculatorProp extends DepositCalculatorProps {
|
|
21
21
|
className?: string;
|
|
@@ -29,7 +29,7 @@ export interface BonusCalculatorParams
|
|
|
29
29
|
|
|
30
30
|
export const useBonusCalculatorParams = (
|
|
31
31
|
userInputParams: BonusCalculatorUserInputParams,
|
|
32
|
-
sourceBookDir
|
|
32
|
+
sourceBookDir?: string,
|
|
33
33
|
) => {
|
|
34
34
|
const { travelExpenseValue, restExpenseValue } = userInputParams;
|
|
35
35
|
const bonusCalculatorSourceBookParams =
|
|
@@ -35,8 +35,8 @@ export const ContentPage: JSXBlock<ContentPageProps> = JSX<ContentPageProps>(
|
|
|
35
35
|
useBlockRouterProvider();
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
|
-
<div data-theme={colorPalette}>
|
|
39
|
-
<section className={style('relative
|
|
38
|
+
<div className="@container" data-theme={colorPalette}>
|
|
39
|
+
<section className={style('relative', pageStyle, className)}>
|
|
40
40
|
{slots?.header ? (
|
|
41
41
|
<div className="relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]">
|
|
42
42
|
{renderBlocksList(slots?.header, { ...options, slotName: 'header' })}
|
|
@@ -14,7 +14,7 @@ export const Contacts = JSX<ContactsProps>(({ className = '', items }) => (
|
|
|
14
14
|
<Button
|
|
15
15
|
version="primary"
|
|
16
16
|
className="w-full"
|
|
17
|
-
href="https://
|
|
17
|
+
href="https://old.rshb.ru/feedback/question/"
|
|
18
18
|
target="_blank"
|
|
19
19
|
ariaLabel="Обратная связь"
|
|
20
20
|
text="Обратная связь"
|
|
@@ -6,6 +6,7 @@ import type { UniBlockProps } from '../../model/JSXBlock';
|
|
|
6
6
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
7
7
|
import { Button } from '../../ui-kit/Button/Button';
|
|
8
8
|
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
9
|
+
import { ClientOnly } from '../../ui-kit/ClientOnly';
|
|
9
10
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
10
11
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
11
12
|
import { Img } from '../../ui-kit/Img/Img';
|
|
@@ -39,12 +40,9 @@ const FILTRATION_LABELS = {
|
|
|
39
40
|
billAcceptorEnable: 'Прием наличных',
|
|
40
41
|
};
|
|
41
42
|
|
|
42
|
-
const
|
|
43
|
+
const FILTRATION_PREDICATES = {
|
|
43
44
|
safeBoxCaseVolumes: (item: Branch) => Boolean(item.safeBoxCaseVolumes),
|
|
44
45
|
workingSaturday: (item: Branch) => Boolean(item.workSchedule?.workingSaturday),
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const FILTRATION_ATMS_PREDICATES = {
|
|
48
46
|
terminalTypeAtms: (item: Atm) => item.terminalType?.toLowerCase() === 'банкомат',
|
|
49
47
|
terminalTypeTerm: (item: Atm) => item.terminalType?.toLowerCase() === 'терминал',
|
|
50
48
|
workAllTime: (item: Atm) => item.workTime?.toLowerCase() === 'круглосуточно',
|
|
@@ -95,7 +93,9 @@ export const OfficesAtmsMap = JSX<OfficesAtmsMapProps>(({ data, className = '',
|
|
|
95
93
|
{renderFiltrationForm(Object.keys(initialState), { field, reset })}
|
|
96
94
|
</div>
|
|
97
95
|
<div className="h-[600px]">
|
|
98
|
-
<
|
|
96
|
+
<ClientOnly>
|
|
97
|
+
<YandexMap points={points} className="h-full" />
|
|
98
|
+
</ClientOnly>
|
|
99
99
|
</div>
|
|
100
100
|
</div>
|
|
101
101
|
{filteredOfficesAtmsData.map(dataType === 'offices' ? renderOfficeCard : renderAtmCard)}
|
|
@@ -106,17 +106,11 @@ export const OfficesAtmsMap = JSX<OfficesAtmsMapProps>(({ data, className = '',
|
|
|
106
106
|
const filterOfficesAtms = (data: Branch[] | Atm[], filtrationState: Record<string, boolean>) => {
|
|
107
107
|
const truthyFilters = Object.keys(filtrationState).filter((key) => filtrationState[key]);
|
|
108
108
|
|
|
109
|
-
return
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
return (data as Array<Branch | Atm>).filter((item) =>
|
|
110
|
+
truthyFilters.every((filterName) => FILTRATION_PREDICATES[filterName](item)),
|
|
111
|
+
);
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
const filterOffices = (filters: string[]) => (item: Branch) =>
|
|
115
|
-
filters.every((filterName) => FILTRATION_BRANCHES_PREDICATES[filterName](item));
|
|
116
|
-
|
|
117
|
-
const filterAtms = (filters: string[]) => (item: Atm) =>
|
|
118
|
-
filters.every((filterName) => FILTRATION_ATMS_PREDICATES[filterName](item));
|
|
119
|
-
|
|
120
114
|
const getTitle = (name = '', dataType = 'offices') =>
|
|
121
115
|
dataType === 'offices' ? `Офисы филиала ${name}` : `Банкоматы филиала ${name}`;
|
|
122
116
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { MenuItemProps } from './StickyBottomMenuProps';
|
|
3
|
-
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
4
3
|
import { RenderItem } from './RenderItem';
|
|
5
4
|
import { useActiveRoute } from '../../hooks/useActiveRoute';
|
|
6
5
|
|
|
@@ -13,15 +12,10 @@ export const RenderMenuItems = JSX<RenderMenuItems>(({ menuItems, onClick }) =>
|
|
|
13
12
|
const [activeIndex] = useActiveRoute(menuItems);
|
|
14
13
|
|
|
15
14
|
return (
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{menuItems.map((_, i) => (
|
|
22
|
-
<RenderItem key={String(i)} isActive={i === activeIndex} item={_} onClick={onClick} />
|
|
23
|
-
))}
|
|
24
|
-
</div>
|
|
25
|
-
</BlockWrapper>
|
|
15
|
+
<div className="ml-auto container bg-white flex justify-center shadow-blue-gray">
|
|
16
|
+
{menuItems.map((_, i) => (
|
|
17
|
+
<RenderItem key={String(i)} isActive={i === activeIndex} item={_} onClick={onClick} />
|
|
18
|
+
))}
|
|
19
|
+
</div>
|
|
26
20
|
);
|
|
27
21
|
});
|
|
@@ -2,10 +2,10 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useMemo } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { projectSettings } from '../../ProjectSettings';
|
|
4
4
|
import { useSWRResource } from '../../hooks/useSWRResource';
|
|
5
|
-
import { BurgerMenuDialog } from './BurgerMenuDialog';
|
|
6
5
|
import type { MenuItemProps, StickyBottomMenuProps } from './StickyBottomMenuProps';
|
|
7
6
|
import { RenderMenuItems } from './RenderMenuItems';
|
|
8
7
|
import { useBurgerMenuDialog } from './useBurgerMenuDialog';
|
|
8
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
9
9
|
|
|
10
10
|
export const StickyBottomMenu = JSX<StickyBottomMenuProps>(({ ...rest }) => {
|
|
11
11
|
const { menuItems = [] } = useSWRResource<StickyBottomMenuProps>(
|
|
@@ -35,9 +35,11 @@ export const StickyBottomMenu = JSX<StickyBottomMenuProps>(({ ...rest }) => {
|
|
|
35
35
|
);
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
|
-
<
|
|
38
|
+
<BlockWrapper
|
|
39
|
+
className="fixed bottom-0 left-0 right-0 my-0 mx-auto w-full bg-transparent z-[100]"
|
|
40
|
+
padding="p-0"
|
|
41
|
+
>
|
|
39
42
|
{<RenderMenuItems menuItems={menuItemsWithButton} onClick={toggle} />}
|
|
40
|
-
|
|
41
|
-
</div>
|
|
43
|
+
</BlockWrapper>
|
|
42
44
|
);
|
|
43
45
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import rehypeParse from 'rehype-parse';
|
|
2
|
-
import rehypeSanitize from 'rehype-sanitize';
|
|
2
|
+
import rehypeSanitize, { defaultSchema } from 'rehype-sanitize';
|
|
3
3
|
import rehypeStringify from 'rehype-stringify';
|
|
4
4
|
import { unified } from 'unified';
|
|
5
5
|
import { replaceHeadingTags } from './replaceHeadingTags';
|
|
@@ -9,9 +9,17 @@ export async function transformHTML(html: string | null | undefined): Promise<st
|
|
|
9
9
|
return '';
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
const extendedSchema = {
|
|
13
|
+
...defaultSchema,
|
|
14
|
+
protocols: {
|
|
15
|
+
...defaultSchema.protocols,
|
|
16
|
+
href: [...(defaultSchema?.protocols?.href || []), 'tel'],
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
12
20
|
const result = await unified()
|
|
13
21
|
.use(rehypeParse)
|
|
14
|
-
.use(rehypeSanitize)
|
|
22
|
+
.use(rehypeSanitize, extendedSchema)
|
|
15
23
|
.use(rehypeStringify)
|
|
16
24
|
.process(html);
|
|
17
25
|
|
|
@@ -5,6 +5,7 @@ import { SwipeListContainer } from './SwipeListContainer';
|
|
|
5
5
|
import type { SwipeListControlContent } from './SwipeListControlContent';
|
|
6
6
|
import { SwipeListControlDots } from './SwipeListControlDots';
|
|
7
7
|
import { useSwipeListScroll } from './useSwipeListScroll';
|
|
8
|
+
import { isShowDots } from './isShowDots';
|
|
8
9
|
|
|
9
10
|
const DEFAULT_GAP = 14;
|
|
10
11
|
|
|
@@ -29,7 +30,7 @@ export const SwipeListControl = JSX<SwipeListControlProps>(
|
|
|
29
30
|
version,
|
|
30
31
|
gap = DEFAULT_GAP,
|
|
31
32
|
padding = DEFAULT_PADDING,
|
|
32
|
-
showDots =
|
|
33
|
+
showDots = isShowDots,
|
|
33
34
|
minHeight,
|
|
34
35
|
children,
|
|
35
36
|
onVisibleIndicesChange,
|
|
@@ -19,6 +19,7 @@ const dotStyle =
|
|
|
19
19
|
const inactiveDotStyle = 'w-2 h-2 opacity-30';
|
|
20
20
|
|
|
21
21
|
export interface SwipeListControlDotsProps {
|
|
22
|
+
className?: string;
|
|
22
23
|
containerRef?: { current: HTMLDivElement | null };
|
|
23
24
|
activeIndex?: number;
|
|
24
25
|
dotCount?: number;
|
|
@@ -27,7 +28,14 @@ export interface SwipeListControlDotsProps {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export const SwipeListControlDots = JSX<SwipeListControlDotsProps>(
|
|
30
|
-
({
|
|
31
|
+
({
|
|
32
|
+
className = '',
|
|
33
|
+
containerRef,
|
|
34
|
+
activeIndex,
|
|
35
|
+
dotCount = 0,
|
|
36
|
+
listType = 'horizontal-list',
|
|
37
|
+
version,
|
|
38
|
+
}) => {
|
|
31
39
|
const handleClick = (idx: number) => {
|
|
32
40
|
if (idx !== activeIndex && containerRef?.current) {
|
|
33
41
|
containerRef.current.children[idx]?.scrollIntoView({
|
|
@@ -40,9 +48,10 @@ export const SwipeListControlDots = JSX<SwipeListControlDotsProps>(
|
|
|
40
48
|
return dotCount ? (
|
|
41
49
|
<div
|
|
42
50
|
className={style(
|
|
43
|
-
'flex gap-xs
|
|
51
|
+
'flex gap-xs',
|
|
44
52
|
containerStyles[listType],
|
|
45
53
|
version ? 'group' : '',
|
|
54
|
+
className,
|
|
46
55
|
)}
|
|
47
56
|
{...(version ? { 'data-ver': version } : {})}
|
|
48
57
|
>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isShowDots = true;
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ export interface BonusCalculatorProps extends CommonCalculatorProps {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const BonusCalculatorForm = JSX<BonusCalculatorProps>(
|
|
18
|
-
({ className = '', sourceBookDir
|
|
18
|
+
({ className = '', sourceBookDir, buttons, footnote }) => {
|
|
19
19
|
const [userInputParams, { field }] = useForm({
|
|
20
20
|
travelExpenseValue: DEFAULT_TRAVEL_MIN_SUM,
|
|
21
21
|
restExpenseValue: DEFAULT_REST_MIN_SUM,
|
|
@@ -22,7 +22,7 @@ export interface BusinessDepositCalculatorProp extends BusinessDepositCalculator
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
25
|
-
({ className = '',
|
|
25
|
+
({ className = '', rateParams, buttons, footnote, bottomFootnote, isShowDepositeName }) => {
|
|
26
26
|
const [userInputParams, { field }] = useForm({
|
|
27
27
|
moneyValue: BUSINESS_DEFAULT_SUM,
|
|
28
28
|
daysValue: BUSINESS_DEFAULT_DAYS,
|
|
@@ -32,7 +32,10 @@ export const BusinessDepositCalculatorForm = JSX<BusinessDepositCalculatorProp>(
|
|
|
32
32
|
isMonthlyInterestPayment: false,
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
const calculatorParams = useBusinessDepositCalculatorParams(
|
|
35
|
+
const calculatorParams = useBusinessDepositCalculatorParams(
|
|
36
|
+
userInputParams,
|
|
37
|
+
rateParams?.sourceBookDir,
|
|
38
|
+
);
|
|
36
39
|
const { income, finalSum, rate, isUnavailableByTerm, depositeName } = calculatorParams;
|
|
37
40
|
|
|
38
41
|
return (
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useCarouselControls } from '../../hooks/useCarouselControls';
|
|
4
|
+
import { Align } from '../../model/Align';
|
|
4
5
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
5
6
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
6
7
|
import { renderArrows } from '../../ui-kit/Button/renderArrows';
|
|
@@ -14,6 +15,7 @@ export interface CalculatorProps extends CalculatorContent, UniBlockProps {}
|
|
|
14
15
|
interface TabsProps {
|
|
15
16
|
activeIndex: number;
|
|
16
17
|
tabsNav: CalculatorNav[];
|
|
18
|
+
tabAlign?: Align;
|
|
17
19
|
slideIndexShift: number;
|
|
18
20
|
onClick: (index: number) => void;
|
|
19
21
|
}
|
|
@@ -25,8 +27,14 @@ interface NavButtonProps {
|
|
|
25
27
|
onClick: () => void;
|
|
26
28
|
}
|
|
27
29
|
|
|
30
|
+
const alignStyleMap: Record<Align, string> = {
|
|
31
|
+
start: 'justify-start',
|
|
32
|
+
center: 'justify-center',
|
|
33
|
+
end: 'justify-end',
|
|
34
|
+
};
|
|
35
|
+
|
|
28
36
|
export const Calculator = JSX<CalculatorProps>(
|
|
29
|
-
({ className = '', calculatorTabs = [], ...rest }) => {
|
|
37
|
+
({ className = '', tabAlign, calculatorTabs = [], ...rest }) => {
|
|
30
38
|
const tabsNav = calculatorTabs.map((_) => _.nav || ({} as CalculatorNav));
|
|
31
39
|
const calculatorBlocks = calculatorTabs.map(
|
|
32
40
|
({ calculatorBlock }) => calculatorBlock || ({} as CalculatorBlockDef),
|
|
@@ -48,7 +56,13 @@ export const Calculator = JSX<CalculatorProps>(
|
|
|
48
56
|
>
|
|
49
57
|
<div className="bg-white">
|
|
50
58
|
{tabsNav.length > 1
|
|
51
|
-
? renderTabs({
|
|
59
|
+
? renderTabs({
|
|
60
|
+
activeIndex,
|
|
61
|
+
tabsNav,
|
|
62
|
+
tabAlign,
|
|
63
|
+
slideIndexShift,
|
|
64
|
+
onClick: handleSlideIndexShift,
|
|
65
|
+
})
|
|
52
66
|
: null}
|
|
53
67
|
{renderArrows({
|
|
54
68
|
...controls,
|
|
@@ -108,8 +122,9 @@ function renderNavButton({ tab, i, isActive, onClick }: NavButtonProps) {
|
|
|
108
122
|
);
|
|
109
123
|
}
|
|
110
124
|
|
|
111
|
-
function renderTabs({ activeIndex, tabsNav, slideIndexShift, onClick }: TabsProps) {
|
|
125
|
+
function renderTabs({ activeIndex, tabsNav, tabAlign, slideIndexShift, onClick }: TabsProps) {
|
|
112
126
|
const CARD_SHIFT = 388;
|
|
127
|
+
const alignStyle = tabAlign ? alignStyleMap[tabAlign] : '';
|
|
113
128
|
|
|
114
129
|
return (
|
|
115
130
|
<div>
|
|
@@ -117,7 +132,7 @@ function renderTabs({ activeIndex, tabsNav, slideIndexShift, onClick }: TabsProp
|
|
|
117
132
|
style={{ transform: `translateX(-${activeIndex * CARD_SHIFT}px)` }}
|
|
118
133
|
className="flex flex-col justify-end items-center h-32 pt-4xl box-border duration-1000"
|
|
119
134
|
>
|
|
120
|
-
<div className=
|
|
135
|
+
<div className={style('w-full flex flex-nowrap items-end gap-xs', alignStyle)}>
|
|
121
136
|
{tabsNav.map((tab, i) =>
|
|
122
137
|
renderNavButton({
|
|
123
138
|
tab,
|
|
@@ -1,9 +1,36 @@
|
|
|
1
|
+
import { Align } from '../../model/Align';
|
|
1
2
|
import type { EmptyOption } from '../../model/EmptyOptionType';
|
|
2
3
|
import type { Footnote } from '../../model/Footnote';
|
|
3
4
|
import type { HeadlineCommonProps, TitleProps } from '../../model/HeadlineType';
|
|
4
5
|
import type { IconProps } from '../../model/Picture';
|
|
5
6
|
import type { ButtonsSectionContent } from '../../ui-kit/Button/ButtonsSectionContent';
|
|
6
7
|
|
|
8
|
+
export interface RateParams {
|
|
9
|
+
/** @title Адрес справочника */
|
|
10
|
+
sourceBookDir?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @title ЮЛ
|
|
15
|
+
* @default {"rateType": "UL"}
|
|
16
|
+
*/
|
|
17
|
+
export type ULRateDef = RateParams & {
|
|
18
|
+
rateType: 'UL';
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @title ИП
|
|
23
|
+
* @default {"rateType": "IP"}
|
|
24
|
+
*/
|
|
25
|
+
export type IPRateDef = RateParams & {
|
|
26
|
+
rateType: 'IP';
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @title Назначение ставки
|
|
31
|
+
*/
|
|
32
|
+
export type RateParamsDef = EmptyOption | ULRateDef | IPRateDef;
|
|
33
|
+
|
|
7
34
|
export type CommonCalculatorProps = Footnote &
|
|
8
35
|
ButtonsSectionContent & {
|
|
9
36
|
/** @title Адрес справочника */
|
|
@@ -51,7 +78,9 @@ export interface DepositCalculatorProps extends CommonCalculatorProps {
|
|
|
51
78
|
paramsViewSettings?: DepositCalculatorParamsViewSettings;
|
|
52
79
|
}
|
|
53
80
|
|
|
54
|
-
export interface BusinessDepositCalculatorProps extends
|
|
81
|
+
export interface BusinessDepositCalculatorProps extends Footnote, ButtonsSectionContent {
|
|
82
|
+
/** @title Ставка для */
|
|
83
|
+
rateParams?: RateParamsDef;
|
|
55
84
|
/** @title Сноска снизу блока */
|
|
56
85
|
bottomFootnote?: string;
|
|
57
86
|
/** @title Показывать название депозита */
|
|
@@ -151,6 +180,7 @@ export type CalculatorTab = {
|
|
|
151
180
|
* @title Калькулятор
|
|
152
181
|
*/
|
|
153
182
|
export interface CalculatorContent {
|
|
183
|
+
tabAlign?: Align;
|
|
154
184
|
/** @title Вкладки */
|
|
155
185
|
calculatorTabs?: CalculatorTab[];
|
|
156
186
|
}
|