@pisell/private-materials 3.0.26 → 3.0.28

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 (58) 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 +4 -4
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +6 -6
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +4 -4
  11. package/es/components/booking/addons/index.d.ts +1 -1
  12. package/es/components/booking/addons/index.js +2 -0
  13. package/es/components/booking/addons/model.d.ts +2 -1
  14. package/es/components/booking/components/customSelect/index.js +2 -1
  15. package/es/components/booking/components/tabPane/index.less +1 -0
  16. package/es/components/booking/forms/forms.d.ts +1 -1
  17. package/es/components/booking/forms/index.d.ts +1 -1
  18. package/es/components/booking/forms/model.d.ts +2 -1
  19. package/es/components/booking/index.d.ts +1 -1
  20. package/es/components/booking/info/index.d.ts +1 -1
  21. package/es/components/booking/info/index.js +8 -5
  22. package/es/components/booking/info/model.d.ts +2 -1
  23. package/es/components/booking/model.d.ts +2 -1
  24. package/es/components/booking/notes/index.d.ts +1 -1
  25. package/es/components/booking/notes/model.d.ts +2 -1
  26. package/es/components/booking/payments/index.d.ts +1 -1
  27. package/es/components/booking/payments/index.js +1 -1
  28. package/es/components/booking/payments/model.d.ts +2 -1
  29. package/es/components/schedules/index.d.ts +1 -1
  30. package/es/components/schedules/locales.d.ts +3 -0
  31. package/es/components/schedules/locales.js +6 -3
  32. package/es/components/schedules/model.d.ts +2 -1
  33. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +91 -3
  34. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.less +20 -0
  35. package/lib/components/booking/addons/index.d.ts +1 -1
  36. package/lib/components/booking/addons/model.d.ts +2 -1
  37. package/lib/components/booking/components/customSelect/index.js +2 -1
  38. package/lib/components/booking/components/tabPane/index.less +1 -0
  39. package/lib/components/booking/forms/forms.d.ts +1 -1
  40. package/lib/components/booking/forms/index.d.ts +1 -1
  41. package/lib/components/booking/forms/model.d.ts +2 -1
  42. package/lib/components/booking/index.d.ts +1 -1
  43. package/lib/components/booking/info/index.d.ts +1 -1
  44. package/lib/components/booking/info/index.js +7 -2
  45. package/lib/components/booking/info/model.d.ts +2 -1
  46. package/lib/components/booking/model.d.ts +2 -1
  47. package/lib/components/booking/notes/index.d.ts +1 -1
  48. package/lib/components/booking/notes/model.d.ts +2 -1
  49. package/lib/components/booking/payments/index.d.ts +1 -1
  50. package/lib/components/booking/payments/index.js +1 -1
  51. package/lib/components/booking/payments/model.d.ts +2 -1
  52. package/lib/components/schedules/index.d.ts +1 -1
  53. package/lib/components/schedules/locales.d.ts +3 -0
  54. package/lib/components/schedules/locales.js +6 -3
  55. package/lib/components/schedules/model.d.ts +2 -1
  56. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +64 -3
  57. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.less +20 -0
  58. package/package.json +3 -3
@@ -80,7 +80,7 @@ var Payments = (0, import_model.Provider)((props) => {
80
80
  }
81
81
  });
82
82
  }
