@pisell/private-materials 3.0.151 → 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 (136) 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 +12 -12
  11. package/es/components/booking/components/footer/index.js +48 -33
  12. package/es/components/booking/components/footer/utils.js +35 -4
  13. package/es/components/booking/index.js +1 -1
  14. package/es/components/booking/info/index.d.ts +4 -12
  15. package/es/components/booking/info/index.js +12 -122
  16. package/es/components/booking/info/main.d.ts +12 -0
  17. package/es/components/booking/info/main.js +124 -0
  18. package/es/components/booking/info/model.js +0 -1
  19. package/es/components/booking/info/service/addTimeModal/index.js +4 -4
  20. package/es/components/booking/info/utils.d.ts +1 -0
  21. package/es/components/booking/info/utils.js +7 -0
  22. package/es/components/booking/info2/index.d.ts +12 -0
  23. package/es/components/booking/info2/index.js +216 -0
  24. package/es/components/booking/info2/serve.d.ts +6 -0
  25. package/es/components/booking/info2/serve.js +79 -0
  26. package/es/components/booking/info2/service/actions/index.d.ts +6 -0
  27. package/es/components/booking/info2/service/actions/index.js +86 -0
  28. package/es/components/booking/info2/service/addService/index.d.ts +6 -0
  29. package/es/components/booking/info2/service/addService/index.js +404 -0
  30. package/es/components/booking/info2/service/addService/mock.d.ts +214 -0
  31. package/es/components/booking/info2/service/addService/mock.js +332 -0
  32. package/es/components/booking/info2/service/addService/utils.d.ts +71 -0
  33. package/es/components/booking/info2/service/addService/utils.js +510 -0
  34. package/es/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
  35. package/es/components/booking/info2/service/addTimeModal/index.js +681 -0
  36. package/es/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
  37. package/es/components/booking/info2/service/addTimeModal/serve.js +73 -0
  38. package/es/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
  39. package/es/components/booking/info2/service/addTimeModal/utils.js +176 -0
  40. package/es/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
  41. package/es/components/booking/info2/service/editService/Capacity/index.js +121 -0
  42. package/es/components/booking/info2/service/editService/Capacity/index.less +1 -0
  43. package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
  44. package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +28 -0
  45. package/es/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
  46. package/es/components/booking/info2/service/editService/Resources/index.js +233 -0
  47. package/es/components/booking/info2/service/editService/Resources/index.less +21 -0
  48. package/es/components/booking/info2/service/editService/index.d.ts +7 -0
  49. package/es/components/booking/info2/service/editService/index.js +617 -0
  50. package/es/components/booking/info2/service/editService/index.less +99 -0
  51. package/es/components/booking/info2/service/editService/utils.d.ts +11 -0
  52. package/es/components/booking/info2/service/editService/utils.js +37 -0
  53. package/es/components/booking/info2/service/index.d.ts +4 -0
  54. package/es/components/booking/info2/service/index.js +55 -0
  55. package/es/components/booking/info2/service/serviceItem/index.d.ts +4 -0
  56. package/es/components/booking/info2/service/serviceItem/index.js +176 -0
  57. package/es/components/booking/info2/service/serviceItem/index.less +125 -0
  58. package/es/components/booking/info2/service/serviceList/index.d.ts +6 -0
  59. package/es/components/booking/info2/service/serviceList/index.js +106 -0
  60. package/es/components/booking/info2/service/serviceList/index.less +0 -0
  61. package/es/components/booking/info2/utilsByBooking.d.ts +34 -0
  62. package/es/components/booking/info2/utilsByBooking.js +349 -0
  63. package/es/components/booking/locales.d.ts +3 -0
  64. package/es/components/booking/locales.js +12 -3
  65. package/es/components/booking/materiels/resources/index.d.ts +2 -2
  66. package/es/components/booking/materiels/resources/index.js +11 -11
  67. package/es/components/booking/mock.d.ts +1 -0
  68. package/es/components/booking/mock.js +66 -0
  69. package/es/components/booking/notes/index.d.ts +1 -1
  70. package/es/components/index.d.ts +1 -1
  71. package/es/components/index.js +1 -1
  72. package/es/index.d.ts +1 -1
  73. package/es/index.js +1 -1
  74. package/lib/components/booking/components/footer/index.js +28 -5
  75. package/lib/components/booking/components/footer/utils.js +29 -4
  76. package/lib/components/booking/index.js +2 -2
  77. package/lib/components/booking/info/index.d.ts +4 -12
  78. package/lib/components/booking/info/index.js +14 -115
  79. package/lib/components/booking/info/main.d.ts +12 -0
  80. package/lib/components/booking/info/main.js +152 -0
  81. package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
  82. package/lib/components/booking/info/utils.d.ts +1 -0
  83. package/lib/components/booking/info/utils.js +9 -0
  84. package/lib/components/booking/info2/index.d.ts +12 -0
  85. package/lib/components/booking/info2/index.js +202 -0
  86. package/lib/components/booking/info2/serve.d.ts +6 -0
  87. package/lib/components/booking/info2/serve.js +53 -0
  88. package/lib/components/booking/info2/service/actions/index.d.ts +6 -0
  89. package/lib/components/booking/info2/service/actions/index.js +102 -0
  90. package/lib/components/booking/info2/service/addService/index.d.ts +6 -0
  91. package/lib/components/booking/info2/service/addService/index.js +356 -0
  92. package/lib/components/booking/info2/service/addService/mock.d.ts +214 -0
  93. package/lib/components/booking/info2/service/addService/mock.js +398 -0
  94. package/lib/components/booking/info2/service/addService/utils.d.ts +71 -0
  95. package/lib/components/booking/info2/service/addService/utils.js +377 -0
  96. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
  97. package/lib/components/booking/info2/service/addTimeModal/index.js +558 -0
  98. package/lib/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
  99. package/lib/components/booking/info2/service/addTimeModal/serve.js +45 -0
  100. package/lib/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
  101. package/lib/components/booking/info2/service/addTimeModal/utils.js +157 -0
  102. package/lib/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
  103. package/lib/components/booking/info2/service/editService/Capacity/index.js +97 -0
  104. package/lib/components/booking/info2/service/editService/Capacity/index.less +1 -0
  105. package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
  106. package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +54 -0
  107. package/lib/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
  108. package/lib/components/booking/info2/service/editService/Resources/index.js +212 -0
  109. package/lib/components/booking/info2/service/editService/Resources/index.less +21 -0
  110. package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
  111. package/lib/components/booking/info2/service/editService/index.js +483 -0
  112. package/lib/components/booking/info2/service/editService/index.less +99 -0
  113. package/lib/components/booking/info2/service/editService/utils.d.ts +11 -0
  114. package/lib/components/booking/info2/service/editService/utils.js +0 -0
  115. package/lib/components/booking/info2/service/index.d.ts +4 -0
  116. package/lib/components/booking/info2/service/index.js +75 -0
  117. package/lib/components/booking/info2/service/serviceItem/index.d.ts +4 -0
  118. package/lib/components/booking/info2/service/serviceItem/index.js +184 -0
  119. package/lib/components/booking/info2/service/serviceItem/index.less +125 -0
  120. package/lib/components/booking/info2/service/serviceList/index.d.ts +6 -0
  121. package/lib/components/booking/info2/service/serviceList/index.js +130 -0
  122. package/lib/components/booking/info2/service/serviceList/index.less +0 -0
  123. package/lib/components/booking/info2/utilsByBooking.d.ts +34 -0
  124. package/lib/components/booking/info2/utilsByBooking.js +257 -0
  125. package/lib/components/booking/locales.d.ts +3 -0
  126. package/lib/components/booking/locales.js +6 -3
  127. package/lib/components/booking/materiels/resources/index.d.ts +2 -2
  128. package/lib/components/booking/mock.d.ts +1 -0
  129. package/lib/components/booking/mock.js +67 -2
  130. package/lib/components/booking/notes/index.d.ts +1 -1
  131. package/lib/components/eftposPay/tyro/index.js +3 -1
  132. package/lib/components/index.d.ts +1 -1
  133. package/lib/components/index.js +1 -1
  134. package/lib/index.d.ts +1 -1
  135. package/lib/index.js +1 -1
  136. package/package.json +3 -3
