@pisell/private-materials 3.4.5 → 3.4.7

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 (157) 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 +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +4 -4
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/appointmentBooking/components/Cart/utils.js +8 -13
  12. package/es/components/appointmentBooking/components/Content/index.js +105 -19
  13. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  14. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  15. package/es/components/appointmentBooking/components/Services/index.js +7 -2
  16. package/es/components/appointmentBooking/components/TimeSlicing/index.js +7 -3
  17. package/es/components/appointmentBooking/components/Voucher/index.js +10 -10
  18. package/es/components/appointmentBooking/hooks.js +28 -30
  19. package/es/components/booking/addons/model.d.ts +1 -10
  20. package/es/components/booking/components/TabProduct/tabs/index.js +5 -1
  21. package/es/components/booking/components/browserSelect/index.js +1 -1
  22. package/es/components/booking/forms/model.d.ts +1 -10
  23. package/es/components/booking/forms/model.js +5 -5
  24. package/es/components/booking/info/dateRange/index.d.ts +0 -1
  25. package/es/components/booking/info/model.d.ts +1 -10
  26. package/es/components/booking/info/service/like/index.js +1 -1
  27. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  28. package/es/components/booking/materiels/holder/index.d.ts +1 -0
  29. package/es/components/booking/materiels/startTime/index.js +1 -1
  30. package/es/components/booking/model.d.ts +1 -9
  31. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  32. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  33. package/es/components/booking/notes/model.d.ts +1 -10
  34. package/es/components/booking/notes/model.js +5 -5
  35. package/es/components/booking/payments/model.d.ts +1 -10
  36. package/es/components/booking/payments/model.js +5 -5
  37. package/es/components/eftposPay/component/step/index.d.ts +0 -1
  38. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  39. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  40. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  41. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  42. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  43. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  44. package/es/components/listComponent/index.js +5 -5
  45. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  46. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  47. package/es/components/pay/toC/model.d.ts +1 -9
  48. package/es/components/productExtension/card/index.js +3 -3
  49. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  50. package/es/components/productExtension/fields/Forms/index.js +12 -12
  51. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  52. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  53. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  54. package/es/components/productExtension/server.js +2 -2
  55. package/es/components/productSelect/components/TabProduct/index.js +103 -39
  56. package/es/components/productSelect/components/TabProduct/tabs/index.less +1 -0
  57. package/es/components/productSelect/index.d.ts +2 -0
  58. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  59. package/es/components/schedules/calendar/index.js +4 -4
  60. package/es/components/schedules/calendar/serve.js +2 -2
  61. package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
  62. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  63. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  64. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  65. package/es/components/schedules/components/ResourceList/index.js +1 -1
  66. package/es/components/schedules/components/Search/index.js +5 -5
  67. package/es/components/schedules/model.d.ts +1 -9
  68. package/es/components/schedules/model.js +5 -5
  69. package/es/components/schedules/openHours/index.js +1 -1
  70. package/es/components/schedules/openHours/serve.js +2 -2
  71. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  72. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  73. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  74. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  75. package/es/components/schedules/products/index.d.ts +1 -0
  76. package/es/components/schedules/products/serve.js +2 -2
  77. package/es/components/schedules/products/utils.js +5 -5
  78. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  79. package/es/components/schedules/resources/detail/index.js +10 -10
  80. package/es/components/schedules/resources/list/index.js +2 -2
  81. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  82. package/es/components/schedules/resources/serve.js +2 -2
  83. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  84. package/es/components/schedules/utils.js +4 -4
  85. package/es/components/selectModal/index.js +2 -2
  86. package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -1
  87. package/es/components/wallet/Detail/model.d.ts +1 -13
  88. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  89. package/es/components/wallet/PointCard/model.d.ts +1 -13
  90. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  91. package/es/components/wallet/Voucher/model.d.ts +1 -13
  92. package/es/components/wallet/model.d.ts +1 -9
  93. package/es/components/walletList/index.js +4 -4
  94. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  95. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  96. package/es/hooks/useComponents.js +1 -1
  97. package/lib/components/appointmentBooking/components/Cart/utils.js +0 -10
  98. package/lib/components/appointmentBooking/components/Content/index.js +49 -7
  99. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  100. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  101. package/lib/components/appointmentBooking/components/Services/index.js +6 -1
  102. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +7 -3
  103. package/lib/components/appointmentBooking/components/Voucher/index.js +0 -11
  104. package/lib/components/appointmentBooking/hooks.js +5 -16
  105. package/lib/components/booking/addons/model.d.ts +1 -10
  106. package/lib/components/booking/forms/model.d.ts +1 -10
  107. package/lib/components/booking/info/dateRange/index.d.ts +0 -1
  108. package/lib/components/booking/info/model.d.ts +1 -10
  109. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  110. package/lib/components/booking/materiels/holder/index.d.ts +1 -0
  111. package/lib/components/booking/model.d.ts +1 -9
  112. package/lib/components/booking/notes/model.d.ts +1 -10
  113. package/lib/components/booking/payments/model.d.ts +1 -10
  114. package/lib/components/eftposPay/component/step/index.d.ts +0 -1
  115. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  116. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  117. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  118. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  119. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  120. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  121. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  122. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  123. package/lib/components/pay/toC/model.d.ts +1 -9
  124. package/lib/components/productSelect/components/TabProduct/index.js +74 -37
  125. package/lib/components/productSelect/components/TabProduct/tabs/index.less +1 -0
  126. package/lib/components/productSelect/index.d.ts +2 -0
  127. package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
  128. package/lib/components/schedules/model.d.ts +1 -9
  129. package/lib/components/schedules/products/index.d.ts +1 -0
  130. package/lib/components/schedules/utils.js +1 -1
  131. package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -1
  132. package/lib/components/wallet/Detail/model.d.ts +1 -13
  133. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  134. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  135. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  136. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  137. package/lib/components/wallet/model.d.ts +1 -9
  138. package/lib/components/walletList/index.js +3 -3
  139. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  140. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  141. package/package.json +3 -3
  142. package/es/components/appointmentBooking/components/Cart/utils.d.ts +0 -56
  143. package/es/components/booking/components/tabPane/index.d.ts +0 -4
  144. package/es/components/booking/hooks/useIsBooking4Shop.d.ts +0 -1
  145. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -7
  146. package/es/components/booking/info/index.d.ts +0 -4
  147. package/es/components/ticketBooking/locales.d.ts +0 -174
  148. package/es/components/ticketBooking/serve.d.ts +0 -287
  149. package/es/components/ticketBooking/utils/index.d.ts +0 -23
  150. package/lib/components/appointmentBooking/components/Cart/utils.d.ts +0 -56
  151. package/lib/components/booking/components/tabPane/index.d.ts +0 -4
  152. package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +0 -1
  153. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -7
  154. package/lib/components/booking/info/index.d.ts +0 -4
  155. package/lib/components/ticketBooking/locales.d.ts +0 -174
  156. package/lib/components/ticketBooking/serve.d.ts +0 -287
  157. package/lib/components/ticketBooking/utils/index.d.ts +0 -23
