@pisell/private-materials 6.2.25 → 6.2.27

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 (162) 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 +143 -159
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +8 -8
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
  12. package/es/components/booking/components/customSelect/index.js +1 -0
  13. package/es/components/booking/components/customiseItemModal/index.js +5 -1
  14. package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  15. package/es/components/booking/forms/table/index.d.ts +0 -1
  16. package/es/components/booking/hooks/useClearCart.js +11 -8
  17. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
  18. package/es/components/booking/info/client/index.js +3 -2
  19. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  20. package/es/components/booking/info/hooks/useInfoHolder.js +13 -14
  21. package/es/components/booking/info/index.d.ts +0 -1
  22. package/es/components/booking/info/service/Lists.js +37 -27
  23. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  24. package/es/components/booking/info/service/editService/constants.d.ts +1 -0
  25. package/es/components/booking/info/service/editService/constants.js +3 -0
  26. package/es/components/booking/info/service/editService/index.js +15 -10
  27. package/es/components/booking/info/service/like/index.d.ts +0 -1
  28. package/es/components/booking/info/service2/utils.js +29 -21
  29. package/es/components/booking/info2/index.js +1 -0
  30. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  31. package/es/components/booking/info2/service/addService/utils.js +6 -3
  32. package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
  33. package/es/components/booking/info2/service/editService/Resources/index.js +5 -0
  34. package/es/components/booking/info2/service/editService/index.js +265 -170
  35. package/es/components/booking/info2/service/index.js +22 -19
  36. package/es/components/booking/info2/utilsByBooking.js +2 -1
  37. package/es/components/booking/materiels/duration/index.js +9 -2
  38. package/es/components/booking/materiels/holder/index.d.ts +0 -1
  39. package/es/components/booking/materiels/startTime/index.d.ts +0 -1
  40. package/es/components/booking/utils.d.ts +2 -2
  41. package/es/components/eftpos/deviceList/index.d.ts +0 -1
  42. package/es/components/eftpos/form/index.d.ts +0 -1
  43. package/es/components/eftpos/group/index.d.ts +0 -1
  44. package/es/components/eftpos/hooks.d.ts +0 -1
  45. package/es/components/eftpos/icon/apiKey.d.ts +0 -1
  46. package/es/components/eftpos/icon/device.d.ts +0 -1
  47. package/es/components/eftpos/receipt/index.d.ts +0 -1
  48. package/es/components/eftpos/surcharge/index.d.ts +0 -1
  49. package/es/components/eftposPay/amount.d.ts +1 -1
  50. package/es/components/eftposPay/app.d.ts +0 -1
  51. package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
  52. package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
  53. package/es/components/eftposPay/component/step/index.d.ts +0 -1
  54. package/es/components/eftposPay/component/step/step.d.ts +0 -1
  55. package/es/components/eftposPay/device.d.ts +1 -1
  56. package/es/components/eftposPay/hooks.d.ts +2 -2
  57. package/es/components/eftposPay/store/index.d.ts +5 -5
  58. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  59. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  60. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  61. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  62. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  63. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  64. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  65. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  66. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  67. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  68. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  69. package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
  70. package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
  71. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  72. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  73. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  74. package/es/components/schedules/products/index.d.ts +0 -1
  75. package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
  76. package/es/components/shoppingCart/components/Cart/Product.js +77 -51
  77. package/es/components/shoppingCart/components/Cart/index.js +21 -18
  78. package/es/components/shoppingCart/components/Cart/index.less +14 -0
  79. package/es/components/ticketBooking/components/addServiceVariant/addService.js +171 -151
  80. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  81. package/es/components/ticketBooking/components/addServiceVariant/utils.js +4 -3
  82. package/es/components/ticketBooking/components/timeBar/index.js +77 -73
  83. package/es/components/ticketBooking/index.less +1 -1
  84. package/es/components/ticketBooking/utils/index.js +13 -8
  85. package/es/plus/clientName/index.d.ts +0 -1
  86. package/es/pro/pisellNumberSelector/index.less +1 -1
  87. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
  88. package/lib/components/booking/components/customSelect/index.js +1 -0
  89. package/lib/components/booking/components/customiseItemModal/index.js +7 -1
  90. package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
  91. package/lib/components/booking/forms/table/index.d.ts +0 -1
  92. package/lib/components/booking/hooks/useClearCart.js +16 -13
  93. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
  94. package/lib/components/booking/info/client/index.js +5 -4
  95. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  96. package/lib/components/booking/info/hooks/useInfoHolder.js +12 -13
  97. package/lib/components/booking/info/index.d.ts +0 -1
  98. package/lib/components/booking/info/service/Lists.js +36 -24
  99. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  100. package/lib/components/booking/info/service/editService/constants.d.ts +1 -0
  101. package/lib/components/booking/info/service/editService/constants.js +31 -0
  102. package/lib/components/booking/info/service/editService/index.js +7 -1
  103. package/lib/components/booking/info/service/like/index.d.ts +0 -1
  104. package/lib/components/booking/info/service2/utils.js +26 -17
  105. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  106. package/lib/components/booking/info2/service/addService/utils.js +4 -2
  107. package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
  108. package/lib/components/booking/info2/service/editService/Resources/index.js +2 -0
  109. package/lib/components/booking/info2/service/editService/index.js +138 -74
  110. package/lib/components/booking/info2/service/index.js +14 -10
  111. package/lib/components/booking/info2/utilsByBooking.js +2 -1
  112. package/lib/components/booking/materiels/duration/index.js +7 -2
  113. package/lib/components/booking/materiels/holder/index.d.ts +0 -1
  114. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  115. package/lib/components/booking/utils.d.ts +2 -2
  116. package/lib/components/eftpos/deviceList/index.d.ts +0 -1
  117. package/lib/components/eftpos/form/index.d.ts +0 -1
  118. package/lib/components/eftpos/group/index.d.ts +0 -1
  119. package/lib/components/eftpos/hooks.d.ts +0 -1
  120. package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
  121. package/lib/components/eftpos/icon/device.d.ts +0 -1
  122. package/lib/components/eftpos/receipt/index.d.ts +0 -1
  123. package/lib/components/eftpos/surcharge/index.d.ts +0 -1
  124. package/lib/components/eftposPay/amount.d.ts +1 -1
  125. package/lib/components/eftposPay/app.d.ts +0 -1
  126. package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
  127. package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
  128. package/lib/components/eftposPay/component/step/index.d.ts +0 -1
  129. package/lib/components/eftposPay/component/step/step.d.ts +0 -1
  130. package/lib/components/eftposPay/device.d.ts +1 -1
  131. package/lib/components/eftposPay/hooks.d.ts +2 -2
  132. package/lib/components/eftposPay/store/index.d.ts +5 -5
  133. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  134. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  135. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  136. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  137. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  138. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  139. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  140. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  141. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
  142. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
  143. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  144. package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
  145. package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
  146. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  147. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  148. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  149. package/lib/components/schedules/products/index.d.ts +0 -1
  150. package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
  151. package/lib/components/shoppingCart/components/Cart/Product.js +58 -31
  152. package/lib/components/shoppingCart/components/Cart/index.js +18 -15
  153. package/lib/components/shoppingCart/components/Cart/index.less +14 -0
  154. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +140 -122
  155. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  156. package/lib/components/ticketBooking/components/addServiceVariant/utils.js +2 -1
  157. package/lib/components/ticketBooking/components/timeBar/index.js +98 -94
  158. package/lib/components/ticketBooking/index.less +1 -1
  159. package/lib/components/ticketBooking/utils/index.js +4 -4
  160. package/lib/plus/clientName/index.d.ts +0 -1
  161. package/lib/pro/pisellNumberSelector/index.less +1 -1
  162. package/package.json +4 -4
