@pisell/private-materials 3.0.163 → 3.0.164

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 (128) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +10 -10
  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 +2 -1
  12. package/es/components/booking/components/footer/index.js +34 -5
  13. package/es/components/booking/dashboard/index.d.ts +20 -0
  14. package/es/components/booking/dashboard/index.js +298 -0
  15. package/es/components/booking/dashboard/serve.d.ts +1 -0
  16. package/es/components/booking/dashboard/serve.js +27 -0
  17. package/es/components/booking/forms/forms.d.ts +1 -0
  18. package/es/components/booking/forms/forms.js +4 -2
  19. package/es/components/booking/forms/model.d.ts +2 -1
  20. package/es/components/booking/forms/single/index.d.ts +1 -1
  21. package/es/components/booking/forms/single/index.js +4 -3
  22. package/es/components/booking/hooks/useClearCart.d.ts +3 -0
  23. package/es/components/booking/hooks/useClearCart.js +27 -0
  24. package/es/components/booking/hooks/useCreateBookingPageHeader.d.ts +6 -0
  25. package/es/components/booking/hooks/useCreateBookingPageHeader.js +21 -0
  26. package/es/components/booking/info/addServiceVariant/index.d.ts +7 -0
  27. package/es/components/booking/info/addServiceVariant/index.js +42 -0
  28. package/es/components/booking/info/client/index.js +1 -1
  29. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
  30. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +4 -2
  31. package/es/components/booking/info/clientVariant/vertical/index.js +6 -5
  32. package/es/components/booking/info/clientVariant/vertical/index.less +8 -0
  33. package/es/components/booking/info/index.less +19 -0
  34. package/es/components/booking/info/main.js +11 -5
  35. package/es/components/booking/info/pet/index.js +1 -1
  36. package/es/components/booking/info/service/addService/index.d.ts +9 -3
  37. package/es/components/booking/info/service/addService/index.js +82 -36
  38. package/es/components/booking/info/service/addService/index.less +27 -1
  39. package/es/components/booking/info/service/editService/index.js +11 -13
  40. package/es/components/booking/info/service/index.js +5 -2
  41. package/es/components/booking/info/service/index.less +18 -0
  42. package/es/components/booking/info/service/serviceItem/index.d.ts +3 -3
  43. package/es/components/booking/info/service/serviceItem/index.js +22 -8
  44. package/es/components/booking/info/service/serviceItem/index.less +8 -0
  45. package/es/components/booking/info/service/serviceList/index.js +20 -1
  46. package/es/components/booking/info2/index.js +9 -3
  47. package/es/components/booking/info2/service/addService/index.d.ts +8 -2
  48. package/es/components/booking/info2/service/addService/index.js +82 -36
  49. package/es/components/booking/info2/service/addTimeModal/index.js +1 -0
  50. package/es/components/booking/info2/service/editService/index.js +11 -4
  51. package/es/components/booking/info2/service/index.js +5 -2
  52. package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -1
  53. package/es/components/booking/info2/service/serviceItem/index.js +16 -3
  54. package/es/components/booking/info2/service/serviceList/index.js +20 -1
  55. package/es/components/booking/info2/utilsByBooking.js +6 -2
  56. package/es/components/booking/locales.d.ts +60 -0
  57. package/es/components/booking/locales.js +63 -3
  58. package/es/components/booking/model.d.ts +2 -0
  59. package/es/components/booking/notes/index.d.ts +1 -1
  60. package/es/components/booking/notes/model.d.ts +2 -1
  61. package/es/components/booking/payments/model.d.ts +2 -1
  62. package/es/components/booking/utils.d.ts +1 -1
  63. package/es/components/booking/utils.js +54 -51
  64. package/es/components/schedules/index.d.ts +1 -1
  65. package/es/components/schedules/model.d.ts +2 -1
  66. package/es/index.d.ts +2 -0
  67. package/es/index.js +3 -1
  68. package/lib/components/booking/addons/model.d.ts +2 -1
  69. package/lib/components/booking/components/footer/index.js +30 -5
  70. package/lib/components/booking/dashboard/index.d.ts +20 -0
  71. package/lib/components/booking/dashboard/index.js +279 -0
  72. package/lib/components/booking/dashboard/serve.d.ts +1 -0
  73. package/lib/components/booking/dashboard/serve.js +33 -0
  74. package/lib/components/booking/forms/forms.d.ts +1 -0
  75. package/lib/components/booking/forms/forms.js +5 -2
  76. package/lib/components/booking/forms/model.d.ts +2 -1
  77. package/lib/components/booking/forms/single/index.d.ts +1 -1
  78. package/lib/components/booking/forms/single/index.js +4 -2
  79. package/lib/components/booking/hooks/useClearCart.d.ts +3 -0
  80. package/lib/components/booking/hooks/useClearCart.js +62 -0
  81. package/lib/components/booking/hooks/useCreateBookingPageHeader.d.ts +6 -0
  82. package/lib/components/booking/hooks/useCreateBookingPageHeader.js +53 -0
  83. package/lib/components/booking/info/addServiceVariant/index.d.ts +7 -0
  84. package/lib/components/booking/info/addServiceVariant/index.js +70 -0
  85. package/lib/components/booking/info/client/index.js +1 -1
  86. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
  87. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +4 -2
  88. package/lib/components/booking/info/clientVariant/vertical/index.js +88 -76
  89. package/lib/components/booking/info/clientVariant/vertical/index.less +8 -0
  90. package/lib/components/booking/info/index.less +19 -0
  91. package/lib/components/booking/info/main.js +9 -3
  92. package/lib/components/booking/info/pet/index.js +2 -1
  93. package/lib/components/booking/info/service/addService/index.d.ts +9 -3
  94. package/lib/components/booking/info/service/addService/index.js +66 -29
  95. package/lib/components/booking/info/service/addService/index.less +27 -1
  96. package/lib/components/booking/info/service/editService/index.js +9 -6
  97. package/lib/components/booking/info/service/index.js +4 -2
  98. package/lib/components/booking/info/service/index.less +18 -0
  99. package/lib/components/booking/info/service/serviceItem/index.d.ts +3 -3
  100. package/lib/components/booking/info/service/serviceItem/index.js +15 -1
  101. package/lib/components/booking/info/service/serviceItem/index.less +8 -0
  102. package/lib/components/booking/info/service/serviceList/index.js +18 -1
  103. package/lib/components/booking/info2/index.js +8 -2
  104. package/lib/components/booking/info2/service/addService/index.d.ts +8 -2
  105. package/lib/components/booking/info2/service/addService/index.js +66 -29
  106. package/lib/components/booking/info2/service/addTimeModal/index.js +1 -0
  107. package/lib/components/booking/info2/service/editService/index.js +7 -1
  108. package/lib/components/booking/info2/service/index.js +4 -2
  109. package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -1
  110. package/lib/components/booking/info2/service/serviceItem/index.js +14 -1
  111. package/lib/components/booking/info2/service/serviceList/index.js +18 -1
  112. package/lib/components/booking/info2/utilsByBooking.js +5 -1
  113. package/lib/components/booking/locales.d.ts +60 -0
  114. package/lib/components/booking/locales.js +63 -3
  115. package/lib/components/booking/model.d.ts +2 -0
  116. package/lib/components/booking/notes/index.d.ts +1 -1
  117. package/lib/components/booking/notes/model.d.ts +2 -1
  118. package/lib/components/booking/payments/model.d.ts +2 -1
  119. package/lib/components/booking/utils.d.ts +1 -1
  120. package/lib/components/booking/utils.js +57 -22
  121. package/lib/components/schedules/index.d.ts +1 -1
  122. package/lib/components/schedules/model.d.ts +2 -1
  123. package/lib/index.d.ts +2 -0
  124. package/lib/index.js +6 -0
  125. package/lowcode/booking-dashboard/meta.ts +137 -0
  126. package/lowcode/booking-vertical-add-service/meta.ts +124 -0
  127. package/lowcode/vertical-add-service/meta.ts +71 -0
  128. package/package.json +3 -3
