@cloud-ru/uikit-product-calculator 1.9.3-preview-07bf30bf.0 → 1.9.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/CHANGELOG.md +13 -0
- package/README.md +2 -2
- package/dist/cjs/components/PriceSummary/components/ProductCard/ProductCard.js +9 -8
- package/dist/esm/components/PriceSummary/components/ProductCard/ProductCard.js +9 -8
- package/package.json +20 -20
- package/src/components/PriceSummary/components/ProductCard/ProductCard.tsx +20 -18
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.9.3 (2026-06-05)
|
|
7
|
+
|
|
8
|
+
### Only dependencies have been changed
|
|
9
|
+
* [@cloud-ru/uikit-product-icons@17.4.0]($PUBLIC_PROJECT_URL/blob/master/packages/icons/CHANGELOG.md)
|
|
10
|
+
* [@cloud-ru/uikit-product-mobile-accordion@1.1.13]($PUBLIC_PROJECT_URL/blob/master/packages/mobile-accordion/CHANGELOG.md)
|
|
11
|
+
* [@cloud-ru/uikit-product-mobile-dropdown@2.1.15]($PUBLIC_PROJECT_URL/blob/master/packages/mobile-dropdown/CHANGELOG.md)
|
|
12
|
+
* [@cloud-ru/uikit-product-mobile-fields@2.1.4]($PUBLIC_PROJECT_URL/blob/master/packages/mobile-fields/CHANGELOG.md)
|
|
13
|
+
* [@cloud-ru/uikit-product-mobile-modal@2.1.5]($PUBLIC_PROJECT_URL/blob/master/packages/mobile-modal/CHANGELOG.md)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
6
19
|
## 1.9.2 (2026-05-27)
|
|
7
20
|
|
|
8
21
|
|
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ export function Calculator() {
|
|
|
41
41
|
| actions* | `{ onPlatformSelect?(platform: string): void; onProductSelect?(productId: string): void; onProductDelete?(productId: string): void; onStartClick?(): void; onCatalogOpen?(): void; onConnectClick?(id: string, value: FormValues): void; onShareClick?(state: State): Promise<...>; onDownloadFileClick?(state: State): Promis...` | - | Колбеки на действия внутри калькулятора |
|
|
42
42
|
| fetcherFn* | `FetcherFn` | - | Функция для запроса цен по продукту |
|
|
43
43
|
| config* | `CatalogConfig` | - | Конфигурация платформ/продуктов/каталога |
|
|
44
|
-
| layoutType |
|
|
44
|
+
| layoutType | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | desktop | Тип устройства |
|
|
45
45
|
| calculatorType | enum CalculatorType: `"test"`, `"main"`, `"partners"`, `"product"`, `"additional"` | main | Тип калькулятора |
|
|
46
46
|
| onAnalyticsClick | `(clickContent: string, uniqueId: string) => void` | - | Колбэк вызова при изменении любого контрола для аналитики |
|
|
47
47
|
| bgImage | `string` | - | Изображение на заднем фоне в состоянии "пустой" корзины |
|
|
@@ -113,7 +113,7 @@ data-test-id
|
|
|
113
113
|
### Props
|
|
114
114
|
| name | type | default value | description |
|
|
115
115
|
|------|------|---------------|-------------|
|
|
116
|
-
| __@iterator@
|
|
116
|
+
| __@iterator@1113* | `() => StringIterator<string>` | - | Iterator |
|
|
117
117
|
| toWellFormed* | `() => string` | - | Returns a string where all lone or out-of-order surrogates have been replaced by the Unicode replacement character (U+FFFD). |
|
|
118
118
|
| isWellFormed* | `() => boolean` | - | Returns true if all leading surrogates and trailing surrogates appear paired and in order. |
|
|
119
119
|
| at* | `(index: number) => string` | - | Returns a new String consisting of the single UTF-16 code unit located at the specified index. @param index The zero-based index of the desired code unit. A negative index will count back from the last item. |
|
|
@@ -22,20 +22,21 @@ function ProductCard({ id, idx, label, selectedProduct, onProductClick, onProduc
|
|
|
22
22
|
const price = (0, react_1.useDeferredValue)((0, utils_1.getValue)(products, `[${id}][${idx}].price`));
|
|
23
23
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(card_1.Card, { size: 's', onClick: () => {
|
|
24
24
|
onProductClick(id, idx);
|
|
25
|
-
}, checked: isChecked, outline: true, "data-test-id": dataTestAttribute, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [(0, jsx_runtime_1.jsx)(card_1.Card.Header, { truncate: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
e.stopPropagation();
|
|
30
|
-
}, children: (0, jsx_runtime_1.jsx)(uikit_product_mobile_dropdown_1.AdaptiveDroplist, { layoutType: layoutType, placement: 'bottom-end', size: 'm', closeDroplistOnItemClick: true, items: [
|
|
25
|
+
}, checked: isChecked, outline: true, "data-test-id": dataTestAttribute, children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.wrapper, children: [(0, jsx_runtime_1.jsx)(card_1.Card.Header, { truncate: {
|
|
26
|
+
title: 10,
|
|
27
|
+
description: 20,
|
|
28
|
+
}, title: label, description: `${(0, utils_1.formatNumber)((0, utils_1.getPrice)({ price, pricePeriod, partners: isPartners }))} ₽ ${PricePeriodSelect_1.PRICE_NAME[pricePeriod]}` }), (0, jsx_runtime_1.jsx)(uikit_product_mobile_dropdown_1.AdaptiveDroplist, { layoutType: layoutType, placement: 'bottom-end', size: 'm', closeDroplistOnItemClick: true, items: [
|
|
31
29
|
{
|
|
32
30
|
id: 'remove',
|
|
33
31
|
content: {
|
|
34
32
|
option: 'Удалить',
|
|
35
33
|
},
|
|
36
|
-
onClick:
|
|
34
|
+
onClick: e => {
|
|
35
|
+
e.stopPropagation();
|
|
37
36
|
onProductDelete(id, idx);
|
|
38
37
|
},
|
|
39
38
|
},
|
|
40
|
-
], children: (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.KebabSVG, {}), size: 'm'
|
|
39
|
+
], children: (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.KebabSVG, {}), size: 'm', onClick: e => {
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
} }) })] }) }) }, id + '_' + idx) }));
|
|
41
42
|
}
|
|
@@ -16,20 +16,21 @@ export function ProductCard({ id, idx, label, selectedProduct, onProductClick, o
|
|
|
16
16
|
const price = useDeferredValue(getValue(products, `[${id}][${idx}].price`));
|
|
17
17
|
return (_jsx(_Fragment, { children: _jsx(Card, { size: 's', onClick: () => {
|
|
18
18
|
onProductClick(id, idx);
|
|
19
|
-
}, checked: isChecked, outline: true, "data-test-id": dataTestAttribute, children: _jsxs("div", { className: styles.wrapper, children: [_jsx(Card.Header, { truncate: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
e.stopPropagation();
|
|
24
|
-
}, children: _jsx(AdaptiveDroplist, { layoutType: layoutType, placement: 'bottom-end', size: 'm', closeDroplistOnItemClick: true, items: [
|
|
19
|
+
}, checked: isChecked, outline: true, "data-test-id": dataTestAttribute, children: _jsx(_Fragment, { children: _jsxs("div", { className: styles.wrapper, children: [_jsx(Card.Header, { truncate: {
|
|
20
|
+
title: 10,
|
|
21
|
+
description: 20,
|
|
22
|
+
}, title: label, description: `${formatNumber(getPrice({ price, pricePeriod, partners: isPartners }))} ₽ ${PRICE_NAME[pricePeriod]}` }), _jsx(AdaptiveDroplist, { layoutType: layoutType, placement: 'bottom-end', size: 'm', closeDroplistOnItemClick: true, items: [
|
|
25
23
|
{
|
|
26
24
|
id: 'remove',
|
|
27
25
|
content: {
|
|
28
26
|
option: 'Удалить',
|
|
29
27
|
},
|
|
30
|
-
onClick:
|
|
28
|
+
onClick: e => {
|
|
29
|
+
e.stopPropagation();
|
|
31
30
|
onProductDelete(id, idx);
|
|
32
31
|
},
|
|
33
32
|
},
|
|
34
|
-
], children: _jsx(ButtonFunction, { icon: _jsx(KebabSVG, {}), size: 'm'
|
|
33
|
+
], children: _jsx(ButtonFunction, { icon: _jsx(KebabSVG, {}), size: 'm', onClick: e => {
|
|
34
|
+
e.stopPropagation();
|
|
35
|
+
} }) })] }) }) }, id + '_' + idx) }));
|
|
35
36
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloud-ru/uikit-product-calculator",
|
|
3
3
|
"title": "Calculator",
|
|
4
|
-
"version": "1.9.3
|
|
4
|
+
"version": "1.9.3",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
7
7
|
"*.woff",
|
|
@@ -37,30 +37,30 @@
|
|
|
37
37
|
"scripts": {},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@cloud-ru/ft-copy-to-clipboard": "0.1.0",
|
|
40
|
-
"@cloud-ru/uikit-product-icons": "17.
|
|
41
|
-
"@cloud-ru/uikit-product-mobile-accordion": "1.1.
|
|
42
|
-
"@cloud-ru/uikit-product-mobile-dropdown": "2.1.
|
|
43
|
-
"@cloud-ru/uikit-product-mobile-fields": "2.1.
|
|
44
|
-
"@cloud-ru/uikit-product-mobile-modal": "2.1.
|
|
40
|
+
"@cloud-ru/uikit-product-icons": "17.4.0",
|
|
41
|
+
"@cloud-ru/uikit-product-mobile-accordion": "1.1.13",
|
|
42
|
+
"@cloud-ru/uikit-product-mobile-dropdown": "2.1.15",
|
|
43
|
+
"@cloud-ru/uikit-product-mobile-fields": "2.1.4",
|
|
44
|
+
"@cloud-ru/uikit-product-mobile-modal": "2.1.5",
|
|
45
45
|
"@cloud-ru/uikit-product-utils": "9.1.0",
|
|
46
|
-
"@snack-uikit/alert": "0.16.
|
|
47
|
-
"@snack-uikit/button": "0.19.
|
|
48
|
-
"@snack-uikit/card": "0.20.
|
|
49
|
-
"@snack-uikit/carousel": "0.6.
|
|
50
|
-
"@snack-uikit/chips": "0.29.
|
|
46
|
+
"@snack-uikit/alert": "0.16.28",
|
|
47
|
+
"@snack-uikit/button": "0.19.7",
|
|
48
|
+
"@snack-uikit/card": "0.20.20",
|
|
49
|
+
"@snack-uikit/carousel": "0.6.11",
|
|
50
|
+
"@snack-uikit/chips": "0.29.0",
|
|
51
51
|
"@snack-uikit/divider": "3.2.3",
|
|
52
|
-
"@snack-uikit/fields": "0.56.
|
|
52
|
+
"@snack-uikit/fields": "0.56.1",
|
|
53
53
|
"@snack-uikit/icon-predefined": "0.7.3",
|
|
54
54
|
"@snack-uikit/input-private": "4.8.8",
|
|
55
|
-
"@snack-uikit/link": "0.
|
|
56
|
-
"@snack-uikit/list": "0.33.
|
|
57
|
-
"@snack-uikit/modal": "0.19.
|
|
58
|
-
"@snack-uikit/pagination": "0.10.
|
|
55
|
+
"@snack-uikit/link": "0.17.20",
|
|
56
|
+
"@snack-uikit/list": "0.33.1",
|
|
57
|
+
"@snack-uikit/modal": "0.19.12",
|
|
58
|
+
"@snack-uikit/pagination": "0.10.24",
|
|
59
59
|
"@snack-uikit/scroll": "0.11.0",
|
|
60
|
-
"@snack-uikit/tag": "0.15.
|
|
60
|
+
"@snack-uikit/tag": "0.15.18",
|
|
61
61
|
"@snack-uikit/toggles": "0.13.26",
|
|
62
|
-
"@snack-uikit/tooltip": "0.18.
|
|
63
|
-
"@snack-uikit/truncate-string": "0.7.
|
|
62
|
+
"@snack-uikit/tooltip": "0.18.12",
|
|
63
|
+
"@snack-uikit/truncate-string": "0.7.11",
|
|
64
64
|
"@snack-uikit/typography": "0.8.4",
|
|
65
65
|
"@snack-uikit/utils": "3.7.0",
|
|
66
66
|
"classnames": "2.5.1",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@types/lodash": "4.17.13"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "447f780b5e9b4f1f4c57fdc2eef2a96858754c75"
|
|
75
75
|
}
|
|
@@ -41,21 +41,16 @@ export function ProductCard({ id, idx, label, selectedProduct, onProductClick, o
|
|
|
41
41
|
key={id + '_' + idx}
|
|
42
42
|
data-test-id={dataTestAttribute}
|
|
43
43
|
>
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<div
|
|
55
|
-
onClick={e => {
|
|
56
|
-
e.stopPropagation();
|
|
57
|
-
}}
|
|
58
|
-
>
|
|
44
|
+
<>
|
|
45
|
+
<div className={styles.wrapper}>
|
|
46
|
+
<Card.Header
|
|
47
|
+
truncate={{
|
|
48
|
+
title: 10,
|
|
49
|
+
description: 20,
|
|
50
|
+
}}
|
|
51
|
+
title={label}
|
|
52
|
+
description={`${formatNumber(getPrice({ price, pricePeriod, partners: isPartners }))} ₽ ${PRICE_NAME[pricePeriod]}`}
|
|
53
|
+
/>
|
|
59
54
|
<AdaptiveDroplist
|
|
60
55
|
layoutType={layoutType}
|
|
61
56
|
placement='bottom-end'
|
|
@@ -67,16 +62,23 @@ export function ProductCard({ id, idx, label, selectedProduct, onProductClick, o
|
|
|
67
62
|
content: {
|
|
68
63
|
option: 'Удалить',
|
|
69
64
|
},
|
|
70
|
-
onClick:
|
|
65
|
+
onClick: e => {
|
|
66
|
+
e.stopPropagation();
|
|
71
67
|
onProductDelete(id, idx);
|
|
72
68
|
},
|
|
73
69
|
},
|
|
74
70
|
]}
|
|
75
71
|
>
|
|
76
|
-
<ButtonFunction
|
|
72
|
+
<ButtonFunction
|
|
73
|
+
icon={<KebabSVG />}
|
|
74
|
+
size='m'
|
|
75
|
+
onClick={e => {
|
|
76
|
+
e.stopPropagation();
|
|
77
|
+
}}
|
|
78
|
+
/>
|
|
77
79
|
</AdaptiveDroplist>
|
|
78
80
|
</div>
|
|
79
|
-
|
|
81
|
+
</>
|
|
80
82
|
</Card>
|
|
81
83
|
</>
|
|
82
84
|
);
|