@redneckz/wildless-cms-uni-blocks 0.14.899 → 0.14.901
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 +221 -28
- 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/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/dist/components/ApplicationLeadForm/consents.js +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +8 -7
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -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/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/lib/components/ApplicationLeadForm/consents.js +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +8 -7
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -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/mobile/bundle/bundle.umd.js +221 -28
- 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/dist/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/mobile/dist/components/ApplicationLeadForm/consents.js +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +8 -7
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -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/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +2 -1
- package/mobile/lib/components/ApplicationLeadForm/consents.js +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +8 -7
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -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/src/components/ApplicationForm/ApplicationForm.example.json +92 -29
- package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +2 -1
- package/mobile/src/components/ApplicationLeadForm/consents.ts +1 -1
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +10 -7
- 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/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/ApplicationLeadForm/consents.ts +1 -1
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +10 -7
- 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/bundle/bundle.umd.js
CHANGED
|
@@ -755,10 +755,10 @@
|
|
|
755
755
|
const and = (a, b) => (...args) => a(...args) && b(...args);
|
|
756
756
|
|
|
757
757
|
const table = (...table) => (...input) => {
|
|
758
|
-
const [, unit] = assertNonEmpty(table.find(([predicate]) => predicate(...input)));
|
|
758
|
+
const [, unit] = assertNonEmpty$1(table.find(([predicate]) => predicate(...input)));
|
|
759
759
|
return unit(...input);
|
|
760
760
|
};
|
|
761
|
-
function assertNonEmpty(value) {
|
|
761
|
+
function assertNonEmpty$1(value) {
|
|
762
762
|
if (!value) {
|
|
763
763
|
throw new Error('Value should be fulfilled');
|
|
764
764
|
}
|
|
@@ -3388,7 +3388,7 @@
|
|
|
3388
3388
|
docId: 1,
|
|
3389
3389
|
},
|
|
3390
3390
|
consentPfrFlg: {
|
|
3391
|
-
text: 'Согласие на запрос в
|
|
3391
|
+
text: 'Согласие на запрос в CФР',
|
|
3392
3392
|
docId: 3,
|
|
3393
3393
|
},
|
|
3394
3394
|
};
|
|
@@ -6631,7 +6631,7 @@
|
|
|
6631
6631
|
}, []);
|
|
6632
6632
|
useEffect(() => {
|
|
6633
6633
|
leadFormStore.productType = productType;
|
|
6634
|
-
const {
|
|
6634
|
+
const { referalCode, refererCode, productId, marketingInfo } = getLeadQueryParams(queryFromStorage, sessionStore);
|
|
6635
6635
|
if (referalCode) {
|
|
6636
6636
|
sessionStore.referalData = {
|
|
6637
6637
|
refererCode,
|
|
@@ -6640,6 +6640,11 @@
|
|
|
6640
6640
|
};
|
|
6641
6641
|
}
|
|
6642
6642
|
sessionStore.marketingInfo = marketingInfo;
|
|
6643
|
+
}, [queryFromStorage]);
|
|
6644
|
+
useEffect(() => {
|
|
6645
|
+
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
6646
|
+
const code = params.get('code');
|
|
6647
|
+
const state = params.get('state');
|
|
6643
6648
|
if (code && state) {
|
|
6644
6649
|
requestEsiaProfile(code, state);
|
|
6645
6650
|
}
|
|
@@ -6647,16 +6652,14 @@
|
|
|
6647
6652
|
sessionStorage.removeItem('accessToken');
|
|
6648
6653
|
sessionStorage.removeItem('refreshToken');
|
|
6649
6654
|
}
|
|
6650
|
-
}, [
|
|
6655
|
+
}, []);
|
|
6651
6656
|
return initialFormState;
|
|
6652
6657
|
};
|
|
6653
6658
|
const getLeadQueryParams = (queryFromStorage, sessionStore) => {
|
|
6654
6659
|
const referalData = sessionStore.referalData;
|
|
6655
6660
|
const marketingInfoFromStorage = sessionStore.marketingInfo;
|
|
6656
6661
|
const queryStorage = new URLSearchParams(decodeURIComponent(queryFromStorage || ''));
|
|
6657
|
-
const
|
|
6658
|
-
const code = params.get('code');
|
|
6659
|
-
const state = params.get('state');
|
|
6662
|
+
const code = queryStorage.get('code');
|
|
6660
6663
|
const referalCode = code ? referalData?.referalCode : queryStorage.get('referalCode');
|
|
6661
6664
|
const refererCode = code ? referalData?.refererCode : queryStorage.get('refererCode');
|
|
6662
6665
|
const productId = code ? referalData?.productId : queryStorage.get('productId');
|
|
@@ -6672,8 +6675,6 @@
|
|
|
6672
6675
|
userId: queryStorage.get('userId'),
|
|
6673
6676
|
};
|
|
6674
6677
|
return {
|
|
6675
|
-
code,
|
|
6676
|
-
state,
|
|
6677
6678
|
referalCode,
|
|
6678
6679
|
refererCode,
|
|
6679
6680
|
productId,
|
|
@@ -10151,6 +10152,214 @@
|
|
|
10151
10152
|
};
|
|
10152
10153
|
const ErrorBlock = JSX(({ className = '', title, description, error, button, ...rest }) => (jsxs(BlockWrapper, { className: style('flex flex-col justify-center items-center', className), defaultPadding: style('p-6xl'), version: "transparent", ...rest, children: [jsx("div", { className: "flex justify-center", children: renderErrorContent(error) }), jsx(Headline, { title: title, description: description, headlineVersion: "XL", isEmbedded: true, className: "mb-2xl last:mb-0" }), button?.text ? (jsx(LinkButton, { version: button?.version, text: button?.text, ...button })) : null] })));
|
|
10153
10154
|
|
|
10155
|
+
const REGION_URL = `${API_BASE_URI$1}/region`;
|
|
10156
|
+
function useLocation(defaultLocation = 'Москва') {
|
|
10157
|
+
const locationStore = useLocalStore();
|
|
10158
|
+
return locationStore.location ?? { name: defaultLocation };
|
|
10159
|
+
}
|
|
10160
|
+
function useDefaultLocation(defaultLocation = 'Москва') {
|
|
10161
|
+
const locationStore = useLocalStore();
|
|
10162
|
+
const preselectLocation = useCallback(async () => {
|
|
10163
|
+
if (!locationStore.location) {
|
|
10164
|
+
const region = await fetchJSON(REGION_URL);
|
|
10165
|
+
locationStore.location = region ?? { name: defaultLocation };
|
|
10166
|
+
}
|
|
10167
|
+
}, [locationStore, defaultLocation]);
|
|
10168
|
+
useAsyncData(REGION_URL, preselectLocation);
|
|
10169
|
+
return locationStore;
|
|
10170
|
+
}
|
|
10171
|
+
|
|
10172
|
+
var Currency;
|
|
10173
|
+
(function (Currency) {
|
|
10174
|
+
Currency["RUB"] = "RUB";
|
|
10175
|
+
Currency["EUR"] = "EUR";
|
|
10176
|
+
Currency["USD"] = "USD";
|
|
10177
|
+
Currency["CNY"] = "CNY";
|
|
10178
|
+
})(Currency || (Currency = {}));
|
|
10179
|
+
|
|
10180
|
+
const currencyNumberFormat = new Intl.NumberFormat('ru', {
|
|
10181
|
+
style: 'currency',
|
|
10182
|
+
currency: Currency.RUB,
|
|
10183
|
+
});
|
|
10184
|
+
const formatCurrency = (value) => (value ? currencyNumberFormat.format(value) : '');
|
|
10185
|
+
|
|
10186
|
+
const TABLE_STYLE_BASE = 'text-m font-light text-secondary-text ';
|
|
10187
|
+
const TABLE_HEAD_STYLE = `${TABLE_STYLE_BASE} text-left`;
|
|
10188
|
+
const TABLE_HEAD_STYLE_CENTER = `${TABLE_STYLE_BASE} pl-5xl text-center`;
|
|
10189
|
+
const TABLE_HEAD_STYLE_RIGHT = `${TABLE_STYLE_BASE} pl-5xl text-right`;
|
|
10190
|
+
const CURRENCY_ICONS_MAP = {
|
|
10191
|
+
USD: 'DollarIcon',
|
|
10192
|
+
EUR: 'EuroIcon',
|
|
10193
|
+
CNY: 'ChineseYuanRenminbiIcon',
|
|
10194
|
+
};
|
|
10195
|
+
const CurrencyTable = JSX(({ className, exchangeCurrencyItems }) => (jsxs("table", { className: style('h-fit w-full', className), children: [jsx("thead", { children: jsxs("tr", { children: [jsx("th", { className: TABLE_HEAD_STYLE, children: jsx(Text, { size: "text-m", children: "\u0412\u0430\u043B\u044E\u0442\u0430" }) }), jsx("th", { className: TABLE_HEAD_STYLE_CENTER, children: jsx(Text, { size: "text-m", children: "\u041A\u0443\u043F\u0438\u0442\u044C" }) }), jsx("th", { className: TABLE_HEAD_STYLE_RIGHT, children: jsx(Text, { size: "text-m", children: "\u041F\u0440\u043E\u0434\u0430\u0442\u044C" }) })] }) }), jsx("tbody", { children: exchangeCurrencyItems.map(renderCurrencyRow) })] })));
|
|
10196
|
+
const renderCurrencyRow = (exchangeCurrencyItem) => {
|
|
10197
|
+
const currency = exchangeCurrencyItem?.currency?.currency;
|
|
10198
|
+
return (jsxs("tr", { className: "pb-2xs text-h6", children: [jsx("td", { className: "pt-m m-auto flex text-left", children: jsxs("div", { className: "flex items-center gap-xs", children: [currency ? (jsx(Img, { image: { icon: CURRENCY_ICONS_MAP[currency] }, width: "24", height: "24" })) : null, jsx(Text, { size: "text-h6", children: currency })] }) }), jsx("td", { className: "pt-m pl-5xl text-center", children: jsx(Text, { size: "text-h6", children: formatCurrency(exchangeCurrencyItem?.saleExchangeRate) }) }), jsx("td", { className: "pt-m pl-5xl text-right", children: jsx(Text, { size: "text-h6", children: formatCurrency(exchangeCurrencyItem?.buyExchangeRate) }) })] }, currency));
|
|
10199
|
+
};
|
|
10200
|
+
|
|
10201
|
+
const icon = { icon: 'GpsIcon' };
|
|
10202
|
+
const CurrentLocation = JSX(({ className = '', address }) => (jsxs("div", { className: style('flex gap-s w-full justify-between @sm:justify-center', className), children: [jsx(RoundedIcon, { ...icon, iconBgVersion: "primary", className: "shrink-0" }), jsxs("div", { className: "space-y-2xs whitespace-pre-wrap", children: [address ? (jsx(Paragraph, { size: "text-l", color: "text-primary-main", children: address })) : null, jsx(Paragraph, { size: "text-m", color: "text-secondary-text", children: "\u041A\u0443\u0440\u0441 \u0443\u043A\u0430\u0437\u0430\u043D \u0434\u043B\u044F \u0437\u0430\u0434\u0430\u043D\u043D\u043E\u0433\u043E \u043E\u0444\u0438\u0441\u0430" })] })] })));
|
|
10203
|
+
|
|
10204
|
+
const roundTo = (value, precision = 2) => {
|
|
10205
|
+
const factor = 10 ** precision;
|
|
10206
|
+
return Math.round(parseFloat(String(value)) * factor) / factor;
|
|
10207
|
+
};
|
|
10208
|
+
|
|
10209
|
+
const calculateResult = (value, rate, precision) => {
|
|
10210
|
+
const result = Number(formatValue(value)) * Math.pow(rate, precision ? -1 : 1);
|
|
10211
|
+
return Number.isInteger(result) ? result : roundTo(result);
|
|
10212
|
+
};
|
|
10213
|
+
const formatValue = (value) => value.replace(/[^\d.,]/g, '').replace(',', '.');
|
|
10214
|
+
|
|
10215
|
+
function assertNonEmpty(value) {
|
|
10216
|
+
if (!value) {
|
|
10217
|
+
throw new Error('Value should be fulfilled');
|
|
10218
|
+
}
|
|
10219
|
+
return value;
|
|
10220
|
+
}
|
|
10221
|
+
|
|
10222
|
+
const baseTableFunc = (table) => (input) => {
|
|
10223
|
+
const [, unit] = assertNonEmpty(table.find(([predicate]) => predicate(input)));
|
|
10224
|
+
return unit(input);
|
|
10225
|
+
};
|
|
10226
|
+
const tableFunc = (table) => baseTableFunc(table.map(([p, o]) => [p, () => o]));
|
|
10227
|
+
tableFunc.if = (predicate) => new TableFuncBuilder(undefined, predicate);
|
|
10228
|
+
class TableFuncBuilder {
|
|
10229
|
+
parent;
|
|
10230
|
+
predicate;
|
|
10231
|
+
unit;
|
|
10232
|
+
get entry() {
|
|
10233
|
+
return [assertNonEmpty(this.predicate), assertNonEmpty(this.unit)];
|
|
10234
|
+
}
|
|
10235
|
+
constructor(parent, predicate, unit) {
|
|
10236
|
+
this.parent = parent;
|
|
10237
|
+
this.predicate = predicate;
|
|
10238
|
+
this.unit = unit;
|
|
10239
|
+
}
|
|
10240
|
+
if(predicate) {
|
|
10241
|
+
return new TableFuncBuilder(this, predicate);
|
|
10242
|
+
}
|
|
10243
|
+
then(unit) {
|
|
10244
|
+
return new TableFuncBuilder(this.parent, this.predicate, unit);
|
|
10245
|
+
}
|
|
10246
|
+
else(unit) {
|
|
10247
|
+
return baseTableFunc([...buildTable(this), [() => true, unit]]);
|
|
10248
|
+
}
|
|
10249
|
+
}
|
|
10250
|
+
const buildTable = (builder) => [
|
|
10251
|
+
...(builder?.parent ? buildTable(builder.parent) : []),
|
|
10252
|
+
builder.entry,
|
|
10253
|
+
];
|
|
10254
|
+
|
|
10255
|
+
const callbackCurrencySelect = (props) => tableFunc([
|
|
10256
|
+
[
|
|
10257
|
+
(_) => _.value !== Currency.RUB && _.oppositeValue !== Currency.RUB,
|
|
10258
|
+
() => props.handleConvert(props.value, Currency.RUB),
|
|
10259
|
+
],
|
|
10260
|
+
[
|
|
10261
|
+
(_) => _.value === Currency.RUB && _.oppositeValue === Currency.RUB,
|
|
10262
|
+
() => props.handleConvert(props.value, Currency.USD),
|
|
10263
|
+
],
|
|
10264
|
+
[
|
|
10265
|
+
(_) => _.value === Currency.RUB && _.oppositeValue === Currency.RUB,
|
|
10266
|
+
() => props.handleConvert(props.value, Currency.CNY),
|
|
10267
|
+
],
|
|
10268
|
+
[() => true, () => props.handleConvert(props.value)],
|
|
10269
|
+
])(props)?.();
|
|
10270
|
+
|
|
10271
|
+
function renderInput(props) {
|
|
10272
|
+
const { placeholder, rates, selected, value, onChange, setSelected } = props;
|
|
10273
|
+
const ratesOptions = rates.map((_) => ({
|
|
10274
|
+
key: _?.currency?.currency ?? '',
|
|
10275
|
+
text: _?.currency?.currency ?? '',
|
|
10276
|
+
}));
|
|
10277
|
+
const selectedValue = { key: selected, text: selected };
|
|
10278
|
+
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] }));
|
|
10279
|
+
}
|
|
10280
|
+
|
|
10281
|
+
const ExchangeCurrencyCalculator = JSX(({ className = '', currencyRatesBuy, currencyRatesSell, button }) => {
|
|
10282
|
+
const [calcState, setCalcState] = useState({
|
|
10283
|
+
inputSell: '',
|
|
10284
|
+
inputBuy: '',
|
|
10285
|
+
selectSell: currencyRatesBuy?.[0]?.currency?.currency || Currency.RUB,
|
|
10286
|
+
selectBuy: currencyRatesSell?.[0]?.currency?.currency || Currency.USD,
|
|
10287
|
+
});
|
|
10288
|
+
const handleSetCalcState = useCallback((newState) => setCalcState((oldState) => ({ ...oldState, ...newState })), []);
|
|
10289
|
+
return (jsxs("div", { className: `flex flex-col gap-m pt-2xl ${className}`, children: [currencyRatesBuy && currencyRatesSell ? (jsxs("div", { className: "grid gap-m", children: [renderInput({
|
|
10290
|
+
placeholder: 'Хочу продать',
|
|
10291
|
+
rates: currencyRatesSell,
|
|
10292
|
+
selected: calcState.selectSell,
|
|
10293
|
+
setSelected: handleSelectSell(calcState, handleSetCalcState, currencyRatesSell),
|
|
10294
|
+
value: calcState.inputSell,
|
|
10295
|
+
onChange: (value) => handleInputSell(handleSetCalcState, currencyRatesSell)(value, calcState.selectSell, calcState.selectBuy),
|
|
10296
|
+
}), renderInput({
|
|
10297
|
+
placeholder: 'Получу',
|
|
10298
|
+
rates: currencyRatesBuy,
|
|
10299
|
+
selected: calcState.selectBuy,
|
|
10300
|
+
setSelected: handleSelectBuy(calcState, handleSetCalcState, currencyRatesBuy),
|
|
10301
|
+
value: calcState.inputBuy,
|
|
10302
|
+
onChange: (value) => handleInputBuy(handleSetCalcState, currencyRatesBuy)(value, calcState.selectBuy, calcState.selectSell),
|
|
10303
|
+
})] })) : null, button?.text ? (jsx(LinkButton, { text: button.text, version: button?.version, ...button })) : null] }));
|
|
10304
|
+
});
|
|
10305
|
+
const handleSelectSell = (calcState, setCalcState, currencyRatesSell) => (value) => {
|
|
10306
|
+
setCalcState({ selectSell: value });
|
|
10307
|
+
callbackCurrencySelect({
|
|
10308
|
+
value,
|
|
10309
|
+
oppositeValue: calcState.selectBuy,
|
|
10310
|
+
handleConvert: (currencyFrom = calcState.selectSell, currencyTo = calcState.selectBuy) => {
|
|
10311
|
+
handleInputSell(setCalcState, currencyRatesSell)(calcState.inputSell, currencyFrom, currencyTo);
|
|
10312
|
+
},
|
|
10313
|
+
});
|
|
10314
|
+
};
|
|
10315
|
+
const handleSelectBuy = (calcState, setCalcState, currencyRatesBuy) => (value) => {
|
|
10316
|
+
setCalcState({ selectBuy: value });
|
|
10317
|
+
callbackCurrencySelect({
|
|
10318
|
+
value,
|
|
10319
|
+
oppositeValue: calcState.selectSell,
|
|
10320
|
+
handleConvert: (currencyTo = calcState.selectBuy, currencyFrom = calcState.selectSell) => handleInputBuy(setCalcState, currencyRatesBuy)(calcState.inputBuy, currencyTo, currencyFrom),
|
|
10321
|
+
});
|
|
10322
|
+
};
|
|
10323
|
+
const handleInputSell = (setCalcState, currencyRatesSell) => (value, currencyFrom, currencyTo) => {
|
|
10324
|
+
setCalcState({ inputSell: formatValue(value), selectBuy: currencyTo });
|
|
10325
|
+
const rate = currencyRatesSell.find((_) => _.currency?.currency === currencyTo)?.buyExchangeRate ||
|
|
10326
|
+
currencyRatesSell.find((_) => _.currency?.currency === currencyFrom)?.buyExchangeRate;
|
|
10327
|
+
if (rate) {
|
|
10328
|
+
setCalcState({
|
|
10329
|
+
inputBuy: String(calculateResult(value, rate, currencyFrom === Currency.RUB) || ''),
|
|
10330
|
+
});
|
|
10331
|
+
}
|
|
10332
|
+
};
|
|
10333
|
+
const handleInputBuy = (setCalcState, currencyRatesBuy) => (value, currencyTo, currencyFrom) => {
|
|
10334
|
+
setCalcState({ inputBuy: formatValue(value), selectSell: currencyFrom });
|
|
10335
|
+
const rate = currencyRatesBuy.find((_) => _.currency?.currency === currencyFrom)?.saleExchangeRate ||
|
|
10336
|
+
currencyRatesBuy.find((_) => _.currency?.currency === currencyTo)?.saleExchangeRate;
|
|
10337
|
+
if (rate) {
|
|
10338
|
+
setCalcState({
|
|
10339
|
+
inputSell: String(calculateResult(value, rate, currencyTo === Currency.RUB) || ''),
|
|
10340
|
+
});
|
|
10341
|
+
}
|
|
10342
|
+
};
|
|
10343
|
+
|
|
10344
|
+
const EXCHANGE_RATES_URL = `${API_BASE_URI$1}/exchangerates`;
|
|
10345
|
+
function useFetchExchangeRateData(currentRegion) {
|
|
10346
|
+
const regionCode = currentRegion?.code || '000';
|
|
10347
|
+
const { data } = useAsyncData(EXCHANGE_RATES_URL + `?regionCode=${regionCode}`, fetchJSONUnsafe);
|
|
10348
|
+
return data || {};
|
|
10349
|
+
}
|
|
10350
|
+
|
|
10351
|
+
const ExchangeRateTile = JSX(({ className = '', title = 'Курсы обмена валют', button, ...rest }) => {
|
|
10352
|
+
const currentLocation = useLocation();
|
|
10353
|
+
const exchangeRates = useFetchExchangeRateData(currentLocation);
|
|
10354
|
+
const currencyRates = getCurrencyRates(exchangeRates?.exchangeRate?.currencies);
|
|
10355
|
+
const currencyRatesBuy = currencyRates.filter((_) => _.buyExchangeRate);
|
|
10356
|
+
currencyRatesBuy.unshift({ currency: { currency: Currency.RUB } });
|
|
10357
|
+
const currencyRatesSell = currencyRates.filter((_) => _.saleExchangeRate);
|
|
10358
|
+
currencyRatesSell.push({ currency: { currency: Currency.RUB } });
|
|
10359
|
+
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 })] }) }) }));
|
|
10360
|
+
});
|
|
10361
|
+
const getCurrencyRates = (currencies) => currencies?.filter((_) => [1, 2, 3].includes(_?.currency?.id)) || [];
|
|
10362
|
+
|
|
10154
10363
|
const LinkList = JSX(({ className = '', items }) => {
|
|
10155
10364
|
const link = useLink();
|
|
10156
10365
|
return (jsx("ul", { className: style('flex flex-col gap-s w-full', className), children: items?.map(renderLinkListItem(link)) }));
|
|
@@ -10717,23 +10926,6 @@
|
|
|
10717
10926
|
const handleIntersectionActivation$1 = (index) => (prev) => Math.max(prev, index + 1);
|
|
10718
10927
|
const handleIntersectionDeactivation$1 = (index) => (prev) => Math.min(prev, index);
|
|
10719
10928
|
|
|
10720
|
-
const REGION_URL = `${API_BASE_URI$1}/region`;
|
|
10721
|
-
function useLocation(defaultLocation = 'Москва') {
|
|
10722
|
-
const locationStore = useLocalStore();
|
|
10723
|
-
return locationStore.location ?? { name: defaultLocation };
|
|
10724
|
-
}
|
|
10725
|
-
function useDefaultLocation(defaultLocation = 'Москва') {
|
|
10726
|
-
const locationStore = useLocalStore();
|
|
10727
|
-
const preselectLocation = useCallback(async () => {
|
|
10728
|
-
if (!locationStore.location) {
|
|
10729
|
-
const region = await fetchJSON(REGION_URL);
|
|
10730
|
-
locationStore.location = region ?? { name: defaultLocation };
|
|
10731
|
-
}
|
|
10732
|
-
}, [locationStore, defaultLocation]);
|
|
10733
|
-
useAsyncData(REGION_URL, preselectLocation);
|
|
10734
|
-
return locationStore;
|
|
10735
|
-
}
|
|
10736
|
-
|
|
10737
10929
|
const groupBy = (list, keyGetter) => {
|
|
10738
10930
|
const result = new Map();
|
|
10739
10931
|
for (const item of list) {
|
|
@@ -11598,6 +11790,7 @@
|
|
|
11598
11790
|
ErrorBlock,
|
|
11599
11791
|
Footer,
|
|
11600
11792
|
GalleryLayout,
|
|
11793
|
+
ExchangeRateTile,
|
|
11601
11794
|
GrantSupport,
|
|
11602
11795
|
Header,
|
|
11603
11796
|
Headline,
|
|
@@ -11761,7 +11954,7 @@
|
|
|
11761
11954
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
11762
11955
|
});
|
|
11763
11956
|
|
|
11764
|
-
const packageVersion = "0.14.
|
|
11957
|
+
const packageVersion = "0.14.900";
|
|
11765
11958
|
|
|
11766
11959
|
exports.Blocks = Blocks;
|
|
11767
11960
|
exports.ContentPage = ContentPage;
|