@sima-land/moleculas 12.2.1 → 12.3.3
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/common/components/adult-block/adult-block.d.ts +2 -2
- package/common/components/adult-block/adult-block.js +2 -2
- package/common/components/badge/badge.module.scss +1 -1
- package/common/components/badge/index.d.ts +4 -0
- package/common/components/badge/index.js +2 -6
- package/common/components/badge-list/badge-list.module.scss +0 -1
- package/common/components/badge-list/index.d.ts +6 -2
- package/common/components/badge-list/index.js +4 -2
- package/common/components/product-info/index.d.ts +5 -0
- package/common/components/product-info/index.js +5 -4
- package/common/components/product-info/product-info.module.scss +11 -1
- package/common/components/quick-view-button/index.js +1 -1
- package/common/components/wish-button/index.js +1 -1
- package/common/helpers/format-qty-string.js +1 -3
- package/common/helpers/get-contained-items.js +2 -1
- package/desktop/components/breadcrumbs/breadcrumbs.module.scss +2 -2
- package/desktop/components/breadcrumbs/index.d.ts +4 -0
- package/desktop/components/breadcrumbs/index.js +5 -5
- package/desktop/components/gallery-modal/components/all-round-view.js +13 -13
- package/desktop/components/gallery-modal/components/all-round-view.module.scss +1 -1
- package/desktop/components/gallery-modal/components/gallery-modal.d.ts +7 -0
- package/desktop/components/gallery-modal/components/gallery-modal.js +13 -12
- package/desktop/components/gallery-modal/components/image-overlay.js +1 -1
- package/desktop/components/gallery-modal/components/image-overlay.module.scss +1 -1
- package/desktop/components/gallery-modal/components/review-info.d.ts +1 -1
- package/desktop/components/gallery-modal/components/review-info.js +1 -1
- package/desktop/components/gallery-modal/components/thumbnail.d.ts +1 -1
- package/desktop/components/gallery-modal/components/thumbnail.js +3 -3
- package/desktop/components/gallery-modal/utils.d.ts +1 -1
- package/desktop/components/gallery-modal/utils.js +6 -6
- package/desktop/components/item-image/index.d.ts +1 -1
- package/desktop/components/item-image/index.js +8 -9
- package/desktop/components/item-image/item-image.module.scss +4 -4
- package/desktop/components/modifiers/button/index.js +4 -4
- package/desktop/components/modifiers/group/index.js +19 -18
- package/desktop/components/modifiers/widget/index.js +2 -2
- package/desktop/components/person-modal/index.d.ts +16 -14
- package/desktop/components/person-modal/index.js +5 -16
- package/desktop/components/product-card/index.d.ts +2 -0
- package/desktop/components/product-card/index.js +5 -5
- package/desktop/components/product-carousel/hover-card.js +4 -4
- package/desktop/components/product-carousel/index.d.ts +6 -0
- package/desktop/components/product-carousel/index.js +34 -33
- package/desktop/components/product-carousel/product-carousel.module.scss +1 -1
- package/desktop/components/product-carousel/utils.js +11 -11
- package/desktop/components/promotion-card/banner-title.js +7 -7
- package/desktop/components/promotion-card/estimate.js +4 -4
- package/desktop/components/promotion-card/index.d.ts +11 -1
- package/desktop/components/promotion-card/index.js +7 -7
- package/desktop/components/promotion-card/index.module.scss +2 -2
- package/desktop/components/promotion-card/placeholder.js +4 -4
- package/mobile/components/garland-calculator-button/garland-calculator-button.module.scss +1 -1
- package/mobile/components/item-image/index.d.ts +1 -1
- package/mobile/components/item-image/index.js +5 -7
- package/mobile/components/item-image/item-image.module.scss +3 -3
- package/mobile/components/modifiers-list/index.d.ts +1 -1
- package/mobile/components/modifiers-list/index.js +1 -1
- package/mobile/components/modifiers-list/modifier-item/index.js +7 -7
- package/mobile/components/modifiers-list/modifiers-list.module.scss +0 -1
- package/mobile/components/person-screen/index.d.ts +1 -1
- package/mobile/components/person-screen/index.js +3 -3
- package/mobile/components/person-screen/person-screen.module.scss +0 -1
- package/mobile/components/product-actions-alert/index.js +6 -5
- package/mobile/components/product-row/index.d.ts +1 -1
- package/mobile/components/product-row/index.js +19 -24
- package/mobile/components/product-row/product-row.module.scss +0 -1
- package/mobile/components/product-slider/index.d.ts +1 -1
- package/mobile/components/product-slider/index.js +7 -7
- package/mobile/components/product-slider/item.js +2 -2
- package/mobile/components/product-slider/utils.js +1 -1
- package/mobile/components/search-bar/index.d.ts +1 -1
- package/mobile/components/search-bar/index.js +31 -31
- package/mobile/components/search-bar/search-bar.module.scss +9 -3
- package/mobile/components/select-screen/index.js +5 -6
- package/package.json +39 -31
- package/README.md +0 -86
|
@@ -11,7 +11,7 @@ export interface AdultBlockProps {
|
|
|
11
11
|
* @param props.onClick Обработчик клика на ссылку.
|
|
12
12
|
* @param props.alignItems Расположение блоков.
|
|
13
13
|
* @param props.marginTop Отступ сверху.
|
|
14
|
-
* @return
|
|
14
|
+
* @return Элемент.
|
|
15
15
|
*/
|
|
16
|
-
declare const AdultBlock: ({ isAuthUser, onClick, marginTop
|
|
16
|
+
declare const AdultBlock: ({ isAuthUser, onClick, marginTop }: AdultBlockProps) => JSX.Element;
|
|
17
17
|
export default AdultBlock;
|
|
@@ -24,9 +24,9 @@ const textBlocks = {
|
|
|
24
24
|
* @param props.onClick Обработчик клика на ссылку.
|
|
25
25
|
* @param props.alignItems Расположение блоков.
|
|
26
26
|
* @param props.marginTop Отступ сверху.
|
|
27
|
-
* @return
|
|
27
|
+
* @return Элемент.
|
|
28
28
|
*/
|
|
29
|
-
const AdultBlock = ({ isAuthUser, onClick, marginTop = 0
|
|
29
|
+
const AdultBlock = ({ isAuthUser, onClick, marginTop = 0 }) => {
|
|
30
30
|
const actualTextBlocks = isAuthUser ? textBlocks.forAuthorized : textBlocks.forGuest;
|
|
31
31
|
return (react_1.default.createElement(box_1.Box, { display: 'flex', direction: 'column', flex: 'grow', marginTop: marginTop },
|
|
32
32
|
react_1.default.createElement(box_1.Box, { marginBottom: 1 },
|
|
@@ -4,9 +4,13 @@ export interface BadgeField {
|
|
|
4
4
|
value: string;
|
|
5
5
|
}
|
|
6
6
|
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
7
|
+
/** Основной цвет, используется как цвет обводки, иконок и текста. */
|
|
7
8
|
color?: string;
|
|
9
|
+
/** Содержимое шильдика. */
|
|
8
10
|
fields: Array<BadgeField>;
|
|
11
|
+
/** Ссылка, переход по которой будет произведён по нажатию на шильдик. */
|
|
9
12
|
href?: string;
|
|
13
|
+
/** Идентификатор для систем автоматизированного тестирования. */
|
|
10
14
|
'data-testid'?: string;
|
|
11
15
|
}
|
|
12
16
|
/**
|
|
@@ -32,8 +32,7 @@ const Badge = (_a) => {
|
|
|
32
32
|
var { className, color, fields, href, style, 'data-testid': testId = 'badge' } = _a, restProps = __rest(_a, ["className", "color", "fields", "href", "style", 'data-testid']);
|
|
33
33
|
const Element = href ? 'a' : 'span';
|
|
34
34
|
const iconOnly = fields.length === 1 && fields[0].type === 'svg-url';
|
|
35
|
-
return (react_1.default.createElement(Element, Object.assign({}, restProps, { "data-testid": testId, href: href, style: Object.assign(Object.assign({}, style), { '--badge-color': color }), className: cx('root', iconOnly && 'icon-only', href && 'interactive', className), children: iconOnly
|
|
36
|
-
? (react_1.default.createElement("img", { className: cx('icon'), src: fields[0].value })) : (
|
|
35
|
+
return (react_1.default.createElement(Element, Object.assign({}, restProps, { "data-testid": testId, href: href, style: Object.assign(Object.assign({}, style), { '--badge-color': color }), className: cx('root', iconOnly && 'icon-only', href && 'interactive', className), children: iconOnly ? (react_1.default.createElement("img", { className: cx('icon'), src: fields[0].value })) : (
|
|
37
36
|
// вложенный span нужен для того чтобы объединить `display: inline-flex` и `text-overflow: ellipsis`
|
|
38
37
|
react_1.default.createElement("span", { className: cx('content') }, fields.reduce((acc, item, i) => {
|
|
39
38
|
let result = null;
|
|
@@ -57,10 +56,7 @@ exports.Badge = Badge;
|
|
|
57
56
|
* @param distance Оставшееся время.
|
|
58
57
|
* @return Отформатированное время.
|
|
59
58
|
*/
|
|
60
|
-
const formatDistance = ({ days, hours, minutes, }) => [
|
|
61
|
-
toTimePart(days),
|
|
62
|
-
...[hours % 24, minutes % 60].map(toTimePart),
|
|
63
|
-
].join(':');
|
|
59
|
+
const formatDistance = ({ days, hours, minutes, }) => [toTimePart(days), ...[hours % 24, minutes % 60].map(toTimePart)].join(':');
|
|
64
60
|
/**
|
|
65
61
|
* Форматирует число добавляя нули при необходимости.
|
|
66
62
|
* @param n Число.
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BadgeProps } from '../badge';
|
|
3
3
|
export interface BadgeListProps {
|
|
4
|
+
/** Список данных для шильдиков. */
|
|
4
5
|
items?: BadgeProps[];
|
|
6
|
+
/** CSS-класс корневого элемента. */
|
|
5
7
|
className?: string;
|
|
8
|
+
/** Стили корневого элемента. */
|
|
6
9
|
style?: React.CSSProperties;
|
|
10
|
+
/** Лимит количества строк, не влезающие шильдики будут скрыты. */
|
|
7
11
|
lineLimit?: number;
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
|
-
* Компонент списка шильдиков.
|
|
14
|
+
* Компонент списка шильдиков. Формирует отступы между шильдиками и переносы по дизайн-найдам.
|
|
11
15
|
* @param props Свойства компонента.
|
|
12
16
|
* @return Элемент.
|
|
13
17
|
*/
|
|
14
18
|
export declare const BadgeList: {
|
|
15
|
-
({ items, className, lineLimit, style
|
|
19
|
+
({ items, className, lineLimit, style }: BadgeListProps): JSX.Element;
|
|
16
20
|
Item: ({ className, color, fields, href, style, "data-testid": testId, ...restProps }: BadgeProps) => JSX.Element;
|
|
17
21
|
};
|
|
@@ -10,10 +10,12 @@ const bind_1 = __importDefault(require("classnames/bind"));
|
|
|
10
10
|
const badge_list_module_scss_1 = __importDefault(require("./badge-list.module.scss"));
|
|
11
11
|
const cx = bind_1.default.bind(badge_list_module_scss_1.default);
|
|
12
12
|
/**
|
|
13
|
-
* Компонент списка шильдиков.
|
|
13
|
+
* Компонент списка шильдиков. Формирует отступы между шильдиками и переносы по дизайн-найдам.
|
|
14
14
|
* @param props Свойства компонента.
|
|
15
15
|
* @return Элемент.
|
|
16
16
|
*/
|
|
17
|
-
const BadgeList = ({ items, className, lineLimit, style
|
|
17
|
+
const BadgeList = ({ items, className, lineLimit, style }) => (react_1.default.createElement("div", { className: cx('root', className, lineLimit && 'line-limit'), style: lineLimit ? Object.assign(Object.assign({}, style), { '--line-limit': lineLimit }) : style }, Array.isArray(items) &&
|
|
18
|
+
items.length > 0 &&
|
|
19
|
+
items.map((itemProps, index) => react_1.default.createElement(badge_1.Badge, Object.assign({ key: index, className: cx('item') }, itemProps)))));
|
|
18
20
|
exports.BadgeList = BadgeList;
|
|
19
21
|
exports.BadgeList.Item = badge_1.Badge;
|
|
@@ -17,6 +17,11 @@ export interface ProductData {
|
|
|
17
17
|
currencyGrapheme?: string;
|
|
18
18
|
/** Список шильдиков. */
|
|
19
19
|
badges?: BadgeProps[];
|
|
20
|
+
/** Торговая марка. */
|
|
21
|
+
trademark?: {
|
|
22
|
+
name: string;
|
|
23
|
+
url: string;
|
|
24
|
+
};
|
|
20
25
|
}
|
|
21
26
|
export interface ProductInfoProps {
|
|
22
27
|
/** Данные товара. */
|
|
@@ -25,20 +25,21 @@ exports.OnImage = OnImage;
|
|
|
25
25
|
* @param props Свойства компонента.
|
|
26
26
|
* @return Элемент.
|
|
27
27
|
*/
|
|
28
|
-
const ProductInfo = ({ data, onLinkClick, children
|
|
29
|
-
const { onImage } = define_slots_1.defineSlots(children, {
|
|
28
|
+
const ProductInfo = ({ data, onLinkClick, children }) => {
|
|
29
|
+
const { onImage } = (0, define_slots_1.defineSlots)(children, {
|
|
30
30
|
onImage: exports.OnImage,
|
|
31
31
|
});
|
|
32
32
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
33
33
|
Boolean(data.imageSrc) && (react_1.default.createElement(image_overlay_1.ImageOverlay, { className: cx('image-overlay') },
|
|
34
34
|
react_1.default.createElement("a", { href: data.url, className: cx('image-link'), onClick: onLinkClick, "data-testid": 'product-info:image-link' },
|
|
35
35
|
react_1.default.createElement("img", { className: cx('image'), alt: data.imageAlt, src: data.imageSrc })),
|
|
36
|
-
onImage &&
|
|
36
|
+
onImage && react_1.default.createElement("div", { className: cx('on-image') }, onImage))),
|
|
37
37
|
data.badges && data.badges.length > 0 && (react_1.default.createElement(badge_list_1.BadgeList, { items: data.badges, lineLimit: 1, className: cx('badges') })),
|
|
38
38
|
Boolean(data.price) && (react_1.default.createElement("div", { className: cx('prices') },
|
|
39
39
|
react_1.default.createElement(price_1.Price, { value: data.price, currencyGrapheme: data.currencyGrapheme, className: cx('price') }),
|
|
40
40
|
data.oldPrice && (react_1.default.createElement(price_1.Price, { value: data.oldPrice, currencyGrapheme: data.currencyGrapheme, className: cx('old-price'), crossedOut: true })))),
|
|
41
|
-
react_1.default.createElement(link_1.Link, { onClick: onLinkClick, className: cx('link'), href: data.url, children: data.name, color: 'gray87', "data-testid": 'product-info:name-link' })
|
|
41
|
+
react_1.default.createElement(link_1.Link, { onClick: onLinkClick, className: cx('link'), href: data.url, children: data.name, color: 'gray87', "data-testid": 'product-info:name-link' }),
|
|
42
|
+
data.trademark && (react_1.default.createElement(link_1.Link, { className: cx('trademark-link'), href: data.trademark.url, children: data.trademark.name, color: 'brand-blue', "data-testid": 'product-info:trademark-link' }))));
|
|
42
43
|
};
|
|
43
44
|
exports.ProductInfo = ProductInfo;
|
|
44
45
|
exports.ProductInfo.OnImage = exports.OnImage;
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
.price {
|
|
62
62
|
font-size: 16px;
|
|
63
|
-
font-weight:
|
|
63
|
+
font-weight: 700;
|
|
64
64
|
line-height: 24px;
|
|
65
65
|
margin-right: 8px;
|
|
66
66
|
}
|
|
@@ -81,3 +81,13 @@
|
|
|
81
81
|
-webkit-line-clamp: 2;
|
|
82
82
|
-webkit-box-orient: vertical;
|
|
83
83
|
}
|
|
84
|
+
|
|
85
|
+
.trademark-link {
|
|
86
|
+
display: block;
|
|
87
|
+
margin-top: 8px;
|
|
88
|
+
font-size: 14px;
|
|
89
|
+
line-height: 20px;
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
text-overflow: ellipsis;
|
|
93
|
+
}
|
|
@@ -44,7 +44,7 @@ const cx = bind_1.default.bind(quick_view_button_module_scss_1.default);
|
|
|
44
44
|
* @param props Свойства компонента.
|
|
45
45
|
* @return Элемент.
|
|
46
46
|
*/
|
|
47
|
-
exports.QuickViewButton = react_1.forwardRef((_a, ref) => {
|
|
47
|
+
exports.QuickViewButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
48
48
|
var { onClick, className } = _a, restProps = __rest(_a, ["onClick", "className"]);
|
|
49
49
|
return (react_1.default.createElement(quick_view_svg_1.default, Object.assign({}, restProps, { ref: ref, role: 'button', "aria-label": '\u0411\u044B\u0441\u0442\u0440\u044B\u0439 \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440', className: cx('root', className), width: 24, height: 24, onClick: onClick, "data-testid": 'quick-view-button' })));
|
|
50
50
|
});
|
|
@@ -49,7 +49,7 @@ const cx = bind_1.default.bind(wish_button_module_scss_1.default);
|
|
|
49
49
|
* @param props.disabled Признак загрузки добавления товара в список избранного.
|
|
50
50
|
* @return Элемент.
|
|
51
51
|
*/
|
|
52
|
-
exports.WishButton = react_1.forwardRef((_a, ref) => {
|
|
52
|
+
exports.WishButton = (0, react_1.forwardRef)((_a, ref) => {
|
|
53
53
|
var { checked, className, onClick, disabled } = _a, restProps = __rest(_a, ["checked", "className", "onClick", "disabled"]);
|
|
54
54
|
const Icon = checked ? filled_heart_svg_1.default : heart_svg_1.default;
|
|
55
55
|
return (react_1.default.createElement(Icon, Object.assign({}, restProps, { ref: ref, role: 'button', "aria-label": checked ? 'Убрать из избранного' : 'Добавить в избранное', className: cx('button', className, { checked, disabled }), onClick: disabled ? undefined : onClick, "data-testid": 'favorite-button', width: 24, height: 24 })));
|
|
@@ -20,9 +20,7 @@ const formatQtyString = (qty = '', { allowFloat = false } = {}) => {
|
|
|
20
20
|
const isFloatWithoutDot = isFloatQty && nextQty.indexOf('.') === -1;
|
|
21
21
|
nextQty = isFloatWithoutDot ? `${nextQty}.` : nextQty;
|
|
22
22
|
const hasDotInEndOfFullStr = nextQty.indexOf('.') === nextQty.length - 1 && nextQty.length === 6;
|
|
23
|
-
nextQty = hasDotInEndOfFullStr
|
|
24
|
-
? nextQty.slice(0, nextQty.length - 1)
|
|
25
|
-
: nextQty;
|
|
23
|
+
nextQty = hasDotInEndOfFullStr ? nextQty.slice(0, nextQty.length - 1) : nextQty;
|
|
26
24
|
// если float режем до десятичной дроби.
|
|
27
25
|
nextQty = isFloatQty ? nextQty.slice(0, dotIndex + 2) : nextQty;
|
|
28
26
|
}
|
|
@@ -9,7 +9,8 @@ const getContainedItems = (node) => {
|
|
|
9
9
|
let count = 0;
|
|
10
10
|
if (node instanceof HTMLElement) {
|
|
11
11
|
const children = Array.from(node.childNodes);
|
|
12
|
-
const farItemIndex = children.findIndex((item, index, arr) => !arr[index + 1] ||
|
|
12
|
+
const farItemIndex = children.findIndex((item, index, arr) => !arr[index + 1] ||
|
|
13
|
+
item.getBoundingClientRect().right > arr[index + 1].getBoundingClientRect().right);
|
|
13
14
|
count = farItemIndex + 1;
|
|
14
15
|
}
|
|
15
16
|
return count;
|
|
@@ -82,7 +82,7 @@ $line-gutter: 12px;
|
|
|
82
82
|
|
|
83
83
|
.fade-enter-active {
|
|
84
84
|
opacity: 1;
|
|
85
|
-
transition: opacity .2s ease-in-out;
|
|
85
|
+
transition: opacity 0.2s ease-in-out;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
.fade-exit {
|
|
@@ -91,5 +91,5 @@ $line-gutter: 12px;
|
|
|
91
91
|
|
|
92
92
|
.fade-exit-active {
|
|
93
93
|
opacity: 0;
|
|
94
|
-
transition: opacity .2s ease-in-out;
|
|
94
|
+
transition: opacity 0.2s ease-in-out;
|
|
95
95
|
}
|
|
@@ -11,9 +11,13 @@ export interface Breadcrumb extends Sibling {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
export interface BreadcrumbsProps {
|
|
14
|
+
/** Список хлебных крошек. */
|
|
14
15
|
items: Breadcrumb[];
|
|
16
|
+
/** Получив хлебную крошку должна вернуть true если крошка выбрана. */
|
|
15
17
|
isSiblingActive?: (sibling: Sibling) => boolean;
|
|
18
|
+
/** Сработает при открытии попапа со смежными ссылками. */
|
|
16
19
|
onSiblingsPopupOpen?: (item: Breadcrumb) => void;
|
|
20
|
+
/** Идентификатор для систем автоматизированного тестирования. */
|
|
17
21
|
'data-testid'?: string;
|
|
18
22
|
}
|
|
19
23
|
/**
|
|
@@ -47,12 +47,12 @@ exports.Breadcrumbs = Breadcrumbs;
|
|
|
47
47
|
*/
|
|
48
48
|
const Breadcrumb = ({ data, onSiblingsPopupOpen, isSiblingActive, }) => {
|
|
49
49
|
var _a;
|
|
50
|
-
const popupRef = react_1.useRef(null);
|
|
51
|
-
const [withPopup, togglePopup] = react_1.useState(false);
|
|
50
|
+
const popupRef = (0, react_1.useRef)(null);
|
|
51
|
+
const [withPopup, togglePopup] = (0, react_1.useState)(false);
|
|
52
52
|
// с useOutsideClick не работает после обновления React до 17 версии, пока так
|
|
53
|
-
react_1.useEffect(() => {
|
|
53
|
+
(0, react_1.useEffect)(() => {
|
|
54
54
|
if (withPopup) {
|
|
55
|
-
return on_1.default(window, 'mousedown', togglePopup.bind(null, false));
|
|
55
|
+
return (0, on_1.default)(window, 'mousedown', togglePopup.bind(null, false));
|
|
56
56
|
}
|
|
57
57
|
}, [withPopup]);
|
|
58
58
|
const selfName = (react_1.default.createElement(link_1.Link, { color: 'gray87', href: data.url }, data.name));
|
|
@@ -74,6 +74,6 @@ const Breadcrumb = ({ data, onSiblingsPopupOpen, isSiblingActive, }) => {
|
|
|
74
74
|
selfName,
|
|
75
75
|
react_1.default.createElement(square_arrow_down_svg_1.default, { "data-testid": 'breadcrumb:siblings-closer', className: cx('toggle-icon', 'close'), onClick: () => togglePopup(false) })),
|
|
76
76
|
react_1.default.createElement("ul", { className: cx('siblings') },
|
|
77
|
-
data.siblings.state === 'fetching' && (react_1.default.createElement(react_1.default.Fragment, null, lodash_1.times(8).map(index => (react_1.default.createElement("div", { key: index, className: cx('sibling-placeholder') }))))),
|
|
77
|
+
data.siblings.state === 'fetching' && (react_1.default.createElement(react_1.default.Fragment, null, (0, lodash_1.times)(8).map(index => (react_1.default.createElement("div", { key: index, className: cx('sibling-placeholder') }))))),
|
|
78
78
|
data.siblings.state === 'ready' && (react_1.default.createElement(react_1.default.Fragment, null, (_a = data.siblings.data) === null || _a === void 0 ? void 0 : _a.map((sibling, index) => (react_1.default.createElement("li", { key: index, className: cx('sibling'), "data-testid": 'breadcrumb-sibling' }, isSiblingActive(sibling) ? (react_1.default.createElement("span", { className: cx('active') }, sibling.name)) : (react_1.default.createElement(link_1.Link, { color: 'gray87', className: cx('link'), href: sibling.url, children: sibling.name }))))))))))))));
|
|
79
79
|
};
|
|
@@ -36,16 +36,16 @@ const turn_left_svg_1 = __importDefault(require("../icons/turn-left.svg"));
|
|
|
36
36
|
const turn_right_svg_1 = __importDefault(require("../icons/turn-right.svg"));
|
|
37
37
|
const cx = bind_1.default.bind(all_round_view_module_scss_1.default);
|
|
38
38
|
const AllRoundView = ({ photos }) => {
|
|
39
|
-
const imageRef = react_1.useRef(null);
|
|
40
|
-
const dragStartRef = react_1.useRef(null);
|
|
41
|
-
const [state, setState] = react_1.useState('autoplay');
|
|
39
|
+
const imageRef = (0, react_1.useRef)(null);
|
|
40
|
+
const dragStartRef = (0, react_1.useRef)(null);
|
|
41
|
+
const [state, setState] = (0, react_1.useState)('autoplay');
|
|
42
42
|
const autoplay = state === 'autoplay';
|
|
43
43
|
const ChangeState = (bindState) => () => setState(bindState);
|
|
44
|
-
const [index, setIndex] = react_1.useState(0);
|
|
45
|
-
const indexRef = identity_1.useIdentityRef(index);
|
|
46
|
-
const photosReady = utils_1.useImagesLoad(photos);
|
|
44
|
+
const [index, setIndex] = (0, react_1.useState)(0);
|
|
45
|
+
const indexRef = (0, identity_1.useIdentityRef)(index);
|
|
46
|
+
const photosReady = (0, utils_1.useImagesLoad)(photos);
|
|
47
47
|
// запуск/остановка вращения
|
|
48
|
-
react_1.useEffect(() => {
|
|
48
|
+
(0, react_1.useEffect)(() => {
|
|
49
49
|
if (state !== 'default' && photosReady) {
|
|
50
50
|
const timerId = window.setInterval(() => {
|
|
51
51
|
const increment = state === 'turn-left' ? -1 : 1;
|
|
@@ -55,14 +55,14 @@ const AllRoundView = ({ photos }) => {
|
|
|
55
55
|
}
|
|
56
56
|
}, [state, photosReady]);
|
|
57
57
|
// перетаскивание
|
|
58
|
-
react_1.useEffect(() => {
|
|
58
|
+
(0, react_1.useEffect)(() => {
|
|
59
59
|
// переданное число всегда замениться на такое, которое будет в промежутке от 0 до количества фото
|
|
60
60
|
const wrap = (value) => (photos.length + value) % photos.length;
|
|
61
61
|
const image = imageRef.current;
|
|
62
62
|
const imageWidth = image.clientWidth;
|
|
63
63
|
const imageLeft = image.getBoundingClientRect().left;
|
|
64
64
|
const offList = [
|
|
65
|
-
on_1.default(image, 'pointerdown', e => {
|
|
65
|
+
(0, on_1.default)(image, 'pointerdown', e => {
|
|
66
66
|
e.preventDefault();
|
|
67
67
|
setState('default');
|
|
68
68
|
image.style.touchAction = 'none';
|
|
@@ -71,7 +71,7 @@ const AllRoundView = ({ photos }) => {
|
|
|
71
71
|
index: indexRef.current,
|
|
72
72
|
};
|
|
73
73
|
}),
|
|
74
|
-
on_1.default(window, 'pointermove', e => {
|
|
74
|
+
(0, on_1.default)(window, 'pointermove', e => {
|
|
75
75
|
if (dragStartRef.current !== null) {
|
|
76
76
|
const startX = dragStartRef.current.position;
|
|
77
77
|
const currentX = e.clientX - imageLeft;
|
|
@@ -81,7 +81,7 @@ const AllRoundView = ({ photos }) => {
|
|
|
81
81
|
setIndex(nextIndex);
|
|
82
82
|
}
|
|
83
83
|
}),
|
|
84
|
-
on_1.default(window, 'pointerup', () => {
|
|
84
|
+
(0, on_1.default)(window, 'pointerup', () => {
|
|
85
85
|
dragStartRef.current = null;
|
|
86
86
|
image.style.touchAction = '';
|
|
87
87
|
}),
|
|
@@ -100,9 +100,9 @@ const AllRoundView = ({ photos }) => {
|
|
|
100
100
|
react_1.default.createElement("button", { className: cx('control', 'turn'), disabled: autoplay, onPointerDown: ChangeState('turn-left'), onPointerUp: ChangeState('default'), onPointerLeave: ChangeState('default'), "data-testid": 'gallery-modal:360-turn-left-button' },
|
|
101
101
|
react_1.default.createElement(turn_right_svg_1.default, null)),
|
|
102
102
|
react_1.default.createElement(with_hint_1.WithHint, { hint: HINT }, (ref, toggleHint) => (react_1.default.createElement("button", { ref: ref, className: cx('control', 'primary', autoplay && 'pause'), onClick: () => {
|
|
103
|
-
setState(s => s === 'autoplay' ? 'default' : 'autoplay');
|
|
103
|
+
setState(s => (s === 'autoplay' ? 'default' : 'autoplay'));
|
|
104
104
|
toggleHint(false);
|
|
105
|
-
}, onMouseEnter: () => autoplay && toggleHint(true), onMouseLeave: () => toggleHint(false), "data-testid": 'gallery-modal:toggle-autoplay-button' }, autoplay ?
|
|
105
|
+
}, onMouseEnter: () => autoplay && toggleHint(true), onMouseLeave: () => toggleHint(false), "data-testid": 'gallery-modal:toggle-autoplay-button' }, autoplay ? react_1.default.createElement(pause_svg_1.default, null) : react_1.default.createElement(_360_svg_1.default, null)))),
|
|
106
106
|
react_1.default.createElement("button", { className: cx('control', 'turn'), disabled: autoplay, onPointerDown: ChangeState('turn-right'), onPointerUp: ChangeState('default'), onPointerLeave: ChangeState('default'), "data-testid": 'gallery-modal:360-turn-right-button' },
|
|
107
107
|
react_1.default.createElement(turn_left_svg_1.default, null)))));
|
|
108
108
|
};
|
|
@@ -2,15 +2,22 @@ import React from 'react';
|
|
|
2
2
|
import { MediaData } from '../types';
|
|
3
3
|
import { ModalProps } from '@sima-land/ui-nucleons/modal';
|
|
4
4
|
export interface GalleryModalProps extends Pick<ModalProps, 'withScrollDisable' | 'scrollDisableOptions'> {
|
|
5
|
+
/** Список медиа. */
|
|
5
6
|
media: MediaData[];
|
|
7
|
+
/** Индекс начального выбранного элемента из списка медиа. */
|
|
6
8
|
defaultMediaIndex?: number;
|
|
9
|
+
/** Будет вызвана при переключении элемента из списка медиа. */
|
|
7
10
|
onMediaChange?: (data: MediaData, index: number) => void;
|
|
11
|
+
/** Данные отзыва, выводятся внизу окна. */
|
|
8
12
|
review?: {
|
|
9
13
|
rating: number;
|
|
10
14
|
author: string;
|
|
11
15
|
};
|
|
16
|
+
/** Будет вызвана при попытке перейти к отзыву. */
|
|
12
17
|
onGoToReview?: () => void;
|
|
18
|
+
/** Будет вызвана при закрытии. */
|
|
13
19
|
onClose?: () => void;
|
|
20
|
+
/** Будет вызвана при событиях проигрывания видео. */
|
|
14
21
|
onVideoEvent?: (event: React.SyntheticEvent<HTMLVideoElement>) => void;
|
|
15
22
|
}
|
|
16
23
|
export declare const GalleryModal: ({ media, defaultMediaIndex, review, onClose, onGoToReview, onMediaChange, withScrollDisable, scrollDisableOptions, onVideoEvent, }: GalleryModalProps) => JSX.Element;
|
|
@@ -49,31 +49,32 @@ const bind_1 = __importDefault(require("classnames/bind"));
|
|
|
49
49
|
const gallery_modal_module_scss_1 = __importDefault(require("./gallery-modal.module.scss"));
|
|
50
50
|
const cx = bind_1.default.bind(gallery_modal_module_scss_1.default);
|
|
51
51
|
const GalleryModal = ({ media, defaultMediaIndex = 0, review, onClose, onGoToReview, onMediaChange, withScrollDisable, scrollDisableOptions, onVideoEvent, }) => {
|
|
52
|
-
const [currentIndex, setCurrent] = react_1.useState(defaultMediaIndex);
|
|
53
|
-
const thumbnailsRef = react_1.useRef(null);
|
|
54
|
-
const areaRef = react_1.useRef(null);
|
|
52
|
+
const [currentIndex, setCurrent] = (0, react_1.useState)(defaultMediaIndex);
|
|
53
|
+
const thumbnailsRef = (0, react_1.useRef)(null);
|
|
54
|
+
const areaRef = (0, react_1.useRef)(null);
|
|
55
55
|
const footerGutter = 40;
|
|
56
56
|
const footerHeight = 20;
|
|
57
57
|
const correction = review ? footerGutter + footerHeight : 0;
|
|
58
|
-
const size = utils_1.useRectFit(areaRef, { correction });
|
|
59
|
-
const innerStyles = Object.assign({}, size !== null && {
|
|
58
|
+
const size = (0, utils_1.useRectFit)(areaRef, { correction });
|
|
59
|
+
const innerStyles = Object.assign({}, (size !== null && {
|
|
60
60
|
'--area-height': `${size + correction}px`,
|
|
61
61
|
'--all-round-view-size': `${size}px`,
|
|
62
|
-
});
|
|
63
|
-
const handlerRef = identity_1.useIdentityRef(onMediaChange);
|
|
64
|
-
react_1.useEffect(() => {
|
|
62
|
+
}));
|
|
63
|
+
const handlerRef = (0, identity_1.useIdentityRef)(onMediaChange);
|
|
64
|
+
(0, react_1.useEffect)(() => {
|
|
65
65
|
var _a;
|
|
66
66
|
(_a = handlerRef.current) === null || _a === void 0 ? void 0 : _a.call(handlerRef, media[currentIndex], currentIndex);
|
|
67
|
-
thumbnailsRef.current &&
|
|
67
|
+
thumbnailsRef.current &&
|
|
68
|
+
(0, scroll_to_child_1.scrollToChild)(thumbnailsRef.current, thumbnailsRef.current.children[currentIndex]);
|
|
68
69
|
}, [currentIndex]);
|
|
69
70
|
return (react_1.default.createElement(modal_1.Modal, Object.assign({ size: 'fullscreen', onClose: onClose }, { withScrollDisable, scrollDisableOptions }),
|
|
70
71
|
react_1.default.createElement(modal_1.Modal.Header, { onClose: onClose }),
|
|
71
72
|
react_1.default.createElement(modal_1.Modal.Body, null,
|
|
72
73
|
react_1.default.createElement(layout_1.DesktopLayout, { className: cx('root'), style: innerStyles },
|
|
73
|
-
size !== null && media.length > 1 && (react_1.default.createElement("div", { className: cx('thumbnails'), ref: thumbnailsRef }, media.map((item, index) => (react_1.default.createElement(thumbnail_1.Thumbnail, Object.assign({ key: index, className: cx('thumbnail'), type: item.type, checked: index === currentIndex, onClick: () => setCurrent(index) }, item.type === 'image' && {
|
|
74
|
+
size !== null && media.length > 1 && (react_1.default.createElement("div", { className: cx('thumbnails'), ref: thumbnailsRef }, media.map((item, index) => (react_1.default.createElement(thumbnail_1.Thumbnail, Object.assign({ key: index, className: cx('thumbnail'), type: item.type, checked: index === currentIndex, onClick: () => setCurrent(index) }, (item.type === 'image' && {
|
|
74
75
|
src: item.data.thumbnailSrc,
|
|
75
76
|
alt: item.data.alt || '',
|
|
76
|
-
})))))),
|
|
77
|
+
}))))))),
|
|
77
78
|
react_1.default.createElement("div", { ref: areaRef, className: cx('area') }, size !== null && (react_1.default.createElement("div", { className: cx('inner'), style: { width: `${size}px` } },
|
|
78
79
|
react_1.default.createElement("div", { className: cx('square') },
|
|
79
80
|
react_1.default.createElement(Media, Object.assign({}, media[currentIndex], { onVideoEvent: onVideoEvent })),
|
|
@@ -90,5 +91,5 @@ const Media = (_a) => {
|
|
|
90
91
|
react_1.default.createElement("img", { src: media.data.src, alt: media.data.alt || '' }))),
|
|
91
92
|
media.type === 'video' && (react_1.default.createElement("video", { autoPlay: true, controls: true, controlsList: 'nodownload', onPlay: onVideoEvent, onPause: onVideoEvent, onEnded: onVideoEvent },
|
|
92
93
|
react_1.default.createElement("source", { src: media.data.src }))),
|
|
93
|
-
media.type === '360' &&
|
|
94
|
+
media.type === '360' && react_1.default.createElement(all_round_view_1.AllRoundView, { photos: media.data.photos })));
|
|
94
95
|
};
|
|
@@ -20,6 +20,6 @@ const classnames_1 = __importDefault(require("classnames"));
|
|
|
20
20
|
const image_overlay_module_scss_1 = __importDefault(require("./image-overlay.module.scss"));
|
|
21
21
|
const ImageOverlay = (_a) => {
|
|
22
22
|
var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
|
|
23
|
-
return (react_1.default.createElement("div", Object.assign({ className: classnames_1.default(image_overlay_module_scss_1.default.root, className) }, restProps), children));
|
|
23
|
+
return (react_1.default.createElement("div", Object.assign({ className: (0, classnames_1.default)(image_overlay_module_scss_1.default.root, className) }, restProps), children));
|
|
24
24
|
};
|
|
25
25
|
exports.ImageOverlay = ImageOverlay;
|
|
@@ -5,4 +5,4 @@ export interface ReviewInfoProps {
|
|
|
5
5
|
onGoToReview?: () => void;
|
|
6
6
|
className?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const ReviewInfo: ({ rating, author, onGoToReview, className
|
|
8
|
+
export declare const ReviewInfo: ({ rating, author, onGoToReview, className }: ReviewInfoProps) => JSX.Element;
|
|
@@ -9,7 +9,7 @@ const link_1 = require("@sima-land/ui-nucleons/link");
|
|
|
9
9
|
const rating_1 = require("@sima-land/ui-nucleons/rating");
|
|
10
10
|
const classnames_1 = __importDefault(require("classnames"));
|
|
11
11
|
const review_info_module_scss_1 = __importDefault(require("./review-info.module.scss"));
|
|
12
|
-
const ReviewInfo = ({ rating, author, onGoToReview, className
|
|
12
|
+
const ReviewInfo = ({ rating, author, onGoToReview, className }) => (react_1.default.createElement("div", { className: (0, classnames_1.default)(review_info_module_scss_1.default.root, className) },
|
|
13
13
|
react_1.default.createElement(rating_1.Rating, { value: rating }),
|
|
14
14
|
react_1.default.createElement("div", { className: review_info_module_scss_1.default.author }, author),
|
|
15
15
|
onGoToReview && (react_1.default.createElement(link_1.Link, { className: review_info_module_scss_1.default.link, pseudo: true, onClick: onGoToReview, "data-testid": 'gallery-modal:go-to-review-link' }, "\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u043E\u0442\u0437\u044B\u0432\u0443"))));
|
|
@@ -8,4 +8,4 @@ export interface ThumbnailProps {
|
|
|
8
8
|
onClick?: React.MouseEventHandler;
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const Thumbnail: ({ type, src, alt, checked, onClick, className
|
|
11
|
+
export declare const Thumbnail: ({ type, src, alt, checked, onClick, className }: ThumbnailProps) => JSX.Element;
|
|
@@ -11,9 +11,9 @@ const bind_1 = __importDefault(require("classnames/bind"));
|
|
|
11
11
|
const thumbnail_module_scss_1 = __importDefault(require("./thumbnail.module.scss"));
|
|
12
12
|
const _360_svg_1 = __importDefault(require("../icons/360.svg"));
|
|
13
13
|
const cx = bind_1.default.bind(thumbnail_module_scss_1.default);
|
|
14
|
-
const Thumbnail = ({ type, src, alt, checked, onClick, className
|
|
15
|
-
type === '360' &&
|
|
16
|
-
type === 'video' &&
|
|
14
|
+
const Thumbnail = ({ type, src, alt, checked, onClick, className }) => (react_1.default.createElement("button", { className: cx('root', type !== 'image' && 'iconic', checked && 'checked', className), onClick: onClick, "data-testid": 'gallery-modal:thumbnail' },
|
|
15
|
+
type === '360' && react_1.default.createElement(_360_svg_1.default, { fill: 'currentColor' }),
|
|
16
|
+
type === 'video' && react_1.default.createElement(play_1.default, { width: 32, height: 32, fill: 'currentColor' }),
|
|
17
17
|
src && (react_1.default.createElement(image_overlay_1.ImageOverlay, { className: cx('image-overlay') },
|
|
18
18
|
react_1.default.createElement("img", { src: src, alt: alt })))));
|
|
19
19
|
exports.Thumbnail = Thumbnail;
|
|
@@ -11,6 +11,6 @@ export declare const useImagesLoad: (srcList: string[]) => boolean;
|
|
|
11
11
|
* @param options Опции.
|
|
12
12
|
* @return Размер или null.
|
|
13
13
|
*/
|
|
14
|
-
export declare const useRectFit: (areaRef: React.RefObject<HTMLDivElement | null>, { correction
|
|
14
|
+
export declare const useRectFit: (areaRef: React.RefObject<HTMLDivElement | null>, { correction }: {
|
|
15
15
|
correction: number;
|
|
16
16
|
}) => number | null;
|
|
@@ -12,8 +12,8 @@ const on_1 = __importDefault(require("@sima-land/ui-nucleons/helpers/on"));
|
|
|
12
12
|
* @return Загружены ли все фото.
|
|
13
13
|
*/
|
|
14
14
|
const useImagesLoad = (srcList) => {
|
|
15
|
-
const [loadedCount, setLoadedCount] = react_1.useState(0);
|
|
16
|
-
react_1.useEffect(() => {
|
|
15
|
+
const [loadedCount, setLoadedCount] = (0, react_1.useState)(0);
|
|
16
|
+
(0, react_1.useEffect)(() => {
|
|
17
17
|
srcList.forEach(src => {
|
|
18
18
|
const image = new Image();
|
|
19
19
|
image.onload = () => setLoadedCount(c => c + 1);
|
|
@@ -30,9 +30,9 @@ exports.useImagesLoad = useImagesLoad;
|
|
|
30
30
|
* @param options Опции.
|
|
31
31
|
* @return Размер или null.
|
|
32
32
|
*/
|
|
33
|
-
const useRectFit = (areaRef, { correction
|
|
34
|
-
const [size, setSize] = react_1.useState(null);
|
|
35
|
-
react_1.useEffect(() => {
|
|
33
|
+
const useRectFit = (areaRef, { correction }) => {
|
|
34
|
+
const [size, setSize] = (0, react_1.useState)(null);
|
|
35
|
+
(0, react_1.useEffect)(() => {
|
|
36
36
|
const calcSquareSize = () => {
|
|
37
37
|
if (areaRef.current) {
|
|
38
38
|
const availWidth = areaRef.current.clientWidth;
|
|
@@ -46,7 +46,7 @@ const useRectFit = (areaRef, { correction, }) => {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
calcSquareSize();
|
|
49
|
-
return on_1.default(window, 'resize', () => window.requestAnimationFrame(calcSquareSize));
|
|
49
|
+
return (0, on_1.default)(window, 'resize', () => window.requestAnimationFrame(calcSquareSize));
|
|
50
50
|
}, [areaRef]);
|
|
51
51
|
return size;
|
|
52
52
|
};
|
|
@@ -80,7 +80,7 @@ export default class ItemImage extends Component<ItemImageProps, any> {
|
|
|
80
80
|
* @param {Function} onClick Колбэк на клик по изображению.
|
|
81
81
|
* @return {Object} Свойства для компонента.
|
|
82
82
|
*/
|
|
83
|
-
getImage: ({ src, alt
|
|
83
|
+
getImage: ({ src, alt }: any, onClick: any) => JSX.Element;
|
|
84
84
|
/**
|
|
85
85
|
* @inheritdoc
|
|
86
86
|
*/
|
|
@@ -25,7 +25,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
25
|
const react_1 = __importStar(require("react"));
|
|
26
26
|
const link_1 = require("@sima-land/ui-nucleons/link");
|
|
27
27
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
28
|
-
const
|
|
28
|
+
const lodash_1 = require("lodash");
|
|
29
29
|
const item_image_module_scss_1 = __importDefault(require("./item-image.module.scss"));
|
|
30
30
|
const badge_list_1 = require("../../../common/components/badge-list");
|
|
31
31
|
const eighteen_plus_svg_1 = __importDefault(require("../../../common/icons/eighteen-plus.svg"));
|
|
@@ -84,12 +84,12 @@ class ItemImage extends react_1.Component {
|
|
|
84
84
|
* @param {Function} onClick Колбэк на клик по изображению.
|
|
85
85
|
* @return {Object} Свойства для компонента.
|
|
86
86
|
*/
|
|
87
|
-
this.getImage = ({ src, alt
|
|
87
|
+
this.getImage = ({ src, alt }, onClick) => (react_1.default.createElement("img", { className: cx('image'), src: src, alt: alt, ref: this.image, onClick: onClick }));
|
|
88
88
|
this.state = {
|
|
89
89
|
currentPhotoIndex: null,
|
|
90
90
|
};
|
|
91
|
-
this.image = react_1.createRef();
|
|
92
|
-
this.imageWrapper = react_1.createRef();
|
|
91
|
+
this.image = (0, react_1.createRef)();
|
|
92
|
+
this.imageWrapper = (0, react_1.createRef)();
|
|
93
93
|
this.bootStartTime = Date.now();
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
@@ -98,7 +98,7 @@ class ItemImage extends react_1.Component {
|
|
|
98
98
|
componentDidMount() {
|
|
99
99
|
const img = this.image.current;
|
|
100
100
|
const { onLoadImage } = this.props;
|
|
101
|
-
if (img && img.complete &&
|
|
101
|
+
if (img && img.complete && (0, lodash_1.isFunction)(onLoadImage)) {
|
|
102
102
|
onLoadImage(Date.now() - this.bootStartTime);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -120,15 +120,14 @@ class ItemImage extends react_1.Component {
|
|
|
120
120
|
left: (this.imageWrapper.current.offsetWidth / photos.length) * index,
|
|
121
121
|
}, key: index + 100, onMouseOver: () => this.setState({ currentPhotoIndex: index }) },
|
|
122
122
|
react_1.default.createElement("div", { className: cx('fake-hover-label') })))))),
|
|
123
|
-
withBlur
|
|
124
|
-
? (react_1.default.createElement("div", { className: cx('with-filter-blur'), children: this.getImage({ src: currentPhoto, alt }, onClick) })) : this.getImage({ src: currentPhoto, alt }, onClick)),
|
|
123
|
+
withBlur ? (react_1.default.createElement("div", { className: cx('with-filter-blur'), children: this.getImage({ src: currentPhoto, alt }, onClick) })) : (this.getImage({ src: currentPhoto, alt }, onClick))),
|
|
125
124
|
hasTrashButton && (react_1.default.createElement(trash_cart_svg_1.default, { width: 24, height: 24, color: 'gray87', className: cx('icon', buttonsPos, trashButtonProps.className), onClick: trashButtonProps.onClick, "data-testid": 'item-image:remove-button' }))),
|
|
126
125
|
Array.isArray(badges) && Boolean(badges.length) && (react_1.default.createElement("div", { className: cx('badges') },
|
|
127
126
|
react_1.default.createElement(badge_list_1.BadgeList, { items: badges }))),
|
|
128
127
|
hasWishButton && (react_1.default.createElement(wish_button_1.WishButton, { checked: wishProps.isWished, className: cx('icon', buttonsPos, hasTrashButton && 'as-second', wishProps.className), onClick: wishProps.onClick, disabled: isFetchingWishItems })),
|
|
129
|
-
hasQuickPreview && (react_1.default.createElement(quick_view_button_1.QuickViewButton, { onClick: quickViewBtnProps.onClick, className: cx('icon', buttonsPos, (hasTrashButton || hasWishButton) && 'as-second',
|
|
128
|
+
hasQuickPreview && (react_1.default.createElement(quick_view_button_1.QuickViewButton, { onClick: quickViewBtnProps.onClick, className: cx('icon', buttonsPos, (hasTrashButton || hasWishButton) && 'as-second', hasTrashButton && hasWishButton && 'as-third', quickViewBtnProps.className) })),
|
|
130
129
|
hasSelectionButton && selectionProps && (react_1.default.createElement("div", { onClick: selectionProps.onSelect, className: cx('selection-container') },
|
|
131
|
-
react_1.default.createElement("div", { className: cx('selection-circle') }, selectionProps.isSelected &&
|
|
130
|
+
react_1.default.createElement("div", { className: cx('selection-circle') }, selectionProps.isSelected && react_1.default.createElement(selected_svg_1.default, { width: 56, height: 56 }))))));
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
133
|
exports.default = ItemImage;
|