@pisell/private-materials 6.12.256 → 6.12.258

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 (29) 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.js +2 -2
  6. package/build/lowcode/view.js +2 -2
  7. package/es/components/venueBooking/components/Checkout/index.js +1 -1
  8. package/es/components/venueBooking/components/Content/index.js +1 -1
  9. package/es/components/venueBooking/components/Header/index.js +5 -5
  10. package/es/components/venueBooking/components/VenueSelection/components/CourtFilter.js +1 -1
  11. package/es/components/venueBooking/components/VenueSelection/components/DateNavigator.js +3 -3
  12. package/es/components/venueBooking/components/VenueSelection/components/DayTabs.js +2 -2
  13. package/es/components/venueBooking/components/VenueSelection/components/MonthPicker.js +4 -4
  14. package/es/components/venueBooking/components/VenueSelection/components/TimeGrid.js +14 -14
  15. package/es/components/venueBooking/components/VenueSelection/index.js +2 -2
  16. package/es/components/venueBooking/context.js +6 -7
  17. package/es/components/venueBooking/hooks.js +22 -16
  18. package/lib/components/venueBooking/components/Checkout/index.js +1 -1
  19. package/lib/components/venueBooking/components/Content/index.js +1 -1
  20. package/lib/components/venueBooking/components/Header/index.js +5 -5
  21. package/lib/components/venueBooking/components/VenueSelection/components/CourtFilter.js +1 -1
  22. package/lib/components/venueBooking/components/VenueSelection/components/DateNavigator.js +3 -3
  23. package/lib/components/venueBooking/components/VenueSelection/components/DayTabs.js +2 -2
  24. package/lib/components/venueBooking/components/VenueSelection/components/MonthPicker.js +4 -4
  25. package/lib/components/venueBooking/components/VenueSelection/components/TimeGrid.js +14 -14
  26. package/lib/components/venueBooking/components/VenueSelection/index.js +2 -2
  27. package/lib/components/venueBooking/context.js +6 -7
  28. package/lib/components/venueBooking/hooks.js +22 -16
  29. package/package.json +3 -3
@@ -182,16 +182,16 @@ function TimeGrid() {
182
182
  }
183
183
  if (isGridLoading || !grid || !timeLabels.length) return /* @__PURE__ */ react.default.createElement(TimeGridSkeleton, null);
