Skip to content

Commit 3862013

Browse files
[update] style changes
1 parent 1ad6662 commit 3862013

40 files changed

Lines changed: 757 additions & 832 deletions

docs/api/config/booking-cardshape.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ To configure the card appearance, in the **cardShape** object you can specify th
3131
- `category` - (optional) shows/hides a card's name
3232
- `details` - (optional) shows/hides details
3333
- `preview` - (optional) shows/hides a preview image
34-
- `price` - (optional) shows/hides price
34+
- `price` - (optional) shows/hides price
3535
- `review` - (optional) shows/hides rating information
3636
- `subtitle` - (optional) shows/hides a card's subtitle
3737
- `title` - (optional) shows/hides a card's title
@@ -40,28 +40,28 @@ To configure the card appearance, in the **cardShape** object you can specify th
4040

4141
~~~jsx {}
4242
const defaultCardShape = {
43-
category: true,
44-
details: true,
45-
preview: true,
46-
price: true,
47-
review: true,
48-
subtitle: false,
49-
title: true,
43+
category: true,
44+
details: true,
45+
preview: true,
46+
price: true,
47+
review: true,
48+
subtitle: false,
49+
title: true
5050
};
5151
~~~
5252

5353
### Example
5454

5555
~~~jsx {}
5656
const cardShape = {
57-
review: false,
58-
subtitle: false,
59-
price: false,
57+
review: false,
58+
subtitle: false,
59+
price: false
6060
};
6161

6262
new booking.Booking("#root", {
63-
cardShape,
64-
// other parameters
63+
cardShape,
64+
// other parameters
6565
});
6666
~~~
6767

docs/api/config/booking-data.md

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,38 @@ description: You can learn about the cards config in the documentation of the DH
1414

1515
~~~jsx {}
1616
data: [
17-
{
18-
id: string | number,
19-
title: string,
20-
category?: string,
21-
subtitle?: string,
22-
details?: string,
23-
preview?: string, // link to image
24-
price?: string,
25-
review?: {
26-
stars: number,
27-
count: number,
28-
},
29-
slots: [
30-
{
31-
from: number | string, // hours from 0 to 24
32-
to: number | string, // hours from 0 to 24
33-
size?: number, // length of slot in minutes
34-
gap?: number, // gap between slots in minutes
35-
days?: array, // days of week for which rule can be applied from 0 to 6
36-
dates?: array, // exact dates for which rule can be applied, timestamps
37-
},
38-
],
39-
40-
availableSlots?: [
41-
{
42-
id: string|number,
43-
time:[number, number] //timestamp, length in minutes
44-
},
45-
],
46-
usedSlots?: number[], //timestamps
47-
slotSize?: number, //minutes
48-
slotGap?: number, //minutes
49-
},
17+
{
18+
id: string | number,
19+
title: string,
20+
category?: string,
21+
subtitle?: string,
22+
details?: string,
23+
preview?: string, // link to image
24+
price?: string,
25+
review?: {
26+
stars: number,
27+
count: number
28+
},
29+
slots: [
30+
{
31+
from: number | string, // hours from 0 to 24
32+
to: number | string, // hours from 0 to 24
33+
size?: number, // length of slot in minutes
34+
gap?: number, // gap between slots in minutes
35+
days?: array, // days of week for which rule can be applied from 0 to 6
36+
dates?: array, // exact dates for which rule can be applied, timestamps
37+
}
38+
],
39+
availableSlots?: [
40+
{
41+
id: string|number,
42+
time:[number, number] //timestamp, length in minutes
43+
},
44+
],
45+
usedSlots?: number[], //timestamps
46+
slotSize?: number, //minutes
47+
slotGap?: number //minutes
48+
}
5049
];
5150
~~~
5251

@@ -67,14 +66,15 @@ For each card object you can specify the following parameters:
6766
- `slots` - (required) an array of objects with the following parameters for each slot object:
6867
- `from` - (required) a slot start time in hours from 0 to 24
6968
- `to` - (required) a slot end time in hours from 0 to 24
70-
- `size` - (optional) the duration of one slot in minutes
69+
- `size` - (optional) the duration of one slot in minutes
7170
- `gap` - (optional) the gap between slots in minutes; 0 is set by default
7271
- `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
73-
- `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
72+
- `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
73+
7474
:::note
75-
Slot parameters specified for days will override common parameters defined for all days.
76-
Slot parameters specified for dates will override parameters defined for specific days and all days.
77-
If several slots objects are created for the same day, make sure that slots time ranges (from and to) with **different** size and gap do not overlap, otherwise all slots data for these days will not be applied.
75+
Slot parameters specified for days will override common parameters defined for all days.
76+
Slot parameters specified for dates will override parameters defined for specific days and all days.
77+
If several slots objects are created for the same day, make sure that slots time ranges (from and to) with **different** size and gap do not overlap, otherwise all slots data for these days will not be applied.
7878
:::
7979

8080
- `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); each object in the array has the next parameters:
@@ -86,7 +86,7 @@ If several slots objects are created for the same day, make sure that slots time
8686