@@ -0,0 +1,70 @@
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 import_addService2 = __toESM(require("../../info2/service/addService"));
38
+ var import_utils = require("../utils");
39
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
40
+ var AddServiceVariant = (props) => {
41
+ var _a, _b, _c, _d, _e, _f;
42
+ const { globalState, setGlobalState } = props;
43
+ const context = (0, import_useEngineContext.default)();
44
+ const stateRef = (0, import_react.useRef)(globalState);
45
+ stateRef.current = globalState;
46
+ const dispatch = ({ type, payload }) => {
47
+ if (type === "setService") {
48
+ setGlobalState({
49
+ service: { ...stateRef.current.service, ...payload }
50
+ });
51
+ }
52
+ };
53
+ let Cpt = import_addService.default;
54
+ if ((0, import_utils.isBooking4Shop)(
55
+ (_e = (_d = (_c = (_b = (_a = context.appHelper.utils.store) == null ? void 0 : _a.getState) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c.global) == null ? void 0 : _d.globalConfig) == null ? void 0 : _e.id,
56
+ (_f = props == null ? void 0 : props.globalState) == null ? void 0 : _f.renderType
57
+ )) {
58
+ Cpt = import_addService2.default;
59
+ }
60
+ return /* @__PURE__ */ import_react.default.createElement(
61
+ Cpt,
62
+ {
63
+ renderMode: "current",
64
+ dispatch,
65
+ state: globalState,
66
+ drawerProps: { open: true, getContainer: false }
67
+ }
68
+ );
69
+ };
70
+ var addServiceVariant_default = AddServiceVariant;
@@ -339,7 +339,7 @@ var Client = () => {
339
339
  }
340
340
  handleOpenClientModal();
341
341
  },