184
184
  return /* @__PURE__ */ react.default.createElement("div", { className: "relative" }, /* @__PURE__ */ react.default.createElement("div", {
185
- className: "sticky z-30 overflow-hidden bg-[#fff7f7]",
185
+ className: "sticky z-30 overflow-hidden rounded-t-[28px] bg-[#fff7f7]",
186
186
  style: { top: "var(--vb-grid-sticky-top, 0px)" }
187
187
  }, /* @__PURE__ */ react.default.createElement("div", {
188
188
  ref: headerInnerRef,
189
- className: "grid border-b border-black/6",
189
+ className: "grid border-b border-black/[0.06]",
190
190
  style: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, tableGridStyle), {}, { willChange: "transform" }),
191
191
  key: `${grid.date}-header`
192
192
  }, /* @__PURE__ */ react.default.createElement("div", {
193
193
  ref: headerFixedColRef,
194
- className: "relative z-20 row-span-2 flex items-center gap-2 border-r border-black/6 bg-[#fff7f7] px-2 py-4 font-bold text-zinc-900 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4",
194
+ className: "relative z-20 row-span-2 flex items-center gap-2 border-r border-black/[0.06] bg-[#fff7f7] px-2 py-4 font-bold text-zinc-900 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4",
195
195
  style: { willChange: "transform" }
196
196
  }, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
197
197
  type: "pisell2-clock",
@@ -227,7 +227,7 @@ function TimeGrid() {
227
227
  }))), /* @__PURE__ */ react.default.createElement("div", {
228
228
  ref: scrollTableRef,
229
229
  onScroll: syncHeader,
230
- className: "max-w-full overflow-x-auto cursor-grab select-none touch-pan-y active:cursor-grabbing",
230
+ className: "max-w-full overflow-x-auto rounded-b-[28px] cursor-grab select-none touch-pan-y active:cursor-grabbing",
231
231
  style: require_objectSpread2._objectSpread2({ WebkitOverflowScrolling: "touch" }, scrollerOverscrollStyle)
232
232
  }, /* @__PURE__ */ react.default.createElement("div", {
233
233
  className: "w-full",
@@ -237,9 +237,9 @@ function TimeGrid() {
237
237
  const isMultiProduct = !!resource.hasMultipleProducts && Array.isArray(resource.products);
238
238
  const expanded = !!expandedResources[String(resource.resourceId)];
239
239
  return /* @__PURE__ */ react.default.createElement(react.default.Fragment, { key: `${resource.resourceId}-${grid.date}` }, /* @__PURE__ */ react.default.createElement("div", {
240
- className: "grid border-b border-black/6",
240
+ className: "grid border-b border-black/[0.06]",
241
241
  style: tableGridStyle
242
- }, /* @__PURE__ */ react.default.createElement("div", { className: `sticky left-0 z-10 border-r border-black/6 px-2 py-2 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4 ${courtMeta.soldOut ? "bg-zinc-50" : "bg-white"}` }, /* @__PURE__ */ react.default.createElement("div", { className: "flex items-start justify-between gap-2" }, /* @__PURE__ */ react.default.createElement("div", { className: "flex items-center gap-1.5" }, isMultiProduct ? /* @__PURE__ */ react.default.createElement("button", {
242
+ }, /* @__PURE__ */ react.default.createElement("div", { className: `sticky left-0 z-10 border-r border-black/[0.06] px-2 py-2 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4 ${courtMeta.soldOut ? "bg-zinc-50" : "bg-white"}` }, /* @__PURE__ */ react.default.createElement("div", { className: "flex items-start justify-between gap-2" }, /* @__PURE__ */ react.default.createElement("div", { className: "flex items-center gap-1.5" }, isMultiProduct ? /* @__PURE__ */ react.default.createElement("button", {
243
243
  type: "button",
244
244
  "data-cart-button": "true",
245
245
  onClick: (e) => {
@@ -303,9 +303,9 @@ function TimeGrid() {
303
303
  }), showPlusLabel ? /* @__PURE__ */ react.default.createElement("span", { className: `text-[13px] font-semibold leading-4 ${priceClass} md:text-sm` }, "+") : null), tag ? /* @__PURE__ */ react.default.createElement("div", { className: `inline-flex rounded-full px-1.5 py-0 text-[8px] font-semibold leading-4 ring-1 md:text-[9px] ${tag.className}` }, tagText) : null));
304
304
  })), isMultiProduct && expanded && resource.products.map((subRow) => /* @__PURE__ */ react.default.createElement("div", {
305
305
  key: `${resource.resourceId}-sub-${subRow.productId}`,
306
- className: "grid border-b border-black/6 bg-zinc-50/60",
306
+ className: "grid border-b border-black/[0.06] bg-zinc-50/60",
307
307
  style: tableGridStyle
308
- }, /* @__PURE__ */ react.default.createElement("div", { className: "sticky left-0 z-10 border-r border-black/6 bg-zinc-50/60 px-2 py-2 pl-8 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4 md:pl-10" }, /* @__PURE__ */ react.default.createElement("div", { className: "text-[12px] font-semibold leading-5 text-zinc-700 md:text-[13px]" }, subRow.productTitle)), subRow.slots.map((slot, slotIndex) => {
308
+ }, /* @__PURE__ */ react.default.createElement("div", { className: "sticky left-0 z-10 border-r border-black/[0.06] bg-zinc-50/60 px-2 py-2 pl-8 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4 md:pl-10" }, /* @__PURE__ */ react.default.createElement("div", { className: "text-[12px] font-semibold leading-5 text-zinc-700 md:text-[13px]" }, subRow.productTitle)), subRow.slots.map((slot, slotIndex) => {
309
309
  const isAvailable = slot.status === "available";
310
310
  const isUnavailable = slot.status === "occupied" || slot.status === "past" || slot.status === "unavailable";
311
311
  const timeLabel = timeLabels[slotIndex] || "";
@@ -355,12 +355,12 @@ function TimeGridSkeleton() {
355
355
  "aria-busy": "true",
356
356
  "aria-live": "polite"
357
357
  }, /* @__PURE__ */ react.default.createElement("div", {
358
- className: "sticky z-30 overflow-hidden bg-[#fff7f7]",
358
+ className: "sticky z-30 overflow-hidden rounded-t-[28px] bg-[#fff7f7]",
359
359
  style: { top: "var(--vb-grid-sticky-top, 0px)" }
360
360
  }, /* @__PURE__ */ react.default.createElement("div", {
361
- className: "grid border-b border-black/6",
361
+ className: "grid border-b border-black/[0.06]",
362
362
  style: { gridTemplateColumns: `120px repeat(${SKELETON_COLS}, minmax(90px, 1fr))` }
363
- }, /* @__PURE__ */ react.default.createElement("div", { className: "relative z-20 flex items-center gap-2 border-r border-black/6 bg-[#fff7f7] px-2 py-4 font-bold text-zinc-900 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4" }, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
363
+ }, /* @__PURE__ */ react.default.createElement("div", { className: "relative z-20 flex items-center gap-2 border-r border-black/[0.06] bg-[#fff7f7] px-2 py-4 font-bold text-zinc-900 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4" }, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
364
364
  type: "pisell2-clock",
365
365
  style: {
366
366
  fontSize: 16,
@@ -373,11 +373,11 @@ function TimeGridSkeleton() {
373
373
  }, /* @__PURE__ */ react.default.createElement("div", { className: "h-3 w-10 rounded bg-zinc-200/80" }), /* @__PURE__ */ react.default.createElement("span", {
374
374
  className: "vb-skeleton-shimmer",
375
375
  "aria-hidden": "true"
376
- }))))), /* @__PURE__ */ react.default.createElement("div", { className: "w-full" }, Array.from({ length: SKELETON_ROWS }).map((_, rowIdx) => /* @__PURE__ */ react.default.createElement("div", {
376
+ }))))), /* @__PURE__ */ react.default.createElement("div", { className: "w-full max-w-full overflow-hidden rounded-b-[28px]" }, Array.from({ length: SKELETON_ROWS }).map((_, rowIdx) => /* @__PURE__ */ react.default.createElement("div", {
377
377
  key: `sk-row-${rowIdx}`,
378
- className: "grid border-b border-black/6",
378
+ className: "grid border-b border-black/[0.06]",
379
379
  style: { gridTemplateColumns: `120px repeat(${SKELETON_COLS}, minmax(90px, 1fr))` }
380
- }, /* @__PURE__ */ react.default.createElement("div", { className: "sticky left-0 z-10 border-r border-black/6 bg-white px-2 py-4 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4" }, /* @__PURE__ */ react.default.createElement("div", { className: "relative overflow-hidden" }, /* @__PURE__ */ react.default.createElement("div", { className: "h-4 w-20 rounded bg-zinc-200/80 md:w-24" }), /* @__PURE__ */ react.default.createElement("div", { className: "mt-2 h-2.5 w-14 rounded bg-zinc-200/60 md:w-16" }), /* @__PURE__ */ react.default.createElement("span", {
380
+ }, /* @__PURE__ */ react.default.createElement("div", { className: "sticky left-0 z-10 border-r border-black/[0.06] bg-white px-2 py-4 shadow-[10px_0_16px_-14px_rgba(0,0,0,0.2)] md:px-4" }, /* @__PURE__ */ react.default.createElement("div", { className: "relative overflow-hidden" }, /* @__PURE__ */ react.default.createElement("div", { className: "h-4 w-20 rounded bg-zinc-200/80 md:w-24" }), /* @__PURE__ */ react.default.createElement("div", { className: "mt-2 h-2.5 w-14 rounded bg-zinc-200/60 md:w-16" }), /* @__PURE__ */ react.default.createElement("span", {
381
381
  className: "vb-skeleton-shimmer",
382
382
  "aria-hidden": "true"
383
383
  }))), Array.from({ length: SKELETON_COLS }).map((_, colIdx) => /* @__PURE__ */ react.default.createElement("div", {
@@ -39,7 +39,7 @@ function VenueSelection() {
39
39
  function goNextWeek() {
40
40
  navigateWeek(7);
41
41
  }
42
- return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: "rounded-b-[24px] bg-white p-3 shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6 md:rounded-[28px] md:p-6" }, /* @__PURE__ */ react.default.createElement("div", { className: "flex flex-col gap-2 xl:flex-row xl:items-center xl:justify-between" }, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("h2", { className: "text-2xl font-extrabold leading-tight text-zinc-900 md:text-[30px]" }, _pisell_utils.locales.getText("pisell2.venue.step1.title") || "选择场地"), /* @__PURE__ */ react.default.createElement("p", { className: "mt-1 text-xs leading-5 text-zinc-500 md:mt-2 md:text-sm md:leading-6" }, _pisell_utils.locales.getText("pisell2.venue.step1.subtitle") || "仅显示可用时段和价格。")), /* @__PURE__ */ react.default.createElement(require_DateNavigator.default, {
42
+ return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: "rounded-b-[24px] bg-white p-3 md:rounded-[28px] md:p-6" }, /* @__PURE__ */ react.default.createElement("div", { className: "flex flex-col gap-2 xl:flex-row xl:items-center xl:justify-between" }, /* @__PURE__ */ react.default.createElement("div", null, /* @__PURE__ */ react.default.createElement("h2", { className: "text-2xl font-extrabold leading-tight text-zinc-900 md:text-[30px]" }, _pisell_utils.locales.getText("pisell2.venue.step1.title") || "选择场地"), /* @__PURE__ */ react.default.createElement("p", { className: "mt-1 text-xs leading-5 text-zinc-500 md:mt-2 md:text-sm md:leading-6" }, _pisell_utils.locales.getText("pisell2.venue.step1.subtitle") || "仅显示可用时段和价格。")), /* @__PURE__ */ react.default.createElement(require_DateNavigator.default, {
43
43
  onPrevWeek: goPrevWeek,
44
44
  onNextWeek: goNextWeek
45
45
  })), /* @__PURE__ */ react.default.createElement("div", { className: "mt-3 md:mt-5" }, /* @__PURE__ */ react.default.createElement(require_DayTabs.default, {
@@ -47,7 +47,7 @@ function VenueSelection() {
47
47
  onNextWeek: goNextWeek
48
48
  })), /* @__PURE__ */ react.default.createElement(require_CourtFilter.default, null)), /* @__PURE__ */ react.default.createElement("div", {
49
49
  ref: tableSectionRef,
50
- className: "w-full max-w-full isolate rounded-[28px] bg-white shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6"
50
+ className: "w-full max-w-full isolate rounded-[28px] bg-white"
51
51
  }, /* @__PURE__ */ react.default.createElement(require_TimeGrid.default, null)));
52
52
  }
53
53
  //#endregion
@@ -204,14 +204,13 @@ function VenueBookingProvider({ entryContext, children }) {
204
204
  */
205
205
  const refreshViewModel = (0, react.useCallback)(function() {
206
206
  var _ref = require_asyncToGenerator._asyncToGenerator(function* (extraFields) {
207
- if (venueBookingModule && typeof venueBookingModule.getSummary === "function") try {
208
- yield venueBookingModule.getSummary();
207
+ try {
208
+ const moduleData = yield require_hooks.createVenueBookingViewModel(venueBookingModule);
209
+ setViewModel((prev) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), moduleData), extraFields || {}));
210
+ if (venueBookingModule && typeof venueBookingModule.getDiscountList === "function") setDiscountList(venueBookingModule.getDiscountList() || []);
209
211
  } catch (error) {
210
- console.warn("[venueBooking] getSummary failed during refreshViewModel", error);
212
+ console.warn("[venueBooking] refreshViewModel failed", error);
211
213
  }
212
- const moduleData = require_hooks.createVenueBookingViewModel(venueBookingModule);
213
- setViewModel((prev) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), moduleData), extraFields || {}));
214
- if (venueBookingModule && typeof venueBookingModule.getDiscountList === "function") setDiscountList(venueBookingModule.getDiscountList() || []);
215
214
  });
216
215
  return function(_x) {
217
216
  return _ref.apply(this, arguments);
@@ -623,7 +622,7 @@ function VenueBookingProvider({ entryContext, children }) {
623
622
  yield require_hooks.loadVenueProducts(venueBookingModule, require_hooks.VENUE_PRODUCT_IDS);
624
623
  const venueProducts = typeof (venueBookingModule === null || venueBookingModule === void 0 ? void 0 : venueBookingModule.getVenueProducts) === "function" ? venueBookingModule.getVenueProducts() : [];
625
624
  yield goToNearestAvailableDateRef.current(anchorDateRef.current);
626
- const moduleData = require_hooks.createVenueBookingViewModel(venueBookingModule);
625
+ const moduleData = yield require_hooks.createVenueBookingViewModel(venueBookingModule);
627
626
  if (!unmounted) {
628
627
  setViewModel((prev) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prev), {}, {
629
628
  cartItems: Array.isArray(moduleData.cartItems) ? moduleData.cartItems : [],
@@ -191,25 +191,31 @@ function getSelectedDateKeySet(module) {
191
191
  return selectedDateKeySet;
192
192
  }
193
193
  /**
194
- * 从 OS 模块快照构建 ViewModel(购物车部分)
194
+ * 等待 OS 金额汇总后,从模块快照构建 ViewModel(购物车部分)
195
195
  * 购物车数据使用 toShoppingCartProducts 转换为 ShoppingCart 组件所需格式
196
196
  */
197
- function createVenueBookingViewModel(module) {
198
- const orderProducts = callModuleGetter(module, "getOrderProducts", []);
199
- const summaryByGetter = callModuleGetter(module, "getSummary", null);
200
- const tempOrder = callModuleGetter(module, "getTempOrder", null);
201
- const amountSymbol = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.currency_symbol) || "$";
202
- const cartItems = require_toShoppingCartProducts.toShoppingCartProducts({
203
- orderProducts: Array.isArray(orderProducts) ? orderProducts : [],
204
- amountSymbol
197
+ function createVenueBookingViewModel(_x10) {
198
+ return _createVenueBookingViewModel.apply(this, arguments);
199
+ }
200
+ function _createVenueBookingViewModel() {
201
+ _createVenueBookingViewModel = require_asyncToGenerator._asyncToGenerator(function* (module) {
202
+ const summaryByGetter = typeof (module === null || module === void 0 ? void 0 : module.getSummary) === "function" ? yield module.getSummary() : null;
203
+ const orderProducts = callModuleGetter(module, "getOrderProducts", []);
204
+ const tempOrder = callModuleGetter(module, "getTempOrder", null);
205
+ const amountSymbol = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.currency_symbol) || "$";
206
+ const cartItems = require_toShoppingCartProducts.toShoppingCartProducts({
207
+ orderProducts: Array.isArray(orderProducts) ? orderProducts : [],
208
+ amountSymbol
209
+ });
210
+ const summary = (summaryByGetter && typeof summaryByGetter === "object" ? summaryByGetter : null) || (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.summary) || {};
211
+ return {
212
+ cartItems: Array.isArray(cartItems) ? cartItems : [],
213
+ summary: summary && typeof summary === "object" ? summary : {},
214
+ note: String((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.note) || ""),
215
+ contactsInfo: Array.isArray(tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.contacts_info) ? tempOrder.contacts_info : []
216
+ };
205
217
  });
206
- const summary = (summaryByGetter && typeof summaryByGetter === "object" ? summaryByGetter : null) || (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.summary) || {};
207
- return {
208
- cartItems: Array.isArray(cartItems) ? cartItems : [],
209
- summary: summary && typeof summary === "object" ? summary : {},
210
- note: String((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.note) || ""),
211
- contactsInfo: Array.isArray(tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.contacts_info) ? tempOrder.contacts_info : []
212
- };
218
+ return _createVenueBookingViewModel.apply(this, arguments);
213
219
  }
214
220
  /** 登录状态 hook(检查 token + 弹出登录弹窗) */
215
221
  function useVenueBookingLogin() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.12.256",
3
+ "version": "6.12.258",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -70,10 +70,10 @@
70
70
  "react-zoom-pan-pinch": "^3.7.0",
71
71
  "styled-components": "^6.0.0-rc.3",
72
72
  "use-sync-external-store": "^1.6.0",
73
- "@pisell/materials": "6.12.74",
73
+ "@pisell/utils": "3.0.7",
74
74
  "@pisell/pi-payment-sdk": "0.0.3",
75
+ "@pisell/materials": "6.12.74",
75
76
  "@pisell/icon": "0.0.11",
76
- "@pisell/utils": "3.0.7",
77
77
  "@pisell/date-picker": "3.0.12"
78
78
  },
79
79
  "peerDependencies": {