@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.
- package/cjs/dist/__mocks__/services.d.ts +0 -4
- package/cjs/dist/__mocks__/services.js +1 -4
- package/cjs/dist/api/fetch-availability/index.js +3 -3
- package/cjs/dist/api/query-services/index.js +1 -4
- package/cjs/dist/react/booking/Book.d.ts +3 -0
- package/cjs/dist/react/booking/Book.js +5 -6
- package/cjs/dist/react/booking/Booking.d.ts +10 -0
- package/cjs/dist/react/booking/Booking.js +10 -11
- package/cjs/dist/react/booking/BookingItem.d.ts +5 -0
- package/cjs/dist/react/booking/BookingItem.js +5 -6
- package/cjs/dist/react/booking-form/BookingForm.d.ts +5 -0
- package/cjs/dist/react/booking-form/BookingForm.js +7 -8
- package/cjs/dist/react/core/staff-member/StaffMember.js +1 -2
- package/cjs/dist/react/core/staff-member-list/StaffMemberList.d.ts +2 -0
- package/cjs/dist/react/core/staff-member-list/StaffMemberList.js +11 -0
- package/cjs/dist/react/location/Location.d.ts +10 -0
- package/cjs/dist/react/location/Location.js +12 -13
- package/cjs/dist/react/location/LocationList.d.ts +7 -0
- package/cjs/dist/react/location/LocationList.js +9 -10
- package/cjs/dist/react/payment/Payment.d.ts +14 -0
- package/cjs/dist/react/payment/Payment.js +14 -15
- package/cjs/dist/react/service/Service.d.ts +33 -0
- package/cjs/dist/react/service/Service.js +39 -40
- package/cjs/dist/react/service/ServiceMedia.d.ts +4 -0
- package/cjs/dist/react/service/ServiceMedia.js +4 -5
- package/cjs/dist/react/service-list/ServiceList.d.ts +7 -0
- package/cjs/dist/react/service-list/ServiceList.js +7 -8
- package/cjs/dist/react/staff-member/StaffMember.d.ts +6 -6
- package/cjs/dist/react/staff-member/StaffMember.js +8 -9
- package/cjs/dist/react/staff-member/StaffMemberList.d.ts +8 -7
- package/cjs/dist/react/staff-member/StaffMemberList.js +11 -22
- package/cjs/dist/react/time-slot-list/TimeSlot.d.ts +12 -12
- package/cjs/dist/react/time-slot-list/TimeSlot.js +18 -19
- package/cjs/dist/react/time-slot-list/TimeSlotList.d.ts +9 -9
- package/cjs/dist/react/time-slot-list/TimeSlotList.js +9 -10
- package/cjs/dist/services/booking/book-action/buildBookingRequest.js +1 -2
- package/cjs/dist/services/booking/book-action/buildCheckoutRequest.js +2 -2
- package/cjs/dist/services/constants.d.ts +9 -0
- package/cjs/dist/services/constants.js +9 -0
- package/cjs/dist/services/payment/payment.js +2 -5
- package/cjs/dist/services/service/service.js +1 -1
- package/cjs/dist/services/service-list/service-list.js +1 -4
- package/dist/__mocks__/services.d.ts +0 -4
- package/dist/__mocks__/services.js +1 -4
- package/dist/api/fetch-availability/index.js +3 -3
- package/dist/api/query-services/index.js +1 -4
- package/dist/react/booking/Book.d.ts +3 -0
- package/dist/react/booking/Book.js +5 -6
- package/dist/react/booking/Booking.d.ts +10 -0
- package/dist/react/booking/Booking.js +10 -11
- package/dist/react/booking/BookingItem.d.ts +5 -0
- package/dist/react/booking/BookingItem.js +5 -6
- package/dist/react/booking-form/BookingForm.d.ts +5 -0
- package/dist/react/booking-form/BookingForm.js +7 -8
- package/dist/react/core/staff-member/StaffMember.js +1 -2
- package/dist/react/core/staff-member-list/StaffMemberList.d.ts +2 -0
- package/dist/react/core/staff-member-list/StaffMemberList.js +11 -0
- package/dist/react/location/Location.d.ts +10 -0
- package/dist/react/location/Location.js +12 -13
- package/dist/react/location/LocationList.d.ts +7 -0
- package/dist/react/location/LocationList.js +9 -10
- package/dist/react/payment/Payment.d.ts +14 -0
- package/dist/react/payment/Payment.js +14 -15
- package/dist/react/service/Service.d.ts +33 -0
- package/dist/react/service/Service.js +39 -40
- package/dist/react/service/ServiceMedia.d.ts +4 -0
- package/dist/react/service/ServiceMedia.js +4 -5
- package/dist/react/service-list/ServiceList.d.ts +7 -0
- package/dist/react/service-list/ServiceList.js +7 -8
- package/dist/react/staff-member/StaffMember.d.ts +6 -6
- package/dist/react/staff-member/StaffMember.js +8 -9
- package/dist/react/staff-member/StaffMemberList.d.ts +8 -7
- package/dist/react/staff-member/StaffMemberList.js +11 -22
- package/dist/react/time-slot-list/TimeSlot.d.ts +12 -12
- package/dist/react/time-slot-list/TimeSlot.js +18 -19
- package/dist/react/time-slot-list/TimeSlotList.d.ts +9 -9
- package/dist/react/time-slot-list/TimeSlotList.js +9 -10
- package/dist/services/booking/book-action/buildBookingRequest.js +1 -2
- package/dist/services/booking/book-action/buildCheckoutRequest.js +2 -2
- package/dist/services/constants.d.ts +9 -0
- package/dist/services/constants.js +9 -0
- package/dist/services/payment/payment.js +2 -5
- package/dist/services/service/service.js +1 -1
- package/dist/services/service-list/service-list.js +1 -4
- package/package.json +2 -2
|
@@ -7,10 +7,6 @@ import type { ServiceListServiceConfig } from '../services/service-list/service-
|
|
|
7
7
|
import type { StaffMemberListServiceConfig } from '../services/staff-member-list/staff-member-list.js';
|
|
8
8
|
import type { PagingMetadata } from '../api/query-services/index.js';
|
|
9
9
|
import type { Category } from '../api/query-categories/index.js';
|
|
10
|
-
/**
|
|
11
|
-
* Booking app ID constant
|
|
12
|
-
*/
|
|
13
|
-
export declare const BOOKING_APP_ID = "13d21c63-b5ec-5912-8397-c3a5ddb27a97";
|
|
14
10
|
/**
|
|
15
11
|
* Base mock service with all fields populated (APPOINTMENT type, FIXED pricing)
|
|
16
12
|
*/
|
|
@@ -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:
|
|
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
|
-
: [
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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,
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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,
|
|
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
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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,
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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,
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
*/
|