@pisell/private-materials 3.3.68 → 3.3.69

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 (85) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +3 -3
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +5 -5
  9. package/es/components/appointmentBooking/components/Cart/Item/index.js +4 -2
  10. package/es/components/appointmentBooking/components/Services/index.js +25 -32
  11. package/es/components/appointmentBooking/components/Voucher/index.js +13 -0
  12. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +6 -7
  13. package/es/components/appointmentBooking/locales.js +3 -3
  14. package/es/components/booking/addons/index.js +9 -2
  15. package/es/components/booking/addons/model.js +5 -0
  16. package/es/components/booking/components/TabProduct/selectProductItem/index.js +3 -1
  17. package/es/components/booking/components/TabProduct/selectProductItem/index.less +6 -0
  18. package/es/components/booking/components/footer/index.js +9 -3
  19. package/es/components/booking/components/footer/utils.js +73 -35
  20. package/es/components/booking/components/voucher/index.js +110 -66
  21. package/es/components/booking/components/voucher/utils.d.ts +4 -0
  22. package/es/components/booking/components/voucher/utils.js +15 -0
  23. package/es/components/booking/hooks/useQuotation.d.ts +1 -0
  24. package/es/components/booking/hooks/useQuotation.js +16 -1
  25. package/es/components/booking/info/service2/utils.d.ts +1 -1
  26. package/es/components/booking/info/service2/utils.js +6 -2
  27. package/es/components/booking/info2/index.js +9 -4
  28. package/es/components/booking/info2/serve.d.ts +1 -1
  29. package/es/components/booking/info2/serve.js +12 -8
  30. package/es/components/booking/info2/service/addService/index.js +2 -2
  31. package/es/components/booking/info2/service/editService/index.js +5 -2
  32. package/es/components/booking/info2/utils.d.ts +1 -1
  33. package/es/components/booking/info2/utils.js +3 -2
  34. package/es/components/booking/info2/utilsByBooking.d.ts +1 -1
  35. package/es/components/booking/info2/utilsByBooking.js +5 -3
  36. package/es/components/booking/locales.d.ts +3 -0
  37. package/es/components/booking/locales.js +6 -3
  38. package/es/components/booking/utils.d.ts +2 -2
  39. package/es/components/eftposPay/amount.d.ts +1 -1
  40. package/es/components/eftposPay/device.d.ts +1 -1
  41. package/es/components/eftposPay/hooks.d.ts +2 -2
  42. package/es/components/eftposPay/store/index.d.ts +5 -5
  43. package/es/components/ticketBooking/components/addServiceVariant/addService.js +5 -4
  44. package/es/components/ticketBooking/components/ticketBooking/index.js +4 -2
  45. package/es/components/ticketBooking/utils/index.d.ts +5 -1
  46. package/es/components/ticketBooking/utils/index.js +50 -5
  47. package/lib/components/appointmentBooking/components/Cart/Item/index.js +5 -4
  48. package/lib/components/appointmentBooking/components/Services/index.js +6 -14
  49. package/lib/components/appointmentBooking/components/Voucher/index.js +9 -0
  50. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +0 -1
  51. package/lib/components/appointmentBooking/locales.js +3 -3
  52. package/lib/components/booking/addons/index.js +10 -2
  53. package/lib/components/booking/addons/model.js +3 -0
  54. package/lib/components/booking/components/TabProduct/selectProductItem/index.js +5 -1
  55. package/lib/components/booking/components/TabProduct/selectProductItem/index.less +6 -0
  56. package/lib/components/booking/components/footer/index.js +10 -5
  57. package/lib/components/booking/components/footer/utils.js +47 -11
  58. package/lib/components/booking/components/voucher/index.js +111 -67
  59. package/lib/components/booking/components/voucher/utils.d.ts +4 -0
  60. package/lib/components/booking/components/voucher/utils.js +43 -0
  61. package/lib/components/booking/hooks/useQuotation.d.ts +1 -0
  62. package/lib/components/booking/hooks/useQuotation.js +19 -1
  63. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  64. package/lib/components/booking/info/service2/utils.js +3 -1
  65. package/lib/components/booking/info2/index.js +9 -9
  66. package/lib/components/booking/info2/serve.d.ts +1 -1
  67. package/lib/components/booking/info2/serve.js +1 -1
  68. package/lib/components/booking/info2/service/addService/index.js +2 -2
  69. package/lib/components/booking/info2/service/editService/index.js +5 -2
  70. package/lib/components/booking/info2/utils.d.ts +1 -1
  71. package/lib/components/booking/info2/utils.js +2 -2
  72. package/lib/components/booking/info2/utilsByBooking.d.ts +1 -1
  73. package/lib/components/booking/info2/utilsByBooking.js +3 -2
  74. package/lib/components/booking/locales.d.ts +3 -0
  75. package/lib/components/booking/locales.js +6 -3
  76. package/lib/components/booking/utils.d.ts +2 -2
  77. package/lib/components/eftposPay/amount.d.ts +1 -1
  78. package/lib/components/eftposPay/device.d.ts +1 -1
  79. package/lib/components/eftposPay/hooks.d.ts +2 -2
  80. package/lib/components/eftposPay/store/index.d.ts +5 -5
  81. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +5 -3
  82. package/lib/components/ticketBooking/components/ticketBooking/index.js +4 -2
  83. package/lib/components/ticketBooking/utils/index.d.ts +5 -1
  84. package/lib/components/ticketBooking/utils/index.js +44 -4
  85. package/package.json +2 -2
