@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
|
@@ -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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
56
|
-
}
|
|
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,
|
|
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,
|
|
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,
|
|
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';
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { AsChildChildren } from '@wix/headless-utils/react';
|
|
7
|
+
export declare const TestIds: {
|
|
8
|
+
readonly serviceMediaMain: "service-media-main";
|
|
9
|
+
readonly serviceMediaCover: "service-media-cover";
|
|
10
|
+
};
|
|
7
11
|
/**
|
|
8
12
|
* Props for ServiceMedia.Main component
|
|
9
13
|
*/
|
|
@@ -8,11 +8,10 @@ import { AsChildSlot } from '@wix/headless-utils/react';
|
|
|
8
8
|
import { WixMediaImage } from '@wix/headless-media/react';
|
|
9
9
|
import * as CoreServiceMediaMain from '../core/service/ServiceMediaMain.js';
|
|
10
10
|
import * as CoreServiceMediaCover from '../core/service/ServiceMediaCover.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})(TestIds || (TestIds = {}));
|
|
11
|
+
export const TestIds = {
|
|
12
|
+
serviceMediaMain: 'service-media-main',
|
|
13
|
+
serviceMediaCover: 'service-media-cover',
|
|
14
|
+
};
|
|
16
15
|
/**
|
|
17
16
|
* Displays the service main media image using WixMediaImage.
|
|
18
17
|
*
|
|
@@ -7,6 +7,13 @@ import { ListVariant, GenericListLoadMoreRenderProps, type FilterRootProps } fro
|
|
|
7
7
|
import { AsChildChildren } from '@wix/headless-utils/react';
|
|
8
8
|
import type { ServiceListServiceConfig } from '../../services/service-list/service-list.js';
|
|
9
9
|
import type { Service as ServiceType } from '@wix/auto_sdk_bookings_services';
|
|
10
|
+
export declare const TestIds: {
|
|
11
|
+
readonly serviceListRoot: "service-list-root";
|
|
12
|
+
readonly serviceListServices: "service-list-services";
|
|
13
|
+
readonly serviceListService: "service-list-service";
|
|
14
|
+
readonly serviceListLoadMore: "service-list-load-more";
|
|
15
|
+
readonly serviceListFilter: "service-list-filter";
|
|
16
|
+
};
|
|
10
17
|
/**
|
|
11
18
|
* Props for the ServiceList root component
|
|
12
19
|
*/
|
|
@@ -10,14 +10,13 @@ import { ServiceListServiceDefinition } from '../../services/service-list/servic
|
|
|
10
10
|
import * as CoreServiceList from '../core/service-list/ServiceList.js';
|
|
11
11
|
import * as CoreServiceListFilter from '../core/service-list/ServiceListFilter.js';
|
|
12
12
|
import * as Service from '../service/Service.js';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})(TestIds || (TestIds = {}));
|
|
13
|
+
export const TestIds = {
|
|
14
|
+
serviceListRoot: 'service-list-root',
|
|
15
|
+
serviceListServices: 'service-list-services',
|
|
16
|
+
serviceListService: 'service-list-service',
|
|
17
|
+
serviceListLoadMore: 'service-list-load-more',
|
|
18
|
+
serviceListFilter: 'service-list-filter',
|
|
19
|
+
};
|
|
21
20
|
/**
|
|
22
21
|
* Root component that provides the ServiceList service context for rendering services lists.
|
|
23
22
|
*
|
|
@@ -8,12 +8,12 @@ import React from 'react';
|
|
|
8
8
|
import * as CoreStaffMember from '../core/staff-member/StaffMember.js';
|
|
9
9
|
import { type AsChildChildren } from '@wix/headless-utils/react';
|
|
10
10
|
export { useStaffMemberContext } from '../core/staff-member/StaffMember.js';
|
|
11
|
-
export declare
|
|
12
|
-
staffMemberRoot
|
|
13
|
-
staffMemberName
|
|
14
|
-
staffMemberRaw
|
|
15
|
-
staffMemberActionSelect
|
|
16
|
-
}
|
|
11
|
+
export declare const TestIds: {
|
|
12
|
+
readonly staffMemberRoot: "staff-member-root";
|
|
13
|
+
readonly staffMemberName: "staff-member-name";
|
|
14
|
+
readonly staffMemberRaw: "staff-member-raw";
|
|
15
|
+
readonly staffMemberActionSelect: "staff-member-action-select";
|
|
16
|
+
};
|
|
17
17
|
export type { StaffMemberData, StaffMemberRenderProps, } from '../core/staff-member/StaffMember.js';
|
|
18
18
|
/**
|
|
19
19
|
* Props for StaffMember.Root component
|
|
@@ -13,13 +13,12 @@ export { useStaffMemberContext } from '../core/staff-member/StaffMember.js';
|
|
|
13
13
|
// ==========================================
|
|
14
14
|
// TestIds Enum
|
|
15
15
|
// ==========================================
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})(TestIds || (TestIds = {}));
|
|
16
|
+
export const TestIds = {
|
|
17
|
+
staffMemberRoot: 'staff-member-root',
|
|
18
|
+
staffMemberName: 'staff-member-name',
|
|
19
|
+
staffMemberRaw: 'staff-member-raw',
|
|
20
|
+
staffMemberActionSelect: 'staff-member-action-select',
|
|
21
|
+
};
|
|
23
22
|
// ==========================================
|
|
24
23
|
// Type Definitions
|
|
25
24
|
// ==========================================
|
|
@@ -131,11 +130,11 @@ const Select = React.forwardRef((props, ref) => {
|
|
|
131
130
|
onClick?.(rawStaffMember);
|
|
132
131
|
}
|
|
133
132
|
};
|
|
134
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className,
|
|
133
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, "data-testid": TestIds.staffMemberActionSelect, "data-selected": selected, customElement: children, customElementProps: {
|
|
135
134
|
onClick: handleClick,
|
|
136
135
|
selected,
|
|
137
136
|
staffMember: rawStaffMember,
|
|
138
|
-
}, children: _jsx("button", { children: children || label }) }));
|
|
137
|
+
}, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
|
|
139
138
|
} }));
|
|
140
139
|
});
|
|
141
140
|
Select.displayName = 'StaffMember.Actions.Select';
|
|
@@ -9,13 +9,14 @@ import { GenericListRepeaterProps, type ListVariant } from '@wix/headless-compon
|
|
|
9
9
|
import { type AsChildChildren } from '@wix/headless-utils/react';
|
|
10
10
|
import type { StaffMemberListServiceConfig } from '../../services/staff-member-list/staff-member-list.js';
|
|
11
11
|
import type { StaffMemberData } from '../../services/staff-member-list/staff-member-list.def.js';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
/** Resource type ID for staff members */
|
|
13
|
+
export declare const TestIds: {
|
|
14
|
+
readonly staffMemberListRoot: "staff-member-list-root";
|
|
15
|
+
readonly staffMemberListStaffMembers: "staff-member-list-staff-members";
|
|
16
|
+
readonly staffMemberListStaffMember: "staff-member-list-staff-member";
|
|
17
|
+
readonly staffMemberListActionClear: "staff-member-list-action-clear";
|
|
18
|
+
readonly staffMemberListTotals: "staff-member-list-totals";
|
|
19
|
+
};
|
|
19
20
|
/**
|
|
20
21
|
* Props for the StaffMemberList root component
|
|
21
22
|
*/
|
|
@@ -8,23 +8,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { GenericList, } from '@wix/headless-components/react';
|
|
10
10
|
import { AsChildSlot } from '@wix/headless-utils/react';
|
|
11
|
-
import { useService } from '@wix/services-manager-react';
|
|
12
|
-
import { BookingServiceDefinition } from '../../services/booking/booking.js';
|
|
13
11
|
import * as CoreStaffMemberList from '../core/staff-member-list/StaffMemberList.js';
|
|
14
12
|
import * as StaffMember from './StaffMember.js';
|
|
15
13
|
/** Resource type ID for staff members */
|
|
16
|
-
const STAFF_MEMBER_RESOURCE_TYPE_ID = '1cd44cf8-756f-41c3-bd90-3e2ffcaf1155';
|
|
17
14
|
// ============================================================================
|
|
18
15
|
// TestIds
|
|
19
16
|
// ============================================================================
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})(TestIds || (TestIds = {}));
|
|
17
|
+
export const TestIds = {
|
|
18
|
+
staffMemberListRoot: 'staff-member-list-root',
|
|
19
|
+
staffMemberListStaffMembers: 'staff-member-list-staff-members',
|
|
20
|
+
staffMemberListStaffMember: 'staff-member-list-staff-member',
|
|
21
|
+
staffMemberListActionClear: 'staff-member-list-action-clear',
|
|
22
|
+
staffMemberListTotals: 'staff-member-list-totals',
|
|
23
|
+
};
|
|
28
24
|
/**
|
|
29
25
|
* Root component that provides the StaffMemberList service context for rendering staff member lists.
|
|
30
26
|
*
|
|
@@ -149,21 +145,14 @@ Totals.displayName = 'StaffMemberList.Totals';
|
|
|
149
145
|
*/
|
|
150
146
|
const Clear = React.forwardRef((props, ref) => {
|
|
151
147
|
const { asChild, children, className, label, onClick, ...rest } = props;
|
|
152
|
-
return (_jsx(CoreStaffMemberList.Actions, { children: ({ selectedStaffMember }) => {
|
|
153
|
-
let bookingService = null;
|
|
154
|
-
try {
|
|
155
|
-
bookingService = useService(BookingServiceDefinition);
|
|
156
|
-
}
|
|
157
|
-
catch {
|
|
158
|
-
// BookingService not available - likely no ServiceManagerProvider
|
|
159
|
-
}
|
|
148
|
+
return (_jsx(CoreStaffMemberList.Actions, { children: ({ selectedStaffMember, clear }) => {
|
|
160
149
|
const handleClick = () => {
|
|
161
|
-
|
|
150
|
+
clear();
|
|
162
151
|
onClick?.(selectedStaffMember);
|
|
163
152
|
};
|
|
164
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className,
|
|
153
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, "data-testid": TestIds.staffMemberListActionClear, customElement: children, customElementProps: {
|
|
165
154
|
onClick: handleClick,
|
|
166
|
-
}, children: _jsx("button", { children: children || label }) }));
|
|
155
|
+
}, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
|
|
167
156
|
} }));
|
|
168
157
|
});
|
|
169
158
|
Clear.displayName = 'StaffMemberList.Actions.Clear';
|
|
@@ -34,18 +34,18 @@ export interface RootProps {
|
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
36
|
export declare const Root: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLElement>>;
|
|
37
|
-
export declare
|
|
38
|
-
timeSlotStartDate
|
|
39
|
-
timeSlotEndDate
|
|
40
|
-
timeSlotDuration
|
|
41
|
-
timeSlotActionSelect
|
|
42
|
-
timeSlotActionClearStaffSelection
|
|
43
|
-
timeSlotLocationName
|
|
44
|
-
timeSlotStaffMembers
|
|
45
|
-
timeSlotStaffMember
|
|
46
|
-
timeSlotStaffMemberName
|
|
47
|
-
timeSlotStaffMemberActionSelect
|
|
48
|
-
}
|
|
37
|
+
export declare const TestIds: {
|
|
38
|
+
readonly timeSlotStartDate: "time-slot-start-date";
|
|
39
|
+
readonly timeSlotEndDate: "time-slot-end-date";
|
|
40
|
+
readonly timeSlotDuration: "time-slot-duration";
|
|
41
|
+
readonly timeSlotActionSelect: "time-slot-action-select";
|
|
42
|
+
readonly timeSlotActionClearStaffSelection: "time-slot-action-clear-staff-selection";
|
|
43
|
+
readonly timeSlotLocationName: "time-slot-location-name";
|
|
44
|
+
readonly timeSlotStaffMembers: "time-slot-staff-members";
|
|
45
|
+
readonly timeSlotStaffMember: "time-slot-staff-member";
|
|
46
|
+
readonly timeSlotStaffMemberName: "time-slot-staff-member-name";
|
|
47
|
+
readonly timeSlotStaffMemberActionSelect: "time-slot-staff-member-action-select";
|
|
48
|
+
};
|
|
49
49
|
/**
|
|
50
50
|
* Props for TimeSlot.StartDate component.
|
|
51
51
|
* Inherits formatting options from DateData (dateTimeFormatOptions, locale).
|
|
@@ -31,21 +31,20 @@ Root.displayName = 'TimeSlot.Root';
|
|
|
31
31
|
// ============================================================================
|
|
32
32
|
// TestIds
|
|
33
33
|
// ============================================================================
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
TestIds["timeSlotActionClearStaffSelection"] = "time-slot-action-clear-staff-selection";
|
|
34
|
+
export const TestIds = {
|
|
35
|
+
timeSlotStartDate: 'time-slot-start-date',
|
|
36
|
+
timeSlotEndDate: 'time-slot-end-date',
|
|
37
|
+
timeSlotDuration: 'time-slot-duration',
|
|
38
|
+
timeSlotActionSelect: 'time-slot-action-select',
|
|
39
|
+
timeSlotActionClearStaffSelection: 'time-slot-action-clear-staff-selection',
|
|
41
40
|
// Location component
|
|
42
|
-
|
|
41
|
+
timeSlotLocationName: 'time-slot-location-name',
|
|
43
42
|
// StaffMember components
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
43
|
+
timeSlotStaffMembers: 'time-slot-staff-members',
|
|
44
|
+
timeSlotStaffMember: 'time-slot-staff-member',
|
|
45
|
+
timeSlotStaffMemberName: 'time-slot-staff-member-name',
|
|
46
|
+
timeSlotStaffMemberActionSelect: 'time-slot-staff-member-action-select',
|
|
47
|
+
};
|
|
49
48
|
/**
|
|
50
49
|
* Displays the time slot start time.
|
|
51
50
|
* Default formatting shows time as "10:00 AM" (hour:minute with AM/PM).
|
|
@@ -181,13 +180,13 @@ export const Select = React.forwardRef((props, ref) => {
|
|
|
181
180
|
selectTimeSlot();
|
|
182
181
|
onClick?.(timeSlot);
|
|
183
182
|
};
|
|
184
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className,
|
|
183
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, disabled: !bookable, "data-testid": TestIds.timeSlotActionSelect, "data-selected": isSelected, "data-bookable": bookable, customElement: children, customElementProps: {
|
|
185
184
|
onClick: handleClick,
|
|
186
185
|
disabled: !bookable,
|
|
187
186
|
isSelected,
|
|
188
187
|
bookable,
|
|
189
188
|
timeSlot,
|
|
190
|
-
}, children: _jsx("button", { children: children || label }) }));
|
|
189
|
+
}, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
|
|
191
190
|
} }));
|
|
192
191
|
});
|
|
193
192
|
Select.displayName = 'TimeSlot.Actions.Select';
|
|
@@ -231,9 +230,9 @@ export const ClearStaffSelection = React.forwardRef((props, ref) => {
|
|
|
231
230
|
clearStaffSelection();
|
|
232
231
|
onClick?.(timeSlot);
|
|
233
232
|
};
|
|
234
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className,
|
|
233
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, "data-testid": TestIds.timeSlotActionClearStaffSelection, customElement: children, customElementProps: {
|
|
235
234
|
onClick: handleClick,
|
|
236
|
-
}, children: _jsx("button", { children: children || label }) }));
|
|
235
|
+
}, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
|
|
237
236
|
} }));
|
|
238
237
|
});
|
|
239
238
|
ClearStaffSelection.displayName = 'TimeSlot.Actions.ClearStaffSelection';
|
|
@@ -385,11 +384,11 @@ export const SelectStaffMember = React.forwardRef((props, ref) => {
|
|
|
385
384
|
selectStaffMember();
|
|
386
385
|
onClick?.(staffMember);
|
|
387
386
|
};
|
|
388
|
-
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className,
|
|
387
|
+
return (_jsx(AsChildSlot, { ref: ref, asChild: asChild, ...rest, className: className, "data-testid": TestIds.timeSlotStaffMemberActionSelect, "data-selected": isSelected, customElement: children, customElementProps: {
|
|
389
388
|
onClick: handleClick,
|
|
390
389
|
isSelected,
|
|
391
390
|
staffMember,
|
|
392
|
-
}, children: _jsx("button", { children: children || label }) }));
|
|
391
|
+
}, children: _jsx("button", { onClick: handleClick, children: children || label }) }));
|
|
393
392
|
} }));
|
|
394
393
|
});
|
|
395
394
|
SelectStaffMember.displayName = 'TimeSlot.StaffMember.Actions.Select';
|
|
@@ -10,15 +10,15 @@ export type { StartDateProps as TimeSlotStartDateProps, EndDateProps as TimeSlot
|
|
|
10
10
|
/**
|
|
11
11
|
* TimeSlot with required id field for GenericList
|
|
12
12
|
*/
|
|
13
|
-
export declare
|
|
14
|
-
timeSlotListRoot
|
|
15
|
-
timeSlotListTimeSlots
|
|
16
|
-
timeSlotListTimeSlot
|
|
17
|
-
timeSlotListTimezone
|
|
18
|
-
timeSlotListLoadMore
|
|
19
|
-
timeSlotListContinue
|
|
20
|
-
timeSlotListDateRangeInput
|
|
21
|
-
}
|
|
13
|
+
export declare const TestIds: {
|
|
14
|
+
readonly timeSlotListRoot: "time-slot-list-root";
|
|
15
|
+
readonly timeSlotListTimeSlots: "time-slot-list-time-slots";
|
|
16
|
+
readonly timeSlotListTimeSlot: "time-slot-list-time-slot";
|
|
17
|
+
readonly timeSlotListTimezone: "time-slot-list-timezone";
|
|
18
|
+
readonly timeSlotListLoadMore: "time-slot-list-load-more";
|
|
19
|
+
readonly timeSlotListContinue: "time-slot-list-continue";
|
|
20
|
+
readonly timeSlotListDateRangeInput: "time-slot-list-date-range-input";
|
|
21
|
+
};
|
|
22
22
|
/**
|
|
23
23
|
* Render props for TimeSlotList.Timezone component
|
|
24
24
|
*/
|
|
@@ -32,16 +32,15 @@ function toISODateString(date, timezone) {
|
|
|
32
32
|
/**
|
|
33
33
|
* TimeSlot with required id field for GenericList
|
|
34
34
|
*/
|
|
35
|
-
export
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
})(TestIds || (TestIds = {}));
|
|
35
|
+
export const TestIds = {
|
|
36
|
+
timeSlotListRoot: 'time-slot-list-root',
|
|
37
|
+
timeSlotListTimeSlots: 'time-slot-list-time-slots',
|
|
38
|
+
timeSlotListTimeSlot: 'time-slot-list-time-slot',
|
|
39
|
+
timeSlotListTimezone: 'time-slot-list-timezone',
|
|
40
|
+
timeSlotListLoadMore: 'time-slot-list-load-more',
|
|
41
|
+
timeSlotListContinue: 'time-slot-list-continue',
|
|
42
|
+
timeSlotListDateRangeInput: 'time-slot-list-date-range-input',
|
|
43
|
+
};
|
|
45
44
|
/**
|
|
46
45
|
* Displays the current timezone with customizable rendering.
|
|
47
46
|
*
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { LocationType as TimeSlotLocationType } from '@wix/auto_sdk_bookings_availability-time-slots';
|
|
5
5
|
import { LocationType as BookingLocationType, SelectionMethod, } from '@wix/auto_sdk_bookings_bookings';
|
|
6
|
-
|
|
7
|
-
const STAFF_MEMBER_RESOURCE_TYPE_ID = '1cd44cf8-756f-41c3-bd90-3e2ffcaf1155';
|
|
6
|
+
import { STAFF_MEMBER_RESOURCE_TYPE_ID } from '../../constants.js';
|
|
8
7
|
/**
|
|
9
8
|
* Derives the selected payment option from service payment settings.
|
|
10
9
|
* Maps service.payment.options to booking API's selectedPaymentOption.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Builds the createCheckout request
|
|
3
3
|
*/
|
|
4
4
|
import { ChannelType, } from '../../../api/create-checkout/index.js';
|
|
5
|
-
|
|
5
|
+
import { BOOKING_APP_ID } from '../../constants.js';
|
|
6
6
|
/**
|
|
7
7
|
* Builds a checkout request from the booking ID and contact details
|
|
8
8
|
*
|
|
@@ -53,7 +53,7 @@ export function buildCheckoutRequest(params) {
|
|
|
53
53
|
quantity: 1,
|
|
54
54
|
catalogReference: {
|
|
55
55
|
catalogItemId: bookingId,
|
|
56
|
-
appId:
|
|
56
|
+
appId: BOOKING_APP_ID,
|
|
57
57
|
},
|
|
58
58
|
},
|
|
59
59
|
],
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared constants for bookings services
|
|
3
|
+
*
|
|
4
|
+
* @module Services/Constants
|
|
5
|
+
*/
|
|
6
|
+
/** Booking app definition ID */
|
|
7
|
+
export declare const BOOKING_APP_ID = "13d21c63-b5ec-5912-8397-c3a5ddb27a97";
|
|
8
|
+
/** Resource type ID for staff members */
|
|
9
|
+
export declare const STAFF_MEMBER_RESOURCE_TYPE_ID = "1cd44cf8-756f-41c3-bd90-3e2ffcaf1155";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared constants for bookings services
|
|
3
|
+
*
|
|
4
|
+
* @module Services/Constants
|
|
5
|
+
*/
|
|
6
|
+
/** Booking app definition ID */
|
|
7
|
+
export const BOOKING_APP_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
|
|
8
|
+
/** Resource type ID for staff members */
|
|
9
|
+
export const STAFF_MEMBER_RESOURCE_TYPE_ID = '1cd44cf8-756f-41c3-bd90-3e2ffcaf1155';
|
|
@@ -11,10 +11,7 @@ import { RateType } from '@wix/auto_sdk_bookings_services';
|
|
|
11
11
|
import { PaymentServiceDefinition, } from './payment.def.js';
|
|
12
12
|
import { generateLineItemId } from '../../utils/guid.js';
|
|
13
13
|
export { PaymentServiceDefinition, } from './payment.def.js';
|
|
14
|
-
|
|
15
|
-
// Constants
|
|
16
|
-
// ============================================================================
|
|
17
|
-
const BOOKINGS_APP_DEF_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
|
|
14
|
+
import { BOOKING_APP_ID } from '../constants.js';
|
|
18
15
|
// ============================================================================
|
|
19
16
|
// Helper Functions
|
|
20
17
|
// ============================================================================
|
|
@@ -52,7 +49,7 @@ function buildLineItem(service, totalParticipants, lineItemId) {
|
|
|
52
49
|
_id: lineItemId,
|
|
53
50
|
catalogReference: {
|
|
54
51
|
catalogItemId: service._id || '',
|
|
55
|
-
appId:
|
|
52
|
+
appId: BOOKING_APP_ID,
|
|
56
53
|
},
|
|
57
54
|
price: String(price),
|
|
58
55
|
...(deposit ? { depositAmount: String(deposit) } : {}),
|
|
@@ -11,7 +11,7 @@ import { convertToMoneyData } from '../../utils/money.js';
|
|
|
11
11
|
/**
|
|
12
12
|
* Booking app ID constant
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
import { BOOKING_APP_ID } from '../constants.js';
|
|
15
15
|
/**
|
|
16
16
|
* Service definition for the Service service.
|
|
17
17
|
* This defines the contract that the ServiceService must implement.
|
|
@@ -7,10 +7,7 @@ import { SignalsServiceDefinition, } from '@wix/services-definitions/core-servic
|
|
|
7
7
|
import { queryServices } from '../../api/query-services/index.js';
|
|
8
8
|
import { queryCategories, } from '../../api/query-categories/index.js';
|
|
9
9
|
import { BookingServiceDefinition } from '../booking/booking.js';
|
|
10
|
-
|
|
11
|
-
* Booking app ID constant
|
|
12
|
-
*/
|
|
13
|
-
const BOOKING_APP_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
|
|
10
|
+
import { BOOKING_APP_ID } from '../constants.js';
|
|
14
11
|
/**
|
|
15
12
|
* Default query limit
|
|
16
13
|
*/
|
|
@@ -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
|
*/
|