@wix/headless-bookings 0.0.91 → 0.0.93

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 (47) hide show
  1. package/cjs/dist/react/booking/Book.d.ts +1 -1
  2. package/cjs/dist/react/booking/Book.js +9 -6
  3. package/cjs/dist/react/booking/Booking.d.ts +2 -15
  4. package/cjs/dist/react/booking/Booking.js +2 -19
  5. package/cjs/dist/react/booking/BookingItem.d.ts +1 -2
  6. package/cjs/dist/react/booking/BookingItem.js +2 -2
  7. package/cjs/dist/react/booking-form/BookingForm.js +3 -3
  8. package/cjs/dist/react/location/Location.d.ts +2 -4
  9. package/cjs/dist/react/location/Location.js +14 -14
  10. package/cjs/dist/react/location/LocationList.d.ts +1 -2
  11. package/cjs/dist/react/location/LocationList.js +6 -5
  12. package/cjs/dist/react/payment/Payment.d.ts +8 -16
  13. package/cjs/dist/react/payment/Payment.js +14 -14
  14. package/cjs/dist/react/service/Service.d.ts +8 -16
  15. package/cjs/dist/react/service/Service.js +29 -29
  16. package/cjs/dist/react/staff-member/StaffMember.d.ts +1 -2
  17. package/cjs/dist/react/staff-member/StaffMember.js +5 -5
  18. package/cjs/dist/react/staff-member/StaffMemberList.d.ts +3 -3
  19. package/cjs/dist/react/staff-member/StaffMemberList.js +6 -5
  20. package/cjs/dist/react/time-slot-list/TimeSlot.d.ts +4 -8
  21. package/cjs/dist/react/time-slot-list/TimeSlot.js +19 -19
  22. package/cjs/dist/react/time-slot-list/TimeSlotList.d.ts +1 -3
  23. package/cjs/dist/react/time-slot-list/TimeSlotList.js +9 -8
  24. package/dist/react/booking/Book.d.ts +1 -1
  25. package/dist/react/booking/Book.js +9 -6
  26. package/dist/react/booking/Booking.d.ts +2 -15
  27. package/dist/react/booking/Booking.js +2 -19
  28. package/dist/react/booking/BookingItem.d.ts +1 -2
  29. package/dist/react/booking/BookingItem.js +2 -2
  30. package/dist/react/booking-form/BookingForm.js +3 -3
  31. package/dist/react/location/Location.d.ts +2 -4
  32. package/dist/react/location/Location.js +14 -14
  33. package/dist/react/location/LocationList.d.ts +1 -2
  34. package/dist/react/location/LocationList.js +6 -5
  35. package/dist/react/payment/Payment.d.ts +8 -16
  36. package/dist/react/payment/Payment.js +14 -14
  37. package/dist/react/service/Service.d.ts +8 -16
  38. package/dist/react/service/Service.js +29 -29
  39. package/dist/react/staff-member/StaffMember.d.ts +1 -2
  40. package/dist/react/staff-member/StaffMember.js +5 -5
  41. package/dist/react/staff-member/StaffMemberList.d.ts +3 -3
  42. package/dist/react/staff-member/StaffMemberList.js +6 -5
  43. package/dist/react/time-slot-list/TimeSlot.d.ts +4 -8
  44. package/dist/react/time-slot-list/TimeSlot.js +19 -19
  45. package/dist/react/time-slot-list/TimeSlotList.d.ts +1 -3
  46. package/dist/react/time-slot-list/TimeSlotList.js +9 -8
  47. package/package.json +2 -2
@@ -182,7 +182,7 @@ export const Actions = {
182
182
  * Uses the core DateRange component to access service data.
183
183
  * Both dates are set together and trigger a single fetch.
184
184
  *
185
- * Default rendering provides two native date inputs.
185
+ * Default rendering provides a native date input.
186
186
  *
187
187
  * @component
188
188
  * @example
@@ -203,18 +203,19 @@ export const Actions = {
203
203
  * ```
204
204
  */
205
205
  const DateRangeInput = React.forwardRef((props, ref) => {
206
- const { asChild, children, className, ...otherProps } = props;
206
+ const { asChild, children, className, onChange, ...rest } = props;
207
207
  return (_jsx(CoreTimeSlotList.DateRange, { children: ({ startDate, endDate, setDateRange, timezone }) => {
208
- const defaultContent = (_jsx("input", { ref: ref, type: "date", className: className, "data-testid": TestIds.timeSlotListDateRangeInput, value: toISODateString(startDate, timezone), required: true, onChange: (e) => {
209
- const date = parse(e.target.value, 'yyyy-MM-dd', new Date());
210
- setDateRange(startOfDay(date), endOfDay(date));
211
- } }));
212
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, className: className, "data-testid": TestIds.timeSlotListDateRangeInput, customElement: children, customElementProps: {
208
+ const handleChange = (e) => {
209
+ const date = parse(e.target.value, 'yyyy-MM-dd', new Date());
210
+ setDateRange(startOfDay(date), endOfDay(date));
211
+ onChange?.(e);
212
+ };
213
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onChange: handleChange, "data-testid": TestIds.timeSlotListDateRangeInput, customElement: children, customElementProps: {
213
214
  startDate,
214
215
  endDate,
215
216
  onChange: setDateRange,
216
217
  timezone,
217
- }, ...otherProps, children: defaultContent }));
218
+ }, children: _jsx("input", { ref: ref, type: "date", value: toISODateString(startDate, timezone) }) }));
218
219
  } }));
219
220
  });
220
221
  DateRangeInput.displayName = 'TimeSlotList.DateRange.Input';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/headless-bookings",
3
- "version": "0.0.91",
3
+ "version": "0.0.93",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -72,5 +72,5 @@
72
72
  "groupId": "com.wixpress.headless-components"
73
73
  }
74
74
  },
75
- "falconPackageHash": "a78e1dd86856b7de4c6810333ca39eddce83be25a76ac688d6b2981c"
75
+ "falconPackageHash": "d8683a086a43f24ffeaae5e129663db278cce49f41577a8e4e4946f9"
76
76
  }