-
Notifications
You must be signed in to change notification settings - Fork 0
Rewrite guides using skills #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from all commits
ac0dda7
da1ab1f
452cced
b8c464e
0b8ad3e
c460d64
18201dc
6e1f0c8
c0f5adb
6f0e36f
64ff782
e09011b
6dcfac7
ccbe18c
b757a65
9a7d0fd
e9f599b
b973f16
f3a9325
b6b20db
31f91c1
f422658
f4949e4
b79a70d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
@@ -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. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
@@ -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: [ | ||
|
|
@@ -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) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
|
|
||
There was a problem hiding this comment.
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, sincecardis an object that contains a prop nameditem. passingitemand then destructuring{ item }is pretty confusing, I advise to returncard