@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
|
@@ -1,104 +1,73 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useExchangeRates } from '../../hooks/useExchangeRates';
|
|
2
3
|
import type { UniBlockProps } from '../../types';
|
|
3
|
-
import type { ButtonProps } from '../../ui-kit/Button/ButtonProps';
|
|
4
|
-
import { ButtonSection } from '../../ui-kit/Button/ButtonSection';
|
|
5
4
|
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
6
|
-
import { Icon } from '../../ui-kit/Icon/Icon';
|
|
7
5
|
import { BaseTile } from '../BaseTile/BaseTile';
|
|
8
6
|
import { getTileHeadingType } from '../BaseTile/getTileHeadingType';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { CurrencyTable } from './CurrencyTable';
|
|
8
|
+
import { CurrentLocation } from './CurrentLocation';
|
|
9
|
+
import { ExchangeCurrencyCalculator } from './ExchangeCurrencyCalculator';
|
|
11
10
|
import type { ExchangeRateTileContent } from './ExchangeRateTileContent';
|
|
12
11
|
|
|
13
|
-
export interface ExchangeRateTileProps extends ExchangeRateTileContent, UniBlockProps {}
|
|
14
|
-
|
|
15
|
-
const CBR_EXCHANGE_RATE_URL = 'https://www.cbr-xml-daily.ru/daily_json.js';
|
|
16
|
-
|
|
17
12
|
const CURRENCY_CODES = ['USD', 'EUR'];
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
EUR: 'EuroIcon',
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const buttons: ButtonProps[] = [
|
|
13
|
+
const EXCHANGE_CODES = ['RUB', 'USD', 'EUR'];
|
|
14
|
+
const DEFAULT_CURRENCY_ITEMS = [
|
|
24
15
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
buyExchangeRate: 90.6,
|
|
17
|
+
saleExchangeRate: 92.8,
|
|
18
|
+
currency: { id: 2, code: '978', currency: 'EUR', name: 'Евро' },
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
buyExchangeRate: 73.75,
|
|
22
|
+
saleExchangeRate: 75.95,
|
|
23
|
+
currency: { id: 1, code: '840', currency: 'USD', name: 'Американский доллар' },
|
|
28
24
|
},
|
|
29
25
|
];
|
|
30
26
|
|
|
27
|
+
const DEFAULT_LOCATION = {
|
|
28
|
+
address: 'Москва, ул.Ленина д.28',
|
|
29
|
+
distance: '6км',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export interface ExchangeRateTileProps extends ExchangeRateTileContent, UniBlockProps {}
|
|
33
|
+
|
|
31
34
|
export const ExchangeRateTile = JSX<ExchangeRateTileProps>(
|
|
32
35
|
({ className = '', context, title = 'Курсы обмена валют' }) => {
|
|
33
|
-
const
|
|
36
|
+
const data = useExchangeRates(context.useAsyncData);
|
|
37
|
+
const exchangeCurrencyItems =
|
|
38
|
+
data?.exchangeRate?.currencies?.filter((item) => {
|
|
39
|
+
return CURRENCY_CODES.indexOf(item?.currency?.currency || '') !== -1;
|
|
40
|
+
}) || DEFAULT_CURRENCY_ITEMS;
|
|
41
|
+
|
|
34
42
|
return (
|
|
35
|
-
<section
|
|
36
|
-
className={`bg-white text-primary-text font-sans p-9 box-border ${className} ${getTileRightPadding(
|
|
37
|
-
className,
|
|
38
|
-
)} ${getTileMinHeight(className)} `}
|
|
39
|
-
>
|
|
43
|
+
<section className={`bg-white text-primary-text font-sans p-9 box-border ${className}`}>
|
|
40
44
|
<BaseTile
|
|
41
45
|
context={context}
|
|
42
46
|
title={
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
buttons={
|
|
52
|
-
buttons?.length ? (
|
|
53
|
-
<ButtonSection context={context} buttons={buttons} className="flex mt-9 gap-3" />
|
|
54
|
-
) : null
|
|
47
|
+
<Heading
|
|
48
|
+
headingType={getTileHeadingType(className)}
|
|
49
|
+
title={title}
|
|
50
|
+
className="whitespace-pre-wrap mb-3"
|
|
51
|
+
/>
|
|
55
52
|
}
|
|
56
53
|
>
|
|
57
|
-
<
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
</
|
|
64
|
-
|
|
65
|
-
|
|
54
|
+
<div className="flex">
|
|
55
|
+
<div className="mr-20 pt-3">
|
|
56
|
+
{exchangeCurrencyItems ? (
|
|
57
|
+
<CurrencyTable className="mb-7" exchangeCurrencyItems={exchangeCurrencyItems} />
|
|
58
|
+
) : null}
|
|
59
|
+
<CurrentLocation {...DEFAULT_LOCATION} />
|
|
60
|
+
</div>
|
|
61
|
+
{exchangeCurrencyItems?.length ? (
|
|
62
|
+
<ExchangeCurrencyCalculator
|
|
63
|
+
className="grow"
|
|
64
|
+
exchangeCurrencyItems={exchangeCurrencyItems}
|
|
65
|
+
codes={EXCHANGE_CODES}
|
|
66
|
+
/>
|
|
67
|
+
) : null}
|
|
68
|
+
</div>
|
|
66
69
|
</BaseTile>
|
|
67
70
|
</section>
|
|
68
71
|
);
|
|
69
72
|
},
|
|
70
73
|
);
|
|
71
|
-
|
|
72
|
-
const CurrencyTH = JSX<{ className?: string }>(({ className = '', children }) => (
|
|
73
|
-
<th className={`text-left font-normal text-sm text-secondary-text ${className}`}>{children}</th>
|
|
74
|
-
));
|
|
75
|
-
|
|
76
|
-
const CurrencyTD = JSX<{ className?: string }>(({ className = '', children }) => (
|
|
77
|
-
<td className={`text-left font-normal text-base text-primary-text ${className}`}>{children}</td>
|
|
78
|
-
));
|
|
79
|
-
|
|
80
|
-
async function fetchExchangeRate(): Promise<{
|
|
81
|
-
Valute?: Record<string, { CharCode: string; Name?: string; Value: number; Previous?: number }>;
|
|
82
|
-
}> {
|
|
83
|
-
const response = await fetch(CBR_EXCHANGE_RATE_URL);
|
|
84
|
-
return await response.json();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const currencyNumberFormat = new Intl.NumberFormat('ru', { style: 'currency', currency: 'RUB' });
|
|
88
|
-
|
|
89
|
-
const formatCurrency = (value?: number) => (value ? currencyNumberFormat.format(value) : '');
|
|
90
|
-
|
|
91
|
-
const renderCurrencyRow = (data) => (code: string) => {
|
|
92
|
-
const value = (data?.Valute || {})[code]?.Value;
|
|
93
|
-
return (
|
|
94
|
-
<tr key={code}>
|
|
95
|
-
<CurrencyTD className="pt-4">
|
|
96
|
-
<div className="flex items-center">
|
|
97
|
-
<Icon name={CURRENCY_ICONS_MAP[code]} width="24" height="24" />
|
|
98
|
-
<span className="ml-2">{code}</span>
|
|
99
|
-
</div>
|
|
100
|
-
</CurrencyTD>
|
|
101
|
-
<CurrencyTD className="pt-4 pl-11">{formatCurrency(value)}</CurrencyTD>
|
|
102
|
-
</tr>
|
|
103
|
-
);
|
|
104
|
-
};
|
|
@@ -4,3 +4,14 @@ import type { HeadingContent } from '../../ui-kit/Heading/HeadingContent';
|
|
|
4
4
|
* @title Курсы валют
|
|
5
5
|
*/
|
|
6
6
|
export type ExchangeRateTileContent = HeadingContent;
|
|
7
|
+
|
|
8
|
+
export interface ExchangeCurrencyItem {
|
|
9
|
+
buyExchangeRate?: number;
|
|
10
|
+
saleExchangeRate?: number;
|
|
11
|
+
currency?: {
|
|
12
|
+
id?: number;
|
|
13
|
+
code?: string;
|
|
14
|
+
currency?: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -5,16 +5,12 @@ export function useCreditCalculatorData(
|
|
|
5
5
|
useAsyncData: AsyncDataHook,
|
|
6
6
|
directoryName: string | undefined,
|
|
7
7
|
): CreditCalculatorData {
|
|
8
|
-
const { data } = useAsyncData(creditCalculatorUrl(directoryName),
|
|
9
|
-
fetchCreditCalculatorData(directoryName),
|
|
10
|
-
);
|
|
8
|
+
const { data } = useAsyncData(creditCalculatorUrl(directoryName), fetchCreditCalculatorData);
|
|
11
9
|
return data || {};
|
|
12
10
|
}
|
|
13
11
|
|
|
14
|
-
async function fetchCreditCalculatorData(
|
|
15
|
-
|
|
16
|
-
): Promise<CreditCalculatorData> {
|
|
17
|
-
const response = await fetch(creditCalculatorUrl(directoryName));
|
|
12
|
+
async function fetchCreditCalculatorData(url: string): Promise<CreditCalculatorData> {
|
|
13
|
+
const response = await fetch(url);
|
|
18
14
|
return await response.json();
|
|
19
15
|
}
|
|
20
16
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AsyncDataHook } from '../components/ContentPage/ContentPageContext';
|
|
2
|
+
import { ExchangeCurrencyItem } from '../components/ExchangeRateTile/ExchangeRateTileContent';
|
|
3
|
+
|
|
4
|
+
interface ExchangeRatesData {
|
|
5
|
+
exchangeRate?: {
|
|
6
|
+
currencies?: ExchangeCurrencyItem[];
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function useExchangeRates(useAsyncData: AsyncDataHook): ExchangeRatesData {
|
|
11
|
+
const { data } = useAsyncData(EXCHANGE_RATES_URL, fetchExchangeRates);
|
|
12
|
+
|
|
13
|
+
return data || {};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async function fetchExchangeRates(): Promise<ExchangeRatesData | undefined> {
|
|
17
|
+
try {
|
|
18
|
+
const response = await fetch(EXCHANGE_RATES_URL);
|
|
19
|
+
return await response.json();
|
|
20
|
+
} catch (err) {
|
|
21
|
+
console.error(err);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const EXCHANGE_RATES_URL = '/api/v1/exchangerates.json';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg title="Gps" width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M9.35107 5.45074C10.3959 4.89842 11.587 4.58569 12.8511 4.58569C16.9932 4.58569 20.3511 7.94356 20.3511 12.0857C20.3511 16.2278 16.9932 19.5857 12.8511 19.5857C8.70894 19.5857 5.35107 16.2278 5.35107 12.0857C5.35107 10.8216 5.66381 9.63055 6.21612 8.58569" stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M12.8511 15.0857C14.5079 15.0857 15.8511 13.7425 15.8511 12.0857C15.8511 10.4288 14.5079 9.08569 12.8511 9.08569C11.1942 9.08569 9.85107 10.4288 9.85107 12.0857C9.85107 13.7425 11.1942 15.0857 12.8511 15.0857Z" stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M12.8511 4.08569V2.08569" stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M4.85107 12.0857H2.85107" stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
<path d="M12.8511 20.0857V22.0857" stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
7
|
+
<path d="M20.8511 12.0857H22.8511" stroke="#1C1C1C" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
8
|
+
</svg>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Generated. Do not touch
|
|
3
3
|
|
|
4
4
|
export enum IconMap {
|
|
5
|
-
ActualBalanceIcon = "ActualBalanceIcon", AppleIcon = "AppleIcon", AtmIcon = "AtmIcon", BankIcon = "BankIcon", BurgerIcon = "BurgerIcon", BurgerIconWhite = "BurgerIconWhite", Calendar2Icon = "Calendar2Icon", CalendarCircleIcon = "CalendarCircleIcon", CalendarIcon = "CalendarIcon", CalendarTickIcon = "CalendarTickIcon", CalendarWhiteIcon = "CalendarWhiteIcon", CardIcon = "CardIcon", CardPosIcon = "CardPosIcon", CardTickIcon = "CardTickIcon", CardWithGemIcon = "CardWithGemIcon", ChartSquareIcon = "ChartSquareIcon", ClockIcon = "ClockIcon", CloseIcon = "CloseIcon", ComfortableCompIcon = "ComfortableCompIcon", CreditCardsIcon = "CreditCardsIcon", DiscountShapeIcon = "DiscountShapeIcon", DocIcon = "DocIcon", DocIconMonoColor = "DocIconMonoColor", DocumentTextIcon = "DocumentTextIcon", DollarIcon = "DollarIcon", EarthIcon = "EarthIcon", EmptyWalletChangeIcon = "EmptyWalletChangeIcon", EmptyWalletIcon = "EmptyWalletIcon", EmptyWalletWhiteIcon = "EmptyWalletWhiteIcon", EuroIcon = "EuroIcon", GeolocationIcon = "GeolocationIcon", GlassIcon = "GlassIcon", GlobalIcon = "GlobalIcon", GridIcon = "GridIcon", GridIconWhite = "GridIconWhite", InterestGrowthIcon = "InterestGrowthIcon", InterestIcon = "InterestIcon", JCBIcon = "JCBIcon", LoupeIcon = "LoupeIcon", MasterCardIcon = "MasterCardIcon", MinusIcon = "MinusIcon", MirIcon = "MirIcon", MoneyIcon = "MoneyIcon", MoneyInsuranceIcon = "MoneyInsuranceIcon", MonitorMobileIcon = "MonitorMobileIcon", NewDocIcon = "NewDocIcon", OfficeIcon = "OfficeIcon", OkIcon = "OkIcon", PassSendIcon = "PassSendIcon", PercentageRoundIcon = "PercentageRoundIcon", PercentageSquareIcon = "PercentageSquareIcon", PercentageSquareWhiteIcon = "PercentageSquareWhiteIcon", PersonalCardIcon = "PersonalCardIcon", PlayMarketIcon = "PlayMarketIcon", PlusIcon = "PlusIcon", Profile2UserIcon = "Profile2UserIcon", ProfileIcon = "ProfileIcon", RoundRubleIcon = "RoundRubleIcon", SafeIcon = "SafeIcon", ShieldTickIcon = "ShieldTickIcon", SignDocsIcon = "SignDocsIcon", SmallClockIcon = "SmallClockIcon", TelegramIcon = "TelegramIcon", UnionPayIcon = "UnionPayIcon", UserTickIcon = "UserTickIcon", VisaIcon = "VisaIcon", VKIcon = "VKIcon", WalletAdd2Icon = "WalletAdd2Icon", WalletAddIcon = "WalletAddIcon", WalletIcon = "WalletIcon", WalletWithMoneyIcon = "WalletWithMoneyIcon"
|
|
5
|
+
ActualBalanceIcon = "ActualBalanceIcon", AppleIcon = "AppleIcon", AtmIcon = "AtmIcon", BankIcon = "BankIcon", BurgerIcon = "BurgerIcon", BurgerIconWhite = "BurgerIconWhite", Calendar2Icon = "Calendar2Icon", CalendarCircleIcon = "CalendarCircleIcon", CalendarIcon = "CalendarIcon", CalendarTickIcon = "CalendarTickIcon", CalendarWhiteIcon = "CalendarWhiteIcon", CardIcon = "CardIcon", CardPosIcon = "CardPosIcon", CardTickIcon = "CardTickIcon", CardWithGemIcon = "CardWithGemIcon", ChartSquareIcon = "ChartSquareIcon", ClockIcon = "ClockIcon", CloseIcon = "CloseIcon", ComfortableCompIcon = "ComfortableCompIcon", CreditCardsIcon = "CreditCardsIcon", DiscountShapeIcon = "DiscountShapeIcon", DocIcon = "DocIcon", DocIconMonoColor = "DocIconMonoColor", DocumentTextIcon = "DocumentTextIcon", DollarIcon = "DollarIcon", EarthIcon = "EarthIcon", EmptyWalletChangeIcon = "EmptyWalletChangeIcon", EmptyWalletIcon = "EmptyWalletIcon", EmptyWalletWhiteIcon = "EmptyWalletWhiteIcon", EuroIcon = "EuroIcon", GeolocationIcon = "GeolocationIcon", GlassIcon = "GlassIcon", GlobalIcon = "GlobalIcon", GpsIcon = "GpsIcon", GridIcon = "GridIcon", GridIconWhite = "GridIconWhite", InterestGrowthIcon = "InterestGrowthIcon", InterestIcon = "InterestIcon", JCBIcon = "JCBIcon", LoupeIcon = "LoupeIcon", MasterCardIcon = "MasterCardIcon", MinusIcon = "MinusIcon", MirIcon = "MirIcon", MoneyIcon = "MoneyIcon", MoneyInsuranceIcon = "MoneyInsuranceIcon", MonitorMobileIcon = "MonitorMobileIcon", NewDocIcon = "NewDocIcon", OfficeIcon = "OfficeIcon", OkIcon = "OkIcon", PassSendIcon = "PassSendIcon", PercentageRoundIcon = "PercentageRoundIcon", PercentageSquareIcon = "PercentageSquareIcon", PercentageSquareWhiteIcon = "PercentageSquareWhiteIcon", PersonalCardIcon = "PersonalCardIcon", PlayMarketIcon = "PlayMarketIcon", PlusIcon = "PlusIcon", Profile2UserIcon = "Profile2UserIcon", ProfileIcon = "ProfileIcon", RoundRubleIcon = "RoundRubleIcon", SafeIcon = "SafeIcon", ShieldTickIcon = "ShieldTickIcon", SignDocsIcon = "SignDocsIcon", SmallClockIcon = "SmallClockIcon", TelegramIcon = "TelegramIcon", UnionPayIcon = "UnionPayIcon", UserTickIcon = "UserTickIcon", VisaIcon = "VisaIcon", VKIcon = "VKIcon", WalletAdd2Icon = "WalletAdd2Icon", WalletAddIcon = "WalletAddIcon", WalletIcon = "WalletIcon", WalletWithMoneyIcon = "WalletWithMoneyIcon"
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -10,7 +10,7 @@ export enum IconMap {
|
|
|
10
10
|
* @title Иконка
|
|
11
11
|
* @enumNames [
|
|
12
12
|
* "",
|
|
13
|
-
* "Деньги", "Лого «Apple»", "Банкомат", "Банк", "Бургер", "Бургер (белый)", "Календарь 2", "Скруглённый календарь", "Календарь", "Календарь с галочкой", "Календарь белый", "Кред. карта", "Кред. карта под наклоном", "Кред. карта с галочкой", "Карта с драгоценностями", "Деньги внутри кошелька", "Часы", "Крестик", "Кресло", "Кредитные карты", "Скидка", "Документ", "Документ (одноцветный)", "Документ с текстом", "Доллар", "Земля", "Пустой кошелёк с возвратом", "Пустой кошелёк", "Пустой кошелёк (белый)", "Евро", "Геолокация", "Зеркало", "Глобус", "Сетка", "Сетка (белая)", "Диаграмма роста", "Скидка", "JCB", "Лупа", "MasterCard", "Минус", "МИР", "Деньги", "Денежное страхование", "Монитор и мобильный", "Новый документ", "Офис", "Лого «Одноклассники»", "Бизнес", "Проценты (круг.)", "Проценты", "Проценты белые", "Персональная карта", "Лого «PlayMarket»", "Плюс", "Профиль, 2 персоны", "Профиль", "Рубль (круг.)", "Сейф", "Безопасность", "Подписанные документы", "Маленькие часы", "Лого «Telegram»", "UnionPay", "Пользователь", "Visa", "Лого «VK»", "Пополнение карты", "Кошелёк с плюсом", "Кошелёк", "Кошелёк с деньгами"
|
|
13
|
+
* "Деньги", "Лого «Apple»", "Банкомат", "Банк", "Бургер", "Бургер (белый)", "Календарь 2", "Скруглённый календарь", "Календарь", "Календарь с галочкой", "Календарь белый", "Кред. карта", "Кред. карта под наклоном", "Кред. карта с галочкой", "Карта с драгоценностями", "Деньги внутри кошелька", "Часы", "Крестик", "Кресло", "Кредитные карты", "Скидка", "Документ", "Документ (одноцветный)", "Документ с текстом", "Доллар", "Земля", "Пустой кошелёк с возвратом", "Пустой кошелёк", "Пустой кошелёк (белый)", "Евро", "Геолокация", "Зеркало", "Глобус", "Gps", "Сетка", "Сетка (белая)", "Диаграмма роста", "Скидка", "JCB", "Лупа", "MasterCard", "Минус", "МИР", "Деньги", "Денежное страхование", "Монитор и мобильный", "Новый документ", "Офис", "Лого «Одноклассники»", "Бизнес", "Проценты (круг.)", "Проценты", "Проценты белые", "Персональная карта", "Лого «PlayMarket»", "Плюс", "Профиль, 2 персоны", "Профиль", "Рубль (круг.)", "Сейф", "Безопасность", "Подписанные документы", "Маленькие часы", "Лого «Telegram»", "UnionPay", "Пользователь", "Visa", "Лого «VK»", "Пополнение карты", "Кошелёк с плюсом", "Кошелёк", "Кошелёк с деньгами"
|
|
14
14
|
* ]
|
|
15
15
|
*/
|
|
16
|
-
export type IconName = "" | "ActualBalanceIcon" | "AppleIcon" | "AtmIcon" | "BankIcon" | "BurgerIcon" | "BurgerIconWhite" | "Calendar2Icon" | "CalendarCircleIcon" | "CalendarIcon" | "CalendarTickIcon" | "CalendarWhiteIcon" | "CardIcon" | "CardPosIcon" | "CardTickIcon" | "CardWithGemIcon" | "ChartSquareIcon" | "ClockIcon" | "CloseIcon" | "ComfortableCompIcon" | "CreditCardsIcon" | "DiscountShapeIcon" | "DocIcon" | "DocIconMonoColor" | "DocumentTextIcon" | "DollarIcon" | "EarthIcon" | "EmptyWalletChangeIcon" | "EmptyWalletIcon" | "EmptyWalletWhiteIcon" | "EuroIcon" | "GeolocationIcon" | "GlassIcon" | "GlobalIcon" | "GridIcon" | "GridIconWhite" | "InterestGrowthIcon" | "InterestIcon" | "JCBIcon" | "LoupeIcon" | "MasterCardIcon" | "MinusIcon" | "MirIcon" | "MoneyIcon" | "MoneyInsuranceIcon" | "MonitorMobileIcon" | "NewDocIcon" | "OfficeIcon" | "OkIcon" | "PassSendIcon" | "PercentageRoundIcon" | "PercentageSquareIcon" | "PercentageSquareWhiteIcon" | "PersonalCardIcon" | "PlayMarketIcon" | "PlusIcon" | "Profile2UserIcon" | "ProfileIcon" | "RoundRubleIcon" | "SafeIcon" | "ShieldTickIcon" | "SignDocsIcon" | "SmallClockIcon" | "TelegramIcon" | "UnionPayIcon" | "UserTickIcon" | "VisaIcon" | "VKIcon" | "WalletAdd2Icon" | "WalletAddIcon" | "WalletIcon" | "WalletWithMoneyIcon";
|
|
16
|
+
export type IconName = "" | "ActualBalanceIcon" | "AppleIcon" | "AtmIcon" | "BankIcon" | "BurgerIcon" | "BurgerIconWhite" | "Calendar2Icon" | "CalendarCircleIcon" | "CalendarIcon" | "CalendarTickIcon" | "CalendarWhiteIcon" | "CardIcon" | "CardPosIcon" | "CardTickIcon" | "CardWithGemIcon" | "ChartSquareIcon" | "ClockIcon" | "CloseIcon" | "ComfortableCompIcon" | "CreditCardsIcon" | "DiscountShapeIcon" | "DocIcon" | "DocIconMonoColor" | "DocumentTextIcon" | "DollarIcon" | "EarthIcon" | "EmptyWalletChangeIcon" | "EmptyWalletIcon" | "EmptyWalletWhiteIcon" | "EuroIcon" | "GeolocationIcon" | "GlassIcon" | "GlobalIcon" | "GpsIcon" | "GridIcon" | "GridIconWhite" | "InterestGrowthIcon" | "InterestIcon" | "JCBIcon" | "LoupeIcon" | "MasterCardIcon" | "MinusIcon" | "MirIcon" | "MoneyIcon" | "MoneyInsuranceIcon" | "MonitorMobileIcon" | "NewDocIcon" | "OfficeIcon" | "OkIcon" | "PassSendIcon" | "PercentageRoundIcon" | "PercentageSquareIcon" | "PercentageSquareWhiteIcon" | "PersonalCardIcon" | "PlayMarketIcon" | "PlusIcon" | "Profile2UserIcon" | "ProfileIcon" | "RoundRubleIcon" | "SafeIcon" | "ShieldTickIcon" | "SignDocsIcon" | "SmallClockIcon" | "TelegramIcon" | "UnionPayIcon" | "UserTickIcon" | "VisaIcon" | "VKIcon" | "WalletAdd2Icon" | "WalletAddIcon" | "WalletIcon" | "WalletWithMoneyIcon";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type InputTypes = 'text' | 'number';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { InputProps } from './InputProps';
|
|
3
|
+
|
|
4
|
+
export const Input = JSX<InputProps>(({ className = '', id, name, type = 'text', placeholder }) => {
|
|
5
|
+
return (
|
|
6
|
+
<input className={className} id={id} name={name || id} type={type} placeholder={placeholder} />
|
|
7
|
+
);
|
|
8
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
|
|
3
|
+
export interface SelectProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const Select = JSX<SelectProps>(({ className = '', id, name, children }) => {
|
|
10
|
+
return (
|
|
11
|
+
<select className={className} id={id} name={name || id}>
|
|
12
|
+
{children}
|
|
13
|
+
</select>
|
|
14
|
+
);
|
|
15
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
|
|
3
|
+
export interface SelectOptionProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const SelectOption = JSX<SelectOptionProps>(({ className = '', value, children }) => {
|
|
9
|
+
return (
|
|
10
|
+
<option className={className} value={`${value}`}>
|
|
11
|
+
{children}
|
|
12
|
+
</option>
|
|
13
|
+
);
|
|
14
|
+
});
|
package/package.json
CHANGED
package/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>
|
package/src/components/Blocks.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { MiniGallery } from './MiniGallery/MiniGallery';
|
|
|
12
12
|
import { MobileAppTile } from './MobileAppTile/MobileAppTile';
|
|
13
13
|
import { Navigation } from './Navigation/Navigation';
|
|
14
14
|
import { PictureText } from './PictureText/PictureText';
|
|
15
|
+
import { Placeholder } from './Placeholder/Placeholder';
|
|
15
16
|
import { ProductBlock } from './ProductBlock/ProductBlock';
|
|
16
17
|
import { ProductGallery } from './ProductGallery/ProductGallery';
|
|
17
18
|
import { ProductTile } from './ProductTile/ProductTile';
|
|
@@ -44,4 +45,5 @@ export const Blocks = {
|
|
|
44
45
|
TextBlock,
|
|
45
46
|
Tile,
|
|
46
47
|
Navigation,
|
|
48
|
+
Placeholder,
|
|
47
49
|
};
|
|
@@ -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
|
+
}
|