@pisell/materials 2.2.35 → 2.2.37
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/components/cardPro/index.d.ts +4 -0
- package/es/components/cardPro/index.js +69 -0
- package/es/components/cardPro/index.less +55 -0
- package/es/components/collapse/index.d.ts +15 -0
- package/es/components/collapse/index.js +80 -0
- package/es/components/collapse/index.less +0 -0
- package/es/components/productCard/components/Action/index.d.ts +4 -0
- package/es/components/productCard/components/Action/index.js +21 -0
- package/es/components/productCard/components/Action/index.less +14 -0
- package/es/components/productCard/components/AmountFooter/index.d.ts +4 -0
- package/es/components/productCard/components/AmountFooter/index.js +38 -0
- package/es/components/productCard/components/AmountFooter/index.less +39 -0
- package/es/components/productCard/components/Divider/index.d.ts +4 -0
- package/es/components/productCard/components/Divider/index.js +11 -0
- package/es/components/productCard/components/Divider/index.less +13 -0
- package/es/components/productCard/components/Header/index.d.ts +4 -0
- package/es/components/productCard/components/Header/index.js +70 -0
- package/es/components/productCard/components/Header/index.less +63 -0
- package/es/components/productCard/components/Note/index.d.ts +4 -0
- package/es/components/productCard/components/Note/index.js +25 -0
- package/es/components/productCard/components/Note/index.less +20 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/index.d.ts +10 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/index.js +96 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/index.less +53 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +2 -0
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.js +33 -0
- package/es/components/productCard/components/Packages/components/options/index.d.ts +4 -0
- package/es/components/productCard/components/Packages/components/options/index.js +23 -0
- package/es/components/productCard/components/Packages/components/options/index.less +29 -0
- package/es/components/productCard/components/Packages/index.d.ts +4 -0
- package/es/components/productCard/components/Packages/index.js +32 -0
- package/es/components/productCard/components/Packages/index.less +17 -0
- package/es/components/productCard/components/Packages/utils.d.ts +20 -0
- package/es/components/productCard/components/Packages/utils.js +40 -0
- package/es/components/productCard/components/Sales/index.d.ts +4 -0
- package/es/components/productCard/components/Sales/index.js +39 -0
- package/es/components/productCard/components/Sales/index.less +18 -0
- package/es/components/productCard/components/Time/components/Like/index.d.ts +9 -0
- package/es/components/productCard/components/Time/components/Like/index.js +26 -0
- package/es/components/productCard/components/Time/components/Like/index.less +6 -0
- 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 +4 -0
- package/es/components/productCard/components/Time/index.js +44 -0
- package/es/components/productCard/components/Time/index.less +35 -0
- package/es/components/productCard/hooks/useOpenNote.d.ts +3 -0
- package/es/components/productCard/hooks/useOpenNote.js +66 -0
- package/es/components/productCard/index.d.ts +5 -0
- package/es/components/productCard/index.js +131 -0
- package/es/components/productCard/index.less +53 -0
- package/es/components/productCard/locales.d.ts +42 -0
- package/es/components/productCard/locales.js +47 -0
- package/es/components/productCard/status.d.ts +9 -0
- package/es/components/productCard/status.js +15 -0
- package/es/components/productCard/types.d.ts +17 -0
- package/es/components/productCard/types.js +1 -0
- package/es/components/productCard/utils.d.ts +162 -0
- package/es/components/productCard/utils.js +700 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/index.d.ts +4 -2
- package/es/index.js +7 -2
- package/lib/components/cardPro/index.d.ts +4 -0
- package/lib/components/cardPro/index.js +101 -0
- package/lib/components/cardPro/index.less +55 -0
- package/lib/components/collapse/index.d.ts +15 -0
- package/lib/components/collapse/index.js +83 -0
- package/lib/components/collapse/index.less +0 -0
- package/lib/components/productCard/components/Action/index.d.ts +4 -0
- package/lib/components/productCard/components/Action/index.js +55 -0
- package/lib/components/productCard/components/Action/index.less +14 -0
- package/lib/components/productCard/components/AmountFooter/index.d.ts +4 -0
- package/lib/components/productCard/components/AmountFooter/index.js +61 -0
- package/lib/components/productCard/components/AmountFooter/index.less +39 -0
- package/lib/components/productCard/components/Divider/index.d.ts +4 -0
- package/lib/components/productCard/components/Divider/index.js +50 -0
- package/lib/components/productCard/components/Divider/index.less +13 -0
- package/lib/components/productCard/components/Header/index.d.ts +4 -0
- package/lib/components/productCard/components/Header/index.js +82 -0
- package/lib/components/productCard/components/Header/index.less +63 -0
- package/lib/components/productCard/components/Note/index.d.ts +4 -0
- package/lib/components/productCard/components/Note/index.js +56 -0
- package/lib/components/productCard/components/Note/index.less +20 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/index.d.ts +10 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/index.js +93 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/index.less +53 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +2 -0
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.js +52 -0
- package/lib/components/productCard/components/Packages/components/options/index.d.ts +4 -0
- package/lib/components/productCard/components/Packages/components/options/index.js +73 -0
- package/lib/components/productCard/components/Packages/components/options/index.less +29 -0
- package/lib/components/productCard/components/Packages/index.d.ts +4 -0
- package/lib/components/productCard/components/Packages/index.js +56 -0
- package/lib/components/productCard/components/Packages/index.less +17 -0
- package/lib/components/productCard/components/Packages/utils.d.ts +20 -0
- package/lib/components/productCard/components/Packages/utils.js +44 -0
- package/lib/components/productCard/components/Sales/index.d.ts +4 -0
- package/lib/components/productCard/components/Sales/index.js +61 -0
- package/lib/components/productCard/components/Sales/index.less +18 -0
- package/lib/components/productCard/components/Time/components/Like/index.d.ts +9 -0
- package/lib/components/productCard/components/Time/components/Like/index.js +64 -0
- package/lib/components/productCard/components/Time/components/Like/index.less +6 -0
- 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 +4 -0
- package/lib/components/productCard/components/Time/index.js +64 -0
- package/lib/components/productCard/components/Time/index.less +35 -0
- package/lib/components/productCard/hooks/useOpenNote.d.ts +3 -0
- package/lib/components/productCard/hooks/useOpenNote.js +84 -0
- package/lib/components/productCard/index.d.ts +5 -0
- package/lib/components/productCard/index.js +160 -0
- package/lib/components/productCard/index.less +53 -0
- package/lib/components/productCard/locales.d.ts +42 -0
- package/lib/components/productCard/locales.js +65 -0
- package/lib/components/productCard/status.d.ts +9 -0
- package/lib/components/productCard/status.js +36 -0
- package/lib/components/productCard/types.d.ts +17 -0
- package/lib/components/productCard/types.js +17 -0
- package/lib/components/productCard/utils.d.ts +162 -0
- package/lib/components/productCard/utils.js +613 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +38 -32
- package/lowcode/card-pro/meta.ts +338 -0
- package/lowcode/card-pro/snippe.ts +39 -0
- package/lowcode/collapse/meta.ts +85 -1
- package/lowcode/date-picker.range-picker/meta.ts +20 -0
- package/lowcode/product-card/meta.ts +92 -0
- package/lowcode/product-card/snippets.ts +23 -0
- package/package.json +2 -2
|
@@ -0,0 +1,82 @@
|
|
|
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/Header/index.tsx
|
|
30
|
+
var Header_exports = {};
|
|
31
|
+
__export(Header_exports, {
|
|
32
|
+
default: () => Header_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Header_exports);
|
|
35
|
+
var import_antd = require("antd");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_iconfont = __toESM(require("../../../iconfont"));
|
|
39
|
+
var import_utils = require("@pisell/utils");
|
|
40
|
+
var import_options = __toESM(require("../Packages/components/options"));
|
|
41
|
+
var import_index = require("./index.less");
|
|
42
|
+
var prefix = "pisell-lowcode-";
|
|
43
|
+
var Header = (props) => {
|
|
44
|
+
const { isShowDelete, item, showImage, onDelete, disabledEdit } = props;
|
|
45
|
+
const showPrice = (0, import_react.useMemo)(() => {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
return ((_a = item == null ? void 0 : item.bundle) == null ? void 0 : _a.length) > 0 || ((_b = item == null ? void 0 : item.options) == null ? void 0 : _b.length) > 0;
|
|
48
|
+
}, [item == null ? void 0 : item.bundle, item == null ? void 0 : item.options]);
|
|
49
|
+
const headerCenterStyle = (0, import_react.useMemo)(() => {
|
|
50
|
+
var _a;
|
|
51
|
+
return ((_a = item == null ? void 0 : item.options) == null ? void 0 : _a.length) > 0 || (item == null ? void 0 : item.product_option_string);
|
|
52
|
+
}, [item == null ? void 0 : item.options, item == null ? void 0 : item.product_option_string]);
|
|
53
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: (0, import_classnames.default)(
|
|
57
|
+
`${prefix}product-header`,
|
|
58
|
+
headerCenterStyle && `${prefix}product-options-header`
|
|
59
|
+
)
|
|
60
|
+
},
|
|
61
|
+
isShowDelete && !disabledEdit ? /* @__PURE__ */ import_react.default.createElement(
|
|
62
|
+
"div",
|
|
63
|
+
{
|
|
64
|
+
className: `${prefix}product-delete`,
|
|
65
|
+
onClick: (e) => {
|
|
66
|
+
e.stopPropagation();
|
|
67
|
+
onDelete();
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "text", icon: /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { type: "pisell2-trash-01" }) })
|
|
71
|
+
) : null,
|
|
72
|
+
showImage ? /* @__PURE__ */ import_react.default.createElement(
|
|
73
|
+
"img",
|
|
74
|
+
{
|
|
75
|
+
src: import_utils.image.ali(item.cover, 64),
|
|
76
|
+
className: `${prefix}product-header-cover`
|
|
77
|
+
}
|
|
78
|
+
) : null,
|
|
79
|
+
(item == null ? void 0 : item.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, item == null ? void 0 : item.title), showPrice ? /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}product-title-price` }, (0, import_utils.formatAmount)(item == null ? void 0 : item.price, 2, item == null ? void 0 : item.symbol)) : null), (item == null ? void 0 : item.product_option_string) ? /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}product-title-variant` }, item == null ? void 0 : item.product_option_string) : null, /* @__PURE__ */ import_react.default.createElement(import_options.default, { options: item == null ? void 0 : item.options, amountSymbol: item == null ? void 0 : item.symbol })) : null
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
var Header_default = Header;
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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/Note/index.tsx
|
|
30
|
+
var Note_exports = {};
|
|
31
|
+
__export(Note_exports, {
|
|
32
|
+
default: () => Note_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Note_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_classnames = __toESM(require("classnames"));
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_Divider = __toESM(require("../Divider"));
|
|
39
|
+
var import_index = require("./index.less");
|
|
40
|
+
var prefix = "pisell-lowcode-";
|
|
41
|
+
var Note = (props) => {
|
|
42
|
+
const { item, type, openNote, disabledEdit } = props;
|
|
43
|
+
return (item == null ? void 0 : item.note) || !disabledEdit ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_Divider.default, { type }), /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)(`${prefix}product-note-wrap`) }, (item == null ? void 0 : item.note) ? /* @__PURE__ */ import_react.default.createElement("div", null, import_utils.locales.getText("pisell2.product.card.discount.note"), ": ", item.note) : null, !disabledEdit ? /* @__PURE__ */ import_react.default.createElement(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
className: `${prefix}product-note-btn`,
|
|
47
|
+
onClick: (e) => {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
e.stopPropagation();
|
|
50
|
+
openNote();
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
(item == null ? void 0 : item.note) ? import_utils.locales.getText("pisell2.product.card.discount.edit.note") : import_utils.locales.getText("pisell2.product.card.discount.add.note")
|
|
54
|
+
) : null)) : null;
|
|
55
|
+
};
|
|
56
|
+
var Note_default = Note;
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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;
|
|
@@ -0,0 +1,93 @@
|
|
|
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/Packages/components/collapsibleList/index.tsx
|
|
30
|
+
var collapsibleList_exports = {};
|
|
31
|
+
__export(collapsibleList_exports, {
|
|
32
|
+
default: () => collapsibleList_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(collapsibleList_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_index = require("./index.less");
|
|
39
|
+
var MAX_LIMIT = 3;
|
|
40
|
+
var CollapsibleList = (props) => {
|
|
41
|
+
const { list = [], renderItem, className, style } = props;
|
|
42
|
+
const [maxLimit, setMaxLimit] = (0, import_react.useState)(MAX_LIMIT);
|
|
43
|
+
const handlePreviewAll = () => {
|
|
44
|
+
let _maxLimit = maxLimit;
|
|
45
|
+
if (_maxLimit === MAX_LIMIT) {
|
|
46
|
+
_maxLimit = 99;
|
|
47
|
+
} else {
|
|
48
|
+
_maxLimit = MAX_LIMIT;
|
|
49
|
+
}
|
|
50
|
+
setMaxLimit(_maxLimit);
|
|
51
|
+
};
|
|
52
|
+
const showAll = (0, import_react.useMemo)(() => {
|
|
53
|
+
return list.length > MAX_LIMIT;
|
|
54
|
+
}, [list]);
|
|
55
|
+
const viewAllText = (0, import_react.useMemo)(() => {
|
|
56
|
+
let _maxLimit = maxLimit;
|
|
57
|
+
if (_maxLimit === MAX_LIMIT) {
|
|
58
|
+
return import_utils.locales.getText("pisell2.product.card.view-all");
|
|
59
|
+
}
|
|
60
|
+
return import_utils.locales.getText("pisell2.product.card.view-less");
|
|
61
|
+
}, [maxLimit]);
|
|
62
|
+
const _list = (0, import_react.useMemo)(() => {
|
|
63
|
+
let arr = [...list];
|
|
64
|
+
let _maxLimit = maxLimit;
|
|
65
|
+
if (list.length > _maxLimit) {
|
|
66
|
+
arr = arr.slice(0, _maxLimit);
|
|
67
|
+
}
|
|
68
|
+
return arr;
|
|
69
|
+
}, [list, maxLimit]);
|
|
70
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
className: (0, import_classnames.default)("pisell2-collapsible-list-wrap", className),
|
|
74
|
+
style
|
|
75
|
+
},
|
|
76
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell2-collapsible-list" }, _list.map((d, i) => {
|
|
77
|
+
return renderItem(d, i);
|
|
78
|
+
})),
|
|
79
|
+
showAll ? /* @__PURE__ */ import_react.default.createElement(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
className: "pisell2-collapsible-list-view-all",
|
|
83
|
+
onClick: (e) => {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
handlePreviewAll();
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
viewAllText
|
|
90
|
+
) : null
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
var collapsibleList_default = CollapsibleList;
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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/Packages/components/collapsibleList/utils.tsx
|
|
30
|
+
var utils_exports = {};
|
|
31
|
+
__export(utils_exports, {
|
|
32
|
+
renderBundles: () => renderBundles
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(utils_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_AmountFooter = __toESM(require("../../../AmountFooter"));
|
|
37
|
+
var import_Note = __toESM(require("../../../Note"));
|
|
38
|
+
var import_useEngineContext = __toESM(require("../../../../../../hooks/useEngineContext"));
|
|
39
|
+
var import_utils = require("../../utils");
|
|
40
|
+
var import_options = __toESM(require("../options"));
|
|
41
|
+
var prefix = "pisell-lowcode-";
|
|
42
|
+
var renderBundles = (item, hidePrice, isShowPackageNote) => {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
let translationOriginal = (text) => "";
|
|
45
|
+
const context = (0, import_useEngineContext.default)();
|
|
46
|
+
translationOriginal = (_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.translationOriginal;
|
|
47
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { key: item.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(item == null ? void 0 : item.title)), !hidePrice ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-info-num` }, (0, import_utils._formatAmount)(item == null ? void 0 : item.price, item == null ? void 0 : item.symbol)) : null), /* @__PURE__ */ import_react.default.createElement(import_options.default, { options: item == null ? void 0 : item.option, amountSymbol: item == null ? void 0 : item.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
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
renderBundles
|
|
52
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
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/Packages/components/options/index.tsx
|
|
30
|
+
var options_exports = {};
|
|
31
|
+
__export(options_exports, {
|
|
32
|
+
default: () => options_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(options_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("../../utils");
|
|
37
|
+
var import_index = require("./index.less");
|
|
38
|
+
var prefix = "pisell-lowcode-";
|
|
39
|
+
var Options = ({ options, amountSymbol }) => {
|
|
40
|
+
return (options == null ? void 0 : options.length) > 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}packages-product-bundle-option` }, options.map((option, index) => {
|
|
41
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
key: option.id,
|
|
45
|
+
className: `${prefix}packages-product-bundle-option-item`
|
|
46
|
+
},
|
|
47
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: `${prefix}packages-product-bundle-option-item-left`
|
|
51
|
+
},
|
|
52
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, option == null ? void 0 : option.name),
|
|
53
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: `${prefix}packages-product-bundle-option-item-left-amount`
|
|
57
|
+
},
|
|
58
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, (0, import_utils._formatAmount)(option == null ? void 0 : option.add_price, amountSymbol)),
|
|
59
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, "×"),
|
|
60
|
+
/* @__PURE__ */ import_react.default.createElement("span", null, option == null ? void 0 : option.num)
|
|
61
|
+
)
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
64
|
+
"span",
|
|
65
|
+
{
|
|
66
|
+
className: `${prefix}packages-product-bundle-option-item-amount`
|
|
67
|
+
},
|
|
68
|
+
(0, import_utils._formatAmount)((option == null ? void 0 : option.add_price) * (option == null ? void 0 : option.num), amountSymbol)
|
|
69
|
+
)
|
|
70
|
+
);
|
|
71
|
+
})) : null;
|
|
72
|
+
};
|
|
73
|
+
var options_default = Options;
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
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/Packages/index.tsx
|
|
30
|
+
var Packages_exports = {};
|
|
31
|
+
__export(Packages_exports, {
|
|
32
|
+
default: () => Packages_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Packages_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_Divider = __toESM(require("../Divider"));
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_collapsibleList = __toESM(require("./components/collapsibleList"));
|
|
39
|
+
var import_utils2 = require("./components/collapsibleList/utils");
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var prefix = "pisell-lowcode-";
|
|
42
|
+
var Packages = ({ item, isShowPackageNote }) => {
|
|
43
|
+
const bundle = (item == null ? void 0 : item.bundle) || [];
|
|
44
|
+
return (bundle == null ? void 0 : bundle.length) > 0 ? /* @__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-packages-wrap` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-packages-title` }, import_utils.locales.getText("pisell2.product.card.items.package")), /* @__PURE__ */ import_react.default.createElement(
|
|
45
|
+
import_collapsibleList.default,
|
|
46
|
+
{
|
|
47
|
+
list: bundle || [],
|
|
48
|
+
renderItem: (items) => (0, import_utils2.renderBundles)(
|
|
49
|
+
{ ...items, symbol: item == null ? void 0 : item.symbol, total: items == null ? void 0 : items.price },
|
|
50
|
+
false,
|
|
51
|
+
isShowPackageNote
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
))) : null;
|
|
55
|
+
};
|
|
56
|
+
var Packages_default = Packages;
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @title: 金额是否是负
|
|
3
|
+
* @description:
|
|
4
|
+
* @param {string} type
|
|
5
|
+
* @return {*}
|
|
6
|
+
* @Author: WangHan
|
|
7
|
+
* @Date: 2024-11-22 10:01
|
|
8
|
+
*/
|
|
9
|
+
export declare const minusSign: (item: any, type?: string) => "" | "-";
|
|
10
|
+
/**
|
|
11
|
+
* @title: 金额格式化
|
|
12
|
+
* @description:
|
|
13
|
+
* @param {number} price
|
|
14
|
+
* @param {string} amountSymbol
|
|
15
|
+
* @param {number} digit
|
|
16
|
+
* @return {*}
|
|
17
|
+
* @Author: WangHan
|
|
18
|
+
* @Date: 2024-11-22 10:58
|
|
19
|
+
*/
|
|
20
|
+
export declare const _formatAmount: (price?: number, amountSymbol?: string, digit?: number) => string | number;
|