@sima-land/moleculas 16.0.0-alpha.2 → 16.0.0-alpha.21
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/README.md +23 -0
- package/common/components/badge/badge.d.ts +8 -0
- package/common/components/badge/badge.js +55 -0
- package/common/components/badge/badge.js.map +1 -0
- package/common/components/badge/badge.m.scss +81 -0
- package/common/components/badge/index.d.ts +2 -19
- package/common/components/badge/index.js +3 -80
- package/common/components/badge/index.js.map +1 -0
- package/common/components/badge/types.d.ts +26 -0
- package/common/components/{intractive-image → badge}/types.js +1 -0
- package/common/components/badge/types.js.map +1 -0
- package/common/components/badge-list/badge-list.d.ts +29 -0
- package/common/components/badge-list/badge-list.js +38 -0
- package/common/components/badge-list/badge-list.js.map +1 -0
- package/common/components/badge-list/index.d.ts +1 -29
- package/common/components/badge-list/index.js +3 -56
- package/common/components/badge-list/index.js.map +1 -0
- package/common/components/breadcrumbs/breadcrumbs.d.ts +46 -0
- package/common/components/breadcrumbs/breadcrumbs.js +83 -0
- package/common/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/common/components/breadcrumbs/breadcrumbs.m.scss +113 -0
- package/common/components/breadcrumbs/index.d.ts +2 -0
- package/common/components/breadcrumbs/index.js +7 -0
- package/common/components/breadcrumbs/index.js.map +1 -0
- package/common/components/breadcrumbs/types.d.ts +8 -0
- package/common/{types.js → components/breadcrumbs/types.js} +1 -0
- package/common/components/breadcrumbs/types.js.map +1 -0
- package/common/components/img-stub/img-stub.d.ts +14 -0
- package/common/components/img-stub/img-stub.js +21 -0
- package/common/components/img-stub/img-stub.js.map +1 -0
- package/common/components/img-stub/img-stub.m.scss +36 -0
- package/common/components/img-stub/index.d.ts +1 -0
- package/common/components/img-stub/index.js +6 -0
- package/common/components/img-stub/index.js.map +1 -0
- package/common/components/{intractive-image → interactive-image}/index.js +1 -0
- package/common/components/interactive-image/index.js.map +1 -0
- package/common/components/interactive-image/interactive-image.d.ts +15 -0
- package/common/components/interactive-image/interactive-image.js +56 -0
- package/common/components/interactive-image/interactive-image.js.map +1 -0
- package/common/components/{intractive-image → interactive-image}/types.d.ts +4 -4
- package/common/components/interactive-image/types.js +3 -0
- package/common/components/interactive-image/types.js.map +1 -0
- package/common/components/media-gallery/index.d.ts +2 -0
- package/common/components/media-gallery/index.js +7 -0
- package/common/components/media-gallery/index.js.map +1 -0
- package/common/components/media-gallery/media-gallery.d.ts +16 -0
- package/common/components/media-gallery/media-gallery.js +90 -0
- package/common/components/media-gallery/media-gallery.js.map +1 -0
- package/common/components/media-gallery/media-gallery.m.scss +35 -0
- package/common/components/media-gallery/types.d.ts +12 -0
- package/common/components/media-gallery/types.js +3 -0
- package/common/components/media-gallery/types.js.map +1 -0
- package/common/components/media-gallery/utils.d.ts +38 -0
- package/common/components/media-gallery/utils.js +102 -0
- package/common/components/media-gallery/utils.js.map +1 -0
- package/common/components/media-modal/__mocks__/images/armchair.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/cup.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/plant.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/stump.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/table.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/vase.jpg +0 -0
- package/common/components/media-modal/__mocks__/index.d.ts +3 -0
- package/common/components/media-modal/__mocks__/index.js +251 -0
- package/common/components/media-modal/__mocks__/index.js.map +1 -0
- package/common/components/media-modal/__mocks__/thumbnails/armchair.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/cup.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/plant.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/stump.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/table.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/vase.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/video3404953.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/video3619217.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/video4093038.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/video6907296.jpg +0 -0
- package/common/components/media-modal/index.d.ts +11 -0
- package/common/components/media-modal/index.js +29 -0
- package/common/components/media-modal/index.js.map +1 -0
- package/common/components/media-modal/layout.d.ts +36 -0
- package/common/components/media-modal/layout.js +81 -0
- package/common/components/media-modal/layout.js.map +1 -0
- package/common/components/media-modal/layout.m.scss +78 -0
- package/common/components/media-modal/parts/all-round-view.d.ts +7 -0
- package/common/components/media-modal/parts/all-round-view.js +42 -0
- package/common/components/media-modal/parts/all-round-view.js.map +1 -0
- package/common/components/media-modal/parts/all-round-view.m.scss +30 -0
- package/common/components/media-modal/parts/index.d.ts +36 -0
- package/common/components/media-modal/parts/index.js +65 -0
- package/common/components/media-modal/parts/index.js.map +1 -0
- package/common/components/media-modal/parts/media-area.d.ts +25 -0
- package/common/components/media-modal/parts/media-area.js +61 -0
- package/common/components/media-modal/parts/media-area.js.map +1 -0
- package/common/components/media-modal/parts/media-area.m.scss +21 -0
- package/common/components/media-modal/parts/media-view.d.ts +20 -0
- package/common/components/media-modal/parts/media-view.js +46 -0
- package/common/components/media-modal/parts/media-view.js.map +1 -0
- package/common/components/media-modal/parts/media-view.m.scss +34 -0
- package/common/components/media-modal/parts/parts.m.scss +21 -0
- package/common/components/media-modal/parts/product-brief.d.ts +20 -0
- package/common/components/media-modal/parts/product-brief.js +40 -0
- package/common/components/media-modal/parts/product-brief.js.map +1 -0
- package/common/components/media-modal/parts/product-brief.m.scss +149 -0
- package/common/components/media-modal/parts/review.d.ts +15 -0
- package/common/components/media-modal/parts/review.js +32 -0
- package/common/components/media-modal/parts/review.js.map +1 -0
- package/common/components/media-modal/parts/review.m.scss +86 -0
- package/common/components/media-modal/parts/scroll-section.d.ts +11 -0
- package/common/components/media-modal/parts/scroll-section.js +20 -0
- package/common/components/media-modal/parts/scroll-section.js.map +1 -0
- package/common/components/media-modal/parts/scroll-section.m.scss +32 -0
- package/common/components/media-modal/parts/thumbnail.d.ts +22 -0
- package/common/components/media-modal/parts/thumbnail.js +36 -0
- package/common/components/media-modal/parts/thumbnail.js.map +1 -0
- package/common/components/media-modal/parts/thumbnail.m.scss +156 -0
- package/common/components/media-modal/parts/thumbnails.d.ts +13 -0
- package/common/components/media-modal/parts/thumbnails.js +60 -0
- package/common/components/media-modal/parts/thumbnails.js.map +1 -0
- package/common/components/media-modal/parts/thumbnails.m.scss +16 -0
- package/common/components/media-modal/types.d.ts +18 -0
- package/common/components/media-modal/types.js +3 -0
- package/common/components/media-modal/types.js.map +1 -0
- package/common/components/media-modal/utils.d.ts +42 -0
- package/common/components/media-modal/utils.js +110 -0
- package/common/components/media-modal/utils.js.map +1 -0
- package/common/components/modifier/index.d.ts +2 -46
- package/common/components/modifier/index.js +4 -99
- package/common/components/modifier/index.js.map +1 -0
- package/common/components/modifier/modifier.d.ts +13 -0
- package/common/components/modifier/modifier.js +74 -0
- package/common/components/modifier/modifier.js.map +1 -0
- package/common/components/modifier/{modifiers.module.scss → modifier.m.scss} +61 -0
- package/common/components/modifier/types.d.ts +35 -0
- package/common/components/modifier/types.js +3 -0
- package/common/components/modifier/types.js.map +1 -0
- package/common/components/pagination-controls/index.d.ts +2 -0
- package/common/components/pagination-controls/index.js +9 -0
- package/common/components/pagination-controls/index.js.map +1 -0
- package/common/components/pagination-controls/pagination-controls.d.ts +30 -0
- package/common/components/pagination-controls/pagination-controls.js +72 -0
- package/common/components/pagination-controls/pagination-controls.js.map +1 -0
- package/common/components/pagination-controls/pagination-controls.m.scss +70 -0
- package/common/components/pagination-controls/types.d.ts +20 -0
- package/common/components/pagination-controls/types.js +3 -0
- package/common/components/pagination-controls/types.js.map +1 -0
- package/common/components/product-info/index.d.ts +1 -16
- package/common/components/product-info/index.js +5 -41
- package/common/components/product-info/index.js.map +1 -0
- package/common/components/product-info/parts.d.ts +22 -21
- package/common/components/product-info/parts.js +35 -83
- package/common/components/product-info/parts.js.map +1 -0
- package/common/components/product-info/product-info.d.ts +15 -0
- package/common/components/product-info/product-info.js +33 -0
- package/common/components/product-info/product-info.js.map +1 -0
- package/common/components/product-info/{product-info.module.scss → product-info.m.scss} +9 -0
- package/common/components/product-info/types.d.ts +2 -2
- package/common/components/product-info/types.js +1 -0
- package/common/components/product-info/types.js.map +1 -0
- package/common/components/product-info/utils.js +1 -0
- package/common/components/product-info/utils.js.map +1 -0
- package/common/components/rating-counter/index.d.ts +1 -25
- package/common/components/rating-counter/index.js +3 -35
- package/common/components/rating-counter/index.js.map +1 -0
- package/common/components/rating-counter/rating-counter-util.scss +1 -1
- package/common/components/rating-counter/rating-counter.d.ts +35 -0
- package/common/components/rating-counter/rating-counter.js +24 -0
- package/common/components/rating-counter/rating-counter.js.map +1 -0
- package/common/hooks/index.d.ts +19 -0
- package/common/hooks/index.js +39 -0
- package/common/hooks/index.js.map +1 -0
- package/desktop/components/breadcrumbs/breadcrumbs.d.ts +31 -0
- package/desktop/components/breadcrumbs/breadcrumbs.js +56 -0
- package/desktop/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/desktop/components/breadcrumbs/{breadcrumbs.module.scss → breadcrumbs.m.scss} +36 -1
- package/desktop/components/breadcrumbs/index.d.ts +1 -28
- package/desktop/components/breadcrumbs/index.js +3 -80
- package/desktop/components/breadcrumbs/index.js.map +1 -0
- package/desktop/components/gallery-modal/__mocks__/index.js +1 -0
- package/desktop/components/gallery-modal/__mocks__/index.js.map +1 -0
- package/desktop/components/gallery-modal/components/all-round-view.d.ts +5 -2
- package/desktop/components/gallery-modal/components/all-round-view.js +47 -62
- package/desktop/components/gallery-modal/components/all-round-view.js.map +1 -0
- package/desktop/components/gallery-modal/components/{all-round-view.module.scss → all-round-view.m.scss} +5 -0
- package/desktop/components/gallery-modal/components/gallery-modal.d.ts +4 -5
- package/desktop/components/gallery-modal/components/gallery-modal.js +16 -66
- package/desktop/components/gallery-modal/components/gallery-modal.js.map +1 -0
- package/desktop/components/gallery-modal/components/{gallery-modal.module.scss → gallery-modal.m.scss} +5 -3
- package/desktop/components/gallery-modal/components/image-overlay.d.ts +3 -3
- package/desktop/components/gallery-modal/components/image-overlay.js +4 -17
- package/desktop/components/gallery-modal/components/image-overlay.js.map +1 -0
- package/desktop/components/gallery-modal/components/{image-overlay.module.scss → image-overlay.m.scss} +1 -0
- package/desktop/components/gallery-modal/components/review-info.d.ts +1 -1
- package/desktop/components/gallery-modal/components/review-info.js +11 -52
- package/desktop/components/gallery-modal/components/review-info.js.map +1 -0
- package/desktop/components/gallery-modal/components/thumbnail.d.ts +3 -3
- package/desktop/components/gallery-modal/components/thumbnail.js +7 -10
- package/desktop/components/gallery-modal/components/thumbnail.js.map +1 -0
- package/desktop/components/gallery-modal/index.js +1 -0
- package/desktop/components/gallery-modal/index.js.map +1 -0
- package/desktop/components/gallery-modal/types.js +1 -0
- package/desktop/components/gallery-modal/types.js.map +1 -0
- package/desktop/components/gallery-modal/utils.d.ts +5 -3
- package/desktop/components/gallery-modal/utils.js +18 -8
- package/desktop/components/gallery-modal/utils.js.map +1 -0
- package/desktop/components/person-info/index.d.ts +1 -41
- package/desktop/components/person-info/index.js +3 -43
- package/desktop/components/person-info/index.js.map +1 -0
- package/desktop/components/person-info/person-info.d.ts +42 -0
- package/desktop/components/person-info/person-info.js +24 -0
- package/desktop/components/person-info/person-info.js.map +1 -0
- package/desktop/components/person-info/{person-info.module.scss → person-info.m.scss} +1 -1
- package/desktop/components/product-card/index.d.ts +2 -26
- package/desktop/components/product-card/index.js +7 -103
- package/desktop/components/product-card/index.js.map +1 -0
- package/desktop/components/product-card/product-card.d.ts +23 -0
- package/desktop/components/product-card/product-card.js +94 -0
- package/desktop/components/product-card/product-card.js.map +1 -0
- package/desktop/components/product-card/types.d.ts +19 -0
- package/desktop/components/product-card/types.js +3 -0
- package/desktop/components/product-card/types.js.map +1 -0
- package/desktop/components/product-carousel/hover-card.d.ts +2 -7
- package/desktop/components/product-carousel/hover-card.js +13 -49
- package/desktop/components/product-carousel/hover-card.js.map +1 -0
- package/desktop/components/product-carousel/{hover-card.module.scss → hover-card.m.scss} +2 -2
- package/desktop/components/product-carousel/index.d.ts +2 -31
- package/desktop/components/product-carousel/index.js +3 -133
- package/desktop/components/product-carousel/index.js.map +1 -0
- package/desktop/components/product-carousel/product-carousel.d.ts +7 -0
- package/desktop/components/product-carousel/product-carousel.js +95 -0
- package/desktop/components/product-carousel/product-carousel.js.map +1 -0
- package/desktop/components/product-carousel/{product-carousel.module.scss → product-carousel.m.scss} +1 -1
- package/desktop/components/product-carousel/types.d.ts +33 -0
- package/desktop/components/product-carousel/types.js +3 -0
- package/desktop/components/product-carousel/types.js.map +1 -0
- package/desktop/components/product-carousel/utils.d.ts +4 -4
- package/desktop/components/product-carousel/utils.js +8 -7
- package/desktop/components/product-carousel/utils.js.map +1 -0
- package/desktop/components/promotion-card/banner-title.d.ts +2 -3
- package/desktop/components/promotion-card/banner-title.js +9 -19
- package/desktop/components/promotion-card/banner-title.js.map +1 -0
- package/desktop/components/promotion-card/estimate.d.ts +1 -2
- package/desktop/components/promotion-card/estimate.js +3 -5
- package/desktop/components/promotion-card/estimate.js.map +1 -0
- package/desktop/components/promotion-card/index.d.ts +4 -31
- package/desktop/components/promotion-card/index.js +10 -83
- package/desktop/components/promotion-card/index.js.map +1 -0
- package/desktop/components/promotion-card/placeholder.d.ts +4 -2
- package/desktop/components/promotion-card/placeholder.js +4 -6
- package/desktop/components/promotion-card/placeholder.js.map +1 -0
- package/desktop/components/promotion-card/promotion-card.d.ts +32 -0
- package/desktop/components/promotion-card/promotion-card.js +39 -0
- package/desktop/components/promotion-card/promotion-card.js.map +1 -0
- package/desktop/components/promotion-card/{index.module.scss → promotion-card.m.scss} +8 -6
- package/desktop/components/promotion-card/types.js +1 -0
- package/desktop/components/promotion-card/types.js.map +1 -0
- package/mobile/components/action-circles/action-circles.d.ts +22 -0
- package/mobile/components/action-circles/action-circles.js +31 -0
- package/mobile/components/action-circles/action-circles.js.map +1 -0
- package/mobile/components/action-circles/index.d.ts +1 -22
- package/mobile/components/action-circles/index.js +3 -29
- package/mobile/components/action-circles/index.js.map +1 -0
- package/mobile/components/action-list/action-list.d.ts +29 -0
- package/mobile/components/action-list/action-list.js +40 -0
- package/mobile/components/action-list/action-list.js.map +1 -0
- package/mobile/components/action-list/index.d.ts +1 -23
- package/mobile/components/action-list/index.js +5 -34
- package/mobile/components/action-list/index.js.map +1 -0
- package/mobile/components/breadcrumbs/breadcrumbs.d.ts +12 -0
- package/mobile/components/breadcrumbs/breadcrumbs.js +17 -0
- package/mobile/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/mobile/components/breadcrumbs/index.d.ts +1 -13
- package/mobile/components/breadcrumbs/index.js +3 -13
- package/mobile/components/breadcrumbs/index.js.map +1 -0
- package/mobile/components/person-info/index.d.ts +1 -44
- package/mobile/components/person-info/index.js +4 -55
- package/mobile/components/person-info/index.js.map +1 -0
- package/mobile/components/person-info/person-info.d.ts +46 -0
- package/mobile/components/person-info/person-info.js +41 -0
- package/mobile/components/person-info/person-info.js.map +1 -0
- package/mobile/components/person-info/{person-info.module.scss → person-info.m.scss} +9 -16
- package/mobile/components/product-row/index.d.ts +1 -41
- package/mobile/components/product-row/index.js +3 -56
- package/mobile/components/product-row/index.js.map +1 -0
- package/mobile/components/product-row/product-row.d.ts +40 -0
- package/mobile/components/product-row/product-row.js +29 -0
- package/mobile/components/product-row/product-row.js.map +1 -0
- package/mobile/components/product-slider/index.d.ts +1 -17
- package/mobile/components/product-slider/index.js +3 -57
- package/mobile/components/product-slider/index.js.map +1 -0
- package/mobile/components/product-slider/product-slider.d.ts +17 -0
- package/mobile/components/product-slider/product-slider.js +37 -0
- package/mobile/components/product-slider/product-slider.js.map +1 -0
- package/mobile/components/search-bar/index.d.ts +1 -39
- package/mobile/components/search-bar/index.js +4 -104
- package/mobile/components/search-bar/index.js.map +1 -0
- package/mobile/components/search-bar/search-bar.d.ts +39 -0
- package/mobile/components/search-bar/search-bar.js +64 -0
- package/mobile/components/search-bar/search-bar.js.map +1 -0
- package/mobile/components/search-bar/{search-bar.module.scss → search-bar.m.scss} +6 -6
- package/mobile/components/select-screen/index.d.ts +1 -20
- package/mobile/components/select-screen/index.js +4 -65
- package/mobile/components/select-screen/index.js.map +1 -0
- package/mobile/components/select-screen/select-screen.d.ts +20 -0
- package/mobile/components/select-screen/select-screen.js +31 -0
- package/mobile/components/select-screen/select-screen.js.map +1 -0
- package/package.json +40 -52
- package/common/components/badge/badge.module.scss +0 -40
- package/common/components/intractive-image/interactive-image.d.ts +0 -15
- package/common/components/intractive-image/interactive-image.js +0 -96
- package/common/components/rating-counter/star.svg +0 -5
- package/common/constants.d.ts +0 -2
- package/common/constants.js +0 -8
- package/common/icons/eighteen-plus.svg +0 -5
- package/common/types.d.ts +0 -1
- package/desktop/components/breadcrumbs/square-arrow-down.svg +0 -8
- package/desktop/components/gallery-modal/icons/360.svg +0 -3
- package/desktop/components/gallery-modal/icons/pause.svg +0 -3
- package/desktop/components/gallery-modal/icons/turn-left.svg +0 -10
- package/desktop/components/gallery-modal/icons/turn-right.svg +0 -10
- package/desktop/components/modifiers/button/index.d.ts +0 -22
- package/desktop/components/modifiers/button/index.js +0 -48
- package/desktop/components/modifiers/button/modifier-button.module.scss +0 -85
- package/desktop/components/modifiers/group/index.d.ts +0 -15
- package/desktop/components/modifiers/group/index.js +0 -70
- package/desktop/components/modifiers/group/modifiers-group.module.scss +0 -33
- package/desktop/components/modifiers/group/utils.d.ts +0 -20
- package/desktop/components/modifiers/group/utils.js +0 -73
- package/desktop/components/modifiers/modifiers.scss +0 -8
- package/mobile/components/modifiers-list/index.d.ts +0 -22
- package/mobile/components/modifiers-list/index.js +0 -25
- package/mobile/components/modifiers-list/modifier-item/index.d.ts +0 -29
- package/mobile/components/modifiers-list/modifier-item/index.js +0 -38
- package/mobile/components/modifiers-list/modifier-item/modifier-item.module.scss +0 -70
- package/mobile/components/modifiers-list/modifiers-list.module.scss +0 -21
- package/mobile/components/pseudo-input/index.d.ts +0 -11
- package/mobile/components/pseudo-input/index.js +0 -34
- package/mobile/components/pseudo-input/pseudo-input.module.scss +0 -24
- /package/common/components/badge-list/{badge-list.module.scss → badge-list.m.scss} +0 -0
- /package/common/components/{intractive-image → interactive-image}/index.d.ts +0 -0
- /package/common/components/{intractive-image → interactive-image}/interactive-image-util.scss +0 -0
- /package/common/components/{intractive-image/interactive-image.module.scss → interactive-image/interactive-image.m.scss} +0 -0
- /package/common/components/rating-counter/{rating-counter.module.scss → rating-counter.m.scss} +0 -0
- /package/desktop/components/gallery-modal/components/{review-info.module.scss → review-info.m.scss} +0 -0
- /package/desktop/components/gallery-modal/components/{thumbnail.module.scss → thumbnail.m.scss} +0 -0
- /package/desktop/components/product-card/{product-card.module.scss → product-card.m.scss} +0 -0
- /package/desktop/components/promotion-card/{banner-title.module.scss → banner-title.m.scss} +0 -0
- /package/desktop/components/promotion-card/{placeholder.module.scss → placeholder.m.scss} +0 -0
- /package/mobile/components/action-circles/{action-circles.module.scss → action-circles.m.scss} +0 -0
- /package/mobile/components/action-list/{action-list.module.scss → action-list.m.scss} +0 -0
- /package/mobile/components/breadcrumbs/{breadcrumbs.module.scss → breadcrumbs.m.scss} +0 -0
- /package/mobile/components/product-row/{product-row.module.scss → product-row.m.scss} +0 -0
- /package/mobile/components/product-slider/{product-slider.module.scss → product-slider.m.scss} +0 -0
- /package/mobile/components/select-screen/{select-screen.module.scss → select-screen.m.scss} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { ProductInfo, ProductInfoProps } from '../../../common/components/product-info';
|
|
3
|
+
export type ItemElement = ReactElement<ProductInfoProps, typeof ProductInfo>;
|
|
4
|
+
export interface ProductSliderProps {
|
|
5
|
+
/** Товары. */
|
|
6
|
+
children?: ItemElement | ItemElement[];
|
|
7
|
+
/** Функция, вызываемая при попадании компонента в поле видимости. */
|
|
8
|
+
onInViewport?: () => void;
|
|
9
|
+
/** Функция, инициализирующая загрузку рекомендаций. */
|
|
10
|
+
onNeedRequest?: () => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Слайдер товаров.
|
|
14
|
+
* @param props Свойства.
|
|
15
|
+
* @return Элемент.
|
|
16
|
+
*/
|
|
17
|
+
export declare const ProductSlider: ({ children, onInViewport, onNeedRequest }: ProductSliderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ProductSlider = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const hooks_1 = require("@sima-land/ui-nucleons/hooks");
|
|
10
|
+
const touch_slider_1 = require("@sima-land/ui-nucleons/touch-slider");
|
|
11
|
+
const product_info_1 = require("../../../common/components/product-info");
|
|
12
|
+
const product_slider_m_scss_1 = __importDefault(require("./product-slider.m.scss"));
|
|
13
|
+
/**
|
|
14
|
+
* Слайдер товаров.
|
|
15
|
+
* @param props Свойства.
|
|
16
|
+
* @return Элемент.
|
|
17
|
+
*/
|
|
18
|
+
const ProductSlider = ({ children, onInViewport, onNeedRequest }) => {
|
|
19
|
+
const rootRef = (0, react_1.useRef)(null);
|
|
20
|
+
// инициируем загрузку данных, когда компонент почти попал в зону видимости
|
|
21
|
+
const options = (0, react_1.useMemo)(() => ({ rootMargin: '200px 0px 200px 0px' }), []);
|
|
22
|
+
(0, hooks_1.useIntersection)(rootRef, entry => {
|
|
23
|
+
entry.isIntersecting && (onNeedRequest === null || onNeedRequest === void 0 ? void 0 : onNeedRequest());
|
|
24
|
+
}, options);
|
|
25
|
+
// сообщаем, когда компонент попадет в зону видимости
|
|
26
|
+
(0, hooks_1.useIntersection)(rootRef, entry => {
|
|
27
|
+
entry.isIntersecting && (onInViewport === null || onInViewport === void 0 ? void 0 : onInViewport());
|
|
28
|
+
});
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: rootRef, "data-testid": 'product-slider:root', children: (0, jsx_runtime_1.jsx)(touch_slider_1.TouchSlider, { children: (0, jsx_runtime_1.jsx)(product_info_1.Parts.FooterContext.Provider, { value: { className: product_slider_m_scss_1.default.footer }, children: react_1.Children.toArray(children).reduce((list, item) => {
|
|
30
|
+
(0, react_1.isValidElement)(item) &&
|
|
31
|
+
item.type === product_info_1.ProductInfo &&
|
|
32
|
+
list.push((0, jsx_runtime_1.jsx)("div", { className: product_slider_m_scss_1.default.item, "data-testid": 'product-slider:item', children: item }, item.key));
|
|
33
|
+
return list;
|
|
34
|
+
}, []) }) }) }));
|
|
35
|
+
};
|
|
36
|
+
exports.ProductSlider = ProductSlider;
|
|
37
|
+
//# sourceMappingURL=product-slider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-slider.js","sourceRoot":"","sources":["../../../../src/mobile/components/product-slider/product-slider.tsx"],"names":[],"mappings":";;;;;;;AAAA,iCAAgF;AAChF,wDAA+D;AAC/D,sEAAkE;AAClE,0EAA+F;AAC/F,oFAA6C;AAe7C;;;;GAIG;AACI,MAAM,aAAa,GAAG,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAsB,EAAE,EAAE;IAC7F,MAAM,OAAO,GAAG,IAAA,cAAM,EAAiB,IAAI,CAAC,CAAC;IAE7C,2EAA2E;IAC3E,MAAM,OAAO,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,qBAAqB,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC3E,IAAA,uBAAe,EACb,OAAO,EACP,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,cAAc,KAAI,aAAa,aAAb,aAAa,uBAAb,aAAa,EAAI,CAAA,CAAC;IAC5C,CAAC,EACD,OAAO,CACR,CAAC;IAEF,qDAAqD;IACrD,IAAA,uBAAe,EAAC,OAAO,EAAE,KAAK,CAAC,EAAE;QAC/B,KAAK,CAAC,cAAc,KAAI,YAAY,aAAZ,YAAY,uBAAZ,YAAY,EAAI,CAAA,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,OAAO,CACL,gCAAK,GAAG,EAAE,OAAO,iBAAc,qBAAqB,YAClD,uBAAC,0BAAW,cACV,uBAAC,oBAAK,CAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,+BAAM,CAAC,MAAM,EAAE,YAC9D,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;oBAChE,IAAA,sBAAc,EAAC,IAAI,CAAC;wBAClB,IAAI,CAAC,IAAI,KAAK,0BAAW;wBACzB,IAAI,CAAC,IAAI,CACP,gCAAoB,SAAS,EAAE,+BAAM,CAAC,IAAI,iBAAc,qBAAqB,YAC1E,IAAI,IADG,IAAI,CAAC,GAAG,CAEZ,CACP,CAAC;oBAEJ,OAAO,IAAI,CAAC;gBACd,CAAC,EAAE,EAAE,CAAC,GACuB,GACnB,GACV,CACP,CAAC;AACJ,CAAC,CAAC;AArCW,QAAA,aAAa,iBAqCxB"}
|
|
@@ -1,39 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Token } from '@sima-land/ui-nucleons/colors';
|
|
3
|
-
export declare const cx: (...args: import("classnames").ArgumentArray) => string;
|
|
4
|
-
export interface ButtonProps {
|
|
5
|
-
text: string;
|
|
6
|
-
onClick: React.MouseEventHandler;
|
|
7
|
-
icon?: React.ElementType;
|
|
8
|
-
iconColor?: Token;
|
|
9
|
-
}
|
|
10
|
-
export interface SearchBarProps {
|
|
11
|
-
/** Поисковый Запрос. */
|
|
12
|
-
value?: string;
|
|
13
|
-
/** Вызовется при изменении поискового запроса. */
|
|
14
|
-
onChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
15
|
-
/** Тип клавиатуры. */
|
|
16
|
-
inputMode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
|
|
17
|
-
/** Подсказка. */
|
|
18
|
-
placeholder?: string;
|
|
19
|
-
/** Вызовется при нажатии на кнопку очистки. */
|
|
20
|
-
onClear?: React.MouseEventHandler;
|
|
21
|
-
/** Кнопки(а) после поля. */
|
|
22
|
-
endButtons?: any[];
|
|
23
|
-
/** Кнопки(а) до поля. */
|
|
24
|
-
startButtons?: any[];
|
|
25
|
-
/** Признак наличия иконки поиска слева. */
|
|
26
|
-
withSearchIcon?: boolean;
|
|
27
|
-
/** Признак авто-фокуса. */
|
|
28
|
-
autoFocus?: boolean;
|
|
29
|
-
/** Описание в поле ввода. */
|
|
30
|
-
description?: string;
|
|
31
|
-
/** Ref для элемента текстового поля. */
|
|
32
|
-
inputRef?: React.MutableRefObject<HTMLInputElement | null>;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Компонент поисковой строки.
|
|
36
|
-
* @param props Свойства.
|
|
37
|
-
* @return Элемент.
|
|
38
|
-
*/
|
|
39
|
-
export declare const SearchBar: ({ value, onChange, inputMode, placeholder, onClear, endButtons, startButtons, withSearchIcon, autoFocus, description, inputRef: inputRefProp, }: SearchBarProps) => JSX.Element;
|
|
1
|
+
export { type SearchBarProps, SearchBar } from './search-bar';
|
|
@@ -1,106 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.SearchBar =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const dropdown_1 = require("@sima-land/ui-nucleons/dropdown");
|
|
34
|
-
const dropdown_item_1 = require("@sima-land/ui-nucleons/dropdown-item");
|
|
35
|
-
const hooks_1 = require("@sima-land/ui-nucleons/hooks/");
|
|
36
|
-
const on_1 = __importDefault(require("@sima-land/ui-nucleons/helpers/on"));
|
|
37
|
-
const cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Filled/cross"));
|
|
38
|
-
const search_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/search"));
|
|
39
|
-
const more_vert_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Filled/more-vert"));
|
|
40
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
41
|
-
const search_bar_module_scss_1 = __importDefault(require("./search-bar.module.scss"));
|
|
42
|
-
exports.cx = bind_1.default.bind(search_bar_module_scss_1.default);
|
|
43
|
-
/**
|
|
44
|
-
* Компонент поисковой строки.
|
|
45
|
-
* @param props Свойства.
|
|
46
|
-
* @return Элемент.
|
|
47
|
-
*/
|
|
48
|
-
const SearchBar = ({ value, onChange, inputMode, placeholder = 'Поиск', onClear, endButtons = [], startButtons = [], withSearchIcon = true, autoFocus = true, description, inputRef: inputRefProp, }) => {
|
|
49
|
-
const [shownDropdown, toggleDropdown] = (0, react_1.useState)(false);
|
|
50
|
-
const inputRef = (0, react_1.useRef)(null);
|
|
51
|
-
const dropdownRef = (0, react_1.useRef)(null);
|
|
52
|
-
const dropdownOpenerRef = (0, react_1.useRef)(null);
|
|
53
|
-
const needHideEndButtons = endButtons.length > 1;
|
|
54
|
-
(0, react_1.useImperativeHandle)(inputRefProp, () => inputRef.current);
|
|
55
|
-
(0, hooks_1.useOutsideClick)(dropdownRef, e => {
|
|
56
|
-
var _a;
|
|
57
|
-
!((_a = dropdownOpenerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) && toggleDropdown(false);
|
|
58
|
-
});
|
|
59
|
-
(0, react_1.useEffect)(() => needHideEndButtons
|
|
60
|
-
? (0, on_1.default)(window, 'resize', (0, lodash_1.throttle)(() => toggleDropdown(false), 500))
|
|
61
|
-
: undefined, [needHideEndButtons]);
|
|
62
|
-
// eslint-disable-next-line require-jsdoc
|
|
63
|
-
const preventFieldBlur = e => {
|
|
64
|
-
if (inputRef.current &&
|
|
65
|
-
inputRef.current !== e.target && // не предотвращаем события на самом поле (например выделение текста)
|
|
66
|
-
document.activeElement === inputRef.current) {
|
|
67
|
-
e.preventDefault();
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
return (react_1.default.createElement("div", { className: (0, exports.cx)('root') },
|
|
71
|
-
Boolean(startButtons.length) && (react_1.default.createElement("div", { className: (0, exports.cx)('before-field') },
|
|
72
|
-
react_1.default.createElement("div", { className: (0, exports.cx)('buttons-container') }, startButtons.map((props, index) => (react_1.default.createElement(Button, Object.assign({}, props, { key: index }))))))),
|
|
73
|
-
react_1.default.createElement("label", { className: (0, exports.cx)('input-wrapper'), onMouseDown: preventFieldBlur, "data-testid": 'search-bar:input-wrapper' },
|
|
74
|
-
withSearchIcon && (react_1.default.createElement("span", { className: (0, exports.cx)('search-icon') },
|
|
75
|
-
react_1.default.createElement(search_1.default, { fill: colors_1.COLORS.get('basic-gray38'), "aria-hidden": true }))),
|
|
76
|
-
react_1.default.createElement("div", { className: (0, exports.cx)('input-container') },
|
|
77
|
-
react_1.default.createElement("input", { ref: inputRef, value: value, onChange: onChange, className: (0, exports.cx)('search-field'), placeholder: placeholder, autoFocus: autoFocus, "data-testid": 'search-bar-input', type: 'text', inputMode: inputMode, tabIndex: 0 }),
|
|
78
|
-
description && (react_1.default.createElement("div", { className: (0, exports.cx)('description-container') },
|
|
79
|
-
react_1.default.createElement("span", { className: (0, exports.cx)('description') }, description)))),
|
|
80
|
-
value && onClear && (react_1.default.createElement("button", { onClick: onClear, "aria-label": '\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C', "data-testid": 'search-bar:clear-icon', className: (0, exports.cx)('clear-button') },
|
|
81
|
-
react_1.default.createElement(cross_1.default, { fill: colors_1.COLORS.get('basic-gray38'), "aria-hidden": true })))),
|
|
82
|
-
Boolean(endButtons.length) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
83
|
-
react_1.default.createElement("div", { className: (0, exports.cx)('after-field', needHideEndButtons && 'wide-screen') },
|
|
84
|
-
react_1.default.createElement("div", { className: (0, exports.cx)('buttons-container') }, endButtons.map((props, index) => (react_1.default.createElement(Button, Object.assign({}, props, { key: index })))))),
|
|
85
|
-
needHideEndButtons && (react_1.default.createElement("div", { className: (0, exports.cx)('after-field', 'narrow-screen') },
|
|
86
|
-
react_1.default.createElement("div", { className: (0, exports.cx)('buttons-container') },
|
|
87
|
-
react_1.default.createElement(Button, { text: '\u0411\u043E\u043B\u044C\u0448\u0435', ref: dropdownOpenerRef, icon: more_vert_1.default, onClick: () => toggleDropdown(!shownDropdown) })),
|
|
88
|
-
shownDropdown && (react_1.default.createElement("div", { ref: dropdownRef, className: (0, exports.cx)('dropdown-container') },
|
|
89
|
-
react_1.default.createElement(dropdown_1.Dropdown, null, endButtons.map(({ text, onClick }, index) => (react_1.default.createElement(dropdown_item_1.DropdownItem, { size: 's', key: index, onClick: event => {
|
|
90
|
-
onClick(event);
|
|
91
|
-
toggleDropdown(false);
|
|
92
|
-
}, children: text }))))))))))));
|
|
93
|
-
};
|
|
94
|
-
exports.SearchBar = SearchBar;
|
|
95
|
-
/**
|
|
96
|
-
* Компонент кнопки.
|
|
97
|
-
* @param props Свойства.
|
|
98
|
-
* @param props.text Текст кнопки.
|
|
99
|
-
* @param props.onClick Обработчик клика.
|
|
100
|
-
* @param props.icon Иконка.
|
|
101
|
-
* @param props.iconColor Цвет иконки.
|
|
102
|
-
* @return Элемент.
|
|
103
|
-
*/
|
|
104
|
-
const Button = (0, react_1.forwardRef)(function Button({ text, icon: Icon, iconColor = 'basic-gray87', onClick }, ref) {
|
|
105
|
-
return (react_1.default.createElement("div", { ref: ref, onClick: onClick, className: (0, exports.cx)('button'), role: 'button', "data-testid": 'search-bar-button', tabIndex: 0, "aria-label": Icon && text }, Icon ? react_1.default.createElement(Icon, { fill: colors_1.COLORS.get(iconColor), "aria-hidden": 'true' }) : text));
|
|
106
|
-
});
|
|
3
|
+
exports.SearchBar = void 0;
|
|
4
|
+
var search_bar_1 = require("./search-bar");
|
|
5
|
+
Object.defineProperty(exports, "SearchBar", { enumerable: true, get: function () { return search_bar_1.SearchBar; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mobile/components/search-bar/index.ts"],"names":[],"mappings":";;;AAAA,2CAA8D;AAAhC,uGAAA,SAAS,OAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ElementType, MouseEventHandler, ChangeEventHandler, MutableRefObject } from 'react';
|
|
2
|
+
import { Token } from '@sima-land/ui-nucleons/colors';
|
|
3
|
+
export declare const cx: (...args: import("classnames").ArgumentArray) => string;
|
|
4
|
+
export interface ButtonProps {
|
|
5
|
+
text: string;
|
|
6
|
+
onClick: MouseEventHandler;
|
|
7
|
+
icon?: ElementType;
|
|
8
|
+
iconColor?: Token;
|
|
9
|
+
}
|
|
10
|
+
export interface SearchBarProps {
|
|
11
|
+
/** Поисковый Запрос. */
|
|
12
|
+
value?: string;
|
|
13
|
+
/** Вызовется при изменении поискового запроса. */
|
|
14
|
+
onChange: ChangeEventHandler<HTMLInputElement>;
|
|
15
|
+
/** Тип клавиатуры. */
|
|
16
|
+
inputMode?: 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
|
|
17
|
+
/** Подсказка. */
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** Вызовется при нажатии на кнопку очистки. */
|
|
20
|
+
onClear?: MouseEventHandler;
|
|
21
|
+
/** Кнопки(а) после поля. */
|
|
22
|
+
endButtons?: any[];
|
|
23
|
+
/** Кнопки(а) до поля. */
|
|
24
|
+
startButtons?: any[];
|
|
25
|
+
/** Признак наличия иконки поиска слева. */
|
|
26
|
+
withSearchIcon?: boolean;
|
|
27
|
+
/** Признак авто-фокуса. */
|
|
28
|
+
autoFocus?: boolean;
|
|
29
|
+
/** Описание в поле ввода. */
|
|
30
|
+
description?: string;
|
|
31
|
+
/** Ref для элемента текстового поля. */
|
|
32
|
+
inputRef?: MutableRefObject<HTMLInputElement | null>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Компонент поисковой строки.
|
|
36
|
+
* @param props Свойства.
|
|
37
|
+
* @return Элемент.
|
|
38
|
+
*/
|
|
39
|
+
export declare const SearchBar: ({ value, onChange, inputMode, placeholder, onClear, endButtons, startButtons, withSearchIcon, autoFocus, description, inputRef: inputRefProp, }: SearchBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SearchBar = exports.cx = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const react_2 = require("react");
|
|
10
|
+
const colors_1 = require("@sima-land/ui-nucleons/colors");
|
|
11
|
+
const dropdown_1 = require("@sima-land/ui-nucleons/dropdown");
|
|
12
|
+
const dropdown_item_1 = require("@sima-land/ui-nucleons/dropdown-item");
|
|
13
|
+
const hooks_1 = require("@sima-land/ui-nucleons/hooks");
|
|
14
|
+
const helpers_1 = require("@sima-land/ui-nucleons/helpers");
|
|
15
|
+
const CircleCross_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Filled/CircleCross"));
|
|
16
|
+
const Magnifier_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/Magnifier"));
|
|
17
|
+
const MoreVert_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Filled/MoreVert"));
|
|
18
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
19
|
+
const search_bar_m_scss_1 = __importDefault(require("./search-bar.m.scss"));
|
|
20
|
+
exports.cx = bind_1.default.bind(search_bar_m_scss_1.default);
|
|
21
|
+
/**
|
|
22
|
+
* Компонент поисковой строки.
|
|
23
|
+
* @param props Свойства.
|
|
24
|
+
* @return Элемент.
|
|
25
|
+
*/
|
|
26
|
+
const SearchBar = ({ value, onChange, inputMode, placeholder = 'Поиск', onClear, endButtons = [], startButtons = [], withSearchIcon = true, autoFocus = true, description, inputRef: inputRefProp, }) => {
|
|
27
|
+
const [shownDropdown, toggleDropdown] = (0, react_2.useState)(false);
|
|
28
|
+
const inputRef = (0, react_2.useRef)(null);
|
|
29
|
+
const dropdownRef = (0, react_2.useRef)(null);
|
|
30
|
+
const dropdownOpenerRef = (0, react_2.useRef)(null);
|
|
31
|
+
const needHideEndButtons = endButtons.length > 1;
|
|
32
|
+
(0, react_2.useImperativeHandle)(inputRefProp, () => inputRef.current);
|
|
33
|
+
(0, hooks_1.useOutsideClick)(dropdownRef, e => {
|
|
34
|
+
var _a;
|
|
35
|
+
!((_a = dropdownOpenerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) && toggleDropdown(false);
|
|
36
|
+
});
|
|
37
|
+
(0, react_2.useEffect)(() => (needHideEndButtons ? (0, helpers_1.on)(window, 'resize', () => toggleDropdown(false)) : undefined), [needHideEndButtons]);
|
|
38
|
+
// eslint-disable-next-line require-jsdoc
|
|
39
|
+
const preventFieldBlur = e => {
|
|
40
|
+
if (inputRef.current &&
|
|
41
|
+
inputRef.current !== e.target && // не предотвращаем события на самом поле (например выделение текста)
|
|
42
|
+
document.activeElement === inputRef.current) {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, exports.cx)('root'), children: [Boolean(startButtons.length) && ((0, jsx_runtime_1.jsx)("div", { className: (0, exports.cx)('before-field'), children: (0, jsx_runtime_1.jsx)("div", { className: (0, exports.cx)('buttons-container'), children: startButtons.map((props, index) => ((0, react_1.createElement)(Button, { ...props, key: index }))) }) })), (0, jsx_runtime_1.jsxs)("label", { className: (0, exports.cx)('input-wrapper'), onMouseDown: preventFieldBlur, "data-testid": 'search-bar:input-wrapper', children: [withSearchIcon && ((0, jsx_runtime_1.jsx)("span", { className: (0, exports.cx)('search-icon'), children: (0, jsx_runtime_1.jsx)(Magnifier_1.default, { fill: colors_1.COLORS.get('basic-gray38'), "aria-hidden": true }) })), (0, jsx_runtime_1.jsxs)("div", { className: (0, exports.cx)('input-container'), children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, value: value, onChange: onChange, className: (0, exports.cx)('search-field'), placeholder: placeholder, autoFocus: autoFocus, "data-testid": 'search-bar-input', type: 'text', inputMode: inputMode, tabIndex: 0 }), description && ((0, jsx_runtime_1.jsx)("div", { className: (0, exports.cx)('description-container'), children: (0, jsx_runtime_1.jsx)("span", { className: (0, exports.cx)('description'), children: description }) }))] }), value && onClear && ((0, jsx_runtime_1.jsx)("button", { onClick: onClear, "aria-label": '\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C', "data-testid": 'search-bar:clear-icon', className: (0, exports.cx)('clear-button'), children: (0, jsx_runtime_1.jsx)(CircleCross_1.default, { fill: colors_1.COLORS.get('basic-gray38'), "aria-hidden": true }) }))] }), Boolean(endButtons.length) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: (0, exports.cx)('after-field', needHideEndButtons && 'wide-screen'), children: (0, jsx_runtime_1.jsx)("div", { className: (0, exports.cx)('buttons-container'), children: endButtons.map((props, index) => ((0, react_1.createElement)(Button, { ...props, key: index }))) }) }), needHideEndButtons && ((0, jsx_runtime_1.jsxs)("div", { className: (0, exports.cx)('after-field', 'narrow-screen'), children: [(0, jsx_runtime_1.jsx)("div", { className: (0, exports.cx)('buttons-container'), children: (0, jsx_runtime_1.jsx)(Button, { text: '\u0411\u043E\u043B\u044C\u0448\u0435', ref: dropdownOpenerRef, icon: MoreVert_1.default, onClick: () => toggleDropdown(!shownDropdown) }) }), shownDropdown && ((0, jsx_runtime_1.jsx)("div", { ref: dropdownRef, className: (0, exports.cx)('dropdown-container'), children: (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { children: endButtons.map(({ text, onClick }, index) => ((0, jsx_runtime_1.jsx)(dropdown_item_1.DropdownItem, { size: 's', onClick: event => {
|
|
47
|
+
onClick(event);
|
|
48
|
+
toggleDropdown(false);
|
|
49
|
+
}, children: text }, index))) }) }))] }))] }))] }));
|
|
50
|
+
};
|
|
51
|
+
exports.SearchBar = SearchBar;
|
|
52
|
+
/**
|
|
53
|
+
* Компонент кнопки.
|
|
54
|
+
* @param props Свойства.
|
|
55
|
+
* @param props.text Текст кнопки.
|
|
56
|
+
* @param props.onClick Обработчик клика.
|
|
57
|
+
* @param props.icon Иконка.
|
|
58
|
+
* @param props.iconColor Цвет иконки.
|
|
59
|
+
* @return Элемент.
|
|
60
|
+
*/
|
|
61
|
+
const Button = (0, react_2.forwardRef)(function Button({ text, icon: Icon, iconColor = 'basic-gray87', onClick }, ref) {
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, onClick: onClick, className: (0, exports.cx)('button'), role: 'button', "data-testid": 'search-bar-button', tabIndex: 0, "aria-label": Icon && text, children: Icon ? (0, jsx_runtime_1.jsx)(Icon, { fill: colors_1.COLORS.get(iconColor), "aria-hidden": 'true' }) : text }));
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=search-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-bar.js","sourceRoot":"","sources":["../../../../src/mobile/components/search-bar/search-bar.tsx"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
2
2
|
|
|
3
3
|
.root {
|
|
4
4
|
display: flex;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
flex-grow: 1;
|
|
11
11
|
margin: 8px 0;
|
|
12
12
|
width: 100%;
|
|
13
|
-
background-color:
|
|
13
|
+
background-color: colors.$basic-gray4;
|
|
14
14
|
border-radius: 8px;
|
|
15
15
|
padding: 0 12px;
|
|
16
16
|
&:focus-within {
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
display: none;
|
|
58
58
|
}
|
|
59
59
|
&::placeholder {
|
|
60
|
-
color:
|
|
60
|
+
color: colors.$basic-gray38;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
.description-container {
|
|
65
65
|
line-height: 24px;
|
|
66
66
|
font-size: 16px;
|
|
67
|
-
color:
|
|
67
|
+
color: colors.$basic-gray38;
|
|
68
68
|
width: 100%;
|
|
69
69
|
max-width: 50%;
|
|
70
70
|
display: flex;
|
|
@@ -119,10 +119,10 @@
|
|
|
119
119
|
|
|
120
120
|
.button {
|
|
121
121
|
padding: 0 12px;
|
|
122
|
-
font-weight:
|
|
122
|
+
font-weight: 600;
|
|
123
123
|
font-size: 14px;
|
|
124
124
|
line-height: 20px;
|
|
125
|
-
color:
|
|
125
|
+
color: colors.$basic-blue;
|
|
126
126
|
cursor: pointer;
|
|
127
127
|
display: flex;
|
|
128
128
|
align-items: center;
|
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { LayoutProps } from '@sima-land/ui-nucleons/layout';
|
|
3
|
-
export type OptionSize = 's' | 'm' | 'l' | 'xl';
|
|
4
|
-
export interface SelectScreenOptionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
-
size?: OptionSize;
|
|
6
|
-
selected?: boolean;
|
|
7
|
-
withSelectedIcon?: boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Отступы для вывода опций в компоненте Screen.
|
|
11
|
-
* @param props Свойства.
|
|
12
|
-
* @return Элемент.
|
|
13
|
-
*/
|
|
14
|
-
export declare const SelectScreenLayout: ({ children, ...props }: LayoutProps) => JSX.Element;
|
|
15
|
-
/**
|
|
16
|
-
* Опция.
|
|
17
|
-
* @param props Свойства.
|
|
18
|
-
* @return Элемент.
|
|
19
|
-
*/
|
|
20
|
-
export declare const SelectScreenOption: ({ children, className, selected, withSelectedIcon, size, ...props }: SelectScreenOptionProps) => JSX.Element;
|
|
1
|
+
export { SelectScreenLayout, SelectScreenOption, type SelectScreenOptionProps, type OptionSize, } from './select-screen';
|
|
@@ -1,68 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
-
var t = {};
|
|
27
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
-
t[p] = s[p];
|
|
29
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
-
t[p[i]] = s[p[i]];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
};
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
3
|
exports.SelectScreenOption = exports.SelectScreenLayout = void 0;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const select_screen_module_scss_1 = __importDefault(require("./select-screen.module.scss"));
|
|
46
|
-
/**
|
|
47
|
-
* Отступы для вывода опций в компоненте Screen.
|
|
48
|
-
* @param props Свойства.
|
|
49
|
-
* @return Элемент.
|
|
50
|
-
*/
|
|
51
|
-
const SelectScreenLayout = (_a) => {
|
|
52
|
-
var { children } = _a, props = __rest(_a, ["children"]);
|
|
53
|
-
return (react_1.default.createElement(layout_1.MobileLayout, Object.assign({}, props, { disabledOn: ['mxs', 'ms'] }),
|
|
54
|
-
react_1.default.createElement("div", { className: select_screen_module_scss_1.default.container }, react_1.Children.toArray(children).filter(x => (0, react_1.isValidElement)(x) && x.type === exports.SelectScreenOption))));
|
|
55
|
-
};
|
|
56
|
-
exports.SelectScreenLayout = SelectScreenLayout;
|
|
57
|
-
/**
|
|
58
|
-
* Опция.
|
|
59
|
-
* @param props Свойства.
|
|
60
|
-
* @return Элемент.
|
|
61
|
-
*/
|
|
62
|
-
const SelectScreenOption = (_a) => {
|
|
63
|
-
var { children, className, selected, withSelectedIcon = selected, size = 'm' } = _a, props = __rest(_a, ["children", "className", "selected", "withSelectedIcon", "size"]);
|
|
64
|
-
return (react_1.default.createElement("button", Object.assign({}, props, { type: 'button', className: (0, classnames_1.default)(select_screen_module_scss_1.default.item, className, select_screen_module_scss_1.default[`size-${size}`]), "data-testid": 'select-screen:option' }),
|
|
65
|
-
children,
|
|
66
|
-
selected && withSelectedIcon && react_1.default.createElement(check_1.default, { role: 'presentation', className: select_screen_module_scss_1.default.icon })));
|
|
67
|
-
};
|
|
68
|
-
exports.SelectScreenOption = SelectScreenOption;
|
|
4
|
+
var select_screen_1 = require("./select-screen");
|
|
5
|
+
Object.defineProperty(exports, "SelectScreenLayout", { enumerable: true, get: function () { return select_screen_1.SelectScreenLayout; } });
|
|
6
|
+
Object.defineProperty(exports, "SelectScreenOption", { enumerable: true, get: function () { return select_screen_1.SelectScreenOption; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/mobile/components/select-screen/index.ts"],"names":[],"mappings":";;;AAAA,iDAKyB;AAJvB,mHAAA,kBAAkB,OAAA;AAClB,mHAAA,kBAAkB,OAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { LayoutProps } from '@sima-land/ui-nucleons/layout';
|
|
3
|
+
export type OptionSize = 's' | 'm' | 'l' | 'xl';
|
|
4
|
+
export interface SelectScreenOptionProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
size?: OptionSize;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
withSelectedIcon?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Отступы для вывода опций в компоненте Screen.
|
|
11
|
+
* @param props Свойства.
|
|
12
|
+
* @return Элемент.
|
|
13
|
+
*/
|
|
14
|
+
export declare function SelectScreenLayout({ children, ...props }: LayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* Опция.
|
|
17
|
+
* @param props Свойства.
|
|
18
|
+
* @return Элемент.
|
|
19
|
+
*/
|
|
20
|
+
export declare function SelectScreenOption({ children, className, selected, withSelectedIcon, size, ...props }: SelectScreenOptionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SelectScreenOption = exports.SelectScreenLayout = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const layout_1 = require("@sima-land/ui-nucleons/layout");
|
|
10
|
+
const Check_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/Check"));
|
|
11
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
12
|
+
const select_screen_m_scss_1 = __importDefault(require("./select-screen.m.scss"));
|
|
13
|
+
/**
|
|
14
|
+
* Отступы для вывода опций в компоненте Screen.
|
|
15
|
+
* @param props Свойства.
|
|
16
|
+
* @return Элемент.
|
|
17
|
+
*/
|
|
18
|
+
function SelectScreenLayout({ children, ...props }) {
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(layout_1.MobileLayout, { ...props, disabledOn: ['mxs', 'ms'], children: (0, jsx_runtime_1.jsx)("div", { className: select_screen_m_scss_1.default.container, children: react_1.Children.toArray(children).filter(x => (0, react_1.isValidElement)(x) && x.type === SelectScreenOption) }) }));
|
|
20
|
+
}
|
|
21
|
+
exports.SelectScreenLayout = SelectScreenLayout;
|
|
22
|
+
/**
|
|
23
|
+
* Опция.
|
|
24
|
+
* @param props Свойства.
|
|
25
|
+
* @return Элемент.
|
|
26
|
+
*/
|
|
27
|
+
function SelectScreenOption({ children, className, selected, withSelectedIcon = selected, size = 'm', ...props }) {
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)("button", { ...props, type: 'button', className: (0, classnames_1.default)(select_screen_m_scss_1.default.item, className, select_screen_m_scss_1.default[`size-${size}`]), "data-testid": 'select-screen:option', children: [children, selected && withSelectedIcon && (0, jsx_runtime_1.jsx)(Check_1.default, { role: 'presentation', className: select_screen_m_scss_1.default.icon })] }));
|
|
29
|
+
}
|
|
30
|
+
exports.SelectScreenOption = SelectScreenOption;
|
|
31
|
+
//# sourceMappingURL=select-screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-screen.js","sourceRoot":"","sources":["../../../../src/mobile/components/select-screen/select-screen.tsx"],"names":[],"mappings":";;;;;;;AAAA,iCAAuE;AACvE,0DAA0E;AAC1E,2FAAsE;AACtE,4DAA4B;AAC5B,kFAA4C;AAU5C;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAe;IACpE,OAAO,CACL,uBAAC,qBAAY,OAAK,KAAK,EAAE,UAAU,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,YAChD,gCAAK,SAAS,EAAE,8BAAM,CAAC,SAAS,YAC7B,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,sBAAc,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,kBAAkB,CAAC,GACvF,GACO,CAChB,CAAC;AACJ,CAAC;AARD,gDAQC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,gBAAgB,GAAG,QAAQ,EAC3B,IAAI,GAAG,GAAG,EACV,GAAG,KAAK,EACgB;IACxB,OAAO,CACL,uCACM,KAAK,EACT,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,IAAA,oBAAE,EAAC,8BAAM,CAAC,IAAI,EAAE,SAAS,EAAE,8BAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,iBACjD,sBAAsB,aAEjC,QAAQ,EACR,QAAQ,IAAI,gBAAgB,IAAI,uBAAC,eAAQ,IAAC,IAAI,EAAC,cAAc,EAAC,SAAS,EAAE,8BAAM,CAAC,IAAI,GAAI,IAClF,CACV,CAAC;AACJ,CAAC;AAnBD,gDAmBC"}
|