@@ -0,0 +1,257 @@
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/info2/utilsByBooking.ts
30
+ var utilsByBooking_exports = {};
31
+ __export(utilsByBooking_exports, {
32
+ formatResource: () => formatResource,
33
+ formatTimes: () => formatTimes,
34
+ getErrorList: () => getErrorList,
35
+ getResourceTimeIsUsable: () => getResourceTimeIsUsable,
36
+ getServiceStartTimeAndEndTime: () => getServiceStartTimeAndEndTime,
37
+ getSumCapacity: () => getSumCapacity
38
+ });
39
+ module.exports = __toCommonJS(utilsByBooking_exports);
40
+ var import_dayjs = __toESM(require("dayjs"));
41
+ var import_utils = require("@pisell/utils");
42
+ var import_utils2 = require("../utils");
43
+ var getUseableEventCount = (eventList, current) => {
44
+ return (eventList || []).reduce((pre, event) => {
45
+ return pre - event.pax;
46
+ }, current || 0);
47
+ };
48
+ var isConflict = (event, current) => {
49
+ const eventStart = (0, import_dayjs.default)(event.start_at);
50
+ const eventEnd = (0, import_dayjs.default)(event.end_at);
51
+ const currentStart = (0, import_dayjs.default)(current.start_at);
52
+ const _isBefore = currentStart.isBefore(eventEnd);
53
+ let _isAfter = true;
54
+ if (current.end_at) {
55
+ const currentEnd = (0, import_dayjs.default)(current.end_at);
56
+ _isAfter = currentEnd.isAfter(eventStart);
57
+ }
58
+ return _isBefore && _isAfter;
59
+ };
60
+ var getResourceTimeIsUsable = (item, cacheItem, resourceItem) => {
61
+ const startDate = (0, import_dayjs.default)(cacheItem._extend.start_date.format("YYYY-MM-DD") + " " + (0, import_utils2.getServeStartTime)(cacheItem._extend.start_time));
62
+ const isFlexible = import_utils2.flexibleObj.isFlexible(cacheItem._extend.duration);
63
+ let isMaxLimitRange = false;
64
+ let isDateRange = false;
65
+ let isCountRange = false;
66
+ let time = { ...item };
67
+ let timeStartDate = (0, import_dayjs.default)(time.start_date + " " + time.start_time).subtract(1, "second");
68
+ let timeEndDate = (0, import_dayjs.default)(time.end_date + " " + time.end_time).add(1, "second");
69
+ let totalCount = getUseableEventCount(time.event_list, resourceItem.capacity);
70
+ const currentCount = getSumCapacity({ cacheItem });
71
+ if (totalCount < currentCount) {
72
+ isCountRange = false;
73
+ } else {
74
+ const eventList = time.event_list || [];
75
+ let endDate = null;
76
+ if (isFlexible) {
77
+ if (eventList.length) {
78
+ timeStartDate = eventList.reduce((max, event) => {
79
+ const endAt = (0, import_dayjs.default)(event.end_at);
80
+ return endAt.isAfter(max) ? endAt : max;
81
+ }, (0, import_dayjs.default)(eventList[0].end_at));
82
+ }
83
+ isDateRange = startDate.isAfter(timeStartDate) && startDate.isBefore(timeEndDate);
84
+ } else {
85
+ endDate = startDate.add(import_utils2.flexibleObj.getValue(cacheItem._extend.duration), "minute");
86
+ const isTimeRange = startDate.isAfter(timeStartDate) && endDate.isBefore(timeEndDate);
87
+ if (isTimeRange) {
88
+ isDateRange = true;
89
+ }
90
+ }
91
+ let conflict = (time.event_list || []).filter((d) => {
92
+ return isConflict({ start_at: d.start_at, end_at: d.end_at }, { start_at: startDate, end_at: endDate });
93
+ });
94
+ if (resourceItem.resourceType === "single") {
95
+ if (conflict.length === 0) {
96
+ isCountRange = true;
97
+ } else {
98
+ isCountRange = false;
99
+ }
100
+ } else {
101
+ let conflictCount = getUseableEventCount(conflict, resourceItem.capacity);
102
+ if (currentCount <= conflictCount) {
103
+ isCountRange = true;
104
+ } else {
105
+ isCountRange = false;
106
+ }
107
+ }
108
+ }
109
+ const isUsable = isDateRange && isCountRange;
110
+ time._extend = {
111
+ isMaxLimitRange,
112
+ isDateRange,
113
+ isCountRange,
114
+ isUsable
115
+ };
116
+ return time;
117
+ };
118
+ var getSumCapacity = ({ cacheItem }) => {
119
+ let sum = 0;
120
+ for (let item of cacheItem._extend.capacity || []) {
121
+ sum += item.value;
122
+ }
123
+ return sum;
124
+ };
125
+ var formatTimes = (resourceItem, cacheItem) => {
126
+ let usableTimes = [];
127
+ let _resourceItem = { ...resourceItem };
128
+ let sum = getSumCapacity({ cacheItem });
129
+ if (_resourceItem.capacity >= sum) {
130
+ _resourceItem.times = _resourceItem.times.map((time) => {
131
+ let _time2 = getResourceTimeIsUsable(time, cacheItem, _resourceItem);
132
+ if (_time2 == null ? void 0 : _time2._extend.isUsable) {
133
+ usableTimes.push(_time2);
134
+ }
135
+ return _time2;
136
+ });
137
+ }
138
+ let _time = (usableTimes || []).sort((a, b) => {
139
+ const aEndDate = (0, import_dayjs.default)(a.end_date + " " + a.end_time).valueOf();
140
+ const bEndDate = (0, import_dayjs.default)(b.end_date + " " + b.end_time).valueOf();
141
+ return aEndDate - bEndDate;
142
+ })[0];
143
+ resourceItem._extend = {
144
+ ...resourceItem._extend,
145
+ usableTime: _time
146
+ };
147
+ return resourceItem;
148
+ };
149
+ var getErrorList = (resource, cacheItem) => {
150
+ var _a, _b, _c, _d, _e, _f, _g;
151
+ if (!(cacheItem == null ? void 0 : cacheItem.id)) {
152
+ return [{
153
+ label: import_utils.locales.getText("pisell2.text.no-product-added"),
154
+ type: "products"
155
+ }];
156
+ }
157
+ if (!resource) {
158
+ return [];
159
+ }
160
+ let list = [];
161
+ if (!resource.usable) {
162
+ const { startDate, endDate } = (0, import_utils2.getServiceTimes)(cacheItem);
163
+ const startText = startDate.format("hh:mm A");
164
+ let endText = endDate.format("hh:mm A");
165
+ if ((0, import_dayjs.default)(endDate).isAfter(startDate, "day")) {
166
+ endText = import_utils.locales.getText("pisell1.text.tomorrow") + endText;
167
+ }
168
+ const isSingle = ((_c = (_b = (_a = cacheItem == null ? void 0 : cacheItem._data) == null ? void 0 : _a.resourceMaps) == null ? void 0 : _b[resource == null ? void 0 : resource.form_id]) == null ? void 0 : _c.type) === "single";
169
+ console.log("resourceresource", resource, cacheItem);
170
+ if (!((_d = resource._extend) == null ? void 0 : _d.usableTime)) {
171
+ if (isSingle) {
172
+ list.push({
173
+ label: import_utils.locales.getText("pisell1.text.resource-error-message-3")(resource.labelText, startText, endText),
174
+ type: "limit"
175
+ });
176
+ } else {
177
+ list.push({
178
+ label: import_utils.locales.getText("pisell1.text.resource-error-message-2")(resource.labelText, startText, endText),
179
+ type: "time"
180
+ });
181
+ }
182
+ } else {
183
+ if (!((_g = (_f = (_e = resource._extend) == null ? void 0 : _e.usableTime) == null ? void 0 : _f._extend) == null ? void 0 : _g.isCountRange)) {
184
+ list.push({
185
+ label: import_utils.locales.getText("pisell1.text.resource-error-message-3")(resource.labelText, startText, endText),
186
+ type: "limit"
187
+ });
188
+ }
189
+ }
190
+ }
191
+ return list;
192
+ };
193
+ var formatResource = (resourceItem, cacheItem, formatLabel) => {
194
+ let _resourceItem = { ...resourceItem };
195
+ _resourceItem = formatTimes(_resourceItem, cacheItem);
196
+ _resourceItem.labelText = _resourceItem.main_field;
197
+ const usable = _resourceItem._extend.usableTime;
198
+ _resourceItem.usable = usable;
199
+ if (formatLabel) {
200
+ _resourceItem.label = formatLabel(_resourceItem);
201
+ }
202
+ return _resourceItem;
203
+ };
204
+ var getServiceStartTimeAndEndTime = (state, cacheItem, timeObj) => {
205
+ var _a;
206
+ let lastServer = (0, import_utils2.getLastServer)(state.service.value);
207
+ let _extend = {
208
+ // 时长: 当前商品时长 > 第一个时长
209
+ duration: (0, import_utils2.findNextDuration)(
210
+ cacheItem.duration,
211
+ timeObj.durationSlicesBasedOnTime,
212
+ (_a = cacheItem == null ? void 0 : cacheItem.duration) == null ? void 0 : _a.value
213
+ )
214
+ };
215
+ if (lastServer) {
216
+ let lastServerStartDate = lastServer._extend.startDate;
217
+ let lastServerEndDate = lastServer._extend.endDate;
218
+ if ((0, import_dayjs.default)(lastServerEndDate).isAfter(lastServerStartDate, "day")) {
219
+ _extend.start_time = timeObj.timeSlices[timeObj.timeSlices.length - 1].value;
220
+ } else {
221
+ _extend.start_time = lastServerEndDate.format("HH:mm");
222
+ }
223
+ } else {
224
+ let findNextSliceProps = {
225
+ date: ""
226
+ };
227
+ const serviceParams = (0, import_utils2.getCacheParams)();
228
+ if (serviceParams) {
229
+ let str = serviceParams.start_date;
230
+ if (str) {
231
+ findNextSliceProps.date = (0, import_dayjs.default)(str).format("HH:mm");
232
+ }
233
+ }
234
+ if (findNextSliceProps.date && findNextSliceProps.date !== "00:00") {
235
+ _extend.start_time = findNextSliceProps.date;
236
+ } else {
237
+ _extend.start_time = (0, import_dayjs.default)().format("HH:mm");
238
+ }
239
+ }
240
+ _extend = {
241
+ ..._extend,
242
+ ...cacheItem._extend
243
+ };
244
+ const { startDate, endDate } = (0, import_utils2.getServiceTimes)({ _extend });
245
+ _extend.startDate = startDate;
246
+ _extend.endDate = endDate;
247
+ return _extend;
248
+ };
249
+ // Annotate the CommonJS export names for ESM import in node:
250
+ 0 && (module.exports = {
251
+ formatResource,
252
+ formatTimes,
253
+ getErrorList,
254
+ getResourceTimeIsUsable,
255
+ getServiceStartTimeAndEndTime,
256
+ getSumCapacity
257
+ });
@@ -194,6 +194,7 @@ declare const _default: {
194
194
  'page.booking.text.please-choose-an-option': string;
195
195
  'page.booking.text.please-choose-an-option-1': string;
196
196
  'page.booking.text.please-choose-an-option-2': string;
197
+ 'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
197
198
  };
