@pisell/materials 2.2.53 → 2.2.55
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 +5 -5
- package/build/lowcode/preview.js +164 -148
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +39 -25
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +39 -25
- package/es/components/Pagination/index.d.ts +1 -1
- package/es/components/appVersionControl/index.d.ts +0 -1
- package/es/components/colorPicker/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceMenu/Basic.d.ts +8 -2
- package/es/components/dataSourceComponents/dataSourceMenu/Basic.js +13 -3
- package/es/components/dataSourceComponents/dataSourceMenu/index.d.ts +8 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +2 -0
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +10 -10
- package/es/components/drag-sort-tree/index.d.ts +0 -1
- package/es/components/filter/components/items/index.d.ts +1 -0
- package/es/components/filter/components/items/text/Editor/index.d.ts +1 -0
- package/es/components/filter/components/items/text/Preview/index.d.ts +1 -0
- package/es/components/filter/components/items/text/index.d.ts +1 -0
- package/es/components/iconfont/index.js +1 -1
- package/es/components/login-and-register/index.js +23 -21
- package/es/components/login-and-register/index.less +7 -7
- package/es/components/page/index.js +23 -57
- package/es/components/pisellAnchor/index.d.ts +1 -1
- package/es/components/pisellAnchor/index.js +109 -199
- package/es/components/pisellAnchor/index.less +3 -5
- package/es/components/pisellAvatar/index.js +2 -1
- package/es/components/pisellAvatar/index.less +2 -1
- package/es/components/pisellCustomCheckboxGroup/index.js +3 -0
- package/es/components/pisellGoodPassCard/index.d.ts +47 -0
- package/es/components/pisellGoodPassCard/index.js +115 -0
- package/es/components/pisellGoodPassCard/index.less +52 -0
- package/es/components/pisellModal/components/MobileModal/index.less +4 -0
- package/es/components/pisellNavigationMenu/PisellNavigationMenu.js +18 -2
- package/es/components/pisellWalletPassCard/index.d.ts +0 -1
- package/es/components/productCard/components/MultiDay/index.js +2 -1
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.js +4 -3
- package/es/components/productCard/components/Time/components/SelectResource/index.d.ts +3 -0
- package/es/components/productCard/components/Time/components/SelectResource/index.js +53 -0
- package/es/components/productCard/components/Time/index.d.ts +1 -1
- package/es/components/productCard/components/Time/index.js +21 -7
- package/es/components/productCard/components/Time/index.less +29 -0
- package/es/components/productCard/index.js +5 -2
- package/es/components/productCard/locales.d.ts +6 -0
- package/es/components/productCard/locales.js +19 -1
- package/es/components/productCard/types.d.ts +4 -0
- package/es/components/productCard/utils.js +18 -2
- package/es/components/table/Actions/component/ExportImport/index.d.ts +0 -1
- package/es/components/table/Table/SelectField/index.d.ts +1 -0
- package/es/components/table/Table/tableConfig/summary/index.d.ts +1 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/tabs/index.js +6 -1
- package/es/index.d.ts +10 -11
- package/es/index.js +11 -12
- package/es/locales/en-US.d.ts +28 -2
- package/es/locales/en-US.js +43 -10
- package/es/locales/zh-CN.d.ts +26 -0
- package/es/locales/zh-CN.js +29 -1
- package/es/locales/zh-TW.d.ts +26 -0
- package/es/locales/zh-TW.js +28 -1
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/appVersionControl/index.d.ts +0 -1
- package/lib/components/colorPicker/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceMenu/Basic.d.ts +8 -2
- package/lib/components/dataSourceComponents/dataSourceMenu/Basic.js +12 -3
- package/lib/components/dataSourceComponents/dataSourceMenu/index.d.ts +8 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Url/ReadPretty.less +2 -0
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +10 -10
- package/lib/components/drag-sort-tree/index.d.ts +0 -1
- package/lib/components/filter/components/items/index.d.ts +1 -0
- package/lib/components/filter/components/items/text/Editor/index.d.ts +1 -0
- package/lib/components/filter/components/items/text/Preview/index.d.ts +1 -0
- package/lib/components/filter/components/items/text/index.d.ts +1 -0
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/login-and-register/index.js +23 -21
- package/lib/components/login-and-register/index.less +7 -7
- package/lib/components/page/index.js +37 -65
- package/lib/components/pisellAnchor/index.d.ts +1 -1
- package/lib/components/pisellAnchor/index.js +64 -131
- package/lib/components/pisellAnchor/index.less +3 -5
- package/lib/components/pisellAvatar/index.js +1 -1
- package/lib/components/pisellAvatar/index.less +2 -1
- package/lib/components/pisellCustomCheckboxGroup/index.js +1 -1
- package/lib/components/pisellEmpty/index.js +9 -1
- package/lib/components/pisellGoodPassCard/index.d.ts +47 -0
- package/lib/components/pisellGoodPassCard/index.js +109 -0
- package/lib/components/pisellGoodPassCard/index.less +52 -0
- package/lib/components/pisellModal/components/MobileModal/index.less +4 -0
- package/lib/components/pisellNavigationMenu/PisellNavigationMenu.js +24 -3
- package/lib/components/pisellWalletPassCard/index.d.ts +0 -1
- package/lib/components/productCard/components/MultiDay/index.js +3 -2
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.js +5 -4
- package/lib/components/productCard/components/Time/components/SelectResource/index.d.ts +3 -0
- package/lib/components/productCard/components/Time/components/SelectResource/index.js +63 -0
- package/lib/components/productCard/components/Time/index.d.ts +1 -1
- package/lib/components/productCard/components/Time/index.js +38 -14
- package/lib/components/productCard/components/Time/index.less +29 -0
- package/lib/components/productCard/index.js +4 -1
- package/lib/components/productCard/locales.d.ts +6 -0
- package/lib/components/productCard/locales.js +7 -1
- package/lib/components/productCard/types.d.ts +4 -0
- package/lib/components/productCard/utils.js +14 -2
- package/lib/components/table/Actions/component/ExportImport/index.d.ts +0 -1
- package/lib/components/table/Table/SelectField/index.d.ts +1 -0
- package/lib/components/table/Table/tableConfig/summary/index.d.ts +1 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/tabs/index.js +1 -0
- package/lib/index.d.ts +10 -11
- package/lib/index.js +12 -15
- package/lib/locales/en-US.d.ts +28 -2
- package/lib/locales/en-US.js +29 -3
- package/lib/locales/zh-CN.d.ts +26 -0
- package/lib/locales/zh-CN.js +29 -1
- package/lib/locales/zh-TW.d.ts +26 -0
- package/lib/locales/zh-TW.js +28 -1
- package/lowcode/pisell-good-pass-card/meta.ts +38 -0
- package/lowcode/pisell-good-pass-card/snippets.ts +9 -0
- package/lowcode/product-card/meta.ts +28 -0
- package/package.json +1 -1
|
@@ -0,0 +1,109 @@
|
|
|
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/pisellGoodPassCard/index.tsx
|
|
30
|
+
var pisellGoodPassCard_exports = {};
|
|
31
|
+
__export(pisellGoodPassCard_exports, {
|
|
32
|
+
default: () => pisellGoodPassCard_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellGoodPassCard_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import__ = require("../../index");
|
|
38
|
+
var import_locales = require("../../locales");
|
|
39
|
+
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var clsPrefix = "pisell-good-pass-card";
|
|
42
|
+
var index = (props) => {
|
|
43
|
+
var _a;
|
|
44
|
+
const context = (0, import_useEngineContext.default)();
|
|
45
|
+
const { translation } = (_a = context.appHelper) == null ? void 0 : _a.utils;
|
|
46
|
+
const { dataSource = [], onChange, style = {} } = props;
|
|
47
|
+
const [showModal, setShowModal] = (0, import_react.useState)(false);
|
|
48
|
+
console.log("pisell good card datasource", dataSource);
|
|
49
|
+
const handleChange = (newValue) => {
|
|
50
|
+
if (onChange) {
|
|
51
|
+
onChange(newValue);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const handleItemChange = (item, checked) => {
|
|
55
|
+
handleChange({
|
|
56
|
+
id: item.id,
|
|
57
|
+
isSelected: checked
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
const renderVoucherContent = (item) => {
|
|
61
|
+
return /* @__PURE__ */ import_react.default.createElement("span", null, (0, import_locales.getText)("pisell2.text.goodpass.save"), " ", /* @__PURE__ */ import_react.default.createElement(import__.PisellText.Amount, { value: item.savedAmount }));
|
|
62
|
+
};
|
|
63
|
+
const renderActionElement = (item) => {
|
|
64
|
+
const isChecked = item.isSelected;
|
|
65
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
66
|
+
import_antd.Checkbox,
|
|
67
|
+
{
|
|
68
|
+
disabled: item.isDisabled,
|
|
69
|
+
style: { marginLeft: 8 },
|
|
70
|
+
checked: isChecked,
|
|
71
|
+
onChange: (e) => handleItemChange(item, e.target.checked)
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
const renderVoucherItem = (item) => {
|
|
76
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { key: item.id, className: `${clsPrefix}-voucher-item` }, /* @__PURE__ */ import_react.default.createElement("div", { className: "item-title" }, translation(item.format_title)), /* @__PURE__ */ import_react.default.createElement("div", { className: "item-content" }, renderVoucherContent(item), renderActionElement(item)));
|
|
77
|
+
};
|
|
78
|
+
const renderModal = () => {
|
|
79
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
80
|
+
import__.PisellModal,
|
|
81
|
+
{
|
|
82
|
+
title: (0, import_locales.getText)("pisell2.text.goodpass.product-vouchers"),
|
|
83
|
+
footer: null,
|
|
84
|
+
open: showModal,
|
|
85
|
+
onCancel: () => setShowModal(false),
|
|
86
|
+
className: `${clsPrefix}-all-items-modal`
|
|
87
|
+
},
|
|
88
|
+
/* @__PURE__ */ import_react.default.createElement("div", { style: { padding: "10px 0" } }, dataSource.map(renderVoucherItem))
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
const renderMixedMode = () => {
|
|
92
|
+
const list = dataSource.length > 3 ? dataSource.slice(0, 3) : dataSource;
|
|
93
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: `${clsPrefix}-header` }, /* @__PURE__ */ import_react.default.createElement("div", null, (0, import_locales.getText)("pisell2.text.goodpass.product-vouchers")), /* @__PURE__ */ import_react.default.createElement(import_antd.Typography.Text, { underline: true, onClick: () => setShowModal(true) }, (0, import_locales.getText)("pisell2.text.goodpass.view-more"))), /* @__PURE__ */ import_react.default.createElement(import_antd.Divider, { style: { margin: 4 } }), /* @__PURE__ */ import_react.default.createElement("div", { className: `${clsPrefix}-body` }, list.map(renderVoucherItem)));
|
|
94
|
+
};
|
|
95
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderModal(), /* @__PURE__ */ import_react.default.createElement(
|
|
96
|
+
import__.PisellCard,
|
|
97
|
+
{
|
|
98
|
+
padding: 8,
|
|
99
|
+
borderRadius: 8,
|
|
100
|
+
style: {
|
|
101
|
+
width: 378,
|
|
102
|
+
...style
|
|
103
|
+
},
|
|
104
|
+
className: clsPrefix
|
|
105
|
+
},
|
|
106
|
+
renderMixedMode()
|
|
107
|
+
));
|
|
108
|
+
};
|
|
109
|
+
var pisellGoodPassCard_default = index;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.pisell-good-pass-card-all-items-modal,
|
|
2
|
+
.pisell-good-pass-card {
|
|
3
|
+
.pisell-good-pass-card-header,
|
|
4
|
+
.pisell-good-pass-card-group-header {
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
align-items: center;
|
|
8
|
+
color: var(--Gray-900, #101828);
|
|
9
|
+
text-align: center;
|
|
10
|
+
font-family: Inter;
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
font-style: normal;
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
line-height: 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pisell-good-pass-card-voucher-item {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
height: 22px;
|
|
22
|
+
|
|
23
|
+
.item-title {
|
|
24
|
+
color: var(--Gray-500, #667085);
|
|
25
|
+
text-align: center;
|
|
26
|
+
font-family: Inter;
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
font-style: normal;
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
line-height: 20px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.item-content {
|
|
34
|
+
color: var(--, #8157d5);
|
|
35
|
+
font-family: Inter;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
font-style: normal;
|
|
38
|
+
font-weight: 400;
|
|
39
|
+
line-height: 20px;
|
|
40
|
+
|
|
41
|
+
.add-btn {
|
|
42
|
+
color: var(--, #8157d5);
|
|
43
|
+
text-align: center;
|
|
44
|
+
font-family: Inter;
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
font-style: normal;
|
|
47
|
+
font-weight: 600;
|
|
48
|
+
line-height: 20px; /* 142.857% */
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -17,14 +17,18 @@
|
|
|
17
17
|
overflow: hidden;
|
|
18
18
|
max-height: 90%;
|
|
19
19
|
min-height: 200px;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
20
22
|
}
|
|
21
23
|
.pisell-lowcode-modal-content {
|
|
24
|
+
flex: 1;
|
|
22
25
|
padding: 0;
|
|
23
26
|
border-radius: 0;
|
|
24
27
|
height: 100%;
|
|
25
28
|
display: flex;
|
|
26
29
|
flex-direction: column;
|
|
27
30
|
max-height: none;
|
|
31
|
+
min-height: 200px;
|
|
28
32
|
.pisell-lowcode-modal-close {
|
|
29
33
|
padding: 10px;
|
|
30
34
|
top: 8px;
|
|
@@ -88,12 +88,31 @@ var PisellNavigationMenu = ({
|
|
|
88
88
|
onAddPage == null ? void 0 : onAddPage(item);
|
|
89
89
|
}
|
|
90
90
|
}, []);
|
|
91
|
+
const tagTextMap = (0, import_react.useMemo)(() => {
|
|
92
|
+
return {
|
|
93
|
+
base: {
|
|
94
|
+
text: (0, import_locales.getText)("pisell-lowcode-navigation-menu-tag-base"),
|
|
95
|
+
color: "#7f56d9"
|
|
96
|
+
},
|
|
97
|
+
pisellV1: {
|
|
98
|
+
text: (0, import_locales.getText)("pisell-lowcode-navigation-menu-tag-pisell1"),
|
|
99
|
+
color: "#ee837a"
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}, []);
|
|
91
103
|
const renderMenuItem = (0, import_react.useCallback)(
|
|
92
104
|
(itemProps) => {
|
|
105
|
+
var _a, _b;
|
|
93
106
|
const { item } = itemProps;
|
|
94
|
-
const {
|
|
107
|
+
const {
|
|
108
|
+
allowEdit = true,
|
|
109
|
+
allowDelete: allowDelete2 = true,
|
|
110
|
+
allowAddChild: allowAddChild2 = true,
|
|
111
|
+
allowAddSubmenu = true,
|
|
112
|
+
allowAddPage = true
|
|
113
|
+
} = item;
|
|
95
114
|
const isShowAddButton = item.isGroup && allowAddChild2 && (allowAddSubmenu || allowAddPage);
|
|
96
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content-icon" }, /* @__PURE__ */ import_react.default.createElement(import_icon.default, { type: item.icon })), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content-text" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-title" }, item.title), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-description" }, item.description, !item.isGroup && item.version && /* @__PURE__ */ import_react.default.createElement(import_pisellTags.default, { type: "pill_color", color: "success" }, item.version)))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-action-wrap" }, allowEdit && /* @__PURE__ */ import_react.default.createElement(
|
|
115
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content-icon" }, /* @__PURE__ */ import_react.default.createElement(import_icon.default, { type: item.icon })), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content-text" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-title" }, item.title), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-description" }, item.description, item.source && /* @__PURE__ */ import_react.default.createElement(import_pisellTags.default, { type: "pill_color", color: (_a = tagTextMap[item.source]) == null ? void 0 : _a.color }, ((_b = tagTextMap[item.source]) == null ? void 0 : _b.text) || ""), !item.isGroup && item.version && /* @__PURE__ */ import_react.default.createElement(import_pisellTags.default, { type: "pill_color", color: "success" }, "v", item.version)))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-action-wrap" }, allowEdit && /* @__PURE__ */ import_react.default.createElement(
|
|
97
116
|
import_button.default,
|
|
98
117
|
{
|
|
99
118
|
type: "text",
|
|
@@ -114,7 +133,9 @@ var PisellNavigationMenu = ({
|
|
|
114
133
|
items: [
|
|
115
134
|
allowAddSubmenu && {
|
|
116
135
|
key: "add-child",
|
|
117
|
-
label: (0, import_locales.getText)(
|
|
136
|
+
label: (0, import_locales.getText)(
|
|
137
|
+
"pisell-lowcode-navigation-menu-add-sub-menu"
|
|
138
|
+
),
|
|
118
139
|
onClick: () => handleClick("add-child", item)
|
|
119
140
|
},
|
|
120
141
|
allowAddPage && {
|
|
@@ -42,11 +42,12 @@ var import_index = require("./index.less");
|
|
|
42
42
|
var import_utils2 = require("./utils");
|
|
43
43
|
var prefix = "pisell-lowcode-";
|
|
44
44
|
var MultiDay = ({ dataSource, hideDivider }) => {
|
|
45
|
-
var _a
|
|
45
|
+
var _a;
|
|
46
46
|
const { items, symbol, locale } = dataSource;
|
|
47
47
|
let translationOriginal = (text) => "";
|
|
48
48
|
const context = (0, import_useEngineContext.default)();
|
|
49
|
-
|
|
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);
|
|
50
51
|
const lists = (0, import_react.useMemo)(() => {
|
|
51
52
|
if (!(items == null ? void 0 : items.length)) return [];
|
|
52
53
|
return (0, import_utils2.formatDateRanges)(items);
|
|
@@ -40,12 +40,13 @@ var import_utils = require("../../utils");
|
|
|
40
40
|
var import_options = __toESM(require("../options"));
|
|
41
41
|
var prefix = "pisell-lowcode-";
|
|
42
42
|
var renderBundles = (item, hidePrice, isShowPackageNote) => {
|
|
43
|
-
var _a
|
|
44
|
-
let
|
|
43
|
+
var _a;
|
|
44
|
+
let translation = (text) => "";
|
|
45
45
|
const context = (0, import_useEngineContext.default)();
|
|
46
|
-
|
|
46
|
+
const utils = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils;
|
|
47
|
+
translation = (utils == null ? void 0 : utils.translationOriginal) || (utils == null ? void 0 : utils.translation);
|
|
47
48
|
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` },
|
|
49
|
+
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` }, translation(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);
|
|
49
50
|
};
|
|
50
51
|
// Annotate the CommonJS export names for ESM import in node:
|
|
51
52
|
0 && (module.exports = {
|
|
@@ -0,0 +1,63 @@
|
|
|
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/Time/components/SelectResource/index.tsx
|
|
30
|
+
var SelectResource_exports = {};
|
|
31
|
+
__export(SelectResource_exports, {
|
|
32
|
+
default: () => SelectResource_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(SelectResource_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var SelectResource = ({ lists, value, onChange }) => {
|
|
38
|
+
const [selectedValue, setSelectedValue] = (0, import_react.useState)();
|
|
39
|
+
(0, import_react.useEffect)(() => {
|
|
40
|
+
setSelectedValue(value);
|
|
41
|
+
}, [value]);
|
|
42
|
+
const renderOptions = (0, import_react.useCallback)(() => {
|
|
43
|
+
return (lists || []).map((d) => {
|
|
44
|
+
return /* @__PURE__ */ import_react.default.createElement(import_antd.Select.Option, { value: d.id, key: d.id }, d["label"]);
|
|
45
|
+
});
|
|
46
|
+
}, [lists]);
|
|
47
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
48
|
+
import_antd.Select,
|
|
49
|
+
{
|
|
50
|
+
size: "large",
|
|
51
|
+
showSearch: true,
|
|
52
|
+
style: { flex: 1 },
|
|
53
|
+
value: selectedValue,
|
|
54
|
+
onChange: (val) => {
|
|
55
|
+
setSelectedValue(val);
|
|
56
|
+
const item = lists.find((d) => d.id === val);
|
|
57
|
+
onChange(item);
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
renderOptions()
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
var SelectResource_default = SelectResource;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './index.less';
|
|
3
|
-
declare const Time: ({ item, isShowHolder, onLike }: any) => JSX.Element | null;
|
|
3
|
+
declare const Time: ({ item, isShowHolder, onLike, isShowChangeResource, changeResource, }: any) => JSX.Element | null;
|
|
4
4
|
export default Time;
|
|
@@ -36,32 +36,56 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_utils = require("../../utils");
|
|
37
37
|
var import_Divider = __toESM(require("../Divider"));
|
|
38
38
|
var import_Like = __toESM(require("./components/Like"));
|
|
39
|
+
var import_SelectResource = __toESM(require("./components/SelectResource"));
|
|
39
40
|
var import_index = require("./index.less");
|
|
40
41
|
var prefix = "pisell-lowcode-";
|
|
41
|
-
var Time = ({
|
|
42
|
+
var Time = ({
|
|
43
|
+
item,
|
|
44
|
+
isShowHolder,
|
|
45
|
+
onLike,
|
|
46
|
+
isShowChangeResource,
|
|
47
|
+
changeResource
|
|
48
|
+
}) => {
|
|
42
49
|
const {
|
|
43
50
|
start_date,
|
|
44
51
|
end_date,
|
|
45
52
|
holder_title,
|
|
46
53
|
resource_id,
|
|
47
54
|
relation_form_name,
|
|
48
|
-
like_status
|
|
55
|
+
like_status,
|
|
56
|
+
resources,
|
|
57
|
+
is_hide_like
|
|
49
58
|
} = item;
|
|
50
59
|
const isShow = (0, import_react.useMemo)(() => {
|
|
51
|
-
return start_date && end_date || isShowHolder && holder_title || resource_id || relation_form_name;
|
|
60
|
+
return start_date && end_date || isShowHolder && holder_title || resource_id || relation_form_name || isShowChangeResource;
|
|
52
61
|
}, [start_date, isShowHolder, holder_title, resource_id]);
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
console.log("isShowChangeResource33", resources, isShowChangeResource);
|
|
63
|
+
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, isShowChangeResource && (start_date && end_date || isShowHolder && holder_title) ? /* @__PURE__ */ import_react.default.createElement(import_Divider.default, { type: "inside" }) : null, resource_id || relation_form_name || isShowChangeResource ? /* @__PURE__ */ import_react.default.createElement(
|
|
64
|
+
"div",
|
|
55
65
|
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
className: `${prefix}product-technician ${isShowChangeResource ? "pisell-lowcode-change-resource" : ""}`
|
|
67
|
+
},
|
|
68
|
+
resource_id && !is_hide_like ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}product-card-like-wrap` }, /* @__PURE__ */ import_react.default.createElement(
|
|
69
|
+
import_Like.default,
|
|
70
|
+
{
|
|
71
|
+
style: { marginRight: 4 },
|
|
72
|
+
status: like_status,
|
|
73
|
+
onLike: (e) => {
|
|
74
|
+
onLike({
|
|
75
|
+
...item,
|
|
76
|
+
like_status: e
|
|
77
|
+
});
|
|
78
|
+
}
|
|
63
79
|
}
|
|
64
|
-
|
|
65
|
-
|
|
80
|
+
)) : null,
|
|
81
|
+
isShowChangeResource ? /* @__PURE__ */ import_react.default.createElement(
|
|
82
|
+
import_SelectResource.default,
|
|
83
|
+
{
|
|
84
|
+
lists: resources,
|
|
85
|
+
value: resource_id,
|
|
86
|
+
onChange: changeResource
|
|
87
|
+
}
|
|
88
|
+
) : relation_form_name
|
|
89
|
+
) : null)) : null;
|
|
66
90
|
};
|
|
67
91
|
var Time_default = Time;
|
|
@@ -32,4 +32,33 @@
|
|
|
32
32
|
display: flex;
|
|
33
33
|
align-items: center;
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
&-product-card-like-wrap {
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
align-items: center;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&-change-resource {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
gap: 10px;
|
|
46
|
+
flex: 1 0 0;
|
|
47
|
+
align-self: stretch;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&-change-resource &-product-card-like-wrap {
|
|
51
|
+
display: flex;
|
|
52
|
+
width: 44px;
|
|
53
|
+
height: 44px;
|
|
54
|
+
padding: 10px 14px;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
align-items: center;
|
|
57
|
+
border-radius: 8px;
|
|
58
|
+
border: 1px solid var(--Gray-300, #d0d5dd);
|
|
59
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
60
|
+
.like-icon {
|
|
61
|
+
margin-right: 0 !important;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
35
64
|
}
|
|
@@ -67,6 +67,7 @@ var ProductCard = (props) => {
|
|
|
67
67
|
onNote,
|
|
68
68
|
onLike,
|
|
69
69
|
onCard,
|
|
70
|
+
onChangeResource,
|
|
70
71
|
...other
|
|
71
72
|
} = props;
|
|
72
73
|
const useOpenNoteRef = (0, import_react.useRef)();
|
|
@@ -133,7 +134,9 @@ var ProductCard = (props) => {
|
|
|
133
134
|
{
|
|
134
135
|
item: dataSource,
|
|
135
136
|
isShowHolder,
|
|
136
|
-
|
|
137
|
+
isShowChangeResource: other == null ? void 0 : other.isShowChangeResource,
|
|
138
|
+
onLike: (item) => onLike == null ? void 0 : onLike(item),
|
|
139
|
+
changeResource: onChangeResource
|
|
137
140
|
}
|
|
138
141
|
),
|
|
139
142
|
/* @__PURE__ */ import_react.default.createElement(import_Packages.default, { item: dataSource, isShowPackageNote }),
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
en: {
|
|
3
3
|
'pisell2.product.card.day': (val: number) => string;
|
|
4
|
+
'pisell2.product.card.day.event': (val: number) => string;
|
|
5
|
+
'pisell2.product.card.minute': (val: number) => string;
|
|
4
6
|
'pisell2.product.card.discount.reason': string;
|
|
5
7
|
'pisell2.product.card.discount.note': string;
|
|
6
8
|
'pisell2.product.card.discount.add.note': string;
|
|
@@ -14,6 +16,8 @@ declare const _default: {
|
|
|
14
16
|
};
|
|
15
17
|
'zh-CN': {
|
|
16
18
|
'pisell2.product.card.day': (val: number) => string;
|
|
19
|
+
'pisell2.product.card.day.event': (val: number) => string;
|
|
20
|
+
'pisell2.product.card.minute': (val: number) => string;
|
|
17
21
|
'pisell2.product.card.discount.reason': string;
|
|
18
22
|
'pisell2.product.card.discount.note': string;
|
|
19
23
|
'pisell2.product.card.discount.add.note': string;
|
|
@@ -27,6 +31,8 @@ declare const _default: {
|
|
|
27
31
|
};
|
|
28
32
|
'zh-HK': {
|
|
29
33
|
'pisell2.product.card.day': (val: number) => string;
|
|
34
|
+
'pisell2.product.card.day.event': (val: number) => string;
|
|
35
|
+
'pisell2.product.card.minute': (val: number) => string;
|
|
30
36
|
'pisell2.product.card.discount.reason': string;
|
|
31
37
|
'pisell2.product.card.discount.note': string;
|
|
32
38
|
'pisell2.product.card.discount.add.note': string;
|
|
@@ -24,7 +24,9 @@ __export(locales_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(locales_exports);
|
|
25
25
|
var locales_default = {
|
|
26
26
|
"en": {
|
|
27
|
-
"pisell2.product.card.day": (val) => `${val > 1 ? "days" : "day"}`,
|
|
27
|
+
"pisell2.product.card.day": (val) => `${val > 1 ? " days" : " day"}`,
|
|
28
|
+
"pisell2.product.card.day.event": (val) => `${val > 1 ? " events" : " event"}`,
|
|
29
|
+
"pisell2.product.card.minute": (val) => `${val > 1 ? " minutes" : " minute"}`,
|
|
28
30
|
"pisell2.product.card.discount.reason": "Discount reason",
|
|
29
31
|
"pisell2.product.card.discount.note": "Note",
|
|
30
32
|
"pisell2.product.card.discount.add.note": "Add note",
|
|
@@ -38,6 +40,8 @@ var locales_default = {
|
|
|
38
40
|
},
|
|
39
41
|
"zh-CN": {
|
|
40
42
|
"pisell2.product.card.day": (val) => "天",
|
|
43
|
+
"pisell2.product.card.day.event": (val) => "个活动",
|
|
44
|
+
"pisell2.product.card.minute": (val) => "分钟",
|
|
41
45
|
"pisell2.product.card.discount.reason": "折扣原因",
|
|
42
46
|
"pisell2.product.card.discount.note": "备注",
|
|
43
47
|
"pisell2.product.card.discount.add.note": "添加备注",
|
|
@@ -51,6 +55,8 @@ var locales_default = {
|
|
|
51
55
|
},
|
|
52
56
|
"zh-HK": {
|
|
53
57
|
"pisell2.product.card.day": (val) => "天",
|
|
58
|
+
"pisell2.product.card.day.event": (val) => "个活動",
|
|
59
|
+
"pisell2.product.card.minute": (val) => "分鐘",
|
|
54
60
|
"pisell2.product.card.discount.reason": "折扣原因",
|
|
55
61
|
"pisell2.product.card.discount.note": "備註",
|
|
56
62
|
"pisell2.product.card.discount.add.note": "添加備註",
|
|
@@ -70,9 +70,13 @@ export declare type ProductCardTypes = {
|
|
|
70
70
|
disabledEdit?: boolean;
|
|
71
71
|
locale?: string;
|
|
72
72
|
symbol?: string;
|
|
73
|
+
isShowChangeHolder?: boolean;
|
|
74
|
+
isShowChangeResource?: boolean;
|
|
75
|
+
isShowChangeDate?: boolean;
|
|
73
76
|
onAction?: (val: any) => void;
|
|
74
77
|
onDelete?: (val: any) => void;
|
|
75
78
|
onNote?: (val: any) => void;
|
|
76
79
|
onLike?: (val: any) => void;
|
|
77
80
|
onCard?: (val: any) => void;
|
|
81
|
+
onChangeResource?: (val: any) => void;
|
|
78
82
|
};
|
|
@@ -74,7 +74,7 @@ var getServiceTime = (item, currentDate) => {
|
|
|
74
74
|
import_dayjs.default.locale(localeTypes[locale]);
|
|
75
75
|
let startDate = (0, import_dayjs.default)(item == null ? void 0 : item.start_date);
|
|
76
76
|
let endDate = (0, import_dayjs.default)(item == null ? void 0 : item.end_date);
|
|
77
|
-
|
|
77
|
+
let diffInDays = (item == null ? void 0 : item.custom_day_count) || endDate.diff(startDate, "day");
|
|
78
78
|
let _format = isEn2 ? "ddd, DD/MM/YYYY" : "YYYY-MM-DD,ddd";
|
|
79
79
|
if ((item == null ? void 0 : item.hasOwnProperty("format")) && ((_b = item == null ? void 0 : item.format) == null ? void 0 : _b.length) > 0) {
|
|
80
80
|
_format = isEn2 ? (_c = item == null ? void 0 : item.format) == null ? void 0 : _c[0] : (_d = item == null ? void 0 : item.format) == null ? void 0 : _d[1];
|
|
@@ -83,8 +83,20 @@ var getServiceTime = (item, currentDate) => {
|
|
|
83
83
|
startDate = (0, import_dayjs.default)(`${item == null ? void 0 : item.start_date} ${item == null ? void 0 : item.start_time}`);
|
|
84
84
|
endDate = (0, import_dayjs.default)(`${item == null ? void 0 : item.end_date} ${item == null ? void 0 : item.end_time}`);
|
|
85
85
|
}
|
|
86
|
+
if ((item == null ? void 0 : item.duration_type) === "minutes") {
|
|
87
|
+
diffInDays = endDate.diff(startDate, "minute");
|
|
88
|
+
}
|
|
86
89
|
const date = `${startDate.format(_format)} ~ ${endDate.format(_format)}`;
|
|
87
|
-
|
|
90
|
+
let text = import_utils.locales.getText("pisell2.product.card.day")(diffInDays);
|
|
91
|
+
if (item == null ? void 0 : item.custom_day_count) {
|
|
92
|
+
text = import_utils.locales.getText("pisell2.product.card.day.event")(diffInDays);
|
|
93
|
+
}
|
|
94
|
+
const textTypes = {
|
|
95
|
+
"minutes": import_utils.locales.getText("pisell2.product.card.minute")(diffInDays),
|
|
96
|
+
"event": import_utils.locales.getText("pisell2.product.card.day.event")(diffInDays)
|
|
97
|
+
};
|
|
98
|
+
text = (textTypes == null ? void 0 : textTypes[item == null ? void 0 : item.duration_type]) || text;
|
|
99
|
+
let duration = `${diffInDays}${text}`;
|
|
88
100
|
return `${date} (${duration})`;
|
|
89
101
|
};
|
|
90
102
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -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" | "group_by" | "order_by" | "column_setting" | "view_mode" | "gallery_setting")[];
|
|
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 {};
|
|
@@ -93,6 +93,7 @@ var Tabs = class extends import_react.Component {
|
|
|
93
93
|
key: item.key,
|
|
94
94
|
onClick: (e) => props.onTabClick(item.key, e)
|
|
95
95
|
},
|
|
96
|
+
/* @__PURE__ */ import_react.default.createElement(import_badge.default, { count: item.badge, offset: [0, 6] }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefix}tab-bar-icon-wrap` }, item.icon)),
|
|
96
97
|
/* @__PURE__ */ import_react.default.createElement("span", { className: `${prefix}tab-bar-label` }, item.label)
|
|
97
98
|
);
|
|
98
99
|
}),
|