342
- style: state.bookingId ? {} : { marginTop: 16 }
342
+ style: state.bookingId ? {} : { marginTop: 12 }
343
343
  },
344
344
  /* @__PURE__ */ import_react.default.createElement(
345
345
  import_antd.Avatar,
@@ -18,6 +18,7 @@ interface SelectDrawerProps {
18
18
  handleAddPet: any;
19
19
  modalOpen: boolean;
20
20
  franchiseeLoading?: number;
21
+ showHeader?: boolean;
21
22
  }
22
23
  declare const _default: React.ForwardRefExoticComponent<SelectDrawerProps & React.RefAttributes<unknown>>;
23
24
  export default _default;
@@ -107,7 +107,8 @@ var SelectDrawer = (props, ref) => {
107
107
  showPet,
108
108
  handleAddPet,
109
109
  modalOpen,
110
- franchiseeLoading
110
+ franchiseeLoading,
111
+ showHeader
111
112
  } = props;
112
113
  const form = (formData == null ? void 0 : formData[0]) || {};
113
114
  const valList = (childrenValue == null ? void 0 : childrenValue[form.id]) || defaultArr;
@@ -273,7 +274,8 @@ var SelectDrawer = (props, ref) => {
273
274
  return /* @__PURE__ */ import_react.default.createElement(
274
275
  import_drawer.default,
275
276
  {
276
- title: import_utils.locales.getText("pisell2.text.select-customer"),
277
+ showGoBack: showHeader,
278
+ title: showHeader && import_utils.locales.getText("pisell2.text.select-customer"),
277
279
  open,
278
280
  onClose: closeDrawer,
279
281
  header: /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
@@ -333,93 +333,105 @@ var VerticalClient = (0, import_react.forwardRef)((props, ref) => {
333
333
  handleOpenClientModal();
334
334
  };
335
335
  (0, import_react.useImperativeHandle)(ref, () => {
336
+ var _a2, _b2;
336
337
  return {
337
- close: () => {
338
- var _a2;
339
- (_a2 = modalRef.current) == null ? void 0 : _a2.close();
340
- }
338
+ open: handleOpenClientModal,
339
+ close: (_a2 = modalRef.current) == null ? void 0 : _a2.close,
340
+ setSearch: (_b2 = modalRef.current) == null ? void 0 : _b2.setSearch
341
341
  };
342
342
  });
343
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-vertical-client-wrap" }, /* @__PURE__ */ import_react.default.createElement(
343
+ return /* @__PURE__ */ import_react.default.createElement(
344
344
  "div",
345
345
  {
346
- className: (0, import_classnames.default)("pisell-lowcode__booking-vertical-client", {
347
- "pisell-lowcode__booking-vertical-client-walkin": isWalkIn
348
- }),
349
- onClick: handleOpenClient
346
+ className: (0, import_classnames.default)("pisell-lowcode__booking-vertical-client-wrap", {
347
+ ["create-booking-page-vertical-client-wrap"]: state.isBookingCreatePage
348
+ })
350
349
  },
351
- /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: false, active: true, round: true }, /* @__PURE__ */ import_react.default.createElement(
352
- import_antd.Avatar,
353
- {
354
- className: "pisell-lowcode__booking-client-avatar",
355
- src: import_utils.image.ali((_y = state.client.value) == null ? void 0 : _y.cover, 100),
356
- size: 64,
357
- icon: /* @__PURE__ */ import_react.default.createElement(import_User01.default, { className: "pisell-lowcode__booking-client-list-item-avatar-icon" })
358
- }
359
- ), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, import_utils.locales.getText("pisell2.text.add-client")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in"))) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, getNickname(state.client.value)), ((_z = state.client.value) == null ? void 0 : _z.email) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, (_A = state.client.value) == null ? void 0 : _A.email) : null, ((_B = state.client.value) == null ? void 0 : _B.phone) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, (_C = state.client.value) == null ? void 0 : _C.phone) : null), !isWalkIn && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-action-wrap" }, !state.disabledEdit && /* @__PURE__ */ import_react.default.createElement(
360
- import_antd.Dropdown.Button,
350
+ /* @__PURE__ */ import_react.default.createElement(
351
+ "div",
361
352
  {
362
- menu: {
363
- items: menus,
364
- onClick: menuChange
353
+ className: (0, import_classnames.default)("pisell-lowcode__booking-vertical-client", {
354
+ "pisell-lowcode__booking-vertical-client-walkin": isWalkIn
355
+ }),
356
+ onClick: handleOpenClient
357
+ },
358
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: false, active: true, round: true }, /* @__PURE__ */ import_react.default.createElement(
359
+ import_antd.Avatar,
360
+ {
361
+ className: "pisell-lowcode__booking-client-avatar",
362
+ src: import_utils.image.ali((_y = state.client.value) == null ? void 0 : _y.cover, 100),
363
+ size: 64,
364
+ icon: /* @__PURE__ */ import_react.default.createElement(import_User01.default, { className: "pisell-lowcode__booking-client-list-item-avatar-icon" })
365
+ }
366
+ ), isWalkIn ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-info-desc" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, import_utils.locales.getText("pisell2.text.add-client")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, import_utils.locales.getText("pisell2.text.leave-empty-for-walk-in"))) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-title" }, getNickname(state.client.value)), ((_z = state.client.value) == null ? void 0 : _z.email) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, (_A = state.client.value) == null ? void 0 : _A.email) : null, ((_B = state.client.value) == null ? void 0 : _B.phone) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-desc-item" }, (_C = state.client.value) == null ? void 0 : _C.phone) : null), !isWalkIn && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-client-action-wrap" }, !state.disabledEdit && /* @__PURE__ */ import_react.default.createElement(
367
+ import_antd.Dropdown.Button,
368
+ {
369
+ menu: {
370
+ items: menus,
371
+ onClick: menuChange
372
+ },
373
+ placement: "bottomRight",
374
+ onClick: () => handleOpenClientModal()
365
375
  },
366
- placement: "bottomRight",
367
- onClick: () => handleOpenClientModal()
376
+ import_utils.locales.getText("pisell2.text.variant-client-change")
377
+ ), /* @__PURE__ */ import_react.default.createElement(
378
+ import_antd.Button,
379
+ {
380
+ onClick: (e) => {
381
+ e.stopPropagation();
382
+ handleViewClient();
383
+ }
384
+ },
385
+ import_utils.locales.getText("pisell2.text.view-profile")
386
+ )))
387
+ ),
388
+ /* @__PURE__ */ import_react.default.createElement(
389
+ "div",
390
+ {
391
+ className: (0, import_classnames.default)("pisell-lowcode__booking-vertical-pet", {
392
+ "pisell-lowcode__booking-vertical-pet-walkin": isWalkIn
393
+ }),
394
+ onClick: handleOpenClient
368
395
  },
369
- import_utils.locales.getText("pisell2.text.variant-client-change")
370
- ), /* @__PURE__ */ import_react.default.createElement(
396
+ petRender
397
+ ),
398
+ isShowAddBtn && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-vertical-footer" }, /* @__PURE__ */ import_react.default.createElement(
371
399
  import_antd.Button,