198
199
  'zh-CN': {
199
200
  'pisell2.text.refunded-amount': string;
@@ -390,6 +391,7 @@ declare const _default: {
390
391
  'page.booking.text.please-choose-an-option': string;
391
392
  'page.booking.text.please-choose-an-option-1': string;
392
393
  'page.booking.text.please-choose-an-option-2': string;
394
+ 'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
393
395
  };
394
396
  'zh-HK': {
395
397
  'pisell2.text.refunded-amount': string;
@@ -586,6 +588,7 @@ declare const _default: {
586
588
  'page.booking.text.please-choose-an-option': string;
587
589
  'page.booking.text.please-choose-an-option-1': string;
588
590
  'page.booking.text.please-choose-an-option-2': string;
591
+ 'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
589
592
  };
590
593
  };
591
594
  export default _default;
@@ -249,7 +249,8 @@ var locales_default = {
249
249
  "page.booking.text.paid.msg": (x) => `The related order is ${x === "paid" ? "paid" : "partially paid"}.`,
250
250
  "page.booking.text.please-choose-an-option": "Please choose an option:",
251
251
  "page.booking.text.please-choose-an-option-1": "Refund: Cancel the appointment and process a refund.",
252
- "page.booking.text.please-choose-an-option-2": "Cancel only: Cancel the appointment without processing a refund. (You can still process a refund after cancellation if needed)"
252
+ "page.booking.text.please-choose-an-option-2": "Cancel only: Cancel the appointment without processing a refund. (You can still process a refund after cancellation if needed)",
253
+ "page.booking.text.resource.min-length-error": (x, y) => `Select at least ${x} ${y}`
253
254
  },
254
255
  "zh-CN": {
255
256
  "pisell2.text.refunded-amount": "已退金额",
@@ -471,7 +472,8 @@ var locales_default = {
471
472
  "page.booking.text.paid.msg": (x) => `关联订单${x === "paid" ? "已付款" : "部分付款"}。`,
472
473
  "page.booking.text.please-choose-an-option": "请选择:",
473
474
  "page.booking.text.please-choose-an-option-1": "退款:取消预约,同时处理退款。",
474
- "page.booking.text.please-choose-an-option-2": "仅取消:仅取消预约,但不进行退款处理。(您仍然可以在取消后再进行退款操作)"
475
+ "page.booking.text.please-choose-an-option-2": "仅取消:仅取消预约,但不进行退款处理。(您仍然可以在取消后再进行退款操作)",
476
+ "page.booking.text.resource.min-length-error": (x, y) => `至少选择${x}项${y}`
475
477
  },
476
478
  "zh-HK": {
477
479
  "pisell2.text.refunded-amount": "已退金額",
@@ -693,6 +695,7 @@ var locales_default = {
693
695
  "page.booking.text.paid.msg": (x) => `關聯訂單${x === "paid" ? "已付款" : "部分付款"}。`,
694
696
  "page.booking.text.please-choose-an-option": "請選擇:",
695
697
  "page.booking.text.please-choose-an-option-1": "退款:取消預約,同時處理退款。",
696
- "page.booking.text.please-choose-an-option-2": "僅取消:僅取消預約,但不進行退款處理。(您仍然可以在取消後再進行退款操作)"
698
+ "page.booking.text.please-choose-an-option-2": "僅取消:僅取消預約,但不進行退款處理。(您仍然可以在取消後再進行退款操作)",
699
+ "page.booking.text.resource.min-length-error": (x, y) => `至少選擇${x}項${y}`
697
700
  }
698
701
  };
@@ -1,5 +1,5 @@
1
- import { SelectProps } from "antd";
2
- import React from "react";
1
+ import { SelectProps } from 'antd';
2
+ import React from 'react';
3
3
  interface ResourcesProps extends SelectProps {
4
4
  locale?: string;
5
5
  resources?: any[];
@@ -54,3 +54,4 @@ export declare const getNoResource: () => {
54
54
  unique: string;
55
55
  }[];
56
56
  };
57
+ export declare const getNoResource2: (other: any) => any;
@@ -19,7 +19,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // src/components/booking/mock.ts
20
20
  var mock_exports = {};
21
21
  __export(mock_exports, {
22
- getNoResource: () => getNoResource
22
+ getNoResource: () => getNoResource,
23
+ getNoResource2: () => getNoResource2
23
24
  });
24
25
  module.exports = __toCommonJS(mock_exports);
25
26
  var import_utils = require("@pisell/utils");
@@ -83,7 +84,71 @@ var getNoResource = () => {
83
84
  ]
84
85
  };
85
86
  };
