@wix/headless-bookings 0.0.68 → 0.0.70
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/react/core/time-slot-list/TimeSlotList.d.ts +2 -2
- package/cjs/dist/react/core/time-slot-list/TimeSlotList.js +2 -5
- package/cjs/dist/react/time-slot-list/TimeSlotList.js +2 -2
- package/dist/react/core/time-slot-list/TimeSlotList.d.ts +2 -2
- package/dist/react/core/time-slot-list/TimeSlotList.js +2 -5
- package/dist/react/time-slot-list/TimeSlotList.js +2 -2
- package/package.json +3 -3
|
@@ -104,7 +104,7 @@ export interface ListDataRenderProps {
|
|
|
104
104
|
isLoading: boolean;
|
|
105
105
|
error: string | null;
|
|
106
106
|
loadMore: () => Promise<void>;
|
|
107
|
-
|
|
107
|
+
hasSelectedTimeSlot: boolean;
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* Props for ListData render prop component
|
|
@@ -120,7 +120,7 @@ export interface ListDataProps {
|
|
|
120
120
|
* @example
|
|
121
121
|
* ```tsx
|
|
122
122
|
* <ListData>
|
|
123
|
-
* {({ timeSlots, hasMore, isLoading, loadMore,
|
|
123
|
+
* {({ timeSlots, hasMore, isLoading, loadMore, hasSelectedTimeSlot }) => (
|
|
124
124
|
* <GenericList.Root items={timeSlots} hasMore={hasMore} isLoading={isLoading} loadMore={loadMore}>
|
|
125
125
|
* {children}
|
|
126
126
|
* </GenericList.Root>
|
|
@@ -129,7 +129,7 @@ export function Timezone(props) {
|
|
|
129
129
|
* @example
|
|
130
130
|
* ```tsx
|
|
131
131
|
* <ListData>
|
|
132
|
-
* {({ timeSlots, hasMore, isLoading, loadMore,
|
|
132
|
+
* {({ timeSlots, hasMore, isLoading, loadMore, hasSelectedTimeSlot }) => (
|
|
133
133
|
* <GenericList.Root items={timeSlots} hasMore={hasMore} isLoading={isLoading} loadMore={loadMore}>
|
|
134
134
|
* {children}
|
|
135
135
|
* </GenericList.Root>
|
|
@@ -141,16 +141,13 @@ export function ListData(props) {
|
|
|
141
141
|
const service = useService(TimeSlotListServiceDefinition);
|
|
142
142
|
const bookingService = useService(BookingServiceDefinition);
|
|
143
143
|
const selectedTimeSlot = bookingService.serviceSelections.get()[0]?.timeSlot;
|
|
144
|
-
const hasTimeSlot = !!selectedTimeSlot;
|
|
145
|
-
const hasSelectedStaffMember = (selectedTimeSlot?.resources?.length ?? 0) === 1;
|
|
146
|
-
const isSelectionComplete = hasTimeSlot && hasSelectedStaffMember;
|
|
147
144
|
return props.children({
|
|
148
145
|
timeSlots: service.timeSlots.get(),
|
|
149
146
|
hasMore: service.hasMore.get(),
|
|
150
147
|
isLoading: service.isLoading.get(),
|
|
151
148
|
error: service.error.get(),
|
|
152
149
|
loadMore: service.actions.loadMore,
|
|
153
|
-
|
|
150
|
+
hasSelectedTimeSlot: !!selectedTimeSlot,
|
|
154
151
|
});
|
|
155
152
|
}
|
|
156
153
|
/**
|
|
@@ -105,10 +105,10 @@ Root.displayName = 'TimeSlotList.Root';
|
|
|
105
105
|
*/
|
|
106
106
|
const RootContent = React.forwardRef((props, ref) => {
|
|
107
107
|
const { children, className, variant } = props;
|
|
108
|
-
return (_jsx(CoreTimeSlotList.ListData, { children: ({ timeSlots, hasMore, isLoading, error, loadMore,
|
|
108
|
+
return (_jsx(CoreTimeSlotList.ListData, { children: ({ timeSlots, hasMore, isLoading, error, loadMore, hasSelectedTimeSlot, }) => (_jsx(GenericList.Root, { items: timeSlots.map((slot) => ({
|
|
109
109
|
...slot,
|
|
110
110
|
id: generateSlotKey(slot),
|
|
111
|
-
})), loadMore: loadMore, hasMore: hasMore, isLoading: isLoading, error: error, className: className, ref: ref, "data-testid": TestIds.timeSlotListRoot, "data-
|
|
111
|
+
})), loadMore: loadMore, hasMore: hasMore, isLoading: isLoading, error: error, className: className, ref: ref, "data-testid": TestIds.timeSlotListRoot, "data-has-selected-time-slot": hasSelectedTimeSlot, variant: variant, children: children })) }));
|
|
112
112
|
});
|
|
113
113
|
RootContent.displayName = 'TimeSlotList.RootContent';
|
|
114
114
|
/**
|
|
@@ -104,7 +104,7 @@ export interface ListDataRenderProps {
|
|
|
104
104
|
isLoading: boolean;
|
|
105
105
|
error: string | null;
|
|
106
106
|
loadMore: () => Promise<void>;
|
|
107
|
-
|
|
107
|
+
hasSelectedTimeSlot: boolean;
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* Props for ListData render prop component
|
|
@@ -120,7 +120,7 @@ export interface ListDataProps {
|
|
|
120
120
|
* @example
|
|
121
121
|
* ```tsx
|
|
122
122
|
* <ListData>
|
|
123
|
-
* {({ timeSlots, hasMore, isLoading, loadMore,
|
|
123
|
+
* {({ timeSlots, hasMore, isLoading, loadMore, hasSelectedTimeSlot }) => (
|
|
124
124
|
* <GenericList.Root items={timeSlots} hasMore={hasMore} isLoading={isLoading} loadMore={loadMore}>
|
|
125
125
|
* {children}
|
|
126
126
|
* </GenericList.Root>
|
|
@@ -129,7 +129,7 @@ export function Timezone(props) {
|
|
|
129
129
|
* @example
|
|
130
130
|
* ```tsx
|
|
131
131
|
* <ListData>
|
|
132
|
-
* {({ timeSlots, hasMore, isLoading, loadMore,
|
|
132
|
+
* {({ timeSlots, hasMore, isLoading, loadMore, hasSelectedTimeSlot }) => (
|
|
133
133
|
* <GenericList.Root items={timeSlots} hasMore={hasMore} isLoading={isLoading} loadMore={loadMore}>
|
|
134
134
|
* {children}
|
|
135
135
|
* </GenericList.Root>
|
|
@@ -141,16 +141,13 @@ export function ListData(props) {
|
|
|
141
141
|
const service = useService(TimeSlotListServiceDefinition);
|
|
142
142
|
const bookingService = useService(BookingServiceDefinition);
|
|
143
143
|
const selectedTimeSlot = bookingService.serviceSelections.get()[0]?.timeSlot;
|
|
144
|
-
const hasTimeSlot = !!selectedTimeSlot;
|
|
145
|
-
const hasSelectedStaffMember = (selectedTimeSlot?.resources?.length ?? 0) === 1;
|
|
146
|
-
const isSelectionComplete = hasTimeSlot && hasSelectedStaffMember;
|
|
147
144
|
return props.children({
|
|
148
145
|
timeSlots: service.timeSlots.get(),
|
|
149
146
|
hasMore: service.hasMore.get(),
|
|
150
147
|
isLoading: service.isLoading.get(),
|
|
151
148
|
error: service.error.get(),
|
|
152
149
|
loadMore: service.actions.loadMore,
|
|
153
|
-
|
|
150
|
+
hasSelectedTimeSlot: !!selectedTimeSlot,
|
|
154
151
|
});
|
|
155
152
|
}
|
|
156
153
|
/**
|
|
@@ -105,10 +105,10 @@ Root.displayName = 'TimeSlotList.Root';
|
|
|
105
105
|
*/
|
|
106
106
|
const RootContent = React.forwardRef((props, ref) => {
|
|
107
107
|
const { children, className, variant } = props;
|
|
108
|
-
return (_jsx(CoreTimeSlotList.ListData, { children: ({ timeSlots, hasMore, isLoading, error, loadMore,
|
|
108
|
+
return (_jsx(CoreTimeSlotList.ListData, { children: ({ timeSlots, hasMore, isLoading, error, loadMore, hasSelectedTimeSlot, }) => (_jsx(GenericList.Root, { items: timeSlots.map((slot) => ({
|
|
109
109
|
...slot,
|
|
110
110
|
id: generateSlotKey(slot),
|
|
111
|
-
})), loadMore: loadMore, hasMore: hasMore, isLoading: isLoading, error: error, className: className, ref: ref, "data-testid": TestIds.timeSlotListRoot, "data-
|
|
111
|
+
})), loadMore: loadMore, hasMore: hasMore, isLoading: isLoading, error: error, className: className, ref: ref, "data-testid": TestIds.timeSlotListRoot, "data-has-selected-time-slot": hasSelectedTimeSlot, variant: variant, children: children })) }));
|
|
112
112
|
});
|
|
113
113
|
RootContent.displayName = 'TimeSlotList.RootContent';
|
|
114
114
|
/**
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/headless-bookings",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"license": "MIT",
|
|
3
|
+
"version": "0.0.70",
|
|
5
4
|
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prebuild": "cd ../media && yarn build && cd ../ecom && yarn build",
|
|
8
8
|
"build": "npm run build:esm && npm run build:cjs",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"groupId": "com.wixpress.headless-components"
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
"falconPackageHash": "
|
|
75
|
+
"falconPackageHash": "f52a35bc9181ed04c0310b7449e0422171fd803813aa9ac41a48e0c2"
|
|
76
76
|
}
|