@timum/booking 1.2.8 → 1.3.2
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 +74 -33
- package/build/{timum-booking.js → booking.js} +1 -1
- package/build/booking.umd.cjs +1252 -0
- package/build/{index-0d873894.js → index-0ee25b5d.js} +1 -1
- package/build/{index-1b2c9a99.js → index-344bc0a4.js} +1 -1
- package/build/{index-810e1dc6.js → index-3c0a5a28.js} +1 -1
- package/build/{index-8a0e9317.js → index-6396e69f.js} +1 -1
- package/build/{index-3e56055e.js → index-6b79b6c4.js} +1 -1
- package/build/{index-50cab4e1.js → index-6f59f9d1.js} +1 -1
- package/build/{index-6afb67dd.js → index-82388012.js} +28042 -27918
- package/build/{index-02ba7778.js → index-a6615eb5.js} +1 -1
- package/build/{index-8ebc4db9.js → index-bcc7ea1d.js} +1 -1
- package/build/{index-60c3bb23.js → index-c0dc40f8.js} +1 -1
- package/build/{index-0e122624.js → index-cd2f0d00.js} +1 -1
- package/examples/callbacks.htm +1 -1
- package/examples/docuExample.htm +1 -1
- package/examples/fields.htm +1 -1
- package/examples/fullExample.htm +1 -1
- package/examples/list-view.htm +1 -1
- package/examples/local-language.htm +1 -1
- package/examples/local-preset.htm +1 -1
- package/examples/local-strings.htm +1 -1
- package/examples/multiple.htm +1 -1
- package/examples/selectable-product.htm +1 -1
- package/examples/usingChannelId.htm +1 -1
- package/examples/usingChannelKeyAndResourceRef.htm +1 -1
- package/examples/usingFullCalendar.htm +1 -1
- package/package.json +16 -7
- package/remTags.bat +14 -0
- package/vite.config.js +2 -1
- package/build/timum-booking.umd.cjs +0 -1238
package/README.md
CHANGED
|
@@ -47,9 +47,9 @@ This documentation guides you through all the customization capabilities.
|
|
|
47
47
|
- Prebooking period option - prevents booking if appointment is too soon from now
|
|
48
48
|
- Double booking prevention
|
|
49
49
|
- Cancelling appointment by customer with proper authentication
|
|
50
|
-
- Fully customizable look and feel with mui theming (available with
|
|
51
|
-
- Customizable wording across languages (availabe with
|
|
52
|
-
- Dynamic definition of input fields with localized labels and validation (available with
|
|
50
|
+
- Fully customizable look and feel with mui theming (available with professional plans)
|
|
51
|
+
- Customizable wording across languages (availabe with professional plans)
|
|
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
54
|
- Support for multiple languages (English 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)
|
|
@@ -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.
|
|
70
|
+
import * as timum from 'https://cdn.timum.de/bookingjs/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.
|
|
85
|
+
import * as timum from 'https://cdn.timum.de/bookingjs/booking.js';
|
|
86
86
|
|
|
87
87
|
timum.init(); //<- no need for the reference here
|
|
88
88
|
</script>
|
|
@@ -92,7 +92,7 @@ Alternatively, you can add `ref` to your url as a parameter. This allows you to
|
|
|
92
92
|
|
|
93
93
|
### As ESM import
|
|
94
94
|
|
|
95
|
-
1. Add timum
|
|
95
|
+
1. Add timum booking to your project with
|
|
96
96
|
`yarn add @timum/booking`
|
|
97
97
|
or use npm with
|
|
98
98
|
`npm install @timum/booking`
|
|
@@ -212,7 +212,7 @@ See [here](https://mui.com/) for a general overview. <br> See [here](https://mui
|
|
|
212
212
|
|
|
213
213
|
When you open the file `config.js` in [this](https://stackblitz.com/edit/react-8q6r8b?file=src/index.js) example, you can find an elaborate custom configuration which includes a redesign of the standard timum theme.
|
|
214
214
|
|
|
215
|
-
Needs
|
|
215
|
+
Needs professional plan.
|
|
216
216
|
|
|
217
217
|
<a name=”fc_config”></a>
|
|
218
218
|
|
|
@@ -223,6 +223,29 @@ See [here](https://fullcalendar.io/docs#toc) for a full list of configuration op
|
|
|
223
223
|
|
|
224
224
|
> Note that since fullCalendar isn't mui based, it does not consider the muiTheme object.
|
|
225
225
|
|
|
226
|
+
There are also some options specific to bookingjs. In addition to the configuration options of fullcalendar the following options are also available (all of them are optional):
|
|
227
|
+
|
|
228
|
+
<table>
|
|
229
|
+
<tr>
|
|
230
|
+
<th>Property</th>
|
|
231
|
+
<th>Description</th>
|
|
232
|
+
</tr>
|
|
233
|
+
<tr>
|
|
234
|
+
<td>largeView</td>
|
|
235
|
+
<td>string, Determines which <code>view</code> is displayed for screen widths <i>greater</i> 601px. <br>Please refer to the fullcalendar docs linked above for an overview of applicable values. </td>
|
|
236
|
+
</tr>
|
|
237
|
+
<tr>
|
|
238
|
+
<td>smallView</td>
|
|
239
|
+
<td>string, Determines which <code>view</code> is displayed for screen widths <i>smaller</i> 601px. <br> Please refer to the fullcalendar docs linked above for an overview of applicable values.
|
|
240
|
+
</td>
|
|
241
|
+
</tr>
|
|
242
|
+
<tr>
|
|
243
|
+
<td>useCustomTimumCss</td>
|
|
244
|
+
<td>boolean, to increase responsiveness, timum overrides some fullcalendar css classes. Set this to <code>false</code> to gain total control over fullcalendar's css.
|
|
245
|
+
</td>
|
|
246
|
+
</tr>
|
|
247
|
+
</table>
|
|
248
|
+
|
|
226
249
|
<a name=”app_config”></a>
|
|
227
250
|
|
|
228
251
|
### appConfig
|
|
@@ -238,6 +261,25 @@ This object's options directly affect timum's behaviour or allow you to react to
|
|
|
238
261
|
<td>ref</td>
|
|
239
262
|
<td>string, Reference of the resource to show the appointments of. <br><em> This is the only prop that is mandatory.</em><br> Everything else is optional. <br>Can also be a url parameter.</td>
|
|
240
263
|
</tr>
|
|
264
|
+
<tr>
|
|
265
|
+
<td>platform</td>
|
|
266
|
+
<td>string, A fully qualified reference (<code>id@someUuid@platform</code>) can be unwieldy especially if used as a url param. This prop allows you to hardcode the <code>platform</code> part.
|
|
267
|
+
<br><br>Note that this prop is ignored if <code>ref</code> is both:
|
|
268
|
+
<ul>
|
|
269
|
+
<li>used as a url param </li>
|
|
270
|
+
<li>contains an @.</li>
|
|
271
|
+
</ul>
|
|
272
|
+
</td>
|
|
273
|
+
</tr>
|
|
274
|
+
<tr>
|
|
275
|
+
<td>prvUuid</td>
|
|
276
|
+
<td>string, A fully qualified reference (<code>id@someUuid@platform</code>) can be unwieldy especially if used as a url param. This prop allows you to hardcode the <code>someUuid</code> part. This part is only sometimes necessary to uniquely identify a resource in timum. <br><br>Note that this prop is ignored if <code>ref</code> is both:
|
|
277
|
+
<ul>
|
|
278
|
+
<li>used as a url param </li>
|
|
279
|
+
<li>contains an @.</li>
|
|
280
|
+
</ul>
|
|
281
|
+
</td>
|
|
282
|
+
</tr>
|
|
241
283
|
<tr>
|
|
242
284
|
<td>height</td>
|
|
243
285
|
<td> string, Height of timum on your page. `500px` is standard.</td>
|
|
@@ -248,7 +290,7 @@ This object's options directly affect timum's behaviour or allow you to react to
|
|
|
248
290
|
</tr>
|
|
249
291
|
<tr>
|
|
250
292
|
<td>hideTimumFooter</td>
|
|
251
|
-
<td>boolean, whether 'powered by timum' can be hidden or not. Needs
|
|
293
|
+
<td>boolean, whether 'powered by timum' can be hidden or not. Needs professional plan.</td>
|
|
252
294
|
</tr>
|
|
253
295
|
<tr>
|
|
254
296
|
<td>sendCustomValuesInMessage</td>
|
|
@@ -290,14 +332,14 @@ This object's options directly affect timum's behaviour or allow you to react to
|
|
|
290
332
|
<td>fields</td>
|
|
291
333
|
<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.
|
|
292
334
|
<br>
|
|
293
|
-
Needs
|
|
335
|
+
Needs professional plan.
|
|
294
336
|
</td>
|
|
295
337
|
</tr>
|
|
296
338
|
<tr>
|
|
297
339
|
<td>localization</td>
|
|
298
340
|
<td>object. Contains all localization variables and their standard texts. timum nativly supports English and German. Use this to override the standard text and/or add translations for your custom field labels and input validations (see the localisation guide for mor info.)
|
|
299
341
|
<br>
|
|
300
|
-
Needs
|
|
342
|
+
Needs professional plan.
|
|
301
343
|
</td>
|
|
302
344
|
</tr>
|
|
303
345
|
</table>
|
|
@@ -628,7 +670,7 @@ The standard configuration can be overridden except for the aforementioned field
|
|
|
628
670
|
|
|
629
671
|
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
672
|
|
|
631
|
-
|
|
673
|
+
`sendCustomValuesInMessage: true, // necessary to transmit custom field values as part of the customer message`
|
|
632
674
|
|
|
633
675
|
Anatomy of a custom booking form field:
|
|
634
676
|
|
|
@@ -649,7 +691,7 @@ Anatomy of a custom booking form field:
|
|
|
649
691
|
|
|
650
692
|
fieldName
|
|
651
693
|
|
|
652
|
-
|
|
694
|
+
- define a field name
|
|
653
695
|
|
|
654
696
|
Depending on the type there are additional properties you can/must specify:
|
|
655
697
|
|
|
@@ -697,7 +739,7 @@ This is the base configuration. As it uses the standard field configuration show
|
|
|
697
739
|
```html
|
|
698
740
|
<div id="bookingjs" style="margin: 32px"></div>
|
|
699
741
|
<script type="module">
|
|
700
|
-
import * as timum from 'https://cdn.
|
|
742
|
+
import * as timum from 'https://cdn.timum.de/bookingjs/1/booking.js';
|
|
701
743
|
|
|
702
744
|
timum.init({ ref: 'booking-widget-demo-resource@timum' });
|
|
703
745
|
</script>
|
|
@@ -708,10 +750,9 @@ Let's add the necessary changes:
|
|
|
708
750
|
```html
|
|
709
751
|
<div id="bookingjs" style="margin: 32px"></div>
|
|
710
752
|
<script type="module">
|
|
711
|
-
import * as timum from 'https://cdn.
|
|
753
|
+
import * as timum from 'https://cdn.timum.de/bookingjs/1/booking.js';
|
|
712
754
|
|
|
713
|
-
timum.init(
|
|
714
|
-
{
|
|
755
|
+
timum.init({
|
|
715
756
|
ref: 'booking-widget-demo-resource@timum',
|
|
716
757
|
|
|
717
758
|
fields: {
|
|
@@ -722,12 +763,12 @@ Let's add the necessary changes:
|
|
|
722
763
|
// index defines the order in which the fields get displayed
|
|
723
764
|
index: 0,
|
|
724
765
|
title: 'fields.firstName',
|
|
725
|
-
validation: yup.string().required('validation.field_required')
|
|
766
|
+
validation: yup.string().required('validation.field_required') // <- compare with key in localisation
|
|
726
767
|
},
|
|
727
768
|
lastName: {
|
|
728
769
|
index: 1,
|
|
729
770
|
title: 'fields.lastName',
|
|
730
|
-
validation: yup.string().required('validation.field_required')
|
|
771
|
+
validation: yup.string().required('validation.field_required')
|
|
731
772
|
},
|
|
732
773
|
email: {
|
|
733
774
|
index: 2,
|
|
@@ -737,7 +778,7 @@ Let's add the necessary changes:
|
|
|
737
778
|
validation: yup
|
|
738
779
|
.string()
|
|
739
780
|
.email('validation.email_field_must_be_valid')
|
|
740
|
-
.required('validation.field_required')
|
|
781
|
+
.required('validation.field_required')
|
|
741
782
|
},
|
|
742
783
|
gender: {
|
|
743
784
|
index: 3,
|
|
@@ -751,8 +792,8 @@ Let's add the necessary changes:
|
|
|
751
792
|
options: [
|
|
752
793
|
{ key: 'm', title: 'fields.gender.male' },
|
|
753
794
|
{ key: 'w', title: 'fields.gender.female' },
|
|
754
|
-
{ key: 'd', title: 'fields.gender.other' }
|
|
755
|
-
]
|
|
795
|
+
{ key: 'd', title: 'fields.gender.other' }
|
|
796
|
+
]
|
|
756
797
|
},
|
|
757
798
|
agbs: {
|
|
758
799
|
index: 4,
|
|
@@ -765,8 +806,8 @@ Let's add the necessary changes:
|
|
|
765
806
|
'privacyAccepted',
|
|
766
807
|
'validation.privacy_field_required',
|
|
767
808
|
(value) => value === true
|
|
768
|
-
)
|
|
769
|
-
}
|
|
809
|
+
)
|
|
810
|
+
}
|
|
770
811
|
},
|
|
771
812
|
sendCustomValuesInMessage: true, // necessary to transmit custom field values as part of the customer message
|
|
772
813
|
|
|
@@ -783,20 +824,20 @@ Let's add the necessary changes:
|
|
|
783
824
|
male: 'Männlich',
|
|
784
825
|
female: 'Weiblich',
|
|
785
826
|
other: 'Divers'
|
|
786
|
-
}
|
|
827
|
+
}
|
|
787
828
|
}
|
|
788
829
|
},
|
|
789
830
|
en: {
|
|
790
|
-
|
|
831
|
+
validation: {
|
|
791
832
|
gender_field_required: 'Please select an option.'
|
|
792
833
|
},
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
834
|
+
fields: {
|
|
835
|
+
gender: {
|
|
836
|
+
title: 'Gender',
|
|
837
|
+
male: 'Male',
|
|
838
|
+
female: 'Female',
|
|
839
|
+
other: 'Others'
|
|
840
|
+
}
|
|
800
841
|
}
|
|
801
842
|
}
|
|
802
843
|
},
|
|
@@ -804,7 +845,7 @@ Let's add the necessary changes:
|
|
|
804
845
|
// the following callback consumes the customers input, allowing you to act on
|
|
805
846
|
//the entered gender value.
|
|
806
847
|
callback: {
|
|
807
|
-
createBookingStarted: ({data}) => {
|
|
848
|
+
createBookingStarted: ({ data }) => {
|
|
808
849
|
console.log(data.gender);
|
|
809
850
|
}
|
|
810
851
|
}
|