@@ -46,10 +46,14 @@ var import_Form = __toESM(require("../Form"));
46
46
  var import_ConfirmInformation = __toESM(require("../ConfirmInformation"));
47
47
  var import_context = require("../../context");
48
48
  var import_PolicyModal = __toESM(require("../../deposit/components/PolicyModal"));
49
+ var import_utils2 = require("../Resource/utils");
49
50
  var import_hooks = require("../../hooks");
50
51
  var import_index = require("./index.less");
52
+ var import_useComponents = __toESM(require("../../../../hooks/useComponents"));
53
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
54
+ var import_utils3 = require("../../utils");
51
55
  var Layout = () => {
52
- var _a, _b, _c, _d, _e;
56
+ var _a, _b, _c, _d, _e, _f;
53
57
  const stepRef = (0, import_react.useRef)();
54
58
  const {
55
59
  currentStep,
@@ -68,9 +72,37 @@ var Layout = () => {
68
72
  const { getHolders } = (0, import_hooks.useAppointmentBookingAccount)();
69
73
  const { removeStep } = (0, import_hooks.useAppointmentBookingStep)();
70
74
  const { shopDiscount } = (0, import_hooks.useShopDiscount)();
75
+ const { customPageData } = (_a = (0, import_useEngineContext.default)().engine) == null ? void 0 : _a.props;
76
+ const [CustomComponent] = (0, import_useComponents.default)({
77
+ components: ["CustomComponent"]
78
+ });
79
+ console.log("CustomComponent:", CustomComponent, typeof CustomComponent, CustomComponent == null ? void 0 : CustomComponent.$$typeof);
71
80
  (0, import_hooks.useAppointmentBookingCart)();
72
81
  (0, import_hooks.useAppointmentBookingStep)();
73
82
  const [params, setParams] = (0, import_react.useState)({});
83
+ const utils = (0, import_hooks.contextUtils)();
84
+ const context = (0, import_useEngineContext.default)();
85
+ const { pubsub } = context.appHelper.utils;
86
+ (0, import_react.useEffect)(() => {
87
+ const handleLoginSuccess = async () => {
88
+ var _a2;
89
+ if (!isFormSubject) {
90
+ const user = JSON.parse(((_a2 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a2.get("customer")) || "{}");
91
+ const currentUser = (0, import_utils3.formatCustomer)(user);
92
+ const accountLists = await appointmentBooking.getAccounts();
93
+ const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
94
+ appointmentBooking.setLoginAccount(meAccount == null ? void 0 : meAccount.id, currentUser);
95
+ } else {
96
+ if (!isRetailTemplate) {
97
+ getHolders();
98
+ }
99
+ }
100
+ };
101
+ pubsub.subscribe("pisell1.login.success", handleLoginSuccess);
102
+ return () => {
103
+ pubsub.unsubscribe("pisell1.login.success");
104
+ };
105
+ }, []);
74
106
  (0, import_react.useEffect)(() => {
75
107
  appointmentBooking.removeStep("fill-form");
76
108
  return () => {
@@ -115,6 +147,7 @@ var Layout = () => {
115
147
  }
116
148
  }, [isFormSubject, isLogin, isRetailTemplate]);
117
149
  (0, import_react.useEffect)(() => {
150
+ var _a2;
118
151
  if (!(currentStep == null ? void 0 : currentStep.step)) return;
119
152
  setLoading(false);
120
153
  setResourceOtherParams({
@@ -126,7 +159,10 @@ var Layout = () => {
126
159
  top: 0,
127
160
  behavior: "smooth"
128
161
  });
129
- }, [(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key]);
162
+ if (((_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key) === "confirm-information") {
163
+ (0, import_utils2.scrollToFirstErrorCard)(".pisell-lowcode-product-card-error");
164
+ }
165
+ }, [(_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key]);
130
166
  const components = {
131
167
  // 选择服务
132
168
  "select-service": import_Services.default,
@@ -151,8 +187,14 @@ var Layout = () => {
151
187
  } else {
152
188
  Com2 = components[key];
153
189
  }
154
- return /* @__PURE__ */ import_react.default.createElement(Com2, { onChange: setParams, params, ref: stepRef });
155
- }, [(_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.key]);
190
+ if (key === "select-service") {
191
+ return /* @__PURE__ */ import_react.default.createElement(CustomComponent, { block: customPageData == null ? void 0 : customPageData.block, customComponents: {
192
+ product_list: /* @__PURE__ */ import_react.default.createElement(Com2, { onChange: setParams, params, ref: stepRef })
193
+ } });
194
+ } else {
195
+ return /* @__PURE__ */ import_react.default.createElement(Com2, { onChange: setParams, params, ref: stepRef });
196
+ }
197
+ }, [(_c = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _c.key]);
156
198
  (0, import_react.useEffect)(() => {
157
199
  var _a2, _b2;
158
200
  if ((0, import_utils.isMobile)()) {
@@ -170,7 +212,7 @@ var Layout = () => {
170
212
  content.style.overflowY = "auto";
171
213
  }
172
214
  }
173
- }, [(_c = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _c.key]);
215
+ }, [(_d = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _d.key]);
174
216
  const isShowCartCom = (0, import_react.useMemo)(() => {
175
217
  var _a2;
176
218
  const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
@@ -182,14 +224,14 @@ var Layout = () => {
182
224
  var _a3, _b2;
183
225
  return (_b2 = (_a3 = stepRef == null ? void 0 : stepRef.current) == null ? void 0 : _a3.next) == null ? void 0 : _b2.call(_a3);
184
226
  } }));
185
- }, [isDateSelectedFirst, (_d = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _d.key]);
227
+ }, [isDateSelectedFirst, (_e = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _e.key]);
186
228
  const isFooter = (0, import_react.useMemo)(() => {
187
229
  var _a2;
188
230
  if (!(0, import_utils.isMobile)()) return false;
189
231
  const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
190
232
  if (isDateSelectedFirst && key === "select-date") return false;
191
233
  return key !== "confirm-information";
192
- }, [isDateSelectedFirst, (_e = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _e.key]);
234
+ }, [isDateSelectedFirst, (_f = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _f.key]);
193
235
  const depositProtocolRequest = (id) => {
194
236
  var _a2;
195
237
  return (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.getProtocol) == null ? void 0 : _a2.call(appointmentBooking, id);
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Footer: ({ onNext, isOpen }: any) => JSX.Element;
4
3
  export default Footer;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const GuestOptionsModal: (props: any) => JSX.Element;
4
3
  export default GuestOptionsModal;
@@ -171,12 +171,17 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
171
171
  }
172
172
  return (productListBlock == null ? void 0 : productListBlock.setting) || {};
173
173
  }, [context]);
174
+ const _isMobile = (0, import_react.useMemo)(() => {
175
+ if (typeof import_utils.isMobile === "function") return (0, import_utils.isMobile)();
176
+ return import_utils.isMobile;
177
+ }, import_utils.isMobile);
174
178
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-service-wrap" }, /* @__PURE__ */ import_react.default.createElement(
175
179
  import_productSelect.default,
176
180
  {
177
181
  dataSource: products,
178
182
  onChange: handleSelectProduct,
179
- scrollDom: (0, import_utils.isMobile)() ? ".parallel-content-wrap" : ".parallel-booking-wrap",
183
+ scrollDom: _isMobile ? ".parallel-content-wrap" : ".parallel-booking-wrap",
184
+ offsetDom: _isMobile ? "" : ".pisell-section-headers",
180
185
  loading: productLoading,
181
186
  emptyDescription: import_utils.locales.getText(
182
187
  "pisell2.appointment.booking.empty.service"
@@ -36,8 +36,9 @@ var import_react = __toESM(require("react"));
36
36
  var import_materials = require("@pisell/materials");
37
37
  var import_utils = require("@pisell/utils");
38
38
  var import_context = require("../../context");
39
+ var import_utils2 = require("../Resource/utils");
39
40
  var import_hooks = require("../../hooks");
40
- var import_utils2 = require("../../utils");
41
+ var import_utils3 = require("../../utils");
41
42
  var import_index = require("./index.less");
42
43
  var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
43
44
  const [selectedResource, setSelectedResource] = (0, import_react.useState)("");
@@ -54,7 +55,7 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
54
55
  next: () => {
55
56
  const isUnSelectedTimes = appointmentBooking.checkCartItems("date");
56
57
  if ((isUnSelectedTimes == null ? void 0 : isUnSelectedTimes.length) > 0) {
57
- (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unselect.time"));
58
+ (0, import_utils3.Toast)(import_utils.locales.getText("pisell2.appointment.unselect.time"));
58
59
  return;
59
60
  }
60
61
  nextStep();
@@ -65,11 +66,14 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
65
66
  }, []);
66
67
  const getAutoSelect = async (val) => {
67
68
  setSelectedTime(val);
69
+ (0, import_utils2.scrollToFirstErrorCard)(".pisell-lowcode-product-card-error");
68
70
  const result = await appointmentBooking.submitTimeSlot(val);
69
71
  };
70
72
  (0, import_react.useEffect)(() => {
71
73
  var _a, _b, _c;
72
- let appoimentBookingProductCart = carts.filter((item) => !appointmentBooking.isTargetCartIdNormalProduct(item == null ? void 0 : item._id));
74
+ let appoimentBookingProductCart = carts.filter(
75
+ (item) => !appointmentBooking.isTargetCartIdNormalProduct(item == null ? void 0 : item._id)
76
+ );
73
77
  if ((times == null ? void 0 : times.length) > 0 && (appoimentBookingProductCart == null ? void 0 : appoimentBookingProductCart.length) > 0) {
74
78
  const startTime = ((_a = appoimentBookingProductCart == null ? void 0 : appoimentBookingProductCart[0]) == null ? void 0 : _a.start_time) || ((_b = times == null ? void 0 : times[0]) == null ? void 0 : _b.start_time);
75
79
  setSelectedResource(startTime);
@@ -41,7 +41,6 @@ var import_utils = require("@pisell/utils");
41
41
  var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
42
42
  var import_materials = require("@pisell/materials");
43
43
  var import_hooks = require("../../hooks");
44
- var import_utils2 = require("../../utils");
45
44
  var import_voucher = require("../../../booking/components/voucher/index.less");
46
45
  var import_index = require("./index.less");
47
46
  var ShopDiscountHooks = {
@@ -154,16 +153,6 @@ var VoucherCard = (props) => {
154
153
  if (!action) return;
155
154
  openLoginModal({
156
155
  callback: (status) => {
157
- var _a2, _b2, _c;
158
- const user = (_c = (_b2 = (_a2 = utils.store) == null ? void 0 : _a2.getState()) == null ? void 0 : _b2.global) == null ? void 0 : _c.userInfo;
159
- const currentUser2 = (0, import_utils2.formatCustomer)(user);
160
- const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
161
- if (status === "success") {
162
- appointmentBooking.setLoginAccount(
163
- meAccount == null ? void 0 : meAccount.id,
164
- currentUser2
165
- );
166
- }
167
156
  }
168
157
  });
169
158
  }
@@ -265,23 +265,12 @@ var useAppointmentBookingStep = () => {
265
265
  };
266
266
  const checkLogin = async () => {
267
267
  if (!isLogin) {
268
- const accountLists = await appointmentBooking.getAccounts();
268
+ const { pubsub } = utils;
269
+ pubsub.once("pisell1.login.success", () => {
270
+ checkHolder();
271
+ });
269
272
  return openLoginModal({
270
273
  callback: (status) => {
271
- var _a3;
272
- if (status === "success") {
273
- if (!isFormSubject) {
274
- const user = JSON.parse(((_a3 = utils == null ? void 0 : utils.storage) == null ? void 0 : _a3.get("customer")) || "{}");
275
- const currentUser = (0, import_utils2.formatCustomer)(user);
276
- const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
277
- appointmentBooking.setLoginAccount(meAccount == null ? void 0 : meAccount.id, currentUser);
278
- } else {
279
- if (!isRetailTemplate) {
280
- getHolders();
281
- }
282
- }
283
- checkHolder();
284
- }
285
274
  }
286
275
  });
287
276
  } else {
@@ -390,7 +379,7 @@ var useAppointmentBookingLogin = () => {
390
379
  utils.action({
391
380
  type: "pisell1.login",
392
381
  data: {
393
- type: "plugin"
382
+ // type: 'plugin'
394
383
  },
395
384
  callback
396
385
  });
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  export declare const disabledDate: (current: any, position: any, currentDate: any) => any;
4
3
  declare const DateRange: ({ state, dispatch, key }: any) => JSX.Element;
@@ -1,14 +1,5 @@
1
- /// <reference types="react" />
2
- import { FormState } from '../model';
3
1
  export declare const walkInData: {
4
2
  id: number;
5
3
  nickname: string;
6
4
  };
7
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
- state: FormState;
9
- } & {
10
- dispatch: (params: {
11
- type: string;
12
- payload: any;
13
- }) => void;
14
- }>;
5
+ export declare const Provider: any, Context: any;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Lists: ({ onEdit, onChange }: any) => JSX.Element;
2
3
  export default Lists;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SelectProps } from 'antd';
2
3
  interface HolderProps extends SelectProps {
3
4
  selectProps?: SelectProps;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  amountSymbol: string;
4
3
  apis: {
@@ -105,11 +104,4 @@ export declare const walkInData: {
105
104
  id: number;
106
105
  nickname: string;
107
106
  };
108
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
109
- state: FormState;
110
- } & {
111
- dispatch: (params: {
112
- type: string;
113
- payload: any;
114
- }) => void;
115
- }>;
107
+ export declare const Provider: any, Context: any;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { StatusType } from '../../const';
3
2
  declare const _default: (props: {
4
3
  status: StatusType;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const ErrorTip: ({ text }: any) => JSX.Element;
4
3
  export default ErrorTip;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const InformationOptionsModal: (props: any) => JSX.Element;
4
3
  export default InformationOptionsModal;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type CallToBookProps = {
3
2
  show: boolean;
4
3
  type: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const WeekItem: (props: any) => JSX.Element;
4
3
  export default WeekItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare type CalenDateWeekProps = {
4
3
  currentDate: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CalendarDataItem } from '../../type';
3
2
  declare type CalendarItemProps = {
4
3
  month: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const SetupForm: ({ onReady, amount, order_id, payment_method, scene, }: any) => JSX.Element;
4
3
  export default SetupForm;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { WalletPassDataType } from '../../../PaymentMethods/WalletPass/serve';
3
2
  import './index.less';
4
3
  interface WalletUseListProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  platform: 'pc' | 'h5' | '' | undefined;
4
3
  order: any;
@@ -29,11 +28,4 @@ export interface PayGroup {
29
28
  pay_number?: string;
30
29
  _order: any;
31
30
  }
32
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
33
- state: FormState;
34
- } & {
35
- dispatch: (params: {
36
- type: string;
37
- payload: any;
38
- }) => void;
39
- }>;
31
+ export declare const Provider: any, Context: any;
@@ -39,7 +39,15 @@ var import_ahooks = require("ahooks");
39
39
  var import_utils = require("@pisell/utils");
40
40
  var import_tabs = __toESM(require("./tabs"));
41
41
  var import_productGroup = __toESM(require("../productGroup"));
42
- var io = null;
42
+ var getOffsetTopRelativeToScrollContainer = (targetElement, scrollContainer) => {
43
+ if (!targetElement || !scrollContainer) return 0;
44
+ if (targetElement === scrollContainer) {
45
+ return 0;
46
+ }
47
+ const targetRect = targetElement.getBoundingClientRect();
48
+ const containerRect = scrollContainer.getBoundingClientRect();
49
+ return targetRect.top - containerRect.top + scrollContainer.scrollTop;
50
+ };
43
51
  var TabProduct = (props) => {
44
52
  const {
45
53
  showTab = true,
@@ -48,6 +56,7 @@ var TabProduct = (props) => {
48
56
  onChange,
49
57
  amountSymbol = "$",
50
58
  scrollDom,
59
+ offsetDom,
51
60
  value: currentProductId,
52
61
  loading,
53
62
  emptyDescription,
@@ -55,6 +64,8 @@ var TabProduct = (props) => {
55
64
  } = props;
56
65
  const tabsRef = (0, import_react.useRef)();
57
66
  const [currentGroupId, setCurrentGroupId] = (0, import_react.useState)(1);
67
+ const tabLocatingRef = (0, import_react.useRef)(false);
68
+ const ioRef = (0, import_react.useRef)(null);
58
69
  (0, import_react.useEffect)(() => {
59
70
  if (list == null ? void 0 : list.length) {
60
71
  setCurrentGroupId(list[0].id);
@@ -62,6 +73,9 @@ var TabProduct = (props) => {
62
73
  handleObserver();
63
74
  });
64
75
  }
76
+ return () => {
77
+ handleUnobserver();
78
+ };
65
79
  }, [list]);
66
80
  const debouncedScroll = (0, import_ahooks.useDebounceFn)(
67
81
  (id) => {
@@ -75,18 +89,23 @@ var TabProduct = (props) => {
75
89
  const _marginTop = 270;
76
90
  const _marginBottom = window.innerHeight - 70 - 200 - 70;
77
91
  const _rootMargin = `${_marginTop * -1}px 0px ${_marginBottom * -1}px 0px`;
78
- io = new IntersectionObserver(
92
+ ioRef.current = new IntersectionObserver(
79
93
  (entries) => {
80
- var _a, _b;
94
+ var _a;
81
95
  const enteringEntries = entries.filter((entry) => entry.isIntersecting);
82
96
  if (enteringEntries.length > 0) {
83
97
  const topMostEntry = enteringEntries.reduce((top, current) => {
84
98
  return current.boundingClientRect.top < top.boundingClientRect.top ? current : top;
85
99
  });
86
- const [name, id] = (_b = (_a = topMostEntry == null ? void 0 : topMostEntry.target) == null ? void 0 : _a.id) == null ? void 0 : _b.split("-");
87
- const newGroupId = Number(id);
88
- setCurrentGroupId(newGroupId);
89
- debouncedScroll.run(id);
100
+ const targetId = (_a = topMostEntry == null ? void 0 : topMostEntry.target) == null ? void 0 : _a.id;
101
+ if (targetId) {
102
+ const [name, id] = targetId.split("-");
103
+ const newGroupId = Number(id);
104
+ if (!tabLocatingRef.current && !isNaN(newGroupId)) {
105
+ setCurrentGroupId(newGroupId);
106
+ debouncedScroll.run(id);
107
+ }
108
+ }
90
109
  }
91
110
  },
92
111
  {
@@ -94,24 +113,28 @@ var TabProduct = (props) => {
94
113
  rootMargin: _rootMargin
95
114
  }
96
115
  );
97
- if (list == null ? void 0 : list.length) {
116
+ if ((list == null ? void 0 : list.length) && ioRef.current) {
98
117
  for (const item of list) {
99
118
  const _item = document.querySelector(`#list-${item.id}`);
100
119
  if (_item) {
101
- io.observe(_item);
120
+ ioRef.current.observe(_item);
102
121
  }
103
122
  }
104
123
  }
105
124
  });
106
125
  const handleUnobserver = (0, import_ahooks.useMemoizedFn)(() => {
107
- if ((list == null ? void 0 : list.length) && io) {
126
+ if ((list == null ? void 0 : list.length) && ioRef.current) {
108
127
  for (const item of list) {
109
128
  const _item = document.querySelector(`#list-${item.id}`);
110
129
  if (_item) {
111
- io.unobserve(_item);
130
+ ioRef.current.unobserve(_item);
112
131
  }
113
132
  }
114
133
  }
134
+ if (ioRef.current) {
135
+ ioRef.current.disconnect();
136
+ ioRef.current = null;
137
+ }
115
138
  });
116
139
  const renderContent = () => {
117
140
  if (loading) {
@@ -126,7 +149,7 @@ var TabProduct = (props) => {
126
149
  );
127
150
  }
128
151
  return list.map((item, i) => {
129
- return /* @__PURE__ */ import_react.default.createElement("div", { id: `list-${item.id}`, key: i }, /* @__PURE__ */ import_react.default.createElement(
152
+ return /* @__PURE__ */ import_react.default.createElement("div", { id: `list-${item.id}`, key: `list-${item.id}` }, /* @__PURE__ */ import_react.default.createElement(
130
153
  import_productGroup.default,
131
154
  {
132
155
  onSelectProduct: onChange,
@@ -148,7 +171,7 @@ var TabProduct = (props) => {
148
171
  }
149
172
  ), /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-pisell-tabs-content" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton.Button, { active: true, size: "large", shape: "round" })));
150
173
  }, []);
151
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, showTab ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-product-select-tabs-wrapper" }, loading ? tabSkeleton : /* @__PURE__ */ import_react.default.createElement(
174
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, showTab && list && list.length > 1 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-product-select-tabs-wrapper" }, loading ? tabSkeleton : /* @__PURE__ */ import_react.default.createElement(
152
175
  import_tabs.default,
153
176
  {
154
177
  ref: tabsRef,
@@ -157,33 +180,47 @@ var TabProduct = (props) => {
157
180
  tab: currentGroupId,
158
181
  onChange: (e) => {
159
182
  var _a;
160
- let comWrapper = document.querySelector(
161
- ".pisell-product-select-wrapper"
162
- );
163
- let categoryDom = document.querySelector(
164
- ".pisell-product-select-tabs-wrapper"
165
- );
166
- let wrapperOffsetTop = comWrapper.offsetTop;
167
- let top = 0;
168
- if (categoryDom) {
169
- top = categoryDom.offsetHeight;
170
- }
171
- const dom = document == null ? void 0 : document.querySelector("#list-" + e);
172
- const main = document == null ? void 0 : document.querySelector(scrollDom);
173
- if (dom && main) {
174
- if (e === ((_a = list[0]) == null ? void 0 : _a.id)) {
175
- main.scrollTop = 0;
176
- } else {
177
- main.scrollTop = dom.offsetTop - top - wrapperOffsetTop;
183
+ try {
184
+ const productSelectWrapper = document.querySelector(
185
+ ".pisell-product-select-wrapper"
186
+ );
187
+ const tabsWrapper = document.querySelector(
188
+ ".pisell-product-select-tabs-wrapper"
189
+ );
190
+ let tabsHeight = 0;
191
+ if (tabsWrapper) {
192
+ tabsHeight = tabsWrapper.offsetHeight;
193
+ }
194
+ const targetListElement = document == null ? void 0 : document.querySelector("#list-" + e);
195
+ const scrollContainer = scrollDom ? document == null ? void 0 : document.querySelector(scrollDom) : null;
196
+ const offsetElement = offsetDom ? document == null ? void 0 : document.querySelector(offsetDom) : null;
197
+ const extraOffset = offsetElement ? offsetElement.clientHeight : 0;
198
+ handleUnobserver();
199
+ tabLocatingRef.current = true;
200
+ if (targetListElement && scrollContainer) {
201
+ if (e === ((_a = list[0]) == null ? void 0 : _a.id)) {
202
+ if (productSelectWrapper) {
203
+ const wrapperOffsetTop = getOffsetTopRelativeToScrollContainer(productSelectWrapper, scrollContainer);
204
+ scrollContainer.scrollTop = wrapperOffsetTop - extraOffset;
205
+ }
206
+ } else {
207
+ const listOffsetTop = getOffsetTopRelativeToScrollContainer(targetListElement, scrollContainer);
208
+ scrollContainer.scrollTop = listOffsetTop - tabsHeight - extraOffset;
209
+ }
178
210
  }
211
+ setCurrentGroupId(e);
212
+ debouncedScroll.run(e);
213
+ setTimeout(() => {
214
+ tabLocatingRef.current = false;
215
+ handleObserver();
216
+ }, 500);
217
+ } catch (error) {
218
+ console.error("Tab onChange error:", error);
219
+ tabLocatingRef.current = false;
220
+ setCurrentGroupId(e);
179
221
  }
180
- handleUnobserver();
181
- setCurrentGroupId(e);
182
- setTimeout(() => {
183
- handleObserver();
184
- }, 1e3);
185
222
  }
186
223
  }
187
- )) : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-product-select-product-list" }, renderContent()));
224
+ )) : /* @__PURE__ */ import_react.default.createElement("p", null, /* @__PURE__ */ import_react.default.createElement("br", null)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-product-select-product-list" }, renderContent()));
188
225
  };
189
226
  var TabProduct_default = TabProduct;
@@ -107,6 +107,7 @@
107
107
  text-overflow: ellipsis;
108
108
  overflow: hidden;
109
109
  white-space: nowrap;
110
+ user-select: none;
110
111
  }
111
112
 
112
113
  &:hover {
@@ -14,6 +14,8 @@ interface ProductSelectProps {
14
14
  value?: number;
15
15
  loading?: boolean;
16
16
  scrollDom?: string;
17
+ /** 某些设置了固定头部的情况 */
18
+ offsetDom?: string;
17
19
  style?: React.CSSProperties;
18
20
  emptyDescription?: string;
19
21
  token?: Partial<ProductSelectToken>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  declare type CurrentDayProps = {
3
4
  onClose: () => void;