@wix/headless-bookings 0.0.93 → 0.0.94

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 (85) hide show
  1. package/cjs/dist/__mocks__/services.d.ts +0 -4
  2. package/cjs/dist/__mocks__/services.js +1 -4
  3. package/cjs/dist/api/fetch-availability/index.js +3 -3
  4. package/cjs/dist/api/query-services/index.js +1 -4
  5. package/cjs/dist/react/booking/Book.d.ts +3 -0
  6. package/cjs/dist/react/booking/Book.js +5 -6
  7. package/cjs/dist/react/booking/Booking.d.ts +10 -0
  8. package/cjs/dist/react/booking/Booking.js +10 -11
  9. package/cjs/dist/react/booking/BookingItem.d.ts +5 -0
  10. package/cjs/dist/react/booking/BookingItem.js +5 -6
  11. package/cjs/dist/react/booking-form/BookingForm.d.ts +5 -0
  12. package/cjs/dist/react/booking-form/BookingForm.js +7 -8
  13. package/cjs/dist/react/core/staff-member/StaffMember.js +1 -2
  14. package/cjs/dist/react/core/staff-member-list/StaffMemberList.d.ts +2 -0
  15. package/cjs/dist/react/core/staff-member-list/StaffMemberList.js +11 -0
  16. package/cjs/dist/react/location/Location.d.ts +10 -0
  17. package/cjs/dist/react/location/Location.js +12 -13
  18. package/cjs/dist/react/location/LocationList.d.ts +7 -0
  19. package/cjs/dist/react/location/LocationList.js +9 -10
  20. package/cjs/dist/react/payment/Payment.d.ts +14 -0
  21. package/cjs/dist/react/payment/Payment.js +14 -15
  22. package/cjs/dist/react/service/Service.d.ts +33 -0
  23. package/cjs/dist/react/service/Service.js +39 -40
  24. package/cjs/dist/react/service/ServiceMedia.d.ts +4 -0
  25. package/cjs/dist/react/service/ServiceMedia.js +4 -5
  26. package/cjs/dist/react/service-list/ServiceList.d.ts +7 -0
  27. package/cjs/dist/react/service-list/ServiceList.js +7 -8
  28. package/cjs/dist/react/staff-member/StaffMember.d.ts +6 -6
  29. package/cjs/dist/react/staff-member/StaffMember.js +8 -9
  30. package/cjs/dist/react/staff-member/StaffMemberList.d.ts +8 -7
  31. package/cjs/dist/react/staff-member/StaffMemberList.js +11 -22
  32. package/cjs/dist/react/time-slot-list/TimeSlot.d.ts +12 -12
  33. package/cjs/dist/react/time-slot-list/TimeSlot.js +18 -19
  34. package/cjs/dist/react/time-slot-list/TimeSlotList.d.ts +9 -9
  35. package/cjs/dist/react/time-slot-list/TimeSlotList.js +9 -10
  36. package/cjs/dist/services/booking/book-action/buildBookingRequest.js +1 -2
  37. package/cjs/dist/services/booking/book-action/buildCheckoutRequest.js +2 -2
  38. package/cjs/dist/services/constants.d.ts +9 -0
  39. package/cjs/dist/services/constants.js +9 -0
  40. package/cjs/dist/services/payment/payment.js +2 -5
  41. package/cjs/dist/services/service/service.js +1 -1
  42. package/cjs/dist/services/service-list/service-list.js +1 -4
  43. package/dist/__mocks__/services.d.ts +0 -4
  44. package/dist/__mocks__/services.js +1 -4
  45. package/dist/api/fetch-availability/index.js +3 -3
  46. package/dist/api/query-services/index.js +1 -4
  47. package/dist/react/booking/Book.d.ts +3 -0
  48. package/dist/react/booking/Book.js +5 -6
  49. package/dist/react/booking/Booking.d.ts +10 -0
  50. package/dist/react/booking/Booking.js +10 -11
  51. package/dist/react/booking/BookingItem.d.ts +5 -0
  52. package/dist/react/booking/BookingItem.js +5 -6
  53. package/dist/react/booking-form/BookingForm.d.ts +5 -0
  54. package/dist/react/booking-form/BookingForm.js +7 -8
  55. package/dist/react/core/staff-member/StaffMember.js +1 -2
  56. package/dist/react/core/staff-member-list/StaffMemberList.d.ts +2 -0
  57. package/dist/react/core/staff-member-list/StaffMemberList.js +11 -0
  58. package/dist/react/location/Location.d.ts +10 -0
  59. package/dist/react/location/Location.js +12 -13
  60. package/dist/react/location/LocationList.d.ts +7 -0
  61. package/dist/react/location/LocationList.js +9 -10
  62. package/dist/react/payment/Payment.d.ts +14 -0
  63. package/dist/react/payment/Payment.js +14 -15
  64. package/dist/react/service/Service.d.ts +33 -0
  65. package/dist/react/service/Service.js +39 -40
  66. package/dist/react/service/ServiceMedia.d.ts +4 -0
  67. package/dist/react/service/ServiceMedia.js +4 -5
  68. package/dist/react/service-list/ServiceList.d.ts +7 -0
  69. package/dist/react/service-list/ServiceList.js +7 -8
  70. package/dist/react/staff-member/StaffMember.d.ts +6 -6
  71. package/dist/react/staff-member/StaffMember.js +8 -9
  72. package/dist/react/staff-member/StaffMemberList.d.ts +8 -7
  73. package/dist/react/staff-member/StaffMemberList.js +11 -22
  74. package/dist/react/time-slot-list/TimeSlot.d.ts +12 -12
  75. package/dist/react/time-slot-list/TimeSlot.js +18 -19
  76. package/dist/react/time-slot-list/TimeSlotList.d.ts +9 -9
  77. package/dist/react/time-slot-list/TimeSlotList.js +9 -10
  78. package/dist/services/booking/book-action/buildBookingRequest.js +1 -2
  79. package/dist/services/booking/book-action/buildCheckoutRequest.js +2 -2
  80. package/dist/services/constants.d.ts +9 -0
  81. package/dist/services/constants.js +9 -0
  82. package/dist/services/payment/payment.js +2 -5
  83. package/dist/services/service/service.js +1 -1
  84. package/dist/services/service-list/service-list.js +1 -4
  85. package/package.json +2 -2
