@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 +31 -19
- package/build/{index-be92daab.js → index-02ba7778.js} +1 -1
- package/build/{index-90d17811.js → index-0d873894.js} +1 -1
- package/build/{index-d0ca0177.js → index-0e122624.js} +1 -1
- package/build/{index-6c98a490.js → index-1b2c9a99.js} +1 -1
- package/build/{index-a5d163ff.js → index-3e56055e.js} +1 -1
- package/build/{index-ea0cf155.js → index-50cab4e1.js} +1 -1
- package/build/{index-203f7a6c.js → index-60c3bb23.js} +1 -1
- package/build/{index-ce93f3a6.js → index-6afb67dd.js} +6649 -6630
- package/build/{index-8ff7ccf7.js → index-810e1dc6.js} +1 -1
- package/build/{index-2aaa432f.js → index-8a0e9317.js} +1 -1
- package/build/{index-abd09dcb.js → index-8ebc4db9.js} +1 -1
- package/build/timum-booking.js +1 -1
- package/build/timum-booking.umd.cjs +77 -77
- package/package.json +1 -1
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
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
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@
|
|
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@
|
|
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
|
|
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
|
|
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=”
|
|
562
|
+
<a name=”bookingFormFields”></a>
|
|
563
563
|
|
|
564
|
-
####
|
|
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=”
|
|
625
|
+
<a name=”customFields”></a>
|
|
626
626
|
|
|
627
|
-
#####
|
|
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=”
|
|
678
|
+
<a name=”CustomFieldExample”></a>
|
|
669
679
|
|
|
670
|
-
###
|
|
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
|
|
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@
|
|
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@
|
|
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 { 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-
|
|
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 { 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-
|
|
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
|
}
|