@redneckz/wildless-cms-uni-blocks 0.10.6 → 0.10.7
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/bundle/bundle.umd.js +198 -266
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Calculator/Rate.d.ts +1 -0
- package/bundle/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
- package/bundle/components/Calculator/renderDaysInput.d.ts +2 -7
- package/bundle/components/Calculator/renderInterestPayment.d.ts +2 -9
- package/bundle/components/Calculator/renderMonthsInput.d.ts +3 -5
- package/bundle/components/Calculator/renderPaymentType.d.ts +2 -11
- package/bundle/components/Calculator/renderRegistrationType.d.ts +2 -9
- package/bundle/components/Calculator/renderWantedSumInput.d.ts +3 -7
- package/bundle/components/Carousel/itemsGap.d.ts +1 -0
- package/bundle/components/Carousel/itemsGap.mobile.d.ts +1 -0
- package/bundle/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
- package/bundle/components/CarouselTariffsCard/descriptionSize.mobile.d.ts +1 -0
- package/bundle/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
- package/bundle/components/CarouselTariffsCard/getPaddingStyle.mobile.d.ts +1 -0
- package/bundle/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
- package/bundle/components/Headline/headlineVersionStyles.d.ts +1 -1
- package/bundle/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/bundle/ui-kit/InputRange/parseDecimal.d.ts +1 -0
- package/bundle/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
- package/dist/components/ApplicationForm/ApplicationForm.js +1 -1
- package/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/dist/components/Blocks.mobile.js +4 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/Calculator/BonusCalculatorForm.js +16 -18
- package/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
- package/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/Calculator.js +4 -4
- package/dist/components/Calculator/Calculator.js.map +1 -1
- package/dist/components/Calculator/CreditCalculatorForm.js +27 -43
- package/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/DepositCalculatorForm.js +30 -33
- package/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/dist/components/Calculator/Rate.d.ts +1 -0
- package/dist/components/Calculator/Rate.js +1 -1
- package/dist/components/Calculator/Rate.js.map +1 -1
- package/dist/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
- package/dist/components/Calculator/renderBinaryRadioButtonGroup.js +8 -0
- package/dist/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
- package/dist/components/Calculator/renderDaysInput.d.ts +2 -7
- package/dist/components/Calculator/renderDaysInput.js +2 -9
- package/dist/components/Calculator/renderDaysInput.js.map +1 -1
- package/dist/components/Calculator/renderInterestPayment.d.ts +2 -9
- package/dist/components/Calculator/renderInterestPayment.js +8 -18
- package/dist/components/Calculator/renderInterestPayment.js.map +1 -1
- package/dist/components/Calculator/renderMonthsInput.d.ts +3 -5
- package/dist/components/Calculator/renderMonthsInput.js +2 -10
- package/dist/components/Calculator/renderMonthsInput.js.map +1 -1
- package/dist/components/Calculator/renderPaymentType.d.ts +2 -11
- package/dist/components/Calculator/renderPaymentType.js +9 -19
- package/dist/components/Calculator/renderPaymentType.js.map +1 -1
- package/dist/components/Calculator/renderRegistrationType.d.ts +2 -9
- package/dist/components/Calculator/renderRegistrationType.js +8 -18
- package/dist/components/Calculator/renderRegistrationType.js.map +1 -1
- package/dist/components/Calculator/renderWantedSumInput.d.ts +3 -7
- package/dist/components/Calculator/renderWantedSumInput.js +4 -6
- package/dist/components/Calculator/renderWantedSumInput.js.map +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js +1 -1
- package/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/dist/components/Carousel/Carousel.js +3 -3
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/itemsGap.d.ts +1 -0
- package/dist/components/Carousel/itemsGap.js +4 -0
- package/dist/components/Carousel/itemsGap.js.map +1 -0
- package/dist/components/Carousel/itemsGap.mobile.d.ts +1 -0
- package/dist/components/Carousel/itemsGap.mobile.js +4 -0
- package/dist/components/Carousel/itemsGap.mobile.js.map +1 -0
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -10
- package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/dist/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
- package/dist/components/CarouselTariffsCard/descriptionSize.js +4 -0
- package/dist/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
- package/dist/components/CarouselTariffsCard/descriptionSize.mobile.d.ts +1 -0
- package/dist/components/CarouselTariffsCard/descriptionSize.mobile.js +4 -0
- package/dist/components/CarouselTariffsCard/descriptionSize.mobile.js.map +1 -0
- package/dist/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
- package/dist/components/CarouselTariffsCard/getPaddingStyle.js +5 -0
- package/dist/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
- package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.d.ts +1 -0
- package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.js +5 -0
- package/dist/components/CarouselTariffsCard/getPaddingStyle.mobile.js.map +1 -0
- package/dist/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
- package/dist/components/CarouselTariffsCard/renderCardInfo.js +12 -0
- package/dist/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
- package/dist/components/Headline/Headline.js +2 -1
- package/dist/components/Headline/Headline.js.map +1 -1
- package/dist/components/Headline/headlineVersionStyles.d.ts +1 -1
- package/dist/components/Headline/headlineVersionStyles.js +6 -6
- package/dist/components/Headline/headlineVersionStyles.js.map +1 -1
- package/dist/hooks/useForm.js +2 -2
- package/dist/hooks/useForm.js.map +1 -1
- package/dist/ui-kit/Checkbox/Checkbox.js +4 -1
- package/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
- package/dist/ui-kit/InputRange/InputRange.js +22 -16
- package/dist/ui-kit/InputRange/InputRange.js.map +1 -1
- package/dist/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/dist/ui-kit/InputRange/parseDecimal.d.ts +1 -0
- package/dist/ui-kit/InputRange/parseDecimal.js +9 -0
- package/dist/ui-kit/InputRange/parseDecimal.js.map +1 -0
- package/dist/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
- package/dist/ui-kit/InputRange/renderRangeWithTicks.js +17 -0
- package/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
- package/dist/utils/getSanitizedValue.js +1 -1
- package/dist/utils/getSanitizedValue.js.map +1 -1
- package/dist/wlc.json +1 -2
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.js +1 -1
- package/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/lib/components/Blocks.mobile.js +4 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/Calculator/BonusCalculatorForm.js +16 -18
- package/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
- package/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/Calculator.js +4 -4
- package/lib/components/Calculator/Calculator.js.map +1 -1
- package/lib/components/Calculator/CreditCalculatorForm.js +27 -43
- package/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/DepositCalculatorForm.js +31 -34
- package/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/lib/components/Calculator/Rate.d.ts +1 -0
- package/lib/components/Calculator/Rate.js +1 -1
- package/lib/components/Calculator/Rate.js.map +1 -1
- package/lib/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
- package/lib/components/Calculator/renderBinaryRadioButtonGroup.js +5 -0
- package/lib/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
- package/lib/components/Calculator/renderDaysInput.d.ts +2 -7
- package/lib/components/Calculator/renderDaysInput.js +2 -9
- package/lib/components/Calculator/renderDaysInput.js.map +1 -1
- package/lib/components/Calculator/renderInterestPayment.d.ts +2 -9
- package/lib/components/Calculator/renderInterestPayment.js +8 -18
- package/lib/components/Calculator/renderInterestPayment.js.map +1 -1
- package/lib/components/Calculator/renderMonthsInput.d.ts +3 -5
- package/lib/components/Calculator/renderMonthsInput.js +2 -10
- package/lib/components/Calculator/renderMonthsInput.js.map +1 -1
- package/lib/components/Calculator/renderPaymentType.d.ts +2 -11
- package/lib/components/Calculator/renderPaymentType.js +8 -18
- package/lib/components/Calculator/renderPaymentType.js.map +1 -1
- package/lib/components/Calculator/renderRegistrationType.d.ts +2 -9
- package/lib/components/Calculator/renderRegistrationType.js +8 -18
- package/lib/components/Calculator/renderRegistrationType.js.map +1 -1
- package/lib/components/Calculator/renderWantedSumInput.d.ts +3 -7
- package/lib/components/Calculator/renderWantedSumInput.js +4 -6
- package/lib/components/Calculator/renderWantedSumInput.js.map +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js +1 -1
- package/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/lib/components/Carousel/Carousel.fixture.mobile.d.ts +11 -0
- package/lib/components/Carousel/Carousel.js +2 -2
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/itemsGap.d.ts +1 -0
- package/lib/components/Carousel/itemsGap.js +2 -0
- package/lib/components/Carousel/itemsGap.js.map +1 -0
- package/lib/components/Carousel/itemsGap.mobile.d.ts +1 -0
- package/lib/components/Carousel/itemsGap.mobile.js +2 -0
- package/lib/components/Carousel/itemsGap.mobile.js.map +1 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.fixture.mobile.d.ts +9 -0
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +5 -9
- package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/lib/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
- package/lib/components/CarouselTariffsCard/descriptionSize.js +2 -0
- package/lib/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
- package/lib/components/CarouselTariffsCard/descriptionSize.mobile.d.ts +1 -0
- package/lib/components/CarouselTariffsCard/descriptionSize.mobile.js +2 -0
- package/lib/components/CarouselTariffsCard/descriptionSize.mobile.js.map +1 -0
- package/lib/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
- package/lib/components/CarouselTariffsCard/getPaddingStyle.js +2 -0
- package/lib/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
- package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.d.ts +1 -0
- package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.js +2 -0
- package/lib/components/CarouselTariffsCard/getPaddingStyle.mobile.js.map +1 -0
- package/lib/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
- package/lib/components/CarouselTariffsCard/renderCardInfo.js +9 -0
- package/lib/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
- package/lib/components/Headline/Headline.fixture.mobile.d.ts +22 -0
- package/lib/components/Headline/Headline.js +2 -1
- package/lib/components/Headline/Headline.js.map +1 -1
- package/lib/components/Headline/headlineVersionStyles.d.ts +1 -1
- package/lib/components/Headline/headlineVersionStyles.js +6 -6
- package/lib/components/Headline/headlineVersionStyles.js.map +1 -1
- package/lib/hooks/useForm.js +2 -2
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/ui-kit/Checkbox/Checkbox.js +4 -1
- package/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
- package/lib/ui-kit/InputRange/InputRange.js +22 -16
- package/lib/ui-kit/InputRange/InputRange.js.map +1 -1
- package/lib/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/lib/ui-kit/InputRange/parseDecimal.d.ts +1 -0
- package/lib/ui-kit/InputRange/parseDecimal.js +6 -0
- package/lib/ui-kit/InputRange/parseDecimal.js.map +1 -0
- package/lib/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
- package/lib/ui-kit/InputRange/renderRangeWithTicks.js +14 -0
- package/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
- package/lib/utils/getSanitizedValue.js +1 -1
- package/lib/utils/getSanitizedValue.js.map +1 -1
- package/lib/wlc.json +1 -2
- package/mobile/bundle/bundle.umd.js +363 -265
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Calculator/Rate.d.ts +1 -0
- package/mobile/bundle/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
- package/mobile/bundle/components/Calculator/renderDaysInput.d.ts +2 -7
- package/mobile/bundle/components/Calculator/renderInterestPayment.d.ts +2 -9
- package/mobile/bundle/components/Calculator/renderMonthsInput.d.ts +3 -5
- package/mobile/bundle/components/Calculator/renderPaymentType.d.ts +2 -11
- package/mobile/bundle/components/Calculator/renderRegistrationType.d.ts +2 -9
- package/mobile/bundle/components/Calculator/renderWantedSumInput.d.ts +3 -7
- package/mobile/bundle/components/Carousel/itemsGap.d.ts +1 -0
- package/mobile/bundle/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
- package/mobile/bundle/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
- package/mobile/bundle/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
- package/mobile/bundle/components/Headline/headlineVersionStyles.d.ts +1 -1
- package/mobile/bundle/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/mobile/bundle/ui-kit/InputRange/parseDecimal.d.ts +1 -0
- package/mobile/bundle/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js +1 -1
- package/mobile/dist/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/dist/components/Blocks.js +4 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/Calculator/BonusCalculatorForm.js +16 -18
- package/mobile/dist/components/Calculator/BonusCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
- package/mobile/dist/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/Calculator.js +4 -4
- package/mobile/dist/components/Calculator/Calculator.js.map +1 -1
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js +27 -43
- package/mobile/dist/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js +30 -33
- package/mobile/dist/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/dist/components/Calculator/Rate.d.ts +1 -0
- package/mobile/dist/components/Calculator/Rate.js +1 -1
- package/mobile/dist/components/Calculator/Rate.js.map +1 -1
- package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
- package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.js +8 -0
- package/mobile/dist/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
- package/mobile/dist/components/Calculator/renderDaysInput.d.ts +2 -7
- package/mobile/dist/components/Calculator/renderDaysInput.js +2 -9
- package/mobile/dist/components/Calculator/renderDaysInput.js.map +1 -1
- package/mobile/dist/components/Calculator/renderInterestPayment.d.ts +2 -9
- package/mobile/dist/components/Calculator/renderInterestPayment.js +8 -18
- package/mobile/dist/components/Calculator/renderInterestPayment.js.map +1 -1
- package/mobile/dist/components/Calculator/renderMonthsInput.d.ts +3 -5
- package/mobile/dist/components/Calculator/renderMonthsInput.js +2 -10
- package/mobile/dist/components/Calculator/renderMonthsInput.js.map +1 -1
- package/mobile/dist/components/Calculator/renderPaymentType.d.ts +2 -11
- package/mobile/dist/components/Calculator/renderPaymentType.js +9 -19
- package/mobile/dist/components/Calculator/renderPaymentType.js.map +1 -1
- package/mobile/dist/components/Calculator/renderRegistrationType.d.ts +2 -9
- package/mobile/dist/components/Calculator/renderRegistrationType.js +8 -18
- package/mobile/dist/components/Calculator/renderRegistrationType.js.map +1 -1
- package/mobile/dist/components/Calculator/renderWantedSumInput.d.ts +3 -7
- package/mobile/dist/components/Calculator/renderWantedSumInput.js +4 -6
- package/mobile/dist/components/Calculator/renderWantedSumInput.js.map +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js +1 -1
- package/mobile/dist/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/dist/components/Carousel/Carousel.js +3 -3
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/Carousel/itemsGap.d.ts +1 -0
- package/mobile/dist/components/Carousel/itemsGap.js +4 -0
- package/mobile/dist/components/Carousel/itemsGap.js.map +1 -0
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +6 -10
- package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/dist/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
- package/mobile/dist/components/CarouselTariffsCard/descriptionSize.js +4 -0
- package/mobile/dist/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
- package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
- package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.js +5 -0
- package/mobile/dist/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
- package/mobile/dist/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
- package/mobile/dist/components/CarouselTariffsCard/renderCardInfo.js +12 -0
- package/mobile/dist/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
- package/mobile/dist/components/Headline/Headline.js +2 -1
- package/mobile/dist/components/Headline/Headline.js.map +1 -1
- package/mobile/dist/components/Headline/headlineVersionStyles.d.ts +1 -1
- package/mobile/dist/components/Headline/headlineVersionStyles.js +6 -6
- package/mobile/dist/components/Headline/headlineVersionStyles.js.map +1 -1
- package/mobile/dist/hooks/useForm.js +2 -2
- package/mobile/dist/hooks/useForm.js.map +1 -1
- package/mobile/dist/ui-kit/Checkbox/Checkbox.js +4 -1
- package/mobile/dist/ui-kit/Checkbox/Checkbox.js.map +1 -1
- package/mobile/dist/ui-kit/InputRange/InputRange.js +22 -16
- package/mobile/dist/ui-kit/InputRange/InputRange.js.map +1 -1
- package/mobile/dist/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/mobile/dist/ui-kit/InputRange/parseDecimal.d.ts +1 -0
- package/mobile/dist/ui-kit/InputRange/parseDecimal.js +9 -0
- package/mobile/dist/ui-kit/InputRange/parseDecimal.js.map +1 -0
- package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
- package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js +17 -0
- package/mobile/dist/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
- package/mobile/dist/utils/getSanitizedValue.js +1 -1
- package/mobile/dist/utils/getSanitizedValue.js.map +1 -1
- package/mobile/dist/wlc.json +1 -2
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationForm.js.map +1 -1
- package/mobile/lib/components/Blocks.js +4 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/Calculator/BonusCalculatorForm.js +16 -18
- package/mobile/lib/components/Calculator/BonusCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js +24 -30
- package/mobile/lib/components/Calculator/BusinessDepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/Calculator.js +4 -4
- package/mobile/lib/components/Calculator/Calculator.js.map +1 -1
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js +27 -43
- package/mobile/lib/components/Calculator/CreditCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js +31 -34
- package/mobile/lib/components/Calculator/DepositCalculatorForm.js.map +1 -1
- package/mobile/lib/components/Calculator/Rate.d.ts +1 -0
- package/mobile/lib/components/Calculator/Rate.js +1 -1
- package/mobile/lib/components/Calculator/Rate.js.map +1 -1
- package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.d.ts +11 -0
- package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.js +5 -0
- package/mobile/lib/components/Calculator/renderBinaryRadioButtonGroup.js.map +1 -0
- package/mobile/lib/components/Calculator/renderDaysInput.d.ts +2 -7
- package/mobile/lib/components/Calculator/renderDaysInput.js +2 -9
- package/mobile/lib/components/Calculator/renderDaysInput.js.map +1 -1
- package/mobile/lib/components/Calculator/renderInterestPayment.d.ts +2 -9
- package/mobile/lib/components/Calculator/renderInterestPayment.js +8 -18
- package/mobile/lib/components/Calculator/renderInterestPayment.js.map +1 -1
- package/mobile/lib/components/Calculator/renderMonthsInput.d.ts +3 -5
- package/mobile/lib/components/Calculator/renderMonthsInput.js +2 -10
- package/mobile/lib/components/Calculator/renderMonthsInput.js.map +1 -1
- package/mobile/lib/components/Calculator/renderPaymentType.d.ts +2 -11
- package/mobile/lib/components/Calculator/renderPaymentType.js +8 -18
- package/mobile/lib/components/Calculator/renderPaymentType.js.map +1 -1
- package/mobile/lib/components/Calculator/renderRegistrationType.d.ts +2 -9
- package/mobile/lib/components/Calculator/renderRegistrationType.js +8 -18
- package/mobile/lib/components/Calculator/renderRegistrationType.js.map +1 -1
- package/mobile/lib/components/Calculator/renderWantedSumInput.d.ts +3 -7
- package/mobile/lib/components/Calculator/renderWantedSumInput.js +4 -6
- package/mobile/lib/components/Calculator/renderWantedSumInput.js.map +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js +1 -1
- package/mobile/lib/components/Calculator/useDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/Carousel/Carousel.js +2 -2
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/Carousel/itemsGap.d.ts +1 -0
- package/mobile/lib/components/Carousel/itemsGap.js +2 -0
- package/mobile/lib/components/Carousel/itemsGap.js.map +1 -0
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +5 -9
- package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
- package/mobile/lib/components/CarouselTariffsCard/descriptionSize.d.ts +1 -0
- package/mobile/lib/components/CarouselTariffsCard/descriptionSize.js +2 -0
- package/mobile/lib/components/CarouselTariffsCard/descriptionSize.js.map +1 -0
- package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.d.ts +1 -0
- package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.js +2 -0
- package/mobile/lib/components/CarouselTariffsCard/getPaddingStyle.js.map +1 -0
- package/mobile/lib/components/CarouselTariffsCard/renderCardInfo.d.ts +3 -0
- package/mobile/lib/components/CarouselTariffsCard/renderCardInfo.js +9 -0
- package/mobile/lib/components/CarouselTariffsCard/renderCardInfo.js.map +1 -0
- package/mobile/lib/components/Headline/Headline.js +2 -1
- package/mobile/lib/components/Headline/Headline.js.map +1 -1
- package/mobile/lib/components/Headline/headlineVersionStyles.d.ts +1 -1
- package/mobile/lib/components/Headline/headlineVersionStyles.js +6 -6
- package/mobile/lib/components/Headline/headlineVersionStyles.js.map +1 -1
- package/mobile/lib/hooks/useForm.js +2 -2
- package/mobile/lib/hooks/useForm.js.map +1 -1
- package/mobile/lib/ui-kit/Checkbox/Checkbox.js +4 -1
- package/mobile/lib/ui-kit/Checkbox/Checkbox.js.map +1 -1
- package/mobile/lib/ui-kit/InputRange/InputRange.js +22 -16
- package/mobile/lib/ui-kit/InputRange/InputRange.js.map +1 -1
- package/mobile/lib/ui-kit/InputRange/InputRangeProps.d.ts +1 -0
- package/mobile/lib/ui-kit/InputRange/parseDecimal.d.ts +1 -0
- package/mobile/lib/ui-kit/InputRange/parseDecimal.js +6 -0
- package/mobile/lib/ui-kit/InputRange/parseDecimal.js.map +1 -0
- package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.d.ts +12 -0
- package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js +14 -0
- package/mobile/lib/ui-kit/InputRange/renderRangeWithTicks.js.map +1 -0
- package/mobile/lib/utils/getSanitizedValue.js +1 -1
- package/mobile/lib/utils/getSanitizedValue.js.map +1 -1
- package/mobile/lib/wlc.json +1 -2
- package/mobile/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
- package/mobile/src/components/Blocks.ts +4 -0
- package/mobile/src/components/Calculator/BonusCalculatorForm.tsx +29 -33
- package/mobile/src/components/Calculator/BusinessDepositCalculatorForm.tsx +37 -57
- package/mobile/src/components/Calculator/Calculator.tsx +11 -5
- package/mobile/src/components/Calculator/CreditCalculatorForm.tsx +52 -87
- package/mobile/src/components/Calculator/DepositCalculatorForm.tsx +38 -66
- package/mobile/src/components/Calculator/Rate.tsx +14 -14
- package/mobile/src/components/Calculator/renderBinaryRadioButtonGroup.tsx +35 -0
- package/mobile/src/components/Calculator/renderDaysInput.tsx +10 -31
- package/mobile/src/components/Calculator/renderInterestPayment.tsx +13 -52
- package/mobile/src/components/Calculator/renderMonthsInput.tsx +17 -39
- package/mobile/src/components/Calculator/renderPaymentType.tsx +13 -49
- package/mobile/src/components/Calculator/renderRegistrationType.tsx +13 -51
- package/mobile/src/components/Calculator/renderWantedSumInput.tsx +10 -27
- package/mobile/src/components/Calculator/useDepositCalculatorParams.ts +1 -1
- package/mobile/src/components/Carousel/Carousel.tsx +2 -3
- package/mobile/src/components/Carousel/itemsGap.ts +1 -0
- package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +7 -31
- package/mobile/src/components/CarouselTariffsCard/descriptionSize.tsx +1 -0
- package/mobile/src/components/CarouselTariffsCard/getPaddingStyle.tsx +2 -0
- package/mobile/src/components/CarouselTariffsCard/renderCardInfo.tsx +31 -0
- package/mobile/src/components/Headline/Headline.tsx +10 -5
- package/mobile/src/components/Headline/headlineVersionStyles.ts +7 -7
- package/mobile/src/hooks/useForm.ts +17 -14
- package/mobile/src/ui-kit/Checkbox/Checkbox.tsx +5 -1
- package/mobile/src/ui-kit/InputRange/InputRange.tsx +56 -43
- package/mobile/src/ui-kit/InputRange/InputRangeProps.ts +1 -0
- package/mobile/src/ui-kit/InputRange/parseDecimal.ts +6 -0
- package/mobile/src/ui-kit/InputRange/renderRangeWithTicks.tsx +62 -0
- package/mobile/src/utils/getSanitizedValue.ts +1 -1
- package/mobile/src/wlc.json +1 -2
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationForm.tsx +1 -1
- package/src/components/Blocks.mobile.ts +4 -0
- package/src/components/Calculator/BonusCalculatorForm.tsx +29 -33
- package/src/components/Calculator/BusinessDepositCalculatorForm.tsx +37 -57
- package/src/components/Calculator/Calculator.tsx +11 -5
- package/src/components/Calculator/CreditCalculatorForm.tsx +52 -87
- package/src/components/Calculator/DepositCalculatorForm.tsx +38 -66
- package/src/components/Calculator/Rate.tsx +14 -14
- package/src/components/Calculator/renderBinaryRadioButtonGroup.tsx +35 -0
- package/src/components/Calculator/renderDaysInput.tsx +10 -31
- package/src/components/Calculator/renderInterestPayment.tsx +13 -52
- package/src/components/Calculator/renderMonthsInput.tsx +17 -39
- package/src/components/Calculator/renderPaymentType.tsx +13 -49
- package/src/components/Calculator/renderRegistrationType.tsx +13 -51
- package/src/components/Calculator/renderWantedSumInput.tsx +10 -27
- package/src/components/Calculator/useDepositCalculatorParams.ts +1 -1
- package/src/components/Carousel/Carousel.fixture.mobile.tsx +93 -0
- package/src/components/Carousel/Carousel.tsx +2 -3
- package/src/components/Carousel/itemsGap.mobile.ts +1 -0
- package/src/components/Carousel/itemsGap.ts +1 -0
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.fixture.mobile.tsx +74 -0
- package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +7 -31
- package/src/components/CarouselTariffsCard/descriptionSize.mobile.tsx +1 -0
- package/src/components/CarouselTariffsCard/descriptionSize.tsx +1 -0
- package/src/components/CarouselTariffsCard/getPaddingStyle.mobile.tsx +2 -0
- package/src/components/CarouselTariffsCard/getPaddingStyle.tsx +2 -0
- package/src/components/CarouselTariffsCard/renderCardInfo.tsx +31 -0
- package/src/components/Headline/Headline.fixture.mobile.tsx +95 -0
- package/src/components/Headline/Headline.tsx +10 -5
- package/src/components/Headline/headlineVersionStyles.ts +7 -7
- package/src/hooks/useForm.ts +17 -14
- package/src/ui-kit/Checkbox/Checkbox.tsx +5 -1
- package/src/ui-kit/InputRange/InputRange.tsx +56 -43
- package/src/ui-kit/InputRange/InputRangeProps.ts +1 -0
- package/src/ui-kit/InputRange/parseDecimal.ts +6 -0
- package/src/ui-kit/InputRange/renderRangeWithTicks.tsx +62 -0
- package/src/utils/getSanitizedValue.ts +1 -1
- package/src/wlc.json +1 -2
- package/bundle/ui-kit/InputListRange/InputListRange.d.ts +0 -2
- package/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
- package/dist/ui-kit/InputListRange/InputListRange.d.ts +0 -2
- package/dist/ui-kit/InputListRange/InputListRange.js +0 -41
- package/dist/ui-kit/InputListRange/InputListRange.js.map +0 -1
- package/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
- package/dist/ui-kit/InputListRange/InputListRangeProps.js +0 -2
- package/dist/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
- package/lib/ui-kit/InputListRange/InputListRange.d.ts +0 -2
- package/lib/ui-kit/InputListRange/InputListRange.js +0 -39
- package/lib/ui-kit/InputListRange/InputListRange.js.map +0 -1
- package/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
- package/lib/ui-kit/InputListRange/InputListRangeProps.js +0 -2
- package/lib/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
- package/mobile/bundle/ui-kit/InputListRange/InputListRange.d.ts +0 -2
- package/mobile/bundle/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
- package/mobile/dist/ui-kit/InputListRange/InputListRange.d.ts +0 -2
- package/mobile/dist/ui-kit/InputListRange/InputListRange.js +0 -41
- package/mobile/dist/ui-kit/InputListRange/InputListRange.js.map +0 -1
- package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
- package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js +0 -2
- package/mobile/dist/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
- package/mobile/lib/ui-kit/InputListRange/InputListRange.d.ts +0 -2
- package/mobile/lib/ui-kit/InputListRange/InputListRange.js +0 -39
- package/mobile/lib/ui-kit/InputListRange/InputListRange.js.map +0 -1
- package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.d.ts +0 -10
- package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js +0 -2
- package/mobile/lib/ui-kit/InputListRange/InputListRangeProps.js.map +0 -1
- package/mobile/src/ui-kit/InputListRange/InputListRange.tsx +0 -99
- package/mobile/src/ui-kit/InputListRange/InputListRangeProps.ts +0 -11
- package/src/ui-kit/InputListRange/InputListRange.tsx +0 -99
- package/src/ui-kit/InputListRange/InputListRangeProps.ts +0 -11
package/bundle/bundle.umd.js
CHANGED
|
@@ -363,7 +363,7 @@
|
|
|
363
363
|
const [isDirtyForm, setDirtyForm] = useState(false);
|
|
364
364
|
const [dirtyFieldsMap, setDirtyFieldsMap] = useState({});
|
|
365
365
|
const handlersMap = useRef({});
|
|
366
|
-
const field = (fieldName) => {
|
|
366
|
+
const field = useCallback((fieldName) => {
|
|
367
367
|
if (!handlersMap.current) {
|
|
368
368
|
handlersMap.current = {};
|
|
369
369
|
}
|
|
@@ -376,7 +376,7 @@
|
|
|
376
376
|
isDirty: isDirtyForm || dirtyFieldsMap[fieldName],
|
|
377
377
|
onChange: handlersMap.current[fieldName],
|
|
378
378
|
};
|
|
379
|
-
};
|
|
379
|
+
}, [formState, isDirtyForm, dirtyFieldsMap]);
|
|
380
380
|
const reset = useCallback(() => {
|
|
381
381
|
setFormState(initialState);
|
|
382
382
|
setDirtyForm(false);
|
|
@@ -904,26 +904,44 @@
|
|
|
904
904
|
|
|
905
905
|
const clamp = (value, min, max) => Math.max(min, Math.min(value, max));
|
|
906
906
|
|
|
907
|
-
|
|
907
|
+
function parseDecimal(value) {
|
|
908
|
+
const rawValue = (value || '').replace(/\D/g, '');
|
|
909
|
+
const unsafeDecimal = parseInt(rawValue, 10);
|
|
910
|
+
return Number.isNaN(unsafeDecimal) ? 0 : unsafeDecimal;
|
|
911
|
+
}
|
|
908
912
|
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
const handleChange = (e) => {
|
|
912
|
-
if (!onChange) {
|
|
913
|
-
return;
|
|
914
|
-
}
|
|
915
|
-
onChange(clamp(Number(getSanitizedValue(e.target.value)), min, max));
|
|
916
|
-
};
|
|
913
|
+
function renderRangeWithTicks({ list = [], min, max, step, value = list[0] || min, disabled, onChange, }) {
|
|
914
|
+
const rangeValue = list.length ? list.indexOf(value) : value;
|
|
917
915
|
const inputStyle = {
|
|
918
|
-
backgroundSize: `${(((
|
|
916
|
+
backgroundSize: `${(((rangeValue - min) * 100) / (max - min)).toFixed(2)}% 100%`,
|
|
919
917
|
};
|
|
920
|
-
return (jsxs("div", {
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
918
|
+
return (jsxs("div", { children: [list.length ? (jsx("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-4", children: list.map((_, i) => (jsx("div", { className: `w-2 h-2 rounded-full ${rangeValue <= i || disabled ? 'bg-gray' : 'bg-primary-main'}` }, String(i)))) })) : null, jsx("div", { className: "absolute inset-x-0 -bottom-1 px-4 leading-[18px]", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", style: inputStyle, type: "range", min: min, max: max, step: step, value: rangeValue, disabled: disabled, onInput: ((e) => {
|
|
919
|
+
const rawValue = parseDecimal(e.target?.value);
|
|
920
|
+
const newValue = list.length ? list[rawValue] : rawValue;
|
|
921
|
+
onChange && onChange(newValue || 0);
|
|
922
|
+
}) }) })] }));
|
|
925
923
|
}
|
|
926
924
|
|
|
925
|
+
const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
|
|
926
|
+
const DEFAULT_MIN = 1;
|
|
927
|
+
const DEFAULT_MAX = 100;
|
|
928
|
+
const InputRange = JSX(({ className, title, items = [], list = [], min = list.length ? 0 : DEFAULT_MIN, max = list.length ? list.length - 1 : DEFAULT_MAX, step = 1, value = list[0] || min, disabled = false, onChange, }) => {
|
|
929
|
+
const [isFocused, setFocused] = useState(false);
|
|
930
|
+
const handleChange = useCallback((e) => {
|
|
931
|
+
onChange && onChange(parseDecimal(e.target?.value));
|
|
932
|
+
}, [onChange]);
|
|
933
|
+
const handleFocus = useCallback(() => {
|
|
934
|
+
setFocused(true);
|
|
935
|
+
}, []);
|
|
936
|
+
const handleBlur = useCallback(() => {
|
|
937
|
+
setFocused(false);
|
|
938
|
+
onChange && onChange(list.length ? closestValue(list)(value) : clamp(value || 0, min, max));
|
|
939
|
+
}, [onChange, value]);
|
|
940
|
+
return (jsxs("div", { className: className, children: [jsxs("label", { className: "block relative", children: [title ? (jsx(Text, { size: "text-m", font: "font-light", color: "text-primary-text", children: title })) : null, jsx("input", { className: style('m-0 mt-2 font-sans text-h3 w-full h-14', 'border border-solid border-gray rounded-md outline-none', 'p-0 pl-4 box-border', 'text-primary-text hover:border-primary-hover focus:border-primary-text', DISABLED_INPUT_CLASSES), value: isFocused ? value : addSpacesBetweenNumbers(value), disabled: disabled, onInput: handleChange, onFocus: handleFocus, onBlur: handleBlur }), renderRangeWithTicks({ list, min, max, step, disabled, value, onChange })] }), renderRangeCaption(items)] }));
|
|
941
|
+
});
|
|
942
|
+
const closestValue = (list) => (_) => list.reduce((prev, curr) => (Math.abs(curr - _) < Math.abs(prev - _) ? curr : prev));
|
|
943
|
+
const renderRangeCaption = (items) => (jsx("div", { className: "flex justify-between my-2", children: items.map((item, i) => (jsx(Text, { size: "text-s-light", color: "text-secondary-text", children: item }, String(i)))) }));
|
|
944
|
+
|
|
927
945
|
const renderCreditParameters = (field) => (jsxs("div", { className: "flex justify-between gap-5 mb-7", children: [jsxs("div", { className: "w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m-light", children: "\u0421\u0443\u043C\u043C\u0430 \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u20BD" }) }), jsx(InputRange, { items: ITEMS_CREDIT_AMOUNT, min: MIN_CREDIT_AMOUNT, max: MAX_CREDIT_AMOUNT, ...field('amount') })] }), jsxs("div", { className: "w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m-light", children: "\u0421\u0440\u043E\u043A \u043A\u0440\u0435\u0434\u0438\u0442\u0430, \u043C\u0435\u0441\u044F\u0446\u0435\u0432" }) }), jsx(InputRange, { items: ITEMS_CREDIT_TERM, min: MIN_CREDIT_TERM, max: MAX_CREDIT_TERM, ...field('term') })] })] }));
|
|
928
946
|
|
|
929
947
|
const renderRegionDepartment = ({ regions, branches, field }) => (jsxs("div", { className: "flex justify-between gap-5 mb-7", children: [jsx("div", { className: "w-1/2", children: jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }) }), jsx("div", { className: "w-1/2", children: jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: branches.map(({ branchCode = '', address = '' }) => ({
|
|
@@ -1043,9 +1061,12 @@
|
|
|
1043
1061
|
];
|
|
1044
1062
|
const Checkbox = JSX(({ className, value, text, disabled, isRadio, onChange }) => {
|
|
1045
1063
|
const handleChange = useCallback((e) => {
|
|
1064
|
+
if (disabled) {
|
|
1065
|
+
return;
|
|
1066
|
+
}
|
|
1046
1067
|
e.preventDefault();
|
|
1047
1068
|
onChange && onChange(!value);
|
|
1048
|
-
}, [onChange, value]);
|
|
1069
|
+
}, [onChange, disabled, value]);
|
|
1049
1070
|
const icon = isRadio ? (jsx("div", { className: "absolute left-1 w-3 h-3 rounded-full bg-primary-main" })) : (jsx(SVG, { paths: CHECK_PATHS, className: "absolute left-1 ml-px block", width: "11", height: "9", fill: "white", viewBox: "0 0 11 9" }));
|
|
1050
1071
|
return (jsx("div", { className: className, children: jsxs("label", { className: "flex items-center relative cursor-pointer group/box", onClick: handleChange, children: [jsx("div", { className: style('appearance-none w-5 h-5 border-solid cursor-pointer m-0', isRadio ? 'rounded-full border-2' : checkboxStyle(value), value ? 'border-primary-main' : 'border-gray', disabled ? 'bg-main-disabled' : 'group-hover/box:border-primary-hover'), role: "checkbox", "aria-checked": Boolean(value), "aria-disabled": Boolean(disabled) }), value ? icon : null, text ? jsx("span", { className: "font-sans ml-3 text-l-light", children: text }) : null] }) }));
|
|
1051
1072
|
});
|
|
@@ -1114,7 +1135,7 @@
|
|
|
1114
1135
|
setResponseType(status);
|
|
1115
1136
|
return status;
|
|
1116
1137
|
}, []);
|
|
1117
|
-
return (jsx(BlockWrapper, { className: style('font-sans bg-white p-
|
|
1138
|
+
return (jsx(BlockWrapper, { className: style('font-sans bg-white p-default pb-9', className), ...rest, children: jsxs("div", { className: "container max-w-[978px]", children: [title ? jsx(Heading, { headingType: "h3", title: title, className: "text-center mb-8" }) : null, COMPONENTS_MAP[typeForm]({ button, link, onSubmit: handleSubmit }), responseType ? jsx(ResponseNotification, { responseType: responseType }) : null] }) }));
|
|
1118
1139
|
});
|
|
1119
1140
|
|
|
1120
1141
|
const BenefitsBlock = JSX(({ className = '', title, benefitList, ...rest }) => (jsxs(BlockWrapper, { className: `p-default flex flex-col items-center ${className}`, ...rest, children: [title ? (jsx(Heading, { headingType: "h3", as: "h2", className: "max-w-[47rem] text-center", title: title })) : null, benefitList?.length ? (jsx("div", { className: "flex flex-wrap w-full justify-center gap-x-20 mt-8", children: benefitList.map(renderStep$1) })) : null] })));
|
|
@@ -1146,34 +1167,34 @@
|
|
|
1146
1167
|
|
|
1147
1168
|
const headlineVersionStyles = {
|
|
1148
1169
|
XXL: {
|
|
1149
|
-
wrapper: 'gap-[18px]',
|
|
1150
1170
|
title: { headingType: 'h0', as: 'h1' },
|
|
1151
1171
|
descriptionSize: 'text-h5',
|
|
1172
|
+
descriptionStyle: 'mt-5',
|
|
1152
1173
|
},
|
|
1153
1174
|
XL: {
|
|
1154
|
-
wrapper: 'gap-4',
|
|
1155
1175
|
title: { headingType: 'h1', as: 'h1' },
|
|
1156
1176
|
descriptionSize: 'text-xl-light',
|
|
1177
|
+
descriptionStyle: 'mt-4',
|
|
1157
1178
|
},
|
|
1158
1179
|
L: {
|
|
1159
|
-
wrapper: 'gap-4',
|
|
1160
1180
|
title: { headingType: 'h2', as: 'h2' },
|
|
1161
1181
|
descriptionSize: 'text-xl-light',
|
|
1182
|
+
descriptionStyle: 'mt-4',
|
|
1162
1183
|
},
|
|
1163
1184
|
M: {
|
|
1164
|
-
wrapper: 'gap-3',
|
|
1165
1185
|
title: { headingType: 'h3', as: 'h3' },
|
|
1166
1186
|
descriptionSize: 'text-xl-light',
|
|
1187
|
+
descriptionStyle: 'mt-3',
|
|
1167
1188
|
},
|
|
1168
1189
|
S: {
|
|
1169
|
-
wrapper: 'gap-2',
|
|
1170
1190
|
title: { headingType: 'h4', as: 'h4' },
|
|
1171
1191
|
descriptionSize: 'text-xl-light',
|
|
1192
|
+
descriptionStyle: 'mt-2',
|
|
1172
1193
|
},
|
|
1173
1194
|
XS: {
|
|
1174
|
-
wrapper: 'gap-2',
|
|
1175
1195
|
title: { headingType: 'h5', as: 'h5' },
|
|
1176
1196
|
descriptionSize: 'text-l-light',
|
|
1197
|
+
descriptionStyle: 'mt-2',
|
|
1177
1198
|
},
|
|
1178
1199
|
};
|
|
1179
1200
|
// TODO Move to Gallery and rename
|
|
@@ -1191,7 +1212,8 @@
|
|
|
1191
1212
|
const Headline = JSX(({ className, title, description, headlineVersion = 'XL', align = 'text-center', as, isPadding = true, isTheme = false, version = '', ...rest }) => {
|
|
1192
1213
|
const versionStyle = headlineVersionStyles[headlineVersion];
|
|
1193
1214
|
const paddingStyle = isPadding ? 'p-default' : '';
|
|
1194
|
-
|
|
1215
|
+
const descriptionStyle = { marginTop: versionStyle.descriptionStyle };
|
|
1216
|
+
return (jsxs(BlockWrapper, { className: style(paddingStyle, className), version: version, isTheme: isTheme, ...rest, children: [title ? (jsx(Heading, { className: style('whitespace-pre-wrap', align), ...versionStyle?.title, as: as || versionStyle?.title.as, title: title })) : null, description ? (jsx(Paragraph, { size: versionStyle.descriptionSize, align: align, ...descriptionStyle, children: description })) : null] }));
|
|
1195
1217
|
});
|
|
1196
1218
|
|
|
1197
1219
|
const Bonus = JSX((props) => {
|
|
@@ -1347,18 +1369,17 @@
|
|
|
1347
1369
|
const DEPOSIT_CALC_DEFAULT_DIR = 'deposit-calculator-data';
|
|
1348
1370
|
const BUSINESS_DEPOSIT_CALC_DEFAULT_DIR = 'business-calculator-data';
|
|
1349
1371
|
|
|
1350
|
-
const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, rateBlockClassName }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsxs("div", { className: "relative", children: [jsxs("div", { className: "flex justify-start", children: [jsx("span", { className: style('
|
|
1372
|
+
const Rate = JSX(({ rate, title = 'Ставка', unit, depositeName, isShowDepositeName, rateBlockClassName, fractionDigits = 2, }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsxs("div", { className: "relative", children: [jsxs("div", { className: "flex justify-start gradient-color-text", children: [jsx("span", { className: style('font-mohave text-title-huge pr-6 -mt-4', rateBlockClassName), children: String(rate.toFixed(fractionDigits)).replace('.', ',') }), unit ? jsx("span", { className: "text-7xl", children: unit }) : null] }), depositeName && isShowDepositeName ? (jsx("div", { className: "absolute bottom-7 w-full text-center whitespace-nowrap", children: depositeName })) : null] })] })));
|
|
1351
1373
|
|
|
1352
1374
|
const renderFootnote = (text) => text ? (jsx(Paragraph, { size: "text-s-light", color: "text-secondary-text", children: text })) : null;
|
|
1353
1375
|
|
|
1354
1376
|
const DEFAULT_MONEY_STEP = 1000;
|
|
1355
|
-
function renderWantedSumInput(
|
|
1356
|
-
const { moneyValue, minSum, maxSum, step = DEFAULT_MONEY_STEP, isShowItems = true } = params;
|
|
1377
|
+
function renderWantedSumInput({ isShowItems = true, step = DEFAULT_MONEY_STEP, ...rest }) {
|
|
1357
1378
|
const items = [
|
|
1358
|
-
`От ${addSpacesBetweenNumbers(
|
|
1359
|
-
`До ${addSpacesBetweenNumbers(
|
|
1379
|
+
`От ${addSpacesBetweenNumbers(rest.min || 0)} ₽`,
|
|
1380
|
+
`До ${addSpacesBetweenNumbers(rest.max || 0)} ₽`,
|
|
1360
1381
|
];
|
|
1361
|
-
return
|
|
1382
|
+
return jsx(InputRange, { items: isShowItems ? items : [], step: step, ...rest });
|
|
1362
1383
|
}
|
|
1363
1384
|
|
|
1364
1385
|
const getBonus = (params, bonusTravelValue, bonusOtherValue) => {
|
|
@@ -1392,40 +1413,32 @@
|
|
|
1392
1413
|
};
|
|
1393
1414
|
|
|
1394
1415
|
const BonusCalculatorForm = JSX(({ className = '', sourceBookDir = '', buttons, footnote }) => {
|
|
1395
|
-
const [
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
const userInputParams = {
|
|
1400
|
-
travelExpenseValue,
|
|
1401
|
-
restExpenseValue,
|
|
1402
|
-
};
|
|
1416
|
+
const [userInputParams, { field }] = useForm({
|
|
1417
|
+
travelExpenseValue: DEFAULT_TRAVEL_MIN_SUM,
|
|
1418
|
+
restExpenseValue: DEFAULT_REST_MIN_SUM,
|
|
1419
|
+
});
|
|
1403
1420
|
const { minSumTravel, maxSumTravel, minSumOther, maxSumOther, monthBonus, yearBonus } = useBonusCalculatorParams(userInputParams, sourceBookDir);
|
|
1404
|
-
return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput(
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1421
|
+
return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput({
|
|
1422
|
+
title: 'Сумма покупок в категории путешествия, ₽',
|
|
1423
|
+
min: minSumTravel,
|
|
1424
|
+
max: maxSumTravel,
|
|
1408
1425
|
step: 500,
|
|
1409
1426
|
isShowItems: false,
|
|
1410
|
-
|
|
1427
|
+
...field('travelExpenseValue'),
|
|
1428
|
+
}), renderWantedSumInput({
|
|
1429
|
+
title: 'Сумма покупок в остальных категориях, ₽',
|
|
1411
1430
|
className: 'mt-7',
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
moneyValue: restExpenseValue,
|
|
1431
|
+
min: minSumOther,
|
|
1432
|
+
max: maxSumOther,
|
|
1415
1433
|
step: 500,
|
|
1416
1434
|
isShowItems: false,
|
|
1417
|
-
|
|
1435
|
+
...field('restExpenseValue'),
|
|
1436
|
+
})] }), jsx("div", { children: monthBonus >= 0 ? (jsx(Rate, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u043C\u0435\u0441\u044F\u0446", rate: monthBonus, rateBlockClassName: "tracking-[-14px]", fractionDigits: 0 })) : null }), jsxs("div", { className: "w-full max-w-[350px]", children: [yearBonus >= 0 ? jsx(CalculatorValueBlock, { title: "\u0411\u0430\u043B\u043B\u043E\u0432 \u0437\u0430 \u0433\u043E\u0434", value: yearBonus }) : null, renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
|
|
1418
1437
|
});
|
|
1419
1438
|
|
|
1420
1439
|
const STEP_DAYS = 1;
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
const daysText = (days) => {
|
|
1424
|
-
const text = Number(days) % 10 === 1 ? 'дня' : 'дней';
|
|
1425
|
-
return `${days} ${text}`;
|
|
1426
|
-
};
|
|
1427
|
-
return (jsx(InputRange, { className: "mt-7", title: title, items: [`От ${daysText(minDays)}`, `До ${daysText(maxDays)}`], min: minDays, max: maxDays, step: STEP_DAYS, value: clamp(daysValue, minDays, maxDays), onChange: callback }));
|
|
1428
|
-
}
|
|
1440
|
+
const renderDaysInput = (props) => (jsx(InputRange, { className: "mt-7", items: [`От ${daysText(props.min || 0)}`, `До ${daysText(props.max || 0)}`], step: STEP_DAYS, ...props }));
|
|
1441
|
+
const daysText = (days) => `${days} ${Number(days) % 10 === 1 ? 'дня' : 'дней'}`;
|
|
1429
1442
|
|
|
1430
1443
|
const orientationStyleMap = {
|
|
1431
1444
|
horizontal: 'gap-10',
|
|
@@ -1433,21 +1446,15 @@
|
|
|
1433
1446
|
};
|
|
1434
1447
|
const RadioButtonGroup = JSX(({ items, checkedItem, onChange: onChangeCheckedItem, orientation = 'horizontal' }) => (jsx("div", { className: `flex ${orientationStyleMap[orientation]}`, children: items?.map(({ id, text }) => (jsx(Checkbox, { isRadio: true, text: text, value: checkedItem === id, onChange: () => onChangeCheckedItem && onChangeCheckedItem(id) }, String(id)))) })));
|
|
1435
1448
|
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1438
|
-
const
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
text: 'Ежемесячно',
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
text: 'В конце срока',
|
|
1446
|
-
},
|
|
1447
|
-
];
|
|
1448
|
-
function renderInterestPayment({ isMonthlyInterestPayment, callback, title, orientation = 'horizontal', }) {
|
|
1449
|
-
return (jsxs("div", { children: [title ? (jsx("div", { className: "mb-3", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, jsx("div", { children: jsx(RadioButtonGroup, { orientation: orientation, items: depositTypeItems, checkedItem: isMonthlyInterestPayment ? EVERY_MONTH : AT_END_TERM, onChange: (text) => callback && callback(text === EVERY_MONTH) }) })] }));
|
|
1450
|
-
}
|
|
1449
|
+
const renderBinaryRadioButtonGroup = ({ items, title, orientation = 'horizontal', value, onChange, }) => (jsxs("div", { children: [title ? (jsx("div", { className: "mb-3", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: items, checkedItem: items[value ? 0 : 1].id, onChange: (_) => onChange && onChange(_ === items[0].id) })] }));
|
|
1450
|
+
|
|
1451
|
+
const renderInterestPayment = (props) => renderBinaryRadioButtonGroup({
|
|
1452
|
+
...props,
|
|
1453
|
+
items: [
|
|
1454
|
+
{ id: 'everyMonth', text: 'Ежемесячно' },
|
|
1455
|
+
{ id: 'atEndTerm', text: 'В конце срока' },
|
|
1456
|
+
],
|
|
1457
|
+
});
|
|
1451
1458
|
|
|
1452
1459
|
const UnknownRate = JSX(({ title = 'Ставка' }) => (jsxs("div", { children: [jsx(Text, { size: "text-l-light", color: "text-secondary-text", children: title }), jsx("div", { className: "mt-1 pt-1 pl-5 pb-1.5", children: jsx(Icon, { name: "PercentIcon", width: "90", height: "85" }) }), jsx("div", { className: "w-[250px] mt-3.5", children: jsxs(Paragraph, { size: "text-xl-light", color: "text-primary-text", children: ["\u041F\u0440\u043E\u0446\u0435\u043D\u0442\u043D\u0430\u044F \u0441\u0442\u0430\u0432\u043A\u0430 \u0434\u043B\u044F \u0441\u0440\u043E\u043A\u0430 ", jsx("strong", { children: "1-30 \u0434\u043D\u0435\u0439" }), " \u0443\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0449\u0435\u043D\u0438\u0438 \u0432 \u0411\u0430\u043D\u043A"] }) })] })));
|
|
1453
1460
|
|
|
@@ -1537,101 +1544,47 @@
|
|
|
1537
1544
|
};
|
|
1538
1545
|
|
|
1539
1546
|
const BusinessDepositCalculatorForm = JSX(({ className = '', sourceBookDir, buttons, footnote, bottomFootnote, isShowDepositeName }) => {
|
|
1540
|
-
const [
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
const [isSmallBusiness, toggleIsSmallBusiness] = useState(false);
|
|
1549
|
-
const handleIsSmallBusiness = useCallback((_) => toggleIsSmallBusiness(_), []);
|
|
1550
|
-
const [isMonthlyInterestPayment, toggleIsMonthlyInterestPayment] = useState(false);
|
|
1551
|
-
const handleIsMonthlyInterestPayment = useCallback((_) => toggleIsMonthlyInterestPayment(_), []);
|
|
1552
|
-
const userInputParams = {
|
|
1553
|
-
moneyValue,
|
|
1554
|
-
daysValue,
|
|
1555
|
-
isReplenished,
|
|
1556
|
-
isPartialWithdrawal,
|
|
1557
|
-
isSmallBusiness,
|
|
1558
|
-
isMonthlyInterestPayment,
|
|
1559
|
-
};
|
|
1547
|
+
const [userInputParams, { field }] = useForm({
|
|
1548
|
+
moneyValue: BUSINESS_DEFAULT_SUM,
|
|
1549
|
+
daysValue: BUSINESS_DEFAULT_DAYS,
|
|
1550
|
+
isReplenished: false,
|
|
1551
|
+
isPartialWithdrawal: false,
|
|
1552
|
+
isSmallBusiness: false,
|
|
1553
|
+
isMonthlyInterestPayment: false,
|
|
1554
|
+
});
|
|
1560
1555
|
const calculatorParams = useBusinessDepositCalculatorParams(userInputParams, sourceBookDir);
|
|
1561
1556
|
const { income, finalSum, rate, depositeName, isShowUnknownRate } = calculatorParams;
|
|
1562
|
-
return (jsxs("section", { className: className, children: [jsxs("div", { className: "flex justify-between", children: [jsxs("div", { className: "w-[486px]", children: [renderWantedSumInput(
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1557
|
+
return (jsxs("section", { className: className, children: [jsxs("div", { className: "flex justify-between", children: [jsxs("div", { className: "w-[486px]", children: [renderWantedSumInput({
|
|
1558
|
+
title: 'Сумма вклада, ₽',
|
|
1559
|
+
min: calculatorParams.minSum,
|
|
1560
|
+
max: calculatorParams.maxSum,
|
|
1561
|
+
...field('moneyValue'),
|
|
1562
|
+
value: calculatorParams.moneyValue,
|
|
1563
|
+
}), renderDaysInput({
|
|
1564
|
+
title: 'Срок вклада, дни',
|
|
1565
|
+
min: calculatorParams.minDays,
|
|
1566
|
+
max: calculatorParams.maxDays,
|
|
1567
|
+
...field('daysValue'),
|
|
1568
|
+
value: calculatorParams.daysValue,
|
|
1569
|
+
}), jsxs("div", { className: "mt-7 flex justify-between", children: [renderBusinessDepositParamsForm(calculatorParams, field), renderInterestPayment({
|
|
1570
1570
|
title: 'Выплата процентов',
|
|
1571
1571
|
orientation: 'vertical',
|
|
1572
|
+
...field('isMonthlyInterestPayment'),
|
|
1572
1573
|
})] })] }), isShowUnknownRate ? (jsx(UnknownRate, {})) : (jsx(Rate, { rate: rate, depositeName: depositeName, isShowDepositeName: isShowDepositeName, rateBlockClassName: "tracking-[-25px]", unit: "%" })), jsxs("div", { className: "w-full max-w-[350px]", children: [jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u043F\u043E \u0432\u043A\u043B\u0430\u0434\u0443", value: income, postfix: "\u20BD", prefix: "+" }), jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finalSum, postfix: "\u20BD" }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), jsx("div", { className: "mt-7", children: renderFootnote(footnote) })] })] }), jsx("div", { className: "mt-5", children: renderFootnote(bottomFootnote) })] }));
|
|
1573
1574
|
});
|
|
1574
|
-
const renderBusinessDepositParamsForm = (
|
|
1575
|
-
|
|
1576
|
-
const DISABLED_INPUT_CLASSES = 'disabled:border-gray disabled:bg-main-divider';
|
|
1577
|
-
const InputListRange = JSX(({ className, title, items = [], list = [], value = list[0], disabled = false, onChange }) => {
|
|
1578
|
-
const min = 0;
|
|
1579
|
-
const max = list.length - 1;
|
|
1580
|
-
const step = 1;
|
|
1581
|
-
const handleTextChange = (e) => {
|
|
1582
|
-
if (!onChange) {
|
|
1583
|
-
return;
|
|
1584
|
-
}
|
|
1585
|
-
const newValue = parseInt(e.target.value);
|
|
1586
|
-
const closetValue = list.reduce(function (prev, curr) {
|
|
1587
|
-
return Math.abs(curr - newValue) < Math.abs(prev - newValue) ? curr : prev;
|
|
1588
|
-
});
|
|
1589
|
-
onChange(Number(getSanitizedValue(closetValue.toString())));
|
|
1590
|
-
};
|
|
1591
|
-
const handleRangeChange = (e) => {
|
|
1592
|
-
if (!onChange) {
|
|
1593
|
-
return;
|
|
1594
|
-
}
|
|
1595
|
-
const val = list.at(clamp(parseInt(e.target.value), min, max)) || 0;
|
|
1596
|
-
onChange(Number(getSanitizedValue(val.toString())));
|
|
1597
|
-
};
|
|
1598
|
-
const valueIndex = list.findIndex((item) => item === value) || 0;
|
|
1599
|
-
const inputStyle = {
|
|
1600
|
-
backgroundSize: `${(((valueIndex - min) * 100) / (max - min)).toFixed(2)}% 100%`,
|
|
1601
|
-
};
|
|
1602
|
-
return (jsxs("div", { className: className, children: [jsxs("label", { className: "block relative", children: [title ? jsx("span", { className: "text-m-light text-primary-text", children: title }) : null, jsx("input", { className: `m-0 mt-2 font-sans text-h3 w-full h-14 border border-solid border-gray rounded-md
|
|
1603
|
-
outline-none p-0 pl-4 box-border text-primary-text hover:border-primary-hover focus:border-primary-text ${DISABLED_INPUT_CLASSES}`, value: addSpacesBetweenNumbers(value), disabled: disabled, onChange: handleTextChange, onBlur: handleTextChange }), list.length ? (jsx("div", { className: "absolute w-full flex justify-between -bottom-[3px] px-4", children: list.map(renderTick(valueIndex, disabled)) })) : null, jsx("div", { className: "absolute inset-x-0 -bottom-1 px-4 leading-[18px]", children: jsx("input", { className: "box-border w-full m-0 cursor-pointer slider relative z-10", type: "range", min: min, max: max, step: step, value: valueIndex, disabled: disabled, onChange: handleRangeChange, style: inputStyle }) })] }), renderRangeCaption(items)] }));
|
|
1604
|
-
});
|
|
1605
|
-
const renderTick = (valueIndex, disabled) => (value, i) => (jsx("span", { className: `w-2 h-2 rounded-full ${valueIndex <= i || disabled ? 'bg-gray' : 'bg-primary-main'}` }, String(i)));
|
|
1606
|
-
function renderRangeCaption(items) {
|
|
1607
|
-
return (jsx("div", { className: "flex justify-between my-2", children: items.map((item, i) => (jsx("span", { className: "text-s-light text-secondary-text", children: item }, String(i)))) }));
|
|
1608
|
-
}
|
|
1575
|
+
const renderBusinessDepositParamsForm = (calculatorParams, field) => (jsxs("div", { children: [jsx(Checkbox, { text: "\u041F\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435", disabled: calculatorParams.isDisabledOperatingDeposit, ...field('isReplenished'), value: calculatorParams.isReplenished }), jsx(Checkbox, { className: "mt-3", disabled: calculatorParams.isDisabledOperatingDeposit, text: "\u0427\u0430\u0441\u0442\u0438\u0447\u043D\u043E\u0435 \u0441\u043D\u044F\u0442\u0438\u0435", ...field('isPartialWithdrawal'), value: calculatorParams.isPartialWithdrawal }), jsx(Checkbox, { className: "mt-3", text: "\u042F\u0432\u043B\u044F\u044E\u0441\u044C \u043C\u0430\u043B\u044B\u043C \u043F\u0440\u0435\u0434\u043F\u0440\u0438\u044F\u0442\u0438\u0435\u043C", ...field('isSmallBusiness'), value: calculatorParams.isSmallBusiness })] }));
|
|
1609
1576
|
|
|
1610
1577
|
const STEP_MONTHS = 1;
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
const monthText = (month) => {
|
|
1614
|
-
const text = Number(month) % 10 === 1 ? 'месяца' : 'месяцев';
|
|
1615
|
-
return `${month} ${text}`;
|
|
1616
|
-
};
|
|
1617
|
-
return availableMonths?.length ? (jsx(InputListRange, { className: "mt-7", title: title, items: [`От ${monthText(minMonths)}`, `До ${monthText(maxMonths)}`], list: availableMonths, value: clamp(monthsValue, minMonths, maxMonths), onChange: callback })) : (jsx(InputRange, { className: "mt-7", title: title, items: [`От ${monthText(minMonths)}`, `До ${monthText(maxMonths)}`], min: minMonths, max: maxMonths, step: STEP_MONTHS, value: clamp(monthsValue, minMonths, maxMonths), onChange: callback }));
|
|
1618
|
-
}
|
|
1578
|
+
const renderMonthsInput = ({ min = 0, max = 0, availableMonths, ...rest }) => (jsx(InputRange, { className: "mt-7", items: [`От ${monthText(min)}`, `До ${monthText(max)}`], step: STEP_MONTHS, ...(availableMonths?.length ? { list: availableMonths } : { min, max }), ...rest }));
|
|
1579
|
+
const monthText = (month) => `${month} ${Number(month) % 10 === 1 ? 'месяца' : 'месяцев'}`;
|
|
1619
1580
|
|
|
1620
|
-
const
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
id:
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
{
|
|
1628
|
-
id: DIFFERENTIAL,
|
|
1629
|
-
text: 'Дифференцированный',
|
|
1630
|
-
},
|
|
1631
|
-
];
|
|
1632
|
-
function renderPaymentType({ isAnnuity, callback, title, orientation = 'horizontal', }) {
|
|
1633
|
-
return (jsxs("div", { children: [title ? (jsx("div", { className: "mb-3", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, jsx(RadioButtonGroup, { orientation: orientation, items: paymentTypeItems, checkedItem: isAnnuity ? ANNUITY : DIFFERENTIAL, onChange: (text) => callback && callback(text === ANNUITY) })] }));
|
|
1634
|
-
}
|
|
1581
|
+
const renderPaymentType = (props) => renderBinaryRadioButtonGroup({
|
|
1582
|
+
...props,
|
|
1583
|
+
items: [
|
|
1584
|
+
{ id: 'annuity', text: 'Аннуитетный' },
|
|
1585
|
+
{ id: 'differential', text: 'Дифференцированный' },
|
|
1586
|
+
],
|
|
1587
|
+
});
|
|
1635
1588
|
|
|
1636
1589
|
/**
|
|
1637
1590
|
* Формулы расчёта аннуитетных и дифференцированных платежей:
|
|
@@ -1702,72 +1655,48 @@
|
|
|
1702
1655
|
return isExclude || userInputParams[fieldKey] === row[fieldKey];
|
|
1703
1656
|
};
|
|
1704
1657
|
|
|
1705
|
-
const CreditCalculatorForm = JSX(({ className
|
|
1706
|
-
const [
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
const [moneyValue, setMoneyValue] = useState(CREDIT_DEFAULT_SUM);
|
|
1716
|
-
const handleMoneyValue = useCallback((_) => setMoneyValue(_), []);
|
|
1717
|
-
const [monthsValue, setMonthsValue] = useState(DEFAULT_MONTHS);
|
|
1718
|
-
const handleMonthsValue = useCallback((_) => setMonthsValue(_), []);
|
|
1719
|
-
const userInputParams = {
|
|
1720
|
-
isAnnuity,
|
|
1721
|
-
isInsurance,
|
|
1722
|
-
isSalaryClient,
|
|
1723
|
-
isPensionClient,
|
|
1724
|
-
isStateEmployee,
|
|
1725
|
-
moneyValue,
|
|
1726
|
-
monthsValue,
|
|
1727
|
-
};
|
|
1658
|
+
const CreditCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
1659
|
+
const [userInputParams, { field }] = useForm({
|
|
1660
|
+
isAnnuity: false,
|
|
1661
|
+
isInsurance: true,
|
|
1662
|
+
isSalaryClient: false,
|
|
1663
|
+
isPensionClient: false,
|
|
1664
|
+
isStateEmployee: false,
|
|
1665
|
+
moneyValue: CREDIT_DEFAULT_SUM,
|
|
1666
|
+
monthsValue: DEFAULT_MONTHS,
|
|
1667
|
+
});
|
|
1728
1668
|
const calculatorParams = useCreditCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
id: OFFICE_REGISTRATION,
|
|
1754
|
-
text: 'Офис Банка',
|
|
1755
|
-
},
|
|
1756
|
-
{
|
|
1757
|
-
id: REMOTE_REGISTRATION,
|
|
1758
|
-
text: 'Дистанционно',
|
|
1759
|
-
},
|
|
1760
|
-
];
|
|
1761
|
-
function renderRegistrationType({ isRemoteRegistration, callback, title, orientation = 'horizontal', }) {
|
|
1762
|
-
return (jsxs("div", { children: [title ? (jsx("div", { className: "mb-3", children: jsx(Text, { color: "text-secondary-text", font: "font-light", children: title }) })) : null, jsx("div", { children: jsx(RadioButtonGroup, { orientation: orientation, items: registrationTypeItems, checkedItem: isRemoteRegistration ? REMOTE_REGISTRATION : OFFICE_REGISTRATION, onChange: (text) => callback && callback(text === REMOTE_REGISTRATION) }) })] }));
|
|
1763
|
-
}
|
|
1669
|
+
return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput({
|
|
1670
|
+
title: 'Сумма кредита, ₽',
|
|
1671
|
+
step: 500,
|
|
1672
|
+
min: calculatorParams.minSum,
|
|
1673
|
+
max: calculatorParams.maxSum,
|
|
1674
|
+
...field('moneyValue'),
|
|
1675
|
+
value: calculatorParams.moneyValue,
|
|
1676
|
+
}), renderMonthsInput({
|
|
1677
|
+
title: 'Срок кредита, месяцев',
|
|
1678
|
+
min: calculatorParams.minMonths,
|
|
1679
|
+
max: calculatorParams.maxMonths,
|
|
1680
|
+
...field('monthsValue'),
|
|
1681
|
+
value: calculatorParams.monthsValue,
|
|
1682
|
+
}), jsx("div", { className: "mt-7", children: renderCreditParamsForm({ ...calculatorParams, ...paramsViewSettings }, field) })] }), jsx(Rate, { title: "\u0421\u0442\u0430\u0432\u043A\u0430", rate: calculatorParams.rate, rateBlockClassName: "tracking-[-25px]", unit: "%" }), jsxs("div", { className: "w-full max-w-[350px]", children: [jsx(CalculatorValueBlock, { title: 'Ежемесячный платеж', value: calculatorParams.monthlyPayment, postfix: "\u20BD" }), renderPaymentType({ orientation: 'vertical', ...field('isAnnuity') }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
|
|
1683
|
+
});
|
|
1684
|
+
const renderCreditParamsForm = (params, field) => (jsxs("div", { children: [params.isShowSalaryClient ? (jsx(Checkbox, { text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u0437\u0430\u0440\u043F\u043B\u0430\u0442\u0443 \u043D\u0430 \u0441\u0447\u0451\u0442 \u0432 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0435", ...field('isSalaryClient'), value: params.isSalaryClient })) : null, params.isShowStateEmployee ? (jsx(Checkbox, { className: "mt-3", text: "\u0420\u0430\u0431\u043E\u0442\u0430\u044E \u0432 \u0431\u044E\u0434\u0436\u0435\u0442\u043D\u043E\u0439 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('isStateEmployee'), value: params.isStateEmployee })) : null, params.isShowPensionClient ? (jsx(Checkbox, { className: "mt-3", text: "\u041F\u043E\u043B\u0443\u0447\u0430\u044E \u043F\u0435\u043D\u0441\u0438\u044E \u043D\u0430 \u043A\u0430\u0440\u0442\u0443 \u0420\u043E\u0441\u0441\u0435\u043B\u044C\u0445\u043E\u0437\u0431\u0430\u043D\u043A\u0430", ...field('isPensionClient'), value: params.isPensionClient })) : null, params.isShowInsurance ? (jsx(Checkbox, { className: "mt-3", text: "\u041A\u043E\u043C\u043F\u043B\u0435\u043A\u0441\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u0445\u043E\u0432\u0430\u044F \u0437\u0430\u0449\u0438\u0442\u0430", ...field('isInsurance'), value: params.isInsurance })) : null] }));
|
|
1685
|
+
|
|
1686
|
+
const renderRegistrationType = (props) => renderBinaryRadioButtonGroup({
|
|
1687
|
+
...props,
|
|
1688
|
+
items: [
|
|
1689
|
+
{ id: 'remote', text: 'Дистанционно' },
|
|
1690
|
+
{ id: 'office', text: 'Офис Банка' },
|
|
1691
|
+
],
|
|
1692
|
+
});
|
|
1764
1693
|
|
|
1765
1694
|
const arrayByRange = (start, stop, step = 1) => Array.from({ length: Math.abs(stop - start) / step + 1 }, (value, index) => stop >= start ? start + index * step : start - index * step);
|
|
1766
1695
|
|
|
1767
1696
|
const useDepositCalculatorParams = (userInputParams, sourceBookDir, paramsViewSettings) => {
|
|
1768
1697
|
const { moneyValue, monthsValue } = userInputParams;
|
|
1769
1698
|
const data = useCalculatorParams(sourceBookDir || DEPOSIT_CALC_DEFAULT_DIR);
|
|
1770
|
-
const defaultMonth = data?.rateRows[0]
|
|
1699
|
+
const defaultMonth = data?.rateRows?.[0]
|
|
1771
1700
|
? getMiddleMonth(data.rateRows[0].minMonths, data.rateRows[0].maxMonths)
|
|
1772
1701
|
: 1;
|
|
1773
1702
|
const isExcludeMonthlyInterestPayment = !paramsViewSettings?.isShowMonthlyInterestPayment;
|
|
@@ -1816,48 +1745,45 @@
|
|
|
1816
1745
|
const checkRowByParam = ({ row, userInputParams, paramKey, isExclude }) => isExclude || userInputParams[paramKey] === row[paramKey];
|
|
1817
1746
|
const getMiddleMonth = (minMonths, maxMonths) => minMonths + Math.round((maxMonths - minMonths) / 2);
|
|
1818
1747
|
|
|
1819
|
-
const DepositCalculatorForm = JSX(({ className
|
|
1820
|
-
const [
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
const handleIsRemoteRegistration = useCallback((_) => toggleIsRemoteRegistration(_), []);
|
|
1827
|
-
const userInputParams = {
|
|
1828
|
-
moneyValue,
|
|
1829
|
-
monthsValue,
|
|
1830
|
-
isMonthlyInterestPayment,
|
|
1831
|
-
isRemoteRegistration,
|
|
1832
|
-
};
|
|
1833
|
-
const handleMonthsValue = useCallback((_) => setMonthsValue(_), []);
|
|
1748
|
+
const DepositCalculatorForm = JSX(({ className, sourceBookDir, buttons, footnote, paramsViewSettings }) => {
|
|
1749
|
+
const [userInputParams, { field }] = useForm({
|
|
1750
|
+
moneyValue: DEPOSIT_DEFAULT_SUM,
|
|
1751
|
+
monthsValue: 0,
|
|
1752
|
+
isMonthlyInterestPayment: false,
|
|
1753
|
+
isRemoteRegistration: false,
|
|
1754
|
+
});
|
|
1834
1755
|
const calculatorParams = useDepositCalculatorParams(userInputParams, sourceBookDir, paramsViewSettings);
|
|
1835
1756
|
const { defaultMonth, income, finalSum, rate } = calculatorParams;
|
|
1757
|
+
const { onChange: setMonthsValue } = field('monthsValue');
|
|
1836
1758
|
useEffect(() => {
|
|
1837
|
-
setMonthsValue(defaultMonth);
|
|
1759
|
+
setMonthsValue && setMonthsValue(defaultMonth);
|
|
1838
1760
|
}, [defaultMonth]);
|
|
1839
|
-
return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput(
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1761
|
+
return (jsxs("section", { className: style('flex justify-between', className), children: [jsxs("div", { className: "w-[468px]", children: [renderWantedSumInput({
|
|
1762
|
+
title: 'Сумма вклада, ₽',
|
|
1763
|
+
min: calculatorParams.minSum,
|
|
1764
|
+
max: calculatorParams.maxSum,
|
|
1765
|
+
...field('moneyValue'),
|
|
1766
|
+
value: calculatorParams.moneyValue,
|
|
1767
|
+
}), renderMonthsInput({
|
|
1768
|
+
title: 'Срок вклада, месяцев',
|
|
1769
|
+
min: calculatorParams.minMonths,
|
|
1770
|
+
max: calculatorParams.maxMonths,
|
|
1771
|
+
availableMonths: calculatorParams.availableMonths,
|
|
1772
|
+
...field('monthsValue'),
|
|
1773
|
+
value: calculatorParams.monthsValue,
|
|
1774
|
+
}), jsx("div", { className: "mt-7", children: renderDepositParamsForm({ ...calculatorParams, ...paramsViewSettings }, field) })] }), jsx(Rate, { rate: rate, rateBlockClassName: "tracking-[-25px]", unit: "%" }), jsxs("div", { className: "w-full max-w-[350px]", children: [jsx(CalculatorValueBlock, { title: "\u0414\u043E\u0445\u043E\u0434 \u043F\u043E \u0432\u043A\u043B\u0430\u0434\u0443", value: income, postfix: "\u20BD", prefix: "+" }), jsx(CalculatorValueBlock, { title: "\u0421\u0443\u043C\u043C\u0430 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0441\u0440\u043E\u043A\u0430", value: finalSum, postfix: "\u20BD" }), renderButtonsSection(buttons, { className: 'mt-7', isVertical: true }), renderFootnote(footnote)] })] }));
|
|
1775
|
+
});
|
|
1776
|
+
const renderDepositParamsForm = (params, field) => (jsxs("div", { className: "flex flex-col gap-y-7", children: [params.isShowMonthlyInterestPayment
|
|
1851
1777
|
? renderInterestPayment({
|
|
1852
|
-
isMonthlyInterestPayment,
|
|
1853
|
-
callback: handleIsMonthlyInterestPayment,
|
|
1854
1778
|
title: 'Выплата процентов',
|
|
1779
|
+
...field('isMonthlyInterestPayment'),
|
|
1780
|
+
value: params.isMonthlyInterestPayment,
|
|
1855
1781
|
})
|
|
1856
|
-
: null, isShowRemoteRegistration
|
|
1782
|
+
: null, params.isShowRemoteRegistration
|
|
1857
1783
|
? renderRegistrationType({
|
|
1858
|
-
isRemoteRegistration,
|
|
1859
|
-
callback: handleIsRemoteRegistration,
|
|
1860
1784
|
title: 'Оформление',
|
|
1785
|
+
...field('isRemoteRegistration'),
|
|
1786
|
+
value: params.isRemoteRegistration,
|
|
1861
1787
|
})
|
|
1862
1788
|
: null] }));
|
|
1863
1789
|
|
|
@@ -1887,7 +1813,7 @@
|
|
|
1887
1813
|
itemCount: calculatorTabs?.length,
|
|
1888
1814
|
visibleItemCount: COLUMNS_FOR_SCROLL,
|
|
1889
1815
|
});
|
|
1890
|
-
return (jsxs(BlockWrapper, { className:
|
|
1816
|
+
return (jsxs(BlockWrapper, { className: style('box-border overflow-hidden relative w-100', className), ...rest, children: [jsxs("div", { className: "bg-white", children: [tabsNav.length > 1
|
|
1891
1817
|
? renderTabs({ activeIndex, tabsNav, slideIndexShift, onClick: handleSlideIndexShift })
|
|
1892
1818
|
: null, renderArrows({
|
|
1893
1819
|
...controls,
|
|
@@ -1906,11 +1832,10 @@
|
|
|
1906
1832
|
const iconClassName = isActive ? '' : `text-primary-main`;
|
|
1907
1833
|
const iconVersion = tab?.icon?.iconVersion;
|
|
1908
1834
|
const activeIconStyle = isActive ? 'white' : 'normal';
|
|
1909
|
-
return (jsxs("button", { type: "button", onClick: onClick, "aria-label": tab?.title, className:
|
|
1910
|
-
${btnClassName}`, children: [jsx(ImgInner, { className: `h-6 w-6 min-w-6 min-h-6 mr-4 ${iconClassName}`, image: {
|
|
1835
|
+
return (jsxs("button", { type: "button", onClick: onClick, "aria-label": tab?.title, className: style('box-border relative border border-gray cursor-pointer text-left border-b-0 flex hover:h-[88px]', btnClassName), children: [jsx(ImgInner, { className: `h-6 w-6 min-w-6 min-h-6 mr-4 ${iconClassName}`, image: {
|
|
1911
1836
|
...tab?.icon,
|
|
1912
1837
|
iconVersion: iconVersion ?? activeIconStyle,
|
|
1913
|
-
}, width: "24", height: "24" }), jsxs("div", { className: "border-0", children: [jsx("div", { className:
|
|
1838
|
+
}, width: "24", height: "24" }), jsxs("div", { className: "border-0", children: [jsx("div", { className: btnTitleClassName, children: tab?.title }), jsx("div", { className: btnDescClassName, children: tab.description })] })] }, String(i)));
|
|
1914
1839
|
}
|
|
1915
1840
|
function renderTabs({ activeIndex, tabsNav, slideIndexShift, onClick }) {
|
|
1916
1841
|
const CARD_SHIFT = 388;
|
|
@@ -1922,6 +1847,8 @@
|
|
|
1922
1847
|
})) }) }), jsx("div", { className: "w-full h-2 bg-primary-main" })] }));
|
|
1923
1848
|
}
|
|
1924
1849
|
|
|
1850
|
+
const getSanitizedValue = (_) => _.replace(/\s/g, '');
|
|
1851
|
+
|
|
1925
1852
|
const adjustValue = (val) => onlyOneDot(setZeroStart(replaceCommaToDot(getSanitizedValue(val))));
|
|
1926
1853
|
const localNumberFormat = (val) => new Intl.NumberFormat('ru-RU', {
|
|
1927
1854
|
minimumFractionDigits: 0,
|
|
@@ -2189,6 +2116,7 @@
|
|
|
2189
2116
|
const renderBlur = (isBlur, scroll) => isBlur ? (jsxs("div", { children: [scroll.canScrollLeft ? (jsx("div", { className: style(blurBaseStyle, 'left-0 bg-opacity-from-white') })) : null, scroll.canScrollRight ? (jsx("div", { className: style(blurBaseStyle, 'right-0 bg-opacity-to-white') })) : null] })) : null;
|
|
2190
2117
|
|
|
2191
2118
|
const ITEMS_GAP = 4;
|
|
2119
|
+
|
|
2192
2120
|
const Carousel = JSX(({ className = '', itemCount, visibleItemCount, isBlur = true, isCyclic = false, arrowsPadded = true, isPadding = true, showDots = false, isAlignCenter = false, ...rest }) => {
|
|
2193
2121
|
const { blocks: childBlocks = [] } = rest.block || {};
|
|
2194
2122
|
const count = itemCount || childBlocks?.length;
|
|
@@ -2201,7 +2129,7 @@
|
|
|
2201
2129
|
});
|
|
2202
2130
|
const [dotsActiveIndex] = scroll.visibleIndicesRange;
|
|
2203
2131
|
const isBankHistoryCarousel = childBlocks && childBlocks[0]?.type === 'CarouselBankHistoryCard';
|
|
2204
|
-
return (jsx(BlockWrapper, { className: style(getPaddingStyle(isPadding), 'group-data-secondary:bg-primary-main group-data-secondary:text-white', className), ...rest, children: jsxs("div", { className: style(getAlignStyle(isAlignCenter), 'relative max-w-full'), children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderChildren({
|
|
2132
|
+
return (jsx(BlockWrapper, { className: style(getPaddingStyle$1(isPadding), 'group-data-secondary:bg-primary-main group-data-secondary:text-white', className), ...rest, children: jsxs("div", { className: style(getAlignStyle(isAlignCenter), 'relative max-w-full'), children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: ITEMS_GAP, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderChildren({
|
|
2205
2133
|
...rest,
|
|
2206
2134
|
renderProps: isBankHistoryCarousel
|
|
2207
2135
|
? (block, options) => renderBlock$1(block, options, {
|
|
@@ -2209,7 +2137,7 @@
|
|
|
2209
2137
|
activeIndex: activeIndex,
|
|
2210
2138
|
})
|
|
2211
2139
|
: renderBlock$1,
|
|
2212
|
-
}) }), jsx(CarouselScrollButtons, { scroll: scroll, isBlur: isBlur, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count }), showDots ? renderDots(containerRef, dotsActiveIndex,
|
|
2140
|
+
}) }), jsx(CarouselScrollButtons, { scroll: scroll, isBlur: isBlur, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count }), showDots ? renderDots(containerRef, dotsActiveIndex, count) : null] }) }));
|
|
2213
2141
|
});
|
|
2214
2142
|
Carousel.childrenTypes = [
|
|
2215
2143
|
'CarouselCard',
|
|
@@ -2224,7 +2152,7 @@
|
|
|
2224
2152
|
'CarouselInvestmentCard',
|
|
2225
2153
|
'CarouselEventCard',
|
|
2226
2154
|
];
|
|
2227
|
-
const getPaddingStyle = (isPadding) => (isPadding ? 'p-default' : '');
|
|
2155
|
+
const getPaddingStyle$1 = (isPadding) => (isPadding ? 'p-default' : '');
|
|
2228
2156
|
const getAlignStyle = (isAlignCenter) => isAlignCenter ? 'flex justify-center' : '';
|
|
2229
2157
|
const renderDots = (containerRef, dotsActiveIndex, itemCount) => (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: dotsActiveIndex, dotCount: itemCount, listType: 'horizontal-list' }));
|
|
2230
2158
|
|
|
@@ -2457,20 +2385,24 @@
|
|
|
2457
2385
|
return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} ${className}`, children: children }));
|
|
2458
2386
|
});
|
|
2459
2387
|
|
|
2388
|
+
const getPaddingStyle = (isHighlighting) => isHighlighting ? 'p-8 mt-8 pt-20' : 'p-8 mt-20';
|
|
2389
|
+
|
|
2390
|
+
const descriptionSize = 'text-h6';
|
|
2391
|
+
|
|
2392
|
+
const renderCardInfo = (cell, i) => {
|
|
2393
|
+
const { title, description, buttons } = cell;
|
|
2394
|
+
return (jsxs("div", { className: "py-5 border-b border-main-divider", children: [title ? (jsx("div", { className: "opacity-80", children: jsx(Text, { size: "text-m", color: "text-secondary-text", children: title }) })) : null, description ? (jsx("div", { className: "mt-1", children: jsx(Text, { size: descriptionSize, color: "text-primary-text", children: description }) })) : null, buttons?.length ? (jsx("div", { className: "text-primary-main", children: renderButtonsSection(buttons) })) : null] }, String(i)));
|
|
2395
|
+
};
|
|
2396
|
+
|
|
2460
2397
|
const VISIBLE_CELLS_COUNT = 1;
|
|
2461
|
-
const CarouselTariffsCard = JSX(({ className = '', title, icon, isHighlighting, button, cardCells = [], ...rest }) => {
|
|
2398
|
+
const CarouselTariffsCard = JSX(({ className = '', title, icon, isHighlighting = false, button, cardCells = [], ...rest }) => {
|
|
2462
2399
|
const cellsNode = cardCells.map(renderCardInfo);
|
|
2463
2400
|
const visibleCells = cellsNode.slice(0, VISIBLE_CELLS_COUNT);
|
|
2464
2401
|
const hiddenCells = cellsNode.slice(VISIBLE_CELLS_COUNT);
|
|
2465
|
-
return (jsxs(BlockWrapper, { className: style('relative border border-gray
|
|
2402
|
+
return (jsxs(BlockWrapper, { className: style('relative border border-gray flex flex-col', getPaddingStyle(isHighlighting), className), ...rest, children: [isHighlighting ? renderHitIcon() : null, renderIconBlock$1(icon), title ? jsx(Heading, { className: "text-center pt-2", headingType: "h5", title: title }) : null, button ? jsx(Button, { className: "w-full mt-4", ...button }) : null, cardCells.length ? (jsx(Foldable, { renderFoldableSection: ({ isUnfolded }) => (jsxs("div", { children: [visibleCells, jsx(FoldableSection, { isUnfolded: isUnfolded, children: hiddenCells })] })), renderFoldButton: cardCells.length > 1 ? renderFoldButton$1 : null })) : null] }));
|
|
2466
2403
|
});
|
|
2467
|
-
const renderIconBlock$1 = (icon) => (
|
|
2468
|
-
const getHitStyle = (isHighlighting) => isHighlighting ? 'mt-8 pt-20' : 'mt-20 pt-8';
|
|
2404
|
+
const renderIconBlock$1 = (icon) => (jsx("div", { className: "w-[267px] min-w-[267px] self-center", children: icon?.src || icon?.icon ? jsx(ImgInner, { image: icon }) : null }));
|
|
2469
2405
|
const renderFoldButton$1 = ({ isUnfolded, onToggle }) => (jsxs("button", { className: "w-full cursor-pointer text-primary-main pt-5 flex justify-between items-center", onClick: onToggle, children: [jsx("div", { children: isUnfolded ? 'Скрыть' : 'Подробнее о тарифе' }), jsx(Icon, { className: "text-primary-text", name: isUnfolded ? 'ArrowUpIcon' : 'ArrowDownIcon', width: "16", height: "16" })] }));
|
|
2470
|
-
const renderCardInfo = (cell, i) => {
|
|
2471
|
-
const { title, description, buttons } = cell;
|
|
2472
|
-
return (jsxs("div", { className: "py-5 border-b border-main-divider", children: [title ? (jsx("div", { className: "text-secondary-text text-m-light opacity-80", children: cell.title })) : null, description ? (jsx("div", { className: "text-primary-text text-h6 mt-1", children: cell.description })) : null, buttons?.length ? (jsx("div", { className: "text-primary-main", children: renderButtonsSection(buttons) })) : null] }, String(i)));
|
|
2473
|
-
};
|
|
2474
2406
|
const renderHitIcon = () => (jsxs("div", { className: "absolute -top-7 -right-4 h-[60px] w-[60px] bg-white flex flex-col items-center justify-center rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: [jsx(Icon, { iconVersion: "black", name: "HeartIcon", width: "23", height: "22" }), jsx(Paragraph, { size: "text-s", font: "font-normal", align: "text-center", color: "text-primary-text", children: "\u0425\u0418\u0422" })] }));
|
|
2475
2407
|
|
|
2476
2408
|
const GRADIENT = 'bg-gradient-to-r from-main-gradient-start to-main-gradient-end';
|
|
@@ -5074,7 +5006,7 @@
|
|
|
5074
5006
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto" }) }));
|
|
5075
5007
|
}
|
|
5076
5008
|
|
|
5077
|
-
const packageVersion = "0.10.
|
|
5009
|
+
const packageVersion = "0.10.7";
|
|
5078
5010
|
|
|
5079
5011
|
exports.Blocks = Blocks;
|
|
5080
5012
|
exports.ContentPage = ContentPage;
|