@redneckz/wildless-cms-uni-blocks 0.3.9 → 0.3.12
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/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +154 -76
- package/bundle/bundle.umd.min.js +1 -1
- package/cosmos-static/icons/GpsIcon.svg +1 -0
- package/dist/components/BaseTile/BaseTile.js +1 -1
- package/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/dist/components/Blocks.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/ComparisonTable/ComparisonTable.mobile.d.ts +5 -0
- package/dist/components/ComparisonTable/ComparisonTable.mobile.js +46 -0
- package/dist/components/ComparisonTable/ComparisonTable.mobile.js.map +1 -0
- package/dist/components/ComparisonTable/ComparisonTableContent.d.ts +4 -0
- package/dist/components/ComparisonTable/HeaderCell.mobile.d.ts +12 -0
- package/dist/components/ComparisonTable/HeaderCell.mobile.js +9 -0
- package/dist/components/ComparisonTable/HeaderCell.mobile.js.map +1 -0
- package/dist/components/ComparisonTable/TableCell.d.ts +3 -2
- package/dist/components/ComparisonTable/TableCell.js.map +1 -1
- package/dist/components/ComparisonTable/TableCell.mobile.d.ts +9 -0
- package/dist/components/ComparisonTable/TableCell.mobile.js +12 -0
- package/dist/components/ComparisonTable/TableCell.mobile.js.map +1 -0
- package/dist/components/ComparisonTable/TableColumn.d.ts +10 -0
- package/dist/components/ComparisonTable/TableColumn.js +19 -0
- package/dist/components/ComparisonTable/TableColumn.js.map +1 -0
- package/dist/components/ContentPage/ContentPageContext.d.ts +1 -1
- package/dist/components/CreditCalculator/CreditCalculator.d.ts +2 -2
- package/dist/components/CreditCalculator/CreditCalculator.js +18 -22
- package/dist/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/dist/components/CreditCalculator/getCalculatorParams.d.ts +1 -1
- package/dist/components/CreditCalculator/getCreditRate.d.ts +1 -1
- package/dist/components/CreditCalculator/getDefaultMonths.d.ts +2 -0
- package/dist/components/CreditCalculator/getDefaultMonths.js +8 -0
- package/dist/components/CreditCalculator/getDefaultMonths.js.map +1 -0
- package/dist/components/CreditCalculator/getDefaultSum.d.ts +2 -0
- package/dist/components/CreditCalculator/getDefaultSum.js +8 -0
- package/dist/components/CreditCalculator/getDefaultSum.js.map +1 -0
- package/dist/components/CreditCalculator/getMonthlyPayment.d.ts +1 -1
- package/dist/components/CreditCalculator/renderButton.d.ts +1 -0
- package/dist/components/CreditCalculator/renderButton.js +8 -0
- package/dist/components/CreditCalculator/renderButton.js.map +1 -0
- package/dist/components/CreditCalculator/renderMonthsInput.d.ts +10 -0
- package/dist/components/CreditCalculator/renderMonthsInput.js +11 -0
- package/dist/components/CreditCalculator/renderMonthsInput.js.map +1 -0
- package/dist/components/CreditCalculator/renderProposal.d.ts +1 -0
- package/dist/components/CreditCalculator/renderProposal.js +9 -0
- package/dist/components/CreditCalculator/renderProposal.js.map +1 -0
- package/dist/components/CreditCalculator/renderTermsButton.d.ts +1 -0
- package/dist/components/CreditCalculator/renderTermsButton.js +9 -0
- package/dist/components/CreditCalculator/renderTermsButton.js.map +1 -0
- package/dist/components/CreditCalculator/renderWantedSumInput.d.ts +10 -0
- package/dist/components/CreditCalculator/renderWantedSumInput.js +18 -0
- package/dist/components/CreditCalculator/renderWantedSumInput.js.map +1 -0
- package/dist/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/dist/components/ExchangeRateTile/CurrencyTable.js +19 -0
- package/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
- package/dist/components/ExchangeRateTile/CurrentLocation.d.ts +7 -0
- package/dist/components/ExchangeRateTile/CurrentLocation.js +7 -0
- package/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -0
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -0
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js +23 -27
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +10 -0
- package/dist/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/dist/components/ExchangeRateTile/formatCurrency.js +6 -0
- package/dist/components/ExchangeRateTile/formatCurrency.js.map +1 -0
- package/dist/components/Gallery/Gallery.mobile.js +2 -2
- package/dist/components/Gallery/Gallery.mobile.js.map +1 -1
- package/dist/components/Header/Header.mobile.js +1 -1
- package/dist/components/Header/Header.mobile.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.js +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.mobile.js +1 -1
- package/dist/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
- package/dist/hooks/useCreditCalculatorData.js +3 -3
- package/dist/hooks/useCreditCalculatorData.js.map +1 -1
- package/dist/hooks/useExchangeRates.d.ts +9 -0
- package/dist/hooks/useExchangeRates.js +18 -0
- package/dist/hooks/useExchangeRates.js.map +1 -0
- package/dist/icons/IconName.d.ts +3 -2
- package/dist/icons/IconName.js +1 -0
- package/dist/icons/IconName.js.map +1 -1
- package/dist/model/InputTypes.d.ts +1 -0
- package/dist/model/InputTypes.js +2 -0
- package/dist/model/InputTypes.js.map +1 -0
- package/dist/setup-fixture.js +1 -1
- package/dist/setup-fixture.js.map +1 -1
- package/dist/ui-kit/Input/Input.d.ts +2 -0
- package/dist/ui-kit/Input/Input.js +8 -0
- package/dist/ui-kit/Input/Input.js.map +1 -0
- package/dist/ui-kit/Input/InputProps.d.ts +8 -0
- package/dist/ui-kit/Input/InputProps.js +2 -0
- package/dist/ui-kit/Input/InputProps.js.map +1 -0
- package/dist/ui-kit/Select/Select.d.ts +6 -0
- package/dist/ui-kit/Select/Select.js +8 -0
- package/dist/ui-kit/Select/Select.js.map +1 -0
- package/dist/ui-kit/Select/SelectOption.d.ts +5 -0
- package/dist/ui-kit/Select/SelectOption.js +8 -0
- package/dist/ui-kit/Select/SelectOption.js.map +1 -0
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js +11 -6
- package/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +1 -0
- package/lib/common.css +1 -1
- package/lib/components/BaseTile/BaseTile.js +1 -1
- package/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/lib/components/Blocks.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/ComparisonTable/ComparisonTable.fixture.mobile.d.ts +5 -0
- package/lib/components/ComparisonTable/ComparisonTable.mobile.d.ts +5 -0
- package/lib/components/ComparisonTable/ComparisonTable.mobile.js +44 -0
- package/lib/components/ComparisonTable/ComparisonTable.mobile.js.map +1 -0
- package/lib/components/ComparisonTable/ComparisonTableContent.d.ts +4 -0
- package/lib/components/ComparisonTable/HeaderCell.mobile.d.ts +12 -0
- package/lib/components/ComparisonTable/HeaderCell.mobile.js +7 -0
- package/lib/components/ComparisonTable/HeaderCell.mobile.js.map +1 -0
- package/lib/components/ComparisonTable/TableCell.d.ts +3 -2
- package/lib/components/ComparisonTable/TableCell.js.map +1 -1
- package/lib/components/ComparisonTable/TableCell.mobile.d.ts +9 -0
- package/lib/components/ComparisonTable/TableCell.mobile.js +10 -0
- package/lib/components/ComparisonTable/TableCell.mobile.js.map +1 -0
- package/lib/components/ComparisonTable/TableColumn.d.ts +10 -0
- package/lib/components/ComparisonTable/TableColumn.js +17 -0
- package/lib/components/ComparisonTable/TableColumn.js.map +1 -0
- package/lib/components/ContentPage/ContentPageContext.d.ts +1 -1
- package/lib/components/CreditCalculator/CreditCalculator.d.ts +2 -2
- package/lib/components/CreditCalculator/CreditCalculator.js +19 -23
- package/lib/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/lib/components/CreditCalculator/getCalculatorParams.d.ts +1 -1
- package/lib/components/CreditCalculator/getCreditRate.d.ts +1 -1
- package/lib/components/CreditCalculator/getDefaultMonths.d.ts +2 -0
- package/lib/components/CreditCalculator/getDefaultMonths.js +5 -0
- package/lib/components/CreditCalculator/getDefaultMonths.js.map +1 -0
- package/lib/components/CreditCalculator/getDefaultSum.d.ts +2 -0
- package/lib/components/CreditCalculator/getDefaultSum.js +5 -0
- package/lib/components/CreditCalculator/getDefaultSum.js.map +1 -0
- package/lib/components/CreditCalculator/getMonthlyPayment.d.ts +1 -1
- package/lib/components/CreditCalculator/renderButton.d.ts +1 -0
- package/lib/components/CreditCalculator/renderButton.js +5 -0
- package/lib/components/CreditCalculator/renderButton.js.map +1 -0
- package/lib/components/CreditCalculator/renderMonthsInput.d.ts +10 -0
- package/lib/components/CreditCalculator/renderMonthsInput.js +8 -0
- package/lib/components/CreditCalculator/renderMonthsInput.js.map +1 -0
- package/lib/components/CreditCalculator/renderProposal.d.ts +1 -0
- package/lib/components/CreditCalculator/renderProposal.js +6 -0
- package/lib/components/CreditCalculator/renderProposal.js.map +1 -0
- package/lib/components/CreditCalculator/renderTermsButton.d.ts +1 -0
- package/lib/components/CreditCalculator/renderTermsButton.js +6 -0
- package/lib/components/CreditCalculator/renderTermsButton.js.map +1 -0
- package/lib/components/CreditCalculator/renderWantedSumInput.d.ts +10 -0
- package/lib/components/CreditCalculator/renderWantedSumInput.js +15 -0
- package/lib/components/CreditCalculator/renderWantedSumInput.js.map +1 -0
- package/lib/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/lib/components/ExchangeRateTile/CurrencyTable.js +17 -0
- package/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
- package/lib/components/ExchangeRateTile/CurrentLocation.d.ts +7 -0
- package/lib/components/ExchangeRateTile/CurrentLocation.js +5 -0
- package/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -0
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +13 -0
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js +23 -27
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +10 -0
- package/lib/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/lib/components/ExchangeRateTile/formatCurrency.js +3 -0
- package/lib/components/ExchangeRateTile/formatCurrency.js.map +1 -0
- package/lib/components/Gallery/Gallery.mobile.js +2 -2
- package/lib/components/Gallery/Gallery.mobile.js.map +1 -1
- package/lib/components/Header/Header.mobile.js +1 -1
- package/lib/components/Header/Header.mobile.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlock.fixture.mobile.d.ts +2 -1
- package/lib/components/ProductBlock/ProductBlockInner.js +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.mobile.js +1 -1
- package/lib/components/ProductBlock/ProductBlockInner.mobile.js.map +1 -1
- package/lib/hooks/useCreditCalculatorData.js +3 -3
- package/lib/hooks/useCreditCalculatorData.js.map +1 -1
- package/lib/hooks/useExchangeRates.d.ts +9 -0
- package/lib/hooks/useExchangeRates.js +15 -0
- package/lib/hooks/useExchangeRates.js.map +1 -0
- package/lib/icons/IconName.d.ts +3 -2
- package/lib/icons/IconName.js +1 -0
- package/lib/icons/IconName.js.map +1 -1
- package/lib/model/InputTypes.d.ts +1 -0
- package/lib/model/InputTypes.js +2 -0
- package/lib/model/InputTypes.js.map +1 -0
- package/lib/setup-fixture.js +1 -1
- package/lib/setup-fixture.js.map +1 -1
- package/lib/ui-kit/Input/Input.d.ts +2 -0
- package/lib/ui-kit/Input/Input.js +6 -0
- package/lib/ui-kit/Input/Input.js.map +1 -0
- package/lib/ui-kit/Input/InputProps.d.ts +8 -0
- package/lib/ui-kit/Input/InputProps.js +2 -0
- package/lib/ui-kit/Input/InputProps.js.map +1 -0
- package/lib/ui-kit/Select/Select.d.ts +6 -0
- package/lib/ui-kit/Select/Select.js +6 -0
- package/lib/ui-kit/Select/Select.js.map +1 -0
- package/lib/ui-kit/Select/SelectOption.d.ts +5 -0
- package/lib/ui-kit/Select/SelectOption.js +6 -0
- package/lib/ui-kit/Select/SelectOption.js.map +1 -0
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js +12 -7
- package/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +1 -0
- package/mobile/bundle/bundle.umd.js +136 -83
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/BaseTile/BaseTile.js +1 -1
- package/mobile/dist/components/BaseTile/BaseTile.js.map +1 -1
- package/mobile/dist/components/ComparisonTable/ComparisonTable.js +38 -28
- package/mobile/dist/components/ComparisonTable/ComparisonTable.js.map +1 -1
- package/mobile/dist/components/ComparisonTable/ComparisonTableContent.d.ts +4 -0
- package/mobile/dist/components/ComparisonTable/HeaderCell.d.ts +2 -0
- package/mobile/dist/components/ComparisonTable/HeaderCell.js +1 -3
- package/mobile/dist/components/ComparisonTable/HeaderCell.js.map +1 -1
- package/mobile/dist/components/ComparisonTable/TableCell.d.ts +4 -3
- package/mobile/dist/components/ComparisonTable/TableCell.js +5 -5
- package/mobile/dist/components/ComparisonTable/TableCell.js.map +1 -1
- package/mobile/dist/components/ComparisonTable/TableColumn.d.ts +10 -0
- package/mobile/dist/components/ComparisonTable/TableColumn.js +19 -0
- package/mobile/dist/components/ComparisonTable/TableColumn.js.map +1 -0
- package/mobile/dist/components/ContentPage/ContentPageContext.d.ts +1 -1
- package/mobile/dist/components/CreditCalculator/CreditCalculator.d.ts +2 -2
- package/mobile/dist/components/CreditCalculator/CreditCalculator.js +18 -22
- package/mobile/dist/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/mobile/dist/components/CreditCalculator/getCalculatorParams.d.ts +1 -1
- package/mobile/dist/components/CreditCalculator/getCreditRate.d.ts +1 -1
- package/mobile/dist/components/CreditCalculator/getDefaultMonths.d.ts +2 -0
- package/mobile/dist/components/CreditCalculator/getDefaultMonths.js +8 -0
- package/mobile/dist/components/CreditCalculator/getDefaultMonths.js.map +1 -0
- package/mobile/dist/components/CreditCalculator/getDefaultSum.d.ts +2 -0
- package/mobile/dist/components/CreditCalculator/getDefaultSum.js +8 -0
- package/mobile/dist/components/CreditCalculator/getDefaultSum.js.map +1 -0
- package/mobile/dist/components/CreditCalculator/getMonthlyPayment.d.ts +1 -1
- package/mobile/dist/components/CreditCalculator/renderButton.d.ts +1 -0
- package/mobile/dist/components/CreditCalculator/renderButton.js +8 -0
- package/mobile/dist/components/CreditCalculator/renderButton.js.map +1 -0
- package/mobile/dist/components/CreditCalculator/renderMonthsInput.d.ts +10 -0
- package/mobile/dist/components/CreditCalculator/renderMonthsInput.js +11 -0
- package/mobile/dist/components/CreditCalculator/renderMonthsInput.js.map +1 -0
- package/mobile/dist/components/CreditCalculator/renderProposal.d.ts +1 -0
- package/mobile/dist/components/CreditCalculator/renderProposal.js +9 -0
- package/mobile/dist/components/CreditCalculator/renderProposal.js.map +1 -0
- package/mobile/dist/components/CreditCalculator/renderTermsButton.d.ts +1 -0
- package/mobile/dist/components/CreditCalculator/renderTermsButton.js +9 -0
- package/mobile/dist/components/CreditCalculator/renderTermsButton.js.map +1 -0
- package/mobile/dist/components/CreditCalculator/renderWantedSumInput.d.ts +10 -0
- package/mobile/dist/components/CreditCalculator/renderWantedSumInput.js +18 -0
- package/mobile/dist/components/CreditCalculator/renderWantedSumInput.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js +19 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/CurrentLocation.d.ts +7 -0
- package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js +7 -0
- package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +15 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +23 -27
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +10 -0
- package/mobile/dist/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/mobile/dist/components/ExchangeRateTile/formatCurrency.js +6 -0
- package/mobile/dist/components/ExchangeRateTile/formatCurrency.js.map +1 -0
- package/mobile/dist/components/Gallery/Gallery.js +2 -2
- package/mobile/dist/components/Gallery/Gallery.js.map +1 -1
- package/mobile/dist/components/Header/Header.js +1 -1
- package/mobile/dist/components/Header/Header.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockInner.js +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/mobile/dist/hooks/useCreditCalculatorData.js +3 -3
- package/mobile/dist/hooks/useCreditCalculatorData.js.map +1 -1
- package/mobile/dist/hooks/useExchangeRates.d.ts +9 -0
- package/mobile/dist/hooks/useExchangeRates.js +18 -0
- package/mobile/dist/hooks/useExchangeRates.js.map +1 -0
- package/mobile/dist/icons/IconName.d.ts +3 -2
- package/mobile/dist/icons/IconName.js +1 -0
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/model/InputTypes.d.ts +1 -0
- package/mobile/dist/model/InputTypes.js +2 -0
- package/mobile/dist/model/InputTypes.js.map +1 -0
- package/mobile/dist/setup-fixture.js +1 -1
- package/mobile/dist/setup-fixture.js.map +1 -1
- package/mobile/dist/ui-kit/Input/Input.d.ts +2 -0
- package/mobile/dist/ui-kit/Input/Input.js +8 -0
- package/mobile/dist/ui-kit/Input/Input.js.map +1 -0
- package/mobile/dist/ui-kit/Input/InputProps.d.ts +8 -0
- package/mobile/dist/ui-kit/Input/InputProps.js +2 -0
- package/mobile/dist/ui-kit/Input/InputProps.js.map +1 -0
- package/mobile/dist/ui-kit/Select/Select.d.ts +6 -0
- package/mobile/dist/ui-kit/Select/Select.js +8 -0
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -0
- package/mobile/dist/ui-kit/Select/SelectOption.d.ts +5 -0
- package/mobile/dist/ui-kit/Select/SelectOption.js +8 -0
- package/mobile/dist/ui-kit/Select/SelectOption.js.map +1 -0
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js +11 -6
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +1 -0
- package/mobile/lib/components/BaseTile/BaseTile.js +1 -1
- package/mobile/lib/components/BaseTile/BaseTile.js.map +1 -1
- package/mobile/lib/components/ComparisonTable/ComparisonTable.js +38 -28
- package/mobile/lib/components/ComparisonTable/ComparisonTable.js.map +1 -1
- package/mobile/lib/components/ComparisonTable/ComparisonTableContent.d.ts +4 -0
- package/mobile/lib/components/ComparisonTable/HeaderCell.d.ts +2 -0
- package/mobile/lib/components/ComparisonTable/HeaderCell.js +1 -3
- package/mobile/lib/components/ComparisonTable/HeaderCell.js.map +1 -1
- package/mobile/lib/components/ComparisonTable/TableCell.d.ts +4 -3
- package/mobile/lib/components/ComparisonTable/TableCell.js +6 -6
- package/mobile/lib/components/ComparisonTable/TableCell.js.map +1 -1
- package/mobile/lib/components/ComparisonTable/TableColumn.d.ts +10 -0
- package/mobile/lib/components/ComparisonTable/TableColumn.js +17 -0
- package/mobile/lib/components/ComparisonTable/TableColumn.js.map +1 -0
- package/mobile/lib/components/ContentPage/ContentPageContext.d.ts +1 -1
- package/mobile/lib/components/CreditCalculator/CreditCalculator.d.ts +2 -2
- package/mobile/lib/components/CreditCalculator/CreditCalculator.js +19 -23
- package/mobile/lib/components/CreditCalculator/CreditCalculator.js.map +1 -1
- package/mobile/lib/components/CreditCalculator/getCalculatorParams.d.ts +1 -1
- package/mobile/lib/components/CreditCalculator/getCreditRate.d.ts +1 -1
- package/mobile/lib/components/CreditCalculator/getDefaultMonths.d.ts +2 -0
- package/mobile/lib/components/CreditCalculator/getDefaultMonths.js +5 -0
- package/mobile/lib/components/CreditCalculator/getDefaultMonths.js.map +1 -0
- package/mobile/lib/components/CreditCalculator/getDefaultSum.d.ts +2 -0
- package/mobile/lib/components/CreditCalculator/getDefaultSum.js +5 -0
- package/mobile/lib/components/CreditCalculator/getDefaultSum.js.map +1 -0
- package/mobile/lib/components/CreditCalculator/getMonthlyPayment.d.ts +1 -1
- package/mobile/lib/components/CreditCalculator/renderButton.d.ts +1 -0
- package/mobile/lib/components/CreditCalculator/renderButton.js +5 -0
- package/mobile/lib/components/CreditCalculator/renderButton.js.map +1 -0
- package/mobile/lib/components/CreditCalculator/renderMonthsInput.d.ts +10 -0
- package/mobile/lib/components/CreditCalculator/renderMonthsInput.js +8 -0
- package/mobile/lib/components/CreditCalculator/renderMonthsInput.js.map +1 -0
- package/mobile/lib/components/CreditCalculator/renderProposal.d.ts +1 -0
- package/mobile/lib/components/CreditCalculator/renderProposal.js +6 -0
- package/mobile/lib/components/CreditCalculator/renderProposal.js.map +1 -0
- package/mobile/lib/components/CreditCalculator/renderTermsButton.d.ts +1 -0
- package/mobile/lib/components/CreditCalculator/renderTermsButton.js +6 -0
- package/mobile/lib/components/CreditCalculator/renderTermsButton.js.map +1 -0
- package/mobile/lib/components/CreditCalculator/renderWantedSumInput.d.ts +10 -0
- package/mobile/lib/components/CreditCalculator/renderWantedSumInput.js +15 -0
- package/mobile/lib/components/CreditCalculator/renderWantedSumInput.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js +17 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/CurrentLocation.d.ts +7 -0
- package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js +5 -0
- package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +7 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +13 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +23 -27
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +10 -0
- package/mobile/lib/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/mobile/lib/components/ExchangeRateTile/formatCurrency.js +3 -0
- package/mobile/lib/components/ExchangeRateTile/formatCurrency.js.map +1 -0
- package/mobile/lib/components/Gallery/Gallery.js +2 -2
- package/mobile/lib/components/Gallery/Gallery.js.map +1 -1
- package/mobile/lib/components/Header/Header.js +1 -1
- package/mobile/lib/components/Header/Header.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockInner.js +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
- package/mobile/lib/hooks/useCreditCalculatorData.js +3 -3
- package/mobile/lib/hooks/useCreditCalculatorData.js.map +1 -1
- package/mobile/lib/hooks/useExchangeRates.d.ts +9 -0
- package/mobile/lib/hooks/useExchangeRates.js +15 -0
- package/mobile/lib/hooks/useExchangeRates.js.map +1 -0
- package/mobile/lib/icons/IconName.d.ts +3 -2
- package/mobile/lib/icons/IconName.js +1 -0
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/model/InputTypes.d.ts +1 -0
- package/mobile/lib/model/InputTypes.js +2 -0
- package/mobile/lib/model/InputTypes.js.map +1 -0
- package/mobile/lib/setup-fixture.js +1 -1
- package/mobile/lib/setup-fixture.js.map +1 -1
- package/mobile/lib/ui-kit/Input/Input.d.ts +2 -0
- package/mobile/lib/ui-kit/Input/Input.js +6 -0
- package/mobile/lib/ui-kit/Input/Input.js.map +1 -0
- package/mobile/lib/ui-kit/Input/InputProps.d.ts +8 -0
- package/mobile/lib/ui-kit/Input/InputProps.js +2 -0
- package/mobile/lib/ui-kit/Input/InputProps.js.map +1 -0
- package/mobile/lib/ui-kit/Select/Select.d.ts +6 -0
- package/mobile/lib/ui-kit/Select/Select.js +6 -0
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -0
- package/mobile/lib/ui-kit/Select/SelectOption.d.ts +5 -0
- package/mobile/lib/ui-kit/Select/SelectOption.js +6 -0
- package/mobile/lib/ui-kit/Select/SelectOption.js.map +1 -0
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js +12 -7
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControl.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListControlProps.d.ts +1 -0
- package/mobile/src/common.css +12 -2
- package/mobile/src/components/BaseTile/BaseTile.tsx +1 -1
- package/mobile/src/components/ComparisonTable/ComparisonTable.tsx +90 -102
- package/mobile/src/components/ComparisonTable/ComparisonTableContent.ts +4 -0
- package/mobile/src/components/ComparisonTable/HeaderCell.tsx +34 -30
- package/mobile/src/components/ComparisonTable/TableCell.tsx +30 -27
- package/mobile/src/components/ComparisonTable/TableColumn.tsx +66 -0
- package/mobile/src/components/ContentPage/ContentPageContext.tsx +1 -1
- package/mobile/src/components/CreditCalculator/CreditCalculator.tsx +26 -87
- package/mobile/src/components/CreditCalculator/getCalculatorParams.ts +1 -1
- package/mobile/src/components/CreditCalculator/getCreditRate.ts +1 -1
- package/mobile/src/components/CreditCalculator/getDefaultMonths.ts +7 -0
- package/mobile/src/components/CreditCalculator/getDefaultSum.ts +7 -0
- package/mobile/src/components/CreditCalculator/getMonthlyPayment.ts +1 -1
- package/mobile/src/components/CreditCalculator/renderButton.tsx +13 -0
- package/mobile/src/components/CreditCalculator/renderMonthsInput.tsx +29 -0
- package/mobile/src/components/CreditCalculator/renderProposal.tsx +13 -0
- package/mobile/src/components/CreditCalculator/renderTermsButton.tsx +16 -0
- package/mobile/src/components/CreditCalculator/renderWantedSumInput.tsx +36 -0
- package/mobile/src/components/ExchangeRateTile/CurrencyTable.tsx +47 -0
- package/mobile/src/components/ExchangeRateTile/CurrentLocation.tsx +22 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +47 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +48 -79
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +11 -0
- package/mobile/src/components/ExchangeRateTile/formatCurrency.ts +3 -0
- package/mobile/src/components/Gallery/Gallery.tsx +2 -2
- package/mobile/src/components/Header/Header.tsx +1 -1
- package/mobile/src/components/ProductBlock/ProductBlock.example.json +11 -1
- package/mobile/src/components/ProductBlock/ProductBlockInner.tsx +5 -5
- package/mobile/src/hooks/useCreditCalculatorData.ts +3 -7
- package/mobile/src/hooks/useExchangeRates.ts +25 -0
- package/mobile/src/icons/GpsIcon.svg +8 -0
- package/mobile/src/icons/IconName.ts +3 -3
- package/mobile/src/model/InputTypes.ts +1 -0
- package/mobile/src/setup-fixture.ts +1 -1
- package/mobile/src/ui-kit/Input/Input.tsx +8 -0
- package/mobile/src/ui-kit/Input/InputProps.ts +9 -0
- package/mobile/src/ui-kit/Select/Select.tsx +15 -0
- package/mobile/src/ui-kit/Select/SelectOption.tsx +14 -0
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControl.tsx +27 -19
- package/mobile/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +1 -0
- package/package.json +1 -1
- package/src/common.css +12 -2
- package/src/components/BaseTile/BaseTile.tsx +1 -1
- package/src/components/Blocks.ts +2 -0
- package/src/components/ComparisonTable/ComparisonTable.fixture.mobile.tsx +152 -0
- package/src/components/ComparisonTable/ComparisonTable.mobile.tsx +121 -0
- package/src/components/ComparisonTable/ComparisonTableContent.ts +4 -0
- package/src/components/ComparisonTable/HeaderCell.mobile.tsx +50 -0
- package/src/components/ComparisonTable/TableCell.mobile.tsx +46 -0
- package/src/components/ComparisonTable/TableCell.tsx +3 -2
- package/src/components/ComparisonTable/TableColumn.tsx +66 -0
- package/src/components/ContentPage/ContentPageContext.tsx +1 -1
- package/src/components/CreditCalculator/CreditCalculator.tsx +26 -87
- package/src/components/CreditCalculator/getCalculatorParams.ts +1 -1
- package/src/components/CreditCalculator/getCreditRate.ts +1 -1
- package/src/components/CreditCalculator/getDefaultMonths.ts +7 -0
- package/src/components/CreditCalculator/getDefaultSum.ts +7 -0
- package/src/components/CreditCalculator/getMonthlyPayment.ts +1 -1
- package/src/components/CreditCalculator/renderButton.tsx +13 -0
- package/src/components/CreditCalculator/renderMonthsInput.tsx +29 -0
- package/src/components/CreditCalculator/renderProposal.tsx +13 -0
- package/src/components/CreditCalculator/renderTermsButton.tsx +16 -0
- package/src/components/CreditCalculator/renderWantedSumInput.tsx +36 -0
- package/src/components/ExchangeRateTile/CurrencyTable.tsx +47 -0
- package/src/components/ExchangeRateTile/CurrentLocation.tsx +22 -0
- package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +47 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.tsx +1 -1
- package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +48 -79
- package/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +11 -0
- package/src/components/ExchangeRateTile/formatCurrency.ts +3 -0
- package/src/components/Gallery/Gallery.mobile.tsx +2 -2
- package/src/components/Header/Header.mobile.tsx +1 -1
- package/src/components/ProductBlock/ProductBlock.example.json +11 -1
- package/src/components/ProductBlock/ProductBlock.fixture.mobile.tsx +57 -32
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +57 -104
- package/src/components/ProductBlock/ProductBlockInner.mobile.tsx +5 -5
- package/src/components/ProductBlock/ProductBlockInner.tsx +4 -4
- package/src/hooks/useCreditCalculatorData.ts +3 -7
- package/src/hooks/useExchangeRates.ts +25 -0
- package/src/icons/GpsIcon.svg +8 -0
- package/src/icons/IconName.ts +3 -3
- package/src/model/InputTypes.ts +1 -0
- package/src/setup-fixture.ts +1 -1
- package/src/ui-kit/Button/Button.fixture.tsx +2 -6
- package/src/ui-kit/Input/Input.tsx +8 -0
- package/src/ui-kit/Input/InputProps.ts +9 -0
- package/src/ui-kit/Select/Select.tsx +15 -0
- package/src/ui-kit/Select/SelectOption.tsx +14 -0
- package/src/ui-kit/SwipeListControl/SwipeListControl.tsx +27 -19
- package/src/ui-kit/SwipeListControl/SwipeListControlProps.ts +1 -0
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import { useComparisonTableScroll } from '../../hooks/useComparisonTableScroll';
|
|
3
|
-
import { useLink } from '../../hooks/useLink';
|
|
4
2
|
import type { UniBlockProps } from '../../types';
|
|
5
|
-
import { ArrowButton } from '../../ui-kit/Button/ArrowButton';
|
|
6
3
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
4
|
+
import { SwipeListControl } from '../../ui-kit/SwipeListControl/SwipeListControl';
|
|
7
5
|
import type { ComparisonTableContent } from './ComparisonTableContent';
|
|
8
|
-
import {
|
|
9
|
-
import { HeaderCell } from './HeaderCell';
|
|
10
|
-
import { TableCarouselContainer } from './TableCarouselContainer';
|
|
11
|
-
import { TableRow } from './TableRow';
|
|
12
|
-
import { TableRowContainer } from './TableRowContainer';
|
|
6
|
+
import { TableColumn } from './TableColumn';
|
|
13
7
|
|
|
14
8
|
export interface ComparisonTableProps extends ComparisonTableContent, UniBlockProps {}
|
|
15
9
|
|
|
@@ -22,112 +16,106 @@ export const ComparisonTable = JSX<ComparisonTableProps>(
|
|
|
22
16
|
columns,
|
|
23
17
|
visibleRowLength = 0,
|
|
24
18
|
isColoredFirstColumn = false,
|
|
19
|
+
useSwiper = false,
|
|
25
20
|
}) => {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
30
|
-
const [isShowAllRow, setIsShowAllRow] = context.useState(!visibleRowLength);
|
|
31
|
-
|
|
32
|
-
const colHeaders = columns?.map(({ header }) => header || {});
|
|
33
|
-
const colData = columns?.map(({ data }) => data) || [];
|
|
34
|
-
const rowData = rowHeaders
|
|
35
|
-
?.map((header, i) => ({
|
|
21
|
+
const tableData =
|
|
22
|
+
columns?.map(({ data, header }) => ({
|
|
36
23
|
header,
|
|
37
|
-
|
|
38
|
-
}))
|
|
39
|
-
.slice(0, isShowAllRow ? rowHeaders.length : visibleRowLength);
|
|
24
|
+
column: data?.map((cell, i) => ({ cell, rowHeader: rowHeaders?.[i]?.title })),
|
|
25
|
+
})) || [];
|
|
40
26
|
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
colsLengthForScroll: COLS_LENGTH_FOR_SCROLL,
|
|
45
|
-
activeCardIndex,
|
|
46
|
-
setActiveCardIndex,
|
|
47
|
-
});
|
|
27
|
+
const [columnsViewState, setColumnsViewState] = context.useState<boolean[]>(
|
|
28
|
+
new Array(columns?.length).fill(!visibleRowLength),
|
|
29
|
+
);
|
|
48
30
|
|
|
49
|
-
const
|
|
31
|
+
const handleToggleColumn = (i: number) => {
|
|
32
|
+
columnsViewState[i] = !columnsViewState[i];
|
|
33
|
+
setColumnsViewState([...columnsViewState]);
|
|
34
|
+
};
|
|
50
35
|
|
|
51
36
|
return (
|
|
52
37
|
<section
|
|
53
|
-
className={`bg-white font-sans
|
|
38
|
+
className={`bg-white font-sans px-4 py-6 overflow-hidden text-primary-text relative ${
|
|
54
39
|
className || ''
|
|
55
40
|
}`}
|
|
56
41
|
>
|
|
57
|
-
|
|
58
|
-
headingType="
|
|
59
|
-
|
|
60
|
-
title={title}
|
|
61
|
-
/>
|
|
62
|
-
<div role="table">
|
|
63
|
-
{colHeaders?.length ? (
|
|
64
|
-
<TableRowContainer>
|
|
65
|
-
<div className={FIRST_CELL_CLASSES} role="columnheader" scope="col" />
|
|
66
|
-
<TableCarouselContainer activeCardIndex={activeCardIndex} columnWidth={COLUMN_WIDTH}>
|
|
67
|
-
{colHeaders.map((header, i) => (
|
|
68
|
-
<HeaderCell
|
|
69
|
-
key={String(i)}
|
|
70
|
-
{...header}
|
|
71
|
-
link={header.link && useLink({ router, handlerDecorator }, header.link)}
|
|
72
|
-
/>
|
|
73
|
-
))}
|
|
74
|
-
</TableCarouselContainer>
|
|
75
|
-
</TableRowContainer>
|
|
76
|
-
) : null}
|
|
77
|
-
|
|
78
|
-
{rowData?.length ? (
|
|
79
|
-
<div className="relative">
|
|
80
|
-
{rowData.map((row, i, { length }) => (
|
|
81
|
-
<TableRow
|
|
82
|
-
key={String(i)}
|
|
83
|
-
row={row}
|
|
84
|
-
isFirstRow={i === 0}
|
|
85
|
-
isLastRow={i + 1 === length}
|
|
86
|
-
activeCardIndex={activeCardIndex}
|
|
87
|
-
isColoredFirstColumn={isColoredFirstColumn}
|
|
88
|
-
/>
|
|
89
|
-
))}
|
|
90
|
-
{isScrollAvailable ? (
|
|
91
|
-
<div>
|
|
92
|
-
<div className="absolute top-7 right-7 z-10">
|
|
93
|
-
<ArrowButton
|
|
94
|
-
onClick={nextClick}
|
|
95
|
-
disabled={!showNextButton}
|
|
96
|
-
ariaLabel="Пролистать вправо"
|
|
97
|
-
/>
|
|
98
|
-
<ArrowButton
|
|
99
|
-
className="mt-4 rotate-180"
|
|
100
|
-
onClick={prevClick}
|
|
101
|
-
disabled={!showPrevButton}
|
|
102
|
-
ariaLabel="Пролистать влево"
|
|
103
|
-
/>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
106
|
-
) : null}
|
|
107
|
-
</div>
|
|
108
|
-
) : null}
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
{isScrollAvailable ? (
|
|
112
|
-
<div className="absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white" />
|
|
113
|
-
) : null}
|
|
42
|
+
{title && (
|
|
43
|
+
<Heading headingType="h3" className="font-medium text-center m-0 mb-5" title={title} />
|
|
44
|
+
)}
|
|
114
45
|
|
|
115
|
-
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
</div>
|
|
126
|
-
</button>
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
129
|
-
) : null}
|
|
46
|
+
{renderColumns({
|
|
47
|
+
tableData,
|
|
48
|
+
context,
|
|
49
|
+
visibleRowLength,
|
|
50
|
+
isColoredFirstColumn,
|
|
51
|
+
columnsViewState,
|
|
52
|
+
handleToggleColumn,
|
|
53
|
+
useSwiper,
|
|
54
|
+
setColumnsViewState,
|
|
55
|
+
})}
|
|
130
56
|
</section>
|
|
131
57
|
);
|
|
132
58
|
},
|
|
133
59
|
);
|
|
60
|
+
|
|
61
|
+
const renderColumns = ({
|
|
62
|
+
context,
|
|
63
|
+
tableData,
|
|
64
|
+
visibleRowLength,
|
|
65
|
+
isColoredFirstColumn,
|
|
66
|
+
columnsViewState,
|
|
67
|
+
handleToggleColumn,
|
|
68
|
+
useSwiper,
|
|
69
|
+
setColumnsViewState,
|
|
70
|
+
}) => (
|
|
71
|
+
<div role="table">
|
|
72
|
+
{tableData?.length ? (
|
|
73
|
+
useSwiper ? (
|
|
74
|
+
<SwipeListControl
|
|
75
|
+
context={context}
|
|
76
|
+
onSlideChange={onSlideChange(columnsViewState, setColumnsViewState)}
|
|
77
|
+
>
|
|
78
|
+
{tableData.map(
|
|
79
|
+
renderColumn({
|
|
80
|
+
context,
|
|
81
|
+
visibleRowLength,
|
|
82
|
+
isColoredFirstColumn,
|
|
83
|
+
columnsViewState,
|
|
84
|
+
handleToggleColumn,
|
|
85
|
+
}),
|
|
86
|
+
)}
|
|
87
|
+
</SwipeListControl>
|
|
88
|
+
) : (
|
|
89
|
+
tableData.map(
|
|
90
|
+
renderColumn({
|
|
91
|
+
context,
|
|
92
|
+
visibleRowLength,
|
|
93
|
+
isColoredFirstColumn,
|
|
94
|
+
columnsViewState,
|
|
95
|
+
handleToggleColumn,
|
|
96
|
+
}),
|
|
97
|
+
)
|
|
98
|
+
)
|
|
99
|
+
) : null}
|
|
100
|
+
</div>
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const renderColumn =
|
|
104
|
+
({ context, visibleRowLength, isColoredFirstColumn, columnsViewState, handleToggleColumn }) =>
|
|
105
|
+
(columnData, i) =>
|
|
106
|
+
(
|
|
107
|
+
<TableColumn
|
|
108
|
+
key={String(i)}
|
|
109
|
+
context={context}
|
|
110
|
+
visibleRowLength={visibleRowLength}
|
|
111
|
+
showRow={columnsViewState[i]}
|
|
112
|
+
header={columnData.header}
|
|
113
|
+
columnData={columnData.column}
|
|
114
|
+
isFillGradient={i === 0 && isColoredFirstColumn}
|
|
115
|
+
onToggleColumn={() => handleToggleColumn(i)}
|
|
116
|
+
/>
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const onSlideChange = (columnsViewState, setColumnsViewState) => () => {
|
|
120
|
+
setColumnsViewState(new Array(columnsViewState.length).fill(false));
|
|
121
|
+
};
|
|
@@ -26,6 +26,8 @@ export interface CellData {
|
|
|
26
26
|
export interface ColumnHeader {
|
|
27
27
|
/** @title Заголовок */
|
|
28
28
|
title?: string;
|
|
29
|
+
/** @title Подзаголовок */
|
|
30
|
+
subtitle?: string;
|
|
29
31
|
icon?: IconName;
|
|
30
32
|
image?: Picture;
|
|
31
33
|
link?: LinkProps;
|
|
@@ -61,4 +63,6 @@ export interface ComparisonTableContent {
|
|
|
61
63
|
isColoredFirstColumn?: boolean;
|
|
62
64
|
/** @title Отображать заданное количество строк */
|
|
63
65
|
visibleRowLength?: number;
|
|
66
|
+
/** @title Использовать свайпер- */
|
|
67
|
+
useSwiper?: boolean;
|
|
64
68
|
}
|
|
@@ -1,46 +1,50 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { LinkProps } from '../../model/LinkProps';
|
|
3
3
|
import type { Picture } from '../../model/Picture';
|
|
4
|
-
import { Button } from '../../ui-kit/Button/Button';
|
|
5
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
5
|
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
7
6
|
import type { IconName } from '../../ui-kit/Icon/IconProps';
|
|
8
7
|
import { Img } from '../../ui-kit/Img/Img';
|
|
9
|
-
import { BORDER_CLASSES, GRADIENT } from './constants';
|
|
10
8
|
|
|
11
9
|
export interface HeaderCellProps {
|
|
12
10
|
icon?: IconName;
|
|
13
11
|
image?: Picture;
|
|
14
12
|
title?: string;
|
|
13
|
+
subtitle?: string;
|
|
14
|
+
isFillGradient?: boolean;
|
|
15
15
|
link?: LinkProps;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export const HeaderCell = JSX<HeaderCellProps>(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
18
|
+
export const HeaderCell = JSX<HeaderCellProps>(
|
|
19
|
+
({ icon, image, title, subtitle, isFillGradient }) => (
|
|
20
|
+
<div role="columnheader" scope="col">
|
|
21
|
+
{icon && (
|
|
22
|
+
<Icon
|
|
23
|
+
className="h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4"
|
|
24
|
+
name={icon}
|
|
25
|
+
width="63"
|
|
26
|
+
height="63"
|
|
27
|
+
/>
|
|
28
|
+
)}
|
|
29
|
+
{image?.src && (
|
|
30
|
+
<div className="mb-3.5">
|
|
31
|
+
<Img image={image} />
|
|
32
|
+
</div>
|
|
33
|
+
)}
|
|
34
|
+
{title && (
|
|
35
|
+
<Heading
|
|
36
|
+
headingType="h4"
|
|
37
|
+
className={`${isFillGradient ? 'text-white' : ''}`}
|
|
38
|
+
title={title}
|
|
39
|
+
/>
|
|
40
|
+
)}
|
|
41
|
+
{subtitle && (
|
|
42
|
+
<div
|
|
43
|
+
className={`text-m-sm mb-3.5 ${isFillGradient ? 'text-white' : 'text-secondary-text/80'}`}
|
|
40
44
|
>
|
|
41
|
-
|
|
42
|
-
</
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
)
|
|
45
|
+
{subtitle}
|
|
46
|
+
</div>
|
|
47
|
+
)}
|
|
48
|
+
</div>
|
|
49
|
+
),
|
|
50
|
+
);
|
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import type { CellData } from './ComparisonTableContent';
|
|
3
|
-
import {
|
|
3
|
+
import { DIVIDER_CLASSES } from './constants';
|
|
4
4
|
|
|
5
5
|
export interface TableCellProps {
|
|
6
6
|
cell: CellData[];
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
rowHeader?: string;
|
|
8
|
+
isLastRow?: boolean;
|
|
9
|
+
isFirstRow?: boolean;
|
|
10
|
+
isFillGradient?: boolean;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
|
-
export const TableCell = JSX<TableCellProps>(({ cell,
|
|
13
|
-
const cellWrapperClasses = `
|
|
14
|
-
!isLastRow ? 'border-y-0' : 'border-t-0 rounded-b-md'
|
|
15
|
-
} ${isFillGradient ? GRADIENT : ''}`;
|
|
13
|
+
export const TableCell = JSX<TableCellProps>(({ cell, rowHeader, isFillGradient = false }) => {
|
|
14
|
+
const cellWrapperClasses = `box-border flex flex-col`;
|
|
16
15
|
|
|
17
|
-
const cellClasses = `
|
|
18
|
-
isFillGradient && isFirstRow ? 'border-t' : ''
|
|
19
|
-
} ${!isLastRow ? 'border-solid' : 'border-b-0'}`;
|
|
16
|
+
const cellClasses = `h-full ${DIVIDER_CLASSES}`;
|
|
20
17
|
|
|
21
18
|
return (
|
|
22
19
|
<div className={cellWrapperClasses} role="cell">
|
|
23
|
-
<div className={cellClasses}>
|
|
24
|
-
{cell.map((item, i) => renderCellInner(item, i, isFillGradient))}
|
|
25
|
-
</div>
|
|
20
|
+
<div className={cellClasses}>{cell.map(renderCellInner(isFillGradient, rowHeader))}</div>
|
|
26
21
|
</div>
|
|
27
22
|
);
|
|
28
23
|
});
|
|
29
24
|
|
|
30
|
-
const renderCellInner =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
const renderCellInner =
|
|
26
|
+
(isFillGradient: boolean, rowHeader?: string) =>
|
|
27
|
+
({ label, description }: CellData, i: number) =>
|
|
28
|
+
(
|
|
29
|
+
<div key={String(i)} className="flex justify-between text-m-sm py-3.5">
|
|
30
|
+
<div className={`${isFillGradient ? 'text-white/80' : 'text-secondary-text'}`}>
|
|
31
|
+
{rowHeader}
|
|
32
|
+
</div>
|
|
33
|
+
<div className="basis-1/2">
|
|
34
|
+
{label && (
|
|
35
|
+
<div className={`text-right ${isFillGradient ? 'text-white' : ''}`}>{label}</div>
|
|
36
|
+
)}
|
|
37
|
+
{description && (
|
|
38
|
+
<div
|
|
39
|
+
className={`text-right ${isFillGradient ? 'text-white/80' : 'text-secondary-text'}`}
|
|
40
|
+
>
|
|
41
|
+
{description}
|
|
42
|
+
</div>
|
|
43
|
+
)}
|
|
44
|
+
</div>
|
|
40
45
|
</div>
|
|
41
|
-
)
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
46
|
+
);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { ButtonVersion } from '../../model/ButtonVersion';
|
|
3
|
+
import type { UniBlockProps } from '../../types';
|
|
4
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
5
|
+
import { GRADIENT } from './constants';
|
|
6
|
+
import { HeaderCell } from './HeaderCell';
|
|
7
|
+
import { TableCell } from './TableCell';
|
|
8
|
+
|
|
9
|
+
export interface TableColumnProps extends UniBlockProps {
|
|
10
|
+
header: any;
|
|
11
|
+
columnData: any;
|
|
12
|
+
visibleRowLength: number;
|
|
13
|
+
isFillGradient: boolean;
|
|
14
|
+
showRow: boolean;
|
|
15
|
+
onToggleColumn: () => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const TableColumn = JSX<TableColumnProps>(
|
|
19
|
+
({ header, columnData, visibleRowLength = 0, isFillGradient, showRow, onToggleColumn }) => {
|
|
20
|
+
const columnDataView = columnData.slice(0, showRow ? columnData.length : visibleRowLength);
|
|
21
|
+
const gradientClassName = isFillGradient ? GRADIENT : '';
|
|
22
|
+
const buttonVersion: ButtonVersion = isFillGradient ? 'secondary' : 'primary';
|
|
23
|
+
return (
|
|
24
|
+
<div className={`border border-main-stroke rounded-md p-4 mb-3.5 ${gradientClassName}`}>
|
|
25
|
+
<HeaderCell {...header} isFillGradient={isFillGradient} />
|
|
26
|
+
{columnDataView?.length
|
|
27
|
+
? columnDataView.map(({ rowHeader, cell }, i) => (
|
|
28
|
+
<TableCell
|
|
29
|
+
key={String(i)}
|
|
30
|
+
cell={cell}
|
|
31
|
+
rowHeader={rowHeader}
|
|
32
|
+
isFillGradient={isFillGradient}
|
|
33
|
+
/>
|
|
34
|
+
))
|
|
35
|
+
: null}
|
|
36
|
+
|
|
37
|
+
{showRow && renderButton({ header, buttonVersion })}
|
|
38
|
+
{renderToggleButton({ onToggleColumn, isFillGradient, showRow })}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
},
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const renderButton = ({ header, buttonVersion }) => (
|
|
45
|
+
<Button
|
|
46
|
+
href={header.link.href}
|
|
47
|
+
target={header.link.target}
|
|
48
|
+
version={buttonVersion}
|
|
49
|
+
className="font-medium text-m-sm mt-4 py-[11px]"
|
|
50
|
+
>
|
|
51
|
+
{header.link.text}
|
|
52
|
+
</Button>
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const renderToggleButton = ({ onToggleColumn, isFillGradient, showRow }) => (
|
|
56
|
+
<div className="mt-5">
|
|
57
|
+
<a
|
|
58
|
+
onClick={onToggleColumn}
|
|
59
|
+
className={`font-medium text-m-sm cursor-pointer ${
|
|
60
|
+
isFillGradient ? 'text-white/80' : 'text-primary-main'
|
|
61
|
+
}`}
|
|
62
|
+
>
|
|
63
|
+
{!showRow ? 'Показать описание' : 'Скрыть'}
|
|
64
|
+
</a>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
@@ -21,7 +21,7 @@ export interface Search {
|
|
|
21
21
|
|
|
22
22
|
export type AsyncDataHook = <Data, Error = any>(
|
|
23
23
|
key: string,
|
|
24
|
-
fetcher: () => Promise<Data>,
|
|
24
|
+
fetcher: (key: string) => Promise<Data>,
|
|
25
25
|
) => { data?: Data; error?: Error };
|
|
26
26
|
|
|
27
27
|
export type GeolocationHook = (defaultLocation: string) => [string, () => void];
|
|
@@ -1,63 +1,47 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCreditCalculatorData } from '../../hooks/useCreditCalculatorData';
|
|
3
|
-
import { UniBlockProps } from '../../types';
|
|
4
|
-
import { Button } from '../../ui-kit/Button/Button';
|
|
3
|
+
import type { UniBlockProps } from '../../types';
|
|
5
4
|
import { Checkbox } from '../../ui-kit/Checkbox/Checkbox';
|
|
6
|
-
import { InputRange } from '../../ui-kit/InputRange/InputRange';
|
|
7
|
-
import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
|
|
8
5
|
import { clamp } from '../../utils/clamp';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
DEFAULT_MAX_SUM,
|
|
12
|
-
DEFAULT_MIN_MONTHS,
|
|
13
|
-
DEFAULT_MIN_SUM,
|
|
14
|
-
DEFAULT_MONTHS,
|
|
15
|
-
DEFAULT_SUM,
|
|
16
|
-
MONTHS_IN_YEAR,
|
|
17
|
-
} from './constants';
|
|
18
|
-
import { CreditCalculatorContent } from './CreditCalculatorContent';
|
|
6
|
+
import { DEFAULT_MAX_MONTHS, DEFAULT_MIN_MONTHS, MONTHS_IN_YEAR } from './constants';
|
|
7
|
+
import type { CreditCalculatorContent } from './CreditCalculatorContent';
|
|
19
8
|
import { getCalculatorParams } from './getCalculatorParams';
|
|
20
9
|
import { getCreditRate } from './getCreditRate';
|
|
21
10
|
import { getCreditTermYears } from './getCreditTermYears';
|
|
11
|
+
import { getDefaultMonths } from './getDefaultMonths';
|
|
12
|
+
import { getDefaultSum } from './getDefaultSum';
|
|
22
13
|
import { getMonthlyPayment } from './getMonthlyPayment';
|
|
14
|
+
import { renderButton } from './renderButton';
|
|
15
|
+
import { renderMonthsInput } from './renderMonthsInput';
|
|
16
|
+
import { renderProposal } from './renderProposal';
|
|
17
|
+
import { renderTermsButton } from './renderTermsButton';
|
|
18
|
+
import { renderWantedSumInput } from './renderWantedSumInput';
|
|
23
19
|
|
|
24
20
|
export interface CreditCalculatorProps extends CreditCalculatorContent, UniBlockProps {}
|
|
25
21
|
|
|
26
|
-
const STEP_MONEY = 1000;
|
|
27
|
-
const STEP_MONTHS = 1;
|
|
28
22
|
const DEFAULT_PAYMENT_TYPE = 'annuity';
|
|
29
23
|
|
|
30
24
|
const borderStyle = 'border-solid border-[3px] border-primary-main rounded-md';
|
|
31
25
|
|
|
32
26
|
export const CreditCalculator = JSX<CreditCalculatorProps>(
|
|
33
|
-
({ context, className, directoryName }) => {
|
|
27
|
+
({ context, className = '', directoryName }) => {
|
|
34
28
|
const [moneyValue, setMoneyValue] = context.useState<number | undefined>(undefined);
|
|
35
29
|
const [monthsValue, setMonthsValue] = context.useState<number | undefined>(undefined);
|
|
36
30
|
const [isAnnuityChecked, setIsAnnuityChecked] = context.useState(true);
|
|
37
31
|
const [isInsuranceChecked, setIsInsuranceChecked] = context.useState(true);
|
|
38
32
|
|
|
39
33
|
const tableRows = useCreditCalculatorData(context.useAsyncData, directoryName).rows;
|
|
40
|
-
|
|
41
34
|
const calculatorParams = getCalculatorParams({ tableRows, isAnnuity: isAnnuityChecked });
|
|
42
35
|
|
|
43
|
-
const defaultSum =
|
|
44
|
-
|
|
45
|
-
? (calculatorParams.maxSum - calculatorParams.minSum) / 2
|
|
46
|
-
: DEFAULT_SUM;
|
|
47
|
-
|
|
48
|
-
const defaultMonths =
|
|
49
|
-
calculatorParams.maxMonths && calculatorParams.minMonths
|
|
50
|
-
? Math.round((calculatorParams.maxMonths - calculatorParams.minMonths) / 2)
|
|
51
|
-
: DEFAULT_MONTHS;
|
|
36
|
+
const defaultSum = getDefaultSum(calculatorParams);
|
|
37
|
+
const defaultMonths = getDefaultMonths(calculatorParams);
|
|
52
38
|
|
|
53
|
-
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM;
|
|
54
|
-
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM;
|
|
55
39
|
const minMonths = calculatorParams?.minMonths || DEFAULT_MIN_MONTHS;
|
|
56
40
|
const maxMonths = calculatorParams?.maxMonths || DEFAULT_MAX_MONTHS;
|
|
57
41
|
|
|
58
42
|
const rate = getCreditRate({ calculatorParams, isInsurance: isInsuranceChecked });
|
|
59
43
|
|
|
60
|
-
const
|
|
44
|
+
const monthlyPayment = getMonthlyPayment({
|
|
61
45
|
calculatorParams,
|
|
62
46
|
paymentType: DEFAULT_PAYMENT_TYPE,
|
|
63
47
|
rate,
|
|
@@ -72,32 +56,18 @@ export const CreditCalculator = JSX<CreditCalculatorProps>(
|
|
|
72
56
|
}
|
|
73
57
|
|
|
74
58
|
return (
|
|
75
|
-
<section className={`font-sans text-primary-text p-10 bg-white ${className
|
|
59
|
+
<section className={`font-sans text-primary-text p-10 bg-white ${className}`}>
|
|
76
60
|
<div className={`box-border p-[49px] pr-[56px] mx-auto w-max ${borderStyle}`}>
|
|
77
|
-
<div className="flex justify-between
|
|
61
|
+
<div className="flex justify-between">
|
|
78
62
|
<div className="mr-[42px]">
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
step={STEP_MONEY}
|
|
88
|
-
value={moneyValue || defaultSum}
|
|
89
|
-
onChange={setMoneyValue}
|
|
90
|
-
/>
|
|
91
|
-
<InputRange
|
|
92
|
-
className="mt-[23px]"
|
|
93
|
-
title="Срок кредита, месяцев"
|
|
94
|
-
items={['Или выберите из предложенных вариантов ниже']}
|
|
95
|
-
min={minMonths}
|
|
96
|
-
max={maxMonths}
|
|
97
|
-
step={STEP_MONTHS}
|
|
98
|
-
value={monthsValue || defaultMonths}
|
|
99
|
-
onChange={setMonthsValue}
|
|
100
|
-
/>
|
|
63
|
+
{renderWantedSumInput({ calculatorParams, moneyValue, defaultSum, setMoneyValue })}
|
|
64
|
+
{renderMonthsInput({
|
|
65
|
+
minMonths,
|
|
66
|
+
maxMonths,
|
|
67
|
+
monthsValue,
|
|
68
|
+
defaultMonths,
|
|
69
|
+
setMonthsValue,
|
|
70
|
+
})}
|
|
101
71
|
<div className="flex mb-7">
|
|
102
72
|
{creditTermYears.map((number, i) => renderButton(number, i, handleButtonClick))}
|
|
103
73
|
</div>
|
|
@@ -113,42 +83,11 @@ export const CreditCalculator = JSX<CreditCalculatorProps>(
|
|
|
113
83
|
onChange={setIsInsuranceChecked}
|
|
114
84
|
/>
|
|
115
85
|
</div>
|
|
116
|
-
|
|
117
|
-
<div className="text-base mb-[18px]">Наше предложение</div>
|
|
118
|
-
<div className="text-sm opacity-60">Ежемесячный платёж</div>
|
|
119
|
-
<div className="text-lg mb-3">
|
|
120
|
-
{addSpacesBetweenNumbers(Math.round(montlyPayment))} ₽
|
|
121
|
-
</div>
|
|
122
|
-
<div className="text-sm opacity-60">Ставка</div>
|
|
123
|
-
<div className="text-lg">{rate} %</div>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
<div className="flex items-center">
|
|
127
|
-
<Button className="mr-3" text="Отправить заявку" version="primary" href="#" />
|
|
128
|
-
<div
|
|
129
|
-
className="w-80 text-2xs leading-4 text-secondary-text"
|
|
130
|
-
aria-label="Соглашение на обработку персональных данных"
|
|
131
|
-
>
|
|
132
|
-
Отправляя заявку, вы соглашаетесь на обработку персональных данных соответственно
|
|
133
|
-
требованиям ФЗ «О персональных данных»
|
|
134
|
-
</div>
|
|
86
|
+
{renderProposal(monthlyPayment, rate)}
|
|
135
87
|
</div>
|
|
88
|
+
{renderTermsButton()}
|
|
136
89
|
</div>
|
|
137
90
|
</section>
|
|
138
91
|
);
|
|
139
92
|
},
|
|
140
93
|
);
|
|
141
|
-
|
|
142
|
-
function renderButton(number: number, i: number, handleClick: (number: number) => void) {
|
|
143
|
-
return (
|
|
144
|
-
<button
|
|
145
|
-
key={String(i)}
|
|
146
|
-
className="bg-secondary-light rounded-3xl h-10 w-[75px] box-border mr-2 flex items-center justify-center cursor-pointer border-none"
|
|
147
|
-
onClick={() => handleClick(number)}
|
|
148
|
-
>
|
|
149
|
-
<span className="font-semibold text-sm">
|
|
150
|
-
{number} {number === 1 ? 'год' : number > 4 ? 'лет' : 'года'}
|
|
151
|
-
</span>
|
|
152
|
-
</button>
|
|
153
|
-
);
|
|
154
|
-
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DEFAULT_MONTHS } from './constants';
|
|
2
|
+
import type { CalculatorParams } from './CreditCalculatorContent';
|
|
3
|
+
|
|
4
|
+
export const getDefaultMonths = (calculatorParams: CalculatorParams) =>
|
|
5
|
+
calculatorParams.maxMonths && calculatorParams.minMonths
|
|
6
|
+
? Math.round((calculatorParams.maxMonths - calculatorParams.minMonths) / 2)
|
|
7
|
+
: DEFAULT_MONTHS;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DEFAULT_SUM } from './constants';
|
|
2
|
+
import type { CalculatorParams } from './CreditCalculatorContent';
|
|
3
|
+
|
|
4
|
+
export const getDefaultSum = (calculatorParams: CalculatorParams) =>
|
|
5
|
+
calculatorParams.maxSum && calculatorParams.minSum
|
|
6
|
+
? (calculatorParams.maxSum - calculatorParams.minSum) / 2
|
|
7
|
+
: DEFAULT_SUM;
|