@pisell/materials 1.10.13 → 1.10.15

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.
@@ -33,7 +33,7 @@ import { getText } from "../../../locales";
33
33
  * @author Pisell Team
34
34
  */
35
35
  var ProcedureHeader = function ProcedureHeader(_ref) {
36
- var _modalConfig$config2, _modalConfig$config3;
36
+ var _mergedStepsProps$mob, _mergedStepsProps$mob2, _modalConfig$config2, _modalConfig$config3;
37
37
  var headerProps = _ref.headerProps,
38
38
  currentStep = _ref.currentStep,
39
39
  className = _ref.className,
@@ -256,8 +256,10 @@ var ProcedureHeader = function ProcedureHeader(_ref) {
256
256
  }, actualLeftSlot), (headerProps === null || headerProps === void 0 ? void 0 : headerProps.showSteps) !== false && /*#__PURE__*/React.createElement("div", {
257
257
  className: "pisell-procedure-header__center"
258
258
  }, /*#__PURE__*/React.createElement(PisellSteps, _extends({}, mergedStepsProps, {
259
- mobileMode: "auto",
260
- mobileBreakpoint: 744
259
+ // 调用方可以根据自身页面形态覆盖移动端展示断点;
260
+ // 未配置时继续沿用 Procedure 原有的 744px 默认行为。
261
+ mobileMode: (_mergedStepsProps$mob = mergedStepsProps.mobileMode) !== null && _mergedStepsProps$mob !== void 0 ? _mergedStepsProps$mob : 'auto',
262
+ mobileBreakpoint: (_mergedStepsProps$mob2 = mergedStepsProps.mobileBreakpoint) !== null && _mergedStepsProps$mob2 !== void 0 ? _mergedStepsProps$mob2 : 744
261
263
  }))), showActualRightArea && /*#__PURE__*/React.createElement("div", {
262
264
  className: "pisell-procedure-header__right",
263
265
  onClick: function onClick() {
@@ -173,7 +173,9 @@ var BookingLineItem = function BookingLineItem(props) {
173
173
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
174
174
  if (!productDataSource || productDataSource !== null && productDataSource !== void 0 && productDataSource.isGift) return null;
175
175
  var _options$showProductP = options.showProductPromotion,
176
- showProductPromotion = _options$showProductP === void 0 ? true : _options$showProductP;
176
+ showProductPromotion = _options$showProductP === void 0 ? true : _options$showProductP,
177
+ _options$showAmountFo = options.showAmountFooter,
178
+ showAmountFooter = _options$showAmountFo === void 0 ? true : _options$showAmountFo;
177
179
  var productPromotion = productDataSource !== null && productDataSource !== void 0 && (_productDataSource$pr = productDataSource.promotions) !== null && _productDataSource$pr !== void 0 && _productDataSource$pr.length ? /*#__PURE__*/React.createElement(Promotion, {
178
180
  promotions: productDataSource.promotions,
179
181
  onClick: function onClick(item) {
@@ -191,7 +193,7 @@ var BookingLineItem = function BookingLineItem(props) {
191
193
  isShowImage: isShowImage,
192
194
  isShowQuantityBadge: isShowQuantityBadge,
193
195
  type: cartSkuType
194
- }), isShowAmountFooter ? /*#__PURE__*/React.createElement(AmountFooter, {
196
+ }), isShowAmountFooter && showAmountFooter ? /*#__PURE__*/React.createElement(AmountFooter, {
195
197
  item: productDataSource,
196
198
  hideDivider: false,
197
199
  type: "total"
@@ -247,6 +249,11 @@ var BookingLineItem = function BookingLineItem(props) {
247
249
  if (dataSource !== null && dataSource !== void 0 && dataSource.isGift) {
248
250
  return null;
249
251
  }
252
+
253
+ // inline 操作栏位于卡片内容右侧。价格栏如果继续放在左侧内容中,
254
+ // 宽度会被数量/删除操作列挤窄;将它提升到整个 wrapper 的下一行,
255
+ // 才能覆盖预约卡片的完整宽度。
256
+ var shouldRenderFullWidthAmountFooter = rightActionsDisplay === 'inline' && isShowAmountFooter && shouldRenderRelatedProduct;
250
257
  var cardContent = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
251
258
  className: classNames(PREFIX, "".concat(PREFIX, "--booking"), "".concat(PREFIX, "--").concat(type)),
252
259
  onClick: function onClick(e) {
@@ -296,7 +303,8 @@ var BookingLineItem = function BookingLineItem(props) {
296
303
  }, /*#__PURE__*/React.createElement("div", {
297
304
  className: "".concat(PREFIX, "__related-product-card")
298
305
  }, renderProductCard(relatedProductDataSource, dataSource, {
299
- showProductPromotion: false
306
+ showProductPromotion: false,
307
+ showAmountFooter: !shouldRenderFullWidthAmountFooter
300
308
  }), renderPromotion, isShowAction && actionText ? /*#__PURE__*/React.createElement(Action, {
301
309
  item: dataSource,
302
310
  onAction: function onAction() {
@@ -307,11 +315,19 @@ var BookingLineItem = function BookingLineItem(props) {
307
315
  className: classNames("".concat(PREFIX, "-wrapper-container"), _defineProperty({}, "".concat(PREFIX, "-wrapper-container--inline"), rightActionsDisplay === 'inline'))
308
316
  }, rightActionsDisplay === 'inline' ? /*#__PURE__*/React.createElement("div", {
309
317
  className: classNames("".concat(PREFIX, "-wrapper"), "".concat(PREFIX, "-wrapper--inline"))
318
+ }, /*#__PURE__*/React.createElement("div", {
319
+ className: "".concat(PREFIX, "-inline-main")
310
320
  }, /*#__PURE__*/React.createElement("div", {
311
321
  className: "".concat(PREFIX, "-inline-content")
312
322
  }, cardContent), /*#__PURE__*/React.createElement(InlineActions, {
313
323
  actions: bookingRightActions
314
- })) : /*#__PURE__*/React.createElement(SwipeAction, {
324
+ })), shouldRenderFullWidthAmountFooter ? /*#__PURE__*/React.createElement("div", {
325
+ className: "".concat(PREFIX, "__inline-amount-footer")
326
+ }, /*#__PURE__*/React.createElement(AmountFooter, {
327
+ item: relatedProductDataSource,
328
+ hideDivider: false,
329
+ type: "total"
330
+ })) : null) : /*#__PURE__*/React.createElement(SwipeAction, {
315
331
  closeOnAction: false,
316
332
  className: classNames("".concat(PREFIX, "-wrapper")),
317
333
  rightActions: bookingRightActions,
@@ -15,10 +15,16 @@
15
15
  box-sizing: border-box;
16
16
  width: 100%;
17
17
  display: flex;
18
- align-items: stretch;
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;
@@ -196,8 +196,8 @@ var ProcedureHeader = ({
196
196
  import_PisellSteps.default,
197
197
  {
198
198
  ...mergedStepsProps,
199
- mobileMode: "auto",
200
- mobileBreakpoint: 744
199
+ mobileMode: mergedStepsProps.mobileMode ?? "auto",
200
+ mobileBreakpoint: mergedStepsProps.mobileBreakpoint ?? 744
201
201
  }
202
202
  )), showActualRightArea && /* @__PURE__ */ import_react.default.createElement(
203
203
  "div",
@@ -171,7 +171,10 @@ var BookingLineItem = (props) => {
171
171
  const renderProductCard = (productDataSource, source, options = {}) => {
172
172
  var _a2;
173
173
  if (!productDataSource || (productDataSource == null ? void 0 : productDataSource.isGift)) return null;
174
- const { showProductPromotion = true } = options;
174
+ const {
175
+ showProductPromotion = true,
176
+ showAmountFooter = true
177
+ } = options;
175
178
  const productPromotion = ((_a2 = productDataSource == null ? void 0 : productDataSource.promotions) == null ? void 0 : _a2.length) ? /* @__PURE__ */ import_react.default.createElement(
176
179
  import_Promotion.default,
177
180
  {
@@ -196,7 +199,7 @@ var BookingLineItem = (props) => {
196
199
  isShowQuantityBadge,
197
200
  type: cartSkuType
198
201
  }
199
- ), isShowAmountFooter ? /* @__PURE__ */ import_react.default.createElement(
202
+ ), isShowAmountFooter && showAmountFooter ? /* @__PURE__ */ import_react.default.createElement(
200
203
  import_AmountFooter.default,
201
204
  {
202
205
  item: productDataSource,
@@ -255,6 +258,7 @@ var BookingLineItem = (props) => {
255
258
  if (dataSource == null ? void 0 : dataSource.isGift) {
256
259
  return null;
257
260
  }
261
+ const shouldRenderFullWidthAmountFooter = rightActionsDisplay === "inline" && isShowAmountFooter && shouldRenderRelatedProduct;
258
262
  const cardContent = /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
259
263
  "div",
260
264
  {
@@ -308,7 +312,8 @@ var BookingLineItem = (props) => {
308
312
  !isShowBookingHeader ? renderDeleteButton(true) : null
309
313
  ),
310
314
  shouldRenderRelatedProduct ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Divider, { style: { margin: 0 } }), /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__related-product` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__related-product-card` }, renderProductCard(relatedProductDataSource, dataSource, {
311
- showProductPromotion: false
315
+ showProductPromotion: false,
316
+ showAmountFooter: !shouldRenderFullWidthAmountFooter
312
317
  }), renderPromotion, isShowAction && actionText ? /* @__PURE__ */ import_react.default.createElement(
313
318
  import_Action.default,
314
319
  {
@@ -333,8 +338,15 @@ var BookingLineItem = (props) => {
333
338
  `${PREFIX}-wrapper--inline`
334
339
  )
335
340
  },
336
- /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-inline-content` }, cardContent),
337
- /* @__PURE__ */ import_react.default.createElement(import_inlineActions.default, { actions: bookingRightActions })
341
+ /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-inline-main` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}-inline-content` }, cardContent), /* @__PURE__ */ import_react.default.createElement(import_inlineActions.default, { actions: bookingRightActions })),
342
+ shouldRenderFullWidthAmountFooter ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${PREFIX}__inline-amount-footer` }, /* @__PURE__ */ import_react.default.createElement(
343
+ import_AmountFooter.default,
344
+ {
345
+ item: relatedProductDataSource,
346
+ hideDivider: false,
347
+ type: "total"
348
+ }
349
+ )) : null
338
350
  ) : /* @__PURE__ */ import_react.default.createElement(
339
351
  import_swipeAction.SwipeAction,
340
352
  {
@@ -15,10 +15,16 @@
15
15
  box-sizing: border-box;
16
16
  width: 100%;
17
17
  display: flex;
18
- align-items: stretch;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.10.13",
3
+ "version": "1.10.15",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",