@redneckz/wildless-cms-uni-blocks 0.6.24 → 0.6.26
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 +97 -58
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/BenefitsBlock/BenefitsBlock.d.ts +2 -1
- package/bundle/components/Catalog/CatalogContent.d.ts +2 -0
- package/bundle/components/ContentPage/computeAPIFallback.d.ts +1 -1
- package/bundle/components/ContentPage/normalizePage.d.ts +1 -1
- package/bundle/components/Header/HeaderContent.d.ts +1 -2
- package/bundle/components/InvestmentGallery/InvestmentGallery.d.ts +5 -0
- package/bundle/components/InvestmentGallery/InvestmentGalleryCard.d.ts +7 -0
- package/bundle/components/InvestmentGallery/InvestmentGalleryContent.d.ts +50 -0
- package/bundle/content-page-repository/ContentPageRepository.d.ts +12 -9
- package/bundle/model/BorderVersion.d.ts +6 -0
- package/bundle/services/sitemap/useSitemap.d.ts +2 -2
- package/bundle/ui-kit/CurrencyInput/{adjustValue .d.ts → adjustValue.d.ts} +0 -0
- package/dist/components/BenefitsBlock/BenefitsBlock.d.ts +2 -1
- package/dist/components/BenefitsBlock/BenefitsBlock.js +5 -9
- package/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/Catalog/CatalogContent.d.ts +2 -0
- package/dist/components/ContentPage/computeAPIFallback.d.ts +1 -1
- package/dist/components/ContentPage/computeAPIFallback.js +1 -1
- package/dist/components/ContentPage/computeAPIFallback.js.map +1 -1
- package/dist/components/ContentPage/normalizeBlock.js +4 -8
- package/dist/components/ContentPage/normalizeBlock.js.map +1 -1
- package/dist/components/ContentPage/normalizeBlock.mobile.js +4 -8
- package/dist/components/ContentPage/normalizeBlock.mobile.js.map +1 -1
- package/dist/components/ContentPage/normalizePage.d.ts +1 -1
- package/dist/components/ContentPage/normalizePage.js +1 -6
- package/dist/components/ContentPage/normalizePage.js.map +1 -1
- package/dist/components/Header/Header.js +9 -9
- package/dist/components/Header/Header.js.map +1 -1
- package/dist/components/Header/Header.mobile.js +6 -6
- package/dist/components/Header/Header.mobile.js.map +1 -1
- package/dist/components/Header/HeaderContent.d.ts +1 -2
- package/dist/components/InvestmentGallery/InvestmentGallery.d.ts +5 -0
- package/dist/components/InvestmentGallery/InvestmentGallery.js +40 -0
- package/dist/components/InvestmentGallery/InvestmentGallery.js.map +1 -0
- package/dist/components/InvestmentGallery/InvestmentGalleryCard.d.ts +7 -0
- package/dist/components/InvestmentGallery/InvestmentGalleryCard.js +24 -0
- package/dist/components/InvestmentGallery/InvestmentGalleryCard.js.map +1 -0
- package/dist/components/InvestmentGallery/InvestmentGalleryContent.d.ts +50 -0
- package/dist/components/InvestmentGallery/InvestmentGalleryContent.js +2 -0
- package/dist/components/InvestmentGallery/InvestmentGalleryContent.js.map +1 -0
- package/dist/components/PictureText/PictureText.js +2 -2
- package/dist/components/PictureText/PictureText.js.map +1 -1
- package/dist/components/ProductGallery/ProductGallery.js +2 -2
- package/dist/components/ProductGallery/ProductGallery.js.map +1 -1
- package/dist/components/Recommendation/Recommendation.js +7 -5
- package/dist/components/Recommendation/Recommendation.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.mobile.js +1 -5
- package/dist/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/dist/content-page-repository/ContentPageRepository.d.ts +12 -9
- package/dist/content-page-repository/ContentPageRepository.js +24 -35
- package/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/dist/model/BorderVersion.d.ts +6 -0
- package/dist/model/BorderVersion.js +7 -0
- package/dist/model/BorderVersion.js.map +1 -0
- package/dist/services/sitemap/useSitemap.d.ts +2 -2
- package/dist/services/sitemap/useSitemap.js.map +1 -1
- package/dist/ui-kit/BenefitItem/BenefitItem.js +3 -3
- package/dist/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
- package/dist/ui-kit/Breadcrumb.js +1 -8
- package/dist/ui-kit/Breadcrumb.js.map +1 -1
- package/dist/ui-kit/CurrencyInput/CurrencyInput.js +1 -1
- package/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/dist/ui-kit/CurrencyInput/{adjustValue .d.ts → adjustValue.d.ts} +0 -0
- package/{mobile/dist/ui-kit/CurrencyInput/adjustValue .js → dist/ui-kit/CurrencyInput/adjustValue.js} +1 -1
- package/dist/ui-kit/CurrencyInput/adjustValue.js.map +1 -0
- package/dist/ui-kit/Tags/Tags.js +2 -2
- package/dist/ui-kit/Tags/Tags.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/BenefitsBlock/BenefitsBlock.d.ts +2 -1
- package/lib/components/BenefitsBlock/BenefitsBlock.js +5 -9
- package/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/Catalog/CatalogContent.d.ts +2 -0
- package/lib/components/ContentPage/computeAPIFallback.d.ts +1 -1
- package/lib/components/ContentPage/computeAPIFallback.js +1 -1
- package/lib/components/ContentPage/computeAPIFallback.js.map +1 -1
- package/lib/components/ContentPage/normalizeBlock.js +4 -8
- package/lib/components/ContentPage/normalizeBlock.js.map +1 -1
- package/lib/components/ContentPage/normalizeBlock.mobile.js +4 -8
- package/lib/components/ContentPage/normalizeBlock.mobile.js.map +1 -1
- package/lib/components/ContentPage/normalizePage.d.ts +1 -1
- package/lib/components/ContentPage/normalizePage.js +1 -6
- package/lib/components/ContentPage/normalizePage.js.map +1 -1
- package/lib/components/Header/Header.js +9 -9
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mobile.js +6 -6
- package/lib/components/Header/Header.mobile.js.map +1 -1
- package/lib/components/Header/HeaderContent.d.ts +1 -2
- package/lib/components/InvestmentGallery/InvestmentGallery.d.ts +5 -0
- package/lib/components/InvestmentGallery/InvestmentGallery.fixture.d.ts +7 -0
- package/lib/components/InvestmentGallery/InvestmentGallery.js +38 -0
- package/lib/components/InvestmentGallery/InvestmentGallery.js.map +1 -0
- package/lib/components/InvestmentGallery/InvestmentGalleryCard.d.ts +7 -0
- package/lib/components/InvestmentGallery/InvestmentGalleryCard.js +22 -0
- package/lib/components/InvestmentGallery/InvestmentGalleryCard.js.map +1 -0
- package/lib/components/InvestmentGallery/InvestmentGalleryContent.d.ts +50 -0
- package/lib/components/InvestmentGallery/InvestmentGalleryContent.js +2 -0
- package/lib/components/InvestmentGallery/InvestmentGalleryContent.js.map +1 -0
- package/lib/components/PictureText/PictureText.js +2 -2
- package/lib/components/PictureText/PictureText.js.map +1 -1
- package/lib/components/ProductGallery/ProductGallery.js +2 -2
- package/lib/components/ProductGallery/ProductGallery.js.map +1 -1
- package/lib/components/Recommendation/Recommendation.js +7 -5
- package/lib/components/Recommendation/Recommendation.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.mobile.js +1 -5
- package/lib/components/StepsBlock/StepsBlock.mobile.js.map +1 -1
- package/lib/content-page-repository/ContentPageRepository.d.ts +12 -9
- package/lib/content-page-repository/ContentPageRepository.js +24 -35
- package/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/lib/model/BorderVersion.d.ts +6 -0
- package/lib/model/BorderVersion.js +5 -0
- package/lib/model/BorderVersion.js.map +1 -0
- package/lib/services/sitemap/useSitemap.d.ts +2 -2
- package/lib/services/sitemap/useSitemap.js.map +1 -1
- package/lib/ui-kit/BenefitItem/BenefitItem.js +3 -3
- package/lib/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
- package/lib/ui-kit/Breadcrumb.js +1 -8
- package/lib/ui-kit/Breadcrumb.js.map +1 -1
- package/lib/ui-kit/CurrencyInput/CurrencyInput.js +1 -1
- package/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/lib/ui-kit/CurrencyInput/{adjustValue .d.ts → adjustValue.d.ts} +0 -0
- package/lib/ui-kit/CurrencyInput/{adjustValue .js → adjustValue.js} +1 -1
- package/lib/ui-kit/CurrencyInput/adjustValue.js.map +1 -0
- package/lib/ui-kit/Tags/Tags.js +2 -2
- package/lib/ui-kit/Tags/Tags.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +9 -13
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/BenefitsBlock/BenefitsBlock.d.ts +2 -1
- package/mobile/bundle/components/Catalog/CatalogContent.d.ts +2 -0
- package/mobile/bundle/components/ContentPage/computeAPIFallback.d.ts +1 -1
- package/mobile/bundle/components/ContentPage/normalizePage.d.ts +1 -1
- package/mobile/bundle/components/Header/HeaderContent.d.ts +1 -2
- package/mobile/bundle/components/InvestmentGallery/InvestmentGallery.d.ts +5 -0
- package/mobile/bundle/components/InvestmentGallery/InvestmentGalleryCard.d.ts +7 -0
- package/mobile/bundle/components/InvestmentGallery/InvestmentGalleryContent.d.ts +50 -0
- package/mobile/bundle/content-page-repository/ContentPageRepository.d.ts +12 -9
- package/mobile/bundle/model/BorderVersion.d.ts +6 -0
- package/mobile/bundle/services/sitemap/useSitemap.d.ts +2 -2
- package/mobile/bundle/ui-kit/CurrencyInput/{adjustValue .d.ts → adjustValue.d.ts} +0 -0
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.d.ts +2 -1
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js +5 -9
- package/mobile/dist/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/mobile/dist/components/Catalog/CatalogContent.d.ts +2 -0
- package/mobile/dist/components/ContentPage/computeAPIFallback.d.ts +1 -1
- package/mobile/dist/components/ContentPage/computeAPIFallback.js +1 -1
- package/mobile/dist/components/ContentPage/computeAPIFallback.js.map +1 -1
- package/mobile/dist/components/ContentPage/normalizeBlock.js +4 -8
- package/mobile/dist/components/ContentPage/normalizeBlock.js.map +1 -1
- package/mobile/dist/components/ContentPage/normalizePage.d.ts +1 -1
- package/mobile/dist/components/ContentPage/normalizePage.js +1 -6
- package/mobile/dist/components/ContentPage/normalizePage.js.map +1 -1
- package/mobile/dist/components/Header/Header.js +6 -6
- package/mobile/dist/components/Header/Header.js.map +1 -1
- package/mobile/dist/components/Header/HeaderContent.d.ts +1 -2
- package/mobile/dist/components/InvestmentGallery/InvestmentGallery.d.ts +5 -0
- package/mobile/dist/components/InvestmentGallery/InvestmentGallery.js +40 -0
- package/mobile/dist/components/InvestmentGallery/InvestmentGallery.js.map +1 -0
- package/mobile/dist/components/InvestmentGallery/InvestmentGalleryCard.d.ts +7 -0
- package/mobile/dist/components/InvestmentGallery/InvestmentGalleryCard.js +24 -0
- package/mobile/dist/components/InvestmentGallery/InvestmentGalleryCard.js.map +1 -0
- package/mobile/dist/components/InvestmentGallery/InvestmentGalleryContent.d.ts +50 -0
- package/mobile/dist/components/InvestmentGallery/InvestmentGalleryContent.js +2 -0
- package/mobile/dist/components/InvestmentGallery/InvestmentGalleryContent.js.map +1 -0
- package/mobile/dist/components/PictureText/PictureText.js +2 -2
- package/mobile/dist/components/PictureText/PictureText.js.map +1 -1
- package/mobile/dist/components/Recommendation/Recommendation.js +7 -5
- package/mobile/dist/components/Recommendation/Recommendation.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlock.js +1 -5
- package/mobile/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/dist/content-page-repository/ContentPageRepository.d.ts +12 -9
- package/mobile/dist/content-page-repository/ContentPageRepository.js +24 -35
- package/mobile/dist/content-page-repository/ContentPageRepository.js.map +1 -1
- package/mobile/dist/model/BorderVersion.d.ts +6 -0
- package/mobile/dist/model/BorderVersion.js +7 -0
- package/mobile/dist/model/BorderVersion.js.map +1 -0
- package/mobile/dist/services/sitemap/useSitemap.d.ts +2 -2
- package/mobile/dist/services/sitemap/useSitemap.js.map +1 -1
- package/mobile/dist/ui-kit/BenefitItem/BenefitItem.js +3 -3
- package/mobile/dist/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
- package/mobile/dist/ui-kit/Breadcrumb.js +1 -8
- package/mobile/dist/ui-kit/Breadcrumb.js.map +1 -1
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js +1 -1
- package/mobile/dist/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/mobile/dist/ui-kit/CurrencyInput/{adjustValue .d.ts → adjustValue.d.ts} +0 -0
- package/{dist/ui-kit/CurrencyInput/adjustValue .js → mobile/dist/ui-kit/CurrencyInput/adjustValue.js} +1 -1
- package/mobile/dist/ui-kit/CurrencyInput/adjustValue.js.map +1 -0
- package/mobile/dist/ui-kit/Tags/Tags.js +2 -2
- package/mobile/dist/ui-kit/Tags/Tags.js.map +1 -1
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.d.ts +2 -1
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js +5 -9
- package/mobile/lib/components/BenefitsBlock/BenefitsBlock.js.map +1 -1
- package/mobile/lib/components/Catalog/CatalogContent.d.ts +2 -0
- package/mobile/lib/components/ContentPage/computeAPIFallback.d.ts +1 -1
- package/mobile/lib/components/ContentPage/computeAPIFallback.js +1 -1
- package/mobile/lib/components/ContentPage/computeAPIFallback.js.map +1 -1
- package/mobile/lib/components/ContentPage/normalizeBlock.js +4 -8
- package/mobile/lib/components/ContentPage/normalizeBlock.js.map +1 -1
- package/mobile/lib/components/ContentPage/normalizePage.d.ts +1 -1
- package/mobile/lib/components/ContentPage/normalizePage.js +1 -6
- package/mobile/lib/components/ContentPage/normalizePage.js.map +1 -1
- package/mobile/lib/components/Header/Header.js +6 -6
- package/mobile/lib/components/Header/Header.js.map +1 -1
- package/mobile/lib/components/Header/HeaderContent.d.ts +1 -2
- package/mobile/lib/components/InvestmentGallery/InvestmentGallery.d.ts +5 -0
- package/mobile/lib/components/InvestmentGallery/InvestmentGallery.js +38 -0
- package/mobile/lib/components/InvestmentGallery/InvestmentGallery.js.map +1 -0
- package/mobile/lib/components/InvestmentGallery/InvestmentGalleryCard.d.ts +7 -0
- package/mobile/lib/components/InvestmentGallery/InvestmentGalleryCard.js +22 -0
- package/mobile/lib/components/InvestmentGallery/InvestmentGalleryCard.js.map +1 -0
- package/mobile/lib/components/InvestmentGallery/InvestmentGalleryContent.d.ts +50 -0
- package/mobile/lib/components/InvestmentGallery/InvestmentGalleryContent.js +2 -0
- package/mobile/lib/components/InvestmentGallery/InvestmentGalleryContent.js.map +1 -0
- package/mobile/lib/components/PictureText/PictureText.js +2 -2
- package/mobile/lib/components/PictureText/PictureText.js.map +1 -1
- package/mobile/lib/components/Recommendation/Recommendation.js +7 -5
- package/mobile/lib/components/Recommendation/Recommendation.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlock.js +1 -5
- package/mobile/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/mobile/lib/content-page-repository/ContentPageRepository.d.ts +12 -9
- package/mobile/lib/content-page-repository/ContentPageRepository.js +24 -35
- package/mobile/lib/content-page-repository/ContentPageRepository.js.map +1 -1
- package/mobile/lib/model/BorderVersion.d.ts +6 -0
- package/mobile/lib/model/BorderVersion.js +5 -0
- package/mobile/lib/model/BorderVersion.js.map +1 -0
- package/mobile/lib/services/sitemap/useSitemap.d.ts +2 -2
- package/mobile/lib/services/sitemap/useSitemap.js.map +1 -1
- package/mobile/lib/ui-kit/BenefitItem/BenefitItem.js +3 -3
- package/mobile/lib/ui-kit/BenefitItem/BenefitItem.js.map +1 -1
- package/mobile/lib/ui-kit/Breadcrumb.js +1 -8
- package/mobile/lib/ui-kit/Breadcrumb.js.map +1 -1
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js +1 -1
- package/mobile/lib/ui-kit/CurrencyInput/CurrencyInput.js.map +1 -1
- package/mobile/lib/ui-kit/CurrencyInput/{adjustValue .d.ts → adjustValue.d.ts} +0 -0
- package/mobile/lib/ui-kit/CurrencyInput/{adjustValue .js → adjustValue.js} +1 -1
- package/mobile/lib/ui-kit/CurrencyInput/adjustValue.js.map +1 -0
- package/mobile/lib/ui-kit/Tags/Tags.js +2 -2
- package/mobile/lib/ui-kit/Tags/Tags.js.map +1 -1
- package/mobile/src/components/BenefitsBlock/BenefitsBlock.tsx +14 -21
- package/mobile/src/components/Catalog/CatalogContent.ts +2 -0
- package/mobile/src/components/ContentPage/computeAPIFallback.ts +20 -21
- package/mobile/src/components/ContentPage/normalizeBlock.ts +15 -18
- package/mobile/src/components/ContentPage/normalizePage.ts +2 -7
- package/mobile/src/components/Header/Header.tsx +11 -11
- package/mobile/src/components/Header/HeaderContent.ts +1 -2
- package/mobile/src/components/InvestmentGallery/InvestmentGallery.example.json +64 -0
- package/mobile/src/components/InvestmentGallery/InvestmentGallery.tsx +103 -0
- package/mobile/src/components/InvestmentGallery/InvestmentGallery.ui.json +11 -0
- package/mobile/src/components/InvestmentGallery/InvestmentGalleryCard.tsx +91 -0
- package/mobile/src/components/InvestmentGallery/InvestmentGalleryContent.ts +54 -0
- package/mobile/src/components/PictureText/PictureText.tsx +3 -3
- package/mobile/src/components/Recommendation/Recommendation.tsx +9 -7
- package/mobile/src/components/StepsBlock/StepsBlock.tsx +1 -7
- package/mobile/src/content-page-repository/ContentPageRepository.ts +27 -45
- package/mobile/src/model/BorderVersion.ts +10 -0
- package/mobile/src/services/sitemap/useSitemap.ts +4 -4
- package/mobile/src/ui-kit/BenefitItem/BenefitItem.tsx +6 -5
- package/mobile/src/ui-kit/Breadcrumb.tsx +8 -11
- package/mobile/src/ui-kit/CurrencyInput/CurrencyInput.tsx +1 -1
- package/mobile/src/ui-kit/CurrencyInput/{adjustValue .ts → adjustValue.ts} +0 -0
- package/mobile/src/ui-kit/Tags/Tags.tsx +3 -5
- package/package.json +1 -1
- package/src/components/BenefitsBlock/BenefitsBlock.tsx +14 -21
- package/src/components/Blocks.ts +2 -0
- package/src/components/Catalog/CatalogContent.ts +2 -0
- package/src/components/ContentPage/computeAPIFallback.ts +20 -21
- package/src/components/ContentPage/normalizeBlock.mobile.ts +15 -18
- package/src/components/ContentPage/normalizeBlock.ts +10 -12
- package/src/components/ContentPage/normalizePage.ts +2 -7
- package/src/components/Header/Header.mobile.tsx +11 -11
- package/src/components/Header/Header.tsx +17 -12
- package/src/components/Header/HeaderContent.ts +1 -2
- package/src/components/InvestmentGallery/InvestmentGallery.example.json +64 -0
- package/src/components/InvestmentGallery/InvestmentGallery.fixture.tsx +79 -0
- package/src/components/InvestmentGallery/InvestmentGallery.tsx +103 -0
- package/src/components/InvestmentGallery/InvestmentGallery.ui.json +11 -0
- package/src/components/InvestmentGallery/InvestmentGalleryCard.tsx +91 -0
- package/src/components/InvestmentGallery/InvestmentGalleryContent.ts +54 -0
- package/src/components/PictureText/PictureText.tsx +3 -3
- package/src/components/ProductGallery/ProductGallery.tsx +3 -4
- package/src/components/Recommendation/Recommendation.tsx +9 -7
- package/src/components/StepsBlock/StepsBlock.mobile.tsx +1 -7
- package/src/content-page-repository/ContentPageRepository.ts +27 -45
- package/src/model/BorderVersion.ts +10 -0
- package/src/services/sitemap/useSitemap.ts +4 -4
- package/src/ui-kit/BenefitItem/BenefitItem.tsx +6 -5
- package/src/ui-kit/Breadcrumb.tsx +8 -11
- package/src/ui-kit/CurrencyInput/CurrencyInput.tsx +1 -1
- package/src/ui-kit/CurrencyInput/{adjustValue .ts → adjustValue.ts} +0 -0
- package/src/ui-kit/Tags/Tags.tsx +3 -5
- package/dist/ui-kit/CurrencyInput/adjustValue .js.map +0 -1
- package/lib/ui-kit/CurrencyInput/adjustValue .js.map +0 -1
- package/mobile/dist/ui-kit/CurrencyInput/adjustValue .js.map +0 -1
- package/mobile/lib/ui-kit/CurrencyInput/adjustValue .js.map +0 -1
package/src/components/Blocks.ts
CHANGED
|
@@ -38,6 +38,7 @@ import { Tabs } from './Tabs/Tabs';
|
|
|
38
38
|
import { TariffsTable } from './TariffsTable/TariffsTable';
|
|
39
39
|
import { TextBlock } from './TextBlock/TextBlock';
|
|
40
40
|
import { Tile } from './Tile/Tile';
|
|
41
|
+
import { InvestmentGallery } from './InvestmentGallery/InvestmentGallery';
|
|
41
42
|
|
|
42
43
|
export const Blocks: BlocksRegistry = {
|
|
43
44
|
Accordion,
|
|
@@ -79,4 +80,5 @@ export const Blocks: BlocksRegistry = {
|
|
|
79
80
|
SafeDepositRental,
|
|
80
81
|
Tabs,
|
|
81
82
|
ErrorBlock,
|
|
83
|
+
InvestmentGallery,
|
|
82
84
|
};
|
|
@@ -2,6 +2,7 @@ import type { HeadlineCommonProps } from '../../model/HeadlineType';
|
|
|
2
2
|
import type { ProductColorVersion } from '../../model/ProductColorVersion';
|
|
3
3
|
import type { ButtonWithIconProps } from '../../ui-kit/Button/ButtonProps';
|
|
4
4
|
import type { ImageContent } from '../../ui-kit/Img/ImgProps';
|
|
5
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
5
6
|
|
|
6
7
|
export interface CatalogCardType extends HeadlineCommonProps, ImageContent {
|
|
7
8
|
/** @title Цена в рублях */
|
|
@@ -24,4 +25,5 @@ export interface CatalogCardType extends HeadlineCommonProps, ImageContent {
|
|
|
24
25
|
export type CatalogContent = HeadlineCommonProps & {
|
|
25
26
|
/** @title Список карточек */
|
|
26
27
|
cards?: CatalogCardType[];
|
|
28
|
+
version?: BlockVersion;
|
|
27
29
|
};
|
|
@@ -6,27 +6,26 @@ interface FallbackData {
|
|
|
6
6
|
data: unknown;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export const computeAPIFallback =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
9
|
+
export const computeAPIFallback = async (blocksRegistry: BlocksRegistry): Promise<Fallback> => {
|
|
10
|
+
const blocksFallbackMap = await Promise.all(Object.keys(blocksRegistry).map(loadBlockFallback));
|
|
11
|
+
const pageFallbackMap = getPageFallbackMap(blocksFallbackMap);
|
|
12
|
+
const fallbackData = await Promise.allSettled(
|
|
13
|
+
Object.entries(pageFallbackMap).map(async ([key, fetcher]) => {
|
|
14
|
+
const data = await fetcher();
|
|
15
|
+
|
|
16
|
+
return { key, data };
|
|
17
|
+
}),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
return fallbackData
|
|
21
|
+
.filter((d): d is PromiseFulfilledResult<FallbackData> => d.status === 'fulfilled')
|
|
22
|
+
.reduce((res, item) => {
|
|
23
|
+
return {
|
|
24
|
+
...res,
|
|
25
|
+
[item.value.key]: item.value.data,
|
|
26
|
+
};
|
|
27
|
+
}, {});
|
|
28
|
+
};
|
|
30
29
|
|
|
31
30
|
export async function loadBlockFallback(blockName: string): Promise<FallbackMap | undefined> {
|
|
32
31
|
try {
|
|
@@ -4,26 +4,23 @@ import { mapSlot } from './mapSlot';
|
|
|
4
4
|
|
|
5
5
|
export function normalizeBlock<S extends Slot>(block?: S, blocksRegistry?: BlocksRegistry): S {
|
|
6
6
|
const { mobile, ...rest } = (block || {}) as BlockDef;
|
|
7
|
-
|
|
8
|
-
const normalizedBlock = mobile
|
|
7
|
+
const result = mobile
|
|
9
8
|
? { ...rest, ...mobile, content: { ...rest.content, ...mobile.content } }
|
|
10
9
|
: block;
|
|
11
10
|
|
|
12
|
-
return {
|
|
13
|
-
...mapSlot((blocks) => filterBlocks(blocks, blocksRegistry))(normalizedBlock || {}),
|
|
14
|
-
} as S;
|
|
11
|
+
return mapSlot(filterBlocks(blocksRegistry))(result || {}) as S;
|
|
15
12
|
}
|
|
16
13
|
|
|
17
|
-
const filterBlocks =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
(block
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
const filterBlocks =
|
|
15
|
+
(blocksRegistry?: BlocksRegistry) =>
|
|
16
|
+
(blocks?: BlockDef[]): BlockDef[] =>
|
|
17
|
+
blocks
|
|
18
|
+
? blocks
|
|
19
|
+
?.filter(
|
|
20
|
+
(block) =>
|
|
21
|
+
blocksRegistry &&
|
|
22
|
+
(block?.type || block?.mobile?.type || '') in blocksRegistry &&
|
|
23
|
+
!block.mobile?.hidden,
|
|
24
|
+
)
|
|
25
|
+
.map((block) => normalizeBlock(block, blocksRegistry))
|
|
26
|
+
: [];
|
|
@@ -4,18 +4,16 @@ import { mapSlot } from './mapSlot';
|
|
|
4
4
|
|
|
5
5
|
export function normalizeBlock<S extends Slot>(block?: S, blocksRegistry?: BlocksRegistry): S {
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
-
const { mobile, ...
|
|
7
|
+
const { mobile, ...result } = (block || {}) as BlockDef;
|
|
8
8
|
|
|
9
|
-
return {
|
|
10
|
-
...mapSlot((blocks) => filterBlocks(blocks, blocksRegistry))({ ...rest }),
|
|
11
|
-
} as S;
|
|
9
|
+
return mapSlot(filterBlocks(blocksRegistry))({ ...result }) as S;
|
|
12
10
|
}
|
|
13
11
|
|
|
14
|
-
const filterBlocks =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
const filterBlocks =
|
|
13
|
+
(blocksRegistry?: BlocksRegistry) =>
|
|
14
|
+
(blocks?: BlockDef[]): BlockDef[] =>
|
|
15
|
+
blocks
|
|
16
|
+
? blocks
|
|
17
|
+
.filter((block) => blocksRegistry && (block?.type || '') in blocksRegistry)
|
|
18
|
+
.map((block) => normalizeBlock(block, blocksRegistry))
|
|
19
|
+
: [];
|
|
@@ -4,10 +4,5 @@ import { normalizeBlock } from './normalizeBlock';
|
|
|
4
4
|
|
|
5
5
|
export const normalizePage =
|
|
6
6
|
(blocksRegistry: BlocksRegistry) =>
|
|
7
|
-
(contentPage: ContentPageDef | undefined | null): ContentPageDef
|
|
8
|
-
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return normalizeBlock(contentPage, blocksRegistry);
|
|
13
|
-
};
|
|
7
|
+
(contentPage: ContentPageDef | undefined | null): ContentPageDef =>
|
|
8
|
+
contentPage ? normalizeBlock(contentPage, blocksRegistry) : {};
|
|
@@ -5,7 +5,6 @@ import type { Fallback } from '../../model/Fallback';
|
|
|
5
5
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
6
6
|
import { findActiveSubItem } from '../../services/sitemap/findActiveSubItem';
|
|
7
7
|
import { isTopItemActive } from '../../services/sitemap/isTopItemActive';
|
|
8
|
-
import { mergeTopItems } from '../../services/sitemap/mergeTopItems';
|
|
9
8
|
import { useSitemap } from '../../services/sitemap/useSitemap';
|
|
10
9
|
import { HeaderItem } from '../../ui-kit/HeaderItem/HeaderItem';
|
|
11
10
|
import type { TopItemProps } from '../../ui-kit/TopItem/TopItem';
|
|
@@ -19,15 +18,14 @@ import { HeaderTop } from './HeaderTop';
|
|
|
19
18
|
export interface HeaderProps extends HeaderContent, UniBlockProps {}
|
|
20
19
|
|
|
21
20
|
export const Header = JSX<HeaderProps>(
|
|
22
|
-
({ className = '', defaultLocation, bgColor = 'bg-white', context,
|
|
21
|
+
({ className = '', defaultLocation, bgColor = 'bg-white', context, page }) => {
|
|
23
22
|
const { handlerDecorator } = context;
|
|
24
23
|
const router = context.useRouter();
|
|
25
24
|
|
|
26
25
|
const fallback: Fallback | undefined = page?.fallback;
|
|
27
|
-
const
|
|
26
|
+
const { topItems, dispositions } = useSitemap(fallback);
|
|
28
27
|
|
|
29
|
-
const
|
|
30
|
-
const activeTopItem = mergedItems.find(isTopItemActive(router));
|
|
28
|
+
const activeTopItem = topItems?.find(isTopItemActive(router));
|
|
31
29
|
const subItems = activeTopItem?.items;
|
|
32
30
|
const activeSubItem = findActiveSubItem(router)(subItems);
|
|
33
31
|
|
|
@@ -58,15 +56,17 @@ export const Header = JSX<HeaderProps>(
|
|
|
58
56
|
<HeaderBurger
|
|
59
57
|
context={context}
|
|
60
58
|
onClick={toggleBurgerMenu}
|
|
61
|
-
burgerSubMenu={
|
|
59
|
+
burgerSubMenu={dispositions}
|
|
62
60
|
defaultLocation={defaultLocation}
|
|
63
61
|
>
|
|
64
62
|
<AccordionItemsList>
|
|
65
|
-
{
|
|
66
|
-
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
{topItems?.map((item, i) => {
|
|
64
|
+
item?.text ? (
|
|
65
|
+
<AccordionItem key={String(i)} context={context} label={item.text}>
|
|
66
|
+
<LinkList context={context} documents={item.items} />
|
|
67
|
+
</AccordionItem>
|
|
68
|
+
) : null;
|
|
69
|
+
})}
|
|
70
70
|
</AccordionItemsList>
|
|
71
71
|
</HeaderBurger>
|
|
72
72
|
) : null}
|
|
@@ -3,12 +3,13 @@ import { useLink } from '../../hooks/useLink';
|
|
|
3
3
|
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
4
4
|
import type { Fallback } from '../../model/Fallback';
|
|
5
5
|
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
6
|
+
import type { TopMenuItem } from '../../model/SitemapProps';
|
|
6
7
|
import { isTopItemActive } from '../../services/sitemap/isTopItemActive';
|
|
7
|
-
import { mergeTopItems } from '../../services/sitemap/mergeTopItems';
|
|
8
8
|
import { useSitemap } from '../../services/sitemap/useSitemap';
|
|
9
9
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
10
10
|
import { Logo } from '../../ui-kit/Logo/Logo';
|
|
11
11
|
import { TopItem } from '../../ui-kit/TopItem/TopItem';
|
|
12
|
+
import type { Router } from '../ContentPage/ContentPageContext';
|
|
12
13
|
import type { HeaderContent } from './HeaderContent';
|
|
13
14
|
import { HeaderSecondaryMenu } from './HeaderSecondaryMenu';
|
|
14
15
|
import { HeaderSubMenu } from './HeaderSubMenu';
|
|
@@ -22,27 +23,24 @@ export interface HeaderProps extends HeaderContent, UniBlockProps {}
|
|
|
22
23
|
|
|
23
24
|
export const Header = JSX<HeaderProps>(
|
|
24
25
|
({
|
|
25
|
-
className = '',
|
|
26
|
-
defaultLocation = 'Москва',
|
|
27
|
-
showSubMenu = true,
|
|
28
26
|
bgColor = 'bg-white',
|
|
27
|
+
className = '',
|
|
29
28
|
context,
|
|
30
|
-
|
|
29
|
+
defaultLocation = 'Москва',
|
|
31
30
|
logo,
|
|
32
31
|
page,
|
|
32
|
+
showSubMenu = true,
|
|
33
33
|
...rest
|
|
34
34
|
}) => {
|
|
35
35
|
const router = context.useRouter();
|
|
36
36
|
const fallback: Fallback | undefined = page?.fallback;
|
|
37
|
-
const sitemap = useSitemap(fallback);
|
|
38
37
|
const { handlerDecorator } = context;
|
|
39
38
|
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const activeTopItem = showSubMenu
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const topMenu = mergedItems.map((_, i) => (
|
|
39
|
+
const { topItems } = useSitemap(fallback);
|
|
40
|
+
|
|
41
|
+
const activeTopItem = showSubMenu ? getActiveItem(topItems, router) : null;
|
|
42
|
+
|
|
43
|
+
const topMenu = topItems?.map((_, i) => (
|
|
46
44
|
<TopItem
|
|
47
45
|
key={String(i)}
|
|
48
46
|
active={_ === activeTopItem}
|
|
@@ -80,3 +78,10 @@ export const Header = JSX<HeaderProps>(
|
|
|
80
78
|
);
|
|
81
79
|
},
|
|
82
80
|
);
|
|
81
|
+
|
|
82
|
+
const getActiveItem = (topItems: TopMenuItem[] | undefined, router: Router) => {
|
|
83
|
+
const [firstPortal] = topItems || [];
|
|
84
|
+
|
|
85
|
+
// Если по слагу невозможно понять к какому подпорталу этот слаг относиться, то выбираем первый подпортал.
|
|
86
|
+
return topItems?.find(isTopItemActive(router)) || firstPortal;
|
|
87
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { BgColorVersion } from '../../model/BgColorVersion';
|
|
2
2
|
import type { LinkProps } from '../../model/LinkProps';
|
|
3
3
|
import type { IconProps, Picture } from '../../model/Picture';
|
|
4
|
-
import type { SitemapProps } from '../../services/sitemap/SitemapProps';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* @title Пункт подменю
|
|
@@ -31,7 +30,7 @@ export interface Logo {
|
|
|
31
30
|
* @title Шапка (для мобильных горизонтальная прокрутка shift+mouseScroll)
|
|
32
31
|
* @required ["defaultLocation", "topItems"]
|
|
33
32
|
*/
|
|
34
|
-
export interface HeaderContent
|
|
33
|
+
export interface HeaderContent {
|
|
35
34
|
logo?: Logo;
|
|
36
35
|
/**
|
|
37
36
|
* @title Город по-умолчанию
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"title": "Заголовок блока",
|
|
3
|
+
"cards": [
|
|
4
|
+
{
|
|
5
|
+
"image": {
|
|
6
|
+
"format": "webp",
|
|
7
|
+
"size": {
|
|
8
|
+
"width": 180,
|
|
9
|
+
"height": 180
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"title": "Заголовок карточки",
|
|
13
|
+
"description": "Описание",
|
|
14
|
+
"additionalDescription": "Дополнительное описание",
|
|
15
|
+
"cardList":[
|
|
16
|
+
{
|
|
17
|
+
"parametr": "Параметр",
|
|
18
|
+
"parametrDesccription": "Описание"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"parametr": "Параметр",
|
|
22
|
+
"parametrDesccription": "Описание"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"parametr": "Параметр",
|
|
26
|
+
"parametrDesccription": "Описание"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"image": {
|
|
32
|
+
"format": "webp",
|
|
33
|
+
"size": {
|
|
34
|
+
"width": 180,
|
|
35
|
+
"height": 180
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"title": "Заголовок 2",
|
|
39
|
+
"description": "Описание 2",
|
|
40
|
+
"socialMedia": [
|
|
41
|
+
{ "href": "https://t.me" },
|
|
42
|
+
{ "href": "https://vk.com" },
|
|
43
|
+
{ "href": "https://ok.ru" }
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"image": {
|
|
48
|
+
"format": "webp",
|
|
49
|
+
"size": {
|
|
50
|
+
"width": 180,
|
|
51
|
+
"height": 180
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"title": "Заголовок 3",
|
|
55
|
+
"description": "Описание 3",
|
|
56
|
+
"socialMedia": [
|
|
57
|
+
{ "href": "https://t.me" },
|
|
58
|
+
{ "href": "https://vk.com" },
|
|
59
|
+
{ "href": "https://ok.ru" }
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"version": "primary"
|
|
64
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Picture } from '../../model/Picture';
|
|
2
|
+
import { context } from '../../react/setup-fixture';
|
|
3
|
+
import { InvestmentGallery, InvestmentGalleryProps } from './InvestmentGallery';
|
|
4
|
+
|
|
5
|
+
const five: Picture = {
|
|
6
|
+
src: '5.svg',
|
|
7
|
+
format: 'webp',
|
|
8
|
+
size: {
|
|
9
|
+
width: 268,
|
|
10
|
+
height: 218,
|
|
11
|
+
},
|
|
12
|
+
title: 'five',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const cardListExample = [
|
|
16
|
+
{
|
|
17
|
+
parameter: 'IR',
|
|
18
|
+
parameterDesccription: 'cтрана эмитента',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
parameter: 'RU',
|
|
22
|
+
parameterDesccription: 'страна риска',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
parameter: '09.03.2022',
|
|
26
|
+
parameterDesccription: 'дата погашения',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
parameter: 'Ba3',
|
|
30
|
+
parameterDesccription: 'рейтинг MOODY’S',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
parameter: 'BB-',
|
|
34
|
+
parameterDesccription: 'рейтинг FITCH',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
parameter: 'Borets Finance Designated Activity Company',
|
|
38
|
+
parameterDesccription: 'эмитент',
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const cardCoomonProps = {
|
|
43
|
+
title: 'Borets Finance DAC 17/09/26',
|
|
44
|
+
description: 'BRTS-26 XS2230649225',
|
|
45
|
+
additionalDescription: 'Краткосрочная',
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const shortProps: InvestmentGalleryProps = {
|
|
49
|
+
context,
|
|
50
|
+
title: 'Примеры еврооблигаций (Московская Биржа)',
|
|
51
|
+
cards: [
|
|
52
|
+
{
|
|
53
|
+
...cardCoomonProps,
|
|
54
|
+
columnsMode: 'double',
|
|
55
|
+
cardList: cardListExample,
|
|
56
|
+
image: five,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
...cardCoomonProps,
|
|
60
|
+
columnsMode: 'single',
|
|
61
|
+
cardList: cardListExample,
|
|
62
|
+
image: five,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
...cardCoomonProps,
|
|
66
|
+
columnsMode: 'double',
|
|
67
|
+
cardList: cardListExample,
|
|
68
|
+
image: five,
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default {
|
|
74
|
+
default: (
|
|
75
|
+
<div className="container grid grid-cols-12 mb-1">
|
|
76
|
+
<InvestmentGallery className="col-span-12" {...shortProps} />
|
|
77
|
+
</div>
|
|
78
|
+
),
|
|
79
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
4
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
5
|
+
import { VersionStyleMap } from '../../model/BlockVersion';
|
|
6
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
7
|
+
import { renderArrows } from '../../ui-kit/Button/renderArrows';
|
|
8
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
9
|
+
import { InvestmentGalleryCard } from './InvestmentGalleryCard';
|
|
10
|
+
import type {
|
|
11
|
+
InvestmentGalleryCardTypes,
|
|
12
|
+
InvestmentGalleryContent,
|
|
13
|
+
} from './InvestmentGalleryContent';
|
|
14
|
+
import type { ContentPageContext } from '../ContentPage/ContentPageContext';
|
|
15
|
+
|
|
16
|
+
const BLUR_BLOCK_CLASSES = 'absolute top-0 bottom-0 w-[84px]';
|
|
17
|
+
const CARD_FULL_VIEW_COUNT = 1;
|
|
18
|
+
|
|
19
|
+
export interface InvestmentGalleryProps extends InvestmentGalleryContent, UniBlockProps {}
|
|
20
|
+
|
|
21
|
+
interface NavButtonsProps {
|
|
22
|
+
cardsCount: number;
|
|
23
|
+
activeCardIndex: number;
|
|
24
|
+
setActiveCardIndex: (number: number) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const InvestmentGallery = JSX<InvestmentGalleryProps>(
|
|
28
|
+
({ context, cards = [], className = '', title, version = 'primary', ...rest }) => {
|
|
29
|
+
const [activeCardIndex, setActiveCardIndex] = useState(0);
|
|
30
|
+
const cardWidth = 525;
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<BlockWrapper
|
|
34
|
+
context={context}
|
|
35
|
+
className={`relative font-sans p-9 overflow-hidden text-center
|
|
36
|
+
${VersionStyleMap[version]}
|
|
37
|
+
${className}`}
|
|
38
|
+
{...rest}
|
|
39
|
+
>
|
|
40
|
+
{title ? <Heading headingType="h3" className="mb-9" title={title} /> : null}
|
|
41
|
+
<div>
|
|
42
|
+
<div
|
|
43
|
+
className="flex duration-1000 gap-3.5"
|
|
44
|
+
style={{ transform: `translateX(-${activeCardIndex * cardWidth}px)` }}
|
|
45
|
+
role="list"
|
|
46
|
+
>
|
|
47
|
+
{cards?.length
|
|
48
|
+
? cards.map(renderInvestmentGalleryCard(context, className, version))
|
|
49
|
+
: null}
|
|
50
|
+
</div>
|
|
51
|
+
{renderNavButtons({
|
|
52
|
+
cardsCount: cards.length,
|
|
53
|
+
activeCardIndex,
|
|
54
|
+
setActiveCardIndex,
|
|
55
|
+
})}
|
|
56
|
+
</div>
|
|
57
|
+
<div
|
|
58
|
+
className={`${BLUR_BLOCK_CLASSES} left-0 ${
|
|
59
|
+
version === 'secondary' ? 'bg-opacity-from-main' : 'bg-opacity-from-white'
|
|
60
|
+
}`}
|
|
61
|
+
/>
|
|
62
|
+
<div
|
|
63
|
+
className={`${BLUR_BLOCK_CLASSES} right-0 ${
|
|
64
|
+
version === 'secondary' ? 'bg-opacity-to-main' : 'bg-opacity-to-white'
|
|
65
|
+
}`}
|
|
66
|
+
/>
|
|
67
|
+
</BlockWrapper>
|
|
68
|
+
);
|
|
69
|
+
},
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const renderInvestmentGalleryCard =
|
|
73
|
+
(context: ContentPageContext, className: string, version?: BlockVersion) =>
|
|
74
|
+
(card: InvestmentGalleryCardTypes, i: number) =>
|
|
75
|
+
(
|
|
76
|
+
<InvestmentGalleryCard
|
|
77
|
+
key={String(i)}
|
|
78
|
+
className={className}
|
|
79
|
+
context={context}
|
|
80
|
+
version={version}
|
|
81
|
+
{...card}
|
|
82
|
+
/>
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
const renderNavButtons = ({ cardsCount, activeCardIndex, setActiveCardIndex }: NavButtonsProps) => {
|
|
86
|
+
const isUseSlider = cardsCount > CARD_FULL_VIEW_COUNT;
|
|
87
|
+
const showNextButton = isUseSlider && cardsCount - activeCardIndex > CARD_FULL_VIEW_COUNT;
|
|
88
|
+
const showPrevButton = isUseSlider && activeCardIndex > 0;
|
|
89
|
+
|
|
90
|
+
const handleNextClick = () => setActiveCardIndex(activeCardIndex + 1);
|
|
91
|
+
const handlePrevClick = () => setActiveCardIndex(activeCardIndex - 1);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<div>
|
|
95
|
+
{renderArrows({
|
|
96
|
+
handler: [handlePrevClick, handleNextClick],
|
|
97
|
+
isShown: [showPrevButton, showNextButton],
|
|
98
|
+
btnClass: ['left-8', 'right-8'],
|
|
99
|
+
className: 'top-1/2 mt-3',
|
|
100
|
+
})}
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
+
import { BorderVersionStyleMap } from '../../model/BorderVersion';
|
|
4
|
+
import type { UniBlockProps } from '../../model/JSXBlock';
|
|
5
|
+
import { Description } from '../../ui-kit/Description/Description';
|
|
6
|
+
import { Heading } from '../../ui-kit/Heading/Heading';
|
|
7
|
+
import { Img } from '../../ui-kit/Img/Img';
|
|
8
|
+
import { BaseTile } from '../BaseTile/BaseTile';
|
|
9
|
+
import type {
|
|
10
|
+
CardColumnsMode,
|
|
11
|
+
CardListItem,
|
|
12
|
+
InvestmentGalleryCardTypes,
|
|
13
|
+
} from './InvestmentGalleryContent';
|
|
14
|
+
|
|
15
|
+
export interface RecommendationCardProps extends InvestmentGalleryCardTypes, UniBlockProps {
|
|
16
|
+
version?: BlockVersion;
|
|
17
|
+
}
|
|
18
|
+
const getItemListFontSize = (colValue?: string) => (colValue === 'single' ? 'text-h6' : 'text-l');
|
|
19
|
+
|
|
20
|
+
const cardColumnsModeStyleMap: Record<CardColumnsMode, string> = {
|
|
21
|
+
double: 'flex gap-y-2 gap-x-10 flex-wrap',
|
|
22
|
+
single: 'flex gap-y-2 flex-col',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const InvestmentGalleryCard = JSX<RecommendationCardProps>(
|
|
26
|
+
({
|
|
27
|
+
className = '',
|
|
28
|
+
columnsMode = 'double',
|
|
29
|
+
context,
|
|
30
|
+
description,
|
|
31
|
+
additionalDescription,
|
|
32
|
+
image,
|
|
33
|
+
cardList,
|
|
34
|
+
title,
|
|
35
|
+
version = 'primary',
|
|
36
|
+
}) => {
|
|
37
|
+
const tileTitle = title ? (
|
|
38
|
+
<Heading headingType="h4" as="h3" className="mb-3.5 z-10" title={title} />
|
|
39
|
+
) : null;
|
|
40
|
+
const tileImage = image?.src ? (
|
|
41
|
+
<Img className="absolute bottom-0 right-0 m-0" image={image} />
|
|
42
|
+
) : null;
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<section
|
|
46
|
+
className={`relative overflow-hidden text-left border border-solid box-border
|
|
47
|
+
p-9 min-w-[697px] min-h-[319px]
|
|
48
|
+
${BorderVersionStyleMap[version]}
|
|
49
|
+
${className}`}
|
|
50
|
+
role="listitem"
|
|
51
|
+
>
|
|
52
|
+
<BaseTile
|
|
53
|
+
context={context}
|
|
54
|
+
className="flex justify-between"
|
|
55
|
+
title={tileTitle}
|
|
56
|
+
image={tileImage}
|
|
57
|
+
>
|
|
58
|
+
<div className="flex flex-col justify-between">
|
|
59
|
+
<div className="flex itens-center justify-between mb-4">
|
|
60
|
+
{description ? <Description className="text-h6" description={description} /> : null}
|
|
61
|
+
{additionalDescription ? (
|
|
62
|
+
<div className="text-m-light text-secondary-text"> {additionalDescription} </div>
|
|
63
|
+
) : null}
|
|
64
|
+
</div>
|
|
65
|
+
{cardList?.length ? (
|
|
66
|
+
<div className={`${cardColumnsModeStyleMap[columnsMode]}`} role="list">
|
|
67
|
+
{renderCardList(cardList, columnsMode)}
|
|
68
|
+
</div>
|
|
69
|
+
) : null}
|
|
70
|
+
</div>
|
|
71
|
+
</BaseTile>
|
|
72
|
+
</section>
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const renderCardList = (cardList: CardListItem[], columnsMode: string) =>
|
|
78
|
+
cardList.map((item, i) => (
|
|
79
|
+
<div
|
|
80
|
+
key={String(i)}
|
|
81
|
+
className={columnsMode === 'double' ? 'basis-[calc(50%-20px)]' : ''}
|
|
82
|
+
role="listitem"
|
|
83
|
+
>
|
|
84
|
+
{item?.parameter ? (
|
|
85
|
+
<span className={`pr-2.5 ${getItemListFontSize(columnsMode)}`}>{item.parameter}</span>
|
|
86
|
+
) : null}
|
|
87
|
+
{item?.parameterDesccription ? (
|
|
88
|
+
<span className="text-m-light text-secondary-text">{item.parameterDesccription}</span>
|
|
89
|
+
) : null}
|
|
90
|
+
</div>
|
|
91
|
+
));
|