@pisell/materials 6.11.271 → 6.11.273
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.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -1
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.js +5 -2
- package/es/components/productCard/cartSkuCard/components/holders/index.js +25 -8
- package/es/components/productCard/cartSkuCard/index.js +11 -4
- package/es/components/productCard/lineItem/index.js +7 -0
- package/es/components/walletCard/Guest/index.js +2 -1
- package/es/components/walletCard/index.js +11 -4
- package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -1
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.js +5 -2
- package/lib/components/productCard/cartSkuCard/components/holders/index.js +25 -8
- package/lib/components/productCard/cartSkuCard/index.js +43 -36
- package/lib/components/productCard/lineItem/index.js +7 -0
- package/lib/components/walletCard/Guest/index.js +2 -1
- package/lib/components/walletCard/index.js +11 -4
- package/package.json +3 -3
|
@@ -5,7 +5,7 @@ import React from "react";
|
|
|
5
5
|
//#region src/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts
|
|
6
6
|
declare const RecordListWrapperWithDataSource: (props: RecordListWrapperProps & WithModeProps & WithFormItemProps & {
|
|
7
7
|
options?: any;
|
|
8
|
-
optionSourceType?: "
|
|
8
|
+
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
9
9
|
labelField: string;
|
|
10
10
|
valueField: string;
|
|
11
11
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -6,7 +6,7 @@ import * as _$antd_es_select0 from "antd/es/select";
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Select/index.d.ts
|
|
7
7
|
declare const SelectWithDataSource: (props: _$antd.SelectProps<any, _$antd_es_select0.DefaultOptionType> & WithModeProps & WithFormItemProps & {
|
|
8
8
|
options?: any;
|
|
9
|
-
optionSourceType?: "
|
|
9
|
+
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
10
10
|
labelField: string;
|
|
11
11
|
valueField: string;
|
|
12
12
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -7,7 +7,7 @@ import * as _$react from "react";
|
|
|
7
7
|
/** 包装 DataSource 层(提供数据源上下文) */
|
|
8
8
|
declare const FormItemTabs: (props: TabsProps & WithModeProps & WithFormItemProps & {
|
|
9
9
|
options?: any;
|
|
10
|
-
optionSourceType?: "
|
|
10
|
+
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
11
11
|
labelField: string;
|
|
12
12
|
valueField: string;
|
|
13
13
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -9,7 +9,7 @@ import classNames from "classnames";
|
|
|
9
9
|
import "./index.less";
|
|
10
10
|
//#region src/components/productCard/cartSkuCard/components/basicInfo/index.tsx
|
|
11
11
|
const BasicInfo = (props) => {
|
|
12
|
-
const { isShowImage, isShowQuantityBadge = true, dataSource = {}, style, isMainProduct, type, maxSpecsCount = 1, isBundle, showFooter, isShowOriginalPrice = false, isShowEditProduct = false, onEditProduct, disabledEditClick = false } = props;
|
|
12
|
+
const { isShowImage, isShowQuantityBadge = true, dataSource = {}, style, isMainProduct, type, maxSpecsCount = 1, isBundle, showFooter, isShowOriginalPrice = false, isShowEditProduct = false, onEditProduct, onChangeHolder, disabledEditClick = false } = props;
|
|
13
13
|
const { image: image$1, bundle, options, product_option_string, name, price, symbol, total = 0, origin_total = 0, num = 1, holder_id, isFormSubject, totalDifference = 0, amountFormatter } = dataSource;
|
|
14
14
|
const formatProductAmount = (value, precision = 2) => amountFormatter ? amountFormatter(value, precision) : formatAmount(value, precision, symbol);
|
|
15
15
|
const renderNumTag = () => {
|
|
@@ -73,7 +73,10 @@ const BasicInfo = (props) => {
|
|
|
73
73
|
if (type === "a5") return /* @__PURE__ */ React.createElement("div", {
|
|
74
74
|
className: basicInfoClassName,
|
|
75
75
|
style: style || {}
|
|
76
|
-
}, isShowQuantityBadge ? renderNumTag() : null, renderImage(), !isShowImage || !image$1 && !name ? /* @__PURE__ */ React.createElement("div", { style: { width: 20 } }) : null, /* @__PURE__ */ React.createElement("div", { className: `product-info product-info-a5` }, /* @__PURE__ */ React.createElement("div", { className: `product-basic-info-wrap` }, /* @__PURE__ */ React.createElement("div", { className: `product-name ${renderEdit ? "product-name-edit" : ""}` }, name), renderProductMeta(), (!holder_id || !(holder_id === null || holder_id === void 0 ? void 0 : holder_id.length)) && !isFormSubject ? /* @__PURE__ */ React.createElement("div", { className: `product-price` }, renderProductPrice()) : /* @__PURE__ */ React.createElement(Holders, {
|
|
76
|
+
}, isShowQuantityBadge ? renderNumTag() : null, renderImage(), !isShowImage || !image$1 && !name ? /* @__PURE__ */ React.createElement("div", { style: { width: 20 } }) : null, /* @__PURE__ */ React.createElement("div", { className: `product-info product-info-a5` }, /* @__PURE__ */ React.createElement("div", { className: `product-basic-info-wrap` }, /* @__PURE__ */ React.createElement("div", { className: `product-name ${renderEdit ? "product-name-edit" : ""}` }, name), renderProductMeta(), (!holder_id || !(holder_id === null || holder_id === void 0 ? void 0 : holder_id.length)) && !isFormSubject ? /* @__PURE__ */ React.createElement("div", { className: `product-price` }, renderProductPrice()) : /* @__PURE__ */ React.createElement(Holders, {
|
|
77
|
+
dataSource,
|
|
78
|
+
onChangeHolder: onChangeHolder ? () => onChangeHolder(dataSource) : void 0
|
|
79
|
+
})), renderEdit));
|
|
77
80
|
if (type === "a9") {
|
|
78
81
|
isBundle && !showFooter && Number(price !== null && price !== void 0 ? price : 0) * num;
|
|
79
82
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -10,15 +10,33 @@ const holderIconMap = {
|
|
|
10
10
|
"waiver": "pisell2-file-lock-03"
|
|
11
11
|
};
|
|
12
12
|
const Holders = (props) => {
|
|
13
|
-
const { dataSource = {} } = props;
|
|
14
|
-
const { holders, holder_id } = dataSource;
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const { dataSource = {}, onChangeHolder } = props;
|
|
14
|
+
const { holders, holder_id, holderName, showUnassignedHolder } = dataSource;
|
|
15
|
+
const holderIds = Array.isArray(holder_id) ? holder_id : holder_id === void 0 || holder_id === null || holder_id === "" ? [] : [holder_id];
|
|
16
|
+
const missingCount = Math.max((Number(dataSource.holderMaxCount) || 1) - holderIds.length, 0);
|
|
17
|
+
const wrapContent = (content) => onChangeHolder ? /* @__PURE__ */ React.createElement("div", {
|
|
18
|
+
role: "button",
|
|
19
|
+
tabIndex: 0,
|
|
20
|
+
onClick: (event) => {
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
event.stopPropagation();
|
|
23
|
+
onChangeHolder();
|
|
24
|
+
},
|
|
25
|
+
onKeyDown: (event) => {
|
|
26
|
+
if (!["Enter", " "].includes(event.key)) return;
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
event.stopPropagation();
|
|
29
|
+
onChangeHolder();
|
|
30
|
+
}
|
|
31
|
+
}, content) : content;
|
|
32
|
+
const unassigned = /* @__PURE__ */ React.createElement("div", { className: "holder-item unassigned" }, dataSource.holderMaxCount > 1 ? /* @__PURE__ */ React.createElement("span", null, missingCount, "/", dataSource.holderMaxCount, " ") : null, /* @__PURE__ */ React.createElement("span", { className: "holder-label" }, locales.getText("pisell2.cart.sku-card.unassigned")));
|
|
33
|
+
if (!holderIds.length) {
|
|
34
|
+
if (dataSource.isFormSubject) return wrapContent(unassigned);
|
|
17
35
|
return null;
|
|
18
36
|
}
|
|
19
37
|
const renderHolder = (id) => {
|
|
20
38
|
if (!id) return null;
|
|
21
|
-
const holder = (holders || []).find((item) => item.id === id);
|
|
39
|
+
const holder = (holders || []).find((item) => String(item.id) === String(id));
|
|
22
40
|
return /* @__PURE__ */ React.createElement("div", {
|
|
23
41
|
className: "holder-item",
|
|
24
42
|
key: id
|
|
@@ -27,9 +45,8 @@ const Holders = (props) => {
|
|
|
27
45
|
type: holderIconMap[(dataSource === null || dataSource === void 0 ? void 0 : dataSource.holderType) || "minors"]
|
|
28
46
|
}), /* @__PURE__ */ React.createElement("span", { className: "holder-label" }, (holder === null || holder === void 0 ? void 0 : holder.label) || id));
|
|
29
47
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}) : renderHolder(holder_id));
|
|
48
|
+
const useSnapshot = holderName && holderIds.some((id) => !(holders || []).some((item) => String(item.id) === String(id) && item.label));
|
|
49
|
+
return wrapContent(/* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__holders` }, useSnapshot ? /* @__PURE__ */ React.createElement("div", { className: "holder-item" }, /* @__PURE__ */ React.createElement("span", { className: "holder-label" }, holderName)) : holderIds.map(renderHolder), showUnassignedHolder && missingCount > 0 ? unassigned : null));
|
|
33
50
|
};
|
|
34
51
|
//#endregion
|
|
35
52
|
export { Holders as default };
|
|
@@ -5,6 +5,7 @@ import useEngineContext from "../../../hooks/useEngineContext.js";
|
|
|
5
5
|
import Action from "../components/Action/index.js";
|
|
6
6
|
import { defaultValue } from "../status.js";
|
|
7
7
|
import locales_default from "./locales.js";
|
|
8
|
+
import Holders from "./components/holders/index.js";
|
|
8
9
|
import BasicInfo from "./components/basicInfo/index.js";
|
|
9
10
|
import DiscountReason from "./components/discountReason/index.js";
|
|
10
11
|
import TimeRange from "./components/timeRange/index.js";
|
|
@@ -132,6 +133,10 @@ const CartSkuCard = (props) => {
|
|
|
132
133
|
if (rightActionsDisplay !== "inline") return basicInfo;
|
|
133
134
|
return /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__main-row` }, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__main-content` }, basicInfo), /* @__PURE__ */ React.createElement(InlineActions, { actions: _rightActions }));
|
|
134
135
|
};
|
|
136
|
+
const productHolders = props.isShowHolder === true && dataSource.showUnassignedHolder !== void 0 ? /* @__PURE__ */ React.createElement(Holders, {
|
|
137
|
+
dataSource,
|
|
138
|
+
onChangeHolder: onChangeHolder ? () => onChangeHolder(dataSource) : void 0
|
|
139
|
+
}) : null;
|
|
135
140
|
const renderA2 = () => {
|
|
136
141
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, renderMainProduct(/* @__PURE__ */ React.createElement(BasicInfo, {
|
|
137
142
|
isShowImage,
|
|
@@ -139,7 +144,7 @@ const CartSkuCard = (props) => {
|
|
|
139
144
|
dataSource,
|
|
140
145
|
isMainProduct: true,
|
|
141
146
|
maxSpecsCount
|
|
142
|
-
})), /* @__PURE__ */ React.createElement(DiscountReason, { dataSource }), renderPromotion, isShowNote ? /* @__PURE__ */ React.createElement(Note, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
147
|
+
})), /* @__PURE__ */ React.createElement(DiscountReason, { dataSource }), renderPromotion, productHolders, isShowNote ? /* @__PURE__ */ React.createElement(Note, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
143
148
|
item: dataSource,
|
|
144
149
|
disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
|
|
145
150
|
openNote: openNoteEditor
|
|
@@ -163,7 +168,8 @@ const CartSkuCard = (props) => {
|
|
|
163
168
|
isShowOriginalPrice,
|
|
164
169
|
isShowEditProduct,
|
|
165
170
|
disabledEditClick,
|
|
166
|
-
onEditProduct
|
|
171
|
+
onEditProduct,
|
|
172
|
+
onChangeHolder: productHolders ? onChangeHolder : void 0
|
|
167
173
|
})), itemType !== "booking" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(TimeRange, { dataSource }), /* @__PURE__ */ React.createElement(Resources, { dataSource })) : null, /* @__PURE__ */ React.createElement(Packages, {
|
|
168
174
|
dataSource,
|
|
169
175
|
isShowImage,
|
|
@@ -216,7 +222,7 @@ const CartSkuCard = (props) => {
|
|
|
216
222
|
item: dataSource,
|
|
217
223
|
hideDivider,
|
|
218
224
|
type: "total"
|
|
219
|
-
}) : null, /* @__PURE__ */ React.createElement(DiscountReason, { dataSource }), renderPromotion, isShowNote ? /* @__PURE__ */ React.createElement(Note, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
225
|
+
}) : null, /* @__PURE__ */ React.createElement(DiscountReason, { dataSource }), renderPromotion, productHolders, isShowNote ? /* @__PURE__ */ React.createElement(Note, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
220
226
|
item: dataSource,
|
|
221
227
|
disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
|
|
222
228
|
openNote: openNoteEditor
|
|
@@ -229,7 +235,8 @@ const CartSkuCard = (props) => {
|
|
|
229
235
|
disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
|
|
230
236
|
openNote: openNoteEditor
|
|
231
237
|
})) : null;
|
|
232
|
-
const
|
|
238
|
+
const contentFooter = note || productHolders ? () => /* @__PURE__ */ React.createElement(React.Fragment, null, productHolders, note) : void 0;
|
|
239
|
+
const slots = contentFooter ? _objectSpread2(_objectSpread2({}, a12Slots), {}, { contentFooter: (_a12Slots$contentFoot = a12Slots === null || a12Slots === void 0 ? void 0 : a12Slots.contentFooter) !== null && _a12Slots$contentFoot !== void 0 ? _a12Slots$contentFoot : contentFooter }) : a12Slots;
|
|
233
240
|
return /* @__PURE__ */ React.createElement(A12, {
|
|
234
241
|
dataSource,
|
|
235
242
|
isShowImage,
|
|
@@ -179,6 +179,13 @@ const convertProductToLineItemProduct = (product, translationOriginal, symbol, a
|
|
|
179
179
|
symbol,
|
|
180
180
|
amountFormatter,
|
|
181
181
|
note: product.note,
|
|
182
|
+
holder_id: product.holder_id,
|
|
183
|
+
holders: product.holders,
|
|
184
|
+
holderName: product.holderName,
|
|
185
|
+
holderType: product.holderType,
|
|
186
|
+
holderMaxCount: product.holderMaxCount,
|
|
187
|
+
isFormSubject: product.isFormSubject,
|
|
188
|
+
showUnassignedHolder: product.showUnassignedHolder,
|
|
182
189
|
product_sku: product.product_sku,
|
|
183
190
|
product_bundle: bundle,
|
|
184
191
|
bundle,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import useEngineContext from "../../../hooks/useEngineContext.js";
|
|
2
2
|
import Button from "../../button/index.js";
|
|
3
3
|
import React from "react";
|
|
4
|
+
import { image } from "@pisell/utils";
|
|
4
5
|
import "./index.less";
|
|
5
6
|
//#region src/components/walletCard/Guest/index.tsx
|
|
6
7
|
const Guest = (props) => {
|
|
@@ -44,7 +45,7 @@ const Guest = (props) => {
|
|
|
44
45
|
style: { backgroundColor: setting === null || setting === void 0 ? void 0 : setting.backgroundColor }
|
|
45
46
|
}, (utils === null || utils === void 0 || (_utils$translation = utils.translation) === null || _utils$translation === void 0 ? void 0 : _utils$translation.call(utils, setting === null || setting === void 0 ? void 0 : setting.backgroundImage)) ? /* @__PURE__ */ React.createElement("img", {
|
|
46
47
|
className: "pisell-wallet-guest-bg",
|
|
47
|
-
src: (utils === null || utils === void 0 || (_utils$translation2 = utils.translation) === null || _utils$translation2 === void 0 ? void 0 : _utils$translation2.call(utils, setting.backgroundImage)) || "",
|
|
48
|
+
src: image.ali((utils === null || utils === void 0 || (_utils$translation2 = utils.translation) === null || _utils$translation2 === void 0 ? void 0 : _utils$translation2.call(utils, setting.backgroundImage)) || "", 175),
|
|
48
49
|
alt: (utils === null || utils === void 0 || (_utils$translation3 = utils.translation) === null || _utils$translation3 === void 0 ? void 0 : _utils$translation3.call(utils, setting === null || setting === void 0 ? void 0 : setting.backgroundImageAlt)) || "",
|
|
49
50
|
title: (utils === null || utils === void 0 || (_utils$translation4 = utils.translation) === null || _utils$translation4 === void 0 ? void 0 : _utils$translation4.call(utils, setting === null || setting === void 0 ? void 0 : setting.backgroundImageAlt)) || ""
|
|
50
51
|
}) : null, /* @__PURE__ */ React.createElement("div", { className: `pisell-wallet-guest-content ${setting.align === "center" ? "pisell-wallet-guest-center" : ""}` }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", {
|
|
@@ -7,6 +7,7 @@ import Amount from "../pisellText/components/Amount/index.js";
|
|
|
7
7
|
import Guest from "./Guest/index.js";
|
|
8
8
|
import Guide from "./Guide/index.js";
|
|
9
9
|
import React, { useMemo, useState } from "react";
|
|
10
|
+
import { image } from "@pisell/utils";
|
|
10
11
|
import { Button, Card, QRCode } from "antd";
|
|
11
12
|
import classNames from "classnames";
|
|
12
13
|
import Barcode from "react-barcode";
|
|
@@ -133,7 +134,7 @@ const CardHeader = ({ showIcon = true, showWalletName = true, showShopName = tru
|
|
|
133
134
|
const processedShowCode = toBooleanValue(showCode);
|
|
134
135
|
const processedShowViewPin = toBooleanValue(showViewPin);
|
|
135
136
|
return /* @__PURE__ */ React.createElement("div", { className: "pisell-wallet-card-header" }, /* @__PURE__ */ React.createElement("div", { className: "pisell-wallet-card-header-left" }, /* @__PURE__ */ React.createElement("div", { className: "pisell-wallet-card-header-level" }, processedShowIcon && iconImg ? /* @__PURE__ */ React.createElement("div", { className: "pisell-wallet-card-header-icon" }, /* @__PURE__ */ React.createElement("img", {
|
|
136
|
-
src: iconImg,
|
|
137
|
+
src: image.ali(iconImg, 40),
|
|
137
138
|
alt: "wallet icon",
|
|
138
139
|
style: {
|
|
139
140
|
width: "20px",
|
|
@@ -244,11 +245,17 @@ const WalletCard = (props) => {
|
|
|
244
245
|
const { isModalOpen, handleCodeClick, closeModal } = useCodeModal(cardNo, onCodeClick, codeType);
|
|
245
246
|
console.log("showViewPin", props);
|
|
246
247
|
const backgroundStyle = useMemo(() => {
|
|
247
|
-
if (props.customBackgroundImage) return { backgroundImage: `url(${props.customBackgroundImage})` };
|
|
248
|
+
if (props.customBackgroundImage) return { backgroundImage: `url(${image.ali(props.customBackgroundImage, 175)})` };
|
|
248
249
|
else {
|
|
249
|
-
var _props$walletGuideCon;
|
|
250
|
+
var _props$walletGuideCon, _constants;
|
|
250
251
|
if ((props === null || props === void 0 || (_props$walletGuideCon = props.walletGuideConfig) === null || _props$walletGuideCon === void 0 ? void 0 : _props$walletGuideCon.backgroundColor) && isGuide || (props === null || props === void 0 ? void 0 : props.backgroundColor) && !isLogin) return { backgroundImage: "none" };
|
|
251
|
-
|
|
252
|
+
let staticUrl = (_constants = constants) === null || _constants === void 0 ? void 0 : _constants.staticURL;
|
|
253
|
+
if (!staticUrl) {
|
|
254
|
+
var _constants2;
|
|
255
|
+
staticUrl = ((_constants2 = constants) === null || _constants2 === void 0 || (_constants2 = _constants2.config) === null || _constants2 === void 0 ? void 0 : _constants2.awsStatic) || "https://static.pisellcdn.com";
|
|
256
|
+
}
|
|
257
|
+
const backgroundImage = `${staticUrl}/${mode === "dark" ? "dark_wallet.png" : "light_wallet.png"}`;
|
|
258
|
+
return { backgroundImage: `url(${image.ali(backgroundImage, 175)})` };
|
|
252
259
|
}
|
|
253
260
|
}, [
|
|
254
261
|
props.customBackgroundImage,
|
|
@@ -5,7 +5,7 @@ import React from "react";
|
|
|
5
5
|
//#region src/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts
|
|
6
6
|
declare const RecordListWrapperWithDataSource: (props: RecordListWrapperProps & WithModeProps & WithFormItemProps & {
|
|
7
7
|
options?: any;
|
|
8
|
-
optionSourceType?: "
|
|
8
|
+
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
9
9
|
labelField: string;
|
|
10
10
|
valueField: string;
|
|
11
11
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -6,7 +6,7 @@ import * as _$antd_es_select0 from "antd/es/select";
|
|
|
6
6
|
//#region src/components/dataSourceComponents/fields/Select/index.d.ts
|
|
7
7
|
declare const SelectWithDataSource: (props: _$antd.SelectProps<any, _$antd_es_select0.DefaultOptionType> & WithModeProps & WithFormItemProps & {
|
|
8
8
|
options?: any;
|
|
9
|
-
optionSourceType?: "
|
|
9
|
+
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
10
10
|
labelField: string;
|
|
11
11
|
valueField: string;
|
|
12
12
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -7,7 +7,7 @@ import * as _$react from "react";
|
|
|
7
7
|
/** 包装 DataSource 层(提供数据源上下文) */
|
|
8
8
|
declare const FormItemTabs: (props: TabsProps & WithModeProps & WithFormItemProps & {
|
|
9
9
|
options?: any;
|
|
10
|
-
optionSourceType?: "
|
|
10
|
+
optionSourceType?: "custom" | "default" | "api" | undefined;
|
|
11
11
|
labelField: string;
|
|
12
12
|
valueField: string;
|
|
13
13
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -12,7 +12,7 @@ classnames = require_runtime.__toESM(classnames);
|
|
|
12
12
|
require("./index.less");
|
|
13
13
|
//#region src/components/productCard/cartSkuCard/components/basicInfo/index.tsx
|
|
14
14
|
const BasicInfo = (props) => {
|
|
15
|
-
const { isShowImage, isShowQuantityBadge = true, dataSource = {}, style, isMainProduct, type, maxSpecsCount = 1, isBundle, showFooter, isShowOriginalPrice = false, isShowEditProduct = false, onEditProduct, disabledEditClick = false } = props;
|
|
15
|
+
const { isShowImage, isShowQuantityBadge = true, dataSource = {}, style, isMainProduct, type, maxSpecsCount = 1, isBundle, showFooter, isShowOriginalPrice = false, isShowEditProduct = false, onEditProduct, onChangeHolder, disabledEditClick = false } = props;
|
|
16
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
17
|
const formatProductAmount = (value, precision = 2) => amountFormatter ? amountFormatter(value, precision) : (0, _pisell_utils.formatAmount)(value, precision, symbol);
|
|
18
18
|
const renderNumTag = () => {
|
|
@@ -76,7 +76,10 @@ const BasicInfo = (props) => {
|
|
|
76
76
|
if (type === "a5") return /* @__PURE__ */ react.default.createElement("div", {
|
|
77
77
|
className: basicInfoClassName,
|
|
78
78
|
style: style || {}
|
|
79
|
-
}, 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-a5` }, /* @__PURE__ */ react.default.createElement("div", { className: `product-basic-info-wrap` }, /* @__PURE__ */ react.default.createElement("div", { className: `product-name ${renderEdit ? "product-name-edit" : ""}` }, name), renderProductMeta(), (!holder_id || !(holder_id === null || holder_id === void 0 ? void 0 : holder_id.length)) && !isFormSubject ? /* @__PURE__ */ react.default.createElement("div", { className: `product-price` }, renderProductPrice()) : /* @__PURE__ */ react.default.createElement(require_index$2.default, {
|
|
79
|
+
}, 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-a5` }, /* @__PURE__ */ react.default.createElement("div", { className: `product-basic-info-wrap` }, /* @__PURE__ */ react.default.createElement("div", { className: `product-name ${renderEdit ? "product-name-edit" : ""}` }, name), renderProductMeta(), (!holder_id || !(holder_id === null || holder_id === void 0 ? void 0 : holder_id.length)) && !isFormSubject ? /* @__PURE__ */ react.default.createElement("div", { className: `product-price` }, renderProductPrice()) : /* @__PURE__ */ react.default.createElement(require_index$2.default, {
|
|
80
|
+
dataSource,
|
|
81
|
+
onChangeHolder: onChangeHolder ? () => onChangeHolder(dataSource) : void 0
|
|
82
|
+
})), renderEdit));
|
|
80
83
|
if (type === "a9") {
|
|
81
84
|
isBundle && !showFooter && Number(price !== null && price !== void 0 ? price : 0) * num;
|
|
82
85
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
@@ -12,15 +12,33 @@ const holderIconMap = {
|
|
|
12
12
|
"waiver": "pisell2-file-lock-03"
|
|
13
13
|
};
|
|
14
14
|
const Holders = (props) => {
|
|
15
|
-
const { dataSource = {} } = props;
|
|
16
|
-
const { holders, holder_id } = dataSource;
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const { dataSource = {}, onChangeHolder } = props;
|
|
16
|
+
const { holders, holder_id, holderName, showUnassignedHolder } = dataSource;
|
|
17
|
+
const holderIds = Array.isArray(holder_id) ? holder_id : holder_id === void 0 || holder_id === null || holder_id === "" ? [] : [holder_id];
|
|
18
|
+
const missingCount = Math.max((Number(dataSource.holderMaxCount) || 1) - holderIds.length, 0);
|
|
19
|
+
const wrapContent = (content) => onChangeHolder ? /* @__PURE__ */ react.default.createElement("div", {
|
|
20
|
+
role: "button",
|
|
21
|
+
tabIndex: 0,
|
|
22
|
+
onClick: (event) => {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
event.stopPropagation();
|
|
25
|
+
onChangeHolder();
|
|
26
|
+
},
|
|
27
|
+
onKeyDown: (event) => {
|
|
28
|
+
if (!["Enter", " "].includes(event.key)) return;
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
event.stopPropagation();
|
|
31
|
+
onChangeHolder();
|
|
32
|
+
}
|
|
33
|
+
}, content) : content;
|
|
34
|
+
const unassigned = /* @__PURE__ */ react.default.createElement("div", { className: "holder-item unassigned" }, dataSource.holderMaxCount > 1 ? /* @__PURE__ */ react.default.createElement("span", null, missingCount, "/", dataSource.holderMaxCount, " ") : null, /* @__PURE__ */ react.default.createElement("span", { className: "holder-label" }, _pisell_utils.locales.getText("pisell2.cart.sku-card.unassigned")));
|
|
35
|
+
if (!holderIds.length) {
|
|
36
|
+
if (dataSource.isFormSubject) return wrapContent(unassigned);
|
|
19
37
|
return null;
|
|
20
38
|
}
|
|
21
39
|
const renderHolder = (id) => {
|
|
22
40
|
if (!id) return null;
|
|
23
|
-
const holder = (holders || []).find((item) => item.id === id);
|
|
41
|
+
const holder = (holders || []).find((item) => String(item.id) === String(id));
|
|
24
42
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
25
43
|
className: "holder-item",
|
|
26
44
|
key: id
|
|
@@ -29,9 +47,8 @@ const Holders = (props) => {
|
|
|
29
47
|
type: holderIconMap[(dataSource === null || dataSource === void 0 ? void 0 : dataSource.holderType) || "minors"]
|
|
30
48
|
}), /* @__PURE__ */ react.default.createElement("span", { className: "holder-label" }, (holder === null || holder === void 0 ? void 0 : holder.label) || id));
|
|
31
49
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}) : renderHolder(holder_id));
|
|
50
|
+
const useSnapshot = holderName && holderIds.some((id) => !(holders || []).some((item) => String(item.id) === String(id) && item.label));
|
|
51
|
+
return wrapContent(/* @__PURE__ */ react.default.createElement("div", { className: `${require_index$1.PREFIX}__holders` }, useSnapshot ? /* @__PURE__ */ react.default.createElement("div", { className: "holder-item" }, /* @__PURE__ */ react.default.createElement("span", { className: "holder-label" }, holderName)) : holderIds.map(renderHolder), showUnassignedHolder && missingCount > 0 ? unassigned : null));
|
|
35
52
|
};
|
|
36
53
|
//#endregion
|
|
37
54
|
exports.default = Holders;
|
|
@@ -6,21 +6,22 @@ const require_useEngineContext = require("../../../hooks/useEngineContext.js");
|
|
|
6
6
|
const require_index$1 = require("../components/Action/index.js");
|
|
7
7
|
const require_status = require("../status.js");
|
|
8
8
|
const require_locales = require("./locales.js");
|
|
9
|
-
const require_index$2 = require("./components/
|
|
10
|
-
const require_index$3 = require("./components/
|
|
11
|
-
const require_index$4 = require("./components/
|
|
12
|
-
const require_index$5 = require("./components/
|
|
13
|
-
const require_index$6 = require("./components/
|
|
14
|
-
const require_index$7 = require("./components/
|
|
15
|
-
const require_index$8 = require("./components/
|
|
16
|
-
const require_index$9 = require("./components/
|
|
17
|
-
const require_index$10 = require("./components/
|
|
18
|
-
const require_index$11 = require("./components/
|
|
19
|
-
const require_index$12 = require("./components/
|
|
20
|
-
const require_index$13 = require("./components/
|
|
21
|
-
const require_index$14 = require("./components/
|
|
22
|
-
const require_index$15 = require("./components/
|
|
23
|
-
const require_index$16 = require("./
|
|
9
|
+
const require_index$2 = require("./components/holders/index.js");
|
|
10
|
+
const require_index$3 = require("./components/basicInfo/index.js");
|
|
11
|
+
const require_index$4 = require("./components/discountReason/index.js");
|
|
12
|
+
const require_index$5 = require("./components/timeRange/index.js");
|
|
13
|
+
const require_index$6 = require("./components/resources/index.js");
|
|
14
|
+
const require_index$7 = require("./components/packages/index.js");
|
|
15
|
+
const require_index$8 = require("./components/sales/index.js");
|
|
16
|
+
const require_index$9 = require("./components/swipeAction/index.js");
|
|
17
|
+
const require_index$10 = require("./components/Note/index.js");
|
|
18
|
+
const require_index$11 = require("./components/AmountFooter/index.js");
|
|
19
|
+
const require_index$12 = require("./components/MultiDay/index.js");
|
|
20
|
+
const require_index$13 = require("./components/Promotion/index.js");
|
|
21
|
+
const require_index$14 = require("./components/Gift/index.js");
|
|
22
|
+
const require_index$15 = require("./components/BookingItem/index.js");
|
|
23
|
+
const require_index$16 = require("./components/inlineActions/index.js");
|
|
24
|
+
const require_index$17 = require("./variants/A12/index.js");
|
|
24
25
|
let react = require("react");
|
|
25
26
|
react = require_runtime.__toESM(react);
|
|
26
27
|
let _pisell_utils = require("@pisell/utils");
|
|
@@ -126,23 +127,27 @@ const CartSkuCard = (props) => {
|
|
|
126
127
|
*/
|
|
127
128
|
const renderPromotion = (0, react.useMemo)(() => {
|
|
128
129
|
var _dataSource$promotion;
|
|
129
|
-
return (dataSource === null || dataSource === void 0 || (_dataSource$promotion = dataSource.promotions) === null || _dataSource$promotion === void 0 ? void 0 : _dataSource$promotion.length) ? /* @__PURE__ */ react.default.createElement(require_index$
|
|
130
|
+
return (dataSource === null || dataSource === void 0 || (_dataSource$promotion = dataSource.promotions) === null || _dataSource$promotion === void 0 ? void 0 : _dataSource$promotion.length) ? /* @__PURE__ */ react.default.createElement(require_index$13.default, {
|
|
130
131
|
promotions: dataSource === null || dataSource === void 0 ? void 0 : dataSource.promotions,
|
|
131
132
|
onClick: (item) => onPromotion === null || onPromotion === void 0 ? void 0 : onPromotion(item)
|
|
132
133
|
}) : null;
|
|
133
134
|
}, [dataSource === null || dataSource === void 0 ? void 0 : dataSource.promotions, dataSource === null || dataSource === void 0 ? void 0 : dataSource.num]);
|
|
134
135
|
const renderMainProduct = (basicInfo) => {
|
|
135
136
|
if (rightActionsDisplay !== "inline") return basicInfo;
|
|
136
|
-
return /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__main-row` }, /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__main-content` }, basicInfo), /* @__PURE__ */ react.default.createElement(require_index$
|
|
137
|
+
return /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__main-row` }, /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__main-content` }, basicInfo), /* @__PURE__ */ react.default.createElement(require_index$16.default, { actions: _rightActions }));
|
|
137
138
|
};
|
|
139
|
+
const productHolders = props.isShowHolder === true && dataSource.showUnassignedHolder !== void 0 ? /* @__PURE__ */ react.default.createElement(require_index$2.default, {
|
|
140
|
+
dataSource,
|
|
141
|
+
onChangeHolder: onChangeHolder ? () => onChangeHolder(dataSource) : void 0
|
|
142
|
+
}) : null;
|
|
138
143
|
const renderA2 = () => {
|
|
139
|
-
return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, renderMainProduct(/* @__PURE__ */ react.default.createElement(require_index$
|
|
144
|
+
return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, renderMainProduct(/* @__PURE__ */ react.default.createElement(require_index$3.default, {
|
|
140
145
|
isShowImage,
|
|
141
146
|
isShowQuantityBadge,
|
|
142
147
|
dataSource,
|
|
143
148
|
isMainProduct: true,
|
|
144
149
|
maxSpecsCount
|
|
145
|
-
})), /* @__PURE__ */ react.default.createElement(require_index$
|
|
150
|
+
})), /* @__PURE__ */ react.default.createElement(require_index$4.default, { dataSource }), renderPromotion, productHolders, isShowNote ? /* @__PURE__ */ react.default.createElement(require_index$10.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, other), {}, {
|
|
146
151
|
item: dataSource,
|
|
147
152
|
disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
|
|
148
153
|
openNote: openNoteEditor
|
|
@@ -157,7 +162,7 @@ const CartSkuCard = (props) => {
|
|
|
157
162
|
e.stopPropagation();
|
|
158
163
|
onDelete === null || onDelete === void 0 || onDelete(dataSource);
|
|
159
164
|
}
|
|
160
|
-
}, /* @__PURE__ */ react.default.createElement(require_index.default, { type: "pisell2-trash-01" })) : null, renderMainProduct(/* @__PURE__ */ react.default.createElement(require_index$
|
|
165
|
+
}, /* @__PURE__ */ react.default.createElement(require_index.default, { type: "pisell2-trash-01" })) : null, renderMainProduct(/* @__PURE__ */ react.default.createElement(require_index$3.default, {
|
|
161
166
|
isShowImage,
|
|
162
167
|
isShowQuantityBadge,
|
|
163
168
|
dataSource,
|
|
@@ -166,24 +171,25 @@ const CartSkuCard = (props) => {
|
|
|
166
171
|
isShowOriginalPrice,
|
|
167
172
|
isShowEditProduct,
|
|
168
173
|
disabledEditClick,
|
|
169
|
-
onEditProduct
|
|
170
|
-
|
|
174
|
+
onEditProduct,
|
|
175
|
+
onChangeHolder: productHolders ? onChangeHolder : void 0
|
|
176
|
+
})), itemType !== "booking" ? /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement(require_index$5.default, { dataSource }), /* @__PURE__ */ react.default.createElement(require_index$6.default, { dataSource })) : null, /* @__PURE__ */ react.default.createElement(require_index$7.default, {
|
|
171
177
|
dataSource,
|
|
172
178
|
isShowImage,
|
|
173
179
|
isShowQuantityBadge
|
|
174
|
-
}), /* @__PURE__ */ react.default.createElement(require_index$
|
|
180
|
+
}), /* @__PURE__ */ react.default.createElement(require_index$8.default, {
|
|
175
181
|
dataSource,
|
|
176
182
|
hideDivider: !!(dataSource === null || dataSource === void 0 || (_dataSource$bundle = dataSource.bundle) === null || _dataSource$bundle === void 0 ? void 0 : _dataSource$bundle.length),
|
|
177
183
|
isShowImage,
|
|
178
184
|
isShowQuantityBadge
|
|
179
|
-
}), ((_dataSource$items = dataSource.items) === null || _dataSource$items === void 0 ? void 0 : _dataSource$items.length) ? /* @__PURE__ */ react.default.createElement(require_index$
|
|
185
|
+
}), ((_dataSource$items = dataSource.items) === null || _dataSource$items === void 0 ? void 0 : _dataSource$items.length) ? /* @__PURE__ */ react.default.createElement(require_index$12.default, {
|
|
180
186
|
dataSource,
|
|
181
187
|
hideDivider
|
|
182
|
-
}) : isShowAmountFooter ? /* @__PURE__ */ react.default.createElement(require_index$
|
|
188
|
+
}) : isShowAmountFooter ? /* @__PURE__ */ react.default.createElement(require_index$11.default, {
|
|
183
189
|
item: dataSource,
|
|
184
190
|
hideDivider,
|
|
185
191
|
type: "total"
|
|
186
|
-
}) : null, renderPromotion, isShowNote ? /* @__PURE__ */ react.default.createElement(require_index$
|
|
192
|
+
}) : null, renderPromotion, isShowNote ? /* @__PURE__ */ react.default.createElement(require_index$10.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, other), {}, {
|
|
187
193
|
item: dataSource,
|
|
188
194
|
disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
|
|
189
195
|
openNote: openNoteEditor
|
|
@@ -200,7 +206,7 @@ const CartSkuCard = (props) => {
|
|
|
200
206
|
e.stopPropagation();
|
|
201
207
|
onDelete === null || onDelete === void 0 || onDelete(dataSource);
|
|
202
208
|
}
|
|
203
|
-
}, /* @__PURE__ */ react.default.createElement(require_index.default, { type: "pisell2-trash-01" })) : null, renderMainProduct(/* @__PURE__ */ react.default.createElement(require_index$
|
|
209
|
+
}, /* @__PURE__ */ react.default.createElement(require_index.default, { type: "pisell2-trash-01" })) : null, renderMainProduct(/* @__PURE__ */ react.default.createElement(require_index$3.default, {
|
|
204
210
|
isShowImage,
|
|
205
211
|
isShowQuantityBadge,
|
|
206
212
|
dataSource,
|
|
@@ -210,16 +216,16 @@ const CartSkuCard = (props) => {
|
|
|
210
216
|
isShowEditProduct,
|
|
211
217
|
disabledEditClick,
|
|
212
218
|
onEditProduct
|
|
213
|
-
})), /* @__PURE__ */ react.default.createElement(require_index$
|
|
219
|
+
})), /* @__PURE__ */ react.default.createElement(require_index$7.default, {
|
|
214
220
|
dataSource,
|
|
215
221
|
isShowImage,
|
|
216
222
|
isShowQuantityBadge,
|
|
217
223
|
type
|
|
218
|
-
}), isShowAmountFooter ? /* @__PURE__ */ react.default.createElement(require_index$
|
|
224
|
+
}), isShowAmountFooter ? /* @__PURE__ */ react.default.createElement(require_index$11.default, {
|
|
219
225
|
item: dataSource,
|
|
220
226
|
hideDivider,
|
|
221
227
|
type: "total"
|
|
222
|
-
}) : null, /* @__PURE__ */ react.default.createElement(require_index$
|
|
228
|
+
}) : null, /* @__PURE__ */ react.default.createElement(require_index$4.default, { dataSource }), renderPromotion, productHolders, isShowNote ? /* @__PURE__ */ react.default.createElement(require_index$10.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, other), {}, {
|
|
223
229
|
item: dataSource,
|
|
224
230
|
disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
|
|
225
231
|
openNote: openNoteEditor
|
|
@@ -227,13 +233,14 @@ const CartSkuCard = (props) => {
|
|
|
227
233
|
};
|
|
228
234
|
const renderA12 = () => {
|
|
229
235
|
var _a12Slots$contentFoot;
|
|
230
|
-
const note = isShowNote ? /* @__PURE__ */ react.default.createElement(require_index$
|
|
236
|
+
const note = isShowNote ? /* @__PURE__ */ react.default.createElement(require_index$10.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, other), {}, {
|
|
231
237
|
item: dataSource,
|
|
232
238
|
disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
|
|
233
239
|
openNote: openNoteEditor
|
|
234
240
|
})) : null;
|
|
235
|
-
const
|
|
236
|
-
|
|
241
|
+
const contentFooter = note || productHolders ? () => /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, productHolders, note) : void 0;
|
|
242
|
+
const slots = contentFooter ? require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, a12Slots), {}, { contentFooter: (_a12Slots$contentFoot = a12Slots === null || a12Slots === void 0 ? void 0 : a12Slots.contentFooter) !== null && _a12Slots$contentFoot !== void 0 ? _a12Slots$contentFoot : contentFooter }) : a12Slots;
|
|
243
|
+
return /* @__PURE__ */ react.default.createElement(require_index$17.default, {
|
|
237
244
|
dataSource,
|
|
238
245
|
isShowImage,
|
|
239
246
|
isShowDelete,
|
|
@@ -264,7 +271,7 @@ const CartSkuCard = (props) => {
|
|
|
264
271
|
e.stopPropagation();
|
|
265
272
|
onCard === null || onCard === void 0 || onCard(dataSource);
|
|
266
273
|
}
|
|
267
|
-
}, itemType === "booking" ? /* @__PURE__ */ react.default.createElement(require_index$
|
|
274
|
+
}, itemType === "booking" ? /* @__PURE__ */ react.default.createElement(require_index$15.default, {
|
|
268
275
|
dataSource,
|
|
269
276
|
isShowRelatedProduct,
|
|
270
277
|
isShowDelete
|
|
@@ -272,12 +279,12 @@ const CartSkuCard = (props) => {
|
|
|
272
279
|
return /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${PREFIX}-wrapper-container`, {
|
|
273
280
|
[`${PREFIX}-wrapper-container--inline`]: useIntegratedWrapper,
|
|
274
281
|
[`${PREFIX}-wrapper-container--a12`]: type === "a12"
|
|
275
|
-
}) }, useIntegratedWrapper ? /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${PREFIX}-wrapper`, `${PREFIX}-wrapper--inline`, type === "a12" && `pisell-cart-sku-card-wrapper--a12`) }, cardContent) : /* @__PURE__ */ react.default.createElement(require_index$
|
|
282
|
+
}) }, useIntegratedWrapper ? /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)(`${PREFIX}-wrapper`, `${PREFIX}-wrapper--inline`, type === "a12" && `pisell-cart-sku-card-wrapper--a12`) }, cardContent) : /* @__PURE__ */ react.default.createElement(require_index$9.SwipeAction, {
|
|
276
283
|
closeOnAction: false,
|
|
277
284
|
className: (0, classnames.default)(`${PREFIX}-wrapper`),
|
|
278
285
|
rightActions: _rightActions,
|
|
279
286
|
escapeDom
|
|
280
|
-
}, cardContent), /* @__PURE__ */ react.default.createElement(require_index$
|
|
287
|
+
}, cardContent), /* @__PURE__ */ react.default.createElement(require_index$14.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, (dataSource === null || dataSource === void 0 ? void 0 : dataSource.giftData) || {}), {}, { onClick: () => onGift === null || onGift === void 0 ? void 0 : onGift(dataSource) })));
|
|
281
288
|
};
|
|
282
289
|
//#endregion
|
|
283
290
|
exports.PREFIX = PREFIX;
|
|
@@ -181,6 +181,13 @@ const convertProductToLineItemProduct = (product, translationOriginal, symbol, a
|
|
|
181
181
|
symbol,
|
|
182
182
|
amountFormatter,
|
|
183
183
|
note: product.note,
|
|
184
|
+
holder_id: product.holder_id,
|
|
185
|
+
holders: product.holders,
|
|
186
|
+
holderName: product.holderName,
|
|
187
|
+
holderType: product.holderType,
|
|
188
|
+
holderMaxCount: product.holderMaxCount,
|
|
189
|
+
isFormSubject: product.isFormSubject,
|
|
190
|
+
showUnassignedHolder: product.showUnassignedHolder,
|
|
184
191
|
product_sku: product.product_sku,
|
|
185
192
|
product_bundle: bundle,
|
|
186
193
|
bundle,
|
|
@@ -3,6 +3,7 @@ const require_useEngineContext = require("../../../hooks/useEngineContext.js");
|
|
|
3
3
|
const require_index = require("../../button/index.js");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
react = require_runtime.__toESM(react);
|
|
6
|
+
let _pisell_utils = require("@pisell/utils");
|
|
6
7
|
require("./index.less");
|
|
7
8
|
//#region src/components/walletCard/Guest/index.tsx
|
|
8
9
|
const Guest = (props) => {
|
|
@@ -46,7 +47,7 @@ const Guest = (props) => {
|
|
|
46
47
|
style: { backgroundColor: setting === null || setting === void 0 ? void 0 : setting.backgroundColor }
|
|
47
48
|
}, (utils === null || utils === void 0 || (_utils$translation = utils.translation) === null || _utils$translation === void 0 ? void 0 : _utils$translation.call(utils, setting === null || setting === void 0 ? void 0 : setting.backgroundImage)) ? /* @__PURE__ */ react.default.createElement("img", {
|
|
48
49
|
className: "pisell-wallet-guest-bg",
|
|
49
|
-
src: (utils === null || utils === void 0 || (_utils$translation2 = utils.translation) === null || _utils$translation2 === void 0 ? void 0 : _utils$translation2.call(utils, setting.backgroundImage)) || "",
|
|
50
|
+
src: _pisell_utils.image.ali((utils === null || utils === void 0 || (_utils$translation2 = utils.translation) === null || _utils$translation2 === void 0 ? void 0 : _utils$translation2.call(utils, setting.backgroundImage)) || "", 175),
|
|
50
51
|
alt: (utils === null || utils === void 0 || (_utils$translation3 = utils.translation) === null || _utils$translation3 === void 0 ? void 0 : _utils$translation3.call(utils, setting === null || setting === void 0 ? void 0 : setting.backgroundImageAlt)) || "",
|
|
51
52
|
title: (utils === null || utils === void 0 || (_utils$translation4 = utils.translation) === null || _utils$translation4 === void 0 ? void 0 : _utils$translation4.call(utils, setting === null || setting === void 0 ? void 0 : setting.backgroundImageAlt)) || ""
|
|
52
53
|
}) : null, /* @__PURE__ */ react.default.createElement("div", { className: `pisell-wallet-guest-content ${setting.align === "center" ? "pisell-wallet-guest-center" : ""}` }, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("div", {
|
|
@@ -9,6 +9,7 @@ const require_index$4 = require("./Guest/index.js");
|
|
|
9
9
|
const require_index$5 = require("./Guide/index.js");
|
|
10
10
|
let react = require("react");
|
|
11
11
|
react = require_runtime.__toESM(react);
|
|
12
|
+
let _pisell_utils = require("@pisell/utils");
|
|
12
13
|
let antd = require("antd");
|
|
13
14
|
let classnames = require("classnames");
|
|
14
15
|
classnames = require_runtime.__toESM(classnames);
|
|
@@ -138,7 +139,7 @@ const CardHeader = ({ showIcon = true, showWalletName = true, showShopName = tru
|
|
|
138
139
|
const processedShowCode = toBooleanValue(showCode);
|
|
139
140
|
const processedShowViewPin = toBooleanValue(showViewPin);
|
|
140
141
|
return /* @__PURE__ */ react.default.createElement("div", { className: "pisell-wallet-card-header" }, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-wallet-card-header-left" }, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-wallet-card-header-level" }, processedShowIcon && iconImg ? /* @__PURE__ */ react.default.createElement("div", { className: "pisell-wallet-card-header-icon" }, /* @__PURE__ */ react.default.createElement("img", {
|
|
141
|
-
src: iconImg,
|
|
142
|
+
src: _pisell_utils.image.ali(iconImg, 40),
|
|
142
143
|
alt: "wallet icon",
|
|
143
144
|
style: {
|
|
144
145
|
width: "20px",
|
|
@@ -249,11 +250,17 @@ const WalletCard = (props) => {
|
|
|
249
250
|
const { isModalOpen, handleCodeClick, closeModal } = useCodeModal(cardNo, onCodeClick, codeType);
|
|
250
251
|
console.log("showViewPin", props);
|
|
251
252
|
const backgroundStyle = (0, react.useMemo)(() => {
|
|
252
|
-
if (props.customBackgroundImage) return { backgroundImage: `url(${props.customBackgroundImage})` };
|
|
253
|
+
if (props.customBackgroundImage) return { backgroundImage: `url(${_pisell_utils.image.ali(props.customBackgroundImage, 175)})` };
|
|
253
254
|
else {
|
|
254
|
-
var _props$walletGuideCon;
|
|
255
|
+
var _props$walletGuideCon, _constants;
|
|
255
256
|
if ((props === null || props === void 0 || (_props$walletGuideCon = props.walletGuideConfig) === null || _props$walletGuideCon === void 0 ? void 0 : _props$walletGuideCon.backgroundColor) && isGuide || (props === null || props === void 0 ? void 0 : props.backgroundColor) && !isLogin) return { backgroundImage: "none" };
|
|
256
|
-
|
|
257
|
+
let staticUrl = (_constants = constants) === null || _constants === void 0 ? void 0 : _constants.staticURL;
|
|
258
|
+
if (!staticUrl) {
|
|
259
|
+
var _constants2;
|
|
260
|
+
staticUrl = ((_constants2 = constants) === null || _constants2 === void 0 || (_constants2 = _constants2.config) === null || _constants2 === void 0 ? void 0 : _constants2.awsStatic) || "https://static.pisellcdn.com";
|
|
261
|
+
}
|
|
262
|
+
const backgroundImage = `${staticUrl}/${mode === "dark" ? "dark_wallet.png" : "light_wallet.png"}`;
|
|
263
|
+
return { backgroundImage: `url(${_pisell_utils.image.ali(backgroundImage, 175)})` };
|
|
257
264
|
}
|
|
258
265
|
}, [
|
|
259
266
|
props.customBackgroundImage,
|