@pisell/materials 6.12.35 → 6.12.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +3 -3
  6. package/build/lowcode/render/default/view.css +1 -1
  7. package/build/lowcode/render/default/view.js +1 -1
  8. package/build/lowcode/view.css +1 -1
  9. package/build/lowcode/view.js +1 -1
  10. package/es/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
  11. package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  12. package/es/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -1
  13. package/es/components/productCard/cartSkuCard/index.js +17 -10
  14. package/es/components/productCard/lineItem/BookingLineItem.js +10 -7
  15. package/es/components/productCard/lineItem/index.js +4 -1
  16. package/es/components/productCard/lineItem/index.less +13 -0
  17. package/es/components/productCard/types.d.ts +2 -0
  18. package/lib/components/dataSourceComponents/fields/RecordListWrapper/index.d.ts +1 -1
  19. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  20. package/lib/components/dataSourceComponents/fields/Tabs/index.d.ts +1 -1
  21. package/lib/components/productCard/cartSkuCard/index.js +17 -10
  22. package/lib/components/productCard/lineItem/BookingLineItem.js +10 -7
  23. package/lib/components/productCard/lineItem/index.js +4 -1
  24. package/lib/components/productCard/lineItem/index.less +13 -0
  25. package/lib/components/productCard/types.d.ts +2 -0
  26. 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?: "custom" | "api" | "default" | undefined;
8
+ optionSourceType?: "default" | "custom" | "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?: "custom" | "api" | "default" | undefined;
9
+ optionSourceType?: "default" | "custom" | "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?: "custom" | "api" | "default" | undefined;
10
+ optionSourceType?: "default" | "custom" | "api" | undefined;
11
11
  labelField: string;
12
12
  valueField: string;
13
13
  extraParams?: Record<string, any> | undefined;