83
- }, [state.bookingDetail, state.refresh]);
83
+ }, [state.bookingDetail]);
84
84
  const getRefundInfo = async () => {
85
85
  const res = await state.apis.getRefundInfo();
86
86
  setRefundAmount(res.total_refund_amount);
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -1,3 +1,3 @@
1
1
  import "./index.less";
2
- declare const Schedules: (props: any) => JSX.Element;
2
+ declare const Schedules: (props: any) => any;
3
3
  export default Schedules;
@@ -25,6 +25,7 @@ declare const _default: {
25
25
  'pisell2.text.products.unsaved-back': string;
26
26
  'pisell2.text.products.unsaved-yes': string;
27
27
  'pisell2.text.products.max-participants-error': string;
28
+ 'pisell2.text.schedules.create-new-schedule': string;
28
29
  };
29
30
  'zh-CN': {
30
31
  'pisell2.text.schedules.all-day': string;
@@ -52,6 +53,7 @@ declare const _default: {
52
53
  'pisell2.text.products.unsaved-back': string;
53
54
  'pisell2.text.products.unsaved-yes': string;
54
55
  'pisell2.text.products.max-participants-error': string;
56
+ 'pisell2.text.schedules.create-new-schedule': string;
55
57
  };
56
58
  'zh-HK': {
57
59
  'pisell2.text.schedules.all-day': string;
@@ -79,6 +81,7 @@ declare const _default: {
79
81
  'pisell2.text.products.unsaved-back': string;
80
82
  'pisell2.text.products.unsaved-yes': string;
81
83
  'pisell2.text.products.max-participants-error': string;
84
+ 'pisell2.text.schedules.create-new-schedule': string;
82
85
  };
83
86
  };
84
87
  export default _default;
@@ -48,7 +48,8 @@ var locales_default = {
48
48
  "pisell2.text.products.unsaved-content": "Navigating away without saving will discard your changes. Are you sure you want to proceed?",
49
49
  "pisell2.text.products.unsaved-back": "Go back",
50
50
  "pisell2.text.products.unsaved-yes": "Yes, discard",
51
- "pisell2.text.products.max-participants-error": "Please set max participants"
51
+ "pisell2.text.products.max-participants-error": "Please set max participants",
52
+ "pisell2.text.schedules.create-new-schedule": "Create new schedule"
52
53
  },
53
54
  "zh-CN": {
54
55
  "pisell2.text.schedules.all-day": "全天",
@@ -75,7 +76,8 @@ var locales_default = {
75
76
  "pisell2.text.products.unsaved-content": "若不保存即离开,您所做的修改将会丢失。确定要继续吗?",
76
77
  "pisell2.text.products.unsaved-back": "返回",
77
78
  "pisell2.text.products.unsaved-yes": "是的,退出",
78
- "pisell2.text.products.max-participants-error": "请设置最大参与人数"
79
+ "pisell2.text.products.max-participants-error": "请设置最大参与人数",
80
+ "pisell2.text.schedules.create-new-schedule": "创建新日程"
79
81
  },
80
82
  "zh-HK": {
81
83
  "pisell2.text.schedules.all-day": "全天",
@@ -102,6 +104,7 @@ var locales_default = {
102
104
  "pisell2.text.products.unsaved-content": "若不保即離開,您做的修改將會丟失。確定要繼續嗎?",
103
105
  "pisell2.text.products.unsaved-back": "返回",
104
106
  "pisell2.text.products.unsaved-yes": "是的,退出",
105
- "pisell2.text.products.max-participants-error": "請設置最大參與人數"
107
+ "pisell2.text.products.max-participants-error": "請設置最大參與人數",
108
+ "pisell2.text.schedules.create-new-schedule": "創建新日程"
106
109
  }
107
110
  };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CalendarDataItem, ScheduleItem } from "./type";
2
3
  import dayjs from "dayjs";
3
4
  export interface FormState {
@@ -68,7 +69,7 @@ export interface FormState {
68
69
  };
69
70
  setGlobalState: Function | null;
70
71
  }
71
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
72
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
72
73
  state: FormState;
73
74
  } & {
74
75
  dispatch: (params: {
@@ -39,18 +39,58 @@ var import_react = __toESM(require("react"));
39
39
  var import_customSelect = __toESM(require("../../../../../../booking/components/customSelect"));
40
40
  var import_model = require("../../../../../model");
41
41
  var import_serve = require("../../../../serve");
42
+ var import_useComponents = __toESM(require("../../../../../../../hooks/useComponents"));
43
+ var import_useEngineContext = __toESM(require("../../../../../../../hooks/useEngineContext"));
42
44
  var import_index = require("./index.less");
43
45
  var AddSchedules = ({ value, onChange, drawerContainer, isSelf }) => {
44
46
  var _a;
45
47
  const modalRef = (0, import_react.useRef)(null);
46
48
  const { state } = (0, import_react.useContext)(import_model.Context);
49
+ const { appHelper } = (0, import_useEngineContext.default)();
50
+ const createSchedules = (0, import_react.useRef)();
51
+ const AllCreateScheduleRef = (0, import_react.useRef)(null);
52
+ const [ScheduleCreateType, AllCreateSchedule] = (0, import_useComponents.default)({
53
+ components: ["ScheduleCreateType", "AllCreateSchedule"]
54
+ });
47
55
  const _getScheduleList = (0, import_ahooks.useRequest)(import_serve.getSchedules, {
48
56
  manual: true,
49
57
  onSuccess: (res) => {
50
58
  }
51
59
  });
52
60
  const onFinish = (e) => {
53
- onChange(e);
61
+ var _a2;
62
+ const idMap = ((_a2 = _getScheduleList == null ? void 0 : _getScheduleList.data) == null ? void 0 : _a2.reduce((p, c) => {
63
+ return { ...p, [c.id]: c };
64
+ }, {})) || {};
65
+ onChange(e.map((item) => idMap[item.id]));
66
+ };
67
+ const handleCreateSchedule = () => {
68
+ var _a2, _b;
69
+ (_b = (_a2 = createSchedules.current) == null ? void 0 : _a2.open) == null ? void 0 : _b.call(_a2, {
70
+ getContainer: void 0
71
+ });
72
+ };
73
+ const handleAddSchedule = (data) => {
74
+ _getScheduleList.mutate((oldData) => [data, ...oldData || []]);
75
+ modalRef.current.setValue((v) => [...v, data]);
76
+ setTimeout(() => {
77
+ var _a2, _b;
78
+ (_b = (_a2 = document.getElementById(data.id)) == null ? void 0 : _a2.scrollIntoView) == null ? void 0 : _b.call(_a2, { block: "center", behavior: "smooth" });
79
+ });
80
+ };
81
+ const handleEdit = (e, id) => {
82
+ var _a2, _b;
83
+ e.stopPropagation();
84
+ (_b = (_a2 = AllCreateScheduleRef.current) == null ? void 0 : _a2.open) == null ? void 0 : _b.call(_a2, { id });
85
+ };
86
+ const handleChangeResData = (data) => {
87
+ _getScheduleList.mutate((oldData) => (oldData || []).map((item) => {
88
+ var _a2;
89
+ if (item.id === data.id) {
90
+ return { ...data, name: ((_a2 = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _a2.translationShop(data.name)) || data.name };
91
+ }
92
+ return item;
93
+ }));
54
94
  };
55
95
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
56
96
  import_antd.Button,
@@ -73,9 +113,11 @@ var AddSchedules = ({ value, onChange, drawerContainer, isSelf }) => {
73
113
  ref: modalRef,
74
114
  rowKey: "id",
75
115
  options: isSelf ? _getScheduleList.data || [] : ((_a = state == null ? void 0 : state.schedules) == null ? void 0 : _a.list) || [],
116
+ createItemText: import_utils.locales.getText("pisell2.text.schedules.create-new-schedule"),
76
117
  loading: _getScheduleList.loading,
77
118
  value,
78
119
  onValueChange: onFinish,
120
+ handleCreateItem: handleCreateSchedule,
79
121
  isPreview: false,
80
122
  drawerProps: {
81
123
  title: import_utils.locales.getText("pisell2.text.schedules.assign-schedule"),
@@ -91,18 +133,37 @@ var AddSchedules = ({ value, onChange, drawerContainer, isSelf }) => {
91
133
  },
92
134
  mode: "multiple",
93
135
  optionRender: (item) => {
94
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
136
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__add-schedule-list-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__add-schedule-list-item-content" }, /* @__PURE__ */ import_react.default.createElement(
95
137
  "div",
96
138
  {
97
139
  className: "pisell-lowcode__add-schedule-list-item-color",
98
140
  style: { backgroundColor: item.color }
99
141
  }
100
- ), item.name);
142
+ ), item.name), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__add-schedule-list-item-action-wrap" }, /* @__PURE__ */ import_react.default.createElement(
143
+ "div",
144
+ {
145
+ className: "pisell-lowcode__add-schedule-list-item-action-edit",
146
+ onClick: (e) => handleEdit(e, item.id)
147
+ },
148
+ import_utils.locales.getText("pisell2.text.edit")
149
+ )));
101
150
  },
102
151
  filterItem: (d, search) => {
103
152
  return d.name.toLowerCase().indexOf(search.toLowerCase()) !== -1;
104
153
  }
105
154
  }
