@pisell/private-materials 6.12.140 → 6.12.142

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 (27) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +4 -4
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +4 -4
  9. package/es/components/bigSale/components/ProductList/index.js +24 -20
  10. package/es/plus/pisellSalesProductCard/index.js +3 -3
  11. package/es/plus/productSelect/ProductCard/ProductCardV2.js +2 -1
  12. package/es/plus/saasDevice/appDevicePlanning/hooks/useDeviceLinking.js +28 -4
  13. package/es/plus/saasDevice/appDevicePlanning/modules/devices/components/DeviceTable/index.js +4 -1
  14. package/es/plus/saasDevice/appDevicePlanning/modules/devices/components/DeviceTable/index.less +23 -3
  15. package/es/plus/salesSdk/context/SalesSdkCartContext.js +54 -53
  16. package/es/pro/skuDetailModal/README.md +2 -2
  17. package/es/pro/skuDetailModal/flow/presets.d.ts +2 -42
  18. package/lib/components/bigSale/components/ProductList/index.js +24 -20
  19. package/lib/plus/pisellSalesProductCard/index.js +3 -3
  20. package/lib/plus/productSelect/ProductCard/ProductCardV2.js +2 -1
  21. package/lib/plus/saasDevice/appDevicePlanning/hooks/useDeviceLinking.js +28 -4
  22. package/lib/plus/saasDevice/appDevicePlanning/modules/devices/components/DeviceTable/index.js +4 -1
  23. package/lib/plus/saasDevice/appDevicePlanning/modules/devices/components/DeviceTable/index.less +23 -3
  24. package/lib/plus/salesSdk/context/SalesSdkCartContext.js +54 -53
  25. package/lib/pro/skuDetailModal/README.md +2 -2
  26. package/lib/pro/skuDetailModal/flow/presets.d.ts +2 -42
  27. package/package.json +2 -2
@@ -818,8 +818,8 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
818
818
  return promise;
819
819
  });
820
820
  const addProductToOrderFromCacheImpl = (0, ahooks.useMemoizedFn)(function() {
821
- var _ref7 = require_asyncToGenerator._asyncToGenerator(function* (item, cacheItem, options) {
822
- var _flowCtx$date;
821
+ var _ref8 = require_asyncToGenerator._asyncToGenerator(function* (item, cacheItem, options) {
822
+ var _flowCtx$date, _ref7, _cacheItemForTransfor, _cacheItemForTransfor2;
823
823
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
824
824
  if (typeof bookingTicket.transformDetailToProductAndBooking !== "function") throw new Error("[SalesSdk] Cart: bookingTicket.transformDetailToProductAndBooking 不可用");
825
825
  const flowCtx = getAddFlowContext();
@@ -832,6 +832,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
832
832
  date: (_flowCtx$date = flowCtx.date) !== null && _flowCtx$date !== void 0 ? _flowCtx$date : void 0
833
833
  }
834
834
  });
835
+ orderLine.note = (_ref7 = (_cacheItemForTransfor = cacheItemForTransform === null || cacheItemForTransform === void 0 || (_cacheItemForTransfor2 = cacheItemForTransform._extend) === null || _cacheItemForTransfor2 === void 0 ? void 0 : _cacheItemForTransfor2.note) !== null && _cacheItemForTransfor !== void 0 ? _cacheItemForTransfor : orderLine.note) !== null && _ref7 !== void 0 ? _ref7 : "";
835
836
  const productLineMergeEnabled = resolveProductLineMergeEnabled(shouldMergeProductLines);
836
837
  const products = yield bookingTicket.addProductToOrder(orderLine, booking, productLineMergeEnabled ? void 0 : { disableMerge: true });
837
838
  const deferredConsistencyRefresh = scheduleDeferredAddConsistencyRefresh();
@@ -840,7 +841,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
840
841
  return products;
841
842
  });
842
843
  return function(_x5, _x6, _x7) {
843
- return _ref7.apply(this, arguments);
844
+ return _ref8.apply(this, arguments);
844
845
  };
845
846
  }());
846
847
  const addProductToOrderFromCache = (0, ahooks.useMemoizedFn)((item, cacheItem, options) => trackPendingCartMutation(addProductToOrderFromCacheImpl(item, cacheItem, options)));
