@pisell/materials 2.2.39 → 2.2.40
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 +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +24 -24
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +14 -14
- package/dist/umd/materials.min.css +1 -0
- package/dist/umd/materials.min.js +1 -0
- package/dist/umd/static/DotsSix.57d66266.svg +1 -0
- package/dist/umd/static/arrow-left.e542294f.svg +1 -0
- package/dist/umd/static/arrow-right.763f03e0.svg +1 -0
- package/dist/umd/static/filter-lines.04a54ae9.svg +1 -0
- package/dist/umd/static/help-circle.31c9be40.svg +1 -0
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +1 -0
- package/es/components/collapse/index.js +27 -4
- package/es/components/productCard/components/Action/index.js +1 -1
- package/es/components/productCard/components/AmountFooter/index.d.ts +1 -1
- package/es/components/productCard/components/AmountFooter/index.js +30 -10
- package/es/components/productCard/components/AmountFooter/index.less +11 -0
- package/es/components/productCard/components/Header/index.js +22 -14
- package/es/components/productCard/components/MultiDay/index.d.ts +4 -0
- package/es/components/productCard/components/MultiDay/index.js +79 -0
- package/es/components/productCard/components/MultiDay/index.less +34 -0
- package/es/components/productCard/components/MultiDay/utils.d.ts +14 -0
- package/es/components/productCard/components/MultiDay/utils.js +54 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.js +11 -5
- package/es/components/productCard/components/Packages/components/options/index.js +2 -2
- package/es/components/productCard/components/Packages/index.js +1 -2
- package/es/components/productCard/components/Sales/index.js +2 -2
- package/es/components/productCard/components/Time/index.js +15 -13
- package/es/components/productCard/index.d.ts +1 -1
- package/es/components/productCard/index.js +34 -20
- package/es/components/productCard/index.less +3 -2
- package/es/components/productCard/status.d.ts +24 -1
- package/es/components/productCard/status.js +52 -2
- package/es/components/productCard/types.d.ts +60 -1
- package/es/components/productCard/utils.d.ts +10 -144
- package/es/components/productCard/utils.js +36 -673
- package/es/components/table/Table/utils.d.ts +1 -1
- package/lib/components/collapse/index.js +30 -4
- package/lib/components/productCard/components/Action/index.js +1 -1
- package/lib/components/productCard/components/AmountFooter/index.d.ts +1 -1
- package/lib/components/productCard/components/AmountFooter/index.js +33 -9
- package/lib/components/productCard/components/AmountFooter/index.less +11 -0
- package/lib/components/productCard/components/Header/index.js +16 -8
- package/lib/components/productCard/components/MultiDay/index.d.ts +4 -0
- package/lib/components/productCard/components/MultiDay/index.js +72 -0
- package/lib/components/productCard/components/MultiDay/index.less +34 -0
- package/lib/components/productCard/components/MultiDay/utils.d.ts +14 -0
- package/lib/components/productCard/components/MultiDay/utils.js +77 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.js +2 -1
- package/lib/components/productCard/components/Packages/components/options/index.js +2 -2
- package/lib/components/productCard/components/Packages/index.js +1 -1
- package/lib/components/productCard/components/Sales/index.js +1 -2
- package/lib/components/productCard/components/Time/index.js +14 -11
- package/lib/components/productCard/index.d.ts +1 -1
- package/lib/components/productCard/index.js +32 -20
- package/lib/components/productCard/index.less +3 -2
- package/lib/components/productCard/status.d.ts +24 -1
- package/lib/components/productCard/status.js +35 -2
- package/lib/components/productCard/types.d.ts +60 -1
- package/lib/components/productCard/utils.d.ts +10 -144
- package/lib/components/productCard/utils.js +30 -567
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/package.json +1 -1
- package/es/components/table/Actions/component/ExportImport/utils/index.d.ts +0 -9
- package/es/components/table/Actions/component/ExportImport/utils/index.js +0 -11
- package/lib/components/table/Actions/component/ExportImport/utils/index.d.ts +0 -9
- package/lib/components/table/Actions/component/ExportImport/utils/index.js +0 -31
|
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
155
155
|
sort?: SortType | undefined;
|
|
156
156
|
mode: "" | "localStorage" | "remote";
|
|
157
157
|
currentViewMode: ModeType;
|
|
158
|
-
}) => ("
|
|
158
|
+
}) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
|
|
159
159
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
160
160
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
161
161
|
export {};
|
|
@@ -34,7 +34,28 @@ __export(collapse_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(collapse_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_antd = require("antd");
|
|
37
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
37
38
|
var import_index = require("./index.less");
|
|
39
|
+
var CustomCollapse = (0, import_styled_components.default)(import_antd.Collapse)`
|
|
40
|
+
&.custom-collapse {
|
|
41
|
+
background-color: ${(props) => props.panelBackground || "#ffffff"};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// .ant-collapse-item {
|
|
45
|
+
// background-color: ${(props) => props.panelBackground || "#ffffff"};
|
|
46
|
+
// margin-bottom: ${(props) => props.panelMarginBottom || "0"};
|
|
47
|
+
// border-radius: ${(props) => props.panelBorderRadius || "0"};
|
|
48
|
+
// }
|
|
49
|
+
|
|
50
|
+
// .pisell-lowcode-collapse-header {
|
|
51
|
+
// background-color: ${(props) => props.panelBackground || "#ffffff"};
|
|
52
|
+
// border-radius: ${(props) => props.panelBorderRadius || "0"} !important;
|
|
53
|
+
// }
|
|
54
|
+
|
|
55
|
+
.pisell-lowcode-collapse-content {
|
|
56
|
+
background-color: ${(props) => props.panelBackground || "#ffffff"};
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
38
59
|
var Collapse = (props) => {
|
|
39
60
|
const {
|
|
40
61
|
panelBackground,
|
|
@@ -66,16 +87,21 @@ var Collapse = (props) => {
|
|
|
66
87
|
},
|
|
67
88
|
item == null ? void 0 : item.label
|
|
68
89
|
) : null,
|
|
69
|
-
|
|
90
|
+
children: item.children,
|
|
91
|
+
className: "custom-collapse-panel"
|
|
70
92
|
};
|
|
71
93
|
});
|
|
72
|
-
}, [items, headerColor, showHeader, headerFontSize
|
|
94
|
+
}, [items, headerColor, showHeader, headerFontSize]);
|
|
73
95
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
74
|
-
|
|
96
|
+
CustomCollapse,
|
|
75
97
|
{
|
|
76
98
|
...rest,
|
|
77
99
|
expandIcon: expandIcon ? () => expandIcon : void 0,
|
|
78
|
-
items: itemsMap
|
|
100
|
+
items: itemsMap,
|
|
101
|
+
className: "custom-collapse",
|
|
102
|
+
panelBackground,
|
|
103
|
+
panelMarginBottom,
|
|
104
|
+
panelBorderRadius
|
|
79
105
|
}
|
|
80
106
|
);
|
|
81
107
|
};
|
|
@@ -34,28 +34,52 @@ __export(AmountFooter_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(AmountFooter_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_antd = require("antd");
|
|
38
|
+
var import_icons = require("@ant-design/icons");
|
|
37
39
|
var import_utils = require("../Packages/utils");
|
|
38
40
|
var import_Divider = __toESM(require("../Divider"));
|
|
39
41
|
var import_index = require("./index.less");
|
|
40
42
|
var import_utils2 = require("@pisell/utils");
|
|
41
43
|
var prefix = "pisell-lowcode-";
|
|
42
|
-
var Footer = ({ item, hideDivider, type }) => {
|
|
43
|
-
|
|
44
|
+
var Footer = ({ item, hideDivider, type, isOnlyTotal }) => {
|
|
45
|
+
const { total, origin_total, symbol, tip, num, discount_reason } = item;
|
|
44
46
|
const isDiscount = (0, import_react.useMemo)(() => {
|
|
45
|
-
if (!
|
|
47
|
+
if (!origin_total)
|
|
46
48
|
return false;
|
|
47
|
-
return Number(
|
|
48
|
-
}, [
|
|
49
|
+
return Number(total) != Number(origin_total);
|
|
50
|
+
}, [total, origin_total]);
|
|
49
51
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !hideDivider ? /* @__PURE__ */ import_react.default.createElement(import_Divider.default, { type: type !== "total" ? "inside" : "" }) : null, /* @__PURE__ */ import_react.default.createElement(
|
|
50
52
|
"div",
|
|
51
53
|
{
|
|
52
54
|
className: (0, import_classnames.default)(
|
|
53
55
|
`${prefix}packages-product-footer`,
|
|
54
|
-
hideDivider && `${prefix}packages-product-hide-divider-footer
|
|
56
|
+
hideDivider && `${prefix}packages-product-hide-divider-footer`,
|
|
57
|
+
isOnlyTotal && `${prefix}packages-product-only-total-footer`
|
|
55
58
|
)
|
|
56
59
|
},
|
|
57
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: (0, import_classnames.default)(`${prefix}packages-product-footer-price-wrap`)
|
|
64
|
+
},
|
|
65
|
+
!isOnlyTotal ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className: (0, import_classnames.default)(`${prefix}packages-product-footer-price`)
|
|
69
|
+
},
|
|
70
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, (0, import_utils._formatAmount)(total, symbol)),
|
|
71
|
+
tip ? /* @__PURE__ */ import_react.default.createElement(import_antd.Tooltip, { title: import_utils2.locales.getText(tip), destroyTooltipOnHide: true }, /* @__PURE__ */ import_react.default.createElement(
|
|
72
|
+
import_icons.QuestionCircleOutlined,
|
|
73
|
+
{
|
|
74
|
+
style: { fontSize: "16px", color: "#1570ef" }
|
|
75
|
+
}
|
|
76
|
+
)) : null
|
|
77
|
+
), /* @__PURE__ */ import_react.default.createElement("span", null, `×${num}`)) : null,
|
|
78
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}packages-product-footer-total` }, (0, import_utils._formatAmount)(total * num, symbol))
|
|
79
|
+
),
|
|
80
|
+
isDiscount ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-footer-discount` }, !isOnlyTotal ? /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_utils._formatAmount)(origin_total, symbol)) : null, /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_utils._formatAmount)(origin_total * num, symbol, 2))) : null
|
|
81
|
+
), isDiscount && discount_reason && type === "total" ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_Divider.default, null), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-item-discount-reason` }, /* @__PURE__ */ import_react.default.createElement("span", null, `${import_utils2.locales.getText(
|
|
82
|
+
"pisell2.product.card.discount.reason"
|
|
83
|
+
)}: ${discount_reason}`))) : null);
|
|
60
84
|
};
|
|
61
85
|
var AmountFooter_default = Footer;
|
|
@@ -12,6 +12,17 @@
|
|
|
12
12
|
justify-content: space-between;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
&-packages-product-only-total-footer {
|
|
16
|
+
> div {
|
|
17
|
+
justify-content: end !important;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&-packages-product-footer-price {
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: 4px;
|
|
25
|
+
}
|
|
15
26
|
|
|
16
27
|
&-packages-product-footer-discount {
|
|
17
28
|
font-size: 12px;
|
|
@@ -42,14 +42,22 @@ var import_index = require("./index.less");
|
|
|
42
42
|
var prefix = "pisell-lowcode-";
|
|
43
43
|
var Header = (props) => {
|
|
44
44
|
const { isShowDelete, item, showImage, onDelete, disabledEdit } = props;
|
|
45
|
+
const {
|
|
46
|
+
id,
|
|
47
|
+
options,
|
|
48
|
+
bundle,
|
|
49
|
+
product_option_string,
|
|
50
|
+
image,
|
|
51
|
+
name,
|
|
52
|
+
price,
|
|
53
|
+
symbol
|
|
54
|
+
} = item;
|
|
45
55
|
const showPrice = (0, import_react.useMemo)(() => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [item == null ? void 0 : item.bundle, item == null ? void 0 : item.options]);
|
|
56
|
+
return (bundle == null ? void 0 : bundle.length) > 0 || (options == null ? void 0 : options.length) > 0;
|
|
57
|
+
}, [bundle, options]);
|
|
49
58
|
const headerCenterStyle = (0, import_react.useMemo)(() => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, [item == null ? void 0 : item.options, item == null ? void 0 : item.product_option_string]);
|
|
59
|
+
return (options == null ? void 0 : options.length) > 0 || product_option_string;
|
|
60
|
+
}, [options, product_option_string]);
|
|
53
61
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
54
62
|
"div",
|
|
55
63
|
{
|
|
@@ -72,11 +80,11 @@ var Header = (props) => {
|
|
|
72
80
|
showImage ? /* @__PURE__ */ import_react.default.createElement(
|
|
73
81
|
"img",
|
|
74
82
|
{
|
|
75
|
-
src: import_utils.image.ali(
|
|
83
|
+
src: import_utils.image.ali(image, 64),
|
|
76
84
|
className: `${prefix}product-header-cover`
|
|
77
85
|
}
|
|
78
86
|
) : null,
|
|
79
|
-
|
|
87
|
+
id ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-right-wrap` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-title` }, /* @__PURE__ */ import_react.default.createElement("span", null, name), showPrice ? /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}product-title-price` }, (0, import_utils.formatAmount)(price, 2, symbol)) : null), product_option_string ? /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}product-title-variant` }, product_option_string) : null, /* @__PURE__ */ import_react.default.createElement(import_options.default, { options, amountSymbol: symbol })) : null
|
|
80
88
|
);
|
|
81
89
|
};
|
|
82
90
|
var Header_default = Header;
|
|
@@ -0,0 +1,72 @@
|
|
|
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/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_Divider = __toESM(require("../Divider"));
|
|
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 prefix = "pisell-lowcode-";
|
|
44
|
+
var MultiDay = ({ dataSource, hideDivider }) => {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
const { items, symbol, locale } = dataSource;
|
|
47
|
+
let translationOriginal = (text) => "";
|
|
48
|
+
const context = (0, import_useEngineContext.default)();
|
|
49
|
+
translationOriginal = (_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.translationOriginal;
|
|
50
|
+
const lists = (0, import_react.useMemo)(() => {
|
|
51
|
+
if (!(items == null ? void 0 : items.length))
|
|
52
|
+
return [];
|
|
53
|
+
return (0, import_utils2.formatDateRanges)(items);
|
|
54
|
+
}, [items]);
|
|
55
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${prefix}multi-day-wrap`) }, lists == null ? void 0 : lists.map((m, index) => {
|
|
56
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { key: index }, /* @__PURE__ */ import_react.default.createElement(import_Divider.default, { type: "inside" }), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${prefix}multi-day`) }, /* @__PURE__ */ import_react.default.createElement("div", null, (0, import_utils.formatMultiDayDate)({ ...m, locale })), /* @__PURE__ */ import_react.default.createElement(
|
|
57
|
+
import_AmountFooter.default,
|
|
58
|
+
{
|
|
59
|
+
item: { ...m, symbol },
|
|
60
|
+
hideDivider: true
|
|
61
|
+
}
|
|
62
|
+
)));
|
|
63
|
+
}), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${prefix}multi-day-total-wrap`) }, /* @__PURE__ */ import_react.default.createElement(
|
|
64
|
+
import_AmountFooter.default,
|
|
65
|
+
{
|
|
66
|
+
item: { ...dataSource, num: 1 },
|
|
67
|
+
type: "total",
|
|
68
|
+
isOnlyTotal: true
|
|
69
|
+
}
|
|
70
|
+
)));
|
|
71
|
+
};
|
|
72
|
+
var MultiDay_default = MultiDay;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@pisell-prefix: pisell-lowcode;
|
|
2
|
+
|
|
3
|
+
.@{pisell-prefix} {
|
|
4
|
+
&-multi-day-wrap {
|
|
5
|
+
margin-top: 16px;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&-multi-day {
|
|
9
|
+
color: var(--Gray-500, #667085);
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
line-height: 20px;
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&-multi-day-total {
|
|
18
|
+
color: var(--Gray-900, #101828);
|
|
19
|
+
text-align: right;
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
font-weight: 600;
|
|
22
|
+
line-height: 20px;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&-multi-day-total-discount {
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
font-weight: 400;
|
|
30
|
+
line-height: 18px;
|
|
31
|
+
text-decoration-line: line-through;
|
|
32
|
+
color: var(--Gray-500, #667085);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -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/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
|
+
});
|
|
@@ -44,7 +44,8 @@ var renderBundles = (item, hidePrice, isShowPackageNote) => {
|
|
|
44
44
|
let translationOriginal = (text) => "";
|
|
45
45
|
const context = (0, import_useEngineContext.default)();
|
|
46
46
|
translationOriginal = (_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.translationOriginal;
|
|
47
|
-
|
|
47
|
+
const { title, name, id, price, symbol, option } = item;
|
|
48
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { key: id, className: `${prefix}packages-product-bundle-item` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info-title` }, translationOriginal(title || name)), !hidePrice ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info-num` }, (0, import_utils._formatAmount)(price, symbol)) : null), /* @__PURE__ */ import_react.default.createElement(import_options.default, { options: option, amountSymbol: symbol }), /* @__PURE__ */ import_react.default.createElement(import_AmountFooter.default, { item }), isShowPackageNote ? /* @__PURE__ */ import_react.default.createElement(import_Note.default, { item, type: "inside" }) : null);
|
|
48
49
|
};
|
|
49
50
|
// Annotate the CommonJS export names for ESM import in node:
|
|
50
51
|
0 && (module.exports = {
|
|
@@ -55,7 +55,7 @@ var Options = ({ options, amountSymbol }) => {
|
|
|
55
55
|
{
|
|
56
56
|
className: `${prefix}packages-product-bundle-option-item-left-amount`
|
|
57
57
|
},
|
|
58
|
-
/* @__PURE__ */ import_react.default.createElement("span", null, (0, import_utils._formatAmount)(option == null ? void 0 : option.
|
|
58
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, (0, import_utils._formatAmount)(option == null ? void 0 : option.price, amountSymbol)),
|
|
59
59
|
/* @__PURE__ */ import_react.default.createElement("span", null, "×"),
|
|
60
60
|
/* @__PURE__ */ import_react.default.createElement("span", null, option == null ? void 0 : option.num)
|
|
61
61
|
)
|
|
@@ -65,7 +65,7 @@ var Options = ({ options, amountSymbol }) => {
|
|
|
65
65
|
{
|
|
66
66
|
className: `${prefix}packages-product-bundle-option-item-amount`
|
|
67
67
|
},
|
|
68
|
-
(0, import_utils._formatAmount)((option == null ? void 0 : option.
|
|
68
|
+
(0, import_utils._formatAmount)((option == null ? void 0 : option.price) * (option == null ? void 0 : option.num), amountSymbol)
|
|
69
69
|
)
|
|
70
70
|
);
|
|
71
71
|
})) : null;
|
|
@@ -46,7 +46,7 @@ var Packages = ({ item, isShowPackageNote }) => {
|
|
|
46
46
|
{
|
|
47
47
|
list: bundle || [],
|
|
48
48
|
renderItem: (items) => (0, import_utils2.renderBundles)(
|
|
49
|
-
{ ...items, symbol: item == null ? void 0 : item.symbol
|
|
49
|
+
{ ...items, symbol: item == null ? void 0 : item.symbol },
|
|
50
50
|
false,
|
|
51
51
|
isShowPackageNote
|
|
52
52
|
)
|
|
@@ -38,8 +38,7 @@ var import_utils = require("../Packages/components/collapsibleList/utils");
|
|
|
38
38
|
var import_index = require("./index.less");
|
|
39
39
|
var prefix = "pisell-lowcode-";
|
|
40
40
|
var Sales = ({ item, isShowNote }) => {
|
|
41
|
-
|
|
42
|
-
let other_products = ((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.relation_details) || [];
|
|
41
|
+
let other_products = (item == null ? void 0 : item.relation_products) || [];
|
|
43
42
|
other_products = other_products.map((p) => {
|
|
44
43
|
return {
|
|
45
44
|
...p,
|
|
@@ -39,26 +39,29 @@ var import_Like = __toESM(require("./components/Like"));
|
|
|
39
39
|
var import_index = require("./index.less");
|
|
40
40
|
var prefix = "pisell-lowcode-";
|
|
41
41
|
var Time = ({ item, isShowHolder, onLike }) => {
|
|
42
|
-
|
|
42
|
+
const {
|
|
43
|
+
start_date,
|
|
44
|
+
end_date,
|
|
45
|
+
holder_title,
|
|
46
|
+
resource_id,
|
|
47
|
+
relation_form_name,
|
|
48
|
+
like_status
|
|
49
|
+
} = item;
|
|
43
50
|
const isShow = (0, import_react.useMemo)(() => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
return isShow ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_Divider.default, null), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-time-wrap` }, ((_b = (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.date) == null ? void 0 : _b.value) ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-date` }, (0, import_utils.getServiceTime)(item, (_c = item._extend) == null ? void 0 : _c.start_date)) : null, isShowHolder && ((_d = item == null ? void 0 : item._extend) == null ? void 0 : _d.holder_title) ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-holder-wrap` }, item._extend.holder_title) : null, ((_e = item == null ? void 0 : item._extend) == null ? void 0 : _e.resource) || ((_f = item == null ? void 0 : item._extend) == null ? void 0 : _f.relation_form_name) ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-technician` }, ((_g = item == null ? void 0 : item._extend) == null ? void 0 : _g.resource) ? /* @__PURE__ */ import_react.default.createElement(
|
|
51
|
+
return start_date && end_date || isShowHolder && holder_title || resource_id || relation_form_name;
|
|
52
|
+
}, [start_date, isShowHolder, holder_title, resource_id]);
|
|
53
|
+
return isShow ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_Divider.default, null), /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-time-wrap` }, start_date && end_date ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-date` }, (0, import_utils.getServiceTime)(item, start_date)) : null, isShowHolder && holder_title ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-holder-wrap` }, holder_title) : null, resource_id || relation_form_name ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-technician` }, resource_id ? /* @__PURE__ */ import_react.default.createElement(
|
|
48
54
|
import_Like.default,
|
|
49
55
|
{
|
|
50
56
|
style: { marginRight: 4 },
|
|
51
|
-
status:
|
|
57
|
+
status: like_status,
|
|
52
58
|
onLike: (e) => {
|
|
53
59
|
onLike({
|
|
54
60
|
...item,
|
|
55
|
-
|
|
56
|
-
...item._extend,
|
|
57
|
-
like_status: e
|
|
58
|
-
}
|
|
61
|
+
like_status: e
|
|
59
62
|
});
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
|
-
) : null,
|
|
65
|
+
) : null, relation_form_name) : null)) : null;
|
|
63
66
|
};
|
|
64
67
|
var Time_default = Time;
|
|
@@ -42,21 +42,23 @@ var import_Time = __toESM(require("./components/Time"));
|
|
|
42
42
|
var import_Packages = __toESM(require("./components/Packages"));
|
|
43
43
|
var import_Sales = __toESM(require("./components/Sales"));
|
|
44
44
|
var import_AmountFooter = __toESM(require("./components/AmountFooter"));
|
|
45
|
+
var import_MultiDay = __toESM(require("./components/MultiDay"));
|
|
45
46
|
var import_Note = __toESM(require("./components/Note"));
|
|
46
47
|
var import_Action = __toESM(require("./components/Action"));
|
|
47
48
|
var import_useOpenNote = __toESM(require("./hooks/useOpenNote"));
|
|
48
49
|
var import_locales = __toESM(require("./locales"));
|
|
50
|
+
var import_status = require("./status");
|
|
49
51
|
var import_index = require("./index.less");
|
|
50
52
|
import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
51
53
|
var ProductCard = (props) => {
|
|
52
|
-
var _a
|
|
54
|
+
var _a;
|
|
53
55
|
const {
|
|
54
|
-
dataSource,
|
|
55
|
-
isShowImage =
|
|
56
|
-
isShowHolder =
|
|
57
|
-
isShowNote =
|
|
58
|
-
isShowDelete =
|
|
59
|
-
isShowPackageNote =
|
|
56
|
+
dataSource = import_status.defaultValue.dataSource,
|
|
57
|
+
isShowImage = import_status.defaultValue.isShowImage,
|
|
58
|
+
isShowHolder = import_status.defaultValue.isShowHolder,
|
|
59
|
+
isShowNote = import_status.defaultValue.isShowNote,
|
|
60
|
+
isShowDelete = import_status.defaultValue.isShowDelete,
|
|
61
|
+
isShowPackageNote = import_status.defaultValue.isShowPackageNote,
|
|
60
62
|
onAction,
|
|
61
63
|
onDelete,
|
|
62
64
|
onNote,
|
|
@@ -65,21 +67,31 @@ var ProductCard = (props) => {
|
|
|
65
67
|
...other
|
|
66
68
|
} = props;
|
|
67
69
|
const useOpenNoteRef = (0, import_react.useRef)();
|
|
70
|
+
console.log(dataSource, isShowImage, isShowNote, "dataSource");
|
|
71
|
+
const {
|
|
72
|
+
image,
|
|
73
|
+
bundle,
|
|
74
|
+
relation_products,
|
|
75
|
+
_id,
|
|
76
|
+
isShowAction,
|
|
77
|
+
actionText,
|
|
78
|
+
errorMessage,
|
|
79
|
+
isNormalProduct
|
|
80
|
+
} = dataSource;
|
|
68
81
|
const showImage = (0, import_react.useMemo)(() => {
|
|
69
|
-
return isShowImage &&
|
|
70
|
-
}, [isShowImage,
|
|
82
|
+
return isShowImage && image;
|
|
83
|
+
}, [isShowImage, image]);
|
|
71
84
|
const hideDivider = (0, import_react.useMemo)(() => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}, [dataSource == null ? void 0 : dataSource.bundle, dataSource == null ? void 0 : dataSource.relation_details]);
|
|
85
|
+
return (bundle == null ? void 0 : bundle.length) || (relation_products == null ? void 0 : relation_products.length);
|
|
86
|
+
}, [bundle, relation_products]);
|
|
75
87
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
76
88
|
import_cardPro.default,
|
|
77
89
|
{
|
|
78
90
|
className: (0, import_classnames.default)("pisell-lowcode-product-card", {
|
|
79
91
|
["pisell-lowcode-product-card-image"]: !showImage,
|
|
80
|
-
["pisell-lowcode-normal-product-card"]: !showImage &&
|
|
92
|
+
["pisell-lowcode-normal-product-card"]: !showImage && isNormalProduct
|
|
81
93
|
}),
|
|
82
|
-
key:
|
|
94
|
+
key: _id
|
|
83
95
|
},
|
|
84
96
|
/* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
85
97
|
"div",
|
|
@@ -103,17 +115,17 @@ var ProductCard = (props) => {
|
|
|
103
115
|
}
|
|
104
116
|
}
|
|
105
117
|
),
|
|
106
|
-
|
|
118
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
107
119
|
import_Time.default,
|
|
108
120
|
{
|
|
109
121
|
item: dataSource,
|
|
110
122
|
isShowHolder,
|
|
111
123
|
onLike: (item) => onLike == null ? void 0 : onLike(item)
|
|
112
124
|
}
|
|
113
|
-
)
|
|
125
|
+
),
|
|
114
126
|
/* @__PURE__ */ import_react.default.createElement(import_Packages.default, { item: dataSource, isShowPackageNote }),
|
|
115
127
|
/* @__PURE__ */ import_react.default.createElement(import_Sales.default, { item: dataSource, isShowNote }),
|
|
116
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
128
|
+
((_a = dataSource.items) == null ? void 0 : _a.length) ? /* @__PURE__ */ import_react.default.createElement(import_MultiDay.default, { dataSource, hideDivider }) : /* @__PURE__ */ import_react.default.createElement(
|
|
117
129
|
import_AmountFooter.default,
|
|
118
130
|
{
|
|
119
131
|
item: dataSource,
|
|
@@ -133,11 +145,11 @@ var ProductCard = (props) => {
|
|
|
133
145
|
}
|
|
134
146
|
}
|
|
135
147
|
) : null,
|
|
136
|
-
|
|
137
|
-
|
|
148
|
+
isShowAction && actionText ? /* @__PURE__ */ import_react.default.createElement(import_Action.default, { item: dataSource, onAction: () => onAction == null ? void 0 : onAction(dataSource) }) : null,
|
|
149
|
+
errorMessage ? /* @__PURE__ */ import_react.default.createElement(
|
|
138
150
|
import_antd.Alert,
|
|
139
151
|
{
|
|
140
|
-
message:
|
|
152
|
+
message: errorMessage,
|
|
141
153
|
type: "warning",
|
|
142
154
|
showIcon: true,
|
|
143
155
|
className: "pisell-lowcode-product-card-error"
|