372
400
  {
373
- onClick: (e) => {
374
- e.stopPropagation();
375
- handleViewClient();
376
- }
377
- },
378
- import_utils.locales.getText("pisell2.text.view-profile")
379
- )))
380
- ), /* @__PURE__ */ import_react.default.createElement(
381
- "div",
382
- {
383
- className: (0, import_classnames.default)("pisell-lowcode__booking-vertical-pet", {
384
- "pisell-lowcode__booking-vertical-pet-walkin": isWalkIn
385
- }),
386
- onClick: handleOpenClient
387
- },
388
- petRender
389
- ), isShowAddBtn && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-vertical-footer" }, /* @__PURE__ */ import_react.default.createElement(
390
- import_antd.Button,
391
- {
392
- onClick: () => {
393
- const currentClientSearchValue = getCurrentClientSearchValue();
394
- modalRef.current.setSearch(currentClientSearchValue);
395
- handleOpenClientModal(currentClientSearchValue);
401
+ onClick: () => {
402
+ const currentClientSearchValue = getCurrentClientSearchValue();
403
+ modalRef.current.setSearch(currentClientSearchValue);
404
+ handleOpenClientModal(currentClientSearchValue);
405
+ },
406
+ block: true,
407
+ size: "large"
396
408
  },
397
- block: true,
398
- size: "large"
399
- },
400
- import_utils.locales.getText("pisell2.text.select")
401
- )), /* @__PURE__ */ import_react.default.createElement(
402
- import_SelectDrawer.default,
403
- {
404
- modalOpen: state.modalOpen,
405
- loading,
406
- autoFocus: !((_F = (_E = (_D = context == null ? void 0 : context.appHelper) == null ? void 0 : _D.utils) == null ? void 0 : _E.isTerminal) == null ? void 0 : _F.call(_E)),
407
- ref: modalRef,
408
- onClose: handleClose,
409
- handleSelectClient,
410
- handleCreateItem,
411
- childrenValue: state.pet.value,
412
- handleSelectPet,
413
- formData: state.pet.formData,
414
- searchChange,
415
- options: renderList,
416
- holder: (_G = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _G.holder,
417
- client: (_H = state == null ? void 0 : state.client) == null ? void 0 : _H.value,
418
- loadMore,
419
- showPet: (boardConfig == null ? void 0 : boardConfig.type) === "form",
420
- handleAddPet,
421
- franchiseeLoading
422
- }
423
- ));
409
+ import_utils.locales.getText("pisell2.text.select")
410
+ )),
411
+ /* @__PURE__ */ import_react.default.createElement(
412
+ import_SelectDrawer.default,
413
+ {
414
+ showHeader: !state.isBookingCreatePage,
415
+ modalOpen: state.modalOpen,
416
+ loading,
417
+ autoFocus: !((_F = (_E = (_D = context == null ? void 0 : context.appHelper) == null ? void 0 : _D.utils) == null ? void 0 : _E.isTerminal) == null ? void 0 : _F.call(_E)),
418
+ ref: modalRef,
419
+ onClose: handleClose,
420
+ handleSelectClient,
421
+ handleCreateItem,
422
+ childrenValue: state.pet.value,
423
+ handleSelectPet,
424
+ formData: state.pet.formData,
425
+ searchChange,
426
+ options: renderList,
427
+ holder: (_G = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _G.holder,
428
+ client: (_H = state == null ? void 0 : state.client) == null ? void 0 : _H.value,
429
+ loadMore,
430
+ showPet: (boardConfig == null ? void 0 : boardConfig.type) === "form",
431
+ handleAddPet,
432
+ franchiseeLoading
433
+ }
434
+ )
435
+ );
424
436
  });
