@pisell/materials 6.2.32 → 6.2.34
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 +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +20 -20
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.js +76 -0
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.less +75 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.js +82 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.less +31 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/utils.js +56 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +6 -6
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.less +1 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +1 -2
- package/es/components/productCard/cartSkuCard/components/resources/index.js +6 -8
- package/es/components/productCard/cartSkuCard/components/specs/index.less +1 -1
- package/es/components/productCard/cartSkuCard/components/timeRange/index.less +1 -1
- package/es/components/productCard/cartSkuCard/index.js +7 -7
- package/es/components/productCard/cartSkuCard/index.less +4 -0
- package/es/components/productCard/components/Header/index.js +1 -14
- package/es/components/productCard/components/Header/index.less +0 -20
- package/es/components/productCard/locales.js +3 -3
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.js +80 -0
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.less +75 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.js +71 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.less +31 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.d.ts +14 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/utils.js +77 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +2 -2
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.less +1 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +1 -2
- package/lib/components/productCard/cartSkuCard/components/resources/index.js +4 -6
- package/lib/components/productCard/cartSkuCard/components/specs/index.less +1 -1
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.less +1 -1
- package/lib/components/productCard/cartSkuCard/index.js +5 -6
- package/lib/components/productCard/cartSkuCard/index.less +4 -0
- package/lib/components/productCard/components/Header/index.js +0 -4
- package/lib/components/productCard/components/Header/index.less +0 -20
- package/lib/components/productCard/locales.js +3 -3
- package/package.json +3 -3
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/productCard/cartSkuCard/components/AmountFooter/index.tsx
|
|
30
|
+
var AmountFooter_exports = {};
|
|
31
|
+
__export(AmountFooter_exports, {
|
|
32
|
+
default: () => AmountFooter_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(AmountFooter_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_antd2 = require("antd");
|
|
39
|
+
var import_icons = require("@ant-design/icons");
|
|
40
|
+
var import_utils = require("../packages/utils");
|
|
41
|
+
var import_index = require("./index.less");
|
|
42
|
+
var import_utils2 = require("@pisell/utils");
|
|
43
|
+
var import__ = require("../../index");
|
|
44
|
+
var Footer = ({ item, hideDivider, type, isOnlyTotal }) => {
|
|
45
|
+
const { total, origin_total, symbol, tip, num, discount_reason } = item;
|
|
46
|
+
const isDiscount = (0, import_react.useMemo)(() => {
|
|
47
|
+
if (!origin_total) return false;
|
|
48
|
+
return Number(total) != Number(origin_total);
|
|
49
|
+
}, [total, origin_total]);
|
|
50
|
+
const renderDiscountReason = () => {
|
|
51
|
+
if (isDiscount && discount_reason && type === "total") {
|
|
52
|
+
if (Array.isArray(discount_reason)) {
|
|
53
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}_discount-reason` }, discount_reason.map((reason, index) => {
|
|
54
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd2.Tag, { key: index, color: "red" }, reason);
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Divider, null), /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}_discount-reason` }, /* @__PURE__ */ import_react.default.createElement("span", null, `${import_utils2.locales.getText(
|
|
58
|
+
"pisell2.product.card.discount.reason"
|
|
59
|
+
)}: ${discount_reason}`)));
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !hideDivider ? /* @__PURE__ */ import_react.default.createElement(import_antd.Divider, { style: { margin: 0 } }) : null, /* @__PURE__ */ import_react.default.createElement(
|
|
64
|
+
"div",
|
|
65
|
+
{
|
|
66
|
+
className: (0, import_classnames.default)(
|
|
67
|
+
`${import__.PREFIX}__product-footer`,
|
|
68
|
+
hideDivider && `${import__.PREFIX}__hide-divider-footer`,
|
|
69
|
+
isOnlyTotal && `${import__.PREFIX}__only-total-footer`
|
|
70
|
+
)
|
|
71
|
+
},
|
|
72
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${import__.PREFIX}__footer-price-wrap`) }, !isOnlyTotal ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${import__.PREFIX}__footer-price`) }, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_utils._formatAmount)(total, symbol)), tip ? /* @__PURE__ */ import_react.default.createElement(import_antd2.Tooltip, { title: import_utils2.locales.getText(tip), destroyTooltipOnHide: true }, /* @__PURE__ */ import_react.default.createElement(
|
|
73
|
+
import_icons.QuestionCircleOutlined,
|
|
74
|
+
{
|
|
75
|
+
style: { fontSize: "16px", color: "#1570ef" }
|
|
76
|
+
}
|
|
77
|
+
)) : null), /* @__PURE__ */ import_react.default.createElement("span", null, `×${num}`)) : null, /* @__PURE__ */ import_react.default.createElement("span", { className: `${import__.PREFIX}__footer-total` }, isDiscount ? /* @__PURE__ */ import_react.default.createElement("span", { className: `${import__.PREFIX}__footer-origin-total` }, (0, import_utils._formatAmount)(origin_total * num, symbol, 2)) : null, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_utils._formatAmount)(total * num, symbol))))
|
|
78
|
+
), renderDiscountReason());
|
|
79
|
+
};
|
|
80
|
+
var AmountFooter_default = Footer;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
.pisell-cart-sku-card {
|
|
2
|
+
&__product-footer {
|
|
3
|
+
color: var(--Gray-500, #667085);
|
|
4
|
+
font-size: 14px;
|
|
5
|
+
font-style: normal;
|
|
6
|
+
font-weight: 600;
|
|
7
|
+
line-height: 20px;
|
|
8
|
+
> div {
|
|
9
|
+
display: flex;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
&__only-total-footer {
|
|
14
|
+
> div {
|
|
15
|
+
justify-content: end !important;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&__footer-price {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
gap: 4px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&__footer-discount {
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
line-height: 18px;
|
|
29
|
+
text-decoration-line: line-through;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__footer-total {
|
|
33
|
+
color: var(--Gray-900, #101828);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&__footer-origin-total {
|
|
37
|
+
color: var(--Gray-500, #667085);
|
|
38
|
+
text-align: center;
|
|
39
|
+
font-size: 12px;
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: 400;
|
|
42
|
+
line-height: 18px; /* 150% */
|
|
43
|
+
text-decoration-line: line-through;
|
|
44
|
+
margin-right: 8px;
|
|
45
|
+
display: inline-block;
|
|
46
|
+
transform: translateY(-1px);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&__hide-divider-footer {
|
|
50
|
+
margin-top: 8px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&-product-item-discount-reason {
|
|
54
|
+
color: var(--gray-500, #667085);
|
|
55
|
+
font-size: 14px;
|
|
56
|
+
font-style: normal;
|
|
57
|
+
font-weight: 400;
|
|
58
|
+
line-height: 20px;
|
|
59
|
+
margin-top: 4px;
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-wrap: wrap;
|
|
62
|
+
gap: 4px;
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
|
|
65
|
+
> span {
|
|
66
|
+
display: inline-block;
|
|
67
|
+
max-width: 100%;
|
|
68
|
+
text-overflow: ellipsis;
|
|
69
|
+
white-space: nowrap;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
border-radius: 4px;
|
|
72
|
+
margin: 0;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/productCard/cartSkuCard/components/MultiDay/index.tsx
|
|
30
|
+
var MultiDay_exports = {};
|
|
31
|
+
__export(MultiDay_exports, {
|
|
32
|
+
default: () => MultiDay_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(MultiDay_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_AmountFooter = __toESM(require("../AmountFooter"));
|
|
39
|
+
var import_utils = require("../../../utils");
|
|
40
|
+
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
41
|
+
var import_index = require("./index.less");
|
|
42
|
+
var import_utils2 = require("./utils");
|
|
43
|
+
var import__ = require("../../index");
|
|
44
|
+
var MultiDay = ({ dataSource, hideDivider }) => {
|
|
45
|
+
var _a;
|
|
46
|
+
const { items, symbol, locale } = dataSource;
|
|
47
|
+
let translationOriginal = (text) => "";
|
|
48
|
+
const context = (0, import_useEngineContext.default)();
|
|
49
|
+
const utils = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils;
|
|
50
|
+
translationOriginal = (utils == null ? void 0 : utils.translationOriginal) || (utils == null ? void 0 : utils.translation);
|
|
51
|
+
const lists = (0, import_react.useMemo)(() => {
|
|
52
|
+
return (0, import_utils2.formatDateRanges)([dataSource]);
|
|
53
|
+
}, [items, dataSource]);
|
|
54
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${import__.PREFIX}__multi-day-wrap`) }, lists == null ? void 0 : lists.map((m, index) => {
|
|
55
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { key: index }, /* @__PURE__ */ import_react.default.createElement(import_antd.Divider, { style: { margin: "4px 0" } }), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${import__.PREFIX}__multi-day`) }, /* @__PURE__ */ import_react.default.createElement("div", null, (0, import_utils.formatMultiDayDate)({ ...m, locale })), /* @__PURE__ */ import_react.default.createElement(
|
|
56
|
+
import_AmountFooter.default,
|
|
57
|
+
{
|
|
58
|
+
item: { ...m, symbol },
|
|
59
|
+
hideDivider: true
|
|
60
|
+
}
|
|
61
|
+
)));
|
|
62
|
+
}), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${import__.PREFIX}__multi-day-total-wrap`) }, /* @__PURE__ */ import_react.default.createElement(
|
|
63
|
+
import_AmountFooter.default,
|
|
64
|
+
{
|
|
65
|
+
item: { ...dataSource, num: 1 },
|
|
66
|
+
type: "total",
|
|
67
|
+
isOnlyTotal: true
|
|
68
|
+
}
|
|
69
|
+
)));
|
|
70
|
+
};
|
|
71
|
+
var MultiDay_default = MultiDay;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.pisell-cart-sku-card {
|
|
2
|
+
&__multi-day-wrap {
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
&__multi-day {
|
|
6
|
+
color: var(--Gray-500, #667085);
|
|
7
|
+
font-size: 14px;
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
line-height: 20px;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&__multi-day-total {
|
|
15
|
+
color: var(--Gray-900, #101828);
|
|
16
|
+
text-align: right;
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
font-weight: 600;
|
|
19
|
+
line-height: 20px;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&__multi-day-total-discount {
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
line-height: 18px;
|
|
28
|
+
text-decoration-line: line-through;
|
|
29
|
+
color: var(--Gray-500, #667085);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface InputItem {
|
|
2
|
+
start_date: string;
|
|
3
|
+
end_date: string;
|
|
4
|
+
total: number;
|
|
5
|
+
num: number;
|
|
6
|
+
}
|
|
7
|
+
interface OutputItem {
|
|
8
|
+
start_date: string;
|
|
9
|
+
end_date: string;
|
|
10
|
+
total: number;
|
|
11
|
+
num: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function formatDateRanges(list: InputItem[]): OutputItem[];
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/productCard/cartSkuCard/components/MultiDay/utils.ts
|
|
30
|
+
var utils_exports = {};
|
|
31
|
+
__export(utils_exports, {
|
|
32
|
+
formatDateRanges: () => formatDateRanges
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(utils_exports);
|
|
35
|
+
var import_dayjs = __toESM(require("dayjs"));
|
|
36
|
+
function formatDateRanges(list) {
|
|
37
|
+
const result = [];
|
|
38
|
+
let currentGroup = null;
|
|
39
|
+
list.forEach((item, index) => {
|
|
40
|
+
const currentStartDate = (0, import_dayjs.default)(item.start_date);
|
|
41
|
+
const currentEndDate = (0, import_dayjs.default)(item.end_date);
|
|
42
|
+
const currentTotal = item.total;
|
|
43
|
+
const currentNum = item.num;
|
|
44
|
+
if (!currentGroup) {
|
|
45
|
+
currentGroup = {
|
|
46
|
+
...item,
|
|
47
|
+
start_date: currentStartDate.format("YYYY-MM-DD"),
|
|
48
|
+
end_date: currentEndDate.format("YYYY-MM-DD"),
|
|
49
|
+
total: currentTotal,
|
|
50
|
+
num: currentNum
|
|
51
|
+
};
|
|
52
|
+
} else {
|
|
53
|
+
const prevEndDate = (0, import_dayjs.default)(currentGroup.end_date);
|
|
54
|
+
if (currentTotal === currentGroup.total && prevEndDate.isSame(currentStartDate, "day")) {
|
|
55
|
+
currentGroup.end_date = currentEndDate.format("YYYY-MM-DD");
|
|
56
|
+
currentGroup.num += currentNum;
|
|
57
|
+
} else {
|
|
58
|
+
result.push(currentGroup);
|
|
59
|
+
currentGroup = {
|
|
60
|
+
...item,
|
|
61
|
+
start_date: currentStartDate.format("YYYY-MM-DD"),
|
|
62
|
+
end_date: currentEndDate.format("YYYY-MM-DD"),
|
|
63
|
+
total: currentTotal,
|
|
64
|
+
num: currentNum
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (index === list.length - 1 && currentGroup) {
|
|
69
|
+
result.push(currentGroup);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
formatDateRanges
|
|
77
|
+
});
|
|
@@ -75,8 +75,8 @@ var BasicInfo = (props) => {
|
|
|
75
75
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: `product-cover-text` }, displayText);
|
|
76
76
|
};
|
|
77
77
|
if (type === "a5") {
|
|
78
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__basic-info`, style: style || {} }, renderNumTag(), renderImage(), !isShowImage || !image && !name ? /* @__PURE__ */ import_react.default.createElement("div", { style: { width:
|
|
78
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__basic-info`, style: style || {} }, renderNumTag(), renderImage(), !isShowImage || !image && !name ? /* @__PURE__ */ import_react.default.createElement("div", { style: { width: 20 } }) : null, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-info` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-name` }, name), !holder_id || !(holder_id == null ? void 0 : holder_id.length) ? /* @__PURE__ */ import_react.default.createElement("div", { className: `product-price` }, (0, import_utils.formatAmount)(price, 2, symbol)) : /* @__PURE__ */ import_react.default.createElement(import_holders.default, { dataSource })));
|
|
79
79
|
}
|
|
80
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__basic-info`, style: style || {} }, renderNumTag(), renderImage(), !isShowImage || !image && !name ? /* @__PURE__ */ import_react.default.createElement("div", { style: { width:
|
|
80
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__basic-info`, style: style || {} }, renderNumTag(), renderImage(), !isShowImage || !image && !name ? /* @__PURE__ */ import_react.default.createElement("div", { style: { width: 20 } }) : null, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-info` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `product-name` }, name), hasSpecs ? /* @__PURE__ */ import_react.default.createElement(import_specs.default, { dataSource }) : /* @__PURE__ */ import_react.default.createElement("div", { className: `product-price` }, (0, import_utils.formatAmount)(price, 2, symbol))), /* @__PURE__ */ import_react.default.createElement("div", { className: `product-amount` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `total-amont` }, (0, import_utils.formatAmount)(total * num, 2, symbol)), origin_total && Number(total) !== Number(origin_total) ? /* @__PURE__ */ import_react.default.createElement("div", { className: `origin-amount` }, (0, import_utils.formatAmount)(origin_total * num, 2, symbol)) : null));
|
|
81
81
|
};
|
|
82
82
|
var basicInfo_default = BasicInfo;
|
|
@@ -63,11 +63,9 @@ var Resources = (props) => {
|
|
|
63
63
|
return null;
|
|
64
64
|
}) : null;
|
|
65
65
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
71
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__resources` }, renderContent());
|
|
66
|
+
if (isMultipleResource && (multiResources == null ? void 0 : multiResources.length) > 0) {
|
|
67
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${import__.PREFIX}__resources` }, multiResources.map(renderResourceItem));
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
72
70
|
};
|
|
73
71
|
var resources_default = Resources;
|
|
@@ -45,11 +45,11 @@ var import_packages = __toESM(require("./components/packages"));
|
|
|
45
45
|
var import_sales = __toESM(require("./components/sales"));
|
|
46
46
|
var import_swipeAction = require("./components/swipeAction");
|
|
47
47
|
var import_Note = __toESM(require("./components/Note"));
|
|
48
|
+
var import_AmountFooter = __toESM(require("./components/AmountFooter"));
|
|
49
|
+
var import_MultiDay = __toESM(require("./components/MultiDay"));
|
|
48
50
|
var import_index = require("./index.less");
|
|
49
51
|
var import_iconfont = __toESM(require("../../iconfont"));
|
|
50
52
|
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
51
|
-
var import_MultiDay = __toESM(require("../components/MultiDay"));
|
|
52
|
-
var import_AmountFooter = __toESM(require("../components/AmountFooter"));
|
|
53
53
|
var import_Action = __toESM(require("../components/Action"));
|
|
54
54
|
var import_status = require("../status");
|
|
55
55
|
var PREFIX = "pisell-cart-sku-card";
|
|
@@ -122,8 +122,7 @@ var CartSkuCard = (props) => {
|
|
|
122
122
|
return actions;
|
|
123
123
|
}, [dataSource, onDelete, isShowDelete, rightActions]);
|
|
124
124
|
const hideDivider = (0, import_react.useMemo)(() => {
|
|
125
|
-
|
|
126
|
-
return (bundle == null ? void 0 : bundle.length) || (relation_products == null ? void 0 : relation_products.length);
|
|
125
|
+
return false;
|
|
127
126
|
}, [dataSource]);
|
|
128
127
|
const renderA2 = () => {
|
|
129
128
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -162,7 +161,7 @@ var CartSkuCard = (props) => {
|
|
|
162
161
|
) : null, /* @__PURE__ */ import_react.default.createElement(
|
|
163
162
|
import_basicInfo.default,
|
|
164
163
|
{
|
|
165
|
-
isShowImage
|
|
164
|
+
isShowImage,
|
|
166
165
|
dataSource,
|
|
167
166
|
isMainProduct: true,
|
|
168
167
|
type
|
|
@@ -223,7 +222,7 @@ var CartSkuCard = (props) => {
|
|
|
223
222
|
) : /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${PREFIX}-wrapper`) }, /* @__PURE__ */ import_react.default.createElement(
|
|
224
223
|
"div",
|
|
225
224
|
{
|
|
226
|
-
className: (0, import_classnames.default)(PREFIX, `${PREFIX}
|
|
225
|
+
className: (0, import_classnames.default)(PREFIX, `${PREFIX}-${type}`),
|
|
227
226
|
onClick: (e) => {
|
|
228
227
|
e.preventDefault();
|
|
229
228
|
e.stopPropagation();
|
|
@@ -72,9 +72,6 @@ var Header = (props) => {
|
|
|
72
72
|
const showDelete = (0, import_react.useMemo)(() => {
|
|
73
73
|
return isShowDelete && !disabledEdit && !disabled;
|
|
74
74
|
}, [isShowDelete, disabledEdit, disabled]);
|
|
75
|
-
const renderNumTag = () => {
|
|
76
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`num-tag`) }, num < 100 ? num : "99+");
|
|
77
|
-
};
|
|
78
75
|
const renderImage = () => {
|
|
79
76
|
if (!isShowImage) return null;
|
|
80
77
|
if (image) {
|
|
@@ -98,7 +95,6 @@ var Header = (props) => {
|
|
|
98
95
|
)
|
|
99
96
|
},
|
|
100
97
|
showDelete ? /* @__PURE__ */ import_react.default.createElement(import_DeleteButton.default, { onDelete }) : null,
|
|
101
|
-
renderNumTag(),
|
|
102
98
|
renderImage(),
|
|
103
99
|
id ? /* @__PURE__ */ import_react.default.createElement(
|
|
104
100
|
"div",
|
|
@@ -6,26 +6,6 @@
|
|
|
6
6
|
align-items: center;
|
|
7
7
|
gap: 8px;
|
|
8
8
|
padding-right: 0 !important;
|
|
9
|
-
|
|
10
|
-
.num-tag {
|
|
11
|
-
background-color: #7f56da;
|
|
12
|
-
position: absolute;
|
|
13
|
-
left: 0;
|
|
14
|
-
top: 0;
|
|
15
|
-
border-radius: 12px;
|
|
16
|
-
min-width: 24px;
|
|
17
|
-
height: 24px;
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
justify-content: center;
|
|
21
|
-
z-index: 1;
|
|
22
|
-
|
|
23
|
-
color: var(--Base-White, #fff);
|
|
24
|
-
font-size: 16px;
|
|
25
|
-
font-style: normal;
|
|
26
|
-
font-weight: 600;
|
|
27
|
-
line-height: 16px;
|
|
28
|
-
}
|
|
29
9
|
}
|
|
30
10
|
|
|
31
11
|
&-product-options-header {
|
|
@@ -43,7 +43,7 @@ var locales_default = {
|
|
|
43
43
|
"pisell2.product.card.add.holder.placeholder.multiple": (num, val) => `Please Select ${num} ${val || ""}`,
|
|
44
44
|
"pisell2.product.card.add.holder.modal.title.1": `Please Select`,
|
|
45
45
|
"pisell2.product.card.hour.minute": (hour, minute) => {
|
|
46
|
-
if (hour
|
|
46
|
+
if (hour <= 0 && minute <= 0) return `${0}min`;
|
|
47
47
|
return `${hour > 0 ? `${hour}h` : ""}${hour > 0 && minute > 0 ? " " : ""}${minute > 0 ? `${minute}min` : ""}`;
|
|
48
48
|
},
|
|
49
49
|
"pisell2.product.card.sales": "Sales",
|
|
@@ -73,7 +73,7 @@ var locales_default = {
|
|
|
73
73
|
"pisell2.product.card.add.holder.placeholder.multiple": (num, val) => `请选择${num}${val || ""}`,
|
|
74
74
|
"pisell2.product.card.add.holder.modal.title.1": `请选择`,
|
|
75
75
|
"pisell2.product.card.hour.minute": (hour, minute) => {
|
|
76
|
-
if (hour
|
|
76
|
+
if (hour <= 0 && minute <= 0) return `${0}分钟`;
|
|
77
77
|
return `${hour > 0 ? `${hour}小时` : ""}${minute > 0 ? `${minute}分钟` : ""}`;
|
|
78
78
|
},
|
|
79
79
|
"pisell2.product.card.sales": "销售",
|
|
@@ -103,7 +103,7 @@ var locales_default = {
|
|
|
103
103
|
"pisell2.product.card.add.holder.placeholder.multiple": (num, val) => `請選擇${num}${val || ""}`,
|
|
104
104
|
"pisell2.product.card.add.holder.modal.title.1": `請選擇`,
|
|
105
105
|
"pisell2.product.card.hour.minute": (hour, minute) => {
|
|
106
|
-
if (hour
|
|
106
|
+
if (hour <= 0 && minute <= 0) return `${0}分鐘`;
|
|
107
107
|
return `${hour > 0 ? `${hour}小時` : ""}${minute > 0 ? `${minute}分鐘` : ""}`;
|
|
108
108
|
},
|
|
109
109
|
"pisell2.product.card.sales": "銷售",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.34",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"swiper": "^8.4.7",
|
|
75
75
|
"vod-js-sdk-v6": "^1.4.11",
|
|
76
76
|
"@pisell/date-picker": "3.0.4",
|
|
77
|
-
"@pisell/
|
|
78
|
-
"@pisell/
|
|
77
|
+
"@pisell/icon": "0.0.11",
|
|
78
|
+
"@pisell/utils": "3.0.0"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"react": "^18.0.0",
|