@pisell/materials 3.0.64 → 3.0.66
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/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +2 -2
- package/es/components/pisellAnchor/index.d.ts +2 -0
- package/es/components/pisellAnchor/index.js +158 -41
- package/es/components/pisellAnchor/index.less +1 -1
- package/es/components/pisellModal/components/MobileModal/index.js +42 -2
- package/es/components/pisellModal/components/MobileModal/index.less +4 -0
- package/es/components/productCard/locales.d.ts +3 -0
- package/es/components/productCard/locales.js +10 -1
- package/es/components/productCard/utils.js +8 -2
- package/lib/components/pisellAnchor/index.d.ts +2 -0
- package/lib/components/pisellAnchor/index.js +108 -24
- package/lib/components/pisellAnchor/index.less +1 -1
- package/lib/components/pisellModal/components/MobileModal/index.js +39 -1
- package/lib/components/pisellModal/components/MobileModal/index.less +4 -0
- package/lib/components/productCard/locales.d.ts +3 -0
- package/lib/components/productCard/locales.js +4 -1
- package/lib/components/productCard/utils.js +6 -2
- package/package.json +1 -1
|
@@ -36,8 +36,45 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_classnames = __toESM(require("classnames"));
|
|
37
37
|
var import_PcModal = __toESM(require("../PcModal"));
|
|
38
38
|
var import_index = require("./index.less");
|
|
39
|
+
var modalCount = 0;
|
|
39
40
|
var MobileModal = (props) => {
|
|
40
41
|
const { wrapClassName, mobileModalHeight } = props;
|
|
42
|
+
const ref = import_react.default.useRef(null);
|
|
43
|
+
const prevOpenRef = (0, import_react.useRef)(props.open);
|
|
44
|
+
const isFirstRender = (0, import_react.useRef)(true);
|
|
45
|
+
(0, import_react.useEffect)(() => {
|
|
46
|
+
if (isFirstRender.current && props.open) {
|
|
47
|
+
modalCount++;
|
|
48
|
+
document.body.style.overflow = "hidden";
|
|
49
|
+
}
|
|
50
|
+
isFirstRender.current = false;
|
|
51
|
+
}, []);
|
|
52
|
+
(0, import_react.useEffect)(() => {
|
|
53
|
+
if (!isFirstRender.current && props.open !== prevOpenRef.current) {
|
|
54
|
+
if (props.open) {
|
|
55
|
+
modalCount++;
|
|
56
|
+
document.body.style.overflow = "hidden";
|
|
57
|
+
} else {
|
|
58
|
+
modalCount--;
|
|
59
|
+
if (modalCount <= 0) {
|
|
60
|
+
modalCount = 0;
|
|
61
|
+
document.body.style.overflow = "";
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
prevOpenRef.current = props.open;
|
|
65
|
+
}
|
|
66
|
+
}, [props.open]);
|
|
67
|
+
(0, import_react.useEffect)(() => {
|
|
68
|
+
return () => {
|
|
69
|
+
if (prevOpenRef.current) {
|
|
70
|
+
modalCount--;
|
|
71
|
+
if (modalCount <= 0) {
|
|
72
|
+
modalCount = 0;
|
|
73
|
+
document.body.style.overflow = "";
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}, []);
|
|
41
78
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
42
79
|
import_PcModal.default,
|
|
43
80
|
{
|
|
@@ -56,7 +93,8 @@ var MobileModal = (props) => {
|
|
|
56
93
|
}),
|
|
57
94
|
style: {
|
|
58
95
|
height: mobileModalHeight || "100%"
|
|
59
|
-
}
|
|
96
|
+
},
|
|
97
|
+
ref
|
|
60
98
|
},
|
|
61
99
|
node
|
|
62
100
|
);
|
|
@@ -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;
|
|
@@ -1,6 +1,7 @@
|
|
|
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;
|
|
4
5
|
'pisell2.product.card.discount.reason': string;
|
|
5
6
|
'pisell2.product.card.discount.note': string;
|
|
6
7
|
'pisell2.product.card.discount.add.note': string;
|
|
@@ -14,6 +15,7 @@ declare const _default: {
|
|
|
14
15
|
};
|
|
15
16
|
'zh-CN': {
|
|
16
17
|
'pisell2.product.card.day': (val: number) => string;
|
|
18
|
+
'pisell2.product.card.day.event': (val: number) => string;
|
|
17
19
|
'pisell2.product.card.discount.reason': string;
|
|
18
20
|
'pisell2.product.card.discount.note': string;
|
|
19
21
|
'pisell2.product.card.discount.add.note': string;
|
|
@@ -27,6 +29,7 @@ declare const _default: {
|
|
|
27
29
|
};
|
|
28
30
|
'zh-HK': {
|
|
29
31
|
'pisell2.product.card.day': (val: number) => string;
|
|
32
|
+
'pisell2.product.card.day.event': (val: number) => string;
|
|
30
33
|
'pisell2.product.card.discount.reason': string;
|
|
31
34
|
'pisell2.product.card.discount.note': string;
|
|
32
35
|
'pisell2.product.card.discount.add.note': string;
|
|
@@ -24,7 +24,8 @@ __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"}`,
|
|
28
29
|
"pisell2.product.card.discount.reason": "Discount reason",
|
|
29
30
|
"pisell2.product.card.discount.note": "Note",
|
|
30
31
|
"pisell2.product.card.discount.add.note": "Add note",
|
|
@@ -38,6 +39,7 @@ var locales_default = {
|
|
|
38
39
|
},
|
|
39
40
|
"zh-CN": {
|
|
40
41
|
"pisell2.product.card.day": (val) => "天",
|
|
42
|
+
"pisell2.product.card.day.event": (val) => "个活动",
|
|
41
43
|
"pisell2.product.card.discount.reason": "折扣原因",
|
|
42
44
|
"pisell2.product.card.discount.note": "备注",
|
|
43
45
|
"pisell2.product.card.discount.add.note": "添加备注",
|
|
@@ -51,6 +53,7 @@ var locales_default = {
|
|
|
51
53
|
},
|
|
52
54
|
"zh-HK": {
|
|
53
55
|
"pisell2.product.card.day": (val) => "天",
|
|
56
|
+
"pisell2.product.card.day.event": (val) => "个活動",
|
|
54
57
|
"pisell2.product.card.discount.reason": "折扣原因",
|
|
55
58
|
"pisell2.product.card.discount.note": "備註",
|
|
56
59
|
"pisell2.product.card.discount.add.note": "添加備註",
|
|
@@ -75,7 +75,7 @@ var getServiceTime = (item, currentDate) => {
|
|
|
75
75
|
import_dayjs.default.locale(localeTypes[locale]);
|
|
76
76
|
let startDate = (0, import_dayjs.default)(item == null ? void 0 : item.start_date);
|
|
77
77
|
let endDate = (0, import_dayjs.default)(item == null ? void 0 : item.end_date);
|
|
78
|
-
const diffInDays = endDate.diff(startDate, "day");
|
|
78
|
+
const diffInDays = (item == null ? void 0 : item.custom_day_count) || endDate.diff(startDate, "day");
|
|
79
79
|
let _format = isEn2 ? "ddd, DD/MM/YYYY" : "YYYY-MM-DD,ddd";
|
|
80
80
|
if ((item == null ? void 0 : item.hasOwnProperty("format")) && ((_b = item == null ? void 0 : item.format) == null ? void 0 : _b.length) > 0) {
|
|
81
81
|
_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];
|
|
@@ -85,7 +85,11 @@ var getServiceTime = (item, currentDate) => {
|
|
|
85
85
|
endDate = (0, import_dayjs.default)(`${item == null ? void 0 : item.end_date} ${item == null ? void 0 : item.end_time}`);
|
|
86
86
|
}
|
|
87
87
|
const date = `${startDate.format(_format)} ~ ${endDate.format(_format)}`;
|
|
88
|
-
|
|
88
|
+
let text = import_utils.locales.getText("pisell2.product.card.day")(diffInDays);
|
|
89
|
+
if (item == null ? void 0 : item.custom_day_count) {
|
|
90
|
+
text = import_utils.locales.getText("pisell2.product.card.day.event")(diffInDays);
|
|
91
|
+
}
|
|
92
|
+
const duration = `${diffInDays}${text}`;
|
|
89
93
|
return `${date} (${duration})`;
|
|
90
94
|
};
|
|
91
95
|
// Annotate the CommonJS export names for ESM import in node:
|