@pisell/private-materials 3.0.152-gray → 3.0.152

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 (186) 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 +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +12 -12
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/booking/addons/model.d.ts +1 -2
  12. package/es/components/booking/components/footer/index.js +51 -36
  13. package/es/components/booking/components/footer/utils.js +35 -4
  14. package/es/components/booking/forms/forms.d.ts +0 -1
  15. package/es/components/booking/forms/forms.js +2 -4
  16. package/es/components/booking/forms/model.d.ts +1 -2
  17. package/es/components/booking/forms/single/index.d.ts +1 -1
  18. package/es/components/booking/forms/single/index.js +3 -4
  19. package/es/components/booking/index.js +1 -1
  20. package/es/components/booking/info/index.d.ts +4 -12
  21. package/es/components/booking/info/index.js +12 -123
  22. package/es/components/booking/info/index.less +0 -9
  23. package/es/components/booking/info/main.d.ts +12 -0
  24. package/es/components/booking/info/main.js +124 -0
  25. package/es/components/booking/info/model.js +0 -1
  26. package/es/components/booking/info/pet/index.js +1 -1
  27. package/es/components/booking/info/service/addService/index.d.ts +2 -8
  28. package/es/components/booking/info/service/addService/index.js +36 -82
  29. package/es/components/booking/info/service/addService/index.less +1 -27
  30. package/es/components/booking/info/service/addTimeModal/index.js +4 -4
  31. package/es/components/booking/info/service/editService/index.js +13 -11
  32. package/es/components/booking/info/utils.d.ts +1 -0
  33. package/es/components/booking/info/utils.js +7 -0
  34. package/es/components/booking/info2/index.d.ts +12 -0
  35. package/es/components/booking/{dashboard → info2}/index.js +196 -222
  36. package/es/components/booking/info2/serve.d.ts +6 -0
  37. package/es/components/booking/info2/serve.js +79 -0
  38. package/es/components/booking/info2/service/actions/index.d.ts +6 -0
  39. package/es/components/booking/info2/service/actions/index.js +86 -0
  40. package/es/components/booking/info2/service/addService/index.d.ts +6 -0
  41. package/es/components/booking/info2/service/addService/index.js +404 -0
  42. package/es/components/booking/info2/service/addService/mock.d.ts +214 -0
  43. package/es/components/booking/info2/service/addService/mock.js +332 -0
  44. package/es/components/booking/info2/service/addService/utils.d.ts +71 -0
  45. package/es/components/booking/info2/service/addService/utils.js +510 -0
  46. package/es/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
  47. package/es/components/booking/info2/service/addTimeModal/index.js +681 -0
  48. package/es/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
  49. package/es/components/booking/{dashboard → info2/service/addTimeModal}/serve.js +51 -5
  50. package/es/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
  51. package/es/components/booking/info2/service/addTimeModal/utils.js +176 -0
  52. package/es/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
  53. package/es/components/booking/info2/service/editService/Capacity/index.js +121 -0
  54. package/es/components/booking/info2/service/editService/Capacity/index.less +1 -0
  55. package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
  56. package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +28 -0
  57. package/es/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
  58. package/es/components/booking/info2/service/editService/Resources/index.js +233 -0
  59. package/es/components/booking/info2/service/editService/Resources/index.less +21 -0
  60. package/es/components/booking/info2/service/editService/index.d.ts +7 -0
  61. package/es/components/booking/info2/service/editService/index.js +617 -0
  62. package/es/components/booking/info2/service/editService/index.less +99 -0
  63. package/es/components/booking/info2/service/editService/utils.d.ts +11 -0
  64. package/es/components/booking/{info/addServiceVariant/index.js → info2/service/editService/utils.js} +30 -26
  65. package/es/components/booking/info2/service/index.d.ts +4 -0
  66. package/es/components/booking/info2/service/index.js +55 -0
  67. package/es/components/booking/info2/service/serviceItem/index.d.ts +4 -0
  68. package/es/components/booking/info2/service/serviceItem/index.js +176 -0
  69. package/es/components/booking/info2/service/serviceItem/index.less +125 -0
  70. package/es/components/booking/info2/service/serviceList/index.d.ts +6 -0
  71. package/es/components/booking/info2/service/serviceList/index.js +106 -0
  72. package/es/components/booking/info2/service/serviceList/index.less +0 -0
  73. package/es/components/booking/info2/utilsByBooking.d.ts +34 -0
  74. package/es/components/booking/info2/utilsByBooking.js +349 -0
  75. package/es/components/booking/locales.d.ts +3 -48
  76. package/es/components/booking/locales.js +9 -48
  77. package/es/components/booking/materiels/resources/index.d.ts +2 -2
  78. package/es/components/booking/materiels/resources/index.js +11 -11
  79. package/es/components/booking/mock.d.ts +1 -0
  80. package/es/components/booking/mock.js +66 -0
  81. package/es/components/booking/model.d.ts +0 -2
  82. package/es/components/booking/notes/index.d.ts +1 -1
  83. package/es/components/booking/notes/model.d.ts +1 -2
  84. package/es/components/booking/payments/model.d.ts +1 -2
  85. package/es/components/booking/utils.d.ts +1 -1
  86. package/es/components/booking/utils.js +51 -54
  87. package/es/components/index.d.ts +1 -1
  88. package/es/components/index.js +1 -1
  89. package/es/components/schedules/index.d.ts +1 -1
  90. package/es/components/schedules/model.d.ts +1 -2
  91. package/es/index.d.ts +1 -3
  92. package/es/index.js +2 -4
  93. package/lib/components/booking/addons/model.d.ts +1 -2
  94. package/lib/components/booking/components/footer/index.js +31 -8
  95. package/lib/components/booking/components/footer/utils.js +29 -4
  96. package/lib/components/booking/forms/forms.d.ts +0 -1
  97. package/lib/components/booking/forms/forms.js +2 -5
  98. package/lib/components/booking/forms/model.d.ts +1 -2
  99. package/lib/components/booking/forms/single/index.d.ts +1 -1
  100. package/lib/components/booking/forms/single/index.js +2 -4
  101. package/lib/components/booking/index.js +2 -2
  102. package/lib/components/booking/info/client/index.js +8 -1
  103. package/lib/components/booking/info/index.d.ts +4 -12
  104. package/lib/components/booking/info/index.js +14 -118
  105. package/lib/components/booking/info/index.less +0 -9
  106. package/lib/components/booking/info/main.d.ts +12 -0
  107. package/lib/components/booking/info/main.js +152 -0
  108. package/lib/components/booking/info/pet/index.js +1 -2
  109. package/lib/components/booking/info/service/addService/index.d.ts +2 -8
  110. package/lib/components/booking/info/service/addService/index.js +29 -66
  111. package/lib/components/booking/info/service/addService/index.less +1 -27
  112. package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
  113. package/lib/components/booking/info/service/editService/index.js +6 -9
  114. package/lib/components/booking/info/utils.d.ts +1 -0
  115. package/lib/components/booking/info/utils.js +9 -0
  116. package/lib/components/booking/info2/index.d.ts +12 -0
  117. package/lib/components/booking/info2/index.js +202 -0
  118. package/lib/components/booking/info2/serve.d.ts +6 -0
  119. package/lib/components/booking/{dashboard → info2}/serve.js +25 -5
  120. package/lib/components/booking/info2/service/actions/index.d.ts +6 -0
  121. package/lib/components/booking/info2/service/actions/index.js +102 -0
  122. package/lib/components/booking/info2/service/addService/index.d.ts +6 -0
  123. package/lib/components/booking/info2/service/addService/index.js +356 -0
  124. package/lib/components/booking/info2/service/addService/mock.d.ts +214 -0
  125. package/lib/components/booking/info2/service/addService/mock.js +398 -0
  126. package/lib/components/booking/info2/service/addService/utils.d.ts +71 -0
  127. package/lib/components/booking/info2/service/addService/utils.js +377 -0
  128. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
  129. package/lib/components/booking/info2/service/addTimeModal/index.js +558 -0
  130. package/lib/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
  131. package/lib/components/booking/info2/service/addTimeModal/serve.js +45 -0
  132. package/lib/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
  133. package/lib/components/booking/info2/service/addTimeModal/utils.js +157 -0
  134. package/lib/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
  135. package/lib/components/booking/info2/service/editService/Capacity/index.js +97 -0
  136. package/lib/components/booking/info2/service/editService/Capacity/index.less +1 -0
  137. package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
  138. package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +54 -0
  139. package/lib/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
  140. package/lib/components/booking/info2/service/editService/Resources/index.js +212 -0
  141. package/lib/components/booking/info2/service/editService/Resources/index.less +21 -0
  142. package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
  143. package/lib/components/booking/info2/service/editService/index.js +483 -0
  144. package/lib/components/booking/info2/service/editService/index.less +99 -0
  145. package/lib/components/booking/info2/service/editService/utils.d.ts +11 -0
  146. package/lib/components/booking/info2/service/editService/utils.js +0 -0
  147. package/lib/components/booking/info2/service/index.d.ts +4 -0
  148. package/lib/components/booking/info2/service/index.js +75 -0
  149. package/lib/components/booking/info2/service/serviceItem/index.d.ts +4 -0
  150. package/lib/components/booking/info2/service/serviceItem/index.js +184 -0
  151. package/lib/components/booking/info2/service/serviceItem/index.less +125 -0
  152. package/lib/components/booking/info2/service/serviceList/index.d.ts +6 -0
  153. package/lib/components/booking/info2/service/serviceList/index.js +130 -0
  154. package/lib/components/booking/info2/service/serviceList/index.less +0 -0
  155. package/lib/components/booking/info2/utilsByBooking.d.ts +34 -0
  156. package/lib/components/booking/info2/utilsByBooking.js +257 -0
  157. package/lib/components/booking/locales.d.ts +3 -48
  158. package/lib/components/booking/locales.js +3 -48
  159. package/lib/components/booking/materiels/resources/index.d.ts +2 -2
  160. package/lib/components/booking/mock.d.ts +1 -0
  161. package/lib/components/booking/mock.js +67 -2
  162. package/lib/components/booking/model.d.ts +0 -2
  163. package/lib/components/booking/notes/index.d.ts +1 -1
  164. package/lib/components/booking/notes/model.d.ts +1 -2
  165. package/lib/components/booking/payments/model.d.ts +1 -2
  166. package/lib/components/booking/utils.d.ts +1 -1
  167. package/lib/components/booking/utils.js +22 -57
  168. package/lib/components/eftposPay/tyro/index.js +3 -1
  169. package/lib/components/index.d.ts +1 -1
  170. package/lib/components/index.js +1 -1
  171. package/lib/components/schedules/index.d.ts +1 -1
  172. package/lib/components/schedules/model.d.ts +1 -2
  173. package/lib/index.d.ts +1 -3
  174. package/lib/index.js +1 -7
  175. package/package.json +2 -2
  176. package/es/components/booking/dashboard/index.d.ts +0 -10
  177. package/es/components/booking/dashboard/serve.d.ts +0 -1
  178. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -7
  179. package/lib/components/booking/dashboard/index.d.ts +0 -10
  180. package/lib/components/booking/dashboard/index.js +0 -225
  181. package/lib/components/booking/dashboard/serve.d.ts +0 -1
  182. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -7
  183. package/lib/components/booking/info/addServiceVariant/index.js +0 -58
  184. package/lowcode/booking-dashboard/meta.ts +0 -130
  185. package/lowcode/booking-vertical-add-service/meta.ts +0 -124
  186. package/lowcode/vertical-add-service/meta.ts +0 -71
