@redneckz/wildless-cms-uni-blocks 0.9.11 → 0.9.13
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/migrateContentUnit.js +1 -1
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +131 -56
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/CalculatorContent.d.ts +18 -17
- package/bundle/components/Calculator/DepositCalculatorForm.d.ts +2 -2
- package/bundle/components/Calculator/rangeHelpers.d.ts +1 -0
- package/bundle/components/Calculator/renderMonthsInput.d.ts +1 -0
- package/bundle/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
- package/bundle/components/Footer/MediaButton.d.ts +3 -4
- package/bundle/content-page-repository/ContentPageRepository.d.ts +1 -5
- package/bundle/content-page-repository/alignImg.d.ts +9 -0
- package/bundle/content-page-repository/computeImgOutputPath.d.ts +3 -0
- package/bundle/content-page-repository/resizeImg.d.ts +3 -0
- package/bundle/content-page-repository/transformContentPage.d.ts +1 -0
- package/bundle/content-page-repository/transformImg.d.ts +6 -5
- package/bundle/content-page-repository/transformPicture.d.ts +1 -1
- package/bundle/ui-kit/InputListRange/InputListRange.d.ts +2 -0
- package/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
- package/bundle/utils/arrayByRange.d.ts +1 -0
- package/bundle/utils/isPictureSizeEmpty.d.ts +2 -2
- package/bundle/utils/mergeIntervals.d.ts +1 -0
- package/dist/components/Calculator/CalculatorContent.d.ts +18 -17
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.d.ts +2 -2
- package/dist/components/Calculator/DepositCalculatorForm.js +21 -11
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/constants.js +1 -1
- package/dist/components/Calculator/constants.js.map +1 -1
- package/dist/components/Calculator/rangeHelpers.d.ts +1 -0
- package/dist/components/Calculator/rangeHelpers.js +4 -1
- package/dist/components/Calculator/rangeHelpers.js.map +1 -1
- package/dist/components/Calculator/renderMonthsInput.d.ts +1 -0
- package/dist/components/Calculator/renderMonthsInput.js +3 -2
- package/dist/components/Calculator/renderMonthsInput.js.map +1 -1
- package/dist/components/Calculator/useCreditCalculatorParams.js +27 -29
- package/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js +22 -6
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
- package/dist/components/Footer/MediaButton.d.ts +3 -4
- package/dist/components/Footer/MediaButton.js.map +1 -1
- package/dist/content-page-repository/ContentPageRepository.d.ts +1 -5
- package/dist/content-page-repository/ContentPageRepository.js +7 -25
- package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/dist/content-page-repository/alignImg.d.ts +9 -0
- package/dist/content-page-repository/alignImg.js +23 -0
- package/dist/content-page-repository/alignImg.js.map +1 -0
- package/dist/content-page-repository/computeImgOutputPath.d.ts +3 -0
- package/dist/content-page-repository/computeImgOutputPath.js +18 -0
- package/dist/content-page-repository/computeImgOutputPath.js.map +1 -0
- package/dist/content-page-repository/resizeImg.d.ts +3 -0
- package/dist/content-page-repository/resizeImg.js +19 -0
- package/dist/content-page-repository/resizeImg.js.map +1 -0
- package/dist/content-page-repository/transformContentPage.d.ts +1 -0
- package/dist/content-page-repository/transformContentPage.js +25 -19
- package/dist/content-page-repository/transformContentPage.js.map +1 -1
- package/dist/content-page-repository/transformImg.d.ts +6 -5
- package/dist/content-page-repository/transformImg.js +26 -76
- package/dist/content-page-repository/transformImg.js.map +1 -1
- package/dist/content-page-repository/transformPicture.d.ts +1 -1
- package/dist/content-page-repository/transformPicture.js +8 -16
- package/dist/content-page-repository/transformPicture.js.map +1 -1
- package/dist/ui-kit/InputListRange/InputListRange.d.ts +2 -0
- package/dist/ui-kit/InputListRange/InputListRange.js +41 -0
- package/dist/ui-kit/InputListRange/InputListRange.js.map +1 -0
- package/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
- package/dist/ui-kit/InputListRange/InputListRangeProps.js +2 -0
- package/dist/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
- package/dist/ui-kit/Select/Select.js +2 -1
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/dist/utils/arrayByRange.d.ts +1 -0
- package/dist/utils/arrayByRange.js +5 -0
- package/dist/utils/arrayByRange.js.map +1 -0
- package/dist/utils/isPictureSizeEmpty.d.ts +2 -2
- package/dist/utils/isPictureSizeEmpty.js +1 -1
- package/dist/utils/isPictureSizeEmpty.js.map +1 -1
- package/dist/utils/mergeIntervals.d.ts +1 -0
- package/dist/utils/mergeIntervals.js +20 -0
- package/dist/utils/mergeIntervals.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Calculator/CalculatorContent.d.ts +18 -17
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.d.ts +2 -2
- package/lib/components/Calculator/DepositCalculatorForm.js +22 -12
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/constants.js +1 -1
- package/lib/components/Calculator/constants.js.map +1 -1
- package/lib/components/Calculator/rangeHelpers.d.ts +1 -0
- package/lib/components/Calculator/rangeHelpers.js +2 -0
- package/lib/components/Calculator/rangeHelpers.js.map +1 -1
- package/lib/components/Calculator/renderMonthsInput.d.ts +1 -0
- package/lib/components/Calculator/renderMonthsInput.js +3 -2
- package/lib/components/Calculator/renderMonthsInput.js.map +1 -1
- package/lib/components/Calculator/useCreditCalculatorParams.js +27 -29
- package/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js +22 -6
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
- package/lib/components/Footer/MediaButton.d.ts +3 -4
- package/lib/components/Footer/MediaButton.js.map +1 -1
- package/lib/content-page-repository/ContentPageRepository.d.ts +1 -5
- package/lib/content-page-repository/ContentPageRepository.js +8 -26
- package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/lib/content-page-repository/alignImg.d.ts +9 -0
- package/lib/content-page-repository/alignImg.js +17 -0
- package/lib/content-page-repository/alignImg.js.map +1 -0
- package/lib/content-page-repository/computeImgOutputPath.d.ts +3 -0
- package/lib/content-page-repository/computeImgOutputPath.js +12 -0
- package/lib/content-page-repository/computeImgOutputPath.js.map +1 -0
- package/lib/content-page-repository/resizeImg.d.ts +3 -0
- package/lib/content-page-repository/resizeImg.js +13 -0
- package/lib/content-page-repository/resizeImg.js.map +1 -0
- package/lib/content-page-repository/transformContentPage.d.ts +1 -0
- package/lib/content-page-repository/transformContentPage.js +23 -18
- package/lib/content-page-repository/transformContentPage.js.map +1 -1
- package/lib/content-page-repository/transformImg.d.ts +6 -5
- package/lib/content-page-repository/transformImg.js +26 -76
- package/lib/content-page-repository/transformImg.js.map +1 -1
- package/lib/content-page-repository/transformPicture.d.ts +1 -1
- package/lib/content-page-repository/transformPicture.js +8 -16
- package/lib/content-page-repository/transformPicture.js.map +1 -1
- package/lib/ui-kit/InputListRange/InputListRange.d.ts +2 -0
- package/lib/ui-kit/InputListRange/InputListRange.js +39 -0
- package/lib/ui-kit/InputListRange/InputListRange.js.map +1 -0
- package/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
- package/lib/ui-kit/InputListRange/InputListRangeProps.js +2 -0
- package/lib/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
- package/lib/ui-kit/Select/Select.js +2 -1
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/lib/utils/arrayByRange.d.ts +1 -0
- package/lib/utils/arrayByRange.js +2 -0
- package/lib/utils/arrayByRange.js.map +1 -0
- package/lib/utils/isPictureSizeEmpty.d.ts +2 -2
- package/lib/utils/isPictureSizeEmpty.js +1 -1
- package/lib/utils/isPictureSizeEmpty.js.map +1 -1
- package/lib/utils/mergeIntervals.d.ts +1 -0
- package/lib/utils/mergeIntervals.js +17 -0
- package/lib/utils/mergeIntervals.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +1 -1
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/CalculatorContent.d.ts +18 -17
- package/mobile/bundle/components/Calculator/DepositCalculatorForm.d.ts +2 -2
- package/mobile/bundle/components/Calculator/rangeHelpers.d.ts +1 -0
- package/mobile/bundle/components/Calculator/renderMonthsInput.d.ts +1 -0
- package/mobile/bundle/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
- package/mobile/bundle/components/Footer/MediaButton.d.ts +3 -4
- package/mobile/bundle/content-page-repository/ContentPageRepository.d.ts +1 -5
- package/mobile/bundle/content-page-repository/alignImg.d.ts +9 -0
- package/mobile/bundle/content-page-repository/computeImgOutputPath.d.ts +3 -0
- package/mobile/bundle/content-page-repository/resizeImg.d.ts +3 -0
- package/mobile/bundle/content-page-repository/transformContentPage.d.ts +1 -0
- package/mobile/bundle/content-page-repository/transformImg.d.ts +6 -5
- package/mobile/bundle/content-page-repository/transformPicture.d.ts +1 -1
- package/mobile/bundle/ui-kit/InputListRange/InputListRange.d.ts +2 -0
- package/mobile/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
- package/mobile/bundle/utils/arrayByRange.d.ts +1 -0
- package/mobile/bundle/utils/isPictureSizeEmpty.d.ts +2 -2
- package/mobile/bundle/utils/mergeIntervals.d.ts +1 -0
- package/mobile/dist/components/Calculator/CalculatorContent.d.ts +18 -17
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.d.ts +2 -2
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +21 -11
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/constants.js +1 -1
- package/mobile/dist/components/Calculator/constants.js.map +1 -1
- package/mobile/dist/components/Calculator/rangeHelpers.d.ts +1 -0
- package/mobile/dist/components/Calculator/rangeHelpers.js +4 -1
- package/mobile/dist/components/Calculator/rangeHelpers.js.map +1 -1
- package/mobile/dist/components/Calculator/renderMonthsInput.d.ts +1 -0
- package/mobile/dist/components/Calculator/renderMonthsInput.js +3 -2
- package/mobile/dist/components/Calculator/renderMonthsInput.js.map +1 -1
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js +27 -29
- package/mobile/dist/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +22 -6
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
- package/mobile/dist/components/Footer/MediaButton.d.ts +3 -4
- package/mobile/dist/components/Footer/MediaButton.js.map +1 -1
- package/mobile/dist/content-page-repository/ContentPageRepository.d.ts +1 -5
- package/mobile/dist/content-page-repository/ContentPageRepository.js +7 -25
- package/mobile/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/mobile/dist/content-page-repository/alignImg.d.ts +9 -0
- package/mobile/dist/content-page-repository/alignImg.js +23 -0
- package/mobile/dist/content-page-repository/alignImg.js.map +1 -0
- package/mobile/dist/content-page-repository/computeImgOutputPath.d.ts +3 -0
- package/mobile/dist/content-page-repository/computeImgOutputPath.js +18 -0
- package/mobile/dist/content-page-repository/computeImgOutputPath.js.map +1 -0
- package/mobile/dist/content-page-repository/resizeImg.d.ts +3 -0
- package/mobile/dist/content-page-repository/resizeImg.js +19 -0
- package/mobile/dist/content-page-repository/resizeImg.js.map +1 -0
- package/mobile/dist/content-page-repository/transformContentPage.d.ts +1 -0
- package/mobile/dist/content-page-repository/transformContentPage.js +25 -19
- package/mobile/dist/content-page-repository/transformContentPage.js.map +1 -1
- package/mobile/dist/content-page-repository/transformImg.d.ts +6 -5
- package/mobile/dist/content-page-repository/transformImg.js +26 -76
- package/mobile/dist/content-page-repository/transformImg.js.map +1 -1
- package/mobile/dist/content-page-repository/transformPicture.d.ts +1 -1
- package/mobile/dist/content-page-repository/transformPicture.js +8 -16
- package/mobile/dist/content-page-repository/transformPicture.js.map +1 -1
- package/mobile/dist/ui-kit/InputListRange/InputListRange.d.ts +2 -0
- package/mobile/dist/ui-kit/InputListRange/InputListRange.js +41 -0
- package/mobile/dist/ui-kit/InputListRange/InputListRange.js.map +1 -0
- package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
- package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js +2 -0
- package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
- package/mobile/dist/ui-kit/Select/Select.js +2 -1
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/dist/utils/arrayByRange.d.ts +1 -0
- package/mobile/dist/utils/arrayByRange.js +5 -0
- package/mobile/dist/utils/arrayByRange.js.map +1 -0
- package/mobile/dist/utils/isPictureSizeEmpty.d.ts +2 -2
- package/mobile/dist/utils/isPictureSizeEmpty.js +1 -1
- package/mobile/dist/utils/isPictureSizeEmpty.js.map +1 -1
- package/mobile/dist/utils/mergeIntervals.d.ts +1 -0
- package/mobile/dist/utils/mergeIntervals.js +20 -0
- package/mobile/dist/utils/mergeIntervals.js.map +1 -0
- package/mobile/lib/components/Calculator/CalculatorContent.d.ts +18 -17
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.d.ts +2 -2
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +22 -12
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/constants.js +1 -1
- package/mobile/lib/components/Calculator/constants.js.map +1 -1
- package/mobile/lib/components/Calculator/rangeHelpers.d.ts +1 -0
- package/mobile/lib/components/Calculator/rangeHelpers.js +2 -0
- package/mobile/lib/components/Calculator/rangeHelpers.js.map +1 -1
- package/mobile/lib/components/Calculator/renderMonthsInput.d.ts +1 -0
- package/mobile/lib/components/Calculator/renderMonthsInput.js +3 -2
- package/mobile/lib/components/Calculator/renderMonthsInput.js.map +1 -1
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js +27 -29
- package/mobile/lib/components/Calculator/useCreditCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.d.ts +3 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +22 -6
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -6
- package/mobile/lib/components/Footer/MediaButton.d.ts +3 -4
- package/mobile/lib/components/Footer/MediaButton.js.map +1 -1
- package/mobile/lib/content-page-repository/ContentPageRepository.d.ts +1 -5
- package/mobile/lib/content-page-repository/ContentPageRepository.js +8 -26
- package/mobile/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/mobile/lib/content-page-repository/alignImg.d.ts +9 -0
- package/mobile/lib/content-page-repository/alignImg.js +17 -0
- package/mobile/lib/content-page-repository/alignImg.js.map +1 -0
- package/mobile/lib/content-page-repository/computeImgOutputPath.d.ts +3 -0
- package/mobile/lib/content-page-repository/computeImgOutputPath.js +12 -0
- package/mobile/lib/content-page-repository/computeImgOutputPath.js.map +1 -0
- package/mobile/lib/content-page-repository/resizeImg.d.ts +3 -0
- package/mobile/lib/content-page-repository/resizeImg.js +13 -0
- package/mobile/lib/content-page-repository/resizeImg.js.map +1 -0
- package/mobile/lib/content-page-repository/transformContentPage.d.ts +1 -0
- package/mobile/lib/content-page-repository/transformContentPage.js +23 -18
- package/mobile/lib/content-page-repository/transformContentPage.js.map +1 -1
- package/mobile/lib/content-page-repository/transformImg.d.ts +6 -5
- package/mobile/lib/content-page-repository/transformImg.js +26 -76
- package/mobile/lib/content-page-repository/transformImg.js.map +1 -1
- package/mobile/lib/content-page-repository/transformPicture.d.ts +1 -1
- package/mobile/lib/content-page-repository/transformPicture.js +8 -16
- package/mobile/lib/content-page-repository/transformPicture.js.map +1 -1
- package/mobile/lib/ui-kit/InputListRange/InputListRange.d.ts +2 -0
- package/mobile/lib/ui-kit/InputListRange/InputListRange.js +39 -0
- package/mobile/lib/ui-kit/InputListRange/InputListRange.js.map +1 -0
- package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +10 -0
- package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js +2 -0
- package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js.map +1 -0
- package/mobile/lib/ui-kit/Select/Select.js +2 -1
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/utils/arrayByRange.d.ts +1 -0
- package/mobile/lib/utils/arrayByRange.js +2 -0
- package/mobile/lib/utils/arrayByRange.js.map +1 -0
- package/mobile/lib/utils/isPictureSizeEmpty.d.ts +2 -2
- package/mobile/lib/utils/isPictureSizeEmpty.js +1 -1
- package/mobile/lib/utils/isPictureSizeEmpty.js.map +1 -1
- package/mobile/lib/utils/mergeIntervals.d.ts +1 -0
- package/mobile/lib/utils/mergeIntervals.js +17 -0
- package/mobile/lib/utils/mergeIntervals.js.map +1 -0
- package/mobile/src/components/Calculator/Calculator.example.json +3 -1
- package/mobile/src/components/Calculator/CalculatorContent.ts +20 -19
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +6 -7
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +48 -15
- package/mobile/src/components/Calculator/constants.ts +1 -1
- package/mobile/src/components/Calculator/rangeHelpers.ts +10 -0
- package/mobile/src/components/Calculator/renderMonthsInput.tsx +13 -2
- package/mobile/src/components/Calculator/useCreditCalculatorParams.ts +8 -10
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +36 -9
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -2
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -8
- package/mobile/src/components/Footer/MediaButton.tsx +3 -5
- package/mobile/src/content-page-repository/ContentPageRepository.ts +8 -40
- package/mobile/src/content-page-repository/alignImg.ts +32 -0
- package/mobile/src/content-page-repository/computeImgOutputPath.ts +20 -0
- package/mobile/src/content-page-repository/resizeImg.ts +18 -0
- package/mobile/src/content-page-repository/transformContentPage.ts +25 -18
- package/mobile/src/content-page-repository/transformImg.ts +49 -121
- package/mobile/src/content-page-repository/transformPicture.ts +9 -21
- package/mobile/src/ui-kit/InputListRange/InputListRange.tsx +99 -0
- package/mobile/src/ui-kit/InputListRange/InputListRangeProps.ts +11 -0
- package/mobile/src/ui-kit/Select/Select.tsx +8 -1
- package/mobile/src/utils/arrayByRange.ts +4 -0
- package/mobile/src/utils/isPictureSizeEmpty.ts +3 -3
- package/mobile/src/utils/mergeIntervals.ts +19 -0
- package/package.json +1 -1
- package/src/components/Calculator/Calculator.example.json +3 -1
- package/src/components/Calculator/Calculator.fixture.tsx +4 -0
- package/src/components/Calculator/CalculatorContent.ts +20 -19
- package/src/components/Calculator/CreditCalculatorForm.tsx +6 -7
- package/src/components/Calculator/DepositCalculatorForm.tsx +48 -15
- package/src/components/Calculator/constants.ts +1 -1
- package/src/components/Calculator/rangeHelpers.ts +10 -0
- package/src/components/Calculator/renderMonthsInput.tsx +13 -2
- package/src/components/Calculator/useCreditCalculatorParams.ts +8 -10
- package/src/components/Calculator/useDepositCalculatorParams.ts +36 -9
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.example.json +1 -2
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.tsx +0 -9
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +2 -8
- package/src/components/Footer/MediaButton.tsx +3 -5
- package/src/content-page-repository/ContentPageRepository.ts +8 -40
- package/src/content-page-repository/alignImg.ts +32 -0
- package/src/content-page-repository/computeImgOutputPath.ts +20 -0
- package/src/content-page-repository/resizeImg.ts +18 -0
- package/src/content-page-repository/transformContentPage.ts +25 -18
- package/src/content-page-repository/transformImg.ts +49 -121
- package/src/content-page-repository/transformPicture.ts +9 -21
- package/src/ui-kit/InputListRange/InputListRange.tsx +99 -0
- package/src/ui-kit/InputListRange/InputListRangeProps.ts +11 -0
- package/src/ui-kit/Select/Select.tsx +8 -1
- package/src/utils/arrayByRange.ts +4 -0
- package/src/utils/isPictureSizeEmpty.ts +3 -3
- package/src/utils/mergeIntervals.ts +19 -0
- package/bundle/content-page-repository/transformImgPath.d.ts +0 -8
- package/dist/content-page-repository/transformImgPath.d.ts +0 -8
- package/dist/content-page-repository/transformImgPath.js +0 -22
- package/dist/content-page-repository/transformImgPath.js.map +0 -1
- package/lib/content-page-repository/transformImgPath.d.ts +0 -8
- package/lib/content-page-repository/transformImgPath.js +0 -16
- package/lib/content-page-repository/transformImgPath.js.map +0 -1
- package/mobile/bundle/content-page-repository/transformImgPath.d.ts +0 -8
- package/mobile/dist/content-page-repository/transformImgPath.d.ts +0 -8
- package/mobile/dist/content-page-repository/transformImgPath.js +0 -22
- package/mobile/dist/content-page-repository/transformImgPath.js.map +0 -1
- package/mobile/lib/content-page-repository/transformImgPath.d.ts +0 -8
- package/mobile/lib/content-page-repository/transformImgPath.js +0 -16
- package/mobile/lib/content-page-repository/transformImgPath.js.map +0 -1
- package/mobile/src/content-page-repository/transformImgPath.ts +0 -30
- package/src/content-page-repository/transformImgPath.ts +0 -30
|
@@ -1,146 +1,74 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import
|
|
4
|
-
import sharp from 'sharp';
|
|
3
|
+
import sharp, { type Sharp } from 'sharp';
|
|
5
4
|
import util from 'util';
|
|
6
5
|
import type { ImageSize } from '../model/ImageSize';
|
|
7
|
-
import type {
|
|
6
|
+
import type { ImgSource } from '../model/Picture';
|
|
8
7
|
import { isPictureSizeEmpty } from '../utils/isPictureSizeEmpty';
|
|
8
|
+
import { alignImg } from './alignImg';
|
|
9
|
+
import { computeImgOutputPath } from './computeImgOutputPath';
|
|
10
|
+
import { resizeImg } from './resizeImg';
|
|
9
11
|
import type { TransformationOptions } from './TransformationOptions';
|
|
10
|
-
import { transformImgPath } from './transformImgPath';
|
|
11
12
|
|
|
12
13
|
const mkdir = util.promisify(fs.mkdir);
|
|
13
14
|
|
|
14
|
-
type
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
containerSize?: ImageSize;
|
|
18
|
-
transformationOptions: TransformationOptions & ImgSource;
|
|
19
|
-
};
|
|
15
|
+
type ImgOutputPath = string;
|
|
16
|
+
type TransformationTaskKey = ImgOutputPath;
|
|
17
|
+
type TransformationTasksCache = Map<TransformationTaskKey, Promise<ImgOutputPath>>;
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
src,
|
|
24
|
-
containerSize,
|
|
25
|
-
transformationOptions,
|
|
26
|
-
}: TransformImgParams): Promise<string> {
|
|
27
|
-
if (!src) {
|
|
28
|
-
return '';
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const { contentDir, publicDir, format, options, size, alignment } = transformationOptions;
|
|
32
|
-
|
|
33
|
-
const pageDir = path.dirname(pagePath);
|
|
34
|
-
const imgPath = `${pageDir}/${src}`;
|
|
35
|
-
let chain = sharp(imgPath);
|
|
36
|
-
|
|
37
|
-
const targetSize = getPictureSize(size, containerSize);
|
|
38
|
-
|
|
39
|
-
if (targetSize) {
|
|
40
|
-
chain = resizeImg(chain, targetSize, getResizeFit(targetSize));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (containerSize) {
|
|
44
|
-
chain = resizeImg(chain, containerSize);
|
|
45
|
-
|
|
46
|
-
// Save intermediate transform result to modify further
|
|
47
|
-
const { data } = await chain.toBuffer({ resolveWithObject: true });
|
|
48
|
-
|
|
49
|
-
chain = resizeImg(
|
|
50
|
-
sharp(data),
|
|
51
|
-
getCompositionResizeSize(containerSize, targetSize),
|
|
52
|
-
getResizeFit(targetSize),
|
|
53
|
-
);
|
|
19
|
+
type TransformImgOptions = TransformationOptions &
|
|
20
|
+
ImgSource & { containerSize?: ImageSize; cache?: TransformationTasksCache };
|
|
54
21
|
|
|
55
|
-
|
|
56
|
-
}
|
|
22
|
+
const defaultTransformationCache: TransformationTasksCache = new Map();
|
|
57
23
|
|
|
58
|
-
|
|
59
|
-
|
|
24
|
+
export function transformImg(
|
|
25
|
+
src: string,
|
|
26
|
+
pagePath: string,
|
|
27
|
+
options: TransformImgOptions,
|
|
28
|
+
): ImgOutputPath | Promise<ImgOutputPath> {
|
|
29
|
+
if (!src) {
|
|
30
|
+
return '';
|
|
60
31
|
}
|
|
61
32
|
|
|
62
|
-
const
|
|
63
|
-
const
|
|
33
|
+
const input = path.join(path.dirname(pagePath), src);
|
|
34
|
+
const output = computeImgOutputPath(input, options);
|
|
64
35
|
|
|
65
|
-
|
|
36
|
+
const { cache = defaultTransformationCache } = options;
|
|
66
37
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
console.error(e);
|
|
38
|
+
const cachedResult = cache.get(output);
|
|
39
|
+
if (cachedResult) {
|
|
40
|
+
return cachedResult;
|
|
71
41
|
}
|
|
72
42
|
|
|
73
|
-
|
|
74
|
-
|
|
43
|
+
const result = (async () => {
|
|
44
|
+
try {
|
|
45
|
+
await mkdir(path.dirname(output), { recursive: true });
|
|
75
46
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
47
|
+
const chain = await computeTransformationChain(options)(sharp(input));
|
|
48
|
+
await chain.toFile(output);
|
|
49
|
+
} catch (e) {
|
|
50
|
+
console.error(e);
|
|
51
|
+
}
|
|
79
52
|
|
|
80
|
-
|
|
53
|
+
return output;
|
|
54
|
+
})();
|
|
55
|
+
cache.set(output, result);
|
|
81
56
|
|
|
82
|
-
return
|
|
57
|
+
return result;
|
|
83
58
|
}
|
|
84
59
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
fit: sharp.fit.fill,
|
|
88
|
-
background: { r: 0, g: 0, b: 0, alpha: 0 },
|
|
89
|
-
...options,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
type CompositeImgParams = {
|
|
94
|
-
chain: Sharp;
|
|
95
|
-
containerSize: ImageSize;
|
|
96
|
-
alignment?: ImgAlignment;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
async function compositeImg({
|
|
100
|
-
chain,
|
|
60
|
+
const computeTransformationChain = ({
|
|
61
|
+
size,
|
|
101
62
|
containerSize,
|
|
102
63
|
alignment,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
function getPictureSize(size: Picture['size'], containerSize?: ImageSize) {
|
|
115
|
-
// If containerSize is undefined intrinsic dimensions of image will be used then.
|
|
116
|
-
return isPictureSizeEmpty(size) ? containerSize : size;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function getCompositionResizeSize(
|
|
120
|
-
containerSize: ImageSize,
|
|
121
|
-
size: Picture['size'] = {},
|
|
122
|
-
): Picture['size'] {
|
|
123
|
-
const { width, height } = size;
|
|
124
|
-
const { width: containerWidth, height: containerHeight } = containerSize;
|
|
125
|
-
|
|
126
|
-
if (!(width || height)) {
|
|
127
|
-
return undefined;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const widthRatio = width ? containerWidth / width : 0;
|
|
131
|
-
const heightRatio = height ? containerHeight / height : 0;
|
|
132
|
-
|
|
133
|
-
return widthRatio > heightRatio
|
|
134
|
-
? { width: Math.min(Number(width), containerWidth) }
|
|
135
|
-
: { height: Math.min(Number(height), containerHeight) };
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function getResizeFit(size: Picture['size']): ResizeOptions {
|
|
139
|
-
/*
|
|
140
|
-
Editor behaviour with one dimension present: resize by given dimension maintaining aspect ratio. (fit: contain)
|
|
141
|
-
With two dimensions present: resize trying to fill given dimensions (fit: fill)
|
|
142
|
-
*/
|
|
143
|
-
return {
|
|
144
|
-
fit: size?.width && size?.height ? sharp.fit.fill : sharp.fit.contain,
|
|
145
|
-
};
|
|
146
|
-
}
|
|
64
|
+
format,
|
|
65
|
+
options,
|
|
66
|
+
}: TransformImgOptions) =>
|
|
67
|
+
pipe(
|
|
68
|
+
resizeImg(isPictureSizeEmpty(size) ? containerSize : size),
|
|
69
|
+
alignImg({ containerSize, alignment }),
|
|
70
|
+
(_) => (format ? _.toFormat(format, options) : _),
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
const pipe = (...operations: Array<(chain: Sharp) => Promise<Sharp> | Sharp>) =>
|
|
74
|
+
operations.reduce((a, b) => async (chain: Sharp) => b(await a(chain)));
|
|
@@ -5,42 +5,30 @@ import type { TransformationOptions } from './TransformationOptions';
|
|
|
5
5
|
import { transformImg } from './transformImg';
|
|
6
6
|
|
|
7
7
|
export async function transformPicture(
|
|
8
|
-
pagePath: string,
|
|
9
8
|
picture: Picture,
|
|
9
|
+
pagePath: string,
|
|
10
10
|
options: TransformationOptions,
|
|
11
11
|
): Promise<Picture> {
|
|
12
|
-
const sources = picture.sources || [];
|
|
13
12
|
const src = picture?.src || '';
|
|
14
13
|
|
|
15
|
-
const
|
|
16
|
-
pagePath,
|
|
17
|
-
src,
|
|
18
|
-
transformationOptions: { ...options, ...picture },
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const { width, height } = await sharp(
|
|
22
|
-
path.resolve(options.publicDir, transformedPicture),
|
|
23
|
-
).metadata();
|
|
14
|
+
const transformedImgPath = await transformImg(src, pagePath, { ...options, ...picture });
|
|
24
15
|
|
|
16
|
+
const { width, height } = await sharp(transformedImgPath).metadata();
|
|
25
17
|
const containerSize = width && height ? { width, height } : undefined;
|
|
26
18
|
|
|
19
|
+
const sources = picture.sources || [];
|
|
27
20
|
const transformedSources = await Promise.all(
|
|
28
|
-
sources.map((_) =>
|
|
29
|
-
transformImg({
|
|
30
|
-
pagePath,
|
|
31
|
-
src,
|
|
32
|
-
containerSize,
|
|
33
|
-
transformationOptions: { ...options, ..._ },
|
|
34
|
-
}),
|
|
35
|
-
),
|
|
21
|
+
sources.map((_) => transformImg(src, pagePath, { ...options, ..._, containerSize })),
|
|
36
22
|
);
|
|
37
23
|
|
|
24
|
+
const imgPathToSrc = (_: string) => path.join('/', path.relative(options.publicDir, _));
|
|
25
|
+
|
|
38
26
|
return {
|
|
39
27
|
...picture,
|
|
40
|
-
src:
|
|
28
|
+
src: imgPathToSrc(transformedImgPath),
|
|
41
29
|
sources: transformedSources.map((_, i) => ({
|
|
42
30
|
...sources[i],
|
|
43
|
-
src:
|
|
31
|
+
src: imgPathToSrc(_),
|
|
44
32
|
size: { width, height },
|
|
45
33
|
})),
|
|
46
34
|
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
|
|
3
|
+
import { clamp } from '../../utils/clamp';
|
|
4
|
+
import { getSanitizedValue } from '../../utils/getSanitizedValue';
|
|
5
|
+
import type { InputListRangeProps } from './InputListRangeProps';
|
|
6
|
+
|
|
7
|
+
const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
|
|
8
|
+
|
|
9
|
+
export const InputListRange = JSX<InputListRangeProps>(
|
|
10
|
+
({ className, title, items = [], list = [], value = list[0], disabled = false, onChange }) => {
|
|
11
|
+
const min = 0;
|
|
12
|
+
const max = list.length - 1;
|
|
13
|
+
const step = 1;
|
|
14
|
+
|
|
15
|
+
const handleTextChange: JSX.IntrinsicElements['input']['onChange'] = (e) => {
|
|
16
|
+
if (!onChange) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const newValue = parseInt(e.target.value);
|
|
20
|
+
|
|
21
|
+
const closetValue = list.reduce(function (prev, curr) {
|
|
22
|
+
return Math.abs(curr - newValue) < Math.abs(prev - newValue) ? curr : prev;
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
onChange(Number(getSanitizedValue(closetValue.toString())));
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const handleRangeChange: JSX.IntrinsicElements['input']['onChange'] = (e) => {
|
|
29
|
+
if (!onChange) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const val = list.at(clamp(parseInt(e.target.value), min, max)) || 0;
|
|
34
|
+
onChange(Number(getSanitizedValue(val.toString())));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const valueIndex = list.findIndex((item) => item === value) || 0;
|
|
38
|
+
const inputStyle = {
|
|
39
|
+
backgroundSize: `${(((valueIndex - min) * 100) / (max - min)).toFixed(2)}% 100%`,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div className={className}>
|
|
44
|
+
<label className="block relative">
|
|
45
|
+
{title ? <span className="text-m-light text-primary-text">{title}</span> : null}
|
|
46
|
+
<input
|
|
47
|
+
className={`m-0 mt-2 font-sans text-h3 w-full h-14 border border-solid border-gray rounded-md
|
|
48
|
+
outline-none p-0 pl-4 box-border text-primary-text hover:border-primary-hover focus:border-primary-text ${DISABLED_INPUT_CLASSES}`}
|
|
49
|
+
value={addSpacesBetweenNumbers(value)}
|
|
50
|
+
disabled={disabled}
|
|
51
|
+
onChange={handleTextChange}
|
|
52
|
+
onBlur={handleTextChange}
|
|
53
|
+
/>
|
|
54
|
+
{list.length ? (
|
|
55
|
+
<div className="absolute w-full flex justify-between -bottom-[3px] px-4">
|
|
56
|
+
{list.map(renderTick(valueIndex, disabled))}
|
|
57
|
+
</div>
|
|
58
|
+
) : null}
|
|
59
|
+
<div className="absolute inset-x-0 -bottom-1 px-4 leading-[18px]">
|
|
60
|
+
<input
|
|
61
|
+
className="box-border w-full m-0 cursor-pointer slider relative z-10"
|
|
62
|
+
type="range"
|
|
63
|
+
min={min}
|
|
64
|
+
max={max}
|
|
65
|
+
step={step}
|
|
66
|
+
value={valueIndex}
|
|
67
|
+
disabled={disabled}
|
|
68
|
+
onChange={handleRangeChange}
|
|
69
|
+
style={inputStyle}
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
</label>
|
|
73
|
+
{renderRangeCaption(items)}
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
const renderTick = (valueIndex: number, disabled: boolean) => (value: number, i: number) =>
|
|
80
|
+
(
|
|
81
|
+
<span
|
|
82
|
+
key={String(i)}
|
|
83
|
+
className={`w-2 h-2 rounded-full ${
|
|
84
|
+
valueIndex <= i || disabled ? 'bg-gray' : 'bg-primary-main'
|
|
85
|
+
}`}
|
|
86
|
+
/>
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
function renderRangeCaption(items: string[]) {
|
|
90
|
+
return (
|
|
91
|
+
<div className="flex justify-between my-2">
|
|
92
|
+
{items.map((item, i) => (
|
|
93
|
+
<span key={String(i)} className="text-s-light text-secondary-text">
|
|
94
|
+
{item}
|
|
95
|
+
</span>
|
|
96
|
+
))}
|
|
97
|
+
</div>
|
|
98
|
+
);
|
|
99
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ListContent } from '../List/ListContent';
|
|
2
|
+
|
|
3
|
+
export interface InputListRangeProps extends ListContent {
|
|
4
|
+
className?: string;
|
|
5
|
+
items?: string[];
|
|
6
|
+
list?: number[];
|
|
7
|
+
value?: number;
|
|
8
|
+
title?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onChange?: (value: number) => void;
|
|
11
|
+
}
|
|
@@ -2,6 +2,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import { useCallback, useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { useOutsideClick } from '../../hooks/useOutsideClick';
|
|
4
4
|
import { LabelProps } from '../../model/HeadlineType';
|
|
5
|
+
import { Text } from '../../ui-kit/Text/Text';
|
|
5
6
|
import { Icon } from '../Icon/Icon';
|
|
6
7
|
|
|
7
8
|
export interface OptionProps {
|
|
@@ -39,7 +40,13 @@ export const Select = JSX<SelectProps>(
|
|
|
39
40
|
|
|
40
41
|
return (
|
|
41
42
|
<div className={`${className}`} ref={wrapperRef}>
|
|
42
|
-
{label ?
|
|
43
|
+
{label ? (
|
|
44
|
+
<div className="mb-2">
|
|
45
|
+
<Text size="text-m" color="text-primary-text" font="font-light">
|
|
46
|
+
{label}
|
|
47
|
+
</Text>
|
|
48
|
+
</div>
|
|
49
|
+
) : null}
|
|
43
50
|
<div className={`relative ${isOpen ? 'z-20' : 'z-10'}`}>
|
|
44
51
|
<div
|
|
45
52
|
className={`text-l flex justify-between items-center mb-0.5 text-primary-text cursor-pointer
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ImageSize } from '../model/ImageSize';
|
|
2
2
|
|
|
3
|
-
export function isPictureSizeEmpty(size:
|
|
4
|
-
return !
|
|
3
|
+
export function isPictureSizeEmpty(size: Partial<ImageSize> | undefined): boolean {
|
|
4
|
+
return !size?.width && !size?.height;
|
|
5
5
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const mergeIntervals = (intervals: number[][]): number[][] => {
|
|
2
|
+
const result = [...intervals];
|
|
3
|
+
result.sort(([a], [c]) => a - c);
|
|
4
|
+
|
|
5
|
+
let i = 1;
|
|
6
|
+
|
|
7
|
+
while (i < result.length) {
|
|
8
|
+
const [a, b] = result[i - 1];
|
|
9
|
+
const [c, d] = result[i];
|
|
10
|
+
|
|
11
|
+
if (b >= c) {
|
|
12
|
+
result.splice(i - 1, 2, [a, Math.max(b, d)]);
|
|
13
|
+
} else {
|
|
14
|
+
i++;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return result;
|
|
19
|
+
};
|
package/package.json
CHANGED
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
"isShowSalaryClient": true,
|
|
21
21
|
"isShowStateEmployee": true,
|
|
22
22
|
"isShowPensionClient": true,
|
|
23
|
-
"isShowInsurance": true
|
|
23
|
+
"isShowInsurance": true,
|
|
24
|
+
"isShowMonthlyInterestPayment": true,
|
|
25
|
+
"isShowRemoteRegistration": true
|
|
24
26
|
},
|
|
25
27
|
"footnote": "Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка. "
|
|
26
28
|
}
|
|
@@ -44,6 +44,10 @@ const CREDIT_CALCULATOR_BLOCK: CreditCalculatorParamsDef = {
|
|
|
44
44
|
|
|
45
45
|
const DEPOSIT_CALCULATOR_BLOCK: DepositCalculatorParamsDef = {
|
|
46
46
|
calcType: 'DepositCalculatorForm',
|
|
47
|
+
paramsViewSettings: {
|
|
48
|
+
isShowMonthlyInterestPayment: true,
|
|
49
|
+
isShowRemoteRegistration: true,
|
|
50
|
+
},
|
|
47
51
|
buttons: buttons,
|
|
48
52
|
footnote,
|
|
49
53
|
};
|
|
@@ -20,11 +20,30 @@ export interface CreditCalculatorParamsViewSettings {
|
|
|
20
20
|
/** @title Комплексная страховая защита */
|
|
21
21
|
isShowInsurance?: boolean;
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
export interface DepositCalculatorParamsViewSettings {
|
|
25
|
+
/**
|
|
26
|
+
* @title Выплата процентов
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
29
|
+
isShowMonthlyInterestPayment?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* @title Оформление
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
isShowRemoteRegistration?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
23
37
|
export interface CreditCalculatorProps extends CommonCalculatorProps {
|
|
24
38
|
/** @title Настройка отображения чекбоксов */
|
|
25
39
|
paramsViewSettings?: CreditCalculatorParamsViewSettings;
|
|
26
40
|
}
|
|
27
41
|
|
|
42
|
+
export interface DepositCalculatorProps extends CommonCalculatorProps {
|
|
43
|
+
/** @title Настройка отображения радио */
|
|
44
|
+
paramsViewSettings?: DepositCalculatorParamsViewSettings;
|
|
45
|
+
}
|
|
46
|
+
|
|
28
47
|
export interface BusinessDepositCalculatorProps extends CommonCalculatorProps {
|
|
29
48
|
/** @title Сноска снизу блока */
|
|
30
49
|
bottomFootnote?: string;
|
|
@@ -32,22 +51,6 @@ export interface BusinessDepositCalculatorProps extends CommonCalculatorProps {
|
|
|
32
51
|
isShowDepositeName?: boolean;
|
|
33
52
|
}
|
|
34
53
|
|
|
35
|
-
/**
|
|
36
|
-
* TODO: данные из справочника
|
|
37
|
-
**/
|
|
38
|
-
export interface DepositCalculatorParams {
|
|
39
|
-
/** @hidden */
|
|
40
|
-
minSum?: number;
|
|
41
|
-
/** @hidden */
|
|
42
|
-
maxSum?: number;
|
|
43
|
-
/** @hidden */
|
|
44
|
-
minMonths?: number;
|
|
45
|
-
/** @hidden */
|
|
46
|
-
maxMonths?: number;
|
|
47
|
-
/** @hidden */
|
|
48
|
-
rate?: number;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
54
|
/**
|
|
52
55
|
* ? Общий интерфейс для всех типов калькуляторов?
|
|
53
56
|
* ? Используется во вложенных функциях. Может быть как то разбить это и вынести отсюда?
|
|
@@ -77,8 +80,7 @@ export type CreditCalculatorParamsDef = TitleProps &
|
|
|
77
80
|
* @default {"calcType": "DepositCalculatorForm"}
|
|
78
81
|
*/
|
|
79
82
|
export type DepositCalculatorParamsDef = TitleProps &
|
|
80
|
-
|
|
81
|
-
CommonCalculatorProps & {
|
|
83
|
+
DepositCalculatorProps & {
|
|
82
84
|
calcType: 'DepositCalculatorForm';
|
|
83
85
|
};
|
|
84
86
|
|
|
@@ -87,7 +89,6 @@ export type DepositCalculatorParamsDef = TitleProps &
|
|
|
87
89
|
* @default {"calcType": "BusinessDepositCalculatorForm"}
|
|
88
90
|
*/
|
|
89
91
|
export type BusinessDepositCalculatorParamsDef = TitleProps &
|
|
90
|
-
DepositCalculatorParams &
|
|
91
92
|
BusinessDepositCalculatorProps & {
|
|
92
93
|
calcType: 'BusinessDepositCalculatorForm';
|
|
93
94
|
};
|
|
@@ -94,13 +94,12 @@ const renderRate = (rate: number) => (
|
|
|
94
94
|
<Rate title="Ставка" rate={rate} rateBlockClassName="tracking-[-25px]" unit="%" />
|
|
95
95
|
);
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
};
|
|
97
|
+
interface CreditParamsFormProps extends CreditCalculatorParams, CreditCalculatorParamsViewSettings {
|
|
98
|
+
handleIsSalaryClient?: (value: boolean) => void;
|
|
99
|
+
handleIsStateEmployee?: (value: boolean) => void;
|
|
100
|
+
handleIsPensionClient?: (value: boolean) => void;
|
|
101
|
+
handleIsInsurance?: (value: boolean) => void;
|
|
102
|
+
}
|
|
104
103
|
|
|
105
104
|
const renderCreditParamsForm = ({
|
|
106
105
|
isSalaryClient,
|
|
@@ -4,7 +4,7 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
4
4
|
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
5
5
|
import { renderButtonsSection } from '../../ui-kit/Button/renderButtonsSection';
|
|
6
6
|
import { style } from '../../utils/style';
|
|
7
|
-
import {
|
|
7
|
+
import { DepositCalculatorParamsViewSettings, DepositCalculatorProps } from './CalculatorContent';
|
|
8
8
|
import { CalculatorValueBlock } from './CalculatorValueBlock';
|
|
9
9
|
import { DEFAULT_MONTHS, DEFAULT_SUM } from './constants';
|
|
10
10
|
import { Rate } from './Rate';
|
|
@@ -13,14 +13,14 @@ import { renderInterestPayment } from './renderInterestPayment';
|
|
|
13
13
|
import { renderMonthsInput } from './renderMonthsInput';
|
|
14
14
|
import { renderRegistrationType } from './renderRegistrationType';
|
|
15
15
|
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
16
|
-
import { useDepositCalculatorParams } from './useDepositCalculatorParams';
|
|
16
|
+
import { DepositCalculatorParams, useDepositCalculatorParams } from './useDepositCalculatorParams';
|
|
17
17
|
|
|
18
|
-
export interface DepositCalculatorProp extends
|
|
18
|
+
export interface DepositCalculatorProp extends DepositCalculatorProps {
|
|
19
19
|
className?: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
23
|
-
({ className = '', sourceBookDir, buttons, footnote }) => {
|
|
23
|
+
({ className = '', sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
24
24
|
const [moneyValue, setMoneyValue] = useState(DEFAULT_SUM);
|
|
25
25
|
const handleMoneyValue = useCallback((_: number) => setMoneyValue(_), []);
|
|
26
26
|
const [monthsValue, setMonthsValue] = useState(DEFAULT_MONTHS);
|
|
@@ -42,7 +42,11 @@ export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
|
42
42
|
};
|
|
43
43
|
const handleMonthsValue = useCallback((_: number) => setMonthsValue(_), []);
|
|
44
44
|
|
|
45
|
-
const calculatorParams = useDepositCalculatorParams(
|
|
45
|
+
const calculatorParams = useDepositCalculatorParams(
|
|
46
|
+
userInputParams,
|
|
47
|
+
sourceBookDir,
|
|
48
|
+
paramsViewSettings,
|
|
49
|
+
);
|
|
46
50
|
const { income, finalSum, rate } = calculatorParams;
|
|
47
51
|
|
|
48
52
|
return (
|
|
@@ -62,16 +66,12 @@ export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
|
62
66
|
},
|
|
63
67
|
handleMonthsValue,
|
|
64
68
|
)}
|
|
65
|
-
<div className="mt-7
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
{renderRegistrationType({
|
|
72
|
-
isRemoteRegistration,
|
|
73
|
-
callback: handleIsRemoteRegistration,
|
|
74
|
-
title: 'Оформление',
|
|
69
|
+
<div className="mt-7">
|
|
70
|
+
{renderDepositParamsForm({
|
|
71
|
+
...calculatorParams,
|
|
72
|
+
...paramsViewSettings,
|
|
73
|
+
handleIsMonthlyInterestPayment,
|
|
74
|
+
handleIsRemoteRegistration,
|
|
75
75
|
})}
|
|
76
76
|
</div>
|
|
77
77
|
</div>
|
|
@@ -86,3 +86,36 @@ export const DepositCalculatorForm = JSX<DepositCalculatorProp>(
|
|
|
86
86
|
);
|
|
87
87
|
},
|
|
88
88
|
);
|
|
89
|
+
|
|
90
|
+
interface DepositParamsFormProps
|
|
91
|
+
extends DepositCalculatorParams,
|
|
92
|
+
DepositCalculatorParamsViewSettings {
|
|
93
|
+
handleIsMonthlyInterestPayment?: (value: boolean) => void;
|
|
94
|
+
handleIsRemoteRegistration?: (value: boolean) => void;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const renderDepositParamsForm = ({
|
|
98
|
+
isMonthlyInterestPayment,
|
|
99
|
+
isRemoteRegistration,
|
|
100
|
+
isShowMonthlyInterestPayment,
|
|
101
|
+
isShowRemoteRegistration,
|
|
102
|
+
handleIsMonthlyInterestPayment,
|
|
103
|
+
handleIsRemoteRegistration,
|
|
104
|
+
}: DepositParamsFormProps) => (
|
|
105
|
+
<div className="flex flex-col gap-y-7">
|
|
106
|
+
{isShowMonthlyInterestPayment
|
|
107
|
+
? renderInterestPayment({
|
|
108
|
+
isMonthlyInterestPayment,
|
|
109
|
+
callback: handleIsMonthlyInterestPayment,
|
|
110
|
+
title: 'Выплата процентов',
|
|
111
|
+
})
|
|
112
|
+
: null}
|
|
113
|
+
{isShowRemoteRegistration
|
|
114
|
+
? renderRegistrationType({
|
|
115
|
+
isRemoteRegistration,
|
|
116
|
+
callback: handleIsRemoteRegistration,
|
|
117
|
+
title: 'Оформление',
|
|
118
|
+
})
|
|
119
|
+
: null}
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { maxBy } from '../../utils/maxBy';
|
|
2
|
+
import { mergeIntervals } from '../../utils/mergeIntervals';
|
|
2
3
|
import { minBy } from '../../utils/minBy';
|
|
3
4
|
|
|
4
5
|
export const getRangeByKeys = <
|
|
@@ -13,6 +14,15 @@ export const getRangeByKeys = <
|
|
|
13
14
|
[maxKey]: rows.length ? maxBy()(rows.map((row) => row[maxKey])) : 0,
|
|
14
15
|
});
|
|
15
16
|
|
|
17
|
+
export const getMergeRangesByKeys = <
|
|
18
|
+
MinKey extends string,
|
|
19
|
+
MaxKey extends string,
|
|
20
|
+
T extends Record<MinKey | MaxKey, number>,
|
|
21
|
+
>(
|
|
22
|
+
[minKey, maxKey]: [MinKey, MaxKey],
|
|
23
|
+
rows: T[] = [],
|
|
24
|
+
) => mergeIntervals(rows.map((row) => [row[minKey], row[maxKey]]));
|
|
25
|
+
|
|
16
26
|
export const checkRangeByKeys = <
|
|
17
27
|
MinKey extends string,
|
|
18
28
|
MaxKey extends string,
|