@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
|
@@ -236,41 +236,84 @@
|
|
|
236
236
|
return JSXTmpl;
|
|
237
237
|
};
|
|
238
238
|
|
|
239
|
-
const HeadingClass = {
|
|
240
|
-
h0: 'text-m-title',
|
|
241
|
-
h1: 'text-m-title',
|
|
242
|
-
h2: 'text-m-title',
|
|
243
|
-
h3: 'text-h6',
|
|
244
|
-
h4: 'text-m-title-xs',
|
|
245
|
-
h5: 'text-m-title-xs',
|
|
246
|
-
h6: 'text-m-title-xs',
|
|
247
|
-
};
|
|
248
|
-
const Heading = JSX((props) => {
|
|
249
|
-
const { className, headingType = 'h3', title, as: Tag = 'h3' } = props;
|
|
250
|
-
return (jsx(Tag, { className: `font-sans font-medium m-0 ${HeadingClass[headingType]} ${className || ''}`, children: title }));
|
|
251
|
-
});
|
|
252
|
-
|
|
253
239
|
const style = (...atoms) => atoms
|
|
254
240
|
.flatMap((_) => _)
|
|
255
241
|
.filter(Boolean)
|
|
256
242
|
.join(' ');
|
|
257
243
|
|
|
258
|
-
const
|
|
259
|
-
|
|
244
|
+
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
245
|
+
|
|
246
|
+
const DEFAULT_ANCESTORS = [];
|
|
247
|
+
const defaultStyle = 'col-span-12';
|
|
248
|
+
function renderBlock(block, options, { className, ...extraProps } = {}) {
|
|
249
|
+
const { key, blockDecorator = defaultBlockDecorator, blocksRegistry = {}, ancestors = DEFAULT_ANCESTORS, } = options;
|
|
250
|
+
const { type } = block;
|
|
251
|
+
if (!(type && type in blocksRegistry)) {
|
|
252
|
+
console.warn(`No block with "${type}" is registered`);
|
|
253
|
+
}
|
|
254
|
+
const BlockComponent = type && blocksRegistry[type];
|
|
255
|
+
return blockDecorator({
|
|
256
|
+
blockClassName: style('scroll-mt-12', // TODO scroll-mt-12 ? here?
|
|
257
|
+
className, block.style || defaultStyle),
|
|
258
|
+
block,
|
|
259
|
+
ancestors,
|
|
260
|
+
// Adjusted by decorator block and blockClassName
|
|
261
|
+
render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
|
|
262
|
+
const { content } = adjustedBlock;
|
|
263
|
+
return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, block: block, options: options, ...content, ...extraProps }, key)) : null;
|
|
264
|
+
},
|
|
265
|
+
}, key);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const DEFAULT_SLOT_NAME = null;
|
|
269
|
+
|
|
270
|
+
const EMPTY_ANCESTORS = [];
|
|
271
|
+
const renderBlocksList = (blocks, { key, ancestors = EMPTY_ANCESTORS, slotName = DEFAULT_SLOT_NAME, renderProps = renderBlock, ...options }) => (blocks || []).map((_, j) => renderProps(_, {
|
|
272
|
+
...options,
|
|
273
|
+
key: `${key ? key : _.type}-${j}`,
|
|
274
|
+
ancestors: options.parent
|
|
275
|
+
? [...(ancestors || EMPTY_ANCESTORS), [options.parent, slotName]]
|
|
276
|
+
: ancestors,
|
|
277
|
+
}));
|
|
278
|
+
|
|
279
|
+
function renderChildren({ children, block, options, renderProps, }) {
|
|
280
|
+
if (children) {
|
|
260
281
|
return children;
|
|
261
282
|
}
|
|
262
|
-
return
|
|
263
|
-
|
|
283
|
+
return block && options
|
|
284
|
+
? renderBlocksList(block.blocks, { ...options, parent: block, renderProps })
|
|
285
|
+
: null;
|
|
286
|
+
}
|
|
264
287
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
288
|
+
class EventBus {
|
|
289
|
+
subscribers = {};
|
|
290
|
+
subjectsStateMap = {};
|
|
291
|
+
subscribe(type, listener) {
|
|
292
|
+
this.subscribers[type] = (this.subscribers[type] || []).concat(listener);
|
|
293
|
+
const latestEvent = this.subjectsStateMap[type];
|
|
294
|
+
if (latestEvent) {
|
|
295
|
+
listener(latestEvent);
|
|
296
|
+
}
|
|
297
|
+
return () => {
|
|
298
|
+
this.unsubscribe(type, listener);
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
unsubscribe(type, listener) {
|
|
302
|
+
this.subscribers[type] = this.subscribers[type]?.filter((s) => s !== listener);
|
|
303
|
+
}
|
|
304
|
+
fire(type, event) {
|
|
305
|
+
const isSubjectDeclared = type in this.subjectsStateMap;
|
|
306
|
+
if (isSubjectDeclared) {
|
|
307
|
+
this.subjectsStateMap[type] = event;
|
|
308
|
+
}
|
|
309
|
+
this.subscribers[type]?.forEach((s) => s(event));
|
|
310
|
+
}
|
|
311
|
+
subject(type, event) {
|
|
312
|
+
this.subjectsStateMap[type] = event;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const defaultEventBus = new EventBus();
|
|
274
317
|
|
|
275
318
|
const SENSITIVITY_SCALE = 10;
|
|
276
319
|
function useIntersectionObserver(observerCallback, { sensitivity, rootRef } = {}) {
|
|
@@ -296,6 +339,54 @@
|
|
|
296
339
|
.concat(1);
|
|
297
340
|
}
|
|
298
341
|
|
|
342
|
+
const blockRouterEventBus = new EventBus();
|
|
343
|
+
|
|
344
|
+
function useBlockIntersectionObserver(block) {
|
|
345
|
+
const observerCallback = useCallback((entries) => {
|
|
346
|
+
if (!block || !entries?.length) {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
const intersection = entries[entries.length - 1];
|
|
350
|
+
blockRouterEventBus.fire('intersection', { block, intersection });
|
|
351
|
+
}, [block]);
|
|
352
|
+
return useIntersectionObserver(observerCallback, { sensitivity: 1 });
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const blockStyles = {
|
|
356
|
+
primary: 'bg-white text-primary-text',
|
|
357
|
+
secondary: 'bg-primary-main text-white',
|
|
358
|
+
gray: 'bg-main-divider text-primary-text',
|
|
359
|
+
transparent: 'bg-transparent text-primary-text',
|
|
360
|
+
'': '',
|
|
361
|
+
};
|
|
362
|
+
const BlockWrapper = JSX(({ className = '', version = 'primary', isTheme = true, block, tag = 'section', role, children, }) => {
|
|
363
|
+
const Tag = tag;
|
|
364
|
+
const ref = useBlockIntersectionObserver(block);
|
|
365
|
+
const [isHidden, setHidden] = useState(false);
|
|
366
|
+
useEffect(() => defaultEventBus.subscribe('tab', (event) => {
|
|
367
|
+
setHidden(Boolean(event.label && block?.labels?.length && !block.labels.includes(event.label)));
|
|
368
|
+
}), [block]);
|
|
369
|
+
return (jsx(Tag, { className: style(groupStyle(Boolean(version && isTheme)), blockStyles[version], isHidden ? 'hidden' : '', className), ...(version && isTheme ? { 'data-ver': version } : {}), ...(block?.anchor ? { id: block.anchor, ref } : {}), role: role, children: children }));
|
|
370
|
+
});
|
|
371
|
+
const groupStyle = (isGroup) => (isGroup ? 'group' : '');
|
|
372
|
+
|
|
373
|
+
const mapChildren = (mapper) => (children) => {
|
|
374
|
+
if (children === null || children === undefined) {
|
|
375
|
+
return children;
|
|
376
|
+
}
|
|
377
|
+
return Array.isArray(children) ? children.map(mapper) : mapper(children, 0);
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
const HEADER_HEIGHT = 170;
|
|
381
|
+
const FOOTER_HEIGHT = 48;
|
|
382
|
+
const BLOCKS_GAP = 4;
|
|
383
|
+
const PAGE_PADDINGS_X = 20;
|
|
384
|
+
const DEFAULT_HEIGHT = 866;
|
|
385
|
+
const getContainerHeight = (minHeight) => ({
|
|
386
|
+
height: `calc(100vh - ${HEADER_HEIGHT + FOOTER_HEIGHT + BLOCKS_GAP + PAGE_PADDINGS_X}px)`,
|
|
387
|
+
minHeight: `${minHeight || DEFAULT_HEIGHT}px`,
|
|
388
|
+
});
|
|
389
|
+
|
|
299
390
|
const SwipeListItem = JSX(({ className = '', style, idx, activeIndex, observerOptions, children, onIntersection }) => {
|
|
300
391
|
const observerCallback = useCallback((entries) => {
|
|
301
392
|
if (entries.length && onIntersection) {
|
|
@@ -432,57 +523,23 @@
|
|
|
432
523
|
];
|
|
433
524
|
};
|
|
434
525
|
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
Horizontal padding used on a container above SwipeListControl.
|
|
438
|
-
Same value used on a SwipeListControlChildren container to compensate it
|
|
439
|
-
and get rid of a clipping effect caused by overflow: hidden.
|
|
440
|
-
*/
|
|
441
|
-
const DEFAULT_PADDING = 16;
|
|
442
|
-
const SwipeListControl = JSX(({ className = '', gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, minHeight, children, onVisibleIndicesChange, listType = 'horizontal-list', version, }) => {
|
|
443
|
-
const itemCount = Array.isArray(children) ? children.length : 0;
|
|
444
|
-
const [containerRef, scroll] = useSwipeListScroll({
|
|
445
|
-
itemCount,
|
|
446
|
-
onVisibleIndicesChange,
|
|
447
|
-
});
|
|
448
|
-
const [activeIndex] = scroll.visibleIndicesRange;
|
|
449
|
-
return (jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, minHeight: minHeight, children: children }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType, version: version })) : null] }));
|
|
450
|
-
});
|
|
451
|
-
|
|
452
|
-
class EventBus {
|
|
453
|
-
subscribers = {};
|
|
454
|
-
subjectsStateMap = {};
|
|
455
|
-
subscribe(type, listener) {
|
|
456
|
-
this.subscribers[type] = (this.subscribers[type] || []).concat(listener);
|
|
457
|
-
const latestEvent = this.subjectsStateMap[type];
|
|
458
|
-
if (latestEvent) {
|
|
459
|
-
listener(latestEvent);
|
|
460
|
-
}
|
|
461
|
-
return () => {
|
|
462
|
-
this.unsubscribe(type, listener);
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
unsubscribe(type, listener) {
|
|
466
|
-
this.subscribers[type] = this.subscribers[type]?.filter((s) => s !== listener);
|
|
467
|
-
}
|
|
468
|
-
fire(type, event) {
|
|
469
|
-
const isSubjectDeclared = type in this.subjectsStateMap;
|
|
470
|
-
if (isSubjectDeclared) {
|
|
471
|
-
this.subjectsStateMap[type] = event;
|
|
472
|
-
}
|
|
473
|
-
this.subscribers[type]?.forEach((s) => s(event));
|
|
474
|
-
}
|
|
475
|
-
subject(type, event) {
|
|
476
|
-
this.subjectsStateMap[type] = event;
|
|
477
|
-
}
|
|
526
|
+
function useRouter() {
|
|
527
|
+
return useRouter._impl();
|
|
478
528
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
529
|
+
useRouter._impl = () => ({
|
|
530
|
+
href: globalThis.location?.href || '/',
|
|
531
|
+
pathname: globalThis.location?.pathname || '/',
|
|
532
|
+
query: {},
|
|
533
|
+
push: () => {
|
|
534
|
+
// Do nothing
|
|
535
|
+
},
|
|
536
|
+
replace: () => {
|
|
537
|
+
// Do nothing
|
|
538
|
+
},
|
|
485
539
|
});
|
|
540
|
+
useRouter.setup = (impl) => {
|
|
541
|
+
useRouter._impl = impl;
|
|
542
|
+
};
|
|
486
543
|
|
|
487
544
|
const dirname = (path) => path?.split('/').slice(0, -1).join('/');
|
|
488
545
|
|
|
@@ -510,31 +567,73 @@
|
|
|
510
567
|
};
|
|
511
568
|
const hasPrefix = (href, prefix) => prefix && href && href.startsWith(prefix);
|
|
512
569
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
570
|
+
const svgUseStyleMap = {
|
|
571
|
+
normal: '',
|
|
572
|
+
color: 'text-primary-main',
|
|
573
|
+
black: 'text-black',
|
|
574
|
+
white: 'text-black',
|
|
516
575
|
};
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
576
|
+
const Icon = JSX(({ className = '', imageClassName = '', name = '', alt = `Иконка ${name}`, title = alt, iconVersion = 'color', ...imgProps }) => {
|
|
577
|
+
const router = useRouter();
|
|
578
|
+
const href = adjustHref(router)(joinPath(projectSettings.CDN, '/icons', `${name}.svg`));
|
|
579
|
+
if (iconVersion !== 'normal') {
|
|
580
|
+
return (jsx(Background, { className: className, children: jsxs("svg", { className: style(getSvgSize(imgProps.width), svgUseStyleMap[iconVersion], iconVersion === 'white' ? 'invert' : '', imageClassName), ...imgProps, "aria-hidden": "true", children: [title ? jsx("title", { children: title }) : null, alt ? jsx("desc", { children: alt }) : null, jsx("use", { href: `${href}#icon`, xlinkHref: `${href}#icon` })] }) }));
|
|
581
|
+
}
|
|
582
|
+
if (!className.includes('h-')) {
|
|
583
|
+
imgProps['style'] = { height: `${imgProps.height}px` };
|
|
584
|
+
}
|
|
585
|
+
return (jsx("img", { className: className, src: href, alt: alt, title: title, "aria-hidden": "true", ...imgProps }));
|
|
586
|
+
});
|
|
587
|
+
const getSvgSize = (width) => (width ? '' : 'w-full h-full');
|
|
588
|
+
const Background = JSX(({ className, children }) => className ? jsx("div", { className: className, children: children }) : children);
|
|
589
|
+
|
|
590
|
+
const sourcesComparator = (a, b) => a?.media && b?.media ? a.media - b.media : 0;
|
|
591
|
+
const ImgAsPicture = JSX(({ className = '', image, imageClassName = '', isMobile = false, pathPrefix }) => {
|
|
592
|
+
const router = useRouter();
|
|
593
|
+
const pictureStyles = isMobile ? 'flex' : 'flex-none';
|
|
594
|
+
return (jsxs("picture", { className: `${pictureStyles} ${className}`, children: [image?.sources?.length
|
|
595
|
+
? image.sources
|
|
596
|
+
.filter((_) => _?.src)
|
|
597
|
+
.sort(sourcesComparator)
|
|
598
|
+
.map(({ src, format, media }, index) => (jsx("source", { srcSet: adjustSrc(router, pathPrefix)(src), type: formatToMimeType(format), media: media ? `(max-width: ${media}px)` : '', ...image.size }, `${index}_${src}`)))
|
|
599
|
+
: null, image?.src
|
|
600
|
+
? renderImg({ ...image, src: adjustSrc(router, pathPrefix)(image.src) }, imageClassName, isMobile)
|
|
601
|
+
: null] }));
|
|
602
|
+
});
|
|
603
|
+
const renderImg = (image, imageClassName = '', isMobile = false) => {
|
|
604
|
+
const style = {
|
|
605
|
+
width: image.size?.width ? `${image.size?.width}px` : '100%',
|
|
606
|
+
height: image.size?.height ? `${image.size?.height}px` : '100%',
|
|
607
|
+
};
|
|
608
|
+
const title = image.title || '';
|
|
609
|
+
const alt = image.alt || image.title;
|
|
610
|
+
const imgStyle = isMobile ? 'm-auto' : 'm-0';
|
|
611
|
+
return (jsx("img", { src: image.src, className: `${imgStyle} ${imageClassName}`, alt: alt, title: title, style: style, ...image.size }));
|
|
520
612
|
};
|
|
613
|
+
const adjustSrc = (router, pathPrefix) => (src) => src && !isURL(src) ? adjustHref(router)(joinPath(pathPrefix, src)) : src;
|
|
614
|
+
const formatToMimeType = (format) => format ? `image/${String(format)}` : undefined;
|
|
521
615
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
},
|
|
616
|
+
const ImgInner = JSX(({ className = '', image, imageClassName = '', isMobile, pathPrefix, ...iconProps }) => {
|
|
617
|
+
if (!image?.src && !image?.icon) {
|
|
618
|
+
return null;
|
|
619
|
+
}
|
|
620
|
+
return image.icon ? (jsx(Icon, { className: className, imageClassName: imageClassName, iconVersion: image?.iconVersion, name: image.icon, ...iconProps })) : (jsx(ImgAsPicture, { className: className, imageClassName: imageClassName, image: image, isMobile: isMobile, pathPrefix: pathPrefix }));
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
const Img = JSX((props) => jsx(ImgInner, { ...props, isMobile: true }));
|
|
624
|
+
|
|
625
|
+
const useDialog = (id = '') => ({
|
|
626
|
+
open: (message) => defaultEventBus.fire('dialog', { type: 'open', id, message }),
|
|
627
|
+
close: () => defaultEventBus.fire('dialog', { type: 'close' }),
|
|
535
628
|
});
|
|
536
|
-
|
|
537
|
-
|
|
629
|
+
|
|
630
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
631
|
+
const handlerDecorator = (handler, targetContent) => {
|
|
632
|
+
return handlerDecorator._impl(handler, targetContent);
|
|
633
|
+
};
|
|
634
|
+
handlerDecorator._impl = (handler) => handler;
|
|
635
|
+
handlerDecorator.setup = (impl) => {
|
|
636
|
+
handlerDecorator._impl = impl;
|
|
538
637
|
};
|
|
539
638
|
|
|
540
639
|
function useLink(params = {}) {
|
|
@@ -635,63 +734,170 @@
|
|
|
635
734
|
const RegularButton = JSX(({ className = '', href, rel, target, ariaLabel, version, rounded, onClick, children }) => (jsx("a", { className: getRegularButtonClasses({ className, version, rounded }), href: href, rel: rel, target: target, "aria-label": ariaLabel, role: href ? 'link' : 'button', onClick: onClick, children: children })));
|
|
636
735
|
const DisabledButton = JSX(({ className, ariaLabel, version, rounded, children }) => (jsx("div", { role: "button", "aria-disabled": "true", "aria-label": ariaLabel, tabIndex: -1, className: getDisabledButtonClasses({ className, rounded, version }), children: children })));
|
|
637
736
|
|
|
638
|
-
const
|
|
639
|
-
|
|
737
|
+
const ArrowButton = JSX(({ className, disabled, ...rest }) => (jsx(Button, { rounded: true, className: `group/btn shadow-[0_4px_25px_rgba(0,0,0,0.07)] w-12 h-12 min-h-12 max-h-12 flex items-center justify-center ${disabled
|
|
738
|
+
? 'bg-secondary-light text-secondary-text'
|
|
739
|
+
: 'bg-white text-primary-text hover:text-primary-main'} ${className || ''}`, disabled: disabled, ...rest, children: jsx(Img, { className: "w-4 h-4 min-w-4 min-h-4 rounded-full box-border", image: { icon: 'ArrowLeftIcon', iconVersion: 'black' }, imageClassName: "group-hover/btn:text-primary-main", width: "16", height: "16" }) })));
|
|
740
|
+
const ScrollLeftButton = JSX((props) => (jsx(ArrowButton, { ...props, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E", "data-block-control": "scroll-left" })));
|
|
741
|
+
const ScrollRightButton = JSX((props) => (jsx(ArrowButton, { ...props, className: `${props.className || ''} rotate-180`, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E", "data-block-control": "scroll-right" })));
|
|
742
|
+
|
|
743
|
+
const scrollButtonStyle = 'absolute top-[calc(50%-24px)] z-40';
|
|
744
|
+
const blurBaseStyle = 'absolute top-0 bottom-0 z-40 w-[84px] pointer-events-none';
|
|
745
|
+
const CarouselScrollButtons = JSX(({ scroll, arrowsPadded, isBlur, onScrollLeft, onScrollRight, hasEdgeBlocks, activeIndex, itemCount, }) => {
|
|
746
|
+
const { canScrollLeft, canScrollRight, scrollLeft, scrollRight } = scroll;
|
|
747
|
+
const canMoveLeft = hasEdgeBlocks ? activeIndex > 0 : canScrollLeft;
|
|
748
|
+
const canMoveRight = hasEdgeBlocks ? activeIndex < itemCount - 1 : canScrollRight;
|
|
749
|
+
const handleScrollLeft = useCallback(() => {
|
|
750
|
+
if (!hasEdgeBlocks) {
|
|
751
|
+
scrollLeft();
|
|
752
|
+
}
|
|
753
|
+
else {
|
|
754
|
+
canScrollLeft && activeIndex !== itemCount - 1 && scrollLeft();
|
|
755
|
+
onScrollLeft();
|
|
756
|
+
}
|
|
757
|
+
}, [scrollLeft, onScrollLeft, hasEdgeBlocks, canScrollLeft, activeIndex, itemCount]);
|
|
758
|
+
const handleScrollRight = useCallback(() => {
|
|
759
|
+
if (!hasEdgeBlocks) {
|
|
760
|
+
scrollRight();
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
canScrollRight && activeIndex !== 0 && scrollRight();
|
|
764
|
+
onScrollRight();
|
|
765
|
+
}
|
|
766
|
+
}, [scrollRight, onScrollRight, hasEdgeBlocks, canScrollLeft, activeIndex, itemCount]);
|
|
767
|
+
return (jsxs("div", { children: [renderBlur(isBlur, scroll), canMoveLeft ? (jsx(ScrollLeftButton, { className: style(scrollButtonStyle, arrowsPadded ? 'left-8' : 'left-0'), onClick: handleScrollLeft })) : null, canMoveRight ? (jsx(ScrollRightButton, { className: style(scrollButtonStyle, arrowsPadded ? 'right-8' : 'right-0'), onClick: handleScrollRight })) : null] }));
|
|
768
|
+
});
|
|
769
|
+
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;
|
|
640
770
|
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
const
|
|
649
|
-
const
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
771
|
+
const ITEMS_GAP = 16;
|
|
772
|
+
|
|
773
|
+
const Carousel = JSX(({ className = '', itemCount, visibleItemCount, isBlur = true, isCyclic = false, arrowsPadded = true, isPadding = true, showDots = false, isAlignCenter = false, ...rest }) => {
|
|
774
|
+
const { blocks: childBlocks = [] } = rest.block || {};
|
|
775
|
+
const count = itemCount || childBlocks?.length;
|
|
776
|
+
const [activeIndex, setActiveIndex] = useState(Math.floor((visibleItemCount || 0) / 2));
|
|
777
|
+
const increaseActiveIndex = useCallback(() => setActiveIndex((_) => _ + 1), []);
|
|
778
|
+
const decreaseActiveIndex = useCallback(() => setActiveIndex((_) => _ - 1), []);
|
|
779
|
+
const [containerRef, scroll] = useSwipeListScroll({
|
|
780
|
+
itemCount: count,
|
|
781
|
+
isCyclic,
|
|
782
|
+
});
|
|
783
|
+
const [dotsActiveIndex] = scroll.visibleIndicesRange;
|
|
784
|
+
const isBankHistoryCarousel = childBlocks && childBlocks[0]?.type === 'CarouselBankHistoryCard';
|
|
785
|
+
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({
|
|
786
|
+
...rest,
|
|
787
|
+
renderProps: isBankHistoryCarousel
|
|
788
|
+
? (block, options) => renderBlock(block, options, {
|
|
789
|
+
blocksLength: childBlocks?.length,
|
|
790
|
+
activeIndex: activeIndex,
|
|
791
|
+
})
|
|
792
|
+
: renderBlock,
|
|
793
|
+
}) }), jsx(CarouselScrollButtons, { scroll: scroll, isBlur: isBlur, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count }), showDots ? renderDots(containerRef, dotsActiveIndex, count) : null] }) }));
|
|
657
794
|
});
|
|
658
|
-
|
|
659
|
-
|
|
795
|
+
Carousel.childrenTypes = [
|
|
796
|
+
'CarouselCard',
|
|
797
|
+
'CarouselBankHistoryCard',
|
|
798
|
+
'CarouselCatalogCard',
|
|
799
|
+
'CarouselInvestmentCard',
|
|
800
|
+
'CarouselProductCard',
|
|
801
|
+
'CarouselProgramsCard',
|
|
802
|
+
'CarouselRecommendationCard',
|
|
803
|
+
'CarouselTariffsCard',
|
|
804
|
+
'CarouselRichTextCard',
|
|
805
|
+
'CarouselInvestmentCard',
|
|
806
|
+
'CarouselEventCard',
|
|
807
|
+
];
|
|
808
|
+
const getPaddingStyle$1 = (isPadding) => (isPadding ? 'p-default' : '');
|
|
809
|
+
const getAlignStyle = (isAlignCenter) => isAlignCenter ? 'flex justify-center' : '';
|
|
810
|
+
const renderDots = (containerRef, dotsActiveIndex, itemCount) => (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: dotsActiveIndex, dotCount: itemCount, listType: 'horizontal-list' }));
|
|
660
811
|
|
|
661
|
-
const
|
|
662
|
-
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
.map(({ src, format, media }, index) => (jsx("source", { srcSet: adjustSrc(router, pathPrefix)(src), type: formatToMimeType(format), media: media ? `(max-width: ${media}px)` : '', ...image.size }, `${index}_${src}`)))
|
|
670
|
-
: null, image?.src
|
|
671
|
-
? renderImg({ ...image, src: adjustSrc(router, pathPrefix)(image.src) }, imageClassName, isMobile)
|
|
672
|
-
: null] }));
|
|
812
|
+
const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
|
|
813
|
+
const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
|
|
814
|
+
const onToggle = useCallback(() => {
|
|
815
|
+
setIsUnfolded((_) => !_);
|
|
816
|
+
}, []);
|
|
817
|
+
const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
|
|
818
|
+
const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
|
|
819
|
+
return isFoldButtonOnTop ? (jsxs("div", { className: className, children: [buttonNode, sectionNode] })) : (jsxs("div", { className: className, children: [sectionNode, buttonNode] }));
|
|
673
820
|
});
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
821
|
+
|
|
822
|
+
const FoldableSection = JSX(({ className = '', isUnfolded, children }) => {
|
|
823
|
+
const containerRef = useRef(null);
|
|
824
|
+
useEffect(() => {
|
|
825
|
+
if (containerRef.current) {
|
|
826
|
+
containerRef.current.style.maxHeight = isUnfolded
|
|
827
|
+
? `${containerRef.current.scrollHeight}px`
|
|
828
|
+
: '';
|
|
829
|
+
}
|
|
830
|
+
}, [isUnfolded, children?.length]);
|
|
831
|
+
return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} ${className}`, children: children }));
|
|
832
|
+
});
|
|
833
|
+
|
|
834
|
+
const HeadingClass = {
|
|
835
|
+
h0: 'text-m-title',
|
|
836
|
+
h1: 'text-m-title',
|
|
837
|
+
h2: 'text-m-title',
|
|
838
|
+
h3: 'text-h6',
|
|
839
|
+
h4: 'text-m-title-xs',
|
|
840
|
+
h5: 'text-m-title-xs',
|
|
841
|
+
h6: 'text-m-title-xs',
|
|
683
842
|
};
|
|
684
|
-
const
|
|
685
|
-
|
|
843
|
+
const Heading = JSX((props) => {
|
|
844
|
+
const { className, headingType = 'h3', title, as: Tag = 'h3' } = props;
|
|
845
|
+
return (jsx(Tag, { className: `font-sans font-medium m-0 ${HeadingClass[headingType]} ${className || ''}`, children: title }));
|
|
846
|
+
});
|
|
686
847
|
|
|
687
|
-
const
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
848
|
+
const Paragraph = JSX(({ children, ...style }) => (jsx("p", { className: ['font-sans', ...Object.values(style)].join(' '), children: children })));
|
|
849
|
+
|
|
850
|
+
const getPaddingStyle = (isHighlighting) => isHighlighting ? 'p-default mt-6' : 'p-default mt-6';
|
|
851
|
+
|
|
852
|
+
const renderButtonsSection = (buttons, { className = '', buttonClassName, isVertical } = {}) => buttons?.length && buttons.some((_) => _?.text || _?.icon?.icon) ? (jsx("div", { className: style('flex', isVertical ? 'flex-col gap-2' : 'gap-4', className), children: buttons.map(renderButton(buttonClassName)) })) : null;
|
|
853
|
+
const renderButton = (buttonClassName = '') => (button, index) => {
|
|
854
|
+
const { text, icon, iconRight, version, ...rest } = button || {};
|
|
855
|
+
const iconVersionDefault = version === 'secondary' ? 'color' : 'white';
|
|
856
|
+
const iconVersion = icon?.iconVersion ? icon?.iconVersion : iconVersionDefault;
|
|
857
|
+
return text || icon?.icon ? (jsx(Button, { className: buttonClassName, appendLeft: renderButtonIcon({ ...icon, iconVersion }), appendRight: renderButtonIcon({ ...iconRight, iconVersion }), version: version, text: text, ...rest }, index ? String(index) : '')) : null;
|
|
858
|
+
};
|
|
859
|
+
const DEFAULT_ICON_W = 24;
|
|
860
|
+
const renderButtonIcon = (icon) => icon?.icon || icon?.src ? (jsx(Img, { image: icon, width: String(icon?.size?.width || DEFAULT_ICON_W), height: String(DEFAULT_ICON_W) })) : null;
|
|
861
|
+
|
|
862
|
+
const Text = JSX(({ children, ...style }) => (jsx("span", { className: ['font-sans', ...Object.values(style)].join(' '), children: children })));
|
|
863
|
+
|
|
864
|
+
const descriptionSize = 'text-l';
|
|
865
|
+
|
|
866
|
+
const renderCardInfo = (cell, i) => {
|
|
867
|
+
const { title, description, buttons } = cell;
|
|
868
|
+
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)));
|
|
869
|
+
};
|
|
870
|
+
|
|
871
|
+
const VISIBLE_CELLS_COUNT = 1;
|
|
872
|
+
const CarouselTariffsCard = JSX(({ className = '', title, icon, isHighlighting = false, button, cardCells = [], ...rest }) => {
|
|
873
|
+
const cellsNode = cardCells.map(renderCardInfo);
|
|
874
|
+
const visibleCells = cellsNode.slice(0, VISIBLE_CELLS_COUNT);
|
|
875
|
+
const hiddenCells = cellsNode.slice(VISIBLE_CELLS_COUNT);
|
|
876
|
+
return (jsxs(BlockWrapper, { className: style('relative border border-gray flex flex-col', getPaddingStyle(isHighlighting), className), ...rest, children: [isHighlighting ? renderHitIcon() : null, renderIconBlock(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] }));
|
|
692
877
|
});
|
|
878
|
+
const renderIconBlock = (icon) => (jsx("div", { className: "w-[267px] min-w-[267px] self-center", children: icon?.src || icon?.icon ? jsx(Img, { image: icon }) : null }));
|
|
879
|
+
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" })] }));
|
|
880
|
+
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" })] }));
|
|
693
881
|
|
|
694
|
-
const
|
|
882
|
+
const DEFAULT_GAP = 14;
|
|
883
|
+
/*
|
|
884
|
+
Horizontal padding used on a container above SwipeListControl.
|
|
885
|
+
Same value used on a SwipeListControlChildren container to compensate it
|
|
886
|
+
and get rid of a clipping effect caused by overflow: hidden.
|
|
887
|
+
*/
|
|
888
|
+
const DEFAULT_PADDING = 16;
|
|
889
|
+
const SwipeListControl = JSX(({ className = '', gap = DEFAULT_GAP, padding = DEFAULT_PADDING, showDots = true, minHeight, children, onVisibleIndicesChange, listType = 'horizontal-list', version, }) => {
|
|
890
|
+
const itemCount = Array.isArray(children) ? children.length : 0;
|
|
891
|
+
const [containerRef, scroll] = useSwipeListScroll({
|
|
892
|
+
itemCount,
|
|
893
|
+
onVisibleIndicesChange,
|
|
894
|
+
});
|
|
895
|
+
const [activeIndex] = scroll.visibleIndicesRange;
|
|
896
|
+
return (jsxs("div", { className: style(className, listType === 'vertical-list' ? 'relative h-full' : ''), children: [jsx(SwipeListContainer, { containerRef: containerRef, activeIndex: activeIndex, visibleItemCount: 1, gap: gap, padding: padding, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, listType: listType, minHeight: minHeight, children: children }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: activeIndex, dotCount: itemCount, listType: listType, version: version })) : null] }));
|
|
897
|
+
});
|
|
898
|
+
|
|
899
|
+
const GRADIENT = 'bg-gradient-to-r from-main-gradient-start to-main-gradient-end';
|
|
900
|
+
const DIVIDER_CLASSES = 'border-main-divider border border-t-0 border-x-0';
|
|
695
901
|
|
|
696
902
|
const headingStyle = (isFillGradient = false) => (isFillGradient ? 'text-white' : '');
|
|
697
903
|
const subtitleStyle = (isFillGradient = false) => `text-s mb-3.5 ${isFillGradient ? 'text-white' : 'text-secondary-text/80'}`;
|
|
@@ -817,37 +1023,6 @@
|
|
|
817
1023
|
return data || {};
|
|
818
1024
|
}
|
|
819
1025
|
|
|
820
|
-
const blockRouterEventBus = new EventBus();
|
|
821
|
-
|
|
822
|
-
function useBlockIntersectionObserver(block) {
|
|
823
|
-
const observerCallback = useCallback((entries) => {
|
|
824
|
-
if (!block || !entries?.length) {
|
|
825
|
-
return;
|
|
826
|
-
}
|
|
827
|
-
const intersection = entries[entries.length - 1];
|
|
828
|
-
blockRouterEventBus.fire('intersection', { block, intersection });
|
|
829
|
-
}, [block]);
|
|
830
|
-
return useIntersectionObserver(observerCallback, { sensitivity: 1 });
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
const blockStyles = {
|
|
834
|
-
primary: 'bg-white text-primary-text',
|
|
835
|
-
secondary: 'bg-primary-main text-white',
|
|
836
|
-
gray: 'bg-main-divider text-primary-text',
|
|
837
|
-
transparent: 'bg-transparent text-primary-text',
|
|
838
|
-
'': '',
|
|
839
|
-
};
|
|
840
|
-
const BlockWrapper = JSX(({ className = '', version = 'primary', isTheme = true, block, tag = 'section', role, children, }) => {
|
|
841
|
-
const Tag = tag;
|
|
842
|
-
const ref = useBlockIntersectionObserver(block);
|
|
843
|
-
const [isHidden, setHidden] = useState(false);
|
|
844
|
-
useEffect(() => defaultEventBus.subscribe('tab', (event) => {
|
|
845
|
-
setHidden(Boolean(event.label && block?.labels?.length && !block.labels.includes(event.label)));
|
|
846
|
-
}), [block]);
|
|
847
|
-
return (jsx(Tag, { className: style(groupStyle(Boolean(version && isTheme)), blockStyles[version], isHidden ? 'hidden' : '', className), ...(version && isTheme ? { 'data-ver': version } : {}), ...(block?.anchor ? { id: block.anchor, ref } : {}), role: role, children: children }));
|
|
848
|
-
});
|
|
849
|
-
const groupStyle = (isGroup) => (isGroup ? 'group' : '');
|
|
850
|
-
|
|
851
1026
|
const CloseButton = JSX(({ className, onClick }) => (jsx("button", { className: style('flex justify-center items-center w-12 h-12 p-1 bg-transparent border-none', className), onClick: onClick, title: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C", children: jsx(Img, { image: { icon: 'CloseIcon' }, width: "24", height: "24" }) })));
|
|
852
1027
|
|
|
853
1028
|
function assertUnreachable(x) {
|
|
@@ -1180,50 +1355,6 @@
|
|
|
1180
1355
|
return (jsx("div", { className: `col-span-12 rounded-md cursor-pointer p-4 mt-6 mb-6 bg-secondary-light font-sans ${className}`, children: href ? (jsxs("div", { className: "flex", children: [jsx("div", { className: "flex justify-center align-middle rounded-md bg-primary-main w-12 h-12", children: jsx(Logo, { className: "w-8", bgColor: "transparent", showTitle: true }) }), jsxs("a", { href: href, target: "_blank", className: "flex flex-col justify-center pl-3", children: [jsx("div", { className: "text-s font-medium mb-[3px]", children: title }), jsx("div", { className: "text-s text-secondary-text", children: description })] })] })) : null }));
|
|
1181
1356
|
});
|
|
1182
1357
|
|
|
1183
|
-
const DEFAULT_SLOT_NAME = null;
|
|
1184
|
-
|
|
1185
|
-
const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
|
|
1186
|
-
|
|
1187
|
-
const DEFAULT_ANCESTORS = [];
|
|
1188
|
-
const defaultStyle = 'col-span-12';
|
|
1189
|
-
function renderBlock(block, options, { className, ...extraProps } = {}) {
|
|
1190
|
-
const { key, blockDecorator = defaultBlockDecorator, blocksRegistry = {}, ancestors = DEFAULT_ANCESTORS, } = options;
|
|
1191
|
-
const { type } = block;
|
|
1192
|
-
if (!(type && type in blocksRegistry)) {
|
|
1193
|
-
console.warn(`No block with "${type}" is registered`);
|
|
1194
|
-
}
|
|
1195
|
-
const BlockComponent = type && blocksRegistry[type];
|
|
1196
|
-
return blockDecorator({
|
|
1197
|
-
blockClassName: style('scroll-mt-12', // TODO scroll-mt-12 ? here?
|
|
1198
|
-
className, block.style || defaultStyle),
|
|
1199
|
-
block,
|
|
1200
|
-
ancestors,
|
|
1201
|
-
// Adjusted by decorator block and blockClassName
|
|
1202
|
-
render: ({ block: adjustedBlock, blockClassName: adjustedBlockClassName }) => {
|
|
1203
|
-
const { content } = adjustedBlock;
|
|
1204
|
-
return BlockComponent ? (jsx(BlockComponent, { className: adjustedBlockClassName, block: block, options: options, ...content, ...extraProps }, key)) : null;
|
|
1205
|
-
},
|
|
1206
|
-
}, key);
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
const EMPTY_ANCESTORS = [];
|
|
1210
|
-
const renderBlocksList = (blocks, { key, ancestors = EMPTY_ANCESTORS, slotName = DEFAULT_SLOT_NAME, renderProps = renderBlock, ...options }) => (blocks || []).map((_, j) => renderProps(_, {
|
|
1211
|
-
...options,
|
|
1212
|
-
key: `${key ? key : _.type}-${j}`,
|
|
1213
|
-
ancestors: options.parent
|
|
1214
|
-
? [...(ancestors || EMPTY_ANCESTORS), [options.parent, slotName]]
|
|
1215
|
-
: ancestors,
|
|
1216
|
-
}));
|
|
1217
|
-
|
|
1218
|
-
function renderChildren({ children, block, options, renderProps, }) {
|
|
1219
|
-
if (children) {
|
|
1220
|
-
return children;
|
|
1221
|
-
}
|
|
1222
|
-
return block && options
|
|
1223
|
-
? renderBlocksList(block.blocks, { ...options, parent: block, renderProps })
|
|
1224
|
-
: null;
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
1358
|
const DefaultFoldButton = JSX(({ className = '', label, icon, dataTheme = '', disabled = false, onClick }) => {
|
|
1228
1359
|
return (jsxs("button", { className: style('flex justify-center w-full px-0 py-5 border border-transparent outline-none focus:border-primary-text', disabled
|
|
1229
1360
|
? 'bg-main-divider text-main-disabled hover:bg-main-divider'
|
|
@@ -1233,30 +1364,6 @@
|
|
|
1233
1364
|
}, className: "flex-shrink-0 my-auto", width: "20", height: "20" })) : null] }));
|
|
1234
1365
|
});
|
|
1235
1366
|
|
|
1236
|
-
const Foldable = JSX(({ className = '', isFoldButtonOnTop = false, unfoldedByDefault = false, renderFoldableSection, renderFoldButton, }) => {
|
|
1237
|
-
const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
|
|
1238
|
-
const onToggle = useCallback(() => {
|
|
1239
|
-
setIsUnfolded((_) => !_);
|
|
1240
|
-
}, []);
|
|
1241
|
-
const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
|
|
1242
|
-
const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
|
|
1243
|
-
return isFoldButtonOnTop ? (jsxs("div", { className: className, children: [buttonNode, sectionNode] })) : (jsxs("div", { className: className, children: [sectionNode, buttonNode] }));
|
|
1244
|
-
});
|
|
1245
|
-
|
|
1246
|
-
const FoldableSection = JSX(({ className = '', isUnfolded, children }) => {
|
|
1247
|
-
const containerRef = useRef(null);
|
|
1248
|
-
useEffect(() => {
|
|
1249
|
-
if (containerRef.current) {
|
|
1250
|
-
containerRef.current.style.maxHeight = isUnfolded
|
|
1251
|
-
? `${containerRef.current.scrollHeight}px`
|
|
1252
|
-
: '';
|
|
1253
|
-
}
|
|
1254
|
-
}, [isUnfolded, children?.length]);
|
|
1255
|
-
return (jsx("div", { ref: containerRef, className: `transition-max-h duration-300 overflow-hidden ${containerRef.current || !isUnfolded ? 'max-h-0' : ''} ${className}`, children: children }));
|
|
1256
|
-
});
|
|
1257
|
-
|
|
1258
|
-
const Text = JSX(({ children, ...style }) => (jsx("span", { className: ['font-sans', ...Object.values(style)].join(' '), children: children })));
|
|
1259
|
-
|
|
1260
1367
|
const RollupItem = JSX(({ className = '', label = 'Развернуть', isExpanded, isFoldButtonOnTop = true, version = 'primary', ...rest }) => {
|
|
1261
1368
|
return (jsx(BlockWrapper, { className: style('border-b border-solid border-main-divider w-full', className), tag: "div", version: "transparent", ...rest, children: jsx(Foldable, { isFoldButtonOnTop: isFoldButtonOnTop, unfoldedByDefault: isExpanded, renderFoldableSection: ({ isUnfolded }) => (jsx(FoldableSection, { className: "flex flex-wrap group-last:last:pb-0 gap-5 [&>*]:p-0", isUnfolded: isUnfolded, children: renderChildren(rest) })), renderFoldButton: ({ isUnfolded, onToggle }) => renderFoldButton({ version, label, isUnfolded, onToggle }) }) }));
|
|
1262
1369
|
});
|
|
@@ -1461,45 +1568,44 @@
|
|
|
1461
1568
|
return (jsxs(BlockWrapper, { tag: "header", version: version, ...rest, children: [jsxs("div", { className: "container px-4 py-0 box-border", children: [jsx(HeaderTop, { onClick: handleBurgerMenuShow, bgColor: bgColor, logo: logo }), jsx("nav", { className: "flex items-center m-0 p-0 overflow-y-hidden w-full h-12", children: jsx("div", { className: "flex no-scrollbar horizontal-list h-full items-center", children: subItems?.map((_, i) => (jsx(HeaderItem, { className: "mr-8 whitespace-nowrap text-s", active: _ === activeSubItem, ..._ }, String(i)))) }) })] }), burgerMenuShow ? (jsx(HeaderBurger, { onClick: handleBurgerMenuShow, burgerSubMenu: dispositions, defaultLocation: defaultLocation, children: jsx("div", { className: "list-none m-0 p-0", children: topItems?.map((item, i) => (jsx(RollupItem, { label: item.text, children: jsx(LinkList, { documents: item.items }) }, String(i)))) }) })) : null] }));
|
|
1462
1569
|
});
|
|
1463
1570
|
|
|
1464
|
-
const Paragraph = JSX(({ children, ...style }) => (jsx("p", { className: ['font-sans', ...Object.values(style)].join(' '), children: children })));
|
|
1465
|
-
|
|
1466
1571
|
const headlineVersionStyles = {
|
|
1467
1572
|
XXL: {
|
|
1468
|
-
wrapper: 'gap-[18px]',
|
|
1469
1573
|
title: { headingType: 'h0', as: 'h1' },
|
|
1470
1574
|
descriptionSize: 'text-h5',
|
|
1575
|
+
descriptionStyle: 'mt-5',
|
|
1471
1576
|
},
|
|
1472
1577
|
XL: {
|
|
1473
|
-
wrapper: 'gap-4',
|
|
1474
1578
|
title: { headingType: 'h1', as: 'h1' },
|
|
1475
1579
|
descriptionSize: 'text-xl-light',
|
|
1580
|
+
descriptionStyle: 'mt-4',
|
|
1476
1581
|
},
|
|
1477
1582
|
L: {
|
|
1478
|
-
wrapper: 'gap-4',
|
|
1479
1583
|
title: { headingType: 'h2', as: 'h2' },
|
|
1480
1584
|
descriptionSize: 'text-xl-light',
|
|
1585
|
+
descriptionStyle: 'mt-4',
|
|
1481
1586
|
},
|
|
1482
1587
|
M: {
|
|
1483
|
-
wrapper: 'gap-3',
|
|
1484
1588
|
title: { headingType: 'h3', as: 'h3' },
|
|
1485
1589
|
descriptionSize: 'text-xl-light',
|
|
1590
|
+
descriptionStyle: 'mt-3',
|
|
1486
1591
|
},
|
|
1487
1592
|
S: {
|
|
1488
|
-
wrapper: 'gap-2',
|
|
1489
1593
|
title: { headingType: 'h4', as: 'h4' },
|
|
1490
1594
|
descriptionSize: 'text-xl-light',
|
|
1595
|
+
descriptionStyle: 'mt-2',
|
|
1491
1596
|
},
|
|
1492
1597
|
XS: {
|
|
1493
|
-
wrapper: 'gap-2',
|
|
1494
1598
|
title: { headingType: 'h5', as: 'h5' },
|
|
1495
1599
|
descriptionSize: 'text-l-light',
|
|
1600
|
+
descriptionStyle: 'mt-2',
|
|
1496
1601
|
},
|
|
1497
1602
|
};
|
|
1498
1603
|
|
|
1499
1604
|
const Headline = JSX(({ className, title, description, headlineVersion = 'XL', align = 'text-center', as, isPadding = true, isTheme = false, version = '', ...rest }) => {
|
|
1500
1605
|
const versionStyle = headlineVersionStyles[headlineVersion];
|
|
1501
1606
|
const paddingStyle = isPadding ? 'p-default' : '';
|
|
1502
|
-
|
|
1607
|
+
const descriptionStyle = { marginTop: versionStyle.descriptionStyle };
|
|
1608
|
+
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] }));
|
|
1503
1609
|
});
|
|
1504
1610
|
|
|
1505
1611
|
const ImgBlock = JSX((props) => {
|
|
@@ -1582,16 +1688,6 @@
|
|
|
1582
1688
|
const renderShimmerItem = (width, index) => (jsx("div", { style: { width: `${width || 100}%` }, className: "h-4 mt-2 bg-secondary-light" }, String(index)));
|
|
1583
1689
|
const goldenSequence = (first, size) => [first].concat(size > 0 ? goldenSequence(first / GOLDEN_RATIO, size - 1) : []);
|
|
1584
1690
|
|
|
1585
|
-
const renderButtonsSection = (buttons, { className = '', buttonClassName, isVertical } = {}) => buttons?.length && buttons.some((_) => _?.text || _?.icon?.icon) ? (jsx("div", { className: style('flex', isVertical ? 'flex-col gap-2' : 'gap-4', className), children: buttons.map(renderButton(buttonClassName)) })) : null;
|
|
1586
|
-
const renderButton = (buttonClassName = '') => (button, index) => {
|
|
1587
|
-
const { text, icon, iconRight, version, ...rest } = button || {};
|
|
1588
|
-
const iconVersionDefault = version === 'secondary' ? 'color' : 'white';
|
|
1589
|
-
const iconVersion = icon?.iconVersion ? icon?.iconVersion : iconVersionDefault;
|
|
1590
|
-
return text || icon?.icon ? (jsx(Button, { className: buttonClassName, appendLeft: renderButtonIcon({ ...icon, iconVersion }), appendRight: renderButtonIcon({ ...iconRight, iconVersion }), version: version, text: text, ...rest }, index ? String(index) : '')) : null;
|
|
1591
|
-
};
|
|
1592
|
-
const DEFAULT_ICON_W = 24;
|
|
1593
|
-
const renderButtonIcon = (icon) => icon?.icon || icon?.src ? (jsx(Img, { image: icon, width: String(icon?.size?.width || DEFAULT_ICON_W), height: String(DEFAULT_ICON_W) })) : null;
|
|
1594
|
-
|
|
1595
1691
|
const DOT_SIZE_MAP = {
|
|
1596
1692
|
L: 'w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-4',
|
|
1597
1693
|
M: 'w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-3',
|
|
@@ -1786,6 +1882,8 @@
|
|
|
1786
1882
|
VerticalLayout.childrenTypes = [];
|
|
1787
1883
|
|
|
1788
1884
|
const Blocks = {
|
|
1885
|
+
Carousel,
|
|
1886
|
+
CarouselTariffsCard,
|
|
1789
1887
|
ComparisonTable,
|
|
1790
1888
|
Footer,
|
|
1791
1889
|
Header,
|
|
@@ -1955,7 +2053,7 @@
|
|
|
1955
2053
|
return (list) => list.reduce((acc, el, i) => (acc.length ? acc.concat({ ...sep, key: i }, el) : [el]), []);
|
|
1956
2054
|
}
|
|
1957
2055
|
|
|
1958
|
-
const packageVersion = "0.10.
|
|
2056
|
+
const packageVersion = "0.10.7";
|
|
1959
2057
|
|
|
1960
2058
|
exports.Blocks = Blocks;
|
|
1961
2059
|
exports.ContentPage = ContentPage;
|