@@ -112,9 +112,7 @@ var sliceDayIntoFiveMinutes = (config, locale) => {
112
112
  value: durationValue
113
113
  });
114
114
  } else {
115
- const durationLabel = `${durationValue} ${import_utils.locales.getText(
116
- "pisell2.text.min"
117
- )}`;
115
+ const durationLabel = `${durationValue} ${import_utils.locales.getText("pisell2.text.min")}`;
118
116
  durationSlicesBasedOnTime.push({
119
117
  label: durationLabel,
120
118
  value: durationValue
@@ -137,9 +135,7 @@ var getServeStartTime = (start_time) => {
137
135
  return start_time;
138
136
  };
139
137
  var getServiceTime = (item, currentDate) => {
140
- const startDate = (0, import_dayjs.default)(
141
- currentDate.format("YYYY-MM-DD") + " " + getServeStartTime(item._extend.start_time)
142
- );
138
+ const startDate = (0, import_dayjs.default)(currentDate.format("YYYY-MM-DD") + " " + getServeStartTime(item._extend.start_time));
143
139
  const startTime = startDate.format("HH:mm");
144
140
  const endTime = startDate.add(flexibleObj.getValue(item._extend.duration), "minute").format("HH:mm");
145
141
  const duration = getDiscountTime(flexibleObj.getValue(item._extend.duration));
@@ -187,7 +183,10 @@ var formatProductListByCategory = (list, filterItem) => {
187
183
  }
188
184
  categoryObject[categoryItem.id] = {
189
185
  ...categoryItem,
190
- products: [...categoryObject[categoryItem.id].products, productItem]
186
+ products: [
187
+ ...categoryObject[categoryItem.id].products,
188
+ productItem
189
+ ]
191
190
  };
192
191
  }
193
192
  } else {
@@ -209,9 +208,7 @@ var formatProductListByCategory = (list, filterItem) => {
209
208
  return Object.values(categoryObject).sort((a, b) => b.sort - a.sort);
210
209
  };
211
210
  var getResourceTimeIsUsable = (item, cacheItem) => {
212
- const startDate = (0, import_dayjs.default)(
213
- cacheItem._extend.start_date.format("YYYY-MM-DD") + " " + getServeStartTime(cacheItem._extend.start_time)
214
- );
211
+ const startDate = (0, import_dayjs.default)(cacheItem._extend.start_date.format("YYYY-MM-DD") + " " + getServeStartTime(cacheItem._extend.start_time));
215
212
  const isFlexible = flexibleObj.isFlexible(cacheItem._extend.duration);
216
213
  let isMaxLimitRange = false;
217
214
  let isDateRange = false;
@@ -221,22 +218,13 @@ var getResourceTimeIsUsable = (item, cacheItem) => {
221
218
  } else {
222
219
  isMaxLimitRange = "unknown";
223
220
  }
224
- const timeStartDate = (0, import_dayjs.default)(time.start_date + " " + time.start_time).subtract(
225
- 1,
226
- "second"
227
- );
228
- const timeEndDate = (0, import_dayjs.default)(time.end_date + " " + time.end_time).add(
229
- 1,
230
- "second"
231
- );
221
+ const timeStartDate = (0, import_dayjs.default)(time.start_date + " " + time.start_time).subtract(1, "second");
222
+ const timeEndDate = (0, import_dayjs.default)(time.end_date + " " + time.end_time).add(1, "second");
232
223
  let bol;
233
224
  if (isFlexible) {
234
225
  bol = startDate.isAfter(timeStartDate) && startDate.isBefore(timeEndDate);
235
226
  } else {
236
- let endDate = startDate.add(
237
- flexibleObj.getValue(cacheItem._extend.duration),
238
- "minute"
239
- );
227
+ let endDate = startDate.add(flexibleObj.getValue(cacheItem._extend.duration), "minute");
240
228
  bol = startDate.isAfter(timeStartDate) && endDate.isBefore(timeEndDate);
241
229
  }
242
230
  if (bol) {
@@ -341,9 +329,7 @@ var flexibleObj = {
341
329
  };
342
330
  var getEndDate = (startDate, duration, endDate) => {
343
331
  if (duration === "flexible") {
344
- let openingDate = (0, import_dayjs.default)(
345
- startDate.format("YYYY-MM-DD") + " " + getShopOpeningHours()
346
- );
332
+ let openingDate = (0, import_dayjs.default)(startDate.format("YYYY-MM-DD") + " " + getShopOpeningHours());
347
333
  if ((0, import_dayjs.default)(startDate).isAfter(openingDate)) {
348
334
  openingDate = openingDate.add(1, "day");
349
335
  }
@@ -358,13 +344,8 @@ var getEndDate = (startDate, duration, endDate) => {
358
344
  return startDate.add(duration, "minute");
359
345
  };
360
346
  var getServiceTimes = (service) => {
361
- const startDate = (0, import_dayjs.default)(
362
- (0, import_dayjs.default)(service._extend.start_date).format("YYYY-MM-DD ") + getServeStartTime(service._extend.start_time)
363
- );
364
- const endDate = startDate.add(
365
- flexibleObj.getValue(service._extend.duration),
366
- "minute"
367
- );
347
+ const startDate = (0, import_dayjs.default)((0, import_dayjs.default)(service._extend.start_date).format("YYYY-MM-DD ") + getServeStartTime(service._extend.start_time));
348
+ const endDate = startDate.add(flexibleObj.getValue(service._extend.duration), "minute");
368
349
  return {
369
350
  startDate,
370
351
  endDate
@@ -373,12 +354,10 @@ var getServiceTimes = (service) => {
373
354
  var getErrorList = (resource, cacheItem) => {
374
355
  var _a, _b, _c;
375
356
  if (!(cacheItem == null ? void 0 : cacheItem.id)) {
376
- return [
377
- {
378
- label: import_utils.locales.getText("pisell2.text.no-product-added"),
379
- type: "products"
380
- }
381
- ];
357
+ return [{
358
+ label: import_utils.locales.getText("pisell2.text.no-product-added"),
359
+ type: "products"
360
+ }];
382
361
  }
383
362
  if (!resource || !resource._extend || !cacheItem) {
384
363
  return [];
@@ -387,10 +366,7 @@ var getErrorList = (resource, cacheItem) => {
387
366
  if (!resource.usable) {
388
367
  if (!((_a = resource == null ? void 0 : resource._extend) == null ? void 0 : _a.usableProduct)) {
389
368
  list.push({
390
- label: import_utils.locales.getText("pisell1.text.resource-error-message-1")(
391
- resource.labelText,
392
- cacheItem == null ? void 0 : cacheItem.title
393
- ),
369
+ label: import_utils.locales.getText("pisell1.text.resource-error-message-1")(resource.labelText, cacheItem == null ? void 0 : cacheItem.title),
394
370
  type: "product"
395
371
  });
396
372
  }
@@ -402,21 +378,13 @@ var getErrorList = (resource, cacheItem) => {
402
378
  }
403
379
  if (!((_b = resource._extend) == null ? void 0 : _b.usableTime)) {
404
380
  list.push({
405
- label: import_utils.locales.getText("pisell1.text.resource-error-message-2")(
406
- resource.labelText,
407
- startText,
408
- endText
409
- ),
381
+ label: import_utils.locales.getText("pisell1.text.resource-error-message-2")(resource.labelText, startText, endText),
410
382
  type: "time"
411
383
  });
412
384
  } else {
413
385
  if (!((_c = resource._extend) == null ? void 0 : _c.usableTime._extend.isMaxLimitRange)) {
414
386
  list.push({
415
- label: import_utils.locales.getText("pisell1.text.resource-error-message-3")(
416
- resource.labelText,
417
- startText,
418
- endText
419
- ),
387
+ label: import_utils.locales.getText("pisell1.text.resource-error-message-3")(resource.labelText, startText, endText),
420
388
  type: "limit"
421
389
  });
422
390
  }
@@ -486,14 +454,11 @@ var getServerItemExtend = (state, cacheItem, timeObj) => {
486
454
  _extend.resource = resourceId;
487
455
  }
488
456
  }
457
+ console.log("_extend", findNextSliceProps);
489
458
  if (findNextSliceProps.date && findNextSliceProps.date !== "00:00") {
490
459
  _extend.start_time = findNextSlice(findNextSliceProps);
491
460
  } else {
492
- if (cacheItem.currentDefaultTime) {
493
- _extend.start_time = cacheItem.currentDefaultTime;
494
- } else {
495
- _extend.start_time = (0, import_dayjs.default)().format("HH:mm");
496
- }
461
+ _extend.start_time = (0, import_dayjs.default)().format("HH:mm");
497
462
  }
498
463
  }
499
464
  _extend = {
@@ -256,7 +256,9 @@ var tyro_default = ({
256
256
  dispatch(
257
257
  (0, import_store.updateState)({
258
258
  status: "loading",
259
- title: import_utils.locales.getText("page.eftpos-pay.text.loading")(modeRef.current),
259
+ title: import_utils.locales.getText("page.eftpos-pay.text.loading")(
260
+ modeRef.current
261
+ ),
260
262
  subTitle: ""
261
263
  })
262
264
  );
@@ -1,5 +1,5 @@
1
1
  import Login from './login';
2
- import BookingInfo from './booking/info';
2
+ import BookingInfo from './booking/info/index';
3
3
  import Booking from './booking';
4
4
  import BookingNotes from './booking/notes';
5
5
  import BookingAddons from './booking/addons';
@@ -43,7 +43,7 @@ __export(components_exports, {
43
43
  });
44
44
  module.exports = __toCommonJS(components_exports);
45
45
  var import_login = __toESM(require("./login"));
46
- var import_info = __toESM(require("./booking/info"));
46
+ var import_info = __toESM(require("./booking/info/index"));
47
47
  var import_booking = __toESM(require("./booking"));
48
48
  var import_notes = __toESM(require("./booking/notes"));
49
49
  var import_addons = __toESM(require("./booking/addons"));
@@ -1,3 +1,3 @@
1
1
  import "./index.less";
2
- declare const Schedules: (props: any) => any;
2
+ declare const Schedules: (props: any) => JSX.Element;
3
3
  export default Schedules;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CalendarDataItem, ScheduleItem } from "./type";
3
2
  import dayjs from "dayjs";
4
3
  export interface FormState {
@@ -69,7 +68,7 @@ export interface FormState {
69
68
  };
70
69
  setGlobalState: Function | null;
71
70
  }
72
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
71
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
73
72
  state: FormState;
74
73
  } & {
75
74
  dispatch: (params: {
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { default as Login } from './components/login';
2
2
  export type { LoginProps } from './components/login';
3
- export { default as BookingInfo } from './components/booking/info';
3
+ export { default as BookingInfo } from './components/booking/info/index';
4
4
  export { default as BookingNotes } from './components/booking/notes';
5
5
  export { default as BookingAddons } from './components/booking/addons';
6
6
  export { default as BookingForms } from './components/booking/forms';
@@ -12,7 +12,6 @@ export { default as BookingStartTime } from './components/booking/materiels/star
12
12
  export { default as BookingDuration } from './components/booking/materiels/duration';
13
13
  export { default as BookingContacts } from './components/booking/materiels/contacts';
14
14
  export { VerticalClient } from './components/booking/info/clientVariant';
15
- export { default as VerticalAddService } from './components/booking/info/addServiceVariant';
16
15
  export { default as ProductExtension } from './components/productExtension';
17
16
  export { default as BookingDeposit } from './components/booking/deposit';
18
17
  export { default as RuleSetting } from './components/ruleSetting';
@@ -20,4 +19,3 @@ export { default as TaxSelect } from './components/taxSelect';
20
19
  export { default as ToCPay } from './components/pay/toC';
21
20
  export { default as Eftpos } from './components/eftpos';
22
21
  export { default as EftposPay } from './components/eftposPay';
23
- export { default as BookingDashboard } from './components/booking/dashboard';
package/lib/index.js CHANGED
@@ -32,7 +32,6 @@ __export(src_exports, {
32
32
  Booking: () => import_booking.default,
33
33
  BookingAddons: () => import_addons.default,
34
34
  BookingContacts: () => import_contacts.default,
35
- BookingDashboard: () => import_dashboard.default,
36
35
  BookingDeposit: () => import_deposit.default,
37
36
  BookingDuration: () => import_duration.default,
38
37
  BookingForms: () => import_forms.default,
@@ -49,7 +48,6 @@ __export(src_exports, {
49
48
  Schedules: () => import_schedules.default,
50
49
  TaxSelect: () => import_taxSelect.default,
51
50
  ToCPay: () => import_toC.default,
52
- VerticalAddService: () => import_addServiceVariant.default,
53
51
  VerticalClient: () => import_clientVariant.VerticalClient
54
52
  });
55
53
  module.exports = __toCommonJS(src_exports);
@@ -57,7 +55,7 @@ var import_weekday = __toESM(require("dayjs/plugin/weekday"));
57
55
  var import_dayjs = __toESM(require("dayjs"));
58
56
  var import_localeData = __toESM(require("dayjs/plugin/localeData"));
59
57
  var import_login = __toESM(require("./components/login"));
60
- var import_info = __toESM(require("./components/booking/info"));
58
+ var import_info = __toESM(require("./components/booking/info/index"));
61
59
  var import_notes = __toESM(require("./components/booking/notes"));
62
60
  var import_addons = __toESM(require("./components/booking/addons"));
63
61
  var import_forms = __toESM(require("./components/booking/forms"));
@@ -69,7 +67,6 @@ var import_startTime = __toESM(require("./components/booking/materiels/startTime
69
67
  var import_duration = __toESM(require("./components/booking/materiels/duration"));
70
68
  var import_contacts = __toESM(require("./components/booking/materiels/contacts"));
71
69
  var import_clientVariant = require("./components/booking/info/clientVariant");
72
- var import_addServiceVariant = __toESM(require("./components/booking/info/addServiceVariant"));
73
70
  var import_productExtension = __toESM(require("./components/productExtension"));
74
71
  var import_deposit = __toESM(require("./components/booking/deposit"));
75
72
  var import_ruleSetting = __toESM(require("./components/ruleSetting"));
@@ -77,7 +74,6 @@ var import_taxSelect = __toESM(require("./components/taxSelect"));
77
74
  var import_toC = __toESM(require("./components/pay/toC"));
78
75
  var import_eftpos = __toESM(require("./components/eftpos"));
79
76
  var import_eftposPay = __toESM(require("./components/eftposPay"));
80
- var import_dashboard = __toESM(require("./components/booking/dashboard"));
81
77
  import_dayjs.default.extend(import_weekday.default);
82
78
  import_dayjs.default.extend(import_localeData.default);
83
79
  // Annotate the CommonJS export names for ESM import in node:
@@ -85,7 +81,6 @@ import_dayjs.default.extend(import_localeData.default);
85
81
  Booking,
86
82
  BookingAddons,
87
83
  BookingContacts,
88
- BookingDashboard,
89
84
  BookingDeposit,
90
85
  BookingDuration,
91
86
  BookingForms,
@@ -102,6 +97,5 @@ import_dayjs.default.extend(import_localeData.default);
102
97
  Schedules,
103
98
  TaxSelect,
104
99
  ToCPay,
105
- VerticalAddService,
106
100
  VerticalClient
107
101
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.152-gray",
3
+ "version": "3.0.152",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -62,7 +62,7 @@
62
62
  "@pisell/utils": "1.0.42",
63
63
  "@pisell/date-picker": "1.0.100",
64
64
  "@pisell/icon": "0.0.11",
65
- "@pisell/materials": "3.0.49-gray"
65
+ "@pisell/materials": "3.0.48"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export interface BookingDashboardProps extends React.HTMLAttributes<HTMLDivElement> {
3
- backgroundColors?: string[];
4
- labelColor?: string;
5
- valueColor?: string;
6
- otherParams?: Record<string, any>;
7
- refreshKey?: string;
8
- }
9
- declare const BookingDashboard: (props: BookingDashboardProps) => React.JSX.Element;
10
- export default BookingDashboard;
@@ -1 +0,0 @@
1
- export declare const getBookingList: (params: any) => Promise<any>;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface AddServiceVariantProps {
3
- globalState: any;
4
- setGlobalState: any;
5
- }
6
- declare const AddServiceVariant: (props: AddServiceVariantProps) => React.JSX.Element;
7
- export default AddServiceVariant;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export interface BookingDashboardProps extends React.HTMLAttributes<HTMLDivElement> {
3
- backgroundColors?: string[];
4
- labelColor?: string;
5
- valueColor?: string;
6
- otherParams?: Record<string, any>;
7
- refreshKey?: string;
8
- }
9
- declare const BookingDashboard: (props: BookingDashboardProps) => React.JSX.Element;
10
- export default BookingDashboard;
@@ -1,225 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/booking/dashboard/index.tsx
30
- var dashboard_exports = {};
31
- __export(dashboard_exports, {
32
- default: () => dashboard_default
33
- });
34
- module.exports = __toCommonJS(dashboard_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_materials = require("@pisell/materials");
37
- var import_utils = require("@pisell/utils");
38
- var import_dayjs = __toESM(require("dayjs"));
39
- var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
40
- var import_utils2 = require("../utils");
41
- var import_serve = require("./serve");
42
- var import_locales = __toESM(require("../locales"));
43
- import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
44
- var BookingDashboard = (props) => {
45
- const {
46
- otherParams = {},
47
- backgroundColors,
48
- labelColor,
49
- valueColor,
50
- refreshKey,
51
- ...others
52
- } = props;
53
- const context = (0, import_useEngineContext.default)();
54
- import_utils2.request.setRequest(context.appHelper.utils.request);
55
- const [data, setData] = (0, import_react.useState)([
56
- // 当前在场团体
57
- {
58
- label: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now"),
59
- value: "-",
60
- tip: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now-tip")
61
- },
62
- // 当前在场人数
63
- {
64
- label: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now"),
65
- value: "-",
66
- tip: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now-tip")
67
- },
68
- // 今日游客总数
69
- {
70
- label: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today"),
71
- value: "-",
72
- tip: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today-tip")
73
- },
74
- // 正在进行中的游客
75
- {
76
- label: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors"),
77
- value: "-",
78
- tip: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors-tip")
79
- },
80
- // 即将到达的游客
81
- {
82
- label: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors"),
83
- value: "-",
84
- tip: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors-tip")
85
- },
86
- // 超时的游客
87
- {
88
- label: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors"),
89
- value: "-",
90
- tip: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors-tip")
91
- },
92
- // 已完成的游客
93
- {
94
- label: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors"),
95
- value: "-",
96
- tip: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors-tip")
97
- },
98
- // 已离场的游客
99
- {
100
- label: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors"),
101
- value: "-",
102
- tip: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors-tip")
103
- }
104
- ]);
105
- const [bookingData, setBookingData] = (0, import_react.useState)([]);
106
- const getData = async () => {
107
- const data2 = await (0, import_serve.getBookingList)({
108
- ...otherParams,
109
- item_type: "appointment_booking",
110
- parent_id: 0,
111
- with: ["children"],
112
- child_booking: 0,
113
- skip: 1,
114
- num: 1e3
115
- });
116
- setBookingData(data2.list);
117
- };
118
- const calcBookingDataCount = (data2) => {
119
- let groupsOnSiteNow = "-";
120
- let peopleOnSiteNow = "-";
121
- let totalVisitorsToday = 0;
122
- let ongoing = 0;
123
- let upcoming = 0;
124
- let overdue = "-";
125
- let completed = 0;
126
- let departed = "-";
127
- data2.forEach((item) => {
128
- if ((0, import_utils.isArr)(item.children)) {
129
- item.children.forEach((child) => {
130
- const start = (0, import_dayjs.default)(`${child.start_date} ${child.start_time}`);
131
- const end = (0, import_dayjs.default)(`${child.end_date} ${child.end_time}`);
132
- totalVisitorsToday += child.number;
133
- if (start < (0, import_dayjs.default)() && end > (0, import_dayjs.default)()) {
134
- ongoing += child.number || 1;
135
- }
136
- if ((0, import_dayjs.default)() < start) {
137
- upcoming += child.number || 1;
138
- }
139
- if ((0, import_dayjs.default)() > end) {
140
- completed += child.number || 1;
141
- }
142
- });
143
- }
144
- });
145
- setData([
146
- // 当前在场团体
147
- {
148
- label: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now"),
149
- tip: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now-tip"),
150
- value: `${groupsOnSiteNow}`
151
- },
152
- // 当前在场人数
153
- {
154
- label: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now"),
155
- tip: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now-tip"),
156
- value: `${peopleOnSiteNow}`
157
- },
158
- // 今日游客总数
159
- {
160
- label: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today"),
161
- tip: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today-tip"),
162
- value: `${totalVisitorsToday}`
163
- },
164
- // 正在进行中的游客
165
- {
166
- label: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors"),
167
- tip: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors-tip"),
168
- value: `${ongoing}`
169
- },
170
- // 即将到达的游客
171
- {
172
- label: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors"),
173
- tip: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors-tip"),
174
- value: `${upcoming}`
175
- },
176
- // 超时的游客
177
- {
178
- label: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors"),
179
- tip: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors-tip"),
180
- value: `${overdue}`
181
- },
182
- // 已完成的游客
183
- {
184
- label: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors"),
185
- tip: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors-tip"),
186
- value: `${completed}`
187
- },
188
- // 已离场的游客
189
- {
190
- label: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors"),
191
- tip: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors-tip"),
192
- value: `${departed}`
193
- }
194
- ]);
195
- };
196
- (0, import_react.useEffect)(() => {
197
- calcBookingDataCount(bookingData);
198
- const timer = setInterval(() => {
199
- calcBookingDataCount(bookingData);
200
- }, 60 * 1e3);
201
- return () => {
202
- clearInterval(timer);
203
- };
204
- }, [bookingData]);
205
- (0, import_react.useEffect)(() => {
206
- getData();
207
- const timer = setInterval(() => {
208
- getData();
209
- }, 10 * 60 * 1e3);
210
- return () => {
211
- clearInterval(timer);
212
- };
213
- }, [JSON.stringify(otherParams), refreshKey]);
214
- return /* @__PURE__ */ import_react.default.createElement(
215
- import_materials.PisellStatisticList,
216
- {
217
- ...others,
218
- data,
219
- backgroundColors,
220
- labelColor,
221
- valueColor
222
- }
223
- );
224
- };
225
- var dashboard_default = BookingDashboard;
@@ -1 +0,0 @@
1
- export declare const getBookingList: (params: any) => Promise<any>;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface AddServiceVariantProps {
3
- globalState: any;
4
- setGlobalState: any;
5
- }
6
- declare const AddServiceVariant: (props: AddServiceVariantProps) => React.JSX.Element;
7
- export default AddServiceVariant;
@@ -1,58 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/booking/info/addServiceVariant/index.tsx
30
- var addServiceVariant_exports = {};
31
- __export(addServiceVariant_exports, {
32
- default: () => addServiceVariant_default
33
- });
34
- module.exports = __toCommonJS(addServiceVariant_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_addService = __toESM(require("../service/addService"));
37
- var AddServiceVariant = (props) => {
38
- const { globalState, setGlobalState } = props;
39
- const stateRef = (0, import_react.useRef)(globalState);
40
- stateRef.current = globalState;
41
- const dispatch = ({ type, payload }) => {
42
- if (type === "setService") {
43
- setGlobalState({
44
- service: { ...stateRef.current.service, ...payload }
45
- });
46
- }
47
- };
48
- return /* @__PURE__ */ import_react.default.createElement(
49
- import_addService.default,
50
- {
51
- renderMode: "current",
52
- dispatch,
53
- state: globalState,
54
- drawerProps: { open: true, getContainer: false }
55
- }
56
- );
57
- };
58
- var addServiceVariant_default = AddServiceVariant;