@@ -8,7 +8,7 @@ import { PosProps } from './const';
8
8
  */
9
9
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
10
10
  className?: string | undefined;
11
- onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
11
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
12
  [keys: string]: unknown;
13
13
  } | undefined, other?: any) => void) | undefined;
14
14
  onClose: () => void;
@@ -10,7 +10,7 @@ import './device.less';
10
10
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
11
11
  api: PayProps['api'];
12
12
  className?: string | undefined;
13
- onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
13
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
14
14
  [keys: string]: unknown;
15
15
  } | undefined, other?: any) => void) | undefined;
16
16
  onClose: () => void;
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave">;
22
+ readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
174
174
  export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
175
175
  type: EActionTypes;
176
176
  payload: {
177
- status: "loading" | "success" | "warn" | "fail" | "question";
177
+ status: "success" | "loading" | "warn" | "fail" | "question";
178
178
  };
179
179
  };
180
180
  /**
@@ -295,10 +295,10 @@ export declare const backUpFree: (payload: Partial<State>) => {
295
295
  name?: string | undefined;
296
296
  symbol?: string | undefined;
297
297
  amount?: string | number | undefined;
298
- mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
298
+ mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "stripe" | "payo" | "tyro" | "windcave" | undefined;
301
- action?: "amount" | "deviceList" | "pay" | undefined;
300
+ eftpos?: "tyro" | "windcave" | "stripe" | "payo" | undefined;
301
+ action?: "amount" | "pay" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
308
308
  net?: boolean | undefined;
309
309
  component?: string | undefined;
310
310
  form?: string | undefined;
311
- status?: "loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
311
+ status?: "success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
312
312
  warn?: string | undefined;
313
313
  steps?: {
314
314
  /** 用于重置当前步骤 */
@@ -222,7 +222,7 @@ var AddSerivce = (props) => {
222
222
  session: isSession,
223
223
  variant: true,
224
224
  package: true,
225
- number: (0, import_utils4.isNormalProductByDurationSchedule)(item)
225
+ number: (0, import_utils6.getIsShowNumber)(item, state)
226
226
  },
227
227
  isOnlySession,
228
228
  is_eject: isEject ? 1 : 0,
@@ -287,9 +287,11 @@ var AddSerivce = (props) => {
287
287
  }
