@wix/headless-bookings 0.0.83 → 0.0.84
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/service-list/ServiceList.d.ts +1 -1
- package/cjs/dist/react/service-list/ServiceList.d.ts +0 -2
- package/cjs/dist/react/service-list/ServiceList.js +4 -27
- package/cjs/dist/services/service-list/service-list.d.ts +1 -1
- package/cjs/dist/services/service-list/service-list.js +0 -1
- package/dist/react/core/service-list/ServiceList.d.ts +1 -1
- package/dist/react/service-list/ServiceList.d.ts +0 -2
- package/dist/react/service-list/ServiceList.js +4 -27
- package/dist/services/service-list/service-list.d.ts +1 -1
- package/dist/services/service-list/service-list.js +0 -1
- package/package.json +2 -2
|
@@ -49,7 +49,7 @@ export interface ServicesRenderProps {
|
|
|
49
49
|
/** Whether more services can be loaded */
|
|
50
50
|
hasMore: boolean;
|
|
51
51
|
/** Function to load more services */
|
|
52
|
-
loadMore: (count
|
|
52
|
+
loadMore: (count?: number) => Promise<void>;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Component that provides services list data through render props.
|
|
@@ -15,8 +15,6 @@ export interface ServiceListRootProps {
|
|
|
15
15
|
serviceListConfig?: ServiceListServiceConfig;
|
|
16
16
|
className?: string;
|
|
17
17
|
variant?: ListVariant;
|
|
18
|
-
/** Number of items to load per page. Defaults to config limit or 100 */
|
|
19
|
-
pageSize?: number;
|
|
20
18
|
}
|
|
21
19
|
/**
|
|
22
20
|
* Root component that provides the ServiceList service context for rendering services lists.
|
|
@@ -10,10 +10,6 @@ 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
|
-
* Booking app ID constant
|
|
15
|
-
*/
|
|
16
|
-
const BOOKING_APP_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
|
|
17
13
|
var TestIds;
|
|
18
14
|
(function (TestIds) {
|
|
19
15
|
TestIds["serviceListRoot"] = "service-list-root";
|
|
@@ -46,40 +42,21 @@ var TestIds;
|
|
|
46
42
|
* ```
|
|
47
43
|
*/
|
|
48
44
|
export const Root = React.forwardRef((props, ref) => {
|
|
49
|
-
const { children, serviceListConfig, className, variant
|
|
50
|
-
|
|
51
|
-
services: [],
|
|
52
|
-
options: {
|
|
53
|
-
appId: BOOKING_APP_ID,
|
|
54
|
-
pagingMetadata: {
|
|
55
|
-
limit: 0,
|
|
56
|
-
offset: 0,
|
|
57
|
-
hasNext: false,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
// Calculate effective page size: prop > config limit > default
|
|
62
|
-
const effectivePageSize = pageSize ??
|
|
63
|
-
serviceListConfig?.options?.pagingMetadata?.limit ??
|
|
64
|
-
DEFAULT_PAGE_SIZE;
|
|
65
|
-
return (_jsx(CoreServiceList.Root, { serviceListConfig: serviceConfig, children: _jsx(RootContent, { className: className, ref: ref, variant: variant, pageSize: effectivePageSize, children: children }) }));
|
|
45
|
+
const { children, serviceListConfig = {}, className, variant } = props;
|
|
46
|
+
return (_jsx(CoreServiceList.Root, { serviceListConfig: serviceListConfig, children: _jsx(RootContent, { className: className, ref: ref, variant: variant, children: children }) }));
|
|
66
47
|
});
|
|
67
48
|
Root.displayName = 'ServiceList.Root';
|
|
68
|
-
/**
|
|
69
|
-
* Default page size for load more
|
|
70
|
-
*/
|
|
71
|
-
const DEFAULT_PAGE_SIZE = 100;
|
|
72
49
|
/**
|
|
73
50
|
* Internal component to handle the Root content with service access
|
|
74
51
|
*/
|
|
75
52
|
const RootContent = React.forwardRef((props, ref) => {
|
|
76
|
-
const { children, className, variant
|
|
53
|
+
const { children, className, variant } = props;
|
|
77
54
|
return (_jsx(CoreServiceList.Services, { children: ({ services: servicesList, isLoading, hasMore, loadMore, error }) => {
|
|
78
55
|
const items = servicesList.map((service) => ({
|
|
79
56
|
...service,
|
|
80
57
|
id: service._id,
|
|
81
58
|
}));
|
|
82
|
-
return (_jsx(GenericList.Root, { items: items, loadMore: () => loadMore(
|
|
59
|
+
return (_jsx(GenericList.Root, { items: items, loadMore: () => loadMore(), hasMore: hasMore, isLoading: isLoading, error: error, className: className, ref: ref, "data-testid": TestIds.serviceListRoot, variant: variant, children: children }));
|
|
83
60
|
} }));
|
|
84
61
|
});
|
|
85
62
|
/**
|
|
@@ -24,7 +24,7 @@ export interface ServiceListServiceConfig {
|
|
|
24
24
|
* Actions object for service list operations
|
|
25
25
|
*/
|
|
26
26
|
export interface ServiceListActions {
|
|
27
|
-
loadMore: (count
|
|
27
|
+
loadMore: (count?: number) => Promise<void>;
|
|
28
28
|
setQueryOptions: (options: QueryOptions) => void;
|
|
29
29
|
setFilter: (filter: Filter) => void;
|
|
30
30
|
resetFilter: () => void;
|
|
@@ -256,7 +256,6 @@ export const ServiceListService = implementService.withConfig()(ServiceListServi
|
|
|
256
256
|
const nextPaging = {
|
|
257
257
|
limit: count || DEFAULT_QUERY_LIMIT,
|
|
258
258
|
offset: nextOffset,
|
|
259
|
-
hasNext: false, // Will be updated after query
|
|
260
259
|
};
|
|
261
260
|
// Get effective filter from computed signal (includes location from BookingService)
|
|
262
261
|
const effectiveFilter = effectiveFilterSignal.get();
|
|
@@ -49,7 +49,7 @@ export interface ServicesRenderProps {
|
|
|
49
49
|
/** Whether more services can be loaded */
|
|
50
50
|
hasMore: boolean;
|
|
51
51
|
/** Function to load more services */
|
|
52
|
-
loadMore: (count
|
|
52
|
+
loadMore: (count?: number) => Promise<void>;
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Component that provides services list data through render props.
|
|
@@ -15,8 +15,6 @@ export interface ServiceListRootProps {
|
|
|
15
15
|
serviceListConfig?: ServiceListServiceConfig;
|
|
16
16
|
className?: string;
|
|
17
17
|
variant?: ListVariant;
|
|
18
|
-
/** Number of items to load per page. Defaults to config limit or 100 */
|
|
19
|
-
pageSize?: number;
|
|
20
18
|
}
|
|
21
19
|
/**
|
|
22
20
|
* Root component that provides the ServiceList service context for rendering services lists.
|
|
@@ -10,10 +10,6 @@ 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
|
-
* Booking app ID constant
|
|
15
|
-
*/
|
|
16
|
-
const BOOKING_APP_ID = '13d21c63-b5ec-5912-8397-c3a5ddb27a97';
|
|
17
13
|
var TestIds;
|
|
18
14
|
(function (TestIds) {
|
|
19
15
|
TestIds["serviceListRoot"] = "service-list-root";
|
|
@@ -46,40 +42,21 @@ var TestIds;
|
|
|
46
42
|
* ```
|
|
47
43
|
*/
|
|
48
44
|
export const Root = React.forwardRef((props, ref) => {
|
|
49
|
-
const { children, serviceListConfig, className, variant
|
|
50
|
-
|
|
51
|
-
services: [],
|
|
52
|
-
options: {
|
|
53
|
-
appId: BOOKING_APP_ID,
|
|
54
|
-
pagingMetadata: {
|
|
55
|
-
limit: 0,
|
|
56
|
-
offset: 0,
|
|
57
|
-
hasNext: false,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
// Calculate effective page size: prop > config limit > default
|
|
62
|
-
const effectivePageSize = pageSize ??
|
|
63
|
-
serviceListConfig?.options?.pagingMetadata?.limit ??
|
|
64
|
-
DEFAULT_PAGE_SIZE;
|
|
65
|
-
return (_jsx(CoreServiceList.Root, { serviceListConfig: serviceConfig, children: _jsx(RootContent, { className: className, ref: ref, variant: variant, pageSize: effectivePageSize, children: children }) }));
|
|
45
|
+
const { children, serviceListConfig = {}, className, variant } = props;
|
|
46
|
+
return (_jsx(CoreServiceList.Root, { serviceListConfig: serviceListConfig, children: _jsx(RootContent, { className: className, ref: ref, variant: variant, children: children }) }));
|
|
66
47
|
});
|
|
67
48
|
Root.displayName = 'ServiceList.Root';
|
|
68
|
-
/**
|
|
69
|
-
* Default page size for load more
|
|
70
|
-
*/
|
|
71
|
-
const DEFAULT_PAGE_SIZE = 100;
|
|
72
49
|
/**
|
|
73
50
|
* Internal component to handle the Root content with service access
|
|
74
51
|
*/
|
|
75
52
|
const RootContent = React.forwardRef((props, ref) => {
|
|
76
|
-
const { children, className, variant
|
|
53
|
+
const { children, className, variant } = props;
|
|
77
54
|
return (_jsx(CoreServiceList.Services, { children: ({ services: servicesList, isLoading, hasMore, loadMore, error }) => {
|
|
78
55
|
const items = servicesList.map((service) => ({
|
|
79
56
|
...service,
|
|
80
57
|
id: service._id,
|
|
81
58
|
}));
|
|
82
|
-
return (_jsx(GenericList.Root, { items: items, loadMore: () => loadMore(
|
|
59
|
+
return (_jsx(GenericList.Root, { items: items, loadMore: () => loadMore(), hasMore: hasMore, isLoading: isLoading, error: error, className: className, ref: ref, "data-testid": TestIds.serviceListRoot, variant: variant, children: children }));
|
|
83
60
|
} }));
|
|
84
61
|
});
|
|
85
62
|
/**
|
|
@@ -24,7 +24,7 @@ export interface ServiceListServiceConfig {
|
|
|
24
24
|
* Actions object for service list operations
|
|
25
25
|
*/
|
|
26
26
|
export interface ServiceListActions {
|
|
27
|
-
loadMore: (count
|
|
27
|
+
loadMore: (count?: number) => Promise<void>;
|
|
28
28
|
setQueryOptions: (options: QueryOptions) => void;
|
|
29
29
|
setFilter: (filter: Filter) => void;
|
|
30
30
|
resetFilter: () => void;
|
|
@@ -256,7 +256,6 @@ export const ServiceListService = implementService.withConfig()(ServiceListServi
|
|
|
256
256
|
const nextPaging = {
|
|
257
257
|
limit: count || DEFAULT_QUERY_LIMIT,
|
|
258
258
|
offset: nextOffset,
|
|
259
|
-
hasNext: false, // Will be updated after query
|
|
260
259
|
};
|
|
261
260
|
// Get effective filter from computed signal (includes location from BookingService)
|
|
262
261
|
const effectiveFilter = effectiveFilterSignal.get();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/headless-bookings",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.84",
|
|
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": "
|
|
75
|
+
"falconPackageHash": "6c0b06979e9fb7f65fd8a0e9a5529b3fe8ce8ff0fc03e0966da5915e"
|
|
76
76
|
}
|