@redneckz/wildless-cms-uni-blocks 0.3.11 → 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 +153 -75
- 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/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/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/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/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/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/mobile/bundle/bundle.umd.js +69 -21
- 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/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/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/lib/components/BaseTile/BaseTile.js +1 -1
- package/mobile/lib/components/BaseTile/BaseTile.js.map +1 -1
- 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/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/src/common.css +12 -0
- package/mobile/src/components/BaseTile/BaseTile.tsx +1 -1
- 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/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/package.json +1 -1
- package/src/common.css +12 -0
- package/src/components/BaseTile/BaseTile.tsx +1 -1
- package/src/components/Blocks.ts +2 -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/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/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
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
export const Select = JSX(({ className = '', id, name, children }) => {
|
|
4
|
+
return (_jsx("select", { className: className, id: id, name: name || id, children: children }));
|
|
5
|
+
});
|
|
6
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/Select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAQxC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAc,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAChF,OAAO,CACL,iBAAQ,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE,YACnD,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
export const SelectOption = JSX(({ className = '', value, children }) => {
|
|
4
|
+
return (_jsx("option", { className: className, value: `${value}`, children: children }));
|
|
5
|
+
});
|
|
6
|
+
//# sourceMappingURL=SelectOption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectOption.js","sourceRoot":"","sources":["../../../src/ui-kit/Select/SelectOption.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAOxC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAoB,CAAC,EAAE,SAAS,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IACzF,OAAO,CACL,iBAAQ,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,YAC5C,QAAQ,GACF,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/mobile/src/common.css
CHANGED
|
@@ -136,4 +136,16 @@
|
|
|
136
136
|
box-shadow: none;
|
|
137
137
|
border: 3px solid #42ab44;
|
|
138
138
|
}
|
|
139
|
+
|
|
140
|
+
/* Hide arrows */
|
|
141
|
+
input[type='number']::-webkit-outer-spin-button,
|
|
142
|
+
input[type='number']::-webkit-inner-spin-button {
|
|
143
|
+
-webkit-appearance: none;
|
|
144
|
+
margin: 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/* Hide arrows */
|
|
148
|
+
input[type='number'] {
|
|
149
|
+
-moz-appearance: textfield;
|
|
150
|
+
}
|
|
139
151
|
}
|
|
@@ -12,7 +12,7 @@ export const BaseTile = JSX<BaseTileProps>(
|
|
|
12
12
|
<div className="flex grow w-full justify-between">
|
|
13
13
|
<div className="flex flex-col justify-between w-full">
|
|
14
14
|
<div>{children}</div>
|
|
15
|
-
<div>{buttons}</div>
|
|
15
|
+
{buttons?.length ? <div>{buttons}</div> : null}
|
|
16
16
|
</div>
|
|
17
17
|
{image}
|
|
18
18
|
</div>
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clamp } from '../../utils/clamp';
|
|
2
2
|
import { DEFAULT_MAX_SUM, DEFAULT_MIN_SUM, MONTHS_IN_YEAR } from './constants';
|
|
3
|
-
import { CalculatorParams } from './CreditCalculatorContent';
|
|
3
|
+
import type { CalculatorParams } from './CreditCalculatorContent';
|
|
4
4
|
|
|
5
5
|
type PaymentType = 'annuity' | 'differentiated';
|
|
6
6
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function renderButton(number: number, i: number, handleClick: (number: number) => void) {
|
|
2
|
+
return (
|
|
3
|
+
<button
|
|
4
|
+
key={String(i)}
|
|
5
|
+
className="bg-secondary-light rounded-3xl h-10 w-[75px] box-border mr-2 flex items-center justify-center cursor-pointer border-none"
|
|
6
|
+
onClick={() => handleClick(number)}
|
|
7
|
+
>
|
|
8
|
+
<span className="font-semibold text-sm">
|
|
9
|
+
{number} {number === 1 ? 'год' : number > 4 ? 'лет' : 'года'}
|
|
10
|
+
</span>
|
|
11
|
+
</button>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InputRange } from '../../ui-kit/InputRange/InputRange';
|
|
2
|
+
import type { InputRangeProps } from '../../ui-kit/InputRange/InputRangeProps';
|
|
3
|
+
|
|
4
|
+
const STEP_MONTHS = 1;
|
|
5
|
+
|
|
6
|
+
interface RenderMonthsInputProps {
|
|
7
|
+
minMonths: number;
|
|
8
|
+
maxMonths: number;
|
|
9
|
+
monthsValue: number | undefined;
|
|
10
|
+
defaultMonths: number;
|
|
11
|
+
setMonthsValue: InputRangeProps['onChange'];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function renderMonthsInput(props: RenderMonthsInputProps) {
|
|
15
|
+
const { minMonths, maxMonths, monthsValue, defaultMonths, setMonthsValue } = props;
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<InputRange
|
|
19
|
+
className="mt-[23px]"
|
|
20
|
+
title="Срок кредита, месяцев"
|
|
21
|
+
items={['Или выберите из предложенных вариантов ниже']}
|
|
22
|
+
min={minMonths}
|
|
23
|
+
max={maxMonths}
|
|
24
|
+
step={STEP_MONTHS}
|
|
25
|
+
value={monthsValue || defaultMonths}
|
|
26
|
+
onChange={setMonthsValue}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
|
|
2
|
+
|
|
3
|
+
export function renderProposal(monthlyPayment: number, rate: number) {
|
|
4
|
+
return (
|
|
5
|
+
<div className="box-border h-fit p-9 bg-primary-main rounded-md text-white">
|
|
6
|
+
<div className="text-base mb-[18px]">Наше предложение</div>
|
|
7
|
+
<div className="text-sm opacity-60">Ежемесячный платёж</div>
|
|
8
|
+
<div className="text-lg mb-3">{addSpacesBetweenNumbers(Math.round(monthlyPayment))} ₽</div>
|
|
9
|
+
<div className="text-sm opacity-60">Ставка</div>
|
|
10
|
+
<div className="text-lg">{rate} %</div>
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
2
|
+
|
|
3
|
+
export function renderTermsButton() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="flex items-center">
|
|
6
|
+
<Button className="mr-3" text="Отправить заявку" version="primary" href="#" />
|
|
7
|
+
<div
|
|
8
|
+
className="w-80 text-2xs leading-4 text-secondary-text"
|
|
9
|
+
aria-label="Соглашение на обработку персональных данных"
|
|
10
|
+
>
|
|
11
|
+
Отправляя заявку, вы соглашаетесь на обработку персональных данных соответственно
|
|
12
|
+
требованиям ФЗ «О персональных данных»
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { InputRange } from '../../ui-kit/InputRange/InputRange';
|
|
2
|
+
import type { InputRangeProps } from '../../ui-kit/InputRange/InputRangeProps';
|
|
3
|
+
import { addSpacesBetweenNumbers } from '../../utils/addSpacesBetweenNumbers';
|
|
4
|
+
import { DEFAULT_MAX_SUM, DEFAULT_MIN_SUM } from './constants';
|
|
5
|
+
import type { CalculatorParams } from './CreditCalculatorContent';
|
|
6
|
+
|
|
7
|
+
const STEP_MONEY = 1000;
|
|
8
|
+
|
|
9
|
+
interface RenderWantedSumInputProps {
|
|
10
|
+
calculatorParams: CalculatorParams;
|
|
11
|
+
moneyValue: number | undefined;
|
|
12
|
+
defaultSum: number;
|
|
13
|
+
setMoneyValue: InputRangeProps['onChange'];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function renderWantedSumInput(props: RenderWantedSumInputProps) {
|
|
17
|
+
const { calculatorParams, moneyValue, defaultSum, setMoneyValue } = props;
|
|
18
|
+
|
|
19
|
+
const minSum = calculatorParams?.minSum || DEFAULT_MIN_SUM;
|
|
20
|
+
const maxSum = calculatorParams?.maxSum || DEFAULT_MAX_SUM;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<InputRange
|
|
24
|
+
title="Желаемая сумма кредита, ₽"
|
|
25
|
+
items={[
|
|
26
|
+
`От ${addSpacesBetweenNumbers(minSum)} рублей`,
|
|
27
|
+
`До ${addSpacesBetweenNumbers(maxSum)} рублей`,
|
|
28
|
+
]}
|
|
29
|
+
min={minSum}
|
|
30
|
+
max={maxSum}
|
|
31
|
+
step={STEP_MONEY}
|
|
32
|
+
value={moneyValue || defaultSum}
|
|
33
|
+
onChange={setMoneyValue}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
3
|
+
import type { ExchangeCurrencyItem } from './ExchangeRateTileContent';
|
|
4
|
+
import { formatCurrency } from './formatCurrency';
|
|
5
|
+
|
|
6
|
+
const TABLE_HEAD_STYLE = 'text-left font-normal text-sm text-secondary-text';
|
|
7
|
+
|
|
8
|
+
const CURRENCY_ICONS_MAP = {
|
|
9
|
+
USD: 'DollarIcon',
|
|
10
|
+
EUR: 'EuroIcon',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
interface CurrencyTableProps {
|
|
14
|
+
className?: string;
|
|
15
|
+
exchangeCurrencyItems: ExchangeCurrencyItem[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const CurrencyTable = JSX<CurrencyTableProps>(({ className, exchangeCurrencyItems }) => {
|
|
19
|
+
return (
|
|
20
|
+
<table className={`h-fit w-fit ${className}`}>
|
|
21
|
+
<thead>
|
|
22
|
+
<tr>
|
|
23
|
+
<th className={TABLE_HEAD_STYLE}>Валюта</th>
|
|
24
|
+
<th className={`${TABLE_HEAD_STYLE} pl-11`}>Купить</th>
|
|
25
|
+
<th className={`${TABLE_HEAD_STYLE} pl-11`}>Продать</th>
|
|
26
|
+
</tr>
|
|
27
|
+
</thead>
|
|
28
|
+
<tbody>{exchangeCurrencyItems.map((item) => renderCurrencyRow(item))}</tbody>
|
|
29
|
+
</table>
|
|
30
|
+
);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const renderCurrencyRow = (exchangeCurrencyItem: ExchangeCurrencyItem) => {
|
|
34
|
+
const code = exchangeCurrencyItem?.currency?.currency;
|
|
35
|
+
return (
|
|
36
|
+
<tr key={code}>
|
|
37
|
+
<td className="pt-4">
|
|
38
|
+
<div className="flex items-center">
|
|
39
|
+
{code ? <Icon name={CURRENCY_ICONS_MAP[code]} width="24" height="24" /> : null}
|
|
40
|
+
<span className="ml-2">{code}</span>
|
|
41
|
+
</div>
|
|
42
|
+
</td>
|
|
43
|
+
<td className="pt-4 pl-11">{formatCurrency(exchangeCurrencyItem.buyExchangeRate)}</td>
|
|
44
|
+
<td className="pt-4 pl-11">{formatCurrency(exchangeCurrencyItem.saleExchangeRate)}</td>
|
|
45
|
+
</tr>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
3
|
+
|
|
4
|
+
interface CurrentLocationProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
address?: string;
|
|
7
|
+
distance?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const CurrentLocation = JSX<CurrentLocationProps>(
|
|
11
|
+
({ className = '', address, distance }) => (
|
|
12
|
+
<div className={`flex text-sm ${className}`}>
|
|
13
|
+
<Icon className="min-w-fit" name="GpsIcon" width="24" height="24" asSVG />
|
|
14
|
+
<div className="ml-1.5">
|
|
15
|
+
{address ? <p className="m-0">{address}</p> : null}
|
|
16
|
+
{distance ? (
|
|
17
|
+
<p className="text-secondary-text m-0">Курс указан для ближайшего офиса - {distance}</p>
|
|
18
|
+
) : null}
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
),
|
|
22
|
+
);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
3
|
+
import { Input } from '../../ui-kit/Input/Input';
|
|
4
|
+
import { Select } from '../../ui-kit/Select/Select';
|
|
5
|
+
import { SelectOption } from '../../ui-kit/Select/SelectOption';
|
|
6
|
+
import type { ExchangeCurrencyItem } from './ExchangeRateTileContent';
|
|
7
|
+
|
|
8
|
+
export interface ExchangeCurrencyCalculatorProps {
|
|
9
|
+
exchangeCurrencyItems: ExchangeCurrencyItem[];
|
|
10
|
+
codes: string[];
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const ExchangeCurrencyCalculator = JSX<ExchangeCurrencyCalculatorProps>(
|
|
15
|
+
({ codes, className = '' }) => {
|
|
16
|
+
return (
|
|
17
|
+
<div className={`grid gap-3.5 ${className}`}>
|
|
18
|
+
{renderInput('Хочу продать', codes)}
|
|
19
|
+
{renderInput('Получу', codes)}
|
|
20
|
+
<Button className="box-border mt-3.5 py-3 h-12 w-44" version="primary" href="#">
|
|
21
|
+
Купить валюту
|
|
22
|
+
</Button>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
function renderInput(placeholder: string, codes: string[]) {
|
|
29
|
+
return (
|
|
30
|
+
<div className="flex items-center">
|
|
31
|
+
<Input
|
|
32
|
+
className="h-10 border pl-2.5 rounded-md text-m-sm w-full appearance-none"
|
|
33
|
+
type="number"
|
|
34
|
+
placeholder={`${placeholder}`}
|
|
35
|
+
/>
|
|
36
|
+
{codes.length ? (
|
|
37
|
+
<Select className="h-9 -translate-x-16">
|
|
38
|
+
{codes.map((code, i) => (
|
|
39
|
+
<SelectOption key={String(i)} value={code}>
|
|
40
|
+
{code}
|
|
41
|
+
</SelectOption>
|
|
42
|
+
))}
|
|
43
|
+
</Select>
|
|
44
|
+
) : null}
|
|
45
|
+
</div>
|
|
46
|
+
);
|
|
47
|
+
}
|