425
437
  var vertical_default = VerticalClient;
@@ -117,3 +117,11 @@
117
117
  line-height: 24px;
118
118
  }
119
119
  }
120
+ .create-booking-page-vertical-client-wrap {
121
+ .pisell-lowcode__booking-drawer-title-wrap {
122
+ padding: 16px 16px 0 !important;
123
+ }
124
+ .pisell-lowcode-input-affix-wrapper {
125
+ margin-top: 0 !important;
126
+ }
127
+ }
@@ -15,4 +15,23 @@
15
15
  // height: 42px;
16
16
  // background: #069456;
17
17
  // }
18
+ }
19
+ #create-booking-page-info-wrap {
20
+ .pisell-lowcode__booking-tab-pane-footer {
21
+ padding: 12px 16px !important;
22
+ }
23
+ }
24
+ .create-booking-page-info-wrap-create {
25
+ background: var(--Success-50, #ECFDF3);
26
+ }
27
+ .create-booking-page-info-wrap {
28
+ position: initial !important;
29
+ padding: 0 16px !important;
30
+ .booking-info-create-new {
31
+ margin-top: 10px;
32
+ color: var(--Base-Black, #000);
33
+ font-size: 24px;
34
+ font-weight: 600;
35
+ line-height: 32px;
36
+ }
18
37
  }
@@ -49,7 +49,9 @@ var import_date2 = require("./date");
49
49
  var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
50
50
  var import_notes = __toESM(require("./notes"));
51
51
  var import_index = require("./index.less");
52
+ var import_classnames = __toESM(require("classnames"));
52
53
  var import_antd = require("antd");
54
+ var import_useCreateBookingPageHeader = __toESM(require("../hooks/useCreateBookingPageHeader"));
53
55
  var defaultModules = {
54
56
  client: 1,
55
57
  date: 1,
@@ -68,6 +70,7 @@ var Info = (0, import_model.Provider)((props) => {
68
70
  var _a2, _b2, _c2, _d2;
69
71
  return ((_d2 = (_c2 = (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.bookingConfig) == null ? void 0 : _b2.config) == null ? void 0 : _c2.basic) == null ? void 0 : _d2.appointment_subject) || {};
70
72
  }, [(_d = (_c = (_b = (_a = modal.state) == null ? void 0 : _a.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.appointment_subject]);
73
+ const { createHeader, isBookingCreatePage, isBookingCreatePageCreateMode } = (0, import_useCreateBookingPageHeader.default)(globalState);
71
74
  (0, import_react.useEffect)(() => {
72
75
  document.body.id = "body";
73
76
  if (props.setState) {
@@ -122,7 +125,7 @@ var Info = (0, import_model.Provider)((props) => {
122
125
  if (!modules.note) {
123
126
  return null;
124
127
  }
125
- return (globalState == null ? void 0 : globalState.bookingId) ? globalState.renderType === "eventBooking" ? /* @__PURE__ */ import_react.default.createElement(import_notes.default, null) : null : /* @__PURE__ */ import_react.default.createElement(import_addNote.default, { value: (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.notes) == null ? void 0 : _b2.orderNote, onChange: addNote });
128
+ return (globalState == null ? void 0 : globalState.bookingId) ? globalState.renderType === "eventBooking" || globalState.isBookingCreatePage ? /* @__PURE__ */ import_react.default.createElement(import_notes.default, null) : null : /* @__PURE__ */ import_react.default.createElement(import_addNote.default, { value: (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.notes) == null ? void 0 : _b2.orderNote, onChange: addNote });
126
129
  }, [
127
130
  modules.note,
128
131
  globalState == null ? void 0 : globalState.bookingId,
@@ -145,9 +148,12 @@ var Info = (0, import_model.Provider)((props) => {
145
148
  style: {
146
149
  height: ((_h = (_g = context == null ? void 0 : context.appHelper) == null ? void 0 : _g.utils) == null ? void 0 : _h.isMobile) ? "100%" : "100vh"
147
150
  },
148
- bodyClassName: "booking-info-warp"
151
+ bodyClassName: (0, import_classnames.default)("booking-info-warp", {
152
+ ["create-booking-page-info-wrap"]: isBookingCreatePage,
153
+ ["create-booking-page-info-wrap-create"]: isBookingCreatePageCreateMode
154
+ })
149
155
  },
150
- /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((_i = modal.state) == null ? void 0 : _i.disabledEdit) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, params.type === "form" ? /* @__PURE__ */ import_react.default.createElement(import_pet.default, null) : null) : null, modules.date ? /* @__PURE__ */ import_react.default.createElement(import_date.default, null) : null, /* @__PURE__ */ import_react.default.createElement(
156
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, createHeader, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((_i = modal.state) == null ? void 0 : _i.disabledEdit) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, params.type === "form" ? /* @__PURE__ */ import_react.default.createElement(import_pet.default, null) : null) : null, modules.date ? /* @__PURE__ */ import_react.default.createElement(import_date.default, null) : null, /* @__PURE__ */ import_react.default.createElement(
151
157
  import_antd.Skeleton,
152
158
  {
153
159
  loading: globalState.loading,
@@ -410,7 +410,8 @@ var Pet = (props) => {
410
410
  state.disableEventBookingEdit,
411
411
  params.search,
412
412
  loadMore,
413
- addButtonProps
413
+ addButtonProps,
414
+ state.isBookingCreatePage
414
415
  ]);
415
416
  };
416
417
  var pet_default = Pet;
@@ -1,6 +1,12 @@
1
1
  import React from 'react';
2
+ import { PisellDrawerProps } from '../../../components/drawer';
2
3
  import './index.less';
3
- declare const Info: ({ onEdit }: {
4
- onEdit: any;
5
- }) => React.JSX.Element;
4
+ interface AddServiceProps {
5
+ onEdit?: any;
6
+ dispatch?: any;
7
+ state?: any;
8
+ drawerProps?: PisellDrawerProps;
9
+ renderMode?: 'current' | 'drawer';
10
+ }
11
+ declare const Info: (props: AddServiceProps) => React.JSX.Element;
6
12
  export default Info;
@@ -63,13 +63,16 @@ var shopList = [
63
63
  6848,
64
64
  6305
65
65
  ];
66
- var Info = ({ onEdit }) => {
66
+ var Info = (props) => {
67
67
  var _a, _b, _c, _d;
68
+ const { onEdit, drawerProps, renderMode } = props;
68
69
  const [search, setSearch] = (0, import_react.useState)("");
69
- const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
70
+ let { state, dispatch } = (0, import_react.useContext)(import_model.Context);
70
71
  const [loading, setLoading] = (0, import_react.useState)(false);
71
72
  const searchRef = (0, import_react.useRef)();
72
73
  const context = (0, import_useEngineContext.default)();
74
+ state = state || (props == null ? void 0 : props.state);
75
+ dispatch = dispatch || (props == null ? void 0 : props.dispatch);
73
76
  import_utils3.request.setRequest(context.appHelper.utils.request);
74
77
  const setDefaultService = async (list) => {
75
78
  if (state.renderType !== "eventBooking") {
@@ -120,7 +123,7 @@ var Info = ({ onEdit }) => {
120
123
  }
121
124
  });
122
125
  };
123
- const getServices = async () => {
126
+ const getServices = async (params) => {
124
127
  var _a2;
125
128
  setLoading(true);
126
129
  let data = await state.apis.getServices({
@@ -134,8 +137,10 @@ var Info = ({ onEdit }) => {
134
137
  with_count: ["bundleGroup", "optionGroup"],
135
138
  order_by_string: "sort:desc",
136
139
  status: "published",
137
- _config: {
138
- useCache: true
140
+ ...state.isBookingCreatePage ? { schedule_date: params == null ? void 0 : params.schedule_date } : {
141
+ _config: {
142
+ useCache: true
143
+ }
139
144
  }
140
145
  });
141
146
  setLoading(false);
@@ -211,6 +216,9 @@ var Info = ({ onEdit }) => {
211
216
  cacheItem._id = (_a2 = state.service.cacheItem) == null ? void 0 : _a2._id;
212
217
  cacheItem.new = 0;
213
218
  }
219
+ if (renderMode === "current") {
220
+ cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
221
+ }
214
222
  cacheItem._extend = (0, import_utils2.getProductExtend)({ cacheItem, state });
215
223
  if (state.renderType === "eventBooking") {
216
224
  cacheItem.autoClose = false;
@@ -269,12 +277,24 @@ var Info = ({ onEdit }) => {
269
277
  setSearch("");
270
278
  }
271
279
  }, [state.service.addModal]);
280
+ const currentDate = (0, import_react.useMemo)(() => {
281
+ return state.date.value.format("YYYY-MM-DD");
282
+ }, [state.date.value]);
283
+ console.log(currentDate, "currentDate");
284
+ (0, import_react.useEffect)(() => {
285
+ if (renderMode === "current") {
286
+ getServices({ schedule_date: currentDate });
287
+ }
288
+ }, [renderMode, currentDate]);
272
289
  (0, import_react.useEffect)(() => {
273
290
  if (state.renderType === "eventBooking" && state.modalOpen) {
274
291
  getServices();
275
292
  }
276
293
  }, [state.renderType, state.modalOpen]);
277
294
  const addButton = (0, import_react.useMemo)(() => {
295
+ if (state.isBookingCreatePage) {
296
+ return /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } });
297
+ }
278
298
  if (state.renderType === "eventBooking") {
279
299
  return isService ? /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } }) : /* @__PURE__ */ import_react.default.createElement(
280
300
  import_addButton.default,
@@ -303,13 +323,50 @@ var Info = ({ onEdit }) => {
303
323
  state.service.value,
304
324
  loading
305
325
  ]);
326
+ const isRenderCurrent = (0, import_react.useMemo)(() => {
327
+ return renderMode === "current";
328
+ }, [renderMode]);
306
329
  return (0, import_react.useMemo)(() => {
307
330
  var _a2, _b2;
331
+ const header = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header" }, /* @__PURE__ */ import_react.default.createElement(
332
+ import_antd.Input,
333
+ {
334
+ ref: searchRef,
335
+ prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
336
+ style: { marginTop: 16, height: 44 },
337
+ placeholder: import_utils4.locales.getText("pisell2.text.search"),
338
+ allowClear: true,
339
+ value: search,
340
+ onChange: (e) => {
341
+ setSearch(e.target.value);
342
+ }
343
+ }
344
+ ));
345
+ const content = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body" }, /* @__PURE__ */ import_react.default.createElement(
346
+ import_TabProduct.default,
347
+ {
348
+ list: renderList,
349
+ amountSymbol: state.amountSymbol,
350
+ onChange: handleSelectProduct,
351
+ scrollDom: isRenderCurrent ? ".pisell-lowcode__booking-vertical-add-service-wrap" : ".booking-server-wrap .pisell-lowcode-drawer-body "
352
+ }
353
+ ));
354
+ if (renderMode === "current") {
355
+ return /* @__PURE__ */ import_react.default.createElement(
356
+ "div",
357
+ {
358
+ className: "pisell-lowcode__booking-vertical-add-service-wrap",
359
+ style: { width: "100%", height: "100%", overflow: "auto" }
360
+ },
361
+ header,
362
+ content
363
+ );
364
+ }
308
365
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2.autoClose) && /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true, round: true }), addButton, /* @__PURE__ */ import_react.default.createElement(
309
366
  import_drawer.default,
310
367
  {
311
368
  titleNoWrap: true,
312
- open: state.service.addModal,
369
+ open: state.service.addModal && !state.isBookingCreatePage,
313
370
  title: import_utils4.locales.getText("pisell2.text.select-service"),
314
371
  rootClassName: "booking-server-wrap",
315
372
  onClose: () => {
@@ -321,30 +378,10 @@ var Info = ({ onEdit }) => {
321
378
  }
322
379
  });
323
380
  },
324
- header: /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header" }, /* @__PURE__ */ import_react.default.createElement(
325
- import_antd.Input,
326
- {
327
- ref: searchRef,
328
- prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
329
- style: { marginTop: 16, height: 44 },
330
- placeholder: import_utils4.locales.getText("pisell2.text.search"),
331
- allowClear: true,
332
- value: search,
333
- onChange: (e) => {
334
- setSearch(e.target.value);
335
- }
336
- }
337
- ))
381
+ header,
382
+ ...drawerProps || {}
338
383
  },
339
- /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body" }, /* @__PURE__ */ import_react.default.createElement(
340
- import_TabProduct.default,
341
- {
342
- list: renderList,
343
- amountSymbol: state.amountSymbol,
344
- onChange: handleSelectProduct,
345
- scrollDom: ".booking-server-wrap .pisell-lowcode-drawer-body"
346
- }
347
- ))
384
+ content
348
385
  ));
