@pisell/materials 1.10.12 → 1.10.14
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 +3 -3
- package/build/lowcode/preview.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +48 -48
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +48 -48
- package/es/components/PisellProcedure/components/ProcedureHeader.js +3 -3
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.js +2 -1
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.less +1 -1
- package/es/components/productCard/cartSkuCard/components/Gift/index.js +0 -1
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +5 -4
- package/es/components/productCard/cartSkuCard/components/packages/index.js +5 -3
- package/es/components/productCard/cartSkuCard/components/specs/index.js +5 -3
- package/es/components/productCard/cartSkuCard/components/specs/index.less +9 -4
- package/es/components/productCard/cartSkuCard/components/swipeAction/index.js +76 -25
- package/es/components/productCard/cartSkuCard/index.js +0 -1
- package/es/components/productCard/cartSkuCard/index.less +3 -0
- package/es/components/productCard/components/Packages/components/options/index.js +3 -2
- package/es/components/productCard/components/Time/components/SelectHolderMultiple/index.js +0 -2
- package/es/components/productCard/lineItem/BookingLineItem.js +17 -8
- package/es/components/productCard/lineItem/index.js +21 -14
- package/es/components/productCard/lineItem/index.less +14 -1
- package/es/hooks/useInitLocalesOnce.js +23 -0
- package/lib/components/PisellProcedure/components/ProcedureHeader.js +3 -3
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.js +2 -1
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.less +1 -1
- package/lib/components/productCard/cartSkuCard/components/Gift/index.js +0 -1
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +5 -4
- package/lib/components/productCard/cartSkuCard/components/packages/index.js +5 -3
- package/lib/components/productCard/cartSkuCard/components/specs/index.js +5 -3
- package/lib/components/productCard/cartSkuCard/components/specs/index.less +9 -4
- package/lib/components/productCard/cartSkuCard/components/swipeAction/index.js +76 -25
- package/lib/components/productCard/cartSkuCard/index.js +0 -1
- package/lib/components/productCard/cartSkuCard/index.less +3 -0
- package/lib/components/productCard/components/Packages/components/options/index.js +3 -2
- package/lib/components/productCard/components/Time/components/SelectHolderMultiple/index.js +0 -2
- package/lib/components/productCard/lineItem/BookingLineItem.js +17 -8
- package/lib/components/productCard/lineItem/index.js +21 -14
- package/lib/components/productCard/lineItem/index.less +14 -1
- package/lib/hooks/useInitLocalesOnce.js +24 -0
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ react = require_runtime.__toESM(react);
|
|
|
15
15
|
* @author Pisell Team
|
|
16
16
|
*/
|
|
17
17
|
const ProcedureHeader = ({ headerProps, currentStep, className, goPrev, goToStep, onClose, onFirstStepBack, onBackConfirm, onCloseConfirm }) => {
|
|
18
|
-
var _modalConfig$config2, _modalConfig$config3;
|
|
18
|
+
var _mergedStepsProps$mob, _mergedStepsProps$mob2, _modalConfig$config2, _modalConfig$config3;
|
|
19
19
|
/** 确认弹窗类型(back: 返回确认,close: 关闭确认,null: 不显示) */
|
|
20
20
|
const [modalType, setModalType] = (0, react.useState)(null);
|
|
21
21
|
/** 目标步骤索引(用于步骤跳转,-1 表示返回上一步) */
|
|
@@ -194,8 +194,8 @@ const ProcedureHeader = ({ headerProps, currentStep, className, goPrev, goToStep
|
|
|
194
194
|
else handleBackClick();
|
|
195
195
|
}
|
|
196
196
|
}, actualLeftSlot), (headerProps === null || headerProps === void 0 ? void 0 : headerProps.showSteps) !== false && /* @__PURE__ */ react.default.createElement("div", { className: "pisell-procedure-header__center" }, /* @__PURE__ */ react.default.createElement(require_index$2.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, mergedStepsProps), {}, {
|
|
197
|
-
mobileMode: "auto",
|
|
198
|
-
mobileBreakpoint: 744
|
|
197
|
+
mobileMode: (_mergedStepsProps$mob = mergedStepsProps.mobileMode) !== null && _mergedStepsProps$mob !== void 0 ? _mergedStepsProps$mob : "auto",
|
|
198
|
+
mobileBreakpoint: (_mergedStepsProps$mob2 = mergedStepsProps.mobileBreakpoint) !== null && _mergedStepsProps$mob2 !== void 0 ? _mergedStepsProps$mob2 : 744
|
|
199
199
|
}))), showActualRightArea && /* @__PURE__ */ react.default.createElement("div", {
|
|
200
200
|
className: "pisell-procedure-header__right",
|
|
201
201
|
onClick: () => {
|
|
@@ -11,9 +11,10 @@ classnames = require_runtime.__toESM(classnames);
|
|
|
11
11
|
require("./index.less");
|
|
12
12
|
//#region src/components/productCard/cartSkuCard/components/AmountFooter/index.tsx
|
|
13
13
|
const Footer = ({ item, hideDivider, type, isOnlyTotal }) => {
|
|
14
|
-
const { total, origin_total, symbol, tip, num, discount_reason } = item;
|
|
14
|
+
const { total, origin_total, symbol, tip, num, discount_reason, amountFormatter } = item;
|
|
15
15
|
const weighingInfo = (0, _pisell_utils.resolveWeighingSnapshot)(item);
|
|
16
16
|
const formatFooterAmount = (amount, precision = 2) => {
|
|
17
|
+
if (amountFormatter) return amountFormatter(amount, precision);
|
|
17
18
|
if (!weighingInfo) return require_utils._formatAmount(amount, symbol, precision);
|
|
18
19
|
return (0, _pisell_utils.formatAmountWithOptions)(amount, symbol, {
|
|
19
20
|
precision,
|
|
@@ -20,7 +20,6 @@ const Gift = (props) => {
|
|
|
20
20
|
return /* @__PURE__ */ react.default.createElement("div", { className: `product-cover-text` }, displayText);
|
|
21
21
|
}, [displayGifts]);
|
|
22
22
|
if (!isShow) return null;
|
|
23
|
-
console.log("Gift777", props, selectedCount);
|
|
24
23
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
25
24
|
className: `${prefixCls}`,
|
|
26
25
|
onClick
|
|
@@ -13,7 +13,8 @@ require("./index.less");
|
|
|
13
13
|
//#region src/components/productCard/cartSkuCard/components/basicInfo/index.tsx
|
|
14
14
|
const BasicInfo = (props) => {
|
|
15
15
|
const { isShowImage, isShowQuantityBadge = true, dataSource = {}, style, isMainProduct, type, maxSpecsCount = 1, isBundle, showFooter, isShowOriginalPrice = false, isShowEditProduct = false, onEditProduct, disabledEditClick = false } = props;
|
|
16
|
-
const { image, bundle, options, product_option_string, name, price, symbol, total = 0, origin_total = 0, num = 1, holder_id, isFormSubject, totalDifference = 0 } = dataSource;
|
|
16
|
+
const { image, bundle, options, product_option_string, name, price, symbol, total = 0, origin_total = 0, num = 1, holder_id, isFormSubject, totalDifference = 0, amountFormatter } = dataSource;
|
|
17
|
+
const formatProductAmount = (value, precision = 2) => amountFormatter ? amountFormatter(value, precision) : (0, _pisell_utils.formatAmount)(value, precision, symbol);
|
|
17
18
|
const renderNumTag = () => {
|
|
18
19
|
return /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`num-tag`, { "is-main": isMainProduct }) }, num < 100 ? num : "99+");
|
|
19
20
|
};
|
|
@@ -35,7 +36,7 @@ const BasicInfo = (props) => {
|
|
|
35
36
|
};
|
|
36
37
|
const renderProductPrice = () => {
|
|
37
38
|
if (hasWeighingInfo) return null;
|
|
38
|
-
return (0
|
|
39
|
+
return formatProductAmount(price !== null && price !== void 0 ? price : 0);
|
|
39
40
|
};
|
|
40
41
|
const renderImage = () => {
|
|
41
42
|
if (!isShowImage) return null;
|
|
@@ -81,12 +82,12 @@ const BasicInfo = (props) => {
|
|
|
81
82
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
82
83
|
className: basicInfoClassName,
|
|
83
84
|
style: style || {}
|
|
84
|
-
}, isShowQuantityBadge ? renderNumTag() : null, renderImage(), !isShowImage || !image && !name ? /* @__PURE__ */ react.default.createElement("div", { style: { width: 20 } }) : null, /* @__PURE__ */ react.default.createElement("div", { className: `product-info product-info-a9` }, /* @__PURE__ */ react.default.createElement("div", { className: `product-basic-info-wrap` }, /* @__PURE__ */ react.default.createElement("div", { className: `product-basic-info ${isBundle ? "row" : ""}` }, /* @__PURE__ */ react.default.createElement("div", { className: `product-name ${renderEdit ? "product-name-edit" : ""}` }, name), /* @__PURE__ */ react.default.createElement("div", { className: `product-price` }, /* @__PURE__ */ react.default.createElement("span", null, renderProductPrice()), _isShowOriginalPrice ? /* @__PURE__ */ react.default.createElement("span", { className: `original-price` }, (
|
|
85
|
+
}, isShowQuantityBadge ? renderNumTag() : null, renderImage(), !isShowImage || !image && !name ? /* @__PURE__ */ react.default.createElement("div", { style: { width: 20 } }) : null, /* @__PURE__ */ react.default.createElement("div", { className: `product-info product-info-a9` }, /* @__PURE__ */ react.default.createElement("div", { className: `product-basic-info-wrap` }, /* @__PURE__ */ react.default.createElement("div", { className: `product-basic-info ${isBundle ? "row" : ""}` }, /* @__PURE__ */ react.default.createElement("div", { className: `product-name ${renderEdit ? "product-name-edit" : ""}` }, name), /* @__PURE__ */ react.default.createElement("div", { className: `product-price` }, /* @__PURE__ */ react.default.createElement("span", null, renderProductPrice()), _isShowOriginalPrice ? /* @__PURE__ */ react.default.createElement("span", { className: `original-price` }, formatProductAmount(origin_total)) : null)), renderProductMeta()), renderEdit));
|
|
85
86
|
}
|
|
86
87
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
87
88
|
className: basicInfoClassName,
|
|
88
89
|
style: style || {}
|
|
89
|
-
}, isShowQuantityBadge ? renderNumTag() : null, renderImage(), !isShowImage || !image && !name ? /* @__PURE__ */ react.default.createElement("div", { style: { width: 20 } }) : null, /* @__PURE__ */ react.default.createElement("div", { className: `product-info` }, /* @__PURE__ */ react.default.createElement("div", { className: `product-name` }, name), hasProductMeta ? renderProductMeta() : /* @__PURE__ */ react.default.createElement("div", { className: `product-price` }, renderProductPrice())), /* @__PURE__ */ react.default.createElement("div", { className: `product-amount` }, /* @__PURE__ */ react.default.createElement("div", { className: `total-amont` }, (
|
|
90
|
+
}, isShowQuantityBadge ? renderNumTag() : null, renderImage(), !isShowImage || !image && !name ? /* @__PURE__ */ react.default.createElement("div", { style: { width: 20 } }) : null, /* @__PURE__ */ react.default.createElement("div", { className: `product-info` }, /* @__PURE__ */ react.default.createElement("div", { className: `product-name` }, name), hasProductMeta ? renderProductMeta() : /* @__PURE__ */ react.default.createElement("div", { className: `product-price` }, renderProductPrice())), /* @__PURE__ */ react.default.createElement("div", { className: `product-amount` }, /* @__PURE__ */ react.default.createElement("div", { className: `total-amont` }, formatProductAmount(total * num - (totalDifference !== null && totalDifference !== void 0 ? totalDifference : 0))), origin_total && Number(total) !== Number(origin_total) ? /* @__PURE__ */ react.default.createElement("div", { className: `origin-amount` }, formatProductAmount(origin_total * num)) : null));
|
|
90
91
|
};
|
|
91
92
|
//#endregion
|
|
92
93
|
exports.default = BasicInfo;
|
|
@@ -11,7 +11,7 @@ let antd = require("antd");
|
|
|
11
11
|
require("./index.less");
|
|
12
12
|
//#region src/components/productCard/cartSkuCard/components/packages/index.tsx
|
|
13
13
|
const Packages = ({ isShowImage, isShowQuantityBadge, dataSource = {}, type }) => {
|
|
14
|
-
const { bundle = [], symbol = "$" } = dataSource;
|
|
14
|
+
const { bundle = [], symbol = "$", amountFormatter } = dataSource;
|
|
15
15
|
const showFooter = (0, react.useCallback)((_bundle) => {
|
|
16
16
|
const { options = [], bundle = [] } = _bundle;
|
|
17
17
|
const hasSpecs = (bundle === null || bundle === void 0 ? void 0 : bundle.length) || (options === null || options === void 0 ? void 0 : options.length);
|
|
@@ -31,7 +31,8 @@ const Packages = ({ isShowImage, isShowQuantityBadge, dataSource = {}, type }) =
|
|
|
31
31
|
dataSource: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, item), {}, {
|
|
32
32
|
name: item.title,
|
|
33
33
|
image: item.cover,
|
|
34
|
-
symbol
|
|
34
|
+
symbol,
|
|
35
|
+
amountFormatter
|
|
35
36
|
}),
|
|
36
37
|
type,
|
|
37
38
|
isBundle: true,
|
|
@@ -39,7 +40,8 @@ const Packages = ({ isShowImage, isShowQuantityBadge, dataSource = {}, type }) =
|
|
|
39
40
|
}), showFooter(item) ? /* @__PURE__ */ react.default.createElement(require_index$1.default, {
|
|
40
41
|
item: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, item), {}, {
|
|
41
42
|
total: item === null || item === void 0 ? void 0 : item.price,
|
|
42
|
-
symbol: dataSource === null || dataSource === void 0 ? void 0 : dataSource.symbol
|
|
43
|
+
symbol: dataSource === null || dataSource === void 0 ? void 0 : dataSource.symbol,
|
|
44
|
+
amountFormatter
|
|
43
45
|
}),
|
|
44
46
|
hideDivider: false,
|
|
45
47
|
type: "total"
|
|
@@ -8,7 +8,8 @@ require("./index.less");
|
|
|
8
8
|
//#region src/components/productCard/cartSkuCard/components/specs/index.tsx
|
|
9
9
|
const Specs = (props) => {
|
|
10
10
|
const { dataSource = {}, maxSpecsCount = 1, type } = props;
|
|
11
|
-
const { bundle, options, product_option_string, symbol } = dataSource;
|
|
11
|
+
const { bundle, options, product_option_string, symbol, amountFormatter } = dataSource;
|
|
12
|
+
const formatSpecAmount = (value) => amountFormatter ? amountFormatter(value, 2) : `${symbol || ""}${value}`;
|
|
12
13
|
const more = /* @__PURE__ */ react.default.createElement("div", { className: `${require_index$1.PREFIX}__specs-more` }, _pisell_utils.locales.getText("pisell2.cart.sku-card.more"));
|
|
13
14
|
/**
|
|
14
15
|
* @description: 渲染多规格字符串
|
|
@@ -19,7 +20,8 @@ const Specs = (props) => {
|
|
|
19
20
|
};
|
|
20
21
|
if (type === "a9") return /* @__PURE__ */ react.default.createElement("div", { className: `${require_index$1.PREFIX}__specs-a9-wrap` }, product_option_string ? /* @__PURE__ */ react.default.createElement("div", { className: "option-string-wrap" }, renderOptionString()) : null, options && (options === null || options === void 0 ? void 0 : options.length) > 0 ? /* @__PURE__ */ react.default.createElement(require_index.default, {
|
|
21
22
|
options,
|
|
22
|
-
amountSymbol: symbol
|
|
23
|
+
amountSymbol: symbol,
|
|
24
|
+
amountFormatter
|
|
23
25
|
}) : null);
|
|
24
26
|
if (Array.isArray(bundle) && (bundle === null || bundle === void 0 ? void 0 : bundle.length) > 0) {
|
|
25
27
|
const displayItems = bundle.slice(0, maxSpecsCount);
|
|
@@ -31,7 +33,7 @@ const Specs = (props) => {
|
|
|
31
33
|
return /* @__PURE__ */ react.default.createElement("div", { className: `${require_index$1.PREFIX}__specs` }, displayItems.map((item, index) => /* @__PURE__ */ react.default.createElement("div", {
|
|
32
34
|
className: "spec-item",
|
|
33
35
|
key: index
|
|
34
|
-
}, /* @__PURE__ */ react.default.createElement("span", { className: "spec-name" }, item.name), /* @__PURE__ */ react.default.createElement("span", { className: "spec-num" }, /* @__PURE__ */ react.default.createElement("span", null,
|
|
36
|
+
}, /* @__PURE__ */ react.default.createElement("span", { className: "spec-name" }, item.name), /* @__PURE__ */ react.default.createElement("span", { className: "spec-num" }, /* @__PURE__ */ react.default.createElement("span", null, formatSpecAmount(item.price)), /* @__PURE__ */ react.default.createElement("span", null), "x", /* @__PURE__ */ react.default.createElement("span", null, item.num)))), options.length > maxSpecsCount ? more : null);
|
|
35
37
|
}
|
|
36
38
|
return null;
|
|
37
39
|
};
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
|
|
48
48
|
.pisell-cart-sku-card__product-meta--weighing & {
|
|
49
49
|
.pisell-lowcode-packages-product-bundle-option {
|
|
50
|
-
font-size: var(--pisell-cart-sku-card-
|
|
50
|
+
font-size: var(--pisell-cart-sku-card-weighing-meta-font-size, 18px);
|
|
51
51
|
line-height: 1.3;
|
|
52
|
-
letter-spacing: -0.
|
|
52
|
+
letter-spacing: -0.01em;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -62,8 +62,13 @@
|
|
|
62
62
|
|
|
63
63
|
.pisell-cart-sku-card__product-meta--weighing {
|
|
64
64
|
.pisell-cart-sku-card__specs {
|
|
65
|
-
font-size: var(--pisell-cart-sku-card-
|
|
65
|
+
font-size: var(--pisell-cart-sku-card-weighing-meta-font-size, 18px);
|
|
66
66
|
line-height: 1.3;
|
|
67
|
-
letter-spacing: -0.
|
|
67
|
+
letter-spacing: -0.01em;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.pisell-cart-sku-card__specs-more {
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
line-height: 18px;
|
|
68
73
|
}
|
|
69
74
|
}
|
|
@@ -52,6 +52,10 @@ const SwipeAction = (0, react.forwardRef)((p, ref) => {
|
|
|
52
52
|
const rootRef = (0, react.useRef)(null);
|
|
53
53
|
const leftRef = (0, react.useRef)(null);
|
|
54
54
|
const rightRef = (0, react.useRef)(null);
|
|
55
|
+
const resizeObserverRef = (0, react.useRef)(null);
|
|
56
|
+
const touchOutsideCleanupRef = (0, react.useRef)(null);
|
|
57
|
+
const latestPropsRef = (0, react.useRef)(props);
|
|
58
|
+
latestPropsRef.current = props;
|
|
55
59
|
const [containerHeight, setContainerHeight] = (0, react.useState)(0);
|
|
56
60
|
function getWidth(ref) {
|
|
57
61
|
const element = ref.current;
|
|
@@ -72,6 +76,29 @@ const SwipeAction = (0, react.forwardRef)((p, ref) => {
|
|
|
72
76
|
function getRootHeight() {
|
|
73
77
|
return getHeight(rootRef);
|
|
74
78
|
}
|
|
79
|
+
function syncActionHeightClasses(height) {
|
|
80
|
+
const rightContainer = rightRef.current;
|
|
81
|
+
if (!rightContainer) return;
|
|
82
|
+
const heightSize = height > 180 ? "large" : height > 120 ? "medium" : "small";
|
|
83
|
+
rightContainer.classList.remove(`${classPrefix}-height-large`, `${classPrefix}-height-medium`, `${classPrefix}-height-small`);
|
|
84
|
+
rightContainer.classList.add(`${classPrefix}-height-${heightSize}`);
|
|
85
|
+
Array.from(rightContainer.children).forEach((element) => {
|
|
86
|
+
element.classList.remove(`${classPrefix}-action-height-large`, `${classPrefix}-action-height-medium`, `${classPrefix}-action-height-small`);
|
|
87
|
+
element.classList.add(`${classPrefix}-action-height-${heightSize}`);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function updateHeight() {
|
|
91
|
+
const height = getRootHeight();
|
|
92
|
+
syncActionHeightClasses(height);
|
|
93
|
+
setContainerHeight((currentHeight) => currentHeight === height ? currentHeight : height);
|
|
94
|
+
}
|
|
95
|
+
function startHeightTracking() {
|
|
96
|
+
if (resizeObserverRef.current) return;
|
|
97
|
+
updateHeight();
|
|
98
|
+
const resizeObserver = new ResizeObserver(updateHeight);
|
|
99
|
+
resizeObserverRef.current = resizeObserver;
|
|
100
|
+
if (rootRef.current) resizeObserver.observe(rootRef.current);
|
|
101
|
+
}
|
|
75
102
|
const [{ x }, api] = (0, _react_spring_web.useSpring)(() => ({
|
|
76
103
|
x: 0,
|
|
77
104
|
config: {
|
|
@@ -86,9 +113,43 @@ const SwipeAction = (0, react.forwardRef)((p, ref) => {
|
|
|
86
113
|
(_dragCancelRef$curren = dragCancelRef.current) === null || _dragCancelRef$curren === void 0 || _dragCancelRef$curren.call(dragCancelRef);
|
|
87
114
|
draggingRef.current = false;
|
|
88
115
|
}
|
|
116
|
+
function stopTouchOutsideListener() {
|
|
117
|
+
const cleanup = touchOutsideCleanupRef.current;
|
|
118
|
+
if (!cleanup) return;
|
|
119
|
+
cleanup();
|
|
120
|
+
touchOutsideCleanupRef.current = null;
|
|
121
|
+
}
|
|
122
|
+
function startTouchOutsideListener() {
|
|
123
|
+
if (!latestPropsRef.current.closeOnTouchOutside || touchOutsideCleanupRef.current) return;
|
|
124
|
+
const eventType = "ontouchstart" in window ? "touchstart" : "mousedown";
|
|
125
|
+
const handle = (e) => {
|
|
126
|
+
const latestProps = latestPropsRef.current;
|
|
127
|
+
if (e.target && latestProps.escapeDom) {
|
|
128
|
+
const container = document.querySelector(latestProps.escapeDom);
|
|
129
|
+
if (container === null || container === void 0 ? void 0 : container.contains(e.target)) return;
|
|
130
|
+
}
|
|
131
|
+
if (x.get() === 0) {
|
|
132
|
+
stopTouchOutsideListener();
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const root = rootRef.current;
|
|
136
|
+
if (root && !root.contains(e.target)) {
|
|
137
|
+
var _latestProps$onClose;
|
|
138
|
+
api.start({ x: 0 });
|
|
139
|
+
forceCancelDrag();
|
|
140
|
+
stopTouchOutsideListener();
|
|
141
|
+
(_latestProps$onClose = latestProps.onClose) === null || _latestProps$onClose === void 0 || _latestProps$onClose.call(latestProps);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
document.addEventListener(eventType, handle);
|
|
145
|
+
touchOutsideCleanupRef.current = () => {
|
|
146
|
+
document.removeEventListener(eventType, handle);
|
|
147
|
+
};
|
|
148
|
+
}
|
|
89
149
|
const bind = (0, _use_gesture_react_dist_use_gesture_react_cjs.useDrag)((state) => {
|
|
90
150
|
dragCancelRef.current = state.cancel;
|
|
91
151
|
if (!state.intentional) return;
|
|
152
|
+
startHeightTracking();
|
|
92
153
|
if (state.down) draggingRef.current = true;
|
|
93
154
|
if (!draggingRef.current) return;
|
|
94
155
|
const [offsetX] = state.offset;
|
|
@@ -107,8 +168,9 @@ const SwipeAction = (0, react.forwardRef)((p, ref) => {
|
|
|
107
168
|
api.start({ x: targetX });
|
|
108
169
|
if (targetX !== 0) {
|
|
109
170
|
var _p$onActionsReveal;
|
|
171
|
+
startTouchOutsideListener();
|
|
110
172
|
(_p$onActionsReveal = p.onActionsReveal) === null || _p$onActionsReveal === void 0 || _p$onActionsReveal.call(p, targetX > 0 ? "left" : "right");
|
|
111
|
-
}
|
|
173
|
+
} else stopTouchOutsideListener();
|
|
112
174
|
window.setTimeout(() => {
|
|
113
175
|
draggingRef.current = false;
|
|
114
176
|
});
|
|
@@ -134,46 +196,32 @@ const SwipeAction = (0, react.forwardRef)((p, ref) => {
|
|
|
134
196
|
var _props$onClose;
|
|
135
197
|
api.start({ x: 0 });
|
|
136
198
|
forceCancelDrag();
|
|
199
|
+
stopTouchOutsideListener();
|
|
137
200
|
(_props$onClose = props.onClose) === null || _props$onClose === void 0 || _props$onClose.call(props);
|
|
138
201
|
};
|
|
139
202
|
(0, react.useImperativeHandle)(ref, () => ({
|
|
140
203
|
show: (side = "right") => {
|
|
141
204
|
var _p$onActionsReveal2;
|
|
205
|
+
startHeightTracking();
|
|
142
206
|
if (side === "right") api.start({ x: -getRightWidth() });
|
|
143
207
|
else if (side === "left") api.start({ x: getLeftWidth() });
|
|
208
|
+
startTouchOutsideListener();
|
|
144
209
|
(_p$onActionsReveal2 = p.onActionsReveal) === null || _p$onActionsReveal2 === void 0 || _p$onActionsReveal2.call(p, side);
|
|
145
210
|
},
|
|
146
211
|
close
|
|
147
212
|
}));
|
|
148
213
|
(0, react.useEffect)(() => {
|
|
149
|
-
const updateHeight = () => {
|
|
150
|
-
setContainerHeight(getRootHeight());
|
|
151
|
-
};
|
|
152
|
-
updateHeight();
|
|
153
|
-
const resizeObserver = new ResizeObserver(updateHeight);
|
|
154
|
-
if (rootRef.current) resizeObserver.observe(rootRef.current);
|
|
155
214
|
return () => {
|
|
156
|
-
|
|
215
|
+
var _resizeObserverRef$cu;
|
|
216
|
+
(_resizeObserverRef$cu = resizeObserverRef.current) === null || _resizeObserverRef$cu === void 0 || _resizeObserverRef$cu.disconnect();
|
|
217
|
+
resizeObserverRef.current = null;
|
|
218
|
+
stopTouchOutsideListener();
|
|
157
219
|
};
|
|
158
220
|
}, []);
|
|
159
221
|
(0, react.useEffect)(() => {
|
|
160
|
-
if (!props.closeOnTouchOutside)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
const container = document.querySelector(props.escapeDom);
|
|
164
|
-
if (container === null || container === void 0 ? void 0 : container.contains(e.target)) return;
|
|
165
|
-
}
|
|
166
|
-
if (x.get() === 0) return;
|
|
167
|
-
const root = rootRef.current;
|
|
168
|
-
if (root && !root.contains(e.target)) close();
|
|
169
|
-
}
|
|
170
|
-
if ("ontouchstart" in window) document.addEventListener("touchstart", handle);
|
|
171
|
-
else document.addEventListener("mousedown", handle);
|
|
172
|
-
return () => {
|
|
173
|
-
document.removeEventListener("touchstart", handle);
|
|
174
|
-
document.removeEventListener("mousedown", handle);
|
|
175
|
-
};
|
|
176
|
-
}, [props.closeOnTouchOutside, props.escapeDom]);
|
|
222
|
+
if (!props.closeOnTouchOutside) stopTouchOutsideListener();
|
|
223
|
+
else if (x.get() !== 0) startTouchOutsideListener();
|
|
224
|
+
}, [props.closeOnTouchOutside]);
|
|
177
225
|
const getRightContainerClass = () => {
|
|
178
226
|
const baseClass = `${classPrefix}-actions ${classPrefix}-actions-right`;
|
|
179
227
|
if (containerHeight > 180) return `${baseClass} ${classPrefix}-height-large`;
|
|
@@ -204,6 +252,9 @@ const SwipeAction = (0, react.forwardRef)((p, ref) => {
|
|
|
204
252
|
}
|
|
205
253
|
return withNativeProps(props, /* @__PURE__ */ react.default.createElement("div", require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({ className: classPrefix }, bind()), {}, {
|
|
206
254
|
ref: rootRef,
|
|
255
|
+
onPointerDownCapture: startHeightTracking,
|
|
256
|
+
onTouchStartCapture: startHeightTracking,
|
|
257
|
+
onMouseDownCapture: startHeightTracking,
|
|
207
258
|
onClickCapture: (e) => {
|
|
208
259
|
if (draggingRef.current) {
|
|
209
260
|
e.stopPropagation();
|
|
@@ -66,7 +66,6 @@ const CartSkuCard = (props) => {
|
|
|
66
66
|
const useOpenNoteRef = (0, react.useRef)();
|
|
67
67
|
const context = require_useEngineContext.default();
|
|
68
68
|
_pisell_utils.locales.init(require_locales.default, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get("umi_locale")) || "en");
|
|
69
|
-
console.log("prodcut props", props);
|
|
70
69
|
const { isShowAction, actionText } = dataSource;
|
|
71
70
|
const _rightActions = (0, react.useMemo)(() => {
|
|
72
71
|
const deleteAction = {
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
var(--pisell-cart-sku-card-weighing-font-base) *
|
|
37
37
|
var(--pisell-cart-sku-card-device-font-scale)
|
|
38
38
|
);
|
|
39
|
+
// 称重卡片的辅助信息保持易读,但不与毛重/净重争夺视觉层级。
|
|
40
|
+
--pisell-cart-sku-card-weighing-meta-font-size: 18px;
|
|
41
|
+
--pisell-cart-sku-card-weighing-summary-font-size: 18px;
|
|
39
42
|
|
|
40
43
|
padding: 4px 8px 4px 4px;
|
|
41
44
|
border-radius: inherit;
|
|
@@ -5,12 +5,13 @@ react = require_runtime.__toESM(react);
|
|
|
5
5
|
require("./index.less");
|
|
6
6
|
//#region src/components/productCard/components/Packages/components/options/index.tsx
|
|
7
7
|
const prefix = "pisell-lowcode-";
|
|
8
|
-
const Options = ({ options, amountSymbol }) => {
|
|
8
|
+
const Options = ({ options, amountSymbol, amountFormatter }) => {
|
|
9
|
+
const formatOptionAmount = (value) => amountFormatter ? amountFormatter(value, 2) : require_utils._formatAmount(value, amountSymbol);
|
|
9
10
|
return (options === null || options === void 0 ? void 0 : options.length) > 0 ? /* @__PURE__ */ react.default.createElement("div", { className: `${prefix}packages-product-bundle-option` }, options.map((option, index) => {
|
|
10
11
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
11
12
|
key: option.id,
|
|
12
13
|
className: `${prefix}packages-product-bundle-option-item`
|
|
13
|
-
}, /* @__PURE__ */ react.default.createElement("div", { className: `${prefix}packages-product-bundle-option-item-left` }, /* @__PURE__ */ react.default.createElement("span", null, option === null || option === void 0 ? void 0 : option.name), /* @__PURE__ */ react.default.createElement("div", { className: `${prefix}packages-product-bundle-option-item-left-amount` }, /* @__PURE__ */ react.default.createElement("span", null,
|
|
14
|
+
}, /* @__PURE__ */ react.default.createElement("div", { className: `${prefix}packages-product-bundle-option-item-left` }, /* @__PURE__ */ react.default.createElement("span", null, option === null || option === void 0 ? void 0 : option.name), /* @__PURE__ */ react.default.createElement("div", { className: `${prefix}packages-product-bundle-option-item-left-amount` }, /* @__PURE__ */ react.default.createElement("span", null, formatOptionAmount(option === null || option === void 0 ? void 0 : option.price)), /* @__PURE__ */ react.default.createElement("span", null, "×"), /* @__PURE__ */ react.default.createElement("span", null, option === null || option === void 0 ? void 0 : option.num))), /* @__PURE__ */ react.default.createElement("span", { className: `${prefix}packages-product-bundle-option-item-amount` }, formatOptionAmount((option === null || option === void 0 ? void 0 : option.price) * (option === null || option === void 0 ? void 0 : option.num))));
|
|
14
15
|
})) : null;
|
|
15
16
|
};
|
|
16
17
|
//#endregion
|
|
@@ -33,9 +33,7 @@ const SelectHolderMultiple = ({ lists, value, onChange, holderMode, isShowAddHol
|
|
|
33
33
|
return acc;
|
|
34
34
|
}, {});
|
|
35
35
|
}, [lists]);
|
|
36
|
-
console.log(optionsMap, value, "optionsMap");
|
|
37
36
|
const handleClose = (item) => {
|
|
38
|
-
console.log("item", item, value);
|
|
39
37
|
handleChange(value.filter((d) => d !== item));
|
|
40
38
|
};
|
|
41
39
|
const renderHolder = () => {
|
|
@@ -66,8 +66,9 @@ const getStatusOption = (status, statusOptions = []) => {
|
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
68
|
const BookingLineItem = (props) => {
|
|
69
|
-
var _ref, _ref2, _dataSource$promotion;
|
|
69
|
+
var _ref, _ref2, _dataSource$promotion, _dataSource$giftData;
|
|
70
70
|
const { dataSource, type, cartSkuType, isShowBookingHeader, relatedProductDataSource, addTimeProductDataSources = [], rightActions = [], rightActionsDisplay = "swipe", escapeDom, isShowImage, isShowQuantityBadge = true, isFormSubject, isShowDelete, isShowInlineDelete = isShowDelete, isShowNote, isShowAmountFooter, disabledClick, disabledEdit, statusOptions = [], statusLoading = false, statusDisabled = false, isShowRelatedProduct = true, holderOptions, onBookingStatusChange, onAddTimeProductCard, onAction, onDelete, onNote, onCard, onPromotion, onGift } = props, other = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
|
|
71
|
+
const shouldRenderRelatedProduct = isShowRelatedProduct && Boolean(relatedProductDataSource);
|
|
71
72
|
const [isAddTimeProductsExpanded, setIsAddTimeProductsExpanded] = (0, react.useState)(false);
|
|
72
73
|
const { isShowAction, actionText } = dataSource;
|
|
73
74
|
const currentStatus = (0, react.useMemo)(() => getStatusOption(dataSource === null || dataSource === void 0 ? void 0 : dataSource.appointment_status, statusOptions), [dataSource === null || dataSource === void 0 ? void 0 : dataSource.appointment_status, statusOptions]);
|
|
@@ -118,7 +119,7 @@ const BookingLineItem = (props) => {
|
|
|
118
119
|
const renderProductCard = (productDataSource, source, options = {}) => {
|
|
119
120
|
var _productDataSource$pr;
|
|
120
121
|
if (!productDataSource || (productDataSource === null || productDataSource === void 0 ? void 0 : productDataSource.isGift)) return null;
|
|
121
|
-
const { showProductPromotion = true } = options;
|
|
122
|
+
const { showProductPromotion = true, showAmountFooter = true } = options;
|
|
122
123
|
const productPromotion = (productDataSource === null || productDataSource === void 0 || (_productDataSource$pr = productDataSource.promotions) === null || _productDataSource$pr === void 0 ? void 0 : _productDataSource$pr.length) ? /* @__PURE__ */ react.default.createElement(require_index$7.default, {
|
|
123
124
|
promotions: productDataSource.promotions,
|
|
124
125
|
onClick: (item) => onPromotion === null || onPromotion === void 0 ? void 0 : onPromotion(item)
|
|
@@ -134,7 +135,7 @@ const BookingLineItem = (props) => {
|
|
|
134
135
|
isShowImage,
|
|
135
136
|
isShowQuantityBadge,
|
|
136
137
|
type: cartSkuType
|
|
137
|
-
}), isShowAmountFooter ? /* @__PURE__ */ react.default.createElement(require_index$6.default, {
|
|
138
|
+
}), isShowAmountFooter && showAmountFooter ? /* @__PURE__ */ react.default.createElement(require_index$6.default, {
|
|
138
139
|
item: productDataSource,
|
|
139
140
|
hideDivider: false,
|
|
140
141
|
type: "total"
|
|
@@ -174,7 +175,8 @@ const BookingLineItem = (props) => {
|
|
|
174
175
|
}, _pisell_utils.locales.getText(isAddTimeProductsExpanded ? "pisell2.line-item.collapse" : "pisell2.line-item.show-all")) : null));
|
|
175
176
|
};
|
|
176
177
|
if (dataSource === null || dataSource === void 0 ? void 0 : dataSource.isGift) return null;
|
|
177
|
-
const
|
|
178
|
+
const shouldRenderFullWidthAmountFooter = rightActionsDisplay === "inline" && isShowAmountFooter && shouldRenderRelatedProduct;
|
|
179
|
+
const cardContent = /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", {
|
|
178
180
|
className: (0, classnames.default)(PREFIX, `${PREFIX}--booking`, `${PREFIX}--${type}`),
|
|
179
181
|
onClick: (e) => {
|
|
180
182
|
if (disabledClick) return;
|
|
@@ -195,16 +197,23 @@ const BookingLineItem = (props) => {
|
|
|
195
197
|
dataSource,
|
|
196
198
|
holderOptions: resolvedHolderOptions,
|
|
197
199
|
isFormSubject: resolvedIsFormSubject
|
|
198
|
-
}) : null), !isShowBookingHeader ? renderDeleteButton(true) : null),
|
|
200
|
+
}) : null), !isShowBookingHeader ? renderDeleteButton(true) : null), shouldRenderRelatedProduct ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement(antd.Divider, { style: { margin: 0 } }), /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__related-product` }, /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__related-product-card` }, renderProductCard(relatedProductDataSource, dataSource, {
|
|
201
|
+
showProductPromotion: false,
|
|
202
|
+
showAmountFooter: !shouldRenderFullWidthAmountFooter
|
|
203
|
+
}), renderPromotion, isShowAction && actionText ? /* @__PURE__ */ react.default.createElement(require_index$1.default, {
|
|
199
204
|
item: dataSource,
|
|
200
205
|
onAction: () => onAction === null || onAction === void 0 ? void 0 : onAction(dataSource)
|
|
201
|
-
}) : null))) : null, renderAddTimeProducts());
|
|
202
|
-
return /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${PREFIX}-wrapper-container`, { [`${PREFIX}-wrapper-container--inline`]: rightActionsDisplay === "inline" }) }, rightActionsDisplay === "inline" ? /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${PREFIX}-wrapper`, `${PREFIX}-wrapper--inline`) }, /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}-inline-content` }, cardContent), /* @__PURE__ */ react.default.createElement(require_index$9.default, { actions: bookingRightActions })) : /* @__PURE__ */ react.default.createElement(require_index$
|
|
206
|
+
}) : null))) : null, renderAddTimeProducts()));
|
|
207
|
+
return /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${PREFIX}-wrapper-container`, { [`${PREFIX}-wrapper-container--inline`]: rightActionsDisplay === "inline" }) }, rightActionsDisplay === "inline" ? /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${PREFIX}-wrapper`, `${PREFIX}-wrapper--inline`) }, /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}-inline-main` }, /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}-inline-content` }, cardContent), /* @__PURE__ */ react.default.createElement(require_index$9.default, { actions: bookingRightActions })), shouldRenderFullWidthAmountFooter ? /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__inline-amount-footer` }, /* @__PURE__ */ react.default.createElement(require_index$6.default, {
|
|
208
|
+
item: relatedProductDataSource,
|
|
209
|
+
hideDivider: false,
|
|
210
|
+
type: "total"
|
|
211
|
+
})) : null) : /* @__PURE__ */ react.default.createElement(require_index$4.SwipeAction, {
|
|
203
212
|
closeOnAction: false,
|
|
204
213
|
className: (0, classnames.default)(`${PREFIX}-wrapper`),
|
|
205
214
|
rightActions: bookingRightActions,
|
|
206
215
|
escapeDom
|
|
207
|
-
}, cardContent),
|
|
216
|
+
}, cardContent), (dataSource === null || dataSource === void 0 || (_dataSource$giftData = dataSource.giftData) === null || _dataSource$giftData === void 0 ? void 0 : _dataSource$giftData.isShow) ? /* @__PURE__ */ react.default.createElement(require_index$8.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, dataSource.giftData), {}, { onClick: () => onGift === null || onGift === void 0 ? void 0 : onGift(dataSource) })) : null);
|
|
208
217
|
};
|
|
209
218
|
//#endregion
|
|
210
219
|
exports.default = BookingLineItem;
|
|
@@ -8,9 +8,9 @@ const require_locales = require("../cartSkuCard/locales.js");
|
|
|
8
8
|
const require_index = require("../cartSkuCard/index.js");
|
|
9
9
|
const require_locales$1 = require("./locales.js");
|
|
10
10
|
const require_BookingLineItem = require("./BookingLineItem.js");
|
|
11
|
+
const require_useInitLocalesOnce = require("../../../hooks/useInitLocalesOnce.js");
|
|
11
12
|
let react = require("react");
|
|
12
13
|
react = require_runtime.__toESM(react);
|
|
13
|
-
let _pisell_utils = require("@pisell/utils");
|
|
14
14
|
require("./index.less");
|
|
15
15
|
//#region src/components/productCard/lineItem/index.tsx
|
|
16
16
|
const _excluded = [
|
|
@@ -40,7 +40,9 @@ const _excluded = [
|
|
|
40
40
|
"onNote",
|
|
41
41
|
"onCard",
|
|
42
42
|
"onPromotion",
|
|
43
|
-
"onGift"
|
|
43
|
+
"onGift",
|
|
44
|
+
"symbol",
|
|
45
|
+
"amountFormatter"
|
|
44
46
|
];
|
|
45
47
|
const isBookingItem = (dataSource) => {
|
|
46
48
|
var _dataSource$_extend;
|
|
@@ -77,7 +79,7 @@ const convertBundleOption = (option, translationOriginal) => {
|
|
|
77
79
|
num: (_ref = (_option$num = option.num) !== null && _option$num !== void 0 ? _option$num : option.quantity) !== null && _ref !== void 0 ? _ref : 1
|
|
78
80
|
});
|
|
79
81
|
};
|
|
80
|
-
const convertBundle = (bundle, translationOriginal) => {
|
|
82
|
+
const convertBundle = (bundle, translationOriginal, amountFormatter) => {
|
|
81
83
|
const options = (bundle.option || []).map((option) => convertBundleOption(option, translationOriginal));
|
|
82
84
|
const bundlePrice = bundle.price_type === "markdown" && Number.isFinite(Number(bundle.price)) ? -Math.abs(Number(bundle.price)) : bundle.price;
|
|
83
85
|
return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, bundle), {}, {
|
|
@@ -94,6 +96,7 @@ const convertBundle = (bundle, translationOriginal) => {
|
|
|
94
96
|
custom_price_type_ext: bundle.price_type_ext,
|
|
95
97
|
options,
|
|
96
98
|
option: options,
|
|
99
|
+
amountFormatter,
|
|
97
100
|
_origin: bundle
|
|
98
101
|
});
|
|
99
102
|
};
|
|
@@ -124,10 +127,10 @@ const mapLineItemOptions = (options, translationOriginal) => options.map((option
|
|
|
124
127
|
num: (_ref2 = (_option$num2 = option.num) !== null && _option$num2 !== void 0 ? _option$num2 : option.quantity) !== null && _ref2 !== void 0 ? _ref2 : 1
|
|
125
128
|
});
|
|
126
129
|
});
|
|
127
|
-
const convertProductToLineItemProduct = (product, translationOriginal, symbol) => {
|
|
130
|
+
const convertProductToLineItemProduct = (product, translationOriginal, symbol, amountFormatter) => {
|
|
128
131
|
var _product$metadata2, _ref3, _product$num, _ref4, _product$num2, _product$metadata3, _product$metadata4, _product$discount_lis, _product$discount_lis2, _product$metadata5, _product$metadata6, _ref5, _product$num3;
|
|
129
132
|
const title = translateText(product.product_title || product.title, translationOriginal);
|
|
130
|
-
const bundle = (product.product_bundle || []).map((bundleItem) => convertBundle(bundleItem, translationOriginal));
|
|
133
|
+
const bundle = (product.product_bundle || []).map((bundleItem) => convertBundle(bundleItem, translationOriginal, amountFormatter));
|
|
131
134
|
const lineOriginTotal = resolveLineOriginTotal(product);
|
|
132
135
|
const lineOptions = mapLineItemOptions(resolveLineItemOptions(product), translationOriginal);
|
|
133
136
|
return {
|
|
@@ -151,6 +154,7 @@ const convertProductToLineItemProduct = (product, translationOriginal, symbol) =
|
|
|
151
154
|
payment_price: product.payment_price,
|
|
152
155
|
tax_fee: product.tax_fee,
|
|
153
156
|
symbol,
|
|
157
|
+
amountFormatter,
|
|
154
158
|
note: product.note,
|
|
155
159
|
product_sku: product.product_sku,
|
|
156
160
|
product_bundle: bundle,
|
|
@@ -180,33 +184,36 @@ const convertProductToLineItemProduct = (product, translationOriginal, symbol) =
|
|
|
180
184
|
};
|
|
181
185
|
const LineItem = (props) => {
|
|
182
186
|
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _dataSource$_extend2, _dataSource$_extend4;
|
|
183
|
-
const { dataSource = require_status.defaultValue.dataSource, itemType, type = "a9", isShowBookingHeader, rightActions = [], rightActionsDisplay = "swipe", escapeDom, isShowImage = require_status.defaultValue.isShowImage, isShowDelete = require_status.defaultValue.isShowDelete, isShowInlineDelete = isShowDelete, isShowNote = require_status.defaultValue.isShowNote, isShowAmountFooter = require_status.defaultValue.isShowAmountFooter, disabledClick = require_status.defaultValue.disabledClick, disabledEdit = require_status.defaultValue.disabledEdit, statusOptions = [], statusLoading = false, statusDisabled = false, isShowRelatedProduct = true, holderOptions, onBookingStatusChange, onAddTimeProductCard, onAction, onDelete, onNote, onCard, onPromotion, onGift } = props, other = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
|
|
184
|
-
|
|
187
|
+
const { dataSource = require_status.defaultValue.dataSource, itemType, type = "a9", isShowBookingHeader, rightActions = [], rightActionsDisplay = "swipe", escapeDom, isShowImage = require_status.defaultValue.isShowImage, isShowDelete = require_status.defaultValue.isShowDelete, isShowInlineDelete = isShowDelete, isShowNote = require_status.defaultValue.isShowNote, isShowAmountFooter = require_status.defaultValue.isShowAmountFooter, disabledClick = require_status.defaultValue.disabledClick, disabledEdit = require_status.defaultValue.disabledEdit, statusOptions = [], statusLoading = false, statusDisabled = false, isShowRelatedProduct = true, holderOptions, onBookingStatusChange, onAddTimeProductCard, onAction, onDelete, onNote, onCard, onPromotion, onGift, symbol: amountSymbol, amountFormatter } = props, other = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
|
|
188
|
+
const itemKind = itemType || (isBookingItem(dataSource) ? "booking" : "product");
|
|
185
189
|
const context = require_useEngineContext.default();
|
|
186
190
|
const translationOriginal = require_useTranslationOriginal.default();
|
|
187
|
-
const symbol = context.appHelper.utils.getSymbolic();
|
|
191
|
+
const symbol = amountSymbol || context.appHelper.utils.getSymbolic();
|
|
188
192
|
const locale = ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getApp) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.locales) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut3 = _context$appHelper$ut2.getLocale) === null || _context$appHelper$ut3 === void 0 ? void 0 : _context$appHelper$ut3.call(_context$appHelper$ut2)) || ((_context$appHelper$ut4 = context.appHelper.utils) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut4 = _context$appHelper$ut4.storage) === null || _context$appHelper$ut4 === void 0 ? void 0 : _context$appHelper$ut4.get("umi_locale")) || "en-US";
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
+
require_useInitLocalesOnce.default(require_locales$1.default, locale);
|
|
194
|
+
require_useInitLocalesOnce.default(require_locales.default, locale);
|
|
195
|
+
const productDataSource = (0, react.useMemo)(() => itemKind === "product" ? convertProductToLineItemProduct(dataSource, translationOriginal, symbol, amountFormatter) : null, [
|
|
196
|
+
amountFormatter,
|
|
193
197
|
dataSource,
|
|
198
|
+
itemKind,
|
|
194
199
|
symbol,
|
|
195
200
|
translationOriginal
|
|
196
201
|
]);
|
|
197
202
|
const relatedProduct = dataSource === null || dataSource === void 0 || (_dataSource$_extend2 = dataSource._extend) === null || _dataSource$_extend2 === void 0 ? void 0 : _dataSource$_extend2.product;
|
|
198
203
|
const relatedProductDataSource = (0, react.useMemo)(() => {
|
|
199
204
|
if (!relatedProduct) return null;
|
|
200
|
-
return convertProductToLineItemProduct(relatedProduct, translationOriginal, symbol);
|
|
205
|
+
return convertProductToLineItemProduct(relatedProduct, translationOriginal, symbol, amountFormatter);
|
|
201
206
|
}, [
|
|
207
|
+
amountFormatter,
|
|
202
208
|
relatedProduct,
|
|
203
209
|
symbol,
|
|
204
210
|
translationOriginal
|
|
205
211
|
]);
|
|
206
212
|
const addTimeProductDataSources = (0, react.useMemo)(() => {
|
|
207
213
|
var _dataSource$_extend3;
|
|
208
|
-
return (Array.isArray(dataSource === null || dataSource === void 0 || (_dataSource$_extend3 = dataSource._extend) === null || _dataSource$_extend3 === void 0 ? void 0 : _dataSource$_extend3.addTimeProduct) ? dataSource._extend.addTimeProduct : []).map((item) => convertProductToLineItemProduct(item, translationOriginal, symbol));
|
|
214
|
+
return (Array.isArray(dataSource === null || dataSource === void 0 || (_dataSource$_extend3 = dataSource._extend) === null || _dataSource$_extend3 === void 0 ? void 0 : _dataSource$_extend3.addTimeProduct) ? dataSource._extend.addTimeProduct : []).map((item) => convertProductToLineItemProduct(item, translationOriginal, symbol, amountFormatter));
|
|
209
215
|
}, [
|
|
216
|
+
amountFormatter,
|
|
210
217
|
dataSource === null || dataSource === void 0 || (_dataSource$_extend4 = dataSource._extend) === null || _dataSource$_extend4 === void 0 ? void 0 : _dataSource$_extend4.addTimeProduct,
|
|
211
218
|
symbol,
|
|
212
219
|
translationOriginal
|
|
@@ -15,10 +15,16 @@
|
|
|
15
15
|
box-sizing: border-box;
|
|
16
16
|
width: 100%;
|
|
17
17
|
display: flex;
|
|
18
|
-
|
|
18
|
+
flex-direction: column;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
.pisell-line-item-inline-main {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: stretch;
|
|
25
|
+
min-width: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
.pisell-line-item-inline-content {
|
|
23
29
|
min-width: 0;
|
|
24
30
|
flex: 1;
|
|
@@ -249,6 +255,13 @@
|
|
|
249
255
|
padding: 6px 8px 8px;
|
|
250
256
|
}
|
|
251
257
|
|
|
258
|
+
// inline 操作仅占上方主体,价格栏放在其下方并占满整个预约卡。
|
|
259
|
+
&__inline-amount-footer {
|
|
260
|
+
box-sizing: border-box;
|
|
261
|
+
width: 100%;
|
|
262
|
+
padding: 0 8px 4px;
|
|
263
|
+
}
|
|
264
|
+
|
|
252
265
|
&__section-title {
|
|
253
266
|
color: #101828;
|
|
254
267
|
font-size: 12px;
|