155
+ ), ScheduleCreateType && /* @__PURE__ */ import_react.default.createElement(
156
+ ScheduleCreateType,
157
+ {
158
+ ref: createSchedules,
159
+ onChange: handleAddSchedule
160
+ }
161
+ ), AllCreateSchedule && /* @__PURE__ */ import_react.default.createElement(
162
+ AllCreateSchedule,
163
+ {
164
+ ref: AllCreateScheduleRef,
165
+ onChange: handleChangeResData
166
+ }
106
167
  ));
107
168
  };
108
169
  var AddSchedules_default = AddSchedules;
@@ -1,3 +1,23 @@
1
+ .pisell-lowcode__add-schedule-list-item {
2
+ display: flex;
3
+ flex: 1;
4
+ .pisell-lowcode__add-schedule-list-item-content {
5
+ flex: 1;
6
+ display: flex;
7
+ align-items: center;
8
+ }
9
+ .pisell-lowcode__add-schedule-list-item-action-wrap {
10
+ .pisell-lowcode__add-schedule-list-item-action-edit {
11
+ display: flex;
12
+ height: 48px;
13
+ padding: 0px 16px;
14
+ justify-content: center;
15
+ align-items: center;
16
+ border-radius: 30px;
17
+ border: 1px solid var(--Gray-true-300, #D5D5D5);
18
+ }
19
+ }
20
+ }
1
21
  .pisell-lowcode__add-schedule-list-item-color {
2
22
  width: 12px;
3
23
  height: 12px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.26",
3
+ "version": "3.0.28",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -58,9 +58,9 @@
58
58
  "ahooks": "^3.7.6",
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
+ "@pisell/date-picker": "1.0.68",
61
62
  "@pisell/utils": "1.0.23",
62
- "@pisell/icon": "0.0.8",
63
- "@pisell/date-picker": "1.0.68"
63
+ "@pisell/icon": "0.0.8"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "react": "^18.0.0",