@wix/headless-bookings 0.0.84 → 0.0.85

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.
@@ -1,6 +1,9 @@
1
+ import { vi } from 'vitest';
2
+ import React from 'react';
1
3
  import type { TimeSlot } from '@wix/auto_sdk_bookings_availability-time-slots';
2
4
  import type { TimeSlotListServiceConfig, TimeSlotListServiceAPI } from '../services/time-slot-list/time-slot-list.def.js';
3
5
  import type { BookingService } from '../services/booking/booking.js';
6
+ import type { StaffMemberData } from '../react/time-slot-list/TimeSlot.js';
4
7
  export declare function createTimeSlotListService(overrides?: Partial<TimeSlotListServiceConfig>): {
5
8
  service: TimeSlotListServiceAPI;
6
9
  bookingService: BookingService;
@@ -26,3 +29,50 @@ export declare const mockCursorPagingMetadataNoMore: {
26
29
  cursors: {};
27
30
  };
28
31
  export declare function createMockTimeSlotListService(config?: Partial<TimeSlotListServiceConfig>): TimeSlotListServiceAPI;
32
+ export interface CoreTimeSlotMockConfig {
33
+ timeSlot: TimeSlot;
34
+ staffMembers: StaffMemberData[];
35
+ selectTimeSlot: ReturnType<typeof vi.fn>;
36
+ clearStaffSelection: ReturnType<typeof vi.fn>;
37
+ selectStaffMember: ReturnType<typeof vi.fn>;
38
+ }
39
+ export declare function createCoreTimeSlotMock(config: CoreTimeSlotMockConfig): {
40
+ Root: import("vitest").Mock<({ children, config: cfg }: any) => import("react/jsx-runtime").JSX.Element>;
41
+ Info: import("vitest").Mock<({ children }: any) => any>;
42
+ Actions: import("vitest").Mock<({ children }: any) => any>;
43
+ StaffMembers: import("vitest").Mock<({ children }: any) => any>;
44
+ StaffMemberProvider: import("vitest").Mock<({ children, staffMember }: any) => import("react/jsx-runtime").JSX.Element>;
45
+ StaffMemberInfo: import("vitest").Mock<({ children }: any) => any>;
46
+ StaffMemberActions: import("vitest").Mock<({ children }: any) => any>;
47
+ };
48
+ export interface CoreTimeSlotListMockConfig {
49
+ timeSlots: TimeSlot[];
50
+ timezone?: string;
51
+ displayName?: string;
52
+ startDate?: Date;
53
+ endDate?: Date;
54
+ }
55
+ export declare function createCoreTimeSlotListMock(config?: CoreTimeSlotListMockConfig): {
56
+ Root: import("vitest").Mock<({ children }: any) => import("react/jsx-runtime").JSX.Element>;
57
+ Timezone: import("vitest").Mock<({ children }: any) => any>;
58
+ ListData: import("vitest").Mock<({ children }: any) => any>;
59
+ DateRange: import("vitest").Mock<({ children }: any) => any>;
60
+ };
61
+ export declare function createCoreTimeSlotInfoMock(timeSlot?: TimeSlot): {
62
+ Root: import("vitest").Mock<({ children, config: cfg }: any) => import("react/jsx-runtime").JSX.Element>;
63
+ Info: import("vitest").Mock<({ children }: any) => any>;
64
+ };
65
+ declare const GenericListContext: React.Context<{
66
+ items: any[];
67
+ } | null>;
68
+ export declare function createGenericListMock(): {
69
+ GenericList: {
70
+ Root: import("vitest").Mock<({ children, items, className, ...props }: any) => import("react/jsx-runtime").JSX.Element>;
71
+ Items: import("vitest").Mock<({ children, emptyState }: any) => any>;
72
+ Repeater: import("vitest").Mock<({ itemWrapper, children }: any) => import("react/jsx-runtime").JSX.Element | null>;
73
+ Actions: {
74
+ LoadMore: import("vitest").Mock<({ children, ...props }: any) => import("react/jsx-runtime").JSX.Element>;
75
+ };
76
+ };
77
+ };
78
+ export { GenericListContext };
@@ -1,4 +1,6 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  import { vi } from 'vitest';
3
+ import React from 'react';
2
4
  import { TimeSlotListService } from '../services/time-slot-list/time-slot-list.js';
3
5
  import { createMockBookingService, createMockSignalsService, mockSignal, } from './booking.js';
4
6
  export function createTimeSlotListService(overrides = {}) {
@@ -115,3 +117,96 @@ export function createMockTimeSlotListService(config = {}) {
115
117
  dispose: vi.fn(),
116
118
  };
117
119
  }
120
+ export function createCoreTimeSlotMock(config) {
121
+ const { timeSlot, staffMembers, selectTimeSlot, clearStaffSelection, selectStaffMember, } = config;
122
+ const startDate = new Date(timeSlot.localStartDate);
123
+ const endDate = new Date(timeSlot.localEndDate);
124
+ const durationInMinutes = Math.round((endDate.getTime() - startDate.getTime()) / (1000 * 60));
125
+ return {
126
+ Root: vi.fn(({ children, config: cfg }) => (_jsx("div", { "data-timeslot-id": cfg.timeSlot.scheduleId, children: children }))),
127
+ Info: vi.fn(({ children }) => children({
128
+ startDate,
129
+ endDate,
130
+ durationInMinutes,
131
+ locationName: timeSlot.location?.name ?? '',
132
+ bookable: timeSlot.bookable ?? false,
133
+ isSelected: false,
134
+ timeSlot,
135
+ })),
136
+ Actions: vi.fn(({ children }) => children({
137
+ selectTimeSlot,
138
+ clearStaffSelection,
139
+ timeSlot,
140
+ bookable: timeSlot.bookable ?? false,
141
+ isSelected: false,
142
+ })),
143
+ StaffMembers: vi.fn(({ children }) => children({ staffMembers, selectStaffMember: vi.fn() })),
144
+ StaffMemberProvider: vi.fn(({ children, staffMember }) => (_jsx("div", { "data-staff-id": staffMember.id, children: children }))),
145
+ StaffMemberInfo: vi.fn(({ children }) => children({
146
+ name: staffMembers[0]?.name ?? '',
147
+ isSelected: false,
148
+ staffMember: staffMembers[0],
149
+ })),
150
+ StaffMemberActions: vi.fn(({ children }) => children({
151
+ selectStaffMember,
152
+ isSelected: false,
153
+ staffMember: staffMembers[0],
154
+ })),
155
+ };
156
+ }
157
+ export function createCoreTimeSlotListMock(config = { timeSlots: mockTimeSlots }) {
158
+ const { timeSlots, timezone = 'America/New_York', displayName = 'Eastern Standard Time', startDate = new Date('2024-01-15'), endDate = new Date('2024-01-22'), } = config;
159
+ return {
160
+ Root: vi.fn(({ children }) => _jsx(_Fragment, { children: children })),
161
+ Timezone: vi.fn(({ children }) => children({ timezone, displayName })),
162
+ ListData: vi.fn(({ children }) => children({
163
+ timeSlots,
164
+ hasMore: false,
165
+ isLoading: false,
166
+ error: null,
167
+ loadMore: vi.fn(),
168
+ hasSelectedTimeSlot: false,
169
+ })),
170
+ DateRange: vi.fn(({ children }) => children({
171
+ startDate,
172
+ endDate,
173
+ setDateRange: vi.fn(),
174
+ })),
175
+ };
176
+ }
177
+ export function createCoreTimeSlotInfoMock(timeSlot = mockTimeSlot) {
178
+ return {
179
+ Root: vi.fn(({ children, config: cfg }) => (_jsx("div", { "data-timeslot-id": cfg.timeSlot.scheduleId, children: children }))),
180
+ Info: vi.fn(({ children }) => children({
181
+ startDate: new Date(timeSlot.localStartDate),
182
+ endDate: new Date(timeSlot.localEndDate),
183
+ durationInMinutes: 60,
184
+ locationName: timeSlot.location?.name ?? '',
185
+ bookable: timeSlot.bookable ?? false,
186
+ isSelected: false,
187
+ timeSlot,
188
+ })),
189
+ };
190
+ }
191
+ const GenericListContext = React.createContext(null);
192
+ export function createGenericListMock() {
193
+ return {
194
+ GenericList: {
195
+ Root: vi.fn(({ children, items, className, ...props }) => (_jsx(GenericListContext.Provider, { value: { items }, children: _jsx("div", { className: className, ...props, children: children }) }))),
196
+ Items: vi.fn(({ children, emptyState }) => {
197
+ const ctx = React.useContext(GenericListContext);
198
+ return ctx?.items?.length ? _jsx("div", { children: children }) : emptyState || null;
199
+ }),
200
+ Repeater: vi.fn(({ itemWrapper, children }) => {
201
+ const ctx = React.useContext(GenericListContext);
202
+ if (!ctx?.items?.length)
203
+ return null;
204
+ return (_jsx(_Fragment, { children: ctx.items.map((item, i) => itemWrapper({ item, index: i, children })) }));
205
+ }),
206
+ Actions: {
207
+ LoadMore: vi.fn(({ children, ...props }) => (_jsx("button", { ...props, children: children }))),
208
+ },
209
+ },
210
+ };
211
+ }
212
+ export { GenericListContext };
@@ -33,6 +33,18 @@ export interface RootProps {
33
33
  * ```
34
34
  */
35
35
  export declare const Root: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLElement>>;
36
+ export declare enum TestIds {
37
+ timeSlotStartDate = "time-slot-start-date",
38
+ timeSlotEndDate = "time-slot-end-date",
39
+ timeSlotDuration = "time-slot-duration",
40
+ timeSlotActionSelect = "time-slot-action-select",
41
+ timeSlotActionClearStaffSelection = "time-slot-action-clear-staff-selection",
42
+ timeSlotLocationName = "time-slot-location-name",
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
+ }
36
48
  /**
37
49
  * Props for TimeSlot.StartDate component
38
50
  */
@@ -31,7 +31,7 @@ Root.displayName = 'TimeSlot.Root';
31
31
  // ============================================================================
32
32
  // TestIds
33
33
  // ============================================================================
34
- var TestIds;
34
+ export var TestIds;
35
35
  (function (TestIds) {
36
36
  TestIds["timeSlotStartDate"] = "time-slot-start-date";
37
37
  TestIds["timeSlotEndDate"] = "time-slot-end-date";
@@ -8,6 +8,18 @@ import { AsChildChildren } from '@wix/headless-utils/react';
8
8
  import type { TimeSlot as TimeSlotType } from '@wix/auto_sdk_bookings_availability-time-slots';
9
9
  import type { TimeSlotListServiceConfig } from '../../services/time-slot-list/time-slot-list.def.js';
10
10
  export type { StartDateProps as TimeSlotStartDateProps, EndDateProps as TimeSlotEndDateProps, DurationProps as TimeSlotDurationProps, SelectProps as TimeSlotSelectProps, LocationNameProps as TimeSlotLocationNameProps, StaffMembersProps as TimeSlotStaffMembersProps, StaffMemberRepeaterProps as TimeSlotStaffMemberRepeaterProps, StaffMemberNameProps as TimeSlotStaffMemberNameProps, SelectStaffMemberProps as TimeSlotSelectStaffMemberProps, ClearStaffSelectionProps as TimeSlotClearStaffSelectionProps, } from './TimeSlot.js';
11
+ /**
12
+ * TimeSlot with required id field for GenericList
13
+ */
14
+ export declare enum TestIds {
15
+ timeSlotListRoot = "time-slot-list-root",
16
+ timeSlotListTimeSlots = "time-slot-list-time-slots",
17
+ timeSlotListTimeSlot = "time-slot-list-time-slot",
18
+ timeSlotListTimezone = "time-slot-list-timezone",
19
+ timeSlotListLoadMore = "time-slot-list-load-more",
20
+ timeSlotListContinue = "time-slot-list-continue",
21
+ timeSlotListDateRangeInput = "time-slot-list-date-range-input"
22
+ }
11
23
  /**
12
24
  * Render props for TimeSlotList.Timezone component
13
25
  */
@@ -21,7 +21,7 @@ function toISODateString(date) {
21
21
  /**
22
22
  * TimeSlot with required id field for GenericList
23
23
  */
24
- var TestIds;
24
+ export var TestIds;
25
25
  (function (TestIds) {
26
26
  TestIds["timeSlotListRoot"] = "time-slot-list-root";
27
27
  TestIds["timeSlotListTimeSlots"] = "time-slot-list-time-slots";
@@ -4,6 +4,12 @@
4
4
  */
5
5
  import type { Service } from '@wix/auto_sdk_bookings_services';
6
6
  import { type TimeSlotListServiceConfig, type TimeSlotsFilters } from './time-slot-list.def.js';
7
+ import { TimeSlot } from '@wix/auto_sdk_bookings_event-time-slots';
8
+ /**
9
+ * Helper to get staff member name from time slots by ID
10
+ * @internal - exported for testing
11
+ */
12
+ export declare const getStaffName: (staffMemberId: string, slots: TimeSlot[]) => string | undefined;
7
13
  export declare const TimeSlotListService: import("@wix/services-definitions").ServiceFactory<string & {
8
14
  __api: import("./time-slot-list.def.js").TimeSlotListServiceAPI;
9
15
  __config: {};
@@ -16,7 +16,11 @@ const getClientTimezone = () => {
16
16
  ? Intl.DateTimeFormat().resolvedOptions().timeZone
17
17
  : undefined;
18
18
  };
19
- const getStaffName = (staffMemberId, slots) => {
19
+ /**
20
+ * Helper to get staff member name from time slots by ID
21
+ * @internal - exported for testing
22
+ */
23
+ export const getStaffName = (staffMemberId, slots) => {
20
24
  return (slots
21
25
  .flatMap((slot) => slot.availableResources[0].resources)
22
26
  .find((r) => r._id === staffMemberId)?.name ?? undefined);
@@ -1,6 +1,9 @@
1
+ import { vi } from 'vitest';
2
+ import React from 'react';
1
3
  import type { TimeSlot } from '@wix/auto_sdk_bookings_availability-time-slots';
2
4
  import type { TimeSlotListServiceConfig, TimeSlotListServiceAPI } from '../services/time-slot-list/time-slot-list.def.js';
3
5
  import type { BookingService } from '../services/booking/booking.js';
6
+ import type { StaffMemberData } from '../react/time-slot-list/TimeSlot.js';
4
7
  export declare function createTimeSlotListService(overrides?: Partial<TimeSlotListServiceConfig>): {
5
8
  service: TimeSlotListServiceAPI;
6
9
  bookingService: BookingService;
@@ -26,3 +29,50 @@ export declare const mockCursorPagingMetadataNoMore: {
26
29
  cursors: {};
27
30
  };
28
31
  export declare function createMockTimeSlotListService(config?: Partial<TimeSlotListServiceConfig>): TimeSlotListServiceAPI;
32
+ export interface CoreTimeSlotMockConfig {
33
+ timeSlot: TimeSlot;
34
+ staffMembers: StaffMemberData[];
35
+ selectTimeSlot: ReturnType<typeof vi.fn>;
36
+ clearStaffSelection: ReturnType<typeof vi.fn>;
37
+ selectStaffMember: ReturnType<typeof vi.fn>;
38
+ }
39
+ export declare function createCoreTimeSlotMock(config: CoreTimeSlotMockConfig): {
40
+ Root: import("vitest").Mock<({ children, config: cfg }: any) => import("react/jsx-runtime").JSX.Element>;
41
+ Info: import("vitest").Mock<({ children }: any) => any>;
42
+ Actions: import("vitest").Mock<({ children }: any) => any>;
43
+ StaffMembers: import("vitest").Mock<({ children }: any) => any>;
44
+ StaffMemberProvider: import("vitest").Mock<({ children, staffMember }: any) => import("react/jsx-runtime").JSX.Element>;
45
+ StaffMemberInfo: import("vitest").Mock<({ children }: any) => any>;
46
+ StaffMemberActions: import("vitest").Mock<({ children }: any) => any>;
47
+ };
48
+ export interface CoreTimeSlotListMockConfig {
49
+ timeSlots: TimeSlot[];
50
+ timezone?: string;
51
+ displayName?: string;
52
+ startDate?: Date;
53
+ endDate?: Date;
54
+ }
55
+ export declare function createCoreTimeSlotListMock(config?: CoreTimeSlotListMockConfig): {
56
+ Root: import("vitest").Mock<({ children }: any) => import("react/jsx-runtime").JSX.Element>;
57
+ Timezone: import("vitest").Mock<({ children }: any) => any>;
58
+ ListData: import("vitest").Mock<({ children }: any) => any>;
59
+ DateRange: import("vitest").Mock<({ children }: any) => any>;
60
+ };
61
+ export declare function createCoreTimeSlotInfoMock(timeSlot?: TimeSlot): {
62
+ Root: import("vitest").Mock<({ children, config: cfg }: any) => import("react/jsx-runtime").JSX.Element>;
63
+ Info: import("vitest").Mock<({ children }: any) => any>;
64
+ };
65
+ declare const GenericListContext: React.Context<{
66
+ items: any[];
67
+ } | null>;
68
+ export declare function createGenericListMock(): {
69
+ GenericList: {
70
+ Root: import("vitest").Mock<({ children, items, className, ...props }: any) => import("react/jsx-runtime").JSX.Element>;
71
+ Items: import("vitest").Mock<({ children, emptyState }: any) => any>;
72
+ Repeater: import("vitest").Mock<({ itemWrapper, children }: any) => import("react/jsx-runtime").JSX.Element | null>;
73
+ Actions: {
74
+ LoadMore: import("vitest").Mock<({ children, ...props }: any) => import("react/jsx-runtime").JSX.Element>;
75
+ };
76
+ };
77
+ };
78
+ export { GenericListContext };
@@ -1,4 +1,6 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
2
  import { vi } from 'vitest';
3
+ import React from 'react';
2
4
  import { TimeSlotListService } from '../services/time-slot-list/time-slot-list.js';
3
5
  import { createMockBookingService, createMockSignalsService, mockSignal, } from './booking.js';
4
6
  export function createTimeSlotListService(overrides = {}) {
@@ -115,3 +117,96 @@ export function createMockTimeSlotListService(config = {}) {
115
117
  dispose: vi.fn(),
116
118
  };
117
119
  }
120
+ export function createCoreTimeSlotMock(config) {
121
+ const { timeSlot, staffMembers, selectTimeSlot, clearStaffSelection, selectStaffMember, } = config;
122
+ const startDate = new Date(timeSlot.localStartDate);
123
+ const endDate = new Date(timeSlot.localEndDate);
124
+ const durationInMinutes = Math.round((endDate.getTime() - startDate.getTime()) / (1000 * 60));
125
+ return {
126
+ Root: vi.fn(({ children, config: cfg }) => (_jsx("div", { "data-timeslot-id": cfg.timeSlot.scheduleId, children: children }))),
127
+ Info: vi.fn(({ children }) => children({
128
+ startDate,
129
+ endDate,
130
+ durationInMinutes,
131
+ locationName: timeSlot.location?.name ?? '',
132
+ bookable: timeSlot.bookable ?? false,
133
+ isSelected: false,
134
+ timeSlot,
135
+ })),
136
+ Actions: vi.fn(({ children }) => children({
137
+ selectTimeSlot,
138
+ clearStaffSelection,
139
+ timeSlot,
140
+ bookable: timeSlot.bookable ?? false,
141
+ isSelected: false,
142
+ })),
143
+ StaffMembers: vi.fn(({ children }) => children({ staffMembers, selectStaffMember: vi.fn() })),
144
+ StaffMemberProvider: vi.fn(({ children, staffMember }) => (_jsx("div", { "data-staff-id": staffMember.id, children: children }))),
145
+ StaffMemberInfo: vi.fn(({ children }) => children({
146
+ name: staffMembers[0]?.name ?? '',
147
+ isSelected: false,
148
+ staffMember: staffMembers[0],
149
+ })),
150
+ StaffMemberActions: vi.fn(({ children }) => children({
151
+ selectStaffMember,
152
+ isSelected: false,
153
+ staffMember: staffMembers[0],
154
+ })),
155
+ };
156
+ }
157
+ export function createCoreTimeSlotListMock(config = { timeSlots: mockTimeSlots }) {
158
+ const { timeSlots, timezone = 'America/New_York', displayName = 'Eastern Standard Time', startDate = new Date('2024-01-15'), endDate = new Date('2024-01-22'), } = config;
159
+ return {
160
+ Root: vi.fn(({ children }) => _jsx(_Fragment, { children: children })),
161
+ Timezone: vi.fn(({ children }) => children({ timezone, displayName })),
162
+ ListData: vi.fn(({ children }) => children({
163
+ timeSlots,
164
+ hasMore: false,
165
+ isLoading: false,
166
+ error: null,
167
+ loadMore: vi.fn(),
168
+ hasSelectedTimeSlot: false,
169
+ })),
170
+ DateRange: vi.fn(({ children }) => children({
171
+ startDate,
172
+ endDate,
173
+ setDateRange: vi.fn(),
174
+ })),
175
+ };
176
+ }
177
+ export function createCoreTimeSlotInfoMock(timeSlot = mockTimeSlot) {
178
+ return {
179
+ Root: vi.fn(({ children, config: cfg }) => (_jsx("div", { "data-timeslot-id": cfg.timeSlot.scheduleId, children: children }))),
180
+ Info: vi.fn(({ children }) => children({
181
+ startDate: new Date(timeSlot.localStartDate),
182
+ endDate: new Date(timeSlot.localEndDate),
183
+ durationInMinutes: 60,
184
+ locationName: timeSlot.location?.name ?? '',
185
+ bookable: timeSlot.bookable ?? false,
186
+ isSelected: false,
187
+ timeSlot,
188
+ })),
189
+ };
190
+ }
191
+ const GenericListContext = React.createContext(null);
192
+ export function createGenericListMock() {
193
+ return {
194
+ GenericList: {
195
+ Root: vi.fn(({ children, items, className, ...props }) => (_jsx(GenericListContext.Provider, { value: { items }, children: _jsx("div", { className: className, ...props, children: children }) }))),
196
+ Items: vi.fn(({ children, emptyState }) => {
197
+ const ctx = React.useContext(GenericListContext);
198
+ return ctx?.items?.length ? _jsx("div", { children: children }) : emptyState || null;
199
+ }),
200
+ Repeater: vi.fn(({ itemWrapper, children }) => {
201
+ const ctx = React.useContext(GenericListContext);
202
+ if (!ctx?.items?.length)
203
+ return null;
204
+ return (_jsx(_Fragment, { children: ctx.items.map((item, i) => itemWrapper({ item, index: i, children })) }));
205
+ }),
206
+ Actions: {
207
+ LoadMore: vi.fn(({ children, ...props }) => (_jsx("button", { ...props, children: children }))),
208
+ },
209
+ },
210
+ };
211
+ }
212
+ export { GenericListContext };
@@ -33,6 +33,18 @@ export interface RootProps {
33
33
  * ```
34
34
  */
35
35
  export declare const Root: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLElement>>;
36
+ export declare enum TestIds {
37
+ timeSlotStartDate = "time-slot-start-date",
38
+ timeSlotEndDate = "time-slot-end-date",
39
+ timeSlotDuration = "time-slot-duration",
40
+ timeSlotActionSelect = "time-slot-action-select",
41
+ timeSlotActionClearStaffSelection = "time-slot-action-clear-staff-selection",
42
+ timeSlotLocationName = "time-slot-location-name",
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
+ }
36
48
  /**
37
49
  * Props for TimeSlot.StartDate component
38
50
  */
@@ -31,7 +31,7 @@ Root.displayName = 'TimeSlot.Root';
31
31
  // ============================================================================
32
32
  // TestIds
33
33
  // ============================================================================
34
- var TestIds;
34
+ export var TestIds;
35
35
  (function (TestIds) {
36
36
  TestIds["timeSlotStartDate"] = "time-slot-start-date";
37
37
  TestIds["timeSlotEndDate"] = "time-slot-end-date";
@@ -8,6 +8,18 @@ import { AsChildChildren } from '@wix/headless-utils/react';
8
8
  import type { TimeSlot as TimeSlotType } from '@wix/auto_sdk_bookings_availability-time-slots';
9
9
  import type { TimeSlotListServiceConfig } from '../../services/time-slot-list/time-slot-list.def.js';
10
10
  export type { StartDateProps as TimeSlotStartDateProps, EndDateProps as TimeSlotEndDateProps, DurationProps as TimeSlotDurationProps, SelectProps as TimeSlotSelectProps, LocationNameProps as TimeSlotLocationNameProps, StaffMembersProps as TimeSlotStaffMembersProps, StaffMemberRepeaterProps as TimeSlotStaffMemberRepeaterProps, StaffMemberNameProps as TimeSlotStaffMemberNameProps, SelectStaffMemberProps as TimeSlotSelectStaffMemberProps, ClearStaffSelectionProps as TimeSlotClearStaffSelectionProps, } from './TimeSlot.js';
11
+ /**
12
+ * TimeSlot with required id field for GenericList
13
+ */
14
+ export declare enum TestIds {
15
+ timeSlotListRoot = "time-slot-list-root",
16
+ timeSlotListTimeSlots = "time-slot-list-time-slots",
17
+ timeSlotListTimeSlot = "time-slot-list-time-slot",
18
+ timeSlotListTimezone = "time-slot-list-timezone",
19
+ timeSlotListLoadMore = "time-slot-list-load-more",
20
+ timeSlotListContinue = "time-slot-list-continue",
21
+ timeSlotListDateRangeInput = "time-slot-list-date-range-input"
22
+ }
11
23
  /**
12
24
  * Render props for TimeSlotList.Timezone component
13
25
  */
@@ -21,7 +21,7 @@ function toISODateString(date) {
21
21
  /**
22
22
  * TimeSlot with required id field for GenericList
23
23
  */
24
- var TestIds;
24
+ export var TestIds;
25
25
  (function (TestIds) {
26
26
  TestIds["timeSlotListRoot"] = "time-slot-list-root";
27
27
  TestIds["timeSlotListTimeSlots"] = "time-slot-list-time-slots";
@@ -4,6 +4,12 @@
4
4
  */
5
5
  import type { Service } from '@wix/auto_sdk_bookings_services';
6
6
  import { type TimeSlotListServiceConfig, type TimeSlotsFilters } from './time-slot-list.def.js';
7
+ import { TimeSlot } from '@wix/auto_sdk_bookings_event-time-slots';
8
+ /**
9
+ * Helper to get staff member name from time slots by ID
10
+ * @internal - exported for testing
11
+ */
12
+ export declare const getStaffName: (staffMemberId: string, slots: TimeSlot[]) => string | undefined;
7
13
  export declare const TimeSlotListService: import("@wix/services-definitions").ServiceFactory<string & {
8
14
  __api: import("./time-slot-list.def.js").TimeSlotListServiceAPI;
9
15
  __config: {};
@@ -16,7 +16,11 @@ const getClientTimezone = () => {
16
16
  ? Intl.DateTimeFormat().resolvedOptions().timeZone
17
17
  : undefined;
18
18
  };
19
- const getStaffName = (staffMemberId, slots) => {
19
+ /**
20
+ * Helper to get staff member name from time slots by ID
21
+ * @internal - exported for testing
22
+ */
23
+ export const getStaffName = (staffMemberId, slots) => {
20
24
  return (slots
21
25
  .flatMap((slot) => slot.availableResources[0].resources)
22
26
  .find((r) => r._id === staffMemberId)?.name ?? undefined);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/headless-bookings",
3
- "version": "0.0.84",
3
+ "version": "0.0.85",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -72,5 +72,5 @@
72
72
  "groupId": "com.wixpress.headless-components"
73
73
  }
74
74
  },
75
- "falconPackageHash": "6c0b06979e9fb7f65fd8a0e9a5529b3fe8ce8ff0fc03e0966da5915e"
75
+ "falconPackageHash": "b386a6976f3f900e07276420a47b689690f92ec0e7d855efc476cefe"
76
76
  }