@sima-land/moleculas 12.3.3 → 13.1.2
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 → index.d.ts} +1 -2
- package/common/components/adult-block/{adult-block.js → index.js} +2 -1
- package/common/components/badge-list/badge-list.module.scss +0 -1
- package/common/components/badge-list/index.d.ts +2 -6
- package/common/components/badge-list/index.js +26 -5
- package/common/components/product-info/index.d.ts +11 -49
- package/common/components/product-info/index.js +24 -35
- package/common/components/product-info/parts.d.ts +41 -0
- package/common/components/product-info/parts.js +176 -0
- package/common/components/product-info/product-info.module.scss +159 -28
- package/common/components/product-info/types.d.ts +5 -0
- package/common/components/product-info/types.js +2 -0
- package/common/components/product-info/utils.d.ts +3 -0
- package/{mobile/components/product-slider → common/components/product-info}/utils.js +2 -2
- package/common/icons/eighteen-plus.svg +3 -1
- package/desktop/components/item-image/index.d.ts +1 -1
- package/desktop/components/item-image/index.js +5 -3
- package/desktop/components/person-modal/index.d.ts +0 -1
- package/desktop/components/person-modal/index.js +0 -1
- package/desktop/components/product-card/index.d.ts +11 -24
- package/desktop/components/product-card/index.js +47 -31
- package/desktop/components/product-card/product-card.module.scss +7 -48
- package/desktop/components/product-carousel/hover-card.d.ts +1 -4
- package/desktop/components/product-carousel/hover-card.js +18 -6
- package/desktop/components/product-carousel/index.d.ts +5 -9
- package/desktop/components/product-carousel/index.js +28 -25
- package/desktop/components/product-carousel/utils.js +4 -1
- package/mobile/components/garland-calculator-button/garland-calculator-button.module.scss +32 -3
- package/mobile/components/garland-calculator-button/index.d.ts +2 -3
- package/mobile/components/garland-calculator-button/index.js +9 -14
- package/mobile/components/item-image/index.d.ts +4 -4
- package/mobile/components/item-image/index.js +9 -10
- package/mobile/components/person-screen/index.d.ts +3 -3
- package/mobile/components/person-screen/index.js +16 -14
- package/mobile/components/product-actions-alert/index.d.ts +2 -5
- package/mobile/components/product-actions-alert/index.js +2 -5
- package/mobile/components/product-slider/index.d.ts +6 -9
- package/mobile/components/product-slider/index.js +14 -11
- package/mobile/components/product-slider/{item.module.scss → product-slider.module.scss} +1 -12
- package/mobile/components/pseudo-input/index.d.ts +5 -8
- package/mobile/components/pseudo-input/index.js +21 -10
- package/mobile/components/pseudo-input/pseudo-input.module.scss +6 -9
- package/mobile/components/select-screen/index.d.ts +11 -2
- package/mobile/components/select-screen/index.js +46 -12
- package/mobile/components/select-screen/select-screen.module.scss +3 -1
- package/package.json +3 -3
- package/common/__fixtures__/list-item.d.ts +0 -53
- package/common/__fixtures__/list-item.js +0 -107
- package/common/helpers/get-contained-items.d.ts +0 -7
- package/common/helpers/get-contained-items.js +0 -18
- package/common/icons/filled-rate.svg +0 -3
- package/common/icons/full-left-arrow.svg +0 -1
- package/common/icons/full-right-arrow.svg +0 -1
- package/common/icons/grid-small.svg +0 -11
- package/common/icons/grid.svg +0 -6
- package/common/icons/list.svg +0 -5
- package/common/icons/page.svg +0 -1
- package/common/icons/step-arrows.svg +0 -4
- package/common/icons/triple-dots.svg +0 -3
- package/common/icons/white-spinner.svg +0 -3
- package/desktop/components/breadcrumbs/items.d.ts +0 -3
- package/desktop/components/breadcrumbs/items.js +0 -157
- package/mobile/components/garland-calculator-button/tree-in-circle.svg +0 -6
- package/mobile/components/product-slider/item.d.ts +0 -18
- package/mobile/components/product-slider/item.js +0 -58
- package/mobile/components/product-slider/utils.d.ts +0 -4
|
@@ -1,37 +1,55 @@
|
|
|
1
|
+
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
2
|
+
@use 'node_modules/@sima-land/ui-nucleons/breakpoints';
|
|
3
|
+
|
|
1
4
|
.image-overlay {
|
|
2
5
|
position: relative;
|
|
3
6
|
max-width: 100%;
|
|
4
7
|
margin-bottom: 8px;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
.favorite-btn {
|
|
8
|
-
position: absolute;
|
|
9
|
-
top: 4px;
|
|
10
|
-
right: 4px;
|
|
11
|
-
}
|
|
8
|
+
overflow: hidden;
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
display: block;
|
|
15
|
-
// фиксируем соотношение сторон чтобы размер не скакал при загрузке изображения
|
|
10
|
+
// формируем соотношение сторон 1 / 1
|
|
16
11
|
&::before {
|
|
17
|
-
display: block;
|
|
18
12
|
content: '';
|
|
13
|
+
display: block;
|
|
19
14
|
padding-top: 100%;
|
|
20
15
|
pointer-events: none;
|
|
21
16
|
}
|
|
22
17
|
}
|
|
23
18
|
|
|
24
|
-
.image {
|
|
25
|
-
display: block;
|
|
19
|
+
.image-link {
|
|
26
20
|
position: absolute;
|
|
27
21
|
top: 0;
|
|
28
22
|
left: 0;
|
|
29
|
-
|
|
23
|
+
display: block;
|
|
30
24
|
height: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.image {
|
|
28
|
+
display: block;
|
|
31
29
|
object-fit: contain;
|
|
30
|
+
width: 100%;
|
|
31
|
+
height: 100%;
|
|
32
|
+
&.adult {
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 0;
|
|
35
|
+
left: 0;
|
|
36
|
+
opacity: 0.2;
|
|
37
|
+
filter: blur(24px);
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.adult-icon {
|
|
43
|
+
position: absolute;
|
|
44
|
+
width: 40%;
|
|
45
|
+
height: 40%;
|
|
46
|
+
top: 50%;
|
|
47
|
+
left: 50%;
|
|
48
|
+
transform: translate(-50%, -50%);
|
|
49
|
+
fill: colors.$gray38;
|
|
32
50
|
}
|
|
33
51
|
|
|
34
|
-
.
|
|
52
|
+
.image-buttons {
|
|
35
53
|
position: absolute;
|
|
36
54
|
top: 0;
|
|
37
55
|
left: 0;
|
|
@@ -43,6 +61,32 @@
|
|
|
43
61
|
}
|
|
44
62
|
}
|
|
45
63
|
|
|
64
|
+
.image-button {
|
|
65
|
+
display: block;
|
|
66
|
+
border: 0;
|
|
67
|
+
outline: 0;
|
|
68
|
+
background: transparent;
|
|
69
|
+
position: absolute;
|
|
70
|
+
--gutter: 8px;
|
|
71
|
+
right: var(--gutter);
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
&:nth-child(1) {
|
|
74
|
+
top: var(--gutter);
|
|
75
|
+
}
|
|
76
|
+
&:nth-child(2) {
|
|
77
|
+
bottom: var(--gutter);
|
|
78
|
+
}
|
|
79
|
+
&:nth-child(n + 3) {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
82
|
+
&:hover {
|
|
83
|
+
fill: colors.$gray54;
|
|
84
|
+
}
|
|
85
|
+
@include breakpoints.down('ml') {
|
|
86
|
+
--gutter: 4px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
46
90
|
.badges {
|
|
47
91
|
margin-bottom: 8px;
|
|
48
92
|
}
|
|
@@ -52,34 +96,50 @@
|
|
|
52
96
|
display: flex;
|
|
53
97
|
align-items: center;
|
|
54
98
|
|
|
55
|
-
// чтобы старая цена скрывалась если не влазит, согласовано с дизайнерами
|
|
56
|
-
height: 24px;
|
|
57
|
-
overflow: hidden;
|
|
58
|
-
flex-wrap: wrap;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.price {
|
|
62
99
|
font-size: 16px;
|
|
63
100
|
font-weight: 700;
|
|
64
101
|
line-height: 24px;
|
|
102
|
+
|
|
103
|
+
// чтобы старая цена скрывалась если не влазит
|
|
104
|
+
&.height-limit {
|
|
105
|
+
height: 24px;
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
flex-wrap: wrap;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.price {
|
|
112
|
+
font-size: inherit;
|
|
113
|
+
line-height: inherit;
|
|
65
114
|
margin-right: 8px;
|
|
66
115
|
}
|
|
67
116
|
|
|
68
117
|
.old-price {
|
|
69
118
|
font-size: 12px;
|
|
70
119
|
line-height: 16px;
|
|
120
|
+
font-weight: 400;
|
|
71
121
|
}
|
|
72
122
|
|
|
73
123
|
.link {
|
|
74
|
-
overflow: hidden;
|
|
75
|
-
word-break: break-word;
|
|
76
|
-
max-height: 40px;
|
|
77
124
|
max-width: 100%;
|
|
78
125
|
font-size: 14px;
|
|
79
126
|
line-height: 20px;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
127
|
+
&.line-clamp {
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
word-break: break-word;
|
|
130
|
+
max-height: 40px;
|
|
131
|
+
display: -webkit-box;
|
|
132
|
+
-webkit-line-clamp: 2;
|
|
133
|
+
-webkit-box-orient: vertical;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.adult-info {
|
|
138
|
+
display: block;
|
|
139
|
+
max-width: 100%;
|
|
140
|
+
font-size: 14px;
|
|
141
|
+
line-height: 20px;
|
|
142
|
+
color: colors.$gray87;
|
|
83
143
|
}
|
|
84
144
|
|
|
85
145
|
.trademark-link {
|
|
@@ -91,3 +151,74 @@
|
|
|
91
151
|
overflow: hidden;
|
|
92
152
|
text-overflow: ellipsis;
|
|
93
153
|
}
|
|
154
|
+
|
|
155
|
+
// футер
|
|
156
|
+
.footer {
|
|
157
|
+
margin-top: 16px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.text-button {
|
|
161
|
+
font-size: 16px;
|
|
162
|
+
line-height: 24px;
|
|
163
|
+
font-weight: 600;
|
|
164
|
+
&:hover,
|
|
165
|
+
&:active {
|
|
166
|
+
font-weight: 600;
|
|
167
|
+
}
|
|
168
|
+
@include breakpoints.down('ml') {
|
|
169
|
+
font-size: 14px;
|
|
170
|
+
line-height: 20px;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.wait-list-added-text {
|
|
175
|
+
font-size: 16px;
|
|
176
|
+
line-height: 24px;
|
|
177
|
+
font-weight: 600;
|
|
178
|
+
color: colors.$gray24;
|
|
179
|
+
@include breakpoints.down('ml') {
|
|
180
|
+
font-size: 14px;
|
|
181
|
+
line-height: 20px;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// блок корзины
|
|
186
|
+
.control-wrapper {
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-wrap: wrap;
|
|
189
|
+
margin-top: 16px;
|
|
190
|
+
&.loading {
|
|
191
|
+
.control {
|
|
192
|
+
background: colors.$gray4;
|
|
193
|
+
border-radius: 4px;
|
|
194
|
+
}
|
|
195
|
+
.unit-text::before {
|
|
196
|
+
content: '';
|
|
197
|
+
display: block;
|
|
198
|
+
background: colors.$gray4;
|
|
199
|
+
border-radius: 4px;
|
|
200
|
+
width: 48px;
|
|
201
|
+
height: 16px;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.control {
|
|
207
|
+
width: 122px;
|
|
208
|
+
height: 40px;
|
|
209
|
+
margin-right: 16px;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.unit-text {
|
|
213
|
+
padding-top: 12px; // чтобы при переносе на следующую строку правильно отступил от кнопки
|
|
214
|
+
font-size: 12px;
|
|
215
|
+
line-height: 16px;
|
|
216
|
+
color: colors.$gray38;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.bottom-text {
|
|
220
|
+
margin-top: 12px;
|
|
221
|
+
font-size: 12px;
|
|
222
|
+
line-height: 16px;
|
|
223
|
+
color: colors.$gray38;
|
|
224
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ProductInfoContext = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
exports.
|
|
5
|
+
exports.ProductInfoContext = (0, react_1.createContext)({});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
<svg width="36" height="36" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path
|
|
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)" />
|
|
3
5
|
</svg>
|
|
@@ -60,7 +60,7 @@ export interface ItemImageProps {
|
|
|
60
60
|
* @param {boolean} props.hasSelectionButton Признак наличия кнопки выделения товара.
|
|
61
61
|
* @return {ReactElement} Компонент изображения.
|
|
62
62
|
*/
|
|
63
|
-
export
|
|
63
|
+
export declare class ItemImage extends Component<ItemImageProps, any> {
|
|
64
64
|
bootStartTime: any;
|
|
65
65
|
image: any;
|
|
66
66
|
imageWrapper: any;
|
|
@@ -22,12 +22,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.ItemImage = void 0;
|
|
25
26
|
const react_1 = __importStar(require("react"));
|
|
26
27
|
const link_1 = require("@sima-land/ui-nucleons/link");
|
|
27
28
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
28
29
|
const lodash_1 = require("lodash");
|
|
29
30
|
const item_image_module_scss_1 = __importDefault(require("./item-image.module.scss"));
|
|
30
31
|
const badge_list_1 = require("../../../common/components/badge-list");
|
|
32
|
+
const badge_1 = require("../../../common/components/badge");
|
|
31
33
|
const eighteen_plus_svg_1 = __importDefault(require("../../../common/icons/eighteen-plus.svg"));
|
|
32
34
|
const selected_svg_1 = __importDefault(require("../../../common/icons/selected.svg"));
|
|
33
35
|
const wish_button_1 = require("../../../common/components/wish-button");
|
|
@@ -111,7 +113,7 @@ class ItemImage extends react_1.Component {
|
|
|
111
113
|
const currentPhoto = currentPhotoIndex === null ? src : photos[currentPhotoIndex];
|
|
112
114
|
return (react_1.default.createElement("div", { className: cx('wrapper', className), ref: this.imageWrapper, onMouseLeave: () => this.setState({ currentPhotoIndex: null }) },
|
|
113
115
|
withBlur && (react_1.default.createElement("div", { className: cx('with-blur') },
|
|
114
|
-
react_1.default.createElement(eighteen_plus_svg_1.default, { width: 124, height: 124 }))),
|
|
116
|
+
react_1.default.createElement(eighteen_plus_svg_1.default, { width: 124, height: 124, opacity: '0.3' }))),
|
|
115
117
|
react_1.default.createElement("div", { className: cx('image-wrapper') },
|
|
116
118
|
react_1.default.createElement(link_1.Link, { href: itemUrl },
|
|
117
119
|
Array.isArray(photos) && photos.length > 1 && !withBlur && this.imageWrapper.current && (react_1.default.createElement("div", { className: cx('fake-hover-wrapper', fakeDivClassName) }, photos.map((value, index) => (react_1.default.createElement("div", { className: cx('fake-hover', { selected: index === currentPhotoIndex }), style: {
|
|
@@ -123,11 +125,11 @@ class ItemImage extends react_1.Component {
|
|
|
123
125
|
withBlur ? (react_1.default.createElement("div", { className: cx('with-filter-blur'), children: this.getImage({ src: currentPhoto, alt }, onClick) })) : (this.getImage({ src: currentPhoto, alt }, onClick))),
|
|
124
126
|
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' }))),
|
|
125
127
|
Array.isArray(badges) && Boolean(badges.length) && (react_1.default.createElement("div", { className: cx('badges') },
|
|
126
|
-
react_1.default.createElement(badge_list_1.BadgeList, {
|
|
128
|
+
react_1.default.createElement(badge_list_1.BadgeList, null, badges.map((badge, index) => (react_1.default.createElement(badge_1.Badge, Object.assign({ key: index }, badge))))))),
|
|
127
129
|
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 })),
|
|
128
130
|
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) })),
|
|
129
131
|
hasSelectionButton && selectionProps && (react_1.default.createElement("div", { onClick: selectionProps.onSelect, className: cx('selection-container') },
|
|
130
132
|
react_1.default.createElement("div", { className: cx('selection-circle') }, selectionProps.isSelected && react_1.default.createElement(selected_svg_1.default, { width: 56, height: 56 }))))));
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
|
-
exports.
|
|
135
|
+
exports.ItemImage = ItemImage;
|
|
@@ -36,4 +36,3 @@ export interface PersonModalProps {
|
|
|
36
36
|
* @return Элемент.
|
|
37
37
|
*/
|
|
38
38
|
export declare const PersonModal: ({ name, appointment, photoUrl, email, skype, social, phoneHref, phoneText, secondPhoneHref, secondPhoneText, arbitraryLinkProps, onClose, withScrollDisable, scrollDisableOptions, }: PersonModalProps) => JSX.Element;
|
|
39
|
-
export default PersonModal;
|
|
@@ -53,4 +53,3 @@ const PersonModal = ({ name, appointment, photoUrl, email, skype, social, phoneH
|
|
|
53
53
|
react_1.default.createElement(clean_buttons_1.Clean.Button, { onClick: onClose }, "\u0417\u0430\u043A\u0440\u044B\u0442\u044C")))));
|
|
54
54
|
};
|
|
55
55
|
exports.PersonModal = PersonModal;
|
|
56
|
-
exports.default = exports.PersonModal;
|
|
@@ -1,29 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ProductInfoProps } from '../../../common/components/product-info';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
onQuickViewClick?: () => void;
|
|
2
|
+
import { ProductInfo, ProductInfoProps } from '../../../common/components/product-info';
|
|
3
|
+
import { PlateProps } from '@sima-land/ui-nucleons/plate';
|
|
4
|
+
export declare type ProductCardChildren = React.ReactElement<ProductInfoProps, typeof ProductInfo>;
|
|
5
|
+
export interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
children: ProductCardChildren;
|
|
8
7
|
}
|
|
8
|
+
export declare const HoverCard: React.ForwardRefExoticComponent<PlateProps & React.RefAttributes<HTMLDivElement | null>>;
|
|
9
|
+
export declare const ProductCard: ({ children, className, ...props }: ProductCardProps) => JSX.Element;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @param
|
|
11
|
+
* Фильтрует содержимое карточки для вывода состояния без наведения.
|
|
12
|
+
* @param el Элемент.
|
|
12
13
|
* @return Элемент.
|
|
13
14
|
*/
|
|
14
|
-
declare const
|
|
15
|
-
|
|
16
|
-
stepText?: string | undefined;
|
|
17
|
-
markupText?: string | undefined;
|
|
18
|
-
loading?: boolean | undefined;
|
|
19
|
-
}) => JSX.Element;
|
|
20
|
-
export interface ProductCardComponent extends React.ForwardRefExoticComponent<React.PropsWithoutRef<ProductCardProps> & React.RefAttributes<HTMLDivElement>> {
|
|
21
|
-
CartControl: typeof CartControlSlot;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Карточка товара, появляющаяся над элементом карусели.
|
|
25
|
-
* @param props Свойства компонента.
|
|
26
|
-
* @return Элемент.
|
|
27
|
-
*/
|
|
28
|
-
export declare const ProductCard: ProductCardComponent;
|
|
29
|
-
export {};
|
|
15
|
+
export declare const reduceBaseInfo: (el: ProductCardChildren) => React.FunctionComponentElement<ProductInfoProps>;
|
|
16
|
+
export declare const reduceHoverInfo: (el: ProductCardChildren) => React.FunctionComponentElement<ProductInfoProps>;
|
|
@@ -33,41 +33,57 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
34
|
};
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ProductCard = void 0;
|
|
36
|
+
exports.reduceHoverInfo = exports.reduceBaseInfo = exports.ProductCard = exports.HoverCard = void 0;
|
|
37
37
|
const react_1 = __importStar(require("react"));
|
|
38
38
|
const product_info_1 = require("../../../common/components/product-info");
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const shadows_1 = require("@sima-land/ui-nucleons/styling/shadows");
|
|
43
|
-
const define_slots_1 = require("@sima-land/ui-nucleons/helpers/define-slots");
|
|
44
|
-
const with_prevent_1 = __importDefault(require("@sima-land/ui-nucleons/helpers/with-prevent"));
|
|
45
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
39
|
+
const plate_1 = require("@sima-land/ui-nucleons/plate");
|
|
40
|
+
const layer_1 = require("@sima-land/ui-nucleons/helpers/layer");
|
|
41
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
46
42
|
const product_card_module_scss_1 = __importDefault(require("./product-card.module.scss"));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
react_1.default.createElement("div", {
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
exports.HoverCard = (0, react_1.forwardRef)((props, ref) => {
|
|
44
|
+
const layer = (0, layer_1.useLayer)() + 1;
|
|
45
|
+
return (react_1.default.createElement(plate_1.Plate, Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), { zIndex: layer }), ref: ref, rounds: 'm', shadow: 'z4', className: (0, classnames_1.default)(product_card_module_scss_1.default.card, props.className), "data-testid": 'product-card:hover-card' })));
|
|
46
|
+
});
|
|
47
|
+
const ProductCard = (_a) => {
|
|
48
|
+
var { children, className } = _a, props = __rest(_a, ["children", "className"]);
|
|
49
|
+
const [hovered, toggle] = (0, react_1.useState)(false);
|
|
50
|
+
return (react_1.default.createElement("div", Object.assign({}, props, { "data-testid": 'product-card', className: (0, classnames_1.default)(product_card_module_scss_1.default.root, className) }),
|
|
51
|
+
react_1.default.createElement("div", { "data-testid": 'product-card:info', onMouseEnter: () => toggle(true) }, (0, exports.reduceBaseInfo)(children)),
|
|
52
|
+
hovered && (react_1.default.createElement(exports.HoverCard, { onMouseLeave: () => toggle(false) }, (0, exports.reduceHoverInfo)(children)))));
|
|
53
|
+
};
|
|
54
|
+
exports.ProductCard = ProductCard;
|
|
57
55
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @param
|
|
56
|
+
* Фильтрует содержимое карточки для вывода состояния без наведения.
|
|
57
|
+
* @param el Элемент.
|
|
60
58
|
* @return Элемент.
|
|
61
59
|
*/
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
60
|
+
const reduceBaseInfo = (el) => (0, react_1.cloneElement)(el, {
|
|
61
|
+
children: react_1.Children.map(el.props.children, child => {
|
|
62
|
+
let result;
|
|
63
|
+
if ((0, react_1.isValidElement)(child)) {
|
|
64
|
+
switch (child.type) {
|
|
65
|
+
// игнорируем кнопки-иконки на изображении
|
|
66
|
+
case product_info_1.Parts.Image:
|
|
67
|
+
result = (0, react_1.cloneElement)(child, { children: undefined });
|
|
68
|
+
break;
|
|
69
|
+
// игнорируем футер
|
|
70
|
+
case product_info_1.Parts.Footer:
|
|
71
|
+
result = null;
|
|
72
|
+
break;
|
|
73
|
+
// остальное оставляем без изменений
|
|
74
|
+
default:
|
|
75
|
+
result = child;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
exports.reduceBaseInfo = reduceBaseInfo;
|
|
83
|
+
const reduceHoverInfo = (el) => (0, react_1.cloneElement)(el, {
|
|
84
|
+
// при наведении у изображения строго непрозрачность = 1
|
|
85
|
+
children: react_1.Children.map(el.props.children, child => (0, react_1.isValidElement)(child) && child.type === product_info_1.Parts.Image
|
|
86
|
+
? (0, react_1.cloneElement)(child, { opacity: 1 })
|
|
87
|
+
: child),
|
|
72
88
|
});
|
|
73
|
-
exports.
|
|
89
|
+
exports.reduceHoverInfo = reduceHoverInfo;
|
|
@@ -1,53 +1,12 @@
|
|
|
1
|
-
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
2
|
-
|
|
3
1
|
.root {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
position: relative;
|
|
3
|
+
max-width: 400px;
|
|
6
4
|
}
|
|
7
5
|
|
|
8
|
-
.
|
|
6
|
+
.card {
|
|
9
7
|
position: absolute;
|
|
10
|
-
top:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.control-wrapper {
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-wrap: wrap;
|
|
18
|
-
margin-top: 16px;
|
|
19
|
-
&.loading {
|
|
20
|
-
.control {
|
|
21
|
-
background: colors.$gray4;
|
|
22
|
-
border-radius: 4px;
|
|
23
|
-
}
|
|
24
|
-
.unit-text::before {
|
|
25
|
-
content: '';
|
|
26
|
-
display: block;
|
|
27
|
-
background: colors.$gray4;
|
|
28
|
-
border-radius: 4px;
|
|
29
|
-
width: 48px;
|
|
30
|
-
height: 16px;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.control {
|
|
36
|
-
width: 122px;
|
|
37
|
-
height: 40px;
|
|
38
|
-
margin-right: 16px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.unit-text {
|
|
42
|
-
padding-top: 12px; // чтобы при переносе на следующую строку правильно отступил от кнопки
|
|
43
|
-
font-size: 12px;
|
|
44
|
-
line-height: 16px;
|
|
45
|
-
color: colors.$gray38;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.bottom-text {
|
|
49
|
-
margin-top: 12px;
|
|
50
|
-
font-size: 12px;
|
|
51
|
-
line-height: 16px;
|
|
52
|
-
color: colors.$gray38;
|
|
8
|
+
top: -16px;
|
|
9
|
+
left: -16px;
|
|
10
|
+
padding: 16px 16px 24px;
|
|
11
|
+
width: calc(100% + 32px);
|
|
53
12
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProductInfoProps } from '../../../common/components/product-info';
|
|
3
|
-
import { ProductCard } from '../product-card';
|
|
4
3
|
export interface HoverCardProps extends ProductInfoProps {
|
|
5
4
|
targetRef: React.RefObject<HTMLElement | null>;
|
|
6
5
|
onMouseLeave?: () => void;
|
|
7
|
-
onQuickViewClick?: () => void;
|
|
8
|
-
renderCartControl?: (Slot: typeof ProductCard.CartControl) => React.ReactNode;
|
|
9
6
|
}
|
|
10
7
|
/**
|
|
11
8
|
* Карточка товара, появляющаяся над элементом карусели.
|
|
12
9
|
* @param props Свойства компонента.
|
|
13
10
|
* @return Элемент.
|
|
14
11
|
*/
|
|
15
|
-
export declare const HoverCard: ({
|
|
12
|
+
export declare const HoverCard: ({ targetRef, onMouseLeave, ...productInfoProps }: HoverCardProps) => JSX.Element;
|
|
@@ -18,6 +18,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
|
+
var t = {};
|
|
23
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
24
|
+
t[p] = s[p];
|
|
25
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
26
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
28
|
+
t[p[i]] = s[p[i]];
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
21
32
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
34
|
};
|
|
@@ -25,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
25
36
|
exports.HoverCard = void 0;
|
|
26
37
|
const react_1 = __importStar(require("react"));
|
|
27
38
|
const utils_1 = require("@sima-land/ui-nucleons/with-tooltip/utils");
|
|
39
|
+
const product_info_1 = require("../../../common/components/product-info");
|
|
28
40
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
29
41
|
const hover_card_module_scss_1 = __importDefault(require("./hover-card.module.scss"));
|
|
30
42
|
const shapes_1 = require("@sima-land/ui-nucleons/styling/shapes");
|
|
@@ -36,7 +48,8 @@ const cx = bind_1.default.bind(hover_card_module_scss_1.default);
|
|
|
36
48
|
* @param props Свойства компонента.
|
|
37
49
|
* @return Элемент.
|
|
38
50
|
*/
|
|
39
|
-
const HoverCard = (
|
|
51
|
+
const HoverCard = (_a) => {
|
|
52
|
+
var { targetRef, onMouseLeave } = _a, productInfoProps = __rest(_a, ["targetRef", "onMouseLeave"]);
|
|
40
53
|
const rootRef = (0, react_1.useRef)(null);
|
|
41
54
|
const [ready, setReady] = (0, react_1.useState)(false);
|
|
42
55
|
(0, react_1.useLayoutEffect)(() => {
|
|
@@ -49,12 +62,11 @@ const HoverCard = ({ data, targetRef, onMouseLeave, onQuickViewClick, onLinkClic
|
|
|
49
62
|
element.style.width = `${rect.width + 32}px`;
|
|
50
63
|
setReady(true);
|
|
51
64
|
}
|
|
52
|
-
}
|
|
53
|
-
return (react_1.default.createElement(product_card_1.
|
|
54
|
-
// div props
|
|
55
|
-
ref: rootRef, "data-testid": 'product-carousel:hover-card', className: cx('root', !ready && 'hidden', shapes_1.SmallRounds.all, shadows_1.BoxShadow.z4), onMouseLeave: () => {
|
|
65
|
+
});
|
|
66
|
+
return (react_1.default.createElement(product_card_1.HoverCard, { ref: rootRef, style: { padding: '16px 16px 24px 16px' }, className: cx('root', !ready && 'hidden', shapes_1.SmallRounds.all, shadows_1.BoxShadow.z4), onMouseLeave: () => {
|
|
56
67
|
setReady(false);
|
|
57
68
|
onMouseLeave && onMouseLeave();
|
|
58
|
-
} },
|
|
69
|
+
} },
|
|
70
|
+
react_1.default.createElement(product_info_1.ProductInfo, Object.assign({}, productInfoProps))));
|
|
59
71
|
};
|
|
60
72
|
exports.HoverCard = HoverCard;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { ProductInfoProps } from '../../../common/components/product-info';
|
|
2
|
+
import { ProductInfo, ProductInfoProps } from '../../../common/components/product-info';
|
|
4
3
|
interface ItemSize {
|
|
5
4
|
xs?: 2 | 3 | 4;
|
|
6
5
|
s?: 2 | 3 | 4;
|
|
@@ -8,12 +7,13 @@ interface ItemSize {
|
|
|
8
7
|
l?: 2 | 3 | 4;
|
|
9
8
|
xl?: 2 | 3 | 4;
|
|
10
9
|
}
|
|
10
|
+
export declare type ItemElement = React.ReactElement<ProductInfoProps, typeof ProductInfo>;
|
|
11
11
|
export interface ProductCarouselProps {
|
|
12
12
|
/** CSS-класс для корневого элемента. */
|
|
13
13
|
className?: string;
|
|
14
14
|
/** Элементы карусели. */
|
|
15
|
-
children?:
|
|
16
|
-
/**
|
|
15
|
+
children?: ItemElement | ItemElement[];
|
|
16
|
+
/** Настройки размера элемента карусели. */
|
|
17
17
|
itemSize?: ItemSize;
|
|
18
18
|
/** Сработает при попадании карусели во viewport. */
|
|
19
19
|
onInViewport?: () => void;
|
|
@@ -22,14 +22,10 @@ export interface ProductCarouselProps {
|
|
|
22
22
|
/** Нужно ли показывать всплывающую карточку при наведении на элемент карусели. */
|
|
23
23
|
withHoverCard?: boolean;
|
|
24
24
|
}
|
|
25
|
-
declare type CarouselItemProps = ProductInfoProps & Pick<HoverCardProps, 'renderCartControl' | 'onQuickViewClick'>;
|
|
26
25
|
/**
|
|
27
26
|
* Карусель рекомендованных товаров.
|
|
28
27
|
* @param props Свойства.
|
|
29
28
|
* @return Элемент.
|
|
30
29
|
*/
|
|
31
|
-
export declare const ProductCarousel: {
|
|
32
|
-
({ className, itemSize, onInViewport, onNeedRequest, withHoverCard, children, }: ProductCarouselProps): JSX.Element;
|
|
33
|
-
Item: (props: CarouselItemProps) => null;
|
|
34
|
-
};
|
|
30
|
+
export declare const ProductCarousel: ({ className, itemSize, onInViewport, onNeedRequest, withHoverCard, children, }: ProductCarouselProps) => JSX.Element;
|
|
35
31
|
export {};
|