@redneckz/wildless-cms-uni-blocks 0.14.898 → 0.14.900
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/bin/migration-scripts/0.14.900.js +18 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +287 -27
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/bundle/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
- package/bundle/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/bundle/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
- package/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
- package/bundle/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
- package/bundle/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
- package/bundle/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/bundle/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/bundle/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/bundle/components/ExchangeRateTile/renderInput.d.ts +11 -0
- package/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
- package/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
- package/bundle/components/OfficesAtmsMap/filters.d.ts +18 -0
- package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Blocks.mobile.js +2 -0
- package/dist/components/Blocks.mobile.js.map +1 -1
- package/dist/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
- package/dist/components/ExchangeRateTile/CurrencyProps.js +10 -0
- package/dist/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
- package/dist/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/dist/components/ExchangeRateTile/CurrencyTable.js +23 -0
- package/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
- package/dist/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
- package/dist/components/ExchangeRateTile/CurrentLocation.js +10 -0
- package/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +73 -0
- package/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js +26 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTileContent.js +2 -0
- package/dist/components/ExchangeRateTile/ExchangeRateTileContent.js.map +1 -0
- package/dist/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/dist/components/ExchangeRateTile/calculateResult.js +11 -0
- package/dist/components/ExchangeRateTile/calculateResult.js.map +1 -0
- package/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/dist/components/ExchangeRateTile/callbackCurrencySelect.js +21 -0
- package/dist/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
- package/dist/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/dist/components/ExchangeRateTile/formatCurrency.js +10 -0
- package/dist/components/ExchangeRateTile/formatCurrency.js.map +1 -0
- package/dist/components/ExchangeRateTile/renderInput.d.ts +11 -0
- package/dist/components/ExchangeRateTile/renderInput.js +16 -0
- package/dist/components/ExchangeRateTile/renderInput.js.map +1 -0
- package/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
- package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js +13 -0
- package/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
- package/dist/components/OfficesAtmsMap/FiltrationForm.js +58 -7
- package/dist/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
- package/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
- package/dist/components/OfficesAtmsMap/filters.d.ts +18 -0
- package/dist/components/OfficesAtmsMap/filters.js +18 -0
- package/dist/components/OfficesAtmsMap/filters.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Blocks.mobile.js +2 -0
- package/lib/components/Blocks.mobile.js.map +1 -1
- package/lib/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
- package/lib/components/ExchangeRateTile/CurrencyProps.js +8 -0
- package/lib/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
- package/lib/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/lib/components/ExchangeRateTile/CurrencyTable.js +21 -0
- package/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
- package/lib/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
- package/lib/components/ExchangeRateTile/CurrentLocation.js +8 -0
- package/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +71 -0
- package/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.fixture.d.ts +5 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.fixture.mobile.d.ts +5 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js +24 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTileContent.js +2 -0
- package/lib/components/ExchangeRateTile/ExchangeRateTileContent.js.map +1 -0
- package/lib/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/lib/components/ExchangeRateTile/calculateResult.js +7 -0
- package/lib/components/ExchangeRateTile/calculateResult.js.map +1 -0
- package/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/lib/components/ExchangeRateTile/callbackCurrencySelect.js +18 -0
- package/lib/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
- package/lib/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/lib/components/ExchangeRateTile/formatCurrency.js +7 -0
- package/lib/components/ExchangeRateTile/formatCurrency.js.map +1 -0
- package/lib/components/ExchangeRateTile/renderInput.d.ts +11 -0
- package/lib/components/ExchangeRateTile/renderInput.js +13 -0
- package/lib/components/ExchangeRateTile/renderInput.js.map +1 -0
- package/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
- package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js +10 -0
- package/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
- package/lib/components/OfficesAtmsMap/FiltrationForm.js +58 -7
- package/lib/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
- package/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
- package/lib/components/OfficesAtmsMap/filters.d.ts +18 -0
- package/lib/components/OfficesAtmsMap/filters.js +18 -0
- package/lib/components/OfficesAtmsMap/filters.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +287 -27
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/mobile/bundle/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
- package/mobile/bundle/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/mobile/bundle/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
- package/mobile/bundle/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
- package/mobile/bundle/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
- package/mobile/bundle/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
- package/mobile/bundle/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/mobile/bundle/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/mobile/bundle/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/mobile/bundle/components/ExchangeRateTile/renderInput.d.ts +11 -0
- package/mobile/bundle/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
- package/mobile/bundle/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
- package/mobile/bundle/components/OfficesAtmsMap/filters.d.ts +18 -0
- package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/mobile/dist/components/Blocks.js +2 -0
- package/mobile/dist/components/Blocks.js.map +1 -1
- package/mobile/dist/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyProps.js +10 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js +23 -0
- package/mobile/dist/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
- package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js +10 -0
- package/mobile/dist/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +73 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +26 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.js +2 -0
- package/mobile/dist/components/ExchangeRateTile/ExchangeRateTileContent.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/mobile/dist/components/ExchangeRateTile/calculateResult.js +11 -0
- package/mobile/dist/components/ExchangeRateTile/calculateResult.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.js +21 -0
- package/mobile/dist/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/mobile/dist/components/ExchangeRateTile/formatCurrency.js +10 -0
- package/mobile/dist/components/ExchangeRateTile/formatCurrency.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/renderInput.d.ts +11 -0
- package/mobile/dist/components/ExchangeRateTile/renderInput.js +16 -0
- package/mobile/dist/components/ExchangeRateTile/renderInput.js.map +1 -0
- package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
- package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js +13 -0
- package/mobile/dist/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
- package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.js +58 -7
- package/mobile/dist/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
- package/mobile/dist/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
- package/mobile/dist/components/OfficesAtmsMap/filters.d.ts +18 -0
- package/mobile/dist/components/OfficesAtmsMap/filters.js +18 -0
- package/mobile/dist/components/OfficesAtmsMap/filters.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/mobile/lib/components/Blocks.js +2 -0
- package/mobile/lib/components/Blocks.js.map +1 -1
- package/mobile/lib/components/ExchangeRateTile/CurrencyProps.d.ts +6 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyProps.js +8 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyProps.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.d.ts +7 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js +21 -0
- package/mobile/lib/components/ExchangeRateTile/CurrencyTable.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/CurrentLocation.d.ts +6 -0
- package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js +8 -0
- package/mobile/lib/components/ExchangeRateTile/CurrentLocation.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.d.ts +24 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js +71 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeCurrencyCalculator.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.d.ts +5 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +24 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.d.ts +9 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.js +2 -0
- package/mobile/lib/components/ExchangeRateTile/ExchangeRateTileContent.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/calculateResult.d.ts +2 -0
- package/mobile/lib/components/ExchangeRateTile/calculateResult.js +7 -0
- package/mobile/lib/components/ExchangeRateTile/calculateResult.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.d.ts +8 -0
- package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.js +18 -0
- package/mobile/lib/components/ExchangeRateTile/callbackCurrencySelect.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/formatCurrency.d.ts +1 -0
- package/mobile/lib/components/ExchangeRateTile/formatCurrency.js +7 -0
- package/mobile/lib/components/ExchangeRateTile/formatCurrency.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/renderInput.d.ts +11 -0
- package/mobile/lib/components/ExchangeRateTile/renderInput.js +13 -0
- package/mobile/lib/components/ExchangeRateTile/renderInput.js.map +1 -0
- package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.d.ts +9 -0
- package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js +10 -0
- package/mobile/lib/components/ExchangeRateTile/useFetchExchangeRateData.js.map +1 -0
- package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.js +58 -7
- package/mobile/lib/components/OfficesAtmsMap/FiltrationForm.js.map +1 -1
- package/mobile/lib/components/OfficesAtmsMap/OfficesAtmsMapProps.d.ts +6 -0
- package/mobile/lib/components/OfficesAtmsMap/filters.d.ts +18 -0
- package/mobile/lib/components/OfficesAtmsMap/filters.js +18 -0
- package/mobile/lib/components/OfficesAtmsMap/filters.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationForm.example.json +92 -29
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +2 -1
- package/mobile/src/components/Blocks.ts +2 -0
- package/mobile/src/components/ExchangeRateTile/CurrencyProps.ts +6 -0
- package/mobile/src/components/ExchangeRateTile/CurrencyTable.tsx +64 -0
- package/mobile/src/components/ExchangeRateTile/CurrentLocation.tsx +28 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +155 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.example.json +12 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +60 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.ui.json +8 -0
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +11 -0
- package/mobile/src/components/ExchangeRateTile/calculateResult.ts +9 -0
- package/mobile/src/components/ExchangeRateTile/callbackCurrencySelect.ts +25 -0
- package/mobile/src/components/ExchangeRateTile/formatCurrency.ts +8 -0
- package/mobile/src/components/ExchangeRateTile/renderInput.tsx +43 -0
- package/mobile/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +25 -0
- package/mobile/src/components/OfficesAtmsMap/FiltrationForm.tsx +91 -12
- package/mobile/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +6 -0
- package/mobile/src/components/OfficesAtmsMap/filters.ts +24 -0
- package/package.json +2 -2
- package/src/components/ApplicationForm/ApplicationForm.example.json +92 -29
- package/src/components/ApplicationForm/ApplicationForm.fixture.mobile.tsx +11 -11
- package/src/components/ApplicationForm/ApplicationForm.fixture.tsx +11 -11
- package/src/components/ApplicationForm/ApplicationFormContent.ts +2 -1
- package/src/components/Blocks.mobile.ts +2 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/ExchangeRateTile/CurrencyProps.ts +6 -0
- package/src/components/ExchangeRateTile/CurrencyTable.tsx +64 -0
- package/src/components/ExchangeRateTile/CurrentLocation.tsx +28 -0
- package/src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx +155 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.example.json +12 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.mobile.tsx +21 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.fixture.tsx +21 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +60 -0
- package/src/components/ExchangeRateTile/ExchangeRateTile.ui.json +8 -0
- package/src/components/ExchangeRateTile/ExchangeRateTileContent.ts +11 -0
- package/src/components/ExchangeRateTile/calculateResult.ts +9 -0
- package/src/components/ExchangeRateTile/callbackCurrencySelect.ts +25 -0
- package/src/components/ExchangeRateTile/formatCurrency.ts +8 -0
- package/src/components/ExchangeRateTile/renderInput.tsx +43 -0
- package/src/components/ExchangeRateTile/useFetchExchangeRateData.ts +25 -0
- package/src/components/OfficesAtmsMap/FiltrationForm.tsx +91 -12
- package/src/components/OfficesAtmsMap/OfficesAtmsMapProps.tsx +6 -0
- package/src/components/OfficesAtmsMap/filters.ts +24 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
4
|
+
import { LinkButton } from '../../ui-kit/LinkButton/LinkButton.js';
|
|
5
|
+
import { calculateResult, formatValue } from './calculateResult.js';
|
|
6
|
+
import { callbackCurrencySelect } from './callbackCurrencySelect.js';
|
|
7
|
+
import { Currency } from './CurrencyProps.js';
|
|
8
|
+
import { renderInput } from './renderInput.js';
|
|
9
|
+
export const ExchangeCurrencyCalculator = JSX(({ className = '', currencyRatesBuy, currencyRatesSell, button }) => {
|
|
10
|
+
const [calcState, setCalcState] = useState({
|
|
11
|
+
inputSell: '',
|
|
12
|
+
inputBuy: '',
|
|
13
|
+
selectSell: currencyRatesBuy?.[0]?.currency?.currency || Currency.RUB,
|
|
14
|
+
selectBuy: currencyRatesSell?.[0]?.currency?.currency || Currency.USD,
|
|
15
|
+
});
|
|
16
|
+
const handleSetCalcState = useCallback((newState) => setCalcState((oldState) => ({ ...oldState, ...newState })), []);
|
|
17
|
+
return (_jsxs("div", { className: `flex flex-col gap-m pt-2xl ${className}`, children: [currencyRatesBuy && currencyRatesSell ? (_jsxs("div", { className: "grid gap-m", children: [renderInput({
|
|
18
|
+
placeholder: 'Хочу продать',
|
|
19
|
+
rates: currencyRatesSell,
|
|
20
|
+
selected: calcState.selectSell,
|
|
21
|
+
setSelected: handleSelectSell(calcState, handleSetCalcState, currencyRatesSell),
|
|
22
|
+
value: calcState.inputSell,
|
|
23
|
+
onChange: (value) => handleInputSell(handleSetCalcState, currencyRatesSell)(value, calcState.selectSell, calcState.selectBuy),
|
|
24
|
+
}), renderInput({
|
|
25
|
+
placeholder: 'Получу',
|
|
26
|
+
rates: currencyRatesBuy,
|
|
27
|
+
selected: calcState.selectBuy,
|
|
28
|
+
setSelected: handleSelectBuy(calcState, handleSetCalcState, currencyRatesBuy),
|
|
29
|
+
value: calcState.inputBuy,
|
|
30
|
+
onChange: (value) => handleInputBuy(handleSetCalcState, currencyRatesBuy)(value, calcState.selectBuy, calcState.selectSell),
|
|
31
|
+
})] })) : null, button?.text ? (_jsx(LinkButton, { text: button.text, version: button?.version, ...button })) : null] }));
|
|
32
|
+
});
|
|
33
|
+
const handleSelectSell = (calcState, setCalcState, currencyRatesSell) => (value) => {
|
|
34
|
+
setCalcState({ selectSell: value });
|
|
35
|
+
callbackCurrencySelect({
|
|
36
|
+
value,
|
|
37
|
+
oppositeValue: calcState.selectBuy,
|
|
38
|
+
handleConvert: (currencyFrom = calcState.selectSell, currencyTo = calcState.selectBuy) => {
|
|
39
|
+
handleInputSell(setCalcState, currencyRatesSell)(calcState.inputSell, currencyFrom, currencyTo);
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const handleSelectBuy = (calcState, setCalcState, currencyRatesBuy) => (value) => {
|
|
44
|
+
setCalcState({ selectBuy: value });
|
|
45
|
+
callbackCurrencySelect({
|
|
46
|
+
value,
|
|
47
|
+
oppositeValue: calcState.selectSell,
|
|
48
|
+
handleConvert: (currencyTo = calcState.selectBuy, currencyFrom = calcState.selectSell) => handleInputBuy(setCalcState, currencyRatesBuy)(calcState.inputBuy, currencyTo, currencyFrom),
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
const handleInputSell = (setCalcState, currencyRatesSell) => (value, currencyFrom, currencyTo) => {
|
|
52
|
+
setCalcState({ inputSell: formatValue(value), selectBuy: currencyTo });
|
|
53
|
+
const rate = currencyRatesSell.find((_) => _.currency?.currency === currencyTo)?.buyExchangeRate ||
|
|
54
|
+
currencyRatesSell.find((_) => _.currency?.currency === currencyFrom)?.buyExchangeRate;
|
|
55
|
+
if (rate) {
|
|
56
|
+
setCalcState({
|
|
57
|
+
inputBuy: String(calculateResult(value, rate, currencyFrom === Currency.RUB) || ''),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const handleInputBuy = (setCalcState, currencyRatesBuy) => (value, currencyTo, currencyFrom) => {
|
|
62
|
+
setCalcState({ inputBuy: formatValue(value), selectSell: currencyFrom });
|
|
63
|
+
const rate = currencyRatesBuy.find((_) => _.currency?.currency === currencyFrom)?.saleExchangeRate ||
|
|
64
|
+
currencyRatesBuy.find((_) => _.currency?.currency === currencyTo)?.saleExchangeRate;
|
|
65
|
+
if (rate) {
|
|
66
|
+
setCalcState({
|
|
67
|
+
inputSell: String(calculateResult(value, rate, currencyTo === Currency.RUB) || ''),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=ExchangeCurrencyCalculator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExchangeCurrencyCalculator.js","sourceRoot":"","sources":["../../../src/components/ExchangeRateTile/ExchangeCurrencyCalculator.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAyB5C,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAC3C,CAAC,E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AgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,QAAQ,KAAK,YAAY,CAAC,EAAE,gBAAgB;QACrF,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,QAAQ,KAAK,UAAU,CAAC,EAAE,gBAAgB,CAAC;IACtF,IAAI,IAAI,EAAE;QACR,YAAY,CAAC;YACX,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,UAAU,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;SACnF,CAAC,CAAC;KACJ;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
2
|
+
import { type ExchangeRateTileContent } from './ExchangeRateTileContent';
|
|
3
|
+
export interface ExchangeRateTileProps extends ExchangeRateTileContent, UniBlockProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const ExchangeRateTile: import("@redneckz/uni-jsx").UNIComponent<ExchangeRateTileProps, any, any>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
+
import { useLocation } from '../../hooks/useLocation.js';
|
|
4
|
+
import { BaseTile } from '../../ui-kit/BaseTile/BaseTile.js';
|
|
5
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper.js';
|
|
6
|
+
import { Heading } from '../../ui-kit/Heading/Heading.js';
|
|
7
|
+
import { style } from '../../utils/style.js';
|
|
8
|
+
import { Currency } from './CurrencyProps.js';
|
|
9
|
+
import { CurrencyTable } from './CurrencyTable.js';
|
|
10
|
+
import { CurrentLocation } from './CurrentLocation.js';
|
|
11
|
+
import { ExchangeCurrencyCalculator, } from './ExchangeCurrencyCalculator.js';
|
|
12
|
+
import { useFetchExchangeRateData } from './useFetchExchangeRateData.js';
|
|
13
|
+
export const ExchangeRateTile = JSX(({ className = '', title = 'Курсы обмена валют', button, ...rest }) => {
|
|
14
|
+
const currentLocation = useLocation();
|
|
15
|
+
const exchangeRates = useFetchExchangeRateData(currentLocation);
|
|
16
|
+
const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
|
|
17
|
+
const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
|
|
18
|
+
currencyRatesBuy.unshift({ currency: { currency: Currency.RUB } });
|
|
19
|
+
const currencyRatesSell = currencyRates.filter((_) => _.saleExchangeRate);
|
|
20
|
+
currencyRatesSell.push({ currency: { currency: Currency.RUB } });
|
|
21
|
+
return (_jsx(BlockWrapper, { className: style('box-border min-h-80', className), ...rest, children: _jsx(BaseTile, { className: "h-full", title: _jsx(Heading, { headingType: "h4", title: title, className: "whitespace-pre-wrap" }), children: _jsxs("div", { className: "flex w-full gap-6xl flex-wrap @lg:flex-nowrap", children: [_jsxs("div", { className: "w-full @2xl:w-auto @5xl:w-1/2", children: [currencyRates ? (_jsx(CurrencyTable, { className: "mb-xl", exchangeCurrencyItems: currencyRates })) : null, _jsx(CurrentLocation, { address: exchangeRates?.address })] }), _jsx(ExchangeCurrencyCalculator, { className: "grow w-1/2", currencyRatesBuy: currencyRatesBuy, currencyRatesSell: currencyRatesSell, button: button })] }) }) }));
|
|
22
|
+
});
|
|
23
|
+
const getCurrencyRates = (currencies) => currencies?.filter((_) => [1, 2, 3].includes(_?.currency?.id)) || [];
|
|
24
|
+
//# sourceMappingURL=ExchangeRateTile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExchangeRateTile.js","sourceRoot":"","sources":["../../../src/components/ExchangeRateTile/ExchangeRateTile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,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AQ,EAAE,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAEjE,OAAO,CACL,KAAC,YAAY,IAAC,SAAS,EAAE,KAAK,CAAC,qBAAqB,EAAE,SAAS,CAAC,KAAM,IAAI,YACxE,KAAC,QAAQ,IACP,SAAS,EAAC,QAAQ,EAClB,KAAK,EAAE,KAAC,OAAO,IAAC,WAAW,EAAC,IAAI,EAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,qBAAqB,GAAG,YAEjF,eAAK,SAAS,EAAC,+CAA+C,aAC5D,eAAK,SAAS,EAAC,+BAA+B,aAC3C,aAAa,CAAC,CAAC,CAAC,CACf,KAAC,aAAa,IAAC,SAAS,EAAC,OAAO,EAAC,qBAAqB,EAAE,aAAa,GAAI,CAC1E,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,eAAe,IAAC,OAAO,EAAE,aAAa,EAAE,OAAO,GAAI,IAChD,EACN,KAAC,0BAA0B,IACzB,SAAS,EAAC,YAAY,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM,GACd,IACE,GACG,GACE,CAChB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,UAAmC,EAAE,EAAE,CAC/D,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAY,CAAC,CAAC,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type TitleProps } from '../../model/HeadlineType';
|
|
2
|
+
import { type LinkButtonContent } from '../../ui-kit/LinkButton/LinkButtonContent';
|
|
3
|
+
import { type UniBlockContent } from '../../UniBlock/UniBlockProps';
|
|
4
|
+
/**
|
|
5
|
+
* @title Курсы обмена валют
|
|
6
|
+
*/
|
|
7
|
+
export declare type ExchangeRateTileContent = UniBlockContent & TitleProps & {
|
|
8
|
+
button?: LinkButtonContent;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExchangeRateTileContent.js","sourceRoot":"","sources":["../../../src/components/ExchangeRateTile/ExchangeRateTileContent.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { roundTo } from '../../utils/roundTo.js';
|
|
2
|
+
export const calculateResult = (value, rate, precision) => {
|
|
3
|
+
const result = Number(formatValue(value)) * Math.pow(rate, precision ? -1 : 1);
|
|
4
|
+
return Number.isInteger(result) ? result : roundTo(result);
|
|
5
|
+
};
|
|
6
|
+
export const formatValue = (value) => value.replace(/[^\d.,]/g, '').replace(',', '.');
|
|
7
|
+
//# sourceMappingURL=calculateResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calculateResult.js","sourceRoot":"","sources":["../../../src/components/ExchangeRateTile/calculateResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,SAAkB,EAAE,EAAE;IACjF,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/E,OAAO,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Currency } from './CurrencyProps';
|
|
2
|
+
interface TableFuncProps {
|
|
3
|
+
value: Currency;
|
|
4
|
+
oppositeValue: Currency;
|
|
5
|
+
handleConvert: (currencyFrom?: Currency, currencyTo?: Currency) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const callbackCurrencySelect: (props: TableFuncProps) => void;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { tableFunc } from '../../utils/tableFunc.js';
|
|
2
|
+
import { Currency } from './CurrencyProps.js';
|
|
3
|
+
export const callbackCurrencySelect = (props) => tableFunc([
|
|
4
|
+
[
|
|
5
|
+
(_) => _.value !== Currency.RUB && _.oppositeValue !== Currency.RUB,
|
|
6
|
+
() => props.handleConvert(props.value, Currency.RUB),
|
|
7
|
+
],
|
|
8
|
+
[
|
|
9
|
+
(_) => _.value === Currency.RUB && _.oppositeValue === Currency.RUB,
|
|
10
|
+
() => props.handleConvert(props.value, Currency.USD),
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
(_) => _.value === Currency.RUB && _.oppositeValue === Currency.RUB,
|
|
14
|
+
() => props.handleConvert(props.value, Currency.CNY),
|
|
15
|
+
],
|
|
16
|
+
[() => true, () => props.handleConvert(props.value)],
|
|
17
|
+
])(props)?.();
|
|
18
|
+
//# sourceMappingURL=callbackCurrencySelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callbackCurrencySelect.js","sourceRoot":"","sources":["../../../src/components/ExchangeRateTile/callbackCurrencySelect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAQ3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAqB,EAAE,EAAE,CAC9D,SAAS,CAA6B;IACpC;QACE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,aAAa,KAAK,QAAQ,CAAC,GAAG;QACnE,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC;KACrD;IACD;QACE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,aAAa,KAAK,QAAQ,CAAC,GAAG;QACnE,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC;KACrD;IACD;QACE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,aAAa,KAAK,QAAQ,CAAC,GAAG;QACnE,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC;KACrD;IACD,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;CACrD,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatCurrency: (value?: number) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Currency } from './CurrencyProps.js';
|
|
2
|
+
const currencyNumberFormat = new Intl.NumberFormat('ru', {
|
|
3
|
+
style: 'currency',
|
|
4
|
+
currency: Currency.RUB,
|
|
5
|
+
});
|
|
6
|
+
export const formatCurrency = (value) => (value ? currencyNumberFormat.format(value) : '');
|
|
7
|
+
//# sourceMappingURL=formatCurrency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatCurrency.js","sourceRoot":"","sources":["../../../src/components/ExchangeRateTile/formatCurrency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,MAAM,oBAAoB,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;IACvD,KAAK,EAAE,UAAU;IACjB,QAAQ,EAAE,QAAQ,CAAC,GAAG;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ControlProps } from '../../model/ControlProps';
|
|
2
|
+
import { type PlaceholderProps } from '../../model/PlaceholderProps';
|
|
3
|
+
import { type Currency } from './CurrencyProps';
|
|
4
|
+
import { type ExchangeCurrencyItem } from './ExchangeCurrencyCalculator';
|
|
5
|
+
interface InputProps extends PlaceholderProps, ControlProps<string> {
|
|
6
|
+
rates: ExchangeCurrencyItem[];
|
|
7
|
+
selected: string;
|
|
8
|
+
setSelected: (value: Currency) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function renderInput(props: InputProps): any;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
|
+
import { Input } from '../../ui-kit/Input/Input.js';
|
|
3
|
+
import { Select } from '../../ui-kit/Select/Select.js';
|
|
4
|
+
export function renderInput(props) {
|
|
5
|
+
const { placeholder, rates, selected, value, onChange, setSelected } = props;
|
|
6
|
+
const ratesOptions = rates.map((_) => ({
|
|
7
|
+
key: _?.currency?.currency ?? '',
|
|
8
|
+
text: _?.currency?.currency ?? '',
|
|
9
|
+
}));
|
|
10
|
+
const selectedValue = { key: selected, text: selected };
|
|
11
|
+
return (_jsxs("div", { className: "relative flex", children: [_jsx(Input, { className: "shrink-0 text-l w-full appearance-none -mr-20", placeholder: placeholder, type: "text", value: value, onChange: onChange }), ratesOptions.length ? (_jsx(Select, { className: "absolute right-0", isBorder: false, onChange: (_) => setSelected(_.key), options: ratesOptions, value: selectedValue })) : null] }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=renderInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderInput.js","sourceRoot":"","sources":["../../../src/components/ExchangeRateTile/renderInput.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAUpD,MAAM,UAAU,WAAW,CAAC,KAAiB;IAC3C,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC7E,MAAM,YAAY,GAAa,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/C,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,IAAI,EAAE;QAChC,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,IAAI,EAAE;KAClC,CAAC,CAAC,CAAC;IACJ,MAAM,aAAa,GAAW,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAEhE,OAAO,CACL,eAAK,SAAS,EAAC,eAAe,aAC5B,KAAC,KAAK,IACJ,SAAS,EAAC,+CAA+C,EACzD,WAAW,EAAE,WAAW,EACxB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,GAClB,EACD,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CACrB,KAAC,MAAM,IACL,SAAS,EAAC,kBAAkB,EAC5B,QAAQ,EAAE,KAAK,EACf,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,GAAe,CAAC,EAC/C,OAAO,EAAE,YAAY,EACrB,KAAK,EAAE,aAAa,GACpB,CACH,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ExchangeCurrencyItem } from '../../components/ExchangeRateTile/ExchangeCurrencyCalculator';
|
|
2
|
+
import { type Region } from '../../hooks/useRegions';
|
|
3
|
+
export interface ExchangeData {
|
|
4
|
+
exchangeRate?: {
|
|
5
|
+
currencies?: ExchangeCurrencyItem[];
|
|
6
|
+
};
|
|
7
|
+
address?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function useFetchExchangeRateData(currentRegion: Region): ExchangeData;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
|
|
2
|
+
import { API_BASE_URI } from '../../api/apiBaseUrl.js';
|
|
3
|
+
import { fetchJSONUnsafe } from '../../utils/fetchJSON.js';
|
|
4
|
+
const EXCHANGE_RATES_URL = `${API_BASE_URI}/exchangerates`;
|
|
5
|
+
export function useFetchExchangeRateData(currentRegion) {
|
|
6
|
+
const regionCode = currentRegion?.code || '000';
|
|
7
|
+
const { data } = useAsyncData(EXCHANGE_RATES_URL + `?regionCode=${regionCode}`, fetchJSONUnsafe);
|
|
8
|
+
return data || {};
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=useFetchExchangeRateData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFetchExchangeRateData.js","sourceRoot":"","sources":["../../../src/components/ExchangeRateTile/useFetchExchangeRateData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAE,eAAe,EAA4B,MAAM,uBAAuB,CAAC;AASlF,MAAM,kBAAkB,GAAG,GAAG,YAAY,gBAAgB,CAAC;AAE3D,MAAM,UAAU,wBAAwB,CAAC,aAAqB;IAC5D,MAAM,UAAU,GAAG,aAAa,EAAE,IAAI,IAAI,KAAK,CAAC;IAEhD,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,CAC3B,kBAAkB,GAAG,eAAe,UAAU,EAAE,EAChD,eAAoD,CACrD,CAAC;IAEF,OAAO,IAAI,IAAI,EAAE,CAAC;AACpB,CAAC"}
|
|
@@ -8,14 +8,65 @@ import { DefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton.js';
|
|
|
8
8
|
import { Foldable } from '../../ui-kit/Foldable/Foldable.js';
|
|
9
9
|
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection.js';
|
|
10
10
|
import { Icon } from '../../ui-kit/Icon/Icon.js';
|
|
11
|
+
import { Text } from '../../ui-kit/Text/Text.js';
|
|
11
12
|
const COMMON_FILTERS_STYLES = 'flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const VISIBLE_FILTERS = [
|
|
14
|
+
'workingSaturday',
|
|
15
|
+
'premiumService',
|
|
16
|
+
'privateBanking',
|
|
17
|
+
'remoteWorkplace',
|
|
18
|
+
'serviceDisabledPeople',
|
|
19
|
+
'transferringDataToBiometricSystem',
|
|
20
|
+
];
|
|
21
|
+
const PRECIOUS_METALS_FILTERS = [
|
|
22
|
+
'sellingCoins',
|
|
23
|
+
'buyingCoins',
|
|
24
|
+
'bullionOperations',
|
|
25
|
+
'preciousMetalsOperations',
|
|
26
|
+
];
|
|
27
|
+
const DISABLED_SERVICE_FILTERS = [
|
|
28
|
+
'hasAccessibilitySign',
|
|
29
|
+
'equippedWithRamp',
|
|
30
|
+
'equippedWithLift',
|
|
31
|
+
'equippedWithElevator',
|
|
32
|
+
'equippedWithStairclimber',
|
|
33
|
+
'hasHelpMeButton',
|
|
34
|
+
];
|
|
35
|
+
const VISIBLE_ATMS_FILTERS_NUM = 6;
|
|
36
|
+
export const FiltrationForm = JSX(({ filters = [], field: { field, reset }, onlyOffice, labels }) => {
|
|
37
|
+
const filtersCheckbox = filters.map((key) => (_jsx(Checkbox, { text: labels[key], ...field(key) }, key)));
|
|
38
|
+
const [visibleFilters, hiddenPreciousMetalsFilters, hiddenDisabledServiceFilters] = getFilters({
|
|
39
|
+
onlyOffice,
|
|
40
|
+
filtersCheckbox,
|
|
41
|
+
});
|
|
18
42
|
const [isUnfolded, { toggle }] = useBool(false);
|
|
19
|
-
return (_jsx("div", { children: filters?.length ? (_jsx("div", { children: _jsxs(Foldable, { children: [
|
|
43
|
+
return (_jsx("div", { children: filters?.length ? (_jsx("div", { children: _jsxs(Foldable, { children: [_jsx("div", { children: _jsx("div", { className: COMMON_FILTERS_STYLES, children: visibleFilters }) }), _jsxs("div", { className: "flex space-x-lg pb-2xl", children: [onlyOffice ? (_jsx(DefaultFoldButton, { label: isUnfolded ? 'Меньше фильтров' : 'Больше фильтров', isUnfolded: isUnfolded, embedded: true, short: true, onClick: toggle })) : null, _jsxs(Button, { embedded: true, onClick: reset, children: [_jsx(ButtonTitle, { children: "\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440" }), _jsx(Icon, { name: "CloseIcon", size: "small" })] })] }), _jsx("div", { children: _jsxs(FoldableSection, { isUnfolded: isUnfolded, children: [renderFoldableSubsection('Драгоценные металлы', hiddenPreciousMetalsFilters), renderFoldableSubsection('Специальные возможности', hiddenDisabledServiceFilters)] }) })] }) })) : null }));
|
|
20
44
|
});
|
|
45
|
+
const getFilters = ({ onlyOffice = false, filtersCheckbox = [] }) => {
|
|
46
|
+
return onlyOffice ? getOfficeFilters(filtersCheckbox) : getAtmsFilters(filtersCheckbox);
|
|
47
|
+
};
|
|
48
|
+
const getOfficeFilters = (filtersCheckbox) => {
|
|
49
|
+
const visibleFilters = [];
|
|
50
|
+
const preciousMetalsFilters = [];
|
|
51
|
+
const disabledServiceFilters = [];
|
|
52
|
+
for (const item of filtersCheckbox) {
|
|
53
|
+
if (VISIBLE_FILTERS.includes(item.key)) {
|
|
54
|
+
visibleFilters.push(item);
|
|
55
|
+
}
|
|
56
|
+
if (PRECIOUS_METALS_FILTERS.includes(item.key)) {
|
|
57
|
+
preciousMetalsFilters.push(item);
|
|
58
|
+
}
|
|
59
|
+
if (DISABLED_SERVICE_FILTERS.includes(item.key)) {
|
|
60
|
+
disabledServiceFilters.push(item);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return [visibleFilters, preciousMetalsFilters, disabledServiceFilters];
|
|
64
|
+
};
|
|
65
|
+
const getAtmsFilters = (filtersCheckbox) => [
|
|
66
|
+
filtersCheckbox.slice(0, VISIBLE_ATMS_FILTERS_NUM),
|
|
67
|
+
filtersCheckbox.slice(VISIBLE_ATMS_FILTERS_NUM),
|
|
68
|
+
];
|
|
69
|
+
const renderFoldableSubsection = (text, filters = []) => {
|
|
70
|
+
return (_jsx("div", { children: filters.length > 0 ? (_jsxs("div", { className: "space-y-s", children: [_jsx(Text, { children: text }), _jsx("div", { className: COMMON_FILTERS_STYLES, children: filters })] })) : null }));
|
|
71
|
+
};
|
|
21
72
|
//# sourceMappingURL=FiltrationForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FiltrationForm.js","sourceRoot":"","sources":["../../../src/components/OfficesAtmsMap/FiltrationForm.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,WAAW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GAAG,CAAC,eAAsC,EAAE,EAAE,CAAC;IACjE,eAAe,CAAC,KAAK,CAAC,CAAC,EAAE,wBAAwB,CAAC;IAClD,eAAe,CAAC,KAAK,CAAC,wBAAwB,CAAC;CAChD,CAAC;AAEF,MAAM,wBAAwB,GAAG,CAAC,IAAY,EAAE,UAAiC,EAAE,EAAE,EAAE;IACrF,OAAO,CACL,wBACG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACpB,eAAK,SAAS,EAAC,WAAW,aACxB,KAAC,IAAI,cAAE,IAAI,GAAQ,EACnB,cAAK,SAAS,EAAE,qBAAqB,YAAG,OAAO,GAAO,IAClD,CACP,CAAC,CAAC,CAAC,IAAI,GACJ,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -74,6 +74,12 @@ export interface Branch {
|
|
|
74
74
|
preciousMetalsOperations?: false;
|
|
75
75
|
transferringDataToBiometricSystem?: false;
|
|
76
76
|
serviceDisabledPeople?: false;
|
|
77
|
+
hasAccessibilitySign?: boolean;
|
|
78
|
+
equippedWithRamp?: boolean;
|
|
79
|
+
equippedWithLift?: boolean;
|
|
80
|
+
equippedWithElevator?: boolean;
|
|
81
|
+
equippedWithStairclimber?: boolean;
|
|
82
|
+
hasHelpMeButton?: boolean;
|
|
77
83
|
}
|
|
78
84
|
export interface RemoteWorkplace extends DescriptionProps {
|
|
79
85
|
id?: number;
|
|
@@ -14,6 +14,12 @@ export declare const INITIAL_FILTRATION_STATE: {
|
|
|
14
14
|
bullionOperations: boolean;
|
|
15
15
|
preciousMetalsOperations: boolean;
|
|
16
16
|
transferringDataToBiometricSystem: boolean;
|
|
17
|
+
hasAccessibilitySign: boolean;
|
|
18
|
+
equippedWithRamp: boolean;
|
|
19
|
+
equippedWithLift: boolean;
|
|
20
|
+
equippedWithElevator: boolean;
|
|
21
|
+
equippedWithStairclimber: boolean;
|
|
22
|
+
hasHelpMeButton: boolean;
|
|
17
23
|
};
|
|
18
24
|
export declare const FILTRATION_LABELS: {
|
|
19
25
|
billAcceptorEnable: string;
|
|
@@ -33,6 +39,12 @@ export declare const FILTRATION_LABELS: {
|
|
|
33
39
|
serviceDisabledPeople: string;
|
|
34
40
|
workAllTime: string;
|
|
35
41
|
workingSaturday: string;
|
|
42
|
+
hasAccessibilitySign: string;
|
|
43
|
+
equippedWithRamp: string;
|
|
44
|
+
equippedWithLift: string;
|
|
45
|
+
equippedWithElevator: string;
|
|
46
|
+
equippedWithStairclimber: string;
|
|
47
|
+
hasHelpMeButton: string;
|
|
36
48
|
};
|
|
37
49
|
export declare const FILTRATION_PREDICATES: {
|
|
38
50
|
workingSaturday: (item: Branch | RemoteWorkplace) => boolean;
|
|
@@ -45,6 +57,12 @@ export declare const FILTRATION_PREDICATES: {
|
|
|
45
57
|
bullionOperations: (item: Branch | RemoteWorkplace) => boolean;
|
|
46
58
|
preciousMetalsOperations: (item: Branch | RemoteWorkplace) => boolean;
|
|
47
59
|
transferringDataToBiometricSystem: (item: Branch | RemoteWorkplace) => boolean;
|
|
60
|
+
hasAccessibilitySign: (item: Branch | RemoteWorkplace) => boolean;
|
|
61
|
+
equippedWithRamp: (item: Branch | RemoteWorkplace) => boolean;
|
|
62
|
+
equippedWithLift: (item: Branch | RemoteWorkplace) => boolean;
|
|
63
|
+
equippedWithElevator: (item: Branch | RemoteWorkplace) => boolean;
|
|
64
|
+
equippedWithStairclimber: (item: Branch | RemoteWorkplace) => boolean;
|
|
65
|
+
hasHelpMeButton: (item: Branch | RemoteWorkplace) => boolean;
|
|
48
66
|
terminalTypeTerm: (item: Atm) => boolean;
|
|
49
67
|
terminalTypeAtms: (item: Atm) => boolean;
|
|
50
68
|
workAllTime: (item: Atm) => boolean;
|
|
@@ -15,6 +15,12 @@ export const INITIAL_FILTRATION_STATE = {
|
|
|
15
15
|
bullionOperations: false,
|
|
16
16
|
preciousMetalsOperations: false,
|
|
17
17
|
transferringDataToBiometricSystem: false,
|
|
18
|
+
hasAccessibilitySign: false,
|
|
19
|
+
equippedWithRamp: false,
|
|
20
|
+
equippedWithLift: false,
|
|
21
|
+
equippedWithElevator: false,
|
|
22
|
+
equippedWithStairclimber: false,
|
|
23
|
+
hasHelpMeButton: false,
|
|
18
24
|
...ATMS_INITIAL_FILTRATION_STATE,
|
|
19
25
|
};
|
|
20
26
|
export const FILTRATION_LABELS = {
|
|
@@ -35,6 +41,12 @@ export const FILTRATION_LABELS = {
|
|
|
35
41
|
serviceDisabledPeople: 'Для маломобильных граждан',
|
|
36
42
|
workAllTime: 'Круглосуточно',
|
|
37
43
|
workingSaturday: 'Открыты по субботам',
|
|
44
|
+
hasAccessibilitySign: 'Без барьеров',
|
|
45
|
+
equippedWithRamp: 'Есть пандус',
|
|
46
|
+
equippedWithLift: 'Есть подъёмник',
|
|
47
|
+
equippedWithElevator: 'Есть лифт',
|
|
48
|
+
equippedWithStairclimber: 'Есть лестницеход',
|
|
49
|
+
hasHelpMeButton: 'Есть кнопка «HELP ME»',
|
|
38
50
|
};
|
|
39
51
|
const FILTRATION_PREDICATES_ATMS = {
|
|
40
52
|
terminalTypeTerm: (item) => item.terminalType?.toLowerCase() === 'терминал',
|
|
@@ -56,5 +68,11 @@ export const FILTRATION_PREDICATES = {
|
|
|
56
68
|
bullionOperations: (item) => Boolean('bullionOperations' in item && item.bullionOperations),
|
|
57
69
|
preciousMetalsOperations: (item) => Boolean('preciousMetalsOperations' in item && item.preciousMetalsOperations),
|
|
58
70
|
transferringDataToBiometricSystem: (item) => Boolean('transferringDataToBiometricSystem' in item && item.transferringDataToBiometricSystem),
|
|
71
|
+
hasAccessibilitySign: (item) => Boolean('hasAccessibilitySign' in item && item.hasAccessibilitySign),
|
|
72
|
+
equippedWithRamp: (item) => Boolean('equippedWithRamp' in item && item.equippedWithRamp),
|
|
73
|
+
equippedWithLift: (item) => Boolean('equippedWithLift' in item && item.equippedWithLift),
|
|
74
|
+
equippedWithElevator: (item) => Boolean('equippedWithElevator' in item && item.equippedWithElevator),
|
|
75
|
+
equippedWithStairclimber: (item) => Boolean('equippedWithStairclimber' in item && item.equippedWithStairclimber),
|
|
76
|
+
hasHelpMeButton: (item) => Boolean('hasHelpMeButton' in item && item.hasHelpMeButton),
|
|
59
77
|
};
|
|
60
78
|
//# sourceMappingURL=filters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../src/components/OfficesAtmsMap/filters.ts"],"names":[],"mappings":"AAEA,MAAM,6BAA6B,GAAG;IACpC,kBAAkB,EAAE,KAAK;IACzB,WAAW,EAAE,KAAK;IAClB,gBAAgB,EAAE,KAAK;IACvB,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,eAAe,EAAE,KAAK;IACtB,cAAc,EAAE,KAAK;IACrB,cAAc,EAAE,KAAK;IACrB,eAAe,EAAE,KAAK;IACtB,qBAAqB,EAAE,KAAK;IAC5B,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,KAAK;IAClB,iBAAiB,EAAE,KAAK;IACxB,wBAAwB,EAAE,KAAK;IAC/B,iCAAiC,EAAE,KAAK;IACxC,GAAG,6BAA6B;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,kBAAkB,EAAE,gBAAgB;IACpC,iBAAiB,EAAE,sBAAsB;IACzC,WAAW,EAAE,uCAAuC;IACpD,oBAAoB,EAAE,kBAAkB;IACxC,sBAAsB,EAAE,mBAAmB;IAC3C,wBAAwB,EAAE,mCAAmC;IAC7D,cAAc,EAAE,0BAA0B;IAC1C,cAAc,EAAE,wBAAwB;IACxC,eAAe,EAAE,yBAAyB;IAC1C,gBAAgB,EAAE,WAAW;IAC7B,gBAAgB,EAAE,WAAW;IAC7B,iCAAiC,EAAE,wDAAwD;IAC3F,YAAY,EAAE,uCAAuC;IACrD,kBAAkB,EAAE,sCAAsC;IAC1D,qBAAqB,EAAE,2BAA2B;IAClD,WAAW,EAAE,eAAe;IA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