@pisell/private-materials 6.6.2 → 6.6.3

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 (39) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +1 -1
  6. package/build/lowcode/view.js +1 -1
  7. package/es/components/booking/addons/model.d.ts +1 -10
  8. package/es/components/booking/forms/model.d.ts +1 -10
  9. package/es/components/booking/info/model.d.ts +1 -10
  10. package/es/components/booking/model.d.ts +1 -9
  11. package/es/components/booking/notes/model.d.ts +1 -10
  12. package/es/components/booking/payments/model.d.ts +1 -10
  13. package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
  14. package/es/components/pay/toC/model.d.ts +1 -9
  15. package/es/components/schedules/model.d.ts +1 -9
  16. package/es/components/wallet/Detail/model.d.ts +1 -13
  17. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  18. package/es/components/wallet/PointCard/model.d.ts +1 -13
  19. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  20. package/es/components/wallet/Voucher/model.d.ts +1 -13
  21. package/es/components/wallet/model.d.ts +1 -9
  22. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +37 -39
  23. package/lib/components/booking/addons/model.d.ts +1 -10
  24. package/lib/components/booking/forms/model.d.ts +1 -10
  25. package/lib/components/booking/info/model.d.ts +1 -10
  26. package/lib/components/booking/model.d.ts +1 -9
  27. package/lib/components/booking/notes/model.d.ts +1 -10
  28. package/lib/components/booking/payments/model.d.ts +1 -10
  29. package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
  30. package/lib/components/pay/toC/model.d.ts +1 -9
  31. package/lib/components/schedules/model.d.ts +1 -9
  32. package/lib/components/wallet/Detail/model.d.ts +1 -13
  33. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  34. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  35. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  36. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  37. package/lib/components/wallet/model.d.ts +1 -9
  38. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +16 -30
  39. package/package.json +1 -1
@@ -38,6 +38,7 @@ var import_dayjs = __toESM(require("dayjs"));
38
38
  var import_materials = require("@pisell/materials");
39
39
  var import_antd = require("antd");
40
40
  var import_utils = require("@pisell/utils");
41
+ var import_dateRange = require("../../components/booking/info/dateRange");
41
42
  var import_MultiDayTimeSelect = require("./MultiDayTimeSelect.less");
42
43
  var RangePicker = import_materials.DatePicker.RangePicker;
43
44
  var MultiDayTimeSelect = (0, import_react.forwardRef)(({
@@ -72,8 +73,16 @@ var MultiDayTimeSelect = (0, import_react.forwardRef)(({
72
73
  value: i
73
74
  });
74
75
  }
76
+ const currentDuration = internalValue == null ? void 0 : internalValue.duration;
77
+ if (currentDuration && currentDuration > maxDays) {
78
+ options.push({
79
+ label: `${currentDuration} ${currentDuration === 1 ? locale === "en" ? "day" : "天" : locale === "en" ? "days" : "天"}`,
80
+ value: currentDuration,
81
+ disabled: true
82
+ });
83
+ }
75
84
  return options;
76
- }, [maxDays, locale]);
85
+ }, [maxDays, locale, internalValue == null ? void 0 : internalValue.duration]);
77
86
  (0, import_react.useEffect)(() => {
78
87
  if (value) {
79
88
  setInternalValue(value);
@@ -110,17 +119,6 @@ var MultiDayTimeSelect = (0, import_react.forwardRef)(({
110
119
  const days = dates[1].diff(dates[0], "day");
111
120
  let finalEndDate = dates[1];
112
121
  let finalDuration = days;
113
- if (days > maxDays) {
114
- const endTime = {
115
- hour: dates[1].hour(),
116
- minute: dates[1].minute(),
117
- second: dates[1].second(),
118
- millisecond: dates[1].millisecond()
119
- };
120
- finalEndDate = dates[0].add(maxDays, "day");
121
- finalEndDate = finalEndDate.hour(endTime.hour).minute(endTime.minute).second(endTime.second).millisecond(endTime.millisecond);
122
- finalDuration = maxDays;
123
- }
124
122
  if (days > 0) {
125
123
  const newValue = {
126
124
  startDate: dates[0],
@@ -162,29 +160,16 @@ var MultiDayTimeSelect = (0, import_react.forwardRef)(({
162
160
  const handleEndDateChange = (date) => {
163
161
  if (date && internalValue) {
164
162
  const days = date.diff(internalValue.startDate, "day");
165
- let finalEndDate = date;
166
- let finalDuration = days;
167
- if (days > maxDays) {
168
- const endTime = {
169
- hour: date.hour(),
170
- minute: date.minute(),
171
- second: date.second(),
172
- millisecond: date.millisecond()
173
- };
174
- finalEndDate = internalValue.startDate.add(maxDays, "day");
175
- finalEndDate = finalEndDate.hour(endTime.hour).minute(endTime.minute).second(endTime.second).millisecond(endTime.millisecond);
176
- finalDuration = maxDays;
177
- }
178
163
  if (days > 0) {
179
164
  const newValue = {
180
165
  startDate: internalValue.startDate,
181
- endDate: finalEndDate,
182
- duration: finalDuration
166
+ endDate: date,
167
+ duration: days
183
168
  };
184
169
  updateValue(newValue);
185
170
  form.setFieldsValue({
186
- endDate: finalEndDate,
187
- duration: finalDuration
171
+ endDate: date,
172
+ duration: days
188
173
  });
189
174
  }
190
175
  }
@@ -278,7 +263,8 @@ var MultiDayTimeSelect = (0, import_react.forwardRef)(({
278
263
  format: formatLocale,
279
264
  isHideCustomSelect: true,
280
265
  endDateDays: 1,
281
- disabled
266
+ disabled,
267
+ disabledDate: import_dateRange.disabledDate
282
268
  }
283
269
  ))
284
270
  )), /* @__PURE__ */ import_react.default.createElement(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.6.2",
3
+ "version": "6.6.3",
4
4
  "scripts": {
5
5
  "dev": "father dev",
6
6
  "build": "father build",