@timum/booking 1.2.7 → 1.2.8

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
@@ -28,9 +28,9 @@ This documentation guides you through all the customization capabilities.
28
28
  - [Cancelation Related](#cancelation_related)
29
29
  - [Data Fetching Related](#data_fetching_related)
30
30
  - [Localisation](#localisation)
31
- - [How to Define Fields](#how_to_define_fields)
32
- - [Anatomy of a Field](#anatomy_of_a_field)
33
- - [An Example](#an_example)
31
+ - [Booking Form Fields](#bookingFormFields)
32
+ - [Custom Fields](#customFields)
33
+ - [Custom Field Example](#CustomFieldExample)
34
34
  - [The Scenario](#the_scenario)
35
35
  - [The Implementation](#the_implementation)
36
36
 
@@ -67,7 +67,7 @@ Add the following code to your webpage:
67
67
  ```html
68
68
  <div id="bookingjs" style="margin: 32px"></div>
69
69
  <script type="module">
70
- import * as timum from 'https://cdn.jsdelivr.net/npm/@timum/booking@0.8.0/build/timum-booking.js';
70
+ import * as timum from 'https://cdn.jsdelivr.net/npm/@timum/booking@1.2.8/build/timum-booking.js';
71
71
 
72
72
  timum.init({ ref: 'booking-widget-demo-resource@timum' });
73
73
  </script>
@@ -82,7 +82,7 @@ Alternatively, you can add `ref` to your url as a parameter. This allows you to
82
82
  ```html
83
83
  <div id="bookingjs" style="margin: 32px"></div>
84
84
  <script type="module">
85
- import * as timum from 'https://cdn.jsdelivr.net/npm/@timum/booking@0.8.0/build/timum-booking.js';
85
+ import * as timum from 'https://cdn.jsdelivr.net/npm/@timum/booking@1.2.8/build/timum-booking.js';
86
86
 
87
87
  timum.init(); //<- no need for the reference here
88
88
  </script>
@@ -334,7 +334,7 @@ All Booking related callbacks receive a <em>single obejct</em> as argument conta
334
334
  untouchedEnd: ISO String e.g: "2023-01-27T09:35:00+01:00" as the server sent it
335
335
  }
336
336
  ```
337
- - a `data` looking like this:
337
+ - a `data` object looking like this:
338
338
 
339
339
  ```javascript
340
340
  {
@@ -343,13 +343,13 @@ All Booking related callbacks receive a <em>single obejct</em> as argument conta
343
343
  email: 'string',
344
344
  agbs: 'bool'
345
345
 
346
- // plus whatever optional and/or custom fields you yourself has defined.
346
+ // plus whatever optional and/or custom fields you yourself have defined.
347
347
  // -> so the makeup of this object changes depending on your settings.
348
348
  }
349
349
 
350
350
  ```
351
351
 
352
- Additionally, `createBookingFailed` and `createBookingSuccessfull` also have a RTKQ `response` object in their respecive argument. See [here](https://redux-toolkit.js.org/rtk-query/usage-with-typescript#type-safe-error-handling) for a reference.
352
+ Additionally, `createBookingFailed` and `createBookingSuccessfull` also have a RTKQ `response` object in their respective argument. See [here](https://redux-toolkit.js.org/rtk-query/usage-with-typescript#type-safe-error-handling) for a reference.
353
353
 
354
354
  <a name=”cancelation_related”></a>
355
355
 
@@ -559,9 +559,9 @@ localization: {
559
559
  },
560
560
  ```
561
561
 
562
- <a name=”how_to_define_fields”></a>
562
+ <a name=”bookingFormFields”></a>
563
563
 
564
- #### How to define fields
564
+ #### Booking Form Fields
565
565
 
566
566
  You can customize the information you request from customers before booking by defining fields. The minimum required fields for timum are firstName, lastName, email, and agbs. By default, timum also requests mobile and message fields, but you can add your own fields as well.
567
567
 
@@ -622,9 +622,15 @@ The standard configuration can be overridden except for the aforementioned field
622
622
  },
623
623
  ```
624
624
 
625
- <a name=”anatomy_of_a_field”></a>
625
+ <a name=”customFields”></a>
626
626
 
627
- ##### Anatomy of a field
627
+ ##### Custom Fields
628
+
629
+ If the values retrieved via custom fields need to be transferred to timum backend as additional booking information, set the parameter `sendCustomValuesInMessage`. With this, the values of custom fields are attached to the customer message. They will be visible to the customer as well in booking confirmation mailings.
630
+
631
+ `sendCustomValuesInMessage: true, // necessary to transmit custom field values as part of the customer message`
632
+
633
+ Anatomy of a custom booking form field:
628
634
 
629
635
  ```
630
636
  <fieldName> : {
@@ -641,6 +647,10 @@ The standard configuration can be overridden except for the aforementioned field
641
647
  }
642
648
  ```
643
649
 
650
+ fieldName
651
+
652
+ - define a field name
653
+
644
654
  Depending on the type there are additional properties you can/must specify:
645
655
 
646
656
  - Type `text`:
@@ -665,9 +675,9 @@ Type `select`:
665
675
 
666
676
  - options: array of objects with structure { title: string, key: string }. The title is displayed and the key is passed in the data object to callbacks.
667
677
 
668
- <a name=”an_example”></a>
678
+ <a name=”CustomFieldExample”></a>
669
679
 
670
- ### An Example
680
+ ### Custom Field Example
671
681
 
672
682
  Here is an example tying all of the aforementioned concepts together.
673
683
  And [here](https://jsfiddle.net/timum/wov6pLk7/) is a fiddle containing the very example detailed in this chapter.
@@ -682,12 +692,12 @@ It is necessary to determine the gender of customers for a specific purpose. The
682
692
 
683
693
  #### The Implementation
684
694
 
685
- This is the base configuration. As it is it uses the standard field configuration shown in [How to define fields](#howToDefineFields).
695
+ This is the base configuration. As it uses the standard field configuration shown in [Booking form fields](#bookingFormFields) :
686
696
 
687
697
  ```html
688
698
  <div id="bookingjs" style="margin: 32px"></div>
689
699
  <script type="module">
690
- import * as timum from 'https://cdn.jsdelivr.net/npm/@timum/booking@0.8.0/build/timum-booking.js';
700
+ import * as timum from 'https://cdn.jsdelivr.net/npm/@timum/booking@1.2.8/build/timum-booking.js';
691
701
 
692
702
  timum.init({ ref: 'booking-widget-demo-resource@timum' });
693
703
  </script>
@@ -698,11 +708,12 @@ Let's add the necessary changes:
698
708
  ```html
699
709
  <div id="bookingjs" style="margin: 32px"></div>
700
710
  <script type="module">
701
- import * as timum from 'https://cdn.jsdelivr.net/npm/@timum/booking@0.8.0/build/timum-booking.js';
711
+ import * as timum from 'https://cdn.jsdelivr.net/npm/@timum/booking@1.2.8/build/timum-booking.js';
702
712
 
703
713
  timum.init(
704
714
  {
705
715
  ref: 'booking-widget-demo-resource@timum',
716
+
706
717
  fields: {
707
718
  // set these fields to undefined explicitly in order to remove them
708
719
  message: undefined,
@@ -756,7 +767,8 @@ Let's add the necessary changes:
756
767
  (value) => value === true
757
768
  ),
758
769
  },
759
- }
770
+ },
771
+ sendCustomValuesInMessage: true, // necessary to transmit custom field values as part of the customer message
760
772
 
761
773
  // now we need to add the new translation keys and their translations.
762
774
 
@@ -787,7 +799,7 @@ Let's add the necessary changes:
787
799
  },
788
800
  }
789
801
  }
790
- }
802
+ },
791
803
 
792
804
  // the following callback consumes the customers input, allowing you to act on
793
805
  //the entered gender value.
@@ -1,4 +1,4 @@
1
- import { D as e, F as l, E as t } from "./index-ce93f3a6.js";
1
+ import { D as e, F as l, E as t } from "./index-6afb67dd.js";
2
2
  export {
3
3
  e as default,
4
4
  l as getTableRowUtilityClass,
@@ -1,4 +1,4 @@
1
- import { o as e, q as s, p as t } from "./index-ce93f3a6.js";
1
+ import { o as e, q as s, p as t } from "./index-6afb67dd.js";
2
2
  export {
3
3
  e as default,
4
4
  s as getTableCellUtilityClass,
@@ -1,4 +1,4 @@
1
- import { k as e, n as l, m as t } from "./index-ce93f3a6.js";
1
+ import { k as e, n as l, m as t } from "./index-6afb67dd.js";
2
2
  export {
3
3
  e as default,
4
4
  l as getTableBodyUtilityClass,
@@ -1,4 +1,4 @@
1
- import { b as a, B as e, g as l } from "./index-ce93f3a6.js";
1
+ import { b as a, B as e, g as l } from "./index-6afb67dd.js";
2
2
  export {
3
3
  a as buttonClasses,
4
4
  e as default,
@@ -1,4 +1,4 @@
1
- import { r as b, s as f, u as m, v as F, w as d, _ as C, x as l, y as n, z as T, A as v, C as x } from "./index-ce93f3a6.js";
1
+ import { r as b, s as f, u as m, v as F, w as d, _ as C, x as l, y as n, z as T, A as v, C as x } from "./index-6afb67dd.js";
2
2
  function y(o) {
3
3
  return b("MuiTableFooter", o);
4
4
  }
@@ -1,4 +1,4 @@
1
- import { h as e, j as l, i as t } from "./index-ce93f3a6.js";
1
+ import { h as e, j as l, i as t } from "./index-6afb67dd.js";
2
2
  export {
3
3
  e as default,
4
4
  l as getTableUtilityClass,
@@ -1,4 +1,4 @@
1
- import { r as p, s as b, u as m, v as H, w as C, _ as T, x as r, y as n, z as f, A as h, C as v } from "./index-ce93f3a6.js";
1
+ import { r as p, s as b, u as m, v as H, w as C, _ as T, x as r, y as n, z as f, A as h, C as v } from "./index-6afb67dd.js";
2
2
  function x(e) {
3
3
  return p("MuiTableHead", e);
4
4
  }