@timum/booking 1.11.6 → 1.13.0

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/README.md CHANGED
@@ -291,42 +291,50 @@ This object's options directly affect timum's behaviour or allow you to react to
291
291
  </tr>
292
292
  <tr>
293
293
  <td>tslRefs</td>
294
- <td>string/array, Reference(s) of specific appointments. For when you only want to share a selection of a resource's appointments.<br><em>Either this or refs (see above) must be defined.</em><br> Everything else is optional. <br>Can also be a url parameter.
295
- <br>You can also provide a list of string references. Booking.js will then load all appointments and corresponding resource information. If they belong to different resources, then bookingjs allows your customer to choose for which resource appointments should be displayed.
296
- <blockquote>
297
- Note: If this and ref are defined in conjunction:
298
- The following behaviour is not yet set in stone and may<b> change in the future. </b><br>
299
- First, bookingjs will load all appointments of the given resources. It then loads all the appointments defined in tslRefs. It then tries to match both results in the following way:<br><br>
300
- If a ref has none of it's appointments referenced in tslRef: <br>
301
- <ul>
302
- <li>allow the corresponding resource to be selected by the customer.</li>
303
- <li>show all free and bookable appointments of that resource.</li>
304
- </ul>
305
- <br>
306
- If a tslRef belongs to a resource also defined in ref:
307
- <ul>
308
- <li>allow the corresponding resource to be selected by the customer.</li>
309
- <li>show only the appointments defined in tslRefs. Discard all other appointments which would have otherwise been bookable.</li>
310
- </ul>
311
- <br>
312
- If a tslRef belongs to no resource defined in ref:
313
- <ul>
314
- <li>allow the corresponding resource to be selected by the customer.</li>
315
- <li>show (and load) only the corresponding appointment.</li>
316
- </ul>
317
- </blockquote>
294
+ <td>string/array, Reference(s) of specific appointments. For when you only want to share a selection of a resource's appointments.<br><em>Either this or refs (see above) must be defined.</em><br> Everything else is optional. <br>Can also be a url parameter.
295
+ <br>You can also provide a list of string references. Booking.js will then load all appointments and corresponding resource information. If they belong to different resources, then bookingjs allows your customer to choose for which resource appointments should be displayed.
296
+ <blockquote>
297
+ Note: If this and ref are defined in conjunction:
298
+ The following behaviour is not yet set in stone and may<b> change in the future. </b><br>
299
+ First, bookingjs will load all appointments of the given resources. It then loads all the appointments defined in tslRefs. It then tries to match both results in the following way:<br><br>
300
+ If a ref has none of it's appointments referenced in tslRef: <br>
301
+ <ul>
302
+ <li>allow the corresponding resource to be selected by the customer.</li>
303
+ <li>show all free and bookable appointments of that resource.</li>
304
+ </ul>
305
+ <br>
306
+ If a tslRef belongs to a resource also defined in ref:
307
+ <ul>
308
+ <li>allow the corresponding resource to be selected by the customer.</li>
309
+ <li>show only the appointments defined in tslRefs. Discard all other appointments which would have otherwise been bookable.</li>
310
+ </ul>
311
+ <br>
312
+ If a tslRef belongs to no resource defined in ref:
313
+ <ul>
314
+ <li>allow the corresponding resource to be selected by the customer.</li>
315
+ <li>show (and load) only the corresponding appointment.</li>
316
+ </ul>
317
+ </blockquote>
318
318
  </td>
319
- </tr>
320
- <tr>
319
+ </tr>
320
+ <tr>
321
321
  <td>prdRefs</td>
322
322
  <td>string/array, Reference(s) of specific products. For when you only want your customer to choose from a subset of your otherwise fully available list of active products.
323
323
  <blockquote>
324
324
  Note: If this and <code>tslRefs</code> are defined in conjunction:
325
325
  To facilitate a seamless booking process, all products linked to appointments or availabilities are made selectable for customers. This ensures that customers can always choose a product that grants access to the corresponding bookable timeslots referenced in <code>tslRefs</code>.
326
326
  Without this step, customers might be restricted by <code>prdRefs</code> from selecting certain products, rendering related appointments or availabilities unselectable. In this way, <code>tslRefs</code> has priority over this field.
327
- </blockquote>
328
- </td>
329
-
327
+ </blockquote>
328
+ </td>
329
+ </tr>
330
+ <tr>
331
+ <td>enableShowAllResourcesOption</td>
332
+ <td>boolean, This option determines whether the resource selection screen presents an "All" option for customers. When this flag is true, customers can choose to see and book from all available appointments across different resources in a single interface. <br><br>
333
+ If the customer selects the "All" option, the system displays all bookable appointments for each resource that match their selected time and product.<br><br>
334
+ To ensure good performance, the system will filter out duplicate appointments. For instance, if there are multiple appointments that start at the same time and offer the same service, only one of these will be shown, until booked at which point the next appointment in line will be loaded and displayed.
335
+ <br><br>
336
+ This feature is particularly useful when it's more important for customers to secure an appointment rather than choosing a specific resource. It allows for greater flexibility and ease in booking, especially during peak times or when specific resources may be limited.
337
+ </td>
330
338
  </tr>
331
339
  <tr>
332
340
  <td>platform</td>
@@ -401,6 +409,18 @@ This object's options directly affect timum's behaviour or allow you to react to
401
409
  <td>callbacks</td>
402
410
  <td>object, may contain various functions which allow to to run custom code in reaction to certain events. See below for a guide on how to do this. </td>
403
411
  </tr>
412
+ <tr>
413
+ <td>postMessageTarget</td>
414
+ <td>
415
+ string, URL of the parent site that receives callback events via the postMessage API. This property enables all callback events to be sent using the postMessage() method, which is particularly useful when using bookingjs within an <code>iframe</code>, as it restricts access to the parent site's JavaScript code.
416
+ <br>
417
+ The <code>event.data</code> object includes all parameters typically passed to callback functions, along with an <code>origin</code> field (always "bookingjs") and a <code>type</code> field that indicates the event's name. This <code>type</code> matches the name of the callback function you would use in a non-iframe scenario. Refer to the guide on callback functions for specifics on available event names.<br>
418
+ <blockquote>
419
+ <strong>Note:</strong> Setting this property overrides the <code>callback</code> property; all standard callbacks will instead trigger postMessage() events.
420
+ </blockquote>
421
+ </td>
422
+ </tr>
423
+
404
424
  <tr>
405
425
  <td>fields</td>
406
426
  <td>object, You can customise what information is demanded of your customers prior to booking. timum requires certain fields to work and has some optional fields it can parse. Fields other than those supported by timum can be evaluated in a callback (see the callback guide below for further info). All fields (yours too!) support localization and input validation.