@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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +12 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/components/footer/index.js +51 -36
- package/es/components/booking/components/footer/utils.js +35 -4
- package/es/components/booking/forms/forms.d.ts +0 -1
- package/es/components/booking/forms/forms.js +2 -4
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/forms/single/index.d.ts +1 -1
- package/es/components/booking/forms/single/index.js +3 -4
- package/es/components/booking/index.js +1 -1
- package/es/components/booking/info/index.d.ts +4 -12
- package/es/components/booking/info/index.js +12 -123
- package/es/components/booking/info/index.less +0 -9
- package/es/components/booking/info/main.d.ts +12 -0
- package/es/components/booking/info/main.js +124 -0
- package/es/components/booking/info/model.js +0 -1
- package/es/components/booking/info/pet/index.js +1 -1
- package/es/components/booking/info/service/addService/index.d.ts +2 -8
- package/es/components/booking/info/service/addService/index.js +36 -82
- package/es/components/booking/info/service/addService/index.less +1 -27
- package/es/components/booking/info/service/addTimeModal/index.js +4 -4
- package/es/components/booking/info/service/editService/index.js +13 -11
- package/es/components/booking/info/utils.d.ts +1 -0
- package/es/components/booking/info/utils.js +7 -0
- package/es/components/booking/info2/index.d.ts +12 -0
- package/es/components/booking/{dashboard → info2}/index.js +196 -222
- package/es/components/booking/info2/serve.d.ts +6 -0
- package/es/components/booking/info2/serve.js +79 -0
- package/es/components/booking/info2/service/actions/index.d.ts +6 -0
- package/es/components/booking/info2/service/actions/index.js +86 -0
- package/es/components/booking/info2/service/addService/index.d.ts +6 -0
- package/es/components/booking/info2/service/addService/index.js +404 -0
- package/es/components/booking/info2/service/addService/mock.d.ts +214 -0
- package/es/components/booking/info2/service/addService/mock.js +332 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +71 -0
- package/es/components/booking/info2/service/addService/utils.js +510 -0
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
- package/es/components/booking/info2/service/addTimeModal/index.js +681 -0
- package/es/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
- package/es/components/booking/{dashboard → info2/service/addTimeModal}/serve.js +51 -5
- package/es/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
- package/es/components/booking/info2/service/addTimeModal/utils.js +176 -0
- package/es/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/Capacity/index.js +121 -0
- package/es/components/booking/info2/service/editService/Capacity/index.less +1 -0
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +28 -0
- package/es/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +233 -0
- package/es/components/booking/info2/service/editService/Resources/index.less +21 -0
- package/es/components/booking/info2/service/editService/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/index.js +617 -0
- package/es/components/booking/info2/service/editService/index.less +99 -0
- package/es/components/booking/info2/service/editService/utils.d.ts +11 -0
- package/es/components/booking/{info/addServiceVariant/index.js → info2/service/editService/utils.js} +30 -26
- package/es/components/booking/info2/service/index.d.ts +4 -0
- package/es/components/booking/info2/service/index.js +55 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +4 -0
- package/es/components/booking/info2/service/serviceItem/index.js +176 -0
- package/es/components/booking/info2/service/serviceItem/index.less +125 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +6 -0
- package/es/components/booking/info2/service/serviceList/index.js +106 -0
- package/es/components/booking/info2/service/serviceList/index.less +0 -0
- package/es/components/booking/info2/utilsByBooking.d.ts +34 -0
- package/es/components/booking/info2/utilsByBooking.js +349 -0
- package/es/components/booking/locales.d.ts +3 -48
- package/es/components/booking/locales.js +9 -48
- package/es/components/booking/materiels/resources/index.d.ts +2 -2
- package/es/components/booking/materiels/resources/index.js +11 -11
- package/es/components/booking/mock.d.ts +1 -0
- package/es/components/booking/mock.js +66 -0
- package/es/components/booking/model.d.ts +0 -2
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/booking/utils.d.ts +1 -1
- package/es/components/booking/utils.js +51 -54
- package/es/components/index.d.ts +1 -1
- package/es/components/index.js +1 -1
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/es/index.d.ts +1 -3
- package/es/index.js +2 -4
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/components/footer/index.js +31 -8
- package/lib/components/booking/components/footer/utils.js +29 -4
- package/lib/components/booking/forms/forms.d.ts +0 -1
- package/lib/components/booking/forms/forms.js +2 -5
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/forms/single/index.d.ts +1 -1
- package/lib/components/booking/forms/single/index.js +2 -4
- package/lib/components/booking/index.js +2 -2
- package/lib/components/booking/info/client/index.js +8 -1
- package/lib/components/booking/info/index.d.ts +4 -12
- package/lib/components/booking/info/index.js +14 -118
- package/lib/components/booking/info/index.less +0 -9
- package/lib/components/booking/info/main.d.ts +12 -0
- package/lib/components/booking/info/main.js +152 -0
- package/lib/components/booking/info/pet/index.js +1 -2
- package/lib/components/booking/info/service/addService/index.d.ts +2 -8
- package/lib/components/booking/info/service/addService/index.js +29 -66
- package/lib/components/booking/info/service/addService/index.less +1 -27
- package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
- package/lib/components/booking/info/service/editService/index.js +6 -9
- package/lib/components/booking/info/utils.d.ts +1 -0
- package/lib/components/booking/info/utils.js +9 -0
- package/lib/components/booking/info2/index.d.ts +12 -0
- package/lib/components/booking/info2/index.js +202 -0
- package/lib/components/booking/info2/serve.d.ts +6 -0
- package/lib/components/booking/{dashboard → info2}/serve.js +25 -5
- package/lib/components/booking/info2/service/actions/index.d.ts +6 -0
- package/lib/components/booking/info2/service/actions/index.js +102 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +6 -0
- package/lib/components/booking/info2/service/addService/index.js +356 -0
- package/lib/components/booking/info2/service/addService/mock.d.ts +214 -0
- package/lib/components/booking/info2/service/addService/mock.js +398 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +71 -0
- package/lib/components/booking/info2/service/addService/utils.js +377 -0
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
- package/lib/components/booking/info2/service/addTimeModal/index.js +558 -0
- package/lib/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
- package/lib/components/booking/info2/service/addTimeModal/serve.js +45 -0
- package/lib/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
- package/lib/components/booking/info2/service/addTimeModal/utils.js +157 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.js +97 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.less +1 -0
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +54 -0
- package/lib/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +212 -0
- package/lib/components/booking/info2/service/editService/Resources/index.less +21 -0
- package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/index.js +483 -0
- package/lib/components/booking/info2/service/editService/index.less +99 -0
- package/lib/components/booking/info2/service/editService/utils.d.ts +11 -0
- package/lib/components/booking/info2/service/editService/utils.js +0 -0
- package/lib/components/booking/info2/service/index.d.ts +4 -0
- package/lib/components/booking/info2/service/index.js +75 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +4 -0
- package/lib/components/booking/info2/service/serviceItem/index.js +184 -0
- package/lib/components/booking/info2/service/serviceItem/index.less +125 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +6 -0
- package/lib/components/booking/info2/service/serviceList/index.js +130 -0
- package/lib/components/booking/info2/service/serviceList/index.less +0 -0
- package/lib/components/booking/info2/utilsByBooking.d.ts +34 -0
- package/lib/components/booking/info2/utilsByBooking.js +257 -0
- package/lib/components/booking/locales.d.ts +3 -48
- package/lib/components/booking/locales.js +3 -48
- package/lib/components/booking/materiels/resources/index.d.ts +2 -2
- package/lib/components/booking/mock.d.ts +1 -0
- package/lib/components/booking/mock.js +67 -2
- package/lib/components/booking/model.d.ts +0 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/booking/utils.d.ts +1 -1
- package/lib/components/booking/utils.js +22 -57
- package/lib/components/eftposPay/tyro/index.js +3 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -7
- package/package.json +2 -2
- package/es/components/booking/dashboard/index.d.ts +0 -10
- package/es/components/booking/dashboard/serve.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -7
- package/lib/components/booking/dashboard/index.d.ts +0 -10
- package/lib/components/booking/dashboard/index.js +0 -225
- package/lib/components/booking/dashboard/serve.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -7
- package/lib/components/booking/info/addServiceVariant/index.js +0 -58
- package/lowcode/booking-dashboard/meta.ts +0 -130
- package/lowcode/booking-vertical-add-service/meta.ts +0 -124
- package/lowcode/vertical-add-service/meta.ts +0 -71
|
@@ -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,22 +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
|
-
'
|
|
198
|
-
'pisell2.booking.dashboard.groups-on-site-now-tip': string;
|
|
199
|
-
'pisell2.booking.dashboard.people-on-site-now': string;
|
|
200
|
-
'pisell2.booking.dashboard.people-on-site-now-tip': string;
|
|
201
|
-
'pisell2.booking.dashboard.total-visitors-today': string;
|
|
202
|
-
'pisell2.booking.dashboard.total-visitors-today-tip': string;
|
|
203
|
-
'pisell2.booking.dashboard.ongoing-visitors': string;
|
|
204
|
-
'pisell2.booking.dashboard.ongoing-visitors-tip': string;
|
|
205
|
-
'pisell2.booking.dashboard.upcoming-visitors': string;
|
|
206
|
-
'pisell2.booking.dashboard.upcoming-visitors-tip': string;
|
|
207
|
-
'pisell2.booking.dashboard.overdue-visitors': string;
|
|
208
|
-
'pisell2.booking.dashboard.overdue-visitors-tip': string;
|
|
209
|
-
'pisell2.booking.dashboard.completed-visitors': string;
|
|
210
|
-
'pisell2.booking.dashboard.completed-visitors-tip': string;
|
|
211
|
-
'pisell2.booking.dashboard.departed-visitors': string;
|
|
212
|
-
'pisell2.booking.dashboard.departed-visitors-tip': string;
|
|
197
|
+
'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
|
|
213
198
|
};
|
|
214
199
|
'zh-CN': {
|
|
215
200
|
'pisell2.text.refunded-amount': string;
|
|
@@ -406,22 +391,7 @@ declare const _default: {
|
|
|
406
391
|
'page.booking.text.please-choose-an-option': string;
|
|
407
392
|
'page.booking.text.please-choose-an-option-1': string;
|
|
408
393
|
'page.booking.text.please-choose-an-option-2': string;
|
|
409
|
-
'
|
|
410
|
-
'pisell2.booking.dashboard.groups-on-site-now-tip': string;
|
|
411
|
-
'pisell2.booking.dashboard.people-on-site-now': string;
|
|
412
|
-
'pisell2.booking.dashboard.people-on-site-now-tip': string;
|
|
413
|
-
'pisell2.booking.dashboard.total-visitors-today': string;
|
|
414
|
-
'pisell2.booking.dashboard.total-visitors-today-tip': string;
|
|
415
|
-
'pisell2.booking.dashboard.ongoing-visitors': string;
|
|
416
|
-
'pisell2.booking.dashboard.ongoing-visitors-tip': string;
|
|
417
|
-
'pisell2.booking.dashboard.upcoming-visitors': string;
|
|
418
|
-
'pisell2.booking.dashboard.upcoming-visitors-tip': string;
|
|
419
|
-
'pisell2.booking.dashboard.overdue-visitors': string;
|
|
420
|
-
'pisell2.booking.dashboard.overdue-visitors-tip': string;
|
|
421
|
-
'pisell2.booking.dashboard.completed-visitors': string;
|
|
422
|
-
'pisell2.booking.dashboard.completed-visitors-tip': string;
|
|
423
|
-
'pisell2.booking.dashboard.departed-visitors': string;
|
|
424
|
-
'pisell2.booking.dashboard.departed-visitors-tip': string;
|
|
394
|
+
'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
|
|
425
395
|
};
|
|
426
396
|
'zh-HK': {
|
|
427
397
|
'pisell2.text.refunded-amount': string;
|
|
@@ -618,22 +588,7 @@ declare const _default: {
|
|
|
618
588
|
'page.booking.text.please-choose-an-option': string;
|
|
619
589
|
'page.booking.text.please-choose-an-option-1': string;
|
|
620
590
|
'page.booking.text.please-choose-an-option-2': string;
|
|
621
|
-
'
|
|
622
|
-
'pisell2.booking.dashboard.groups-on-site-now-tip': string;
|
|
623
|
-
'pisell2.booking.dashboard.people-on-site-now': string;
|
|
624
|
-
'pisell2.booking.dashboard.people-on-site-now-tip': string;
|
|
625
|
-
'pisell2.booking.dashboard.total-visitors-today': string;
|
|
626
|
-
'pisell2.booking.dashboard.total-visitors-today-tip': string;
|
|
627
|
-
'pisell2.booking.dashboard.ongoing-visitors': string;
|
|
628
|
-
'pisell2.booking.dashboard.ongoing-visitors-tip': string;
|
|
629
|
-
'pisell2.booking.dashboard.upcoming-visitors': string;
|
|
630
|
-
'pisell2.booking.dashboard.upcoming-visitors-tip': string;
|
|
631
|
-
'pisell2.booking.dashboard.overdue-visitors': string;
|
|
632
|
-
'pisell2.booking.dashboard.overdue-visitors-tip': string;
|
|
633
|
-
'pisell2.booking.dashboard.completed-visitors': string;
|
|
634
|
-
'pisell2.booking.dashboard.completed-visitors-tip': string;
|
|
635
|
-
'pisell2.booking.dashboard.departed-visitors': string;
|
|
636
|
-
'pisell2.booking.dashboard.departed-visitors-tip': string;
|
|
591
|
+
'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
|
|
637
592
|
};
|
|
638
593
|
};
|
|
639
594
|
export default _default;
|
|
@@ -250,22 +250,7 @@ var locales_default = {
|
|
|
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
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
|
-
"
|
|
254
|
-
"pisell2.booking.dashboard.groups-on-site-now-tip": "Tip: Total number of groups who have checked in and are currently on-site",
|
|
255
|
-
"pisell2.booking.dashboard.people-on-site-now": "People on-site now",
|
|
256
|
-
"pisell2.booking.dashboard.people-on-site-now-tip": "Tip: Total number of people who have checked in and are currently on-site",
|
|
257
|
-
"pisell2.booking.dashboard.total-visitors-today": "Total visitors today",
|
|
258
|
-
"pisell2.booking.dashboard.total-visitors-today-tip": "Tip: Total number of visitors today, regardless of check-in status",
|
|
259
|
-
"pisell2.booking.dashboard.ongoing-visitors": "Ongoing visitors",
|
|
260
|
-
"pisell2.booking.dashboard.ongoing-visitors-tip": "Tip: Total number of visitors who have passed the start time, regardless of check-in status",
|
|
261
|
-
"pisell2.booking.dashboard.upcoming-visitors": "Upcoming visitors",
|
|
262
|
-
"pisell2.booking.dashboard.upcoming-visitors-tip": "Tip: Total number of visitors expected to arrive in the near future",
|
|
263
|
-
"pisell2.booking.dashboard.overdue-visitors": "Overdue visitors",
|
|
264
|
-
"pisell2.booking.dashboard.overdue-visitors-tip": "Tip: Total number of visitors whose playtime has expired but have not yet left the venue",
|
|
265
|
-
"pisell2.booking.dashboard.completed-visitors": "Completed visitors",
|
|
266
|
-
"pisell2.booking.dashboard.completed-visitors-tip": "Tip: Total number of visitors whose playtime has ended, regardless of whether they have left the venue",
|
|
267
|
-
"pisell2.booking.dashboard.departed-visitors": "Departed visitors",
|
|
268
|
-
"pisell2.booking.dashboard.departed-visitors-tip": "Tip: Total number of visitors who checked in and have left the venue today"
|
|
253
|
+
"page.booking.text.resource.min-length-error": (x, y) => `Select at least ${x} ${y}`
|
|
269
254
|
},
|
|
270
255
|
"zh-CN": {
|
|
271
256
|
"pisell2.text.refunded-amount": "已退金额",
|
|
@@ -488,22 +473,7 @@ var locales_default = {
|
|
|
488
473
|
"page.booking.text.please-choose-an-option": "请选择:",
|
|
489
474
|
"page.booking.text.please-choose-an-option-1": "退款:取消预约,同时处理退款。",
|
|
490
475
|
"page.booking.text.please-choose-an-option-2": "仅取消:仅取消预约,但不进行退款处理。(您仍然可以在取消后再进行退款操作)",
|
|
491
|
-
"
|
|
492
|
-
"pisell2.booking.dashboard.groups-on-site-now-tip": "提示:已检票并在场内的团体总数",
|
|
493
|
-
"pisell2.booking.dashboard.people-on-site-now": "当前在场人数",
|
|
494
|
-
"pisell2.booking.dashboard.people-on-site-now-tip": "提示:已检票并在场内的总人数",
|
|
495
|
-
"pisell2.booking.dashboard.total-visitors-today": "今日游客总数",
|
|
496
|
-
"pisell2.booking.dashboard.total-visitors-today-tip": "提示:今日的游客总人数,无论是否检票入场",
|
|
497
|
-
"pisell2.booking.dashboard.ongoing-visitors": "进行中的游客",
|
|
498
|
-
"pisell2.booking.dashboard.ongoing-visitors-tip": "提示:已过开始时间的游客总数,无论是否检票",
|
|
499
|
-
"pisell2.booking.dashboard.upcoming-visitors": "即将到达的游客",
|
|
500
|
-
"pisell2.booking.dashboard.upcoming-visitors-tip": "提示:预计将在未来到场的游客总人数",
|
|
501
|
-
"pisell2.booking.dashboard.overdue-visitors": "超时的游客",
|
|
502
|
-
"pisell2.booking.dashboard.overdue-visitors-tip": "提示:游玩时间已过,但尚未离场的游客总人数",
|
|
503
|
-
"pisell2.booking.dashboard.completed-visitors": "已完成的游客",
|
|
504
|
-
"pisell2.booking.dashboard.completed-visitors-tip": "提示:游玩时长已结束的游客总人数,无论是否离场",
|
|
505
|
-
"pisell2.booking.dashboard.departed-visitors": "已离场的游客",
|
|
506
|
-
"pisell2.booking.dashboard.departed-visitors-tip": "提示:今日已检票并离场的游客总人数"
|
|
476
|
+
"page.booking.text.resource.min-length-error": (x, y) => `至少选择${x}项${y}`
|
|
507
477
|
},
|
|
508
478
|
"zh-HK": {
|
|
509
479
|
"pisell2.text.refunded-amount": "已退金額",
|
|
@@ -726,21 +696,6 @@ var locales_default = {
|
|
|
726
696
|
"page.booking.text.please-choose-an-option": "請選擇:",
|
|
727
697
|
"page.booking.text.please-choose-an-option-1": "退款:取消預約,同時處理退款。",
|
|
728
698
|
"page.booking.text.please-choose-an-option-2": "僅取消:僅取消預約,但不進行退款處理。(您仍然可以在取消後再進行退款操作)",
|
|
729
|
-
"
|
|
730
|
-
"pisell2.booking.dashboard.groups-on-site-now-tip": "提示:已檢票並在場內的團體總數",
|
|
731
|
-
"pisell2.booking.dashboard.people-on-site-now": "當前在場人數",
|
|
732
|
-
"pisell2.booking.dashboard.people-on-site-now-tip": "提示:已檢票並在場內的總人數",
|
|
733
|
-
"pisell2.booking.dashboard.total-visitors-today": "今日遊客總數",
|
|
734
|
-
"pisell2.booking.dashboard.total-visitors-today-tip": "提示:今日的遊客總人數,無論是否檢票入場",
|
|
735
|
-
"pisell2.booking.dashboard.ongoing-visitors": "進行中的遊客",
|
|
736
|
-
"pisell2.booking.dashboard.ongoing-visitors-tip": "提示:已過開始時間的遊客總數,無論是否檢票",
|
|
737
|
-
"pisell2.booking.dashboard.upcoming-visitors": "即將到達的遊客",
|
|
738
|
-
"pisell2.booking.dashboard.upcoming-visitors-tip": "提示:預計將在未來到場的遊客總人數",
|
|
739
|
-
"pisell2.booking.dashboard.overdue-visitors": "超時的遊客",
|
|
740
|
-
"pisell2.booking.dashboard.overdue-visitors-tip": "提示:遊玩時間已過,但尚未離場的遊客總人數",
|
|
741
|
-
"pisell2.booking.dashboard.completed-visitors": "已完成的遊客",
|
|
742
|
-
"pisell2.booking.dashboard.completed-visitors-tip": "提示:遊玩時長已結束的遊客總人數,無論是否離場",
|
|
743
|
-
"pisell2.booking.dashboard.departed-visitors": "已離場的遊客",
|
|
744
|
-
"pisell2.booking.dashboard.departed-visitors-tip": "提示:今日已檢票並離場的遊客總人數"
|
|
699
|
+
"page.booking.text.resource.min-length-error": (x, y) => `至少選擇${x}項${y}`
|
|
745
700
|
}
|
|
746
701
|
};
|
|
@@ -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
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -62,7 +62,7 @@ export declare const getServeStartTime: (start_time: string) => string;
|
|
|
62
62
|
* @Date: 2024-04-26 14:04
|
|
63
63
|
*/
|
|
64
64
|
export declare const getServiceTime: (item: any, currentDate: any) => string;
|
|
65
|
-
export declare const findNextSlice: ({ timeSlices, index, date
|
|
65
|
+
export declare const findNextSlice: ({ timeSlices, index, date }: {
|
|
66
66
|
timeSlices: any[];
|
|
67
67
|
index?: number | undefined;
|
|
68
68
|
date?: string | undefined;
|