@@ -2,10 +2,7 @@
2
2
  * Shared mock data for booking service tests
3
3
  */
4
4
  import { RateType, ServiceType } from '@wix/auto_sdk_bookings_services';
5
- /**
6
- * Booking app ID constant
7
- */
8
- export const BOOKING_APP_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
5
+ import { BOOKING_APP_ID } from '../services/constants.js';
9
6
  /**
10
7
  * Base mock service with all fields populated (APPOINTMENT type, FIXED pricing)
11
8
  */
@@ -7,6 +7,7 @@ import { listEventTimeSlots } from '@wix/auto_sdk_bookings_event-time-slots';
7
7
  import { ServiceType } from '@wix/auto_sdk_bookings_services';
8
8
  import { format } from 'date-fns';
9
9
  import { ViewMode, } from '../../services/time-slot-list/time-slot-list.def.js';
10
+ import { STAFF_MEMBER_RESOURCE_TYPE_ID } from '../../services/constants.js';
10
11
  // ============================================================================
11
12
  // Internal Types
12
13
  // ============================================================================
@@ -16,7 +17,6 @@ var FlowType;
16
17
  FlowType["MULTI_SERVICE"] = "multi_service";
17
18
  FlowType["CLASS"] = "class";
18
19
  })(FlowType || (FlowType = {}));
19
- const STAFF_RESOURCE_TYPE_ID = '1cd44cf8-756f-41c3-bd90-3e2ffcaf1155';
20
20
  // ============================================================================
21
21
  // Helpers
22
22
  // ============================================================================
