Skip to content

Commit 3f53add

Browse files
[add] properties description
1 parent d32bb54 commit 3f53add

9 files changed

Lines changed: 542 additions & 8 deletions

docs/api/api_overview.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ new booking.Booking("#root", {
5353

5454
## Booking properties
5555

56-
| Name | Description |
57-
| --------------------------------------------- | ------------------------------------------------------ |
58-
| [](api/config/booking_configname_config.md) | @getshort(api/config/booking_configname_config.md) |
56+
| Name | Description |
57+
| ----------------------------------------- | ------------------------------------------------ |
58+
| [](api/config/js_booking_cards.md) | @getshort(api/config/js_booking_cards.md) |
59+
| [](api/config/js_booking_cardshape.md) | @getshort(api/config/js_booking_cardshape.md) |
60+
| [](api/config/js_booking_filteredcards.md)| @getshort(api/config/js_booking_filteredcards.md)|
61+
| [](api/config/js_booking_filtershape.md) | @getshort(api/config/js_booking_filtershape.md) |
62+
| [](api/config/js_booking_formshape.md) | @getshort(api/config/js_booking_formshape.md) |
63+
| [](api/config/js_booking_infoshape.md) | @getshort(api/config/js_booking_infoshape.md) |

docs/api/config/booking_configname_config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
sidebar_label: CONFIG_NAME
33
title: CONFIG_NAME Config
4-
description: You can learn about the CONFIG_NAME config in the documentation of the DHTMLX JavaScript Booking library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Booking.
4+
description: You can learn about the NAME config in the documentation of the DHTMLX JavaScript Booking library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Booking.
55
---
66

77
# CONFIG_NAME
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
sidebar_label: cards
3+
title: cards
4+
description: You can learn about the cards config in the documentation of the DHTMLX JavaScript Booking library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Booking.
5+
---
6+
7+
# cards
8+
9+
### Description
10+
11+
@short: Optional. An array of objects containing the cards data
12+
13+
### Usage
14+
15+
~~~jsx {}
16+
cards?: [
17+
{
18+
id: string | number,
19+
title: string,
20+
category?: string,
21+
subtitle?: string,
22+
details?: string,
23+
preview?: string, // url
24+
price?: string,
25+
review?: {
26+
star: number,
27+
count: number,
28+
},
29+
slots: [
30+
{
31+
from: number,
32+
to: number,
33+
size?: number,
34+
gap?: number,
35+
days?: array, // array of numbers
36+
dates?: array, // array of numbers
37+
}, {...}
38+
],
39+
availableSlots?: array, // array of numbers
40+
usedSlots?: array, // array of numbers
41+
}, {...}
42+
];
43+
~~~
44+
45+
### Parameters
46+
47+
For each card object you can specify the following parameters:
48+
49+
- `id` - (required) the ID of a card
50+
- `title` - (required) the title of a card (e.g., a specialist's name)
51+
- `category` - (optional) the category name of a card (e.g., a specialist's job)
52+
- `subtitle` - (optional) the subtitle of a card
53+
- `details` - (optional) other details of a card
54+
- `preview` - (optional) a card preview which is the link to the card image
55+
- `price` - (optional) the price of the service
56+
- `review` - (optional) rating information that includes the following parameters:
57+
- `star` - (optional) the number of rating stars (out of five)
58+
- `count` - (optional) the number of reviews
59+
- `slots` - (required) an array of objects with the following parameters for booking slots:
60+
- `from` - (required) a slot start time in hours from 0 to 24
61+
- `to` - (required) a slot end time in hours from 0 to 24
62+
- `size` - (optional) the duration of one slot in minutes TBD
63+
- `gap` - (optional) the gap between slots in minutes; 0 is set by default
64+
- `days` - (optional) days of the week when a slot is available for booking; possible values: from 0 to 6 where 0 is Sunday and 6 is Saturday; if no days are specified, all days are applied by default; if days are specified, the slot parameters (**to**, **from**, **size**, **gap**) defined for these days will be applied
65+
- `dates` - (optional) an array of timestamps in milliseconds which are exact dates when a slot is available; the slot parameters (**to**, **from**, **size**, **gap**) for these specified dates will be applied
66+
:::note
67+
Slot parameters specified for days will override common parameters defined for all days.
68+
Slot parameters specified for dates will override parameters defined for specific days and all days.
69+
If several slots objects are created for the same day, make sure that slots time ranges (**from** and **to**) do not overlap, otherwise, all slots data for these days will not be applied.
70+
:::
71+
- `availableSlots` - (optional) an array of timestamps of available slots in milliseconds; if available slots are specified here, all slots from the `slots` array are ignored (i.e., become unavailable)
72+
- `usedSlots` - (optional) an array of timestamps of booked slots in milliseconds; these slots are not visible for a user
73+
74+
### Example
75+
76+
~~~jsx {1-42,45}
77+
const cards = [
78+
{
79+
id: "1",
80+
title: "Debra Weeks",
81+
category: "Allergist",
82+
subtitle: "5 years of experience",
83+
details: "Silverstone Medical Center (Vanderbilt Avenue 13, Chestnut, New Zealand)",
84+
preview: "https://files.webix.com/30d/d34de82e0a8e3b561988a46ce1e86743/stock-photo-doc.jpg",
85+
price: "37 $",
86+
review: {
87+
star: 1,
88+
count: 40,
89+
},
90+
slots: [
91+
{
92+
//a common slot rule for all days except those specified for the days and dates below
93+
from: 14,
94+
to: 17,
95+
size: 30,
96+
gap: 10,
97+
},
98+
{
99+
//this rule is applied to days 2 and 5 (Tuesdays and Fridays) except
100+
//the Friday from the slot object below
101+
from: 12,
102+
to: 17,
103+
size: 50,
104+
gap: 20,
105+
days: [2,5],
106+
},
107+
{
108+
//this rule is applied to days 3 and 4 (Wed and Thu) and exact date
109+
from: 18,
110+
to: 20,
111+
size: 45,
112+
gap: 20,
113+
days: [1,3]
114+
dates: [1683234000000] // exact upcoming date (May 5, 2023, Friday)
115+
},
116+
],
117+
}, {...}
118+
];
119+
120+
new booking.Booking("#root", {
121+
cards,
122+
// other parameters
123+
});
124+
~~~
125+
126+
**Related articles:**
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
sidebar_label: cardShape
3+
title: cardShape
4+
description: You can learn about the cardShape config in the documentation of the DHTMLX JavaScript Booking library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Booking.
5+
---
6+
7+
# cardShape
8+
9+
### Description
10+
11+
@short: Optional. An object of settings for managing appearance of the information blocks
12+
13+
### Usage
14+
15+
~~~jsx {}
16+
cardShape?: {
17+
category?: boolean,
18+
details?: boolean,
19+
preview?: boolean,
20+
price?: boolean,
21+
review?: boolean,
22+
subtitle?: boolean,
23+
title?: boolean,
24+
};
25+
~~~
26+
27+
### Parameters
28+
29+
To configure the card appearance, in the **cardShape** object you can specify the following parameters (fields):
30+
31+
- `category` - (optional) shows/hides a booking category name
32+
- `details` - (optional) shows/hides a booking detail information
33+
- `preview` - (optional) shows/hides a booking preview image
34+
- `price` - (optional) shows/hides a booking price
35+
- `review` - (optional) shows/hides a booking rating information
36+
- `subtitle` - (optional) shows/hides a booking subtitle
37+
- `title` - (optional) shows/hides a booking title
38+
39+
### Default config
40+
41+
~~~jsx {}
42+
const defaultCardShape = {
43+
category: true,
44+
details: true,
45+
preview: true,
46+
price: true,
47+
review: true,
48+
subtitle: false,
49+
title: true,
50+
};
51+
~~~
52+
53+
### Example
54+
55+
~~~jsx {1-9,12}
56+
const cardShape = {
57+
preview: true,
58+
review: false,
59+
category: true,
60+
title: true,
61+
subtitle: false,
62+
price: true,
63+
details: false,
64+
};
65+
66+
new booking.Booking("#root", {
67+
cardShape,
68+
// other parameters
69+
});
70+
~~~
71+
72+
**Related articles:**
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
sidebar_label: filteredCards
3+
title: filteredCards
4+
description: You can learn about the filteredCards config in the documentation of the DHTMLX JavaScript Booking library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX Booking.
5+
---
6+
7+
# filteredCards
8+
9+
### Description
10+
11+
@short: Optional. An array of objects containing the filtered cards data
12+
13+
:::info
14+
If no filters are applied, the `filteredCards` data are the same as the [`cards`](/api/properties/sv_booking_cards) data
15+
:::
16+
17+
### Usage
18+
19+
~~~jsx {}
20+
filteredCards?: [
21+
{
22+
id: string | number,
23+
title: string,
24+
category?: string,
25+
subtitle?: string,
26+
details?: string,
27+
preview?: string, // url
28+
price?: string,
29+
review?: {
30+
star: number,
31+
count: number,
32+
},
33+
slots: [
34+
{
35+
from: number,
36+
to: number,
37+
size?: number,
38+
gap?: number,
39+
days?: array, // array of numbers
40+
dates?: array, // array of numbers
41+
}, {...}
42+
],
43+
availableSlots?: array, // array of numbers
44+
usedSlots?: array, // array of numbers
45+
}, {...}
46+
];
47+
~~~
48+
49+
### Parameters
50+
51+
For each filtered card you can specify the following parameters:
52+
53+
- `id` - (required) the ID of a card
54+
- `title` - (required) the title of a card (e.g., a specialist's name)
55+
- `category` - (optional) the category name of a card (e.g., a specialist's job)
56+
- `subtitle` - (optional) the subtitle of a card
57+
- `details` - (optional) other details of a card
58+
- `preview` - (optional) a card preview which is the link to the card image
59+
- `price` - (optional) the price of the service
60+
- `review` - (optional) rating information that includes the following parameters:
61+
- `star` - (optional) the number of rating stars (out of five)
62+
- `count` - (optional) the number of reviews
63+
- `slots` - (required) an array of objects with the following parameters for booking slots:
64+
- `from` - (required) a slot start time in hours from 0 to 24
65+
- `to` - (required) a slot end time in hours from 0 to 24
66+
- `size` - (optional) the duration of one slot in minutes TBD
67+
- `gap` - (optional) the gap between slots in minutes; 0 is set by default
68+
- `days` - (optional) days of the week when a slot is available for booking; possible values: from 0 to 6 where 0 is Sunday and 6 is Saturday; if no days are specified, all days are applied by default; if days are specified, the slot parameters (**to**, **from**, **size**, **gap**) defined for these days will be applied
69+
- `dates` - (optional) an array of timestamps in milliseconds which are exact dates when a slot is available; the slot parameters (**to**, **from**, **size**, **gap**) for these specified dates will be applied
70+
:::note
71+
Slot parameters specified for days will override common parameters defined for all days.
72+
Slot parameters specified for dates will override parameters defined for specific days and all days.
73+
If several slots objects are created for the same day, make sure that slots time ranges (**from** and **to**) do not overlap, otherwise, all slots data for these days will not be applied.
74+
:::
75+
- `availableSlots` - (optional) an array of timestamps of available slots in milliseconds; if available slots are specified here, all slots from the `slots` array are ignored (i.e., become unavailable)
76+
- `usedSlots` - (optional) an array of timestamps of booked slots in milliseconds; these slots are not visible for a user
77+
78+
### Example
79+
80+
~~~jsx {1-23,26}
81+
const cards = [
82+
{
83+
id: "5cf364d8-9997-4d8c-9586-48f90f3cb736",
84+
title: "Debra Weeks",
85+
category: "Allergist",
86+
subtitle: "7 years of experience",
87+
details: "Silverstone Medical Center (Vanderbilt Avenue 13, Chestnut, New Zealand)",
88+
preview: "https://files.webix.com/30d/d34de82e0a8e3b561988a46ce1e86743/stock-photo-doc.jpg",
89+
price: "40 $",
90+
review: {
91+
star: 1,
92+
count: 40,
93+
},
94+
slots: [
95+
{
96+
from: 14,
97+
to: 17,
98+
size: 30,
99+
gap: 10,
100+
}, {...}
101+
],
102+
}, {...}
103+
];
104+
105+
new booking.Booking("#root", {
106+
filteredCards,
107+
// other parameters
108+
});
109+
~~~
110+
111+
**Related articles:**

0 commit comments

Comments
 (0)