@@ -251,7 +251,13 @@ var CustomiseItemModal = ({
251
251
  max: 999,
252
252
  step: 1,
253
253
  disabled,
254
- onChange: (value) => setQuantity(value),
254
+ onChange: (value) => {
255
+ if (value < 1) {
256
+ setQuantity(1);
257
+ } else {
258
+ setQuantity(value);
259
+ }
260
+ },
255
261
  size: "middle",
256
262
  enablePriceAdjust: true
257
263
  }
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const FormItemChildrenWrap: (props: any) => JSX.Element;
3
2
  export default FormItemChildrenWrap;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const Table: ({ value, onChange, field, mode, onAdd }: any) => JSX.Element;
4
3
  export default Table;
@@ -37,7 +37,7 @@ var import_classnames = __toESM(require("classnames"));
37
37
  var import_materials = require("@pisell/materials");
38
38
  var import_utils = require("@pisell/utils");
39
39
  var useClearCart = (state, dispatch) => {
40
- var _a, _b, _c, _d;
40
+ var _a, _b;
41
41
  const handleClear = () => {
42
42
  dispatch({
43
43
  type: "setService",
@@ -46,17 +46,20 @@ var useClearCart = (state, dispatch) => {
46
46
  }
47
47
  });
48
48
  };
49
- return !!((_b = (_a = state.service) == null ? void 0 : _a.value) == null ? void 0 : _b.length) && !state.channelDisabledEdit && /* @__PURE__ */ import_react.default.createElement(
50
- "span",
51
- {
52
- className: (0, import_classnames.default)("pisell-lowcode__booking-service-clear-btn", {
53
- ["pisell-lowcode__booking-service-clear-btn-disabled"]: !((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length)
54
- }),
55
- onClick: handleClear
56
- },
57
- /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-trash-01" }),
58
- " ",
59
- /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.booking.info.text.clear-cart"))
60
- );
49
+ return (0, import_react.useMemo)(() => {
50
+ var _a2, _b2, _c, _d;
51
+ return !!((_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.length) && !state.channelDisabledEdit && /* @__PURE__ */ import_react.default.createElement(
52
+ "span",
53
+ {
54
+ className: (0, import_classnames.default)("pisell-lowcode__booking-service-clear-btn", {
55
+ ["pisell-lowcode__booking-service-clear-btn-disabled"]: !((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length)
56
+ }),
57
+ onClick: handleClear
58
+ },
59
+ /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-trash-01" }),
60
+ " ",
61
+ /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.booking.info.text.clear-cart"))
62
+ );
63
+ }, [(_b = (_a = state.service) == null ? void 0 : _a.value) == null ? void 0 : _b.length, state.channelDisabledEdit]);
61
64
  };
62
65
  var useClearCart_default = useClearCart;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface AddServiceVariantProps {
3
2
  globalState: any;
4
3
  setGlobalState: any;
@@ -48,7 +48,7 @@ var import_utils3 = require("../clientVariant/utils");
48
48
  var import_useGetHolderList = __toESM(require("../hooks/useGetHolderList"));
49
49
  var isLoadClient = false;
50
50
  var Client = () => {
51
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
51
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
52
52
  const modalRef = (0, import_react.useRef)();
53
53
  const [loadLoading, setLoadLoading] = (0, import_react.useState)(false);
54
54
  const [loading, setLoading] = (0, import_react.useState)(false);
@@ -298,6 +298,7 @@ var Client = () => {
298
298
  )) : null;
299
299
  }, [loadLoading, params, state.client.clients.length]);
300
300
  const customSelect = (0, import_react.useMemo)(() => {
301
+ console.log("render customSelect");
301
302
  return /* @__PURE__ */ import_react.default.createElement(
302
303
  import_customSelect.default,
303
304
  {
@@ -340,7 +341,7 @@ var Client = () => {
340
341
  }
341
342
  }
342
343
  );
343
- }, [state, renderList, loading, franchiseeLoading, params.search, loadMore]);
344
+ }, [state.isTerminal, state.modalOpen, (_b = state.client) == null ? void 0 : _b.value, state.drawerMask, renderList, loading, franchiseeLoading, params.search, loadMore]);
344
345
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
345
346
  "div",
346
347
  {
@@ -357,11 +358,11 @@ var Client = () => {
357
358
  import_antd.Avatar,
358
359
  {
359
360
  className: "pisell-lowcode__booking-client-list-item-avatar",
360
- src: import_utils.image.ali((_b = state.client.value) == null ? void 0 : _b.cover, 100),
361
+ src: import_utils.image.ali((_c = state.client.value) == null ? void 0 : _c.cover, 100),
361
362
  icon: /* @__PURE__ */ import_react.default.createElement(import_User01.default, { className: "pisell-lowcode__booking-client-list-item-avatar-icon" })
362
363
  }
363
364
  ),
364
- /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-name" }, getNickname(state.client.value)), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in")) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((_c = state.client.value) == null ? void 0 : _c.email) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-email" }, (_d = state.client.value) == null ? void 0 : _d.email) : null, ((_e = state.client.value) == null ? void 0 : _e.phone) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-phone" }, (_f = state.client.value) == null ? void 0 : _f.phone) : null, !!((_h = (_g = state.client.value) == null ? void 0 : _g.waiver_form) == null ? void 0 : _h.length) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-waiver", title: (0, import_utils3.getWaiverTitle)((_i = state.client.value) == null ? void 0 : _i.waiver_form) }, (_l = (_k = (_j = state.client.value) == null ? void 0 : _j.waiver_form) == null ? void 0 : _k.map) == null ? void 0 : _l.call(_k, (item) => {
365
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-left" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-name" }, getNickname(state.client.value)), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in")) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((_d = state.client.value) == null ? void 0 : _d.email) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-email" }, (_e = state.client.value) == null ? void 0 : _e.email) : null, ((_f = state.client.value) == null ? void 0 : _f.phone) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-phone" }, (_g = state.client.value) == null ? void 0 : _g.phone) : null, !!((_i = (_h = state.client.value) == null ? void 0 : _h.waiver_form) == null ? void 0 : _i.length) && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-waiver", title: (0, import_utils3.getWaiverTitle)((_j = state.client.value) == null ? void 0 : _j.waiver_form) }, (_m = (_l = (_k = state.client.value) == null ? void 0 : _k.waiver_form) == null ? void 0 : _l.map) == null ? void 0 : _m.call(_l, (item) => {
365
366
  return /* @__PURE__ */ import_react.default.createElement("span", null, item.form_title, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-client-waiver-colon" }, ":"), item.is_filled ? /* @__PURE__ */ import_react.default.createElement(
366
367
  "span",
367
368
  {
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useIsLowSpeedNetwork: () => import("react").MutableRefObject<boolean>;
3
2
  export default useIsLowSpeedNetwork;
@@ -32,6 +32,7 @@ __export(useInfoHolder_exports, {
32
32
  default: () => useInfoHolder_default
33
33
  });
34
34
  module.exports = __toCommonJS(useInfoHolder_exports);
35
+ var import_ahooks = require("ahooks");
35
36
  var import_react = require("react");
36
37
  var import_useHolderConfig = __toESM(require("./useHolderConfig"));
37
38
  var import_utils = require("../utils");
@@ -58,24 +59,22 @@ var useInfoHolder = (state, dispatch) => {
58
59
  const showAddTimeModal = (0, import_react.useMemo)(() => {
59
60
  return (0, import_utils.isOpenAddTime)(state);
60
61
  }, [state, appointment_card.quick_time]);
61
- const handleEdit = (cacheItem, type) => {
62
- setTimeout(() => {
63
- var _a2, _b2, _c2;
64
- const isNoSpecAndPackage = (0, import_utilsByBooking.getIsNoSpecAndPackage)(cacheItem);
65
- if (isNoSpecAndPackage) {
66
- (_a2 = editNormalServiceRef.current) == null ? void 0 : _a2.init(cacheItem);
67
- } else {
68
- (_c2 = (_b2 = detailRef.current) == null ? void 0 : _b2.init) == null ? void 0 : _c2.call(_b2, cacheItem, false, type === "edit_product");
69
- }
70
- }, 100);
71
- };
62
+ const handleEdit = (0, import_ahooks.useMemoizedFn)((cacheItem, type) => {
63
+ var _a2, _b2, _c2;
64
+ const isNoSpecAndPackage = (0, import_utilsByBooking.getIsNoSpecAndPackage)(cacheItem);
65
+ if (isNoSpecAndPackage) {
66
+ (_a2 = editNormalServiceRef.current) == null ? void 0 : _a2.init(cacheItem);
67
+ } else {
68
+ (_c2 = (_b2 = detailRef.current) == null ? void 0 : _b2.init) == null ? void 0 : _c2.call(_b2, cacheItem, false, type === "edit_product");
69
+ }
70
+ });
72
71
  const dispatchService = (type, payload) => {
73
72
  dispatch({
74
73
  type,
75
74
  payload: { ...payload }
76
75
  });
77
76
  };
78
- const handleAction = (dataSource) => {
77
+ const handleAction = (0, import_ahooks.useMemoizedFn)((dataSource) => {
79
78
  const cacheItem = (0, import_utils2.getProductExtend)({
80
79
  cacheItem: { ...dataSource._origin, new: 0 },
81
80
  state
@@ -87,7 +86,7 @@ var useInfoHolder = (state, dispatch) => {
87
86
  cacheItem
88
87
  }
89
88
  });
90
- };
89
+ });
91
90
  return {
92
91
  detailRef,
93
92
  handleEdit,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { InfoProps } from './main';
3
2
  declare const APP: (props: InfoProps) => JSX.Element;
4
3
  export default APP;
@@ -48,10 +48,12 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
48
48
  const { handleAddHolder } = (0, import_useAddHolder.default)(state, dispatch);
49
49
  const handleChange = (0, import_ahooks.useMemoizedFn)(
50
50
  (currentItem, type, other) => {
51
+ console.time("handleChange");
52
+ console.log(window.pp1 = performance.now(), "打开商品");
51
53
  if (state.disabledEdit || state.disableEventBookingEdit) {
52
54
  return;
53
55
  }
54
- let products = (0, import_utils.updateServices)(state, currentItem, type, other, {
56
+ let products2 = (0, import_utils.updateServices)(state, currentItem, type, other, {
55
57
  handleAddHolder
56
58
  });
57
59
  if (type === "view" || type === "edit_product") {
@@ -64,11 +66,11 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
64
66
  });
65
67
  }
66
68
  onChange({ editModal: true, cacheItem });
67
- return onEdit == null ? void 0 : onEdit({ ...product, new: 0 }, type);
69
+ return onEdit == null ? void 0 : onEdit(cacheItem, type);
68
70
  }
69
71
  const params = {
70
72
  editModal: false,
71
- value: products,
73
+ value: products2,
72
74
  edit: true,
73
75
  cacheItem: null
74
76
  };
@@ -98,27 +100,37 @@ var Lists = ({ onEdit, onChange, onAction, isParallelResource }) => {
98
100
  state.isBookingCreatePage,
99
101
  state.bookingConfig
100
102
  ]);
101
- return /* @__PURE__ */ import_react.default.createElement(import_Provider.CartContext.Provider, { value: { state } }, /* @__PURE__ */ import_react.default.createElement(
102
- import_shoppingCart.default,
103
- {
104
- scenario: state.isBookingTicket2 ? "booking2" : void 0,
105
- isParallelResource,
106
- onAction,
107
- onChange: handleChange,
108
- isOpenGroup: false,
109
- isHideClearCart: true,
110
- onAddProduct: () => onChange({ addModal: true }),
111
- productParams: {
112
- ...productParams,
113
- products: (0, import_utils.formatProducts)(
114
- ((_a = state == null ? void 0 : state.service) == null ? void 0 : _a.value) || [],
115
- state,
116
- false,
117
- true,
118
- isParallelResource
119
- )
103
+ const products = (0, import_react.useMemo)(() => {
104
+ var _a2;
105
+ console.time("products");
106
+ const p = (0, import_utils.formatProducts)(
107
+ ((_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.value) || [],
108
+ state,
109
+ false,
110
+ true,
111
+ isParallelResource
112
+ );
113
+ console.timeEnd("products");
114
+ return p;
115
+ }, [(_a = state == null ? void 0 : state.service) == null ? void 0 : _a.value, state]);
116
+ return (0, import_react.useMemo)(() => {
117
+ console.log("render List");
118
+ return /* @__PURE__ */ import_react.default.createElement(import_Provider.CartContext.Provider, { value: { state } }, /* @__PURE__ */ import_react.default.createElement(
119
+ import_shoppingCart.default,
120
+ {
121
+ scenario: state.isBookingTicket2 ? "booking2" : void 0,
122
+ isParallelResource,
123
+ onAction,
124
+ onChange: handleChange,
125
+ isOpenGroup: false,
126
+ isHideClearCart: true,
127
+ onAddProduct: () => onChange({ addModal: true }),
128
+ productParams: {
129
+ ...productParams,
130
+ products
131
+ }
120
132
  }
121
- }
122
- ));
133
+ ));
134
+ }, [products, state, productParams]);
123
135
  };
124
136
  var Lists_default = Lists;
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: any;
9
+ locale: string;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -0,0 +1 @@
1
+ export declare const getIsPartyRoomResourceShop: (id: number) => boolean;
@@ -0,0 +1,31 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/booking/info/service/editService/constants.ts
20
+ var constants_exports = {};
21
+ __export(constants_exports, {
22
+ getIsPartyRoomResourceShop: () => getIsPartyRoomResourceShop
23
+ });
24
+ module.exports = __toCommonJS(constants_exports);
25
+ var getIsPartyRoomResourceShop = (id) => {
26
+ return [2155, 9].includes(id);
27
+ };
28
+ // Annotate the CommonJS export names for ESM import in node:
29
+ 0 && (module.exports = {
30
+ getIsPartyRoomResourceShop
31
+ });
@@ -57,10 +57,13 @@ var import_like = __toESM(require("../like"));
57
57
  var import_utils7 = require("../../utils");
58
58
  var import_serviceManager = require("../serviceManager");
59
59
  var import_EditTabs = __toESM(require("./EditTabs"));
60
+ var import_constants = require("./constants");
61
+ var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
60
62
  var submitLock = false;
61
63
  var Info = (_, ref) => {
62
64
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
63
65
  const [form] = import_antd.Form.useForm();
66
+ const context = (0, import_useEngineContext.default)();
64
67
  const useTotal = import_antd.Form.useWatch("total", form);
65
68
  const useLikeStatus = import_antd.Form.useWatch("like_status", form);
66
69
  const useResource = import_antd.Form.useWatch("resource", form);
@@ -354,6 +357,7 @@ var Info = (_, ref) => {
354
357
  });
355
358
  }, [(_q = (_p = (_o = state.service) == null ? void 0 : _o.cacheItem) == null ? void 0 : _p._extend) == null ? void 0 : _q.multi_day]);
356
359
  const getResourcesData = async () => {
360
+ var _a2, _b2, _c2, _d2, _e2;
357
361
  setResourceLoading(true);
358
362
  try {
359
363
  let params = {};
@@ -373,10 +377,12 @@ var Info = (_, ref) => {
373
377
  } else {
374
378
  params.with_date_times = state.date.value.format("YYYY-MM-DD");
375
379
  }
380
+ const isPartyRoomResourceShop = (0, import_constants.getIsPartyRoomResourceShop)((_e2 = (_d2 = (_c2 = (_b2 = (_a2 = context.appHelper.utils.store) == null ? void 0 : _a2.getState) == null ? void 0 : _b2.call(_a2)) == null ? void 0 : _c2.global) == null ? void 0 : _d2.globalConfig) == null ? void 0 : _e2.id);
381
+ const codes = isPartyRoomResourceShop ? ["resources", "therapist", "table", "party_room"] : ["resources", "therapist", "table"];
376
382
  let data = await state.apis.getResources({
377
383
  skip: 1,
378
384
  num: 1e3,
379
- codes: ["resources", "therapist", "table"],
385
+ codes,
380
386
  _config: { abort: true },
381
387
  ...params
382
388
  });
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  declare const Like: ({ status, onChange, className, style, }: {
4
3
  style?: any;
@@ -317,6 +317,15 @@ var updateServices = (state, currentItem, type, other, actions) => {
317
317
  products = handleChangeResource(products, currentItem, other, state);
318
318
  return products;
319
319
  }
320
+ if (type === "num") {
321
+ return products.map((product) => {
322
+ if (product._id === currentItem._id) {
323
+ product._extend.quantity = other.num;
324
+ return product;
325
+ }
326
+ return product;
327
+ });
328
+ }
320
329
  if (type === "update_holders") {
321
330
  products = products == null ? void 0 : products.map((item) => {
322
331
  var _a2;
@@ -590,25 +599,25 @@ var formatProducts = (lists, state, isRenderGroup = true, isGeneral, isParallelR
590
599
  _origin: item
591
600
  };
592
601
  };
593
- lists.forEach((item) => {
594
- var _a;
595
- if (!((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId)) {
596
- normalList.push(formItem(item));
597
- } else {
598
- groupList.push(item);
599
- }
600
- });
601
- let groups = groupList.reduce((prev, item) => {
602
- var _a;
603
- const groupId = (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId;
604
- if (!prev[groupId]) {
605
- prev[groupId] = [];
606
- }
607
- prev[groupId].push(item);
608
- return prev;
609
- }, {});
610
602
  console.log(normalList, "normalList");
611
603
  if (isRenderGroup) {
604
+ lists.forEach((item) => {
605
+ var _a;
606
+ if (!((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId)) {
607
+ normalList.push(formItem(item));
608
+ } else {
609
+ groupList.push(item);
610
+ }
611
+ });
612
+ let groups = groupList.reduce((prev, item) => {
613
+ var _a;
614
+ const groupId = (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId;
615
+ if (!prev[groupId]) {
616
+ prev[groupId] = [];
617
+ }
618
+ prev[groupId].push(item);
619
+ return prev;
620
+ }, {});
612
621
  return Object.values(groups).map((d) => formItem((0, import_utils3.concatBookings)(d))).concat(normalList);
613
622
  } else {
614
623
  return lists == null ? void 0 : lists.map((item) => formItem(item));
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
7
7
  type: string;
8
8
  value: number;
9
9
  };
10
- locale: any;
10
+ locale: string;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -142,7 +142,8 @@ var getTimeObj = ({
142
142
  cacheItem,
143
143
  useStartTime,
144
144
  currentResource,
145
- state,
145
+ // 没有使用该参数
146
+ // state,
146
147
  durationProps
147
148
  });
148
149
  let obj = (0, import_utils.sliceDayIntoFiveMinutes)(
@@ -242,7 +243,8 @@ var setDefaultResource = ({ cacheItem, resources }) => {
242
243
  }
243
244
  const defaultResource = defaultOriginalResource.map((d) => {
244
245
  return {
245
- ...d,
246
+ // ...d,
247
+ children: d.children,
246
248
  relation_type: d.relation_type,
247
249
  form_id: item.form_id,
248
250
  relation_id: d.id,
@@ -65,6 +65,7 @@ var AddTimeModal = () => {
65
65
  const [number, setNumber] = (0, import_react.useState)(1);
66
66
  const originServices = (0, import_react.useRef)([]);
67
67
  const [renderList, setRenderList] = (0, import_react.useState)([]);
68
+ console.log(renderList, "renderListrenderList");
68
69
  const context = (0, import_useEngineContext.default)();
69
70
  const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
70
71
  const statusMap = {
@@ -126,6 +127,7 @@ var AddTimeModal = () => {
126
127
  }
127
128
  return arr.filter(Boolean);
128
129
  }, [(_f = (_e = (_d = state.service) == null ? void 0 : _d.cacheItem) == null ? void 0 : _e._extend) == null ? void 0 : _f.resource]);
130
+ console.log(currentResource, "currentResource");
129
131
  const getTimeUsableStatus = (time) => {
130
132
  var _a2, _b2;
131
133
  if (!((_a2 = state.service.cacheItem) == null ? void 0 : _a2._extend) || !currentResource.length) {
@@ -206,6 +208,7 @@ var AddTimeModal = () => {
206
208
  setLoading("list");
207
209
  const newList = await _getAddTimeProducts();
208
210
  let list = newList.map((d) => {
211
+ debugger;
209
212
  let isUsable = (0, import_utils2.isUsableProduct)(d.add_time, state.service.cacheItem);
210
213
  return {
211
214
  ...d,
@@ -168,9 +168,11 @@ var Resources = ({
168
168
  const getIsAutoAllocation = (id) => {
169
169
  return (0, import_utils2.getAutoAllocationStorage)(id);
170
170
  };
171
+ console.log("resourcesss");
171
172
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, data.map((item) => {
172
173
  var _a2;
173
174
  const cur = _value[item.form_id];
175
+ console.log(cur, "curcur");
174
176
  const errors = (cur || []).reduce((pre, d) => {
175
177
  return pre.concat((d == null ? void 0 : d.errors) || []);
176
178
  }, []);