@sima-land/moleculas 15.6.0 → 16.0.0-alpha.0
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/badge/index.js +5 -1
- package/common/components/badge-list/index.d.ts +5 -0
- package/common/components/badge-list/index.js +10 -1
- package/common/components/intractive-image/interactive-image.d.ts +5 -0
- package/common/components/intractive-image/interactive-image.js +24 -1
- package/common/components/product-info/index.d.ts +5 -0
- package/common/components/product-info/index.js +5 -0
- package/common/components/product-info/parts.d.ts +11 -1
- package/common/components/product-info/parts.js +17 -2
- package/common/components/rating-counter/index.d.ts +2 -2
- package/common/types.d.ts +1 -1
- package/desktop/components/breadcrumbs/index.js +5 -1
- package/desktop/components/gallery-modal/components/all-round-view.d.ts +5 -0
- package/desktop/components/gallery-modal/components/all-round-view.js +12 -1
- package/desktop/components/gallery-modal/components/gallery-modal.d.ts +5 -0
- package/desktop/components/gallery-modal/components/gallery-modal.js +15 -1
- package/desktop/components/gallery-modal/components/gallery-modal.module.scss +3 -3
- package/desktop/components/gallery-modal/components/image-overlay.d.ts +6 -1
- package/desktop/components/gallery-modal/components/image-overlay.js +5 -0
- package/desktop/components/gallery-modal/components/review-info.d.ts +5 -0
- package/desktop/components/gallery-modal/components/review-info.js +19 -1
- package/desktop/components/gallery-modal/components/thumbnail.d.ts +5 -0
- package/desktop/components/gallery-modal/components/thumbnail.js +5 -0
- package/desktop/components/gallery-modal/types.d.ts +2 -2
- package/desktop/components/gallery-modal/utils.js +3 -2
- package/desktop/components/modifiers/button/index.js +5 -1
- package/desktop/components/modifiers/group/index.js +10 -1
- package/desktop/components/{person-modal → person-info}/index.d.ts +6 -3
- package/desktop/components/person-info/index.js +46 -0
- package/desktop/components/{person-modal/person-modal.module.scss → person-info/person-info.module.scss} +0 -0
- package/desktop/components/product-card/index.d.ts +11 -1
- package/desktop/components/product-card/index.js +15 -1
- package/desktop/components/product-carousel/hover-card.js +5 -1
- package/desktop/components/product-carousel/index.d.ts +1 -1
- package/desktop/components/product-carousel/index.js +22 -4
- package/desktop/components/product-carousel/utils.d.ts +1 -1
- package/desktop/components/promotion-card/banner-title.d.ts +10 -0
- package/desktop/components/promotion-card/banner-title.js +19 -0
- package/desktop/components/promotion-card/estimate.d.ts +5 -0
- package/desktop/components/promotion-card/estimate.js +10 -0
- package/desktop/components/promotion-card/index.js +5 -1
- package/desktop/components/promotion-card/types.d.ts +1 -1
- package/mobile/components/action-circles/action-circles.module.scss +60 -0
- package/mobile/components/action-circles/index.d.ts +22 -0
- package/mobile/components/action-circles/index.js +32 -0
- package/mobile/components/action-list/action-list.module.scss +60 -0
- package/mobile/components/action-list/index.d.ts +23 -0
- package/mobile/components/action-list/index.js +36 -0
- package/mobile/components/breadcrumbs/index.d.ts +5 -0
- package/mobile/components/breadcrumbs/index.js +5 -0
- package/mobile/components/modifiers-list/index.d.ts +9 -9
- package/mobile/components/modifiers-list/index.js +1 -7
- package/mobile/components/modifiers-list/modifier-item/index.d.ts +2 -2
- package/mobile/components/person-info/index.d.ts +44 -0
- package/mobile/components/person-info/index.js +57 -0
- package/mobile/components/{person-screen/person-screen.module.scss → person-info/person-info.module.scss} +0 -0
- package/mobile/components/product-row/index.d.ts +30 -30
- package/mobile/components/product-row/index.js +40 -51
- 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 +5 -1
- package/mobile/components/search-bar/index.d.ts +1 -1
- package/mobile/components/search-bar/index.js +13 -8
- package/mobile/components/select-screen/index.d.ts +9 -25
- package/mobile/components/select-screen/index.js +14 -35
- package/package.json +47 -43
- package/common/components/adult-block/index.d.ts +0 -16
- package/common/components/adult-block/index.js +0 -40
- package/common/components/quick-view-button/index.d.ts +0 -8
- package/common/components/quick-view-button/index.js +0 -50
- package/common/components/quick-view-button/quick-view-button.module.scss +0 -12
- package/common/components/wish-button/index.d.ts +0 -15
- package/common/components/wish-button/index.js +0 -56
- package/common/components/wish-button/wish-button.module.scss +0 -17
- package/common/helpers/clean-num-string.d.ts +0 -6
- package/common/helpers/clean-num-string.js +0 -13
- package/common/helpers/format-qty-string.d.ts +0 -11
- package/common/helpers/format-qty-string.js +0 -29
- package/common/icons/filled-heart.svg +0 -3
- package/common/icons/heart.svg +0 -3
- package/common/icons/quick-view.svg +0 -3
- package/common/icons/selected.svg +0 -1
- package/common/icons/trash-cart.svg +0 -4
- package/desktop/components/person-modal/index.js +0 -55
- package/mobile/components/garland-calculator-button/garland-calculator-button.module.scss +0 -33
- package/mobile/components/garland-calculator-button/index.d.ts +0 -13
- package/mobile/components/garland-calculator-button/index.js +0 -24
- package/mobile/components/person-screen/index.d.ts +0 -45
- package/mobile/components/person-screen/index.js +0 -80
- package/mobile/components/product-actions-alert/index.d.ts +0 -18
- package/mobile/components/product-actions-alert/index.js +0 -25
- package/mobile/components/product-actions-alert/product-actions-alert.module.scss +0 -36
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -18,6 +18,11 @@ export declare const BadgeList: {
|
|
|
18
18
|
({ children, className, lineLimit, style }: BadgeListProps): JSX.Element;
|
|
19
19
|
Slot: typeof BadgeListSlot;
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Слот для вывода Badge с произвольной оберткой.
|
|
23
|
+
* @param props Свойства.
|
|
24
|
+
* @return Элемент.
|
|
25
|
+
*/
|
|
21
26
|
declare function BadgeListSlot({ children }: {
|
|
22
27
|
children?: ReactNode;
|
|
23
28
|
}): JSX.Element;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -44,6 +48,11 @@ const BadgeList = ({ children, className, lineLimit, style }) => (react_1.defaul
|
|
|
44
48
|
}
|
|
45
49
|
})));
|
|
46
50
|
exports.BadgeList = BadgeList;
|
|
51
|
+
/**
|
|
52
|
+
* Слот для вывода Badge с произвольной оберткой.
|
|
53
|
+
* @param props Свойства.
|
|
54
|
+
* @return Элемент.
|
|
55
|
+
*/
|
|
47
56
|
function BadgeListSlot({ children }) {
|
|
48
57
|
return react_1.default.createElement("div", { className: cx('item') }, children);
|
|
49
58
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React, { AnchorHTMLAttributes } from 'react';
|
|
2
2
|
import { InteractiveImageProps, InteractiveImageImageProps, InteractiveImagePointProps } from './types';
|
|
3
3
|
export declare const InteractiveImage: React.ForwardRefExoticComponent<InteractiveImageProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
/**
|
|
5
|
+
* Обертка-ссылка для картинки.
|
|
6
|
+
* @param props Свойства.
|
|
7
|
+
* @return Элемент.
|
|
8
|
+
*/
|
|
4
9
|
declare function ImageAnchor({ children, className, ...rest }: AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
5
10
|
export declare const Parts: {
|
|
6
11
|
readonly ImageAnchor: typeof ImageAnchor;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -47,6 +51,10 @@ exports.InteractiveImage = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
47
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) &&
|
|
48
52
|
(child.type === ImageAnchor || child.type === Image || child.type === Point))));
|
|
49
53
|
});
|
|
54
|
+
/**
|
|
55
|
+
* Проверка валидности содержимого, переданного в InteractiveImage.
|
|
56
|
+
* @param children Содержимое.
|
|
57
|
+
*/
|
|
50
58
|
function validateChildren(children) {
|
|
51
59
|
let counter = 0;
|
|
52
60
|
for (const child of react_1.Children.toArray(children)) {
|
|
@@ -58,14 +66,29 @@ function validateChildren(children) {
|
|
|
58
66
|
}
|
|
59
67
|
}
|
|
60
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Обертка-ссылка для картинки.
|
|
71
|
+
* @param props Свойства.
|
|
72
|
+
* @return Элемент.
|
|
73
|
+
*/
|
|
61
74
|
function ImageAnchor(_a) {
|
|
62
75
|
var { children, className } = _a, rest = __rest(_a, ["children", "className"]);
|
|
63
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)));
|
|
64
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Изображение на котором будут располагаться точки.
|
|
80
|
+
* @param props Свойства.
|
|
81
|
+
* @return Элемент.
|
|
82
|
+
*/
|
|
65
83
|
const Image = (0, react_1.forwardRef)((_a, ref) => {
|
|
66
84
|
var { className, 'data-testid': testId = 'interactive-image:image' } = _a, rest = __rest(_a, ["className", 'data-testid']);
|
|
67
85
|
return (react_1.default.createElement("img", Object.assign({ ref: ref, className: cx('image', className), "data-testid": testId }, rest)));
|
|
68
86
|
});
|
|
87
|
+
/**
|
|
88
|
+
* Точка которая будет располагаться на изображении.
|
|
89
|
+
* @param props Свойства.
|
|
90
|
+
* @return Элемент.
|
|
91
|
+
*/
|
|
69
92
|
const Point = (0, react_1.forwardRef)((_a, ref) => {
|
|
70
93
|
var { x, y, className, style, 'data-testid': testId = 'interactive-image:point' } = _a, rest = __rest(_a, ["x", "y", "className", "style", 'data-testid']);
|
|
71
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)));
|
|
@@ -7,5 +7,10 @@ export declare const UNAVAILABLE_REASON: {
|
|
|
7
7
|
readonly unavailableInRegion: "Товар недоступен в вашем регионе";
|
|
8
8
|
readonly onlyForLegalEntities: "Товар доступен только для юридических лиц";
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Блок информации о товаре по дизайн-гайдам.
|
|
12
|
+
* @param props Свойства.
|
|
13
|
+
* @return Элемент.
|
|
14
|
+
*/
|
|
10
15
|
export declare const ProductInfo: ({ restriction, children }: ProductInfoProps) => JSX.Element;
|
|
11
16
|
export { Parts };
|
|
@@ -14,6 +14,11 @@ exports.UNAVAILABLE_REASON = {
|
|
|
14
14
|
unavailableInRegion: 'Товар недоступен в вашем регионе',
|
|
15
15
|
onlyForLegalEntities: 'Товар доступен только для юридических лиц',
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Блок информации о товаре по дизайн-гайдам.
|
|
19
|
+
* @param props Свойства.
|
|
20
|
+
* @return Элемент.
|
|
21
|
+
*/
|
|
17
22
|
const ProductInfo = ({ restriction, children }) => {
|
|
18
23
|
const { image, badges, prices, title, trademark, footer, secondaryInfo, ratingCounter } = (0, define_slots_1.defineSlots)(children, {
|
|
19
24
|
image: parts_1.Parts.Image,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { LinkProps } from '@sima-land/ui-nucleons/link';
|
|
3
|
-
import { HintProps } from '@sima-land/ui-nucleons/hint';
|
|
3
|
+
import { HintProps } from '@sima-land/ui-nucleons/hint-deprecated';
|
|
4
4
|
import { StrokedSVGProps } from '@sima-land/ui-nucleons/stroked-svg';
|
|
5
5
|
import { BadgeListProps } from '../badge-list';
|
|
6
6
|
import { RatingCounterProps } from '../rating-counter';
|
|
@@ -12,9 +12,19 @@ export interface ImageProps {
|
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
opacity?: number;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Дополнительный контент после заголовка.
|
|
17
|
+
* @param props Свойства.
|
|
18
|
+
* @return Элемент.
|
|
19
|
+
*/
|
|
15
20
|
declare function SecondaryInfo({ children }: {
|
|
16
21
|
children: ReactNode;
|
|
17
22
|
}): JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* Счетчик рейтинга.
|
|
25
|
+
* @param props Свойства.
|
|
26
|
+
* @return Элемент.
|
|
27
|
+
*/
|
|
18
28
|
declare function CustomRatingCounter({ className, ...rest }: RatingCounterProps): JSX.Element;
|
|
19
29
|
export declare const Parts: {
|
|
20
30
|
readonly Image: ({ src, alt, href, onClick, children, opacity }: ImageProps) => JSX.Element;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -107,7 +111,8 @@ const Title = ({ children, href, onClick }) => {
|
|
|
107
111
|
const { restriction } = (0, react_1.useContext)(utils_1.ProductInfoContext);
|
|
108
112
|
return restriction === 'adult' ? (react_1.default.createElement("span", { className: cx('adult-info'), "data-testid": 'product-info:adult-warning' }, "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043E \u0432\u044B \u0441\u0442\u0430\u0440\u0448\u0435 18 \u043B\u0435\u0442, \u0447\u0442\u043E\u0431\u044B \u043F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0442\u043E\u0432\u0430\u0440.")) : (react_1.default.createElement(link_1.Link, { onClick: onClick, className: cx('link', 'line-clamp'), href: href, color: 'basic-gray87', "data-testid": 'product-info:name-link' }, children));
|
|
109
113
|
};
|
|
110
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* Слот для вывода ссылки торговой марки.
|
|
111
116
|
* @param props Свойства.
|
|
112
117
|
* @return Элемент.
|
|
113
118
|
*/
|
|
@@ -166,9 +171,19 @@ const WaitListAddedLink = (_a) => {
|
|
|
166
171
|
'\u00A0',
|
|
167
172
|
"\u043E\u0436\u0438\u0434\u0430\u043D\u0438\u044F")));
|
|
168
173
|
};
|
|
174
|
+
/**
|
|
175
|
+
* Дополнительный контент после заголовка.
|
|
176
|
+
* @param props Свойства.
|
|
177
|
+
* @return Элемент.
|
|
178
|
+
*/
|
|
169
179
|
function SecondaryInfo({ children }) {
|
|
170
180
|
return react_1.default.createElement("div", { className: cx('secondary-info') }, children);
|
|
171
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Счетчик рейтинга.
|
|
184
|
+
* @param props Свойства.
|
|
185
|
+
* @return Элемент.
|
|
186
|
+
*/
|
|
172
187
|
function CustomRatingCounter(_a) {
|
|
173
188
|
var { className } = _a, rest = __rest(_a, ["className"]);
|
|
174
189
|
return react_1.default.createElement(rating_counter_1.RatingCounter, Object.assign({ size: 'unset', className: cx('rating', className), hoverDisabled: true }, rest));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type RatingCounterSize = 's' | 'm' | 'unset';
|
|
3
3
|
interface CustomProps {
|
|
4
4
|
/**
|
|
5
5
|
* Размер.
|
|
@@ -15,7 +15,7 @@ interface CustomProps {
|
|
|
15
15
|
/** Идентификатор для систем автоматизированного тестирования. */
|
|
16
16
|
'data-testid'?: string;
|
|
17
17
|
}
|
|
18
|
-
export
|
|
18
|
+
export type RatingCounterProps = CustomProps & Omit<HTMLAttributes<HTMLDivElement>, keyof CustomProps>;
|
|
19
19
|
/**
|
|
20
20
|
* Счетчик рейтинга.
|
|
21
21
|
* @param props Свойства.
|
package/common/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ModifierType = 'text' | 'image' | 'color';
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -35,11 +39,17 @@ const pause_svg_1 = __importDefault(require("../icons/pause.svg"));
|
|
|
35
39
|
const turn_left_svg_1 = __importDefault(require("../icons/turn-left.svg"));
|
|
36
40
|
const turn_right_svg_1 = __importDefault(require("../icons/turn-right.svg"));
|
|
37
41
|
const cx = bind_1.default.bind(all_round_view_module_scss_1.default);
|
|
42
|
+
/**
|
|
43
|
+
* 3д-просмотр.
|
|
44
|
+
* @param props Свойства.
|
|
45
|
+
* @return Элемент.
|
|
46
|
+
*/
|
|
38
47
|
const AllRoundView = ({ photos }) => {
|
|
39
48
|
const imageRef = (0, react_1.useRef)(null);
|
|
40
49
|
const dragStartRef = (0, react_1.useRef)(null);
|
|
41
50
|
const [state, setState] = (0, react_1.useState)('autoplay');
|
|
42
51
|
const autoplay = state === 'autoplay';
|
|
52
|
+
// eslint-disable-next-line require-jsdoc
|
|
43
53
|
const ChangeState = (bindState) => () => setState(bindState);
|
|
44
54
|
const [index, setIndex] = (0, react_1.useState)(0);
|
|
45
55
|
const indexRef = (0, identity_1.useIdentityRef)(index);
|
|
@@ -57,6 +67,7 @@ const AllRoundView = ({ photos }) => {
|
|
|
57
67
|
// перетаскивание
|
|
58
68
|
(0, react_1.useEffect)(() => {
|
|
59
69
|
// переданное число всегда замениться на такое, которое будет в промежутке от 0 до количества фото
|
|
70
|
+
// eslint-disable-next-line require-jsdoc
|
|
60
71
|
const wrap = (value) => (photos.length + value) % photos.length;
|
|
61
72
|
const image = imageRef.current;
|
|
62
73
|
const imageWidth = image.clientWidth;
|
|
@@ -18,4 +18,9 @@ export interface GalleryModalProps extends Pick<ModalProps, 'withScrollDisable'
|
|
|
18
18
|
/** Будет вызвана при событиях проигрывания видео. */
|
|
19
19
|
onVideoEvent?: (event: React.SyntheticEvent<HTMLVideoElement>) => void;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Полноэкранное модальное окно галереи фото/видео.
|
|
23
|
+
* @param props Свойства.
|
|
24
|
+
* @return Элемент.
|
|
25
|
+
*/
|
|
21
26
|
export declare const GalleryModal: ({ media, defaultMediaIndex, review, onClose, onGoToReview, onMediaChange, withScrollDisable, scrollDisableOptions, onVideoEvent, }: GalleryModalProps) => JSX.Element;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -48,6 +52,11 @@ const utils_1 = require("../utils");
|
|
|
48
52
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
49
53
|
const gallery_modal_module_scss_1 = __importDefault(require("./gallery-modal.module.scss"));
|
|
50
54
|
const cx = bind_1.default.bind(gallery_modal_module_scss_1.default);
|
|
55
|
+
/**
|
|
56
|
+
* Полноэкранное модальное окно галереи фото/видео.
|
|
57
|
+
* @param props Свойства.
|
|
58
|
+
* @return Элемент.
|
|
59
|
+
*/
|
|
51
60
|
const GalleryModal = ({ media, defaultMediaIndex = 0, review, onClose, onGoToReview, onMediaChange, withScrollDisable, scrollDisableOptions, onVideoEvent, }) => {
|
|
52
61
|
const [currentIndex, setCurrent] = (0, react_1.useState)(defaultMediaIndex);
|
|
53
62
|
const rootRef = (0, react_1.useRef)(null);
|
|
@@ -83,6 +92,11 @@ const GalleryModal = ({ media, defaultMediaIndex = 0, review, onClose, onGoToRev
|
|
|
83
92
|
size !== null && (react_1.default.createElement("div", { className: cx('footer'), style: style }, review && react_1.default.createElement(review_info_1.ReviewInfo, Object.assign({}, review, { onGoToReview: onGoToReview })))))));
|
|
84
93
|
};
|
|
85
94
|
exports.GalleryModal = GalleryModal;
|
|
95
|
+
/**
|
|
96
|
+
* Изображение или видео.
|
|
97
|
+
* @param props Свойства.
|
|
98
|
+
* @return Элемент.
|
|
99
|
+
*/
|
|
86
100
|
const Media = (_a) => {
|
|
87
101
|
var { onVideoEvent } = _a, media = __rest(_a, ["onVideoEvent"]);
|
|
88
102
|
return (react_1.default.createElement("div", { className: cx('media') },
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
2
|
+
@use 'node_modules/@sima-land/ui-nucleons/utils';
|
|
2
3
|
|
|
3
4
|
.root {
|
|
5
|
+
--header-height: 80px;
|
|
4
6
|
position: relative;
|
|
5
7
|
height: calc(100vh - var(--header-height));
|
|
6
8
|
display: flex;
|
|
7
9
|
flex-direction: column;
|
|
8
|
-
// box-shadow: inset 0 0 0 6px #f00;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
.main {
|
|
12
13
|
position: relative;
|
|
13
|
-
// box-shadow: inset 0 0 0 6px #0f0;
|
|
14
14
|
width: 100%;
|
|
15
15
|
height: var(--area-height);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.thumbnails {
|
|
19
|
+
@include utils.semi-stylized-scrollbars;
|
|
19
20
|
width: 104px;
|
|
20
21
|
height: 100%;
|
|
21
22
|
overflow-x: hidden;
|
|
@@ -81,5 +82,4 @@
|
|
|
81
82
|
left: 0;
|
|
82
83
|
right: 0;
|
|
83
84
|
margin-top: auto;
|
|
84
|
-
// background-color: #ff000024;
|
|
85
85
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type ImageOverlayProps = React.HTMLAttributes<HTMLDivElement>;
|
|
3
|
+
/**
|
|
4
|
+
* Полупрозрачный слой над картинкой по дизайн-гайдам.
|
|
5
|
+
* @param props Свойства.
|
|
6
|
+
* @return Элемент.
|
|
7
|
+
*/
|
|
3
8
|
export declare const ImageOverlay: ({ className, children, ...restProps }: ImageOverlayProps) => JSX.Element;
|
|
@@ -18,6 +18,11 @@ exports.ImageOverlay = void 0;
|
|
|
18
18
|
const react_1 = __importDefault(require("react"));
|
|
19
19
|
const classnames_1 = __importDefault(require("classnames"));
|
|
20
20
|
const image_overlay_module_scss_1 = __importDefault(require("./image-overlay.module.scss"));
|
|
21
|
+
/**
|
|
22
|
+
* Полупрозрачный слой над картинкой по дизайн-гайдам.
|
|
23
|
+
* @param props Свойства.
|
|
24
|
+
* @return Элемент.
|
|
25
|
+
*/
|
|
21
26
|
const ImageOverlay = (_a) => {
|
|
22
27
|
var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
|
|
23
28
|
return (react_1.default.createElement("div", Object.assign({ className: (0, classnames_1.default)(image_overlay_module_scss_1.default.root, className) }, restProps), children));
|
|
@@ -8,4 +8,9 @@ export interface ReviewInfoProps {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
loading?: boolean;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Отзыв.
|
|
13
|
+
* @param props Свойства.
|
|
14
|
+
* @return Элемент.
|
|
15
|
+
*/
|
|
11
16
|
export declare const ReviewInfo: ({ rating, author, onGoToReview, content, className, notAffectRating, loading, }: ReviewInfoProps) => JSX.Element;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -32,6 +36,11 @@ const on_1 = __importDefault(require("@sima-land/ui-nucleons/helpers/on"));
|
|
|
32
36
|
const shadows_1 = require("@sima-land/ui-nucleons/styling/shadows");
|
|
33
37
|
const custom_scrollbar_1 = require("@sima-land/ui-nucleons/_internal/custom-scrollbar");
|
|
34
38
|
const cx = bind_1.default.bind(review_info_module_scss_1.default);
|
|
39
|
+
/**
|
|
40
|
+
* Отзыв.
|
|
41
|
+
* @param props Свойства.
|
|
42
|
+
* @return Элемент.
|
|
43
|
+
*/
|
|
35
44
|
const ReviewInfo = ({ rating, author, onGoToReview, content, className, notAffectRating, loading, }) => {
|
|
36
45
|
const [clamped, setClamped] = (0, react_1.useState)(false);
|
|
37
46
|
const [opened, setOpened] = (0, react_1.useState)(false);
|
|
@@ -67,9 +76,18 @@ const ReviewInfo = ({ rating, author, onGoToReview, content, className, notAffec
|
|
|
67
76
|
react_1.default.createElement(link_1.Link, { pseudo: true, onClick: () => setOpened(true), "data-testid": 'review-info:expand' }, "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u043E\u043B\u043D\u043E\u0441\u0442\u044C\u044E")))))));
|
|
68
77
|
};
|
|
69
78
|
exports.ReviewInfo = ReviewInfo;
|
|
79
|
+
/**
|
|
80
|
+
* Оступы для блоков отзыва.
|
|
81
|
+
* @param props Свойства.
|
|
82
|
+
* @return Элемент.
|
|
83
|
+
*/
|
|
70
84
|
function Layout({ className, children }) {
|
|
71
85
|
return react_1.default.createElement("div", { className: cx(className, 'layout') }, children);
|
|
72
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Отображение загрузки данных отзыва.
|
|
89
|
+
* @return Элемент.
|
|
90
|
+
*/
|
|
73
91
|
function LoadingView() {
|
|
74
92
|
return (react_1.default.createElement("div", { className: cx('loading') },
|
|
75
93
|
react_1.default.createElement("div", { className: cx('head') },
|
|
@@ -8,4 +8,9 @@ export interface ThumbnailProps {
|
|
|
8
8
|
onClick?: React.MouseEventHandler;
|
|
9
9
|
className?: string;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Превью медиа.
|
|
13
|
+
* @param props Свойства.
|
|
14
|
+
* @return Элемент.
|
|
15
|
+
*/
|
|
11
16
|
export declare const Thumbnail: ({ type, src, alt, checked, onClick, className }: ThumbnailProps) => JSX.Element;
|
|
@@ -11,6 +11,11 @@ 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
|
+
/**
|
|
15
|
+
* Превью медиа.
|
|
16
|
+
* @param props Свойства.
|
|
17
|
+
* @return Элемент.
|
|
18
|
+
*/
|
|
14
19
|
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
20
|
type === '360' && react_1.default.createElement(_360_svg_1.default, { fill: 'currentColor' }),
|
|
16
21
|
type === 'video' && react_1.default.createElement(play_1.default, { width: 32, height: 32, fill: 'currentColor' }),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type MediaType = 'image' | 'video' | '360';
|
|
2
2
|
export interface MediaShape<T extends string, D extends Record<string, any>> {
|
|
3
3
|
type: T;
|
|
4
4
|
data: D;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type MediaData = MediaShape<'image', {
|
|
7
7
|
src: string;
|
|
8
8
|
thumbnailSrc?: string;
|
|
9
9
|
alt?: string;
|
|
@@ -33,7 +33,8 @@ exports.useImagesLoad = useImagesLoad;
|
|
|
33
33
|
const useSquareFit = (areaRef, { hasReview }) => {
|
|
34
34
|
const [size, setSize] = (0, react_1.useState)(null);
|
|
35
35
|
(0, react_1.useEffect)(() => {
|
|
36
|
-
|
|
36
|
+
// eslint-disable-next-line require-jsdoc
|
|
37
|
+
const calc = () => {
|
|
37
38
|
if (areaRef.current) {
|
|
38
39
|
const correction = 2 * (104 + 16 + 56 + 24); // ширина превью + отступ + ширина кнопки + отступ
|
|
39
40
|
// доступная область в которую можно вписать **квадрат**
|
|
@@ -41,7 +42,7 @@ const useSquareFit = (areaRef, { hasReview }) => {
|
|
|
41
42
|
const availHeight = areaRef.current.clientHeight - (hasReview ? 140 : 40); // вычитаем высоту футера
|
|
42
43
|
setSize(Math.min(availWidth, availHeight));
|
|
43
44
|
}
|
|
44
|
-
}
|
|
45
|
+
};
|
|
45
46
|
calc();
|
|
46
47
|
return (0, on_1.default)(window, 'resize', () => window.requestAnimationFrame(calc));
|
|
47
48
|
}, [areaRef, hasReview]);
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -58,4 +62,9 @@ const ModifiersGroup = ({ children, defaultOpened = false, onShowAll, }) => {
|
|
|
58
62
|
};
|
|
59
63
|
exports.ModifiersGroup = ModifiersGroup;
|
|
60
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
|
+
*/
|
|
61
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' }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ModalProps } from '@sima-land/ui-nucleons/modal';
|
|
3
|
-
|
|
3
|
+
interface PersonInfoProps {
|
|
4
4
|
/** Имя. */
|
|
5
5
|
name: string;
|
|
6
6
|
/** Должность. */
|
|
@@ -23,6 +23,8 @@ export interface PersonModalProps {
|
|
|
23
23
|
secondPhoneText?: string;
|
|
24
24
|
/** Свойства ссылки под именем. */
|
|
25
25
|
arbitraryLinkProps?: any;
|
|
26
|
+
}
|
|
27
|
+
export interface PersonModalProps extends PersonInfoProps {
|
|
26
28
|
/** Сработает при нажатии на кнопку "Закрыть". */
|
|
27
29
|
onClose: () => void;
|
|
28
30
|
/** Нужно ли блокировать прокрутку пока открыто окно. */
|
|
@@ -31,8 +33,9 @@ export interface PersonModalProps {
|
|
|
31
33
|
scrollDisableOptions?: ModalProps['scrollDisableOptions'];
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
|
-
*
|
|
36
|
+
* Информация о персоне.
|
|
35
37
|
* @param props Свойства.
|
|
36
38
|
* @return Элемент.
|
|
37
39
|
*/
|
|
38
|
-
export declare
|
|
40
|
+
export declare function PersonInfo({ name, appointment, photoUrl, email, skype, social, phoneHref, phoneText, secondPhoneHref, secondPhoneText, arbitraryLinkProps, }: PersonInfoProps): JSX.Element;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PersonInfo = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const user_1 = require("@sima-land/ui-nucleons/avatar/user");
|
|
9
|
+
const box_1 = require("@sima-land/ui-nucleons/box");
|
|
10
|
+
const text_1 = require("@sima-land/ui-nucleons/text");
|
|
11
|
+
const link_1 = require("@sima-land/ui-nucleons/link");
|
|
12
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
13
|
+
const person_info_module_scss_1 = __importDefault(require("./person-info.module.scss"));
|
|
14
|
+
const cx = bind_1.default.bind(person_info_module_scss_1.default);
|
|
15
|
+
/**
|
|
16
|
+
* Информация о персоне.
|
|
17
|
+
* @param props Свойства.
|
|
18
|
+
* @return Элемент.
|
|
19
|
+
*/
|
|
20
|
+
function PersonInfo({ name, appointment, photoUrl, email, skype, social, phoneHref, phoneText, secondPhoneHref, secondPhoneText, arbitraryLinkProps, }) {
|
|
21
|
+
return (react_1.default.createElement("div", { className: cx('main') },
|
|
22
|
+
react_1.default.createElement(box_1.Box, { marginBottom: 6 },
|
|
23
|
+
react_1.default.createElement(user_1.UserAvatar, { title: name, imageUrl: photoUrl, size: 104 })),
|
|
24
|
+
react_1.default.createElement(box_1.Box, { marginBottom: 1 },
|
|
25
|
+
react_1.default.createElement(text_1.Text, { color: 'basic-gray38', size: 14, weight: 400 }, appointment)),
|
|
26
|
+
react_1.default.createElement("div", { className: cx('name') }, name),
|
|
27
|
+
arbitraryLinkProps && (react_1.default.createElement(box_1.Box, { marginTop: 2 },
|
|
28
|
+
react_1.default.createElement(text_1.Text, { size: 12, weight: 600 },
|
|
29
|
+
react_1.default.createElement(link_1.Link, Object.assign({}, arbitraryLinkProps))))),
|
|
30
|
+
react_1.default.createElement("div", { className: cx('contacts') },
|
|
31
|
+
email && (react_1.default.createElement("span", { className: cx('contacts-item') },
|
|
32
|
+
'Email: ',
|
|
33
|
+
react_1.default.createElement(link_1.Link, { color: 'basic-gray87', href: `mailto:${email}`, children: email }))),
|
|
34
|
+
Array.isArray(social) && social.length > 0 && (react_1.default.createElement("span", { className: cx('contacts-item') },
|
|
35
|
+
"\u0421\u043E\u0446. \u0441\u0435\u0442\u0438:",
|
|
36
|
+
' ',
|
|
37
|
+
social.map((props, key) => (react_1.default.createElement(link_1.Link, Object.assign({ className: cx('inline'), key: key, color: 'basic-gray87', target: '_blank', rel: 'nofollow' }, props)))))),
|
|
38
|
+
skype && (react_1.default.createElement("span", { className: cx('contacts-item') },
|
|
39
|
+
'Skype: ',
|
|
40
|
+
react_1.default.createElement(link_1.Link, { color: 'basic-gray87', href: `skype:${skype}`, children: skype }))),
|
|
41
|
+
phoneText && (react_1.default.createElement("span", { className: cx('contacts-item') },
|
|
42
|
+
react_1.default.createElement(link_1.Link, { color: 'basic-gray87', href: phoneHref, children: phoneText }))),
|
|
43
|
+
secondPhoneText && (react_1.default.createElement("span", { className: cx('contacts-item') },
|
|
44
|
+
react_1.default.createElement(link_1.Link, { color: 'basic-gray87', href: secondPhoneHref, children: secondPhoneText }))))));
|
|
45
|
+
}
|
|
46
|
+
exports.PersonInfo = PersonInfo;
|
|
File without changes
|