87
+ var getNoResource2 = (other) => {
88
+ return {
89
+ "form_tag": null,
90
+ "policy": 148,
91
+ "partyroom_package": {
92
+ "type": "product_all"
93
+ },
94
+ "sort": "2",
95
+ "status": "active",
96
+ "description": "<p>1</p>",
97
+ "media": "",
98
+ "main_field": import_utils.locales.getText("pisell1.text.no-resource"),
99
+ "subtitle": "无资源",
100
+ "room_name": import_utils.locales.getText("pisell1.text.no-resource"),
101
+ "labelText": import_utils.locales.getText("pisell1.text.no-resource"),
102
+ "form_record_id": 0,
103
+ "item_type": "resources",
104
+ "form_id": 0,
105
+ "id": 0,
106
+ "form_resource_sort": 0,
107
+ "form_title": "资源",
108
+ "capacity": 999999,
109
+ "form": {
110
+ "id": 0,
111
+ "shop_id": 265,
112
+ "title": "资源",
113
+ "navigation_display": 1,
114
+ "button": "保存",
115
+ "describe": "",
116
+ "status": "published",
117
+ "resource_sort": 0,
118
+ "code": "resources",
119
+ "type": "manual",
120
+ "version": 1,
121
+ "setting": null,
122
+ "created_at": "2023-08-08 20:10:13",
123
+ "updated_at": "2023-10-13 15:21:02"
124
+ },
125
+ "times": [
126
+ {
127
+ "keys": "20c04d77e571b082fe504777879f7261",
128
+ "schedule_id": 0,
129
+ "item_type": "resources",
130
+ "item_id": 0,
131
+ "start_date": "2000-01-01",
132
+ "end_date": "2300-01-01",
133
+ "start_time": "00:00",
134
+ "end_time": "23:59",
135
+ "is_all": 1,
136
+ "max_participants_type": "custom-limit",
137
+ "max_participants_limit": 0,
138
+ "relation_type": "form",
139
+ "start_at": "2000-01-01 00:00",
140
+ "end_at": "2300-01-05 23:59",
141
+ "is_blocked": 0,
142
+ "blocked_times": [],
143
+ "order_event_count": 3,
144
+ "unique": "IomNIL9OPQsSjosiu7EqhhgXGviqUxk1"
145
+ }
146
+ ],
147
+ ...other
148
+ };
149
+ };
86
150
  // Annotate the CommonJS export names for ESM import in node:
