@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
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sima-land/moleculas",
|
|
3
|
-
"
|
|
3
|
+
"type": "commonjs",
|
|
4
|
+
"version": "16.0.0-alpha.21",
|
|
4
5
|
"repository": "ssh://git@github.com:sima-land/moleculas.git",
|
|
5
6
|
"author": "www.sima-land.ru team",
|
|
6
7
|
"license": "Apache-2.0",
|
|
@@ -9,83 +10,70 @@
|
|
|
9
10
|
"node": ">=16.15.1"
|
|
10
11
|
},
|
|
11
12
|
"scripts": {
|
|
12
|
-
"build
|
|
13
|
-
"build:
|
|
14
|
-
"build:
|
|
15
|
-
"build": "
|
|
13
|
+
"build": "npm run build:clean && npm run build:scripts && npm run build:assets && npm run build:package",
|
|
14
|
+
"build:clean": "rm -rf build",
|
|
15
|
+
"build:scripts": "tsc --project tsconfig.build.json",
|
|
16
|
+
"build:assets": "node scripts/build-assets.mjs",
|
|
17
|
+
"build:package": "cd build && npm pkg delete scripts.prepare && cd ..",
|
|
16
18
|
"type-check": "tsc -p . --noEmit",
|
|
17
|
-
"
|
|
18
|
-
"coverage": "jest --coverage",
|
|
19
|
+
"lint": "npm run lint:scripts && npm run lint:styles",
|
|
19
20
|
"lint:scripts": "eslint --cache src/ --ext .js,.jsx,.ts,.tsx",
|
|
20
21
|
"lint:styles": "stylelint 'src/**/*.scss'",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
22
|
+
"test": "jest",
|
|
23
|
+
"test:coverage": "jest --coverage",
|
|
23
24
|
"prettier": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,css,scss}\" --loglevel error",
|
|
24
|
-
"prettier:check": "prettier --check \"./src/**/*.{js,jsx,ts,tsx,css,scss}\" --loglevel error"
|
|
25
|
+
"prettier:check": "prettier --check \"./src/**/*.{js,jsx,ts,tsx,css,scss}\" --loglevel error",
|
|
26
|
+
"storybook": "BROWSERSLIST_ENV=\"storybook\" storybook dev -p 6006",
|
|
27
|
+
"storybook:build": "BROWSERSLIST_ENV=\"storybook\" storybook build --quiet --loglevel error -o build-storybook"
|
|
25
28
|
},
|
|
26
29
|
"dependencies": {
|
|
27
30
|
"classnames": "^2.3.2",
|
|
28
|
-
"date-fns": "^
|
|
29
|
-
"lodash": "^4.17.21",
|
|
30
|
-
"react-svg": "^14.1.3",
|
|
31
|
+
"date-fns": "^3.3.1",
|
|
31
32
|
"react-transition-group": "^4.4.5"
|
|
32
33
|
},
|
|
33
|
-
"peerDependencies": {
|
|
34
|
-
"@sima-land/ui-nucleons": "^45.0.0-alpha.3",
|
|
35
|
-
"@sima-land/ui-quarks": "^3.6.0",
|
|
36
|
-
"react": ">=17",
|
|
37
|
-
"react-dom": ">=17"
|
|
38
|
-
},
|
|
39
34
|
"devDependencies": {
|
|
40
35
|
"@babel/core": "^7.20.12",
|
|
41
36
|
"@babel/preset-env": "^7.20.2",
|
|
42
37
|
"@babel/preset-react": "^7.18.6",
|
|
43
38
|
"@babel/preset-typescript": "^7.18.6",
|
|
44
39
|
"@rushstack/eslint-patch": "^1.2.0",
|
|
45
|
-
"@sima-land/linters": "^
|
|
46
|
-
"@storybook/addon-
|
|
47
|
-
"@storybook/addon-
|
|
48
|
-
"@storybook/addon-
|
|
49
|
-
"@storybook/addon-storysource": "^6.
|
|
50
|
-
"@storybook/addon-viewport": "^6.
|
|
51
|
-
"@storybook/
|
|
52
|
-
"@storybook/
|
|
53
|
-
"@storybook/
|
|
54
|
-
"@
|
|
55
|
-
"@svgr/core": "^6.5.1",
|
|
56
|
-
"@svgr/plugin-jsx": "^6.5.1",
|
|
57
|
-
"@svgr/plugin-svgo": "^6.5.1",
|
|
58
|
-
"@svgr/webpack": "^6.5.1",
|
|
59
|
-
"@testing-library/dom": "^9.2.0",
|
|
60
|
-
"@testing-library/react": "^12.1.0",
|
|
40
|
+
"@sima-land/linters": "^4.0.0",
|
|
41
|
+
"@storybook/addon-backgrounds": "^7.6.12",
|
|
42
|
+
"@storybook/addon-docs": "^7.6.12",
|
|
43
|
+
"@storybook/addon-mdx-gfm": "^7.6.12",
|
|
44
|
+
"@storybook/addon-storysource": "^7.6.12",
|
|
45
|
+
"@storybook/addon-viewport": "^7.6.12",
|
|
46
|
+
"@storybook/react": "^7.6.12",
|
|
47
|
+
"@storybook/react-webpack5": "^7.6.12",
|
|
48
|
+
"@storybook/theming": "^7.6.12",
|
|
49
|
+
"@testing-library/react": "^14.0.0",
|
|
61
50
|
"@testing-library/user-event": "^14.4.3",
|
|
62
|
-
"@types/
|
|
63
|
-
"@types/
|
|
64
|
-
"@types/lodash": "^4.14.191",
|
|
65
|
-
"@types/react-dom": "^17.0.18",
|
|
51
|
+
"@types/jest": "^29.5.4",
|
|
52
|
+
"@types/react": "^18.2.21",
|
|
66
53
|
"@types/react-transition-group": "^4.4.5",
|
|
67
|
-
"
|
|
68
|
-
"babel-jest": "^29.4.1",
|
|
54
|
+
"babel-jest": "^29.6.4",
|
|
69
55
|
"copyfiles": "^2.4.1",
|
|
70
56
|
"css-loader": "^6.7.3",
|
|
71
|
-
"enzyme": "^3.11.0",
|
|
72
|
-
"enzyme-to-json": "^3.4.4",
|
|
73
57
|
"eslint": "^8.33.0",
|
|
74
58
|
"husky": "^8.0.3",
|
|
75
|
-
"
|
|
76
|
-
"jest": "^
|
|
77
|
-
"jest-environment-jsdom": "^29.4
|
|
59
|
+
"jest": "^29.6.4",
|
|
60
|
+
"jest-css-modules-transform": "^4.4.2",
|
|
61
|
+
"jest-environment-jsdom": "^29.6.4",
|
|
78
62
|
"lint-staged": "^13.1.0",
|
|
79
|
-
"prettier": "^2.
|
|
80
|
-
"react": "^
|
|
63
|
+
"prettier": "^3.2.4",
|
|
64
|
+
"react": "^18.2.0",
|
|
81
65
|
"react-docgen-typescript": "^2.2.2",
|
|
82
|
-
"react-dom": "^17.0.2",
|
|
83
|
-
"rimraf": "^4.1.2",
|
|
84
66
|
"sass": "^1.58.0",
|
|
85
67
|
"sass-loader": "^13.2.0",
|
|
68
|
+
"storybook": "^7.6.12",
|
|
86
69
|
"style-loader": "^3.3.1",
|
|
87
|
-
"stylelint": "^
|
|
88
|
-
"typescript": "^
|
|
70
|
+
"stylelint": "^15.11.0",
|
|
71
|
+
"typescript": "^5.3.3",
|
|
89
72
|
"webpack": "^5.64.4"
|
|
73
|
+
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"@sima-land/ui-nucleons": "^45.0.0-alpha.14",
|
|
76
|
+
"@sima-land/ui-quarks": "^5.0.0",
|
|
77
|
+
"react": "^17.0 || ^18.0"
|
|
90
78
|
}
|
|
91
79
|
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
$badge-size: 20px;
|
|
2
|
-
$icon-size: 14px;
|
|
3
|
-
|
|
4
|
-
.root {
|
|
5
|
-
--badge-color: #aaa;
|
|
6
|
-
display: inline-flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
justify-content: center;
|
|
9
|
-
height: $badge-size;
|
|
10
|
-
color: var(--badge-color);
|
|
11
|
-
|
|
12
|
-
// используем border т.к. на Safari box-shadow пропадает при уменьшении масштаба
|
|
13
|
-
border: 1px solid var(--badge-color);
|
|
14
|
-
padding: 0 5px; // учитываем border
|
|
15
|
-
font-weight: bold;
|
|
16
|
-
font-size: 12px;
|
|
17
|
-
line-height: 16px;
|
|
18
|
-
max-width: 100%;
|
|
19
|
-
min-width: $badge-size;
|
|
20
|
-
text-decoration: none;
|
|
21
|
-
&.interactive:hover {
|
|
22
|
-
cursor: pointer;
|
|
23
|
-
opacity: 0.72;
|
|
24
|
-
}
|
|
25
|
-
&.icon-only {
|
|
26
|
-
width: $badge-size;
|
|
27
|
-
padding: 0;
|
|
28
|
-
}
|
|
29
|
-
.content {
|
|
30
|
-
overflow: hidden;
|
|
31
|
-
text-overflow: ellipsis;
|
|
32
|
-
white-space: nowrap;
|
|
33
|
-
}
|
|
34
|
-
.icon {
|
|
35
|
-
display: inline-block;
|
|
36
|
-
width: $icon-size;
|
|
37
|
-
height: $icon-size;
|
|
38
|
-
line-height: $icon-size;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React, { AnchorHTMLAttributes } from 'react';
|
|
2
|
-
import { InteractiveImageProps, InteractiveImageImageProps, InteractiveImagePointProps } from './types';
|
|
3
|
-
export declare const InteractiveImage: React.ForwardRefExoticComponent<InteractiveImageProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
-
/**
|
|
5
|
-
* Обертка-ссылка для картинки.
|
|
6
|
-
* @param props Свойства.
|
|
7
|
-
* @return Элемент.
|
|
8
|
-
*/
|
|
9
|
-
declare function ImageAnchor({ children, className, ...rest }: AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
10
|
-
export declare const Parts: {
|
|
11
|
-
readonly ImageAnchor: typeof ImageAnchor;
|
|
12
|
-
readonly Image: React.ForwardRefExoticComponent<InteractiveImageImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
13
|
-
readonly Point: React.ForwardRefExoticComponent<InteractiveImagePointProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
14
|
-
};
|
|
15
|
-
export {};
|
|
@@ -1,96 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.Parts = exports.InteractiveImage = void 0;
|
|
41
|
-
const react_1 = __importStar(require("react"));
|
|
42
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
43
|
-
const interactive_image_module_scss_1 = __importDefault(require("./interactive-image.module.scss"));
|
|
44
|
-
const cx = bind_1.default.bind(interactive_image_module_scss_1.default);
|
|
45
|
-
exports.InteractiveImage = (0, react_1.forwardRef)((_a, ref) => {
|
|
46
|
-
var { children, 'data-testid': testId, className, dotSize } = _a, rest = __rest(_a, ["children", 'data-testid', "className", "dotSize"]);
|
|
47
|
-
const rootClassName = cx('root', {
|
|
48
|
-
'dot-size-unset': dotSize === 'unset',
|
|
49
|
-
}, className);
|
|
50
|
-
validateChildren(children);
|
|
51
|
-
return (react_1.default.createElement("div", Object.assign({ ref: ref, className: rootClassName }, rest, { "data-testid": testId }), react_1.Children.toArray(children).filter(child => (0, react_1.isValidElement)(child) &&
|
|
52
|
-
(child.type === ImageAnchor || child.type === Image || child.type === Point))));
|
|
53
|
-
});
|
|
54
|
-
/**
|
|
55
|
-
* Проверка валидности содержимого, переданного в InteractiveImage.
|
|
56
|
-
* @param children Содержимое.
|
|
57
|
-
*/
|
|
58
|
-
function validateChildren(children) {
|
|
59
|
-
let counter = 0;
|
|
60
|
-
for (const child of react_1.Children.toArray(children)) {
|
|
61
|
-
if ((0, react_1.isValidElement)(child) && (child.type === ImageAnchor || child.type === Image)) {
|
|
62
|
-
counter++;
|
|
63
|
-
}
|
|
64
|
-
if (counter > 1) {
|
|
65
|
-
throw new Error('[InteractiveImage] Either Image or ImageAnchor allowed. Not both.');
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Обертка-ссылка для картинки.
|
|
71
|
-
* @param props Свойства.
|
|
72
|
-
* @return Элемент.
|
|
73
|
-
*/
|
|
74
|
-
function ImageAnchor(_a) {
|
|
75
|
-
var { children, className } = _a, rest = __rest(_a, ["children", "className"]);
|
|
76
|
-
return (react_1.default.createElement("a", Object.assign({}, rest, { className: cx('image-anchor', className), "data-testid": 'interactive-image:image-anchor' }), react_1.Children.toArray(children).filter(child => (0, react_1.isValidElement)(child) && child.type === Image)));
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Изображение на котором будут располагаться точки.
|
|
80
|
-
* @param props Свойства.
|
|
81
|
-
* @return Элемент.
|
|
82
|
-
*/
|
|
83
|
-
const Image = (0, react_1.forwardRef)((_a, ref) => {
|
|
84
|
-
var { className, 'data-testid': testId = 'interactive-image:image' } = _a, rest = __rest(_a, ["className", 'data-testid']);
|
|
85
|
-
return (react_1.default.createElement("img", Object.assign({ ref: ref, className: cx('image', className), "data-testid": testId }, rest)));
|
|
86
|
-
});
|
|
87
|
-
/**
|
|
88
|
-
* Точка которая будет располагаться на изображении.
|
|
89
|
-
* @param props Свойства.
|
|
90
|
-
* @return Элемент.
|
|
91
|
-
*/
|
|
92
|
-
const Point = (0, react_1.forwardRef)((_a, ref) => {
|
|
93
|
-
var { x, y, className, style, 'data-testid': testId = 'interactive-image:point' } = _a, rest = __rest(_a, ["x", "y", "className", "style", 'data-testid']);
|
|
94
|
-
return (react_1.default.createElement("a", Object.assign({ ref: ref, "aria-label": '\u0422\u043E\u0447\u043A\u0430 \u043D\u0430 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0438', "data-testid": testId, className: cx('point', className), style: Object.assign(Object.assign({}, style), { top: `${y}%`, left: `${x}%` }) }, rest)));
|
|
95
|
-
});
|
|
96
|
-
exports.Parts = { ImageAnchor, Image, Point };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path
|
|
3
|
-
d="M7.53601 1.54543C7.70396 1.12719 8.29603 1.12719 8.46398 1.54543L10.1755 5.80741L14.7577 6.11811C15.2074 6.1486 15.3904 6.71169 15.0445 7.00066L11.52 9.94542L12.6405 14.3994C12.7505 14.8365 12.2715 15.1845 11.8897 14.9449L7.99999 12.5028L4.11024 14.9449C3.72853 15.1845 3.24953 14.8365 3.35949 14.3994L4.47999 9.94542L0.955488 7.00067C0.609623 6.71169 0.792582 6.1486 1.24225 6.11811L5.82451 5.80741L7.53601 1.54543Z"
|
|
4
|
-
fill="#000" />
|
|
5
|
-
</svg>
|
package/common/constants.d.ts
DELETED
package/common/constants.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
<svg width="36" height="36" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd"
|
|
3
|
-
d="M106.163 37.2641H101.212V23.2372H87.1854V18.2862H101.212V4.2587H106.163V18.2862H120.191V23.2372H106.163V37.2641ZM70.2788 52.7828C71.5464 54.2213 73.8876 55.6569 77.3059 57.0961C80.3783 55.7891 82.5529 54.3858 83.831 52.8827C85.1099 51.3788 85.7497 49.6254 85.7497 47.6209C85.7497 45.4231 84.9714 43.6746 83.4134 42.3782C81.8561 41.0824 79.7118 40.4356 76.9846 40.4356C74.2968 40.4356 72.1918 41.088 70.6662 42.3943C69.1412 43.7006 68.3777 45.4442 68.3777 47.6209C68.3777 49.6254 69.0104 51.3472 70.2788 52.7828ZM69.0217 66.3583C67.5832 68.0449 66.8633 70.0648 66.8633 72.4166C66.8633 75.0306 67.759 77.0667 69.5532 78.5269C71.3467 79.9872 73.8658 80.7142 77.1119 80.7142C80.315 80.7142 82.8053 79.9549 84.5883 78.4299C86.3719 76.905 87.2655 74.8148 87.2655 72.1558C87.2655 70.0438 86.4282 68.1652 84.7507 66.5221C83.0739 64.8762 80.1526 63.2817 75.9848 61.7349C72.7824 63.1277 70.4616 64.6688 69.0217 66.3583ZM65.0585 54.0083C63.7698 52.039 63.1237 49.8328 63.1237 47.3917C63.1237 43.9298 64.3857 41.1689 66.9111 39.1103C69.4358 37.0524 72.814 36.0225 77.0479 36.0225C81.3464 36.0225 84.7507 37.0356 87.2655 39.0618C89.7797 41.088 91.0368 43.8869 91.0368 47.4592C91.0368 49.8117 90.3168 51.9553 88.8762 53.8951C87.4378 55.8327 85.1388 57.5967 81.9792 59.1863C85.8031 61.0368 88.5226 62.9822 90.1333 65.019C91.7469 67.0557 92.5519 69.4131 92.5519 72.0911C92.5519 76.0564 91.1858 79.2188 88.4586 81.5825C85.7286 83.9448 81.989 85.1273 77.2426 85.1273C72.2136 85.1273 68.3461 84.0094 65.6378 81.7786C62.9296 79.545 61.5762 76.3826 61.5762 72.2872C61.5762 66.8216 64.8645 62.5617 71.4395 59.5126C68.474 57.8154 66.3472 55.9804 65.0585 54.0083ZM62.0185 123.903C27.8404 123.903 0.133301 96.1964 0.133301 62.0183C0.133301 27.8402 27.8404 0.133118 62.0185 0.133118C69.2333 0.133118 76.1606 1.3677 82.5986 3.63789C82.6471 4.73608 82.6471 8.81386 82.6471 8.79698C76.2274 6.28845 69.3261 5.0841 62.0185 5.0841C30.5746 5.0841 5.08428 30.5744 5.08428 62.0183C5.08428 93.4621 30.5746 118.952 62.0185 118.952C93.4623 118.952 118.953 93.4621 118.953 62.0183C118.953 54.7296 117.583 47.7608 115.087 41.3552C117.817 41.3897 119.9 41.3897 120.38 41.3833C122.662 47.8368 123.904 54.7823 123.904 62.0183C123.904 96.1964 96.1966 123.903 62.0185 123.903ZM32.6789 50.2019L29.8434 46.4791L42.3165 36.7101H46.8273V84.4728H41.6071V50.4311C41.6071 47.5991 41.6922 44.9212 41.8651 42.3943C41.413 42.852 40.9082 43.3322 40.35 43.8335C39.7918 44.3341 37.2347 46.4573 32.6789 50.2019Z"
|
|
4
|
-
transform="matrix(0.2903226,0,0,0.2903226,0,0)" />
|
|
5
|
-
</svg>
|
package/common/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type ModifierType = 'text' | 'image' | 'color';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g opacity="0.3">
|
|
3
|
-
<mask id="path-1-inside-1" fill="white">
|
|
4
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 3H13V13H3L3 3ZM2 3C2 2.44772 2.44772 2 3 2H13C13.5523 2 14 2.44772 14 3V13C14 13.5523 13.5523 14 13 14H3C2.44772 14 2 13.5523 2 13V3ZM5.37964 6.17461C5.19993 5.96495 4.88428 5.94067 4.67461 6.12038C4.46495 6.30009 4.44067 6.61574 4.62038 6.8254L7.62038 10.3254C7.71537 10.4362 7.85405 10.5 8.00001 10.5C8.14597 10.5 8.28465 10.4362 8.37964 10.3254L11.3796 6.8254C11.5593 6.61574 11.5351 6.30009 11.3254 6.12038C11.1157 5.94067 10.8001 5.96495 10.6204 6.17461L8.00001 9.23171L5.37964 6.17461Z"/>
|
|
5
|
-
</mask>
|
|
6
|
-
<path d="M13 3H14V2H13V3ZM3 3V2H2L2 3H3ZM13 13V14H14V13H13ZM3 13H2L2 14H3V13ZM4.67461 6.12038L5.3254 6.87964L5.3254 6.87964L4.67461 6.12038ZM5.37964 6.17461L4.62038 6.8254H4.62038L5.37964 6.17461ZM4.62038 6.8254L5.37964 6.17461V6.17461L4.62038 6.8254ZM7.62038 10.3254L6.86112 10.9762L6.86113 10.9762L7.62038 10.3254ZM8.37964 10.3254L9.13889 10.9762L9.13889 10.9762L8.37964 10.3254ZM11.3796 6.8254L10.6204 6.17461L10.6204 6.17461L11.3796 6.8254ZM11.3254 6.12038L11.9762 5.36112L11.9762 5.36112L11.3254 6.12038ZM10.6204 6.17461L9.86112 5.52382L9.86112 5.52382L10.6204 6.17461ZM8.00001 9.23171L7.24075 9.8825L8.00001 10.7683L8.75927 9.8825L8.00001 9.23171ZM13 2H3V4H13V2ZM14 13V3H12V13H14ZM3 14H13V12H3V14ZM2 3L2 13H4L4 3H2ZM3 1C1.89543 1 1 1.89543 1 3H3V3V1ZM13 1H3V3H13V1ZM15 3C15 1.89543 14.1046 1 13 1V3H15ZM15 13V3H13V13H15ZM13 15C14.1046 15 15 14.1046 15 13H13V15ZM3 15H13V13H3V15ZM1 13C1 14.1046 1.89543 15 3 15V13H3H1ZM1 3V13H3V3H1ZM5.3254 6.87964C5.11574 7.05935 4.80009 7.03507 4.62038 6.8254L6.13889 5.52382C5.59976 4.89483 4.65281 4.82199 4.02382 5.36112L5.3254 6.87964ZM5.37964 6.17461C5.55935 6.38428 5.53507 6.69993 5.3254 6.87964L4.02382 5.36112C3.39483 5.90026 3.32199 6.84721 3.86112 7.4762L5.37964 6.17461ZM8.37964 9.67461L5.37964 6.17461L3.86112 7.4762L6.86112 10.9762L8.37964 9.67461ZM8.00001 9.50001C8.14597 9.50001 8.28465 9.56379 8.37963 9.67461L6.86113 10.9762C7.1461 11.3087 7.56212 11.5 8.00001 11.5V9.50001ZM7.62038 9.67461C7.71537 9.56379 7.85404 9.50001 8.00001 9.50001V11.5C8.4379 11.5 8.85392 11.3087 9.13889 10.9762L7.62038 9.67461ZM10.6204 6.17461L7.62038 9.67461L9.13889 10.9762L12.1389 7.4762L10.6204 6.17461ZM10.6746 6.87964C10.465 6.69993 10.4407 6.38428 10.6204 6.17461L12.1389 7.4762C12.678 6.84721 12.6052 5.90026 11.9762 5.36112L10.6746 6.87964ZM11.3796 6.82541C11.1999 7.03507 10.8843 7.05935 10.6746 6.87964L11.9762 5.36112C11.3472 4.82199 10.4003 4.89483 9.86112 5.52382L11.3796 6.82541ZM8.75927 9.8825L11.3796 6.8254L9.86112 5.52382L7.24075 8.58092L8.75927 9.8825ZM4.62038 6.8254L7.24075 9.8825L8.75927 8.58092L6.13889 5.52382L4.62038 6.8254Z" fill="#212121" mask="url(#path-1-inside-1)"/>
|
|
7
|
-
</g>
|
|
8
|
-
</svg>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M30.6299 17.8779C31.2041 17.0394 31.4912 15.7474 31.4912 14.002C31.4912 12.3158 31.195 11.0352 30.6025 10.1602C30.0146 9.28516 29.1442 8.84766 27.9912 8.84766C26.8063 8.84766 25.929 9.26693 25.3594 10.1055C24.7897 10.9395 24.5049 12.2383 24.5049 14.002C24.5049 15.6927 24.7965 16.971 25.3799 17.8369C25.9678 18.7028 26.8382 19.1357 27.9912 19.1357C29.1807 19.1357 30.0602 18.7165 30.6299 17.8779ZM26.918 16.6406C26.7083 16.1074 26.6035 15.2279 26.6035 14.002C26.6035 12.776 26.7106 11.8965 26.9248 11.3633C27.139 10.8255 27.4945 10.5566 27.9912 10.5566C28.4788 10.5566 28.832 10.8255 29.0508 11.3633C29.2741 11.8965 29.3857 12.776 29.3857 14.002C29.3857 15.2142 29.2764 16.0892 29.0576 16.627C28.8389 17.1647 28.4834 17.4336 27.9912 17.4336C27.4899 17.4336 27.1322 17.1693 26.918 16.6406ZM15.1602 11.2402C15.1602 11.8646 14.971 12.3955 14.5928 12.833C14.2145 13.2705 13.6836 13.5713 13 13.7354V13.7764C13.8066 13.8766 14.4173 14.1227 14.832 14.5146C15.2467 14.902 15.4541 15.4261 15.4541 16.0869C15.4541 17.0485 15.1055 17.7982 14.4082 18.3359C13.7109 18.8691 12.7152 19.1357 11.4209 19.1357C10.3363 19.1357 9.37467 18.9557 8.53613 18.5957V16.7979C8.9235 16.9938 9.34961 17.1533 9.81445 17.2764C10.2793 17.3994 10.7396 17.4609 11.1953 17.4609C11.8926 17.4609 12.4076 17.3424 12.7402 17.1055C13.0729 16.8685 13.2393 16.488 13.2393 15.9639C13.2393 15.4945 13.0479 15.1618 12.665 14.9658C12.2822 14.7699 11.6715 14.6719 10.833 14.6719H10.0742V13.0518H10.8467C11.6214 13.0518 12.1865 12.9515 12.542 12.751C12.902 12.5459 13.082 12.1973 13.082 11.7051C13.082 10.9486 12.6081 10.5703 11.6602 10.5703C11.332 10.5703 10.9971 10.625 10.6553 10.7344C10.318 10.8438 9.94206 11.0329 9.52734 11.3018L8.5498 9.8457C9.46126 9.18945 10.5482 8.86133 11.8105 8.86133C12.8451 8.86133 13.6608 9.07096 14.2578 9.49023C14.8594 9.90951 15.1602 10.4928 15.1602 11.2402ZM16.4932 14.7539C16.4932 12.776 16.9102 11.304 17.7441 10.3379C18.5827 9.37174 19.8359 8.88867 21.5039 8.88867C22.0736 8.88867 22.5202 8.92285 22.8438 8.99121V10.6797C22.4382 10.5885 22.0371 10.543 21.6406 10.543C20.916 10.543 20.3236 10.6523 19.8633 10.8711C19.4076 11.0898 19.0658 11.4134 18.8379 11.8418C18.61 12.2702 18.4756 12.8786 18.4346 13.667H18.5234C18.9746 12.8923 19.6969 12.5049 20.6904 12.5049C21.5837 12.5049 22.2832 12.7852 22.7891 13.3457C23.2949 13.9062 23.5479 14.681 23.5479 15.6699C23.5479 16.7363 23.2471 17.5817 22.6455 18.2061C22.0439 18.8258 21.21 19.1357 20.1436 19.1357C19.4053 19.1357 18.7604 18.9648 18.209 18.623C17.6621 18.2812 17.2383 17.7822 16.9375 17.126C16.6413 16.4697 16.4932 15.679 16.4932 14.7539ZM20.1025 17.4473C20.5537 17.4473 20.9001 17.2969 21.1416 16.9961C21.3831 16.6908 21.5039 16.2578 21.5039 15.6973C21.5039 15.2096 21.39 14.8268 21.1621 14.5488C20.9388 14.2663 20.5993 14.125 20.1436 14.125C19.7152 14.125 19.3483 14.264 19.043 14.542C18.7422 14.82 18.5918 15.1436 18.5918 15.5127C18.5918 16.055 18.7331 16.513 19.0156 16.8867C19.3027 17.2604 19.665 17.4473 20.1025 17.4473ZM35.0256 14.3057C34.5558 14.0154 33.9396 14.1609 33.6493 14.6307C33.359 15.1006 33.5045 15.7168 33.9744 16.0071C35.129 16.7206 35.8757 17.4576 36.3364 18.2063C36.7918 18.9464 37 19.7498 37 20.6564C37 22.3611 35.7489 24.1362 33.1873 25.6357C30.6608 27.1145 27.0642 28.1875 22.9164 28.5354C22.3661 28.5816 21.9573 29.0652 22.0035 29.6155C22.0497 30.1659 22.5332 30.5746 23.0836 30.5284C27.4489 30.1623 31.3523 29.0272 34.1976 27.3617C37.0076 25.7168 39 23.4111 39 20.6564C39 19.4197 38.709 18.2459 38.0398 17.1582C37.3759 16.0793 36.3726 15.1379 35.0256 14.3057ZM6.02565 16.3497C6.49548 16.0594 6.64101 15.4432 6.3507 14.9734C6.0604 14.5036 5.44419 14.358 4.97435 14.6483C3.66371 15.4582 2.65775 16.3004 1.98457 17.2919C1.29515 18.3073 1 19.4121 1 20.6564C1 23.4111 2.99235 25.7168 5.8024 27.3617C8.13368 28.7263 11.1753 29.7348 14.5993 30.2561L12.8534 31.7363C12.4321 32.0934 12.3801 32.7244 12.7372 33.1457C13.0943 33.567 13.7254 33.619 14.1466 33.2618L17.6467 30.2947C17.8491 30.1231 17.975 29.8781 17.9967 29.6136C18.0183 29.3492 17.934 29.0869 17.7623 28.8847L14.7623 25.3518C14.4048 24.9308 13.7737 24.8793 13.3527 25.2368C12.9317 25.5943 12.8803 26.2253 13.2377 26.6463L14.5814 28.2287C11.4916 27.7255 8.81581 26.8082 6.81275 25.6357C4.25108 24.1362 3 22.3611 3 20.6564C3 19.7574 3.20405 19.0563 3.63924 18.4153C4.09065 17.7504 4.83469 17.0856 6.02565 16.3497Z" />
|
|
3
|
-
</svg>
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M8 9C7.44772 9 7 9.44772 7 10V30C7 30.5523 7.44772 31 8 31H15C15.5523 31 16 30.5523 16 30V10C16 9.44772 15.5523 9 15 9H8ZM25 9C24.4477 9 24 9.44772 24 10V30C24 30.5523 24.4477 31 25 31H32C32.5523 31 33 30.5523 33 30V10C33 9.44772 32.5523 9 32 9H25Z" />
|
|
3
|
-
</svg>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g clip-path="url(#clip0)">
|
|
3
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 1C12 0.447715 11.5523 0 11 0H5C4.66818 0 4.35796 0.164599 4.17193 0.439371C3.9859 0.714144 3.94829 1.0633 4.07152 1.37139L6.07152 6.37139C6.27664 6.88417 6.85861 7.13359 7.37139 6.92848C7.88417 6.72336 8.13359 6.14139 7.92848 5.62861L6.77977 2.75684C8.7434 3.87987 9.99987 5.83881 9.99987 8C9.99987 10.8289 7.8471 13.3113 4.7735 14.026C4.23557 14.1511 3.9009 14.6886 4.02599 15.2265C4.15108 15.7644 4.68857 16.0991 5.2265 15.974C9.05366 15.084 11.9999 11.9068 11.9999 8C11.9999 5.60695 10.8944 3.4876 9.15822 2H11C11.5523 2 12 1.55228 12 1Z" fill="#C2C2C2"/>
|
|
4
|
-
</g>
|
|
5
|
-
<defs>
|
|
6
|
-
<clipPath id="clip0">
|
|
7
|
-
<rect width="16" height="16" fill="white"/>
|
|
8
|
-
</clipPath>
|
|
9
|
-
</defs>
|
|
10
|
-
</svg>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g clip-path="url(#clip0)">
|
|
3
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 1C4 0.447715 4.44772 0 5 0H11C11.3318 0 11.642 0.164599 11.8281 0.439371C12.0141 0.714144 12.0517 1.0633 11.9285 1.37139L9.92848 6.37139C9.72336 6.88417 9.14139 7.13359 8.62861 6.92848C8.11583 6.72336 7.86641 6.14139 8.07152 5.62861L9.22023 2.75684C7.2566 3.87987 6.00013 5.83881 6.00013 8C6.00013 10.8289 8.1529 13.3113 11.2265 14.026C11.7644 14.1511 12.0991 14.6886 11.974 15.2265C11.8489 15.7644 11.3114 16.0991 10.7735 15.974C6.94634 15.084 4.00013 11.9068 4.00013 8C4.00013 5.60695 5.10557 3.4876 6.84178 2H5C4.44772 2 4 1.55228 4 1Z" fill="#C2C2C2"/>
|
|
4
|
-
</g>
|
|
5
|
-
<defs>
|
|
6
|
-
<clipPath id="clip0">
|
|
7
|
-
<rect width="16" height="16" fill="white"/>
|
|
8
|
-
</clipPath>
|
|
9
|
-
</defs>
|
|
10
|
-
</svg>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties } from 'react';
|
|
2
|
-
import { ModifierType } from '../../../../common/types';
|
|
3
|
-
export interface Modifier {
|
|
4
|
-
count?: number;
|
|
5
|
-
content: string;
|
|
6
|
-
color?: string;
|
|
7
|
-
image?: string;
|
|
8
|
-
type?: ModifierType;
|
|
9
|
-
isMarkdown?: boolean;
|
|
10
|
-
selected?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface ModifierButtonProps extends Modifier {
|
|
13
|
-
className?: string;
|
|
14
|
-
style?: CSSProperties;
|
|
15
|
-
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
16
|
-
squared?: boolean;
|
|
17
|
-
'data-testid'?: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Компонент модификатора.
|
|
21
|
-
*/
|
|
22
|
-
export declare const ModifierButton: React.ForwardRefExoticComponent<ModifierButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.ModifierButton = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
|
-
const lodash_1 = require("lodash");
|
|
32
|
-
const modifier_button_module_scss_1 = __importDefault(require("./modifier-button.module.scss"));
|
|
33
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
34
|
-
const constants_1 = require("../../../../common/constants");
|
|
35
|
-
const cx = bind_1.default.bind(modifier_button_module_scss_1.default);
|
|
36
|
-
/**
|
|
37
|
-
* Компонент модификатора.
|
|
38
|
-
*/
|
|
39
|
-
exports.ModifierButton = (0, react_1.forwardRef)(function ModifierButton({ count = null, content, selected, color, image, type = 'text', className, style, onClick, isMarkdown: hasMarkdown, squared = [constants_1.MODIFIER_TYPE.color, constants_1.MODIFIER_TYPE.image].includes(type), 'data-testid': testId = 'modifier-button', }, ref) {
|
|
40
|
-
const hasCount = (0, lodash_1.isNumber)(count) && count >= 0;
|
|
41
|
-
return (react_1.default.createElement("div", { ref: ref, className: cx('modifier-button', squared && 'squared', selected && 'selected', className), style: color ? Object.assign(Object.assign({}, style), { background: color }) : style, onClick: onClick, "data-testid": testId },
|
|
42
|
-
(hasCount || hasMarkdown) && (react_1.default.createElement("span", { className: cx('label', hasCount && 'with-count'), "data-testid": 'modifier-button:badge' },
|
|
43
|
-
hasCount && (count > 99 ? '99+' : count),
|
|
44
|
-
hasMarkdown && (hasCount ? '(У)' : 'У'))),
|
|
45
|
-
[constants_1.MODIFIER_TYPE.text, constants_1.MODIFIER_TYPE.image].includes(type) && (react_1.default.createElement("div", { className: cx('content') },
|
|
46
|
-
type === constants_1.MODIFIER_TYPE.text && (react_1.default.createElement("span", { className: cx('text', !squared && 'guttered') }, String(content || ''))),
|
|
47
|
-
type === constants_1.MODIFIER_TYPE.image && react_1.default.createElement("img", { src: image, alt: content, className: cx('image') })))));
|
|
48
|
-
});
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
2
|
-
@import 'node_modules/@sima-land/ui-nucleons/styling/shadows.module';
|
|
3
|
-
@import '../modifiers';
|
|
4
|
-
|
|
5
|
-
.modifier-button {
|
|
6
|
-
max-width: 100%;
|
|
7
|
-
position: relative;
|
|
8
|
-
display: inline-block;
|
|
9
|
-
font-size: 0;
|
|
10
|
-
line-height: 0;
|
|
11
|
-
border-radius: 4px;
|
|
12
|
-
min-width: $minSize;
|
|
13
|
-
height: $minSize;
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
&.squared {
|
|
16
|
-
width: $minSize;
|
|
17
|
-
}
|
|
18
|
-
&::before {
|
|
19
|
-
content: '';
|
|
20
|
-
position: absolute;
|
|
21
|
-
top: 0;
|
|
22
|
-
left: 0;
|
|
23
|
-
width: 100%;
|
|
24
|
-
height: 100%;
|
|
25
|
-
border-radius: inherit;
|
|
26
|
-
box-shadow: inset 0 0 0 1px colors.$basic-gray12;
|
|
27
|
-
}
|
|
28
|
-
&:hover::before {
|
|
29
|
-
box-shadow: inset 0 0 0 2px colors.$basic-gray12;
|
|
30
|
-
}
|
|
31
|
-
&.selected::before {
|
|
32
|
-
box-shadow: inset 0 0 0 2px colors.$basic-blue;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.content {
|
|
37
|
-
display: flex;
|
|
38
|
-
align-items: center;
|
|
39
|
-
justify-content: center;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
border-radius: inherit;
|
|
42
|
-
height: 100%;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.image {
|
|
46
|
-
display: block;
|
|
47
|
-
width: auto;
|
|
48
|
-
height: calc(100% - 2px);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.text {
|
|
52
|
-
font-size: 14px;
|
|
53
|
-
line-height: 20px;
|
|
54
|
-
text-overflow: ellipsis;
|
|
55
|
-
white-space: nowrap;
|
|
56
|
-
overflow: hidden;
|
|
57
|
-
&.guttered {
|
|
58
|
-
margin: 0 16px;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.label {
|
|
63
|
-
position: absolute;
|
|
64
|
-
top: -4px;
|
|
65
|
-
right: -4px;
|
|
66
|
-
display: block;
|
|
67
|
-
min-width: 16px;
|
|
68
|
-
height: 16px;
|
|
69
|
-
text-align: center;
|
|
70
|
-
padding: 0 4px;
|
|
71
|
-
line-height: 16px;
|
|
72
|
-
border-radius: 32px;
|
|
73
|
-
background-color: #fff;
|
|
74
|
-
color: colors.$basic-gray54;
|
|
75
|
-
font-size: 12px;
|
|
76
|
-
font-weight: 500;
|
|
77
|
-
box-sizing: border-box;
|
|
78
|
-
&.with-count {
|
|
79
|
-
background-color: colors.$basic-blue;
|
|
80
|
-
color: #fff;
|
|
81
|
-
}
|
|
82
|
-
&:not(.with-count) {
|
|
83
|
-
@extend .shadow-z1;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
-
export interface ModifiersGroupProps {
|
|
3
|
-
/** Кнопки модификаторов. */
|
|
4
|
-
children?: ReactNode;
|
|
5
|
-
/** Надо ли сразу показывать весь список не ограничивая двумя строками. */
|
|
6
|
-
defaultOpened?: boolean;
|
|
7
|
-
/** Будет вызвана после нажатия на кнопку показа всех модификаторов. */
|
|
8
|
-
onShowAll?: MouseEventHandler<HTMLDivElement>;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Блок списка кнопок модификаторов.
|
|
12
|
-
* @param props Свойства.
|
|
13
|
-
* @return Элемент.
|
|
14
|
-
*/
|
|
15
|
-
export declare const ModifiersGroup: ({ children, defaultOpened, onShowAll, }: ModifiersGroupProps) => JSX.Element;
|
|
@@ -1,70 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.ModifiersGroup = void 0;
|
|
30
|
-
const react_1 = __importStar(require("react"));
|
|
31
|
-
const button_1 = require("../button");
|
|
32
|
-
const utils_1 = require("./utils");
|
|
33
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
34
|
-
const modifiers_group_module_scss_1 = __importDefault(require("./modifiers-group.module.scss"));
|
|
35
|
-
const cx = bind_1.default.bind(modifiers_group_module_scss_1.default);
|
|
36
|
-
/**
|
|
37
|
-
* Блок списка кнопок модификаторов.
|
|
38
|
-
* @param props Свойства.
|
|
39
|
-
* @return Элемент.
|
|
40
|
-
*/
|
|
41
|
-
const ModifiersGroup = ({ children, defaultOpened = false, onShowAll, }) => {
|
|
42
|
-
const [opened, setOpened] = (0, react_1.useState)(defaultOpened);
|
|
43
|
-
const rootRef = (0, react_1.useRef)(null);
|
|
44
|
-
const openerRef = (0, react_1.useRef)(null);
|
|
45
|
-
const showAll = (0, react_1.useCallback)(event => {
|
|
46
|
-
setOpened(true);
|
|
47
|
-
onShowAll === null || onShowAll === void 0 ? void 0 : onShowAll(event);
|
|
48
|
-
}, [onShowAll]);
|
|
49
|
-
const viewState = (0, utils_1.useViewState)(rootRef, openerRef);
|
|
50
|
-
const items = react_1.Children.toArray(children).reduce((result, child, index) => {
|
|
51
|
-
if ((0, react_1.isValidElement)(child) && child.type === button_1.ModifierButton) {
|
|
52
|
-
const needHideItems = viewState.lastVisibleIndex !== -1 && !opened;
|
|
53
|
-
const isDisplayed = !needHideItems || index < viewState.lastVisibleIndex;
|
|
54
|
-
result.push(react_1.default.createElement(GroupItem, { key: index, hidden: !isDisplayed }, child));
|
|
55
|
-
}
|
|
56
|
-
return result;
|
|
57
|
-
}, []);
|
|
58
|
-
return (react_1.default.createElement("div", { ref: rootRef, className: cx('root', { opened }) },
|
|
59
|
-
items,
|
|
60
|
-
!opened && (react_1.default.createElement(GroupItem, { ref: openerRef, invisible: viewState.lastVisibleIndex === -1 },
|
|
61
|
-
react_1.default.createElement(OpenButton, { count: items.length - viewState.lastVisibleIndex, onClick: showAll })))));
|
|
62
|
-
};
|
|
63
|
-
exports.ModifiersGroup = ModifiersGroup;
|
|
64
|
-
const GroupItem = (0, react_1.forwardRef)(({ children, hidden, invisible }, ref) => (react_1.default.createElement("div", { ref: ref, className: cx('item', { hidden, invisible }), "data-testid": 'modifier-group:item' }, children)));
|
|
65
|
-
/**
|
|
66
|
-
* Кнопка показа скрытых модификаторов.
|
|
67
|
-
* @param props Свойства.
|
|
68
|
-
* @return Элемент.
|
|
69
|
-
*/
|
|
70
|
-
const OpenButton = ({ count, onClick }) => (react_1.default.createElement(button_1.ModifierButton, { squared: true, onClick: onClick, content: `+${count}`, className: cx('opener'), "data-testid": 'modifier-group:show-all-button' }));
|