349
386
  }, [
350
387
  (_d = (_c = state.service) == null ? void 0 : _c.cacheItem) == null ? void 0 : _d.autoClose,
@@ -3,7 +3,33 @@
3
3
  // border-bottom: 1px solid var(--gray-300, #D0D5DD);
4
4
  }
5
5
 
6
-
7
6
  .pisell-lowcode__booking-service-body {
8
7
  background: var(--gray-50, #F9FAFB);
8
+ }
9
+
10
+ .pisell-lowcode__booking-vertical-add-service-wrap {
11
+ &::-webkit-scrollbar {
12
+ display: none !important;
13
+ }
14
+ .pisell-lowcode__booking-service-header {
15
+ background-color: #fff;
16
+ top: 0;
17
+ position: sticky;
18
+ z-index: 2;
19
+ padding: 16px !important;
20
+ margin: 0;
21
+ .pisell-lowcode-input-affix-wrapper {
22
+ margin: 0 !important;
23
+ }
24
+ }
25
+ .booking-category-list {
26
+ padding: 0 16px !important;
27
+ }
28
+ .pisell-lowcode__booking-service-body {
29
+ .booking-tab-product {
30
+ .booking-tabs-wrap {
31
+ top: 76px !important;
32
+ }
33
+ }
34
+ }
9
35
  }
@@ -118,7 +118,7 @@ var Info = (_, ref) => {
118
118
  } catch (err) {
119
119
  }
120
120
  }, [useDuration, flexibleOption]);