@@ -38,6 +38,8 @@ const _excluded = [
38
38
  "isShowEditProduct",
39
39
  "disabledClick",
40
40
  "disabledEditClick",
41
+ "disabledNoteEdit",
42
+ "externalNoteEditor",
41
43
  "onEditProduct",
42
44
  "onAction",
43
45
  "onDelete",
@@ -59,7 +61,7 @@ const _excluded = [
59
61
  const PREFIX = "pisell-cart-sku-card";
60
62
  const CartSkuCard = (props) => {
61
63
  var _context$appHelper$ut;
62
- const { dataSource = defaultValue.dataSource, isShowImage = defaultValue.isShowImage, isShowQuantityBadge = true, isShowOriginalPrice = defaultValue.isShowOriginalPrice, isShowHolder = defaultValue.isShowHolder, isShowNote = defaultValue.isShowNote, isShowDelete = defaultValue.isShowDelete, isShowInlineDelete = isShowDelete, isShowAmountFooter = defaultValue.isShowAmountFooter, isShowPackageNote = defaultValue.isShowPackageNote, isShowEditProduct = defaultValue.isShowEditProduct, disabledClick = defaultValue.disabledClick, disabledEditClick = defaultValue.disabledEditClick, onEditProduct, onAction, onDelete, onNote, onLike, onCard, onChangeResource, onPromotion, onGift, onChangeHolder, itemType = "product", type, rightActions = [], rightActionsDisplay = "swipe", escapeDom, maxSpecsCount = 1, isShowRelatedProduct = true } = props, other = _objectWithoutProperties(props, _excluded);
64
+ const { dataSource = defaultValue.dataSource, isShowImage = defaultValue.isShowImage, isShowQuantityBadge = true, isShowOriginalPrice = defaultValue.isShowOriginalPrice, isShowHolder = defaultValue.isShowHolder, isShowNote = defaultValue.isShowNote, isShowDelete = defaultValue.isShowDelete, isShowInlineDelete = isShowDelete, isShowAmountFooter = defaultValue.isShowAmountFooter, isShowPackageNote = defaultValue.isShowPackageNote, isShowEditProduct = defaultValue.isShowEditProduct, disabledClick = defaultValue.disabledClick, disabledEditClick = defaultValue.disabledEditClick, disabledNoteEdit, externalNoteEditor = false, onEditProduct, onAction, onDelete, onNote, onLike, onCard, onChangeResource, onPromotion, onGift, onChangeHolder, itemType = "product", type, rightActions = [], rightActionsDisplay = "swipe", escapeDom, maxSpecsCount = 1, isShowRelatedProduct = true } = props, other = _objectWithoutProperties(props, _excluded);
63
65
  const useOpenNoteRef = useRef();
64
66
  const context = useEngineContext();
65
67
  locales.init(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");
@@ -103,6 +105,14 @@ const CartSkuCard = (props) => {
103
105
  const hideDivider = useMemo(() => {
104
106
  return false;
105
107
  }, [dataSource]);
108
+ const openNoteEditor = () => {
109
+ var _useOpenNoteRef$curre;
110
+ if (externalNoteEditor) {
111
+ onNote === null || onNote === void 0 || onNote(dataSource);
112
+ return;
113
+ }
114
+ (_useOpenNoteRef$curre = useOpenNoteRef.current) === null || _useOpenNoteRef$curre === void 0 || _useOpenNoteRef$curre.open({ item: dataSource });
115
+ };
106
116
  /**
107
117
  * @description: 营销活动
108
118
  * @param {*} useMemo
@@ -128,9 +138,8 @@ const CartSkuCard = (props) => {
128
138
  maxSpecsCount
129
139
  })), /* @__PURE__ */ React.createElement(DiscountReason, { dataSource }), renderPromotion, isShowNote ? /* @__PURE__ */ React.createElement(Note, _objectSpread2(_objectSpread2({}, other), {}, {
130
140
  item: dataSource,
131
- openNote: () => {
132
- useOpenNoteRef.current.open({ item: dataSource });
133
- }
141
+ disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
142
+ openNote: openNoteEditor
134
143
  })) : null);
135
144
  };
136
145
  const renderA5 = () => {
@@ -170,9 +179,8 @@ const CartSkuCard = (props) => {
170
179
  type: "total"
171
180
  }) : null, renderPromotion, isShowNote ? /* @__PURE__ */ React.createElement(Note, _objectSpread2(_objectSpread2({}, other), {}, {
172
181
  item: dataSource,
173
- openNote: () => {
174
- useOpenNoteRef.current.open({ item: dataSource });
175
- }
182
+ disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
183
+ openNote: openNoteEditor
176
184
  })) : null, isShowAction && actionText ? /* @__PURE__ */ React.createElement(Action, {
177
185
  item: dataSource,
178
186
  onAction: () => onAction === null || onAction === void 0 ? void 0 : onAction(dataSource)
@@ -207,9 +215,8 @@ const CartSkuCard = (props) => {
207
215
  type: "total"
208
216
  }) : null, /* @__PURE__ */ React.createElement(DiscountReason, { dataSource }), renderPromotion, isShowNote ? /* @__PURE__ */ React.createElement(Note, _objectSpread2(_objectSpread2({}, other), {}, {
209
217
  item: dataSource,
210
- openNote: () => {
211
- useOpenNoteRef.current.open({ item: dataSource });
212
- }
218
+ disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
219
+ openNote: openNoteEditor
213
220
  })) : null);
214
221
  };
215
222
  const renderContent = () => {
@@ -38,6 +38,7 @@ const _excluded = [
38
38
  "isShowAmountFooter",
39
39
  "disabledClick",
40
40
  "disabledEdit",
41
+ "disabledNoteEdit",
41
42
  "statusOptions",
42
43
  "statusLoading",
43
44
  "statusDisabled",
@@ -64,7 +65,7 @@ const getStatusOption = (status, statusOptions = []) => {
64
65
  };
65
66
  const BookingLineItem = (props) => {
66
67
  var _ref, _ref2, _dataSource$promotion, _dataSource$giftData;
67
- 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 = _objectWithoutProperties(props, _excluded);
68
+ const { dataSource, type, cartSkuType, isShowBookingHeader, relatedProductDataSource, addTimeProductDataSources = [], rightActions = [], rightActionsDisplay = "swipe", escapeDom, isShowImage, isShowQuantityBadge = true, isFormSubject, isShowDelete, isShowInlineDelete = isShowDelete, isShowNote, isShowAmountFooter, disabledClick, disabledEdit, disabledNoteEdit = disabledEdit, statusOptions = [], statusLoading = false, statusDisabled = false, isShowRelatedProduct = true, holderOptions, onBookingStatusChange, onAddTimeProductCard, onAction, onDelete, onNote, onCard, onPromotion, onGift } = props, other = _objectWithoutProperties(props, _excluded);
68
69
  const shouldRenderRelatedProduct = isShowRelatedProduct && Boolean(relatedProductDataSource);
69
70
  const [isAddTimeProductsExpanded, setIsAddTimeProductsExpanded] = useState(false);
70
71
  const { isShowAction, actionText } = dataSource;
@@ -85,7 +86,8 @@ const BookingLineItem = (props) => {
85
86
  onDelete === null || onDelete === void 0 || onDelete(dataSource);
86
87
  }
87
88
  };
88
- const bookingRightActions = isShowDelete ? rightActionsDisplay === "inline" ? [...rightActions, deleteAction] : [deleteAction, ...rightActions] : rightActions;
89
+ const showDeleteInRelatedProduct = isShowDelete && rightActionsDisplay === "inline" && shouldRenderRelatedProduct && !(relatedProductDataSource === null || relatedProductDataSource === void 0 ? void 0 : relatedProductDataSource.isGift);
90
+ const bookingRightActions = isShowDelete && !showDeleteInRelatedProduct ? rightActionsDisplay === "inline" ? [...rightActions, deleteAction] : [deleteAction, ...rightActions] : rightActions;
89
91
  const resolvedHolderOptions = (_ref = (_ref2 = holderOptions !== null && holderOptions !== void 0 ? holderOptions : dataSource === null || dataSource === void 0 ? void 0 : dataSource.holderOptions) !== null && _ref2 !== void 0 ? _ref2 : dataSource === null || dataSource === void 0 ? void 0 : dataSource.holders) !== null && _ref !== void 0 ? _ref : [];
90
92
  const resolvedIsFormSubject = isFormSubject !== null && isFormSubject !== void 0 ? isFormSubject : dataSource === null || dataSource === void 0 ? void 0 : dataSource.isFormSubject;
91
93
  const bookingTitle = String((dataSource === null || dataSource === void 0 ? void 0 : dataSource.booking_id) || "");
@@ -116,18 +118,18 @@ const BookingLineItem = (props) => {
116
118
  const renderProductCard = (productDataSource, source, options = {}) => {
117
119
  var _productDataSource$pr;
118
120
  if (!productDataSource || (productDataSource === null || productDataSource === void 0 ? void 0 : productDataSource.isGift)) return null;
119
- const { showProductPromotion = true, showAmountFooter = true } = options;
121
+ const { showProductPromotion = true, showAmountFooter = true, inlineActions = [] } = options;
120
122
  const productPromotion = (productDataSource === null || productDataSource === void 0 || (_productDataSource$pr = productDataSource.promotions) === null || _productDataSource$pr === void 0 ? void 0 : _productDataSource$pr.length) ? /* @__PURE__ */ React.createElement(Promotion, {
121
123
  promotions: productDataSource.promotions,
122
124
  onClick: (item) => onPromotion === null || onPromotion === void 0 ? void 0 : onPromotion(item)
123
125
  }) : null;
124
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(BasicInfo, {
126
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__product-main-row` }, /* @__PURE__ */ React.createElement(BasicInfo, {
125
127
  isShowImage,
126
128
  isShowQuantityBadge,
127
129
  dataSource: productDataSource,
128
130
  type: cartSkuType,
129
131
  maxSpecsCount: props.maxSpecsCount || 1
130
- }), /* @__PURE__ */ React.createElement(Packages, {
132
+ }), inlineActions.length > 0 ? /* @__PURE__ */ React.createElement(InlineActions, { actions: inlineActions }) : null), /* @__PURE__ */ React.createElement(Packages, {
131
133
  dataSource: productDataSource,
132
134
  isShowImage,
133
135
  isShowQuantityBadge,
@@ -138,7 +140,7 @@ const BookingLineItem = (props) => {
138
140
  type: "total"
139
141
  }) : null, showProductPromotion ? productPromotion : null, isShowNote ? /* @__PURE__ */ React.createElement(Note, _objectSpread2(_objectSpread2({}, other), {}, {
140
142
  item: productDataSource,
141
- disabledEdit,
143
+ disabledEdit: disabledNoteEdit,
142
144
  openNote: () => onNote === null || onNote === void 0 ? void 0 : onNote(source)
143
145
  })) : null);
144
146
  };
@@ -196,7 +198,8 @@ const BookingLineItem = (props) => {
196
198
  isFormSubject: resolvedIsFormSubject
197
199
  }) : null), !isShowBookingHeader ? renderDeleteButton(true) : null), shouldRenderRelatedProduct ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Divider, { style: { margin: 0 } }), /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__related-product` }, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__related-product-card` }, renderProductCard(relatedProductDataSource, dataSource, {
198
200
  showProductPromotion: false,
199
- showAmountFooter: !shouldRenderFullWidthAmountFooter
201
+ showAmountFooter: !shouldRenderFullWidthAmountFooter,
202
+ inlineActions: showDeleteInRelatedProduct ? [deleteAction] : []
200
203
  }), renderPromotion, isShowAction && actionText ? /* @__PURE__ */ React.createElement(Action, {
201
204
  item: dataSource,
202
205
  onAction: () => onAction === null || onAction === void 0 ? void 0 : onAction(dataSource)
@@ -26,6 +26,7 @@ const _excluded = [
26
26
  "isShowAmountFooter",
27
27
  "disabledClick",
28
28
  "disabledEdit",
29
+ "disabledNoteEdit",
29
30
  "statusOptions",
30
31
  "statusLoading",
31
32
  "statusDisabled",
@@ -178,7 +179,7 @@ const convertProductToLineItemProduct = (product, translationOriginal, symbol) =
178
179
  };
179
180
  const LineItem = (props) => {
180
181
  var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _dataSource$_extend2, _dataSource$_extend4;
181
- const { dataSource = defaultValue.dataSource, itemType, type = "a9", isShowBookingHeader, rightActions = [], rightActionsDisplay = "swipe", escapeDom, isShowImage = defaultValue.isShowImage, isShowDelete = defaultValue.isShowDelete, isShowInlineDelete = isShowDelete, isShowNote = defaultValue.isShowNote, isShowAmountFooter = defaultValue.isShowAmountFooter, disabledClick = defaultValue.disabledClick, disabledEdit = defaultValue.disabledEdit, statusOptions = [], statusLoading = false, statusDisabled = false, isShowRelatedProduct = true, holderOptions, onBookingStatusChange, onAddTimeProductCard, onAction, onDelete, onNote, onCard, onPromotion, onGift } = props, other = _objectWithoutProperties(props, _excluded);
182
+ const { dataSource = defaultValue.dataSource, itemType, type = "a9", isShowBookingHeader, rightActions = [], rightActionsDisplay = "swipe", escapeDom, isShowImage = defaultValue.isShowImage, isShowDelete = defaultValue.isShowDelete, isShowInlineDelete = isShowDelete, isShowNote = defaultValue.isShowNote, isShowAmountFooter = defaultValue.isShowAmountFooter, disabledClick = defaultValue.disabledClick, disabledEdit = defaultValue.disabledEdit, disabledNoteEdit = disabledEdit, statusOptions = [], statusLoading = false, statusDisabled = false, isShowRelatedProduct = true, holderOptions, onBookingStatusChange, onAddTimeProductCard, onAction, onDelete, onNote, onCard, onPromotion, onGift } = props, other = _objectWithoutProperties(props, _excluded);
182
183
  const itemKind = itemType || (isBookingItem(dataSource) ? "booking" : "product");
183
184
  const context = useEngineContext();
184
185
  const translationOriginal = useTranslationOriginal();
@@ -222,6 +223,7 @@ const LineItem = (props) => {
222
223
  isShowAmountFooter,
223
224
  disabledClick,
224
225
  disabledEdit,
226
+ disabledNoteEdit,
225
227
  onAction,
226
228
  onDelete,
227
229
  onNote,
@@ -246,6 +248,7 @@ const LineItem = (props) => {
246
248
  isShowAmountFooter,
247
249
  disabledClick,
248
250
  disabledEdit,
251
+ disabledNoteEdit,
249
252
  statusOptions,
250
253
  statusLoading,
251
254
  statusDisabled,
@@ -284,6 +284,19 @@
284
284
  }
285
285
  }
286
286
 
287
+ // 复杂预约的删除入口属于关联主商品,不再占用整张预约卡的右侧操作列。
288
+ // 这里复用普通商品的 InlineActions,只改变它的布局归属。
289
+ &__product-main-row {
290
+ display: flex;
291
+ align-items: stretch;
292
+ min-width: 0;
293
+
294
+ > .pisell-cart-sku-card__basic-info {
295
+ min-width: 0;
296
+ flex: 1;
297
+ }
298
+ }
299
+
287
300
  &__add-time-product-card {
288
301
  padding: 4px;
289
302
  border: 1px solid var(--Gray-300, #d0d5dd);
@@ -79,6 +79,8 @@ type ProductCardTypes = {
79
79
  isShowEditProduct?: boolean;
80
80
  isShowAmountFooter?: boolean;
81
81
  disabledEdit?: boolean;
82
+ disabledNoteEdit?: boolean;
83
+ externalNoteEditor?: boolean;
82
84
  locale?: string;
83
85
  symbol?: string;
84
86
  isShowChangeHolder?: boolean;
@@ -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?: "custom" | "api" | "default" | undefined;
8
+ optionSourceType?: "default" | "custom" | "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?: "custom" | "api" | "default" | undefined;
9
+ optionSourceType?: "default" | "custom" | "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?: "custom" | "api" | "default" | undefined;
10
+ optionSourceType?: "default" | "custom" | "api" | undefined;
11
11
  labelField: string;
12
12
  valueField: string;
13
13
  extraParams?: Record<string, any> | undefined;
@@ -41,6 +41,8 @@ const _excluded = [
41
41
  "isShowEditProduct",
42
42
  "disabledClick",
43
43
  "disabledEditClick",
44
+ "disabledNoteEdit",
45
+ "externalNoteEditor",
44
46
  "onEditProduct",
45
47
  "onAction",
46
48
  "onDelete",
@@ -62,7 +64,7 @@ const _excluded = [
62
64
  const PREFIX = "pisell-cart-sku-card";
63
65
  const CartSkuCard = (props) => {
64
66
  var _context$appHelper$ut;
65
- const { dataSource = require_status.defaultValue.dataSource, isShowImage = require_status.defaultValue.isShowImage, isShowQuantityBadge = true, isShowOriginalPrice = require_status.defaultValue.isShowOriginalPrice, isShowHolder = require_status.defaultValue.isShowHolder, isShowNote = require_status.defaultValue.isShowNote, isShowDelete = require_status.defaultValue.isShowDelete, isShowInlineDelete = isShowDelete, isShowAmountFooter = require_status.defaultValue.isShowAmountFooter, isShowPackageNote = require_status.defaultValue.isShowPackageNote, isShowEditProduct = require_status.defaultValue.isShowEditProduct, disabledClick = require_status.defaultValue.disabledClick, disabledEditClick = require_status.defaultValue.disabledEditClick, onEditProduct, onAction, onDelete, onNote, onLike, onCard, onChangeResource, onPromotion, onGift, onChangeHolder, itemType = "product", type, rightActions = [], rightActionsDisplay = "swipe", escapeDom, maxSpecsCount = 1, isShowRelatedProduct = true } = props, other = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
67
+ const { dataSource = require_status.defaultValue.dataSource, isShowImage = require_status.defaultValue.isShowImage, isShowQuantityBadge = true, isShowOriginalPrice = require_status.defaultValue.isShowOriginalPrice, isShowHolder = require_status.defaultValue.isShowHolder, isShowNote = require_status.defaultValue.isShowNote, isShowDelete = require_status.defaultValue.isShowDelete, isShowInlineDelete = isShowDelete, isShowAmountFooter = require_status.defaultValue.isShowAmountFooter, isShowPackageNote = require_status.defaultValue.isShowPackageNote, isShowEditProduct = require_status.defaultValue.isShowEditProduct, disabledClick = require_status.defaultValue.disabledClick, disabledEditClick = require_status.defaultValue.disabledEditClick, disabledNoteEdit, externalNoteEditor = false, onEditProduct, onAction, onDelete, onNote, onLike, onCard, onChangeResource, onPromotion, onGift, onChangeHolder, itemType = "product", type, rightActions = [], rightActionsDisplay = "swipe", escapeDom, maxSpecsCount = 1, isShowRelatedProduct = true } = props, other = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
66
68
  const useOpenNoteRef = (0, react.useRef)();
67
69
  const context = require_useEngineContext.default();
68
70
  _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");
@@ -106,6 +108,14 @@ const CartSkuCard = (props) => {
106
108
  const hideDivider = (0, react.useMemo)(() => {
107
109
  return false;
108
110
  }, [dataSource]);
111
+ const openNoteEditor = () => {
112
+ var _useOpenNoteRef$curre;
113
+ if (externalNoteEditor) {
114
+ onNote === null || onNote === void 0 || onNote(dataSource);
115
+ return;
116
+ }
117
+ (_useOpenNoteRef$curre = useOpenNoteRef.current) === null || _useOpenNoteRef$curre === void 0 || _useOpenNoteRef$curre.open({ item: dataSource });
118
+ };
109
119
  /**
110
120
  * @description: 营销活动
111
121
  * @param {*} useMemo
@@ -131,9 +141,8 @@ const CartSkuCard = (props) => {
131
141
  maxSpecsCount
132
142
  })), /* @__PURE__ */ react.default.createElement(require_index$3.default, { dataSource }), renderPromotion, isShowNote ? /* @__PURE__ */ react.default.createElement(require_index$9.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, other), {}, {
133
143
  item: dataSource,
134
- openNote: () => {
135
- useOpenNoteRef.current.open({ item: dataSource });
136
- }
144
+ disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
145
+ openNote: openNoteEditor
137
146
  })) : null);
138
147
  };
139
148
  const renderA5 = () => {
@@ -173,9 +182,8 @@ const CartSkuCard = (props) => {
173
182
  type: "total"
174
183
  }) : null, renderPromotion, isShowNote ? /* @__PURE__ */ react.default.createElement(require_index$9.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, other), {}, {
175
184
  item: dataSource,
176
- openNote: () => {
177
- useOpenNoteRef.current.open({ item: dataSource });
178
- }
185
+ disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
186
+ openNote: openNoteEditor
179
187
  })) : null, isShowAction && actionText ? /* @__PURE__ */ react.default.createElement(require_index$1.default, {
180
188
  item: dataSource,
181
189
  onAction: () => onAction === null || onAction === void 0 ? void 0 : onAction(dataSource)
@@ -210,9 +218,8 @@ const CartSkuCard = (props) => {
210
218
  type: "total"
211
219
  }) : null, /* @__PURE__ */ react.default.createElement(require_index$3.default, { dataSource }), renderPromotion, isShowNote ? /* @__PURE__ */ react.default.createElement(require_index$9.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, other), {}, {
212
220
  item: dataSource,
213
- openNote: () => {
214
- useOpenNoteRef.current.open({ item: dataSource });
215
- }
221
+ disabledEdit: disabledNoteEdit !== null && disabledNoteEdit !== void 0 ? disabledNoteEdit : other.disabledEdit,
222
+ openNote: openNoteEditor
216
223
  })) : null);
217
224
  };
218
225
  const renderContent = () => {
@@ -41,6 +41,7 @@ const _excluded = [
41
41
  "isShowAmountFooter",
42
42
  "disabledClick",
43
43
  "disabledEdit",
44
+ "disabledNoteEdit",
44
45
  "statusOptions",
45
46
  "statusLoading",
46
47
  "statusDisabled",
@@ -67,7 +68,7 @@ const getStatusOption = (status, statusOptions = []) => {
67
68
  };
68
69
  const BookingLineItem = (props) => {
69
70
  var _ref, _ref2, _dataSource$promotion, _dataSource$giftData;
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 { dataSource, type, cartSkuType, isShowBookingHeader, relatedProductDataSource, addTimeProductDataSources = [], rightActions = [], rightActionsDisplay = "swipe", escapeDom, isShowImage, isShowQuantityBadge = true, isFormSubject, isShowDelete, isShowInlineDelete = isShowDelete, isShowNote, isShowAmountFooter, disabledClick, disabledEdit, disabledNoteEdit = 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
72
  const shouldRenderRelatedProduct = isShowRelatedProduct && Boolean(relatedProductDataSource);
72
73
  const [isAddTimeProductsExpanded, setIsAddTimeProductsExpanded] = (0, react.useState)(false);
73
74
  const { isShowAction, actionText } = dataSource;
@@ -88,7 +89,8 @@ const BookingLineItem = (props) => {
88
89
  onDelete === null || onDelete === void 0 || onDelete(dataSource);
89
90
  }
90
91
  };
91
- const bookingRightActions = isShowDelete ? rightActionsDisplay === "inline" ? [...rightActions, deleteAction] : [deleteAction, ...rightActions] : rightActions;
92
+ const showDeleteInRelatedProduct = isShowDelete && rightActionsDisplay === "inline" && shouldRenderRelatedProduct && !(relatedProductDataSource === null || relatedProductDataSource === void 0 ? void 0 : relatedProductDataSource.isGift);
93
+ const bookingRightActions = isShowDelete && !showDeleteInRelatedProduct ? rightActionsDisplay === "inline" ? [...rightActions, deleteAction] : [deleteAction, ...rightActions] : rightActions;
92
94
  const resolvedHolderOptions = (_ref = (_ref2 = holderOptions !== null && holderOptions !== void 0 ? holderOptions : dataSource === null || dataSource === void 0 ? void 0 : dataSource.holderOptions) !== null && _ref2 !== void 0 ? _ref2 : dataSource === null || dataSource === void 0 ? void 0 : dataSource.holders) !== null && _ref !== void 0 ? _ref : [];
93
95
  const resolvedIsFormSubject = isFormSubject !== null && isFormSubject !== void 0 ? isFormSubject : dataSource === null || dataSource === void 0 ? void 0 : dataSource.isFormSubject;
94
96
  const bookingTitle = String((dataSource === null || dataSource === void 0 ? void 0 : dataSource.booking_id) || "");
@@ -119,18 +121,18 @@ const BookingLineItem = (props) => {
119
121
  const renderProductCard = (productDataSource, source, options = {}) => {
120
122
  var _productDataSource$pr;
121
123
  if (!productDataSource || (productDataSource === null || productDataSource === void 0 ? void 0 : productDataSource.isGift)) return null;
122
- const { showProductPromotion = true, showAmountFooter = true } = options;
124
+ const { showProductPromotion = true, showAmountFooter = true, inlineActions = [] } = options;
123
125
  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, {
124
126
  promotions: productDataSource.promotions,
125
127
  onClick: (item) => onPromotion === null || onPromotion === void 0 ? void 0 : onPromotion(item)
126
128
  }) : null;
127
- return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement(require_index$2.default, {
129
+ return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: `${PREFIX}__product-main-row` }, /* @__PURE__ */ react.default.createElement(require_index$2.default, {
128
130
  isShowImage,
129
131
  isShowQuantityBadge,
130
132
  dataSource: productDataSource,
131
133
  type: cartSkuType,
132
134
  maxSpecsCount: props.maxSpecsCount || 1
133
- }), /* @__PURE__ */ react.default.createElement(require_index$3.default, {
135
+ }), inlineActions.length > 0 ? /* @__PURE__ */ react.default.createElement(require_index$9.default, { actions: inlineActions }) : null), /* @__PURE__ */ react.default.createElement(require_index$3.default, {
134
136
  dataSource: productDataSource,
135
137
  isShowImage,
136
138
  isShowQuantityBadge,
@@ -141,7 +143,7 @@ const BookingLineItem = (props) => {
141
143
  type: "total"
142
144
  }) : null, showProductPromotion ? productPromotion : null, isShowNote ? /* @__PURE__ */ react.default.createElement(require_index$5.default, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, other), {}, {
143
145
  item: productDataSource,
144
- disabledEdit,
146
+ disabledEdit: disabledNoteEdit,
145
147
  openNote: () => onNote === null || onNote === void 0 ? void 0 : onNote(source)
146
148
  })) : null);
147
149
  };
@@ -199,7 +201,8 @@ const BookingLineItem = (props) => {
199
201
  isFormSubject: resolvedIsFormSubject
200
202
  }) : 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
203
  showProductPromotion: false,
202
- showAmountFooter: !shouldRenderFullWidthAmountFooter
204
+ showAmountFooter: !shouldRenderFullWidthAmountFooter,
205
+ inlineActions: showDeleteInRelatedProduct ? [deleteAction] : []
203
206
  }), renderPromotion, isShowAction && actionText ? /* @__PURE__ */ react.default.createElement(require_index$1.default, {
204
207
  item: dataSource,
205
208
  onAction: () => onAction === null || onAction === void 0 ? void 0 : onAction(dataSource)
@@ -28,6 +28,7 @@ const _excluded = [
28
28
  "isShowAmountFooter",
29
29
  "disabledClick",
30
30
  "disabledEdit",
31
+ "disabledNoteEdit",
31
32
  "statusOptions",
32
33
  "statusLoading",
33
34
  "statusDisabled",
@@ -180,7 +181,7 @@ const convertProductToLineItemProduct = (product, translationOriginal, symbol) =
180
181
  };
181
182
  const LineItem = (props) => {
182
183
  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
+ 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, disabledNoteEdit = 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
185
  const itemKind = itemType || (isBookingItem(dataSource) ? "booking" : "product");
185
186
  const context = require_useEngineContext.default();
186
187
  const translationOriginal = require_useTranslationOriginal.default();
@@ -224,6 +225,7 @@ const LineItem = (props) => {
224
225
  isShowAmountFooter,
225
226
  disabledClick,
226
227
  disabledEdit,
228
+ disabledNoteEdit,
227
229
  onAction,
228
230
  onDelete,
229
231
  onNote,
@@ -248,6 +250,7 @@ const LineItem = (props) => {
248
250
  isShowAmountFooter,
249
251
  disabledClick,
250
252
  disabledEdit,
253
+ disabledNoteEdit,
251
254
  statusOptions,
252
255
  statusLoading,
253
256
  statusDisabled,
@@ -284,6 +284,19 @@
284
284
  }
285
285
  }
286
286
 
287
+ // 复杂预约的删除入口属于关联主商品,不再占用整张预约卡的右侧操作列。
288
+ // 这里复用普通商品的 InlineActions,只改变它的布局归属。
289
+ &__product-main-row {
290
+ display: flex;
291
+ align-items: stretch;
292
+ min-width: 0;
293
+
294
+ > .pisell-cart-sku-card__basic-info {
295
+ min-width: 0;
296
+ flex: 1;
297
+ }
298
+ }
299
+
287
300
  &__add-time-product-card {
288
301
  padding: 4px;
289
302
  border: 1px solid var(--Gray-300, #d0d5dd);
@@ -79,6 +79,8 @@ type ProductCardTypes = {
79
79
  isShowEditProduct?: boolean;
80
80
  isShowAmountFooter?: boolean;
81
81
  disabledEdit?: boolean;
82
+ disabledNoteEdit?: boolean;
83
+ externalNoteEditor?: boolean;
82
84
  locale?: string;
83
85
  symbol?: string;
84
86
  isShowChangeHolder?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "6.12.35",
3
+ "version": "6.12.37",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -96,8 +96,8 @@
96
96
  "antd-mobile": "^5.38.1",
97
97
  "vod-js-sdk-v6": "^1.4.11",
98
98
  "@pisell/date-picker": "3.0.10",
99
- "@pisell/icon": "0.0.11",
100
- "@pisell/utils": "3.0.4"
99
+ "@pisell/utils": "3.0.4",
100
+ "@pisell/icon": "0.0.11"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "react": "^18.0.0",