@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,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
|
+
}
|
|
@@ -5,7 +5,7 @@ import { ExchangeRateTile } from './ExchangeRateTile';
|
|
|
5
5
|
export default {
|
|
6
6
|
default: (
|
|
7
7
|
<div className="container grid grid-cols-12">
|
|
8
|
-
<ExchangeRateTile context={context} className="col-span-
|
|
8
|
+
<ExchangeRateTile context={context} className="col-span-12" />
|
|
9
9
|
</div>
|
|
10
10
|
),
|
|
11
11
|
};
|
|
@@ -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>
|
package/src/icons/IconName.ts
CHANGED
|
@@ -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';
|
package/src/setup-fixture.ts
CHANGED
|
@@ -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
|
+
});
|