@redneckz/wildless-cms-uni-blocks 0.13.4 → 0.13.6
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.13.4.js +30 -0
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +168 -124
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ButtonsBlock/ButtonsBlockContent.d.ts +2 -0
- package/bundle/components/Carousel/CarouselContent.d.ts +6 -0
- package/bundle/components/Carousel/renderCarouselCards.d.ts +3 -1
- package/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -4
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.d.ts +1 -1
- package/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -4
- package/bundle/components/Header/HeaderSubMenu.d.ts +1 -1
- package/bundle/components/LinkDocs/LinkDocsContent.d.ts +2 -5
- package/bundle/components/ParagraphBlock/ParagraphBlockContent.d.ts +3 -3
- package/bundle/icons/IconName.d.ts +4 -2
- package/bundle/model/HeadlineType.d.ts +1 -1
- package/bundle/ui-kit/DialogManager/useDialogsList.d.ts +7 -0
- package/bundle/ui-kit/Input/InputProps.d.ts +1 -0
- package/bundle/ui-kit/List/ListContent.d.ts +2 -2
- package/bundle/ui-kit/Select/Select.d.ts +1 -0
- package/cosmos-static/icons/CourtHouseIcon.svg +1 -0
- package/dist/components/ApplicationForm/ApplicationFormCredit.js +2 -1
- package/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/dist/components/ApplicationForm/PhoneInputControl.js +1 -1
- package/dist/components/ApplicationForm/PhoneInputControl.js.map +1 -1
- package/dist/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
- package/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
- package/dist/components/ApplicationForm/renderCreditParameters.js +1 -1
- package/dist/components/ApplicationForm/renderCreditParameters.js.map +1 -1
- package/dist/components/ApplicationForm/renderRegion.js +1 -1
- package/dist/components/ApplicationForm/renderRegion.js.map +1 -1
- package/dist/components/ApplicationForm/renderRegionDepartment.js +1 -1
- package/dist/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
- package/dist/components/ButtonsBlock/ButtonsBlock.js +9 -1
- package/dist/components/ButtonsBlock/ButtonsBlock.js.map +1 -1
- package/dist/components/ButtonsBlock/ButtonsBlockContent.d.ts +2 -0
- package/dist/components/Carousel/Carousel.js +2 -2
- package/dist/components/Carousel/Carousel.js.map +1 -1
- package/dist/components/Carousel/CarouselContent.d.ts +6 -0
- package/dist/components/Carousel/renderCarouselCards.d.ts +3 -1
- package/dist/components/Carousel/renderCarouselCards.js +12 -3
- package/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/dist/components/CarouselLinks/CarouselLinks.js +1 -1
- package/dist/components/CarouselLinks/CarouselLinks.js.map +1 -1
- package/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -4
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.d.ts +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js.map +1 -1
- package/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -4
- package/dist/components/Header/HeaderSubMenu.d.ts +1 -1
- package/dist/components/Header/HeaderSubMenu.js +4 -4
- package/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/dist/components/Headline/headlineVersionStyles.js +1 -1
- package/dist/components/LinkDocs/LinkDocsContent.d.ts +2 -5
- package/dist/components/ParagraphBlock/ParagraphBlockContent.d.ts +3 -3
- package/dist/icons/IconName.d.ts +4 -2
- package/dist/icons/IconName.js +2 -0
- package/dist/icons/IconName.js.map +1 -1
- package/dist/model/HeadlineType.d.ts +1 -1
- package/dist/ui-kit/BaseTile/BaseTile.js +1 -1
- package/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/dist/ui-kit/DialogManager/DialogManager.js +9 -29
- package/dist/ui-kit/DialogManager/DialogManager.js.map +1 -1
- package/dist/ui-kit/DialogManager/useDialogsList.d.ts +7 -0
- package/dist/ui-kit/DialogManager/useDialogsList.js +37 -0
- package/dist/ui-kit/DialogManager/useDialogsList.js.map +1 -0
- package/dist/ui-kit/Input/Input.js +2 -2
- package/dist/ui-kit/Input/Input.js.map +1 -1
- package/dist/ui-kit/Input/InputProps.d.ts +1 -0
- package/dist/ui-kit/List/List.js +2 -0
- package/dist/ui-kit/List/List.js.map +1 -1
- package/dist/ui-kit/List/ListContent.d.ts +2 -2
- package/dist/ui-kit/List/ListItem.js +1 -0
- package/dist/ui-kit/List/ListItem.js.map +1 -1
- package/dist/ui-kit/Select/Select.d.ts +1 -0
- package/dist/ui-kit/Select/Select.js +18 -4
- package/dist/ui-kit/Select/Select.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/components/ApplicationForm/ApplicationFormCredit.js +2 -1
- package/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/lib/components/ApplicationForm/PhoneInputControl.js +1 -1
- package/lib/components/ApplicationForm/PhoneInputControl.js.map +1 -1
- package/lib/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
- package/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
- package/lib/components/ApplicationForm/renderCreditParameters.js +1 -1
- package/lib/components/ApplicationForm/renderCreditParameters.js.map +1 -1
- package/lib/components/ApplicationForm/renderRegion.js +1 -1
- package/lib/components/ApplicationForm/renderRegion.js.map +1 -1
- package/lib/components/ApplicationForm/renderRegionDepartment.js +1 -1
- package/lib/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
- package/lib/components/ButtonsBlock/ButtonsBlock.js +9 -1
- package/lib/components/ButtonsBlock/ButtonsBlock.js.map +1 -1
- package/lib/components/ButtonsBlock/ButtonsBlockContent.d.ts +2 -0
- package/lib/components/Carousel/Carousel.js +2 -2
- package/lib/components/Carousel/Carousel.js.map +1 -1
- package/lib/components/Carousel/CarouselContent.d.ts +6 -0
- package/lib/components/Carousel/renderCarouselCards.d.ts +3 -1
- package/lib/components/Carousel/renderCarouselCards.js +12 -3
- package/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/lib/components/CarouselLinks/CarouselLinks.js +1 -1
- package/lib/components/CarouselLinks/CarouselLinks.js.map +1 -1
- package/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -4
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.d.ts +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.js.map +1 -1
- package/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -4
- package/lib/components/Header/HeaderSubMenu.d.ts +1 -1
- package/lib/components/Header/HeaderSubMenu.js +4 -4
- package/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/lib/components/Headline/headlineVersionStyles.js +1 -1
- package/lib/components/LinkDocs/LinkDocsContent.d.ts +2 -5
- package/lib/components/ParagraphBlock/ParagraphBlockContent.d.ts +3 -3
- package/lib/icons/IconName.d.ts +4 -2
- package/lib/icons/IconName.js +2 -0
- package/lib/icons/IconName.js.map +1 -1
- package/lib/model/HeadlineType.d.ts +1 -1
- package/lib/ui-kit/BaseTile/BaseTile.js +1 -1
- package/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/lib/ui-kit/DialogManager/DialogManager.js +9 -29
- package/lib/ui-kit/DialogManager/DialogManager.js.map +1 -1
- package/lib/ui-kit/DialogManager/useDialogsList.d.ts +7 -0
- package/lib/ui-kit/DialogManager/useDialogsList.js +34 -0
- package/lib/ui-kit/DialogManager/useDialogsList.js.map +1 -0
- package/lib/ui-kit/Input/Input.js +2 -2
- package/lib/ui-kit/Input/Input.js.map +1 -1
- package/lib/ui-kit/Input/InputProps.d.ts +1 -0
- package/lib/ui-kit/List/List.js +2 -0
- package/lib/ui-kit/List/List.js.map +1 -1
- package/lib/ui-kit/List/ListContent.d.ts +2 -2
- package/lib/ui-kit/List/ListItem.js +1 -0
- package/lib/ui-kit/List/ListItem.js.map +1 -1
- package/lib/ui-kit/Select/Select.d.ts +1 -0
- package/lib/ui-kit/Select/Select.js +19 -5
- package/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +139 -31
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ButtonsBlock/ButtonsBlockContent.d.ts +2 -0
- package/mobile/bundle/components/Carousel/CarouselContent.d.ts +6 -0
- package/mobile/bundle/components/Carousel/renderCarouselCards.d.ts +3 -1
- package/mobile/bundle/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -4
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +1 -1
- package/mobile/bundle/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -4
- package/mobile/bundle/components/Header/HeaderSubMenu.d.ts +1 -1
- package/mobile/bundle/components/LinkDocs/LinkDocsContent.d.ts +2 -5
- package/mobile/bundle/components/ParagraphBlock/ParagraphBlockContent.d.ts +3 -3
- package/mobile/bundle/icons/IconName.d.ts +4 -2
- package/mobile/bundle/model/HeadlineType.d.ts +1 -1
- package/mobile/bundle/ui-kit/DialogManager/useDialogsList.d.ts +7 -0
- package/mobile/bundle/ui-kit/Input/InputProps.d.ts +1 -0
- package/mobile/bundle/ui-kit/List/ListContent.d.ts +2 -2
- package/mobile/bundle/ui-kit/Select/Select.d.ts +1 -0
- package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js +2 -1
- package/mobile/dist/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/PhoneInputControl.js +1 -1
- package/mobile/dist/components/ApplicationForm/PhoneInputControl.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderCreditParameters.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderCreditParameters.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderRegion.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderRegion.js.map +1 -1
- package/mobile/dist/components/ApplicationForm/renderRegionDepartment.js +1 -1
- package/mobile/dist/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
- package/mobile/dist/components/ButtonsBlock/ButtonsBlock.js +9 -1
- package/mobile/dist/components/ButtonsBlock/ButtonsBlock.js.map +1 -1
- package/mobile/dist/components/ButtonsBlock/ButtonsBlockContent.d.ts +2 -0
- package/mobile/dist/components/Carousel/Carousel.js +2 -2
- package/mobile/dist/components/Carousel/Carousel.js.map +1 -1
- package/mobile/dist/components/Carousel/CarouselContent.d.ts +6 -0
- package/mobile/dist/components/Carousel/renderCarouselCards.d.ts +3 -1
- package/mobile/dist/components/Carousel/renderCarouselCards.js +12 -3
- package/mobile/dist/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/dist/components/CarouselLinks/CarouselLinks.js +1 -1
- package/mobile/dist/components/CarouselLinks/CarouselLinks.js.map +1 -1
- package/mobile/dist/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -4
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/dist/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -4
- package/mobile/dist/components/Footer/buttonSizeStyles.js +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.d.ts +1 -1
- package/mobile/dist/components/Header/HeaderSubMenu.js +4 -4
- package/mobile/dist/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/dist/components/Headline/headlineVersionStyles.js +1 -1
- package/mobile/dist/components/LinkDocs/LinkDocsContent.d.ts +2 -5
- package/mobile/dist/components/ParagraphBlock/ParagraphBlockContent.d.ts +3 -3
- package/mobile/dist/icons/IconName.d.ts +4 -2
- package/mobile/dist/icons/IconName.js +2 -0
- package/mobile/dist/icons/IconName.js.map +1 -1
- package/mobile/dist/model/HeadlineType.d.ts +1 -1
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js +1 -1
- package/mobile/dist/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/dist/ui-kit/DialogManager/DialogManager.js +9 -29
- package/mobile/dist/ui-kit/DialogManager/DialogManager.js.map +1 -1
- package/mobile/dist/ui-kit/DialogManager/useDialogsList.d.ts +7 -0
- package/mobile/dist/ui-kit/DialogManager/useDialogsList.js +37 -0
- package/mobile/dist/ui-kit/DialogManager/useDialogsList.js.map +1 -0
- package/mobile/dist/ui-kit/Input/Input.js +2 -2
- package/mobile/dist/ui-kit/Input/Input.js.map +1 -1
- package/mobile/dist/ui-kit/Input/InputProps.d.ts +1 -0
- package/mobile/dist/ui-kit/List/List.js +2 -0
- package/mobile/dist/ui-kit/List/List.js.map +1 -1
- package/mobile/dist/ui-kit/List/ListContent.d.ts +2 -2
- package/mobile/dist/ui-kit/List/ListItem.js +1 -0
- package/mobile/dist/ui-kit/List/ListItem.js.map +1 -1
- package/mobile/dist/ui-kit/Select/Select.d.ts +1 -0
- package/mobile/dist/ui-kit/Select/Select.js +18 -4
- package/mobile/dist/ui-kit/Select/Select.js.map +1 -1
- package/mobile/lib/common.css +1 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js +2 -1
- package/mobile/lib/components/ApplicationForm/ApplicationFormCredit.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/PhoneInputControl.js +1 -1
- package/mobile/lib/components/ApplicationForm/PhoneInputControl.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderCreditDataOrganization.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderCreditParameters.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderCreditParameters.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderRegion.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderRegion.js.map +1 -1
- package/mobile/lib/components/ApplicationForm/renderRegionDepartment.js +1 -1
- package/mobile/lib/components/ApplicationForm/renderRegionDepartment.js.map +1 -1
- package/mobile/lib/components/ButtonsBlock/ButtonsBlock.js +9 -1
- package/mobile/lib/components/ButtonsBlock/ButtonsBlock.js.map +1 -1
- package/mobile/lib/components/ButtonsBlock/ButtonsBlockContent.d.ts +2 -0
- package/mobile/lib/components/Carousel/Carousel.js +2 -2
- package/mobile/lib/components/Carousel/Carousel.js.map +1 -1
- package/mobile/lib/components/Carousel/CarouselContent.d.ts +6 -0
- package/mobile/lib/components/Carousel/renderCarouselCards.d.ts +3 -1
- package/mobile/lib/components/Carousel/renderCarouselCards.js +12 -3
- package/mobile/lib/components/Carousel/renderCarouselCards.js.map +1 -1
- package/mobile/lib/components/CarouselLinks/CarouselLinks.js +1 -1
- package/mobile/lib/components/CarouselLinks/CarouselLinks.js.map +1 -1
- package/mobile/lib/components/CarouselProductCard/CarouselProductCardContent.d.ts +2 -4
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.d.ts +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCard.js.map +1 -1
- package/mobile/lib/components/CarouselRecommendationCard/CarouselRecommendationCardContent.d.ts +2 -4
- package/mobile/lib/components/Footer/buttonSizeStyles.js +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.d.ts +1 -1
- package/mobile/lib/components/Header/HeaderSubMenu.js +4 -4
- package/mobile/lib/components/Header/HeaderSubMenu.js.map +1 -1
- package/mobile/lib/components/Headline/headlineVersionStyles.js +1 -1
- package/mobile/lib/components/LinkDocs/LinkDocsContent.d.ts +2 -5
- package/mobile/lib/components/ParagraphBlock/ParagraphBlockContent.d.ts +3 -3
- package/mobile/lib/icons/IconName.d.ts +4 -2
- package/mobile/lib/icons/IconName.js +2 -0
- package/mobile/lib/icons/IconName.js.map +1 -1
- package/mobile/lib/model/HeadlineType.d.ts +1 -1
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js +1 -1
- package/mobile/lib/ui-kit/BaseTile/BaseTile.js.map +1 -1
- package/mobile/lib/ui-kit/DialogManager/DialogManager.js +9 -29
- package/mobile/lib/ui-kit/DialogManager/DialogManager.js.map +1 -1
- package/mobile/lib/ui-kit/DialogManager/useDialogsList.d.ts +7 -0
- package/mobile/lib/ui-kit/DialogManager/useDialogsList.js +34 -0
- package/mobile/lib/ui-kit/DialogManager/useDialogsList.js.map +1 -0
- package/mobile/lib/ui-kit/Input/Input.js +2 -2
- package/mobile/lib/ui-kit/Input/Input.js.map +1 -1
- package/mobile/lib/ui-kit/Input/InputProps.d.ts +1 -0
- package/mobile/lib/ui-kit/List/List.js +2 -0
- package/mobile/lib/ui-kit/List/List.js.map +1 -1
- package/mobile/lib/ui-kit/List/ListContent.d.ts +2 -2
- package/mobile/lib/ui-kit/List/ListItem.js +1 -0
- package/mobile/lib/ui-kit/List/ListItem.js.map +1 -1
- package/mobile/lib/ui-kit/Select/Select.d.ts +1 -0
- package/mobile/lib/ui-kit/Select/Select.js +19 -5
- package/mobile/lib/ui-kit/Select/Select.js.map +1 -1
- package/mobile/src/components/ApplicationForm/ApplicationFormCredit.tsx +2 -1
- package/mobile/src/components/ApplicationForm/PhoneInputControl.tsx +1 -0
- package/mobile/src/components/ApplicationForm/renderCreditDataOrganization.tsx +1 -1
- package/mobile/src/components/ApplicationForm/renderCreditParameters.tsx +2 -2
- package/mobile/src/components/ApplicationForm/renderRegion.tsx +1 -0
- package/mobile/src/components/ApplicationForm/renderRegionDepartment.tsx +1 -0
- package/mobile/src/components/ButtonsBlock/ButtonsBlock.tsx +22 -5
- package/mobile/src/components/ButtonsBlock/ButtonsBlockContent.ts +2 -0
- package/mobile/src/components/Carousel/Carousel.example.json +2 -1
- package/mobile/src/components/Carousel/Carousel.tsx +2 -1
- package/mobile/src/components/Carousel/CarouselContent.ts +7 -0
- package/mobile/src/components/Carousel/renderCarouselCards.tsx +20 -4
- package/mobile/src/components/CarouselLinks/CarouselLinks.tsx +1 -1
- package/mobile/src/components/CarouselProductCard/CarouselProductCardContent.ts +7 -4
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCard.tsx +7 -7
- package/mobile/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +3 -4
- package/mobile/src/components/Footer/buttonSizeStyles.ts +1 -1
- package/mobile/src/components/Header/HeaderSubMenu.tsx +17 -15
- package/mobile/src/components/Headline/Headline.example.json +1 -1
- package/mobile/src/components/Headline/headlineVersionStyles.ts +1 -1
- package/mobile/src/components/LinkDocs/LinkDocsContent.ts +3 -5
- package/mobile/src/components/ParagraphBlock/ParagraphBlockContent.ts +9 -8
- package/mobile/src/icons/CourtHouseIcon.svg +1 -0
- package/mobile/src/icons/IconName.ts +4 -4
- package/mobile/src/model/HeadlineType.ts +1 -1
- package/mobile/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
- package/mobile/src/ui-kit/DialogManager/DialogManager.tsx +9 -34
- package/mobile/src/ui-kit/DialogManager/useDialogsList.ts +50 -0
- package/mobile/src/ui-kit/Input/Input.tsx +2 -0
- package/mobile/src/ui-kit/Input/InputProps.ts +1 -0
- package/mobile/src/ui-kit/List/List.tsx +2 -0
- package/mobile/src/ui-kit/List/ListContent.ts +2 -2
- package/mobile/src/ui-kit/List/ListItem.tsx +1 -0
- package/mobile/src/ui-kit/Select/Select.tsx +46 -12
- package/package.json +1 -1
- package/src/components/ApplicationForm/ApplicationFormCredit.tsx +2 -1
- package/src/components/ApplicationForm/PhoneInputControl.tsx +1 -0
- package/src/components/ApplicationForm/renderCreditDataOrganization.tsx +1 -1
- package/src/components/ApplicationForm/renderCreditParameters.tsx +2 -2
- package/src/components/ApplicationForm/renderRegion.tsx +1 -0
- package/src/components/ApplicationForm/renderRegionDepartment.tsx +1 -0
- package/src/components/ButtonsBlock/ButtonsBlock.tsx +22 -5
- package/src/components/ButtonsBlock/ButtonsBlockContent.ts +2 -0
- package/src/components/Carousel/Carousel.example.json +2 -1
- package/src/components/Carousel/Carousel.fixture.tsx +2 -0
- package/src/components/Carousel/Carousel.tsx +2 -1
- package/src/components/Carousel/CarouselContent.ts +7 -0
- package/src/components/Carousel/renderCarouselCards.tsx +20 -4
- package/src/components/CarouselLinks/CarouselLinks.fixture.tsx +12 -9
- package/src/components/CarouselLinks/CarouselLinks.tsx +1 -1
- package/src/components/CarouselProductCard/CarouselProductCardContent.ts +7 -4
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.fixture.mobile.tsx +1 -1
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCard.mobile.tsx +7 -7
- package/src/components/CarouselRecommendationCard/CarouselRecommendationCardContent.ts +3 -4
- package/src/components/Header/HeaderSubMenu.tsx +17 -15
- package/src/components/Headline/Headline.example.json +1 -1
- package/src/components/Headline/headlineVersionStyles.ts +1 -1
- package/src/components/LinkDocs/LinkDocsContent.ts +3 -5
- package/src/components/ParagraphBlock/ParagraphBlockContent.ts +9 -8
- package/src/icons/CourtHouseIcon.svg +1 -0
- package/src/icons/IconName.ts +4 -1
- package/src/model/HeadlineType.ts +1 -1
- package/src/ui-kit/BaseTile/BaseTile.tsx +1 -1
- package/src/ui-kit/DialogManager/DialogManager.tsx +9 -34
- package/src/ui-kit/DialogManager/useDialogsList.ts +50 -0
- package/src/ui-kit/Input/Input.tsx +2 -0
- package/src/ui-kit/Input/InputProps.ts +1 -0
- package/src/ui-kit/List/List.tsx +2 -0
- package/src/ui-kit/List/ListContent.ts +2 -2
- package/src/ui-kit/List/ListItem.tsx +1 -0
- package/src/ui-kit/Select/Select.tsx +46 -12
- package/bundle/components/Footer/buttonSizeStyles.mobile.d.ts +0 -4
- package/dist/components/Footer/buttonSizeStyles.mobile.d.ts +0 -4
- package/dist/components/Footer/buttonSizeStyles.mobile.js +0 -7
- package/dist/components/Footer/buttonSizeStyles.mobile.js.map +0 -1
- package/lib/components/Footer/buttonSizeStyles.mobile.d.ts +0 -4
- package/lib/components/Footer/buttonSizeStyles.mobile.js +0 -5
- package/lib/components/Footer/buttonSizeStyles.mobile.js.map +0 -1
- package/src/components/Footer/buttonSizeStyles.mobile.ts +0 -6
package/bundle/bundle.umd.js
CHANGED
|
@@ -685,7 +685,7 @@
|
|
|
685
685
|
};
|
|
686
686
|
};
|
|
687
687
|
|
|
688
|
-
const Input = JSX(({ key, className = '', inputClassName = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, }) => {
|
|
688
|
+
const Input = JSX(({ key, className = '', inputClassName = '', id, name, type = 'text', label, placeholder, value = '', valid = true, children, onChange, onFocus, onBlur, pattern, autoFocus = false, }) => {
|
|
689
689
|
const handleChange = useCallback((e) => {
|
|
690
690
|
onChange && onChange(e.target?.value || '');
|
|
691
691
|
}, [onChange]);
|
|
@@ -693,7 +693,7 @@
|
|
|
693
693
|
const validStyle = valid
|
|
694
694
|
? 'border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text'
|
|
695
695
|
: 'border-error';
|
|
696
|
-
return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { children: [label ? (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) })) : null, jsx("input", { className: style('w-full border rounded-md text-primary-text outline-none p-m', paddingStyle, validStyle, inputClassName), id: id, name: name || id, placeholder: placeholder, type: type, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern }, key)] }), children] }));
|
|
696
|
+
return (jsxs("div", { className: style('relative', className), children: [jsxs("label", { children: [label ? (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", font: "font-light", children: label }) })) : null, jsx("input", { className: style('w-full border rounded-md text-primary-text outline-none p-m', paddingStyle, validStyle, inputClassName), id: id, name: name || id, placeholder: placeholder, type: type, value: value, onInput: handleChange, onFocus: onFocus, onBlur: onBlur, pattern: pattern, autoFocus: autoFocus }, key)] }), children] }));
|
|
697
697
|
});
|
|
698
698
|
|
|
699
699
|
const InputControl = JSX(({ className, label, value = '', error, onChange, onBlur }) => (jsxs("div", { className: className, children: [jsx(Input, { type: "text", "aria-label": label, label: label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur }), jsx("div", { className: "h-2", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null })] })));
|
|
@@ -717,7 +717,7 @@
|
|
|
717
717
|
return (jsx(Input, { onChange: handleChange, onFocus: (event) => handleChange(event?.target?.value || ''), ...inputProps, children: children }));
|
|
718
718
|
});
|
|
719
719
|
|
|
720
|
-
const PhoneInputControl = JSX(({ className, label, value, error, onChange, onBlur }) => (jsxs("div", { className: className, children: [jsx(PhoneInput, { "aria-label": label, label: label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur }), jsx("div", { className: "h-2", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null })] })));
|
|
720
|
+
const PhoneInputControl = JSX(({ className, label, value, error, onChange, onBlur }) => (jsxs("div", { className: className, children: [jsx(PhoneInput, { "aria-label": label, label: label, valid: Boolean(!error), value: value, onChange: onChange, onBlur: onBlur, placeholder: "+7 (___) ___-__-__" }), jsx("div", { className: "h-2", children: error ? (jsx(Text, { size: "text-xs", font: "font-light", color: "text-error", children: error })) : null })] })));
|
|
721
721
|
|
|
722
722
|
const pattern = (regexp) => validator((_) => typeof _ === 'string' && regexp.test(_));
|
|
723
723
|
|
|
@@ -776,6 +776,70 @@
|
|
|
776
776
|
return targetRef;
|
|
777
777
|
}
|
|
778
778
|
|
|
779
|
+
const JARO_WINKLER_P = 0.1;
|
|
780
|
+
const JARO_WINKLER_MAX_L = 4;
|
|
781
|
+
const jaroWinklerDistance = (s1) => (s2) => {
|
|
782
|
+
if (s1 === s2) {
|
|
783
|
+
return 1;
|
|
784
|
+
}
|
|
785
|
+
if (!s1 || !s2) {
|
|
786
|
+
return 0;
|
|
787
|
+
}
|
|
788
|
+
const { m, s1Matches, s2Matches } = computeM(s1, s2);
|
|
789
|
+
if (m === 0) {
|
|
790
|
+
return 0;
|
|
791
|
+
}
|
|
792
|
+
const t = computeT(s1, s2, { s1Matches, s2Matches });
|
|
793
|
+
const jaroWeight = (m / s1.length + m / s2.length + (m - t / 2) / m) / 3;
|
|
794
|
+
const winklerWeight = jaroWeight > 0.7 ? computePrefixL(s1, s2) * JARO_WINKLER_P : 0;
|
|
795
|
+
return jaroWeight + winklerWeight * (1 - jaroWeight);
|
|
796
|
+
};
|
|
797
|
+
function computeM(s1, s2) {
|
|
798
|
+
const range = Math.max(0, Math.floor(Math.max(s1.length, s2.length) / 2) - 1);
|
|
799
|
+
const s1Matches = new Array(s1.length);
|
|
800
|
+
const s2Matches = new Array(s2.length);
|
|
801
|
+
let m = 0;
|
|
802
|
+
for (let i = 0; i < s1.length; i++) {
|
|
803
|
+
const low = Math.max(0, i - range);
|
|
804
|
+
const high = Math.min(i + range, s2.length - 1);
|
|
805
|
+
for (let j = low; j <= high; j++) {
|
|
806
|
+
if (s1Matches[i] || s2Matches[j] || s1[i] !== s2[j]) {
|
|
807
|
+
continue;
|
|
808
|
+
}
|
|
809
|
+
m++;
|
|
810
|
+
s1Matches[i] = true;
|
|
811
|
+
s2Matches[j] = true;
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
return { m, s1Matches, s2Matches };
|
|
815
|
+
}
|
|
816
|
+
function computeT(s1, s2, { s1Matches, s2Matches }) {
|
|
817
|
+
let t = 0;
|
|
818
|
+
for (let i = 0, k = 0; i < s1.length; i++) {
|
|
819
|
+
if (!s1Matches[i]) {
|
|
820
|
+
continue;
|
|
821
|
+
}
|
|
822
|
+
let j = k;
|
|
823
|
+
for (; j < s2.length; j++) {
|
|
824
|
+
if (s2Matches[j]) {
|
|
825
|
+
k = j + 1;
|
|
826
|
+
break;
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
if (s1[i] !== s2[j]) {
|
|
830
|
+
t++;
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
return t;
|
|
834
|
+
}
|
|
835
|
+
function computePrefixL(s1, s2) {
|
|
836
|
+
let prefixL = 0;
|
|
837
|
+
while (s1[prefixL] === s2[prefixL] && prefixL < JARO_WINKLER_MAX_L) {
|
|
838
|
+
prefixL++;
|
|
839
|
+
}
|
|
840
|
+
return prefixL;
|
|
841
|
+
}
|
|
842
|
+
|
|
779
843
|
const svgUseStyleMap = {
|
|
780
844
|
normal: '',
|
|
781
845
|
color: 'text-primary-main',
|
|
@@ -796,16 +860,28 @@
|
|
|
796
860
|
const getSvgSize = (width) => (width ? '' : 'w-full h-full');
|
|
797
861
|
const Background = JSX(({ className, children }) => className ? jsx("div", { className: className, children: children }) : children);
|
|
798
862
|
|
|
799
|
-
const Select = JSX(({ className = '', label, options = [], value, valid = true, isBorder = true, placeholder = '', onChange, }) => {
|
|
863
|
+
const Select = JSX(({ className = '', label, options = [], value, valid = true, isBorder = true, placeholder = '', onChange, isSearch = false, }) => {
|
|
800
864
|
const [isOpen, { setFalse: close, toggle }] = useBool();
|
|
801
|
-
const
|
|
802
|
-
const
|
|
865
|
+
const [searchValue, setSearchValue] = useState('');
|
|
866
|
+
const reset = useCallback(() => {
|
|
803
867
|
close();
|
|
868
|
+
setSearchValue('');
|
|
869
|
+
}, []);
|
|
870
|
+
const wrapperRef = useOutsideClick(reset);
|
|
871
|
+
const handleChange = useCallback((option) => {
|
|
872
|
+
reset();
|
|
804
873
|
onChange && onChange(option);
|
|
805
874
|
}, [onChange]);
|
|
806
875
|
const isSelected = (option) => option.key === value?.key;
|
|
807
|
-
return (jsxs("div", { className: className, ref: wrapperRef, children: [
|
|
876
|
+
return (jsxs("div", { className: className, ref: wrapperRef, children: [renderLabel(label), jsxs("div", { className: style('relative', isOpen ? 'z-20' : 'z-10'), children: [jsxs("div", { className: style('text-l flex justify-between items-center text-primary-text cursor-pointer relative z-10', getBorderStyle(isBorder, valid)), onClick: toggle, children: [jsx("p", { className: "p-m pr-3xl h-14 overflow-hidden text-ellipsis whitespace-nowrap", children: formatOption(value) || placeholder }), jsx(Icon, { className: style('absolute right-3', isOpen ? '' : 'rotate-180'), name: "ArrowUpIcon", width: "16", height: "16" })] }), isSearch ? renderSearch(isOpen, searchValue, setSearchValue) : null, options?.length ? (jsx("div", { className: style('h-0', isOpen ? '' : 'overflow-hidden'), children: jsx("div", { className: "bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]", children: getFilteredOptions(options, searchValue).map(renderOption(handleChange, isOpen, isSelected)) }) })) : null] })] }));
|
|
808
877
|
});
|
|
878
|
+
const renderLabel = (label) => label ? (jsx("div", { className: "mb-xs", children: jsx(Text, { size: "text-m", color: "text-primary-text", font: "font-light", children: label }) })) : null;
|
|
879
|
+
const getFilteredOptions = (options, searchValue) => {
|
|
880
|
+
return searchValue
|
|
881
|
+
? options.filter((_) => jaroWinklerDistance(_.text?.toLowerCase())(searchValue.toLowerCase()) >= 0.6)
|
|
882
|
+
: options;
|
|
883
|
+
};
|
|
884
|
+
const renderSearch = (isOpen, searchValue, setSearchValue) => isOpen ? (jsx("div", { className: style('absolute top-0 w-full h-full z-20'), children: jsx(Input, { type: "text", autoFocus: true, value: searchValue, onChange: setSearchValue }) })) : null;
|
|
809
885
|
const renderOption = (handleChange, isOpen, isSelected) => (option, i) => (jsxs("div", { onClick: () => {
|
|
810
886
|
handleChange(option);
|
|
811
887
|
}, className: "flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative", children: [jsx("span", { className: "min-h-6", children: formatOption(option) }), jsx(Icon, { name: "DoneSimpleIcon", width: "16", height: "16", className: style('absolute right-4 pt-3xs', isSelected(option) && isOpen ? '' : 'hidden') })] }, String(i)));
|
|
@@ -867,7 +943,7 @@
|
|
|
867
943
|
|
|
868
944
|
const renderBusinessCardDataOrganization = (field) => (jsxs("div", { className: "sm:flex sm:justify-between sm:gap-lg", children: [jsxs("div", { className: "sm:w-1/2 space-y-s", children: [jsx(InputControl, { className: "shrink-0 w-full", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) })] }), jsxs("div", { className: "sm:w-1/2 space-y-s", children: [jsx(PhoneInputControl, { className: "shrink-0 w-full", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...withValidator(field('mail'), defaultValidator) })] })] }));
|
|
869
945
|
|
|
870
|
-
const renderRegion$1 = ({ regions, field }) => (jsx(SelectControl, { className: "w-full", label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }));
|
|
946
|
+
const renderRegion$1 = ({ regions, field }) => (jsx(SelectControl, { className: "w-full", label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", isSearch: true, options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }));
|
|
871
947
|
|
|
872
948
|
const initialFormState$3 = {
|
|
873
949
|
name: '',
|
|
@@ -919,7 +995,7 @@
|
|
|
919
995
|
const MAX_CREDIT_TERM = 180;
|
|
920
996
|
const ITEMS_CREDIT_TERM = ['От 1 мес', 'До 15 лет'];
|
|
921
997
|
|
|
922
|
-
const renderCreditDataOrganization = (field) => (jsxs("div", { className: "pb-2xs border-b border-b-main-divider sm:flex sm:justify-between sm:gap-lg sm:border-none sm:pb-0", children: [jsxs("div", { className: "sm:w-1/2 space-y-s", children: [jsx(InputControl, { className: "shrink-0 w-full", label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...field('fullName') }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) }), jsx(PhoneInputControl, { className: "shrink-0 w-full", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] }), jsxs("div", { className: "sm:w-1/2 space-y-s", children: [jsx(InputControl, { className: "shrink-0 w-full", label: "\u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0432\u044B\u0440\u0443\u0447\u043A\u0430, \u20BD", ...withValidator(field('annualRevenue'), defaultValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...field('mail') })] })] }));
|
|
998
|
+
const renderCreditDataOrganization = (field) => (jsxs("div", { className: "pb-2xs border-b border-b-main-divider sm:flex sm:justify-between sm:gap-lg sm:border-none sm:pb-0", children: [jsxs("div", { className: "sm:w-1/2 space-y-s", children: [jsx(InputControl, { className: "shrink-0 w-full", label: "\u041D\u0430\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", ...withValidator(field('fullName'), defaultValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u0418\u041D\u041D", ...withValidator(field('inn'), innValidator) }), jsx(PhoneInputControl, { className: "shrink-0 w-full", label: "\u0422\u0435\u043B\u0435\u0444\u043E\u043D", ...withValidator(field('phone'), phoneValidator) })] }), jsxs("div", { className: "sm:w-1/2 space-y-s", children: [jsx(InputControl, { className: "shrink-0 w-full", label: "\u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0432\u044B\u0440\u0443\u0447\u043A\u0430, \u20BD", ...withValidator(field('annualRevenue'), defaultValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u041A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0435 \u043B\u0438\u0446\u043E", ...withValidator(field('name'), nameValidator) }), jsx(InputControl, { className: "shrink-0 w-full", label: "\u042D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u0430\u044F \u043F\u043E\u0447\u0442\u0430", ...field('mail') })] })] }));
|
|
923
999
|
|
|
924
1000
|
const useNormalizedInput = (props, { normalize, format }) => {
|
|
925
1001
|
const { value, onFocus, onBlur, onChange } = props;
|
|
@@ -982,9 +1058,9 @@
|
|
|
982
1058
|
const closestValue = (list) => (_) => list.reduce((prev, curr) => (Math.abs(curr - _) < Math.abs(prev - _) ? curr : prev));
|
|
983
1059
|
const renderRangeCaption = (items) => (jsx("div", { className: "flex justify-between my-xs", children: items.map((item, i) => (jsx(Text, { size: "text-s", font: "font-light", color: "text-secondary-text", children: item }, String(i)))) }));
|
|
984
1060
|
|
|
985
|
-
const renderCreditParameters = (field) => (jsxs("div", { className: "border-b border-b-main-divider sm:flex sm:justify-between gap-lg sm:border-none", children: [jsxs("div", { className: "sm:w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m", font: "font-light", children: "\u0421\u0443\u043C\u043C\u0430
|
|
1061
|
+
const renderCreditParameters = (field) => (jsxs("div", { className: "border-b border-b-main-divider sm:flex sm:justify-between gap-lg sm:border-none", children: [jsxs("div", { className: "sm:w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m", font: "font-light", children: "\u0421\u0443\u043C\u043C\u0430, \u20BD" }) }), jsx(InputRange, { items: ITEMS_CREDIT_AMOUNT, min: MIN_CREDIT_AMOUNT, max: MAX_CREDIT_AMOUNT, ...field('amount') })] }), jsxs("div", { className: "sm:w-1/2", children: [jsx("label", { children: jsx(Text, { size: "text-m", font: "font-light", children: "\u0421\u0440\u043E\u043A, \u043C\u0435\u0441\u044F\u0446\u0435\u0432" }) }), jsx(InputRange, { items: ITEMS_CREDIT_TERM, min: MIN_CREDIT_TERM, max: MAX_CREDIT_TERM, ...field('term') })] })] }));
|
|
986
1062
|
|
|
987
|
-
const renderRegionDepartment = ({ regions, branches, field }) => (jsxs("div", { className: "sm:flex sm:justify-between sm:gap-m sm:mb-2xl sm:border-none sm:pb-0", children: [jsx("div", { className: "sm:w-1/2", children: jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }) }), jsx("div", { className: "sm:w-1/2", children: jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: branches.map(({ branchCode = '', address = '' }) => ({
|
|
1063
|
+
const renderRegionDepartment = ({ regions, branches, field }) => (jsxs("div", { className: "sm:flex sm:justify-between sm:gap-m sm:mb-2xl sm:border-none sm:pb-0", children: [jsx("div", { className: "sm:w-1/2", children: jsx(SelectControl, { label: "\u0420\u0435\u0433\u0438\u043E\u043D", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0433\u0438\u043E\u043D", isSearch: true, options: regions.map(({ code = '', name = '' }) => ({ key: code, text: name })), ...withValidator(field('region'), defaultValidator) }) }), jsx("div", { className: "sm:w-1/2", children: jsx(SelectControl, { label: "\u0410\u0434\u0440\u0435\u0441", placeholder: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441", options: branches.map(({ branchCode = '', address = '' }) => ({
|
|
988
1064
|
key: branchCode,
|
|
989
1065
|
text: address,
|
|
990
1066
|
})), ...withValidator(field('department'), defaultValidator) }) })] }));
|
|
@@ -1000,6 +1076,7 @@
|
|
|
1000
1076
|
annualRevenue: '',
|
|
1001
1077
|
};
|
|
1002
1078
|
const creditValidator = objectValidator({
|
|
1079
|
+
fullName: defaultValidator,
|
|
1003
1080
|
annualRevenue: defaultValidator,
|
|
1004
1081
|
inn: innValidator,
|
|
1005
1082
|
name: nameValidator,
|
|
@@ -1026,7 +1103,7 @@
|
|
|
1026
1103
|
const [formState, { field, ...formProps }] = useForm(initialFormState$2, handleSubmit);
|
|
1027
1104
|
const regions = useGetRegions();
|
|
1028
1105
|
const branches = useBranches(formState.region?.key).filter((branch) => branch?.address);
|
|
1029
|
-
return (jsxs("form", { className: "container space-y-m", onSubmit: formProps.onSubmit, children: [jsx(Heading, { headingType: "h6", title: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B
|
|
1106
|
+
return (jsxs("form", { className: "container space-y-m", onSubmit: formProps.onSubmit, children: [jsx(Heading, { headingType: "h6", title: "\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B", className: "sm:text-center" }), renderCreditParameters(field), jsx(Heading, { headingType: "h6", title: "\u0414\u0430\u043D\u043D\u044B\u0435 \u043E\u0440\u0433\u0430\u043D\u0438\u0437\u0430\u0446\u0438\u0438", className: "sm:text-center" }), renderCreditDataOrganization(field), jsx(Heading, { headingType: "h6", title: "\u041E\u0444\u0438\u0441 \u0431\u0430\u043D\u043A\u0430", className: "sm:text-center" }), renderRegionDepartment({ regions, branches, field }), renderSubmitButton(button), jsx(Footnote, { link: link })] }));
|
|
1030
1107
|
});
|
|
1031
1108
|
|
|
1032
1109
|
const initialFormState$1 = {
|
|
@@ -1277,7 +1354,7 @@
|
|
|
1277
1354
|
},
|
|
1278
1355
|
XS: {
|
|
1279
1356
|
title: { headingType: 'h5', as: 'h2' },
|
|
1280
|
-
descriptionSize: 'text-
|
|
1357
|
+
descriptionSize: 'text-m',
|
|
1281
1358
|
descriptionWeight: 'font-light',
|
|
1282
1359
|
descriptionStyle: 'mt-xs',
|
|
1283
1360
|
},
|
|
@@ -1357,7 +1434,15 @@
|
|
|
1357
1434
|
|
|
1358
1435
|
const BusinessBlock = JSX(({ className, title, cards, ...rest }) => (jsxs(BlockWrapper, { className: className, defaultPadding: "p-6xl space-y-3xl", ...rest, children: [jsx(Heading, { headingType: "h3", title: title, className: "text-center" }), jsx("div", { className: "flex gap-lg", children: cards?.length ? cards.map((_, i) => jsx(BusinessCard, { ..._ }, String(i))) : null })] })));
|
|
1359
1436
|
|
|
1360
|
-
const
|
|
1437
|
+
const alignStyleMap = {
|
|
1438
|
+
start: 'justify-start',
|
|
1439
|
+
center: 'justify-center',
|
|
1440
|
+
end: 'justify-end',
|
|
1441
|
+
};
|
|
1442
|
+
const ButtonsBlock = JSX(({ buttons, className = '', align, ...rest }) => {
|
|
1443
|
+
const alignStyle = align ? style('flex', alignStyleMap[align]) : '';
|
|
1444
|
+
return (jsx(BlockWrapper, { className: style('!bg-transparent', alignStyle, className), defaultPadding: "p-0", ...rest, children: renderButtonsSection(buttons) }));
|
|
1445
|
+
});
|
|
1361
1446
|
|
|
1362
1447
|
const useCarouselControls = (props, initialIndex = 0) => {
|
|
1363
1448
|
const { itemCount, visibleItemCount } = props;
|
|
@@ -2416,13 +2501,21 @@
|
|
|
2416
2501
|
const renderCardHighlight = ({ className, text = 'ХИТ' } = {}) => (jsxs("div", { className: style('w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-[0_4px_25px_rgba(0,0,0,0.07)]', className), children: [jsx(Icon, { iconVersion: "black", name: "HeartIcon", width: "24", height: "24" }), jsx(Paragraph, { size: "text-s", font: "font-normal", align: "text-center", color: "text-primary-text", children: text })] }));
|
|
2417
2502
|
|
|
2418
2503
|
const cardBaseStyle = 'relative h-full';
|
|
2419
|
-
const
|
|
2504
|
+
const CARD_SIZE_MAP = {
|
|
2505
|
+
normal: 'sm:min-w-96',
|
|
2506
|
+
big: 'sm:min-w-[515px]',
|
|
2507
|
+
};
|
|
2508
|
+
const renderCarouselCards = ({ noCardBorder, activeIndex, cardSize = 'normal', ...rest }) => {
|
|
2420
2509
|
const { blocks: childBlocks } = rest.block || {};
|
|
2421
2510
|
const someCardsHighlighted = childBlocks?.some(isCardHighlighted);
|
|
2422
2511
|
return renderChildren({
|
|
2423
2512
|
...rest,
|
|
2424
2513
|
renderProps: (block, options, blockIndex) => (jsxs("div", { className: cardWrapperStyle(block, { someCardsHighlighted }), children: [renderBlock$1(block, options, {
|
|
2425
|
-
className: cardStyle(block, {
|
|
2514
|
+
className: cardStyle(block, {
|
|
2515
|
+
someCardsHighlighted,
|
|
2516
|
+
showBorder: !noCardBorder,
|
|
2517
|
+
cardSize,
|
|
2518
|
+
}),
|
|
2426
2519
|
blockIndex,
|
|
2427
2520
|
isActive: blockIndex === activeIndex,
|
|
2428
2521
|
}), isCardHighlighted(block)
|
|
@@ -2431,11 +2524,12 @@
|
|
|
2431
2524
|
});
|
|
2432
2525
|
};
|
|
2433
2526
|
const cardWrapperStyle = (_, { someCardsHighlighted }) => style(cardBaseStyle, someCardsHighlighted && (isCardHighlighted(_) ? 'pt-3xl' : 'pt-3xl sm:pt-16'));
|
|
2434
|
-
const cardStyle = (_, { someCardsHighlighted, showBorder }) => style(cardBaseStyle, 'min-w-80
|
|
2527
|
+
const cardStyle = (_, { someCardsHighlighted, showBorder, cardSize = 'normal', }) => style(cardBaseStyle, 'min-w-80', CARD_SIZE_MAP[cardSize], // TODO fix для RecommendationCard
|
|
2528
|
+
someCardsHighlighted && (isCardHighlighted(_) ? 'pt-3xl sm:pt-16' : 'pt-3xl'), showBorder &&
|
|
2435
2529
|
'border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider');
|
|
2436
2530
|
const isCardHighlighted = (_) => _?.content && 'isHighlighting' in _.content && _.content.isHighlighting;
|
|
2437
2531
|
|
|
2438
|
-
const Carousel = JSX(({ className, itemCount, visibleItemCount = 0, noCardBorder, isAlignCenter, showDots, arrowsPadded = true, isGap = true, ...rest }) => {
|
|
2532
|
+
const Carousel = JSX(({ className, itemCount, visibleItemCount = 0, noCardBorder, isAlignCenter, showDots, arrowsPadded = true, isGap = true, cardSize = 'normal', ...rest }) => {
|
|
2439
2533
|
const { blocks: childBlocks = [] } = rest.block || {};
|
|
2440
2534
|
const count = itemCount || childBlocks?.length;
|
|
2441
2535
|
const [activeIndex, { inc: increaseActiveIndex, dec: decreaseActiveIndex }] = useCarouselControls({
|
|
@@ -2446,7 +2540,7 @@
|
|
|
2446
2540
|
const [dotsActiveIndex] = scroll.visibleIndicesRange;
|
|
2447
2541
|
// TODO Remove
|
|
2448
2542
|
const isBankHistoryCarousel = childBlocks && childBlocks[0]?.type === 'CarouselBankHistoryCard';
|
|
2449
|
-
return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: style(isAlignCenter ? 'flex justify-center' : '', 'relative max-w-full'), children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: isGap ? ITEMS_GAP : undefined, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderCarouselCards({ noCardBorder, activeIndex, ...rest }) }), jsx(CarouselScrollButtons, { scroll: scroll, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: dotsActiveIndex, dotCount: count, listType: "horizontal-list" })) : null] }) }));
|
|
2543
|
+
return (jsx(BlockWrapper, { className: className, defaultPadding: "p-6xl", ...rest, children: jsxs("div", { className: style(isAlignCenter ? 'flex justify-center' : '', 'relative max-w-full'), children: [jsx(SwipeListContainer, { containerRef: containerRef, visibleItemCount: visibleItemCount, snapAlign: "snap-start", gap: isGap ? ITEMS_GAP : undefined, onVisibleIndicesChange: scroll.handleVisibleIndicesChange, children: renderCarouselCards({ noCardBorder, activeIndex, cardSize, ...rest }) }), jsx(CarouselScrollButtons, { scroll: scroll, arrowsPadded: arrowsPadded, onScrollLeft: decreaseActiveIndex, onScrollRight: increaseActiveIndex, hasEdgeBlocks: isBankHistoryCarousel, activeIndex: activeIndex, itemCount: count }), showDots ? (jsx(SwipeListControlDots, { containerRef: containerRef, activeIndex: dotsActiveIndex, dotCount: count, listType: "horizontal-list" })) : null] }) }));
|
|
2450
2544
|
});
|
|
2451
2545
|
Carousel.childrenTypes = [
|
|
2452
2546
|
'CarouselCard',
|
|
@@ -2511,7 +2605,7 @@
|
|
|
2511
2605
|
const BaseTile = JSX(({ className, defaultPadding, padding, title = '', insetTitle = '', buttons, leftImage, rightImage, imageAlign, backImage, children, }) => (jsxs("div", { className: style('relative flex flex-col gap-3xl font-sans overflow-hidden', padding || defaultPadding, className), children: [title ? jsx("div", { className: "relative", children: title }) : null, jsxs("div", { className: "grow relative flex flex-wrap @xl:flex-nowrap justify-around @xl:justify-between items-stretch gap-3xl", children: [renderImageContainer(leftImage, { imageAlign }), jsxs("div", { className: style('flex flex-col gap-3xl max-w-[600px] @xl:max-w-[728px]', leftImage ? '' : 'grow'), children: [insetTitle, jsx("div", { className: "grow", children: children }), backImage ? (jsx("div", { className: "mx-auto sm:absolute sm:-z-10 sm:-bottom-4 sm:-right-4", children: backImage })) : null, buttons] }), renderImageContainer(rightImage, { className: '-order-1 @xl:order-1', imageAlign })] })] })));
|
|
2512
2606
|
const renderImageContainer = (image, { className, imageAlign }) => {
|
|
2513
2607
|
//TODO Спорное решение
|
|
2514
|
-
const fullWidth = image?.props?.image
|
|
2608
|
+
const fullWidth = image?.props?.image?.size?.width > 400;
|
|
2515
2609
|
return image ? (jsx("div", { className: style('flex-shrink-0', fullWidth ? 'w-full @xl:w-auto' : '', imageAlign && imageAlignmentMap[imageAlign], className), children: image })) : null;
|
|
2516
2610
|
};
|
|
2517
2611
|
|
|
@@ -2535,7 +2629,7 @@
|
|
|
2535
2629
|
const CarouselLinks = JSX(({ className, additionalDescription, description, links, title, maxLinksCount = 10, ...rest }) => (jsxs(BlockWrapper, { className: style('flex flex-col sm:flex-row w-full overflow-hidden', className), ...rest, children: [jsxs("div", { className: "mr-xl flex-auto", children: [jsx(Headline, { isEmbedded: true, title: title, description: description, as: "h1", align: "text-left" }), additionalDescription ? (jsx(Headline, { className: "pt-m", description: additionalDescription, align: "text-left", isEmbedded: true })) : null] }), links?.length ? renderLinks(links, maxLinksCount) : null] })));
|
|
2536
2630
|
const renderLinks = (links, maxLinksCount) => {
|
|
2537
2631
|
const itemCount = Math.ceil(links.length / maxLinksCount);
|
|
2538
|
-
return (jsx(Carousel, { className: "sm:w-2/3 w-full p-0 sm:p-xs", version: "secondary", itemCount: itemCount, arrowsPadded: false, showDots: false, children: new Array(itemCount).fill(null).map((_, groupIndex) => (jsx("div", { className: style('flex flex-wrap self-start w-full sm:w-[672px]'), children: links
|
|
2632
|
+
return (jsx(Carousel, { className: "@container-normal sm:w-2/3 w-full p-0 sm:p-xs", version: "secondary", itemCount: itemCount, arrowsPadded: false, showDots: false, children: new Array(itemCount).fill(null).map((_, groupIndex) => (jsx("div", { className: style('flex flex-wrap self-start w-full sm:w-[672px]'), children: links
|
|
2539
2633
|
.slice(groupIndex * maxLinksCount, (groupIndex + 1) * maxLinksCount)
|
|
2540
2634
|
.map((link, index) => (jsx(CarouselLinkButton, { className: "sm:m-2xs", ...link }, String(index)))) }, String(groupIndex)))) }));
|
|
2541
2635
|
};
|
|
@@ -2544,15 +2638,18 @@
|
|
|
2544
2638
|
L: 'w-1.5 h-1.5 mr-m',
|
|
2545
2639
|
M: 'w-1.5 h-1.5 mr-s',
|
|
2546
2640
|
S: 'w-1 h-1 mr-xs',
|
|
2641
|
+
XS: 'w-1 h-1 mr-xs',
|
|
2547
2642
|
};
|
|
2548
2643
|
const ListItem = JSX(({ className, isDotted = true, children, size = 'M' }) => (jsxs("div", { className: style('font-sans flex', className), role: "listitem", children: [isDotted ? (jsx("div", { className: "shrink-0", children: jsx("div", { className: style('align-middle inline-block rounded-full bg-primary-text group-data-secondary:bg-white', DOT_SIZE_MAP[size]) }) })) : null, jsx("span", { children: children })] })));
|
|
2549
2644
|
|
|
2550
2645
|
const TEXT_SIZE_MAP = {
|
|
2646
|
+
XS: 'text-m font-light',
|
|
2551
2647
|
S: 'text-l font-light',
|
|
2552
2648
|
M: 'text-h6',
|
|
2553
2649
|
L: 'text-h5',
|
|
2554
2650
|
};
|
|
2555
2651
|
const ITEM_INDENT_MAP = {
|
|
2652
|
+
XS: 'ml-2xs',
|
|
2556
2653
|
S: 'ml-xs',
|
|
2557
2654
|
M: 'ml-s',
|
|
2558
2655
|
L: 'ml-m',
|
|
@@ -3194,70 +3291,6 @@
|
|
|
3194
3291
|
return firstCol.map((firstEl, rowIndex) => [firstEl, ...restCols.map((col) => col[rowIndex])]);
|
|
3195
3292
|
}
|
|
3196
3293
|
|
|
3197
|
-
const JARO_WINKLER_P = 0.1;
|
|
3198
|
-
const JARO_WINKLER_MAX_L = 4;
|
|
3199
|
-
const jaroWinklerDistance = (s1) => (s2) => {
|
|
3200
|
-
if (s1 === s2) {
|
|
3201
|
-
return 1;
|
|
3202
|
-
}
|
|
3203
|
-
if (!s1 || !s2) {
|
|
3204
|
-
return 0;
|
|
3205
|
-
}
|
|
3206
|
-
const { m, s1Matches, s2Matches } = computeM(s1, s2);
|
|
3207
|
-
if (m === 0) {
|
|
3208
|
-
return 0;
|
|
3209
|
-
}
|
|
3210
|
-
const t = computeT(s1, s2, { s1Matches, s2Matches });
|
|
3211
|
-
const jaroWeight = (m / s1.length + m / s2.length + (m - t / 2) / m) / 3;
|
|
3212
|
-
const winklerWeight = jaroWeight > 0.7 ? computePrefixL(s1, s2) * JARO_WINKLER_P : 0;
|
|
3213
|
-
return jaroWeight + winklerWeight * (1 - jaroWeight);
|
|
3214
|
-
};
|
|
3215
|
-
function computeM(s1, s2) {
|
|
3216
|
-
const range = Math.max(0, Math.floor(Math.max(s1.length, s2.length) / 2) - 1);
|
|
3217
|
-
const s1Matches = new Array(s1.length);
|
|
3218
|
-
const s2Matches = new Array(s2.length);
|
|
3219
|
-
let m = 0;
|
|
3220
|
-
for (let i = 0; i < s1.length; i++) {
|
|
3221
|
-
const low = Math.max(0, i - range);
|
|
3222
|
-
const high = Math.min(i + range, s2.length - 1);
|
|
3223
|
-
for (let j = low; j <= high; j++) {
|
|
3224
|
-
if (s1Matches[i] || s2Matches[j] || s1[i] !== s2[j]) {
|
|
3225
|
-
continue;
|
|
3226
|
-
}
|
|
3227
|
-
m++;
|
|
3228
|
-
s1Matches[i] = true;
|
|
3229
|
-
s2Matches[j] = true;
|
|
3230
|
-
}
|
|
3231
|
-
}
|
|
3232
|
-
return { m, s1Matches, s2Matches };
|
|
3233
|
-
}
|
|
3234
|
-
function computeT(s1, s2, { s1Matches, s2Matches }) {
|
|
3235
|
-
let t = 0;
|
|
3236
|
-
for (let i = 0, k = 0; i < s1.length; i++) {
|
|
3237
|
-
if (!s1Matches[i]) {
|
|
3238
|
-
continue;
|
|
3239
|
-
}
|
|
3240
|
-
let j = k;
|
|
3241
|
-
for (; j < s2.length; j++) {
|
|
3242
|
-
if (s2Matches[j]) {
|
|
3243
|
-
k = j + 1;
|
|
3244
|
-
break;
|
|
3245
|
-
}
|
|
3246
|
-
}
|
|
3247
|
-
if (s1[i] !== s2[j]) {
|
|
3248
|
-
t++;
|
|
3249
|
-
}
|
|
3250
|
-
}
|
|
3251
|
-
return t;
|
|
3252
|
-
}
|
|
3253
|
-
function computePrefixL(s1, s2) {
|
|
3254
|
-
let prefixL = 0;
|
|
3255
|
-
while (s1[prefixL] === s2[prefixL] && prefixL < JARO_WINKLER_MAX_L) {
|
|
3256
|
-
prefixL++;
|
|
3257
|
-
}
|
|
3258
|
-
return prefixL;
|
|
3259
|
-
}
|
|
3260
|
-
|
|
3261
3294
|
const joinMaps = (aggregate, emptyVal) => (acc, map) => {
|
|
3262
3295
|
for (const [key, b] of map) {
|
|
3263
3296
|
acc.set(key, aggregate(acc.get(key) || emptyVal, b));
|
|
@@ -3598,15 +3631,6 @@
|
|
|
3598
3631
|
return (jsxs("div", { className: style('flex items-center gap-lg', className), children: [jsx(TopItem, { flat: true, href: "#", text: currentLocation?.name, onClick: openLocationDialog }), officesLink ? jsx(TopItem, { flat: true, href: officesLink, text: "\u041E\u0444\u0438\u0441\u044B \u0438 \u0431\u0430\u043D\u043A\u043E\u043C\u0430\u0442\u044B" }) : null, jsx(HeaderSecondaryMenuButton, { image: { icon: 'LoupeIcon', iconVersion }, ariaLabel: "\u041F\u043E\u0438\u0441\u043A", onClick: openSearchDialog })] }));
|
|
3599
3632
|
});
|
|
3600
3633
|
|
|
3601
|
-
const isHrefActive = (router) => ({ href }) => withoutQuery(isURL(href) ? router.href : router.pathname).startsWith(withoutQuery(href));
|
|
3602
|
-
|
|
3603
|
-
const findActiveSubItem = (router) => (items = []) => {
|
|
3604
|
-
const possibleActiveSubItems = items?.filter(isHrefActive(router));
|
|
3605
|
-
return possibleActiveSubItems?.length
|
|
3606
|
-
? maxBy((_) => _.href?.length || 0)(possibleActiveSubItems) // More specific item with max length
|
|
3607
|
-
: undefined;
|
|
3608
|
-
};
|
|
3609
|
-
|
|
3610
3634
|
const DropdownMenu = JSX(({ className = '', items, activeItem }) => {
|
|
3611
3635
|
const link = useLink();
|
|
3612
3636
|
const [visible, setVisible] = useState(false);
|
|
@@ -3621,26 +3645,6 @@
|
|
|
3621
3645
|
}) })] }));
|
|
3622
3646
|
});
|
|
3623
3647
|
|
|
3624
|
-
const HeaderItem = JSX(({ className = '', active, dataItemName, children, ...rest }) => {
|
|
3625
|
-
const link = useLink();
|
|
3626
|
-
const { href, target, text, onClick } = link(rest);
|
|
3627
|
-
return (jsxs("a", { className: style('relative inline-block bg-transparent text-center no-underline', className), href: href, target: target, "data-item-name": dataItemName, onClick: onClick, children: [jsx("span", { className: getTextStyle(active), children: text || children }), active ? (jsx("div", { className: "absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent" })) : null] }));
|
|
3628
|
-
});
|
|
3629
|
-
const getTextStyle = (active = false) => style('font-sans text-l font-light', active ? 'text-primary-main' : 'text-primary-text hover:text-primary-main', 'group-data-transparent:text-white group-data-transparent:hover:text-primary-hover');
|
|
3630
|
-
|
|
3631
|
-
const HeaderSubMenuItem = JSX(({ observerOptions, onVisibilityChange, children, className, ...rest }) => {
|
|
3632
|
-
const observerCallback = useCallback((entries) => {
|
|
3633
|
-
if (!entries.length || !onVisibilityChange) {
|
|
3634
|
-
return;
|
|
3635
|
-
}
|
|
3636
|
-
// Assumption about entries order (by time)
|
|
3637
|
-
const entry = entries[entries.length - 1];
|
|
3638
|
-
onVisibilityChange(entry.isIntersecting);
|
|
3639
|
-
}, [onVisibilityChange]);
|
|
3640
|
-
const ref = useIntersectionObserver(observerCallback, observerOptions);
|
|
3641
|
-
return (jsx("span", { ref: ref, className: className, children: jsx(HeaderItem, { ...rest, children: children }) }));
|
|
3642
|
-
});
|
|
3643
|
-
|
|
3644
3648
|
const getNS = (_) => globalThis[_];
|
|
3645
3649
|
function useExternalNS(namespaceName, url) {
|
|
3646
3650
|
const [externalNS, setExternalNS] = useState();
|
|
@@ -3696,12 +3700,41 @@
|
|
|
3696
3700
|
});
|
|
3697
3701
|
const renderChatBotButton = ({ className, iconVersion, onClick }) => (jsx(HeaderSecondaryMenuButton, { className: style(CHAT_BUTTON_EXTERNAL_NAME, className), image: { icon: 'HeadphonesIcon', iconVersion }, ariaLabel: "\u0427\u0430\u0442", onClick: onClick, buttonSize: "large", isGrayBg: true }));
|
|
3698
3702
|
|
|
3703
|
+
const HeaderItem = JSX(({ className = '', active, dataItemName, children, ...rest }) => {
|
|
3704
|
+
const link = useLink();
|
|
3705
|
+
const { href, target, text, onClick } = link(rest);
|
|
3706
|
+
return (jsxs("a", { className: style('relative inline-block bg-transparent text-center no-underline', className), href: href, target: target, "data-item-name": dataItemName, onClick: onClick, children: [jsx("span", { className: getTextStyle(active), children: text || children }), active ? (jsx("div", { className: "absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent" })) : null] }));
|
|
3707
|
+
});
|
|
3708
|
+
const getTextStyle = (active = false) => style('font-sans text-l font-light', active ? 'text-primary-main' : 'text-primary-text hover:text-primary-main', 'group-data-transparent:text-white group-data-transparent:hover:text-primary-hover');
|
|
3709
|
+
|
|
3710
|
+
const HeaderSubMenuItem = JSX(({ observerOptions, onVisibilityChange, children, className, ...rest }) => {
|
|
3711
|
+
const observerCallback = useCallback((entries) => {
|
|
3712
|
+
if (!entries.length || !onVisibilityChange) {
|
|
3713
|
+
return;
|
|
3714
|
+
}
|
|
3715
|
+
// Assumption about entries order (by time)
|
|
3716
|
+
const entry = entries[entries.length - 1];
|
|
3717
|
+
onVisibilityChange(entry.isIntersecting);
|
|
3718
|
+
}, [onVisibilityChange]);
|
|
3719
|
+
const ref = useIntersectionObserver(observerCallback, observerOptions);
|
|
3720
|
+
return (jsx("span", { ref: ref, className: className, children: jsx(HeaderItem, { ...rest, children: children }) }));
|
|
3721
|
+
});
|
|
3722
|
+
|
|
3699
3723
|
const BUTTON_STYLE = {
|
|
3700
3724
|
default: 'px-lg bg-main-divider rounded hover:text-primary-main',
|
|
3701
3725
|
transparent: 'text-white hover:text-primary-hover',
|
|
3702
3726
|
};
|
|
3703
3727
|
const InternetBankButton = JSX(({ version, internetBankUrl }) => internetBankUrl ? (jsx(Button, { href: internetBankUrl, ariaLabel: "\u0418\u043D\u0442\u0435\u0440\u043D\u0435\u0442-\u0431\u0430\u043D\u043A", target: "_blank", className: style('py-s ml-s text-l font-light whitespace-nowrap hover:text-primary-main', BUTTON_STYLE[version === 'transparent' ? 'transparent' : 'default']), children: "\u0418\u043D\u0442\u0435\u0440\u043D\u0435\u0442-\u0431\u0430\u043D\u043A" })) : null);
|
|
3704
3728
|
|
|
3729
|
+
const isHrefActive = (router) => ({ href }) => withoutQuery(isURL(href) ? router.href : router.pathname).startsWith(withoutQuery(href));
|
|
3730
|
+
|
|
3731
|
+
const findActiveSubItem = (router) => (items = []) => {
|
|
3732
|
+
const possibleActiveSubItems = items?.filter(isHrefActive(router));
|
|
3733
|
+
return possibleActiveSubItems?.length
|
|
3734
|
+
? maxBy((_) => _.href?.length || 0)(possibleActiveSubItems) // More specific item with max length
|
|
3735
|
+
: undefined;
|
|
3736
|
+
};
|
|
3737
|
+
|
|
3705
3738
|
const HeaderSubMenu = JSX(({ subItems = [], version, internetBankUrl }) => {
|
|
3706
3739
|
const iconVersion = version === 'transparent' ? 'white' : 'black';
|
|
3707
3740
|
const router = useRouter();
|
|
@@ -3715,7 +3748,7 @@
|
|
|
3715
3748
|
? handleIntersectionActivation(index)
|
|
3716
3749
|
: handleIntersectionDeactivation(index));
|
|
3717
3750
|
}), [subItems]);
|
|
3718
|
-
return (jsxs("nav", { className: "relative mt-s flex items-center justify-between", children: [jsx("div", { ref: subItemsListRef, className: "overflow-hidden whitespace-nowrap pb-s mt-xs space-x-3xl", children: subItems.map((_, i) => (jsx(HeaderSubMenuItem, { className: visibleItemsCount - 1 < i ? 'invisible' : '', active: _ === activeSubItem, observerOptions: observerOptions, onVisibilityChange: subItemsVisibilityHandlers[i], ..._ }, String(i)))) }), dropDownMenuItems.length ? (jsx(DropdownMenu, { className: "relative w-auto z-40", items: dropDownMenuItems, activeItem: activeSubItem })) : null, projectSettings.CHAT_BOT ? (jsx(HeaderChatBotButton, { className: "ml-4xl", iconVersion: iconVersion, chat: projectSettings.CHAT_BOT })) : null, jsx(InternetBankButton, { version: version, internetBankUrl: internetBankUrl })] }));
|
|
3751
|
+
return (jsxs("nav", { className: "relative mt-s flex items-center justify-between", children: [jsx("div", { ref: subItemsListRef, className: "overflow-hidden whitespace-nowrap pb-s mt-xs space-x-3xl", children: subItems.map((_, i) => (jsx(HeaderSubMenuItem, { className: visibleItemsCount - 1 < i ? 'invisible' : '', active: _ === activeSubItem, observerOptions: observerOptions, onVisibilityChange: subItemsVisibilityHandlers[i], ..._ }, String(i)))) }), dropDownMenuItems.length ? (jsx(DropdownMenu, { className: "relative w-auto z-40", items: dropDownMenuItems, activeItem: activeSubItem })) : null, jsxs("div", { className: "flex", children: [projectSettings.CHAT_BOT ? (jsx(HeaderChatBotButton, { className: "ml-4xl", iconVersion: iconVersion, chat: projectSettings.CHAT_BOT })) : null, jsx(InternetBankButton, { version: version, internetBankUrl: internetBankUrl })] })] }));
|
|
3719
3752
|
});
|
|
3720
3753
|
const handleIntersectionActivation = (index) => (prev) => Math.max(prev, index + 1);
|
|
3721
3754
|
const handleIntersectionDeactivation = (index) => (prev) => Math.min(prev, index);
|
|
@@ -5079,19 +5112,16 @@
|
|
|
5079
5112
|
throw new Error(x);
|
|
5080
5113
|
}
|
|
5081
5114
|
|
|
5082
|
-
const
|
|
5115
|
+
const useDialogsList = ({ onCloseAll, onClose, } = {}) => {
|
|
5083
5116
|
const [dialogs, { push, pop, clear }] = useList();
|
|
5084
5117
|
const closeAll = useCallback(() => {
|
|
5085
|
-
|
|
5086
|
-
_.onClose && _.onClose();
|
|
5087
|
-
}
|
|
5118
|
+
onCloseAll && onCloseAll(dialogs);
|
|
5088
5119
|
clear();
|
|
5089
|
-
}, [dialogs]);
|
|
5120
|
+
}, [dialogs, onCloseAll]);
|
|
5090
5121
|
const close = useCallback(() => {
|
|
5091
|
-
|
|
5092
|
-
_?.onClose && _.onClose();
|
|
5122
|
+
onClose && onClose(dialogs[dialogs.length - 1]);
|
|
5093
5123
|
pop();
|
|
5094
|
-
}, [dialogs]);
|
|
5124
|
+
}, [dialogs, onClose]);
|
|
5095
5125
|
useEffect(() => defaultEventBus.subscribe('dialog', (action) => {
|
|
5096
5126
|
switch (action.type) {
|
|
5097
5127
|
case 'open':
|
|
@@ -5109,6 +5139,20 @@
|
|
|
5109
5139
|
assertUnreachable(action);
|
|
5110
5140
|
}
|
|
5111
5141
|
}), [closeAll, close]);
|
|
5142
|
+
return dialogs;
|
|
5143
|
+
};
|
|
5144
|
+
|
|
5145
|
+
const DialogManager = JSX(() => {
|
|
5146
|
+
const handleCloseAll = useCallback((dialogs) => {
|
|
5147
|
+
for (const _ of dialogs) {
|
|
5148
|
+
_?.onClose && _.onClose();
|
|
5149
|
+
}
|
|
5150
|
+
}, []);
|
|
5151
|
+
const handleClose = useCallback((_) => {
|
|
5152
|
+
_?.onClose && _.onClose();
|
|
5153
|
+
}, []);
|
|
5154
|
+
const dialogs = useDialogsList({ onCloseAll: handleCloseAll, onClose: handleClose });
|
|
5155
|
+
const { close } = useDialogManager();
|
|
5112
5156
|
useEffect(() => {
|
|
5113
5157
|
const handleEscape = ({ key }) => {
|
|
5114
5158
|
if (key === 'Escape') {
|
|
@@ -5190,7 +5234,7 @@
|
|
|
5190
5234
|
return (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-3xl sticky bottom-0 pointer-events-auto" }) }));
|
|
5191
5235
|
}
|
|
5192
5236
|
|
|
5193
|
-
const packageVersion = "0.13.
|
|
5237
|
+
const packageVersion = "0.13.6";
|
|
5194
5238
|
|
|
5195
5239
|
exports.Blocks = Blocks;
|
|
5196
5240
|
exports.ContentPage = ContentPage;
|