288
288
  if (cacheItem.autoClose) {
289
289
  cacheItem.autoClose = false;
290
+ cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
290
291
  let { list: _list, quantity } = (0, import_utils6.addService)(
291
- state.service.value,
292
- cacheItem
292
+ [...state.service.value],
293
+ cacheItem,
294
+ state
293
295
  );
294
296
  (_b2 = Toast == null ? void 0 : Toast.success) == null ? void 0 : _b2.call(
295
297
  Toast,
@@ -836,7 +836,8 @@ var TicketBooking = () => {
836
836
  addTimeProducts: state.addTimeProducts,
837
837
  isBookingCreatePage: true,
838
838
  closeAutoOpenService: true,
839
- productExtensionType: state.productExtensionType
839
+ productExtensionType: state.productExtensionType,
840
+ isBookingTicket2: true
840
841
  },
841
842
  setGlobalState: _setModalState
842
843
  }
@@ -889,7 +890,8 @@ var TicketBooking = () => {
889
890
  refreshData: _refreshData,
890
891
  setActiveTab: _setActiveTab,
891
892
  clearAllValue: _clearAllValue,
892
- drawerMask: true
893
+ drawerMask: true,
894
+ isBookingTicket2: true
893
895
  },
894
896
  setGlobalState: _setModalState,
895
897
  setState,
@@ -12,8 +12,12 @@ export declare const restoreProductOtherData: (data: any) => {
12
12
  product_variant_id: number;
13
13
  quantity: number;
14
14
  } | undefined;
15
- export declare const addService: (list: any[], addItem: any) => {
15
+ export declare const addService: (list: any[], addItem: any, state: any) => {
16
16
  list: any[];
17
17
  quantity: any;
18
18
  };
19
19
  export declare const addServiceScroll: (rowKey: string, cacheItem: any) => void;
20
+ export declare const getCartProductOverlay: (state: any) => any;
21
+ export declare const getIsOverlayProduct: (item: any, state: any) => any;
22
+ export declare const getIsShowNumber: (item: any, state: any) => any;
23
+ export declare const genServiceKey: (item: any) => string;
@@ -33,8 +33,12 @@ __export(utils_exports, {
33
33
  addServiceScroll: () => addServiceScroll,
34
34
  formatBookingList: () => formatBookingList,
35
35
  formatDateToStr: () => formatDateToStr,
36
+ genServiceKey: () => genServiceKey,
37
+ getCartProductOverlay: () => getCartProductOverlay,
36
38
  getDefaultStartParam: () => getDefaultStartParam,
37
39
  getDisabledEdit: () => getDisabledEdit,
40
+ getIsOverlayProduct: () => getIsOverlayProduct,
41
+ getIsShowNumber: () => getIsShowNumber,
38
42
  getNextTimeSlice: () => getNextTimeSlice,
39
43
  restoreProductOtherData: () => restoreProductOtherData
40
44
  });
@@ -124,13 +128,16 @@ var restoreProductOtherData = (data) => {
124
128
  };
125
129
  };
126
130
  var isSameProduct = (a, b) => {
127
- var _a, _b, _c, _d;
128
- return ((_b = (_a = a._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.rowKey) === ((_d = (_c = b._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.rowKey);
131
+ var _a, _b, _c, _d, _e, _f, _g, _h;
132
+ if ((0, import_utils.isNormalProductByDurationSchedule)(a) && (0, import_utils.isNormalProductByDurationSchedule)(b)) {
133
+ return ((_b = (_a = a._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.rowKey) === ((_d = (_c = b._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.rowKey);
134
+ }
135
+ return ((_f = (_e = a._extend) == null ? void 0 : _e.other) == null ? void 0 : _f.rowKey) === ((_h = (_g = b._extend) == null ? void 0 : _g.other) == null ? void 0 : _h.rowKey) && a._serviceKey === b._serviceKey;
129
136
  };
130
- var addService = (list, addItem) => {
137
+ var addService = (list, addItem, state) => {
131
138
  let value = list;
132
139
  let count;
133
- if (!(0, import_utils.isNormalProductByDurationSchedule)(addItem)) {
140
+ if (!(0, import_utils.isNormalProductByDurationSchedule)(addItem) && !getIsOverlayProduct(addItem, state)) {
134
141
  value.push(addItem);
135
142
  count = addItem._extend.quantity;
136
143
  } else {
@@ -183,14 +190,47 @@ var addServiceScroll = (rowKey, cacheItem) => {
183
190
  }
184
191
  });
185
192
  };
193
+ var getCartProductOverlay = (state) => {
194
+ var _a, _b, _c;
195
+ return ((_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.cart_product_overlay) || { type: "product_all" };
196
+ };
197
+ var getIsOverlayProduct = (item, state) => {
198
+ const { type, product_ids } = getCartProductOverlay(state);
199
+ if (type === "product_all") {
200
+ return true;
201
+ }
202
+ return product_ids.includes(item.product_id || item.id);
203
+ };
204
+ var getIsShowNumber = (item, state) => {
205
+ const isBookingTicket2 = state.isBookingTicket2;
206
+ return (0, import_utils.isNormalProductByDurationSchedule)(item) || isBookingTicket2 && getIsOverlayProduct(item, state);
207
+ };
208
+ var genServiceKey = (item) => {
209
+ var _a, _b, _c;
210
+ const product_id = item.product_id;
211
+ const durationKey = (_a = item._extend) == null ? void 0 : _a.duration;
212
+ const start_time = (_b = item._extend) == null ? void 0 : _b.start_time;
213
+ const total = (_c = item._extend) == null ? void 0 : _c.total;
214
+ let resourceKey = "";
215
+ Object.values(item._extend.resource).forEach((resources) => {
216
+ resources.forEach((resource) => {
217
+ resourceKey += `${resource.relation_id}`;
218
+ });
219
+ });
220
+ return `${product_id}-${durationKey}-${resourceKey}-${start_time}-${total}`;
221
+ };
186
222
  // Annotate the CommonJS export names for ESM import in node:
187
223
  0 && (module.exports = {
188
224
  addService,
189
225
  addServiceScroll,
190
226
  formatBookingList,
191
227
  formatDateToStr,
228
+ genServiceKey,
229
+ getCartProductOverlay,
192
230
  getDefaultStartParam,
193
231
  getDisabledEdit,
232
+ getIsOverlayProduct,
233
+ getIsShowNumber,
194
234
  getNextTimeSlice,
195
235
  restoreProductOtherData
196
236
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.3.68",
3
+ "version": "3.3.69",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,8 +59,8 @@
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
61
  "decimal.js": "^10.4.3",
62
+ "@pisell/materials": "3.3.27",
62
63
  "@pisell/icon": "0.0.11",
63
- "@pisell/materials": "3.3.26",
64
64
  "@pisell/utils": "1.0.42",
65
65
  "@pisell/date-picker": "3.0.2"
66
66
  },