8787
### Example
8888

89-
~~~jsx
89+
~~~jsx {}
9090
const data = [
9191
{
9292
id: "5cf364d8-9997-4d8c-9586-48f90f3cb736",
@@ -99,15 +99,15 @@ const data = [
9999
price: "37 $",
100100
review: {
101101
star: 1,
102-
count: 40,
102+
count: 40
103103
},
104104
slots: [
105105
{
106106
//a common slot rule for all days except those specified for the days and dates below
107107
from: 14,
108108
to: 17,
109109
size: 30,
110-
gap: 10,
110+
gap: 10
111111
},
112112
{
113113
//this rule is applied to days 2 and 5 (Tuesdays and Fridays) except
@@ -116,7 +116,7 @@ const data = [
116116
to: 17,
117117
size: 50,
118118
gap: 20,
119-
days: [2, 5],
119+
days: [2, 5]
120120
},
121121
{
122122
//this rule is applied to days 3 and 4 (Wednesdays and Thursdays) and exact date
@@ -126,13 +126,14 @@ const data = [
126126
gap: 20,
127127
days: [3, 4],
128128
dates: [ 1683234000000 ] // exact upcoming date (May 5, 2023, Friday)
129-
},
130-
],
131-
},]
132-
129+
}
130+
]
131+
}
132+
];
133+
133134
new booking.Booking("#root", {
134-
data,
135-
// other parameters
135+
data,
136+
// other parameters
136137
});
137138
~~~
138139

docs/api/config/booking-end.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ end?: Date;
2424

2525
~~~jsx {}
2626
new booking.Booking("#root", {
27-
data,
28-
end: new Date(2025, 11, 11),
29-
// other parameters
27+
data,
28+
end: new Date(2025, 11, 11),
29+
// other parameters
3030
});
3131
~~~
32-
33-

docs/api/config/booking-filtershape.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ filterShape: {
1717
text?: boolean | [{
1818
id: string,
1919
label?: string,
20-
suggest?: boolean,
20+
suggest?: boolean
2121
}],
2222
date?: boolean,
2323
time?: boolean | [{
2424
from: number | string,
2525
to: number | string,
26-
label?: string,
27-
}],
26+
label?: string
27+
}],
2828
autoApply?: boolean
2929
};
3030
~~~
@@ -33,7 +33,7 @@ filterShape: {
3333

3434
- `text` - (optional) if **true**, the text input field is displayed (default); if **false**, the text field is hidden
3535
- `id` - (required) the id of a card
36-
- `suggest` - (required) if **true**, the auto-complete is enabled and the values (from the [`data`](/api/config/booking-data) object) that match a user's input text will be displayed
36+
- `suggest` - (required) if **true**, the auto-complete is enabled and the values (from the [`data`](/api/config/booking-data) object) that match a user's input text will be displayed
3737
- `label` - (optional) the label for the property from the `data` object. See [Default config](#default-config) below.
3838
- `date` - (optional) shows/hides the date field; **true** is set by default (the field is shown)
3939
- `time` - (optional) shows/hides the time field. If set to **true**, it takes an array of objects with default time options for a slot. For each object you can specify the following parameters:
@@ -49,18 +49,18 @@ If the `time` parameters are not set, the default values are applied: see [Defau
4949
const defaultTimeRanges = [
5050
{ from: 8, to: 12, label: "Morning" },
5151
{ from: 12, to: 17, label: "Afternoon" },
52-
{ from: 17, to: 20, label: "Evening" },
52+
{ from: 17, to: 20, label: "Evening" }
5353
];
5454

5555
const defaultFilterShape = {
5656
text: [
5757
{ id: "category", label: "speciality", suggest: true },
5858
{ id: "title", label: "specialist", suggest: true },
59-
{ id: "details", label: "location" },
59+
{ id: "details", label: "location" }
6060
],
6161
date: true,
6262
time: defaultTimeRanges,
63-
autoApply: false,
63+
autoApply: false
6464
};
6565
~~~
6666

@@ -73,8 +73,8 @@ const filterShape = {
7373
time: [
7474
{ from: 8, to: 11, label: "Morning" },
7575
{ from: 12, to: 18, label: "Afternoon" },
76-
{ from: 18, to: 21, label: "Evening" },
77-
],
76+
{ from: 18, to: 21, label: "Evening" }
77+
]
7878
};
7979

8080
new booking.Booking("#root", {
@@ -86,4 +86,4 @@ new booking.Booking("#root", {
8686

8787
The snippet below demonstrates how to configure filter:
8888

89-
<iframe src="https://snippet.dhtmlx.com/b5uj78bs?mode=result" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>
89+
<iframe src="https://snippet.dhtmlx.com/b5uj78bs?mode=result" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>

0 commit comments

Comments
 (0)