87
151
  0 && (module.exports = {
88
- getNoResource
152
+ getNoResource,
153
+ getNoResource2
89
154
  });
@@ -4,5 +4,5 @@ export interface InfoProps {
4
4
  globalState: any;
5
5
  setGlobalState: any;
6
6
  }
7
- declare const Notes: (props: any) => JSX.Element;
7
+ declare const Notes: any;
8
8
  export default Notes;
@@ -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"));
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';
package/lib/index.js CHANGED
@@ -55,7 +55,7 @@ var import_weekday = __toESM(require("dayjs/plugin/weekday"));
55
55
  var import_dayjs = __toESM(require("dayjs"));
56
56
  var import_localeData = __toESM(require("dayjs/plugin/localeData"));
57
57
  var import_login = __toESM(require("./components/login"));
58
- var import_info = __toESM(require("./components/booking/info"));
58
+ var import_info = __toESM(require("./components/booking/info/index"));
59
59
  var import_notes = __toESM(require("./components/booking/notes"));
60
60
  var import_addons = __toESM(require("./components/booking/addons"));
61
61
  var import_forms = __toESM(require("./components/booking/forms"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.151",
3
+ "version": "3.0.152",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,10 +59,10 @@
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
61
  "decimal.js": "^10.4.3",
62
- "@pisell/materials": "3.0.48",
63
62
  "@pisell/utils": "1.0.42",
64
63
  "@pisell/date-picker": "1.0.100",
65
- "@pisell/icon": "0.0.11"
64
+ "@pisell/icon": "0.0.11",
65
+ "@pisell/materials": "3.0.48"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",