121
- const getResources = async (cacheItem) => {
121
+ const getResources = async (cacheItem, open) => {
122
122
  console.log("getResources2");
123
123
  try {
124
124
  let _list = state.service.resourcesOrigin || [];
@@ -143,7 +143,7 @@ var Info = (_, ref) => {
143
143
  }, 200);
144
144
  } else {
145
145
  setTimeout(() => {
146
- if (selectOpen === void 0) {
146
+ if (selectOpen === void 0 || open) {
147
147
  setSelectOpen(true);
148
148
  }
149
149
  }, 500);
@@ -266,12 +266,12 @@ var Info = (_, ref) => {
266
266
  }
267
267
  });
268
268
  });
269
- const setEditData = (0, import_ahooks.useMemoizedFn)((_cacheItem) => {
269
+ const setEditData = (0, import_ahooks.useMemoizedFn)((_cacheItem, open) => {
270
270
  let cacheItem = _cacheItem || state.service.cacheItem;
271
271
  let values = cacheItem._extend;
272
272
  form.setFieldsValue(values);
273
273
  if (state.renderType !== "eventBooking") {
274
- getResources(_cacheItem);
274
+ getResources(cacheItem, open);
275
275
  }
276
276
  });
277
277
  const isReason = (0, import_react.useMemo)(() => {
@@ -298,7 +298,10 @@ var Info = (_, ref) => {
298
298
  (_f = state.service.cacheItem) == null ? void 0 : _f.autoClose
299
299
  ]);
300
300
  (0, import_react.useEffect)(() => {
301
- }, [state.service.editModal]);
301
+ if (state.isBookingCreatePage && state.service.editModal) {
302
+ setEditData(null, true);
303
+ }
304
+ }, [state.service.editModal, state.isBookingCreatePage]);
302
305
  (0, import_react.useEffect)(() => {
303
306
  getErrorMsg();
304
307
  }, [useResource, useStartTime, useDuration]);
@@ -435,7 +438,7 @@ var Info = (_, ref) => {
435
438
  });
436
439
  }
437
440
  },
438
- /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Page, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { layout: "vertical", form, onFinish }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "product_name" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((_d2 = (_c2 = (_b2 = state.service) == null ? void 0 : _b2.cacheItem) == null ? void 0 : _c2._extend) == null ? void 0 : _d2.product_name) || "-"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleEdit }, import_utils.locales.getText("pisell2.text.edit")), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleChange }, import_utils.locales.getText("pisell2.text.change"))), /* @__PURE__ */ import_react.default.createElement(
441
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Page, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { layout: "vertical", form, onFinish }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "product_name" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((_d2 = (_c2 = (_b2 = state.service) == null ? void 0 : _b2.cacheItem) == null ? void 0 : _c2._extend) == null ? void 0 : _d2.product_name) || "-"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleEdit }, import_utils.locales.getText("pisell2.text.edit")), !state.isBookingCreatePage && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleChange }, import_utils.locales.getText("pisell2.text.change"))), /* @__PURE__ */ import_react.default.createElement(
439
442
  import_collapsibleList.default,
440
443
  {
441
444
  style: { marginTop: bundles.length ? "8px" : 0 },