@pisell/private-materials 3.0.73 → 3.0.75
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 +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +15 -15
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/components/drawer/index.d.ts +1 -0
- package/es/components/booking/components/drawer/index.js +5 -0
- package/es/components/booking/components/drawer/index.less +10 -3
- package/es/components/booking/components/footer/amount.js +47 -24
- package/es/components/booking/components/footer/index.js +5 -0
- package/es/components/booking/components/footer/utils.js +12 -0
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/model.d.ts +1 -2
- package/es/components/booking/info/service/actions/index.d.ts +6 -0
- package/es/components/booking/info/service/actions/index.js +73 -0
- package/es/components/booking/info/service/actions/index.less +9 -0
- package/es/components/booking/info/service/addTimeModal/index.d.ts +4 -0
- package/es/components/booking/info/service/addTimeModal/index.js +697 -0
- package/es/components/booking/info/service/addTimeModal/index.less +138 -0
- package/es/components/booking/info/service/addTimeModal/serve.d.ts +5 -0
- package/es/components/booking/info/service/addTimeModal/serve.js +50 -0
- package/es/components/booking/info/service/addTimeModal/utils.d.ts +31 -0
- package/es/components/booking/info/service/addTimeModal/utils.js +174 -0
- package/es/components/booking/info/service/index.js +2 -1
- package/es/components/booking/info/service/serviceItem/Sales/index.d.ts +0 -0
- package/es/components/booking/info/service/serviceItem/Sales/index.js +0 -0
- package/es/components/booking/info/service/serviceItem/Sales/index.less +0 -0
- package/es/components/booking/info/service/serviceItem/index.js +24 -2
- package/es/components/booking/info/service/serviceItem/index.less +28 -0
- package/es/components/booking/locales.d.ts +27 -0
- package/es/components/booking/locales.js +29 -2
- package/es/components/booking/model.d.ts +3 -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/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/booking/utils.d.ts +12 -0
- package/es/components/booking/utils.js +91 -48
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/components/drawer/index.d.ts +1 -0
- package/lib/components/booking/components/drawer/index.js +4 -0
- package/lib/components/booking/components/drawer/index.less +10 -3
- package/lib/components/booking/components/footer/amount.js +10 -0
- package/lib/components/booking/components/footer/index.js +5 -0
- package/lib/components/booking/components/footer/utils.js +12 -0
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/model.d.ts +1 -2
- package/lib/components/booking/info/service/actions/index.d.ts +6 -0
- package/lib/components/booking/info/service/actions/index.js +97 -0
- package/lib/components/booking/info/service/actions/index.less +9 -0
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +4 -0
- package/lib/components/booking/info/service/addTimeModal/index.js +553 -0
- package/lib/components/booking/info/service/addTimeModal/index.less +138 -0
- package/lib/components/booking/info/service/addTimeModal/serve.d.ts +5 -0
- package/lib/components/booking/info/service/addTimeModal/serve.js +39 -0
- package/lib/components/booking/info/service/addTimeModal/utils.d.ts +31 -0
- package/lib/components/booking/info/service/addTimeModal/utils.js +155 -0
- package/lib/components/booking/info/service/index.js +2 -1
- package/lib/components/booking/info/service/serviceItem/Sales/index.d.ts +0 -0
- package/lib/components/booking/info/service/serviceItem/Sales/index.js +0 -0
- package/lib/components/booking/info/service/serviceItem/Sales/index.less +0 -0
- package/lib/components/booking/info/service/serviceItem/index.js +14 -1
- package/lib/components/booking/info/service/serviceItem/index.less +28 -0
- package/lib/components/booking/locales.d.ts +27 -0
- package/lib/components/booking/locales.js +29 -2
- package/lib/components/booking/model.d.ts +3 -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/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/booking/utils.d.ts +12 -0
- package/lib/components/booking/utils.js +82 -33
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/package.json +3 -3
|
@@ -35,14 +35,17 @@ __export(utils_exports, {
|
|
|
35
35
|
flexibleObj: () => flexibleObj,
|
|
36
36
|
formatProductListByCategory: () => formatProductListByCategory,
|
|
37
37
|
formatResource: () => formatResource,
|
|
38
|
+
formatTimes: () => formatTimes,
|
|
38
39
|
getCacheParams: () => getCacheParams,
|
|
39
40
|
getDiscountTime: () => getDiscountTime,
|
|
40
41
|
getDuration: () => getDuration,
|
|
41
42
|
getEndDate: () => getEndDate,
|
|
42
43
|
getErrorList: () => getErrorList,
|
|
44
|
+
getIsEdit: () => getIsEdit,
|
|
43
45
|
getLastServer: () => getLastServer,
|
|
44
46
|
getNowTime: () => getNowTime,
|
|
45
47
|
getProductTotalPrice: () => getProductTotalPrice,
|
|
48
|
+
getResourceTimeIsUsable: () => getResourceTimeIsUsable,
|
|
46
49
|
getServeStartTime: () => getServeStartTime,
|
|
47
50
|
getServerItemExtend: () => getServerItemExtend,
|
|
48
51
|
getServiceTime: () => getServiceTime,
|
|
@@ -204,42 +207,46 @@ var formatProductListByCategory = (list, filterItem) => {
|
|
|
204
207
|
}
|
|
205
208
|
return Object.values(categoryObject);
|
|
206
209
|
};
|
|
210
|
+
var getResourceTimeIsUsable = (item, cacheItem) => {
|
|
211
|
+
const startDate = (0, import_dayjs.default)(cacheItem._extend.start_date.format("YYYY-MM-DD") + " " + getServeStartTime(cacheItem._extend.start_time));
|
|
212
|
+
const isFlexible = flexibleObj.isFlexible(cacheItem._extend.duration);
|
|
213
|
+
let isMaxLimitRange = false;
|
|
214
|
+
let isDateRange = false;
|
|
215
|
+
let time = { ...item };
|
|
216
|
+
if (time.max_participants_limit == 0) {
|
|
217
|
+
isMaxLimitRange = true;
|
|
218
|
+
} else {
|
|
219
|
+
isMaxLimitRange = "unknown";
|
|
220
|
+
}
|
|
221
|
+
const timeStartDate = (0, import_dayjs.default)(time.start_date + " " + time.start_time).subtract(1, "second");
|
|
222
|
+
const timeEndDate = (0, import_dayjs.default)(time.end_date + " " + time.end_time).add(1, "second");
|
|
223
|
+
let bol;
|
|
224
|
+
if (isFlexible) {
|
|
225
|
+
bol = startDate.isAfter(timeStartDate) && startDate.isBefore(timeEndDate);
|
|
226
|
+
} else {
|
|
227
|
+
let endDate = startDate.add(flexibleObj.getValue(cacheItem._extend.duration), "minute");
|
|
228
|
+
bol = startDate.isAfter(timeStartDate) && endDate.isBefore(timeEndDate);
|
|
229
|
+
}
|
|
230
|
+
if (bol) {
|
|
231
|
+
isDateRange = true;
|
|
232
|
+
}
|
|
233
|
+
const isUsable = isDateRange;
|
|
234
|
+
time._extend = {
|
|
235
|
+
isMaxLimitRange,
|
|
236
|
+
isDateRange,
|
|
237
|
+
isUsable
|
|
238
|
+
};
|
|
239
|
+
return time;
|
|
240
|
+
};
|
|
207
241
|
var formatTimes = (resourceItem, cacheItem) => {
|
|
208
242
|
let usableTimes = [];
|
|
209
243
|
let _resourceItem = { ...resourceItem };
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
let isDateRange = false;
|
|
215
|
-
let time = { ...d };
|
|
216
|
-
if (time.max_participants_limit == 0) {
|
|
217
|
-
isMaxLimitRange = true;
|
|
218
|
-
} else {
|
|
219
|
-
isMaxLimitRange = "unknown";
|
|
220
|
-
}
|
|
221
|
-
const timeStartDate = (0, import_dayjs.default)(time.start_date + " " + time.start_time).subtract(1, "second");
|
|
222
|
-
const timeEndDate = (0, import_dayjs.default)(time.end_date + " " + time.end_time).add(1, "second");
|
|
223
|
-
let bol;
|
|
224
|
-
if (isFlexible) {
|
|
225
|
-
bol = startDate.isAfter(timeStartDate) && startDate.isBefore(timeEndDate);
|
|
226
|
-
} else {
|
|
227
|
-
let endDate = startDate.add(flexibleObj.getValue(cacheItem._extend.duration), "minute");
|
|
228
|
-
bol = startDate.isAfter(timeStartDate) && endDate.isBefore(timeEndDate);
|
|
229
|
-
}
|
|
230
|
-
if (bol) {
|
|
231
|
-
isDateRange = true;
|
|
244
|
+
_resourceItem.times = _resourceItem.times.map((time) => {
|
|
245
|
+
let _time2 = getResourceTimeIsUsable(time, cacheItem);
|
|
246
|
+
if (_time2 == null ? void 0 : _time2._extend.isUsable) {
|
|
247
|
+
usableTimes.push(_time2);
|
|
232
248
|
}
|
|
233
|
-
|
|
234
|
-
time._extend = {
|
|
235
|
-
isMaxLimitRange,
|
|
236
|
-
isDateRange,
|
|
237
|
-
isUsable
|
|
238
|
-
};
|
|
239
|
-
if (isUsable) {
|
|
240
|
-
usableTimes.push(time);
|
|
241
|
-
}
|
|
242
|
-
return time;
|
|
249
|
+
return _time2;
|
|
243
250
|
});
|
|
244
251
|
let _time = (usableTimes || []).sort((a, b) => {
|
|
245
252
|
const aEndDate = (0, import_dayjs.default)(a.end_date + " " + a.end_time).valueOf();
|
|
@@ -309,6 +316,15 @@ var flexibleObj = {
|
|
|
309
316
|
return false;
|
|
310
317
|
}
|
|
311
318
|
return str.indexOf("flexible_") > -1;
|
|
319
|
+
},
|
|
320
|
+
add: (current, duration) => {
|
|
321
|
+
if (flexibleObj.isFlexible(current)) {
|
|
322
|
+
return flexibleObj.create(
|
|
323
|
+
flexibleObj.getValue(current) + duration
|
|
324
|
+
);
|
|
325
|
+
} else {
|
|
326
|
+
return Number(current) + duration;
|
|
327
|
+
}
|
|
312
328
|
}
|
|
313
329
|
};
|
|
314
330
|
var getEndDate = (startDate, duration, endDate) => {
|
|
@@ -383,7 +399,9 @@ var formatResource = (resourceItem, cacheItem, formatLabel) => {
|
|
|
383
399
|
_resourceItem.labelText = _resourceItem.room_name || _resourceItem.name;
|
|
384
400
|
const usable = _resourceItem._extend.usableTime && _resourceItem._extend.usableProduct;
|
|
385
401
|
_resourceItem.usable = usable;
|
|
386
|
-
|
|
402
|
+
if (formatLabel) {
|
|
403
|
+
_resourceItem.label = formatLabel(_resourceItem);
|
|
404
|
+
}
|
|
387
405
|
return _resourceItem;
|
|
388
406
|
};
|
|
389
407
|
var getLastServer = (list) => {
|
|
@@ -485,6 +503,34 @@ var isWalkIn = (customer_id) => {
|
|
|
485
503
|
}
|
|
486
504
|
return [0, 1].includes(customer_id);
|
|
487
505
|
};
|
|
506
|
+
var getIsEdit = (state) => {
|
|
507
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
508
|
+
if ((_a = state.addons) == null ? void 0 : _a.edit) {
|
|
509
|
+
return true;
|
|
510
|
+
}
|
|
511
|
+
if (!state.bookingId) {
|
|
512
|
+
return true;
|
|
513
|
+
}
|
|
514
|
+
if ((_b = state.client) == null ? void 0 : _b.edit) {
|
|
515
|
+
return true;
|
|
516
|
+
}
|
|
517
|
+
if ((_c = state.date) == null ? void 0 : _c.edit) {
|
|
518
|
+
return true;
|
|
519
|
+
}
|
|
520
|
+
if ((_d = state.pet) == null ? void 0 : _d.edit) {
|
|
521
|
+
return true;
|
|
522
|
+
}
|
|
523
|
+
if ((_e = state.service) == null ? void 0 : _e.edit) {
|
|
524
|
+
return true;
|
|
525
|
+
}
|
|
526
|
+
if ((_f = state.notes) == null ? void 0 : _f.edit) {
|
|
527
|
+
return true;
|
|
528
|
+
}
|
|
529
|
+
if ((_g = state.contacts) == null ? void 0 : _g.edit) {
|
|
530
|
+
return true;
|
|
531
|
+
}
|
|
532
|
+
return false;
|
|
533
|
+
};
|
|
488
534
|
// Annotate the CommonJS export names for ESM import in node:
|
|
489
535
|
0 && (module.exports = {
|
|
490
536
|
deleteCacheParams,
|
|
@@ -493,14 +539,17 @@ var isWalkIn = (customer_id) => {
|
|
|
493
539
|
flexibleObj,
|
|
494
540
|
formatProductListByCategory,
|
|
495
541
|
formatResource,
|
|
542
|
+
formatTimes,
|
|
496
543
|
getCacheParams,
|
|
497
544
|
getDiscountTime,
|
|
498
545
|
getDuration,
|
|
499
546
|
getEndDate,
|
|
500
547
|
getErrorList,
|
|
548
|
+
getIsEdit,
|
|
501
549
|
getLastServer,
|
|
502
550
|
getNowTime,
|
|
503
551
|
getProductTotalPrice,
|
|
552
|
+
getResourceTimeIsUsable,
|
|
504
553
|
getServeStartTime,
|
|
505
554
|
getServerItemExtend,
|
|
506
555
|
getServiceTime,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
3
2
|
import dayjs from "dayjs";
|
|
4
3
|
export interface FormState {
|
|
@@ -69,7 +68,7 @@ export interface FormState {
|
|
|
69
68
|
};
|
|
70
69
|
setGlobalState: Function | null;
|
|
71
70
|
}
|
|
72
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
71
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
73
72
|
state: FormState;
|
|
74
73
|
} & {
|
|
75
74
|
dispatch: (params: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.75",
|
|
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/utils": "1.0.25",
|
|
61
62
|
"@pisell/date-picker": "1.0.74",
|
|
62
|
-
"@pisell/icon": "0.0.8"
|
|
63
|
-
"@pisell/utils": "1.0.25"
|
|
63
|
+
"@pisell/icon": "0.0.8"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"react": "^18.0.0",
|