@@ -87,14 +87,14 @@ export async function fetchAvailability({ services: selectedServices, viewMode =
87
87
  const resourceTypes = staffMemberIds?.length
88
88
  ? [
89
89
  {
90
- resourceTypeId: STAFF_RESOURCE_TYPE_ID,
90
+ resourceTypeId: STAFF_MEMBER_RESOURCE_TYPE_ID,
91
91
  resourceIds: staffMemberIds,
92
92
  },
93
93
  ]
94
94
  : undefined;
95
95
  const includeResourceTypeIds = isFetchAvailabileDays
96
96
  ? undefined
97
- : [STAFF_RESOURCE_TYPE_ID];
97
+ : [STAFF_MEMBER_RESOURCE_TYPE_ID];
98
98
  const locations = location
99
99
  ? [{ _id: location.id, locationType: location.locationType }]
100
100
  : undefined;
@@ -3,10 +3,7 @@
3
3
  * Fetches single or multiple services with pagination and sorting
4
4
  */
5
5
  import { queryServices as queryServicesApi, LocationType, } from '@wix/auto_sdk_bookings_services';
6
- /**
7
- * Booking app ID constant
8
- */
9
- const BOOKING_APP_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
6
+ import { BOOKING_APP_ID } from '../../services/constants.js';
10
7
  /**
11
8
  * Synthetic location ID constants for non-business locations
12
9
  */
@@ -4,6 +4,9 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import type { BookChildProps, BookingError } from '../../services/booking/book-action/types.js';
7
+ export declare const TestIds: {
8
+ readonly bookingActionBook: "booking-action-book";
9
+ };
7
10
  /**
8
11
  * Props for the high-level Book component
9
12
  */
@@ -7,10 +7,9 @@ import React from 'react';
7
7
  import { AsChildSlot } from '@wix/headless-utils/react';
8
8
  import * as CoreBook from '../core/booking/Book.js';
9
9
  import { navigateToCheckout as navigateToCheckoutUtil } from '../../utils/navigation.js';
10
- var TestIds;
11
- (function (TestIds) {
12
- TestIds["bookingActionBook"] = "booking-action-book";
13
- })(TestIds || (TestIds = {}));
10
+ export const TestIds = {
11
+ bookingActionBook: 'booking-action-book',
12
+ };
14
13
  /**
15
14
  * Book action button component with AsChildSlot pattern.
16
15
  *
@@ -73,10 +72,10 @@ export const Book = React.forwardRef((props, ref) => {
73
72
  await coreBookProps.onClick();
74
73
  onClick?.(coreBookProps);
75
74
  };
76
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, onClick: handleClick, disabled: coreBookProps.disabled, "data-testid": TestIds.bookingActionBook, "data-in-progress": coreBookProps.isLoading, "data-can-book": coreBookProps.canBook, customElement: children, customElementProps: {
75
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, disabled: coreBookProps.disabled, "data-testid": TestIds.bookingActionBook, "data-in-progress": coreBookProps.isLoading, "data-can-book": coreBookProps.canBook, customElement: children, customElementProps: {
77
76
  ...coreBookProps,
78
77
  onClick: handleClick,
79
- }, children: _jsx("button", { children: coreBookProps.isLoading
78
+ }, children: _jsx("button", { onClick: handleClick, children: coreBookProps.isLoading
80
79
  ? loadingState
81
80
  : children || label }) }));
82
81
  } }));
@@ -6,6 +6,16 @@ import React from 'react';
6
6
  import * as CoreBooking from '../core/booking/Booking.js';
7
7
  import type { BookingServiceConfig } from '../../services/booking/booking.js';
8
8
  export type { BookingData, DataProps, BookingItem, } from '../core/booking/Booking.js';
9
+ export declare const TestIds: {
10
+ readonly bookingItemsRoot: "booking-items-root";
11
+ readonly bookingItems: "booking-items";
12
+ readonly bookingItem: "booking-item";
13
+ readonly bookingItemService: "booking-item-service";
14
+ readonly bookingItemTimeSlot: "booking-item-time-slot";
15
+ readonly bookingItemPayment: "booking-item-payment";
16
+ readonly bookingLocation: "booking-location";
17
+ readonly bookingStaffName: "booking-staff-name";
18
+ };
9
19
  /**
10
20
  * Props for Booking.Root component
11
21
  */
@@ -12,17 +12,16 @@ import { GenericList } from '@wix/headless-components/react';
12
12
  // ============================================================================
13
13
  // TestIds
14
14
  // ============================================================================
15
- var TestIds;
16
- (function (TestIds) {
17
- TestIds["bookingItemsRoot"] = "booking-items-root";
18
- TestIds["bookingItems"] = "booking-items";
19
- TestIds["bookingItem"] = "booking-item";
20
- TestIds["bookingItemService"] = "booking-item-service";
21
- TestIds["bookingItemTimeSlot"] = "booking-item-time-slot";
22
- TestIds["bookingItemPayment"] = "booking-item-payment";
23
- TestIds["bookingLocation"] = "booking-location";
24
- TestIds["bookingStaffName"] = "booking-staff-name";
25
- })(TestIds || (TestIds = {}));
15
+ export const TestIds = {
16
+ bookingItemsRoot: 'booking-items-root',
17
+ bookingItems: 'booking-items',
18
+ bookingItem: 'booking-item',
19
+ bookingItemService: 'booking-item-service',
20
+ bookingItemTimeSlot: 'booking-item-time-slot',
21
+ bookingItemPayment: 'booking-item-payment',
22
+ bookingLocation: 'booking-location',
23
+ bookingStaffName: 'booking-staff-name',
24
+ };
26
25
  /**
27
26
  * Root component that provides booking context to the entire app.
28
27
  *
@@ -4,6 +4,11 @@
4
4
  */
5
5
  import React from 'react';
6
6
  import { type AsChildChildren } from '@wix/headless-utils/react';
7
+ export declare const TestIds: {
8
+ readonly bookingItemService: "booking-item-service";
9
+ readonly bookingItemTimeSlot: "booking-item-time-slot";
10
+ readonly bookingItemStaffName: "booking-item-staff-name";
11
+ };
7
12
  export interface ServiceProps {
8
13
  children: React.ReactNode;
9
14
  }
@@ -8,12 +8,11 @@ import * as CoreBooking from '../core/booking/Booking.js';
8
8
  import { AsChildSlot } from '@wix/headless-utils/react';
9
9
  import * as ServiceComponent from '../service/Service.js';
10
10
  import * as TimeSlotComponent from '../time-slot-list/TimeSlot.js';
11
- var TestIds;
12
- (function (TestIds) {
13
- TestIds["bookingItemService"] = "booking-item-service";
14
- TestIds["bookingItemTimeSlot"] = "booking-item-time-slot";
15
- TestIds["bookingItemStaffName"] = "booking-item-staff-name";
16
- })(TestIds || (TestIds = {}));
11
+ export const TestIds = {
12
+ bookingItemService: 'booking-item-service',
13
+ bookingItemTimeSlot: 'booking-item-time-slot',
14
+ bookingItemStaffName: 'booking-item-staff-name',
15
+ };
17
16
  /**
18
17
  * Wraps Service.Root with the service from the current booking item context.
19
18
  * Must be used within Booking.BookingItemRepeater.
@@ -6,6 +6,11 @@ import React from 'react';
6
6
  import { Form } from '@wix/headless-forms/react';
7
7
  import * as CoreBookingForm from '../core/booking-form/BookingForm.js';
8
8
  type FieldMap = Parameters<typeof Form.Fields>[0]['fieldMap'];
9
+ export declare const TestIds: {
10
+ readonly bookingFormRoot: "booking-form-root";
11
+ readonly bookingFormFields: "booking-form-fields";
12
+ readonly bookingFormActionValidateFormSubmission: "booking-form-action-validate-form-submission";
13
+ };
9
14
  /**
10
15
  * Props for BookingForm.Root component
11
16
  */
@@ -40,12 +40,11 @@ class BookingFormErrorBoundary extends React.Component {
40
40
  return children;
41
41
  }
42
42
  }
43
- var TestIds;
44
- (function (TestIds) {
45
- TestIds["bookingFormRoot"] = "booking-form-root";
46
- TestIds["bookingFormFields"] = "booking-form-fields";
47
- TestIds["bookingFormActionValidateFormSubmission"] = "booking-form-action-validate-form-submission";
48
- })(TestIds || (TestIds = {}));
43
+ export const TestIds = {
44
+ bookingFormRoot: 'booking-form-root',
45
+ bookingFormFields: 'booking-form-fields',
46
+ bookingFormActionValidateFormSubmission: 'booking-form-action-validate-form-submission',
47
+ };
49
48
  /**
50
49
  * Root component for booking form that wraps CoreBookingForm.Root.
51
50
  * Automatically loads form and handles submission in standalone mode.
@@ -184,11 +183,11 @@ export const ValidateFormSubmission = React.forwardRef((props, ref) => {
184
183
  }
185
184
  onClick?.(result);
186
185
  };
187
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, onClick: handleClick, "data-testid": TestIds.bookingFormActionValidateFormSubmission, "data-valid": valid, customElement: children, customElementProps: {
186
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, "data-testid": TestIds.bookingFormActionValidateFormSubmission, "data-valid": valid, customElement: children, customElementProps: {
188
187
  onClick: handleClick,
189
188
  valid,
190
189
  validationFailures,
191
- }, children: _jsx("button", { children: children || label }) }));
190
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
192
191
  } }));
193
192
  });
194
193
  ValidateFormSubmission.displayName =
@@ -8,8 +8,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { createContext, useContext } from 'react';
9
9
  import { useService } from '@wix/services-manager-react';
10
10
  import { BookingServiceDefinition } from '../../../services/booking/booking.js';
11
- /** Resource type ID for staff members */
12
- const STAFF_MEMBER_RESOURCE_TYPE_ID = '1cd44cf8-756f-41c3-bd90-3e2ffcaf1155';
11
+ import { STAFF_MEMBER_RESOURCE_TYPE_ID } from '../../../services/constants.js';
13
12
  // ==========================================
14
13
  // Context
15
14
  // ==========================================
@@ -71,6 +71,8 @@ export interface ActionsRenderProps {
71
71
  select: (staffMember: StaffMemberData) => void;
72
72
  /** Currently selected staff member */
73
73
  selectedStaffMember: StaffMemberData | null;
74
+ /** Clear the staff member resource from BookingService */
75
+ clear: () => void;
74
76
  }
75
77
  /**
76
78
  * Props for Actions render prop component
@@ -2,6 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { WixServices, useService } from '@wix/services-manager-react';
3
3
  import { createServicesMap } from '@wix/services-manager';
4
4
  import { StaffMemberListServiceDefinition, StaffMemberListService, } from '../../../services/staff-member-list/staff-member-list.js';
5
+ import { BookingServiceDefinition } from '../../../services/booking/booking.js';
6
+ import { STAFF_MEMBER_RESOURCE_TYPE_ID } from '../../../services/constants.js';
5
7
  /**
6
8
  * Root component that provides StaffMemberList service context
7
9
  *
@@ -59,8 +61,17 @@ export function StaffMembers(props) {
59
61
  */
60
62
  export function Actions(props) {
61
63
  const service = useService(StaffMemberListServiceDefinition);
64
+ let bookingService = null;
65
+ try {
66
+ bookingService = useService(BookingServiceDefinition);
67
+ }
68
+ catch { }
69
+ const clear = () => {
70
+ bookingService?.actions.clearResourceByType(STAFF_MEMBER_RESOURCE_TYPE_ID);
71
+ };
62
72
  return props.children({
63
73
  select: service.actions.select,
64
74
  selectedStaffMember: service.selectedStaffMember.get(),
75
+ clear,
65
76
  });
66
77
  }
@@ -9,6 +9,16 @@ import * as CoreLocation from '../core/location/Location.js';
9
9
  import { type AsChildChildren } from '@wix/headless-utils/react';
10
10
  import { LocationType } from '../../services/location-list/location-list.def.js';
11
11
  export { useLocationContext } from '../core/location/Location.js';
12
+ export declare const TestIds: {
13
+ readonly locationRoot: "location-root";
14
+ readonly locationName: "location-name";
15
+ readonly locationType: "location-type";
16
+ readonly locationAddress: "location-address";
17
+ readonly locationPhone: "location-phone";
18
+ readonly locationEmail: "location-email";
19
+ readonly locationRaw: "location-raw";
20
+ readonly locationActionSelect: "location-action-select";
21
+ };
12
22
  export type { AddressData, Location, LocationRenderProps, } from '../core/location/Location.js';
13
23
  /**
14
24
  * Props for Location.Root component
@@ -14,17 +14,16 @@ export { useLocationContext } from '../core/location/Location.js';
14
14
  // ==========================================
15
15
  // TestIds Enum
16
16
  // ==========================================
17
- var TestIds;
18
- (function (TestIds) {
19
- TestIds["locationRoot"] = "location-root";
20
- TestIds["locationName"] = "location-name";
21
- TestIds["locationType"] = "location-type";
22
- TestIds["locationAddress"] = "location-address";
23
- TestIds["locationPhone"] = "location-phone";
24
- TestIds["locationEmail"] = "location-email";
25
- TestIds["locationRaw"] = "location-raw";
26
- TestIds["locationActionSelect"] = "location-action-select";
27
- })(TestIds || (TestIds = {}));
17
+ export const TestIds = {
18
+ locationRoot: 'location-root',
19
+ locationName: 'location-name',
20
+ locationType: 'location-type',
21
+ locationAddress: 'location-address',
22
+ locationPhone: 'location-phone',
23
+ locationEmail: 'location-email',
24
+ locationRaw: 'location-raw',
25
+ locationActionSelect: 'location-action-select',
26
+ };
28
27
  // ==========================================
29
28
  // Type Definitions
30
29
  // ==========================================
@@ -252,11 +251,11 @@ const Select = React.forwardRef((props, ref) => {
252
251
  onClick?.(rawLocation);
253
252
  }
254
253
  };
255
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, "data-testid": TestIds.locationActionSelect, "data-selected": selected, customElement: children, customElementProps: {
254
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, "data-testid": TestIds.locationActionSelect, "data-selected": selected, customElement: children, customElementProps: {
256
255
  onClick: handleClick,
257
256
  selected,
258
257
  location: rawLocation,
259
- }, children: _jsx("button", { children: children || label }) }));
258
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
260
259
  } }));
261
260
  });
262
261
  Select.displayName = 'Location.Actions.Select';
@@ -9,6 +9,13 @@ import { GenericListRepeaterProps, type ListVariant } from '@wix/headless-compon
9
9
  import { type AsChildChildren } from '@wix/headless-utils/react';
10
10
  import type { LocationListServiceConfig } from '../../services/location-list/location-list.js';
11
11
  import { type Location } from '../../services/location-list/location-list.def.js';
12
+ export declare const TestIds: {
13
+ readonly locationListRoot: "location-list-root";
14
+ readonly locationListLocations: "location-list-locations";
15
+ readonly locationListLocation: "location-list-location";
16
+ readonly locationListActionClear: "location-list-action-clear";
17
+ readonly locationListTotals: "location-list-totals";
18
+ };
12
19
  /**
13
20
  * Props for the LocationList root component
14
21
  */
@@ -37,14 +37,13 @@ function getLocationType(location) {
37
37
  // ============================================================================
38
38
  // TestIds
39
39
  // ============================================================================
40
- var TestIds;
41
- (function (TestIds) {
42
- TestIds["locationListRoot"] = "location-list-root";
43
- TestIds["locationListLocations"] = "location-list-locations";
44
- TestIds["locationListLocation"] = "location-list-location";
45
- TestIds["locationListActionClear"] = "location-list-action-clear";
46
- TestIds["locationListTotals"] = "location-list-totals";
47
- })(TestIds || (TestIds = {}));
40
+ export const TestIds = {
41
+ locationListRoot: 'location-list-root',
42
+ locationListLocations: 'location-list-locations',
43
+ locationListLocation: 'location-list-location',
44
+ locationListActionClear: 'location-list-action-clear',
45
+ locationListTotals: 'location-list-totals',
46
+ };
48
47
  /**
49
48
  * Root component that provides the LocationList service context for rendering locations lists.
50
49
  *
@@ -184,9 +183,9 @@ const Clear = React.forwardRef((props, ref) => {
184
183
  bookingService?.actions.clearLocation();
185
184
  onClick?.(selectedLocation);
186
185
  };
187
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, "data-testid": TestIds.locationListActionClear, customElement: children, customElementProps: {
186
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, "data-testid": TestIds.locationListActionClear, customElement: children, customElementProps: {
188
187
  onClick: handleClick,
189
- }, children: _jsx("button", { children: children || label }) }));
188
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
190
189
  } }));
191
190
  });
192
191
  Clear.displayName = 'LocationList.Actions.Clear';
@@ -6,6 +6,20 @@ import React from 'react';
6
6
  import { AsChildChildren } from '@wix/headless-utils/react';
7
7
  import { MoneyData } from '@wix/headless-components/react';
8
8
  import type { PaymentServiceConfig, PricingServiceSelection } from '../../services/payment/payment.js';
9
+ export declare const TestIds: {
10
+ readonly paymentRoot: "payment-root";
11
+ readonly paymentSubtotal: "payment-subtotal";
12
+ readonly paymentTax: "payment-tax";
13
+ readonly paymentTotal: "payment-total";
14
+ readonly paymentPayNow: "payment-pay-now";
15
+ readonly paymentPayLater: "payment-pay-later";
16
+ readonly paymentLineItems: "payment-line-items";
17
+ readonly paymentLineItemsList: "payment-line-items-list";
18
+ readonly paymentLineItemRepeater: "payment-line-item-repeater";
19
+ readonly paymentLineItemTotal: "payment-line-item-total";
20
+ readonly paymentLineItemSubtotal: "payment-line-item-subtotal";
21
+ readonly paymentLineItemDeposit: "payment-line-item-deposit";
22
+ };
9
23
  /**
10
24
  * Props for Payment.Root component
11
25
  */
@@ -7,21 +7,20 @@ import React from 'react';
7
7
  import * as CorePayment from '../core/payment/Payment.js';
8
8
  import { AsChildSlot } from '@wix/headless-utils/react';
9
9
  import { Money, GenericList } from '@wix/headless-components/react';
10
- var TestIds;
11
- (function (TestIds) {
12
- TestIds["paymentRoot"] = "payment-root";
13
- TestIds["paymentSubtotal"] = "payment-subtotal";
14
- TestIds["paymentTax"] = "payment-tax";
15
- TestIds["paymentTotal"] = "payment-total";
16
- TestIds["paymentPayNow"] = "payment-pay-now";
17
- TestIds["paymentPayLater"] = "payment-pay-later";
18
- TestIds["paymentLineItems"] = "payment-line-items";
19
- TestIds["paymentLineItemsList"] = "payment-line-items-list";
20
- TestIds["paymentLineItemRepeater"] = "payment-line-item-repeater";
21
- TestIds["paymentLineItemTotal"] = "payment-line-item-total";
22
- TestIds["paymentLineItemSubtotal"] = "payment-line-item-subtotal";
23
- TestIds["paymentLineItemDeposit"] = "payment-line-item-deposit";
24
- })(TestIds || (TestIds = {}));
10
+ export const TestIds = {
11
+ paymentRoot: 'payment-root',
12
+ paymentSubtotal: 'payment-subtotal',
13
+ paymentTax: 'payment-tax',
14
+ paymentTotal: 'payment-total',
15
+ paymentPayNow: 'payment-pay-now',
16
+ paymentPayLater: 'payment-pay-later',
17
+ paymentLineItems: 'payment-line-items',
18
+ paymentLineItemsList: 'payment-line-items-list',
19
+ paymentLineItemRepeater: 'payment-line-item-repeater',
20
+ paymentLineItemTotal: 'payment-line-item-total',
21
+ paymentLineItemSubtotal: 'payment-line-item-subtotal',
22
+ paymentLineItemDeposit: 'payment-line-item-deposit',
23
+ };
25
24
  /**
26
25
  * Root component that provides payment context to the entire app.
27
26
  * Supports 3 modes:
@@ -7,6 +7,39 @@ import { AsChildChildren } from '@wix/headless-utils/react';
7
7
  import { MoneyData } from '@wix/headless-components/react';
8
8
  import { type Service, type Payment } from '@wix/auto_sdk_bookings_services';
9
9
  import * as ServiceMediaModule from './ServiceMedia.js';
10
+ export declare const TestIds: {
11
+ readonly serviceRoot: "service-root";
12
+ readonly serviceName: "service-name";
13
+ readonly serviceDescription: "service-description";
14
+ readonly servicePrice: "service-price";
15
+ readonly serviceTagline: "service-tagline";
16
+ readonly serviceDurationInMinutes: "service-duration-in-minutes";
17
+ readonly serviceType: "service-type";
18
+ readonly serviceCategory: "service-category";
19
+ readonly serviceLocations: "service-locations";
20
+ readonly serviceLocation: "service-location";
21
+ readonly serviceLocationRepeater: "service-location-repeater";
22
+ readonly locationRoot: "location-root";
23
+ readonly serviceStaffMembers: "service-staff-members";
24
+ readonly serviceStaffMemberRepeater: "service-staff-member-repeater";
25
+ readonly serviceSchedule: "service-schedule";
26
+ readonly serviceDefaultCapacity: "service-default-capacity";
27
+ readonly serviceRaw: "service-raw";
28
+ readonly serviceActionSelect: "service-action-select";
29
+ readonly serviceActionAdd: "service-action-add";
30
+ readonly serviceActionRemove: "service-action-remove";
31
+ readonly servicePolicyLatestCancellationInMinutes: "service-policy-latest-cancellation-in-minutes";
32
+ readonly servicePolicyLatestBookingInMinutes: "service-policy-latest-booking-in-minutes";
33
+ readonly servicePolicyEarliestBookingInMinutes: "service-policy-earliest-booking-in-minutes";
34
+ readonly servicePolicyLatestRescheduleInMinutes: "service-policy-latest-reschedule-in-minutes";
35
+ readonly servicePolicyWaitlistCapacity: "service-policy-waitlist-capacity";
36
+ readonly servicePolicyBookAfterStartEnabled: "service-policy-book-after-start-enabled";
37
+ readonly servicePolicyMaxParticipantsPerBooking: "service-policy-max-participants-per-booking";
38
+ readonly serviceScheduleFirstSessionStart: "service-schedule-first-session-start";
39
+ readonly serviceScheduleLastSessionEnd: "service-schedule-last-session-end";
40
+ readonly serviceScheduleSessionDuration: "service-schedule-session-duration";
41
+ readonly serviceAvailableOnline: "service-available-online";
42
+ };
10
43
  /**
11
44
  * Base props shared by all Service.Root variants
12
45
  */
@@ -17,43 +17,42 @@ import * as StaffMemberListModule from '../staff-member/StaffMemberList.js';
17
17
  // Note: StaffMember components are used inside StaffMemberList.StaffMemberRepeater
18
18
  // Users should import { StaffMember } from '@wix/headless-bookings/react' for StaffMember.Name, etc.
19
19
  import * as ServiceMediaModule from './ServiceMedia.js';
20
- var TestIds;
21
- (function (TestIds) {
22
- TestIds["serviceRoot"] = "service-root";
23
- TestIds["serviceName"] = "service-name";
24
- TestIds["serviceDescription"] = "service-description";
25
- TestIds["servicePrice"] = "service-price";
26
- TestIds["serviceTagline"] = "service-tagline";
27
- TestIds["serviceDurationInMinutes"] = "service-duration-in-minutes";
28
- TestIds["serviceType"] = "service-type";
29
- TestIds["serviceCategory"] = "service-category";
30
- TestIds["serviceLocations"] = "service-locations";
31
- TestIds["serviceLocation"] = "service-location";
32
- TestIds["serviceLocationRepeater"] = "service-location-repeater";
33
- TestIds["locationRoot"] = "location-root";
34
- TestIds["serviceStaffMembers"] = "service-staff-members";
35
- TestIds["serviceStaffMemberRepeater"] = "service-staff-member-repeater";
36
- TestIds["serviceSchedule"] = "service-schedule";
37
- TestIds["serviceDefaultCapacity"] = "service-default-capacity";
38
- TestIds["serviceRaw"] = "service-raw";
39
- TestIds["serviceActionSelect"] = "service-action-select";
40
- TestIds["serviceActionAdd"] = "service-action-add";
41
- TestIds["serviceActionRemove"] = "service-action-remove";
20
+ export const TestIds = {
21
+ serviceRoot: 'service-root',
22
+ serviceName: 'service-name',
23
+ serviceDescription: 'service-description',
24
+ servicePrice: 'service-price',
25
+ serviceTagline: 'service-tagline',
26
+ serviceDurationInMinutes: 'service-duration-in-minutes',
27
+ serviceType: 'service-type',
28
+ serviceCategory: 'service-category',
29
+ serviceLocations: 'service-locations',
30
+ serviceLocation: 'service-location',
31
+ serviceLocationRepeater: 'service-location-repeater',
32
+ locationRoot: 'location-root',
33
+ serviceStaffMembers: 'service-staff-members',
34
+ serviceStaffMemberRepeater: 'service-staff-member-repeater',
35
+ serviceSchedule: 'service-schedule',
36
+ serviceDefaultCapacity: 'service-default-capacity',
37
+ serviceRaw: 'service-raw',
38
+ serviceActionSelect: 'service-action-select',
39
+ serviceActionAdd: 'service-action-add',
40
+ serviceActionRemove: 'service-action-remove',
42
41
  // Policy component TestIds
43
- TestIds["servicePolicyLatestCancellationInMinutes"] = "service-policy-latest-cancellation-in-minutes";
44
- TestIds["servicePolicyLatestBookingInMinutes"] = "service-policy-latest-booking-in-minutes";
45
- TestIds["servicePolicyEarliestBookingInMinutes"] = "service-policy-earliest-booking-in-minutes";
46
- TestIds["servicePolicyLatestRescheduleInMinutes"] = "service-policy-latest-reschedule-in-minutes";
47
- TestIds["servicePolicyWaitlistCapacity"] = "service-policy-waitlist-capacity";
48
- TestIds["servicePolicyBookAfterStartEnabled"] = "service-policy-book-after-start-enabled";
49
- TestIds["servicePolicyMaxParticipantsPerBooking"] = "service-policy-max-participants-per-booking";
42
+ servicePolicyLatestCancellationInMinutes: 'service-policy-latest-cancellation-in-minutes',
43
+ servicePolicyLatestBookingInMinutes: 'service-policy-latest-booking-in-minutes',
44
+ servicePolicyEarliestBookingInMinutes: 'service-policy-earliest-booking-in-minutes',
45
+ servicePolicyLatestRescheduleInMinutes: 'service-policy-latest-reschedule-in-minutes',
46
+ servicePolicyWaitlistCapacity: 'service-policy-waitlist-capacity',
47
+ servicePolicyBookAfterStartEnabled: 'service-policy-book-after-start-enabled',
48
+ servicePolicyMaxParticipantsPerBooking: 'service-policy-max-participants-per-booking',
50
49
  // Schedule component TestIds
51
- TestIds["serviceScheduleFirstSessionStart"] = "service-schedule-first-session-start";
52
- TestIds["serviceScheduleLastSessionEnd"] = "service-schedule-last-session-end";
53
- TestIds["serviceScheduleSessionDuration"] = "service-schedule-session-duration";
50
+ serviceScheduleFirstSessionStart: 'service-schedule-first-session-start',
51
+ serviceScheduleLastSessionEnd: 'service-schedule-last-session-end',
52
+ serviceScheduleSessionDuration: 'service-schedule-session-duration',
54
53
  // Conferencing component TestIds
55
- TestIds["serviceAvailableOnline"] = "service-available-online";
56
- })(TestIds || (TestIds = {}));
54
+ serviceAvailableOnline: 'service-available-online',
55
+ };
57
56
  /**
58
57
  * Root component that provides service context to the entire app.
59
58
  * Can be used with:
@@ -624,14 +623,14 @@ export var Actions;
624
623
  select();
625
624
  onClick?.(rawService);
626
625
  };
627
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, disabled: !bookable, "data-testid": TestIds.serviceActionSelect, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
626
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, disabled: !bookable, "data-testid": TestIds.serviceActionSelect, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
628
627
  onClick: handleClick,
629
628
  disabled: !bookable,
630
629
  selected,
631
630
  bookable,
632
631
  requiresAvailability,
633
632
  service: rawService,
634
- }, children: _jsx("button", { children: children || label }) }));
633
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
635
634
  } }));
636
635
  });
637
636
  Actions.Select.displayName = 'Service.Actions.Select';
@@ -673,14 +672,14 @@ export var Actions;
673
672
  add();
674
673
  onClick?.(rawService);
675
674
  };
676
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, disabled: isDisabled, "data-testid": TestIds.serviceActionAdd, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
675
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, disabled: isDisabled, "data-testid": TestIds.serviceActionAdd, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
677
676
  onClick: handleClick,
678
677
  disabled: isDisabled,
679
678
  selected,
680
679
  bookable,
681
680
  requiresAvailability,
682
681
  service: rawService,
683
- }, children: _jsx("button", { children: children || label }) }));
682
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
684
683
  } }));
685
684
  });
686
685
  Actions.Add.displayName = 'Service.Actions.Add';
@@ -722,14 +721,14 @@ export var Actions;
722
721
  remove();
723
722
  onClick?.(rawService);
724
723
  };
725
- return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, onClick: handleClick, disabled: isDisabled, "data-testid": TestIds.serviceActionRemove, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
724
+ return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, disabled: isDisabled, "data-testid": TestIds.serviceActionRemove, "data-selected": selected, "data-bookable": bookable, "data-requires-availability": requiresAvailability, customElement: children, customElementProps: {
726
725
  onClick: handleClick,
727
726
  disabled: isDisabled,
728
727
  selected,
729
728
  bookable,
730
729
  requiresAvailability,
731
730
  service: rawService,
732
- }, children: _jsx("button", { children: children || label }) }));
731
+ }, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
733
732
  } }));
734
733
  });
735
734
  Actions.Remove.displayName = 'Service.Actions.Remove';