@redneckz/wildless-cms-uni-blocks 0.5.12 → 0.5.13
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 +125 -69
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/Accordion/AccordionContent.d.ts +9 -7
- package/bundle/components/Accordion/AccordionItem.d.ts +1 -4
- package/bundle/components/Accordion/AccordionItem.mobile.d.ts +1 -4
- package/bundle/components/Accordion/AccordionItemProps.d.ts +5 -0
- package/bundle/components/Accordion/AccordionItemsList.d.ts +1 -0
- package/bundle/components/Blocks.d.ts +1 -0
- package/bundle/components/InvestmentInfo/InvestmentInfo.d.ts +5 -0
- package/bundle/components/InvestmentInfo/InvestmentInfoContent.d.ts +49 -0
- package/bundle/components/StepsBlock/renderItems.d.ts +7 -2
- package/bundle/components/StepsBlock/renderStepContent.d.ts +14 -0
- package/bundle/model/BlockDecorator.d.ts +1 -0
- package/bundle/model/BlocksRegistry.d.ts +4 -1
- package/bundle/ui-kit/Foldable/DefaultFoldButton.d.ts +14 -0
- package/bundle/ui-kit/Foldable/Foldable.d.ts +3 -10
- package/bundle/ui-kit/Foldable/FoldablePartProps.d.ts +4 -0
- package/bundle/ui-kit/Foldable/FoldableSection.d.ts +5 -0
- package/dist/components/Accordion/Accordion.js +3 -1
- package/dist/components/Accordion/Accordion.js.map +1 -1
- package/dist/components/Accordion/Accordion.mobile.js +5 -2
- package/dist/components/Accordion/Accordion.mobile.js.map +1 -1
- package/dist/components/Accordion/AccordionContent.d.ts +9 -7
- package/dist/components/Accordion/AccordionItem.d.ts +1 -4
- package/dist/components/Accordion/AccordionItem.js +3 -8
- package/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/dist/components/Accordion/AccordionItem.mobile.d.ts +1 -4
- package/dist/components/Accordion/AccordionItem.mobile.js +2 -5
- package/dist/components/Accordion/AccordionItem.mobile.js.map +1 -1
- package/dist/components/Accordion/AccordionItemProps.d.ts +5 -0
- package/dist/components/Accordion/AccordionItemProps.js +2 -0
- package/dist/components/Accordion/AccordionItemProps.js.map +1 -0
- package/dist/components/Accordion/AccordionItemsList.d.ts +1 -0
- package/dist/components/Accordion/AccordionItemsList.js +6 -0
- package/dist/components/Accordion/AccordionItemsList.js.map +1 -0
- package/dist/components/Blocks.d.ts +1 -0
- package/dist/components/Blocks.js +2 -0
- package/dist/components/Blocks.js.map +1 -1
- package/dist/components/ContentPage/filterBlocks.js +1 -2
- package/dist/components/ContentPage/filterBlocks.js.map +1 -1
- package/dist/components/ContentPage/filterBlocks.mobile.js +1 -3
- package/dist/components/ContentPage/filterBlocks.mobile.js.map +1 -1
- package/dist/components/ContentPage/renderBlock.js +1 -1
- package/dist/components/ContentPage/renderBlock.js.map +1 -1
- package/dist/components/Footer/Footer.mobile.js +8 -7
- package/dist/components/Footer/Footer.mobile.js.map +1 -1
- package/dist/components/Header/Header.mobile.js +5 -5
- package/dist/components/Header/Header.mobile.js.map +1 -1
- package/dist/components/InvestmentInfo/InvestmentInfo.d.ts +5 -0
- package/dist/components/InvestmentInfo/InvestmentInfo.js +49 -0
- package/dist/components/InvestmentInfo/InvestmentInfo.js.map +1 -0
- package/dist/components/InvestmentInfo/InvestmentInfoContent.d.ts +49 -0
- package/dist/components/InvestmentInfo/InvestmentInfoContent.js +2 -0
- package/dist/components/InvestmentInfo/InvestmentInfoContent.js.map +1 -0
- package/dist/components/OtherProducts/OtherProductsItem.js +4 -6
- package/dist/components/OtherProducts/OtherProductsItem.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlock.js +2 -8
- package/dist/components/StepsBlock/StepsBlock.js.map +1 -1
- package/dist/components/StepsBlock/StepsBlockStyleMaps.js +2 -2
- package/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/dist/components/StepsBlock/renderItems.d.ts +7 -2
- package/dist/components/StepsBlock/renderItems.js +5 -1
- package/dist/components/StepsBlock/renderItems.js.map +1 -1
- package/dist/components/StepsBlock/renderStepContent.d.ts +14 -0
- package/dist/components/StepsBlock/renderStepContent.js +20 -0
- package/dist/components/StepsBlock/renderStepContent.js.map +1 -0
- package/dist/components/TariffsTable/TariffsTable.js +11 -2
- package/dist/components/TariffsTable/TariffsTable.js.map +1 -1
- package/dist/model/BlockDecorator.d.ts +1 -0
- package/dist/model/BlockDecorator.js +2 -1
- package/dist/model/BlockDecorator.js.map +1 -1
- package/dist/model/BlocksRegistry.d.ts +4 -1
- package/dist/ui-kit/Foldable/DefaultFoldButton.d.ts +14 -0
- package/dist/ui-kit/Foldable/DefaultFoldButton.js +16 -0
- package/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -0
- package/dist/ui-kit/Foldable/Foldable.d.ts +3 -10
- package/dist/ui-kit/Foldable/Foldable.js +7 -23
- package/dist/ui-kit/Foldable/Foldable.js.map +1 -1
- package/dist/ui-kit/Foldable/FoldablePartProps.d.ts +4 -0
- package/dist/ui-kit/Foldable/{FoldButtonProps.js → FoldablePartProps.js} +1 -1
- package/dist/ui-kit/Foldable/FoldablePartProps.js.map +1 -0
- package/dist/ui-kit/Foldable/FoldableSection.d.ts +5 -0
- package/dist/ui-kit/Foldable/FoldableSection.js +17 -0
- package/dist/ui-kit/Foldable/FoldableSection.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/components/Accordion/Accordion.js +3 -1
- package/lib/components/Accordion/Accordion.js.map +1 -1
- package/lib/components/Accordion/Accordion.mobile.js +5 -2
- package/lib/components/Accordion/Accordion.mobile.js.map +1 -1
- package/lib/components/Accordion/AccordionContent.d.ts +9 -7
- package/lib/components/Accordion/AccordionItem.d.ts +1 -4
- package/lib/components/Accordion/AccordionItem.js +3 -8
- package/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/components/Accordion/AccordionItem.mobile.d.ts +1 -4
- package/lib/components/Accordion/AccordionItem.mobile.js +2 -5
- package/lib/components/Accordion/AccordionItem.mobile.js.map +1 -1
- package/lib/components/Accordion/AccordionItemProps.d.ts +5 -0
- package/lib/components/Accordion/AccordionItemProps.js +2 -0
- package/lib/components/Accordion/AccordionItemProps.js.map +1 -0
- package/lib/components/Accordion/AccordionItemsList.d.ts +1 -0
- package/lib/components/Accordion/AccordionItemsList.js +4 -0
- package/lib/components/Accordion/AccordionItemsList.js.map +1 -0
- package/lib/components/Blocks.d.ts +1 -0
- package/lib/components/Blocks.js +2 -0
- package/lib/components/Blocks.js.map +1 -1
- package/lib/components/ContentPage/filterBlocks.js +1 -2
- package/lib/components/ContentPage/filterBlocks.js.map +1 -1
- package/lib/components/ContentPage/filterBlocks.mobile.js +1 -3
- package/lib/components/ContentPage/filterBlocks.mobile.js.map +1 -1
- package/lib/components/ContentPage/renderBlock.js +2 -2
- package/lib/components/ContentPage/renderBlock.js.map +1 -1
- package/lib/components/Footer/Footer.mobile.js +8 -7
- package/lib/components/Footer/Footer.mobile.js.map +1 -1
- package/lib/components/Header/Header.mobile.js +5 -5
- package/lib/components/Header/Header.mobile.js.map +1 -1
- package/lib/components/InvestmentInfo/InvestmentInfo.d.ts +5 -0
- package/lib/components/InvestmentInfo/InvestmentInfo.fixture.d.ts +7 -0
- package/lib/components/InvestmentInfo/InvestmentInfo.js +47 -0
- package/lib/components/InvestmentInfo/InvestmentInfo.js.map +1 -0
- package/lib/components/InvestmentInfo/InvestmentInfoContent.d.ts +49 -0
- package/lib/components/InvestmentInfo/InvestmentInfoContent.js +2 -0
- package/lib/components/InvestmentInfo/InvestmentInfoContent.js.map +1 -0
- package/lib/components/OtherProducts/OtherProductsItem.js +4 -6
- package/lib/components/OtherProducts/OtherProductsItem.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlock.fixture.d.ts +2 -1
- package/lib/components/StepsBlock/StepsBlock.js +2 -8
- package/lib/components/StepsBlock/StepsBlock.js.map +1 -1
- package/lib/components/StepsBlock/StepsBlockStyleMaps.js +2 -2
- package/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/lib/components/StepsBlock/renderItems.d.ts +7 -2
- package/lib/components/StepsBlock/renderItems.js +6 -2
- package/lib/components/StepsBlock/renderItems.js.map +1 -1
- package/lib/components/StepsBlock/renderStepContent.d.ts +14 -0
- package/lib/components/StepsBlock/renderStepContent.js +17 -0
- package/lib/components/StepsBlock/renderStepContent.js.map +1 -0
- package/lib/components/TariffsTable/TariffsTable.js +11 -2
- package/lib/components/TariffsTable/TariffsTable.js.map +1 -1
- package/lib/model/BlockDecorator.d.ts +1 -0
- package/lib/model/BlockDecorator.js +1 -0
- package/lib/model/BlockDecorator.js.map +1 -1
- package/lib/model/BlocksRegistry.d.ts +4 -1
- package/lib/ui-kit/Foldable/DefaultFoldButton.d.ts +14 -0
- package/lib/ui-kit/Foldable/DefaultFoldButton.js +13 -0
- package/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -0
- package/lib/ui-kit/Foldable/Foldable.d.ts +3 -10
- package/lib/ui-kit/Foldable/Foldable.js +9 -25
- package/lib/ui-kit/Foldable/Foldable.js.map +1 -1
- package/lib/ui-kit/Foldable/FoldablePartProps.d.ts +4 -0
- package/lib/ui-kit/Foldable/FoldablePartProps.js +2 -0
- package/lib/ui-kit/Foldable/FoldablePartProps.js.map +1 -0
- package/lib/ui-kit/Foldable/FoldableSection.d.ts +5 -0
- package/lib/ui-kit/Foldable/FoldableSection.js +15 -0
- package/lib/ui-kit/Foldable/FoldableSection.js.map +1 -0
- package/mobile/bundle/bundle.umd.js +131 -153
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/Accordion/AccordionContent.d.ts +9 -7
- package/mobile/bundle/components/Accordion/AccordionItem.d.ts +1 -4
- package/mobile/bundle/components/Accordion/AccordionItemProps.d.ts +5 -0
- package/mobile/bundle/components/Accordion/AccordionItemsList.d.ts +1 -0
- package/mobile/bundle/components/InvestmentInfo/InvestmentInfo.d.ts +5 -0
- package/mobile/bundle/components/InvestmentInfo/InvestmentInfoContent.d.ts +49 -0
- package/mobile/bundle/components/StepsBlock/renderItems.d.ts +7 -2
- package/mobile/bundle/components/StepsBlock/renderStepContent.d.ts +14 -0
- package/mobile/bundle/model/BlockDecorator.d.ts +1 -0
- package/mobile/bundle/model/BlocksRegistry.d.ts +4 -1
- package/mobile/bundle/ui-kit/Foldable/DefaultFoldButton.d.ts +14 -0
- package/mobile/bundle/ui-kit/Foldable/Foldable.d.ts +3 -10
- package/mobile/bundle/ui-kit/Foldable/FoldablePartProps.d.ts +4 -0
- package/mobile/bundle/ui-kit/Foldable/FoldableSection.d.ts +5 -0
- package/mobile/dist/components/Accordion/Accordion.js +5 -2
- package/mobile/dist/components/Accordion/Accordion.js.map +1 -1
- package/mobile/dist/components/Accordion/AccordionContent.d.ts +9 -7
- package/mobile/dist/components/Accordion/AccordionItem.d.ts +1 -4
- package/mobile/dist/components/Accordion/AccordionItem.js +2 -5
- package/mobile/dist/components/Accordion/AccordionItem.js.map +1 -1
- package/mobile/dist/components/Accordion/AccordionItemProps.d.ts +5 -0
- package/mobile/dist/components/Accordion/AccordionItemProps.js +2 -0
- package/mobile/dist/components/Accordion/AccordionItemProps.js.map +1 -0
- package/mobile/dist/components/Accordion/AccordionItemsList.d.ts +1 -0
- package/mobile/dist/components/Accordion/AccordionItemsList.js +6 -0
- package/mobile/dist/components/Accordion/AccordionItemsList.js.map +1 -0
- package/mobile/dist/components/ContentPage/filterBlocks.js +1 -3
- package/mobile/dist/components/ContentPage/filterBlocks.js.map +1 -1
- package/mobile/dist/components/ContentPage/renderBlock.js +1 -1
- package/mobile/dist/components/ContentPage/renderBlock.js.map +1 -1
- package/mobile/dist/components/Footer/Footer.js +8 -7
- package/mobile/dist/components/Footer/Footer.js.map +1 -1
- package/mobile/dist/components/Header/Header.js +5 -5
- package/mobile/dist/components/Header/Header.js.map +1 -1
- package/mobile/dist/components/InvestmentInfo/InvestmentInfo.d.ts +5 -0
- package/mobile/dist/components/InvestmentInfo/InvestmentInfo.js +49 -0
- package/mobile/dist/components/InvestmentInfo/InvestmentInfo.js.map +1 -0
- package/mobile/dist/components/InvestmentInfo/InvestmentInfoContent.d.ts +49 -0
- package/mobile/dist/components/InvestmentInfo/InvestmentInfoContent.js +2 -0
- package/mobile/dist/components/InvestmentInfo/InvestmentInfoContent.js.map +1 -0
- package/mobile/dist/components/OtherProducts/OtherProductsItem.js +4 -6
- package/mobile/dist/components/OtherProducts/OtherProductsItem.js.map +1 -1
- package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js +2 -2
- package/mobile/dist/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/mobile/dist/components/StepsBlock/renderItems.d.ts +7 -2
- package/mobile/dist/components/StepsBlock/renderItems.js +5 -1
- package/mobile/dist/components/StepsBlock/renderItems.js.map +1 -1
- package/mobile/dist/components/StepsBlock/renderStepContent.d.ts +14 -0
- package/mobile/dist/components/StepsBlock/renderStepContent.js +20 -0
- package/mobile/dist/components/StepsBlock/renderStepContent.js.map +1 -0
- package/mobile/dist/model/BlockDecorator.d.ts +1 -0
- package/mobile/dist/model/BlockDecorator.js +2 -1
- package/mobile/dist/model/BlockDecorator.js.map +1 -1
- package/mobile/dist/model/BlocksRegistry.d.ts +4 -1
- package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.d.ts +14 -0
- package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js +16 -0
- package/mobile/dist/ui-kit/Foldable/DefaultFoldButton.js.map +1 -0
- package/mobile/dist/ui-kit/Foldable/Foldable.d.ts +3 -10
- package/mobile/dist/ui-kit/Foldable/Foldable.js +7 -23
- package/mobile/dist/ui-kit/Foldable/Foldable.js.map +1 -1
- package/mobile/dist/ui-kit/Foldable/FoldablePartProps.d.ts +4 -0
- package/mobile/dist/ui-kit/Foldable/{FoldButtonProps.js → FoldablePartProps.js} +1 -1
- package/mobile/dist/ui-kit/Foldable/FoldablePartProps.js.map +1 -0
- package/mobile/dist/ui-kit/Foldable/FoldableSection.d.ts +5 -0
- package/mobile/dist/ui-kit/Foldable/FoldableSection.js +17 -0
- package/mobile/dist/ui-kit/Foldable/FoldableSection.js.map +1 -0
- package/mobile/lib/components/Accordion/Accordion.js +5 -2
- package/mobile/lib/components/Accordion/Accordion.js.map +1 -1
- package/mobile/lib/components/Accordion/AccordionContent.d.ts +9 -7
- package/mobile/lib/components/Accordion/AccordionItem.d.ts +1 -4
- package/mobile/lib/components/Accordion/AccordionItem.js +2 -5
- package/mobile/lib/components/Accordion/AccordionItem.js.map +1 -1
- package/mobile/lib/components/Accordion/AccordionItemProps.d.ts +5 -0
- package/mobile/lib/components/Accordion/AccordionItemProps.js +2 -0
- package/mobile/lib/components/Accordion/AccordionItemProps.js.map +1 -0
- package/mobile/lib/components/Accordion/AccordionItemsList.d.ts +1 -0
- package/mobile/lib/components/Accordion/AccordionItemsList.js +4 -0
- package/mobile/lib/components/Accordion/AccordionItemsList.js.map +1 -0
- package/mobile/lib/components/ContentPage/filterBlocks.js +1 -3
- package/mobile/lib/components/ContentPage/filterBlocks.js.map +1 -1
- package/mobile/lib/components/ContentPage/renderBlock.js +2 -2
- package/mobile/lib/components/ContentPage/renderBlock.js.map +1 -1
- package/mobile/lib/components/Footer/Footer.js +8 -7
- package/mobile/lib/components/Footer/Footer.js.map +1 -1
- package/mobile/lib/components/Header/Header.js +5 -5
- package/mobile/lib/components/Header/Header.js.map +1 -1
- package/mobile/lib/components/InvestmentInfo/InvestmentInfo.d.ts +5 -0
- package/mobile/lib/components/InvestmentInfo/InvestmentInfo.js +47 -0
- package/mobile/lib/components/InvestmentInfo/InvestmentInfo.js.map +1 -0
- package/mobile/lib/components/InvestmentInfo/InvestmentInfoContent.d.ts +49 -0
- package/mobile/lib/components/InvestmentInfo/InvestmentInfoContent.js +2 -0
- package/mobile/lib/components/InvestmentInfo/InvestmentInfoContent.js.map +1 -0
- package/mobile/lib/components/OtherProducts/OtherProductsItem.js +4 -6
- package/mobile/lib/components/OtherProducts/OtherProductsItem.js.map +1 -1
- package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js +2 -2
- package/mobile/lib/components/StepsBlock/StepsBlockStyleMaps.js.map +1 -1
- package/mobile/lib/components/StepsBlock/renderItems.d.ts +7 -2
- package/mobile/lib/components/StepsBlock/renderItems.js +6 -2
- package/mobile/lib/components/StepsBlock/renderItems.js.map +1 -1
- package/mobile/lib/components/StepsBlock/renderStepContent.d.ts +14 -0
- package/mobile/lib/components/StepsBlock/renderStepContent.js +17 -0
- package/mobile/lib/components/StepsBlock/renderStepContent.js.map +1 -0
- package/mobile/lib/model/BlockDecorator.d.ts +1 -0
- package/mobile/lib/model/BlockDecorator.js +1 -0
- package/mobile/lib/model/BlockDecorator.js.map +1 -1
- package/mobile/lib/model/BlocksRegistry.d.ts +4 -1
- package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.d.ts +14 -0
- package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js +13 -0
- package/mobile/lib/ui-kit/Foldable/DefaultFoldButton.js.map +1 -0
- package/mobile/lib/ui-kit/Foldable/Foldable.d.ts +3 -10
- package/mobile/lib/ui-kit/Foldable/Foldable.js +9 -25
- package/mobile/lib/ui-kit/Foldable/Foldable.js.map +1 -1
- package/mobile/lib/ui-kit/Foldable/FoldablePartProps.d.ts +4 -0
- package/mobile/lib/ui-kit/Foldable/FoldablePartProps.js +2 -0
- package/mobile/lib/ui-kit/Foldable/FoldablePartProps.js.map +1 -0
- package/mobile/lib/ui-kit/Foldable/FoldableSection.d.ts +5 -0
- package/mobile/lib/ui-kit/Foldable/FoldableSection.js +15 -0
- package/mobile/lib/ui-kit/Foldable/FoldableSection.js.map +1 -0
- package/mobile/src/common.css +11 -3
- package/mobile/src/components/Accordion/Accordion.tsx +17 -7
- package/mobile/src/components/Accordion/AccordionContent.ts +10 -7
- package/mobile/src/components/Accordion/AccordionItem.tsx +34 -30
- package/mobile/src/components/Accordion/AccordionItemProps.ts +6 -0
- package/mobile/src/components/Accordion/AccordionItemsList.tsx +5 -0
- package/mobile/src/components/ContentPage/filterBlocks.ts +1 -3
- package/mobile/src/components/ContentPage/renderBlock.tsx +2 -2
- package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.ui.json +8 -1
- package/mobile/src/components/Footer/Footer.tsx +15 -13
- package/mobile/src/components/GracePeriod/GracePeriod.ui.json +5 -0
- package/mobile/src/components/Header/Header.tsx +16 -11
- package/mobile/src/components/InvestmentInfo/InvestmentInfo.example.json +48 -0
- package/mobile/src/components/InvestmentInfo/InvestmentInfo.tsx +149 -0
- package/mobile/src/components/InvestmentInfo/InvestmentInfo.ui.json +16 -0
- package/mobile/src/components/InvestmentInfo/InvestmentInfoContent.ts +55 -0
- package/mobile/src/components/OtherProducts/OtherProductsItem.tsx +18 -15
- package/mobile/src/components/SafeDepositRental/SafeDepositRental.ui.json +8 -1
- package/mobile/src/components/StepsBlock/StepsBlockStyleMaps.ts +2 -2
- package/mobile/src/components/StepsBlock/renderItems.tsx +24 -15
- package/mobile/src/components/StepsBlock/renderStepContent.tsx +63 -0
- package/mobile/src/model/BlockDecorator.ts +2 -0
- package/mobile/src/model/BlocksRegistry.ts +4 -1
- package/mobile/src/ui-kit/Foldable/DefaultFoldButton.tsx +52 -0
- package/mobile/src/ui-kit/Foldable/Foldable.tsx +19 -67
- package/mobile/src/ui-kit/Foldable/FoldablePartProps.ts +4 -0
- package/mobile/src/ui-kit/Foldable/FoldableSection.tsx +30 -0
- package/package.json +2 -2
- package/src/common.css +11 -3
- package/src/components/Accordion/Accordion.mobile.tsx +17 -7
- package/src/components/Accordion/Accordion.tsx +12 -3
- package/src/components/Accordion/AccordionContent.ts +10 -7
- package/src/components/Accordion/AccordionItem.mobile.tsx +34 -30
- package/src/components/Accordion/AccordionItem.tsx +24 -23
- package/src/components/Accordion/AccordionItemProps.ts +6 -0
- package/src/components/Accordion/AccordionItemsList.tsx +5 -0
- package/src/components/Blocks.ts +2 -0
- package/src/components/ContentPage/filterBlocks.mobile.ts +1 -3
- package/src/components/ContentPage/filterBlocks.ts +1 -2
- package/src/components/ContentPage/renderBlock.tsx +2 -2
- package/src/components/ExchangeRateTile/ExchangeRateTile.ui.json +8 -1
- package/src/components/Footer/Footer.mobile.tsx +15 -13
- package/src/components/GracePeriod/GracePeriod.ui.json +5 -0
- package/src/components/Header/Header.mobile.tsx +16 -11
- package/src/components/InvestmentInfo/InvestmentInfo.example.json +48 -0
- package/src/components/InvestmentInfo/InvestmentInfo.fixture.tsx +107 -0
- package/src/components/InvestmentInfo/InvestmentInfo.tsx +149 -0
- package/src/components/InvestmentInfo/InvestmentInfo.ui.json +16 -0
- package/src/components/InvestmentInfo/InvestmentInfoContent.ts +55 -0
- package/src/components/OtherProducts/OtherProductsItem.tsx +18 -15
- package/src/components/SafeDepositRental/SafeDepositRental.ui.json +8 -1
- package/src/components/StepsBlock/StepsBlock.fixture.tsx +39 -25
- package/src/components/StepsBlock/StepsBlock.tsx +3 -49
- package/src/components/StepsBlock/StepsBlockStyleMaps.ts +2 -2
- package/src/components/StepsBlock/renderItems.tsx +24 -15
- package/src/components/StepsBlock/renderStepContent.tsx +63 -0
- package/src/components/TariffsTable/TariffsTable.tsx +32 -23
- package/src/model/BlockDecorator.ts +2 -0
- package/src/model/BlocksRegistry.ts +4 -1
- package/src/ui-kit/Foldable/DefaultFoldButton.tsx +52 -0
- package/src/ui-kit/Foldable/Foldable.tsx +19 -67
- package/src/ui-kit/Foldable/FoldablePartProps.ts +4 -0
- package/src/ui-kit/Foldable/FoldableSection.tsx +30 -0
- package/tailwind.config.cjs +5 -0
- package/bundle/components/ContentPage/isBlockInRegistry.d.ts +0 -2
- package/bundle/ui-kit/Foldable/DefaultButton.d.ts +0 -2
- package/bundle/ui-kit/Foldable/FoldButtonProps.d.ts +0 -12
- package/bundle/utils/getAccordionItems.d.ts +0 -1
- package/dist/components/ContentPage/isBlockInRegistry.d.ts +0 -2
- package/dist/components/ContentPage/isBlockInRegistry.js +0 -7
- package/dist/components/ContentPage/isBlockInRegistry.js.map +0 -1
- package/dist/ui-kit/Foldable/DefaultButton.d.ts +0 -2
- package/dist/ui-kit/Foldable/DefaultButton.js +0 -12
- package/dist/ui-kit/Foldable/DefaultButton.js.map +0 -1
- package/dist/ui-kit/Foldable/FoldButtonProps.d.ts +0 -12
- package/dist/ui-kit/Foldable/FoldButtonProps.js.map +0 -1
- package/dist/utils/getAccordionItems.d.ts +0 -1
- package/dist/utils/getAccordionItems.js +0 -13
- package/dist/utils/getAccordionItems.js.map +0 -1
- package/lib/components/ContentPage/isBlockInRegistry.d.ts +0 -2
- package/lib/components/ContentPage/isBlockInRegistry.js +0 -4
- package/lib/components/ContentPage/isBlockInRegistry.js.map +0 -1
- package/lib/ui-kit/Foldable/DefaultButton.d.ts +0 -2
- package/lib/ui-kit/Foldable/DefaultButton.js +0 -10
- package/lib/ui-kit/Foldable/DefaultButton.js.map +0 -1
- package/lib/ui-kit/Foldable/FoldButtonProps.d.ts +0 -12
- package/lib/ui-kit/Foldable/FoldButtonProps.js +0 -2
- package/lib/ui-kit/Foldable/FoldButtonProps.js.map +0 -1
- package/lib/utils/getAccordionItems.d.ts +0 -1
- package/lib/utils/getAccordionItems.js +0 -10
- package/lib/utils/getAccordionItems.js.map +0 -1
- package/mobile/bundle/components/ContentPage/isBlockInRegistry.d.ts +0 -2
- package/mobile/bundle/ui-kit/Foldable/DefaultButton.d.ts +0 -2
- package/mobile/bundle/ui-kit/Foldable/FoldButtonProps.d.ts +0 -12
- package/mobile/bundle/utils/getAccordionItems.d.ts +0 -1
- package/mobile/dist/components/ContentPage/isBlockInRegistry.d.ts +0 -2
- package/mobile/dist/components/ContentPage/isBlockInRegistry.js +0 -7
- package/mobile/dist/components/ContentPage/isBlockInRegistry.js.map +0 -1
- package/mobile/dist/ui-kit/Foldable/DefaultButton.d.ts +0 -2
- package/mobile/dist/ui-kit/Foldable/DefaultButton.js +0 -12
- package/mobile/dist/ui-kit/Foldable/DefaultButton.js.map +0 -1
- package/mobile/dist/ui-kit/Foldable/FoldButtonProps.d.ts +0 -12
- package/mobile/dist/ui-kit/Foldable/FoldButtonProps.js.map +0 -1
- package/mobile/dist/utils/getAccordionItems.d.ts +0 -1
- package/mobile/dist/utils/getAccordionItems.js +0 -13
- package/mobile/dist/utils/getAccordionItems.js.map +0 -1
- package/mobile/lib/components/ContentPage/isBlockInRegistry.d.ts +0 -2
- package/mobile/lib/components/ContentPage/isBlockInRegistry.js +0 -4
- package/mobile/lib/components/ContentPage/isBlockInRegistry.js.map +0 -1
- package/mobile/lib/ui-kit/Foldable/DefaultButton.d.ts +0 -2
- package/mobile/lib/ui-kit/Foldable/DefaultButton.js +0 -10
- package/mobile/lib/ui-kit/Foldable/DefaultButton.js.map +0 -1
- package/mobile/lib/ui-kit/Foldable/FoldButtonProps.d.ts +0 -12
- package/mobile/lib/ui-kit/Foldable/FoldButtonProps.js +0 -2
- package/mobile/lib/ui-kit/Foldable/FoldButtonProps.js.map +0 -1
- package/mobile/lib/utils/getAccordionItems.d.ts +0 -1
- package/mobile/lib/utils/getAccordionItems.js +0 -10
- package/mobile/lib/utils/getAccordionItems.js.map +0 -1
- package/mobile/src/components/ContentPage/isBlockInRegistry.ts +0 -5
- package/mobile/src/ui-kit/Foldable/DefaultButton.tsx +0 -27
- package/mobile/src/ui-kit/Foldable/FoldButtonProps.ts +0 -13
- package/mobile/src/utils/getAccordionItems.ts +0 -10
- package/src/components/ContentPage/isBlockInRegistry.ts +0 -5
- package/src/ui-kit/Foldable/DefaultButton.tsx +0 -27
- package/src/ui-kit/Foldable/FoldButtonProps.ts +0 -13
- package/src/utils/getAccordionItems.ts +0 -10
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { UniBlockProps } from '../../model/ContentPageDef';
|
|
3
|
+
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
4
|
+
import { List } from '../../ui-kit/List/List';
|
|
5
|
+
import { joinList } from '../../utils/joinList';
|
|
6
|
+
import type {
|
|
7
|
+
InvestmentCell,
|
|
8
|
+
InvestmentCellColor,
|
|
9
|
+
InvestmentCellSize,
|
|
10
|
+
InvestmentColumn,
|
|
11
|
+
InvestmentInfoContent,
|
|
12
|
+
InvestmentZeroColumn,
|
|
13
|
+
} from './InvestmentInfoContent';
|
|
14
|
+
|
|
15
|
+
const investmentCellColorMap: Record<InvestmentCellColor, string> = {
|
|
16
|
+
yellow: 'bg-yellow',
|
|
17
|
+
green: 'bg-green',
|
|
18
|
+
'green-light': 'bg-green-light',
|
|
19
|
+
'green-dark': 'bg-green-dark',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const investmentCellSizeMap: Record<InvestmentCellSize, string> = {
|
|
23
|
+
XS: 'h-[40px]',
|
|
24
|
+
S: 'h-[68px]',
|
|
25
|
+
M: 'h-[102px]',
|
|
26
|
+
L: 'h-[136px]',
|
|
27
|
+
XL: 'h-[204px]',
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export interface InvestmentInfoProps extends InvestmentInfoContent, UniBlockProps {}
|
|
31
|
+
|
|
32
|
+
export const InvestmentInfo = JSX<InvestmentInfoProps>((props) => {
|
|
33
|
+
const {
|
|
34
|
+
context,
|
|
35
|
+
className = '',
|
|
36
|
+
items,
|
|
37
|
+
isDotted,
|
|
38
|
+
investmentZeroColumn,
|
|
39
|
+
investmentColumns,
|
|
40
|
+
...rest
|
|
41
|
+
} = props;
|
|
42
|
+
const colums = investmentColumns ? [...investmentColumns] : [];
|
|
43
|
+
if (investmentZeroColumn) {
|
|
44
|
+
colums.unshift(investmentZeroColumn);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<BlockWrapper
|
|
49
|
+
className={`font-sans bg-white p-9 pb-9 ${className}`}
|
|
50
|
+
context={context}
|
|
51
|
+
{...rest}
|
|
52
|
+
>
|
|
53
|
+
<div className="container text-m-light">
|
|
54
|
+
{colums?.length ? (
|
|
55
|
+
<div>
|
|
56
|
+
<div className="flex items-end px-9 text-white">
|
|
57
|
+
{joinList(<div className="w-px h-4 bg-main-stroke" />)(
|
|
58
|
+
colums.map(renderInvestmentColumn),
|
|
59
|
+
)}
|
|
60
|
+
<div className="w-px h-4 bg-main-stroke" />
|
|
61
|
+
</div>
|
|
62
|
+
<div className="border-t border-main-stroke -mt-2 mx-9" />
|
|
63
|
+
<div className="flex justify-between mt-3 -mx-10">
|
|
64
|
+
{colums.map(renderInvestmentColumnTitle)}
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
) : null}
|
|
68
|
+
|
|
69
|
+
{items?.length ? (
|
|
70
|
+
<List
|
|
71
|
+
className="mt-9 text-h6"
|
|
72
|
+
items={items}
|
|
73
|
+
itemClassName="mb-[7px]"
|
|
74
|
+
isDotted={isDotted}
|
|
75
|
+
/>
|
|
76
|
+
) : null}
|
|
77
|
+
</div>
|
|
78
|
+
</BlockWrapper>
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
const renderInvestmentColumn = (
|
|
83
|
+
column: InvestmentColumn | InvestmentZeroColumn,
|
|
84
|
+
i: number,
|
|
85
|
+
arr: Array<InvestmentColumn>,
|
|
86
|
+
) => {
|
|
87
|
+
const isSecondColumn = i === 1;
|
|
88
|
+
const isLastColumn = i === arr.length - 1;
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<div
|
|
92
|
+
key={`column_${i}`}
|
|
93
|
+
className={`${getColumnClasses(isSecondColumn, isLastColumn, column.cells)}`}
|
|
94
|
+
>
|
|
95
|
+
{column.cells?.length ? (
|
|
96
|
+
<div className={`w-full ${isLastColumn ? 'border-4 border-green-more-dark p-1' : ''}`}>
|
|
97
|
+
{column.cells.map(renderInvestmentCell)}
|
|
98
|
+
</div>
|
|
99
|
+
) : null}
|
|
100
|
+
</div>
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const getColumnClasses = (
|
|
105
|
+
isSecondColumn: boolean,
|
|
106
|
+
isLastColumn: boolean,
|
|
107
|
+
cells: InvestmentCell[] = [],
|
|
108
|
+
): string =>
|
|
109
|
+
[
|
|
110
|
+
cells.length ? 'flex-1' : 'flex-0',
|
|
111
|
+
cells.length && !isSecondColumn && !isLastColumn ? 'pl-2.5' : '',
|
|
112
|
+
cells.length && !isLastColumn ? 'pr-2.5 pb-8' : 'pb-6',
|
|
113
|
+
].join(' ');
|
|
114
|
+
|
|
115
|
+
const renderInvestmentCell = (cell: InvestmentCell, i: number) => {
|
|
116
|
+
const cellSize = cell.cellSize || 'XS';
|
|
117
|
+
const cellColor = cell.cellColor || 'green';
|
|
118
|
+
|
|
119
|
+
return cell.text ? (
|
|
120
|
+
<div
|
|
121
|
+
key={`cell_${i}`}
|
|
122
|
+
className={`flex-1 flex items-center justify-center relative py-2 ${
|
|
123
|
+
investmentCellSizeMap[cellSize]
|
|
124
|
+
} ${investmentCellColorMap[cellColor]} ${cellSize === 'XS' ? 'px-3' : 'px-11'}`}
|
|
125
|
+
>
|
|
126
|
+
<div className="text-center">{cell.text}</div>
|
|
127
|
+
</div>
|
|
128
|
+
) : null;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const renderInvestmentColumnTitle = (
|
|
132
|
+
column: InvestmentColumn | InvestmentZeroColumn,
|
|
133
|
+
i: number,
|
|
134
|
+
arr: Array<InvestmentColumn>,
|
|
135
|
+
) => {
|
|
136
|
+
const isFirstColumn = i === 0;
|
|
137
|
+
const isLastColumn = i === arr.length - 1;
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<div
|
|
141
|
+
key={`title_${i}`}
|
|
142
|
+
className={`flex-1 max-w-[180px] text-center px-2 ${isFirstColumn ? 'pl-9' : ''} ${
|
|
143
|
+
isLastColumn ? 'pr-9' : ' '
|
|
144
|
+
}`}
|
|
145
|
+
>
|
|
146
|
+
{column.title}
|
|
147
|
+
</div>
|
|
148
|
+
);
|
|
149
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ListContent } from '../../ui-kit/List/ListContent';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @title Цвет
|
|
5
|
+
* @enumNames ["Желтый", "Светло-зеленый", "Зеленый", "Тёмно-зеленый"]
|
|
6
|
+
*/
|
|
7
|
+
export type InvestmentCellColor = 'yellow' | 'green-light' | 'green' | 'green-dark';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @title Высота
|
|
11
|
+
* @enumNames ["Очень большой", "Большой", "Средний", "Маленький", "Очень маленький"]
|
|
12
|
+
*/
|
|
13
|
+
export type InvestmentCellSize = 'XL' | 'L' | 'M' | 'S' | 'XS';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @title Ячейка
|
|
17
|
+
*/
|
|
18
|
+
export type InvestmentCell = {
|
|
19
|
+
/** @title Текст */
|
|
20
|
+
text?: string;
|
|
21
|
+
cellColor?: InvestmentCellColor;
|
|
22
|
+
cellSize?: InvestmentCellSize;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @title Элемент данных 1
|
|
27
|
+
*/
|
|
28
|
+
export type InvestmentZeroColumn = {
|
|
29
|
+
/** @title Название */
|
|
30
|
+
title?: string;
|
|
31
|
+
/** @hidden */
|
|
32
|
+
cells?: InvestmentCell[];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @title Элемент данных
|
|
37
|
+
*/
|
|
38
|
+
export type InvestmentColumn = {
|
|
39
|
+
/** @title Название */
|
|
40
|
+
title?: string;
|
|
41
|
+
/** @title Ячейки */
|
|
42
|
+
cells?: InvestmentCell[];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @title Блок инвестиций
|
|
47
|
+
*/
|
|
48
|
+
export type InvestmentInfoContent = ListContent & {
|
|
49
|
+
/** @title Буллиты */
|
|
50
|
+
isDotted?: boolean;
|
|
51
|
+
/** @title Элемент данных 1 */
|
|
52
|
+
investmentZeroColumn?: InvestmentZeroColumn;
|
|
53
|
+
/** @title Остальные элементы данных */
|
|
54
|
+
investmentColumns?: InvestmentColumn[];
|
|
55
|
+
};
|
|
@@ -2,8 +2,9 @@ import { JSX } from '@redneckz/uni-jsx';
|
|
|
2
2
|
import type { ColorPalette, UniBlockProps } from '../../model/ContentPageDef';
|
|
3
3
|
import type { VNode } from '../../model/VNode';
|
|
4
4
|
import { renderBlocksList } from '../../ui-kit/BlocksList/renderBlocksList';
|
|
5
|
-
import {
|
|
5
|
+
import { DefaultFoldButton } from '../../ui-kit/Foldable/DefaultFoldButton';
|
|
6
6
|
import { Foldable } from '../../ui-kit/Foldable/Foldable';
|
|
7
|
+
import { FoldableSection } from '../../ui-kit/Foldable/FoldableSection';
|
|
7
8
|
import type { IconName } from '../../ui-kit/Icon/IconProps';
|
|
8
9
|
import type { BlockItemCommonProps } from './OtherProductsContent';
|
|
9
10
|
|
|
@@ -14,7 +15,7 @@ export interface BlockItemProps extends BlockItemCommonProps, UniBlockProps {
|
|
|
14
15
|
const icons: IconName[] = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
15
16
|
|
|
16
17
|
export const OtherProductsItem = JSX<BlockItemProps>(
|
|
17
|
-
({ label = '', blocks, context, dataTheme, isUnfolded }) => {
|
|
18
|
+
({ label = '', blocks, context, dataTheme, isUnfolded: unfoldedByDefault }) => {
|
|
18
19
|
const foldableBlocks = renderBlocksList({
|
|
19
20
|
context,
|
|
20
21
|
blocks,
|
|
@@ -24,17 +25,23 @@ export const OtherProductsItem = JSX<BlockItemProps>(
|
|
|
24
25
|
<div className="˝border-0 border-b border-solid border-main-divider">
|
|
25
26
|
{blocks?.length ? (
|
|
26
27
|
<Foldable
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
unfoldedByDefault={unfoldedByDefault}
|
|
29
|
+
renderFoldableSection={({ isUnfolded }) => (
|
|
30
|
+
<div className="box-border">
|
|
31
|
+
<FoldableSection
|
|
32
|
+
className="grid grid-cols-12 gap-1 border-box"
|
|
33
|
+
isUnfolded={isUnfolded}
|
|
34
|
+
>
|
|
35
|
+
{foldableBlocks}
|
|
36
|
+
</FoldableSection>
|
|
37
|
+
</div>
|
|
38
|
+
)}
|
|
39
|
+
renderFoldButton={({ isUnfolded, onToggle }) => (
|
|
40
|
+
<DefaultFoldButton
|
|
35
41
|
label={label}
|
|
42
|
+
icon={icons[Number(isUnfolded)]}
|
|
36
43
|
dataTheme={dataTheme}
|
|
37
|
-
onClick={
|
|
44
|
+
onClick={onToggle}
|
|
38
45
|
/>
|
|
39
46
|
)}
|
|
40
47
|
/>
|
|
@@ -43,7 +50,3 @@ export const OtherProductsItem = JSX<BlockItemProps>(
|
|
|
43
50
|
);
|
|
44
51
|
},
|
|
45
52
|
);
|
|
46
|
-
|
|
47
|
-
const Wrapper = JSX(({ children }) => {
|
|
48
|
-
return <div className="box-border">{children}</div>;
|
|
49
|
-
});
|
|
@@ -14,7 +14,7 @@ export const STEPS_BLOCK_STYLE_MAPS: Record<BlockVersion, StyleType> = {
|
|
|
14
14
|
primary: {
|
|
15
15
|
background: 'bg-white',
|
|
16
16
|
title: 'text-primary-text',
|
|
17
|
-
description: 'text-secondary-text',
|
|
17
|
+
description: '!text-secondary-text text-l-light',
|
|
18
18
|
iconText: 'text-secondary-text',
|
|
19
19
|
iconBackground: 'bg-main-divider',
|
|
20
20
|
iconConnector: 'bg-secondary-light',
|
|
@@ -23,7 +23,7 @@ export const STEPS_BLOCK_STYLE_MAPS: Record<BlockVersion, StyleType> = {
|
|
|
23
23
|
secondary: {
|
|
24
24
|
background: 'bg-primary-main',
|
|
25
25
|
title: 'text-white',
|
|
26
|
-
description: 'text-white/80',
|
|
26
|
+
description: '!text-white/80 text-l-light',
|
|
27
27
|
iconText: 'text-white',
|
|
28
28
|
iconBackground: 'bg-white/30',
|
|
29
29
|
iconConnector: 'bg-white',
|
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { List } from '../../ui-kit/List/List';
|
|
2
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
2
3
|
|
|
3
|
-
export const renderItems = (
|
|
4
|
-
items
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
export const renderItems = ({
|
|
5
|
+
items,
|
|
6
|
+
isDotted = true,
|
|
7
|
+
version = 'primary',
|
|
8
|
+
className = '',
|
|
9
|
+
}: {
|
|
10
|
+
items?: string[];
|
|
11
|
+
isDotted?: boolean;
|
|
12
|
+
version?: BlockVersion;
|
|
13
|
+
className?: string;
|
|
14
|
+
}) => {
|
|
15
|
+
const listVersion = version === 'primary' ? 'gray' : version;
|
|
16
|
+
|
|
17
|
+
return items ? (
|
|
18
|
+
<List
|
|
19
|
+
className={`mt-4 ${className}`}
|
|
20
|
+
version={listVersion}
|
|
21
|
+
items={items}
|
|
22
|
+
listItemSize="S"
|
|
23
|
+
isDotted={isDotted}
|
|
24
|
+
/>
|
|
17
25
|
) : null;
|
|
26
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Button } from '../../ui-kit/Button/Button';
|
|
2
|
+
import type { BlockVersion } from '../../model/BlockVersion';
|
|
3
|
+
import type { HandlerDecorator, Router } from '../ContentPage/ContentPageContext';
|
|
4
|
+
import type { Step } from './StepsBlockContent';
|
|
5
|
+
import type { StyleType } from './StepsBlockStyleMaps';
|
|
6
|
+
import { renderItems } from './renderItems';
|
|
7
|
+
import { useLink } from '../../hooks/useLink';
|
|
8
|
+
|
|
9
|
+
export const renderStepContent =
|
|
10
|
+
({
|
|
11
|
+
styleMap,
|
|
12
|
+
isMainButton,
|
|
13
|
+
version,
|
|
14
|
+
router,
|
|
15
|
+
handlerDecorator,
|
|
16
|
+
}: {
|
|
17
|
+
styleMap: StyleType;
|
|
18
|
+
isMainButton: boolean;
|
|
19
|
+
version: BlockVersion;
|
|
20
|
+
router: Router;
|
|
21
|
+
handlerDecorator?: HandlerDecorator;
|
|
22
|
+
}) =>
|
|
23
|
+
(step: Step, i: number, { length }: { length: number }) => {
|
|
24
|
+
const { label, description, button, items, isDotted } = step;
|
|
25
|
+
|
|
26
|
+
const additionalMarginClass = `${button?.text ? 'mb-8' : ''} ${step?.label ? 'mt-2' : 'mt-4'}`;
|
|
27
|
+
const widthContainer = length < 5 ? 'w-[276px]' : 'w-[210px]';
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div
|
|
31
|
+
key={String(i)}
|
|
32
|
+
className={`flex flex-col items-center text-center relative
|
|
33
|
+
whitespace-pre-line overflow-hidden ${widthContainer}`}
|
|
34
|
+
>
|
|
35
|
+
{renderStepLabel(label)}
|
|
36
|
+
{renderStepDescription({
|
|
37
|
+
description,
|
|
38
|
+
className: `${styleMap.description} ${additionalMarginClass}`,
|
|
39
|
+
})}
|
|
40
|
+
{renderItems({ items, isDotted, version, className: styleMap.description })}
|
|
41
|
+
{button?.text && !isMainButton ? (
|
|
42
|
+
<Button
|
|
43
|
+
className="box-border py-3 h-12 w-full max-w-[240px] mt-auto"
|
|
44
|
+
{...useLink({ router, handlerDecorator }, button)}
|
|
45
|
+
version={version}
|
|
46
|
+
>
|
|
47
|
+
{button.text}
|
|
48
|
+
</Button>
|
|
49
|
+
) : null}
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const renderStepLabel = (label?: string) =>
|
|
55
|
+
label ? <div className="text-x6 m-0 mt-4">{label}</div> : null;
|
|
56
|
+
|
|
57
|
+
const renderStepDescription = ({
|
|
58
|
+
description,
|
|
59
|
+
className = '',
|
|
60
|
+
}: {
|
|
61
|
+
description?: string;
|
|
62
|
+
className?: string;
|
|
63
|
+
}) => (description ? <div className={className}>{description}</div> : null);
|
|
@@ -4,6 +4,8 @@ export const DEFAULT_SLOT_NAME = null;
|
|
|
4
4
|
|
|
5
5
|
export type BlockAncestors = [keyof SlotsMap | typeof DEFAULT_SLOT_NAME, ...Slot[]];
|
|
6
6
|
|
|
7
|
+
export const DEFAULT_ANCESTORS: BlockAncestors = [DEFAULT_SLOT_NAME];
|
|
8
|
+
|
|
7
9
|
interface BlockDecoratorProps<VNode> {
|
|
8
10
|
blockClassName: string;
|
|
9
11
|
block: BlockDef;
|
|
@@ -6,6 +6,9 @@ export type JSXBlock<BlockProps = Record<string, any>> = UNIComponent<
|
|
|
6
6
|
BlockProps & UniBlockProps,
|
|
7
7
|
any,
|
|
8
8
|
VNode | VNode[]
|
|
9
|
-
|
|
9
|
+
> & {
|
|
10
|
+
childrenTypes?: string[];
|
|
11
|
+
renderChild?: (child: VNode, i: number) => VNode;
|
|
12
|
+
};
|
|
10
13
|
|
|
11
14
|
export type BlocksRegistry<BlockProps = Record<string, any>> = Record<string, JSXBlock<BlockProps>>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import type { ColorPalette } from '../../model/ContentPageDef';
|
|
3
|
+
import type { IconName } from '../Icon/IconProps';
|
|
4
|
+
import { Img } from '../Img/Img';
|
|
5
|
+
import type { FoldablePartProps } from './FoldablePartProps';
|
|
6
|
+
|
|
7
|
+
interface DefaultFoldButtonProps {
|
|
8
|
+
className?: string;
|
|
9
|
+
label: string;
|
|
10
|
+
icon: IconName;
|
|
11
|
+
dataTheme?: ColorPalette;
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const DefaultFoldButton = JSX<DefaultFoldButtonProps>(
|
|
16
|
+
({ className, label, icon, dataTheme = '', onClick }) => (
|
|
17
|
+
<button
|
|
18
|
+
className={`border-none bg-primary-main hover:bg-primary-hover px-0 py-5 mb-[1px] w-full font-sans text-white flex justify-center cursor-pointer ${
|
|
19
|
+
className || ''
|
|
20
|
+
}`}
|
|
21
|
+
data-theme={dataTheme}
|
|
22
|
+
onClick={onClick}
|
|
23
|
+
>
|
|
24
|
+
<span className="text-h4 pr-3">{label}</span>
|
|
25
|
+
{icon ? (
|
|
26
|
+
<Img
|
|
27
|
+
image={{
|
|
28
|
+
icon,
|
|
29
|
+
iconVersion: 'white',
|
|
30
|
+
}}
|
|
31
|
+
className="flex-shrink-0 my-auto"
|
|
32
|
+
width="20"
|
|
33
|
+
height="20"
|
|
34
|
+
asSVG
|
|
35
|
+
/>
|
|
36
|
+
) : null}
|
|
37
|
+
</button>
|
|
38
|
+
),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export const renderDefaultFoldButton = ({ isUnfolded, onToggle }: FoldablePartProps) => {
|
|
42
|
+
const labels = ['Развернуть', 'Скрыть'];
|
|
43
|
+
const icons: IconName[] = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<DefaultFoldButton
|
|
47
|
+
icon={icons[Number(isUnfolded)]}
|
|
48
|
+
label={labels[Number(isUnfolded)]}
|
|
49
|
+
onClick={onToggle}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
@@ -1,89 +1,41 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
-
import {
|
|
2
|
+
import { useCallback, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import type { VNode } from '../../model/VNode';
|
|
4
|
-
import {
|
|
5
|
-
import type { IconName } from '../Icon/IconProps';
|
|
6
|
-
import { DefaultButton } from './DefaultButton';
|
|
4
|
+
import type { FoldablePartProps } from './FoldablePartProps';
|
|
7
5
|
|
|
8
|
-
interface RenderFoldButtonProps {
|
|
9
|
-
isUnfolded: boolean;
|
|
10
|
-
onToggle: () => void;
|
|
11
|
-
}
|
|
12
6
|
export interface FoldableProps {
|
|
13
|
-
blocks?: VNode[];
|
|
14
|
-
hiddenBlocksNum?: number;
|
|
15
7
|
unfoldedByDefault?: boolean;
|
|
16
8
|
isFoldButtonOnTop?: boolean;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
renderFoldButton?: (props: RenderFoldButtonProps) => VNode;
|
|
9
|
+
renderFoldableSection: (props: FoldablePartProps) => VNode;
|
|
10
|
+
renderFoldButton?: (props: FoldablePartProps) => VNode;
|
|
20
11
|
}
|
|
21
12
|
|
|
22
13
|
export const Foldable = JSX<FoldableProps>(
|
|
23
14
|
({
|
|
24
|
-
blocks = [],
|
|
25
|
-
hiddenBlocksNum = 0,
|
|
26
15
|
isFoldButtonOnTop = false,
|
|
27
16
|
unfoldedByDefault = false,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
renderFoldButton = renderDefaultFoldButton,
|
|
17
|
+
renderFoldableSection,
|
|
18
|
+
renderFoldButton,
|
|
31
19
|
}) => {
|
|
32
20
|
const [isUnfolded, setIsUnfolded] = useState(unfoldedByDefault);
|
|
33
|
-
const blocksToHide = clamp(hiddenBlocksNum, 0, blocks?.length);
|
|
34
|
-
const visibleBlocks = blocks.slice(0, blocks.length - blocksToHide);
|
|
35
|
-
const hiddenBlocks = blocksToHide > 0 ? blocks.slice(-blocksToHide) : [];
|
|
36
|
-
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
37
21
|
|
|
38
|
-
const onToggle = () => {
|
|
39
|
-
setIsUnfolded(!
|
|
40
|
-
|
|
41
|
-
containerRef.current.style.maxHeight = isUnfolded
|
|
42
|
-
? ''
|
|
43
|
-
: `${containerRef.current.scrollHeight}px`;
|
|
44
|
-
}
|
|
45
|
-
};
|
|
22
|
+
const onToggle = useCallback(() => {
|
|
23
|
+
setIsUnfolded((_) => !_);
|
|
24
|
+
}, []);
|
|
46
25
|
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
<div>
|
|
50
|
-
{visibleBlocks}
|
|
51
|
-
<div
|
|
52
|
-
ref={containerRef}
|
|
53
|
-
className={`transition-max-h duration-300 overflow-hidden max-h-0 ${containerClassName}`}
|
|
54
|
-
>
|
|
55
|
-
{hiddenBlocks}
|
|
56
|
-
</div>
|
|
57
|
-
</div>,
|
|
58
|
-
);
|
|
26
|
+
const sectionNode = renderFoldableSection({ isUnfolded, onToggle });
|
|
27
|
+
const buttonNode = renderFoldButton ? renderFoldButton({ isUnfolded, onToggle }) : null;
|
|
59
28
|
|
|
60
|
-
return (
|
|
29
|
+
return isFoldButtonOnTop ? (
|
|
61
30
|
<div>
|
|
62
|
-
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
{blocksNode}
|
|
70
|
-
{buttonNode}
|
|
71
|
-
</div>
|
|
72
|
-
)}
|
|
31
|
+
{buttonNode}
|
|
32
|
+
{sectionNode}
|
|
33
|
+
</div>
|
|
34
|
+
) : (
|
|
35
|
+
<div>
|
|
36
|
+
{sectionNode}
|
|
37
|
+
{buttonNode}
|
|
73
38
|
</div>
|
|
74
39
|
);
|
|
75
40
|
},
|
|
76
41
|
);
|
|
77
|
-
|
|
78
|
-
const renderDefaultFoldButton = (props: RenderFoldButtonProps) => {
|
|
79
|
-
const labels = ['Развернуть', 'Скрыть'];
|
|
80
|
-
const icons: IconName[] = ['ArrowDownIcon', 'ArrowUpIcon'];
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<DefaultButton
|
|
84
|
-
icon={icons[Number(props.isUnfolded)]}
|
|
85
|
-
label={labels[Number(props.isUnfolded)]}
|
|
86
|
-
onClick={props.onToggle}
|
|
87
|
-
/>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { JSX } from '@redneckz/uni-jsx';
|
|
2
|
+
import { useEffect, useRef } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
|
+
|
|
4
|
+
export interface FoldableSectionProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
isUnfolded?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const FoldableSection = JSX<FoldableSectionProps>(
|
|
10
|
+
({ className = '', isUnfolded, children }) => {
|
|
11
|
+
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (containerRef.current) {
|
|
15
|
+
containerRef.current.style.maxHeight = isUnfolded
|
|
16
|
+
? `${containerRef.current.scrollHeight}px`
|
|
17
|
+
: '';
|
|
18
|
+
}
|
|
19
|
+
}, [isUnfolded]);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div
|
|
23
|
+
ref={containerRef}
|
|
24
|
+
className={`transition-max-h duration-300 overflow-hidden max-h-0 ${className}`}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redneckz/wildless-cms-uni-blocks",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ЦК",
|
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
"path": "lib/common.css"
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
|
-
"limit": "
|
|
185
|
+
"limit": "37 kB",
|
|
186
186
|
"path": "bundle/bundle.umd.min.js"
|
|
187
187
|
}
|
|
188
188
|
],
|