@@ -849,7 +850,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
849
850
  * 直接复用其 cacheItem 加车,避免再次执行 decide/enrich 并重复弹窗。
850
851
  */
851
852
  const addPreparedProduct = (0, ahooks.useMemoizedFn)(function() {
852
- var _ref8 = require_asyncToGenerator._asyncToGenerator(function* (cacheItem, options) {
853
+ var _ref9 = require_asyncToGenerator._asyncToGenerator(function* (cacheItem, options) {
853
854
  const quantity = (options === null || options === void 0 ? void 0 : options.quantity) != null && options.quantity > 0 ? Math.floor(options.quantity) : 1;
854
855
  const preparedCacheItem = require_applyExplicitAddQuantityToCacheItem.applyExplicitAddQuantityToCacheItem(cacheItem, quantity);
855
856
  const products = yield addProductToOrderFromCache(preparedCacheItem, preparedCacheItem, { quantity });
@@ -860,7 +861,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
860
861
  };
861
862
  });
862
863
  return function(_x8, _x9) {
863
- return _ref8.apply(this, arguments);
864
+ return _ref9.apply(this, arguments);
864
865
  };
865
866
  }());
866
867
  /**
@@ -879,7 +880,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
879
880
  * 加车:走 OS `decideAddProduct` 两阶段决策;直加路径可透传 preparedCacheItem 跳过二次决策。
880
881
  */
881
882
  const addProduct = (0, ahooks.useMemoizedFn)(function() {
882
- var _ref11 = require_asyncToGenerator._asyncToGenerator(function* (product, options) {
883
+ var _ref12 = require_asyncToGenerator._asyncToGenerator(function* (product, options) {
883
884
  var _flowCtx$date2;
884
885
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
885
886
  if (typeof bookingTicket.decideAddProduct !== "function") throw new Error("[SalesSdk] Cart: bookingTicket.decideAddProduct 不可用,请升级 pisellos");
@@ -892,7 +893,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
892
893
  * addProduct(p, { quantity: 1, preparedCacheItem: cacheItem });
893
894
  */
894
895
  const runDirectAddFromCacheItem = function() {
895
- var _ref9 = require_asyncToGenerator._asyncToGenerator(function* (rawCacheItem) {
896
+ var _ref10 = require_asyncToGenerator._asyncToGenerator(function* (rawCacheItem) {
896
897
  const cacheItemForEnrich = require_mergeCatalogDurationIntoCacheItem.mergeCatalogDurationIntoCacheItem(require_applyExplicitAddQuantityToCacheItem.applyExplicitAddQuantityToCacheItem(rawCacheItem, addQty), product);
897
898
  const shouldPrepareHolderOptions = require_shouldPromptHolderOnAddCart.shouldPromptHolderOnAddCart({
898
899
  cacheItem: cacheItemForEnrich,
@@ -921,7 +922,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
921
922
  };
922
923
  });
923
924
  return function runDirectAddFromCacheItem(_x10) {
924
- return _ref9.apply(this, arguments);
925
+ return _ref10.apply(this, arguments);
925
926
  };
926
927
  }();
927
928
  if ((options === null || options === void 0 ? void 0 : options.preparedCacheItem) != null) return runDirectAddFromCacheItem(options.preparedCacheItem);
@@ -961,12 +962,12 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
961
962
  };
962
963
  }
963
964
  if (decision.action === "requiresBookingEdit") {
964
- var _decision$payload2, _flowCtx$date5, _ref10, _flowCtx$date6, _decision$payload3, _flowCtx$customerId, _decision$payload4;
965
+ var _decision$payload2, _flowCtx$date5, _ref11, _flowCtx$date6, _decision$payload3, _flowCtx$customerId, _decision$payload4;
965
966
  return {
966
967
  status: "requiresBookingEdit",
967
968
  payload: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, (_decision$payload2 = decision.payload) !== null && _decision$payload2 !== void 0 ? _decision$payload2 : { date: (_flowCtx$date5 = flowCtx.date) !== null && _flowCtx$date5 !== void 0 ? _flowCtx$date5 : null }), {}, {
968
969
  cacheItem: decision.cacheItem,
969
- date: (_ref10 = (_flowCtx$date6 = flowCtx.date) !== null && _flowCtx$date6 !== void 0 ? _flowCtx$date6 : (_decision$payload3 = decision.payload) === null || _decision$payload3 === void 0 ? void 0 : _decision$payload3.date) !== null && _ref10 !== void 0 ? _ref10 : null,
970
+ date: (_ref11 = (_flowCtx$date6 = flowCtx.date) !== null && _flowCtx$date6 !== void 0 ? _flowCtx$date6 : (_decision$payload3 = decision.payload) === null || _decision$payload3 === void 0 ? void 0 : _decision$payload3.date) !== null && _ref11 !== void 0 ? _ref11 : null,
970
971
  customerId: (_flowCtx$customerId = flowCtx.customerId) !== null && _flowCtx$customerId !== void 0 ? _flowCtx$customerId : (_decision$payload4 = decision.payload) === null || _decision$payload4 === void 0 ? void 0 : _decision$payload4.customerId
971
972
  })
972
973
  };
@@ -974,14 +975,14 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
974
975
  return runDirectAddFromCacheItem(decision.cacheItem);
975
976
  });
976
977
  return function(_x11, _x12) {
977
- return _ref11.apply(this, arguments);
978
+ return _ref12.apply(this, arguments);
978
979
  };
979
980
  }());
980
981
  /**
981
982
  * 规格弹窗 callback 完成后:先跑第二段 `decideAfterDetail`,再决定加车或开资源抽屉。
982
983
  */
983
984
  const confirmDetail = (0, ahooks.useMemoizedFn)(function() {
984
- var _ref13 = require_asyncToGenerator._asyncToGenerator(function* (input) {
985
+ var _ref14 = require_asyncToGenerator._asyncToGenerator(function* (input) {
985
986
  var _flowCtx$date7, _input$options, _input$options3;
986
987
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
987
988
  if (typeof bookingTicket.transformDetailToProductAndBooking !== "function") throw new Error("[SalesSdk] Cart: bookingTicket.transformDetailToProductAndBooking 不可用");
@@ -1009,7 +1010,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1009
1010
  bookingConfig: (_flowCtx$bookingConfi = flowCtx.bookingConfig) !== null && _flowCtx$bookingConfi !== void 0 ? _flowCtx$bookingConfi : void 0
1010
1011
  });
1011
1012
  if (decision.action === "requiresBookingEdit") {
1012
- var _decision$payload5, _ref12, _flowCtx$date9, _decision$payload6, _flowCtx$customerId2, _decision$payload7;
1013
+ var _decision$payload5, _ref13, _flowCtx$date9, _decision$payload6, _flowCtx$customerId2, _decision$payload7;
1013
1014
  return {
1014
1015
  status: "requiresBookingEdit",
1015
1016
  payload: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, (_decision$payload5 = decision.payload) !== null && _decision$payload5 !== void 0 ? _decision$payload5 : {
@@ -1017,7 +1018,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1017
1018
  date: flowCtx.date
1018
1019
  }), {}, {
1019
1020
  cacheItem: decision.cacheItem,
1020
- date: (_ref12 = (_flowCtx$date9 = flowCtx.date) !== null && _flowCtx$date9 !== void 0 ? _flowCtx$date9 : (_decision$payload6 = decision.payload) === null || _decision$payload6 === void 0 ? void 0 : _decision$payload6.date) !== null && _ref12 !== void 0 ? _ref12 : null,
1021
+ date: (_ref13 = (_flowCtx$date9 = flowCtx.date) !== null && _flowCtx$date9 !== void 0 ? _flowCtx$date9 : (_decision$payload6 = decision.payload) === null || _decision$payload6 === void 0 ? void 0 : _decision$payload6.date) !== null && _ref13 !== void 0 ? _ref13 : null,
1021
1022
  customerId: (_flowCtx$customerId2 = flowCtx.customerId) !== null && _flowCtx$customerId2 !== void 0 ? _flowCtx$customerId2 : (_decision$payload7 = decision.payload) === null || _decision$payload7 === void 0 ? void 0 : _decision$payload7.customerId
1022
1023
  })
1023
1024
  };
@@ -1055,12 +1056,12 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1055
1056
  };
1056
1057
  });
1057
1058
  return function(_x13) {
1058
- return _ref13.apply(this, arguments);
1059
+ return _ref14.apply(this, arguments);
1059
1060
  };
1060
1061
  }());
1061
1062
  /** 资源 / 时间抽屉确认后加车。 */
1062
1063
  const confirmBookingEdit = (0, ahooks.useMemoizedFn)(function() {
1063
- var _ref14 = require_asyncToGenerator._asyncToGenerator(function* (input) {
1064
+ var _ref15 = require_asyncToGenerator._asyncToGenerator(function* (input) {
1064
1065
  var _input$options4;
1065
1066
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1066
1067
  const products = yield addProductToOrderFromCache(input.cacheItem, input.cacheItem, { quantity: require_resolveConfirmDetailQuantity.resolveAddQuantityFromCacheItem(input.cacheItem, (_input$options4 = input.options) === null || _input$options4 === void 0 ? void 0 : _input$options4.quantity) });
@@ -1068,7 +1069,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1068
1069
  return { products };
1069
1070
  });
1070
1071
  return function(_x14) {
1071
- return _ref14.apply(this, arguments);
1072
+ return _ref15.apply(this, arguments);
1072
1073
  };
1073
1074
  }());
1074
1075
  const syncCommittedBookingSelection = (0, ahooks.useMemoizedFn)(require_asyncToGenerator._asyncToGenerator(function* () {
@@ -1076,7 +1077,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1076
1077
  }));
1077
1078
  /** 无防抖的加车编排(规格 / 资源弹窗链)。 */
1078
1079
  const runAddProductFlowBase = (0, ahooks.useMemoizedFn)(function() {
1079
- var _ref15 = require_asyncToGenerator._asyncToGenerator(function* (product, options) {
1080
+ var _ref16 = require_asyncToGenerator._asyncToGenerator(function* (product, options) {
1080
1081
  const holderOptionsForProduct = yield ensureHolderOptionsForSource(product);
1081
1082
  return require_runAddProductFlow.runAddProductFlow({
1082
1083
  addProduct,
@@ -1088,7 +1089,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1088
1089
  }));
1089
1090
  });
1090
1091
  return function(_x15, _x16) {
1091
- return _ref15.apply(this, arguments);
1092
+ return _ref16.apply(this, arguments);
1092
1093
  };
1093
1094
  }());
1094
1095
  const addProductRef = (0, react.useRef)(addProduct);
@@ -1124,7 +1125,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1124
1125
  },
1125
1126
  onBookingSelectionCommitted: syncCommittedBookingSelection,
1126
1127
  confirmBookingSelection: function() {
1127
- var _ref16 = require_asyncToGenerator._asyncToGenerator(function* (cacheItem, opts) {
1128
+ var _ref17 = require_asyncToGenerator._asyncToGenerator(function* (cacheItem, opts) {
1128
1129
  const result = yield confirmBookingEditRef.current({
1129
1130
  cacheItem,
1130
1131
  options: {
@@ -1138,7 +1139,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1138
1139
  } : result;
1139
1140
  });
1140
1141
  return function confirmBookingSelection(_x17, _x18) {
1141
- return _ref16.apply(this, arguments);
1142
+ return _ref17.apply(this, arguments);
1142
1143
  };
1143
1144
  }(),
1144
1145
  reloadProductCatalog: () => reloadProductCatalogRef.current(),
@@ -1172,17 +1173,17 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1172
1173
  * 仅 action=add 时首击立即加车、200ms 内连点合并追加;关闭商品行合并时每次调用立即独立加车。
1173
1174
  */
1174
1175
  const addProductWithFlow = (0, ahooks.useMemoizedFn)(function() {
1175
- var _ref17 = require_asyncToGenerator._asyncToGenerator(function* (product, options) {
1176
+ var _ref18 = require_asyncToGenerator._asyncToGenerator(function* (product, options) {
1176
1177
  if (!bookingTicketRef.current) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1177
1178
  const productLineMergeEnabled = resolveProductLineMergeEnabled(shouldMergeProductLines);
1178
1179
  return debouncedAddRef.current.addProductWithFlow(product, productLineMergeEnabled ? options : require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, options), {}, { debounceMs: 0 }));
1179
1180
  });
1180
1181
  return function(_x19, _x20) {
1181
- return _ref17.apply(this, arguments);
1182
+ return _ref18.apply(this, arguments);
1182
1183
  };
1183
1184
  }());
1184
1185
  const removeItem = (0, ahooks.useMemoizedFn)(function() {
1185
- var _ref18 = require_asyncToGenerator._asyncToGenerator(function* (item) {
1186
+ var _ref19 = require_asyncToGenerator._asyncToGenerator(function* (item) {
1186
1187
  var _extend$product, _extend2;
1187
1188
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1188
1189
  const productItem = (_extend$product = item === null || item === void 0 || (_extend2 = item._extend) === null || _extend2 === void 0 ? void 0 : _extend2.product) !== null && _extend$product !== void 0 ? _extend$product : item;
@@ -1199,11 +1200,11 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1199
1200
  return result;
1200
1201
  });
1201
1202
  return function(_x21) {
1202
- return _ref18.apply(this, arguments);
1203
+ return _ref19.apply(this, arguments);
1203
1204
  };
1204
1205
  }());
1205
1206
  const updateItem = (0, ahooks.useMemoizedFn)(function() {
1206
- var _ref19 = require_asyncToGenerator._asyncToGenerator(function* (params) {
1207
+ var _ref20 = require_asyncToGenerator._asyncToGenerator(function* (params) {
1207
1208
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1208
1209
  if (typeof bookingTicket.updateOrderProduct !== "function") throw new Error("[SalesSdk] Cart: updateOrderProduct 不可用");
1209
1210
  const result = yield bookingTicket.updateOrderProduct(params);
@@ -1211,11 +1212,11 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1211
1212
  return result;
1212
1213
  });
1213
1214
  return function(_x22) {
1214
- return _ref19.apply(this, arguments);
1215
+ return _ref20.apply(this, arguments);
1215
1216
  };
1216
1217
  }());
1217
1218
  const updateItems = (0, ahooks.useMemoizedFn)(function() {
1218
- var _ref20 = require_asyncToGenerator._asyncToGenerator(function* (paramsList, options) {
1219
+ var _ref21 = require_asyncToGenerator._asyncToGenerator(function* (paramsList, options) {
1219
1220
  var _bookingTicket$getTem7, _bookingTicket$getTem8;
1220
1221
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1221
1222
  if (!paramsList.length) return (_bookingTicket$getTem7 = (_bookingTicket$getTem8 = bookingTicket.getTempOrder) === null || _bookingTicket$getTem8 === void 0 || (_bookingTicket$getTem8 = _bookingTicket$getTem8.call(bookingTicket)) === null || _bookingTicket$getTem8 === void 0 ? void 0 : _bookingTicket$getTem8.products) !== null && _bookingTicket$getTem7 !== void 0 ? _bookingTicket$getTem7 : [];
@@ -1225,11 +1226,11 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1225
1226
  return result;
1226
1227
  });
1227
1228
  return function(_x23, _x24) {
1228
- return _ref20.apply(this, arguments);
1229
+ return _ref21.apply(this, arguments);
1229
1230
  };
1230
1231
  }());
1231
1232
  const updateItemQuantity = (0, ahooks.useMemoizedFn)(function() {
1232
- var _ref21 = require_asyncToGenerator._asyncToGenerator(function* (item, num) {
1233
+ var _ref22 = require_asyncToGenerator._asyncToGenerator(function* (item, num) {
1233
1234
  var _extend$product2, _extend3;
1234
1235
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1235
1236
  if (typeof bookingTicket.updateOrderProductQuantity !== "function") throw new Error("[SalesSdk] Cart: updateOrderProductQuantity 不可用");
@@ -1250,11 +1251,11 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1250
1251
  return result;
1251
1252
  });
1252
1253
  return function(_x25, _x26) {
1253
- return _ref21.apply(this, arguments);
1254
+ return _ref22.apply(this, arguments);
1254
1255
  };
1255
1256
  }());
1256
1257
  const editCartLineBooking$1 = (0, ahooks.useMemoizedFn)(function() {
1257
- var _ref24 = require_asyncToGenerator._asyncToGenerator(function* (item) {
1258
+ var _ref25 = require_asyncToGenerator._asyncToGenerator(function* (item) {
1258
1259
  var _bookingTicket$getPro5;
1259
1260
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1260
1261
  return require_editCartLineBooking.editCartLineBooking({
@@ -1266,31 +1267,31 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1266
1267
  bookingConfigParams: sales === null || sales === void 0 ? void 0 : sales.bookingConfigParams,
1267
1268
  updateItem,
1268
1269
  onSelectionCommitted: function() {
1269
- var _ref22 = require_asyncToGenerator._asyncToGenerator(function* () {
1270
+ var _ref23 = require_asyncToGenerator._asyncToGenerator(function* () {
1270
1271
  yield syncCartAfterMutation();
1271
1272
  });
1272
1273
  return function onSelectionCommitted() {
1273
- return _ref22.apply(this, arguments);
1274
+ return _ref23.apply(this, arguments);
1274
1275
  };
1275
1276
  }(),
1276
1277
  syncQuantityByRows: function() {
1277
- var _ref23 = require_asyncToGenerator._asyncToGenerator(function* (params) {
1278
+ var _ref24 = require_asyncToGenerator._asyncToGenerator(function* (params) {
1278
1279
  const result = yield require_syncBookingLineQuantityByRows.syncBookingLineQuantityByRows(require_objectSpread2._objectSpread2({ bookingTicket }, params));
1279
1280
  yield syncCartAfterMutation();
1280
1281
  return result;
1281
1282
  });
1282
1283
  return function syncQuantityByRows(_x27) {
1283
- return _ref23.apply(this, arguments);
1284
+ return _ref24.apply(this, arguments);
1284
1285
  };
1285
1286
  }()
1286
1287
  });
1287
1288
  });
1288
1289
  return function(_x28) {
1289
- return _ref24.apply(this, arguments);
1290
+ return _ref25.apply(this, arguments);
1290
1291
  };
1291
1292
  }());
1292
1293
  const editCartLineProduct$1 = (0, ahooks.useMemoizedFn)(function() {
1293
- var _ref25 = require_asyncToGenerator._asyncToGenerator(function* (item) {
1294
+ var _ref26 = require_asyncToGenerator._asyncToGenerator(function* (item) {
1294
1295
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1295
1296
  const result = yield require_editCartLineProduct.editCartLineProduct({
1296
1297
  item,
@@ -1306,18 +1307,18 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1306
1307
  };
1307
1308
  });
1308
1309
  return function(_x29) {
1309
- return _ref25.apply(this, arguments);
1310
+ return _ref26.apply(this, arguments);
1310
1311
  };
1311
1312
  }());
1312
1313
  const editCartLine = (0, ahooks.useMemoizedFn)(function() {
1313
- var _ref26 = require_asyncToGenerator._asyncToGenerator(function* (target) {
1314
+ var _ref27 = require_asyncToGenerator._asyncToGenerator(function* (target) {
1314
1315
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1315
1316
  const item = require_editCartLine.resolveEditCartLineTarget(target, snapshot.items);
1316
1317
  if (require_editCartLine.shouldEditCartLineAsBooking(item)) return editCartLineBooking$1(item);
1317
1318
  return editCartLineProduct$1(item);
1318
1319
  });
1319
1320
  return function(_x30) {
1320
- return _ref26.apply(this, arguments);
1321
+ return _ref27.apply(this, arguments);
1321
1322
  };
1322
1323
  }());
1323
1324
  /**
@@ -1327,7 +1328,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1327
1328
  * await selectGiftForItem(bookingRow);
1328
1329
  */
1329
1330
  const selectGiftForItem = (0, ahooks.useMemoizedFn)(function() {
1330
- var _ref27 = require_asyncToGenerator._asyncToGenerator(function* (target) {
1331
+ var _ref28 = require_asyncToGenerator._asyncToGenerator(function* (target) {
1331
1332
  var _mainItem$metadata, _mainItem$metadata2, _giftInfo$giftOptions, _promotion$strategyMe, _mainItem$giftData, _mainItem$giftData2;
1332
1333
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1333
1334
  const mainItem = require_editCartLine.resolveEditCartLineTarget(target, snapshot.items);
@@ -1355,7 +1356,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1355
1356
  yield syncCartAfterMutation();
1356
1357
  });
1357
1358
  return function(_x31) {
1358
- return _ref27.apply(this, arguments);
1359
+ return _ref28.apply(this, arguments);
1359
1360
  };
1360
1361
  }());
1361
1362
  const setOrderNote = (0, ahooks.useMemoizedFn)((note) => {
@@ -1365,24 +1366,24 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1365
1366
  return result;
1366
1367
  });
1367
1368
  const setLineNote = (0, ahooks.useMemoizedFn)(function() {
1368
- var _ref28 = require_asyncToGenerator._asyncToGenerator(function* (identity, note) {
1369
+ var _ref29 = require_asyncToGenerator._asyncToGenerator(function* (identity, note) {
1369
1370
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1370
1371
  const result = yield bookingTicket.setOrderProductLineNote(identity, note);
1371
1372
  yield syncCartAfterMutation({ skipSummarySync: true });
1372
1373
  return result;
1373
1374
  });
1374
1375
  return function(_x32, _x33) {
1375
- return _ref28.apply(this, arguments);
1376
+ return _ref29.apply(this, arguments);
1376
1377
  };
1377
1378
  }());
1378
1379
  const setDiscount = (0, ahooks.useMemoizedFn)(function() {
1379
- var _ref29 = require_asyncToGenerator._asyncToGenerator(function* (params) {
1380
+ var _ref30 = require_asyncToGenerator._asyncToGenerator(function* (params) {
1380
1381
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1381
1382
  yield bookingTicket.setDiscountSelected(params);
1382
1383
  yield syncCartAfterMutation();
1383
1384
  });
1384
1385
  return function(_x34) {
1385
- return _ref29.apply(this, arguments);
1386
+ return _ref30.apply(this, arguments);
1386
1387
  };
1387
1388
  }());
1388
1389
  const bestDiscount = (0, ahooks.useMemoizedFn)(require_asyncToGenerator._asyncToGenerator(function* () {
@@ -1414,7 +1415,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1414
1415
  yield syncCartAfterMutation();
1415
1416
  }));
1416
1417
  const loadDiscountConfig = (0, ahooks.useMemoizedFn)(function() {
1417
- var _ref30 = require_asyncToGenerator._asyncToGenerator(function* (params) {
1418
+ var _ref31 = require_asyncToGenerator._asyncToGenerator(function* (params) {
1418
1419
  var _bookingTicket$getTem9, _bookingTicket$getTem10, _params$customerId, _bookingTicket$getOrd3, _params$action, _bookingTicket$getOrd5, _bookingTicket$getDis5;
1419
1420
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1420
1421
  const liveTempOrder = (_bookingTicket$getTem9 = (_bookingTicket$getTem10 = bookingTicket.getTempOrder) === null || _bookingTicket$getTem10 === void 0 ? void 0 : _bookingTicket$getTem10.call(bookingTicket)) !== null && _bookingTicket$getTem9 !== void 0 ? _bookingTicket$getTem9 : snapshot.tempOrder;
@@ -1439,22 +1440,22 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1439
1440
  };
1440
1441
  });
1441
1442
  return function(_x35) {
1442
- return _ref30.apply(this, arguments);
1443
+ return _ref31.apply(this, arguments);
1443
1444
  };
1444
1445
  }());
1445
1446
  const scanCode = (0, ahooks.useMemoizedFn)(function() {
1446
- var _ref31 = require_asyncToGenerator._asyncToGenerator(function* (code, customerId) {
1447
+ var _ref32 = require_asyncToGenerator._asyncToGenerator(function* (code, customerId) {
1447
1448
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1448
1449
  const result = yield bookingTicket.scanPromotionCode(code, customerId);
1449
1450
  yield syncCartAfterMutation();
1450
1451
  return result;
1451
1452
  });
1452
1453
  return function(_x36, _x37) {
1453
- return _ref31.apply(this, arguments);
1454
+ return _ref32.apply(this, arguments);
1454
1455
  };
1455
1456
  }());
1456
1457
  const submit = (0, ahooks.useMemoizedFn)(function() {
1457
- var _ref32 = require_asyncToGenerator._asyncToGenerator(function* (params, options) {
1458
+ var _ref33 = require_asyncToGenerator._asyncToGenerator(function* (params, options) {
1458
1459
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1459
1460
  yield waitForCartConsistency();
1460
1461
  if (options === null || options === void 0 ? void 0 : options.validateHolder) {
@@ -1467,7 +1468,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
1467
1468
  return bookingTicket.submitSalesOrder(params);
1468
1469
  });
1469
1470
  return function(_x38, _x39) {
1470
- return _ref32.apply(this, arguments);
1471
+ return _ref33.apply(this, arguments);
1471
1472
  };
1472
1473
  }());
1473
1474
  const recalcSummary = (0, ahooks.useMemoizedFn)(require_asyncToGenerator._asyncToGenerator(function* () {
@@ -38,12 +38,12 @@ const Example = ({ product }: { product: ProductData }) => {
38
38
  ```tsx
39
39
  import type { SelectionFlowStepConfig } from '@pisell/private-materials';
40
40
 
41
- const steps = [
41
+ const steps: readonly SelectionFlowStepConfig[] = [
42
42
  { key: 'date', title: 'Date', modules: ['date'] },
43
43
  { key: 'sku', title: 'SKU', modules: ['sku'] },
44
44
  { key: 'booking', title: 'Booking', modules: ['time', 'resource'] },
45
45
  { key: 'holder', title: 'Holder', modules: ['holder'] },
46
- ] as const satisfies readonly SelectionFlowStepConfig[];
46
+ ];
47
47
 
48
48
  modalRef.current?.open({
49
49
  id: product.id,
@@ -2,27 +2,7 @@ import { ResolveSelectionFlowSteps, SelectionFlowStepConfig } from "./types.js";
2
2
 
3
3
  //#region src/pro/skuDetailModal/flow/presets.d.ts
4
4
  /** 用户端:每项选择能力独立成一步。 */
5
- declare const customerSteps: readonly [{
6
- readonly key: "date";
7
- readonly title: "pisell2.text.sku.detail.modal.step.date";
8
- readonly modules: readonly ["date"];
9
- }, {
10
- readonly key: "sku";
11
- readonly title: "pisell2.text.sku.detail.modal.step.sku";
12
- readonly modules: readonly ["sku"];
13
- }, {
14
- readonly key: "time";
15
- readonly title: "pisell2.text.sku.detail.modal.step.time";
16
- readonly modules: readonly ["time"];
17
- }, {
18
- readonly key: "resource";
19
- readonly title: "pisell2.text.sku.detail.modal.step.resource";
20
- readonly modules: readonly ["resource"];
21
- }, {
22
- readonly key: "holder";
23
- readonly title: "pisell2.text.sku.detail.modal.step.holder";
24
- readonly modules: readonly ["holder"];
25
- }];
5
+ declare const customerSteps: readonly SelectionFlowStepConfig[];
26
6
  /** POS:先完成日期与 SKU,再合并其余预约模块。 */
27
7
  declare const posSteps: readonly SelectionFlowStepConfig<string>[];
28
8
  /**
@@ -31,27 +11,7 @@ declare const posSteps: readonly SelectionFlowStepConfig<string>[];
31
11
  */
32
12
  declare const resolvePosSelectionFlowSteps: ResolveSelectionFlowSteps;
33
13
  declare const selectionFlowPresets: {
34
- readonly customer: readonly [{
35
- readonly key: "date";
36
- readonly title: "pisell2.text.sku.detail.modal.step.date";
37
- readonly modules: readonly ["date"];
38
- }, {
39
- readonly key: "sku";
40
- readonly title: "pisell2.text.sku.detail.modal.step.sku";
41
- readonly modules: readonly ["sku"];
42
- }, {
43
- readonly key: "time";
44
- readonly title: "pisell2.text.sku.detail.modal.step.time";
45
- readonly modules: readonly ["time"];
46
- }, {
47
- readonly key: "resource";
48
- readonly title: "pisell2.text.sku.detail.modal.step.resource";
49
- readonly modules: readonly ["resource"];
50
- }, {
51
- readonly key: "holder";
52
- readonly title: "pisell2.text.sku.detail.modal.step.holder";
53
- readonly modules: readonly ["holder"];
54
- }];
14
+ readonly customer: readonly SelectionFlowStepConfig<string>[];
55
15
  readonly pos: readonly SelectionFlowStepConfig<string>[];
56
16
  };
57
17
  type SelectionFlowPresetName = keyof typeof selectionFlowPresets;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.12.140",
3
+ "version": "6.12.142",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -69,8 +69,8 @@
69
69
  "react-zoom-pan-pinch": "^3.7.0",
70
70
  "styled-components": "^6.0.0-rc.3",
71
71
  "use-sync-external-store": "^1.6.0",
72
- "@pisell/utils": "3.0.4",
73
72
  "@pisell/materials": "6.12.38",
73
+ "@pisell/utils": "3.0.4",
74
74
  "@pisell/date-picker": "3.0.10",
75
75
  "@pisell/icon": "0.0.11"
76
76
  },