@pisell/materials 3.0.57 → 3.0.59
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +30 -30
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +23 -23
- package/es/index.d.ts +2 -4
- package/es/index.js +2 -7
- package/lib/index.d.ts +2 -4
- package/lib/index.js +32 -38
- package/lowcode/collapse/meta.ts +1 -85
- package/lowcode/date-picker.range-picker/meta.ts +0 -20
- package/package.json +3 -3
- package/es/components/cardPro/index.d.ts +0 -4
- package/es/components/cardPro/index.js +0 -69
- package/es/components/cardPro/index.less +0 -55
- package/es/components/collapse/index.d.ts +0 -15
- package/es/components/collapse/index.js +0 -80
- package/es/components/collapse/index.less +0 -0
- package/es/components/productCard/components/Action/index.d.ts +0 -4
- package/es/components/productCard/components/Action/index.js +0 -21
- package/es/components/productCard/components/Action/index.less +0 -14
- package/es/components/productCard/components/AmountFooter/index.d.ts +0 -4
- package/es/components/productCard/components/AmountFooter/index.js +0 -38
- package/es/components/productCard/components/AmountFooter/index.less +0 -39
- package/es/components/productCard/components/Divider/index.d.ts +0 -4
- package/es/components/productCard/components/Divider/index.js +0 -11
- package/es/components/productCard/components/Divider/index.less +0 -13
- package/es/components/productCard/components/Header/index.d.ts +0 -4
- package/es/components/productCard/components/Header/index.js +0 -70
- package/es/components/productCard/components/Header/index.less +0 -63
- package/es/components/productCard/components/Note/index.d.ts +0 -4
- package/es/components/productCard/components/Note/index.js +0 -25
- package/es/components/productCard/components/Note/index.less +0 -20
- package/es/components/productCard/components/Packages/components/collapsibleList/index.d.ts +0 -10
- package/es/components/productCard/components/Packages/components/collapsibleList/index.js +0 -96
- package/es/components/productCard/components/Packages/components/collapsibleList/index.less +0 -53
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +0 -2
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.js +0 -33
- package/es/components/productCard/components/Packages/components/options/index.d.ts +0 -4
- package/es/components/productCard/components/Packages/components/options/index.js +0 -23
- package/es/components/productCard/components/Packages/components/options/index.less +0 -29
- package/es/components/productCard/components/Packages/index.d.ts +0 -4
- package/es/components/productCard/components/Packages/index.js +0 -32
- package/es/components/productCard/components/Packages/index.less +0 -17
- package/es/components/productCard/components/Packages/utils.d.ts +0 -20
- package/es/components/productCard/components/Packages/utils.js +0 -40
- package/es/components/productCard/components/Sales/index.d.ts +0 -4
- package/es/components/productCard/components/Sales/index.js +0 -39
- package/es/components/productCard/components/Sales/index.less +0 -18
- package/es/components/productCard/components/Time/components/Like/index.d.ts +0 -9
- package/es/components/productCard/components/Time/components/Like/index.js +0 -26
- package/es/components/productCard/components/Time/components/Like/index.less +0 -6
- package/es/components/productCard/components/Time/components/Like/like-heart.png +0 -0
- package/es/components/productCard/components/Time/components/Like/like-hide-heart.png +0 -0
- package/es/components/productCard/components/Time/index.d.ts +0 -4
- package/es/components/productCard/components/Time/index.js +0 -44
- package/es/components/productCard/components/Time/index.less +0 -35
- package/es/components/productCard/hooks/useOpenNote.d.ts +0 -3
- package/es/components/productCard/hooks/useOpenNote.js +0 -66
- package/es/components/productCard/index.d.ts +0 -5
- package/es/components/productCard/index.js +0 -131
- package/es/components/productCard/index.less +0 -53
- package/es/components/productCard/locales.d.ts +0 -42
- package/es/components/productCard/locales.js +0 -47
- package/es/components/productCard/status.d.ts +0 -9
- package/es/components/productCard/status.js +0 -15
- package/es/components/productCard/types.d.ts +0 -17
- package/es/components/productCard/types.js +0 -1
- package/es/components/productCard/utils.d.ts +0 -165
- package/es/components/productCard/utils.js +0 -709
- package/lib/components/cardPro/index.d.ts +0 -4
- package/lib/components/cardPro/index.js +0 -101
- package/lib/components/cardPro/index.less +0 -55
- package/lib/components/collapse/index.d.ts +0 -15
- package/lib/components/collapse/index.js +0 -83
- package/lib/components/collapse/index.less +0 -0
- package/lib/components/productCard/components/Action/index.d.ts +0 -4
- package/lib/components/productCard/components/Action/index.js +0 -55
- package/lib/components/productCard/components/Action/index.less +0 -14
- package/lib/components/productCard/components/AmountFooter/index.d.ts +0 -4
- package/lib/components/productCard/components/AmountFooter/index.js +0 -61
- package/lib/components/productCard/components/AmountFooter/index.less +0 -39
- package/lib/components/productCard/components/Divider/index.d.ts +0 -4
- package/lib/components/productCard/components/Divider/index.js +0 -50
- package/lib/components/productCard/components/Divider/index.less +0 -13
- package/lib/components/productCard/components/Header/index.d.ts +0 -4
- package/lib/components/productCard/components/Header/index.js +0 -82
- package/lib/components/productCard/components/Header/index.less +0 -63
- package/lib/components/productCard/components/Note/index.d.ts +0 -4
- package/lib/components/productCard/components/Note/index.js +0 -56
- package/lib/components/productCard/components/Note/index.less +0 -20
- package/lib/components/productCard/components/Packages/components/collapsibleList/index.d.ts +0 -10
- package/lib/components/productCard/components/Packages/components/collapsibleList/index.js +0 -93
- package/lib/components/productCard/components/Packages/components/collapsibleList/index.less +0 -53
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +0 -2
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.js +0 -52
- package/lib/components/productCard/components/Packages/components/options/index.d.ts +0 -4
- package/lib/components/productCard/components/Packages/components/options/index.js +0 -73
- package/lib/components/productCard/components/Packages/components/options/index.less +0 -29
- package/lib/components/productCard/components/Packages/index.d.ts +0 -4
- package/lib/components/productCard/components/Packages/index.js +0 -56
- package/lib/components/productCard/components/Packages/index.less +0 -17
- package/lib/components/productCard/components/Packages/utils.d.ts +0 -20
- package/lib/components/productCard/components/Packages/utils.js +0 -44
- package/lib/components/productCard/components/Sales/index.d.ts +0 -4
- package/lib/components/productCard/components/Sales/index.js +0 -61
- package/lib/components/productCard/components/Sales/index.less +0 -18
- package/lib/components/productCard/components/Time/components/Like/index.d.ts +0 -9
- package/lib/components/productCard/components/Time/components/Like/index.js +0 -64
- package/lib/components/productCard/components/Time/components/Like/index.less +0 -6
- package/lib/components/productCard/components/Time/components/Like/like-heart.png +0 -0
- package/lib/components/productCard/components/Time/components/Like/like-hide-heart.png +0 -0
- package/lib/components/productCard/components/Time/index.d.ts +0 -4
- package/lib/components/productCard/components/Time/index.js +0 -64
- package/lib/components/productCard/components/Time/index.less +0 -35
- package/lib/components/productCard/hooks/useOpenNote.d.ts +0 -3
- package/lib/components/productCard/hooks/useOpenNote.js +0 -84
- package/lib/components/productCard/index.d.ts +0 -5
- package/lib/components/productCard/index.js +0 -160
- package/lib/components/productCard/index.less +0 -53
- package/lib/components/productCard/locales.d.ts +0 -42
- package/lib/components/productCard/locales.js +0 -65
- package/lib/components/productCard/status.d.ts +0 -9
- package/lib/components/productCard/status.js +0 -36
- package/lib/components/productCard/types.d.ts +0 -17
- package/lib/components/productCard/types.js +0 -17
- package/lib/components/productCard/utils.d.ts +0 -165
- package/lib/components/productCard/utils.js +0 -622
- package/lowcode/card-pro/meta.ts +0 -338
- package/lowcode/card-pro/snippe.ts +0 -39
- package/lowcode/product-card/meta.ts +0 -92
- package/lowcode/product-card/snippets.ts +0 -23
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React, { useMemo } from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { _formatAmount } from "../Packages/utils";
|
|
4
|
-
import Divider from "../Divider";
|
|
5
|
-
import "./index.less";
|
|
6
|
-
import { locales } from '@pisell/utils';
|
|
7
|
-
var prefix = 'pisell-lowcode-';
|
|
8
|
-
var Footer = function Footer(_ref) {
|
|
9
|
-
var _item$_extend, _item$_extend2;
|
|
10
|
-
var item = _ref.item,
|
|
11
|
-
hideDivider = _ref.hideDivider,
|
|
12
|
-
type = _ref.type;
|
|
13
|
-
/**
|
|
14
|
-
* @title: 折扣
|
|
15
|
-
* @description:
|
|
16
|
-
* @param {*} useMemo
|
|
17
|
-
* @return {*}
|
|
18
|
-
* @Author: WangHan
|
|
19
|
-
* @Date: 2024-11-22 13:50
|
|
20
|
-
*/
|
|
21
|
-
var isDiscount = useMemo(function () {
|
|
22
|
-
// item中没有该属性则不展示
|
|
23
|
-
if (!(item !== null && item !== void 0 && item.hasOwnProperty('origin_total'))) return false;
|
|
24
|
-
return Number(item === null || item === void 0 ? void 0 : item.total) != Number(item === null || item === void 0 ? void 0 : item.origin_total);
|
|
25
|
-
}, [item]);
|
|
26
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, !hideDivider ? /*#__PURE__*/React.createElement(Divider, {
|
|
27
|
-
type: type !== 'total' ? 'inside' : ''
|
|
28
|
-
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
29
|
-
className: classNames("".concat(prefix, "packages-product-footer"), hideDivider && "".concat(prefix, "packages-product-hide-divider-footer"))
|
|
30
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, _formatAmount(item === null || item === void 0 ? void 0 : item.total, item === null || item === void 0 ? void 0 : item.symbol)), /*#__PURE__*/React.createElement("span", null, "\xD7".concat(item === null || item === void 0 ? void 0 : item.num)), /*#__PURE__*/React.createElement("span", {
|
|
31
|
-
className: "".concat(prefix, "packages-product-footer-total")
|
|
32
|
-
}, _formatAmount((item === null || item === void 0 ? void 0 : item.total) * (item === null || item === void 0 ? void 0 : item.num), item === null || item === void 0 ? void 0 : item.symbol))), isDiscount ? /*#__PURE__*/React.createElement("div", {
|
|
33
|
-
className: "".concat(prefix, "packages-product-footer-discount")
|
|
34
|
-
}, /*#__PURE__*/React.createElement("span", null, _formatAmount(item === null || item === void 0 ? void 0 : item.origin_total, item === null || item === void 0 ? void 0 : item.symbol)), /*#__PURE__*/React.createElement("span", null, _formatAmount((item === null || item === void 0 ? void 0 : item.origin_total) * (item === null || item === void 0 ? void 0 : item.num), item === null || item === void 0 ? void 0 : item.symbol, 2))) : null), isDiscount && (_item$_extend = item._extend) !== null && _item$_extend !== void 0 && _item$_extend.discount_reason && type === 'total' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
className: "".concat(prefix, "product-item-discount-reason")
|
|
36
|
-
}, /*#__PURE__*/React.createElement("span", null, "".concat(locales.getText('pisell2.product.card.discount.reason'), ": ").concat((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.discount_reason)))) : null);
|
|
37
|
-
};
|
|
38
|
-
export default Footer;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
@pisell-prefix: pisell-lowcode;
|
|
2
|
-
|
|
3
|
-
.@{pisell-prefix} {
|
|
4
|
-
&-packages-product-footer {
|
|
5
|
-
color: var(--Gray-500, #667085);
|
|
6
|
-
font-size: 14px;
|
|
7
|
-
font-style: normal;
|
|
8
|
-
font-weight: 600;
|
|
9
|
-
line-height: 20px;
|
|
10
|
-
> div {
|
|
11
|
-
display: flex;
|
|
12
|
-
justify-content: space-between;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&-packages-product-footer-discount {
|
|
17
|
-
font-size: 12px;
|
|
18
|
-
font-weight: 400;
|
|
19
|
-
line-height: 18px;
|
|
20
|
-
text-decoration-line: line-through;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&-packages-product-footer-total {
|
|
24
|
-
color: var(--Gray-900, #101828);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&-packages-product-hide-divider-footer {
|
|
28
|
-
margin-top: 8px;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&-product-item-discount-reason {
|
|
32
|
-
color: var(--gray-500, #667085);
|
|
33
|
-
font-size: 14px;
|
|
34
|
-
font-style: normal;
|
|
35
|
-
font-weight: 400;
|
|
36
|
-
line-height: 20px;
|
|
37
|
-
white-space: break-spaces;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import "./index.less";
|
|
4
|
-
var prefix = 'pisell-lowcode-';
|
|
5
|
-
var Divider = function Divider(_ref) {
|
|
6
|
-
var type = _ref.type;
|
|
7
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
8
|
-
className: classNames("".concat(prefix, "product-divider"), type === 'inside' && "".concat(prefix, "product-divider-inside"))
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
export default Divider;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Button } from 'antd';
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
import Iconfont from "../../../iconfont";
|
|
5
|
-
import { image, formatAmount } from '@pisell/utils';
|
|
6
|
-
import Options from "../Packages/components/options";
|
|
7
|
-
import "./index.less";
|
|
8
|
-
var prefix = 'pisell-lowcode-';
|
|
9
|
-
var Header = function Header(props) {
|
|
10
|
-
var isShowDelete = props.isShowDelete,
|
|
11
|
-
item = props.item,
|
|
12
|
-
showImage = props.showImage,
|
|
13
|
-
onDelete = props.onDelete,
|
|
14
|
-
disabledEdit = props.disabledEdit;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @title: 是否显示价格
|
|
18
|
-
* @description:
|
|
19
|
-
* @param {*} useMemo
|
|
20
|
-
* @return {*}
|
|
21
|
-
* @Author: WangHan
|
|
22
|
-
* @Date: 2024-11-23 16:13
|
|
23
|
-
*/
|
|
24
|
-
var showPrice = useMemo(function () {
|
|
25
|
-
var _item$bundle, _item$options;
|
|
26
|
-
return (item === null || item === void 0 ? void 0 : (_item$bundle = item.bundle) === null || _item$bundle === void 0 ? void 0 : _item$bundle.length) > 0 || (item === null || item === void 0 ? void 0 : (_item$options = item.options) === null || _item$options === void 0 ? void 0 : _item$options.length) > 0;
|
|
27
|
-
}, [item === null || item === void 0 ? void 0 : item.bundle, item === null || item === void 0 ? void 0 : item.options]);
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* @title: 样式是否居中
|
|
31
|
-
* @description:
|
|
32
|
-
* @param {*} useMemo
|
|
33
|
-
* @return {*}
|
|
34
|
-
* @Author: WangHan
|
|
35
|
-
* @Date: 2024-11-23 17:37
|
|
36
|
-
*/
|
|
37
|
-
var headerCenterStyle = useMemo(function () {
|
|
38
|
-
var _item$options2;
|
|
39
|
-
return (item === null || item === void 0 ? void 0 : (_item$options2 = item.options) === null || _item$options2 === void 0 ? void 0 : _item$options2.length) > 0 || (item === null || item === void 0 ? void 0 : item.product_option_string);
|
|
40
|
-
}, [item === null || item === void 0 ? void 0 : item.options, item === null || item === void 0 ? void 0 : item.product_option_string]);
|
|
41
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
className: classNames("".concat(prefix, "product-header"), headerCenterStyle && "".concat(prefix, "product-options-header"))
|
|
43
|
-
}, isShowDelete && !disabledEdit ? /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
className: "".concat(prefix, "product-delete"),
|
|
45
|
-
onClick: function onClick(e) {
|
|
46
|
-
e.stopPropagation();
|
|
47
|
-
onDelete();
|
|
48
|
-
}
|
|
49
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
50
|
-
type: "text",
|
|
51
|
-
icon: /*#__PURE__*/React.createElement(Iconfont, {
|
|
52
|
-
type: "pisell2-trash-01"
|
|
53
|
-
})
|
|
54
|
-
})) : null, showImage ? /*#__PURE__*/React.createElement("img", {
|
|
55
|
-
src: image.ali(item.cover, 64),
|
|
56
|
-
className: "".concat(prefix, "product-header-cover")
|
|
57
|
-
}) : null, item !== null && item !== void 0 && item.id ? /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: "".concat(prefix, "product-right-wrap")
|
|
59
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
60
|
-
className: "".concat(prefix, "product-title")
|
|
61
|
-
}, /*#__PURE__*/React.createElement("span", null, item === null || item === void 0 ? void 0 : item.title), showPrice ? /*#__PURE__*/React.createElement("span", {
|
|
62
|
-
className: "".concat(prefix, "product-title-price")
|
|
63
|
-
}, formatAmount(item === null || item === void 0 ? void 0 : item.price, 2, item === null || item === void 0 ? void 0 : item.symbol)) : null), item !== null && item !== void 0 && item.product_option_string ? /*#__PURE__*/React.createElement("span", {
|
|
64
|
-
className: "".concat(prefix, "product-title-variant")
|
|
65
|
-
}, item === null || item === void 0 ? void 0 : item.product_option_string) : null, /*#__PURE__*/React.createElement(Options, {
|
|
66
|
-
options: item === null || item === void 0 ? void 0 : item.options,
|
|
67
|
-
amountSymbol: item === null || item === void 0 ? void 0 : item.symbol
|
|
68
|
-
})) : null);
|
|
69
|
-
};
|
|
70
|
-
export default Header;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
@pisell-prefix: pisell-lowcode;
|
|
2
|
-
|
|
3
|
-
.@{pisell-prefix} {
|
|
4
|
-
&-product-header {
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: center;
|
|
7
|
-
gap: 8px;
|
|
8
|
-
padding-right: 24px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
&-product-options-header {
|
|
12
|
-
align-items: initial;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&-product-delete {
|
|
16
|
-
position: absolute;
|
|
17
|
-
padding: 0;
|
|
18
|
-
top: 0;
|
|
19
|
-
right: 0;
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
.pisell-lowcode-btn {
|
|
22
|
-
padding: 0;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&-product-header-cover {
|
|
27
|
-
width: 64px;
|
|
28
|
-
height: 64px;
|
|
29
|
-
object-fit: cover;
|
|
30
|
-
border-radius: 8px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&-product-right-wrap {
|
|
34
|
-
display: flex;
|
|
35
|
-
flex-direction: column;
|
|
36
|
-
justify-content: space-between;
|
|
37
|
-
flex: 1;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&-product-title {
|
|
41
|
-
color: var(--gray-900, #101828);
|
|
42
|
-
font-size: 16px;
|
|
43
|
-
font-style: normal;
|
|
44
|
-
font-weight: 600;
|
|
45
|
-
line-height: 24px;
|
|
46
|
-
display: flex;
|
|
47
|
-
flex-direction: column;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&-product-title-price {
|
|
51
|
-
font-size: 14px;
|
|
52
|
-
font-weight: 500;
|
|
53
|
-
line-height: 20px;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
&-product-title-variant {
|
|
57
|
-
color: var(--Gray-500, #667085);
|
|
58
|
-
font-size: 14px;
|
|
59
|
-
font-style: normal;
|
|
60
|
-
font-weight: 400;
|
|
61
|
-
line-height: 20px;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import { locales } from '@pisell/utils';
|
|
4
|
-
import Divider from "../Divider";
|
|
5
|
-
import "./index.less";
|
|
6
|
-
var prefix = 'pisell-lowcode-';
|
|
7
|
-
var Note = function Note(props) {
|
|
8
|
-
var item = props.item,
|
|
9
|
-
type = props.type,
|
|
10
|
-
openNote = props.openNote,
|
|
11
|
-
disabledEdit = props.disabledEdit;
|
|
12
|
-
return item !== null && item !== void 0 && item.note || !disabledEdit ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
|
|
13
|
-
type: type
|
|
14
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
15
|
-
className: classNames("".concat(prefix, "product-note-wrap"))
|
|
16
|
-
}, item !== null && item !== void 0 && item.note ? /*#__PURE__*/React.createElement("div", null, locales.getText('pisell2.product.card.discount.note'), ": ", item.note) : null, !disabledEdit ? /*#__PURE__*/React.createElement("span", {
|
|
17
|
-
className: "".concat(prefix, "product-note-btn"),
|
|
18
|
-
onClick: function onClick(e) {
|
|
19
|
-
e.preventDefault();
|
|
20
|
-
e.stopPropagation();
|
|
21
|
-
openNote();
|
|
22
|
-
}
|
|
23
|
-
}, item !== null && item !== void 0 && item.note ? locales.getText('pisell2.product.card.discount.edit.note') : locales.getText('pisell2.product.card.discount.add.note')) : null)) : null;
|
|
24
|
-
};
|
|
25
|
-
export default Note;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
@pisell-prefix: pisell-lowcode;
|
|
2
|
-
|
|
3
|
-
.@{pisell-prefix} {
|
|
4
|
-
&-product-note-wrap {
|
|
5
|
-
display: flex;
|
|
6
|
-
gap: 8px;
|
|
7
|
-
color: var(--Gray-900, #101828);
|
|
8
|
-
font-size: 14px;
|
|
9
|
-
font-style: normal;
|
|
10
|
-
font-weight: 400;
|
|
11
|
-
line-height: 20px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&-product-note-btn {
|
|
15
|
-
color: var(--Blue-600, #1570ef);
|
|
16
|
-
font-weight: 600;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
white-space: nowrap;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
interface CollapsibleListProps<T> {
|
|
4
|
-
list: T[];
|
|
5
|
-
renderItem: (item: T, index: number) => React.ReactNode;
|
|
6
|
-
className?: string;
|
|
7
|
-
style?: React.CSSProperties;
|
|
8
|
-
}
|
|
9
|
-
declare const CollapsibleList: React.FC<CollapsibleListProps<any>>;
|
|
10
|
-
export default CollapsibleList;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import React, { useState, useMemo } from 'react';
|
|
12
|
-
import { locales } from '@pisell/utils';
|
|
13
|
-
import classNames from 'classnames';
|
|
14
|
-
import "./index.less";
|
|
15
|
-
var MAX_LIMIT = 3;
|
|
16
|
-
var CollapsibleList = function CollapsibleList(props) {
|
|
17
|
-
var _props$list = props.list,
|
|
18
|
-
list = _props$list === void 0 ? [] : _props$list,
|
|
19
|
-
renderItem = props.renderItem,
|
|
20
|
-
className = props.className,
|
|
21
|
-
style = props.style;
|
|
22
|
-
var _useState = useState(MAX_LIMIT),
|
|
23
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
24
|
-
maxLimit = _useState2[0],
|
|
25
|
-
setMaxLimit = _useState2[1];
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* @title: 展开和收起
|
|
29
|
-
* @description:
|
|
30
|
-
* @param {any} d
|
|
31
|
-
* @return {*}
|
|
32
|
-
* @Author: zhiwei.Wang
|
|
33
|
-
* @Date: 2024-01-30 17:08
|
|
34
|
-
*/
|
|
35
|
-
var handlePreviewAll = function handlePreviewAll() {
|
|
36
|
-
var _maxLimit = maxLimit;
|
|
37
|
-
if (_maxLimit === MAX_LIMIT) {
|
|
38
|
-
_maxLimit = 99;
|
|
39
|
-
} else {
|
|
40
|
-
_maxLimit = MAX_LIMIT;
|
|
41
|
-
}
|
|
42
|
-
setMaxLimit(_maxLimit);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @title: 是否展开全部
|
|
47
|
-
* @description:
|
|
48
|
-
* @param {*} useMemo
|
|
49
|
-
* @return {*}
|
|
50
|
-
* @Author: zhiwei.Wang
|
|
51
|
-
* @Date: 2024-01-30 17:08
|
|
52
|
-
*/
|
|
53
|
-
var showAll = useMemo(function () {
|
|
54
|
-
return list.length > MAX_LIMIT;
|
|
55
|
-
}, [list]);
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* @title: 展开文案
|
|
59
|
-
* @description:
|
|
60
|
-
* @return {*}
|
|
61
|
-
* @Author: zhiwei.Wang
|
|
62
|
-
* @Date: 2024-01-30 17:08
|
|
63
|
-
*/
|
|
64
|
-
var viewAllText = useMemo(function () {
|
|
65
|
-
var _maxLimit = maxLimit;
|
|
66
|
-
if (_maxLimit === MAX_LIMIT) {
|
|
67
|
-
return locales.getText('pisell2.product.card.view-all');
|
|
68
|
-
}
|
|
69
|
-
return locales.getText('pisell2.product.card.view-less');
|
|
70
|
-
}, [maxLimit]);
|
|
71
|
-
var _list = useMemo(function () {
|
|
72
|
-
var arr = _toConsumableArray(list);
|
|
73
|
-
// 默认展示3条, 点击更多时展示全部
|
|
74
|
-
var _maxLimit = maxLimit;
|
|
75
|
-
if (list.length > _maxLimit) {
|
|
76
|
-
arr = arr.slice(0, _maxLimit);
|
|
77
|
-
}
|
|
78
|
-
return arr;
|
|
79
|
-
}, [list, maxLimit]);
|
|
80
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
81
|
-
className: classNames('pisell2-collapsible-list-wrap', className),
|
|
82
|
-
style: style
|
|
83
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
84
|
-
className: "pisell2-collapsible-list"
|
|
85
|
-
}, _list.map(function (d, i) {
|
|
86
|
-
return renderItem(d, i);
|
|
87
|
-
})), showAll ? /*#__PURE__*/React.createElement("div", {
|
|
88
|
-
className: "pisell2-collapsible-list-view-all",
|
|
89
|
-
onClick: function onClick(e) {
|
|
90
|
-
e.preventDefault();
|
|
91
|
-
e.stopPropagation();
|
|
92
|
-
handlePreviewAll();
|
|
93
|
-
}
|
|
94
|
-
}, viewAllText) : null);
|
|
95
|
-
};
|
|
96
|
-
export default CollapsibleList;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
@pisell-prefix: pisell-lowcode;
|
|
2
|
-
|
|
3
|
-
.@{pisell-prefix} {
|
|
4
|
-
&-packages-product-bundle-item {
|
|
5
|
-
width: 100%;
|
|
6
|
-
padding: 8px;
|
|
7
|
-
border-radius: 6px;
|
|
8
|
-
border: 1px solid var(--Gray-300, #d0d5dd);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
&-packages-product-bundle-info {
|
|
12
|
-
width: 100%;
|
|
13
|
-
display: flex;
|
|
14
|
-
align-items: center;
|
|
15
|
-
justify-content: space-between;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
&-packages-product-bundle-info-title {
|
|
19
|
-
color: var(--Gray-500, #667085);
|
|
20
|
-
font-family: Inter;
|
|
21
|
-
font-size: 14px;
|
|
22
|
-
font-style: normal;
|
|
23
|
-
font-weight: 600;
|
|
24
|
-
line-height: 20px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&-packages-product-bundle-info-num {
|
|
28
|
-
color: var(--Gray-500, #667085);
|
|
29
|
-
font-size: 14px;
|
|
30
|
-
font-style: normal;
|
|
31
|
-
font-weight: 500;
|
|
32
|
-
line-height: 20px;
|
|
33
|
-
flex-shrink: 0;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.pisell2-collapsible-list-wrap {
|
|
38
|
-
.pisell2-collapsible-list {
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-direction: column;
|
|
41
|
-
gap: 8px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.pisell2-collapsible-list-view-all {
|
|
45
|
-
margin-top: 4px;
|
|
46
|
-
color: #7f56d9;
|
|
47
|
-
font-size: 16px;
|
|
48
|
-
font-style: normal;
|
|
49
|
-
font-weight: 700;
|
|
50
|
-
line-height: 24px;
|
|
51
|
-
user-select: none;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Footer from "../../../AmountFooter";
|
|
3
|
-
import Note from "../../../Note";
|
|
4
|
-
import useEngineContext from "../../../../../../hooks/useEngineContext";
|
|
5
|
-
import { _formatAmount } from "../../utils";
|
|
6
|
-
import Options from "../options";
|
|
7
|
-
var prefix = 'pisell-lowcode-';
|
|
8
|
-
export var renderBundles = function renderBundles(item, hidePrice, isShowPackageNote) {
|
|
9
|
-
var _context$appHelper, _context$appHelper$ut;
|
|
10
|
-
var translationOriginal = function translationOriginal(text) {
|
|
11
|
-
return '';
|
|
12
|
-
};
|
|
13
|
-
var context = useEngineContext();
|
|
14
|
-
translationOriginal = context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.translationOriginal;
|
|
15
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
-
key: item.id,
|
|
17
|
-
className: "".concat(prefix, "packages-product-bundle-item")
|
|
18
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
className: "".concat(prefix, "packages-product-bundle-info")
|
|
20
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
className: "".concat(prefix, "packages-product-bundle-info-title")
|
|
22
|
-
}, translationOriginal(item === null || item === void 0 ? void 0 : item.title)), !hidePrice ? /*#__PURE__*/React.createElement("div", {
|
|
23
|
-
className: "".concat(prefix, "packages-product-bundle-info-num")
|
|
24
|
-
}, _formatAmount(item === null || item === void 0 ? void 0 : item.price, item === null || item === void 0 ? void 0 : item.symbol)) : null), /*#__PURE__*/React.createElement(Options, {
|
|
25
|
-
options: item === null || item === void 0 ? void 0 : item.option,
|
|
26
|
-
amountSymbol: item === null || item === void 0 ? void 0 : item.symbol
|
|
27
|
-
}), /*#__PURE__*/React.createElement(Footer, {
|
|
28
|
-
item: item
|
|
29
|
-
}), isShowPackageNote ? /*#__PURE__*/React.createElement(Note, {
|
|
30
|
-
item: item,
|
|
31
|
-
type: "inside"
|
|
32
|
-
}) : null);
|
|
33
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { _formatAmount } from "../../utils";
|
|
3
|
-
import "./index.less";
|
|
4
|
-
var prefix = 'pisell-lowcode-';
|
|
5
|
-
var Options = function Options(_ref) {
|
|
6
|
-
var options = _ref.options,
|
|
7
|
-
amountSymbol = _ref.amountSymbol;
|
|
8
|
-
return (options === null || options === void 0 ? void 0 : options.length) > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
className: "".concat(prefix, "packages-product-bundle-option")
|
|
10
|
-
}, options.map(function (option, index) {
|
|
11
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
-
key: option.id,
|
|
13
|
-
className: "".concat(prefix, "packages-product-bundle-option-item")
|
|
14
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
15
|
-
className: "".concat(prefix, "packages-product-bundle-option-item-left")
|
|
16
|
-
}, /*#__PURE__*/React.createElement("span", null, option === null || option === void 0 ? void 0 : option.name), /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
className: "".concat(prefix, "packages-product-bundle-option-item-left-amount")
|
|
18
|
-
}, /*#__PURE__*/React.createElement("span", null, _formatAmount(option === null || option === void 0 ? void 0 : option.add_price, amountSymbol)), /*#__PURE__*/React.createElement("span", null, "\xD7"), /*#__PURE__*/React.createElement("span", null, option === null || option === void 0 ? void 0 : option.num))), /*#__PURE__*/React.createElement("span", {
|
|
19
|
-
className: "".concat(prefix, "packages-product-bundle-option-item-amount")
|
|
20
|
-
}, _formatAmount((option === null || option === void 0 ? void 0 : option.add_price) * (option === null || option === void 0 ? void 0 : option.num), amountSymbol)));
|
|
21
|
-
})) : null;
|
|
22
|
-
};
|
|
23
|
-
export default Options;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
@pisell-prefix: pisell-lowcode;
|
|
2
|
-
|
|
3
|
-
.@{pisell-prefix} {
|
|
4
|
-
&-packages-product-bundle-option {
|
|
5
|
-
color: var(--gray-500, #667085);
|
|
6
|
-
font-size: 14px;
|
|
7
|
-
font-style: normal;
|
|
8
|
-
font-weight: 400;
|
|
9
|
-
line-height: 20px;
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&-packages-product-bundle-option-item {
|
|
15
|
-
display: flex;
|
|
16
|
-
justify-content: space-between;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&-packages-product-bundle-option-item-left {
|
|
20
|
-
display: flex;
|
|
21
|
-
gap: 4px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&-packages-product-bundle-option-item-left-amount {
|
|
25
|
-
margin-left: 8px;
|
|
26
|
-
display: flex;
|
|
27
|
-
gap: 4px;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import Divider from "../Divider";
|
|
9
|
-
import { locales } from '@pisell/utils';
|
|
10
|
-
import CollapsibleList from "./components/collapsibleList";
|
|
11
|
-
import { renderBundles } from "./components/collapsibleList/utils";
|
|
12
|
-
import "./index.less";
|
|
13
|
-
var prefix = 'pisell-lowcode-';
|
|
14
|
-
var Packages = function Packages(_ref) {
|
|
15
|
-
var item = _ref.item,
|
|
16
|
-
isShowPackageNote = _ref.isShowPackageNote;
|
|
17
|
-
var bundle = (item === null || item === void 0 ? void 0 : item.bundle) || [];
|
|
18
|
-
return (bundle === null || bundle === void 0 ? void 0 : bundle.length) > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, null), /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
className: "".concat(prefix, "product-packages-wrap")
|
|
20
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
21
|
-
className: "".concat(prefix, "product-packages-title")
|
|
22
|
-
}, locales.getText('pisell2.product.card.items.package')), /*#__PURE__*/React.createElement(CollapsibleList, {
|
|
23
|
-
list: bundle || [],
|
|
24
|
-
renderItem: function renderItem(items) {
|
|
25
|
-
return renderBundles(_objectSpread(_objectSpread({}, items), {}, {
|
|
26
|
-
symbol: item === null || item === void 0 ? void 0 : item.symbol,
|
|
27
|
-
total: items === null || items === void 0 ? void 0 : items.price
|
|
28
|
-
}), false, isShowPackageNote);
|
|
29
|
-
}
|
|
30
|
-
}))) : null;
|
|
31
|
-
};
|
|
32
|
-
export default Packages;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
@pisell-prefix: pisell-lowcode;
|
|
2
|
-
|
|
3
|
-
.@{pisell-prefix} {
|
|
4
|
-
&-product-packages-wrap {
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
gap: 8px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
&-product-packages-title {
|
|
11
|
-
color: var(--Gray-900, #101828);
|
|
12
|
-
font-size: 14px;
|
|
13
|
-
font-style: normal;
|
|
14
|
-
font-weight: 600;
|
|
15
|
-
line-height: 20px;
|
|
16
|
-
}
|
|
17
|
-
}
|