Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ac0dda7
[update] rewrite configuration guide via article-guide skill
serhiipylypchuk1991 May 26, 2026
da1ab1f
[update] rewrite initialization guide via article-guide skill
serhiipylypchuk1991 May 26, 2026
452cced
[update] rewrite loading-data guide via article-guide skill
serhiipylypchuk1991 May 26, 2026
b8c464e
[update] rewrite localization guide via article-guide skill
serhiipylypchuk1991 May 26, 2026
0b8ad3e
[update] rewrite saving-reservations guide via article-guide skill
serhiipylypchuk1991 May 26, 2026
c460d64
[update] rewrite styling guide via article-guide skill
serhiipylypchuk1991 May 27, 2026
18201dc
[update] rewrite angular integration guide via article-guide skill
serhiipylypchuk1991 May 27, 2026
6e1f0c8
[update] rewrite react integration guide via article-guide skill
serhiipylypchuk1991 May 27, 2026
c0f5adb
[update] rewrite vue integration guide via article-guide skill
serhiipylypchuk1991 May 27, 2026
6f0e36f
[update] rewrite svelte integration guide via article-guide skill
serhiipylypchuk1991 May 27, 2026
64ff782
[update] rewrite eventcalendar integration guide via article-guide skill
serhiipylypchuk1991 May 27, 2026
e09011b
[update] rewrite scheduler integration guide via article-guide skill
serhiipylypchuk1991 May 27, 2026
6dcfac7
[fix] remove gerund opener in integration guides
serhiipylypchuk1991 May 28, 2026
ccbe18c
[add] OpenGraph/Twitter meta and JSON-LD structured data
serhiipylypchuk1991 May 22, 2026
b757a65
[fix] correct API names in booking guides
serhiipylypchuk1991 Jun 10, 2026
9a7d0fd
[fix] correct API config reference docs
serhiipylypchuk1991 Jun 10, 2026
e9f599b
[fix] correct API events reference docs
serhiipylypchuk1991 Jun 10, 2026
b973f16
[fix] correct API methods reference docs
serhiipylypchuk1991 Jun 10, 2026
f3a9325
[fix] correct API internal reference docs
serhiipylypchuk1991 Jun 10, 2026
b6b20db
[update] normalize internal doc links to .md form
serhiipylypchuk1991 Jun 12, 2026
31f91c1
[update] align overview links with pivot convention
serhiipylypchuk1991 Jun 12, 2026
f422658
[update] use backticks for API names and values in docs
serhiipylypchuk1991 Jun 12, 2026
f4949e4
[fix] align API docs with widget source
serhiipylypchuk1991 Jun 12, 2026
b79a70d
[fix] align guides with widget source
serhiipylypchuk1991 Jun 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/api/config/booking-cardshape.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ cardShape?: {

### Parameters

In the **cardShape** object you can specify the following parameters (fields):
In the `cardShape` object you can specify the following parameters (fields):

- `category` - (optional) shows/hides a card's name
- `category` - (optional) shows/hides a category name
- `details` - (optional) shows/hides details
- `preview` - (optional) shows/hides a preview image
- `price` - (optional) shows/hides price
Expand All @@ -45,7 +45,7 @@ const defaultCardShape = {
preview: true,
price: true,
review: true,
subtitle: false,
subtitle: true,
title: true
};
~~~
Expand All @@ -70,10 +70,10 @@ The snippet below demonstrates how to configure what fields to display on the le
<iframe src="https://snippet.dhtmlx.com/6mxd7918?mode=result" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>

:::info
You can also configure the appearance of a card using the [`cardTemplate`](/api/config/booking-cardtemplate) property. If both `cardTemplate` and `cardShape` are applied, `cardTemplate` will override the `cardShape` settings.
You can also configure the appearance of a card using the [`cardTemplate`](api/config/booking-cardtemplate.md) property. If both `cardTemplate` and `cardShape` are applied, `cardTemplate` will override the `cardShape` settings.
:::

**Related articles:**
**Related articles**:

- [Defining the structure of cards](/guides/configuration/#defining-the-structure-of-cards)
- [`cardTemplate`](/api/config/booking-cardtemplate)
- [Defining the structure of cards](guides/configuration.md#define-the-structure-of-cards)
- [`cardTemplate`](api/config/booking-cardtemplate.md)
25 changes: 12 additions & 13 deletions docs/api/config/booking-cardtemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: You can learn about the cardTemplate config in the documentation of
The property specifies the HTML structure and layout of each card's block (the left side of each card). It means you can manage which fields are displayed, how they are arranged, and how they look.

:::info
You can also specify which fields to display using the [`cardShape`](/api/config/booking-cardshape) property
You can also specify which fields to display using the [`cardShape`](api/config/booking-cardshape.md) property
:::

### Usage
Expand All @@ -24,11 +24,11 @@ cardTemplate?: ({item: obj}) => string;

### Parameters

`cardTemplate` expects a function that takes a `card` object as input and returns a string of HTML that defines how the card should look.
`cardTemplate` expects a function that takes an `item` (card) object as input and returns a string of HTML that defines how the card should look.

### Example

In the example below we create a function that takes the `card` object and returns HTML for a card that includes a preview image (card.preview), category (card.category), title (card.title), and price (card.price). You need to create your own HTML template to be applied to a card and import the **template** helper. Then pass the function into the Booking configuration by assigning the function to the `cardTemplate` property.
In the example below we create a function that takes the `item` (card) object and returns HTML for a card that includes a preview image (item.preview), category (item.category), title (item.title), and price (item.price). You need to create your own HTML template to be applied to a card and import the `template` helper. Then pass the function into the Booking configuration by assigning the function to the `cardTemplate` property.

~~~html {}
<style>
Expand All @@ -51,29 +51,29 @@ In the example below we create a function that takes the `card` object and retur
<script>
const { Booking, template } = booking; //import template helper

function cardPreviewTemplate({ card }) {
function cardPreviewTemplate({ item }) {
return `
<div class="custom-preview" data-action="preview-click">
<div class="preview-left">
<div
style="background-image: url(${card.preview})"
style="background-image: url(${item.preview})"
class="card-photo"
></div>
<!-- <div class="card-photo-empty" /> -->
</div>

<div class="preview-right">
<div class="category">${card.category}</div>
<div class="title">${card.title}</div>
<div class="price">${card.price}</div>
<div class="category">${item.category}</div>
<div class="title">${item.title}</div>
<div class="price">${item.price}</div>
</div>
</div>
`;
}

const widget = new Booking("#root", {
data,
cardTemplate: template(card => cardPreviewTemplate(card)), // pass the function to Booking configuration
cardTemplate: template(item => cardPreviewTemplate(item)), // pass the function to Booking configuration

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, the old name - card - was better, since card is an object that contains a prop named item. passing item and then destructuring { item } is pretty confusing, I advise to return card

});
// other parameters
</script>
Expand All @@ -84,8 +84,7 @@ The snippet below demonstrates how to apply a template to the left block of a ca

<iframe src="https://snippet.dhtmlx.com/k2v01vng" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>

**Related articles:**

- [Defining the structure of cards](/guides/configuration/#defining-the-structure-of-cards)
- [`cardShape`](/api/config/booking-cardshape)
**Related articles**:

- [Defining the structure of cards](guides/configuration.md#define-the-structure-of-cards)
- [`cardShape`](api/config/booking-cardshape.md)
23 changes: 8 additions & 15 deletions docs/api/config/booking-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ data: [
stars: number,
count: number
},
slots: [
slots?: [
{
from: number | string, // hours from 0 to 24
to: number | string, // hours from 0 to 24
Expand All @@ -36,12 +36,7 @@ data: [
dates?: array, // exact dates for which rule can be applied, timestamps
}
],
availableSlots?: [
{
id: string|number,
time:[number, number] //timestamp, length in minutes
},
],
availableSlots?: [number, number][], // each slot: [timestamp, slot duration in minutes]
usedSlots?: number[], //timestamps
slotSize?: number, //minutes
slotGap?: number //minutes
Expand All @@ -63,23 +58,21 @@ For each card object you can specify the following parameters:
- `review` - (optional) rating information that includes the following parameters:
- `stars` - (optional) the number of rating stars (out of five)
- `count` - (optional) the number of reviews
- `slots` - (required) an array of objects with the following parameters for each slot object:
- `slots` - (optional) an array of objects that defines slot rules (either `slots` or `availableSlots` should be provided to display bookable time); each slot object has the following parameters:
- `from` - (required) a slot start time in hours from 0 to 24
- `to` - (required) a slot end time in hours from 0 to 24
- `size` - (optional) the duration of one slot in minutes
- `gap` - (optional) the gap between slots in minutes; 0 is set by default
- `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
- `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 (timestamps are in a local timezone)
- `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
- `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 (timestamps are in a local timezone)

:::note
Slot parameters specified for days will override common parameters defined for all days.
Slot parameters specified for dates will override parameters defined for specific days and all days.
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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 negations here make harder to understand what happens if rules conflict, I advise to phrase in a simpler way

:::

- `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:
- `id` - (required) the id of a slot
- `time` - (required) an array that includes timestamp and slot duration in minutes (timestamps are in a local timezone)
- `availableSlots` - (optional) an array of available slots; each slot is an array `[timestamp, duration]` where the timestamp is in milliseconds (in a local timezone) and the duration is the slot length in minutes; if available slots are specified here, all slots from the `slots` array are ignored (i.e., become unavailable)
- `usedSlots` - (optional) an array of timestamps of booked slots in milliseconds (timestamps are in a local timezone)
- `slotSize` - (optional) the duration of a slot in minutes; the value will be applied to all slots of this card if other value is not set inside the `slots` object; *60* minutes is set by default
- `slotGap` - (optional) the gap between slots in minutes that is set for all slots in the current card; this value is applied if any other value is not specified inside the `slots` object; 0 is set by default
Expand All @@ -98,7 +91,7 @@ const data = [
preview: "https://snippet.dhtmlx.com/codebase/data/booking/01/img/01.jpg",
price: "37 $",
review: {
star: 1,
stars: 1,
count: 40
},
slots: [
Expand Down Expand Up @@ -137,4 +130,4 @@ new booking.Booking("#root", {
});
~~~

**Related articles:** [Defining slot rules](/guides/configuration#defining-slot-rules)
**Related articles**: [Defining slot rules](guides/configuration.md#define-slot-rules)
2 changes: 1 addition & 1 deletion docs/api/config/booking-end.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ new booking.Booking("#root", {
});
~~~

The snippet below shows how to set the [start](/api/config/booking-start) and end dates:
The snippet below shows how to set the [start](api/config/booking-start.md) and end dates:

<iframe src="https://snippet.dhtmlx.com/cc28whe7?mode=result" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>
10 changes: 5 additions & 5 deletions docs/api/config/booking-filtershape.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ filterShape: {

### Parameters

- `text` - (optional) if **true**, the text input field is displayed (default); if **false**, the text field is hidden
- `text` - (optional) if `true`, the text input field is displayed (default); if `false`, the text field is hidden
- `id` - (required) the id of a card

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source (store/src/types.ts: TFilterText.id: keyof ICard) says it's a card field name (e.g. category, title)

- `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
- `suggest` - (optional) if `true`, the auto-complete is enabled and the values (from the [`data`](api/config/booking-data.md) object) that match a user's input text will be displayed
- `label` - (optional) the label for the property from the `data` object. See [Default config](#default-config) below.
- `date` - (optional) shows/hides the date field; **true** is set by default (the field is shown)
- `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:
- `date` - (optional) shows/hides the date field; `true` is set by default (the field is shown)
- `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:
- `from` - (required) the start time for a slot; it can be a number from 0 to 24 that specifies the time in hours (e.g., 9 means 9:00, 8.5 means 8:30) or a string in the format "h:m" (for example, "8:30")
- `to` - (required) the end time for a slot; it can be a number from 0 to 24 that specifies the time in hours (e.g., 9 means 9:00, 8.5 means 8:30) or a string in the format "h:m" (for example, "8:30")
- `label` - (optional) placeholder for the time field
If the `time` parameters are not set, the default values are applied: see [Default config](#default-config) below.
- `autoApply` - (optional) if **true**, the search criteria will be automatically applied (no need to initiate the search by clicking the button); **false** is set by default
- `autoApply` - (optional) if `true`, the search criteria will be automatically applied (no need to initiate the search by clicking the button); `false` is set by default

### Default config

Expand Down
20 changes: 12 additions & 8 deletions docs/api/config/booking-formshape.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,26 @@ description: You can learn about the formShape config in the documentation of th
### Usage

~~~jsx {}
formShape: {
formShape: [{
comp: "text" | "textarea",
key: string,
label?: string,
required?: boolean
};
required?: boolean,
validation?: (value: any) => boolean,
errorMessage?: string
}];
~~~

### Parameters

For each field you can specify the following parameters:

- `comp` - (required) the field type (**text** or **textarea**)
- `comp` - (required) the field type (`text` or `textarea`)
- `key` - (required) the id of a field
- `label` - (optional) the field label
- `required` - (optional) if the value is set to **true**, the field should not be empty and it's required to submit the booking form; if **false**, the field can be empty
- `required` - (optional) if the value is set to `true`, the field should not be empty and it's required to submit the booking form; if `false`, the field can be empty
- `validation` - (optional) a function that takes the field value and returns a boolean; the field is considered valid when the function returns `true`
- `errorMessage` - (optional) the message shown when the value does not pass validation

### Default config

Expand Down Expand Up @@ -68,17 +72,17 @@ const defaultFormShape = [
~~~jsx {1-17,21}
const formShape = [
{
type: "text",
comp: "text",
key: "name",
label: "Name"
},
{
type: "text",
comp: "text",
key: "contact",
label: "Mobile"
},
{
type: "textarea",
comp: "textarea",
key: "description",
label: "Details"
},
Expand Down
8 changes: 4 additions & 4 deletions docs/api/config/booking-infoshape.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ The snippet below shows how to configure what to display on the left side of the
<iframe src="https://snippet.dhtmlx.com/pd6wp1xc?mode=result" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>

:::info
You can also control which fields to display in the information block of the Booking dialog using the [`infoTemplate`](/api/config/booking-infotemplate) property. But if both properties are applied, `infoTemplate` will override the `infoShape` settings.
You can also control which fields to display in the information block of the Booking dialog using the [`infoTemplate`](api/config/booking-infotemplate.md) property. But if both properties are applied, `infoTemplate` will override the `infoShape` settings.
:::

**Related articles:**
**Related articles**:

- [Configuring the Booking dialog](/guides/configuration/#configuring-the-booking-dialog)
- [`infoTemplate`](/api/config/booking-infotemplate)
- [Configuring the Booking dialog](guides/configuration.md#configure-the-booking-dialog)
- [`infoTemplate`](api/config/booking-infotemplate.md)
10 changes: 5 additions & 5 deletions docs/api/config/booking-infotemplate.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ infoTemplate?: ({item: obj, slot: number}) => string;

### Example

In the example below, we define the `cardInfoTemplate` function that will generate the custom HTML for the information block. This function will receive the `item` (card object) and `slot` (slot timestamp) as input parameters. The function returns div containers representing the information block for a selected booking item, including an image, category, title, and formatted date. You should also import the **template** helper and assign your custom function to `infoTemplate`.
In the example below, we define the `cardInfoTemplate` function that will generate the custom HTML for the information block. This function will receive the `item` (card object) and `slot` (slot timestamp) as input parameters. The function returns div containers representing the information block for a selected booking item, including an image, category, title, and formatted date. You should also import the `template` helper and assign your custom function to `infoTemplate`.

~~~html
<style>
Expand Down Expand Up @@ -83,10 +83,10 @@ The snippet below shows how to apply a template to the information block of the
<iframe src="https://snippet.dhtmlx.com/byb94ipu?mode=result" frameborder="0" class="snippet_iframe" width="100%" height="600"></iframe>

:::info
You can also control which fields to display in the information block of the Booking dialog using the [`infoShape`](/api/config/booking-infoshape) property. But if both properties are applied, `infoTemplate` will override the `infoShape` settings.
You can also control which fields to display in the information block of the Booking dialog using the [`infoShape`](api/config/booking-infoshape.md) property. But if both properties are applied, `infoTemplate` will override the `infoShape` settings.
:::

**Related articles:**
**Related articles**:

- [Configuring the Booking dialog](/guides/configuration/#configuring-the-booking-dialog)
- [`infoShape`](/api/config/booking-infoshape)
- [Configuring the Booking dialog](guides/configuration.md#configure-the-booking-dialog)
- [`infoShape`](api/config/booking-infoshape.md)
12 changes: 6 additions & 6 deletions docs/api/config/booking-locale.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ locale?: object;

### Default config

By default, Booking uses the [English](/guides/localization/#default-locale) locale. You can set it to the custom locale as well.
By default, Booking uses the [English](guides/localization.md#default-locale) locale. You can set it to the custom locale as well.

:::tip
To change the current locale dynamically, you can use the [`setLocale()`](/api/methods/booking-setlocale-method) method
To change the current locale dynamically, you can use the [`setLocale()`](api/methods/booking-setlocale-method.md) method
:::

### Example

~~~jsx
const { data } = getData();
const booking = new booking.Booking("#root", {
const widget = new booking.Booking("#root", {
data,
locale: de
locale: booking.locales.de
});
~~~

**Related articles**:
- [setLocale()](/api/methods/booking-setlocale-method)
- [Localization](/guides/localization)
- [setLocale()](api/methods/booking-setlocale-method.md)
- [Localization](guides/localization.md)
4 changes: 2 additions & 2 deletions docs/api/config/booking-slotgap.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: You can learn about the slotGap in the documentation of the DHTMLX
@short: Optional. Defines a gap between booking slots for all cards

:::note
The value will be applied in case the gap value is not set for the `gap` or `slotGap` parameter inside the [`data`](/api/config/booking-data) property.
The value will be applied in case the gap value is not set for the `gap` or `slotGap` parameter inside the [`data`](api/config/booking-data.md) property.
:::

### Usage
Expand All @@ -35,6 +35,6 @@ new booking.Booking("#root", {
});
~~~

The snippet below shows how to set [duration](/api/config/booking-slotsize) and gap for all slots:
The snippet below shows how to set [duration](api/config/booking-slotsize.md) and gap for all slots:

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