@timum/booking 1.7.1 → 1.8.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 +90 -52
- package/build/booking.js +15324 -15250
- package/build/booking.umd.cjs +91 -91
- package/build/component/booking.js +13090 -13016
- package/build/component/booking.umd.cjs +80 -80
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ This documentation guides you through all the customization capabilities.
|
|
|
51
51
|
- Customizable wording across languages (availabe with professional plans)
|
|
52
52
|
- Dynamic definition of input fields with localized labels and validation (available with professional plans)
|
|
53
53
|
- Therefore, ability to request additional information from customers during booking process
|
|
54
|
-
- Support for multiple languages (English and German included) - add your own language
|
|
54
|
+
- Support for multiple languages (English, Italian, Spanish, French and German included) - add your own language
|
|
55
55
|
- Callbacks for custom code execution and event response (e.g. booking created, appointments loaded, booking canceled)
|
|
56
56
|
|
|
57
57
|
<a name=”how-to-integrate”></a>
|
|
@@ -335,6 +335,10 @@ This object's options directly affect timum's behaviour or allow you to react to
|
|
|
335
335
|
<tr>
|
|
336
336
|
<td>sendCustomValuesInMessage</td>
|
|
337
337
|
<td>boolean, whether values of custom fields are concatenated and comma-separated into a single string which is then sent to the backend as <code>message</code>. If field <code>message</code> is defined its input is concatenated to the generated string as well.</td>
|
|
338
|
+
</tr>
|
|
339
|
+
<tr>
|
|
340
|
+
<td>gatherAddressData</td>
|
|
341
|
+
<td>boolean, adds the fields <code>street</code>, <code>zipCode</code> and <code>city</code> in their default configuration to the booking page. You may also redefine/override them in the <code>fields</code> object, which supersedes this setting (needs professional plan). timum handles address data in a best effort basis, meaning it tries to parse the data and sync it to connected CRM systems, if possible.</td>
|
|
338
342
|
</tr>
|
|
339
343
|
<tr>
|
|
340
344
|
<td>channelKey</td>
|
|
@@ -453,7 +457,7 @@ Additionally, `cancelationSuccessful` and `cancelationFailed` also have a RTKQ r
|
|
|
453
457
|
|
|
454
458
|
##### Dialog related
|
|
455
459
|
|
|
456
|
-
In addition to the dialog related callbacks already mentioned in [Cancelation Related](#cancelation-related) and [Booking related](#booking-related), there
|
|
460
|
+
In addition to the dialog related callbacks already mentioned in [Cancelation Related](#cancelation-related) and [Booking related](#booking-related), there are callbacks for all other dialogs as well.
|
|
457
461
|
|
|
458
462
|
- `openedProductSelection`
|
|
459
463
|
- `openedResourceSelection`
|
|
@@ -549,7 +553,7 @@ In order to display public appointments, resource and calendar information timum
|
|
|
549
553
|
|
|
550
554
|
#### Localisation
|
|
551
555
|
|
|
552
|
-
timum booking has the ability to change all of its text. It comes with English and German pre-installed, but you can add additional translations as well. You can also change the text for these languages to your preference. You don't have to redefine the entire localization object; you can just add or change the specific texts you want. Any missing texts will be taken from the default.
|
|
556
|
+
timum booking has the ability to change all of its text. It comes with English, Italian, Spanish, French and German pre-installed, but you can add additional translations as well. You can also change the text for these languages to your preference. You don't have to redefine the entire localization object; you can just add or change the specific texts you want. Any missing texts will be taken from the default.
|
|
553
557
|
The code snippet provided shows the complete localization object and the standard text for both English and German. For each language, it includes text for different parts of the booking process such as product selection, appointment booking, appointment request, appointment cancellation, form fields, and more.
|
|
554
558
|
|
|
555
559
|
```javascript
|
|
@@ -666,7 +670,9 @@ localization: {
|
|
|
666
670
|
|
|
667
671
|
#### Booking Form Fields
|
|
668
672
|
|
|
669
|
-
You can customize the information you request from customers before booking by defining fields. The minimum required fields for timum are firstName
|
|
673
|
+
You can customize the information you request from customers before booking by defining fields. The minimum required fields for timum are <code>firstName</code>, <code>lastName</code>, <code>email</code>, and <code>agbs</code>. By default, timum also requests <code>mobile</code> and <code>message</code> fields, but you can add your own fields as well.
|
|
674
|
+
|
|
675
|
+
Supported, but not present by default are the fields <code>street</code>, <code>zipCode</code> and <code>city</code>. You can activate them setting <code>gatherAddressData</code>, or by redefining fields with the same name as custom fields (see below).
|
|
670
676
|
|
|
671
677
|
Fields, including custom ones, support validation and localization.
|
|
672
678
|
Validation is realized using the yup library, which is included with timum. You can import it using the following code:
|
|
@@ -680,55 +686,87 @@ Localization is achieved by using the title property in the field definition. Yo
|
|
|
680
686
|
The standard configuration can be overridden except for the aforementioned fields. The following is the standard configuration:
|
|
681
687
|
|
|
682
688
|
```javascript
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
lastName: {
|
|
689
|
-
title: 'fields.lastName',
|
|
690
|
-
validation: yup.string().required('validation.field_required'),
|
|
691
|
-
},
|
|
692
|
-
email: {
|
|
693
|
-
title: 'fields.email',
|
|
694
|
-
format: 'email',
|
|
695
|
-
type: 'text',
|
|
696
|
-
validation: yup
|
|
697
|
-
.string()
|
|
698
|
-
.email('validation.email_field_must_be_valid')
|
|
699
|
-
.required('validation.field_required'),
|
|
700
|
-
},
|
|
701
|
-
mobile: {
|
|
702
|
-
title: 'fields.mobile',
|
|
703
|
-
type: 'phoneNumber',
|
|
704
|
-
isRequired: false,
|
|
705
|
-
defaultCountry: 'DE',
|
|
706
|
-
preferredCountries: ['DE', 'CH', 'AT'],
|
|
707
|
-
// validation: is in built and ignored
|
|
708
|
-
},
|
|
709
|
-
message: {
|
|
710
|
-
title: 'fields.message',
|
|
711
|
-
type: 'textarea',
|
|
712
|
-
validation: yup.string().max(1024),
|
|
713
|
-
limit: 1024,
|
|
714
|
-
},
|
|
715
|
-
agbs: {
|
|
716
|
-
title: 'fields.accept_timum_privacy',
|
|
717
|
-
type: 'checkbox',
|
|
718
|
-
validation: yup
|
|
719
|
-
.boolean()
|
|
720
|
-
.required('validation.field_required')
|
|
721
|
-
.test(
|
|
722
|
-
'privacyAccepted',
|
|
723
|
-
'validation.privacy_field_required',
|
|
724
|
-
(value) => value === true
|
|
725
|
-
),
|
|
726
|
-
},
|
|
727
|
-
locale: {
|
|
728
|
-
index: 6,
|
|
729
|
-
preventRendering: true,
|
|
730
|
-
},
|
|
689
|
+
fields: {
|
|
690
|
+
firstName: {
|
|
691
|
+
index: 0,
|
|
692
|
+
title: 'fields.firstName',
|
|
693
|
+
validation: yup.string().required('validation.field_required'), // <- compare with key in localisation
|
|
731
694
|
},
|
|
695
|
+
lastName: {
|
|
696
|
+
index: 1,
|
|
697
|
+
title: 'fields.lastName',
|
|
698
|
+
validation: yup.string().required('validation.field_required'),
|
|
699
|
+
},
|
|
700
|
+
email: {
|
|
701
|
+
index: 2,
|
|
702
|
+
title: 'fields.email',
|
|
703
|
+
format: 'email',
|
|
704
|
+
type: 'text',
|
|
705
|
+
validation: yup
|
|
706
|
+
.string()
|
|
707
|
+
.email('validation.email_field_must_be_valid')
|
|
708
|
+
.required('validation.field_required'),
|
|
709
|
+
},
|
|
710
|
+
mobile: {
|
|
711
|
+
index: 3,
|
|
712
|
+
title: 'fields.mobile',
|
|
713
|
+
type: 'phoneNumber',
|
|
714
|
+
isRequired: false,
|
|
715
|
+
defaultCountry: 'DE',
|
|
716
|
+
preferredCountries: ['DE', 'CH', 'AT'],
|
|
717
|
+
// validation: is in built and ignored
|
|
718
|
+
},
|
|
719
|
+
street: {
|
|
720
|
+
index: 4,
|
|
721
|
+
title: 'fields.street',
|
|
722
|
+
validation: yup.string().required('validation.field_required'),
|
|
723
|
+
ignore: true, // gets filtered by default. Set gatherAddressData: true to activate this field. Or just add it to your custom field config.
|
|
724
|
+
},
|
|
725
|
+
zipCode: {
|
|
726
|
+
index: 5,
|
|
727
|
+
title: 'fields.zipCode',
|
|
728
|
+
validation: yup.string().required('validation.field_required'),
|
|
729
|
+
ignore: true, // gets filtered by default. Set gatherAddressData: true to activate this field. Or just add it to your custom field config.
|
|
730
|
+
},
|
|
731
|
+
city: {
|
|
732
|
+
index: 6,
|
|
733
|
+
title: 'fields.city',
|
|
734
|
+
validation: yup.string().required('validation.field_required'),
|
|
735
|
+
ignore: true, // gets filtered by default. Set gatherAddressData: true to activate this field. Or just add it to your custom field config.
|
|
736
|
+
},
|
|
737
|
+
message: {
|
|
738
|
+
index: 7,
|
|
739
|
+
title: 'fields.message',
|
|
740
|
+
type: 'textarea',
|
|
741
|
+
validation: yup
|
|
742
|
+
.string()
|
|
743
|
+
.max(1024)
|
|
744
|
+
.test(
|
|
745
|
+
'no-emojis',
|
|
746
|
+
'validation.no_emojis',
|
|
747
|
+
(value) => !RE_EMOJI.test(value),
|
|
748
|
+
),
|
|
749
|
+
limit: 1024,
|
|
750
|
+
onChange: (value) => value.replace(RE_EMOJI, ''),
|
|
751
|
+
},
|
|
752
|
+
agbs: {
|
|
753
|
+
index: 8,
|
|
754
|
+
title: 'fields.accept_timum_privacy',
|
|
755
|
+
type: 'checkbox',
|
|
756
|
+
validation: yup
|
|
757
|
+
.boolean()
|
|
758
|
+
.required('validation.field_required')
|
|
759
|
+
.test(
|
|
760
|
+
'privacyAccepted',
|
|
761
|
+
'validation.privacy_field_required',
|
|
762
|
+
(value) => value === true,
|
|
763
|
+
),
|
|
764
|
+
},
|
|
765
|
+
locale: {
|
|
766
|
+
index: 9,
|
|
767
|
+
preventRendering: true,
|
|
768
|
+
},
|
|
769
|
+
},
|
|
732
770
|
```
|
|
733
771
|
|
|
734
772
|
<a name=”customFields”></a>
|